From ce895330ed994de32f55a17a3d2dc5dbbb2ccb9b Mon Sep 17 00:00:00 2001 From: LagoLunatic Date: Tue, 23 Dec 2025 00:55:51 -0500 Subject: [PATCH] Add missing RVL .init splits (#2989) * Fix Debug_BBA being in the wrong split for GCN * Add .init splits/symbols for Wii versions * Fix incorrect relocations detected to __check_pad3 for Wii * Add .init splits and fix __check_pad3 for Shield versions --- .vscode/tasks.json | 2 +- config/GZ2E01/splits.txt | 9 +++++---- config/GZ2E01/symbols.txt | 2 +- config/GZ2J01/splits.txt | 9 +++++---- config/GZ2J01/symbols.txt | 2 +- config/GZ2P01/splits.txt | 9 +++++---- config/GZ2P01/symbols.txt | 2 +- config/RZDE01_00/config.yml | 4 ++++ config/RZDE01_00/splits.txt | 13 ++++++++++++- config/RZDE01_02/config.yml | 4 ++++ config/RZDE01_02/splits.txt | 13 ++++++++++++- config/RZDJ01/config.yml | 4 ++++ config/RZDJ01/splits.txt | 13 ++++++++++++- config/RZDJ01/symbols.txt | 18 +++++++++--------- config/RZDP01/config.yml | 4 ++++ config/RZDP01/splits.txt | 13 ++++++++++++- config/RZDP01/symbols.txt | 17 +++++++++-------- config/Shield/config.yml | 4 ++++ config/Shield/splits.txt | 11 ++++++++++- config/ShieldD/config.yml | 2 ++ config/ShieldD/splits.txt | 11 ++++++++++- configure.py | 3 ++- src/dolphin/os/OSThread.c | 4 ---- src/dolphin/os/__start.c | 2 ++ 24 files changed, 131 insertions(+), 44 deletions(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index a2c434e915..0e26bc0455 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -12,7 +12,7 @@ "GZ2J01", // GCN JPN "RZDE01_00", // Wii USA Rev 0 "RZDE01_02", // Wii USA Rev 2 - //"RZDP01", // Wii PAL + "RZDP01", // Wii PAL "RZDJ01", // Wii JPN //"RZDK01", // Wii KOR //"DZDE01", // Wii USA Kiosk Demo diff --git a/config/GZ2E01/splits.txt b/config/GZ2E01/splits.txt index 57e3ef80c8..35ca40d130 100644 --- a/config/GZ2E01/splits.txt +++ b/config/GZ2E01/splits.txt @@ -3027,7 +3027,7 @@ dolphin/os/OSThread.c: .data start:0x803D0838 end:0x803D1048 .bss start:0x8044BB78 end:0x8044C570 .sdata start:0x804509B8 end:0x804509C0 - .sbss start:0x804516C0 end:0x804516D8 + .sbss start:0x804516C0 end:0x804516D0 dolphin/os/OSTime.c: .text start:0x803426FC end:0x80342B78 @@ -3036,6 +3036,10 @@ dolphin/os/OSTime.c: dolphin/os/__ppc_eabi_init.cpp: .text start:0x80342B78 end:0x80342C0C +dolphin/os/__start.c: + .init start:0x80003100 end:0x80003458 + .sbss start:0x804516D0 end:0x804516D8 + dolphin/exi/EXIBios.c: .text start:0x80342C0C end:0x803445E8 .data start:0x803D10A8 end:0x803D11B8 @@ -3603,9 +3607,6 @@ TRK_MINNOW_DOLPHIN/debugger/embedded/MetroTRK/Portable/notify.c: TRK_MINNOW_DOLPHIN/debugger/embedded/MetroTRK/Processor/ppc/Generic/flush_cache.c: .text start:0x8036F548 end:0x8036F580 -dolphin/os/__start.c: - .init start:0x80003100 end:0x80003458 - PowerPC_EABI_Support/Runtime/Src/__mem.c: .init start:0x80003458 end:0x80003590 diff --git a/config/GZ2E01/symbols.txt b/config/GZ2E01/symbols.txt index 6470afbf9d..70d988a893 100644 --- a/config/GZ2E01/symbols.txt +++ b/config/GZ2E01/symbols.txt @@ -22311,7 +22311,7 @@ HoldDown = .sbss:0x804516B8; // type:object size:0x8 scope:local align:8 data:4b RunQueueBits = .sbss:0x804516C0; // type:object size:0x4 scope:local align:4 data:4byte RunQueueHint = .sbss:0x804516C4; // type:object size:0x4 scope:local align:4 data:4byte Reschedule = .sbss:0x804516C8; // type:object size:0x4 scope:local align:4 data:4byte -Debug_BBA = .sbss:0x804516D0; // type:object size:0x1 scope:global align:8 data:byte +Debug_BBA = .sbss:0x804516D0; // type:object size:0x1 scope:local data:byte IDSerialPort1 = .sbss:0x804516D8; // type:object size:0x4 scope:local align:4 data:4byte Chan = .sbss:0x804516E0; // type:object size:0x4 scope:local align:4 data:4byte Dev = .sbss:0x804516E4; // type:object size:0x4 scope:local align:4 data:4byte diff --git a/config/GZ2J01/splits.txt b/config/GZ2J01/splits.txt index 757dcccb4a..5feaac606a 100644 --- a/config/GZ2J01/splits.txt +++ b/config/GZ2J01/splits.txt @@ -2955,7 +2955,7 @@ dolphin/os/OSThread.c: .data start:0x803CA978 end:0x803CB188 .bss start:0x80445CB8 end:0x804466B0 .sdata start:0x8044AAF8 end:0x8044AB00 - .sbss start:0x8044B800 end:0x8044B818 + .sbss start:0x8044B800 end:0x8044B810 dolphin/os/OSTime.c: .text start:0x80344B98 end:0x80345014 @@ -2964,6 +2964,10 @@ dolphin/os/OSTime.c: dolphin/os/__ppc_eabi_init.cpp: .text start:0x80345014 end:0x803450A8 +dolphin/os/__start.c: + .init start:0x80003100 end:0x80003458 + .sbss start:0x8044B810 end:0x8044B818 + dolphin/exi/EXIBios.c: .text start:0x803450A8 end:0x80346A84 .data start:0x803CB1E8 end:0x803CB2F8 @@ -3531,9 +3535,6 @@ TRK_MINNOW_DOLPHIN/debugger/embedded/MetroTRK/Portable/notify.c: TRK_MINNOW_DOLPHIN/debugger/embedded/MetroTRK/Processor/ppc/Generic/flush_cache.c: .text start:0x803719E4 end:0x80371A1C -dolphin/os/__start.c: - .init start:0x80003100 end:0x80003458 - PowerPC_EABI_Support/Runtime/Src/__mem.c: .init start:0x80003458 end:0x80003590 diff --git a/config/GZ2J01/symbols.txt b/config/GZ2J01/symbols.txt index ccae3db9ec..c3a1d8e1b3 100644 --- a/config/GZ2J01/symbols.txt +++ b/config/GZ2J01/symbols.txt @@ -22340,7 +22340,7 @@ HoldDown = .sbss:0x8044B7F8; // type:object size:0x8 scope:local align:4 data:4b RunQueueBits = .sbss:0x8044B800; // type:object size:0x4 scope:local align:4 data:4byte RunQueueHint = .sbss:0x8044B804; // type:object size:0x4 scope:local align:4 data:4byte Reschedule = .sbss:0x8044B808; // type:object size:0x4 scope:local align:4 data:4byte -Debug_BBA = .sbss:0x8044B810; // type:object size:0x1 scope:global align:8 data:byte +Debug_BBA = .sbss:0x8044B810; // type:object size:0x1 scope:local data:byte IDSerialPort1 = .sbss:0x8044B818; // type:object size:0x4 scope:local align:4 data:4byte Chan = .sbss:0x8044B820; // type:object size:0x4 scope:local align:4 data:4byte Dev = .sbss:0x8044B824; // type:object size:0x4 scope:local align:4 data:4byte diff --git a/config/GZ2P01/splits.txt b/config/GZ2P01/splits.txt index 0c0107c9e7..1ec2860617 100644 --- a/config/GZ2P01/splits.txt +++ b/config/GZ2P01/splits.txt @@ -2955,7 +2955,7 @@ dolphin/os/OSThread.c: .data start:0x803D27D8 end:0x803D2FE8 .bss start:0x8044DB38 end:0x8044E530 .sdata start:0x80452978 end:0x80452980 - .sbss start:0x80453688 end:0x804536A0 + .sbss start:0x80453688 end:0x80453698 dolphin/os/OSTime.c: .text start:0x80343568 end:0x803439E4 @@ -2964,6 +2964,10 @@ dolphin/os/OSTime.c: dolphin/os/__ppc_eabi_init.cpp: .text start:0x803439E4 end:0x80343A78 +dolphin/os/__start.c: + .init start:0x80003100 end:0x80003458 + .sbss start:0x80453698 end:0x804536A0 + dolphin/exi/EXIBios.c: .text start:0x80343A78 end:0x80345454 .data start:0x803D3048 end:0x803D3158 @@ -3531,9 +3535,6 @@ TRK_MINNOW_DOLPHIN/debugger/embedded/MetroTRK/Portable/notify.c: TRK_MINNOW_DOLPHIN/debugger/embedded/MetroTRK/Processor/ppc/Generic/flush_cache.c: .text start:0x80370378 end:0x803703B0 -dolphin/os/__start.c: - .init start:0x80003100 end:0x80003458 - PowerPC_EABI_Support/Runtime/Src/__mem.c: .init start:0x80003458 end:0x80003590 diff --git a/config/GZ2P01/symbols.txt b/config/GZ2P01/symbols.txt index 14389374c0..fc60314826 100644 --- a/config/GZ2P01/symbols.txt +++ b/config/GZ2P01/symbols.txt @@ -22353,7 +22353,7 @@ HoldDown = .sbss:0x80453680; // type:object size:0x8 scope:local align:4 data:4b RunQueueBits = .sbss:0x80453688; // type:object size:0x4 scope:local align:4 data:4byte RunQueueHint = .sbss:0x8045368C; // type:object size:0x4 scope:local align:4 data:4byte Reschedule = .sbss:0x80453690; // type:object size:0x4 scope:local align:4 data:4byte -Debug_BBA = .sbss:0x80453698; // type:object size:0x1 scope:global align:8 data:byte +Debug_BBA = .sbss:0x80453698; // type:object size:0x1 scope:local data:byte IDSerialPort1 = .sbss:0x804536A0; // type:object size:0x4 scope:local align:4 data:4byte Chan = .sbss:0x804536A8; // type:object size:0x4 scope:local align:4 data:4byte Dev = .sbss:0x804536AC; // type:object size:0x4 scope:local align:4 data:4byte diff --git a/config/RZDE01_00/config.yml b/config/RZDE01_00/config.yml index dc7a5962b1..70a4a964fa 100644 --- a/config/RZDE01_00/config.yml +++ b/config/RZDE01_00/config.yml @@ -13,6 +13,10 @@ force_active: [ _MetroTRK_Has_Framing, ] +block_relocations: +- source: .text:0x80344978 +- source: .text:0x803449f0 + modules: - object: files/RELS.arc:rels/mmem/f_pc_profile_lst.rel hash: 40511841f108b688f4885b19bf8ecf07781aab67 diff --git a/config/RZDE01_00/splits.txt b/config/RZDE01_00/splits.txt index 22e241bf62..08be85c1e4 100644 --- a/config/RZDE01_00/splits.txt +++ b/config/RZDE01_00/splits.txt @@ -3209,7 +3209,11 @@ revolution/os/OSStateTM.c: .text start:0x8034FB88 end:0x8035027C .data start:0x8043D210 end:0x8043D2D8 .bss start:0x804EBB60 end:0x804EBC20 - .sbss start:0x8053B4E0 end:0x8053B508 + .sbss start:0x8053B4E0 end:0x8053B500 + +revolution/os/__start.c: + .init start:0x80004000 end:0x800042E0 + .sbss start:0x8053B500 end:0x8053B508 revolution/os/OSPlayRecord.c: .text start:0x8035027C end:0x80350954 @@ -3223,6 +3227,7 @@ revolution/os/OSStateFlags.c: .bss start:0x804EBE20 end:0x804EBE40 revolution/os/__ppc_eabi_init.cpp: + .init start:0x800042E0 end:0x80004338 .text start:0x80350B4C end:0x80350C00 revolution/exi/EXIBios.c: @@ -3963,6 +3968,7 @@ revolution/gd/GDGeometry.c: .data start:0x804492A8 end:0x80449310 PowerPC_EABI_Support/Runtime/Src/__mem.c: + .init start:0x80004338 end:0x8000446C .text start:0x803BDB38 end:0x803BDB54 PowerPC_EABI_Support/Runtime/Src/__va_arg.c: @@ -4305,6 +4311,7 @@ TRK_MINNOW_DOLPHIN/debugger/embedded/MetroTRK/Processor/ppc/Generic/flush_cache. .text start:0x803CA918 end:0x803CA950 TRK_MINNOW_DOLPHIN/debugger/embedded/MetroTRK/Portable/mem_TRK.c: + .init start:0x8000446C end:0x800044C0 .text start:0x803CA950 end:0x803CAA08 TRK_MINNOW_DOLPHIN/debugger/embedded/MetroTRK/Portable/string_TRK.c: @@ -4325,7 +4332,11 @@ TRK_MINNOW_DOLPHIN/debugger/embedded/MetroTRK/Processor/ppc/Generic/mpc_7xx_603e TRK_MINNOW_DOLPHIN/debugger/embedded/MetroTRK/Export/mslsupp.c: .text start:0x803CC7D0 end:0x803CC948 +TRK_MINNOW_DOLPHIN/debugger/embedded/MetroTRK/Processor/ppc/Generic/exception.s: + .init start:0x800044C0 end:0x800063F4 + TRK_MINNOW_DOLPHIN/debugger/embedded/MetroTRK/Os/dolphin/dolphin_trk.c: + .init start:0x800063F4 end:0x80006420 .text start:0x803CC948 end:0x803CCC64 .data start:0x80449AE0 end:0x80449B20 .bss start:0x80536FE0 end:0x80536FE8 diff --git a/config/RZDE01_02/config.yml b/config/RZDE01_02/config.yml index 8247d238de..cabb79264c 100644 --- a/config/RZDE01_02/config.yml +++ b/config/RZDE01_02/config.yml @@ -13,6 +13,10 @@ force_active: [ _MetroTRK_Has_Framing, ] +block_relocations: +- source: .text:0x8032f348 +- source: .text:0x8032f3c0 + modules: - object: files/RELS.arc:rels/mmem/f_pc_profile_lst.rel hash: a7f24646c20b174199613be4780a362c29ffec9a diff --git a/config/RZDE01_02/splits.txt b/config/RZDE01_02/splits.txt index 739f5b328b..32899e9801 100644 --- a/config/RZDE01_02/splits.txt +++ b/config/RZDE01_02/splits.txt @@ -3171,7 +3171,11 @@ revolution/os/OSStateTM.c: .text start:0x8033A5C0 end:0x8033ACB4 .data start:0x804246D8 end:0x804247A0 .bss start:0x804D1BE0 end:0x804D1CA0 - .sbss start:0x805214D8 end:0x80521500 + .sbss start:0x805214D8 end:0x805214F8 + +revolution/os/__start.c: + .init start:0x80004000 end:0x800042E0 + .sbss start:0x805214F8 end:0x80521500 revolution/os/OSPlayRecord.c: .text start:0x8033ACB4 end:0x8033B38C @@ -3185,6 +3189,7 @@ revolution/os/OSStateFlags.c: .bss start:0x804D1EA0 end:0x804D1EC0 revolution/os/__ppc_eabi_init.cpp: + .init start:0x800042E0 end:0x80004338 .text start:0x8033B584 end:0x8033B638 revolution/exi/EXIBios.c: @@ -3922,6 +3927,7 @@ revolution/gd/GDGeometry.c: .data start:0x80430788 end:0x804307F0 PowerPC_EABI_Support/Runtime/Src/__mem.c: + .init start:0x80004338 end:0x8000446C .text start:0x803A8570 end:0x803A858C PowerPC_EABI_Support/Runtime/Src/__va_arg.c: @@ -4263,6 +4269,7 @@ TRK_MINNOW_DOLPHIN/debugger/embedded/MetroTRK/Processor/ppc/Generic/flush_cache. .text start:0x803B5350 end:0x803B5388 TRK_MINNOW_DOLPHIN/debugger/embedded/MetroTRK/Portable/mem_TRK.c: + .init start:0x8000446C end:0x800044C0 .text start:0x803B5388 end:0x803B5440 TRK_MINNOW_DOLPHIN/debugger/embedded/MetroTRK/Portable/string_TRK.c: @@ -4283,7 +4290,11 @@ TRK_MINNOW_DOLPHIN/debugger/embedded/MetroTRK/Processor/ppc/Generic/mpc_7xx_603e TRK_MINNOW_DOLPHIN/debugger/embedded/MetroTRK/Export/mslsupp.c: .text start:0x803B7210 end:0x803B7388 +TRK_MINNOW_DOLPHIN/debugger/embedded/MetroTRK/Processor/ppc/Generic/exception.s: + .init start:0x800044C0 end:0x800063F4 + TRK_MINNOW_DOLPHIN/debugger/embedded/MetroTRK/Os/dolphin/dolphin_trk.c: + .init start:0x800063F4 end:0x80006420 .text start:0x803B7388 end:0x803B76A4 .data start:0x80430FC0 end:0x80431000 .bss start:0x8051D060 end:0x8051D068 diff --git a/config/RZDJ01/config.yml b/config/RZDJ01/config.yml index c1cbeb5ec3..7cd94dd0b4 100644 --- a/config/RZDJ01/config.yml +++ b/config/RZDJ01/config.yml @@ -13,6 +13,10 @@ force_active: [ _MetroTRK_Has_Framing, ] +block_relocations: +- source: .text:0x80330e68 +- source: .text:0x80330ee0 + modules: - object: files/RELS.arc:rels/mmem/f_pc_profile_lst.rel hash: 8392f1c2b842a02891ee30481ed96aa107e8d300 diff --git a/config/RZDJ01/splits.txt b/config/RZDJ01/splits.txt index 4f9583ea9e..05732471f7 100644 --- a/config/RZDJ01/splits.txt +++ b/config/RZDJ01/splits.txt @@ -3167,7 +3167,11 @@ revolution/os/OSStateTM.c: .text start:0x8033C078 end:0x8033C76C .data start:0x80422558 end:0x80422620 .bss start:0x804CFA60 end:0x804CFB20 - .sbss start:0x8051F348 end:0x8051F370 + .sbss start:0x8051F348 end:0x8051F368 + +revolution/os/__start.c: + .init start:0x80004000 end:0x800042E0 + .sbss start:0x8051F368 end:0x8051F370 revolution/os/OSPlayRecord.c: .text start:0x8033C76C end:0x8033CE44 @@ -3181,6 +3185,7 @@ revolution/os/OSStateFlags.c: .bss start:0x804CFD20 end:0x804CFD40 revolution/os/__ppc_eabi_init.cpp: + .init start:0x800042E0 end:0x80004338 .text start:0x8033D03C end:0x8033D0F0 revolution/exi/EXIBios.c: @@ -3918,6 +3923,7 @@ revolution/gd/GDGeometry.c: .data start:0x8042E608 end:0x8042E670 PowerPC_EABI_Support/Runtime/Src/__mem.c: + .init start:0x80004338 end:0x8000446C .text start:0x803AA028 end:0x803AA044 PowerPC_EABI_Support/Runtime/Src/__va_arg.c: @@ -4260,6 +4266,7 @@ TRK_MINNOW_DOLPHIN/debugger/embedded/MetroTRK/Processor/ppc/Generic/flush_cache. .text start:0x803B6E08 end:0x803B6E40 TRK_MINNOW_DOLPHIN/debugger/embedded/MetroTRK/Portable/mem_TRK.c: + .init start:0x8000446C end:0x800044C0 .text start:0x803B6E40 end:0x803B6EF8 TRK_MINNOW_DOLPHIN/debugger/embedded/MetroTRK/Portable/string_TRK.c: @@ -4277,7 +4284,11 @@ TRK_MINNOW_DOLPHIN/debugger/embedded/MetroTRK/Processor/ppc/Generic/mpc_7xx_603e TRK_MINNOW_DOLPHIN/debugger/embedded/MetroTRK/Export/mslsupp.c: .text start:0x803B8CC0 end:0x803B8E38 +TRK_MINNOW_DOLPHIN/debugger/embedded/MetroTRK/Processor/ppc/Generic/exception.s: + .init start:0x800044C0 end:0x800063F4 + TRK_MINNOW_DOLPHIN/debugger/embedded/MetroTRK/Os/dolphin/dolphin_trk.c: + .init start:0x800063F4 end:0x80006420 .text start:0x803B8E38 end:0x803B9154 .data start:0x8042EE40 end:0x8042EE80 .bss start:0x8051AEE0 end:0x8051AEE8 diff --git a/config/RZDJ01/symbols.txt b/config/RZDJ01/symbols.txt index bc482734ce..83f6d7e6e7 100644 --- a/config/RZDJ01/symbols.txt +++ b/config/RZDJ01/symbols.txt @@ -1,20 +1,21 @@ __check_pad3 = .init:0x80004000; // type:function size:0x28 scope:local __set_debug_bba = .init:0x80004028; // type:function size:0xC scope:local -__get_debug_bba = .init:0x80004034; // type:function scope:local +__get_debug_bba = .init:0x80004034; // type:function size:0x8 scope:local __start = .init:0x8000403C; // type:function size:0x16C scope:weak __init_registers = .init:0x800041A8; // type:function size:0x90 scope:local __init_data = .init:0x80004238; // type:function size:0xA8 scope:local __init_hardware = .init:0x800042E0; // type:function size:0x24 scope:global -__flush_cache = .init:0x80004304; // type:function scope:global -memcpy = .init:0x80004338; // type:function scope:global -__fill_mem = .init:0x80004388; // type:function scope:global +__flush_cache = .init:0x80004304; // type:function size:0x34 scope:global +memcpy = .init:0x80004338; // type:function size:0x50 scope:global +__fill_mem = .init:0x80004388; // type:function size:0xB4 scope:global memset = .init:0x8000443C; // type:function size:0x30 scope:global -lbl_8000446C = .init:0x8000446C; // type:label -lbl_8000449C = .init:0x8000449C; // type:label -lbl_800044C0 = .init:0x800044C0; // type:label +TRK_memset = .init:0x8000446C; // type:function size:0x30 scope:global align:4 +TRK_memcpy = .init:0x8000449C; // type:function size:0x24 scope:global align:4 +gTRKInterruptVectorTable = .init:0x800044C0; // type:label scope:global lbl_80004600 = .init:0x80004600; // type:label lbl_80005400 = .init:0x80005400; // type:label -lbl_800063F4 = .init:0x800063F4; // type:label +__TRK_reset = .init:0x800063F4; // type:function size:0x2C scope:global align:4 +gTRKInterruptVectorTableEnd = .init:0x800063F4; // type:label scope:global _rom_copy_info = .init:0x80006420; // type:object size:0x84 scope:global data:4byte _bss_init_info = .init:0x800064A4; // type:object size:0x20 scope:global data:4byte @etb_800064E0 = extab:0x800064E0; // type:object size:0x18 scope:local hidden @@ -16164,7 +16165,6 @@ OSExceptionInit = .text:0x8033116C; // type:function size:0x280 scope:global ali __OSDBIntegrator = .text:0x803313EC; // type:function size:0x24 scope:global align:4 __OSDBINTSTART = .text:0x803313EC; // type:label scope:global __OSDBJump = .text:0x80331410; // type:function size:0x4 scope:global align:4 -__OSDBINTEND = .text:0x80331410; // type:label scope:global __OSDBJUMPSTART = .text:0x80331410; // type:label scope:global align:4 __OSSetExceptionHandler = .text:0x80331414; // type:function size:0x14 scope:global align:4 __OSDBJUMPEND = .text:0x80331414; // type:label scope:global diff --git a/config/RZDP01/config.yml b/config/RZDP01/config.yml index 1348dd55c4..2439a78d64 100644 --- a/config/RZDP01/config.yml +++ b/config/RZDP01/config.yml @@ -13,6 +13,10 @@ force_active: [ _MetroTRK_Has_Framing, ] +block_relocations: +- source: .text:0x8032f778 +- source: .text:0x8032f7f0 + modules: - object: files/RELS.arc:mmem/f_pc_profile_lst.rel hash: 55347a0f55d15a6901d297ee3e198b76cb8242ee diff --git a/config/RZDP01/splits.txt b/config/RZDP01/splits.txt index 72593255ea..51998fba6d 100644 --- a/config/RZDP01/splits.txt +++ b/config/RZDP01/splits.txt @@ -3167,7 +3167,11 @@ revolution/os/OSStateTM.c: .text start:0x8033A9F0 end:0x8033B0E4 .data start:0x80424FE8 end:0x804250B0 .bss start:0x804D24E0 end:0x804D25A0 - .sbss start:0x80521C98 end:0x80521CC0 + .sbss start:0x80521C98 end:0x80521CB8 + +revolution/os/__start.c: + .init start:0x80004000 end:0x800042E0 + .sbss start:0x80521CB8 end:0x80521CC0 revolution/os/OSPlayRecord.c: .text start:0x8033B0E4 end:0x8033B7BC @@ -3181,6 +3185,7 @@ revolution/os/OSStateFlags.c: .bss start:0x804D27A0 end:0x804D27C0 revolution/os/__ppc_eabi_init.cpp: + .init start:0x800042E0 end:0x80004338 .text start:0x8033B9B4 end:0x8033BA68 revolution/exi/EXIBios.c: @@ -3918,6 +3923,7 @@ revolution/gd/GDGeometry.c: .data start:0x80431088 end:0x804310F0 PowerPC_EABI_Support/Runtime/Src/__mem.c: + .init start:0x80004338 end:0x8000446C .text start:0x803A89F4 end:0x803A8A10 PowerPC_EABI_Support/Runtime/Src/__va_arg.c: @@ -4260,6 +4266,7 @@ TRK_MINNOW_DOLPHIN/debugger/embedded/MetroTRK/Processor/ppc/Generic/flush_cache. .text start:0x803B57D4 end:0x803B580C TRK_MINNOW_DOLPHIN/debugger/embedded/MetroTRK/Portable/mem_TRK.c: + .init start:0x8000446C end:0x800044C0 .text start:0x803B580C end:0x803B58C4 TRK_MINNOW_DOLPHIN/debugger/embedded/MetroTRK/Portable/string_TRK.c: @@ -4280,7 +4287,11 @@ TRK_MINNOW_DOLPHIN/debugger/embedded/MetroTRK/Processor/ppc/Generic/mpc_7xx_603e TRK_MINNOW_DOLPHIN/debugger/embedded/MetroTRK/Export/mslsupp.c: .text start:0x803B7690 end:0x803B7808 +TRK_MINNOW_DOLPHIN/debugger/embedded/MetroTRK/Processor/ppc/Generic/exception.s: + .init start:0x800044C0 end:0x800063F4 + TRK_MINNOW_DOLPHIN/debugger/embedded/MetroTRK/Os/dolphin/dolphin_trk.c: + .init start:0x800063F4 end:0x80006420 .text start:0x803B7808 end:0x803B7B24 .data start:0x804318C0 end:0x80431900 .bss start:0x8051D960 end:0x8051D968 diff --git a/config/RZDP01/symbols.txt b/config/RZDP01/symbols.txt index 694c5b2595..570d80796b 100644 --- a/config/RZDP01/symbols.txt +++ b/config/RZDP01/symbols.txt @@ -1,20 +1,21 @@ __check_pad3 = .init:0x80004000; // type:function size:0x28 scope:local __set_debug_bba = .init:0x80004028; // type:function size:0xC scope:local -__get_debug_bba = .init:0x80004034; // type:function scope:local +__get_debug_bba = .init:0x80004034; // type:function size:0x8 scope:local __start = .init:0x8000403C; // type:function size:0x16C scope:weak __init_registers = .init:0x800041A8; // type:function size:0x90 scope:local __init_data = .init:0x80004238; // type:function size:0xA8 scope:local __init_hardware = .init:0x800042E0; // type:function size:0x24 scope:global -__flush_cache = .init:0x80004304; // type:function scope:global -memcpy = .init:0x80004338; // type:function scope:global -__fill_mem = .init:0x80004388; // type:function scope:global +__flush_cache = .init:0x80004304; // type:function size:0x34 scope:global +memcpy = .init:0x80004338; // type:function size:0x50 scope:global +__fill_mem = .init:0x80004388; // type:function size:0xB4 scope:global memset = .init:0x8000443C; // type:function size:0x30 scope:global -lbl_8000446C = .init:0x8000446C; // type:label -lbl_8000449C = .init:0x8000449C; // type:label -lbl_800044C0 = .init:0x800044C0; // type:label +TRK_memset = .init:0x8000446C; // type:function size:0x30 scope:global align:4 +TRK_memcpy = .init:0x8000449C; // type:function size:0x24 scope:global align:4 +gTRKInterruptVectorTable = .init:0x800044C0; // type:label scope:global lbl_80004600 = .init:0x80004600; // type:label lbl_80005400 = .init:0x80005400; // type:label -lbl_800063F4 = .init:0x800063F4; // type:label +__TRK_reset = .init:0x800063F4; // type:function size:0x2C scope:global align:4 +gTRKInterruptVectorTableEnd = .init:0x800063F4; // type:label scope:global _rom_copy_info = .init:0x80006420; // type:object size:0x84 scope:global data:4byte _bss_init_info = .init:0x800064A4; // type:object size:0x20 scope:global data:4byte @etb_800064E0 = extab:0x800064E0; // type:object size:0x18 scope:local hidden diff --git a/config/Shield/config.yml b/config/Shield/config.yml index 7221eb5274..5f199784df 100644 --- a/config/Shield/config.yml +++ b/config/Shield/config.yml @@ -17,6 +17,10 @@ ldscript_template: config/Shield/ldscript.tpl # target: buffer__14mDoMtx_stack_c # addend: 0x300 +block_relocations: +- source: .text:0x803f56fc +- source: .text:0x803f5764 + modules: - object: files/RELS.arc:rels/mmem/f_pc_profile_lst.rel hash: 6fde21e7ca31044cd9f5a94b922ca44535328134 diff --git a/config/Shield/splits.txt b/config/Shield/splits.txt index 268911265e..b39be061f7 100644 --- a/config/Shield/splits.txt +++ b/config/Shield/splits.txt @@ -3307,9 +3307,13 @@ revolution/os/OSIpc.c: revolution/os/OSStateTM.c: .text start:0x804014D0 end:0x80401C50 .data start:0x804F6738 end:0x804F6800 - .sbss start:0x805095E0 end:0x80509608 + .sbss start:0x805095E0 end:0x80509600 .bss start:0x805977A0 end:0x80597860 +revolution/os/__start.c: + .init start:0x80004000 end:0x80004360 + .sbss start:0x80509600 end:0x80509608 + revolution/os/OSPlayRecord.c: .text start:0x80401C50 end:0x80402370 .data start:0x804F6800 end:0x804F6848 @@ -3349,6 +3353,7 @@ revolution/os/OSLaunch.c: .text start:0x80403660 end:0x80403870 revolution/os/__ppc_eabi_init.cpp: + .init start:0x80004360 end:0x800043C4 .text start:0x80403870 end:0x80403930 revolution/exi/EXIBios.c: @@ -4071,6 +4076,7 @@ revolution/gd/GDGeometry.c: .data start:0x80503EB0 end:0x80503F18 PowerPC_EABI_Support/Runtime/Src/__mem.c: + .init start:0x800043C4 end:0x80004744 .text start:0x8047AA94 end:0x8047AAB0 PowerPC_EABI_Support/Runtime/Src/__va_arg.c: @@ -4451,3 +4457,6 @@ NdevExi2A/DebuggerDriver.c: NdevExi2A/exi2.c: .text start:0x8048DDA8 end:0x8048E534 + +TRK_MINNOW_DOLPHIN/debugger/embedded/MetroTRK/Processor/ppc/Generic/exception.s: + .init start:0x80004744 end:0x80006678 diff --git a/config/ShieldD/config.yml b/config/ShieldD/config.yml index 9695d1f945..d30978c5d5 100644 --- a/config/ShieldD/config.yml +++ b/config/ShieldD/config.yml @@ -17,6 +17,8 @@ block_relocations: end: .text:0x8055029C - source: .text:0x80550314 end: .text:0x8055031C +- source: .text:0x805b727c + end: .text:0x805b7284 add_relocations: - source: .sdata:0x8073f3f4 type: abs diff --git a/config/ShieldD/splits.txt b/config/ShieldD/splits.txt index 8c2109d6d1..3ca0497923 100644 --- a/config/ShieldD/splits.txt +++ b/config/ShieldD/splits.txt @@ -4071,9 +4071,13 @@ revolution/os/OSIpc.c: revolution/os/OSStateTM.c: .text start:0x805C6CD0 end:0x805C7490 .data start:0x8072B550 end:0x8072B6F8 - .sbss start:0x8074D258 end:0x8074D280 + .sbss start:0x8074D258 end:0x8074D278 .bss start:0x807FA2C0 end:0x807FA380 +revolution/os/__start.c: + .init start:0x80004000 end:0x80004400 + .sbss start:0x8074D278 end:0x8074D280 + revolution/os/OSPlayRecord.c: .text start:0x805C7490 end:0x805C7C40 .data start:0x8072B6F8 end:0x8072B740 @@ -4109,6 +4113,7 @@ revolution/os/OSLaunch.c: .text start:0x805C95C0 end:0x805C9810 revolution/os/__ppc_eabi_init.cpp: + .init start:0x80004400 end:0x80004464 .text start:0x805C9810 end:0x805C9920 revolution/exi/EXIBios.c: @@ -4496,6 +4501,7 @@ revolution/gd/GDGeometry.c: .data start:0x8073E268 end:0x8073E500 PowerPC_EABI_Support/Runtime/Src/__mem.c: + .init start:0x80004464 end:0x800047E4 .text start:0x8061B4D8 end:0x8061B4F4 PowerPC_EABI_Support/Runtime/Src/__va_arg.c: @@ -4888,3 +4894,6 @@ NdevExi2AD/DebuggerDriver.c: NdevExi2AD/exi2.c: .text start:0x8062F1EC end:0x8062F7C0 + +TRK_MINNOW_DOLPHIN/debugger/embedded/MetroTRK/Processor/ppc/Generic/exception.s: + .init start:0x800047E4 end:0x80006718 diff --git a/configure.py b/configure.py index da2d7ca241..d775928b80 100755 --- a/configure.py +++ b/configure.py @@ -1524,6 +1524,7 @@ config.libs = [ RevolutionLib( "os", [ + Object(NonMatching, "revolution/os/__start.c"), Object(MatchingFor("ShieldD"), "revolution/os/OS.c"), Object(MatchingFor("ShieldD"), "revolution/os/OSAddress.c"), Object(MatchingFor("ShieldD"), "revolution/os/OSAlarm.c"), @@ -1557,7 +1558,7 @@ config.libs = [ Object(MatchingFor("ShieldD"), "revolution/os/OSNandbootInfo.c"), Object(MatchingFor("ShieldD"), "revolution/os/OSPlayTime.c"), Object(MatchingFor("ShieldD"), "revolution/os/OSLaunch.c"), - Object(MatchingFor("ShieldD"), "revolution/os/__ppc_eabi_init.cpp"), + Object(NonMatching, "revolution/os/__ppc_eabi_init.cpp"), ], ), RevolutionLib( diff --git a/src/dolphin/os/OSThread.c b/src/dolphin/os/OSThread.c index 81e57afe72..62db9ff2d2 100644 --- a/src/dolphin/os/OSThread.c +++ b/src/dolphin/os/OSThread.c @@ -873,7 +873,3 @@ void* OSGetThreadSpecific(s32 index) { return NULL; } - -#include "global.h" -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 110e7e5b3a..dea700fdbb 100644 --- a/src/dolphin/os/__start.c +++ b/src/dolphin/os/__start.c @@ -1,6 +1,8 @@ #include #include "__ppc_eabi_linker.h" +static u8 Debug_BBA; + extern void InitMetroTRK(); extern void exit(int); extern int main(int argc, char* argv[]);