GBA: Unhandled bkpt should be treated as an undefined exception

This commit is contained in:
Vicki Pfau 2023-07-04 04:21:37 -07:00
parent fd84ceddda
commit 3f0d06e307
2 changed files with 4 additions and 3 deletions

View File

@ -13,6 +13,7 @@ Emulation fixes:
- GB Serialize: Add missing Pocket Cam state to savestates - GB Serialize: Add missing Pocket Cam state to savestates
- GB SIO: Disabling SIO should cancel pending transfers (fixes mgba.io/i/2537) - GB SIO: Disabling SIO should cancel pending transfers (fixes mgba.io/i/2537)
- GB Video: Implement DMG-style sprite ordering - GB Video: Implement DMG-style sprite ordering
- GBA: Unhandled bkpt should be treated as an undefined exception
- GBA Audio: Fix sample timing drifting when changing sample interval - GBA Audio: Fix sample timing drifting when changing sample interval
- GBA Audio: Fix initial channel 3 wave RAM (fixes mgba.io/i/2947) - GBA Audio: Fix initial channel 3 wave RAM (fixes mgba.io/i/2947)
- GBA BIOS: Fix clobbering registers with word-sized CpuSet - GBA BIOS: Fix clobbering registers with word-sized CpuSet

View File

@ -886,9 +886,6 @@ void GBAIllegal(struct ARMCore* cpu, uint32_t opcode) {
void GBABreakpoint(struct ARMCore* cpu, int immediate) { void GBABreakpoint(struct ARMCore* cpu, int immediate) {
struct GBA* gba = (struct GBA*) cpu->master; struct GBA* gba = (struct GBA*) cpu->master;
if (immediate >= CPU_COMPONENT_MAX) {
return;
}
switch (immediate) { switch (immediate) {
#ifdef USE_DEBUGGERS #ifdef USE_DEBUGGERS
case CPU_COMPONENT_DEBUGGER: case CPU_COMPONENT_DEBUGGER:
@ -899,6 +896,7 @@ void GBABreakpoint(struct ARMCore* cpu, int immediate) {
.pointId = -1 .pointId = -1
}; };
mDebuggerEnter(gba->debugger->d.p, DEBUGGER_ENTER_BREAKPOINT, &info); mDebuggerEnter(gba->debugger->d.p, DEBUGGER_ENTER_BREAKPOINT, &info);
return;
} }
break; break;
#endif #endif
@ -917,11 +915,13 @@ void GBABreakpoint(struct ARMCore* cpu, int immediate) {
if (hook) { if (hook) {
ARMRunFake(cpu, hook->patchedOpcode); ARMRunFake(cpu, hook->patchedOpcode);
} }
return;
} }
break; break;
default: default:
break; break;
} }
ARMRaiseUndefined(cpu);
} }
void GBAFrameStarted(struct GBA* gba) { void GBAFrameStarted(struct GBA* gba) {