mirror of
https://github.com/zeldaret/ss
synced 2026-05-29 16:44:44 -04:00
+262
-19
@@ -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
|
||||
|
||||
+1528
-1514
File diff suppressed because it is too large
Load Diff
+55
-16
@@ -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"),
|
||||
],
|
||||
},
|
||||
|
||||
+21
-27
@@ -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<SoundInfo> 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<SoundInfo, 12> SoundInfoList;
|
||||
|
||||
/* 0x68 */ mHeapAllocator_c heap_allocator;
|
||||
/* 0x84 */ const ActorInfo *mpActorInfo;
|
||||
/* 0x88 */ TList<SoundInfo, 12> sound_list;
|
||||
/* 0x94 */ RaiiPtr<dSoundSourceIf_c> sound_source;
|
||||
/* 0x88 */ SoundInfoList sound_list;
|
||||
/* 0x94 */ RaiiPtr<dSoundSourceIf_c> 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<dAcBase_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
|
||||
|
||||
|
||||
@@ -93,6 +93,10 @@ public:
|
||||
return LINK;
|
||||
}
|
||||
|
||||
static dAcPy_c *GetLinkM() {
|
||||
return LINK;
|
||||
}
|
||||
|
||||
static dAcPy_c *GetLink2() {
|
||||
return LINK2;
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -33,6 +33,9 @@ public:
|
||||
mScreenShakeIntensity = val;
|
||||
}
|
||||
|
||||
bool isUnderwater() const;
|
||||
f32 getUnderwaterDepth() const;
|
||||
|
||||
private:
|
||||
/* 0x068 */ u8 _0x068[0x6C - 0x068];
|
||||
/* 0x06C */ mVec3_c mPositionMaybe;
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -88,6 +88,10 @@ struct SpawnInfo {
|
||||
return (Trial)trial;
|
||||
}
|
||||
|
||||
const char *getStageName() const {
|
||||
return stageName;
|
||||
}
|
||||
|
||||
bool isNight() {
|
||||
return getTimeOfDay() == NIGHT;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
+34
-27
@@ -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;
|
||||
|
||||
+246
-66
@@ -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 <cstring>
|
||||
|
||||
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
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
@@ -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
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -4,6 +4,35 @@
|
||||
#include "common.h"
|
||||
#include "egg/core/eggDisposer.h"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
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<ty *>(nw4r::ut::List_GetFirst(&m##name##List)); \
|
||||
} \
|
||||
inline ty *get##name##Next(ty *p) { \
|
||||
return static_cast<ty *>(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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
+2
-6
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 <typename Sound>
|
||||
Sound *AllocSound(
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -6,6 +6,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
extern u16 __AXCompressorTable[];
|
||||
void AXSetCompressor(BOOL);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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<dSoundSourceIf_c> mpSource;
|
||||
/* 0x08 */ const mVec3_c *mpPosPtr;
|
||||
/* 0x0C */ TListNode<SoundInfo> 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
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
+12
-12
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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); // ?
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user