From 4b0737d49ceed80017a02974f0514ff682fba24a Mon Sep 17 00:00:00 2001 From: dbalatoni13 <40299962+dbalatoni13@users.noreply.github.com> Date: Tue, 1 Apr 2025 02:17:36 +0200 Subject: [PATCH] Some fixes (#577) * Mini improvements * Fix some splits --- config/GMPE01_00/rels/nisDll/splits.txt | 3 ++- config/GMPE01_00/splits.txt | 2 +- config/GMPE01_00/symbols.txt | 12 ++++++------ include/dolphin/thp/THPPlayer.h | 11 ++++++----- src/REL/m446Dll/table.c | 2 +- src/REL/nisDll/main.c | 1 + src/TRK_MINNOW_DOLPHIN/targimpl.c | 1 + src/TRK_MINNOW_DOLPHIN/targsupp.s | 2 +- src/game/hsfman.c | 12 ++++++------ 9 files changed, 25 insertions(+), 21 deletions(-) diff --git a/config/GMPE01_00/rels/nisDll/splits.txt b/config/GMPE01_00/rels/nisDll/splits.txt index d512c836..4554248b 100644 --- a/config/GMPE01_00/rels/nisDll/splits.txt +++ b/config/GMPE01_00/rels/nisDll/splits.txt @@ -2,7 +2,8 @@ Sections: .text type:code align:4 .ctors type:rodata align:4 .dtors type:rodata align:4 - .data type:data align:8 + .rodata type:rodata align:8 REL/nisDll/main.c: .text start:0x00000000 end:0x0000017C + .rodata start:0x00000000 end:0x00000010 diff --git a/config/GMPE01_00/splits.txt b/config/GMPE01_00/splits.txt index 0c85aae7..d9a64bf5 100644 --- a/config/GMPE01_00/splits.txt +++ b/config/GMPE01_00/splits.txt @@ -1222,7 +1222,7 @@ TRK_MINNOW_DOLPHIN/targimpl.c: .bss start:0x801A9138 end:0x801A96B8 TRK_MINNOW_DOLPHIN/targsupp.s: - .text start:0x800F1CF0 end:0x800F1D10 + .text start:0x800F1CE4 end:0x800F1D10 TRK_MINNOW_DOLPHIN/__exception.s: .init start:0x80003534 end:0x80005468 diff --git a/config/GMPE01_00/symbols.txt b/config/GMPE01_00/symbols.txt index 19a42077..17ef4f4f 100644 --- a/config/GMPE01_00/symbols.txt +++ b/config/GMPE01_00/symbols.txt @@ -3032,9 +3032,9 @@ TRK_flush_cache = .text:0x800F0360; // type:function size:0x38 TRK_fill_mem = .text:0x800F0398; // type:function size:0xBC __TRK_get_MSR = .text:0x800F0454; // type:function size:0x8 __TRK_set_MSR = .text:0x800F045C; // type:function size:0x8 -TRK_ppc_memcpy = .text:0x800F0464; // type:function size:0x3C +TRK_ppc_memcpy = .text:0x800F0464; // type:function size:0x3C scope:local TRKInterruptHandler = .text:0x800F04A0; // type:function size:0x194 scope:global -TRKExceptionHandler = .text:0x800F0634; // type:function size:0x9C scope:global +TRKExceptionHandler = .text:0x800F0634; // type:function size:0x9C scope:local TRKSwapAndGo = .text:0x800F06D0; // type:function size:0xC4 scope:global TRKInterruptHandlerEnableInterrupts = .text:0x800F0794; // type:function size:0x54 scope:global TRKTargetSetInputPendingPtr = .text:0x800F07E8; // type:function size:0x10 scope:global @@ -3670,9 +3670,9 @@ aT = .rodata:0x8011E9F8; // type:object size:0x58 scope:local @62 = .rodata:0x8011EA50; // type:object size:0x1C scope:local data:string lbl_8011EA70 = .rodata:0x8011EA70; // type:object size:0x1D data:string gTRKMemMap = .rodata:0x8011EA90; // type:object size:0x10 data:4byte -lbl_8011EAA0 = .rodata:0x8011EAA0; // type:object size:0x28 data:4byte -lbl_8011EAC8 = .rodata:0x8011EAC8; // type:object size:0x28 data:4byte -lbl_8011EAF0 = .rodata:0x8011EAF0; // type:object size:0x28 data:4byte +lbl_8011EAA0 = .rodata:0x8011EAA0; // type:object size:0x28 scope:local data:4byte +lbl_8011EAC8 = .rodata:0x8011EAC8; // type:object size:0x28 scope:local data:4byte +lbl_8011EAF0 = .rodata:0x8011EAF0; // type:object size:0x28 scope:local data:4byte @154 = .rodata:0x8011EB18; // type:object size:0x21 scope:local data:string @155 = .rodata:0x8011EB3C; // type:object size:0x24 scope:local data:string dspMixerCycles = .rodata:0x8011EB60; // type:object size:0x40 @@ -4517,7 +4517,7 @@ jumptable_8013EA20 = .data:0x8013EA20; // type:object size:0x1C scope:local jumptable_8013EA3C = .data:0x8013EA3C; // type:object size:0x1C scope:local gTRKRestoreFlags = .data:0x8013EA58; // type:object size:0x9 scope:global data:byte gTRKExceptionStatus = .data:0x8013EA64; // type:object size:0x10 scope:local data:4byte -gTRKStepStatus = .data:0x8013EA74; // type:object size:0x14 data:4byte +gTRKStepStatus = .data:0x8013EA74; // type:object size:0x14 scope:local data:4byte TRK_ISR_OFFSETS = .data:0x8013EA88; // type:object size:0x3C scope:local data:4byte gDBCommTable = .data:0x8013EAC8; // type:object size:0x1C scope:global data:4byte jumptable_8013EAE8 = .data:0x8013EAE8; // type:object size:0x50 scope:local diff --git a/include/dolphin/thp/THPPlayer.h b/include/dolphin/thp/THPPlayer.h index 8cd1e6ca..eb6fff62 100644 --- a/include/dolphin/thp/THPPlayer.h +++ b/include/dolphin/thp/THPPlayer.h @@ -2,11 +2,12 @@ #define _THP_THPPLAYER_H #include "types.h" -#include "Dolphin/os.h" -#include "Dolphin/gx.h" -#include "THP/THPBuffer.h" -#include "THP/THPFile.h" -#include "THP/THPInfo.h" +#include +#include "dolphin/os.h" +#include "dolphin/gx.h" +#include "dolphin/thp/THPBuffer.h" +#include "dolphin/thp/THPFile.h" +#include "dolphin/thp/THPInfo.h" #ifdef __cplusplus extern "C" { diff --git a/src/REL/m446Dll/table.c b/src/REL/m446Dll/table.c index f1de1c13..ea79e3b9 100644 --- a/src/REL/m446Dll/table.c +++ b/src/REL/m446Dll/table.c @@ -240,7 +240,7 @@ s32 fn_1_4088(unkStruct6 *arg0, u8 arg1, u8 arg2, s32 arg3, unkStruct4 **arg4, s arg0->unk68 = 0x1E; } if ((arg0->unk68 > 0) && (arg5 == 0)) { - arg0->unk68 = (arg0->unk68 - 1); + arg0->unk68--; } else { var_r28 = (arg0->unk64 / 7) < (arg0->unk60 / 7); diff --git a/src/REL/nisDll/main.c b/src/REL/nisDll/main.c index a50c5b18..4dc839ce 100644 --- a/src/REL/nisDll/main.c +++ b/src/REL/nisDll/main.c @@ -1,4 +1,5 @@ #include "game/object.h" +#include "math.h" void fn_1_68(omObjData *object); diff --git a/src/TRK_MINNOW_DOLPHIN/targimpl.c b/src/TRK_MINNOW_DOLPHIN/targimpl.c index ab925687..ba77ff35 100644 --- a/src/TRK_MINNOW_DOLPHIN/targimpl.c +++ b/src/TRK_MINNOW_DOLPHIN/targimpl.c @@ -94,6 +94,7 @@ static void TRK_ppc_memcpy(register void* dest, register const void* src, void TRKRestoreExtended1Block(); void TRKUARTInterruptHandler(); +DSError TRKTargetReadInstruction(void* data, u32 start); static BOOL TRKTargetCheckStep(); diff --git a/src/TRK_MINNOW_DOLPHIN/targsupp.s b/src/TRK_MINNOW_DOLPHIN/targsupp.s index 670f691f..0244131b 100644 --- a/src/TRK_MINNOW_DOLPHIN/targsupp.s +++ b/src/TRK_MINNOW_DOLPHIN/targsupp.s @@ -2,7 +2,7 @@ .file "targsupp.s" .text -.balign 4 +.balign 16 .fn TRKAccessFile, global twui r0, 0x0 diff --git a/src/game/hsfman.c b/src/game/hsfman.c index e02c8edb..b455a0cf 100644 --- a/src/game/hsfman.c +++ b/src/game/hsfman.c @@ -1394,7 +1394,7 @@ inline s16 Hu3DLightCreateV(LightData *light, Vec *arg0, Vec *arg1, GXColor *arg light->color = *arg2; } -s16 Hu3DGLightCreateV(Vec* arg0, Vec* arg1, GXColor* arg2) { +s16 Hu3DGLightCreateV(Vec* pos, Vec* dir, GXColor* color) { s16 var_r30; LightData* var_r31; @@ -1409,7 +1409,7 @@ s16 Hu3DGLightCreateV(Vec* arg0, Vec* arg1, GXColor* arg2) { return -1; } - Hu3DLightCreateV(var_r31, arg0, arg1, arg2); + Hu3DLightCreateV(var_r31, pos, dir, color); return var_r30; } @@ -1894,10 +1894,10 @@ void Hu3DShadowCreate(f32 arg8, f32 arg9, f32 argA) { Hu3DShadowF = 1; } -void Hu3DShadowPosSet(Vec* arg0, Vec* arg1, Vec* arg2) { - Hu3DShadowData.unk_14 = *arg0; - Hu3DShadowData.unk_20 = *arg2; - Hu3DShadowData.unk_2C = *arg1; +void Hu3DShadowPosSet(Vec* camPos, Vec* camUp, Vec* camTarget) { + Hu3DShadowData.unk_14 = *camPos; + Hu3DShadowData.unk_20 = *camTarget; + Hu3DShadowData.unk_2C = *camUp; } void Hu3DShadowTPLvlSet(f32 arg8) {