GBA: Slightly optimize GBAProcessEvents

This commit is contained in:
Jeffrey Pfau 2016-02-08 22:32:30 -08:00
parent be42f298da
commit 564f58c7fb
2 changed files with 14 additions and 11 deletions

View File

@ -1,6 +1,8 @@
0.5.0: (Future) 0.5.0: (Future)
Bugfixes: Bugfixes:
- VFS: Fix reading 7z archives without rewinding first - VFS: Fix reading 7z archives without rewinding first
Misc:
- GBA: Slightly optimize GBAProcessEvents
0.4.0: (2016-02-02) 0.4.0: (2016-02-02)
Features: Features:

View File

@ -205,8 +205,19 @@ void GBASkipBIOS(struct GBA* gba) {
} }
static void GBAProcessEvents(struct ARMCore* cpu) { 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 { do {
struct GBA* gba = (struct GBA*) cpu->master;
int32_t cycles = cpu->nextEvent; int32_t cycles = cpu->nextEvent;
int32_t nextEvent = INT_MAX; int32_t nextEvent = INT_MAX;
int32_t testEvent; int32_t testEvent;
@ -216,16 +227,6 @@ static void GBAProcessEvents(struct ARMCore* cpu) {
} }
#endif #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); testEvent = GBAVideoProcessEvents(&gba->video, cycles);
if (testEvent < nextEvent) { if (testEvent < nextEvent) {
nextEvent = testEvent; nextEvent = testEvent;