From cbc8e4f11a90351c5c4cdad4b9662f4a6835c1ac Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sun, 28 May 2023 21:29:11 -0700 Subject: [PATCH] Debugger: Fix writing to specific segment in command-line debugger --- CHANGES | 1 + src/debugger/cli-debugger.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 609a1495d..41e46b939 100644 --- a/CHANGES +++ b/CHANGES @@ -13,6 +13,7 @@ Emulation fixes: - GBA BIOS: Fix clobbering registers with word-sized CpuSet - GBA Video: Disable BG target 1 blending when OBJ blending (fixes mgba.io/i/2722) Other fixes: + - Debugger: Fix writing to specific segment in command-line debugger - mGUI: Fix cases where an older save state screenshot would be shown. (fixes mgba.io/i/2183) - Qt: Fix savestate preview sizes with different scales (fixes mgba.io/i/2560) Misc: diff --git a/src/debugger/cli-debugger.c b/src/debugger/cli-debugger.c index 58ce72a25..398a993e5 100644 --- a/src/debugger/cli-debugger.c +++ b/src/debugger/cli-debugger.c @@ -438,7 +438,7 @@ static void _writeByte(struct CLIDebugger* debugger, struct CLIDebugVector* dv) return; } if (dv->segmentValue >= 0) { - debugger->d.p->core->rawWrite8(debugger->d.p->core, address, value, dv->segmentValue); + debugger->d.p->core->rawWrite8(debugger->d.p->core, address, dv->segmentValue, value); } else { debugger->d.p->core->busWrite8(debugger->d.p->core, address, value); } @@ -460,7 +460,7 @@ static void _writeHalfword(struct CLIDebugger* debugger, struct CLIDebugVector* return; } if (dv->segmentValue >= 0) { - debugger->d.p->core->rawWrite16(debugger->d.p->core, address, value, dv->segmentValue); + debugger->d.p->core->rawWrite16(debugger->d.p->core, address, dv->segmentValue, value); } else { debugger->d.p->core->busWrite16(debugger->d.p->core, address, value); } @@ -492,7 +492,7 @@ static void _writeWord(struct CLIDebugger* debugger, struct CLIDebugVector* dv) uint32_t address = dv->intValue; uint32_t value = dv->next->intValue; if (dv->segmentValue >= 0) { - debugger->d.p->core->rawWrite32(debugger->d.p->core, address, value, dv->segmentValue); + debugger->d.p->core->rawWrite32(debugger->d.p->core, address, dv->segmentValue, value); } else { debugger->d.p->core->busWrite32(debugger->d.p->core, address, value); }