From 304c6cfca9f011ba9677f12d115c28cdb8e73af8 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Sun, 10 Sep 2023 18:55:46 -0700 Subject: [PATCH] Rename unnamed CARAMToken functions --- asm/Kyoto/CARAMToken.s | 8 ++++---- asm/Kyoto/Graphics/DolphinCTexture.s | 2 +- asm/MetroidPrime/CWorldTransManager.s | 4 ++-- asm/musyx/runtime/synthdata.s | 15 ++++++++++----- include/Kyoto/CARAMToken.hpp | 4 ++-- src/Kyoto/CARAMToken.cpp | 4 ++-- 6 files changed, 21 insertions(+), 16 deletions(-) diff --git a/asm/Kyoto/CARAMToken.s b/asm/Kyoto/CARAMToken.s index 5d8fdeb5..ff168d98 100644 --- a/asm/Kyoto/CARAMToken.s +++ b/asm/Kyoto/CARAMToken.s @@ -31,8 +31,8 @@ lbl_80358374: /* 80358380 003552E0 38 21 00 10 */ addi r1, r1, 0x10 /* 80358384 003552E4 4E 80 00 20 */ blr -.global sub_80358388__10CARAMTokenFv -sub_80358388__10CARAMTokenFv: +.global ForceSyncARAM__10CARAMTokenFv +ForceSyncARAM__10CARAMTokenFv: /* 80358388 003552E8 94 21 FF F0 */ stwu r1, -0x10(r1) /* 8035838C 003552EC 7C 08 02 A6 */ mflr r0 /* 80358390 003552F0 90 01 00 14 */ stw r0, 0x14(r1) @@ -54,8 +54,8 @@ lbl_803583C0: /* 803583CC 0035532C 38 21 00 10 */ addi r1, r1, 0x10 /* 803583D0 00355330 4E 80 00 20 */ blr -.global sub_803583d4__10CARAMTokenFv -sub_803583d4__10CARAMTokenFv: +.global ForceSyncMRAM__10CARAMTokenFv +ForceSyncMRAM__10CARAMTokenFv: /* 803583D4 00355334 94 21 FF F0 */ stwu r1, -0x10(r1) /* 803583D8 00355338 7C 08 02 A6 */ mflr r0 /* 803583DC 0035533C 90 01 00 14 */ stw r0, 0x14(r1) diff --git a/asm/Kyoto/Graphics/DolphinCTexture.s b/asm/Kyoto/Graphics/DolphinCTexture.s index 1571a817..5c4db687 100644 --- a/asm/Kyoto/Graphics/DolphinCTexture.s +++ b/asm/Kyoto/Graphics/DolphinCTexture.s @@ -63,7 +63,7 @@ sub_8030e10c__8CTextureFv: /* 8030E11C 0030B07C 2C 00 00 06 */ cmpwi r0, 6 /* 8030E120 0030B080 41 82 00 18 */ beq lbl_8030E138 /* 8030E124 0030B084 38 63 00 44 */ addi r3, r3, 0x44 -/* 8030E128 0030B088 48 04 A2 AD */ bl sub_803583d4__10CARAMTokenFv +/* 8030E128 0030B088 48 04 A2 AD */ bl ForceSyncMRAM__10CARAMTokenFv /* 8030E12C 0030B08C 7C 64 1B 78 */ mr r4, r3 /* 8030E130 0030B090 38 60 00 01 */ li r3, 1 /* 8030E134 0030B094 48 05 EA E9 */ bl sub_8036cc1c__19CFrameDelayedKillerFbPv diff --git a/asm/MetroidPrime/CWorldTransManager.s b/asm/MetroidPrime/CWorldTransManager.s index 91052c66..f3b0d3c4 100644 --- a/asm/MetroidPrime/CWorldTransManager.s +++ b/asm/MetroidPrime/CWorldTransManager.s @@ -280,7 +280,7 @@ lbl_802090DC: /* 80209104 00206064 38 61 00 80 */ addi r3, r1, 0x80 /* 80209108 00206068 48 14 F5 71 */ bl LoadToARAM__10CARAMTokenFv /* 8020910C 0020606C 38 61 00 80 */ addi r3, r1, 0x80 -/* 80209110 00206070 48 14 F2 79 */ bl sub_80358388__10CARAMTokenFv +/* 80209110 00206070 48 14 F2 79 */ bl ForceSyncARAM__10CARAMTokenFv /* 80209114 00206074 83 61 00 A8 */ lwz r27, 0xa8(r1) /* 80209118 00206078 3C 60 80 3D */ lis r3, lbl_803D2768@ha /* 8020911C 0020607C 38 83 27 68 */ addi r4, r3, lbl_803D2768@l @@ -322,7 +322,7 @@ lbl_80209160: lbl_802091A0: /* 802091A0 00206100 80 61 00 A4 */ lwz r3, 0xa4(r1) /* 802091A4 00206104 38 63 00 08 */ addi r3, r3, 8 -/* 802091A8 00206108 48 14 F2 2D */ bl sub_803583d4__10CARAMTokenFv +/* 802091A8 00206108 48 14 F2 2D */ bl ForceSyncMRAM__10CARAMTokenFv /* 802091AC 0020610C 80 81 00 A4 */ lwz r4, 0xa4(r1) /* 802091B0 00206110 7C 7B 1B 78 */ mr r27, r3 /* 802091B4 00206114 38 61 00 A0 */ addi r3, r1, 0xa0 diff --git a/asm/musyx/runtime/synthdata.s b/asm/musyx/runtime/synthdata.s index 490a7580..73828632 100644 --- a/asm/musyx/runtime/synthdata.s +++ b/asm/musyx/runtime/synthdata.s @@ -1872,11 +1872,12 @@ lbl_803A24D0: /* 803A24E4 0039F444 38 21 00 10 */ addi r1, r1, 0x10 /* 803A24E8 0039F448 4E 80 00 20 */ blr -maccmp: +.fn maccmp, local /* 803A24EC 0039F44C A0 84 00 04 */ lhz r4, 4(r4) /* 803A24F0 0039F450 A0 03 00 04 */ lhz r0, 4(r3) /* 803A24F4 0039F454 7C 64 00 50 */ subf r3, r4, r0 /* 803A24F8 0039F458 4E 80 00 20 */ blr +.endfn maccmp .global dataGetMacro dataGetMacro: @@ -1918,11 +1919,12 @@ lbl_803A2578: /* 803A2580 0039F4E0 38 21 00 10 */ addi r1, r1, 0x10 /* 803A2584 0039F4E4 4E 80 00 20 */ blr -smpcmp: +.fn smpcmp, local /* 803A2588 0039F4E8 A0 84 00 00 */ lhz r4, 0(r4) /* 803A258C 0039F4EC A0 03 00 00 */ lhz r0, 0(r3) /* 803A2590 0039F4F0 7C 64 00 50 */ subf r3, r4, r0 /* 803A2594 0039F4F4 4E 80 00 20 */ blr +.endfn smpcmp .global dataGetSample dataGetSample: @@ -2006,11 +2008,12 @@ lbl_803A26A8: /* 803A26B8 0039F618 38 21 00 20 */ addi r1, r1, 0x20 /* 803A26BC 0039F61C 4E 80 00 20 */ blr -curvecmp: +.fn curvecmp, local /* 803A26C0 0039F620 A0 84 00 04 */ lhz r4, 4(r4) /* 803A26C4 0039F624 A0 03 00 04 */ lhz r0, 4(r3) /* 803A26C8 0039F628 7C 64 00 50 */ subf r3, r4, r0 /* 803A26CC 0039F62C 4E 80 00 20 */ blr +.endfn curvecmp .global dataGetCurve dataGetCurve: @@ -2068,11 +2071,12 @@ lbl_803A2778: /* 803A2780 0039F6E0 38 21 00 10 */ addi r1, r1, 0x10 /* 803A2784 0039F6E4 4E 80 00 20 */ blr -layercmp: +.fn layercmp, local /* 803A2788 0039F6E8 A0 84 00 04 */ lhz r4, 4(r4) /* 803A278C 0039F6EC A0 03 00 04 */ lhz r0, 4(r3) /* 803A2790 0039F6F0 7C 64 00 50 */ subf r3, r4, r0 /* 803A2794 0039F6F4 4E 80 00 20 */ blr +.endfn layercmp .global dataGetLayer dataGetLayer: @@ -2110,11 +2114,12 @@ lbl_803A2800: /* 803A280C 0039F76C 38 21 00 10 */ addi r1, r1, 0x10 /* 803A2810 0039F770 4E 80 00 20 */ blr -fxcmp: +.fn fxcmp, local /* 803A2814 0039F774 A0 84 00 00 */ lhz r4, 0(r4) /* 803A2818 0039F778 A0 03 00 00 */ lhz r0, 0(r3) /* 803A281C 0039F77C 7C 64 00 50 */ subf r3, r4, r0 /* 803A2820 0039F780 4E 80 00 20 */ blr +.endfn fxcmp .global dataGetFX dataGetFX: diff --git a/include/Kyoto/CARAMToken.hpp b/include/Kyoto/CARAMToken.hpp index 646e2d86..dcee4352 100644 --- a/include/Kyoto/CARAMToken.hpp +++ b/include/Kyoto/CARAMToken.hpp @@ -31,8 +31,8 @@ public: void RemoveFromList(); void MakeInvalid(); - void* sub_803583d4(); - void sub_80358388(); + void* ForceSyncMRAM(); + void ForceSyncARAM(); void* GetMRAMSafe(); diff --git a/src/Kyoto/CARAMToken.cpp b/src/Kyoto/CARAMToken.cpp index 12c33565..3b516b41 100644 --- a/src/Kyoto/CARAMToken.cpp +++ b/src/Kyoto/CARAMToken.cpp @@ -231,13 +231,13 @@ void CARAMToken::MakeInvalid() { x10_dmaHandle = CARAMManager::GetInvalidDMAHandle(); } -void* CARAMToken::sub_803583d4() { +void* CARAMToken::ForceSyncMRAM() { void* ptr = GetMRAMSafe(); MakeInvalid(); return ptr; } -void CARAMToken::sub_80358388() { +void CARAMToken::ForceSyncARAM() { if (x0_status >= kS_Two && x0_status <= kS_Five) { CARAMManager::WaitForDMACompletion(x10_dmaHandle); RefreshStatus();