DS: Fix non-debugger builds

This commit is contained in:
Vicki Pfau 2017-04-08 11:10:11 -07:00
parent 18955a53f2
commit 6f04c89c5f
1 changed files with 6 additions and 0 deletions

View File

@ -607,6 +607,7 @@ void DSGetGameTitle(struct DS* ds, char* out) {
void DSHitStub(struct ARMCore* cpu, uint32_t opcode) { void DSHitStub(struct ARMCore* cpu, uint32_t opcode) {
struct DS* ds = (struct DS*) cpu->master; struct DS* ds = (struct DS*) cpu->master;
#ifdef USE_DEBUGGERS
if (ds->debugger) { if (ds->debugger) {
struct mDebuggerEntryInfo info = { struct mDebuggerEntryInfo info = {
.address = _ARMPCAddress(cpu), .address = _ARMPCAddress(cpu),
@ -614,6 +615,7 @@ void DSHitStub(struct ARMCore* cpu, uint32_t opcode) {
}; };
mDebuggerEnter(ds->debugger->d.p, DEBUGGER_ENTER_ILLEGAL_OP, &info); mDebuggerEnter(ds->debugger->d.p, DEBUGGER_ENTER_ILLEGAL_OP, &info);
} }
#endif
// TODO: More sensible category? // TODO: More sensible category?
mLOG(DS, ERROR, "Stub opcode: %08x", opcode); mLOG(DS, ERROR, "Stub opcode: %08x", opcode);
} }
@ -629,12 +631,14 @@ void DSIllegal(struct ARMCore* cpu, uint32_t opcode) {
cpu->gprs[ARM_PC] -= WORD_SIZE_ARM * 2; cpu->gprs[ARM_PC] -= WORD_SIZE_ARM * 2;
ARM_WRITE_PC; ARM_WRITE_PC;
} }
#ifdef USE_DEBUGGERS
} else if (ds->debugger) { } else if (ds->debugger) {
struct mDebuggerEntryInfo info = { struct mDebuggerEntryInfo info = {
.address = _ARMPCAddress(cpu), .address = _ARMPCAddress(cpu),
.opcode = opcode .opcode = opcode
}; };
mDebuggerEnter(ds->debugger->d.p, DEBUGGER_ENTER_ILLEGAL_OP, &info); mDebuggerEnter(ds->debugger->d.p, DEBUGGER_ENTER_ILLEGAL_OP, &info);
#endif
} else { } else {
ARMRaiseUndefined(cpu); ARMRaiseUndefined(cpu);
} }
@ -646,6 +650,7 @@ void DSBreakpoint(struct ARMCore* cpu, int immediate) {
return; return;
} }
switch (immediate) { switch (immediate) {
#ifdef USE_DEBUGGERS
case CPU_COMPONENT_DEBUGGER: case CPU_COMPONENT_DEBUGGER:
if (ds->debugger) { if (ds->debugger) {
struct mDebuggerEntryInfo info = { struct mDebuggerEntryInfo info = {
@ -654,6 +659,7 @@ void DSBreakpoint(struct ARMCore* cpu, int immediate) {
mDebuggerEnter(ds->debugger->d.p, DEBUGGER_ENTER_BREAKPOINT, &info); mDebuggerEnter(ds->debugger->d.p, DEBUGGER_ENTER_BREAKPOINT, &info);
} }
break; break;
#endif
default: default:
break; break;
} }