From b1b114e142f05443524d91b4127d9bf97fe75a28 Mon Sep 17 00:00:00 2001 From: Tharo <17233964+Thar0@users.noreply.github.com> Date: Fri, 29 Oct 2021 19:30:48 +0100 Subject: Decompile graph.c (#274) * Decompiled, 1 non-matching, add some bss reordering helpers * Document stuff * Review suggestions * graphutil.c -> graphalloc.c * Try to fix fault callback warnings * Remove extra comments in GfxMasterList * char pad -> u32 pad Co-authored-by: Derek Hensley * Fix gameState Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * Other suggestions Co-authored-by: Derek Hensley Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> --- src/boot_O2_g3/CIC6105.c | 3 ++- src/boot_O2_g3/fault.c | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'src/boot_O2_g3') diff --git a/src/boot_O2_g3/CIC6105.c b/src/boot_O2_g3/CIC6105.c index 5a51b22c8..4ab4ca4e8 100644 --- a/src/boot_O2_g3/CIC6105.c +++ b/src/boot_O2_g3/CIC6105.c @@ -1,4 +1,5 @@ #include "global.h" +#include "prevent_bss_reordering.h" UNK_TYPE4 D_8009BE30; UNK_TYPE4 D_8009BE34; @@ -17,7 +18,7 @@ void CIC6105_PrintRomInfo(void) { } void CIC6105_AddRomInfoFaultPage(void) { - Fault_AddClient(&romInfoFaultClient, (fault_client_func)CIC6105_PrintRomInfo, 0, 0); + Fault_AddClient(&romInfoFaultClient, CIC6105_PrintRomInfo, 0, 0); } void CIC6105_RemoveRomInfoFaultPage(void) { diff --git a/src/boot_O2_g3/fault.c b/src/boot_O2_g3/fault.c index 1851d21cb..b32b5aa98 100644 --- a/src/boot_O2_g3/fault.c +++ b/src/boot_O2_g3/fault.c @@ -33,7 +33,7 @@ void Fault_SleepImpl(u32 duration) { Sleep_Cycles(value); } -void Fault_AddClient(FaultClient* client, fault_client_func callback, void* param0, void* param1) { +void Fault_AddClient(FaultClient* client, void* callback, void* param0, void* param1) { OSIntMask mask; u32 alreadyExists = 0; @@ -104,7 +104,7 @@ void Fault_RemoveClient(FaultClient* client) { } } -void Fault_AddAddrConvClient(FaultAddrConvClient* client, FaultAddrConvFunc callback, void* param) { +void Fault_AddAddrConvClient(FaultAddrConvClient* client, void* callback, void* param) { OSIntMask mask; u32 alreadyExists = 0; @@ -910,8 +910,8 @@ void Fault_HangupFaultClient(const char* arg0, char* arg1) { void Fault_AddHungupAndCrashImpl(const char* arg0, char* arg1) { FaultClient client; - char padd[4]; - Fault_AddClient(&client, (fault_client_func)Fault_HangupFaultClient, (void*)arg0, arg1); + u32 pad; + Fault_AddClient(&client, Fault_HangupFaultClient, (void*)arg0, arg1); *(u32*)0x11111111 = 0; // trigger an exception } -- cgit v1.2.3