Skip to content

Commit

Permalink
Debugger: GB - Fixed crash when processing halt op code in some scena…
Browse files Browse the repository at this point in the history
…rios
  • Loading branch information
SourMesen committed Jul 6, 2023
1 parent a1cd60b commit f5c9a72
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Core/Gameboy/GbCpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -805,10 +805,12 @@ void GbCpu::HALT()
_state.HaltCounter = 1;
} else {
//HALT bug, execution continues, but PC isn't incremented for the first byte
#ifndef DUMMYCPU
HalfCycle();
uint8_t opCode = ReadMemory<MemoryOperationType::ExecOpCode, GbOamCorruptionType::Read>(_state.PC);
HalfCycle();
ExecOpCode(opCode);
#endif
}
}

Expand Down

0 comments on commit f5c9a72

Please sign in to comment.