mirror of https://github.com/mgba-emu/mgba.git
Tighter looping for ARMRun
This commit is contained in:
parent
61c410154f
commit
433f0ba360
|
@ -291,3 +291,14 @@ void ARMRun(struct ARMCore* cpu) {
|
||||||
cpu->irqh.processEvents(cpu);
|
cpu->irqh.processEvents(cpu);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ARMRunLoop(struct ARMCore* cpu) {
|
||||||
|
while (cpu->cycles < cpu->nextEvent) {
|
||||||
|
if (cpu->executionMode == MODE_THUMB) {
|
||||||
|
ThumbStep(cpu);
|
||||||
|
} else {
|
||||||
|
ARMStep(cpu);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cpu->irqh.processEvents(cpu);
|
||||||
|
}
|
||||||
|
|
|
@ -156,5 +156,6 @@ void ARMRaiseIRQ(struct ARMCore*);
|
||||||
void ARMRaiseSWI(struct ARMCore*);
|
void ARMRaiseSWI(struct ARMCore*);
|
||||||
|
|
||||||
void ARMRun(struct ARMCore* cpu);
|
void ARMRun(struct ARMCore* cpu);
|
||||||
|
void ARMRunLoop(struct ARMCore* cpu);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -167,7 +167,7 @@ static THREAD_ENTRY _GBAThreadRun(void* context) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
while (threadContext->state == THREAD_RUNNING) {
|
while (threadContext->state == THREAD_RUNNING) {
|
||||||
ARMRun(&cpu);
|
ARMRunLoop(&cpu);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue