diff --git a/Machines/Atari2600/Atari2600.cpp b/Machines/Atari2600/Atari2600.cpp index d88da666b..3ea6d2703 100644 --- a/Machines/Atari2600/Atari2600.cpp +++ b/Machines/Atari2600/Atari2600.cpp @@ -217,7 +217,7 @@ void Machine::output_pixels(unsigned int count) { OutputState state; - // determine which output will start in four cycles + // determine which output state will be active in four cycles from now switch(_horizontalTimer >> 2) { case 56: case 0: case 1: case 2: state = OutputState::Blank; break; @@ -235,6 +235,11 @@ void Machine::output_pixels(unsigned int count) state = (state = OutputState::Sync) ? OutputState::Blank : OutputState::Sync; } + // honour the vertical blank flag + if(_vBlankEnabled && state == OutputState::Pixel) { + state = OutputState::Blank; + } + // write that state as the one that will become effective in four clocks _upcomingEvents[(_upcomingEventsPointer+4)%number_of_upcoming_events].state = state; @@ -352,13 +357,6 @@ unsigned int Machine::perform_bus_operation(CPU6502::BusOperation operation, uin output_pixels(cycles_run_for * 3); -// if(_hMoveWillCount) { -// _hMoveCounter = 0x0f; -// _hMoveFlags = 0x1f; -// _hMoveIsCounting = true; -// _hMoveWillCount = false; -// } - if(operation != CPU6502::BusOperation::Ready) { // check for a paging access