mirror of https://github.com/mgba-emu/mgba.git
SM83: Fix runloop early exit when event happens outside FETCH
This commit is contained in:
parent
5cd21c6798
commit
2e6f8b4af9
|
@ -178,10 +178,11 @@ void SM83Tick(struct SM83Core* cpu) {
|
||||||
void SM83Run(struct SM83Core* cpu) {
|
void SM83Run(struct SM83Core* cpu) {
|
||||||
bool running = true;
|
bool running = true;
|
||||||
while (running || cpu->executionState != SM83_CORE_FETCH) {
|
while (running || cpu->executionState != SM83_CORE_FETCH) {
|
||||||
if (cpu->cycles >= cpu->nextEvent) {
|
if (cpu->cycles < cpu->nextEvent) {
|
||||||
|
running = _SM83TickInternal(cpu) && running;
|
||||||
|
} else {
|
||||||
cpu->irqh.processEvents(cpu);
|
cpu->irqh.processEvents(cpu);
|
||||||
break;
|
running = false;
|
||||||
}
|
}
|
||||||
running = _SM83TickInternal(cpu) && running;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue