mirror of https://github.com/mgba-emu/mgba.git
Partially revert "GB: Fix execution state and HALT getting out of sync"
This reverts commit 5d9e4d217a
.
This commit is contained in:
parent
e104b46564
commit
c9145e18d7
|
@ -622,8 +622,6 @@ void GBProcessEvents(struct LR35902Core* cpu) {
|
|||
}
|
||||
if (cpu->halted) {
|
||||
cpu->cycles = cpu->nextEvent;
|
||||
cpu->executionState += cpu->nextEvent;
|
||||
cpu->executionState &= 3;
|
||||
if (!gb->memory.ie || !gb->memory.ime) {
|
||||
break;
|
||||
}
|
||||
|
@ -681,8 +679,6 @@ static void _enableInterrupts(struct mTiming* timing, void* user, uint32_t cycle
|
|||
void GBHalt(struct LR35902Core* cpu) {
|
||||
struct GB* gb = (struct GB*) cpu->master;
|
||||
if (!(gb->memory.ie & gb->memory.io[REG_IF])) {
|
||||
cpu->executionState += cpu->nextEvent - cpu->cycles;
|
||||
cpu->executionState &= 3;
|
||||
cpu->cycles = cpu->nextEvent;
|
||||
cpu->halted = true;
|
||||
} else if (gb->model < GB_MODEL_CGB) {
|
||||
|
|
Loading…
Reference in New Issue