all repos — mgba @ b3b6d7f75cb1e95106b340d9ae1958a8cc6f7701

mGBA Game Boy Advance Emulator

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

b3b6d7f75cb1e95106b340d9ae1958a8cc6f7701

parent

be7ca4d5adbace2a58658c7215ae8e3fb268aa43

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

jump to
M CHANGESCHANGES

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

0.4.1: (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) {