mirror of https://github.com/mgba-emu/mgba.git
DS: Add CPSR-reading skeleton, sans IRQs
This commit is contained in:
parent
5939af0a2b
commit
b83f037799
23
src/ds/ds.c
23
src/ds/ds.c
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue