all repos — mgba @ 564f58c7fb2fc7c6bee5aed3fe1fcf7a13a3a43c

mGBA Game Boy Advance Emulator

GBA: Slightly optimize GBAProcessEvents
Jeffrey Pfau jeffrey@endrift.com
Mon, 08 Feb 2016 22:32:30 -0800
commit

564f58c7fb2fc7c6bee5aed3fe1fcf7a13a3a43c

parent

be42f298dafae88507564533c7d622eda70caea8

2 files changed, 14 insertions(+), 11 deletions(-)

jump to
M CHANGESCHANGES

@@ -1,6 +1,8 @@

0.5.0: (Future) Bugfixes: - VFS: Fix reading 7z archives without rewinding first +Misc: + - GBA: Slightly optimize GBAProcessEvents 0.4.0: (2016-02-02) Features:
M src/gba/gba.csrc/gba/gba.c

@@ -205,8 +205,19 @@ }

} static void GBAProcessEvents(struct ARMCore* cpu) { + struct GBA* gba = (struct GBA*) cpu->master; + + gba->bus = cpu->prefetch[1]; + if (cpu->executionMode == MODE_THUMB) { + gba->bus |= cpu->prefetch[1] << 16; + } + + if (gba->springIRQ) { + ARMRaiseIRQ(cpu); + gba->springIRQ = 0; + } + do { - struct GBA* gba = (struct GBA*) cpu->master; int32_t cycles = cpu->nextEvent; int32_t nextEvent = INT_MAX; int32_t testEvent;

@@ -215,16 +226,6 @@ if (cycles < 0) {

GBALog(gba, GBA_LOG_FATAL, "Negative cycles passed: %i", cycles); } #endif - - gba->bus = cpu->prefetch[1]; - if (cpu->executionMode == MODE_THUMB) { - gba->bus |= cpu->prefetch[1] << 16; - } - - if (gba->springIRQ) { - ARMRaiseIRQ(cpu); - gba->springIRQ = 0; - } testEvent = GBAVideoProcessEvents(&gba->video, cycles); if (testEvent < nextEvent) {