From 483b1caf4e4a6ecfaaf572033a1ce66b7d1620b7 Mon Sep 17 00:00:00 2001 From: Max Roncace Date: Sun, 21 Dec 2025 15:30:44 -0500 Subject: [PATCH] Make Debug_BBA symbol global in __start.c This fixes an issue where the virtual address of the symbol would be appended after the name making it impossible to automatically match the symbol on more than one version. --- config/GZ2E01/symbols.txt | 2 +- config/GZ2J01/symbols.txt | 2 +- config/GZ2P01/symbols.txt | 2 +- src/dolphin/os/OSThread.c | 4 ++-- src/dolphin/os/__start.c | 6 +++--- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/config/GZ2E01/symbols.txt b/config/GZ2E01/symbols.txt index 25e27fcb71c..0c99a9f4c41 100644 --- a/config/GZ2E01/symbols.txt +++ b/config/GZ2E01/symbols.txt @@ -22288,7 +22288,7 @@ HoldDown = .sbss:0x804516B8; // type:object size:0x8 scope:global align:8 data:4 RunQueueBits = .sbss:0x804516C0; // type:object size:0x4 scope:global align:4 data:4byte RunQueueHint = .sbss:0x804516C4; // type:object size:0x4 scope:global align:4 data:4byte Reschedule = .sbss:0x804516C8; // type:object size:0x4 scope:global align:4 data:4byte -Debug_BBA = .sbss:0x804516D0; // type:object size:0x1 scope:local align:8 data:byte +Debug_BBA = .sbss:0x804516D0; // type:object size:0x1 scope:global align:8 data:byte IDSerialPort1 = .sbss:0x804516D8; // type:object size:0x4 scope:global align:4 data:4byte Chan = .sbss:0x804516E0; // type:object size:0x4 scope:global align:4 data:4byte Dev = .sbss:0x804516E4; // type:object size:0x4 scope:global align:4 data:4byte diff --git a/config/GZ2J01/symbols.txt b/config/GZ2J01/symbols.txt index f054d162fe0..993e64984dc 100644 --- a/config/GZ2J01/symbols.txt +++ b/config/GZ2J01/symbols.txt @@ -22304,7 +22304,7 @@ HoldDown = .sbss:0x8044B7F8; // type:object size:0x8 scope:global align:4 data:4 RunQueueBits = .sbss:0x8044B800; // type:object size:0x4 scope:global align:4 data:4byte RunQueueHint = .sbss:0x8044B804; // type:object size:0x4 scope:global align:4 data:4byte Reschedule = .sbss:0x8044B808; // type:object size:0x4 scope:global align:4 data:4byte -Debug_BBA = .sbss:0x8044B810; // type:object size:0x1 scope:local data:byte +Debug_BBA = .sbss:0x8044B810; // type:object size:0x1 scope:global align:8 data:byte IDSerialPort1 = .sbss:0x8044B818; // type:object size:0x4 scope:global align:4 data:4byte Chan = .sbss:0x8044B820; // type:object size:0x4 scope:global align:4 data:4byte Dev = .sbss:0x8044B824; // type:object size:0x4 scope:global align:4 data:4byte diff --git a/config/GZ2P01/symbols.txt b/config/GZ2P01/symbols.txt index 6d7825d565c..ae9eb5e908b 100644 --- a/config/GZ2P01/symbols.txt +++ b/config/GZ2P01/symbols.txt @@ -22312,7 +22312,7 @@ HoldDown = .sbss:0x80453680; // type:object size:0x8 scope:global align:4 data:4 RunQueueBits = .sbss:0x80453688; // type:object size:0x4 scope:global align:4 data:4byte RunQueueHint = .sbss:0x8045368C; // type:object size:0x4 scope:global align:4 data:4byte Reschedule = .sbss:0x80453690; // type:object size:0x4 scope:global align:4 data:4byte -Debug_BBA = .sbss:0x80453698; // type:object size:0x1 scope:local data:byte +Debug_BBA = .sbss:0x80453698; // type:object size:0x1 scope:global align:8 data:byte IDSerialPort1 = .sbss:0x804536A0; // type:object size:0x4 scope:global align:4 data:4byte Chan = .sbss:0x804536A8; // type:object size:0x4 scope:global align:4 data:4byte Dev = .sbss:0x804536AC; // type:object size:0x4 scope:global align:4 data:4byte diff --git a/src/dolphin/os/OSThread.c b/src/dolphin/os/OSThread.c index 48dd553eb94..81e57afe728 100644 --- a/src/dolphin/os/OSThread.c +++ b/src/dolphin/os/OSThread.c @@ -875,5 +875,5 @@ void* OSGetThreadSpecific(s32 index) { } #include "global.h" -extern u8 Debug_BBA_804516D0; -u8 Debug_BBA_804516D0 ATTRIBUTE_ALIGN(8); +extern u8 Debug_BBA; +u8 Debug_BBA ATTRIBUTE_ALIGN(8); diff --git a/src/dolphin/os/__start.c b/src/dolphin/os/__start.c index 62349da9619..110e7e5b3ad 100644 --- a/src/dolphin/os/__start.c +++ b/src/dolphin/os/__start.c @@ -17,7 +17,7 @@ __declspec(section ".init") extern void __init_data(void); __declspec(section ".init") extern void __init_hardware(void); __declspec(section ".init") extern void __flush_cache(void* addr, u32 size); -extern u8 Debug_BBA_804516D0; +extern u8 Debug_BBA; __declspec(section ".init") void __check_pad3(void) { if ((*(u16*)0x800030E4 & 0xEEF) == 0xEEF) { @@ -26,11 +26,11 @@ __declspec(section ".init") void __check_pad3(void) { } void __set_debug_bba(void) { - Debug_BBA_804516D0 = 1; + Debug_BBA = 1; } __declspec(section ".init") u8 __get_debug_bba(void) { - return Debug_BBA_804516D0; + return Debug_BBA; } __declspec(section ".init") asm void __start(void) {