GB: Halt bug emulation
This commit is contained in:
parent
c47f0d642f
commit
f75ca7c5d0
1 changed files with 9 additions and 2 deletions
|
@ -731,8 +731,15 @@ void GbCpu::STOP()
|
|||
|
||||
void GbCpu::HALT()
|
||||
{
|
||||
//TODO: HALT BUG emulation
|
||||
_state.Halted = true;
|
||||
if(_state.IME || _memoryManager->ProcessIrqRequests() == 0) {
|
||||
_state.Halted = true;
|
||||
} else {
|
||||
//HALT bug, execution continues, but PC isn't incremented for the first byte
|
||||
HalfCycle();
|
||||
uint8_t opCode = _memoryManager->Read<MemoryOperationType::ExecOpCode>(_state.PC);
|
||||
HalfCycle();
|
||||
ExecOpCode(opCode);
|
||||
}
|
||||
}
|
||||
|
||||
// cpl 2F 4 -11- A = A xor FF
|
||||
|
|
Loading…
Add table
Reference in a new issue