DS: Add CPSR-reading skeleton, sans IRQs

This commit is contained in:
Jeffrey Pfau 2016-06-01 21:42:02 -07:00
parent 5939af0a2b
commit b83f037799
1 changed files with 21 additions and 2 deletions

View File

@ -37,11 +37,14 @@ enum {
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);
static void DSIllegal(struct ARMCore* cpu, uint32_t opcode);
@ -104,7 +107,7 @@ void DS7InterruptHandlerInit(struct ARMInterruptHandler* irqh) {
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 @@ void DS9InterruptHandlerInit(struct ARMInterruptHandler* irqh) {
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 @@ void DSBreakpoint(struct ARMCore* cpu, int immediate) {
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;
}
}