Tighter looping for ARMRun
Jeffrey Pfau jeffrey@endrift.com
Thu, 28 Aug 2014 05:00:38 -0700
3 files changed,
13 insertions(+),
1 deletions(-)
M
src/arm/arm.c
→
src/arm/arm.c
@@ -291,3 +291,14 @@ if (cpu->cycles >= cpu->nextEvent) {
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); +}
M
src/arm/arm.h
→
src/arm/arm.h
@@ -156,5 +156,6 @@ void ARMRaiseIRQ(struct ARMCore*);
void ARMRaiseSWI(struct ARMCore*); void ARMRun(struct ARMCore* cpu); +void ARMRunLoop(struct ARMCore* cpu); #endif
M
src/gba/gba-thread.c
→
src/gba/gba-thread.c
@@ -167,7 +167,7 @@ _changeState(threadContext, THREAD_EXITING, false);
} } else { while (threadContext->state == THREAD_RUNNING) { - ARMRun(&cpu); + ARMRunLoop(&cpu); } }