mirror of https://github.com/mgba-emu/mgba.git
GBA: Slightly optimize GBAProcessEvents
This commit is contained in:
parent
be42f298da
commit
564f58c7fb
2
CHANGES
2
CHANGES
|
@ -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:
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue