From 5e9704b464cce82b33fc54fdabb584a287154e90 Mon Sep 17 00:00:00 2001 From: cadmic Date: Thu, 29 Aug 2024 09:05:50 -0700 Subject: [PATCH] [ntsc-1.2] Fix some data / disassembly / undefined_syms (#2103) * Fix some data splits * Use real fault functions in cic6105.c * Fix fault_n64.c data sizes * Format --- src/boot/cic6105.c | 24 ++++++++++-------------- src/code/fault_n64.c | 4 +++- tools/disasm/ntsc-1.2/files_code.csv | 3 ++- undefined_syms.txt | 2 -- 4 files changed, 15 insertions(+), 18 deletions(-) diff --git a/src/boot/cic6105.c b/src/boot/cic6105.c index 9cb5c3e393..1f6469b560 100644 --- a/src/boot/cic6105.c +++ b/src/boot/cic6105.c @@ -2,10 +2,6 @@ #include "cic6105.h" #include "fault.h" -// TODO N64 fault.c functions -void func_800AE1E0_unknown(s32, s32); -void func_800AE258_unknown(const char*, ...); - s32 func_80001714(void); extern u64 cic6105ucodeTextStart[]; @@ -32,19 +28,19 @@ void CIC6105_FaultClient(void) { s32 spStatus; spStatus = IO_READ(SP_STATUS_REG); - func_800AE1E0_unknown(48, 200); + Fault_SetCursor(48, 200); if (spStatus & SP_STATUS_SIG7) { - func_800AE258_unknown("OCARINA %08x %08x", B_80008EF8, B_80008EFC); + Fault_Printf("OCARINA %08x %08x", B_80008EF8, B_80008EFC); } else { - func_800AE258_unknown("LEGEND %08x %08x", B_80008EF8, B_80008EFC); + Fault_Printf("LEGEND %08x %08x", B_80008EF8, B_80008EFC); } - func_800AE1E0_unknown(40, 184); - func_800AE258_unknown("ROM_F"); - func_800AE258_unknown(" [Creator:%s]", gBuildTeam); - func_800AE1E0_unknown(56, 192); - func_800AE258_unknown("[Date:%s]", gBuildDate); - func_800AE1E0_unknown(96, 32); - func_800AE258_unknown("I LOVE YOU %08x", func_80001714()); + Fault_SetCursor(40, 184); + Fault_Printf("ROM_F"); + Fault_Printf(" [Creator:%s]", gBuildTeam); + Fault_SetCursor(56, 192); + Fault_Printf("[Date:%s]", gBuildDate); + Fault_SetCursor(96, 32); + Fault_Printf("I LOVE YOU %08x", func_80001714()); } void CIC6105_AddFaultClient(void) { diff --git a/src/code/fault_n64.c b/src/code/fault_n64.c index 74e9633770..69ead64414 100644 --- a/src/code/fault_n64.c +++ b/src/code/fault_n64.c @@ -82,6 +82,7 @@ const char* sFpExceptionNames[] = { }; u16 sFaultFontColor = GPACK_RGBA5551(255, 255, 255, 1); +s32 D_800FF9C4[7] = { 0 }; // Unused (file padding?) Input sFaultInputs[MAXCONTROLLERS]; @@ -95,7 +96,8 @@ vs32 sFaultExit; vs32 gFaultMsgId; vs32 sFaultDisplayEnable; OSThread* sFaultFaultedThread; -s32 B_80122570[0x10]; +s32 B_80122570[16]; +s32 B_801225B0[8]; // Unused (file padding?) void Fault_SleepImpl(u32 ms) { Sleep_Msec(ms); diff --git a/tools/disasm/ntsc-1.2/files_code.csv b/tools/disasm/ntsc-1.2/files_code.csv index 553114dc89..f66c981ae3 100644 --- a/tools/disasm/ntsc-1.2/files_code.csv +++ b/tools/disasm/ntsc-1.2/files_code.csv @@ -276,7 +276,7 @@ EDD90,800FF470,src/code/sys_ucode EDDA0,800FF480,src/code/sys_rumble EDDB0,800FF490,src/code/irqmgr EDDD0,800FF4B0,src/code/code_n64dd_800AD4C0 -EE280,800FF960,src/code/fault_n64 +EDE80,800FF560,src/code/fault_n64 EE300,800FF9E0,src/audio/lib/data F0710,80101DF0,src/audio/lib/synthesis F0740,80101E20,src/audio/lib/load @@ -445,6 +445,7 @@ offset,vram,.bss 110FB0,80122690,src/audio/general 1111B0,80122890,src/audio/sfx 1139C0,801250A0,src/audio/sequence +1146E0,80125DC0,src/audio/data 114780,80125E60,src/audio/session_config 11AC90,8012C370,src/code/system_malloc 11ACA0,8012C380,src/code/jpegdecoder diff --git a/undefined_syms.txt b/undefined_syms.txt index 0cfc7eac26..94e26b9045 100644 --- a/undefined_syms.txt +++ b/undefined_syms.txt @@ -17,8 +17,6 @@ func_80001720 = 0x80001720; // cic6105.c cic6105ucodeTextStart = 0x80006720; -func_800AE258_unknown = 0x800AE258; -func_800AE1E0_unknown = 0x800AE1E0; // code_n64dd_800AD410.c func_800ADCD8_unknown = 0x800ADCD8;