DS: Add CPSR-reading skeleton, sans IRQs
Jeffrey Pfau jeffrey@endrift.com
Wed, 01 Jun 2016 21:42:02 -0700
1 files changed,
21 insertions(+),
2 deletions(-)
jump to
M
src/ds/ds.c
→
src/ds/ds.c
@@ -37,10 +37,13 @@
static void DSInit(void* cpu, struct mCPUComponent* component); static void DS7Reset(struct ARMCore* cpu); +static void DS7TestIRQ(struct ARMCore* cpu); static void DS7InterruptHandlerInit(struct ARMInterruptHandler* irqh); static void DS9Reset(struct ARMCore* cpu); +static void DS9TestIRQ(struct ARMCore* cpu); static void DS9InterruptHandlerInit(struct ARMInterruptHandler* irqh); + static void DSProcessEvents(struct ARMCore* cpu); static void DSHitStub(struct ARMCore* cpu, uint32_t opcode);@@ -104,7 +107,7 @@ irqh->processEvents = DSProcessEvents;
irqh->swi16 = NULL; irqh->swi32 = NULL; irqh->hitIllegal = DSIllegal; - irqh->readCPSR = NULL; + irqh->readCPSR = DS7TestIRQ; irqh->hitStub = DSHitStub; irqh->bkpt16 = DSBreakpoint; irqh->bkpt32 = DSBreakpoint;@@ -116,7 +119,7 @@ irqh->processEvents = DSProcessEvents;
irqh->swi16 = NULL; irqh->swi32 = NULL; irqh->hitIllegal = DSIllegal; - irqh->readCPSR = NULL; + irqh->readCPSR = DS9TestIRQ; irqh->hitStub = DSHitStub; irqh->bkpt16 = DSBreakpoint; irqh->bkpt32 = DSBreakpoint;@@ -337,3 +340,19 @@ default:
break; } } + +void DS7TestIRQ(struct ARMCore* cpu) { + struct DS* ds = (struct DS*) cpu->master; + if (0) { + ds->springIRQ7 = 1; + cpu->nextEvent = cpu->cycles; + } +} + +void DS9TestIRQ(struct ARMCore* cpu) { + struct DS* ds = (struct DS*) cpu->master; + if (0) { + ds->springIRQ9 = 1; + cpu->nextEvent = cpu->cycles; + } +}