Actually use GBATestIRQ
Jeffrey Pfau jeffrey@endrift.com
Wed, 09 Oct 2013 01:56:59 -0700
4 files changed,
8 insertions(+),
5 deletions(-)
M
src/arm/arm.h
→
src/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.h
→
src/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.c
→
src/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.h
→
src/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);