diff --git a/asm/Kyoto/Audio/CDSPStreamManager.s b/asm/Kyoto/Audio/CDSPStreamManager.s index 7614f258..7d06686b 100644 --- a/asm/Kyoto/Audio/CDSPStreamManager.s +++ b/asm/Kyoto/Audio/CDSPStreamManager.s @@ -970,7 +970,7 @@ StartStreaming__17CDSPStreamManagerFRCQ24rstl6stringcb: /* 80364208 00361168 54 1E 0F FE */ srwi r30, r0, 0x1f /* 8036420C 0036116C 38 80 00 7C */ li r4, 0x7c /* 80364210 00361170 38 A0 00 00 */ li r5, 0 -/* 80364214 00361174 4B EA 7F 41 */ bl sub_8020c154 +/* 80364214 00361174 4B EA 7F 41 */ bl "sub_8020c154__FRCQ24rstl66basic_string,Q24rstl17rmemory_allocator>ii" /* 80364218 00361178 7C 7F 1B 78 */ mr r31, r3 /* 8036421C 0036117C 2C 1F FF FF */ cmpwi r31, -1 /* 80364220 00361180 40 82 00 FC */ bne lbl_8036431C @@ -1898,4 +1898,3 @@ lbl_803D8400: # ROM: 0x3D5400 .4byte 0 .4byte 0 - diff --git a/asm/Kyoto/Audio/CStreamAudioManager.s b/asm/Kyoto/Audio/CStreamAudioManager.s index 41268824..4dc6d5d4 100644 --- a/asm/Kyoto/Audio/CStreamAudioManager.s +++ b/asm/Kyoto/Audio/CStreamAudioManager.s @@ -65,8 +65,8 @@ lbl_805A9688: .section .text, "ax" -.global sub_803653f8 -sub_803653f8: +.global sub_803653f8__19CStreamAudioManagerFf +sub_803653f8__19CStreamAudioManagerFf: /* 803653F8 00362358 C0 02 CD B0 */ lfs f0, lbl_805AEAD0@sda21(r2) /* 803653FC 0036235C FC 00 08 00 */ fcmpu cr0, f0, f1 /* 80365400 00362360 40 82 00 0C */ bne lbl_8036540C @@ -81,8 +81,8 @@ lbl_80365414: /* 8036541C 0036237C 90 0D 9E 70 */ stw r0, lbl_805A8A30@sda21(r13) /* 80365420 00362380 4E 80 00 20 */ blr -.global sub_80365424 -sub_80365424: +.global sub_80365424__19CStreamAudioManagerFf +sub_80365424__19CStreamAudioManagerFf: /* 80365424 00362384 C0 02 CD B0 */ lfs f0, lbl_805AEAD0@sda21(r2) /* 80365428 00362388 C0 4D AA C0 */ lfs f2, lbl_805A9680@sda21(r13) /* 8036542C 0036238C FC 00 08 00 */ fcmpu cr0, f0, f1 @@ -439,8 +439,8 @@ lbl_803658FC: /* 80365904 00362864 38 21 00 10 */ addi r1, r1, 0x10 /* 80365908 00362868 4E 80 00 20 */ blr -.global sub_8036590c -sub_8036590c: +.global sub_8036590c__19CStreamAudioManagerFf +sub_8036590c__19CStreamAudioManagerFf: /* 8036590C 0036286C 94 21 FF E0 */ stwu r1, -0x20(r1) /* 80365910 00362870 7C 08 02 A6 */ mflr r0 /* 80365914 00362874 C0 02 CD B0 */ lfs f0, lbl_805AEAD0@sda21(r2) @@ -544,8 +544,8 @@ lbl_80365A54: /* 80365A64 003629C4 38 21 00 10 */ addi r1, r1, 0x10 /* 80365A68 003629C8 4E 80 00 20 */ blr -.global "SetCurrentAudio__19CStreamAudioManagerFRCQ24rstl66basic_string,Q24rstl17rmemory_allocator>fUc" -"SetCurrentAudio__19CStreamAudioManagerFRCQ24rstl66basic_string,Q24rstl17rmemory_allocator>fUc": +.global "SetCurrentAudio__19CStreamAudioManagerFRCQ24rstl66basic_string,Q24rstl17rmemory_allocator>ffUc" +"SetCurrentAudio__19CStreamAudioManagerFRCQ24rstl66basic_string,Q24rstl17rmemory_allocator>ffUc": /* 80365A6C 003629CC 94 21 FF C0 */ stwu r1, -0x40(r1) /* 80365A70 003629D0 7C 08 02 A6 */ mflr r0 /* 80365A74 003629D4 90 01 00 44 */ stw r0, 0x44(r1) @@ -637,8 +637,8 @@ lbl_80365B90: /* 80365BB0 00362B10 38 21 00 40 */ addi r1, r1, 0x40 /* 80365BB4 00362B14 4E 80 00 20 */ blr -.global "SetDefaultAudio__19CStreamAudioManagerFRCQ24rstl66basic_string,Q24rstl17rmemory_allocator>fUc" -"SetDefaultAudio__19CStreamAudioManagerFRCQ24rstl66basic_string,Q24rstl17rmemory_allocator>fUc": +.global "SetDefaultAudio__19CStreamAudioManagerFRCQ24rstl66basic_string,Q24rstl17rmemory_allocator>ffUc" +"SetDefaultAudio__19CStreamAudioManagerFRCQ24rstl66basic_string,Q24rstl17rmemory_allocator>ffUc": /* 80365BB8 00362B18 94 21 FF E0 */ stwu r1, -0x20(r1) /* 80365BBC 00362B1C 7C 08 02 A6 */ mflr r0 /* 80365BC0 00362B20 3C A0 80 5A */ lis r5, lbl_805A6B60@ha @@ -658,7 +658,7 @@ lbl_80365B90: /* 80365BF8 00362B58 7F C3 F3 78 */ mr r3, r30 /* 80365BFC 00362B5C FC 40 F8 90 */ fmr f2, f31 /* 80365C00 00362B60 7F E4 FB 78 */ mr r4, r31 -/* 80365C04 00362B64 4B FF FE 69 */ bl "SetCurrentAudio__19CStreamAudioManagerFRCQ24rstl66basic_string,Q24rstl17rmemory_allocator>fUc" +/* 80365C04 00362B64 4B FF FE 69 */ bl "SetCurrentAudio__19CStreamAudioManagerFRCQ24rstl66basic_string,Q24rstl17rmemory_allocator>ffUc" /* 80365C08 00362B68 80 01 00 24 */ lwz r0, 0x24(r1) /* 80365C0C 00362B6C CB E1 00 18 */ lfd f31, 0x18(r1) /* 80365C10 00362B70 CB C1 00 10 */ lfd f30, 0x10(r1) @@ -767,8 +767,8 @@ lbl_80365D60: /* 80365D78 00362CD8 38 21 00 20 */ addi r1, r1, 0x20 /* 80365D7C 00362CDC 4E 80 00 20 */ blr -.global Start__19CStreamAudioManagerFiRCQ24rstl6stringib -Start__19CStreamAudioManagerFiRCQ24rstl6stringib: +.global "Start__19CStreamAudioManagerFiRCQ24rstl66basic_string,Q24rstl17rmemory_allocator>ibff" +"Start__19CStreamAudioManagerFiRCQ24rstl66basic_string,Q24rstl17rmemory_allocator>ibff": /* 80365D80 00362CE0 94 21 FF 60 */ stwu r1, -0xa0(r1) /* 80365D84 00362CE4 7C 08 02 A6 */ mflr r0 /* 80365D88 00362CE8 90 01 00 A4 */ stw r0, 0xa4(r1) @@ -1113,7 +1113,7 @@ UpdateDSP__19CStreamAudioManagerFif: /* 80366254 003631B4 C0 5F 00 1C */ lfs f2, 0x1c(r31) /* 80366258 003631B8 54 05 06 3E */ clrlwi r5, r0, 0x18 /* 8036625C 003631BC 88 DF 00 28 */ lbz r6, 0x28(r31) -/* 80366260 003631C0 4B FF FB 21 */ bl Start__19CStreamAudioManagerFiRCQ24rstl6stringib +/* 80366260 003631C0 4B FF FB 21 */ bl "Start__19CStreamAudioManagerFiRCQ24rstl66basic_string,Q24rstl17rmemory_allocator>ibff" /* 80366264 003631C4 38 61 00 0C */ addi r3, r1, 0xc /* 80366268 003631C8 48 00 02 E9 */ bl __ct__20SDSPStreamCacheEntryFv /* 8036626C 003631CC 7F E3 FB 78 */ mr r3, r31 diff --git a/asm/Kyoto/Text/CTextParser.s b/asm/Kyoto/Text/CTextParser.s index a25506ab..1141fc47 100644 --- a/asm/Kyoto/Text/CTextParser.s +++ b/asm/Kyoto/Text/CTextParser.s @@ -761,7 +761,7 @@ GetImage__11CTextParserFPCwi: lbl_80304D24: /* 80304D24 00301C84 38 61 01 C8 */ addi r3, r1, 0x1c8 /* 80304D28 00301C88 38 80 00 2C */ li r4, 0x2c -/* 80304D2C 00301C8C 4B F0 74 29 */ bl sub_8020c154 +/* 80304D2C 00301C8C 4B F0 74 29 */ bl "sub_8020c154__FRCQ24rstl66basic_string,Q24rstl17rmemory_allocator>ii" /* 80304D30 00301C90 2C 03 FF FF */ cmpwi r3, -1 /* 80304D34 00301C94 41 82 00 10 */ beq lbl_80304D44 /* 80304D38 00301C98 3B 39 00 01 */ addi r25, r25, 1 @@ -1680,4 +1680,3 @@ lbl_803D6EA0: .asciz "A" .asciz "SA" .asciz "SI" - diff --git a/asm/MetroidPrime/CFrontEndUI.s b/asm/MetroidPrime/CFrontEndUI.s index 50b18b62..8ae082f2 100644 --- a/asm/MetroidPrime/CFrontEndUI.s +++ b/asm/MetroidPrime/CFrontEndUI.s @@ -2786,7 +2786,7 @@ __dt__11CFrontEndUIFv: /* 8001D9D8 0001A938 48 32 01 09 */ bl "internal_dereference__Q24rstl66basic_string,Q24rstl17rmemory_allocator>Fv" lbl_8001D9DC: /* 8001D9DC 0001A93C C0 22 82 9C */ lfs f1, lbl_805A9FBC@sda21(r2) -/* 8001D9E0 0001A940 48 34 7F 2D */ bl sub_8036590c +/* 8001D9E0 0001A940 48 34 7F 2D */ bl sub_8036590c__19CStreamAudioManagerFf /* 8001D9E4 0001A944 34 1E 00 F0 */ addic. r0, r30, 0xf0 /* 8001D9E8 0001A948 41 82 00 10 */ beq lbl_8001D9F8 /* 8001D9EC 0001A94C 80 7E 00 F0 */ lwz r3, 0xf0(r30) diff --git a/asm/MetroidPrime/CInGameTweakManager.s b/asm/MetroidPrime/CInGameTweakManager.s index 3c34a683..c454172e 100644 --- a/asm/MetroidPrime/CInGameTweakManager.s +++ b/asm/MetroidPrime/CInGameTweakManager.s @@ -729,8 +729,8 @@ lbl_8021CB2C: /* 8021CB30 00219A90 38 21 00 60 */ addi r1, r1, 0x60 /* 8021CB34 00219A94 4E 80 00 20 */ blr -.global sub_8021cb38__19CInGameTweakManagerFv -sub_8021cb38__19CInGameTweakManagerFv: +.global "sub_8021cb38__19CInGameTweakManagerFUiRCQ24rstl66basic_string,Q24rstl17rmemory_allocator>" +"sub_8021cb38__19CInGameTweakManagerFUiRCQ24rstl66basic_string,Q24rstl17rmemory_allocator>": /* 8021CB38 00219A98 94 21 FF E0 */ stwu r1, -0x20(r1) /* 8021CB3C 00219A9C 7C 08 02 A6 */ mflr r0 /* 8021CB40 00219AA0 3C C0 80 3D */ lis r6, lbl_803D3038@ha diff --git a/asm/MetroidPrime/CWorld.s b/asm/MetroidPrime/CWorld.s index 3517d195..77da3fb2 100644 --- a/asm/MetroidPrime/CWorld.s +++ b/asm/MetroidPrime/CWorld.s @@ -3457,7 +3457,7 @@ lbl_80058A1C: /* 80058A30 00055990 38 7F 00 84 */ addi r3, r31, 0x84 /* 80058A34 00055994 57 24 06 3E */ clrlwi r4, r25, 0x18 /* 80058A38 00055998 FC 40 08 90 */ fmr f2, f1 -/* 80058A3C 0005599C 48 30 D1 7D */ bl "SetDefaultAudio__19CStreamAudioManagerFRCQ24rstl66basic_string,Q24rstl17rmemory_allocator>fUc" +/* 80058A3C 0005599C 48 30 D1 7D */ bl "SetDefaultAudio__19CStreamAudioManagerFRCQ24rstl66basic_string,Q24rstl17rmemory_allocator>ffUc" lbl_80058A40: /* 80058A40 000559A0 38 61 00 B0 */ addi r3, r1, 0xb0 /* 80058A44 000559A4 48 2E 50 9D */ bl "internal_dereference__Q24rstl66basic_string,Q24rstl17rmemory_allocator>Fv" diff --git a/asm/MetroidPrime/ScriptObjects/CScriptStreamedAudio.s b/asm/MetroidPrime/ScriptObjects/CScriptStreamedAudio.s index cc13aba8..35ee0f1d 100644 --- a/asm/MetroidPrime/ScriptObjects/CScriptStreamedAudio.s +++ b/asm/MetroidPrime/ScriptObjects/CScriptStreamedAudio.s @@ -73,8 +73,8 @@ lbl_8020BE74: /* 8020BE88 00208DE8 38 21 00 10 */ addi r1, r1, 0x10 /* 8020BE8C 00208DEC 4E 80 00 20 */ blr -.global sub_8020be90 -sub_8020be90: +.global sub_8020be90__20CScriptStreamedMusicFv +sub_8020be90__20CScriptStreamedMusicFv: /* 8020BE90 00208DF0 94 21 FF 40 */ stwu r1, -0xc0(r1) /* 8020BE94 00208DF4 7C 08 02 A6 */ mflr r0 /* 8020BE98 00208DF8 90 01 00 C4 */ stw r0, 0xc4(r1) @@ -87,7 +87,7 @@ sub_8020be90: /* 8020BEB4 00208E14 38 7F 00 34 */ addi r3, r31, 0x34 /* 8020BEB8 00208E18 38 80 00 7C */ li r4, 0x7c /* 8020BEBC 00208E1C 38 A0 00 00 */ li r5, 0 -/* 8020BEC0 00208E20 48 00 02 95 */ bl sub_8020c154 +/* 8020BEC0 00208E20 48 00 02 95 */ bl "sub_8020c154__FRCQ24rstl66basic_string,Q24rstl17rmemory_allocator>ii" /* 8020BEC4 00208E24 2C 03 FF FF */ cmpwi r3, -1 /* 8020BEC8 00208E28 40 82 01 B4 */ bne lbl_8020C07C /* 8020BECC 00208E2C 80 7F 00 3C */ lwz r3, 0x3c(r31) @@ -265,8 +265,8 @@ lbl_8020C07C: /* 8020C14C 002090AC 38 21 00 20 */ addi r1, r1, 0x20 /* 8020C150 002090B0 4E 80 00 20 */ blr -.global sub_8020c154 -sub_8020c154: +.global "sub_8020c154__FRCQ24rstl66basic_string,Q24rstl17rmemory_allocator>ii" +"sub_8020c154__FRCQ24rstl66basic_string,Q24rstl17rmemory_allocator>ii": /* 8020C154 002090B4 94 21 FF C0 */ stwu r1, -0x40(r1) /* 8020C158 002090B8 2C 05 FF FF */ cmpwi r5, -1 /* 8020C15C 002090BC 98 81 00 08 */ stb r4, 8(r1) @@ -362,7 +362,7 @@ TweakOverride__20CScriptStreamedMusicFR13CStateManager: /* 8020C28C 002091EC 7C 86 00 2E */ lwzx r4, r6, r0 /* 8020C290 002091F0 90 E1 00 10 */ stw r7, 0x10(r1) /* 8020C294 002091F4 80 84 00 84 */ lwz r4, 0x84(r4) -/* 8020C298 002091F8 48 01 08 A1 */ bl sub_8021cb38__19CInGameTweakManagerFv +/* 8020C298 002091F8 48 01 08 A1 */ bl "sub_8021cb38__19CInGameTweakManagerFUiRCQ24rstl66basic_string,Q24rstl17rmemory_allocator>" /* 8020C29C 002091FC 38 61 00 34 */ addi r3, r1, 0x34 /* 8020C2A0 00209200 38 81 00 14 */ addi r4, r1, 0x14 /* 8020C2A4 00209204 48 13 1E BD */ bl "__ct__Q24rstl66basic_string,Q24rstl17rmemory_allocator>FRCQ24rstl66basic_string,Q24rstl17rmemory_allocator>" @@ -400,7 +400,7 @@ TweakOverride__20CScriptStreamedMusicFR13CStateManager: /* 8020C324 00209284 D3 FE 00 4C */ stfs f31, 0x4c(r30) /* 8020C328 00209288 48 00 03 FD */ bl nullsub_42 /* 8020C32C 0020928C 7F C3 F3 78 */ mr r3, r30 -/* 8020C330 00209290 4B FF FB 61 */ bl sub_8020be90 +/* 8020C330 00209290 4B FF FB 61 */ bl sub_8020be90__20CScriptStreamedMusicFv /* 8020C334 00209294 38 61 00 24 */ addi r3, r1, 0x24 /* 8020C338 00209298 48 13 17 A9 */ bl "internal_dereference__Q24rstl66basic_string,Q24rstl17rmemory_allocator>Fv" lbl_8020C33C: @@ -449,27 +449,27 @@ StartStream__20CScriptStreamedMusicFR13CStateManager: /* 8020C3CC 0020932C C0 5F 00 4C */ lfs f2, 0x4c(r31) /* 8020C3D0 00209330 54 05 06 3E */ clrlwi r5, r0, 0x18 /* 8020C3D4 00209334 88 DF 00 47 */ lbz r6, 0x47(r31) -/* 8020C3D8 00209338 48 15 99 A9 */ bl Start__19CStreamAudioManagerFiRCQ24rstl6stringib +/* 8020C3D8 00209338 48 15 99 A9 */ bl "Start__19CStreamAudioManagerFiRCQ24rstl66basic_string,Q24rstl17rmemory_allocator>ibff" /* 8020C3DC 0020933C 80 01 00 14 */ lwz r0, 0x14(r1) /* 8020C3E0 00209340 83 E1 00 0C */ lwz r31, 0xc(r1) /* 8020C3E4 00209344 7C 08 03 A6 */ mtlr r0 /* 8020C3E8 00209348 38 21 00 10 */ addi r1, r1, 0x10 /* 8020C3EC 0020934C 4E 80 00 20 */ blr -.global sub_8020c3f0 -sub_8020c3f0: +.global sub_8020c3f0__20CScriptStreamedMusicFR13CStateManager +sub_8020c3f0__20CScriptStreamedMusicFR13CStateManager: /* 8020C3F0 00209350 94 21 FF F0 */ stwu r1, -0x10(r1) /* 8020C3F4 00209354 7C 08 02 A6 */ mflr r0 /* 8020C3F8 00209358 90 01 00 14 */ stw r0, 0x14(r1) /* 8020C3FC 0020935C C0 23 00 4C */ lfs f1, 0x4c(r3) -/* 8020C400 00209360 48 15 95 0D */ bl sub_8036590c +/* 8020C400 00209360 48 15 95 0D */ bl sub_8036590c__19CStreamAudioManagerFf /* 8020C404 00209364 80 01 00 14 */ lwz r0, 0x14(r1) /* 8020C408 00209368 7C 08 03 A6 */ mtlr r0 /* 8020C40C 0020936C 38 21 00 10 */ addi r1, r1, 0x10 /* 8020C410 00209370 4E 80 00 20 */ blr -.global sub_8020c414 -sub_8020c414: +.global sub_8020c414__20CScriptStreamedMusicFR13CStateManager +sub_8020c414__20CScriptStreamedMusicFR13CStateManager: /* 8020C414 00209374 94 21 FF F0 */ stwu r1, -0x10(r1) /* 8020C418 00209378 7C 08 02 A6 */ mflr r0 /* 8020C41C 0020937C 7C 64 1B 78 */ mr r4, r3 @@ -483,14 +483,14 @@ sub_8020c414: /* 8020C43C 0020939C 38 64 00 34 */ addi r3, r4, 0x34 /* 8020C440 002093A0 C0 44 00 48 */ lfs f2, 0x48(r4) /* 8020C444 002093A4 54 04 06 3E */ clrlwi r4, r0, 0x18 -/* 8020C448 002093A8 48 15 97 71 */ bl "SetDefaultAudio__19CStreamAudioManagerFRCQ24rstl66basic_string,Q24rstl17rmemory_allocator>fUc" +/* 8020C448 002093A8 48 15 97 71 */ bl "SetDefaultAudio__19CStreamAudioManagerFRCQ24rstl66basic_string,Q24rstl17rmemory_allocator>ffUc" /* 8020C44C 002093AC 48 00 00 18 */ b lbl_8020C464 lbl_8020C450: /* 8020C450 002093B0 C0 24 00 4C */ lfs f1, 0x4c(r4) /* 8020C454 002093B4 38 64 00 34 */ addi r3, r4, 0x34 /* 8020C458 002093B8 C0 44 00 48 */ lfs f2, 0x48(r4) /* 8020C45C 002093BC 54 04 06 3E */ clrlwi r4, r0, 0x18 -/* 8020C460 002093C0 48 15 96 0D */ bl "SetCurrentAudio__19CStreamAudioManagerFRCQ24rstl66basic_string,Q24rstl17rmemory_allocator>fUc" +/* 8020C460 002093C0 48 15 96 0D */ bl "SetCurrentAudio__19CStreamAudioManagerFRCQ24rstl66basic_string,Q24rstl17rmemory_allocator>ffUc" lbl_8020C464: /* 8020C464 002093C4 80 01 00 14 */ lwz r0, 0x14(r1) /* 8020C468 002093C8 7C 08 03 A6 */ mtlr r0 @@ -508,7 +508,7 @@ Stop__20CScriptStreamedMusicFR13CStateManager: /* 8020C48C 002093EC 4B FF FE E1 */ bl StopStream__20CScriptStreamedMusicFR13CStateManager /* 8020C490 002093F0 48 00 00 08 */ b lbl_8020C498 lbl_8020C494: -/* 8020C494 002093F4 4B FF FF 5D */ bl sub_8020c3f0 +/* 8020C494 002093F4 4B FF FF 5D */ bl sub_8020c3f0__20CScriptStreamedMusicFR13CStateManager lbl_8020C498: /* 8020C498 002093F8 80 01 00 14 */ lwz r0, 0x14(r1) /* 8020C49C 002093FC 7C 08 03 A6 */ mtlr r0 @@ -535,7 +535,7 @@ Play__20CScriptStreamedMusicFR13CStateManager: lbl_8020C4E4: /* 8020C4E4 00209444 7F C3 F3 78 */ mr r3, r30 /* 8020C4E8 00209448 7F E4 FB 78 */ mr r4, r31 -/* 8020C4EC 0020944C 4B FF FF 29 */ bl sub_8020c414 +/* 8020C4EC 0020944C 4B FF FF 29 */ bl sub_8020c414__20CScriptStreamedMusicFR13CStateManager lbl_8020C4F0: /* 8020C4F0 00209450 80 01 00 14 */ lwz r0, 0x14(r1) /* 8020C4F4 00209454 83 E1 00 0C */ lwz r31, 0xc(r1) @@ -627,7 +627,7 @@ lbl_8020C600: /* 8020C61C 0020957C 48 00 00 38 */ b lbl_8020C654 lbl_8020C620: /* 8020C620 00209580 C0 3D 00 48 */ lfs f1, 0x48(r29) -/* 8020C624 00209584 48 15 8D D5 */ bl sub_803653f8 +/* 8020C624 00209584 48 15 8D D5 */ bl sub_803653f8__19CStreamAudioManagerFf /* 8020C628 00209588 48 00 00 2C */ b lbl_8020C654 lbl_8020C62C: /* 8020C62C 0020958C 88 1D 00 45 */ lbz r0, 0x45(r29) @@ -640,7 +640,7 @@ lbl_8020C62C: /* 8020C648 002095A8 48 00 00 0C */ b lbl_8020C654 lbl_8020C64C: /* 8020C64C 002095AC C0 3D 00 4C */ lfs f1, 0x4c(r29) -/* 8020C650 002095B0 48 15 8D D5 */ bl sub_80365424 +/* 8020C650 002095B0 48 15 8D D5 */ bl sub_80365424__19CStreamAudioManagerFf lbl_8020C654: /* 8020C654 002095B4 80 01 00 24 */ lwz r0, 0x24(r1) /* 8020C658 002095B8 83 E1 00 1C */ lwz r31, 0x1c(r1) diff --git a/include/Kyoto/Audio/CStreamAudioManager.hpp b/include/Kyoto/Audio/CStreamAudioManager.hpp index da551324..ca3aeae5 100644 --- a/include/Kyoto/Audio/CStreamAudioManager.hpp +++ b/include/Kyoto/Audio/CStreamAudioManager.hpp @@ -18,6 +18,13 @@ public: static void Start(int, const rstl::string&, int, bool, float, float); static void Stop(int, const rstl::string&); + static void sub_803653f8(float); + static void sub_80365424(float); + static void sub_8036590c(float); + + static void SetDefaultAudio(const rstl::string&, float, float, unsigned char); + static void SetCurrentAudio(const rstl::string&, float, float, unsigned char); + private: }; diff --git a/include/Kyoto/rstl/StringExtras.hpp b/include/Kyoto/rstl/StringExtras.hpp index 57feadbd..9f153ccf 100644 --- a/include/Kyoto/rstl/StringExtras.hpp +++ b/include/Kyoto/rstl/StringExtras.hpp @@ -5,7 +5,7 @@ class CStringExtras { public: - static bool CompareCaseInsensitive(const rstl::string&, const rstl::string&); + static int CompareCaseInsensitive(const rstl::string&, const rstl::string&); static int IndexOfSubstring(const rstl::string&, const rstl::string&); }; diff --git a/include/MetroidPrime/CInGameTweakManager.hpp b/include/MetroidPrime/CInGameTweakManager.hpp index 9d910cac..7f8b7b73 100644 --- a/include/MetroidPrime/CInGameTweakManager.hpp +++ b/include/MetroidPrime/CInGameTweakManager.hpp @@ -62,7 +62,7 @@ public: const CTweakValue* GetTweakValue(const rstl::string& name) const; bool ReadFromMemoryCard(const rstl::string&); - static rstl::string sub_8021cb38(); + static rstl::string sub_8021cb38(CAssetId, const rstl::string&); static rstl::string GetIdentifierForMidiEvent(CAssetId world, CAssetId area, const rstl::string& midiObj); diff --git a/include/MetroidPrime/ScriptObjects/CScriptStreamedAudio.hpp b/include/MetroidPrime/ScriptObjects/CScriptStreamedAudio.hpp index bb13dac6..5ced508e 100644 --- a/include/MetroidPrime/ScriptObjects/CScriptStreamedAudio.hpp +++ b/include/MetroidPrime/ScriptObjects/CScriptStreamedAudio.hpp @@ -30,6 +30,10 @@ private: void StopStream(CStateManager& mgr); void StartStream(CStateManager& mgr); void TweakOverride(CStateManager& mgr); + + void sub_8020c3f0(CStateManager& mgr); + void sub_8020c414(CStateManager& mgr); + rstl::string sub_8020be90(); }; #endif // _CSCRIPTSTREAMEDAUDIO diff --git a/include/rstl/string.hpp b/include/rstl/string.hpp index 149d4234..ca389437 100644 --- a/include/rstl/string.hpp +++ b/include/rstl/string.hpp @@ -141,6 +141,7 @@ string string_l(const char* data); // } string operator+(const string&, const string&); +string operator+(const string&, char); CHECK_SIZEOF(string, 0x10) } // namespace rstl diff --git a/src/MetroidPrime/ScriptObjects/CScriptStreamedAudio.cpp b/src/MetroidPrime/ScriptObjects/CScriptStreamedAudio.cpp index c4e1b226..5342e00d 100644 --- a/src/MetroidPrime/ScriptObjects/CScriptStreamedAudio.cpp +++ b/src/MetroidPrime/ScriptObjects/CScriptStreamedAudio.cpp @@ -1,17 +1,15 @@ #include "MetroidPrime/ScriptObjects/CScriptStreamedAudio.hpp" #include "MetroidPrime/CGameArea.hpp" -#include "MetroidPrime/CWorld.hpp" #include "MetroidPrime/CInGameTweakManager.hpp" +#include "MetroidPrime/CWorld.hpp" +#include "Kyoto/CDvdFile.hpp" #include "Kyoto/Audio/CStreamAudioManager.hpp" #include "Kyoto/rstl/StringExtras.hpp" -extern "C" void nullsub_42(); -extern "C" void sub_8020c414(CScriptStreamedMusic*, CStateManager& mgr); -extern "C" void sub_8020c3f0(); -extern "C" void sub_8020c154(); -extern "C" rstl::string sub_8020be90(); +extern "C" void nullsub_42(CScriptStreamedMusic*); +int sub_8020c154(const rstl::string&, int, int); int CScriptStreamedMusic::IsOneShot(bool b) { return b == false; } @@ -29,16 +27,14 @@ CScriptStreamedMusic::CScriptStreamedMusic(TUniqueId id, const CEntityInfo& info , x48_fadeIn(fadeIn) , x4c_fadeOut(fadeOut) , x50_volume(volume) { - nullsub_42(); + nullsub_42(this); } -extern "C" void nullsub_42() {} +extern "C" void nullsub_42(CScriptStreamedMusic*) {} bool CScriptStreamedMusic::IsDSPFile(const rstl::string& fileName) { - if (CStringExtras::CompareCaseInsensitive(fileName, rstl::string_l("sw"))) { - return true; - } - return CStringExtras::IndexOfSubstring(fileName, rstl::string_l(".dsp")) != -1; + return !CStringExtras::CompareCaseInsensitive(fileName, rstl::string_l("sw")) || + CStringExtras::IndexOfSubstring(fileName, rstl::string_l(".dsp")) != -1; } void CScriptStreamedMusic::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId objId, @@ -55,16 +51,30 @@ void CScriptStreamedMusic::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId o Stop(stateMgr); } break; + case kSM_Deactivate: + if (((x45_fileIsDsp == false) && (x44_noStopOnDeactivate == false)) || + (x45_fileIsDsp != false)) { + Stop(stateMgr); + } + break; + case kSM_Increment: - if (IsOneShot(x45_fileIsDsp)) { - CStreamAudioManager::FadeBackIn(!x46_loop, x48_fadeIn); + if (x45_fileIsDsp) { + CStreamAudioManager::FadeBackIn(IsOneShot(x46_loop), x48_fadeIn); + } else { + CStreamAudioManager::sub_803653f8(x48_fadeIn); } + break; + case kSM_Decrement: - if (IsOneShot(x45_fileIsDsp)) { - CStreamAudioManager::TemporaryFadeOut(!x46_loop, x4c_fadeOut); + if (x45_fileIsDsp) { + CStreamAudioManager::TemporaryFadeOut(IsOneShot(x46_loop), x4c_fadeOut); + } else { + CStreamAudioManager::sub_80365424(x4c_fadeOut); } break; + default: break; } @@ -77,7 +87,7 @@ void CScriptStreamedMusic::Play(CStateManager& mgr) { if (x45_fileIsDsp) { StartStream(mgr); } else { - sub_8020c414(this, mgr); + sub_8020c414(mgr); } } @@ -85,17 +95,26 @@ void CScriptStreamedMusic::Stop(CStateManager& mgr) { if (x45_fileIsDsp) { StopStream(mgr); } else { - sub_8020c3f0(); + sub_8020c3f0(mgr); } } -extern "C" void sub_8020c414(CScriptStreamedMusic*, CStateManager& mgr) {} +void CScriptStreamedMusic::sub_8020c414(CStateManager& mgr) { + uint volume = x50_volume; + if (x44_noStopOnDeactivate) { + CStreamAudioManager::SetDefaultAudio(x34_fileName, x4c_fadeOut, x48_fadeIn, volume); + } else { + CStreamAudioManager::SetCurrentAudio(x34_fileName, x4c_fadeOut, x48_fadeIn, volume); + } +} -extern "C" void sub_8020c3f0() {} +void CScriptStreamedMusic::sub_8020c3f0(CStateManager& mgr) { + CStreamAudioManager::sub_8036590c(x4c_fadeOut); +} void CScriptStreamedMusic::StartStream(CStateManager& mgr) { - CStreamAudioManager::Start(IsOneShot(x46_loop), x34_fileName, x50_volume, x47_music, x48_fadeIn, - x4c_fadeOut); + CStreamAudioManager::Start(IsOneShot(x46_loop), x34_fileName, x50_volume & 0xff, x47_music, + x48_fadeIn, x4c_fadeOut); } void CScriptStreamedMusic::StopStream(CStateManager& mgr) { @@ -105,22 +124,34 @@ void CScriptStreamedMusic::StopStream(CStateManager& mgr) { void CScriptStreamedMusic::TweakOverride(CStateManager& mgr) { const CWorld* wld = mgr.GetWorld(); const CGameArea& area = wld->GetAreaAlways(GetCurrentAreaId()); - rstl::string twkName = CInGameTweakManager::sub_8021cb38(); + rstl::string twkName = CInGameTweakManager::sub_8021cb38(area.GetAreaAssetId(), GetDebugName()); if (gpTweakManager->HasTweakValue(twkName)) { const CTweakValue::Audio& audio = gpTweakManager->GetTweakValue(twkName)->GetAudio(); + float volume = audio.GetVolume() * 127.f; + x34_fileName = audio.GetFileName(); x45_fileIsDsp = IsDSPFile(x34_fileName); x48_fadeIn = audio.GetFadeIn(); + x50_volume = volume; x4c_fadeOut = audio.GetFadeOut(); - x50_volume = audio.GetVolume() * 127.f; + nullsub_42(this); sub_8020be90(); } } -extern "C" void sub_8020c154() { - -} +int sub_8020c154(const rstl::string&, int, int) {} -extern "C" rstl::string sub_8020be90() { +rstl::string CScriptStreamedMusic::sub_8020be90() { + if (x45_fileIsDsp && sub_8020c154(x34_fileName, 0x7c, 0) == -1 && x34_fileName.size() >= 4) { + if (CStringExtras::CompareCaseInsensitive( + rstl::string_l(x34_fileName.data() + (x34_fileName.size() - 5)), + rstl::string_l("L.dsp")) == 0) { + rstl::string buf; + rstl::string file = buf + "R.dsp"; + if (CDvdFile::FileExists(file.data())) { + x34_fileName = x34_fileName + '|' + file; + } + } + } }