diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index af09ffa0..f26f2490 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -124,6 +124,7 @@ toBeSorted/d_effects_2.cpp: toBeSorted/sound_info.cpp: .text start:0x8002C130 end:0x8002C3A0 align:16 + .data start:0x80501528 end:0x80501538 d/a/d_a_base.cpp: .text start:0x8002C3A0 end:0x8002DE40 align:16 @@ -2601,6 +2602,7 @@ d/snd/d_snd_sound.cpp: d/snd/d_snd_player_mgr.cpp: .text start:0x8035DA90 end:0x8035F04C align:16 .data start:0x80548758 end:0x805487A0 + .sdata start:0x80574090 end:0x80574098 .sbss start:0x80575D38 end:0x80575D40 .sdata2 start:0x8057D380 end:0x8057D390 @@ -2617,16 +2619,46 @@ d/snd/d_snd_3d_manager.cpp: .sbss start:0x80575D58 end:0x80575D60 .sdata2 start:0x8057D3B8 end:0x8057D3F8 -d/snd/d_snd_stage_mgr.cpp: +d/snd/d_snd_state_mgr.cpp: .text start:0x80361460 end:0x8036642C align:16 .ctors start:0x804DB918 end:0x804DB91C + .data start:0x805487E0 end:0x80548A28 + .sdata start:0x80574098 end:0x80574198 + .sbss start:0x80575D60 end:0x80575D78 + .sdata2 start:0x8057D3F8 end:0x8057D450 -d/snd/d_snd_unk_component_2.cpp: - .text start:0x80366430 end:0x8036A3A4 align:16 +d/snd/d_snd_stage_reverb.cpp: + .text start:0x80366430 end:0x803665E4 align:16 + .sdata2 start:0x8057D450 end:0x8057D478 + +d/snd/d_snd_stage_data.cpp: + .rodata start:0x804F0D80 end:0x804F2308 + .sdata2 start:0x8057D478 end:0x8057D7C0 + +d/snd/d_snd_stage_callbacks.cpp: + .text start:0x803665F0 end:0x8036740C align:16 + .data start:0x80548A28 end:0x80548A48 + .sdata start:0x80574198 end:0x805741A0 + .sdata2 start:0x8057D7C0 end:0x8057D808 + +d/snd/d_snd_event_callbacks.cpp: + .text start:0x80367410 end:0x803698F8 align:16 + .rodata start:0x804F2308 end:0x804F3678 + .data start:0x80548A48 end:0x80548A58 + .sdata start:0x805741A0 end:0x805741F8 + .sdata2 start:0x8057D808 end:0x8057D8A0 + +d/snd/d_snd_event_demo_callbacks.cpp: + .text start:0x80369900 end:0x8036A3A4 align:16 + .rodata start:0x804F3678 end:0x804F37E8 + .data start:0x80548A58 end:0x80548B08 + .sdata start:0x805741F8 end:0x80574200 + .sdata2 start:0x8057D8A0 end:0x8057D8B0 d/snd/d_snd_area_sound_effect_mgr.cpp: .text start:0x8036A3B0 end:0x8036B8D0 align:16 - .data start:0x80548B38 end:0x80548B48 + .data start:0x80548B08 end:0x80548B48 + .sdata start:0x80574200 end:0x80574210 .sbss start:0x80575D78 end:0x80575D80 .sdata2 start:0x8057D8B0 end:0x8057D8E8 @@ -2647,36 +2679,81 @@ d/snd/d_snd_control_player.cpp: d/snd/d_snd_bgm_mgr.cpp: .text start:0x8036C6B0 end:0x803739CC align:16 + .data start:0x80548CC8 end:0x80548F98 + .sdata start:0x80574210 end:0x80574268 .sbss start:0x80575D80 end:0x80575D88 .sdata2 start:0x8057D940 end:0x8057D970 d/snd/d_snd_bgm_sound_callbacks.cpp: .text start:0x803739D0 end:0x80378ECC align:16 + .rodata start:0x804F37E8 end:0x804F3858 + .data start:0x80548F98 end:0x80549088 + .sdata start:0x80574268 end:0x805742B8 .sdata2 start:0x8057D970 end:0x8057DA50 -d/snd/d_snd_bgm_sound_boss_callbacks.cpp: +d/snd/d_snd_bgm_sound_battle_callbacks.cpp: .text start:0x80378ED0 end:0x80379D20 align:16 + .sdata start:0x805742B8 end:0x805742F0 .sdata2 start:0x8057DA50 end:0x8057DA58 d/snd/d_snd_bgm_sound.cpp: - .text start:0x80379D20 end:0x8037BA68 align:16 + .text start:0x80379D20 end:0x8037B4D8 align:16 + .data start:0x80549088 end:0x80549100 .sbss start:0x80575D88 end:0x80575D90 + .sdata2 start:0x8057DA58 end:0x8057DA60 -d/snd/d_snd_unk_15.cpp: - .text start:0x8037BA70 end:0x8037D800 align:16 +d/snd/d_snd_bgm_sound_battle.cpp: + .text start:0x8037B4E0 end:0x8037B908 align:16 + .data start:0x80549100 end:0x80549148 + +d/snd/d_snd_bgm_sound_harp_mgr.cpp: + .text start:0x8037B910 end:0x8037BA68 align:16 + +d/snd/d_snd_bgm_seq_data_mgr.cpp: + .text start:0x8037BA70 end:0x8037BD24 align:16 + .data start:0x80549148 end:0x80549158 + .sdata start:0x805742F0 end:0x805742F8 + .sbss start:0x80575D90 end:0x80575D98 + +d/snd/d_snd_bgm_reverb.cpp: + .text start:0x8037BD30 end:0x8037BD84 align:16 + .sdata2 start:0x8057DA60 end:0x8057DA80 + +d/snd/d_snd_bgm_seq_config.cpp: + .text start:0x8037BD90 end:0x8037BEA8 align:16 + .rodata start:0x804F3858 end:0x804F38C8 + +d/snd/d_snd_bgm_harp_data.cpp: + .text start:0x8037BEB0 end:0x8037C518 align:16 + +d/snd/d_snd_bgm_mml_parser_base.cpp: + .text start:0x8037C520 end:0x8037D014 align:16 + .data start:0x80549158 end:0x80549168 + +d/snd/d_snd_bgm_mml_parsers.cpp: + .text start:0x8037D020 end:0x8037D800 align:16 + .data start:0x80549168 end:0x805491B8 + .sdata start:0x805742F8 end:0x80574300 d/snd/d_snd_small_effect_mgr.cpp: .text start:0x8037D800 end:0x8037F8B4 align:16 .data start:0x805491B8 end:0x805491D0 + .sdata start:0x80574300 end:0x80574308 .sbss start:0x80575D98 end:0x80575DA0 .sdata2 start:0x8057DA80 end:0x8057DAD0 -d/snd/d_snd_harp_mgr.cpp: - .text start:0x8037F8C0 end:0x80382150 align:16 +d/snd/d_snd_harp_song_mgr.cpp: + .text start:0x8037F8C0 end:0x80381868 align:16 .data start:0x805491D0 end:0x805491E0 + .sdata start:0x80574308 end:0x80574310 .sbss start:0x80575DA0 end:0x80575DA8 .sdata2 start:0x8057DAD0 end:0x8057DB48 +d/snd/d_snd_harp_song_data.cpp: + .text start:0x80381870 end:0x80382150 align:16 + .rodata start:0x804F38C8 end:0x804F38E0 + .sdata2 start:0x8057DB48 end:0x8057DB50 + d/snd/d_snd_anim_sound.cpp: .text start:0x80382150 end:0x8038240C align:16 .sdata2 start:0x8057DB50 end:0x8057DB68 @@ -2684,6 +2761,8 @@ d/snd/d_snd_anim_sound.cpp: d/snd/d_snd_source_mgr.cpp: .text start:0x80382410 end:0x803864C8 align:16 .ctors start:0x804DB91C end:0x804DB920 + .rodata start:0x804F38E0 end:0x804F3970 + .data start:0x805491E0 end:0x8054A680 .sdata start:0x80574310 end:0x805743D0 .sbss start:0x80575DA8 end:0x80575DB0 .sdata2 start:0x8057DB68 end:0x8057DBC0 @@ -2698,29 +2777,193 @@ d/snd/d_snd_source.cpp: .text start:0x803889C0 end:0x8038C408 align:16 .ctors start:0x804DB920 end:0x804DB924 .data start:0x8054A7D0 end:0x8054AAE8 + .sdata start:0x80574708 end:0x80574718 + .sbss start:0x80575DB0 end:0x80575DC0 + .sdata2 start:0x8057DCB0 end:0x8057DCD0 -d/snd/d_snd_mgr_unk_7.cpp: - .text start:0x8038C410 end:0x8038EBF0 align:16 +d/snd/d_snd_source_player.cpp: + .text start:0x8038C410 end:0x8038D548 align:16 + .data start:0x8054AAE8 end:0x8054AF18 + .sdata start:0x80574718 end:0x80574758 + .sdata2 start:0x8057DCD0 end:0x8057DD08 + +d/snd/d_snd_source_player_head.cpp: + .text start:0x8038D550 end:0x8038DD08 align:16 + .data start:0x8054AF18 end:0x8054B1B8 + .sdata2 start:0x8057DD08 end:0x8057DD48 + +d/snd/d_snd_source_enemy.cpp: + .text start:0x8038DD10 end:0x8038E858 align:16 + .data start:0x8054B1B8 end:0x8054B798 + .sdata start:0x80574758 end:0x80574798 + .sdata2 start:0x8057DD48 end:0x8057DD68 + +d/snd/d_snd_source_obj.cpp: + .text start:0x8038E860 end:0x8038EAD8 align:16 + .data start:0x8054B798 end:0x8054BB78 + .sdata start:0x80574798 end:0x805747C0 + .sdata2 start:0x8057DD68 end:0x8057DD70 + +d/snd/d_snd_source_obj_clef.cpp: + .text start:0x8038EAE0 end:0x8038EBF0 align:16 .ctors start:0x804DB924 end:0x804DB928 + .rodata start:0x804F3970 end:0x804F39B8 + .data start:0x8054BB78 end:0x8054BBC0 + .sbss start:0x80575DC0 end:0x80575DC8 + .sdata2 start:0x8057DD70 end:0x8057DDB8 + .bss start:0x805D0FE8 end:0x805D0FF8 + +d/snd/d_snd_source_equipment.cpp: + .text start:0x8038EBF0 end:0x8038F2A8 align:16 + .data start:0x8054BBC0 end:0x8054BFC0 d/snd/d_snd_mgr_unk_8.cpp: - .text start:0x8038EBF0 end:0x8038FF18 align:16 + .text start:0x8038F2B0 end:0x8038FF18 align:16 .ctors start:0x804DB928 end:0x804DB92C -d/snd/d_snd_mgr_unk_9.cpp: - .text start:0x8038FF20 end:0x80390A18 align:16 +d/snd/d_snd_source_npc_head.cpp: + .text start:0x8038FF20 end:0x80390298 align:16 + .data start:0x8054C3A0 end:0x8054C5A0 + .sdata start:0x805747D0 end:0x805747E8 + .sdata2 start:0x8057DDD0 end:0x8057DDD8 + +d/snd/d_snd_source_py_bird.cpp: + .text start:0x803902A0 end:0x80390508 align:16 + .data start:0x8054C5A0 end:0x8054C7B8 + .sdata start:0x805747E8 end:0x80574800 + +d/snd/d_snd_source_demo.cpp: + .text start:0x80390510 end:0x80390A20 align:16 .ctors start:0x804DB92C end:0x804DB930 + .data start:0x8054C7B8 end:0x8054C9C0 + .sdata2 start:0x8057DDD8 end:0x8057DDE8 -d/snd/d_snd_mgr_unk_10.cpp: - .text start:0x80390A20 end:0x80393DF4 align:16 +d/snd/d_snd_source_harp_related.cpp: + .text start:0x80390A20 end:0x80392E38 align:16 + .data start:0x8054C9C0 end:0x8054D1C0 + .sdata start:0x80574800 end:0x80574810 + .sdata2 start:0x8057DDE8 end:0x8057DE30 + +d/snd/d_snd_source_tg_sound.cpp: + .text start:0x80392E40 end:0x80393008 align:16 + .data start:0x8054D1C0 end:0x8054D3B0 + .sdata start:0x80574810 end:0x80574818 + +d/snd/d_snd_id_mappers.cpp: + .text start:0x80393010 end:0x803934A8 align:16 + .data start:0x8054D3B0 end:0x8054D400 + .sdata start:0x80574818 end:0x80574830 + .sdata2 start:0x8057DE30 end:0x8057DEB8 + +d/snd/d_snd_id_mappers_data.cpp: + .rodata start:0x804F39B8 end:0x804F3E38 + .sdata2 start:0x8057DEB8 end:0x8057E398 + +d/snd/d_snd_distant_sound_actor_pool.cpp: + .text start:0x803934B0 end:0x80393DF4 align:16 .ctors start:0x804DB930 end:0x804DB934 + .data start:0x8054D400 end:0x8054D410 + .sbss start:0x80575DD0 end:0x80575DD8 + .sdata2 start:0x8057E398 end:0x8057E3B0 + .bss start:0x805D1018 end:0x805D1030 -d/snd/d_snd_mgr_unk_11.cpp: - .text start:0x80393E00 end:0x8039A848 align:16 +d/snd/d_snd_distant_sound_actor.cpp: + .text start:0x80393E00 end:0x80394208 align:16 + .data start:0x8054D410 end:0x8054D470 + +d/snd/d_snd_se_sound.cpp: + .text start:0x80394210 end:0x8039466C align:16 + .data start:0x8054D470 end:0x8054D488 + .sdata2 start:0x8057E3B0 end:0x8057E3B8 + +d/snd/d_snd_se_sound_1.cpp: + .text start:0x80394670 end:0x803946C4 align:16 + .data start:0x8054D488 end:0x8054D4A0 + +d/snd/d_snd_se_sound_2.cpp: + .text start:0x803946D0 end:0x803947AC align:16 + .data start:0x8054D4A0 end:0x8054D4B8 + +d/snd/d_snd_se_sound_pool.cpp: + .text start:0x803947B0 end:0x80394DD4 align:16 + .data start:0x8054D4B8 end:0x8054D4C8 + .sbss start:0x80575DD8 end:0x80575DE0 + +d/snd/d_snd_sound_link_body_callbacks.cpp: + .text start:0x80394DE0 end:0x803957B8 align:16 + .sdata start:0x80574830 end:0x80574860 + .sdata2 start:0x8057E3B8 end:0x8057E400 + +d/snd/d_snd_sound_enemy_callbacks.cpp: + .text start:0x803957C0 end:0x80396104 align:16 + .sdata start:0x80574860 end:0x80574898 + .sdata2 start:0x8057E400 end:0x8057E448 + +d/snd/d_snd_sound_object_callbacks.cpp: + .text start:0x80396110 end:0x80398430 align:16 + .data start:0x8054D4C8 end:0x8054D520 + .sdata start:0x80574898 end:0x805748D8 + .sdata2 start:0x8057E448 end:0x8057E528 + +d/snd/d_snd_sound_equipment_callbacks.cpp: + .text start:0x80398430 end:0x80398AD4 align:16 + .sdata2 start:0x8057E528 end:0x8057E570 + +d/snd/d_snd_sound_npc_callbacks.cpp: + .text start:0x80398AE0 end:0x80398E18 align:16 + .data start:0x8054D520 end:0x8054D730 + .sdata start:0x805748D8 end:0x805748E0 + .sdata2 start:0x8057E570 end:0x8057E598 + +d/snd/d_snd_sound_npc_2_callbacks.cpp: + .text start:0x80398E20 end:0x80398FFC align:16 + .sdata start:0x805748E0 end:0x805748E8 + .sdata2 start:0x8057E598 end:0x8057E5A0 + +d/snd/d_snd_sound_tgsound_callbacks.cpp: + .text start:0x80399000 end:0x8039942C align:16 + .data start:0x8054D730 end:0x8054D740 + .sdata start:0x805748E8 end:0x805748F0 + .sdata2 start:0x8057E5A0 end:0x8057E5C0 + +d/snd/d_snd_rng_link_voice.cpp: + .text start:0x80399430 end:0x80399574 align:16 + .rodata start:0x804F3E38 end:0x804F42F8 + .data start:0x8054D740 end:0x8054D760 + +d/snd/d_snd_fi_vocal_mgr.cpp: + .text start:0x80399580 end:0x80399A3C align:16 + .rodata start:0x804F42F8 end:0x804F4778 + .data start:0x8054D760 end:0x8054D7A8 + .sbss start:0x80575DE0 end:0x80575DE8 + .sdata2 start:0x8057E5C0 end:0x8057E5C8 + +d/snd/d_snd_rng.cpp: + .text start:0x80399A40 end:0x80399BA0 align:16 + .data start:0x8054D7A8 end:0x8054D7B8 + +d/snd/d_snd_rng_mgr.cpp: + .text start:0x80399BA0 end:0x80399D60 align:16 + .data start:0x8054D7B8 end:0x8054D7D0 + .sbss start:0x80575DE8 end:0x80575DF0 + +d/snd/d_snd_rng_id.cpp: + .text start:0x80399D60 end:0x8039A204 align:16 + .data start:0x8054D7D0 end:0x8054D7E0 + +d/snd/d_snd_rng_id_if.cpp: + .text start:0x8039A210 end:0x8039A344 align:16 + +d/snd/d_snd_file_mgr.cpp: + .text start:0x8039A350 end:0x8039A848 align:16 .ctors start:0x804DB934 end:0x804DB938 + .data start:0x8054D7E0 end:0x8054D810 + .bss start:0x805D1030 end:0x805D1050 d/snd/d_snd_calc_pitch.cpp: .text start:0x8039A850 end:0x8039A960 align:16 + .rodata start:0x804F4778 end:0x804F4F00 + .sdata2 start:0x8057E5D8 end:0x8057E5E8 revolution/kpr/kpr_lib.c: .text start:0x8039A960 end:0x8039AF7C align:16 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index d3e51b77..e6d865bf 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -1021,11 +1021,11 @@ fn_8002BFB0 = .text:0x8002BFB0; // type:function size:0x54 fn_8002C010 = .text:0x8002C010; // type:function size:0x58 fn_8002C070 = .text:0x8002C070; // type:function size:0x58 fn_8002C0D0 = .text:0x8002C0D0; // type:function size:0x58 -fn_8002C130 = .text:0x8002C130; // type:function size:0x24 -__dt__16dSoundSourceIf_cFv = .text:0x8002C160; // type:function size:0x40 -fn_8002C1A0 = .text:0x8002C1A0; // type:function size:0xB0 -fn_8002C250 = .text:0x8002C250; // type:function size:0xB8 -fn_8002C310 = .text:0x8002C310; // type:function size:0x90 +__ct__9SoundInfoFP9dAcBase_c = .text:0x8002C130; // type:function size:0x24 +__dt__16dSoundSourceIf_cFv = .text:0x8002C160; // type:function size:0x40 scope:weak +__dt__9SoundInfoFv = .text:0x8002C1A0; // type:function size:0xB0 +initSource__9SoundInfoFlPCcPC7mVec3_c = .text:0x8002C250; // type:function size:0xB8 +startBgHitSound__9SoundInfoFUlRC13cBgS_PolyInfoPC7mVec3_c = .text:0x8002C310; // type:function size:0x90 createHeap__9dAcBase_cFv = .text:0x8002C3A0; // type:function size:0x8 __ct__9dAcBase_cFv = .text:0x8002C3B0; // type:function size:0x178 __dt__7dBase_cFv = .text:0x8002C530; // type:function size:0x58 @@ -1035,7 +1035,7 @@ createSoundSource__9dAcBase_cFv = .text:0x8002C690; // type:function size:0x78 initAllocatorWork1Heap__9dAcBase_cFiPci = .text:0x8002C710; // type:function size:0xC initAllocator__9dAcBase_cFiPcPQ23EGG4Heapi = .text:0x8002C720; // type:function size:0x8C addActorToRoom__9dAcBase_cFl = .text:0x8002C7B0; // type:function size:0x88 -setBit_field_0xE8__9dAcBase_cFl = .text:0x8002C840; // type:function size:0x18 +setTgSndAreaFlag__9dAcBase_cFl = .text:0x8002C840; // type:function size:0x18 actorCreate__9dAcBase_cFv = .text:0x8002C860; // type:function size:0x8 actorPostCreate__9dAcBase_cFv = .text:0x8002C870; // type:function size:0x8 create__9dAcBase_cFv = .text:0x8002C880; // type:function size:0x70 @@ -1069,21 +1069,21 @@ getDistToPlayer__9dAcBase_cFv = .text:0x8002D470; // type:function size:0x30 getSquareDistToPlayer__9dAcBase_cFv = .text:0x8002D4A0; // type:function size:0x10 updateRoomId__9dAcBase_cFf = .text:0x8002D4B0; // type:function size:0x90 isRoomFlags_0x6_Set__9dAcBase_cFv = .text:0x8002D540; // type:function size:0x44 -FUN_8002d590__9dAcBase_cFv = .text:0x8002D590; // type:function size:0x20 +setSoundSourceSubtype__9dAcBase_cFUc = .text:0x8002D590; // type:function size:0x20 FUN_8002d5b0__9dAcBase_cFv = .text:0x8002D5B0; // type:function size:0x20 -playSound__9dAcBase_cFUs = .text:0x8002D5D0; // type:function size:0x28 -FUN_8002d600__9dAcBase_cFv = .text:0x8002D600; // type:function size:0x28 -FUN_8002d630__9dAcBase_cFv = .text:0x8002D630; // type:function size:0x9C -FUN_8002d6d0__9dAcBase_cFv = .text:0x8002D6D0; // type:function size:0x40 -playSoundEffect1__9dAcBase_cFUs = .text:0x8002D710; // type:function size:0x28 -FUN_8002d740__9dAcBase_cFv = .text:0x8002D740; // type:function size:0x28 -FUN_8002d770__9dAcBase_cFUsf = .text:0x8002D770; // type:function size:0x28 -FUN_8002d7a0__9dAcBase_cFv = .text:0x8002D7A0; // type:function size:0x28 -FUN_8002d7d0__9dAcBase_cFv = .text:0x8002D7D0; // type:function size:0x20 -FUN_8002d7f0__9dAcBase_cFv = .text:0x8002D7F0; // type:function size:0x20 -FUN_8002d810__9dAcBase_cFv = .text:0x8002D810; // type:function size:0x20 -FUN_8002d830__9dAcBase_cFv = .text:0x8002D830; // type:function size:0x28 -FUN_8002d860__9dAcBase_cFi = .text:0x8002D860; // type:function size:0x20 +startSound__9dAcBase_cFUl = .text:0x8002D5D0; // type:function size:0x28 +startSoundWithFloatParam__9dAcBase_cFUlf = .text:0x8002D600; // type:function size:0x28 +startBgHitSound__9dAcBase_cFUlRC13cBgS_PolyInfoPC7mVec3_c = .text:0x8002D630; // type:function size:0x9C +startSoundAtPosition__9dAcBase_cFUlPC7mVec3_c = .text:0x8002D6D0; // type:function size:0x40 +holdSound__9dAcBase_cFUl = .text:0x8002D710; // type:function size:0x28 +holdSoundWithIntParam__9dAcBase_cFUll = .text:0x8002D740; // type:function size:0x28 +holdSoundWithFloatParam__9dAcBase_cFUlf = .text:0x8002D770; // type:function size:0x28 +holdSoundWithParams__9dAcBase_cFUlfl = .text:0x8002D7A0; // type:function size:0x28 +holdSoundSourceFlag__9dAcBase_cFUl = .text:0x8002D7D0; // type:function size:0x20 +onSoundSourceFlag__9dAcBase_cFUl = .text:0x8002D7F0; // type:function size:0x20 +offSoundSourceFlag__9dAcBase_cFUl = .text:0x8002D810; // type:function size:0x20 +isPlayingSound__9dAcBase_cFUl = .text:0x8002D830; // type:function size:0x28 +setBattleBgmRelated__9dAcBase_cFi = .text:0x8002D860; // type:function size:0x20 getSoundSource__9dAcBase_cFv = .text:0x8002D880; // type:function size:0x8 removeSoundInfo__9dAcBase_cFP9SoundInfo = .text:0x8002D890; // type:function size:0x88 setActorRef__9dAcBase_cFP9dAcBase_c = .text:0x8002D920; // type:function size:0x8 @@ -1237,7 +1237,7 @@ fn_80032950 = .text:0x80032950; // type:function size:0x8 fn_80032960 = .text:0x80032960; // type:function size:0x94 fn_80032A00 = .text:0x80032A00; // type:function size:0x44 fn_80032A50 = .text:0x80032A50; // type:function size:0x9C -fn_80032AF0 = .text:0x80032AF0; // type:function size:0x4 +d_s_npc_vt_0x1EC__15dSndSourceNpc_cFP15dSndSourceNpc_c = .text:0x80032AF0; // type:function size:0x4 fn_80032B00 = .text:0x80032B00; // type:function size:0x138 fn_80032C40 = .text:0x80032C40; // type:function size:0xE4 fn_80032D30 = .text:0x80032D30; // type:function size:0xAC @@ -2462,7 +2462,7 @@ fn_8005BAC0 = .text:0x8005BAC0; // type:function size:0x10 fn_8005BAD0 = .text:0x8005BAD0; // type:function size:0x10 fn_8005BAE0 = .text:0x8005BAE0; // type:function size:0xC IsLinkOutOfStamina = .text:0x8005BAF0; // type:function size:0x14 -fn_8005BB10 = .text:0x8005BB10; // type:function size:0x8 +getStamina__17daPlayerActBase_cFv = .text:0x8005BB10; // type:function size:0x8 getBoatActorIfRiding = .text:0x8005BB20; // type:function size:0x24 getRidingActor__17daPlayerActBase_cFv = .text:0x8005BB50; // type:function size:0x8 AcNpcTke__setRefInLinkToCall = .text:0x8005BB60; // type:function size:0xC @@ -2609,7 +2609,7 @@ tryGrabItemWithWhip__17daPlayerActBase_cFv = .text:0x8005CCA0; // type:function isWhipOnObject__17daPlayerActBase_cFv = .text:0x8005CCB0; // type:function size:0x8 somethingWithWHip__17daPlayerActBase_cFv = .text:0x8005CCC0; // type:function size:0x8 anotherThingWithWhip__17daPlayerActBase_cFv = .text:0x8005CCD0; // type:function size:0x8 -isUsingWhip__17daPlayerActBase_cFv = .text:0x8005CCE0; // type:function size:0x8 +isUsingWhip__17daPlayerActBase_cCFv = .text:0x8005CCE0; // type:function size:0x8 finishPlayingHarp__17daPlayerActBase_cFv = .text:0x8005CCF0; // type:function size:0x4 isUsingHarp__17daPlayerActBase_cFv = .text:0x8005CD00; // type:function size:0x8 isPullingOutBomb__17daPlayerActBase_cFv = .text:0x8005CD10; // type:function size:0x8 @@ -3977,7 +3977,7 @@ fn_800B9980 = .text:0x800B9980; // type:function size:0xCC checkPositionIsInPastState__14dTimeAreaMgr_cFlRC7mVec3_cPff = .text:0x800B9A50; // type:function size:0x104 fn_800B9B60__14dTimeAreaMgr_cFlRC7mVec3_c = .text:0x800B9B60; // type:function size:0xB4 fn_800B9C20 = .text:0x800B9C20; // type:function size:0xB4 -fn_800B9CE0 = .text:0x800B9CE0; // type:function size:0xA0 +fn_800B9CE0__14dTimeAreaMgr_cFRC7mVec3_c = .text:0x800B9CE0; // type:function size:0xA0 check__14TimeAreaStructFiRC7mVec3_cUlff = .text:0x800B9D80; // type:function size:0x214 fn_800B9FA0 = .text:0x800B9FA0; // type:function size:0x188 fn_800BA130 = .text:0x800BA130; // type:function size:0xC0 @@ -10617,14 +10617,14 @@ finalizeState_ReadStageLayerRes__11dStageMgr_cFv = .text:0x8019AD00; // type:fun initializeState_ReadLayerObjectRes__11dStageMgr_cFv = .text:0x8019AD10; // type:function size:0x19C executeState_ReadLayerObjectRes__11dStageMgr_cFv = .text:0x8019AEB0; // type:function size:0x68 finalizeState_ReadLayerObjectRes__11dStageMgr_cFv = .text:0x8019AF20; // type:function size:0x98 -fn_8019AFC0 = .text:0x8019AFC0; // type:function size:0x28 +soundCallback__FPv = .text:0x8019AFC0; // type:function size:0x28 initializeState_SoundLoadSceneData__11dStageMgr_cFv = .text:0x8019AFF0; // type:function size:0x44 executeState_SoundLoadSceneData__11dStageMgr_cFv = .text:0x8019B040; // type:function size:0x34 finalizeState_SoundLoadSceneData__11dStageMgr_cFv = .text:0x8019B080; // type:function size:0x38 initializeState_CreateObject__11dStageMgr_cFv = .text:0x8019B0C0; // type:function size:0x684 executeState_CreateObject__11dStageMgr_cFv = .text:0x8019B750; // type:function size:0x50 finalizeState_CreateObject__11dStageMgr_cFv = .text:0x8019B7A0; // type:function size:0x4 -fn_8019B7B0 = .text:0x8019B7B0; // type:function size:0x28 +soundCallback2__FPv = .text:0x8019B7B0; // type:function size:0x28 initializeState_ReadObjectSound__11dStageMgr_cFv = .text:0x8019B7E0; // type:function size:0x3C executeState_ReadObjectSound__11dStageMgr_cFv = .text:0x8019B820; // type:function size:0x7C finalizeState_ReadObjectSound__11dStageMgr_cFv = .text:0x8019B8A0; // type:function size:0x4C @@ -10644,8 +10644,8 @@ fn_8019BEC0 = .text:0x8019BEC0; // type:function size:0x10 fn_8019BED0 = .text:0x8019BED0; // type:function size:0x98 fn_8019BF70 = .text:0x8019BF70; // type:function size:0x10 addArcnToStage = .text:0x8019BF80; // type:function size:0x17C -ArcnObjnManager__doLoad = .text:0x8019C100; // type:function size:0x64 -ArcnObjnManager__checkLoaded = .text:0x8019C170; // type:function size:0x44 +doLoad__10RelObjCtrlFv = .text:0x8019C100; // type:function size:0x64 +isLoaded__10RelObjCtrlCFv = .text:0x8019C170; // type:function size:0x44 fn_8019C1C0 = .text:0x8019C1C0; // type:function size:0x44 getNumStep__Q23EGG16DrawPathLightMapCFv = .text:0x8019C210; // type:function size:0x8 scope:weak fn_8019C220 = .text:0x8019C220; // type:function size:0x4 @@ -10721,7 +10721,7 @@ fn_8019D890 = .text:0x8019D890; // type:function size:0x2E8 fn_8019DB80 = .text:0x8019DB80; // type:function size:0x158 fn_8019DCE0 = .text:0x8019DCE0; // type:function size:0x140 fn_8019DE20 = .text:0x8019DE20; // type:function size:0x3C -dCamera__someShift6_0x1 = .text:0x8019DE60; // type:function size:0xC +isUnderwater__9dCamera_cCFv = .text:0x8019DE60; // type:function size:0xC fn_8019DE70 = .text:0x8019DE70; // type:function size:0x2A4 fn_8019E120 = .text:0x8019E120; // type:function size:0xC4 fn_8019E1F0 = .text:0x8019E1F0; // type:function size:0x10 @@ -10736,7 +10736,7 @@ fn_8019E450 = .text:0x8019E450; // type:function size:0x7C fn_8019E4D0 = .text:0x8019E4D0; // type:function size:0x5C fn_8019E530 = .text:0x8019E530; // type:function size:0x130 fn_8019E660 = .text:0x8019E660; // type:function size:0x8 -fn_8019E670 = .text:0x8019E670; // type:function size:0x8 +getUnderwaterDepth__9dCamera_cCFv = .text:0x8019E670; // type:function size:0x8 fn_8019E680 = .text:0x8019E680; // type:function size:0x1D8 fn_8019E860 = .text:0x8019E860; // type:function size:0x1C fn_8019E880 = .text:0x8019E880; // type:function size:0x8 @@ -11191,7 +11191,7 @@ set__14LinkReloadInfoFUcRC7mVec3_c4mAngUl = .text:0x801BB380; // type:function s isCurrentStage__9dScGame_cFPCc = .text:0x801BB3C0; // type:function size:0x10 isStageSkyloftLayer20__9dScGame_cFv = .text:0x801BB3D0; // type:function size:0x54 isInCredits = .text:0x801BB430; // type:function size:0x54 -isStateLayerWithSeekerStoneHintMenu = .text:0x801BB490; // type:function size:0x78 +isStateLayerWithSeekerStoneHintMenu__9dScGame_cFv = .text:0x801BB490; // type:function size:0x78 copySpawnNextToCurrent__9dScGame_cFv = .text:0x801BB510; // type:function size:0xBC actuallyTriggerEntrance__9dScGame_cFPCcUcUcUciiUcUsSc = .text:0x801BB5D0; // type:function size:0x104 setCamera = .text:0x801BB6E0; // type:function size:0x10 @@ -19806,42 +19806,42 @@ fn_80359C50 = .text:0x80359C50; // type:function size:0x1C fn_80359C70 = .text:0x80359C70; // type:function size:0x8 fn_80359C80 = .text:0x80359C80; // type:function size:0xA0 __ct__9dSndMgr_cFv = .text:0x80359D20; // type:function size:0x9C -initialize__9dSndMgr_cFPQ23EGG4HeapUl = .text:0x80359DC0; // type:function size:0xEC +setup__9dSndMgr_cFPQ23EGG4HeapUl = .text:0x80359DC0; // type:function size:0xEC initHbm__9dSndMgr_cFUl = .text:0x80359EB0; // type:function size:0x10 calc__9dSndMgr_cFv = .text:0x80359EC0; // type:function size:0xB8 restoreEffectsCallback__9dSndMgr_cFv = .text:0x80359F80; // type:function size:0x2C -stateProc__Q23EGG12SoundHeapMgrFv = .text:0x80359FB0; // type:function size:0xD4 -loadState__Q23EGG12SoundHeapMgrFl = .text:0x8035A090; // type:function size:0x8C -getCurrentLevel__Q23EGG12SoundHeapMgrFv = .text:0x8035A120; // type:function size:0x54 -holdSound__Q23EGG9ArcPlayerFPQ34nw4r3snd11SoundHandleUl = .text:0x8035A180; // type:function size:0x34 -holdSound__Q23EGG9ArcPlayerFPQ34nw4r3snd11SoundHandleUi = .text:0x8035A1C0; // type:function size:0x34 -holdSound__Q23EGG9ArcPlayerFPQ34nw4r3snd11SoundHandlePCc = .text:0x8035A200; // type:function size:0x70 -prepareSound__Q23EGG9ArcPlayerFPQ34nw4r3snd11SoundHandleUl = .text:0x8035A270; // type:function size:0x34 -prepareSound__Q23EGG9ArcPlayerFPQ34nw4r3snd11SoundHandleUi = .text:0x8035A2B0; // type:function size:0x34 -prepareSound__Q23EGG9ArcPlayerFPQ34nw4r3snd11SoundHandlePCc = .text:0x8035A2F0; // type:function size:0x70 -startSound__Q23EGG9ArcPlayerFPQ34nw4r3snd11SoundHandleUl = .text:0x8035A360; // type:function size:0x34 -startSound__Q23EGG9ArcPlayerFPQ34nw4r3snd11SoundHandleUi = .text:0x8035A3A0; // type:function size:0x34 -startSound__Q23EGG9ArcPlayerFPQ34nw4r3snd11SoundHandlePCc = .text:0x8035A3E0; // type:function size:0x70 -setupMemoryArchive__Q23EGG9ArcPlayerFPCvPQ34nw4r3snd9SoundHeapl = .text:0x8035A450; // type:function size:0x10 -__dt__9dSndMgr_cFv = .text:0x8035A460; // type:function size:0x58 -@248@calc__9dSndMgr_cFv = .text:0x8035A4C0; // type:function size:0x8 -@248@loadGroup__Q23EGG14SimpleAudioMgrFUiPQ34nw4r3snd9SoundHeapUl = .text:0x8035A4D0; // type:function size:0x8 -@248@loadGroup__Q23EGG14SimpleAudioMgrFiPQ34nw4r3snd9SoundHeapUl = .text:0x8035A4E0; // type:function size:0x8 -@248@loadGroup__Q23EGG14SimpleAudioMgrFUlPQ34nw4r3snd9SoundHeapUl = .text:0x8035A4F0; // type:function size:0x8 -@248@loadGroup__Q23EGG14SimpleAudioMgrFPCcPQ34nw4r3snd9SoundHeapUl = .text:0x8035A500; // type:function size:0x8 -@248@closeArchive__Q23EGG14SimpleAudioMgrFv = .text:0x8035A510; // type:function size:0x8 -@248@setupMemoryArchive__Q23EGG14SimpleAudioMgrFPCvPQ34nw4r3snd9SoundHeap = .text:0x8035A520; // type:function size:0x8 -@248@openNandArchive__Q23EGG14SimpleAudioMgrFPCcPQ34nw4r3snd9SoundHeap = .text:0x8035A530; // type:function size:0x8 -@248@openDvdArchive__Q23EGG14SimpleAudioMgrFPCcPQ34nw4r3snd9SoundHeap = .text:0x8035A540; // type:function size:0x8 -@248@__dt__9dSndMgr_cFv = .text:0x8035A550; // type:function size:0x8 +stateProc__Q23EGG12SoundHeapMgrFv = .text:0x80359FB0; // type:function size:0xD4 scope:weak +loadState__Q23EGG12SoundHeapMgrFl = .text:0x8035A090; // type:function size:0x8C scope:weak +getCurrentLevel__Q23EGG12SoundHeapMgrFv = .text:0x8035A120; // type:function size:0x54 scope:weak +holdSound__Q23EGG9ArcPlayerFPQ34nw4r3snd11SoundHandleUl = .text:0x8035A180; // type:function size:0x34 scope:weak +holdSound__Q23EGG9ArcPlayerFPQ34nw4r3snd11SoundHandleUi = .text:0x8035A1C0; // type:function size:0x34 scope:weak +holdSound__Q23EGG9ArcPlayerFPQ34nw4r3snd11SoundHandlePCc = .text:0x8035A200; // type:function size:0x70 scope:weak +prepareSound__Q23EGG9ArcPlayerFPQ34nw4r3snd11SoundHandleUl = .text:0x8035A270; // type:function size:0x34 scope:weak +prepareSound__Q23EGG9ArcPlayerFPQ34nw4r3snd11SoundHandleUi = .text:0x8035A2B0; // type:function size:0x34 scope:weak +prepareSound__Q23EGG9ArcPlayerFPQ34nw4r3snd11SoundHandlePCc = .text:0x8035A2F0; // type:function size:0x70 scope:weak +startSound__Q23EGG9ArcPlayerFPQ34nw4r3snd11SoundHandleUl = .text:0x8035A360; // type:function size:0x34 scope:weak +startSound__Q23EGG9ArcPlayerFPQ34nw4r3snd11SoundHandleUi = .text:0x8035A3A0; // type:function size:0x34 scope:weak +startSound__Q23EGG9ArcPlayerFPQ34nw4r3snd11SoundHandlePCc = .text:0x8035A3E0; // type:function size:0x70 scope:weak +setupMemoryArchive__Q23EGG9ArcPlayerFPCvPQ34nw4r3snd9SoundHeapl = .text:0x8035A450; // type:function size:0x10 scope:weak +__dt__9dSndMgr_cFv = .text:0x8035A460; // type:function size:0x58 scope:weak +@248@calc__9dSndMgr_cFv = .text:0x8035A4C0; // type:function size:0x8 scope:weak +@248@loadGroup__Q23EGG14SimpleAudioMgrFUiPQ34nw4r3snd9SoundHeapUl = .text:0x8035A4D0; // type:function size:0x8 scope:weak +@248@loadGroup__Q23EGG14SimpleAudioMgrFiPQ34nw4r3snd9SoundHeapUl = .text:0x8035A4E0; // type:function size:0x8 scope:weak +@248@loadGroup__Q23EGG14SimpleAudioMgrFUlPQ34nw4r3snd9SoundHeapUl = .text:0x8035A4F0; // type:function size:0x8 scope:weak +@248@loadGroup__Q23EGG14SimpleAudioMgrFPCcPQ34nw4r3snd9SoundHeapUl = .text:0x8035A500; // type:function size:0x8 scope:weak +@248@closeArchive__Q23EGG14SimpleAudioMgrFv = .text:0x8035A510; // type:function size:0x8 scope:weak +@248@setupMemoryArchive__Q23EGG14SimpleAudioMgrFPCvPQ34nw4r3snd9SoundHeap = .text:0x8035A520; // type:function size:0x8 scope:weak +@248@openNandArchive__Q23EGG14SimpleAudioMgrFPCcPQ34nw4r3snd9SoundHeap = .text:0x8035A530; // type:function size:0x8 scope:weak +@248@openDvdArchive__Q23EGG14SimpleAudioMgrFPCcPQ34nw4r3snd9SoundHeap = .text:0x8035A540; // type:function size:0x8 scope:weak +@248@__dt__9dSndMgr_cFv = .text:0x8035A550; // type:function size:0x8 scope:weak __ct__11dSndActor_cFRQ34nw4r3snd18SoundArchivePlayer = .text:0x8035A560; // type:function size:0x3C __dt__Q34nw4r3snd11SoundHandleFv = .text:0x8035A5A0; // type:function size:0x54 scope:weak __cl__22SoundPropertiesCheckerFRQ34nw4r3snd11SoundHandle = .text:0x8035A600; // type:function size:0x240 scope:weak __dt__11dSndActor_cFv = .text:0x8035A840; // type:function size:0x58 scope:weak -__ct__13dSnd3DActor_cFP15dSndSourceParamUc = .text:0x8035A8A0; // type:function size:0xE8 -d_vt_0x34__13dSnd3DActor_cFRCQ34nw4r4math4VEC3 = .text:0x8035A990; // type:function size:0x40 +__ct__13dSnd3DActor_cFP15dSndSourceParaml = .text:0x8035A8A0; // type:function size:0xE8 +setPosition__13dSnd3DActor_cFRCQ34nw4r4math4VEC3 = .text:0x8035A990; // type:function size:0x40 resetCachedRelativePositions__13dSnd3DActor_cFv = .text:0x8035A9D0; // type:function size:0x2C -fn_8035AA00 = .text:0x8035AA00; // type:function size:0x30 +setSourceParam__13dSnd3DActor_cFPC15dSndSourceParam = .text:0x8035AA00; // type:function size:0x30 updatePositionRelativeToListener__13dSnd3DActor_cFv = .text:0x8035AA30; // type:function size:0x44 calculatePositionRelativeToListener__13dSnd3DActor_cFv = .text:0x8035AA80; // type:function size:0x28 updateDistanceToListener__13dSnd3DActor_cFv = .text:0x8035AAB0; // type:function size:0x50 @@ -19863,8 +19863,8 @@ fn_8035B640 = .text:0x8035B640; // type:function size:0x1FC hasPlayingSounds__13dSnd3DActor_cCFv = .text:0x8035B840; // type:function size:0x60 isPlayingSound__13dSnd3DActor_cFUl = .text:0x8035B8A0; // type:function size:0xCC __cl__23IsCurrentSoundIdCheckerFRQ34nw4r3snd11SoundHandle = .text:0x8035B970; // type:function size:0x34 -fn_8035B9B0 = .text:0x8035B9B0; // type:function size:0x74 -fn_8035BA30 = .text:0x8035BA30; // type:function size:0x20 +checkUserParamMask__13dSnd3DActor_cCFUlUl = .text:0x8035B9B0; // type:function size:0x74 +getSomeUserParam__13dSnd3DActor_cCFUl = .text:0x8035BA30; // type:function size:0x20 soundLabelToSoundId__13dSnd3DActor_cCFPCc = .text:0x8035BA50; // type:function size:0x8 soundIdToSoundLabel__13dSnd3DActor_cCFUl = .text:0x8035BA60; // type:function size:0x58 __dt__13dSnd3DActor_cFv = .text:0x8035BAC0; // type:function size:0x58 @@ -19905,15 +19905,15 @@ setVolume__11dSndSound_cFfl = .text:0x8035D050; // type:function size:0x1C setPitchRelated__11dSndSound_cFfl = .text:0x8035D070; // type:function size:0x1C setLinearPitch__11dSndSound_cFfl = .text:0x8035D090; // type:function size:0x1C resetTrackVolumes__11dSndSound_cFv = .text:0x8035D0B0; // type:function size:0xE8 -setTrackVolume__11dSndSound_cFUlfl = .text:0x8035D1A0; // type:function size:0x114 -setStrmTrackVolume__11dSndSound_cFUlfl = .text:0x8035D2C0; // type:function size:0xC0 +setTrackVolume__11dSndSound_cFUsfl = .text:0x8035D1A0; // type:function size:0x114 +setStrmTrackVolume__11dSndSound_cFUsfl = .text:0x8035D2C0; // type:function size:0xC0 setSingleSeqTrackVolume__11dSndSound_cFUsfl = .text:0x8035D380; // type:function size:0xA0 setSingleStrmTrackVolume__11dSndSound_cFUsfl = .text:0x8035D420; // type:function size:0xA0 -setEachSeqTrackVolume__11dSndSound_cFUlf = .text:0x8035D4C0; // type:function size:0xB8 -setEachStrmTrackVolume__11dSndSound_cFUlf = .text:0x8035D580; // type:function size:0xB8 +setEachSeqTrackVolume__11dSndSound_cFUsf = .text:0x8035D4C0; // type:function size:0xB8 +setEachStrmTrackVolume__11dSndSound_cFUsf = .text:0x8035D580; // type:function size:0xB8 getCurrentStrmTrackVolume__11dSndSound_cCFUl = .text:0x8035D640; // type:function size:0x24 setSeqTempoRatio__11dSndSound_cFfl = .text:0x8035D670; // type:function size:0x60 -setSeqTrackMute__11dSndSound_cFUlQ34nw4r3snd7SeqMute = .text:0x8035D6D0; // type:function size:0x78 +setSeqTrackMute__11dSndSound_cFUsQ34nw4r3snd7SeqMute = .text:0x8035D6D0; // type:function size:0x78 prepareSound__11dSndSound_cFUlUl = .text:0x8035D750; // type:function size:0x1E8 prepareSound__11dSndSound_cFPCcUl = .text:0x8035D940; // type:function size:0x58 onPreparing__11dSndSound_cFUlUl = .text:0x8035D9A0; // type:function size:0x68 @@ -19924,26 +19924,26 @@ __dt__33SndMgrDisposer<15dSndPlayerMgr_c>Fv = .text:0x8035DAA0; // type:function create__33SndMgrDisposer<15dSndPlayerMgr_c>Fv = .text:0x8035DB20; // type:function size:0x48 remove__33SndMgrDisposer<15dSndPlayerMgr_c>Fv = .text:0x8035DB70; // type:function size:0x10 __ct__15dSndPlayerMgr_cFv = .text:0x8035DB80; // type:function size:0x78 -fn_8035DC00 = .text:0x8035DC00; // type:function size:0x44 -fn_8035DC50 = .text:0x8035DC50; // type:function size:0x8C -fn_8035DCE0 = .text:0x8035DCE0; // type:function size:0x38 -fn_8035DD20 = .text:0x8035DD20; // type:function size:0x4 -fn_8035DD30 = .text:0x8035DD30; // type:function size:0x10 -fn_8035DD40 = .text:0x8035DD40; // type:function size:0xC0 -fn_8035DE00 = .text:0x8035DE00; // type:function size:0x54 -fn_8035DE60 = .text:0x8035DE60; // type:function size:0x38 -fn_8035DEA0 = .text:0x8035DEA0; // type:function size:0x50 -fn_8035DEF0 = .text:0x8035DEF0; // type:function size:0x38 -fn_8035DF30 = .text:0x8035DF30; // type:function size:0x24 +setup__15dSndPlayerMgr_cFv = .text:0x8035DC00; // type:function size:0x44 +initialize__15dSndPlayerMgr_cFv = .text:0x8035DC50; // type:function size:0x8C +createFileManager__15dSndPlayerMgr_cFv = .text:0x8035DCE0; // type:function size:0x38 +calcActive__15dSndPlayerMgr_cFv = .text:0x8035DD20; // type:function size:0x4 +clearTempStates__15dSndPlayerMgr_cFv = .text:0x8035DD30; // type:function size:0x10 +setupState0__15dSndPlayerMgr_cFv = .text:0x8035DD40; // type:function size:0xC0 +popToState0__15dSndPlayerMgr_cFv = .text:0x8035DE00; // type:function size:0x54 +saveState1__15dSndPlayerMgr_cFv = .text:0x8035DE60; // type:function size:0x38 +popToState1__15dSndPlayerMgr_cFv = .text:0x8035DEA0; // type:function size:0x50 +saveState2__15dSndPlayerMgr_cFv = .text:0x8035DEF0; // type:function size:0x38 +popToState2__15dSndPlayerMgr_cFv = .text:0x8035DF30; // type:function size:0x24 getFreeSize__15dSndPlayerMgr_cFv = .text:0x8035DF60; // type:function size:0x54 -fn_8035DFC0 = .text:0x8035DFC0; // type:function size:0x3C +stopAllSound__15dSndPlayerMgr_cFl = .text:0x8035DFC0; // type:function size:0x3C fn_8035E000 = .text:0x8035E000; // type:function size:0xD4 fn_8035E0E0 = .text:0x8035E0E0; // type:function size:0xCC -fn_8035E1B0__15dSndPlayerMgr_cFUs = .text:0x8035E1B0; // type:function size:0x68 -fn_8035E220__15dSndPlayerMgr_cFv = .text:0x8035E220; // type:function size:0x2C -fn_8035E250__15dSndPlayerMgr_cFUs = .text:0x8035E250; // type:function size:0x8C -fn_8035E2E0__15dSndPlayerMgr_cFv = .text:0x8035E2E0; // type:function size:0x2C -fn_8035E310__15dSndPlayerMgr_cFv = .text:0x8035E310; // type:function size:0x50 +shutdown__15dSndPlayerMgr_cFl = .text:0x8035E1B0; // type:function size:0x68 +isShutdown__15dSndPlayerMgr_cFv = .text:0x8035E220; // type:function size:0x2C +reset__15dSndPlayerMgr_cFl = .text:0x8035E250; // type:function size:0x8C +isReset__15dSndPlayerMgr_cFv = .text:0x8035E2E0; // type:function size:0x2C +recoverReset__15dSndPlayerMgr_cFv = .text:0x8035E310; // type:function size:0x50 enterPauseState__15dSndPlayerMgr_cFv = .text:0x8035E360; // type:function size:0x70 leavePauseState__15dSndPlayerMgr_cFv = .text:0x8035E3D0; // type:function size:0x70 enterMenu__15dSndPlayerMgr_cFv = .text:0x8035E440; // type:function size:0x2C @@ -19952,38 +19952,38 @@ enterMap__15dSndPlayerMgr_cFv = .text:0x8035E4A0; // type:function size:0x44 leaveMap__15dSndPlayerMgr_cFv = .text:0x8035E4F0; // type:function size:0x44 enterHelp__15dSndPlayerMgr_cFv = .text:0x8035E540; // type:function size:0x18 leaveHelp__15dSndPlayerMgr_cFv = .text:0x8035E560; // type:function size:0x18 -fn_8035E580 = .text:0x8035E580; // type:function size:0x50 -fn_8035E5D0 = .text:0x8035E5D0; // type:function size:0x44 -fn_8035E620__15dSndPlayerMgr_cFv = .text:0x8035E620; // type:function size:0xB4 -fn_8035E6E0__15dSndPlayerMgr_cFv = .text:0x8035E6E0; // type:function size:0xA4 -fn_8035E790 = .text:0x8035E790; // type:function size:0x84 -fn_8035E820 = .text:0x8035E820; // type:function size:0x38 -fn_8035E860 = .text:0x8035E860; // type:function size:0x14 -fn_8035E880 = .text:0x8035E880; // type:function size:0x14 -setup__15dSndPlayerMgr_cFl = .text:0x8035E8A0; // type:function size:0xC -shutdown__15dSndPlayerMgr_cFl = .text:0x8035E8B0; // type:function size:0xC +enterSystemMenu__15dSndPlayerMgr_cFv = .text:0x8035E580; // type:function size:0x50 +leaveSystemMenu__15dSndPlayerMgr_cFv = .text:0x8035E5D0; // type:function size:0x44 +enterCaution__15dSndPlayerMgr_cFv = .text:0x8035E620; // type:function size:0xB4 +leaveCaution__15dSndPlayerMgr_cFv = .text:0x8035E6E0; // type:function size:0xA4 +setMsgActor__15dSndPlayerMgr_cFlP9dAcBase_c = .text:0x8035E790; // type:function size:0x84 +unsetMsgActor__15dSndPlayerMgr_cFv = .text:0x8035E820; // type:function size:0x38 +enterMsgWait__15dSndPlayerMgr_cFv = .text:0x8035E860; // type:function size:0x14 +leaveMsgWait__15dSndPlayerMgr_cFv = .text:0x8035E880; // type:function size:0x14 +setupRmtSpeaker__15dSndPlayerMgr_cFl = .text:0x8035E8A0; // type:function size:0xC +shutdownRmtSpeaker__15dSndPlayerMgr_cFl = .text:0x8035E8B0; // type:function size:0xC startSound__15dSndPlayerMgr_cFPQ34nw4r3snd11SoundHandleUlPCQ44nw4r3snd14SoundStartable9StartInfo = .text:0x8035E8C0; // type:function size:0x90 startSound__15dSndPlayerMgr_cFPQ34nw4r3snd11SoundHandlePCcPCQ44nw4r3snd14SoundStartable9StartInfo = .text:0x8035E950; // type:function size:0x6C -fn_8035E9C0 = .text:0x8035E9C0; // type:function size:0x80 -fn_8035EA40 = .text:0x8035EA40; // type:function size:0x64 -fn_8035EAB0 = .text:0x8035EAB0; // type:function size:0x28 -fn_8035EAE0 = .text:0x8035EAE0; // type:function size:0xC -fn_8035EAF0 = .text:0x8035EAF0; // type:function size:0xC -fn_8035EB00 = .text:0x8035EB00; // type:function size:0x3C -fn_8035EB40 = .text:0x8035EB40; // type:function size:0xC -fn_8035EB50 = .text:0x8035EB50; // type:function size:0x3C -fn_8035EB90 = .text:0x8035EB90; // type:function size:0x80 -fn_8035EC10 = .text:0x8035EC10; // type:function size:0x5C -fn_8035EC70 = .text:0x8035EC70; // type:function size:0x84 +startDemoSound__15dSndPlayerMgr_cFPQ34nw4r3snd11SoundHandleUlPCQ44nw4r3snd14SoundStartable9StartInfo = .text:0x8035E9C0; // type:function size:0x80 +loadGroup__15dSndPlayerMgr_cFUl = .text:0x8035EA40; // type:function size:0x64 +loadFileForSound__15dSndPlayerMgr_cFUl = .text:0x8035EAB0; // type:function size:0x28 +isLoadedFileForSound__15dSndPlayerMgr_cFUl = .text:0x8035EAE0; // type:function size:0xC +isLoadedFileForBank__15dSndPlayerMgr_cFUl = .text:0x8035EAF0; // type:function size:0xC +isLoadedBnkSeForGroup__15dSndPlayerMgr_cFP17dSndSourceGroup_c = .text:0x8035EB00; // type:function size:0x3C +isLoadedFileAndWaveForSound__15dSndPlayerMgr_cFUl = .text:0x8035EB40; // type:function size:0xC +isLoadedSeFileAndWaveForGroup__15dSndPlayerMgr_cFP17dSndSourceGroup_c = .text:0x8035EB50; // type:function size:0x3C +getSomeUserParam__15dSndPlayerMgr_cCFUl = .text:0x8035EB90; // type:function size:0x80 +getRemoConSoundVariant__15dSndPlayerMgr_cCFUl = .text:0x8035EC10; // type:function size:0x5C +getRemoConSoundVariantDemo__15dSndPlayerMgr_cCFUl = .text:0x8035EC70; // type:function size:0x84 convertLabelStringToSoundId__15dSndPlayerMgr_cCFPCc = .text:0x8035ED00; // type:function size:0x3C -getSoundArchivePlayerForType__15dSndPlayerMgr_cFUc = .text:0x8035ED40; // type:function size:0x44 -canUseThisPlayer__15dSndPlayerMgr_cCFUc = .text:0x8035ED90; // type:function size:0x5C +getSoundArchivePlayerForType__15dSndPlayerMgr_cFl = .text:0x8035ED40; // type:function size:0x44 +shouldUseDemoPlayer__15dSndPlayerMgr_cCFl = .text:0x8035ED90; // type:function size:0x5C loadDemoArchive__15dSndPlayerMgr_cFPCc = .text:0x8035EDF0; // type:function size:0x198 -shutdown__15dSndPlayerMgr_cFv = .text:0x8035EF90; // type:function size:0x38 +shutdownDemo__15dSndPlayerMgr_cFv = .text:0x8035EF90; // type:function size:0x38 calc__15dSndPlayerMgr_cFv = .text:0x8035EFD0; // type:function size:0x40 fn_8035F010 = .text:0x8035F010; // type:function size:0x20 -fn_8035F030 = .text:0x8035F030; // type:function size:0x1C -fn_8035F050 = .text:0x8035F050; // type:function size:0x50 +isBgmPlayerId__15dSndPlayerMgr_cFUl = .text:0x8035F030; // type:function size:0x1C +isSoundPlayedByBgmBattlePlayer__15dSndPlayerMgr_cFUl = .text:0x8035F050; // type:function size:0x50 __dt__40SndMgrDisposer<22dSndControlPlayerMgr_c>Fv = .text:0x8035F0A0; // type:function size:0x78 create__40SndMgrDisposer<22dSndControlPlayerMgr_c>Fv = .text:0x8035F120; // type:function size:0x48 remove__40SndMgrDisposer<22dSndControlPlayerMgr_c>Fv = .text:0x8035F170; // type:function size:0x10 @@ -19995,9 +19995,9 @@ __dt__25dSndControlPlayerVolume_cFv = .text:0x8035F360; // type:function size:0x __dt__26dSndControlPlayerLpfFreq_cFv = .text:0x8035F3A0; // type:function size:0x40 __dt__25dSndControlPlayerFxSend_cFv = .text:0x8035F3E0; // type:function size:0x40 fn_8035F420 = .text:0x8035F420; // type:function size:0xC8 -fn_8035F4F0 = .text:0x8035F4F0; // type:function size:0x118 -fn_8035F610 = .text:0x8035F610; // type:function size:0x158 -fn_8035F770 = .text:0x8035F770; // type:function size:0xDC +setupPlayerControlsStage__22dSndControlPlayerMgr_cFv = .text:0x8035F4F0; // type:function size:0x118 +setupPlayerControlsStageBgm__22dSndControlPlayerMgr_cFv = .text:0x8035F610; // type:function size:0x158 +setupPlayerControlsDemo__22dSndControlPlayerMgr_cFv = .text:0x8035F770; // type:function size:0xDC calc__22dSndControlPlayerMgr_cFv = .text:0x8035F850; // type:function size:0x3C executeControls__22dSndControlPlayerMgr_cFv = .text:0x8035F890; // type:function size:0xAC calcVolumes__22dSndControlPlayerMgr_cFv = .text:0x8035F940; // type:function size:0x168 @@ -20020,9 +20020,9 @@ getAppliedPlayerVolume__22dSndControlPlayerMgr_cCFUl = .text:0x80360530; // type setControlValue__22dSndControlPlayerMgr_cFQ222dSndControlPlayerMgr_c12PlayerCtrl_eUlfl = .text:0x80360570; // type:function size:0xB0 resetControls__22dSndControlPlayerMgr_cFv = .text:0x80360620; // type:function size:0xAC getControlTarget__22dSndControlPlayerMgr_cCFQ222dSndControlPlayerMgr_c12PlayerCtrl_eUl = .text:0x803606D0; // type:function size:0x40 -fn_80360710 = .text:0x80360710; // type:function size:0x78 -fn_80360790 = .text:0x80360790; // type:function size:0x5C -fn_803607F0 = .text:0x803607F0; // type:function size:0x60 +unmutePlayer__22dSndControlPlayerMgr_cFUll = .text:0x80360710; // type:function size:0x78 +unmuteScenePlayers__22dSndControlPlayerMgr_cFl = .text:0x80360790; // type:function size:0x5C +muteScenePlayers__22dSndControlPlayerMgr_cFl = .text:0x803607F0; // type:function size:0x60 setGroupVolumeFlag__22dSndControlPlayerMgr_cFQ222dSndControlPlayerMgr_c18VolumeControlGroupQ222dSndControlPlayerMgr_c9MuteLevel = .text:0x80360850; // type:function size:0x2C setPlayerVolumeInternal__22dSndControlPlayerMgr_cFUlf = .text:0x80360880; // type:function size:0x64 fn_803608F0 = .text:0x803608F0; // type:function size:0x50 @@ -20046,117 +20046,117 @@ calc__15dSnd3DManager_cFv = .text:0x80360FB0; // type:function size:0xC clearState__15dSnd3DManager_cFv = .text:0x80360FC0; // type:function size:0x18 updateFromCamera__15dSnd3DManager_cFRQ23EGG12LookAtCamera = .text:0x80360FE0; // type:function size:0x390 updateListenerPos__15dSnd3DManager_cFf = .text:0x80361370; // type:function size:0xEC -EnemySoundMgr__dtor = .text:0x80361460; // type:function size:0x78 -initEnemySoundMgr = .text:0x803614E0; // type:function size:0x48 -EnemySoundMgr__deref = .text:0x80361530; // type:function size:0x10 -EnemySoundMgr__ctor = .text:0x80361540; // type:function size:0x15C +__dt__32SndMgrDisposer<14dSndStateMgr_c>Fv = .text:0x80361460; // type:function size:0x78 +create__32SndMgrDisposer<14dSndStateMgr_c>Fv = .text:0x803614E0; // type:function size:0x48 +remove__32SndMgrDisposer<14dSndStateMgr_c>Fv = .text:0x80361530; // type:function size:0x10 +__ct__14dSndStateMgr_cFv = .text:0x80361540; // type:function size:0x15C __dt__Q34nw4r3snd15FxReverbStdDpl2Fv = .text:0x803616A0; // type:function size:0x7C -fn_80361720 = .text:0x80361720; // type:function size:0x1CC -fn_803618F0 = .text:0x803618F0; // type:function size:0x3DC -GetStageTypeFlags = .text:0x80361CD0; // type:function size:0x2FC -fn_80361FD0 = .text:0x80361FD0; // type:function size:0x44 -fn_80362020 = .text:0x80362020; // type:function size:0x84 -fn_803620B0 = .text:0x803620B0; // type:function size:0x5C -fn_80362110 = .text:0x80362110; // type:function size:0x34 -fn_80362150 = .text:0x80362150; // type:function size:0xB0 +setup__14dSndStateMgr_cFPQ23EGG4Heap = .text:0x80361720; // type:function size:0x1CC +onStageOrLayerUpdate__14dSndStateMgr_cFv = .text:0x803618F0; // type:function size:0x3DC +getStageTypeFlags__14dSndStateMgr_cCFPCc = .text:0x80361CD0; // type:function size:0x2FC +isVolcanicDungeon__14dSndStateMgr_cFUl = .text:0x80361FD0; // type:function size:0x44 +isSeekerStoneStage__14dSndStateMgr_cFPCcl = .text:0x80362020; // type:function size:0x84 +isActiveDemoMaybe__14dSndStateMgr_cCFl = .text:0x803620B0; // type:function size:0x5C +isSomeSkyloftRoom__14dSndStateMgr_cCFv = .text:0x80362110; // type:function size:0x34 +onGotoStage__14dSndStateMgr_cFl = .text:0x80362150; // type:function size:0xB0 fn_80362200 = .text:0x80362200; // type:function size:0xFC fn_80362300 = .text:0x80362300; // type:function size:0x84 fn_80362390 = .text:0x80362390; // type:function size:0x6C fn_80362400 = .text:0x80362400; // type:function size:0x10 fn_80362410 = .text:0x80362410; // type:function size:0xC -fn_80362420 = .text:0x80362420; // type:function size:0x18 -isInStage = .text:0x80362440; // type:function size:0x34 +checkFlag0x18__14dSndStateMgr_cFUl = .text:0x80362420; // type:function size:0x18 +isInStage__14dSndStateMgr_cFPCc = .text:0x80362440; // type:function size:0x34 fn_80362480 = .text:0x80362480; // type:function size:0x6C -fn_803624F0 = .text:0x803624F0; // type:function size:0xF4 -fn_803625F0 = .text:0x803625F0; // type:function size:0x140 -fn_80362730 = .text:0x80362730; // type:function size:0x8 -fn_80362740 = .text:0x80362740; // type:function size:0x59C -EnemySoundMgr__update = .text:0x80362CE0; // type:function size:0xFC -EnemySoundMgr__enemyMusicRelated = .text:0x80362DE0; // type:function size:0x154 -fn_80362F40 = .text:0x80362F40; // type:function size:0x770 -fn_803636B0 = .text:0x803636B0; // type:function size:0xCC -fn_80363780 = .text:0x80363780; // type:function size:0xCC -fn_80363850 = .text:0x80363850; // type:function size:0xA8 -fn_80363900 = .text:0x80363900; // type:function size:0xA8 -fn_803639B0 = .text:0x803639B0; // type:function size:0xA8 -fn_80363A60 = .text:0x80363A60; // type:function size:0x5C -fn_80363AC0 = .text:0x80363AC0; // type:function size:0x60 -fn_80363B20 = .text:0x80363B20; // type:function size:0x54 -fn_80363B80 = .text:0x80363B80; // type:function size:0x5C -fn_80363BE0 = .text:0x80363BE0; // type:function size:0x60 -fn_80363C40 = .text:0x80363C40; // type:function size:0x54 -fn_80363CA0 = .text:0x80363CA0; // type:function size:0x5C -fn_80363D00 = .text:0x80363D00; // type:function size:0x60 -fn_80363D60 = .text:0x80363D60; // type:function size:0x54 -fn_80363DC0 = .text:0x80363DC0; // type:function size:0xC -fn_80363DD0 = .text:0x80363DD0; // type:function size:0x1AC -fn_80363F80 = .text:0x80363F80; // type:function size:0x48 +onStageLoad__14dSndStateMgr_cFv = .text:0x803624F0; // type:function size:0xF4 +onRestartScene__14dSndStateMgr_cFl = .text:0x803625F0; // type:function size:0x140 +loadStageSound__14dSndStateMgr_cFv = .text:0x80362730; // type:function size:0x8 +loadStageSound__14dSndStateMgr_cFb = .text:0x80362740; // type:function size:0x59C +calc__14dSndStateMgr_cFv = .text:0x80362CE0; // type:function size:0xFC +calcEvent__14dSndStateMgr_cFv = .text:0x80362DE0; // type:function size:0x154 +setEvent__14dSndStateMgr_cFPCc = .text:0x80362F40; // type:function size:0x770 +initializeEventCallbacks__14dSndStateMgr_cFPCc = .text:0x803636B0; // type:function size:0xCC +convertSeLabelToSoundId__14dSndStateMgr_cFPCc = .text:0x80363780; // type:function size:0xCC +convertBgmLabelToSoundId__14dSndStateMgr_cFPCc = .text:0x80363850; // type:function size:0xA8 +convertCmdLabelToSoundId__14dSndStateMgr_cFPCc = .text:0x80363900; // type:function size:0xA8 +doLabelSuffix__14dSndStateMgr_cFPCc = .text:0x803639B0; // type:function size:0xA8 +getSeCameraId__14dSndStateMgr_cFv = .text:0x80363A60; // type:function size:0x5C +getSeMsgWaitId__14dSndStateMgr_cFv = .text:0x80363AC0; // type:function size:0x60 +getSeFrameCountId__14dSndStateMgr_cFv = .text:0x80363B20; // type:function size:0x54 +getBgmCameraId__14dSndStateMgr_cFv = .text:0x80363B80; // type:function size:0x5C +getBgmMsgWaitId__14dSndStateMgr_cFv = .text:0x80363BE0; // type:function size:0x60 +getBgmFrameCountId__14dSndStateMgr_cFv = .text:0x80363C40; // type:function size:0x54 +getCmdCameraId__14dSndStateMgr_cFv = .text:0x80363CA0; // type:function size:0x5C +getCmdMsgWaitId__14dSndStateMgr_cFv = .text:0x80363D00; // type:function size:0x60 +getCmdFrameCountId__14dSndStateMgr_cFv = .text:0x80363D60; // type:function size:0x54 +clearEventExecuteCallback__14dSndStateMgr_cFv = .text:0x80363DC0; // type:function size:0xC +playSe__14dSndStateMgr_cFUl = .text:0x80363DD0; // type:function size:0x1AC +doSe__14dSndStateMgr_cFPCc = .text:0x80363F80; // type:function size:0x48 fn_80363FD0 = .text:0x80363FD0; // type:function size:0x24C fn_80364220 = .text:0x80364220; // type:function size:0x9C -fn_803642C0 = .text:0x803642C0; // type:function size:0x84 -fn_80364350 = .text:0x80364350; // type:function size:0x48 -fn_803643A0 = .text:0x803643A0; // type:function size:0x130 -fn_803644D0 = .text:0x803644D0; // type:function size:0x40 -fn_80364510 = .text:0x80364510; // type:function size:0x60 -fn_80364570 = .text:0x80364570; // type:function size:0x8 -fn_80364580 = .text:0x80364580; // type:function size:0x1C4 -fn_80364750 = .text:0x80364750; // type:function size:0x84 -fn_803647E0 = .text:0x803647E0; // type:function size:0x8 -fn_803647F0 = .text:0x803647F0; // type:function size:0x44 -fn_80364840 = .text:0x80364840; // type:function size:0x60 -fn_803648A0 = .text:0x803648A0; // type:function size:0x8 -fn_803648B0 = .text:0x803648B0; // type:function size:0x190 -fn_80364A40 = .text:0x80364A40; // type:function size:0x9C -fn_80364AE0 = .text:0x80364AE0; // type:function size:0x8C +playFanOrBgm__14dSndStateMgr_cFUl = .text:0x803642C0; // type:function size:0x84 +doBgm__14dSndStateMgr_cFPCc = .text:0x80364350; // type:function size:0x48 +playCmd__14dSndStateMgr_cFUl = .text:0x803643A0; // type:function size:0x130 +doCmd__14dSndStateMgr_cFPCc = .text:0x803644D0; // type:function size:0x40 +calcSe__14dSndStateMgr_cFv = .text:0x80364510; // type:function size:0x60 +handleSe__14dSndStateMgr_cFv = .text:0x80364570; // type:function size:0x8 +handleSeLv__14dSndStateMgr_cFv = .text:0x80364580; // type:function size:0x1C4 +calcBgm__14dSndStateMgr_cFv = .text:0x80364750; // type:function size:0x84 +getBgmLabelSoundId__14dSndStateMgr_cFv = .text:0x803647E0; // type:function size:0x8 +handleFan__14dSndStateMgr_cFv = .text:0x803647F0; // type:function size:0x44 +calcCmd__14dSndStateMgr_cFv = .text:0x80364840; // type:function size:0x60 +handleCmd__14dSndStateMgr_cFv = .text:0x803648A0; // type:function size:0x8 +finalizeEvent__14dSndStateMgr_cFb = .text:0x803648B0; // type:function size:0x190 +__cl__25SoundStopperIfParamFlag20FRQ34nw4r3snd11SoundHandle = .text:0x80364A40; // type:function size:0x9C +endEvent__14dSndStateMgr_cFb = .text:0x80364AE0; // type:function size:0x8C fn_80364B70 = .text:0x80364B70; // type:function size:0xD0 -fn_80364C40 = .text:0x80364C40; // type:function size:0xBC -fn_80364D00 = .text:0x80364D00; // type:function size:0x94 -fn_80364DA0 = .text:0x80364DA0; // type:function size:0xC -fn_80364DB0 = .text:0x80364DB0; // type:function size:0x2C -fn_80364DE0 = .text:0x80364DE0; // type:function size:0x7C -fn_80364E60 = .text:0x80364E60; // type:function size:0x54 -fn_80364EC0 = .text:0x80364EC0; // type:function size:0x90 -fn_80364F50 = .text:0x80364F50; // type:function size:0x7C -fn_80364FD0 = .text:0x80364FD0; // type:function size:0x50 -fn_80365020 = .text:0x80365020; // type:function size:0x84 -fn_803650B0 = .text:0x803650B0; // type:function size:0x6C +resetEventVars__14dSndStateMgr_cFv = .text:0x80364C40; // type:function size:0xBC +onCameraCut__14dSndStateMgr_cFl = .text:0x80364D00; // type:function size:0x94 +isInEvent__14dSndStateMgr_cFv = .text:0x80364DA0; // type:function size:0xC +isInEvent__14dSndStateMgr_cFPCc = .text:0x80364DB0; // type:function size:0x2C +onMsgStart__14dSndStateMgr_cFl = .text:0x80364DE0; // type:function size:0x7C +onMsgEnd__14dSndStateMgr_cFv = .text:0x80364E60; // type:function size:0x54 +onMsgWaitStart__14dSndStateMgr_cFv = .text:0x80364EC0; // type:function size:0x90 +onMsgWaitEnd__14dSndStateMgr_cFv = .text:0x80364F50; // type:function size:0x7C +setFlowEvent__14dSndStateMgr_cFUl = .text:0x80364FD0; // type:function size:0x50 +onSkipEvent__14dSndStateMgr_cCFv = .text:0x80365020; // type:function size:0x84 +onLinkDie__14dSndStateMgr_cFv = .text:0x803650B0; // type:function size:0x6C getStageMusicDemoName = .text:0x80365120; // type:function size:0x28 -getCurrentStageMusicDemoName = .text:0x80365150; // type:function size:0x8 +getCurrentStageMusicDemoName__14dSndStateMgr_cCFv = .text:0x80365150; // type:function size:0x8 fn_80365160 = .text:0x80365160; // type:function size:0x24 -fn_80365190 = .text:0x80365190; // type:function size:0x8 -fn_803651A0 = .text:0x803651A0; // type:function size:0xA0 -fn_80365240 = .text:0x80365240; // type:function size:0x1F8 -fn_80365440 = .text:0x80365440; // type:function size:0x10C -fn_80365550 = .text:0x80365550; // type:function size:0x1A8 -setUnderwaterLpfFreq = .text:0x80365700; // type:function size:0xCC -fn_803657D0 = .text:0x803657D0; // type:function size:0x78 -fn_80365850 = .text:0x80365850; // type:function size:0x70 -fn_803658C0 = .text:0x803658C0; // type:function size:0x5C -fn_80365920 = .text:0x80365920; // type:function size:0x4C -fn_80365970 = .text:0x80365970; // type:function size:0x8 -fn_80365980 = .text:0x80365980; // type:function size:0x54 -resetBgmAndStageEffectLpfFreq = .text:0x803659E0; // type:function size:0x4C -resetBgmLpfFreq = .text:0x80365A30; // type:function size:0x48 -fn_80365A80 = .text:0x80365A80; // type:function size:0x4C -fn_80365AD0 = .text:0x80365AD0; // type:function size:0xA8 -fn_80365B80 = .text:0x80365B80; // type:function size:0x5C -fn_80365BE0 = .text:0x80365BE0; // type:function size:0x70 +setStbEventName__14dSndStateMgr_cFPCc = .text:0x80365190; // type:function size:0x8 +calcRoomId__14dSndStateMgr_cFv = .text:0x803651A0; // type:function size:0xA0 +setRoomId__14dSndStateMgr_cFl = .text:0x80365240; // type:function size:0x1F8 +calcTgSnd__14dSndStateMgr_cFv = .text:0x80365440; // type:function size:0x10C +calcFilters__14dSndStateMgr_cFv = .text:0x80365550; // type:function size:0x1A8 +setFiltersIfUnderwater__14dSndStateMgr_cFv = .text:0x80365700; // type:function size:0xCC +setBgmLpfAndFxSendIfUnderwater__14dSndStateMgr_cFv = .text:0x803657D0; // type:function size:0x78 +resetLpfAndFxSend__14dSndStateMgr_cFv = .text:0x80365850; // type:function size:0x70 +resetBgmLpfAndFxSend__14dSndStateMgr_cFv = .text:0x803658C0; // type:function size:0x5C +setBgmAndStageEffectLpf__14dSndStateMgr_cFv = .text:0x80365920; // type:function size:0x4C +setBgmLpf__14dSndStateMgr_cFv = .text:0x80365970; // type:function size:0x8 +setBgmLpf__14dSndStateMgr_cFl = .text:0x80365980; // type:function size:0x54 +resetBgmAndStageEffectLpf__14dSndStateMgr_cFv = .text:0x803659E0; // type:function size:0x4C +resetBgmLpf__14dSndStateMgr_cFv = .text:0x80365A30; // type:function size:0x48 +calcFxSend3D__14dSndStateMgr_cFv = .text:0x80365A80; // type:function size:0x4C +restoreEffects__14dSndStateMgr_cFv = .text:0x80365AD0; // type:function size:0xA8 +setFxSend3DTarget__14dSndStateMgr_cFv = .text:0x80365B80; // type:function size:0x5C +getUserParamVolume__14dSndStateMgr_cFUl = .text:0x80365BE0; // type:function size:0x70 fn_80365C50 = .text:0x80365C50; // type:function size:0xC8 -fn_80365D20 = .text:0x80365D20; // type:function size:0x3C -fn_80365D60 = .text:0x80365D60; // type:function size:0x24 -fn_80365D90 = .text:0x80365D90; // type:function size:0x44 -fn_80365DE0 = .text:0x80365DE0; // type:function size:0x1C -findMusicInMusicStruct = .text:0x80365E00; // type:function size:0xC0 -fn_80365EC0 = .text:0x80365EC0; // type:function size:0xA8 -fn_80365F70 = .text:0x80365F70; // type:function size:0xA8 -fn_80366020 = .text:0x80366020; // type:function size:0x28 -fn_80366050 = .text:0x80366050; // type:function size:0x28 -fn_80366080 = .text:0x80366080; // type:function size:0x10 +loadObjectSound__14dSndStateMgr_cFv = .text:0x80365D20; // type:function size:0x3C +getStageName__14dSndStateMgr_cFl = .text:0x80365D60; // type:function size:0x24 +getStageName4__14dSndStateMgr_cFl = .text:0x80365D90; // type:function size:0x44 +getCurrentStageName4__14dSndStateMgr_cFv = .text:0x80365DE0; // type:function size:0x1C +getSndStageId__14dSndStateMgr_cFPCcl = .text:0x80365E00; // type:function size:0xC0 +getSndStageId3__14dSndStateMgr_cFPCcl = .text:0x80365EC0; // type:function size:0xA8 +getSndStageId4__14dSndStateMgr_cFPCcl = .text:0x80365F70; // type:function size:0xA8 +getSndStageId2__14dSndStateMgr_cFl = .text:0x80366020; // type:function size:0x28 +getSndStageId4__14dSndStateMgr_cFl = .text:0x80366050; // type:function size:0x28 +getNextSndStageId__14dSndStateMgr_cFl = .text:0x80366080; // type:function size:0x10 fn_80366090 = .text:0x80366090; // type:function size:0x88 -fn_80366120 = .text:0x80366120; // type:function size:0x7C +specialLayerVersionExists__14dSndStateMgr_cFPCcl = .text:0x80366120; // type:function size:0x7C fn_803661A0 = .text:0x803661A0; // type:function size:0x10 fn_803661B0 = .text:0x803661B0; // type:function size:0x10 -actuallyFindSoundIdForStageLayer = .text:0x803661C0; // type:function size:0x224 +getSoundIdForStageAndLayer__14dSndStateMgr_cFQ214dSndStateMgr_c15SoundIdLookup_ePCcll = .text:0x803661C0; // type:function size:0x224 fn_803663F0 = .text:0x803663F0; // type:function size:0x1C fn_80366410 = .text:0x80366410; // type:function size:0x1C fn_80366430 = .text:0x80366430; // type:function size:0x4C @@ -20178,8 +20178,8 @@ fn_80366DE0 = .text:0x80366DE0; // type:function size:0x118 fn_80366F00 = .text:0x80366F00; // type:function size:0x5C fn_80366F60 = .text:0x80366F60; // type:function size:0x30C fn_80367270 = .text:0x80367270; // type:function size:0xC -fn_80367280 = .text:0x80367280; // type:function size:0x18C -fn_80367410 = .text:0x80367410; // type:function size:0x4 +setCallbacksForStage__14dSndStateMgr_cFv = .text:0x80367280; // type:function size:0x18C +cbUnkNoop__14dSndStateMgr_cFv = .text:0x80367410; // type:function size:0x4 fn_80367420 = .text:0x80367420; // type:function size:0x24 fn_80367450 = .text:0x80367450; // type:function size:0x14 fn_80367470 = .text:0x80367470; // type:function size:0x64 @@ -20308,8 +20308,8 @@ fn_803695B0 = .text:0x803695B0; // type:function size:0x14 playExitTriforceRoomSound = .text:0x803695D0; // type:function size:0x3C fn_80369610 = .text:0x80369610; // type:function size:0x38 fn_80369650 = .text:0x80369650; // type:function size:0x14 -fn_80369670 = .text:0x80369670; // type:function size:0x1C4 -fn_80369840 = .text:0x80369840; // type:function size:0xB8 +handleStageEvent__14dSndStateMgr_cFPCc = .text:0x80369670; // type:function size:0x1C4 +handleGlobalEvent__14dSndStateMgr_cFPCc = .text:0x80369840; // type:function size:0xB8 fn_80369900 = .text:0x80369900; // type:function size:0x10 fn_80369910 = .text:0x80369910; // type:function size:0x60 fn_80369970 = .text:0x80369970; // type:function size:0x34 @@ -20333,22 +20333,22 @@ fn_8036A0D0 = .text:0x8036A0D0; // type:function size:0x3C fn_8036A110 = .text:0x8036A110; // type:function size:0x108 fn_8036A220 = .text:0x8036A220; // type:function size:0x3C fn_8036A260 = .text:0x8036A260; // type:function size:0x6C -fn_8036A2D0 = .text:0x8036A2D0; // type:function size:0xB8 -fn_8036A390 = .text:0x8036A390; // type:function size:0x14 +handleDemoEvent__14dSndStateMgr_cFPCc = .text:0x8036A2D0; // type:function size:0xB8 +resetOverrides__14dSndStateMgr_cFv = .text:0x8036A390; // type:function size:0x14 __dt__42SndMgrDisposer<24dSndAreaSoundEffectMgr_c>Fv = .text:0x8036A3B0; // type:function size:0x78 create__42SndMgrDisposer<24dSndAreaSoundEffectMgr_c>Fv = .text:0x8036A430; // type:function size:0x48 remove__42SndMgrDisposer<24dSndAreaSoundEffectMgr_c>Fv = .text:0x8036A480; // type:function size:0x10 __ct__24dSndAreaSoundEffectMgr_cFv = .text:0x8036A490; // type:function size:0x88 __dt__15dSndAreaSound_cFv = .text:0x8036A520; // type:function size:0x58 calc__24dSndAreaSoundEffectMgr_cFv = .text:0x8036A580; // type:function size:0x74 -fn_8036A600 = .text:0x8036A600; // type:function size:0x88 -fn_8036A690 = .text:0x8036A690; // type:function size:0x9C +calcPlayerVolume__24dSndAreaSoundEffectMgr_cFv = .text:0x8036A600; // type:function size:0x88 +calcActorVolume__24dSndAreaSoundEffectMgr_cFv = .text:0x8036A690; // type:function size:0x9C startSound__24dSndAreaSoundEffectMgr_cFUlUl = .text:0x8036A730; // type:function size:0xEC -fn_8036A820 = .text:0x8036A820; // type:function size:0x328 +loadStageSound__24dSndAreaSoundEffectMgr_cFPf = .text:0x8036A820; // type:function size:0x328 fn_8036AB50 = .text:0x8036AB50; // type:function size:0x20 -fn_8036AB70 = .text:0x8036AB70; // type:function size:0x4 -fn_8036AB80 = .text:0x8036AB80; // type:function size:0x4 -fn_8036AB90 = .text:0x8036AB90; // type:function size:0xFC +onEventStart__24dSndAreaSoundEffectMgr_cFv = .text:0x8036AB70; // type:function size:0x4 +onEventEnd__24dSndAreaSoundEffectMgr_cFv = .text:0x8036AB80; // type:function size:0x4 +holdInWaterLvSound__24dSndAreaSoundEffectMgr_cFf = .text:0x8036AB90; // type:function size:0xFC stopSounds__24dSndAreaSoundEffectMgr_cFl = .text:0x8036AC90; // type:function size:0x68 fn_8036AD00 = .text:0x8036AD00; // type:function size:0xB0 isPlayingAnySound__24dSndAreaSoundEffectMgr_cCFv = .text:0x8036ADB0; // type:function size:0x44 @@ -20360,10 +20360,10 @@ fn_8036B170 = .text:0x8036B170; // type:function size:0x200 fn_8036B370 = .text:0x8036B370; // type:function size:0x6C fn_8036B3E0 = .text:0x8036B3E0; // type:function size:0xA4 fn_8036B490 = .text:0x8036B490; // type:function size:0x124 -fn_8036B5C0 = .text:0x8036B5C0; // type:function size:0x6C +pauseAllSounds__24dSndAreaSoundEffectMgr_cFv = .text:0x8036B5C0; // type:function size:0x6C fn_8036B630 = .text:0x8036B630; // type:function size:0x170 -fn_8036B7A0 = .text:0x8036B7A0; // type:function size:0x110 -fn_8036B8B0 = .text:0x8036B8B0; // type:function size:0x20 +setTgSoundVolume__24dSndAreaSoundEffectMgr_cFfl = .text:0x8036B7A0; // type:function size:0x110 +__cl__17SoundVolumeSetterFRQ34nw4r3snd11SoundHandle = .text:0x8036B8B0; // type:function size:0x20 __ct__15dSndAreaSound_cFv = .text:0x8036B8D0; // type:function size:0x54 cancel__15dSndAreaSound_cFv = .text:0x8036B930; // type:function size:0x34 calc__15dSndAreaSound_cFv = .text:0x8036B970; // type:function size:0xC4 @@ -20404,44 +20404,44 @@ apply__26dSndControlPlayerLpfFreq_cFv = .text:0x8036C5F0; // type:function size: getAppliedValue__26dSndControlPlayerLpfFreq_cFv = .text:0x8036C600; // type:function size:0xC apply__25dSndControlPlayerFxSend_cFv = .text:0x8036C610; // type:function size:0x40 getAppliedValue__25dSndControlPlayerFxSend_cFv = .text:0x8036C650; // type:function size:0x58 -fn_8036C6B0 = .text:0x8036C6B0; // type:function size:0x64 -isInvalidSoundId = .text:0x8036C720; // type:function size:0x10 -FanfareSoundMgr__dtor = .text:0x8036C730; // type:function size:0x78 -initFanfareSoundMgr = .text:0x8036C7B0; // type:function size:0x48 -FanfareSoundMgr__deref = .text:0x8036C800; // type:function size:0x10 -FanfareSoundMgr__ctor = .text:0x8036C810; // type:function size:0x204 -fn_8036CA20 = .text:0x8036CA20; // type:function size:0xF0 -fn_8036CB10 = .text:0x8036CB10; // type:function size:0x54 -fn_8036CB70 = .text:0x8036CB70; // type:function size:0x19C +isSoundPlayedByBgmBattlePlayer__12dSndBgmMgr_cFUl = .text:0x8036C6B0; // type:function size:0x64 +isBgmBattle2__12dSndBgmMgr_cFUl = .text:0x8036C720; // type:function size:0x10 +__dt__30SndMgrDisposer<12dSndBgmMgr_c>Fv = .text:0x8036C730; // type:function size:0x78 +create__30SndMgrDisposer<12dSndBgmMgr_c>Fv = .text:0x8036C7B0; // type:function size:0x48 +remove__30SndMgrDisposer<12dSndBgmMgr_c>Fv = .text:0x8036C800; // type:function size:0x10 +__ct__12dSndBgmMgr_cFv = .text:0x8036C810; // type:function size:0x204 +setup__12dSndBgmMgr_cFPQ23EGG4Heap = .text:0x8036CA20; // type:function size:0xF0 +calc__12dSndBgmMgr_cFv = .text:0x8036CB10; // type:function size:0x54 +calcLists__12dSndBgmMgr_cFv = .text:0x8036CB70; // type:function size:0x19C fn_8036CD10 = .text:0x8036CD10; // type:function size:0x34 fn_8036CD50 = .text:0x8036CD50; // type:function size:0x88 fn_8036CDE0 = .text:0x8036CDE0; // type:function size:0xFC fn_8036CEE0 = .text:0x8036CEE0; // type:function size:0x12C -fn_8036D010 = .text:0x8036D010; // type:function size:0x98 +restoreEffects__12dSndBgmMgr_cFv = .text:0x8036D010; // type:function size:0x98 fn_8036D0B0 = .text:0x8036D0B0; // type:function size:0x11C -fn_8036D1D0 = .text:0x8036D1D0; // type:function size:0x208 -fn_8036D3E0 = .text:0x8036D3E0; // type:function size:0x170 +loadStageSound__12dSndBgmMgr_cFv = .text:0x8036D1D0; // type:function size:0x208 +playBgm__12dSndBgmMgr_cFUllb = .text:0x8036D3E0; // type:function size:0x170 fn_8036D550 = .text:0x8036D550; // type:function size:0x174 -fn_8036D6D0 = .text:0x8036D6D0; // type:function size:0x60 -fn_8036D730 = .text:0x8036D730; // type:function size:0x138 +startBgmMuteSound__12dSndBgmMgr_cFv = .text:0x8036D6D0; // type:function size:0x60 +prepareBgmSound__12dSndBgmMgr_cFUlP14dSndBgmSound_cUl = .text:0x8036D730; // type:function size:0x138 fn_8036D870 = .text:0x8036D870; // type:function size:0x1D0 -fn_8036DA40 = .text:0x8036DA40; // type:function size:0xA0 -fn_8036DAE0 = .text:0x8036DAE0; // type:function size:0x74 -fn_8036DB60 = .text:0x8036DB60; // type:function size:0x84 +prepareBgm__12dSndBgmMgr_cFUlUl = .text:0x8036DA40; // type:function size:0xA0 +stopAllBgm__12dSndBgmMgr_cFl = .text:0x8036DAE0; // type:function size:0x74 +stopBgmSound__12dSndBgmMgr_cFP14dSndBgmSound_cl = .text:0x8036DB60; // type:function size:0x84 fn_8036DBF0 = .text:0x8036DBF0; // type:function size:0x2E4 fn_8036DEE0 = .text:0x8036DEE0; // type:function size:0x80 fn_8036DF60 = .text:0x8036DF60; // type:function size:0xBC fn_8036E020 = .text:0x8036E020; // type:function size:0xC4 fn_8036E0F0 = .text:0x8036E0F0; // type:function size:0x80 -fn_8036E170 = .text:0x8036E170; // type:function size:0x1C +stopBgmHandleIdx__12dSndBgmMgr_cFUll = .text:0x8036E170; // type:function size:0x1C fn_8036E190 = .text:0x8036E190; // type:function size:0x60 -fn_8036E1F0 = .text:0x8036E1F0; // type:function size:0x18 +endBgmMuteSound__12dSndBgmMgr_cFv = .text:0x8036E1F0; // type:function size:0x18 fn_8036E210 = .text:0x8036E210; // type:function size:0x78 fn_8036E290 = .text:0x8036E290; // type:function size:0xC0 fn_8036E350 = .text:0x8036E350; // type:function size:0x9C fn_8036E3F0 = .text:0x8036E3F0; // type:function size:0x90 fn_8036E480 = .text:0x8036E480; // type:function size:0x94 -fn_8036E520 = .text:0x8036E520; // type:function size:0x6C +pauseAllBgm__12dSndBgmMgr_cFv = .text:0x8036E520; // type:function size:0x6C fn_8036E590 = .text:0x8036E590; // type:function size:0x68 fn_8036E600 = .text:0x8036E600; // type:function size:0x18 fn_8036E620 = .text:0x8036E620; // type:function size:0x68 @@ -20451,59 +20451,59 @@ fn_8036E820 = .text:0x8036E820; // type:function size:0x154 fn_8036E980 = .text:0x8036E980; // type:function size:0xD4 fn_8036EA60 = .text:0x8036EA60; // type:function size:0xC4 fn_8036EB30 = .text:0x8036EB30; // type:function size:0xC4 -fn_8036EC00 = .text:0x8036EC00; // type:function size:0x28 +checkForPrepareStoppedBgmSound__12dSndBgmMgr_cFUl = .text:0x8036EC00; // type:function size:0x28 fn_8036EC30 = .text:0x8036EC30; // type:function size:0x98 -fn_8036ECD0 = .text:0x8036ECD0; // type:function size:0x64 -fn_8036ED40 = .text:0x8036ED40; // type:function size:0x58 +prepareBgm__12dSndBgmMgr_cFv = .text:0x8036ECD0; // type:function size:0x64 +startAdditionalBgm__12dSndBgmMgr_cFUl = .text:0x8036ED40; // type:function size:0x58 fn_8036EDA0 = .text:0x8036EDA0; // type:function size:0x3F8 fn_8036F1A0 = .text:0x8036F1A0; // type:function size:0x58 -fn_8036F200 = .text:0x8036F200; // type:function size:0x100 +prepareBossBgm__12dSndBgmMgr_cFPCc = .text:0x8036F200; // type:function size:0x100 fn_8036F300 = .text:0x8036F300; // type:function size:0xA8 musicForStageRelated = .text:0x8036F3B0; // type:function size:0x9EC fn_8036FDA0 = .text:0x8036FDA0; // type:function size:0x2C fn_8036FDD0 = .text:0x8036FDD0; // type:function size:0x298 fn_80370070 = .text:0x80370070; // type:function size:0xC8 -fn_80370140 = .text:0x80370140; // type:function size:0x8 +setOverrideBgmId__12dSndBgmMgr_cFUl = .text:0x80370140; // type:function size:0x8 fn_80370150 = .text:0x80370150; // type:function size:0x20 -fn_80370170 = .text:0x80370170; // type:function size:0x1C +activateOverrideBgmId__12dSndBgmMgr_cFv = .text:0x80370170; // type:function size:0x1C fn_80370190 = .text:0x80370190; // type:function size:0x180 fn_80370310 = .text:0x80370310; // type:function size:0x8 fn_80370320 = .text:0x80370320; // type:function size:0xF4 fn_80370420 = .text:0x80370420; // type:function size:0xCC fn_803704F0 = .text:0x803704F0; // type:function size:0xC -fn_80370500 = .text:0x80370500; // type:function size:0x120 +playBattleBgm__12dSndBgmMgr_cFUlb = .text:0x80370500; // type:function size:0x120 fn_80370620 = .text:0x80370620; // type:function size:0xC0 -fn_803706E0 = .text:0x803706E0; // type:function size:0x24 +beginBgmBattleMainLoop__12dSndBgmMgr_cFv = .text:0x803706E0; // type:function size:0x24 fn_80370710 = .text:0x80370710; // type:function size:0x64 -fn_80370780 = .text:0x80370780; // type:function size:0x54 -fn_803707E0 = .text:0x803707E0; // type:function size:0x60 -fn_80370840 = .text:0x80370840; // type:function size:0x78 +beginBgmBattleRoom__12dSndBgmMgr_cFv = .text:0x80370780; // type:function size:0x54 +endBgmBattleRoom__12dSndBgmMgr_cFv = .text:0x803707E0; // type:function size:0x60 +isPlayingAnyBattleMusic__12dSndBgmMgr_cFv = .text:0x80370840; // type:function size:0x78 fn_803708C0 = .text:0x803708C0; // type:function size:0x34 -fn_80370900 = .text:0x80370900; // type:function size:0xA0 +weirdCheckAlwaysFalse__12dSndBgmMgr_cFv = .text:0x80370900; // type:function size:0xA0 fn_803709A0 = .text:0x803709A0; // type:function size:0xA8 fn_80370A50 = .text:0x80370A50; // type:function size:0x74 fn_80370AD0 = .text:0x80370AD0; // type:function size:0x64 fn_80370B40 = .text:0x80370B40; // type:function size:0x44 -fn_80370B90 = .text:0x80370B90; // type:function size:0xEC +playDelayedSound__12dSndBgmMgr_cFUll = .text:0x80370B90; // type:function size:0xEC fn_80370C80 = .text:0x80370C80; // type:function size:0x4C -fn_80370CD0 = .text:0x80370CD0; // type:function size:0x14 -fn_80370CF0 = .text:0x80370CF0; // type:function size:0x70 -fn_80370D60 = .text:0x80370D60; // type:function size:0xBC -fn_80370E20 = .text:0x80370E20; // type:function size:0x28 +cancelDelayedSound__12dSndBgmMgr_cFv = .text:0x80370CD0; // type:function size:0x14 +cancelDelayedBgm__12dSndBgmMgr_cFv = .text:0x80370CF0; // type:function size:0x70 +startDelayedSound__12dSndBgmMgr_cFv = .text:0x80370D60; // type:function size:0xBC +calcDelayedSound__12dSndBgmMgr_cFv = .text:0x80370E20; // type:function size:0x28 fn_80370E50 = .text:0x80370E50; // type:function size:0x6C -fn_80370EC0 = .text:0x80370EC0; // type:function size:0x70 +setBgmHandleIdxVolume__12dSndBgmMgr_cFUlfl = .text:0x80370EC0; // type:function size:0x70 fn_80370F30 = .text:0x80370F30; // type:function size:0x6C -fn_80370FA0 = .text:0x80370FA0; // type:function size:0xA0 -fn_80371040 = .text:0x80371040; // type:function size:0x138 +onEventStart__12dSndBgmMgr_cFPCcll = .text:0x80370FA0; // type:function size:0xA0 +onEventFinalize__12dSndBgmMgr_cFPCcUlb = .text:0x80371040; // type:function size:0x138 fn_80371180 = .text:0x80371180; // type:function size:0x1A8 fn_80371330 = .text:0x80371330; // type:function size:0x48 fn_80371380 = .text:0x80371380; // type:function size:0x48 -fn_803713D0 = .text:0x803713D0; // type:function size:0x4C -fn_80371420 = .text:0x80371420; // type:function size:0x58 +setBgmToPlayOnEventEnd__12dSndBgmMgr_cFUl = .text:0x803713D0; // type:function size:0x4C +onEventEnd__12dSndBgmMgr_cFv = .text:0x80371420; // type:function size:0x58 fn_80371480 = .text:0x80371480; // type:function size:0x7C fn_80371500 = .text:0x80371500; // type:function size:0x60 -fn_80371560 = .text:0x80371560; // type:function size:0x84 -fn_803715F0 = .text:0x803715F0; // type:function size:0x84 +onTgSndAreaFlagsChange__12dSndBgmMgr_cFUlUl = .text:0x80371560; // type:function size:0x84 +onTgSndAreaMgFlagsChange__12dSndBgmMgr_cFUlUl = .text:0x803715F0; // type:function size:0x84 fn_80371680 = .text:0x80371680; // type:function size:0xB0 fn_80371730 = .text:0x80371730; // type:function size:0x84 fn_803717C0 = .text:0x803717C0; // type:function size:0x160 @@ -20512,36 +20512,36 @@ fn_80371A60 = .text:0x80371A60; // type:function size:0x88 fn_80371AF0 = .text:0x80371AF0; // type:function size:0x58 fn_80371B50 = .text:0x80371B50; // type:function size:0x58 fn_80371BB0 = .text:0x80371BB0; // type:function size:0x58 -fn_80371C10 = .text:0x80371C10; // type:function size:0x58 -fn_80371C70 = .text:0x80371C70; // type:function size:0x70 +isPlayingBgmSound__12dSndBgmMgr_cCFv = .text:0x80371C10; // type:function size:0x58 +isPlayingBgmSoundId__12dSndBgmMgr_cCFUl = .text:0x80371C70; // type:function size:0x70 fn_80371CE0 = .text:0x80371CE0; // type:function size:0x64 -fn_80371D50 = .text:0x80371D50; // type:function size:0x84 +isBgmHandleIdxPlayingSoundId__12dSndBgmMgr_cFUlUl = .text:0x80371D50; // type:function size:0x84 fn_80371DE0 = .text:0x80371DE0; // type:function size:0x10C fn_80371EF0 = .text:0x80371EF0; // type:function size:0xA0 fn_80371F90 = .text:0x80371F90; // type:function size:0xDC -fn_80372070 = .text:0x80372070; // type:function size:0x68 -fn_803720E0 = .text:0x803720E0; // type:function size:0x70 -fn_80372150 = .text:0x80372150; // type:function size:0x94 -fn_803721F0 = .text:0x803721F0; // type:function size:0xD8 -fn_803722D0 = .text:0x803722D0; // type:function size:0x20 -fn_803722F0 = .text:0x803722F0; // type:function size:0x70 +isFadingOutBgmSoundId__12dSndBgmMgr_cCFUl = .text:0x80372070; // type:function size:0x68 +isPreparingBgmSoundId__12dSndBgmMgr_cCFUl = .text:0x803720E0; // type:function size:0x70 +isPreparingBgmSoundIdWithStartOffset__12dSndBgmMgr_cCFUlUl = .text:0x80372150; // type:function size:0x94 +isPreparedBgmSoundId__12dSndBgmMgr_cCFUl = .text:0x803721F0; // type:function size:0xD8 +getBgmSoundByIndex__12dSndBgmMgr_cFUl = .text:0x803722D0; // type:function size:0x20 +getBgmSoundHandleForId__12dSndBgmMgr_cCFUl = .text:0x803722F0; // type:function size:0x70 fn_80372360 = .text:0x80372360; // type:function size:0xC4 -fn_80372430 = .text:0x80372430; // type:function size:0xD0 -fn_80372500 = .text:0x80372500; // type:function size:0xD8 +getSoundHandleForBgm__12dSndBgmMgr_cFUlUl = .text:0x80372430; // type:function size:0xD0 +getActiveBgmSound__12dSndBgmMgr_cFv = .text:0x80372500; // type:function size:0xD8 fn_803725E0 = .text:0x803725E0; // type:function size:0xB4 fn_803726A0 = .text:0x803726A0; // type:function size:0xE4 -fn_80372790 = .text:0x80372790; // type:function size:0x10C +findIdleBgmSoundHandle__12dSndBgmMgr_cFv = .text:0x80372790; // type:function size:0x10C fn_803728A0 = .text:0x803728A0; // type:function size:0x74 -fn_80372920 = .text:0x80372920; // type:function size:0x3C -fn_80372960 = .text:0x80372960; // type:function size:0x8 -fn_80372970 = .text:0x80372970; // type:function size:0x6C -fn_803729E0 = .text:0x803729E0; // type:function size:0x6C -fn_80372A50 = .text:0x80372A50; // type:function size:0x70 -fn_80372AC0 = .text:0x80372AC0; // type:function size:0x5C -fn_80372B20 = .text:0x80372B20; // type:function size:0x98 -fn_80372BC0 = .text:0x80372BC0; // type:function size:0x28 -fn_80372BF0 = .text:0x80372BF0; // type:function size:0x28 -fn_80372C20 = .text:0x80372C20; // type:function size:0x28 +cullTooManyPreparingSounds__12dSndBgmMgr_cFv = .text:0x80372920; // type:function size:0x3C +getBgmBattleSound__12dSndBgmMgr_cFv = .text:0x80372960; // type:function size:0x8 +addToBgmSoundList__12dSndBgmMgr_cFQ212dSndBgmMgr_c14BgmSoundList_eP14dSndBgmSound_c = .text:0x80372970; // type:function size:0x6C +appendToBgmSoundList__12dSndBgmMgr_cFQ212dSndBgmMgr_c14BgmSoundList_eP14dSndBgmSound_c = .text:0x803729E0; // type:function size:0x6C +removeFromBgmSoundList__12dSndBgmMgr_cFQ212dSndBgmMgr_c14BgmSoundList_eP14dSndBgmSound_c = .text:0x80372A50; // type:function size:0x70 +removeFromAllBgmSoundLists__12dSndBgmMgr_cFP14dSndBgmSound_c = .text:0x80372AC0; // type:function size:0x5C +isInBgmSoundList__12dSndBgmMgr_cFQ212dSndBgmMgr_c14BgmSoundList_eP14dSndBgmSound_c = .text:0x80372B20; // type:function size:0x98 +getFirstInBgmSoundList__12dSndBgmMgr_cFQ212dSndBgmMgr_c14BgmSoundList_e = .text:0x80372BC0; // type:function size:0x28 +getNextInBgmSoundList__12dSndBgmMgr_cFQ212dSndBgmMgr_c14BgmSoundList_eP14dSndBgmSound_c = .text:0x80372BF0; // type:function size:0x28 +getLastInBgmSoundList__12dSndBgmMgr_cFQ212dSndBgmMgr_c14BgmSoundList_e = .text:0x80372C20; // type:function size:0x28 fn_80372C50 = .text:0x80372C50; // type:function size:0x8C fn_80372CE0 = .text:0x80372CE0; // type:function size:0x8C fn_80372D70 = .text:0x80372D70; // type:function size:0x74 @@ -20549,20 +20549,20 @@ fn_80372DF0 = .text:0x80372DF0; // type:function size:0x40 fn_80372E30 = .text:0x80372E30; // type:function size:0x40 fn_80372E70 = .text:0x80372E70; // type:function size:0xB0 fn_80372F20 = .text:0x80372F20; // type:function size:0x6C -AnotherSoundMgr__playSound = .text:0x80372F90; // type:function size:0x264 -vt_0xF4__14dSoundSource_cFv = .text:0x80373200; // type:function size:0x8 -fn_80373210 = .text:0x80373210; // type:function size:0xB4 -fn_803732D0 = .text:0x803732D0; // type:function size:0x44 -fn_80373320 = .text:0x80373320; // type:function size:0x8C -fn_803733B0 = .text:0x803733B0; // type:function size:0x110 -fn_803734C0 = .text:0x803734C0; // type:function size:0x8C -fn_80373550 = .text:0x80373550; // type:function size:0x110 -fn_80373660 = .text:0x80373660; // type:function size:0xC8 -fn_80373730 = .text:0x80373730; // type:function size:0x68 -fn_803737A0 = .text:0x803737A0; // type:function size:0x108 -fn_803738B0 = .text:0x803738B0; // type:function size:0x4C -fn_80373900 = .text:0x80373900; // type:function size:0x4C -fn_80373950 = .text:0x80373950; // type:function size:0x7C +playFanSound__12dSndBgmMgr_cFUl = .text:0x80372F90; // type:function size:0x264 +setField0x101__14dSoundSource_cFb = .text:0x80373200; // type:function size:0x8 +prepareFanSound__12dSndBgmMgr_cFUl = .text:0x80373210; // type:function size:0xB4 +getFreeFanSoundHandle__12dSndBgmMgr_cFv = .text:0x803732D0; // type:function size:0x44 +getFanSoundHandleForFan__12dSndBgmMgr_cFUl = .text:0x80373320; // type:function size:0x8C +getSoundHandleCurrentlyPlayingFanSound__12dSndBgmMgr_cFUl = .text:0x803733B0; // type:function size:0x110 +getFanSoundHandleForFan2__12dSndBgmMgr_cFUl = .text:0x803734C0; // type:function size:0x8C +isCurrentlyPlayingFanSound__12dSndBgmMgr_cCFUl = .text:0x80373550; // type:function size:0x110 +hasPlayingFanSounds__12dSndBgmMgr_cCFv = .text:0x80373660; // type:function size:0xC8 +stopFanSounds__12dSndBgmMgr_cFl = .text:0x80373730; // type:function size:0x68 +calcStopOldBgmSounds__12dSndBgmMgr_cFv = .text:0x803737A0; // type:function size:0x108 +registSound__12dSndBgmMgr_cFP11dSndSound_c = .text:0x803738B0; // type:function size:0x4C +unregistSound__12dSndBgmMgr_cFP11dSndSound_c = .text:0x80373900; // type:function size:0x4C +isSoundRegist__12dSndBgmMgr_cFP11dSndSound_c = .text:0x80373950; // type:function size:0x7C fn_803739D0 = .text:0x803739D0; // type:function size:0x58 fn_80373A30 = .text:0x80373A30; // type:function size:0x8 fn_80373A40 = .text:0x80373A40; // type:function size:0x64 @@ -20591,8 +20591,8 @@ fn_80374DB0 = .text:0x80374DB0; // type:function size:0x24 fn_80374DE0 = .text:0x80374DE0; // type:function size:0x58 fn_80374E40 = .text:0x80374E40; // type:function size:0x10 fn_80374E50 = .text:0x80374E50; // type:function size:0x330 -vt_0x38__14dSoundSource_cFv = .text:0x80375180; // type:function size:0x28 -vt_0x3C__14dSoundSource_cFv = .text:0x803751B0; // type:function size:0x10 +checkFlag__14dSoundSource_cCFUl = .text:0x80375180; // type:function size:0x28 +holdFlag__14dSoundSource_cFUl = .text:0x803751B0; // type:function size:0x10 fn_803751C0 = .text:0x803751C0; // type:function size:0x70 fn_80375230 = .text:0x80375230; // type:function size:0xA4 fn_803752E0 = .text:0x803752E0; // type:function size:0xC8 @@ -20694,7 +20694,7 @@ fn_80378230 = .text:0x80378230; // type:function size:0x4C fn_80378280 = .text:0x80378280; // type:function size:0x8 fn_80378290 = .text:0x80378290; // type:function size:0x68 fn_80378300 = .text:0x80378300; // type:function size:0x270 -fn_80378570 = .text:0x80378570; // type:function size:0x95C +loadCallbacks__14dSndBgmSound_cFUl = .text:0x80378570; // type:function size:0x95C fn_80378ED0 = .text:0x80378ED0; // type:function size:0xD4 fn_80378FB0 = .text:0x80378FB0; // type:function size:0x144 fn_80379100 = .text:0x80379100; // type:function size:0x19C @@ -20712,36 +20712,36 @@ fn_80379760 = .text:0x80379760; // type:function size:0xF4 fn_80379860 = .text:0x80379860; // type:function size:0x120 fn_80379980 = .text:0x80379980; // type:function size:0x158 fn_80379AE0 = .text:0x80379AE0; // type:function size:0x40 -fn_80379B20 = .text:0x80379B20; // type:function size:0x200 -fn_80379D20 = .text:0x80379D20; // type:function size:0xF8 -fn_80379E20 = .text:0x80379E20; // type:function size:0x58 -fn_80379E80 = .text:0x80379E80; // type:function size:0xC -fn_80379E90 = .text:0x80379E90; // type:function size:0xC8 -fn_80379F60 = .text:0x80379F60; // type:function size:0xC8 -fn_8037A030 = .text:0x8037A030; // type:function size:0x4 -fn_8037A040 = .text:0x8037A040; // type:function size:0x5C -fn_8037A0A0 = .text:0x8037A0A0; // type:function size:0x20 +loadCallbacks__20dSndBgmBattleSound_cFUl = .text:0x80379B20; // type:function size:0x200 +__ct__14dSndBgmSound_cFv = .text:0x80379D20; // type:function size:0xF8 +__dt__21dSndBgmSoundHarpMgr_cFv = .text:0x80379E20; // type:function size:0x58 +init__14dSndBgmSound_cFRQ34nw4r3snd14SoundStartablel = .text:0x80379E80; // type:function size:0xC +cancel__14dSndBgmSound_cFv = .text:0x80379E90; // type:function size:0xC8 +calc__14dSndBgmSound_cFv = .text:0x80379F60; // type:function size:0xC8 +postCalc__14dSndBgmSound_cFv = .text:0x8037A030; // type:function size:0x4 +calcPlaySamplePosition__14dSndBgmSound_cFv = .text:0x8037A040; // type:function size:0x5C +isBgmBattle__14dSndBgmSound_cCFv = .text:0x8037A0A0; // type:function size:0x20 fn_8037A0C0 = .text:0x8037A0C0; // type:function size:0xC fn_8037A0D0 = .text:0x8037A0D0; // type:function size:0x20 -fn_8037A0F0 = .text:0x8037A0F0; // type:function size:0x2D4 -fn_8037A3D0 = .text:0x8037A3D0; // type:function size:0x1D0 -fn_8037A5A0 = .text:0x8037A5A0; // type:function size:0x68 -fn_8037A610 = .text:0x8037A610; // type:function size:0x250 -fn_8037A860 = .text:0x8037A860; // type:function size:0x58 -fn_8037A8C0 = .text:0x8037A8C0; // type:function size:0x7C -fn_8037A940 = .text:0x8037A940; // type:function size:0x104 -fn_8037AA50 = .text:0x8037AA50; // type:function size:0xE8 -fn_8037AB40 = .text:0x8037AB40; // type:function size:0x4C -fn_8037AB90 = .text:0x8037AB90; // type:function size:0x148 -fn_8037ACE0 = .text:0x8037ACE0; // type:function size:0xC0 -fn_8037ADA0 = .text:0x8037ADA0; // type:function size:0xC0 -fn_8037AE60 = .text:0x8037AE60; // type:function size:0x70 -fn_8037AED0 = .text:0x8037AED0; // type:function size:0x144 -fn_8037B020 = .text:0x8037B020; // type:function size:0x64 -fn_8037B090 = .text:0x8037B090; // type:function size:0x28 -fn_8037B0C0 = .text:0x8037B0C0; // type:function size:0x38 -fn_8037B100 = .text:0x8037B100; // type:function size:0x64 -fn_8037B170 = .text:0x8037B170; // type:function size:0x1C8 +startBgmSound__14dSndBgmSound_cFUllUl = .text:0x8037A0F0; // type:function size:0x2D4 +fadeIn__14dSndBgmSound_cFUll = .text:0x8037A3D0; // type:function size:0x1D0 +loadSeqConfig__14dSndBgmSound_cFUl = .text:0x8037A5A0; // type:function size:0x68 +prepareSound__14dSndBgmSound_cFUlUl = .text:0x8037A610; // type:function size:0x250 +prepareSound__14dSndBgmSound_cFPCcUl = .text:0x8037A860; // type:function size:0x58 +onPreparing__14dSndBgmSound_cFUlUl = .text:0x8037A8C0; // type:function size:0x7C +stop__14dSndBgmSound_cFl = .text:0x8037A940; // type:function size:0x104 +pause__14dSndBgmSound_cFbl = .text:0x8037AA50; // type:function size:0xE8 +pause__14dSndBgmSound_cFl = .text:0x8037AB40; // type:function size:0x4C +getPlaySamplePosition__14dSndBgmSound_cFv = .text:0x8037AB90; // type:function size:0x148 +getStrmPlaySamplePosition__14dSndBgmSound_cFv = .text:0x8037ACE0; // type:function size:0xC0 +getWavePlaySamplePosition__14dSndBgmSound_cFv = .text:0x8037ADA0; // type:function size:0xC0 +getSeqSoundPlaySamplePosition__14dSndBgmSound_cFv = .text:0x8037AE60; // type:function size:0x70 +calcSeqPlaySamplePosition__14dSndBgmSound_cFv = .text:0x8037AED0; // type:function size:0x144 +applyVars__14dSndBgmSound_cFv = .text:0x8037B020; // type:function size:0x64 +onBecomeActive__14dSndBgmSound_cFv = .text:0x8037B090; // type:function size:0x28 +getCurrentHarpVarSet__14dSndBgmSound_cFv = .text:0x8037B0C0; // type:function size:0x38 +getHarpData__14dSndBgmSound_cFUl = .text:0x8037B100; // type:function size:0x64 +loadNewHarpData__14dSndBgmSound_cFUl = .text:0x8037B170; // type:function size:0x1C8 fn_8037B340 = .text:0x8037B340; // type:function size:0x4C fn_8037B390 = .text:0x8037B390; // type:function size:0x4C fn_8037B3E0 = .text:0x8037B3E0; // type:function size:0x4C @@ -20750,152 +20750,152 @@ fn_8037B450 = .text:0x8037B450; // type:function size:0x18 fn_8037B470 = .text:0x8037B470; // type:function size:0x18 fn_8037B490 = .text:0x8037B490; // type:function size:0x18 fn_8037B4B0 = .text:0x8037B4B0; // type:function size:0x18 -fn_8037B4D0 = .text:0x8037B4D0; // type:function size:0x8 -fn_8037B4E0 = .text:0x8037B4E0; // type:function size:0x58 -fn_8037B540 = .text:0x8037B540; // type:function size:0x44 -fn_8037B590 = .text:0x8037B590; // type:function size:0x7C -fn_8037B610 = .text:0x8037B610; // type:function size:0xAC -fn_8037B6C0 = .text:0x8037B6C0; // type:function size:0x18 -fn_8037B6E0 = .text:0x8037B6E0; // type:function size:0x18 -fn_8037B700 = .text:0x8037B700; // type:function size:0xB0 -fn_8037B7B0 = .text:0x8037B7B0; // type:function size:0x134 -fn_8037B8F0 = .text:0x8037B8F0; // type:function size:0x10 -fn_8037B900 = .text:0x8037B900; // type:function size:0x8 -fn_8037B910 = .text:0x8037B910; // type:function size:0x54 -fn_8037B970 = .text:0x8037B970; // type:function size:0x8 -fn_8037B980 = .text:0x8037B980; // type:function size:0xC -fn_8037B990 = .text:0x8037B990; // type:function size:0x48 -fn_8037B9E0 = .text:0x8037B9E0; // type:function size:0x74 -fn_8037BA60 = .text:0x8037BA60; // type:function size:0x8 -SomeSoundMgr__dtor = .text:0x8037BA70; // type:function size:0x78 -initSomeUnusedSoundMgr = .text:0x8037BAF0; // type:function size:0x48 -SomeSoundMgr__deref = .text:0x8037BB40; // type:function size:0x10 -SomeSoundMgr__ctor = .text:0x8037BB50; // type:function size:0x6C -getDATA_ = .text:0x8037BBC0; // type:function size:0x8 -fn_8037BBD0 = .text:0x8037BBD0; // type:function size:0x24 -fn_8037BC00 = .text:0x8037BC00; // type:function size:0x4 -fn_8037BC10 = .text:0x8037BC10; // type:function size:0xC0 -fn_8037BCD0 = .text:0x8037BCD0; // type:function size:0x54 +isBattleBgmSound__14dSndBgmSound_cCFv = .text:0x8037B4D0; // type:function size:0x8 +__ct__20dSndBgmBattleSound_cFv = .text:0x8037B4E0; // type:function size:0x58 +cancel__20dSndBgmBattleSound_cFv = .text:0x8037B540; // type:function size:0x44 +loadSeqConfig__20dSndBgmBattleSound_cFUl = .text:0x8037B590; // type:function size:0x7C +fadeIn__20dSndBgmBattleSound_cFUll = .text:0x8037B610; // type:function size:0xAC +setTrackGroupMuted__20dSndBgmBattleSound_cFUl = .text:0x8037B6C0; // type:function size:0x18 +setTrackGroupUnmuted__20dSndBgmBattleSound_cFUl = .text:0x8037B6E0; // type:function size:0x18 +startMainBattleLoop__20dSndBgmBattleSound_cFv = .text:0x8037B700; // type:function size:0xB0 +calcSeqPlaySamplePosition__20dSndBgmBattleSound_cFv = .text:0x8037B7B0; // type:function size:0x134 +postCalc__20dSndBgmBattleSound_cFv = .text:0x8037B8F0; // type:function size:0x10 scope:weak +isBattleBgmSound__20dSndBgmBattleSound_cCFv = .text:0x8037B900; // type:function size:0x8 scope:weak +__ct__21dSndBgmSoundHarpMgr_cFv = .text:0x8037B910; // type:function size:0x54 +setSoundId__21dSndBgmSoundHarpMgr_cFUl = .text:0x8037B970; // type:function size:0x8 +setLoaded__21dSndBgmSoundHarpMgr_cFv = .text:0x8037B980; // type:function size:0xC +reset__21dSndBgmSoundHarpMgr_cFv = .text:0x8037B990; // type:function size:0x48 +setPlaySamplePosition__21dSndBgmSoundHarpMgr_cFl = .text:0x8037B9E0; // type:function size:0x74 +getCurrentVarSet__21dSndBgmSoundHarpMgr_cFv = .text:0x8037BA60; // type:function size:0x8 +__dt__37SndMgrDisposer<19dSndBgmSeqDataMgr_c>Fv = .text:0x8037BA70; // type:function size:0x78 scope:weak +create__37SndMgrDisposer<19dSndBgmSeqDataMgr_c>Fv = .text:0x8037BAF0; // type:function size:0x48 scope:weak +remove__37SndMgrDisposer<19dSndBgmSeqDataMgr_c>Fv = .text:0x8037BB40; // type:function size:0x10 scope:weak +__ct__19dSndBgmSeqDataMgr_cFv = .text:0x8037BB50; // type:function size:0x6C +getDataPrefix__19dSndBgmSeqDataMgr_cFv = .text:0x8037BBC0; // type:function size:0x8 +getDataPrefixLength__19dSndBgmSeqDataMgr_cFv = .text:0x8037BBD0; // type:function size:0x24 +setup__19dSndBgmSeqDataMgr_cFv = .text:0x8037BC00; // type:function size:0x4 +setupState0__19dSndBgmSeqDataMgr_cFv = .text:0x8037BC10; // type:function size:0xC0 +getHarpMgrForSoundId__19dSndBgmSeqDataMgr_cFUl = .text:0x8037BCD0; // type:function size:0x54 fn_8037BD30 = .text:0x8037BD30; // type:function size:0x4C fn_8037BD80 = .text:0x8037BD80; // type:function size:0x4 -fn_8037BD90 = .text:0x8037BD90; // type:function size:0x4C -fn_8037BDE0 = .text:0x8037BDE0; // type:function size:0x5C -fn_8037BE40 = .text:0x8037BE40; // type:function size:0x68 -fn_8037BEB0 = .text:0x8037BEB0; // type:function size:0x7C -fn_8037BF30 = .text:0x8037BF30; // type:function size:0x10 -fn_8037BF40 = .text:0x8037BF40; // type:function size:0x64 -fn_8037BFB0 = .text:0x8037BFB0; // type:function size:0x48 -fn_8037C000 = .text:0x8037C000; // type:function size:0x30 -fn_8037C030 = .text:0x8037C030; // type:function size:0x14 -fn_8037C050 = .text:0x8037C050; // type:function size:0x70 -fn_8037C0C0 = .text:0x8037C0C0; // type:function size:0x64 -fn_8037C130 = .text:0x8037C130; // type:function size:0x124 -fn_8037C260 = .text:0x8037C260; // type:function size:0x14 -fn_8037C280 = .text:0x8037C280; // type:function size:0x34 -fn_8037C2C0 = .text:0x8037C2C0; // type:function size:0x34 -fn_8037C300 = .text:0x8037C300; // type:function size:0x68 -fn_8037C370 = .text:0x8037C370; // type:function size:0x34 -fn_8037C3B0 = .text:0x8037C3B0; // type:function size:0x58 -fn_8037C410 = .text:0x8037C410; // type:function size:0x60 -fn_8037C470 = .text:0x8037C470; // type:function size:0xA8 -fn_8037C520 = .text:0x8037C520; // type:function size:0x20 -fn_8037C540 = .text:0x8037C540; // type:function size:0x34 -fn_8037C580 = .text:0x8037C580; // type:function size:0x98 -fn_8037C620 = .text:0x8037C620; // type:function size:0x1E0 -fn_8037C800 = .text:0x8037C800; // type:function size:0x4F0 -fn_8037CCF0 = .text:0x8037CCF0; // type:function size:0x18C -fn_8037CE80 = .text:0x8037CE80; // type:function size:0x24 -fn_8037CEB0 = .text:0x8037CEB0; // type:function size:0x38 -fn_8037CEF0 = .text:0x8037CEF0; // type:function size:0x30 -fn_8037CF20 = .text:0x8037CF20; // type:function size:0xD8 -fn_8037D000 = .text:0x8037D000; // type:function size:0x4 -fn_8037D010 = .text:0x8037D010; // type:function size:0x4 -fn_8037D020 = .text:0x8037D020; // type:function size:0x64 -fn_8037D090 = .text:0x8037D090; // type:function size:0xE8 -fn_8037D180 = .text:0x8037D180; // type:function size:0x84 -fn_8037D210 = .text:0x8037D210; // type:function size:0x38 -fn_8037D250 = .text:0x8037D250; // type:function size:0x20 -fn_8037D270 = .text:0x8037D270; // type:function size:0x58 -fn_8037D2D0 = .text:0x8037D2D0; // type:function size:0x68 -fn_8037D340 = .text:0x8037D340; // type:function size:0x4 -fn_8037D350 = .text:0x8037D350; // type:function size:0x50 -fn_8037D3A0 = .text:0x8037D3A0; // type:function size:0x5C -fn_8037D400 = .text:0x8037D400; // type:function size:0xB0 -fn_8037D4B0 = .text:0x8037D4B0; // type:function size:0x34 -fn_8037D4F0 = .text:0x8037D4F0; // type:function size:0x64 -fn_8037D560 = .text:0x8037D560; // type:function size:0xE0 -fn_8037D640 = .text:0x8037D640; // type:function size:0x6C -fn_8037D6B0 = .text:0x8037D6B0; // type:function size:0x5C -fn_8037D710 = .text:0x8037D710; // type:function size:0x94 -fn_8037D7B0 = .text:0x8037D7B0; // type:function size:0x50 -__dt__38SndMgrDisposer<20dSndSmallEffectMgr_c>Fv = .text:0x8037D800; // type:function size:0x78 -create__38SndMgrDisposer<20dSndSmallEffectMgr_c>Fv = .text:0x8037D880; // type:function size:0x48 -remove__38SndMgrDisposer<20dSndSmallEffectMgr_c>Fv = .text:0x8037D8D0; // type:function size:0x10 +getConfig__19dSndBgmBattleConfigFUl = .text:0x8037BD90; // type:function size:0x4C +hasConfig__19dSndBgmBattleConfigFUl = .text:0x8037BDE0; // type:function size:0x5C +getConfig__16dSndBgmSeqConfigFUll = .text:0x8037BE40; // type:function size:0x68 +__ct__27dSndBgmDataHarpVarSetBase_cFl = .text:0x8037BEB0; // type:function size:0x7C +__ct__20dSndBgmDataHarpVar_cFv = .text:0x8037BF30; // type:function size:0x10 scope:weak +__dt__27dSndBgmDataHarpVarSetBase_cFv = .text:0x8037BF40; // type:function size:0x64 +resetVars__27dSndBgmDataHarpVarSetBase_cFv = .text:0x8037BFB0; // type:function size:0x48 +addVar__27dSndBgmDataHarpVarSetBase_cFUc = .text:0x8037C000; // type:function size:0x30 +__ct__21dSndBgmHarpDataBase_cFv = .text:0x8037C030; // type:function size:0x14 +resetVars__21dSndBgmHarpDataBase_cFv = .text:0x8037C050; // type:function size:0x70 +getIdxForPosition__21dSndBgmHarpDataBase_cFl = .text:0x8037C0C0; // type:function size:0x64 +addVar__21dSndBgmHarpDataBase_cFlll = .text:0x8037C130; // type:function size:0x124 +setField_0x08__21dSndBgmHarpDataBase_cFl = .text:0x8037C260; // type:function size:0x14 +getUsableVarSet__21dSndBgmHarpDataBase_cFl = .text:0x8037C280; // type:function size:0x34 +getVarSet__21dSndBgmHarpDataBase_cFl = .text:0x8037C2C0; // type:function size:0x34 +__ct__17dSndBgmHarpData_cFv = .text:0x8037C300; // type:function size:0x68 +__ct__23dSndBgmDataHarpVarSet_cFv = .text:0x8037C370; // type:function size:0x34 scope:weak +__dt__23dSndBgmDataHarpVarSet_cFv = .text:0x8037C3B0; // type:function size:0x58 scope:weak +__dt__17dSndBgmHarpData_cFv = .text:0x8037C410; // type:function size:0x60 +writeSeqVars__17dSndBgmHarpData_cFl = .text:0x8037C470; // type:function size:0xA8 +__ct__18dSndBgmMmlParser_cFPQ34nw4r3snd18SoundArchivePlayerPQ34nw4r3snd12SoundArchive = .text:0x8037C520; // type:function size:0x20 +initTrack__18dSndBgmMmlParser_cFlUl = .text:0x8037C540; // type:function size:0x34 +loadAndParse__18dSndBgmMmlParser_cFUlUlb = .text:0x8037C580; // type:function size:0x98 +readTracks__18dSndBgmMmlParser_cFUlUlb = .text:0x8037C620; // type:function size:0x1E0 +Parse__18dSndBgmMmlParser_cCFP12dBgmMmlTrack = .text:0x8037C800; // type:function size:0x4F0 +CommandProc___18dSndBgmMmlParser_cCFP12dBgmMmlTrackUlll = .text:0x8037CCF0; // type:function size:0x18C +Read16__18dSndBgmMmlParser_cCFPPCUc = .text:0x8037CE80; // type:function size:0x24 +Read24__18dSndBgmMmlParser_cCFPPCUc = .text:0x8037CEB0; // type:function size:0x38 +ReadVar__18dSndBgmMmlParser_cCFPPCUc = .text:0x8037CEF0; // type:function size:0x30 +ReadArg__18dSndBgmMmlParser_cCFPPCUcQ218dSndBgmMmlParser_c10SeqArgType = .text:0x8037CF20; // type:function size:0xD8 +CommandProc__18dSndBgmMmlParser_cCFUliUlll = .text:0x8037D000; // type:function size:0x4 +NoteOnCommandProc__18dSndBgmMmlParser_cCFUliiil = .text:0x8037D010; // type:function size:0x4 +__ct__22dSndBgmMmlParserHarp_cFP21dSndBgmSoundHarpMgr_c = .text:0x8037D020; // type:function size:0x64 +parseData__22dSndBgmMmlParserHarp_cFPCcUlUl = .text:0x8037D090; // type:function size:0xE8 +parseData__22dSndBgmMmlParserHarp_cFUlUl = .text:0x8037D180; // type:function size:0x84 +CommandProc__22dSndBgmMmlParserHarp_cCFUliUlll = .text:0x8037D210; // type:function size:0x38 +NoteOnCommandProc__22dSndBgmMmlParserHarp_cCFUliiil = .text:0x8037D250; // type:function size:0x20 +__ct__26dSndBgmMmlParserHarpSong_cFv = .text:0x8037D270; // type:function size:0x58 +parseData__26dSndBgmMmlParserHarpSong_cFUlP18dSndHarpSongData_c = .text:0x8037D2D0; // type:function size:0x68 +CommandProc__26dSndBgmMmlParserHarpSong_cCFUliUlll = .text:0x8037D340; // type:function size:0x4 +NoteOnCommandProc__26dSndBgmMmlParserHarpSong_cCFUliiil = .text:0x8037D350; // type:function size:0x50 +__ct__27dSndBgmMmlParserTagBattle_cFv = .text:0x8037D3A0; // type:function size:0x5C +parseData__27dSndBgmMmlParserTagBattle_cFUlPP11dSndTagData = .text:0x8037D400; // type:function size:0xB0 +NoteOnCommandProc__27dSndBgmMmlParserTagBattle_cCFUliiil = .text:0x8037D4B0; // type:function size:0x34 +__ct__28dSndBgmMmlParserTagBgmBoss_cFv = .text:0x8037D4F0; // type:function size:0x64 +parseData__28dSndBgmMmlParserTagBgmBoss_cFPP11dSndTagDataPP11dSndTagData = .text:0x8037D560; // type:function size:0xE0 +NoteOnCommandProc__28dSndBgmMmlParserTagBgmBoss_cCFUliiil = .text:0x8037D640; // type:function size:0x6C +__ct__29dSndBgmMmlParserTagCompNote_cFv = .text:0x8037D6B0; // type:function size:0x5C +parseData__29dSndBgmMmlParserTagCompNote_cFPP11dSndTagData = .text:0x8037D710; // type:function size:0x94 +NoteOnCommandProc__29dSndBgmMmlParserTagCompNote_cCFUliiil = .text:0x8037D7B0; // type:function size:0x50 +__dt__38SndMgrDisposer<20dSndSmallEffectMgr_c>Fv = .text:0x8037D800; // type:function size:0x78 scope:weak +create__38SndMgrDisposer<20dSndSmallEffectMgr_c>Fv = .text:0x8037D880; // type:function size:0x48 scope:weak +remove__38SndMgrDisposer<20dSndSmallEffectMgr_c>Fv = .text:0x8037D8D0; // type:function size:0x10 scope:weak __ct__20dSndSmallEffectMgr_cFv = .text:0x8037D8E0; // type:function size:0x9C -__ct__Q34nw4r3snd11SoundHandleFv = .text:0x8037D980; // type:function size:0xC -fn_8037D990 = .text:0x8037D990; // type:function size:0x4 -fn_8037D9A0 = .text:0x8037D9A0; // type:function size:0xA0 -fn_8037DA40 = .text:0x8037DA40; // type:function size:0x18 -fn_8037DA60 = .text:0x8037DA60; // type:function size:0x70 -fn_8037DAD0 = .text:0x8037DAD0; // type:function size:0xDC -fn_8037DBB0 = .text:0x8037DBB0; // type:function size:0x98 -fn_8037DC50 = .text:0x8037DC50; // type:function size:0x70 -fn_8037DCC0 = .text:0x8037DCC0; // type:function size:0x48 -fn_8037DD10 = .text:0x8037DD10; // type:function size:0x1BC +__ct__Q34nw4r3snd11SoundHandleFv = .text:0x8037D980; // type:function size:0xC scope:weak +initialize__20dSndSmallEffectMgr_cFv = .text:0x8037D990; // type:function size:0x4 +calc__20dSndSmallEffectMgr_cFv = .text:0x8037D9A0; // type:function size:0xA0 +calcTimer__20dSndSmallEffectMgr_cFv = .text:0x8037DA40; // type:function size:0x18 +stopAllSound__20dSndSmallEffectMgr_cFl = .text:0x8037DA60; // type:function size:0x70 +stopAllSoundDemoRelated__20dSndSmallEffectMgr_cFl = .text:0x8037DAD0; // type:function size:0xDC +stopAllSoundExceptEvent__20dSndSmallEffectMgr_cFl = .text:0x8037DBB0; // type:function size:0x98 +stopAllSoundExceptEffectOrLink__20dSndSmallEffectMgr_cFl = .text:0x8037DC50; // type:function size:0x70 +playSoundInternalChecked__20dSndSmallEffectMgr_cFUlPQ34nw4r3snd11SoundHandle = .text:0x8037DCC0; // type:function size:0x48 +playSoundInternal__20dSndSmallEffectMgr_cFUlPQ34nw4r3snd11SoundHandle = .text:0x8037DD10; // type:function size:0x1BC playSound__20dSndSmallEffectMgr_cFUl = .text:0x8037DED0; // type:function size:0x2D0 playSoundWithPan__20dSndSmallEffectMgr_cFUlf = .text:0x8037E1A0; // type:function size:0x90 -fn_8037E230 = .text:0x8037E230; // type:function size:0xEC +doSideEffects__20dSndSmallEffectMgr_cFUl = .text:0x8037E230; // type:function size:0xEC playSoundInternal__20dSndSmallEffectMgr_cFUl = .text:0x8037E320; // type:function size:0x78 -fn_8037E3A0 = .text:0x8037E3A0; // type:function size:0x158 -fn_8037E500 = .text:0x8037E500; // type:function size:0x58 -playSoundWithPitch__20dSndSmallEffectMgr_cFUlf = .text:0x8037E560; // type:function size:0xBC -fn_8037E620 = .text:0x8037E620; // type:function size:0xDC -fn_8037E700 = .text:0x8037E700; // type:function size:0x8 -fn_8037E710 = .text:0x8037E710; // type:function size:0x8 -fn_8037E720 = .text:0x8037E720; // type:function size:0xEC -fn_8037E810 = .text:0x8037E810; // type:function size:0x50 -fn_8037E860 = .text:0x8037E860; // type:function size:0x148 -fn_8037E9B0 = .text:0x8037E9B0; // type:function size:0xC -fn_8037E9C0 = .text:0x8037E9C0; // type:function size:0x90 -fn_8037EA50 = .text:0x8037EA50; // type:function size:0x8 -fn_8037EA60 = .text:0x8037EA60; // type:function size:0x14 -fn_8037EA80 = .text:0x8037EA80; // type:function size:0x8 -fn_8037EA90 = .text:0x8037EA90; // type:function size:0x40 -fn_8037EAD0 = .text:0x8037EAD0; // type:function size:0x40 -fn_8037EB10 = .text:0x8037EB10; // type:function size:0x11C -fn_8037EC30 = .text:0x8037EC30; // type:function size:0x8 -fn_8037EC40 = .text:0x8037EC40; // type:function size:0x3C -fn_8037EC80 = .text:0x8037EC80; // type:function size:0xB0 -fn_8037ED30 = .text:0x8037ED30; // type:function size:0x68 +getHoldSoundHandle__20dSndSmallEffectMgr_cFUl = .text:0x8037E3A0; // type:function size:0x158 +holdSound__20dSndSmallEffectMgr_cFUl = .text:0x8037E500; // type:function size:0x58 +holdSoundWithPitch__20dSndSmallEffectMgr_cFUlf = .text:0x8037E560; // type:function size:0xBC +holdSound__20dSndSmallEffectMgr_cFUlPQ34nw4r3snd11SoundHandle = .text:0x8037E620; // type:function size:0xDC +playSoundAtPosition__20dSndSmallEffectMgr_cFUlPCQ34nw4r4math4VEC3 = .text:0x8037E700; // type:function size:0x8 +playSoundAtPosition2__20dSndSmallEffectMgr_cFUlPCQ34nw4r4math4VEC3 = .text:0x8037E710; // type:function size:0x8 +holdBowChargeSound__20dSndSmallEffectMgr_cFf = .text:0x8037E720; // type:function size:0xEC +holdFinisherPromptSound__20dSndSmallEffectMgr_cFPCQ34nw4r4math4VEC3 = .text:0x8037E810; // type:function size:0x50 +playDowsingPingSound__20dSndSmallEffectMgr_cFff = .text:0x8037E860; // type:function size:0x148 +holdDowsingNearestSound__20dSndSmallEffectMgr_cFv = .text:0x8037E9B0; // type:function size:0xC +playSirenCountdownSound__20dSndSmallEffectMgr_cFl = .text:0x8037E9C0; // type:function size:0x90 +playMinigameCountdownSound__20dSndSmallEffectMgr_cFv = .text:0x8037EA50; // type:function size:0x8 +playMinigameTimeUpSound__20dSndSmallEffectMgr_cFl = .text:0x8037EA60; // type:function size:0x14 +playMinigameStartSound__20dSndSmallEffectMgr_cFv = .text:0x8037EA80; // type:function size:0x8 +playMinigameFinishSound__20dSndSmallEffectMgr_cFv = .text:0x8037EA90; // type:function size:0x40 +playMinigameFinishWhistleSound__20dSndSmallEffectMgr_cFv = .text:0x8037EAD0; // type:function size:0x40 +playMinigameScoreUpSound__20dSndSmallEffectMgr_cFl = .text:0x8037EB10; // type:function size:0x11C +playMinigameScoreDownSound__20dSndSmallEffectMgr_cFv = .text:0x8037EC30; // type:function size:0x8 +playMinigameMusasabiSound__20dSndSmallEffectMgr_cFl = .text:0x8037EC40; // type:function size:0x3C +playSkbSound__20dSndSmallEffectMgr_cFUl = .text:0x8037EC80; // type:function size:0xB0 +playDemoSound__20dSndSmallEffectMgr_cFUlPQ34nw4r3snd11SoundHandle = .text:0x8037ED30; // type:function size:0x68 stopSounds__20dSndSmallEffectMgr_cFUlUll = .text:0x8037EDA0; // type:function size:0xA0 -__cl__12SoundStopperFRQ34nw4r3snd11SoundHandle = .text:0x8037EE40; // type:function size:0x3C +__cl__12SoundStopperFRQ34nw4r3snd11SoundHandle = .text:0x8037EE40; // type:function size:0x3C scope:weak stopSounds__20dSndSmallEffectMgr_cFUll = .text:0x8037EE80; // type:function size:0x64 isPlayingSound__20dSndSmallEffectMgr_cFUlUl = .text:0x8037EEF0; // type:function size:0xAC isPlayingSound__20dSndSmallEffectMgr_cFUl = .text:0x8037EFA0; // type:function size:0x80 playButtonPressSoundWhenAdvancingTextBoxes__20dSndSmallEffectMgr_cFf = .text:0x8037F020; // type:function size:0xB4 resetButtonPressSound__20dSndSmallEffectMgr_cFv = .text:0x8037F0E0; // type:function size:0xC setButtonPressSound__20dSndSmallEffectMgr_cFP14dSoundSource_c = .text:0x8037F0F0; // type:function size:0x60 -fn_8037F150 = .text:0x8037F150; // type:function size:0x6D0 -d_s_vt_0x17C__14dSoundSource_cFv = .text:0x8037F820; // type:function size:0x8 -vt_0x18__14dSoundSource_cFv = .text:0x8037F830; // type:function size:0x8 -fn_8037F840 = .text:0x8037F840; // type:function size:0x74 -fn_8037F8C0 = .text:0x8037F8C0; // type:function size:0x78 -fn_8037F940 = .text:0x8037F940; // type:function size:0x48 -fn_8037F990 = .text:0x8037F990; // type:function size:0x10 -fn_8037F9A0 = .text:0x8037F9A0; // type:function size:0x144 -fn_8037FAF0 = .text:0x8037FAF0; // type:function size:0x80 -fn_8037FB70 = .text:0x8037FB70; // type:function size:0x58 -fn_8037FBD0 = .text:0x8037FBD0; // type:function size:0x58 -fn_8037FC30 = .text:0x8037FC30; // type:function size:0x4 -fn_8037FC40 = .text:0x8037FC40; // type:function size:0xA8 +playBattleHitSound__20dSndSmallEffectMgr_cFQ220dSndSmallEffectMgr_c16BattleHitSound_eP14dSoundSource_c = .text:0x8037F150; // type:function size:0x6D0 +getName__14dSoundSource_cCFv = .text:0x8037F820; // type:function size:0x8 scope:weak +getSourceType__14dSoundSource_cCFv = .text:0x8037F830; // type:function size:0x8 scope:weak +setBitsIfAdjacent__20dSndSmallEffectMgr_cFP27dSndBgmDataHarpVarSetBase_cllPUl = .text:0x8037F840; // type:function size:0x74 +__dt__35SndMgrDisposer<17dSndHarpSongMgr_c>Fv = .text:0x8037F8C0; // type:function size:0x78 +create__35SndMgrDisposer<17dSndHarpSongMgr_c>Fv = .text:0x8037F940; // type:function size:0x48 +remove__35SndMgrDisposer<17dSndHarpSongMgr_c>Fv = .text:0x8037F990; // type:function size:0x10 +__ct__17dSndHarpSongMgr_cFv = .text:0x8037F9A0; // type:function size:0x144 +__dt__18dSndHarpSongData_cFv = .text:0x8037FAF0; // type:function size:0x80 +__dt__20dSndHarpSongEntry1_cFv = .text:0x8037FB70; // type:function size:0x58 +__dt__20dSndHarpSongEntry2_cFv = .text:0x8037FBD0; // type:function size:0x58 +setup__17dSndHarpSongMgr_cFv = .text:0x8037FC30; // type:function size:0x4 +setupState0__17dSndHarpSongMgr_cFv = .text:0x8037FC40; // type:function size:0xA8 fn_8037FCF0 = .text:0x8037FCF0; // type:function size:0x6C -putHarpAway = .text:0x8037FD60; // type:function size:0x74 +deactivate__17dSndHarpSongMgr_cFv = .text:0x8037FD60; // type:function size:0x74 fn_8037FDE0 = .text:0x8037FDE0; // type:function size:0x58 -fn_8037FE40 = .text:0x8037FE40; // type:function size:0x220 +calc__17dSndHarpSongMgr_cFv = .text:0x8037FE40; // type:function size:0x220 fn_80380060 = .text:0x80380060; // type:function size:0x130 fn_80380190 = .text:0x80380190; // type:function size:0x44 fn_803801E0 = .text:0x803801E0; // type:function size:0x2F4 -fn_803804E0 = .text:0x803804E0; // type:function size:0x8 +d_s_harp_vt_0x1EC__23dSndSourceHarpRelated_cCFv = .text:0x803804E0; // type:function size:0x8 fn_803804F0 = .text:0x803804F0; // type:function size:0x150 fn_80380640 = .text:0x80380640; // type:function size:0x40C fn_80380A50 = .text:0x80380A50; // type:function size:0x350 @@ -20913,62 +20913,62 @@ fn_803814B0 = .text:0x803814B0; // type:function size:0x8C fn_80381540 = .text:0x80381540; // type:function size:0x1C fn_80381560 = .text:0x80381560; // type:function size:0x14 fn_80381580 = .text:0x80381580; // type:function size:0x78 -fn_80381600 = .text:0x80381600; // type:function size:0xA0 -fn_803816A0 = .text:0x803816A0; // type:function size:0xC0 -fn_80381760 = .text:0x80381760; // type:function size:0x60 -fn_803817C0 = .text:0x803817C0; // type:function size:0x80 +shiftFloat1__17dSndHarpSongMgr_cFf = .text:0x80381600; // type:function size:0xA0 +shiftFloat2__17dSndHarpSongMgr_cFf = .text:0x803816A0; // type:function size:0xC0 +resetFloatArr1__17dSndHarpSongMgr_cFv = .text:0x80381760; // type:function size:0x60 +resetFloatArr2__17dSndHarpSongMgr_cFv = .text:0x803817C0; // type:function size:0x80 fn_80381840 = .text:0x80381840; // type:function size:0x28 -fn_80381870 = .text:0x80381870; // type:function size:0x48 -fn_803818C0 = .text:0x803818C0; // type:function size:0x58 -fn_80381920 = .text:0x80381920; // type:function size:0x30 -fn_80381950 = .text:0x80381950; // type:function size:0x38 -fn_80381990 = .text:0x80381990; // type:function size:0x24 -fn_803819C0 = .text:0x803819C0; // type:function size:0xA4 -fn_80381A70 = .text:0x80381A70; // type:function size:0x84 -fn_80381B00 = .text:0x80381B00; // type:function size:0x20 -fn_80381B20 = .text:0x80381B20; // type:function size:0x80 -fn_80381BA0 = .text:0x80381BA0; // type:function size:0x38 -fn_80381BE0 = .text:0x80381BE0; // type:function size:0xD0 -fn_80381CB0 = .text:0x80381CB0; // type:function size:0x74 -fn_80381D30 = .text:0x80381D30; // type:function size:0x1BC -fn_80381EF0 = .text:0x80381EF0; // type:function size:0x150 +__ct__23dSndHarpSongEntryBase_cFss = .text:0x80381870; // type:function size:0x48 +__dt__23dSndHarpSongEntryBase_cFv = .text:0x803818C0; // type:function size:0x58 +reset__23dSndHarpSongEntryBase_cFv = .text:0x80381920; // type:function size:0x30 +insert__23dSndHarpSongEntryBase_cFUls = .text:0x80381950; // type:function size:0x38 +get__23dSndHarpSongEntryBase_cCFUl = .text:0x80381990; // type:function size:0x24 +__ct__20dSndHarpSongEntry1_cFv = .text:0x803819C0; // type:function size:0xA4 +loadStaticData__20dSndHarpSongEntry1_cFlUll = .text:0x80381A70; // type:function size:0x84 +getStaticDatum__20dSndHarpSongEntry1_cCFUl = .text:0x80381B00; // type:function size:0x20 +__ct__18dSndHarpSongData_cFv = .text:0x80381B20; // type:function size:0x80 +__ct__20dSndHarpSongEntry2_cFv = .text:0x80381BA0; // type:function size:0x38 +init__18dSndHarpSongData_cFUl = .text:0x80381BE0; // type:function size:0xD0 +loadStaticValues__18dSndHarpSongData_cFv = .text:0x80381CB0; // type:function size:0x74 +insert2__18dSndHarpSongData_cFUlsl = .text:0x80381D30; // type:function size:0x1BC +insert1__18dSndHarpSongData_cFUls = .text:0x80381EF0; // type:function size:0x150 fn_80382040 = .text:0x80382040; // type:function size:0x48 fn_80382090 = .text:0x80382090; // type:function size:0x3C fn_803820D0 = .text:0x803820D0; // type:function size:0x40 fn_80382110 = .text:0x80382110; // type:function size:0x40 -fn_80382150 = .text:0x80382150; // type:function size:0x78 -fn_803821D0 = .text:0x803821D0; // type:function size:0x3C -fn_80382210 = .text:0x80382210; // type:function size:0xE8 -fn_80382300 = .text:0x80382300; // type:function size:0x28 -fn_80382330 = .text:0x80382330; // type:function size:0x7C -fn_803823B0 = .text:0x803823B0; // type:function size:0x18 -d_s_vt_0x1E0__14dSoundSource_cFv = .text:0x803823D0; // type:function size:0x8 -fn_803823E0 = .text:0x803823E0; // type:function size:0x14 -fn_80382400 = .text:0x80382400; // type:function size:0xC -fn_80382410 = .text:0x80382410; // type:function size:0xC0 -fn_803824D0 = .text:0x803824D0; // type:function size:0x24 -fn_80382500 = .text:0x80382500; // type:function size:0x90 +__ct__15dSndAnimSound_cFP14dSoundSource_c = .text:0x80382150; // type:function size:0x78 +setData__15dSndAnimSound_cFPCvPCc = .text:0x803821D0; // type:function size:0x3C +setFrame__15dSndAnimSound_cFf = .text:0x80382210; // type:function size:0xE8 +setRate__15dSndAnimSound_cFf = .text:0x80382300; // type:function size:0x28 +resetFrame__15dSndAnimSound_cFf = .text:0x80382330; // type:function size:0x7C +animCallback__15dSndAnimSound_cFilPCciPv = .text:0x803823B0; // type:function size:0x18 +onAnimSoundEvent__14dSoundSource_cFl = .text:0x803823D0; // type:function size:0x8 scope:weak +setCallback__15dSndAnimSound_cFP14dSoundSource_c = .text:0x803823E0; // type:function size:0x14 +setCallback__15dSndAnimSound_cFPFilPCciPv_vPv = .text:0x80382400; // type:function size:0xC +isAnimSoundSource__15dSndSourceMgr_cFlPCc = .text:0x80382410; // type:function size:0xC0 +isMultiSoundSource__15dSndSourceMgr_cFlPCc = .text:0x803824D0; // type:function size:0x24 +isSwOrEOc__15dSndSourceMgr_cFPCc = .text:0x80382500; // type:function size:0x90 getSourceCategoryForSourceType__15dSndSourceMgr_cFlPCc = .text:0x80382590; // type:function size:0xB0 -soundForActorInitRelated_80382640 = .text:0x80382640; // type:function size:0xFD8 -fn_80383620 = .text:0x80383620; // type:function size:0x94 -fn_803836C0 = .text:0x803836C0; // type:function size:0x98 -fn_80383760 = .text:0x80383760; // type:function size:0x58 -fn_803837C0 = .text:0x803837C0; // type:function size:0x9C -fn_80383860 = .text:0x80383860; // type:function size:0x94 -fn_80383900 = .text:0x80383900; // type:function size:0x58 -fn_80383960 = .text:0x80383960; // type:function size:0x9C -d_s_vt_0x180__14dSoundSource_cFv = .text:0x80383A00; // type:function size:0x8 -d_s_vt_0x1DC__14dSoundSource_cFv = .text:0x80383A10; // type:function size:0x8 -d_s_vt_0x1D8__14dSoundSource_cFv = .text:0x80383A20; // type:function size:0x4 +createSource__15dSndSourceMgr_cFlP9dAcBase_cPCcUc = .text:0x80382640; // type:function size:0xFD8 +__dt__25dSndSourceEnemyAnimBase_cFv = .text:0x80383620; // type:function size:0x94 +__dt__26dSndSourceEnemyMultiBase_cFv = .text:0x803836C0; // type:function size:0x98 +__dt__15dSndSourceObj_cFv = .text:0x80383760; // type:function size:0x58 +__dt__23dSndSourceObjAnimBase_cFv = .text:0x803837C0; // type:function size:0x9C +__dt__21dSndSourceAnimSound_cFv = .text:0x80383860; // type:function size:0x94 +__dt__15dSndSourceNpc_cFv = .text:0x80383900; // type:function size:0x58 +__dt__23dSndSourceNpcAnimBase_cFv = .text:0x80383960; // type:function size:0x9C +setOrigName__14dSoundSource_cFPCc = .text:0x80383A00; // type:function size:0x8 +isMultiSource__14dSoundSource_cCFv = .text:0x80383A10; // type:function size:0x8 +registerAdditionalSource__14dSoundSource_cFP14dSoundSource_c = .text:0x80383A20; // type:function size:0x4 __dt__33SndMgrDisposer<15dSndSourceMgr_c>Fv = .text:0x80383A30; // type:function size:0x78 create__33SndMgrDisposer<15dSndSourceMgr_c>Fv = .text:0x80383AB0; // type:function size:0x48 remove__33SndMgrDisposer<15dSndSourceMgr_c>Fv = .text:0x80383B00; // type:function size:0x10 __ct__15dSndSourceMgr_cFv = .text:0x80383B10; // type:function size:0x140 -fn_80383C50 = .text:0x80383C50; // type:function size:0x78 +setup__15dSndSourceMgr_cFv = .text:0x80383C50; // type:function size:0x78 fn_80383CD0 = .text:0x80383CD0; // type:function size:0x4C fn_80383D20 = .text:0x80383D20; // type:function size:0x44 fn_80383D70 = .text:0x80383D70; // type:function size:0x44 -fn_80383DC0 = .text:0x80383DC0; // type:function size:0x84 +calcEnemyObjVolume__15dSndSourceMgr_cFv = .text:0x80383DC0; // type:function size:0x84 EnemyBgmRelatedMgr__actuallyHandleEnemyMusic = .text:0x80383E50; // type:function size:0x354 fn_803841B0 = .text:0x803841B0; // type:function size:0x13C fn_803842F0 = .text:0x803842F0; // type:function size:0x64 @@ -20976,150 +20976,150 @@ fn_80384360 = .text:0x80384360; // type:function size:0x7C fn_803843E0 = .text:0x803843E0; // type:function size:0x34 fn_80384420 = .text:0x80384420; // type:function size:0x94 fn_803844C0 = .text:0x803844C0; // type:function size:0xB0 -fn_80384570 = .text:0x80384570; // type:function size:0xC0 +setMutedFromFader__15dSndSourceMgr_cFb = .text:0x80384570; // type:function size:0xC0 fn_80384630 = .text:0x80384630; // type:function size:0x94 fn_803846D0 = .text:0x803846D0; // type:function size:0xA0 -fn_80384770 = .text:0x80384770; // type:function size:0xAC -fn_80384820 = .text:0x80384820; // type:function size:0x8C +getGroup__15dSndSourceMgr_cFlP9dAcBase_cPCcPCcUc = .text:0x80384770; // type:function size:0xAC +getActiveGroupForName__15dSndSourceMgr_cFPCc = .text:0x80384820; // type:function size:0x8C fn_803848B0 = .text:0x803848B0; // type:function size:0xAC fn_80384960 = .text:0x80384960; // type:function size:0x8C -fn_803849F0 = .text:0x803849F0; // type:function size:0xC -fn_80384A00 = .text:0x80384A00; // type:function size:0x174 +getInactiveGroup__15dSndSourceMgr_cFv = .text:0x803849F0; // type:function size:0xC +addGroupToLoading__15dSndSourceMgr_cFP17dSndSourceGroup_c = .text:0x80384A00; // type:function size:0x174 registerSource__15dSndSourceMgr_cFP14dSoundSource_c = .text:0x80384B80; // type:function size:0x178 getCategory__14dSoundSource_cCFv = .text:0x80384D00; // type:function size:0x8 isCertainEnemyType__15dSndSourceMgr_cFP14dSoundSource_c = .text:0x80384D10; // type:function size:0x78 -fn_80384D90 = .text:0x80384D90; // type:function size:0x98 +registerUnkEnemyType__15dSndSourceMgr_cFP17dSndSourceEnemy_c = .text:0x80384D90; // type:function size:0x98 unregisterSource__15dSndSourceMgr_cFP14dSoundSource_c = .text:0x80384E30; // type:function size:0xBC removeSourceFromList__15dSndSourceMgr_cFP14dSoundSource_cPQ34nw4r2ut4List = .text:0x80384EF0; // type:function size:0xAC -fn_80384FA0 = .text:0x80384FA0; // type:function size:0x14 +onShutdownSource__15dSndSourceMgr_cFP14dSoundSource_c = .text:0x80384FA0; // type:function size:0x14 clearSourceLists__15dSndSourceMgr_cFv = .text:0x80384FC0; // type:function size:0x50 -fn_80385010 = .text:0x80385010; // type:function size:0x60 -fn_80385070 = .text:0x80385070; // type:function size:0x18 +activateGroup__15dSndSourceMgr_cFP17dSndSourceGroup_c = .text:0x80385010; // type:function size:0x60 +isActiveGroup__15dSndSourceMgr_cCFP17dSndSourceGroup_c = .text:0x80385070; // type:function size:0x18 fn_80385090 = .text:0x80385090; // type:function size:0x18 fn_803850B0 = .text:0x803850B0; // type:function size:0x108 fn_803851C0 = .text:0x803851C0; // type:function size:0x74 clearSourceList__15dSndSourceMgr_cFPQ34nw4r2ut4List = .text:0x80385240; // type:function size:0x64 fn_803852B0 = .text:0x803852B0; // type:function size:0x3C fn_803852F0 = .text:0x803852F0; // type:function size:0x3C -fn_80385330 = .text:0x80385330; // type:function size:0x94 +pauseAllSound__15dSndSourceMgr_cFv = .text:0x80385330; // type:function size:0x94 fn_803853D0 = .text:0x803853D0; // type:function size:0xA0 -fn_80385470 = .text:0x80385470; // type:function size:0x78 -fn_803854F0 = .text:0x803854F0; // type:function size:0x94 +stopAllSound__15dSndSourceMgr_cFv = .text:0x80385470; // type:function size:0x78 +stopAllNonPlayerSound__15dSndSourceMgr_cFv = .text:0x803854F0; // type:function size:0x94 fn_80385590 = .text:0x80385590; // type:function size:0x74 -fn_80385610 = .text:0x80385610; // type:function size:0x4 -fn_80385620 = .text:0x80385620; // type:function size:0x4 +onEventStart__15dSndSourceMgr_cFv = .text:0x80385610; // type:function size:0x4 +onEventEnd__15dSndSourceMgr_cFv = .text:0x80385620; // type:function size:0x4 fn_80385630 = .text:0x80385630; // type:function size:0x8 fn_80385640 = .text:0x80385640; // type:function size:0x134 -fn_80385780 = .text:0x80385780; // type:function size:0x34 +getPlayerSourceRoomId__15dSndSourceMgr_cCFv = .text:0x80385780; // type:function size:0x34 fn_803857C0 = .text:0x803857C0; // type:function size:0x5C fn_80385820 = .text:0x80385820; // type:function size:0x8 fn_80385830 = .text:0x80385830; // type:function size:0x44 fn_80385880 = .text:0x80385880; // type:function size:0x50 playFlowSound__15dSndSourceMgr_cFUl = .text:0x803858D0; // type:function size:0xA0 fn_80385970 = .text:0x80385970; // type:function size:0x90 -vt_0x118__14dSoundSource_cFv = .text:0x80385A00; // type:function size:0x8 -vt_0x114__14dSoundSource_cFv = .text:0x80385A10; // type:function size:0x4 -d_s_vt_0x1D4__14dSoundSource_cFv = .text:0x80385A20; // type:function size:0x8 +checkBattleBgmRelated__14dSoundSource_cFv = .text:0x80385A00; // type:function size:0x8 +setBattleBgmRelated__14dSoundSource_cFi = .text:0x80385A10; // type:function size:0x4 +getAnimSound__14dSoundSource_cFv = .text:0x80385A20; // type:function size:0x8 setRate__14dSoundSource_cFf = .text:0x80385A30; // type:function size:0x4 setFrame__14dSoundSource_cFf = .text:0x80385A40; // type:function size:0x4 load__14dSoundSource_cFPvPCc = .text:0x80385A50; // type:function size:0x4 -isReadyMaybe__14dSoundSource_cFv = .text:0x80385A60; // type:function size:0x8 -vt_0xF0__14dSoundSource_cFv = .text:0x80385A70; // type:function size:0x4 -d_s_vt_0x1CC__14dSoundSource_cFv = .text:0x80385A80; // type:function size:0x4 -d_s_vt_0x1C0__14dSoundSource_cFv = .text:0x80385A90; // type:function size:0x34 -vt_0xE8__14dSoundSource_cFv = .text:0x80385AD0; // type:function size:0x8 -vt_0xEC__14dSoundSource_cFv = .text:0x80385AE0; // type:function size:0x8 -vt_0xE0__14dSoundSource_cFv = .text:0x80385AF0; // type:function size:0x4 -vt_0xE4__14dSoundSource_cFv = .text:0x80385B00; // type:function size:0x4 -vt_0xDC__14dSoundSource_cFv = .text:0x80385B10; // type:function size:0x8 -vt_0xD4__14dSoundSource_cFv = .text:0x80385B20; // type:function size:0x8 -vt_0x54__14dSoundSource_cFv = .text:0x80385B30; // type:function size:0x8 -vt_0x40__14dSoundSource_cFv = .text:0x80385B40; // type:function size:0x8 -vt_0x34__14dSoundSource_cFv = .text:0x80385B50; // type:function size:0x10 -vt_0x30__14dSoundSource_cFv = .text:0x80385B60; // type:function size:0x10 -vt_0xF8__14dSoundSource_cFv = .text:0x80385B70; // type:function size:0x8 -d_s_vt_0x188__14dSoundSource_cFv = .text:0x80385B80; // type:function size:0x4 -vt_0x20__14dSoundSource_cFv = .text:0x80385B90; // type:function size:0x4 -vt_0x24__14dSoundSource_cFv = .text:0x80385BA0; // type:function size:0x8 -vt_0x1C__14dSoundSource_cFv = .text:0x80385BB0; // type:function size:0x14 -vt_0x14__14dSoundSource_cFv = .text:0x80385BD0; // type:function size:0x14 -fn_80385BF0 = .text:0x80385BF0; // type:function size:0xC -fn_80385C00 = .text:0x80385C00; // type:function size:0xC -fn_80385C10 = .text:0x80385C10; // type:function size:0xC -fn_80385C20 = .text:0x80385C20; // type:function size:0x8 -fn_80385C30 = .text:0x80385C30; // type:function size:0x8 -fn_80385C40 = .text:0x80385C40; // type:function size:0x90 -fn_80385CD0 = .text:0x80385CD0; // type:function size:0x8 -fn_80385CE0 = .text:0x80385CE0; // type:function size:0xDC -fn_80385DC0 = .text:0x80385DC0; // type:function size:0x8 -fn_80385DD0 = .text:0x80385DD0; // type:function size:0x8 -fn_80385DE0 = .text:0x80385DE0; // type:function size:0x5C -fn_80385E40 = .text:0x80385E40; // type:function size:0x8 -fn_80385E50 = .text:0x80385E50; // type:function size:0x8 -fn_80385E60 = .text:0x80385E60; // type:function size:0x4 -fn_80385E70 = .text:0x80385E70; // type:function size:0x8 -fn_80385E80 = .text:0x80385E80; // type:function size:0x8 -fn_80385E90 = .text:0x80385E90; // type:function size:0x5C -fn_80385EF0 = .text:0x80385EF0; // type:function size:0x8 -fn_80385F00 = .text:0x80385F00; // type:function size:0x8 -fn_80385F10 = .text:0x80385F10; // type:function size:0x4 -fn_80385F20 = .text:0x80385F20; // type:function size:0x8 -fn_80385F30 = .text:0x80385F30; // type:function size:0x8 -fn_80385F40 = .text:0x80385F40; // type:function size:0x5C -fn_80385FA0 = .text:0x80385FA0; // type:function size:0x8 -fn_80385FB0 = .text:0x80385FB0; // type:function size:0x8 -fn_80385FC0 = .text:0x80385FC0; // type:function size:0x4 -fn_80385FD0 = .text:0x80385FD0; // type:function size:0x8 -fn_80385FE0 = .text:0x80385FE0; // type:function size:0x8 -fn_80385FF0 = .text:0x80385FF0; // type:function size:0x5C -fn_80386050 = .text:0x80386050; // type:function size:0x8 -fn_80386060 = .text:0x80386060; // type:function size:0x8 -fn_80386070 = .text:0x80386070; // type:function size:0x4 -fn_80386080 = .text:0x80386080; // type:function size:0x58 -fn_803860E0 = .text:0x803860E0; // type:function size:0xA0 -fn_80386180 = .text:0x80386180; // type:function size:0x5C -fn_803861E0 = .text:0x803861E0; // type:function size:0xA0 -fn_80386280 = .text:0x80386280; // type:function size:0x58 -fn_803862E0 = .text:0x803862E0; // type:function size:0x4 -fn_803862F0 = .text:0x803862F0; // type:function size:0x8 -fn_80386300 = .text:0x80386300; // type:function size:0x8 -fn_80386310 = .text:0x80386310; // type:function size:0x8 -fn_80386320 = .text:0x80386320; // type:function size:0x8 -fn_80386330 = .text:0x80386330; // type:function size:0x8 -fn_80386340 = .text:0x80386340; // type:function size:0x8 -fn_80386350 = .text:0x80386350; // type:function size:0x8 -fn_80386360 = .text:0x80386360; // type:function size:0x8 -fn_80386370 = .text:0x80386370; // type:function size:0x8 -fn_80386380 = .text:0x80386380; // type:function size:0x8 -fn_80386390 = .text:0x80386390; // type:function size:0x8 -fn_803863A0 = .text:0x803863A0; // type:function size:0x8 -fn_803863B0 = .text:0x803863B0; // type:function size:0x8 -fn_803863C0 = .text:0x803863C0; // type:function size:0x8 -fn_803863D0 = .text:0x803863D0; // type:function size:0x8 -fn_803863E0 = .text:0x803863E0; // type:function size:0x8 -fn_803863F0 = .text:0x803863F0; // type:function size:0x8 -fn_80386400 = .text:0x80386400; // type:function size:0x8 -fn_80386410 = .text:0x80386410; // type:function size:0x8 -fn_80386420 = .text:0x80386420; // type:function size:0x8 -fn_80386430 = .text:0x80386430; // type:function size:0x8 -fn_80386440 = .text:0x80386440; // type:function size:0x8 -@4@d_vt_0x38__14dSoundSource_cFbi = .text:0x80386450; // type:function size:0x8 -fn_80386460 = .text:0x80386460; // type:function size:0x8 -fn_80386470 = .text:0x80386470; // type:function size:0x8 +hasAnimSound__14dSoundSource_cFv = .text:0x80385A60; // type:function size:0x8 +vt_0x0F0_noop__14dSoundSource_cFv = .text:0x80385A70; // type:function size:0x4 +postSetupSound__14dSoundSource_cFUlUlP13dSndSeSound_c = .text:0x80385A80; // type:function size:0x4 +hasDistantSounds__14dSoundSource_cCFv = .text:0x80385A90; // type:function size:0x34 +isPlayingActionSound__14dSoundSource_cCFv = .text:0x80385AD0; // type:function size:0x8 +isCurrentActionSound__14dSoundSource_cCFUl = .text:0x80385AE0; // type:function size:0x8 +stopCurrentActionSound__14dSoundSource_cFv = .text:0x80385AF0; // type:function size:0x4 +stopActionSound__14dSoundSource_cFUl = .text:0x80385B00; // type:function size:0x4 +vt_0xDC__14dSoundSource_cFUl = .text:0x80385B10; // type:function size:0x8 +startVoiceLine__14dSoundSource_cFUl = .text:0x80385B20; // type:function size:0x8 +setCtxParam__14dSoundSource_cFPC17dSndSoundCtxParam = .text:0x80385B30; // type:function size:0x8 +stopAllSound__14dSoundSource_cFl = .text:0x80385B40; // type:function size:0x8 +offFlag__14dSoundSource_cFUl = .text:0x80385B50; // type:function size:0x10 +onFlag__14dSoundSource_cFUl = .text:0x80385B60; // type:function size:0x10 +setField0x102__14dSoundSource_cFUc = .text:0x80385B70; // type:function size:0x8 +postSetup__14dSoundSource_cFv = .text:0x80385B80; // type:function size:0x4 +vt_0x020__14dSoundSource_cFv = .text:0x80385B90; // type:function size:0x4 +setSubtype__14dSoundSource_cFUc = .text:0x80385BA0; // type:function size:0x8 +isSourceType__14dSoundSource_cCFl = .text:0x80385BB0; // type:function size:0x14 +isCategory__14dSoundSource_cCFl = .text:0x80385BD0; // type:function size:0x14 +d_s_vt_0x1E8__15dSndSourceNpc_cFUl = .text:0x80385BF0; // type:function size:0xC +d_s_vt_0x1E8__15dSndSourceObj_cFUl = .text:0x80385C00; // type:function size:0xC +d_s_vt_0x1E8__17dSndSourceEnemy_cFUl = .text:0x80385C10; // type:function size:0xC +setBattleBgmRelated__17dSndSourceEnemy_cFi = .text:0x80385C20; // type:function size:0x8 +hasAnimSound__18dSndSourceESpark_cFv = .text:0x80385C30; // type:function size:0x8 +registerAdditionalSource__26dSndSourceEnemyMultiBase_cFP14dSoundSource_c = .text:0x80385C40; // type:function size:0x90 +isMultiSource__26dSndSourceEnemyMultiBase_cCFv = .text:0x80385CD0; // type:function size:0x8 +SetupSound__26dSndSourceEnemyMultiBase_cFPQ34nw4r3snd11SoundHandleUlPCQ44nw4r3snd14SoundStartable9StartInfoPv = .text:0x80385CE0; // type:function size:0xDC +hasAnimSound__23dSndSourceNpcAnimBase_cFv = .text:0x80385DC0; // type:function size:0x8 +load__23dSndSourceNpcAnimBase_cFPvPCc = .text:0x80385DD0; // type:function size:0x8 +setFrame__23dSndSourceNpcAnimBase_cFf = .text:0x80385DE0; // type:function size:0x5C +setRate__23dSndSourceNpcAnimBase_cFf = .text:0x80385E40; // type:function size:0x8 +getAnimSound__23dSndSourceNpcAnimBase_cFv = .text:0x80385E50; // type:function size:0x8 +SetupSound__23dSndSourceNpcAnimBase_cFPQ34nw4r3snd11SoundHandleUlPCQ44nw4r3snd14SoundStartable9StartInfoPv = .text:0x80385E60; // type:function size:0x4 +hasAnimSound__23dSndSourceObjAnimBase_cFv = .text:0x80385E70; // type:function size:0x8 +load__23dSndSourceObjAnimBase_cFPvPCc = .text:0x80385E80; // type:function size:0x8 +setFrame__23dSndSourceObjAnimBase_cFf = .text:0x80385E90; // type:function size:0x5C +setRate__23dSndSourceObjAnimBase_cFf = .text:0x80385EF0; // type:function size:0x8 +getAnimSound__23dSndSourceObjAnimBase_cFv = .text:0x80385F00; // type:function size:0x8 +SetupSound__23dSndSourceObjAnimBase_cFPQ34nw4r3snd11SoundHandleUlPCQ44nw4r3snd14SoundStartable9StartInfoPv = .text:0x80385F10; // type:function size:0x4 +hasAnimSound__25dSndSourceEnemyAnimBase_cFv = .text:0x80385F20; // type:function size:0x8 +load__25dSndSourceEnemyAnimBase_cFPvPCc = .text:0x80385F30; // type:function size:0x8 +setFrame__25dSndSourceEnemyAnimBase_cFf = .text:0x80385F40; // type:function size:0x5C +setRate__25dSndSourceEnemyAnimBase_cFf = .text:0x80385FA0; // type:function size:0x8 +getAnimSound__25dSndSourceEnemyAnimBase_cFv = .text:0x80385FB0; // type:function size:0x8 +SetupSound__25dSndSourceEnemyAnimBase_cFPQ34nw4r3snd11SoundHandleUlPCQ44nw4r3snd14SoundStartable9StartInfoPv = .text:0x80385FC0; // type:function size:0x4 +hasAnimSound__21dSndSourceAnimSound_cFv = .text:0x80385FD0; // type:function size:0x8 +load__21dSndSourceAnimSound_cFPvPCc = .text:0x80385FE0; // type:function size:0x8 +setFrame__21dSndSourceAnimSound_cFf = .text:0x80385FF0; // type:function size:0x5C +setRate__21dSndSourceAnimSound_cFf = .text:0x80386050; // type:function size:0x8 +getAnimSound__21dSndSourceAnimSound_cFv = .text:0x80386060; // type:function size:0x8 +SetupSound__21dSndSourceAnimSound_cFPQ34nw4r3snd11SoundHandleUlPCQ44nw4r3snd14SoundStartable9StartInfoPv = .text:0x80386070; // type:function size:0x4 +__dt__18dSndSourceESpark_cFv = .text:0x80386080; // type:function size:0x58 +__dt__19dSndSourceObjAnim_cFv = .text:0x803860E0; // type:function size:0xA0 +__dt__19dSndSourceObjClef_cFv = .text:0x80386180; // type:function size:0x5C +__dt__19dSndSourceNpcAnim_cFv = .text:0x803861E0; // type:function size:0xA0 +__dt__18dSndSourceHarpTg_cFv = .text:0x80386280; // type:function size:0x58 +__sinit_\d_snd_source_mgr_cpp = .text:0x803862E0; // type:function size:0x4 scope:local +@88@__dt__18dSndSourceESpark_cFv = .text:0x803862F0; // type:function size:0x8 +@4@__dt__18dSndSourceESpark_cFv = .text:0x80386300; // type:function size:0x8 +@88@__dt__21dSndSourceAnimSound_cFv = .text:0x80386310; // type:function size:0x8 +@4@SetupSound__21dSndSourceAnimSound_cFPQ34nw4r3snd11SoundHandleUlPCQ44nw4r3snd14SoundStartable9StartInfoPv = .text:0x80386320; // type:function size:0x8 +@4@__dt__21dSndSourceAnimSound_cFv = .text:0x80386330; // type:function size:0x8 +@88@__dt__25dSndSourceEnemyAnimBase_cFv = .text:0x80386340; // type:function size:0x8 +@4@SetupSound__25dSndSourceEnemyAnimBase_cFPQ34nw4r3snd11SoundHandleUlPCQ44nw4r3snd14SoundStartable9StartInfoPv = .text:0x80386350; // type:function size:0x8 +@4@__dt__25dSndSourceEnemyAnimBase_cFv = .text:0x80386360; // type:function size:0x8 +@88@__dt__26dSndSourceEnemyMultiBase_cFv = .text:0x80386370; // type:function size:0x8 +@4@SetupSound__26dSndSourceEnemyMultiBase_cFPQ34nw4r3snd11SoundHandleUlPCQ44nw4r3snd14SoundStartable9StartInfoPv = .text:0x80386380; // type:function size:0x8 +@4@__dt__26dSndSourceEnemyMultiBase_cFv = .text:0x80386390; // type:function size:0x8 +@88@__dt__23dSndSourceObjAnimBase_cFv = .text:0x803863A0; // type:function size:0x8 +@4@__dt__23dSndSourceObjAnimBase_cFv = .text:0x803863B0; // type:function size:0x8 +@88@__dt__19dSndSourceObjAnim_cFv = .text:0x803863C0; // type:function size:0x8 +@4@SetupSound__23dSndSourceObjAnimBase_cFPQ34nw4r3snd11SoundHandleUlPCQ44nw4r3snd14SoundStartable9StartInfoPv = .text:0x803863D0; // type:function size:0x8 +@4@__dt__19dSndSourceObjAnim_cFv = .text:0x803863E0; // type:function size:0x8 +@88@__dt__19dSndSourceObjClef_cFv = .text:0x803863F0; // type:function size:0x8 +@4@__dt__19dSndSourceObjClef_cFv = .text:0x80386400; // type:function size:0x8 +@88@__dt__23dSndSourceNpcAnimBase_cFv = .text:0x80386410; // type:function size:0x8 +@4@__dt__23dSndSourceNpcAnimBase_cFv = .text:0x80386420; // type:function size:0x8 +@88@__dt__19dSndSourceNpcAnim_cFv = .text:0x80386430; // type:function size:0x8 +@4@SetupSound__23dSndSourceNpcAnimBase_cFPQ34nw4r3snd11SoundHandleUlPCQ44nw4r3snd14SoundStartable9StartInfoPv = .text:0x80386440; // type:function size:0x8 +@4@setPause__14dSoundSource_cFbi = .text:0x80386450; // type:function size:0x8 +@4@__dt__19dSndSourceNpcAnim_cFv = .text:0x80386460; // type:function size:0x8 +@88@__dt__18dSndSourceHarpTg_cFv = .text:0x80386470; // type:function size:0x8 @4@SetupSound__14dSoundSource_cFPQ34nw4r3snd11SoundHandleUlPCQ44nw4r3snd14SoundStartable9StartInfoPv = .text:0x80386480; // type:function size:0x8 -@4@d_vt_0x5C__14dSoundSource_cFv = .text:0x80386490; // type:function size:0x8 -@4@d_vt_0x58__14dSoundSource_cFv = .text:0x803864A0; // type:function size:0x8 -fn_803864B0 = .text:0x803864B0; // type:function size:0x8 -fn_803864C0 = .text:0x803864C0; // type:function size:0x8 -set__17dSndSourceGroup_cFlPCc = .text:0x803864D0; // type:function size:0x164 +@4@postHoldSound__14dSoundSource_cFRQ34nw4r3snd11SoundHandleP13dSndSeSound_cUli = .text:0x80386490; // type:function size:0x8 +@4@postStartSound__14dSoundSource_cFRQ34nw4r3snd11SoundHandleP13dSndSeSound_cUl = .text:0x803864A0; // type:function size:0x8 +@4@setPause__23dSndSourceHarpRelated_cFbi = .text:0x803864B0; // type:function size:0x8 +@4@__dt__18dSndSourceHarpTg_cFv = .text:0x803864C0; // type:function size:0x8 +setParam__17dSndSourceGroup_cFlPCc = .text:0x803864D0; // type:function size:0x164 resetSoundSourceParam__17dSndSourceGroup_cFv = .text:0x80386640; // type:function size:0x2C __ct__17dSndSourceGroup_cFv = .text:0x80386670; // type:function size:0x118 -fn_80386790 = .text:0x80386790; // type:function size:0x120 +__ct__17dSndSourceGroup_cFlPCcPCcl = .text:0x80386790; // type:function size:0x120 __dt__17dSndSourceGroup_cFv = .text:0x803868B0; // type:function size:0x54 -fn_80386910 = .text:0x80386910; // type:function size:0xEC -fn_80386A00 = .text:0x80386A00; // type:function size:0xB0 -fn_80386AB0 = .text:0x80386AB0; // type:function size:0xBC -fn_80386B70 = .text:0x80386B70; // type:function size:0xBC +set__17dSndSourceGroup_cFlPCcPCcl = .text:0x80386910; // type:function size:0xEC +setTemp__17dSndSourceGroup_cFlPCcl = .text:0x80386A00; // type:function size:0xB0 +clear__17dSndSourceGroup_cFv = .text:0x80386AB0; // type:function size:0xBC +clearTemp__17dSndSourceGroup_cFv = .text:0x80386B70; // type:function size:0xBC calc__17dSndSourceGroup_cFv = .text:0x80386C30; // type:function size:0x10 getNumSources__17dSndSourceGroup_cCFv = .text:0x80386C40; // type:function size:0x8 registerSource__17dSndSourceGroup_cFP14dSoundSource_c = .text:0x80386C50; // type:function size:0x14 @@ -21129,112 +21129,112 @@ getSourceClosestToListener__17dSndSourceGroup_cFv = .text:0x80386CF0; // type:fu getSourceClosestToPlayer__17dSndSourceGroup_cFv = .text:0x80386DE0; // type:function size:0x110 fn_80386EF0 = .text:0x80386EF0; // type:function size:0x80 setParamFromName__17dSndSourceGroup_cFPCc = .text:0x80386F70; // type:function size:0x1A4C -soundForActorInitRelated_803889c0 = .text:0x803889C0; // type:function size:0x4 -__ct__14dSoundSource_cFUcP9dAcBase_cPCcP17dSndSourceGroup_c = .text:0x803889D0; // type:function size:0x108 +create__16dSoundSourceIf_cFlP9dAcBase_cPCcUc = .text:0x803889C0; // type:function size:0x4 +__ct__14dSoundSource_cFlP9dAcBase_cPCcP17dSndSourceGroup_c = .text:0x803889D0; // type:function size:0x108 __dt__14dSoundSource_cFv = .text:0x80388AE0; // type:function size:0xC4 -vt_0x0C__14dSoundSource_cFv = .text:0x80388BB0; // type:function size:0x118 -vt_0x44__14dSoundSource_cFv = .text:0x80388CD0; // type:function size:0x9C -fn_80388D70 = .text:0x80388D70; // type:function size:0x80 +setup__14dSoundSource_cFv = .text:0x80388BB0; // type:function size:0x118 +shutdown__14dSoundSource_cFv = .text:0x80388CD0; // type:function size:0x9C +stopAllPlaySounds__14dSoundSource_cFl = .text:0x80388D70; // type:function size:0x80 getListenerPosition__14dSoundSource_cCFv = .text:0x80388DF0; // type:function size:0xC -vt_0x2C__14dSoundSource_cFv = .text:0x80388E00; // type:function size:0x88 -d_s_vt_0x184__14dSoundSource_cFv = .text:0x80388E90; // type:function size:0x84 -d_s_vt_0x18C__14dSoundSource_cFv = .text:0x80388F20; // type:function size:0x4 +calc__14dSoundSource_cFRCQ34nw4r4math4VEC3 = .text:0x80388E00; // type:function size:0x88 +preCalc__14dSoundSource_cFv = .text:0x80388E90; // type:function size:0x84 +postCalc__14dSoundSource_cFv = .text:0x80388F20; // type:function size:0x4 hasPlayingSounds__14dSoundSource_cCFv = .text:0x80388F30; // type:function size:0x8 isPlayingSound__14dSoundSource_cFUl = .text:0x80388F40; // type:function size:0x8 isPlayingSound__14dSoundSource_cFPCc = .text:0x80388F50; // type:function size:0x48 -fn_80388FA0 = .text:0x80388FA0; // type:function size:0x14 -fn_80388FC0 = .text:0x80388FC0; // type:function size:0x84 -fn_80389050 = .text:0x80389050; // type:function size:0x68 -vt_0x5C__14dSoundSource_cFv = .text:0x803890C0; // type:function size:0x18 -vt_0x58__14dSoundSource_cFv = .text:0x803890E0; // type:function size:0x1C -fn_80389100 = .text:0x80389100; // type:function size:0x60 -d_s_vt_0x190__14dSoundSource_cFv = .text:0x80389160; // type:function size:0x40 -d_vt_0x38__14dSoundSource_cFbi = .text:0x803891A0; // type:function size:0xB0 -vt_0x60__14dSoundSource_cFv = .text:0x80389250; // type:function size:0x30 -vt_0x70__14dSoundSource_cFv = .text:0x80389280; // type:function size:0x48 -vt_0x64__14dSoundSource_cFv = .text:0x803892D0; // type:function size:0x64 -vt_0x74__14dSoundSource_cFv = .text:0x80389340; // type:function size:0x58 -vt_0x68__14dSoundSource_cFv = .text:0x803893A0; // type:function size:0x60 -vt_0x78__14dSoundSource_cFv = .text:0x80389400; // type:function size:0x58 -vt_0x6C__14dSoundSource_cFv = .text:0x80389460; // type:function size:0x88 -vt_0x7C__14dSoundSource_cFv = .text:0x803894F0; // type:function size:0x68 -vt_0xA0__14dSoundSource_cFv = .text:0x80389560; // type:function size:0x94 -fn_80389600 = .text:0x80389600; // type:function size:0x74 -fn_80389680 = .text:0x80389680; // type:function size:0x40 -fn_803896C0 = .text:0x803896C0; // type:function size:0x1A8 -vt_0x80__14dSoundSource_cFv = .text:0x80389870; // type:function size:0x11C -vt_0x8C__14dSoundSource_cFv = .text:0x80389990; // type:function size:0x58 -vt_0x84__14dSoundSource_cFv = .text:0x803899F0; // type:function size:0x184 -vt_0x90__14dSoundSource_cFv = .text:0x80389B80; // type:function size:0x68 -vt_0x88__14dSoundSource_cFv = .text:0x80389BF0; // type:function size:0x160 -vt_0x94__14dSoundSource_cFv = .text:0x80389D50; // type:function size:0x78 -vt_0x98__14dSoundSource_cFv = .text:0x80389DD0; // type:function size:0x11C -vt_0x9C__14dSoundSource_cFv = .text:0x80389EF0; // type:function size:0x58 -fn_80389F50 = .text:0x80389F50; // type:function size:0x208 -d_s_vt_0x19C__14dSoundSource_cFv = .text:0x8038A160; // type:function size:0x6C -fn_8038A1D0 = .text:0x8038A1D0; // type:function size:0xD8 -vt_0xD8__14dSoundSource_cFv = .text:0x8038A2B0; // type:function size:0x48 -fn_8038A300 = .text:0x8038A300; // type:function size:0x10 -vt_0xA4__14dSoundSource_cFv = .text:0x8038A310; // type:function size:0xB8 -vt_0xA8__14dSoundSource_cFv = .text:0x8038A3D0; // type:function size:0x58 -vt_0xAC__14dSoundSource_cFv = .text:0x8038A430; // type:function size:0x30 -vt_0xBC__14dSoundSource_cFv = .text:0x8038A460; // type:function size:0x48 -vt_0xB0__14dSoundSource_cFv = .text:0x8038A4B0; // type:function size:0x64 -vt_0xC0__14dSoundSource_cFv = .text:0x8038A520; // type:function size:0x58 -vt_0xB4__14dSoundSource_cFv = .text:0x8038A580; // type:function size:0x60 -vt_0xC4__14dSoundSource_cFv = .text:0x8038A5E0; // type:function size:0x58 -vt_0xB8__14dSoundSource_cFv = .text:0x8038A640; // type:function size:0x88 -vt_0xC8__14dSoundSource_cFv = .text:0x8038A6D0; // type:function size:0x68 -fn_8038A740 = .text:0x8038A740; // type:function size:0x1E8 -fn_8038A930 = .text:0x8038A930; // type:function size:0x1D0 -vt_0xCC__14dSoundSource_cFv = .text:0x8038AB00; // type:function size:0x258 -vt_0xD0__14dSoundSource_cFv = .text:0x8038AD60; // type:function size:0x58 +initVolumeFade__14dSoundSource_cFv = .text:0x80388FA0; // type:function size:0x14 +setVolumeFade__14dSoundSource_cFfUl = .text:0x80388FC0; // type:function size:0x84 +calcVolumeFade__14dSoundSource_cFv = .text:0x80389050; // type:function size:0x68 +setCtxInt__14dSoundSource_cFl = .text:0x803890C0; // type:function size:0x18 +setCtxFloat__14dSoundSource_cFf = .text:0x803890E0; // type:function size:0x1C +isInaudibleInternal__14dSoundSource_cFv = .text:0x80389100; // type:function size:0x60 +d_s_vt_0x190__14dSoundSource_cCFv = .text:0x80389160; // type:function size:0x40 +setPause__14dSoundSource_cFbi = .text:0x803891A0; // type:function size:0xB0 +startSound__14dSoundSource_cFUl = .text:0x80389250; // type:function size:0x30 +startSound__14dSoundSource_cFPCc = .text:0x80389280; // type:function size:0x48 +startSoundWithIntParam__14dSoundSource_cFUll = .text:0x803892D0; // type:function size:0x64 +startSoundWithIntParam__14dSoundSource_cFPCcl = .text:0x80389340; // type:function size:0x58 +startSoundWithFloatParam__14dSoundSource_cFUlf = .text:0x803893A0; // type:function size:0x60 +startSoundWithFloatParam__14dSoundSource_cFPCcf = .text:0x80389400; // type:function size:0x58 +startSoundWithParams__14dSoundSource_cFUlfl = .text:0x80389460; // type:function size:0x88 +startSoundWithParams__14dSoundSource_cFPCcfl = .text:0x803894F0; // type:function size:0x68 +maybeUnusedEnemyDeath__14dSoundSource_cFv = .text:0x80389560; // type:function size:0x94 +startRemoConSound__14dSoundSource_cFUl = .text:0x80389600; // type:function size:0x74 +startSound__14dSoundSource_cFUlPQ34nw4r3snd11SoundHandle = .text:0x80389680; // type:function size:0x40 +startSound__14dSoundSource_cFUlPQ34nw4r3snd11SoundHandlePPQ34nw4r3snd11SoundHandle = .text:0x803896C0; // type:function size:0x1A8 +startSoundAtPosition__14dSoundSource_cFUlPCQ34nw4r4math4VEC3 = .text:0x80389870; // type:function size:0x11C +startSoundAtPosition__14dSoundSource_cFPCcPCQ34nw4r4math4VEC3 = .text:0x80389990; // type:function size:0x58 +startObjHitSound__14dSoundSource_cFUlP16dSoundSourceIf_cPCQ34nw4r4math4VEC3 = .text:0x803899F0; // type:function size:0x184 +startObjHitSound__14dSoundSource_cFPCcP16dSoundSourceIf_cPCQ34nw4r4math4VEC3 = .text:0x80389B80; // type:function size:0x68 +startBgHitSound__14dSoundSource_cFUlUlUlPCQ34nw4r4math4VEC3 = .text:0x80389BF0; // type:function size:0x160 +startBgHitSound__14dSoundSource_cFPCcUlUlPCQ34nw4r4math4VEC3 = .text:0x80389D50; // type:function size:0x78 +startSoundAtPosition2__14dSoundSource_cFUlPCQ34nw4r4math4VEC3 = .text:0x80389DD0; // type:function size:0x11C +startSoundAtPosition2__14dSoundSource_cFPCcPCQ34nw4r4math4VEC3 = .text:0x80389EF0; // type:function size:0x58 +startSoundAtPosition__14dSoundSource_cFUlPCQ34nw4r4math4VEC3PQ34nw4r3snd11SoundHandle = .text:0x80389F50; // type:function size:0x208 +overrideHitObjSoundId__14dSoundSource_cFUlP14dSoundSource_c = .text:0x8038A160; // type:function size:0x6C +handleRemoCon__14dSoundSource_cFPQ34nw4r3snd11SoundHandleUl = .text:0x8038A1D0; // type:function size:0xD8 +startVoiceLine__14dSoundSource_cFPCc = .text:0x8038A2B0; // type:function size:0x48 +getRoomId__14dSoundSource_cCFv = .text:0x8038A300; // type:function size:0x10 +stopSounds__14dSoundSource_cFUll = .text:0x8038A310; // type:function size:0xB8 +stopSounds__14dSoundSource_cFPCcl = .text:0x8038A3D0; // type:function size:0x58 +holdSound__14dSoundSource_cFUl = .text:0x8038A430; // type:function size:0x30 +holdSound__14dSoundSource_cFPCc = .text:0x8038A460; // type:function size:0x48 +holdSoundWithIntParam__14dSoundSource_cFUll = .text:0x8038A4B0; // type:function size:0x64 +holdSoundWithIntParam__14dSoundSource_cFPCcl = .text:0x8038A520; // type:function size:0x58 +holdSoundWithFloatParam__14dSoundSource_cFUlf = .text:0x8038A580; // type:function size:0x60 +holdSoundWithFloatParam__14dSoundSource_cFPCcf = .text:0x8038A5E0; // type:function size:0x58 +holdSoundWithParams__14dSoundSource_cFUlfl = .text:0x8038A640; // type:function size:0x88 +holdSoundWithParams__14dSoundSource_cFPCcfl = .text:0x8038A6D0; // type:function size:0x68 +holdSound__14dSoundSource_cFUlPQ34nw4r3snd11SoundHandle = .text:0x8038A740; // type:function size:0x1E8 +continueHoldingSound__14dSoundSource_cFP14dSndSeSound2_cUlP23dSndDistantSoundActor_cPCQ34nw4r4math4VEC3 = .text:0x8038A930; // type:function size:0x1D0 +holdSoundAtPosition__14dSoundSource_cFUlPCQ34nw4r4math4VEC3 = .text:0x8038AB00; // type:function size:0x258 +holdSoundAtPosition__14dSoundSource_cFPCcPCQ34nw4r4math4VEC3 = .text:0x8038AD60; // type:function size:0x58 SetupSound__14dSoundSource_cFPQ34nw4r3snd11SoundHandleUlPCQ44nw4r3snd14SoundStartable9StartInfoPv = .text:0x8038ADC0; // type:function size:0xAC -d_s_vt_0x1AC__14dSoundSource_cFv = .text:0x8038AE70; // type:function size:0x98 -d_s_vt_0x1B0__14dSoundSource_cFv = .text:0x8038AF10; // type:function size:0x254 -getVolumePercentMaybe = .text:0x8038B170; // type:function size:0x78 -fn_8038B1F0 = .text:0x8038B1F0; // type:function size:0x90 -fn_8038B280 = .text:0x8038B280; // type:function size:0x94 -d_s_vt_0x1C8__14dSoundSource_cFv = .text:0x8038B320; // type:function size:0x24 -fn_8038B350 = .text:0x8038B350; // type:function size:0x30 -d_s_vt_0x194__14dSoundSource_cFv = .text:0x8038B380; // type:function size:0x8 -d_vt_0x58__14dSoundSource_cFv = .text:0x8038B390; // type:function size:0x4 -d_s_vt_0x1A0__14dSoundSource_cFv = .text:0x8038B3A0; // type:function size:0x8 -d_vt_0x5C__14dSoundSource_cFv = .text:0x8038B3B0; // type:function size:0x4 -d_s_vt_0x1B4__14dSoundSource_cFv = .text:0x8038B3C0; // type:function size:0x54 -d_s_vt_0x1B8__14dSoundSource_cFv = .text:0x8038B420; // type:function size:0x60 -d_s_vt_0x1BC__14dSoundSource_cFv = .text:0x8038B480; // type:function size:0x74 -d_s_vt_0x1C4__14dSoundSource_cFv = .text:0x8038B500; // type:function size:0x84 -fn_8038B590 = .text:0x8038B590; // type:function size:0x24 -fn_8038B5C0 = .text:0x8038B5C0; // type:function size:0x24 -fn_8038B5F0 = .text:0x8038B5F0; // type:function size:0x60 -fn_8038B650 = .text:0x8038B650; // type:function size:0x50 -fn_8038B6A0 = .text:0x8038B6A0; // type:function size:0x34 -fn_8038B6E0 = .text:0x8038B6E0; // type:function size:0x7C -fn_8038B760 = .text:0x8038B760; // type:function size:0x5C -fn_8038B7C0 = .text:0x8038B7C0; // type:function size:0x34 -fn_8038B800 = .text:0x8038B800; // type:function size:0x98 -fn_8038B8A0 = .text:0x8038B8A0; // type:function size:0xD4 -fn_8038B980 = .text:0x8038B980; // type:function size:0x90 -fn_8038BA10 = .text:0x8038BA10; // type:function size:0x6C -fn_8038BA80 = .text:0x8038BA80; // type:function size:0x90 -fn_8038BB10 = .text:0x8038BB10; // type:function size:0x6C -fn_8038BB80 = .text:0x8038BB80; // type:function size:0x6C -fn_8038BBF0 = .text:0x8038BBF0; // type:function size:0x144 -vt_0xFC__14dSoundSource_cFv = .text:0x8038BD40; // type:function size:0x20 -vt_0x110__14dSoundSource_cFv = .text:0x8038BD60; // type:function size:0xC -d_s_vt_0x1E4__14dSoundSource_cFv = .text:0x8038BD70; // type:function size:0x4 -fn_8038BD80 = .text:0x8038BD80; // type:function size:0xB8 -getCharacterTalkSoundId__14dSoundSource_cFUlP14dSoundSource_c = .text:0x8038BE40; // type:function size:0xC4 -fn_8038BF10 = .text:0x8038BF10; // type:function size:0x104 -d_s_vt_0x1E8__14dSoundSource_cFv = .text:0x8038C020; // type:function size:0x8 +d_s_vt_0x1AC__14dSoundSource_cFUl = .text:0x8038AE70; // type:function size:0x98 +setupSound__14dSoundSource_cFPQ34nw4r3snd11SoundHandleUlPCQ44nw4r3snd14SoundStartable9StartInfoPvb = .text:0x8038AF10; // type:function size:0x254 +getBaseSoundVolume__14dSoundSource_cFUlUl = .text:0x8038B170; // type:function size:0x78 +startBaseSound__14dSoundSource_cFUlf = .text:0x8038B1F0; // type:function size:0x90 +startBaseSoundAtPosition__14dSoundSource_cFUlPCQ34nw4r4math4VEC3f = .text:0x8038B280; // type:function size:0x94 +resetTempParams__14dSoundSource_cFv = .text:0x8038B320; // type:function size:0x24 +onSetupError__14dSoundSource_cFv = .text:0x8038B350; // type:function size:0x30 +overrideStartSoundId__14dSoundSource_cFUl = .text:0x8038B380; // type:function size:0x8 +postStartSound__14dSoundSource_cFRQ34nw4r3snd11SoundHandleP13dSndSeSound_cUl = .text:0x8038B390; // type:function size:0x4 +overrideHoldSoundId__14dSoundSource_cFUlb = .text:0x8038B3A0; // type:function size:0x8 +postHoldSound__14dSoundSource_cFRQ34nw4r3snd11SoundHandleP13dSndSeSound_cUli = .text:0x8038B3B0; // type:function size:0x4 +attachDistantSound__14dSoundSource_cFP23dSndDistantSoundActor_c = .text:0x8038B3C0; // type:function size:0x54 +detachDistantSound__14dSoundSource_cFP23dSndDistantSoundActor_c = .text:0x8038B420; // type:function size:0x60 +detachAllDistantSounds__14dSoundSource_cFv = .text:0x8038B480; // type:function size:0x74 +pauseAllDistantSounds__14dSoundSource_cFbi = .text:0x8038B500; // type:function size:0x84 +addSeHandleType1__14dSoundSource_cFP14dSndSeSound1_c = .text:0x8038B590; // type:function size:0x24 +addSeHandleType2__14dSoundSource_cFP14dSndSeSound2_c = .text:0x8038B5C0; // type:function size:0x24 +removeSeHandleType1__14dSoundSource_cFP14dSndSeSound1_cb = .text:0x8038B5F0; // type:function size:0x60 +removeSeHandleType2__14dSoundSource_cFP14dSndSeSound2_c = .text:0x8038B650; // type:function size:0x50 +removeAllSeHandles__14dSoundSource_cFv = .text:0x8038B6A0; // type:function size:0x34 +removeAllSeHandlesType1__14dSoundSource_cFv = .text:0x8038B6E0; // type:function size:0x7C +removeAllSeHandlesType2__14dSoundSource_cFv = .text:0x8038B760; // type:function size:0x5C +calcHandles__14dSoundSource_cFv = .text:0x8038B7C0; // type:function size:0x34 +calcHandlesType1__14dSoundSource_cFv = .text:0x8038B800; // type:function size:0x98 +calcHandlesType2__14dSoundSource_cFv = .text:0x8038B8A0; // type:function size:0xD4 +getHandleType1ForSoundId__14dSoundSource_cFUl = .text:0x8038B980; // type:function size:0x90 +getHandleType1ForSoundHandle__14dSoundSource_cFPQ34nw4r3snd11SoundHandle = .text:0x8038BA10; // type:function size:0x6C +getHandleType2ForSoundId__14dSoundSource_cFUl = .text:0x8038BA80; // type:function size:0x90 +getHandleType1ForSoundHandle_Dupe__14dSoundSource_cFPQ34nw4r3snd11SoundHandle = .text:0x8038BB10; // type:function size:0x6C +getHandleType2ForSoundHandle_Dupe__14dSoundSource_cFPQ34nw4r3snd11SoundHandle = .text:0x8038BB80; // type:function size:0x6C +stopSoundHandles__14dSoundSource_cFUll = .text:0x8038BBF0; // type:function size:0x144 +isInaudible__14dSoundSource_cFv = .text:0x8038BD40; // type:function size:0x20 +setPolyAttrs__14dSoundSource_cFUcUc = .text:0x8038BD60; // type:function size:0xC +d_s_vt_0x1E4_noop__14dSoundSource_cFv = .text:0x8038BD70; // type:function size:0x4 +modifySoundId__14dSoundSource_cFUl = .text:0x8038BD80; // type:function size:0xB8 +modifySoundId__14dSoundSource_cFUlP14dSoundSource_c = .text:0x8038BE40; // type:function size:0xC4 +specializeBgHitSoundId__14dSoundSource_cFUlUlUl = .text:0x8038BF10; // type:function size:0x104 +d_s_vt_0x1E8__14dSoundSource_cFUl = .text:0x8038C020; // type:function size:0x8 getRemoConSoundVariant__14dSoundSource_cCFUl = .text:0x8038C030; // type:function size:0x58 -fn_8038C090 = .text:0x8038C090; // type:function size:0xBC -fn_8038C150 = .text:0x8038C150; // type:function size:0x280 -__sinit_\d_snd_source_cpp = .text:0x8038C3D0; // type:function size:0x18 -@88@__dt__14dSoundSource_cFv = .text:0x8038C3F0; // type:function size:0x8 -@4@__dt__14dSoundSource_cFv = .text:0x8038C400; // type:function size:0x8 -fn_8038C410 = .text:0x8038C410; // type:function size:0xEC +timeAreaCheck__14dSoundSource_cFv = .text:0x8038C090; // type:function size:0xBC +setupSoundCommon__14dSoundSource_cFPQ34nw4r3snd11SoundHandleUlPCQ44nw4r3snd14SoundStartable9StartInfoPv = .text:0x8038C150; // type:function size:0x280 +__sinit_\d_snd_source_cpp = .text:0x8038C3D0; // type:function size:0x18 scope:local +@88@__dt__14dSoundSource_cFv = .text:0x8038C3F0; // type:function size:0x8 scope:weak +@4@__dt__14dSoundSource_cFv = .text:0x8038C400; // type:function size:0x8 scope:weak +__ct__18dSndSourcePlayer_cFlP9dAcBase_cPCcP17dSndSourceGroup_c = .text:0x8038C410; // type:function size:0xEC fn_8038C500 = .text:0x8038C500; // type:function size:0xC4 fn_8038C5D0 = .text:0x8038C5D0; // type:function size:0x3D0 fn_8038C9A0 = .text:0x8038C9A0; // type:function size:0x44 @@ -21263,79 +21263,79 @@ fn_8038D510 = .text:0x8038D510; // type:function size:0x8 fn_8038D520 = .text:0x8038D520; // type:function size:0x8 fn_8038D530 = .text:0x8038D530; // type:function size:0x8 fn_8038D540 = .text:0x8038D540; // type:function size:0x8 -linkSoundRelated = .text:0x8038D550; // type:function size:0x7C -fn_8038D5D0 = .text:0x8038D5D0; // type:function size:0x40 -fn_8038D610 = .text:0x8038D610; // type:function size:0x40 -fn_8038D650 = .text:0x8038D650; // type:function size:0x40 -fn_8038D690 = .text:0x8038D690; // type:function size:0x74 -fn_8038D710 = .text:0x8038D710; // type:function size:0x8 -actuallyPlaysLinkSound = .text:0x8038D720; // type:function size:0x334 -fn_8038DA60 = .text:0x8038DA60; // type:function size:0x14 -fn_8038DA80 = .text:0x8038DA80; // type:function size:0x58 -fn_8038DAE0 = .text:0x8038DAE0; // type:function size:0x8 -fn_8038DAF0 = .text:0x8038DAF0; // type:function size:0x6C -fn_8038DB60 = .text:0x8038DB60; // type:function size:0x48 -fn_8038DBB0 = .text:0x8038DBB0; // type:function size:0x54 -fn_8038DC10 = .text:0x8038DC10; // type:function size:0x8 -fn_8038DC20 = .text:0x8038DC20; // type:function size:0x8 -fn_8038DC30 = .text:0x8038DC30; // type:function size:0x4 -fn_8038DC40 = .text:0x8038DC40; // type:function size:0x8 -fn_8038DC50 = .text:0x8038DC50; // type:function size:0x80 -fn_8038DCD0 = .text:0x8038DCD0; // type:function size:0x8 -fn_8038DCE0 = .text:0x8038DCE0; // type:function size:0x8 -fn_8038DCF0 = .text:0x8038DCF0; // type:function size:0x8 -fn_8038DD00 = .text:0x8038DD00; // type:function size:0x8 -fn_8038DD10 = .text:0x8038DD10; // type:function size:0x94 -fn_8038DDB0 = .text:0x8038DDB0; // type:function size:0x7C -fn_8038DE30 = .text:0x8038DE30; // type:function size:0x34 -fn_8038DE70 = .text:0x8038DE70; // type:function size:0x34 -fn_8038DEB0 = .text:0x8038DEB0; // type:function size:0x284 -fn_8038E140 = .text:0x8038E140; // type:function size:0xC -fn_8038E150 = .text:0x8038E150; // type:function size:0xA4 -fn_8038E200 = .text:0x8038E200; // type:function size:0xBC -fn_8038E2C0 = .text:0x8038E2C0; // type:function size:0x48 -fn_8038E310 = .text:0x8038E310; // type:function size:0xE0 -fn_8038E3F0 = .text:0x8038E3F0; // type:function size:0x2C -fn_8038E420 = .text:0x8038E420; // type:function size:0x198 +__ct__22dSndSourcePlayerHead_cFlP9dAcBase_cPCcP17dSndSourceGroup_c = .text:0x8038D550; // type:function size:0x7C +__dt__18dSndRngLinkVoice_cFv = .text:0x8038D5D0; // type:function size:0x40 +__dt__11dSndRngId_cFv = .text:0x8038D610; // type:function size:0x40 +__dt__9dSndRng_cFv = .text:0x8038D650; // type:function size:0x40 +configureVoiceRngs__22dSndSourcePlayerHead_cFv = .text:0x8038D690; // type:function size:0x74 +d_vt_0x3C__22dSndSourcePlayerHead_cFv = .text:0x8038D710; // type:function size:0x8 +startVoiceLine__22dSndSourcePlayerHead_cFUl = .text:0x8038D720; // type:function size:0x334 +isPlayingActionSound__22dSndSourcePlayerHead_cCFv = .text:0x8038DA60; // type:function size:0x14 +startVoiceSoundInternal__22dSndSourcePlayerHead_cFUl = .text:0x8038DA80; // type:function size:0x58 +d_vt_0x30__22dSndSourcePlayerHead_cFv = .text:0x8038DAE0; // type:function size:0x8 +isCurrentActionSound__22dSndSourcePlayerHead_cCFUl = .text:0x8038DAF0; // type:function size:0x6C +stopCurrentActionSound__22dSndSourcePlayerHead_cFv = .text:0x8038DB60; // type:function size:0x48 +stopActionSound__22dSndSourcePlayerHead_cFUl = .text:0x8038DBB0; // type:function size:0x54 +startVoiceLine__22dSndSourcePlayerHead_cFPCc = .text:0x8038DC10; // type:function size:0x8 +vt_1F0__22dSndSourcePlayerHead_cFv = .text:0x8038DC20; // type:function size:0x8 +preCalc__22dSndSourcePlayerHead_cFv = .text:0x8038DC30; // type:function size:0x4 +overrideStartSoundId__22dSndSourcePlayerHead_cFUl = .text:0x8038DC40; // type:function size:0x8 +__dt__22dSndSourcePlayerHead_cFv = .text:0x8038DC50; // type:function size:0x80 +@88@__dt__22dSndSourcePlayerHead_cFv = .text:0x8038DCD0; // type:function size:0x8 +@4@d_vt_0x3C__22dSndSourcePlayerHead_cFv = .text:0x8038DCE0; // type:function size:0x8 +@4@d_vt_0x30__22dSndSourcePlayerHead_cFv = .text:0x8038DCF0; // type:function size:0x8 +@4@__dt__22dSndSourcePlayerHead_cFv = .text:0x8038DD00; // type:function size:0x8 +__ct__17dSndSourceEnemy_cFlP9dAcBase_cPCcP17dSndSourceGroup_c = .text:0x8038DD10; // type:function size:0x94 +__dt__17dSndSourceEnemy_cFv = .text:0x8038DDB0; // type:function size:0x7C +shutdown__17dSndSourceEnemy_cFv = .text:0x8038DE30; // type:function size:0x34 +unregisterEnemySource__17dSndSourceEnemy_cFv = .text:0x8038DE70; // type:function size:0x34 +postSetup__17dSndSourceEnemy_cFv = .text:0x8038DEB0; // type:function size:0x284 +vt_0x020__17dSndSourceEnemy_cFv = .text:0x8038E140; // type:function size:0xC +checkBattleBgmRelated__17dSndSourceEnemy_cFv = .text:0x8038E150; // type:function size:0xA4 +overrideStartSoundId__17dSndSourceEnemy_cFUl = .text:0x8038E200; // type:function size:0xBC +overrideHoldSoundId__17dSndSourceEnemy_cFUlb = .text:0x8038E2C0; // type:function size:0x48 +overrideStartSoundId__21dSndSourceEnemyAnim_cFUl = .text:0x8038E310; // type:function size:0xE0 +overrideHoldSoundId__21dSndSourceEnemyAnim_cFUlb = .text:0x8038E3F0; // type:function size:0x2C +postCalc__22dSndSourceEnemyMulti_cFv = .text:0x8038E420; // type:function size:0x198 fn_8038E5C0 = .text:0x8038E5C0; // type:function size:0x74 fn_8038E640 = .text:0x8038E640; // type:function size:0x74 -fn_8038E6C0 = .text:0x8038E6C0; // type:function size:0x98 -fn_8038E760 = .text:0x8038E760; // type:function size:0x9C -fn_8038E800 = .text:0x8038E800; // type:function size:0x8 -fn_8038E810 = .text:0x8038E810; // type:function size:0x8 -fn_8038E820 = .text:0x8038E820; // type:function size:0x8 -fn_8038E830 = .text:0x8038E830; // type:function size:0x8 -fn_8038E840 = .text:0x8038E840; // type:function size:0x8 -fn_8038E850 = .text:0x8038E850; // type:function size:0x8 -fn_8038E860 = .text:0x8038E860; // type:function size:0x130 -fn_8038E990 = .text:0x8038E990; // type:function size:0x98 -fn_8038EA30 = .text:0x8038EA30; // type:function size:0x5C -fn_8038EA90 = .text:0x8038EA90; // type:function size:0x8 -fn_8038EAA0 = .text:0x8038EAA0; // type:function size:0x8 -fn_8038EAB0 = .text:0x8038EAB0; // type:function size:0x8 -fn_8038EAC0 = .text:0x8038EAC0; // type:function size:0x8 -fn_8038EAD0 = .text:0x8038EAD0; // type:function size:0x8 -tadtoneRelated = .text:0x8038EAE0; // type:function size:0xE4 -fn_8038EBD0 = .text:0x8038EBD0; // type:function size:0x20 -fn_8038EBF0 = .text:0x8038EBF0; // type:function size:0x4C -fn_8038EC40 = .text:0x8038EC40; // type:function size:0x5C -fn_8038ECA0 = .text:0x8038ECA0; // type:function size:0x1F0 -fn_8038EE90 = .text:0x8038EE90; // type:function size:0x54 -fn_8038EEF0 = .text:0x8038EEF0; // type:function size:0x1D8 -fn_8038F0D0 = .text:0x8038F0D0; // type:function size:0x4C -fn_8038F120 = .text:0x8038F120; // type:function size:0x58 -fn_8038F180 = .text:0x8038F180; // type:function size:0x68 -fn_8038F1F0 = .text:0x8038F1F0; // type:function size:0xC -fn_8038F200 = .text:0x8038F200; // type:function size:0x5C -fn_8038F260 = .text:0x8038F260; // type:function size:0x8 -fn_8038F270 = .text:0x8038F270; // type:function size:0x8 -fn_8038F280 = .text:0x8038F280; // type:function size:0x8 -fn_8038F290 = .text:0x8038F290; // type:function size:0x8 -fn_8038F2A0 = .text:0x8038F2A0; // type:function size:0x8 -fn_8038F2B0 = .text:0x8038F2B0; // type:function size:0x7C +__dt__21dSndSourceEnemyAnim_cFv = .text:0x8038E6C0; // type:function size:0x98 +__dt__22dSndSourceEnemyMulti_cFv = .text:0x8038E760; // type:function size:0x9C +@88@__dt__17dSndSourceEnemy_cFv = .text:0x8038E800; // type:function size:0x8 +@4@__dt__17dSndSourceEnemy_cFv = .text:0x8038E810; // type:function size:0x8 +@88@__dt__21dSndSourceEnemyAnim_cFv = .text:0x8038E820; // type:function size:0x8 +@4@__dt__21dSndSourceEnemyAnim_cFv = .text:0x8038E830; // type:function size:0x8 +@88@__dt__22dSndSourceEnemyMulti_cFv = .text:0x8038E840; // type:function size:0x8 +@4@__dt__22dSndSourceEnemyMulti_cFv = .text:0x8038E850; // type:function size:0x8 +postSetup__15dSndSourceObj_cFv = .text:0x8038E860; // type:function size:0x130 +setPosition__25dSndSourceObjLightShaft_cFRCQ34nw4r4math4VEC3 = .text:0x8038E990; // type:function size:0x98 +__dt__25dSndSourceObjLightShaft_cFv = .text:0x8038EA30; // type:function size:0x5C scope:weak +@88@__dt__15dSndSourceObj_cFv = .text:0x8038EA90; // type:function size:0x8 scope:weak +@4@__dt__15dSndSourceObj_cFv = .text:0x8038EAA0; // type:function size:0x8 scope:weak +@88@__dt__25dSndSourceObjLightShaft_cFv = .text:0x8038EAB0; // type:function size:0x8 scope:weak +@4@setPosition__25dSndSourceObjLightShaft_cFRCQ34nw4r4math4VEC3 = .text:0x8038EAC0; // type:function size:0x8 scope:weak +@4@__dt__25dSndSourceObjLightShaft_cFv = .text:0x8038EAD0; // type:function size:0x8 scope:weak +startTadtoneSound__19dSndSourceObjClef_cFUlUl = .text:0x8038EAE0; // type:function size:0xE4 +__sinit_\d_snd_source_obj_clef_cpp = .text:0x8038EBD0; // type:function size:0x20 scope:local +__ct__21dSndSourceEquipment_cFlP9dAcBase_cPCcP17dSndSourceGroup_c = .text:0x8038EBF0; // type:function size:0x4C +shutdown__21dSndSourceEquipment_cFv = .text:0x8038EC40; // type:function size:0x5C +overrideStartSoundId__21dSndSourceEquipment_cFUl = .text:0x8038ECA0; // type:function size:0x1F0 +postStartSound__21dSndSourceEquipment_cFRQ34nw4r3snd11SoundHandleP13dSndSeSound_cUl = .text:0x8038EE90; // type:function size:0x54 +overrideHitObjSoundId__21dSndSourceEquipment_cFUlP14dSoundSource_c = .text:0x8038EEF0; // type:function size:0x1D8 +__ct__25dSndSourceEquipmentWhip_cFlP9dAcBase_cPCcP17dSndSourceGroup_c = .text:0x8038F0D0; // type:function size:0x4C +__dt__21dSndSourceEquipment_cFv = .text:0x8038F120; // type:function size:0x58 scope:weak +postCalc__25dSndSourceEquipmentWhip_cFv = .text:0x8038F180; // type:function size:0x68 +d_s_vt_0x1E8__21dSndSourceEquipment_cFUl = .text:0x8038F1F0; // type:function size:0xC scope:weak +__dt__25dSndSourceEquipmentWhip_cFv = .text:0x8038F200; // type:function size:0x5C scope:weak +@88@__dt__21dSndSourceEquipment_cFv = .text:0x8038F260; // type:function size:0x8 scope:weak +@4@__dt__21dSndSourceEquipment_cFv = .text:0x8038F270; // type:function size:0x8 scope:weak +@88@__dt__25dSndSourceEquipmentWhip_cFv = .text:0x8038F280; // type:function size:0x8 scope:weak +@4@postStartSound__21dSndSourceEquipment_cFRQ34nw4r3snd11SoundHandleP13dSndSeSound_cUl = .text:0x8038F290; // type:function size:0x8 scope:weak +@4@__dt__25dSndSourceEquipmentWhip_cFv = .text:0x8038F2A0; // type:function size:0x8 scope:weak +__ct__22dSndSourceNpcSpecial_cFlP9dAcBase_cPCcP17dSndSourceGroup_c = .text:0x8038F2B0; // type:function size:0x7C fn_8038F330 = .text:0x8038F330; // type:function size:0x64 fn_8038F3A0 = .text:0x8038F3A0; // type:function size:0xD8 -fn_8038F480 = .text:0x8038F480; // type:function size:0x90 +__ct__17dSndSourceNpcDr_cFlP9dAcBase_cPCcP17dSndSourceGroup_c = .text:0x8038F480; // type:function size:0x90 fn_8038F510 = .text:0x8038F510; // type:function size:0xA0 fn_8038F5B0 = .text:0x8038F5B0; // type:function size:0x158 fn_8038F710 = .text:0x8038F710; // type:function size:0x84 @@ -21351,19 +21351,19 @@ fn_8038FEE0 = .text:0x8038FEE0; // type:function size:0x8 fn_8038FEF0 = .text:0x8038FEF0; // type:function size:0x8 fn_8038FF00 = .text:0x8038FF00; // type:function size:0x8 fn_8038FF10 = .text:0x8038FF10; // type:function size:0x8 -fn_8038FF20 = .text:0x8038FF20; // type:function size:0xC0 -fn_8038FFE0 = .text:0x8038FFE0; // type:function size:0x1E8 -fn_803901D0 = .text:0x803901D0; // type:function size:0x18 -fn_803901F0 = .text:0x803901F0; // type:function size:0x18 -fn_80390210 = .text:0x80390210; // type:function size:0xC -fn_80390220 = .text:0x80390220; // type:function size:0x58 -fn_80390280 = .text:0x80390280; // type:function size:0x8 -fn_80390290 = .text:0x80390290; // type:function size:0x8 -fn_803902A0 = .text:0x803902A0; // type:function size:0x1B0 -fn_80390450 = .text:0x80390450; // type:function size:0x98 -fn_803904F0 = .text:0x803904F0; // type:function size:0x8 -fn_80390500 = .text:0x80390500; // type:function size:0x8 -fn_80390510 = .text:0x80390510; // type:function size:0x7C +__ct__19dSndSourceNpcHead_cFlP9dAcBase_cPCcP17dSndSourceGroup_c = .text:0x8038FF20; // type:function size:0xC0 +npcSpeak__19dSndSourceNpcHead_cFUl = .text:0x8038FFE0; // type:function size:0x1E8 +startVoiceLine__19dSndSourceNpcHead_cFUl = .text:0x803901D0; // type:function size:0x18 +vt_0xDC__19dSndSourceNpcHead_cFUl = .text:0x803901F0; // type:function size:0x18 +setOrigName__19dSndSourceNpcHead_cFPCc = .text:0x80390210; // type:function size:0xC +__dt__19dSndSourceNpcHead_cFv = .text:0x80390220; // type:function size:0x58 scope:weak +@88@__dt__19dSndSourceNpcHead_cFv = .text:0x80390280; // type:function size:0x8 scope:weak +@4@__dt__19dSndSourceNpcHead_cFv = .text:0x80390290; // type:function size:0x8 scope:weak +load__18dSndSourcePyBird_cFPvPCc = .text:0x803902A0; // type:function size:0x1B0 +__dt__18dSndSourcePyBird_cFv = .text:0x80390450; // type:function size:0x98 scope:weak +@88@__dt__18dSndSourcePyBird_cFv = .text:0x803904F0; // type:function size:0x8 scope:weak +@4@__dt__18dSndSourcePyBird_cFv = .text:0x80390500; // type:function size:0x8 scope:weak +__ct__16dSndSourceDemo_cFlP9dAcBase_cPCcP17dSndSourceGroup_c = .text:0x80390510; // type:function size:0x7C fn_80390590 = .text:0x80390590; // type:function size:0x1EC fn_80390780 = .text:0x80390780; // type:function size:0x8C fn_80390810 = .text:0x80390810; // type:function size:0x58 @@ -21376,23 +21376,23 @@ fn_803909C0 = .text:0x803909C0; // type:function size:0x24 fn_803909F0 = .text:0x803909F0; // type:function size:0x8 fn_80390A00 = .text:0x80390A00; // type:function size:0x8 fn_80390A10 = .text:0x80390A10; // type:function size:0x8 -fn_80390A20 = .text:0x80390A20; // type:function size:0x108 -fn_80390B30 = .text:0x80390B30; // type:function size:0xA8 -fn_80390BE0 = .text:0x80390BE0; // type:function size:0x2F8 -fn_80390EE0 = .text:0x80390EE0; // type:function size:0xFC +__ct__23dSndSourceHarpRelated_cFlP9dAcBase_cPCcP17dSndSourceGroup_c = .text:0x80390A20; // type:function size:0x108 +__dt__23dSndSourceHarpRelated_cFv = .text:0x80390B30; // type:function size:0xA8 +postCalc__23dSndSourceHarpRelated_cFv = .text:0x80390BE0; // type:function size:0x2F8 +setPause__23dSndSourceHarpRelated_cFbi = .text:0x80390EE0; // type:function size:0xFC fn_80390FE0 = .text:0x80390FE0; // type:function size:0x5C -fn_80391040 = .text:0x80391040; // type:function size:0xA8 +d_s_harp_vt_0x1F0__23dSndSourceHarpRelated_cFv = .text:0x80391040; // type:function size:0xA8 fn_803910F0 = .text:0x803910F0; // type:function size:0x7C fn_80391170 = .text:0x80391170; // type:function size:0xA0 fn_80391210 = .text:0x80391210; // type:function size:0x84 fn_803912A0 = .text:0x803912A0; // type:function size:0xA4 -fn_80391350 = .text:0x80391350; // type:function size:0x58 +d_s_harp_vt_0x1F4__23dSndSourceHarpRelated_cFv = .text:0x80391350; // type:function size:0x58 fn_803913B0 = .text:0x803913B0; // type:function size:0xBC fn_80391470 = .text:0x80391470; // type:function size:0x174 fn_803915F0 = .text:0x803915F0; // type:function size:0x6C fn_80391660 = .text:0x80391660; // type:function size:0x44 fn_803916B0 = .text:0x803916B0; // type:function size:0x20C -fn_803918C0 = .text:0x803918C0; // type:function size:0x20 +d_s_harp_vt_0x1F8__23dSndSourceHarpRelated_cFv = .text:0x803918C0; // type:function size:0x20 fn_803918E0 = .text:0x803918E0; // type:function size:0x68 fn_80391950 = .text:0x80391950; // type:function size:0x134 fn_80391A90 = .text:0x80391A90; // type:function size:0x108 @@ -21400,7 +21400,7 @@ fn_80391BA0 = .text:0x80391BA0; // type:function size:0x160 fn_80391D00 = .text:0x80391D00; // type:function size:0x11C fn_80391E20 = .text:0x80391E20; // type:function size:0x4C fn_80391E70 = .text:0x80391E70; // type:function size:0x14 -fn_80391E90 = .text:0x80391E90; // type:function size:0xA8 +__ct__23dSndSourceHarpSwHarp4_cFlP9dAcBase_cPCcP17dSndSourceGroup_c = .text:0x80391E90; // type:function size:0xA8 fn_80391F40 = .text:0x80391F40; // type:function size:0xC fn_80391F50 = .text:0x80391F50; // type:function size:0x24C fn_803921A0 = .text:0x803921A0; // type:function size:0x198 @@ -21418,92 +21418,92 @@ fn_80392C90 = .text:0x80392C90; // type:function size:0x8 fn_80392CA0 = .text:0x80392CA0; // type:function size:0x58 fn_80392D00 = .text:0x80392D00; // type:function size:0x58 fn_80392D60 = .text:0x80392D60; // type:function size:0x58 -fn_80392DC0 = .text:0x80392DC0; // type:function size:0x8 -fn_80392DD0 = .text:0x80392DD0; // type:function size:0x8 +@88@__dt__23dSndSourceHarpRelated_cFv = .text:0x80392DC0; // type:function size:0x8 +@4@__dt__23dSndSourceHarpRelated_cFv = .text:0x80392DD0; // type:function size:0x8 fn_80392DE0 = .text:0x80392DE0; // type:function size:0x8 fn_80392DF0 = .text:0x80392DF0; // type:function size:0x8 fn_80392E00 = .text:0x80392E00; // type:function size:0x8 fn_80392E10 = .text:0x80392E10; // type:function size:0x8 fn_80392E20 = .text:0x80392E20; // type:function size:0x8 fn_80392E30 = .text:0x80392E30; // type:function size:0x8 -fn_80392E40 = .text:0x80392E40; // type:function size:0x54 -fn_80392EA0 = .text:0x80392EA0; // type:function size:0x74 -fn_80392F20 = .text:0x80392F20; // type:function size:0x28 -fn_80392F50 = .text:0x80392F50; // type:function size:0x30 -fn_80392F80 = .text:0x80392F80; // type:function size:0x4 -fn_80392F90 = .text:0x80392F90; // type:function size:0x58 -fn_80392FF0 = .text:0x80392FF0; // type:function size:0x8 -fn_80393000 = .text:0x80393000; // type:function size:0x8 -fn_80393010 = .text:0x80393010; // type:function size:0x98 -fn_803930B0 = .text:0x803930B0; // type:function size:0xD0 -fn_80393180 = .text:0x80393180; // type:function size:0x64 -fn_803931F0 = .text:0x803931F0; // type:function size:0xDC -fn_803932D0 = .text:0x803932D0; // type:function size:0x64 -fn_80393340 = .text:0x80393340; // type:function size:0xC8 -fn_80393410 = .text:0x80393410; // type:function size:0x64 -fn_80393480 = .text:0x80393480; // type:function size:0x28 -fn_803934B0 = .text:0x803934B0; // type:function size:0x78 -fn_80393530 = .text:0x80393530; // type:function size:0x48 -fn_80393580 = .text:0x80393580; // type:function size:0x10 -fn_80393590 = .text:0x80393590; // type:function size:0xA0 -fn_80393630 = .text:0x80393630; // type:function size:0x70 -fn_803936A0 = .text:0x803936A0; // type:function size:0x7C -fn_80393720 = .text:0x80393720; // type:function size:0xBC -fn_803937E0 = .text:0x803937E0; // type:function size:0x158 -fn_80393940 = .text:0x80393940; // type:function size:0x4C -fn_80393990 = .text:0x80393990; // type:function size:0x4C -fn_803939E0 = .text:0x803939E0; // type:function size:0x5C -fn_80393A40 = .text:0x80393A40; // type:function size:0xA0 -fn_80393AE0 = .text:0x80393AE0; // type:function size:0xA4 -fn_80393B90 = .text:0x80393B90; // type:function size:0x90 -fn_80393C20 = .text:0x80393C20; // type:function size:0x98 -fn_80393CC0 = .text:0x80393CC0; // type:function size:0x98 -fn_80393D60 = .text:0x80393D60; // type:function size:0x60 -fn_80393DC0 = .text:0x80393DC0; // type:function size:0x34 -fn_80393E00 = .text:0x80393E00; // type:function size:0x74 -fn_80393E80 = .text:0x80393E80; // type:function size:0xC -fn_80393E90 = .text:0x80393E90; // type:function size:0x54 -fn_80393EF0 = .text:0x80393EF0; // type:function size:0x18 -fn_80393F10 = .text:0x80393F10; // type:function size:0x28 -fn_80393F40 = .text:0x80393F40; // type:function size:0x20 -fn_80393F60 = .text:0x80393F60; // type:function size:0x20 -fn_80393F80 = .text:0x80393F80; // type:function size:0x98 -fn_80394020 = .text:0x80394020; // type:function size:0x90 -fn_803940B0 = .text:0x803940B0; // type:function size:0x38 -fn_803940F0 = .text:0x803940F0; // type:function size:0x58 -fn_80394150 = .text:0x80394150; // type:function size:0x6C -fn_803941C0 = .text:0x803941C0; // type:function size:0x10 -fn_803941D0 = .text:0x803941D0; // type:function size:0x24 -fn_80394200 = .text:0x80394200; // type:function size:0x8 -fn_80394210 = .text:0x80394210; // type:function size:0xA8 -fn_803942C0 = .text:0x803942C0; // type:function size:0x14 -fn_803942E0 = .text:0x803942E0; // type:function size:0x40 -fn_80394320 = .text:0x80394320; // type:function size:0x78 -fn_803943A0 = .text:0x803943A0; // type:function size:0x80 -fn_80394420 = .text:0x80394420; // type:function size:0x40 -fn_80394460 = .text:0x80394460; // type:function size:0x9C -fn_80394500 = .text:0x80394500; // type:function size:0xA8 -fn_803945B0 = .text:0x803945B0; // type:function size:0x78 -fn_80394630 = .text:0x80394630; // type:function size:0x1C -fn_80394650 = .text:0x80394650; // type:function size:0x1C -fn_80394670 = .text:0x80394670; // type:function size:0x44 -fn_803946C0 = .text:0x803946C0; // type:function size:0x4 -fn_803946D0 = .text:0x803946D0; // type:function size:0x54 -fn_80394730 = .text:0x80394730; // type:function size:0x3C -fn_80394770 = .text:0x80394770; // type:function size:0x3C -fn_803947B0 = .text:0x803947B0; // type:function size:0x78 -fn_80394830 = .text:0x80394830; // type:function size:0x4C -fn_80394880 = .text:0x80394880; // type:function size:0x10 -fn_80394890 = .text:0x80394890; // type:function size:0xFC -fn_80394990 = .text:0x80394990; // type:function size:0x58 -fn_803949F0 = .text:0x803949F0; // type:function size:0x58 -fn_80394A50 = .text:0x80394A50; // type:function size:0x98 -fn_80394AF0 = .text:0x80394AF0; // type:function size:0xCC -fn_80394BC0 = .text:0x80394BC0; // type:function size:0xCC -fn_80394C90 = .text:0x80394C90; // type:function size:0x9C -fn_80394D30 = .text:0x80394D30; // type:function size:0x68 -fn_80394DA0 = .text:0x80394DA0; // type:function size:0x14 -fn_80394DC0 = .text:0x80394DC0; // type:function size:0x14 +__ct__19dSndSourceTgSound_cFlP9dAcBase_cPCcP17dSndSourceGroup_c = .text:0x80392E40; // type:function size:0x54 +postSetup__19dSndSourceTgSound_cFv = .text:0x80392EA0; // type:function size:0x74 +setTgActive__19dSndSourceTgSound_cFb = .text:0x80392F20; // type:function size:0x28 +postCalc__19dSndSourceTgSound_cFv = .text:0x80392F50; // type:function size:0x30 +preCalc__19dSndSourceTgSound_cFv = .text:0x80392F80; // type:function size:0x4 scope:weak +__dt__19dSndSourceTgSound_cFv = .text:0x80392F90; // type:function size:0x58 scope:weak +@88@__dt__19dSndSourceTgSound_cFv = .text:0x80392FF0; // type:function size:0x8 scope:weak +@4@__dt__19dSndSourceTgSound_cFv = .text:0x80393000; // type:function size:0x8 scope:weak +getBaseVariant__FPCc = .text:0x80393010; // type:function size:0x98 +getGrpId__FlPCc = .text:0x803930B0; // type:function size:0xD0 +getGrpId__FP17dSndSourceGroup_c = .text:0x80393180; // type:function size:0x64 +getBnkSeId__FlPCc = .text:0x803931F0; // type:function size:0xDC +getBnkSeId__FP17dSndSourceGroup_c = .text:0x803932D0; // type:function size:0x64 +getSeId__FlPCc = .text:0x80393340; // type:function size:0xC8 +getSeId__FP17dSndSourceGroup_c = .text:0x80393410; // type:function size:0x64 +getHitEffectName__FUl = .text:0x80393480; // type:function size:0x28 +__dt__45SndMgrDisposer<27dSndDistantSoundActorPool_c>Fv = .text:0x803934B0; // type:function size:0x78 scope:weak +create__45SndMgrDisposer<27dSndDistantSoundActorPool_c>Fv = .text:0x80393530; // type:function size:0x48 scope:weak +remove__45SndMgrDisposer<27dSndDistantSoundActorPool_c>Fv = .text:0x80393580; // type:function size:0x10 scope:weak +__ct__27dSndDistantSoundActorPool_cFv = .text:0x80393590; // type:function size:0xA0 +__dt__23dSndDistantSoundActor_cFv = .text:0x80393630; // type:function size:0x70 scope:weak +setup__27dSndDistantSoundActorPool_cFv = .text:0x803936A0; // type:function size:0x7C +calc__27dSndDistantSoundActorPool_cFv = .text:0x80393720; // type:function size:0xBC +acquireActor__27dSndDistantSoundActorPool_cFUlPCQ34nw4r4math4VEC3P14dSoundSource_c = .text:0x803937E0; // type:function size:0x158 +addToActiveList__27dSndDistantSoundActorPool_cFP23dSndDistantSoundActor_cUl = .text:0x80393940; // type:function size:0x4C +removeFromActiveList__27dSndDistantSoundActorPool_cFP23dSndDistantSoundActor_c = .text:0x80393990; // type:function size:0x4C +startSound__27dSndDistantSoundActorPool_cFUlPCQ34nw4r4math4VEC3 = .text:0x803939E0; // type:function size:0x5C +findActiveActor__27dSndDistantSoundActorPool_cFUlP14dSoundSource_c = .text:0x80393A40; // type:function size:0xA0 +holdSound__27dSndDistantSoundActorPool_cFUlPCQ34nw4r4math4VEC3 = .text:0x80393AE0; // type:function size:0xA4 +setAllPause__27dSndDistantSoundActorPool_cFbl = .text:0x80393B90; // type:function size:0x90 +disableAll__27dSndDistantSoundActorPool_cFv = .text:0x80393C20; // type:function size:0x98 +enableAll__27dSndDistantSoundActorPool_cFv = .text:0x80393CC0; // type:function size:0x98 +onChangeStage__27dSndDistantSoundActorPool_cFv = .text:0x80393D60; // type:function size:0x60 +__sinit_\d_snd_distant_sound_actor_pool_cpp = .text:0x80393DC0; // type:function size:0x34 scope:local +__ct__23dSndDistantSoundActor_cFv = .text:0x80393E00; // type:function size:0x74 +getSourceParam__27dSndDistantSoundActorPool_cFv = .text:0x80393E80; // type:function size:0xC scope:weak +initSource__23dSndDistantSoundActor_cFP14dSoundSource_c = .text:0x80393E90; // type:function size:0x54 +setSourceDirectly__23dSndDistantSoundActor_cFP14dSoundSource_c = .text:0x80393EF0; // type:function size:0x18 +updatePosition__23dSndDistantSoundActor_cFv = .text:0x80393F10; // type:function size:0x28 +postStartSound__23dSndDistantSoundActor_cFRQ34nw4r3snd11SoundHandleP13dSndSeSound_cUl = .text:0x80393F40; // type:function size:0x20 +postHoldSound__23dSndDistantSoundActor_cFRQ34nw4r3snd11SoundHandleP13dSndSeSound_cUli = .text:0x80393F60; // type:function size:0x20 +startSound__23dSndDistantSoundActor_cFUlRCQ34nw4r4math4VEC3PQ34nw4r3snd11SoundHandle = .text:0x80393F80; // type:function size:0x98 +holdSound__23dSndDistantSoundActor_cFUlRCQ34nw4r4math4VEC3PQ34nw4r3snd11SoundHandle = .text:0x80394020; // type:function size:0x90 +loadDefaultParam__23dSndDistantSoundActor_cFv = .text:0x803940B0; // type:function size:0x38 +detachFromSource__23dSndDistantSoundActor_cFv = .text:0x803940F0; // type:function size:0x58 +setPause__23dSndDistantSoundActor_cFbi = .text:0x80394150; // type:function size:0x6C +updateSome3DField__23dSndDistantSoundActor_cFv = .text:0x803941C0; // type:function size:0x10 +d_vt_0x3C__23dSndDistantSoundActor_cFv = .text:0x803941D0; // type:function size:0x24 +@84@__dt__23dSndDistantSoundActor_cFv = .text:0x80394200; // type:function size:0x8 scope:weak +__ct__13dSndSeSound_cFv = .text:0x80394210; // type:function size:0xA8 +__ct__17dSndSoundCtxParamFv = .text:0x803942C0; // type:function size:0x14 scope:weak +__dt__17dSndSoundCtxParamFv = .text:0x803942E0; // type:function size:0x40 scope:weak +__dt__13dSndSeSound_cFv = .text:0x80394320; // type:function size:0x78 +setSource__13dSndSeSound_cFP14dSoundSource_cUl = .text:0x803943A0; // type:function size:0x80 +clear__13dSndSeSound_cFv = .text:0x80394420; // type:function size:0x40 +calc__13dSndSeSound_cFP14dSoundSource_c = .text:0x80394460; // type:function size:0x9C +shiftParam__13dSndSeSound_cFPC17dSndSoundCtxParam = .text:0x80394500; // type:function size:0xA8 +shiftFloatParam__13dSndSeSound_cFf = .text:0x803945B0; // type:function size:0x78 +onStart__13dSndSeSound_cFP14dSoundSource_c = .text:0x80394630; // type:function size:0x1C +onCalc__13dSndSeSound_cFP14dSoundSource_c = .text:0x80394650; // type:function size:0x1C +__ct__14dSndSeSound1_cFv = .text:0x80394670; // type:function size:0x44 +setSource__14dSndSeSound1_cFP14dSoundSource_cUl = .text:0x803946C0; // type:function size:0x4 +__ct__14dSndSeSound2_cFv = .text:0x803946D0; // type:function size:0x54 +setSource__14dSndSeSound2_cFP14dSoundSource_cUl = .text:0x80394730; // type:function size:0x3C +calcTimer__14dSndSeSound2_cFv = .text:0x80394770; // type:function size:0x3C +__dt__35SndMgrDisposer<17dSndSeSoundPool_c>Fv = .text:0x803947B0; // type:function size:0x78 scope:weak +create__35SndMgrDisposer<17dSndSeSoundPool_c>Fv = .text:0x80394830; // type:function size:0x4C scope:weak +remove__35SndMgrDisposer<17dSndSeSoundPool_c>Fv = .text:0x80394880; // type:function size:0x10 scope:weak +__ct__17dSndSeSoundPool_cFv = .text:0x80394890; // type:function size:0xFC +__dt__14dSndSeSound1_cFv = .text:0x80394990; // type:function size:0x58 scope:weak +__dt__14dSndSeSound2_cFv = .text:0x803949F0; // type:function size:0x58 scope:weak +calc__17dSndSeSoundPool_cFv = .text:0x80394A50; // type:function size:0x98 +acquireSoundType1__17dSndSeSoundPool_cFP14dSoundSource_cUl = .text:0x80394AF0; // type:function size:0xCC +acquireSoundType2__17dSndSeSoundPool_cFP14dSoundSource_cUl = .text:0x80394BC0; // type:function size:0xCC +releaseSoundType1__17dSndSeSoundPool_cFP14dSndSeSound1_cb = .text:0x80394C90; // type:function size:0x9C +releaseSoundType2__17dSndSeSoundPool_cFP14dSndSeSound2_c = .text:0x80394D30; // type:function size:0x68 +removeSoundType1__17dSndSeSoundPool_cFP14dSndSeSound1_c = .text:0x80394DA0; // type:function size:0x14 +removeSoundType2__17dSndSeSoundPool_cFP14dSndSeSound2_c = .text:0x80394DC0; // type:function size:0x14 fn_80394DE0 = .text:0x80394DE0; // type:function size:0xD0 fn_80394EB0 = .text:0x80394EB0; // type:function size:0xF8 fn_80394FB0 = .text:0x80394FB0; // type:function size:0x1A8 @@ -21529,7 +21529,7 @@ fn_80395D10 = .text:0x80395D10; // type:function size:0x5C fn_80395D70 = .text:0x80395D70; // type:function size:0xB4 fn_80395E30 = .text:0x80395E30; // type:function size:0xA0 fn_80395ED0 = .text:0x80395ED0; // type:function size:0x84 -fn_80395F60 = .text:0x80395F60; // type:function size:0x1A4 +postSetupSound__17dSndSourceEnemy_cFUlUlP13dSndSeSound_c = .text:0x80395F60; // type:function size:0x1A4 fn_80396110 = .text:0x80396110; // type:function size:0x4C fn_80396160 = .text:0x80396160; // type:function size:0x64 fn_803961D0 = .text:0x803961D0; // type:function size:0x64 @@ -21579,26 +21579,26 @@ fn_80397BF0 = .text:0x80397BF0; // type:function size:0x4 fn_80397C00 = .text:0x80397C00; // type:function size:0x60 fn_80397C60 = .text:0x80397C60; // type:function size:0xD8 fn_80397D40 = .text:0x80397D40; // type:function size:0x138 -fn_80397E80 = .text:0x80397E80; // type:function size:0x5B0 -fn_80398430 = .text:0x80398430; // type:function size:0xC8 -fn_80398500 = .text:0x80398500; // type:function size:0x158 -fn_80398660 = .text:0x80398660; // type:function size:0x74 -fn_803986E0 = .text:0x803986E0; // type:function size:0x68 -fn_80398750 = .text:0x80398750; // type:function size:0x184 -fn_803988E0 = .text:0x803988E0; // type:function size:0x15C -fn_80398A40 = .text:0x80398A40; // type:function size:0x94 +postSetupSound__15dSndSourceObj_cFUlUlP13dSndSeSound_c = .text:0x80397E80; // type:function size:0x5B0 +cbBeFlyLv__21dSndSourceEquipment_cFP13dSndSeSound_cP14dSoundSource_cRQ34nw4r3snd11SoundHandle = .text:0x80398430; // type:function size:0xC8 +cbBeThrowRc__21dSndSourceEquipment_cFP13dSndSeSound_cP14dSoundSource_cRQ34nw4r3snd11SoundHandle = .text:0x80398500; // type:function size:0x158 +cbBmIgnitionLv__21dSndSourceEquipment_cFP13dSndSeSound_cP14dSoundSource_cRQ34nw4r3snd11SoundHandle = .text:0x80398660; // type:function size:0x74 +cbBmBound__21dSndSourceEquipment_cFP13dSndSeSound_cP14dSoundSource_cRQ34nw4r3snd11SoundHandle = .text:0x803986E0; // type:function size:0x68 +cbWiFxLv__21dSndSourceEquipment_cFP13dSndSeSound_cP14dSoundSource_cRQ34nw4r3snd11SoundHandle = .text:0x80398750; // type:function size:0x184 +cbPcHit__21dSndSourceEquipment_cFP13dSndSeSound_cP14dSoundSource_cRQ34nw4r3snd11SoundHandle = .text:0x803988E0; // type:function size:0x15C +postSetupSound__21dSndSourceEquipment_cFUlUlP13dSndSeSound_c = .text:0x80398A40; // type:function size:0x94 fn_80398AE0 = .text:0x80398AE0; // type:function size:0xC4 fn_80398BB0 = .text:0x80398BB0; // type:function size:0xCC fn_80398C80 = .text:0x80398C80; // type:function size:0x68 -fn_80398CF0 = .text:0x80398CF0; // type:function size:0x80 -fn_80398D70 = .text:0x80398D70; // type:function size:0x64 -fn_80398DE0 = .text:0x80398DE0; // type:function size:0x18 -fn_80398E00 = .text:0x80398E00; // type:function size:0x8 -fn_80398E10 = .text:0x80398E10; // type:function size:0x8 +cbPyBirdGlide__18dSndSourcePyBird_cFP13dSndSeSound_cP14dSoundSource_cRQ34nw4r3snd11SoundHandle = .text:0x80398CF0; // type:function size:0x80 +postSetupSound__15dSndSourceNpc_cFUlUlP13dSndSeSound_c = .text:0x80398D70; // type:function size:0x64 +postSetupSound__18dSndSourcePyBird_cFUlUlP13dSndSeSound_c = .text:0x80398DE0; // type:function size:0x18 +@88@__dt__15dSndSourceNpc_cFv = .text:0x80398E00; // type:function size:0x8 +@4@__dt__15dSndSourceNpc_cFv = .text:0x80398E10; // type:function size:0x8 fn_80398E20 = .text:0x80398E20; // type:function size:0x4C fn_80398E70 = .text:0x80398E70; // type:function size:0x84 fn_80398F00 = .text:0x80398F00; // type:function size:0x5C -fn_80398F60 = .text:0x80398F60; // type:function size:0x9C +postSetupSound__19dSndSourceNpcHead_cFUlUlP13dSndSeSound_c = .text:0x80398F60; // type:function size:0x9C fn_80399000 = .text:0x80399000; // type:function size:0x28 fn_80399030 = .text:0x80399030; // type:function size:0x5C fn_80399090 = .text:0x80399090; // type:function size:0x84 @@ -21606,57 +21606,57 @@ fn_80399120 = .text:0x80399120; // type:function size:0x58 fn_80399180 = .text:0x80399180; // type:function size:0xB0 fn_80399230 = .text:0x80399230; // type:function size:0xA0 fn_803992D0 = .text:0x803992D0; // type:function size:0xA8 -fn_80399380 = .text:0x80399380; // type:function size:0xAC -fn_80399430 = .text:0x80399430; // type:function size:0x3C -fn_80399470 = .text:0x80399470; // type:function size:0x6C -fn_803994E0 = .text:0x803994E0; // type:function size:0x78 -fn_80399560 = .text:0x80399560; // type:function size:0x14 -fn_80399580 = .text:0x80399580; // type:function size:0x78 -fn_80399600 = .text:0x80399600; // type:function size:0x48 -fn_80399650 = .text:0x80399650; // type:function size:0x10 -fn_80399660 = .text:0x80399660; // type:function size:0x44 -fn_803996B0 = .text:0x803996B0; // type:function size:0x1EC -fn_803998A0 = .text:0x803998A0; // type:function size:0x4 -fn_803998B0 = .text:0x803998B0; // type:function size:0x120 -fn_803999D0 = .text:0x803999D0; // type:function size:0x6C -fn_80399A40 = .text:0x80399A40; // type:function size:0x50 -fn_80399A90 = .text:0x80399A90; // type:function size:0x44 -fn_80399AE0 = .text:0x80399AE0; // type:function size:0x5C -fn_80399B40 = .text:0x80399B40; // type:function size:0x60 -__dt__32SndMgrDisposer<14SndMgr80399c20>Fv = .text:0x80399BA0; // type:function size:0x78 -create__32SndMgrDisposer<14SndMgr80399c20>Fv = .text:0x80399C20; // type:function size:0x84 -remove__32SndMgrDisposer<14SndMgr80399c20>Fv = .text:0x80399CB0; // type:function size:0x10 -fn_80399CC0 = .text:0x80399CC0; // type:function size:0x34 -__dt__14SndMgr80399c20Fv = .text:0x80399D00; // type:function size:0x5C -fn_80399D60 = .text:0x80399D60; // type:function size:0x44 -fn_80399DB0 = .text:0x80399DB0; // type:function size:0x34 -fn_80399DF0 = .text:0x80399DF0; // type:function size:0x15C -fn_80399F50 = .text:0x80399F50; // type:function size:0xAC -fn_8039A000 = .text:0x8039A000; // type:function size:0x54 -fn_8039A060 = .text:0x8039A060; // type:function size:0xC4 -fn_8039A130 = .text:0x8039A130; // type:function size:0xB4 -fn_8039A1F0 = .text:0x8039A1F0; // type:function size:0x10 -fn_8039A200 = .text:0x8039A200; // type:function size:0x4 -fn_8039A210 = .text:0x8039A210; // type:function size:0x44 -fn_8039A260 = .text:0x8039A260; // type:function size:0x44 -fn_8039A2B0 = .text:0x8039A2B0; // type:function size:0x44 -fn_8039A300 = .text:0x8039A300; // type:function size:0x44 -fn_8039A350 = .text:0x8039A350; // type:function size:0x40 -fn_8039A390 = .text:0x8039A390; // type:function size:0xB0 -fn_8039A440 = .text:0x8039A440; // type:function size:0x40 -fn_8039A480 = .text:0x8039A480; // type:function size:0xCC -fn_8039A550 = .text:0x8039A550; // type:function size:0x6C -fn_8039A5C0 = .text:0x8039A5C0; // type:function size:0x88 -fn_8039A650 = .text:0x8039A650; // type:function size:0x88 -fn_8039A6E0 = .text:0x8039A6E0; // type:function size:0x4C -fn_8039A730 = .text:0x8039A730; // type:function size:0x4C -fn_8039A780 = .text:0x8039A780; // type:function size:0x28 -fn_8039A7B0 = .text:0x8039A7B0; // type:function size:0x28 -fn_8039A7E0 = .text:0x8039A7E0; // type:function size:0x38 -fn_8039A820 = .text:0x8039A820; // type:function size:0x8 -fn_8039A830 = .text:0x8039A830; // type:function size:0x8 -fn_8039A840 = .text:0x8039A840; // type:function size:0x8 -pitchScaleForPitchIdx = .text:0x8039A850; // type:function size:0x2C +postSetupSound__19dSndSourceTgSound_cFUlUlP13dSndSeSound_c = .text:0x80399380; // type:function size:0xAC +__ct__18dSndRngLinkVoice_cFv = .text:0x80399430; // type:function size:0x3C +configure__18dSndRngLinkVoice_cFPC19dSndLinkVoiceConfigP22dSndSourcePlayerHead_c = .text:0x80399470; // type:function size:0x6C +handleId__18dSndRngLinkVoice_cFUl = .text:0x803994E0; // type:function size:0x78 +getConfig__18dSndRngLinkVoice_cFl = .text:0x80399560; // type:function size:0x14 +__dt__34SndMgrDisposer<16dSndFiVocalMgr_c>Fv = .text:0x80399580; // type:function size:0x78 +create__34SndMgrDisposer<16dSndFiVocalMgr_c>Fv = .text:0x80399600; // type:function size:0x48 +remove__34SndMgrDisposer<16dSndFiVocalMgr_c>Fv = .text:0x80399650; // type:function size:0x10 +__ct__16dSndFiVocalMgr_cFv = .text:0x80399660; // type:function size:0x44 +fiSpeak__16dSndFiVocalMgr_cFPCcUsl = .text:0x803996B0; // type:function size:0x1EC +executeOutputText__16dSndFiVocalMgr_cFUsUs = .text:0x803998A0; // type:function size:0x4 +startFiVocal__16dSndFiVocalMgr_cFss = .text:0x803998B0; // type:function size:0x120 +getStaticSongValue__16dSndFiVocalMgr_cFlUlll = .text:0x803999D0; // type:function size:0x6C +__ct__9dSndRng_cFv = .text:0x80399A40; // type:function size:0x50 +init__9dSndRng_cFv = .text:0x80399A90; // type:function size:0x44 +rndInt__9dSndRng_cFl = .text:0x80399AE0; // type:function size:0x5C +rndBool__9dSndRng_cFl = .text:0x80399B40; // type:function size:0x60 +__dt__30SndMgrDisposer<12dSndRngMgr_c>Fv = .text:0x80399BA0; // type:function size:0x78 scope:weak +create__30SndMgrDisposer<12dSndRngMgr_c>Fv = .text:0x80399C20; // type:function size:0x84 scope:weak +remove__30SndMgrDisposer<12dSndRngMgr_c>Fv = .text:0x80399CB0; // type:function size:0x10 scope:weak +rndIntRange__12dSndRngMgr_cFll = .text:0x80399CC0; // type:function size:0x34 +__dt__12dSndRngMgr_cFv = .text:0x80399D00; // type:function size:0x5C scope:weak +__ct__11dSndRngId_cFv = .text:0x80399D60; // type:function size:0x44 +configure__11dSndRngId_cFUlUlUc = .text:0x80399DB0; // type:function size:0x34 +rndIdNoReuse__11dSndRngId_cFv = .text:0x80399DF0; // type:function size:0x15C +nextIdNoReuse__11dSndRngId_cFv = .text:0x80399F50; // type:function size:0xAC +rndId__11dSndRngId_cFv = .text:0x8039A000; // type:function size:0x54 +rndIdNotSame__11dSndRngId_cFv = .text:0x8039A060; // type:function size:0xC4 +markPicked__11dSndRngId_cFUlb = .text:0x8039A130; // type:function size:0xB4 +resetPicked__11dSndRngId_cFv = .text:0x8039A1F0; // type:function size:0x10 +rndInt__11dSndRngId_cFl = .text:0x8039A200; // type:function size:0x4 +doNextIdNoReuse__13dSndRngIdIf_cFv = .text:0x8039A210; // type:function size:0x44 +doRndId__13dSndRngIdIf_cFv = .text:0x8039A260; // type:function size:0x44 +doRndIdNoReuse__13dSndRngIdIf_cFv = .text:0x8039A2B0; // type:function size:0x44 +doRndIdNotSame__13dSndRngIdIf_cFv = .text:0x8039A300; // type:function size:0x44 +__dt__15dSndFileManagerFv = .text:0x8039A350; // type:function size:0x40 scope:weak +create__15dSndFileManagerFPQ34nw4r3snd12SoundArchivePQ34nw4r3snd9SoundHeap = .text:0x8039A390; // type:function size:0xB0 +clearGlob__15dSndFileManagerFv = .text:0x8039A440; // type:function size:0x40 +loadFileForSound__15dSndFileManagerFRCQ34nw4r3snd12SoundArchiveUlPQ34nw4r3snd9SoundHeap = .text:0x8039A480; // type:function size:0xCC +isLoadedFileForSound__15dSndFileManagerFPQ34nw4r3snd18SoundArchivePlayerUl = .text:0x8039A550; // type:function size:0x6C +isLoadedFileAndWaveForBank__15dSndFileManagerFPQ34nw4r3snd18SoundArchivePlayerUl = .text:0x8039A5C0; // type:function size:0x88 +isLoadedFileAndWaveForSound__15dSndFileManagerFPQ34nw4r3snd18SoundArchivePlayerUl = .text:0x8039A650; // type:function size:0x88 +InvalidateData__15dSndFileManagerFPCvPCv = .text:0x8039A6E0; // type:function size:0x4C +InvalidateWaveData__15dSndFileManagerFPCvPCv = .text:0x8039A730; // type:function size:0x4C +GetFileWaveDataAddress__15dSndFileManagerFUl = .text:0x8039A780; // type:function size:0x28 +GetFileAddress__15dSndFileManagerFUl = .text:0x8039A7B0; // type:function size:0x28 +__sinit_\d_snd_file_mgr_cpp = .text:0x8039A7E0; // type:function size:0x38 scope:local +@4@InvalidateWaveData__15dSndFileManagerFPCvPCv = .text:0x8039A820; // type:function size:0x8 scope:weak +@4@InvalidateData__15dSndFileManagerFPCvPCv = .text:0x8039A830; // type:function size:0x8 scope:weak +@4@__dt__15dSndFileManagerFv = .text:0x8039A840; // type:function size:0x8 scope:weak +pitchScaleForPitchIdx__Fl = .text:0x8039A850; // type:function size:0x2C pitchScaleForPitchIdxTenths__Ff = .text:0x8039A880; // type:function size:0x58 pitchIdxTenthsForPitchScale__Ff = .text:0x8039A8E0; // type:function size:0x80 KPRInitRegionUS = .text:0x8039A960; // type:function size:0x10 @@ -26858,9 +26858,9 @@ exit__Q33EGG12AudioUtility3HBMFb = .text:0x804B70E0; // type:function size:0x120 __sinit_\eggAudioUtility_cpp = .text:0x804B7200; // type:function size:0xC scope:local __ct__Q23EGG11AudioSystemFv = .text:0x804B7210; // type:function size:0x1C __dt__Q23EGG11AudioSystemFv = .text:0x804B7230; // type:function size:0x40 -fn_804B7270__Q23EGG11AudioSystemFl = .text:0x804B7270; // type:function size:0xF8 -fn_804B7370__Q23EGG11AudioSystemFv = .text:0x804B7370; // type:function size:0x60 -fn_804B73D0__Q23EGG11AudioSystemFl = .text:0x804B73D0; // type:function size:0x78 +reset__Q23EGG11AudioSystemFl = .text:0x804B7270; // type:function size:0xF8 +recoverReset__Q23EGG11AudioSystemFv = .text:0x804B7370; // type:function size:0x60 +shutdown__Q23EGG11AudioSystemFl = .text:0x804B73D0; // type:function size:0x78 calc__Q23EGG11AudioSystemFv = .text:0x804B7450; // type:function size:0xF4 ExceptionWaitTime__Q23EGG9ExceptionFUl = .text:0x804B7550; // type:function size:0x78 ExceptionCallback__Q23EGG9ExceptionFPQ44nw4r2db6detail11ConsoleHeadPv = .text:0x804B75D0; // type:function size:0x58 @@ -28855,65 +28855,65 @@ lbl_804F0CC8 = .rodata:0x804F0CC8; // type:object size:0x10 lbl_804F0CD8 = .rodata:0x804F0CD8; // type:object size:0x18 lbl_804F0CF0 = .rodata:0x804F0CF0; // type:object size:0x10 data:string lbl_804F0D00 = .rodata:0x804F0D00; // type:object size:0x80 data:4byte -lbl_804F0D80 = .rodata:0x804F0D80; // type:object size:0xC -lbl_804F0D8C = .rodata:0x804F0D8C; // type:object size:0xC -lbl_804F0D98 = .rodata:0x804F0D98; // type:object size:0xC -lbl_804F0DA4 = .rodata:0x804F0DA4; // type:object size:0xC -lbl_804F0DB0 = .rodata:0x804F0DB0; // type:object size:0xC -lbl_804F0DBC = .rodata:0x804F0DBC; // type:object size:0xC -lbl_804F0DC8 = .rodata:0x804F0DC8; // type:object size:0xC -lbl_804F0DD4 = .rodata:0x804F0DD4; // type:object size:0xC -lbl_804F0DE0 = .rodata:0x804F0DE0; // type:object size:0xC -lbl_804F0DEC = .rodata:0x804F0DEC; // type:object size:0xC -lbl_804F0DF8 = .rodata:0x804F0DF8; // type:object size:0xC -lbl_804F0E04 = .rodata:0x804F0E04; // type:object size:0xC -lbl_804F0E10 = .rodata:0x804F0E10; // type:object size:0xC -lbl_804F0E1C = .rodata:0x804F0E1C; // type:object size:0xC -lbl_804F0E28 = .rodata:0x804F0E28; // type:object size:0xC -lbl_804F0E34 = .rodata:0x804F0E34; // type:object size:0xC -lbl_804F0E40 = .rodata:0x804F0E40; // type:object size:0xC -lbl_804F0E4C = .rodata:0x804F0E4C; // type:object size:0xC -lbl_804F0E58 = .rodata:0x804F0E58; // type:object size:0xC -lbl_804F0E64 = .rodata:0x804F0E64; // type:object size:0xC -lbl_804F0E70 = .rodata:0x804F0E70; // type:object size:0xC -lbl_804F0E7C = .rodata:0x804F0E7C; // type:object size:0xC -lbl_804F0E88 = .rodata:0x804F0E88; // type:object size:0xC -lbl_804F0E94 = .rodata:0x804F0E94; // type:object size:0xC -lbl_804F0EA0 = .rodata:0x804F0EA0; // type:object size:0xC -lbl_804F0EAC = .rodata:0x804F0EAC; // type:object size:0xC -lbl_804F0EB8 = .rodata:0x804F0EB8; // type:object size:0xC -lbl_804F0EC4 = .rodata:0x804F0EC4; // type:object size:0xC -lbl_804F0ED0 = .rodata:0x804F0ED0; // type:object size:0xC -lbl_804F0EDC = .rodata:0x804F0EDC; // type:object size:0xC -lbl_804F0EE8 = .rodata:0x804F0EE8; // type:object size:0xC -lbl_804F0EF4 = .rodata:0x804F0EF4; // type:object size:0xC -lbl_804F0F00 = .rodata:0x804F0F00; // type:object size:0xC -lbl_804F0F0C = .rodata:0x804F0F0C; // type:object size:0xC -lbl_804F0F18 = .rodata:0x804F0F18; // type:object size:0xC -lbl_804F0F24 = .rodata:0x804F0F24; // type:object size:0xC -lbl_804F0F30 = .rodata:0x804F0F30; // type:object size:0xC -lbl_804F0F3C = .rodata:0x804F0F3C; // type:object size:0xC -lbl_804F0F48 = .rodata:0x804F0F48; // type:object size:0xC -lbl_804F0F54 = .rodata:0x804F0F54; // type:object size:0xC -lbl_804F0F60 = .rodata:0x804F0F60; // type:object size:0xC -lbl_804F0F6C = .rodata:0x804F0F6C; // type:object size:0xC -lbl_804F0F78 = .rodata:0x804F0F78; // type:object size:0xC -lbl_804F0F84 = .rodata:0x804F0F84; // type:object size:0xC -lbl_804F0F90 = .rodata:0x804F0F90; // type:object size:0xC -lbl_804F0F9C = .rodata:0x804F0F9C; // type:object size:0xC -lbl_804F0FA8 = .rodata:0x804F0FA8; // type:object size:0xC -lbl_804F0FB4 = .rodata:0x804F0FB4; // type:object size:0xC -lbl_804F0FC0 = .rodata:0x804F0FC0; // type:object size:0xC -lbl_804F0FCC = .rodata:0x804F0FCC; // type:object size:0xC -lbl_804F0FD8 = .rodata:0x804F0FD8; // type:object size:0xC -lbl_804F0FE4 = .rodata:0x804F0FE4; // type:object size:0xC -lbl_804F0FF0 = .rodata:0x804F0FF0; // type:object size:0xC -lbl_804F0FFC = .rodata:0x804F0FFC; // type:object size:0xC -lbl_804F1008 = .rodata:0x804F1008; // type:object size:0xC -lbl_804F1014 = .rodata:0x804F1014; // type:object size:0xC -lbl_804F1020 = .rodata:0x804F1020; // type:object size:0xC -lbl_804F102C = .rodata:0x804F102C; // type:object size:0xC -STAGE_MUSIC_RELATED = .rodata:0x804F1038; // type:object size:0x12D0 data:4byte +@16 = .rodata:0x804F0D80; // type:object size:0xA scope:local data:string +@26 = .rodata:0x804F0D8C; // type:object size:0xA scope:local data:string +@35 = .rodata:0x804F0D98; // type:object size:0xA scope:local data:string +@37 = .rodata:0x804F0DA4; // type:object size:0xA scope:local data:string +@39 = .rodata:0x804F0DB0; // type:object size:0xA scope:local data:string +@40 = .rodata:0x804F0DBC; // type:object size:0xA scope:local data:string +@41 = .rodata:0x804F0DC8; // type:object size:0xA scope:local data:string +@43 = .rodata:0x804F0DD4; // type:object size:0xA scope:local data:string +@44 = .rodata:0x804F0DE0; // type:object size:0xA scope:local data:string +@45 = .rodata:0x804F0DEC; // type:object size:0xA scope:local data:string +@46 = .rodata:0x804F0DF8; // type:object size:0xA scope:local data:string +@48 = .rodata:0x804F0E04; // type:object size:0xA scope:local data:string +@50 = .rodata:0x804F0E10; // type:object size:0xA scope:local data:string +@51 = .rodata:0x804F0E1C; // type:object size:0xA scope:local data:string +@72 = .rodata:0x804F0E28; // type:object size:0xA scope:local data:string +@74 = .rodata:0x804F0E34; // type:object size:0xA scope:local data:string +@77 = .rodata:0x804F0E40; // type:object size:0xA scope:local data:string +@80 = .rodata:0x804F0E4C; // type:object size:0xA scope:local data:string +@81 = .rodata:0x804F0E58; // type:object size:0xA scope:local data:string +@83 = .rodata:0x804F0E64; // type:object size:0xA scope:local data:string +@85 = .rodata:0x804F0E70; // type:object size:0xA scope:local data:string +@88 = .rodata:0x804F0E7C; // type:object size:0xA scope:local data:string +@91 = .rodata:0x804F0E88; // type:object size:0xA scope:local data:string +@92 = .rodata:0x804F0E94; // type:object size:0xA scope:local data:string +@97 = .rodata:0x804F0EA0; // type:object size:0xA scope:local data:string +@98 = .rodata:0x804F0EAC; // type:object size:0xA scope:local data:string +@102 = .rodata:0x804F0EB8; // type:object size:0xA scope:local data:string +@117 = .rodata:0x804F0EC4; // type:object size:0xA scope:local data:string +@119 = .rodata:0x804F0ED0; // type:object size:0xA scope:local data:string +@121 = .rodata:0x804F0EDC; // type:object size:0xA scope:local data:string +@122 = .rodata:0x804F0EE8; // type:object size:0xA scope:local data:string +@123 = .rodata:0x804F0EF4; // type:object size:0xA scope:local data:string +@124 = .rodata:0x804F0F00; // type:object size:0xA scope:local data:string +@125 = .rodata:0x804F0F0C; // type:object size:0xA scope:local data:string +@126 = .rodata:0x804F0F18; // type:object size:0xA scope:local data:string +@127 = .rodata:0x804F0F24; // type:object size:0xA scope:local data:string +@128 = .rodata:0x804F0F30; // type:object size:0xA scope:local data:string +@129 = .rodata:0x804F0F3C; // type:object size:0xA scope:local data:string +@130 = .rodata:0x804F0F48; // type:object size:0xA scope:local data:string +@131 = .rodata:0x804F0F54; // type:object size:0xA scope:local data:string +@134 = .rodata:0x804F0F60; // type:object size:0xA scope:local data:string +@135 = .rodata:0x804F0F6C; // type:object size:0xA scope:local data:string +@136 = .rodata:0x804F0F78; // type:object size:0xA scope:local data:string +@153 = .rodata:0x804F0F84; // type:object size:0xA scope:local data:string +@154 = .rodata:0x804F0F90; // type:object size:0xA scope:local data:string +@155 = .rodata:0x804F0F9C; // type:object size:0xA scope:local data:string +@157 = .rodata:0x804F0FA8; // type:object size:0xA scope:local data:string +@158 = .rodata:0x804F0FB4; // type:object size:0xA scope:local data:string +@160 = .rodata:0x804F0FC0; // type:object size:0xA scope:local data:string +@161 = .rodata:0x804F0FCC; // type:object size:0xA scope:local data:string +@162 = .rodata:0x804F0FD8; // type:object size:0xA scope:local data:string +@164 = .rodata:0x804F0FE4; // type:object size:0xA scope:local data:string +@165 = .rodata:0x804F0FF0; // type:object size:0xA scope:local data:string +@166 = .rodata:0x804F0FFC; // type:object size:0xA scope:local data:string +@168 = .rodata:0x804F1008; // type:object size:0xA scope:local data:string +@169 = .rodata:0x804F1014; // type:object size:0xA scope:local data:string +@170 = .rodata:0x804F1020; // type:object size:0xA scope:local data:string +@172 = .rodata:0x804F102C; // type:object size:0xA scope:local data:string +sInfos__13dSndStageInfo = .rodata:0x804F1038; // type:object size:0x12D0 data:4byte lbl_804F2308 = .rodata:0x804F2308; // type:object size:0x10 lbl_804F2318 = .rodata:0x804F2318; // type:object size:0x10 lbl_804F2328 = .rodata:0x804F2328; // type:object size:0x10 @@ -28974,35 +28974,43 @@ lbl_804F2684 = .rodata:0x804F2684; // type:object size:0xC lbl_804F2690 = .rodata:0x804F2690; // type:object size:0x18 data:string lbl_804F26A8 = .rodata:0x804F26A8; // type:object size:0x10 lbl_804F26B8 = .rodata:0x804F26B8; // type:object size:0x770 -lbl_804F2E28 = .rodata:0x804F2E28; // type:object size:0x18 +lbl_804F2E28 = .rodata:0x804F2E28; // type:object size:0x15 data:string lbl_804F2E40 = .rodata:0x804F2E40; // type:object size:0x10 lbl_804F2E50 = .rodata:0x804F2E50; // type:object size:0x10 data:string lbl_804F2E60 = .rodata:0x804F2E60; // type:object size:0x10 lbl_804F2E70 = .rodata:0x804F2E70; // type:object size:0x14 -lbl_804F2E84 = .rodata:0x804F2E84; // type:object size:0xE0 +lbl_804F2E84 = .rodata:0x804F2E84; // type:object size:0x1C +lbl_804F2EA0 = .rodata:0x804F2EA0; // type:object size:0xA8 +lbl_804F2F48 = .rodata:0x804F2F48; // type:object size:0x1C lbl_804F2F64 = .rodata:0x804F2F64; // type:object size:0xC data:string lbl_804F2F70 = .rodata:0x804F2F70; // type:object size:0x10 lbl_804F2F80 = .rodata:0x804F2F80; // type:object size:0x10 lbl_804F2F90 = .rodata:0x804F2F90; // type:object size:0x14 lbl_804F2FA4 = .rodata:0x804F2FA4; // type:object size:0x1C -lbl_804F2FC0 = .rodata:0x804F2FC0; // type:object size:0xC8 +lbl_804F2FC0 = .rodata:0x804F2FC0; // type:object size:0x20 +lbl_804F2FE0 = .rodata:0x804F2FE0; // type:object size:0xA8 lbl_804F3088 = .rodata:0x804F3088; // type:object size:0x10 lbl_804F3098 = .rodata:0x804F3098; // type:object size:0x14 data:string lbl_804F30AC = .rodata:0x804F30AC; // type:object size:0x10 lbl_804F30BC = .rodata:0x804F30BC; // type:object size:0x10 -lbl_804F30CC = .rodata:0x804F30CC; // type:object size:0x9C +lbl_804F30CC = .rodata:0x804F30CC; // type:object size:0x10 +lbl_804F30DC = .rodata:0x804F30DC; // type:object size:0x8C lbl_804F3168 = .rodata:0x804F3168; // type:object size:0x10 lbl_804F3178 = .rodata:0x804F3178; // type:object size:0xC data:string -lbl_804F3184 = .rodata:0x804F3184; // type:object size:0x60 +lbl_804F3184 = .rodata:0x804F3184; // type:object size:0xC +lbl_804F3190 = .rodata:0x804F3190; // type:object size:0x54 lbl_804F31E4 = .rodata:0x804F31E4; // type:object size:0x10 lbl_804F31F4 = .rodata:0x804F31F4; // type:object size:0xC data:string lbl_804F3200 = .rodata:0x804F3200; // type:object size:0xC lbl_804F320C = .rodata:0x804F320C; // type:object size:0xC lbl_804F3218 = .rodata:0x804F3218; // type:object size:0xC -lbl_804F3224 = .rodata:0x804F3224; // type:object size:0x194 +lbl_804F3224 = .rodata:0x804F3224; // type:object size:0xC +lbl_804F3230 = .rodata:0x804F3230; // type:object size:0x134 +lbl_804F3364 = .rodata:0x804F3364; // type:object size:0x54 lbl_804F33B8 = .rodata:0x804F33B8; // type:object size:0x18 lbl_804F33D0 = .rodata:0x804F33D0; // type:object size:0x10 -lbl_804F33E0 = .rodata:0x804F33E0; // type:object size:0x80 +lbl_804F33E0 = .rodata:0x804F33E0; // type:object size:0x10 data:string +lbl_804F33F0 = .rodata:0x804F33F0; // type:object size:0x70 lbl_804F3460 = .rodata:0x804F3460; // type:object size:0x10 lbl_804F3470 = .rodata:0x804F3470; // type:object size:0x10 lbl_804F3480 = .rodata:0x804F3480; // type:object size:0x10 @@ -29011,40 +29019,43 @@ lbl_804F349C = .rodata:0x804F349C; // type:object size:0x10 lbl_804F34AC = .rodata:0x804F34AC; // type:object size:0xC lbl_804F34B8 = .rodata:0x804F34B8; // type:object size:0xC lbl_804F34C4 = .rodata:0x804F34C4; // type:object size:0xC -lbl_804F34D0 = .rodata:0x804F34D0; // type:object size:0x108 +lbl_804F34D0 = .rodata:0x804F34D0; // type:object size:0xC +lbl_804F34DC = .rodata:0x804F34DC; // type:object size:0xFC lbl_804F35D8 = .rodata:0x804F35D8; // type:object size:0xC -lbl_804F35E4 = .rodata:0x804F35E4; // type:object size:0x64 -lbl_804F3648 = .rodata:0x804F3648; // type:object size:0x30 -lbl_804F3678 = .rodata:0x804F3678; // type:object size:0x170 +lbl_804F35E4 = .rodata:0x804F35E4; // type:object size:0x10 +lbl_804F35F4 = .rodata:0x804F35F4; // type:object size:0x54 +lbl_804F3648 = .rodata:0x804F3648; // type:object size:0x14 +lbl_804F365C = .rodata:0x804F365C; // type:object size:0x1C +lbl_804F3678 = .rodata:0x804F3678; // type:object size:0x16C lbl_804F37E8 = .rodata:0x804F37E8; // type:object size:0x30 data:2byte lbl_804F3818 = .rodata:0x804F3818; // type:object size:0x40 -lbl_804F3858 = .rodata:0x804F3858; // type:object size:0x30 data:4byte -lbl_804F3888 = .rodata:0x804F3888; // type:object size:0x40 -lbl_804F38C8 = .rodata:0x804F38C8; // type:object size:0x18 +sBattleConfigs = .rodata:0x804F3858; // type:object size:0x30 scope:local data:4byte +sBgmConfigs = .rodata:0x804F3888; // type:object size:0x40 scope:local +sUnkSongVals = .rodata:0x804F38C8; // type:object size:0x18 lbl_804F38E0 = .rodata:0x804F38E0; // type:object size:0x10 -lbl_804F38F0 = .rodata:0x804F38F0; // type:object size:0x80 -lbl_804F3970 = .rodata:0x804F3970; // type:object size:0xC -lbl_804F397C = .rodata:0x804F397C; // type:object size:0xC -lbl_804F3988 = .rodata:0x804F3988; // type:object size:0xC -lbl_804F3994 = .rodata:0x804F3994; // type:object size:0xC -lbl_804F39A0 = .rodata:0x804F39A0; // type:object size:0x18 -lbl_804F39B8 = .rodata:0x804F39B8; // type:object size:0xC -lbl_804F39C4 = .rodata:0x804F39C4; // type:object size:0xC -lbl_804F39D0 = .rodata:0x804F39D0; // type:object size:0xC -lbl_804F39DC = .rodata:0x804F39DC; // type:object size:0xC -lbl_804F39E8 = .rodata:0x804F39E8; // type:object size:0xC -lbl_804F39F4 = .rodata:0x804F39F4; // type:object size:0xC -lbl_804F3A00 = .rodata:0x804F3A00; // type:object size:0xC -lbl_804F3A0C = .rodata:0x804F3A0C; // type:object size:0xC -lbl_804F3A18 = .rodata:0x804F3A18; // type:object size:0xC -lbl_804F3A24 = .rodata:0x804F3A24; // type:object size:0xC -lbl_804F3A30 = .rodata:0x804F3A30; // type:object size:0xC -lbl_804F3A3C = .rodata:0x804F3A3C; // type:object size:0xC -lbl_804F3A48 = .rodata:0x804F3A48; // type:object size:0xC -lbl_804F3A54 = .rodata:0x804F3A54; // type:object size:0xC -lbl_804F3A60 = .rodata:0x804F3A60; // type:object size:0xC -lbl_804F3A6C = .rodata:0x804F3A6C; // type:object size:0xC -Actor_BaseActorName_Pairs = .rodata:0x804F3A78; // type:object size:0x3C0 data:4byte +sFlowSoundDefs = .rodata:0x804F38F0; // type:object size:0x80 scope:local +grp4 = .rodata:0x804F3970; // type:object size:0x9 scope:local +grp6 = .rodata:0x804F397C; // type:object size:0x9 scope:local +grp9 = .rodata:0x804F3988; // type:object size:0x9 scope:local +grp12 = .rodata:0x804F3994; // type:object size:0x9 scope:local +grp17 = .rodata:0x804F39A0; // type:object size:0x11 scope:local +@30 = .rodata:0x804F39B8; // type:object size:0xB scope:local data:string +@32 = .rodata:0x804F39C4; // type:object size:0xB scope:local data:string +@37 = .rodata:0x804F39D0; // type:object size:0xB scope:local data:string +@39 = .rodata:0x804F39DC; // type:object size:0xB scope:local data:string +@41 = .rodata:0x804F39E8; // type:object size:0xB scope:local data:string +@52 = .rodata:0x804F39F4; // type:object size:0xB scope:local data:string +@54 = .rodata:0x804F3A00; // type:object size:0xB scope:local data:string +@55 = .rodata:0x804F3A0C; // type:object size:0xB scope:local data:string +@56 = .rodata:0x804F3A18; // type:object size:0xB scope:local data:string +@57 = .rodata:0x804F3A24; // type:object size:0xB scope:local data:string +@100 = .rodata:0x804F3A30; // type:object size:0xB scope:local data:string +@166 = .rodata:0x804F3A3C; // type:object size:0x9 scope:local data:string +@167 = .rodata:0x804F3A48; // type:object size:0x9 scope:local data:string +@168 = .rodata:0x804F3A54; // type:object size:0x9 scope:local data:string +@169 = .rodata:0x804F3A60; // type:object size:0x9 scope:local data:string +@174 = .rodata:0x804F3A6C; // type:object size:0x9 scope:local data:string +sActorBaseNamePairs = .rodata:0x804F3A78; // type:object size:0x3C0 data:4byte lbl_804F3E38 = .rodata:0x804F3E38; // type:object size:0x4C0 lbl_804F42F8 = .rodata:0x804F42F8; // type:object size:0x480 lbl_804F4778 = .rodata:0x804F4778; // type:object size:0x788 align:4 data:float @@ -29993,7 +30004,7 @@ lbl_8050140C = .data:0x8050140C; // type:object size:0xB4 lbl_805014C0 = .data:0x805014C0; // type:object size:0x28 lbl_805014E8 = .data:0x805014E8; // type:object size:0x18 lbl_80501500 = .data:0x80501500; // type:object size:0x28 -lbl_80501528 = .data:0x80501528; // type:object size:0x10 +__vt__9SoundInfo = .data:0x80501528; // type:object size:0xC @19465 = .data:0x80501538; // type:object size:0xC data:string __vt__9dAcBase_c = .data:0x80501544; // type:object size:0x74 ActorObjectBase__vtable = .data:0x805015B8; // type:object size:0x80 @@ -37935,7 +37946,7 @@ __vt__12dCcMassS_Obj = .data:0x80548598; // type:object size:0xC __vt__4dCcS = .data:0x805485A8; // type:object size:0xC lbl_805485B8 = .data:0x805485B8; // type:object size:0xC lbl_805485C4 = .data:0x805485C4; // type:object size:0xC -__vt__9dSndMgr_c = .data:0x805485D0; // type:object size:0xA8 +__vt__9dSndMgr_c = .data:0x805485D0; // type:object size:0xA4 __vt__22SoundPropertiesChecker = .data:0x80548678; // type:object size:0xC scope:weak __vt__11dSndActor_c = .data:0x80548684; // type:object size:0x1C scope:weak __vt__23IsCurrentSoundIdChecker = .data:0x805486A0; // type:object size:0x10 @@ -37973,10 +37984,10 @@ lbl_80548998 = .data:0x80548998; // type:object size:0x14 lbl_805489AC = .data:0x805489AC; // type:object size:0x14 data:string lbl_805489C0 = .data:0x805489C0; // type:object size:0x10 data:string lbl_805489D0 = .data:0x805489D0; // type:object size:0xC -lbl_805489DC = .data:0x805489DC; // type:object size:0xC +__vt__25SoundStopperIfParamFlag20 = .data:0x805489DC; // type:object size:0xC lbl_805489E8 = .data:0x805489E8; // type:object size:0xC -vtable3 = .data:0x805489F4; // type:object size:0xC -lbl_80548A00 = .data:0x80548A00; // type:object size:0xC +__vt__32SndMgrDisposer<14dSndStateMgr_c> = .data:0x805489F4; // type:object size:0xC +@STRING@resetEventName__14dSndStateMgr_cFv = .data:0x80548A00; // type:object size:0xB data:string lbl_80548A0C = .data:0x80548A0C; // type:object size:0xC lbl_80548A18 = .data:0x80548A18; // type:object size:0x10 lbl_80548A28 = .data:0x80548A28; // type:object size:0x10 @@ -37998,7 +38009,7 @@ lbl_80548AF0 = .data:0x80548AF0; // type:object size:0xC lbl_80548AFC = .data:0x80548AFC; // type:object size:0xC lbl_80548B08 = .data:0x80548B08; // type:object size:0x14 lbl_80548B1C = .data:0x80548B1C; // type:object size:0x10 -lbl_80548B2C = .data:0x80548B2C; // type:object size:0xC +__vt__17SoundVolumeSetter = .data:0x80548B2C; // type:object size:0xC __vt__42SndMgrDisposer<24dSndAreaSoundEffectMgr_c> = .data:0x80548B38; // type:object size:0x10 lbl_80548B48 = .data:0x80548B48; // type:object size:0x30 __vt__33dSndControlSoundStrmTrackVolume_c = .data:0x80548B78; // type:object size:0x20 @@ -38014,7 +38025,7 @@ __vt__29dSndControlPlayerVolumeBase_c = .data:0x80548CA4; // type:object size:0x jumptable_80548CC8 = .data:0x80548CC8; // type:object size:0x34 scope:local jumptable_80548CFC = .data:0x80548CFC; // type:object size:0x284 scope:local lbl_80548F80 = .data:0x80548F80; // type:object size:0xC -vtable4 = .data:0x80548F8C; // type:object size:0xC +__vt__30SndMgrDisposer<12dSndBgmMgr_c> = .data:0x80548F8C; // type:object size:0xC lbl_80548F98 = .data:0x80548F98; // type:object size:0xC lbl_80548FA4 = .data:0x80548FA4; // type:object size:0x10 lbl_80548FB4 = .data:0x80548FB4; // type:object size:0xC @@ -38028,90 +38039,93 @@ lbl_80549058 = .data:0x80549058; // type:object size:0x10 data:string lbl_80549068 = .data:0x80549068; // type:object size:0x10 lbl_80549078 = .data:0x80549078; // type:object size:0x10 lbl_80549088 = .data:0x80549088; // type:object size:0x34 -lbl_805490BC = .data:0x805490BC; // type:object size:0x44 -lbl_80549100 = .data:0x80549100; // type:object size:0x48 -lbl_80549148 = .data:0x80549148; // type:object size:0x10 -lbl_80549158 = .data:0x80549158; // type:object size:0x10 -lbl_80549168 = .data:0x80549168; // type:object size:0x10 -lbl_80549178 = .data:0x80549178; // type:object size:0x10 -lbl_80549188 = .data:0x80549188; // type:object size:0x10 -lbl_80549198 = .data:0x80549198; // type:object size:0x10 -lbl_805491A8 = .data:0x805491A8; // type:object size:0x10 -__vt__12SoundStopper = .data:0x805491B8; // type:object size:0xC -__vt__38SndMgrDisposer<20dSndSmallEffectMgr_c> = .data:0x805491C4; // type:object size:0xC -lbl_805491D0 = .data:0x805491D0; // type:object size:0x10 +__vt__14dSndBgmSound_c = .data:0x805490BC; // type:object size:0x44 +__vt__20dSndBgmBattleSound_c = .data:0x80549100; // type:object size:0x44 +__vt__37SndMgrDisposer<19dSndBgmSeqDataMgr_c> = .data:0x80549148; // type:object size:0xC scope:weak +__vt__18dSndBgmMmlParser_c = .data:0x80549158; // type:object size:0x10 +__vt__29dSndBgmMmlParserTagCompNote_c = .data:0x80549168; // type:object size:0x10 +__vt__28dSndBgmMmlParserTagBgmBoss_c = .data:0x80549178; // type:object size:0x10 +__vt__27dSndBgmMmlParserTagBattle_c = .data:0x80549188; // type:object size:0x10 +__vt__26dSndBgmMmlParserHarpSong_c = .data:0x80549198; // type:object size:0x10 +__vt__22dSndBgmMmlParserHarp_c = .data:0x805491A8; // type:object size:0x10 +__vt__12SoundStopper = .data:0x805491B8; // type:object size:0xC scope:weak +__vt__38SndMgrDisposer<20dSndSmallEffectMgr_c> = .data:0x805491C4; // type:object size:0xC scope:weak +__vt__35SndMgrDisposer<17dSndHarpSongMgr_c> = .data:0x805491D0; // type:object size:0x10 jumptable_805491E0 = .data:0x805491E0; // type:object size:0x20 scope:local lbl_80549200 = .data:0x80549200; // type:object size:0x14 data:4byte lbl_80549214 = .data:0x80549214; // type:object size:0x14 data:4byte jumptable_80549228 = .data:0x80549228; // type:object size:0xF0 scope:local lbl_80549318 = .data:0x80549318; // type:object size:0xC -lbl_80549324 = .data:0x80549324; // type:object size:0x1FC -lbl_80549520 = .data:0x80549520; // type:object size:0x1F0 -lbl_80549710 = .data:0x80549710; // type:object size:0x1F0 -lbl_80549900 = .data:0x80549900; // type:object size:0x1EC -lbl_80549AEC = .data:0x80549AEC; // type:object size:0x1EC -lbl_80549CD8 = .data:0x80549CD8; // type:object size:0x1EC -lbl_80549EC4 = .data:0x80549EC4; // type:object size:0x1EC -lbl_8054A0B0 = .data:0x8054A0B0; // type:object size:0x1EC -lbl_8054A29C = .data:0x8054A29C; // type:object size:0x1EC -lbl_8054A488 = .data:0x8054A488; // type:object size:0x1EC +__vt__18dSndSourceHarpTg_c = .data:0x80549324; // type:object size:0x1FC +__vt__19dSndSourceNpcAnim_c = .data:0x80549520; // type:object size:0x1F0 +__vt__23dSndSourceNpcAnimBase_c = .data:0x80549710; // type:object size:0x1F0 +__vt__19dSndSourceObjClef_c = .data:0x80549900; // type:object size:0x1EC +__vt__19dSndSourceObjAnim_c = .data:0x80549AEC; // type:object size:0x1EC +__vt__23dSndSourceObjAnimBase_c = .data:0x80549CD8; // type:object size:0x1EC +__vt__26dSndSourceEnemyMultiBase_c = .data:0x80549EC4; // type:object size:0x1EC +__vt__25dSndSourceEnemyAnimBase_c = .data:0x8054A0B0; // type:object size:0x1EC +__vt__21dSndSourceAnimSound_c = .data:0x8054A29C; // type:object size:0x1EC +__vt__18dSndSourceESpark_c = .data:0x8054A488; // type:object size:0x1EC __vt__33SndMgrDisposer<15dSndSourceMgr_c> = .data:0x8054A674; // type:object size:0xC lbl_8054A680 = .data:0x8054A680; // type:object size:0x150 -lbl_8054A7D0 = .data:0x8054A7D0; // type:object size:0xC +@14987 = .data:0x8054A7D0; // type:object size:0x9 scope:local data:string __vt__14dSoundSource_c = .data:0x8054A7DC; // type:object size:0x1EC -__vt__16dSoundSourceIf_c = .data:0x8054A9C8; // type:object size:0x120 +__vt__16dSoundSourceIf_c = .data:0x8054A9C8; // type:object size:0x11C scope:weak lbl_8054AAE8 = .data:0x8054AAE8; // type:object size:0x38 lbl_8054AB20 = .data:0x8054AB20; // type:object size:0x3F8 jumptable_8054AF18 = .data:0x8054AF18; // type:object size:0xA8 scope:local -lbl_8054AFC0 = .data:0x8054AFC0; // type:object size:0x1F8 +__vt__22dSndSourcePlayerHead_c = .data:0x8054AFC0; // type:object size:0x1F8 lbl_8054B1B8 = .data:0x8054B1B8; // type:object size:0xC lbl_8054B1C4 = .data:0x8054B1C4; // type:object size:0xC -lbl_8054B1D0 = .data:0x8054B1D0; // type:object size:0x1EC -lbl_8054B3BC = .data:0x8054B3BC; // type:object size:0x1EC -lbl_8054B5A8 = .data:0x8054B5A8; // type:object size:0x1F0 -lbl_8054B798 = .data:0x8054B798; // type:object size:0x1F0 -lbl_8054B988 = .data:0x8054B988; // type:object size:0x1F0 -lbl_8054BB78 = .data:0x8054BB78; // type:object size:0x48 -lbl_8054BBC0 = .data:0x8054BBC0; // type:object size:0x10 data:string -lbl_8054BBD0 = .data:0x8054BBD0; // type:object size:0x18 -lbl_8054BBE8 = .data:0x8054BBE8; // type:object size:0x1EC -lbl_8054BDD4 = .data:0x8054BDD4; // type:object size:0x1EC +__vt__22dSndSourceEnemyMulti_c = .data:0x8054B1D0; // type:object size:0x1EC +__vt__21dSndSourceEnemyAnim_c = .data:0x8054B3BC; // type:object size:0x1EC +__vt__17dSndSourceEnemy_c = .data:0x8054B5A8; // type:object size:0x1EC +__vt__25dSndSourceObjLightShaft_c = .data:0x8054B798; // type:object size:0x1F0 +__vt__15dSndSourceObj_c = .data:0x8054B988; // type:object size:0x1EC +sGroups = .data:0x8054BB78; // type:object size:0x44 scope:local +@23983 = .data:0x8054BBC0; // type:object size:0x10 scope:local data:string +@23984 = .data:0x8054BBD0; // type:object size:0x15 scope:local data:string +__vt__25dSndSourceEquipmentWhip_c = .data:0x8054BBE8; // type:object size:0x1EC +__vt__21dSndSourceEquipment_c = .data:0x8054BDD4; // type:object size:0x1EC lbl_8054BFC0 = .data:0x8054BFC0; // type:object size:0x1F0 lbl_8054C1B0 = .data:0x8054C1B0; // type:object size:0x1F0 -lbl_8054C3A0 = .data:0x8054C3A0; // type:object size:0x10 -lbl_8054C3B0 = .data:0x8054C3B0; // type:object size:0x1F0 -lbl_8054C5A0 = .data:0x8054C5A0; // type:object size:0x2C -lbl_8054C5CC = .data:0x8054C5CC; // type:object size:0x1EC +@9360 = .data:0x8054C3A0; // type:object size:0xC scope:local data:string +__vt__19dSndSourceNpcHead_c = .data:0x8054C3B0; // type:object size:0x1F0 +@6581 = .data:0x8054C5A0; // type:object size:0xA scope:local data:string +...data.0 = .data:0x8054C5A0; // type:label scope:local +@6582 = .data:0x8054C5AC; // type:object size:0xD scope:local data:string +@6584 = .data:0x8054C5BC; // type:object size:0xE scope:local data:string +__vt__18dSndSourcePyBird_c = .data:0x8054C5CC; // type:object size:0x1EC lbl_8054C7B8 = .data:0x8054C7B8; // type:object size:0x10 lbl_8054C7C8 = .data:0x8054C7C8; // type:object size:0x1F8 lbl_8054C9C0 = .data:0x8054C9C0; // type:object size:0x10 lbl_8054C9D0 = .data:0x8054C9D0; // type:object size:0x1FC -lbl_8054CBCC = .data:0x8054CBCC; // type:object size:0x1FC -lbl_8054CDC8 = .data:0x8054CDC8; // type:object size:0x1FC -lbl_8054CFC4 = .data:0x8054CFC4; // type:object size:0x1FC -lbl_8054D1C0 = .data:0x8054D1C0; // type:object size:0x1F0 -lbl_8054D3B0 = .data:0x8054D3B0; // type:object size:0xC -lbl_8054D3BC = .data:0x8054D3BC; // type:object size:0x44 -lbl_8054D400 = .data:0x8054D400; // type:object size:0x10 -lbl_8054D410 = .data:0x8054D410; // type:object size:0x60 -lbl_8054D470 = .data:0x8054D470; // type:object size:0x18 -lbl_8054D488 = .data:0x8054D488; // type:object size:0x18 -lbl_8054D4A0 = .data:0x8054D4A0; // type:object size:0x18 -lbl_8054D4B8 = .data:0x8054D4B8; // type:object size:0x10 +__vt__22dSndSourceHarpSwHarp_c = .data:0x8054CBCC; // type:object size:0x1FC +__vt__23dSndSourceHarpObjWarp_c = .data:0x8054CDC8; // type:object size:0x1FC +__vt__23dSndSourceHarpRelated_c = .data:0x8054CFC4; // type:object size:0x1FC +__vt__19dSndSourceTgSound_c = .data:0x8054D1C0; // type:object size:0x1EC +@7165 = .data:0x8054D3B0; // type:object size:0xA scope:local data:string +sSndHitEffects = .data:0x8054D3BC; // type:object size:0x44 +__vt__45SndMgrDisposer<27dSndDistantSoundActorPool_c> = .data:0x8054D400; // type:object size:0xC scope:weak +__vt__23dSndDistantSoundActor_c = .data:0x8054D410; // type:object size:0x60 +__vt__13dSndSeSound_c = .data:0x8054D470; // type:object size:0x14 +__vt__14dSndSeSound1_c = .data:0x8054D488; // type:object size:0x14 +__vt__14dSndSeSound2_c = .data:0x8054D4A0; // type:object size:0x14 +__vt__35SndMgrDisposer<17dSndSeSoundPool_c> = .data:0x8054D4B8; // type:object size:0xC scope:weak lbl_8054D4C8 = .data:0x8054D4C8; // type:object size:0x58 lbl_8054D520 = .data:0x8054D520; // type:object size:0x10 data:string lbl_8054D530 = .data:0x8054D530; // type:object size:0x10 -lbl_8054D540 = .data:0x8054D540; // type:object size:0x1F0 +__vt__15dSndSourceNpc_c = .data:0x8054D540; // type:object size:0x1F0 lbl_8054D730 = .data:0x8054D730; // type:object size:0x10 -lbl_8054D740 = .data:0x8054D740; // type:object size:0x20 +__vt__18dSndRngLinkVoice_c = .data:0x8054D740; // type:object size:0x20 lbl_8054D760 = .data:0x8054D760; // type:object size:0xC jumptable_8054D76C = .data:0x8054D76C; // type:object size:0x30 scope:local -lbl_8054D79C = .data:0x8054D79C; // type:object size:0xC -lbl_8054D7A8 = .data:0x8054D7A8; // type:object size:0x10 -lbl_8054D7B8 = .data:0x8054D7B8; // type:object size:0xC -lbl_8054D7C4 = .data:0x8054D7C4; // type:object size:0xC -lbl_8054D7D0 = .data:0x8054D7D0; // type:object size:0x10 -lbl_8054D7E0 = .data:0x8054D7E0; // type:object size:0x30 +__vt__34SndMgrDisposer<16dSndFiVocalMgr_c> = .data:0x8054D79C; // type:object size:0xC +__vt__9dSndRng_c = .data:0x8054D7A8; // type:object size:0x10 +__vt__12dSndRngMgr_c = .data:0x8054D7B8; // type:object size:0xC scope:weak +__vt__30SndMgrDisposer<12dSndRngMgr_c> = .data:0x8054D7C4; // type:object size:0xC scope:weak +__vt__11dSndRngId_c = .data:0x8054D7D0; // type:object size:0xC scope:weak +__vt__15dSndFileManager = .data:0x8054D7E0; // type:object size:0x30 lbl_8054D810 = .data:0x8054D810; // type:object size:0x48 lbl_8054D858 = .data:0x8054D858; // type:object size:0xA data:string lbl_8054D864 = .data:0x8054D864; // type:object size:0x15 data:string @@ -41032,7 +41046,7 @@ lbl_8057414C = .sdata:0x8057414C; // type:object size:0x8 lbl_80574154 = .sdata:0x80574154; // type:object size:0x8 lbl_8057415C = .sdata:0x8057415C; // type:object size:0x8 lbl_80574164 = .sdata:0x80574164; // type:object size:0x8 -lbl_8057416C = .sdata:0x8057416C; // type:object size:0x8 +lbl_8057416C = .sdata:0x8057416C; // type:object size:0x5 data:string lbl_80574174 = .sdata:0x80574174; // type:object size:0x8 lbl_8057417C = .sdata:0x8057417C; // type:object size:0x8 lbl_80574184 = .sdata:0x80574184; // type:object size:0x8 @@ -41082,9 +41096,9 @@ lbl_805742D0 = .sdata:0x805742D0; // type:object size:0x8 lbl_805742D8 = .sdata:0x805742D8; // type:object size:0x8 lbl_805742E0 = .sdata:0x805742E0; // type:object size:0x8 lbl_805742E8 = .sdata:0x805742E8; // type:object size:0x8 -lbl_805742F0 = .sdata:0x805742F0; // type:object size:0x8 -lbl_805742F8 = .sdata:0x805742F8; // type:object size:0x8 -lbl_80574300 = .sdata:0x80574300; // type:object size:0x8 data:string +@7580 = .sdata:0x805742F0; // type:object size:0x6 scope:local data:string +@7402 = .sdata:0x805742F8; // type:object size:0x5 scope:local data:string +@12944 = .sdata:0x80574300; // type:object size:0x8 scope:local data:string lbl_80574308 = .sdata:0x80574308; // type:object size:0x8 lbl_80574310 = .sdata:0x80574310; // type:object size:0x4 lbl_80574314 = .sdata:0x80574314; // type:object size:0x8 @@ -41216,8 +41230,8 @@ lbl_805746E8 = .sdata:0x805746E8; // type:object size:0x8 lbl_805746F0 = .sdata:0x805746F0; // type:object size:0x8 lbl_805746F8 = .sdata:0x805746F8; // type:object size:0x8 lbl_80574700 = .sdata:0x80574700; // type:object size:0x8 -lbl_80574708 = .sdata:0x80574708; // type:object size:0x8 -lbl_80574710 = .sdata:0x80574710; // type:object size:0x8 +@14930 = .sdata:0x80574708; // type:object size:0x6 scope:local data:string +@14991 = .sdata:0x80574710; // type:object size:0x6 scope:local data:string lbl_80574718 = .sdata:0x80574718; // type:object size:0x8 lbl_80574720 = .sdata:0x80574720; // type:object size:0x8 lbl_80574728 = .sdata:0x80574728; // type:object size:0x8 @@ -41235,26 +41249,26 @@ lbl_80574778 = .sdata:0x80574778; // type:object size:0x8 lbl_80574780 = .sdata:0x80574780; // type:object size:0x4 data:string lbl_80574784 = .sdata:0x80574784; // type:object size:0x8 lbl_8057478C = .sdata:0x8057478C; // type:object size:0xC -lbl_80574798 = .sdata:0x80574798; // type:object size:0x8 -lbl_805747A0 = .sdata:0x805747A0; // type:object size:0x8 -lbl_805747A8 = .sdata:0x805747A8; // type:object size:0x8 -lbl_805747B0 = .sdata:0x805747B0; // type:object size:0x8 -lbl_805747B8 = .sdata:0x805747B8; // type:object size:0x8 +@5031 = .sdata:0x80574798; // type:object size:0x5 scope:local data:string +@5032 = .sdata:0x805747A0; // type:object size:0x6 scope:local data:string +@5034 = .sdata:0x805747A8; // type:object size:0x6 scope:local data:string +@5035 = .sdata:0x805747B0; // type:object size:0x5 scope:local data:string +@5036 = .sdata:0x805747B8; // type:object size:0x5 scope:local data:string lbl_805747C0 = .sdata:0x805747C0; // type:object size:0x8 lbl_805747C8 = .sdata:0x805747C8; // type:object size:0x8 -lbl_805747D0 = .sdata:0x805747D0; // type:object size:0x8 -lbl_805747D8 = .sdata:0x805747D8; // type:object size:0x8 -lbl_805747E0 = .sdata:0x805747E0; // type:object size:0x4 -lbl_805747E4 = .sdata:0x805747E4; // type:object size:0x4 -lbl_805747E8 = .sdata:0x805747E8; // type:object size:0x8 -lbl_805747F0 = .sdata:0x805747F0; // type:object size:0x8 -lbl_805747F8 = .sdata:0x805747F8; // type:object size:0x8 +@9359 = .sdata:0x805747D0; // type:object size:0x6 scope:local data:string +@9470 = .sdata:0x805747D8; // type:object size:0x6 scope:local data:string +@9471 = .sdata:0x805747E0; // type:object size:0x3 scope:local data:string +@9472 = .sdata:0x805747E4; // type:object size:0x3 scope:local data:string +@6583 = .sdata:0x805747E8; // type:object size:0x6 scope:local data:string +@6585 = .sdata:0x805747F0; // type:object size:0x7 scope:local data:string +@6586 = .sdata:0x805747F8; // type:object size:0x6 scope:local data:string lbl_80574800 = .sdata:0x80574800; // type:object size:0x8 lbl_80574808 = .sdata:0x80574808; // type:object size:0x8 -lbl_80574810 = .sdata:0x80574810; // type:object size:0x8 -lbl_80574818 = .sdata:0x80574818; // type:object size:0x8 -lbl_80574820 = .sdata:0x80574820; // type:object size:0x8 -lbl_80574828 = .sdata:0x80574828; // type:object size:0x8 +@7595 = .sdata:0x80574810; // type:object size:0x6 scope:local data:string +@7123 = .sdata:0x80574818; // type:object size:0x7 scope:local data:string +@7195 = .sdata:0x80574820; // type:object size:0x6 scope:local data:string +@7215 = .sdata:0x80574828; // type:object size:0x1 scope:local lbl_80574830 = .sdata:0x80574830; // type:object size:0x8 lbl_80574838 = .sdata:0x80574838; // type:object size:0x8 lbl_80574840 = .sdata:0x80574840; // type:object size:0x8 @@ -42263,7 +42277,7 @@ l_start = .sbss:0x80575D18; // type:object size:0x4 data:4byte l_wcsbuf_num = .sbss:0x80575D1C; // type:object size:0x4 data:4byte sInstance__4dCcS = .sbss:0x80575D20; // type:object size:0x4 data:4byte lbl_80575D28 = .sbss:0x80575D28; // type:object size:0x8 data:4byte -sInstance__9dSndMgr_c = .sbss:0x80575D30; // type:object size:0x8 data:4byte +sInstance__9dSndMgr_c = .sbss:0x80575D30; // type:object size:0x4 data:4byte sInstance__15dSndPlayerMgr_c = .sbss:0x80575D38; // type:object size:0x4 data:4byte sDisposer__15dSndPlayerMgr_c = .sbss:0x80575D3C; // type:object size:0x4 data:4byte lbl_80575D40 = .sbss:0x80575D40; // type:object size:0x4 data:4byte @@ -42275,35 +42289,35 @@ sInstance__15dSnd3DManager_c = .sbss:0x80575D58; // type:object size:0x4 data:4b sDisposer__15dSnd3DManager_c = .sbss:0x80575D5C; // type:object size:0x4 data:4byte lbl_80575D60 = .sbss:0x80575D60; // type:object size:0x4 data:4byte lbl_80575D64 = .sbss:0x80575D64; // type:object size:0x4 data:4byte -lbl_80575D68 = .sbss:0x80575D68; // type:object size:0x4 data:4byte -ENEMY_SOUND_MGR = .sbss:0x80575D6C; // type:object size:0x4 data:4byte -ENEMY_SOUND_MGR_source = .sbss:0x80575D70; // type:object size:0x8 data:4byte +sEventExecuteCallback__14dSndStateMgr_c = .sbss:0x80575D68; // type:object size:0x4 data:4byte +sInstance__14dSndStateMgr_c = .sbss:0x80575D6C; // type:object size:0x4 data:4byte +sDisposer__14dSndStateMgr_c = .sbss:0x80575D70; // type:object size:0x8 data:4byte sInstance__24dSndAreaSoundEffectMgr_c = .sbss:0x80575D78; // type:object size:0x4 data:4byte sDisposer__24dSndAreaSoundEffectMgr_c = .sbss:0x80575D7C; // type:object size:0x4 data:4byte -FANFARE_SOUND_MGR = .sbss:0x80575D80; // type:object size:0x4 data:4byte -FANFARE_SOUND_MGR_source = .sbss:0x80575D84; // type:object size:0x4 data:4byte -lbl_80575D88 = .sbss:0x80575D88; // type:object size:0x8 data:4byte -SOME_UNUSED_SOUND_MGR = .sbss:0x80575D90; // type:object size:0x4 data:4byte -SOME_UNUSED_SOUND_MGR_source = .sbss:0x80575D94; // type:object size:0x4 data:4byte +sInstance__12dSndBgmMgr_c = .sbss:0x80575D80; // type:object size:0x4 data:4byte +sDisposer__12dSndBgmMgr_c = .sbss:0x80575D84; // type:object size:0x4 data:4byte +spGlobalHarpMgr__14dSndBgmSound_c = .sbss:0x80575D88; // type:object size:0x8 data:4byte +sInstance__19dSndBgmSeqDataMgr_c = .sbss:0x80575D90; // type:object size:0x4 data:4byte +sDisposer__19dSndBgmSeqDataMgr_c = .sbss:0x80575D94; // type:object size:0x4 data:4byte sInstance__20dSndSmallEffectMgr_c = .sbss:0x80575D98; // type:object size:0x4 data:4byte sDisposer__20dSndSmallEffectMgr_c = .sbss:0x80575D9C; // type:object size:0x4 data:4byte -lbl_80575DA0 = .sbss:0x80575DA0; // type:object size:0x4 data:4byte -lbl_80575DA4 = .sbss:0x80575DA4; // type:object size:0x4 data:4byte +sInstance__17dSndHarpSongMgr_c = .sbss:0x80575DA0; // type:object size:0x4 data:4byte +sDisposer__17dSndHarpSongMgr_c = .sbss:0x80575DA4; // type:object size:0x4 data:4byte sInstance__15dSndSourceMgr_c = .sbss:0x80575DA8; // type:object size:0x4 data:4byte sDisposer__15dSndSourceMgr_c = .sbss:0x80575DAC; // type:object size:0x4 data:4byte -lbl_80575DB0 = .sbss:0x80575DB0; // type:object size:0x8 data:4byte -lbl_80575DB8 = .sbss:0x80575DB8; // type:object size:0x8 data:byte -lbl_80575DC0 = .sbss:0x80575DC0; // type:object size:0x8 data:4byte +sCtxParams = .sbss:0x80575DB0; // type:object size:0x8 scope:local data:4byte +sIsStartingBaseSound__14dSoundSource_c = .sbss:0x80575DB8; // type:object size:0x1 data:byte +clefSoundHandle = .sbss:0x80575DC0; // type:object size:0x4 scope:local data:4byte lbl_80575DC8 = .sbss:0x80575DC8; // type:object size:0x4 data:4byte lbl_80575DCC = .sbss:0x80575DCC; // type:object size:0x4 data:4byte -lbl_80575DD0 = .sbss:0x80575DD0; // type:object size:0x4 data:4byte -lbl_80575DD4 = .sbss:0x80575DD4; // type:object size:0x4 data:4byte -lbl_80575DD8 = .sbss:0x80575DD8; // type:object size:0x4 data:4byte -lbl_80575DDC = .sbss:0x80575DDC; // type:object size:0x4 data:4byte -lbl_80575DE0 = .sbss:0x80575DE0; // type:object size:0x4 data:4byte -lbl_80575DE4 = .sbss:0x80575DE4; // type:object size:0x4 data:4byte -lbl_80575DE8 = .sbss:0x80575DE8; // type:object size:0x4 data:4byte -lbl_80575DEC = .sbss:0x80575DEC; // type:object size:0x4 data:4byte +sInstance__27dSndDistantSoundActorPool_c = .sbss:0x80575DD0; // type:object size:0x4 data:4byte +sDisposer__27dSndDistantSoundActorPool_c = .sbss:0x80575DD4; // type:object size:0x4 data:4byte +sInstance__17dSndSeSoundPool_c = .sbss:0x80575DD8; // type:object size:0x4 data:4byte +sDisposer__17dSndSeSoundPool_c = .sbss:0x80575DDC; // type:object size:0x4 data:4byte +sInstance__16dSndFiVocalMgr_c = .sbss:0x80575DE0; // type:object size:0x4 data:4byte +sDisposer__16dSndFiVocalMgr_c = .sbss:0x80575DE4; // type:object size:0x4 data:4byte +sInstance__12dSndRngMgr_c = .sbss:0x80575DE8; // type:object size:0x4 data:4byte +sDisposer__12dSndRngMgr_c = .sbss:0x80575DEC; // type:object size:0x4 data:4byte kprProcDeadKeysFP = .sbss:0x80575DF0; // type:object size:0x4 data:4byte kprProcRomajiFP = .sbss:0x80575DF4; // type:object size:0x4 data:4byte @LOCAL@KPRInitQueue__FP9_KPRQueue@once = .sbss:0x80575DF8; // type:object size:0x8 data:byte @@ -48804,111 +48818,111 @@ lbl_8057D468 = .sdata2:0x8057D468; // type:object size:0x4 align:4 data:float lbl_8057D46C = .sdata2:0x8057D46C; // type:object size:0x4 align:4 data:float lbl_8057D470 = .sdata2:0x8057D470; // type:object size:0x4 align:4 data:float lbl_8057D474 = .sdata2:0x8057D474; // type:object size:0x4 align:4 data:float -lbl_8057D478 = .sdata2:0x8057D478; // type:object size:0x8 -lbl_8057D480 = .sdata2:0x8057D480; // type:object size:0x8 -lbl_8057D488 = .sdata2:0x8057D488; // type:object size:0x8 -lbl_8057D490 = .sdata2:0x8057D490; // type:object size:0x8 -lbl_8057D498 = .sdata2:0x8057D498; // type:object size:0x8 -lbl_8057D4A0 = .sdata2:0x8057D4A0; // type:object size:0x8 -lbl_8057D4A8 = .sdata2:0x8057D4A8; // type:object size:0x8 -lbl_8057D4B0 = .sdata2:0x8057D4B0; // type:object size:0x8 -lbl_8057D4B8 = .sdata2:0x8057D4B8; // type:object size:0x8 -lbl_8057D4C0 = .sdata2:0x8057D4C0; // type:object size:0x8 -lbl_8057D4C8 = .sdata2:0x8057D4C8; // type:object size:0x8 -lbl_8057D4D0 = .sdata2:0x8057D4D0; // type:object size:0x8 -lbl_8057D4D8 = .sdata2:0x8057D4D8; // type:object size:0x8 -lbl_8057D4E0 = .sdata2:0x8057D4E0; // type:object size:0x8 -lbl_8057D4E8 = .sdata2:0x8057D4E8; // type:object size:0x8 -lbl_8057D4F0 = .sdata2:0x8057D4F0; // type:object size:0x8 -lbl_8057D4F8 = .sdata2:0x8057D4F8; // type:object size:0x8 -lbl_8057D500 = .sdata2:0x8057D500; // type:object size:0x8 -lbl_8057D508 = .sdata2:0x8057D508; // type:object size:0x8 -lbl_8057D510 = .sdata2:0x8057D510; // type:object size:0x8 -lbl_8057D518 = .sdata2:0x8057D518; // type:object size:0x8 -lbl_8057D520 = .sdata2:0x8057D520; // type:object size:0x8 -lbl_8057D528 = .sdata2:0x8057D528; // type:object size:0x8 -lbl_8057D530 = .sdata2:0x8057D530; // type:object size:0x8 -lbl_8057D538 = .sdata2:0x8057D538; // type:object size:0x8 -lbl_8057D540 = .sdata2:0x8057D540; // type:object size:0x8 -lbl_8057D548 = .sdata2:0x8057D548; // type:object size:0x8 -lbl_8057D550 = .sdata2:0x8057D550; // type:object size:0x8 -lbl_8057D558 = .sdata2:0x8057D558; // type:object size:0x8 -lbl_8057D560 = .sdata2:0x8057D560; // type:object size:0x8 -lbl_8057D568 = .sdata2:0x8057D568; // type:object size:0x8 -lbl_8057D570 = .sdata2:0x8057D570; // type:object size:0x8 -lbl_8057D578 = .sdata2:0x8057D578; // type:object size:0x8 -lbl_8057D580 = .sdata2:0x8057D580; // type:object size:0x8 -lbl_8057D588 = .sdata2:0x8057D588; // type:object size:0x8 -lbl_8057D590 = .sdata2:0x8057D590; // type:object size:0x8 -lbl_8057D598 = .sdata2:0x8057D598; // type:object size:0x8 -lbl_8057D5A0 = .sdata2:0x8057D5A0; // type:object size:0x8 -lbl_8057D5A8 = .sdata2:0x8057D5A8; // type:object size:0x8 -lbl_8057D5B0 = .sdata2:0x8057D5B0; // type:object size:0x8 -lbl_8057D5B8 = .sdata2:0x8057D5B8; // type:object size:0x8 -lbl_8057D5C0 = .sdata2:0x8057D5C0; // type:object size:0x8 -lbl_8057D5C8 = .sdata2:0x8057D5C8; // type:object size:0x8 -lbl_8057D5D0 = .sdata2:0x8057D5D0; // type:object size:0x8 -lbl_8057D5D8 = .sdata2:0x8057D5D8; // type:object size:0x8 -lbl_8057D5E0 = .sdata2:0x8057D5E0; // type:object size:0x8 -lbl_8057D5E8 = .sdata2:0x8057D5E8; // type:object size:0x8 -lbl_8057D5F0 = .sdata2:0x8057D5F0; // type:object size:0x8 -lbl_8057D5F8 = .sdata2:0x8057D5F8; // type:object size:0x8 -lbl_8057D600 = .sdata2:0x8057D600; // type:object size:0x8 -lbl_8057D608 = .sdata2:0x8057D608; // type:object size:0x8 -lbl_8057D610 = .sdata2:0x8057D610; // type:object size:0x8 -lbl_8057D618 = .sdata2:0x8057D618; // type:object size:0x8 -lbl_8057D620 = .sdata2:0x8057D620; // type:object size:0x8 -lbl_8057D628 = .sdata2:0x8057D628; // type:object size:0x8 -lbl_8057D630 = .sdata2:0x8057D630; // type:object size:0x8 -lbl_8057D638 = .sdata2:0x8057D638; // type:object size:0x8 -lbl_8057D640 = .sdata2:0x8057D640; // type:object size:0x8 -lbl_8057D648 = .sdata2:0x8057D648; // type:object size:0x8 -lbl_8057D650 = .sdata2:0x8057D650; // type:object size:0x8 -lbl_8057D658 = .sdata2:0x8057D658; // type:object size:0x8 -lbl_8057D660 = .sdata2:0x8057D660; // type:object size:0x8 -lbl_8057D668 = .sdata2:0x8057D668; // type:object size:0x8 -lbl_8057D670 = .sdata2:0x8057D670; // type:object size:0x8 -lbl_8057D678 = .sdata2:0x8057D678; // type:object size:0x8 -lbl_8057D680 = .sdata2:0x8057D680; // type:object size:0x8 -lbl_8057D688 = .sdata2:0x8057D688; // type:object size:0x8 -lbl_8057D690 = .sdata2:0x8057D690; // type:object size:0x8 -lbl_8057D698 = .sdata2:0x8057D698; // type:object size:0x8 -lbl_8057D6A0 = .sdata2:0x8057D6A0; // type:object size:0x8 -lbl_8057D6A8 = .sdata2:0x8057D6A8; // type:object size:0x8 -lbl_8057D6B0 = .sdata2:0x8057D6B0; // type:object size:0x8 -lbl_8057D6B8 = .sdata2:0x8057D6B8; // type:object size:0x8 -lbl_8057D6C0 = .sdata2:0x8057D6C0; // type:object size:0x8 -lbl_8057D6C8 = .sdata2:0x8057D6C8; // type:object size:0x8 -lbl_8057D6D0 = .sdata2:0x8057D6D0; // type:object size:0x8 -lbl_8057D6D8 = .sdata2:0x8057D6D8; // type:object size:0x8 -lbl_8057D6E0 = .sdata2:0x8057D6E0; // type:object size:0x8 -lbl_8057D6E8 = .sdata2:0x8057D6E8; // type:object size:0x8 -lbl_8057D6F0 = .sdata2:0x8057D6F0; // type:object size:0x8 -lbl_8057D6F8 = .sdata2:0x8057D6F8; // type:object size:0x8 -lbl_8057D700 = .sdata2:0x8057D700; // type:object size:0x8 -lbl_8057D708 = .sdata2:0x8057D708; // type:object size:0x8 -lbl_8057D710 = .sdata2:0x8057D710; // type:object size:0x8 -lbl_8057D718 = .sdata2:0x8057D718; // type:object size:0x8 -lbl_8057D720 = .sdata2:0x8057D720; // type:object size:0x8 -lbl_8057D728 = .sdata2:0x8057D728; // type:object size:0x8 -lbl_8057D730 = .sdata2:0x8057D730; // type:object size:0x8 -lbl_8057D738 = .sdata2:0x8057D738; // type:object size:0x8 -lbl_8057D740 = .sdata2:0x8057D740; // type:object size:0x8 -lbl_8057D748 = .sdata2:0x8057D748; // type:object size:0x8 -lbl_8057D750 = .sdata2:0x8057D750; // type:object size:0x8 -lbl_8057D758 = .sdata2:0x8057D758; // type:object size:0x8 -lbl_8057D760 = .sdata2:0x8057D760; // type:object size:0x8 -lbl_8057D768 = .sdata2:0x8057D768; // type:object size:0x8 -lbl_8057D770 = .sdata2:0x8057D770; // type:object size:0x8 -lbl_8057D778 = .sdata2:0x8057D778; // type:object size:0x8 -lbl_8057D780 = .sdata2:0x8057D780; // type:object size:0x8 -lbl_8057D788 = .sdata2:0x8057D788; // type:object size:0x8 -lbl_8057D790 = .sdata2:0x8057D790; // type:object size:0x8 -lbl_8057D798 = .sdata2:0x8057D798; // type:object size:0x8 -lbl_8057D7A0 = .sdata2:0x8057D7A0; // type:object size:0x8 -lbl_8057D7A8 = .sdata2:0x8057D7A8; // type:object size:0x8 -lbl_8057D7B0 = .sdata2:0x8057D7B0; // type:object size:0x8 -lbl_8057D7B8 = .sdata2:0x8057D7B8; // type:object size:0x8 data:4byte +@11 = .sdata2:0x8057D478; // type:object size:0x5 scope:local data:string +@12 = .sdata2:0x8057D480; // type:object size:0x5 scope:local data:string +@13 = .sdata2:0x8057D488; // type:object size:0x5 scope:local data:string +@14 = .sdata2:0x8057D490; // type:object size:0x7 scope:local data:string +@15 = .sdata2:0x8057D498; // type:object size:0x5 scope:local data:string +@17 = .sdata2:0x8057D4A0; // type:object size:0x5 scope:local data:string +@18 = .sdata2:0x8057D4A8; // type:object size:0x7 scope:local data:string +@19 = .sdata2:0x8057D4B0; // type:object size:0x7 scope:local data:string +@20 = .sdata2:0x8057D4B8; // type:object size:0x7 scope:local data:string +@21 = .sdata2:0x8057D4C0; // type:object size:0x7 scope:local data:string +@22 = .sdata2:0x8057D4C8; // type:object size:0x5 scope:local data:string +@23 = .sdata2:0x8057D4D0; // type:object size:0x5 scope:local data:string +@24 = .sdata2:0x8057D4D8; // type:object size:0x7 scope:local data:string +@25 = .sdata2:0x8057D4E0; // type:object size:0x7 scope:local data:string +@27 = .sdata2:0x8057D4E8; // type:object size:0x5 scope:local data:string +@28 = .sdata2:0x8057D4F0; // type:object size:0x7 scope:local data:string +@29 = .sdata2:0x8057D4F8; // type:object size:0x7 scope:local data:string +@30 = .sdata2:0x8057D500; // type:object size:0x7 scope:local data:string +@31 = .sdata2:0x8057D508; // type:object size:0x7 scope:local data:string +@32 = .sdata2:0x8057D510; // type:object size:0x7 scope:local data:string +@33 = .sdata2:0x8057D518; // type:object size:0x7 scope:local data:string +@34 = .sdata2:0x8057D520; // type:object size:0x5 scope:local data:string +@36 = .sdata2:0x8057D528; // type:object size:0x5 scope:local data:string +@38 = .sdata2:0x8057D530; // type:object size:0x5 scope:local data:string +@42 = .sdata2:0x8057D538; // type:object size:0x5 scope:local data:string +@47 = .sdata2:0x8057D540; // type:object size:0x5 scope:local data:string +@49 = .sdata2:0x8057D548; // type:object size:0x5 scope:local data:string +@52 = .sdata2:0x8057D550; // type:object size:0x5 scope:local data:string +@53 = .sdata2:0x8057D558; // type:object size:0x7 scope:local data:string +@54 = .sdata2:0x8057D560; // type:object size:0x5 scope:local data:string +@55 = .sdata2:0x8057D568; // type:object size:0x5 scope:local data:string +@56 = .sdata2:0x8057D570; // type:object size:0x5 scope:local data:string +@57 = .sdata2:0x8057D578; // type:object size:0x5 scope:local data:string +@58 = .sdata2:0x8057D580; // type:object size:0x5 scope:local data:string +@59 = .sdata2:0x8057D588; // type:object size:0x7 scope:local data:string +@60 = .sdata2:0x8057D590; // type:object size:0x5 scope:local data:string +@61 = .sdata2:0x8057D598; // type:object size:0x7 scope:local data:string +@62 = .sdata2:0x8057D5A0; // type:object size:0x7 scope:local data:string +@63 = .sdata2:0x8057D5A8; // type:object size:0x7 scope:local data:string +@64 = .sdata2:0x8057D5B0; // type:object size:0x7 scope:local data:string +@65 = .sdata2:0x8057D5B8; // type:object size:0x7 scope:local data:string +@66 = .sdata2:0x8057D5C0; // type:object size:0x7 scope:local data:string +@67 = .sdata2:0x8057D5C8; // type:object size:0x7 scope:local data:string +@68 = .sdata2:0x8057D5D0; // type:object size:0x7 scope:local data:string +@69 = .sdata2:0x8057D5D8; // type:object size:0x7 scope:local data:string +@70 = .sdata2:0x8057D5E0; // type:object size:0x7 scope:local data:string +@71 = .sdata2:0x8057D5E8; // type:object size:0x5 scope:local data:string +@73 = .sdata2:0x8057D5F0; // type:object size:0x7 scope:local data:string +@75 = .sdata2:0x8057D5F8; // type:object size:0x5 scope:local data:string +@76 = .sdata2:0x8057D600; // type:object size:0x7 scope:local data:string +@78 = .sdata2:0x8057D608; // type:object size:0x5 scope:local data:string +@79 = .sdata2:0x8057D610; // type:object size:0x5 scope:local data:string +@82 = .sdata2:0x8057D618; // type:object size:0x5 scope:local data:string +@84 = .sdata2:0x8057D620; // type:object size:0x7 scope:local data:string +@86 = .sdata2:0x8057D628; // type:object size:0x5 scope:local data:string +@87 = .sdata2:0x8057D630; // type:object size:0x5 scope:local data:string +@89 = .sdata2:0x8057D638; // type:object size:0x5 scope:local data:string +@90 = .sdata2:0x8057D640; // type:object size:0x5 scope:local data:string +@93 = .sdata2:0x8057D648; // type:object size:0x7 scope:local data:string +@94 = .sdata2:0x8057D650; // type:object size:0x7 scope:local data:string +@95 = .sdata2:0x8057D658; // type:object size:0x7 scope:local data:string +@96 = .sdata2:0x8057D660; // type:object size:0x7 scope:local data:string +@99 = .sdata2:0x8057D668; // type:object size:0x5 scope:local data:string +@100 = .sdata2:0x8057D670; // type:object size:0x5 scope:local data:string +@101 = .sdata2:0x8057D678; // type:object size:0x5 scope:local data:string +@103 = .sdata2:0x8057D680; // type:object size:0x7 scope:local data:string +@104 = .sdata2:0x8057D688; // type:object size:0x7 scope:local data:string +@105 = .sdata2:0x8057D690; // type:object size:0x7 scope:local data:string +@106 = .sdata2:0x8057D698; // type:object size:0x7 scope:local data:string +@107 = .sdata2:0x8057D6A0; // type:object size:0x7 scope:local data:string +@108 = .sdata2:0x8057D6A8; // type:object size:0x7 scope:local data:string +@109 = .sdata2:0x8057D6B0; // type:object size:0x7 scope:local data:string +@110 = .sdata2:0x8057D6B8; // type:object size:0x5 scope:local data:string +@111 = .sdata2:0x8057D6C0; // type:object size:0x5 scope:local data:string +@112 = .sdata2:0x8057D6C8; // type:object size:0x5 scope:local data:string +@113 = .sdata2:0x8057D6D0; // type:object size:0x5 scope:local data:string +@114 = .sdata2:0x8057D6D8; // type:object size:0x5 scope:local data:string +@115 = .sdata2:0x8057D6E0; // type:object size:0x5 scope:local data:string +@116 = .sdata2:0x8057D6E8; // type:object size:0x5 scope:local data:string +@118 = .sdata2:0x8057D6F0; // type:object size:0x5 scope:local data:string +@120 = .sdata2:0x8057D6F8; // type:object size:0x5 scope:local data:string +@132 = .sdata2:0x8057D700; // type:object size:0x7 scope:local data:string +@133 = .sdata2:0x8057D708; // type:object size:0x6 scope:local data:string +@137 = .sdata2:0x8057D710; // type:object size:0x6 scope:local data:string +@138 = .sdata2:0x8057D718; // type:object size:0x6 scope:local data:string +@139 = .sdata2:0x8057D720; // type:object size:0x6 scope:local data:string +@140 = .sdata2:0x8057D728; // type:object size:0x6 scope:local data:string +@141 = .sdata2:0x8057D730; // type:object size:0x6 scope:local data:string +@142 = .sdata2:0x8057D738; // type:object size:0x6 scope:local data:string +@143 = .sdata2:0x8057D740; // type:object size:0x6 scope:local data:string +@144 = .sdata2:0x8057D748; // type:object size:0x6 scope:local data:string +@145 = .sdata2:0x8057D750; // type:object size:0x6 scope:local data:string +@146 = .sdata2:0x8057D758; // type:object size:0x6 scope:local data:string +@147 = .sdata2:0x8057D760; // type:object size:0x6 scope:local data:string +@148 = .sdata2:0x8057D768; // type:object size:0x6 scope:local data:string +@149 = .sdata2:0x8057D770; // type:object size:0x6 scope:local data:string +@150 = .sdata2:0x8057D778; // type:object size:0x6 scope:local data:string +@151 = .sdata2:0x8057D780; // type:object size:0x6 scope:local data:string +@152 = .sdata2:0x8057D788; // type:object size:0x5 scope:local data:string +@156 = .sdata2:0x8057D790; // type:object size:0x5 scope:local data:string +@159 = .sdata2:0x8057D798; // type:object size:0x5 scope:local data:string +@163 = .sdata2:0x8057D7A0; // type:object size:0x6 scope:local data:string +@167 = .sdata2:0x8057D7A8; // type:object size:0x6 scope:local data:string +@171 = .sdata2:0x8057D7B0; // type:object size:0x5 scope:local data:string +sNumStageInfos__13dSndStageInfo = .sdata2:0x8057D7B8; // type:object size:0x4 data:4byte lbl_8057D7C0 = .sdata2:0x8057D7C0; // type:object size:0x4 align:4 data:float lbl_8057D7C4 = .sdata2:0x8057D7C4; // type:object size:0x4 align:4 data:float lbl_8057D7C8 = .sdata2:0x8057D7C8; // type:object size:0x4 align:4 data:float @@ -49055,23 +49069,23 @@ lbl_8057DA6C = .sdata2:0x8057DA6C; // type:object size:0x4 align:4 data:float lbl_8057DA70 = .sdata2:0x8057DA70; // type:object size:0x4 align:4 data:float lbl_8057DA74 = .sdata2:0x8057DA74; // type:object size:0x4 align:4 data:float lbl_8057DA78 = .sdata2:0x8057DA78; // type:object size:0x4 align:4 data:float -lbl_8057DA80 = .sdata2:0x8057DA80; // type:object size:0x4 align:4 data:float -lbl_8057DA84 = .sdata2:0x8057DA84; // type:object size:0x4 align:4 data:float -lbl_8057DA88 = .sdata2:0x8057DA88; // type:object size:0x4 align:4 data:float -lbl_8057DA8C = .sdata2:0x8057DA8C; // type:object size:0x4 align:4 data:float -lbl_8057DA90 = .sdata2:0x8057DA90; // type:object size:0x4 align:4 data:float -lbl_8057DA94 = .sdata2:0x8057DA94; // type:object size:0x4 align:4 data:float -lbl_8057DA98 = .sdata2:0x8057DA98; // type:object size:0x4 align:4 data:float -lbl_8057DA9C = .sdata2:0x8057DA9C; // type:object size:0x4 align:4 data:float -lbl_8057DAA0 = .sdata2:0x8057DAA0; // type:object size:0x4 align:4 data:float -lbl_8057DAA4 = .sdata2:0x8057DAA4; // type:object size:0x4 align:4 data:float -lbl_8057DAA8 = .sdata2:0x8057DAA8; // type:object size:0x4 align:4 data:float -lbl_8057DAAC = .sdata2:0x8057DAAC; // type:object size:0x4 align:4 data:float -lbl_8057DAB0 = .sdata2:0x8057DAB0; // type:object size:0x4 align:4 data:float -lbl_8057DAB4 = .sdata2:0x8057DAB4; // type:object size:0x4 align:4 data:float -lbl_8057DAB8 = .sdata2:0x8057DAB8; // type:object size:0x4 align:4 data:float -lbl_8057DAC0 = .sdata2:0x8057DAC0; // type:object size:0x8 align:8 data:double -lbl_8057DAC8 = .sdata2:0x8057DAC8; // type:object size:0x4 align:4 data:float +@12034 = .sdata2:0x8057DA80; // type:object size:0x4 scope:local align:4 data:float +@12035 = .sdata2:0x8057DA84; // type:object size:0x4 scope:local align:4 data:float +@12125 = .sdata2:0x8057DA88; // type:object size:0x4 scope:local align:4 data:float +@12177 = .sdata2:0x8057DA8C; // type:object size:0x4 scope:local align:4 data:float +@12178 = .sdata2:0x8057DA90; // type:object size:0x4 scope:local align:4 data:float +@12179 = .sdata2:0x8057DA94; // type:object size:0x4 scope:local align:4 data:float +@12217 = .sdata2:0x8057DA98; // type:object size:0x4 scope:local align:4 data:float +@12218 = .sdata2:0x8057DA9C; // type:object size:0x4 scope:local align:4 data:float +@12219 = .sdata2:0x8057DAA0; // type:object size:0x4 scope:local align:4 data:float +@12220 = .sdata2:0x8057DAA4; // type:object size:0x4 scope:local align:4 data:float +@12221 = .sdata2:0x8057DAA8; // type:object size:0x4 scope:local align:4 data:float +@12222 = .sdata2:0x8057DAAC; // type:object size:0x4 scope:local align:4 data:float +@12223 = .sdata2:0x8057DAB0; // type:object size:0x4 scope:local align:4 data:float +@12224 = .sdata2:0x8057DAB4; // type:object size:0x4 scope:local align:4 data:float +@12235 = .sdata2:0x8057DAB8; // type:object size:0x4 scope:local align:4 data:float +@12238 = .sdata2:0x8057DAC0; // type:object size:0x8 scope:local align:8 data:double +@12706 = .sdata2:0x8057DAC8; // type:object size:0x4 scope:local align:4 data:float lbl_8057DAD0 = .sdata2:0x8057DAD0; // type:object size:0x4 align:4 data:float lbl_8057DAD4 = .sdata2:0x8057DAD4; // type:object size:0x4 align:4 data:float lbl_8057DAD8 = .sdata2:0x8057DAD8; // type:object size:0x4 align:4 data:float @@ -49101,12 +49115,12 @@ lbl_8057DB34 = .sdata2:0x8057DB34; // type:object size:0x4 align:4 data:float lbl_8057DB38 = .sdata2:0x8057DB38; // type:object size:0x4 align:4 data:float lbl_8057DB3C = .sdata2:0x8057DB3C; // type:object size:0x4 align:4 data:float lbl_8057DB40 = .sdata2:0x8057DB40; // type:object size:0x4 align:4 data:float -lbl_8057DB48 = .sdata2:0x8057DB48; // type:object size:0x4 data:4byte +sNumHarpSongs__18dSndHarpSongData_c = .sdata2:0x8057DB48; // type:object size:0x4 data:4byte lbl_8057DB4C = .sdata2:0x8057DB4C; // type:object size:0x4 align:4 data:float -lbl_8057DB50 = .sdata2:0x8057DB50; // type:object size:0x4 align:4 data:float -lbl_8057DB54 = .sdata2:0x8057DB54; // type:object size:0x4 align:4 data:float -lbl_8057DB58 = .sdata2:0x8057DB58; // type:object size:0x4 align:4 data:float -lbl_8057DB60 = .sdata2:0x8057DB60; // type:object size:0x8 align:8 data:double +@2557 = .sdata2:0x8057DB50; // type:object size:0x4 scope:local align:4 data:float +@2558 = .sdata2:0x8057DB54; // type:object size:0x4 scope:local align:4 data:float +@2582 = .sdata2:0x8057DB58; // type:object size:0x4 scope:local align:4 data:float +@2585 = .sdata2:0x8057DB60; // type:object size:0x8 scope:local align:8 data:double lbl_8057DB68 = .sdata2:0x8057DB68; // type:object size:0x8 lbl_8057DB70 = .sdata2:0x8057DB70; // type:object size:0x8 lbl_8057DB78 = .sdata2:0x8057DB78; // type:object size:0x8 @@ -49180,12 +49194,12 @@ lbl_8057DC9C = .sdata2:0x8057DC9C; // type:object size:0x4 align:4 data:float lbl_8057DCA0 = .sdata2:0x8057DCA0; // type:object size:0x4 align:4 data:float lbl_8057DCA4 = .sdata2:0x8057DCA4; // type:object size:0x4 align:4 data:float lbl_8057DCA8 = .sdata2:0x8057DCA8; // type:object size:0x4 align:4 data:float -lbl_8057DCB0 = .sdata2:0x8057DCB0; // type:object size:0x4 align:4 data:float -lbl_8057DCB4 = .sdata2:0x8057DCB4; // type:object size:0x4 align:4 data:float -lbl_8057DCB8 = .sdata2:0x8057DCB8; // type:object size:0x4 align:4 data:float -lbl_8057DCC0 = .sdata2:0x8057DCC0; // type:object size:0x8 align:8 data:double -lbl_8057DCC8 = .sdata2:0x8057DCC8; // type:object size:0x4 align:4 data:float -lbl_8057DCCC = .sdata2:0x8057DCCC; // type:object size:0x4 align:4 data:float +@13901 = .sdata2:0x8057DCB0; // type:object size:0x4 scope:local align:4 data:float +@13964 = .sdata2:0x8057DCB4; // type:object size:0x4 scope:local align:4 data:float +@13982 = .sdata2:0x8057DCB8; // type:object size:0x4 scope:local align:4 data:float +@13985 = .sdata2:0x8057DCC0; // type:object size:0x8 scope:local align:8 data:double +@14618 = .sdata2:0x8057DCC8; // type:object size:0x4 scope:local align:4 data:float +@15015 = .sdata2:0x8057DCCC; // type:object size:0x4 scope:local align:4 data:float lbl_8057DCD0 = .sdata2:0x8057DCD0; // type:object size:0x4 align:4 data:float lbl_8057DCD4 = .sdata2:0x8057DCD4; // type:object size:0x4 align:4 data:float lbl_8057DCD8 = .sdata2:0x8057DCD8; // type:object size:0x4 align:4 data:float @@ -49215,28 +49229,28 @@ lbl_8057DD58 = .sdata2:0x8057DD58; // type:object size:0x4 align:4 data:float lbl_8057DD5C = .sdata2:0x8057DD5C; // type:object size:0x4 align:4 data:float lbl_8057DD60 = .sdata2:0x8057DD60; // type:object size:0x4 align:4 data:float lbl_8057DD64 = .sdata2:0x8057DD64; // type:object size:0x4 align:4 data:float -lbl_8057DD68 = .sdata2:0x8057DD68; // type:object size:0x4 align:4 data:float -lbl_8057DD6C = .sdata2:0x8057DD6C; // type:object size:0x4 align:4 data:float -lbl_8057DD70 = .sdata2:0x8057DD70; // type:object size:0x4 -lbl_8057DD74 = .sdata2:0x8057DD74; // type:object size:0x8 -lbl_8057DD7C = .sdata2:0x8057DD7C; // type:object size:0x4 -lbl_8057DD80 = .sdata2:0x8057DD80; // type:object size:0x4 -lbl_8057DD84 = .sdata2:0x8057DD84; // type:object size:0x4 -lbl_8057DD88 = .sdata2:0x8057DD88; // type:object size:0x8 -lbl_8057DD90 = .sdata2:0x8057DD90; // type:object size:0x4 -lbl_8057DD94 = .sdata2:0x8057DD94; // type:object size:0x8 -lbl_8057DD9C = .sdata2:0x8057DD9C; // type:object size:0x4 -lbl_8057DDA0 = .sdata2:0x8057DDA0; // type:object size:0x8 -lbl_8057DDA8 = .sdata2:0x8057DDA8; // type:object size:0x4 -lbl_8057DDAC = .sdata2:0x8057DDAC; // type:object size:0xC +@5033 = .sdata2:0x8057DD68; // type:object size:0x4 scope:local align:4 data:float +@5037 = .sdata2:0x8057DD6C; // type:object size:0x4 scope:local align:4 data:float +grp1 = .sdata2:0x8057DD70; // type:object size:0x2 scope:local +grp2 = .sdata2:0x8057DD74; // type:object size:0x5 scope:local +grp3 = .sdata2:0x8057DD7C; // type:object size:0x3 scope:local +grp5 = .sdata2:0x8057DD80; // type:object size:0x2 scope:local +grp7 = .sdata2:0x8057DD84; // type:object size:0x2 scope:local +grp8 = .sdata2:0x8057DD88; // type:object size:0x5 scope:local +grp10 = .sdata2:0x8057DD90; // type:object size:0x2 scope:local +grp11 = .sdata2:0x8057DD94; // type:object size:0x5 scope:local +grp13 = .sdata2:0x8057DD9C; // type:object size:0x2 scope:local +grp14 = .sdata2:0x8057DDA0; // type:object size:0x5 scope:local +grp15 = .sdata2:0x8057DDA8; // type:object size:0x3 scope:local +grp16 = .sdata2:0x8057DDAC; // type:object size:0x5 scope:local lbl_8057DDB8 = .sdata2:0x8057DDB8; // type:object size:0x4 align:4 data:float lbl_8057DDBC = .sdata2:0x8057DDBC; // type:object size:0x4 align:4 data:float lbl_8057DDC0 = .sdata2:0x8057DDC0; // type:object size:0x4 align:4 data:float lbl_8057DDC4 = .sdata2:0x8057DDC4; // type:object size:0x4 align:4 data:float lbl_8057DDC8 = .sdata2:0x8057DDC8; // type:object size:0x4 align:4 data:float lbl_8057DDCC = .sdata2:0x8057DDCC; // type:object size:0x4 align:4 data:float -lbl_8057DDD0 = .sdata2:0x8057DDD0; // type:object size:0x4 align:4 data:float -lbl_8057DDD4 = .sdata2:0x8057DDD4; // type:object size:0x4 align:4 data:float +@9361 = .sdata2:0x8057DDD0; // type:object size:0x4 scope:local align:4 data:float +@9362 = .sdata2:0x8057DDD4; // type:object size:0x4 scope:local align:4 data:float lbl_8057DDD8 = .sdata2:0x8057DDD8; // type:object size:0x4 align:4 data:float lbl_8057DDDC = .sdata2:0x8057DDDC; // type:object size:0x4 align:4 data:float lbl_8057DDE0 = .sdata2:0x8057DDE0; // type:object size:0x4 align:4 data:float @@ -49257,188 +49271,188 @@ lbl_8057DE20 = .sdata2:0x8057DE20; // type:object size:0x4 align:4 data:float lbl_8057DE24 = .sdata2:0x8057DE24; // type:object size:0x4 align:4 data:float lbl_8057DE28 = .sdata2:0x8057DE28; // type:object size:0x4 align:4 data:float lbl_8057DE2C = .sdata2:0x8057DE2C; // type:object size:0x4 align:4 data:float -lbl_8057DE30 = .sdata2:0x8057DE30; // type:object size:0x8 -lbl_8057DE38 = .sdata2:0x8057DE38; // type:object size:0x8 -lbl_8057DE40 = .sdata2:0x8057DE40; // type:object size:0x8 -lbl_8057DE48 = .sdata2:0x8057DE48; // type:object size:0x8 -lbl_8057DE50 = .sdata2:0x8057DE50; // type:object size:0x8 -lbl_8057DE58 = .sdata2:0x8057DE58; // type:object size:0x8 -lbl_8057DE60 = .sdata2:0x8057DE60; // type:object size:0x8 -lbl_8057DE68 = .sdata2:0x8057DE68; // type:object size:0x8 -lbl_8057DE70 = .sdata2:0x8057DE70; // type:object size:0x8 -lbl_8057DE78 = .sdata2:0x8057DE78; // type:object size:0x8 -lbl_8057DE80 = .sdata2:0x8057DE80; // type:object size:0x8 -lbl_8057DE88 = .sdata2:0x8057DE88; // type:object size:0x8 -lbl_8057DE90 = .sdata2:0x8057DE90; // type:object size:0x8 -lbl_8057DE98 = .sdata2:0x8057DE98; // type:object size:0x8 -lbl_8057DEA0 = .sdata2:0x8057DEA0; // type:object size:0x8 -lbl_8057DEA8 = .sdata2:0x8057DEA8; // type:object size:0x8 -lbl_8057DEB0 = .sdata2:0x8057DEB0; // type:object size:0x8 -lbl_8057DEB8 = .sdata2:0x8057DEB8; // type:object size:0x8 data:string -lbl_8057DEC0 = .sdata2:0x8057DEC0; // type:object size:0x8 -lbl_8057DEC8 = .sdata2:0x8057DEC8; // type:object size:0x8 data:string -lbl_8057DED0 = .sdata2:0x8057DED0; // type:object size:0x8 data:string -lbl_8057DED8 = .sdata2:0x8057DED8; // type:object size:0x8 data:string -lbl_8057DEE0 = .sdata2:0x8057DEE0; // type:object size:0x8 data:string -lbl_8057DEE8 = .sdata2:0x8057DEE8; // type:object size:0x8 -lbl_8057DEF0 = .sdata2:0x8057DEF0; // type:object size:0x8 -lbl_8057DEF8 = .sdata2:0x8057DEF8; // type:object size:0x8 data:string -lbl_8057DF00 = .sdata2:0x8057DF00; // type:object size:0x8 -lbl_8057DF08 = .sdata2:0x8057DF08; // type:object size:0x8 -lbl_8057DF10 = .sdata2:0x8057DF10; // type:object size:0x8 -lbl_8057DF18 = .sdata2:0x8057DF18; // type:object size:0x8 -lbl_8057DF20 = .sdata2:0x8057DF20; // type:object size:0x8 -lbl_8057DF28 = .sdata2:0x8057DF28; // type:object size:0x8 data:string -lbl_8057DF30 = .sdata2:0x8057DF30; // type:object size:0x8 data:string -lbl_8057DF38 = .sdata2:0x8057DF38; // type:object size:0x8 data:string -lbl_8057DF40 = .sdata2:0x8057DF40; // type:object size:0x8 data:string -lbl_8057DF48 = .sdata2:0x8057DF48; // type:object size:0x8 data:string -lbl_8057DF50 = .sdata2:0x8057DF50; // type:object size:0x8 data:string -lbl_8057DF58 = .sdata2:0x8057DF58; // type:object size:0x8 data:string -lbl_8057DF60 = .sdata2:0x8057DF60; // type:object size:0x8 data:string -lbl_8057DF68 = .sdata2:0x8057DF68; // type:object size:0x8 data:string -lbl_8057DF70 = .sdata2:0x8057DF70; // type:object size:0x8 data:string -lbl_8057DF78 = .sdata2:0x8057DF78; // type:object size:0x8 data:string -lbl_8057DF80 = .sdata2:0x8057DF80; // type:object size:0x8 data:string -lbl_8057DF88 = .sdata2:0x8057DF88; // type:object size:0x8 -lbl_8057DF90 = .sdata2:0x8057DF90; // type:object size:0x8 data:string -lbl_8057DF98 = .sdata2:0x8057DF98; // type:object size:0x8 data:string -lbl_8057DFA0 = .sdata2:0x8057DFA0; // type:object size:0x8 data:string -lbl_8057DFA8 = .sdata2:0x8057DFA8; // type:object size:0x8 data:string -lbl_8057DFB0 = .sdata2:0x8057DFB0; // type:object size:0x8 data:string -lbl_8057DFB8 = .sdata2:0x8057DFB8; // type:object size:0x8 data:string -lbl_8057DFC0 = .sdata2:0x8057DFC0; // type:object size:0x8 data:string -lbl_8057DFC8 = .sdata2:0x8057DFC8; // type:object size:0x8 data:string -lbl_8057DFD0 = .sdata2:0x8057DFD0; // type:object size:0x8 data:string -lbl_8057DFD8 = .sdata2:0x8057DFD8; // type:object size:0x8 data:string -lbl_8057DFE0 = .sdata2:0x8057DFE0; // type:object size:0x8 -lbl_8057DFE8 = .sdata2:0x8057DFE8; // type:object size:0x8 -lbl_8057DFF0 = .sdata2:0x8057DFF0; // type:object size:0x8 -lbl_8057DFF8 = .sdata2:0x8057DFF8; // type:object size:0x8 -lbl_8057E000 = .sdata2:0x8057E000; // type:object size:0x8 -lbl_8057E008 = .sdata2:0x8057E008; // type:object size:0x8 -lbl_8057E010 = .sdata2:0x8057E010; // type:object size:0x8 data:string -lbl_8057E018 = .sdata2:0x8057E018; // type:object size:0x8 -lbl_8057E020 = .sdata2:0x8057E020; // type:object size:0x8 data:string -lbl_8057E028 = .sdata2:0x8057E028; // type:object size:0x8 data:string -lbl_8057E030 = .sdata2:0x8057E030; // type:object size:0x8 data:string -lbl_8057E038 = .sdata2:0x8057E038; // type:object size:0x8 data:string -lbl_8057E040 = .sdata2:0x8057E040; // type:object size:0x8 data:string -lbl_8057E048 = .sdata2:0x8057E048; // type:object size:0x8 data:string -lbl_8057E050 = .sdata2:0x8057E050; // type:object size:0x8 data:string -lbl_8057E058 = .sdata2:0x8057E058; // type:object size:0x4 data:string -lbl_8057E05C = .sdata2:0x8057E05C; // type:object size:0x4 data:string -lbl_8057E060 = .sdata2:0x8057E060; // type:object size:0x8 -lbl_8057E068 = .sdata2:0x8057E068; // type:object size:0x8 -lbl_8057E070 = .sdata2:0x8057E070; // type:object size:0x8 -lbl_8057E078 = .sdata2:0x8057E078; // type:object size:0x8 -lbl_8057E080 = .sdata2:0x8057E080; // type:object size:0x8 -lbl_8057E088 = .sdata2:0x8057E088; // type:object size:0x8 -lbl_8057E090 = .sdata2:0x8057E090; // type:object size:0x8 -lbl_8057E098 = .sdata2:0x8057E098; // type:object size:0x8 -lbl_8057E0A0 = .sdata2:0x8057E0A0; // type:object size:0x8 -lbl_8057E0A8 = .sdata2:0x8057E0A8; // type:object size:0x8 -lbl_8057E0B0 = .sdata2:0x8057E0B0; // type:object size:0x8 -lbl_8057E0B8 = .sdata2:0x8057E0B8; // type:object size:0x8 -lbl_8057E0C0 = .sdata2:0x8057E0C0; // type:object size:0x8 -lbl_8057E0C8 = .sdata2:0x8057E0C8; // type:object size:0x8 -lbl_8057E0D0 = .sdata2:0x8057E0D0; // type:object size:0x8 -lbl_8057E0D8 = .sdata2:0x8057E0D8; // type:object size:0x8 -lbl_8057E0E0 = .sdata2:0x8057E0E0; // type:object size:0x8 -lbl_8057E0E8 = .sdata2:0x8057E0E8; // type:object size:0x8 data:string -lbl_8057E0F0 = .sdata2:0x8057E0F0; // type:object size:0x8 data:string -lbl_8057E0F8 = .sdata2:0x8057E0F8; // type:object size:0x8 -lbl_8057E100 = .sdata2:0x8057E100; // type:object size:0x8 data:string -lbl_8057E108 = .sdata2:0x8057E108; // type:object size:0x8 data:string -lbl_8057E110 = .sdata2:0x8057E110; // type:object size:0x8 data:string -lbl_8057E118 = .sdata2:0x8057E118; // type:object size:0x8 -lbl_8057E120 = .sdata2:0x8057E120; // type:object size:0x8 data:string -lbl_8057E128 = .sdata2:0x8057E128; // type:object size:0x8 -lbl_8057E130 = .sdata2:0x8057E130; // type:object size:0x8 -lbl_8057E138 = .sdata2:0x8057E138; // type:object size:0x8 -lbl_8057E140 = .sdata2:0x8057E140; // type:object size:0x8 data:string -lbl_8057E148 = .sdata2:0x8057E148; // type:object size:0x8 data:string -lbl_8057E150 = .sdata2:0x8057E150; // type:object size:0x8 data:string -lbl_8057E158 = .sdata2:0x8057E158; // type:object size:0x8 -lbl_8057E160 = .sdata2:0x8057E160; // type:object size:0x8 -lbl_8057E168 = .sdata2:0x8057E168; // type:object size:0x8 -lbl_8057E170 = .sdata2:0x8057E170; // type:object size:0x8 data:string -lbl_8057E178 = .sdata2:0x8057E178; // type:object size:0x8 -lbl_8057E180 = .sdata2:0x8057E180; // type:object size:0x8 data:string -lbl_8057E188 = .sdata2:0x8057E188; // type:object size:0x8 data:string -lbl_8057E190 = .sdata2:0x8057E190; // type:object size:0x8 -lbl_8057E198 = .sdata2:0x8057E198; // type:object size:0x8 data:string -lbl_8057E1A0 = .sdata2:0x8057E1A0; // type:object size:0x8 -lbl_8057E1A8 = .sdata2:0x8057E1A8; // type:object size:0x8 -lbl_8057E1B0 = .sdata2:0x8057E1B0; // type:object size:0x8 -lbl_8057E1B8 = .sdata2:0x8057E1B8; // type:object size:0x8 data:string -lbl_8057E1C0 = .sdata2:0x8057E1C0; // type:object size:0x8 -lbl_8057E1C8 = .sdata2:0x8057E1C8; // type:object size:0x8 -lbl_8057E1D0 = .sdata2:0x8057E1D0; // type:object size:0x8 data:string -lbl_8057E1D8 = .sdata2:0x8057E1D8; // type:object size:0x8 data:string -lbl_8057E1E0 = .sdata2:0x8057E1E0; // type:object size:0x8 data:string -lbl_8057E1E8 = .sdata2:0x8057E1E8; // type:object size:0x8 data:string -lbl_8057E1F0 = .sdata2:0x8057E1F0; // type:object size:0x8 data:string -lbl_8057E1F8 = .sdata2:0x8057E1F8; // type:object size:0x8 data:string -lbl_8057E200 = .sdata2:0x8057E200; // type:object size:0x8 data:string -lbl_8057E208 = .sdata2:0x8057E208; // type:object size:0x8 data:string -lbl_8057E210 = .sdata2:0x8057E210; // type:object size:0x8 data:string -lbl_8057E218 = .sdata2:0x8057E218; // type:object size:0x8 -lbl_8057E220 = .sdata2:0x8057E220; // type:object size:0x8 -lbl_8057E228 = .sdata2:0x8057E228; // type:object size:0x8 data:string -lbl_8057E230 = .sdata2:0x8057E230; // type:object size:0x8 -lbl_8057E238 = .sdata2:0x8057E238; // type:object size:0x8 data:string -lbl_8057E240 = .sdata2:0x8057E240; // type:object size:0x8 data:string -lbl_8057E248 = .sdata2:0x8057E248; // type:object size:0x8 -lbl_8057E250 = .sdata2:0x8057E250; // type:object size:0x8 data:string -lbl_8057E258 = .sdata2:0x8057E258; // type:object size:0x8 data:string -lbl_8057E260 = .sdata2:0x8057E260; // type:object size:0x8 -lbl_8057E268 = .sdata2:0x8057E268; // type:object size:0x8 -lbl_8057E270 = .sdata2:0x8057E270; // type:object size:0x8 -lbl_8057E278 = .sdata2:0x8057E278; // type:object size:0x8 data:string -lbl_8057E280 = .sdata2:0x8057E280; // type:object size:0x8 -lbl_8057E288 = .sdata2:0x8057E288; // type:object size:0x8 data:string -lbl_8057E290 = .sdata2:0x8057E290; // type:object size:0x8 data:string -lbl_8057E298 = .sdata2:0x8057E298; // type:object size:0x8 data:string -lbl_8057E2A0 = .sdata2:0x8057E2A0; // type:object size:0x8 data:string -lbl_8057E2A8 = .sdata2:0x8057E2A8; // type:object size:0x8 data:string -lbl_8057E2B0 = .sdata2:0x8057E2B0; // type:object size:0x8 data:string -lbl_8057E2B8 = .sdata2:0x8057E2B8; // type:object size:0x8 data:string -lbl_8057E2C0 = .sdata2:0x8057E2C0; // type:object size:0x8 data:string -lbl_8057E2C8 = .sdata2:0x8057E2C8; // type:object size:0x8 data:string -lbl_8057E2D0 = .sdata2:0x8057E2D0; // type:object size:0x8 -lbl_8057E2D8 = .sdata2:0x8057E2D8; // type:object size:0x8 data:string -lbl_8057E2E0 = .sdata2:0x8057E2E0; // type:object size:0x8 data:string -lbl_8057E2E8 = .sdata2:0x8057E2E8; // type:object size:0x8 data:string -lbl_8057E2F0 = .sdata2:0x8057E2F0; // type:object size:0x8 data:string -lbl_8057E2F8 = .sdata2:0x8057E2F8; // type:object size:0x8 data:string -lbl_8057E300 = .sdata2:0x8057E300; // type:object size:0x8 -lbl_8057E308 = .sdata2:0x8057E308; // type:object size:0x8 -lbl_8057E310 = .sdata2:0x8057E310; // type:object size:0x8 -lbl_8057E318 = .sdata2:0x8057E318; // type:object size:0x8 -lbl_8057E320 = .sdata2:0x8057E320; // type:object size:0x8 data:string -lbl_8057E328 = .sdata2:0x8057E328; // type:object size:0x8 data:string -lbl_8057E330 = .sdata2:0x8057E330; // type:object size:0x8 data:string -lbl_8057E338 = .sdata2:0x8057E338; // type:object size:0x8 data:string -lbl_8057E340 = .sdata2:0x8057E340; // type:object size:0x8 data:string -lbl_8057E348 = .sdata2:0x8057E348; // type:object size:0x8 data:string -lbl_8057E350 = .sdata2:0x8057E350; // type:object size:0x8 data:string -lbl_8057E358 = .sdata2:0x8057E358; // type:object size:0x8 data:string -lbl_8057E360 = .sdata2:0x8057E360; // type:object size:0x8 data:string -lbl_8057E368 = .sdata2:0x8057E368; // type:object size:0x8 -lbl_8057E370 = .sdata2:0x8057E370; // type:object size:0x8 data:string -lbl_8057E378 = .sdata2:0x8057E378; // type:object size:0x8 data:string -lbl_8057E380 = .sdata2:0x8057E380; // type:object size:0x8 data:string -lbl_8057E388 = .sdata2:0x8057E388; // type:object size:0x8 data:string -lbl_8057E390 = .sdata2:0x8057E390; // type:object size:0x4 data:string -lbl_8057E394 = .sdata2:0x8057E394; // type:object size:0x4 data:4byte -lbl_8057E398 = .sdata2:0x8057E398; // type:object size:0x4 align:4 data:float -lbl_8057E39C = .sdata2:0x8057E39C; // type:object size:0x4 align:4 data:float -lbl_8057E3A0 = .sdata2:0x8057E3A0; // type:object size:0x4 align:4 data:float -lbl_8057E3A4 = .sdata2:0x8057E3A4; // type:object size:0x4 align:4 data:float -lbl_8057E3A8 = .sdata2:0x8057E3A8; // type:object size:0x4 align:4 data:float -lbl_8057E3AC = .sdata2:0x8057E3AC; // type:object size:0x4 align:4 data:float -lbl_8057E3B0 = .sdata2:0x8057E3B0; // type:object size:0x4 align:4 data:float +@7014 = .sdata2:0x8057DE30; // type:object size:0x5 scope:local data:string +@7015 = .sdata2:0x8057DE38; // type:object size:0x5 scope:local data:string +@7016 = .sdata2:0x8057DE40; // type:object size:0x5 scope:local data:string +@7017 = .sdata2:0x8057DE48; // type:object size:0x6 scope:local data:string +@7018 = .sdata2:0x8057DE50; // type:object size:0x5 scope:local data:string +@7019 = .sdata2:0x8057DE58; // type:object size:0x5 scope:local data:string +@7020 = .sdata2:0x8057DE60; // type:object size:0x6 scope:local data:string +@7021 = .sdata2:0x8057DE68; // type:object size:0x6 scope:local data:string +@7022 = .sdata2:0x8057DE70; // type:object size:0x6 scope:local data:string +@7023 = .sdata2:0x8057DE78; // type:object size:0x6 scope:local data:string +@7024 = .sdata2:0x8057DE80; // type:object size:0x5 scope:local data:string +@7025 = .sdata2:0x8057DE88; // type:object size:0x5 scope:local data:string +@7026 = .sdata2:0x8057DE90; // type:object size:0x5 scope:local data:string +@7027 = .sdata2:0x8057DE98; // type:object size:0x7 scope:local data:string +@7028 = .sdata2:0x8057DEA0; // type:object size:0x6 scope:local data:string +@7029 = .sdata2:0x8057DEA8; // type:object size:0x5 scope:local data:string +@7030 = .sdata2:0x8057DEB0; // type:object size:0x6 scope:local data:string +@11 = .sdata2:0x8057DEB8; // type:object size:0x8 scope:local data:string +@12 = .sdata2:0x8057DEC0; // type:object size:0x7 scope:local data:string +@13 = .sdata2:0x8057DEC8; // type:object size:0x8 scope:local data:string +@14 = .sdata2:0x8057DED0; // type:object size:0x8 scope:local data:string +@15 = .sdata2:0x8057DED8; // type:object size:0x8 scope:local data:string +@16 = .sdata2:0x8057DEE0; // type:object size:0x8 scope:local data:string +@17 = .sdata2:0x8057DEE8; // type:object size:0x5 scope:local data:string +@18 = .sdata2:0x8057DEF0; // type:object size:0x5 scope:local data:string +@19 = .sdata2:0x8057DEF8; // type:object size:0x8 scope:local data:string +@20 = .sdata2:0x8057DF00; // type:object size:0x6 scope:local data:string +@21 = .sdata2:0x8057DF08; // type:object size:0x7 scope:local data:string +@22 = .sdata2:0x8057DF10; // type:object size:0x6 scope:local data:string +@23 = .sdata2:0x8057DF18; // type:object size:0x7 scope:local data:string +@24 = .sdata2:0x8057DF20; // type:object size:0x7 scope:local data:string +@25 = .sdata2:0x8057DF28; // type:object size:0x8 scope:local data:string +@26 = .sdata2:0x8057DF30; // type:object size:0x8 scope:local data:string +@27 = .sdata2:0x8057DF38; // type:object size:0x8 scope:local data:string +@28 = .sdata2:0x8057DF40; // type:object size:0x8 scope:local data:string +@29 = .sdata2:0x8057DF48; // type:object size:0x8 scope:local data:string +@31 = .sdata2:0x8057DF50; // type:object size:0x8 scope:local data:string +@33 = .sdata2:0x8057DF58; // type:object size:0x8 scope:local data:string +@34 = .sdata2:0x8057DF60; // type:object size:0x8 scope:local data:string +@35 = .sdata2:0x8057DF68; // type:object size:0x8 scope:local data:string +@36 = .sdata2:0x8057DF70; // type:object size:0x8 scope:local data:string +@38 = .sdata2:0x8057DF78; // type:object size:0x8 scope:local data:string +@40 = .sdata2:0x8057DF80; // type:object size:0x8 scope:local data:string +@42 = .sdata2:0x8057DF88; // type:object size:0x7 scope:local data:string +@43 = .sdata2:0x8057DF90; // type:object size:0x8 scope:local data:string +@44 = .sdata2:0x8057DF98; // type:object size:0x8 scope:local data:string +@45 = .sdata2:0x8057DFA0; // type:object size:0x8 scope:local data:string +@46 = .sdata2:0x8057DFA8; // type:object size:0x8 scope:local data:string +@47 = .sdata2:0x8057DFB0; // type:object size:0x8 scope:local data:string +@48 = .sdata2:0x8057DFB8; // type:object size:0x8 scope:local data:string +@49 = .sdata2:0x8057DFC0; // type:object size:0x8 scope:local data:string +@50 = .sdata2:0x8057DFC8; // type:object size:0x8 scope:local data:string +@51 = .sdata2:0x8057DFD0; // type:object size:0x8 scope:local data:string +@53 = .sdata2:0x8057DFD8; // type:object size:0x8 scope:local data:string +@58 = .sdata2:0x8057DFE0; // type:object size:0x7 scope:local data:string +@59 = .sdata2:0x8057DFE8; // type:object size:0x7 scope:local data:string +@60 = .sdata2:0x8057DFF0; // type:object size:0x7 scope:local data:string +@61 = .sdata2:0x8057DFF8; // type:object size:0x7 scope:local data:string +@62 = .sdata2:0x8057E000; // type:object size:0x7 scope:local data:string +@63 = .sdata2:0x8057E008; // type:object size:0x7 scope:local data:string +@64 = .sdata2:0x8057E010; // type:object size:0x8 scope:local data:string +@65 = .sdata2:0x8057E018; // type:object size:0x7 scope:local data:string +@66 = .sdata2:0x8057E020; // type:object size:0x8 scope:local data:string +@67 = .sdata2:0x8057E028; // type:object size:0x8 scope:local data:string +@68 = .sdata2:0x8057E030; // type:object size:0x8 scope:local data:string +@69 = .sdata2:0x8057E038; // type:object size:0x8 scope:local data:string +@70 = .sdata2:0x8057E040; // type:object size:0x8 scope:local data:string +@71 = .sdata2:0x8057E048; // type:object size:0x8 scope:local data:string +@72 = .sdata2:0x8057E050; // type:object size:0x8 scope:local data:string +@73 = .sdata2:0x8057E058; // type:object size:0x4 scope:local data:string +@74 = .sdata2:0x8057E05C; // type:object size:0x4 scope:local data:string +@75 = .sdata2:0x8057E060; // type:object size:0x5 scope:local data:string +@76 = .sdata2:0x8057E068; // type:object size:0x7 scope:local data:string +@77 = .sdata2:0x8057E070; // type:object size:0x6 scope:local data:string +@78 = .sdata2:0x8057E078; // type:object size:0x7 scope:local data:string +@79 = .sdata2:0x8057E080; // type:object size:0x7 scope:local data:string +@80 = .sdata2:0x8057E088; // type:object size:0x7 scope:local data:string +@81 = .sdata2:0x8057E090; // type:object size:0x7 scope:local data:string +@82 = .sdata2:0x8057E098; // type:object size:0x7 scope:local data:string +@83 = .sdata2:0x8057E0A0; // type:object size:0x7 scope:local data:string +@84 = .sdata2:0x8057E0A8; // type:object size:0x7 scope:local data:string +@85 = .sdata2:0x8057E0B0; // type:object size:0x7 scope:local data:string +@86 = .sdata2:0x8057E0B8; // type:object size:0x7 scope:local data:string +@87 = .sdata2:0x8057E0C0; // type:object size:0x7 scope:local data:string +@88 = .sdata2:0x8057E0C8; // type:object size:0x7 scope:local data:string +@89 = .sdata2:0x8057E0D0; // type:object size:0x6 scope:local data:string +@90 = .sdata2:0x8057E0D8; // type:object size:0x6 scope:local data:string +@91 = .sdata2:0x8057E0E0; // type:object size:0x6 scope:local data:string +@92 = .sdata2:0x8057E0E8; // type:object size:0x8 scope:local data:string +@93 = .sdata2:0x8057E0F0; // type:object size:0x8 scope:local data:string +@94 = .sdata2:0x8057E0F8; // type:object size:0x6 scope:local data:string +@95 = .sdata2:0x8057E100; // type:object size:0x8 scope:local data:string +@96 = .sdata2:0x8057E108; // type:object size:0x8 scope:local data:string +@97 = .sdata2:0x8057E110; // type:object size:0x8 scope:local data:string +@98 = .sdata2:0x8057E118; // type:object size:0x5 scope:local data:string +@99 = .sdata2:0x8057E120; // type:object size:0x8 scope:local data:string +@101 = .sdata2:0x8057E128; // type:object size:0x7 scope:local data:string +@102 = .sdata2:0x8057E130; // type:object size:0x7 scope:local data:string +@103 = .sdata2:0x8057E138; // type:object size:0x6 scope:local data:string +@104 = .sdata2:0x8057E140; // type:object size:0x8 scope:local data:string +@105 = .sdata2:0x8057E148; // type:object size:0x8 scope:local data:string +@106 = .sdata2:0x8057E150; // type:object size:0x8 scope:local data:string +@107 = .sdata2:0x8057E158; // type:object size:0x7 scope:local data:string +@108 = .sdata2:0x8057E160; // type:object size:0x7 scope:local data:string +@109 = .sdata2:0x8057E168; // type:object size:0x7 scope:local data:string +@110 = .sdata2:0x8057E170; // type:object size:0x8 scope:local data:string +@111 = .sdata2:0x8057E178; // type:object size:0x7 scope:local data:string +@112 = .sdata2:0x8057E180; // type:object size:0x8 scope:local data:string +@113 = .sdata2:0x8057E188; // type:object size:0x8 scope:local data:string +@114 = .sdata2:0x8057E190; // type:object size:0x7 scope:local data:string +@115 = .sdata2:0x8057E198; // type:object size:0x8 scope:local data:string +@116 = .sdata2:0x8057E1A0; // type:object size:0x7 scope:local data:string +@117 = .sdata2:0x8057E1A8; // type:object size:0x7 scope:local data:string +@118 = .sdata2:0x8057E1B0; // type:object size:0x4 scope:local data:string +@119 = .sdata2:0x8057E1B8; // type:object size:0x8 scope:local data:string +@120 = .sdata2:0x8057E1C0; // type:object size:0x7 scope:local data:string +@121 = .sdata2:0x8057E1C8; // type:object size:0x7 scope:local data:string +@122 = .sdata2:0x8057E1D0; // type:object size:0x8 scope:local data:string +@123 = .sdata2:0x8057E1D8; // type:object size:0x8 scope:local data:string +@124 = .sdata2:0x8057E1E0; // type:object size:0x8 scope:local data:string +@125 = .sdata2:0x8057E1E8; // type:object size:0x8 scope:local data:string +@126 = .sdata2:0x8057E1F0; // type:object size:0x8 scope:local data:string +@127 = .sdata2:0x8057E1F8; // type:object size:0x8 scope:local data:string +@128 = .sdata2:0x8057E200; // type:object size:0x8 scope:local data:string +@129 = .sdata2:0x8057E208; // type:object size:0x8 scope:local data:string +@130 = .sdata2:0x8057E210; // type:object size:0x8 scope:local data:string +@131 = .sdata2:0x8057E218; // type:object size:0x5 scope:local data:string +@132 = .sdata2:0x8057E220; // type:object size:0x6 scope:local data:string +@133 = .sdata2:0x8057E228; // type:object size:0x8 scope:local data:string +@134 = .sdata2:0x8057E230; // type:object size:0x7 scope:local data:string +@135 = .sdata2:0x8057E238; // type:object size:0x8 scope:local data:string +@136 = .sdata2:0x8057E240; // type:object size:0x8 scope:local data:string +@137 = .sdata2:0x8057E248; // type:object size:0x7 scope:local data:string +@138 = .sdata2:0x8057E250; // type:object size:0x8 scope:local data:string +@139 = .sdata2:0x8057E258; // type:object size:0x8 scope:local data:string +@140 = .sdata2:0x8057E260; // type:object size:0x7 scope:local data:string +@141 = .sdata2:0x8057E268; // type:object size:0x5 scope:local data:string +@142 = .sdata2:0x8057E270; // type:object size:0x4 scope:local data:string +@143 = .sdata2:0x8057E278; // type:object size:0x8 scope:local data:string +@144 = .sdata2:0x8057E280; // type:object size:0x5 scope:local data:string +@145 = .sdata2:0x8057E288; // type:object size:0x8 scope:local data:string +@146 = .sdata2:0x8057E290; // type:object size:0x8 scope:local data:string +@147 = .sdata2:0x8057E298; // type:object size:0x8 scope:local data:string +@148 = .sdata2:0x8057E2A0; // type:object size:0x8 scope:local data:string +@149 = .sdata2:0x8057E2A8; // type:object size:0x8 scope:local data:string +@150 = .sdata2:0x8057E2B0; // type:object size:0x8 scope:local data:string +@151 = .sdata2:0x8057E2B8; // type:object size:0x8 scope:local data:string +@152 = .sdata2:0x8057E2C0; // type:object size:0x8 scope:local data:string +@153 = .sdata2:0x8057E2C8; // type:object size:0x8 scope:local data:string +@154 = .sdata2:0x8057E2D0; // type:object size:0x7 scope:local data:string +@155 = .sdata2:0x8057E2D8; // type:object size:0x8 scope:local data:string +@156 = .sdata2:0x8057E2E0; // type:object size:0x8 scope:local data:string +@157 = .sdata2:0x8057E2E8; // type:object size:0x8 scope:local data:string +@158 = .sdata2:0x8057E2F0; // type:object size:0x8 scope:local data:string +@159 = .sdata2:0x8057E2F8; // type:object size:0x8 scope:local data:string +@160 = .sdata2:0x8057E300; // type:object size:0x7 scope:local data:string +@161 = .sdata2:0x8057E308; // type:object size:0x5 scope:local data:string +@162 = .sdata2:0x8057E310; // type:object size:0x5 scope:local data:string +@163 = .sdata2:0x8057E318; // type:object size:0x6 scope:local data:string +@164 = .sdata2:0x8057E320; // type:object size:0x8 scope:local data:string +@165 = .sdata2:0x8057E328; // type:object size:0x8 scope:local data:string +@170 = .sdata2:0x8057E330; // type:object size:0x8 scope:local data:string +@171 = .sdata2:0x8057E338; // type:object size:0x8 scope:local data:string +@172 = .sdata2:0x8057E340; // type:object size:0x8 scope:local data:string +@173 = .sdata2:0x8057E348; // type:object size:0x8 scope:local data:string +@175 = .sdata2:0x8057E350; // type:object size:0x8 scope:local data:string +@176 = .sdata2:0x8057E358; // type:object size:0x8 scope:local data:string +@177 = .sdata2:0x8057E360; // type:object size:0x8 scope:local data:string +@178 = .sdata2:0x8057E368; // type:object size:0x7 scope:local data:string +@179 = .sdata2:0x8057E370; // type:object size:0x8 scope:local data:string +@180 = .sdata2:0x8057E378; // type:object size:0x8 scope:local data:string +@181 = .sdata2:0x8057E380; // type:object size:0x8 scope:local data:string +@182 = .sdata2:0x8057E388; // type:object size:0x8 scope:local data:string +@183 = .sdata2:0x8057E390; // type:object size:0x4 scope:local data:string +sNumActorBaseNamePairs = .sdata2:0x8057E394; // type:object size:0x4 data:4byte +@4479 = .sdata2:0x8057E398; // type:object size:0x4 scope:local align:4 data:float +@4480 = .sdata2:0x8057E39C; // type:object size:0x4 scope:local align:4 data:float +@4481 = .sdata2:0x8057E3A0; // type:object size:0x4 scope:local align:4 data:float +@4482 = .sdata2:0x8057E3A4; // type:object size:0x4 scope:local align:4 data:float +@4483 = .sdata2:0x8057E3A8; // type:object size:0x4 scope:local align:4 data:float +@4616 = .sdata2:0x8057E3AC; // type:object size:0x4 scope:local align:4 data:float +@3193 = .sdata2:0x8057E3B0; // type:object size:0x4 scope:local align:4 data:float lbl_8057E3B8 = .sdata2:0x8057E3B8; // type:object size:0x4 align:4 data:float lbl_8057E3BC = .sdata2:0x8057E3BC; // type:object size:0x4 align:4 data:float lbl_8057E3C0 = .sdata2:0x8057E3C0; // type:object size:0x4 align:4 data:float @@ -49527,23 +49541,23 @@ lbl_8057E514 = .sdata2:0x8057E514; // type:object size:0x4 align:4 data:float lbl_8057E518 = .sdata2:0x8057E518; // type:object size:0x4 align:4 data:float lbl_8057E51C = .sdata2:0x8057E51C; // type:object size:0x4 align:4 data:float lbl_8057E520 = .sdata2:0x8057E520; // type:object size:0x4 align:4 data:float -lbl_8057E528 = .sdata2:0x8057E528; // type:object size:0x4 align:4 data:float -lbl_8057E52C = .sdata2:0x8057E52C; // type:object size:0x4 align:4 data:float -lbl_8057E530 = .sdata2:0x8057E530; // type:object size:0x4 align:4 data:float -lbl_8057E534 = .sdata2:0x8057E534; // type:object size:0x4 align:4 data:float -lbl_8057E538 = .sdata2:0x8057E538; // type:object size:0x4 align:4 data:float -lbl_8057E53C = .sdata2:0x8057E53C; // type:object size:0x4 align:4 data:float -lbl_8057E540 = .sdata2:0x8057E540; // type:object size:0x4 align:4 data:float -lbl_8057E544 = .sdata2:0x8057E544; // type:object size:0x4 align:4 data:float -lbl_8057E548 = .sdata2:0x8057E548; // type:object size:0x4 align:4 data:float -lbl_8057E54C = .sdata2:0x8057E54C; // type:object size:0x4 align:4 data:float -lbl_8057E550 = .sdata2:0x8057E550; // type:object size:0x4 align:4 data:float -lbl_8057E554 = .sdata2:0x8057E554; // type:object size:0x4 align:4 data:float -lbl_8057E558 = .sdata2:0x8057E558; // type:object size:0x4 align:4 data:float -lbl_8057E55C = .sdata2:0x8057E55C; // type:object size:0x4 align:4 data:float -lbl_8057E560 = .sdata2:0x8057E560; // type:object size:0x4 align:4 data:float -lbl_8057E564 = .sdata2:0x8057E564; // type:object size:0x4 align:4 data:float -lbl_8057E568 = .sdata2:0x8057E568; // type:object size:0x4 align:4 data:float +@27751 = .sdata2:0x8057E528; // type:object size:0x4 scope:local align:4 data:float +@27752 = .sdata2:0x8057E52C; // type:object size:0x4 scope:local align:4 data:float +@27753 = .sdata2:0x8057E530; // type:object size:0x4 scope:local align:4 data:float +@27754 = .sdata2:0x8057E534; // type:object size:0x4 scope:local align:4 data:float +@27835 = .sdata2:0x8057E538; // type:object size:0x4 scope:local align:4 data:float +@27858 = .sdata2:0x8057E53C; // type:object size:0x4 scope:local align:4 data:float +@27859 = .sdata2:0x8057E540; // type:object size:0x4 scope:local align:4 data:float +@27860 = .sdata2:0x8057E544; // type:object size:0x4 scope:local align:4 data:float +@27925 = .sdata2:0x8057E548; // type:object size:0x4 scope:local align:4 data:float +@27926 = .sdata2:0x8057E54C; // type:object size:0x4 scope:local align:4 data:float +@27927 = .sdata2:0x8057E550; // type:object size:0x4 scope:local align:4 data:float +@27928 = .sdata2:0x8057E554; // type:object size:0x4 scope:local align:4 data:float +@27929 = .sdata2:0x8057E558; // type:object size:0x4 scope:local align:4 data:float +@27930 = .sdata2:0x8057E55C; // type:object size:0x4 scope:local align:4 data:float +@27931 = .sdata2:0x8057E560; // type:object size:0x4 scope:local align:4 data:float +@28140 = .sdata2:0x8057E564; // type:object size:0x4 scope:local align:4 data:float +@28141 = .sdata2:0x8057E568; // type:object size:0x4 scope:local align:4 data:float lbl_8057E570 = .sdata2:0x8057E570; // type:object size:0x4 align:4 data:float lbl_8057E574 = .sdata2:0x8057E574; // type:object size:0x4 align:4 data:float lbl_8057E578 = .sdata2:0x8057E578; // type:object size:0x4 align:4 data:float @@ -52191,12 +52205,12 @@ l_wcsbuf = .bss:0x805D0510; // type:object size:0x540 scope:local l_wcsbuf = .bss:0x805D0A50; // type:object size:0x540 scope:local lbl_805D0F90 = .bss:0x805D0F90; // type:object size:0x24 align:4 data:float lbl_805D0FB8 = .bss:0x805D0FB8; // type:object size:0x30 align:4 data:float -lbl_805D0FE8 = .bss:0x805D0FE8; // type:object size:0x10 +@5909 = .bss:0x805D0FE8; // type:object size:0xC scope:local lbl_805D0FF8 = .bss:0x805D0FF8; // type:object size:0x10 align:4 data:float lbl_805D1008 = .bss:0x805D1008; // type:object size:0x10 align:4 data:float -lbl_805D1018 = .bss:0x805D1018; // type:object size:0x18 align:4 data:float -lbl_805D1030 = .bss:0x805D1030; // type:object size:0xC data:4byte -lbl_805D103C = .bss:0x805D103C; // type:object size:0x14 data:4byte +sParam__27dSndDistantSoundActorPool_c = .bss:0x805D1018; // type:object size:0x14 align:4 data:float +sGlob__15dSndFileManager = .bss:0x805D1030; // type:object size:0xC data:4byte +sFileManager = .bss:0x805D103C; // type:object size:0x14 scope:local data:4byte lbl_805D1050 = .bss:0x805D1050; // type:object size:0x80 data:4byte lbl_805D10D0 = .bss:0x805D10D0; // type:object size:0x80 data:4byte lbl_805D1160 = .bss:0x805D1160; // type:object size:0x1200 align:32 data:4byte diff --git a/configure.py b/configure.py index 566a8346..9a240a9c 100644 --- a/configure.py +++ b/configure.py @@ -410,7 +410,7 @@ config.libs = [ Object(Matching, "d/d_light_env.cpp"), Object(NonMatching, "toBeSorted/d_emitter.cpp"), Object(NonMatching, "toBeSorted/d_effects_2.cpp"), - Object(NonMatching, "toBeSorted/sound_info.cpp"), + Object(Matching, "toBeSorted/sound_info.cpp"), Object(NonMatching, "d/a/d_a_base.cpp"), Object(NonMatching, "d/a/obj/d_a_obj_base.cpp"), Object(NonMatching, "d/a/e/d_a_e_base.cpp"), @@ -735,7 +735,7 @@ config.libs = [ "progress_category": "game", "host": False, "objects": [ - Object(NonMatching, "d/snd/d_snd_mgr.cpp"), + Object(Matching, "d/snd/d_snd_mgr.cpp"), Object(Matching, "d/snd/d_snd_actor.cpp"), Object(NonMatching, "d/snd/d_snd_3d_actor.cpp"), Object(NonMatching, "d/snd/d_snd_3d_engine.cpp"), @@ -743,30 +743,69 @@ config.libs = [ Object(NonMatching, "d/snd/d_snd_player_mgr.cpp"), Object(NonMatching, "d/snd/d_snd_control_player_mgr.cpp"), Object(Matching, "d/snd/d_snd_3d_manager.cpp"), - # this one is a bit weird. it deals with all the stage definitions, - # but it's not actually the bgm manager? - Object(NonMatching, "d/snd/d_snd_stage_mgr.cpp"), - Object(NonMatching, "d/snd/d_snd_unk_component_2.cpp"), + Object(NonMatching, "d/snd/d_snd_state_mgr.cpp"), + Object(Matching, "d/snd/d_snd_stage_data.cpp"), + Object(NonMatching, "d/snd/d_snd_stage_reverb.cpp"), + Object(NonMatching, "d/snd/d_snd_stage_callbacks.cpp"), + Object(NonMatching, "d/snd/d_snd_event_callbacks.cpp"), + Object(NonMatching, "d/snd/d_snd_event_demo_callbacks.cpp"), Object(NonMatching, "d/snd/d_snd_area_sound_effect_mgr.cpp"), Object(NonMatching, "d/snd/d_snd_area_sound.cpp"), Object(Matching, "d/snd/d_snd_control_sound.cpp"), Object(Matching, "d/snd/d_snd_control_player.cpp"), Object(NonMatching, "d/snd/d_snd_bgm_mgr.cpp"), Object(NonMatching, "d/snd/d_snd_bgm_sound_callbacks.cpp"), - Object(NonMatching, "d/snd/d_snd_bgm_sound_boss_callbacks.cpp"), + Object(NonMatching, "d/snd/d_snd_bgm_sound_battle_callbacks.cpp"), Object(NonMatching, "d/snd/d_snd_bgm_sound.cpp"), - Object(NonMatching, "d/snd/d_snd_unk_15.cpp"), - Object(NonMatching, "d/snd/d_snd_small_effect_mgr.cpp"), - Object(NonMatching, "d/snd/d_snd_harp_mgr.cpp"), - Object(NonMatching, "d/snd/d_snd_anim_sound.cpp"), + Object(Matching, "d/snd/d_snd_bgm_sound_battle.cpp"), + Object(Matching, "d/snd/d_snd_bgm_sound_harp_mgr.cpp"), + Object(Matching, "d/snd/d_snd_bgm_seq_data_mgr.cpp"), + Object(NonMatching, "d/snd/d_snd_bgm_reverb.cpp"), + Object(Matching, "d/snd/d_snd_bgm_seq_config.cpp"), + Object(Matching, "d/snd/d_snd_bgm_harp_data.cpp"), + Object(Matching, "d/snd/d_snd_bgm_mml_parser_base.cpp"), + Object(Matching, "d/snd/d_snd_bgm_mml_parsers.cpp"), + Object(Matching, "d/snd/d_snd_small_effect_mgr.cpp"), + Object(NonMatching, "d/snd/d_snd_harp_song_mgr.cpp"), + Object(NonMatching, "d/snd/d_snd_harp_song_data.cpp"), + Object(Matching, "d/snd/d_snd_anim_sound.cpp"), Object(NonMatching, "d/snd/d_snd_source_mgr.cpp"), Object(NonMatching, "d/snd/d_snd_source_group.cpp"), - Object(NonMatching, "d/snd/d_snd_source.cpp"), - Object(NonMatching, "d/snd/d_snd_mgr_unk_7.cpp"), + Object(Matching, "d/snd/d_snd_source.cpp"), + Object(NonMatching, "d/snd/d_snd_source_player.cpp"), + Object(NonMatching, "d/snd/d_snd_source_player_head.cpp"), + Object(NonMatching, "d/snd/d_snd_source_enemy.cpp"), + Object(Matching, "d/snd/d_snd_source_obj.cpp"), + Object(Matching, "d/snd/d_snd_source_obj_clef.cpp"), + Object(Matching, "d/snd/d_snd_source_equipment.cpp"), Object(NonMatching, "d/snd/d_snd_mgr_unk_8.cpp"), - Object(NonMatching, "d/snd/d_snd_mgr_unk_9.cpp"), - Object(NonMatching, "d/snd/d_snd_mgr_unk_10.cpp"), - Object(NonMatching, "d/snd/d_snd_mgr_unk_11.cpp"), + Object(Matching, "d/snd/d_snd_source_npc_head.cpp"), + Object(Matching, "d/snd/d_snd_source_py_bird.cpp"), + Object(NonMatching, "d/snd/d_snd_source_demo.cpp"), + Object(NonMatching, "d/snd/d_snd_source_harp_related.cpp"), + Object(Matching, "d/snd/d_snd_source_tg_sound.cpp"), + Object(Matching, "d/snd/d_snd_id_mappers.cpp"), + Object(Matching, "d/snd/d_snd_id_mappers_data.cpp"), + Object(Matching, "d/snd/d_snd_distant_sound_actor_pool.cpp"), + Object(Matching, "d/snd/d_snd_distant_sound_actor.cpp"), + Object(Matching, "d/snd/d_snd_se_sound.cpp"), + Object(Matching, "d/snd/d_snd_se_sound_1.cpp"), + Object(Matching, "d/snd/d_snd_se_sound_2.cpp"), + Object(Matching, "d/snd/d_snd_se_sound_pool.cpp"), + Object(NonMatching, "d/snd/d_snd_sound_link_body_callbacks.cpp"), + Object(NonMatching, "d/snd/d_snd_sound_enemy_callbacks.cpp"), + Object(NonMatching, "d/snd/d_snd_sound_object_callbacks.cpp"), + Object(Matching, "d/snd/d_snd_sound_equipment_callbacks.cpp"), + Object(NonMatching, "d/snd/d_snd_sound_npc_callbacks.cpp"), + Object(NonMatching, "d/snd/d_snd_sound_npc_2_callbacks.cpp"), + Object(NonMatching, "d/snd/d_snd_sound_tgsound_callbacks.cpp"), + Object(NonMatching, "d/snd/d_snd_rng_link_voice.cpp"), + Object(NonMatching, "d/snd/d_snd_fi_vocal_mgr.cpp"), + Object(NonMatching, "d/snd/d_snd_rng.cpp"), + Object(Matching, "d/snd/d_snd_rng_mgr.cpp"), + Object(Matching, "d/snd/d_snd_rng_id.cpp"), + Object(Matching, "d/snd/d_snd_rng_id_if.cpp"), + Object(Matching, "d/snd/d_snd_file_mgr.cpp"), Object(NonMatching, "d/snd/d_snd_calc_pitch.cpp"), ], }, diff --git a/include/d/a/d_a_base.h b/include/d/a/d_a_base.h index ceadd9b5..17175279 100644 --- a/include/d/a/d_a_base.h +++ b/include/d/a/d_a_base.h @@ -9,18 +9,10 @@ #include "m/m_vec.h" #include "toBeSorted/actor_info.h" #include "toBeSorted/raii_ptr.h" -#include "toBeSorted/tlist.h" +#include "toBeSorted/sound_info.h" -class dAcBase_c; struct cBgS_PolyInfo; -struct SoundInfo { - dAcBase_c *actor; - dSoundSourceIf_c *sound_source; - mVec3_c *obj_pos; - TListNode mLink; -}; - /** * A list node that will automatically unlink upon destruction. */ @@ -67,10 +59,12 @@ public: // non-official name class dAcBase_c : public dBase_c { public: + typedef TList SoundInfoList; + /* 0x68 */ mHeapAllocator_c heap_allocator; /* 0x84 */ const ActorInfo *mpActorInfo; - /* 0x88 */ TList sound_list; - /* 0x94 */ RaiiPtr sound_source; + /* 0x88 */ SoundInfoList sound_list; + /* 0x94 */ RaiiPtr mpSoundSource; /* 0x98 */ mVec3_c *obj_pos; /* 0x9C */ mVec3_c pos_copy; /* 0xA8 */ u32 params2; @@ -84,7 +78,7 @@ public: /* 0xCC */ mVec3_c mScale; /* 0xD8 */ u32 actor_properties; /* 0xDC */ dAcRef_c actor_node; - /* 0xE8 */ u32 field_0xe8; + /* 0xE8 */ u32 mTgSndAreaFlags; /* 0xEC */ s8 roomid; /* 0xED */ u8 actor_subtype; /* 0xEE */ u8 polyAttr0; @@ -183,7 +177,7 @@ public: /* 8002c710 */ int initAllocatorWork1Heap(int size, char *name, int align); /* 8002c720 */ int initAllocator(int size, char *name, EGG::Heap *heap, int align); /* 8002c7b0 */ bool addActorToRoom(s32 roomId); - /* 8002c840 */ void setBit_field_0xE8(s32); + /* 8002c840 */ void setTgSndAreaFlag(s32); /* 8002cf10 */ u32 itemDroppingAndGivingRelated(mVec3_c *spawnPos, int subtype); /* 8002cf90 */ void fillUpperParams2Byte(); /* 8002cfa0 */ u32 getParams2_ignoreLower(); @@ -213,21 +207,21 @@ public: /* 8002d540 */ bool isRoomFlags_0x6_Set(); // Start of SoundSource stuff - /* 8002d590 */ void FUN_8002d590(); + /* 8002d590 */ void setSoundSourceSubtype(u8 subType); /* 8002d5b0 */ void FUN_8002d5b0(); - /* 8002d5d0 */ void playSound(u16 effect); - /* 8002d600 */ void FUN_8002d600(); - /* 8002d630 */ void FUN_8002d630(); - /* 8002d6d0 */ void FUN_8002d6d0(); - /* 8002d710 */ void playSoundEffect1(u16 effect); - /* 8002d740 */ void FUN_8002d740(); - /* 8002d770 */ void FUN_8002d770(u16, f32); - /* 8002d7a0 */ void FUN_8002d7a0(); - /* 8002d7d0 */ void FUN_8002d7d0(); - /* 8002d7f0 */ void FUN_8002d7f0(); - /* 8002d810 */ void FUN_8002d810(); - /* 8002d830 */ void FUN_8002d830(); - /* 8002d860 */ void FUN_8002d860(UNKWORD val); + /* 8002d5d0 */ bool startSound(u32 soundId); + /* 8002d600 */ bool startSoundWithFloatParam(u32 soundId, f32 param); + /* 8002d630 */ bool startBgHitSound(u32 soundId, const cBgS_PolyInfo &info, const mVec3_c *position); + /* 8002d6d0 */ bool startSoundAtPosition(u32 soundId, const mVec3_c *position); + /* 8002d710 */ bool holdSound(u32 soundId); + /* 8002d740 */ bool holdSoundWithIntParam(u32 soundId, s32 param); + /* 8002d770 */ bool holdSoundWithFloatParam(u32 soundId, f32 param); + /* 8002d7a0 */ bool holdSoundWithParams(u32 soundId, f32 fValue, s32 value); + /* 8002d7d0 */ void holdSoundSourceFlag(u32 mask); + /* 8002d7f0 */ void onSoundSourceFlag(u32 mask); + /* 8002d810 */ void offSoundSourceFlag(u32 mask); + /* 8002d830 */ bool isPlayingSound(u32 soundId); + /* 8002d860 */ void setBattleBgmRelated(UNKWORD val); /* 8002d880 */ dSoundSourceIf_c *getSoundSource(); // End of SoundSource stuff diff --git a/include/d/a/d_a_player.h b/include/d/a/d_a_player.h index 2672af43..786eabd6 100644 --- a/include/d/a/d_a_player.h +++ b/include/d/a/d_a_player.h @@ -93,6 +93,10 @@ public: return LINK; } + static dAcPy_c *GetLinkM() { + return LINK; + } + static dAcPy_c *GetLink2() { return LINK2; } diff --git a/include/d/col/bg/d_bg_pc.h b/include/d/col/bg/d_bg_pc.h index 23a60965..e3b05ced 100644 --- a/include/d/col/bg/d_bg_pc.h +++ b/include/d/col/bg/d_bg_pc.h @@ -27,6 +27,29 @@ enum dBgPc_ECode { /* 0x80000000 */ CODE_UNUSED_8000_0000 = 0x80000000, }; +enum dBgPc_PolyAttr0_e { + POLY_ATT_0_NONE = 0, + POLY_ATT_0_TUTI = 1, + POLY_ATT_0_ROCK = 2, + POLY_ATT_0_SAND = 3, + POLY_ATT_0_GRASS = 4, + POLY_ATT_0_TREE = 5, + POLY_ATT_0_LAVA = 6, + POLY_ATT_0_WATER = 7, + POLY_ATT_0_STONE = 8, + POLY_ATT_0_LOTUS = 9, + POLY_ATT_0_METAL = 10, + POLY_ATT_0_NUMA = 11, + POLY_ATT_0_TUTA = 12, + POLY_ATT_0_LIFE = 13, + POLY_ATT_0_CARPET = 14, + POLY_ATT_0_QSAND = 15, + POLY_ATT_0_WOOD = 16, + POLY_ATT_0_DEATH = 17, + + POLY_ATT_0_MAX = 18, +}; + enum dBgPc_Attribute { POLY_ATTR_NORMAL = 0, POLY_ATTR_SLOPE = 1, diff --git a/include/d/d_camera.h b/include/d/d_camera.h index f57fb520..5dbb0f61 100644 --- a/include/d/d_camera.h +++ b/include/d/d_camera.h @@ -33,6 +33,9 @@ public: mScreenShakeIntensity = val; } + bool isUnderwater() const; + f32 getUnderwaterDepth() const; + private: /* 0x068 */ u8 _0x068[0x6C - 0x068]; /* 0x06C */ mVec3_c mPositionMaybe; diff --git a/include/d/d_player_act.h b/include/d/d_player_act.h index 7c272127..1f618598 100644 --- a/include/d/d_player_act.h +++ b/include/d/d_player_act.h @@ -56,7 +56,7 @@ public: return false; } /* vt 0x0BC */ virtual void finishPlayingHarp() {} - /* vt 0x0C0 */ virtual bool isUsingWhip() { + /* vt 0x0C0 */ virtual bool isUsingWhip() const { return false; } /* vt 0x0C4 */ virtual bool anotherThingWithWhip() { @@ -611,6 +611,10 @@ public: return mAttackDirection != ATTACK_NONE; } + inline bool hasvt_0x1C0() const { + return vt_0x1C0() != nullptr; + } + static bool isInEvent(); bool isAttackingLeft() const; bool isAttackingRight() const; @@ -627,6 +631,9 @@ public: static mAng fn_8005BAA0(); static void updateCurrentSword(); + static bool isOutOfStamina(); + static f32 getStamina(); + static s32 getCurrentSwordType(); static const char *getSwordName(s32); static s32 getCurrentlyEquippedShieldType(); diff --git a/include/d/d_sc_game.h b/include/d/d_sc_game.h index ec04ea82..01b0f7bc 100644 --- a/include/d/d_sc_game.h +++ b/include/d/d_sc_game.h @@ -88,6 +88,10 @@ struct SpawnInfo { return (Trial)trial; } + const char *getStageName() const { + return stageName; + } + bool isNight() { return getTimeOfDay() == NIGHT; } diff --git a/include/d/lyt/msg_window/d_lyt_msg_window.h b/include/d/lyt/msg_window/d_lyt_msg_window.h index 069c4889..ab6cc7af 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window.h @@ -93,8 +93,8 @@ public: return mpTagProcessor; } - s32 getField_0x784() const { - return field_0x784; + s32 getMsgIdx() const { + return mMsgIdx; } u8 getField_0x80D() const { @@ -166,7 +166,7 @@ private: /* 0x778 */ s32 field_0x778; /* 0x77C */ s32 field_0x77C; /* 0x780 */ s32 field_0x780; - /* 0x784 */ s32 field_0x784; + /* 0x784 */ s32 mMsgIdx; /* 0x788 */ u16 mEntryPointToTrigger; /* 0x78A */ u16 mAlsoEntryPointToTrigger; diff --git a/include/d/snd/d_snd_3d_actor.h b/include/d/snd/d_snd_3d_actor.h index 6f3ad6d4..bdbfd365 100644 --- a/include/d/snd/d_snd_3d_actor.h +++ b/include/d/snd/d_snd_3d_actor.h @@ -3,12 +3,14 @@ #include "common.h" #include "d/snd/d_snd_misc.h" +#include "d/snd/d_snd_types.h" #include "nw4r/math/math_types.h" #include "nw4r/snd/snd_Sound3DActor.h" +#include "nw4r/snd/snd_SoundHandle.h" class dSnd3DActor_c : public nw4r::snd::Sound3DActor { public: - dSnd3DActor_c(dSndSourceParam *pSourceParam, u8 sourceType); + dSnd3DActor_c(dSndSourceParam *pSourceParam, s32 sourceType); virtual ~dSnd3DActor_c() {} @@ -16,9 +18,8 @@ public: return true; } - virtual void d_vt_0x34(const nw4r::math::VEC3 &); - - virtual void d_vt_0x38(bool flag, int fadeFrames) = 0; + virtual void setPosition(const nw4r::math::VEC3 &); // vt 0x34 + virtual void setPause(bool flag, int fadeFrames) = 0; // vt 0x38 virtual UNKWORD d_vt_0x3C() { return 0; @@ -32,12 +33,12 @@ public: return 0; } - virtual const nw4r::math::VEC3 &getPositionRelativeToPlayer(); - virtual f32 getDistanceToPlayer(); // vt 0x4C - virtual void updatePositionRelativeToPlayer(); // vt 0x50 - virtual void updateDistanceToPlayer(); // vt 0x54 - virtual void d_vt_0x58() = 0; - virtual void d_vt_0x5C() = 0; + virtual const nw4r::math::VEC3 &getPositionRelativeToPlayer(); // vt 0x48 + virtual f32 getDistanceToPlayer(); // vt 0x4C + virtual void updatePositionRelativeToPlayer(); // vt 0x50 + virtual void updateDistanceToPlayer(); // vt 0x54 + virtual void postStartSound(nw4r::snd::SoundHandle &handle, dSndSeSound_c *pSound, u32 id) = 0; // vt 0x58 + virtual void postHoldSound(nw4r::snd::SoundHandle &handle, dSndSeSound_c *pSound, u32 id, UNKWORD) = 0; // vt 0x5C void resetCachedRelativePositions(); @@ -50,6 +51,21 @@ public: void updatePositionRelativeToListener(); void updateDistanceToListener(); + void updateListenerParameters() { + calculatePositionRelativeToListener(); + mDistanceToListener = VECMag(mPositionRelativeToListener); + setFlag(0x1 | 0x2); + } + + void updateCameraTargetParameters() { + calculatePositionRelativeToCameraTarget(); + mDistanceToCameraTarget = VECMag(mPositionRelativeToCameraTarget); + setFlag(0x4 | 0x8); + } + + u32 getSomeUserParam(u32 soundId) const; + bool checkUserParamMask(u32 soundId, u32 mask) const; + bool checkFlag(u16 flag) const { return (mFlags & flag); } @@ -58,11 +74,33 @@ public: mFlags |= flag; } + void setDisabled(bool value) { + mIsDisabled = value; + } + f32 getDistanceToListener() { updateDistanceToListener(); return mDistanceToListener; } + f32 getSpeed() { + if (!checkFlag(0x400)) { + mSpeed = VECMag(GetVelocity()); + setFlag(0x400); + } + return mSpeed; + } + + f32 getDistanceToCameraTarget() { + updateDistanceToCameraTarget(); + return mDistanceToCameraTarget; + } + + const dSndSourceParam *getSourceParam() const { + return mpSourceParam; + } + void setSourceParam(const dSndSourceParam *param); + bool hasPlayingSounds() const; bool isPlayingSound(u32 id); @@ -72,16 +110,16 @@ public: protected: // a_ prefix to prevent multiple inheritance clashes /* 0x7D */ u8 a_field_0x7D; - /* 0x7E */ u8 a_field_0x7E; - /* 0x7F */ u8 a_field_0x7F; - /* 0x80 */ u8 a_field_0x80; + /* 0x7E */ bool mIsDisabled; + /* 0x7F */ bool mIsDemoActor; + /* 0x80 */ bool mIsPaused; /* 0x84 */ f32 a_field_0x84; /* 0x88 */ f32 a_field_0x88; /* 0x8C */ f32 a_field_0x8C; /* 0x90 */ f32 a_field_0x90; /* 0x94 */ f32 mDistanceToListener; /* 0x98 */ f32 mCameraDirectionDot; - /* 0x9C */ f32 a_field_0x9C; + /* 0x9C */ f32 mSpeed; /* 0xA0 */ nw4r::math::VEC3 mPositionRelativeToListener; /* 0xAC */ nw4r::math::VEC3 mPositionTransformedByListener; /* 0xB8 */ f32 mDistanceToCameraTarget; @@ -90,7 +128,7 @@ protected: /* 0xCC */ u16 mFlags; /* 0xD0 */ nw4r::math::VEC3 mPositionRelativeToPlayer; /* 0xDC */ f32 mDistanceToPlayer; - /* 0xE0 */ f32 a_field_0xE0; + /* 0xE0 */ f32 mFxSend3D; }; #endif diff --git a/include/d/snd/d_snd_3d_manager.h b/include/d/snd/d_snd_3d_manager.h index 2ac0b062..af45af62 100644 --- a/include/d/snd/d_snd_3d_manager.h +++ b/include/d/snd/d_snd_3d_manager.h @@ -4,7 +4,6 @@ #include "d/snd/d_snd_3d_engine.h" #include "d/snd/d_snd_util.h" #include "egg/gfx/eggCamera.h" -#include "m/m_vec.h" #include "nw4r/math/math_types.h" #include "nw4r/snd/snd_Sound3DListener.h" #include "nw4r/snd/snd_Sound3DManager.h" @@ -28,11 +27,11 @@ public: return mManager; } - const mVec3_c &getCameraTargetPos() const { + const nw4r::math::VEC3 &getCameraTargetPos() const { return mCameraTargetPosition; } - const mVec3_c &getNrmCameraDirection() const { + const nw4r::math::VEC3 &getNrmCameraDirection() const { return mCameraDirectionNormalized; } @@ -52,8 +51,8 @@ private: /* 0x018 */ nw4r::snd::Sound3DManager mManager; /* 0x044 */ nw4r::snd::Sound3DListener mListener; /* 0xB0 */ EGG::LookAtCamera mCamera; - /* 0x138 */ mVec3_c mCameraDirectionNormalized; - /* 0x144 */ mVec3_c mCameraTargetPosition; + /* 0x138 */ nw4r::math::VEC3 mCameraDirectionNormalized; + /* 0x144 */ nw4r::math::VEC3 mCameraTargetPosition; /* 0x150 */ f32 mCameraPosSqVelocity; /* 0x154 */ f32 mCameraAtSqVelocity; /* 0x158 */ f32 mCamDistance; diff --git a/include/d/snd/d_snd_anim_sound.h b/include/d/snd/d_snd_anim_sound.h new file mode 100644 index 00000000..a1686e17 --- /dev/null +++ b/include/d/snd/d_snd_anim_sound.h @@ -0,0 +1,38 @@ +#ifndef D_SND_ANIM_SOUND_H +#define D_SND_ANIM_SOUND_H + +#include "d/snd/d_snd_types.h" +#include "nw4r/snd/snd_AnimSound.h" + +// Could also inherit from AnimSound +class dSndAnimSound_c { +public: + dSndAnimSound_c(dSoundSource_c *source); + void setData(const void *data, const char *name); + void setFrame(f32 frame); + void resetFrame(f32 frame); + void setRate(f32 rate); + + void setCallback(dSoundSource_c *source); + void setCallback(nw4r::snd::AnimSound::Callback cb, void *userData); + + void shutdown() { + mSound.Shutdown(); + } + + void setField_0x98(f32 value) { + field_0x98 = value; + } + +private: + static void animCallback(int, s32, const char *, UNKWORD, void *userData); + + /* 0x00 */ nw4r::snd::AnimSound mSound; + /* 0x90 */ const void *mpData; + /* 0x94 */ f32 mRate; // TODO - is this actually used? + /* 0x98 */ f32 field_0x98; + /* 0x9C */ bool mNeedFrameReset; + /* 0xA0 */ nw4r::snd::AnimSound::PlayDirection mDirection; +}; + +#endif diff --git a/include/d/snd/d_snd_area_sound_effect_mgr.h b/include/d/snd/d_snd_area_sound_effect_mgr.h index aa4f7f72..288c40ad 100644 --- a/include/d/snd/d_snd_area_sound_effect_mgr.h +++ b/include/d/snd/d_snd_area_sound_effect_mgr.h @@ -5,6 +5,7 @@ #include "d/snd/d_snd_actor.h" #include "d/snd/d_snd_area_sound.h" #include "d/snd/d_snd_util.h" +#include "nw4r/snd/snd_SoundHandle.h" SND_DISPOSER_FORWARD_DECL(dSndAreaSoundEffectMgr_c); @@ -20,20 +21,30 @@ class dSndAreaSoundEffectMgr_c { public: dSndAreaSoundEffectMgr_c(); + void loadStageSound(f32 *pOutVolume); + bool startSound(u32 soundId, u32 handleIdx); void calc(); void stopSounds(s32 fadeFrames); + void pauseAllSounds(); + + bool holdInWaterLvSound(f32 depth); + void onEventStart(); + void onEventEnd(); private: + void calcPlayerVolume(); + void calcActorVolume(); bool isPlayingAnySound() const; bool isPlayingSound(u32 soundId) const; + void setTgSoundVolume(f32 volume, s32 fadeFrames); /* 0x010 */ dSndAreaSound_c mSounds[3]; - /* 0x328 */ UNKWORD field_0x328; + /* 0x328 */ nw4r::snd::SoundHandle mInWaterLvHandle; /* 0x32C */ f32 field_0x32C; /* 0x330 */ f32 field_0x330; /* 0x334 */ dSndActor_c mActor; - /* 0x388 */ f32 field_0x388; + /* 0x388 */ f32 mTargetVolume; }; #endif diff --git a/include/d/snd/d_snd_bgm_harp_data.h b/include/d/snd/d_snd_bgm_harp_data.h new file mode 100644 index 00000000..3c4cee7f --- /dev/null +++ b/include/d/snd/d_snd_bgm_harp_data.h @@ -0,0 +1,178 @@ +#ifndef D_SND_BGM_HARP_DATA_H +#define D_SND_BGM_HARP_DATA_H + +#include "common.h" +#include "d/snd/d_snd_rng_mgr.h" + +/** + * This file deals with the pitch of the Goddess' Harp when Link + * is freely strumming. In this case the pitch of the strings + * is adjusted to match the key of background music through sequence variables. + * When Link strums the harp, 12 strings can be heard, but it's actually only four + * notes of the same chord spanning three octaves. + * + * I haven't yet investigated all the data, but a typical chord Link might play + * is Cmaj^7, consisting of C-E-G-B. Link actually plays: + * G3-C4-E4-G4-B4-C5-E5-G5-B5-C6-E6-G6 + * B3 is missing, possibly to prevent dissonance at the ends of the scale. + * (Sealed Grounds, before Demise fight, no actual BGM) + * + * TODO: This deals with slightly more than the harp. It additionally + * also deals with the combat hit sounds that also seem to match up in + * pitch with the BGM. + */ + +/** + * Contains a single Seq sound var controlling the pitch of a subset of harp strings + * Size: 0x02 + */ +struct dSndBgmDataHarpVar_c { + dSndBgmDataHarpVar_c() : field_0x00(0), field_0x01(0) {} + + void reset() { + field_0x00 = 0; + field_0x01 = 0; + } + + void onFlag() { + field_0x00 |= 1; + } + + bool checkFlag() const { + return field_0x00 & 1; + } + + /* 0x00 */ u8 field_0x00; // flags + /* 0x01 */ s8 field_0x01; // var +}; + +/** + * Contains Seq sound vars for all harp strings, represents a "key" in the bgm music + * Size: 0x0C + */ +class dSndBgmDataHarpVarSetBase_c { +public: + dSndBgmDataHarpVarSetBase_c(s32 count); + ~dSndBgmDataHarpVarSetBase_c(); + + void resetVars(); + void addVar(u8 value); + + s32 getPosition() const { + return mPosition; + } + + void setPosition(s32 position) { + mPosition = position; + } + + s32 getCount() { + return mCount; + } + + s32 getMax() const { + return mMax; + } + + s32 getNumBitsSet() { + s32 numBits = 0; + for (int i = 0; i < getCount(); i++) { + if (mpVars[i].checkFlag()) { + numBits++; + } + } + return numBits; + } + + dSndBgmDataHarpVar_c *getVar(s32 idx) { + if (idx >= getCount()) { + return nullptr; + } + return &mpVars[idx]; + } + + s32 getRandomIdx() { + return dSndRngMgr_c::GetInstance()->rndIntRange(0, getCount()); + } + + s32 getRandomIdxWithBitSet() { + s32 numBitsSet = getNumBitsSet(); + s32 idx; + if (numBitsSet <= 0) { + return 0; + } else { + idx = dSndRngMgr_c::GetInstance()->rndIntRange(0, getCount()); + while (true) { + if (mpVars[idx].checkFlag()) { + return idx; + } + idx = dSndRngMgr_c::GetInstance()->rndIntRange(0, getCount()); + } + } + } + + s32 getVal(s32 idx) { + if (idx >= getCount()) { + return 0; + } + return mpVars[idx].field_0x01; + } + + dSndBgmDataHarpVar_c *getUnusedVar() { + if (mCount >= mMax) { + return nullptr; + } + return &mpVars[mCount]; + } + +private: + /* 0x00 */ dSndBgmDataHarpVar_c *mpVars; + /* 0x04 */ s32 mPosition; + /* 0x08 */ s16 mMax; + /* 0x0A */ s16 mCount; +}; + +class dSndBgmDataHarpVarSet_c : public dSndBgmDataHarpVarSetBase_c { +public: + dSndBgmDataHarpVarSet_c() : dSndBgmDataHarpVarSetBase_c(4) {} + +private: +}; + +/** + * Contains parsed seq data for harp strings for a single bgm sound + */ +class dSndBgmHarpDataBase_c { +public: + dSndBgmHarpDataBase_c(); + void resetVars(); + s32 getIdxForPosition(s32 position); + + dSndBgmDataHarpVarSetBase_c *getUsableVarSet(s32 idx); + void addVar(s32 position, s32 value, s32 unk); + void setField_0x08(s32 value); + +protected: + dSndBgmDataHarpVarSetBase_c *getVarSet(s32 idx); + /* 0x00 */ dSndBgmDataHarpVarSetBase_c *mpVarSets; + /* 0x04 */ s16 mMax; + /* 0x06 */ s16 mCount; + /* 0x08 */ s32 field_0x08; +}; + +class dSndBgmHarpData_c : public dSndBgmHarpDataBase_c { +public: + dSndBgmHarpData_c(); + ~dSndBgmHarpData_c(); + + /** + * Writes the Seq sound variables that control the pitch + * of the individual harp strings. + */ + void writeSeqVars(s32 idx); + +private: + static const u32 NUM_SETS = 300; +}; + +#endif diff --git a/include/d/snd/d_snd_bgm_mgr.h b/include/d/snd/d_snd_bgm_mgr.h new file mode 100644 index 00000000..ff8a31d7 --- /dev/null +++ b/include/d/snd/d_snd_bgm_mgr.h @@ -0,0 +1,205 @@ +#ifndef D_SND_BGM_MGR_H +#define D_SND_BGM_MGR_H + +#include "common.h" +#include "d/snd/d_snd_actor.h" +#include "d/snd/d_snd_sound.h" +#include "d/snd/d_snd_types.h" +#include "d/snd/d_snd_util.h" +#include "nw4r/snd/snd_FxReverbStdDpl2.h" +#include "nw4r/ut/ut_list.h" + +SND_DISPOSER_FORWARD_DECL(dSndBgmMgr_c); + +// Previous Ghidra name: FanfareSoundMgr +class dSndBgmMgr_c { +public: + SND_DISPOSER_MEMBERS(dSndBgmMgr_c); + +public: + static bool isSoundPlayedByBgmBattlePlayer(u32 soundId); + static bool isBgmBattle2(u32 soundId); + + enum BgmSoundList_e { + BGM_LIST_PREPARING = 0, + BGM_LIST_PLAYING = 1, + BGM_LIST_STOPPING = 2, + + BGM_LIST_MAX = 3, + }; + + dSndBgmMgr_c(); + void calc(); + void setup(EGG::Heap *heap); + + void restoreEffects(); + + bool playBgm(u32 soundId, s32 fadeFrames, bool paused); + bool prepareBgm(u32 soundId, u32 startOffset); + void pauseAllBgm(); + void stopAllBgm(s32 fadeFrames); + + void loadStageSound(); + void setBgmToPlayOnEventEnd(u32 soundId); + bool onEventEnd(); + void onEventStart(const char *eventName, s32 soundEventId, s32 unk); + bool onEventFinalize(const char *eventName, u32 soundEventId, bool skipped); + void prepareBgm(); + + void setOverrideBgmId(u32 id); + void activateOverrideBgmId(); + + void onTgSndAreaMgFlagsChange(u32 newFlags, u32 oldFlags); + void onTgSndAreaFlagsChange(u32 newFlags, u32 oldFlags); + + dSndBgmSound_c *getSoundHandleForBgm(u32 soundId, u32 startOffset); + bool isPlayingBgmSound() const; + bool isPlayingBgmSoundId(u32 soundId) const; + + bool isPreparingBgmSoundId(u32 soundId) const; + bool isFadingOutBgmSoundId(u32 soundId) const; + bool isPreparingBgmSoundIdWithStartOffset(u32 soundId, u32 startOffset) const; + bool isPreparedBgmSoundId(u32 soundId) const; + + void registSound(dSndSound_c *sound); + void unregistSound(dSndSound_c *sound); + + dSndSound_c *getFanSoundHandleForFan2(u32 soundId); + dSndSound_c *getSoundHandleCurrentlyPlayingFanSound(u32 soundId); + bool isCurrentlyPlayingFanSound(u32 soundId) const; + bool hasPlayingFanSounds() const; + + bool playFanSound(u32 soundId); + bool prepareFanSound(u32 soundId); + + void playDelayedSound(u32 soundId, s32 delay); + void cancelDelayedSound(); + void cancelDelayedBgm(); + + dSndBgmSound_c *getBgmSoundByIndex(u32 idx); + + bool prepareBossBgm(const char *name); + + /** + * E.g. Lizalfos fight in ET. Note that in the ET case, this is only called when triggering + * the fight without a cutscene, the cutscene code runs through "ELizarufos_c_opening" + */ + bool beginBgmBattleRoom(); + /** Runs when the fight is over, no matter how you started it */ + bool endBgmBattleRoom(); + + bool beginBgmBattleMainLoop(); + + bool isPlayingAnyBattleMusic(); + void cullTooManyPreparingSounds(); + + void removeFromAllBgmSoundLists(dSndBgmSound_c *sound); + void addToBgmSoundList(BgmSoundList_e list, dSndBgmSound_c *sound); + void appendToBgmSoundList(BgmSoundList_e list, dSndBgmSound_c *sound); + + // Unless there's a Ghidra decompiler bug this function + // always returns false + bool weirdCheckAlwaysFalse(); + + dSndBgmSound_c *getActiveBgmSound(); + // I don't love this inline but it fixes one regswap + // TODO look into getting rid of this one + dSndBgmSound_c *getActiveBgmSound_i() { + return getActiveBgmSound(); + } + + void setField_0x306(u8 val) { + field_0x306 = val; + } + + void setField_0x300(s32 v) { + field_0x300 = v; + } + + void setField_0x307(u8 val) { + field_0x307 = val; + } + + u8 getField_0x308() const { + return field_0x308; + } + + void updateField_0x2F4(f32 value) { + if (field_0x2F4 > value) { + field_0x2F4 = value; + } + } + +private: + dSndBgmBattleSound_c *getBgmBattleSound(); + + void startBgmMuteSound(); + void endBgmMuteSound(); + + bool stopBgmSound(dSndBgmSound_c *sound, s32 fadeFrames); + void checkForPrepareStoppedBgmSound(u32 stoppedSoundId); + dSndBgmSound_c *findNewBgmSoundHandle(); + dSndBgmSound_c *findIdleBgmSoundHandle(); + bool prepareBgmSound(u32 soundId, dSndBgmSound_c *handle, u32 startOffset); + bool startAdditionalBgm(u32 soundId); + + bool playBattleBgm(u32 soundId, bool intense); + + /** Used to mute other BGM when battle music is playing */ + void setBgmHandleIdxVolume(u32 handleIdx, f32 volume, s32 fadeFrames); + + bool isBgmHandleIdxPlayingSoundId(u32 handleIdx, u32 soundId); + bool stopBgmHandleIdx(u32 handleIdx, s32 fadeFrames); + + void calcLists(); + void calcStopOldBgmSounds(); + + void removeFromBgmSoundList(BgmSoundList_e list, dSndBgmSound_c *sound); + bool isInBgmSoundList(BgmSoundList_e list, dSndBgmSound_c *sound); + dSndBgmSound_c *getFirstInBgmSoundList(BgmSoundList_e list); + dSndBgmSound_c *getNextInBgmSoundList(BgmSoundList_e list, dSndBgmSound_c *sound); + dSndBgmSound_c *getLastInBgmSoundList(BgmSoundList_e list); + + bool startDelayedSound(); + void calcDelayedSound(); + + dSndBgmSound_c *getBgmSoundHandleForId(u32 soundId) const; + + dSndSound_c *getFreeFanSoundHandle(); + dSndSound_c *getFanSoundHandleForFan(u32 soundId); + void stopFanSounds(s32 fadeFrames); + + bool isSoundRegist(dSndSound_c *sound); + + /* 0x010 */ nw4r::snd::FxReverbStdDpl2 mFx; + /* 0x240 */ UNKWORD field_0x240; + /* 0x244 */ UNKWORD field_0x244; + /* 0x248 */ UNKWORD field_0x248; + /* 0x24C */ u32 mScheduledSoundId; + /* 0x250 */ s32 mScheduledSoundDelay; + /* 0x254 */ dSndBgmSound_c *mBgmSounds[7]; + /* 0x270 */ dSndBgmSound_c *mpBgmMuteSound; + /* 0x274 */ dSndBgmSound_c *mpPrevActiveBgmSound; + /* 0x278 */ nw4r::ut::List mBgmSoundLists[BGM_LIST_MAX]; // node offset 0xF0 -> dSndBgmSound_c + /* 0x29C */ UNKWORD field_0x29C; + /* 0x2A0 */ dSndActor_c mSoundActor; + /* 0x2F4 */ f32 field_0x2F4; + /* 0x2F8 */ u32 mBgmToPlayOnEventEnd; + /* 0x2FC */ u8 field_0x2FC; + /* 0x300 */ s32 field_0x300; + /* 0x304 */ u8 field_0x304; + /* 0x305 */ u8 field_0x305; + /* 0x306 */ u8 field_0x306; + /* 0x307 */ u8 field_0x307; + /* 0x308 */ u8 field_0x308; + /* 0x30C */ dSndTagData *field_0x30C[3]; + /* 0x318 */ u32 field_0x318[3]; + /* 0x324 */ u32 field_0x324[3]; + /* 0x330 */ u8 field_0x330[3]; + /* 0x333 */ u8 field_0x333; + /* 0x334 */ dSndSound_c *mFanSounds[3]; + /* 0x340 */ u8 field_0x340; + /* 0x344 */ LIST_MEMBER(dSndSound_c, AllSounds); // node offset 0x8 +}; + +#endif diff --git a/include/d/snd/d_snd_bgm_mml_parser_base.h b/include/d/snd/d_snd_bgm_mml_parser_base.h new file mode 100644 index 00000000..9debde20 --- /dev/null +++ b/include/d/snd/d_snd_bgm_mml_parser_base.h @@ -0,0 +1,203 @@ +#ifndef D_SND_BGM_MML_PARSER_BASE_H +#define D_SND_BGM_MML_PARSER_BASE_H + +#include "common.h" +#include "nw4r/snd/snd_SoundArchive.h" +#include "nw4r/snd/snd_SoundArchivePlayer.h" + +// [R89JEL]:/bin/RVL/Debug/mainD.elf:.debug::0x2cdd6 +struct dBgmMmlCallStack +{ + bool loopFlag; // size 0x01, offset 0x00 + u8 loopCount; // size 0x01, offset 0x01 + /* 2 bytes padding */ + byte_t const *address; // size 0x04, offset 0x04 +}; // size 0x08 + +/** + * Size: 0x28 + */ +struct dBgmMmlTrack { + /* 0x00 */ const byte_t *currentAddr; + /* 0x04 */ u8 mTrackNo; + /* 0x05 */ bool mTrackUsed; + /* 0x06 */ u8 cmpFlag; + /* 0x08 */ s32 wait; + /* 0x0C */ dBgmMmlCallStack callStack[3]; + /* 0x24 */ s32 callStackDepth; +}; + +/** + * @brief Parses harp key data + * + * Partial copy of nw4r::snd::detail::MmlParser + */ +class dSndBgmMmlParser_c { +protected: + // [R89JEL]:/bin/RVL/Debug/mainD.elf:.debug::0x2d70c + // Swapped - or maybe just returns a boolean + enum ParseResult { + PARSE_RESULT_FINISH, + PARSE_RESULT_CONTINUE, + }; + + // [R89JEL]:/bin/RVL/Debug/mainD.elf:.debug::0x31279 + enum SeqArgType { + SEQ_ARG_NONE, + + SEQ_ARG_U8, + SEQ_ARG_S16, + SEQ_ARG_VMIDI, + SEQ_ARG_RANDOM, + SEQ_ARG_VARIABLE, + }; + + enum MmlCommand { + MML_CMD_MIN = 0x80, // <80 -> MML note, not a command + MML_CMD_MAX = 0xff, + + MML_CMD_MASK = 0x80, + MML_CMD_SET_MASK = 0xf0, + + MML_WAIT = 0x80, + MML_SET_PRGNO, + + MML_OPEN_TRACK = 0x88, + MML_JUMP, + MML_CALL, + + MML_ARG_1_RANDOM = 0xa0, + MML_ARG_1_VARIABLE, + MML_EXEC_IF, + MML_ARG_2_S16, + MML_ARG_2_RANDOM, + MML_ARG_2_VARIABLE, + + MML_SET_TIMEBASE = 0xb0, + MML_SET_ENV_HOLD, + MML_SET_MONOPHONIC, + MML_SET_TRACK_VELOCITY_RANGE, + MML_SET_BIQUAD_TYPE, + MML_SET_BIQUAD_VALUE, + + MML_SET_PAN = 0xc0, + MML_SET_TRACK_VOLUME, + MML_SET_PLAYER_VOLUME, + MML_SET_TRANSPOSE, + MML_SET_PITCH_BEND, + MML_SET_BEND_RANGE, + MML_SET_PRIORITY, + MML_SET_NOTE_WAIT, + MML_SET_TIE, + MML_SET_PORTAMENTO, + MML_SET_LFO_DEPTH, + MML_SET_LFO_SPEED, + MML_SET_LFO_TARGET, + MML_SET_LFO_RANGE, + MML_SET_PORTASPEED, + MML_SET_PORTATIME, + + MML_SET_ATTACK = 0xd0, + MML_SET_DECAY, + MML_SET_SUSTAIN, + MML_SET_RELEASE, + MML_LOOP_START, + MML_SET_TRACK_VOLUME2, + MML_PRINT_VAR, + MML_SET_SURROUND_PAN, + MML_SET_LPF_FREQ, + MML_SET_FX_SEND_A, + MML_SET_FX_SEND_B, + MML_SET_MAIN_SEND, + MML_SET_INIT_PAN, + MML_SET_MUTE, + MML_SET_FX_SEND_C, + MML_SET_DAMPER, + + MML_SET_LFO_DELAY = 0xe0, + MML_SET_TEMPO, + MML_SET_E2, + MML_SET_SWEEP_PITCH, + + MML_RESET_ADSR = 0xfb, + MML_LOOP_END, + MML_RET, + MML_ALLOC_TRACK, + MML_EOF + }; + + enum MmlExCommand { + MML_EX_COMMAND = 0xf0, + + MML_EX_CMD_MAX = 0xffff, + + MML_EX_ARITHMETIC = 0x80, + MML_EX_SET = 0x80, + MML_EX_APL, + MML_EX_AMI, + MML_EX_AMU, + MML_EX_ADV, + MML_EX_ALS, + MML_EX_RND, + MML_EX_AAD, + MML_EX_AOR, + MML_EX_AER, + MML_EX_ACO, + MML_EX_AMD, + + MML_EX_LOGIC = 0x90, + MML_EX_EQ = 0x90, + MML_EX_GE, + MML_EX_GT, + MML_EX_LE, + MML_EX_LT, + MML_EX_NE, + + MML_EX_USERPROC = 0xe0, + }; + +public: + dSndBgmMmlParser_c(nw4r::snd::SoundArchivePlayer *player, nw4r::snd::SoundArchive *archive); + + virtual void CommandProc(u32 trackNo, int wait, u32 command, s32 commandArg1, s32 commandArg2) const; + virtual void NoteOnCommandProc(u32 trackNo, int wait, int key, int velocity, s32 length) const; + +protected: + bool loadAndParse(u32 soundId, u32 trackMask, bool noJumps); + +private: + bool readTracks(u32 soundId, u32 trackMask, bool noJumps); + void initTrack(s32 trackNo, u32 offset); + ParseResult Parse(dBgmMmlTrack *track) const; + void CommandProc_(dBgmMmlTrack *track, u32 command, s32 commandArg1, s32 commandArg2) const; + + u8 ReadByte(byte_t const **ptr) const { + return *(*ptr)++; + } + u16 Read16(byte_t const **ptr) const; + u32 Read24(byte_t const **ptr) const; + s32 ReadVar(byte_t const **ptr) const; + s32 ReadArg(byte_t const **ptr, SeqArgType argType) const; + + // static members +public: + static int const TEMPO_MAX = 1023; + static int const TEMPO_MIN = 0; + static int const CALL_STACK_DEPTH = 3; + static int const SURROUND_PAN_CENTER; + static int const PAN_CENTER = 64; + +private: + static bool mPrintVarEnabledFlag; + + // members +private: + /* vtable */ // size 0x04, offset 0x00 + /* 0x04 */ u8 field_0x04; + /* 0x08 */ nw4r::snd::SoundArchivePlayer *mpPlayer; + /* 0x0C */ nw4r::snd::SoundArchive *mpArchive; + /* 0x10 */ const byte_t *baseAddr; + /* 0x14 */ dBgmMmlTrack mTracks[16]; +}; // size 0x04 + +#endif diff --git a/include/d/snd/d_snd_bgm_mml_parsers.h b/include/d/snd/d_snd_bgm_mml_parsers.h new file mode 100644 index 00000000..e36932b4 --- /dev/null +++ b/include/d/snd/d_snd_bgm_mml_parsers.h @@ -0,0 +1,81 @@ +#ifndef D_SND_BGM_MML_PARSERS_H +#define D_SND_BGM_MML_PARSERS_H + +#include "d/snd/d_snd_bgm_mml_parser_base.h" +#include "d/snd/d_snd_types.h" + +class dSndBgmMmlParserHarp_c : dSndBgmMmlParser_c { +public: + dSndBgmMmlParserHarp_c(dSndBgmSoundHarpMgr_c *mgr); + + virtual void CommandProc(u32 trackNo, int wait, u32 command, s32 commandArg1, s32 commandArg2) const override; + virtual void NoteOnCommandProc(u32 trackNo, int wait, int key, int velocity, s32 length) const override; + + bool parseData(const char *soundLabel, u32 baseSoundId, u32 trackMask); + bool parseData(u32 baseSoundId, u32 trackMask); + +private: + /* 0x294 */ dSndBgmSoundHarpMgr_c *field_0x294; + /* 0x298 */ dSndBgmSoundHarpMgr_c *field_0x298; +}; + +class dSndBgmMmlParserHarpSong_c : dSndBgmMmlParser_c { +public: + dSndBgmMmlParserHarpSong_c(); + + virtual void CommandProc(u32 trackNo, int wait, u32 command, s32 commandArg1, s32 commandArg2) const override; + virtual void NoteOnCommandProc(u32 trackNo, int wait, int key, int velocity, s32 length) const override; + + bool parseData(u32 soundId, dSndHarpSongData_c *pData); + +private: + /* 0x294 */ dSndHarpSongData_c *field_0x294; +}; + +struct dSndTagData { + /* 0x00 */ u32 size; + /* 0x04 */ u32 data[]; +}; + +class dSndBgmMmlParserTagBattle_c : dSndBgmMmlParser_c { +public: + dSndBgmMmlParserTagBattle_c(); + + virtual void NoteOnCommandProc(u32 trackNo, int wait, int key, int velocity, s32 length) const override; + + bool parseData(u32 soundId, dSndTagData **pOutData); + +private: + /* 0x294 */ dSndTagData *mpBuf; + /* 0x298 */ mutable u32 mBufSize; +}; + +class dSndBgmMmlParserTagBgmBoss_c : dSndBgmMmlParser_c { +public: + dSndBgmMmlParserTagBgmBoss_c(); + + virtual void NoteOnCommandProc(u32 trackNo, int wait, int key, int velocity, s32 length) const override; + + void parseData(dSndTagData **pOutData1, dSndTagData **pOutData2); + +private: + /* 0x294 */ dSndTagData *mpBuf1; + /* 0x298 */ dSndTagData *mpBuf2; + /* 0x29C */ mutable u32 mBufSize1; + /* 0x2A0 */ mutable u32 mBufSize2; +}; + +class dSndBgmMmlParserTagCompNote_c : dSndBgmMmlParser_c { +public: + dSndBgmMmlParserTagCompNote_c(); + + virtual void NoteOnCommandProc(u32 trackNo, int wait, int key, int velocity, s32 length) const override; + + void parseData(dSndTagData **pOutData); + +private: + /* 0x294 */ dSndTagData *mpBuf; + /* 0x298 */ mutable u32 mBufSize; +}; + +#endif diff --git a/include/d/snd/d_snd_bgm_seq_config.h b/include/d/snd/d_snd_bgm_seq_config.h new file mode 100644 index 00000000..a66a8131 --- /dev/null +++ b/include/d/snd/d_snd_bgm_seq_config.h @@ -0,0 +1,30 @@ +#ifndef D_SND_BGM_SEQ_CONFIG_H +#define D_SND_BGM_SEQ_CONFIG_H + +#include "common.h" + +struct dSndBgmSeqConfig { + /* 0x00 */ u32 soundId; + /* 0x04 */ s32 field_0x04; + /* 0x08 */ s32 mTimebase; + /* 0x0C */ u16 mLoopStart; + /* 0x0E */ u16 mLoopEnd; + + + static const dSndBgmSeqConfig *getConfig(u32 soundId, s32 unkParam); +}; + +struct dSndBgmBattleConfig_MuteUnmuteMasks { + /* 0x00 */ u16 unmuteMask; + /* 0x02 */ u16 muteMask; +}; + +struct dSndBgmBattleConfig { + /* 0x00 */ u32 soundId; + /* 0x04 */ dSndBgmBattleConfig_MuteUnmuteMasks mTrackMasks[3]; + + static bool hasConfig(u32 soundId); + static const dSndBgmBattleConfig *getConfig(u32 soundId); +}; + +#endif diff --git a/include/d/snd/d_snd_bgm_seq_data_mgr.h b/include/d/snd/d_snd_bgm_seq_data_mgr.h new file mode 100644 index 00000000..adc1ead6 --- /dev/null +++ b/include/d/snd/d_snd_bgm_seq_data_mgr.h @@ -0,0 +1,32 @@ +#ifndef D_SND_BGM_SEQ_DATA_MGR_H +#define D_SND_BGM_SEQ_DATA_MGR_H + +#include "common.h" +#include "d/snd/d_snd_types.h" +#include "d/snd/d_snd_util.h" + +SND_DISPOSER_FORWARD_DECL(dSndBgmSeqDataMgr_c); + +// Previous Ghidra name: SomeUnusedSoundMgr +class dSndBgmSeqDataMgr_c { +public: + SND_DISPOSER_MEMBERS(dSndBgmSeqDataMgr_c); + +public: + dSndBgmSeqDataMgr_c(); + + static const char *getDataPrefix(); + static u32 getDataPrefixLength(); + + dSndBgmSoundHarpMgr_c *getHarpMgrForSoundId(u32 soundId); + void setup(); + void setupState0(); + +private: + static const s32 NUM_SOUNDS = 2; + + /* 0x10 */ dSndBgmSoundHarpMgr_c *mpMgrs; + /* 0x14 */ bool mInitialized; +}; + +#endif diff --git a/include/d/snd/d_snd_bgm_sound.h b/include/d/snd/d_snd_bgm_sound.h new file mode 100644 index 00000000..3d4ccd7b --- /dev/null +++ b/include/d/snd/d_snd_bgm_sound.h @@ -0,0 +1,101 @@ +#ifndef D_SND_BGM_SOUND_H +#define D_SND_BGM_SOUND_H + +#include "common.h" +#include "d/snd/d_snd_bgm_sound_harp_mgr.h" +#include "d/snd/d_snd_sound.h" +#include "nw4r/snd/snd_SoundStartable.h" +#include "nw4r/ut/ut_list.h" + +class dSndBgmSound_c : public dSndSound_c { + enum BgmSoundFlags_e { + BGM_FLAG_BATTLE = 0x1, + BGM_FLAG_0x8 = 0x8, + BGM_FLAG_0x10 = 0x10, + BGM_FLAG_PAUSED = 0x20, + BGM_FLAG_0x40 = 0x40, + }; + +public: + typedef void (*StopCallback)(bool); + typedef void (*CalcCallback)(dSndBgmSound_c *sound); + + dSndBgmSound_c(); + + virtual void cancel() override; // vt 0x08 + virtual void calc() override; // vt 0x0C + virtual void fadeIn(u32 id, s32 fadeFrames) override; // vt 0x10 + virtual nw4r::snd::SoundStartable::StartResult prepareSound(u32 soundId, u32 startOffset) override; // vt 0x14 + virtual nw4r::snd::SoundStartable::StartResult prepareSound(const char *label, u32 startOffset) override; // vt 0x18 + virtual void onPreparing(u32 soundId, u32 startOffset) override; // vt 0x1C + virtual void stop(s32 fadeFrames) override; // vt 0x20 + virtual void pause(bool pauseFlag, s32 fadeFrames) override; // vt 0x24 + + virtual void init(nw4r::snd::SoundStartable &startable, s32 idx); // vt 0x28 + virtual bool isBattleBgmSound() const { + return false; + } // vt 0x2C + virtual void pause(s32 fadeFrames); // vt 0x30 + virtual void loadSeqConfig(u32 soundId); // vt 0x34 + virtual void postCalc() {} // vt 0x38 + virtual void calcSeqPlaySamplePosition(); // vt 0x3C + virtual void loadCallbacks(u32 soundId); // vt 0x40 + + nw4r::snd::SoundStartable::StartResult startBgmSound(u32 soundId, s32 fadeFrames, u32 startOffset); + + bool isPreparedSoundId(u32 soundId) const { + return IsPrepared() && !mIsRunning && GetId() == soundId; + } + + bool isPrepared() const { + return IsPrepared() && !mIsRunning; + } + + void applyVars(); + void onBecomeActive(); + bool isBgmBattle() const; + + dSndBgmDataHarpVarSetBase_c *getCurrentHarpVarSet(); + + u32 getStrmPlaySamplePosition(); + u32 getWavePlaySamplePosition(); + +protected: + void getHarpData(u32 soundId); + bool loadNewHarpData(u32 soundId); + + void calcPlaySamplePosition(); + u32 getPlaySamplePosition(); + u32 getSeqSoundPlaySamplePosition(); + static dSndBgmSoundHarpMgr_c *spGlobalHarpMgr; + + /* 0x0F0 */ nw4r::ut::Node mBgmMgrNode; + /* 0x0F8 */ nw4r::snd::SoundStartable *mpStartable; + /* 0x0FC */ dSoundSource_c *mpSoundSource; + /* 0x100 */ s32 mIndex; + /* 0x104 */ UNKWORD field_0x104; + /* 0x108 */ s32 mSeqTempo; + /* 0x10C */ u32 mBgmFlags; + /* 0x110 */ bool mDidRewindPlaySamplePosition; + /* 0x114 */ s32 mBgmVar3; + /* 0x118 */ s32 mSeqTimebase; + /* 0x11C */ u32 mPlaySamplePosition; + /* 0x120 */ dSndBgmSoundHarpMgr_c mHarpMgr; + /* 0x140 */ dSndBgmSoundHarpMgr_c *mpHarpMgr; + /* 0x144 */ const dSndBgmSeqConfig *mpSeqConfig; + /* 0x148 */ s32 mSeqPlaySamplePosition; + /* 0x14C */ UNKWORD field_0x14C[2]; + /* 0x154 */ f32 field_0x154[2]; + /* 0x15C */ StopCallback mpStopCallback; + /* 0x160 */ CalcCallback mpCalcCallback; + /* 0x164 */ void *cb3; + /* 0x168 */ void *cb4; + /* 0x16C */ void *cb5; + /* 0x170 */ void *cb6; + /* 0x174 */ void *cb7; + /* 0x178 */ void *cb8; + /* 0x17C */ void *cb9; + /* 0x180 */ void *cb10; +}; + +#endif diff --git a/include/d/snd/d_snd_bgm_sound_battle.h b/include/d/snd/d_snd_bgm_sound_battle.h new file mode 100644 index 00000000..f18fa7be --- /dev/null +++ b/include/d/snd/d_snd_bgm_sound_battle.h @@ -0,0 +1,40 @@ +#ifndef D_SND_BGM_SOUND_BATTLE_H +#define D_SND_BGM_SOUND_BATTLE_H + +#include "d/snd/d_snd_bgm_sound.h" +#include "d/snd/d_snd_types.h" + +class dSndBgmBattleSound_c : public dSndBgmSound_c { +public: + dSndBgmBattleSound_c(); + + virtual void cancel() override; // vt 0x08 + virtual void fadeIn(u32 id, s32 fadeFrames) override; // vt 0x10 + virtual bool isBattleBgmSound() const override { + return true; + } // vt 0x2C + virtual void loadSeqConfig(u32 soundId) override; // vt 0x34 + virtual void postCalc() override { + calcSeqPlaySamplePosition(); + } // vt 0x38 + virtual void calcSeqPlaySamplePosition() override; // vt 0x3C + virtual void loadCallbacks(u32 soundId) override; // vt 0x40 + + /** + * Called when the player is even closer to an enemy. + * Adds some more instruments to the battle sound. + */ + bool startMainBattleLoop(); + +private: + void setTrackGroupMuted(u32 groupId); + void setTrackGroupUnmuted(u32 groupId); + + /* 0x184 */ const dSndBgmBattleConfig *mpBgmBattleConfig; + /* 0x188 */ u32 mMuteGroupActiveMask; + /* 0x18C */ u32 mPrevTick; + /* 0x190 */ u8 field_0x190; + /* 0x191 */ u8 field_0x191; +}; + +#endif diff --git a/include/d/snd/d_snd_bgm_sound_harp_mgr.h b/include/d/snd/d_snd_bgm_sound_harp_mgr.h new file mode 100644 index 00000000..34ed6df2 --- /dev/null +++ b/include/d/snd/d_snd_bgm_sound_harp_mgr.h @@ -0,0 +1,58 @@ +#ifndef D_SND_BGM_SOUND_HARP_MGR_H +#define D_SND_BGM_SOUND_HARP_MGR_H + +#include "common.h" +#include "d/snd/d_snd_bgm_harp_data.h" + +class dSndBgmSoundHarpMgr_c { +public: + dSndBgmSoundHarpMgr_c(); + ~dSndBgmSoundHarpMgr_c() {} + + void setSoundId(u32 soundId); + void setLoaded(); + void reset(); + + void setPlaySamplePosition(s32 position); + + dSndBgmDataHarpVarSetBase_c *getCurrentVarSet(); + + bool isLoaded() const { + return mIsLoaded; + } + + void setField_0x08(s32 value) { + mHarpData.setField_0x08(value); + } + + void setTempo(s32 tempo) { + mTempo = tempo; + } + + s32 getTempo() const { + return mTempo; + } + + void addVar(int wait, int key, int velocity) { + mHarpData.addVar(wait, key, velocity); + } + + void resetPrevIdx() { + mPrevIdx = -1; + } + + u32 getSoundId() const { + return mSoundId; + } + +private: + /* 0x00 */ dSndBgmHarpData_c mHarpData; + /* 0x0C */ dSndBgmDataHarpVarSetBase_c *mpCurrVarSet; + /* 0x10 */ u32 mSoundId; + /* 0x14 */ s32 mTempo; + /* 0x18 */ s32 mPrevIdx; + /* 0x1C */ u8 field_0x1C; + /* 0x1D */ bool mIsLoaded; +}; + +#endif diff --git a/include/d/snd/d_snd_checkers.h b/include/d/snd/d_snd_checkers.h index d18c2777..22a56097 100644 --- a/include/d/snd/d_snd_checkers.h +++ b/include/d/snd/d_snd_checkers.h @@ -1,11 +1,23 @@ #ifndef D_SND_CHECKERS_H #define D_SND_CHECKERS_H +#include "common.h" +#include "d/snd/d_snd_bgm_mgr.h" +#include "d/snd/d_snd_player_mgr.h" #include "nw4r/snd/snd_SoundHandle.h" -#include "toBeSorted/music_mgrs.h" class SoundPropertiesChecker { public: + // @bug forgot to initialize mCounter4. see `dSndSourceEquipment_c::cbPcHit` for one consequence + SoundPropertiesChecker(u32 soundId) + : mSoundId(soundId), + mPlayCounter(0), + mPauseCounter(0), + mCounter3(0), + mpPlayCounter(nullptr), + mpPauseCounter(nullptr), + mpCounter3(nullptr), + mpCounter4(nullptr) {} virtual void operator()(nw4r::snd::SoundHandle &pHandle) { if (mSoundId != -1 && mSoundId != pHandle.GetId()) { return; @@ -26,7 +38,7 @@ public: return; } - if (fn_803721F0(FANFARE_SOUND_MGR, pHandle.GetId())) { + if (dSndBgmMgr_c::GetInstance()->isPreparedBgmSoundId(pHandle.GetId())) { if (mpCounter3 != nullptr) { (*mpCounter3)++; } else { @@ -35,7 +47,7 @@ public: return; } - if (fn_803720E0(FANFARE_SOUND_MGR, pHandle.GetId())) { + if (dSndBgmMgr_c::GetInstance()->isPreparingBgmSoundId(pHandle.GetId())) { if (mpCounter3 != nullptr) { (*mpCounter3)++; } else { @@ -44,7 +56,7 @@ public: return; } - if (fn_80372070(FANFARE_SOUND_MGR, pHandle.GetId())) { + if (dSndBgmMgr_c::GetInstance()->isFadingOutBgmSoundId(pHandle.GetId())) { if (mpCounter4 != nullptr) { (*mpCounter4)++; } else { @@ -53,24 +65,25 @@ public: return; } - if (fn_803734C0(FANFARE_SOUND_MGR, pHandle.GetId()) && !fn_80373550(FANFARE_SOUND_MGR, pHandle.GetId())) { + if (dSndBgmMgr_c::GetInstance()->getFanSoundHandleForFan2(pHandle.GetId()) != nullptr && + !dSndBgmMgr_c::GetInstance()->isCurrentlyPlayingFanSound(pHandle.GetId())) { + // Why not mpCounter3??? mCounter3++; } } -private: +public: /* 0x04 */ u32 mSoundId; - /* 0x08 */ u32 mPlayCounter; - /* 0x0C */ u32 mPauseCounter; - /* 0x10 */ u32 mCounter3; - /* 0x14 */ u32 mCounter4; - /* 0x18 */ u32 *mpPlayCounter; - /* 0x1C */ u32 *mpPauseCounter; - /* 0x20 */ u32 *mpCounter3; - /* 0x24 */ u32 *mpCounter4; + /* 0x08 */ s32 mPlayCounter; + /* 0x0C */ s32 mPauseCounter; + /* 0x10 */ s32 mCounter3; + /* 0x14 */ s32 mCounter4; + /* 0x18 */ s32 *mpPlayCounter; + /* 0x1C */ s32 *mpPauseCounter; + /* 0x20 */ s32 *mpCounter3; + /* 0x24 */ s32 *mpCounter4; }; - // used at the very least when trying to finish Demise class IsCurrentSoundIdChecker { public: @@ -91,7 +104,7 @@ private: class SoundStopper { public: SoundStopper(u32 id, s32 fadeFrames) : mSoundId(id), mFadeFrames(fadeFrames) {} - ~SoundStopper() {} + // ~SoundStopper() {} virtual void operator()(nw4r::snd::SoundHandle &pHandle) { if (mSoundId == pHandle.GetId()) { @@ -104,4 +117,34 @@ private: /* 0x08 */ s32 mFadeFrames; }; +class SoundStopperIfParamFlag20 { +public: + SoundStopperIfParamFlag20() {} + + virtual void operator()(nw4r::snd::SoundHandle &pHandle) { + u32 id = pHandle.GetId(); + u32 param = dSndPlayerMgr_c::GetInstance()->getDemoArchive()->GetSoundUserParam(id); + if ((param & 0x100000) != 0) { + u32 fadeFrames = param & 0xFF; + pHandle.Stop(fadeFrames); + } + } + +private: +}; + +class SoundVolumeSetter { +public: + SoundVolumeSetter() {} + ~SoundVolumeSetter() {} + + virtual void operator()(nw4r::snd::SoundHandle &pHandle) { + pHandle.SetVolume(mVolume, mFadeFrames); + } + +public: + /* 0x04 */ f32 mVolume; + /* 0x08 */ s32 mFadeFrames; +}; + #endif diff --git a/include/d/snd/d_snd_control_player_mgr.h b/include/d/snd/d_snd_control_player_mgr.h index 541268fb..cab2cfd3 100644 --- a/include/d/snd/d_snd_control_player_mgr.h +++ b/include/d/snd/d_snd_control_player_mgr.h @@ -22,6 +22,11 @@ public: dSndControlPlayerMgr_c(); + void setupPlayerControlsGlobal(); + void setupPlayerControlsStage(); + void setupPlayerControlsStageBgm(); + void setupPlayerControlsDemo(); + void calc(); static const s32 sNumPlayers; @@ -41,6 +46,9 @@ public: void muteAllWorldSounds(s32 fadeFrames); void unmuteAllWorldSounds(s32 fadeFrames); + void muteScenePlayers(s32 frames); + void unmuteScenePlayers(s32 frames); + enum MuteLevel { MUTE_FULL = 0, MUTE_PARTIAL = 1, @@ -49,7 +57,7 @@ public: }; enum VolumeControlGroup { - /** PLAYER_BGM, PLAYER_BGM_BOSS */ + /** PLAYER_BGM, PLAYER_BGM_BATTLE */ CTRL_GROUP_BGM = 0, /** PLAYER_TG_SOUND - PLAYER_AREA_IN_WATER_LV */ CTRL_GROUP_STAGE_EFFECTS = 1, @@ -64,14 +72,14 @@ public: void setBgmVolumeDecreaseSpeed(f32 speed); void setStageEffectsVolume(f32 volume, s32 fadeFrames); - -private: void setBgmMuteVolume(f32 volume); void setStageEffectsMuteVolume(f32 volume); void setEnemyMuteVolume(f32 volume); void setObjectMuteVolume(f32 volume); void setPlayerVolumeInternal(u32 playerIdx, f32 volume); +private: + void unmutePlayer(u32 playerIdx, s32 frames); void resetControls(); void calcVolumes(); void calcMuteFlags(); diff --git a/include/d/snd/d_snd_distant_sound_actor.h b/include/d/snd/d_snd_distant_sound_actor.h new file mode 100644 index 00000000..dd91806b --- /dev/null +++ b/include/d/snd/d_snd_distant_sound_actor.h @@ -0,0 +1,92 @@ +#ifndef D_SND_DISTANT_SOUND_ACTOR_H +#define D_SND_DISTANT_SOUND_ACTOR_H + +#include "common.h" +#include "d/snd/d_snd_3d_actor.h" +#include "d/snd/d_snd_types.h" +#include "nw4r/math/math_types.h" +#include "nw4r/snd/snd_SoundHandle.h" +#include "nw4r/ut/ut_list.h" + +/** + * A sound actor to be borrowed by sound sources when they want to play + * sounds at a specific position. + * + * Sound sources correspond to actors, but e.g. projectile hit effects, grass + * cutting sounds, sword hit effects, ... have to be played where the hit occurred. + * This pool allows sound sources to borrow sound actors for these purposes. + */ +class dSndDistantSoundActor_c : public dSnd3DActor_c { +public: + dSndDistantSoundActor_c(); + virtual void setPause(bool flag, int fadeFrames) override; + virtual UNKWORD d_vt_0x3C() override; + virtual void postStartSound(nw4r::snd::SoundHandle &handle, dSndSeSound_c *pSound, u32 id) override; + virtual void postHoldSound(nw4r::snd::SoundHandle &handle, dSndSeSound_c *pSound, u32 id, UNKWORD) override; + + void initSource(dSoundSource_c *pSource); + void setSourceDirectly(dSoundSource_c *pSource); + void loadDefaultParam(); + void detachFromSource(); + + void updatePosition(); + + bool startSound(u32 soundId, const nw4r::math::VEC3 &position, nw4r::snd::SoundHandle *pHandle); + bool holdSound(u32 soundId, const nw4r::math::VEC3 &position, nw4r::snd::SoundHandle *pHandle); + + bool isAttachedSource(dSoundSource_c *source) const { + return mpSoundSource == source; + } + + bool hasAttachedSource() const { + return mpSoundSource; + } + + nw4r::snd::SoundHandle *getHandle() { + return mpSoundHandle; + } + + void setSource(dSoundSource_c *source) { + mpSoundSource = source; + } + + // not sure if this combination makes sense + void resetHandle() { + mpHoldSoundHandle = nullptr; + mpSoundHandle = &mSoundHandle; + } + + dSndSeSound2_c *getHoldSoundHandle() const { + return mpHoldSoundHandle; + } + + void setHoldSoundHandle(dSndSeSound2_c *handle) { + mpHoldSoundHandle = handle; + } + + bool isActive() const { + return mIsActive; + } + + void setActive(bool value) { + mIsActive = value; + } + + void setUseSourcePosition(bool value) { + mUseSourcePosition = true; + } + + void updateSome3DField(); + +private: + /* 0x0E4 */ nw4r::ut::Node mPoolLink; // sound actor pool link + /* 0x0EC */ nw4r::ut::Node mSourceLink; // sound source link + /* 0x0F4 */ dSndSeSound2_c *mpHoldSoundHandle; + /* 0x0F8 */ dSoundSource_c *mpSoundSource; + /* 0x0FC */ nw4r::snd::SoundHandle mSoundHandle; + /* 0x100 */ nw4r::snd::SoundHandle *mpSoundHandle; + /* 0x104 */ bool mIsActive; + /* 0x105 */ bool mUseSourcePosition; +}; + +#endif diff --git a/include/d/snd/d_snd_distant_sound_actor_pool.h b/include/d/snd/d_snd_distant_sound_actor_pool.h new file mode 100644 index 00000000..4a09d3bc --- /dev/null +++ b/include/d/snd/d_snd_distant_sound_actor_pool.h @@ -0,0 +1,58 @@ +#ifndef D_SND_DISTANT_SOUND_ACTOR_POOL_H +#define D_SND_DISTANT_SOUND_ACTOR_POOL_H + +#include "common.h" +#include "d/snd/d_snd_distant_sound_actor.h" +#include "d/snd/d_snd_misc.h" +#include "d/snd/d_snd_types.h" +#include "d/snd/d_snd_util.h" +#include "nw4r/math/math_types.h" +#include "nw4r/ut/ut_list.h" + + +SND_DISPOSER_FORWARD_DECL(dSndDistantSoundActorPool_c); + +/** + * A pool for distant sounds actors. Sound sources will borrow + * actors from this pool when they want to play a sound + * at a specific position. The finisher target sound will + * also play using this pool. + */ +class dSndDistantSoundActorPool_c { + SND_DISPOSER_MEMBERS(dSndDistantSoundActorPool_c); + + static const s32 POOL_SIZE = 64; + +public: + dSndDistantSoundActorPool_c(); + + static dSndSourceParam &getSourceParam() { + return sParam; + } + + void setup(); + void calc(); + void onChangeStage(); + + dSndDistantSoundActor_c *acquireActor(u32 soundId, const nw4r::math::VEC3 *position, dSoundSource_c *source); + dSndDistantSoundActor_c *findActiveActor(u32 soundId, dSoundSource_c *source); + + bool startSound(u32 soundId, const nw4r::math::VEC3 *position); + bool holdSound(u32 soundId, const nw4r::math::VEC3 *position); + + void setAllPause(bool flag, s32 fadeFrames); + void disableAll(); + void enableAll(); + +private: + void addToActiveList(dSndDistantSoundActor_c *actor, u32 id); + void removeFromActiveList(dSndDistantSoundActor_c *actor); + + /* 0x0010 */ dSndDistantSoundActor_c mSounds[POOL_SIZE]; + /* 0x4210 */ UNKWORD field_0x4210; + /* 0x4214 */ nw4r::ut::List mActiveActors; + + static dSndSourceParam sParam; +}; + +#endif diff --git a/include/d/snd/d_snd_event.h b/include/d/snd/d_snd_event.h new file mode 100644 index 00000000..5f3ad071 --- /dev/null +++ b/include/d/snd/d_snd_event.h @@ -0,0 +1,160 @@ +#ifndef D_SND_EVENT_H +#define D_SND_EVENT_H + +#include "common.h" + +typedef void (*SndEventCallback)(void); +typedef void (*SndEventFinalizeCallback)(bool skipped); +typedef void (*SndEventMsgWaitCallback)(u32 msgWaitSelectCounter); + +struct SndEventDef { + /* 0x00 */ const char *eventName; + /* 0x04 */ s32 eventId; + /* 0x08 */ SndEventCallback initializeCb; + /* 0x0C */ SndEventCallback executeCb; + /* 0x10 */ SndEventFinalizeCallback finalizeCb; + /* 0x14 */ SndEventMsgWaitCallback msgWaitStartCb; // always null + /* 0x18 */ SndEventMsgWaitCallback msgWaitEndCb; // always null +}; + +enum SndEvent_e { + /* 0x00 */ SND_EVENT_DefaultStart = 0x00, + /* 0x01 */ SND_EVENT_SkyDiveStart = 0x01, + /* 0x02 */ SND_EVENT_ShortDiveStart = 0x02, + /* 0x03 */ SND_EVENT_ParachuteStart = 0x03, + /* 0x04 */ SND_EVENT_SirenBackStart = 0x04, + /* 0x05 */ SND_EVENT_TimeDoorIn = 0x05, + /* 0x06 */ SND_EVENT_TimeDoorOut = 0x06, + /* 0x07 */ SND_EVENT_ReturnSkyloft = 0x07, + /* 0x08 */ SND_EVENT_Shutter = 0x08, + /* 0x09 */ SND_EVENT_DayTime = 0x09, + /* 0x0A */ SND_EVENT_BedStart = 0x0A, + /* 0x0B */ SND_EVENT_TboxShow = 0x0B, + /* 0x0C */ SND_EVENT_TreasureBoxOpen = 0x0C, + /* 0x0D */ SND_EVENT_TreasureBoxOpenBoss = 0x0D, + /* 0x0E */ SND_EVENT_FaysSirenSong = 0x0E, + /* 0x0F */ SND_EVENT_fays_song_fin_siren = 0x0F, + /* 0x10 */ SND_EVENT_SDGateInOpen = 0x10, + /* 0x11 */ SND_EVENT_SealedDoorOpen = 0x11, + /* 0x12 */ SND_EVENT_SealedDoorClose = 0x12, + /* 0x13 */ SND_EVENT_HeartContainer = 0x13, + /* 0x14 */ SND_EVENT_ordinary_sword_sprit = 0x14, + /* 0x15 */ SND_EVENT_fays_navigate = 0x15, + /* 0x16 */ SND_EVENT_fays_allert = 0x16, + /* 0x17 */ SND_EVENT_DefaultGetItem = 0x17, + /* 0x18 */ SND_EVENT_ItemGetGorgeous = 0x18, + /* 0x19 */ SND_EVENT_Save = 0x19, + /* 0x1A */ SND_EVENT_SwordDraw = 0x1A, + /* 0x1B */ SND_EVENT_SwordDrawDoorNew = 0x1B, + /* 0x1C */ SND_EVENT_DoorBossGame = 0x1C, + /* 0x1D */ SND_EVENT_FallRestart = 0x1D, + /* 0x1E */ SND_EVENT_DeadMagma = 0x1E, + /* 0x1F */ SND_EVENT_DeadSink = 0x1F, + /* 0x20 */ SND_EVENT_Dead = 0x20, + /* 0x21 */ SND_EVENT_DeadDive = 0x21, + /* 0x22 */ SND_EVENT_SirenChaser2 = 0x22, + /* 0x23 */ SND_EVENT_JMAP = 0x23, + /* 0x24 */ SND_EVENT_JMAPAllMove = 0x24, + /* 0x25 */ SND_EVENT_OracleInSiren = 0x25, + /* 0x26 */ SND_EVENT_CeremonyByRescueTeam = 0x26, + /* 0x27 */ SND_EVENT_BirdRaceStart = 0x27, + /* 0x28 */ SND_EVENT_GoddessGateOpen = 0x28, + /* 0x29 */ SND_EVENT_FaysPharosSong = 0x29, + /* 0x2A */ SND_EVENT_fays_song_pharos = 0x2A, + /* 0x2B */ SND_EVENT_fays_song_fin_pharos = 0x2B, + /* 0x2D */ SND_EVENT_HarpPerformanceResult = 0x2D, + /* 0x2E */ SND_EVENT_ItemGetBird = 0x2E, + /* 0x2F */ SND_EVENT_DivingMGStart = 0x2F, + /* 0x30 */ SND_EVENT_DiveGameResult = 0x30, + /* 0x31 */ SND_EVENT_StartCarryPumpkin = 0x31, + /* 0x32 */ SND_EVENT_CarryPumpkinResultsFailed = 0x32, + /* 0x33 */ SND_EVENT_CarryPumpkinResultsSuccessful = 0x33, + /* 0x34 */ SND_EVENT_NusiAppearDemo = 0x34, + /* 0x35 */ SND_EVENT_NusiTHideAppearDemo = 0x35, + /* 0x36 */ SND_EVENT_TenAppearDemo = 0x36, + /* 0x37 */ SND_EVENT_NusiTDeathDemo = 0x37, + /* 0x38 */ SND_EVENT_NusiDeathDemo = 0x38, + /* 0x39 */ SND_EVENT_F100IntroByFay = 0x39, + /* 0x3A */ SND_EVENT_BC_wakidasi = 0x3A, + /* 0x3B */ SND_EVENT_Kyui3Fall = 0x3B, + /* 0x3C */ SND_EVENT_F102Intro2 = 0x3C, + /* 0x3D */ SND_EVENT_Uo = 0x3D, + /* 0x3E */ SND_EVENT_WaterfallStop = 0x3E, + /* 0x3F */ SND_EVENT_F103Intro2 = 0x3F, + /* 0x40 */ SND_EVENT_Onp = 0x40, + /* 0x41 */ SND_EVENT_F103_UoMS = 0x41, + /* 0x42 */ SND_EVENT_F200IntroByFay = 0x42, + /* 0x43 */ SND_EVENT_F202_R02Intro = 0x43, + /* 0x44 */ SND_EVENT_SearchLightDemo = 0x44, + /* 0x45 */ SND_EVENT_F300_1IntroByFay = 0x45, + /* 0x46 */ SND_EVENT_FirstTimeSlip = 0x46, + /* 0x47 */ SND_EVENT_F301IntroByFay = 0x47, + /* 0x49 */ SND_EVENT_F302RevivalRairyu = 0x49, + /* 0x4A */ SND_EVENT_F401IntroByFay = 0x4A, + /* 0x4B */ SND_EVENT_BBossAppear = 0x4B, + /* 0x4C */ SND_EVENT_BBFLYDEMO = 0x4C, + /* 0x4D */ SND_EVENT_BBossEvac = 0x4D, + /* 0x4E */ SND_EVENT_BBoss2Evac = 0x4E, + /* 0x4F */ SND_EVENT_BBoss3Evac = 0x4F, + /* 0x50 */ SND_EVENT_BBFuuin = 0x50, + /* 0x51 */ SND_EVENT_BBHDTH = 0x51, + /* 0x52 */ SND_EVENT_BBHDRC = 0x52, + /* 0x53 */ SND_EVENT_BBFCL = 0x53, + /* 0x54 */ SND_EVENT_BBTUTO = 0x54, + /* 0x55 */ SND_EVENT_F402L3QuakeStart = 0x55, + /* 0x56 */ SND_EVENT_Girahimu3SecondAppearDemo = 0x56, + /* 0x57 */ SND_EVENT_SF_start = 0x57, + /* 0x58 */ SND_EVENT_GirahimuSwordDemo = 0x58, + /* 0x59 */ SND_EVENT_SF4_Op = 0x59, + /* 0x5A */ SND_EVENT_SF4_End = 0x5A, + /* 0x5C */ SND_EVENT_AsuraStart = 0x5C, + /* 0x5D */ SND_EVENT_AsuraStartB = 0x5D, + /* 0x5E */ SND_EVENT_ELizarufos_c_opening = 0x5E, + /* 0x5F */ SND_EVENT_D200R04Rock = 0x5F, + /* 0x60 */ SND_EVENT_RollRockLspJump = 0x60, + /* 0x62 */ SND_EVENT_RollRockLspAppear = 0x62, + /* 0x63 */ SND_EVENT_RollRockChangeVera = 0x63, + /* 0x64 */ SND_EVENT_MoleInitFear = 0x64, + /* 0x65 */ SND_EVENT_MolePushSwitch = 0x65, + /* 0x66 */ SND_EVENT_MoleInitTalk = 0x66, + /* 0x67 */ SND_EVENT_CatchMole = 0x67, + /* 0x68 */ SND_EVENT_D201IronFence = 0x68, + /* 0x69 */ SND_EVENT_MogMolShut = 0x69, + /* 0x6A */ SND_EVENT_MogMolOpen = 0x6A, + /* 0x6B */ SND_EVENT_LavaPlate = 0x6B, + /* 0x6C */ SND_EVENT_ResqueMole = 0x6C, + /* 0x6D */ SND_EVENT_MG_start = 0x6D, + /* 0x6E */ SND_EVENT_ECaptain_c_Opening = 0x6E, + /* 0x6F */ SND_EVENT_BKR_start = 0x6F, + /* 0x70 */ SND_EVENT_BKR_end = 0x70, + /* 0x71 */ SND_EVENT_BKR_armCaught = 0x71, + /* 0x72 */ SND_EVENT_BLS_demo2 = 0x72, + /* 0x73 */ SND_EVENT_BLS_end = 0x73, + /* 0x74 */ SND_EVENT_D003Intro = 0x74, + /* 0x75 */ SND_EVENT_ECaptain_c_OpeningType2 = 0x75, + /* 0x76 */ SND_EVENT_NeedleUnderground = 0x76, + /* 0x77 */ SND_EVENT_TriforceWarp = 0x77, + + /* 0x78 */ SND_EVENT_0x78 = 0x78, + + /* 0x79 */ SND_EVENT_Demo03_03 = 0x79, + /* 0x7A */ SND_EVENT_Demo15_04 = 0x7A, + /* 0x7B */ SND_EVENT_Demo08_01 = 0x7B, + /* 0x7C */ SND_EVENT_Demo36_01 = 0x7C, + /* 0x7D */ SND_EVENT_Demo41_01 = 0x7D, + /* 0x7E */ SND_EVENT_Demo59_01 = 0x7E, + /* 0x7F */ SND_EVENT_Demo62_01 = 0x7F, + /* 0x80 */ SND_EVENT_Demo64_06 = 0x80, + /* 0x81 */ SND_EVENT_Demo70_01 = 0x81, + /* 0x82 */ SND_EVENT_Demo70_02 = 0x82, + /* 0x83 */ SND_EVENT_Demo72_01 = 0x83, + /* 0x84 */ SND_EVENT_Demo77_01 = 0x84, + /* 0x85 */ SND_EVENT_Demo79_01 = 0x85, + + /* 0x86 */ SND_EVENT_0x86 = 0x86, + /* 0x87 */ SND_EVENT_0x87 = 0x87, + /* 0x88 */ SND_EVENT_0x88 = 0x88, + /* 0x89 */ SND_EVENT_0x89 = 0x89, +}; + +#endif diff --git a/include/d/snd/d_snd_fi_vocal_mgr.h b/include/d/snd/d_snd_fi_vocal_mgr.h new file mode 100644 index 00000000..19f743d0 --- /dev/null +++ b/include/d/snd/d_snd_fi_vocal_mgr.h @@ -0,0 +1,26 @@ +#ifndef D_SND_FI_VOCAL_MGR_H +#define D_SND_FI_VOCAL_MGR_H + +#include "d/snd/d_snd_util.h" +#include "nw4r/snd/snd_SoundHandle.h" + +SND_DISPOSER_FORWARD_DECL(dSndFiVocalMgr_c); + +class dSndFiVocalMgr_c { + SND_DISPOSER_MEMBERS(dSndFiVocalMgr_c) + +public: + dSndFiVocalMgr_c(); + + void fiSpeak(const char *, u16, s32); + void executeOutputText(u16, u16); + /** The bank argument affects what Fi is singing */ + bool startFiVocal(s16 pitch, s16 bank); + + s16 getStaticSongValue(s32, u32, s32, s32); + +private: + /* 0x10 */ nw4r::snd::SoundHandle mSpeechHandle; +}; + +#endif diff --git a/include/d/snd/d_snd_file_mgr.h b/include/d/snd/d_snd_file_mgr.h new file mode 100644 index 00000000..dce7d67d --- /dev/null +++ b/include/d/snd/d_snd_file_mgr.h @@ -0,0 +1,44 @@ +#ifndef D_SND_FILE_MGR_H +#define D_SND_FILE_MGR_H + +#include "nw4r/snd/snd_DisposeCallbackManager.h" +#include "nw4r/snd/snd_SoundArchive.h" +#include "nw4r/snd/snd_SoundArchivePlayer.h" +#include "nw4r/snd/snd_SoundHeap.h" + +class dSndFileManager : public nw4r::snd::SoundArchivePlayer_FileManager, public nw4r::snd::detail::DisposeCallback { +private: + struct dSndFileManagerGlob { + u32 numFiles; + const void **pData; + const void **pWaveData; + }; + + static dSndFileManagerGlob sGlob; + +public: + dSndFileManager() { + mpGlob = &sGlob; + } + static dSndFileManager *create(nw4r::snd::SoundArchive *pArchive, nw4r::snd::SoundHeap *pHeap); + + virtual void const *GetFileAddress(u32) override; + virtual void const *GetFileWaveDataAddress(u32) override; + + virtual void InvalidateData(void const *pStart, void const *pEnd) override; + virtual void InvalidateWaveData(void const *pStart, void const *pEnd) override; + + virtual ~dSndFileManager() {} + + static bool loadFileForSound(const nw4r::snd::SoundArchive &pArchive, u32 soundId, nw4r::snd::SoundHeap *pHeap); + static bool isLoadedFileForSound(nw4r::snd::SoundArchivePlayer *pPlayer, u32 soundId); + static bool isLoadedFileAndWaveForBank(nw4r::snd::SoundArchivePlayer *pPlayer, u32 soundId); + static bool isLoadedFileAndWaveForSound(nw4r::snd::SoundArchivePlayer *pPlayer, u32 soundId); + +private: + static void clearGlob(); + + /* 0x10 */ dSndFileManagerGlob *mpGlob; +}; + +#endif diff --git a/include/d/snd/d_snd_harp_song_data.h b/include/d/snd/d_snd_harp_song_data.h new file mode 100644 index 00000000..9ca29b0e --- /dev/null +++ b/include/d/snd/d_snd_harp_song_data.h @@ -0,0 +1,69 @@ +#ifndef D_SND_HARP_SONG_DATA_H +#define D_SND_HARP_SONG_DATA_H + +#include "common.h" + +class dSndHarpSongEntryBase_c { +public: + dSndHarpSongEntryBase_c(s16 count, s16 stride); + ~dSndHarpSongEntryBase_c(); + + void insert(u32 idx, s16 value); + s32 get(u32 idx) const; + + void reset(); + +private: + /* 0x00 */ s16 *mpData; + /* 0x04 */ u16 mCount; + /* 0x06 */ u16 mStride; +}; + +class dSndHarpSongEntry1_c : public dSndHarpSongEntryBase_c { + static const s32 NUM_ENTRIES_TYPE_1 = 24; + +public: + dSndHarpSongEntry1_c(); + void loadStaticData(s32 i1, u32 i2, s32 i3); + s16 getStaticDatum(u32 idx) const; + +private: + /* 0x08 */ s16 mStaticValues[24]; +}; + +class dSndHarpSongEntry2_c : public dSndHarpSongEntryBase_c { + static const s32 NUM_ENTRIES_TYPE_2 = 12; + +public: + dSndHarpSongEntry2_c() : dSndHarpSongEntryBase_c(NUM_ENTRIES_TYPE_2, NUM_ENTRIES_TYPE_2 * 2) {} + +private: +}; + +class dSndHarpSongData_c { +public: + dSndHarpSongData_c(); + + void init(u32 idx); + void loadStaticValues(); + + void insert2(u32 key, s16 value, s32); + void insert1(u32 key, s16 value); + + static const s32 sNumHarpSongs; + + void setSoundId(u32 id) { + mSoundId = id; + } + +private: + /* 0x00 */ u32 mSoundId; + /* 0x04 */ u32 mIndex; + /* 0x08 */ UNKWORD field_0x08; + /* 0x0C */ f32 field_0x0C; + /* 0x10 */ dSndHarpSongEntry2_c mEntries2[4][2][2]; + /* 0x90 */ UNKWORD field_0x90[4][2]; + /* 0xB0 */ dSndHarpSongEntry1_c mEntries1[4][2]; +}; + +#endif diff --git a/include/d/snd/d_snd_harp_song_mgr.h b/include/d/snd/d_snd_harp_song_mgr.h new file mode 100644 index 00000000..934ffe0f --- /dev/null +++ b/include/d/snd/d_snd_harp_song_mgr.h @@ -0,0 +1,81 @@ +#ifndef D_SND_HARP_SONG_MGR_H +#define D_SND_HARP_SONG_MGR_H + +#include "common.h" +#include "d/snd/d_snd_util.h" +#include "d/snd/d_snd_types.h" +#include "nw4r/snd/snd_SoundHandle.h" + +SND_DISPOSER_FORWARD_DECL(dSndHarpSongMgr_c); + +class dSndHarpSongMgr_c { + SND_DISPOSER_MEMBERS(dSndHarpSongMgr_c) + +public: + dSndHarpSongMgr_c(); + + void setup(); + void setupState0(); + + void calc(); + + void activate(); + void deactivate(); + + nw4r::snd::SoundHandle &getFiSingHandle() { + return mFiSingHandle; + } + +private: + void shiftFloat1(f32 val); + void shiftFloat2(f32 val); + void resetFloatArr1(); + void resetFloatArr2(); + + /* 0x010 */ u8 field_0x010; + /* 0x011 */ u8 field_0x011; + /* 0x012 */ bool mDataLoaded; + /* 0x014 */ UNKWORD field_0x014; + /* 0x018 */ UNKWORD field_0x018; + /* 0x01C */ UNKWORD field_0x01C; + /* 0x020 */ UNKWORD field_0x020; + /* 0x024 */ UNKWORD field_0x024; + /* 0x028 */ UNKWORD field_0x028; + /* 0x02C */ UNKWORD field_0x02C; + /* 0x030 */ UNKWORD field_0x030; + /* 0x034 */ UNKWORD field_0x034; + /* 0x038 */ f32 field_0x038; + /* 0x03C */ f32 field_0x03C; + /* 0x040 */ u8 field_0x040; + /* 0x041 */ u8 field_0x041; + /* 0x042 */ u8 field_0x042; + /* 0x043 */ u8 field_0x043; + /* 0x044 */ u8 field_0x044; + /* 0x048 */ UNKWORD field_0x048; + /* 0x04C */ UNKWORD field_0x04C; + /* 0x050 */ UNKWORD field_0x050; + /* 0x054 */ UNKWORD field_0x054; + /* 0x058 */ UNKWORD field_0x058; + /* 0x05C */ UNKWORD field_0x05C; + /* 0x060 */ UNKWORD field_0x060; + /* 0x064 */ UNKWORD field_0x064; + /* 0x068 */ UNKWORD field_0x068; + /* 0x06C */ UNKWORD field_0x06C; + /* 0x070 */ f32 field_0x070; + /* 0x074 */ u8 _0x074[0x078 - 0x074]; + /* 0x078 */ u8 field_0x078; + /* 0x07C */ f32 field_0x07C[300]; + /* 0x52C */ f32 field_0x52C[30]; + + /* 0x5A4 */ dSndHarpSongData_c *mpData; + /* 0x5A8 */ dSndHarpSongData_c *mpTmpData; + /* 0x5AC */ UNKWORD field_0x5AC; + /* 0x5B0 */ nw4r::snd::SoundHandle mFiSingHandle; + /* 0x5B4 */ UNKWORD field_0x5B4; + /* 0x5B8 */ UNKWORD field_0x5B8; + /* 0x5BC */ u8 field_0x5BC; + /* 0x5C0 */ UNKWORD field_0x5C0; + /* 0x5C4 */ UNKWORD field_0x5C4; +}; + +#endif diff --git a/include/d/snd/d_snd_id_mappers.h b/include/d/snd/d_snd_id_mappers.h new file mode 100644 index 00000000..f8889468 --- /dev/null +++ b/include/d/snd/d_snd_id_mappers.h @@ -0,0 +1,13 @@ +#ifndef D_SND_ID_MAPPERS_H +#define D_SND_ID_MAPPERS_H + +#include "common.h" +#include "d/snd/d_snd_types.h" + +u32 getGrpId(dSndSourceGroup_c *pGroup); +u32 getBnkSeId(dSndSourceGroup_c *pGroup); +u32 getSeId(dSndSourceGroup_c *pGroup); + +const char *getHitEffectName(u32 polyAttr0); + +#endif diff --git a/include/d/snd/d_snd_id_mappers_data.h b/include/d/snd/d_snd_id_mappers_data.h new file mode 100644 index 00000000..047cd1be --- /dev/null +++ b/include/d/snd/d_snd_id_mappers_data.h @@ -0,0 +1,16 @@ +#ifndef D_SND_ID_MAPPERS_DATA_H +#define D_SND_ID_MAPPERS_DATA_H + +#include "common.h" + +struct ActorBaseNamePair { + const char *variant; + const char *base; +}; + +extern const ActorBaseNamePair sActorBaseNamePairs[]; +extern const s32 sNumActorBaseNamePairs; + +extern const char *sSndHitEffects[]; + +#endif diff --git a/include/d/snd/d_snd_mgr.h b/include/d/snd/d_snd_mgr.h index 305e96ea..75673e8e 100644 --- a/include/d/snd/d_snd_mgr.h +++ b/include/d/snd/d_snd_mgr.h @@ -1,8 +1,10 @@ #ifndef D_SND_MGR_H #define D_SND_MGR_H +#include "common.h" #include "egg/audio/eggAudioMgr.h" #include "nw4r/snd/snd_SoundArchivePlayer.h" +#include "nw4r/snd/snd_global.h" /** The core audio manager used for most sounds. */ class dSndMgr_c : public EGG::SimpleAudioMgr { @@ -10,7 +12,7 @@ public: dSndMgr_c(); virtual void calc() override; - void initialize(EGG::Heap *heap, u32 size); + void setup(EGG::Heap *heap, u32 size); void initHbm(u32 frame); static void restoreEffectsCallback(); @@ -19,15 +21,34 @@ public: return sInstance; } - static nw4r::snd::SoundArchivePlayer* getPlayer() { - return sInstance->ArcPlayer::getPlayer(); + static nw4r::snd::SoundArchivePlayer& getPlayer() { + return *sInstance->ArcPlayer::getPlayer(); + } + + static const char *getSoundLabelString(u32 soundId) { + const char *label = nullptr; + if (sInstance->getArchive() != nullptr) { + label = sInstance->getArchive()->GetSoundLabelString(soundId); + } + return label; + } + + static u32 getPlayerId(u32 soundId) { + nw4r::snd::SoundArchive::SoundInfo info; + u32 playerId; + if (!sInstance->getArchive()->ReadSoundInfo(soundId, &info)) { + playerId = -1; + } else { + playerId = info.playerId; + } + return playerId; } private: static dSndMgr_c *sInstance; - /* 0x6C8 */ u8 _0x6C8[0x6CC - 0x6C8]; - /* 0x6CC */ u8 field_0x6CC; + /* 0x6C8 */ nw4r::snd::OutputMode mOutputMode; + /* 0x6CC */ bool mIsInitialized; }; #endif diff --git a/include/d/snd/d_snd_misc.h b/include/d/snd/d_snd_misc.h index f5bfaa7f..fd8ce8d9 100644 --- a/include/d/snd/d_snd_misc.h +++ b/include/d/snd/d_snd_misc.h @@ -11,12 +11,16 @@ struct dSndSourceParam { reset(); } - void reset() { + void reset(f32 value_0x10 = 5000.0f) { field_0x00 = 300.0; field_0x04 = 1000.0f; field_0x08 = 100.0f; field_0x0C = 400.0f; - field_0x10 = 5000.0f; + field_0x10 = value_0x10; + } + + f32 getField0x10() const { + return field_0x10; } /* 0x00 */ f32 field_0x00; diff --git a/include/d/snd/d_snd_player_mgr.h b/include/d/snd/d_snd_player_mgr.h index 5b83ee5d..67ba6eb4 100644 --- a/include/d/snd/d_snd_player_mgr.h +++ b/include/d/snd/d_snd_player_mgr.h @@ -2,12 +2,15 @@ #define D_SND_PLAYER_MGR_H #include "d/snd/d_snd_mgr.h" +#include "d/snd/d_snd_types.h" #include "d/snd/d_snd_util.h" #include "nw4r/snd/snd_MemorySoundArchive.h" #include "nw4r/snd/snd_SoundArchivePlayer.h" #include "nw4r/snd/snd_SoundHandle.h" #include "nw4r/snd/snd_SoundStartable.h" +class dAcBase_c; + SND_DISPOSER_FORWARD_DECL(dSndPlayerMgr_c); /** @@ -23,11 +26,21 @@ public: public: dSndPlayerMgr_c(); - void setup(s32 channel); - void shutdown(s32 channel); + void shutdown(s32 frames); + bool isShutdown(); + void reset(s32 frames); + bool isReset(); + void recoverReset(); - void shutdown(); + void setupRmtSpeaker(s32 channel); + void shutdownRmtSpeaker(s32 channel); + + void clearTempStates(); + + void setup(); + void shutdownDemo(); void calc(); + void calcActive(); void enterMenu(); void leaveMenu(); @@ -44,25 +57,63 @@ public: void fn_8035E250(u16); bool fn_8035E2E0(); void fn_8035E310(); - void fn_8035E620(); - void fn_8035E6E0(); + void enterSystemMenu(); + void leaveSystemMenu(); + + void enterCaution(); + void leaveCaution(); + + void setMsgActor(s32 msgIdx, dAcBase_c *actor); + void unsetMsgActor(); + + void enterMsgWait(); + void leaveMsgWait(); + + void setupState0(); + void popToState0(); + void saveState1(); + void popToState1(); + void saveState2(); + void popToState2(); + + bool loadGroup(u32 groupId); + bool loadFileForSound(u32 soundId); + bool isLoadedFileForSound(u32 soundId); + bool isLoadedFileForBank(u32 bankId); + bool isLoadedBnkSeForGroup(dSndSourceGroup_c *group); + bool isLoadedFileAndWaveForSound(u32 soundId); + bool isLoadedSeFileAndWaveForGroup(dSndSourceGroup_c *group); u32 getFreeSize(); bool loadDemoArchive(const char *demoArchiveName); const char *getSoundArchivePath(); u32 convertLabelStringToSoundId(const char *label) const; + static bool isBgmPlayerId(u32 id); + static bool isSoundPlayedByBgmBattlePlayer(u32 soundId); + u32 getSomeUserParam(u32 soundId) const; - nw4r::snd::SoundArchivePlayer &getSoundArchivePlayerForType(u8 sourceType); - bool canUseThisPlayer(u8 sourceType) const; + nw4r::snd::SoundArchivePlayer &getSoundArchivePlayerForType(s32 sourceType); + bool shouldUseDemoPlayer(s32 sourceType) const; + + u32 getRemoConSoundVariantDemo(u32 soundId) const; + u32 getRemoConSoundVariant(u32 soundId) const; enum PlayerMgrFlag_e { MGR_HBM = 0x1, - MGR_UNK_0x2 = 0x2, + MGR_SHUTDOWN_RESET = 0x2, MGR_PAUSE = 0x4, MGR_MAP = 0x8, MGR_HELP = 0x10, + MGR_SYSTEM = 0x20, + MGR_MSG_WAIT = 0x40, + + MGR_CAUTION = 0x80, }; + bool isInit() const { + return mState0 > 0; + } + bool checkFlag(u32 mask) const { return mFlags & mask; } @@ -75,14 +126,20 @@ public: mFlags &= ~mask; } - u32 getEventMuteMask(u32 id) { - nw4r::snd::SoundArchive *archive; - if (mSoundArchivePlayer.IsAvailable()) { - archive = &mSoundArchive; + const nw4r::snd::SoundArchive *getDemoArchive() const { + if (mDemoSoundArchivePlayer.IsAvailable()) { + return &mDemoSoundArchive; } else { - archive = dSndMgr_c::GetInstance()->getArchive(); + return dSndMgr_c::GetInstance()->getArchive(); } - return archive->GetSoundUserParam(id) & sEventMuteFlagsMask; + } + + const nw4r::snd::SoundArchive *getDemoArchiveDirectly() const { + return &mDemoSoundArchive; + } + + u32 getEventMuteMask(u32 id) { + return getDemoArchive()->GetSoundUserParam(id) & sEventMuteFlagsMask; } enum FanfareUnmuteParam_e { @@ -111,8 +168,8 @@ public: enum PlayerIndex_e { /** Background music */ PLAYER_BGM = 0, - /** Background music, boss battle */ - PLAYER_BGM_BOSS = 1, + /** Background music, battles */ + PLAYER_BGM_BATTLE = 1, /** "fanfare?" */ PLAYER_FAN = 2, /** small sound effects, only a few (UI navigation related) */ @@ -157,24 +214,36 @@ public: private: /* 0x010 */ u8 field_0x010; - /* 0x011 */ u8 field_0x011; - /* 0x014 */ s32 field_0x014; - /* 0x018 */ s32 field_0x018; - /* 0x01C */ s32 field_0x01C; + /* 0x011 */ bool mIsSetup; + /* 0x014 */ s32 mState0; + /* 0x018 */ s32 mState1; + /* 0x01C */ s32 mState2; /* 0x020 */ u32 mFlags; + void stopAllSound(s32 frames); + void fn_8035E0E0(); + // system menu, inventory, map void enterPauseState(); void leavePauseState(); + void initialize(); + void createFileManager(); + +public: virtual nw4r::snd::SoundStartable::StartResult startSound(nw4r::snd::SoundHandle *pHandle, u32 soundId, const nw4r::snd::SoundStartable::StartInfo *pStartInfo); virtual nw4r::snd::SoundStartable::StartResult startSound( nw4r::snd::SoundHandle *pHandle, const char *soundLabel, const nw4r::snd::SoundStartable::StartInfo *pStartInfo ); - /* 0x028 */ nw4r::snd::MemorySoundArchive mSoundArchive; - /* 0x178 */ nw4r::snd::SoundArchivePlayer mSoundArchivePlayer; + nw4r::snd::SoundStartable::StartResult startDemoSound( + nw4r::snd::SoundHandle *pHandle, u32 soundId, const nw4r::snd::SoundStartable::StartInfo *pStartInfo + ); + +private: + /* 0x028 */ nw4r::snd::MemorySoundArchive mDemoSoundArchive; + /* 0x178 */ nw4r::snd::SoundArchivePlayer mDemoSoundArchivePlayer; }; #endif diff --git a/include/d/snd/d_snd_rng.h b/include/d/snd/d_snd_rng.h new file mode 100644 index 00000000..28f9ffd4 --- /dev/null +++ b/include/d/snd/d_snd_rng.h @@ -0,0 +1,21 @@ +#ifndef D_SND_RNG_H +#define D_SND_RNG_H + +#include "common.h" + +class dSndRng_c { +public: + dSndRng_c(); + virtual ~dSndRng_c() {} + + bool rndBool(s32 chance); + u32 rndInt(s32 max); + +private: + void init(); + + /* 0x08 */ u64 field_0x08; + /* 0x10 */ u64 field_0x10; +}; + +#endif diff --git a/include/d/snd/d_snd_rng_id.h b/include/d/snd/d_snd_rng_id.h new file mode 100644 index 00000000..ac068194 --- /dev/null +++ b/include/d/snd/d_snd_rng_id.h @@ -0,0 +1,32 @@ +#ifndef D_SND_RNG_ID_H +#define D_SND_RNG_ID_H + +#include "d/snd/d_snd_rng.h" + +/** A class for picking sound ID variants at random without repeats. */ +class dSndRngId_c : public dSndRng_c { +public: + dSndRngId_c(); + + void configure(u32 start, u32 end, u8 genChance); + + u32 rndIdNoReuse(); + u32 nextIdNoReuse(); + u32 rndId(); + u32 rndIdNotSame(); + void markPicked(u32 id, bool allowReset); + +private: + void resetPicked(); + u32 rndInt(s32 max); + + /* 0x18 */ u32 mBaseId; + /* 0x1C */ u32 mLastPicked; + /* 0x20 */ u32 mPickedMask; + /* 0x24 */ s16 mPickedNum; + /* 0x26 */ u8 mRange; + /* 0x27 */ u8 mGenChance; + /* 0x28 */ bool mIsConfigured; +}; + +#endif diff --git a/include/d/snd/d_snd_rng_id_if.h b/include/d/snd/d_snd_rng_id_if.h new file mode 100644 index 00000000..94198f5e --- /dev/null +++ b/include/d/snd/d_snd_rng_id_if.h @@ -0,0 +1,17 @@ +#ifndef D_SND_RNG_ID_IF_H +#define D_SND_RNG_ID_IF_H + +#include "d/snd/d_snd_rng_id.h" + +/** A class for picking sound ID variants at random without repeats. */ +class dSndRngIdIf_c : protected dSndRngId_c { +public: + /* 0x0C */ virtual bool doNextIdNoReuse(); + /* 0x10 */ virtual bool doRndId(); + /* 0x14 */ virtual bool doRndIdNoReuse(); + /* 0x18 */ virtual bool doRndIdNotSame(); + + /* 0x1C */ virtual bool handleId(u32 id) = 0; +}; + +#endif diff --git a/include/d/snd/d_snd_rng_link_voice.h b/include/d/snd/d_snd_rng_link_voice.h new file mode 100644 index 00000000..8292bd64 --- /dev/null +++ b/include/d/snd/d_snd_rng_link_voice.h @@ -0,0 +1,188 @@ +#ifndef D_SND_RNG_LINK_VOICE_H +#define D_SND_RNG_LINK_VOICE_H + +#include "d/snd/d_snd_rng_id_if.h" +#include "d/snd/d_snd_types.h" + +struct dSndLinkVoiceConfig; + +enum dSndLinkVoice_e { + /* 0x00 */ SND_LV_PRACTICE_S, + /* 0x01 */ SND_LV_PRACTICE_M, + /* 0x02 */ SND_LV_PRACTICE_L, + /* 0x03 */ SND_LV_PRACTICE_KAITEN_M, + /* 0x04 */ SND_LV_ATTACK_S, + /* 0x05 */ SND_LV_ATTACK_M, + /* 0x06 */ SND_LV_ATTACK_L, + /* 0x07 */ SND_LV_SAVE_POWER, + /* 0x08 */ SND_LV_ATTACK_KAITEN_M, + /* 0x09 */ SND_LV_NOTICE, + /* 0x0A */ SND_LV_PRACTICE_SHIELD, + /* 0x0B */ SND_LV_ATTACK_SHIELD, + /* 0x0C */ SND_LV_ATTACK_SHIELD_GJ, + /* 0x0D */ SND_LV_SHELD_GUARD, + /* 0x0E */ SND_LV_SHELD_DOWN, + /* 0x0F */ SND_LV_SHELD_BREAK, + /* 0x10 */ SND_LV_ATTACK_DOWN, + /* 0x11 */ SND_LV_DAMAGE_S, + /* 0x12 */ SND_LV_DAMAGE_L, + /* 0x13 */ SND_LV_DAMAGE_FIRE_S, + /* 0x14 */ SND_LV_DAMAGE_FIRE_L, + /* 0x15 */ SND_LV_DAMAGE_ELEC_S, + /* 0x16 */ SND_LV_DAMAGE_ELEC_L, + /* 0x17 */ SND_LV_STRUGGLE_S, + /* 0x18 */ SND_LV_STRUGGLE_L, + /* 0x19 */ SND_LV_GROAN, + /* 0x1A */ SND_LV_ESCAPE, + /* 0x1B */ SND_LV_DAMAGE_MAGMA, + /* 0x1C */ SND_LV_DAMAGE_QUICKSAND, + /* 0x1D */ SND_LV_DIE_L, + /* 0x1E */ SND_LV_DIE_S, + /* 0x1F */ SND_LV_DIE_WATER, + /* 0x20 */ SND_LV_RESTART, + /* 0x21 */ SND_LV_STAND_UP, + /* 0x22 */ SND_LV_PHEW_1, + /* 0x23 */ SND_LV_TIRED_S_1, + /* 0x24 */ SND_LV_TIRED_S_2, + /* 0x25 */ SND_LV_TIRED_M, + /* 0x26 */ SND_LV_TIRED_L, + /* 0x27 */ SND_LV_CLIMB_TIRED_S_1, + /* 0x28 */ SND_LV_CLIMB_TIRED_S_2, + /* 0x29 */ SND_LV_CLIMB_TIRED_M, + /* 0x2A */ SND_LV_CLIMB_TIRED_L, + /* 0x2B */ SND_LV_LIFT_TIRED_S_1, + /* 0x2C */ SND_LV_LIFT_TIRED_S_2, + /* 0x2D */ SND_LV_LIFT_TIRED_M, + /* 0x2E */ SND_LV_LIFT_TIRED_L, + /* 0x2F */ SND_LV_TIRED_RECOVER, + /* 0x30 */ SND_LV_TIRED_RECOVER_S, + /* 0x31 */ SND_LV_TIRED_RECOVER_M, + /* 0x32 */ SND_LV_TIRED_RECOVER_L, + /* 0x33 */ SND_LV_TIRED_EMPTY, + /* 0x34 */ SND_LV_PHEW_2, + /* 0x35 */ SND_LV_JUMP_S, + /* 0x36 */ SND_LV_JUMP_M, + /* 0x37 */ SND_LV_JUMP_L, + /* 0x38 */ SND_LV_SHOOT_START, + /* 0x39 */ SND_LV_SHOOT_SLOPE, + /* 0x3A */ SND_LV_RUN_UP, + /* 0x3B */ SND_LV_GRAB, + /* 0x3C */ SND_LV_CLIMB_STEP, + /* 0x3D */ SND_LV_HUNG, + /* 0x3E */ SND_LV_JUMP_IVY, + /* 0x3F */ SND_LV_BACKFLIP, + /* 0x40 */ SND_LV_ZENTEN, + /* 0x41 */ SND_LV_ZENTEN_CLASH, + /* 0x42 */ SND_LV_ZENTEN_UP, + /* 0x43 */ SND_LV_FALLING_HIGH, + /* 0x44 */ SND_LV_DAMAGE_FALL, + /* 0x45 */ SND_LV_SKYDIVE, + /* 0x46 */ SND_LV_RIDE_BIRD, + /* 0x47 */ SND_LV_BLAST, + /* 0x48 */ SND_LV_WIND_FLY, + /* 0x49 */ SND_LV_BALANCE_BALL, + /* 0x4A */ SND_LV_SLIDE_START, + /* 0x4B */ SND_LV_CLIMB_ROPE, + /* 0x4C */ SND_LV_SWING_ROPE, + /* 0x4D */ SND_LV_JUMP_ROPE, + /* 0x4E */ SND_LV_STOP_ROPE, + /* 0x4F */ SND_LV_SHAKE_ROPE, + /* 0x50 */ SND_LV_FOOT_MISS, + /* 0x51 */ SND_LV_BREATH, + /* 0x52 */ SND_LV_TAKE_BREATH, + /* 0x53 */ SND_LV_GET_AIR, + /* 0x54 */ SND_LV_DOLPHIN_JUMP, + /* 0x55 */ SND_LV_LIFT_S, + /* 0x56 */ SND_LV_THROW_S, + /* 0x57 */ SND_LV_LIFT_L, + /* 0x58 */ SND_LV_THROW_L, + /* 0x59 */ SND_LV_PUSH_M, + /* 0x5A */ SND_LV_DIG_GLOVE, + /* 0x5B */ SND_LV_SWING_S, + /* 0x5C */ SND_LV_DRINK, + /* 0x5D */ SND_LV_DRINK_FIN, + /* 0x5E */ SND_LV_CLIMB_WALL, + /* 0x5F */ SND_LV_JUMPON_LIFT, + /* 0x60 */ SND_LV_GET_SURPRISND, + /* 0x61 */ SND_LV_FLOATAWAY, + /* 0x62 */ SND_LV_CANNON_JUMP, + /* 0x63 */ SND_LV_FIRE, + /* 0x64 */ SND_LV_LOOK_BODY, + /* 0x65 */ SND_LV_QUICKWATER, + /* 0x66 */ SND_LV_DANGER_ROCK, + /* 0x67 */ SND_LV_PULL_SWORD, + /* 0x68 */ SND_LV_WHIP_BACK, + /* 0x69 */ SND_LV_SW_PUSH, + /* 0x6A */ SND_LV_SW_REJECT, + /* 0x6B */ SND_LV_JUMP_DIVEWATER, + /* 0x6C */ SND_LV_DAMAGE_WATER_M, + /* 0x6D */ SND_LV_DAMAGE_WATER_S, + /* 0x6E */ SND_LV_DAMAGE_ELEC_W, + /* 0x6F */ SND_LV_STRUGGLE_W, + /* 0x70 */ SND_LV_GROAN_W, + /* 0x71 */ SND_LV_ESCAPE_W, + /* 0x72 */ SND_LV_BREATH_TIRED_S_1, + /* 0x73 */ SND_LV_BREATH_TIRED_S_2, + /* 0x74 */ SND_LV_BREATH_TIRED_M, + /* 0x75 */ SND_LV_BREATH_TIRED_L, + /* 0x76 */ SND_LV_LIE_UP, + /* 0x77 */ SND_LV_PRACTICE_PUNCH, + /* 0x78 */ SND_LV_ATTACK_PUNCH, + /* 0x79 */ SND_LV_SURPRISND_S, + /* 0x7A */ SND_LV_SHUTTER_OPEN, + /* 0x7B */ SND_LV_BIRDRACE_REACH, + /* 0x7C */ SND_LV_ATTACK_A, + /* 0x7D */ SND_LV_BADSMELL_TIRED_S_1, + /* 0x7E */ SND_LV_BADSMELL_TIRED_S_2, + /* 0x7F */ SND_LV_BADSMELL_TIRED_M, + /* 0x80 */ SND_LV_BADSMELL_TIRED_L, + /* 0x81 */ SND_LV_GIRA_SWORD_REJECT, + /* 0x82 */ SND_LV_GIRA_SWORD_PULL, + /* 0x83 */ SND_LV_GIRA_GRAPPLE, + /* 0x84 */ SND_LV_SWORD_SIREN_IN, + /* 0x85 */ SND_LV_APPEAR_SURPRISND, + /* 0x86 */ SND_LV_EXIT_SURPRISND, + /* 0x87 */ SND_LV_BIRD_DAMAGE, + /* 0x88 */ SND_LV_BIRD_SPIN, + /* 0x89 */ SND_LV_BIRD_ATTACK, + /* 0x8A */ SND_LV_TRUCK_JUMP, + /* 0x8B */ SND_LV_TRUCK_IN, + /* 0x8C */ SND_LV_TRUCK_BRAKE, + /* 0x8D */ SND_LV_DAMAGE_MUTEKI_S, + /* 0x8E */ SND_LV_DAMAGE_MUTEKI_L, + /* 0x8F */ SND_LV_DAMAGE_MUTEKI_W_S, + /* 0x90 */ SND_LV_DAMAGE_MUTEKI_W_L, + /* 0x91 */ SND_LV_RECOVER_WATER, + /* 0x92 */ SND_LV_SPIN_WATER, + /* 0x93 */ SND_LV_SHOCKED, + /* 0x94 */ SND_LV_LIGHT_SURPRISND, + /* 0x95 */ SND_LV_QUIETLY_S, + /* 0x96 */ SND_LV_QUIETLY_M, + /* 0x97 */ SND_LV_DAMAGE_L_1, + /* 0x98 */ SND_LV_MAX +}; + +class dSndRngLinkVoice_c : public dSndRngIdIf_c { +public: + dSndRngLinkVoice_c(); + + void configure(const dSndLinkVoiceConfig *config, dSndSourcePlayerHead_c *source); + static const dSndLinkVoiceConfig *getConfig(s32 idx); + + /* 0x1C */ bool handleId(u32 id) override; + + s32 getPriority() const { + return mPriority; + } + + bool getPriorityTiebreaker() const { + return mPriorityTiebreaker; + } + +private: + /* 0x2C */ dSndSourcePlayerHead_c *mpSource; + /* 0x30 */ s32 mPriority; + /* 0x34 */ bool mPriorityTiebreaker; +}; + +#endif diff --git a/include/d/snd/d_snd_rng_mgr.h b/include/d/snd/d_snd_rng_mgr.h new file mode 100644 index 00000000..64596883 --- /dev/null +++ b/include/d/snd/d_snd_rng_mgr.h @@ -0,0 +1,18 @@ +#ifndef D_SND_RNG_MGR_H +#define D_SND_RNG_MGR_H + +#include "d/snd/d_snd_rng.h" +#include "d/snd/d_snd_util.h" + +SND_DISPOSER_FORWARD_DECL(dSndRngMgr_c) + +class dSndRngMgr_c : public dSndRng_c { +public: + SND_DISPOSER_MEMBERS(dSndRngMgr_c) + +public: + dSndRngMgr_c() {} + u32 rndIntRange(s32 min, s32 max); +}; + +#endif diff --git a/include/d/snd/d_snd_se_sound.h b/include/d/snd/d_snd_se_sound.h new file mode 100644 index 00000000..6ed8e2c2 --- /dev/null +++ b/include/d/snd/d_snd_se_sound.h @@ -0,0 +1,130 @@ +#ifndef D_SND_SE_SOUND_H +#define D_SND_SE_SOUND_H + +#include "common.h" +#include "d/snd/d_snd_sound.h" +#include "d/snd/d_snd_types.h" +#include "nw4r/snd/snd_SoundHandle.h" +#include "nw4r/ut/ut_list.h" + +/** + * A sound effect handle. Typically acquired by sound sources from a pool. + * This allows sound sources to play sounds with no pre-determined limit + * on the number of sounds. It also allows the source to handle the statefulness + * of holdSound without requiring users to manage handles. + * + * Additionally, some sound sources will register callbacks to customize + * sound parameters (pitch, volume, ...). These callbacks can additionally + * write and read context parameters (see above). The game will shift these + * parameters with each call, so a lot of this is obviously frame-rate dependent. + */ +class dSndSeSound_c { +public: + dSndSeSound_c(); + ~dSndSeSound_c(); + + enum Type_e { + SE_HANDLE_TYPE_1 = 0, + SE_HANDLE_TYPE_2 = 1, + }; + + // vtable at 0x000 + /* vt 0x08 */ virtual void setSource(dSoundSource_c *source, u32 soundId); + // TODO these names are probably wrong + /* vt 0x0C */ virtual void onStart(dSoundSource_c *source); + /* vt 0x10 */ virtual void onCalc(dSoundSource_c *source); + + void calc(dSoundSource_c *source); + void clear(); + + // not sure what this does + void shiftParam(const dSndSoundCtxParam *p); + void shiftFloatParam(f32 value); + + typedef void Callback(dSndSeSound_c *sound, dSoundSource_c *source, nw4r::snd::SoundHandle &handle); + + void stop(s32 fadeFrames) { + mpSoundHandle->Stop(fadeFrames); + } + + Type_e getHandleType() const { + return mHandleType; + } + + // cannot be const... + bool isAttachedSound() { + return mpSoundHandle->IsAttachedSound(); + } + + nw4r::snd::SoundHandle *getHandle() { + return mpSoundHandle; + } + + dSndSoundCtxParam *getCtxParams() const { + return mpCtxParam; + } + + s32 getField0x114() const { + return field_0x114; + } + + void setHandle(nw4r::snd::SoundHandle *handle) { + if (handle != nullptr) { + mpSoundHandle = handle; + field_0x11C = 0; + } else { + mpSoundHandle = &mSound; + field_0x11C = 1; + } + } + + void attachSource(dSoundSource_c *source) { + mpSource = source; + } + + bool isAttachedSource() const { + return mpSource != nullptr; + } + + bool unkRemovalCheck() const { + return !field_0x11D && !field_0x11E; + } + + bool isSoundId(u32 id) const { + return mSoundId == id; + } + + void setAcquiredMaybe(bool value) { + field_0x11D = value; + } + + void setInUseMaybe(bool value) { + field_0x11E = value; + } + + void setCallback1(Callback cb) { + mpStartCallback = cb; + } + + void setCallback2(Callback cb) { + mpCalcCallback = cb; + } + +protected: + /* 0x004 */ nw4r::ut::Node mSourceLink; + /* 0x00C */ nw4r::ut::Node mPoolLink; + /* 0x014 */ dSoundSource_c *mpSource; + /* 0x018 */ dSndSound_c mSound; + /* 0x108 */ nw4r::snd::SoundHandle *mpSoundHandle; + /* 0x10C */ Type_e mHandleType; + /* 0x110 */ u32 mSoundId; + /* 0x114 */ s32 field_0x114; + /* 0x118 */ dSndSoundCtxParam *mpCtxParam; + /* 0x11C */ u8 field_0x11C; + /* 0x11D */ u8 field_0x11D; + /* 0x11E */ u8 field_0x11E; + /* 0x120 */ Callback *mpStartCallback; + /* 0x124 */ Callback *mpCalcCallback; +}; + +#endif diff --git a/include/d/snd/d_snd_se_sound_1.h b/include/d/snd/d_snd_se_sound_1.h new file mode 100644 index 00000000..70019403 --- /dev/null +++ b/include/d/snd/d_snd_se_sound_1.h @@ -0,0 +1,15 @@ +#ifndef D_SND_SE_SOUND_1_H +#define D_SND_SE_SOUND_1_H + +#include "common.h" +#include "d/snd/d_snd_se_sound.h" + +class dSndSeSound1_c : public dSndSeSound_c { +public: + dSndSeSound1_c(); + + // vtable at 0x000 + /* vt 0x08 */ virtual void setSource(dSoundSource_c *source, u32 soundId) override; +}; + +#endif diff --git a/include/d/snd/d_snd_se_sound_2.h b/include/d/snd/d_snd_se_sound_2.h new file mode 100644 index 00000000..c106e5ee --- /dev/null +++ b/include/d/snd/d_snd_se_sound_2.h @@ -0,0 +1,26 @@ +#ifndef D_SND_SE_SOUND_2_H +#define D_SND_SE_SOUND_2_H + +#include "common.h" +#include "d/snd/d_snd_se_sound.h" + +class dSndSeSound2_c : public dSndSeSound_c { +public: + dSndSeSound2_c(); + + // vtable at 0x000 + /* vt 0x08 */ virtual void setSource(dSoundSource_c *source, u32 soundId) override; + + bool calcTimer(); + + void setField0x130(u8 val) { + field_0x130 = val; + } + +private: + /* 0x128 */ u32 field_0x128; + /* 0x12C */ u32 field_0x12C; + /* 0x130 */ u8 field_0x130; +}; + +#endif diff --git a/include/d/snd/d_snd_se_sound_pool.h b/include/d/snd/d_snd_se_sound_pool.h new file mode 100644 index 00000000..9f62813a --- /dev/null +++ b/include/d/snd/d_snd_se_sound_pool.h @@ -0,0 +1,38 @@ +#ifndef D_SND_SE_SOUND_POOL_H +#define D_SND_SE_SOUND_POOL_H + +#include "common.h" +#include "d/snd/d_snd_se_sound_1.h" +#include "d/snd/d_snd_se_sound_2.h" +#include "d/snd/d_snd_util.h" +#include "nw4r/ut/ut_list.h" + +SND_DISPOSER_FORWARD_DECL(dSndSeSoundPool_c); + +class dSndSeSoundPool_c { + SND_DISPOSER_MEMBERS(dSndSeSoundPool_c) + + static const u32 POOL_SIZE = 64; + +public: + dSndSeSoundPool_c(); + void calc(); + + dSndSeSound1_c *acquireSoundType1(dSoundSource_c *source, u32 soundId); + dSndSeSound2_c *acquireSoundType2(dSoundSource_c *source, u32 soundId); + + void releaseSoundType1(dSndSeSound1_c *sound, bool stop); + void releaseSoundType2(dSndSeSound2_c *sound); + +private: + void removeSoundType1(dSndSeSound1_c *sound); + void removeSoundType2(dSndSeSound2_c *sound); + + /* 0x0010 */ nw4r::ut::List mFreeType1List; + /* 0x001C */ nw4r::ut::List mActiveType1List; + /* 0x0028 */ nw4r::ut::List mFreeType2List; + /* 0x0034 */ dSndSeSound1_c mSoundsType1[POOL_SIZE]; + /* 0x4A34 */ dSndSeSound2_c mSoundsType2[POOL_SIZE]; +}; + +#endif diff --git a/include/d/snd/d_snd_small_effect_mgr.h b/include/d/snd/d_snd_small_effect_mgr.h index 6504728a..a47fc559 100644 --- a/include/d/snd/d_snd_small_effect_mgr.h +++ b/include/d/snd/d_snd_small_effect_mgr.h @@ -4,9 +4,9 @@ #include "d/snd/d_snd_source.h" #include "d/snd/d_snd_util.h" #include "d/snd/d_snd_wzsound.h" // IWYU pragma: export +#include "nw4r/math/math_types.h" #include "nw4r/snd/snd_SoundHandle.h" - SND_DISPOSER_FORWARD_DECL(dSndSmallEffectMgr_c); /** @@ -15,42 +15,99 @@ SND_DISPOSER_FORWARD_DECL(dSndSmallEffectMgr_c); class dSndSmallEffectMgr_c { SND_DISPOSER_MEMBERS(dSndSmallEffectMgr_c) + static const s32 NUM_DELAYED_SOUNDS = 2; + static const s32 NUM_HOLD_SOUNDS = 3; + public: + enum BattleHitSound_e { + BATTLE_TUTTI_NORMAL = 0, + BATTLE_TUTTI_TURN = 1, + BATTLE_TUTTI_JUMP = 2, + BATTLE_TUTTI_FINISH = 3, + BATTLE_TUTTI_GUARDJUST = 5, + }; + dSndSmallEffectMgr_c(); - bool playSound(u32 soundId); - bool playSoundWithPan(u32 soundId, f32 pan); - void playSoundWithPitch(u32 soundId, f32 pitch); + void initialize(); + void calc(); + void calcTimer(); + void stopAllSound(s32 fadeFrames); + void stopAllSoundDemoRelated(s32 fadeFrames); // TODO: better name + void stopAllSoundExceptEvent(s32 fadeFrames); + void stopAllSoundExceptEffectOrLink(s32 fadeFrames); + + bool playSound(u32 soundId); + // used for clawshots cursor, pan depends on where on the screen + // your cursor is when it activates + bool playSoundWithPan(u32 soundId, f32 pan); + bool holdSound(u32 soundId); + bool holdSoundWithPitch(u32 soundId, f32 pitch); + + // These two do the exact same thing + bool playSoundAtPosition(u32 soundId, const nw4r::math::VEC3 *position); + bool playSoundAtPosition2(u32 soundId, const nw4r::math::VEC3 *position); + + bool holdBowChargeSound(f32 remainingChargeAmount); + bool holdFinisherPromptSound(const nw4r::math::VEC3 *position); + + bool playDowsingPingSound(f32 volume, f32 pitch); + bool holdDowsingNearestSound(); + + bool playSirenCountdownSound(s32 timer); + bool playMinigameCountdownSound(); + bool playMinigameTimeUpSound(s32 timer); + bool playMinigameStartSound(); + bool playMinigameFinishSound(); + bool playMinigameFinishWhistleSound(); + bool playMinigameScoreUpSound(s32 param); + bool playMinigameScoreDownSound(); + bool playMinigameMusasabiSound(s32 count); + + bool playSkbSound(u32 soundId); + bool playDemoSound(u32 soundId, nw4r::snd::SoundHandle *pHandle); bool playButtonPressSoundWhenAdvancingTextBoxes(f32); void resetButtonPressSound(); void setButtonPressSound(dSoundSource_c *source); + bool playBattleHitSound(BattleHitSound_e type, dSoundSource_c *source); + + bool playSoundInternalChecked(u32 soundId, nw4r::snd::SoundHandle *handle); private: + bool playSoundInternal(u32 soundId, nw4r::snd::SoundHandle *handle); bool playSoundInternal(u32 soundId); void stopSounds(u32 playerIdx, u32 soundId, s32 fadeFrames); void stopSounds(u32 soundId, s32 fadeFrames); bool isPlayingSound(u32 playerIdx, u32 soundId); bool isPlayingSound(u32 soundId); - /* 0x10 */ nw4r::snd::SoundHandle mHandle1; + bool doSideEffects(u32 soundId); + + void setBitsIfAdjacent(dSndBgmDataHarpVarSetBase_c *set, s32 count, s32 target, u32 *pMask); + + /** + * Finds a sound handle currently playing the given sound, + * or an idle sound handle, + * or stops a lower-priority sound if needed and possible. + */ + nw4r::snd::SoundHandle *getHoldSoundHandle(u32 soundId); + bool holdSound(u32 soundId, nw4r::snd::SoundHandle *handle); + + /* 0x10 */ s32 field_0x10; // used for most sounds /* 0x14 */ nw4r::snd::SoundHandle mNormalSound; - /* 0x18 */ nw4r::snd::SoundHandle mHandle3; - // apparently used for shield gauge sounds, but maybe not given - // that the callers appear unreachable - /* 0x1C */ nw4r::snd::SoundHandle mShieldGaugeHandles[3]; + /* 0x18 */ nw4r::snd::SoundHandle mDowsingSoundHandle; + /* 0x1C */ nw4r::snd::SoundHandle mHoldSoundHandles[NUM_HOLD_SOUNDS]; - /* 0x28 */ s32 field_0x28; - /* 0x2C */ s32 field_0x2C; - /* 0x30 */ s32 field_0x30; - /* 0x34 */ s32 field_0x34; + /* 0x28 */ u32 mDelayedSoundIds[NUM_DELAYED_SOUNDS]; + /* 0x30 */ s32 mDelayedSoundTimers[NUM_DELAYED_SOUNDS]; /* 0x38 */ u32 mTextboxAdvanceSound; - /* 0x3C */ nw4r::snd::SoundHandle mHandle4; - /* 0x40 */ u16 field_0x40; - /* 0x42 */ u16 field_0x42; - /* 0x44 */ s32 field_0x44; + /* 0x3C */ nw4r::snd::SoundHandle mBattleTuttiHandle; + /* 0x40 */ s16 field_0x40; + /* 0x42 */ s16 field_0x42; + /* 0x44 */ u32 field_0x44; }; #endif diff --git a/include/d/snd/d_snd_sound.h b/include/d/snd/d_snd_sound.h index c2b865da..ae9dcb5c 100644 --- a/include/d/snd/d_snd_sound.h +++ b/include/d/snd/d_snd_sound.h @@ -2,13 +2,12 @@ #define D_SND_SOUND_H #include "common.h" +#include "d/snd/d_snd_types.h" #include "nw4r/snd/snd_SeqTrack.h" #include "nw4r/snd/snd_SoundHandle.h" #include "nw4r/snd/snd_SoundStartable.h" #include "nw4r/ut/ut_list.h" -class dSndSound_c; - // Not sure, handles a bunch of floats, exists in a ton of variants class dSndControl_c { public: @@ -154,30 +153,54 @@ public: void setVolume(f32 volume, s32 frames); void setPitchRelated(f32 pitch, s32 frames); void setLinearPitch(f32 pitch, s32 frames); - void setTrackVolume(u32 trackFlags, f32 volume, s32 frames); - void setStrmTrackVolume(u32 trackFlags, f32 volume, s32 frames); + void setTrackVolume(u16 trackFlags, f32 volume, s32 frames); + void setStrmTrackVolume(u16 trackFlags, f32 volume, s32 frames); void setSingleSeqTrackVolume(u16 index, f32 volume, s32 frames); void setSingleStrmTrackVolume(u16 index, f32 volume, s32 frames); // why f32 frames? - void setEachSeqTrackVolume(u32 trackFlags, f32 frames); - void setEachStrmTrackVolume(u32 trackFlags, f32 frames); + void setEachSeqTrackVolume(u16 trackFlags, f32 frames); + void setEachStrmTrackVolume(u16 trackFlags, f32 frames); void setSeqTempoRatio(f32 ratio, s32 frames); - void setSeqTrackMute(u32 trackFlags, nw4r::snd::SeqMute mute); + void setSeqTrackMute(u16 trackFlags, nw4r::snd::SeqMute mute); void forceStop(); - s16 readSeqTrackVariable(int varNo); + s32 readSeqTrackVariable(int varNo); void writeSeqTrackVariable(int varNo, s16 value); void linkCtrl(dSndControlSound_c *); void unlinkCtrl(dSndControlSound_c *); -protected: - bool cannotStart() const { + bool isPlaying() const { return mIsRunning && !mIsFadingOut && IsAttachedSound(); } + bool isPlayingSoundId(u32 soundId) const { + return mIsRunning && !mIsFadingOut && GetId() == soundId; + } + + bool isPreparingSoundId(u32 soundId) const { + return mIsPreparing && !mIsRunning && GetId() == soundId; + } + + bool isFadingOut() const { + return mIsFadingOut && IsAttachedSound(); + } + + bool isPreparingSoundIdWithStartOffset(u32 soundId, u32 offset) const { + return isPreparingSoundId(soundId) && (offset == 0 || mPrevStartOffset == offset); + } + + bool hasState() const { + return mIsRunning || mIsPreparing || IsAttachedSound(); + } + + bool isPaused() const { + return mPauseFlag; + } + +protected: bool isRunning() const { return mIsRunning && IsAttachedSound(); } @@ -186,28 +209,12 @@ protected: return mIsPreparing && !mIsRunning; } - bool canCancel() const { - return mIsRunning || mIsPreparing || IsAttachedSound(); - } - - bool isPreparingSoundId(u32 soundId) const { - bool ret = mIsPreparing; - if (ret) { - ret = !mIsRunning; - } - if (ret) { - ret = GetId() == soundId; - } - return ret; - } - void resetControls(); void resetTrackVolumes(); void setControlValue(dSndControlSound_c *ctrl, f32 value, s32 frames); - /* 0x08 */ u8 _0x08[0x10 - 0x08]; - + /* 0x08 */ nw4r::ut::Node mBgmMgrNode; /* 0x10 */ u32 mPrevStartOffset; /* 0x14 */ bool mIsPreparing; /* 0x15 */ bool mPauseFlag; diff --git a/include/d/snd/d_snd_source.h b/include/d/snd/d_snd_source.h index 946589ea..f84105b5 100644 --- a/include/d/snd/d_snd_source.h +++ b/include/d/snd/d_snd_source.h @@ -4,112 +4,292 @@ #include "common.h" #include "d/snd/d_snd_3d_actor.h" #include "d/snd/d_snd_source_if.h" +#include "d/snd/d_snd_types.h" +#include "d/snd/d_snd_util.h" +#include "nw4r/math/math_types.h" +#include "nw4r/snd/snd_SoundHandle.h" +#include "nw4r/snd/snd_SoundStartable.h" #include "nw4r/ut/ut_list.h" -#include - -class dSndSourceGroup_c; - /** Manages sound relating to a particular actor. */ /** Size: probably 0x15C */ class dSoundSource_c : public dSoundSourceIf_c, public dSnd3DActor_c { public: - dSoundSource_c(u8 sourceType, dAcBase_c *, const char *name, dSndSourceGroup_c *pOwnerGroup); + dSoundSource_c(s32 sourceType, dAcBase_c *, const char *name, dSndSourceGroup_c *pOwnerGroup); virtual ~dSoundSource_c(); - static u32 getCharacterTalkSoundId(u32 baseSoundId, dSoundSource_c *source); + u32 modifySoundId(u32 baseSoundId); + static u32 modifySoundId(u32 baseSoundId, dSoundSource_c *source); u32 getRemoConSoundVariant(u32 soundId) const; + s32 getRoomId() const; + bool isInaudibleInternal(); + void stopAllPlaySounds(s32 fadeFrames); + f32 timeAreaCheck(); + void handleRemoCon(nw4r::snd::SoundHandle *pHandle, u32 baseId); + bool startRemoConSound(u32 soundId); + nw4r::snd::SoundHandle *startSound(u32 soundId, nw4r::snd::SoundHandle *handle); + dSndDistantSoundActor_c * + startSoundAtPosition(u32 soundId, const nw4r::math::VEC3 *position, nw4r::snd::SoundHandle *handle); + nw4r::snd::SoundHandle *holdSound(u32 soundId, nw4r::snd::SoundHandle *handle); + u32 specializeBgHitSoundId(u32 baseSoundId, u32 polyAttr0, u32 polyAttr1); // This is where it gets a bit wild and this class starts mixing in overrides between // new virtual functions, which causes the vtable to list these functions in exactly this // order. - virtual const char *getName() const; - bool isName(const char *name) const { - return !std::strcmp(getName(), name); + /* 0x17C */ virtual const char *getName() const { + return mpName; } - virtual void d_s_vt_0x180(); - virtual void d_s_vt_0x184(); - virtual void d_s_vt_0x188(); - virtual void d_s_vt_0x18C(); - virtual void d_s_vt_0x190(); - virtual void d_s_vt_0x194(); + /* 0x180 */ virtual void setOrigName(const char *arg) { + mpOrigName = arg; + } + /* 0x184 */ virtual void preCalc(); + /* 0x188 */ virtual void postSetup() {} + /* 0x18C */ virtual void postCalc(); + /* 0x190 */ virtual bool d_s_vt_0x190() const; + /* 0x194 */ virtual u32 overrideStartSoundId(u32 soundId); - virtual void d_vt_0x58() override; + /* 0x198 */ virtual void postStartSound(nw4r::snd::SoundHandle &handle, dSndSeSound_c *pSound, u32 id) override; - virtual void d_s_vt_0x19C(); - virtual void d_s_vt_0x1A0(); + /* 0x19C */ virtual u32 overrideHitObjSoundId(u32 soundId, dSoundSource_c *source); + /* 0x1A0 */ virtual u32 overrideHoldSoundId(u32 soundId, bool initial); - virtual void d_vt_0x5C() override; - virtual StartResult + /* 0x1A4 */ virtual void + postHoldSound(nw4r::snd::SoundHandle &handle, dSndSeSound_c *pSound, u32 id, UNKWORD) override; + /* 0x1A8 */ virtual StartResult SetupSound(nw4r::snd::SoundHandle *pHandle, u32 soundId, const StartInfo *pStartInfo, void *) override; - virtual void d_s_vt_0x1AC(); - virtual void d_s_vt_0x1B0(); - virtual void d_s_vt_0x1B4(); - virtual void d_s_vt_0x1B8(); - virtual void d_s_vt_0x1BC(); - virtual void d_s_vt_0x1C0(); - virtual void d_s_vt_0x1C4(bool flag, int fadeFrames); - virtual void d_s_vt_0x1C8(); - virtual void d_s_vt_0x1CC(); + /* 0x1AC */ virtual bool d_s_vt_0x1AC(u32 soundId); + /* 0x1B0 */ virtual StartResult + setupSound(nw4r::snd::SoundHandle *pHandle, u32 soundId, const StartInfo *pStartInfo, void *arg, bool holdFlag); + /* 0x1B4 */ virtual void attachDistantSound(dSndDistantSoundActor_c *); + /* 0x1B8 */ virtual void detachDistantSound(dSndDistantSoundActor_c *); + /* 0x1BC */ virtual void detachAllDistantSounds(); + /* 0x1C0 */ virtual bool hasDistantSounds() const { + return nw4r::ut::List_GetFirstConst(&mDistantSoundList) != nullptr; + } + /* 0x1C4 */ virtual void pauseAllDistantSounds(bool flag, int fadeFrames); + /* 0x1C8 */ virtual void resetTempParams(); + /* 0x1CC */ virtual void postSetupSound(u32 playingId, u32 requestedId, dSndSeSound_c *seSound) {} - virtual void d_vt_0x38(bool flag, int fadeFrames) override; + /* 0x1D0 */ virtual void setPause(bool flag, int fadeFrames) override; - virtual void d_s_vt_0x1D4(); - virtual void d_s_vt_0x1D8(); - virtual void d_s_vt_0x1DC(); - virtual void d_s_vt_0x1E0(); - virtual void d_s_vt_0x1E4(); - virtual void d_s_vt_0x1E8(); + /* 0x1D4 */ virtual dSndAnimSound_c *getAnimSound() { + return nullptr; + } + /* 0x1D8 */ virtual void registerAdditionalSource(dSoundSource_c *other) { + return; + } + /* 0x1DC */ virtual bool isMultiSource() const { + return 0; + } + /* 0x1E0 */ virtual void onAnimSoundEvent(s32 arg) { + mAnimEventValue = arg; + } + /* 0x1E4 */ virtual void d_s_vt_0x1E4_noop(); + /* 0x1E8 */ virtual u32 d_s_vt_0x1E8(u32 soundId); // Overrides of dSoundSourceIf_c - always in the first section of // the vtable, so the order is not certain. May have to reorder for weak // function order. - virtual s32 getCategory() const override { + /* 0x00C */ virtual void setup() override; + /* 0x010 */ virtual s32 getCategory() const override { return mSourceCategory; } - virtual const nw4r::math::VEC3 &getListenerPosition() const override; - - virtual bool hasPlayingSounds() const override; // 0x48 - virtual bool isPlayingSound(u32 soundId) override; // 0x4C - virtual bool isPlayingSound(const char *soundId) override; // 0x50 - - virtual bool isReadyMaybe() override { + /* 0x014 */ virtual bool isCategory(s32 category) const override { + return category == mSourceCategory; + } + /* 0x018 */ virtual s32 getSourceType() const override { + return mSourceType; + } + /* 0x01C */ virtual bool isSourceType(s32 type) const override { + return type == mSourceType; + } + /* 0x020 */ virtual void vt_0x020() override {} + /* 0x024 */ virtual void setSubtype(u8 subtype) override { + mSubtype = subtype; + } + /* 0x028 */ virtual const nw4r::math::VEC3 &getListenerPosition() const override; + /* 0x02C */ void calc(const nw4r::math::VEC3 &) override; + /* 0x030 */ virtual void onFlag(u32 mask) override { + mFlagsPersistent |= mask; + } + /* 0x034 */ virtual void offFlag(u32 mask) override { + mFlagsPersistent &= ~mask; + } + /* 0x038 */ virtual bool checkFlag(u32 mask) const override { + return (mFlagsPersistent & mask) != 0 || (mFlagsHold & mask) != 0; + } + /* 0x03C */ virtual void holdFlag(u32 mask) override { + mFlagsHold |= mask; + } + /* 0x040 */ virtual void stopAllSound(s32 fadeFrames) override { + SoundActor::StopAllSound(fadeFrames); + } + /* 0x044 */ virtual void shutdown() override; + /* 0x048 */ virtual bool hasPlayingSounds() const override; + /* 0x04C */ virtual bool isPlayingSound(u32 soundId) override; + /* 0x050 */ virtual bool isPlayingSound(const char *soundId) override; + /* 0x054 */ virtual void setCtxParam(const dSndSoundCtxParam *arg) override { + mpCtxParam = arg; + } + /* 0x058 */ virtual void setCtxFloat(f32 value) override; + /* 0x05C */ virtual void setCtxInt(s32 value) override; + /* 0x060 */ virtual bool startSound(u32 soundId) override; + /* 0x064 */ virtual bool startSoundWithIntParam(u32 soundId, s32 value) override; + /* 0x068 */ virtual bool startSoundWithFloatParam(u32 soundId, f32 value) override; + /* 0x06C */ virtual bool startSoundWithParams(u32 soundId, f32 fValue, s32 value) override; + /* 0x070 */ virtual bool startSound(const char *label) override; + /* 0x074 */ virtual bool startSoundWithIntParam(const char *label, s32 value) override; + /* 0x078 */ virtual bool startSoundWithFloatParam(const char *label, f32 value) override; + /* 0x07C */ virtual bool startSoundWithParams(const char *label, f32 fValue, s32 value) override; + /* 0x080 */ virtual bool startSoundAtPosition(u32 soundId, const nw4r::math::VEC3 *position) override; + /* 0x084 */ virtual bool + startObjHitSound(u32 baseSoundId, dSoundSourceIf_c *source, const nw4r::math::VEC3 *position) override; + /* 0x088 */ virtual bool + startBgHitSound(u32 baseSoundId, u32 polyAttr0, u32 polyAttr1, const nw4r::math::VEC3 *position) override; + /* 0x08C */ virtual bool startSoundAtPosition(const char *label, const nw4r::math::VEC3 *position) override; + /* 0x090 */ virtual bool + startObjHitSound(const char *label, dSoundSourceIf_c *source, const nw4r::math::VEC3 *position) override; + /* 0x094 */ virtual bool + startBgHitSound(const char *label, u32 polyAttr0, u32 polyAttr1, const nw4r::math::VEC3 *position) override; + /* 0x098 */ virtual bool startSoundAtPosition2(u32 soundId, const nw4r::math::VEC3 *position) override; + /* 0x09C */ virtual bool startSoundAtPosition2(const char *label, const nw4r::math::VEC3 *position) override; + /* 0x0A0 */ virtual bool maybeUnusedEnemyDeath() override; + /* 0x0A4 */ virtual void stopSounds(u32 soundId, s32 fadeFrames) override; + /* 0x0A8 */ virtual void stopSounds(const char *label, s32 fadeFrames) override; + /* 0x0AC */ virtual bool holdSound(u32 soundId) override; + /* 0x0B0 */ virtual bool holdSoundWithIntParam(u32 soundId, s32 value) override; + /* 0x0B4 */ virtual bool holdSoundWithFloatParam(u32 soundId, f32 value) override; + /* 0x0B8 */ virtual bool holdSoundWithParams(u32 soundId, f32 fValue, s32 value) override; + /* 0x0BC */ virtual bool holdSound(const char *label) override; + /* 0x0C0 */ virtual bool holdSoundWithIntParam(const char *label, s32 value) override; + /* 0x0C4 */ virtual bool holdSoundWithFloatParam(const char *label, f32 value) override; + /* 0x0C8 */ virtual bool holdSoundWithParams(const char *label, f32 fValue, s32 value) override; + /* 0x0CC */ virtual bool holdSoundAtPosition(u32 soundId, const nw4r::math::VEC3 *position) override; + /* 0x0D0 */ virtual bool holdSoundAtPosition(const char *label, const nw4r::math::VEC3 *position) override; + /* 0x0D4 */ virtual bool startVoiceLine(u32 id) override { return false; - } // 0x100 - virtual void load(void *data, const char *name) override {} // 0x104 - virtual void setFrame(f32 frame) override {} // 0x108 - virtual void setRate(f32 frame) override {} // 0x10C + } + /* 0x0D8 */ virtual bool startVoiceLine(const char *label) override; + /* 0x0DC */ virtual bool vt_0xDC(u32 id) override { + return false; + } + /* 0x0E0 */ virtual void stopCurrentActionSound() override {} + /* 0x0E4 */ virtual void stopActionSound(u32 id) override {} + /* 0x0E8 */ virtual bool isPlayingActionSound() const override { + return false; + } + /* 0x0EC */ virtual bool isCurrentActionSound(u32 id) const override { + return false; + } + /* 0x0F0 */ virtual void vt_0x0F0_noop() override {} + /* 0x0F4 */ virtual void setField0x101(bool value) override { + field_0x101 = value; + } + /* 0x0F8 */ virtual void setField0x102(u8 value) override { + field_0x102 = value; + } + /* 0x0FC */ virtual bool isInaudible() override; + /* 0x100 */ virtual bool hasAnimSound() override { + return false; + } + /* 0x104 */ virtual void load(void *data, const char *name) override {} + /* 0x108 */ virtual void setFrame(f32 frame) override {} + /* 0x10C */ virtual void setRate(f32 frame) override {} + /* 0x110 */ virtual void setPolyAttrs(u8 polyAttr0, u8 polyAttr1) override; + /* 0x114 */ virtual void setBattleBgmRelated(UNKWORD) override {} + /* 0x118 */ virtual UNKWORD checkBattleBgmRelated() override { + return 0; + } + + dSndSeSound2_c *getHandleType2ForSoundId(u32 soundId); + + // Would have loved to roll this in with a PrepareSound function + // but that doesn't work + void markPrepared() { + field_0x11C |= 0x80000000; + } + + nw4r::snd::SoundStartable::StartResult + startSound(u32 soundId, nw4r::snd::SoundHandle *handle, nw4r::snd::SoundHandle **pOutHandle); + +protected: + StartResult setupSoundCommon(nw4r::snd::SoundHandle *pHandle, u32 soundId, const StartInfo *pStartInfo, void *arg); + void setVolumeFade(f32 volume, u32 fadeFrames); + nw4r::snd::SoundStartable::StartResult onSetupError(); private: + /** + * Sound sources can cause other sounds to be started. E.g when + * walking, Link will produce a walk sound, but an additional sound + * will be played, a different one per surface material. + * + * If this flag isn't set, the code will find the correct variant for + * a base sound, play the variant, and then play the base sound with this + * flag set so that we don't attempt to find and play the variant again. + */ + static bool sIsStartingBaseSound; + f32 getBaseSoundVolume(u32 variantSoundId, u32 baseSoundId); + dSndDistantSoundActor_c *startBaseSoundAtPosition(u32 baseSoundId, const nw4r::math::VEC3 *position, f32 volume); + nw4r::snd::SoundHandle *startBaseSound(u32 baseSoundId, f32 volume); + + nw4r::snd::SoundHandle *continueHoldingSound( + dSndSeSound2_c *seHandle, u32 soundId, dSndDistantSoundActor_c *distant, const nw4r::math::VEC3 *position + ); + + void addSeHandleType1(dSndSeSound1_c *handle); + void addSeHandleType2(dSndSeSound2_c *handle); + void removeSeHandleType1(dSndSeSound1_c *handle, bool stop); + void removeSeHandleType2(dSndSeSound2_c *handle); + void removeAllSeHandles(); + void removeAllSeHandlesType1(); + void removeAllSeHandlesType2(); + + void stopSoundHandles(u32 soundId, s32 fadeFrames); + + void calcHandles(); + void calcHandlesType1(); + void calcHandlesType2(); + + dSndSeSound1_c *getHandleType1ForSoundId(u32 soundId); + dSndSeSound1_c *getHandleType1ForSoundHandle(nw4r::snd::SoundHandle *handle); + + dSndSeSound1_c *getHandleType1ForSoundHandle_Dupe(nw4r::snd::SoundHandle *pHandle); + dSndSeSound2_c *getHandleType2ForSoundHandle_Dupe(nw4r::snd::SoundHandle *pHandle); + + void initVolumeFade(); + void calcVolumeFade(); + // at 0x00: dSoundSourceIf_c vtable // at 0x04: dSnd3DActor_c sub-object // at 0x58: thunk-vtable - - /* 0xE8 */ nw4r::ut::Node mMgrLink; +protected: + /* 0x0E8 */ nw4r::ut::Node mMgrLink; /* 0x0F0 */ const char *mpName; - /* 0x0F4 */ UNKWORD field_0x0F4; - /* 0x0F8 */ dAcBase_c *mpPlayer; + /* 0x0F4 */ const char *mpOrigName; + /* 0x0F8 */ dAcBase_c *mpActor; /* 0x0FC */ u8 mSourceCategory; /* 0x0FD */ u8 mSourceType; - /* 0x0FE */ u8 field_0x0FE; - /* 0x0FF */ u8 field_0x0FF; + /* 0x0FE */ u8 mSubtype; + /* 0x0FF */ bool mIsSetup; /* 0x100 */ u8 field_0x100; - /* 0x101 */ u8 field_0x101; + /* 0x101 */ bool field_0x101; /* 0x102 */ u8 field_0x102; - /* 0x104 */ UNKWORD field_0x104; - /* 0x108 */ UNKWORD field_0x108; - /* 0x10C */ UNKWORD field_0x10C; - /* 0x110 */ nw4r::ut::List field_0x110; // node offset 0xEC + /* 0x104 */ u32 mFlagsPersistent; + /* 0x108 */ u32 mFlagsHold; + /* 0x10C */ const dSndSoundCtxParam *mpCtxParam; + /* 0x110 */ LIST_MEMBER(dSndDistantSoundActor_c, DistantSound); // node offset 0xEC /* 0x11C */ UNKWORD field_0x11C; - /* 0x120 */ nw4r::ut::List field_0x120; // node offset 0x4 - /* 0x12C */ nw4r::ut::List field_0x12C; // node offset 0x4 - /* 0x138 */ nw4r::ut::Node mGroupLink; // node for list in dSndSourceGroup_c + /* 0x120 */ LIST_MEMBER(dSndSeSound1_c, HandleType1); // node offset 0x4 + /* 0x12C */ LIST_MEMBER(dSndSeSound2_c, HandleType2); // node offset 0x4 + /* 0x138 */ nw4r::ut::Node mGroupLink; // node for list in dSndSourceGroup_c /* 0x140 */ dSndSourceGroup_c *mpOwnerGroup; - /* 0x144 */ u8 _0x144[0x154 - 0x144]; - /* 0x154 */ UNKWORD field_0x154; - /* 0x158 */ s16 field_0x158; - /* 0x15A */ s16 field_0x15A; + /* 0x144 */ f32 mVolumeFadeTarget; + /* 0x148 */ f32 mVolumeFadeStepSize; + /* 0x14C */ nw4r::ut::Node mSubSourceLink; // node for list in dSndSourceEnemyMultiBase_c + /* 0x154 */ s32 mAnimEventValue; + /* 0x158 */ s16 mPolyAttr0; + /* 0x15A */ s16 mPolyAttr1; }; #endif diff --git a/include/d/snd/d_snd_source_anim_sound.h b/include/d/snd/d_snd_source_anim_sound.h new file mode 100644 index 00000000..70088a40 --- /dev/null +++ b/include/d/snd/d_snd_source_anim_sound.h @@ -0,0 +1,42 @@ +#ifndef D_SND_SOURCE_ANIM_SOUND_H +#define D_SND_SOURCE_ANIM_SOUND_H + +#include "d/snd/d_snd_anim_sound.h" +#include "d/snd/d_snd_source.h" + +class dSndSourceAnimSound_c : public dSoundSource_c { +public: + dSndSourceAnimSound_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup) + : dSoundSource_c(sourceType, ac, name, pOwnerGroup), mAnimSound(this) {} + + /* 0x1A8 */ virtual StartResult + SetupSound(nw4r::snd::SoundHandle *pHandle, u32 soundId, const StartInfo *pStartInfo, void *arg) override { + return setupSoundCommon(pHandle, soundId, pStartInfo, arg); + } + + /* 0x1D4 */ virtual dSndAnimSound_c *getAnimSound() override { + return &mAnimSound; + } + + /* 0x100 */ virtual bool hasAnimSound() override { + return true; + } + /* 0x104 */ virtual void load(void *data, const char *name) override { + mAnimSound.setData(data, name); + } + /* 0x108 */ virtual void setFrame(f32 frame) override { + if (isInaudibleInternal()) { + mAnimSound.resetFrame(frame); + } else { + mAnimSound.setFrame(frame); + } + } + /* 0x10C */ virtual void setRate(f32 frame) override { + mAnimSound.setRate(frame); + } + +protected: + /* 0x15C */ dSndAnimSound_c mAnimSound; +}; + +#endif diff --git a/include/d/snd/d_snd_source_demo.h b/include/d/snd/d_snd_source_demo.h new file mode 100644 index 00000000..497046f9 --- /dev/null +++ b/include/d/snd/d_snd_source_demo.h @@ -0,0 +1,13 @@ +#ifndef D_SND_SOURCE_DEMO_H +#define D_SND_SOURCE_DEMO_H + +#include "d/snd/d_snd_source_anim_sound.h" + +class dSndSourceDemo_c : public dSndSourceAnimSound_c { +public: + dSndSourceDemo_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup); + + /* 0x200 */ u8 _0x200[0x204 - 0x200]; +}; + +#endif diff --git a/include/d/snd/d_snd_source_e_spark.h b/include/d/snd/d_snd_source_e_spark.h new file mode 100644 index 00000000..295f3ff4 --- /dev/null +++ b/include/d/snd/d_snd_source_e_spark.h @@ -0,0 +1,18 @@ +#ifndef D_SND_SOURCE_E_SPARK_H +#define D_SND_SOURCE_E_SPARK_H + +#include "d/snd/d_snd_source.h" + +class dSndSourceESpark_c : public dSoundSource_c { +public: + dSndSourceESpark_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup) + : dSoundSource_c(sourceType, ac, name, pOwnerGroup) {} + + // TODO - this one doesn't actually have an AnimSound. Maybe the name is wrong, + // maybe something else is weird + virtual bool hasAnimSound() override { + return true; + } +}; + +#endif diff --git a/include/d/snd/d_snd_source_enemy.h b/include/d/snd/d_snd_source_enemy.h new file mode 100644 index 00000000..8088765d --- /dev/null +++ b/include/d/snd/d_snd_source_enemy.h @@ -0,0 +1,169 @@ +#ifndef D_SND_SOURCE_ENEMY_H +#define D_SND_SOURCE_ENEMY_H + +#include "common.h" +#include "d/snd/d_snd_anim_sound.h" +#include "d/snd/d_snd_source.h" +#include "d/snd/d_snd_util.h" +#include "nw4r/ut/ut_list.h" + +class dSndSourceEnemy_c : public dSoundSource_c { +public: + dSndSourceEnemy_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup); + virtual ~dSndSourceEnemy_c(); + + /* 0x020 */ virtual void vt_0x020() override; + /* 0x044 */ virtual void shutdown() override; + + /* 0x114 */ virtual void setBattleBgmRelated(UNKWORD arg) override { + field_0x164 = arg; + } + /* 0x118 */ virtual UNKWORD checkBattleBgmRelated() override; + + /* 0x188 */ virtual void postSetup() override; + /* 0x194 */ virtual u32 overrideStartSoundId(u32 soundId) override; + /* 0x1A0 */ virtual u32 overrideHoldSoundId(u32 soundId, bool initial) override; + + /* 0x1CC */ virtual void postSetupSound(u32 playingId, u32 requestedId, dSndSeSound_c *seSound) override; + + /* 0x1E8 */ virtual u32 d_s_vt_0x1E8(u32 soundId) override { + return specializeBgHitSoundId(soundId, mPolyAttr0, mPolyAttr1); + } + +private: + // Probably not a problem for weak function order since getName is emitted + // earlier through an explicit call + bool isName(const char *name) const { + return streq(name, getName()); + } + void unregisterEnemySource(); + + /* 0x15C */ nw4r::ut::Node mMgrEnemyLink; + /* 0x164 */ UNKWORD field_0x164; + /* 0x168 */ u8 field_0x168; + /* 0x169 */ u8 field_0x169; + /* 0x16A */ bool mIsRegisteredEnemy; +}; + +class dSndSourceEnemyAnimBase_c : public dSndSourceEnemy_c { +public: + dSndSourceEnemyAnimBase_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup) + : dSndSourceEnemy_c(sourceType, ac, name, pOwnerGroup), mAnimSound(this) {} + + /* 0x1A8 */ virtual StartResult + SetupSound(nw4r::snd::SoundHandle *pHandle, u32 soundId, const StartInfo *pStartInfo, void *arg) override { + return setupSoundCommon(pHandle, soundId, pStartInfo, arg); + } + + /* 0x1D4 */ virtual dSndAnimSound_c *getAnimSound() override { + return &mAnimSound; + } + + /* 0x100 */ virtual bool hasAnimSound() override { + return true; + } + /* 0x104 */ virtual void load(void *data, const char *name) override { + mAnimSound.setData(data, name); + } + /* 0x108 */ virtual void setFrame(f32 frame) override { + if (isInaudibleInternal()) { + mAnimSound.resetFrame(frame); + } else { + mAnimSound.setFrame(frame); + } + } + /* 0x10C */ virtual void setRate(f32 frame) override { + mAnimSound.setRate(frame); + } + +protected: + /* 0x16C */ dSndAnimSound_c mAnimSound; +}; + +class dSndSourceEnemyAnim_c : public dSndSourceEnemyAnimBase_c { +public: + dSndSourceEnemyAnim_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup) + : dSndSourceEnemyAnimBase_c(sourceType, ac, name, pOwnerGroup) {} + + /* 0x194 */ virtual u32 overrideStartSoundId(u32 soundId) override; + /* 0x1A0 */ virtual u32 overrideHoldSoundId(u32 soundId, bool initial) override; + +private: +}; + +class dSndSourceEnemyMultiBase_c : public dSndSourceEnemyAnimBase_c { +public: + dSndSourceEnemyMultiBase_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup) + : dSndSourceEnemyAnimBase_c(sourceType, ac, name, pOwnerGroup) { + nw4r::ut::List_Init(&mSubSourceList, 0x14C); + mAnimSound.setCallback(this); + } + + /* 0x1A8 */ virtual StartResult + SetupSound(nw4r::snd::SoundHandle *pHandle, u32 soundId, const StartInfo *pStartInfo, void *arg) override { + bool bHoldFlag = *(bool*)arg; + if (!bHoldFlag && (mAnimEventValue & 0xF) > 0) { + dSoundSource_c *otherSource; + s32 idx = (mAnimEventValue & 0xF) - 1; + if (idx < 0) { + otherSource = nullptr; + } else if (idx >= nw4r::ut::List_GetSize(&mSubSourceList)) { + otherSource = nullptr; + } else { + otherSource = getSubSourceFirst(); + while (idx > 0) { + otherSource = getSubSourceNext(otherSource); + idx--; + } + } + if (otherSource != nullptr) { + otherSource->startSound(soundId, pHandle); + return onSetupError(); + } + } + + return setupSoundCommon(pHandle, soundId, pStartInfo, arg); + } + + /* 0x1D8 */ virtual void registerAdditionalSource(dSoundSource_c *other) override { + if (other == this) { + return; + } + + if (other == nullptr) { + return; + } + if (!hasSubSource(other)) { + appendSubSource(other); + } + } + /* 0x1DC */ virtual bool isMultiSource() const override { + return true; + } + +private: + // TODO: maybe created by the macro below + bool hasSubSource(dSoundSource_c *other) { + for (dSoundSource_c *it = getSubSourceFirst(); it != nullptr; it = getSubSourceNext(it)) { + if (it == other) { + return true; + } + } + return false; + } + + /* 0x210 */ LIST_MEMBER(dSoundSource_c, SubSource); // -> dSoundSource_c::mSubSourceLink +}; + +class dSndSourceEnemyMulti_c : public dSndSourceEnemyMultiBase_c { +public: + dSndSourceEnemyMulti_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup) + : dSndSourceEnemyMultiBase_c(sourceType, ac, name, pOwnerGroup) {} + + /* 0x18C */ virtual void postCalc() override; + +private: + +}; + +#endif diff --git a/include/d/snd/d_snd_source_enums.h b/include/d/snd/d_snd_source_enums.h index d4ebe17c..31c4ae52 100644 --- a/include/d/snd/d_snd_source_enums.h +++ b/include/d/snd/d_snd_source_enums.h @@ -19,28 +19,44 @@ enum SoundSourceType_e { // 10-31: Enemy? (2) SND_SOURCE_ENEMY_10 = 10, + SND_SOURCE_MAGUPPO = 12, + SND_SOURCE_LIZARUFOS = 13, + SND_SOURCE_ENEMY_14 = 14, + SND_SOURCE_BC_Z = 16, + SND_SOURCE_SPARK = 17, SND_SOURCE_BIGBOSS = 20, + SND_SOURCE_BOSS_MG = 21, + SND_SOURCE_BOSS_KR = 22, + SND_SOURCE_BOSS_NUSI = 23, SND_SOURCE_GIRAHUMU_3 = 24, + SND_SOURCE_ENEMY_28 = 28, SND_SOURCE_BULLET = 29, + SND_SOURCE_BULLET_MAGUPPO = 30, SND_SOURCE_ENEMY_31 = 31, // 32-42: Object? (3) SND_SOURCE_OBJECT = 32, + SND_SOURCE_OBJECT_33 = 33, SND_SOURCE_BAMBOO = 34, SND_SOURCE_ITEM = 35, SND_SOURCE_TERRY_SHOP = 36, SND_SOURCE_TIME_STONE = 37, SND_SOURCE_CLEF = 38, SND_SOURCE_SHUTTER = 39, + SND_SOURCE_OBJECT_40 = 40, + SND_SOURCE_LIGHT_SHAFT = 41, SND_SOURCE_OBJECT_42 = 42, // 43-52: Npc (4) SND_SOURCE_NPC_43 = 43, SND_SOURCE_KENSEI = 44, SND_SOURCE_PLAYER_BIRD = 45, - SND_SOURCE_NPC_48 = 48, + SND_SOURCE_NPC_NUSI = 46, + SND_SOURCE_NPC_47 = 47, + SND_SOURCE_NPC_HEAD = 48, SND_SOURCE_INSECT = 49, - SND_SOURCE_NPC_NRM = 51, + SND_SOURCE_NPC_50 = 50, + SND_SOURCE_NPC_51 = 51, SND_SOURCE_NPC_DRAGON = 52, // 53: TagSound (5) @@ -50,13 +66,16 @@ enum SoundSourceType_e { SND_SOURCE_54 = 54, SND_SOURCE_OBJECT_WARP = 55, SND_SOURCE_SW_HARP = 56, - SND_SOURCE_57 = 57, + SND_SOURCE_TG_HARP = 57, // 58: ? (7) SND_SOURCE_58 = 58, // 59: ? (9) SND_SOURCE_59 = 59, + + // dSndDistantSoundActor_c, not a real sound source type + SND_SOURCE_DISTANT = 61, }; enum SoundSourceCategory_e { @@ -66,7 +85,7 @@ enum SoundSourceCategory_e { SND_SOURCE_CATEGORY_OBJECT = 3, SND_SOURCE_CATEGORY_NPC = 4, SND_SOURCE_CATEGORY_TG_SOUND = 5, - SND_SOURCE_CATEGORY_6 = 6, + SND_SOURCE_CATEGORY_HARP_RELATED = 6, SND_SOURCE_CATEGORY_7 = 7, SND_SOURCE_CATEGORY_9 = 9, }; diff --git a/include/d/snd/d_snd_source_equipment.h b/include/d/snd/d_snd_source_equipment.h new file mode 100644 index 00000000..fdcacb23 --- /dev/null +++ b/include/d/snd/d_snd_source_equipment.h @@ -0,0 +1,38 @@ +#ifndef D_SND_SOURCE_EQUIPMENT_H +#define D_SND_SOURCE_EQUIPMENT_H + +#include "d/snd/d_snd_source.h" + +class dSndSourceEquipment_c : public dSoundSource_c { +public: + dSndSourceEquipment_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup); + + /* 0x040 */ virtual void shutdown() override; + /* 0x194 */ virtual u32 overrideStartSoundId(u32 soundId) override; + /* 0x198 */ virtual void postStartSound(nw4r::snd::SoundHandle &handle, dSndSeSound_c *pSound, u32 id) override; + /* 0x19C */ virtual u32 overrideHitObjSoundId(u32 soundId, dSoundSource_c *source) override; + + /* 0x1CC */ virtual void postSetupSound(u32 playingId, u32 requestedId, dSndSeSound_c *seSound) override; + + /* 0x1E8 */ virtual u32 d_s_vt_0x1E8(u32 soundId) override { + return specializeBgHitSoundId(soundId, mPolyAttr0, mPolyAttr1); + } + +private: + static void cbBeFlyLv(dSndSeSound_c *sound, dSoundSource_c *source, nw4r::snd::SoundHandle &handle); + static void cbBeThrowRc(dSndSeSound_c *sound, dSoundSource_c *source, nw4r::snd::SoundHandle &handle); + static void cbBmIgnitionLv(dSndSeSound_c *sound, dSoundSource_c *source, nw4r::snd::SoundHandle &handle); + static void cbBmBound(dSndSeSound_c *sound, dSoundSource_c *source, nw4r::snd::SoundHandle &handle); + static void cbWiFxLv(dSndSeSound_c *sound, dSoundSource_c *source, nw4r::snd::SoundHandle &handle); + static void cbPcHit(dSndSeSound_c *sound, dSoundSource_c *source, nw4r::snd::SoundHandle &handle); +}; + + +class dSndSourceEquipmentWhip_c : public dSndSourceEquipment_c { +public: + dSndSourceEquipmentWhip_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup); + + /* 0x1CC */ virtual void postCalc() override; +}; + +#endif diff --git a/include/d/snd/d_snd_source_group.h b/include/d/snd/d_snd_source_group.h index 187b41a5..4151770b 100644 --- a/include/d/snd/d_snd_source_group.h +++ b/include/d/snd/d_snd_source_group.h @@ -3,11 +3,11 @@ #include "common.h" #include "d/snd/d_snd_misc.h" +#include "d/snd/d_snd_types.h" +#include "d/snd/d_snd_util.h" #include "nw4r/ut/ut_list.h" #include "sized_string.h" -class dSoundSource_c; - /** * All similar dSoundSource_c's are put in a group. The game can then find the closest * source for a given type by name/id, for example for changing things about the music @@ -21,13 +21,16 @@ class dSoundSource_c; class dSndSourceGroup_c { public: dSndSourceGroup_c(); - dSndSourceGroup_c(s32 sourceType, const char*, u32, s32 mSubtype); + dSndSourceGroup_c(s32 sourceType, const char *name, const char *origName, s32 subtype); ~dSndSourceGroup_c(); + void set(s32 sourceType, const char *name, const char *origName, s32 subtype); + void setTemp(s32 sourceType, const char *name, s32 subtype); + void registerSource(dSoundSource_c *); void unregisterSource(dSoundSource_c *); - dSndSourceParam* getAmbientParam() { + dSndSourceParam *getAmbientParam() { return &mParam; } @@ -35,9 +38,31 @@ public: dSoundSource_c *getSourceClosestToPlayer(); s32 getNumSources() const; - void set(s32 type, const char *name); + void setParam(s32 type, const char *name); void calc(); - + void clear(); + void clearTemp(); + + const char *getName() const { + return mName; + } + + const char *getOrigName() const { + return mpOrigName; + } + + s32 getSourceType() const { + return mSourceType; + } + + bool isActive() const { + return mIsActive; + } + + void setIsActive(bool active) { + mIsActive = active; + } + private: bool setParamFromName(const char *name); void resetSoundSourceParam(); @@ -45,14 +70,14 @@ private: /* 0x00 */ nw4r::ut::Node mNode1; /* 0x08 */ nw4r::ut::Node mNode2; - /* 0x10 */ UNKWORD field_0x10; + /* 0x10 */ s32 mSourceType; /* 0x14 */ s32 mSourceCategory; /* 0x18 */ s32 mSubtype; - /* 0x1C */ u8 field_0x1C; - /* 0x1D */ u8 field_0x1D; + /* 0x1C */ bool mIsActive; + /* 0x1D */ bool field_0x1D; /* 0x1E */ SizedString<32> mName; - /* 0x40 */ UNKWORD field_0x40; - /* 0x44 */ nw4r::ut::List mSourceList; + /* 0x40 */ const char *mpOrigName; + /* 0x44 */ LIST_MEMBER(dSoundSource_c, SubSource); /* 0x50 */ dSndSourceParam mParam; /* 0x64 */ dSoundSource_c *mpCachedClosestSourceToListener; /* 0x68 */ dSoundSource_c *mpCachedClosestSourceToPlayer; diff --git a/include/d/snd/d_snd_source_harp_related.h b/include/d/snd/d_snd_source_harp_related.h new file mode 100644 index 00000000..b94ac363 --- /dev/null +++ b/include/d/snd/d_snd_source_harp_related.h @@ -0,0 +1,67 @@ +#ifndef D_SND_SOURCE_HARP_RELATED_H +#define D_SND_SOURCE_HARP_RELATED_H + +#include "d/snd/d_snd_source.h" + +class dSndSourceHarpRelated_c : public dSoundSource_c { +public: + dSndSourceHarpRelated_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup); + virtual ~dSndSourceHarpRelated_c(); + + /* 0x18C */ virtual void postCalc() override; + /* 0x1D0 */ virtual void setPause(bool flag, int fadeFrames) override; + + /* 0x1EC */ virtual UNKWORD d_s_harp_vt_0x1EC() const { + return 0; + } + + /* 0x1F0 */ virtual void d_s_harp_vt_0x1F0(); + /* 0x1F4 */ virtual void d_s_harp_vt_0x1F4(); + /* 0x1F8 */ virtual void d_s_harp_vt_0x1F8(); + +private: + /* 0x15C */ u8 _0x15C[0x1BC - 0x15C]; +}; + +class dSndSourceHarpTg_c : public dSndSourceHarpRelated_c { +public: + dSndSourceHarpTg_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup) + : dSndSourceHarpRelated_c(sourceType, ac, name, pOwnerGroup) {} + +private: +}; + +class dSndSourceHarpObjWarp_c : public dSndSourceHarpRelated_c { +public: + dSndSourceHarpObjWarp_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup) + : dSndSourceHarpRelated_c(sourceType, ac, name, pOwnerGroup) {} + + /* 0x188 */ virtual void postSetup() override; + /* 0x18C */ virtual void postCalc() override; + +private: +}; + +class dSndSourceHarpSwHarp_c : public dSndSourceHarpRelated_c { +public: + dSndSourceHarpSwHarp_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup) + : dSndSourceHarpRelated_c(sourceType, ac, name, pOwnerGroup) {} + + /* 0x188 */ virtual void postSetup() override; + /* 0x18C */ virtual void postCalc() override; + +private: +}; + +class dSndSourceHarpSwHarp4_c : public dSndSourceHarpRelated_c { +public: + dSndSourceHarpSwHarp4_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup); + + /* 0x188 */ virtual void postSetup() override; + /* 0x18C */ virtual void postCalc() override; + +private: + /* 0x1BC */ u8 _0x1BC[0x210 - 0x1BC]; +}; + +#endif diff --git a/include/d/snd/d_snd_source_if.h b/include/d/snd/d_snd_source_if.h index 89486a81..86a08c9f 100644 --- a/include/d/snd/d_snd_source_if.h +++ b/include/d/snd/d_snd_source_if.h @@ -6,82 +6,103 @@ class dAcBase_c; +/** + * Examples: + * * Chandelier hold sound. Game code (dAcOChandelier_c::executeState_Wait) will + * push the current swing angle, callback (80397a40) will play additional sounds + * when chandelier swing speed exceeds certain values. + * * SE_L_ROPE_WIND_LV: callback (80228814) will read and write values to create a feedback + * loop for certain parameters. + * * `dSndSourceEquipment_c::overrideStartSoundId` will directly read the parameter to customize shield + * sounds. + */ +struct dSndSoundCtxParam { + dSndSoundCtxParam() : intParam(0), floatParam(0.0f) {} + ~dSndSoundCtxParam() {} + + /* 0x00 */ s32 intParam; + /* 0x04 */ f32 floatParam; +}; + /** An abstract interface for sound relating to a particular actor. */ class dSoundSourceIf_c { public: + static dSoundSourceIf_c *create(s32 sourceType, dAcBase_c *actor, const char *name, u8 subtype); + virtual ~dSoundSourceIf_c() {} -#define SOUNDSOURCE_VIRTUAL(offset) virtual void vt_##offset() = 0; - SOUNDSOURCE_VIRTUAL(0x0C); - virtual s32 getCategory() const = 0; // 0x10 - SOUNDSOURCE_VIRTUAL(0x14); - virtual s32 getActorType() const = 0; - SOUNDSOURCE_VIRTUAL(0x1C); - SOUNDSOURCE_VIRTUAL(0x20); - SOUNDSOURCE_VIRTUAL(0x24); - virtual const nw4r::math::VEC3 &getListenerPosition() const = 0; // 0x28 - SOUNDSOURCE_VIRTUAL(0x2C); - SOUNDSOURCE_VIRTUAL(0x30); - SOUNDSOURCE_VIRTUAL(0x34); - SOUNDSOURCE_VIRTUAL(0x38); - SOUNDSOURCE_VIRTUAL(0x3C); - virtual void vt_0x40(s32) = 0; - SOUNDSOURCE_VIRTUAL(0x44); - virtual bool hasPlayingSounds() const = 0; // 0x48 - virtual bool isPlayingSound(u32 soundId) = 0; // 0x4C - virtual bool isPlayingSound(const char *soundId) = 0; // 0x50 - SOUNDSOURCE_VIRTUAL(0x54); - SOUNDSOURCE_VIRTUAL(0x58); - SOUNDSOURCE_VIRTUAL(0x5C); - SOUNDSOURCE_VIRTUAL(0x60); - SOUNDSOURCE_VIRTUAL(0x64); - SOUNDSOURCE_VIRTUAL(0x68); - SOUNDSOURCE_VIRTUAL(0x6C); - SOUNDSOURCE_VIRTUAL(0x70); - SOUNDSOURCE_VIRTUAL(0x74); - SOUNDSOURCE_VIRTUAL(0x78); - SOUNDSOURCE_VIRTUAL(0x7C); - SOUNDSOURCE_VIRTUAL(0x80); - SOUNDSOURCE_VIRTUAL(0x84); - SOUNDSOURCE_VIRTUAL(0x88); - SOUNDSOURCE_VIRTUAL(0x8C); - SOUNDSOURCE_VIRTUAL(0x90); - SOUNDSOURCE_VIRTUAL(0x94); - SOUNDSOURCE_VIRTUAL(0x98); - SOUNDSOURCE_VIRTUAL(0x9C); - SOUNDSOURCE_VIRTUAL(0xA0); - SOUNDSOURCE_VIRTUAL(0xA4); - SOUNDSOURCE_VIRTUAL(0xA8); - SOUNDSOURCE_VIRTUAL(0xAC); - SOUNDSOURCE_VIRTUAL(0xB0); - SOUNDSOURCE_VIRTUAL(0xB4); - SOUNDSOURCE_VIRTUAL(0xB8); - SOUNDSOURCE_VIRTUAL(0xBC); - SOUNDSOURCE_VIRTUAL(0xC0); - SOUNDSOURCE_VIRTUAL(0xC4); - SOUNDSOURCE_VIRTUAL(0xC8); - SOUNDSOURCE_VIRTUAL(0xCC); - SOUNDSOURCE_VIRTUAL(0xD0); - SOUNDSOURCE_VIRTUAL(0xD4); - SOUNDSOURCE_VIRTUAL(0xD8); - SOUNDSOURCE_VIRTUAL(0xDC); - SOUNDSOURCE_VIRTUAL(0xE0); - SOUNDSOURCE_VIRTUAL(0xE4); - SOUNDSOURCE_VIRTUAL(0xE8); - SOUNDSOURCE_VIRTUAL(0xEC); - SOUNDSOURCE_VIRTUAL(0xF0); - SOUNDSOURCE_VIRTUAL(0xF4); - SOUNDSOURCE_VIRTUAL(0xF8); - SOUNDSOURCE_VIRTUAL(0xFC); - - virtual bool isReadyMaybe() = 0; // 0x100 - virtual void load(void *data, const char *name) = 0; // 0x104 - virtual void setFrame(f32 frame) = 0; // 0x108 - virtual void setRate(f32 frame) = 0; // 0x10C - - SOUNDSOURCE_VIRTUAL(0x110); - SOUNDSOURCE_VIRTUAL(0x114); - SOUNDSOURCE_VIRTUAL(0x118); + /* 0x00C */ virtual void setup() = 0; + /* 0x010 */ virtual s32 getCategory() const = 0; + /* 0x014 */ virtual bool isCategory(s32 category) const = 0; + /* 0x018 */ virtual s32 getSourceType() const = 0; + /* 0x01C */ virtual bool isSourceType(s32 type) const = 0; + /* 0x020 */ virtual void vt_0x020() = 0; + /* 0x024 */ virtual void setSubtype(u8 subtype) = 0; + /* 0x028 */ virtual const nw4r::math::VEC3 &getListenerPosition() const = 0; + /* 0x02C */ virtual void calc(const nw4r::math::VEC3 &) = 0; + /* 0x030 */ virtual void onFlag(u32 mask) = 0; + /* 0x034 */ virtual void offFlag(u32 mask) = 0; + /* 0x038 */ virtual bool checkFlag(u32 mask) const = 0; + /* 0x03C */ virtual void holdFlag(u32 mask) = 0; + /* 0x040 */ virtual void stopAllSound(s32 fadeFrames) = 0; + /* 0x044 */ virtual void shutdown() = 0; + /* 0x048 */ virtual bool hasPlayingSounds() const = 0; + /* 0x04C */ virtual bool isPlayingSound(u32 soundId) = 0; + /* 0x050 */ virtual bool isPlayingSound(const char *soundId) = 0; + /* 0x054 */ virtual void setCtxParam(const dSndSoundCtxParam *) = 0; + /* 0x058 */ virtual void setCtxFloat(f32 value) = 0; + /* 0x05C */ virtual void setCtxInt(s32 value) = 0; + /* 0x060 */ virtual bool startSound(u32 soundId) = 0; + /* 0x064 */ virtual bool startSoundWithIntParam(u32 soundId, s32 value) = 0; + /* 0x068 */ virtual bool startSoundWithFloatParam(u32 soundId, f32 value) = 0; + /* 0x06C */ virtual bool startSoundWithParams(u32 soundId, f32 fValue, s32 value) = 0; + /* 0x070 */ virtual bool startSound(const char *label) = 0; + /* 0x074 */ virtual bool startSoundWithIntParam(const char *label, s32 value) = 0; + /* 0x078 */ virtual bool startSoundWithFloatParam(const char *label, f32 value) = 0; + /* 0x07C */ virtual bool startSoundWithParams(const char *label, f32 fValue, s32 value) = 0; + /* 0x080 */ virtual bool startSoundAtPosition(u32 soundId, const nw4r::math::VEC3 *position) = 0; + /* 0x084 */ virtual bool + startObjHitSound(u32 baseSoundId, dSoundSourceIf_c *source, const nw4r::math::VEC3 *position) = 0; + /* 0x088 */ virtual bool + startBgHitSound(u32 baseSoundId, u32 polyAttr0, u32 polyAttr1, const nw4r::math::VEC3 *position) = 0; + /* 0x08C */ virtual bool startSoundAtPosition(const char *label, const nw4r::math::VEC3 *position) = 0; + /* 0x090 */ virtual bool + startObjHitSound(const char *label, dSoundSourceIf_c *source, const nw4r::math::VEC3 *position) = 0; + /* 0x094 */ virtual bool + startBgHitSound(const char *label, u32 polyAttr0, u32 polyAttr1, const nw4r::math::VEC3 *position) = 0; + /* 0x098 */ virtual bool startSoundAtPosition2(u32 soundId, const nw4r::math::VEC3 *position) = 0; + /* 0x09C */ virtual bool startSoundAtPosition2(const char *label, const nw4r::math::VEC3 *position) = 0; + /* 0x0A0 */ virtual bool maybeUnusedEnemyDeath() = 0; + /* 0x0A4 */ virtual void stopSounds(u32 soundId, s32 fadeFrames) = 0; + /* 0x0A8 */ virtual void stopSounds(const char *label, s32 fadeFrames) = 0; + /* 0x0AC */ virtual bool holdSound(u32 soundId) = 0; + /* 0x0B0 */ virtual bool holdSoundWithIntParam(u32 soundId, s32 value) = 0; + /* 0x0B4 */ virtual bool holdSoundWithFloatParam(u32 soundId, f32 value) = 0; + /* 0x0B8 */ virtual bool holdSoundWithParams(u32 soundId, f32 fValue, s32 value) = 0; + /* 0x0BC */ virtual bool holdSound(const char *label) = 0; + /* 0x0C0 */ virtual bool holdSoundWithIntParam(const char *label, s32 value) = 0; + /* 0x0C4 */ virtual bool holdSoundWithFloatParam(const char *label, f32 value) = 0; + /* 0x0C8 */ virtual bool holdSoundWithParams(const char *label, f32 fValue, s32 value) = 0; + /* 0x0CC */ virtual bool holdSoundAtPosition(u32 soundId, const nw4r::math::VEC3 *position) = 0; + /* 0x0D0 */ virtual bool holdSoundAtPosition(const char *label, const nw4r::math::VEC3 *position) = 0; + /* 0x0D4 */ virtual bool startVoiceLine(u32 id) = 0; + /* 0x0D8 */ virtual bool startVoiceLine(const char *label) = 0; + /* 0x0DC */ virtual bool vt_0xDC(u32 id) = 0; + /* 0x0E0 */ virtual void stopCurrentActionSound() = 0; + /* 0x0E4 */ virtual void stopActionSound(u32 id) = 0; + /* 0x0E8 */ virtual bool isPlayingActionSound() const = 0; + /* 0x0EC */ virtual bool isCurrentActionSound(u32 id) const = 0; + /* 0x0F0 */ virtual void vt_0x0F0_noop() = 0; + /* 0x0F4 */ virtual void setField0x101(bool value) = 0; + /* 0x0F8 */ virtual void setField0x102(u8 value) = 0; + /* 0x0FC */ virtual bool isInaudible() = 0; + /* 0x100 */ virtual bool hasAnimSound() = 0; + /* 0x104 */ virtual void load(void *data, const char *name) = 0; + /* 0x108 */ virtual void setFrame(f32 frame) = 0; + /* 0x10C */ virtual void setRate(f32 frame) = 0; + /* 0x110 */ virtual void setPolyAttrs(u8 polyAttr0, u8 polyAttr1) = 0; + /* 0x114 */ virtual void setBattleBgmRelated(UNKWORD) = 0; + /* 0x118 */ virtual UNKWORD checkBattleBgmRelated() = 0; }; #endif diff --git a/include/d/snd/d_snd_source_mgr.h b/include/d/snd/d_snd_source_mgr.h index 5582b2d3..f3f56952 100644 --- a/include/d/snd/d_snd_source_mgr.h +++ b/include/d/snd/d_snd_source_mgr.h @@ -15,34 +15,93 @@ class dSndSourceMgr_c { public: dSndSourceMgr_c(); + void setup(); + + static dSoundSourceIf_c *createSource(s32 sourceType, dAcBase_c *actor, const char *name, u8 subtype); void registerSource(dSoundSource_c *source); void unregisterSource(dSoundSource_c *source); + void onShutdownSource(dSoundSource_c *source); + + // Only for sources 10, 11, 12, 13, 14 + void registerUnkEnemyType(dSndSourceEnemy_c *); void playFlowSound(u32 id); static s32 getSourceCategoryForSourceType(s32 sourceType, const char *name); + static bool isSwOrEOc(const char *name); + s32 getPlayerSourceRoomId() const; + + static dSoundSource_c *getPlayerSource() { + return GetInstance()->mpPlayerSource; + } + + static dSoundSource_c *getBoomerangSource() { + return GetInstance()->mpBoomerangSource; + } + + void setMsgSource(dSoundSource_c *source) { + mpMsgSource = source; + } + + u8 getField_0x0012() const { + return field_0x0012; + } + + u8 getField_0x0013() const { + return field_0x0013; + } + + void stopAllSound(); + void stopAllNonPlayerSound(); + void pauseAllSound(); + + void incrementEnemyCount() { + field_0x3868++; + } + + void decrementEnemyCount() { + field_0x3868--; + } + + void setMutedFromFader(bool muteFlag); + void onEventStart(); + void onEventEnd(); private: + void calcEnemyObjVolume(); + static bool isCertainEnemyType(dSoundSource_c *source); + static bool isAnimSoundSource(s32 sourceType, const char *name); + static bool isMultiSoundSource(s32 sourceType, const char *name); + void removeSourceFromList(dSoundSource_c *source, nw4r::ut::List *list); void clearSourceLists(); void clearSourceList(nw4r::ut::List *list); + dSndSourceGroup_c *getActiveGroupForName(const char *name); + dSndSourceGroup_c *getInactiveGroup(); + dSndSourceGroup_c *getGroup(s32 sourceType, dAcBase_c *actor, const char *name, const char *origName, u8 subtype); + bool fn_803846D0(s32 sourceType, const char *name, u8 subtype); + + bool addGroupToLoading(dSndSourceGroup_c *group); + void activateGroup(dSndSourceGroup_c *group); + bool isActiveGroup(dSndSourceGroup_c *group) const; + /* 0x0010 */ u8 field_0x0010; /* 0x0011 */ u8 field_0x0011; /* 0x0012 */ u8 field_0x0012; /* 0x0013 */ u8 field_0x0013; /* 0x0014 */ dSndSourceGroup_c *mpDefaultGroup; - /* 0x0018 */ nw4r::ut::List mGroupList1; - /* 0x0024 */ nw4r::ut::List mGroupList2; - /* 0x0030 */ nw4r::ut::List mGroupList3; + /* 0x0018 */ LIST_MEMBER(dSndSourceGroup_c, Group1); + /* 0x0024 */ LIST_MEMBER(dSndSourceGroup_c, Group2); + /* 0x0030 */ LIST_MEMBER(dSndSourceGroup_c, Group3); /* 0x003C */ dSndSourceGroup_c mGroups[NUM_GROUPS]; // Not sure what these are for - /* 0x383C */ nw4r::ut::List mAllSources; // node offset 0xE8, probably into dSoundSource::mMgrLink - /* 0x3848 */ nw4r::ut::List field_0x3848; // node offset 0x15C, possibly a subset of source types - /* 0x3854 */ nw4r::ut::List field_0x3854; // node offset 0x160 + /* 0x383C */ LIST_MEMBER(dSoundSource_c, AllSources); // node offset 0xE8, -> dSoundSource_c::mMgrLink + /* 0x3848 */ nw4r::ut::List field_0x3848; // node offset 0x15C, -> dSndSourceEnemy_c::mMgrEnemyLink + /* 0x3854 */ LIST_MEMBER(dSndSourceHarpRelated_c, HarpRelated); // node offset 0x160, -> dSndSourceHarpRelated_c /* 0x3860 */ UNKWORD field_0x3860; /* 0x3864 */ UNKWORD field_0x3864; @@ -54,7 +113,7 @@ private: /* 0x3878 */ dSoundSource_c *mpBoomerangSource; /* 0x387C */ dSoundSource_c *mpTBoatSource; /* 0x3880 */ dSoundSource_c *field_0x3880; // fi singing related? - /* 0x3884 */ dSoundSource_c *field_0x3884; + /* 0x3884 */ dSoundSource_c *mpMsgSource; }; #endif diff --git a/include/d/snd/d_snd_source_npc.h b/include/d/snd/d_snd_source_npc.h new file mode 100644 index 00000000..da3308bd --- /dev/null +++ b/include/d/snd/d_snd_source_npc.h @@ -0,0 +1,68 @@ +#ifndef D_SND_SOURCE_NPC_H +#define D_SND_SOURCE_NPC_H + +#include "d/snd/d_snd_anim_sound.h" +#include "d/snd/d_snd_source.h" + +// vtable at 8054d540 - placed by implementation of postSetupSound, +// so this is the base class and also instantiated in createSource +class dSndSourceNpc_c : public dSoundSource_c { +public: + dSndSourceNpc_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup) + : dSoundSource_c(sourceType, ac, name, pOwnerGroup) {} + + /* 0x1CC */ virtual void postSetupSound(u32 playingId, u32 requestedId, dSndSeSound_c *seSound) override; + + /* 0x1E8 */ virtual u32 d_s_vt_0x1E8(u32 soundId) override { + return specializeBgHitSoundId(soundId, mPolyAttr0, mPolyAttr1); + } + // at 80032af0, explicitly called by dAcNpc_c + /* 0x1EC */ virtual void d_s_npc_vt_0x1EC(dSndSourceNpc_c *source) {} + +private: +}; + +class dSndSourceNpcAnimBase_c : public dSndSourceNpc_c { +public: + dSndSourceNpcAnimBase_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup) + : dSndSourceNpc_c(sourceType, ac, name, pOwnerGroup), mAnimSound(this) {} + + /* 0x1A8 */ virtual StartResult + SetupSound(nw4r::snd::SoundHandle *pHandle, u32 soundId, const StartInfo *pStartInfo, void *arg) override { + return setupSoundCommon(pHandle, soundId, pStartInfo, arg); + } + + /* 0x1D4 */ virtual dSndAnimSound_c *getAnimSound() override { + return &mAnimSound; + } + + /* 0x100 */ virtual bool hasAnimSound() override { + return true; + } + /* 0x104 */ virtual void load(void *data, const char *name) override { + mAnimSound.setData(data, name); + } + /* 0x108 */ virtual void setFrame(f32 frame) override { + if (isInaudibleInternal()) { + mAnimSound.resetFrame(frame); + } else { + mAnimSound.setFrame(frame); + } + } + /* 0x10C */ virtual void setRate(f32 frame) override { + mAnimSound.setRate(frame); + } + +private: + /* 0x15C */ dSndAnimSound_c mAnimSound; +}; + +class dSndSourceNpcAnim_c : public dSndSourceNpcAnimBase_c { +public: + dSndSourceNpcAnim_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup) + : dSndSourceNpcAnimBase_c(sourceType, ac, name, pOwnerGroup) {} + +private: +}; + +#endif diff --git a/include/d/snd/d_snd_source_npc_head.h b/include/d/snd/d_snd_source_npc_head.h new file mode 100644 index 00000000..b033af2d --- /dev/null +++ b/include/d/snd/d_snd_source_npc_head.h @@ -0,0 +1,30 @@ +#ifndef D_SND_SOURCE_NPC_HEAD_H +#define D_SND_SOURCE_NPC_HEAD_H + +#include "common.h" +#include "d/snd/d_snd_source.h" + +class dSndSourceNpcHead_c : public dSoundSource_c { +public: + dSndSourceNpcHead_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup); + + void setMainName(const char *name) { + mpMainName = name; + } + + /* 0x0D4 */ virtual bool startVoiceLine(u32 id) override; + /* 0x0DC */ virtual bool vt_0xDC(u32 id) override; + + /* 0x180 */ virtual void setOrigName(const char *arg) override; + + // id can be a WZSound ID or an offset from LABEL_NV_START + /* 0x1EC */ virtual bool npcSpeak(u32 id); + + /* 0x1CC */ virtual void postSetupSound(u32 playingId, u32 requestedId, dSndSeSound_c *seSound) override; + +private: + /* 0x15C */ UNKWORD field_0x15C; + /* 0x160 */ const char *mpMainName; +}; + +#endif diff --git a/include/d/snd/d_snd_source_npc_special.h b/include/d/snd/d_snd_source_npc_special.h new file mode 100644 index 00000000..4fd2349b --- /dev/null +++ b/include/d/snd/d_snd_source_npc_special.h @@ -0,0 +1,23 @@ +#ifndef D_SND_SOURCE_NPC_SPECIAL_H +#define D_SND_SOURCE_NPC_SPECIAL_H + +#include "common.h" +#include "d/snd/d_snd_source_npc.h" + +class dSndSourceNpcSpecial_c : public dSndSourceNpcAnimBase_c { +public: + dSndSourceNpcSpecial_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup); + +private: + /* 0x200 */ u8 _0x200[0x204 - 0x200]; +}; + +class dSndSourceNpcDr_c : public dSndSourceNpcSpecial_c { +public: + dSndSourceNpcDr_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup); + +private: + /* 0x204 */ u8 _0x204[0x20C - 0x204]; +}; + +#endif diff --git a/include/d/snd/d_snd_source_obj.h b/include/d/snd/d_snd_source_obj.h new file mode 100644 index 00000000..416ff403 --- /dev/null +++ b/include/d/snd/d_snd_source_obj.h @@ -0,0 +1,79 @@ +#ifndef D_SND_SOURCE_OBJ_H +#define D_SND_SOURCE_OBJ_H + +#include "d/snd/d_snd_anim_sound.h" +#include "d/snd/d_snd_source.h" +#include "d/snd/d_snd_util.h" +#include "nw4r/math/math_types.h" + +class dSndSourceObj_c : public dSoundSource_c { +public: + dSndSourceObj_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup) + : dSoundSource_c(sourceType, ac, name, pOwnerGroup) {} + + /* 0x188 */ virtual void postSetup() override; + + /* 0x1CC */ virtual void postSetupSound(u32 playingId, u32 requestedId, dSndSeSound_c *seSound) override; + + /* 0x1E8 */ virtual u32 d_s_vt_0x1E8(u32 soundId) override { + return specializeBgHitSoundId(soundId, mPolyAttr0, mPolyAttr1); + } + +private: + // Probably not a problem for weak function order since getName is emitted + // earlier through an explicit call + bool isName(const char *name) const { + return streq(name, getName()); + } +}; + +class dSndSourceObjLightShaft_c : public dSndSourceObj_c { +public: + dSndSourceObjLightShaft_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup) + : dSndSourceObj_c(sourceType, ac, name, pOwnerGroup) {} + + /* 0x1EC */ virtual void setPosition(const nw4r::math::VEC3 &position) override; +}; + +class dSndSourceObjAnimBase_c : public dSndSourceObj_c { +public: + dSndSourceObjAnimBase_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup) + : dSndSourceObj_c(sourceType, ac, name, pOwnerGroup), mAnimSound(this) {} + + /* 0x1A8 */ virtual StartResult + SetupSound(nw4r::snd::SoundHandle *pHandle, u32 soundId, const StartInfo *pStartInfo, void *arg) override { + return setupSoundCommon(pHandle, soundId, pStartInfo, arg); + } + + /* 0x1D4 */ virtual dSndAnimSound_c *getAnimSound() override { + return &mAnimSound; + } + + /* 0x100 */ virtual bool hasAnimSound() override { + return true; + } + /* 0x104 */ virtual void load(void *data, const char *name) override { + mAnimSound.setData(data, name); + } + /* 0x108 */ virtual void setFrame(f32 frame) override { + if (isInaudibleInternal()) { + mAnimSound.resetFrame(frame); + } else { + mAnimSound.setFrame(frame); + } + } + /* 0x10C */ virtual void setRate(f32 frame) override { + mAnimSound.setRate(frame); + } + +protected: + /* 0x15C */ dSndAnimSound_c mAnimSound; +}; + +class dSndSourceObjAnim_c : public dSndSourceObjAnimBase_c { +public: + dSndSourceObjAnim_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup) + : dSndSourceObjAnimBase_c(sourceType, ac, name, pOwnerGroup) {} +}; + +#endif diff --git a/include/d/snd/d_snd_source_obj_clef.h b/include/d/snd/d_snd_source_obj_clef.h new file mode 100644 index 00000000..3b2b8d6a --- /dev/null +++ b/include/d/snd/d_snd_source_obj_clef.h @@ -0,0 +1,14 @@ +#ifndef D_SND_SOURCE_OBJ_CLEF_H +#define D_SND_SOURCE_OBJ_CLEF_H + +#include "d/snd/d_snd_source_obj.h" + +class dSndSourceObjClef_c : public dSndSourceObj_c { +public: + dSndSourceObjClef_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup) + : dSndSourceObj_c(sourceType, ac, name, pOwnerGroup) {} + + bool startTadtoneSound(u32 groupIdx, u32 noteIdx); +}; + +#endif diff --git a/include/d/snd/d_snd_source_player.h b/include/d/snd/d_snd_source_player.h new file mode 100644 index 00000000..02fb843e --- /dev/null +++ b/include/d/snd/d_snd_source_player.h @@ -0,0 +1,13 @@ +#ifndef D_SND_SOURCE_PLAYER_H +#define D_SND_SOURCE_PLAYER_H + +#include "d/snd/d_snd_source_anim_sound.h" + +class dSndSourcePlayer_c : public dSndSourceAnimSound_c { +public: + dSndSourcePlayer_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup); + + /* 0x200 */ u8 _0x200[0x238 - 0x200]; +}; + +#endif diff --git a/include/d/snd/d_snd_source_player_head.h b/include/d/snd/d_snd_source_player_head.h new file mode 100644 index 00000000..e221595c --- /dev/null +++ b/include/d/snd/d_snd_source_player_head.h @@ -0,0 +1,69 @@ +#ifndef D_SND_SOURCE_PLAYER_HEAD_H +#define D_SND_SOURCE_PLAYER_HEAD_H + +#include "common.h" +#include "d/snd/d_snd_rng_link_voice.h" +#include "d/snd/d_snd_source.h" +#include "nw4r/snd/snd_SoundHandle.h" + +class dSndSourcePlayerHead_c : public dSoundSource_c { +public: + dSndSourcePlayerHead_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup); + + bool startVoiceSoundInternal(u32 id); + + /* 0x0D4 */ virtual bool startVoiceLine(u32 id) override; + + /* 0x0E0 */ virtual void stopCurrentActionSound() override { + mSoundHandle.Stop(2); + field_0x22A0 = SND_LV_MAX; + } + /* 0x0E4 */ virtual void stopActionSound(u32 id) override { + if (isCurrentActionSound(id)) { + stopCurrentActionSound(); + } + } + /* 0x0E8 */ virtual bool isPlayingActionSound() const override { + return mSoundHandle.IsAttachedSound(); + } + /* 0x0EC */ virtual bool isCurrentActionSound(u32 id) const override { + return isPlayingActionSound() && id == mLastPlayedSound; + } + + // TODO - some of these might not be inlines. It's probably possible to implement them + // as not inlines in the source file for the correct order, but maybe when we figure out how + // to fix the order in d_snd_source_mgr we might also be able to fix it here that way. + + /* 0x0D8 */ virtual bool startVoiceLine(const char *label) override { + return false; + } + + /* 0x184 */ virtual void preCalc() override {} + + /* 0x194 */ virtual u32 overrideStartSoundId(u32 soundId) override { + return soundId; + } + + /* 0x1EC */ virtual bool d_vt_0x30() override { + return false; + } + + /* 0x1F0 */ virtual bool vt_1F0() { + return false; + } + + /* 0x1F4 */ virtual UNKWORD d_vt_0x3C() override { + return 1; + } + +private: + void configureVoiceRngs(); + + /* 0x015C */ u8 _0x015C[0x0160 - 0x015C]; + /* 0x0160 */ dSndRngLinkVoice_c mLinkVoiceRngs[SND_LV_MAX]; + /* 0x22A0 */ u32 field_0x22A0; + /* 0x22A4 */ s32 mLastPlayedSound; + /* 0x22A8 */ nw4r::snd::SoundHandle mSoundHandle; +}; + +#endif diff --git a/include/d/snd/d_snd_source_py_bird.h b/include/d/snd/d_snd_source_py_bird.h new file mode 100644 index 00000000..994bc11e --- /dev/null +++ b/include/d/snd/d_snd_source_py_bird.h @@ -0,0 +1,21 @@ +#ifndef D_SND_SOURCE_PY_BIRD_H +#define D_SND_SOURCE_PY_BIRD_H + +#include "d/snd/d_snd_source_anim_sound.h" + +class dSndSourcePyBird_c : public dSndSourceAnimSound_c { +public: + dSndSourcePyBird_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup) + : dSndSourceAnimSound_c(sourceType, ac, name, pOwnerGroup), mSeqVarValue(0) {} + + /* 0x104 */ virtual void load(void *data, const char *name) override; + + /* 0x1CC */ virtual void postSetupSound(u32 playingId, u32 requestedId, dSndSeSound_c *seSound) override; + +private: + static void cbPyBirdGlide(dSndSeSound_c *sound, dSoundSource_c *source, nw4r::snd::SoundHandle &handle); + + /* 0x200 */ s32 mSeqVarValue; +}; + +#endif diff --git a/include/d/snd/d_snd_source_tg_sound.h b/include/d/snd/d_snd_source_tg_sound.h new file mode 100644 index 00000000..2544a7dd --- /dev/null +++ b/include/d/snd/d_snd_source_tg_sound.h @@ -0,0 +1,23 @@ +#ifndef D_SND_SOURCE_TG_SOUND_H +#define D_SND_SOURCE_TG_SOUND_H + +#include "d/snd/d_snd_source.h" + +class dSndSourceTgSound_c : public dSoundSource_c { +public: + dSndSourceTgSound_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup); + + /* 0x184 */ virtual void preCalc() override {} + /* 0x188 */ virtual void postSetup() override; + /* 0x18C */ virtual void postCalc() override; + + /* 0x1CC */ virtual void postSetupSound(u32 playingId, u32 requestedId, dSndSeSound_c *seSound) override; + + void setTgActive(bool active); + +private: + /* 0x15C */ u32 mTgSoundId; + /* 0x160 */ bool mTgActive; +}; + +#endif diff --git a/include/d/snd/d_snd_stage_data.h b/include/d/snd/d_snd_stage_data.h new file mode 100644 index 00000000..082a4bb9 --- /dev/null +++ b/include/d/snd/d_snd_stage_data.h @@ -0,0 +1,196 @@ +#ifndef D_SND_STATE_DEF_H +#define D_SND_STATE_DEF_H + +#include "common.h" + +struct dSndStageInfo { + /* 0x00 */ const char *stageName; + /* 0x04 */ s32 layer; + /* 0x08 */ u32 unk1; + /* 0x0C */ u32 unk2; + /* 0x10 */ u32 unk3; + /* 0x14 */ s32 unk4; + /* 0x18 */ const char *demoName; + + static const s32 sNumStageInfos; + static const dSndStageInfo sInfos[]; +}; + +enum SndStage_e { + /* 0x00 */ SND_STAGE_F100, + /* 0x01 */ SND_STAGE_F101, + /* 0x02 */ SND_STAGE_F102, + /* 0x03 */ SND_STAGE_F102_1, + /* 0x04 */ SND_STAGE_F103_L13, + /* 0x05 */ SND_STAGE_F103, + /* 0x06 */ SND_STAGE_F200, + /* 0x07 */ SND_STAGE_F201_1, + /* 0x08 */ SND_STAGE_F201_2, + /* 0x09 */ SND_STAGE_F201_3, + /* 0x0A */ SND_STAGE_F201_4, + /* 0x0B */ SND_STAGE_F202, + /* 0x0C */ SND_STAGE_F300, + /* 0x0D */ SND_STAGE_F300_1, + /* 0x0E */ SND_STAGE_F300_4_L13, + /* 0x0F */ SND_STAGE_F300_4, + /* 0x10 */ SND_STAGE_F301, + /* 0x11 */ SND_STAGE_F301_1, + /* 0x12 */ SND_STAGE_F301_2, + /* 0x13 */ SND_STAGE_F301_3, + /* 0x14 */ SND_STAGE_F301_4_L2, + /* 0x15 */ SND_STAGE_F301_4, + /* 0x16 */ SND_STAGE_F301_6, + /* 0x17 */ SND_STAGE_F301_7, + /* 0x18 */ SND_STAGE_F302_L13, + /* 0x19 */ SND_STAGE_F302, + /* 0x1A */ SND_STAGE_F400_L13, + /* 0x1B */ SND_STAGE_F400, + /* 0x1C */ SND_STAGE_F401_L2, + /* 0x1D */ SND_STAGE_F401_L3, + /* 0x1E */ SND_STAGE_F401_L4, + /* 0x1F */ SND_STAGE_F401_L13, + /* 0x20 */ SND_STAGE_F401_L14, + /* 0x21 */ SND_STAGE_F401_L15, + /* 0x22 */ SND_STAGE_F401, + /* 0x23 */ SND_STAGE_F403_L13, + /* 0x24 */ SND_STAGE_F403_L14, + /* 0x25 */ SND_STAGE_F403_L15, + /* 0x26 */ SND_STAGE_F403_L16, + /* 0x27 */ SND_STAGE_F403, + /* 0x28 */ SND_STAGE_F405, + /* 0x29 */ SND_STAGE_F406_L13, + /* 0x2A */ SND_STAGE_F406_L14, + /* 0x2B */ SND_STAGE_F406, + /* 0x2C */ SND_STAGE_D301, + /* 0x2D */ SND_STAGE_D301_1, + /* 0x2E */ SND_STAGE_D000, + /* 0x2F */ SND_STAGE_D100, + /* 0x30 */ SND_STAGE_D101, + /* 0x31 */ SND_STAGE_D200, + /* 0x32 */ SND_STAGE_D201, + /* 0x33 */ SND_STAGE_D201_1, + /* 0x34 */ SND_STAGE_D300, + /* 0x35 */ SND_STAGE_D300_1, + /* 0x36 */ SND_STAGE_D003_0, + /* 0x37 */ SND_STAGE_D003_1, + /* 0x38 */ SND_STAGE_D003_2, + /* 0x39 */ SND_STAGE_D003_3, + /* 0x3A */ SND_STAGE_D003_4, + /* 0x3B */ SND_STAGE_D003_5, + /* 0x3C */ SND_STAGE_D003_6, + /* 0x3D */ SND_STAGE_D003_7, + /* 0x3E */ SND_STAGE_D003_8, + /* 0x3F */ SND_STAGE_B100_L13, + /* 0x40 */ SND_STAGE_B100, + /* 0x41 */ SND_STAGE_B100_1_L13, + /* 0x42 */ SND_STAGE_B100_1, + /* 0x43 */ SND_STAGE_B101, + /* 0x44 */ SND_STAGE_B101_1_L13, + /* 0x45 */ SND_STAGE_B101_1, + /* 0x46 */ SND_STAGE_B200_L1, + /* 0x47 */ SND_STAGE_B200_L2, + /* 0x48 */ SND_STAGE_B200_L3, + /* 0x49 */ SND_STAGE_B200, + /* 0x4A */ SND_STAGE_B210_L13, + /* 0x4B */ SND_STAGE_B210_L14, + /* 0x4C */ SND_STAGE_B210, + /* 0x4D */ SND_STAGE_B201_L13, + /* 0x4E */ SND_STAGE_B201, + /* 0x4F */ SND_STAGE_B201_1_L13, + /* 0x50 */ SND_STAGE_B201_1, + /* 0x51 */ SND_STAGE_B300, + /* 0x52 */ SND_STAGE_B301_L13, + /* 0x53 */ SND_STAGE_B301, + /* 0x54 */ SND_STAGE_B003, + /* 0x55 */ SND_STAGE_B400_L13, + /* 0x56 */ SND_STAGE_B400_L14, + /* 0x57 */ SND_STAGE_B400, + /* 0x58 */ SND_STAGE_F100_1, + /* 0x59 */ SND_STAGE_F100_2, + /* 0x5A */ SND_STAGE_F102_2, + /* 0x5B */ SND_STAGE_F103_1_L13, + /* 0x5C */ SND_STAGE_F103_1_L14, + /* 0x5D */ SND_STAGE_F103_1, + /* 0x5E */ SND_STAGE_F210, + /* 0x5F */ SND_STAGE_F211, + /* 0x60 */ SND_STAGE_F221_L13, + /* 0x61 */ SND_STAGE_F221, + /* 0x62 */ SND_STAGE_F202_1, + /* 0x63 */ SND_STAGE_F202_2, + /* 0x64 */ SND_STAGE_F202_3, + /* 0x65 */ SND_STAGE_F202_4, + /* 0x66 */ SND_STAGE_F300_2, + /* 0x67 */ SND_STAGE_F300_3, + /* 0x68 */ SND_STAGE_F300_5, + /* 0x69 */ SND_STAGE_F303, + /* 0x6A */ SND_STAGE_S000, + /* 0x6B */ SND_STAGE_S100, + /* 0x6C */ SND_STAGE_S200, + /* 0x6D */ SND_STAGE_S300, + /* 0x6E */ SND_STAGE_F020_L3, + /* 0x6F */ SND_STAGE_F020, + /* 0x70 */ SND_STAGE_F021_L13, + /* 0x71 */ SND_STAGE_F021, + /* 0x72 */ SND_STAGE_F023_L14, + /* 0x73 */ SND_STAGE_F023, + /* 0x74 */ SND_STAGE_F000_L13, + /* 0x75 */ SND_STAGE_F000_L14, + /* 0x76 */ SND_STAGE_F000_L15, + /* 0x77 */ SND_STAGE_F000_L16, + /* 0x78 */ SND_STAGE_F000_L17, + /* 0x79 */ SND_STAGE_F000_L18, + /* 0x7A */ SND_STAGE_F000_L19, + /* 0x7B */ SND_STAGE_F000_L20, + /* 0x7C */ SND_STAGE_F000_L21, + /* 0x7D */ SND_STAGE_F000_L26, + /* 0x7E */ SND_STAGE_F000_L27, + /* 0x7F */ SND_STAGE_F000, + /* 0x80 */ SND_STAGE_F301_5, + /* 0x81 */ SND_STAGE_F001r_L13, + /* 0x82 */ SND_STAGE_F001r_L14, + /* 0x83 */ SND_STAGE_F001r_L15, + /* 0x84 */ SND_STAGE_F001r, + /* 0x85 */ SND_STAGE_F002r, + /* 0x86 */ SND_STAGE_F004r, + /* 0x87 */ SND_STAGE_F009r, + /* 0x88 */ SND_STAGE_F011r, + /* 0x89 */ SND_STAGE_F012r, + /* 0x8A */ SND_STAGE_F019r, + /* 0x8B */ SND_STAGE_F005r, + /* 0x8C */ SND_STAGE_F006r, + /* 0x8D */ SND_STAGE_F007r, + /* 0x8E */ SND_STAGE_F013r, + /* 0x8F */ SND_STAGE_F014r, + /* 0x90 */ SND_STAGE_F015r, + /* 0x91 */ SND_STAGE_F016r, + /* 0x92 */ SND_STAGE_F017r, + /* 0x93 */ SND_STAGE_F018r, + /* 0x94 */ SND_STAGE_F402_L2, + /* 0x95 */ SND_STAGE_F402_L3, + /* 0x96 */ SND_STAGE_F402_L5, + /* 0x97 */ SND_STAGE_F402_L13, + /* 0x98 */ SND_STAGE_F402_L18, + /* 0x99 */ SND_STAGE_F402_L19, + /* 0x9A */ SND_STAGE_F402, + /* 0x9B */ SND_STAGE_F404_L13, + /* 0x9C */ SND_STAGE_F404_L14, + /* 0x9D */ SND_STAGE_F404, + /* 0x9E */ SND_STAGE_F407_L13, + /* 0x9F */ SND_STAGE_F407_L14, + /* 0xA0 */ SND_STAGE_F407_L15, + /* 0xA1 */ SND_STAGE_F407, + /* 0xA2 */ SND_STAGE_F008r_L13, + /* 0xA3 */ SND_STAGE_F008r_L14, + /* 0xA4 */ SND_STAGE_F008r_L15, + /* 0xA5 */ SND_STAGE_F008r, + /* 0xA6 */ SND_STAGE_F010r_L13, + /* 0xA7 */ SND_STAGE_F010r_L14, + /* 0xA8 */ SND_STAGE_F010r_L15, + /* 0xA9 */ SND_STAGE_F010r, + /* 0xAA */ SND_STAGE_Demo_L13, + /* 0xAB */ SND_STAGE_Demo, + + /* 0xAC */ SND_STAGE_MAX, +}; + +#endif diff --git a/include/d/snd/d_snd_state_mgr.h b/include/d/snd/d_snd_state_mgr.h new file mode 100644 index 00000000..ce3058ef --- /dev/null +++ b/include/d/snd/d_snd_state_mgr.h @@ -0,0 +1,375 @@ +#ifndef D_SND_STATE_MGR_H +#define D_SND_STATE_MGR_H + +#include "common.h" +#include "d/snd/d_snd_event.h" +#include "d/snd/d_snd_util.h" +#include "nw4r/snd/snd_FxReverbStdDpl2.h" +#include "nw4r/snd/snd_SoundHandle.h" +#include "sized_string.h" + +SND_DISPOSER_FORWARD_DECL(dSndStateMgr_c); + +// Previous Ghidra name: EnemySoundMgr +class dSndStateMgr_c { +public: + SND_DISPOSER_MEMBERS(dSndStateMgr_c); + +public: + typedef void (*OnEventStartCallback)(s32 soundEventId, u32 flags); + typedef void (*OnFlagsChangeCallback)(u32 newFlags, u32 oldFlags); + + enum StageFlags_e { + STAGE_FIELD = 0x1, + STAGE_DUNGEON = 0x2, + STAGE_BOSS = 0x4, + STAGE_SILENT_REALM = 0x8, + + STAGE_ROOM = 0x10, // only for sky + + STAGE_SKY = 0x20, + STAGE_FOREST = 0x40, + STAGE_MOUNTAIN = 0x80, + STAGE_DESERT = 0x100, + STAGE_SILENT_GROUNDS = 0x200, + }; + + enum Flag0x10_e { + FLAG0x10_0x01 = 0x01, + FLAG0x10_0x02 = 0x02, + FLAG0x10_0x04 = 0x04, + FLAG0x10_0x08 = 0x08, + FLAG0x10_0x10 = 0x10, + }; + + // 0x94 + enum EventFlags_e { + EVENT_IN_EVENT = 0x1, + EVENT_DEMO = 0x2, + EVENT_0x04 = 0x4, + EVENT_MUTE_BGM_PARTIAL = 0x8, + EVENT_MUTE_BGM_FULL = 0x10, + EVENT_MUTE_STAGE_EFFECTS_PARTIAL = 0x20, + EVENT_MUTE_STAGE_EFFECTS_FULL = 0x40, + EVENT_MUTE_ENEMY_PARTIAL = 0x80, + EVENT_MUTE_ENEMY_FULL = 0x100, + EVENT_MUTE_OBJ_PARTIAL = 0x200, + EVENT_MUTE_OBJ_FULL = 0x400, + EVENT_0x800 = 0x800, + EVENT_0x400000 = 0x400000, + }; + + dSndStateMgr_c(); + + void setup(EGG::Heap *pHeap); + void calc(); + void restoreEffects(); + + static bool isInStage(const char *stageName); + + bool getField_0x064() const { + return field_0x064; + } + + s32 getField_0x14() const { + return field_0x014; + } + + s32 getStageId_0x040() const { + return mStageId; + } + + s32 getStageId_0x044() const { + return field_0x044; + } + + s32 getLayer() const { + return mLayer; + } + + u32 getFrameCounter() const { + return mFrameCounter; + } + + f32 getFxSend3D() const { + return mFxSend3D; + } + + void resetEventName() { + mEventName = "EVENT_NONE"; + } + + const char *getCameraFmt() { + return "%s_C%d_%d"; + } + + const char *getMsgWaitFmt() { + return "%s_M%d_W%d_%d"; + } + + const char *getFrameFmt() { + return "%s_%d"; + } + + bool checkFlag0x18(u32 mask); + + bool checkFlag0x258(u32 mask) { + return field_0x258 & mask; + } + + void resetFlag0x258() { + field_0x258 = 0; + } + + void onFlag0x258(u32 mask) { + field_0x258 |= mask; + } + + void offFlag0x258(u32 mask) { + field_0x258 &= ~mask; + } + + bool checkStageTypeFlag(u32 mask) { + return mStageTypeFlags & mask; + } + + bool checkFlag0x10(u32 mask) { + return field_0x010 & mask; + } + + void onFlag0x10(u32 mask) { + field_0x010 |= mask; + } + + void offFlag0x10(u32 mask) { + field_0x010 &= ~mask; + } + + bool checkEventFlag(u32 mask) { + return mEventFlags & mask; + } + + void onEventFlag(u32 mask) { + mEventFlags |= mask; + } + + void offEventFlag(u32 mask) { + mEventFlags &= ~mask; + } + + void setFlowEvent(u32 eventId); + + const char *getCurrentStageMusicDemoName() const; + bool isInDemo() const { + // implicit conversion required for regalloc in loadStageSound + return getCurrentStageMusicDemoName(); + } + + void setStbEventName(const char *eventName); + void setEvent(const char *eventName); + // not sure, subtype is unused + bool isActiveDemoMaybe(s32 subtype) const; + bool isInEvent(const char *eventName); + bool isInEvent(); + bool onSkipEvent() const; + + void onMsgStart(s32 idx); + void onMsgEnd(); + + void onMsgWaitStart(); + void onMsgWaitEnd(); + + void onLinkDie(); + + f32 getUserParamVolume(u32 userParam); + + void onStageOrLayerUpdate(); + void onStageLoad(); + void onRestartScene(s32 fadeFrames); + void onGotoStage(s32 fadeFrames); + void loadStageSound(); + void loadObjectSound(); + + // TODO better names + static const char *getStageName(s32 id); + const char *getStageName4(s32 id); + const char *getCurrentStageName4(); + + static s32 getSndStageId(const char *stageName, s32 layer); + static s32 getSndStageId3(const char *stageName, s32 layer); + static s32 getSndStageId4(const char *stageName, s32 layer); + + static s32 getSndStageId2(s32 id); + static s32 getSndStageId4(s32 id); + + static s32 getNextSndStageId(s32 id); + static bool specialLayerVersionExists(const char *stageName, s32 layer); + + enum SoundIdLookup_e { + LOOKUP_BGM, + LOOKUP_BGM_MAIN, + LOOKUP_SE_A, + }; + + u32 getSoundIdForStageAndLayer(SoundIdLookup_e lookup, const char *stageName, s32 layer, s32 stageId); + + void setFiltersIfUnderwater(); + void setBgmLpfAndFxSendIfUnderwater(); + void resetLpfAndFxSend(); + void resetBgmLpfAndFxSend(); + void setBgmAndStageEffectLpf(); + void setBgmLpf(); + void setBgmLpf(s32 fadeFrames); + void resetBgmAndStageEffectLpf(); + void resetBgmLpf(); + + void onCameraCut(s32 cutIdx); + + static void clearEventExecuteCallback(); + +private: + void loadStageSound(bool force); + + void resetOverrides(); + void initializeEventCallbacks(const char *name); + bool handleGlobalEvent(const char *name); + bool handleStageEvent(const char *name); + void handleDemoEvent(const char *name); + + void calcEvent(); + void calcRoomId(); + void setRoomId(s32 roomId); + void calcTgSnd(); + void calcFilters(); + void calcFxSend3D(); + void setFxSend3DTarget(); + + u32 getBgmLabelSoundId(); + void doLabelSuffix(const char *suffix); + + u32 convertSeLabelToSoundId(const char *label); + u32 convertBgmLabelToSoundId(const char *label); + u32 convertCmdLabelToSoundId(const char *label); + + void doBgm(const char *label); + void doSe(const char *label); + void doCmd(const char *label); + + u32 getSeCameraId(); + u32 getSeMsgWaitId(); + u32 getSeFrameCountId(); + + u32 getBgmCameraId(); + u32 getBgmMsgWaitId(); + u32 getBgmFrameCountId(); + + u32 getCmdCameraId(); + u32 getCmdMsgWaitId(); + u32 getCmdFrameCountId(); + + void calcSe(); + bool calcBgm(); + void calcCmd(); + + bool playSe(u32 soundId); + bool playFanOrBgm(u32 soundId); + bool playCmd(u32 soundId); + + void handleFan(); + void handleSe(); + void handleCmd(); + void handleSeLv(); + + /** Called when no event is running anymore */ + void endEvent(bool skipped); + /** Called when an event stops */ + bool finalizeEvent(bool skipped); + + void resetEventVars(); + + // Callbacks start + static void cbUnkNoop(); + + // Callbacks end + + u32 getStageTypeFlags(const char *stageName) const; + // ET, FS, or corresponding Sky Keep rooms + static bool isVolcanicDungeon(u32 stageId); + // Checks if the given stage + layer is the stage you're transported + // to when viewing hint movies. + static bool isSeekerStoneStage(const char *stageName, s32 layer); + bool isSomeSkyloftRoom() const; + + void setCallbacksForStage(); + + u32 getStageId(const char *name, s32 layer); + static u32 getStageUnk2(u32 stageId); + + static SndEventCallback sEventExecuteCallback; + + /* 0x010 */ u32 field_0x010; + /* 0x014 */ UNKWORD field_0x014; + /* 0x018 */ UNKWORD field_0x018; + /* 0x01C */ SizedString<32> mStageName; + /* 0x03C */ s32 field_0x03C; + /* 0x040 */ s32 mStageId; + /* 0x044 */ UNKWORD field_0x044; + /* 0x048 */ u8 _0x048[0x050 - 0x048]; + /* 0x050 */ s32 mPreviousStageId; + /* 0x054 */ u32 mStageTypeFlags; + /* 0x058 */ s32 mLayer; + /* 0x05C */ s32 mRoomId; + /* 0x060 */ s32 mCheckRoomIdCooldown; + /* 0x064 */ bool field_0x064; + /* 0x065 */ bool field_0x065; + /* 0x066 */ bool mHasChangedTgSndAreaFlags; + /* 0x067 */ bool mHasChangedTgSndAreaMgFlags; + /* 0x068 */ u32 mSavedTgSndAreaFlags; + /* 0x06C */ u32 mSavedTgSndAreaMgFlags; + /* 0x070 */ void (*mpUnkCallback)(); + /* 0x074 */ UNKWORD field_0x074; + /* 0x078 */ OnEventStartCallback mpOnEventStartCallback; + /* 0x07C */ UNKWORD field_0x07C; + /* 0x080 */ OnFlagsChangeCallback mpTgSndAreaFlagsChangeCallback; + /* 0x084 */ OnFlagsChangeCallback mpTgSndAreaMgFlagsChangeCallback; + /* 0x088 */ UNKWORD field_0x088; + /* 0x08C */ s32 mSoundEventId; + /* 0x090 */ s32 mCameraCutCounter; + /* 0x094 */ u32 mEventFlags; + /* 0x098 */ SizedString<64> mEventName; + /* 0x0D8 */ SizedString<64> mPrevEventName; + /* 0x118 */ const char *mpStbEventName; + /* 0x11C */ u32 mFrameCounter; + /* 0x120 */ u32 mCameraCutFrameCounter; + /* 0x124 */ u32 mMsgFrameCounter; + /* 0x128 */ u32 mSeLvSoundId; + /* 0x12C */ SizedString<64> mSeName; + /* 0x16C */ SizedString<64> mBgmName; + /* 0x1AC */ SizedString<64> mFanName; + /* 0x1EC */ SizedString<64> mCmdName; + /* 0x22C */ UNKWORD field_0x22C; + /* 0x230 */ nw4r::snd::SoundHandle mSeLvSoundHandle; + /* 0x234 */ const SndEventDef *mpSoundEventDef; + /* 0x238 */ u32 field_0x238; + /* 0x23C */ u8 field_0x23C; + /* 0x23D */ u8 field_0x23D; + /* 0x240 */ UNKWORD field_0x240; + /* 0x244 */ UNKWORD field_0x244; + /* 0x248 */ UNKWORD field_0x248; + /* 0x24C */ s32 mMsgCounter; + /* 0x250 */ s32 mMsgWaitSelectCounter; + /* 0x254 */ u8 field_0x254; + /* 0x258 */ u32 field_0x258; + /* 0x25C */ nw4r::snd::FxReverbStdDpl2 mFx; + /* 0x48C */ UNKWORD field_0x48C; + /* 0x490 */ f32 mFxSend3DDefault; + /* 0x494 */ f32 mFxSend3DOverride; + /* 0x498 */ f32 mFxSend3DNext; + /* 0x49C */ f32 mFxSend3D; + /* 0x4A0 */ f32 mFxSend3DTarget; + /* 0x4A4 */ u32 mPrevStageGroup; + /* 0x4A8 */ u8 field_0x4A8; + /* 0x4A9 */ bool mNeedsGroupsReload; +}; + +#endif diff --git a/include/d/snd/d_snd_types.h b/include/d/snd/d_snd_types.h new file mode 100644 index 00000000..4c835232 --- /dev/null +++ b/include/d/snd/d_snd_types.h @@ -0,0 +1,36 @@ +#ifndef D_SND_TYPES_H +#define D_SND_TYPES_H + +// Forward declarations for d/snd to break circular header dependencies + +class dSndAnimSound_c; +class dSoundSource_c; +class dSndSourceGroup_c; +class dSndDistantSoundActor_c; + + +class dSndSourceEnemy_c; +class dSndSourceHarpRelated_c; +class dSndSourcePlayerHead_c; + +class dSndSound_c; + +class dSndSoundCtxParam; + +class dSndSeSound_c; +class dSndSeSound1_c; +class dSndSeSound2_c; + +class dSndBgmSound_c; +class dSndBgmBattleSound_c; + +class dSndBgmSoundHarpMgr_c; +class dSndBgmSeqConfig; +class dSndBgmBattleConfig; + +class dSndBgmDataHarpVarSetBase_c; + +class dSndHarpSongData_c; +class dSndTagData; + +#endif diff --git a/include/d/snd/d_snd_util.h b/include/d/snd/d_snd_util.h index 5040fa50..b3be21ff 100644 --- a/include/d/snd/d_snd_util.h +++ b/include/d/snd/d_snd_util.h @@ -4,6 +4,35 @@ #include "common.h" #include "egg/core/eggDisposer.h" +#include + +inline bool streq(const char *left, const char *right) { + return !std::strcmp(left, right); +} + +inline bool strneq(const char *left, const char *right, size_t len) { + return !std::strncmp(left, right, len); +} + +// This list setup is convenient, and it allows declaring local variables in +// a consistent order without causing regswaps when multiple loops are involved +// in a single funcion. + +#define LIST_MEMBER(ty, name) \ + nw4r::ut::List m##name##List; \ + inline ty *get##name##First() { \ + return static_cast(nw4r::ut::List_GetFirst(&m##name##List)); \ + } \ + inline ty *get##name##Next(ty *p) { \ + return static_cast(nw4r::ut::List_GetNext(&m##name##List, p)); \ + } \ + inline void append##name(ty *p) { \ + nw4r::ut::List_Append(&m##name##List, p); \ + } \ + inline void remove##name(ty *p) { \ + nw4r::ut::List_Remove(&m##name##List, p); \ + } + // This setup is only inferred. d/snd uses it all over the place. // This works for dSndPlayerMgr_c, which has a vtable of its own but the Disposer at offset 0. // It also works for the factory at 0x80399c20, which calls a base class ctor, diff --git a/include/d/snd/d_snd_wzsound.h b/include/d/snd/d_snd_wzsound.h index 63da34c9..7fc1a8ac 100644 --- a/include/d/snd/d_snd_wzsound.h +++ b/include/d/snd/d_snd_wzsound.h @@ -6468,4 +6468,710 @@ enum WZSound { /* 0x193D */ LABEL_SOUND_END }; +enum WZSound_Group { + /* 0x000 */ GRP_BGM_BOSS_A, + /* 0x001 */ GRP_BGM_STATIC, + /* 0x002 */ GRP_FAN_TIMECHANGE, + /* 0x003 */ GRP_BGM_HARP_GODDESS, + /* 0x004 */ GRP_BGM_HARP_BREEZE, + /* 0x005 */ GRP_BGM_HARP_AQUA, + /* 0x006 */ GRP_BGM_HARP_FLAME, + /* 0x007 */ GRP_BGM_HARP_BRAVE, + /* 0x008 */ GRP_BGM_HARP_PUMPKIN, + /* 0x009 */ GRP_BGM_PLAY_DATA_STATIC, + /* 0x00A */ GRP_SE_SYSTEM_MINIGAME, + /* 0x00B */ GRP_SE_LINK, + /* 0x00C */ GRP_SE_LINK_VOICE, + /* 0x00D */ GRP_SE_HARP, + /* 0x00E */ GRP_SE_NPC_COMMON, + /* 0x00F */ GRP_SE_NpcKen, + /* 0x010 */ GRP_SE_NpcKen_VOCUL, + /* 0x011 */ GRP_SE_A_IN_WATER, + /* 0x012 */ GRP_SE_IN_WATER, + /* 0x013 */ GRP_SE_IN_WATER_MINI, + /* 0x014 */ GRP_SE_STATIC, + /* 0x015 */ GRP_DEFAULT, + /* 0x016 */ GRP_FIELD, + /* 0x017 */ GRP_BOSS, + /* 0x018 */ GRP_DUNGEON, + /* 0x019 */ GRP_DUNGEON_BATTLE_ROOM, + /* 0x01A */ GRP_SIREN, + /* 0x01B */ GRP_SKY, + /* 0x01C */ GRP_INDOOR, + /* 0x01D */ GRP_Demo, + /* 0x01E */ GRP_FOREST, + /* 0x01F */ GRP_MOUNTAIN, + /* 0x020 */ GRP_DESERT, + /* 0x021 */ GRP_STATIC, + /* 0x022 */ GRP_Warp, + /* 0x023 */ GRP_Sw, + /* 0x024 */ GRP_Pumpkin, + /* 0x025 */ GRP_Kanban, + /* 0x026 */ GRP_Item_A43, + /* 0x027 */ GRP_NpcRvl, + /* 0x028 */ GRP_NpcKbn, + /* 0x029 */ GRP_NpcKbn2, + /* 0x02A */ GRP_NpcSkn, + /* 0x02B */ GRP_NpcSkn2, + /* 0x02C */ GRP_NpcZld, + /* 0x02D */ GRP_NpcDsk, + /* 0x02E */ GRP_NpcDrb, + /* 0x02F */ GRP_NpcDrbC, + /* 0x030 */ GRP_NpcSoFa, + /* 0x031 */ GRP_NpcSoMo, + /* 0x032 */ GRP_NpcSoG, + /* 0x033 */ GRP_NpcTer, + /* 0x034 */ GRP_NpcResc, + /* 0x035 */ GRP_NpcResc_A1, + /* 0x036 */ GRP_NpcResc_A2, + /* 0x037 */ GRP_TstShtr, + /* 0x038 */ GRP_Kibako, + /* 0x039 */ GRP_PyBird, + /* 0x03A */ GRP_BirdCommon, + /* 0x03B */ GRP_BirdR, + /* 0x03C */ GRP_BirdZT, + /* 0x03D */ GRP_BirdB, + /* 0x03E */ GRP_Nusi, + /* 0x03F */ GRP_NusiT, + /* 0x040 */ GRP_BMg, + /* 0x041 */ GRP_BKr, + /* 0x042 */ GRP_BKrA, + /* 0x043 */ GRP_BLasBos, + /* 0x044 */ GRP_Bvd, + /* 0x045 */ GRP_Vdb, + /* 0x046 */ GRP_ECptn, + /* 0x047 */ GRP_EAm, + /* 0x048 */ GRP_Swhit, + /* 0x049 */ GRP_ESf, + /* 0x04A */ GRP_ESf4, + /* 0x04B */ GRP_Est, + /* 0x04C */ GRP_ERemly, + /* 0x04D */ GRP_ELizaru, + /* 0x04E */ GRP_EHidoK, + /* 0x04F */ GRP_EHydra, + /* 0x050 */ GRP_EGunho, + /* 0x051 */ GRP_EGunhob, + /* 0x052 */ GRP_EBfish, + /* 0x053 */ GRP_ECactus, + /* 0x054 */ GRP_ESm, + /* 0x055 */ GRP_EBeamos, + /* 0x056 */ GRP_EGeko, + /* 0x057 */ GRP_EPo, + /* 0x058 */ GRP_EPh, + /* 0x059 */ GRP_EOr, + /* 0x05A */ GRP_EEye, + /* 0x05B */ GRP_ESpark, + /* 0x05C */ GRP_EMagma, + /* 0x05D */ GRP_EMagupp, + /* 0x05E */ GRP_EKs, + /* 0x05F */ GRP_Ehb, + /* 0x060 */ GRP_EWs, + /* 0x061 */ GRP_BGh, + /* 0x062 */ GRP_BGh3, + /* 0x063 */ GRP_OGhSwL, + /* 0x064 */ GRP_OGhKf, + /* 0x065 */ GRP_BAsura, + /* 0x066 */ GRP_AsuraB, + /* 0x067 */ GRP_AsuraS, + /* 0x068 */ GRP_AsuraP, + /* 0x069 */ GRP_EMr, + /* 0x06A */ GRP_EMr_A1, + /* 0x06B */ GRP_EGumarm, + /* 0x06C */ GRP_NpcBird, + /* 0x06D */ GRP_Himo, + /* 0x06E */ GRP_SpiderL, + /* 0x06F */ GRP_Wind, + /* 0x070 */ GRP_Wind02, + /* 0x071 */ GRP_Wind03, + /* 0x072 */ GRP_Wind04, + /* 0x073 */ GRP_Tornado, + /* 0x074 */ GRP_SkEnmyT, + /* 0x075 */ GRP_EBc, + /* 0x076 */ GRP_EKGira, + /* 0x077 */ GRP_BcArrow, + /* 0x078 */ GRP_EBcZ, + /* 0x079 */ GRP_ESktl, + /* 0x07A */ GRP_Bamboo, + /* 0x07B */ GRP_TgTrap, + /* 0x07C */ GRP_NpcSalS, + /* 0x07D */ GRP_NpcSalS_A1, + /* 0x07E */ GRP_NpcSalS_A2, + /* 0x07F */ GRP_NpcSalS_A4, + /* 0x080 */ GRP_NpcSalS_A5, + /* 0x081 */ GRP_NpcSalS_A8, + /* 0x082 */ GRP_NpcDoMo, + /* 0x083 */ GRP_NpcJkMo, + /* 0x084 */ GRP_NpcSAMo, + /* 0x085 */ GRP_NpcSMnE, + /* 0x086 */ GRP_NpcSMnD, + /* 0x087 */ GRP_NpcAzFa, + /* 0x088 */ GRP_NpcDskN, + /* 0x089 */ GRP_EChb, + /* 0x08A */ GRP_EGue, + /* 0x08B */ GRP_EGerock, + /* 0x08C */ GRP_PushBlk, + /* 0x08D */ GRP_CyStone, + /* 0x08E */ GRP_HnComb, + /* 0x08F */ GRP_Bee, + /* 0x090 */ GRP_Bubble, + /* 0x091 */ GRP_EChaser, + /* 0x092 */ GRP_EHidory, + /* 0x093 */ GRP_NpcOim, + /* 0x094 */ GRP_NpcYim, + /* 0x095 */ GRP_NpcBgr, + /* 0x096 */ GRP_NpcSlrb, + /* 0x097 */ GRP_NpcSma3, + /* 0x098 */ GRP_NpcSma2, + /* 0x099 */ GRP_NpcPma, + /* 0x09A */ GRP_NpcPdu, + /* 0x09B */ GRP_NpcCbFd, + /* 0x09C */ GRP_NpcFdr, + /* 0x09D */ GRP_NpcTdr, + /* 0x09E */ GRP_NpcAdr, + /* 0x09F */ GRP_NpcGhm, + /* 0x0A0 */ GRP_NpcSha, + /* 0x0A1 */ GRP_NpcGra, + /* 0x0A2 */ GRP_NpcSoBo, + /* 0x0A3 */ GRP_NpcAkum, + /* 0x0A4 */ GRP_NpcSui, + /* 0x0A5 */ GRP_NpcMole, + /* 0x0A6 */ GRP_NpcMole_A1, + /* 0x0A7 */ GRP_NpcMole_A2, + /* 0x0A8 */ GRP_NpcMoN, + /* 0x0A9 */ GRP_NpcMoT, + /* 0x0AA */ GRP_NpcMoEl, + /* 0x0AB */ GRP_NpcChef, + /* 0x0AC */ GRP_Door, + /* 0x0AD */ GRP_Door_A4, + /* 0x0AE */ GRP_SwWall, + /* 0x0AF */ GRP_LeafSwg, + /* 0x0B0 */ GRP_IvyRope, + /* 0x0B1 */ GRP_RopeIga, + /* 0x0B2 */ GRP_RolRock, + /* 0x0B3 */ GRP_RidRock, + /* 0x0B4 */ GRP_MvLiftV, + /* 0x0B5 */ GRP_Truck, + /* 0x0B6 */ GRP_TrapRc1, + /* 0x0B7 */ GRP_StprRc, + /* 0x0B8 */ GRP_Log, + /* 0x0B9 */ GRP_LogWtr, + /* 0x0BA */ GRP_LightLi, + /* 0x0BB */ GRP_TimeStn, + /* 0x0BC */ GRP_BlsRock, + /* 0x0BD */ GRP_BlsRock_A18, + /* 0x0BE */ GRP_BlsRock_A5, + /* 0x0BF */ GRP_BlsRock_A6, + /* 0x0C0 */ GRP_BlsRock_A10, + /* 0x0C1 */ GRP_BlsRock_A8, + /* 0x0C2 */ GRP_FenceIr, + /* 0x0C3 */ GRP_SwDir, + /* 0x0C4 */ GRP_SwDir2, + /* 0x0C5 */ GRP_SwBnk, + /* 0x0C6 */ GRP_SwBnkS, + /* 0x0C7 */ GRP_Fairy, + /* 0x0C8 */ GRP_SnkFlrF, + /* 0x0C9 */ GRP_StpGm, + /* 0x0CA */ GRP_BrgFall, + /* 0x0CB */ GRP_BrgStp, + /* 0x0CC */ GRP_Gear, + /* 0x0CD */ GRP_DNight, + /* 0x0CE */ GRP_Fire, + /* 0x0CF */ GRP_Tshop, + /* 0x0D0 */ GRP_Obstacl, + /* 0x0D1 */ GRP_BeltCvr, + /* 0x0D2 */ GRP_Gcoil, + /* 0x0D3 */ GRP_Lotus, + /* 0x0D4 */ GRP_OcGrs, + /* 0x0D5 */ GRP_StepTS, + /* 0x0D6 */ GRP_WarpObj, + /* 0x0D7 */ GRP_WarpObj_A5, + /* 0x0D8 */ GRP_WarpObj_A4, + /* 0x0D9 */ GRP_WarpObj_A2, + /* 0x0DA */ GRP_WarpObj_A6, + /* 0x0DB */ GRP_WarpObj_A7, + /* 0x0DC */ GRP_Barrel, + /* 0x0DD */ GRP_Boat, + /* 0x0DE */ GRP_Blst, + /* 0x0DF */ GRP_BlstF3, + /* 0x0E0 */ GRP_TrpBrdW, + /* 0x0E1 */ GRP_Tckl, + /* 0x0E2 */ GRP_LvPlt, + /* 0x0E3 */ GRP_TWeed, + /* 0x0E4 */ GRP_TBoat, + /* 0x0E5 */ GRP_TBoatB, + /* 0x0E6 */ GRP_Vortex, + /* 0x0E7 */ GRP_TowerB, + /* 0x0E8 */ GRP_D300Obj, + /* 0x0E9 */ GRP_BrgBn, + /* 0x0EA */ GRP_SwSB, + /* 0x0EB */ GRP_SndStn, + /* 0x0EC */ GRP_SwHrp, + /* 0x0ED */ GRP_SwHrp_A1, + /* 0x0EE */ GRP_SwHrp_A2, + /* 0x0EF */ GRP_SwHrp_A4, + /* 0x0F0 */ GRP_Tubo, + /* 0x0F1 */ GRP_BigTubo, + /* 0x0F2 */ GRP_DoorBs, + /* 0x0F3 */ GRP_TBox, + /* 0x0F4 */ GRP_EffGnT_A2, + /* 0x0F5 */ GRP_PoleStn, + /* 0x0F6 */ GRP_EKg, + /* 0x0F7 */ GRP_BBigBos, + /* 0x0F8 */ GRP_NpcBRvl, + /* 0x0F9 */ GRP_OBBLBom, + /* 0x0FA */ GRP_NpcSoma, + /* 0x0FB */ GRP_NpcSowo, + /* 0x0FC */ GRP_vmSand, + /* 0x0FD */ GRP_wnleaf, + /* 0x0FE */ GRP_tware, + /* 0x0FF */ GRP_swsht, + /* 0x100 */ GRP_rpillar, + /* 0x101 */ GRP_wfall, + /* 0x102 */ GRP_ftower, + /* 0x103 */ GRP_NpcKen, + /* 0x104 */ GRP_sw_whip, + /* 0x105 */ GRP_ShtCS, + /* 0x106 */ GRP_fruit, + /* 0x107 */ GRP_Kinoko, + /* 0x108 */ GRP_chest, + /* 0x109 */ GRP_LBird, + /* 0x10A */ GRP_Fish, + /* 0x10B */ GRP_Eel, + /* 0x10C */ GRP_TerrGmk, + /* 0x10D */ GRP_TgSound_A1, + /* 0x10E */ GRP_TgSound_A2, + /* 0x10F */ GRP_TgSound_A3, + /* 0x110 */ GRP_TgSound_A4, + /* 0x111 */ GRP_TgSound_A5, + /* 0x112 */ GRP_TgSound_A6, + /* 0x113 */ GRP_TgSound_A7, + /* 0x114 */ GRP_TgSound_A8, + /* 0x115 */ GRP_TgSound_A9, + /* 0x116 */ GRP_TgSound_A10, + /* 0x117 */ GRP_TgSound_A11, + /* 0x118 */ GRP_TgSound_A12, + /* 0x119 */ GRP_TgSound_A13, + /* 0x11A */ GRP_TgSound_A14, + /* 0x11B */ GRP_TgSound_A15, + /* 0x11C */ GRP_TgSound_A16, + /* 0x11D */ GRP_TgSound_A17, + /* 0x11E */ GRP_TgSound_A18, + /* 0x11F */ GRP_TgSound_A19, + /* 0x120 */ GRP_TgSound_A20, + /* 0x121 */ GRP_TgSound_A21, + /* 0x122 */ GRP_TgSound_A22, + /* 0x123 */ GRP_TgSound_A23, + /* 0x124 */ GRP_TgSound_A24, + /* 0x125 */ GRP_TgSound_A25, + /* 0x126 */ GRP_TgSound_A26, + /* 0x127 */ GRP_TgSound_A27, + /* 0x128 */ GRP_TgSound_A28, + /* 0x129 */ GRP_TgSound_A29, + /* 0x12A */ GRP_TgSound_A30, + /* 0x12B */ GRP_TgSound_A31, + /* 0x12C */ GRP_TgSound_A32, + /* 0x12D */ GRP_TgSound_A33, + /* 0x12E */ GRP_TgSound_A34, + /* 0x12F */ GRP_TgSound_A35, + /* 0x130 */ GRP_TgSound_A36, + /* 0x131 */ GRP_TgSound_A37, + /* 0x132 */ GRP_TgSound_A38, + /* 0x133 */ GRP_TgSound_A39, + /* 0x134 */ GRP_TgSound_A40, + /* 0x135 */ GRP_ArrowSW, + /* 0x136 */ GRP_VentFan, + /* 0x137 */ GRP_WdBoard, + /* 0x138 */ GRP_ElLight, + /* 0x139 */ GRP_WaterSW, + /* 0x13A */ GRP_WaterSW_A1, + /* 0x13B */ GRP_BulbSW, + /* 0x13C */ GRP_SideST, + /* 0x13D */ GRP_STKraPt, + /* 0x13E */ GRP_HitLVSW, + /* 0x13F */ GRP_UDLava, + /* 0x140 */ GRP_BridgeB, + /* 0x141 */ GRP_Cannon, + /* 0x142 */ GRP_BridgeS, + /* 0x143 */ GRP_BlwCoal, + /* 0x144 */ GRP_UtaStop, + /* 0x145 */ GRP_Windmil, + /* 0x146 */ GRP_Pinwhel, + /* 0x147 */ GRP_WatrIga, + /* 0x148 */ GRP_STSink, + /* 0x149 */ GRP_ShipWin, + /* 0x14A */ GRP_FireObs, + /* 0x14B */ GRP_FireObs_A1, + /* 0x14C */ GRP_SldDoor, + /* 0x14D */ GRP_SliceLg, + /* 0x14E */ GRP_Debris, + /* 0x14F */ GRP_DwnLava, + /* 0x150 */ GRP_ApBridg, + /* 0x151 */ GRP_GrCover, + /* 0x152 */ GRP_TrukStp, + /* 0x153 */ GRP_WFF102, + /* 0x154 */ GRP_RockSkB, + /* 0x155 */ GRP_Bell, + /* 0x156 */ GRP_WndMilD, + /* 0x157 */ GRP_RkDrgn, + /* 0x158 */ GRP_Insect, + /* 0x159 */ GRP_Uground, + /* 0x15A */ GRP_BlockUg, + /* 0x15B */ GRP_MagBoat, + /* 0x15C */ GRP_skull, + /* 0x15D */ GRP_ESyako, + /* 0x15E */ GRP_LtsFlwr, + /* 0x15F */ GRP_LtsSeed, + /* 0x160 */ GRP_Npckyu, + /* 0x161 */ GRP_NpcKyuE, + /* 0x162 */ GRP_lock, + /* 0x163 */ GRP_trolley, + /* 0x164 */ GRP_trolley_A2, + /* 0x165 */ GRP_trlshut, + /* 0x166 */ GRP_swsyako, + /* 0x167 */ GRP_syashtr, + /* 0x168 */ GRP_d2ship, + /* 0x169 */ GRP_Chandel, + /* 0x16A */ GRP_needleU, + /* 0x16B */ GRP_SStatue, + /* 0x16C */ GRP_NpcKyuW, + /* 0x16D */ GRP_BDrD101, + /* 0x16E */ GRP_NpcCbLd, + /* 0x16F */ GRP_TGrD101, + /* 0x170 */ GRP_ShtrWtr, + /* 0x171 */ GRP_NpcKnld, + /* 0x172 */ GRP_TowerHa, + /* 0x173 */ GRP_NpcDgJg, + /* 0x174 */ GRP_NpcMlMg, + /* 0x175 */ GRP_BoxCage, + /* 0x176 */ GRP_FWall, + /* 0x177 */ GRP_SwrdPrj, + /* 0x178 */ GRP_SdCdl, + /* 0x179 */ GRP_NpcSenp, + /* 0x17A */ GRP_NpcSenb, + /* 0x17B */ GRP_Piston, + /* 0x17C */ GRP_GodCube, + /* 0x17D */ GRP_HeartCo, + /* 0x17E */ GRP_Clef, + /* 0x17F */ GRP_TDoor, + /* 0x180 */ GRP_Fence, + /* 0x181 */ GRP_Flag, + /* 0x182 */ GRP_DoorDun, + /* 0x183 */ GRP_DoorDun_A1, + /* 0x184 */ GRP_DoorDun_A2, + /* 0x185 */ GRP_TSBlk, + /* 0x186 */ GRP_Propera, + /* 0x187 */ GRP_Roulete, + /* 0x188 */ GRP_LvD201, + /* 0x189 */ GRP_Grave, + /* 0x18A */ GRP_FruitB, + /* 0x18B */ GRP_RoAtTar, + /* 0x18C */ GRP_PrpLift, + /* 0x18D */ GRP_TAgo, + /* 0x18E */ GRP_DivCrst, + /* 0x18F */ GRP_DNdl, + /* 0x190 */ GRP_CtrlPnl, + /* 0x191 */ GRP_NpcGost, + /* 0x192 */ GRP_D2Mtr, + /* 0x193 */ GRP_HrpHint, + /* 0x194 */ GRP_Paint, + /* 0x195 */ GRP_BrgTs, + /* 0x196 */ GRP_WarpH, + /* 0x197 */ GRP_UgSwitc, + /* 0x198 */ GRP_F000, + /* 0x199 */ GRP_F000_L1, + /* 0x19A */ GRP_F000_L2, + /* 0x19B */ GRP_F000_L3, + /* 0x19C */ GRP_F000_L4, + /* 0x19D */ GRP_F000_L5, + /* 0x19E */ GRP_F000_L6, + /* 0x19F */ GRP_F000_L7, + /* 0x1A0 */ GRP_F000_L8, + /* 0x1A1 */ GRP_F000_L9, + /* 0x1A2 */ GRP_F000_L10, + /* 0x1A3 */ GRP_F000_L12, + /* 0x1A4 */ GRP_F000_L13, + /* 0x1A5 */ GRP_F000_L14, + /* 0x1A6 */ GRP_F000_L15, + /* 0x1A7 */ GRP_F000_L16, + /* 0x1A8 */ GRP_F000_L17, + /* 0x1A9 */ GRP_F000_L18, + /* 0x1AA */ GRP_F000_L19, + /* 0x1AB */ GRP_F000_L20, + /* 0x1AC */ GRP_F000_L21, + /* 0x1AD */ GRP_F000_L26, + /* 0x1AE */ GRP_F000_L27, + /* 0x1AF */ GRP_F000_L28, + /* 0x1B0 */ GRP_F001r, + /* 0x1B1 */ GRP_F001r_L2, + /* 0x1B2 */ GRP_F001r_L3, + /* 0x1B3 */ GRP_F001r_L13, + /* 0x1B4 */ GRP_F001r_L14, + /* 0x1B5 */ GRP_F001r_L15, + /* 0x1B6 */ GRP_F002r, + /* 0x1B7 */ GRP_F004r, + /* 0x1B8 */ GRP_F005r, + /* 0x1B9 */ GRP_F006r, + /* 0x1BA */ GRP_F007r, + /* 0x1BB */ GRP_F008r, + /* 0x1BC */ GRP_F008r_L1, + /* 0x1BD */ GRP_F008r_L2, + /* 0x1BE */ GRP_F008r_L13, + /* 0x1BF */ GRP_F008r_L14, + /* 0x1C0 */ GRP_F008r_L15, + /* 0x1C1 */ GRP_F009r, + /* 0x1C2 */ GRP_F010r, + /* 0x1C3 */ GRP_F010r_L13, + /* 0x1C4 */ GRP_F010r_L14, + /* 0x1C5 */ GRP_F010r_L15, + /* 0x1C6 */ GRP_F011r, + /* 0x1C7 */ GRP_F011r_L12, + /* 0x1C8 */ GRP_F012r, + /* 0x1C9 */ GRP_F013r, + /* 0x1CA */ GRP_F014r, + /* 0x1CB */ GRP_F015r, + /* 0x1CC */ GRP_F016r, + /* 0x1CD */ GRP_F017r, + /* 0x1CE */ GRP_F018r, + /* 0x1CF */ GRP_F019r, + /* 0x1D0 */ GRP_F019r_L2, + /* 0x1D1 */ GRP_F020, + /* 0x1D2 */ GRP_F020_L1, + /* 0x1D3 */ GRP_F020_L2, + /* 0x1D4 */ GRP_F020_L3, + /* 0x1D5 */ GRP_F020_L4, + /* 0x1D6 */ GRP_F020_L5, + /* 0x1D7 */ GRP_F020_L6, + /* 0x1D8 */ GRP_F021_L13, + /* 0x1D9 */ GRP_D000, + /* 0x1DA */ GRP_D003_1, + /* 0x1DB */ GRP_D003_2, + /* 0x1DC */ GRP_D003_3, + /* 0x1DD */ GRP_S000, + /* 0x1DE */ GRP_D003_4, + /* 0x1DF */ GRP_D003_5, + /* 0x1E0 */ GRP_F023, + /* 0x1E1 */ GRP_F023_L2, + /* 0x1E2 */ GRP_F023_L13, + /* 0x1E3 */ GRP_F023_L14, + /* 0x1E4 */ GRP_D003_6, + /* 0x1E5 */ GRP_D003_7, + /* 0x1E6 */ GRP_D003_0, + /* 0x1E7 */ GRP_D003_8, + /* 0x1E8 */ GRP_F100, + /* 0x1E9 */ GRP_F100_L1, + /* 0x1EA */ GRP_F100_L2, + /* 0x1EB */ GRP_F100_L3, + /* 0x1EC */ GRP_F100_L4, + /* 0x1ED */ GRP_F100_1, + /* 0x1EE */ GRP_F101, + /* 0x1EF */ GRP_F102, + /* 0x1F0 */ GRP_F102_1, + /* 0x1F1 */ GRP_F102_2, + /* 0x1F2 */ GRP_F103, + /* 0x1F3 */ GRP_F103_L13, + /* 0x1F4 */ GRP_D100, + /* 0x1F5 */ GRP_D100_L1, + /* 0x1F6 */ GRP_D101, + /* 0x1F7 */ GRP_B100, + /* 0x1F8 */ GRP_B100_L1, + /* 0x1F9 */ GRP_B100_L2, + /* 0x1FA */ GRP_B100_L5, + /* 0x1FB */ GRP_B100_L13, + /* 0x1FC */ GRP_B100_1, + /* 0x1FD */ GRP_B100_1_L13, + /* 0x1FE */ GRP_B101, + /* 0x1FF */ GRP_B101_L2, + /* 0x200 */ GRP_B101_1, + /* 0x201 */ GRP_B101_1_L13, + /* 0x202 */ GRP_S100, + /* 0x203 */ GRP_F103_1, + /* 0x204 */ GRP_F103_1_L13, + /* 0x205 */ GRP_F103_1_L14, + /* 0x206 */ GRP_F200, + /* 0x207 */ GRP_F200_L1, + /* 0x208 */ GRP_F200_L2, + /* 0x209 */ GRP_F200_L3, + /* 0x20A */ GRP_F200_L4, + /* 0x20B */ GRP_F210, + /* 0x20C */ GRP_F211, + /* 0x20D */ GRP_F211_L2, + /* 0x20E */ GRP_F211_L3, + /* 0x20F */ GRP_F211_L4, + /* 0x210 */ GRP_F221, + /* 0x211 */ GRP_F221_L13, + /* 0x212 */ GRP_F202, + /* 0x213 */ GRP_D200, + /* 0x214 */ GRP_D201, + /* 0x215 */ GRP_B200, + /* 0x216 */ GRP_B200_L1, + /* 0x217 */ GRP_B200_L2, + /* 0x218 */ GRP_B200_L3, + /* 0x219 */ GRP_B201_L1, + /* 0x21A */ GRP_B201_L2, + /* 0x21B */ GRP_B201_L3, + /* 0x21C */ GRP_B201_L13, + /* 0x21D */ GRP_B201_1, + /* 0x21E */ GRP_B201_1_L13, + /* 0x21F */ GRP_B210, + /* 0x220 */ GRP_B210_L13, + /* 0x221 */ GRP_B210_L14, + /* 0x222 */ GRP_S200, + /* 0x223 */ GRP_F201_1, + /* 0x224 */ GRP_F201_2, + /* 0x225 */ GRP_F202_1, + /* 0x226 */ GRP_F202_2, + /* 0x227 */ GRP_D201_1, + /* 0x228 */ GRP_F201_3, + /* 0x229 */ GRP_F201_4, + /* 0x22A */ GRP_F202_3, + /* 0x22B */ GRP_F202_4, + /* 0x22C */ GRP_F300, + /* 0x22D */ GRP_F300_L2, + /* 0x22E */ GRP_F300_1, + /* 0x22F */ GRP_F300_2, + /* 0x230 */ GRP_F300_3, + /* 0x231 */ GRP_F300_4, + /* 0x232 */ GRP_F300_4_L13, + /* 0x233 */ GRP_F301, + /* 0x234 */ GRP_F301_1, + /* 0x235 */ GRP_F301_2, + /* 0x236 */ GRP_F301_3, + /* 0x237 */ GRP_F301_4, + /* 0x238 */ GRP_F301_4_L2, + /* 0x239 */ GRP_F301_5, + /* 0x23A */ GRP_F302, + /* 0x23B */ GRP_F302_L1, + /* 0x23C */ GRP_F302_L2, + /* 0x23D */ GRP_F302_L13, + /* 0x23E */ GRP_D300, + /* 0x23F */ GRP_D301, + /* 0x240 */ GRP_D301_L1, + /* 0x241 */ GRP_D301_L2, + /* 0x242 */ GRP_D301_L3, + /* 0x243 */ GRP_D301_L4, + /* 0x244 */ GRP_D301_L9, + /* 0x245 */ GRP_D301_L10, + /* 0x246 */ GRP_D301_L11, + /* 0x247 */ GRP_D301_L12, + /* 0x248 */ GRP_D301_1, + /* 0x249 */ GRP_B300, + /* 0x24A */ GRP_B300_L2, + /* 0x24B */ GRP_B301, + /* 0x24C */ GRP_B301_L2, + /* 0x24D */ GRP_B301_L13, + /* 0x24E */ GRP_S300, + /* 0x24F */ GRP_F301_6, + /* 0x250 */ GRP_F301_7, + /* 0x251 */ GRP_F303, + /* 0x252 */ GRP_F300_5, + /* 0x253 */ GRP_D300_1, + /* 0x254 */ GRP_F400, + /* 0x255 */ GRP_F400_L1, + /* 0x256 */ GRP_F400_L2, + /* 0x257 */ GRP_F400_L3, + /* 0x258 */ GRP_F400_L13, + /* 0x259 */ GRP_F401, + /* 0x25A */ GRP_F401_L1, + /* 0x25B */ GRP_F401_L2, + /* 0x25C */ GRP_F401_L3, + /* 0x25D */ GRP_F401_L4, + /* 0x25E */ GRP_F401_L5, + /* 0x25F */ GRP_F401_L6, + /* 0x260 */ GRP_F401_L13, + /* 0x261 */ GRP_F401_L14, + /* 0x262 */ GRP_F401_L15, + /* 0x263 */ GRP_F402, + /* 0x264 */ GRP_F402_L13, + /* 0x265 */ GRP_F402_L18, + /* 0x266 */ GRP_F402_L19, + /* 0x267 */ GRP_F402_L20, + /* 0x268 */ GRP_F403, + /* 0x269 */ GRP_F403_L1, + /* 0x26A */ GRP_F403_L2, + /* 0x26B */ GRP_F403_L3, + /* 0x26C */ GRP_F403_L4, + /* 0x26D */ GRP_F403_L7, + /* 0x26E */ GRP_F403_L13, + /* 0x26F */ GRP_F403_L14, + /* 0x270 */ GRP_F403_L15, + /* 0x271 */ GRP_F403_L16, + /* 0x272 */ GRP_F404, + /* 0x273 */ GRP_F404_L13, + /* 0x274 */ GRP_F404_L14, + /* 0x275 */ GRP_F405, + /* 0x276 */ GRP_F406, + /* 0x277 */ GRP_F406_L14, + /* 0x278 */ GRP_B400, + /* 0x279 */ GRP_B400_L13, + /* 0x27A */ GRP_B400_L14, + /* 0x27B */ GRP_F407_L13, + /* 0x27C */ GRP_F407_L14, + /* 0x27D */ GRP_F407_L15, + /* 0x27E */ GRP_A_IN_WATER, + /* 0x27F */ GRP_A_QUAKE, + /* 0x280 */ GRP_A_F000, + /* 0x281 */ GRP_A_F000_L2, + /* 0x282 */ GRP_A_F000_L5, + /* 0x283 */ GRP_A_F000_L7, + /* 0x284 */ GRP_A_F000_L9, + /* 0x285 */ GRP_A_F001r, + /* 0x286 */ GRP_A_F002r, + /* 0x287 */ GRP_A_F008r, + /* 0x288 */ GRP_A_F010r, + /* 0x289 */ GRP_A_F012r, + /* 0x28A */ GRP_A_F019r, + /* 0x28B */ GRP_A_F020, + /* 0x28C */ GRP_A_F023, + /* 0x28D */ GRP_A_F023_L2, + /* 0x28E */ GRP_A_D000, + /* 0x28F */ GRP_A_D003_0, + /* 0x290 */ GRP_A_D003_1, + /* 0x291 */ GRP_A_D003_2, + /* 0x292 */ GRP_A_D003_3, + /* 0x293 */ GRP_A_D003_4, + /* 0x294 */ GRP_A_D003_5, + /* 0x295 */ GRP_A_D003_6, + /* 0x296 */ GRP_A_D003_7, + /* 0x297 */ GRP_A_F100, + /* 0x298 */ GRP_A_F100_1, + /* 0x299 */ GRP_A_F102, + /* 0x29A */ GRP_A_F103, + /* 0x29B */ GRP_A_D100, + /* 0x29C */ GRP_A_D101, + /* 0x29D */ GRP_A_B100, + /* 0x29E */ GRP_A_B100_1, + /* 0x29F */ GRP_A_B101, + /* 0x2A0 */ GRP_A_B101_1, + /* 0x2A1 */ GRP_A_F200, + /* 0x2A2 */ GRP_A_F210, + /* 0x2A3 */ GRP_A_F211, + /* 0x2A4 */ GRP_A_F201_1, + /* 0x2A5 */ GRP_A_F201_2, + /* 0x2A6 */ GRP_A_F201_3, + /* 0x2A7 */ GRP_A_F201_4, + /* 0x2A8 */ GRP_A_F221, + /* 0x2A9 */ GRP_A_F202, + /* 0x2AA */ GRP_A_D200, + /* 0x2AB */ GRP_A_D201, + /* 0x2AC */ GRP_A_B210, + /* 0x2AD */ GRP_A_B201, + /* 0x2AE */ GRP_A_B201_1, + /* 0x2AF */ GRP_A_F300, + /* 0x2B0 */ GRP_A_F301, + /* 0x2B1 */ GRP_A_F301_1, + /* 0x2B2 */ GRP_A_F302, + /* 0x2B3 */ GRP_A_F303, + /* 0x2B4 */ GRP_A_D300, + /* 0x2B5 */ GRP_A_D301, + /* 0x2B6 */ GRP_A_B300, + /* 0x2B7 */ GRP_A_B301, + /* 0x2B8 */ GRP_A_F400, + /* 0x2B9 */ GRP_A_F401, + /* 0x2BA */ GRP_A_F402, + /* 0x2BB */ GRP_A_F403, + /* 0x2BC */ GRP_A_F404, + /* 0x2BD */ GRP_A_F406, + /* 0x2BE */ GRP_A_B400, +}; + #endif diff --git a/include/d/t/d_t_sound_area_mgr.h b/include/d/t/d_t_sound_area_mgr.h index d7b64106..ae191056 100644 --- a/include/d/t/d_t_sound_area_mgr.h +++ b/include/d/t/d_t_sound_area_mgr.h @@ -16,8 +16,12 @@ public: virtual int doDelete() override; virtual int create() override; - void setBgmFlag(int flag) { - mBgmFlags |= 1 << flag; + void setSndFlag(int flag) { + mSndFlags |= 1 << flag; + } + + u32 getSndFlags() const { + return mSndFlags; } static dTgSndMg_c *GetInstance() { @@ -26,7 +30,8 @@ public: private: static dTgSndMg_c *sInstance; - u32 mBgmFlags; + + /* 0xFC */ u32 mSndFlags; }; #endif diff --git a/include/egg/audio/eggAudioMgr.h b/include/egg/audio/eggAudioMgr.h index 5b7fea91..e2a064b2 100644 --- a/include/egg/audio/eggAudioMgr.h +++ b/include/egg/audio/eggAudioMgr.h @@ -14,7 +14,7 @@ public: virtual StartResult detail_SetupSound(nw4r::snd::SoundHandle *pHandle, u32 id, bool hold, const StartInfo *pStartInfo) override { if (AudioSystem::sInstanse != nullptr && - (AudioSystem::sInstanse->field0x08NotZero() || AudioSystem::sInstanse->field0x04NotZero())) { + (AudioSystem::sInstanse->isShuttingDown() || AudioSystem::sInstanse->isResetting())) { return START_ERR_USER; } return nw4r::snd::SoundArchivePlayer::detail_SetupSound(pHandle, id, hold, pStartInfo); @@ -26,7 +26,7 @@ public: struct Arg { Arg(); /* 0x00 */ EGG::Heap *heap; - /* 0x04 */ char *soundFileName; + /* 0x04 */ const char *soundFileName; /* 0x08 */ int sndThreadPriority; /* 0x0C */ int dvdThreadPriority; /* 0x10 */ int sndThreadStackSize; @@ -40,7 +40,7 @@ public: field_0x04 = false; } - virtual UNKTYPE initialize(Arg *) {} + virtual void initialize(Arg *) {} virtual UNKTYPE calc() = 0; bool field_0x04; @@ -55,7 +55,7 @@ public: SimpleAudioMgr(); virtual ~SimpleAudioMgr(); - void initialize(EGG::IAudioMgr::Arg *) override; + virtual void initialize(EGG::IAudioMgr::Arg *) override; virtual void calc() override; virtual UNKTYPE *openDvdArchive(const char *, nw4r::snd::SoundHeap *) override; // at 0x10 diff --git a/include/egg/audio/eggAudioSystem.h b/include/egg/audio/eggAudioSystem.h index 69791333..8ab47824 100644 --- a/include/egg/audio/eggAudioSystem.h +++ b/include/egg/audio/eggAudioSystem.h @@ -10,29 +10,37 @@ public: AudioSystem(); ~AudioSystem(); - void fn_804B7270(s32 frame); - void fn_804B7370(); - void fn_804B73D0(s32 frame); + // TODO - this seems to use milliseconds as the unit, but + // calling code seems to pass frame counts... + void reset(s32 ms); + void recoverReset(); + // TODO - see reset + void shutdown(s32 ms); void calc(); - bool isField0x04Eq2() { - return field_0x04 == 2; + // Non-official inline names + bool isReset() { + return mResetStatus == 2; } - bool field0x08NotZero() { - return field_0x08 != 0; + bool isShutdown() { + return mShutdownStatus == 2; } - bool field0x04NotZero() { - return field_0x04 != 0; + bool isShuttingDown() { + return mShutdownStatus != 0; + } + + bool isResetting() { + return mResetStatus != 0; } static AudioSystem *sInstanse; ///< sic private: - f32 field_0x00; - s32 field_0x04; - s32 field_0x08; + /* 0x00 */ f32 mSavedMasterVolume; + /* 0x04 */ s32 mResetStatus; + /* 0x08 */ s32 mShutdownStatus; }; } // namespace EGG diff --git a/include/m/m_vec.h b/include/m/m_vec.h index 401c04c3..7f5fa836 100644 --- a/include/m/m_vec.h +++ b/include/m/m_vec.h @@ -70,16 +70,12 @@ public: /// @brief Constructs a new vector from an existing vector from the nw4r::math library. mVec3_c(const nw4r::math::VEC3 &v) { - x = v.x; - y = v.y; - z = v.z; + set(v.x, v.y, v.z); } /// @brief Constructs a new vector from an existing vector from the EGG library. mVec3_c(const EGG::Vector3f &v) { - x = v.x; - y = v.y; - z = v.z; + set(v.x, v.y, v.z); } /// @brief Float cast operator. diff --git a/include/nw4r/snd/snd_AnimSound.h b/include/nw4r/snd/snd_AnimSound.h index 37d66c2f..e8c6627b 100644 --- a/include/nw4r/snd/snd_AnimSound.h +++ b/include/nw4r/snd/snd_AnimSound.h @@ -91,7 +91,7 @@ public: bool Setup(const void *data); void Shutdown(); - void ResetFrame(f32, int); + void ResetFrame(f32, int cycle); void UpdateFrame(f32 frame, PlayDirection dir); void UpdateForward(f32 frame); void UpdateBackward(f32 frame); @@ -103,27 +103,78 @@ public: void StartEvent(const AnimEvent *, bool); void HoldEvent(const AnimEvent *, bool); void StopEvent(const AnimEvent *); - bool IsPlayableLoopCount(const nw4r::snd::detail::AnimEventFrameInfo&); + bool IsPlayableLoopCount(const nw4r::snd::detail::AnimEventFrameInfo &); + typedef void (*Callback)(int, s32, const char *, UNKWORD, void *userData); - typedef void (*Callback)(int, s32, const char *, UNKWORD, UNKWORD); + void SetCallback(Callback cb, void *userData) { + mCallback = cb; + mUserData = userData; + } + + u32 GetAnimDuration() const { + return mReader.GetAnimDuration(); + } private: /* 0x00 */ SoundStartable &mStartable; /* 0x04 */ AnimSoundFileReader mReader; - /* 0x0C */ f32 field_0x0C; + /* 0x0C */ f32 mCurrentFrame; /* 0x10 */ AnimEventPlayer *mpSounds; /* 0x14 */ int mNumSounds; /* 0x18 */ bool mIsActive; - /* 0x19 */ u8 field_0x19; - /* 0x1A */ u8 field_0x1A; - /* 0x1C */ UNKWORD field_0x1C; + /* 0x19 */ bool mNeedFrameReset; + /* 0x1A */ bool mNeedTriggerEventsAtCurrentFrame; + /* 0x1C */ int mCycleCounter; /* 0x20 */ Callback mCallback; - /* 0x24 */ UNKWORD field_0x24; + /* 0x24 */ void *mUserData; /* 0x28 */ f32 field_0x28; /* 0x2C */ f32 mVariableValue; }; } // namespace detail + +// Not sure about this one but it appears game code isn't meant to access the "detail" +// namespace so I guess some way for game code to use the above things need to exist +class AnimSound { +public: + AnimSound(SoundStartable &startable) : mImpl(startable, mPlayers, 8) {} + + enum PlayDirection { + FORWARD, + BACKWARD, + }; + + typedef void (*Callback)(int, s32, const char *, UNKWORD, void *userData); + + bool Setup(const void *data) { + return mImpl.Setup(data); + } + + void UpdateFrame(f32 frame, PlayDirection dir) { + mImpl.UpdateFrame(frame, (detail::AnimSoundImpl::PlayDirection)dir); + } + + void ResetFrame(f32 frame, int cycle) { + mImpl.ResetFrame(frame, cycle); + } + + void Shutdown() { + mImpl.Shutdown(); + } + + void SetCallback(Callback cb, void *userData) { + mImpl.SetCallback(cb, userData); + } + + u32 GetAnimDuration() const { + return mImpl.GetAnimDuration(); + } + +private: + /* 0x00 */ detail::AnimSoundImpl mImpl; + /* 0x30 */ detail::AnimEventPlayer mPlayers[8]; +}; + } // namespace snd } // namespace nw4r diff --git a/include/nw4r/snd/snd_SeqSoundHandle.h b/include/nw4r/snd/snd_SeqSoundHandle.h index 374a966c..764bbec3 100644 --- a/include/nw4r/snd/snd_SeqSoundHandle.h +++ b/include/nw4r/snd/snd_SeqSoundHandle.h @@ -36,6 +36,12 @@ namespace nw4r { namespace snd void DetachSound(); + u32 GetTick() const { + if (IsAttachedSound()) + return mSound->GetTick(); + return 0; + } + void WriteVariable(int varNo, s16 value) { if (IsAttachedSound()) mSound->WriteVariable(varNo, value); @@ -46,6 +52,10 @@ namespace nw4r { namespace snd mSound->ReadVariable(varNo, value); } + static bool WriteGlobalVariable(int varNo, s16 value) { + return detail::SeqSound::WriteGlobalVariable(varNo, value); + } + void SetTrackMute(u32 trackFlags, SeqMute mute) { if (IsAttachedSound()) mSound->SetTrackMute(trackFlags, mute); diff --git a/include/nw4r/snd/snd_Sound3DActor.h b/include/nw4r/snd/snd_Sound3DActor.h index 168fafa6..c0088339 100644 --- a/include/nw4r/snd/snd_Sound3DActor.h +++ b/include/nw4r/snd/snd_Sound3DActor.h @@ -24,6 +24,10 @@ public: const nw4r::math::VEC3 &GetPosition() const { return mPosition; } + + const nw4r::math::VEC3 &GetVelocity() const { + return mVelocity; + } void SetPosition(const math::VEC3 &rPosition); void SetUserParam(u32 userParam) { diff --git a/include/nw4r/snd/snd_SoundActor.h b/include/nw4r/snd/snd_SoundActor.h index 044772a7..d8b499f2 100644 --- a/include/nw4r/snd/snd_SoundActor.h +++ b/include/nw4r/snd/snd_SoundActor.h @@ -69,6 +69,14 @@ namespace nw4r { namespace snd void PauseAllSound(bool flag, int fadeFrames); int GetPlayingSoundCount(int playerId) const; + void SetVolume(f32 volume) { + mActorParam.volume = volume; + } + + f32 GetVolume() const { + return mActorParam.volume; + } + // static members public: static int const ACTOR_PLAYER_COUNT = 4; diff --git a/include/nw4r/snd/snd_SoundArchivePlayer.h b/include/nw4r/snd/snd_SoundArchivePlayer.h index 8724fde1..c3299bd3 100644 --- a/include/nw4r/snd/snd_SoundArchivePlayer.h +++ b/include/nw4r/snd/snd_SoundArchivePlayer.h @@ -227,6 +227,11 @@ namespace nw4r { namespace snd detail::BasicSound::AmbientInfo *ambientArgInfo, SoundActor *actor, bool holdFlag, SoundStartable::StartInfo const *startInfo); + // Made up + void detail_SetFileManager(SoundArchivePlayer_FileManager *manager) { + mFileManager = manager; + } + private: template Sound *AllocSound( diff --git a/include/nw4r/snd/snd_SoundHandle.h b/include/nw4r/snd/snd_SoundHandle.h index 847f7942..4dd83232 100644 --- a/include/nw4r/snd/snd_SoundHandle.h +++ b/include/nw4r/snd/snd_SoundHandle.h @@ -34,6 +34,10 @@ namespace nw4r { namespace snd const detail::BasicSound *detail_GetAttachedSound() const { return mSound; } void DetachSound(); + void SetOutputLineFlag(int outputLineFlag) { + if (IsAttachedSound()) + mSound->SetOutputLineFlag(outputLineFlag); + } void FadeIn(int fadeFrames) { if (IsAttachedSound()) @@ -45,9 +49,9 @@ namespace nw4r { namespace snd mSound->SetVolume(volume, frames); } - void SetPitch(f32 volume) { + void SetPitch(f32 pitch) { if (IsAttachedSound()) - mSound->SetPitch(volume); + mSound->SetPitch(pitch); } void Stop(int fadeFrames) { @@ -65,10 +69,24 @@ namespace nw4r { namespace snd mSound->SetPan(pan); } + void SetFxSend(AuxBus bus, f32 send) { + if (IsAttachedSound()) + mSound->SetFxSend(bus, send); + } + + void SetLpfFreq(f32 lpfFreq) { + if (IsAttachedSound()) + mSound->SetLpfFreq(lpfFreq); + } + bool IsPause() const { return IsAttachedSound() && mSound->IsPause(); } + bool IsPrepared() const { + return IsAttachedSound() && mSound->IsPrepared(); + } + int GetRemainingFadeFrames() const { if (IsAttachedSound()) return mSound->GetRemainingFadeFrames(); diff --git a/include/nw4r/snd/snd_SoundStartable.h b/include/nw4r/snd/snd_SoundStartable.h index 86d62ec6..8ac1d55b 100644 --- a/include/nw4r/snd/snd_SoundStartable.h +++ b/include/nw4r/snd/snd_SoundStartable.h @@ -164,6 +164,23 @@ namespace nw4r { namespace snd return detail_PrepareSound(pHandle, id, NULL) == START_SUCCESS; } + // The detail_ functions above are probably not meant to be called directly from game code, + // so these inlines probably exist, but I haven't found them in Ketteiban or BBA. An inline + // fixes a regswap in d/snd so that's more evidence. Names are obviously made up. + // TODO: Do these exist in other variants for different ID types too??? + + StartResult StartSoundReturnStatus(SoundHandle *pHandle, u32 id, const StartInfo *pStartInfo) { + return detail_StartSound(pHandle, id, pStartInfo); + } + + StartResult HoldSoundReturnStatus(SoundHandle *pHandle, u32 id, const StartInfo *pStartInfo) { + return detail_HoldSound(pHandle, id, pStartInfo); + } + + StartResult PrepareSoundReturnStatus(SoundHandle *pHandle, u32 id, const StartInfo *pStartInfo) { + return detail_PrepareSound(pHandle, id, pStartInfo); + } + // members private: /* vtable */ // size 0x04, offset 0x00 diff --git a/include/nw4r/snd/snd_SoundSystem.h b/include/nw4r/snd/snd_SoundSystem.h index fb0f594c..3a376d0e 100644 --- a/include/nw4r/snd/snd_SoundSystem.h +++ b/include/nw4r/snd/snd_SoundSystem.h @@ -72,6 +72,9 @@ namespace nw4r { namespace snd detail::AxManager::GetInstance().PrepareReset(); } + static OutputMode GetOutputMode() { + return detail::AxManager::GetInstance().GetOutputMode(); + } static void SetOutputMode(OutputMode mode) { detail::AxManager::GetInstance().SetOutputMode(mode); diff --git a/include/nw4r/snd/snd_StrmSound.h b/include/nw4r/snd/snd_StrmSound.h index 240659ea..88bb3205 100644 --- a/include/nw4r/snd/snd_StrmSound.h +++ b/include/nw4r/snd/snd_StrmSound.h @@ -88,6 +88,8 @@ namespace nw4r { namespace snd { namespace detail return DEBUG_SOUND_TYPE_STRMSOUND; } + u32 GetPlaySamplePosition() const { return mStrmPlayer.GetPlaySamplePosition(); } + // static members public: static int const FILE_STREAM_BUFFER_SIZE = 128; diff --git a/include/nw4r/snd/snd_StrmSoundHandle.h b/include/nw4r/snd/snd_StrmSoundHandle.h index e377ed9a..712fb90e 100644 --- a/include/nw4r/snd/snd_StrmSoundHandle.h +++ b/include/nw4r/snd/snd_StrmSoundHandle.h @@ -41,6 +41,12 @@ namespace nw4r { namespace snd mSound->SetTrackVolume(trackFlags, volume, fadeFrames); } + u32 GetPlaySamplePosition() const { + if (!IsAttachedSound()) + return -1; + return mSound->GetPlaySamplePosition(); + } + // members private: /* base NonCopyable */ // size 0x00, offset 0x00 diff --git a/include/nw4r/snd/snd_WaveSound.h b/include/nw4r/snd/snd_WaveSound.h index 87989c8e..568ef104 100644 --- a/include/nw4r/snd/snd_WaveSound.h +++ b/include/nw4r/snd/snd_WaveSound.h @@ -74,6 +74,8 @@ namespace nw4r { namespace snd { namespace detail return DEBUG_SOUND_TYPE_WAVESOUND; } + u32 GetPlaySamplePosition() const { return mWsdPlayer.GetPlaySamplePosition(); } + // static members public: static ut::detail::RuntimeTypeInfo const typeInfo; diff --git a/include/nw4r/snd/snd_WaveSoundHandle.h b/include/nw4r/snd/snd_WaveSoundHandle.h index af7de2b1..67a56540 100644 --- a/include/nw4r/snd/snd_WaveSoundHandle.h +++ b/include/nw4r/snd/snd_WaveSoundHandle.h @@ -7,6 +7,8 @@ #include "common.h" // nullptr +#include "nw4r/snd/snd_WaveSound.h" // snd::WaveSound + #include "nw4r/ut/ut_NonCopyable.h" // ut::NonCopyable /******************************************************************************* @@ -30,10 +32,17 @@ namespace nw4r { namespace snd public: // cdtors WaveSoundHandle(SoundHandle *handle); + ~WaveSoundHandle() { DetachSound(); } // methods bool IsAttachedSound() const { return mSound != nullptr; } + u32 GetPlaySamplePosition() const { + if (!IsAttachedSound()) + return -1; + return mSound->GetPlaySamplePosition(); + } + void DetachSound(); // members diff --git a/include/nw4r/snd/snd_global.h b/include/nw4r/snd/snd_global.h index f80ab974..ba696d4f 100644 --- a/include/nw4r/snd/snd_global.h +++ b/include/nw4r/snd/snd_global.h @@ -28,6 +28,14 @@ namespace nw4r { namespace snd { + enum OutputLineFlag { + OUTPUT_LINE_MAIN = 0x1, + OUTPUT_LINE_REMOTE_1 = 0x2, + OUTPUT_LINE_REMOTE_2 = 0x4, + OUTPUT_LINE_REMOTE_3 = 0x8, + OUTPUT_LINE_REMOTE_4 = 0x16, + }; + // [R89JEL]:/bin/RVL/Debug/mainD.elf:.debug::0x26bd0 enum AuxBus { diff --git a/include/rvl/AX/AXComp.h b/include/rvl/AX/AXComp.h index b389fde8..8cc2552f 100644 --- a/include/rvl/AX/AXComp.h +++ b/include/rvl/AX/AXComp.h @@ -6,6 +6,7 @@ extern "C" { #endif extern u16 __AXCompressorTable[]; +void AXSetCompressor(BOOL); #ifdef __cplusplus } diff --git a/include/toBeSorted/d_emitter.h b/include/toBeSorted/d_emitter.h index 9fdf9800..f0976a13 100644 --- a/include/toBeSorted/d_emitter.h +++ b/include/toBeSorted/d_emitter.h @@ -433,6 +433,16 @@ public: static s32 getGroupId(u16); static bool shouldBePaused(dBase_c *owner); + enum GroundEffect_e { + GROUND_0, + GROUND_1, + GROUND_2, + GROUND_3, + GROUND_4, + GROUND_5, + GROUND_6, + }; + enum Fx_e { TsuboA, TsuboB, @@ -500,7 +510,7 @@ private: u16 effectResourceId, const mMtx_c &transform, const GXColor *c1, const GXColor *c2, s32 idx1, s32 idx2 ); - static s32 polyAttrsToGroundEffectIdx(s32 polyAttr0, s32 polyAttr1); + static GroundEffect_e polyAttrsToGroundEffectIdx(s32 polyAttr0, s32 polyAttr1); static mHeapAllocator_c *ms_allocator; static dMassObjEmitter_c *sMassObjEmitters; diff --git a/include/toBeSorted/event_manager.h b/include/toBeSorted/event_manager.h index c248e8b8..561490c8 100644 --- a/include/toBeSorted/event_manager.h +++ b/include/toBeSorted/event_manager.h @@ -37,6 +37,10 @@ public: return isInEvent() ? sInstance->mCurrentEvent.eventName : nullptr; } + static s32 getCurrentEventRoomId() { + return isInEvent() ? sInstance->mCurrentEvent.roomid : -1; + } + static bool isCurrentEvent(const char *name) { return strequals(getCurrentEventName(), name); } diff --git a/include/toBeSorted/music_mgrs.h b/include/toBeSorted/music_mgrs.h deleted file mode 100644 index 518ef793..00000000 --- a/include/toBeSorted/music_mgrs.h +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef MUSIC_MGRS_H -#define MUSIC_MGRS_H - -#include "common.h" -#include "d/snd/d_snd_player_mgr.h" -#include "d/snd/d_snd_source_mgr.h" - -class dSndPlayerMgr_c; -class dSndSound_c; - -// A lot of these names are and were guesses that are probably wrong in a lot of ways. - -#define BGM_MGR (dSndPlayerMgr_c::GetInstance()) -extern "C" void fn_8035E000(); -extern "C" void fn_8035E860(dSndPlayerMgr_c *); -extern "C" void fn_8035E820(dSndPlayerMgr_c *); -extern "C" void fn_8035E880(dSndPlayerMgr_c *); -extern "C" void fn_8035E790(dSndPlayerMgr_c *, UNKWORD, void *); - -extern "C" void *ENEMY_SOUND_MGR; -extern "C" void fn_80362150(void *, u16); -extern "C" void fn_803625F0(void *, u16); -extern "C" void fn_803618F0(void *); -extern "C" void fn_80362730(void *); -extern "C" void fn_80365D20(void *); -extern "C" void fn_803624F0(void *); -extern "C" void fn_80364FD0(void *, s32); -extern "C" bool fn_80364DA0(void *); -extern "C" void fn_80365020(void *); -extern "C" void fn_80364D00(void *, s32); - -#define ENEMY_BGM_RELATED_MGR (dSndSourceMgr_c::GetInstance()) -extern "C" void fn_80384570(dSndSourceMgr_c *, bool); - -// This one has a SoundActor that actually plays the BGM_ music tracks, -// including the battle BGM track. -extern "C" void *FANFARE_SOUND_MGR; -extern "C" void AnotherSoundMgr__playSound(void *, s32); -extern "C" bool fn_803721F0(void *, u32); -extern "C" bool fn_803720E0(void *, u32); -extern "C" bool fn_80372070(void *, u32); -extern "C" bool fn_803734C0(void *, u32); -extern "C" bool fn_80373550(void *, u32); -extern "C" void fn_80372920(void *); -extern "C" void fn_803738B0(void *, dSndSound_c *sound); -extern "C" void fn_80373900(void *, dSndSound_c *sound); -extern "C" bool fn_803733B0(void *, u32); - -#endif diff --git a/include/toBeSorted/other_sound_stuff.h b/include/toBeSorted/other_sound_stuff.h deleted file mode 100644 index 9de21cee..00000000 --- a/include/toBeSorted/other_sound_stuff.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef OTHER_SOUND_STUFF_H -#define OTHER_SOUND_STUFF_H - -#include "common.h" - -extern "C" void *lbl_80575DE0; -extern "C" void fn_803996B0(void *, const char *msgLabelName, u16, s32); -extern "C" void fn_803998A0(void *, u16, u16); - -#endif diff --git a/include/toBeSorted/sound_info.h b/include/toBeSorted/sound_info.h new file mode 100644 index 00000000..1754949a --- /dev/null +++ b/include/toBeSorted/sound_info.h @@ -0,0 +1,36 @@ +#ifndef SOUND_INFO_H +#define SOUND_INFO_H + +#include "m/m_vec.h" +#include "d/snd/d_snd_source_if.h" +#include "toBeSorted/raii_ptr.h" +#include "toBeSorted/tlist.h" + +class dAcBase_c; +class cBgS_PolyInfo; + +class SoundInfo { +private: + /* 0x00 */ dAcBase_c *mpActor; + /* 0x04 */ RaiiPtr mpSource; + /* 0x08 */ const mVec3_c *mpPosPtr; + /* 0x0C */ TListNode mLink; + +public: + SoundInfo(dAcBase_c *ac); + /* vtable at 0x14 */ + virtual ~SoundInfo(); + + dSoundSourceIf_c *getSource() { + return mpSource.get(); + } + + void calc() { + mpSource->calc(*mpPosPtr); + } + + bool initSource(s32 sourceType, const char *name, const mVec3_c *posPtr); + bool startBgHitSound(u32 soundId, const cBgS_PolyInfo &info, const mVec3_c *position); +}; + +#endif diff --git a/include/toBeSorted/time_area_mgr.h b/include/toBeSorted/time_area_mgr.h index f6d206c6..032a45ed 100644 --- a/include/toBeSorted/time_area_mgr.h +++ b/include/toBeSorted/time_area_mgr.h @@ -68,7 +68,9 @@ public: void draw(); f32 checkPositionIsInPastState(s32 roomId, const mVec3_c &position, float *, float); - bool fn_800B9B60(s32 roomId, const mVec3_c &position); + // I think this might be an enum + s32 fn_800B9B60(s32 roomId, const mVec3_c &position); + f32 fn_800B9CE0(const mVec3_c &position); bool isInLanayruMiningFacility() const { return mIsInLanayruMiningFacility; diff --git a/src/REL/d/a/d_a_bombf.cpp b/src/REL/d/a/d_a_bombf.cpp index 72456bae..d01e6ed0 100644 --- a/src/REL/d/a/d_a_bombf.cpp +++ b/src/REL/d/a/d_a_bombf.cpp @@ -76,11 +76,11 @@ int dAcBombf_c::actorPostCreate() { } if (field_0x3D2 == 0 || field_0x3D2 == 2) { - bool b = dTimeAreaMgr_c::GetInstance()->fn_800B9B60(roomid, position); - if (b) { + s32 b = dTimeAreaMgr_c::GetInstance()->fn_800B9B60(roomid, position); + if (b != 0) { mTimeAreaStruct.field_0x00 = 1.0f; } - if ((b && field_0x3D2 == 2) || (!b && field_0x3D2 == 0)) { + if ((b != 0 && field_0x3D2 == 2) || (b == 0 && field_0x3D2 == 0)) { mModel.setScale(0.0001f, 0.0001f, 0.0001f); if (mBombRef.get() != nullptr) { mBombRef.get()->mField_0xA50 = 0.0001f; @@ -190,9 +190,9 @@ void dAcBombf_c::executeState_Wait() { if (mTimeAreaStruct.check(roomid, checkPos, 0, 30.0f, 0.1f) && field_0x3D4 != 1) { if (mTimeAreaStruct.field_0x04 == 1) { - playSound(SE_TIMESLIP_TIMESLIP); + startSound(SE_TIMESLIP_TIMESLIP); } else { - playSound(SE_TIMESLIP_TIMESLIP_REV); + startSound(SE_TIMESLIP_TIMESLIP_REV); } dJEffManager_c::spawnEffect(lbl_8057A750, position, nullptr, nullptr, nullptr, nullptr, 0, 0); } diff --git a/src/REL/d/a/e/d_a_e_sm.cpp b/src/REL/d/a/e/d_a_e_sm.cpp index b095eafc..6ce1179b 100644 --- a/src/REL/d/a/e/d_a_e_sm.cpp +++ b/src/REL/d/a/e/d_a_e_sm.cpp @@ -310,7 +310,7 @@ int dAcEsm_c::actorPostCreate() { if (field_0xBBF == 1 || field_0xBBF == 3) { clearActorProperty(1); fn_800306d0(); - FUN_8002d860(0); + setBattleBgmRelated(0); } return SUCCEEDED; @@ -391,10 +391,10 @@ int dAcEsm_c::actorExecute() { dJEffManager_c::spawnEffect(effectID, mEffPos, nullptr, &effScale, nullptr, nullptr, 0, 0); if (timeCheck > 0) { - playSound(SE_TIMESLIP_TIMESLIP); + startSound(SE_TIMESLIP_TIMESLIP); fn_800306d0(); } else { - playSound(SE_TIMESLIP_TIMESLIP_REV); + startSound(SE_TIMESLIP_TIMESLIP_REV); fn_80030700(); } } @@ -441,7 +441,7 @@ int dAcEsm_c::actorExecute() { field_0xBB8 = 0; } field_0xBBF = 0; - FUN_8002d860(2); + setBattleBgmRelated(2); fn_80030700(); rotation.y = angle.y = getXZAngleToPlayer(); } @@ -555,7 +555,7 @@ int dAcEsm_c::actorExecute() { fn_187_4540(2); } else { mHealth = 100; - playSound(SE_ESm_NO_DMG); + startSound(SE_ESm_NO_DMG); fn_187_61B0(7); } @@ -615,7 +615,7 @@ int dAcEsm_c::actorExecute() { pOther->field_0xBC8 = 1; pOther->mDamageTimer = 8; pOther->mStateMgr.changeState(StateID_Fusion); - playSound(SE_ESm_UNITE); + startSound(SE_ESm_UNITE); mStateMgr.changeState(StateID_Fusion); } } @@ -634,7 +634,7 @@ int dAcEsm_c::actorExecute() { if (bomb != nullptr && std::abs(bomb->GetPosition().y - mHomePos1.y) < 0.7f * lookRadius) { if (bomb->GetLinkage().tryAttach(bomb, this, &mBombRef, dLinkage_c::CONNECTION_1, false)) { mTimer_0xBAE = 160; - playSound(SE_ESm_BRING_IN); + startSound(SE_ESm_BRING_IN); clearActorProperty(1); } } @@ -664,7 +664,7 @@ int dAcEsm_c::actorExecute() { mSph.SetC(mHomePos1); if (mSph.ChkTgElectric()) { - playSoundEffect1(SE_ESm_ELEC_LV); + holdSound(SE_ESm_ELEC_LV); } radius *= mScaleTarget.x; @@ -683,9 +683,9 @@ int dAcEsm_c::actorExecute() { sLib::addCalcScaled(&field_0xB80, 0.3f, 1.f); if (field_0xBCB == 0) { - playSoundEffect1(SE_ESm_MOVE); + holdSound(SE_ESm_MOVE); } else { - playSoundEffect1(SE_ESm_MOVE_HI); + holdSound(SE_ESm_MOVE_HI); } if (field_0xBC8 == 0 && !mStateMgr.isState(StateID_Absorption)) { @@ -867,7 +867,7 @@ bool dAcEsm_c::fn_187_4090() { field_0xB50 = 0.f; field_0xB70 = 0.f; - playSound(SE_ESm_LAND); + startSound(SE_ESm_LAND); if (field_0xBA0 == 0) { if (fn_800301b0(position, rotation.y, true, 10.f) == 3 /* TODO: Enum?*/) { @@ -1081,7 +1081,7 @@ void dAcEsm_c::fn_187_4540(int param0) { if (field_0xB98 == 2) { mTimer_0xBC4 = 20; } - playSound(SE_ESm_JUMP); + startSound(SE_ESm_JUMP); } } diff --git a/src/REL/d/a/obj/d_a_obj_appear_bridge.cpp b/src/REL/d/a/obj/d_a_obj_appear_bridge.cpp index 1111db14..5d2ee4c2 100644 --- a/src/REL/d/a/obj/d_a_obj_appear_bridge.cpp +++ b/src/REL/d/a/obj/d_a_obj_appear_bridge.cpp @@ -3,6 +3,7 @@ #include "d/a/d_a_player.h" #include "d/col/bg/d_bg_s.h" #include "d/d_stage.h" +#include "d/snd/d_snd_wzsound.h" #include "nw4r/types_nw4r.h" #include "toBeSorted/area_utils.h" @@ -94,7 +95,7 @@ void dAcOappearBridge_c::initializeState_Appear() { mSrtAnm.setRate(sMovementRate, 0); mClrAnm.setRate(sMovementRate, 0); dBgS::GetInstance()->Regist(&mCollision, this); - playSound(0xAA4); + startSound(SE_ApBridg_APPEAR_LV); } void dAcOappearBridge_c::executeState_Appear() { mClrAnm.isStop(0); // ? diff --git a/src/REL/d/a/obj/d_a_obj_dungeon_ship.cpp b/src/REL/d/a/obj/d_a_obj_dungeon_ship.cpp index 0a5cdb37..2236d7dd 100644 --- a/src/REL/d/a/obj/d_a_obj_dungeon_ship.cpp +++ b/src/REL/d/a/obj/d_a_obj_dungeon_ship.cpp @@ -8,6 +8,7 @@ #include "d/col/cc/d_cc_s.h" #include "d/flag/sceneflag_manager.h" #include "d/flag/storyflag_manager.h" +#include "d/snd/d_snd_wzsound.h" #include "f/f_base.h" #include "m/m3d/m_fanm.h" #include "m/m_angle.h" @@ -226,7 +227,7 @@ void dAcODungeonShip_c::executeState_Wait() { field_0x863 = 0; field_0x864 = 0x8C; mAppearEvent = field_0x849; - playSound(0xB62); + startSound(SE_d2ship_APPEAR); mStateMgr.changeState(StateID_AppearEvent); } else { fn_485_1BF0(); @@ -244,7 +245,7 @@ void dAcODungeonShip_c::executeState_Transparency() { field_0x863 = 0; field_0x855 = 0; mNumTimesHit++; - playSound(0xB62); + startSound(SE_d2ship_APPEAR); } else if (mNumTimesHit == 2) { field_0x863 = 0; mNumTimesHit++; @@ -252,7 +253,7 @@ void dAcODungeonShip_c::executeState_Transparency() { mAppearEvent = mAppearEventFromParam; field_0x8D8 = 1; mStateMgr.changeState(StateID_AppearEvent); - playSound(0xB62); + startSound(SE_d2ship_APPEAR); return; } } diff --git a/src/REL/d/a/obj/d_a_obj_ivy_rope.cpp b/src/REL/d/a/obj/d_a_obj_ivy_rope.cpp index f7b39a39..896fd2fc 100644 --- a/src/REL/d/a/obj/d_a_obj_ivy_rope.cpp +++ b/src/REL/d/a/obj/d_a_obj_ivy_rope.cpp @@ -9,6 +9,7 @@ #include "d/col/c/c_m3d_g_lin.h" #include "d/col/cc/d_cc_s.h" #include "d/flag/sceneflag_manager.h" +#include "d/snd/d_snd_wzsound.h" #include "egg/math/eggMath.h" #include "m/m3d/m3d.h" #include "m/m_angle.h" @@ -1116,7 +1117,7 @@ void dAcOivyRope_c::fn_256_E3E0() { mField_0x1030 = 60; mStateMgr.changeState(StateID_RopeReturn); fn_256_DEE0(); - playSound(0xB76 /* HANGDOWN */); + startSound(SE_IvyRope_HANGDOWN); } } break; case 4: { diff --git a/src/REL/d/a/obj/d_a_obj_tower_gearD101.cpp b/src/REL/d/a/obj/d_a_obj_tower_gearD101.cpp index cee568bd..cda686ce 100644 --- a/src/REL/d/a/obj/d_a_obj_tower_gearD101.cpp +++ b/src/REL/d/a/obj/d_a_obj_tower_gearD101.cpp @@ -93,9 +93,9 @@ void dAcOTowerGearD101_c::executeState_Wait() { mAng newRotation = diff * scale5 / 2400.0f; if (newRotation != mCurrRotation) { if (mPreviousTurnSpeed == 0) { - playSound(SE_TGrD101_ROLL_START); + startSound(SE_TGrD101_ROLL_START); } else { - playSoundEffect1(SE_TGrD101_ROLL_LV); + holdSound(SE_TGrD101_ROLL_LV); playVisualEffect(); } } diff --git a/src/REL/d/a/obj/d_a_obj_tower_hand_D101.cpp b/src/REL/d/a/obj/d_a_obj_tower_hand_D101.cpp index 8398f3d0..c101c768 100644 --- a/src/REL/d/a/obj/d_a_obj_tower_hand_D101.cpp +++ b/src/REL/d/a/obj/d_a_obj_tower_hand_D101.cpp @@ -7,6 +7,7 @@ #include "d/col/bg/d_bg_w.h" #include "d/d_stage.h" #include "d/flag/sceneflag_manager.h" +#include "d/snd/d_snd_wzsound.h" #include "f/f_base.h" #include "m/m3d/m_fanm.h" #include "m/m_angle.h" @@ -597,7 +598,7 @@ void dAcOTowerHandD101_c::initializeState_Close() { mMdl.getAnm().setPlayState(m3d::PLAY_MODE_1); mMdl.setRate(getCloseRate()); mEffects.createEffect(PARTICLE_RESOURCE_ID_MAPPING_573_, position, nullptr, nullptr, nullptr, nullptr); - playSound(0xC0C); + startSound(SE_TowerHa_CLENCH); } void dAcOTowerHandD101_c::executeState_Close() { dAcPy_c *link = dAcPy_c::LINK; @@ -649,7 +650,7 @@ void dAcOTowerHandD101_c::initializeState_Open() { mMdl.getAnm().setPlayState(m3d::PLAY_MODE_3); mMdl.setRate(getOpenRate()); } - playSound(0xC0D); + startSound(SE_TowerHa_OPEN); } void dAcOTowerHandD101_c::executeState_Open() { dAcPy_c *link = dAcPy_c::LINK; diff --git a/src/REL/d/a/obj/d_a_obj_trap_rock_1.cpp b/src/REL/d/a/obj/d_a_obj_trap_rock_1.cpp index efcdaf44..9876e0bb 100644 --- a/src/REL/d/a/obj/d_a_obj_trap_rock_1.cpp +++ b/src/REL/d/a/obj/d_a_obj_trap_rock_1.cpp @@ -2,6 +2,7 @@ #include "d/col/bg/d_bg_s.h" #include "d/flag/sceneflag_manager.h" +#include "d/snd/d_snd_wzsound.h" #include "m/m_vec.h" #include "nw4r/math/math_arithmetic.h" #include "s/s_Math.h" @@ -74,7 +75,7 @@ void dAcOtrapRock1_c::initializeState_TrapAction() { field_0x5A0 = 0x2000; field_0x5A5 = 1; field_0x5A2 = 0x2D8; - playSound(0xB0E); + startSound(SE_TrapRc1_TRAP_ACTION); } void dAcOtrapRock1_c::executeState_TrapAction() { diff --git a/src/REL/d/a/obj/d_a_obj_tubo.cpp b/src/REL/d/a/obj/d_a_obj_tubo.cpp index 7ae8a189..7f916f97 100644 --- a/src/REL/d/a/obj/d_a_obj_tubo.cpp +++ b/src/REL/d/a/obj/d_a_obj_tubo.cpp @@ -217,7 +217,7 @@ void dAcOtubo_c::executeState_Wait() { dJEffManager_c::spawnGroundEffect(position, polyAttr0, polyAttr1, mField_0x1B4, 0, 1.0f, mField_0x1B0); } if (mbField_0x9F3) { - playSound(SE_Tubo_PUT); + startSound(SE_Tubo_PUT); mbField_0x9F3 = false; } if (checkOnLava()) { @@ -226,7 +226,7 @@ void dAcOtubo_c::executeState_Wait() { position, polyAttr0, polyAttr1, mField_0x1B4, 0, 1.0f, mField_0x1B0 ); } - playSound(SE_O_FALL_LAVA_S); + startSound(SE_O_FALL_LAVA_S); } } } else if (mObjAcch.ChkGndHit()) { @@ -467,7 +467,7 @@ void dAcOtubo_c::destroy() { fx_thing->bindShpEmitter(mSubtype != 0 ? dJEffManager_c::TsuboB : dJEffManager_c::TsuboA, false); } - playSound(SE_Tubo_BREAK); + startSound(SE_Tubo_BREAK); if (mSceneflag < 0xFF && !checkSceneflag()) { SceneflagManager::sInstance->setFlag(roomid, mSceneflag); @@ -607,7 +607,7 @@ void dAcOtubo_c::fn_272_2670() { cLib::addCalcPosXZ(&velocity, mVec3_c::Zero, 0.05f, 1.0f, 0.2f); forwardSpeed = EGG::Math::sqrt(velocity.x * velocity.x + velocity.z * velocity.z); if (!noSound) { - playSound(SE_O_FALL_WATER_S); + startSound(SE_O_FALL_WATER_S); } mbSubmerged = true; } else { @@ -855,7 +855,7 @@ void dAcOtubo_c::playRollSound() { return; } - FUN_8002d770(SE_Tubo_ROLL_LV, forwardSpeed); + holdSoundWithFloatParam(SE_Tubo_ROLL_LV, forwardSpeed); } void float_order() { diff --git a/src/REL/d/a/obj/d_a_obj_tumble_weed.cpp b/src/REL/d/a/obj/d_a_obj_tumble_weed.cpp index ed1049f6..c4e44fdc 100644 --- a/src/REL/d/a/obj/d_a_obj_tumble_weed.cpp +++ b/src/REL/d/a/obj/d_a_obj_tumble_weed.cpp @@ -144,7 +144,7 @@ int dAcOTumbleWeed_c::actorExecute() { dCcS::GetInstance()->Set(&mSph); updateMatrix(); calcMatrix(); - playSoundEffect1(0xC2C); // TODO(Sound Id) + holdSound(SE_TWeed_ROLL_LV); mMdl.setLocalMtx(mWorldMtx); mMdl.setScale(mScale); mMdl.calc(false); @@ -262,7 +262,7 @@ bool dAcOTumbleWeed_c::checkInvalidGround() const { } void dAcOTumbleWeed_c::doBreak() { - playSound(SE_TWeed_CUT); + startSound(SE_TWeed_CUT); mVec3_c pos = getPosition(); dJEffManager_c::spawnEffect(PARTICLE_RESOURCE_ID_MAPPING_743_, pos, nullptr, nullptr, nullptr, nullptr, 0, 0); deleteRequest(); diff --git a/src/REL/d/a/obj/d_a_obj_underground_switch.cpp b/src/REL/d/a/obj/d_a_obj_underground_switch.cpp index d8ef1e7f..491170b5 100644 --- a/src/REL/d/a/obj/d_a_obj_underground_switch.cpp +++ b/src/REL/d/a/obj/d_a_obj_underground_switch.cpp @@ -4,6 +4,7 @@ #include "d/a/d_a_player.h" #include "d/a/obj/d_a_obj_base.h" #include "d/flag/sceneflag_manager.h" +#include "d/snd/d_snd_wzsound.h" #include "m/m_vec.h" #include "nw4r/g3d/res/g3d_resanmclr.h" #include "nw4r/g3d/res/g3d_resmdl.h" @@ -109,7 +110,7 @@ void dAcOUgSwitch_c::executeState_Active() { if (mVariant == 0 && !SceneflagManager::sInstance->checkBoolFlag(roomid, mActiveSceneFlag)) { if (isWithinPlayerRadius(sActivationRadius) && dAcPy_c::LINK->checkActionFlags(dAcPy_c::FLG0_CRAWLING)) { mOnEventTimer = sEventTimer; - playSound(0xB12); + startSound(SE_UgSwitc_ON_ZERO); mStateMgr.changeState(StateID_On); } } @@ -117,7 +118,7 @@ void dAcOUgSwitch_c::executeState_Active() { if (!SceneflagManager::sInstance->checkBoolFlag(roomid, field_0x3BD)) { if (isWithinPlayerRadius(sActivationRadius) && dAcPy_c::LINK->checkActionFlags(dAcPy_c::FLG0_CRAWLING)) { mOnEventTimer = sEventTimer; - playSound(0xB13); + startSound(SE_UgSwitc_ON); mStateMgr.changeState(StateID_On); } } diff --git a/src/REL/d/a/obj/d_a_obj_utajima_island.cpp b/src/REL/d/a/obj/d_a_obj_utajima_island.cpp index 23c2c3b5..aa4c5eed 100644 --- a/src/REL/d/a/obj/d_a_obj_utajima_island.cpp +++ b/src/REL/d/a/obj/d_a_obj_utajima_island.cpp @@ -5,6 +5,7 @@ #include "d/a/obj/d_a_obj_utajima_main_mecha.h" #include "d/col/bg/d_bg_s.h" #include "d/d_stage.h" +#include "d/snd/d_snd_wzsound.h" #include "f/f_base.h" #include "f/f_manager.h" #include "f/f_profile_name.h" @@ -105,17 +106,17 @@ void dAcOutajimaIsland_c::executeState_Wait() { if (mPlaySound) { if (mRingLayer == 1) { - playSoundEffect1(0xC6E); + holdSound(SE_UtaLand_MoveA); } else if (mRingLayer == 2) { - playSoundEffect1(0xC6F); + holdSound(SE_UtaLand_MoveB); } else if (mRingLayer == 3) { - playSoundEffect1(0xC70); + holdSound(SE_UtaLand_MoveC); } if (mOldPosition == position) { mPlaySound = false; if (mParam2 == 0 && !sPlatformsSettled) { - playSound(0xC71); + startSound(SE_UtaLand_StopOK); sPlatformsSettled = true; } } diff --git a/src/REL/d/t/d_t_sound_area.cpp b/src/REL/d/t/d_t_sound_area.cpp index 655caa73..b1f7552f 100644 --- a/src/REL/d/t/d_t_sound_area.cpp +++ b/src/REL/d/t/d_t_sound_area.cpp @@ -36,7 +36,7 @@ int dTgSndAr_c::create() { } dAcBase_c *ac = static_cast(base); if (!ac->isActorPlayer() && checkPosInArea(ac->position)) { - ac->setBit_field_0xE8(params & 0xFF); + ac->setTgSndAreaFlag(params & 0xFF); } } return SUCCEEDED; @@ -49,12 +49,12 @@ int dTgSndAr_c::doDelete() { int dTgSndAr_c::actorExecute() { dAcBase_c *link = dAcPy_c::LINK; if (link != nullptr && checkPosInArea(link->position)) { - link->setBit_field_0xE8(params & 0xFF); + link->setTgSndAreaFlag(params & 0xFF); } if (dSnd3DManager_c::GetInstance() != nullptr) { - mVec3_c pos = dSnd3DManager_c::GetInstance()->getCameraTargetPos(); + mVec3_c pos(dSnd3DManager_c::GetInstance()->getCameraTargetPos()); if (checkPosInArea(pos) && dTgSndMg_c::GetInstance() != nullptr) { - dTgSndMg_c::GetInstance()->setBgmFlag(params & 0xFF); + dTgSndMg_c::GetInstance()->setSndFlag(params & 0xFF); } } return SUCCEEDED; diff --git a/src/REL/d/t/d_t_sound_area_mgr.cpp b/src/REL/d/t/d_t_sound_area_mgr.cpp index 0d9dd1d1..c17a843c 100644 --- a/src/REL/d/t/d_t_sound_area_mgr.cpp +++ b/src/REL/d/t/d_t_sound_area_mgr.cpp @@ -18,9 +18,9 @@ int dTgSndMg_c::doDelete() { int dTgSndMg_c::actorExecute() { if (dAcPy_c::LINK != nullptr) { - dAcPy_c::LINK->field_0xe8 = 0; + dAcPy_c::LINK->mTgSndAreaFlags = 0; } - mBgmFlags = 0; + mSndFlags = 0; return SUCCEEDED; } diff --git a/src/d/a/d_a_base.cpp b/src/d/a/d_a_base.cpp index a60175f5..1aa515d4 100644 --- a/src/d/a/d_a_base.cpp +++ b/src/d/a/d_a_base.cpp @@ -38,13 +38,11 @@ dAcBase_c *dAcBase_c::s_Create_Parent; const ActorInfo *dAcBase_c::s_Create_ActorInfo; u8 dAcBase_c::s_Create_Subtype; -extern "C" dSoundSourceIf_c *soundForActorInitRelated_803889c0(s8, fBase_c *, const char *, u8); - bool dAcBase_c::createHeap() { return true; } -// sound_source and sound_list need to be ironed out before this can match +// mpSoundSource and sound_list need to be ironed out before this can match // NOT MATCHING // 8002c3b0 dAcBase_c::dAcBase_c() @@ -90,8 +88,6 @@ dAcBase_c::dAcBase_c() // 8002c530 // dBase_c::~dBase_c() {} -// Fixing the sound_source and sound_info in the ctor should make this match -// NOT MATCHING // 8002c590 dAcBase_c::~dAcBase_c() {} @@ -122,7 +118,7 @@ dSoundSourceIf_c *dAcBase_c::createSoundSource() { } const char *actorName = getActorName(mpActorInfo); - return soundForActorInitRelated_803889c0(soundSourceType, this, actorName, subtype); + return dSoundSourceIf_c::create(soundSourceType, this, actorName, subtype); } int dAcBase_c::initAllocatorWork1Heap(int size, char *name, int align) { @@ -133,7 +129,7 @@ int dAcBase_c::initAllocator(int size, char *name, EGG::Heap *heap, int align) { if (!heap_allocator.createFrmHeapToCurrent(size, heap, name, 0x20, mHeap::OPT_NONE)) { return 0; } - sound_source = createSoundSource(); + mpSoundSource = createSoundSource(); int success = createHeap(); heap_allocator.adjustFrmHeapRestoreCurrent(); return success; @@ -155,8 +151,8 @@ bool dAcBase_c::addActorToRoom(s32 roomId) { return false; } -void dAcBase_c::setBit_field_0xE8(s32 shift) { - field_0xe8 |= (1 << shift); +void dAcBase_c::setTgSndAreaFlag(s32 shift) { + mTgSndAreaFlags |= (1 << shift); } int dAcBase_c::actorCreate() { @@ -192,7 +188,10 @@ void dAcBase_c::postCreate(fBase_c::MAIN_STATE_e state) { // NOT MATCHING // 8002c940 int dAcBase_c::preDelete() { - int fbaseDelete = fBase_c::preDelete(); + int ret = SUCCEEDED; + if (fBase_c::preDelete() == NOT_READY) { + ret = NOT_READY; + } if (!checkActorProperty(0x800) && checkActorProperty(0x10000000) && fBase_c::getConnectParent()->lifecycle_state != TO_BE_DELETED) { @@ -201,29 +200,39 @@ int dAcBase_c::preDelete() { } } else { - if (sound_source != nullptr) { - // TODO: add func call + if (mpSoundSource != nullptr) { + mpSoundSource->stopAllSound(0); + } + // TODO - TList + for (SoundInfoList::Iterator it = sound_list.GetBeginIter(); it != sound_list.GetEndIter(); ++it) { + it->getSource()->stopAllSound(0); } - - // TODO: add sound_info stuff once the SoundInfo x Heap weirdness is figured out } - if (fbaseDelete == 0) { - return false; + if (ret == NOT_READY) { + return NOT_READY; } - if (sound_source != nullptr) { - // TODO: add func calls - return false; + if (mpSoundSource != nullptr) { + mpSoundSource->shutdown(); + if (mpSoundSource->hasPlayingSounds()) { + return NOT_READY; + } + } + // TODO - TList + for (SoundInfoList::Iterator it = sound_list.GetBeginIter(); it != sound_list.GetEndIter(); ++it) { + it->getSource()->shutdown(); + if (it->getSource()->hasPlayingSounds()) { + return NOT_READY; + } } - // TODO: add sound_info stuff once the SoundInfo x Heap weirdness is figured out - if (checkActorProperty(0x20000000)) { + if (checkActorProperty(0x02000000)) { changeLoadedEntitiesNoSet(); } - return true; + return SUCCEEDED; } // 8002cb10 @@ -263,9 +272,20 @@ int dAcBase_c::actorExecuteInEvent() { return actorExecute(); } -// Can't make progress on this til the SoundInfo x Heap weirdness is figured out // 8002ccc0 -void dAcBase_c::postExecute(fBase_c::MAIN_STATE_e state) {} +void dAcBase_c::postExecute(fBase_c::MAIN_STATE_e state) { + if (mpSoundSource != nullptr) { + mpSoundSource->calc(*obj_pos); + mpSoundSource->setPolyAttrs(polyAttr0, polyAttr1); + } + + // TODO - TList + for (SoundInfoList::Iterator it = sound_list.GetBeginIter(); it != sound_list.GetEndIter(); ++it) { + it->calc(); + } + + // TODO - ... +} // 8002ce90 void dAcBase_c::unkVirtFunc_0x5C() { @@ -494,29 +514,118 @@ bool dAcBase_c::isRoomFlags_0x6_Set() { return (room->checkFlag(0x4 | 0x2)); } -// Start of SoundSource stuff -void dAcBase_c::FUN_8002d590() {} -void dAcBase_c::FUN_8002d5b0() {} -void dAcBase_c::playSound(u16) {} -void dAcBase_c::FUN_8002d600() {} -void dAcBase_c::FUN_8002d630() {} -void dAcBase_c::FUN_8002d6d0() {} -// currently named ActorBase__playSoundEffect1 -void dAcBase_c::playSoundEffect1(u16) {} -void dAcBase_c::FUN_8002d740() {} -void dAcBase_c::FUN_8002d770(u16, f32) {} -void dAcBase_c::FUN_8002d7a0() {} -void dAcBase_c::FUN_8002d7d0() {} -void dAcBase_c::FUN_8002d7f0() {} -void dAcBase_c::FUN_8002d810() {} -void dAcBase_c::FUN_8002d830() {} -void dAcBase_c::FUN_8002d860(UNKWORD) {} +void dAcBase_c::setSoundSourceSubtype(u8 subType) { + if (mpSoundSource == nullptr) { + return; + } + mpSoundSource->setSubtype(subType); +} + +void dAcBase_c::FUN_8002d5b0() { + if (mpSoundSource == nullptr) { + return; + } + mpSoundSource->vt_0x0F0_noop(); +} + +bool dAcBase_c::startSound(u32 soundId) { + if (mpSoundSource == nullptr) { + return false; + } + return mpSoundSource->startSound(soundId); +} + +bool dAcBase_c::startSoundWithFloatParam(u32 soundId, f32 param) { + if (mpSoundSource == nullptr) { + return false; + } + return mpSoundSource->startSoundWithFloatParam(soundId, param); +} + +bool dAcBase_c::startBgHitSound(u32 soundId, const cBgS_PolyInfo &info, const mVec3_c *position) { + if (mpSoundSource == nullptr) { + return false; + } + return mpSoundSource->startBgHitSound( + soundId, dBgS::GetInstance()->GetPolyAtt0(info), dBgS::GetInstance()->GetPolyAtt1(info), + position != nullptr ? position : &this->position + ); +} + +bool dAcBase_c::startSoundAtPosition(u32 soundId, const mVec3_c *position) { + if (mpSoundSource == nullptr) { + return false; + } + return mpSoundSource->startSoundAtPosition(soundId, position != nullptr ? position : &this->position); +} + +bool dAcBase_c::holdSound(u32 soundId) { + if (mpSoundSource == nullptr) { + return false; + } + return mpSoundSource->holdSound(soundId); +} + +bool dAcBase_c::holdSoundWithIntParam(u32 soundId, s32 param) { + if (mpSoundSource == nullptr) { + return false; + } + return mpSoundSource->holdSoundWithIntParam(soundId, param); +} + +bool dAcBase_c::holdSoundWithFloatParam(u32 soundId, f32 param) { + if (mpSoundSource == nullptr) { + return false; + } + return mpSoundSource->holdSoundWithFloatParam(soundId, param); +} + +bool dAcBase_c::holdSoundWithParams(u32 soundId, f32 fValue, s32 value) { + if (mpSoundSource == nullptr) { + return false; + } + return mpSoundSource->holdSoundWithParams(soundId, fValue, value); +} + +void dAcBase_c::holdSoundSourceFlag(u32 mask) { + if (mpSoundSource == nullptr) { + return; + } + mpSoundSource->holdFlag(mask); +} + +void dAcBase_c::onSoundSourceFlag(u32 mask) { + if (mpSoundSource == nullptr) { + return; + } + mpSoundSource->onFlag(mask); +} + +void dAcBase_c::offSoundSourceFlag(u32 mask) { + if (mpSoundSource == nullptr) { + return; + } + mpSoundSource->offFlag(mask); +} + +bool dAcBase_c::isPlayingSound(u32 soundId) { + if (mpSoundSource == nullptr) { + return false; + } + return mpSoundSource->isPlayingSound(soundId); +} + +void dAcBase_c::setBattleBgmRelated(UNKWORD param) { + if (mpSoundSource == nullptr) { + return; + } + mpSoundSource->setBattleBgmRelated(param); +} // 8002d880 dSoundSourceIf_c *dAcBase_c::getSoundSource() { - return sound_source.get(); + return mpSoundSource.get(); } -// End of SoundSource stuff // 8002d890 void dAcBase_c::removeSoundInfo(SoundInfo *soundInfo) { diff --git a/src/d/a/d_a_insect.cpp b/src/d/a/d_a_insect.cpp index b93cac0d..cead799a 100644 --- a/src/d/a/d_a_insect.cpp +++ b/src/d/a/d_a_insect.cpp @@ -19,7 +19,7 @@ void dAcOInsect_c::kill() { dJEffManager_c::spawnEffect(PARTICLE_RESOURCE_ID_MAPPING_394_, position, nullptr, nullptr, nullptr, nullptr, 0, 0); - playSound(SE_Insect_DISAPPEAR); + startSound(SE_Insect_DISAPPEAR); deleteRequest(); } diff --git a/src/d/a/obj/d_a_obj_boomerang.cpp b/src/d/a/obj/d_a_obj_boomerang.cpp index 7cbde76a..4f5dade2 100644 --- a/src/d/a/obj/d_a_obj_boomerang.cpp +++ b/src/d/a/obj/d_a_obj_boomerang.cpp @@ -239,7 +239,7 @@ void dAcBoomerang_c::deleteReady() { deleteCheck(); if (getSoundSource()) { - getSoundSource()->vt_0x40(5); + getSoundSource()->stopAllSound(5); } if (dAcPy_c::GetLink2()) { @@ -251,7 +251,7 @@ void dAcBoomerang_c::retrieve() { if (mFader.isStatus(mFaderBase_c::FADED_OUT)) { mFader.setFrame(5); mFader.fadeIn(); - playSound(SE_BE_COME_BACK); + startSound(SE_BE_COME_BACK); } mFader.calc(); } @@ -391,7 +391,7 @@ void dAcBoomerang_c::executeState_ReturnWait() { forwardSpeed = 0.f; placeOnArm(); if (mAnmChr[BOOMERANG_ANIM_PINCERS].isStop() || !dAcPy_c::GetLink2()->checkActionFlagsCont(0x10)) { - playSound(SE_BE_CATCH); + startSound(SE_BE_CATCH); mStateMgr.changeState(StateID_Wait); } } @@ -439,7 +439,7 @@ void dAcBoomerang_c::initializeState_Move() { field_0x8E4.fromXY(angle.x, angle.y, forwardSpeed); - playSound(SE_BE_THROW); + startSound(SE_BE_THROW); dJEffManager_c::spawnUIEffect(PARTICLE_RESOURCE_ID_MAPPING_3_, mVec3_c::Zero, nullptr, nullptr, nullptr, nullptr); field_0x8F0 = mVec3_c::Zero; field_0x8D4 = 0.0f; @@ -484,7 +484,7 @@ void dAcBoomerang_c::executeTimeWarning() { flashClr.r = (1.f / (r - 6)) * MAX(0, (mFlashTimer % r) - 5) * 255.f; if (flashClr.r == 0xFF && !mStateMgr.isState(StateID_MoveCancelWait)) { - playSound(SE_BE_WARNING); + startSound(SE_BE_WARNING); } } @@ -554,7 +554,7 @@ int dAcBoomerang_c::actorExecute() { if (checkField_0x8CC(FLAG_0x20) && !checkField_0x8CC(FLAG_CANCEL)) { if (mStateMgr.isState(StateID_Move) || mStateMgr.isState(StateID_MoveCancelWait)) { mEff3.createContinuousEffect(PARTICLE_RESOURCE_ID_MAPPING_7_, mWorldMtx, nullptr, nullptr); - playSoundEffect1(SE_BE_HIT_LEAVES_LV); + holdSound(SE_BE_HIT_LEAVES_LV); } } diff --git a/src/d/a/obj/d_a_obj_switch.cpp b/src/d/a/obj/d_a_obj_switch.cpp index d64f90bb..29cc1dc4 100644 --- a/src/d/a/obj/d_a_obj_switch.cpp +++ b/src/d/a/obj/d_a_obj_switch.cpp @@ -160,7 +160,7 @@ int dAcOsw_c::actorExecute() { dJEffManager_c::spawnEffect( PARTICLE_RESOURCE_ID_MAPPING_754_, position, &rotation, nullptr, nullptr, nullptr, 0, 0 ); - playSound(SE_TIMESLIP_TIMESLIP_REV); + startSound(SE_TIMESLIP_TIMESLIP_REV); mHidden = true; } } else { @@ -175,7 +175,7 @@ int dAcOsw_c::actorExecute() { dJEffManager_c::spawnEffect( PARTICLE_RESOURCE_ID_MAPPING_754_, position, &rotation, nullptr, nullptr, nullptr, 0, 0 ); - playSound(SE_TIMESLIP_TIMESLIP); + startSound(SE_TIMESLIP_TIMESLIP); mShown = true; } } else { @@ -250,7 +250,7 @@ void dAcOsw_c::executeState_OnWait() { void dAcOsw_c::finalizeState_OnWait() {} void dAcOsw_c::initializeState_On() { - playSound(0xA19); + startSound(SE_Sw_SLIDE); } void dAcOsw_c::executeState_On() { if (sLib::chase(&mButtonCtrl.mElevation, -20.0f, 2.0f)) { @@ -259,7 +259,7 @@ void dAcOsw_c::executeState_On() { } void dAcOsw_c::finalizeState_On() { - playSound(0xA18); + startSound(SE_Sw_ON); dRumble_c::start(dRumble_c::sRumblePreset2, 0x1); } @@ -281,7 +281,7 @@ void dAcOsw_c::executeState_OffWait() { void dAcOsw_c::finalizeState_OffWait() {} void dAcOsw_c::initializeState_Off() { - playSound(0xA19); + startSound(SE_Sw_SLIDE); } void dAcOsw_c::executeState_Off() { if (sLib::chase(&mButtonCtrl.mElevation, 0.0f, 2.0f)) { diff --git a/src/d/a/obj/d_a_obj_tbox.cpp b/src/d/a/obj/d_a_obj_tbox.cpp index ef3c05de..618cc6e2 100644 --- a/src/d/a/obj/d_a_obj_tbox.cpp +++ b/src/d/a/obj/d_a_obj_tbox.cpp @@ -1934,7 +1934,7 @@ extern "C" dAcItem_c *giveItem3(u16 item, s32); void dAcTbox_c::initializeState_Open() { mScale.set(1.0f, 1.0f, 1.0f); - playSound(SE_TBox_OPEN_A); + startSound(SE_TBox_OPEN_A); clearActorProperty(0x100); if (mVariant == NORMAL) { mAnmMatClr1.setFrame(mAnmMatClr1.getFrameMax(0), 0); diff --git a/src/d/col/bg/d_bg_s.cpp b/src/d/col/bg/d_bg_s.cpp index d6fd0242..7f96c7c3 100644 --- a/src/d/col/bg/d_bg_s.cpp +++ b/src/d/col/bg/d_bg_s.cpp @@ -1,6 +1,7 @@ #include "d/col/bg/d_bg_s.h" #include "common.h" +#include "d/col/bg/d_bg_pc.h" #include "d/col/bg/d_bg_s_acch.h" #include "d/col/bg/d_bg_s_gnd_chk.h" #include "d/col/bg/d_bg_s_lin_chk.h" @@ -557,10 +558,10 @@ s32 dBgS::GetWallCode(cBgS_PolyInfo const &info) { int dBgS::GetPolyAtt0(cBgS_PolyInfo const &info) { if (!ChkPolySafe(info)) { - return 0; + return POLY_ATT_0_NONE; } - if (GetSpecialCode(info) == 7 /* LAVA */) { - return 6; + if (GetSpecialCode(info) == POLY_ATTR_LAVA) { + return POLY_ATT_0_LAVA; } return mChkElem[info.GetBgIndex()].mpBgW->GetPolyAtt0Material(info); } @@ -577,10 +578,10 @@ int dBgS::GetMapCode(int att0, int att1, bool bAlt) { if (bAlt && dScGame_c::currentSpawnInfo.getTrial() == SpawnInfo::TRIAL) { return 0x1E; } - if (att0 == 4 && att1 == 1) { + if (att0 == POLY_ATT_0_GRASS && att1 == 1) { return 0x13; } - if (att0 == 5) { + if (att0 == POLY_ATT_0_TREE) { if (att1 == 1) { return 0x14; } @@ -588,10 +589,10 @@ int dBgS::GetMapCode(int att0, int att1, bool bAlt) { return 0x15; } } else { - if ((att0 == 8) && (att1 == 1)) { + if ((att0 == POLY_ATT_0_STONE) && (att1 == 1)) { return 0x16; } - if (att0 == 10) { + if (att0 == POLY_ATT_0_METAL) { if (att1 == 1) { return 0x17; } @@ -601,11 +602,11 @@ int dBgS::GetMapCode(int att0, int att1, bool bAlt) { } } - if ((att0 == 0xc) && (att1 == 1)) { + if ((att0 == POLY_ATT_0_TUTA) && (att1 == 1)) { return 0x19; } - if (att0 == 0xd) { + if (att0 == POLY_ATT_0_LIFE) { if (att1 == 1) { return 0x1a; } @@ -616,7 +617,7 @@ int dBgS::GetMapCode(int att0, int att1, bool bAlt) { return 0x1C; } } else { - if (att0 != 0xf) { + if (att0 != POLY_ATT_0_QSAND) { return att0; } if (att1 == 1) { diff --git a/src/d/d_dvd_unk.cpp b/src/d/d_dvd_unk.cpp index 60a344f3..2e34c1fc 100644 --- a/src/d/d_dvd_unk.cpp +++ b/src/d/d_dvd_unk.cpp @@ -120,7 +120,7 @@ void dDvdUnk::FontUnk::fn_80052A20() { if (checkFlag(FLAG_ERROR_STATE)) { dGfx_c::GetInstance()->releaseTextureBuffer(); - dSndPlayerMgr_c::GetInstance()->fn_8035E6E0(); + dSndPlayerMgr_c::GetInstance()->leaveCaution(); } if (dLytSystemWindow_c::GetInstance() != nullptr && dLytSystemWindow_c::GetInstance()->fn_80152F80()) { @@ -169,11 +169,11 @@ void FontUnk::preExecute() { if (prevError && !isAnyError()) { dGfx_c::GetInstance()->releaseTextureBuffer(); offFlag(FLAG_ERROR_STATE); - dSndPlayerMgr_c::GetInstance()->fn_8035E6E0(); + dSndPlayerMgr_c::GetInstance()->leaveCaution(); } if (field_0x2C == true && !prevError && isAnyError()) { - dSndPlayerMgr_c::GetInstance()->fn_8035E620(); + dSndPlayerMgr_c::GetInstance()->enterCaution(); } } } @@ -222,7 +222,7 @@ void FontUnk::fn_80052D50() { if (checkFlag(FLAG_ERROR_STATE)) { dGfx_c::GetInstance()->releaseTextureBuffer(); mFlags = 0; - dSndPlayerMgr_c::GetInstance()->fn_8035E6E0(); + dSndPlayerMgr_c::GetInstance()->leaveCaution(); } dPadManager_c::GetInstance()->init(); } diff --git a/src/d/d_message.cpp b/src/d/d_message.cpp index 0d56a9f8..764b066a 100644 --- a/src/d/d_message.cpp +++ b/src/d/d_message.cpp @@ -23,8 +23,10 @@ #include "d/lyt/d_lyt_mini_game.h" #include "d/lyt/meter/d_lyt_meter.h" #include "d/lyt/msg_window/d_lyt_msg_window.h" +#include "d/snd/d_snd_bgm_mgr.h" #include "d/snd/d_snd_small_effect_mgr.h" #include "d/snd/d_snd_source_mgr.h" +#include "d/snd/d_snd_state_mgr.h" #include "egg/core/eggHeap.h" #include "f/f_base.h" #include "f/f_profile.h" @@ -39,7 +41,6 @@ #include "toBeSorted/fi_context.h" #include "toBeSorted/file_manager.h" #include "toBeSorted/minigame_mgr.h" -#include "toBeSorted/music_mgrs.h" #include "toBeSorted/unk_save_time.h" #include "rvl/OS.h" @@ -47,7 +48,6 @@ #include #include - s32 dFlow_c::sExitId = -1; dFlow_c::dFlow_c() { @@ -196,7 +196,7 @@ static const FlowSoundDef sSoundDefs[] = { void dFlow_c::playSound(u32 params) { if (params >= 1000) { - fn_80364FD0(ENEMY_SOUND_MGR, params); + dSndStateMgr_c::GetInstance()->setFlowEvent(params); return; } if (params >= 100) { @@ -217,7 +217,7 @@ void dFlow_c::playSound(u32 params) { } switch (sSoundDefs[idx].mSoundMgr) { - case 0: AnotherSoundMgr__playSound(FANFARE_SOUND_MGR, sSoundDefs[idx].mSoundId); break; + case 0: dSndBgmMgr_c::GetInstance()->playFanSound(sSoundDefs[idx].mSoundId); break; case 1: dSndSmallEffectMgr_c::GetInstance()->playSound(sSoundDefs[idx].mSoundId); break; } } diff --git a/src/d/d_pad.cpp b/src/d/d_pad.cpp index 0508dbaf..efc067d1 100644 --- a/src/d/d_pad.cpp +++ b/src/d/d_pad.cpp @@ -299,12 +299,12 @@ void endPad_BR() { void connectCallback(const EGG::CoreControllerConnectArg &rArg) { switch (rArg.result) { case WPAD_ERR_OK: { - dSndPlayerMgr_c::GetInstance()->setup(rArg.chan); + dSndPlayerMgr_c::GetInstance()->setupRmtSpeaker(rArg.chan); ex_c::m_ex[rArg.chan].mDidConnect = true; break; } case WPAD_ERR_NO_CONTROLLER: { - dSndPlayerMgr_c::GetInstance()->shutdown(rArg.chan); + dSndPlayerMgr_c::GetInstance()->shutdownRmtSpeaker(rArg.chan); ex_c::m_ex[rArg.chan].mDidDisconnect = true; break; } diff --git a/src/d/d_player_mdl.cpp b/src/d/d_player_mdl.cpp index 43a2bf28..de8cbab4 100644 --- a/src/d/d_player_mdl.cpp +++ b/src/d/d_player_mdl.cpp @@ -633,7 +633,7 @@ bool daPlBaseMdl_c::create( mpSoundData = nullptr; field_0x5A = 0xFFFF; dSoundSourceIf_c *sound = player->getSoundSource(); - if (sound->isReadyMaybe()) { + if (sound->hasAnimSound()) { sound->load(nullptr, ""); } return true; diff --git a/src/d/d_reset.cpp b/src/d/d_reset.cpp index e548d9eb..536eb4c5 100644 --- a/src/d/d_reset.cpp +++ b/src/d/d_reset.cpp @@ -116,7 +116,7 @@ void Manage_c::BootComplete(bool complete) { bool Manage_c::CanExecSoftReset() const { return mMode == SoftReset && mpFader->getStatus() == EGG::Fader::STATUS_PREPARE_IN && field_0x60 == 0 && dHbm::Manage_c::GetInstance()->getState() != dHbm::Manage_c::HBM_MANAGE_ACTIVE && - dSndPlayerMgr_c::GetInstance()->fn_8035E2E0() && FileManager::GetInstance()->getField_0xA84D() != 1; + dSndPlayerMgr_c::GetInstance()->isReset() && FileManager::GetInstance()->getField_0xA84D() != 1; } void Manage_c::SetSoftResetFinish() { @@ -306,15 +306,15 @@ void Manage_c::ModeInit_SoftReset() { mpFader->setFrame(30); mpFader->fadeOut(); field_0x66 = true; - dSndPlayerMgr_c::GetInstance()->fn_8035E250(30); + dSndPlayerMgr_c::GetInstance()->reset(30); } else { field_0x60 = 0; if (dTitleMgr_c::GetInstance()) { if (dTitleMgr_c::GetInstance()->getField_0xBC() == 0) { - dSndPlayerMgr_c::GetInstance()->fn_8035E250(30); + dSndPlayerMgr_c::GetInstance()->reset(30); } } else { - dSndPlayerMgr_c::GetInstance()->fn_8035E250(30); + dSndPlayerMgr_c::GetInstance()->reset(30); } THPPlayerSetVolume(0, 60); mpFader->setFrame(30); @@ -332,13 +332,13 @@ void Manage_c::ModeProc_SoftReset() { dScBoot_c::GetInstance()->setField_0x5E4(false); mpFader->setStatus(EGG::ColorFader::STATUS_PREPARE_OUT); ModeRequest(Normal); - dSndPlayerMgr_c::GetInstance()->fn_8035E310(); + dSndPlayerMgr_c::GetInstance()->recoverReset(); } else { if (field_0x66) { dScBoot_c::GetInstance()->setField_0x5E3(true); dDvdUnk::FontUnk::GetInstance()->fn_800529B0(); - dSndPlayerMgr_c::GetInstance()->fn_8035E6E0(); + dSndPlayerMgr_c::GetInstance()->leaveCaution(); if (dDvdUnk::FontUnk::GetInstance()->isNandError() || dDvdUnk::FontUnk::GetInstance()->getNandError() != NandResultTracker::ERR_CAT_NONE || @@ -476,14 +476,14 @@ void Manage_c::ModeProc_FatalError() {} void Manage_c::ModeInit_SafetyWait() { DebugPrintMode("SafetyWait"); - dSndPlayerMgr_c::GetInstance()->fn_8035E1B0(30); + dSndPlayerMgr_c::GetInstance()->shutdown(30); mpFader->setFrame(30); mpFader->fadeOut(); } void Manage_c::ModeProc_SafetyWait() { if (mpFader->getStatus() == EGG::Fader::STATUS_PREPARE_IN) { - bool b = dSndPlayerMgr_c::GetInstance()->fn_8035E220() && !FileManager::GetInstance()->getField_0xA84D(); + bool b = dSndPlayerMgr_c::GetInstance()->isShutdown() && !FileManager::GetInstance()->getField_0xA84D(); if (b) { ExecProcPre(); fn_80068070(); diff --git a/src/d/d_sc_game.cpp b/src/d/d_sc_game.cpp index 9d85e44f..7d4f449c 100644 --- a/src/d/d_sc_game.cpp +++ b/src/d/d_sc_game.cpp @@ -6,6 +6,7 @@ #include "d/d_gfx.h" #include "d/d_stage_mgr.h" #include "d/flag/storyflag_manager.h" +#include "d/snd/d_snd_state_mgr.h" #include "f/f_base.h" #include "f/f_profile_name.h" #include "m/m_fader_base.h" @@ -16,7 +17,6 @@ #include "toBeSorted/arc_managers/oarc_manager.h" #include "toBeSorted/file_manager.h" #include "toBeSorted/minigame_mgr.h" -#include "toBeSorted/music_mgrs.h" #include "toBeSorted/unk_save_time.h" #include @@ -166,7 +166,7 @@ void dScGame_c::executeState_Action() { } } else if (mReloadTrigger != fProfile::PROFILE_MAX) { mFader.fadeOut(); - fn_80362150(ENEMY_SOUND_MGR, mFader.getFadeOutFrame()); + dSndStateMgr_c::GetInstance()->onGotoStage(mFader.getFadeOutFrame()); } } diff --git a/src/d/d_sc_title.cpp b/src/d/d_sc_title.cpp index aad53c91..7d261e9f 100644 --- a/src/d/d_sc_title.cpp +++ b/src/d/d_sc_title.cpp @@ -9,6 +9,8 @@ #include "d/d_reset.h" #include "d/d_sc_game.h" #include "d/d_sys.h" +#include "d/snd/d_snd_player_mgr.h" +#include "d/snd/d_snd_state_mgr.h" #include "f/f_base.h" #include "f/f_profile_name.h" #include "m/m_color.h" @@ -17,7 +19,6 @@ #include "sized_string.h" #include "toBeSorted/arc_managers/layout_arc_manager.h" #include "toBeSorted/file_manager.h" -#include "toBeSorted/music_mgrs.h" #include "toBeSorted/save_related.h" #include "toBeSorted/unk_save_time.h" @@ -96,7 +97,7 @@ int dScTitle_c::create() { SizedString<128> fntPath; fntPath.sprintf("/US/Font/%s/%s", dMessage_c::getLanguageIdentifier(), "normal_02.brfnt"); mDvd_toMainRam_normal_c::create2(&mpSkbFont, fntPath, 0, dHeap::work2Heap.heap); - BGM_MGR->fn_8035E310(); + dSndPlayerMgr_c::GetInstance()->recoverReset(); } return ret; @@ -162,7 +163,7 @@ void dScTitle_c::loadTitleScreen(u32 params) { } else { actuallyTriggerEntrance("F000", 0, 28, 48, 0, 0, dFader_c::FADER_BLACK, 15, -1); } - fn_80362150(ENEMY_SOUND_MGR, 30); + dSndStateMgr_c::GetInstance()->onGotoStage(30); } void dScTitle_c::setSomethingSkbRelated() { diff --git a/src/d/d_stage.cpp b/src/d/d_stage.cpp index 684824f7..7d2d2d38 100644 --- a/src/d/d_stage.cpp +++ b/src/d/d_stage.cpp @@ -13,6 +13,7 @@ #include "d/flag/dungeonflag_manager.h" #include "d/flag/sceneflag_manager.h" #include "d/flag/storyflag_manager.h" +#include "d/snd/d_snd_source_mgr.h" #include "f/f_base.h" #include "f/f_profile.h" #include "f/f_profile_name.h" @@ -27,7 +28,6 @@ #include "toBeSorted/arc_managers/layout_arc_manager.h" #include "toBeSorted/arc_managers/oarc_manager.h" #include "toBeSorted/event_manager.h" -#include "toBeSorted/music_mgrs.h" #include "toBeSorted/time_area_mgr.h" #include @@ -164,7 +164,7 @@ bool dStage_c::fadeIn(s32 fadeType, u16 frames) { mFader.setFadeInType(fadeType); mFader.setFadeInFrame(frames); mFader.fadeIn(); - fn_80384570(ENEMY_BGM_RELATED_MGR, false); + dSndSourceMgr_c::GetInstance()->setMutedFromFader(false); return true; } @@ -175,18 +175,18 @@ bool dStage_c::fadeOut(s32 fadeType, u16 frames) { mFader.setFadeOutType(fadeType); mFader.setFadeOutFrame(frames); mFader.fadeOut(); - fn_80384570(ENEMY_BGM_RELATED_MGR, true); + dSndSourceMgr_c::GetInstance()->setMutedFromFader(true); return true; } void dStage_c::forceFadeOut() { mFader.setStatus(mFaderBase_c::FADED_OUT); - fn_80384570(ENEMY_BGM_RELATED_MGR, true); + dSndSourceMgr_c::GetInstance()->setMutedFromFader(true); } void dStage_c::forceFadeIn() { mFader.setStatus(mFaderBase_c::FADED_IN); - fn_80384570(ENEMY_BGM_RELATED_MGR, false); + dSndSourceMgr_c::GetInstance()->setMutedFromFader(false); } void dStage_c::drawMap(mMtx_c *mtx, int param) { diff --git a/src/d/d_stage_mgr.cpp b/src/d/d_stage_mgr.cpp index 678848e0..e6bfc03e 100644 --- a/src/d/d_stage_mgr.cpp +++ b/src/d/d_stage_mgr.cpp @@ -9,14 +9,14 @@ #include "d/d_stage_parse.h" #include "d/d_sys.h" #include "d/flag/flag_managers.h" -#include "egg/core/eggHeap.h" +#include "d/snd/d_snd_state_mgr.h" #include "f/f_base.h" #include "f/f_profile_name.h" #include "m/m_dvd.h" #include "toBeSorted/arc_managers/current_stage_arc_manager.h" #include "toBeSorted/arc_managers/layout_arc_manager.h" #include "toBeSorted/arc_managers/oarc_manager.h" -#include "toBeSorted/music_mgrs.h" +#include "toBeSorted/d_particle.h" SPECIAL_BASE_PROFILE(STAGE_MANAGER, dStageMgr_c, fProfile::STAGE_MANAGER, 0X5, 1536); @@ -56,7 +56,7 @@ void dStageMgr_c::finalizeState_ReadStageRes() { parseStageBzs(-1, stageBzs); parseRoomStageBzs(-1, stageBzs); } - fn_803618F0(ENEMY_SOUND_MGR); + dSndStateMgr_c::GetInstance()->onStageOrLayerUpdate(); } void dStageMgr_c::initializeState_ReadRoomRes() {} @@ -147,27 +147,24 @@ void dStageMgr_c::executeState_ReadLayerObjectRes() { } } -extern "C" void fn_800C85D0(void *, EGG::Heap *heap, bool, void *jpc, void *jpn); -extern "C" void *FOR_LOADED_PARTICLES; - void dStageMgr_c::finalizeState_ReadLayerObjectRes() { if (mDemoName.len() != 0) { const char *name = mDemoName; void *jpc = OarcManager::GetInstance()->getSubEntryData(name, "dat/jparticle.jpc"); if (jpc != nullptr) { - void *jpn = OarcManager::GetInstance()->getSubEntryData(name, "dat/jparticle.jpn"); - fn_800C85D0(FOR_LOADED_PARTICLES, dHeap::work2Heap.heap, true, jpc, jpn); + void *jpn = OarcManager::GetInstance()->getData(name, "dat/jparticle.jpn"); + dParticle::mgr_c::GetInstance()->createResource(dHeap::work2Heap.heap, 1, jpc, jpn); } } } static void *soundCallback(void *arg) { - fn_80362730(ENEMY_SOUND_MGR); + dSndStateMgr_c::GetInstance()->loadStageSound(); return reinterpret_cast(true); } void dStageMgr_c::initializeState_SoundLoadSceneData() { - fn_803624F0(ENEMY_SOUND_MGR); + dSndStateMgr_c::GetInstance()->onStageLoad(); mpDvdCallback = mDvd_callback_c::createOrDie(soundCallback, nullptr); } @@ -195,7 +192,7 @@ void dStageMgr_c::executeState_CreateObject() { void dStageMgr_c::finalizeState_CreateObject() {} static void *soundCallback2(void *arg) { - fn_80365D20(ENEMY_SOUND_MGR); + dSndStateMgr_c::GetInstance()->loadObjectSound(); return reinterpret_cast(true); } @@ -282,7 +279,7 @@ void dStageMgr_c::finalizeState_RestartSceneWait() {} void dStageMgr_c::initializeState_RestartScene() { triggerFade(dScGame_c::nextSpawnInfo.transitionType, dScGame_c::nextSpawnInfo.transitionFadeFrames); mFader.setFadeInType(dScGame_c::nextSpawnInfo.transitionType); - fn_803625F0(ENEMY_SOUND_MGR, mFader.getFadeOutFrame()); + dSndStateMgr_c::GetInstance()->onRestartScene(mFader.getFadeOutFrame()); } void dStageMgr_c::executeState_RestartScene() { diff --git a/src/d/d_tag_processor.cpp b/src/d/d_tag_processor.cpp index fa1cb4e6..5c76e740 100644 --- a/src/d/d_tag_processor.cpp +++ b/src/d/d_tag_processor.cpp @@ -9,6 +9,7 @@ #include "d/lyt/d_lyt_util_items.h" #include "d/lyt/d_textbox.h" #include "d/lyt/msg_window/d_lyt_msg_window.h" +#include "d/snd/d_snd_player_mgr.h" #include "f/f_base.h" #include "f/f_manager.h" #include "f/f_profile_name.h" @@ -22,7 +23,6 @@ #include "nw4r/ut/ut_TextWriterBase.h" #include "sized_string.h" #include "toBeSorted/file_manager.h" -#include "toBeSorted/music_mgrs.h" #include @@ -1572,12 +1572,12 @@ void dTagProcessor_c::somethingWithScrapperAndMusic(wchar_t *src) { if ((ac->profile_name >= fProfile::NPC_SLFB && ac->profile_name <= fProfile::NPC_SLFL) || (ac->profile_name >= fProfile::NPC_SLB && ac->profile_name <= fProfile::FLY_SLB) || ac->profile_name == fProfile::NPC_SLB2 || ac->profile_name == fProfile::NPC_DRBC) { - fn_8035E790(BGM_MGR, dLytMsgWindow_c::getInstance()->getField_0x784(), ac); + dSndPlayerMgr_c::GetInstance()->setMsgActor(dLytMsgWindow_c::getInstance()->getMsgIdx(), ac); return; } } } else if (field_0x824 == 101) { - fn_8035E790(BGM_MGR, dLytMsgWindow_c::getInstance()->getField_0x784(), nullptr); + dSndPlayerMgr_c::GetInstance()->setMsgActor(dLytMsgWindow_c::getInstance()->getMsgIdx(), nullptr); } } diff --git a/src/d/d_textwindow_unk.cpp b/src/d/d_textwindow_unk.cpp index 2eaf8be7..22782a5d 100644 --- a/src/d/d_textwindow_unk.cpp +++ b/src/d/d_textwindow_unk.cpp @@ -9,8 +9,8 @@ #include "d/d_lyt_hio.h" #include "d/lyt/d_textbox.h" #include "d/lyt/msg_window/d_lyt_msg_window.h" +#include "d/snd/d_snd_fi_vocal_mgr.h" #include "m/m_vec.h" -#include "toBeSorted/other_sound_stuff.h" TextWindowUnk::TextWindowUnk(dTagProcessor_c *c) { mpTagProcessor = c; @@ -45,7 +45,7 @@ bool TextWindowUnk::fn_800B2130(const char *label, dTextBox_c *textBox, dLytMsgW mpTextBox, mRawTextBuffer, mUnkBuffer, field_0x1458, &field_0x1478, mpCharacterData ); if (mpTagProcessor->getMsgWindowSubtype() == dLytMsgWindow_c::MSG_WINDOW_SWORD_FI) { - fn_803996B0(lbl_80575DE0, field_0x1402, field_0x1478, mpTagProcessor->getField_0x824()); + dSndFiVocalMgr_c::GetInstance()->fiSpeak(field_0x1402, field_0x1478, mpTagProcessor->getField_0x824()); } } diff --git a/src/d/lyt/d_lyt_game_over.cpp b/src/d/lyt/d_lyt_game_over.cpp index d443bfef..8adc393c 100644 --- a/src/d/lyt/d_lyt_game_over.cpp +++ b/src/d/lyt/d_lyt_game_over.cpp @@ -10,6 +10,7 @@ #include "d/flag/sceneflag_manager.h" #include "d/lyt/d2d.h" #include "d/lyt/d_window.h" +#include "d/snd/d_snd_bgm_mgr.h" #include "d/snd/d_snd_wzsound.h" #include "f/f_base.h" #include "nw4r/lyt/lyt_group.h" @@ -17,7 +18,6 @@ #include "toBeSorted/file_manager.h" #include "toBeSorted/minigame_mgr.h" #include "toBeSorted/misc_actor.h" -#include "toBeSorted/music_mgrs.h" STATE_DEFINE(dLytGameOver_c, Init); STATE_DEFINE(dLytGameOver_c, In); @@ -407,7 +407,7 @@ void dLytGameOverMgr_c::executeState_FadeOut() { if (mMain.requestIn("SYS_GAMEOVER_01", 0, 0)) { mMain.setField_0x1338(true); mStateMgr.changeState(StateID_Select); - AnotherSoundMgr__playSound(FANFARE_SOUND_MGR, FAN_GAMEOVER); + dSndBgmMgr_c::GetInstance()->playFanSound(FAN_GAMEOVER); } } } diff --git a/src/d/lyt/meter/d_lyt_meter_shield_gauge.cpp b/src/d/lyt/meter/d_lyt_meter_shield_gauge.cpp index 7618b0d8..0b2dcdac 100644 --- a/src/d/lyt/meter/d_lyt_meter_shield_gauge.cpp +++ b/src/d/lyt/meter/d_lyt_meter_shield_gauge.cpp @@ -181,13 +181,13 @@ bool dLytMeterShieldGauge_c::execute() { if (mCurrentDurability >= mMaxDurability) { if (field_0x31E) { // Unreachable? - dSndSmallEffectMgr_c::GetInstance()->playSoundWithPitch(SE_S_GAUGE_SHIELD_UP_LV, 1.0f); + dSndSmallEffectMgr_c::GetInstance()->holdSoundWithPitch(SE_S_GAUGE_SHIELD_UP_LV, 1.0f); } dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_GAUGE_SHIELD_UP_MAX); } else { if (field_0x31E) { // Unreachable? - dSndSmallEffectMgr_c::GetInstance()->playSoundWithPitch( + dSndSmallEffectMgr_c::GetInstance()->holdSoundWithPitch( SE_S_GAUGE_SHIELD_UP_LV, mCurrentDurability / mMaxDurability ); } diff --git a/src/d/lyt/msg_window/d_lyt_msg_window.cpp b/src/d/lyt/msg_window/d_lyt_msg_window.cpp index 89e027a5..d43b29d9 100644 --- a/src/d/lyt/msg_window/d_lyt_msg_window.cpp +++ b/src/d/lyt/msg_window/d_lyt_msg_window.cpp @@ -28,6 +28,8 @@ // clang-format on #include "d/d_gfx.h" +#include "d/snd/d_snd_fi_vocal_mgr.h" +#include "d/snd/d_snd_player_mgr.h" #include "d/snd/d_snd_small_effect_mgr.h" #include "f/f_base.h" #include "m/m_fader_base.h" @@ -37,8 +39,6 @@ #include "toBeSorted/d_d3d.h" #include "toBeSorted/event_manager.h" #include "toBeSorted/fi_context.h" -#include "toBeSorted/music_mgrs.h" -#include "toBeSorted/other_sound_stuff.h" #include @@ -120,7 +120,7 @@ bool dLytMsgWindow_c::build() { field_0x778 = 0; field_0x77C = 0; field_0x780 = 0; - field_0x784 = -1; + mMsgIdx = -1; mAlsoEntryPointToTrigger = 0xFFFF; mEntryPointToTrigger = 0xFFFF; @@ -309,7 +309,9 @@ void dLytMsgWindow_c::executeState_OutputText() { if (mpTagProcessor->getMsgWindowSubtype() >= MSG_WINDOW_SWORD_FI && mpTagProcessor->getMsgWindowSubtype() < MSG_WINDOW_SWORD_FI + 3) { - fn_803998A0(lbl_80575DE0, mpMsgWindowUnk->getField_0x147A(), mpMsgWindowUnk->getField_0x147C()); + dSndFiVocalMgr_c::GetInstance()->executeOutputText( + mpMsgWindowUnk->getField_0x147A(), mpMsgWindowUnk->getField_0x147C() + ); } else if (mpTagProcessor->getMsgWindowSubtype() <= MSG_WINDOW_1 && oldValue != mpMsgWindowUnk->getField_0x147A()) { u16 a = mpMsgWindowUnk->getField_0x147C(); f32 b = (dTagProcessor_c::fn_800B8040(0, 0) * 100.0f); @@ -345,7 +347,7 @@ void dLytMsgWindow_c::initializeState_WaitKeyChangePage0() { if (field_0x811 != 0) { field_0x812 = 1; } else if (field_0x814 == 0) { - fn_8035E860(BGM_MGR); + dSndPlayerMgr_c::GetInstance()->enterMsgWait(); } } void dLytMsgWindow_c::executeState_WaitKeyChangePage0() { @@ -360,7 +362,7 @@ void dLytMsgWindow_c::executeState_WaitKeyChangePage0() { allowChange = true; } } else if (dPad::getDownTrigA() || fn_8011A5D0()) { - fn_8035E880(BGM_MGR); + dSndPlayerMgr_c::GetInstance()->leaveMsgWait(); allowChange = true; } @@ -403,7 +405,7 @@ void dLytMsgWindow_c::initializeState_WaitKeyMsgEnd0() { if (field_0x811 != 0) { field_0x812 = 1; } else if (mpTagProcessor->getField_0x90E() == 0 && field_0x814 == 0) { - fn_8035E860(BGM_MGR); + dSndPlayerMgr_c::GetInstance()->enterMsgWait(); } } void dLytMsgWindow_c::executeState_WaitKeyMsgEnd0() { @@ -420,7 +422,7 @@ void dLytMsgWindow_c::executeState_WaitKeyMsgEnd0() { allowChange = true; } } else if (dPad::getDownTrigA() || fn_8011A5D0()) { - fn_8035E880(BGM_MGR); + dSndPlayerMgr_c::GetInstance()->leaveMsgWait(); allowChange = true; } @@ -441,7 +443,7 @@ void dLytMsgWindow_c::executeState_WaitKeyMsgEnd0() { } field_0x810 = 0; } else { - fn_8035E820(BGM_MGR); + dSndPlayerMgr_c::GetInstance()->unsetMsgActor(); if (mpTagProcessor->getField_0x90E() != 0) { mStateMgr.changeState(StateID_WaitKeySelectQuestion); } else { @@ -465,7 +467,7 @@ void dLytMsgWindow_c::executeState_WaitKeyMsgEnd1() { } field_0x810 = 0; } else { - fn_8035E820(BGM_MGR); + dSndPlayerMgr_c::GetInstance()->unsetMsgActor(); if (mpTagProcessor->getField_0x90E() != 0) { mStateMgr.changeState(StateID_WaitKeySelectQuestion); } else if (field_0x817 == 0) { diff --git a/src/d/lyt/msg_window/d_lyt_msg_window_select_btn.cpp b/src/d/lyt/msg_window/d_lyt_msg_window_select_btn.cpp index e4973458..23b4ce88 100644 --- a/src/d/lyt/msg_window/d_lyt_msg_window_select_btn.cpp +++ b/src/d/lyt/msg_window/d_lyt_msg_window_select_btn.cpp @@ -4,8 +4,8 @@ #include "d/d_pad.h" #include "d/d_pad_nav.h" #include "d/lyt/d2d.h" +#include "d/snd/d_snd_player_mgr.h" #include "d/snd/d_snd_small_effect_mgr.h" -#include "toBeSorted/music_mgrs.h" STATE_DEFINE(dLytMsgWindowSelectBtnParts_c, Wait); STATE_DEFINE(dLytMsgWindowSelectBtnParts_c, On); @@ -302,7 +302,7 @@ void dLytMsgWindowSelectBtn_c::finalizeState_In() { void dLytMsgWindowSelectBtn_c::initializeState_WaitSelect() { if (field_0x9D0 == 0) { field_0x9D0 = true; - fn_8035E860(BGM_MGR); + dSndPlayerMgr_c::GetInstance()->enterMsgWait(); } mBtnHelper.fn_8011C970(); @@ -340,7 +340,7 @@ void dLytMsgWindowSelectBtn_c::executeState_WaitSelect() { } else { dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_TALK_CURSOR_OK); } - fn_8035E880(BGM_MGR); + dSndPlayerMgr_c::GetInstance()->leaveMsgWait(); } else if (dPad::getDownTrigB()) { f32 f = mBtnHelper.fn_8011D690(field_0x9BC); // TODO @@ -353,7 +353,7 @@ void dLytMsgWindowSelectBtn_c::executeState_WaitSelect() { } else { dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_TALK_CURSOR_OK); } - fn_8035E880(BGM_MGR); + dSndPlayerMgr_c::GetInstance()->leaveMsgWait(); } } void dLytMsgWindowSelectBtn_c::finalizeState_WaitSelect() {} diff --git a/src/d/snd/d_snd_3d_actor.cpp b/src/d/snd/d_snd_3d_actor.cpp index e304d296..913afbd7 100644 --- a/src/d/snd/d_snd_3d_actor.cpp +++ b/src/d/snd/d_snd_3d_actor.cpp @@ -4,51 +4,47 @@ #include "d/a/d_a_player.h" #include "d/snd/d_snd_3d_manager.h" #include "d/snd/d_snd_checkers.h" +#include "d/snd/d_snd_mgr.h" #include "d/snd/d_snd_player_mgr.h" +#include "d/snd/d_snd_state_mgr.h" #include "nw4r/math/math_types.h" #include -dSnd3DActor_c::dSnd3DActor_c(dSndSourceParam *pSourceParam, u8 sourceType) +dSnd3DActor_c::dSnd3DActor_c(dSndSourceParam *pSourceParam, s32 sourceType) : nw4r::snd::Sound3DActor( - dSndPlayerMgr_c::GetInstance()->getSoundArchivePlayerForType(sourceType), dSnd3DManager_c::GetInstance()->getManager() + dSndPlayerMgr_c::GetInstance()->getSoundArchivePlayerForType(sourceType), + dSnd3DManager_c::GetInstance()->getManager() ), a_field_0x7D(0), - a_field_0x7E(0), - a_field_0x7F(0), - a_field_0x80(0), + mIsDisabled(false), + mIsDemoActor(false), + mIsPaused(false), a_field_0x84(0.0f), a_field_0x88(0.0f), a_field_0x8C(0.0f), a_field_0x90(INFINITY), mDistanceToListener(INFINITY), mCameraDirectionDot(0.0f), - a_field_0x9C(0.0f), + mSpeed(0.0f), mpSourceParam(pSourceParam), mFlags(0), mDistanceToPlayer(INFINITY), - a_field_0xE0(0.0f) { + mFxSend3D(0.0f) { resetCachedRelativePositions(); // Portability hazard SetUserParam(reinterpret_cast(this)); - if (dSndPlayerMgr_c::GetInstance()->canUseThisPlayer(sourceType)) { - a_field_0x7F = 1; + if (dSndPlayerMgr_c::GetInstance()->shouldUseDemoPlayer(sourceType)) { + mIsDemoActor = true; } } -void dSnd3DActor_c::d_vt_0x34(const nw4r::math::VEC3 &rPosition) { +void dSnd3DActor_c::setPosition(const nw4r::math::VEC3 &rPosition) { SetPosition(rPosition); - // TODO - 0xE0 + mFxSend3D = dSndStateMgr_c::GetInstance()->getFxSend3D(); mFlags = 0; } -void dSnd3DActor_c::updatePositionRelativeToListener() { - if (!checkFlag(0x1)) { - calculatePositionRelativeToListener(); - setFlag(0x1); - } -} - void dSnd3DActor_c::resetCachedRelativePositions() { mPositionRelativeToPlayer.x = INFINITY; mPositionRelativeToPlayer.y = INFINITY; @@ -63,6 +59,17 @@ void dSnd3DActor_c::resetCachedRelativePositions() { mPositionTransformedByListener.z = INFINITY; } +void dSnd3DActor_c::setSourceParam(const dSndSourceParam *param) { + *mpSourceParam = *param; +} + +void dSnd3DActor_c::updatePositionRelativeToListener() { + if (!checkFlag(0x1)) { + calculatePositionRelativeToListener(); + setFlag(0x1); + } +} + void dSnd3DActor_c::calculatePositionRelativeToListener() { nw4r::math::VEC3Sub( &mPositionRelativeToListener, &GetPosition(), &dSnd3DManager_c::GetInstance()->getSndListenerPos() @@ -91,7 +98,7 @@ void dSnd3DActor_c::updateCameraDirectionDot() { updatePositionRelativeToListener(); nw4r::math::VEC3 norm; VECNormalize(mPositionRelativeToListener, norm); - mCameraDirectionDot = nw4r::math::VEC3Dot(&norm, dSnd3DManager_c::GetInstance()->getNrmCameraDirection()); + mCameraDirectionDot = nw4r::math::VEC3Dot(&norm, &dSnd3DManager_c::GetInstance()->getNrmCameraDirection()); setFlag(0x20); } } @@ -105,7 +112,7 @@ void dSnd3DActor_c::updatePositionRelativeToCameraTarget() { void dSnd3DActor_c::calculatePositionRelativeToCameraTarget() { nw4r::math::VEC3Sub( - &mPositionRelativeToCameraTarget, &GetPosition(), dSnd3DManager_c::GetInstance()->getCameraTargetPos() + &mPositionRelativeToCameraTarget, &GetPosition(), &dSnd3DManager_c::GetInstance()->getCameraTargetPos() ); } @@ -172,3 +179,15 @@ bool dSnd3DActor_c::isPlayingSound(u32 id) { return result; } + +u32 dSnd3DActor_c::soundLabelToSoundId(const char *soundLabel) const { + return dSndPlayerMgr_c::GetInstance()->convertLabelStringToSoundId(soundLabel); +} + +const char *dSnd3DActor_c::soundIdToSoundLabel(u32 soundId) const { + if (mIsDemoActor) { + return dSndPlayerMgr_c::GetInstance()->getDemoArchiveDirectly()->GetSoundLabelString(soundId); + } else { + return dSndMgr_c::getSoundLabelString(soundId); + } +} diff --git a/src/d/snd/d_snd_3d_manager.cpp b/src/d/snd/d_snd_3d_manager.cpp index ec1d91ce..1cf5610b 100644 --- a/src/d/snd/d_snd_3d_manager.cpp +++ b/src/d/snd/d_snd_3d_manager.cpp @@ -2,12 +2,12 @@ #include "d/snd/d_snd_3d_engine.h" #include "d/snd/d_snd_mgr.h" +#include "d/snd/d_snd_state_mgr.h" #include "egg/math/eggMatrix.h" #include "egg/math/eggVector.h" #include "nw4r/math/math_arithmetic.h" #include "nw4r/math/math_types.h" #include "nw4r/snd/snd_SoundArchive.h" -#include "toBeSorted/music_mgrs.h" SND_DISPOSER_DEFINE(dSnd3DManager_c); @@ -74,13 +74,13 @@ void dSnd3DManager_c::updateFromCamera(EGG::LookAtCamera &camera) { } f32 dist = 0.5f; - if (fn_80364DA0(ENEMY_SOUND_MGR)) { + if (dSndStateMgr_c::GetInstance()->isInEvent()) { dist = mCamDistance; f32 prevCameraAtSqVelocity = mCameraAtSqVelocity; f32 prevCameraPosSqVelocity = mCameraPosSqVelocity; mCameraAtSqVelocity = VECSquareDistance(camera.mAt, mCamera.mAt); mCameraPosSqVelocity = VECSquareDistance(camera.mPos, mCamera.mPos); - if (((u32 *)ENEMY_SOUND_MGR)[71] > 30) { + if (dSndStateMgr_c::GetInstance()->getFrameCounter() > 30) { bool bigMovement = false; bool hugeMovement = false; if (mTimer > 0) { @@ -115,7 +115,7 @@ void dSnd3DManager_c::updateFromCamera(EGG::LookAtCamera &camera) { } if (bigMovement) { - fn_80364D00(ENEMY_SOUND_MGR, -1); + dSndStateMgr_c::GetInstance()->onCameraCut(-1); mTimer = 30; } } diff --git a/src/d/snd/d_snd_actor.cpp b/src/d/snd/d_snd_actor.cpp index 114bb03f..fdd30ddd 100644 --- a/src/d/snd/d_snd_actor.cpp +++ b/src/d/snd/d_snd_actor.cpp @@ -7,6 +7,6 @@ dSndActor_c::dSndActor_c(nw4r::snd::SoundArchivePlayer &rStartable) : nw4r::snd::SoundActor(rStartable) {} void dSndActor_c::doesSomethingWithForeachSound() { - SoundPropertiesChecker checker; + SoundPropertiesChecker checker(-1); ForEachSound(checker, false); } diff --git a/src/d/snd/d_snd_anim_sound.cpp b/src/d/snd/d_snd_anim_sound.cpp new file mode 100644 index 00000000..f3638966 --- /dev/null +++ b/src/d/snd/d_snd_anim_sound.cpp @@ -0,0 +1,73 @@ +#include "d/snd/d_snd_anim_sound.h" + +#include "common.h" +#include "d/snd/d_snd_source.h" + +#include + +dSndAnimSound_c::dSndAnimSound_c(dSoundSource_c *source) + : mSound(*source), mpData(nullptr), mRate(1.0f), field_0x98(INFINITY), mNeedFrameReset(false) {} + +void dSndAnimSound_c::setData(const void *data, const char *name) { + mDirection = nw4r::snd::AnimSound::FORWARD; + mRate = 1.0f; + if (data == mpData) { + return; + } + + mpData = data; + if (mpData != nullptr) { + mNeedFrameReset = true; + mSound.Setup(data); + } else { + mSound.Shutdown(); + } +} + +void dSndAnimSound_c::setFrame(f32 frame) { + if (mpData == nullptr) { + mSound.Shutdown(); + return; + } + if (frame >= mSound.GetAnimDuration()) { + return; + } + if (mNeedFrameReset) { + if (frame <= field_0x98) { + mSound.ResetFrame(0.0f, 0); + } else { + mSound.ResetFrame(frame, 0); + } + mNeedFrameReset = false; + } + mSound.UpdateFrame(frame, mDirection); +} + +void dSndAnimSound_c::setRate(f32 rate) { + if (rate < 0.0f) { + mDirection = nw4r::snd::AnimSound::BACKWARD; + } else { + mDirection = nw4r::snd::AnimSound::FORWARD; + } + mRate = rate; +} + +void dSndAnimSound_c::resetFrame(f32 frame) { + if (mpData == nullptr || mSound.GetAnimDuration() <= frame) { + return; + } + mNeedFrameReset = false; + mSound.ResetFrame(frame, 0); +} + +void dSndAnimSound_c::animCallback(int, s32, const char *, UNKWORD arg, void *userData) { + reinterpret_cast(userData)->onAnimSoundEvent(arg); +} + +void dSndAnimSound_c::setCallback(dSoundSource_c *source) { + mSound.SetCallback(&animCallback, source); +} + +void dSndAnimSound_c::setCallback(nw4r::snd::AnimSound::Callback cb, void *userData) { + mSound.SetCallback(cb, userData); +} diff --git a/src/d/snd/d_snd_area_sound_effect_mgr.cpp b/src/d/snd/d_snd_area_sound_effect_mgr.cpp index 95114462..e574175d 100644 --- a/src/d/snd/d_snd_area_sound_effect_mgr.cpp +++ b/src/d/snd/d_snd_area_sound_effect_mgr.cpp @@ -2,24 +2,65 @@ #include "common.h" #include "d/d_sc_game.h" +#include "d/snd/d_snd_checkers.h" +#include "d/snd/d_snd_control_player_mgr.h" #include "d/snd/d_snd_mgr.h" #include "d/snd/d_snd_player_mgr.h" +#include "d/snd/d_snd_state_mgr.h" #include "d/snd/d_snd_util.h" +#include "d/snd/d_snd_wzsound.h" +#include "nw4r/snd/snd_SoundPlayer.h" #include "nw4r/snd/snd_SoundStartable.h" SND_DISPOSER_DEFINE(dSndAreaSoundEffectMgr_c); dSndAreaSoundEffectMgr_c::dSndAreaSoundEffectMgr_c() - : field_0x328(0), - field_0x32C(1.0f), - field_0x330(1.0f), - mActor(*dSndMgr_c::GetInstance()->getPlayer()), - field_0x388(1.0f) {} + : field_0x32C(1.0f), field_0x330(1.0f), mActor(dSndMgr_c::GetInstance()->getPlayer()), mTargetVolume(1.0f) {} void dSndAreaSoundEffectMgr_c::calc() { for (int i = 0; i < 3; i++) { mSounds[i].calc(); } + calcPlayerVolume(); + calcActorVolume(); +} + +void dSndAreaSoundEffectMgr_c::calcPlayerVolume() { + if (dSndStateMgr_c::GetInstance()->checkEventFlag(dSndStateMgr_c::EVENT_MUTE_STAGE_EFFECTS_FULL)) { + dSndControlPlayerMgr_c::GetInstance()->setStageEffectsMuteVolume(0.0f); + } else if (dSndStateMgr_c::GetInstance()->checkEventFlag(dSndStateMgr_c::EVENT_MUTE_STAGE_EFFECTS_PARTIAL)) { + dSndControlPlayerMgr_c::GetInstance()->setStageEffectsMuteVolume(0.3f); + } + + if (dSndPlayerMgr_c::GetInstance()->checkFlag(dSndPlayerMgr_c::MGR_PAUSE)) { + dSndControlPlayerMgr_c::GetInstance()->setStageEffectsMuteVolume(0.3f); + } + + if (dSndStateMgr_c::GetInstance()->checkFlag0x258(0x04)) { + dSndControlPlayerMgr_c::GetInstance()->setStageEffectsMuteVolume(0.3f); + } +} + +void dSndAreaSoundEffectMgr_c::calcActorVolume() { + // TODO - FPR regswap + f32 volume = mActor.GetVolume(); + f32 target = mTargetVolume; + if (volume != target) { + if (volume - target > 0.05f) { + volume -= 0.05f; + } else if (target - volume > 0.05f) { + volume += 0.05f; + } + + if (volume < 0.0f) { + volume = 0.0f; + } else if (volume > 2.0f) { + volume = 2.0f; + } + mActor.SetVolume(volume); + setTgSoundVolume(volume, 0); + } + mTargetVolume = 1.0f; } bool dSndAreaSoundEffectMgr_c::startSound(u32 soundId, u32 handleIdx) { @@ -40,7 +81,7 @@ bool dSndAreaSoundEffectMgr_c::startSound(u32 soundId, u32 handleIdx) { } dSndAreaSound_c *snd = &mSounds[handleIdx]; - nw4r::snd::SoundStartable::StartResult res = mActor.detail_StartSound(snd, soundId, nullptr); + nw4r::snd::SoundStartable::StartResult res = mActor.StartSoundReturnStatus(snd, soundId, nullptr); if (res == nw4r::snd::SoundStartable::START_SUCCESS) { snd->fadeIn(soundId, 30); } @@ -50,6 +91,41 @@ bool dSndAreaSoundEffectMgr_c::startSound(u32 soundId, u32 handleIdx) { return res; } +bool dSndAreaSoundEffectMgr_c::holdInWaterLvSound(f32 depth) { + if (depth <= 0) { + return false; + } + + // TODO: Ugh, maybe convert the enums to unsigned ints? + bool ret = dSndMgr_c::GetInstance()->holdSound(&mInWaterLvHandle, (unsigned int)SE_A_IN_WATER_LV); + if (ret) { + f32 volume = 1.0f; + if (depth < 600.0f) { + volume = (depth / 600.0f) * 0.5f + 0.5f; + } + mInWaterLvHandle.SetVolume(volume, 0); + } + + f32 otherVolume = 0.0f; + if (depth < 300.0f) { + otherVolume = (depth * -0.7f) / 300.0f + 0.7f; + if (otherVolume < 0.0f) { + otherVolume = 0.0f; + } + } + mTargetVolume *= otherVolume; + + return ret; +} + +void dSndAreaSoundEffectMgr_c::onEventStart() { + // no-op +} + +void dSndAreaSoundEffectMgr_c::onEventEnd() { + // no-op +} + void dSndAreaSoundEffectMgr_c::stopSounds(s32 fadeFrames) { for (u32 i = 0; i < 3; i++) { mSounds[i].stop(fadeFrames); @@ -73,3 +149,18 @@ bool dSndAreaSoundEffectMgr_c::isPlayingSound(u32 soundId) const { } return false; } + +void dSndAreaSoundEffectMgr_c::setTgSoundVolume(f32 volume, s32 fadeFrames) { + nw4r::snd::SoundPlayer *player = + dSndControlPlayerMgr_c::GetInstance()->getPlayer1(dSndPlayerMgr_c::PLAYER_TG_SOUND); + SoundVolumeSetter setter; + setter.mFadeFrames = fadeFrames; + if (volume > 1.0f) { + volume = 1.0f; + } else if (volume < 0.0f) { + volume = 0.0f; + } + setter.mVolume = volume; + + player->ForEachSound(setter, false); +} diff --git a/src/d/snd/d_snd_bgm_harp_data.cpp b/src/d/snd/d_snd_bgm_harp_data.cpp new file mode 100644 index 00000000..1479eee5 --- /dev/null +++ b/src/d/snd/d_snd_bgm_harp_data.cpp @@ -0,0 +1,165 @@ +#include "d/snd/d_snd_bgm_harp_data.h" + +#include "common.h" +#include "nw4r/snd/snd_SeqSoundHandle.h" + +dSndBgmDataHarpVarSetBase_c::dSndBgmDataHarpVarSetBase_c(s32 count) { + mPosition = -1; + mMax = count; + mCount = 0; + mpVars = new dSndBgmDataHarpVar_c[count]; + resetVars(); +} + +dSndBgmDataHarpVarSetBase_c::~dSndBgmDataHarpVarSetBase_c() { + delete[] mpVars; +} + +void dSndBgmDataHarpVarSetBase_c::resetVars() { + mCount = 0; + mPosition = -1; + for (int i = 0; i < mMax; i++) { + mpVars[i].reset(); + } +} + +void dSndBgmDataHarpVarSetBase_c::addVar(u8 value) { + if (mCount < mMax) { + mpVars[mCount].field_0x01 = value; + mCount++; + } +} + +dSndBgmHarpDataBase_c::dSndBgmHarpDataBase_c() : mMax(0), mCount(0), field_0x08(0) {} + +void dSndBgmHarpDataBase_c::resetVars() { + mCount = 0; + field_0x08 = 0; + for (int i = 0; i < mMax; i++) { + mpVarSets[i].resetVars(); + } +} + +s32 dSndBgmHarpDataBase_c::getIdxForPosition(s32 position) { + if (position < 0) { + return 0; + } + if (mpVarSets[0].getPosition() > position) { + return 0; + } + + for (int i = mCount - 1; i > 0; i--) { + if (mpVarSets[i].getPosition() <= position) { + return i; + } + } + + return 0; +} + +void dSndBgmHarpDataBase_c::addVar(s32 position, s32 value, s32 unk) { + if (position < 0) { + return; + } + + if (value <= 0) { + return; + } + + if (field_0x08 > 0) { + return; + } + + if (mCount > mMax) { + return; + } + + // Look at the set that might not be full yet + dSndBgmDataHarpVarSetBase_c *set = getVarSet(mCount); + if (set->getPosition() >= 0 && set->getPosition() < position) { + // If it's not full but it doesn't match the position, + // advance either way + set++; + mCount++; + } + + // Set position for new set + if (set->getPosition() < 0) { + // Make sure set positions are strictly monotonically increasing (1), + // do not record e.g. a fifth value for the same set + if (mCount > 0 && set[-1].getPosition() >= position) { + return; + } + set->setPosition(position); + } + + dSndBgmDataHarpVar_c *var = set->getUnusedVar(); + if (var != nullptr) { + if (unk == 0x7F) { + var->onFlag(); + } + set->addVar(value); + + if (set->getCount() >= set->getMax()) { + // If the set is full, continue with the next set. + // Condition (1) above will make sure that the next + // set gets a strictly higher position, so there are + // no sets with the same position. + mCount++; + } + } +} + +void dSndBgmHarpDataBase_c::setField_0x08(s32 value) { + if (value < 0) { + value = 0; + } + field_0x08 = value; +} + +dSndBgmDataHarpVarSetBase_c *dSndBgmHarpDataBase_c::getUsableVarSet(s32 idx) { + if (idx < 0) { + return nullptr; + } + + if (idx >= mCount) { + return nullptr; + } + + return &mpVarSets[idx]; +} + +dSndBgmDataHarpVarSetBase_c *dSndBgmHarpDataBase_c::getVarSet(s32 idx) { + if (idx < 0) { + return nullptr; + } + + if (idx >= mMax) { + return nullptr; + } + + return &mpVarSets[idx]; +} + +dSndBgmHarpData_c::dSndBgmHarpData_c() { + mpVarSets = new dSndBgmDataHarpVarSet_c[NUM_SETS]; + mMax = NUM_SETS; + resetVars(); +} + +dSndBgmHarpData_c::~dSndBgmHarpData_c() { + delete[] mpVarSets; +} + +void dSndBgmHarpData_c::writeSeqVars(s32 idx) { + if (idx < 0) { + return; + } + if (idx >= mCount) { + return; + } + + for (int i = 0; i < mpVarSets[idx].getCount(); i++) { + nw4r::snd::SeqSoundHandle::WriteGlobalVariable(10 + i, mpVarSets[idx].getVar(i)->field_0x01); + } +} diff --git a/src/d/snd/d_snd_bgm_mgr.cpp b/src/d/snd/d_snd_bgm_mgr.cpp new file mode 100644 index 00000000..029e4c59 --- /dev/null +++ b/src/d/snd/d_snd_bgm_mgr.cpp @@ -0,0 +1,627 @@ +#include "d/snd/d_snd_bgm_mgr.h" + +#include "common.h" +#include "d/flag/storyflag_manager.h" +#include "d/snd/d_snd_bgm_sound_battle.h" +#include "d/snd/d_snd_bgm_sound.h" +#include "d/snd/d_snd_mgr.h" +#include "d/snd/d_snd_bgm_mml_parsers.h" +#include "d/snd/d_snd_player_mgr.h" +#include "d/snd/d_snd_sound.h" +#include "d/snd/d_snd_state_mgr.h" +#include "d/snd/d_snd_util.h" +#include "d/snd/d_snd_wzsound.h" +#include "nw4r/snd/snd_SoundArchive.h" +#include "nw4r/ut/ut_list.h" + +bool dSndBgmMgr_c::isSoundPlayedByBgmBattlePlayer(u32 soundId) { + if (soundId == -1) { + return false; + } + + return dSndMgr_c::getPlayerId(soundId) == dSndPlayerMgr_c::PLAYER_BGM_BATTLE; +} + +bool dSndBgmMgr_c::isBgmBattle2(u32 soundId) { + return soundId == BGM_BATTLE2; +} + +SND_DISPOSER_DEFINE(dSndBgmMgr_c); + +dSndBgmMgr_c::dSndBgmMgr_c() + : field_0x240(2), + field_0x244(0), + field_0x248(0), + mScheduledSoundId(-1), + mScheduledSoundDelay(0), + mpPrevActiveBgmSound(nullptr), + field_0x29C(0), + mSoundActor(dSndMgr_c::GetInstance()->getPlayer()), + field_0x2F4(1.0f), + mBgmToPlayOnEventEnd(-1), + field_0x2FC(0), + field_0x300(-1), + field_0x304(0), + field_0x305(0), + field_0x306(0), + field_0x307(0), + field_0x308(0), + field_0x333(0), + field_0x340(0) { + for (int i = 0; i < BGM_LIST_MAX; i++) { + // TODO offsetof + nw4r::ut::List_Init(&mBgmSoundLists[i], 0xF0); + } + + for (int i = 0; i < 7; i++) { + if (i == 4) { + mBgmSounds[i] = new dSndBgmBattleSound_c(); + } else { + mBgmSounds[i] = new dSndBgmSound_c(); + } + mBgmSounds[i]->init(mSoundActor, i); + } + + mpBgmMuteSound = new dSndBgmSound_c(); + mpBgmMuteSound->init(dSndMgr_c::GetInstance()->getPlayer(), 8); + + for (int i = 0; i < 3; i++) { + mFanSounds[i] = new dSndSound_c(); + } + + nw4r::ut::List_Init(&mAllSoundsList, 8); + + for (int i = 0; i < 3; i++) { + field_0x30C[i] = 0; + field_0x318[i] = 0; + field_0x324[i] = 0; + field_0x330[i] = 0; + } +} + +void dSndBgmMgr_c::calcLists() { + dSndBgmSound_c *snd = getActiveBgmSound_i(); + if (snd != nullptr) { + if (snd != mpPrevActiveBgmSound) { + snd->onBecomeActive(); + } + snd->applyVars(); + } + mpPrevActiveBgmSound = snd; + + dSndBgmSound_c *next, *it; + for (it = getFirstInBgmSoundList(BGM_LIST_PLAYING); it != nullptr; it = next) { + next = getNextInBgmSoundList(BGM_LIST_PLAYING, it); + it->calc(); + } + + for (it = getFirstInBgmSoundList(BGM_LIST_STOPPING); it != nullptr; it = next) { + next = getNextInBgmSoundList(BGM_LIST_STOPPING, it); + it->calc(); + } + + for (it = getFirstInBgmSoundList(BGM_LIST_PREPARING); it != nullptr; it = next) { + next = getNextInBgmSoundList(BGM_LIST_PREPARING, it); + if (!it->IsAttachedSound()) { + it->cancel(); + removeFromAllBgmSoundLists(it); + } + } + + { + dSndSound_c *next, *it; + for (it = getAllSoundsFirst(); it != nullptr; it = next) { + next = getAllSoundsNext(it); + if (!it->IsAttachedSound()) { + unregistSound(it); + } + } + } +} + +void dSndBgmMgr_c::loadStageSound() { + for (int i = 0; i < 3; i++) { + field_0x30C[i] = nullptr; + field_0x318[i] = 0; + field_0x324[i] = 0; + field_0x330[i] = 0; + } + + if (dSndStateMgr_c::GetInstance()->isInDemo()) { + return; + } + + if (dSndStateMgr_c::isInStage("F103")) { + // Flooded Faron Woods + if (!StoryflagManager::sInstance->getFlag(18)) { + bool ok = true; + if (!dSndPlayerMgr_c::GetInstance()->isLoadedFileForSound(TAG_BGM_EVENT_COMP_NOTE)) { + ok = dSndPlayerMgr_c::GetInstance()->loadFileForSound(TAG_BGM_EVENT_COMP_NOTE); + } + + if (ok) { + dSndBgmMmlParserTagCompNote_c parser; + parser.parseData(&field_0x30C[0]); + field_0x324[0] = field_0x30C[0]->data[0]; + } + } + } else if (dSndStateMgr_c::isInStage("F403") && dSndStateMgr_c::GetInstance()->getLayer() == 1) { + bool ok = true; + if (!dSndPlayerMgr_c::GetInstance()->isLoadedFileForSound(TAG_BGM_BATTLE_CROWD)) { + ok = dSndPlayerMgr_c::GetInstance()->loadFileForSound(TAG_BGM_BATTLE_CROWD); + } + + if (ok) { + dSndBgmMmlParserTagBattle_c parser; + parser.parseData(TAG_BGM_BATTLE_CROWD, &field_0x30C[0]); + field_0x324[0] = field_0x30C[0]->data[0]; + } + } else { + if (dSndPlayerMgr_c::GetInstance()->isLoadedFileForSound(TAG_BGM_BOSS_A)) { + bool ok = true; + // I am REALLY not sure how TAG_BGM_BOSS_A could spontaneously unload here but better + // double check I guess + if (!dSndPlayerMgr_c::GetInstance()->isLoadedFileForSound(TAG_BGM_BOSS_A)) { + // TODO types + ok = dSndMgr_c::GetInstance()->loadGroup((unsigned int)GRP_BGM_BOSS_A, nullptr, 0); + } + if (ok) { + dSndBgmMmlParserTagBgmBoss_c parser1; + parser1.parseData(&field_0x30C[0], &field_0x30C[1]); + } + + if (ok) { + dSndBgmMmlParserTagBattle_c parser; + parser.parseData(TAG_BGM_BOSS_A_CHANCE, &field_0x30C[2]); + } + } + } +} + +void dSndBgmMgr_c::startBgmMuteSound() { + if (mpBgmMuteSound != nullptr) { + mpBgmMuteSound->stop(0); + mpBgmMuteSound->startBgmSound(BGM_MUTE, 0, 0); + } +} + +bool dSndBgmMgr_c::prepareBgm(u32 soundId, u32 startOffset) { + if (isPlayingBgmSoundId(soundId)) { + return false; + } + dSndBgmSound_c *handle = getSoundHandleForBgm(soundId, startOffset); + bool ret = false; + if (handle != nullptr) { + ret = prepareBgmSound(soundId, handle, startOffset); + } + startAdditionalBgm(soundId); + return ret; +} + +void dSndBgmMgr_c::stopAllBgm(s32 fadeFrames) { + for (int i = 0; i < 7; i++) { + stopBgmSound(mBgmSounds[i], fadeFrames); + } + cancelDelayedBgm(); +} + +bool dSndBgmMgr_c::stopBgmSound(dSndBgmSound_c *sound, s32 fadeFrames) { + u32 oldId = sound->GetId(); + if (oldId != -1) { + sound->stop(fadeFrames); + checkForPrepareStoppedBgmSound(oldId); + return true; + } + + return false; +} + +void dSndBgmMgr_c::endBgmMuteSound() { + mpBgmMuteSound->stop(0); +} + +void dSndBgmMgr_c::checkForPrepareStoppedBgmSound(u32 stoppedSoundId) { + // TODO ??? + u32 id = stoppedSoundId == BGM_SKYFIELD ? BGM_SKYFIELD : -1; + if (id != -1) { + prepareBgm(id, 0); + } +} + +bool dSndBgmMgr_c::beginBgmBattleMainLoop() { + return getBgmBattleSound()->startMainBattleLoop(); +} + +bool dSndBgmMgr_c::beginBgmBattleRoom() { + if (isBgmHandleIdxPlayingSoundId(4, BGM_BATTLE_ROOM_MAIN)) { + return false; + } + + return playBattleBgm(BGM_BATTLE_ROOM_MAIN, true); +} + +bool dSndBgmMgr_c::endBgmBattleRoom() { + if (!isBgmHandleIdxPlayingSoundId(4, BGM_BATTLE_ROOM_MAIN)) { + return false; + } + + stopBgmHandleIdx(4, 5); + return playFanSound(BGM_BATTLE_ROOM_OUTRO); +} + +bool dSndBgmMgr_c::weirdCheckAlwaysFalse() { + u32 soundId = getBgmBattleSound()->GetId(); + bool ok = false; + // @bug should be != -1 + if (soundId != 0) { + if (getBgmBattleSound()->isPlaying()) { + ok = true; + } + } + // @bug passes a boolean to a function expecting a sound ID. + // function only returns true if sound ID is 0x1585, so this + // always returns false + return isBgmBattle2(ok); +} + +void dSndBgmMgr_c::playDelayedSound(u32 soundId, s32 delay) { + if (soundId == -1) { + return; + } + + u32 playerId = dSndMgr_c::getPlayerId(soundId); + + switch (playerId) { + case dSndPlayerMgr_c::PLAYER_BGM: + case dSndPlayerMgr_c::PLAYER_BGM_BATTLE: + if (delay == 0) { + playBgm(soundId, 0, false); + return; + } + prepareBgm(soundId, 0); + break; + case dSndPlayerMgr_c::PLAYER_FAN: + if (delay == 0) { + playFanSound(soundId); + return; + } + prepareFanSound(soundId); + break; + default: return; + } + mScheduledSoundId = soundId; + mScheduledSoundDelay = delay; +} + +void dSndBgmMgr_c::cancelDelayedSound() { + mScheduledSoundId = -1; + mScheduledSoundDelay = 0; +} + +void dSndBgmMgr_c::cancelDelayedBgm() { + if (mScheduledSoundId == -1) { + return; + } + + nw4r::snd::SoundArchive::SoundInfo info; + u32 playerId = dSndMgr_c::getPlayerId(mScheduledSoundId); + + if (dSndPlayerMgr_c::isBgmPlayerId(playerId)) { + cancelDelayedSound(); + } +} + +bool dSndBgmMgr_c::startDelayedSound() { + if (mScheduledSoundId == -1) { + return false; + } + + bool ok = false; + + u32 playerId = dSndMgr_c::getPlayerId(mScheduledSoundId); + switch (playerId) { + case dSndPlayerMgr_c::PLAYER_BGM: + case dSndPlayerMgr_c::PLAYER_BGM_BATTLE: ok = playBgm(mScheduledSoundId, 0, false); break; + case dSndPlayerMgr_c::PLAYER_FAN: ok = playFanSound(mScheduledSoundId); break; + default: break; + } + + cancelDelayedSound(); + return ok; +} + +void dSndBgmMgr_c::calcDelayedSound() { + if (mScheduledSoundId == -1) { + return; + } + + mScheduledSoundDelay--; + if (mScheduledSoundDelay == 0) { + startDelayedSound(); + } +} + +// 8036e980 - plays additional music for some reason. +// e.g. Sandship (BGM_D301 / 0x1607) also prepares BGM_D301_INSIDE / 0x1608 + +void dSndBgmMgr_c::setBgmHandleIdxVolume(u32 handleIdx, f32 volume, s32 fadeFrames) { + // Using the getter to check validity but then not using the result is a bit weird + if (getBgmSoundByIndex(handleIdx) != nullptr) { + mBgmSounds[handleIdx]->setVolume(volume, fadeFrames); + } +} + +void dSndBgmMgr_c::setBgmToPlayOnEventEnd(u32 soundId) { + if (soundId != -1) { + prepareBgm(soundId, 0); + mBgmToPlayOnEventEnd = soundId; + } +} + +bool dSndBgmMgr_c::onEventEnd() { + bool ret = false; + if (mBgmToPlayOnEventEnd != -1) { + ret = playBgm(mBgmToPlayOnEventEnd, 0, false); + mBgmToPlayOnEventEnd = -1; + } + return ret; +} + +bool dSndBgmMgr_c::isPlayingBgmSound() const { + for (int i = 0; i < 7; i++) { + if (mBgmSounds[i]->isPlaying()) { + return true; + } + } + return false; +} + +bool dSndBgmMgr_c::isPlayingBgmSoundId(u32 soundId) const { + for (int i = 0; i < 7; i++) { + if (mBgmSounds[i]->isPlayingSoundId(soundId)) { + return true; + } + } + return false; +} + +bool dSndBgmMgr_c::isFadingOutBgmSoundId(u32 soundId) const { + for (int i = 0; i < 7; i++) { + if (mBgmSounds[i]->GetId() == soundId && mBgmSounds[i]->isFadingOut()) { + return true; + } + } + return false; +} + +bool dSndBgmMgr_c::isPreparingBgmSoundId(u32 soundId) const { + for (int i = 0; i < 7; i++) { + if (mBgmSounds[i]->isPreparingSoundId(soundId)) { + return true; + } + } + return false; +} + +bool dSndBgmMgr_c::isPreparingBgmSoundIdWithStartOffset(u32 soundId, u32 startOffset) const { + for (int i = 0; i < 7; i++) { + if (mBgmSounds[i]->isPreparingSoundIdWithStartOffset(soundId, startOffset)) { + return true; + } + } + return false; +} + +bool dSndBgmMgr_c::isPreparedBgmSoundId(u32 soundId) const { + for (int i = 0; i < 7; i++) { + if (mBgmSounds[i]->isPreparedSoundId(soundId)) { + return true; + } + } + return false; +} + +dSndBgmSound_c *dSndBgmMgr_c::getBgmSoundByIndex(u32 idx) { + if (idx >= 7) { + return nullptr; + } + return mBgmSounds[idx]; +} + +dSndBgmSound_c *dSndBgmMgr_c::getBgmSoundHandleForId(u32 soundId) const { + for (int i = 0; i < 7; i++) { + dSndBgmSound_c *snd = mBgmSounds[i]; + if (snd->isPlayingSoundId(soundId)) { + return snd; + } + } + return nullptr; +} + +dSndBgmSound_c *dSndBgmMgr_c::findIdleBgmSoundHandle() { + for (int i = 0; i < 4; i++) { + dSndBgmSound_c *snd = mBgmSounds[i]; + if (!snd->hasState()) { + return snd; + } + } + return nullptr; +} + +dSndBgmBattleSound_c *dSndBgmMgr_c::getBgmBattleSound() { + return static_cast(mBgmSounds[4]); +} + +void dSndBgmMgr_c::addToBgmSoundList(BgmSoundList_e list, dSndBgmSound_c *sound) { + if (list < BGM_LIST_MAX && sound != nullptr) { + removeFromAllBgmSoundLists(sound); + nw4r::ut::List_Prepend(&mBgmSoundLists[list], sound); + } +} + +void dSndBgmMgr_c::appendToBgmSoundList(BgmSoundList_e list, dSndBgmSound_c *sound) { + if (list < BGM_LIST_MAX && sound != nullptr) { + removeFromAllBgmSoundLists(sound); + nw4r::ut::List_Append(&mBgmSoundLists[list], sound); + } +} + +void dSndBgmMgr_c::removeFromBgmSoundList(BgmSoundList_e list, dSndBgmSound_c *sound) { + if (list < BGM_LIST_MAX && sound != nullptr) { + if (isInBgmSoundList(list, sound)) { + nw4r::ut::List_Remove(&mBgmSoundLists[list], sound); + } + } +} + +void dSndBgmMgr_c::removeFromAllBgmSoundLists(dSndBgmSound_c *sound) { + for (int i = 0; i < BGM_LIST_MAX; i++) { + removeFromBgmSoundList(static_cast(i), sound); + } +} + +bool dSndBgmMgr_c::isInBgmSoundList(BgmSoundList_e list, dSndBgmSound_c *sound) { + if (list >= BGM_LIST_MAX) { + return false; + } + + if (sound == nullptr) { + return false; + } + + for (dSndBgmSound_c *it = getFirstInBgmSoundList(list); it != nullptr; it = getNextInBgmSoundList(list, it)) { + if (it == sound) { + return true; + } + } + return false; +} + +dSndBgmSound_c *dSndBgmMgr_c::getFirstInBgmSoundList(BgmSoundList_e list) { + if (list >= BGM_LIST_MAX) { + return nullptr; + } + return static_cast(nw4r::ut::List_GetFirst(&mBgmSoundLists[list])); +} + +dSndBgmSound_c *dSndBgmMgr_c::getNextInBgmSoundList(BgmSoundList_e list, dSndBgmSound_c *sound) { + if (list >= BGM_LIST_MAX) { + return nullptr; + } + return static_cast(nw4r::ut::List_GetNext(&mBgmSoundLists[list], sound)); +} + +dSndBgmSound_c *dSndBgmMgr_c::getLastInBgmSoundList(BgmSoundList_e list) { + if (list >= BGM_LIST_MAX) { + return nullptr; + } + return static_cast(nw4r::ut::List_GetLast(&mBgmSoundLists[list])); +} + +dSndSound_c *dSndBgmMgr_c::getFreeFanSoundHandle() { + for (int i = 0; i < 3; i++) { + if (!mFanSounds[i]->IsAttachedSound()) { + return mFanSounds[i]; + } + } + return nullptr; +} + +dSndSound_c *dSndBgmMgr_c::getFanSoundHandleForFan(u32 soundId) { + for (int i = 0; i < 3; i++) { + if (mFanSounds[i]->GetId() == soundId) { + return mFanSounds[i]; + } + } + return nullptr; +} + +dSndSound_c *dSndBgmMgr_c::getSoundHandleCurrentlyPlayingFanSound(u32 soundId) { + for (int i = 0; i < 3; i++) { + if (mFanSounds[i]->isPlayingSoundId(soundId)) { + return mFanSounds[i]; + } + } + return nullptr; +} + +dSndSound_c *dSndBgmMgr_c::getFanSoundHandleForFan2(u32 soundId) { + for (int i = 0; i < 3; i++) { + if (mFanSounds[i]->GetId() == soundId) { + return mFanSounds[i]; + } + } + return nullptr; +} + +bool dSndBgmMgr_c::isCurrentlyPlayingFanSound(u32 soundId) const { + for (int i = 0; i < 3; i++) { + if (mFanSounds[i]->isPlayingSoundId(soundId)) { + return true; + } + } + return false; +} + +bool dSndBgmMgr_c::hasPlayingFanSounds() const { + for (int i = 0; i < 3; i++) { + if (mFanSounds[i]->isPlaying()) { + return true; + } + } + return false; +} + +void dSndBgmMgr_c::stopFanSounds(s32 fadeFrames) { + for (int i = 0; i < 3; i++) { + mFanSounds[i]->stop(fadeFrames); + } +} + +void dSndBgmMgr_c::calcStopOldBgmSounds() { + s32 numPlayingSounds = 0; + + dSndBgmSound_c *it; + for (it = getFirstInBgmSoundList(BGM_LIST_PLAYING); it != nullptr; + it = getNextInBgmSoundList(BGM_LIST_PLAYING, it)) { + if (!it->isPaused() && it->isStrmSound()) { + numPlayingSounds++; + } + } + + // If more than one strm sound is playing, stop all but the first one + if (numPlayingSounds >= 2) { + for (it = getFirstInBgmSoundList(BGM_LIST_PLAYING); it != nullptr; + it = getNextInBgmSoundList(BGM_LIST_PLAYING, it)) { + if (!it->isPaused() && it->isStrmSound() && it != getFirstInBgmSoundList(BGM_LIST_PLAYING)) { + it->stop(15); + } + } + } +} + +void dSndBgmMgr_c::registSound(dSndSound_c *sound) { + if (sound == nullptr) { + return; + } + unregistSound(sound); + nw4r::ut::List_Append(&mAllSoundsList, sound); +} + +void dSndBgmMgr_c::unregistSound(dSndSound_c *sound) { + if (isSoundRegist(sound)) { + nw4r::ut::List_Remove(&mAllSoundsList, sound); + } +} + +bool dSndBgmMgr_c::isSoundRegist(dSndSound_c *sound) { + if (sound == nullptr) { + return false; + } + for (dSndSound_c *it = getAllSoundsFirst(); it != nullptr; it = getAllSoundsNext(it)) { + if (it == sound) { + return true; + } + } + return false; +} diff --git a/src/d/snd/d_snd_bgm_mml_parser_base.cpp b/src/d/snd/d_snd_bgm_mml_parser_base.cpp new file mode 100644 index 00000000..37cf2c93 --- /dev/null +++ b/src/d/snd/d_snd_bgm_mml_parser_base.cpp @@ -0,0 +1,580 @@ +#include "d/snd/d_snd_bgm_mml_parser_base.h" + +#include "common.h" +#include "nw4r/snd/snd_SeqFile.h" +#include "nw4r/snd/snd_SoundArchive.h" +#include "nw4r/snd/snd_SoundArchivePlayer.h" + +dSndBgmMmlParser_c::dSndBgmMmlParser_c(nw4r::snd::SoundArchivePlayer *player, nw4r::snd::SoundArchive *archive) + : field_0x04(0), mpPlayer(player), mpArchive(archive) {} + +void dSndBgmMmlParser_c::initTrack(s32 trackNo, u32 offset) { + dBgmMmlTrack &trackParam = mTracks[trackNo]; + trackParam.currentAddr = baseAddr + offset; + trackParam.mTrackNo = trackNo; + trackParam.mTrackUsed = true; + trackParam.cmpFlag = 0; + trackParam.wait = 0; + trackParam.callStackDepth = 0; +} + +bool dSndBgmMmlParser_c::loadAndParse(u32 soundId, u32 trackMask, bool noJumps) { + if (!readTracks(soundId, trackMask, noJumps)) { + return false; + } + + for (int i = 0; i < 16; i++) { + if (mTracks[i].mTrackUsed) { + while (Parse(&mTracks[i]) != PARSE_RESULT_FINISH) {} + } + } + return true; +} + +bool dSndBgmMmlParser_c::readTracks(u32 soundId, u32 trackMask, bool noJumps) { + nw4r::snd::SoundArchivePlayer *player = mpPlayer; + nw4r::snd::SoundArchive *archive = mpArchive; + + field_0x04 = noJumps; + nw4r::snd::SoundArchive::SoundInfo info; + if (!archive->ReadSoundInfo(soundId, &info)) { + return false; + } + + if (archive->GetSoundType(soundId) != nw4r::snd::SoundArchive::SOUND_TYPE_SEQ) { + return false; + } + + const void *addr = player->detail_GetFileAddress(info.fileId); + if (addr == nullptr) { + return false; + } + + nw4r::snd::detail::SeqFileReader reader(addr); + baseAddr = (const byte_t *)reader.GetBaseAddress(); + for (int i = 0; i < 16; i++) { + mTracks[i].mTrackUsed = false; + } + initTrack(0, 0); + + const byte_t *ptr = baseAddr; + bool endReached = false; + + for (int i = 0; i < 20; i++) { + u32 cmd = ReadByte(&ptr); + switch (cmd) { + case MML_ALLOC_TRACK: + Read16(&ptr); + break; + case MML_OPEN_TRACK: { + u8 trackNo = ReadByte(&ptr); + u32 offset = Read24(&ptr); + if (((trackMask >> trackNo) & 1) != 0) { + initTrack(trackNo, offset); + } + break; + } + case MML_SET_TIMEBASE: + ptr += 1; + break; + default: + endReached = true; + break; + } + + if (endReached) { + mTracks[0].currentAddr = ptr - 1; + break; + } + } + + if (!endReached) { + return false; + } + + if ((trackMask & 1) == 0) { + mTracks[0].mTrackUsed = false; + } + return true; +} + +// clang-format off + +// modified from nw4r::snd - some changes I had to make to make it match might be fake +dSndBgmMmlParser_c::ParseResult dSndBgmMmlParser_c::Parse(dBgmMmlTrack *track) const { + dBgmMmlTrack &trackParam = *track; + + // Had to move these up for regswaps - maybe fake + s32 commandArg1; + s32 commandArg2; + + SeqArgType argType; + SeqArgType argType2 = SEQ_ARG_NONE; + + bool useArgType = false; + bool doExecCommand = true; + + + u32 cmd = ReadByte(&trackParam.currentAddr); + + if (cmd == MML_EXEC_IF) + { + cmd = ReadByte(&trackParam.currentAddr); + doExecCommand = trackParam.cmpFlag != false; + } + + if (cmd == MML_ARG_2_S16) + { + cmd = ReadByte(&trackParam.currentAddr); + argType2 = SEQ_ARG_S16; + } + else if (cmd == MML_ARG_2_RANDOM) + { + cmd = ReadByte(&trackParam.currentAddr); + argType2 = SEQ_ARG_RANDOM; + } + else if (cmd == MML_ARG_2_VARIABLE) + { + cmd = ReadByte(&trackParam.currentAddr); + argType2 = SEQ_ARG_VARIABLE; + } + + if (cmd == MML_ARG_1_RANDOM) + { + cmd = ReadByte(&trackParam.currentAddr); + argType = SEQ_ARG_RANDOM; + useArgType = true; + } + else if (cmd == MML_ARG_1_VARIABLE) + { + cmd = ReadByte(&trackParam.currentAddr); + argType = SEQ_ARG_VARIABLE; + useArgType = true; + } + + if (!(cmd & MML_CMD_MASK)) + { + // MML note data, not a command + u8 velocity = ReadByte(&trackParam.currentAddr); + + s32 length = ReadArg(&trackParam.currentAddr, + useArgType ? argType : SEQ_ARG_VMIDI); + + if (!doExecCommand) + return PARSE_RESULT_CONTINUE; + + int key = cmd; + + NoteOnCommandProc(trackParam.mTrackNo, trackParam.wait, key, velocity, + length > 0 ? length : -1); + } + else + { + // MML command + commandArg1 = 0; + commandArg2 = 0; + + switch (cmd & MML_CMD_SET_MASK) + { + case 0x80: + { + switch (cmd) + { + case MML_WAIT: + { + s32 arg = ReadArg(&trackParam.currentAddr, + useArgType ? argType : SEQ_ARG_VMIDI); + + if (doExecCommand) + trackParam.wait += arg; + } + break; + + case MML_SET_PRGNO: + commandArg1 = ReadArg(&trackParam.currentAddr, + useArgType ? argType : SEQ_ARG_VMIDI); + + if (doExecCommand) + CommandProc_(track, cmd, commandArg1, commandArg2); + + break; + + case MML_OPEN_TRACK: + { + // Had to change u8 -> u32 for regswaps - maybe fake + u32 trackNo = ReadByte(&trackParam.currentAddr); + u32 offset = Read24(&trackParam.currentAddr); + + if (doExecCommand) + { + commandArg1 = trackNo; + commandArg2 = offset; + CommandProc_(track, cmd, commandArg1, commandArg2); + } + } + break; + + case MML_JUMP: + case MML_CALL: + { + u32 offset = Read24(&trackParam.currentAddr); + + if (doExecCommand) + { + commandArg1 = offset; + CommandProc_(track, cmd, commandArg1, commandArg2); + } + } + break; + } + + break; + } + + case 0xb0: + case 0xc0: + case 0xd0: + { + u8 arg = ReadArg(&trackParam.currentAddr, + useArgType ? argType : SEQ_ARG_U8); + + if (argType2 != SEQ_ARG_NONE) + { + commandArg2 = + ReadArg(&trackParam.currentAddr, argType2); + } + + if (!doExecCommand) + break; + + switch (cmd) + { + case MML_SET_TRANSPOSE: + case MML_SET_PITCH_BEND: + commandArg1 = *reinterpret_cast(&arg); + break; + + default: + commandArg1 = *reinterpret_cast(&arg); + break; + } + + CommandProc_(track, cmd, commandArg1, commandArg2); + break; + } + + case 0x90: + if (doExecCommand) + CommandProc_(track, cmd, commandArg1, commandArg2); + + break; + + case 0xe0: + commandArg1 = + static_cast(ReadArg(&trackParam.currentAddr, + useArgType ? argType : SEQ_ARG_S16)); + + if (doExecCommand) + CommandProc_(track, cmd, commandArg1, commandArg2); + + break; + + case 0xf0: + { + switch (cmd) + { + case MML_ALLOC_TRACK: + Read16(&trackParam.currentAddr); + NW4RPanicMessage_Line( + 312, "seq: must use alloctrack in startup code"); + + break; + + case MML_EOF: + if (doExecCommand) + return PARSE_RESULT_FINISH; + + break; + + case MML_EX_COMMAND: + { + u32 cmdex = ReadByte(&trackParam.currentAddr); + + switch (cmdex & MML_CMD_SET_MASK) + { + case MML_EX_USERPROC: + commandArg1 = static_cast( + ReadArg(&trackParam.currentAddr, + useArgType ? argType : SEQ_ARG_S16)); + + if (doExecCommand) + { + CommandProc_(track, (cmd << 8) + cmdex, commandArg1, + commandArg2); + } + + break; + + case MML_EX_ARITHMETIC: + case MML_EX_LOGIC: + commandArg1 = ReadByte(&trackParam.currentAddr); + commandArg2 = static_cast( + ReadArg(&trackParam.currentAddr, + useArgType ? argType : SEQ_ARG_S16)); + + if (doExecCommand) + { + CommandProc_(track, (cmd << 8) + cmdex, commandArg1, + commandArg2); + } + + break; + } + } + ATTR_FALLTHROUGH; + + default: + if (doExecCommand) + CommandProc_(track, cmd, commandArg1, commandArg2); + + break; + } + } + break; + + case 0xa0: + NW4RPanicMessage_Line(392, "Invalid seqdata command: %d", cmd); + break; + } + } + + return PARSE_RESULT_CONTINUE; +} + +// very stripped down from nw4r::snd +void dSndBgmMmlParser_c::CommandProc_(dBgmMmlTrack *track, u32 command, s32 commandArg1, s32 commandArg2) const { + dBgmMmlTrack &trackParam = *track; + + switch (command) + { + case MML_JUMP: + if (field_0x04 == 0) + trackParam.currentAddr = baseAddr + commandArg1; + break; + + case MML_CALL: + { + if (trackParam.callStackDepth >= CALL_STACK_DEPTH) + { + NW4RWarningMessage_Line(665, + "nw4r::snd::MmlParser: cannot \'call\' " + "because already too deep"); + break; + } + + dBgmMmlCallStack *callStack = + &trackParam.callStack[trackParam.callStackDepth]; + + callStack->address = trackParam.currentAddr; + callStack->loopFlag = false; + + trackParam.callStackDepth++; + trackParam.currentAddr = baseAddr + commandArg1; + break; + } + + case MML_RET: + { + dBgmMmlCallStack *tmp; // needed for lbzu + dBgmMmlCallStack *callStack = nullptr; + + while (trackParam.callStackDepth > 0) + { + tmp = &trackParam.callStack[--trackParam.callStackDepth]; + + if (!tmp->loopFlag) + { + callStack = tmp; + break; + } + } + + if (!callStack) + { + NW4RWarningMessage_Line( + 688, + "nw4r::snd::MmlParser: unmatched sequence command \'ret\'"); + + break; + } + + trackParam.currentAddr = callStack->address; + } + break; + + case MML_LOOP_START: + { + if (trackParam.callStackDepth >= CALL_STACK_DEPTH) + { + NW4RWarningMessage_Line( + 698, "nw4r::snd::MmlParser: cannot \'loop_start\' because " + "already too deep"); + + break; + } + + dBgmMmlCallStack *callStack = + &trackParam.callStack[trackParam.callStackDepth]; + + callStack->address = trackParam.currentAddr; + callStack->loopFlag = true; + callStack->loopCount = commandArg1; + + trackParam.callStackDepth++; + } + break; + + case MML_LOOP_END: + { + if (trackParam.callStackDepth <= 0) + { + NW4RWarningMessage_Line(713, "nw4r::snd::MmlParser: unmatched " + "sequence command \'loop_end\'"); + break; + } + + dBgmMmlCallStack *callStack = + &trackParam.callStack[trackParam.callStackDepth - 1]; + + if (!callStack->loopFlag) + { + NW4RWarningMessage_Line(719, "nw4r::snd::MmlParser: unmatched " + "sequence command \'loop_end\'"); + break; + } + + u8 loop_count = callStack->loopCount; + + if (loop_count && --loop_count == 0) + { + trackParam.callStackDepth--; + } + else + { + callStack->loopCount = loop_count; + + trackParam.currentAddr = callStack->address; + } + } + break; + } + + CommandProc(track->mTrackNo, track->wait, command, commandArg1, commandArg2); +} + +// copied from nw4r::snd start +u16 dSndBgmMmlParser_c::Read16(byte_t const **ptr) const +{ + u16 ret = ReadByte(ptr); + + ret <<= 8; + ret |= ReadByte(ptr); + + return ret; +} + +u32 dSndBgmMmlParser_c::Read24(byte_t const **ptr) const +{ + u32 ret = ReadByte(ptr); + + ret <<= 8; + ret |= ReadByte(ptr); + + ret <<= 8; + ret |= ReadByte(ptr); + + return ret; +} + +s32 dSndBgmMmlParser_c::ReadVar(byte_t const **ptr) const +{ + s32 ret = 0; + byte_t b; + + for (int i = 0;; i++) + { + NW4RAssert_Line(940, i < 4); + + b = ReadByte(ptr); + ret <<= 7; + ret |= b & 0x7f; + + if (!(b & 0x80)) + break; + } + + return ret; +} + +s32 dSndBgmMmlParser_c::ReadArg(byte_t const **ptr, + SeqArgType argType) const +{ + s32 var; + + switch (argType) + { + case SEQ_ARG_U8: + var = ReadByte(ptr); + break; + + case SEQ_ARG_S16: + var = Read16(ptr); + break; + + case SEQ_ARG_VMIDI: + var = ReadVar(ptr); + break; + + case SEQ_ARG_VARIABLE: + { + var = ReadByte(ptr); + /* + u8 varNo = ReadByte(ptr); + + s16 const volatile *varPtr = GetVariablePtr(player, track, varNo); + + // ERRATUM: if varPtr is not valid then ReadArg returns garbage + if (varPtr) + var = *varPtr; + */ + } + break; + + case SEQ_ARG_RANDOM: + { + s32 rand; + + s16 min = Read16(ptr); + s16 max = Read16(ptr); + + rand = nw4r::snd::detail::Util::CalcRandom(); + rand *= max - min + 1; + rand >>= 16; + rand += min; + + var = rand; + } + break; + } + + return var; +} +// clang-format on + +void dSndBgmMmlParser_c::CommandProc(u32 trackNo, int wait, u32 command, s32 commandArg1, s32 commandArg2) const { + // noop +} + +void dSndBgmMmlParser_c::NoteOnCommandProc(u32 trackNo, int wait, int key, int velocity, s32 length) const { + // noop +} diff --git a/src/d/snd/d_snd_bgm_mml_parsers.cpp b/src/d/snd/d_snd_bgm_mml_parsers.cpp new file mode 100644 index 00000000..c440c10a --- /dev/null +++ b/src/d/snd/d_snd_bgm_mml_parsers.cpp @@ -0,0 +1,225 @@ +#include "d/snd/d_snd_bgm_mml_parsers.h" + +#include "common.h" +#include "d/snd/d_snd_bgm_seq_data_mgr.h" +#include "d/snd/d_snd_bgm_sound_harp_mgr.h" +#include "d/snd/d_snd_harp_song_data.h" +#include "d/snd/d_snd_mgr.h" +#include "d/snd/d_snd_player_mgr.h" +#include "d/snd/d_snd_wzsound.h" +#include "nw4r/snd/snd_SoundArchive.h" +#include "sized_string.h" + +dSndBgmMmlParserHarp_c::dSndBgmMmlParserHarp_c(dSndBgmSoundHarpMgr_c *mgr) + : dSndBgmMmlParser_c(&dSndMgr_c::GetInstance()->getPlayer(), dSndMgr_c::GetInstance()->getArchive()) { + field_0x294 = mgr; + field_0x298 = mgr; +} + +bool dSndBgmMmlParserHarp_c::parseData(const char *soundLabel, u32 baseSoundId, u32 trackMask) { + if (soundLabel == nullptr) { + return false; + } + bool ok = false; + field_0x294->reset(); + SizedString<64> dataLabel; + dataLabel.sprintf("%s%s", dSndBgmSeqDataMgr_c::getDataPrefix(), soundLabel); + u32 dataId = dSndPlayerMgr_c::GetInstance()->convertLabelStringToSoundId(dataLabel); + if (dataId != -1 && + dSndMgr_c::GetInstance()->getArchive()->GetSoundType(dataId) == nw4r::snd::SoundArchive::SOUND_TYPE_SEQ) { + ok = loadAndParse(dataId, trackMask, true); + if (ok) { + field_0x294->setSoundId(baseSoundId); + } + } + field_0x294->setLoaded(); + return ok; +} + +bool dSndBgmMmlParserHarp_c::parseData(u32 baseSoundId, u32 trackMask) { + if (baseSoundId == -1) { + return false; + } + return parseData(dSndMgr_c::getSoundLabelString(baseSoundId), baseSoundId, trackMask); +} + +void dSndBgmMmlParserHarp_c::CommandProc(u32 trackNo, int wait, u32 command, s32 commandArg1, s32 commandArg2) const { + if (command > 0xFF) { + return; + } + + // TODO type + switch ((s32)trackNo) { + case 15: + if (command == MML_JUMP) { + field_0x298->setField_0x08(wait); + } + break; + default: + if (command == MML_SET_TEMPO) { + field_0x294->setTempo(commandArg1); + } + break; + } +} + +void dSndBgmMmlParserHarp_c::NoteOnCommandProc(u32 trackNo, int wait, int key, int velocity, s32 length) const { + // TODO type + switch ((s32)trackNo) { + case 15: field_0x298->addVar(wait, key, velocity); break; + default: break; + } +} + +dSndBgmMmlParserHarpSong_c::dSndBgmMmlParserHarpSong_c() + : dSndBgmMmlParser_c(&dSndMgr_c::GetInstance()->getPlayer(), dSndMgr_c::GetInstance()->getArchive()) { + field_0x294 = nullptr; +} + +bool dSndBgmMmlParserHarpSong_c::parseData(u32 soundId, dSndHarpSongData_c *pData) { + if (soundId == -1) { + return false; + } + if (pData == nullptr) { + return false; + } + + field_0x294 = pData; + bool ok = loadAndParse(soundId, 0xFFFF, true); + field_0x294 = nullptr; + + return ok; +} + +void dSndBgmMmlParserHarpSong_c::CommandProc(u32 trackNo, int wait, u32 command, s32 commandArg1, s32 commandArg2) + const { + // no-op +} + +void dSndBgmMmlParserHarpSong_c::NoteOnCommandProc(u32 trackNo, int wait, int key, int velocity, s32 length) const { + if (trackNo >= 0 && trackNo < 2) { + if (field_0x294 != nullptr) { + field_0x294->insert2(wait, key, trackNo); + } + } else if (trackNo == 15) { + if (field_0x294 != nullptr) { + field_0x294->insert1(wait, key); + } + } +} + +dSndBgmMmlParserTagBattle_c::dSndBgmMmlParserTagBattle_c() + : dSndBgmMmlParser_c(&dSndMgr_c::GetInstance()->getPlayer(), dSndMgr_c::GetInstance()->getArchive()), + mpBuf(nullptr), + mBufSize(0) {} + +bool dSndBgmMmlParserTagBattle_c::parseData(u32 soundId, dSndTagData **pOutData) { + if (soundId == -1) { + return false; + } + // First pass, check how much memory we need + loadAndParse(soundId, (1 << 0), true); + // alloc memory + mpBuf = reinterpret_cast( + dSndMgr_c::GetInstance()->getSoundHeap()->Alloc(sizeof(dSndTagData) + mBufSize * sizeof(u32)) + ); + mpBuf->size = mBufSize; + // second pass, actually parse + mBufSize = 0; + bool ok = loadAndParse(soundId, (1 << 0), true); + *pOutData = mpBuf; + return ok; +} + +void dSndBgmMmlParserTagBattle_c::NoteOnCommandProc(u32 trackNo, int wait, int key, int velocity, s32 length) const { + if (key < 0x3C) { + return; + } + + if (mpBuf != nullptr) { + mpBuf->data[mBufSize] = wait; + } + mBufSize++; +} + +dSndBgmMmlParserTagBgmBoss_c::dSndBgmMmlParserTagBgmBoss_c() + : dSndBgmMmlParser_c(&dSndMgr_c::GetInstance()->getPlayer(), dSndMgr_c::GetInstance()->getArchive()), + mpBuf1(nullptr), + mpBuf2(nullptr), + mBufSize1(0), + mBufSize2(0) {} + +void dSndBgmMmlParserTagBgmBoss_c::parseData(dSndTagData **pOutData1, dSndTagData **pOutData2) { + // First pass, check how much memory we need + loadAndParse(TAG_BGM_BOSS_A, (1 << 0), true); + // alloc memory + mpBuf1 = reinterpret_cast( + dSndMgr_c::GetInstance()->getSoundHeap()->Alloc(sizeof(dSndTagData) + mBufSize1 * sizeof(u32)) + ); + mpBuf2 = reinterpret_cast( + dSndMgr_c::GetInstance()->getSoundHeap()->Alloc(sizeof(dSndTagData) + mBufSize2 * sizeof(u32)) + ); + mpBuf1->size = mBufSize1; + mpBuf2->size = mBufSize2; + // second pass, actually parse + mBufSize1 = 0; + mBufSize2 = 0; + loadAndParse(TAG_BGM_BOSS_A, (1 << 0), true); + *pOutData1 = mpBuf1; + *pOutData2 = mpBuf2; +} + +void dSndBgmMmlParserTagBgmBoss_c::NoteOnCommandProc(u32 trackNo, int wait, int key, int velocity, s32 length) const { + switch (key) { + case 0x3C: { + if (mpBuf1 != nullptr) { + mpBuf1->data[mBufSize1] = wait; + } + mBufSize1++; + break; + } + case 0x48: { + if (mpBuf2 != nullptr) { + mpBuf2->data[mBufSize2] = wait; + } + mBufSize2++; + break; + } + } +} + +dSndBgmMmlParserTagCompNote_c::dSndBgmMmlParserTagCompNote_c() + : dSndBgmMmlParser_c(&dSndMgr_c::GetInstance()->getPlayer(), dSndMgr_c::GetInstance()->getArchive()), + mpBuf(nullptr), + mBufSize(0) {} + +void dSndBgmMmlParserTagCompNote_c::parseData(dSndTagData **pOutData) { + // First pass, check how much memory we need + loadAndParse(TAG_BGM_EVENT_COMP_NOTE, (1 << 0), true); + // alloc memory + mpBuf = reinterpret_cast( + dSndMgr_c::GetInstance()->getSoundHeap()->Alloc(sizeof(dSndTagData) + mBufSize * sizeof(u32)) + ); + mpBuf->size = mBufSize; + // second pass, actually parse + mBufSize = 0; + loadAndParse(TAG_BGM_EVENT_COMP_NOTE, (1 << 0), true); + *pOutData = mpBuf; +} + +void dSndBgmMmlParserTagCompNote_c::NoteOnCommandProc(u32 trackNo, int wait, int key, int velocity, s32 length) const { + if (key < 0x3C) { + return; + } + + // TODO - signed/unsigned + u32 w = wait; + if (mpBuf != nullptr) { + if (w != 0) { + w = w < 0xC80 ? 0 : w - 0xC80; + } + mpBuf->data[mBufSize] = w; + } + + mBufSize++; +} diff --git a/src/d/snd/d_snd_bgm_seq_config.cpp b/src/d/snd/d_snd_bgm_seq_config.cpp new file mode 100644 index 00000000..423c4295 --- /dev/null +++ b/src/d/snd/d_snd_bgm_seq_config.cpp @@ -0,0 +1,52 @@ +#include "d/snd/d_snd_bgm_seq_config.h" + +#include "common.h" +#include "d/snd/d_snd_wzsound.h" + +static const dSndBgmBattleConfig sBattleConfigs[] = { + { BGM_BATTLE2, {{(1 << 7) | (1 << 4) | (1 << 3), 0}, {(1 << 9) | (1 << 6), 0}, {0, 0}}}, + {BGM_BATTLE_ROOM_MAIN, {{(1 << 7) | (1 << 4), 0}, {(1 << 9), 0}, {0, 0}}}, + { BGM_MIDDLE_BOSS, {{(1 << 1), 0}, {(1 << 2), 0}, {0, 0}}} +}; + +const dSndBgmBattleConfig *dSndBgmBattleConfig::getConfig(u32 soundId) { + for (int i = 0; i < ARRAY_LENGTH(sBattleConfigs); i++) { + if (soundId == sBattleConfigs[i].soundId) { + return &sBattleConfigs[i]; + } + } + return nullptr; +} + +bool dSndBgmBattleConfig::hasConfig(u32 soundId) { + if (soundId == -1) { + return false; + } + + for (int i = 0; i < ARRAY_LENGTH(sBattleConfigs); i++) { + if (soundId == sBattleConfigs[i].soundId) { + return true; + } + } + return false; +} + +static const dSndBgmSeqConfig sBgmConfigs[] = { + { BGM_BATTLE2, 0, 0x180, 1, 4}, + { BGM_BATTLE2, 1, 0x180, 5, 0x2F}, + {BGM_BATTLE_ROOM_MAIN, 1, 0x180, 5, 0x2C}, + { BGM_MUTE, 1, 0x120, 0, 0x1F}, +}; + +const dSndBgmSeqConfig *dSndBgmSeqConfig::getConfig(u32 soundId, s32 unkParam) { + if (soundId == -1) { + return nullptr; + } + + for (const dSndBgmSeqConfig *def = sBgmConfigs; def < sBgmConfigs + ARRAY_LENGTH(sBgmConfigs); def++) { + if (soundId == def->soundId && def->field_0x04 == unkParam) { + return def; + } + } + return nullptr; +} diff --git a/src/d/snd/d_snd_bgm_seq_data_mgr.cpp b/src/d/snd/d_snd_bgm_seq_data_mgr.cpp new file mode 100644 index 00000000..a8a45272 --- /dev/null +++ b/src/d/snd/d_snd_bgm_seq_data_mgr.cpp @@ -0,0 +1,60 @@ +#include "d/snd/d_snd_bgm_seq_data_mgr.h" +#include "common.h" +#include "d/snd/d_snd_bgm_mgr.h" +#include "d/snd/d_snd_bgm_mml_parsers.h" +#include "d/snd/d_snd_bgm_sound_harp_mgr.h" + +#include "d/snd/d_snd_mgr.h" +#include "d/snd/d_snd_player_mgr.h" +#include "d/snd/d_snd_util.h" +#include "d/snd/d_snd_wzsound.h" + +SND_DISPOSER_DEFINE(dSndBgmSeqDataMgr_c) + +dSndBgmSeqDataMgr_c::dSndBgmSeqDataMgr_c() : mInitialized(false) { + mpMgrs = new dSndBgmSoundHarpMgr_c[NUM_SOUNDS]; +} + +const char *dSndBgmSeqDataMgr_c::getDataPrefix() { + return "DATA_"; +} + +u32 dSndBgmSeqDataMgr_c::getDataPrefixLength() { + return std::strlen(getDataPrefix()); +} + +void dSndBgmSeqDataMgr_c::setup() { + // no-op +} + +void dSndBgmSeqDataMgr_c::setupState0() { + if (mInitialized) { + return; + } + + // DATA_BGM_BATTLE2, DATA_BGM_BATTLE2_OUTRO + for (int i = 0; i < NUM_SOUNDS; i++) { + u32 dataId = DATA_BGM_BATTLE2 + i; + const char *baseLabel = dSndMgr_c::getSoundLabelString(dataId) + getDataPrefixLength(); + u32 baseSoundId = dSndPlayerMgr_c::GetInstance()->convertLabelStringToSoundId(baseLabel); + dSndBgmMmlParserHarp_c parser(&mpMgrs[i]); + (void)dSndBgmMgr_c::isSoundPlayedByBgmBattlePlayer(dataId); + parser.parseData(baseSoundId, (1 << 15) | (1 << 0)); + } + + mInitialized = true; +} + +dSndBgmSoundHarpMgr_c *dSndBgmSeqDataMgr_c::getHarpMgrForSoundId(u32 soundId) { + if (soundId == -1) { + return nullptr; + } + + for (dSndBgmSoundHarpMgr_c *it = &mpMgrs[0]; it < &mpMgrs[NUM_SOUNDS]; it++) { + if (it->getSoundId() == soundId) { + return it; + } + } + + return nullptr; +} diff --git a/src/d/snd/d_snd_bgm_sound.cpp b/src/d/snd/d_snd_bgm_sound.cpp new file mode 100644 index 00000000..2d01949f --- /dev/null +++ b/src/d/snd/d_snd_bgm_sound.cpp @@ -0,0 +1,526 @@ +#include "d/snd/d_snd_bgm_sound.h" + +#include "common.h" +#include "d/snd/d_snd_bgm_mgr.h" +#include "d/snd/d_snd_bgm_mml_parsers.h" +#include "d/snd/d_snd_bgm_seq_config.h" +#include "d/snd/d_snd_bgm_seq_data_mgr.h" +#include "d/snd/d_snd_mgr.h" +#include "d/snd/d_snd_player_mgr.h" +#include "d/snd/d_snd_sound.h" +#include "d/snd/d_snd_source.h" +#include "d/snd/d_snd_state_mgr.h" +#include "d/snd/d_snd_wzsound.h" +#include "nw4r/snd/snd_SeqSoundHandle.h" +#include "nw4r/snd/snd_SoundArchive.h" +#include "nw4r/snd/snd_SoundStartable.h" +#include "nw4r/snd/snd_StrmSoundHandle.h" +#include "nw4r/snd/snd_WaveSoundHandle.h" + +dSndBgmSoundHarpMgr_c *dSndBgmSound_c::spGlobalHarpMgr; + +dSndBgmSound_c::dSndBgmSound_c() + : mpStartable(nullptr), + mpSoundSource(nullptr), + mIndex(7), + field_0x104(0), + mSeqTempo(-1), + mBgmFlags(0), + mDidRewindPlaySamplePosition(false), + mBgmVar3(-1), + mSeqTimebase(0x180), + mPlaySamplePosition(0), + mpHarpMgr(&mHarpMgr), + mpSeqConfig(nullptr), + mSeqPlaySamplePosition(-1), + // not initialized!!! + // mpStopCallback(nullptr), + mpCalcCallback(nullptr), + cb3(nullptr), + cb4(nullptr), + cb5(nullptr), + cb6(nullptr), + cb7(nullptr), + cb8(nullptr), + cb9(nullptr), + cb10(nullptr) { + for (int i = 0; i < 2; i++) { + field_0x14C[i] = 0; + field_0x154[i] = 0.0f; + } + + if (spGlobalHarpMgr == nullptr) { + spGlobalHarpMgr = new dSndBgmSoundHarpMgr_c(); + } +} + +void dSndBgmSound_c::init(nw4r::snd::SoundStartable &startable, s32 idx) { + mpStartable = &startable; + mIndex = idx; +} + +void dSndBgmSound_c::cancel() { + if (hasState()) { + dSndSound_c::cancel(); + mBgmFlags = 0; + field_0x104 = 0; + mDidRewindPlaySamplePosition = false; + mpHarpMgr = &mHarpMgr; + mpSeqConfig = nullptr; + mPlaySamplePosition = 0; + mSeqPlaySamplePosition = -1; + mBgmVar3 = -1; + mSeqTempo = -1; + mSeqTimebase = 0x180; + mHarpMgr.reset(); + for (int i = 0; i < 2; i++) { + field_0x14C[i] = 0; + field_0x154[i] = 0.0f; + } + dSndBgmMgr_c::GetInstance()->removeFromAllBgmSoundLists(this); + } +} + +void dSndBgmSound_c::calc() { + dSndSound_c::calc(); + mDidRewindPlaySamplePosition = false; + if (mIsRunning) { + if (!IsAttachedSound()) { + if (mpStopCallback != nullptr) { + (mpStopCallback)(false); + mpStopCallback = nullptr; + } + cancel(); + } else { + field_0x104++; + postCalc(); + calcPlaySamplePosition(); + if (mpCalcCallback != nullptr) { + (mpCalcCallback)(this); + } + } + } +} + +void dSndBgmSound_c::calcPlaySamplePosition() { + if (!isSeqSound()) { + u32 oldPos = mPlaySamplePosition; + mPlaySamplePosition = getPlaySamplePosition(); + if (mPlaySamplePosition < oldPos) { + mDidRewindPlaySamplePosition = true; + } + } +} + +bool dSndBgmSound_c::isBgmBattle() const { + // TODO index constants + if (mIndex == 4) { + return true; + } + return (mBgmFlags & BGM_FLAG_BATTLE) != 0; +} + +nw4r::snd::SoundStartable::StartResult dSndBgmSound_c::startBgmSound(u32 soundId, s32 fadeFrames, u32 startOffset) { + if (isPlaying()) { + stop(0); + } + + nw4r::snd::SoundStartable::StartResult res; + if (isPrepared() || isPreparing()) { + if (soundId != GetId()) { + return nw4r::snd::SoundStartable::START_ERR_USER; + } + if (startOffset != 0 && mPrevStartOffset != startOffset) { + return nw4r::snd::SoundStartable::START_ERR_USER; + } + + (void)IsPrepared(); // return value ignored + StartPrepared(); + res = nw4r::snd::SoundStartable::START_SUCCESS; + } else { + if (startOffset == 0) { + if (mpSoundSource != nullptr) { + res = mpSoundSource->startSound(soundId, this, nullptr); + } else { + res = mpStartable->StartSoundReturnStatus(this, soundId, nullptr); + } + } else { + nw4r::snd::SoundStartable::StartInfo info; + info.enableFlag |= nw4r::snd::SoundStartable::StartInfo::ENABLE_START_OFFSET; + + getHarpData(soundId); + if (mpHarpMgr != nullptr) { + mSeqTempo = mpHarpMgr->getTempo(); + } + + if (mSeqTempo > 0 && dSndMgr_c::GetInstance()->getArchive()->GetSoundType(soundId) == + nw4r::snd::SoundArchive::SOUND_TYPE_SEQ) { + mSeqPlaySamplePosition = (mSeqTempo * startOffset * 0xC0); + mSeqPlaySamplePosition /= 120000; + info.startOffsetType = nw4r::snd::SoundStartable::StartInfo::START_OFFSET_TYPE_TICK; + info.startOffset = mSeqPlaySamplePosition; + } else { + info.startOffsetType = nw4r::snd::SoundStartable::StartInfo::START_OFFSET_TYPE_MILLISEC; + info.startOffset = startOffset; + } + + if (mpSoundSource != nullptr) { + // TODO - is it a @bug that no pStartInfo is passed here? + res = mpSoundSource->startSound(soundId, this, nullptr); + } else { + res = mpStartable->StartSoundReturnStatus(this, soundId, &info); + } + } + } + + if (res == nw4r::snd::SoundStartable::START_SUCCESS) { + fadeIn(soundId, fadeFrames); + } else { + cancel(); + } + + return res; +} + +void dSndBgmSound_c::fadeIn(u32 id, s32 fadeFrames) { + dSndSound_c::fadeIn(id, fadeFrames); + u32 param = dSndMgr_c::GetInstance()->getArchive()->GetSoundUserParam(id); + if (dSndMgr_c::GetInstance()->getArchive()->GetSoundType(id) == nw4r::snd::SoundArchive::SOUND_TYPE_STRM) { + // Mute all seq tracks but the first + setStrmTrackVolume(~(1 << 0), 0.0f, 0); + // Unmute second and third based on flags + if ((param & 0x10000) != 0) { + setStrmTrackVolume((1 << 1), 1.0f, 0); + } + if ((param & 0x20000) != 0) { + setStrmTrackVolume((1 << 2), 1.0f, 0); + } + } + + loadCallbacks(id); + loadSeqConfig(id); + getHarpData(id); + if (mpHarpMgr != nullptr) { + mSeqTempo = mpHarpMgr->getTempo(); + } + + if ((param & 0x40000000) != 0) { + mBgmFlags |= BGM_FLAG_0x10 | BGM_FLAG_0x8; + dSndStateMgr_c::GetInstance()->onEventFlag(dSndStateMgr_c::EVENT_0x400000); + } + + if ((param & 0x10000000) != 0) { + mBgmFlags |= BGM_FLAG_0x10; + dSndStateMgr_c::GetInstance()->onEventFlag(dSndStateMgr_c::EVENT_0x400000); + } + + if ((param & 0x800000) != 0) { + mBgmFlags |= BGM_FLAG_0x40; + } + + if (dSndPlayerMgr_c::isSoundPlayedByBgmBattlePlayer(id)) { + mBgmFlags |= BGM_FLAG_BATTLE; + } + + if (id == BGM_MUTE) { + dSndBgmMgr_c::GetInstance()->appendToBgmSoundList(dSndBgmMgr_c::BGM_LIST_PLAYING, this); + } else { + dSndBgmMgr_c::GetInstance()->addToBgmSoundList(dSndBgmMgr_c::BGM_LIST_PLAYING, this); + } + + if (dSndBgmMgr_c::GetInstance()->getActiveBgmSound() == this) { + mpHarpMgr->setPlaySamplePosition(0); + } +} + +void dSndBgmSound_c::loadSeqConfig(u32 soundId) { + if (dSndMgr_c::GetInstance()->getArchive()->GetSoundType(soundId) == nw4r::snd::SoundArchive::SOUND_TYPE_SEQ) { + mpSeqConfig = dSndBgmSeqConfig::getConfig(soundId, 1); + if (mpSeqConfig != nullptr) { + mSeqTimebase = mpSeqConfig->mTimebase; + } + } +} + +// Largely a copy of dSndSound_c::prepareSound, with changes to support different startable +nw4r::snd::SoundStartable::StartResult dSndBgmSound_c::prepareSound(u32 soundId, u32 startOffset) { + if (soundId == -1) { + return nw4r::snd::SoundStartable::START_ERR_USER; + } + + if (isPlaying()) { + return nw4r::snd::SoundStartable::START_ERR_USER; + } + + if (isPreparingSoundId(soundId)) { + if (mPrevStartOffset == startOffset) { + return nw4r::snd::SoundStartable::START_ERR_USER; + } + forceStop(); + } else { + if (isPreparing()) { + forceStop(); + } else { + dSndBgmMgr_c::GetInstance()->cullTooManyPreparingSounds(); + } + } + + nw4r::snd::SoundStartable::StartResult res; + if (startOffset == 0) { + if (mpSoundSource != nullptr) { + mpSoundSource->markPrepared(); + res = mpSoundSource->PrepareSoundReturnStatus(this, soundId, nullptr); + } else { + res = mpStartable->PrepareSoundReturnStatus(this, soundId, nullptr); + } + } else { + nw4r::snd::SoundStartable::StartInfo info; + info.enableFlag |= nw4r::snd::SoundStartable::StartInfo::ENABLE_START_OFFSET; + info.startOffsetType = nw4r::snd::SoundStartable::StartInfo::START_OFFSET_TYPE_MILLISEC; + info.startOffset = startOffset; + if (mpSoundSource != nullptr) { + mpSoundSource->markPrepared(); + // TODO - is it a @bug that no pStartInfo is passed here? + res = mpSoundSource->PrepareSoundReturnStatus(this, soundId, nullptr); + } else { + res = mpStartable->PrepareSoundReturnStatus(this, soundId, &info); + } + } + + if (res == nw4r::snd::SoundStartable::START_SUCCESS) { + onPreparing(soundId, startOffset); + } else { + cancel(); + } + + return res; +} + +nw4r::snd::SoundStartable::StartResult dSndBgmSound_c::prepareSound(const char *label, u32 startOffset) { + return prepareSound(dSndPlayerMgr_c::GetInstance()->convertLabelStringToSoundId(label), startOffset); +} + +void dSndBgmSound_c::onPreparing(u32 soundId, u32 startOffset) { + if (soundId == -1) { + return; + } + + dSndSound_c::onPreparing(soundId, startOffset); + getHarpData(soundId); + if (dSndPlayerMgr_c::isSoundPlayedByBgmBattlePlayer(soundId)) { + mBgmFlags |= BGM_FLAG_BATTLE; + } + dSndBgmMgr_c::GetInstance()->addToBgmSoundList(dSndBgmMgr_c::BGM_LIST_PREPARING, this); +} + +void dSndBgmSound_c::stop(s32 fadeFrames) { + if (isRunning()) { + if (mpStopCallback != nullptr) { + (mpStopCallback)(true); + mpStopCallback = nullptr; + } + Stop(fadeFrames); + if (fadeFrames != 0) { + mIsFadingOut = true; + dSndBgmMgr_c::GetInstance()->addToBgmSoundList(dSndBgmMgr_c::BGM_LIST_STOPPING, this); + } else { + cancel(); + } + } else if (!isPreparing()) { + cancel(); + } +} + +void dSndBgmSound_c::pause(bool pauseFlag, s32 fadeFrames) { + if (isFadingOut()) { + return; + } + + if (isPlaying()) { + if (pauseFlag == false) { + if (mIndex != 4 && dSndBgmMgr_c::GetInstance()->weirdCheckAlwaysFalse()) { + setVolume(0.0f, 10); + } + mBgmFlags &= ~BGM_FLAG_PAUSED; + } + dSndSound_c::pause(pauseFlag, fadeFrames); + } +} + +void dSndBgmSound_c::pause(s32 fadeFrames) { + pause(true, fadeFrames); + mBgmFlags |= BGM_FLAG_PAUSED; +} + +u32 dSndBgmSound_c::getPlaySamplePosition() { + if (isRunning()) { + u32 soundId = GetId(); + if (dSndMgr_c::GetInstance()->getArchive()->GetSoundType(soundId) == nw4r::snd::SoundArchive::SOUND_TYPE_SEQ) { + return getSeqSoundPlaySamplePosition(); + } + + if (dSndMgr_c::GetInstance()->getArchive()->GetSoundType(soundId) == nw4r::snd::SoundArchive::SOUND_TYPE_STRM) { + nw4r::snd::StrmSoundHandle handle(this); + return handle.GetPlaySamplePosition(); + } + + if (dSndMgr_c::GetInstance()->getArchive()->GetSoundType(soundId) == nw4r::snd::SoundArchive::SOUND_TYPE_WAVE) { + nw4r::snd::WaveSoundHandle handle(this); + return handle.GetPlaySamplePosition(); + } + } + + return -1; +} + +u32 dSndBgmSound_c::getStrmPlaySamplePosition() { + if (isRunning()) { + u32 soundId = GetId(); + if (dSndMgr_c::GetInstance()->getArchive()->GetSoundType(soundId) == nw4r::snd::SoundArchive::SOUND_TYPE_STRM) { + nw4r::snd::StrmSoundHandle handle(this); + return handle.GetPlaySamplePosition(); + } + } + + return -1; +} + +u32 dSndBgmSound_c::getWavePlaySamplePosition() { + if (isRunning()) { + u32 soundId = GetId(); + if (dSndMgr_c::GetInstance()->getArchive()->GetSoundType(soundId) == nw4r::snd::SoundArchive::SOUND_TYPE_WAVE) { + nw4r::snd::WaveSoundHandle handle(this); + return handle.GetPlaySamplePosition(); + } + } + + return -1; +} + +u32 dSndBgmSound_c::getSeqSoundPlaySamplePosition() { + if (isRunning()) { + calcSeqPlaySamplePosition(); + return mSeqPlaySamplePosition; + } else { + return -1; + } +} + +void dSndBgmSound_c::calcSeqPlaySamplePosition() { + if (!isSeqSound()) { + return; + } + + nw4r::snd::SeqSoundHandle handle(this); + s32 tick = handle.GetTick(); + mBgmVar3 = readSeqTrackVariable(3); + if (mBgmVar3 >= 0) { + // Var >= 0 - seq itself controls play position + mSeqPlaySamplePosition = tick % mSeqTimebase; + if (mSeqPlaySamplePosition == 0) { + mBgmVar3++; + if (mpSeqConfig != nullptr && mBgmVar3 > mpSeqConfig->mLoopEnd) { + mBgmVar3 = mpSeqConfig->mLoopStart; + } + } + mSeqPlaySamplePosition += mSeqTimebase * mBgmVar3; + } else if (mpSeqConfig != nullptr) { + if (tick < (mpSeqConfig->mLoopEnd + 1) * mSeqTimebase) { + // not looped yet, no adjustment needed + mSeqPlaySamplePosition = tick; + return; + } + s32 startOffset = mpSeqConfig->mLoopStart * mSeqTimebase; + + // wrap around loop, making sure to account for start offset + tick -= startOffset; + tick = tick % (mSeqTimebase * (mpSeqConfig->mLoopEnd - mpSeqConfig->mLoopStart)); + mSeqPlaySamplePosition = tick + startOffset; + } else { + // Fallback, not controlled by seq no config override + mSeqPlaySamplePosition = tick; + } +} + +void dSndBgmSound_c::applyVars() { + if (isRunning()) { + mpHarpMgr->setPlaySamplePosition(getPlaySamplePosition()); + } +} + +void dSndBgmSound_c::onBecomeActive() { + if (mpHarpMgr != nullptr) { + mpHarpMgr->resetPrevIdx(); + } + mHarpMgr.resetPrevIdx(); + spGlobalHarpMgr->resetPrevIdx(); +} + +dSndBgmDataHarpVarSetBase_c *dSndBgmSound_c::getCurrentHarpVarSet() { + if (isRunning()) { + return mpHarpMgr->getCurrentVarSet(); + } + return nullptr; +} + +void dSndBgmSound_c::getHarpData(u32 soundId) { + if (soundId == -1) { + return; + } + + dSndBgmSoundHarpMgr_c *mgr = dSndBgmSeqDataMgr_c::GetInstance()->getHarpMgrForSoundId(soundId); + if (mgr != nullptr) { + mpHarpMgr = mgr; + } else { + loadNewHarpData(soundId); + } +} + +bool dSndBgmSound_c::loadNewHarpData(u32 soundId) { + if (soundId == -1) { + return false; + } + + if (!IsAttachedSound()) { + return false; + } + + bool ok = false; + if (!mHarpMgr.isLoaded()) { + dSndBgmMmlParserHarp_c parser(&mHarpMgr); + // result unused + (void)dSndBgmMgr_c::isSoundPlayedByBgmBattlePlayer(soundId); + if ((ok = parser.parseData(soundId, (1 << 15) | (1 << 0)))) { + mHarpMgr.setLoaded(); + } + } + + if (soundId == BGM_D301_INSIDE) { + spGlobalHarpMgr->reset(); + if (!spGlobalHarpMgr->isLoaded()) { + dSndBgmMmlParserHarp_c parser(spGlobalHarpMgr); + if ((ok = parser.parseData("BGM_D301_INSIDE_B", soundId, (1 << 15) | (1 << 0)))) { + spGlobalHarpMgr->setLoaded(); + } + } + } else if (soundId == BGM_D003_3) { + spGlobalHarpMgr->reset(); + if (!spGlobalHarpMgr->isLoaded()) { + dSndBgmMmlParserHarp_c parser(spGlobalHarpMgr); + if ((ok = parser.parseData("BGM_D003_3_B", soundId, (1 << 15) | (1 << 0)))) { + spGlobalHarpMgr->setLoaded(); + } + } + } else { + if (soundId == BGM_D101) { + spGlobalHarpMgr->reset(); + if (!spGlobalHarpMgr->isLoaded()) { + dSndBgmMmlParserHarp_c parser(spGlobalHarpMgr); + if ((ok = parser.parseData("BGM_D101_hell", soundId, (1 << 15) | (1 << 0)))) { + spGlobalHarpMgr->setLoaded(); + } + } + } + } + return ok; +} diff --git a/src/d/snd/d_snd_bgm_sound_battle.cpp b/src/d/snd/d_snd_bgm_sound_battle.cpp new file mode 100644 index 00000000..034fedb1 --- /dev/null +++ b/src/d/snd/d_snd_bgm_sound_battle.cpp @@ -0,0 +1,98 @@ +#include "d/snd/d_snd_bgm_sound_battle.h" + +#include "common.h" +#include "d/snd/d_snd_bgm_seq_config.h" +#include "d/snd/d_snd_bgm_sound.h" +#include "d/snd/d_snd_mgr.h" +#include "d/snd/d_snd_wzsound.h" +#include "nw4r/snd/snd_SeqSoundHandle.h" + +dSndBgmBattleSound_c::dSndBgmBattleSound_c() + : mpBgmBattleConfig(nullptr), mMuteGroupActiveMask(0), mPrevTick(0), field_0x190(0), field_0x191(1) {} + +void dSndBgmBattleSound_c::cancel() { + dSndBgmSound_c::cancel(); + mMuteGroupActiveMask = 0; + mPrevTick = 0; + field_0x190 = 0; + field_0x191 = 1; +} + +void dSndBgmBattleSound_c::loadSeqConfig(u32 soundId) { + if (dSndMgr_c::GetInstance()->getArchive()->GetSoundType(soundId) == nw4r::snd::SoundArchive::SOUND_TYPE_SEQ) { + if (soundId == BGM_BATTLE2) { + mpSeqConfig = dSndBgmSeqConfig::getConfig(soundId, 0); + } + + if (mpSeqConfig == nullptr) { + mpSeqConfig = dSndBgmSeqConfig::getConfig(soundId, 1); + } + } +} + +void dSndBgmBattleSound_c::fadeIn(u32 id, s32 fadeFrames) { + if (id == -1) { + return; + } + + // TODO - hmmm + mpBgmBattleConfig = nullptr; + mpBgmBattleConfig = dSndBgmBattleConfig::getConfig(GetId()); + + dSndBgmSound_c::fadeIn(id, fadeFrames); + + if (GetId() != BGM_BATTLE2) { + field_0x191 = 0; + } +} + +void dSndBgmBattleSound_c::setTrackGroupMuted(u32 groupId) { + mMuteGroupActiveMask |= (1 << groupId); +} + +void dSndBgmBattleSound_c::setTrackGroupUnmuted(u32 groupId) { + mMuteGroupActiveMask &= ~(1 << groupId); +} + +bool dSndBgmBattleSound_c::startMainBattleLoop() { + if (isPlaying() && readSeqTrackVariable(0) != 1) { + // This seq variable allows the seq sound to jump from intro to main loop + writeSeqTrackVariable(0, 1); + mpSeqConfig = dSndBgmSeqConfig::getConfig(GetId(), 1); + return true; + } + + return false; +} + +void dSndBgmBattleSound_c::calcSeqPlaySamplePosition() { + if (!isSeqSound()) { + return; + } + + nw4r::snd::SeqSoundHandle handle(this); + s32 tick = handle.GetTick(); + s32 tickDiff = tick - mPrevTick; + + if (tickDiff <= 0) { + return; + } + + mPrevTick = tick; + s32 timeBase = mpSeqConfig != nullptr ? mpSeqConfig->mTimebase : 0x180; + mBgmVar3 = readSeqTrackVariable(3); + if (mBgmVar3 >= 0) { + // Var >= 0 - seq itself controls play position + mSeqPlaySamplePosition = tick % mSeqTimebase; + mSeqPlaySamplePosition += mSeqTimebase * mBgmVar3; + } else if (mpSeqConfig != nullptr) { + mSeqPlaySamplePosition += tickDiff; + if (mSeqPlaySamplePosition < (mpSeqConfig->mLoopEnd + 1) * timeBase) { + // not looped yet, no adjustment needed + return; + } + // looped, simple adjustment - simplified compared to dSndBgmSound_c which always calculates + // mSeqPlaySamplePosition freshly. This function instead uses the difference + mSeqPlaySamplePosition -= (timeBase * (mpSeqConfig->mLoopEnd - mpSeqConfig->mLoopStart)); + } +} diff --git a/src/d/snd/d_snd_bgm_sound_harp_mgr.cpp b/src/d/snd/d_snd_bgm_sound_harp_mgr.cpp new file mode 100644 index 00000000..ee376ac9 --- /dev/null +++ b/src/d/snd/d_snd_bgm_sound_harp_mgr.cpp @@ -0,0 +1,41 @@ +#include "d/snd/d_snd_bgm_sound_harp_mgr.h" + +#include "common.h" + +dSndBgmSoundHarpMgr_c::dSndBgmSoundHarpMgr_c() + : mpCurrVarSet(nullptr), mSoundId(-1), mTempo(-1), mPrevIdx(-1), mIsLoaded(false) { + reset(); +} + +void dSndBgmSoundHarpMgr_c::setSoundId(u32 soundId) { + mSoundId = soundId; +} + +void dSndBgmSoundHarpMgr_c::setLoaded() { + mIsLoaded = true; +} + +void dSndBgmSoundHarpMgr_c::reset() { + mSoundId = -1; + mTempo = -1; + mPrevIdx = -1; + mHarpData.resetVars(); + mpCurrVarSet = 0; + mIsLoaded = false; +} + +void dSndBgmSoundHarpMgr_c::setPlaySamplePosition(s32 position) { + if (position < 0) { + return; + } + s32 idx = mHarpData.getIdxForPosition(position); + if (idx != mPrevIdx && idx >= 0) { + mHarpData.writeSeqVars(idx); + mpCurrVarSet = mHarpData.getUsableVarSet(idx); + mPrevIdx = idx; + } +} + +dSndBgmDataHarpVarSetBase_c *dSndBgmSoundHarpMgr_c::getCurrentVarSet() { + return mpCurrVarSet; +} diff --git a/src/d/snd/d_snd_control_player.cpp b/src/d/snd/d_snd_control_player.cpp index 824f327a..fe0d9e4b 100644 --- a/src/d/snd/d_snd_control_player.cpp +++ b/src/d/snd/d_snd_control_player.cpp @@ -2,6 +2,7 @@ #include "common.h" #include "d/snd/d_snd_control_player_mgr.h" +#include "d/snd/d_snd_player_mgr.h" #include "d/snd/d_snd_sound.h" #include "nw4r/snd/snd_SoundPlayer.h" #include "nw4r/snd/snd_global.h" @@ -57,11 +58,9 @@ void dSndControlPlayerFxSend_c::apply() { mpPlayer->SetFxSend(nw4r::snd::AUX_B, mCurrValue); } -extern "C" bool fn_8035F030(s32); - f32 dSndControlPlayerFxSend_c::getAppliedValue() { int auxBus = nw4r::snd::AUX_A; - if (fn_8035F030(mIndex)) { + if (dSndPlayerMgr_c::isBgmPlayerId(mIndex)) { auxBus = nw4r::snd::AUX_B; } return mpPlayer->GetFxSend(auxBus); diff --git a/src/d/snd/d_snd_control_player_mgr.cpp b/src/d/snd/d_snd_control_player_mgr.cpp index 22223c98..5503760a 100644 --- a/src/d/snd/d_snd_control_player_mgr.cpp +++ b/src/d/snd/d_snd_control_player_mgr.cpp @@ -1,12 +1,13 @@ #include "d/snd/d_snd_control_player_mgr.h" #include "common.h" +#include "d/snd/d_snd_bgm_mgr.h" #include "d/snd/d_snd_control_player.h" #include "d/snd/d_snd_mgr.h" #include "d/snd/d_snd_player_mgr.h" +#include "d/snd/d_snd_state_mgr.h" #include "nw4r/snd/snd_SoundHandle.h" #include "nw4r/ut/ut_list.h" -#include "toBeSorted/music_mgrs.h" struct FanfareMuteFlagsApplier { ~FanfareMuteFlagsApplier() {} @@ -14,7 +15,7 @@ struct FanfareMuteFlagsApplier { // The logic here is inverted compared to the others - Fanfares seem to // mute things by default unless otherwise speciefied u32 id = handle.GetId(); - if (fn_803733B0(FANFARE_SOUND_MGR, id)) { + if (dSndBgmMgr_c::GetInstance()->getSoundHandleCurrentlyPlayingFanSound(id)) { u32 userParam = dSndMgr_c::GetInstance()->getArchive()->GetSoundUserParam(id); if (!(userParam & dSndPlayerMgr_c::FANFARE_UNMUTE_BGM)) { dSndControlPlayerMgr_c::GetInstance()->setGroupVolumeFlag( @@ -23,7 +24,7 @@ struct FanfareMuteFlagsApplier { dSndControlPlayerMgr_c::GetInstance()->setBgmVolumeDecreaseSpeed(0.2f); } - if (fn_80364DA0(ENEMY_SOUND_MGR)) { + if (dSndStateMgr_c::GetInstance()->isInEvent()) { if (!(userParam & dSndPlayerMgr_c::FANFARE_UNMUTE_STAGE_EFFECTS)) { dSndControlPlayerMgr_c::GetInstance()->setGroupVolumeFlag( dSndControlPlayerMgr_c::CTRL_GROUP_STAGE_EFFECTS, dSndControlPlayerMgr_c::MUTE_FULL @@ -339,6 +340,30 @@ f32 dSndControlPlayerMgr_c::getControlTarget(PlayerCtrl_e ctrlType, u32 playerId return mpCtrls[ctrlType][playerIdx].getTargetValue(); } +// TODO - not sure what this actually does +void dSndControlPlayerMgr_c::unmutePlayer(u32 idx, s32 frames) { + if (idx >= sNumPlayers) { + return; + } + + restoreVolume(idx, 0); + overrideVolume(idx, 0.0f, 0); + restoreVolume(idx, frames); +} + + +void dSndControlPlayerMgr_c::unmuteScenePlayers(s32 frames) { + for (u32 i = dSndPlayerMgr_c::PLAYER_ENEMY; i < dSndPlayerMgr_c::PLAYER_AREA; i++) { + unmutePlayer(i, frames); + } +} + +void dSndControlPlayerMgr_c::muteScenePlayers(s32 frames) { + for (u32 i = dSndPlayerMgr_c::PLAYER_ENEMY; i < dSndPlayerMgr_c::PLAYER_AREA; i++) { + overrideVolume(i, 0.0f, frames); + } +} + void dSndControlPlayerMgr_c::setGroupVolumeFlag(VolumeControlGroup group, MuteLevel level) { if (group >= CTRL_GROUP_MAX) { return; @@ -369,7 +394,7 @@ void dSndControlPlayerMgr_c::setPlayerVolumeInternal(u32 playerIdx, f32 volume) } void dSndControlPlayerMgr_c::setBgmMuteVolume(f32 volume) { - for (u32 i = dSndPlayerMgr_c::PLAYER_BGM; i < dSndPlayerMgr_c::PLAYER_BGM_BOSS + 1; i++) { + for (u32 i = dSndPlayerMgr_c::PLAYER_BGM; i < dSndPlayerMgr_c::PLAYER_BGM_BATTLE + 1; i++) { setPlayerVolumeInternal(i, volume); } } diff --git a/src/d/snd/d_snd_distant_sound_actor.cpp b/src/d/snd/d_snd_distant_sound_actor.cpp new file mode 100644 index 00000000..0dad5ccc --- /dev/null +++ b/src/d/snd/d_snd_distant_sound_actor.cpp @@ -0,0 +1,120 @@ + + +#include "d/snd/d_snd_distant_sound_actor.h" + +#include "common.h" +#include "d/snd/d_snd_3d_actor.h" +#include "d/snd/d_snd_distant_sound_actor_pool.h" +#include "d/snd/d_snd_source.h" +#include "d/snd/d_snd_source_enums.h" +#include "d/snd/d_snd_state_mgr.h" + +dSndDistantSoundActor_c::dSndDistantSoundActor_c() + : dSnd3DActor_c(&dSndDistantSoundActorPool_c::GetInstance()->getSourceParam(), SND_SOURCE_DISTANT), + mpHoldSoundHandle(nullptr), + mpSoundSource(nullptr), + mpSoundHandle(&mSoundHandle), + mIsActive(false), + mUseSourcePosition(false) {} + +void dSndDistantSoundActor_c::initSource(dSoundSource_c *pSource) { + resetCachedRelativePositions(); + loadDefaultParam(); + setSourceDirectly(pSource); + mUseSourcePosition = false; +} + +void dSndDistantSoundActor_c::setSourceDirectly(dSoundSource_c *pSource) { + mpSoundSource = pSource; + if (mpSoundSource != nullptr) { + setSourceParam(pSource->getSourceParam()); + } +} + +void dSndDistantSoundActor_c::updatePosition() { + if (mpSoundSource != nullptr && mUseSourcePosition) { + dSnd3DActor_c::setPosition(mpSoundSource->GetPosition()); + } else { + dSnd3DActor_c::setPosition(GetPosition()); + } +} + +void dSndDistantSoundActor_c::postStartSound(nw4r::snd::SoundHandle &handle, dSndSeSound_c *pSound, u32 id) { + if (mpSoundSource != nullptr) { + mpSoundSource->postStartSound(handle, pSound, id); + } +} + +void dSndDistantSoundActor_c::postHoldSound(nw4r::snd::SoundHandle &handle, dSndSeSound_c *pSound, u32 id, UNKWORD arg) { + if (mpSoundSource != nullptr) { + mpSoundSource->postHoldSound(handle, pSound, id, arg); + } +} + +bool dSndDistantSoundActor_c::startSound( + u32 soundId, const nw4r::math::VEC3 &position, nw4r::snd::SoundHandle *pHandle +) { + if (mIsDisabled) { + return false; + } + + if (pHandle == nullptr) { + pHandle = &mSoundHandle; + } else { + mpSoundHandle = pHandle; + } + + SetPosition(position); + updateSome3DField(); + return StartSound(pHandle, soundId); +} + +bool dSndDistantSoundActor_c::holdSound( + u32 soundId, const nw4r::math::VEC3 &position, nw4r::snd::SoundHandle *pHandle +) { + if (mIsDisabled) { + return false; + } + + if (pHandle == nullptr) { + pHandle = &mSoundHandle; + } else { + mpSoundHandle = pHandle; + } + + SetPosition(position); + return HoldSound(pHandle, soundId); +} + +void dSndDistantSoundActor_c::loadDefaultParam() { + setSourceParam(&dSndDistantSoundActorPool_c::GetInstance()->getSourceParam()); +} + +void dSndDistantSoundActor_c::detachFromSource() { + if (mpSoundSource != nullptr) { + mpSoundSource->detachDistantSound(this); + } + mpSoundSource = nullptr; + mpHoldSoundHandle = nullptr; +} + +void dSndDistantSoundActor_c::setPause(bool flag, int fadeFrames) { + if (mIsPaused && !flag) { + PauseAllSound(flag, fadeFrames); + mIsPaused = false; + } else if (!mIsPaused && flag) { + PauseAllSound(flag, fadeFrames); + mIsPaused = true; + } +} + +void dSndDistantSoundActor_c::updateSome3DField() { + mFxSend3D = dSndStateMgr_c::GetInstance()->getFxSend3D(); +} + +UNKWORD dSndDistantSoundActor_c::d_vt_0x3C() { + if (mpSoundSource != nullptr) { + return mpSoundSource->d_vt_0x3C(); + } + return 0; +} diff --git a/src/d/snd/d_snd_distant_sound_actor_pool.cpp b/src/d/snd/d_snd_distant_sound_actor_pool.cpp new file mode 100644 index 00000000..931ea175 --- /dev/null +++ b/src/d/snd/d_snd_distant_sound_actor_pool.cpp @@ -0,0 +1,167 @@ +#include "d/snd/d_snd_distant_sound_actor_pool.h" + +#include "common.h" +#include "d/snd/d_snd_distant_sound_actor.h" +#include "d/snd/d_snd_source.h" +#include "nw4r/math/math_types.h" +#include "nw4r/ut/ut_list.h" + +#include + +SND_DISPOSER_DEFINE(dSndDistantSoundActorPool_c); + +dSndSourceParam dSndDistantSoundActorPool_c::sParam; + +dSndDistantSoundActorPool_c::dSndDistantSoundActorPool_c() { + field_0x4210 = 0; + // TODO offsetof + nw4r::ut::List_Init(&mActiveActors, 0xE4); + sParam.reset(INFINITY); +} + +void dSndDistantSoundActorPool_c::setup() { + field_0x4210 = 0; + for (int i = 0; i < POOL_SIZE; i++) { + mSounds[i].loadDefaultParam(); + mSounds[i].setSource(nullptr); + mSounds[i].initSource(nullptr); + } +} + +void dSndDistantSoundActorPool_c::calc() { + dSndDistantSoundActor_c *it, *next; + for (dSndDistantSoundActor_c *it = static_cast(nw4r::ut::List_GetFirst(&mActiveActors)); it != nullptr; it = next) { + next = static_cast(nw4r::ut::List_GetNext(&mActiveActors, it)); + if (it->hasPlayingSounds()) { + it->updatePosition(); + } else { + if (it->hasAttachedSource()) { + it->detachFromSource(); + } + it->resetHandle(); + removeFromActiveList(it); + } + } +} + +dSndDistantSoundActor_c * +dSndDistantSoundActorPool_c::acquireActor(u32 soundId, const nw4r::math::VEC3 *position, dSoundSource_c *source) { + if (soundId == -1) { + return nullptr; + } + + dSndDistantSoundActor_c *ac = nullptr; + int i = 0; + while (ac == nullptr) { + ac = &mSounds[field_0x4210]; + field_0x4210++; + if (field_0x4210 >= POOL_SIZE) { + field_0x4210 = 0; + } + if (ac->isActive()) { + i++; + ac = nullptr; + if (i >= POOL_SIZE) { + break; + } + } + } + + if (ac != nullptr) { + if (source != nullptr) { + ac->initSource(source); + source->attachDistantSound(ac); + } else { + ac->loadDefaultParam(); + ac->setSource(nullptr); + } + ac->SetPosition(*position); + ac->updateListenerParameters(); + ac->updateCameraTargetParameters(); + + addToActiveList(ac, soundId); + + return ac; + } + return nullptr; +} + +void dSndDistantSoundActorPool_c::addToActiveList(dSndDistantSoundActor_c *actor, u32 id) { + if (actor == nullptr) { + return; + } + if (actor->isActive()) { + return; + } + nw4r::ut::List_Append(&mActiveActors, actor); + actor->setActive(true); +} + +void dSndDistantSoundActorPool_c::removeFromActiveList(dSndDistantSoundActor_c *actor) { + if (actor == nullptr) { + return; + } + if (!actor->isActive()) { + return; + } + nw4r::ut::List_Remove(&mActiveActors, actor); + actor->setActive(false); +} + +bool dSndDistantSoundActorPool_c::startSound(u32 soundId, const nw4r::math::VEC3 *position) { + dSndDistantSoundActor_c *ac = acquireActor(soundId, position, nullptr); + if (ac != nullptr) { + return ac->startSound(soundId, *position, nullptr); + } + return false; +} + +dSndDistantSoundActor_c *dSndDistantSoundActorPool_c::findActiveActor(u32 soundId, dSoundSource_c *source) { + for (dSndDistantSoundActor_c *it = static_cast(nw4r::ut::List_GetFirst(&mActiveActors)); it != nullptr; it = static_cast(nw4r::ut::List_GetNext(&mActiveActors, it))) { + if (it->isAttachedSource(source) && it->isPlayingSound(soundId)) { + return it; + } + } + + return nullptr; +} + +bool dSndDistantSoundActorPool_c::holdSound(u32 soundId, const nw4r::math::VEC3 *position) { + dSndDistantSoundActor_c *ac = findActiveActor(soundId, nullptr); + if (ac == nullptr) { + ac = acquireActor(soundId, position, nullptr); + if (ac != nullptr) { + ac->updateSome3DField(); + } + } + if (ac != nullptr) { + return ac->holdSound(soundId, *position, nullptr); + } + return false; + +} + +void dSndDistantSoundActorPool_c::setAllPause(bool flag, s32 fadeFrames) { + for (dSndDistantSoundActor_c *it = static_cast(nw4r::ut::List_GetFirst(&mActiveActors)); it != nullptr; it = static_cast(nw4r::ut::List_GetNext(&mActiveActors, it))) { + it->setPause(flag, fadeFrames); + } +} + +void dSndDistantSoundActorPool_c::disableAll() { + for (int i = 0; i < POOL_SIZE; i++) { + mSounds[i].setDisabled(true); + } +} + +void dSndDistantSoundActorPool_c::enableAll() { + for (int i = 0; i < POOL_SIZE; i++) { + mSounds[i].setDisabled(false); + } +} + +void dSndDistantSoundActorPool_c::onChangeStage() { + nw4r::math::VEC3 v(INFINITY, INFINITY, INFINITY); + for (int i = 0; i < POOL_SIZE; i++) { + mSounds[i].SetPosition(v); + } +} diff --git a/src/d/snd/d_snd_event_callbacks.cpp b/src/d/snd/d_snd_event_callbacks.cpp new file mode 100644 index 00000000..9e05cc71 --- /dev/null +++ b/src/d/snd/d_snd_event_callbacks.cpp @@ -0,0 +1,259 @@ +#include "common.h" +#include "d/snd/d_snd_event.h" +#include "d/snd/d_snd_stage_data.h" +#include "d/snd/d_snd_state_mgr.h" + +void todoInititalizeSndEvent(); +void todoExecuteSndEvent(); +void todoFinalizeSndEvent(bool skipped); + +#pragma push +#pragma readonly_strings on +// clang-format off + +static const SndEventDef sSndEventDefs_GLOBAL[] = { + { "DefaultStart", SND_EVENT_DefaultStart, todoInititalizeSndEvent, nullptr, nullptr}, + { "SkyDiveStart", SND_EVENT_SkyDiveStart, todoInititalizeSndEvent, nullptr, nullptr}, + { "ShortDiveStart", SND_EVENT_ShortDiveStart, todoInititalizeSndEvent, nullptr, nullptr}, + { "ParachuteStart", SND_EVENT_ParachuteStart, todoInititalizeSndEvent, nullptr, nullptr}, + { "SirenBackStart", SND_EVENT_SirenBackStart, todoInititalizeSndEvent, nullptr, nullptr}, + { "TimeDoorIn", SND_EVENT_TimeDoorIn, nullptr, todoExecuteSndEvent, nullptr}, + { "TimeDoorOut", SND_EVENT_TimeDoorOut, todoInititalizeSndEvent, todoExecuteSndEvent, nullptr}, + { "ReturnSkyloft", SND_EVENT_ReturnSkyloft, todoInititalizeSndEvent, nullptr, nullptr}, + { "Shutter", SND_EVENT_Shutter, todoInititalizeSndEvent, nullptr, todoFinalizeSndEvent}, + { "DayTime", SND_EVENT_DayTime, todoInititalizeSndEvent, nullptr, nullptr}, + { "BedStart", SND_EVENT_BedStart, todoInititalizeSndEvent, nullptr, nullptr}, + { "TboxShow", SND_EVENT_TboxShow, todoInititalizeSndEvent, nullptr, nullptr}, + { "TreasureBoxOpen", SND_EVENT_TreasureBoxOpen, todoInititalizeSndEvent, nullptr, nullptr}, + { "TreasureBoxOpenBoss", SND_EVENT_TreasureBoxOpenBoss, todoInititalizeSndEvent, nullptr, nullptr}, + { "FaysSirenSong", SND_EVENT_FaysSirenSong, todoInititalizeSndEvent, nullptr, nullptr}, + { "fays_song_fin_siren", SND_EVENT_fays_song_fin_siren, todoInititalizeSndEvent, nullptr, nullptr}, + { "SDGateInOpen", SND_EVENT_SDGateInOpen, todoInititalizeSndEvent, nullptr, nullptr}, + { "SealedDoorOpen", SND_EVENT_SealedDoorOpen, todoInititalizeSndEvent, nullptr, nullptr}, + { "SealedDoorClose", SND_EVENT_SealedDoorClose, todoInititalizeSndEvent, nullptr, nullptr}, + { "HeartContainer", SND_EVENT_HeartContainer, todoInititalizeSndEvent, nullptr, todoFinalizeSndEvent}, + { "ordinary_sword_sprit", SND_EVENT_ordinary_sword_sprit, todoInititalizeSndEvent, nullptr, nullptr}, + { "fays_navigate", SND_EVENT_fays_navigate, todoInititalizeSndEvent, nullptr, nullptr}, + { "fays_allert", SND_EVENT_fays_allert, todoInititalizeSndEvent, nullptr, nullptr}, + { "DefaultGetItem", SND_EVENT_DefaultGetItem, todoInititalizeSndEvent, nullptr, nullptr}, + { "ItemGetGorgeous", SND_EVENT_ItemGetGorgeous, todoInititalizeSndEvent, nullptr, nullptr}, + { "Save", SND_EVENT_Save, todoInititalizeSndEvent, nullptr, nullptr}, + { "SwordDraw", SND_EVENT_SwordDraw, todoInititalizeSndEvent, nullptr, nullptr}, + { "SwordDrawDoorNew", SND_EVENT_SwordDrawDoorNew, todoInititalizeSndEvent, nullptr, nullptr}, + { "DoorBossGame", SND_EVENT_DoorBossGame, todoInititalizeSndEvent, nullptr, nullptr}, + { "FallRestart", SND_EVENT_FallRestart, todoInititalizeSndEvent, nullptr, nullptr}, + { "DeadMagma", SND_EVENT_DeadMagma, todoInititalizeSndEvent, nullptr, nullptr}, + { "DeadSink", SND_EVENT_DeadSink, todoInititalizeSndEvent, nullptr, nullptr}, + { "Dead", SND_EVENT_Dead, todoInititalizeSndEvent, nullptr, nullptr}, + { "DeadDive", SND_EVENT_DeadDive, nullptr, todoExecuteSndEvent, nullptr}, + { "SirenChaser2", SND_EVENT_SirenChaser2, nullptr, nullptr, todoFinalizeSndEvent}, + { "JMAP", SND_EVENT_JMAP, todoInititalizeSndEvent, nullptr, nullptr}, + { "JMAPAllMove", SND_EVENT_JMAPAllMove, todoInititalizeSndEvent, nullptr, nullptr}, + { "OracleInSiren", SND_EVENT_OracleInSiren, todoInititalizeSndEvent, nullptr, nullptr}, + { "HarpPerformanceResult", SND_EVENT_HarpPerformanceResult, nullptr, todoExecuteSndEvent, nullptr}, + { "F102Intro2", SND_EVENT_F102Intro2, todoInititalizeSndEvent, todoExecuteSndEvent, nullptr}, + { "Uo", SND_EVENT_Uo, todoInititalizeSndEvent, nullptr, todoFinalizeSndEvent}, + { "WaterfallStop", SND_EVENT_WaterfallStop, nullptr, nullptr, todoFinalizeSndEvent}, + { "F103Intro2", SND_EVENT_F103Intro2, todoInititalizeSndEvent, todoExecuteSndEvent, nullptr}, + { "Onp", SND_EVENT_Onp, todoInititalizeSndEvent, todoExecuteSndEvent, todoFinalizeSndEvent}, + { "F103_UoMS", SND_EVENT_F103_UoMS, todoInititalizeSndEvent, nullptr, todoFinalizeSndEvent}, + { "F200IntroByFay", SND_EVENT_F200IntroByFay, todoInititalizeSndEvent, todoExecuteSndEvent, nullptr}, + { "F202_R02Intro", SND_EVENT_F202_R02Intro, todoInititalizeSndEvent, nullptr, nullptr}, + { "SearchLightDemo", SND_EVENT_SearchLightDemo, nullptr, nullptr, nullptr}, + { "F300_1IntroByFay", SND_EVENT_F300_1IntroByFay, todoInititalizeSndEvent, todoExecuteSndEvent, nullptr}, + { "FirstTimeSlip", SND_EVENT_FirstTimeSlip, todoInititalizeSndEvent, nullptr, todoFinalizeSndEvent}, + { "F301IntroByFay", SND_EVENT_F301IntroByFay, todoInititalizeSndEvent, todoExecuteSndEvent, todoFinalizeSndEvent}, + { "F302RevivalRairyu", SND_EVENT_F302RevivalRairyu, todoInititalizeSndEvent, todoExecuteSndEvent, nullptr}, + { "F402L3QuakeStart", SND_EVENT_F402L3QuakeStart, todoInititalizeSndEvent, todoExecuteSndEvent, nullptr}, + {"Girahimu3SecondAppearDemo", SND_EVENT_Girahimu3SecondAppearDemo, nullptr, todoExecuteSndEvent, todoFinalizeSndEvent}, + { "SF_start", SND_EVENT_SF_start, todoInititalizeSndEvent, nullptr, todoFinalizeSndEvent}, + { "GirahimuSwordDemo", SND_EVENT_GirahimuSwordDemo, nullptr, todoExecuteSndEvent, nullptr}, + { "AsuraStart", SND_EVENT_AsuraStart, todoInititalizeSndEvent, todoExecuteSndEvent, todoFinalizeSndEvent}, + { "AsuraStartB", SND_EVENT_AsuraStartB, todoInititalizeSndEvent, nullptr, todoFinalizeSndEvent}, + { "RollRockLspAppear", SND_EVENT_RollRockLspAppear, todoInititalizeSndEvent, nullptr, nullptr}, + { "RollRockChangeVera", SND_EVENT_RollRockChangeVera, todoInititalizeSndEvent, nullptr, nullptr}, + { "MG_start", SND_EVENT_MG_start, todoInititalizeSndEvent, nullptr, todoFinalizeSndEvent}, + { "BLS_demo2", SND_EVENT_BLS_demo2, todoInititalizeSndEvent, todoExecuteSndEvent, nullptr}, + { "BLS_end", SND_EVENT_BLS_end, todoInititalizeSndEvent, nullptr, nullptr}, + { "ECaptain_c_Opening", SND_EVENT_ECaptain_c_Opening, todoInititalizeSndEvent, nullptr, todoFinalizeSndEvent}, + { "D003Intro", SND_EVENT_D003Intro, todoInititalizeSndEvent, nullptr, nullptr}, + { "ECaptain_c_OpeningType2", SND_EVENT_ECaptain_c_OpeningType2, todoInititalizeSndEvent, nullptr, todoFinalizeSndEvent}, + { "SF4_End", SND_EVENT_SF4_End, nullptr, nullptr, nullptr}, + { "TriforceWarp", SND_EVENT_TriforceWarp, nullptr, todoExecuteSndEvent, nullptr}, +}; + +static const SndEventDef sSndEventDefs_F000[] = { + {"CeremonyByRescueTeam", SND_EVENT_CeremonyByRescueTeam, todoInititalizeSndEvent, nullptr, nullptr}, + { "BirdRaceStart", SND_EVENT_BirdRaceStart, nullptr, nullptr, todoFinalizeSndEvent}, + { "GoddessGateOpen", SND_EVENT_GoddessGateOpen, nullptr, todoExecuteSndEvent, nullptr}, + { "FaysPharosSong", SND_EVENT_FaysPharosSong, todoInititalizeSndEvent, nullptr, nullptr}, + { "fays_song_pharos", SND_EVENT_fays_song_pharos, todoInititalizeSndEvent, nullptr, nullptr}, + {"fays_song_fin_pharos", SND_EVENT_fays_song_fin_pharos, nullptr, nullptr, todoFinalizeSndEvent}, +}; + +static const SndEventDef sSndEventDefs_F001r[] = { + {"OracleInSiren", SND_EVENT_OracleInSiren, todoInititalizeSndEvent, nullptr, nullptr}, +}; + +static const SndEventDef sSndEventDefs_F020[] = { + { "ItemGetBird", SND_EVENT_ItemGetBird, todoInititalizeSndEvent, nullptr, nullptr}, + { "DivingMGStart", SND_EVENT_DivingMGStart, todoInititalizeSndEvent, nullptr, todoFinalizeSndEvent}, + { "DiveGameResult", SND_EVENT_DiveGameResult, todoInititalizeSndEvent, todoExecuteSndEvent, nullptr}, + { "StartCarryPumpkin", SND_EVENT_StartCarryPumpkin, todoInititalizeSndEvent, nullptr, nullptr}, + { "CarryPumpkinResultsFailed", SND_EVENT_CarryPumpkinResultsFailed, todoInititalizeSndEvent, nullptr, nullptr}, + {"CarryPumpkinResultsSuccessful", SND_EVENT_CarryPumpkinResultsSuccessful, todoInititalizeSndEvent, nullptr, nullptr}, +}; + +static const SndEventDef sSndEventDefs_F023[] = { + { "NusiAppearDemo", SND_EVENT_NusiAppearDemo, todoInititalizeSndEvent, nullptr, todoFinalizeSndEvent}, + {"NusiTHideAppearDemo", SND_EVENT_NusiTHideAppearDemo, todoInititalizeSndEvent, nullptr, nullptr}, + { "TenAppearDemo", SND_EVENT_TenAppearDemo, todoInititalizeSndEvent, todoExecuteSndEvent, todoFinalizeSndEvent}, + { "NusiTDeathDemo", SND_EVENT_NusiTDeathDemo, todoInititalizeSndEvent, nullptr, nullptr}, + { "NusiDeathDemo", SND_EVENT_NusiDeathDemo, todoInititalizeSndEvent, todoExecuteSndEvent, nullptr}, +}; + +static const SndEventDef sSndEventDefs_F100[] = { + {"F100IntroByFay", SND_EVENT_F100IntroByFay, todoInititalizeSndEvent, todoExecuteSndEvent, nullptr}, + { "BC_wakidasi", SND_EVENT_BC_wakidasi, todoInititalizeSndEvent, nullptr, nullptr}, + { "Kyui3Fall", SND_EVENT_Kyui3Fall, nullptr, nullptr, todoFinalizeSndEvent}, +}; + +static const SndEventDef sSndEventDefs_F401[] = { + {"F401IntroByFay", SND_EVENT_F401IntroByFay, todoInititalizeSndEvent, todoExecuteSndEvent, nullptr}, + { "BBossAppear", SND_EVENT_BBossAppear, todoInititalizeSndEvent, todoExecuteSndEvent, todoFinalizeSndEvent}, + { "BBFLYDEMO", SND_EVENT_BBFLYDEMO, todoInititalizeSndEvent, nullptr, todoFinalizeSndEvent}, + { "BBossEvac", SND_EVENT_BBossEvac, todoInititalizeSndEvent, todoExecuteSndEvent, nullptr}, + { "BBoss2Evac", SND_EVENT_BBoss2Evac, todoInititalizeSndEvent, todoExecuteSndEvent, nullptr}, + { "BBoss3Evac", SND_EVENT_BBoss3Evac, todoInititalizeSndEvent, todoExecuteSndEvent, nullptr}, + { "BBFuuin", SND_EVENT_BBFuuin, todoInititalizeSndEvent, todoExecuteSndEvent, nullptr}, + { "BBHDTH", SND_EVENT_BBHDTH, nullptr, nullptr, nullptr}, + { "BBHDRC", SND_EVENT_BBHDRC, nullptr, nullptr, nullptr}, + { "BBFCL", SND_EVENT_BBFCL, nullptr, nullptr, nullptr}, + { "BBTUTO", SND_EVENT_BBTUTO, todoInititalizeSndEvent, nullptr, nullptr}, +}; + +static const SndEventDef sSndEventDefs_D101[] = { + { "SF4_Op", SND_EVENT_SF4_Op, todoInititalizeSndEvent, nullptr, todoFinalizeSndEvent}, + { "SF4_End", SND_EVENT_SF4_End, todoInititalizeSndEvent, nullptr, nullptr}, + {"JMAPAllMove", SND_EVENT_JMAPAllMove, todoInititalizeSndEvent, nullptr, nullptr}, +}; + +static const SndEventDef sSndEventDefs_D200[] = { + {"ELizarufos_c_opening", SND_EVENT_ELizarufos_c_opening, todoInititalizeSndEvent, nullptr, todoFinalizeSndEvent}, + { "D200R04Rock", SND_EVENT_D200R04Rock, todoInititalizeSndEvent, nullptr, nullptr}, + { "RollRockLspJump", SND_EVENT_RollRockLspJump, todoInititalizeSndEvent, nullptr, nullptr}, + { "JMAP", SND_EVENT_JMAP, todoInititalizeSndEvent, nullptr, nullptr}, +}; + +static const SndEventDef sSndEventDefs_D201[] = { + { "MoleInitFear", SND_EVENT_MoleInitFear, todoInititalizeSndEvent, todoExecuteSndEvent, nullptr}, + {"MolePushSwitch", SND_EVENT_MolePushSwitch, todoInititalizeSndEvent, nullptr, nullptr}, + { "MoleInitTalk", SND_EVENT_MoleInitTalk, todoInititalizeSndEvent, nullptr, todoFinalizeSndEvent}, + { "CatchMole", SND_EVENT_CatchMole, todoInititalizeSndEvent, nullptr, nullptr}, + { "D201IronFence", SND_EVENT_D201IronFence, todoInititalizeSndEvent, nullptr, nullptr}, + { "MogMolShut", SND_EVENT_MogMolShut, nullptr, nullptr, todoFinalizeSndEvent}, + { "MogMolOpen", SND_EVENT_MogMolOpen, todoInititalizeSndEvent, nullptr, todoFinalizeSndEvent}, + { "LavaPlate", SND_EVENT_LavaPlate, todoInititalizeSndEvent, nullptr, nullptr}, + { "ResqueMole", SND_EVENT_ResqueMole, todoInititalizeSndEvent, nullptr, nullptr}, +}; + +static const SndEventDef sSndEventDefs_B301[] = { + { "BKR_start", SND_EVENT_BKR_start, todoInititalizeSndEvent, todoExecuteSndEvent, todoFinalizeSndEvent}, + { "BKR_end", SND_EVENT_BKR_end, todoInititalizeSndEvent, todoExecuteSndEvent, todoFinalizeSndEvent}, + {"BKR_armCaught", SND_EVENT_BKR_armCaught, nullptr, nullptr, nullptr}, +}; + +static const SndEventDef sSndEventDefs_D003_1[] = { + {"NeedleUnderground", SND_EVENT_NeedleUnderground, todoInititalizeSndEvent, nullptr, todoFinalizeSndEvent}, +}; + +// clang-format on + +#pragma pop + +bool dSndStateMgr_c::handleStageEvent(const char *name) { + if (mSoundEventId != SND_EVENT_0x87) { + const SndEventDef *def = nullptr; + s32 defCount = 0; + + switch (field_0x044) { + case SND_STAGE_F000: + def = sSndEventDefs_F000; + defCount = ARRAY_LENGTH(sSndEventDefs_F000); + break; + case SND_STAGE_F001r: + def = sSndEventDefs_F001r; + defCount = ARRAY_LENGTH(sSndEventDefs_F001r); + break; + case SND_STAGE_F020: + def = sSndEventDefs_F020; + defCount = ARRAY_LENGTH(sSndEventDefs_F020); + break; + case SND_STAGE_F023: + def = sSndEventDefs_F023; + defCount = ARRAY_LENGTH(sSndEventDefs_F023); + break; + case SND_STAGE_F100: + def = sSndEventDefs_F100; + defCount = ARRAY_LENGTH(sSndEventDefs_F100); + break; + case SND_STAGE_F401: + def = sSndEventDefs_F401; + defCount = ARRAY_LENGTH(sSndEventDefs_F401); + break; + case SND_STAGE_D101: + def = sSndEventDefs_D101; + defCount = ARRAY_LENGTH(sSndEventDefs_D101); + break; + case SND_STAGE_D200: + def = sSndEventDefs_D200; + defCount = ARRAY_LENGTH(sSndEventDefs_D200); + break; + case SND_STAGE_D201: + def = sSndEventDefs_D201; + defCount = ARRAY_LENGTH(sSndEventDefs_D201); + break; + case SND_STAGE_B301: + def = sSndEventDefs_B301; + defCount = ARRAY_LENGTH(sSndEventDefs_B301); + break; + case SND_STAGE_D003_1: + def = sSndEventDefs_D003_1; + defCount = ARRAY_LENGTH(sSndEventDefs_D003_1); + break; + } + + if (def != nullptr && defCount > 0) { + for (s32 i = 0; i < defCount; def++, i++) { + if (streq(name, def->eventName)) { + mSoundEventId = def->eventId; + mpSoundEventDef = def; + sEventExecuteCallback = def->executeCb; + if (def->initializeCb != nullptr) { + (def->initializeCb)(); + } + return true; + } + } + } + } + return false; +} + +bool dSndStateMgr_c::handleGlobalEvent(const char *name) { + if (mSoundEventId != SND_EVENT_0x87) { + for (const SndEventDef *def = sSndEventDefs_GLOBAL; + def < sSndEventDefs_GLOBAL + ARRAY_LENGTH(sSndEventDefs_GLOBAL); def++) { + if (streq(name, def->eventName)) { + mSoundEventId = def->eventId; + mpSoundEventDef = def; + sEventExecuteCallback = def->executeCb; + if (def->initializeCb != nullptr) { + (def->initializeCb)(); + } + return true; + } + } + } + return false; +} diff --git a/src/d/snd/d_snd_event_demo_callbacks.cpp b/src/d/snd/d_snd_event_demo_callbacks.cpp new file mode 100644 index 00000000..8d806c06 --- /dev/null +++ b/src/d/snd/d_snd_event_demo_callbacks.cpp @@ -0,0 +1,47 @@ +#include "common.h" +#include "d/snd/d_snd_event.h" +#include "d/snd/d_snd_state_mgr.h" + +void todoInititalizeSndEvent(); +void todoExecuteSndEvent(); + +// clang-format off + +static const SndEventDef sSndEventDefs_DEMO[] = { + {"Demo03_03", SND_EVENT_Demo03_03, todoInititalizeSndEvent, todoExecuteSndEvent, nullptr}, + {"Demo08_01", SND_EVENT_Demo08_01, todoInititalizeSndEvent, todoExecuteSndEvent, nullptr}, + {"Demo15_04", SND_EVENT_Demo15_04, todoInititalizeSndEvent, todoExecuteSndEvent, nullptr}, + {"Demo36_01", SND_EVENT_Demo36_01, nullptr, todoExecuteSndEvent, nullptr}, + {"Demo41_01", SND_EVENT_Demo41_01, todoInititalizeSndEvent, todoExecuteSndEvent, nullptr}, + {"Demo59_01", SND_EVENT_Demo59_01, nullptr, todoExecuteSndEvent, nullptr}, + {"Demo62_01", SND_EVENT_Demo62_01, todoInititalizeSndEvent, todoExecuteSndEvent, nullptr}, + {"Demo64_06", SND_EVENT_Demo64_06, todoInititalizeSndEvent, nullptr, nullptr}, + {"Demo70_01", SND_EVENT_Demo70_01, todoInititalizeSndEvent, todoExecuteSndEvent, nullptr}, + {"Demo70_02", SND_EVENT_Demo70_02, todoInititalizeSndEvent, todoExecuteSndEvent, nullptr}, + {"Demo72_01", SND_EVENT_Demo72_01, todoInititalizeSndEvent, todoExecuteSndEvent, nullptr}, + {"Demo77_01", SND_EVENT_Demo77_01, todoInititalizeSndEvent, todoExecuteSndEvent, nullptr}, + {"Demo79_01", SND_EVENT_Demo79_01, todoInititalizeSndEvent, todoExecuteSndEvent, nullptr}, +}; + +// clang-format on + +void dSndStateMgr_c::handleDemoEvent(const char *name) { + for (const SndEventDef *def = sSndEventDefs_DEMO; def < sSndEventDefs_DEMO + ARRAY_LENGTH(sSndEventDefs_DEMO); + def++) { + if (streq(name, def->eventName)) { + mSoundEventId = def->eventId; + mpSoundEventDef = def; + sEventExecuteCallback = def->executeCb; + if (def->initializeCb != nullptr) { + (def->initializeCb)(); + } + break; + } + } + + if (mSoundEventId == SND_EVENT_0x89) { + mSoundEventId = SND_EVENT_0x78; + } + + return; +} diff --git a/src/d/snd/d_snd_fi_vocal_mgr.cpp b/src/d/snd/d_snd_fi_vocal_mgr.cpp new file mode 100644 index 00000000..de77016b --- /dev/null +++ b/src/d/snd/d_snd_fi_vocal_mgr.cpp @@ -0,0 +1,42 @@ +#include "d/snd/d_snd_fi_vocal_mgr.h" + +#include "d/snd/d_snd_harp_song_mgr.h" +#include "d/snd/d_snd_small_effect_mgr.h" +#include "d/snd/d_snd_util.h" +#include "d/snd/d_snd_wzsound.h" +#include "nw4r/snd/snd_SeqSoundHandle.h" +#include "nw4r/snd/snd_SoundHandle.h" + +SND_DISPOSER_DEFINE(dSndFiVocalMgr_c); + +dSndFiVocalMgr_c::dSndFiVocalMgr_c() {} + +void dSndFiVocalMgr_c::executeOutputText(u16, u16) { + // no-op +} + +bool dSndFiVocalMgr_c::startFiVocal(s16 pitch, s16 bank) { + nw4r::snd::SoundHandle &handle = dSndHarpSongMgr_c::GetInstance()->getFiSingHandle(); + handle.Stop(3); + mSpeechHandle.Stop(3); + + if (pitch < 0x39 || pitch > 0x4C) { + return false; + } + + if (bank < 0 || bank >= 9) { + return false; + } + + // Already stopped above, but again doesn't hurt + mSpeechHandle.Stop(3); + + bool ok = dSndSmallEffectMgr_c::GetInstance()->playSoundInternalChecked(SE_NpcKen_VOCAL, &handle); + if (ok) { + nw4r::snd::SeqSoundHandle seqHandle(&handle); + seqHandle.WriteVariable(0, pitch - 0x30); + seqHandle.WriteVariable(2, bank + 0x1F); + } + + return ok; +} diff --git a/src/d/snd/d_snd_file_mgr.cpp b/src/d/snd/d_snd_file_mgr.cpp new file mode 100644 index 00000000..fdbd560b --- /dev/null +++ b/src/d/snd/d_snd_file_mgr.cpp @@ -0,0 +1,127 @@ +#include "d/snd/d_snd_file_mgr.h" + +#include "common.h" +#include "nw4r/snd/snd_DisposeCallbackManager.h" +#include "nw4r/snd/snd_SoundArchive.h" +#include "nw4r/snd/snd_SoundArchiveLoader.h" +#include "nw4r/snd/snd_SoundArchivePlayer.h" + +dSndFileManager::dSndFileManagerGlob dSndFileManager::sGlob; + +static dSndFileManager sFileManager; + +dSndFileManager *dSndFileManager::create(nw4r::snd::SoundArchive *pArchive, nw4r::snd::SoundHeap *pHeap) { + sGlob.numFiles = pArchive->detail_GetFileCount(); + sGlob.pData = (const void **)pHeap->Alloc(sGlob.numFiles * sizeof(const void *)); + sGlob.pWaveData = (const void **)pHeap->Alloc(sGlob.numFiles * sizeof(const void *)); + clearGlob(); + nw4r::snd::detail::DisposeCallbackManager::GetInstance().RegisterDisposeCallback(&sFileManager); + return &sFileManager; +} + +void dSndFileManager::clearGlob() { + for (u32 i = 0; i < sGlob.numFiles; i++) { + sGlob.pData[i] = nullptr; + sGlob.pWaveData[i] = nullptr; + } +} + +bool dSndFileManager::loadFileForSound(const nw4r::snd::SoundArchive &pArchive, u32 soundId, nw4r::snd::SoundHeap *pHeap) { + nw4r::snd::SoundArchive::SoundInfo info; + if (!pArchive.ReadSoundInfo(soundId, &info)) { + return false; + } + + if (sGlob.pData[info.fileId] == nullptr) { + nw4r::snd::detail::SoundArchiveLoader loader(pArchive); + const void *data = loader.LoadFile(info.fileId, pHeap); + if (data == nullptr) { + return false; + } + sGlob.pData[info.fileId] = data; + } + return true; +} + +bool dSndFileManager::isLoadedFileForSound(nw4r::snd::SoundArchivePlayer *pPlayer, u32 soundId) { + const nw4r::snd::SoundArchive &pArchive = pPlayer->GetSoundArchive(); + nw4r::snd::SoundArchive::SoundInfo info; + if (!pArchive.ReadSoundInfo(soundId, &info)) { + return false; + } + + if (pPlayer->detail_GetFileAddress(info.fileId) == nullptr) { + return false; + } + + return true; +} + +bool dSndFileManager::isLoadedFileAndWaveForBank(nw4r::snd::SoundArchivePlayer *pPlayer, u32 soundId) { + const nw4r::snd::SoundArchive &pArchive = pPlayer->GetSoundArchive(); + nw4r::snd::SoundArchive::BankInfo info; + if (!pArchive.ReadBankInfo(soundId, &info)) { + return false; + } + + if (pPlayer->detail_GetFileAddress(info.fileId) == nullptr) { + return false; + } + + if (pPlayer->detail_GetFileWaveDataAddress(info.fileId) == nullptr) { + return false; + } + + return true; +} + +bool dSndFileManager::isLoadedFileAndWaveForSound(nw4r::snd::SoundArchivePlayer *pPlayer, u32 soundId) { + const nw4r::snd::SoundArchive &pArchive = pPlayer->GetSoundArchive(); + nw4r::snd::SoundArchive::SoundInfo info; + if (!pArchive.ReadSoundInfo(soundId, &info)) { + return false; + } + + if (pPlayer->detail_GetFileAddress(info.fileId) == nullptr) { + return false; + } + + if (pPlayer->detail_GetFileWaveDataAddress(info.fileId) == nullptr) { + return false; + } + + return true; +} + + +void dSndFileManager::InvalidateData(void const *pStart, void const *pEnd) { + for (u32 i = 0; i < sGlob.numFiles; i++) { + if (pStart <= sGlob.pData[i] && sGlob.pData[i] <= pEnd) { + sGlob.pData[i] = nullptr; + } + } +} + +void dSndFileManager::InvalidateWaveData(void const *pStart, void const *pEnd) { + for (u32 i = 0; i < sGlob.numFiles; i++) { + if (pStart <= sGlob.pWaveData[i] && sGlob.pWaveData[i] <= pEnd) { + sGlob.pWaveData[i] = nullptr; + } + } +} + +// These two might be inline given that the order is reversed + +void const *dSndFileManager::GetFileWaveDataAddress(u32 id) { + if (id >= mpGlob->numFiles) { + return nullptr; + } + return mpGlob->pWaveData[id]; +} + +void const *dSndFileManager::GetFileAddress(u32 id) { + if (id >= mpGlob->numFiles) { + return nullptr; + } + return mpGlob->pData[id]; +} diff --git a/src/d/snd/d_snd_harp_song_data.cpp b/src/d/snd/d_snd_harp_song_data.cpp new file mode 100644 index 00000000..5ea89fe5 --- /dev/null +++ b/src/d/snd/d_snd_harp_song_data.cpp @@ -0,0 +1,114 @@ +#include "d/snd/d_snd_harp_song_data.h" + +#include "common.h" +#include "d/snd/d_snd_fi_vocal_mgr.h" +#include "d/snd/d_snd_wzsound.h" + +const s32 dSndHarpSongData_c::sNumHarpSongs = LABEL_HARP_TONE_RAW_END - LABEL_HARP_TONE_RAW_START - 1; +static const f32 sUnkSongVals[] = { + 40.0f, + 40.0f, + 40.0f, + 40.0f, + 40.0f, + 40.0f, +}; + +dSndHarpSongEntryBase_c::dSndHarpSongEntryBase_c(s16 count, s16 stride) : mCount(count), mStride(stride) { + mpData = new s16[count]; + reset(); +} + +dSndHarpSongEntryBase_c::~dSndHarpSongEntryBase_c() { + delete[] mpData; +} + +void dSndHarpSongEntryBase_c::reset() { + for (int i = 0; i < mCount; i++) { + mpData[i] = -1; + } +} + +void dSndHarpSongEntryBase_c::insert(u32 idx, s16 value) { + // TODO - magic number + if (idx > 0x120) { + return; + } + + u32 insert = 0; + while (mStride <= idx) { + insert++; + idx -= mStride; + } + mpData[insert] = value; +} + +s32 dSndHarpSongEntryBase_c::get(u32 idx) const { + if (idx >= mCount) { + return -1; + } + return mpData[idx]; +} + +dSndHarpSongEntry1_c::dSndHarpSongEntry1_c() : dSndHarpSongEntryBase_c(NUM_ENTRIES_TYPE_1, NUM_ENTRIES_TYPE_1 / 2) { + reset(); + for (s32 i = 0; i < NUM_ENTRIES_TYPE_1; i++) { + mStaticValues[i] = 0; + } +} + +void dSndHarpSongEntry1_c::loadStaticData(s32 i1, u32 i2, s32 i3) { + for (s32 i = 0; i < NUM_ENTRIES_TYPE_1; i++) { + if (get(i) > 0) { + mStaticValues[i] = dSndFiVocalMgr_c::GetInstance()->getStaticSongValue(i1, i2, i3, i); + } + } +} + +s16 dSndHarpSongEntry1_c::getStaticDatum(u32 idx) const { + if (idx >= NUM_ENTRIES_TYPE_1) { + return -1; + } + return mStaticValues[idx]; +} + +dSndHarpSongData_c::dSndHarpSongData_c() : field_0x0C(30.0f) { + init(0); +} + +void dSndHarpSongData_c::init(u32 idx) { + if (idx >= sNumHarpSongs) { + return; + } + mIndex = idx; + mSoundId = -1; + field_0x08 = 0; + + for (s32 i1 = 0; i1 < 4; i1++) { + for (u32 i2 = 0; i2 < 2; i2++) { + for (s32 i3 = 0; i3 < 2; i3++) { + mEntries2[i1][i2][i3].reset(); + } + field_0x90[i1][i2] = 0; + } + } + + field_0x0C = sUnkSongVals[mIndex]; + loadStaticValues(); +} + +void dSndHarpSongData_c::loadStaticValues() { + for (s32 i1 = 0; i1 < 4; i1++) { + for (u32 i2 = 0; i2 < 2; i2++) { + mEntries1[i1][i2].loadStaticData(mIndex, i1, i2); + } + } +} + +void dSndHarpSongData_c::insert2(u32 key, s16 value, s32) { + // TODO +} + +void dSndHarpSongData_c::insert1(u32 key, s16 value) { + // TODO +} diff --git a/src/d/snd/d_snd_harp_song_mgr.cpp b/src/d/snd/d_snd_harp_song_mgr.cpp new file mode 100644 index 00000000..6861b67e --- /dev/null +++ b/src/d/snd/d_snd_harp_song_mgr.cpp @@ -0,0 +1,122 @@ +#include "d/snd/d_snd_harp_song_mgr.h" + +#include "common.h" +#include "d/snd/d_snd_bgm_mml_parsers.h" +#include "d/snd/d_snd_harp_song_data.h" +#include "d/snd/d_snd_util.h" +#include "d/snd/d_snd_wzsound.h" + +SND_DISPOSER_DEFINE(dSndHarpSongMgr_c); + +dSndHarpSongMgr_c::dSndHarpSongMgr_c() + : field_0x010(0), + field_0x011(0), + mDataLoaded(false), + field_0x014(0), + field_0x018(0), + field_0x01C(0), + field_0x020(0), + field_0x024(0), + field_0x028(0), + field_0x02C(0), + field_0x030(0), + field_0x034(0), + field_0x038(0.0f), + field_0x03C(1.0f), + field_0x040(0), + field_0x041(0), + field_0x042(0), + field_0x043(0), + field_0x044(1), + field_0x048(0), + field_0x04C(3), + field_0x050(3), + field_0x054(3), + field_0x064(0), + field_0x068(0), + field_0x070(0), + field_0x078(0), + mpTmpData(nullptr), + field_0x5AC(0), + field_0x5B4(0), + field_0x5B8(0), + field_0x5BC(0), + field_0x5C0(4), + field_0x5C4(4) { + resetFloatArr1(); + resetFloatArr2(); + + field_0x058 = 3; + field_0x05C = 3; + field_0x060 = 3; + mpData = new dSndHarpSongData_c[dSndHarpSongData_c::sNumHarpSongs]; +} + +void dSndHarpSongMgr_c::setup() { + // no-op +} + +void dSndHarpSongMgr_c::setupState0() { + if (mDataLoaded) { + return; + } + + dSndBgmMmlParserHarpSong_c parser; + for (int i = 0; i < dSndHarpSongData_c::sNumHarpSongs; i++) { + mpData[i].init(i); + u32 soundId = LABEL_HARP_TONE_RAW_START + 1 + i; + parser.parseData(soundId, mpData + i); + mpData[i].setSoundId(soundId); + mpData[i].loadStaticValues(); + } + + mDataLoaded = true; +} + +void dSndHarpSongMgr_c::shiftFloat1(f32 val) { + if (val < 0.0f) { + val = 0.0f; + } + if (val > 150.0f) { + val = 150.0f; + } + + // @bug (?) this loop ends up copying the value of field_0x07C[0] + // to all array elements when surely the intention was to + // move each of them back by one position. TODO: are array entries + // other than [0] read anywhere? + for (int i = 1; i < 300; i++) { + field_0x07C[i] = field_0x07C[i - 1]; + } + field_0x07C[0] = val; +} + +void dSndHarpSongMgr_c::shiftFloat2(f32 val) { + if (val < 0.0f) { + val = 0.0f; + } + if (val > 240.0f) { + val = 240.0f; + } + + // @bug (?) this loop ends up copying the value of field_0x52C[0] + // to all array elements when surely the intention was to + // move each of them back by one position. TODO: are array entries + // other than [0] read anywhere? + for (int i = 1; i < 30; i++) { + field_0x52C[i] = field_0x52C[i - 1]; + } + field_0x52C[0] = val; +} + +void dSndHarpSongMgr_c::resetFloatArr1() { + for (int i = 0; i < 300; i++) { + field_0x07C[i] = 0.0f; + } +} + +void dSndHarpSongMgr_c::resetFloatArr2() { + for (int i = 0; i < 30; i++) { + field_0x52C[i] = 0.0f; + } +} diff --git a/src/d/snd/d_snd_id_mappers.cpp b/src/d/snd/d_snd_id_mappers.cpp new file mode 100644 index 00000000..6d699350 --- /dev/null +++ b/src/d/snd/d_snd_id_mappers.cpp @@ -0,0 +1,153 @@ +#include "d/snd/d_snd_id_mappers.h" + +#include "common.h" +#include "d/col/bg/d_bg_pc.h" +#include "d/snd/d_snd_mgr.h" +#include "d/snd/d_snd_player_mgr.h" +#include "d/snd/d_snd_source_enums.h" +#include "d/snd/d_snd_source_group.h" +#include "d/snd/d_snd_util.h" +#include "d/snd/d_snd_id_mappers_data.h" +#include "sized_string.h" + +const char *getBaseVariant(const char *name) { + const ActorBaseNamePair *pair = sActorBaseNamePairs; + for (int i = 0; i < sNumActorBaseNamePairs; i++) { + if (streq(name, sActorBaseNamePairs[i].variant)) { + return sActorBaseNamePairs[i].base; + } + } + return nullptr; +} + +u32 getGrpId(s32 sourceType, const char *name) { + if (name == nullptr) { + return -1; + } + if (sourceType < 0) { + return -1; + } + + if (sourceType >= SND_SOURCE_59 + 1) { + return -1; + } + + SizedString<64> label; + label.sprintf("GRP_%s", name); + u32 id = dSndMgr_c::GetInstance()->getArchive()->ConvertLabelStringToGroupId(label); + if (id != -1) { + return id; + } + const char *base = getBaseVariant(name); + if (base != nullptr) { + label.sprintf("GRP_%s", base); + id = dSndMgr_c::GetInstance()->getArchive()->ConvertLabelStringToGroupId(label); + return id; + } + return -1; +} + +u32 getGrpId(dSndSourceGroup_c *pGroup) { + if (pGroup == nullptr) { + return -1; + } + u32 id = getGrpId(pGroup->getSourceType(), pGroup->getName()); + if (id == -1 && pGroup->getOrigName() != nullptr) { + id = getGrpId(pGroup->getSourceType(), pGroup->getOrigName()); + } + return id; +} + +u32 getBnkSeId(s32 sourceType, const char *name) { + if (name == nullptr) { + return -1; + } + if (sourceType < 0) { + return -1; + } + + if (sourceType >= SND_SOURCE_59 + 1) { + return -1; + } + + SizedString<64> label; + label.sprintf("BNK_SE_%s", name); + u32 id = dSndMgr_c::GetInstance()->getArchive()->ConvertLabelStringToBankId(label); + if (id != -1) { + return id; + } + const char *base = getBaseVariant(name); + if (base != nullptr) { + label.sprintf("BNK_SE_%s", base); + id = dSndMgr_c::GetInstance()->getArchive()->ConvertLabelStringToBankId(label); + return id; + } + return -1; +} + +u32 getBnkSeId(dSndSourceGroup_c *pGroup) { + if (pGroup == nullptr) { + return -1; + } + u32 id = getBnkSeId(pGroup->getSourceType(), pGroup->getName()); + if (id == -1 && pGroup->getOrigName() != nullptr) { + id = getBnkSeId(pGroup->getSourceType(), pGroup->getOrigName()); + } + return id; +} + +u32 getSeId(s32 sourceType, const char *name) { + if (name == nullptr) { + return -1; + } + if (sourceType < 0) { + return -1; + } + + if (sourceType >= SND_SOURCE_59 + 1) { + return -1; + } + + SizedString<64> label; + label.sprintf("SE_%s", name); + u32 id = dSndPlayerMgr_c::GetInstance()->convertLabelStringToSoundId(label); + if (id != -1) { + return id; + } + const char *base = getBaseVariant(name); + if (base != nullptr) { + label.sprintf("SE_%s", base); + id = dSndPlayerMgr_c::GetInstance()->convertLabelStringToSoundId(label); + return id; + } + return -1; +} + +u32 getSeId(dSndSourceGroup_c *pGroup) { + if (pGroup == nullptr) { + return -1; + } + u32 id = getSeId(pGroup->getSourceType(), pGroup->getName()); + if (id == -1 && pGroup->getOrigName() != nullptr) { + id = getSeId(pGroup->getSourceType(), pGroup->getOrigName()); + } + return id; +} + +#pragma push +#pragma readonly_strings on +// TODO could be yet another file +const char *sSndHitEffects[] = { + "TUTI", "ROCK", "SAND", "GRASS", "TREE", "LAVA", "WATER", "STONE", "LOTUS", + "METAL", "NUMA", "TUTA", "LIFE", "CARPET", "QSAND", "WOOD", "DEATH", +}; + +#pragma pop + +const char *getHitEffectName(u32 polyAttr0) { + if (polyAttr0 >= 1 && polyAttr0 < POLY_ATT_0_MAX) { + polyAttr0 -= 1; + return sSndHitEffects[polyAttr0]; + } + return ""; +} diff --git a/src/d/snd/d_snd_id_mappers_data.cpp b/src/d/snd/d_snd_id_mappers_data.cpp new file mode 100644 index 00000000..84a8f0ea --- /dev/null +++ b/src/d/snd/d_snd_id_mappers_data.cpp @@ -0,0 +1,131 @@ +#include "d/snd/d_snd_id_mappers_data.h" + +#pragma push +#pragma readonly_strings on + +const ActorBaseNamePair sActorBaseNamePairs[] = { + { "KinokoA", "Kinoko"}, + { "KinokoB", "Kinoko"}, + { "KinokoC", "Kinoko"}, + { "KinokoD", "Kinoko"}, + { "SKinoko", "Kinoko"}, + { "Tbox", "TBox"}, + { "LBmaker", "LBird"}, + { "TansuA", "chest"}, + { "TansuB", "chest"}, + { "TansuC", "chest"}, + { "BbsRock", "RolRock"}, + { "NpcRvlR", "NpcBRvl"}, + { "NpcMWNi", "NpcSalS_A2"}, + { "NpcMHNi", "NpcSalS_A8"}, + { "NpcIcgK", "NpcKbn2"}, + { "NpcKb2N", "NpcKbn2"}, + { "NpcDoNi", "NpcSalS_A1"}, + { "NpcJkNi", "NpcSalS_A4"}, + { "NpcAzNi", "NpcSalS_A5"}, + { "NpcPcs", "NpcCbFd"}, + { "NpcAkuH", "NpcAkum"}, + { "NpcJkML", "NpcJkMo"}, + { "NpcDoML", "NpcDoMo"}, + { "NpcSAML", "NpcSAMo"}, + {"NpcResc_A3", "NpcResc"}, + {"NpcResc_A4", "NpcResc_A1"}, + {"NpcResc_A5", "NpcResc_A2"}, + { "NpcGrb", "NpcGra"}, + { "NpcGrc", "NpcGra"}, + { "NpcGrd", "NpcGra"}, + { "OcGrsL", "OctGrs"}, + { "NpcOkyu", "Npckyu"}, + { "Npckyu1", "Npckyu"}, + { "Npckyu2", "Npckyu"}, + { "Npckyu3", "Npckyu"}, + { "Npckyu4", "Npckyu"}, + { "NpcSlKy", "Npckyu"}, + { "rpiller", "rpillar"}, + { "EOc", "EBc"}, + { "EBce", "EBc"}, + { "CupA00", "tware"}, + { "CupA01", "tware"}, + { "CupA02", "tware"}, + { "CupB00", "tware"}, + { "CupB01", "tware"}, + { "CupB02", "tware"}, + { "PltA00", "tware"}, + { "PltA01", "tware"}, + { "PltA02", "tware"}, + { "PltB00", "tware"}, + { "PltB01", "tware"}, + { "PltB02", "tware"}, + { "FlvsA", "tware"}, + { "FlvsB", "tware"}, + { "FlvsC", "tware"}, + { "PlntA00", "tware"}, + { "PlntA01", "tware"}, + { "PlntB", "tware"}, + { "PlntC00", "tware"}, + { "PlntC01", "tware"}, + { "ERupGue", "EGue"}, + { "BirdNpc", "BirdCommon"}, + { "BirdKA", "BirdCommon"}, + { "BirdKB", "BirdCommon"}, + { "BirdT", "BirdCommon"}, + { "NpcBdsw", "BirdCommon"}, + { "DbidNpc", "BirdCommon"}, + { "KndBird", "BirdCommon"}, + { "BrdMob", "BirdCommon"}, + { "NpcBdz", "BirdZT"}, + { "InsctTg", "Insect"}, + { "Ladybug", "Insect"}, + { "Drgnfly", "Insect"}, + { "Beetle", "Insect"}, + { "Kuwagat", "Insect"}, + { "Grshpr", "Insect"}, + { "Cicada", "Insect"}, + { "Ant", "Insect"}, + { "Butrfly", "Insect"}, + { "Mantis", "Insect"}, + { "Scarab", "Insect"}, + { "Firefly", "Insect"}, + { "BcAlArr", "BcArrow"}, + { "FShutte", "FenceIr"}, + { "BBigBo2", "BBigBos"}, + { "BBigBo3", "BBigBos"}, + { "NusiNpc", "Nusi"}, + { "NusiB", "Nusi"}, + { "NpcMoN2", "NpcMoN"}, + { "NpcMoEN", "NpcMole"}, + { "NpcMoS", "NpcMoEl"}, + { "NpcMoT2", "NpcMoT"}, + { "BGh2", "BGh"}, + { "BGh3Fst", "BGh3"}, + { "BGh3Snd", "BGh3"}, + { "BGh3Trd", "BGh3"}, + { "NpcSlb2", "NpcSlrb"}, + { "NpcSlFB", "NpcSlrb"}, + { "NpcSlRp", "NpcSlrb"}, + { "NpcSlFl", "NpcSlrb"}, + { "FlySlrb", "NpcSlrb"}, + { "NpcKenT", "NpcKen"}, + { "GuardLg", "SliceLg"}, + { "SlicePt", "SliceLg"}, + { "TrShtCs", "trlshut"}, + { "Fmaker", "Fish"}, + { "TgTw", "TWeed"}, + { "BltObsT", "Obstacl"}, + { "Item_A44", "Item_A43"}, + { "Item_A45", "Item_A43"}, + { "Item_A46", "Item_A43"}, + { "PmpknBd", "Pumpkin"}, + { "MgPmpkn", "Pumpkin"}, + { "CmCloud", "CumlClud"}, + { "IslTreB", "RockSkB"}, + { "WnLeafA", "wnleaf"}, + { "WnLeafB", "wnleaf"}, + { "WnLeafC", "wnleaf"}, + { "WnLeafD", "wnleaf"}, + { "EOrCann", "EOr"}, +}; + +const s32 sNumActorBaseNamePairs = ARRAY_LENGTH(sActorBaseNamePairs); + +#pragma pop diff --git a/src/d/snd/d_snd_mgr.cpp b/src/d/snd/d_snd_mgr.cpp index b2ee2279..f9aa0f31 100644 --- a/src/d/snd/d_snd_mgr.cpp +++ b/src/d/snd/d_snd_mgr.cpp @@ -1,57 +1,100 @@ #include "d/snd/d_snd_mgr.h" +#include "common.h" #include "d/snd/d_snd_3d_manager.h" #include "d/snd/d_snd_area_sound_effect_mgr.h" +#include "d/snd/d_snd_bgm_mgr.h" +#include "d/snd/d_snd_bgm_seq_data_mgr.h" #include "d/snd/d_snd_control_player_mgr.h" +#include "d/snd/d_snd_distant_sound_actor_pool.h" +#include "d/snd/d_snd_fi_vocal_mgr.h" +#include "d/snd/d_snd_harp_song_mgr.h" #include "d/snd/d_snd_player_mgr.h" +#include "d/snd/d_snd_rng_mgr.h" +#include "d/snd/d_snd_se_sound_pool.h" #include "d/snd/d_snd_small_effect_mgr.h" #include "d/snd/d_snd_source_mgr.h" +#include "d/snd/d_snd_state_mgr.h" #include "egg/audio/eggAudioRmtSpeakerMgr.h" #include "egg/audio/eggAudioUtility.h" - -extern "C" void initEnemySoundMgr(); -extern "C" void initFanfareSoundMgr(); -extern "C" void initSomeUnusedSoundMgr(); -extern "C" void fn_80393530(); -extern "C" void fn_80394830(); -extern "C" void fn_8037F940(); -extern "C" void fn_80399600(); -extern "C" void fn_80399C20(); +#include "nw4r/snd/snd_SoundSystem.h" dSndMgr_c *dSndMgr_c::sInstance; -dSndMgr_c::dSndMgr_c(): field_0x6CC(0) { +dSndMgr_c::dSndMgr_c() : mIsInitialized(false) { sInstance = this; dSndPlayerMgr_c::create(); dSndControlPlayerMgr_c::create(); - initEnemySoundMgr(); + dSndStateMgr_c::create(); dSnd3DManager_c::create(); - initFanfareSoundMgr(); - initSomeUnusedSoundMgr(); + dSndBgmMgr_c::create(); + dSndBgmSeqDataMgr_c::create(); dSndSmallEffectMgr_c::create(); dSndAreaSoundEffectMgr_c::create(); dSndSourceMgr_c::create(); - fn_80393530(); - fn_80394830(); - fn_8037F940(); - fn_80399600(); - fn_80399C20(); + dSndDistantSoundActorPool_c::create(); + dSndSeSoundPool_c::create(); + dSndHarpSongMgr_c::create(); + dSndFiVocalMgr_c::create(); + dSndRngMgr_c::create(); initHbm(9); } -void dSndMgr_c::initialize(EGG::Heap *heap, u32 size) {} +void dSndMgr_c::setup(EGG::Heap *heap, u32 size) { + if (mIsInitialized) { + return; + } + + SimpleAudioMgrArg arg; + arg.heap = heap; + arg.soundFileName = dSndPlayerMgr_c::GetInstance()->getSoundArchivePath(); + // TODO - how is this calculated? + arg.field_0x1C = size + 0x1400; + arg.blocks = 2; + initialize(&arg); + mOutputMode = nw4r::snd::SoundSystem::GetOutputMode(); + dSndPlayerMgr_c::GetInstance()->setup(); + dSndStateMgr_c::GetInstance()->setup(heap); + dSndBgmMgr_c::GetInstance()->setup(heap); + dSndBgmSeqDataMgr_c::GetInstance()->setup(); + dSndDistantSoundActorPool_c::GetInstance()->setup(); + dSndHarpSongMgr_c::GetInstance()->setup(); + dSndSourceMgr_c::GetInstance()->setup(); + EGG::AudioRmtSpeakerMgr::setup(0, nullptr); + mIsInitialized = true; +} void dSndMgr_c::initHbm(u32 frame) { EGG::AudioUtility::HBM::init(this, restoreEffectsCallback, frame); } void dSndMgr_c::calc() { - if (field_0x6CC) { + if (mIsInitialized) { EGG::SimpleAudioMgr::calc(); EGG::AudioRmtSpeakerMgr::calc(); dSndPlayerMgr_c::GetInstance()->calc(); + + if (dSndPlayerMgr_c::GetInstance()->isInit()) { + dSndSmallEffectMgr_c::GetInstance()->calcTimer(); + if (!dSndPlayerMgr_c::GetInstance()->checkFlag(dSndPlayerMgr_c::MGR_HBM)) { + dSndControlPlayerMgr_c::GetInstance()->calc(); + if (!dSndPlayerMgr_c::GetInstance()->checkFlag(dSndPlayerMgr_c::MGR_CAUTION)) { + dSndStateMgr_c::GetInstance()->calc(); + dSndPlayerMgr_c::GetInstance()->calcActive(); + dSnd3DManager_c::GetInstance()->calc(); + dSndSmallEffectMgr_c::GetInstance()->calc(); + dSndBgmMgr_c::GetInstance()->calc(); + dSndAreaSoundEffectMgr_c::GetInstance()->calc(); + dSndHarpSongMgr_c::GetInstance()->calc(); + dSndSeSoundPool_c::GetInstance()->calc(); + } + } + } } } -void dSndMgr_c::restoreEffectsCallback() {} +void dSndMgr_c::restoreEffectsCallback() { + dSndStateMgr_c::GetInstance()->restoreEffects(); + dSndBgmMgr_c::GetInstance()->restoreEffects(); +} diff --git a/src/d/snd/d_snd_player_mgr.cpp b/src/d/snd/d_snd_player_mgr.cpp index 981f2150..893e684e 100644 --- a/src/d/snd/d_snd_player_mgr.cpp +++ b/src/d/snd/d_snd_player_mgr.cpp @@ -2,15 +2,27 @@ #include "d/snd/d_snd_player_mgr.h" #include "common.h" +#include "d/a/d_a_base.h" +#include "d/snd/d_snd_area_sound_effect_mgr.h" +#include "d/snd/d_snd_bgm_mgr.h" +#include "d/snd/d_snd_bgm_seq_data_mgr.h" #include "d/snd/d_snd_control_player_mgr.h" +#include "d/snd/d_snd_file_mgr.h" +#include "d/snd/d_snd_harp_song_mgr.h" +#include "d/snd/d_snd_id_mappers.h" #include "d/snd/d_snd_mgr.h" #include "d/snd/d_snd_small_effect_mgr.h" +#include "d/snd/d_snd_source.h" #include "d/snd/d_snd_source_enums.h" +#include "d/snd/d_snd_source_mgr.h" +#include "d/snd/d_snd_state_mgr.h" #include "d/snd/d_snd_wzsound.h" #include "egg/audio/eggAudioRmtSpeakerMgr.h" #include "egg/core/eggDvdRipper.h" #include "nw4r/snd/snd_SoundHandle.h" #include "nw4r/snd/snd_SoundStartable.h" +#include "nw4r/snd/snd_SoundSystem.h" +#include "rvl/AX/AXComp.h" #include "sized_string.h" const char *dSndPlayerMgr_c::getSoundArchivePath() { @@ -19,8 +31,131 @@ const char *dSndPlayerMgr_c::getSoundArchivePath() { SND_DISPOSER_DEFINE(dSndPlayerMgr_c); -dSndPlayerMgr_c::dSndPlayerMgr_c() - : field_0x010(0), field_0x011(0), field_0x014(-1), field_0x018(-1), field_0x01C(-1), mFlags(0) {} +dSndPlayerMgr_c::dSndPlayerMgr_c() : field_0x010(0), mIsSetup(false), mState0(-1), mState1(-1), mState2(-1), mFlags(0) {} + +void dSndPlayerMgr_c::setup() { + if (!mIsSetup) { + AXSetCompressor(FALSE); + mIsSetup = true; + } +} + +void dSndPlayerMgr_c::createFileManager() { + dSndMgr_c::getPlayer().detail_SetFileManager( + dSndFileManager::create(dSndMgr_c::GetInstance()->getArchive(), dSndMgr_c::GetInstance()->getSoundHeap()) + ); +} + +void dSndPlayerMgr_c::calcActive() { + // no-op +} + +void dSndPlayerMgr_c::clearTempStates() { + offFlag(MGR_PAUSE | MGR_MAP | MGR_HELP | MGR_SYSTEM | MGR_MSG_WAIT); +} + +void dSndPlayerMgr_c::setupState0() { + if (mState0 > 0) { + return; + } + initialize(); + + // TODO: Ugh, maybe convert the enums to unsigned ints? + dSndMgr_c::GetInstance()->loadGroup((unsigned int)GRP_STATIC, nullptr, 0); + mState0 = dSndMgr_c::GetInstance()->saveState(); + + s32 tmpState = dSndMgr_c::GetInstance()->saveState(); + + // This state is discarded, since all relevant data is parsed and copied out + dSndMgr_c::GetInstance()->loadGroup((unsigned int)GRP_BGM_PLAY_DATA_STATIC, nullptr, 0); + dSndBgmSeqDataMgr_c::GetInstance()->setupState0(); + dSndHarpSongMgr_c::GetInstance()->setupState0(); + + dSndMgr_c::GetInstance()->loadState(tmpState); +} + +void dSndPlayerMgr_c::popToState0() { + if (mState0 < 0) { + return; + } + dSndMgr_c::GetInstance()->loadState(mState0); + mState1 = -1; + mState2 = -1; +} + +void dSndPlayerMgr_c::saveState1() { + mState1 = dSndMgr_c::GetInstance()->saveState(); +} + +void dSndPlayerMgr_c::popToState1() { + if (mState1 < 0) { + return; + } + dSndMgr_c::GetInstance()->loadState(mState1); + mState2 = -1; +} + +void dSndPlayerMgr_c::saveState2() { + mState2 = dSndMgr_c::GetInstance()->saveState(); +} + +void dSndPlayerMgr_c::popToState2() { + if (mState2 < 0) { + return; + } + dSndMgr_c::GetInstance()->loadState(mState2); +} + +u32 dSndPlayerMgr_c::getFreeSize() { + return dSndMgr_c::GetInstance()->getSoundHeap()->GetFreeSize(); +} + +void dSndPlayerMgr_c::stopAllSound(s32 frames) { + dSndBgmMgr_c::GetInstance()->stopAllBgm(frames); + dSndSmallEffectMgr_c::GetInstance()->stopAllSound(frames); +} + + +void dSndPlayerMgr_c::shutdown(s32 frames) { + if (mState0 >= 0) { + dSndMgr_c::GetInstance()->shutdown(frames * 2); + stopAllSound(frames); + onFlag(MGR_SHUTDOWN_RESET); + } +} + +bool dSndPlayerMgr_c::isShutdown() { + if (mState0 < 0) { + return true; + } + return dSndMgr_c::GetInstance()->isShutdown(); +} + +void dSndPlayerMgr_c::reset(s32 frames) { + if (mState0 >= 0) { + nw4r::snd::SoundSystem::SetMasterVolume(1.0f, 0); + dSndMgr_c::GetInstance()->reset(frames * 2); + stopAllSound(frames); + dSndBgmMgr_c::GetInstance()->cancelDelayedSound(); + dSndBgmMgr_c::GetInstance()->setField_0x300(-1); + onFlag(MGR_SHUTDOWN_RESET); + } +} + +bool dSndPlayerMgr_c::isReset() { + if (mState0 < 0) { + return true; + } + return dSndMgr_c::GetInstance()->isReset(); +} + +void dSndPlayerMgr_c::recoverReset() { + if (checkFlag(MGR_HBM)) { + fn_8035E0E0(); + } + dSndMgr_c::GetInstance()->recoverReset(); + offFlag(MGR_SHUTDOWN_RESET); +} void dSndPlayerMgr_c::enterPauseState() { dSndControlPlayerMgr_c::GetInstance()->setVolume(PLAYER_FAN, 0.3f, 5); @@ -30,10 +165,6 @@ void dSndPlayerMgr_c::enterPauseState() { onFlag(MGR_PAUSE); } -u32 dSndPlayerMgr_c::getFreeSize() { - return dSndMgr_c::GetInstance()->getSoundHeap()->GetFreeSize(); -} - void dSndPlayerMgr_c::leavePauseState() { dSndControlPlayerMgr_c::GetInstance()->setVolume(PLAYER_FAN, 1.0f, 5); dSndControlPlayerMgr_c::GetInstance()->setVolume(PLAYER_AREA, 1.0f, 5); @@ -73,18 +204,104 @@ void dSndPlayerMgr_c::leaveHelp() { dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_HELP_OUT); } -void dSndPlayerMgr_c::setup(s32 channel) { +void dSndPlayerMgr_c::enterSystemMenu() { + if (checkFlag(MGR_CAUTION)) { + return; + } + enterPauseState(); + onFlag(MGR_SYSTEM); + dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_MENU_IN); +} + +void dSndPlayerMgr_c::leaveSystemMenu() { + if (checkFlag(MGR_CAUTION)) { + return; + } + leavePauseState(); + offFlag(MGR_SYSTEM); +} + +void dSndPlayerMgr_c::enterCaution() { + if (checkFlag(MGR_CAUTION)) { + return; + } + + s32 frames = 9; + if (dSndStateMgr_c::GetInstance()->isInEvent()) { + frames = 0; + } + + for (int i = 0; i < dSndControlPlayerMgr_c::sNumPlayers; i++) { + if ((u32)i != PLAYER_SMALL_IMPORTANT) { + dSndControlPlayerMgr_c::GetInstance()->getPlayer1(i)->PauseAllSound(true, frames); + } + } + + onFlag(MGR_CAUTION); + dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_CAUTION_IN); +} + +void dSndPlayerMgr_c::leaveCaution() { + if (!checkFlag(MGR_CAUTION)) { + return; + } + + EGG::AudioRmtSpeakerMgr::connectAllByForce(); + offFlag(MGR_CAUTION); + for (int i = 0; i < dSndControlPlayerMgr_c::sNumPlayers; i++) { + if ((u32)i != PLAYER_SMALL_IMPORTANT) { + dSndControlPlayerMgr_c::GetInstance()->getPlayer1(i)->PauseAllSound(false, 9); + } + } + + dSndBgmMgr_c::GetInstance()->pauseAllBgm(); + dSndAreaSoundEffectMgr_c::GetInstance()->pauseAllSounds(); + dSndSourceMgr_c::GetInstance()->pauseAllSound(); +} + +void dSndPlayerMgr_c::setMsgActor(s32 msgIdx, dAcBase_c *actor) { + if (actor != nullptr) { + dSoundSource_c *source = static_cast(actor->getSoundSource()); + if (source != nullptr) { + dSndSmallEffectMgr_c::GetInstance()->setButtonPressSound(source); + dSndSourceMgr_c::GetInstance()->setMsgSource(source); + } else { + dSndSmallEffectMgr_c::GetInstance()->resetButtonPressSound(); + } + } else { + dSndSmallEffectMgr_c::GetInstance()->resetButtonPressSound(); + } + dSndStateMgr_c::GetInstance()->onMsgStart(msgIdx); +} + +void dSndPlayerMgr_c::unsetMsgActor() { + dSndStateMgr_c::GetInstance()->onMsgEnd(); + dSndSmallEffectMgr_c::GetInstance()->resetButtonPressSound(); + dSndSourceMgr_c::GetInstance()->setMsgSource(nullptr); +} + +void dSndPlayerMgr_c::enterMsgWait() { + onFlag(MGR_MSG_WAIT); + dSndStateMgr_c::GetInstance()->onMsgWaitStart(); +} + +void dSndPlayerMgr_c::leaveMsgWait() { + offFlag(MGR_MSG_WAIT); + dSndStateMgr_c::GetInstance()->onMsgWaitEnd(); +} + +void dSndPlayerMgr_c::setupRmtSpeaker(s32 channel) { EGG::AudioRmtSpeakerMgr::setup(channel, nullptr); } -void dSndPlayerMgr_c::shutdown(s32 channel) { +void dSndPlayerMgr_c::shutdownRmtSpeaker(s32 channel) { EGG::AudioRmtSpeakerMgr::shutdown(channel, nullptr); } nw4r::snd::SoundStartable::StartResult dSndPlayerMgr_c::startSound( nw4r::snd::SoundHandle *pHandle, u32 soundId, const nw4r::snd::SoundStartable::StartInfo *pStartInfo ) { - if (checkFlag(MGR_UNK_0x2)) { + if (checkFlag(MGR_SHUTDOWN_RESET)) { return nw4r::snd::SoundStartable::START_ERR_USER; } @@ -94,9 +311,9 @@ nw4r::snd::SoundStartable::StartResult dSndPlayerMgr_c::startSound( } nw4r::snd::SoundStartable::StartResult res; if (pStartInfo != nullptr) { - res = dSndMgr_c::getPlayer()->detail_StartSound(pHandle, soundId, pStartInfo); + res = dSndMgr_c::getPlayer().StartSoundReturnStatus(pHandle, soundId, pStartInfo); } else { - res = dSndMgr_c::getPlayer()->detail_StartSound(pHandle, soundId, nullptr); + res = dSndMgr_c::getPlayer().StartSoundReturnStatus(pHandle, soundId, nullptr); } return res; } @@ -108,19 +325,71 @@ nw4r::snd::SoundStartable::StartResult dSndPlayerMgr_c::startSound( return startSound(pHandle, id, pStartInfo); } +bool dSndPlayerMgr_c::loadGroup(u32 groupId) { + if (dSndMgr_c::getPlayer().IsLoadedGroup(groupId)) { + // TODO - true would probably make more sense if the return value + // was checked at all... + return false; + } + return dSndMgr_c::GetInstance()->loadGroup(groupId, nullptr, 0); +} + +bool dSndPlayerMgr_c::loadFileForSound(u32 soundId) { + if (soundId == -1) { + return false; + } + return dSndFileManager::loadFileForSound( + *dSndMgr_c::GetInstance()->getArchive(), soundId, dSndMgr_c::GetInstance()->getSoundHeap() + ); +} + +bool dSndPlayerMgr_c::isLoadedFileForSound(u32 soundId) { + return dSndFileManager::isLoadedFileForSound(&dSndMgr_c::getPlayer(), soundId); +} + +bool dSndPlayerMgr_c::isLoadedFileForBank(u32 bankId) { + return dSndFileManager::isLoadedFileAndWaveForBank(&dSndMgr_c::getPlayer(), bankId); +} + +bool dSndPlayerMgr_c::isLoadedBnkSeForGroup(dSndSourceGroup_c *group) { + return isLoadedFileForBank(getBnkSeId(group)); +} + +bool dSndPlayerMgr_c::isLoadedFileAndWaveForSound(u32 soundId) { + return dSndFileManager::isLoadedFileAndWaveForSound(&dSndMgr_c::getPlayer(), soundId); +} + +bool dSndPlayerMgr_c::isLoadedSeFileAndWaveForGroup(dSndSourceGroup_c *group) { + return isLoadedFileAndWaveForSound(getSeId(group)); +} + +u32 dSndPlayerMgr_c::getRemoConSoundVariant(u32 soundId) const { + const char *label = dSndMgr_c::getSoundLabelString(soundId); + SizedString<64> variant; + variant.sprintf("%s_RC", label); + return sInstance->convertLabelStringToSoundId(variant); +} + +u32 dSndPlayerMgr_c::getRemoConSoundVariantDemo(u32 soundId) const { + const char *label = getDemoArchive()->GetSoundLabelString(soundId); + SizedString<64> variant; + variant.sprintf("%s_RC", label); + return sInstance->convertLabelStringToSoundId(variant); +} + u32 dSndPlayerMgr_c::convertLabelStringToSoundId(const char *label) const { return dSndMgr_c::GetInstance()->changeNameToId(label); } -nw4r::snd::SoundArchivePlayer &dSndPlayerMgr_c::getSoundArchivePlayerForType(u8 sourceType) { - if (canUseThisPlayer(sourceType)) { - return mSoundArchivePlayer; +nw4r::snd::SoundArchivePlayer &dSndPlayerMgr_c::getSoundArchivePlayerForType(s32 sourceType) { + if (shouldUseDemoPlayer(sourceType)) { + return mDemoSoundArchivePlayer; } - return *dSndMgr_c::getPlayer(); + return dSndMgr_c::getPlayer(); } -bool dSndPlayerMgr_c::canUseThisPlayer(u8 sourceType) const { - if (!mSoundArchivePlayer.IsAvailable()) { +bool dSndPlayerMgr_c::shouldUseDemoPlayer(s32 sourceType) const { + if (!mDemoSoundArchivePlayer.IsAvailable()) { return false; } @@ -150,12 +419,12 @@ bool dSndPlayerMgr_c::loadDemoArchive(const char *demoArchiveName) { EGG::DvdRipper::Arg arg(path, (u8 *)buf, nullptr, EGG::DvdRipper::ALLOC_DIR_TOP, 0, &amountRead, &fileSize); void *ptr = EGG::DvdRipper::loadToMainRAM(arg); if (ptr != nullptr) { - ok = mSoundArchive.Setup(ptr); + ok = mDemoSoundArchive.Setup(ptr); if (ok) { - u32 size = mSoundArchivePlayer.GetRequiredMemSize(&mSoundArchive); + u32 size = mDemoSoundArchivePlayer.GetRequiredMemSize(&mDemoSoundArchive); void *buf2 = dSndMgr_c::GetInstance()->getSoundHeap()->Alloc(size); if (buf2 != nullptr) { - ok = mSoundArchivePlayer.Setup(&mSoundArchive, buf2, size, nullptr, 0); + ok = mDemoSoundArchivePlayer.Setup(&mDemoSoundArchive, buf2, size, nullptr, 0); } } } @@ -165,13 +434,21 @@ bool dSndPlayerMgr_c::loadDemoArchive(const char *demoArchiveName) { return ok; } -void dSndPlayerMgr_c::shutdown() { - mSoundArchivePlayer.Shutdown(); - mSoundArchive.Shutdown(); +void dSndPlayerMgr_c::shutdownDemo() { + mDemoSoundArchivePlayer.Shutdown(); + mDemoSoundArchive.Shutdown(); } void dSndPlayerMgr_c::calc() { - if (mSoundArchivePlayer.IsAvailable()) { - mSoundArchivePlayer.Update(); + if (mDemoSoundArchivePlayer.IsAvailable()) { + mDemoSoundArchivePlayer.Update(); + } +} + +bool dSndPlayerMgr_c::isBgmPlayerId(u32 id) { + switch (id) { + case PLAYER_BGM: + case PLAYER_BGM_BATTLE: return true; + default: return false; } } diff --git a/src/d/snd/d_snd_rng.cpp b/src/d/snd/d_snd_rng.cpp new file mode 100644 index 00000000..b1a5994e --- /dev/null +++ b/src/d/snd/d_snd_rng.cpp @@ -0,0 +1,42 @@ +#include "d/snd/d_snd_rng.h" + +#include "rvl/OS/OSTime.h" + +dSndRng_c::dSndRng_c() : field_0x08(0), field_0x10(0) { + init(); +} + +void dSndRng_c::init() { + u32 tick = OSGetTick(); + field_0x08 = ((tick << 0x10) & 0xFFF0000) | tick >> 0x10; + field_0x10 = field_0x08; +} + +u32 dSndRng_c::rndInt(s32 max) { + // TODO + return 0; +/* + s32 temp_r0; + s32 temp_r11; + + temp_r11 = this->unkC; + this->unkC = (temp_r11 * 0xB2E3D431) + 0x508EBD; + temp_r0 = MULTU_HI(temp_r11, 0xB2E3D431) + (this->unk8 * 0xB2E3D431) + (temp_r11 * 0x690379B2) + M2C_CARRY; + this->unk8 = temp_r0; + return MULTU_HI(temp_r0, arg0) + (0 * arg0); +=> + + lo_1 = (lo_0 * 0xB2E3D431) + 0x508EBD; + hi_1 = MULTU_HI(lo_0, 0xB2E3D431) + (hi_0 * 0xB2E3D431) + (lo_0 * 0x690379B2) + M2C_CARRY; + return MULTU_HI(hi_1, arg0) + (0 * arg0); +*/ +} + +bool dSndRng_c::rndBool(s32 chance) { + if (chance >= 100) { + return true; + } else if (chance <= 0) { + return false; + } + return rndInt(100) < chance; +} diff --git a/src/d/snd/d_snd_rng_id.cpp b/src/d/snd/d_snd_rng_id.cpp new file mode 100644 index 00000000..dab77371 --- /dev/null +++ b/src/d/snd/d_snd_rng_id.cpp @@ -0,0 +1,152 @@ +#include "d/snd/d_snd_rng_id.h" + +dSndRngId_c::dSndRngId_c() : mIsConfigured(false) {} + +void dSndRngId_c::configure(u32 start, u32 end, u8 genChance) { + mBaseId = start; + mLastPicked = -1; + mPickedMask = 0; + mPickedNum = 0; + mRange = end - start + 1; + mGenChance = genChance; + mIsConfigured = true; +} + + +u32 dSndRngId_c::rndIdNoReuse() { + if (mPickedNum >= mRange) { + return -1; + } + + if (!rndBool(mGenChance)) { + return -1; + } + + u32 result = mLastPicked; + + if (mRange == 1) { + // only one possible ID + return mBaseId; + } else if (mRange == 2) { + // not alternating like below + result = mBaseId + rndInt(2); + } else { + int remaining = mRange - mPickedNum; + if (remaining == 1) { + // find the single last remaining ID + for (int i = 0; i < mRange; i++) { + if (((1 << i) & ~mPickedMask) != 0) { + result = mBaseId + i; + } + } + + } else { + while (mLastPicked == result) { + // pick a remaining ID and find it + int pick = rndInt(remaining); + int j = 0; + for (int i = 0; i < mRange; i++) { + if (((1 << i) & ~mPickedMask) != 0) { + if (j == pick) { + result = mBaseId + i; + } + j++; + } + } + } + } + } + + return result; +} + +u32 dSndRngId_c::nextIdNoReuse() { + if (mPickedNum >= mRange) { + return -1; + } + + if (!rndBool(mGenChance)) { + return -1; + } + + if (mRange == 1) { + // only one possible ID + return mBaseId; + } + + for (int i = 0; i < mRange; i++) { + if (((1 << i) & ~mPickedMask) != 0) { + return mBaseId + i; + } + } + + return -1; +} + +u32 dSndRngId_c::rndId() { + if (!rndBool(mGenChance)) { + return -1; + } + return mBaseId + rndInt(mRange); +} + +u32 dSndRngId_c::rndIdNotSame() { + if (!rndBool(mGenChance)) { + return -1; + } + + u32 last = mLastPicked; + if (mRange == 1) { + // we have to reuse if we only have one ID to pick from + return mBaseId; + } + + u32 result = mLastPicked; + + if (mRange == 2) { + if (last == -1) { + // we haven't generated an ID yet, so pick one of the two at random + result = mBaseId + rndInt(2); + } else { + // we have generated an ID before, so pick the other one now + if (last == mBaseId) { + result = mBaseId + 1; + } else { + result = mBaseId; + } + } + } else { + while (mLastPicked == result) { + result = mBaseId + rndInt(mRange); + } + } + + + return result; +} + +void dSndRngId_c::markPicked(u32 id, bool allowReset) { + if (id != -1 && id >= mBaseId && id < mBaseId + mRange) { + if (mRange >= 2) { + u32 bit = 1 << (id - mBaseId); + if (!(mPickedMask & bit)) { + mPickedMask |= bit; + mPickedNum++; + } + + if (allowReset && mPickedNum >= mRange) { + resetPicked(); + } + mLastPicked = id; + } + } +} + +void dSndRngId_c::resetPicked() { + mPickedMask = 0; + mPickedNum = 0; +} + +u32 dSndRngId_c::rndInt(s32 max) { + return dSndRng_c::rndInt(max); +} diff --git a/src/d/snd/d_snd_rng_id_if.cpp b/src/d/snd/d_snd_rng_id_if.cpp new file mode 100644 index 00000000..7fdf103e --- /dev/null +++ b/src/d/snd/d_snd_rng_id_if.cpp @@ -0,0 +1,17 @@ +#include "d/snd/d_snd_rng_id_if.h" + +bool dSndRngIdIf_c::doNextIdNoReuse() { + return handleId(nextIdNoReuse()); +} + +bool dSndRngIdIf_c::doRndId() { + return handleId(rndId()); +} + +bool dSndRngIdIf_c::doRndIdNoReuse() { + return handleId(rndIdNoReuse()); +} + +bool dSndRngIdIf_c::doRndIdNotSame() { + return handleId(rndIdNotSame()); +} diff --git a/src/d/snd/d_snd_rng_link_voice.cpp b/src/d/snd/d_snd_rng_link_voice.cpp new file mode 100644 index 00000000..058486f8 --- /dev/null +++ b/src/d/snd/d_snd_rng_link_voice.cpp @@ -0,0 +1,346 @@ +#include "d/snd/d_snd_rng_link_voice.h" + +#include "common.h" +#include "d/snd/d_snd_rng_id.h" +#include "d/snd/d_snd_source_player_head.h" +#include "d/snd/d_snd_wzsound.h" + +struct dSndLinkVoiceConfig { + /* 0x00 */ u16 begin; + /* 0x02 */ u16 end; + /* 0x04 */ s16 mGenChance; + /* 0x06 */ s8 priority; + /* 0x07 */ bool priorityTiebreaker; +}; + +static const dSndLinkVoiceConfig sLinkVoiceConfig[] = { + /* SND_LV_PRACTICE_S*/ + { SE_LV_PRACTICE_S_01, SE_LV_PRACTICE_S_ff, 70, 9, false}, + /* SND_LV_PRACTICE_M*/ + { SE_LV_PRACTICE_M_01, SE_LV_PRACTICE_M_ff, 100, 10, false}, + /* SND_LV_PRACTICE_L*/ + { SE_LV_PRACTICE_L_01, SE_LV_PRACTICE_L_ff, 100, 10, false}, + /* SND_LV_PRACTICE_KAITEN_M*/ + {SE_LV_PRACTICE_KAITEN_M_01, SE_LV_PRACTICE_KAITEN_M_ff, 100, 11, false}, + /* SND_LV_ATTACK_S*/ + { SE_LV_ATTACK_S_01, SE_LV_ATTACK_S_ff, 100, 10, false}, + /* SND_LV_ATTACK_M*/ + { SE_LV_ATTACK_M_01, SE_LV_ATTACK_M_ff, 100, 10, false}, + /* SND_LV_ATTACK_L*/ + { SE_LV_ATTACK_L_01, SE_LV_ATTACK_L_ff, 100, 10, false}, + /* SND_LV_SAVE_POWER*/ + { SE_LV_SAVE_POWER_01, SE_LV_SAVE_POWER_ff, 100, 0, false}, + /* SND_LV_ATTACK_KAITEN_M*/ + { SE_LV_ATTACK_KAITEN_M_01, SE_LV_ATTACK_KAITEN_M_ff, 100, 11, false}, + /* SND_LV_NOTICE*/ + { SE_LV_NOTICE_01, SE_LV_NOTICE_ff, 100, 0, false}, + /* SND_LV_PRACTICE_SHIELD*/ + { SE_LV_PRACTICE_SHIELD_01, SE_LV_PRACTICE_SHIELD_ff, 100, 8, false}, + /* SND_LV_ATTACK_SHIELD*/ + { SE_LV_ATTACK_SHIELD_01, SE_LV_ATTACK_SHIELD_ff, 100, 8, false}, + /* SND_LV_ATTACK_SHIELD_GJ*/ + { SE_LV_ATTACK_SHIELD_GJ_01, SE_LV_ATTACK_SHIELD_GJ_ff, 100, 9, false}, + /* SND_LV_SHELD_GUARD*/ + { SE_LV_SHELD_GUARD_01, SE_LV_SHELD_GUARD_ff, 100, 8, false}, + /* SND_LV_SHELD_DOWN*/ + { SE_LV_SHELD_DOWN_01, SE_LV_SHELD_DOWN_ff, 100, 15, false}, + /* SND_LV_SHELD_BREAK*/ + { SE_LV_SHELD_BREAK_01, SE_LV_SHELD_BREAK_ff, 100, 16, false}, + /* SND_LV_ATTACK_DOWN*/ + { SE_LV_ATTACK_DOWN_01, SE_LV_ATTACK_DOWN_ff, 100, 16, false}, + /* SND_LV_DAMAGE_S*/ + { SE_LV_DAMAGE_S_01, SE_LV_DAMAGE_S_ff, 100, 15, false}, + /* SND_LV_DAMAGE_L*/ + { SE_LV_DAMAGE_L_01, SE_LV_DAMAGE_L_ff, 100, 16, false}, + /* SND_LV_DAMAGE_FIRE_S*/ + { SE_LV_DAMAGE_FIRE_S_01, SE_LV_DAMAGE_FIRE_S_ff, 100, 15, false}, + /* SND_LV_DAMAGE_FIRE_L*/ + { SE_LV_DAMAGE_FIRE_L_01, SE_LV_DAMAGE_FIRE_L_ff, 100, 16, false}, + /* SND_LV_DAMAGE_ELEC_S*/ + { SE_LV_DAMAGE_ELEC_S_01, SE_LV_DAMAGE_ELEC_S_ff, 100, 15, false}, + /* SND_LV_DAMAGE_ELEC_L*/ + { SE_LV_DAMAGE_ELEC_L_01, SE_LV_DAMAGE_ELEC_L_ff, 100, 15, false}, + /* SND_LV_STRUGGLE_S*/ + { SE_LV_STRUGGLE_S_01, SE_LV_STRUGGLE_S_ff, 100, 14, false}, + /* SND_LV_STRUGGLE_L*/ + { SE_LV_STRUGGLE_L_01, SE_LV_STRUGGLE_L_ff, 100, 14, false}, + /* SND_LV_GROAN*/ + { SE_LV_GROAN_01, SE_LV_GROAN_ff, 100, 246, false}, + /* SND_LV_ESCAPE*/ + { SE_LV_ESCAPE_01, SE_LV_ESCAPE_ff, 100, 15, true}, + /* SND_LV_DAMAGE_MAGMA*/ + { SE_LV_DAMAGE_MAGMA_01, SE_LV_DAMAGE_MAGMA_ff, 100, 17, false}, + /* SND_LV_DAMAGE_QUICKSAND*/ + { SE_LV_DAMAGE_QUICKSAND_01, SE_LV_DAMAGE_QUICKSAND_ff, 100, 17, false}, + /* SND_LV_DIE_L*/ + { SE_LV_DIE_L_01, SE_LV_DIE_L_ff, 100, 100, true}, + /* SND_LV_DIE_S*/ + { SE_LV_DIE_S_01, SE_LV_DIE_S_ff, 100, 100, true}, + /* SND_LV_DIE_WATER*/ + { SE_LV_DIE_WATER_01, SE_LV_DIE_WATER_ff, 100, 100, true}, + /* SND_LV_RESTART*/ + { SE_LV_RESTART_01, SE_LV_RESTART_ff, 100, 100, true}, + /* SND_LV_STAND_UP*/ + { SE_LV_STAND_UP_01, SE_LV_STAND_UP_ff, 100, 0, false}, + /* SND_LV_PHEW*/ + { SE_LV_PHEW_01, SE_LV_PHEW_ff, 100, 0, false}, + /* SND_LV_TIRED_S*/ + { SE_LV_TIRED_S_01, SE_LV_TIRED_S_ff, 100, 254, true}, + /* SND_LV_TIRED_S*/ + { SE_LV_TIRED_S_01, SE_LV_TIRED_S_ff, 100, 254, true}, + /* SND_LV_TIRED_M*/ + { SE_LV_TIRED_M_01, SE_LV_TIRED_M_ff, 100, 254, true}, + /* SND_LV_TIRED_L*/ + { SE_LV_TIRED_L_01, SE_LV_TIRED_L_ff, 100, 254, true}, + /* SND_LV_CLIMB_TIRED_S*/ + { SE_LV_CLIMB_TIRED_S_01, SE_LV_CLIMB_TIRED_S_ff, 60, 254, false}, + /* SND_LV_CLIMB_TIRED_S*/ + { SE_LV_CLIMB_TIRED_S_01, SE_LV_CLIMB_TIRED_S_ff, 60, 254, false}, + /* SND_LV_CLIMB_TIRED_M*/ + { SE_LV_CLIMB_TIRED_M_01, SE_LV_CLIMB_TIRED_M_ff, 60, 254, false}, + /* SND_LV_CLIMB_TIRED_L*/ + { SE_LV_CLIMB_TIRED_L_01, SE_LV_CLIMB_TIRED_L_ff, 100, 254, false}, + /* SND_LV_LIFT_TIRED_S*/ + { SE_LV_LIFT_TIRED_S_01, SE_LV_LIFT_TIRED_S_ff, 60, 254, false}, + /* SND_LV_LIFT_TIRED_S*/ + { SE_LV_LIFT_TIRED_S_01, SE_LV_LIFT_TIRED_S_ff, 60, 254, false}, + /* SND_LV_LIFT_TIRED_M*/ + { SE_LV_LIFT_TIRED_M_01, SE_LV_LIFT_TIRED_M_ff, 60, 254, false}, + /* SND_LV_LIFT_TIRED_L*/ + { SE_LV_LIFT_TIRED_L_01, SE_LV_LIFT_TIRED_L_ff, 100, 254, false}, + /* SND_LV_TIRED_RECOVER*/ + { SE_LV_TIRED_RECOVER_01, SE_LV_TIRED_RECOVER_ff, 100, 254, true}, + /* SND_LV_TIRED_RECOVER_S*/ + { SE_LV_TIRED_RECOVER_S_01, SE_LV_TIRED_RECOVER_S_ff, 100, 254, true}, + /* SND_LV_TIRED_RECOVER_M*/ + { SE_LV_TIRED_RECOVER_M_01, SE_LV_TIRED_RECOVER_M_ff, 100, 254, true}, + /* SND_LV_TIRED_RECOVER_L*/ + { SE_LV_TIRED_RECOVER_L_01, SE_LV_TIRED_RECOVER_L_ff, 100, 254, true}, + /* SND_LV_TIRED_EMPTY*/ + { SE_LV_TIRED_EMPTY_01, SE_LV_TIRED_EMPTY_ff, 100, 1, true}, + /* SND_LV_PHEW*/ + { SE_LV_PHEW_01, SE_LV_PHEW_ff, 100, 1, true}, + /* SND_LV_JUMP_S*/ + { SE_LV_JUMP_S_01, SE_LV_JUMP_S_ff, 100, 8, false}, + /* SND_LV_JUMP_M*/ + { SE_LV_JUMP_M_01, SE_LV_JUMP_M_ff, 100, 8, false}, + /* SND_LV_JUMP_L*/ + { SE_LV_JUMP_L_01, SE_LV_JUMP_L_ff, 100, 8, false}, + /* SND_LV_SHOOT_START*/ + { SE_LV_SHOOT_START_01, SE_LV_SHOOT_START_ff, 100, 255, false}, + /* SND_LV_SHOOT_SLOPE*/ + { SE_LV_SHOOT_SLOPE_01, SE_LV_SHOOT_SLOPE_ff, 100, 255, false}, + /* SND_LV_RUN_UP*/ + { SE_LV_RUN_UP_01, SE_LV_RUN_UP_ff, 100, 255, false}, + /* SND_LV_GRAB*/ + { SE_LV_GRAB_01, SE_LV_GRAB_ff, 100, 0, false}, + /* SND_LV_CLIMB_STEP*/ + { SE_LV_CLIMB_STEP_01, SE_LV_CLIMB_STEP_ff, 100, 1, false}, + /* SND_LV_HUNG*/ + { SE_LV_HUNG_01, SE_LV_HUNG_ff, 100, 0, false}, + /* SND_LV_JUMP_IVY*/ + { SE_LV_JUMP_IVY_01, SE_LV_JUMP_IVY_ff, 100, 0, true}, + /* SND_LV_BACKFLIP*/ + { SE_LV_BACKFLIP_01, SE_LV_BACKFLIP_ff, 70, 0, false}, + /* SND_LV_ZENTEN*/ + { SE_LV_ZENTEN_01, SE_LV_ZENTEN_ff, 100, 0, false}, + /* SND_LV_ZENTEN_CLASH*/ + { SE_LV_ZENTEN_CLASH_01, SE_LV_ZENTEN_CLASH_ff, 100, 14, false}, + /* SND_LV_ZENTEN_UP*/ + { SE_LV_ZENTEN_UP_01, SE_LV_ZENTEN_UP_ff, 100, 247, true}, + /* SND_LV_FALLING_HIGH*/ + { SE_LV_FALLING_HIGH_01, SE_LV_FALLING_HIGH_ff, 100, 15, true}, + /* SND_LV_DAMAGE_FALL*/ + { SE_LV_DAMAGE_FALL_01, SE_LV_DAMAGE_FALL_ff, 100, 15, true}, + /* SND_LV_SKYDIVE*/ + { SE_LV_SKYDIVE_01, SE_LV_SKYDIVE_ff, 100, 0, false}, + /* SND_LV_RIDE_BIRD*/ + { SE_LV_RIDE_BIRD_01, SE_LV_RIDE_BIRD_ff, 100, 0, true}, + /* SND_LV_BLAST*/ + { SE_LV_BLAST_01, SE_LV_BLAST_ff, 100, 0, false}, + /* SND_LV_WIND_FLY*/ + { SE_LV_WIND_FLY_01, SE_LV_WIND_FLY_ff, 100, 0, false}, + /* SND_LV_BALANCE_BALL*/ + { SE_LV_BALANCE_BALL_01, SE_LV_BALANCE_BALL_ff, 100, 0, false}, + /* SND_LV_SLIDE_START*/ + { SE_LV_SLIDE_START_01, SE_LV_SLIDE_START_ff, 100, 255, false}, + /* SND_LV_CLIMB_ROPE*/ + { SE_LV_CLIMB_ROPE_01, SE_LV_CLIMB_ROPE_ff, 60, 0, false}, + /* SND_LV_SWING_ROPE*/ + { SE_LV_SWING_ROPE_01, SE_LV_SWING_ROPE_ff, 100, 0, false}, + /* SND_LV_JUMP_ROPE*/ + { SE_LV_JUMP_ROPE_01, SE_LV_JUMP_ROPE_ff, 100, 0, false}, + /* SND_LV_STOP_ROPE*/ + { SE_LV_STOP_ROPE_01, SE_LV_STOP_ROPE_ff, 100, 0, false}, + /* SND_LV_SHAKE_ROPE*/ + { SE_LV_SHAKE_ROPE_01, SE_LV_SHAKE_ROPE_ff, 100, 0, false}, + /* SND_LV_FOOT_MISS*/ + { SE_LV_FOOT_MISS_01, SE_LV_FOOT_MISS_ff, 100, 0, false}, + /* SND_LV_BREATH*/ + { SE_LV_BREATH_01, SE_LV_BREATH_ff, 100, 0, false}, + /* SND_LV_TAKE_BREATH*/ + { SE_LV_TAKE_BREATH_01, SE_LV_TAKE_BREATH_ff, 100, 0, false}, + /* SND_LV_GET_AIR*/ + { SE_LV_GET_AIR_01, SE_LV_GET_AIR_ff, 100, 0, false}, + /* SND_LV_DOLPHIN_JUMP*/ + { SE_LV_DOLPHIN_JUMP_01, SE_LV_DOLPHIN_JUMP_ff, 100, 0, false}, + /* SND_LV_LIFT_S*/ + { SE_LV_LIFT_S_01, SE_LV_LIFT_S_ff, 100, 0, false}, + /* SND_LV_THROW_S*/ + { SE_LV_THROW_S_01, SE_LV_THROW_S_ff, 100, 0, false}, + /* SND_LV_LIFT_L*/ + { SE_LV_LIFT_L_01, SE_LV_LIFT_L_ff, 100, 0, false}, + /* SND_LV_THROW_L*/ + { SE_LV_THROW_L_01, SE_LV_THROW_L_ff, 100, 0, false}, + /* SND_LV_PUSH_M*/ + { SE_LV_PUSH_M_01, SE_LV_PUSH_M_ff, 100, 0, false}, + /* SND_LV_DIG_GLOVE*/ + { SE_LV_DIG_GLOVE_01, SE_LV_DIG_GLOVE_ff, 100, 0, false}, + /* SND_LV_SWING_S*/ + { SE_LV_SWING_S_01, SE_LV_SWING_S_ff, 100, 0, false}, + /* SND_LV_DRINK*/ + { SE_LV_DRINK_01, SE_LV_DRINK_ff, 100, 0, false}, + /* SND_LV_DRINK_FIN*/ + { SE_LV_DRINK_FIN_01, SE_LV_DRINK_FIN_ff, 100, 255, false}, + /* SND_LV_CLIMB_WALL*/ + { SE_LV_CLIMB_WALL_01, SE_LV_CLIMB_WALL_ff, 60, 254, false}, + /* SND_LV_JUMPON_LIFT*/ + { SE_LV_JUMPON_LIFT_01, SE_LV_JUMPON_LIFT_ff, 100, 0, false}, + /* SND_LV_GET_SURPRISND*/ + { SE_LV_GET_SURPRISE_01, SE_LV_GET_SURPRISE_ff, 100, 0, false}, + /* SND_LV_FLOATAWAY*/ + { SE_LV_FLOATAWAY_01, SE_LV_FLOATAWAY_ff, 100, 0, false}, + /* SND_LV_CANNON_JUMP*/ + { SE_LV_CANNON_JUMP_01, SE_LV_CANNON_JUMP_ff, 100, 0, false}, + /* SND_LV_FIRE*/ + { SE_LV_FIRE_01, SE_LV_FIRE_ff, 100, 0, false}, + /* SND_LV_LOOK_BODY*/ + { SE_LV_LOOK_BODY_01, SE_LV_LOOK_BODY_ff, 100, 0, false}, + /* SND_LV_QUICKWATER*/ + { SE_LV_QUICKWATER_01, SE_LV_QUICKWATER_ff, 60, 0, false}, + /* SND_LV_DANGER_ROCK*/ + { SE_LV_DANGER_ROCK_01, SE_LV_DANGER_ROCK_ff, 100, 0, false}, + /* SND_LV_PULL_SWORD*/ + { SE_LV_PULL_SWORD_01, SE_LV_PULL_SWORD_ff, 100, 0, false}, + /* SND_LV_WHIP_BACK*/ + { SE_LV_WHIP_BACK_01, SE_LV_WHIP_BACK_ff, 100, 0, false}, + /* SND_LV_SW_PUSH*/ + { SE_LV_SW_PUSH_01, SE_LV_SW_PUSH_ff, 100, 0, false}, + /* SND_LV_SW_REJECT*/ + { SE_LV_SW_REJECT_01, SE_LV_SW_REJECT_ff, 100, 0, false}, + /* SND_LV_JUMP_DIVEWATER*/ + { SE_LV_JUMP_DIVEWATER_01, SE_LV_JUMP_DIVEWATER_ff, 100, 0, false}, + /* SND_LV_DAMAGE_WATER_M*/ + { SE_LV_DAMAGE_WATER_M_01, SE_LV_DAMAGE_WATER_M_ff, 100, 16, false}, + /* SND_LV_DAMAGE_WATER_S*/ + { SE_LV_DAMAGE_WATER_S_01, SE_LV_DAMAGE_WATER_S_ff, 100, 15, false}, + /* SND_LV_DAMAGE_ELEC_W*/ + { SE_LV_DAMAGE_ELEC_W_01, SE_LV_DAMAGE_ELEC_W_ff, 100, 15, false}, + /* SND_LV_STRUGGLE_W*/ + { SE_LV_STRUGGLE_W_01, SE_LV_STRUGGLE_W_ff, 100, 0, false}, + /* SND_LV_GROAN_W*/ + { SE_LV_GROAN_W_01, SE_LV_GROAN_W_ff, 100, 0, false}, + /* SND_LV_ESCAPE_W*/ + { SE_LV_ESCAPE_W_01, SE_LV_ESCAPE_W_ff, 100, 0, false}, + /* SND_LV_BREATH_TIRED_S*/ + { SE_LV_BREATH_TIRED_S_01, SE_LV_BREATH_TIRED_S_ff, 100, 254, false}, + /* SND_LV_BREATH_TIRED_S*/ + { SE_LV_BREATH_TIRED_S_01, SE_LV_BREATH_TIRED_S_ff, 30, 254, false}, + /* SND_LV_BREATH_TIRED_M*/ + { SE_LV_BREATH_TIRED_M_01, SE_LV_BREATH_TIRED_M_ff, 60, 254, false}, + /* SND_LV_BREATH_TIRED_L*/ + { SE_LV_BREATH_TIRED_L_01, SE_LV_BREATH_TIRED_L_ff, 100, 254, false}, + /* SND_LV_LIE_UP*/ + { SE_LV_LIE_UP_01, SE_LV_LIE_UP_ff, 100, 0, false}, + /* SND_LV_PRACTICE_PUNCH*/ + { SE_LV_PRACTICE_PUNCH_01, SE_LV_PRACTICE_PUNCH_ff, 100, 0, false}, + /* SND_LV_ATTACK_PUNCH*/ + { SE_LV_ATTACK_PUNCH_01, SE_LV_ATTACK_PUNCH_ff, 100, 0, false}, + /* SND_LV_SURPRISND_S*/ + { SE_LV_SURPRISE_S_01, SE_LV_SURPRISE_S_ff, 100, 0, false}, + /* SND_LV_SHUTTER_OPEN*/ + { SE_LV_SHUTTER_OPEN_01, SE_LV_SHUTTER_OPEN_ff, 100, 0, false}, + /* SND_LV_BIRDRACE_REACH*/ + { SE_LV_BIRDRACE_REACH_01, SE_LV_BIRDRACE_REACH_ff, 100, 10, false}, + /* SND_LV_ATTACK_A*/ + { SE_LV_ATTACK_A_01, SE_LV_ATTACK_A_ff, 100, 0, false}, + /* SND_LV_BADSMELL_TIRED_S*/ + { SE_LV_BADSMELL_TIRED_S_01, SE_LV_BADSMELL_TIRED_S_ff, 100, 254, false}, + /* SND_LV_BADSMELL_TIRED_S*/ + { SE_LV_BADSMELL_TIRED_S_01, SE_LV_BADSMELL_TIRED_S_ff, 50, 254, false}, + /* SND_LV_BADSMELL_TIRED_M*/ + { SE_LV_BADSMELL_TIRED_M_01, SE_LV_BADSMELL_TIRED_M_ff, 60, 254, false}, + /* SND_LV_BADSMELL_TIRED_L*/ + { SE_LV_BADSMELL_TIRED_L_01, SE_LV_BADSMELL_TIRED_L_ff, 100, 254, false}, + /* SND_LV_GIRA_SWORD_REJECT*/ + {SE_LV_GIRA_SWORD_REJECT_01, SE_LV_GIRA_SWORD_REJECT_ff, 100, 0, false}, + /* SND_LV_GIRA_SWORD_PULL*/ + { SE_LV_GIRA_SWORD_PULL_01, SE_LV_GIRA_SWORD_PULL_ff, 100, 0, false}, + /* SND_LV_GIRA_GRAPPLE*/ + { SE_LV_GIRA_GRAPPLE_01, SE_LV_GIRA_GRAPPLE_ff, 100, 0, false}, + /* SND_LV_SWORD_SIREN_IN*/ + { SE_LV_SWORD_SIREN_IN_01, SE_LV_SWORD_SIREN_IN_ff, 100, 0, false}, + /* SND_LV_APPEAR_SURPRISND*/ + { SE_LV_APPEAR_SURPRISE_01, SE_LV_APPEAR_SURPRISE_ff, 100, 0, false}, + /* SND_LV_EXIT_SURPRISND*/ + { SE_LV_EXIT_SURPRISE_01, SE_LV_EXIT_SURPRISE_ff, 100, 0, false}, + /* SND_LV_BIRD_DAMAGE*/ + { SE_LV_BIRD_DAMAGE_01, SE_LV_BIRD_DAMAGE_ff, 100, 15, false}, + /* SND_LV_BIRD_SPIN*/ + { SE_LV_BIRD_SPIN_01, SE_LV_BIRD_SPIN_ff, 100, 10, false}, + /* SND_LV_BIRD_ATTACK*/ + { SE_LV_BIRD_ATTACK_01, SE_LV_BIRD_ATTACK_ff, 100, 9, false}, + /* SND_LV_TRUCK_JUMP*/ + { SE_LV_TRUCK_JUMP_01, SE_LV_TRUCK_JUMP_ff, 100, 0, false}, + /* SND_LV_TRUCK_IN*/ + { SE_LV_TRUCK_IN_01, SE_LV_TRUCK_IN_ff, 100, 0, false}, + /* SND_LV_TRUCK_BRAKE*/ + { SE_LV_TRUCK_BRAKE_01, SE_LV_TRUCK_BRAKE_ff, 100, 0, false}, + /* SND_LV_DAMAGE_MUTEKI_S*/ + { SE_LV_DAMAGE_MUTEKI_S_01, SE_LV_DAMAGE_MUTEKI_S_ff, 100, 15, false}, + /* SND_LV_DAMAGE_MUTEKI_L*/ + { SE_LV_DAMAGE_MUTEKI_L_01, SE_LV_DAMAGE_MUTEKI_L_ff, 100, 15, false}, + /* SND_LV_DAMAGE_MUTEKI_W_S*/ + {SE_LV_DAMAGE_MUTEKI_W_S_01, SE_LV_DAMAGE_MUTEKI_W_S_ff, 100, 15, false}, + /* SND_LV_DAMAGE_MUTEKI_W_L*/ + {SE_LV_DAMAGE_MUTEKI_W_L_01, SE_LV_DAMAGE_MUTEKI_W_L_ff, 100, 15, false}, + /* SND_LV_RECOVER_WATER*/ + { SE_LV_RECOVER_WATER_01, SE_LV_RECOVER_WATER_ff, 100, 100, true}, + /* SND_LV_SPIN_WATER*/ + { SE_LV_SPIN_WATER_01, SE_LV_SPIN_WATER_ff, 100, 8, false}, + /* SND_LV_SHOCKED*/ + { SE_LV_SHOCKED_01, SE_LV_SHOCKED_ff, 100, 14, false}, + /* SND_LV_LIGHT_SURPRISND*/ + { SE_LV_LIGHT_SURPRISE_01, SE_LV_LIGHT_SURPRISE_ff, 100, 0, false}, + /* SND_LV_QUIETLY_S*/ + { SE_LV_QUIETLY_S_01, SE_LV_QUIETLY_S_ff, 60, 0, false}, + /* SND_LV_QUIETLY_M*/ + { SE_LV_QUIETLY_M_01, SE_LV_QUIETLY_M_ff, 60, 0, false}, + /* SND_LV_DAMAGE_L*/ + { SE_LV_DAMAGE_L_01, SE_LV_DAMAGE_L_ff, 100, 17, false}, +}; + +dSndRngLinkVoice_c::dSndRngLinkVoice_c() {} + +void dSndRngLinkVoice_c::configure(const dSndLinkVoiceConfig *config, dSndSourcePlayerHead_c *source) { + dSndRngId_c::configure(config->begin, config->end, config->mGenChance); + mPriority = config->priority; + mPriorityTiebreaker = config->priorityTiebreaker; + mpSource = source; +} + +bool dSndRngLinkVoice_c::handleId(u32 id) { + if (mpSource == nullptr) { + return false; + } + + bool ok = mpSource->startVoiceSoundInternal(id); + if (ok) { + markPicked(id, true); + } + return ok; +} + +const dSndLinkVoiceConfig *dSndRngLinkVoice_c::getConfig(s32 idx) { + return &sLinkVoiceConfig[idx]; +} diff --git a/src/d/snd/d_snd_rng_mgr.cpp b/src/d/snd/d_snd_rng_mgr.cpp new file mode 100644 index 00000000..5c31fbd4 --- /dev/null +++ b/src/d/snd/d_snd_rng_mgr.cpp @@ -0,0 +1,10 @@ + +#include "d/snd/d_snd_rng_mgr.h" + +#include "d/snd/d_snd_util.h" + +SND_DISPOSER_DEFINE(dSndRngMgr_c) + +u32 dSndRngMgr_c::rndIntRange(s32 min, s32 max) { + return min + rndInt(max - min); +} diff --git a/src/d/snd/d_snd_se_sound.cpp b/src/d/snd/d_snd_se_sound.cpp new file mode 100644 index 00000000..45cb0977 --- /dev/null +++ b/src/d/snd/d_snd_se_sound.cpp @@ -0,0 +1,88 @@ +#include "d/snd/d_snd_se_sound.h" + +#include "common.h" +#include "d/snd/d_snd_source.h" + +dSndSeSound_c::dSndSeSound_c() + : mpSource(nullptr), + mpSoundHandle(&mSound), + mHandleType(SE_HANDLE_TYPE_1), + mSoundId(-1), + field_0x114(-1), + field_0x11C(1), + field_0x11D(0), + field_0x11E(0), + mpStartCallback(nullptr), + mpCalcCallback(nullptr) { + mpCtxParam = new dSndSoundCtxParam[10]; +} + +dSndSeSound_c::~dSndSeSound_c() { + delete[] mpCtxParam; +} + +void dSndSeSound_c::setSource(dSoundSource_c *source, u32 soundId) { + clear(); + mSoundId = soundId; + field_0x114 = 0; + dSndSoundCtxParam* s = mpCtxParam; + while (s < &mpCtxParam[10]) { + s->intParam = 0; + s->floatParam = 0.0f; + s++; + } + + mpCalcCallback = nullptr; + mpStartCallback = nullptr; + field_0x11D = 0; + field_0x11E = 0; +} + +void dSndSeSound_c::clear() { + field_0x114 = -1; + mpSource = nullptr; + mpCalcCallback = nullptr; + mpStartCallback = nullptr; + mpSoundHandle = &mSound; + field_0x11C = 1; + field_0x11D = 0; + mSound.cancel(); +} + +void dSndSeSound_c::calc(dSoundSource_c *source) { + onCalc(source); + if (mpSoundHandle->IsPause() && mpSoundHandle->GetRemainingFadeFrames() == 0) { + return; + } + field_0x114++; +} + +void dSndSeSound_c::shiftParam(const dSndSoundCtxParam *pParam) { + if (pParam == nullptr) { + return; + } + + for (int i = 9; i > 0; i--) { + mpCtxParam[i] = mpCtxParam[i - 1]; + } + mpCtxParam[0] = *pParam; +} + +void dSndSeSound_c::shiftFloatParam(f32 value) { + for (int i = 9; i > 0; i--) { + mpCtxParam[i].floatParam = mpCtxParam[i - 1].floatParam; + } + mpCtxParam[0].floatParam = value; +} + +void dSndSeSound_c::onStart(dSoundSource_c *source) { + if (mpStartCallback != nullptr) { + (mpStartCallback)(this, source, *mpSoundHandle); + } +} + +void dSndSeSound_c::onCalc(dSoundSource_c *source) { + if (mpCalcCallback != nullptr) { + (mpCalcCallback)(this, source, *mpSoundHandle); + } +} diff --git a/src/d/snd/d_snd_se_sound_1.cpp b/src/d/snd/d_snd_se_sound_1.cpp new file mode 100644 index 00000000..adc70a89 --- /dev/null +++ b/src/d/snd/d_snd_se_sound_1.cpp @@ -0,0 +1,12 @@ +#include "d/snd/d_snd_se_sound_1.h" + +#include "common.h" +#include "d/snd/d_snd_source.h" + +dSndSeSound1_c::dSndSeSound1_c() { + mHandleType = SE_HANDLE_TYPE_1; +} + +void dSndSeSound1_c::setSource(dSoundSource_c *source, u32 soundId) { + dSndSeSound_c::setSource(source, soundId); +} diff --git a/src/d/snd/d_snd_se_sound_2.cpp b/src/d/snd/d_snd_se_sound_2.cpp new file mode 100644 index 00000000..729f8849 --- /dev/null +++ b/src/d/snd/d_snd_se_sound_2.cpp @@ -0,0 +1,26 @@ +#include "d/snd/d_snd_se_sound_2.h" + +#include "common.h" +#include "d/snd/d_snd_source.h" + +dSndSeSound2_c::dSndSeSound2_c() : field_0x128(0), field_0x12C(0), field_0x130(0) { + mHandleType = SE_HANDLE_TYPE_2; +} + +void dSndSeSound2_c::setSource(dSoundSource_c *source, u32 soundId) { + dSndSeSound_c::setSource(source, soundId); + field_0x128 = 0; + field_0x12C = 0; + field_0x130 = 0; +} + +bool dSndSeSound2_c::calcTimer() { + if (!field_0x130 && field_0x128 != 0) { + field_0x12C++; + if (field_0x12C <= field_0x128) { + return true; + } + } + + return false; +} diff --git a/src/d/snd/d_snd_se_sound_pool.cpp b/src/d/snd/d_snd_se_sound_pool.cpp new file mode 100644 index 00000000..9c5cfc70 --- /dev/null +++ b/src/d/snd/d_snd_se_sound_pool.cpp @@ -0,0 +1,112 @@ +#include "d/snd/d_snd_se_sound_pool.h" + +#include "common.h" +#include "d/snd/d_snd_se_sound_1.h" +#include "d/snd/d_snd_util.h" +#include "nw4r/ut/ut_list.h" + +SND_DISPOSER_DEFINE(dSndSeSoundPool_c); + +dSndSeSoundPool_c::dSndSeSoundPool_c() { + // TODO offsetof + nw4r::ut::List_Init(&mFreeType1List, 0x0C); + nw4r::ut::List_Init(&mActiveType1List, 0x0C); + nw4r::ut::List_Init(&mFreeType2List, 0x0C); + + for (dSndSeSound1_c *sound = mSoundsType1; sound < &mSoundsType1[POOL_SIZE]; sound++) { + releaseSoundType1(sound, true); + } + + for (dSndSeSound2_c *sound = mSoundsType2; sound < &mSoundsType2[POOL_SIZE]; sound++) { + releaseSoundType2(sound); + } +} + +void dSndSeSoundPool_c::calc() { + dSndSeSound1_c *it, *next; + for (it = static_cast(nw4r::ut::List_GetFirst(&mActiveType1List)); it != nullptr; it = next) { + next = static_cast(nw4r::ut::List_GetNext(&mActiveType1List, it)); + if (!it->isAttachedSound()) { + it->clear(); + nw4r::ut::List_Remove(&mActiveType1List, it); + nw4r::ut::List_Append(&mFreeType1List, it); + } + } +} + +dSndSeSound1_c *dSndSeSoundPool_c::acquireSoundType1(dSoundSource_c *source, u32 soundId) { + if (soundId == -1) { + return nullptr; + } + + for (dSndSeSound1_c *it = static_cast(nw4r::ut::List_GetFirst(&mFreeType1List)); it != nullptr; + it = static_cast(nw4r::ut::List_GetNext(&mFreeType1List, it))) { + if (!it->isAttachedSound()) { + it->setSource(source, soundId); + removeSoundType1(it); + return it; + } + } + return nullptr; +} + +dSndSeSound2_c *dSndSeSoundPool_c::acquireSoundType2(dSoundSource_c *source, u32 soundId) { + if (soundId == -1) { + return nullptr; + } + + for (dSndSeSound2_c *it = static_cast(nw4r::ut::List_GetFirst(&mFreeType2List)); it != nullptr; + it = static_cast(nw4r::ut::List_GetNext(&mFreeType2List, it))) { + if (!it->isAttachedSound()) { + it->setSource(source, soundId); + removeSoundType2(it); + return it; + } + } + return nullptr; +} + +void dSndSeSoundPool_c::releaseSoundType1(dSndSeSound1_c *sound, bool stop) { + if (sound == nullptr) { + return; + } + + if (sound->isAttachedSound()) { + if (stop) { + sound->stop(0); + sound->clear(); + nw4r::ut::List_Append(&mFreeType1List, sound); + } else { + nw4r::ut::List_Append(&mActiveType1List, sound); + } + } else { + sound->clear(); + nw4r::ut::List_Append(&mFreeType1List, sound); + } +} + +void dSndSeSoundPool_c::releaseSoundType2(dSndSeSound2_c *sound) { + if (sound == nullptr) { + return; + } + + sound->stop(0); + sound->clear(); + nw4r::ut::List_Append(&mFreeType2List, sound); +} + +void dSndSeSoundPool_c::removeSoundType1(dSndSeSound1_c *sound) { + if (sound == nullptr) { + return; + } + + nw4r::ut::List_Remove(&mFreeType1List, sound); +} + +void dSndSeSoundPool_c::removeSoundType2(dSndSeSound2_c *sound) { + if (sound == nullptr) { + return; + } + + nw4r::ut::List_Remove(&mFreeType2List, sound); +} diff --git a/src/d/snd/d_snd_small_effect_mgr.cpp b/src/d/snd/d_snd_small_effect_mgr.cpp index 1dca1655..b970a325 100644 --- a/src/d/snd/d_snd_small_effect_mgr.cpp +++ b/src/d/snd/d_snd_small_effect_mgr.cpp @@ -1,25 +1,173 @@ #include "d/snd/d_snd_small_effect_mgr.h" #include "common.h" +#include "d/snd/d_snd_area_sound_effect_mgr.h" +#include "d/snd/d_snd_bgm_harp_data.h" +#include "d/snd/d_snd_bgm_mgr.h" +#include "d/snd/d_snd_bgm_sound.h" +#include "d/snd/d_snd_calc_pitch.h" #include "d/snd/d_snd_checkers.h" #include "d/snd/d_snd_control_player_mgr.h" +#include "d/snd/d_snd_distant_sound_actor_pool.h" +#include "d/snd/d_snd_mgr.h" #include "d/snd/d_snd_player_mgr.h" #include "d/snd/d_snd_source.h" -#include "d/snd/d_snd_source_if.h" +#include "d/snd/d_snd_source_enums.h" +#include "d/snd/d_snd_source_mgr.h" +#include "d/snd/d_snd_stage_data.h" +#include "d/snd/d_snd_state_mgr.h" #include "d/snd/d_snd_util.h" #include "d/snd/d_snd_wzsound.h" +#include "egg/audio/eggAudioRmtSpeakerMgr.h" #include "nw4r/snd/snd_SeqSoundHandle.h" +#include "nw4r/snd/snd_SoundHandle.h" +#include "nw4r/snd/snd_SoundStartable.h" +#include "nw4r/snd/snd_global.h" #include "rvl/OS/OSFastCast.h" -#include "toBeSorted/music_mgrs.h" SND_DISPOSER_DEFINE(dSndSmallEffectMgr_c) -dSndSmallEffectMgr_c::dSndSmallEffectMgr_c() : mTextboxAdvanceSound(-1), field_0x40(0), field_0x42(0), field_0x44(0) { - // probably arrays - field_0x28 = -1; - field_0x30 = 0; - field_0x2C = -1; - field_0x34 = 0; +dSndSmallEffectMgr_c::dSndSmallEffectMgr_c() + : field_0x10(0), mTextboxAdvanceSound(-1), field_0x40(0), field_0x42(0), field_0x44(0) { + for (int i = 0; i < NUM_DELAYED_SOUNDS; i++) { + mDelayedSoundIds[i] = -1; + mDelayedSoundTimers[i] = 0; + } +} + +void dSndSmallEffectMgr_c::initialize() { + resetButtonPressSound(); +} + +void dSndSmallEffectMgr_c::calc() { + if (!dSndPlayerMgr_c::GetInstance()->checkFlag(0x4)) { + for (int i = 0; i < NUM_DELAYED_SOUNDS; i++) { + if (mDelayedSoundIds[i] != -1) { + mDelayedSoundTimers[i]--; + if (mDelayedSoundTimers[i] <= 0) { + playSoundInternalChecked(mDelayedSoundIds[i], nullptr); + mDelayedSoundIds[i] = -1; + } + } + } + } +} + +void dSndSmallEffectMgr_c::calcTimer() { + if (field_0x10 <= 0) { + return; + } + field_0x10--; +} + +void dSndSmallEffectMgr_c::stopAllSound(s32 fadeFrames) { + field_0x10 = fadeFrames; + for (s32 i = dSndPlayerMgr_c::PLAYER_SMALL_IMPORTANT; i <= dSndControlPlayerMgr_c::sPlayerMax; i++) { + dSndControlPlayerMgr_c::GetInstance()->getPlayer1(i)->StopAllSound(fadeFrames); + } + dSndSourceMgr_c::GetInstance()->stopAllSound(); +} + +void dSndSmallEffectMgr_c::stopAllSoundDemoRelated(s32 fadeFrames) { + field_0x10 = fadeFrames; + if (dSndStateMgr_c::GetInstance()->isInDemo()) { + for (s32 i = dSndPlayerMgr_c::PLAYER_SMALL_NORMAL; i <= dSndControlPlayerMgr_c::sPlayerMax; i++) { + dSndControlPlayerMgr_c::GetInstance()->getPlayer1(i)->StopAllSound(fadeFrames); + } + dSndSourceMgr_c::GetInstance()->stopAllSound(); + } else { + dSndControlPlayerMgr_c::GetInstance() + ->getPlayer1(dSndPlayerMgr_c::PLAYER_SMALL_NORMAL) + ->StopAllSound(fadeFrames); + + for (s32 i = dSndPlayerMgr_c::PLAYER_LINK_EQUIPMENT; i <= dSndControlPlayerMgr_c::sPlayerMax; i++) { + if ((u32)i != dSndPlayerMgr_c::PLAYER_AREA) { + dSndControlPlayerMgr_c::GetInstance()->getPlayer1(i)->StopAllSound(fadeFrames); + } + } + dSndSourceMgr_c::GetInstance()->stopAllNonPlayerSound(); + } +} + +void dSndSmallEffectMgr_c::stopAllSoundExceptEvent(s32 fadeFrames) { + field_0x10 = fadeFrames; + for (u32 i = dSndPlayerMgr_c::PLAYER_SMALL_NORMAL; (s32)i <= dSndControlPlayerMgr_c::sPlayerMax; i++) { + if (i == dSndPlayerMgr_c::PLAYER_LINK_VOICE) { + dSndControlPlayerMgr_c::GetInstance()->getPlayer1(i)->StopAllSound(20); + } else if (i != dSndPlayerMgr_c::PLAYER_EVENT) { + dSndControlPlayerMgr_c::GetInstance()->getPlayer1(i)->StopAllSound(fadeFrames); + } + } + dSndSourceMgr_c::GetInstance()->stopAllSound(); +} + +void dSndSmallEffectMgr_c::stopAllSoundExceptEffectOrLink(s32 fadeFrames) { + field_0x10 = fadeFrames; + for (s32 i = dSndPlayerMgr_c::PLAYER_LINK_EQUIPMENT; i <= dSndControlPlayerMgr_c::sPlayerMax; i++) { + dSndControlPlayerMgr_c::GetInstance()->getPlayer1(i)->StopAllSound(field_0x10); + } + dSndSourceMgr_c::GetInstance()->stopAllNonPlayerSound(); +} + +bool dSndSmallEffectMgr_c::playSoundInternalChecked(u32 soundId, nw4r::snd::SoundHandle *pHandle) { + if (dSndStateMgr_c::GetInstance()->getField_0x064()) { + return false; + } + + if (field_0x10 > 0) { + return false; + } + + if (dSndStateMgr_c::GetInstance()->checkFlag0x10(dSndStateMgr_c::FLAG0x10_0x08)) { + return false; + } + return playSoundInternal(soundId, pHandle); +} + +bool dSndSmallEffectMgr_c::playSoundInternal(u32 soundId, nw4r::snd::SoundHandle *pHandle) { + u32 userParam = dSndPlayerMgr_c::GetInstance()->getSomeUserParam(soundId); + if (userParam & 2) { + for (u32 i = dSndPlayerMgr_c::PLAYER_SMALL_IMPORTANT; i <= dSndPlayerMgr_c::PLAYER_EVENT; i++) { + if (isPlayingSound(i, soundId)) { + return false; + } + } + } else if (userParam & 1) { + stopSounds(soundId, 2); + } + + if (userParam & 0x80000000) { + return false; + } + + nw4r::snd::SoundHandle tmpHandle; + if (pHandle == nullptr) { + pHandle = &tmpHandle; + } + + nw4r::snd::SoundStartable::StartResult res = dSndPlayerMgr_c::GetInstance()->startSound(pHandle, soundId, nullptr); + if (res == nw4r::snd::SoundStartable::START_SUCCESS) { + if (userParam & 8) { + if (EGG::AudioRmtSpeakerMgr::getWpadVolume() != 0) { + pHandle->SetOutputLineFlag(nw4r::snd::OUTPUT_LINE_REMOTE_1); + } + } else if (userParam & 4) { + pHandle->SetOutputLineFlag(nw4r::snd::OUTPUT_LINE_MAIN | nw4r::snd::OUTPUT_LINE_REMOTE_1); + } + + if (userParam & 0x10 && EGG::AudioRmtSpeakerMgr::getWpadVolume() != 0) { + u32 rcVariant = dSndPlayerMgr_c::GetInstance()->getRemoConSoundVariant(soundId); + if (rcVariant != -1) { + nw4r::snd::SoundHandle rcHandle; + dSndMgr_c::GetInstance()->getPlayer().StartSound(&rcHandle, rcVariant); + if (EGG::AudioRmtSpeakerMgr::getWpadVolume() != 0) { + rcHandle.SetOutputLineFlag(nw4r::snd::OUTPUT_LINE_REMOTE_1); + } + } + } + } + + return res == nw4r::snd::SoundStartable::START_SUCCESS; } bool dSndSmallEffectMgr_c::playSound(u32 soundId) { @@ -80,8 +228,8 @@ bool dSndSmallEffectMgr_c::playSound(u32 soundId) { break; } case SE_S_SKIP: { - if (fn_80364DA0(ENEMY_SOUND_MGR)) { - fn_80365020(ENEMY_SOUND_MGR); + if (dSndStateMgr_c::GetInstance()->isInEvent()) { + dSndStateMgr_c::GetInstance()->onSkipEvent(); } break; } @@ -132,6 +280,310 @@ bool dSndSmallEffectMgr_c::playSoundWithPan(u32 soundId, f32 pan) { return ok; } +bool dSndSmallEffectMgr_c::doSideEffects(u32 soundId) { + if (soundId == SE_S_FS2_SELECT_START || soundId == SE_S_NE_SELECT_OK) { + dSndBgmMgr_c::GetInstance()->stopAllBgm(15); + dSndAreaSoundEffectMgr_c::GetInstance()->stopSounds(15); + } + + u32 userParam = dSndPlayerMgr_c::GetInstance()->getSomeUserParam(soundId); + if ((userParam & 0x80) && dSndStateMgr_c::GetInstance()->isInEvent()) { + return false; + } + + if (userParam & 2) { + for (u32 i = dSndPlayerMgr_c::PLAYER_SMALL_IMPORTANT; i <= dSndPlayerMgr_c::PLAYER_SMALL_NORMAL; i++) { + if (isPlayingSound(i, soundId)) { + return false; + } + } + } else if (userParam & 1) { + stopSounds(soundId, 2); + } + return true; +} + +bool dSndSmallEffectMgr_c::playSoundInternal(u32 soundId) { + u32 userParam = dSndPlayerMgr_c::GetInstance()->getSomeUserParam(soundId); + + // Why is this flag weird + if ((userParam >> 31) != 0) { + return false; + } + + // Bunch of code duplication between doSideEffects and playSoundInternal + if (doSideEffects(soundId)) { + return playSoundInternal(soundId, &mNormalSound); + } + return false; +} + +nw4r::snd::SoundHandle *dSndSmallEffectMgr_c::getHoldSoundHandle(u32 soundId) { + // Find an existing handle holding this sound + for (int i = 0; i < NUM_HOLD_SOUNDS; i++) { + nw4r::snd::SoundHandle *h = &mHoldSoundHandles[i]; + if (h->GetId() == soundId) { + return h; + } + } + + // Find a free handle + for (int i = 0; i < NUM_HOLD_SOUNDS; i++) { + nw4r::snd::SoundHandle *h = &mHoldSoundHandles[i]; + if (!h->IsAttachedSound()) { + return h; + } + } + + // Drop a lower-priority sound + nw4r::snd::SoundHandle *least = nullptr; + nw4r::snd::SoundArchive::SoundInfo info; + dSndMgr_c::GetInstance()->getArchive()->ReadSoundInfo(soundId, &info); + s32 newPriority = info.playerPriority; + + for (int i = 0; i < NUM_HOLD_SOUNDS; i++) { + nw4r::snd::SoundHandle *h = &mHoldSoundHandles[i]; + dSndMgr_c::GetInstance()->getArchive()->ReadSoundInfo(h->GetId(), &info); + if (info.playerPriority < newPriority) { + newPriority = info.playerPriority; + least = h; + } + } + return least; +} + +bool dSndSmallEffectMgr_c::holdSound(u32 soundId) { + nw4r::snd::SoundHandle *h = getHoldSoundHandle(soundId); + if (h != nullptr) { + return holdSound(soundId, h); + } + return false; +} + +bool dSndSmallEffectMgr_c::holdSoundWithPitch(u32 soundId, f32 pitch) { + nw4r::snd::SoundHandle *h = getHoldSoundHandle(soundId); + bool ok = false; + if (h != nullptr) { + ok = holdSound(soundId, h); + } + if (ok && soundId == SE_S_GAUGE_SHIELD_UP_LV) { + f32 actualPitch = pitch + 1.0f; + if (actualPitch > 2.0f) { + actualPitch = 2.0f; + } + h->SetPitch(actualPitch); + } + return ok; +} + +bool dSndSmallEffectMgr_c::holdSound(u32 soundId, nw4r::snd::SoundHandle *handle) { + if (handle == nullptr) { + return false; + } + u32 param = dSndPlayerMgr_c::GetInstance()->getSomeUserParam(soundId); + if ((param & 0x80000000) != 0) { + return false; + } + nw4r::snd::SoundStartable::StartResult result = + dSndMgr_c::GetInstance()->getPlayer().HoldSoundReturnStatus(handle, soundId, nullptr); + if (result == nw4r::snd::SoundStartable::START_SUCCESS) { + if ((param & 0x8) != 0) { + if (EGG::AudioRmtSpeakerMgr::getWpadVolume() != 0) { + handle->SetOutputLineFlag(nw4r::snd::OUTPUT_LINE_REMOTE_1); + } + } else if ((param & 0x4) != 0) { + handle->SetOutputLineFlag(nw4r::snd::OUTPUT_LINE_MAIN | nw4r::snd::OUTPUT_LINE_REMOTE_1); + } + } + + return result == nw4r::snd::SoundStartable::START_SUCCESS; +} + +bool dSndSmallEffectMgr_c::playSoundAtPosition(u32 soundId, const nw4r::math::VEC3 *position) { + return dSndDistantSoundActorPool_c::GetInstance()->startSound(soundId, position); +} + +bool dSndSmallEffectMgr_c::playSoundAtPosition2(u32 soundId, const nw4r::math::VEC3 *position) { + return dSndDistantSoundActorPool_c::GetInstance()->startSound(soundId, position); +} + +bool dSndSmallEffectMgr_c::holdBowChargeSound(f32 remainingChargeAmount) { + nw4r::snd::SoundHandle *pHandle = getHoldSoundHandle(SE_S_BW_FOCUS_LV); + bool ok = false; + if (pHandle != nullptr) { + ok = holdSound(SE_S_BW_FOCUS_LV, pHandle); + } + if (ok) { + f32 chargeProgress = 1.0f - remainingChargeAmount; + if (chargeProgress < 0.0f) { + chargeProgress = 0.0f; + } + + // Bow charge sound increases in volume as it's charging up + f32 volume = chargeProgress / 2.0f; + volume += 0.5f; + if (volume > 1.0f) { + volume = 1.0f; + } + pHandle->SetVolume(volume, 0); + + // Bow charge sound pitches up by 25% until it's complete + f32 pitch = chargeProgress / 4.0f + 1.0f; + pHandle->SetPitch(pitch); + } + return ok; +} + +bool dSndSmallEffectMgr_c::holdFinisherPromptSound(const nw4r::math::VEC3 *position) { + if (dSndStateMgr_c::GetInstance()->isInEvent()) { + return false; + } + return dSndDistantSoundActorPool_c::GetInstance()->holdSound(SE_S_FOCUS_FINISHER_LV, position); +} + +bool dSndSmallEffectMgr_c::playDowsingPingSound(f32 volume, f32 pitch) { + bool result = playSoundInternal(SE_S_DOWSING_SOUND, &mDowsingSoundHandle); + if (result) { + mDowsingSoundHandle.SetVolume(volume, 0); + if (pitch < 0.8408964f) { + pitch = 0.8408964f; + } else if (pitch < 1.0594631f) { + pitch = 1.0f; + } else if (pitch < 1.122462f) { + pitch = 1.0594631f; + } else if (pitch < 1.1892071f) { + pitch = 1.122462f; + } else if (pitch < 1.2599211f) { + pitch = 1.1892071f; + } else if (pitch < 1.3348398f) { + pitch = 1.2599211f; + } else if (pitch < 1.4142135f) { + pitch = 1.3348398f; + } else if (pitch < 1.4983071f) { + pitch = 1.4142135f; // sqrt(2) + } else if (pitch > 1.4983071f) { + pitch = 1.4983071f; + } + mDowsingSoundHandle.SetPitch(pitch); + } + + return result; +} + +bool dSndSmallEffectMgr_c::holdDowsingNearestSound() { + return holdSound(SE_S_DOWSING_SOUND_NEAREST, &mDowsingSoundHandle); +} + +bool dSndSmallEffectMgr_c::playSirenCountdownSound(s32 timer) { + bool ok = playSoundInternal(SE_S_SIREN_COUNT_DOWN); + if (ok) { + f32 pitch = 1.0f - (timer * 0.01f); + mNormalSound.SetPitch(pitch); + } + return ok; +} + +bool dSndSmallEffectMgr_c::playMinigameCountdownSound() { + return playSoundInternal(SE_S_MG_COUNT_DOWN_1); +} + +bool dSndSmallEffectMgr_c::playMinigameTimeUpSound(s32 timer) { + return playSoundInternal(timer <= 3 ? SE_S_MG_TIMEUP_COUNT_02 : SE_S_MG_TIMEUP_COUNT_01); +} + +bool dSndSmallEffectMgr_c::playMinigameStartSound() { + return playSoundInternal(SE_S_MG_START); +} + +bool dSndSmallEffectMgr_c::playMinigameFinishSound() { + dSndBgmMgr_c::GetInstance()->stopAllBgm(10); + return playSoundInternal(SE_S_MG_FINISH); +} + +bool dSndSmallEffectMgr_c::playMinigameFinishWhistleSound() { + dSndBgmMgr_c::GetInstance()->stopAllBgm(10); + return playSoundInternal(SE_S_MG_FINISH_WHISTLE); +} + +bool dSndSmallEffectMgr_c::playMinigameScoreUpSound(s32 param) { + u32 soundId = SE_S_MG_SCORE_UP; + bool ok; + switch (dSndStateMgr_c::GetInstance()->getStageId_0x044()) { + case SND_STAGE_F019r: + // Bamboo Island + ok = playSoundInternal(SE_S_MG_TAKE_SCORE_UP); + if (ok) { + f32 pitch = pitchScaleForPitchIdx(param); + mNormalSound.SetPitch(pitch); + } + return ok; + case SND_STAGE_F020: + // Sky Field + soundId = dSndMgr_c::GetInstance()->getArchive() != nullptr ? (param >> 1) + SE_S_MG_TAKE_SCORE_UP : + SE_S_MG_DIVING_SCORE_01; + break; + case SND_STAGE_F211: + // Thrill Digger + soundId = SE_S_BE_GET_RUPEE; + break; + case SND_STAGE_F000: + // Skyloft (Pumpkin Archery) + if (param >= 50) { + soundId = SE_S_MG_PUMP_SHOT_SCORE_UP_50; + } else if (param >= 40) { + soundId = SE_S_MG_PUMP_SHOT_SCORE_UP_40; + } else if (param >= 30) { + soundId = SE_S_MG_PUMP_SHOT_SCORE_UP_30; + } else if (param >= 20) { + soundId = SE_S_MG_PUMP_SHOT_SCORE_UP_20; + } else { + soundId = SE_S_MG_PUMP_SHOT_SCORE_UP_10; + } + break; + } + return playSoundInternal(soundId); +} + +bool dSndSmallEffectMgr_c::playMinigameScoreDownSound() { + return playSoundInternal(SE_S_MG_SCORE_DOWN); +} + +bool dSndSmallEffectMgr_c::playMinigameMusasabiSound(s32 count) { + if (count < 0) { + count = 0; + } else if (count > 10) { + count = 10; + } + return playSoundInternal( + dSndMgr_c::GetInstance()->getArchive() != nullptr ? count + SE_S_MG_MUSASABI_01 : SE_S_MG_MUSASABI_01 + ); +} + +bool dSndSmallEffectMgr_c::playSkbSound(u32 soundId) { + switch (soundId) { + case SE_S_SK_POINT: + case SE_S_SK_INPUT: + if (isPlayingSound(SE_S_SK_INPUT_DECIDE)) { + return false; + } + break; + case SE_S_SK_INPUT_DECIDE: + stopSounds(dSndPlayerMgr_c::PLAYER_SMALL_NORMAL, SE_S_SK_POINT, 0); + stopSounds(dSndPlayerMgr_c::PLAYER_SMALL_NORMAL, SE_S_SK_INPUT, 0); + break; + case SE_S_SK_DELETE_ERROR: stopSounds(dSndPlayerMgr_c::PLAYER_SMALL_NORMAL, SE_S_SK_INPUT, 0); break; + } + return playSound(soundId); +} + +bool dSndSmallEffectMgr_c::playDemoSound(u32 soundId, nw4r::snd::SoundHandle *pHandle) { + nw4r::snd::SoundHandle tmpHandle; + + return dSndPlayerMgr_c::GetInstance()->startDemoSound( + pHandle == nullptr ? &tmpHandle : pHandle, soundId, nullptr + ) == nw4r::snd::SoundStartable::START_SUCCESS; +} + void dSndSmallEffectMgr_c::stopSounds(u32 playerIdx, u32 soundId, s32 fadeFrames) { SoundStopper stopper(soundId, fadeFrames); dSndControlPlayerMgr_c::GetInstance()->getPlayer1(playerIdx)->ForEachSound(stopper, false); @@ -185,9 +637,199 @@ void dSndSmallEffectMgr_c::resetButtonPressSound() { void dSndSmallEffectMgr_c::setButtonPressSound(dSoundSource_c *source) { resetButtonPressSound(); if (source != nullptr) { - mTextboxAdvanceSound = dSoundSource_c::getCharacterTalkSoundId(SE_S_TALK_CHAR, source); + mTextboxAdvanceSound = dSoundSource_c::modifySoundId(SE_S_TALK_CHAR, source); if (mTextboxAdvanceSound == SE_S_TALK_CHAR) { resetButtonPressSound(); } } } + +bool dSndSmallEffectMgr_c::playBattleHitSound(BattleHitSound_e type, dSoundSource_c *source) { + // if we're not in battle, don't play any of the hit effects + if (!dSndBgmMgr_c::GetInstance()->isPlayingAnyBattleMusic()) { + return false; + } + + if (source != nullptr) { + const char *name = source->getName(); + s32 sourceType = source->getSourceType(); + if (sourceType == SND_SOURCE_OBJECT_40) { + return false; + } + + switch (type) { + case BATTLE_TUTTI_GUARDJUST: + if (sourceType >= SND_SOURCE_BULLET) { + // Do not play battle effects for countering bullets + return false; + } + break; + case BATTLE_TUTTI_FINISH: + if (streq(name, "BLasBos")) { + // Do not play finish effect for finishing Demise + return false; + } + break; + default: break; + } + } + u32 soundId = BGM_BATTLE_TUTTI; + switch (type) { + case BATTLE_TUTTI_TURN: soundId = BGM_BATTLE_TUTTI_TURN; break; + case BATTLE_TUTTI_JUMP: soundId = BGM_BATTLE_TUTTI_JUMP; break; + case BATTLE_TUTTI_FINISH: soundId = BGM_BATTLE_TUTTI_FINISH; break; + case BATTLE_TUTTI_GUARDJUST: soundId = BGM_BATTLE_TUTTI_GUARDJUST; break; + default: break; + } + + if (mBattleTuttiHandle.IsAttachedSound()) { + u32 alreadyPlayingSound = mBattleTuttiHandle.GetId(); + // BGM_BATTLE_TUTTI_ sounds are ordered by priority apparently + if (alreadyPlayingSound > soundId) { + return false; + } + if (alreadyPlayingSound == BGM_BATTLE_TUTTI) { + nw4r::snd::SeqSoundHandle handle(&mBattleTuttiHandle); + // Do not allow stopping BGM_BATTLE_TUTTI too early + if ((s32)handle.GetTick() < 12) { + return false; + } + } + mBattleTuttiHandle.Stop(5); + } + + dSndBgmSound_c *bgmSound = dSndBgmMgr_c::GetInstance()->getActiveBgmSound(); + if (bgmSound == nullptr) { + return false; + } + + dSndBgmDataHarpVarSetBase_c *set = bgmSound->getCurrentHarpVarSet(); + if (set == nullptr) { + return false; + } + + bool ok = playSoundInternal(soundId, &mBattleTuttiHandle); + if (ok) { + nw4r::snd::SeqSoundHandle seqHandle(&mBattleTuttiHandle); + if (set->getCount() <= 0) { + return true; + } + + s32 count = set->getCount(); + if (count == 1) { + field_0x40 = set->getVal(0); + field_0x42 = field_0x40; + for (int i = 1; i < 4; i++) { + seqHandle.WriteVariable(i, field_0x40); + } + return true; + } else { + s32 i2 = 0; + field_0x44 = 0; + s32 varIdx = 0; + u32 mask = 0; + + // Pick a var 0 + if (type == BATTLE_TUTTI_FINISH) { + field_0x40 = set->getVal(0); + varIdx = 0; + } else { + s32 numHarpBits = set->getNumBitsSet(); + + if (numHarpBits <= 0) { + // No bits set, just try and pick a random variable + // that's not equal to the one we picked before + s32 pick = field_0x40; + int i = 0; + while (pick == field_0x40) { + i++; + if (i > 0x14) { + break; + } + varIdx = set->getRandomIdx(); + pick = set->getVal(varIdx); + } + field_0x40 = pick; + } else if (numHarpBits == 1) { + // One bit set, get the value (using a slightly convoluted method + // due to inline complexity) without rejecting it when it equals + // the previously picked value + varIdx = set->getRandomIdxWithBitSet(); + field_0x40 = set->getVal(varIdx); + } else { + // Multiple bits set, just pick a random variable with the bit set + // that's not equal to the one we picked before + s32 pick = field_0x40; + int i = 0; + while (pick == field_0x40) { + i++; + if (i > 0x14) { + break; + } + varIdx = set->getRandomIdxWithBitSet(); + pick = set->getVal(varIdx); + } + field_0x40 = pick; + } + } + field_0x44 |= 1 << varIdx; + setBitsIfAdjacent(set, count, field_0x40, &mask); + seqHandle.WriteVariable(0, field_0x40); + + // Pick a new field_0x42 -> var 1 + u32 mask5 = 0; + s32 value = 0; + int i = 0; + do { + i++; + if (i > 0x14) { + break; + } + u32 rndValue = set->getRandomIdx(); + mask5 = 1 << rndValue; + value = set->getVal(rndValue); + + } while ((mask & mask5) || value == field_0x42); + field_0x42 = value; + field_0x44 |= mask5; + + setBitsIfAdjacent(set, count, field_0x42, &mask); + seqHandle.WriteVariable(1, field_0x42); + + // Pick new vars 2 and 3 + bool b = field_0x40 != field_0x42; + s32 seqVarIdx = 2; + for (; seqVarIdx < 4; seqVarIdx++) { + u32 rndValue = 0; + u32 mask5 = 0; + int i = 0; + do { + i++; + if (i > 0x14) { + break; + } + rndValue = set->getRandomIdx(); + mask5 = 1 << rndValue; + } while ((mask & mask5) || (seqVarIdx >= 3 && !b && (field_0x44 & mask5))); + if (!(field_0x44 & mask5)) { + b = true; + } + s32 nextVal = value = set->getVal(rndValue); + setBitsIfAdjacent(set, count, nextVal, &mask); + field_0x44 |= mask5; + seqHandle.WriteVariable(seqVarIdx, nextVal); + } + } + } + + return ok; +} + +void dSndSmallEffectMgr_c::setBitsIfAdjacent(dSndBgmDataHarpVarSetBase_c *set, s32 count, s32 target, u32 *pMask) { + for (int i = 0; i < count; i++) { + s32 val = set->getVal(i); + if (val == target + 1 || val == target - 1) { + *pMask |= 1 << i; + } + } +} diff --git a/src/d/snd/d_snd_sound.cpp b/src/d/snd/d_snd_sound.cpp index 39354783..ffbfa3ce 100644 --- a/src/d/snd/d_snd_sound.cpp +++ b/src/d/snd/d_snd_sound.cpp @@ -1,13 +1,13 @@ #include "d/snd/d_snd_sound.h" #include "common.h" +#include "d/snd/d_snd_bgm_mgr.h" #include "d/snd/d_snd_mgr.h" #include "d/snd/d_snd_player_mgr.h" #include "nw4r/snd/snd_SeqSoundHandle.h" #include "nw4r/snd/snd_SoundArchive.h" #include "nw4r/snd/snd_SoundStartable.h" #include "nw4r/ut/ut_list.h" -#include "toBeSorted/music_mgrs.h" dSndSound_c::dSndSound_c() : mPrevStartOffset(0), mIsPreparing(false), mPauseFlag(false), mIsRunning(false), mIsFadingOut(false) { @@ -38,13 +38,13 @@ dSndSound_c::~dSndSound_c() { } void dSndSound_c::cancel() { - if (canCancel()) { + if (hasState()) { resetControls(); mIsRunning = false; mIsFadingOut = false; mIsPreparing = false; mPrevStartOffset = 0; - fn_80373900(FANFARE_SOUND_MGR, this); + dSndBgmMgr_c::GetInstance()->unregistSound(this); } } @@ -159,7 +159,7 @@ void dSndSound_c::unlinkCtrl(dSndControlSound_c *ctrl) { nw4r::ut::List_Remove(&mList, ctrl); } -s16 dSndSound_c::readSeqTrackVariable(int varNo) { +s32 dSndSound_c::readSeqTrackVariable(int varNo) { if (!isSeqSound()) { return -1; } @@ -223,7 +223,7 @@ void dSndSound_c::resetTrackVolumes() { } } -void dSndSound_c::setTrackVolume(u32 trackFlags, f32 volume, s32 frames) { +void dSndSound_c::setTrackVolume(u16 trackFlags, f32 volume, s32 frames) { if (trackFlags != 0 && IsAttachedSound()) { switch (dSndMgr_c::GetInstance()->getArchive()->GetSoundType(GetId())) { case nw4r::snd::SoundArchive::SOUND_TYPE_SEQ: { @@ -246,7 +246,7 @@ void dSndSound_c::setTrackVolume(u32 trackFlags, f32 volume, s32 frames) { } } -void dSndSound_c::setStrmTrackVolume(u32 trackFlags, f32 volume, s32 frames) { +void dSndSound_c::setStrmTrackVolume(u16 trackFlags, f32 volume, s32 frames) { if (trackFlags != 0 && IsAttachedSound()) { switch (dSndMgr_c::GetInstance()->getArchive()->GetSoundType(GetId())) { case nw4r::snd::SoundArchive::SOUND_TYPE_STRM: { @@ -283,7 +283,7 @@ void dSndSound_c::setSingleStrmTrackVolume(u16 index, f32 volume, s32 frames) { } } -void dSndSound_c::setEachSeqTrackVolume(u32 trackFlags, f32 frames) { +void dSndSound_c::setEachSeqTrackVolume(u16 trackFlags, f32 frames) { for (int i = 0; i < 16; i++) { if ((trackFlags & (u16)(1 << i)) != 0) { setSingleSeqTrackVolume(i, 1.0f, (u32)frames); @@ -293,7 +293,7 @@ void dSndSound_c::setEachSeqTrackVolume(u32 trackFlags, f32 frames) { } } -void dSndSound_c::setEachStrmTrackVolume(u32 trackFlags, f32 frames) { +void dSndSound_c::setEachStrmTrackVolume(u16 trackFlags, f32 frames) { for (int i = 0; i < 3; i++) { if ((trackFlags & (u16)(1 << i)) != 0) { setSingleStrmTrackVolume(i, 1.0f, (u32)frames); @@ -316,7 +316,7 @@ void dSndSound_c::setSeqTempoRatio(f32 ratio, s32 frames) { } } -void dSndSound_c::setSeqTrackMute(u32 trackFlags, nw4r::snd::SeqMute mute) { +void dSndSound_c::setSeqTrackMute(u16 trackFlags, nw4r::snd::SeqMute mute) { if (isSeqSound()) { nw4r::snd::SeqSoundHandle handle(this); handle.SetTrackMute(trackFlags, mute); @@ -328,7 +328,7 @@ nw4r::snd::SoundStartable::StartResult dSndSound_c::prepareSound(u32 soundId, u3 return nw4r::snd::SoundStartable::START_ERR_USER; } - if (cannotStart()) { + if (isPlaying()) { return nw4r::snd::SoundStartable::START_ERR_USER; } @@ -341,19 +341,19 @@ nw4r::snd::SoundStartable::StartResult dSndSound_c::prepareSound(u32 soundId, u3 if (isPreparing()) { forceStop(); } else { - fn_80372920(FANFARE_SOUND_MGR); + dSndBgmMgr_c::GetInstance()->cullTooManyPreparingSounds(); } } nw4r::snd::SoundStartable::StartResult res; if (startOffset == 0) { - res = dSndMgr_c::GetInstance()->getPlayer()->detail_PrepareSound(this, soundId, nullptr); + res = dSndMgr_c::GetInstance()->getPlayer().PrepareSoundReturnStatus(this, soundId, nullptr); } else { nw4r::snd::SoundStartable::StartInfo info; info.enableFlag |= nw4r::snd::SoundStartable::StartInfo::ENABLE_START_OFFSET; info.startOffsetType = nw4r::snd::SoundStartable::StartInfo::START_OFFSET_TYPE_MILLISEC; info.startOffset = startOffset; - res = dSndMgr_c::GetInstance()->getPlayer()->detail_PrepareSound(this, soundId, &info); + res = dSndMgr_c::GetInstance()->getPlayer().PrepareSoundReturnStatus(this, soundId, &info); } if (res == nw4r::snd::SoundStartable::START_SUCCESS) { @@ -375,7 +375,7 @@ void dSndSound_c::onPreparing(u32 soundId, u32 startOffset) { cancel(); mPrevStartOffset = startOffset; mIsPreparing = true; - fn_803738B0(FANFARE_SOUND_MGR, this); + dSndBgmMgr_c::GetInstance()->registSound(this); } } diff --git a/src/d/snd/d_snd_sound_equipment_callbacks.cpp b/src/d/snd/d_snd_sound_equipment_callbacks.cpp new file mode 100644 index 00000000..d5260734 --- /dev/null +++ b/src/d/snd/d_snd_sound_equipment_callbacks.cpp @@ -0,0 +1,156 @@ + +#include "common.h" +#include "d/a/d_a_player.h" +#include "d/snd/d_snd_checkers.h" +#include "d/snd/d_snd_control_player_mgr.h" +#include "d/snd/d_snd_player_mgr.h" +#include "d/snd/d_snd_se_sound.h" +#include "d/snd/d_snd_se_sound_2.h" +#include "d/snd/d_snd_source_equipment.h" +#include "d/snd/d_snd_wzsound.h" +#include "nw4r/snd/snd_SeqSoundHandle.h" +#include "nw4r/snd/snd_SoundPlayer.h" + +void dSndSourceEquipment_c::cbBeFlyLv(dSndSeSound_c *sound, dSoundSource_c *source, nw4r::snd::SoundHandle &handle) { + if (sound->getCtxParams()[0].floatParam > 0.0f) { + nw4r::snd::SeqSoundHandle seqHandle(&handle); + f32 volume = 0.6f; + f32 pitch = 1.0f; + if (sound->getCtxParams()[0].floatParam == 1.0f) { + volume = 1.0f; + pitch = 1.3f; + } + handle.SetVolume(volume, 0); + handle.SetPitch(pitch); + seqHandle.SetTempoRatio(pitch); + } +} + +void dSndSourceEquipment_c::cbBeThrowRc(dSndSeSound_c *sound, dSoundSource_c *source, nw4r::snd::SoundHandle &handle) { + if (dAcPy_c::GetLink() != nullptr && !dAcPy_c::GetLink()->hasvt_0x1C0()) { + handle.Stop(10); + return; + } + + dSndSeSound2_c *flyHoldHandle = source->getHandleType2ForSoundId(SE_BE_FLY_LV); + if (flyHoldHandle == nullptr) { + if (sound->getField0x114() != 0) { + handle.Stop(3); + sound->setCallback2(nullptr); + } + return; + } + + nw4r::snd::SeqSoundHandle seqHandle(sound->getHandle()); + if (flyHoldHandle->getCtxParams()[0].floatParam > 0.0f) { + f32 volume = 0.6f; + f32 pitch = 1.0f; + if (flyHoldHandle->getCtxParams()[0].floatParam == 1.0f) { + volume = 1.0f; + pitch = 1.3f; + } + handle.SetVolume(volume, 0); + handle.SetPitch(pitch); + seqHandle.SetTempoRatio(pitch); + } +} + +void dSndSourceEquipment_c::cbBmIgnitionLv( + dSndSeSound_c *sound, dSoundSource_c *source, nw4r::snd::SoundHandle &handle +) { + // TODO how are these flags set + if (source->checkFlag(0x1)) { + handle.SetLpfFreq(-0.4f); + } else { + handle.SetLpfFreq(0.0f); + } +} + +void dSndSourceEquipment_c::cbBmBound(dSndSeSound_c *sound, dSoundSource_c *source, nw4r::snd::SoundHandle &handle) { + f32 param = sound->getCtxParams()[0].floatParam; + if (param <= 2.0f) { + handle.Stop(0); + return; + } + // TODO what does this do? + f32 volume = param / 70.0f + 0.3f; + if (volume > 1.0f) { + volume = 1.0f; + } + handle.SetVolume(volume, 0); +} + +static const f32 beMinSpeed = 2.0f; +static const f32 beMaxSpeed = 40.0f; + +void dSndSourceEquipment_c::cbWiFxLv(dSndSeSound_c *sound, dSoundSource_c *source, nw4r::snd::SoundHandle &handle) { + if (dAcPy_c::GetLink() == nullptr) { + return; + } + f32 volume = 1.0f; + f32 pitch = 1.0f; + if (dAcPy_c::GetLink()->checkCurrentAction(/* WHIP_LOCKED */ 0x8E)) { + volume = 0.9f; + } else { + if (dAcPy_c::GetLink()->checkCurrentAction(/* USE_WHIP */ 0x8D)) { + pitch = 1.2f; + } else if (dAcPy_c::GetLink()->isUsingWhip()) { + f32 speed = source->getSpeed(); + + if (speed <= beMinSpeed) { + volume = 0.2; + } else if (speed >= beMaxSpeed) { + volume = 0.8f; + } else { + volume = speed * 0.6f / 38.0f; + volume += 0.8f; + volume -= (beMaxSpeed * 0.6f / 38.0f); + // @bug not actually clamped + (void)nw4r::ut::Clamp(volume, 0.2f, 0.8f); + } + pitch = 0.9f; + } + } + // Save the current speed value... + sound->shiftFloatParam(pitch); + // And read the speed value from 4 frames earlier (~133ms) + f32 actualPitch = sound->getCtxParams()[5].floatParam; + handle.SetVolume(volume, 0); + handle.SetPitch(actualPitch); +} + +void dSndSourceEquipment_c::cbPcHit(dSndSeSound_c *sound, dSoundSource_c *source, nw4r::snd::SoundHandle &handle) { + nw4r::snd::SoundPlayer *equipmentPlayer = + dSndControlPlayerMgr_c::GetInstance()->getPlayer2(dSndPlayerMgr_c::PLAYER_LINK_EQUIPMENT); + s32 result = 0; + SoundPropertiesChecker checker(handle.GetId()); + // due to a @bug in SoundPropertiesChecker's ctor, mCounter4 is uninitialized, + // so when MWCC creates a copy of `checker` for ForEachSound, + // it uses r3 to store the ininitialized field, which currently holds + // `equipmentPlayer`. So this behaves as if someone wrote: + // checker.mCounter4 = reinterpret_cast(equipmentPlayer); + // This is harmless here, since we never use the result. + checker.mpPlayCounter = &result; + + // The more equipment sounds are playing, the more + // the volume on SE_PC_HIT is reduced + equipmentPlayer->ForEachSound(checker, false); + if (result == 2) { + handle.SetVolume(0.7f, 0); + } else if (result == 3) { + handle.SetVolume(0.5f, 0); + } else if (result >= 4) { + handle.SetVolume(0.3f, 0); + } +} + +void dSndSourceEquipment_c::postSetupSound(u32 playingId, u32 requestedId, dSndSeSound_c *seSound) { + switch (requestedId) { + case SE_BE_FLY_LV: seSound->setCallback2(&cbBeFlyLv); break; + case SE_BE_THROW_RC: seSound->setCallback2(&cbBeThrowRc); break; + case SE_BM_IGNITION_LV: seSound->setCallback2(&cbBmIgnitionLv); break; + case SE_BM_BOUND: seSound->setCallback1(&cbBmBound); break; + case SE_WI_FX_LV: seSound->setCallback2(&cbWiFxLv); break; + case SE_PC_HIT: seSound->setCallback1(&cbPcHit); break; + } +} diff --git a/src/d/snd/d_snd_sound_npc_callbacks.cpp b/src/d/snd/d_snd_sound_npc_callbacks.cpp new file mode 100644 index 00000000..94054d87 --- /dev/null +++ b/src/d/snd/d_snd_sound_npc_callbacks.cpp @@ -0,0 +1,25 @@ +#include "d/snd/d_snd_se_sound.h" +#include "d/snd/d_snd_source_py_bird.h" +#include "d/snd/d_snd_source_npc.h" +#include "d/snd/d_snd_state_mgr.h" +#include "d/snd/d_snd_wzsound.h" +#include "nw4r/snd/snd_SeqSoundHandle.h" + +void dSndSourcePyBird_c::cbPyBirdGlide(dSndSeSound_c *sound, dSoundSource_c *source, nw4r::snd::SoundHandle &handle) { + s32 var = 0; + if (!dSndStateMgr_c::GetInstance()->isInEvent()) { + var = static_cast(source)->mSeqVarValue; + } + nw4r::snd::SeqSoundHandle seqHandle(&handle); + seqHandle.WriteVariable(10, var); +} + +void dSndSourceNpc_c::postSetupSound(u32 playingId, u32 requestedId, dSndSeSound_c *seSound) { + // TODO +} + +void dSndSourcePyBird_c::postSetupSound(u32 playingId, u32 requestedId, dSndSeSound_c *seSound) { + if (requestedId == SE_PyBird_GLIDE) { + seSound->setCallback2(&cbPyBirdGlide); + } +} diff --git a/src/d/snd/d_snd_source.cpp b/src/d/snd/d_snd_source.cpp index 5ed288b8..2ed4fa23 100644 --- a/src/d/snd/d_snd_source.cpp +++ b/src/d/snd/d_snd_source.cpp @@ -1,68 +1,170 @@ #include "d/snd/d_snd_source.h" #include "common.h" +#include "d/a/d_a_base.h" +#include "d/col/bg/d_bg_pc.h" #include "d/snd/d_snd_3d_actor.h" #include "d/snd/d_snd_3d_manager.h" +#include "d/snd/d_snd_anim_sound.h" +#include "d/snd/d_snd_checkers.h" +#include "d/snd/d_snd_distant_sound_actor.h" +#include "d/snd/d_snd_distant_sound_actor_pool.h" +#include "d/snd/d_snd_id_mappers.h" #include "d/snd/d_snd_mgr.h" #include "d/snd/d_snd_player_mgr.h" +#include "d/snd/d_snd_se_sound.h" +#include "d/snd/d_snd_se_sound_1.h" +#include "d/snd/d_snd_se_sound_2.h" +#include "d/snd/d_snd_se_sound_pool.h" +#include "d/snd/d_snd_source_enums.h" #include "d/snd/d_snd_source_group.h" #include "d/snd/d_snd_source_mgr.h" +#include "d/snd/d_snd_stage_data.h" +#include "d/snd/d_snd_state_mgr.h" +#include "d/snd/d_snd_wzsound.h" +#include "egg/audio/eggAudioRmtSpeakerMgr.h" +#include "m/m_vec.h" +#include "nw4r/snd/snd_SoundHandle.h" #include "nw4r/snd/snd_SoundStartable.h" +#include "nw4r/snd/snd_global.h" #include "nw4r/ut/ut_list.h" #include "sized_string.h" +#include "toBeSorted/time_area_mgr.h" -struct d_snd_mgr_unk_6_sinit { - d_snd_mgr_unk_6_sinit() : field_0x00(0), field_0x04(0.0f) {} +static dSndSoundCtxParam sCtxParams; +bool dSoundSource_c::sIsStartingBaseSound; - u32 field_0x00; - f32 field_0x04; -}; - -d_snd_mgr_unk_6_sinit d_snd_mgr_unk_6_sinit_instance; - -const char *help_i_need_data() { - return "%s_%s_%d"; +dSoundSourceIf_c *dSoundSourceIf_c::create(s32 sourceType, dAcBase_c *actor, const char *name, u8 subtype) { + return dSndSourceMgr_c::createSource(sourceType, actor, name, subtype); } -dSoundSource_c::dSoundSource_c(u8 sourceType, dAcBase_c *player, const char *name, dSndSourceGroup_c *pOwnerGroup) +dSoundSource_c::dSoundSource_c(s32 sourceType, dAcBase_c *actor, const char *name, dSndSourceGroup_c *pOwnerGroup) : dSnd3DActor_c(pOwnerGroup->getAmbientParam(), sourceType), mpName(name), - field_0x0F4(0), - mpPlayer(player), + mpOrigName(nullptr), + mpActor(actor), mSourceType(sourceType), - field_0x0FE(0), - field_0x0FF(0), + mSubtype(0), + mIsSetup(false), field_0x100(0), field_0x101(0), field_0x102(0), - field_0x104(0), - field_0x108(0), - field_0x10C(0), + mFlagsPersistent(0), + mFlagsHold(0), + mpCtxParam(nullptr), field_0x11C(0), mpOwnerGroup(pOwnerGroup), - field_0x154(0), - field_0x158(-1), - field_0x15A(-1) { + mAnimEventValue(0), + mPolyAttr0(-1), + mPolyAttr1(-1) { mSourceCategory = dSndSourceMgr_c::getSourceCategoryForSourceType(sourceType, name); // TODO: Offsetof - nw4r::ut::List_Init(&field_0x110, 0xEC); - nw4r::ut::List_Init(&field_0x120, 0x04); - nw4r::ut::List_Init(&field_0x12C, 0x04); + nw4r::ut::List_Init(&mDistantSoundList, 0xEC); + nw4r::ut::List_Init(&mHandleType1List, 0x04); + nw4r::ut::List_Init(&mHandleType2List, 0x04); pOwnerGroup->registerSource(this); } dSoundSource_c::~dSoundSource_c() { SetUserParam(0); - vt_0x44(); - d_s_vt_0x1BC(); + shutdown(); + removeAllSeHandles(); + detachAllDistantSounds(); dSndSourceMgr_c::GetInstance()->unregisterSource(this); mpOwnerGroup->unregisterSource(this); } +void dSoundSource_c::setup() { + if (mIsSetup) { + return; + } + SetPosition(mpActor->position); + resetCachedRelativePositions(); + initVolumeFade(); + if (mSourceCategory == SND_SOURCE_CATEGORY_PLAYER) { + mPositionRelativeToPlayer.x = 0.0f; + mPositionRelativeToPlayer.y = 0.0f; + mPositionRelativeToPlayer.z = 0.0f; + } + mIsPaused = false; + field_0x102 = 0; + switch (mSourceCategory) { + case SND_SOURCE_CATEGORY_ENEMY: + case SND_SOURCE_CATEGORY_OBJECT: + case SND_SOURCE_CATEGORY_NPC: + case SND_SOURCE_CATEGORY_TG_SOUND: + case SND_SOURCE_CATEGORY_HARP_RELATED: + if (dSndSourceMgr_c::GetInstance()->getField_0x0013() != 0 && mSourceType != SND_SOURCE_SHUTTER) { + field_0x101 = 1; + } else { + field_0x101 = 0; + } + } + + postSetup(); + dSndSourceMgr_c::GetInstance()->registerSource(this); + s32 id = dSndStateMgr_c::GetInstance()->getStageId_0x040(); + if (SND_STAGE_F000_L26 <= id && id <= SND_STAGE_F000_L27) { + setVolumeFade(0.0f, 0); + } + field_0x100 = dSndSourceMgr_c::isSwOrEOc(mpName); + mIsSetup = true; +} + +void dSoundSource_c::shutdown() { + if (!mIsDisabled) { + if (getAnimSound() != nullptr) { + getAnimSound()->shutdown(); + } + if (mIsPaused) { + stopAllSound(1); + } + dSndSourceMgr_c::GetInstance()->onShutdownSource(this); + mIsDisabled = true; + } +} + +void dSoundSource_c::stopAllPlaySounds(s32 fadeFrames) { + dSndSeSound1_c *sound = getHandleType1First(); + while (sound != nullptr) { + sound->getHandle()->Stop(fadeFrames); + sound = getHandleType1Next(sound); + } +} + const nw4r::math::VEC3 &dSoundSource_c::getListenerPosition() const { return dSnd3DManager_c::GetInstance()->getSndListenerPos(); } +void dSoundSource_c::calc(const nw4r::math::VEC3 &pos) { + preCalc(); + setPosition(pos); + calcHandles(); + calcVolumeFade(); + postCalc(); + mFlagsHold = 0; +} + +void dSoundSource_c::preCalc() { + if (field_0x100 != 0) { + return; + } + + if (dSndSourceMgr_c::GetInstance()->getField_0x0012() != 0) { + return; + } + + if (!mIsPaused && !mpActor->isBasePropertyFlag(dBase_c::BASE_PROP_0x4)) { + setPause(true, 3); + } else if (mIsPaused && mpActor->isBasePropertyFlag(dBase_c::BASE_PROP_0x4)) { + setPause(false, 3); + } +} + +void dSoundSource_c::postCalc() { + // noop +} + bool dSoundSource_c::hasPlayingSounds() const { return dSnd3DActor_c::hasPlayingSounds(); } @@ -75,42 +177,1024 @@ bool dSoundSource_c::isPlayingSound(const char *soundId) { return isPlayingSound(soundLabelToSoundId(soundId)); } -void dSoundSource_c::d_vt_0x38(bool flag, int fadeFrames) { - if (flag == 0) { - PauseAllSound(flag, fadeFrames); - d_s_vt_0x1C4(flag, fadeFrames); - a_field_0x80 = 0; - } else if (a_field_0x7E == 0) { - PauseAllSound(flag, fadeFrames); - d_s_vt_0x1C4(flag, fadeFrames); - a_field_0x80 = 1; +void dSoundSource_c::initVolumeFade() { + mVolumeFadeTarget = 1.0f; + mVolumeFadeStepSize = 0.0f; +} + +void dSoundSource_c::setVolumeFade(f32 volume, u32 fadeFrames) { + // @bug not actually clamped + (void)nw4r::ut::Clamp(volume, 0.0f, 2.0f); + if (fadeFrames == 0) { + SoundActor::SetVolume(volume); + mVolumeFadeTarget = volume; + mVolumeFadeStepSize = 0.0f; + return; + } + f32 currVolume = SoundActor::GetVolume(); + if (currVolume == volume) { + mVolumeFadeTarget = volume; + mVolumeFadeStepSize = 0.0f; + } else { + mVolumeFadeTarget = volume; + mVolumeFadeStepSize = (volume - currVolume) / fadeFrames; } } +void dSoundSource_c::calcVolumeFade() { + if (mIsPaused) { + return; + } + + if (mVolumeFadeStepSize == 0.0f) { + return; + } + + f32 nextVolume = SoundActor::GetVolume(); + nextVolume += mVolumeFadeStepSize; + if (mVolumeFadeStepSize > 0.0f) { + if (nextVolume >= mVolumeFadeTarget) { + nextVolume = mVolumeFadeTarget; + mVolumeFadeStepSize = 0.0f; + } + } else { + if (nextVolume <= mVolumeFadeTarget) { + nextVolume = mVolumeFadeTarget; + mVolumeFadeStepSize = 0.0f; + } + } + + SoundActor::SetVolume(nextVolume); +} + +void dSoundSource_c::setCtxInt(s32 value) { + sCtxParams.intParam = value; + setCtxParam(&sCtxParams); +} + +void dSoundSource_c::setCtxFloat(f32 value) { + sCtxParams.floatParam = value; + setCtxParam(&sCtxParams); +} + +bool dSoundSource_c::isInaudibleInternal() { + if (field_0x102 != 0) { + return true; + } + + return dSnd3DActor_c::getDistanceToCameraTarget() >= mpSourceParam->getField0x10(); +} + +bool dSoundSource_c::d_s_vt_0x190() const { + if (field_0x101 != 0) { + return true; + } + if (mIsDisabled) { + return true; + } + return dSndStateMgr_c::GetInstance()->getField_0x14() > 0; +} + +void dSoundSource_c::setPause(bool flag, int fadeFrames) { + if (!flag) { + PauseAllSound(flag, fadeFrames); + pauseAllDistantSounds(flag, fadeFrames); + mIsPaused = false; + } else if (!mIsDisabled) { + PauseAllSound(flag, fadeFrames); + pauseAllDistantSounds(flag, fadeFrames); + mIsPaused = true; + } +} + +bool dSoundSource_c::startSound(u32 soundId) { + return startSound(soundId, nullptr); +} + +bool dSoundSource_c::startSound(const char *label) { + return startSound(soundLabelToSoundId(label)); +} + +bool dSoundSource_c::startSoundWithIntParam(u32 soundId, s32 value) { + setCtxInt(value); + return startSound(soundId, nullptr) != nullptr; +} + +bool dSoundSource_c::startSoundWithIntParam(const char *label, s32 value) { + u32 soundId = soundLabelToSoundId(label); + return startSoundWithIntParam(soundId, value); +} + +bool dSoundSource_c::startSoundWithFloatParam(u32 soundId, f32 value) { + setCtxFloat(value); + return startSound(soundId, nullptr) != nullptr; +} + +bool dSoundSource_c::startSoundWithFloatParam(const char *label, f32 value) { + u32 soundId = soundLabelToSoundId(label); + return startSoundWithFloatParam(soundId, value); +} + +bool dSoundSource_c::startSoundWithParams(u32 soundId, f32 fValue, s32 value) { + setCtxInt(value); + setCtxFloat(fValue); + return startSound(soundId, nullptr) != nullptr; +} + +bool dSoundSource_c::startSoundWithParams(const char *label, f32 fValue, s32 value) { + u32 soundId = soundLabelToSoundId(label); + return startSoundWithParams(soundId, fValue, value); +} + +bool dSoundSource_c::maybeUnusedEnemyDeath() { + if (mSourceCategory == SND_SOURCE_CATEGORY_ENEMY) { + dSndSourceMgr_c::GetInstance()->onShutdownSource(this); + if (getAnimSound() != nullptr) { + getAnimSound()->shutdown(); + } + return startSound(SE_E_DISAPPEAR); + } + return false; +} + +bool dSoundSource_c::startRemoConSound(u32 soundId) { + nw4r::snd::SoundHandle *outHandle = nullptr; + StartResult result = startSound(soundId, nullptr, &outHandle); + if (result == START_SUCCESS && EGG::AudioRmtSpeakerMgr::getWpadVolume() != 0) { + outHandle->SetOutputLineFlag(nw4r::snd::OUTPUT_LINE_REMOTE_1); + } + return result == START_SUCCESS; +} + +nw4r::snd::SoundHandle *dSoundSource_c::startSound(u32 soundId, nw4r::snd::SoundHandle *handle) { + nw4r::snd::SoundHandle *outHandle = nullptr; + StartResult result = startSound(soundId, handle, &outHandle); + if (result == START_SUCCESS) { + return outHandle; + } + return nullptr; +} + nw4r::snd::SoundStartable::StartResult -dSoundSource_c::SetupSound(nw4r::snd::SoundHandle *pHandle, u32 soundId, const StartInfo *pStartInfo, void *) { - // TODO - return START_SUCCESS; +dSoundSource_c::startSound(u32 soundId, nw4r::snd::SoundHandle *handle, nw4r::snd::SoundHandle **pOutHandle) { + StartResult result; + + dSndSeSound1_c *seHandle = dSndSeSoundPool_c::GetInstance()->acquireSoundType1(this, soundId); + if (seHandle == nullptr) { + resetTempParams(); + return START_ERR_USER; + } + + seHandle->shiftParam(mpCtxParam); + if (handle != nullptr) { + seHandle->setHandle(handle); + } else { + handle = seHandle->getHandle(); + } + + field_0x11C |= 0x80000000; + result = StartSoundReturnStatus(handle, soundId, nullptr); + if (result == START_SUCCESS) { + addSeHandleType1(seHandle); + postStartSound(*handle, seHandle, soundId); + postSetupSound(handle->GetId(), soundId, seHandle); + seHandle->onStart(this); + seHandle->onCalc(this); + } else { + dSndSeSoundPool_c::GetInstance()->releaseSoundType1(seHandle, true); + handle = nullptr; + } + resetTempParams(); + if (pOutHandle != nullptr) { + *pOutHandle = handle; + } + return result; } -void dSoundSource_c::d_vt_0x58() { +bool dSoundSource_c::startSoundAtPosition(u32 soundId, const nw4r::math::VEC3 *position) { + if (!d_s_vt_0x1AC(soundId)) { + return false; + } + + u32 actualSoundId = soundId; + if (!sIsStartingBaseSound) { + actualSoundId = overrideStartSoundId(soundId); + if (actualSoundId == -1) { + resetTempParams(); + return false; + } + } + dSndDistantSoundActor_c *ac = startSoundAtPosition(actualSoundId, position, nullptr); + + if (ac != nullptr) { + if (ac->getHandle() != nullptr) { + actualSoundId = ac->getHandle()->GetId(); + } + f32 volume = getBaseSoundVolume(actualSoundId, soundId); + startBaseSoundAtPosition(soundId, position, volume); + } + return ac != nullptr; +} + +bool dSoundSource_c::startSoundAtPosition(const char *label, const nw4r::math::VEC3 *position) { + return startSoundAtPosition(soundLabelToSoundId(label), position); +} + +bool dSoundSource_c::startObjHitSound(u32 baseSoundId, dSoundSourceIf_c *source, const nw4r::math::VEC3 *position) { + if (source == nullptr) { + return startSoundAtPosition(baseSoundId, position); + } + + if (!d_s_vt_0x1AC(baseSoundId)) { + return false; + } + + u32 soundId = baseSoundId; + if (!sIsStartingBaseSound) { + u32 tmp = overrideStartSoundId(soundId); + if (tmp == -1) { + resetTempParams(); + return false; + } + soundId = overrideHitObjSoundId(tmp, static_cast(source)); + if (soundId == -1) { + resetTempParams(); + return false; + } + } + dSndDistantSoundActor_c *ac = startSoundAtPosition(soundId, position, nullptr); + if (ac != nullptr) { + if (ac->getHandle() != nullptr) { + soundId = ac->getHandle()->GetId(); + } + f32 volume = getBaseSoundVolume(soundId, baseSoundId); + startBaseSoundAtPosition(baseSoundId, position, volume); + } + return ac != nullptr; +} + +bool dSoundSource_c::startObjHitSound(const char *label, dSoundSourceIf_c *source, const nw4r::math::VEC3 *position) { + return startObjHitSound(soundLabelToSoundId(label), source, position); +} + +bool dSoundSource_c::startBgHitSound(u32 baseSoundId, u32 polyAttr0, u32 polyAttr1, const nw4r::math::VEC3 *position) { + if (!d_s_vt_0x1AC(baseSoundId)) { + return false; + } + + u32 soundId = baseSoundId; + if (!sIsStartingBaseSound) { + u32 tmp = overrideStartSoundId(soundId); + if (tmp == -1) { + resetTempParams(); + return false; + } + soundId = specializeBgHitSoundId(tmp, polyAttr0, polyAttr1); + if (soundId == -1) { + resetTempParams(); + return false; + } + } + dSndDistantSoundActor_c *ac = startSoundAtPosition(soundId, position, nullptr); + if (ac != nullptr) { + if (ac->getHandle() != nullptr) { + soundId = ac->getHandle()->GetId(); + } + f32 volume = getBaseSoundVolume(soundId, baseSoundId); + startBaseSoundAtPosition(baseSoundId, position, volume); + } + return ac != nullptr; +} + +bool dSoundSource_c::startBgHitSound( + const char *label, u32 polyAttr0, u32 polyAttr1, const nw4r::math::VEC3 *position +) { + return startBgHitSound(soundLabelToSoundId(label), polyAttr0, polyAttr1, position); +} + +// exact copy of startSoundAtPosition - used only for when the hookshot +// hits the water level +bool dSoundSource_c::startSoundAtPosition2(u32 soundId, const nw4r::math::VEC3 *position) { + if (!d_s_vt_0x1AC(soundId)) { + return false; + } + + u32 actualSoundId = soundId; + if (!sIsStartingBaseSound) { + actualSoundId = overrideStartSoundId(soundId); + if (actualSoundId == -1) { + resetTempParams(); + return false; + } + } + dSndDistantSoundActor_c *ac = startSoundAtPosition(actualSoundId, position, nullptr); + + if (ac != nullptr) { + if (ac->getHandle() != nullptr) { + actualSoundId = ac->getHandle()->GetId(); + } + f32 volume = getBaseSoundVolume(actualSoundId, soundId); + startBaseSoundAtPosition(soundId, position, volume); + } + return ac != nullptr; +} + +bool dSoundSource_c::startSoundAtPosition2(const char *label, const nw4r::math::VEC3 *position) { + return startSoundAtPosition2(soundLabelToSoundId(label), position); +} + +dSndDistantSoundActor_c * +dSoundSource_c::startSoundAtPosition(u32 soundId, const nw4r::math::VEC3 *position, nw4r::snd::SoundHandle *handle) { + if (position == nullptr) { + position = &GetPosition(); + } + dSndSeSound1_c *seHandle = nullptr; + if (handle != nullptr) { + seHandle = getHandleType1ForSoundHandle(handle); + } + if (seHandle == nullptr) { + seHandle = dSndSeSoundPool_c::GetInstance()->acquireSoundType1(this, soundId); + if (seHandle == nullptr) { + resetTempParams(); + return nullptr; + } + } + + dSndDistantSoundActor_c *ac = dSndDistantSoundActorPool_c::GetInstance()->acquireActor(soundId, position, this); + if (ac == nullptr) { + resetTempParams(); + return nullptr; + } + + seHandle->setAcquiredMaybe(true); + seHandle->shiftParam(mpCtxParam); + if (handle != nullptr) { + seHandle->setHandle(handle); + } else { + handle = seHandle->getHandle(); + } + + if (ac->startSound(soundId, *position, handle)) { + addSeHandleType1(seHandle); + seHandle->setInUseMaybe(true); + ac->postStartSound(*handle, seHandle, soundId); + postSetupSound(handle->GetId(), soundId, seHandle); + seHandle->onStart(this); + seHandle->onCalc(this); + } else { + dSndSeSoundPool_c::GetInstance()->releaseSoundType1(seHandle, true); + ac = nullptr; + } + resetTempParams(); + return ac; +} + +u32 dSoundSource_c::overrideHitObjSoundId(u32 soundId, dSoundSource_c *source) { + if (source == nullptr) { + return soundId; + } + if (checkUserParamMask(soundId, 0x200)) { + return modifySoundId(soundId, source); + } + return soundId; +} + +void dSoundSource_c::handleRemoCon(nw4r::snd::SoundHandle *pHandle, u32 baseId) { + u32 userParam = getSomeUserParam(baseId); + if ((userParam & 0x8) != 0) { + if (EGG::AudioRmtSpeakerMgr::getWpadVolume() != 0) { + pHandle->SetOutputLineFlag(nw4r::snd::OUTPUT_LINE_REMOTE_1); + } + } else if ((userParam & 0x4) != 0) { + pHandle->SetOutputLineFlag(nw4r::snd::OUTPUT_LINE_MAIN | nw4r::snd::OUTPUT_LINE_REMOTE_1); + } + + if ((userParam & 0x10) != 0) { + if (EGG::AudioRmtSpeakerMgr::getWpadVolume() != 0) { + u32 variant = getRemoConSoundVariant(baseId); + if (variant != -1) { + startRemoConSound(variant); + } + } + } +} + +bool dSoundSource_c::startVoiceLine(const char *label) { + return startVoiceLine(soundLabelToSoundId(label)); +} + +s32 dSoundSource_c::getRoomId() const { + return mpActor->roomid; +} + +void dSoundSource_c::stopSounds(u32 soundId, s32 fadeFrames) { + SoundStopper handler(soundId, fadeFrames); + ForEachSound(handler, false); +} + +void dSoundSource_c::stopSounds(const char *label, s32 fadeFrames) { + stopSounds(soundLabelToSoundId(label), fadeFrames); +} + +bool dSoundSource_c::holdSound(u32 soundId) { + return holdSound(soundId, nullptr); +} + +bool dSoundSource_c::holdSound(const char *label) { + return holdSound(soundLabelToSoundId(label)); +} + +bool dSoundSource_c::holdSoundWithIntParam(u32 soundId, s32 value) { + setCtxInt(value); + return holdSound(soundId, nullptr) != nullptr; +} + +bool dSoundSource_c::holdSoundWithIntParam(const char *label, s32 value) { + u32 soundId = soundLabelToSoundId(label); + return holdSoundWithIntParam(soundId, value); +} + +bool dSoundSource_c::holdSoundWithFloatParam(u32 soundId, f32 value) { + setCtxFloat(value); + return holdSound(soundId, nullptr) != nullptr; +} + +bool dSoundSource_c::holdSoundWithFloatParam(const char *label, f32 value) { + u32 soundId = soundLabelToSoundId(label); + return holdSoundWithFloatParam(soundId, value); +} + +bool dSoundSource_c::holdSoundWithParams(u32 soundId, f32 fValue, s32 value) { + setCtxInt(value); + setCtxFloat(fValue); + return holdSound(soundId, nullptr) != nullptr; +} + +bool dSoundSource_c::holdSoundWithParams(const char *label, f32 fValue, s32 value) { + u32 soundId = soundLabelToSoundId(label); + return holdSoundWithParams(soundId, fValue, value); +} + +nw4r::snd::SoundHandle *dSoundSource_c::holdSound(u32 soundId, nw4r::snd::SoundHandle *handle) { + if (soundId == -1) { + return nullptr; + } + + dSndSeSound2_c *seHandle = getHandleType2ForSoundId(soundId); + if (seHandle == nullptr) { + seHandle = dSndSeSoundPool_c::GetInstance()->acquireSoundType2(this, soundId); + if (seHandle == nullptr) { + resetTempParams(); + return nullptr; + } + + seHandle->shiftParam(mpCtxParam); + + if (handle != nullptr) { + seHandle->setHandle(handle); + } else { + handle = seHandle->getHandle(); + } + + field_0x11C |= 0x80000000; + if (HoldSound(handle, soundId)) { + addSeHandleType2(seHandle); + postHoldSound(*handle, seHandle, soundId, 0); + postSetupSound(handle->GetId(), soundId, seHandle); + seHandle->onStart(this); + seHandle->onCalc(this); + } else { + dSndSeSoundPool_c::GetInstance()->releaseSoundType2(seHandle); + handle = nullptr; + } + } else { + handle = continueHoldingSound(seHandle, soundId, nullptr, nullptr); + } + resetTempParams(); + + return handle; +} + +nw4r::snd::SoundHandle *dSoundSource_c::continueHoldingSound( + dSndSeSound2_c *seHandle, u32 soundId, dSndDistantSoundActor_c *distant, const nw4r::math::VEC3 *position +) { + if (!d_s_vt_0x1AC(soundId)) { + resetTempParams(); + return nullptr; + } + + u32 actualSoundId = soundId; + if (!sIsStartingBaseSound) { + actualSoundId = overrideHoldSoundId(soundId, false); + if (actualSoundId == -1) { + resetTempParams(); + return nullptr; + } + actualSoundId = d_s_vt_0x1E8(actualSoundId); + if (actualSoundId == -1) { + resetTempParams(); + return nullptr; + } + } + nw4r::snd::SoundHandle *handle = seHandle->getHandle(); + seHandle->shiftParam(mpCtxParam); + field_0x11C |= 0x80000000; + bool ok; + if (distant != nullptr && position != nullptr) { + // not sure why we're using the original ID here + ok = distant->holdSound(soundId, *position, handle); + } else { + ok = HoldSound(handle, actualSoundId); + } + field_0x11C = 0; + mAnimEventValue = 0; + if (ok) { + seHandle->setField0x130(1); + postHoldSound(*handle, seHandle, soundId, 0); + } else { + handle = nullptr; + } + resetTempParams(); + return handle; +} + +bool dSoundSource_c::holdSoundAtPosition(u32 soundId, const nw4r::math::VEC3 *position) { + dSndSeSound2_c *seHandle; + nw4r::snd::SoundHandle *handle; + + if (position != nullptr) { + dSndDistantSoundActor_c *actor = dSndDistantSoundActorPool_c::GetInstance()->findActiveActor(soundId, this); + if (actor != nullptr) { + seHandle = actor->getHoldSoundHandle(); + seHandle->setAcquiredMaybe(1); + handle = continueHoldingSound(seHandle, soundId, actor, position); + } else { + if (d_s_vt_0x190()) { + resetTempParams(); + return false; + } + if (isInaudibleInternal()) { + resetTempParams(); + return false; + } + actor = dSndDistantSoundActorPool_c::GetInstance()->acquireActor(soundId, position, this); + if (actor == nullptr) { + resetTempParams(); + return false; + } + seHandle = dSndSeSoundPool_c::GetInstance()->acquireSoundType2(this, soundId); + if (seHandle == nullptr) { + resetTempParams(); + return false; + } + seHandle->shiftParam(mpCtxParam); + handle = seHandle->getHandle(); + if (actor->holdSound(soundId, *position, handle)) { + addSeHandleType2(seHandle); + postHoldSound(*handle, seHandle, soundId, 0); + postSetupSound(handle->GetId(), soundId, seHandle); + seHandle->onStart(this); + seHandle->onCalc(this); + actor->setHoldSoundHandle(seHandle); + } else { + dSndSeSoundPool_c::GetInstance()->releaseSoundType2(seHandle); + handle = nullptr; + } + } + + } else { + handle = holdSound(soundId, nullptr); + } + resetTempParams(); + return handle != nullptr; +} + +bool dSoundSource_c::holdSoundAtPosition(const char *label, const nw4r::math::VEC3 *position) { + return holdSoundAtPosition(soundLabelToSoundId(label), position); +} + +nw4r::snd::SoundStartable::StartResult +dSoundSource_c::SetupSound(nw4r::snd::SoundHandle *pHandle, u32 soundId, const StartInfo *pStartInfo, void *arg) { + bool holdFlag = *(bool *)arg; + if (!d_s_vt_0x1AC(soundId)) { + return onSetupError(); + } else if ((field_0x11C & 0x80000000) != 0) { + return setupSound(pHandle, soundId, pStartInfo, arg, holdFlag); + } else { + return onSetupError(); + } +} + +bool dSoundSource_c::d_s_vt_0x1AC(u32 soundId) { + if (soundId == -1) { + return false; + } + + if (d_s_vt_0x190()) { + return false; + } + + if (isInaudibleInternal()) { + return false; + } + + if (checkUserParamMask(soundId, 0x80000000)) { + return false; + } + + return true; +} + +nw4r::snd::SoundStartable::StartResult dSoundSource_c::setupSound( + nw4r::snd::SoundHandle *pHandle, u32 soundId, const StartInfo *pStartInfo, void *arg, bool holdFlag +) { + u32 userParam = getSomeUserParam(soundId); + if (userParam & 0x2) { + // maybe a flag for not allowing duplicates + if (getHandleType1ForSoundId(soundId) != nullptr) { + return onSetupError(); + } + } else if (userParam & 0x1) { + // maybe a flag for stopping other copies + stopSoundHandles(soundId, 2); + } + + u32 variantSoundId = soundId; + if (!sIsStartingBaseSound) { + u32 anotherSoundId; + if (holdFlag) { + anotherSoundId = overrideHoldSoundId(soundId, true); + } else { + anotherSoundId = overrideStartSoundId(soundId); + } + if (anotherSoundId == -1) { + return onSetupError(); + } + + if (userParam & 0x800) { + anotherSoundId = modifySoundId(anotherSoundId); + if (anotherSoundId == -1) { + return onSetupError(); + } + } + variantSoundId = d_s_vt_0x1E8(anotherSoundId); + if (variantSoundId == -1) { + return onSetupError(); + } + } + + if (!holdFlag && (userParam & 0x1C000000) != 0) { + dSndDistantSoundActor_c *ac = startSoundAtPosition(variantSoundId, &GetPosition(), nullptr); + f32 volume = 0.0f; + if (ac != nullptr) { + if ((userParam & 0x10000000) != 0 && (userParam & 0xC000000) == 0) { + ac->setUseSourcePosition(true); + } + // unnecessary double check + if (!holdFlag) { + volume = getBaseSoundVolume(variantSoundId, soundId); + } + } + startBaseSoundAtPosition(soundId, &GetPosition(), volume); + resetTempParams(); + return onSetupError(); + } else { + StartResult result = dSnd3DActor_c::SetupSound(pHandle, variantSoundId, pStartInfo, arg); + if (result == START_SUCCESS && !holdFlag) { + f32 volume = getBaseSoundVolume(variantSoundId, soundId); + startBaseSound(soundId, volume); + } + resetTempParams(); + return result; + } +} + +f32 dSoundSource_c::getBaseSoundVolume(u32 variantSoundId, u32 baseSoundId) { + if (variantSoundId == baseSoundId) { + return 0.0f; + } else if (sIsStartingBaseSound) { + return 0.0f; + } + + u32 volume = (dSndPlayerMgr_c::GetInstance()->getSomeUserParam(variantSoundId) >> 16) & 0xFF; + if (volume > 100) { + volume = 100; + } + return volume / 100.0f; +} + +nw4r::snd::SoundHandle *dSoundSource_c::startBaseSound(u32 baseSoundId, f32 volume) { + if (volume <= 0.0f) { + return nullptr; + } + + sIsStartingBaseSound = true; + nw4r::snd::SoundHandle *handle = startSound(baseSoundId, nullptr); + sIsStartingBaseSound = false; + if (handle != nullptr) { + handle->SetVolume(volume, 0); + } + return handle; +} + +dSndDistantSoundActor_c * +dSoundSource_c::startBaseSoundAtPosition(u32 baseSoundId, const nw4r::math::VEC3 *position, f32 volume) { + if (volume <= 0.0f) { + return nullptr; + } + + sIsStartingBaseSound = true; + dSndDistantSoundActor_c *handle = startSoundAtPosition(baseSoundId, position, nullptr); + sIsStartingBaseSound = false; + if (handle != nullptr) { + handle->getHandle()->SetVolume(volume, 0); + } + return handle; +} + +void dSoundSource_c::resetTempParams() { + mpCtxParam = nullptr; + sCtxParams.floatParam = 0.0f; + sCtxParams.intParam = 0; + field_0x11C = 0; + mAnimEventValue = 0; +} + +nw4r::snd::SoundStartable::StartResult dSoundSource_c::onSetupError() { + resetTempParams(); + return START_ERR_USER; +} + +u32 dSoundSource_c::overrideStartSoundId(u32 soundId) { + return soundId; +} + +void dSoundSource_c::postStartSound(nw4r::snd::SoundHandle &handle, dSndSeSound_c *pSound, u32 id) { // noop } -void dSoundSource_c::d_vt_0x5C() { +u32 dSoundSource_c::overrideHoldSoundId(u32 soundId, bool initial) { + return soundId; +} + +void dSoundSource_c::postHoldSound(nw4r::snd::SoundHandle &handle, dSndSeSound_c *pSound, u32 id, UNKWORD) { // noop } -u32 dSoundSource_c::getCharacterTalkSoundId(u32 baseSoundId, dSoundSource_c *source) { +void dSoundSource_c::attachDistantSound(dSndDistantSoundActor_c *sound) { + if (sound != nullptr) { + sound->setSourceDirectly(this); + appendDistantSound(sound); + } +} + +void dSoundSource_c::detachDistantSound(dSndDistantSoundActor_c *sound) { + if (sound != nullptr && sound->isAttachedSource(this)) { + sound->setSourceDirectly(nullptr); + removeDistantSound(sound); + } +} + +void dSoundSource_c::detachAllDistantSounds() { + dSndDistantSoundActor_c *it = getDistantSoundFirst(); + while (it != nullptr) { + it->setSourceDirectly(nullptr); + removeDistantSound(it); + it = getDistantSoundFirst(); + } +} + +void dSoundSource_c::pauseAllDistantSounds(bool flag, int fadeFrames) { + for (dSndDistantSoundActor_c *it = getDistantSoundFirst(); it != nullptr; it = getDistantSoundNext(it)) { + it->PauseAllSound(flag, fadeFrames); + } +} + +void dSoundSource_c::addSeHandleType1(dSndSeSound1_c *handle) { + if (handle == nullptr) { + return; + } + if (handle->isAttachedSource()) { + return; + } + handle->attachSource(this); + appendHandleType1(handle); +} + +void dSoundSource_c::addSeHandleType2(dSndSeSound2_c *handle) { + if (handle == nullptr) { + return; + } + if (handle->isAttachedSource()) { + return; + } + handle->attachSource(this); + appendHandleType2(handle); +} + +void dSoundSource_c::removeSeHandleType1(dSndSeSound1_c *handle, bool stop) { + if (handle == nullptr) { + return; + } + if (!handle->isAttachedSource()) { + return; + } + removeHandleType1(handle); + dSndSeSoundPool_c::GetInstance()->releaseSoundType1(handle, stop); +} + +void dSoundSource_c::removeSeHandleType2(dSndSeSound2_c *handle) { + if (handle == nullptr) { + return; + } + if (!handle->isAttachedSource()) { + return; + } + removeHandleType2(handle); + dSndSeSoundPool_c::GetInstance()->releaseSoundType2(handle); +} + +void dSoundSource_c::removeAllSeHandles() { + removeAllSeHandlesType1(); + removeAllSeHandlesType2(); +} + +void dSoundSource_c::removeAllSeHandlesType1() { + dSndSeSound1_c *sound = getHandleType1First(); + while (sound != nullptr) { + removeSeHandleType1(sound, sound->unkRemovalCheck()); + sound = getHandleType1First(); + } +} + +void dSoundSource_c::removeAllSeHandlesType2() { + dSndSeSound2_c *sound = getHandleType2First(); + while (sound != nullptr) { + removeSeHandleType2(sound); + sound = getHandleType2First(); + } +} + +void dSoundSource_c::calcHandles() { + calcHandlesType1(); + calcHandlesType2(); +} + +void dSoundSource_c::calcHandlesType1() { + dSndSeSound1_c *next, *it; + it = getHandleType1First(); + while (it != nullptr) { + next = getHandleType1Next(it); + if (it->isAttachedSound()) { + it->calc(this); + } else { + removeSeHandleType1(it, true); + } + it = next; + } +} + +void dSoundSource_c::calcHandlesType2() { + dSndSeSound2_c *next, *it; + it = getHandleType2First(); + while (it != nullptr) { + next = getHandleType2Next(it); + if (it->isAttachedSound()) { + if (it->calcTimer()) { + continueHoldingSound(it, it->getHandle()->GetId(), nullptr, nullptr); + } + it->calc(this); + } else { + removeSeHandleType2(it); + } + it = next; + } +} + +dSndSeSound1_c *dSoundSource_c::getHandleType1ForSoundId(u32 soundId) { + dSndSeSound1_c *sound = getHandleType1First(); + while (sound != nullptr) { + if (sound->isSoundId(soundId) || sound->getHandle()->GetId() == soundId) { + return sound; + } + sound = getHandleType1Next(sound); + } + + return nullptr; +} + +dSndSeSound1_c *dSoundSource_c::getHandleType1ForSoundHandle(nw4r::snd::SoundHandle *handle) { + dSndSeSound1_c *sound = getHandleType1First(); + while (sound != nullptr) { + if (sound->getHandle() == handle) { + return sound; + } + sound = getHandleType1Next(sound); + } + + return nullptr; +} + +dSndSeSound2_c *dSoundSource_c::getHandleType2ForSoundId(u32 soundId) { + dSndSeSound2_c *sound = getHandleType2First(); + while (sound != nullptr) { + if (sound->isSoundId(soundId) || sound->getHandle()->GetId() == soundId) { + return sound; + } + sound = getHandleType2Next(sound); + } + + return nullptr; +} + +dSndSeSound1_c *dSoundSource_c::getHandleType1ForSoundHandle_Dupe(nw4r::snd::SoundHandle *pHandle) { + dSndSeSound1_c *sound = getHandleType1First(); + while (sound != nullptr) { + if (sound->getHandle() == pHandle) { + return sound; + } + sound = getHandleType1Next(sound); + } + + return nullptr; +} + +dSndSeSound2_c *dSoundSource_c::getHandleType2ForSoundHandle_Dupe(nw4r::snd::SoundHandle *pHandle) { + dSndSeSound2_c *sound = getHandleType2First(); + while (sound != nullptr) { + if (sound->getHandle() == pHandle) { + return sound; + } + sound = getHandleType2Next(sound); + } + + return nullptr; +} + +void dSoundSource_c::stopSoundHandles(u32 soundId, s32 fadeFrames) { + { + dSndSeSound1_c *next, *it; + it = getHandleType1First(); + while (it != nullptr) { + next = getHandleType1Next(it); + if (it->isSoundId(soundId) || it->getHandle()->GetId() == soundId) { + it->getHandle()->Stop(fadeFrames); + removeSeHandleType1(it, true); + } + it = next; + } + } + + { + dSndSeSound2_c *next, *it; + it = getHandleType2First(); + while (it != nullptr) { + next = getHandleType2Next(it); + if (it->isSoundId(soundId) || it->getHandle()->GetId() == soundId) { + it->getHandle()->Stop(fadeFrames); + removeSeHandleType2(it); + } + it = next; + } + } +} + +#pragma push +#pragma optimize_tail_call off +bool dSoundSource_c::isInaudible() { + return isInaudibleInternal(); +} +#pragma pop + +void dSoundSource_c::setPolyAttrs(u8 polyAttr0, u8 polyAttr1) { + mPolyAttr0 = polyAttr0; + mPolyAttr1 = polyAttr1; +} + +void dSoundSource_c::d_s_vt_0x1E4_noop() { + // never used, never overridden +} + +u32 dSoundSource_c::modifySoundId(u32 baseSoundId) { + if (baseSoundId != -1) { + SizedString<64> label; + + const char *baseLabel = dSndMgr_c::getSoundLabelString(baseSoundId); + const char *charLabel = getName(); + label.sprintf("%s_%s", baseLabel, charLabel); + u32 newLabel = dSndPlayerMgr_c::GetInstance()->convertLabelStringToSoundId(label); + if (newLabel != -1) { + return newLabel; + } + } + return baseSoundId; +} + +u32 dSoundSource_c::modifySoundId(u32 baseSoundId, dSoundSource_c *source) { if (baseSoundId != -1 && source != nullptr) { SizedString<64> label; - // maybe an inline - const char *baseLabel = nullptr; - if (dSndMgr_c::GetInstance()->getArchive() != nullptr) { - baseLabel = dSndMgr_c::GetInstance()->getArchive()->GetSoundLabelString(baseSoundId); - } - + const char *baseLabel = dSndMgr_c::getSoundLabelString(baseSoundId); const char *charLabel = source->getName(); label.sprintf("%s_%s", baseLabel, charLabel); u32 newLabel = dSndPlayerMgr_c::GetInstance()->convertLabelStringToSoundId(label); @@ -121,9 +1205,112 @@ u32 dSoundSource_c::getCharacterTalkSoundId(u32 baseSoundId, dSoundSource_c *sou return baseSoundId; } +u32 dSoundSource_c::specializeBgHitSoundId(u32 soundId, u32 polyAttr0, u32 polyAttr1) { + if (checkUserParamMask(soundId, 0x100)) { + if (polyAttr0 >= POLY_ATT_0_NONE + 1 && polyAttr0 <= POLY_ATT_0_MAX - 1) { + const char *baseLabel = dSndMgr_c::getSoundLabelString(soundId); + SizedString<64> label; + label.sprintf("%s_%s_%d", baseLabel, getHitEffectName(polyAttr0), polyAttr1); + u32 newId = dSndPlayerMgr_c::GetInstance()->convertLabelStringToSoundId(label); + if (newId == -1) { + SizedString<64> label; + label.sprintf("%s_%s", baseLabel, getHitEffectName(polyAttr0)); + newId = dSndPlayerMgr_c::GetInstance()->convertLabelStringToSoundId(label); + } + if (newId != -1) { + return newId; + } + } + } + return soundId; +} + +u32 dSoundSource_c::d_s_vt_0x1E8(u32 soundId) { + return soundId; +} + u32 dSoundSource_c::getRemoConSoundVariant(u32 soundId) const { const char *label = soundIdToSoundLabel(soundId); SizedString<64> str; str.sprintf("%s_RC", label); return soundLabelToSoundId(str); } + +f32 dSoundSource_c::timeAreaCheck() { + bool check = !dTimeAreaMgr_c::GetInstance()->fn_800B9B60(getRoomId(), GetPosition()); + if (check) { + return 0.0f; + } + f32 tmp = dTimeAreaMgr_c::GetInstance()->fn_800B9CE0(GetPosition()); + if (tmp > 0.0f) { + tmp = tmp / 500.0f; + if (tmp > 1.0f) { + tmp = 1.0f; + } + } + return tmp; +} + +nw4r::snd::SoundStartable::StartResult +dSoundSource_c::setupSoundCommon(nw4r::snd::SoundHandle *pHandle, u32 soundId, const StartInfo *pStartInfo, void *arg) { + bool holdFlag = *(bool *)arg; + if (!d_s_vt_0x1AC(soundId)) { + return onSetupError(); + } + + dSndSeSound_c *seHandle = nullptr; + bool freshSeSound = false; + if ((field_0x11C & 0x80000000) == 0) { + if (holdFlag) { + seHandle = getHandleType2ForSoundHandle_Dupe(pHandle); + } else { + seHandle = getHandleType1ForSoundHandle_Dupe(pHandle); + } + + if (seHandle == nullptr) { + if (holdFlag) { + seHandle = dSndSeSoundPool_c::GetInstance()->acquireSoundType2(this, soundId); + } else { + seHandle = dSndSeSoundPool_c::GetInstance()->acquireSoundType1(this, soundId); + } + freshSeSound = true; + } + + if (seHandle == nullptr) { + return onSetupError(); + } + + if (pHandle != nullptr) { + seHandle->setHandle(pHandle); + } else { + pHandle = seHandle->getHandle(); + } + } + + StartResult res = setupSound(pHandle, soundId, pStartInfo, arg, holdFlag); + if (res == START_SUCCESS) { + if (seHandle != nullptr) { + if (!holdFlag) { + if (freshSeSound) { + addSeHandleType1(static_cast(seHandle)); + } + postStartSound(*pHandle, seHandle, soundId); + } else { + if (freshSeSound) { + addSeHandleType2(static_cast(seHandle)); + } + postHoldSound(*pHandle, seHandle, soundId, 1); + } + postSetupSound(pHandle->GetId(), soundId, seHandle); + seHandle->onStart(this); + seHandle->onCalc(this); + } + } else if (freshSeSound) { + if (seHandle->getHandleType() == dSndSeSound_c::SE_HANDLE_TYPE_1) { + dSndSeSoundPool_c::GetInstance()->releaseSoundType1(static_cast(seHandle), true); + } else { + dSndSeSoundPool_c::GetInstance()->releaseSoundType2(static_cast(seHandle)); + } + } + return res; +} diff --git a/src/d/snd/d_snd_source_enemy.cpp b/src/d/snd/d_snd_source_enemy.cpp new file mode 100644 index 00000000..2b4c703d --- /dev/null +++ b/src/d/snd/d_snd_source_enemy.cpp @@ -0,0 +1,138 @@ +#include "d/snd/d_snd_source_enemy.h" + +#include "common.h" +#include "d/snd/d_snd_anim_sound.h" +#include "d/snd/d_snd_source.h" +#include "d/snd/d_snd_source_enums.h" +#include "d/snd/d_snd_source_mgr.h" +#include "d/snd/d_snd_wzsound.h" + +dSndSourceEnemy_c::dSndSourceEnemy_c(s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup) + : dSoundSource_c(sourceType, ac, name, pOwnerGroup), field_0x164(2), field_0x168(0), field_0x169(0) { + if ((SoundSourceType_e)sourceType < SND_SOURCE_ENEMY_28) { + dSndSourceMgr_c::GetInstance()->incrementEnemyCount(); + mIsRegisteredEnemy = true; + } else { + mIsRegisteredEnemy = false; + } +} + +dSndSourceEnemy_c::~dSndSourceEnemy_c() { + unregisterEnemySource(); +} + +void dSndSourceEnemy_c::shutdown() { + dSoundSource_c::shutdown(); + unregisterEnemySource(); +} + +void dSndSourceEnemy_c::unregisterEnemySource() { + if (!mIsRegisteredEnemy) { + return; + } + + if (mSourceType < SND_SOURCE_ENEMY_28) { + dSndSourceMgr_c::GetInstance()->decrementEnemyCount(); + } + mIsRegisteredEnemy = false; +} + +void dSndSourceEnemy_c::postSetup() { + if (isName("EBfish")) { + field_0x169 = 1; + } else if (isName("BLasBos")) { + setVolumeFade(0.9f, 0); + } else if (isName("BBigBos") || isName("BBsFootL") || isName("BBsFootR") || isName("BBsMane")) { + setVolumeFade(0.9f, 0); + } else if (isName("BAsura")) { + getAnimSound()->setField_0x98(100.0f); + } else if (isName("BGh") || isName("BGh2") || isName("BGh3")) { + getAnimSound()->setField_0x98(0.0f); + } +} + +void dSndSourceEnemy_c::vt_0x020() { + dSndSourceMgr_c::GetInstance()->registerUnkEnemyType(this); +} + +UNKWORD dSndSourceEnemy_c::checkBattleBgmRelated() { + if (getRoomId() == dSndSourceMgr_c::GetInstance()->getPlayerSourceRoomId()) { + f32 dist = getDistanceToPlayer(); + if (field_0x168 == 0 && dist <= 1200.0f) { + return field_0x164; + } + + if (field_0x168 != 0 && dist < 700.0f) { + return field_0x164; + } + } + + return 0; +} + +u32 dSndSourceEnemy_c::overrideStartSoundId(u32 soundId) { + switch (mSourceType) { + case SND_SOURCE_BULLET_MAGUPPO: + switch (mSubtype) { + case 1: + switch (soundId) { + case SE_MagpB_HIT: soundId = SE_MagpB_HIT_SAND; break; + case SE_MagpB_BROKEN: soundId = SE_MagpB_BROKEN_SAND; break; + } + break; + case 2: + switch (soundId) { + case SE_MagpB_BROKEN: soundId = SE_MagpB_BROKEN_MA; break; + } + break; + case 3: + switch (soundId) { + case SE_MagpB_BROKEN: soundId = SE_MagpB_BROKEN_WATER; break; + } + break; + } + break; + case SND_SOURCE_LIZARUFOS: + case SND_SOURCE_BC_Z: + if (soundId == SE_E_DISAPPEAR) { + unregisterEnemySource(); + } + break; + } + + return soundId; +} + +u32 dSndSourceEnemy_c::overrideHoldSoundId(u32 soundId, bool initial) { + if (mSourceType == SND_SOURCE_BULLET_MAGUPPO) { + switch (mSubtype) { + case 1: + switch (soundId) { + case SE_MagpB_FLY_LV: soundId = SE_MagpB_FLY_LV_SAND; break; + } + break; + case 2: + case 3: + switch (soundId) { + case SE_MagpB_FLY_LV: soundId = SE_MagpB_FLY_LV_MA; break; + } + break; + } + } + return soundId; +} + +u32 dSndSourceEnemyAnim_c::overrideStartSoundId(u32 soundId) { + // TODO + return soundId; +} + +u32 dSndSourceEnemyAnim_c::overrideHoldSoundId(u32 soundId, bool initial) { + // TODO + return soundId; +} + + +void dSndSourceEnemyMulti_c::postCalc() { + // TODO - Nusi +} diff --git a/src/d/snd/d_snd_source_equipment.cpp b/src/d/snd/d_snd_source_equipment.cpp new file mode 100644 index 00000000..e16920bd --- /dev/null +++ b/src/d/snd/d_snd_source_equipment.cpp @@ -0,0 +1,148 @@ +#include "d/snd/d_snd_source_equipment.h" + +#include "common.h" +#include "d/a/d_a_player.h" +#include "d/snd/d_snd_source.h" +#include "d/snd/d_snd_source_enums.h" +#include "d/snd/d_snd_state_mgr.h" +#include "d/snd/d_snd_wzsound.h" + +dSndSourceEquipment_c::dSndSourceEquipment_c( + s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup +) + : dSoundSource_c(sourceType, ac, name, pOwnerGroup) {} + +void dSndSourceEquipment_c::shutdown() { + dSoundSource_c::shutdown(); + if (mSourceType == SND_SOURCE_ARROW && !mIsDisabled) { + stopAllSound(2); + } +} + +u32 dSndSourceEquipment_c::overrideStartSoundId(u32 soundId) { + switch (mSourceType) { + case SND_SOURCE_BLADE: + if (soundId == SE_SW_PUTIN && (dSndStateMgr_c::GetInstance()->isInEvent("ECaptain_c_dead") || + dSndStateMgr_c::GetInstance()->isInEvent("ECaptain_c_deadType2"))) { + // TODO: I guess there would be a distracting sword stow sound in the Scervo death sequence? + return -1; + } + break; + case SND_SOURCE_SHIELD: + switch (soundId) { + case SE_SH_GIRD_HIT: + if (mpCtxParam != nullptr) { + switch (mpCtxParam->intParam) { + case 1: soundId = SE_SH_GIRD_HIT_FIRE; break; + case 2: + case 4: soundId = SE_SH_GIRD_HIT_ELEC; break; + case 3: soundId = SE_SH_GIRD_HIT_CURSE; break; + } + } + break; + case SE_SH_GIRD_JUST: + if (mpCtxParam != nullptr) { + switch (mpCtxParam->intParam) { + case 1: soundId = SE_SH_GIRD_JUST_FIRE; break; + case 2: + case 4: soundId = SE_SH_GIRD_JUST_ELEC; break; + case 3: soundId = SE_SH_GIRD_JUST_CURSE; break; + } + } + break; + case SE_SH_BREAK: + // TODO enum + if (dAcPy_c::getCurrentlyEquippedShieldType() == 0) { + soundId = SE_SH_BREAK_WOOD; + break; + } + break; + } + break; + case SND_SOURCE_BOOMERANG: + if (soundId == SE_BE_HIT_DMG || soundId == SE_BE_COME_BACK) { + // Not sure if this override handler is the right place for a stop call + stopSounds(SE_BE_THROW_RC, 10); + } + break; + case SND_SOURCE_BOMB: + if (soundId == SE_BM_FALL_WATER) { + // Not sure if this override handler is the right place for a shutdown call + shutdown(); + } + break; + case SND_SOURCE_ARROW: + if (soundId != SE_AW_FLY) { + stopSounds(SE_AW_FLY, 1); + shutdown(); + } + } + return soundId; +} + +void dSndSourceEquipment_c::postStartSound(nw4r::snd::SoundHandle &handle, dSndSeSound_c *pSound, u32 id) { + dSoundSource_c::postStartSound(handle, pSound, id); + handleRemoCon(&handle, id); +} + +u32 dSndSourceEquipment_c::overrideHitObjSoundId(u32 soundId, dSoundSource_c *source) { + if (source == nullptr) { + return soundId; + } + u32 overrideId = soundId; + if (checkUserParamMask(soundId, 0x200)) { + overrideId = modifySoundId(soundId, source); + } + if (overrideId == soundId) { + switch (source->getCategory()) { + case SND_SOURCE_CATEGORY_OBJECT: + switch (soundId) { + case SE_SW_HIT: + if (source->getSourceType() == SND_SOURCE_ITEM || + source->getSourceType() == SND_SOURCE_BAMBOO) { + return -1; + } else { + overrideId = SE_SW_HIT_OBJ; + } + break; + case SE_SW_HIT_DMG: overrideId = SE_SW_HIT_OBJ; break; + case SE_SW_HIT_DMG_STAB: overrideId = SE_SW_HIT_OBJ; break; + case SE_SW_HIT_NO_DMG: overrideId = SE_SW_HIT_NO_DMG_OBJ; break; + case SE_SW_BEAM_HIT_DMG: overrideId = SE_SW_BEAM_HIT; break; + case SE_WI_HIT_DMG: overrideId = SE_WI_HIT; break; + case SE_HS_HIT_DMG: overrideId = SE_HS_REBOUND; break; + } + break; + case SND_SOURCE_CATEGORY_ENEMY: break; + case SND_SOURCE_CATEGORY_NPC: + if (source->getSourceType() != SND_SOURCE_INSECT) { + if (soundId == SE_BE_HIT) { + overrideId = SE_BE_HIT_NPC; + } else { + overrideId = -1; + } + } + break; + case SND_SOURCE_CATEGORY_EQUIPMENT: + if (source->getSourceType() == SND_SOURCE_BOMB && soundId == SE_BE_HIT_DMG) { + overrideId = SE_BE_HIT; + } else { + overrideId = -1; + } + break; + default: overrideId = -1; break; + } + } + return overrideId; +} + +dSndSourceEquipmentWhip_c::dSndSourceEquipmentWhip_c( + s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup +) + : dSndSourceEquipment_c(sourceType, ac, name, pOwnerGroup) {} + +void dSndSourceEquipmentWhip_c::postCalc() { + if (dAcPy_c::GetLink() != nullptr && dAcPy_c::GetLink()->isUsingWhip()) { + holdSound(SE_WI_FX_LV); + } +} diff --git a/src/d/snd/d_snd_source_group.cpp b/src/d/snd/d_snd_source_group.cpp index d973deaa..e73f4903 100644 --- a/src/d/snd/d_snd_source_group.cpp +++ b/src/d/snd/d_snd_source_group.cpp @@ -4,13 +4,13 @@ #include "common.h" #include "d/snd/d_snd_source.h" #include "d/snd/d_snd_source_enums.h" +#include "d/snd/d_snd_source_mgr.h" +#include "d/snd/d_snd_state_mgr.h" #include "nw4r/ut/ut_list.h" #include -extern "C" bool isInStage(const char *stageName); - -void dSndSourceGroup_c::set(s32 sourceType, const char *name) { +void dSndSourceGroup_c::setParam(s32 sourceType, const char *name) { resetSoundSourceParam(); bool assignedParam = false; @@ -40,17 +40,17 @@ void dSndSourceGroup_c::set(s32 sourceType, const char *name) { if (!assignedParam) { switch (sourceType) { - case SND_SOURCE_NPC_NRM: { + case SND_SOURCE_NPC_51: { mParam.field_0x00 = 300.0f; mParam.field_0x04 = 800.0; mParam.field_0x10 = 2200.0; break; } - case SND_SOURCE_NPC_48: { - if (isInStage("F401")) { + case SND_SOURCE_NPC_HEAD: { + if (dSndStateMgr_c::isInStage("F401")) { mParam.field_0x00 = 500.0f; mParam.field_0x04 = 4000.0; - } else if (isInStage("F402")) { + } else if (dSndStateMgr_c::isInStage("F402")) { mParam.field_0x00 = 400.0f; mParam.field_0x04 = 3500.0; } else { @@ -71,23 +71,70 @@ void dSndSourceGroup_c::resetSoundSourceParam() { dSndSourceGroup_c::dSndSourceGroup_c() : mSubtype(0), - field_0x1C(0), - field_0x1D(0), + mIsActive(false), + field_0x1D(false), mName(""), - field_0x40(0), + mpOrigName(nullptr), mpCachedClosestSourceToListener(nullptr), mpCachedClosestSourceToPlayer(nullptr), mCalculatedClosestToListener(false), mCalculatedClosestToPlayer(false) { // TODO offsetof - nw4r::ut::List_Init(&mSourceList, 0x138); + nw4r::ut::List_Init(&mSubSourceList, 0x138); resetSoundSourceParam(); } +dSndSourceGroup_c::dSndSourceGroup_c(s32 sourceType, const char *name, const char *origName, s32 subtype) + : mSourceCategory(-1), + mSubtype(subtype), + mIsActive(false), + field_0x1D(false), + mName(name), + mpOrigName(origName), + mpCachedClosestSourceToListener(nullptr), + mpCachedClosestSourceToPlayer(nullptr), + mCalculatedClosestToListener(false), + mCalculatedClosestToPlayer(false) { + nw4r::ut::List_Init(&mSubSourceList, 0x138); + setParam(sourceType, name); +} + +void dSndSourceGroup_c::set(s32 sourceType, const char *name, const char *origName, s32 subtype) { + mSourceCategory = dSndSourceMgr_c::getSourceCategoryForSourceType(sourceType, name); + setParam(sourceType, name); + mSourceType = sourceType; + mName = name; + mSubtype = subtype; + mpCachedClosestSourceToPlayer = nullptr; + mpCachedClosestSourceToListener = nullptr; + mCalculatedClosestToPlayer = false; + mCalculatedClosestToListener = false; + mpOrigName = origName; +} + +void dSndSourceGroup_c::setTemp(s32 sourceType, const char *name, s32 subtype) { + mSourceType = sourceType; + mName = name; + mSubtype = subtype; +} + dSndSourceGroup_c::~dSndSourceGroup_c() { clearList(); } +void dSndSourceGroup_c::clear() { + clearList(); + mIsActive = false; + field_0x1D = false; + mName = ""; +} + +void dSndSourceGroup_c::clearTemp() { + mIsActive = false; + field_0x1D = false; + mName = ""; +} + void dSndSourceGroup_c::calc() { // Reset freshness flags, computed on-demand mCalculatedClosestToPlayer = false; @@ -95,26 +142,26 @@ void dSndSourceGroup_c::calc() { } s32 dSndSourceGroup_c::getNumSources() const { - return nw4r::ut::List_GetSize(&mSourceList); + return nw4r::ut::List_GetSize(&mSubSourceList); } void dSndSourceGroup_c::registerSource(dSoundSource_c *source) { if (source != nullptr) { - nw4r::ut::List_Append(&mSourceList, source); + appendSubSource(source); } } void dSndSourceGroup_c::unregisterSource(dSoundSource_c *source) { if (source != nullptr) { - nw4r::ut::List_Remove(&mSourceList, source); + removeSubSource(source); } } void dSndSourceGroup_c::clearList() { - dSoundSource_c *source = static_cast(nw4r::ut::List_GetFirst(&mSourceList)); + dSoundSource_c *source = getSubSourceFirst(); while (source != nullptr) { - nw4r::ut::List_Remove(&mSourceList, source); - source = static_cast(nw4r::ut::List_GetFirst(&mSourceList)); + removeSubSource(source); + source = getSubSourceFirst(); } } @@ -125,9 +172,9 @@ dSoundSource_c *dSndSourceGroup_c::getSourceClosestToListener() { mpCachedClosestSourceToListener = nullptr; f32 closest = INFINITY; - for (dSoundSource_c *source = static_cast(nw4r::ut::List_GetFirst(&mSourceList)); - source != nullptr; source = static_cast(nw4r::ut::List_GetNext(&mSourceList, source))) { - if (source->getActorType() != SND_SOURCE_PLAYER_HEAD && source->getActorType() != SND_SOURCE_NPC_48) { + for (dSoundSource_c *source = getSubSourceFirst(); + source != nullptr; source = getSubSourceNext(source)) { + if (source->getSourceType() != SND_SOURCE_PLAYER_HEAD && source->getSourceType() != SND_SOURCE_NPC_HEAD) { f32 dist = source->getDistanceToListener(); if (dist < closest) { closest = dist; @@ -144,15 +191,15 @@ dSoundSource_c *dSndSourceGroup_c::getSourceClosestToPlayer() { return mpCachedClosestSourceToPlayer; } - if ((s32)nw4r::ut::List_GetSize(&mSourceList) <= 1) { - return static_cast(nw4r::ut::List_GetFirst(&mSourceList)); + if ((s32)nw4r::ut::List_GetSize(&mSubSourceList) <= 1) { + return getSubSourceFirst(); } mpCachedClosestSourceToPlayer = nullptr; f32 closest = INFINITY; - for (dSoundSource_c *source = static_cast(nw4r::ut::List_GetFirst(&mSourceList)); - source != nullptr; source = static_cast(nw4r::ut::List_GetNext(&mSourceList, source))) { - if (source->getActorType() != 1 && source->getActorType() != 48) { + for (dSoundSource_c *source = getSubSourceFirst(); + source != nullptr; source = getSubSourceNext(source)) { + if (source->getSourceType() != 1 && source->getSourceType() != 48) { f32 dist = source->getDistanceToPlayer(); if (dist < closest) { closest = dist; @@ -164,7 +211,7 @@ dSoundSource_c *dSndSourceGroup_c::getSourceClosestToPlayer() { return mpCachedClosestSourceToPlayer; } -bool dSndSourceGroup_c::setParamFromName(const char*) { +bool dSndSourceGroup_c::setParamFromName(const char *) { // TODO return false; } diff --git a/src/d/snd/d_snd_source_harp_related.cpp b/src/d/snd/d_snd_source_harp_related.cpp new file mode 100644 index 00000000..0807d8e2 --- /dev/null +++ b/src/d/snd/d_snd_source_harp_related.cpp @@ -0,0 +1,22 @@ +#include "d/snd/d_snd_source_harp_related.h" + +#include "d/snd/d_snd_source.h" + +dSndSourceHarpRelated_c::dSndSourceHarpRelated_c( + s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup +) + : dSoundSource_c(sourceType, ac, name, pOwnerGroup) { + // TODO +} + +dSndSourceHarpRelated_c::~dSndSourceHarpRelated_c() { + // TODO +} + +void dSndSourceHarpRelated_c::postCalc() { + // TODO +} + +void dSndSourceHarpRelated_c::setPause(bool flag, int fadeFrames) { + // TODO +} diff --git a/src/d/snd/d_snd_source_mgr.cpp b/src/d/snd/d_snd_source_mgr.cpp index 0e5eb9ae..85e196d4 100644 --- a/src/d/snd/d_snd_source_mgr.cpp +++ b/src/d/snd/d_snd_source_mgr.cpp @@ -1,12 +1,95 @@ #include "d/snd/d_snd_source_mgr.h" #include "common.h" +#include "d/a/d_a_base.h" +#include "d/snd/d_snd_bgm_mgr.h" +#include "d/snd/d_snd_control_player_mgr.h" +#include "d/snd/d_snd_id_mappers_data.h" +#include "d/snd/d_snd_player_mgr.h" +#include "d/snd/d_snd_small_effect_mgr.h" #include "d/snd/d_snd_source.h" + +// clang-format off +// vtable order - vtables are right but need to split up +// some headers for weak function order +#include "d/snd/d_snd_source_e_spark.h" #include "d/snd/d_snd_source_enums.h" +#include "d/snd/d_snd_source_equipment.h" +#include "d/snd/d_snd_source_group.h" +#include "d/snd/d_snd_source_py_bird.h" +#include "d/snd/d_snd_source_enemy.h" +#include "d/snd/d_snd_source_obj_clef.h" +#include "d/snd/d_snd_source_obj.h" +#include "d/snd/d_snd_source_npc.h" +#include "d/snd/d_snd_source_harp_related.h" + +#include "d/snd/d_snd_source_demo.h" +#include "d/snd/d_snd_source_player.h" +#include "d/snd/d_snd_source_player_head.h" +#include "d/snd/d_snd_source_npc_head.h" +#include "d/snd/d_snd_source_npc_special.h" +#include "d/snd/d_snd_source_tg_sound.h" +// clang-format on + +#include "d/snd/d_snd_state_mgr.h" +#include "d/snd/d_snd_util.h" +#include "d/snd/d_snd_wzsound.h" #include "nw4r/ut/ut_list.h" +#include "sized_string.h" #include +// TODO - weak function order in this file is a problem. +// one particular problem is that all weak functions involving +// dSndAnimSound_c are reversed compared to their natural vtable order, +// and the overridden `SetupSound` function seems to be immune to reordering + +bool dSndSourceMgr_c::isAnimSoundSource(s32 sourceType, const char *name) { + switch (getSourceCategoryForSourceType(sourceType, name)) { + case SND_SOURCE_CATEGORY_PLAYER: + switch (sourceType) { + case SND_SOURCE_PLAYER: return true; + } + break; + case SND_SOURCE_CATEGORY_ENEMY: + if (sourceType < 0x19) { + return sourceType != SND_SOURCE_ENEMY_14; + } + return false; + case SND_SOURCE_CATEGORY_NPC: + return sourceType != SND_SOURCE_NPC_47 && sourceType != SND_SOURCE_NPC_HEAD && + sourceType != SND_SOURCE_INSECT; + case SND_SOURCE_CATEGORY_OBJECT: + if (sourceType >= SND_SOURCE_OBJECT_42) { + return true; + } + break; + case 58: + // TODO - what is category 58??? + return true; + } + + return false; +} + +bool dSndSourceMgr_c::isMultiSoundSource(s32 sourceType, const char *name) { + switch (sourceType) { + case SND_SOURCE_BIGBOSS: + case SND_SOURCE_BOSS_MG: + case SND_SOURCE_BOSS_KR: + case SND_SOURCE_BOSS_NUSI: + case SND_SOURCE_NPC_NUSI: return true; + } + return false; +} + +bool dSndSourceMgr_c::isSwOrEOc(const char *name) { + if (streq(name, "Sw") || streq(name, "SwWall") || streq(name, "wnut") || streq(name, "EOc")) { + return true; + } + return false; +} + s32 dSndSourceMgr_c::getSourceCategoryForSourceType(s32 sourceType, const char *name) { // This might be a full-on switch statement but I don't want to write out // all the unknown entries yet and this matches anyway @@ -35,20 +118,246 @@ s32 dSndSourceMgr_c::getSourceCategoryForSourceType(s32 sourceType, const char * return SND_SOURCE_CATEGORY_TG_SOUND; } - if (sourceType >= SND_SOURCE_54 && sourceType <= SND_SOURCE_57) { - return SND_SOURCE_CATEGORY_6; + if (sourceType >= SND_SOURCE_54 && sourceType <= SND_SOURCE_TG_HARP) { + return SND_SOURCE_CATEGORY_HARP_RELATED; } switch (sourceType) { - case SND_SOURCE_58: - return SND_SOURCE_CATEGORY_7; - case SND_SOURCE_59: - return SND_SOURCE_CATEGORY_9; - default: - return -1; + case SND_SOURCE_58: return SND_SOURCE_CATEGORY_7; + case SND_SOURCE_59: return SND_SOURCE_CATEGORY_9; + default: return -1; } } +dSoundSourceIf_c *dSndSourceMgr_c::createSource(s32 sourceType, dAcBase_c *actor, const char *name, u8 _subtype) { + if (actor == nullptr) { + return nullptr; + } + + s32 subtype = actor->subtype; + SizedString<64> nameStr; + nameStr.sprintf("%s", name); + + bool isModified = false; + + if (dSndStateMgr_c::GetInstance()->isInDemo() != nullptr && strneq(name, "$act", 4)) { + nameStr.sprintf("%s_%s", name + 1, dSndStateMgr_c::GetInstance()->getCurrentStageMusicDemoName()); + isModified = true; + } + + dSoundSource_c *existingSource = static_cast(actor->getSoundSource()); + if (!isModified) { + bool allowSubtype = true; + switch (sourceType) { + case SND_SOURCE_BIGBOSS: + nameStr = "BBigBos"; + isModified = true; + break; + case SND_SOURCE_GIRAHUMU_3: + nameStr = "BGh3"; + isModified = true; + break; + case SND_SOURCE_NPC_HEAD: + if (existingSource != nullptr) { + name = existingSource->getName(); + nameStr.sprintf("%sHead", name); + allowSubtype = false; + } + break; + } + + if (strneq(name, "NpcMole", 7)) { + if (subtype != 0) { + nameStr = "NpcMoT"; + subtype = 0; + isModified = true; + } + } else if (strneq(name, "NpcMoT2", 7)) { + nameStr = "NpcMoT"; + isModified = true; + } else if (strneq(name, "NpcMoN2", 7)) { + nameStr = "NpcMoN"; + isModified = true; + } else if (strneq(name, "NpcMoEN", 7)) { + nameStr = "NpcMole"; + subtype = 0; + isModified = true; + } else if (strneq(name, "NpcMoS", 6)) { + nameStr = "NpcMoEl"; + isModified = true; + } + + if (allowSubtype && subtype != 0) { + nameStr.sprintf("%s_A%d", &nameStr, subtype); + isModified = true; + } + + if (sourceType == SND_SOURCE_NPC_51) { + const ActorBaseNamePair *pair = sActorBaseNamePairs; + for (int i = 0; i < sNumActorBaseNamePairs; i++) { + if (streq(nameStr, sActorBaseNamePairs[i].variant)) { + nameStr = sActorBaseNamePairs[i].base; + isModified = true; + break; + } + } + } + } + + const char *actualName = nameStr; + s32 category = getSourceCategoryForSourceType(sourceType, actualName); + dSndSourceGroup_c *group = nullptr; + + if (category != SND_SOURCE_CATEGORY_9) { + if (isModified) { + group = GetInstance()->getGroup(sourceType, actor, actualName, name, subtype); + } else { + group = GetInstance()->getGroup(sourceType, actor, actualName, nullptr, subtype); + } + actualName = group->getName(); + } + + s32 sourceCategory = getSourceCategoryForSourceType(sourceType, actualName); + dSoundSourceIf_c *newSource = nullptr; + bool isAnimSource = isAnimSoundSource(sourceType, actualName); + bool isMultiSource = isMultiSoundSource(sourceType, actualName); + bool isDemo = dSndPlayerMgr_c::GetInstance()->shouldUseDemoPlayer(sourceType); + + if (isDemo) { + newSource = new dSndSourceDemo_c(sourceType, actor, actualName, group); + } + + if (newSource == nullptr) { + switch (sourceCategory) { + case SND_SOURCE_CATEGORY_PLAYER: + if (sourceType == SND_SOURCE_PLAYER_HEAD) { + newSource = new dSndSourcePlayerHead_c(sourceType, actor, actualName, group); + } else { + newSource = new dSndSourcePlayer_c(sourceType, actor, actualName, group); + } + break; + case SND_SOURCE_CATEGORY_ENEMY: + if (sourceType == SND_SOURCE_SPARK) { + newSource = new dSndSourceESpark_c(sourceType, actor, actualName, group); + } else if (isAnimSource) { + if (isMultiSource) { + newSource = new dSndSourceEnemyMulti_c(sourceType, actor, actualName, group); + } else { + newSource = new dSndSourceEnemyAnim_c(sourceType, actor, actualName, group); + } + } else { + newSource = new dSndSourceEnemy_c(sourceType, actor, actualName, group); + } + break; + case SND_SOURCE_CATEGORY_OBJECT: + if (sourceType == SND_SOURCE_OBJECT_33) { + return nullptr; + } + if (sourceType == SND_SOURCE_LIGHT_SHAFT) { + newSource = new dSndSourceObjLightShaft_c(sourceType, actor, actualName, group); + } else if (sourceType == SND_SOURCE_CLEF) { + newSource = new dSndSourceObjClef_c(sourceType, actor, actualName, group); + } else if (isAnimSource) { + newSource = new dSndSourceObjAnim_c(sourceType, actor, actualName, group); + } else { + newSource = new dSndSourceObj_c(sourceType, actor, actualName, group); + } + break; + case SND_SOURCE_CATEGORY_EQUIPMENT: + if (sourceType == SND_SOURCE_WHIP) { + newSource = new dSndSourceEquipmentWhip_c(sourceType, actor, actualName, group); + } else { + newSource = new dSndSourceEquipment_c(sourceType, actor, actualName, group); + } + break; + case SND_SOURCE_CATEGORY_NPC: + if (sourceType == SND_SOURCE_NPC_HEAD) { + newSource = new dSndSourceNpcHead_c(sourceType, actor, actualName, group); + } else if (sourceType == SND_SOURCE_NPC_DRAGON) { + newSource = new dSndSourceNpcDr_c(sourceType, actor, actualName, group); + } else if (sourceType >= SND_SOURCE_NPC_50) { + newSource = new dSndSourceNpcSpecial_c(sourceType, actor, actualName, group); + } else if (sourceType == SND_SOURCE_PLAYER_BIRD) { + newSource = new dSndSourcePyBird_c(sourceType, actor, actualName, group); + } else if (isAnimSource) { + newSource = new dSndSourceNpcAnim_c(sourceType, actor, actualName, group); + } else { + newSource = new dSndSourceNpc_c(sourceType, actor, actualName, group); + } + break; + case SND_SOURCE_CATEGORY_TG_SOUND: + if (dSndStateMgr_c::GetInstance()->isActiveDemoMaybe(subtype)) { + return nullptr; + } + newSource = new dSndSourceTgSound_c(sourceType, actor, actualName, group); + break; + case SND_SOURCE_CATEGORY_HARP_RELATED: + switch (sourceType) { + case SND_SOURCE_OBJECT_WARP: + newSource = new dSndSourceHarpObjWarp_c(sourceType, actor, actualName, group); + break; + case SND_SOURCE_SW_HARP: + if (subtype == 4) { + newSource = new dSndSourceHarpSwHarp4_c(sourceType, actor, actualName, group); + } else { + newSource = new dSndSourceHarpSwHarp_c(sourceType, actor, actualName, group); + } + break; + case SND_SOURCE_TG_HARP: + newSource = new dSndSourceHarpTg_c(sourceType, actor, actualName, group); + break; + default: newSource = new dSndSourceHarpRelated_c(sourceType, actor, actualName, group); break; + } + break; + case SND_SOURCE_CATEGORY_7: newSource = new dSndSourceDemo_c(sourceType, actor, actualName, group); break; + default: + if (sourceType < SND_SOURCE_59 + 1) { + // This part is confusing as heck. Various "tags" have category 9, + // but most of them never create their sound source (except for Uground). + // On top of that, this called function does weird things where + // if no group with the given name is in the "to load list", + // it grabs the first group from the "inactive" list but + // *doesn't remove it from that list*, then temporarily sets some + // variables, adds it to the "to load" list, then clears some other variables. + // Maybe there's a very specific reason for it to do things + // that way but the effect is that there's a group + // in a weird in-between state (inactive but loading) + // and I'm really not sure if it has the intended effect. + // Then again, I think this is only called from Uground... + GetInstance()->fn_803846D0(sourceType, actualName, subtype); + } + return nullptr; + } + } + + if (newSource == nullptr) { + return nullptr; + } + + // setSubtype not emitted by explicit call, + // so it apparently happens through dSoundSourceIf_c + newSource->setSubtype(subtype); + newSource->setup(); + if (!streq(name, actualName)) { + static_cast(newSource)->setOrigName(name); + } + + if (sourceType == SND_SOURCE_NPC_HEAD) { + if (existingSource != nullptr && strneq(existingSource->getName(), "NpcMoT", 6)) { + static_cast(newSource)->setMainName(existingSource->getName()); + } else if (existingSource != nullptr && streq(name, "NpcGrd")) { + static_cast(newSource)->setMainName("NpcGra"); + } + } + + if (existingSource != nullptr && existingSource != newSource && sourceType != SND_SOURCE_NPC_HEAD && + existingSource->isMultiSource()) { + existingSource->registerAdditionalSource(static_cast(newSource)); + } + + return newSource; +} + SND_DISPOSER_DEFINE(dSndSourceMgr_c); dSndSourceMgr_c::dSndSourceMgr_c() @@ -65,36 +374,104 @@ dSndSourceMgr_c::dSndSourceMgr_c() mpBoomerangSource(nullptr), mpTBoatSource(nullptr), field_0x3880(nullptr), - field_0x3884(nullptr) { + mpMsgSource(nullptr) { // TODO offsetof - nw4r::ut::List_Init(&mGroupList1, 0); - nw4r::ut::List_Init(&mGroupList2, 0); + nw4r::ut::List_Init(&mGroup1List, 0); + nw4r::ut::List_Init(&mGroup2List, 0); // TODO figure out what these are for - nw4r::ut::List_Init(&mGroupList3, 8); - nw4r::ut::List_Init(&mAllSources, 0xE8); + nw4r::ut::List_Init(&mGroup3List, 8); + nw4r::ut::List_Init(&mAllSourcesList, 0xE8); nw4r::ut::List_Init(&field_0x3848, 0x15C); - nw4r::ut::List_Init(&field_0x3854, 0x160); + nw4r::ut::List_Init(&mHarpRelatedList, 0x160); - mpDefaultGroup = new dSndSourceGroup_c(-1, "Default", 0, 0); + mpDefaultGroup = new dSndSourceGroup_c(-1, "Default", nullptr, 0); for (dSndSourceGroup_c *group = &mGroups[0]; group < &mGroups[NUM_GROUPS]; group++) { - nw4r::ut::List_Append(&mGroupList2, group); + nw4r::ut::List_Append(&mGroup2List, group); } } +void dSndSourceMgr_c::calcEnemyObjVolume() { + if (dSndStateMgr_c::GetInstance()->checkEventFlag(dSndStateMgr_c::EVENT_MUTE_ENEMY_FULL)) { + dSndControlPlayerMgr_c::GetInstance()->setEnemyMuteVolume(0.0f); + } else if (dSndStateMgr_c::GetInstance()->checkEventFlag(dSndStateMgr_c::EVENT_MUTE_ENEMY_PARTIAL)) { + dSndControlPlayerMgr_c::GetInstance()->setEnemyMuteVolume(0.3f); + } + + if (dSndStateMgr_c::GetInstance()->checkEventFlag(dSndStateMgr_c::EVENT_MUTE_OBJ_FULL)) { + dSndControlPlayerMgr_c::GetInstance()->setObjectMuteVolume(0.0f); + } else if (dSndStateMgr_c::GetInstance()->checkEventFlag(dSndStateMgr_c::EVENT_MUTE_OBJ_PARTIAL)) { + dSndControlPlayerMgr_c::GetInstance()->setObjectMuteVolume(0.3f); + } +} + +void dSndSourceMgr_c::setMutedFromFader(bool muteFlag) { + for (dSoundSource_c *it = getAllSourcesFirst(); it != nullptr; it = getAllSourcesNext(it)) { + s32 sourceType = it->getSourceType(); + switch (sourceType) { + case SND_SOURCE_PLAYER: + case SND_SOURCE_PLAYER_HEAD: + break; + default: + it->setField0x101(muteFlag); + break; + } + } + if (muteFlag) { + dSndControlPlayerMgr_c::GetInstance()->muteScenePlayers(30); + } else { + dSndControlPlayerMgr_c::GetInstance()->unmuteScenePlayers(30); + } +} + +dSndSourceGroup_c *dSndSourceMgr_c::getGroup(s32 sourceType, dAcBase_c *actor, const char *name, const char *origName, u8 subtype) { + dSndSourceGroup_c *group = getActiveGroupForName(name); + if (group != nullptr) { + return group; + } + + group = getInactiveGroup(); + if (group != nullptr) { + group->set(sourceType, name, origName, subtype); + activateGroup(group); + addGroupToLoading(group); + dSndBgmMgr_c::GetInstance()->prepareBossBgm(name); + return group; + } + + return nullptr; +} + +dSndSourceGroup_c *dSndSourceMgr_c::getActiveGroupForName(const char *name) { + for (dSndSourceGroup_c *it = getGroup1First(); it != nullptr; it = getGroup1Next(it)) { + if (streq(it->getName(), name)) { + return it; + } + } + return nullptr; +} + +dSndSourceGroup_c *dSndSourceMgr_c::getInactiveGroup() { + return getGroup2First(); +} + +bool dSndSourceMgr_c::addGroupToLoading(dSndSourceGroup_c *source) { + return false; +} + void dSndSourceMgr_c::registerSource(dSoundSource_c *source) { if (source != nullptr) { - nw4r::ut::List_Append(&mAllSources, source); + nw4r::ut::List_Append(&mAllSourcesList, source); switch (source->getCategory()) { case SND_SOURCE_CATEGORY_PLAYER: { - if (source->getActorType() == SND_SOURCE_PLAYER && mpPlayerSource == nullptr) { + if (source->getSourceType() == SND_SOURCE_PLAYER && mpPlayerSource == nullptr) { mpPlayerSource = source; } break; } case SND_SOURCE_CATEGORY_EQUIPMENT: { - if (source->getActorType() == SND_SOURCE_BOOMERANG) { + if (source->getSourceType() == SND_SOURCE_BOOMERANG) { mpBoomerangSource = source; } break; @@ -105,18 +482,18 @@ void dSndSourceMgr_c::registerSource(dSoundSource_c *source) { } break; } - case SND_SOURCE_CATEGORY_6: { - nw4r::ut::List_Append(&field_0x3854, source); + case SND_SOURCE_CATEGORY_HARP_RELATED: { + nw4r::ut::List_Append(&mHarpRelatedList, source); break; } case SND_SOURCE_CATEGORY_OBJECT: { - if (source->isName("TBoat") && mpTBoatSource == nullptr) { + if (streq(source->getName(), "TBoat") && mpTBoatSource == nullptr) { mpTBoatSource = source; } break; } case SND_SOURCE_CATEGORY_NPC: { - if (source->getActorType() == SND_SOURCE_KENSEI) { + if (source->getSourceType() == SND_SOURCE_KENSEI) { mpKenseiSource = source; } break; @@ -127,9 +504,9 @@ void dSndSourceMgr_c::registerSource(dSoundSource_c *source) { void dSndSourceMgr_c::unregisterSource(dSoundSource_c *source) { if (source != nullptr) { - removeSourceFromList(source, &mAllSources); + removeSourceFromList(source, &mAllSourcesList); removeSourceFromList(source, &field_0x3848); - removeSourceFromList(source, &field_0x3854); + removeSourceFromList(source, &mHarpRelatedList); if (source == mpPlayerSource) { mpPlayerSource = nullptr; } else if (source == mpKenseiSource) { @@ -164,13 +541,35 @@ void dSndSourceMgr_c::removeSourceFromList(dSoundSource_c *source, nw4r::ut::Lis } } +void dSndSourceMgr_c::onShutdownSource(dSoundSource_c *source) { + if (source == nullptr) { + return; + } + removeSourceFromList(source, &field_0x3848); +} + void dSndSourceMgr_c::clearSourceLists() { - clearSourceList(&mAllSources); + clearSourceList(&mAllSourcesList); clearSourceList(&field_0x3848); - clearSourceList(&field_0x3854); + clearSourceList(&mHarpRelatedList); mpPlayerSource = nullptr; } +void dSndSourceMgr_c::activateGroup(dSndSourceGroup_c *group) { + if (!isActiveGroup(group)) { + removeGroup2(group); + appendGroup1(group); + group->setIsActive(true); + } +} + +bool dSndSourceMgr_c::isActiveGroup(dSndSourceGroup_c *group) const { + if (group != nullptr) { + return group->isActive(); + } + return false; +} + void dSndSourceMgr_c::clearSourceList(nw4r::ut::List *list) { if (list != nullptr) { dSoundSource_c *sourceIter = static_cast(nw4r::ut::List_GetFirst(list)); @@ -180,3 +579,77 @@ void dSndSourceMgr_c::clearSourceList(nw4r::ut::List *list) { } } } + +void dSndSourceMgr_c::onEventStart() { + // no-op +} + +void dSndSourceMgr_c::onEventEnd() { + // no-op +} + +s32 dSndSourceMgr_c::getPlayerSourceRoomId() const { + if (mpPlayerSource == nullptr) { + return -1; + } + if (getBoomerangSource() != nullptr) { + return getBoomerangSource()->getRoomId(); + } + return mpPlayerSource->getRoomId(); +} + +struct FlowSoundDef { + const char *groupName; + u32 soundId; +}; + +extern "C" const char sLinkHead[] = "LinkHead"; + +static const FlowSoundDef sFlowSoundDefs[] = { + { "Door_A7", SE_DoorB00_OPEN_SHORT}, + {"TgSound_A4", SE_TgSound_A4_TOILET_WATER}, + { nullptr, SE_Door_W_KEY_OPEN}, + { nullptr, SE_NpcDskN_BATH_SPLASH}, + { "NpcSenb", SE_NpcSenb_OPEN_LETTER}, + {"TgSound_A4", SE_NV_001_NpcGost}, + {"TgSound_A4", SE_NV_003_NpcGost}, + { nullptr, SE_EVENT_GIRL_SCREAM}, + { nullptr, SE_NpcPma_COOKING}, + { nullptr, SE_N_GET_LETTER}, + { nullptr, SE_NV_021_NpcOim}, + { nullptr, SE_NV_020_NpcOim}, + { nullptr, SE_F000_L3_RACE_CALL}, + { nullptr, SE_F000_L3_RACE_START}, + { nullptr, SE_S_TALK_CHAR_NpcSlrb_ONE}, + { nullptr, SE_LV_DRINK_MSG}, +}; + +void dSndSourceMgr_c::playFlowSound(u32 id) { + if (id < 100) { + return; + } + + id -= 100; + // @bug should be >= + if (id > ARRAY_LENGTH(sFlowSoundDefs)) { + return; + } + + if (sFlowSoundDefs[id].groupName != nullptr) { + dSndSourceGroup_c *grp = getActiveGroupForName(sFlowSoundDefs[id].groupName); + if (grp != nullptr) { + dSoundSource_c *src = grp->getSourceClosestToListener(); + if (src != nullptr) { + src->startSound(sFlowSoundDefs[id].soundId); + } + } + } else { + dSndSmallEffectMgr_c::GetInstance()->playSoundInternalChecked(sFlowSoundDefs[id].soundId, nullptr); + } +} + +struct dSndSourceMgrEmptySinit { + dSndSourceMgrEmptySinit() {} +}; + +dSndSourceMgrEmptySinit emptySinit; diff --git a/src/d/snd/d_snd_source_npc_head.cpp b/src/d/snd/d_snd_source_npc_head.cpp new file mode 100644 index 00000000..33fab0a6 --- /dev/null +++ b/src/d/snd/d_snd_source_npc_head.cpp @@ -0,0 +1,80 @@ +#include "d/snd/d_snd_source_npc_head.h" + +#include "common.h" +#include "d/a/d_a_base.h" +#include "d/snd/d_snd_mgr.h" +#include "d/snd/d_snd_player_mgr.h" +#include "d/snd/d_snd_rng_mgr.h" +#include "d/snd/d_snd_source.h" +#include "d/snd/d_snd_source_group.h" +#include "d/snd/d_snd_state_mgr.h" +#include "d/snd/d_snd_util.h" +#include "d/snd/d_snd_wzsound.h" +#include "sized_string.h" + +dSndSourceNpcHead_c::dSndSourceNpcHead_c( + s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup +) + : dSoundSource_c(sourceType, ac, name, pOwnerGroup), field_0x15C(0) { + if (dSndStateMgr_c::isInStage("F001r") && streq(name, "NpcCbFdHead") && ac->roomid == 1) { + // Fledge in Knight's Academy + pOwnerGroup->getAmbientParam()->field_0x00 = 100.0f; + pOwnerGroup->getAmbientParam()->field_0x04 = 300.0f; + } +} + +bool dSndSourceNpcHead_c::npcSpeak(u32 id) { + if (id == -1) { + return false; + } + + if (id < (LABEL_NV_END - LABEL_NV_START)) { + // turn SE_NV_123 into SE_NV_123_NpcZld + SizedString<64> nvVariantLabel; + const char *baseLabel = dSndMgr_c::getSoundLabelString(id + LABEL_NV_START); + nvVariantLabel.sprintf("%s_%s", baseLabel, mpMainName); + id = dSndPlayerMgr_c::GetInstance()->convertLabelStringToSoundId(nvVariantLabel); + if (id == -1) { + return false; + } + } else if (id < LABEL_NV_START || id >= LABEL_SE_AMBIENT_START) { + // This condition allows all the SE_TgSound sounds... + return false; + } + + // if there are _R1, _R2 variants, pick a random one + SizedString<64> label; + if (checkUserParamMask(id, 0x20)) { + label.sprintf("%s_%s", dSndMgr_c::getSoundLabelString(id), "R1"); + + if (label == dSndMgr_c::getSoundLabelString(id + 1)) { + // _R1 variant directly follows base variant + u32 randRange = 2; + + label.sprintf("%s_%s", dSndMgr_c::getSoundLabelString(id), "R2"); + if (label == dSndMgr_c::getSoundLabelString(id + 2)) { + // base, base_R1, base_R2 + randRange = 3; + } + id += dSndRngMgr_c::GetInstance()->rndInt(randRange); + } + } + + return startSound(id, nullptr); +} + +bool dSndSourceNpcHead_c::startVoiceLine(u32 id) { + a_field_0x7D = false; + return npcSpeak(id); +} + +bool dSndSourceNpcHead_c::vt_0xDC(u32 id) { + a_field_0x7D = true; + return npcSpeak(id); +} + + +void dSndSourceNpcHead_c::setOrigName(const char *arg) { + mpOrigName = arg; + mpMainName = arg; +} diff --git a/src/d/snd/d_snd_source_obj.cpp b/src/d/snd/d_snd_source_obj.cpp new file mode 100644 index 00000000..5d6d686f --- /dev/null +++ b/src/d/snd/d_snd_source_obj.cpp @@ -0,0 +1,38 @@ +#include "d/snd/d_snd_source_obj.h" + +#include "common.h" +#include "d/snd/d_snd_source.h" +#include "d/snd/d_snd_source_mgr.h" +#include "d/snd/d_snd_state_mgr.h" +#include "d/snd/d_snd_wzsound.h" +#include "nw4r/math/math_types.h" + +void dSndSourceObj_c::postSetup() { + if (isName("Fire")) { + if (dSndStateMgr_c::isInStage("F008r")) { + // Inside Goddess Statue + setVolumeFade(0.7f, 0); + } + return; + } + + if ((isName("TDoor") || isName("Wind") || isName("Flag")) && + dSndStateMgr_c::GetInstance()->getLayer() >= 13) { + setVolumeFade(0.0f, 0); + } +} + +void dSndSourceObjLightShaft_c::setPosition(const nw4r::math::VEC3 &position) { + if (dSndSourceMgr_c::getPlayerSource() != nullptr) { + f32 y = dSndSourceMgr_c::getPlayerSource()->GetPosition().y; + nw4r::math::VEC3 v = position; + if (y > 0.0f) { + v.y = y; + } else { + v.y = 0.0f; + } + SetPosition(v); + mFlags = 0; + holdSound(SE_LightLi_LV); + } +} diff --git a/src/d/snd/d_snd_source_obj_clef.cpp b/src/d/snd/d_snd_source_obj_clef.cpp new file mode 100644 index 00000000..be1be9b5 --- /dev/null +++ b/src/d/snd/d_snd_source_obj_clef.cpp @@ -0,0 +1,132 @@ +#include "d/snd/d_snd_source_obj_clef.h" + +#include "common.h" +#include "d/snd/d_snd_wzsound.h" +#include "nw4r/snd/snd_SeqSoundHandle.h" +#include "nw4r/snd/snd_SoundHandle.h" + +struct SndTadtoneGroup { + u8 count; + u8 pitchVariables[]; +}; + +static const SndTadtoneGroup grp1 = { + 1, + {0x41}, +}; + +static const SndTadtoneGroup grp2 = { + 4, + {0x3C, 0x40, 0x41, 0x43}, +}; + +static const SndTadtoneGroup grp3 = { + 2, + {0x43, 0x37}, +}; + +static const SndTadtoneGroup grp4 = { + 8, + {0x34, 0x43, 0x41, 0x43, 0x45, 0x35, 0x39, 0x3C}, +}; + +static const SndTadtoneGroup grp5 = { + 1, + {0x41}, +}; + +static const SndTadtoneGroup grp6 = { + 8, + {0x48, 0x34, 0x37, 0x3C, 0x43, 0x4A, 0x4C, 0x48}, +}; + +static const SndTadtoneGroup grp7 = { + 1, + {0x41}, +}; + +static const SndTadtoneGroup grp8 = { + 4, + {0x3C, 0x40, 0x41, 0x43}, +}; + +static const SndTadtoneGroup grp9 = { + 8, + {0x43, 0x3C, 0x37, 0x3C, 0x34, 0x43, 0x41, 0x43}, +}; + +static const SndTadtoneGroup grp10 = { + 1, + {0x45}, +}; + +static const SndTadtoneGroup grp11 = { + 4, + {0x41, 0x35, 0x39, 0x3C}, +}; + +static const SndTadtoneGroup grp12 = { + 8, + {0x48, 0x34, 0x37, 0x3C, 0x43, 0x4A, 0x4C, 0x48}, +}; + +static const SndTadtoneGroup grp13 = { + 1, + {0x41}, +}; + +static const SndTadtoneGroup grp14 = { + 4, + {0x3C, 0x40, 0x41, 0x43}, +}; + +static const SndTadtoneGroup grp15 = { + 2, + {0x43, 0x37}, +}; + +static const SndTadtoneGroup grp16 = { + 4, + {0x37, 0x43, 0x41, 0x43}, +}; + +static const SndTadtoneGroup grp17 = { + 16, + {0x45, 0x39, 0x3E, 0x41, 0x35, 0x39, 0x3E, 0x41, 0x48, 0x34, 0x37, 0x3C, 0x43, 0x4A, 0x4C, 0x48}, +}; + +static const SndTadtoneGroup *sGroups[] = { + &grp1, &grp2, &grp3, &grp4, &grp5, &grp6, &grp7, &grp8, &grp9, + &grp10, &grp11, &grp12, &grp13, &grp14, &grp15, &grp16, &grp17, +}; + +static nw4r::snd::SoundHandle clefSoundHandle; + +bool dSndSourceObjClef_c::startTadtoneSound(u32 groupIdx, u32 noteIdx) { + if (groupIdx > ARRAY_LENGTH(sGroups)) { + return false; + } + + if (groupIdx < 1) { + return false; + } + + const SndTadtoneGroup *grp = sGroups[groupIdx - 1]; + + if (noteIdx >= grp->count) { + return false; + } + + s16 var = grp->pitchVariables[noteIdx]; + + clefSoundHandle.Stop(10); + + nw4r::snd::SoundHandle *pHandle = startSound(SE_Clef_VOICE, &clefSoundHandle); + if (pHandle != nullptr) { + nw4r::snd::SeqSoundHandle seqHandle(pHandle); + seqHandle.WriteVariable(0, var); + return true; + } + + return false; +} diff --git a/src/d/snd/d_snd_source_player_head.cpp b/src/d/snd/d_snd_source_player_head.cpp new file mode 100644 index 00000000..ef077563 --- /dev/null +++ b/src/d/snd/d_snd_source_player_head.cpp @@ -0,0 +1,166 @@ +#include "d/snd/d_snd_source_player_head.h" + +#include "common.h" +#include "d/d_player_act.h" +#include "d/snd/d_snd_rng_link_voice.h" +#include "d/snd/d_snd_wzsound.h" + +dSndSourcePlayerHead_c::dSndSourcePlayerHead_c( + s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup +) + : dSoundSource_c(sourceType, ac, name, pOwnerGroup) { + configureVoiceRngs(); +} + +void dSndSourcePlayerHead_c::configureVoiceRngs() { + field_0x22A0 = SND_LV_MAX; + mLastPlayedSound = SND_LV_MAX; + + for (int i = 0; i < SND_LV_MAX; i++) { + mLinkVoiceRngs[i].configure(dSndRngLinkVoice_c::getConfig(i), this); + } +} + +bool dSndSourcePlayerHead_c::startVoiceLine(u32 id) { + // id might be a sound ID, or it might be the ID of one of our RNGs + if (id > LABEL_LV_START && id < LABEL_LV_END) { + return startVoiceSoundInternal(id); + } + + if (id >= SND_LV_MAX) { + return false; + } + + if (checkFlag(1)) { + switch (id) { + case SND_LV_JUMP_S: + case SND_LV_SHOOT_START: + case SND_LV_SHOOT_SLOPE: + case SND_LV_RUN_UP: + case SND_LV_CLIMB_STEP: + case SND_LV_BACKFLIP: + case SND_LV_CLIMB_WALL: { + id = SND_LV_QUIETLY_S; + break; + } + case SND_LV_JUMP_M: + case SND_LV_JUMP_L: + case SND_LV_ZENTEN: { + id = SND_LV_QUIETLY_M; + break; + } + case SND_LV_GRAB: + case SND_LV_HUNG: { + return false; + } + } + } + + f32 stamina = daPlayerActBase_c::getStamina(); + switch (id) { + case SND_LV_TIRED_S_1: { + if (stamina < 0.25) { + id = SND_LV_TIRED_L; + } else if (stamina < 0.5) { + id = SND_LV_TIRED_M; + } else if (stamina < 0.8) { + id = SND_LV_TIRED_S_2; + } else { + return false; + } + break; + } + case SND_LV_CLIMB_TIRED_S_1: { + if (stamina < 0.125) { + id = SND_LV_CLIMB_TIRED_L; + } else if (stamina < 0.375) { + id = SND_LV_CLIMB_TIRED_M; + } else { + return false; + } + break; + } + case SND_LV_LIFT_TIRED_S_1: { + if (stamina < 0.125) { + id = SND_LV_LIFT_TIRED_L; + } else if (stamina < 0.375) { + id = SND_LV_LIFT_TIRED_M; + } else { + return false; + } + break; + } + case SND_LV_TIRED_RECOVER: { + if (stamina > 0.75) { + id = SND_LV_TIRED_RECOVER_S; + } else if (stamina > 0.5) { + id = SND_LV_TIRED_RECOVER_M; + } else if (stamina > 0.375) { + id = SND_LV_TIRED_RECOVER_L; + } + break; + } + + case SND_LV_BREATH_TIRED_S_1: { + if (stamina <= 0.0f) { + id = SND_LV_BREATH_TIRED_L; + } else if (stamina < 0.125) { + id = SND_LV_BREATH_TIRED_M; + } else if (stamina < 0.25) { + id = SND_LV_BREATH_TIRED_S_2; + } else { + return false; + } + break; + } + + case SND_LV_BADSMELL_TIRED_S_1: { + if (stamina < 0.125) { + id = SND_LV_BADSMELL_TIRED_L; + } else if (stamina < 0.375) { + id = SND_LV_BADSMELL_TIRED_M; + } else if (stamina < 0.99) { + id = SND_LV_BADSMELL_TIRED_S_2; + } else { + return false; + } + break; + } + + case SND_LV_DIE_WATER: + case SND_LV_DAMAGE_WATER_M: + case SND_LV_DAMAGE_WATER_S: + case SND_LV_DAMAGE_ELEC_W: startSound(SE_L_WATER_AIR_OUT); break; + } + + if (mLastPlayedSound != SND_LV_MAX && isPlayingActionSound()) { + s32 oldPriority = mLinkVoiceRngs[mLastPlayedSound].getPriority(); + s32 newPriority = mLinkVoiceRngs[id].getPriority(); + + if (oldPriority > newPriority) { + return false; + } + + if (oldPriority == newPriority && !mLinkVoiceRngs[id].getPriorityTiebreaker()) { + return false; + } + } + + field_0x22A0 = id; + bool ok = mLinkVoiceRngs[id].doRndIdNoReuse(); + if (ok) { + mLastPlayedSound = id; + } + + return ok; +} + +bool dSndSourcePlayerHead_c::startVoiceSoundInternal(u32 id) { + bool ok = false; + // @bug shouldn't this be > and < ? + if (id >= LABEL_LV_START && id <= LABEL_LV_END) { + ok = startSound(id, &mSoundHandle) != nullptr; + field_0x22A0 = SND_LV_MAX; + } + return ok; +} diff --git a/src/d/snd/d_snd_source_py_bird.cpp b/src/d/snd/d_snd_source_py_bird.cpp new file mode 100644 index 00000000..40efd1ee --- /dev/null +++ b/src/d/snd/d_snd_source_py_bird.cpp @@ -0,0 +1,32 @@ +#include "d/snd/d_snd_source_py_bird.h" +#include "common.h" +#include "d/snd/d_snd_anim_sound.h" +#include "d/snd/d_snd_se_sound_2.h" +#include "d/snd/d_snd_util.h" +#include "d/snd/d_snd_wzsound.h" +#include "nw4r/snd/snd_SeqSoundHandle.h" + +void dSndSourcePyBird_c::load(void *data, const char *name) { + if (streq(name, "GlideDive")) { + mSeqVarValue = 1; + } else if (streq(name, "SwitchToDive") && mSeqVarValue != 1) { + mSeqVarValue = 1; + } else if (streq(name, "Brake")) { + mSeqVarValue = 2; + startSound(SE_PyBird_V_BRAKE, nullptr); + } else if (streq(name, "DamageTornado")) { + startSound(SE_PyBird_V_TORNADE, nullptr); + } else if (mSeqVarValue == 1) { + if (!streq(name, "Attack") && !streq(name, "Accel")) { + mSeqVarValue = 0; + } + } else { + mSeqVarValue = 0; + } + dSndSeSound2_c *glideSound = getHandleType2ForSoundId(SE_PyBird_GLIDE); + if (glideSound != nullptr && glideSound->getHandle() != nullptr) { + nw4r::snd::SeqSoundHandle handle(glideSound->getHandle()); + handle.WriteVariable(10, mSeqVarValue); + } + mAnimSound.setData(data, name); +} diff --git a/src/d/snd/d_snd_source_tg_sound.cpp b/src/d/snd/d_snd_source_tg_sound.cpp new file mode 100644 index 00000000..c7506fc0 --- /dev/null +++ b/src/d/snd/d_snd_source_tg_sound.cpp @@ -0,0 +1,49 @@ +#include "d/snd/d_snd_source_tg_sound.h" + +#include "common.h" +#include "d/snd/d_snd_player_mgr.h" +#include "d/snd/d_snd_source.h" +#include "sized_string.h" + +dSndSourceTgSound_c::dSndSourceTgSound_c( + s32 sourceType, dAcBase_c *ac, const char *name, dSndSourceGroup_c *pOwnerGroup +) + : dSoundSource_c(sourceType, ac, name, pOwnerGroup), mTgActive(true) {} + +void dSndSourceTgSound_c::postSetup() { + switch (mSubtype) { + // TODO subtypes + case 7: + mTgActive = false; + break; + default: + mTgActive = true; + break; + } + + SizedString<64> label; + label.sprintf("SE_%s", mpName); + mTgSoundId = dSndPlayerMgr_c::GetInstance()->convertLabelStringToSoundId(label); +} + +void dSndSourceTgSound_c::setTgActive(bool active) { + switch (mSubtype) { + case 34: + case 35: + mTgActive = !active; + break; + default: + mTgActive = active; + break; + } +} + +void dSndSourceTgSound_c::postCalc() { + if (mTgSoundId == -1) { + return; + } + if (!mTgActive) { + return; + } + holdSound(mTgSoundId); +} diff --git a/src/d/snd/d_snd_stage_data.cpp b/src/d/snd/d_snd_stage_data.cpp new file mode 100644 index 00000000..1977039d --- /dev/null +++ b/src/d/snd/d_snd_stage_data.cpp @@ -0,0 +1,358 @@ +#include "d/snd/d_snd_stage_data.h" + +#include "common.h" + + +#pragma push +#pragma readonly_strings on + +const dSndStageInfo dSndStageInfo::sInfos[] = { + /* SND_STAGE_F100 */ + { "F100", -1, SND_STAGE_F100, SND_STAGE_F100, SND_STAGE_F100, SND_STAGE_F100, nullptr}, + /* SND_STAGE_F101 */ + { "F101", -1, SND_STAGE_F101, SND_STAGE_F101, SND_STAGE_F100, SND_STAGE_F100, nullptr}, + /* SND_STAGE_F102 */ + { "F102", -1, SND_STAGE_F102, SND_STAGE_F102, SND_STAGE_F102, SND_STAGE_F102, nullptr}, + /* SND_STAGE_F102_1 */ + {"F102_1", -1, SND_STAGE_F102_1, SND_STAGE_F102_1, SND_STAGE_F102, SND_STAGE_F102, nullptr}, + /* SND_STAGE_F103_L13 */ + { "F103", 13, SND_STAGE_F103_L13, SND_STAGE_F103, SND_STAGE_F103_L13, SND_STAGE_F103_L13, "Demo64_03"}, + /* SND_STAGE_F103 */ + { "F103", -1, SND_STAGE_F103, SND_STAGE_F103, SND_STAGE_F103, SND_STAGE_F103, nullptr}, + /* SND_STAGE_F200 */ + { "F200", -1, SND_STAGE_F200, SND_STAGE_F200, SND_STAGE_F200, SND_STAGE_F200, nullptr}, + /* SND_STAGE_F201_1 */ + {"F201_1", -1, SND_STAGE_F201_1, SND_STAGE_F201_1, SND_STAGE_F201_1, SND_STAGE_F201_1, nullptr}, + /* SND_STAGE_F201_2 */ + {"F201_2", -1, SND_STAGE_F201_2, SND_STAGE_F201_2, SND_STAGE_F201_2, SND_STAGE_F201_2, nullptr}, + /* SND_STAGE_F201_3 */ + {"F201_3", -1, SND_STAGE_F201_3, SND_STAGE_F201_3, SND_STAGE_F201_1, SND_STAGE_F201_3, nullptr}, + /* SND_STAGE_F201_4 */ + {"F201_4", -1, SND_STAGE_F201_4, SND_STAGE_F201_4, SND_STAGE_F201_4, SND_STAGE_F201_4, nullptr}, + /* SND_STAGE_F202 */ + { "F202", -1, SND_STAGE_F202, SND_STAGE_F202, SND_STAGE_F202, SND_STAGE_F202, nullptr}, + /* SND_STAGE_F300 */ + { "F300", -1, SND_STAGE_F300, SND_STAGE_F300, SND_STAGE_F300, SND_STAGE_F300, nullptr}, + /* SND_STAGE_F300_1 */ + {"F300_1", -1, SND_STAGE_F300_1, SND_STAGE_F300_1, SND_STAGE_F300, SND_STAGE_F300, nullptr}, + /* SND_STAGE_F300_4_L13 */ + {"F300_4", 13, SND_STAGE_F300_4_L13, SND_STAGE_F300_4, SND_STAGE_F300_4_L13, SND_STAGE_F300_4_L13, "Demo36_01"}, + /* SND_STAGE_F300_4 */ + {"F300_4", -1, SND_STAGE_F300_4, SND_STAGE_F300_4, SND_STAGE_F300, SND_STAGE_F300, nullptr}, + /* SND_STAGE_F301 */ + { "F301", -1, SND_STAGE_F301, SND_STAGE_F301, SND_STAGE_F301, SND_STAGE_F301, nullptr}, + /* SND_STAGE_F301_1 */ + {"F301_1", -1, SND_STAGE_F301_1, SND_STAGE_F301_1, SND_STAGE_F301_1, SND_STAGE_F301_1, nullptr}, + /* SND_STAGE_F301_2 */ + {"F301_2", -1, SND_STAGE_F301_2, SND_STAGE_F301_2, SND_STAGE_F301_2, SND_STAGE_F301, nullptr}, + /* SND_STAGE_F301_3 */ + {"F301_3", -1, SND_STAGE_F301_3, SND_STAGE_F301_3, SND_STAGE_F301_3, SND_STAGE_F301, nullptr}, + /* SND_STAGE_F301_4_L2 */ + {"F301_4", 2, SND_STAGE_F301_4_L2, SND_STAGE_F301_4, SND_STAGE_F301_4_L2, SND_STAGE_F301, nullptr}, + /* SND_STAGE_F301_4 */ + {"F301_4", -1, SND_STAGE_F301_4, SND_STAGE_F301_4, SND_STAGE_F301_4, SND_STAGE_F301, nullptr}, + /* SND_STAGE_F301_6 */ + {"F301_6", -1, SND_STAGE_F301_6, SND_STAGE_F301_6, SND_STAGE_F301, SND_STAGE_F301, nullptr}, + /* SND_STAGE_F301_7 */ + {"F301_7", -1, SND_STAGE_F301_7, SND_STAGE_F301_7, SND_STAGE_F301_7, SND_STAGE_F301, nullptr}, + /* SND_STAGE_F302_L13 */ + { "F302", 13, SND_STAGE_F302_L13, SND_STAGE_F302, SND_STAGE_F302_L13, SND_STAGE_F302_L13, "Demo64_05"}, + /* SND_STAGE_F302 */ + { "F302", -1, SND_STAGE_F302, SND_STAGE_F302, SND_STAGE_F302, SND_STAGE_F302, nullptr}, + /* SND_STAGE_F400_L13 */ + { "F400", 13, SND_STAGE_F400_L13, SND_STAGE_F400, SND_STAGE_F400_L13, SND_STAGE_F400_L13, "Demo38_01"}, + /* SND_STAGE_F400 */ + { "F400", -1, SND_STAGE_F400, SND_STAGE_F400, SND_STAGE_F400, SND_STAGE_F400, nullptr}, + /* SND_STAGE_F401_L2 */ + { "F401", 2, SND_STAGE_F401_L2, SND_STAGE_F401, SND_STAGE_F401_L2, SND_STAGE_F401_L2, nullptr}, + /* SND_STAGE_F401_L3 */ + { "F401", 3, SND_STAGE_F401_L3, SND_STAGE_F401, SND_STAGE_F401_L3, SND_STAGE_F401_L3, nullptr}, + /* SND_STAGE_F401_L4 */ + { "F401", 4, SND_STAGE_F401_L4, SND_STAGE_F401, SND_STAGE_F401_L4, SND_STAGE_F401_L4, nullptr}, + /* SND_STAGE_F401_L13 */ + { "F401", 13, SND_STAGE_F401_L13, SND_STAGE_F401, SND_STAGE_F401_L13, SND_STAGE_F401_L13, "Demo17_01"}, + /* SND_STAGE_F401_L14 */ + { "F401", 14, SND_STAGE_F401_L14, SND_STAGE_F401, SND_STAGE_F401_L14, SND_STAGE_F401_L14, "Demo43_01"}, + /* SND_STAGE_F401_L15 */ + { "F401", 15, SND_STAGE_F401_L15, SND_STAGE_F401, SND_STAGE_F401_L15, SND_STAGE_F401_L15, "Demo69_02"}, + /* SND_STAGE_F401 */ + { "F401", -1, SND_STAGE_F401, SND_STAGE_F401, SND_STAGE_F401, SND_STAGE_F401, nullptr}, + /* SND_STAGE_F403_L13 */ + { "F403", 13, SND_STAGE_F403_L13, SND_STAGE_F403, SND_STAGE_F403_L13, SND_STAGE_F403_L13, "Demo72_01"}, + /* SND_STAGE_F403_L14 */ + { "F403", 14, SND_STAGE_F403_L14, SND_STAGE_F403, SND_STAGE_F403_L14, SND_STAGE_F403_L14, "Demo73_01"}, + /* SND_STAGE_F403_L15 */ + { "F403", 15, SND_STAGE_F403_L15, SND_STAGE_F403, SND_STAGE_F403_L15, SND_STAGE_F403_L15, "Demo75_01"}, + /* SND_STAGE_F403_L16 */ + { "F403", 16, SND_STAGE_F403_L16, SND_STAGE_F403, SND_STAGE_F403_L16, SND_STAGE_F403_L16, "Demo75_02"}, + /* SND_STAGE_F403 */ + { "F403", -1, SND_STAGE_F403, SND_STAGE_F403, SND_STAGE_F403, SND_STAGE_F403, nullptr}, + /* SND_STAGE_F405 */ + { "F405", -1, SND_STAGE_F405, SND_STAGE_F405, SND_STAGE_F405, SND_STAGE_F405, "Demo02_01"}, + /* SND_STAGE_F406_L13 */ + { "F406", 13, SND_STAGE_F406_L13, SND_STAGE_F406, SND_STAGE_F406_L13, SND_STAGE_F406_L13, "Demo79_02"}, + /* SND_STAGE_F406_L14 */ + { "F406", 14, SND_STAGE_F406_L14, SND_STAGE_F406, SND_STAGE_F406_L14, SND_STAGE_F406_L14, "Demo69_03"}, + /* SND_STAGE_F406 */ + { "F406", -1, SND_STAGE_F406, SND_STAGE_F406, SND_STAGE_F406, SND_STAGE_F406, nullptr}, + /* SND_STAGE_D301 */ + { "D301", -1, SND_STAGE_D301, SND_STAGE_D301, SND_STAGE_D301, SND_STAGE_D301, nullptr}, + /* SND_STAGE_D301_1 */ + {"D301_1", -1, SND_STAGE_D301_1, SND_STAGE_D301_1, SND_STAGE_D301_1, SND_STAGE_D301, nullptr}, + /* SND_STAGE_D000 */ + { "D000", -1, SND_STAGE_D000, SND_STAGE_D000, SND_STAGE_D000, SND_STAGE_D000, nullptr}, + /* SND_STAGE_D100 */ + { "D100", -1, SND_STAGE_D100, SND_STAGE_D100, SND_STAGE_D100, SND_STAGE_D100, nullptr}, + /* SND_STAGE_D101 */ + { "D101", -1, SND_STAGE_D101, SND_STAGE_D101, SND_STAGE_D101, SND_STAGE_D101, nullptr}, + /* SND_STAGE_D200 */ + { "D200", -1, SND_STAGE_D200, SND_STAGE_D200, SND_STAGE_D200, SND_STAGE_D200, nullptr}, + /* SND_STAGE_D201 */ + { "D201", -1, SND_STAGE_D201, SND_STAGE_D201, SND_STAGE_D201, SND_STAGE_D201, nullptr}, + /* SND_STAGE_D201_1 */ + {"D201_1", -1, SND_STAGE_D201_1, SND_STAGE_D201_1, SND_STAGE_D201, SND_STAGE_D201, nullptr}, + /* SND_STAGE_D300 */ + { "D300", -1, SND_STAGE_D300, SND_STAGE_D300, SND_STAGE_D300, SND_STAGE_D300, nullptr}, + /* SND_STAGE_D300_1 */ + {"D300_1", -1, SND_STAGE_D300_1, SND_STAGE_D300_1, SND_STAGE_D300, SND_STAGE_D300, nullptr}, + /* SND_STAGE_D003_0 */ + {"D003_0", -1, SND_STAGE_D003_0, SND_STAGE_D003_0, SND_STAGE_D003_0, SND_STAGE_D003_0, nullptr}, + /* SND_STAGE_D003_1 */ + {"D003_1", -1, SND_STAGE_D003_1, SND_STAGE_D003_1, SND_STAGE_D003_1, SND_STAGE_D003_1, nullptr}, + /* SND_STAGE_D003_2 */ + {"D003_2", -1, SND_STAGE_D003_2, SND_STAGE_D003_2, SND_STAGE_D003_2, SND_STAGE_D003_2, nullptr}, + /* SND_STAGE_D003_3 */ + {"D003_3", -1, SND_STAGE_D003_3, SND_STAGE_D003_3, SND_STAGE_D003_3, SND_STAGE_D003_3, nullptr}, + /* SND_STAGE_D003_4 */ + {"D003_4", -1, SND_STAGE_D003_4, SND_STAGE_D003_4, SND_STAGE_D003_4, SND_STAGE_D003_4, nullptr}, + /* SND_STAGE_D003_5 */ + {"D003_5", -1, SND_STAGE_D003_5, SND_STAGE_D003_5, SND_STAGE_D003_5, SND_STAGE_D003_5, nullptr}, + /* SND_STAGE_D003_6 */ + {"D003_6", -1, SND_STAGE_D003_6, SND_STAGE_D003_6, SND_STAGE_D003_6, SND_STAGE_D003_6, nullptr}, + /* SND_STAGE_D003_7 */ + {"D003_7", -1, SND_STAGE_D003_7, SND_STAGE_D003_7, SND_STAGE_D003_7, SND_STAGE_D003_7, nullptr}, + /* SND_STAGE_D003_8 */ + {"D003_8", -1, SND_STAGE_D003_8, SND_STAGE_D003_8, SND_STAGE_D003_8, SND_STAGE_D003_8, nullptr}, + /* SND_STAGE_B100_L13 */ + { "B100", 13, SND_STAGE_B100_L13, SND_STAGE_B100, SND_STAGE_B100_L13, SND_STAGE_B100_L13, "Demo21_01"}, + /* SND_STAGE_B100 */ + { "B100", -1, SND_STAGE_B100, SND_STAGE_B100, SND_STAGE_B100, SND_STAGE_B100, nullptr}, + /* SND_STAGE_B100_1_L13 */ + {"B100_1", 13, SND_STAGE_B100_1_L13, SND_STAGE_B100_1, SND_STAGE_B100_1_L13, SND_STAGE_B100_1_L13, "Demo23_01"}, + /* SND_STAGE_B100_1 */ + {"B100_1", -1, SND_STAGE_B100_1, SND_STAGE_B100_1, SND_STAGE_B100_1, SND_STAGE_B100_1, nullptr}, + /* SND_STAGE_B101 */ + { "B101", -1, SND_STAGE_B101, SND_STAGE_B101, SND_STAGE_B101, SND_STAGE_B101, nullptr}, + /* SND_STAGE_B101_1_L13 */ + {"B101_1", 13, SND_STAGE_B101_1_L13, SND_STAGE_B101_1, SND_STAGE_B101_1_L13, SND_STAGE_B101_1_L13, "Demo47_01"}, + /* SND_STAGE_B101_1 */ + {"B101_1", -1, SND_STAGE_B101_1, SND_STAGE_B101_1, SND_STAGE_B101_1, SND_STAGE_B101_1, nullptr}, + /* SND_STAGE_B200_L1 */ + { "B200", 1, SND_STAGE_B200_L1, SND_STAGE_B200, SND_STAGE_B200_L1, SND_STAGE_D200, nullptr}, + /* SND_STAGE_B200_L2 */ + { "B200", 2, SND_STAGE_B200_L2, SND_STAGE_B200, SND_STAGE_B200_L2, SND_STAGE_D200, nullptr}, + /* SND_STAGE_B200_L3 */ + { "B200", 3, SND_STAGE_B200_L3, SND_STAGE_B200, SND_STAGE_B200_L3, SND_STAGE_D200, nullptr}, + /* SND_STAGE_B200 */ + { "B200", -1, SND_STAGE_B200, SND_STAGE_B200, SND_STAGE_B200, SND_STAGE_D200, nullptr}, + /* SND_STAGE_B210_L13 */ + { "B210", 13, SND_STAGE_B210_L13, SND_STAGE_B210, SND_STAGE_B210_L13, SND_STAGE_B210_L13, "Demo29_01"}, + /* SND_STAGE_B210_L14 */ + { "B210", 14, SND_STAGE_B210_L14, SND_STAGE_B210, SND_STAGE_B210_L14, SND_STAGE_B210_L14, "Demo31_01"}, + /* SND_STAGE_B210 */ + { "B210", -1, SND_STAGE_B210, SND_STAGE_B210, SND_STAGE_B210, SND_STAGE_B210, nullptr}, + /* SND_STAGE_B201_L13 */ + { "B201", 13, SND_STAGE_B201_L13, SND_STAGE_B201, SND_STAGE_B201_L13, SND_STAGE_B201_L13, "Demo51_01"}, + /* SND_STAGE_B201 */ + { "B201", -1, SND_STAGE_B201, SND_STAGE_B201, SND_STAGE_B201, SND_STAGE_B201, nullptr}, + /* SND_STAGE_B201_1_L13 */ + {"B201_1", 13, SND_STAGE_B201_1_L13, SND_STAGE_B201_1, SND_STAGE_B201_1_L13, SND_STAGE_B201_1_L13, "Demo52_01"}, + /* SND_STAGE_B201_1 */ + {"B201_1", -1, SND_STAGE_B201_1, SND_STAGE_B201_1, SND_STAGE_B201_1, SND_STAGE_B201_1, nullptr}, + /* SND_STAGE_B300 */ + { "B300", -1, SND_STAGE_B300, SND_STAGE_B300, SND_STAGE_B300, SND_STAGE_B300, nullptr}, + /* SND_STAGE_B301_L13 */ + { "B301", 13, SND_STAGE_B301_L13, SND_STAGE_B301, SND_STAGE_B301_L13, SND_STAGE_B301_L13, "Demo49_01"}, + /* SND_STAGE_B301 */ + { "B301", -1, SND_STAGE_B301, SND_STAGE_B301, SND_STAGE_B301, SND_STAGE_B301, nullptr}, + /* SND_STAGE_B003 */ + { "B003", -1, SND_STAGE_B003, SND_STAGE_B003, SND_STAGE_B003, SND_STAGE_B003, nullptr}, + /* SND_STAGE_B400_L13 */ + { "B400", 13, SND_STAGE_B400_L13, SND_STAGE_B400, SND_STAGE_B400_L13, SND_STAGE_B400_L13, "Demo75_04"}, + /* SND_STAGE_B400_L14 */ + { "B400", 14, SND_STAGE_B400_L14, SND_STAGE_B400, SND_STAGE_B400_L14, SND_STAGE_B400_L14, "Demo76_01"}, + /* SND_STAGE_B400 */ + { "B400", -1, SND_STAGE_B400, SND_STAGE_B400, SND_STAGE_B400, SND_STAGE_B400, nullptr}, + /* SND_STAGE_F100_1 */ + {"F100_1", -1, SND_STAGE_F100_1, SND_STAGE_F100_1, SND_STAGE_F100_1, SND_STAGE_F100_1, nullptr}, + /* SND_STAGE_F100_2 */ + {"F100_2", -1, SND_STAGE_F100_2, SND_STAGE_F100_2, SND_STAGE_F100_2, SND_STAGE_F100_2, nullptr}, + /* SND_STAGE_F102_2 */ + {"F102_2", -1, SND_STAGE_F102_2, SND_STAGE_F102_2, SND_STAGE_F102, SND_STAGE_F102, nullptr}, + /* SND_STAGE_F103_1_L13 */ + {"F103_1", 13, SND_STAGE_F103_1_L13, SND_STAGE_F103_1, SND_STAGE_F103_1_L13, SND_STAGE_F103_1_L13, "Demo64_02"}, + /* SND_STAGE_F103_1_L14 */ + {"F103_1", 14, SND_STAGE_F103_1_L14, SND_STAGE_F103_1, SND_STAGE_F103_1_L14, SND_STAGE_F103_1_L14, "Demo64_04"}, + /* SND_STAGE_F103_1 */ + {"F103_1", -1, SND_STAGE_F103_1, SND_STAGE_F103_1, SND_STAGE_F103_1, SND_STAGE_F103, nullptr}, + /* SND_STAGE_F210 */ + { "F210", -1, SND_STAGE_F210, SND_STAGE_F210, SND_STAGE_F210, SND_STAGE_F210, nullptr}, + /* SND_STAGE_F211 */ + { "F211", -1, SND_STAGE_F211, SND_STAGE_F211, SND_STAGE_F211, SND_STAGE_F211, nullptr}, + /* SND_STAGE_F221_L13 */ + { "F221", 13, SND_STAGE_F221_L13, SND_STAGE_F221, SND_STAGE_F221_L13, SND_STAGE_F221_L13, "Demo64_01"}, + /* SND_STAGE_F221 */ + { "F221", -1, SND_STAGE_F221, SND_STAGE_F221, SND_STAGE_F221, SND_STAGE_F221, nullptr}, + /* SND_STAGE_F202_1 */ + {"F202_1", -1, SND_STAGE_F202_1, SND_STAGE_F202_1, SND_STAGE_F202_1, SND_STAGE_D200, nullptr}, + /* SND_STAGE_F202_2 */ + {"F202_2", -1, SND_STAGE_F202_2, SND_STAGE_F202_2, SND_STAGE_F202_2, SND_STAGE_D200, nullptr}, + /* SND_STAGE_F202_3 */ + {"F202_3", -1, SND_STAGE_F202_3, SND_STAGE_F202_3, SND_STAGE_F202_3, SND_STAGE_D200, nullptr}, + /* SND_STAGE_F202_4 */ + {"F202_4", -1, SND_STAGE_F202_4, SND_STAGE_F202_4, SND_STAGE_F202_4, SND_STAGE_D200, nullptr}, + /* SND_STAGE_F300_2 */ + {"F300_2", -1, SND_STAGE_F300_2, SND_STAGE_F300_2, SND_STAGE_F300, SND_STAGE_F300, nullptr}, + /* SND_STAGE_F300_3 */ + {"F300_3", -1, SND_STAGE_F300_3, SND_STAGE_F300_3, SND_STAGE_F300, SND_STAGE_F300, nullptr}, + /* SND_STAGE_F300_5 */ + {"F300_5", -1, SND_STAGE_F300_5, SND_STAGE_F300_5, SND_STAGE_F300_5, SND_STAGE_F300_5, nullptr}, + /* SND_STAGE_F303 */ + { "F303", -1, SND_STAGE_F303, SND_STAGE_F303, SND_STAGE_F303, SND_STAGE_F303, nullptr}, + /* SND_STAGE_S000 */ + { "S000", -1, SND_STAGE_S000, SND_STAGE_S000, SND_STAGE_S000, SND_STAGE_S000, nullptr}, + /* SND_STAGE_S100 */ + { "S100", -1, SND_STAGE_S100, SND_STAGE_S100, SND_STAGE_S100, SND_STAGE_S100, nullptr}, + /* SND_STAGE_S200 */ + { "S200", -1, SND_STAGE_S200, SND_STAGE_S200, SND_STAGE_S200, SND_STAGE_S200, nullptr}, + /* SND_STAGE_S300 */ + { "S300", -1, SND_STAGE_S300, SND_STAGE_S300, SND_STAGE_S300, SND_STAGE_S300, nullptr}, + /* SND_STAGE_F020_L3 */ + { "F020", 3, SND_STAGE_F020_L3, SND_STAGE_F020, SND_STAGE_F020_L3, SND_STAGE_F000, nullptr}, + /* SND_STAGE_F020 */ + { "F020", -1, SND_STAGE_F020, SND_STAGE_F020, SND_STAGE_F020, SND_STAGE_F000, nullptr}, + /* SND_STAGE_F021_L13 */ + { "F021", 13, SND_STAGE_F021_L13, SND_STAGE_F021, SND_STAGE_F021_L13, SND_STAGE_F021_L13, "Demo12_02"}, + /* SND_STAGE_F021 */ + { "F021", -1, SND_STAGE_F021, SND_STAGE_F021, SND_STAGE_F021, SND_STAGE_F021, nullptr}, + /* SND_STAGE_F023_L14 */ + { "F023", 14, SND_STAGE_F023_L14, SND_STAGE_F023, SND_STAGE_F023_L14, SND_STAGE_F023_L14, "Demo64_06"}, + /* SND_STAGE_F023 */ + { "F023", -1, SND_STAGE_F023, SND_STAGE_F023, SND_STAGE_F023, SND_STAGE_F023, nullptr}, + /* SND_STAGE_F000_L13 */ + { "F000", 13, SND_STAGE_F000_L13, SND_STAGE_F000, SND_STAGE_F000_L13, SND_STAGE_F000_L13, "Demo04_01"}, + /* SND_STAGE_F000_L14 */ + { "F000", 14, SND_STAGE_F000_L14, SND_STAGE_F000, SND_STAGE_F000_L14, SND_STAGE_F000_L14, "Demo12_01"}, + /* SND_STAGE_F000_L15 */ + { "F000", 15, SND_STAGE_F000_L15, SND_STAGE_F000, SND_STAGE_F000_L15, SND_STAGE_F000_L15, "Demo05_01"}, + /* SND_STAGE_F000_L16 */ + { "F000", 16, SND_STAGE_F000_L16, SND_STAGE_F000, SND_STAGE_F000_L16, SND_STAGE_F000_L16, "Demo08_01"}, + /* SND_STAGE_F000_L17 */ + { "F000", 17, SND_STAGE_F000_L17, SND_STAGE_F000, SND_STAGE_F000_L17, SND_STAGE_F000_L17, "Demo11_01"}, + /* SND_STAGE_F000_L18 */ + { "F000", 18, SND_STAGE_F000_L18, SND_STAGE_F000, SND_STAGE_F000_L18, SND_STAGE_F000_L18, "Demo68_01"}, + /* SND_STAGE_F000_L19 */ + { "F000", 19, SND_STAGE_F000_L19, SND_STAGE_F000, SND_STAGE_F000_L19, SND_STAGE_F000_L19, "Demo69_01"}, + /* SND_STAGE_F000_L20 */ + { "F000", 20, SND_STAGE_F000_L20, SND_STAGE_F000, SND_STAGE_F000_L20, SND_STAGE_F000_L20, "Demo03_01"}, + /* SND_STAGE_F000_L21 */ + { "F000", 21, SND_STAGE_F000_L21, SND_STAGE_F000, SND_STAGE_F000_L21, SND_STAGE_F000_L21, "Demo03_02"}, + /* SND_STAGE_F000_L26 */ + { "F000", 26, SND_STAGE_F000_L26, SND_STAGE_F000, SND_STAGE_F000_L26, SND_STAGE_F000_L26, "Demo01_01"}, + /* SND_STAGE_F000_L27 */ + { "F000", 27, SND_STAGE_F000_L27, SND_STAGE_F000, SND_STAGE_F000_L27, SND_STAGE_F000_L27, "Demo01_02"}, + /* SND_STAGE_F000 */ + { "F000", -1, SND_STAGE_F000, SND_STAGE_F000, SND_STAGE_F000, SND_STAGE_F000, nullptr}, + /* SND_STAGE_F301_5 */ + {"F301_5", -1, SND_STAGE_F301_5, SND_STAGE_F301_5, SND_STAGE_F301_3, SND_STAGE_F301, nullptr}, + /* SND_STAGE_F001r_L13 */ + { "F001r", 13, SND_STAGE_F001r_L13, SND_STAGE_F001r, SND_STAGE_F001r_L13, SND_STAGE_F001r_L13, "Demo13_01"}, + /* SND_STAGE_F001r_L14 */ + { "F001r", 14, SND_STAGE_F001r_L14, SND_STAGE_F001r, SND_STAGE_F001r_L14, SND_STAGE_F001r_L14, "Demo15_04"}, + /* SND_STAGE_F001r_L15 */ + { "F001r", 15, SND_STAGE_F001r_L15, SND_STAGE_F001r, SND_STAGE_F001r_L15, SND_STAGE_F001r_L15, "Demo03_03"}, + /* SND_STAGE_F001r */ + { "F001r", -1, SND_STAGE_F001r, SND_STAGE_F001r, SND_STAGE_F001r, SND_STAGE_F001r, nullptr}, + /* SND_STAGE_F002r */ + { "F002r", -1, SND_STAGE_F002r, SND_STAGE_F002r, SND_STAGE_F002r, SND_STAGE_F002r, nullptr}, + /* SND_STAGE_F004r */ + { "F004r", -1, SND_STAGE_F004r, SND_STAGE_F004r, SND_STAGE_F004r, SND_STAGE_F004r, nullptr}, + /* SND_STAGE_F009r */ + { "F009r", -1, SND_STAGE_F009r, SND_STAGE_F009r, SND_STAGE_F009r, SND_STAGE_F009r, nullptr}, + /* SND_STAGE_F011r */ + { "F011r", -1, SND_STAGE_F011r, SND_STAGE_F011r, SND_STAGE_F011r, SND_STAGE_F011r, nullptr}, + /* SND_STAGE_F012r */ + { "F012r", -1, SND_STAGE_F012r, SND_STAGE_F012r, SND_STAGE_F012r, SND_STAGE_F012r, nullptr}, + /* SND_STAGE_F019r */ + { "F019r", -1, SND_STAGE_F019r, SND_STAGE_F019r, SND_STAGE_F019r, SND_STAGE_F019r, nullptr}, + /* SND_STAGE_F005r */ + { "F005r", -1, SND_STAGE_F005r, SND_STAGE_F005r, SND_STAGE_F005r, SND_STAGE_F005r, nullptr}, + /* SND_STAGE_F006r */ + { "F006r", -1, SND_STAGE_F006r, SND_STAGE_F006r, SND_STAGE_F006r, SND_STAGE_F006r, nullptr}, + /* SND_STAGE_F007r */ + { "F007r", -1, SND_STAGE_F007r, SND_STAGE_F007r, SND_STAGE_F007r, SND_STAGE_F007r, nullptr}, + /* SND_STAGE_F013r */ + { "F013r", -1, SND_STAGE_F013r, SND_STAGE_F013r, SND_STAGE_F013r, SND_STAGE_F013r, nullptr}, + /* SND_STAGE_F014r */ + { "F014r", -1, SND_STAGE_F014r, SND_STAGE_F014r, SND_STAGE_F014r, SND_STAGE_F014r, nullptr}, + /* SND_STAGE_F015r */ + { "F015r", -1, SND_STAGE_F015r, SND_STAGE_F015r, SND_STAGE_F015r, SND_STAGE_F015r, nullptr}, + /* SND_STAGE_F016r */ + { "F016r", -1, SND_STAGE_F016r, SND_STAGE_F016r, SND_STAGE_F016r, SND_STAGE_F016r, nullptr}, + /* SND_STAGE_F017r */ + { "F017r", -1, SND_STAGE_F017r, SND_STAGE_F017r, SND_STAGE_F017r, SND_STAGE_F017r, nullptr}, + /* SND_STAGE_F018r */ + { "F018r", -1, SND_STAGE_F018r, SND_STAGE_F018r, SND_STAGE_F018r, SND_STAGE_F018r, nullptr}, + /* SND_STAGE_F402_L2 */ + { "F402", 2, SND_STAGE_F402_L2, SND_STAGE_F402, SND_STAGE_F402_L2, SND_STAGE_F402_L2, nullptr}, + /* SND_STAGE_F402_L3 */ + { "F402", 3, SND_STAGE_F402_L3, SND_STAGE_F402, SND_STAGE_F402_L3, SND_STAGE_F402_L3, nullptr}, + /* SND_STAGE_F402_L5 */ + { "F402", 5, SND_STAGE_F402_L5, SND_STAGE_F402, SND_STAGE_F402_L5, SND_STAGE_F402_L5, nullptr}, + /* SND_STAGE_F402_L13 */ + { "F402", 13, SND_STAGE_F402_L13, SND_STAGE_F402, SND_STAGE_F402_L13, SND_STAGE_F402_L13, "Demo41_01"}, + /* SND_STAGE_F402_L18 */ + { "F402", 18, SND_STAGE_F402_L18, SND_STAGE_F402, SND_STAGE_F402_L18, SND_STAGE_F402_L18, "Demo43_02"}, + /* SND_STAGE_F402_L19 */ + { "F402", 19, SND_STAGE_F402_L19, SND_STAGE_F402, SND_STAGE_F402_L19, SND_STAGE_F402_L19, "Demo79_01"}, + /* SND_STAGE_F402 */ + { "F402", -1, SND_STAGE_F402, SND_STAGE_F402, SND_STAGE_F402, SND_STAGE_F402, nullptr}, + /* SND_STAGE_F404_L13 */ + { "F404", 13, SND_STAGE_F404_L13, SND_STAGE_F404, SND_STAGE_F404_L13, SND_STAGE_F404_L13, "Demo62_01"}, + /* SND_STAGE_F404_L14 */ + { "F404", 14, SND_STAGE_F404_L14, SND_STAGE_F404, SND_STAGE_F404_L14, SND_STAGE_F404_L14, "Demo77_01"}, + /* SND_STAGE_F404 */ + { "F404", -1, SND_STAGE_F404, SND_STAGE_F404, SND_STAGE_F404, SND_STAGE_F404, nullptr}, + /* SND_STAGE_F407_L13 */ + { "F407", 13, SND_STAGE_F407_L13, SND_STAGE_F407, SND_STAGE_F407_L13, SND_STAGE_F407_L13, "Demo59_01"}, + /* SND_STAGE_F407_L14 */ + { "F407", 14, SND_STAGE_F407_L14, SND_STAGE_F407, SND_STAGE_F407_L14, SND_STAGE_F407_L14, "Demo70_01"}, + /* SND_STAGE_F407_L15 */ + { "F407", 15, SND_STAGE_F407_L15, SND_STAGE_F407, SND_STAGE_F407_L15, SND_STAGE_F407_L15, "Demo70_02"}, + /* SND_STAGE_F407 */ + { "F407", -1, SND_STAGE_F407, SND_STAGE_F407, SND_STAGE_F407, SND_STAGE_F407, nullptr}, + /* SND_STAGE_F008r_L13 */ + { "F008r", 13, SND_STAGE_F008r_L13, SND_STAGE_F008r, SND_STAGE_F008r_L13, SND_STAGE_F008r_L13, "Demo15_01"}, + /* SND_STAGE_F008r_L14 */ + { "F008r", 14, SND_STAGE_F008r_L14, SND_STAGE_F008r, SND_STAGE_F008r_L14, SND_STAGE_F008r_L14, "Demo15_02"}, + /* SND_STAGE_F008r_L15 */ + { "F008r", 15, SND_STAGE_F008r_L15, SND_STAGE_F008r, SND_STAGE_F008r_L15, SND_STAGE_F008r_L15, "Demo15_03"}, + /* SND_STAGE_F008r */ + { "F008r", -1, SND_STAGE_F008r, SND_STAGE_F008r, SND_STAGE_F008r, SND_STAGE_F008r, nullptr}, + /* SND_STAGE_F010r_L13 */ + { "F010r", 13, SND_STAGE_F010r_L13, SND_STAGE_F010r, SND_STAGE_F010r_L13, SND_STAGE_F010r_L13, "Demo44_01"}, + /* SND_STAGE_F010r_L14 */ + { "F010r", 14, SND_STAGE_F010r_L14, SND_STAGE_F010r, SND_STAGE_F010r_L14, SND_STAGE_F010r_L14, "Demo48_01"}, + /* SND_STAGE_F010r_L15 */ + { "F010r", 15, SND_STAGE_F010r_L15, SND_STAGE_F010r, SND_STAGE_F010r_L15, SND_STAGE_F010r_L15, "Demo50_01"}, + /* SND_STAGE_F010r */ + { "F010r", -1, SND_STAGE_F010r, SND_STAGE_F010r, SND_STAGE_F010r, SND_STAGE_F010r, nullptr}, + /* SND_STAGE_Demo_L13 */ + { "Demo", 13, SND_STAGE_Demo_L13, SND_STAGE_Demo, SND_STAGE_Demo_L13, SND_STAGE_Demo_L13, "Demo78_01"}, + /* SND_STAGE_Demo */ + { "Demo", -1, SND_STAGE_Demo, SND_STAGE_Demo, SND_STAGE_Demo, SND_STAGE_Demo, nullptr}, +}; + +#pragma pop + +const s32 dSndStageInfo::sNumStageInfos = ARRAY_LENGTH(dSndStageInfo::sInfos); diff --git a/src/d/snd/d_snd_state_mgr.cpp b/src/d/snd/d_snd_state_mgr.cpp new file mode 100644 index 00000000..89a74d33 --- /dev/null +++ b/src/d/snd/d_snd_state_mgr.cpp @@ -0,0 +1,1247 @@ +#include "d/snd/d_snd_state_mgr.h" + +#include "common.h" +#include "d/a/d_a_player.h" +#include "d/d_camera.h" +#include "d/d_sc_game.h" +#include "d/snd/d_snd_area_sound_effect_mgr.h" +#include "d/snd/d_snd_bgm_mgr.h" +#include "d/snd/d_snd_checkers.h" +#include "d/snd/d_snd_control_player_mgr.h" +#include "d/snd/d_snd_event.h" +#include "d/snd/d_snd_harp_song_mgr.h" +#include "d/snd/d_snd_mgr.h" +#include "d/snd/d_snd_player_mgr.h" +#include "d/snd/d_snd_small_effect_mgr.h" +#include "d/snd/d_snd_source_mgr.h" +#include "d/snd/d_snd_stage_data.h" +#include "d/snd/d_snd_util.h" +#include "d/snd/d_snd_wzsound.h" +#include "d/t/d_t_sound_area_mgr.h" +#include "egg/core/eggHeap.h" +#include "nw4r/snd/snd_FxReverbStdDpl2.h" +#include "nw4r/snd/snd_SeqSoundHandle.h" +#include "nw4r/snd/snd_SoundPlayer.h" +#include "nw4r/snd/snd_global.h" +#include "sized_string.h" +#include "toBeSorted/event_manager.h" + +#include + +SndEventCallback dSndStateMgr_c::sEventExecuteCallback; +SND_DISPOSER_DEFINE(dSndStateMgr_c); + +dSndStateMgr_c::dSndStateMgr_c() + : field_0x010(0), + field_0x014(0), + field_0x018(0), + field_0x03C(0), + mStageId(0xAC), + mPreviousStageId(0xAC), + mStageTypeFlags(0), + mLayer(0), + mRoomId(-1), + mCheckRoomIdCooldown(0), + field_0x064(false), + field_0x065(false), + mHasChangedTgSndAreaFlags(false), + mHasChangedTgSndAreaMgFlags(false), + mSavedTgSndAreaFlags(-1), + mSavedTgSndAreaMgFlags(-1), + mpUnkCallback(nullptr), + field_0x074(0), + mpOnEventStartCallback(nullptr), + field_0x07C(0), + mpTgSndAreaFlagsChangeCallback(nullptr), + mpTgSndAreaMgFlagsChangeCallback(nullptr), + field_0x088(0), + mSoundEventId(SND_EVENT_0x89), + mCameraCutCounter(0), + mEventFlags(0), + mpStbEventName(nullptr), + mFrameCounter(0), + mCameraCutFrameCounter(0), + mMsgFrameCounter(0), + mSeLvSoundId(-1), + field_0x22C(0), + mpSoundEventDef(nullptr), + field_0x238(-1), + field_0x23C(0), + field_0x23D(0), + field_0x240(0), + field_0x244(0), + field_0x248(0), + mMsgCounter(-1), + mMsgWaitSelectCounter(0), + field_0x254(0), + field_0x258(0), + field_0x48C(0), + mFxSend3DDefault(0.02f), + mFxSend3DOverride(-1.0f), + mFxSend3DNext(-1.0f), + mFxSend3D(0.02f), + mFxSend3DTarget(0.02f), + mPrevStageGroup(-1), + field_0x4A8(0), + mNeedsGroupsReload(false) {} + +extern "C" void fn_803665B0(nw4r::snd::detail::FxReverbStdParam &, int); + +void dSndStateMgr_c::setup(EGG::Heap *pHeap) { + u32 max = 0; + for (int i = 0; i < 5; i++) { + nw4r::snd::detail::FxReverbStdParam param; + fn_803665B0(param, i); + mFx.SetParam(param); + u32 thisSize = mFx.GetRequiredMemSize(); + if (max < thisSize) { + max = thisSize; + } + } + void *mem = pHeap->alloc(max, 4); + mFx.AssignWorkBuffer(mem, max); + resetEventName(); +} + +void dSndStateMgr_c::onStageOrLayerUpdate() { + if (dSndPlayerMgr_c::GetInstance()->checkFlag(dSndPlayerMgr_c::MGR_CAUTION)) { + dSndPlayerMgr_c::GetInstance()->leaveCaution(); + } + + bool unk_0x065 = field_0x065; + + onFlag0x10(FLAG0x10_0x02); + field_0x064 = false; + + if (!streq(mStageName, dScGame_c::currentSpawnInfo.getStageName())) { + mNeedsGroupsReload = true; + mStageName = dScGame_c::currentSpawnInfo.getStageName(); + } + + if (!mNeedsGroupsReload && dScGame_c::currentSpawnInfo.layer != mLayer) { + mNeedsGroupsReload = true; + } + + mLayer = dScGame_c::currentSpawnInfo.layer; + u32 newStageId = getStageId(dScGame_c::currentSpawnInfo.getStageName(), dScGame_c::currentSpawnInfo.layer); + mPreviousStageId = mStageId; + field_0x044 = getStageUnk2(newStageId); + mStageId = newStageId; + + if (unk_0x065) { + setCallbacksForStage(); + } +} + +inline bool checkStagePrefix(const char *stageName, const char *prefix) { + return !std::strncmp(prefix, stageName, 2); +} + +u32 dSndStateMgr_c::getStageTypeFlags(const char *stageName) const { + u32 flags = 0; + if (checkStagePrefix(stageName, "F0")) { + flags |= STAGE_SKY | STAGE_FIELD; + } else if (checkStagePrefix(stageName, "D0")) { + flags |= STAGE_SKY | STAGE_DUNGEON; + } else if (checkStagePrefix(stageName, "B0")) { + flags |= STAGE_SKY | STAGE_BOSS; + } else if (checkStagePrefix(stageName, "S0")) { + flags |= STAGE_SKY | STAGE_SILENT_REALM; + } else if (checkStagePrefix(stageName, "F1")) { + flags |= STAGE_FOREST | STAGE_FIELD; + } else if (checkStagePrefix(stageName, "D1")) { + flags |= STAGE_FOREST | STAGE_DUNGEON; + } else if (checkStagePrefix(stageName, "B1")) { + flags |= STAGE_FOREST | STAGE_BOSS; + } else if (checkStagePrefix(stageName, "S1")) { + flags |= STAGE_FOREST | STAGE_SILENT_REALM; + } else if (checkStagePrefix(stageName, "F2")) { + flags |= STAGE_MOUNTAIN | STAGE_FIELD; + } else if (checkStagePrefix(stageName, "D2")) { + flags |= STAGE_MOUNTAIN | STAGE_DUNGEON; + } else if (checkStagePrefix(stageName, "B2")) { + flags |= STAGE_MOUNTAIN | STAGE_BOSS; + } else if (checkStagePrefix(stageName, "S2")) { + flags |= STAGE_MOUNTAIN | STAGE_SILENT_REALM; + } else if (checkStagePrefix(stageName, "F3")) { + flags |= STAGE_DESERT | STAGE_FIELD; + } else if (checkStagePrefix(stageName, "D3")) { + flags |= STAGE_DESERT | STAGE_DUNGEON; + } else if (checkStagePrefix(stageName, "B3")) { + flags |= STAGE_DESERT | STAGE_BOSS; + } else if (checkStagePrefix(stageName, "S3")) { + flags |= STAGE_DESERT | STAGE_SILENT_REALM; + } else if (checkStagePrefix(stageName, "F4")) { + flags |= STAGE_SILENT_GROUNDS | STAGE_FIELD; + } else if (checkStagePrefix(stageName, "D4")) { + flags |= STAGE_SILENT_GROUNDS | STAGE_DUNGEON; + } else if (checkStagePrefix(stageName, "B4")) { + flags |= STAGE_SILENT_GROUNDS | STAGE_BOSS; + } + + if ((flags & STAGE_SKY) != 0 && std::strstr(stageName, "r") != nullptr) { + flags |= STAGE_ROOM; + } + + return flags; +} + +bool dSndStateMgr_c::isVolcanicDungeon(u32 stageId) { + u32 base = getStageUnk2(stageId); + switch (base) { + case SND_STAGE_D200: + case SND_STAGE_D201: + case SND_STAGE_D201_1: + case SND_STAGE_D003_0: + case SND_STAGE_D003_1: return true; + default: return false; + } +} + +bool dSndStateMgr_c::isSeekerStoneStage(const char *stageName, s32 layer) { + if (streq(stageName, "F000") && layer == 22) { + // Skyloft hint stone + return true; + } + + if (streq(stageName, "F202") && layer == 10) { + // Boko base hint stone + return true; + } + + return false; +} + +bool dSndStateMgr_c::isSomeSkyloftRoom() const { + switch (field_0x044) { + case SND_STAGE_F001r: + case SND_STAGE_F002r: + case SND_STAGE_F011r: + case SND_STAGE_F005r: + case SND_STAGE_F006r: + case SND_STAGE_F007r: + case SND_STAGE_F013r: + case SND_STAGE_F014r: + case SND_STAGE_F015r: + case SND_STAGE_F016r: + case SND_STAGE_F017r: + case SND_STAGE_F018r: return true; + default: return false; + } +} + +void dSndStateMgr_c::onRestartScene(s32 fadeFrames) { + if (field_0x064) { + return; + } + + s32 nextLayer = dScGame_c::nextSpawnInfo.layer; + // This combines next stage with current layer, so this effectively checks if you're leaving the Hint Movie scene + if (isSeekerStoneStage(mStageName, dScGame_c::currentSpawnInfo.layer)) { + dSndBgmMgr_c::GetInstance()->stopAllBgm(fadeFrames); + } else if (mLayer != nextLayer) { + if (isSeekerStoneStage(mStageName, nextLayer)) { + dSndBgmMgr_c::GetInstance()->stopAllBgm(fadeFrames); + dSndBgmMgr_c::GetInstance()->prepareBgm(BGM_HINT_SELECT, 0); + dSndBgmMgr_c::GetInstance()->setOverrideBgmId(BGM_HINT_SELECT); + dSndBgmMgr_c::GetInstance()->activateOverrideBgmId(); + dSndAreaSoundEffectMgr_c::GetInstance()->stopSounds(fadeFrames); + } else { + onGotoStage(fadeFrames); + onFlag0x10(FLAG0x10_0x01); + return; + } + } + + dSndSmallEffectMgr_c::GetInstance()->stopAllSoundExceptEvent(fadeFrames); + dSndBgmMgr_c::GetInstance()->prepareBgm(); + dSndHarpSongMgr_c::GetInstance()->deactivate(); + onFlag0x10(FLAG0x10_0x01); + dSndBgmMgr_c::GetInstance()->setField_0x306(1); + offFlag0x10(FLAG0x10_0x04); + offFlag0x10(FLAG0x10_0x10); +} + +void dSndStateMgr_c::loadStageSound() { + loadStageSound(false); +} + +void dSndStateMgr_c::loadStageSound(bool force) { + if (!force && !mNeedsGroupsReload) { + return; + } + + bool demo = isInDemo(); + if (!checkFlag0x18(0x40)) { + for (int i = 0; i < dSndControlPlayerMgr_c::sNumPlayers; i++) { + dSndControlPlayerMgr_c::GetInstance()->setLpfFreq(i, 0.0f, 0); + dSndControlPlayerMgr_c::GetInstance()->setFxSend(i, 0.0f, 0); + } + } + + if (checkEventFlag(EVENT_0x800)) { + if (!dSndBgmMgr_c::GetInstance()->isPlayingBgmSound()) { + dSndControlPlayerMgr_c::GetInstance()->setupPlayerControlsStage(); + offEventFlag(EVENT_0x800); + } else { + dSndControlPlayerMgr_c::GetInstance()->setupPlayerControlsStageBgm(); + } + } else { + if (dSndBgmMgr_c::GetInstance()->isPlayingBgmSound()) { + dSndControlPlayerMgr_c::GetInstance()->setupPlayerControlsStageBgm(); + onEventFlag(EVENT_0x800); + } else { + dSndControlPlayerMgr_c::GetInstance()->setupPlayerControlsStage(); + } + } + + dSndControlPlayerMgr_c::GetInstance()->muteScenePlayers(0); + dSndPlayerMgr_c::GetInstance()->shutdownDemo(); + field_0x4A8 = 1; + bool bHasState1 = false; + + if (isSomeSkyloftRoom()) { + u32 id = dSndMgr_c::GetInstance()->getArchive()->ConvertLabelStringToGroupId("GRP_FAN_TIMECHANGE"); + if (dSndMgr_c::GetInstance()->getPlayer().IsLoadedGroup(id)) { + bHasState1 = true; + } else { + dSndPlayerMgr_c::GetInstance()->popToState0(); + if (dSndMgr_c::GetInstance()->loadGroup(id, nullptr, 0)) { + dSndPlayerMgr_c::GetInstance()->saveState1(); + bHasState1 = true; + } + } + } + + const dSndStageInfo *info = &dSndStageInfo::sInfos[mStageId]; + + u32 id = -1; + int round = 1; + + bool canReuseStageState = false; + SizedString<64> label; + + if (info->unk4 == mStageId) { + const char *stageName = getStageName(info->unk4); + label.sprintf("GRP_A_%s_L%d", stageName, mLayer); + round = 2; + } else { + const char *stageName = getCurrentStageName4(); + label.sprintf("GRP_A_%s", stageName); + } + + for (; round > 0; round--) { + id = dSndMgr_c::GetInstance()->getArchive()->ConvertLabelStringToGroupId(label); + if (mPrevStageGroup == id && mPrevStageGroup != -1) { + canReuseStageState = true; + break; + } + + if (id != -1) { + if (bHasState1) { + dSndPlayerMgr_c::GetInstance()->popToState1(); + } else { + dSndPlayerMgr_c::GetInstance()->popToState0(); + } + if (dSndMgr_c::GetInstance()->loadGroup(id, nullptr, 0)) { + mPrevStageGroup = id; + dSndPlayerMgr_c::GetInstance()->saveState2(); + break; + } + } + + if (round == 2) { + // we tried layer variant, now try variant without layer + const char *stageName = getCurrentStageName4(); + label.sprintf("GRP_A_%s", stageName); + } + } + + if (canReuseStageState) { + dSndPlayerMgr_c::GetInstance()->popToState2(); + } else if (id == -1) { + if (bHasState1) { + dSndPlayerMgr_c::GetInstance()->popToState1(); + } else { + dSndPlayerMgr_c::GetInstance()->popToState0(); + } + dSndPlayerMgr_c::GetInstance()->saveState2(); + mPrevStageGroup = -1; + } + + if (!demo && (field_0x03C != 2 || field_0x065)) { + if (field_0x065) { + id = GRP_SIREN; + } else if (checkStageTypeFlag(STAGE_ROOM)) { + id = GRP_INDOOR; + } else if (checkStageTypeFlag(STAGE_FIELD)) { + id = GRP_FIELD; + } else if (checkStageTypeFlag(STAGE_DUNGEON)) { + if (isVolcanicDungeon(mStageId)) { + id = GRP_DUNGEON_BATTLE_ROOM; + } else { + id = GRP_DUNGEON; + } + } else if (checkStageTypeFlag(STAGE_BOSS)) { + id = GRP_BOSS; + } else { + id = GRP_DEFAULT; + } + + if (id != -1) { + dSndMgr_c::GetInstance()->loadGroup(id, nullptr, 0); + } + } + + if (!field_0x065) { + id = -1; + if (!demo) { + if (field_0x03C == 2) { + id = GRP_SKY; + } else if (checkStageTypeFlag(STAGE_FOREST)) { + id = GRP_FOREST; + } else if (checkStageTypeFlag(STAGE_MOUNTAIN)) { + id = GRP_MOUNTAIN; + } else if (checkStageTypeFlag(STAGE_DESERT)) { + id = GRP_DESERT; + } + + if (id != -1) { + dSndMgr_c::GetInstance()->loadGroup(id, nullptr, 0); + } + } + + SizedString<64> label; + label.sprintf("GRP_%s_L%d", &mStageName, mLayer); + id = dSndMgr_c::GetInstance()->getArchive()->ConvertLabelStringToGroupId(label); + if (id == -1) { + label.sprintf("GRP_%s", &mStageName); + id = dSndMgr_c::GetInstance()->getArchive()->ConvertLabelStringToGroupId(label); + } + + if (id != -1) { + dSndMgr_c::GetInstance()->loadGroup(id, nullptr, 0); + } + + if (demo) { + // REGSWAP + if (dSndPlayerMgr_c::GetInstance()->loadDemoArchive(getCurrentStageMusicDemoName())) { + for (u32 i = dSndPlayerMgr_c::PLAYER_LINK_BODY; i <= dSndPlayerMgr_c::PLAYER_EVENT; i++) { + dSndControlPlayerMgr_c::GetInstance()->getPlayer1(i)->StopAllSound(0); + } + dSndControlPlayerMgr_c::GetInstance()->setupPlayerControlsDemo(); + } + } + } + + field_0x4A8 = 0; + dSndBgmMgr_c::GetInstance()->loadStageSound(); + f32 volume = -1.0f; + dSndAreaSoundEffectMgr_c::GetInstance()->loadStageSound(&volume); + if (volume > 0.0f) { + mFxSend3DDefault = volume; + } +} + +void dSndStateMgr_c::calcEvent() { + if (!isInEvent()) { + return; + } + + bool b = false; + if (dSndPlayerMgr_c::GetInstance()->checkFlag(dSndPlayerMgr_c::MGR_CAUTION) || + dSndPlayerMgr_c::GetInstance()->checkFlag(dSndPlayerMgr_c::MGR_MAP) || + dSndPlayerMgr_c::GetInstance()->checkFlag(dSndPlayerMgr_c::MGR_MSG_WAIT)) { + b = true; + } + + if (mpSoundEventDef != nullptr && sEventExecuteCallback != nullptr) { + (sEventExecuteCallback)(); + } + + if (!b) { + if (EventManager::getCurrentEventName() == nullptr) { + if (!checkEventFlag(EVENT_0x800)) { + endEvent(false); + } + } else { + if (mSeLvSoundId != -1) { + dSndMgr_c::GetInstance()->holdSound(&mSeLvSoundHandle, mSeLvSoundId); + } + calcBgm(); + calcSe(); + calcCmd(); + mFrameCounter++; + mCameraCutFrameCounter++; + mMsgFrameCounter++; + nw4r::snd::SeqSoundHandle::WriteGlobalVariable(2, mCameraCutFrameCounter); + } + } +} + +void dSndStateMgr_c::setEvent(const char *eventName) { + if (eventName == nullptr) { + return; + } + + if (dSndPlayerMgr_c::GetInstance()->checkFlag(dSndPlayerMgr_c::MGR_CAUTION)) { + dSndPlayerMgr_c::GetInstance()->leaveCaution(); + } + + if (!field_0x064) { + if (streq(mEventName, "DefaultSkip")) { + onSkipEvent(); + mPrevEventName = mEventName; + return; + } + + if (!checkFlag0x18(0x20) || !checkFlag0x10(FLAG0x10_0x04)) { + SizedString<64> prevEvent = mEventName; + if (isInEvent()) { + field_0x23C = 1; + finalizeEvent(false); + } else { + field_0x23C = 0; + } + + // TODO - constness or direct access + if (checkEventFlag(EVENT_0x04)) { + offEventFlag(EVENT_0x04); + } + mEventName = eventName; + mPrevEventName = prevEvent; + resetEventVars(); + field_0x23D = 0; + field_0x238 = -1; + + if (streq(mEventName, "STB")) { + if (mpStbEventName != nullptr) { + mEventName = mpStbEventName; + } + onEventFlag(EVENT_DEMO); + } else { + mpStbEventName = nullptr; + } + + if (!checkFlag0x10(FLAG0x10_0x04)) { + if (mpUnkCallback != nullptr) { + mpUnkCallback(); + } + field_0x23D = 1; + dSndBgmMgr_c::GetInstance()->setField_0x306(1); + dSndBgmMgr_c::GetInstance()->prepareBgm(); + onEventFlag(EVENT_0x04); + onFlag0x10(FLAG0x10_0x04); + dSndControlPlayerMgr_c::GetInstance()->unmuteScenePlayers(30); + } + bool b2 = checkEventFlag(EVENT_0x800) && dSndBgmMgr_c::GetInstance()->isPlayingBgmSound(); + if (checkEventFlag(EVENT_0x800) && !field_0x064) { + // TODO - constness or direct access + offEventFlag(0x800); + } + + mSoundEventId = SND_EVENT_0x89; + initializeEventCallbacks(mEventName); + s32 i3 = 0; + SizedString<64> eventLabel; + if (mSoundEventId == SND_EVENT_JMAP) { + s32 eventRoomId = EventManager::getCurrentEventRoomId(); + // UB: Cannot pass object of non-POD type 'SizedString<32>' through variadic method + eventLabel.sprintf("%s_R%d_JMAP_%d", mStageName, mRoomId, eventRoomId); + } else if (mSoundEventId == SND_EVENT_JMAPAllMove) { + s32 eventRoomId = EventManager::getCurrentEventRoomId(); + // UB: Cannot pass object of non-POD type 'SizedString<32>' through variadic method + eventLabel.sprintf("%s_R%d_JMAPAllMove_%d", mStageName, mRoomId, eventRoomId); + } else { + eventLabel.sprintf("%s", &mEventName); + } + + if (checkEventFlag(EVENT_DEMO)) { + mBgmName.sprintf("BGM_%s", &eventLabel); + mFanName.sprintf("FAN_%s", &eventLabel); + mSeName.sprintf("SE_%s", &eventLabel); + mCmdName.sprintf("CMD_%s", &eventLabel); + } else { + mBgmName.sprintf("BGM_EVENT_%s", &eventLabel); + mFanName.sprintf("FAN_EVENT_%s", &eventLabel); + mSeName.sprintf("SE_EVENT_%s", &eventLabel); + mCmdName.sprintf("CMD_EVENT_%s", &eventLabel); + } + + if (checkEventFlag(EVENT_0x04)) { + field_0x238 = getBgmLabelSoundId(); + if (b2 && field_0x238 == -1) { + field_0x23D = 0; + } + } else { + i3 = playFanOrBgm(getBgmLabelSoundId()); + if (i3) { + field_0x23D = 0; + } + } + + handleFan(); + handleSe(); + handleSeLv(); + handleCmd(); + + if (mSoundEventId != SND_EVENT_0x89) { + onEventFlag(EVENT_IN_EVENT); + mFrameCounter = 0; + mCameraCutFrameCounter = 0; + mMsgFrameCounter = 0; + if (mpOnEventStartCallback != nullptr) { + (mpOnEventStartCallback)(mSoundEventId, mEventFlags); + } + if (field_0x238 == -1) { + dSndBgmMgr_c::GetInstance()->onEventStart(mEventName, mSoundEventId, i3); + } + dSndAreaSoundEffectMgr_c::GetInstance()->onEventStart(); + dSndSourceMgr_c::GetInstance()->onEventStart(); + } + } + } +} + +bool dSndStateMgr_c::isInStage(const char *stageName) { + return !std::strcmp(dScGame_c::currentSpawnInfo.getStageName(), stageName); +} + +void dSndStateMgr_c::initializeEventCallbacks(const char *name) { + if (name == nullptr) { + return; + } + + mpSoundEventDef = nullptr; + sEventExecuteCallback = nullptr; + resetOverrides(); + + if (checkEventFlag(EVENT_DEMO)) { + handleDemoEvent(name); + return; + } + + if (mSoundEventId == SND_EVENT_0x87) { + return; + } + + if (!handleStageEvent(name)) { + handleGlobalEvent(name); + } + + if (mSoundEventId == SND_EVENT_0x89) { + if (strstr(name, "Intro")) { + mSoundEventId = SND_EVENT_0x88; + } else { + mSoundEventId = SND_EVENT_0x86; + cbUnkNoop(); + } + } +} + +void dSndStateMgr_c::doLabelSuffix(const char *suffix) { + SizedString<64> label; + label.sprintf("%s%s", &mBgmName, suffix); + doBgm(label); + label.sprintf("%s%s", &mSeName, suffix); + doSe(label); + label.sprintf("%s%s", &mCmdName, suffix); + doCmd(label); +} + +u32 dSndStateMgr_c::getSeCameraId() { + SizedString<64> label; + label.sprintf(getCameraFmt(), &mSeName, mCameraCutCounter, mCameraCutFrameCounter); + return convertSeLabelToSoundId(label); +} + +u32 dSndStateMgr_c::getSeMsgWaitId() { + SizedString<64> label; + label.sprintf(getMsgWaitFmt(), &mSeName, mMsgCounter, mMsgWaitSelectCounter, mMsgFrameCounter); + return convertSeLabelToSoundId(label); +} + +u32 dSndStateMgr_c::getSeFrameCountId() { + SizedString<64> label; + label.sprintf(getFrameFmt(), &mSeName, mFrameCounter); + return convertSeLabelToSoundId(label); +} + +u32 dSndStateMgr_c::getBgmCameraId() { + SizedString<64> label; + label.sprintf(getCameraFmt(), &mBgmName, mCameraCutCounter, mCameraCutFrameCounter); + return convertBgmLabelToSoundId(label); +} + +u32 dSndStateMgr_c::getBgmMsgWaitId() { + SizedString<64> label; + label.sprintf(getMsgWaitFmt(), &mBgmName, mMsgCounter, mMsgWaitSelectCounter, mMsgFrameCounter); + return convertBgmLabelToSoundId(label); +} + +u32 dSndStateMgr_c::getBgmFrameCountId() { + SizedString<64> label; + label.sprintf(getFrameFmt(), &mBgmName, mFrameCounter); + return convertBgmLabelToSoundId(label); +} + +u32 dSndStateMgr_c::getCmdCameraId() { + SizedString<64> label; + label.sprintf(getCameraFmt(), &mCmdName, mCameraCutCounter, mCameraCutFrameCounter); + return convertCmdLabelToSoundId(label); +} + +u32 dSndStateMgr_c::getCmdMsgWaitId() { + SizedString<64> label; + label.sprintf(getMsgWaitFmt(), &mCmdName, mMsgCounter, mMsgWaitSelectCounter, mMsgFrameCounter); + return convertCmdLabelToSoundId(label); +} + +u32 dSndStateMgr_c::getCmdFrameCountId() { + SizedString<64> label; + label.sprintf(getFrameFmt(), &mCmdName, mFrameCounter); + return convertCmdLabelToSoundId(label); +} + +void dSndStateMgr_c::clearEventExecuteCallback() { + sEventExecuteCallback = nullptr; +} + +bool dSndStateMgr_c::calcBgm() { + bool ok = playFanOrBgm(getBgmCameraId()); + if (!ok) { + ok = playFanOrBgm(getBgmMsgWaitId()); + } + if (!ok) { + // @bug (?) shouldn't this assign to ok? Maybe a shadowing redeclaration... + (void)playFanOrBgm(getBgmFrameCountId()); + } + return ok; +} + +void dSndStateMgr_c::calcSe() { + playSe(getSeCameraId()); + playSe(getSeMsgWaitId()); + playSe(getSeFrameCountId()); +} + +void dSndStateMgr_c::handleSeLv() { + SizedString<0x40> name = mSeName; + name += "_LV"; + u32 soundId = convertSeLabelToSoundId(name); + if (soundId != -1) { + mSeLvSoundId = soundId; + if (dSndMgr_c::GetInstance()->holdSound(&mSeLvSoundHandle, soundId)) { + u32 id = dSndPlayerMgr_c::GetInstance()->getDemoArchive()->GetSoundUserParam(soundId); + if ((dSndPlayerMgr_c::sEventMuteFlagsMask & id & 0x2000000) == 0) { + mSeLvSoundHandle.SetFxSend(nw4r::snd::AUX_A, mFxSend3D); + } + } + } else { + mSeLvSoundId = -1; + } +} + +void dSndStateMgr_c::calcCmd() { + playCmd(getCmdCameraId()); + playCmd(getCmdMsgWaitId()); + playCmd(getCmdFrameCountId()); +} + +bool dSndStateMgr_c::finalizeEvent(bool skipped) { + dSndPlayerMgr_c *mgr = dSndPlayerMgr_c::GetInstance(); + if (mgr->checkFlag(dSndPlayerMgr_c::MGR_CAUTION)) { + mgr->leaveCaution(); + } + if (!isInEvent()) { + return false; + } + + if (mpSoundEventDef != nullptr && mpSoundEventDef->finalizeCb) { + mpSoundEventDef->finalizeCb(skipped); + } + + if (!isInDemo()) { + nw4r::snd::SoundPlayer *p = dSndControlPlayerMgr_c::GetInstance()->getPlayer1(dSndPlayerMgr_c::PLAYER_EVENT); + SoundStopperIfParamFlag20 stopper; + p->ForEachSound(stopper, false); + } + + SizedString<64> label; + label.sprintf("%s_FIN", &mSeName); + playSe(dSndPlayerMgr_c::GetInstance()->convertLabelStringToSoundId(label)); + label.sprintf("%s_FIN", &mBgmName); + doBgm(label); + label.sprintf("%s_FIN", &mCmdName); + doCmd(label); + + return dSndBgmMgr_c::GetInstance()->onEventFinalize(mEventName, mSoundEventId, skipped); +} + +// TODO - the whole "camera cut" thing seems plausible but I haven't confirmed it yet +void dSndStateMgr_c::onCameraCut(s32 cutIdx) { + if (cutIdx <= 0) { + mCameraCutCounter++; + } else { + mCameraCutCounter = cutIdx; + } + mCameraCutFrameCounter = 0; + nw4r::snd::SeqSoundHandle::WriteGlobalVariable(1, mCameraCutCounter); + nw4r::snd::SeqSoundHandle::WriteGlobalVariable(2, 0); + SizedString<64> suffix; + suffix.sprintf("_C%d", mCameraCutCounter); + doLabelSuffix(suffix); +} + +bool dSndStateMgr_c::isInEvent() { + return checkEventFlag(EVENT_IN_EVENT); +} + +bool dSndStateMgr_c::isInEvent(const char *eventName) { + return streq(mEventName, eventName); +} + +void dSndStateMgr_c::onMsgStart(s32 idx) { + if (idx >= 0) { + mMsgCounter = idx; + } else { + mMsgCounter++; + } + field_0x254 = 1; + mMsgWaitSelectCounter = 0; + mMsgFrameCounter = 0; + SizedString<64> label; + label.sprintf("_MS%d", mMsgCounter); + doLabelSuffix(label); +} + +void dSndStateMgr_c::onMsgEnd() { + field_0x254 = 0; + SizedString<64> label; + label.sprintf("_ME%d", mMsgCounter); + doLabelSuffix(label); +} + +void dSndStateMgr_c::onMsgWaitStart() { + mMsgFrameCounter = 0; + mMsgWaitSelectCounter++; + + if (mpSoundEventDef != nullptr && mpSoundEventDef->msgWaitStartCb != nullptr) { + mpSoundEventDef->msgWaitStartCb(mMsgWaitSelectCounter); + } + + SizedString<64> label; + label.sprintf("_M%d_WS%d", mMsgCounter, mMsgWaitSelectCounter); + doLabelSuffix(label); +} + +void dSndStateMgr_c::onMsgWaitEnd() { + if (mpSoundEventDef != nullptr && mpSoundEventDef->msgWaitEndCb != nullptr) { + mpSoundEventDef->msgWaitEndCb(mMsgWaitSelectCounter); + } + + SizedString<64> label; + label.sprintf("_M%d_WE%d", mMsgCounter, mMsgWaitSelectCounter); + doLabelSuffix(label); +} + +void dSndStateMgr_c::onLinkDie() { + if (!checkFlag0x10(FLAG0x10_0x08)) { + onFlag0x10(FLAG0x10_0x08); + dSndBgmMgr_c::GetInstance()->stopAllBgm(15); + dSndSmallEffectMgr_c::GetInstance()->stopAllSoundExceptEffectOrLink(15); + if (field_0x065 == 0) { + dSndBgmMgr_c::GetInstance()->prepareFanSound(FAN_GAMEOVER); + } + } +} + +void dSndStateMgr_c::setStbEventName(const char *eventName) { + mpStbEventName = eventName; +} + +void dSndStateMgr_c::calcRoomId() { + if (checkFlag0x10(FLAG0x10_0x04)) { + if (mCheckRoomIdCooldown > 0) { + mCheckRoomIdCooldown--; + } else { + if (mRoomId == -1) { + mCheckRoomIdCooldown = 30; + } + s32 newRoom = dSndSourceMgr_c::GetInstance()->getPlayerSourceRoomId(); + if (mRoomId != newRoom) { + setRoomId(newRoom); + } else if (newRoom != -1 && !checkFlag0x10(FLAG0x10_0x10)) { + setRoomId(newRoom); + } + } + } +} + +void dSndStateMgr_c::setRoomId(s32 roomId) { + // ... +} + +void dSndStateMgr_c::calcTgSnd() { + mHasChangedTgSndAreaFlags = false; + mHasChangedTgSndAreaMgFlags = false; + dAcPy_c *link = dAcPy_c::GetLinkM(); + if (link != nullptr && dTgSndMg_c::GetInstance() != nullptr) { + u32 flags = dTgSndMg_c::GetInstance()->getSndFlags(); + if (flags != mSavedTgSndAreaMgFlags) { + mHasChangedTgSndAreaMgFlags = true; + if (mpTgSndAreaMgFlagsChangeCallback != nullptr) { + (mpTgSndAreaMgFlagsChangeCallback)(flags, mSavedTgSndAreaMgFlags); + } + dSndBgmMgr_c::GetInstance()->onTgSndAreaMgFlagsChange(flags, mSavedTgSndAreaMgFlags); + mSavedTgSndAreaMgFlags = flags; + } + + if (dSndSourceMgr_c::getBoomerangSource() != nullptr) { + flags = mSavedTgSndAreaMgFlags; + } else { + flags = link->mTgSndAreaFlags; + } + if (flags != mSavedTgSndAreaFlags) { + mHasChangedTgSndAreaFlags = true; + if (mpTgSndAreaFlagsChangeCallback != nullptr) { + (mpTgSndAreaFlagsChangeCallback)(flags, mSavedTgSndAreaFlags); + } + mFxSend3DNext = getUserParamVolume(flags); + dSndBgmMgr_c::GetInstance()->onTgSndAreaFlagsChange(flags, mSavedTgSndAreaFlags); + mSavedTgSndAreaFlags = flags; + } + } +} + +void dSndStateMgr_c::calcFilters() { + dCamera_c *cam = dScGame_c::getCamera(0); + if (cam != nullptr && !checkFlag0x258(0x2)) { + if (cam->isUnderwater()) { + if (!checkFlag0x258(0x1)) { + resetFlag0x258(); + onFlag0x258(1); + setFiltersIfUnderwater(); + } + f32 depth = cam->getUnderwaterDepth(); + dSndAreaSoundEffectMgr_c::GetInstance()->holdInWaterLvSound(depth); + f32 maxDepth = isInStage("F103") ? 5000.0f : 1000.0f; + f32 unk = isInStage("F103") ? 0.5f : 0.3f; + if (depth < maxDepth) { + f32 tmp = (1.0f - unk); + f32 tmp2 = (depth / maxDepth); + unk = 1.0f - tmp2 * tmp; + } + dSndBgmMgr_c::GetInstance()->updateField_0x2F4(unk); + } else { + if (checkFlag0x258(0x1)) { + offFlag0x258(1); + resetLpfAndFxSend(); + } + + if (dAcPy_c::GetLink()->checkActionFlagsCont(0x400000)) { + if (!checkFlag0x258(0x4)) { + resetFlag0x258(); + onFlag0x258(0x4); + setBgmAndStageEffectLpf(); + dSndBgmMgr_c::GetInstance()->setField_0x307(0); + } + } else { + if (checkFlag0x258(0x4)) { + offFlag0x258(0x4); + resetBgmAndStageEffectLpf(); + if (dSndBgmMgr_c::GetInstance()->getField_0x308() != 0) { + dSndBgmMgr_c::GetInstance()->setField_0x307(1); + } + } + } + } + } +} + +void dSndStateMgr_c::setFiltersIfUnderwater() { + dCamera_c *cam = dScGame_c::getCamera(0); + if (cam == nullptr || cam->isUnderwater()) { + setBgmLpfAndFxSendIfUnderwater(); + for (u32 id = dSndPlayerMgr_c::PLAYER_LINK_BODY; id < dSndPlayerMgr_c::PLAYER_LINK_EQUIPMENT + 1; id++) { + dSndControlPlayerMgr_c::GetInstance()->setLpfFreq(id, -0.45f, 15); + } + + for (u32 id = dSndPlayerMgr_c::PLAYER_ENEMY; id < dSndPlayerMgr_c::PLAYER_AREA + 1; id++) { + dSndControlPlayerMgr_c::GetInstance()->setLpfFreq(id, -0.41f, 15); + } + + dSndControlPlayerMgr_c::GetInstance()->setLpfFreq(dSndPlayerMgr_c::PLAYER_AREA_IN_WATER_LV, -0.3f, 15); + + for (u32 id = dSndPlayerMgr_c::PLAYER_ENEMY; id <= dSndPlayerMgr_c::PLAYER_AREA_IN_WATER_LV; id++) { + dSndControlPlayerMgr_c::GetInstance()->setFxSend(id, 0.14f, 15); + } + } +} + +void dSndStateMgr_c::setBgmLpfAndFxSendIfUnderwater() { + dCamera_c *cam = dScGame_c::getCamera(0); + if (cam == nullptr || cam->isUnderwater()) { + for (u32 id = dSndPlayerMgr_c::PLAYER_BGM; id < dSndPlayerMgr_c::PLAYER_BGM_BATTLE + 1; id++) { + dSndControlPlayerMgr_c::GetInstance()->setLpfFreq(id, -0.55f, 15); + dSndControlPlayerMgr_c::GetInstance()->setFxSend(id, 0.2f, 15); + } + } +} + +void dSndStateMgr_c::resetLpfAndFxSend() { + resetBgmLpfAndFxSend(); + for (u32 id = dSndPlayerMgr_c::PLAYER_LINK_BODY; id <= dSndPlayerMgr_c::PLAYER_AREA_IN_WATER_LV; id++) { + dSndControlPlayerMgr_c::GetInstance()->setLpfFreq(id, 0.0f, 15); + } + + for (u32 id = dSndPlayerMgr_c::PLAYER_LINK_BODY; id <= dSndPlayerMgr_c::PLAYER_AREA_IN_WATER_LV; id++) { + dSndControlPlayerMgr_c::GetInstance()->setFxSend(id, 0.0f, 15); + } +} + +void dSndStateMgr_c::resetBgmLpfAndFxSend() { + for (u32 id = dSndPlayerMgr_c::PLAYER_BGM; id < dSndPlayerMgr_c::PLAYER_BGM_BATTLE + 1; id++) { + dSndControlPlayerMgr_c::GetInstance()->setLpfFreq(id, 0.0f, 15); + dSndControlPlayerMgr_c::GetInstance()->setFxSend(id, 0.0f, 15); + } +} + +void dSndStateMgr_c::setBgmAndStageEffectLpf() { + setBgmLpf(); + for (u32 id = dSndPlayerMgr_c::PLAYER_TG_SOUND; id < dSndPlayerMgr_c::PLAYER_AREA + 1; id++) { + dSndControlPlayerMgr_c::GetInstance()->setLpfFreq(id, -0.55f, 15); + } +} + +void dSndStateMgr_c::setBgmLpf() { + setBgmLpf(15); +} + +void dSndStateMgr_c::setBgmLpf(s32 fadeFrames) { + for (u32 id = dSndPlayerMgr_c::PLAYER_BGM; id < dSndPlayerMgr_c::PLAYER_BGM_BATTLE + 1; id++) { + dSndControlPlayerMgr_c::GetInstance()->setLpfFreq(id, -0.55f, fadeFrames); + } +} + +void dSndStateMgr_c::resetBgmAndStageEffectLpf() { + resetBgmLpf(); + for (u32 id = dSndPlayerMgr_c::PLAYER_TG_SOUND; id < dSndPlayerMgr_c::PLAYER_AREA + 1; id++) { + dSndControlPlayerMgr_c::GetInstance()->setLpfFreq(id, 0.0f, 15); + } +} + +void dSndStateMgr_c::resetBgmLpf() { + for (u32 id = dSndPlayerMgr_c::PLAYER_BGM; id < dSndPlayerMgr_c::PLAYER_BGM_BATTLE + 1; id++) { + dSndControlPlayerMgr_c::GetInstance()->setLpfFreq(id, 0.0f, 15); + } +} + +void dSndStateMgr_c::calcFxSend3D() { + if (mFxSend3D > mFxSend3DTarget) { + mFxSend3D -= 0.02f; + if (mFxSend3D < mFxSend3DTarget) { + mFxSend3D = mFxSend3DTarget; + } + } else if (mFxSend3D < mFxSend3DTarget) { + mFxSend3D += 0.02f; + if (mFxSend3D > mFxSend3DTarget) { + mFxSend3D = mFxSend3DTarget; + } + } +} + +void dSndStateMgr_c::setFxSend3DTarget() { + // TODO - weird control flow + f32 target = mFxSend3DDefault; + if (mFxSend3DNext > 0.0f) { + target = mFxSend3DNext; + } else if (mFxSend3DOverride > 0.0f) { + target = mFxSend3DOverride; + } + + if (target < 0.02f) { + target = 0.02f; + } else if (target > 0.3f) { + target = 0.3f; + } + mFxSend3DTarget = target; +} + +f32 dSndStateMgr_c::getUserParamVolume(u32 userParam) { + s32 bit = 31; + for (int i = 0; i < 4; i++) { + if (((1 << bit) & userParam) != 0) { + switch (bit) { + case 31: return 0.3f; + case 30: return 0.2f; + case 29: return 0.1f; + case 28: return 0.02f; + } + } + + bit--; + } + return 0.0f; +} + +const char *dSndStateMgr_c::getStageName(s32 id) { + if (id >= SND_STAGE_MAX) { + return "NULL"; + } + return dSndStageInfo::sInfos[id].stageName; +} + +const char *dSndStateMgr_c::getStageName4(s32 id) { + if (id >= SND_STAGE_MAX) { + return "NULL"; + } + return dSndStageInfo::sInfos[getSndStageId4(id)].stageName; +} + +const char *dSndStateMgr_c::getCurrentStageName4() { + return getStageName(dSndStageInfo::sInfos[mStageId].unk4); +} + +s32 dSndStateMgr_c::getSndStageId(const char *stageName, s32 layer) { + if (stageName != nullptr) { + for (s32 idx = 0; idx < dSndStageInfo::sNumStageInfos; idx++) { + if (streq(stageName, dSndStageInfo::sInfos[idx].stageName)) { + if (dSndStageInfo::sInfos[idx].layer == -1) { + return dSndStageInfo::sInfos[idx].unk1; + } + if (dSndStageInfo::sInfos[idx].layer == layer) { + return dSndStageInfo::sInfos[idx].unk1; + } + } + } + } + + return SND_STAGE_MAX; +} + +s32 dSndStateMgr_c::getSndStageId3(const char *stageName, s32 layer) { + if (stageName != nullptr) { + for (s32 idx = 0; idx < dSndStageInfo::sNumStageInfos; idx++) { + if (streq(stageName, dSndStageInfo::sInfos[idx].stageName)) { + if (dSndStageInfo::sInfos[idx].layer == -1 || dSndStageInfo::sInfos[idx].layer == layer) { + return dSndStageInfo::sInfos[idx].unk3; + } + } + } + } + + return SND_STAGE_MAX; +} + +s32 dSndStateMgr_c::getSndStageId4(const char *stageName, s32 layer) { + if (stageName != nullptr) { + for (s32 idx = 0; idx < dSndStageInfo::sNumStageInfos; idx++) { + if (streq(stageName, dSndStageInfo::sInfos[idx].stageName)) { + if (dSndStageInfo::sInfos[idx].layer == -1 || dSndStageInfo::sInfos[idx].layer == layer) { + return dSndStageInfo::sInfos[idx].unk4; + } + } + } + } + + return SND_STAGE_MAX; +} + +s32 dSndStateMgr_c::getSndStageId2(s32 id) { + if (id >= SND_STAGE_MAX) { + return SND_STAGE_MAX; + } + return dSndStageInfo::sInfos[id].unk2; +} + +s32 dSndStateMgr_c::getSndStageId4(s32 id) { + if (id >= SND_STAGE_MAX) { + return SND_STAGE_MAX; + } + return dSndStageInfo::sInfos[id].unk4; +} + +s32 dSndStateMgr_c::getNextSndStageId(s32 id) { + return getSndStageId(dScGame_c::nextSpawnInfo.getStageName(), dScGame_c::nextSpawnInfo.layer); +} + +bool dSndStateMgr_c::specialLayerVersionExists(const char *stageName, s32 layer) { + if (stageName != nullptr && layer > 0) { + return getSndStageId(stageName, layer) != getSndStageId(stageName, 0); + } + + return false; +} + +u32 dSndStateMgr_c::getSoundIdForStageAndLayer(SoundIdLookup_e lookup, const char *stageName, s32 layer, s32 stageId) { + // Ternary causes regswaps... + const char *prefix = "BGM_"; + if (lookup == LOOKUP_SE_A) { + prefix = "SE_A_"; + } + SizedString<64> label; + + u32 soundId = -1; + s32 round = 3; + + bool hasSpecialLayerVersion = false; + if (layer > 0) { + hasSpecialLayerVersion = specialLayerVersionExists(stageName, layer); + } + + if (hasSpecialLayerVersion) { + label.sprintf("%s%s_L%d", prefix, stageName, layer); + } else if (layer > 0) { + label.sprintf("%s%s_L%d", prefix, stageName, layer); + } else { + label.sprintf("%s%s", prefix, stageName); + // We didn't bother with a _L layer variant, so we're going + // in with the base variant + round = 2; + } + + while (round > 0) { + if (lookup == LOOKUP_BGM_MAIN) { + label += "_MAIN"; + } + + soundId = dSndPlayerMgr_c::GetInstance()->convertLabelStringToSoundId(label); + if (soundId != -1) { + break; + } + + if (round == 3) { + // If _L layer variant didn't exist, try the one without a layer... + label.sprintf("%s%s", prefix, stageName); + } else if (round == 2) { + if (lookup == LOOKUP_BGM) { + // If the one without a layer doesn't exist, continue with the one referenced + // in field 3, unless it's the same as the original one + s32 otherStageId = getSndStageId3(stageName, layer); + if (stageId != otherStageId) { + label.sprintf("%s%s", prefix, getStageName(otherStageId)); + } else { + // break to prevent infinite loop + round = 0; + } + } else if (lookup == LOOKUP_SE_A) { + // If the one without a layer doesn't exist, continue with the one referenced + // in field 4, unless it's the same as the original one + s32 otherStageId = getSndStageId4(stageName, layer); + if (stageId != otherStageId) { + label.sprintf("%s%s", prefix, getStageName(otherStageId)); + } else { + // break to prevent infinite loop + break; + } + } else { + break; + } + } + + round--; + } + + return soundId; +} diff --git a/src/d/snd/mgr/d_snd_mgr_unk_11.cpp b/src/d/snd/mgr/d_snd_mgr_unk_11.cpp deleted file mode 100644 index 5ad3cddc..00000000 --- a/src/d/snd/mgr/d_snd_mgr_unk_11.cpp +++ /dev/null @@ -1,36 +0,0 @@ - -#include "d/snd/d_snd_util.h" - -class SndClass80399a40 { -public: - SndClass80399a40(); - virtual ~SndClass80399a40() {} - - /* 0x04 */ u8 _0x04[0x18 - 0x04]; -}; - -// This is a test for SndMgrDisposer, since this -// class has the disposer at 0x18, which is interesting - -class SndMgr80399c20; - -extern template class SndMgrDisposer; - -class SndMgr80399c20 : SndClass80399a40 { -public: - SndMgrDisposer *GetDisposer() { - return &mDisposer; - } - - static SndMgr80399c20 *GetInstance() { - return sInstance; - } - - static SndMgr80399c20 *sInstance; - static SndMgrDisposer *sDisposer; - -private: - SndMgrDisposer mDisposer; -}; - -template class SndMgrDisposer; diff --git a/src/egg/audio/eggAudioMgr.cpp b/src/egg/audio/eggAudioMgr.cpp index 9c98a801..6dd7350e 100644 --- a/src/egg/audio/eggAudioMgr.cpp +++ b/src/egg/audio/eggAudioMgr.cpp @@ -62,7 +62,7 @@ void SimpleAudioMgr::initialize(EGG::IAudioMgr::Arg *arg) { void SimpleAudioMgr::calc() { AudioSystem::calc(); - if (AudioSystem::isField0x04Eq2()) { + if (AudioSystem::isReset()) { ArcPlayer::stopAllSound(); } ArcPlayer::calc(); diff --git a/src/egg/audio/eggAudioSystem.cpp b/src/egg/audio/eggAudioSystem.cpp index 8687eb62..844853ab 100644 --- a/src/egg/audio/eggAudioSystem.cpp +++ b/src/egg/audio/eggAudioSystem.cpp @@ -8,47 +8,47 @@ namespace EGG { AudioSystem *AudioSystem::sInstanse; AudioSystem::AudioSystem() { - field_0x00 = 1.0f; - field_0x08 = 0; - field_0x04 = 0; + mSavedMasterVolume = 1.0f; + mShutdownStatus = 0; + mResetStatus = 0; sInstanse = this; } AudioSystem::~AudioSystem() {} -void AudioSystem::fn_804B7270(s32 frame) { - if (field_0x08 == 0 && field_0x04 == 0) { - field_0x00 = nw4r::snd::SoundSystem::GetMasterVolume(); - nw4r::snd::SoundSystem::SetMasterVolume(0.0f, frame * 16.666667f); - field_0x04 = 1; +void AudioSystem::reset(s32 ms) { + if (mShutdownStatus == 0 && mResetStatus == 0) { + mSavedMasterVolume = nw4r::snd::SoundSystem::GetMasterVolume(); + nw4r::snd::SoundSystem::SetMasterVolume(0.0f, ms * (1.0f / 60.f * 1000.0f)); + mResetStatus = 1; } } -void AudioSystem::fn_804B7370() { - if (field_0x08 == 0) { - nw4r::snd::SoundSystem::SetMasterVolume(field_0x00, 0); - field_0x04 = 0; +void AudioSystem::recoverReset() { + if (mShutdownStatus == 0) { + nw4r::snd::SoundSystem::SetMasterVolume(mSavedMasterVolume, 0); + mResetStatus = 0; } } -void AudioSystem::fn_804B73D0(s32 frame) { - if (field_0x08 == 0) { - field_0x08 = 1; - nw4r::snd::SoundSystem::SetMasterVolume(0.0f, frame * 16.666667f); +void AudioSystem::shutdown(s32 ms) { + if (mShutdownStatus == 0) { + mShutdownStatus = 1; + nw4r::snd::SoundSystem::SetMasterVolume(0.0f, ms * (1.0f / 60.f * 1000.0f)); } } void AudioSystem::calc() { f32 masterVolume = nw4r::snd::SoundSystem::GetMasterVolume(); - if (field_0x08 == 1 && masterVolume == 0.0f) { + if (mShutdownStatus == 1 && masterVolume == 0.0f) { nw4r::snd::SoundSystem::PrepareReset(); nw4r::snd::SoundSystem::WaitForResetReady(); - field_0x08 = 2; + mShutdownStatus = 2; } - if (field_0x08 != 2 && field_0x04 == 1 && masterVolume == 0.0f) { - field_0x04 = 2; + if (mShutdownStatus != 2 && mResetStatus == 1 && masterVolume == 0.0f) { + mResetStatus = 2; } } diff --git a/src/nw4r/snd/snd_AnimSound.cpp b/src/nw4r/snd/snd_AnimSound.cpp index 91f80368..05ec3ef8 100644 --- a/src/nw4r/snd/snd_AnimSound.cpp +++ b/src/nw4r/snd/snd_AnimSound.cpp @@ -19,11 +19,11 @@ AnimSoundImpl::AnimSoundImpl(SoundStartable &startable, AnimEventPlayer *player, : mStartable(startable), mpSounds(player), mNumSounds(numSounds), - field_0x0C(0.0f), + mCurrentFrame(0.0f), mIsActive(false), - field_0x19(0), - field_0x1A(0), - field_0x1C(0), + mNeedFrameReset(false), + mNeedTriggerEventsAtCurrentFrame(false), + mCycleCounter(0), mCallback(NULL), field_0x28(1.0f) {} @@ -37,10 +37,10 @@ bool AnimSoundImpl::Setup(const void *data) { return false; } - field_0x19 = 1; + mNeedFrameReset = true; mIsActive = true; - field_0x0C = 0.0f; - field_0x1C = 0; + mCurrentFrame = 0.0f; + mCycleCounter = 0; return true; } @@ -58,10 +58,10 @@ void AnimSoundImpl::Shutdown() { } void AnimSoundImpl::ResetFrame(f32 f, int i) { - field_0x0C = f; - field_0x1C = i; - field_0x1A = 1; - field_0x19 = 0; + mCurrentFrame = f; + mCycleCounter = i; + mNeedTriggerEventsAtCurrentFrame = true; + mNeedFrameReset = false; } void AnimSoundImpl::UpdateFrame(f32 frame, PlayDirection dir) { @@ -69,48 +69,48 @@ void AnimSoundImpl::UpdateFrame(f32 frame, PlayDirection dir) { mpSounds[i].UpdateFrame(); } - if (field_0x19) { + if (mNeedFrameReset) { if (dir == FORWARD) { ResetFrame(0.0f, 0); } else { u32 duration = mReader.GetAnimDuration(); ResetFrame(duration - 1.0f, 0); } - field_0x19 = false; + mNeedFrameReset = false; } - mVariableValue = (frame - field_0x0C) / field_0x28; + mVariableValue = (frame - mCurrentFrame) / field_0x28; if (dir == FORWARD) { UpdateForward(frame); } else { UpdateBackward(frame); } - field_0x0C = frame; - field_0x1A = false; + mCurrentFrame = frame; + mNeedTriggerEventsAtCurrentFrame = false; } void AnimSoundImpl::UpdateForward(f32 frame) { - s32 duration = std::floorf(field_0x0C); - s32 iFrame = std::floorf(frame); + s32 currFrameFloor = std::floorf(mCurrentFrame); + s32 targetFrame = std::floorf(frame); - if (field_0x1A && field_0x0C == duration) { - duration -= 1; + if (mNeedTriggerEventsAtCurrentFrame && mCurrentFrame == currFrameFloor) { + currFrameFloor -= 1; } - if (duration == iFrame) { + if (currFrameFloor == targetFrame) { return; } - s32 loopFrame = duration + 1; + s32 loopFrame = currFrameFloor + 1; while (true) { if (loopFrame == mReader.GetAnimDuration()) { loopFrame -= mReader.GetAnimDuration(); - field_0x1C++; + mCycleCounter++; } UpdateOneFrame(loopFrame, FORWARD); - if (loopFrame == iFrame) { + if (loopFrame == targetFrame) { break; } loopFrame++; @@ -118,35 +118,35 @@ void AnimSoundImpl::UpdateForward(f32 frame) { } void AnimSoundImpl::UpdateBackward(f32 frame) { - s32 duration = std::ceilf(field_0x0C); - s32 iFrame = std::ceilf(frame); + s32 currFrameCeil = std::ceilf(mCurrentFrame); + s32 targetFrame = std::ceilf(frame); - if (duration >= mReader.GetAnimDuration()) { - duration -= mReader.GetAnimDuration(); + if (currFrameCeil >= mReader.GetAnimDuration()) { + currFrameCeil -= mReader.GetAnimDuration(); } - if (iFrame >= mReader.GetAnimDuration()) { - iFrame -= mReader.GetAnimDuration(); + if (targetFrame >= mReader.GetAnimDuration()) { + targetFrame -= mReader.GetAnimDuration(); } - if (field_0x1A && field_0x0C == duration) { - duration += 1; + if (mNeedTriggerEventsAtCurrentFrame && mCurrentFrame == currFrameCeil) { + currFrameCeil += 1; } - if (duration == iFrame) { + if (currFrameCeil == targetFrame) { return; } - s32 loopFrame = duration - 1; + s32 loopFrame = currFrameCeil - 1; while (true) { if (loopFrame == -1) { loopFrame += mReader.GetAnimDuration(); - field_0x1C--; + mCycleCounter--; } UpdateOneFrame(loopFrame, BACKWARD); - if (loopFrame == iFrame) { + if (loopFrame == targetFrame) { break; } loopFrame--; @@ -191,7 +191,7 @@ void AnimSoundImpl::UpdateTrigger(const AnimEventRef *ref, s32 frame, PlayDirect if (ref->mInfo.field_0x00 == frame) { StopEvent(event); if (mCallback != NULL) { - (mCallback)(0, frame, event->GetSoundLabel(), event->field_0x1C, field_0x24); + (mCallback)(0, frame, event->GetSoundLabel(), event->field_0x1C, mUserData); } StartEvent(event, true); } @@ -199,7 +199,7 @@ void AnimSoundImpl::UpdateTrigger(const AnimEventRef *ref, s32 frame, PlayDirect if (ref->mInfo.field_0x00 == frame) { StopEvent(event); if (mCallback != NULL) { - (mCallback)(0, frame, event->GetSoundLabel(), event->field_0x1C, field_0x24); + (mCallback)(0, frame, event->GetSoundLabel(), event->field_0x1C, mUserData); } StartEvent(event, true); } @@ -213,7 +213,7 @@ void AnimSoundImpl::UpdateTrigger(const AnimEventRef *ref, s32 frame, PlayDirect if (u == frame) { if (mCallback != NULL) { - (mCallback)(1, frame, event->GetSoundLabel(), event->field_0x1C, field_0x24); + (mCallback)(1, frame, event->GetSoundLabel(), event->field_0x1C, mUserData); } StopEvent(event); } @@ -233,11 +233,11 @@ void AnimSoundImpl::UpdateForwardRange(const AnimEventRef *ref, s32 frame) { if (ref->mInfo.flags & 4) { if (ref->mInfo.field_0x04 == frame && mCallback != NULL) { - (mCallback)(3, frame, event->GetSoundLabel(), event->field_0x1C, field_0x24); + (mCallback)(3, frame, event->GetSoundLabel(), event->field_0x1C, mUserData); } - if (field_0x1C < ref->mInfo.field_0x09) { + if (mCycleCounter < ref->mInfo.field_0x09) { HoldEvent(event, true); - } else if (field_0x1C == ref->mInfo.field_0x09) { + } else if (mCycleCounter == ref->mInfo.field_0x09) { if (frame < ref->mInfo.field_0x04) { HoldEvent(event, true); } else { @@ -246,19 +246,19 @@ void AnimSoundImpl::UpdateForwardRange(const AnimEventRef *ref, s32 frame) { } } else if ((ref->mInfo.flags & 2)) { if (ref->mInfo.field_0x00 == frame && mCallback != NULL) { - (mCallback)(2, frame, event->GetSoundLabel(), event->field_0x1C, field_0x24); + (mCallback)(2, frame, event->GetSoundLabel(), event->field_0x1C, mUserData); } - if (field_0x1C > ref->mInfo.field_0x09) { + if (mCycleCounter > ref->mInfo.field_0x09) { HoldEvent(event, true); - } else if (field_0x1C == ref->mInfo.field_0x09 && ref->mInfo.field_0x00 <= frame) { + } else if (mCycleCounter == ref->mInfo.field_0x09 && ref->mInfo.field_0x00 <= frame) { HoldEvent(event, true); } } else { if (ref->mInfo.field_0x00 == frame && mCallback != NULL) { - (mCallback)(2, frame, event->GetSoundLabel(), event->field_0x1C, field_0x24); + (mCallback)(2, frame, event->GetSoundLabel(), event->field_0x1C, mUserData); } if (ref->mInfo.field_0x04 == frame && mCallback != NULL) { - (mCallback)(3, frame, event->GetSoundLabel(), event->field_0x1C, field_0x24); + (mCallback)(3, frame, event->GetSoundLabel(), event->field_0x1C, mUserData); } if (ref->mInfo.field_0x00 <= frame && frame < ref->mInfo.field_0x04) { HoldEvent(event, true); @@ -281,20 +281,20 @@ void AnimSoundImpl::UpdateBackwardRange(const AnimEventRef *ref, s32 frame) { if (ref->mInfo.flags & 4) { if (ref->mInfo.field_0x04 == frame && mCallback != NULL) { - (mCallback)(2, frame, event->GetSoundLabel(), event->field_0x1C, field_0x24); + (mCallback)(2, frame, event->GetSoundLabel(), event->field_0x1C, mUserData); } - if (field_0x1C < ref->mInfo.field_0x09) { + if (mCycleCounter < ref->mInfo.field_0x09) { HoldEvent(event, true); - } else if (field_0x1C == ref->mInfo.field_0x09 && frame <= ref->mInfo.field_0x04) { + } else if (mCycleCounter == ref->mInfo.field_0x09 && frame <= ref->mInfo.field_0x04) { HoldEvent(event, true); } } else if ((ref->mInfo.flags & 2)) { if (ref->mInfo.field_0x00 == frame && mCallback != NULL) { - (mCallback)(3, frame, event->GetSoundLabel(), event->field_0x1C, field_0x24); + (mCallback)(3, frame, event->GetSoundLabel(), event->field_0x1C, mUserData); } - if (field_0x1C > ref->mInfo.field_0x09) { + if (mCycleCounter > ref->mInfo.field_0x09) { HoldEvent(event, true); - } else if (field_0x1C == ref->mInfo.field_0x09) { + } else if (mCycleCounter == ref->mInfo.field_0x09) { if (ref->mInfo.field_0x00 < frame) { HoldEvent(event, true); } else { @@ -303,10 +303,10 @@ void AnimSoundImpl::UpdateBackwardRange(const AnimEventRef *ref, s32 frame) { } } else { if (ref->mInfo.field_0x00 == frame && mCallback != NULL) { - (mCallback)(3, frame, event->GetSoundLabel(), event->field_0x1C, field_0x24); + (mCallback)(3, frame, event->GetSoundLabel(), event->field_0x1C, mUserData); } if (ref->mInfo.field_0x04 == frame && mCallback != NULL) { - (mCallback)(2, frame, event->GetSoundLabel(), event->field_0x1C, field_0x24); + (mCallback)(2, frame, event->GetSoundLabel(), event->field_0x1C, mUserData); } if (ref->mInfo.field_0x00 < frame && frame <= ref->mInfo.field_0x04) { HoldEvent(event, true); @@ -388,7 +388,7 @@ bool AnimSoundImpl::IsPlayableLoopCount(const nw4r::snd::detail::AnimEventFrameI return true; } int i1 = ut::Max((int)ref.field_0x09, 0); - int i2 = ut::Abs(field_0x1C); + int i2 = ut::Abs(mCycleCounter); if (ref.field_0x0A == 0) { if (i2 < i1) { return false; diff --git a/src/nw4r/snd/snd_BasicPlayer.cpp b/src/nw4r/snd/snd_BasicPlayer.cpp index 4045f4b8..6b8cba05 100644 --- a/src/nw4r/snd/snd_BasicPlayer.cpp +++ b/src/nw4r/snd/snd_BasicPlayer.cpp @@ -32,7 +32,7 @@ void PlayerParamSet::Init() biquadType = 0; biquadValue = 0.0f; remoteFilter = 0; - outputLineFlag = 1; + outputLineFlag = OUTPUT_LINE_MAIN; mainOutVolume = 1.0f; mainSend = 0.0f; panMode = PAN_MODE_DUAL; diff --git a/src/nw4r/snd/snd_BasicSound.cpp b/src/nw4r/snd/snd_BasicSound.cpp index d6e29c09..f2b7931b 100644 --- a/src/nw4r/snd/snd_BasicSound.cpp +++ b/src/nw4r/snd/snd_BasicSound.cpp @@ -100,7 +100,7 @@ void BasicSound::InitParam() mLpfFreq = 0.0f; mBiquadFilterType = 0; mBiquadFilterValue = 0.0f; - mOutputLineFlag = mSoundPlayer ? mSoundPlayer->GetDefaultOutputLine() : 1; + mOutputLineFlag = mSoundPlayer ? mSoundPlayer->GetDefaultOutputLine() : OUTPUT_LINE_MAIN; mMainOutVolume = 1.0f; mMainSend = 0.0f; // clang-format on diff --git a/src/nw4r/snd/snd_Channel.cpp b/src/nw4r/snd/snd_Channel.cpp index 3d3456d8..1c92348b 100644 --- a/src/nw4r/snd/snd_Channel.cpp +++ b/src/nw4r/snd/snd_Channel.cpp @@ -143,7 +143,7 @@ void Channel::InitParam(Callback *callback, u32 callbackData) mBiquadType = 0; mBiquadValue = 0.0f; mRemoteFilter = 0; - mOutputLineFlag = 1; + mOutputLineFlag = OUTPUT_LINE_MAIN; mMainOutVolume = 1.0f; mMainSend = 0.0f; diff --git a/src/nw4r/snd/snd_SoundPlayer.cpp b/src/nw4r/snd/snd_SoundPlayer.cpp index 112135ec..a991dad2 100644 --- a/src/nw4r/snd/snd_SoundPlayer.cpp +++ b/src/nw4r/snd/snd_SoundPlayer.cpp @@ -34,7 +34,7 @@ SoundPlayer::SoundPlayer() : mPlayableLimit (INT_MAX), mVolume (1.0f), mLpfFreq (0.0f), - mOutputLineFlag (1), + mOutputLineFlag (OUTPUT_LINE_MAIN), mMainOutVolume (1.0f), mBiquadType (0), mBiquadValue (0.0f), diff --git a/src/nw4r/snd/snd_Voice.cpp b/src/nw4r/snd/snd_Voice.cpp index b422b842..dd19828c 100644 --- a/src/nw4r/snd/snd_Voice.cpp +++ b/src/nw4r/snd/snd_Voice.cpp @@ -129,7 +129,7 @@ void Voice::InitParam(int channelCount, int voiceOutCount, Callback *callback, mBiquadValue = 0.0f; mPan = 0.0f; mSurroundPan = 0.0f; - mOutputLineFlag = 1; + mOutputLineFlag = OUTPUT_LINE_MAIN; mMainOutVolume = 1.0f; mMainSend = 1.0f; @@ -873,7 +873,7 @@ bool Voice::CalcAxMix() CalcMixParam(channelIndex, voiceOutIndex, &mix, &rmtmix); nextUpdateFlag |= axVoice->SetMix(mix); - if (mOutputLineFlag == 0 || mOutputLineFlag == 1) { + if (mOutputLineFlag == 0 || mOutputLineFlag == OUTPUT_LINE_MAIN) { axVoice->EnableRemote(false); } else { axVoice->EnableRemote(true); @@ -1077,7 +1077,7 @@ void Voice::CalcMixParam(int channelIndex, int voiceOutIndex, f32 fxSendB = 0.0f; f32 fxSendC = 0.0f; - if (mOutputLineFlag & 1) // OUTPUT_LINE_MAIN + if (mOutputLineFlag & OUTPUT_LINE_MAIN) { mainVolume = mMainOutVolume; mainSend = mMainSend; diff --git a/src/toBeSorted/actor_info.cpp b/src/toBeSorted/actor_info.cpp index 341d7775..ec4a11ad 100644 --- a/src/toBeSorted/actor_info.cpp +++ b/src/toBeSorted/actor_info.cpp @@ -10,783 +10,783 @@ #pragma readonly_strings on // sorted alphabetically to facilitate binary search static const ActorInfo sInfos[] = { - { "$act01", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 1}, - { "$act02", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 2}, - { "$act03", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 3}, - { "$act04", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 4}, - { "$act05", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 5}, - { "$act06", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 6}, - { "$act07", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 7}, - { "$act08", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 8}, - { "$act09", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 9}, - { "$act10", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 10}, - { "$act11", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 11}, - { "$act12", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 12}, - { "$act13", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 13}, - { "$act14", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 14}, - { "$act15", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 15}, - { "$act16", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 16}, - { "$act17", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 17}, - { "$act18", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 18}, - { "$act19", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 19}, - { "$act20", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 20}, - { "$act21", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 21}, - { "$act22", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 22}, - { "$act23", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 23}, - { "$act24", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 24}, - { "$act25", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 25}, - { "$act26", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 26}, - { "$act27", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 27}, - { "$act28", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 28}, - { "$act29", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 29}, - { "$act30", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 30}, - { "$act31", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 31}, - { "$act32", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 32}, - { "$act33", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 33}, - { "$act34", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 34}, - { "$act35", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 35}, - { "$act36", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 36}, - { "$act37", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 37}, - { "$act38", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 38}, - { "$act39", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 39}, - { "$act40", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 40}, - { "$act41", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 41}, - { "$act42", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 42}, - { "$act43", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 43}, - { "$act44", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 44}, - { "$act45", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 45}, - { "$act46", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 46}, - { "$act47", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 47}, - { "$act48", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 48}, - { "$act49", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 49}, - { "$act50", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 50}, - { "$act51", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 51}, - { "$act52", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 52}, - { "$act53", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 53}, - { "$act54", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 54}, - { "$act55", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 55}, - { "$act56", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 56}, - { "$act57", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 57}, - { "$act58", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 58}, - { "$act59", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 59}, - { "$act60", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 60}, - { "$act61", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 61}, - { "$act62", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 62}, - { "$act63", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 63}, - { "$snd", fProfile::JSTUDIO_SYSOBJ, fProfile::JSTUDIO_SYSOBJ, 0xFFFF, 0xFF, 1}, - { "$sys", fProfile::JSTUDIO_SYSOBJ, fProfile::JSTUDIO_SYSOBJ, 0xFFFF, 0xFF, 0}, - { "AFlw", fProfile::OBJ_FLOWER_ANCIENT, fProfile::OBJ_FLOWER_ANCIENT, 0xFFFF, SND_SOURCE_ITEM, 0}, - { "ActTag", fProfile::ACTION_TAG, fProfile::ACTION_TAG, 0xFFFF, 0xFF, 0}, - { "Amber", fProfile::OBJ_AMBER, fProfile::OBJ_AMBER, 0xFFFF, 0xFF, 0}, - {"AncJwls", fProfile::OBJ_ANCIENT_JEWELS, fProfile::OBJ_ANCIENT_JEWELS, 0xFFFF, SND_SOURCE_ITEM, 0}, - { "Ant", fProfile::INSECT_ANT, fProfile::INSECT_ANT, 774, SND_SOURCE_INSECT, 0}, - {"ApBridg", fProfile::OBJ_APPEAR_BRIDGE, fProfile::OBJ_APPEAR_BRIDGE, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "Arrow", fProfile::ARROW, fProfile::ARROW, 0xFFFF, SND_SOURCE_ARROW, 0}, - {"ArrowSW", fProfile::OBJ_ARROW_SWITCH, fProfile::OBJ_ARROW_SWITCH, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "AsuArm", fProfile::ASURA_ARM, fProfile::ASURA_ARM, 0xFFFF, 15, 0}, - { "AsuFoo", fProfile::ASURA_FOOT, fProfile::ASURA_FOOT, 0xFFFF, 15, 0}, - { "AsuraB", fProfile::ASURA_BULLET, fProfile::ASURA_BULLET, 0xFFFF, SND_SOURCE_BULLET, 0}, - { "AsuraP", fProfile::ASURA_PILLAR, fProfile::ASURA_PILLAR, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "AsuraS", fProfile::ASURA_SWORD, fProfile::ASURA_SWORD, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "AttTag", fProfile::ATT_TAG, fProfile::ATT_TAG, 0xFFFF, 0xFF, 0}, - {"AutoMes", fProfile::TAG_AUTO_MESSAGE, fProfile::TAG_AUTO_MESSAGE, 0xFFFF, 0xFF, 0}, - {"B300Snd", fProfile::OBJ_B300_SAND, fProfile::OBJ_B300_SAND, 0xFFFF, 0xFF, 0}, - { "BAsura", fProfile::B_ASURA, fProfile::B_ASURA, 48, 19, 0}, - { "BBObjs", fProfile::OBJ_BB_OBJECTS, fProfile::OBJ_BB_OBJECTS, 0xFFFF, 0xFF, 0}, - {"BBParts", fProfile::OBJ_BB_BROKEN_PARTS, fProfile::OBJ_BB_BROKEN_PARTS, 0xFFFF, 0xFF, 0}, - {"BBQuake", fProfile::T_QUAKE, fProfile::T_QUAKE, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "BBbrg", fProfile::OBJ_BB_BRIDGE, fProfile::OBJ_BB_BRIDGE, 0xFFFF, 0xFF, 0}, - {"BBigBo2", fProfile::B_BIGBOSS2, fProfile::B_BIGBOSS2, 53, SND_SOURCE_BIGBOSS, 0}, - {"BBigBo3", fProfile::B_BIGBOSS3, fProfile::B_BIGBOSS3, 54, SND_SOURCE_BIGBOSS, 0}, - {"BBigBoB", fProfile::B_BIGBOSS_BASE, fProfile::B_BIGBOSS_BASE, 0xFFFF, 0xFF, 0}, - {"BBigBos", fProfile::B_BIGBOSS, fProfile::B_BIGBOSS, 52, SND_SOURCE_BIGBOSS, 0}, - {"BBigShc", fProfile::B_BBSHWV, fProfile::B_BBSHWV, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "BBombf", fProfile::OBJ_BIGBOMB_FLOWER, fProfile::OBJ_BIGBOMB_FLOWER, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"BDrD101", fProfile::OBJ_DOOR_BOSSD101, fProfile::OBJ_DOOR_BOSSD101, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "BGh", fProfile::B_GIRAHIMU, fProfile::B_GIRAHIMU, 49, 19, 0}, - { "BGh2", fProfile::B_GIRAHIMU2, fProfile::B_GIRAHIMU2, 50, 19, 0}, - { "BGh3B", fProfile::B_GIRAHIMU3_BASE, fProfile::B_GIRAHIMU3_BASE, 0xFFFF, 0xFF, 0}, - {"BGh3Fst", fProfile::B_GIRAHIMU3_FIRST, fProfile::B_GIRAHIMU3_FIRST, 51, SND_SOURCE_GIRAHUMU_3, 0}, - {"BGh3Snd", fProfile::B_GIRAHIMU3_SECOND, fProfile::B_GIRAHIMU3_SECOND, 89, SND_SOURCE_GIRAHUMU_3, 0}, - {"BGh3Trd", fProfile::B_GIRAHIMU3_THIRD, fProfile::B_GIRAHIMU3_THIRD, 90, SND_SOURCE_GIRAHUMU_3, 0}, - { "BGhB", fProfile::B_GIRAHIMU_BASE, fProfile::B_GIRAHIMU_BASE, 0xFFFF, 0xFF, 0}, - { "BKr", fProfile::B_KR, fProfile::B_KR, 77, 22, 0}, - { "BKrA", fProfile::B_KRA, fProfile::B_KRA, 77, 15, 0}, - { "BKrH", fProfile::B_KRH, fProfile::B_KRH, 77, 15, 0}, - {"BLasBos", fProfile::B_LASTBOSS, fProfile::B_LASTBOSS, 0xFFFF, 19, 0}, - { "BMg", fProfile::B_MG, fProfile::B_MG, 10, 21, 0}, - { "BSpUp", fProfile::OBJ_BIRD_SP_UP, fProfile::OBJ_BIRD_SP_UP, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "Bamboo", fProfile::OBJ_BAMBOO, fProfile::OBJ_BAMBOO, 533, SND_SOURCE_BAMBOO, 0}, - {"BarPsTg", fProfile::TAG_BARREL_POS, fProfile::TAG_BARREL_POS, 0xFFFF, 0xFF, 0}, - { "Barrel", fProfile::OBJ_BARREL, fProfile::OBJ_BARREL, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"BarrlTg", fProfile::TAG_BARREL, fProfile::TAG_BARREL, 0xFFFF, 0xFF, 0}, - {"BcAlArr", fProfile::E_BCALARROW, fProfile::E_BCALARROW, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"BcArrow", fProfile::E_BCARROW, fProfile::E_BCARROW, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "BcZTag", fProfile::BCZ_TAG, fProfile::BCZ_TAG, 0xFFFF, 0xFF, 0}, - { "Bee", fProfile::NPC_BEE, fProfile::NPC_BEE, 776, 15, 0}, - { "Beetle", fProfile::INSECT_BEETLE, fProfile::INSECT_BEETLE, 768, SND_SOURCE_INSECT, 0}, - { "Bell", fProfile::OBJ_BELL, fProfile::OBJ_BELL, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"BeltCvr", fProfile::OBJ_BELT_CVR, fProfile::OBJ_BELT_CVR, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"BigTubo", fProfile::OBJ_TUBO_BIG, fProfile::OBJ_TUBO_BIG, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "BirdB", fProfile::AVATER_BULLET, fProfile::AVATER_BULLET, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "BirdKA", fProfile::BIRD_KOBUNA, fProfile::BIRD_KOBUNA, 0xFFFF, 43, 0}, - { "BirdKB", fProfile::BIRD_KOBUNB, fProfile::BIRD_KOBUNB, 0xFFFF, 43, 0}, - {"BirdNpc", fProfile::BIRD_NPC, fProfile::BIRD_NPC, 0xFFFF, 43, 0}, - { "BirdR", fProfile::BIRD_RIVAL, fProfile::BIRD_RIVAL, 0xFFFF, 43, 0}, - {"BirdSta", fProfile::OBJ_BIRD_STATUE, fProfile::OBJ_BIRD_STATUE, 0xFFFF, 0xFF, 0}, - { "BirdT", fProfile::BIRD_TARGET, fProfile::BIRD_TARGET, 0xFFFF, 43, 0}, - { "BirdZT", fProfile::BIRD_ZELDA_TRAINING, fProfile::BIRD_ZELDA_TRAINING, 0xFFFF, 43, 0}, - { "Blade", fProfile::OBJ_BLADE, fProfile::OBJ_BLADE, 0xFFFF, 0xFF, 0}, - {"BlkRope", fProfile::OBJ_BLOCK_ROPE, fProfile::OBJ_BLOCK_ROPE, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"BlockUg", fProfile::OBJ_BLOCK_UNDERGROUND, fProfile::OBJ_BLOCK_UNDERGROUND, 0xFFFF, 0xFF, 0}, - {"BlsRock", fProfile::OBJ_BLAST_ROCK, fProfile::OBJ_BLAST_ROCK, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "Blst", fProfile::OBJ_BALLISTA, fProfile::OBJ_BALLISTA, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "BlstF3", fProfile::OBJ_BALLISTA_F3, fProfile::OBJ_BALLISTA_F3, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "BlstH", fProfile::OBJ_BALLISTA_HANDLE, fProfile::OBJ_BALLISTA_HANDLE, 0xFFFF, 0xFF, 0}, - {"BltObsT", fProfile::TAG_BELT_OBSTACLE, fProfile::TAG_BELT_OBSTACLE, 0xFFFF, 59, 0}, - {"BlwCoal", fProfile::OBJ_BLOW_COAL, fProfile::OBJ_BLOW_COAL, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "Boat", fProfile::OBJ_BOAT, fProfile::OBJ_BOAT, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "Bomb", fProfile::BOMB, fProfile::BOMB, 0xFFFF, SND_SOURCE_BOMB, 0}, - { "Bombf", fProfile::BOMBF, fProfile::BOMBF, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "Boom", fProfile::BOOMERANG, fProfile::BOOMERANG, 0xFFFF, SND_SOURCE_BOOMERANG, 0}, - {"BoxCage", fProfile::OBJ_BOXCAGE_F300, fProfile::OBJ_BOXCAGE_F300, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "BrdMob", fProfile::BIRD_MOB, fProfile::BIRD_MOB, 0xFFFF, 0xFF, 0}, - { "BrgBn", fProfile::OBJ_BRIDGE_BONE, fProfile::OBJ_BRIDGE_BONE, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"BrgFall", fProfile::OBJ_BRIDGE_FALL, fProfile::OBJ_BRIDGE_FALL, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "BrgStp", fProfile::OBJ_BRIDGE_STEP, fProfile::OBJ_BRIDGE_STEP, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "BrgTs", fProfile::OBJ_BRIDGE_TIME, fProfile::OBJ_BRIDGE_TIME, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"BridgeB", fProfile::OBJ_BRIDGE_BUILDING, fProfile::OBJ_BRIDGE_BUILDING, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"BridgeS", fProfile::OBJ_BRIDGE_STRETCH, fProfile::OBJ_BRIDGE_STRETCH, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "Bstone", fProfile::OBJ_BSTONE, fProfile::OBJ_BSTONE, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "BtlTg", fProfile::BEETLE_TAG, fProfile::BEETLE_TAG, 0xFFFF, 0xFF, 0}, - { "BtlTgA", fProfile::BEETLE_TAG, fProfile::BEETLE_TAG, 0xFFFF, 0xFF, 1}, - { "BtlTgB", fProfile::BEETLE_TAG, fProfile::BEETLE_TAG, 0xFFFF, 0xFF, 2}, - { "BtlTgC", fProfile::BEETLE_TAG, fProfile::BEETLE_TAG, 0xFFFF, 0xFF, 3}, - { "Bubble", fProfile::OBJ_BUBBLE, fProfile::OBJ_BUBBLE, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "BulbSW", fProfile::OBJ_BULB_SWITCH, fProfile::OBJ_BULB_SWITCH, 524, SND_SOURCE_OBJECT, 0}, - { "Bullet", fProfile::COMMON_BULLET, fProfile::COMMON_BULLET, 0xFFFF, SND_SOURCE_BULLET, 0}, - {"Butrfly", fProfile::INSECT_BUTTERFLY, fProfile::INSECT_BUTTERFLY, 777, SND_SOURCE_INSECT, 0}, - { "Bvd", fProfile::B_VD, fProfile::B_VD, 65, 19, 0}, - {"CBomSld", fProfile::COL_BOMSLD, fProfile::COL_BOMSLD, 0xFFFF, 0xFF, 0}, - {"Cam2Tag", fProfile::CAMERA2_TAG, fProfile::CAMERA2_TAG, 0xFFFF, 0xFF, 0}, - { "CamTag", fProfile::CAMERA_TAG, fProfile::CAMERA_TAG, 0xFFFF, 0xFF, 0}, - { "Cannon", fProfile::OBJ_CANNON, fProfile::OBJ_CANNON, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"CannonC", fProfile::OBJ_CANNON_COVER, fProfile::OBJ_CANNON_COVER, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"Chandel", fProfile::OBJ_CHANDELIER, fProfile::OBJ_CHANDELIER, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "Char", fProfile::OBJ_CHAIR, fProfile::OBJ_CHAIR, 0xFFFF, SND_SOURCE_OBJECT, 5}, - { "CharA", fProfile::OBJ_CHAIR, fProfile::OBJ_CHAIR, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "CharB", fProfile::OBJ_CHAIR, fProfile::OBJ_CHAIR, 0xFFFF, SND_SOURCE_OBJECT, 1}, - { "CharC", fProfile::OBJ_CHAIR, fProfile::OBJ_CHAIR, 0xFFFF, SND_SOURCE_OBJECT, 2}, - { "CharD", fProfile::OBJ_CHAIR, fProfile::OBJ_CHAIR, 0xFFFF, SND_SOURCE_OBJECT, 3}, - { "CharE", fProfile::OBJ_CHAIR, fProfile::OBJ_CHAIR, 0xFFFF, SND_SOURCE_OBJECT, 4}, - { "Cicada", fProfile::INSECT_CICADA, fProfile::INSECT_CICADA, 770, SND_SOURCE_INSECT, 0}, - { "City", fProfile::OBJ_CITY, fProfile::OBJ_CITY, 0xFFFF, 0xFF, 0}, - {"CityWtr", fProfile::OBJ_CITY_WATER, fProfile::OBJ_CITY_WATER, 0xFFFF, 0xFF, 0}, - {"ClawSTg", fProfile::OBJ_CLAW_SHOT_TG, fProfile::OBJ_CLAW_SHOT_TG, 0xFFFF, 33, 0}, - { "Clef", fProfile::OBJ_CLEF, fProfile::OBJ_CLEF, 0xFFFF, SND_SOURCE_CLEF, 0}, - {"CloudSD", fProfile::OBJ_CLOUD_DIVE, fProfile::OBJ_CLOUD_DIVE, 0xFFFF, 0xFF, 0}, - {"ClrWall", fProfile::OBJ_CLEARNESS_WALL, fProfile::OBJ_CLEARNESS_WALL, 0xFFFF, 0xFF, 0}, - {"CmCloud", fProfile::OBJ_CUMUL_CLOUD, fProfile::OBJ_CUMUL_CLOUD, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "CoTest", fProfile::CO_TEST, fProfile::CO_TEST, 0xFFFF, 0xFF, 0}, - { "Col", fProfile::OBJ_COL, fProfile::OBJ_COL, 0xFFFF, 0xFF, 0}, - { "ColStp", fProfile::COL_STP, fProfile::COL_STP, 0xFFFF, 0xFF, 0}, - {"CtrlPnl", fProfile::OBJ_CONTROL_PANEL, fProfile::OBJ_CONTROL_PANEL, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "CupA00", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 1}, - { "CupA01", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 2}, - { "CupA02", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 3}, - { "CupB00", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 4}, - { "CupB01", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 5}, - { "CupB02", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 6}, - {"CyStone", fProfile::OBJ_CARRY_STONE, fProfile::OBJ_CARRY_STONE, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "D2Mtr", fProfile::OBJ_DESERT_METER, fProfile::OBJ_DESERT_METER, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"D300Obj", fProfile::OBJ_D300, fProfile::OBJ_D300, 0xFFFF, 0xFF, 0}, - {"D3Dummy", fProfile::OBJ_D3_DUMMY, fProfile::OBJ_D3_DUMMY, 0xFFFF, 0xFF, 0}, - { "DNdl", fProfile::OBJ_NEEDLE_DESERT, fProfile::OBJ_NEEDLE_DESERT, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "DNight", fProfile::OBJ_DAYNIGHT, fProfile::OBJ_DAYNIGHT, 0xFFFF, 0xFF, 0}, - {"DStartT", fProfile::START_TAG, fProfile::START_TAG, 0xFFFF, 0xFF, 0}, - {"DbidNpc", fProfile::DEMO_NPC_BIRD, fProfile::DEMO_NPC_BIRD, 0xFFFF, 43, 0}, - { "Debris", fProfile::OBJ_STAGE_DEBRIS, fProfile::OBJ_STAGE_DEBRIS, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "DecoA", fProfile::OBJ_DECOA, fProfile::OBJ_DECOA, 0xFFFF, 0xFF, 0}, - { "DecoB", fProfile::OBJ_DECOB, fProfile::OBJ_DECOB, 0xFFFF, 0xFF, 0}, - {"DemoPds", fProfile::OBJ_UTA_DEMO_PEDEST, fProfile::OBJ_UTA_DEMO_PEDEST, 0xFFFF, 0xFF, 0}, - {"DiOnNbs", fProfile::OBJ_DISPLAY_ONLY_NBS, fProfile::OBJ_DISPLAY_ONLY_NBS, 0xFFFF, 0xFF, 0}, - { "DieTag", fProfile::ALLDIE_TAG, fProfile::ALLDIE_TAG, 0xFFFF, 0xFF, 0}, - {"DisShip", fProfile::OBJ_DIS_SHIP, fProfile::OBJ_DIS_SHIP, 0xFFFF, 0xFF, 0}, - {"DivCrst", fProfile::OBJ_DIVINER_CRYSTAL, fProfile::OBJ_DIVINER_CRYSTAL, 551, SND_SOURCE_OBJECT, 0}, - {"DmtGate", fProfile::OBJ_DORMITORY_GATE, fProfile::OBJ_DORMITORY_GATE, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "Door", fProfile::OBJ_DOOR, fProfile::OBJ_DOOR, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"Door200", fProfile::OBJ_DOOR_DUNGEON_D200, fProfile::OBJ_DOOR_DUNGEON_D200, 0xFFFF, 42, 0}, - { "DoorBs", fProfile::OBJ_DOOR_BOSS, fProfile::OBJ_DOOR_BOSS, 0xFFFF, 42, 0}, - {"DoorDun", fProfile::OBJ_DOOR_DUNGEON, fProfile::OBJ_DOOR_DUNGEON, 0xFFFF, 42, 0}, - {"Dowsing", fProfile::T_DOWSING, fProfile::T_DOWSING, 0xFFFF, 0xFF, 0}, - {"Drgnfly", fProfile::INSECT_DRAGONFLY, fProfile::INSECT_DRAGONFLY, 778, SND_SOURCE_INSECT, 0}, - { "Drum", fProfile::OBJ_DRUM, fProfile::OBJ_DRUM, 0xFFFF, 0xFF, 0}, - {"DrumTag", fProfile::TAG_DRUM, fProfile::TAG_DRUM, 0xFFFF, 0xFF, 0}, - {"DstDbrs", fProfile::OBJ_DESERT_DEBRIS, fProfile::OBJ_DESERT_DEBRIS, 0xFFFF, 0xFF, 0}, - {"DwnLava", fProfile::OBJ_DOWN_LAVA, fProfile::OBJ_DOWN_LAVA, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "EAm", fProfile::E_AM, fProfile::E_AM, 69, 10, 0}, - { "EBc", fProfile::E_BC, fProfile::E_BC, 18, 10, 0}, - { "EBcZ", fProfile::E_BCZ, fProfile::E_BCZ, 43, 16, 0}, - { "EBcaL", fProfile::E_BCAL, fProfile::E_BCAL, 29, 10, 0}, - { "EBce", fProfile::E_BCE, fProfile::E_BCE, 18, 10, 0}, - {"EBeamos", fProfile::E_BEAMOS, fProfile::E_BEAMOS, 70, 10, 0}, - { "EBfish", fProfile::E_BFISH, fProfile::E_BFISH, 73, 10, 0}, - { "EBs", fProfile::E_BS, fProfile::E_BS, 0xFFFF, 10, 0}, - {"ECactus", fProfile::E_CACTUS, fProfile::E_CACTUS, 531, 40, 0}, - {"EChaser", fProfile::E_TN2, fProfile::E_TN2, 0xFFFF, 18, 0}, - { "EChb", fProfile::E_CHB, fProfile::E_CHB, 0xFFFF, 18, 0}, - { "ECptn", fProfile::E_CAPTAIN, fProfile::E_CAPTAIN, 47, 19, 0}, - { "EEye", fProfile::E_EYE, fProfile::E_EYE, 517, 15, 0}, - { "EGe", fProfile::E_GE, fProfile::E_GE, 0xFFFF, 10, 0}, - { "EGeko", fProfile::E_GEKO, fProfile::E_GEKO, 72, 15, 0}, - {"EGerock", fProfile::E_GEROCK, fProfile::E_GEROCK, 17, 10, 0}, - { "EGue", fProfile::E_GUE, fProfile::E_GUE, 15, 10, 0}, - {"EGumarm", fProfile::E_GUMARM, fProfile::E_GUMARM, 66, 10, 0}, - { "EGunho", fProfile::E_GUNHO, fProfile::E_GUNHO, 71, 10, 0}, - {"EGunhob", fProfile::E_GUNHOB, fProfile::E_GUNHOB, 87, 15, 0}, - { "EHidoK", fProfile::E_HIDOKARI, fProfile::E_HIDOKARI, 63, 10, 0}, - { "EHidoS", fProfile::E_HIDOKARIS, fProfile::E_HIDOKARIS, 63, SND_SOURCE_OBJECT, 0}, - {"EHidory", fProfile::E_HIDORY, fProfile::E_HIDORY, 16, 10, 0}, - { "EHoc", fProfile::E_HOC, fProfile::E_HOC, 20, 10, 0}, - { "EHp", fProfile::E_HP, fProfile::E_HP, 0xFFFF, 10, 0}, - { "EHydra", fProfile::E_HYDRA, fProfile::E_HYDRA, 44, 10, 0}, - { "EKGira", fProfile::E_KGIRA, fProfile::E_KGIRA, 0xFFFF, 19, 0}, - { "EKg", fProfile::E_KG, fProfile::E_KG, 8, 15, 0}, - { "EKs", fProfile::E_KS, fProfile::E_KS, 11, 10, 0}, - {"ELiTail", fProfile::E_LIZA_TAIL, fProfile::E_LIZA_TAIL, 0xFFFF, SND_SOURCE_ITEM, 0}, - {"ELizaru", fProfile::E_LIZARUFOS, fProfile::E_LIZARUFOS, 41, 13, 0}, - { "EMagma", fProfile::E_MAGMA, fProfile::E_MAGMA, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"EMagupp", fProfile::E_MAGUPPO, fProfile::E_MAGUPPO, 74, 12, 0}, - { "EMr", fProfile::E_MR, fProfile::E_MR, 36, 10, 0}, - {"EMrTate", fProfile::E_MR_SHIELD, fProfile::E_MR_SHIELD, 0xFFFF, 15, 0}, - { "EOc", fProfile::E_OC, fProfile::E_OC, 18, 10, 0}, - { "EOr", fProfile::E_OR, fProfile::E_OR, 57, 10, 0}, - {"EOrCann", fProfile::E_OR_CANNON, fProfile::E_OR_CANNON, 3, 10, 0}, - { "EPh", fProfile::E_PH, fProfile::E_PH, 81, 15, 0}, - { "EPo", fProfile::E_PO, fProfile::E_PO, 0xFFFF, 18, 0}, - { "ERemly", fProfile::E_REMLY, fProfile::E_REMLY, 0, 15, 0}, - {"ERupGue", fProfile::E_RUPEE_GUE, fProfile::E_RUPEE_GUE, 4, 10, 0}, - { "ESf", fProfile::E_SF, fProfile::E_SF, 45, 19, 0}, - { "ESf4", fProfile::E_SF4, fProfile::E_SF4, 46, 19, 0}, - { "ESiren", fProfile::E_SIREN, fProfile::E_SIREN, 0xFFFF, 18, 0}, - { "ESktl", fProfile::E_SKYTAIL, fProfile::E_SKYTAIL, 2, 10, 0}, - { "ESm", fProfile::E_SM, fProfile::E_SM, 59, 11, 0}, - { "ESpark", fProfile::E_SPARK, fProfile::E_SPARK, 67, 17, 0}, - { "ESyako", fProfile::E_SYAKOMAITO, fProfile::E_SYAKOMAITO, 68, 10, 0}, - { "EWs", fProfile::E_WS, fProfile::E_WS, 6, 15, 0}, - { "Eel", fProfile::EEL, fProfile::EEL, 0xFFFF, 0xFF, 0}, - { "EffGnT", fProfile::EFFECT_GEN_TAG, fProfile::EFFECT_GEN_TAG, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "Ehb", fProfile::E_HB, fProfile::E_HB, 78, 10, 0}, - {"EhbLeaf", fProfile::E_HB_LEAF, fProfile::E_HB_LEAF, 0xFFFF, 0xFF, 0}, - {"ElLight", fProfile::OBJ_ELECTRIC_LIGHT, fProfile::OBJ_ELECTRIC_LIGHT, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "EnCl", fProfile::ENEMY_CONTROL, fProfile::ENEMY_CONTROL, 0xFFFF, 0xFF, 0}, - { "Est", fProfile::E_ST, fProfile::E_ST, 7, 10, 0}, - {"Estwire", fProfile::E_ST_WIRE, fProfile::E_ST_WIRE, 0xFFFF, 0xFF, 0}, - { "EvfTag", fProfile::EVENTF_TAG, fProfile::EVENTF_TAG, 0xFFFF, 0xFF, 0}, - {"EvilFld", fProfile::OBJ_EVIL_FIELD, fProfile::OBJ_EVIL_FIELD, 0xFFFF, 0xFF, 0}, - {"EvntTag", fProfile::EVENT_TAG, fProfile::EVENT_TAG, 0xFFFF, 0xFF, 0}, - { "F302Lt", fProfile::OBJ_F302_LIGHT, fProfile::OBJ_F302_LIGHT, 0xFFFF, 0xFF, 0}, - {"F400GaS", fProfile::OBJ_F400_GATE_SEAL, fProfile::OBJ_F400_GATE_SEAL, 0xFFFF, 0xFF, 0}, - {"F400Gat", fProfile::OBJ_F400_GATE_LEAF, fProfile::OBJ_F400_GATE_LEAF, 0xFFFF, 0xFF, 0}, - {"FShutte", fProfile::OBJ_SHUTTER_FENCE, fProfile::OBJ_SHUTTER_FENCE, 0xFFFF, SND_SOURCE_SHUTTER, 0}, - { "FWall", fProfile::OBJ_FIREWALL, fProfile::OBJ_FIREWALL, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "Fairy", fProfile::OBJ_FAIRY, fProfile::OBJ_FAIRY, 546, SND_SOURCE_OBJECT, 0}, - {"FairyTa", fProfile::T_FAIRY, fProfile::T_FAIRY, 0xFFFF, 0xFF, 0}, - { "Fence", fProfile::OBJ_FENCE, fProfile::OBJ_FENCE, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"FenceB2", fProfile::OBJ_FENCE_BOKO2, fProfile::OBJ_FENCE_BOKO2, 0xFFFF, 0xFF, 0}, - {"FenceBk", fProfile::OBJ_FENCE_BOKO, fProfile::OBJ_FENCE_BOKO, 0xFFFF, 0xFF, 0}, - {"FenceFo", fProfile::TAG_SHUTTER_FENCE_FORBIDDANCE, fProfile::TAG_SHUTTER_FENCE_FORBIDDANCE, 0xFFFF, 0xFF, 0}, - {"FenceIr", fProfile::OBJ_FENCE_IRON, fProfile::OBJ_FENCE_IRON, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"FenceKs", fProfile::OBJ_FENCE_KONSAI, fProfile::OBJ_FENCE_KONSAI, 0xFFFF, 0xFF, 0}, - {"FencePe", fProfile::TAG_SHUTTER_FENCE_PERMISSION, fProfile::TAG_SHUTTER_FENCE_PERMISSION, 0xFFFF, 0xFF, 0}, - { "Fire", fProfile::OBJ_FIRE, fProfile::OBJ_FIRE, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"FireObs", fProfile::OBJ_FIRE_OBSTACLE, fProfile::OBJ_FIRE_OBSTACLE, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"FirePil", fProfile::OBJ_FIRE_PILLAR, fProfile::OBJ_FIRE_PILLAR, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"Firefly", fProfile::INSECT_FIREFLY, fProfile::INSECT_FIREFLY, 779, SND_SOURCE_INSECT, 0}, - { "Fish", fProfile::FISH, fProfile::FISH, 0xFFFF, 0xFF, 0}, - { "Flag", fProfile::OBJ_FLAG, fProfile::OBJ_FLAG, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "FlvsA", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 13}, - { "FlvsB", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 14}, - { "FlvsC", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 15}, - {"FlySlrb", fProfile::FLY_SLB, fProfile::FLY_SLB, 0xFFFF, 43, 0}, - {"FlyingC", fProfile::OBJ_FLYING_CLAWSHOT_TARGET, fProfile::OBJ_FLYING_CLAWSHOT_TARGET, 0xFFFF, 0xFF, 0}, - { "Fmaker", fProfile::FISH_MGR, fProfile::FISH_MGR, 0xFFFF, 0xFF, 0}, - {"ForceGT", fProfile::TAG_FORCE_GET_FLAG, fProfile::TAG_FORCE_GET_FLAG, 0xFFFF, 0xFF, 0}, - { "ForceS", fProfile::OBJ_FORCE_SIGN, fProfile::OBJ_FORCE_SIGN, 0xFFFF, 0xFF, 0}, - {"Fortune", fProfile::OBJ_FORTUNE_RING, fProfile::OBJ_FORTUNE_RING, 0xFFFF, 0xFF, 0}, - {"FrmLand", fProfile::OBJ_FARMLAND, fProfile::OBJ_FARMLAND, 0xFFFF, 0xFF, 0}, - {"FrtTree", fProfile::OBJ_FRUIT_TREE, fProfile::OBJ_FRUIT_TREE, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "FruitA", fProfile::OBJ_FRUIT, fProfile::OBJ_FRUIT, 0xFFFF, SND_SOURCE_OBJECT, 1}, - { "FruitB", fProfile::OBJ_FRUIT_B, fProfile::OBJ_FRUIT_B, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"GateGnd", fProfile::GATE2GND_TAG, fProfile::GATE2GND_TAG, 0xFFFF, 0xFF, 0}, - { "Gcoil", fProfile::OBJ_GRASS_COIL, fProfile::OBJ_GRASS_COIL, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "Gear", fProfile::OBJ_GEAR, fProfile::OBJ_GEAR, 525, SND_SOURCE_OBJECT, 0}, - {"GekoTag", fProfile::GEKO_TAG, fProfile::GEKO_TAG, 0xFFFF, 0xFF, 0}, - {"GenkiDT", fProfile::TAG_GENKI_DOWSING_TARGET, fProfile::TAG_GENKI_DOWSING_TARGET, 0xFFFF, 0xFF, 0}, - { "GhFlr", fProfile::OBJ_GIRAHIMU_FLOOR, fProfile::OBJ_GIRAHIMU_FLOOR, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"GhSBeam", fProfile::GH_SWORD_BEAM, fProfile::GH_SWORD_BEAM, 0xFFFF, SND_SOURCE_BULLET, 0}, - {"GiraFot", fProfile::OBJ_GIRAHIM_FOOT, fProfile::OBJ_GIRAHIM_FOOT, 0xFFFF, 0xFF, 0}, - {"GkMgTag", fProfile::GENKI_MGR_TAG, fProfile::GENKI_MGR_TAG, 0xFFFF, 0xFF, 0}, - {"GodCube", fProfile::OBJ_GODDESS_CUBE, fProfile::OBJ_GODDESS_CUBE, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"GodMark", fProfile::OBJ_GOD_MARK, fProfile::OBJ_GOD_MARK, 0xFFFF, 0xFF, 0}, - {"GrCover", fProfile::OBJ_GROUND_COVER, fProfile::OBJ_GROUND_COVER, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "Grave", fProfile::OBJ_GRAVE, fProfile::OBJ_GRAVE, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "GroupS", fProfile::GROUP_SUMMON, fProfile::GROUP_SUMMON, 0xFFFF, 0xFF, 0}, - { "GroupT", fProfile::GROUP_TEST, fProfile::GROUP_TEST, 0xFFFF, 0xFF, 0}, - { "Grshpr", fProfile::INSECT_GRASSHOPPER, fProfile::INSECT_GRASSHOPPER, 772, SND_SOURCE_INSECT, 0}, - {"GuardLg", fProfile::OBJ_GUARD_LOG, fProfile::OBJ_GUARD_LOG, 544, SND_SOURCE_OBJECT, 0}, - { "GueB", fProfile::GUE_BULLET, fProfile::GUE_BULLET, 0xFFFF, 42, 0}, - {"HdrFire", fProfile::HIDORY_FIRE, fProfile::HIDORY_FIRE, 16, SND_SOURCE_OBJECT, 0}, - {"HeartCo", fProfile::OBJ_ITEM_HEART_CONTAINER, fProfile::OBJ_ITEM_HEART_CONTAINER, 0xFFFF, SND_SOURCE_ITEM, 0}, - { "Heartf", fProfile::HEART_FLOWER, fProfile::HEART_FLOWER, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"HeatRst", fProfile::TAG_HEAT_RESIST, fProfile::TAG_HEAT_RESIST, 0xFFFF, 0xFF, 0}, - { "Himo", fProfile::OBJ_HIMO, fProfile::OBJ_HIMO, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"HitLVSW", fProfile::OBJ_HIT_LEVER_SW, fProfile::OBJ_HIT_LEVER_SW, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "HnComb", fProfile::NPC_HONEYCOMB, fProfile::NPC_HONEYCOMB, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"HoleMNG", fProfile::OBJ_HOLE_MINIGAME, fProfile::OBJ_HOLE_MINIGAME, 0xFFFF, 0xFF, 0}, - {"HolyWtr", fProfile::TAG_HOLY_WATER, fProfile::TAG_HOLY_WATER, 0xFFFF, 0xFF, 0}, - {"HrpHint", fProfile::OBJ_HARP_HINT, fProfile::OBJ_HARP_HINT, 555, SND_SOURCE_OBJECT, 0}, - { "HrpTg", fProfile::HARP_TAG, fProfile::HARP_TAG, 0xFFFF, 57, 0}, - {"ImpaDor", fProfile::OBJ_IMPA_DOOR, fProfile::OBJ_IMPA_DOOR, 0xFFFF, 0xFF, 0}, - { "InHole", fProfile::OBJ_INTO_HOLE, fProfile::OBJ_INTO_HOLE, 0xFFFF, 33, 0}, - {"InsctTg", fProfile::TAG_INSECT, fProfile::TAG_INSECT, 0xFFFF, 0xFF, 0}, - { "Invisi", fProfile::INVISIBLE, fProfile::INVISIBLE, 0xFFFF, 0xFF, 0}, - {"IronStg", fProfile::OBJ_IRON_STAGE, fProfile::OBJ_IRON_STAGE, 0xFFFF, 0xFF, 0}, - {"IslBamb", fProfile::OBJ_BAMBOO_ISLAND, fProfile::OBJ_BAMBOO_ISLAND, 0xFFFF, 0xFF, 0}, - { "IslIns", fProfile::OBJ_INSECT_ISLAND, fProfile::OBJ_INSECT_ISLAND, 0xFFFF, 0xFF, 0}, - { "IslLOD", fProfile::OBJ_ISLAND_LOD, fProfile::OBJ_ISLAND_LOD, 0xFFFF, 0xFF, 0}, - {"IslMegm", fProfile::OBJ_MEGAMI_ISLAND, fProfile::OBJ_MEGAMI_ISLAND, 0xFFFF, 0xFF, 0}, - {"IslNusi", fProfile::OBJ_ISLAND_NUSI, fProfile::OBJ_ISLAND_NUSI, 0xFFFF, 0xFF, 0}, - {"IslTery", fProfile::OBJ_TERRY_ISLAND, fProfile::OBJ_TERRY_ISLAND, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"IslTreB", fProfile::OBJ_TREASURE_ISLAND_B, fProfile::OBJ_TREASURE_ISLAND_B, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"IslTrea", fProfile::OBJ_TREASURE_ISLAND, fProfile::OBJ_TREASURE_ISLAND, 0xFFFF, 0xFF, 0}, - { "Item", fProfile::ITEM, fProfile::ITEM, 0xFFFF, SND_SOURCE_ITEM, 0}, - {"IvyRope", fProfile::OBJ_IVY_ROPE, fProfile::OBJ_IVY_ROPE, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "J_Test", fProfile::J_TEST, fProfile::J_TEST, 0xFFFF, 0xFF, 0}, - {"JunkRep", fProfile::OBJ_JUNK_REPAIR, fProfile::OBJ_JUNK_REPAIR, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "Kanban", fProfile::KANBAN, fProfile::KANBAN, 513, SND_SOURCE_OBJECT, 0}, - {"KanbanS", fProfile::OBJ_KANBAN_STONE, fProfile::OBJ_KANBAN_STONE, 514, 0xFF, 0}, - { "Kibako", fProfile::OBJ_KIBAKO, fProfile::OBJ_KIBAKO, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"KiesuTa", fProfile::KIESU_TAG, fProfile::KIESU_TAG, 0xFFFF, 15, 0}, - { "Kinoko", fProfile::OBJ_MUSHROOM, fProfile::OBJ_MUSHROOM, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"KinokoA", fProfile::OBJ_MUSHROOM, fProfile::OBJ_MUSHROOM, 0xFFFF, SND_SOURCE_OBJECT, 1}, - {"KinokoB", fProfile::OBJ_MUSHROOM, fProfile::OBJ_MUSHROOM, 0xFFFF, SND_SOURCE_OBJECT, 2}, - {"KinokoC", fProfile::OBJ_MUSHROOM, fProfile::OBJ_MUSHROOM, 0xFFFF, SND_SOURCE_OBJECT, 3}, - {"KinokoD", fProfile::OBJ_MUSHROOM, fProfile::OBJ_MUSHROOM, 0xFFFF, SND_SOURCE_OBJECT, 4}, - {"KmtWall", fProfile::OBJ_KUMITE_WALL, fProfile::OBJ_KUMITE_WALL, 0xFFFF, 0xFF, 0}, - {"KndBird", fProfile::KNIGHT_LEADER_BIRD, fProfile::KNIGHT_LEADER_BIRD, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"Kuwagat", fProfile::INSECT_BEETLE, fProfile::INSECT_BEETLE, 771, SND_SOURCE_INSECT, 1}, - { "Kytag", fProfile::KYTAG_TAG, fProfile::KYTAG_TAG, 0xFFFF, 0xFF, 0}, - { "LBird", fProfile::LITTLE_BIRD, fProfile::LITTLE_BIRD, 479, 43, 0}, - {"LBmaker", fProfile::LITTLE_BIRD_MGR, fProfile::LITTLE_BIRD_MGR, 0xFFFF, 59, 0}, - { "LHHarp", fProfile::OBJ_LIGHTHOUSE_HARP, fProfile::OBJ_LIGHTHOUSE_HARP, 0xFFFF, 0xFF, 0}, - {"LHLight", fProfile::OBJ_LIGHTHOUSE_LIGHT, fProfile::OBJ_LIGHTHOUSE_LIGHT, 0xFFFF, 0xFF, 0}, - { "LSEff", fProfile::TAG_LIGHT_SHAFT_EFF, fProfile::TAG_LIGHT_SHAFT_EFF, 0xFFFF, 0xFF, 0}, - {"Ladybug", fProfile::INSECT_LADYBUG, fProfile::INSECT_LADYBUG, 769, SND_SOURCE_INSECT, 0}, - { "LampA", fProfile::OBJ_LAMP, fProfile::OBJ_LAMP, 0xFFFF, 0xFF, 1}, - { "LampB", fProfile::OBJ_LAMP, fProfile::OBJ_LAMP, 0xFFFF, 0xFF, 2}, - { "LampC", fProfile::OBJ_LAMP, fProfile::OBJ_LAMP, 0xFFFF, 0xFF, 3}, - { "LampD", fProfile::OBJ_LAMP, fProfile::OBJ_LAMP, 0xFFFF, 0xFF, 6}, - { "LampE", fProfile::OBJ_LAMP, fProfile::OBJ_LAMP, 0xFFFF, 0xFF, 4}, - { "LampF", fProfile::OBJ_LAMP, fProfile::OBJ_LAMP, 0xFFFF, 0xFF, 5}, - {"LavF200", fProfile::OBJ_LAVA_F200, fProfile::OBJ_LAVA_F200, 0xFFFF, 0xFF, 0}, - {"LbTnder", fProfile::LBTHUNDER_TAG, fProfile::LBTHUNDER_TAG, 0xFFFF, 0xFF, 0}, - {"LeafGut", fProfile::OBJ_FRUIT_GUTS_LEAF, fProfile::OBJ_FRUIT_GUTS_LEAF, 0xFFFF, 0xFF, 0}, - {"LeafSwg", fProfile::OBJ_LEAF_SWING, fProfile::OBJ_LEAF_SWING, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"Light00", fProfile::OBJ_BUILDING, fProfile::OBJ_BUILDING, 0xFFFF, 0xFF, 1}, - {"LightLi", fProfile::OBJ_LIGHT_LINE, fProfile::OBJ_LIGHT_LINE, 0xFFFF, 41, 0}, - { "Link", fProfile::PLAYER, fProfile::PLAYER, 0xFFFF, SND_SOURCE_PLAYER, 0}, - { "Log", fProfile::OBJ_LOG, fProfile::OBJ_LOG, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "LogWtr", fProfile::OBJ_LOG_WATER, fProfile::OBJ_LOG_WATER, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "Lotus", fProfile::OBJ_LOTUS, fProfile::OBJ_LOTUS, 521, SND_SOURCE_OBJECT, 0}, - { "LtSftS", fProfile::OBJ_LIGHT_SHAFT_SMALL, fProfile::OBJ_LIGHT_SHAFT_SMALL, 0xFFFF, 41, 0}, - {"LtsFlwr", fProfile::OBJ_LOTUS_FLOWER, fProfile::OBJ_LOTUS_FLOWER, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"LtsSeed", fProfile::OBJ_LOTUS_SEED, fProfile::OBJ_LOTUS_SEED, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "LvD201", fProfile::OBJ_LAVA_D201, fProfile::OBJ_LAVA_D201, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "LvPlt", fProfile::OBJ_LAVA_PLATE, fProfile::OBJ_LAVA_PLATE, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "MDvTg", fProfile::MEGAMI_DIVING_TAG, fProfile::MEGAMI_DIVING_TAG, 0xFFFF, 0xFF, 0}, - {"MagBoat", fProfile::OBJ_ROCK_BOAT, fProfile::OBJ_ROCK_BOAT, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "MagpB", fProfile::MAGUPPO_BULLET, fProfile::MAGUPPO_BULLET, 0xFFFF, 30, 0}, - { "Mantis", fProfile::INSECT_GRASSHOPPER, fProfile::INSECT_GRASSHOPPER, 773, SND_SOURCE_INSECT, 1}, - {"MapArea", fProfile::MAP_AREA_TAG, fProfile::MAP_AREA_TAG, 0xFFFF, 0xFF, 0}, - {"MapInst", fProfile::TAG_MAP_INST, fProfile::TAG_MAP_INST, 0xFFFF, 0xFF, 0}, - {"MapMark", fProfile::T_MAP_MARK, fProfile::T_MAP_MARK, 0xFFFF, 0xFF, 0}, - {"MassTag", fProfile::MASS_OBJ_TAG, fProfile::MASS_OBJ_TAG, 0xFFFF, 0xFF, 0}, - {"Message", fProfile::MESSAGE_ACTOR, fProfile::MESSAGE_ACTOR, 0xFFFF, 0xFF, 0}, - {"MgPmpkn", fProfile::OBJ_MG_PUMPKIN, fProfile::OBJ_MG_PUMPKIN, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "MistTg", fProfile::MIST_TAG, fProfile::MIST_TAG, 0xFFFF, 0xFF, 0}, - {"MoMgTag", fProfile::MOLE_MGR_TAG, fProfile::MOLE_MGR_TAG, 0xFFFF, 0xFF, 0}, - { "MoSoil", fProfile::OBJ_MOLE_SOIL, fProfile::OBJ_MOLE_SOIL, 0xFFFF, 0xFF, 0}, - {"MoleCvr", fProfile::OBJ_MOLE_COVER, fProfile::OBJ_MOLE_COVER, 0xFFFF, 0xFF, 0}, - {"MoleTag", fProfile::MOLE_PROHIBIT_TAG, fProfile::MOLE_PROHIBIT_TAG, 0xFFFF, 0xFF, 0}, - {"MpParts", fProfile::OBJ_MAPPARTS, fProfile::OBJ_MAPPARTS, 0xFFFF, 0xFF, 0}, - {"MssbTag", fProfile::TAG_MUSASABI, fProfile::TAG_MUSASABI, 0xFFFF, 0xFF, 0}, - {"Musasab", fProfile::OBJ_MUSASABI, fProfile::OBJ_MUSASABI, 321, SND_SOURCE_OBJECT, 0}, - { "MvElc", fProfile::OBJ_MOVE_ELEC, fProfile::OBJ_MOVE_ELEC, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"MvLiftV", fProfile::OBJ_MOVE_LIFT_VOL, fProfile::OBJ_MOVE_LIFT_VOL, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "NpcAdr", fProfile::NPC_ADR, fProfile::NPC_ADR, 310, SND_SOURCE_NPC_DRAGON, 0}, - {"NpcAkuH", fProfile::NPC_AKU_HUMAN, fProfile::NPC_AKU_HUMAN, 346, SND_SOURCE_NPC_NRM, 0}, - {"NpcAkum", fProfile::NPC_AKUMAKUN, fProfile::NPC_AKUMAKUN, 279, SND_SOURCE_NPC_NRM, 0}, - {"NpcAzFa", fProfile::NPC_AZUKARIYA_FATHER, fProfile::NPC_AZUKARIYA_FATHER, 298, SND_SOURCE_NPC_NRM, 0}, - {"NpcAzNi", fProfile::NPC_AZUKARIYA_NIGHT, fProfile::NPC_AZUKARIYA_NIGHT, 464, SND_SOURCE_NPC_NRM, 0}, - {"NpcBRvl", fProfile::NPC_BBRVL, fProfile::NPC_BBRVL, 261, 50, 0}, - {"NpcBdsw", fProfile::NPC_BDSW, fProfile::NPC_BDSW, 0xFFFF, 50, 0}, - { "NpcBdz", fProfile::NPC_BDZ, fProfile::NPC_BDZ, 0xFFFF, 43, 0}, - { "NpcBgr", fProfile::NPC_BGR, fProfile::NPC_BGR, 298, SND_SOURCE_NPC_NRM, 0}, - {"NpcBird", fProfile::NPC_BIRD, fProfile::NPC_BIRD, 0xFFFF, 43, 0}, - {"NpcCbFd", fProfile::NPC_CE_FRIEND, fProfile::NPC_CE_FRIEND, 278, SND_SOURCE_NPC_NRM, 0}, - {"NpcCbLd", fProfile::NPC_CE_LADY, fProfile::NPC_CE_LADY, 285, SND_SOURCE_NPC_NRM, 0}, - {"NpcChef", fProfile::NPC_CHEF, fProfile::NPC_CHEF, 299, SND_SOURCE_NPC_NRM, 0}, - {"NpcDgJg", fProfile::NPC_DIVE_GAME_JUDGE, fProfile::NPC_DIVE_GAME_JUDGE, 272, SND_SOURCE_NPC_NRM, 0}, - {"NpcDoML", fProfile::NPC_DOUGUYA_MOTHER_LOD, fProfile::NPC_DOUGUYA_MOTHER_LOD, 294, SND_SOURCE_NPC_NRM, 0}, - {"NpcDoMo", fProfile::NPC_DOUGUYA_MOTHER, fProfile::NPC_DOUGUYA_MOTHER, 294, SND_SOURCE_NPC_NRM, 0}, - {"NpcDoNi", fProfile::NPC_DOUGUYA_NIGHT, fProfile::NPC_DOUGUYA_NIGHT, 462, SND_SOURCE_NPC_NRM, 0}, - { "NpcDrb", fProfile::NPC_DRB, fProfile::NPC_DRB, 319, 43, 0}, - {"NpcDrbC", fProfile::NPC_DRBC, fProfile::NPC_DRBC, 320, 43, 0}, - { "NpcDsk", fProfile::NPC_DSK, fProfile::NPC_DSK, 258, SND_SOURCE_NPC_NRM, 0}, - {"NpcDskN", fProfile::NPC_DAISHINKAN_N, fProfile::NPC_DAISHINKAN_N, 340, SND_SOURCE_NPC_NRM, 0}, - { "NpcFdr", fProfile::NPC_FDR, fProfile::NPC_FDR, 318, SND_SOURCE_NPC_DRAGON, 0}, - { "NpcGhm", fProfile::NPC_GHM, fProfile::NPC_GHM, 323, 50, 0}, - {"NpcGost", fProfile::NPC_TOILET_GHOST, fProfile::NPC_TOILET_GHOST, 300, SND_SOURCE_NPC_NRM, 0}, - { "NpcGra", fProfile::NPC_GRA, fProfile::NPC_GRA, 302, SND_SOURCE_NPC_NRM, 0}, - { "NpcGrc", fProfile::NPC_GRC, fProfile::NPC_GRC, 330, SND_SOURCE_NPC_NRM, 0}, - { "NpcGrd", fProfile::NPC_GRD, fProfile::NPC_GRD, 331, 50, 0}, - { "NpcGzl", fProfile::NPC_GZL, fProfile::NPC_GZL, 257, SND_SOURCE_NPC_NRM, 0}, - {"NpcIcgK", fProfile::NPC_ICGK, fProfile::NPC_ICGK, 460, SND_SOURCE_NPC_NRM, 0}, - { "NpcInv", fProfile::NPC_INV, fProfile::NPC_INV, 0xFFFF, 0xFF, 0}, - {"NpcJkML", fProfile::NPC_JUNK_MOTHER_LOD, fProfile::NPC_JUNK_MOTHER_LOD, 295, SND_SOURCE_NPC_NRM, 0}, - {"NpcJkMo", fProfile::NPC_JUNK_MOTHER, fProfile::NPC_JUNK_MOTHER, 295, SND_SOURCE_NPC_NRM, 0}, - {"NpcJkNi", fProfile::NPC_JUNK_NIGHT, fProfile::NPC_JUNK_NIGHT, 463, SND_SOURCE_NPC_NRM, 0}, - {"NpcKb2N", fProfile::NPC_KOBUN_B_NIGHT, fProfile::NPC_KOBUN_B_NIGHT, 459, SND_SOURCE_NPC_NRM, 0}, - { "NpcKbn", fProfile::NPC_KBN, fProfile::NPC_KBN, 262, SND_SOURCE_NPC_NRM, 0}, - {"NpcKbn2", fProfile::NPC_KBN2, fProfile::NPC_KBN2, 263, SND_SOURCE_NPC_NRM, 0}, - { "NpcKen", fProfile::NPC_KENSEI, fProfile::NPC_KENSEI, 0xFFFF, SND_SOURCE_KENSEI, 0}, - {"NpcKenT", fProfile::NPC_TALK_KENSEI, fProfile::NPC_TALK_KENSEI, 0xFFFF, SND_SOURCE_KENSEI, 0}, - {"NpcKnld", fProfile::NPC_KNIGHT_LEADER, fProfile::NPC_KNIGHT_LEADER, 271, SND_SOURCE_NPC_NRM, 0}, - {"NpcKyuE", fProfile::NPC_KYUI_ELDER, fProfile::NPC_KYUI_ELDER, 307, SND_SOURCE_NPC_NRM, 0}, - {"NpcKyuW", fProfile::NPC_KYUI_WIZARD, fProfile::NPC_KYUI_WIZARD, 308, SND_SOURCE_NPC_NRM, 0}, - {"NpcMHNi", fProfile::NPC_MED_HUS_NIGHT, fProfile::NPC_MED_HUS_NIGHT, 466, SND_SOURCE_NPC_NRM, 0}, - {"NpcMWNi", fProfile::NPC_MED_WIFE_NIGHT, fProfile::NPC_MED_WIFE_NIGHT, 465, SND_SOURCE_NPC_NRM, 0}, - {"NpcMlMg", fProfile::NPC_MOLE_MG, fProfile::NPC_MOLE_MG, 313, 50, 0}, - {"NpcMoEN", fProfile::NPC_MOLE_ES_NML, fProfile::NPC_MOLE_ES_NML, 345, 50, 0}, - {"NpcMoEl", fProfile::NPC_MOLE_ELDER, fProfile::NPC_MOLE_ELDER, 317, 50, 0}, - { "NpcMoN", fProfile::NPC_MOLE_NORMAL, fProfile::NPC_MOLE_NORMAL, 312, 50, 0}, - {"NpcMoN2", fProfile::NPC_MOLE_NORMAL2, fProfile::NPC_MOLE_NORMAL2, 312, 50, 0}, - { "NpcMoS", fProfile::NPC_MOLE_SAL, fProfile::NPC_MOLE_SAL, 474, 50, 0}, - { "NpcMoT", fProfile::NPC_MOLE_TACKLE, fProfile::NPC_MOLE_TACKLE, 315, 50, 0}, - {"NpcMoT2", fProfile::NPC_MOLE_TACKLE2, fProfile::NPC_MOLE_TACKLE2, 316, 50, 0}, - {"NpcMole", fProfile::NPC_MOLE, fProfile::NPC_MOLE, 345, 50, 0}, - { "NpcOim", fProfile::NPC_OIM, fProfile::NPC_OIM, 301, SND_SOURCE_NPC_NRM, 0}, - {"NpcOkyu", fProfile::NPC_ORD_KYUI, fProfile::NPC_ORD_KYUI, 304, SND_SOURCE_NPC_NRM, 0}, - { "NpcPcs", fProfile::NPC_PCS, fProfile::NPC_PCS, 469, SND_SOURCE_NPC_NRM, 0}, - { "NpcPdu", fProfile::NPC_PDU, fProfile::NPC_PDU, 274, SND_SOURCE_NPC_NRM, 0}, - { "NpcPma", fProfile::NPC_PMA, fProfile::NPC_PMA, 273, SND_SOURCE_NPC_NRM, 0}, - {"NpcResc", fProfile::NPC_RESCUE, fProfile::NPC_RESCUE, 291, SND_SOURCE_NPC_NRM, 0}, - { "NpcRvl", fProfile::NPC_RVL, fProfile::NPC_RVL, 261, SND_SOURCE_NPC_NRM, 0}, - {"NpcRvlL", fProfile::NPC_RIVAL_LOD, fProfile::NPC_RIVAL_LOD, 261, SND_SOURCE_NPC_NRM, 0}, - {"NpcRvlR", fProfile::NPC_REGRET_RIVAL, fProfile::NPC_REGRET_RIVAL, 261, SND_SOURCE_NPC_NRM, 0}, - {"NpcSAML", fProfile::NPC_SENPAIA_MOTHER_LOD, fProfile::NPC_SENPAIA_MOTHER_LOD, 296, SND_SOURCE_NPC_NRM, 0}, - {"NpcSAMo", fProfile::NPC_SENPAIA_MOTHER, fProfile::NPC_SENPAIA_MOTHER, 296, SND_SOURCE_NPC_NRM, 0}, - {"NpcSMnD", fProfile::NPC_SORAJIMA_MAN_D, fProfile::NPC_SORAJIMA_MAN_D, 297, SND_SOURCE_NPC_NRM, 0}, - {"NpcSMnE", fProfile::NPC_SORAJIMA_MAN_E, fProfile::NPC_SORAJIMA_MAN_E, 336, SND_SOURCE_NPC_NRM, 0}, - {"NpcSalS", fProfile::NPC_SALESMAN_S, fProfile::NPC_SALESMAN_S, 265, SND_SOURCE_NPC_NRM, 0}, - {"NpcSenb", fProfile::NPC_SENPAI_B, fProfile::NPC_SENPAI_B, 277, SND_SOURCE_NPC_NRM, 0}, - {"NpcSenp", fProfile::NPC_SENPAI, fProfile::NPC_SENPAI, 276, SND_SOURCE_NPC_NRM, 0}, - { "NpcSha", fProfile::NPC_SHA, fProfile::NPC_SHA, 275, SND_SOURCE_NPC_NRM, 0}, - { "NpcSkn", fProfile::NPC_SKN, fProfile::NPC_SKN, 259, SND_SOURCE_NPC_NRM, 0}, - {"NpcSkn2", fProfile::NPC_SKN2, fProfile::NPC_SKN2, 260, SND_SOURCE_NPC_NRM, 0}, - {"NpcSlFB", fProfile::NPC_SLFB, fProfile::NPC_SLFB, 0xFFFF, 43, 0}, - {"NpcSlFl", fProfile::NPC_SLFL, fProfile::NPC_SLFL, 0xFFFF, 43, 0}, - {"NpcSlKy", fProfile::NPC_SALBAGE_MORRY, fProfile::NPC_SALBAGE_MORRY, 304, SND_SOURCE_NPC_NRM, 0}, - {"NpcSlRp", fProfile::NPC_SLRP, fProfile::NPC_SLRP, 477, 43, 0}, - {"NpcSlb2", fProfile::NPC_SLB2, fProfile::NPC_SLB2, 354, 43, 0}, - {"NpcSlrb", fProfile::NPC_SLB, fProfile::NPC_SLB, 0xFFFF, 43, 0}, - {"NpcSltk", fProfile::NPC_SLTK, fProfile::NPC_SLTK, 0xFFFF, 0xFF, 0}, - {"NpcSma2", fProfile::NPC_SMA2, fProfile::NPC_SMA2, 286, SND_SOURCE_NPC_NRM, 0}, - {"NpcSma3", fProfile::NPC_SMA3, fProfile::NPC_SMA3, 287, SND_SOURCE_NPC_NRM, 0}, - {"NpcSoBo", fProfile::NPC_SORAJIMA_BOY, fProfile::NPC_SORAJIMA_BOY, 284, SND_SOURCE_NPC_NRM, 0}, - {"NpcSoFa", fProfile::NPC_SORAJIMA_FATHER, fProfile::NPC_SORAJIMA_FATHER, 282, SND_SOURCE_NPC_NRM, 0}, - { "NpcSoG", fProfile::NPC_SORAJIMA_GIRL, fProfile::NPC_SORAJIMA_GIRL, 288, SND_SOURCE_NPC_NRM, 0}, - {"NpcSoMo", fProfile::NPC_SORAJIMA_MOTHER, fProfile::NPC_SORAJIMA_MOTHER, 283, SND_SOURCE_NPC_NRM, 0}, - {"NpcSoma", fProfile::NPC_SORAJIMA_MALE, fProfile::NPC_SORAJIMA_MALE, 281, SND_SOURCE_NPC_NRM, 0}, - {"NpcSowo", fProfile::NPC_SORAJIMA_FEMALE, fProfile::NPC_SORAJIMA_FEMALE, 280, SND_SOURCE_NPC_NRM, 0}, - { "NpcStr", fProfile::NPC_STR, fProfile::NPC_STR, 0xFFFF, 0xFF, 0}, - { "NpcSui", fProfile::NPC_SUISEI, fProfile::NPC_SUISEI, 344, 43, 0}, - {"NpcSuiN", fProfile::NPC_SUISEI_NORMAL, fProfile::NPC_SUISEI_NORMAL, 309, 50, 0}, - {"NpcSuiS", fProfile::NPC_SUISEI_SUB, fProfile::NPC_SUISEI_SUB, 309, 43, 0}, - { "NpcTdr", fProfile::NPC_TDR, fProfile::NPC_TDR, 322, SND_SOURCE_NPC_DRAGON, 0}, - {"NpcTdrB", fProfile::NPC_TDRB, fProfile::NPC_TDRB, 322, SND_SOURCE_OBJECT, 0}, - { "NpcTds", fProfile::NPC_TDS, fProfile::NPC_TDS, 478, 0xFF, 0}, - { "NpcTer", fProfile::NPC_TERRY, fProfile::NPC_TERRY, 264, SND_SOURCE_NPC_NRM, 0}, - { "NpcTke", fProfile::NPC_TKE, fProfile::NPC_TKE, 0xFFFF, 0xFF, 0}, - { "NpcTmn", fProfile::NPC_TMN, fProfile::NPC_TMN, 0xFFFF, 0xFF, 0}, - { "NpcYim", fProfile::NPC_YIM, fProfile::NPC_YIM, 311, SND_SOURCE_NPC_NRM, 0}, - { "NpcZld", fProfile::NPC_ZLD, fProfile::NPC_ZLD, 256, SND_SOURCE_NPC_NRM, 0}, - {"Npckyu1", fProfile::NPC_KYUI_FIRST, fProfile::NPC_KYUI_FIRST, 303, SND_SOURCE_NPC_NRM, 0}, - {"Npckyu3", fProfile::NPC_KYUI_THIRD, fProfile::NPC_KYUI_THIRD, 305, SND_SOURCE_NPC_NRM, 0}, - {"Npckyu4", fProfile::NPC_KYUI4, fProfile::NPC_KYUI4, 306, SND_SOURCE_NPC_NRM, 0}, - { "NusiB", fProfile::B_NUSI, fProfile::B_NUSI, 0xFFFF, 23, 0}, - { "NusiBt", fProfile::B_NUSI_BULLET, fProfile::B_NUSI_BULLET, 0xFFFF, SND_SOURCE_BULLET, 0}, - {"NusiNpc", fProfile::NUSI_NPC, fProfile::NUSI_NPC, 0xFFFF, 46, 0}, - { "NusiS", fProfile::NUSI_BASE, fProfile::NUSI_BASE, 0xFFFF, 0xFF, 0}, - { "NusiT", fProfile::B_NUSI_TENTAKLE, fProfile::B_NUSI_TENTAKLE, 5, 19, 0}, - {"OBBLBom", fProfile::OBJ_BBLARGEBOMB, fProfile::OBJ_BBLARGEBOMB, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "OBBStn", fProfile::OBJ_BSTN, fProfile::OBJ_BSTN, 557, 0xFF, 0}, - {"ODesert", fProfile::OBJ_DESERT, fProfile::OBJ_DESERT, 0xFFFF, 0xFF, 0}, - { "OGhKf", fProfile::OBJ_GH_KNIFE, fProfile::OBJ_GH_KNIFE, 0xFFFF, SND_SOURCE_BULLET, 0}, - { "OGhSwL", fProfile::OBJ_GH_SW_L, fProfile::OBJ_GH_SW_L, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "OHole", fProfile::OBJ_HOLE, fProfile::OBJ_HOLE, 0xFFFF, 0xFF, 0}, - { "OPipe", fProfile::OBJ_PIPE, fProfile::OBJ_PIPE, 0xFFFF, SND_SOURCE_ITEM, 0}, - { "ORing", fProfile::OBJ_RING, fProfile::OBJ_RING, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "ObjBg", fProfile::OBJ_BG, fProfile::OBJ_BG, 0xFFFF, 0xFF, 0}, - { "ObjBld", fProfile::OBJ_BUILDING, fProfile::OBJ_BUILDING, 0xFFFF, 0xFF, 0}, - {"Obstacl", fProfile::OBJ_BELT_OBSTACLE, fProfile::OBJ_BELT_OBSTACLE, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "OcGrs", fProfile::OBJ_OCT_GRASS, fProfile::OBJ_OCT_GRASS, 0xFFFF, 0xFF, 0}, - { "OcGrsL", fProfile::OBJ_OCT_GRASS_LEAF, fProfile::OBJ_OCT_GRASS_LEAF, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"OrCaBul", fProfile::OR_CANN_BULLET, fProfile::OR_CANN_BULLET, 0xFFFF, SND_SOURCE_BULLET, 0}, - { "Paint", fProfile::OBJ_PAINT, fProfile::OBJ_PAINT, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"Pinwhel", fProfile::OBJ_PINWHEEL, fProfile::OBJ_PINWHEEL, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "Piston", fProfile::OBJ_PISTON, fProfile::OBJ_PISTON, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "PlCock", fProfile::OBJ_POOL_COCK, fProfile::OBJ_POOL_COCK, 0xFFFF, 0xFF, 0}, - {"PlRsTag", fProfile::PL_RESTART, fProfile::PL_RESTART, 0xFFFF, 0xFF, 0}, - { "Plight", fProfile::PLIGHT_TAG, fProfile::PLIGHT_TAG, 0xFFFF, 0xFF, 0}, - {"PlntA00", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 16}, - {"PlntA01", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 17}, - { "PlntB", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 18}, - {"PlntC00", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 19}, - {"PlntC01", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 20}, - { "PltA00", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 7}, - { "PltA01", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 8}, - { "PltA02", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 9}, - { "PltB00", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 10}, - { "PltB01", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 11}, - { "PltB02", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 12}, - { "PltChg", fProfile::PLTCHG_TAG, fProfile::PLTCHG_TAG, 0xFFFF, 0xFF, 0}, - {"PmpknBd", fProfile::PUMPKIN, fProfile::PUMPKIN, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"PmpknDe", fProfile::PUMPKIN, fProfile::PUMPKIN, 0xFFFF, 0xFF, 0}, - {"PoleStn", fProfile::OBJ_POLE_STONY, fProfile::OBJ_POLE_STONY, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "PotSal", fProfile::OBJ_POT_SAL, fProfile::OBJ_POT_SAL, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"Propera", fProfile::OBJ_PROPERA, fProfile::OBJ_PROPERA, 539, SND_SOURCE_OBJECT, 0}, - {"PrpLift", fProfile::OBJ_PROPELLER_LIFT, fProfile::OBJ_PROPELLER_LIFT, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"PumpBar", fProfile::OBJ_PUMPKIN_BAR, fProfile::OBJ_PUMPKIN_BAR, 0xFFFF, 0xFF, 0}, - {"Pumpkin", fProfile::OBJ_PUMPKIN_LEAF, fProfile::OBJ_PUMPKIN_LEAF, 0xFFFF, 0xFF, 0}, - {"PushBlk", fProfile::OBJ_PUSH_BLOCK, fProfile::OBJ_PUSH_BLOCK, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "PyBird", fProfile::BIRD, fProfile::BIRD, 0xFFFF, SND_SOURCE_PLAYER_BIRD, 0}, - {"PzlLand", fProfile::OBJ_PUZZLE_ISLAND, fProfile::OBJ_PUZZLE_ISLAND, 0xFFFF, 0xFF, 0}, - {"RRckTag", fProfile::RIDE_ROCK_SET_TAG, fProfile::RIDE_ROCK_SET_TAG, 0xFFFF, 0xFF, 0}, - { "RaceM", fProfile::AVATER_RACE_MNG, fProfile::AVATER_RACE_MNG, 0xFFFF, 0xFF, 0}, - {"RailEnd", fProfile::OBJ_RAIL_END, fProfile::OBJ_RAIL_END, 0xFFFF, 0xFF, 0}, - {"RailPst", fProfile::OBJ_RAIL_POST, fProfile::OBJ_RAIL_POST, 0xFFFF, 0xFF, 0}, - {"RidRock", fProfile::OBJ_RIDE_ROCK, fProfile::OBJ_RIDE_ROCK, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "RkDrgn", fProfile::OBJ_ROCK_DRAGON, fProfile::OBJ_ROCK_DRAGON, 0xFFFF, 42, 0}, - {"RoAtLog", fProfile::TAG_ROLL_ATTACK_LOG, fProfile::TAG_ROLL_ATTACK_LOG, 0xFFFF, 0xFF, 0}, - {"RoAtTag", fProfile::RO_AT_TAR_MANAGER_TAG, fProfile::RO_AT_TAR_MANAGER_TAG, 0xFFFF, 0xFF, 0}, - {"RoAtTar", fProfile::OBJ_RO_AT_TARGET, fProfile::OBJ_RO_AT_TARGET, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"RoLight", fProfile::OBJ_ROTATION_LIGHT, fProfile::OBJ_ROTATION_LIGHT, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"RockSky", fProfile::OBJ_ROCK_SKY, fProfile::OBJ_ROCK_SKY, 0xFFFF, 0xFF, 0}, - {"RolRock", fProfile::OBJ_ROLL_ROCK, fProfile::OBJ_ROLL_ROCK, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"RopeBas", fProfile::OBJ_ROPE_BASE, fProfile::OBJ_ROPE_BASE, 0xFFFF, 0xFF, 0}, - {"RopeIga", fProfile::OBJ_ROPE_IGAIGA, fProfile::OBJ_ROPE_IGAIGA, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"RouletC", fProfile::OBJ_ROULETTE_ISLAND_C, fProfile::OBJ_ROULETTE_ISLAND_C, 0xFFFF, 0xFF, 0}, - {"RouletR", fProfile::OBJ_ROULETTE_ISLAND_R, fProfile::OBJ_ROULETTE_ISLAND_R, 0xFFFF, 0xFF, 0}, - {"Roulete", fProfile::OBJ_ROULETTE, fProfile::OBJ_ROULETTE, 540, SND_SOURCE_OBJECT, 0}, - {"RuinSav", fProfile::OBJ_RUINED_SAVE, fProfile::OBJ_RUINED_SAVE, 0xFFFF, 0xFF, 0}, - {"SKinoko", fProfile::OBJ_MUSHROOM, fProfile::OBJ_MUSHROOM, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"SStatue", fProfile::OBJ_STEP_STATUE, fProfile::OBJ_STEP_STATUE, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"STCover", fProfile::OBJ_STAGE_COVER, fProfile::OBJ_STAGE_COVER, 0xFFFF, 0xFF, 0}, - {"STCrack", fProfile::OBJ_STAGE_CRACK, fProfile::OBJ_STAGE_CRACK, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"STKraPt", fProfile::OBJ_STAGE_KRAKEN_PARTS, fProfile::OBJ_STAGE_KRAKEN_PARTS, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"STKrake", fProfile::OBJ_STAGE_KRAKEN, fProfile::OBJ_STAGE_KRAKEN, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "STSink", fProfile::OBJ_STAGE_SINK, fProfile::OBJ_STAGE_SINK, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"STWater", fProfile::OBJ_STAGE_WATER, fProfile::OBJ_STAGE_WATER, 0xFFFF, 0xFF, 0}, - { "Sail", fProfile::OBJ_SAIL, fProfile::OBJ_SAIL, 0xFFFF, 0xFF, 0}, - {"Sandbag", fProfile::OBJ_SANDBAG, fProfile::OBJ_SANDBAG, 0xFFFF, 0xFF, 0}, - {"ScChang", fProfile::SC_CHANGE_TAG, fProfile::SC_CHANGE_TAG, 0xFFFF, 0xFF, 0}, - { "Scarab", fProfile::INSECT_SCARAB, fProfile::INSECT_SCARAB, 775, SND_SOURCE_INSECT, 0}, - { "SdCdl", fProfile::OBJ_SWORD_CANDLE, fProfile::OBJ_SWORD_CANDLE, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"SeaF301", fProfile::OBJ_SEA_F301, fProfile::OBJ_SEA_F301, 0xFFFF, 0xFF, 0}, - { "Shed", fProfile::OBJ_SHED, fProfile::OBJ_SHED, 0xFFFF, 0xFF, 0}, - {"ShipFld", fProfile::TAG_SHIP_FLOOD, fProfile::TAG_SHIP_FLOOD, 0xFFFF, 0xFF, 0}, - {"ShipSlp", fProfile::TAG_SHIP_SLOPE, fProfile::TAG_SHIP_SLOPE, 0xFFFF, 0xFF, 0}, - {"ShipWin", fProfile::OBJ_SHIP_WINDOW, fProfile::OBJ_SHIP_WINDOW, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"ShpSmpl", fProfile::SHOP_SAMPLE, fProfile::SHOP_SAMPLE, 553, 0xFF, 0}, - {"ShriAft", fProfile::OBJ_SHRINE_AFTER, fProfile::OBJ_SHRINE_AFTER, 0xFFFF, 0xFF, 0}, - {"ShriBef", fProfile::OBJ_SHRINE_BEFORE, fProfile::OBJ_SHRINE_BEFORE, 0xFFFF, 0xFF, 0}, - {"ShriIns", fProfile::OBJ_SHRINE_BEF_INSIDE, fProfile::OBJ_SHRINE_BEF_INSIDE, 0xFFFF, 0xFF, 0}, - { "ShtCS", fProfile::OBJ_SHUTTER_CHANGE_SCENE, fProfile::OBJ_SHUTTER_CHANGE_SCENE, 0xFFFF, SND_SOURCE_SHUTTER, 0}, - {"ShtrWtr", fProfile::OBJ_SHUTTER_WATER_D101, fProfile::OBJ_SHUTTER_WATER_D101, 0xFFFF, SND_SOURCE_SHUTTER, 0}, - { "SideST", fProfile::OBJ_SIDE_SHUTTER, fProfile::OBJ_SIDE_SHUTTER, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"Siren2D", fProfile::OBJ_SIREN_2DMAP, fProfile::OBJ_SIREN_2DMAP, 0xFFFF, 0xFF, 0}, - {"SirenTg", fProfile::SIREN_TAG, fProfile::SIREN_TAG, 0xFFFF, 0xFF, 0}, - {"SkEnmyT", fProfile::SKYENEMY_T, fProfile::SKYENEMY_T, 0xFFFF, 59, 0}, - {"SldDoor", fProfile::OBJ_SEALED_DOOR, fProfile::OBJ_SEALED_DOOR, 0xFFFF, 0xFF, 0}, - {"SliceLg", fProfile::OBJ_SLICE_LOG, fProfile::OBJ_SLICE_LOG, 543, SND_SOURCE_OBJECT, 0}, - {"SlicePt", fProfile::OBJ_SLICE_LOG_PARTS, fProfile::OBJ_SLICE_LOG_PARTS, 543, SND_SOURCE_OBJECT, 0}, - { "Smoke", fProfile::OBJ_SMOKE, fProfile::OBJ_SMOKE, 0xFFFF, 0xFF, 0}, - {"SnLight", fProfile::OBJ_SUN_LIGHT, fProfile::OBJ_SUN_LIGHT, 0xFFFF, 0xFF, 0}, - {"SndD301", fProfile::OBJ_SAND_D301, fProfile::OBJ_SAND_D301, 0xFFFF, 0xFF, 0}, - { "SndStn", fProfile::OBJ_STONE_STAND, fProfile::OBJ_STONE_STAND, 558, SND_SOURCE_OBJECT, 0}, - { "SngGS", fProfile::OBJ_GODDESS_STATUE, fProfile::OBJ_GODDESS_STATUE, 0xFFFF, 0xFF, 0}, - {"SnkFlrF", fProfile::OBJ_SINK_FLOOR_F, fProfile::OBJ_SINK_FLOOR_F, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "Soil", fProfile::OBJ_SOIL, fProfile::OBJ_SOIL, 0xFFFF, 33, 0}, - {"SpWinTg", fProfile::TAG_SHIP_WINDOW, fProfile::TAG_SHIP_WINDOW, 0xFFFF, 0xFF, 0}, - {"SparkTg", fProfile::SPARKS_TAG, fProfile::SPARKS_TAG, 0xFFFF, 0xFF, 0}, - {"SpiderL", fProfile::OBJ_SPIDER_LINE, fProfile::OBJ_SPIDER_LINE, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "Spike", fProfile::OBJ_SPIKE, fProfile::OBJ_SPIKE, 0xFFFF, 0xFF, 0}, - { "SpkTg2", fProfile::SPARKS2_TAG, fProfile::SPARKS2_TAG, 0xFFFF, 0xFF, 0}, - { "Spore", fProfile::OBJ_SPORE, fProfile::OBJ_SPORE, 0xFFFF, 0xFF, 0}, - {"SporeTg", fProfile::SPORE_TAG, fProfile::SPORE_TAG, 0xFFFF, 0xFF, 0}, - { "SrnSk", fProfile::OBJ_SIREN_BARRIER, fProfile::OBJ_SIREN_BARRIER, 0xFFFF, 0xFF, 0}, - { "StepTS", fProfile::OBJ_STEP_TIME_SLIP, fProfile::OBJ_STEP_TIME_SLIP, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"StgBgTs", fProfile::OBJ_TIME_STAGE_BG, fProfile::OBJ_TIME_STAGE_BG, 0xFFFF, 0xFF, 0}, - { "StpGm", fProfile::OBJ_STEP_GUMARM, fProfile::OBJ_STEP_GUMARM, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"StpRope", fProfile::OBJ_STOPPING_ROPE, fProfile::OBJ_STOPPING_ROPE, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "StprRc", fProfile::OBJ_STOPPER_ROCK, fProfile::OBJ_STOPPER_ROCK, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"StrLava", fProfile::OBJ_STREAM_LAVA, fProfile::OBJ_STREAM_LAVA, 0xFFFF, 0xFF, 0}, - {"StreamT", fProfile::TAG_STREAM, fProfile::TAG_STREAM, 0xFFFF, 0xFF, 0}, - { "Sw", fProfile::OBJ_SW, fProfile::OBJ_SW, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"SwAreaT", fProfile::SW_AREA_TAG, fProfile::SW_AREA_TAG, 0xFFFF, 0xFF, 0}, - { "SwBnk", fProfile::OBJ_SW_BANK, fProfile::OBJ_SW_BANK, 527, SND_SOURCE_OBJECT, 0}, - { "SwBnkS", fProfile::OBJ_SW_BANK_SMALL, fProfile::OBJ_SW_BANK_SMALL, 528, SND_SOURCE_OBJECT, 0}, - { "SwDir", fProfile::OBJ_SW_DIR, fProfile::OBJ_SW_DIR, 536, SND_SOURCE_OBJECT, 0}, - { "SwDir2", fProfile::OBJ_SW_DIR_DOOR, fProfile::OBJ_SW_DIR_DOOR, 516, SND_SOURCE_OBJECT, 0}, - { "SwHrp", fProfile::OBJ_SW_HARP, fProfile::OBJ_SW_HARP, 548, SND_SOURCE_SW_HARP, 0}, - { "SwSB", fProfile::OBJ_SW_SWORD_BEAM, fProfile::OBJ_SW_SWORD_BEAM, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "SwTag", fProfile::SW_TAG, fProfile::SW_TAG, 0xFFFF, 0xFF, 0}, - { "SwWall", fProfile::OBJ_SWITCH_WALL, fProfile::OBJ_SWITCH_WALL, 519, SND_SOURCE_OBJECT, 0}, - { "SwdStb", fProfile::OBJ_SWORD_STAB, fProfile::OBJ_SWORD_STAB, 0xFFFF, 0xFF, 0}, - { "Swhit", fProfile::OBJ_SWHIT, fProfile::OBJ_SWHIT, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"SwrdPrj", fProfile::OBJ_SWRD_PRJ, fProfile::OBJ_SWRD_PRJ, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "SwrdSt", fProfile::OBJ_SEAT_SWORD, fProfile::OBJ_SEAT_SWORD, 0xFFFF, 0xFF, 0}, - { "TAgo", fProfile::OBJ_DESERT_AGO, fProfile::OBJ_DESERT_AGO, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "TBcal", fProfile::T_BCAL, fProfile::T_BCAL, 0xFFFF, 0xFF, 0}, - { "TBoat", fProfile::OBJ_TIME_BOAT, fProfile::OBJ_TIME_BOAT, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "TBoatB", fProfile::OBJ_TIME_BOAT_BULLET, fProfile::OBJ_TIME_BOAT_BULLET, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "TBox", fProfile::TBOX, fProfile::TBOX, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "TChk", fProfile::TAG_TIME_AREA_CHECK, fProfile::TAG_TIME_AREA_CHECK, 0xFFFF, 0xFF, 0}, - { "TDoor", fProfile::OBJ_TIME_DOOR, fProfile::OBJ_TIME_DOOR, 0xFFFF, 42, 0}, - { "TDoorB", fProfile::OBJ_TIME_DOOR_BEFORE, fProfile::OBJ_TIME_DOOR_BEFORE, 556, 0xFF, 0}, - {"TGrD101", fProfile::OBJ_TOWER_GEAR_D101, fProfile::OBJ_TOWER_GEAR_D101, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"TKumite", fProfile::T_KUMITE, fProfile::T_KUMITE, 0xFFFF, 0xFF, 0}, - { "TPole", fProfile::OBJ_TARZAN_POLE, fProfile::OBJ_TARZAN_POLE, 523, SND_SOURCE_OBJECT, 0}, - { "TRail", fProfile::OBJ_TENI_RAIL, fProfile::OBJ_TENI_RAIL, 0xFFFF, 0xFF, 0}, - {"TRalPst", fProfile::OBJ_TENI_RAIL_POST, fProfile::OBJ_TENI_RAIL_POST, 0xFFFF, 0xFF, 0}, - { "TSBase", fProfile::OBJ_TIME_BASE, fProfile::OBJ_TIME_BASE, 0xFFFF, 0xFF, 0}, - { "TSBlk", fProfile::OBJ_TIME_BLOCK, fProfile::OBJ_TIME_BLOCK, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "TWeed", fProfile::OBJ_TUMBLE_WEED, fProfile::OBJ_TUMBLE_WEED, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "Tckl", fProfile::OBJ_TACKLE, fProfile::OBJ_TACKLE, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"TerBike", fProfile::OBJ_TERRY_BIKE, fProfile::OBJ_TERRY_BIKE, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"TerrGmk", fProfile::OBJ_TERRY_GIMMICK, fProfile::OBJ_TERRY_GIMMICK, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"TerrHol", fProfile::OBJ_TERRY_HOLE, fProfile::OBJ_TERRY_HOLE, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "TerrSw", fProfile::OBJ_TERRY_SWITCH, fProfile::OBJ_TERRY_SWITCH, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "TgClay", fProfile::TAG_PUMPKIN_CLAY, fProfile::TAG_PUMPKIN_CLAY, 0xFFFF, 0xFF, 0}, - {"TgClefG", fProfile::TAG_CLEF_GAME, fProfile::TAG_CLEF_GAME, 0xFFFF, 0xFF, 0}, - {"TgClefM", fProfile::TAG_CLEF_MANAGER, fProfile::TAG_CLEF_MANAGER, 0xFFFF, 0xFF, 0}, - {"TgD3Chg", fProfile::TAG_D3_SCENE_CHANGE, fProfile::TAG_D3_SCENE_CHANGE, 0xFFFF, 0xFF, 0}, - {"TgDefea", fProfile::TAG_DEFEAT_BOSS, fProfile::TAG_DEFEAT_BOSS, 0xFFFF, 0xFF, 0}, - {"TgFence", fProfile::TAG_FENCE_SYNCHRONIZER, fProfile::TAG_FENCE_SYNCHRONIZER, 0xFFFF, 0xFF, 0}, - {"TgMICap", fProfile::TAG_MINIGAME_INSECT_CAPTURE, fProfile::TAG_MINIGAME_INSECT_CAPTURE, 0xFFFF, 0xFF, 0}, - { "TgMien", fProfile::TAG_MIECHAN, fProfile::TAG_MIECHAN, 0xFFFF, 0xFF, 0}, - {"TgNoEff", fProfile::TAG_NOEFFECT_AREA, fProfile::TAG_NOEFFECT_AREA, 0xFFFF, 0xFF, 0}, - {"TgRBoat", fProfile::TAG_ROCK_BOAT, fProfile::TAG_ROCK_BOAT, 0xFFFF, 0xFF, 0}, - {"TgReact", fProfile::TAG_REACTION, fProfile::TAG_REACTION, 0xFFFF, 0xFF, 0}, - {"TgRstTs", fProfile::TAG_RESTART_TIME_STONE, fProfile::TAG_RESTART_TIME_STONE, 0xFFFF, 0xFF, 0}, - { "TgSBG", fProfile::TAG_SWORD_BATTLE_GAME, fProfile::TAG_SWORD_BATTLE_GAME, 0xFFFF, 0xFF, 0}, - { "TgSTA", fProfile::TAG_SIREN_TIME_ATTACK, fProfile::TAG_SIREN_TIME_ATTACK, 0xFFFF, 0xFF, 0}, - {"TgSndAr", fProfile::TAG_SOUND_AREA, fProfile::TAG_SOUND_AREA, 0xFFFF, 0xFF, 0}, - {"TgSndMg", fProfile::SOUND_AREA_MGR, fProfile::SOUND_AREA_MGR, 0xFFFF, 0xFF, 0}, - {"TgSound", fProfile::SOUND_TAG, fProfile::SOUND_TAG, 0xFFFF, 0xFF, 0}, - { "TgTDB", fProfile::TAG_TIME_DOOR_BEAM, fProfile::TAG_TIME_DOOR_BEAM, 0xFFFF, 0xFF, 0}, - { "TgTckl", fProfile::TACKLE_TAG, fProfile::TACKLE_TAG, 0xFFFF, 0xFF, 0}, - {"TgTimer", fProfile::TAG_TIMER, fProfile::TAG_TIMER, 0xFFFF, 0xFF, 0}, - { "TgTrap", fProfile::OBJ_TOGE_TRAP, fProfile::OBJ_TOGE_TRAP, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "TgTw", fProfile::TUMBLE_WEED_TAG, fProfile::TUMBLE_WEED_TAG, 0xFFFF, 59, 0}, - { "TimeIs", fProfile::OBJ_TENIJIMA, fProfile::OBJ_TENIJIMA, 0xFFFF, 0xFF, 0}, - {"TimeStn", fProfile::OBJ_TIME_STONE, fProfile::OBJ_TIME_STONE, 0xFFFF, SND_SOURCE_TIME_STONE, 0}, - { "TkEvnt", fProfile::TAG_TKEVNT, fProfile::TAG_TKEVNT, 0xFFFF, 0xFF, 0}, - { "TlpTag", fProfile::TLP_TAG, fProfile::TLP_TAG, 0xFFFF, 0xFF, 0}, - {"ToD3Stn", fProfile::OBJ_TOD3_STONE, fProfile::OBJ_TOD3_STONE, 537, 0xFF, 0}, - {"Tornado", fProfile::OBJ_TORNADO, fProfile::OBJ_TORNADO, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"TouchTa", fProfile::TOUCH_TAG, fProfile::TOUCH_TAG, 0xFFFF, 0xFF, 0}, - { "TowerB", fProfile::OBJ_TOWER_BOMB, fProfile::OBJ_TOWER_BOMB, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"TowerHa", fProfile::OBJ_TOWER_HAND_D101, fProfile::OBJ_TOWER_HAND_D101, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"TrRaiCo", fProfile::OBJ_TRUCK_RAIL_COL, fProfile::OBJ_TRUCK_RAIL_COL, 0xFFFF, 0xFF, 0}, - {"TrShtCs", fProfile::OBJ_TR_SHUTTER_CS, fProfile::OBJ_TR_SHUTTER_CS, 0xFFFF, SND_SOURCE_SHUTTER, 0}, - {"TrapRc1", fProfile::OBJ_TRAP_ROCK_1, fProfile::OBJ_TRAP_ROCK_1, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"TriForc", fProfile::OBJ_TRIFORCE, fProfile::OBJ_TRIFORCE, 0xFFFF, 0xFF, 0}, - {"TrpBrdW", fProfile::OBJ_TRAP_BIRD_WOOD, fProfile::OBJ_TRAP_BIRD_WOOD, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"TruRail", fProfile::TRUCK_RAIL, fProfile::TRUCK_RAIL, 0xFFFF, 0xFF, 0}, - { "Truck", fProfile::OBJ_TRUCK, fProfile::OBJ_TRUCK, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"TrukStp", fProfile::OBJ_TRUCK_STOPPER, fProfile::OBJ_TRUCK_STOPPER, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "Tshop", fProfile::OBJ_TERRY_SHOP, fProfile::OBJ_TERRY_SHOP, 0xFFFF, SND_SOURCE_TERRY_SHOP, 0}, - {"TstShtr", fProfile::SHUTTER, fProfile::SHUTTER, 0xFFFF, SND_SOURCE_SHUTTER, 0}, - { "Tubo", fProfile::OBJ_TUBO, fProfile::OBJ_TUBO, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "UDLava", fProfile::OBJ_UPDOWN_LAVA, fProfile::OBJ_UPDOWN_LAVA, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"UdCloud", fProfile::OBJ_UNDER_CLOUD, fProfile::OBJ_UNDER_CLOUD, 0xFFFF, 0xFF, 0}, - {"UgSwitc", fProfile::OBJ_UG_SWITCH, fProfile::OBJ_UG_SWITCH, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"Uground", fProfile::OBJ_UNDERGROUND, fProfile::OBJ_UNDERGROUND, 0xFFFF, 59, 0}, - {"UtaLand", fProfile::OBJ_UTAJIMA_ISLAND, fProfile::OBJ_UTAJIMA_ISLAND, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "UtaLv2", fProfile::OBJ_UTAJIMA_LV2, fProfile::OBJ_UTAJIMA_LV2, 0xFFFF, 0xFF, 0}, - {"UtaMain", fProfile::OBJ_UTAJIMA_MAIN_MECHA, fProfile::OBJ_UTAJIMA_MAIN_MECHA, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"UtaPeds", fProfile::OBJ_UTAJIMA_PEDESTAL, fProfile::OBJ_UTAJIMA_PEDESTAL, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"UtaStop", fProfile::OBJ_UTAJIMA_STOPPER, fProfile::OBJ_UTAJIMA_STOPPER, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"Utajima", fProfile::OBJ_UTAJIMA, fProfile::OBJ_UTAJIMA, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "V_Clip", fProfile::VIEW_CLIP_TAG, fProfile::VIEW_CLIP_TAG, 0xFFFF, 0xFF, 0}, - {"VacuDsP", fProfile::OBJ_VACU_DUST_PARTS, fProfile::OBJ_VACU_DUST_PARTS, 0xFFFF, 0xFF, 0}, - {"VacuDst", fProfile::OBJ_VACU_DUST, fProfile::OBJ_VACU_DUST, 0xFFFF, 0xFF, 0}, - { "Vdb", fProfile::OBJ_VDB, fProfile::OBJ_VDB, 0xFFFF, SND_SOURCE_BULLET, 0}, - {"VentFan", fProfile::OBJ_VENT_FAN, fProfile::OBJ_VENT_FAN, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "Vortex", fProfile::OBJ_VORTEX, fProfile::OBJ_VORTEX, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "Vrbox", fProfile::VRBOX_TAG, fProfile::VRBOX_TAG, 0xFFFF, 0xFF, 0}, - { "WFF102", fProfile::OBJ_WATERFALL_F102, fProfile::OBJ_WATERFALL_F102, 0xFFFF, 0xFF, 0}, - { "Warp", fProfile::TIME_AREA, fProfile::TIME_AREA, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "WarpH", fProfile::OBJ_WARP_HOLE, fProfile::OBJ_WARP_HOLE, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"WarpObj", fProfile::OBJ_WARP, fProfile::OBJ_WARP, 547, SND_SOURCE_OBJECT_WARP, 0}, - {"WaterSW", fProfile::OBJ_WATER_SWITCH, fProfile::OBJ_WATER_SWITCH, 526, SND_SOURCE_OBJECT, 0}, - {"WaterSf", fProfile::OBJ_WATER_SURFACE, fProfile::OBJ_WATER_SURFACE, 0xFFFF, 0xFF, 0}, - {"WaterSp", fProfile::OBJ_WATER_SPOUT, fProfile::OBJ_WATER_SPOUT, 0xFFFF, 0xFF, 0}, - {"WatrIga", fProfile::OBJ_WATER_IGAIGA, fProfile::OBJ_WATER_IGAIGA, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"WdBoard", fProfile::OBJ_WOOD_BOARD, fProfile::OBJ_WOOD_BOARD, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "Wind", fProfile::OBJ_WIND, fProfile::OBJ_WIND, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "Wind02", fProfile::OBJ_WIND02, fProfile::OBJ_WIND02, 0xFFFF, 0xFF, 0}, - { "Wind03", fProfile::OBJ_WIND03, fProfile::OBJ_WIND03, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "Wind04", fProfile::OBJ_WIND04, fProfile::OBJ_WIND04, 0xFFFF, 0xFF, 0}, - {"Windmil", fProfile::OBJ_WINDMILL, fProfile::OBJ_WINDMILL, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"WnLeafA", fProfile::OBJ_WATER_NUT_LEAF, fProfile::OBJ_WATER_NUT_LEAF, 542, SND_SOURCE_OBJECT, 1}, - {"WnLeafB", fProfile::OBJ_WATER_NUT_LEAF, fProfile::OBJ_WATER_NUT_LEAF, 0xFFFF, SND_SOURCE_OBJECT, 2}, - {"WnLeafC", fProfile::OBJ_WATER_NUT_LEAF, fProfile::OBJ_WATER_NUT_LEAF, 542, SND_SOURCE_OBJECT, 3}, - {"WnLeafD", fProfile::OBJ_WATER_NUT_LEAF, fProfile::OBJ_WATER_NUT_LEAF, 0xFFFF, SND_SOURCE_OBJECT, 4}, - {"WndMilD", fProfile::OBJ_WINDMILL_DESERT, fProfile::OBJ_WINDMILL_DESERT, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"WoodTag", fProfile::WOODAREA_TAG, fProfile::WOODAREA_TAG, 0xFFFF, 0xFF, 1}, - {"WoodTg2", fProfile::WOODAREA_TAG, fProfile::WOODAREA_TAG, 0xFFFF, 0xFF, 2}, - {"WtFD100", fProfile::OBJ_WATERFALL_D100, fProfile::OBJ_WATERFALL_D100, 0xFFFF, 0xFF, 0}, - {"WtrF100", fProfile::OBJ_WATER_F100, fProfile::OBJ_WATER_F100, 0xFFFF, 0xFF, 0}, - { "WtrJar", fProfile::OBJ_WATER_JAR, fProfile::OBJ_WATER_JAR, 552, 0xFF, 0}, - { "WtrMrk", fProfile::OBJ_WATER_MARK, fProfile::OBJ_WATER_MARK, 0xFFFF, 0xFF, 0}, - {"WtrShld", fProfile::OBJ_WATER_SHIELD, fProfile::OBJ_WATER_SHIELD, 0xFFFF, 0xFF, 0}, - { "chest", fProfile::OBJ_CHEST, fProfile::OBJ_CHEST, 0xFFFF, 42, 0}, - { "d2ship", fProfile::OBJ_DUNGEON_SHIP, fProfile::OBJ_DUNGEON_SHIP, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "fruit", fProfile::OBJ_FRUIT, fProfile::OBJ_FRUIT, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "ftower", fProfile::OBJ_TOWER_D101, fProfile::OBJ_TOWER_D101, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "lock", fProfile::OBJ_SHUTTER_LOCK, fProfile::OBJ_SHUTTER_LOCK, 0xFFFF, SND_SOURCE_SHUTTER, 0}, - {"needleU", fProfile::OBJ_NEEDLE_UNDERGROUND, fProfile::OBJ_NEEDLE_UNDERGROUND, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"rpiller", fProfile::OBJ_ROLL_PILLAR, fProfile::OBJ_ROLL_PILLAR, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "sandD1", fProfile::OBJ_SAND_FLOOR, fProfile::OBJ_SAND_FLOOR, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"sandflr", fProfile::OBJ_SAND_FLOOR, fProfile::OBJ_SAND_FLOOR, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"saveObj", fProfile::OBJ_SAVE, fProfile::OBJ_SAVE, 515, 0xFF, 0}, - { "skull", fProfile::OBJ_SKULL, fProfile::OBJ_SKULL, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"sw_whip", fProfile::OBJ_SW_WHIPLEVER, fProfile::OBJ_SW_WHIPLEVER, 522, SND_SOURCE_OBJECT, 0}, - { "swsht", fProfile::OBJ_SWITCH_SHUTTER, fProfile::OBJ_SWITCH_SHUTTER, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"swsyako", fProfile::OBJ_SW_SYAKO, fProfile::OBJ_SW_SYAKO, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"syashtr", fProfile::OBJ_SYAKO_SHUTTER, fProfile::OBJ_SYAKO_SHUTTER, 0xFFFF, SND_SOURCE_SHUTTER, 0}, - {"trlshut", fProfile::OBJ_TROLLEY_SHUTTER, fProfile::OBJ_TROLLEY_SHUTTER, 0xFFFF, SND_SOURCE_SHUTTER, 0}, - {"trolley", fProfile::OBJ_TROLLEY, fProfile::OBJ_TROLLEY, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "tware", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "vmSand", fProfile::OBJ_VSD, fProfile::OBJ_VSD, 0xFFFF, SND_SOURCE_OBJECT, 0}, - {"weather", fProfile::WEATHER_TAG, fProfile::WEATHER_TAG, 0xFFFF, 0xFF, 0}, - { "wfall", fProfile::OBJ_WATERFALL_D101, fProfile::OBJ_WATERFALL_D101, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "wnleaf", fProfile::OBJ_WATER_NUT_LEAF, fProfile::OBJ_WATER_NUT_LEAF, 0xFFFF, SND_SOURCE_OBJECT, 0}, - { "wnut", fProfile::OBJ_WATER_NUT, fProfile::OBJ_WATER_NUT, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "$act01", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 1}, + { "$act02", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 2}, + { "$act03", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 3}, + { "$act04", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 4}, + { "$act05", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 5}, + { "$act06", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 6}, + { "$act07", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 7}, + { "$act08", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 8}, + { "$act09", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 9}, + { "$act10", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 10}, + { "$act11", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 11}, + { "$act12", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 12}, + { "$act13", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 13}, + { "$act14", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 14}, + { "$act15", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 15}, + { "$act16", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 16}, + { "$act17", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 17}, + { "$act18", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 18}, + { "$act19", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 19}, + { "$act20", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 20}, + { "$act21", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 21}, + { "$act22", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 22}, + { "$act23", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 23}, + { "$act24", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 24}, + { "$act25", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 25}, + { "$act26", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 26}, + { "$act27", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 27}, + { "$act28", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 28}, + { "$act29", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 29}, + { "$act30", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 30}, + { "$act31", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 31}, + { "$act32", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 32}, + { "$act33", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 33}, + { "$act34", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 34}, + { "$act35", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 35}, + { "$act36", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 36}, + { "$act37", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 37}, + { "$act38", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 38}, + { "$act39", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 39}, + { "$act40", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 40}, + { "$act41", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 41}, + { "$act42", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 42}, + { "$act43", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 43}, + { "$act44", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 44}, + { "$act45", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 45}, + { "$act46", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 46}, + { "$act47", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 47}, + { "$act48", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 48}, + { "$act49", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 49}, + { "$act50", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 50}, + { "$act51", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 51}, + { "$act52", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 52}, + { "$act53", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 53}, + { "$act54", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 54}, + { "$act55", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 55}, + { "$act56", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 56}, + { "$act57", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 57}, + { "$act58", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 58}, + { "$act59", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 59}, + { "$act60", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 60}, + { "$act61", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 61}, + { "$act62", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 62}, + { "$act63", fProfile::JSTUDIO_ACTOR, fProfile::JSTUDIO_ACTOR, 0xFFFF, 0xFF, 63}, + { "$snd", fProfile::JSTUDIO_SYSOBJ, fProfile::JSTUDIO_SYSOBJ, 0xFFFF, 0xFF, 1}, + { "$sys", fProfile::JSTUDIO_SYSOBJ, fProfile::JSTUDIO_SYSOBJ, 0xFFFF, 0xFF, 0}, + { "AFlw", fProfile::OBJ_FLOWER_ANCIENT, fProfile::OBJ_FLOWER_ANCIENT, 0xFFFF, SND_SOURCE_ITEM, 0}, + { "ActTag", fProfile::ACTION_TAG, fProfile::ACTION_TAG, 0xFFFF, 0xFF, 0}, + { "Amber", fProfile::OBJ_AMBER, fProfile::OBJ_AMBER, 0xFFFF, 0xFF, 0}, + {"AncJwls", fProfile::OBJ_ANCIENT_JEWELS, fProfile::OBJ_ANCIENT_JEWELS, 0xFFFF, SND_SOURCE_ITEM, 0}, + { "Ant", fProfile::INSECT_ANT, fProfile::INSECT_ANT, 774, SND_SOURCE_INSECT, 0}, + {"ApBridg", fProfile::OBJ_APPEAR_BRIDGE, fProfile::OBJ_APPEAR_BRIDGE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Arrow", fProfile::ARROW, fProfile::ARROW, 0xFFFF, SND_SOURCE_ARROW, 0}, + {"ArrowSW", fProfile::OBJ_ARROW_SWITCH, fProfile::OBJ_ARROW_SWITCH, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "AsuArm", fProfile::ASURA_ARM, fProfile::ASURA_ARM, 0xFFFF, 15, 0}, + { "AsuFoo", fProfile::ASURA_FOOT, fProfile::ASURA_FOOT, 0xFFFF, 15, 0}, + { "AsuraB", fProfile::ASURA_BULLET, fProfile::ASURA_BULLET, 0xFFFF, SND_SOURCE_BULLET, 0}, + { "AsuraP", fProfile::ASURA_PILLAR, fProfile::ASURA_PILLAR, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "AsuraS", fProfile::ASURA_SWORD, fProfile::ASURA_SWORD, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "AttTag", fProfile::ATT_TAG, fProfile::ATT_TAG, 0xFFFF, 0xFF, 0}, + {"AutoMes", fProfile::TAG_AUTO_MESSAGE, fProfile::TAG_AUTO_MESSAGE, 0xFFFF, 0xFF, 0}, + {"B300Snd", fProfile::OBJ_B300_SAND, fProfile::OBJ_B300_SAND, 0xFFFF, 0xFF, 0}, + { "BAsura", fProfile::B_ASURA, fProfile::B_ASURA, 48, 19, 0}, + { "BBObjs", fProfile::OBJ_BB_OBJECTS, fProfile::OBJ_BB_OBJECTS, 0xFFFF, 0xFF, 0}, + {"BBParts", fProfile::OBJ_BB_BROKEN_PARTS, fProfile::OBJ_BB_BROKEN_PARTS, 0xFFFF, 0xFF, 0}, + {"BBQuake", fProfile::T_QUAKE, fProfile::T_QUAKE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "BBbrg", fProfile::OBJ_BB_BRIDGE, fProfile::OBJ_BB_BRIDGE, 0xFFFF, 0xFF, 0}, + {"BBigBo2", fProfile::B_BIGBOSS2, fProfile::B_BIGBOSS2, 53, SND_SOURCE_BIGBOSS, 0}, + {"BBigBo3", fProfile::B_BIGBOSS3, fProfile::B_BIGBOSS3, 54, SND_SOURCE_BIGBOSS, 0}, + {"BBigBoB", fProfile::B_BIGBOSS_BASE, fProfile::B_BIGBOSS_BASE, 0xFFFF, 0xFF, 0}, + {"BBigBos", fProfile::B_BIGBOSS, fProfile::B_BIGBOSS, 52, SND_SOURCE_BIGBOSS, 0}, + {"BBigShc", fProfile::B_BBSHWV, fProfile::B_BBSHWV, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "BBombf", fProfile::OBJ_BIGBOMB_FLOWER, fProfile::OBJ_BIGBOMB_FLOWER, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"BDrD101", fProfile::OBJ_DOOR_BOSSD101, fProfile::OBJ_DOOR_BOSSD101, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "BGh", fProfile::B_GIRAHIMU, fProfile::B_GIRAHIMU, 49, 19, 0}, + { "BGh2", fProfile::B_GIRAHIMU2, fProfile::B_GIRAHIMU2, 50, 19, 0}, + { "BGh3B", fProfile::B_GIRAHIMU3_BASE, fProfile::B_GIRAHIMU3_BASE, 0xFFFF, 0xFF, 0}, + {"BGh3Fst", fProfile::B_GIRAHIMU3_FIRST, fProfile::B_GIRAHIMU3_FIRST, 51, SND_SOURCE_GIRAHUMU_3, 0}, + {"BGh3Snd", fProfile::B_GIRAHIMU3_SECOND, fProfile::B_GIRAHIMU3_SECOND, 89, SND_SOURCE_GIRAHUMU_3, 0}, + {"BGh3Trd", fProfile::B_GIRAHIMU3_THIRD, fProfile::B_GIRAHIMU3_THIRD, 90, SND_SOURCE_GIRAHUMU_3, 0}, + { "BGhB", fProfile::B_GIRAHIMU_BASE, fProfile::B_GIRAHIMU_BASE, 0xFFFF, 0xFF, 0}, + { "BKr", fProfile::B_KR, fProfile::B_KR, 77, SND_SOURCE_BOSS_KR, 0}, + { "BKrA", fProfile::B_KRA, fProfile::B_KRA, 77, 15, 0}, + { "BKrH", fProfile::B_KRH, fProfile::B_KRH, 77, 15, 0}, + {"BLasBos", fProfile::B_LASTBOSS, fProfile::B_LASTBOSS, 0xFFFF, 19, 0}, + { "BMg", fProfile::B_MG, fProfile::B_MG, 10, SND_SOURCE_BOSS_MG, 0}, + { "BSpUp", fProfile::OBJ_BIRD_SP_UP, fProfile::OBJ_BIRD_SP_UP, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Bamboo", fProfile::OBJ_BAMBOO, fProfile::OBJ_BAMBOO, 533, SND_SOURCE_BAMBOO, 0}, + {"BarPsTg", fProfile::TAG_BARREL_POS, fProfile::TAG_BARREL_POS, 0xFFFF, 0xFF, 0}, + { "Barrel", fProfile::OBJ_BARREL, fProfile::OBJ_BARREL, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"BarrlTg", fProfile::TAG_BARREL, fProfile::TAG_BARREL, 0xFFFF, 0xFF, 0}, + {"BcAlArr", fProfile::E_BCALARROW, fProfile::E_BCALARROW, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"BcArrow", fProfile::E_BCARROW, fProfile::E_BCARROW, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "BcZTag", fProfile::BCZ_TAG, fProfile::BCZ_TAG, 0xFFFF, 0xFF, 0}, + { "Bee", fProfile::NPC_BEE, fProfile::NPC_BEE, 776, 15, 0}, + { "Beetle", fProfile::INSECT_BEETLE, fProfile::INSECT_BEETLE, 768, SND_SOURCE_INSECT, 0}, + { "Bell", fProfile::OBJ_BELL, fProfile::OBJ_BELL, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"BeltCvr", fProfile::OBJ_BELT_CVR, fProfile::OBJ_BELT_CVR, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"BigTubo", fProfile::OBJ_TUBO_BIG, fProfile::OBJ_TUBO_BIG, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "BirdB", fProfile::AVATER_BULLET, fProfile::AVATER_BULLET, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "BirdKA", fProfile::BIRD_KOBUNA, fProfile::BIRD_KOBUNA, 0xFFFF, 43, 0}, + { "BirdKB", fProfile::BIRD_KOBUNB, fProfile::BIRD_KOBUNB, 0xFFFF, 43, 0}, + {"BirdNpc", fProfile::BIRD_NPC, fProfile::BIRD_NPC, 0xFFFF, 43, 0}, + { "BirdR", fProfile::BIRD_RIVAL, fProfile::BIRD_RIVAL, 0xFFFF, 43, 0}, + {"BirdSta", fProfile::OBJ_BIRD_STATUE, fProfile::OBJ_BIRD_STATUE, 0xFFFF, 0xFF, 0}, + { "BirdT", fProfile::BIRD_TARGET, fProfile::BIRD_TARGET, 0xFFFF, 43, 0}, + { "BirdZT", fProfile::BIRD_ZELDA_TRAINING, fProfile::BIRD_ZELDA_TRAINING, 0xFFFF, 43, 0}, + { "Blade", fProfile::OBJ_BLADE, fProfile::OBJ_BLADE, 0xFFFF, 0xFF, 0}, + {"BlkRope", fProfile::OBJ_BLOCK_ROPE, fProfile::OBJ_BLOCK_ROPE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"BlockUg", fProfile::OBJ_BLOCK_UNDERGROUND, fProfile::OBJ_BLOCK_UNDERGROUND, 0xFFFF, 0xFF, 0}, + {"BlsRock", fProfile::OBJ_BLAST_ROCK, fProfile::OBJ_BLAST_ROCK, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Blst", fProfile::OBJ_BALLISTA, fProfile::OBJ_BALLISTA, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "BlstF3", fProfile::OBJ_BALLISTA_F3, fProfile::OBJ_BALLISTA_F3, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "BlstH", fProfile::OBJ_BALLISTA_HANDLE, fProfile::OBJ_BALLISTA_HANDLE, 0xFFFF, 0xFF, 0}, + {"BltObsT", fProfile::TAG_BELT_OBSTACLE, fProfile::TAG_BELT_OBSTACLE, 0xFFFF, 59, 0}, + {"BlwCoal", fProfile::OBJ_BLOW_COAL, fProfile::OBJ_BLOW_COAL, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Boat", fProfile::OBJ_BOAT, fProfile::OBJ_BOAT, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Bomb", fProfile::BOMB, fProfile::BOMB, 0xFFFF, SND_SOURCE_BOMB, 0}, + { "Bombf", fProfile::BOMBF, fProfile::BOMBF, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Boom", fProfile::BOOMERANG, fProfile::BOOMERANG, 0xFFFF, SND_SOURCE_BOOMERANG, 0}, + {"BoxCage", fProfile::OBJ_BOXCAGE_F300, fProfile::OBJ_BOXCAGE_F300, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "BrdMob", fProfile::BIRD_MOB, fProfile::BIRD_MOB, 0xFFFF, 0xFF, 0}, + { "BrgBn", fProfile::OBJ_BRIDGE_BONE, fProfile::OBJ_BRIDGE_BONE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"BrgFall", fProfile::OBJ_BRIDGE_FALL, fProfile::OBJ_BRIDGE_FALL, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "BrgStp", fProfile::OBJ_BRIDGE_STEP, fProfile::OBJ_BRIDGE_STEP, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "BrgTs", fProfile::OBJ_BRIDGE_TIME, fProfile::OBJ_BRIDGE_TIME, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"BridgeB", fProfile::OBJ_BRIDGE_BUILDING, fProfile::OBJ_BRIDGE_BUILDING, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"BridgeS", fProfile::OBJ_BRIDGE_STRETCH, fProfile::OBJ_BRIDGE_STRETCH, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Bstone", fProfile::OBJ_BSTONE, fProfile::OBJ_BSTONE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "BtlTg", fProfile::BEETLE_TAG, fProfile::BEETLE_TAG, 0xFFFF, 0xFF, 0}, + { "BtlTgA", fProfile::BEETLE_TAG, fProfile::BEETLE_TAG, 0xFFFF, 0xFF, 1}, + { "BtlTgB", fProfile::BEETLE_TAG, fProfile::BEETLE_TAG, 0xFFFF, 0xFF, 2}, + { "BtlTgC", fProfile::BEETLE_TAG, fProfile::BEETLE_TAG, 0xFFFF, 0xFF, 3}, + { "Bubble", fProfile::OBJ_BUBBLE, fProfile::OBJ_BUBBLE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "BulbSW", fProfile::OBJ_BULB_SWITCH, fProfile::OBJ_BULB_SWITCH, 524, SND_SOURCE_OBJECT, 0}, + { "Bullet", fProfile::COMMON_BULLET, fProfile::COMMON_BULLET, 0xFFFF, SND_SOURCE_BULLET, 0}, + {"Butrfly", fProfile::INSECT_BUTTERFLY, fProfile::INSECT_BUTTERFLY, 777, SND_SOURCE_INSECT, 0}, + { "Bvd", fProfile::B_VD, fProfile::B_VD, 65, 19, 0}, + {"CBomSld", fProfile::COL_BOMSLD, fProfile::COL_BOMSLD, 0xFFFF, 0xFF, 0}, + {"Cam2Tag", fProfile::CAMERA2_TAG, fProfile::CAMERA2_TAG, 0xFFFF, 0xFF, 0}, + { "CamTag", fProfile::CAMERA_TAG, fProfile::CAMERA_TAG, 0xFFFF, 0xFF, 0}, + { "Cannon", fProfile::OBJ_CANNON, fProfile::OBJ_CANNON, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"CannonC", fProfile::OBJ_CANNON_COVER, fProfile::OBJ_CANNON_COVER, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"Chandel", fProfile::OBJ_CHANDELIER, fProfile::OBJ_CHANDELIER, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Char", fProfile::OBJ_CHAIR, fProfile::OBJ_CHAIR, 0xFFFF, SND_SOURCE_OBJECT, 5}, + { "CharA", fProfile::OBJ_CHAIR, fProfile::OBJ_CHAIR, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "CharB", fProfile::OBJ_CHAIR, fProfile::OBJ_CHAIR, 0xFFFF, SND_SOURCE_OBJECT, 1}, + { "CharC", fProfile::OBJ_CHAIR, fProfile::OBJ_CHAIR, 0xFFFF, SND_SOURCE_OBJECT, 2}, + { "CharD", fProfile::OBJ_CHAIR, fProfile::OBJ_CHAIR, 0xFFFF, SND_SOURCE_OBJECT, 3}, + { "CharE", fProfile::OBJ_CHAIR, fProfile::OBJ_CHAIR, 0xFFFF, SND_SOURCE_OBJECT, 4}, + { "Cicada", fProfile::INSECT_CICADA, fProfile::INSECT_CICADA, 770, SND_SOURCE_INSECT, 0}, + { "City", fProfile::OBJ_CITY, fProfile::OBJ_CITY, 0xFFFF, 0xFF, 0}, + {"CityWtr", fProfile::OBJ_CITY_WATER, fProfile::OBJ_CITY_WATER, 0xFFFF, 0xFF, 0}, + {"ClawSTg", fProfile::OBJ_CLAW_SHOT_TG, fProfile::OBJ_CLAW_SHOT_TG, 0xFFFF, 33, 0}, + { "Clef", fProfile::OBJ_CLEF, fProfile::OBJ_CLEF, 0xFFFF, SND_SOURCE_CLEF, 0}, + {"CloudSD", fProfile::OBJ_CLOUD_DIVE, fProfile::OBJ_CLOUD_DIVE, 0xFFFF, 0xFF, 0}, + {"ClrWall", fProfile::OBJ_CLEARNESS_WALL, fProfile::OBJ_CLEARNESS_WALL, 0xFFFF, 0xFF, 0}, + {"CmCloud", fProfile::OBJ_CUMUL_CLOUD, fProfile::OBJ_CUMUL_CLOUD, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "CoTest", fProfile::CO_TEST, fProfile::CO_TEST, 0xFFFF, 0xFF, 0}, + { "Col", fProfile::OBJ_COL, fProfile::OBJ_COL, 0xFFFF, 0xFF, 0}, + { "ColStp", fProfile::COL_STP, fProfile::COL_STP, 0xFFFF, 0xFF, 0}, + {"CtrlPnl", fProfile::OBJ_CONTROL_PANEL, fProfile::OBJ_CONTROL_PANEL, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "CupA00", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 1}, + { "CupA01", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 2}, + { "CupA02", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 3}, + { "CupB00", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 4}, + { "CupB01", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 5}, + { "CupB02", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 6}, + {"CyStone", fProfile::OBJ_CARRY_STONE, fProfile::OBJ_CARRY_STONE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "D2Mtr", fProfile::OBJ_DESERT_METER, fProfile::OBJ_DESERT_METER, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"D300Obj", fProfile::OBJ_D300, fProfile::OBJ_D300, 0xFFFF, 0xFF, 0}, + {"D3Dummy", fProfile::OBJ_D3_DUMMY, fProfile::OBJ_D3_DUMMY, 0xFFFF, 0xFF, 0}, + { "DNdl", fProfile::OBJ_NEEDLE_DESERT, fProfile::OBJ_NEEDLE_DESERT, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "DNight", fProfile::OBJ_DAYNIGHT, fProfile::OBJ_DAYNIGHT, 0xFFFF, 0xFF, 0}, + {"DStartT", fProfile::START_TAG, fProfile::START_TAG, 0xFFFF, 0xFF, 0}, + {"DbidNpc", fProfile::DEMO_NPC_BIRD, fProfile::DEMO_NPC_BIRD, 0xFFFF, 43, 0}, + { "Debris", fProfile::OBJ_STAGE_DEBRIS, fProfile::OBJ_STAGE_DEBRIS, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "DecoA", fProfile::OBJ_DECOA, fProfile::OBJ_DECOA, 0xFFFF, 0xFF, 0}, + { "DecoB", fProfile::OBJ_DECOB, fProfile::OBJ_DECOB, 0xFFFF, 0xFF, 0}, + {"DemoPds", fProfile::OBJ_UTA_DEMO_PEDEST, fProfile::OBJ_UTA_DEMO_PEDEST, 0xFFFF, 0xFF, 0}, + {"DiOnNbs", fProfile::OBJ_DISPLAY_ONLY_NBS, fProfile::OBJ_DISPLAY_ONLY_NBS, 0xFFFF, 0xFF, 0}, + { "DieTag", fProfile::ALLDIE_TAG, fProfile::ALLDIE_TAG, 0xFFFF, 0xFF, 0}, + {"DisShip", fProfile::OBJ_DIS_SHIP, fProfile::OBJ_DIS_SHIP, 0xFFFF, 0xFF, 0}, + {"DivCrst", fProfile::OBJ_DIVINER_CRYSTAL, fProfile::OBJ_DIVINER_CRYSTAL, 551, SND_SOURCE_OBJECT, 0}, + {"DmtGate", fProfile::OBJ_DORMITORY_GATE, fProfile::OBJ_DORMITORY_GATE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Door", fProfile::OBJ_DOOR, fProfile::OBJ_DOOR, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"Door200", fProfile::OBJ_DOOR_DUNGEON_D200, fProfile::OBJ_DOOR_DUNGEON_D200, 0xFFFF, 42, 0}, + { "DoorBs", fProfile::OBJ_DOOR_BOSS, fProfile::OBJ_DOOR_BOSS, 0xFFFF, 42, 0}, + {"DoorDun", fProfile::OBJ_DOOR_DUNGEON, fProfile::OBJ_DOOR_DUNGEON, 0xFFFF, 42, 0}, + {"Dowsing", fProfile::T_DOWSING, fProfile::T_DOWSING, 0xFFFF, 0xFF, 0}, + {"Drgnfly", fProfile::INSECT_DRAGONFLY, fProfile::INSECT_DRAGONFLY, 778, SND_SOURCE_INSECT, 0}, + { "Drum", fProfile::OBJ_DRUM, fProfile::OBJ_DRUM, 0xFFFF, 0xFF, 0}, + {"DrumTag", fProfile::TAG_DRUM, fProfile::TAG_DRUM, 0xFFFF, 0xFF, 0}, + {"DstDbrs", fProfile::OBJ_DESERT_DEBRIS, fProfile::OBJ_DESERT_DEBRIS, 0xFFFF, 0xFF, 0}, + {"DwnLava", fProfile::OBJ_DOWN_LAVA, fProfile::OBJ_DOWN_LAVA, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "EAm", fProfile::E_AM, fProfile::E_AM, 69, 10, 0}, + { "EBc", fProfile::E_BC, fProfile::E_BC, 18, 10, 0}, + { "EBcZ", fProfile::E_BCZ, fProfile::E_BCZ, 43, SND_SOURCE_BC_Z, 0}, + { "EBcaL", fProfile::E_BCAL, fProfile::E_BCAL, 29, 10, 0}, + { "EBce", fProfile::E_BCE, fProfile::E_BCE, 18, 10, 0}, + {"EBeamos", fProfile::E_BEAMOS, fProfile::E_BEAMOS, 70, 10, 0}, + { "EBfish", fProfile::E_BFISH, fProfile::E_BFISH, 73, 10, 0}, + { "EBs", fProfile::E_BS, fProfile::E_BS, 0xFFFF, 10, 0}, + {"ECactus", fProfile::E_CACTUS, fProfile::E_CACTUS, 531, 40, 0}, + {"EChaser", fProfile::E_TN2, fProfile::E_TN2, 0xFFFF, 18, 0}, + { "EChb", fProfile::E_CHB, fProfile::E_CHB, 0xFFFF, 18, 0}, + { "ECptn", fProfile::E_CAPTAIN, fProfile::E_CAPTAIN, 47, 19, 0}, + { "EEye", fProfile::E_EYE, fProfile::E_EYE, 517, 15, 0}, + { "EGe", fProfile::E_GE, fProfile::E_GE, 0xFFFF, 10, 0}, + { "EGeko", fProfile::E_GEKO, fProfile::E_GEKO, 72, 15, 0}, + {"EGerock", fProfile::E_GEROCK, fProfile::E_GEROCK, 17, 10, 0}, + { "EGue", fProfile::E_GUE, fProfile::E_GUE, 15, 10, 0}, + {"EGumarm", fProfile::E_GUMARM, fProfile::E_GUMARM, 66, 10, 0}, + { "EGunho", fProfile::E_GUNHO, fProfile::E_GUNHO, 71, 10, 0}, + {"EGunhob", fProfile::E_GUNHOB, fProfile::E_GUNHOB, 87, 15, 0}, + { "EHidoK", fProfile::E_HIDOKARI, fProfile::E_HIDOKARI, 63, 10, 0}, + { "EHidoS", fProfile::E_HIDOKARIS, fProfile::E_HIDOKARIS, 63, SND_SOURCE_OBJECT, 0}, + {"EHidory", fProfile::E_HIDORY, fProfile::E_HIDORY, 16, 10, 0}, + { "EHoc", fProfile::E_HOC, fProfile::E_HOC, 20, 10, 0}, + { "EHp", fProfile::E_HP, fProfile::E_HP, 0xFFFF, 10, 0}, + { "EHydra", fProfile::E_HYDRA, fProfile::E_HYDRA, 44, 10, 0}, + { "EKGira", fProfile::E_KGIRA, fProfile::E_KGIRA, 0xFFFF, 19, 0}, + { "EKg", fProfile::E_KG, fProfile::E_KG, 8, 15, 0}, + { "EKs", fProfile::E_KS, fProfile::E_KS, 11, 10, 0}, + {"ELiTail", fProfile::E_LIZA_TAIL, fProfile::E_LIZA_TAIL, 0xFFFF, SND_SOURCE_ITEM, 0}, + {"ELizaru", fProfile::E_LIZARUFOS, fProfile::E_LIZARUFOS, 41, SND_SOURCE_LIZARUFOS, 0}, + { "EMagma", fProfile::E_MAGMA, fProfile::E_MAGMA, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"EMagupp", fProfile::E_MAGUPPO, fProfile::E_MAGUPPO, 74, SND_SOURCE_MAGUPPO, 0}, + { "EMr", fProfile::E_MR, fProfile::E_MR, 36, 10, 0}, + {"EMrTate", fProfile::E_MR_SHIELD, fProfile::E_MR_SHIELD, 0xFFFF, 15, 0}, + { "EOc", fProfile::E_OC, fProfile::E_OC, 18, 10, 0}, + { "EOr", fProfile::E_OR, fProfile::E_OR, 57, 10, 0}, + {"EOrCann", fProfile::E_OR_CANNON, fProfile::E_OR_CANNON, 3, 10, 0}, + { "EPh", fProfile::E_PH, fProfile::E_PH, 81, 15, 0}, + { "EPo", fProfile::E_PO, fProfile::E_PO, 0xFFFF, 18, 0}, + { "ERemly", fProfile::E_REMLY, fProfile::E_REMLY, 0, 15, 0}, + {"ERupGue", fProfile::E_RUPEE_GUE, fProfile::E_RUPEE_GUE, 4, 10, 0}, + { "ESf", fProfile::E_SF, fProfile::E_SF, 45, 19, 0}, + { "ESf4", fProfile::E_SF4, fProfile::E_SF4, 46, 19, 0}, + { "ESiren", fProfile::E_SIREN, fProfile::E_SIREN, 0xFFFF, 18, 0}, + { "ESktl", fProfile::E_SKYTAIL, fProfile::E_SKYTAIL, 2, 10, 0}, + { "ESm", fProfile::E_SM, fProfile::E_SM, 59, 11, 0}, + { "ESpark", fProfile::E_SPARK, fProfile::E_SPARK, 67, SND_SOURCE_SPARK, 0}, + { "ESyako", fProfile::E_SYAKOMAITO, fProfile::E_SYAKOMAITO, 68, 10, 0}, + { "EWs", fProfile::E_WS, fProfile::E_WS, 6, 15, 0}, + { "Eel", fProfile::EEL, fProfile::EEL, 0xFFFF, 0xFF, 0}, + { "EffGnT", fProfile::EFFECT_GEN_TAG, fProfile::EFFECT_GEN_TAG, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Ehb", fProfile::E_HB, fProfile::E_HB, 78, 10, 0}, + {"EhbLeaf", fProfile::E_HB_LEAF, fProfile::E_HB_LEAF, 0xFFFF, 0xFF, 0}, + {"ElLight", fProfile::OBJ_ELECTRIC_LIGHT, fProfile::OBJ_ELECTRIC_LIGHT, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "EnCl", fProfile::ENEMY_CONTROL, fProfile::ENEMY_CONTROL, 0xFFFF, 0xFF, 0}, + { "Est", fProfile::E_ST, fProfile::E_ST, 7, 10, 0}, + {"Estwire", fProfile::E_ST_WIRE, fProfile::E_ST_WIRE, 0xFFFF, 0xFF, 0}, + { "EvfTag", fProfile::EVENTF_TAG, fProfile::EVENTF_TAG, 0xFFFF, 0xFF, 0}, + {"EvilFld", fProfile::OBJ_EVIL_FIELD, fProfile::OBJ_EVIL_FIELD, 0xFFFF, 0xFF, 0}, + {"EvntTag", fProfile::EVENT_TAG, fProfile::EVENT_TAG, 0xFFFF, 0xFF, 0}, + { "F302Lt", fProfile::OBJ_F302_LIGHT, fProfile::OBJ_F302_LIGHT, 0xFFFF, 0xFF, 0}, + {"F400GaS", fProfile::OBJ_F400_GATE_SEAL, fProfile::OBJ_F400_GATE_SEAL, 0xFFFF, 0xFF, 0}, + {"F400Gat", fProfile::OBJ_F400_GATE_LEAF, fProfile::OBJ_F400_GATE_LEAF, 0xFFFF, 0xFF, 0}, + {"FShutte", fProfile::OBJ_SHUTTER_FENCE, fProfile::OBJ_SHUTTER_FENCE, 0xFFFF, SND_SOURCE_SHUTTER, 0}, + { "FWall", fProfile::OBJ_FIREWALL, fProfile::OBJ_FIREWALL, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Fairy", fProfile::OBJ_FAIRY, fProfile::OBJ_FAIRY, 546, SND_SOURCE_OBJECT, 0}, + {"FairyTa", fProfile::T_FAIRY, fProfile::T_FAIRY, 0xFFFF, 0xFF, 0}, + { "Fence", fProfile::OBJ_FENCE, fProfile::OBJ_FENCE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"FenceB2", fProfile::OBJ_FENCE_BOKO2, fProfile::OBJ_FENCE_BOKO2, 0xFFFF, 0xFF, 0}, + {"FenceBk", fProfile::OBJ_FENCE_BOKO, fProfile::OBJ_FENCE_BOKO, 0xFFFF, 0xFF, 0}, + {"FenceFo", fProfile::TAG_SHUTTER_FENCE_FORBIDDANCE, fProfile::TAG_SHUTTER_FENCE_FORBIDDANCE, 0xFFFF, 0xFF, 0}, + {"FenceIr", fProfile::OBJ_FENCE_IRON, fProfile::OBJ_FENCE_IRON, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"FenceKs", fProfile::OBJ_FENCE_KONSAI, fProfile::OBJ_FENCE_KONSAI, 0xFFFF, 0xFF, 0}, + {"FencePe", fProfile::TAG_SHUTTER_FENCE_PERMISSION, fProfile::TAG_SHUTTER_FENCE_PERMISSION, 0xFFFF, 0xFF, 0}, + { "Fire", fProfile::OBJ_FIRE, fProfile::OBJ_FIRE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"FireObs", fProfile::OBJ_FIRE_OBSTACLE, fProfile::OBJ_FIRE_OBSTACLE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"FirePil", fProfile::OBJ_FIRE_PILLAR, fProfile::OBJ_FIRE_PILLAR, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"Firefly", fProfile::INSECT_FIREFLY, fProfile::INSECT_FIREFLY, 779, SND_SOURCE_INSECT, 0}, + { "Fish", fProfile::FISH, fProfile::FISH, 0xFFFF, 0xFF, 0}, + { "Flag", fProfile::OBJ_FLAG, fProfile::OBJ_FLAG, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "FlvsA", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 13}, + { "FlvsB", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 14}, + { "FlvsC", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 15}, + {"FlySlrb", fProfile::FLY_SLB, fProfile::FLY_SLB, 0xFFFF, 43, 0}, + {"FlyingC", fProfile::OBJ_FLYING_CLAWSHOT_TARGET, fProfile::OBJ_FLYING_CLAWSHOT_TARGET, 0xFFFF, 0xFF, 0}, + { "Fmaker", fProfile::FISH_MGR, fProfile::FISH_MGR, 0xFFFF, 0xFF, 0}, + {"ForceGT", fProfile::TAG_FORCE_GET_FLAG, fProfile::TAG_FORCE_GET_FLAG, 0xFFFF, 0xFF, 0}, + { "ForceS", fProfile::OBJ_FORCE_SIGN, fProfile::OBJ_FORCE_SIGN, 0xFFFF, 0xFF, 0}, + {"Fortune", fProfile::OBJ_FORTUNE_RING, fProfile::OBJ_FORTUNE_RING, 0xFFFF, 0xFF, 0}, + {"FrmLand", fProfile::OBJ_FARMLAND, fProfile::OBJ_FARMLAND, 0xFFFF, 0xFF, 0}, + {"FrtTree", fProfile::OBJ_FRUIT_TREE, fProfile::OBJ_FRUIT_TREE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "FruitA", fProfile::OBJ_FRUIT, fProfile::OBJ_FRUIT, 0xFFFF, SND_SOURCE_OBJECT, 1}, + { "FruitB", fProfile::OBJ_FRUIT_B, fProfile::OBJ_FRUIT_B, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"GateGnd", fProfile::GATE2GND_TAG, fProfile::GATE2GND_TAG, 0xFFFF, 0xFF, 0}, + { "Gcoil", fProfile::OBJ_GRASS_COIL, fProfile::OBJ_GRASS_COIL, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Gear", fProfile::OBJ_GEAR, fProfile::OBJ_GEAR, 525, SND_SOURCE_OBJECT, 0}, + {"GekoTag", fProfile::GEKO_TAG, fProfile::GEKO_TAG, 0xFFFF, 0xFF, 0}, + {"GenkiDT", fProfile::TAG_GENKI_DOWSING_TARGET, fProfile::TAG_GENKI_DOWSING_TARGET, 0xFFFF, 0xFF, 0}, + { "GhFlr", fProfile::OBJ_GIRAHIMU_FLOOR, fProfile::OBJ_GIRAHIMU_FLOOR, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"GhSBeam", fProfile::GH_SWORD_BEAM, fProfile::GH_SWORD_BEAM, 0xFFFF, SND_SOURCE_BULLET, 0}, + {"GiraFot", fProfile::OBJ_GIRAHIM_FOOT, fProfile::OBJ_GIRAHIM_FOOT, 0xFFFF, 0xFF, 0}, + {"GkMgTag", fProfile::GENKI_MGR_TAG, fProfile::GENKI_MGR_TAG, 0xFFFF, 0xFF, 0}, + {"GodCube", fProfile::OBJ_GODDESS_CUBE, fProfile::OBJ_GODDESS_CUBE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"GodMark", fProfile::OBJ_GOD_MARK, fProfile::OBJ_GOD_MARK, 0xFFFF, 0xFF, 0}, + {"GrCover", fProfile::OBJ_GROUND_COVER, fProfile::OBJ_GROUND_COVER, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Grave", fProfile::OBJ_GRAVE, fProfile::OBJ_GRAVE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "GroupS", fProfile::GROUP_SUMMON, fProfile::GROUP_SUMMON, 0xFFFF, 0xFF, 0}, + { "GroupT", fProfile::GROUP_TEST, fProfile::GROUP_TEST, 0xFFFF, 0xFF, 0}, + { "Grshpr", fProfile::INSECT_GRASSHOPPER, fProfile::INSECT_GRASSHOPPER, 772, SND_SOURCE_INSECT, 0}, + {"GuardLg", fProfile::OBJ_GUARD_LOG, fProfile::OBJ_GUARD_LOG, 544, SND_SOURCE_OBJECT, 0}, + { "GueB", fProfile::GUE_BULLET, fProfile::GUE_BULLET, 0xFFFF, 42, 0}, + {"HdrFire", fProfile::HIDORY_FIRE, fProfile::HIDORY_FIRE, 16, SND_SOURCE_OBJECT, 0}, + {"HeartCo", fProfile::OBJ_ITEM_HEART_CONTAINER, fProfile::OBJ_ITEM_HEART_CONTAINER, 0xFFFF, SND_SOURCE_ITEM, 0}, + { "Heartf", fProfile::HEART_FLOWER, fProfile::HEART_FLOWER, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"HeatRst", fProfile::TAG_HEAT_RESIST, fProfile::TAG_HEAT_RESIST, 0xFFFF, 0xFF, 0}, + { "Himo", fProfile::OBJ_HIMO, fProfile::OBJ_HIMO, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"HitLVSW", fProfile::OBJ_HIT_LEVER_SW, fProfile::OBJ_HIT_LEVER_SW, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "HnComb", fProfile::NPC_HONEYCOMB, fProfile::NPC_HONEYCOMB, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"HoleMNG", fProfile::OBJ_HOLE_MINIGAME, fProfile::OBJ_HOLE_MINIGAME, 0xFFFF, 0xFF, 0}, + {"HolyWtr", fProfile::TAG_HOLY_WATER, fProfile::TAG_HOLY_WATER, 0xFFFF, 0xFF, 0}, + {"HrpHint", fProfile::OBJ_HARP_HINT, fProfile::OBJ_HARP_HINT, 555, SND_SOURCE_OBJECT, 0}, + { "HrpTg", fProfile::HARP_TAG, fProfile::HARP_TAG, 0xFFFF, SND_SOURCE_TG_HARP, 0}, + {"ImpaDor", fProfile::OBJ_IMPA_DOOR, fProfile::OBJ_IMPA_DOOR, 0xFFFF, 0xFF, 0}, + { "InHole", fProfile::OBJ_INTO_HOLE, fProfile::OBJ_INTO_HOLE, 0xFFFF, 33, 0}, + {"InsctTg", fProfile::TAG_INSECT, fProfile::TAG_INSECT, 0xFFFF, 0xFF, 0}, + { "Invisi", fProfile::INVISIBLE, fProfile::INVISIBLE, 0xFFFF, 0xFF, 0}, + {"IronStg", fProfile::OBJ_IRON_STAGE, fProfile::OBJ_IRON_STAGE, 0xFFFF, 0xFF, 0}, + {"IslBamb", fProfile::OBJ_BAMBOO_ISLAND, fProfile::OBJ_BAMBOO_ISLAND, 0xFFFF, 0xFF, 0}, + { "IslIns", fProfile::OBJ_INSECT_ISLAND, fProfile::OBJ_INSECT_ISLAND, 0xFFFF, 0xFF, 0}, + { "IslLOD", fProfile::OBJ_ISLAND_LOD, fProfile::OBJ_ISLAND_LOD, 0xFFFF, 0xFF, 0}, + {"IslMegm", fProfile::OBJ_MEGAMI_ISLAND, fProfile::OBJ_MEGAMI_ISLAND, 0xFFFF, 0xFF, 0}, + {"IslNusi", fProfile::OBJ_ISLAND_NUSI, fProfile::OBJ_ISLAND_NUSI, 0xFFFF, 0xFF, 0}, + {"IslTery", fProfile::OBJ_TERRY_ISLAND, fProfile::OBJ_TERRY_ISLAND, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"IslTreB", fProfile::OBJ_TREASURE_ISLAND_B, fProfile::OBJ_TREASURE_ISLAND_B, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"IslTrea", fProfile::OBJ_TREASURE_ISLAND, fProfile::OBJ_TREASURE_ISLAND, 0xFFFF, 0xFF, 0}, + { "Item", fProfile::ITEM, fProfile::ITEM, 0xFFFF, SND_SOURCE_ITEM, 0}, + {"IvyRope", fProfile::OBJ_IVY_ROPE, fProfile::OBJ_IVY_ROPE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "J_Test", fProfile::J_TEST, fProfile::J_TEST, 0xFFFF, 0xFF, 0}, + {"JunkRep", fProfile::OBJ_JUNK_REPAIR, fProfile::OBJ_JUNK_REPAIR, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Kanban", fProfile::KANBAN, fProfile::KANBAN, 513, SND_SOURCE_OBJECT, 0}, + {"KanbanS", fProfile::OBJ_KANBAN_STONE, fProfile::OBJ_KANBAN_STONE, 514, 0xFF, 0}, + { "Kibako", fProfile::OBJ_KIBAKO, fProfile::OBJ_KIBAKO, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"KiesuTa", fProfile::KIESU_TAG, fProfile::KIESU_TAG, 0xFFFF, 15, 0}, + { "Kinoko", fProfile::OBJ_MUSHROOM, fProfile::OBJ_MUSHROOM, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"KinokoA", fProfile::OBJ_MUSHROOM, fProfile::OBJ_MUSHROOM, 0xFFFF, SND_SOURCE_OBJECT, 1}, + {"KinokoB", fProfile::OBJ_MUSHROOM, fProfile::OBJ_MUSHROOM, 0xFFFF, SND_SOURCE_OBJECT, 2}, + {"KinokoC", fProfile::OBJ_MUSHROOM, fProfile::OBJ_MUSHROOM, 0xFFFF, SND_SOURCE_OBJECT, 3}, + {"KinokoD", fProfile::OBJ_MUSHROOM, fProfile::OBJ_MUSHROOM, 0xFFFF, SND_SOURCE_OBJECT, 4}, + {"KmtWall", fProfile::OBJ_KUMITE_WALL, fProfile::OBJ_KUMITE_WALL, 0xFFFF, 0xFF, 0}, + {"KndBird", fProfile::KNIGHT_LEADER_BIRD, fProfile::KNIGHT_LEADER_BIRD, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"Kuwagat", fProfile::INSECT_BEETLE, fProfile::INSECT_BEETLE, 771, SND_SOURCE_INSECT, 1}, + { "Kytag", fProfile::KYTAG_TAG, fProfile::KYTAG_TAG, 0xFFFF, 0xFF, 0}, + { "LBird", fProfile::LITTLE_BIRD, fProfile::LITTLE_BIRD, 479, 43, 0}, + {"LBmaker", fProfile::LITTLE_BIRD_MGR, fProfile::LITTLE_BIRD_MGR, 0xFFFF, 59, 0}, + { "LHHarp", fProfile::OBJ_LIGHTHOUSE_HARP, fProfile::OBJ_LIGHTHOUSE_HARP, 0xFFFF, 0xFF, 0}, + {"LHLight", fProfile::OBJ_LIGHTHOUSE_LIGHT, fProfile::OBJ_LIGHTHOUSE_LIGHT, 0xFFFF, 0xFF, 0}, + { "LSEff", fProfile::TAG_LIGHT_SHAFT_EFF, fProfile::TAG_LIGHT_SHAFT_EFF, 0xFFFF, 0xFF, 0}, + {"Ladybug", fProfile::INSECT_LADYBUG, fProfile::INSECT_LADYBUG, 769, SND_SOURCE_INSECT, 0}, + { "LampA", fProfile::OBJ_LAMP, fProfile::OBJ_LAMP, 0xFFFF, 0xFF, 1}, + { "LampB", fProfile::OBJ_LAMP, fProfile::OBJ_LAMP, 0xFFFF, 0xFF, 2}, + { "LampC", fProfile::OBJ_LAMP, fProfile::OBJ_LAMP, 0xFFFF, 0xFF, 3}, + { "LampD", fProfile::OBJ_LAMP, fProfile::OBJ_LAMP, 0xFFFF, 0xFF, 6}, + { "LampE", fProfile::OBJ_LAMP, fProfile::OBJ_LAMP, 0xFFFF, 0xFF, 4}, + { "LampF", fProfile::OBJ_LAMP, fProfile::OBJ_LAMP, 0xFFFF, 0xFF, 5}, + {"LavF200", fProfile::OBJ_LAVA_F200, fProfile::OBJ_LAVA_F200, 0xFFFF, 0xFF, 0}, + {"LbTnder", fProfile::LBTHUNDER_TAG, fProfile::LBTHUNDER_TAG, 0xFFFF, 0xFF, 0}, + {"LeafGut", fProfile::OBJ_FRUIT_GUTS_LEAF, fProfile::OBJ_FRUIT_GUTS_LEAF, 0xFFFF, 0xFF, 0}, + {"LeafSwg", fProfile::OBJ_LEAF_SWING, fProfile::OBJ_LEAF_SWING, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"Light00", fProfile::OBJ_BUILDING, fProfile::OBJ_BUILDING, 0xFFFF, 0xFF, 1}, + {"LightLi", fProfile::OBJ_LIGHT_LINE, fProfile::OBJ_LIGHT_LINE, 0xFFFF, SND_SOURCE_LIGHT_SHAFT, 0}, + { "Link", fProfile::PLAYER, fProfile::PLAYER, 0xFFFF, SND_SOURCE_PLAYER, 0}, + { "Log", fProfile::OBJ_LOG, fProfile::OBJ_LOG, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "LogWtr", fProfile::OBJ_LOG_WATER, fProfile::OBJ_LOG_WATER, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Lotus", fProfile::OBJ_LOTUS, fProfile::OBJ_LOTUS, 521, SND_SOURCE_OBJECT, 0}, + { "LtSftS", fProfile::OBJ_LIGHT_SHAFT_SMALL, fProfile::OBJ_LIGHT_SHAFT_SMALL, 0xFFFF, SND_SOURCE_LIGHT_SHAFT, 0}, + {"LtsFlwr", fProfile::OBJ_LOTUS_FLOWER, fProfile::OBJ_LOTUS_FLOWER, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"LtsSeed", fProfile::OBJ_LOTUS_SEED, fProfile::OBJ_LOTUS_SEED, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "LvD201", fProfile::OBJ_LAVA_D201, fProfile::OBJ_LAVA_D201, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "LvPlt", fProfile::OBJ_LAVA_PLATE, fProfile::OBJ_LAVA_PLATE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "MDvTg", fProfile::MEGAMI_DIVING_TAG, fProfile::MEGAMI_DIVING_TAG, 0xFFFF, 0xFF, 0}, + {"MagBoat", fProfile::OBJ_ROCK_BOAT, fProfile::OBJ_ROCK_BOAT, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "MagpB", fProfile::MAGUPPO_BULLET, fProfile::MAGUPPO_BULLET, 0xFFFF, SND_SOURCE_BULLET_MAGUPPO, 0}, + { "Mantis", fProfile::INSECT_GRASSHOPPER, fProfile::INSECT_GRASSHOPPER, 773, SND_SOURCE_INSECT, 1}, + {"MapArea", fProfile::MAP_AREA_TAG, fProfile::MAP_AREA_TAG, 0xFFFF, 0xFF, 0}, + {"MapInst", fProfile::TAG_MAP_INST, fProfile::TAG_MAP_INST, 0xFFFF, 0xFF, 0}, + {"MapMark", fProfile::T_MAP_MARK, fProfile::T_MAP_MARK, 0xFFFF, 0xFF, 0}, + {"MassTag", fProfile::MASS_OBJ_TAG, fProfile::MASS_OBJ_TAG, 0xFFFF, 0xFF, 0}, + {"Message", fProfile::MESSAGE_ACTOR, fProfile::MESSAGE_ACTOR, 0xFFFF, 0xFF, 0}, + {"MgPmpkn", fProfile::OBJ_MG_PUMPKIN, fProfile::OBJ_MG_PUMPKIN, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "MistTg", fProfile::MIST_TAG, fProfile::MIST_TAG, 0xFFFF, 0xFF, 0}, + {"MoMgTag", fProfile::MOLE_MGR_TAG, fProfile::MOLE_MGR_TAG, 0xFFFF, 0xFF, 0}, + { "MoSoil", fProfile::OBJ_MOLE_SOIL, fProfile::OBJ_MOLE_SOIL, 0xFFFF, 0xFF, 0}, + {"MoleCvr", fProfile::OBJ_MOLE_COVER, fProfile::OBJ_MOLE_COVER, 0xFFFF, 0xFF, 0}, + {"MoleTag", fProfile::MOLE_PROHIBIT_TAG, fProfile::MOLE_PROHIBIT_TAG, 0xFFFF, 0xFF, 0}, + {"MpParts", fProfile::OBJ_MAPPARTS, fProfile::OBJ_MAPPARTS, 0xFFFF, 0xFF, 0}, + {"MssbTag", fProfile::TAG_MUSASABI, fProfile::TAG_MUSASABI, 0xFFFF, 0xFF, 0}, + {"Musasab", fProfile::OBJ_MUSASABI, fProfile::OBJ_MUSASABI, 321, SND_SOURCE_OBJECT, 0}, + { "MvElc", fProfile::OBJ_MOVE_ELEC, fProfile::OBJ_MOVE_ELEC, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"MvLiftV", fProfile::OBJ_MOVE_LIFT_VOL, fProfile::OBJ_MOVE_LIFT_VOL, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "NpcAdr", fProfile::NPC_ADR, fProfile::NPC_ADR, 310, SND_SOURCE_NPC_DRAGON, 0}, + {"NpcAkuH", fProfile::NPC_AKU_HUMAN, fProfile::NPC_AKU_HUMAN, 346, SND_SOURCE_NPC_51, 0}, + {"NpcAkum", fProfile::NPC_AKUMAKUN, fProfile::NPC_AKUMAKUN, 279, SND_SOURCE_NPC_51, 0}, + {"NpcAzFa", fProfile::NPC_AZUKARIYA_FATHER, fProfile::NPC_AZUKARIYA_FATHER, 298, SND_SOURCE_NPC_51, 0}, + {"NpcAzNi", fProfile::NPC_AZUKARIYA_NIGHT, fProfile::NPC_AZUKARIYA_NIGHT, 464, SND_SOURCE_NPC_51, 0}, + {"NpcBRvl", fProfile::NPC_BBRVL, fProfile::NPC_BBRVL, 261, SND_SOURCE_NPC_50, 0}, + {"NpcBdsw", fProfile::NPC_BDSW, fProfile::NPC_BDSW, 0xFFFF, SND_SOURCE_NPC_50, 0}, + { "NpcBdz", fProfile::NPC_BDZ, fProfile::NPC_BDZ, 0xFFFF, 43, 0}, + { "NpcBgr", fProfile::NPC_BGR, fProfile::NPC_BGR, 298, SND_SOURCE_NPC_51, 0}, + {"NpcBird", fProfile::NPC_BIRD, fProfile::NPC_BIRD, 0xFFFF, 43, 0}, + {"NpcCbFd", fProfile::NPC_CE_FRIEND, fProfile::NPC_CE_FRIEND, 278, SND_SOURCE_NPC_51, 0}, + {"NpcCbLd", fProfile::NPC_CE_LADY, fProfile::NPC_CE_LADY, 285, SND_SOURCE_NPC_51, 0}, + {"NpcChef", fProfile::NPC_CHEF, fProfile::NPC_CHEF, 299, SND_SOURCE_NPC_51, 0}, + {"NpcDgJg", fProfile::NPC_DIVE_GAME_JUDGE, fProfile::NPC_DIVE_GAME_JUDGE, 272, SND_SOURCE_NPC_51, 0}, + {"NpcDoML", fProfile::NPC_DOUGUYA_MOTHER_LOD, fProfile::NPC_DOUGUYA_MOTHER_LOD, 294, SND_SOURCE_NPC_51, 0}, + {"NpcDoMo", fProfile::NPC_DOUGUYA_MOTHER, fProfile::NPC_DOUGUYA_MOTHER, 294, SND_SOURCE_NPC_51, 0}, + {"NpcDoNi", fProfile::NPC_DOUGUYA_NIGHT, fProfile::NPC_DOUGUYA_NIGHT, 462, SND_SOURCE_NPC_51, 0}, + { "NpcDrb", fProfile::NPC_DRB, fProfile::NPC_DRB, 319, 43, 0}, + {"NpcDrbC", fProfile::NPC_DRBC, fProfile::NPC_DRBC, 320, 43, 0}, + { "NpcDsk", fProfile::NPC_DSK, fProfile::NPC_DSK, 258, SND_SOURCE_NPC_51, 0}, + {"NpcDskN", fProfile::NPC_DAISHINKAN_N, fProfile::NPC_DAISHINKAN_N, 340, SND_SOURCE_NPC_51, 0}, + { "NpcFdr", fProfile::NPC_FDR, fProfile::NPC_FDR, 318, SND_SOURCE_NPC_DRAGON, 0}, + { "NpcGhm", fProfile::NPC_GHM, fProfile::NPC_GHM, 323, SND_SOURCE_NPC_50, 0}, + {"NpcGost", fProfile::NPC_TOILET_GHOST, fProfile::NPC_TOILET_GHOST, 300, SND_SOURCE_NPC_51, 0}, + { "NpcGra", fProfile::NPC_GRA, fProfile::NPC_GRA, 302, SND_SOURCE_NPC_51, 0}, + { "NpcGrc", fProfile::NPC_GRC, fProfile::NPC_GRC, 330, SND_SOURCE_NPC_51, 0}, + { "NpcGrd", fProfile::NPC_GRD, fProfile::NPC_GRD, 331, SND_SOURCE_NPC_50, 0}, + { "NpcGzl", fProfile::NPC_GZL, fProfile::NPC_GZL, 257, SND_SOURCE_NPC_51, 0}, + {"NpcIcgK", fProfile::NPC_ICGK, fProfile::NPC_ICGK, 460, SND_SOURCE_NPC_51, 0}, + { "NpcInv", fProfile::NPC_INV, fProfile::NPC_INV, 0xFFFF, 0xFF, 0}, + {"NpcJkML", fProfile::NPC_JUNK_MOTHER_LOD, fProfile::NPC_JUNK_MOTHER_LOD, 295, SND_SOURCE_NPC_51, 0}, + {"NpcJkMo", fProfile::NPC_JUNK_MOTHER, fProfile::NPC_JUNK_MOTHER, 295, SND_SOURCE_NPC_51, 0}, + {"NpcJkNi", fProfile::NPC_JUNK_NIGHT, fProfile::NPC_JUNK_NIGHT, 463, SND_SOURCE_NPC_51, 0}, + {"NpcKb2N", fProfile::NPC_KOBUN_B_NIGHT, fProfile::NPC_KOBUN_B_NIGHT, 459, SND_SOURCE_NPC_51, 0}, + { "NpcKbn", fProfile::NPC_KBN, fProfile::NPC_KBN, 262, SND_SOURCE_NPC_51, 0}, + {"NpcKbn2", fProfile::NPC_KBN2, fProfile::NPC_KBN2, 263, SND_SOURCE_NPC_51, 0}, + { "NpcKen", fProfile::NPC_KENSEI, fProfile::NPC_KENSEI, 0xFFFF, SND_SOURCE_KENSEI, 0}, + {"NpcKenT", fProfile::NPC_TALK_KENSEI, fProfile::NPC_TALK_KENSEI, 0xFFFF, SND_SOURCE_KENSEI, 0}, + {"NpcKnld", fProfile::NPC_KNIGHT_LEADER, fProfile::NPC_KNIGHT_LEADER, 271, SND_SOURCE_NPC_51, 0}, + {"NpcKyuE", fProfile::NPC_KYUI_ELDER, fProfile::NPC_KYUI_ELDER, 307, SND_SOURCE_NPC_51, 0}, + {"NpcKyuW", fProfile::NPC_KYUI_WIZARD, fProfile::NPC_KYUI_WIZARD, 308, SND_SOURCE_NPC_51, 0}, + {"NpcMHNi", fProfile::NPC_MED_HUS_NIGHT, fProfile::NPC_MED_HUS_NIGHT, 466, SND_SOURCE_NPC_51, 0}, + {"NpcMWNi", fProfile::NPC_MED_WIFE_NIGHT, fProfile::NPC_MED_WIFE_NIGHT, 465, SND_SOURCE_NPC_51, 0}, + {"NpcMlMg", fProfile::NPC_MOLE_MG, fProfile::NPC_MOLE_MG, 313, SND_SOURCE_NPC_50, 0}, + {"NpcMoEN", fProfile::NPC_MOLE_ES_NML, fProfile::NPC_MOLE_ES_NML, 345, SND_SOURCE_NPC_50, 0}, + {"NpcMoEl", fProfile::NPC_MOLE_ELDER, fProfile::NPC_MOLE_ELDER, 317, SND_SOURCE_NPC_50, 0}, + { "NpcMoN", fProfile::NPC_MOLE_NORMAL, fProfile::NPC_MOLE_NORMAL, 312, SND_SOURCE_NPC_50, 0}, + {"NpcMoN2", fProfile::NPC_MOLE_NORMAL2, fProfile::NPC_MOLE_NORMAL2, 312, SND_SOURCE_NPC_50, 0}, + { "NpcMoS", fProfile::NPC_MOLE_SAL, fProfile::NPC_MOLE_SAL, 474, SND_SOURCE_NPC_50, 0}, + { "NpcMoT", fProfile::NPC_MOLE_TACKLE, fProfile::NPC_MOLE_TACKLE, 315, SND_SOURCE_NPC_50, 0}, + {"NpcMoT2", fProfile::NPC_MOLE_TACKLE2, fProfile::NPC_MOLE_TACKLE2, 316, SND_SOURCE_NPC_50, 0}, + {"NpcMole", fProfile::NPC_MOLE, fProfile::NPC_MOLE, 345, SND_SOURCE_NPC_50, 0}, + { "NpcOim", fProfile::NPC_OIM, fProfile::NPC_OIM, 301, SND_SOURCE_NPC_51, 0}, + {"NpcOkyu", fProfile::NPC_ORD_KYUI, fProfile::NPC_ORD_KYUI, 304, SND_SOURCE_NPC_51, 0}, + { "NpcPcs", fProfile::NPC_PCS, fProfile::NPC_PCS, 469, SND_SOURCE_NPC_51, 0}, + { "NpcPdu", fProfile::NPC_PDU, fProfile::NPC_PDU, 274, SND_SOURCE_NPC_51, 0}, + { "NpcPma", fProfile::NPC_PMA, fProfile::NPC_PMA, 273, SND_SOURCE_NPC_51, 0}, + {"NpcResc", fProfile::NPC_RESCUE, fProfile::NPC_RESCUE, 291, SND_SOURCE_NPC_51, 0}, + { "NpcRvl", fProfile::NPC_RVL, fProfile::NPC_RVL, 261, SND_SOURCE_NPC_51, 0}, + {"NpcRvlL", fProfile::NPC_RIVAL_LOD, fProfile::NPC_RIVAL_LOD, 261, SND_SOURCE_NPC_51, 0}, + {"NpcRvlR", fProfile::NPC_REGRET_RIVAL, fProfile::NPC_REGRET_RIVAL, 261, SND_SOURCE_NPC_51, 0}, + {"NpcSAML", fProfile::NPC_SENPAIA_MOTHER_LOD, fProfile::NPC_SENPAIA_MOTHER_LOD, 296, SND_SOURCE_NPC_51, 0}, + {"NpcSAMo", fProfile::NPC_SENPAIA_MOTHER, fProfile::NPC_SENPAIA_MOTHER, 296, SND_SOURCE_NPC_51, 0}, + {"NpcSMnD", fProfile::NPC_SORAJIMA_MAN_D, fProfile::NPC_SORAJIMA_MAN_D, 297, SND_SOURCE_NPC_51, 0}, + {"NpcSMnE", fProfile::NPC_SORAJIMA_MAN_E, fProfile::NPC_SORAJIMA_MAN_E, 336, SND_SOURCE_NPC_51, 0}, + {"NpcSalS", fProfile::NPC_SALESMAN_S, fProfile::NPC_SALESMAN_S, 265, SND_SOURCE_NPC_51, 0}, + {"NpcSenb", fProfile::NPC_SENPAI_B, fProfile::NPC_SENPAI_B, 277, SND_SOURCE_NPC_51, 0}, + {"NpcSenp", fProfile::NPC_SENPAI, fProfile::NPC_SENPAI, 276, SND_SOURCE_NPC_51, 0}, + { "NpcSha", fProfile::NPC_SHA, fProfile::NPC_SHA, 275, SND_SOURCE_NPC_51, 0}, + { "NpcSkn", fProfile::NPC_SKN, fProfile::NPC_SKN, 259, SND_SOURCE_NPC_51, 0}, + {"NpcSkn2", fProfile::NPC_SKN2, fProfile::NPC_SKN2, 260, SND_SOURCE_NPC_51, 0}, + {"NpcSlFB", fProfile::NPC_SLFB, fProfile::NPC_SLFB, 0xFFFF, 43, 0}, + {"NpcSlFl", fProfile::NPC_SLFL, fProfile::NPC_SLFL, 0xFFFF, 43, 0}, + {"NpcSlKy", fProfile::NPC_SALBAGE_MORRY, fProfile::NPC_SALBAGE_MORRY, 304, SND_SOURCE_NPC_51, 0}, + {"NpcSlRp", fProfile::NPC_SLRP, fProfile::NPC_SLRP, 477, 43, 0}, + {"NpcSlb2", fProfile::NPC_SLB2, fProfile::NPC_SLB2, 354, 43, 0}, + {"NpcSlrb", fProfile::NPC_SLB, fProfile::NPC_SLB, 0xFFFF, 43, 0}, + {"NpcSltk", fProfile::NPC_SLTK, fProfile::NPC_SLTK, 0xFFFF, 0xFF, 0}, + {"NpcSma2", fProfile::NPC_SMA2, fProfile::NPC_SMA2, 286, SND_SOURCE_NPC_51, 0}, + {"NpcSma3", fProfile::NPC_SMA3, fProfile::NPC_SMA3, 287, SND_SOURCE_NPC_51, 0}, + {"NpcSoBo", fProfile::NPC_SORAJIMA_BOY, fProfile::NPC_SORAJIMA_BOY, 284, SND_SOURCE_NPC_51, 0}, + {"NpcSoFa", fProfile::NPC_SORAJIMA_FATHER, fProfile::NPC_SORAJIMA_FATHER, 282, SND_SOURCE_NPC_51, 0}, + { "NpcSoG", fProfile::NPC_SORAJIMA_GIRL, fProfile::NPC_SORAJIMA_GIRL, 288, SND_SOURCE_NPC_51, 0}, + {"NpcSoMo", fProfile::NPC_SORAJIMA_MOTHER, fProfile::NPC_SORAJIMA_MOTHER, 283, SND_SOURCE_NPC_51, 0}, + {"NpcSoma", fProfile::NPC_SORAJIMA_MALE, fProfile::NPC_SORAJIMA_MALE, 281, SND_SOURCE_NPC_51, 0}, + {"NpcSowo", fProfile::NPC_SORAJIMA_FEMALE, fProfile::NPC_SORAJIMA_FEMALE, 280, SND_SOURCE_NPC_51, 0}, + { "NpcStr", fProfile::NPC_STR, fProfile::NPC_STR, 0xFFFF, 0xFF, 0}, + { "NpcSui", fProfile::NPC_SUISEI, fProfile::NPC_SUISEI, 344, 43, 0}, + {"NpcSuiN", fProfile::NPC_SUISEI_NORMAL, fProfile::NPC_SUISEI_NORMAL, 309, SND_SOURCE_NPC_50, 0}, + {"NpcSuiS", fProfile::NPC_SUISEI_SUB, fProfile::NPC_SUISEI_SUB, 309, 43, 0}, + { "NpcTdr", fProfile::NPC_TDR, fProfile::NPC_TDR, 322, SND_SOURCE_NPC_DRAGON, 0}, + {"NpcTdrB", fProfile::NPC_TDRB, fProfile::NPC_TDRB, 322, SND_SOURCE_OBJECT, 0}, + { "NpcTds", fProfile::NPC_TDS, fProfile::NPC_TDS, 478, 0xFF, 0}, + { "NpcTer", fProfile::NPC_TERRY, fProfile::NPC_TERRY, 264, SND_SOURCE_NPC_51, 0}, + { "NpcTke", fProfile::NPC_TKE, fProfile::NPC_TKE, 0xFFFF, 0xFF, 0}, + { "NpcTmn", fProfile::NPC_TMN, fProfile::NPC_TMN, 0xFFFF, 0xFF, 0}, + { "NpcYim", fProfile::NPC_YIM, fProfile::NPC_YIM, 311, SND_SOURCE_NPC_51, 0}, + { "NpcZld", fProfile::NPC_ZLD, fProfile::NPC_ZLD, 256, SND_SOURCE_NPC_51, 0}, + {"Npckyu1", fProfile::NPC_KYUI_FIRST, fProfile::NPC_KYUI_FIRST, 303, SND_SOURCE_NPC_51, 0}, + {"Npckyu3", fProfile::NPC_KYUI_THIRD, fProfile::NPC_KYUI_THIRD, 305, SND_SOURCE_NPC_51, 0}, + {"Npckyu4", fProfile::NPC_KYUI4, fProfile::NPC_KYUI4, 306, SND_SOURCE_NPC_51, 0}, + { "NusiB", fProfile::B_NUSI, fProfile::B_NUSI, 0xFFFF, SND_SOURCE_BOSS_NUSI, 0}, + { "NusiBt", fProfile::B_NUSI_BULLET, fProfile::B_NUSI_BULLET, 0xFFFF, SND_SOURCE_BULLET, 0}, + {"NusiNpc", fProfile::NUSI_NPC, fProfile::NUSI_NPC, 0xFFFF, SND_SOURCE_NPC_NUSI, 0}, + { "NusiS", fProfile::NUSI_BASE, fProfile::NUSI_BASE, 0xFFFF, 0xFF, 0}, + { "NusiT", fProfile::B_NUSI_TENTAKLE, fProfile::B_NUSI_TENTAKLE, 5, 19, 0}, + {"OBBLBom", fProfile::OBJ_BBLARGEBOMB, fProfile::OBJ_BBLARGEBOMB, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "OBBStn", fProfile::OBJ_BSTN, fProfile::OBJ_BSTN, 557, 0xFF, 0}, + {"ODesert", fProfile::OBJ_DESERT, fProfile::OBJ_DESERT, 0xFFFF, 0xFF, 0}, + { "OGhKf", fProfile::OBJ_GH_KNIFE, fProfile::OBJ_GH_KNIFE, 0xFFFF, SND_SOURCE_BULLET, 0}, + { "OGhSwL", fProfile::OBJ_GH_SW_L, fProfile::OBJ_GH_SW_L, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "OHole", fProfile::OBJ_HOLE, fProfile::OBJ_HOLE, 0xFFFF, 0xFF, 0}, + { "OPipe", fProfile::OBJ_PIPE, fProfile::OBJ_PIPE, 0xFFFF, SND_SOURCE_ITEM, 0}, + { "ORing", fProfile::OBJ_RING, fProfile::OBJ_RING, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "ObjBg", fProfile::OBJ_BG, fProfile::OBJ_BG, 0xFFFF, 0xFF, 0}, + { "ObjBld", fProfile::OBJ_BUILDING, fProfile::OBJ_BUILDING, 0xFFFF, 0xFF, 0}, + {"Obstacl", fProfile::OBJ_BELT_OBSTACLE, fProfile::OBJ_BELT_OBSTACLE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "OcGrs", fProfile::OBJ_OCT_GRASS, fProfile::OBJ_OCT_GRASS, 0xFFFF, 0xFF, 0}, + { "OcGrsL", fProfile::OBJ_OCT_GRASS_LEAF, fProfile::OBJ_OCT_GRASS_LEAF, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"OrCaBul", fProfile::OR_CANN_BULLET, fProfile::OR_CANN_BULLET, 0xFFFF, SND_SOURCE_BULLET, 0}, + { "Paint", fProfile::OBJ_PAINT, fProfile::OBJ_PAINT, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"Pinwhel", fProfile::OBJ_PINWHEEL, fProfile::OBJ_PINWHEEL, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Piston", fProfile::OBJ_PISTON, fProfile::OBJ_PISTON, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "PlCock", fProfile::OBJ_POOL_COCK, fProfile::OBJ_POOL_COCK, 0xFFFF, 0xFF, 0}, + {"PlRsTag", fProfile::PL_RESTART, fProfile::PL_RESTART, 0xFFFF, 0xFF, 0}, + { "Plight", fProfile::PLIGHT_TAG, fProfile::PLIGHT_TAG, 0xFFFF, 0xFF, 0}, + {"PlntA00", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 16}, + {"PlntA01", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 17}, + { "PlntB", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 18}, + {"PlntC00", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 19}, + {"PlntC01", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 20}, + { "PltA00", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 7}, + { "PltA01", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 8}, + { "PltA02", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 9}, + { "PltB00", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 10}, + { "PltB01", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 11}, + { "PltB02", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 12}, + { "PltChg", fProfile::PLTCHG_TAG, fProfile::PLTCHG_TAG, 0xFFFF, 0xFF, 0}, + {"PmpknBd", fProfile::PUMPKIN, fProfile::PUMPKIN, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"PmpknDe", fProfile::PUMPKIN, fProfile::PUMPKIN, 0xFFFF, 0xFF, 0}, + {"PoleStn", fProfile::OBJ_POLE_STONY, fProfile::OBJ_POLE_STONY, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "PotSal", fProfile::OBJ_POT_SAL, fProfile::OBJ_POT_SAL, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"Propera", fProfile::OBJ_PROPERA, fProfile::OBJ_PROPERA, 539, SND_SOURCE_OBJECT, 0}, + {"PrpLift", fProfile::OBJ_PROPELLER_LIFT, fProfile::OBJ_PROPELLER_LIFT, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"PumpBar", fProfile::OBJ_PUMPKIN_BAR, fProfile::OBJ_PUMPKIN_BAR, 0xFFFF, 0xFF, 0}, + {"Pumpkin", fProfile::OBJ_PUMPKIN_LEAF, fProfile::OBJ_PUMPKIN_LEAF, 0xFFFF, 0xFF, 0}, + {"PushBlk", fProfile::OBJ_PUSH_BLOCK, fProfile::OBJ_PUSH_BLOCK, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "PyBird", fProfile::BIRD, fProfile::BIRD, 0xFFFF, SND_SOURCE_PLAYER_BIRD, 0}, + {"PzlLand", fProfile::OBJ_PUZZLE_ISLAND, fProfile::OBJ_PUZZLE_ISLAND, 0xFFFF, 0xFF, 0}, + {"RRckTag", fProfile::RIDE_ROCK_SET_TAG, fProfile::RIDE_ROCK_SET_TAG, 0xFFFF, 0xFF, 0}, + { "RaceM", fProfile::AVATER_RACE_MNG, fProfile::AVATER_RACE_MNG, 0xFFFF, 0xFF, 0}, + {"RailEnd", fProfile::OBJ_RAIL_END, fProfile::OBJ_RAIL_END, 0xFFFF, 0xFF, 0}, + {"RailPst", fProfile::OBJ_RAIL_POST, fProfile::OBJ_RAIL_POST, 0xFFFF, 0xFF, 0}, + {"RidRock", fProfile::OBJ_RIDE_ROCK, fProfile::OBJ_RIDE_ROCK, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "RkDrgn", fProfile::OBJ_ROCK_DRAGON, fProfile::OBJ_ROCK_DRAGON, 0xFFFF, 42, 0}, + {"RoAtLog", fProfile::TAG_ROLL_ATTACK_LOG, fProfile::TAG_ROLL_ATTACK_LOG, 0xFFFF, 0xFF, 0}, + {"RoAtTag", fProfile::RO_AT_TAR_MANAGER_TAG, fProfile::RO_AT_TAR_MANAGER_TAG, 0xFFFF, 0xFF, 0}, + {"RoAtTar", fProfile::OBJ_RO_AT_TARGET, fProfile::OBJ_RO_AT_TARGET, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"RoLight", fProfile::OBJ_ROTATION_LIGHT, fProfile::OBJ_ROTATION_LIGHT, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"RockSky", fProfile::OBJ_ROCK_SKY, fProfile::OBJ_ROCK_SKY, 0xFFFF, 0xFF, 0}, + {"RolRock", fProfile::OBJ_ROLL_ROCK, fProfile::OBJ_ROLL_ROCK, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"RopeBas", fProfile::OBJ_ROPE_BASE, fProfile::OBJ_ROPE_BASE, 0xFFFF, 0xFF, 0}, + {"RopeIga", fProfile::OBJ_ROPE_IGAIGA, fProfile::OBJ_ROPE_IGAIGA, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"RouletC", fProfile::OBJ_ROULETTE_ISLAND_C, fProfile::OBJ_ROULETTE_ISLAND_C, 0xFFFF, 0xFF, 0}, + {"RouletR", fProfile::OBJ_ROULETTE_ISLAND_R, fProfile::OBJ_ROULETTE_ISLAND_R, 0xFFFF, 0xFF, 0}, + {"Roulete", fProfile::OBJ_ROULETTE, fProfile::OBJ_ROULETTE, 540, SND_SOURCE_OBJECT, 0}, + {"RuinSav", fProfile::OBJ_RUINED_SAVE, fProfile::OBJ_RUINED_SAVE, 0xFFFF, 0xFF, 0}, + {"SKinoko", fProfile::OBJ_MUSHROOM, fProfile::OBJ_MUSHROOM, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"SStatue", fProfile::OBJ_STEP_STATUE, fProfile::OBJ_STEP_STATUE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"STCover", fProfile::OBJ_STAGE_COVER, fProfile::OBJ_STAGE_COVER, 0xFFFF, 0xFF, 0}, + {"STCrack", fProfile::OBJ_STAGE_CRACK, fProfile::OBJ_STAGE_CRACK, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"STKraPt", fProfile::OBJ_STAGE_KRAKEN_PARTS, fProfile::OBJ_STAGE_KRAKEN_PARTS, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"STKrake", fProfile::OBJ_STAGE_KRAKEN, fProfile::OBJ_STAGE_KRAKEN, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "STSink", fProfile::OBJ_STAGE_SINK, fProfile::OBJ_STAGE_SINK, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"STWater", fProfile::OBJ_STAGE_WATER, fProfile::OBJ_STAGE_WATER, 0xFFFF, 0xFF, 0}, + { "Sail", fProfile::OBJ_SAIL, fProfile::OBJ_SAIL, 0xFFFF, 0xFF, 0}, + {"Sandbag", fProfile::OBJ_SANDBAG, fProfile::OBJ_SANDBAG, 0xFFFF, 0xFF, 0}, + {"ScChang", fProfile::SC_CHANGE_TAG, fProfile::SC_CHANGE_TAG, 0xFFFF, 0xFF, 0}, + { "Scarab", fProfile::INSECT_SCARAB, fProfile::INSECT_SCARAB, 775, SND_SOURCE_INSECT, 0}, + { "SdCdl", fProfile::OBJ_SWORD_CANDLE, fProfile::OBJ_SWORD_CANDLE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"SeaF301", fProfile::OBJ_SEA_F301, fProfile::OBJ_SEA_F301, 0xFFFF, 0xFF, 0}, + { "Shed", fProfile::OBJ_SHED, fProfile::OBJ_SHED, 0xFFFF, 0xFF, 0}, + {"ShipFld", fProfile::TAG_SHIP_FLOOD, fProfile::TAG_SHIP_FLOOD, 0xFFFF, 0xFF, 0}, + {"ShipSlp", fProfile::TAG_SHIP_SLOPE, fProfile::TAG_SHIP_SLOPE, 0xFFFF, 0xFF, 0}, + {"ShipWin", fProfile::OBJ_SHIP_WINDOW, fProfile::OBJ_SHIP_WINDOW, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"ShpSmpl", fProfile::SHOP_SAMPLE, fProfile::SHOP_SAMPLE, 553, 0xFF, 0}, + {"ShriAft", fProfile::OBJ_SHRINE_AFTER, fProfile::OBJ_SHRINE_AFTER, 0xFFFF, 0xFF, 0}, + {"ShriBef", fProfile::OBJ_SHRINE_BEFORE, fProfile::OBJ_SHRINE_BEFORE, 0xFFFF, 0xFF, 0}, + {"ShriIns", fProfile::OBJ_SHRINE_BEF_INSIDE, fProfile::OBJ_SHRINE_BEF_INSIDE, 0xFFFF, 0xFF, 0}, + { "ShtCS", fProfile::OBJ_SHUTTER_CHANGE_SCENE, fProfile::OBJ_SHUTTER_CHANGE_SCENE, 0xFFFF, SND_SOURCE_SHUTTER, 0}, + {"ShtrWtr", fProfile::OBJ_SHUTTER_WATER_D101, fProfile::OBJ_SHUTTER_WATER_D101, 0xFFFF, SND_SOURCE_SHUTTER, 0}, + { "SideST", fProfile::OBJ_SIDE_SHUTTER, fProfile::OBJ_SIDE_SHUTTER, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"Siren2D", fProfile::OBJ_SIREN_2DMAP, fProfile::OBJ_SIREN_2DMAP, 0xFFFF, 0xFF, 0}, + {"SirenTg", fProfile::SIREN_TAG, fProfile::SIREN_TAG, 0xFFFF, 0xFF, 0}, + {"SkEnmyT", fProfile::SKYENEMY_T, fProfile::SKYENEMY_T, 0xFFFF, 59, 0}, + {"SldDoor", fProfile::OBJ_SEALED_DOOR, fProfile::OBJ_SEALED_DOOR, 0xFFFF, 0xFF, 0}, + {"SliceLg", fProfile::OBJ_SLICE_LOG, fProfile::OBJ_SLICE_LOG, 543, SND_SOURCE_OBJECT, 0}, + {"SlicePt", fProfile::OBJ_SLICE_LOG_PARTS, fProfile::OBJ_SLICE_LOG_PARTS, 543, SND_SOURCE_OBJECT, 0}, + { "Smoke", fProfile::OBJ_SMOKE, fProfile::OBJ_SMOKE, 0xFFFF, 0xFF, 0}, + {"SnLight", fProfile::OBJ_SUN_LIGHT, fProfile::OBJ_SUN_LIGHT, 0xFFFF, 0xFF, 0}, + {"SndD301", fProfile::OBJ_SAND_D301, fProfile::OBJ_SAND_D301, 0xFFFF, 0xFF, 0}, + { "SndStn", fProfile::OBJ_STONE_STAND, fProfile::OBJ_STONE_STAND, 558, SND_SOURCE_OBJECT, 0}, + { "SngGS", fProfile::OBJ_GODDESS_STATUE, fProfile::OBJ_GODDESS_STATUE, 0xFFFF, 0xFF, 0}, + {"SnkFlrF", fProfile::OBJ_SINK_FLOOR_F, fProfile::OBJ_SINK_FLOOR_F, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Soil", fProfile::OBJ_SOIL, fProfile::OBJ_SOIL, 0xFFFF, 33, 0}, + {"SpWinTg", fProfile::TAG_SHIP_WINDOW, fProfile::TAG_SHIP_WINDOW, 0xFFFF, 0xFF, 0}, + {"SparkTg", fProfile::SPARKS_TAG, fProfile::SPARKS_TAG, 0xFFFF, 0xFF, 0}, + {"SpiderL", fProfile::OBJ_SPIDER_LINE, fProfile::OBJ_SPIDER_LINE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Spike", fProfile::OBJ_SPIKE, fProfile::OBJ_SPIKE, 0xFFFF, 0xFF, 0}, + { "SpkTg2", fProfile::SPARKS2_TAG, fProfile::SPARKS2_TAG, 0xFFFF, 0xFF, 0}, + { "Spore", fProfile::OBJ_SPORE, fProfile::OBJ_SPORE, 0xFFFF, 0xFF, 0}, + {"SporeTg", fProfile::SPORE_TAG, fProfile::SPORE_TAG, 0xFFFF, 0xFF, 0}, + { "SrnSk", fProfile::OBJ_SIREN_BARRIER, fProfile::OBJ_SIREN_BARRIER, 0xFFFF, 0xFF, 0}, + { "StepTS", fProfile::OBJ_STEP_TIME_SLIP, fProfile::OBJ_STEP_TIME_SLIP, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"StgBgTs", fProfile::OBJ_TIME_STAGE_BG, fProfile::OBJ_TIME_STAGE_BG, 0xFFFF, 0xFF, 0}, + { "StpGm", fProfile::OBJ_STEP_GUMARM, fProfile::OBJ_STEP_GUMARM, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"StpRope", fProfile::OBJ_STOPPING_ROPE, fProfile::OBJ_STOPPING_ROPE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "StprRc", fProfile::OBJ_STOPPER_ROCK, fProfile::OBJ_STOPPER_ROCK, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"StrLava", fProfile::OBJ_STREAM_LAVA, fProfile::OBJ_STREAM_LAVA, 0xFFFF, 0xFF, 0}, + {"StreamT", fProfile::TAG_STREAM, fProfile::TAG_STREAM, 0xFFFF, 0xFF, 0}, + { "Sw", fProfile::OBJ_SW, fProfile::OBJ_SW, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"SwAreaT", fProfile::SW_AREA_TAG, fProfile::SW_AREA_TAG, 0xFFFF, 0xFF, 0}, + { "SwBnk", fProfile::OBJ_SW_BANK, fProfile::OBJ_SW_BANK, 527, SND_SOURCE_OBJECT, 0}, + { "SwBnkS", fProfile::OBJ_SW_BANK_SMALL, fProfile::OBJ_SW_BANK_SMALL, 528, SND_SOURCE_OBJECT, 0}, + { "SwDir", fProfile::OBJ_SW_DIR, fProfile::OBJ_SW_DIR, 536, SND_SOURCE_OBJECT, 0}, + { "SwDir2", fProfile::OBJ_SW_DIR_DOOR, fProfile::OBJ_SW_DIR_DOOR, 516, SND_SOURCE_OBJECT, 0}, + { "SwHrp", fProfile::OBJ_SW_HARP, fProfile::OBJ_SW_HARP, 548, SND_SOURCE_SW_HARP, 0}, + { "SwSB", fProfile::OBJ_SW_SWORD_BEAM, fProfile::OBJ_SW_SWORD_BEAM, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "SwTag", fProfile::SW_TAG, fProfile::SW_TAG, 0xFFFF, 0xFF, 0}, + { "SwWall", fProfile::OBJ_SWITCH_WALL, fProfile::OBJ_SWITCH_WALL, 519, SND_SOURCE_OBJECT, 0}, + { "SwdStb", fProfile::OBJ_SWORD_STAB, fProfile::OBJ_SWORD_STAB, 0xFFFF, 0xFF, 0}, + { "Swhit", fProfile::OBJ_SWHIT, fProfile::OBJ_SWHIT, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"SwrdPrj", fProfile::OBJ_SWRD_PRJ, fProfile::OBJ_SWRD_PRJ, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "SwrdSt", fProfile::OBJ_SEAT_SWORD, fProfile::OBJ_SEAT_SWORD, 0xFFFF, 0xFF, 0}, + { "TAgo", fProfile::OBJ_DESERT_AGO, fProfile::OBJ_DESERT_AGO, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "TBcal", fProfile::T_BCAL, fProfile::T_BCAL, 0xFFFF, 0xFF, 0}, + { "TBoat", fProfile::OBJ_TIME_BOAT, fProfile::OBJ_TIME_BOAT, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "TBoatB", fProfile::OBJ_TIME_BOAT_BULLET, fProfile::OBJ_TIME_BOAT_BULLET, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "TBox", fProfile::TBOX, fProfile::TBOX, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "TChk", fProfile::TAG_TIME_AREA_CHECK, fProfile::TAG_TIME_AREA_CHECK, 0xFFFF, 0xFF, 0}, + { "TDoor", fProfile::OBJ_TIME_DOOR, fProfile::OBJ_TIME_DOOR, 0xFFFF, 42, 0}, + { "TDoorB", fProfile::OBJ_TIME_DOOR_BEFORE, fProfile::OBJ_TIME_DOOR_BEFORE, 556, 0xFF, 0}, + {"TGrD101", fProfile::OBJ_TOWER_GEAR_D101, fProfile::OBJ_TOWER_GEAR_D101, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"TKumite", fProfile::T_KUMITE, fProfile::T_KUMITE, 0xFFFF, 0xFF, 0}, + { "TPole", fProfile::OBJ_TARZAN_POLE, fProfile::OBJ_TARZAN_POLE, 523, SND_SOURCE_OBJECT, 0}, + { "TRail", fProfile::OBJ_TENI_RAIL, fProfile::OBJ_TENI_RAIL, 0xFFFF, 0xFF, 0}, + {"TRalPst", fProfile::OBJ_TENI_RAIL_POST, fProfile::OBJ_TENI_RAIL_POST, 0xFFFF, 0xFF, 0}, + { "TSBase", fProfile::OBJ_TIME_BASE, fProfile::OBJ_TIME_BASE, 0xFFFF, 0xFF, 0}, + { "TSBlk", fProfile::OBJ_TIME_BLOCK, fProfile::OBJ_TIME_BLOCK, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "TWeed", fProfile::OBJ_TUMBLE_WEED, fProfile::OBJ_TUMBLE_WEED, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Tckl", fProfile::OBJ_TACKLE, fProfile::OBJ_TACKLE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"TerBike", fProfile::OBJ_TERRY_BIKE, fProfile::OBJ_TERRY_BIKE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"TerrGmk", fProfile::OBJ_TERRY_GIMMICK, fProfile::OBJ_TERRY_GIMMICK, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"TerrHol", fProfile::OBJ_TERRY_HOLE, fProfile::OBJ_TERRY_HOLE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "TerrSw", fProfile::OBJ_TERRY_SWITCH, fProfile::OBJ_TERRY_SWITCH, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "TgClay", fProfile::TAG_PUMPKIN_CLAY, fProfile::TAG_PUMPKIN_CLAY, 0xFFFF, 0xFF, 0}, + {"TgClefG", fProfile::TAG_CLEF_GAME, fProfile::TAG_CLEF_GAME, 0xFFFF, 0xFF, 0}, + {"TgClefM", fProfile::TAG_CLEF_MANAGER, fProfile::TAG_CLEF_MANAGER, 0xFFFF, 0xFF, 0}, + {"TgD3Chg", fProfile::TAG_D3_SCENE_CHANGE, fProfile::TAG_D3_SCENE_CHANGE, 0xFFFF, 0xFF, 0}, + {"TgDefea", fProfile::TAG_DEFEAT_BOSS, fProfile::TAG_DEFEAT_BOSS, 0xFFFF, 0xFF, 0}, + {"TgFence", fProfile::TAG_FENCE_SYNCHRONIZER, fProfile::TAG_FENCE_SYNCHRONIZER, 0xFFFF, 0xFF, 0}, + {"TgMICap", fProfile::TAG_MINIGAME_INSECT_CAPTURE, fProfile::TAG_MINIGAME_INSECT_CAPTURE, 0xFFFF, 0xFF, 0}, + { "TgMien", fProfile::TAG_MIECHAN, fProfile::TAG_MIECHAN, 0xFFFF, 0xFF, 0}, + {"TgNoEff", fProfile::TAG_NOEFFECT_AREA, fProfile::TAG_NOEFFECT_AREA, 0xFFFF, 0xFF, 0}, + {"TgRBoat", fProfile::TAG_ROCK_BOAT, fProfile::TAG_ROCK_BOAT, 0xFFFF, 0xFF, 0}, + {"TgReact", fProfile::TAG_REACTION, fProfile::TAG_REACTION, 0xFFFF, 0xFF, 0}, + {"TgRstTs", fProfile::TAG_RESTART_TIME_STONE, fProfile::TAG_RESTART_TIME_STONE, 0xFFFF, 0xFF, 0}, + { "TgSBG", fProfile::TAG_SWORD_BATTLE_GAME, fProfile::TAG_SWORD_BATTLE_GAME, 0xFFFF, 0xFF, 0}, + { "TgSTA", fProfile::TAG_SIREN_TIME_ATTACK, fProfile::TAG_SIREN_TIME_ATTACK, 0xFFFF, 0xFF, 0}, + {"TgSndAr", fProfile::TAG_SOUND_AREA, fProfile::TAG_SOUND_AREA, 0xFFFF, 0xFF, 0}, + {"TgSndMg", fProfile::SOUND_AREA_MGR, fProfile::SOUND_AREA_MGR, 0xFFFF, 0xFF, 0}, + {"TgSound", fProfile::SOUND_TAG, fProfile::SOUND_TAG, 0xFFFF, 0xFF, 0}, + { "TgTDB", fProfile::TAG_TIME_DOOR_BEAM, fProfile::TAG_TIME_DOOR_BEAM, 0xFFFF, 0xFF, 0}, + { "TgTckl", fProfile::TACKLE_TAG, fProfile::TACKLE_TAG, 0xFFFF, 0xFF, 0}, + {"TgTimer", fProfile::TAG_TIMER, fProfile::TAG_TIMER, 0xFFFF, 0xFF, 0}, + { "TgTrap", fProfile::OBJ_TOGE_TRAP, fProfile::OBJ_TOGE_TRAP, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "TgTw", fProfile::TUMBLE_WEED_TAG, fProfile::TUMBLE_WEED_TAG, 0xFFFF, 59, 0}, + { "TimeIs", fProfile::OBJ_TENIJIMA, fProfile::OBJ_TENIJIMA, 0xFFFF, 0xFF, 0}, + {"TimeStn", fProfile::OBJ_TIME_STONE, fProfile::OBJ_TIME_STONE, 0xFFFF, SND_SOURCE_TIME_STONE, 0}, + { "TkEvnt", fProfile::TAG_TKEVNT, fProfile::TAG_TKEVNT, 0xFFFF, 0xFF, 0}, + { "TlpTag", fProfile::TLP_TAG, fProfile::TLP_TAG, 0xFFFF, 0xFF, 0}, + {"ToD3Stn", fProfile::OBJ_TOD3_STONE, fProfile::OBJ_TOD3_STONE, 537, 0xFF, 0}, + {"Tornado", fProfile::OBJ_TORNADO, fProfile::OBJ_TORNADO, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"TouchTa", fProfile::TOUCH_TAG, fProfile::TOUCH_TAG, 0xFFFF, 0xFF, 0}, + { "TowerB", fProfile::OBJ_TOWER_BOMB, fProfile::OBJ_TOWER_BOMB, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"TowerHa", fProfile::OBJ_TOWER_HAND_D101, fProfile::OBJ_TOWER_HAND_D101, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"TrRaiCo", fProfile::OBJ_TRUCK_RAIL_COL, fProfile::OBJ_TRUCK_RAIL_COL, 0xFFFF, 0xFF, 0}, + {"TrShtCs", fProfile::OBJ_TR_SHUTTER_CS, fProfile::OBJ_TR_SHUTTER_CS, 0xFFFF, SND_SOURCE_SHUTTER, 0}, + {"TrapRc1", fProfile::OBJ_TRAP_ROCK_1, fProfile::OBJ_TRAP_ROCK_1, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"TriForc", fProfile::OBJ_TRIFORCE, fProfile::OBJ_TRIFORCE, 0xFFFF, 0xFF, 0}, + {"TrpBrdW", fProfile::OBJ_TRAP_BIRD_WOOD, fProfile::OBJ_TRAP_BIRD_WOOD, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"TruRail", fProfile::TRUCK_RAIL, fProfile::TRUCK_RAIL, 0xFFFF, 0xFF, 0}, + { "Truck", fProfile::OBJ_TRUCK, fProfile::OBJ_TRUCK, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"TrukStp", fProfile::OBJ_TRUCK_STOPPER, fProfile::OBJ_TRUCK_STOPPER, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Tshop", fProfile::OBJ_TERRY_SHOP, fProfile::OBJ_TERRY_SHOP, 0xFFFF, SND_SOURCE_TERRY_SHOP, 0}, + {"TstShtr", fProfile::SHUTTER, fProfile::SHUTTER, 0xFFFF, SND_SOURCE_SHUTTER, 0}, + { "Tubo", fProfile::OBJ_TUBO, fProfile::OBJ_TUBO, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "UDLava", fProfile::OBJ_UPDOWN_LAVA, fProfile::OBJ_UPDOWN_LAVA, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"UdCloud", fProfile::OBJ_UNDER_CLOUD, fProfile::OBJ_UNDER_CLOUD, 0xFFFF, 0xFF, 0}, + {"UgSwitc", fProfile::OBJ_UG_SWITCH, fProfile::OBJ_UG_SWITCH, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"Uground", fProfile::OBJ_UNDERGROUND, fProfile::OBJ_UNDERGROUND, 0xFFFF, 59, 0}, + {"UtaLand", fProfile::OBJ_UTAJIMA_ISLAND, fProfile::OBJ_UTAJIMA_ISLAND, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "UtaLv2", fProfile::OBJ_UTAJIMA_LV2, fProfile::OBJ_UTAJIMA_LV2, 0xFFFF, 0xFF, 0}, + {"UtaMain", fProfile::OBJ_UTAJIMA_MAIN_MECHA, fProfile::OBJ_UTAJIMA_MAIN_MECHA, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"UtaPeds", fProfile::OBJ_UTAJIMA_PEDESTAL, fProfile::OBJ_UTAJIMA_PEDESTAL, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"UtaStop", fProfile::OBJ_UTAJIMA_STOPPER, fProfile::OBJ_UTAJIMA_STOPPER, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"Utajima", fProfile::OBJ_UTAJIMA, fProfile::OBJ_UTAJIMA, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "V_Clip", fProfile::VIEW_CLIP_TAG, fProfile::VIEW_CLIP_TAG, 0xFFFF, 0xFF, 0}, + {"VacuDsP", fProfile::OBJ_VACU_DUST_PARTS, fProfile::OBJ_VACU_DUST_PARTS, 0xFFFF, 0xFF, 0}, + {"VacuDst", fProfile::OBJ_VACU_DUST, fProfile::OBJ_VACU_DUST, 0xFFFF, 0xFF, 0}, + { "Vdb", fProfile::OBJ_VDB, fProfile::OBJ_VDB, 0xFFFF, SND_SOURCE_BULLET, 0}, + {"VentFan", fProfile::OBJ_VENT_FAN, fProfile::OBJ_VENT_FAN, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Vortex", fProfile::OBJ_VORTEX, fProfile::OBJ_VORTEX, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Vrbox", fProfile::VRBOX_TAG, fProfile::VRBOX_TAG, 0xFFFF, 0xFF, 0}, + { "WFF102", fProfile::OBJ_WATERFALL_F102, fProfile::OBJ_WATERFALL_F102, 0xFFFF, 0xFF, 0}, + { "Warp", fProfile::TIME_AREA, fProfile::TIME_AREA, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "WarpH", fProfile::OBJ_WARP_HOLE, fProfile::OBJ_WARP_HOLE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"WarpObj", fProfile::OBJ_WARP, fProfile::OBJ_WARP, 547, SND_SOURCE_OBJECT_WARP, 0}, + {"WaterSW", fProfile::OBJ_WATER_SWITCH, fProfile::OBJ_WATER_SWITCH, 526, SND_SOURCE_OBJECT, 0}, + {"WaterSf", fProfile::OBJ_WATER_SURFACE, fProfile::OBJ_WATER_SURFACE, 0xFFFF, 0xFF, 0}, + {"WaterSp", fProfile::OBJ_WATER_SPOUT, fProfile::OBJ_WATER_SPOUT, 0xFFFF, 0xFF, 0}, + {"WatrIga", fProfile::OBJ_WATER_IGAIGA, fProfile::OBJ_WATER_IGAIGA, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"WdBoard", fProfile::OBJ_WOOD_BOARD, fProfile::OBJ_WOOD_BOARD, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Wind", fProfile::OBJ_WIND, fProfile::OBJ_WIND, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Wind02", fProfile::OBJ_WIND02, fProfile::OBJ_WIND02, 0xFFFF, 0xFF, 0}, + { "Wind03", fProfile::OBJ_WIND03, fProfile::OBJ_WIND03, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "Wind04", fProfile::OBJ_WIND04, fProfile::OBJ_WIND04, 0xFFFF, 0xFF, 0}, + {"Windmil", fProfile::OBJ_WINDMILL, fProfile::OBJ_WINDMILL, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"WnLeafA", fProfile::OBJ_WATER_NUT_LEAF, fProfile::OBJ_WATER_NUT_LEAF, 542, SND_SOURCE_OBJECT, 1}, + {"WnLeafB", fProfile::OBJ_WATER_NUT_LEAF, fProfile::OBJ_WATER_NUT_LEAF, 0xFFFF, SND_SOURCE_OBJECT, 2}, + {"WnLeafC", fProfile::OBJ_WATER_NUT_LEAF, fProfile::OBJ_WATER_NUT_LEAF, 542, SND_SOURCE_OBJECT, 3}, + {"WnLeafD", fProfile::OBJ_WATER_NUT_LEAF, fProfile::OBJ_WATER_NUT_LEAF, 0xFFFF, SND_SOURCE_OBJECT, 4}, + {"WndMilD", fProfile::OBJ_WINDMILL_DESERT, fProfile::OBJ_WINDMILL_DESERT, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"WoodTag", fProfile::WOODAREA_TAG, fProfile::WOODAREA_TAG, 0xFFFF, 0xFF, 1}, + {"WoodTg2", fProfile::WOODAREA_TAG, fProfile::WOODAREA_TAG, 0xFFFF, 0xFF, 2}, + {"WtFD100", fProfile::OBJ_WATERFALL_D100, fProfile::OBJ_WATERFALL_D100, 0xFFFF, 0xFF, 0}, + {"WtrF100", fProfile::OBJ_WATER_F100, fProfile::OBJ_WATER_F100, 0xFFFF, 0xFF, 0}, + { "WtrJar", fProfile::OBJ_WATER_JAR, fProfile::OBJ_WATER_JAR, 552, 0xFF, 0}, + { "WtrMrk", fProfile::OBJ_WATER_MARK, fProfile::OBJ_WATER_MARK, 0xFFFF, 0xFF, 0}, + {"WtrShld", fProfile::OBJ_WATER_SHIELD, fProfile::OBJ_WATER_SHIELD, 0xFFFF, 0xFF, 0}, + { "chest", fProfile::OBJ_CHEST, fProfile::OBJ_CHEST, 0xFFFF, 42, 0}, + { "d2ship", fProfile::OBJ_DUNGEON_SHIP, fProfile::OBJ_DUNGEON_SHIP, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "fruit", fProfile::OBJ_FRUIT, fProfile::OBJ_FRUIT, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "ftower", fProfile::OBJ_TOWER_D101, fProfile::OBJ_TOWER_D101, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "lock", fProfile::OBJ_SHUTTER_LOCK, fProfile::OBJ_SHUTTER_LOCK, 0xFFFF, SND_SOURCE_SHUTTER, 0}, + {"needleU", fProfile::OBJ_NEEDLE_UNDERGROUND, fProfile::OBJ_NEEDLE_UNDERGROUND, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"rpiller", fProfile::OBJ_ROLL_PILLAR, fProfile::OBJ_ROLL_PILLAR, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "sandD1", fProfile::OBJ_SAND_FLOOR, fProfile::OBJ_SAND_FLOOR, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"sandflr", fProfile::OBJ_SAND_FLOOR, fProfile::OBJ_SAND_FLOOR, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"saveObj", fProfile::OBJ_SAVE, fProfile::OBJ_SAVE, 515, 0xFF, 0}, + { "skull", fProfile::OBJ_SKULL, fProfile::OBJ_SKULL, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"sw_whip", fProfile::OBJ_SW_WHIPLEVER, fProfile::OBJ_SW_WHIPLEVER, 522, SND_SOURCE_OBJECT, 0}, + { "swsht", fProfile::OBJ_SWITCH_SHUTTER, fProfile::OBJ_SWITCH_SHUTTER, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"swsyako", fProfile::OBJ_SW_SYAKO, fProfile::OBJ_SW_SYAKO, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"syashtr", fProfile::OBJ_SYAKO_SHUTTER, fProfile::OBJ_SYAKO_SHUTTER, 0xFFFF, SND_SOURCE_SHUTTER, 0}, + {"trlshut", fProfile::OBJ_TROLLEY_SHUTTER, fProfile::OBJ_TROLLEY_SHUTTER, 0xFFFF, SND_SOURCE_SHUTTER, 0}, + {"trolley", fProfile::OBJ_TROLLEY, fProfile::OBJ_TROLLEY, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "tware", fProfile::OBJ_TABLEWARE, fProfile::OBJ_TABLEWARE, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "vmSand", fProfile::OBJ_VSD, fProfile::OBJ_VSD, 0xFFFF, SND_SOURCE_OBJECT, 0}, + {"weather", fProfile::WEATHER_TAG, fProfile::WEATHER_TAG, 0xFFFF, 0xFF, 0}, + { "wfall", fProfile::OBJ_WATERFALL_D101, fProfile::OBJ_WATERFALL_D101, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "wnleaf", fProfile::OBJ_WATER_NUT_LEAF, fProfile::OBJ_WATER_NUT_LEAF, 0xFFFF, SND_SOURCE_OBJECT, 0}, + { "wnut", fProfile::OBJ_WATER_NUT, fProfile::OBJ_WATER_NUT, 0xFFFF, SND_SOURCE_OBJECT, 0}, }; #pragma pop diff --git a/src/toBeSorted/d_d3d.cpp b/src/toBeSorted/d_d3d.cpp index 3b38c67f..0f562b4f 100644 --- a/src/toBeSorted/d_d3d.cpp +++ b/src/toBeSorted/d_d3d.cpp @@ -125,7 +125,7 @@ void AnmMdlWrapper::setSoundSource(dSoundSourceIf_c *pSource) { } bool AnmMdlWrapper::loadSounds(const char *name) { - if (mpSoundSource == nullptr || !mpSoundSource->isReadyMaybe()) { + if (mpSoundSource == nullptr || !mpSoundSource->hasAnimSound()) { return true; } diff --git a/src/toBeSorted/d_emitter.cpp b/src/toBeSorted/d_emitter.cpp index 64079684..ba4fcfd2 100644 --- a/src/toBeSorted/d_emitter.cpp +++ b/src/toBeSorted/d_emitter.cpp @@ -907,7 +907,9 @@ bool dJEffManager_c::createEffManagers() { } } - ms_allocator->createFrmHeapToCurrent(-1, dHeap::work1Heap.heap, "dJEffManager_c::ms_allocator", 0x20, mHeap::OPT_NONE); + ms_allocator->createFrmHeapToCurrent( + -1, dHeap::work1Heap.heap, "dJEffManager_c::ms_allocator", 0x20, mHeap::OPT_NONE + ); for (s32 idx = 0; idx < 2; idx++) { sFogProcs[idx].create(idx, sInts[idx], -1, ms_allocator); } @@ -1179,27 +1181,25 @@ bool EffectsStruct::createEffect( return hasEmitters(); } -// TODO: Document PolyAttrs -s32 dJEffManager_c::polyAttrsToGroundEffectIdx(s32 polyAttr0, s32 polyAttr1) { - if (polyAttr0 == 0 || (polyAttr0 == 4 && polyAttr1 == 1) || (polyAttr0 == 9) || - (polyAttr0 == 10 && polyAttr1 == 1) || (polyAttr0 == 12) || (polyAttr0 == 17 && polyAttr1 != 1) || - (polyAttr0 == 13 && (polyAttr1 == 1 || polyAttr1 == 3)) || polyAttr0 == 18) { - return 6; - } else if (polyAttr0 == 17) { - return 5; - } else if (polyAttr0 == 6) { - return 2; - } else if (polyAttr0 == 4) { - return 1; - } else if (polyAttr0 == 3 || polyAttr0 == 15) { - return 3; +// TODO: Document polyAttr1 and GROUND enum +dJEffManager_c::GroundEffect_e dJEffManager_c::polyAttrsToGroundEffectIdx(s32 polyAttr0, s32 polyAttr1) { + if (polyAttr0 == POLY_ATT_0_NONE || (polyAttr0 == POLY_ATT_0_GRASS && polyAttr1 == 1) || (polyAttr0 == POLY_ATT_0_LOTUS) || + (polyAttr0 == POLY_ATT_0_METAL && polyAttr1 == 1) || (polyAttr0 == POLY_ATT_0_TUTA) || (polyAttr0 == POLY_ATT_0_DEATH && polyAttr1 != 1) || + (polyAttr0 == POLY_ATT_0_LIFE && (polyAttr1 == 1 || polyAttr1 == 3)) || polyAttr0 == POLY_ATT_0_MAX) { + return GROUND_6; + } else if (polyAttr0 == POLY_ATT_0_DEATH) { + return GROUND_5; + } else if (polyAttr0 == POLY_ATT_0_LAVA) { + return GROUND_2; + } else if (polyAttr0 == POLY_ATT_0_GRASS) { + return GROUND_1; + } else if (polyAttr0 == POLY_ATT_0_SAND || polyAttr0 == POLY_ATT_0_QSAND) { + return GROUND_3; + } else if (polyAttr0 == POLY_ATT_0_NUMA) { + return GROUND_4; + } else { + return GROUND_0; } - // ??? - s32 result = 0; - if (polyAttr0 == 11) { - result = 4; - } - return result; } dEmitterBase_c *dJEffManager_c::spawnGroundEffect( @@ -1218,11 +1218,11 @@ dEmitterBase_c *dJEffManager_c::spawnGroundEffect( return nullptr; } - s32 idx = polyAttrsToGroundEffectIdx(polyAttr0, polyAttr1); - if (idx == 6) { + GroundEffect_e idx = polyAttrsToGroundEffectIdx(polyAttr0, polyAttr1); + if (idx == GROUND_6) { return nullptr; } - if (idx == 2 && unk == 0) { + if (idx == GROUND_2 && unk == 0) { scale *= 1.5f; } mMtx_c mtx; diff --git a/src/toBeSorted/sound_info.cpp b/src/toBeSorted/sound_info.cpp index 98f7c6ea..af3de5ed 100644 --- a/src/toBeSorted/sound_info.cpp +++ b/src/toBeSorted/sound_info.cpp @@ -1,13 +1,31 @@ +#include "toBeSorted/sound_info.h" + +#include "common.h" #include "d/a/d_a_base.h" +#include "d/col/bg/d_bg_s.h" -extern "C" dSoundSourceIf_c *soundForActorInitRelated_803889c0(int, fBase_c *, char *, u8); +SoundInfo::SoundInfo(dAcBase_c *ac) : mpActor(ac) {} -extern "C" bool fn_8002C250(SoundInfo *p1, int someNum, char *name, mVec3_c *position) { - p1->sound_source = soundForActorInitRelated_803889c0(someNum, p1->actor, name, 0); - if (!p1->sound_source) { +SoundInfo::~SoundInfo() { + if (mpActor != nullptr) { + mpActor->removeSoundInfo(this); + mpActor = nullptr; + } +} + +bool SoundInfo::initSource(s32 sourceType, const char *name, const mVec3_c *posPtr) { + mpSource = dSoundSourceIf_c::create(sourceType, mpActor, name, 0); + if (mpSource == nullptr) { return false; } - p1->actor->sound_list.append(p1); - p1->obj_pos = position; + mpActor->sound_list.append(this); + mpPosPtr = posPtr; return true; } + +bool SoundInfo::startBgHitSound(u32 soundId, const cBgS_PolyInfo &info, const mVec3_c *position) { + return mpSource->startBgHitSound( + soundId, dBgS::GetInstance()->GetPolyAtt0(info), dBgS::GetInstance()->GetPolyAtt1(info), + position != nullptr ? position : &mpActor->position + ); +}