From e5e09c1e13fb70bf50ab53ad695d32728dd776ac Mon Sep 17 00:00:00 2001 From: TuxSH <1922548+TuxSH@users.noreply.github.com> Date: Fri, 3 Jun 2022 22:18:10 +0100 Subject: [PATCH 1/3] gdb: use 'swbreak' for bkpt too --- sysmodules/rosalina/source/gdb/debug.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/sysmodules/rosalina/source/gdb/debug.c b/sysmodules/rosalina/source/gdb/debug.c index 0ee032e..12418cc 100644 --- a/sysmodules/rosalina/source/gdb/debug.c +++ b/sysmodules/rosalina/source/gdb/debug.c @@ -546,20 +546,13 @@ int GDB_SendStopReply(GDBContext *ctx, const DebugEventInfo *info) switch(exc.stop_point.type) { case STOPPOINT_SVC_FF: - { - GDB_ParseCommonThreadInfo(buffer, ctx, SIGTRAP); - return GDB_SendFormattedPacket(ctx, "%sswbreak:;", buffer); - break; - } - case STOPPOINT_BREAKPOINT: { - // Note: this includes both "bkpt" and hw breakpoints, but we never use the latter... - // However, since our GDB executable only knows about svc 0xFF as sw breakpoint for the 3DS ABI, - // we can use swbreak as reason (it'll dismiss the bkpt instruction and try to auto-step over it). + // Note: STOPPOINT_BREAKPOINT includes both "bkpt" and hw breakpoints, but we never use the latter... + // Use swbreak as a reason for both 'svc 0xFF' and 'bkpt' too (GDB doc mention we should use 'swbreak' + // even if the breakpoint was already present/hardcoded). GDB_ParseCommonThreadInfo(buffer, ctx, SIGTRAP); - return GDB_SendFormattedPacket(ctx, "%s", buffer); - break; + return GDB_SendFormattedPacket(ctx, "%sswbreak:;", buffer); } case STOPPOINT_WATCHPOINT: @@ -571,7 +564,6 @@ int GDB_SendStopReply(GDBContext *ctx, const DebugEventInfo *info) GDB_ParseCommonThreadInfo(buffer, ctx, SIGTRAP); return GDB_SendFormattedPacket(ctx, "%s%swatch:%08lx;", buffer, kinds[(u32)kind], exc.stop_point.fault_information); - break; } default: From 3227b2ea4b97ac1551039691db5aec6dd690955b Mon Sep 17 00:00:00 2001 From: TuxSH <1922548+TuxSH@users.noreply.github.com> Date: Fri, 3 Jun 2022 23:53:07 +0100 Subject: [PATCH 2/3] Fix battery voltage calculation (thanks nocash) --- sysmodules/rosalina/source/menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysmodules/rosalina/source/menu.c b/sysmodules/rosalina/source/menu.c index 66dcfbe..f5c1f61 100644 --- a/sysmodules/rosalina/source/menu.c +++ b/sysmodules/rosalina/source/menu.c @@ -175,7 +175,7 @@ static Result menuUpdateMcuInfo(void) batteryPercentage = (u32)((batteryPercentage + 0.05f) * 10.0f) / 10.0f; // Round battery voltage to 0.01V - batteryVoltage = (5u * data[3]) / 256.0f; + batteryVoltage = 0.02f * data[3]; batteryVoltage = (u32)((batteryVoltage + 0.005f) * 100.0f) / 100.0f; } From 2c184cf7a3c4f1de243565680bd2eb2e513c1368 Mon Sep 17 00:00:00 2001 From: TuxSH <1922548+TuxSH@users.noreply.github.com> Date: Sat, 4 Jun 2022 22:27:31 +0100 Subject: [PATCH 3/3] Update chainloader version number --- arm9/source/start.s | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arm9/source/start.s b/arm9/source/start.s index 1290b4a..955b2e4 100644 --- a/arm9/source/start.s +++ b/arm9/source/start.s @@ -160,7 +160,7 @@ disableMpuAndJumpToEntrypoints: @ Jump to the Arm9 entrypoint mov r0, r4 mov r1, r5 - ldr r2, =0x3BEEF + ldr r2, =0x4BEEF bx r6 .pool