all repos — mgba @ 09a0f95ed4784729f75e00e8a68dc5ba57ca7fe2

mGBA Game Boy Advance Emulator

Actually use GBATestIRQ
Jeffrey Pfau jeffrey@endrift.com
Wed, 09 Oct 2013 01:56:59 -0700
commit

09a0f95ed4784729f75e00e8a68dc5ba57ca7fe2

parent

6906df95e28cd08dac54def70704ac4775c5dbcb

4 files changed, 8 insertions(+), 5 deletions(-)

jump to
M src/arm/arm.hsrc/arm/arm.h

@@ -93,6 +93,7 @@ void (*reset)(struct ARMBoard* board);

void (*processEvents)(struct ARMBoard* board); void (*swi16)(struct ARMBoard* board, int immediate); void (*swi32)(struct ARMBoard* board, int immediate); + void (*readCPSR)(struct ARMBoard* board); void (*hitStub)(struct ARMBoard* board, uint32_t opcode); };
M src/arm/isa-inlines.hsrc/arm/isa-inlines.h

@@ -97,6 +97,7 @@

static inline void _ARMReadCPSR(struct ARMCore* cpu) { _ARMSetMode(cpu, cpu->cpsr.t); ARMSetPrivilegeMode(cpu, cpu->cpsr.priv); + cpu->board->readCPSR(cpu->board); } #endif
M src/gba/gba.csrc/gba/gba.c

@@ -69,6 +69,7 @@ board->d.reset = GBABoardReset;

board->d.processEvents = GBAProcessEvents; board->d.swi16 = GBASwi16; board->d.swi32 = GBASwi32; + board->d.readCPSR = GBATestIRQ; board->d.hitStub = GBAHitStub; }

@@ -372,13 +373,13 @@ ARMRaiseIRQ(&gba->cpu);

} } -int GBATestIRQ(struct GBA* gba) { +void GBATestIRQ(struct ARMBoard* board) { + struct GBABoard* gbaBoard = (struct GBABoard*) board; + struct GBA* gba = gbaBoard->p; if (gba->memory.io[REG_IME >> 1] && gba->memory.io[REG_IE >> 1] & gba->memory.io[REG_IF >> 1]) { gba->springIRQ = 1; - gba->cpu.nextEvent = gba->cpu.cycles; - return 1; + gba->cpu.nextEvent = 0; } - return 0; } int GBAWaitForIRQ(struct GBA* gba) {
M src/gba/gba.hsrc/gba/gba.h

@@ -109,7 +109,7 @@

void GBAWriteIE(struct GBA* gba, uint16_t value); void GBAWriteIME(struct GBA* gba, uint16_t value); void GBARaiseIRQ(struct GBA* gba, enum GBAIRQ irq); -int GBATestIRQ(struct GBA* gba); +void GBATestIRQ(struct ARMBoard* board); int GBAWaitForIRQ(struct GBA* gba); int GBAHalt(struct GBA* gba);