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)
Bugfixes:
- VFS: Fix reading 7z archives without rewinding first
Misc:
- GBA: Slightly optimize GBAProcessEvents
0.4.0: (2016-02-02)
Features:

View File

@ -205,8 +205,19 @@ void GBASkipBIOS(struct GBA* gba) {
}
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;
@ -216,16 +227,6 @@ static void GBAProcessEvents(struct ARMCore* cpu) {
}
#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) {
nextEvent = testEvent;