diff --git a/assets/xml/interface/nes_font_static.xml b/assets/xml/interface/nes_font_static.xml new file mode 100644 index 000000000..b021dbfdb --- /dev/null +++ b/assets/xml/interface/nes_font_static.xml @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/misc/scene_texture_01.xml b/assets/xml/misc/scene_texture_01.xml new file mode 100644 index 000000000..edbb2d1c4 --- /dev/null +++ b/assets/xml/misc/scene_texture_01.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/misc/scene_texture_02.xml b/assets/xml/misc/scene_texture_02.xml new file mode 100644 index 000000000..a7219c31e --- /dev/null +++ b/assets/xml/misc/scene_texture_02.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/assets/xml/misc/scene_texture_03.xml b/assets/xml/misc/scene_texture_03.xml new file mode 100644 index 000000000..fcd10b9a9 --- /dev/null +++ b/assets/xml/misc/scene_texture_03.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/xml/misc/scene_texture_04.xml b/assets/xml/misc/scene_texture_04.xml new file mode 100644 index 000000000..6faf681ac --- /dev/null +++ b/assets/xml/misc/scene_texture_04.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/assets/xml/misc/scene_texture_05.xml b/assets/xml/misc/scene_texture_05.xml new file mode 100644 index 000000000..d9ae4f2c3 --- /dev/null +++ b/assets/xml/misc/scene_texture_05.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/assets/xml/misc/scene_texture_06.xml b/assets/xml/misc/scene_texture_06.xml new file mode 100644 index 000000000..1a2dfc2a0 --- /dev/null +++ b/assets/xml/misc/scene_texture_06.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/misc/scene_texture_07.xml b/assets/xml/misc/scene_texture_07.xml new file mode 100644 index 000000000..22f445990 --- /dev/null +++ b/assets/xml/misc/scene_texture_07.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/xml/misc/scene_texture_08.xml b/assets/xml/misc/scene_texture_08.xml new file mode 100644 index 000000000..31e557347 --- /dev/null +++ b/assets/xml/misc/scene_texture_08.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/gameplay_dangeon_keep.xml b/assets/xml/objects/gameplay_dangeon_keep.xml index 8237f6380..70f9d606b 100644 --- a/assets/xml/objects/gameplay_dangeon_keep.xml +++ b/assets/xml/objects/gameplay_dangeon_keep.xml @@ -50,8 +50,8 @@ - - + + diff --git a/assets/xml/objects/gameplay_keep.xml b/assets/xml/objects/gameplay_keep.xml index 5e5b9b4f5..4ca6f2c4f 100644 --- a/assets/xml/objects/gameplay_keep.xml +++ b/assets/xml/objects/gameplay_keep.xml @@ -873,8 +873,11 @@ - - + + + + + @@ -898,7 +901,7 @@ - + @@ -996,7 +999,7 @@ - + @@ -1038,15 +1041,15 @@ - - - - - - - - - + + + + + + + + + @@ -1319,7 +1322,7 @@ - + @@ -1399,14 +1402,14 @@ - - - - - - - - + + + + + + + + diff --git a/assets/xml/objects/object_ani.xml b/assets/xml/objects/object_ani.xml index 85fd13cec..f9915c880 100644 --- a/assets/xml/objects/object_ani.xml +++ b/assets/xml/objects/object_ani.xml @@ -42,13 +42,14 @@ - - + + - + + diff --git a/assets/xml/objects/object_bg.xml b/assets/xml/objects/object_bg.xml index d623f9455..554047b44 100644 --- a/assets/xml/objects/object_bg.xml +++ b/assets/xml/objects/object_bg.xml @@ -74,7 +74,9 @@ - + + + diff --git a/assets/xml/objects/object_bigokuta.xml b/assets/xml/objects/object_bigokuta.xml index b6783c15d..653853c92 100644 --- a/assets/xml/objects/object_bigokuta.xml +++ b/assets/xml/objects/object_bigokuta.xml @@ -1,58 +1,58 @@  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_bji.xml b/assets/xml/objects/object_bji.xml index e8c7fe949..cd953541c 100644 --- a/assets/xml/objects/object_bji.xml +++ b/assets/xml/objects/object_bji.xml @@ -31,10 +31,11 @@ - + - + + diff --git a/assets/xml/objects/object_boj.xml b/assets/xml/objects/object_boj.xml index d948ff546..f0272cdc0 100644 --- a/assets/xml/objects/object_boj.xml +++ b/assets/xml/objects/object_boj.xml @@ -3,16 +3,16 @@ - - + + - - - + + + @@ -49,7 +49,7 @@ - + @@ -73,7 +73,7 @@ - + diff --git a/assets/xml/objects/object_boss02.xml b/assets/xml/objects/object_boss02.xml index f944de242..fee15d4a0 100644 --- a/assets/xml/objects/object_boss02.xml +++ b/assets/xml/objects/object_boss02.xml @@ -8,7 +8,7 @@ - + @@ -17,7 +17,7 @@ - + @@ -33,7 +33,7 @@ - + diff --git a/assets/xml/objects/object_boss03.xml b/assets/xml/objects/object_boss03.xml index 14d7d3498..5cf4ad2b8 100644 --- a/assets/xml/objects/object_boss03.xml +++ b/assets/xml/objects/object_boss03.xml @@ -1,93 +1,138 @@  + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_boss_hakugin.xml b/assets/xml/objects/object_boss_hakugin.xml index 05302db78..52a124fec 100644 --- a/assets/xml/objects/object_boss_hakugin.xml +++ b/assets/xml/objects/object_boss_hakugin.xml @@ -33,7 +33,7 @@ - + diff --git a/assets/xml/objects/object_cow.xml b/assets/xml/objects/object_cow.xml index b44057344..390c54b36 100644 --- a/assets/xml/objects/object_cow.xml +++ b/assets/xml/objects/object_cow.xml @@ -1,6 +1,6 @@  - + @@ -19,9 +19,9 @@ - - - + + + @@ -32,7 +32,7 @@ - - + + diff --git a/assets/xml/objects/object_ctower_rot.xml b/assets/xml/objects/object_ctower_rot.xml index 515b4fa65..3a04c474e 100644 --- a/assets/xml/objects/object_ctower_rot.xml +++ b/assets/xml/objects/object_ctower_rot.xml @@ -1,63 +1,100 @@  + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_dnk.xml b/assets/xml/objects/object_dnk.xml index 209742fe1..0d290f19d 100644 --- a/assets/xml/objects/object_dnk.xml +++ b/assets/xml/objects/object_dnk.xml @@ -9,7 +9,9 @@ - + + + diff --git a/assets/xml/objects/object_dnp.xml b/assets/xml/objects/object_dnp.xml index 0f5655e9b..575ae3d69 100644 --- a/assets/xml/objects/object_dnp.xml +++ b/assets/xml/objects/object_dnp.xml @@ -52,7 +52,10 @@ - + + + + diff --git a/assets/xml/objects/object_dns.xml b/assets/xml/objects/object_dns.xml index 64939670e..135dc6ab6 100644 --- a/assets/xml/objects/object_dns.xml +++ b/assets/xml/objects/object_dns.xml @@ -21,7 +21,9 @@ - + + + diff --git a/assets/xml/objects/object_dy_obj.xml b/assets/xml/objects/object_dy_obj.xml index dc2ab5ed4..7de69f2ff 100644 --- a/assets/xml/objects/object_dy_obj.xml +++ b/assets/xml/objects/object_dy_obj.xml @@ -15,6 +15,9 @@ + + + diff --git a/assets/xml/objects/object_f52_obj.xml b/assets/xml/objects/object_f52_obj.xml index 7f35d8b1b..f80b67696 100644 --- a/assets/xml/objects/object_f52_obj.xml +++ b/assets/xml/objects/object_f52_obj.xml @@ -1,11 +1,11 @@  - - - - - - + + + + + + diff --git a/assets/xml/objects/object_fall.xml b/assets/xml/objects/object_fall.xml index 5a90c5a24..47fa1da70 100644 --- a/assets/xml/objects/object_fall.xml +++ b/assets/xml/objects/object_fall.xml @@ -1,31 +1,56 @@  + - - - - - - - - - + + + + + + + + + \ + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_fall2.xml b/assets/xml/objects/object_fall2.xml index e616de260..4e58e9fd3 100644 --- a/assets/xml/objects/object_fall2.xml +++ b/assets/xml/objects/object_fall2.xml @@ -1,12 +1,16 @@  + - - - - - - - + + + + + + + diff --git a/assets/xml/objects/object_fr.xml b/assets/xml/objects/object_fr.xml index b1d284de9..cf65cc0ac 100644 --- a/assets/xml/objects/object_fr.xml +++ b/assets/xml/objects/object_fr.xml @@ -11,7 +11,8 @@ - + + diff --git a/assets/xml/objects/object_fsn.xml b/assets/xml/objects/object_fsn.xml index f2d4b3648..7c3d0beb2 100644 --- a/assets/xml/objects/object_fsn.xml +++ b/assets/xml/objects/object_fsn.xml @@ -31,13 +31,15 @@ - + - + + + @@ -53,7 +55,8 @@ - + + diff --git a/assets/xml/objects/object_fu.xml b/assets/xml/objects/object_fu.xml index 83d2f9eff..fe847642e 100644 --- a/assets/xml/objects/object_fu.xml +++ b/assets/xml/objects/object_fu.xml @@ -27,7 +27,10 @@ - + + + + diff --git a/assets/xml/objects/object_gmo.xml b/assets/xml/objects/object_gmo.xml index 266c70383..7490a661e 100644 --- a/assets/xml/objects/object_gmo.xml +++ b/assets/xml/objects/object_gmo.xml @@ -9,8 +9,8 @@ - - - + + + diff --git a/assets/xml/objects/object_hanareyama_obj.xml b/assets/xml/objects/object_hanareyama_obj.xml index ba213a585..62cf67540 100644 --- a/assets/xml/objects/object_hanareyama_obj.xml +++ b/assets/xml/objects/object_hanareyama_obj.xml @@ -1,7 +1,6 @@  - - + @@ -59,7 +58,12 @@ - + + + + + + diff --git a/assets/xml/objects/object_in.xml b/assets/xml/objects/object_in.xml index 07969fe80..42bace14f 100644 --- a/assets/xml/objects/object_in.xml +++ b/assets/xml/objects/object_in.xml @@ -6,8 +6,8 @@ - - + + @@ -17,9 +17,10 @@ - + - + + diff --git a/assets/xml/objects/object_in2.xml b/assets/xml/objects/object_in2.xml index 34a942882..a47c7613e 100644 --- a/assets/xml/objects/object_in2.xml +++ b/assets/xml/objects/object_in2.xml @@ -21,15 +21,15 @@ - + - + - + @@ -37,9 +37,9 @@ - + - + diff --git a/assets/xml/objects/object_jg.xml b/assets/xml/objects/object_jg.xml index 10253e155..03d7c3ce5 100644 --- a/assets/xml/objects/object_jg.xml +++ b/assets/xml/objects/object_jg.xml @@ -94,7 +94,7 @@ - - + + diff --git a/assets/xml/objects/object_knight.xml b/assets/xml/objects/object_knight.xml index bbd2d7b93..67d87a0ff 100644 --- a/assets/xml/objects/object_knight.xml +++ b/assets/xml/objects/object_knight.xml @@ -98,6 +98,9 @@ + + + diff --git a/assets/xml/objects/object_lightswitch.xml b/assets/xml/objects/object_lightswitch.xml index 3d5c3aee2..0a374033b 100644 --- a/assets/xml/objects/object_lightswitch.xml +++ b/assets/xml/objects/object_lightswitch.xml @@ -3,7 +3,9 @@ - + + + diff --git a/assets/xml/objects/object_lodmoon.xml b/assets/xml/objects/object_lodmoon.xml index 46d9f8e72..0756c3300 100644 --- a/assets/xml/objects/object_lodmoon.xml +++ b/assets/xml/objects/object_lodmoon.xml @@ -1,12 +1,13 @@  + - - - - - - - - + + + + + + + + diff --git a/assets/xml/objects/object_ma1.xml b/assets/xml/objects/object_ma1.xml index 98444a884..7001eb84a 100644 --- a/assets/xml/objects/object_ma1.xml +++ b/assets/xml/objects/object_ma1.xml @@ -1,13 +1,13 @@  - + - + - + @@ -54,7 +54,15 @@ - + + + + + + + + + diff --git a/assets/xml/objects/object_ma2.xml b/assets/xml/objects/object_ma2.xml index 523dfe212..a6554d387 100644 --- a/assets/xml/objects/object_ma2.xml +++ b/assets/xml/objects/object_ma2.xml @@ -6,7 +6,7 @@ - + @@ -48,7 +48,16 @@ - + + + + + + + + + + diff --git a/assets/xml/objects/object_mbar_obj.xml b/assets/xml/objects/object_mbar_obj.xml index d69d7ce3b..b1a816f47 100644 --- a/assets/xml/objects/object_mbar_obj.xml +++ b/assets/xml/objects/object_mbar_obj.xml @@ -5,6 +5,6 @@ - + diff --git a/assets/xml/objects/object_mm.xml b/assets/xml/objects/object_mm.xml index 3ce9c1925..43c0e9b19 100644 --- a/assets/xml/objects/object_mm.xml +++ b/assets/xml/objects/object_mm.xml @@ -12,7 +12,8 @@ - + + diff --git a/assets/xml/objects/object_moonston.xml b/assets/xml/objects/object_moonston.xml index cc06a9632..58a920522 100644 --- a/assets/xml/objects/object_moonston.xml +++ b/assets/xml/objects/object_moonston.xml @@ -1,9 +1,13 @@  + - - - - - + + + + + diff --git a/assets/xml/objects/object_niw.xml b/assets/xml/objects/object_niw.xml index f97b5d726..b055a2740 100644 --- a/assets/xml/objects/object_niw.xml +++ b/assets/xml/objects/object_niw.xml @@ -16,8 +16,8 @@ - - + + diff --git a/assets/xml/objects/object_obj_milk_bin.xml b/assets/xml/objects/object_obj_milk_bin.xml index 4a0ca700b..70daa6172 100644 --- a/assets/xml/objects/object_obj_milk_bin.xml +++ b/assets/xml/objects/object_obj_milk_bin.xml @@ -1,6 +1,6 @@  - + diff --git a/assets/xml/objects/object_obj_tokeidai.xml b/assets/xml/objects/object_obj_tokeidai.xml index 9141b67ff..09e070254 100644 --- a/assets/xml/objects/object_obj_tokeidai.xml +++ b/assets/xml/objects/object_obj_tokeidai.xml @@ -1,59 +1,81 @@  + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_owl.xml b/assets/xml/objects/object_owl.xml index b35f38b0f..381c0bfd0 100644 --- a/assets/xml/objects/object_owl.xml +++ b/assets/xml/objects/object_owl.xml @@ -29,7 +29,9 @@ - + + + diff --git a/assets/xml/objects/object_oyu.xml b/assets/xml/objects/object_oyu.xml index aa762ce59..78cc8b34d 100644 --- a/assets/xml/objects/object_oyu.xml +++ b/assets/xml/objects/object_oyu.xml @@ -4,6 +4,6 @@ - + diff --git a/assets/xml/objects/object_pamera.xml b/assets/xml/objects/object_pamera.xml index 901a7523b..6ce4c5219 100644 --- a/assets/xml/objects/object_pamera.xml +++ b/assets/xml/objects/object_pamera.xml @@ -26,7 +26,13 @@ - + + + + + + + @@ -55,17 +61,17 @@ - + - - + + - - + + - + diff --git a/assets/xml/objects/object_sek.xml b/assets/xml/objects/object_sek.xml index e37af4380..3529620aa 100644 --- a/assets/xml/objects/object_sek.xml +++ b/assets/xml/objects/object_sek.xml @@ -1,6 +1,6 @@  - + @@ -11,7 +11,7 @@ - + diff --git a/assets/xml/objects/object_shn.xml b/assets/xml/objects/object_shn.xml index 78cc77ca7..b322641a9 100644 --- a/assets/xml/objects/object_shn.xml +++ b/assets/xml/objects/object_shn.xml @@ -18,7 +18,9 @@ - + + + @@ -83,7 +85,8 @@ - + + diff --git a/assets/xml/objects/object_st.xml b/assets/xml/objects/object_st.xml index a7ce1418d..011d76449 100644 --- a/assets/xml/objects/object_st.xml +++ b/assets/xml/objects/object_st.xml @@ -22,8 +22,8 @@ - - + + diff --git a/assets/xml/objects/object_syokudai.xml b/assets/xml/objects/object_syokudai.xml index 83e4c34f3..01ab0ef90 100644 --- a/assets/xml/objects/object_syokudai.xml +++ b/assets/xml/objects/object_syokudai.xml @@ -1,8 +1,8 @@  - - - + + + diff --git a/assets/xml/objects/object_tite.xml b/assets/xml/objects/object_tite.xml index 2d57d1b47..eec5b05d0 100644 --- a/assets/xml/objects/object_tite.xml +++ b/assets/xml/objects/object_tite.xml @@ -8,10 +8,14 @@ - + + + - + + + diff --git a/assets/xml/objects/object_tk.xml b/assets/xml/objects/object_tk.xml index 506f9b00a..813b0fb24 100644 --- a/assets/xml/objects/object_tk.xml +++ b/assets/xml/objects/object_tk.xml @@ -12,7 +12,9 @@ - + + + diff --git a/assets/xml/objects/object_uch.xml b/assets/xml/objects/object_uch.xml index de16b0d7b..86f2a4646 100644 --- a/assets/xml/objects/object_uch.xml +++ b/assets/xml/objects/object_uch.xml @@ -3,7 +3,7 @@ - + diff --git a/assets/xml/objects/object_wf.xml b/assets/xml/objects/object_wf.xml index 98dd21ed5..56c9e1621 100644 --- a/assets/xml/objects/object_wf.xml +++ b/assets/xml/objects/object_wf.xml @@ -5,7 +5,7 @@ - + @@ -20,7 +20,8 @@ - + + @@ -67,13 +68,14 @@ - + - + + diff --git a/assets/xml/objects/object_zm.xml b/assets/xml/objects/object_zm.xml index c5511f6b2..022efcf27 100644 --- a/assets/xml/objects/object_zm.xml +++ b/assets/xml/objects/object_zm.xml @@ -28,7 +28,7 @@ - + @@ -36,7 +36,8 @@ - + + diff --git a/assets/xml/objects/object_zo.xml b/assets/xml/objects/object_zo.xml index 446202443..f0926dd2b 100644 --- a/assets/xml/objects/object_zo.xml +++ b/assets/xml/objects/object_zo.xml @@ -1,65 +1,67 @@  - - - - - + + + + + - + - + - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_zos.xml b/assets/xml/objects/object_zos.xml index 7a25eb338..5af477773 100644 --- a/assets/xml/objects/object_zos.xml +++ b/assets/xml/objects/object_zos.xml @@ -35,7 +35,10 @@ - + + + + diff --git a/assets/xml/overlays/ovl_En_Bom.xml b/assets/xml/overlays/ovl_En_Bom.xml new file mode 100644 index 000000000..08902add6 --- /dev/null +++ b/assets/xml/overlays/ovl_En_Bom.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/assets/xml/scenes/Z2_00KEIKOKU/Z2_00KEIKOKU.xml b/assets/xml/scenes/Z2_00KEIKOKU/Z2_00KEIKOKU.xml index 58d50ee83..3cf73a255 100644 --- a/assets/xml/scenes/Z2_00KEIKOKU/Z2_00KEIKOKU.xml +++ b/assets/xml/scenes/Z2_00KEIKOKU/Z2_00KEIKOKU.xml @@ -1,4 +1,5 @@ + diff --git a/assets/xml/scenes/Z2_10YUKIYAMANOMURA/Z2_10YUKIYAMANOMURA.xml b/assets/xml/scenes/Z2_10YUKIYAMANOMURA/Z2_10YUKIYAMANOMURA.xml index c48cb9646..9676cbc39 100644 --- a/assets/xml/scenes/Z2_10YUKIYAMANOMURA/Z2_10YUKIYAMANOMURA.xml +++ b/assets/xml/scenes/Z2_10YUKIYAMANOMURA/Z2_10YUKIYAMANOMURA.xml @@ -1,4 +1,5 @@ + diff --git a/assets/xml/scenes/Z2_10YUKIYAMANOMURA2/Z2_10YUKIYAMANOMURA2.xml b/assets/xml/scenes/Z2_10YUKIYAMANOMURA2/Z2_10YUKIYAMANOMURA2.xml index 565dcc06c..943e58e58 100644 --- a/assets/xml/scenes/Z2_10YUKIYAMANOMURA2/Z2_10YUKIYAMANOMURA2.xml +++ b/assets/xml/scenes/Z2_10YUKIYAMANOMURA2/Z2_10YUKIYAMANOMURA2.xml @@ -1,4 +1,5 @@ + diff --git a/assets/xml/scenes/Z2_11GORONNOSATO/Z2_11GORONNOSATO.xml b/assets/xml/scenes/Z2_11GORONNOSATO/Z2_11GORONNOSATO.xml index 2a948603b..986823c90 100644 --- a/assets/xml/scenes/Z2_11GORONNOSATO/Z2_11GORONNOSATO.xml +++ b/assets/xml/scenes/Z2_11GORONNOSATO/Z2_11GORONNOSATO.xml @@ -1,4 +1,5 @@ + diff --git a/assets/xml/scenes/Z2_11GORONNOSATO2/Z2_11GORONNOSATO2.xml b/assets/xml/scenes/Z2_11GORONNOSATO2/Z2_11GORONNOSATO2.xml index 40e82522f..9e6925131 100644 --- a/assets/xml/scenes/Z2_11GORONNOSATO2/Z2_11GORONNOSATO2.xml +++ b/assets/xml/scenes/Z2_11GORONNOSATO2/Z2_11GORONNOSATO2.xml @@ -1,4 +1,5 @@ + diff --git a/assets/xml/scenes/Z2_12HAKUGINMAE/Z2_12HAKUGINMAE.xml b/assets/xml/scenes/Z2_12HAKUGINMAE/Z2_12HAKUGINMAE.xml index ca23dfa17..740f6a15a 100644 --- a/assets/xml/scenes/Z2_12HAKUGINMAE/Z2_12HAKUGINMAE.xml +++ b/assets/xml/scenes/Z2_12HAKUGINMAE/Z2_12HAKUGINMAE.xml @@ -1,4 +1,5 @@ + diff --git a/assets/xml/scenes/Z2_14YUKIDAMANOMITI/Z2_14YUKIDAMANOMITI.xml b/assets/xml/scenes/Z2_14YUKIDAMANOMITI/Z2_14YUKIDAMANOMITI.xml index 2165e80f5..6c368004f 100644 --- a/assets/xml/scenes/Z2_14YUKIDAMANOMITI/Z2_14YUKIDAMANOMITI.xml +++ b/assets/xml/scenes/Z2_14YUKIDAMANOMITI/Z2_14YUKIDAMANOMITI.xml @@ -1,4 +1,5 @@ + diff --git a/assets/xml/scenes/Z2_17SETUGEN/Z2_17SETUGEN.xml b/assets/xml/scenes/Z2_17SETUGEN/Z2_17SETUGEN.xml index b5b9f6d77..ed6beb36e 100644 --- a/assets/xml/scenes/Z2_17SETUGEN/Z2_17SETUGEN.xml +++ b/assets/xml/scenes/Z2_17SETUGEN/Z2_17SETUGEN.xml @@ -1,4 +1,5 @@ + diff --git a/assets/xml/scenes/Z2_17SETUGEN2/Z2_17SETUGEN2.xml b/assets/xml/scenes/Z2_17SETUGEN2/Z2_17SETUGEN2.xml index 357c0b897..1ac9488d7 100644 --- a/assets/xml/scenes/Z2_17SETUGEN2/Z2_17SETUGEN2.xml +++ b/assets/xml/scenes/Z2_17SETUGEN2/Z2_17SETUGEN2.xml @@ -1,4 +1,5 @@ + diff --git a/assets/xml/scenes/Z2_20SICHITAI/Z2_20SICHITAI.xml b/assets/xml/scenes/Z2_20SICHITAI/Z2_20SICHITAI.xml index 73c697f16..d144c9e8e 100644 --- a/assets/xml/scenes/Z2_20SICHITAI/Z2_20SICHITAI.xml +++ b/assets/xml/scenes/Z2_20SICHITAI/Z2_20SICHITAI.xml @@ -1,4 +1,5 @@ + diff --git a/assets/xml/scenes/Z2_20SICHITAI2/Z2_20SICHITAI2.xml b/assets/xml/scenes/Z2_20SICHITAI2/Z2_20SICHITAI2.xml index fca3e6846..144914621 100644 --- a/assets/xml/scenes/Z2_20SICHITAI2/Z2_20SICHITAI2.xml +++ b/assets/xml/scenes/Z2_20SICHITAI2/Z2_20SICHITAI2.xml @@ -1,4 +1,5 @@ + diff --git a/assets/xml/scenes/Z2_22DEKUCITY/Z2_22DEKUCITY.xml b/assets/xml/scenes/Z2_22DEKUCITY/Z2_22DEKUCITY.xml index 1db584d58..77f382ecc 100644 --- a/assets/xml/scenes/Z2_22DEKUCITY/Z2_22DEKUCITY.xml +++ b/assets/xml/scenes/Z2_22DEKUCITY/Z2_22DEKUCITY.xml @@ -1,4 +1,5 @@ + diff --git a/assets/xml/scenes/Z2_24KEMONOMITI/Z2_24KEMONOMITI.xml b/assets/xml/scenes/Z2_24KEMONOMITI/Z2_24KEMONOMITI.xml index eb4b353db..f6c852dc9 100644 --- a/assets/xml/scenes/Z2_24KEMONOMITI/Z2_24KEMONOMITI.xml +++ b/assets/xml/scenes/Z2_24KEMONOMITI/Z2_24KEMONOMITI.xml @@ -1,4 +1,5 @@ + diff --git a/assets/xml/scenes/Z2_26SARUNOMORI/Z2_26SARUNOMORI.xml b/assets/xml/scenes/Z2_26SARUNOMORI/Z2_26SARUNOMORI.xml index 5055f4ff3..83e362742 100644 --- a/assets/xml/scenes/Z2_26SARUNOMORI/Z2_26SARUNOMORI.xml +++ b/assets/xml/scenes/Z2_26SARUNOMORI/Z2_26SARUNOMORI.xml @@ -1,4 +1,5 @@ + diff --git a/assets/xml/scenes/Z2_30GYOSON/Z2_30GYOSON.xml b/assets/xml/scenes/Z2_30GYOSON/Z2_30GYOSON.xml index eca539742..f24a37254 100644 --- a/assets/xml/scenes/Z2_30GYOSON/Z2_30GYOSON.xml +++ b/assets/xml/scenes/Z2_30GYOSON/Z2_30GYOSON.xml @@ -1,4 +1,5 @@ + diff --git a/assets/xml/scenes/Z2_31MISAKI/Z2_31MISAKI.xml b/assets/xml/scenes/Z2_31MISAKI/Z2_31MISAKI.xml index 918dc1ceb..afd35a817 100644 --- a/assets/xml/scenes/Z2_31MISAKI/Z2_31MISAKI.xml +++ b/assets/xml/scenes/Z2_31MISAKI/Z2_31MISAKI.xml @@ -1,4 +1,5 @@ + diff --git a/assets/xml/scenes/Z2_AYASHIISHOP/Z2_AYASHIISHOP.xml b/assets/xml/scenes/Z2_AYASHIISHOP/Z2_AYASHIISHOP.xml index c757263f3..3b03e8e5e 100644 --- a/assets/xml/scenes/Z2_AYASHIISHOP/Z2_AYASHIISHOP.xml +++ b/assets/xml/scenes/Z2_AYASHIISHOP/Z2_AYASHIISHOP.xml @@ -1,4 +1,5 @@ + diff --git a/assets/xml/scenes/Z2_DOUJOU/Z2_DOUJOU.xml b/assets/xml/scenes/Z2_DOUJOU/Z2_DOUJOU.xml index 00e6702fa..a6b7a1a6a 100644 --- a/assets/xml/scenes/Z2_DOUJOU/Z2_DOUJOU.xml +++ b/assets/xml/scenes/Z2_DOUJOU/Z2_DOUJOU.xml @@ -1,4 +1,5 @@ + diff --git a/assets/xml/scenes/Z2_KAJIYA/Z2_KAJIYA.xml b/assets/xml/scenes/Z2_KAJIYA/Z2_KAJIYA.xml index 6e73abc32..158669f8f 100644 --- a/assets/xml/scenes/Z2_KAJIYA/Z2_KAJIYA.xml +++ b/assets/xml/scenes/Z2_KAJIYA/Z2_KAJIYA.xml @@ -1,4 +1,5 @@ + diff --git a/assets/xml/scenes/Z2_ROMANYMAE/Z2_ROMANYMAE.xml b/assets/xml/scenes/Z2_ROMANYMAE/Z2_ROMANYMAE.xml index e49402a10..3ef612381 100644 --- a/assets/xml/scenes/Z2_ROMANYMAE/Z2_ROMANYMAE.xml +++ b/assets/xml/scenes/Z2_ROMANYMAE/Z2_ROMANYMAE.xml @@ -1,4 +1,5 @@ + diff --git a/assets/xml/scenes/Z2_SINKAI/Z2_SINKAI.xml b/assets/xml/scenes/Z2_SINKAI/Z2_SINKAI.xml index d2f362453..6a3df8b2e 100644 --- a/assets/xml/scenes/Z2_SINKAI/Z2_SINKAI.xml +++ b/assets/xml/scenes/Z2_SINKAI/Z2_SINKAI.xml @@ -1,4 +1,5 @@ + diff --git a/assets/xml/scenes/Z2_SONCHONOIE/Z2_SONCHONOIE.xml b/assets/xml/scenes/Z2_SONCHONOIE/Z2_SONCHONOIE.xml index 36168378b..72f476631 100644 --- a/assets/xml/scenes/Z2_SONCHONOIE/Z2_SONCHONOIE.xml +++ b/assets/xml/scenes/Z2_SONCHONOIE/Z2_SONCHONOIE.xml @@ -1,4 +1,5 @@ + diff --git a/assets/xml/scenes/Z2_TORIDE/Z2_TORIDE.xml b/assets/xml/scenes/Z2_TORIDE/Z2_TORIDE.xml index c8e4a16c2..4003e785d 100644 --- a/assets/xml/scenes/Z2_TORIDE/Z2_TORIDE.xml +++ b/assets/xml/scenes/Z2_TORIDE/Z2_TORIDE.xml @@ -1,4 +1,5 @@ + diff --git a/assets/xml/scenes/Z2_YADOYA/Z2_YADOYA.xml b/assets/xml/scenes/Z2_YADOYA/Z2_YADOYA.xml index 9a2ad7080..03801385c 100644 --- a/assets/xml/scenes/Z2_YADOYA/Z2_YADOYA.xml +++ b/assets/xml/scenes/Z2_YADOYA/Z2_YADOYA.xml @@ -1,4 +1,5 @@ + diff --git a/include/functions.h b/include/functions.h index 1c536b90d..ecbb95387 100644 --- a/include/functions.h +++ b/include/functions.h @@ -559,7 +559,7 @@ void EffectSsBlast_SpawnWhiteCustomScale(GlobalContext* globalCtx, Vec3f* pos, V void EffectSsBlast_SpawnWhiteShockwave(GlobalContext* globalCtx, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3); // void EffectSsGSpk_SpawnAccel(UNK_TYPE4 uParm1, UNK_TYPE4 uParm2, Vec3f* pzParm3, Vec3f* pzParm4, Vec3f* param_5, Color_RGBA8* param_6, Color_RGBA8* param_7, UNK_TYPE2 param_8, UNK_TYPE2 param_9); // void EffectSsGSpk_SpawnNoAccel(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7, UNK_TYPE2 param_8, UNK_TYPE2 param_9); -// void EffectSsGSpk_SpawnFuse(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5); +void EffectSsGSpk_SpawnFuse(GlobalContext* globalCtx, Actor* actor, Vec3f* pos, Vec3f* velocity, Vec3f* accel); // void EffectSsGSpk_SpawnRandColor(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE2 param_6, UNK_TYPE2 param_7); // void EffectSsGSpk_SpawnSmall(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7); void EffectSsDFire_Spawn(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep, s16 alpha, s16 fadeDelay, s16 life, s32 arg9); @@ -944,7 +944,7 @@ u32 SurfaceType_GetEcho(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId) u32 SurfaceType_IsHookshotSurface(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); s32 SurfaceType_IsIgnoredByEntities(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); s32 SurfaceType_IsIgnoredByProjectiles(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); -s32 SurfaceType_IsConveyor(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); +s32 SurfaceType_GetConveyorType(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); s32 func_800C9DDC(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); u32 SurfaceType_GetConveyorSpeed(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); u32 SurfaceType_GetConveyorDirection(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); @@ -1147,7 +1147,7 @@ s32 func_800DFC68(Camera* camera); // void func_800DFC90(void); s16 func_800DFCB4(Camera* camera); s16 func_800DFCDC(Camera* camera); -// void func_800DFD04(void); +void func_800DFD04(Camera* camera, s32 arg1, s32 arg2, s32 arg3); // void func_800DFD78(void); // UNK_TYPE4 func_800DFEF0(s32 param_1, u16 param_2); // UNK_TYPE4 func_800DFF18(Camera* iParm1, UNK_TYPE2 uParm2); @@ -2061,8 +2061,8 @@ void func_80123DA4(Player* player); // void func_80123DC0(void); void func_80123E90(GlobalContext* globalCtx, Actor* actor); void func_80123F2C(GlobalContext* globalCtx, s32 arg1); -// void func_80123F48(void); -// void func_80124020(void); +s32 func_80123F48(GlobalContext* globalCtx, Vec3f* arg1, f32 arg2, f32 arg3); +s32 func_80124020(void); u8 Player_GetMask(GlobalContext* globalCtx); void Player_RemoveMask(GlobalContext* globalCtx); s32 func_8012405C(GlobalContext* globalCtx); @@ -2150,14 +2150,14 @@ void Quake_Init(void); s16 Quake_Add(Camera* camera, u32 callbackIdx); u32 Quake_RemoveFromIdx(s16 idx); s16 Quake_Calc(Camera* camera, QuakeCamCalc* camData); -void Quake2_Init(GlobalContext* globalCtx); -void Quake2_SetCountdown(s16 countdown); -s16 Quake2_GetCountdown(void); -s16 Quake2_GetType(void); -void Quake2_SetType(s32 type); -void Quake2_ClearType(s32 type); -s32 Quake2_GetFloorQuake(Player* player); -void Quake2_Update(void); +void Distortion_Init(GlobalContext* globalCtx); +void Distortion_SetCountdown(s16 countdown); +s16 Distortion_GetCountdown(void); +s16 Distortion_GetType(void); +void Distortion_SetType(s32 type); +void Distortion_ClearType(s32 type); +s32 Distortion_GetUnderwaterCurrentSpeed(Player* player); +void Distortion_Update(void); s32 Quake_NumActiveQuakes(void); Gfx* Gfx_SetFog(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 n, s32 f); Gfx* Gfx_SetFogWithSync(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 n, s32 f); @@ -2581,13 +2581,13 @@ void View_GetViewport(View* view, Viewport* viewport); void View_WriteScissor(Gfx** gfx, s32 ulx, s32 uly, s32 lrx, s32 lry); void View_SyncAndWriteScissor(View* view, Gfx** gfx); void View_SetScissorForLetterbox(View* view); -s32 View_SetQuakeRotation(View* view, f32 x, f32 y, f32 z); -s32 View_SetQuakeScale(View* view, f32 x, f32 y, f32 z); -s32 View_SetQuakeSpeed(View* view, f32 speed); -s32 View_InitCameraQuake(View* view); -s32 View_ClearQuake(View* view); -s32 View_SetQuake(View* view, Vec3f rot, Vec3f scale, f32 speed); -s32 View_StepQuake(View* view, Mtx* matrix); +s32 View_SetDistortionDirRot(View* view, f32 dirRotX, f32 dirRotY, f32 dirRotZ); +s32 View_SetDistortionScale(View* view, f32 scaleX, f32 scaleY, f32 scaleZ); +s32 View_SetDistortionSpeed(View* view, f32 speed); +s32 View_InitDistortion(View* view); +s32 View_ClearDistortion(View* view); +s32 View_SetDistortion(View* view, Vec3f dirRot, Vec3f scale, f32 speed); +s32 View_StepDistortion(View* view, Mtx* projectionMtx); void View_RenderView(View* view, s32 uParm2); s32 View_RenderToPerspectiveMatrix(View* view); s32 View_RenderToOrthographicMatrix(View* view); @@ -3375,7 +3375,7 @@ s32 osFlashReadArray(OSIoMesg* mb, s32 priority, u32 pageNum, void* dramAddr, u3 // void func_8018B4F8(void); // void func_8018B520(void); // void func_8018B578(void); -// void func_8018B5D0(void); +void* AudioHeap_AllocDmaMemory(AudioAllocPool* pool, u32 size); // void func_8018B608(void); // void func_8018B640(void); // void func_8018B69C(void); @@ -3421,7 +3421,7 @@ s32 osFlashReadArray(OSIoMesg* mb, s32 priority, u32 pageNum, void* dramAddr, u3 // void func_8018EB60(void); // void func_8018EC4C(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5); // void func_8018EF88(void); -// void func_8018F220(void); +s32 AudioLoad_IsFontLoadComplete(s32 bankId); // void func_8018F298(void); // void func_8018F310(void); // void func_8018F388(void); @@ -3531,37 +3531,23 @@ void Audio_WritebackDCache(void* buf, size_t size); // void func_80194790(void); // void func_80194840(void); // void func_801948B0(void); -// void func_80194930(void); -// void func_80194DB0(void); -// void func_80194E60(void); -// void func_80194F20(void); -// void func_80194F84(void); -// void func_801954CC(void); -// void func_80195508(void); -// void func_801955DC(void); -// void func_801956C0(void); -// void func_801957B4(void); -// void func_801958F8(void); -// void func_80195C40(void); -// void func_80195C60(void); -// void func_80195C80(void); -// void func_80195D84(void); -// void func_80195DDC(void); -// void func_80195DEC(void); -// void func_80195E3C(void); -// void func_80195EE0(void); -// void func_80196040(void); -// void func_8019617C(void); -// void func_801961BC(void); -// void func_801961E8(void); -// void func_80196268(void); -// void func_801963E8(void); -// void func_8019641C(void); -// void func_80196448(void); -// void func_80196494(void); -// void func_801964F8(void); -// void func_801965F0(void); -// void func_801968C4(void); +void AudioPlayback_NoteDisable(Note* note); +void AudioPlayback_ProcessNotes(void); +SoundFontSound* AudioPlayback_InstrumentGetSound(Instrument* instrument, s32 semitone); +Instrument* AudioPlayback_GetInstrumentInner(s32 fontId, s32 instId); +Drum* AudioPlayback_GetDrum(s32 fontId, s32 drumId); +SoundFontSound* AudioPlayback_GetSfx(s32 fontId, s32 sfxId); +s32 AudioPlayback_SetFontInstrument(s32 instrumentType, s32 fontId, s32 index, void* value); +void AudioPlayback_SeqLayerNoteDecay(SequenceLayer* layer); +void AudioPlayback_SeqLayerNoteRelease(SequenceLayer* layer); +void AudioPlayback_InitSyntheticWave(Note* note, SequenceLayer* layer); +void AudioPlayback_InitNoteLists(NotePool* pool); +void AudioPlayback_InitNoteFreeList(void); +void AudioPlayback_NotePoolClear(NotePool* pool); +void AudioPlayback_NotePoolFill(NotePool* pool, s32 count); +void AudioPlayback_AudioListRemove(AudioListItem* item); +Note* AudioPlayback_AllocNote(SequenceLayer* layer); +void AudioPlayback_NoteInitAll(void); void AudioEffects_SequencePlayerProcessSound(SequencePlayer* seqPlayer); void AudioEffects_NoteVibratoUpdate(Note* note); void AudioEffects_NoteVibratoInit(Note* note); @@ -3574,14 +3560,14 @@ f32 AudioEffects_AdsrUpdate(AdsrState* adsr); // void func_80197880(void); // void func_801979D8(void); // void func_80197A54(void); -// void func_80197AA4(void); +void AudioSeq_SequenceChannelDisable(SequenceChannel* channel); // void func_80197B14(void); // void func_80197C0C(void); // void func_80197C8C(void); // void func_80197D24(void); void AudioSeq_SequencePlayerDisable(SequencePlayer* seqPlayer); -// void func_80197E08(void); -// void func_80197E48(void); +void AudioSeq_AudioListPushBack(AudioListItem* list, AudioListItem* item); +void* AudioSeq_AudioListPopBack(AudioListItem* list); // void func_80197E88(void); // void func_80197F28(void); // void func_80197F3C(void); @@ -3706,7 +3692,7 @@ void func_801A0204(s8 seqId); // void func_801A0554(void); // void func_801A05F0(void); void func_801A0654(Vec3f* arg0, u16 sfxId, s32 arg2); -void func_801A0810(s32* arg0, u16 sfxId, u8 arg2); +void func_801A0810(Vec3f* arg0, u16 sfxId, u8 arg2); // void func_801A0868(void); // void func_801A09D4(void); // void func_801A0CB0(void); diff --git a/include/variables.h b/include/variables.h index 01744bc45..a0acd9325 100644 --- a/include/variables.h +++ b/include/variables.h @@ -79,7 +79,7 @@ extern float D_80097F90; // extern UNK_TYPE1 D_80097FA0; // extern UNK_TYPE1 D_80097FA4; // extern UNK_TYPE1 D_80097FA5; -// extern UNK_TYPE4 D_80097FB0; +extern s32 __osPfsLastChannel; extern OSViMode osViModeNtscLan1; extern OSViMode osViModeMpalLan1; // extern __OSViContext D_80098060[2]; @@ -358,8 +358,7 @@ extern OSMesgQueue viEventQueue; extern u16 viRetrace; extern DmaEntry dmadata[1568]; // extern UNK_TYPE1 D_80186028; -// extern UNK_TYPE1 D_801AAAB0; -extern u64 gJpegUCode[]; +extern u64 aspMainTextStart[]; extern ActorInit En_A_Obj_InitVars; extern ColliderCylinderInit enAObjCylinderInit; extern InitChainEntry enAObjInitVar; @@ -1653,16 +1652,14 @@ extern f32 gBendPitchOneOctaveFrequencies[256]; // extern UNK_TYPE1 D_801D57B4; // extern UNK_TYPE1 D_801D57C4; // extern UNK_TYPE1 D_801D57D4; -// extern UNK_TYPE4 D_801D57E4; -// extern UNK_TYPE4 D_801D5804; -// extern UNK_TYPE2 D_801D5824; -// extern UNK_TYPE2 D_801D58A2; -// extern UNK_TYPE1 D_801D58AA; -// extern UNK_TYPE1 D_801D5928; -// extern UNK_TYPE1 D_801D5B24; -// extern UNK_TYPE1 D_801D5B28; -// extern UNK_TYPE1 D_801D5D24; -// extern UNK_TYPE1 D_801D5D28; +extern NoteSubEu gZeroNoteSub; +extern NoteSubEu gDefaultNoteSub; +extern u16 gHeadsetPanQuantization[]; +extern u16 gHeadsetPanQuantization[]; +extern s16 D_801D58A8[]; +extern f32 gHeadsetPanVolume[]; +extern f32 gStereoPanVolume[]; +extern f32 gDefaultPanVolume[]; // extern UNK_TYPE1 D_801D5F24; // extern UNK_TYPE4 D_801D5FB4; // extern UNK_TYPE4 D_801D5FB8; @@ -1827,7 +1824,7 @@ extern UNK_PTR D_801DB478[7]; // extern UNK_TYPE1 D_801DB494; // extern UNK_TYPE1 D_801DB49C; // extern UNK_TYPE2 D_801DB4A0; -extern UNK_TYPE D_801DB4A4; +extern Vec3f D_801DB4A4; extern f32 D_801DB4B0; extern s8 D_801DB4B8; // extern UNK_TYPE1 D_801DB4C0; @@ -3085,15 +3082,11 @@ extern const s16 gAudioTatumInit[]; extern const AudioContextInitSizes gAudioContextInitSizes; // extern UNK_TYPE4 D_801E1108; // extern UNK_TYPE4 D_801E110C; -// extern UNK_TYPE2 D_801E1180; -// extern UNK_TYPE1 D_801E1420; -// extern UNK_TYPE2 D_801E1630; -// extern UNK_TYPE1 D_801E1E40; -// extern UNK_TYPE1 D_801E1E80; -extern u64 gspF3DEX2_NoN_fifoTextStart[]; -extern u64 gspF3DEX2_NoN_fifoDataStart[]; -extern u64 gJpegUCodeData[]; -// extern UNK_TYPE1 D_801E3FA0; +// extern UNK_TYPE2 gSoundFontTable; +// extern UNK_TYPE1 gSequenceFontTable; +// extern UNK_TYPE2 gSequenceTable; +// extern UNK_TYPE1 gSampleBankTable; +extern u64 aspMainDataStart[]; // bss // extern UNK_TYPE1 D_801ED890; @@ -3220,20 +3213,16 @@ extern u8 actorCutsceneNextCutscenes[16]; // extern UNK_TYPE1 D_801F4E20; extern u8 D_801F4E30; // extern UNK_TYPE1 D_801F4E31; -// extern UNK_TYPE1 D_801F4E32; -// extern UNK_TYPE1 D_801F4E38; -// extern UNK_TYPE1 D_801F4E3C; -// extern UNK_TYPE1 D_801F4E40; -// extern UNK_TYPE1 D_801F4E44; -// extern UNK_TYPE1 D_801F4E48; -// extern UNK_TYPE1 D_801F4E4C; -// extern UNK_TYPE1 D_801F4E4E; -// extern UNK_TYPE1 D_801F4E50; -// extern UNK_TYPE1 D_801F4E54; -// extern UNK_TYPE1 D_801F4E58; -// extern UNK_TYPE1 D_801F4E5C; -// extern UNK_TYPE1 D_801F4E60; -// extern UNK_TYPE1 D_801F4E64; +extern s8 D_801F4E32; +extern Vec3f D_801F4E38; +extern f32 D_801F4E44; +extern f32 D_801F4E48; +extern s16 D_801F4E4C; +extern s8 D_801F4E4E; +extern Vec3f D_801F4E50; +extern f32 D_801F4E5C; +extern f32 D_801F4E60; +extern s16 D_801F4E64; // extern UNK_TYPE1 D_801F4E68; extern f32 D_801F4E70; // extern UNK_TYPE1 D_801F4E74; @@ -3640,244 +3629,6 @@ extern u8 D_80780000[0x4600]; extern u8 D_80784600[0x56200]; extern u16 gFramebuffer0[SCREEN_HEIGHT][SCREEN_WIDTH]; -// keep objects - -extern Gfx D_040008D0[]; -extern Gfx D_040032B0[]; -extern UNK_TYPE D_0400CF58; -extern UNK_TYPE D_0400CF88; -extern UNK_TYPE D_0400CF98; -extern UNK_TYPE D_0400D0A8; -extern UNK_TYPE D_0400D0B0; -extern UNK_TYPE D_0400D0C8; -extern UNK_TYPE D_0400D100; -extern UNK_TYPE D_0400D218; -extern UNK_TYPE D_0400D220; -extern UNK_TYPE D_0400D228; -extern UNK_TYPE D_0400D2D0; -extern UNK_TYPE D_0400D3E8; -extern UNK_TYPE D_0400D3F8; -extern UNK_TYPE D_0400D488; -extern UNK_TYPE D_0400D490; -extern UNK_TYPE D_0400D500; -extern UNK_TYPE D_0400D520; -extern UNK_TYPE D_0400D568; -extern UNK_TYPE D_0400D638; -extern UNK_TYPE D_0400D660; -extern UNK_TYPE D_0400D698; -extern UNK_TYPE D_0400D728; -extern UNK_TYPE D_0400D9C8; -extern UNK_TYPE D_0400D9D0; -extern UNK_TYPE D_0400DA70; -extern UNK_TYPE D_0400DA88; -extern UNK_TYPE D_0400DAA8; -extern UNK_TYPE D_0400DAC0; -extern UNK_TYPE D_0400DAC8; -extern UNK_TYPE D_0400DAD8; -extern UNK_TYPE D_0400DAE0; -extern UNK_TYPE D_0400DAF0; -extern UNK_TYPE D_0400DB10; -extern UNK_TYPE D_0400DB18; -extern UNK_TYPE D_0400DB30; -extern UNK_TYPE D_0400DBB0; -extern UNK_TYPE D_0400DBE8; -extern UNK_TYPE D_0400DC48; -extern UNK_TYPE D_0400DC50; -extern UNK_TYPE D_0400DCA8; -extern UNK_TYPE D_0400DCD0; -extern UNK_TYPE D_0400DCD8; -extern UNK_TYPE D_0400DCF8; -extern UNK_TYPE D_0400DD30; -extern UNK_TYPE D_0400DD38; -extern UNK_TYPE D_0400DD40; -extern UNK_TYPE D_0400DD50; -extern UNK_TYPE D_0400DD58; -extern UNK_TYPE D_0400DD80; -extern UNK_TYPE D_0400DDB0; -extern UNK_TYPE D_0400DDF8; -extern UNK_TYPE D_0400DE00; -extern UNK_TYPE D_0400DE08; -extern UNK_TYPE D_0400DE10; -extern UNK_TYPE D_0400DE28; -extern UNK_TYPE D_0400DE30; -extern UNK_TYPE D_0400DE58; -extern UNK_TYPE D_0400DE60; -extern UNK_TYPE D_0400DEA0; -extern UNK_TYPE D_0400DEA8; -extern UNK_TYPE D_0400DF78; -extern UNK_TYPE D_0400DF90; -extern UNK_TYPE D_0400DFA0; -extern UNK_TYPE D_0400DFD0; -extern UNK_TYPE D_0400DFE0; -extern UNK_TYPE D_0400DFE8; -extern UNK_TYPE D_0400DFF8; -extern UNK_TYPE D_0400E000; -extern UNK_TYPE D_0400E070; -extern UNK_TYPE D_0400E088; -extern UNK_TYPE D_0400E120; -extern UNK_TYPE D_0400E150; -extern UNK_TYPE D_0400E1F0; -extern UNK_TYPE D_0400E200; -extern UNK_TYPE D_0400E208; -extern UNK_TYPE D_0400E270; -extern UNK_TYPE D_0400E290; -extern UNK_TYPE D_0400E2A8; -extern UNK_TYPE D_0400E2B8; -extern UNK_TYPE D_0400E2C0; -extern UNK_TYPE D_0400E2D0; -extern UNK_TYPE D_0400E2D8; -extern UNK_TYPE D_0400E2E8; -extern UNK_TYPE D_0400E318; -extern UNK_TYPE D_0400E398; -extern UNK_TYPE D_0400E3A0; -extern UNK_TYPE D_0400E3A8; -extern UNK_TYPE D_0400E3C0; -extern UNK_TYPE D_0400E3D8; -extern UNK_TYPE D_0400E408; -extern UNK_TYPE D_0400E410; -extern UNK_TYPE D_0400E418; -extern UNK_TYPE D_04012860; -extern UNK_TYPE D_040128BC; -extern u64 D_04014570[]; -extern UNK_TYPE D_04015FA0; -extern UNK_TYPE D_04016360; -extern UNK_TYPE D_0401A4D0; -extern UNK_TYPE D_0401A538; -extern Gfx D_0401A620[]; -extern Gfx D_0401C430[]; -extern UNK_TYPE D_0401F740; -extern UNK_TYPE D_0401F7C0; -extern UNK_TYPE D_0401F8C0; -extern UNK_TYPE D_0401FA40; -extern UNK_TYPE D_04020BB8; -extern UNK_TYPE D_040221B8; -extern UNK_TYPE D_04023100; -extern UNK_TYPE D_04023130; -extern Gfx D_04023210[]; -extern UNK_TYPE D_04023288; -extern Gfx D_04023348[]; -extern Gfx D_04023428[]; -extern UNK_TYPE D_04025DD0; -extern UNK_TYPE D_040281DC; -extern UNK_TYPE D_04028FEC; -extern AnimationHeader D_04029140; -extern Gfx D_04029CB0[]; -extern Gfx D_04029CF0[]; -extern UNK_TYPE D_04029D20; -extern Gfx D_0402E510[]; -extern AnimationHeader D_0402E65C; -extern AnimationHeader D_0402F0EC; -extern Gfx D_04030100[]; // Floor shockwave ring -extern Gfx D_040301B0[]; -extern UNK_TYPE D_04032270; -extern UNK_TYPE D_04035710; -extern UNK_TYPE D_040367B0; -extern UNK_TYPE D_040377B0; -extern UNK_TYPE D_04037850; -extern Gfx D_040378F0[]; // gExplosionSplashTex1 -extern Gfx D_04037DF0[]; // gExplosionSplashTex2 -extern Gfx D_040382F0[]; // gExplosionSplashTex3 -extern Gfx D_040387F0[]; // gExplosionSplashTex4 -extern Gfx D_04038CF0[]; // gExplosionSplashTex5 -extern Gfx D_040391F0[]; // gExplosionSplashTex6 -extern Gfx D_040396F0[]; // gExplosionSplashTex7 -extern Gfx D_04039BF0[]; // gExplosionSplashTex8 -extern Gfx D_0403A0F0[]; // gExplosionSplashDL -extern UNK_TYPE D_0403C190; -extern UNK_TYPE D_0403F230; -extern UNK_TYPE D_04044300; -extern Gfx D_04048DF0[]; -extern UNK_TYPE D_04050D10; -extern Gfx D_04051180[]; -extern Gfx D_04051238[]; -extern AnimationHeader D_0405140C; -extern Gfx D_040527F0[]; -extern Gfx D_040528B0[]; -extern Gfx D_04054A90[]; -extern u64 D_04054F20[]; -extern UNK_TYPE D_04055628; -extern Gfx D_04057B10[]; -extern Gfx D_04058BA0[]; -extern Gfx D_04089070[]; -extern TexturePtr D_0408DBE0[]; // gDust1Tex -extern TexturePtr D_0408DFE0[]; // gDust2Tex -extern TexturePtr D_0408E3E0[]; // gDust3Tex -extern TexturePtr D_0408E7E0[]; // gDust4Tex -extern TexturePtr D_0408EBE0[]; // gDust5Tex -extern TexturePtr D_0408EFE0[]; // gDust6Tex -extern TexturePtr D_0408F3E0[]; // gDust7Tex -extern TexturePtr D_0408F7E0[]; // gDust8Tex -extern UNK_TYPE D_04050550; -extern Gfx D_04050648[]; -extern Gfx D_040506E0[]; -extern UNK_TYPE D_040510B0; -extern UNK_TYPE D_04054940; -extern Gfx D_0405AAB0[]; -extern UNK_TYPE D_0405B6F0; -extern UNK_TYPE D_0405BEF0; -extern UNK_TYPE D_0405C6F0; -extern UNK_TYPE D_0405CEF0; -extern UNK_TYPE D_0405E6F0; -extern Gfx D_0405F6F0[]; -extern UNK_TYPE D_0405F7C0; -extern UNK_TYPE D_0405FFC0; -extern UNK_TYPE D_040607C0; -extern UNK_TYPE D_04060FC0; -extern UNK_TYPE D_040617C0; -extern UNK_TYPE D_04061FC0; -extern UNK_TYPE D_04061FE0; -extern UNK_TYPE D_04062000; -extern UNK_TYPE D_04062020; -extern UNK_TYPE D_04062040; -extern UNK_TYPE D_04062060; -extern Gfx D_040622C0[]; -extern Gfx D_0406AB30[]; -extern UNK_TYPE D_0406B730; -extern UNK_TYPE D_0406BB0C; -extern UNK_TYPE D_0406F380; -extern Gfx D_040706E0[]; -extern UNK_TYPE D_04073F00; -extern UNK_TYPE D_04075400; -extern Gfx D_04076BC0[]; -extern UNK_TYPE D_04079B10; -extern Gfx D_0407AB10[]; // sun (sparkles when small) displaylist -extern Gfx D_0407AB58[]; -extern UNK_TYPE D_0407AFB0; -extern UNK_TYPE D_0407D650; -extern UNK_TYPE D_0407F218; -extern UNK_TYPE D_040815D0; -extern UNK_TYPE D_04081628; -extern UNK_TYPE D_04083534; -extern UNK_TYPE D_04091BE0; -extern UNK_TYPE D_04091CE0; -extern TexturePtr D_04091DE0[]; -extern TexturePtr D_04091FE0[]; -extern TexturePtr D_040921E0[]; -extern TexturePtr D_040923E0[]; - -extern Gfx D_05000C40[]; -extern UNK_TYPE D_05001D20; -extern Gfx D_050061E8[]; -extern Gfx D_05006420[]; -extern Gfx D_050066B0[]; -extern UNK_TYPE D_05007498; -extern Gfx D_05007890[]; -extern Gfx D_050078A0[]; -extern Gfx D_05007938[]; -extern Gfx D_05007980[]; -extern UNK_TYPE D_05007E00; -extern UNK_TYPE D_05008018; -extern UNK_TYPE D_050085F0; -extern Gfx D_05017EA0[]; // pot displaylist -extern Gfx D_05018090[]; // pot break shard displaylist -extern UNK_TYPE D_050182A8; -extern UNK_TYPE D_0501B508; -extern UNK_TYPE D_0501C058; -extern Gfx D_0501D980[]; -extern Gfx D_050219E0[]; -extern UNK_TYPE D_05023008; -extern UNK_TYPE D_0502324C; - // other segments extern GfxMasterList D_0E000000; extern Mtx D_01000000; diff --git a/include/z64.h b/include/z64.h index 6893be8bb..48b19347f 100644 --- a/include/z64.h +++ b/include/z64.h @@ -494,13 +494,12 @@ typedef struct { /* 0x0E0 */ Mtx unkE0; /* 0x120 */ Mtx* projectionPtr; /* 0x124 */ Mtx* viewingPtr; - /* 0x128 */ Vec3f quakeRot; - /* 0x134 */ Vec3f quakeScale; - /* 0x140 */ f32 quakeSpeed; - /* 0x144 */ Vec3f currQuakeRot; - /* 0x150 */ Vec3f currQuakeScale; + /* 0x128 */ Vec3f distortionDirRot; + /* 0x134 */ Vec3f distortionScale; + /* 0x140 */ f32 distortionSpeed; + /* 0x144 */ Vec3f curDistortionDirRot; + /* 0x150 */ Vec3f curDistortionScale; /* 0x15C */ u16 normal; - /* 0x15E */ UNK_TYPE1 pad15E[0x2]; /* 0x160 */ u32 flags; // bit 3: Render to an orthographic perspective /* 0x164 */ UNK_TYPE4 unk164; } View; // size = 0x168 @@ -1172,13 +1171,13 @@ typedef struct { /* 0x4 */ s32 type; // bitfield, highest set bit determines type /* 0x8 */ s16 countdown; /* 0xA */ s16 state; -} Quake2Context; // size = 0xC +} DistortionContext; // size = 0xC typedef enum { - QUAKE2_INACTIVE, - QUAKE2_ACTIVE, - QUAKE2_SETUP, -} Quake2State; + /* 0 */ DISTORTION_INACTIVE, + /* 1 */ DISTORTION_ACTIVE, + /* 2 */ DISTORTION_SETUP, +} DistortionState; typedef struct { /* 0x000 */ u8 controllers; // bit 0 is set if controller 1 is plugged in, etc. @@ -1358,7 +1357,7 @@ struct GlobalContext { /* 0x187B0 */ MtxF viewProjectionMtxF; /* 0x187F0 */ Vec3f unk_187F0; /* 0x187FC */ MtxF billboardMtxF; - /* 0x1883C */ Mtx* unk_1883C; + /* 0x1883C */ Mtx* billboardMtx; /* 0x18840 */ u32 gameplayFrames; /* 0x18844 */ u8 unk_18844; /* 0x18845 */ u8 unk_18845; diff --git a/include/z64actor.h b/include/z64actor.h index 5fa771e49..8c6992f49 100644 --- a/include/z64actor.h +++ b/include/z64actor.h @@ -1168,6 +1168,8 @@ typedef enum { #define ACTOR_FLAG_20000000 (1 << 29) // #define ACTOR_FLAG_40000000 (1 << 30) +// +#define ACTOR_FLAG_80000000 (1 << 31) typedef enum { /* 0x00 */ CLEAR_TAG_SMALL_EXPLOSION, diff --git a/include/z64audio.h b/include/z64audio.h index 06f70b81b..9baa9911e 100644 --- a/include/z64audio.h +++ b/include/z64audio.h @@ -20,6 +20,14 @@ #define AIBUF_LEN 0x580 +typedef enum { + /* 0 */ AUDIO_MODE_STEREO, + /* 1 */ AUDIO_MODE_HEADSET, + /* 2 */ AUDIO_MODE_UNK, + /* 3 */ AUDIO_MODE_MONO, + /* 4 */ AUDIO_MODE_SURROUND, +} AudioSoundMode; + typedef enum { /* 0 */ ADSR_STATE_DISABLED, /* 1 */ ADSR_STATE_INITIAL, diff --git a/include/z64bgcheck.h b/include/z64bgcheck.h index 6ca0b66d5..55429a433 100644 --- a/include/z64bgcheck.h +++ b/include/z64bgcheck.h @@ -56,6 +56,11 @@ struct DynaPolyActor; // CollisionContext flags #define BGCHECK_FLAG_REVERSE_CONVEYOR_FLOW 1 +typedef enum { + /* 0 */ CONVEYOR_WATER, + /* 1 */ CONVEYOR_FLOOR +} ConveyorType; + typedef struct { /* 0x0 */ Vec3s pos; } BgVertex; // size = 0x6 diff --git a/include/z64object.h b/include/z64object.h index 08423ab6c..34035306b 100644 --- a/include/z64object.h +++ b/include/z64object.h @@ -405,7 +405,7 @@ typedef enum { /* 0x189 */ OBJECT_HANAREYAMA_OBJ, /* 0x18A */ OBJECT_CRACE_OBJECT, /* 0x18B */ OBJECT_DNQ, - /* 0x18C */ OBJECT_OBJECT_UNSET_TOKEIDAI, + /* 0x18C */ OBJECT_OBJ_TOKEIDAI, /* 0x18D */ OBJECT_EG, /* 0x18E */ OBJECT_TRU, /* 0x18F */ OBJECT_TRT, @@ -545,13 +545,13 @@ typedef enum { /* 0x215 */ OBJECT_GI_RESERVE_C_01, /* 0x216 */ OBJECT_ZOD, /* 0x217 */ OBJECT_KUMO30, - /* 0x218 */ OBJECT_OBJECT_UNSET_YASI, + /* 0x218 */ OBJECT_OBJ_YASI, /* 0x219 */ OBJECT_MASK_ROMERNY, /* 0x21A */ OBJECT_TANRON1, /* 0x21B */ OBJECT_TANRON2, /* 0x21C */ OBJECT_TANRON3, /* 0x21D */ OBJECT_GI_MAGICMUSHROOM, - /* 0x21E */ OBJECT_OBJECT_UNSET_CHAN, + /* 0x21E */ OBJECT_OBJ_CHAN, /* 0x21F */ OBJECT_GI_MASK10, /* 0x220 */ OBJECT_ZOS, /* 0x221 */ OBJECT_MASK_POSTHAT, @@ -589,7 +589,7 @@ typedef enum { /* 0x241 */ OBJECT_DT, /* 0x242 */ OBJECT_GI_MASK03, /* 0x243 */ OBJECT_CHA, - /* 0x244 */ OBJECT_OBJECT_UNSET_DINNER, + /* 0x244 */ OBJECT_OBJ_DINNER, /* 0x245 */ OBJECT_GI_RESERVE_B_01, /* 0x246 */ OBJECT_LASTDAY, /* 0x247 */ OBJECT_BAI, @@ -608,7 +608,7 @@ typedef enum { /* 0x254 */ OBJECT_GI_STONEMASK, /* 0x255 */ OBJECT_ZORABAND, /* 0x256 */ OBJECT_KEPN_KOYA, - /* 0x257 */ OBJECT_OBJECT_UNSET_USIYANE, + /* 0x257 */ OBJECT_OBJ_USIYANE, /* 0x258 */ OBJECT_GI_MASK05, /* 0x259 */ OBJECT_GI_MASK11, /* 0x25A */ OBJECT_GI_MASK20, @@ -618,7 +618,7 @@ typedef enum { /* 0x25E */ OBJECT_MASK_MEOTO, /* 0x25F */ OBJECT_MASK_DANCER, /* 0x260 */ OBJECT_KZSAKU, - /* 0x261 */ OBJECT_OBJECT_UNSET_MILK_BIN, + /* 0x261 */ OBJECT_OBJ_MILK_BIN, /* 0x262 */ OBJECT_RANDOM_OBJ, /* 0x263 */ OBJECT_KUJIYA, /* 0x264 */ OBJECT_KITAN, @@ -636,7 +636,7 @@ typedef enum { /* 0x270 */ OBJECT_MOONEND, /* 0x271 */ OBJECT_OB, /* 0x272 */ OBJECT_GI_BOTTLE_04, - /* 0x273 */ OBJECT_OBJECT_UNSET_DANPEILIFT, + /* 0x273 */ OBJECT_OBJ_DANPEILIFT, /* 0x274 */ OBJECT_WDOR01, /* 0x275 */ OBJECT_WDOR02, /* 0x276 */ OBJECT_WDOR03, diff --git a/spec b/spec index bcb80e215..7dcc4bcbf 100644 --- a/spec +++ b/spec @@ -14,7 +14,7 @@ beginseg name "boot" address 0x80080060 include "build/src/boot_O2_g3/boot_main.o" - include "build/data/boot/rsp_boot.data.o" + include "build/data/boot/rspboot.data.o" include "build/src/boot_O2_g3/idle.o" include "build/src/boot_O2_g3/idle_extra_bss.o" include "build/src/boot_O2_g3/viconfig.o" @@ -162,7 +162,6 @@ beginseg include "build/src/libultra/voice/voicesetadconverter.o" include "build/src/libultra/io/aisetfreq.o" include "build/src/libultra/io/contramread.o" - include "build/data/boot/contramread.data.o" include "build/src/libultra/voice/voicecontwrite20.o" include "build/src/libultra/io/crc.o" include "build/src/libultra/os/getactivequeue.o" @@ -422,7 +421,9 @@ beginseg compress after "dmadata" include "build/src/code/z_en_a_keep.o" - include "build/data/code/rsp.data.o" + include "build/data/code/aspMain.data.o" + include "build/data/code/gspS2DEX2.fifo.data.o" + include "build/data/code/njpgdspMain.data.o" include "build/data/code/code_801ADE60.data.o" include "build/data/code/code_801E3FA0.bss.o" include "build/src/code/z_en_item00.o" @@ -660,7 +661,11 @@ beginseg include "build/src/code/jpegdecoder.o" include_readonly "build/src/code/z_game_over.o" include "build/src/code/z_construct.o" - include "build/data/code/rsp.rodata.o" + include "build/data/code/audio_tables.rodata.o" + include "build/data/code/aspMain.rodata.o" + include "build/data/code/gspF3DZEX2.NoN.PosLight.fifo.rodata.o" + include "build/data/code/gspS2DEX2.fifo.rodata.o" + include "build/data/code/njpgdspMain.rodata.o" endseg beginseg @@ -802,9 +807,7 @@ beginseg name "ovl_En_Bom" compress include "build/src/overlays/actors/ovl_En_Bom/z_en_bom.o" - include "build/data/ovl_En_Bom/ovl_En_Bom.data.o" - include "build/data/ovl_En_Bom/ovl_En_Bom.bss.o" - include "build/data/ovl_En_Bom/ovl_En_Bom.reloc.o" + include "build/src/overlays/actors/ovl_En_Bom/ovl_En_Bom_reloc.o" endseg beginseg @@ -1330,8 +1333,7 @@ beginseg name "ovl_Obj_Oshihiki" compress include "build/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.o" - include "build/data/ovl_Obj_Oshihiki/ovl_Obj_Oshihiki.data.o" - include "build/data/ovl_Obj_Oshihiki/ovl_Obj_Oshihiki.reloc.o" + include "build/src/overlays/actors/ovl_Obj_Oshihiki/ovl_Obj_Oshihiki_reloc.o" endseg beginseg @@ -2219,8 +2221,7 @@ beginseg name "ovl_En_Zo" compress include "build/src/overlays/actors/ovl_En_Zo/z_en_zo.o" - include "build/data/ovl_En_Zo/ovl_En_Zo.data.o" - include "build/data/ovl_En_Zo/ovl_En_Zo.reloc.o" + include "build/src/overlays/actors/ovl_En_Zo/ovl_En_Zo_reloc.o" endseg beginseg @@ -2558,9 +2559,11 @@ beginseg name "ovl_Boss_06" compress include "build/src/overlays/actors/ovl_Boss_06/z_boss_06.o" - include "build/data/ovl_Boss_06/ovl_Boss_06.data.o" - include "build/data/ovl_Boss_06/ovl_Boss_06.bss.o" +#ifdef NON_MATCHING + include "build/src/overlays/actors/ovl_Boss_06/ovl_Boss_06_reloc.o" +#else include "build/data/ovl_Boss_06/ovl_Boss_06.reloc.o" +#endif endseg beginseg @@ -2686,11 +2689,7 @@ beginseg name "ovl_Obj_Iceblock" compress include "build/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.o" -#ifdef NON_MATCHING include "build/src/overlays/actors/ovl_Obj_Iceblock/ovl_Obj_Iceblock_reloc.o" -#else - include "build/data/ovl_Obj_Iceblock/ovl_Obj_Iceblock.reloc.o" -#endif endseg beginseg @@ -3431,8 +3430,7 @@ beginseg name "ovl_En_Bigokuta" compress include "build/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.o" - include "build/data/ovl_En_Bigokuta/ovl_En_Bigokuta.data.o" - include "build/data/ovl_En_Bigokuta/ovl_En_Bigokuta.reloc.o" + include "build/src/overlays/actors/ovl_En_Bigokuta/ovl_En_Bigokuta_reloc.o" endseg beginseg @@ -3587,8 +3585,7 @@ beginseg name "ovl_En_Trt2" compress include "build/src/overlays/actors/ovl_En_Trt2/z_en_trt2.o" - include "build/data/ovl_En_Trt2/ovl_En_Trt2.data.o" - include "build/data/ovl_En_Trt2/ovl_En_Trt2.reloc.o" + include "build/src/overlays/actors/ovl_En_Trt2/ovl_En_Trt2_reloc.o" endseg beginseg @@ -4614,8 +4611,7 @@ beginseg name "ovl_En_Zos" compress include "build/src/overlays/actors/ovl_En_Zos/z_en_zos.o" - include "build/data/ovl_En_Zos/ovl_En_Zos.data.o" - include "build/data/ovl_En_Zos/ovl_En_Zos.reloc.o" + include "build/src/overlays/actors/ovl_En_Zos/ovl_En_Zos_reloc.o" endseg beginseg @@ -4703,8 +4699,7 @@ beginseg name "ovl_En_Scopenuts" compress include "build/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.o" - include "build/data/ovl_En_Scopenuts/ovl_En_Scopenuts.data.o" - include "build/data/ovl_En_Scopenuts/ovl_En_Scopenuts.reloc.o" + include "build/src/overlays/actors/ovl_En_Scopenuts/ovl_En_Scopenuts_reloc.o" endseg beginseg @@ -5030,9 +5025,11 @@ beginseg name "ovl_En_Rg" compress include "build/src/overlays/actors/ovl_En_Rg/z_en_rg.o" - include "build/data/ovl_En_Rg/ovl_En_Rg.data.o" - include "build/data/ovl_En_Rg/ovl_En_Rg.bss.o" +#ifdef NON_MATCHING + include "build/src/overlays/actors/ovl_En_Rg/ovl_En_Rg_reloc.o" +#else include "build/data/ovl_En_Rg/ovl_En_Rg.reloc.o" +#endif endseg beginseg @@ -5176,8 +5173,7 @@ beginseg name "ovl_Obj_Kzsaku" compress include "build/src/overlays/actors/ovl_Obj_Kzsaku/z_obj_kzsaku.o" - include "build/data/ovl_Obj_Kzsaku/ovl_Obj_Kzsaku.data.o" - include "build/data/ovl_Obj_Kzsaku/ovl_Obj_Kzsaku.reloc.o" + include "build/src/overlays/actors/ovl_Obj_Kzsaku/ovl_Obj_Kzsaku_reloc.o" endseg beginseg @@ -5385,8 +5381,7 @@ beginseg name "ovl_En_Hint_Skb" compress include "build/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.o" - include "build/data/ovl_En_Hint_Skb/ovl_En_Hint_Skb.data.o" - include "build/data/ovl_En_Hint_Skb/ovl_En_Hint_Skb.reloc.o" + include "build/src/overlays/actors/ovl_En_Hint_Skb/ovl_En_Hint_Skb_reloc.o" endseg beginseg @@ -9200,56 +9195,64 @@ beginseg name "scene_texture_01" compress romalign 0x1000 - include "build/baserom/scene_texture_01.o" + number 6 + include "build/assets/misc/scene_texture_01/scene_texture_01.o" endseg beginseg name "scene_texture_02" compress romalign 0x1000 - include "build/baserom/scene_texture_02.o" + number 6 + include "build/assets/misc/scene_texture_02/scene_texture_02.o" endseg beginseg name "scene_texture_03" compress romalign 0x1000 - include "build/baserom/scene_texture_03.o" + number 6 + include "build/assets/misc/scene_texture_03/scene_texture_03.o" endseg beginseg name "scene_texture_04" compress romalign 0x1000 - include "build/baserom/scene_texture_04.o" + number 6 + include "build/assets/misc/scene_texture_04/scene_texture_04.o" endseg beginseg name "scene_texture_05" compress romalign 0x1000 - include "build/baserom/scene_texture_05.o" + number 6 + include "build/assets/misc/scene_texture_05/scene_texture_05.o" endseg beginseg name "scene_texture_06" compress romalign 0x1000 - include "build/baserom/scene_texture_06.o" + number 6 + include "build/assets/misc/scene_texture_06/scene_texture_06.o" endseg beginseg name "scene_texture_07" compress romalign 0x1000 - include "build/baserom/scene_texture_07.o" + number 6 + include "build/assets/misc/scene_texture_07/scene_texture_07.o" endseg beginseg name "scene_texture_08" compress romalign 0x1000 - include "build/baserom/scene_texture_08.o" + number 6 + include "build/assets/misc/scene_texture_08/scene_texture_08.o" endseg beginseg diff --git a/src/boot_O2_g3/boot_main.c b/src/boot_O2_g3/boot_main.c index be281d248..87bee5da4 100644 --- a/src/boot_O2_g3/boot_main.c +++ b/src/boot_O2_g3/boot_main.c @@ -1,6 +1,5 @@ #include "prevent_bss_reordering.h" #include "global.h" -#include "prevent_bss_reordering.h" StackEntry sBootThreadInfo; OSThread sIdleThread; diff --git a/src/boot_O2_g3/idle.c b/src/boot_O2_g3/idle.c index 2a52e7dce..da93f13fd 100644 --- a/src/boot_O2_g3/idle.c +++ b/src/boot_O2_g3/idle.c @@ -1,6 +1,5 @@ #include "prevent_bss_reordering.h" #include "global.h" -#include "prevent_bss_reordering.h" u8 D_80096B20 = 1; vu8 gViConfigUseDefault = 1; diff --git a/src/boot_O2_g3/z_std_dma.c b/src/boot_O2_g3/z_std_dma.c index 190536b21..9edc65e52 100644 --- a/src/boot_O2_g3/z_std_dma.c +++ b/src/boot_O2_g3/z_std_dma.c @@ -211,24 +211,20 @@ s32 DmaMgr_SendRequest0(void* vramStart, uintptr_t vromStart, size_t size) { } void DmaMgr_Start(void) { - DmaEntry* iter; - u32 idx; - DmaMgr_DMARomToRam(SEGMENT_ROM_START(dmadata), dmadata, SEGMENT_ROM_SIZE(dmadata)); -dummy_label:; + { + DmaEntry* iter = dmadata; + u32 idx = 0; - iter = dmadata; - idx = 0; - while (iter->vromEnd != 0) { - iter++; - idx++; + while (iter->vromEnd != 0) { + iter++; + idx++; + } + + numDmaEntries = idx; } - numDmaEntries = idx; - -dummy_label_2:; - osCreateMesgQueue(&sDmaMgrMsgQueue, sDmaMgrMsgs, ARRAY_COUNT(sDmaMgrMsgs)); StackCheck_Init(&sDmaMgrStackInfo, sDmaMgrStack, sDmaMgrStack + sizeof(sDmaMgrStack), 0, 0x100, "dmamgr"); osCreateThread(&sDmaMgrThread, Z_THREAD_ID_DMAMGR, DmaMgr_ThreadEntry, NULL, sDmaMgrStack + sizeof(sDmaMgrStack), diff --git a/src/code/audio/audio_heap.c b/src/code/audio/audio_heap.c index 7c43ef0f1..b3d83c1f9 100644 --- a/src/code/audio/audio_heap.c +++ b/src/code/audio/audio_heap.c @@ -18,7 +18,7 @@ #pragma GLOBAL_ASM("asm/non_matchings/code/audio_heap/func_8018B578.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/audio_heap/func_8018B5D0.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/audio_heap/AudioHeap_AllocDmaMemory.s") #pragma GLOBAL_ASM("asm/non_matchings/code/audio_heap/func_8018B608.s") diff --git a/src/code/audio/audio_load.c b/src/code/audio/audio_load.c index 15e54b3c5..497f9d47a 100644 --- a/src/code/audio/audio_load.c +++ b/src/code/audio/audio_load.c @@ -8,7 +8,7 @@ #pragma GLOBAL_ASM("asm/non_matchings/code/audio_load/func_8018EF88.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/audio_load/func_8018F220.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/audio_load/AudioLoad_IsFontLoadComplete.s") #pragma GLOBAL_ASM("asm/non_matchings/code/audio_load/func_8018F298.s") diff --git a/src/code/audio/audio_playback.c b/src/code/audio/audio_playback.c index ec8dd86b8..78161943c 100644 --- a/src/code/audio/audio_playback.c +++ b/src/code/audio/audio_playback.c @@ -1,63 +1,988 @@ #include "global.h" -#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_80194930.s") +void AudioPlayback_NoteSetResamplingRate(NoteSubEu* noteSubEu, f32 resamplingRateInput); +void AudioPlayback_AudioListPushFront(AudioListItem* list, AudioListItem* item); +void AudioPlayback_NoteInitForLayer(Note* note, SequenceLayer* layer); -#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_80194DB0.s") +void AudioPlayback_InitNoteSub(Note* note, NoteSubEu* sub, NoteSubAttributes* attrs) { + f32 volRight, volLeft; + s32 smallPanIndex; + u64 pad; + u8 strongLeft; + u8 strongRight; + f32 vel; + u8 pan; + u8 reverbVol; + StereoData stereoData; + s32 stereoHeadsetEffects = note->playbackState.stereoHeadsetEffects; -#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_80194E60.s") + vel = attrs->velocity; + pan = attrs->pan; + reverbVol = attrs->reverbVol; + stereoData = attrs->stereo.s; -#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_80194F20.s") + sub->bitField0 = note->noteSubEu.bitField0; + sub->bitField1 = note->noteSubEu.bitField1; + sub->sound.samples = note->noteSubEu.sound.samples; + sub->unk_06 = note->noteSubEu.unk_06; -#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_80194F84.s") + AudioPlayback_NoteSetResamplingRate(sub, attrs->frequency); -#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_801954CC.s") + pan &= 0x7F; -#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_80195508.s") + sub->bitField0.stereoStrongRight = false; + sub->bitField0.stereoStrongLeft = false; + sub->bitField0.stereoHeadsetEffects = stereoData.stereoHeadsetEffects; + sub->bitField0.usesHeadsetPanEffects = stereoData.usesHeadsetPanEffects; + if (stereoHeadsetEffects && gAudioContext.soundMode == AUDIO_MODE_HEADSET) { + smallPanIndex = pan >> 1; + if (smallPanIndex > 0x3F) { + smallPanIndex = 0x3F; + } -#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_801955DC.s") + sub->headsetPanLeft = gHeadsetPanQuantization[smallPanIndex]; + sub->headsetPanRight = gHeadsetPanQuantization[0x3F - smallPanIndex]; + sub->bitField1.usesHeadsetPanEffects2 = true; -#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_801956C0.s") + volLeft = gHeadsetPanVolume[pan]; + volRight = gHeadsetPanVolume[0x7F - pan]; + } else if (stereoHeadsetEffects && gAudioContext.soundMode == AUDIO_MODE_STEREO) { + strongLeft = strongRight = false; + sub->headsetPanRight = 0; + sub->headsetPanLeft = 0; + sub->bitField1.usesHeadsetPanEffects2 = false; -#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_801957B4.s") + volLeft = gStereoPanVolume[pan]; + volRight = gStereoPanVolume[0x7F - pan]; + if (pan < 0x20) { + strongLeft = true; + } else if (pan > 0x60) { + strongRight = true; + } -#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_801958F8.s") + sub->bitField0.stereoStrongRight = strongRight; + sub->bitField0.stereoStrongLeft = strongLeft; -#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_80195C40.s") + switch (stereoData.bit2) { + case 0: + break; + case 1: + sub->bitField0.stereoStrongRight = stereoData.strongRight; + sub->bitField0.stereoStrongLeft = stereoData.strongLeft; + break; + case 2: + sub->bitField0.stereoStrongRight = stereoData.strongRight | strongRight; + sub->bitField0.stereoStrongLeft = stereoData.strongLeft | strongLeft; + break; + case 3: + sub->bitField0.stereoStrongRight = stereoData.strongRight ^ strongRight; + sub->bitField0.stereoStrongLeft = stereoData.strongLeft ^ strongLeft; + break; + } -#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_80195C60.s") + } else if (gAudioContext.soundMode == AUDIO_MODE_MONO) { + sub->bitField0.stereoHeadsetEffects = false; + sub->bitField0.usesHeadsetPanEffects = false; + volLeft = 0.707f; // approx 1/sqrt(2) + volRight = 0.707f; + } else { + sub->bitField0.stereoStrongRight = stereoData.strongRight; + sub->bitField0.stereoStrongLeft = stereoData.strongLeft; + volLeft = gDefaultPanVolume[pan]; + volRight = gDefaultPanVolume[0x7F - pan]; + } -#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_80195C80.s") + vel = 0.0f > vel ? 0.0f : vel; + vel = 1.0f < vel ? 1.0f : vel; -#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_80195D84.s") + sub->targetVolLeft = (s32)((vel * volLeft) * (0x1000 - 0.001f)); + sub->targetVolRight = (s32)((vel * volRight) * (0x1000 - 0.001f)); -#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_80195DDC.s") + sub->unk_2 = attrs->unk_1; + sub->filter = attrs->filter; + sub->unk_07 = attrs->unk_14; + sub->unk_0E = attrs->unk_16; + sub->reverbVol = reverbVol; + sub->unk_19 = attrs->unk_3; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_80195DEC.s") +void AudioPlayback_NoteSetResamplingRate(NoteSubEu* noteSubEu, f32 resamplingRateInput) { + f32 resamplingRate = 0.0f; -#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_80195E3C.s") + if (resamplingRateInput < 2.0f) { + noteSubEu->bitField1.hasTwoParts = false; + resamplingRate = CLAMP_MAX(resamplingRateInput, 1.99998f); -#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_80195EE0.s") + } else { + noteSubEu->bitField1.hasTwoParts = true; + if (resamplingRateInput > 3.99996f) { + resamplingRate = 1.99998f; + } else { + resamplingRate = resamplingRateInput * 0.5f; + } + } + noteSubEu->resamplingRateFixedPoint = (s32)(resamplingRate * 32768.0f); +} -#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_80196040.s") +void AudioPlayback_NoteInit(Note* note) { + if (note->playbackState.parentLayer->adsr.releaseRate == 0) { + AudioEffects_AdsrInit(¬e->playbackState.adsr, note->playbackState.parentLayer->channel->adsr.envelope, + ¬e->playbackState.adsrVolScaleUnused); + } else { + AudioEffects_AdsrInit(¬e->playbackState.adsr, note->playbackState.parentLayer->adsr.envelope, + ¬e->playbackState.adsrVolScaleUnused); + } -#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_8019617C.s") + note->playbackState.unk_04 = 0; + note->playbackState.adsr.action.s.state = ADSR_STATE_INITIAL; + note->noteSubEu = gDefaultNoteSub; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_801961BC.s") +void AudioPlayback_NoteDisable(Note* note) { + if (note->noteSubEu.bitField0.needsInit == true) { + note->noteSubEu.bitField0.needsInit = false; + } + note->playbackState.priority = 0; + note->noteSubEu.bitField0.enabled = false; + note->playbackState.unk_04 = 0; + note->noteSubEu.bitField0.finished = false; + note->playbackState.parentLayer = NO_LAYER; + note->playbackState.prevParentLayer = NO_LAYER; + note->playbackState.adsr.action.s.state = ADSR_STATE_DISABLED; + note->playbackState.adsr.current = 0; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_801961E8.s") +void AudioPlayback_ProcessNotes(void) { + s32 pad; + s32 unk_04; + NoteAttributes* attrs; + NoteSubEu* noteSubEu2; + NoteSubEu* noteSubEu; + Note* note; + NotePlaybackState* playbackState; + NoteSubAttributes subAttrs; + u8 bookOffset; + f32 scale; + s32 i; -#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_80196268.s") + for (i = 0; i < gAudioContext.numNotes; i++) { + note = &gAudioContext.notes[i]; + noteSubEu2 = &gAudioContext.noteSubsEu[gAudioContext.noteSubEuOffset + i]; + playbackState = ¬e->playbackState; + if (playbackState->parentLayer != NO_LAYER) { + if ((u32)playbackState->parentLayer < 0x7FFFFFFF) { + continue; + } -#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_801963E8.s") + if (note != playbackState->parentLayer->note && playbackState->unk_04 == 0) { + playbackState->adsr.action.s.release = true; + playbackState->adsr.fadeOutVel = gAudioContext.audioBufferParameters.updatesPerFrameInv; + playbackState->priority = 1; + playbackState->unk_04 = 2; + goto out; + } else if (!playbackState->parentLayer->enabled && playbackState->unk_04 == 0 && + playbackState->priority >= 1) { + // do nothing + } else if (playbackState->parentLayer->channel->seqPlayer == NULL) { + AudioSeq_SequenceChannelDisable(playbackState->parentLayer->channel); + playbackState->priority = 1; + playbackState->unk_04 = 1; + continue; + } else if (playbackState->parentLayer->channel->seqPlayer->muted && + (playbackState->parentLayer->channel->muteBehavior & 0x40)) { + // do nothing + } else { + goto out; + } -#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_8019641C.s") + AudioPlayback_SeqLayerNoteRelease(playbackState->parentLayer); + AudioPlayback_AudioListRemove(¬e->listItem); + AudioPlayback_AudioListPushFront(¬e->listItem.pool->decaying, ¬e->listItem); + playbackState->priority = 1; + playbackState->unk_04 = 2; + } else if (playbackState->unk_04 == 0 && playbackState->priority >= 1) { + continue; + } -#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_80196448.s") + out: + if (playbackState->priority != 0) { + if (1) {} + noteSubEu = ¬e->noteSubEu; + if (playbackState->unk_04 >= 1 || noteSubEu->bitField0.finished) { + if (playbackState->adsr.action.s.state == ADSR_STATE_DISABLED || noteSubEu->bitField0.finished) { + if (playbackState->wantedParentLayer != NO_LAYER) { + AudioPlayback_NoteDisable(note); + if (playbackState->wantedParentLayer->channel != NULL) { + AudioPlayback_NoteInitForLayer(note, playbackState->wantedParentLayer); + AudioEffects_NoteVibratoInit(note); + AudioEffects_NotePortamentoInit(note); + AudioPlayback_AudioListRemove(¬e->listItem); + AudioSeq_AudioListPushBack(¬e->listItem.pool->active, ¬e->listItem); + playbackState->wantedParentLayer = NO_LAYER; + // don't skip + } else { + AudioPlayback_NoteDisable(note); + AudioPlayback_AudioListRemove(¬e->listItem); + AudioSeq_AudioListPushBack(¬e->listItem.pool->disabled, ¬e->listItem); + playbackState->wantedParentLayer = NO_LAYER; + goto skip; + } + } else { + if (playbackState->parentLayer != NO_LAYER) { + playbackState->parentLayer->bit1 = true; + } + AudioPlayback_NoteDisable(note); + AudioPlayback_AudioListRemove(¬e->listItem); + AudioSeq_AudioListPushBack(¬e->listItem.pool->disabled, ¬e->listItem); + continue; + } + } + } else if (playbackState->adsr.action.s.state == ADSR_STATE_DISABLED) { + if (playbackState->parentLayer != NO_LAYER) { + playbackState->parentLayer->bit1 = true; + } + AudioPlayback_NoteDisable(note); + AudioPlayback_AudioListRemove(¬e->listItem); + AudioSeq_AudioListPushBack(¬e->listItem.pool->disabled, ¬e->listItem); + continue; + } -#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_80196494.s") + scale = AudioEffects_AdsrUpdate(&playbackState->adsr); + AudioEffects_NoteVibratoUpdate(note); + unk_04 = playbackState->unk_04; + attrs = &playbackState->attributes; + if (unk_04 == 1 || unk_04 == 2) { + subAttrs.frequency = attrs->freqScale; + subAttrs.velocity = attrs->velocity; + subAttrs.pan = attrs->pan; + subAttrs.reverbVol = attrs->reverb; + subAttrs.stereo = attrs->stereo; + subAttrs.unk_1 = attrs->unk_1; + subAttrs.filter = attrs->filter; + subAttrs.unk_14 = attrs->unk_4; + subAttrs.unk_16 = attrs->unk_6; + subAttrs.unk_3 = attrs->unk_3; + bookOffset = noteSubEu->bitField1.bookOffset; + } else { + SequenceLayer* layer = playbackState->parentLayer; + SequenceChannel* channel = playbackState->parentLayer->channel; -#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_801964F8.s") + subAttrs.frequency = layer->noteFreqScale; + subAttrs.velocity = layer->noteVelocity; + subAttrs.pan = layer->notePan; -#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_801965F0.s") + if (layer->unk_08 == 0x80) { + subAttrs.unk_3 = channel->unk_10; + } else { + subAttrs.unk_3 = layer->unk_08; + } -#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_801968C4.s") + if (layer->stereo.s.bit2 == 0) { + subAttrs.stereo = channel->stereo; + } else { + subAttrs.stereo = layer->stereo; + } + + if (layer->unk_0A.s.bit_2 == 1) { + subAttrs.reverbVol = channel->reverb; + } else { + subAttrs.reverbVol = layer->unk_09; + } + + if (layer->unk_0A.s.bit_9 == 1) { + subAttrs.unk_1 = channel->unk_0C; + } else { + subAttrs.unk_1 = 0; + if (1) {} + } + + subAttrs.filter = channel->filter; + subAttrs.unk_14 = channel->unk_0F; + subAttrs.unk_16 = channel->unk_20; + bookOffset = channel->bookOffset & 0x7; + + if (channel->seqPlayer->muted && (channel->muteBehavior & 8)) { + subAttrs.frequency = 0.0f; + subAttrs.velocity = 0.0f; + } + } + + subAttrs.frequency *= playbackState->vibratoFreqScale * playbackState->portamentoFreqScale; + subAttrs.frequency *= gAudioContext.audioBufferParameters.resampleRate; + subAttrs.velocity *= scale; + AudioPlayback_InitNoteSub(note, noteSubEu2, &subAttrs); + noteSubEu->bitField1.bookOffset = bookOffset; + skip:; + } + } +} + +SoundFontSound* AudioPlayback_InstrumentGetSound(Instrument* instrument, s32 semitone) { + SoundFontSound* sound; + + if (semitone < instrument->normalRangeLo) { + sound = &instrument->lowNotesSound; + } else if (semitone <= instrument->normalRangeHi) { + sound = &instrument->normalNotesSound; + } else { + sound = &instrument->highNotesSound; + } + return sound; +} + +Instrument* AudioPlayback_GetInstrumentInner(s32 fontId, s32 instId) { + Instrument* inst; + + if (fontId == 0xFF) { + return NULL; + } + + if (!AudioLoad_IsFontLoadComplete(fontId)) { + gAudioContext.audioErrorFlags = fontId + 0x10000000; + return NULL; + } + + if (instId >= gAudioContext.soundFonts[fontId].numInstruments) { + gAudioContext.audioErrorFlags = ((fontId << 8) + instId) + 0x3000000; + return NULL; + } + + inst = gAudioContext.soundFonts[fontId].instruments[instId]; + if (inst == NULL) { + gAudioContext.audioErrorFlags = ((fontId << 8) + instId) + 0x1000000; + return inst; + } + + return inst; +} + +Drum* AudioPlayback_GetDrum(s32 fontId, s32 drumId) { + Drum* drum; + + if (fontId == 0xFF) { + return NULL; + } + + if (!AudioLoad_IsFontLoadComplete(fontId)) { + gAudioContext.audioErrorFlags = fontId + 0x10000000; + return NULL; + } + + if (drumId >= gAudioContext.soundFonts[fontId].numDrums) { + gAudioContext.audioErrorFlags = ((fontId << 8) + drumId) + 0x4000000; + return NULL; + } + if ((u32)gAudioContext.soundFonts[fontId].drums < 0x80000000) { + return NULL; + } + drum = gAudioContext.soundFonts[fontId].drums[drumId]; + + if (drum == NULL) { + gAudioContext.audioErrorFlags = ((fontId << 8) + drumId) + 0x5000000; + } + + return drum; +} + +SoundFontSound* AudioPlayback_GetSfx(s32 fontId, s32 sfxId) { + SoundFontSound* sfx; + + if (fontId == 0xFF) { + return NULL; + } + + if (!AudioLoad_IsFontLoadComplete(fontId)) { + gAudioContext.audioErrorFlags = fontId + 0x10000000; + return NULL; + } + + if (sfxId >= gAudioContext.soundFonts[fontId].numSfx) { + gAudioContext.audioErrorFlags = ((fontId << 8) + sfxId) + 0x4000000; + return NULL; + } + + if ((u32)gAudioContext.soundFonts[fontId].soundEffects < 0x80000000) { + return NULL; + } + + sfx = &gAudioContext.soundFonts[fontId].soundEffects[sfxId]; + + if (sfx == NULL) { + gAudioContext.audioErrorFlags = ((fontId << 8) + sfxId) + 0x5000000; + } + + if (sfx->sample == NULL) { + return NULL; + } + + return sfx; +} + +s32 AudioPlayback_SetFontInstrument(s32 instrumentType, s32 fontId, s32 index, void* value) { + if (fontId == 0xFF) { + return -1; + } + + if (!AudioLoad_IsFontLoadComplete(fontId)) { + return -2; + } + + switch (instrumentType) { + case 0: + if (index >= gAudioContext.soundFonts[fontId].numDrums) { + return -3; + } + gAudioContext.soundFonts[fontId].drums[index] = value; + break; + + case 1: + if (index >= gAudioContext.soundFonts[fontId].numSfx) { + return -3; + } + gAudioContext.soundFonts[fontId].soundEffects[index] = *(SoundFontSound*)value; + break; + + default: + if (index >= gAudioContext.soundFonts[fontId].numInstruments) { + return -3; + } + gAudioContext.soundFonts[fontId].instruments[index] = value; + break; + } + + return 0; +} + +void AudioPlayback_SeqLayerDecayRelease(SequenceLayer* layer, s32 target) { + Note* note; + NoteAttributes* attrs; + SequenceChannel* chan; + s32 i; + + if (layer == NO_LAYER) { + return; + } + + layer->bit3 = false; + + if (layer->note == NULL) { + return; + } + + note = layer->note; + attrs = ¬e->playbackState.attributes; + + if (note->playbackState.wantedParentLayer == layer) { + note->playbackState.wantedParentLayer = NO_LAYER; + } + + if (note->playbackState.parentLayer != layer) { + if (note->playbackState.parentLayer == NO_LAYER && note->playbackState.wantedParentLayer == NO_LAYER && + note->playbackState.prevParentLayer == layer && target != ADSR_STATE_DECAY) { + note->playbackState.adsr.fadeOutVel = gAudioContext.audioBufferParameters.updatesPerFrameInv; + note->playbackState.adsr.action.s.release = true; + } + return; + } + + if (note->playbackState.adsr.action.s.state != ADSR_STATE_DECAY) { + attrs->freqScale = layer->noteFreqScale; + attrs->velocity = layer->noteVelocity; + attrs->pan = layer->notePan; + + if (layer->channel != NULL) { + chan = layer->channel; + + if (layer->unk_0A.s.bit_2 == 1) { + attrs->reverb = chan->reverb; + } else { + attrs->reverb = layer->unk_09; + } + + if (layer->unk_08 == 0x80) { + attrs->unk_3 = chan->unk_10; + } else { + attrs->unk_3 = layer->unk_08; + } + + if (layer->unk_0A.s.bit_9 == 1) { + attrs->unk_1 = chan->unk_0C; + } else { + attrs->unk_1 = 0; + } + + attrs->filter = chan->filter; + + if (attrs->filter != NULL) { + for (i = 0; i < 8; i++) { + attrs->filterBuf[i] = attrs->filter[i]; + } + attrs->filter = attrs->filterBuf; + } + + attrs->unk_6 = chan->unk_20; + attrs->unk_4 = chan->unk_0F; + if (chan->seqPlayer->muted && (chan->muteBehavior & 8)) { + note->noteSubEu.bitField0.finished = true; + } + + if (layer->stereo.asByte == 0) { + attrs->stereo = chan->stereo; + } else { + attrs->stereo = layer->stereo; + } + note->playbackState.priority = chan->someOtherPriority; + } else { + attrs->stereo = layer->stereo; + note->playbackState.priority = 1; + } + + note->playbackState.prevParentLayer = note->playbackState.parentLayer; + note->playbackState.parentLayer = NO_LAYER; + if (target == ADSR_STATE_RELEASE) { + note->playbackState.adsr.fadeOutVel = gAudioContext.audioBufferParameters.updatesPerFrameInv; + note->playbackState.adsr.action.s.release = true; + note->playbackState.unk_04 = 2; + } else { + note->playbackState.unk_04 = 1; + note->playbackState.adsr.action.s.decay = true; + if (layer->adsr.releaseRate == 0) { + note->playbackState.adsr.fadeOutVel = gAudioContext.unk_3520[layer->channel->adsr.releaseRate]; + } else { + note->playbackState.adsr.fadeOutVel = gAudioContext.unk_3520[layer->adsr.releaseRate]; + } + note->playbackState.adsr.sustain = + ((f32)(s32)(layer->channel->adsr.sustain) * note->playbackState.adsr.current) / 256.0f; + } + } + + if (target == ADSR_STATE_DECAY) { + AudioPlayback_AudioListRemove(¬e->listItem); + AudioPlayback_AudioListPushFront(¬e->listItem.pool->decaying, ¬e->listItem); + } +} + +void AudioPlayback_SeqLayerNoteDecay(SequenceLayer* layer) { + AudioPlayback_SeqLayerDecayRelease(layer, ADSR_STATE_DECAY); +} + +void AudioPlayback_SeqLayerNoteRelease(SequenceLayer* layer) { + AudioPlayback_SeqLayerDecayRelease(layer, ADSR_STATE_RELEASE); +} + +s32 AudioPlayback_BuildSyntheticWave(Note* note, SequenceLayer* layer, s32 waveId) { + f32 freqScale; + f32 ratio; + u8 sampleCountIndex; + + if (waveId < 128) { + waveId = 128; + } + + freqScale = layer->freqScale; + if (layer->portamento.mode != 0 && 0.0f < layer->portamento.extent) { + freqScale *= (layer->portamento.extent + 1.0f); + } + if (freqScale < 0.99999f) { + sampleCountIndex = 0; + ratio = 1.0465f; + } else if (freqScale < 1.99999f) { + sampleCountIndex = 1; + ratio = 0.52325f; + } else if (freqScale < 3.99999f) { + sampleCountIndex = 2; + ratio = 0.26263f; + } else { + sampleCountIndex = 3; + ratio = 0.13081f; + } + layer->freqScale *= ratio; + note->playbackState.waveId = waveId; + note->playbackState.sampleCountIndex = sampleCountIndex; + + note->noteSubEu.sound.samples = &gWaveSamples[waveId - 128][sampleCountIndex * 64]; + + return sampleCountIndex; +} + +void AudioPlayback_InitSyntheticWave(Note* note, SequenceLayer* layer) { + s32 sampleCountIndex; + s32 waveSampleCountIndex; + s32 waveId = layer->instOrWave; + + if (waveId == 0xFF) { + waveId = layer->channel->instOrWave; + } + + sampleCountIndex = note->playbackState.sampleCountIndex; + waveSampleCountIndex = AudioPlayback_BuildSyntheticWave(note, layer, waveId); + + if (waveSampleCountIndex != sampleCountIndex) { + note->noteSubEu.unk_06 = waveSampleCountIndex * 4 + sampleCountIndex; + } +} + +void AudioPlayback_InitNoteList(AudioListItem* list) { + list->prev = list; + list->next = list; + list->u.count = 0; +} + +void AudioPlayback_InitNoteLists(NotePool* pool) { + AudioPlayback_InitNoteList(&pool->disabled); + AudioPlayback_InitNoteList(&pool->decaying); + AudioPlayback_InitNoteList(&pool->releasing); + AudioPlayback_InitNoteList(&pool->active); + pool->disabled.pool = pool; + pool->decaying.pool = pool; + pool->releasing.pool = pool; + pool->active.pool = pool; +} + +void AudioPlayback_InitNoteFreeList(void) { + s32 i; + + AudioPlayback_InitNoteLists(&gAudioContext.noteFreeLists); + for (i = 0; i < gAudioContext.numNotes; i++) { + gAudioContext.notes[i].listItem.u.value = &gAudioContext.notes[i]; + gAudioContext.notes[i].listItem.prev = NULL; + AudioSeq_AudioListPushBack(&gAudioContext.noteFreeLists.disabled, &gAudioContext.notes[i].listItem); + } +} + +void AudioPlayback_NotePoolClear(NotePool* pool) { + s32 i; + AudioListItem* source; + AudioListItem* cur; + AudioListItem* dest; + + for (i = 0; i < 4; i++) { + switch (i) { + case 0: + source = &pool->disabled; + dest = &gAudioContext.noteFreeLists.disabled; + break; + + case 1: + source = &pool->decaying; + dest = &gAudioContext.noteFreeLists.decaying; + break; + + case 2: + source = &pool->releasing; + dest = &gAudioContext.noteFreeLists.releasing; + break; + + case 3: + source = &pool->active; + dest = &gAudioContext.noteFreeLists.active; + break; + } + + for (;;) { + cur = source->next; + if (cur == source || cur == NULL) { + break; + } + AudioPlayback_AudioListRemove(cur); + AudioSeq_AudioListPushBack(dest, cur); + } + } +} + +void AudioPlayback_NotePoolFill(NotePool* pool, s32 count) { + s32 i; + s32 j; + Note* note; + AudioListItem* source; + AudioListItem* dest; + + AudioPlayback_NotePoolClear(pool); + + for (i = 0, j = 0; j < count; i++) { + if (i == 4) { + return; + } + + switch (i) { + case 0: + source = &gAudioContext.noteFreeLists.disabled; + dest = &pool->disabled; + break; + + case 1: + source = &gAudioContext.noteFreeLists.decaying; + dest = &pool->decaying; + break; + + case 2: + source = &gAudioContext.noteFreeLists.releasing; + dest = &pool->releasing; + break; + + case 3: + source = &gAudioContext.noteFreeLists.active; + dest = &pool->active; + break; + } + + while (j < count) { + note = AudioSeq_AudioListPopBack(source); + if (note == NULL) { + break; + } + AudioSeq_AudioListPushBack(dest, ¬e->listItem); + j++; + } + } +} + +void AudioPlayback_AudioListPushFront(AudioListItem* list, AudioListItem* item) { + // add 'item' to the front of the list given by 'list', if it's not in any list + if (item->prev == NULL) { + item->prev = list; + item->next = list->next; + list->next->prev = item; + list->next = item; + list->u.count++; + item->pool = list->pool; + } +} + +void AudioPlayback_AudioListRemove(AudioListItem* item) { + // remove 'item' from the list it's in, if any + if (item->prev != NULL) { + item->prev->next = item->next; + item->next->prev = item->prev; + item->prev = NULL; + } +} + +Note* AudioPlayback_FindNodeWithPrioLessThan(AudioListItem* list, s32 limit) { + AudioListItem* cur = list->next; + AudioListItem* best; + + if (cur == list) { + return NULL; + } + + for (best = cur; cur != list; cur = cur->next) { + if (((Note*)best->u.value)->playbackState.priority >= ((Note*)cur->u.value)->playbackState.priority) { + best = cur; + } + } + + if (best == NULL) { + return NULL; + } + + if (limit <= ((Note*)best->u.value)->playbackState.priority) { + return NULL; + } + + return best->u.value; +} + +void AudioPlayback_NoteInitForLayer(Note* note, SequenceLayer* layer) { + s32 pad[3]; + s16 instId; + SequenceChannel* channel = layer->channel; + NotePlaybackState* playbackState = ¬e->playbackState; + NoteSubEu* noteSubEu = ¬e->noteSubEu; + + playbackState->prevParentLayer = NO_LAYER; + playbackState->parentLayer = layer; + playbackState->priority = channel->notePriority; + layer->notePropertiesNeedInit = true; + layer->bit3 = true; + layer->note = note; + channel->noteUnused = note; + channel->layerUnused = layer; + layer->noteVelocity = 0.0f; + AudioPlayback_NoteInit(note); + instId = layer->instOrWave; + + if (instId == 0xFF) { + instId = channel->instOrWave; + } + noteSubEu->sound.soundFontSound = layer->sound; + + if (instId >= 0x80 && instId < 0xC0) { + noteSubEu->bitField1.isSyntheticWave = true; + } else { + noteSubEu->bitField1.isSyntheticWave = false; + } + + if (noteSubEu->bitField1.isSyntheticWave) { + AudioPlayback_BuildSyntheticWave(note, layer, instId); + } else if (channel->unk_DC == 1) { + playbackState->unk_84 = noteSubEu->sound.soundFontSound->sample->loop->start; + } else { + playbackState->unk_84 = channel->unk_DC; + if (playbackState->unk_84 >= noteSubEu->sound.soundFontSound->sample->loop->end) { + playbackState->unk_84 = 0; + } + } + + playbackState->fontId = channel->fontId; + playbackState->stereoHeadsetEffects = channel->stereoHeadsetEffects; + noteSubEu->bitField1.reverbIndex = channel->reverbIndex & 3; +} + +void func_801963E8(Note* note, SequenceLayer* layer) { + // similar to Audio_NoteReleaseAndTakeOwnership, hard to say what the difference is + AudioPlayback_SeqLayerNoteRelease(note->playbackState.parentLayer); + note->playbackState.wantedParentLayer = layer; +} + +void AudioPlayback_NoteReleaseAndTakeOwnership(Note* note, SequenceLayer* layer) { + note->playbackState.wantedParentLayer = layer; + note->playbackState.priority = layer->channel->notePriority; + + note->playbackState.adsr.fadeOutVel = gAudioContext.audioBufferParameters.updatesPerFrameInv; + note->playbackState.adsr.action.s.release = true; +} + +Note* AudioPlayback_AllocNoteFromDisabled(NotePool* pool, SequenceLayer* layer) { + Note* note = AudioSeq_AudioListPopBack(&pool->disabled); + if (note != NULL) { + AudioPlayback_NoteInitForLayer(note, layer); + AudioPlayback_AudioListPushFront(&pool->active, ¬e->listItem); + } + return note; +} + +Note* AudioPlayback_AllocNoteFromDecaying(NotePool* pool, SequenceLayer* layer) { + Note* note = AudioPlayback_FindNodeWithPrioLessThan(&pool->decaying, layer->channel->notePriority); + + if (note != NULL) { + AudioPlayback_NoteReleaseAndTakeOwnership(note, layer); + AudioPlayback_AudioListRemove(¬e->listItem); + AudioSeq_AudioListPushBack(&pool->releasing, ¬e->listItem); + } + return note; +} + +Note* AudioPlayback_AllocNoteFromActive(NotePool* pool, SequenceLayer* layer) { + Note* rNote; + Note* aNote; + s32 rPriority; + s32 aPriority; + + rPriority = aPriority = 0x10; + rNote = AudioPlayback_FindNodeWithPrioLessThan(&pool->releasing, layer->channel->notePriority); + + if (rNote != NULL) { + rPriority = rNote->playbackState.priority; + } + + aNote = AudioPlayback_FindNodeWithPrioLessThan(&pool->active, layer->channel->notePriority); + + if (aNote != NULL) { + aPriority = aNote->playbackState.priority; + } + + if (rNote == NULL && aNote == NULL) { + return NULL; + } + + if (aPriority < rPriority) { + AudioPlayback_AudioListRemove(&aNote->listItem); + func_801963E8(aNote, layer); + AudioSeq_AudioListPushBack(&pool->releasing, &aNote->listItem); + aNote->playbackState.priority = layer->channel->notePriority; + return aNote; + } + rNote->playbackState.wantedParentLayer = layer; + rNote->playbackState.priority = layer->channel->notePriority; + return rNote; +} + +Note* AudioPlayback_AllocNote(SequenceLayer* layer) { + Note* note; + u32 policy = layer->channel->noteAllocPolicy; + + if (policy & 1) { + note = layer->note; + if (note != NULL && note->playbackState.prevParentLayer == layer && + note->playbackState.wantedParentLayer == NO_LAYER) { + AudioPlayback_NoteReleaseAndTakeOwnership(note, layer); + AudioPlayback_AudioListRemove(¬e->listItem); + AudioSeq_AudioListPushBack(¬e->listItem.pool->releasing, ¬e->listItem); + return note; + } + } + + if (policy & 2) { + if (!(note = AudioPlayback_AllocNoteFromDisabled(&layer->channel->notePool, layer)) && + !(note = AudioPlayback_AllocNoteFromDecaying(&layer->channel->notePool, layer)) && + !(note = AudioPlayback_AllocNoteFromActive(&layer->channel->notePool, layer))) { + goto null_return; + } + return note; + } + + if (policy & 4) { + if (!(note = AudioPlayback_AllocNoteFromDisabled(&layer->channel->notePool, layer)) && + !(note = AudioPlayback_AllocNoteFromDisabled(&layer->channel->seqPlayer->notePool, layer)) && + !(note = AudioPlayback_AllocNoteFromDecaying(&layer->channel->notePool, layer)) && + !(note = AudioPlayback_AllocNoteFromDecaying(&layer->channel->seqPlayer->notePool, layer)) && + !(note = AudioPlayback_AllocNoteFromActive(&layer->channel->notePool, layer)) && + !(note = AudioPlayback_AllocNoteFromActive(&layer->channel->seqPlayer->notePool, layer))) { + goto null_return; + } + return note; + } + + if (policy & 8) { + if (!(note = AudioPlayback_AllocNoteFromDisabled(&gAudioContext.noteFreeLists, layer)) && + !(note = AudioPlayback_AllocNoteFromDecaying(&gAudioContext.noteFreeLists, layer)) && + !(note = AudioPlayback_AllocNoteFromActive(&gAudioContext.noteFreeLists, layer))) { + goto null_return; + } + return note; + } + + if (!(note = AudioPlayback_AllocNoteFromDisabled(&layer->channel->notePool, layer)) && + !(note = AudioPlayback_AllocNoteFromDisabled(&layer->channel->seqPlayer->notePool, layer)) && + !(note = AudioPlayback_AllocNoteFromDisabled(&gAudioContext.noteFreeLists, layer)) && + !(note = AudioPlayback_AllocNoteFromDecaying(&layer->channel->notePool, layer)) && + !(note = AudioPlayback_AllocNoteFromDecaying(&layer->channel->seqPlayer->notePool, layer)) && + !(note = AudioPlayback_AllocNoteFromDecaying(&gAudioContext.noteFreeLists, layer)) && + !(note = AudioPlayback_AllocNoteFromActive(&layer->channel->notePool, layer)) && + !(note = AudioPlayback_AllocNoteFromActive(&layer->channel->seqPlayer->notePool, layer)) && + !(note = AudioPlayback_AllocNoteFromActive(&gAudioContext.noteFreeLists, layer))) { + goto null_return; + } + return note; + +null_return: + layer->bit3 = true; + return NULL; +} + +void AudioPlayback_NoteInitAll(void) { + Note* note; + s32 i; + + for (i = 0; i < gAudioContext.numNotes; i++) { + note = &gAudioContext.notes[i]; + note->noteSubEu = gZeroNoteSub; + note->playbackState.priority = 0; + note->playbackState.unk_04 = 0; + note->playbackState.parentLayer = NO_LAYER; + note->playbackState.wantedParentLayer = NO_LAYER; + note->playbackState.prevParentLayer = NO_LAYER; + note->playbackState.waveId = 0; + note->playbackState.attributes.velocity = 0.0f; + note->playbackState.adsrVolScaleUnused = 0; + note->playbackState.adsr.action.asByte = 0; + note->playbackState.vibratoState.active = false; + note->playbackState.portamento.cur = 0; + note->playbackState.portamento.speed = 0; + note->playbackState.stereoHeadsetEffects = false; + note->playbackState.unk_84 = 0; + note->synthesisState.synthesisBuffers = AudioHeap_AllocDmaMemory(&gAudioContext.notesAndBuffersPool, 0x2E0); + note->playbackState.attributes.filterBuf = AudioHeap_AllocDmaMemory(&gAudioContext.notesAndBuffersPool, 0x10); + } +} diff --git a/src/code/audio/audio_seqplayer.c b/src/code/audio/audio_seqplayer.c index ec4375796..56d8ac951 100644 --- a/src/code/audio/audio_seqplayer.c +++ b/src/code/audio/audio_seqplayer.c @@ -12,7 +12,7 @@ #pragma GLOBAL_ASM("asm/non_matchings/code/audio_seqplayer/func_80197A54.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/audio_seqplayer/func_80197AA4.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/audio_seqplayer/AudioSeq_SequenceChannelDisable.s") #pragma GLOBAL_ASM("asm/non_matchings/code/audio_seqplayer/func_80197B14.s") @@ -24,9 +24,9 @@ #pragma GLOBAL_ASM("asm/non_matchings/code/audio_seqplayer/AudioSeq_SequencePlayerDisable.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/audio_seqplayer/func_80197E08.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/audio_seqplayer/AudioSeq_AudioListPushBack.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/audio_seqplayer/func_80197E48.s") +#pragma GLOBAL_ASM("asm/non_matchings/code/audio_seqplayer/AudioSeq_AudioListPopBack.s") #pragma GLOBAL_ASM("asm/non_matchings/code/audio_seqplayer/func_80197E88.s") diff --git a/src/code/graph.c b/src/code/graph.c index 8059d1f63..04ab72057 100644 --- a/src/code/graph.c +++ b/src/code/graph.c @@ -1,4 +1,3 @@ -#include "prevent_bss_reordering.h" #include "global.h" #include "system_malloc.h" #include "overlays/gamestates/ovl_daytelop/z_daytelop.h" diff --git a/src/code/sys_ucode.c b/src/code/sys_ucode.c index 9bde9e6df..f9433eab2 100644 --- a/src/code/sys_ucode.c +++ b/src/code/sys_ucode.c @@ -7,8 +7,11 @@ extern u64 rspbootTextStart[]; extern u64 rspbootTextEnd[]; -u64* initialgspUcodeText = gspF3DEX2_NoN_fifoTextStart; -u64* initialgspUcodeData = gspF3DEX2_NoN_fifoDataStart; +extern u64 gspF3DZEX2_NoN_PosLight_fifoTextStart[]; +extern u64 gspF3DZEX2_NoN_PosLight_fifoDataStart[]; + +u64* initialgspUcodeText = gspF3DZEX2_NoN_PosLight_fifoTextStart; +u64* initialgspUcodeData = gspF3DZEX2_NoN_PosLight_fifoDataStart; u64* SysUcode_GetUCodeBoot(void) { return rspbootTextStart; diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 998063534..f41fb43df 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -320,13 +320,12 @@ void func_800B4AEC(GlobalContext* globalCtx, Actor* actor, f32 y) { void func_800B4B50(Actor* actor, Lights* mapper, GlobalContext* globalCtx) { f32 spEC; f32 temp_f12; - f32 temp_f20; f32 shadowScaleZ; f32 temp_f22; f32 temp_f24; f32 temp_f8; - MtxF sp94; s32 lightNum; + MtxF sp94; s32 numLights; s8 phi_v1; u8 temp_v0; @@ -342,7 +341,8 @@ void func_800B4B50(Actor* actor, Lights* mapper, GlobalContext* globalCtx) { spEC = actor->world.pos.y - actor->floorHeight; if (spEC > 20.0f) { - temp_f20 = actor->shape.shadowScale; + f32 temp_f20 = actor->shape.shadowScale; + temp_v0 = actor->shape.shadowAlpha; actor->shape.shadowScale *= 0.3f; temp_f12 = (spEC - 20.0f) * 0.02f; @@ -350,7 +350,6 @@ void func_800B4B50(Actor* actor, Lights* mapper, GlobalContext* globalCtx) { ActorShadow_DrawCircle(actor, mapper, globalCtx); actor->shape.shadowScale = temp_f20; actor->shape.shadowAlpha = temp_v0; - dummy_label_111649:; } else if (spEC >= -1.0f) { numLights = mapper->numLights - 2; @@ -377,8 +376,8 @@ void func_800B4B50(Actor* actor, Lights* mapper, GlobalContext* globalCtx) { for (j = 0; j < 2; j++, phi_s0++) { if (phi_s0->l.dir[1] > 0) { - lightNum = (ABS_ALT(phi_s0->l.dir[1]) * (phi_s0->l.col[0] + phi_s0->l.col[1] + phi_s0->l.col[2])) - - (lightNumMax * ((void)0, 8)); + lightNum = ((phi_s0->l.col[0] + phi_s0->l.col[1] + phi_s0->l.col[2]) * ABS_ALT(phi_s0->l.dir[1])) - + (8 * lightNumMax); if (lightNum > 0) { ActorShadow_DrawFoot(globalCtx, phi_s0, &sp94, lightNum, temp_f22, temp_f24, shadowScaleZ); } diff --git a/src/code/z_bgcheck.c b/src/code/z_bgcheck.c index 850d5234b..7fa1b755b 100644 --- a/src/code/z_bgcheck.c +++ b/src/code/z_bgcheck.c @@ -4321,17 +4321,18 @@ s32 SurfaceType_IsIgnoredByProjectiles(CollisionContext* colCtx, CollisionPoly* } /** - * CollisionPoly is conveyor enabled - * Returns true if `poly` is a conveyor surface, else false + * SurfaceType Get Conveyor Surface Type + * Return type 0 (CONVEYOR_WATER) if 'poly' is a surface that will only move player underwater + * Return type 1 (CONVEYOR_FLOOR) if `poly` is a surface that must be stood on to move player */ -s32 SurfaceType_IsConveyor(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId) { +s32 SurfaceType_GetConveyorType(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId) { u32 flags; if (BgCheck_GetCollisionHeader(colCtx, bgId) == NULL) { - return true; + return CONVEYOR_FLOOR; } if (poly == NULL) { - return false; + return CONVEYOR_WATER; } flags = poly->flags_vIB & 0x2000; return !!flags; diff --git a/src/code/z_eff_blure.c b/src/code/z_eff_blure.c index 887534366..b17799aff 100644 --- a/src/code/z_eff_blure.c +++ b/src/code/z_eff_blure.c @@ -1,4 +1,5 @@ #include "global.h" +#include "objects/gameplay_keep/gameplay_keep.h" void EffectBlure_AddVertex(EffectBlure* this, Vec3f* p1, Vec3f* p2) { EffectBlureElement* elem; @@ -720,8 +721,8 @@ void EffectBlure_SetupSimpleAlt(GraphicsContext* gfxCtx, EffectBlure* this, Vtx* gDPSetTextureLUT(POLY_XLU_DISP++, G_TT_NONE); gSPTexture(POLY_XLU_DISP++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON); - gDPLoadTextureBlock(POLY_XLU_DISP++, D_04014570, G_IM_FMT_I, G_IM_SIZ_8b, 64, 32, 0, G_TX_NOMIRROR | G_TX_CLAMP, - G_TX_NOMIRROR | G_TX_WRAP, 6, 5, G_TX_NOLOD, G_TX_NOLOD); + gDPLoadTextureBlock(POLY_XLU_DISP++, gameplay_keep_Tex_014570, G_IM_FMT_I, G_IM_SIZ_8b, 64, 32, 0, + G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_WRAP, 6, 5, G_TX_NOLOD, G_TX_NOLOD); gDPSetCombineLERP(POLY_XLU_DISP++, TEXEL0, PRIMITIVE, PRIM_LOD_FRAC, TEXEL0, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, COMBINED, ENVIRONMENT, 0, 0, 0, COMBINED); diff --git a/src/code/z_eff_shield_particle.c b/src/code/z_eff_shield_particle.c index 05669d63a..112f7fe73 100644 --- a/src/code/z_eff_shield_particle.c +++ b/src/code/z_eff_shield_particle.c @@ -2,6 +2,7 @@ #include "vt.h" #include "assets/code/eff_shield_particle/eff_shield_particle.c" +#include "objects/gameplay_keep/gameplay_keep.h" void EffectShieldParticle_Init(void* thisx, void* initParamsx) { EffectShieldParticle* this = (EffectShieldParticle*)thisx; @@ -154,8 +155,8 @@ void EffectShieldParticle_Draw(void* thisx, GraphicsContext* gfxCtx) { gDPPipeSync(POLY_XLU_DISP++); gSPTexture(POLY_XLU_DISP++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON); - gDPLoadTextureBlock(POLY_XLU_DISP++, D_04054F20, G_IM_FMT_I, G_IM_SIZ_8b, 32, 32, 0, G_TX_NOMIRROR | G_TX_WRAP, - G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD); + gDPLoadTextureBlock(POLY_XLU_DISP++, gameplay_keep_Tex_054F20, G_IM_FMT_I, G_IM_SIZ_8b, 32, 32, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD); gDPSetCombineLERP(POLY_XLU_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, PRIMITIVE, 0, TEXEL0, 0, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED); diff --git a/src/code/z_eff_spark.c b/src/code/z_eff_spark.c index 27ed1443d..697c55398 100644 --- a/src/code/z_eff_spark.c +++ b/src/code/z_eff_spark.c @@ -1,4 +1,5 @@ #include "global.h" +#include "objects/gameplay_keep/gameplay_keep.h" void EffectSpark_Init(void* thisx, void* initParamsx) { EffectSpark* this = (EffectSpark*)thisx; @@ -152,8 +153,8 @@ void EffectSpark_Draw(void* thisx, GraphicsContext* gfxCtx) { gDPPipeSync(POLY_XLU_DISP++); gSPTexture(POLY_XLU_DISP++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON); - gDPLoadTextureBlock(POLY_XLU_DISP++, D_04054F20, G_IM_FMT_I, G_IM_SIZ_8b, 32, 32, 0, G_TX_NOMIRROR | G_TX_WRAP, - G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD); + gDPLoadTextureBlock(POLY_XLU_DISP++, gameplay_keep_Tex_054F20, G_IM_FMT_I, G_IM_SIZ_8b, 32, 32, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD); gDPSetCombineMode(POLY_XLU_DISP++, G_CC_SHADEDECALA, G_CC_PASS2); gDPSetRenderMode(POLY_XLU_DISP++, G_RM_PASS, G_RM_ZB_CLD_SURF2); diff --git a/src/code/z_eff_tire_mark.c b/src/code/z_eff_tire_mark.c index 517ee5251..532e8e2fb 100644 --- a/src/code/z_eff_tire_mark.c +++ b/src/code/z_eff_tire_mark.c @@ -1,4 +1,5 @@ #include "global.h" +#include "objects/gameplay_keep/gameplay_keep.h" void func_800AE930(CollisionContext* colCtx, EffectTireMark* this, Vec3f* pos, f32 arg3, s16 arg4, CollisionPoly* colPoly, s32 arg6) { @@ -233,7 +234,7 @@ void EffectTireMark_Draw(void* thisx, GraphicsContext* gfxCtx) { POLY_OPA_DISP = Gfx_CallSetupDL(POLY_OPA_DISP++, 0x2C); gDPSetRenderMode(POLY_OPA_DISP++, G_RM_PASS, G_RM_ZB_CLD_SURF2); - gDPLoadTextureBlock(POLY_OPA_DISP++, D_04014570, G_IM_FMT_I, G_IM_SIZ_8b, 64, 32, 0, + gDPLoadTextureBlock(POLY_OPA_DISP++, gameplay_keep_Tex_014570, G_IM_FMT_I, G_IM_SIZ_8b, 64, 32, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_WRAP, 6, 5, G_TX_NOLOD, G_TX_NOLOD); gDPSetCombineLERP(POLY_OPA_DISP++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, COMBINED, 0, 0, 0, @@ -255,11 +256,12 @@ void EffectTireMark_Draw(void* thisx, GraphicsContext* gfxCtx) { if ((elem - 1)->flags & 1) { if (!(elem->flags & 1)) { + s32 requiredScopeTemp; + vtx[i * 2 + 0].v.tc[0] = 0; vtx[i * 2 + 0].v.tc[1] = 0; vtx[i * 2 + 1].v.tc[0] = 0; vtx[i * 2 + 1].v.tc[1] = 1024; - dummy_label:; } else if ((i >= 2) && !((elem - 2)->flags & 1)) { vtx[i * 2 - 2].v.tc[0] = 0; vtx[i * 2 - 2].v.tc[1] = 0; diff --git a/src/code/z_en_item00.c b/src/code/z_en_item00.c index 3c174215f..7100aec71 100644 --- a/src/code/z_en_item00.c +++ b/src/code/z_en_item00.c @@ -1,4 +1,6 @@ #include "global.h" +#include "objects/gameplay_keep/gameplay_keep.h" +#include "objects/object_gi_hearts/object_gi_hearts.h" #define FLAGS 0x00000000 @@ -693,12 +695,12 @@ void EnItem00_Draw(Actor* thisx, GlobalContext* globalCtx) { } } -UNK_PTR D_801ADF30[5] = { - &D_04061FC0, // Green rupee - &D_04061FE0, // Blue rupee - &D_04062000, // Red rupee - &D_04062040, // Orange rupee - &D_04062020 // Purple rupee +TexturePtr D_801ADF30[] = { + gameplay_keep_Tex_061FC0, // Green rupee + gameplay_keep_Tex_061FE0, // Blue rupee + gameplay_keep_Tex_062000, // Red rupee + gameplay_keep_Tex_062040, // Orange rupee + gameplay_keep_Tex_062020 // Purple rupee }; void EnItem00_DrawRupee(EnItem00* this, GlobalContext* globalCtx) { @@ -720,24 +722,24 @@ void EnItem00_DrawRupee(EnItem00* this, GlobalContext* globalCtx) { gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(D_801ADF30[iconNb])); - gSPDisplayList(POLY_OPA_DISP++, &D_040622C0); // TODO symbol + gSPDisplayList(POLY_OPA_DISP++, gameplay_keep_DL_0622C0); // TODO symbol CLOSE_DISPS(globalCtx->state.gfxCtx); } -UNK_PTR D_801ADF44[12] = { - &D_0405E6F0, // Heart (Not used) - &D_0405CEF0, // Bombs (A), Bombs (0) - &D_0405BEF0, // Arrows (10) - &D_0405B6F0, // Arrows (30) - &D_0405C6F0, // Arrows (40), Arrows (50) - &D_0405CEF0, // Bombs (B) - &D_040607C0, // Nuts (1), Nuts (10) - &D_04060FC0, // Sticks (1) - &D_040617C0, // Magic (Large) - &D_0405FFC0, // Magic (Small) +TexturePtr D_801ADF44[12] = { + gameplay_keep_Tex_05E6F0, // Heart (Not used) + gameplay_keep_Tex_05CEF0, // Bombs (A), Bombs (0) + gameplay_keep_Tex_05BEF0, // Arrows (10) + gameplay_keep_Tex_05B6F0, // Arrows (30) + gameplay_keep_Tex_05C6F0, // Arrows (40), Arrows (50) + gameplay_keep_Tex_05CEF0, // Bombs (B) + gameplay_keep_Tex_0607C0, // Nuts (1), Nuts (10) + gameplay_keep_Tex_060FC0, // Sticks (1) + gameplay_keep_Tex_0617C0, // Magic (Large) + gameplay_keep_Tex_05FFC0, // Magic (Small) NULL, - &D_0405F7C0 // Small Key + gameplay_keep_Tex_05F7C0 // Small Key }; void EnItem00_DrawSprite(EnItem00* this, GlobalContext* globalCtx) { @@ -764,14 +766,11 @@ void EnItem00_DrawSprite(EnItem00* this, GlobalContext* globalCtx) { gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_MODELVIEW | G_MTX_LOAD); - gSPDisplayList(POLY_OPA_DISP++, D_0405F6F0); + gSPDisplayList(POLY_OPA_DISP++, gameplay_keep_DL_05F6F0); CLOSE_DISPS(globalCtx->state.gfxCtx); } -extern Gfx D_06001290[]; -extern Gfx D_06001470[]; - void EnItem00_DrawHeartContainer(EnItem00* actor, GlobalContext* globalCtx) { s32 pad; s32 pad2; @@ -784,8 +783,8 @@ void EnItem00_DrawHeartContainer(EnItem00* actor, GlobalContext* globalCtx) { gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_MODELVIEW | G_MTX_LOAD); - gSPDisplayList(POLY_XLU_DISP++, D_06001290); - gSPDisplayList(POLY_XLU_DISP++, D_06001470); + gSPDisplayList(POLY_XLU_DISP++, object_gi_hearts_DL_001290); + gSPDisplayList(POLY_XLU_DISP++, object_gi_hearts_DL_001470); CLOSE_DISPS(globalCtx->state.gfxCtx); } @@ -801,7 +800,7 @@ void EnItem00_DrawHeartPiece(EnItem00* this, GlobalContext* globalCtx) { gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_MODELVIEW | G_MTX_LOAD); - gSPDisplayList(POLY_XLU_DISP++, D_0405AAB0); + gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_05AAB0); CLOSE_DISPS(globalCtx->state.gfxCtx); } diff --git a/src/code/z_jpeg.c b/src/code/z_jpeg.c index c611ab1f8..7b9254ccd 100644 --- a/src/code/z_jpeg.c +++ b/src/code/z_jpeg.c @@ -16,6 +16,9 @@ #define MARKER_COM 0xFE #define MARKER_EOI 0xD9 +extern u64 njpgdspMainTextStart[]; +extern u64 njpgdspMainDataStart[]; + /** * Configures and schedules a JPEG decoder task and waits for it to finish. */ @@ -25,9 +28,9 @@ void Jpeg_ScheduleDecoderTask(JpegContext* jpegCtx) { 0, // flags NULL, // ucode_boot 0, // ucode_boot_size - gJpegUCode, // ucode + njpgdspMainTextStart, // ucode 0x1000, // ucode_size - gJpegUCodeData, // ucode_data + njpgdspMainDataStart, // ucode_data 0x800, // ucode_data_size NULL, // dram_stack 0, // dram_stack_size diff --git a/src/code/z_lights.c b/src/code/z_lights.c index fae6af51e..858a7186e 100644 --- a/src/code/z_lights.c +++ b/src/code/z_lights.c @@ -1,4 +1,5 @@ #include "global.h" +#include "objects/gameplay_keep/gameplay_keep.h" void Lights_PointSetInfo(LightInfo* info, s16 x, s16 y, s16 z, u8 r, u8 g, u8 b, s16 radius, s32 type) { info->type = type; @@ -418,7 +419,7 @@ void Lights_DrawGlow(GlobalContext* globalCtx) { gDPSetCombineLERP(dl++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0); - gSPDisplayList(dl++, D_04029CB0); + gSPDisplayList(dl++, gameplay_keep_DL_029CB0); do { if (light->info->type == LIGHT_POINT_GLOW) { @@ -434,7 +435,7 @@ void Lights_DrawGlow(GlobalContext* globalCtx) { gSPMatrix(dl++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(dl++, D_04029CF0); + gSPDisplayList(dl++, gameplay_keep_DL_029CF0); } } diff --git a/src/code/z_quake.c b/src/code/z_quake.c index e699ff086..d38746bf4 100644 --- a/src/code/z_quake.c +++ b/src/code/z_quake.c @@ -1,7 +1,7 @@ #include "global.h" QuakeRequest sQuakeRequest[4]; -Quake2Context sQuake2Context; +DistortionContext sDistortionContext; static s16 sIsQuakeInitialized = true; static s16 sQuakeRequestCount = 0; @@ -382,58 +382,62 @@ s16 Quake_Calc(Camera* camera, QuakeCamCalc* camData) { return ret; } -void Quake2_Init(GlobalContext* globalCtx) { - sQuake2Context.globalCtx = globalCtx; - View_ClearQuake(&globalCtx->view); - sQuake2Context.type = 0; - sQuake2Context.countdown = 0; - sQuake2Context.state = QUAKE2_INACTIVE; +void Distortion_Init(GlobalContext* globalCtx) { + sDistortionContext.globalCtx = globalCtx; + View_ClearDistortion(&globalCtx->view); + sDistortionContext.type = 0; + sDistortionContext.countdown = 0; + sDistortionContext.state = DISTORTION_INACTIVE; } -void Quake2_SetCountdown(s16 countdown) { - sQuake2Context.countdown = countdown; - sQuake2Context.state = QUAKE2_SETUP; +void Distortion_SetCountdown(s16 countdown) { + sDistortionContext.countdown = countdown; + sDistortionContext.state = DISTORTION_SETUP; } -s16 Quake2_GetCountdown(void) { - return sQuake2Context.countdown; +s16 Distortion_GetCountdown(void) { + return sDistortionContext.countdown; } -s16 Quake2_GetType(void) { - return sQuake2Context.type; +s16 Distortion_GetType(void) { + return sDistortionContext.type; } -void Quake2_SetType(s32 type) { - if (sQuake2Context.type < type) { - sQuake2Context.type = type; +void Distortion_SetType(s32 type) { + if (sDistortionContext.type < type) { + sDistortionContext.type = type; } } -void Quake2_ClearType(s32 type) { - if (sQuake2Context.type == type) { - sQuake2Context.type = 0; +void Distortion_ClearType(s32 type) { + if (sDistortionContext.type == type) { + sDistortionContext.type = 0; } } -s32 Quake2_GetFloorQuake(Player* player) { - if (!SurfaceType_IsConveyor(&sQuake2Context.globalCtx->colCtx, player->actor.floorPoly, player->actor.floorBgId)) { - return SurfaceType_GetConveyorSpeed(&sQuake2Context.globalCtx->colCtx, player->actor.floorPoly, +/** + * Checks that the bg surface is an underwater conveyor type and if so, returns the conveyor speed + */ +s32 Distortion_GetUnderwaterCurrentSpeed(Player* player) { + if (SurfaceType_GetConveyorType(&sDistortionContext.globalCtx->colCtx, player->actor.floorPoly, + player->actor.floorBgId) == CONVEYOR_WATER) { + return SurfaceType_GetConveyorSpeed(&sDistortionContext.globalCtx->colCtx, player->actor.floorPoly, player->actor.floorBgId); } return 0; } -void Quake2_Update(void) { - static s16 angle1 = 0x3F0; - static s16 angle2 = 0x156; +void Distortion_Update(void) { + static s16 depthPhase = 0x3F0; + static s16 screenPlanePhase = 0x156; static s16 countdownMax = 1; f32 xyScaleFactor; f32 zScaleFactor; f32 speedScaleFactor; f32 countdownRatio; f32 waterYScaleFactor; - f32 angle1Speed; - f32 angle2Speed; + f32 depthPhaseStep; + f32 screenPlanePhaseStep; f32 rotX; f32 rotY; f32 rotZ; @@ -442,181 +446,210 @@ void Quake2_Update(void) { f32 zScale; f32 speed; Player* player; - GlobalContext* globalCtx = sQuake2Context.globalCtx; + GlobalContext* globalCtx = sDistortionContext.globalCtx; PosRot playerPosRot; Camera* camera = GET_ACTIVE_CAM(globalCtx); f32 speedRatio = CLAMP_MAX(camera->speedRatio, 1.0f); - if (sQuake2Context.type != 0) { - if (sQuake2Context.type & 0x800) { - sQuake2Context.countdown = 2; - angle1 = 0x3F0; - angle2 = 0x156; - angle1Speed = 0.0f; - angle2Speed = 170.0f; + if (sDistortionContext.type != 0) { + if (sDistortionContext.type & 0x800) { + sDistortionContext.countdown = 2; + depthPhase = 0x3F0; + screenPlanePhase = 0x156; + + depthPhaseStep = 0.0f; + screenPlanePhaseStep = 170.0f; + rotX = 0.0f; rotY = 0.0f; rotZ = 0.0f; + xScale = -0.01f; yScale = 0.01f; zScale = 0.0f; + speed = 0.6f; - xyScaleFactor = zScaleFactor = sQuake2Context.countdown / 60.0f; + xyScaleFactor = zScaleFactor = sDistortionContext.countdown / 60.0f; speedScaleFactor = 1.0f; - } else if (sQuake2Context.type & 0x400) { - if (sQuake2Context.state == QUAKE2_SETUP) { - countdownMax = sQuake2Context.countdown; - angle1 = 0x3F0; - angle2 = 0x156; + } else if (sDistortionContext.type & 0x400) { + if (sDistortionContext.state == DISTORTION_SETUP) { + countdownMax = sDistortionContext.countdown; + depthPhase = 0x3F0; + screenPlanePhase = 0x156; } - angle1Speed = 0.0f; - angle2Speed = 50.0f / countdownMax; + depthPhaseStep = 0.0f; + screenPlanePhaseStep = 50.0f / countdownMax; + rotX = 0.0f; rotY = 0.0f; rotZ = 0.0f; + xScale = 0.01f; yScale = 100.0f; zScale = 0.0f; + speed = 0.4f; - xyScaleFactor = zScaleFactor = ((f32)countdownMax - sQuake2Context.countdown) / (f32)countdownMax; + xyScaleFactor = zScaleFactor = ((f32)countdownMax - sDistortionContext.countdown) / (f32)countdownMax; speedScaleFactor = 0.5f; - } else if (sQuake2Context.type & 0x200) { - if (sQuake2Context.state == QUAKE2_SETUP) { - countdownMax = sQuake2Context.countdown; - angle1 = 0x1FC; - angle2 = 0x156; + } else if (sDistortionContext.type & 0x200) { + if (sDistortionContext.state == DISTORTION_SETUP) { + countdownMax = sDistortionContext.countdown; + depthPhase = 0x1FC; + screenPlanePhase = 0x156; } - angle1Speed = -5.0f; - angle2Speed = 5.0f; + depthPhaseStep = -5.0f; + screenPlanePhaseStep = 5.0f; + rotX = 0.0f; rotY = 0.0f; rotZ = 2.0f; + xScale = 0.3f; yScale = 0.3f; zScale = 0.0f; + speed = 0.1f; - xyScaleFactor = zScaleFactor = ((f32)countdownMax - sQuake2Context.countdown) / (f32)countdownMax; + xyScaleFactor = zScaleFactor = ((f32)countdownMax - sDistortionContext.countdown) / (f32)countdownMax; speedScaleFactor = 1.0f; - } else if (sQuake2Context.type & 0x100) { - if (sQuake2Context.state == QUAKE2_SETUP) { - countdownMax = sQuake2Context.countdown; - angle1 = 0x2710; - angle2 = 0x3E8; + } else if (sDistortionContext.type & 0x100) { + if (sDistortionContext.state == DISTORTION_SETUP) { + countdownMax = sDistortionContext.countdown; + depthPhase = 0x2710; + screenPlanePhase = 0x3E8; } - angle1Speed = 0.0f; - angle2Speed = 150.0f; + depthPhaseStep = 0.0f; + screenPlanePhaseStep = 150.0f; + rotX = 0; rotY = 0; rotZ = 0.2f; + xScale = 0.025f; yScale = 0.02f; zScale = 0.01f; + speed = 1.5f; - if (sQuake2Context.countdown < 5) { - xyScaleFactor = zScaleFactor = ((f32)countdownMax - sQuake2Context.countdown) / (f32)countdownMax; + if (sDistortionContext.countdown < 5) { + xyScaleFactor = zScaleFactor = ((f32)countdownMax - sDistortionContext.countdown) / (f32)countdownMax; } else { xyScaleFactor = zScaleFactor = 0.0f; } speedScaleFactor = 1.0f; - } else if (sQuake2Context.type & 0x80) { - if (sQuake2Context.state == QUAKE2_SETUP) { - countdownMax = sQuake2Context.countdown; - angle1 = 0x4B0; - angle2 = 0x7D0; + } else if (sDistortionContext.type & 0x80) { + if (sDistortionContext.state == DISTORTION_SETUP) { + countdownMax = sDistortionContext.countdown; + depthPhase = 0x4B0; + screenPlanePhase = 0x7D0; } - angle1Speed = 0.0f; - angle2Speed = 150.0f; + depthPhaseStep = 0.0f; + screenPlanePhaseStep = 150.0f; + rotX = 0; rotY = 0; rotZ = 0; + xScale = 0.03f; yScale = 0.02f; zScale = 0.01f; + speed = 1.5f; - xyScaleFactor = zScaleFactor = sQuake2Context.countdown / (f32)countdownMax; + xyScaleFactor = zScaleFactor = sDistortionContext.countdown / (f32)countdownMax; speedScaleFactor = 1.0f; - } else if (sQuake2Context.type & 0x40) { - if (sQuake2Context.state == QUAKE2_SETUP) { - countdownMax = sQuake2Context.countdown; - angle1 = 0x9C4; - angle2 = 0xBB8; + } else if (sDistortionContext.type & 0x40) { + if (sDistortionContext.state == DISTORTION_SETUP) { + countdownMax = sDistortionContext.countdown; + depthPhase = 0x9C4; + screenPlanePhase = 0xBB8; } - angle1Speed = 0.0f; - angle2Speed = 150.0f; + depthPhaseStep = 0.0f; + screenPlanePhaseStep = 150.0f; + rotX = 0; rotY = 0; rotZ = 0; + xScale = 0.03f; yScale = 0.03f; zScale = 0.01f; + speed = 1.3f; - if (sQuake2Context.countdown < 4) { - xyScaleFactor = zScaleFactor = sQuake2Context.countdown / (f32)countdownMax; + if (sDistortionContext.countdown < 4) { + xyScaleFactor = zScaleFactor = sDistortionContext.countdown / (f32)countdownMax; } else { xyScaleFactor = zScaleFactor = 0.0f; } speedScaleFactor = 1.0f; - } else if (sQuake2Context.type & 0x20) { - sQuake2Context.countdown = 2; - if (sQuake2Context.state == QUAKE2_SETUP) { - angle1 = 0x9C4; - angle2 = 0xBB8; + } else if (sDistortionContext.type & 0x20) { + sDistortionContext.countdown = 2; + if (sDistortionContext.state == DISTORTION_SETUP) { + depthPhase = 0x9C4; + screenPlanePhase = 0xBB8; } - angle1 += 0xB1; - angle2 -= 0x2B; - angle1Speed = -107.0f; - angle2Speed = 158.0f; + depthPhase += 0xB1; + screenPlanePhase -= 0x2B; + + depthPhaseStep = -107.0f; + screenPlanePhaseStep = 158.0f; + rotX = 0.2f; rotY = 1.7f; rotZ = -2.9f; + xScale = -0.6f; yScale = -0.7f; zScale = 0.6f; + speed = 0.2f; zScaleFactor = 1.0f; xyScaleFactor = 1.0f; speedScaleFactor = 1.0f; - } else if (sQuake2Context.type & 0x10) { - if (sQuake2Context.state == QUAKE2_SETUP) { - countdownMax = sQuake2Context.countdown; - angle1 = 0x760; - angle2 = 0x1BC; + } else if (sDistortionContext.type & 0x10) { + if (sDistortionContext.state == DISTORTION_SETUP) { + countdownMax = sDistortionContext.countdown; + depthPhase = 0x760; + screenPlanePhase = 0x1BC; } - angle1Speed = 248.0f; - angle2Speed = -90.0f; + depthPhaseStep = 248.0f; + screenPlanePhaseStep = -90.0f; + rotX = 0.0f; rotY = 0.0f; rotZ = 0.0f; + xScale = -0.4f; yScale = 0.4f; zScale = 0.2f; + speed = 0.25f; - countdownRatio = sQuake2Context.countdown / (f32)countdownMax; + countdownRatio = sDistortionContext.countdown / (f32)countdownMax; zScaleFactor = xyScaleFactor = countdownRatio; speedScaleFactor = 1.0f; - } else if (sQuake2Context.type & 8) { - angle1 = 0x3F0; - angle2 = 0x156; - sQuake2Context.countdown = 2; + } else if (sDistortionContext.type & 8) { + depthPhase = 0x3F0; + screenPlanePhase = 0x156; + + sDistortionContext.countdown = 2; player = GET_PLAYER(globalCtx); if (&player->actor != NULL) { Actor_GetWorldPosShapeRot(&playerPosRot, &player->actor); } - angle1Speed = 359.2f; - angle2Speed = -18.5f; + depthPhaseStep = 359.2f; + screenPlanePhaseStep = -18.5f; + rotX = 0.0f; rotY = 0.0f; rotZ = 0.3f; - switch (Quake2_GetFloorQuake(player)) { + + switch (Distortion_GetUnderwaterCurrentSpeed(player)) { case 3: xScale = -0.06f; yScale = 0.1f; @@ -650,17 +683,20 @@ void Quake2_Update(void) { } zScaleFactor = -xyScaleFactor; speedScaleFactor = 1.0f; - } else if (sQuake2Context.type & 4) { - angle1 = 0x3F0; - angle2 = 0x156; - sQuake2Context.countdown = 2; + } else if (sDistortionContext.type & 4) { + depthPhase = 0x3F0; + screenPlanePhase = 0x156; + + sDistortionContext.countdown = 2; player = GET_PLAYER(globalCtx); - angle1Speed = 359.2f; - angle2Speed = -18.5f; + + depthPhaseStep = 359.2f; + screenPlanePhaseStep = -18.5f; + rotX = 0.0f; rotY = 0.0f; rotZ = 0.0f; - switch (Quake2_GetFloorQuake(player)) { + switch (Distortion_GetUnderwaterCurrentSpeed(player)) { case 3: xScale = 0.12f; yScale = 0.12f; @@ -695,18 +731,23 @@ void Quake2_Update(void) { xyScaleFactor = speedScaleFactor = (waterYScaleFactor * 0.15f) + 0.35f + (speedRatio * 0.4f); zScaleFactor = 0.9f - xyScaleFactor; - } else if (sQuake2Context.type & 1) { - angle1 = 0x3F0; - angle2 = 0x156; - sQuake2Context.countdown = 2; - angle1Speed = 0.0f; - angle2Speed = 150.0f; + } else if (sDistortionContext.type & 1) { + // Gives a small mirage-like appearance + depthPhase = 0x3F0; + screenPlanePhase = 0x156; + + sDistortionContext.countdown = 2; + depthPhaseStep = 0.0f; + screenPlanePhaseStep = 150.0f; + rotX = 0.0f; rotY = 0.0f; rotZ = 0.0f; + xScale = -0.01f; yScale = 0.01f; zScale = 0.01f; + speed = 0.6f; speedScaleFactor = 1.0f; zScaleFactor = 1.0f; @@ -715,26 +756,32 @@ void Quake2_Update(void) { return; } - angle1 += DEGF_TO_BINANG(angle1Speed); - angle2 += DEGF_TO_BINANG(angle2Speed); - View_SetQuakeRotation(&sQuake2Context.globalCtx->view, Math_CosS(angle1) * (DEGF_TO_RADF(rotX) * xyScaleFactor), - Math_SinS(angle1) * (DEGF_TO_RADF(rotY) * xyScaleFactor), - Math_SinS(angle2) * (DEGF_TO_RADF(rotZ) * zScaleFactor)); - View_SetQuakeScale(&sQuake2Context.globalCtx->view, (Math_SinS(angle2) * (xScale * xyScaleFactor)) + 1.0f, - (Math_CosS(angle2) * (yScale * xyScaleFactor)) + 1.0f, - (Math_CosS(angle1) * (zScale * zScaleFactor)) + 1.0f); - View_SetQuakeSpeed(&sQuake2Context.globalCtx->view, speed * speedScaleFactor); - sQuake2Context.state = QUAKE2_ACTIVE; - } else if (sQuake2Context.state != QUAKE2_INACTIVE) { - View_ClearQuake(&globalCtx->view); - sQuake2Context.state = QUAKE2_INACTIVE; - sQuake2Context.countdown = 0; + depthPhase += DEGF_TO_BINANG(depthPhaseStep); + screenPlanePhase += DEGF_TO_BINANG(screenPlanePhaseStep); + + View_SetDistortionDirRot(&sDistortionContext.globalCtx->view, + Math_CosS(depthPhase) * (DEGF_TO_RADF(rotX) * xyScaleFactor), + Math_SinS(depthPhase) * (DEGF_TO_RADF(rotY) * xyScaleFactor), + Math_SinS(screenPlanePhase) * (DEGF_TO_RADF(rotZ) * zScaleFactor)); + View_SetDistortionScale(&sDistortionContext.globalCtx->view, + (Math_SinS(screenPlanePhase) * (xScale * xyScaleFactor)) + 1.0f, + (Math_CosS(screenPlanePhase) * (yScale * xyScaleFactor)) + 1.0f, + (Math_CosS(depthPhase) * (zScale * zScaleFactor)) + 1.0f); + View_SetDistortionSpeed(&sDistortionContext.globalCtx->view, speed * speedScaleFactor); + + sDistortionContext.state = DISTORTION_ACTIVE; + + } else if (sDistortionContext.state != DISTORTION_INACTIVE) { + View_ClearDistortion(&globalCtx->view); + + sDistortionContext.state = DISTORTION_INACTIVE; + sDistortionContext.countdown = 0; } - if (sQuake2Context.countdown != 0) { - sQuake2Context.countdown--; - if (sQuake2Context.countdown == 0) { - sQuake2Context.type = 0; + if (sDistortionContext.countdown != 0) { + sDistortionContext.countdown--; + if (sDistortionContext.countdown == 0) { + sDistortionContext.type = 0; } } } diff --git a/src/code/z_view.c b/src/code/z_view.c index da2e3593b..d11a18201 100644 --- a/src/code/z_view.c +++ b/src/code/z_view.c @@ -43,7 +43,7 @@ void View_Init(View* view, GraphicsContext* gfxCtx) { view->zFar = 12800.0f; view->eye.z = -1.0f; - View_InitCameraQuake(view); + View_InitDistortion(view); } void View_SetViewOrientation(View* view, Vec3f* eye, Vec3f* at, Vec3f* up) { @@ -187,87 +187,93 @@ void View_SetScissorForLetterbox(View* view) { CLOSE_DISPS(view->gfxCtx); } -s32 View_SetQuakeRotation(View* view, f32 x, f32 y, f32 z) { - view->quakeRot.x = x; - view->quakeRot.y = y; - view->quakeRot.z = z; +s32 View_SetDistortionDirRot(View* view, f32 dirRotX, f32 dirRotY, f32 dirRotZ) { + view->distortionDirRot.x = dirRotX; + view->distortionDirRot.y = dirRotY; + view->distortionDirRot.z = dirRotZ; return 1; } -s32 View_SetQuakeScale(View* view, f32 x, f32 y, f32 z) { - view->quakeScale.x = x; - view->quakeScale.y = y; - view->quakeScale.z = z; +s32 View_SetDistortionScale(View* view, f32 scaleX, f32 scaleY, f32 scaleZ) { + view->distortionScale.x = scaleX; + view->distortionScale.y = scaleY; + view->distortionScale.z = scaleZ; return 1; } -s32 View_SetQuakeSpeed(View* view, f32 speed) { - view->quakeSpeed = speed; +s32 View_SetDistortionSpeed(View* view, f32 speed) { + view->distortionSpeed = speed; return 1; } -s32 View_InitCameraQuake(View* view) { - view->quakeRot.x = 0.0f; - view->quakeRot.y = 0.0f; - view->quakeRot.z = 0.0f; - view->quakeScale.x = 1.0f; - view->quakeScale.y = 1.0f; - view->quakeScale.z = 1.0f; - view->currQuakeRot = view->quakeRot; - view->currQuakeScale = view->quakeScale; - view->quakeSpeed = 0.0f; +s32 View_InitDistortion(View* view) { + view->distortionDirRot.x = 0.0f; + view->distortionDirRot.y = 0.0f; + view->distortionDirRot.z = 0.0f; + view->distortionScale.x = 1.0f; + view->distortionScale.y = 1.0f; + view->distortionScale.z = 1.0f; + view->curDistortionDirRot = view->distortionDirRot; + view->curDistortionScale = view->distortionScale; + view->distortionSpeed = 0.0f; return 1; } -s32 View_ClearQuake(View* view) { - view->quakeRot.x = 0.0f; - view->quakeRot.y = 0.0f; - view->quakeRot.z = 0.0f; - view->quakeScale.x = 1.0f; - view->quakeScale.y = 1.0f; - view->quakeScale.z = 1.0f; - view->quakeSpeed = 1.0f; +s32 View_ClearDistortion(View* view) { + view->distortionDirRot.x = 0.0f; + view->distortionDirRot.y = 0.0f; + view->distortionDirRot.z = 0.0f; + view->distortionScale.x = 1.0f; + view->distortionScale.y = 1.0f; + view->distortionScale.z = 1.0f; + view->distortionSpeed = 1.0f; return 1; } -s32 View_SetQuake(View* view, Vec3f rot, Vec3f scale, f32 speed) { - view->quakeRot = rot; - view->quakeScale = scale; - view->quakeSpeed = speed; +s32 View_SetDistortion(View* view, Vec3f dirRot, Vec3f scale, f32 speed) { + view->distortionDirRot = dirRot; + view->distortionScale = scale; + view->distortionSpeed = speed; return 1; } -s32 View_StepQuake(View* view, Mtx* matrix) { - MtxF mf; +s32 View_StepDistortion(View* view, Mtx* projectionMtx) { + MtxF projectionMtxF; - if (view->quakeSpeed == 0.0f) { - return 0; - } else if (view->quakeSpeed == 1.0f) { - view->currQuakeRot = view->quakeRot; - view->currQuakeScale = view->quakeScale; - view->quakeSpeed = 0.0f; + if (view->distortionSpeed == 0.0f) { + return false; + } else if (view->distortionSpeed == 1.0f) { + view->curDistortionDirRot = view->distortionDirRot; + view->curDistortionScale = view->distortionScale; + view->distortionSpeed = 0.0f; } else { - view->currQuakeRot.x += ((view->quakeRot.x - view->currQuakeRot.x) * view->quakeSpeed); - view->currQuakeRot.y += ((view->quakeRot.y - view->currQuakeRot.y) * view->quakeSpeed); - view->currQuakeRot.z += ((view->quakeRot.z - view->currQuakeRot.z) * view->quakeSpeed); + view->curDistortionDirRot.x = + F32_LERPIMP(view->curDistortionDirRot.x, view->distortionDirRot.x, view->distortionSpeed); + view->curDistortionDirRot.y = + F32_LERPIMP(view->curDistortionDirRot.y, view->distortionDirRot.y, view->distortionSpeed); + view->curDistortionDirRot.z = + F32_LERPIMP(view->curDistortionDirRot.z, view->distortionDirRot.z, view->distortionSpeed); - view->currQuakeScale.x += ((view->quakeScale.x - view->currQuakeScale.x) * view->quakeSpeed); - view->currQuakeScale.y += ((view->quakeScale.y - view->currQuakeScale.y) * view->quakeSpeed); - view->currQuakeScale.z += ((view->quakeScale.z - view->currQuakeScale.z) * view->quakeSpeed); + view->curDistortionScale.x = + F32_LERPIMP(view->curDistortionScale.x, view->distortionScale.x, view->distortionSpeed); + view->curDistortionScale.y = + F32_LERPIMP(view->curDistortionScale.y, view->distortionScale.y, view->distortionSpeed); + view->curDistortionScale.z = + F32_LERPIMP(view->curDistortionScale.z, view->distortionScale.z, view->distortionSpeed); } - Matrix_FromRSPMatrix(matrix, &mf); - Matrix_SetCurrentState(&mf); - Matrix_RotateStateAroundXAxis(view->currQuakeRot.x); - Matrix_InsertYRotation_f(view->currQuakeRot.y, MTXMODE_APPLY); - Matrix_InsertZRotation_f(view->currQuakeRot.z, MTXMODE_APPLY); - Matrix_Scale(view->currQuakeScale.x, view->currQuakeScale.y, view->currQuakeScale.z, MTXMODE_APPLY); - Matrix_InsertZRotation_f(-view->currQuakeRot.z, MTXMODE_APPLY); - Matrix_InsertYRotation_f(-view->currQuakeRot.y, MTXMODE_APPLY); - Matrix_RotateStateAroundXAxis(-view->currQuakeRot.x); - Matrix_ToMtx(matrix); + Matrix_FromRSPMatrix(projectionMtx, &projectionMtxF); + Matrix_SetCurrentState(&projectionMtxF); + Matrix_RotateStateAroundXAxis(view->curDistortionDirRot.x); + Matrix_InsertYRotation_f(view->curDistortionDirRot.y, MTXMODE_APPLY); + Matrix_InsertZRotation_f(view->curDistortionDirRot.z, MTXMODE_APPLY); + Matrix_Scale(view->curDistortionScale.x, view->curDistortionScale.y, view->curDistortionScale.z, MTXMODE_APPLY); + Matrix_InsertZRotation_f(-view->curDistortionDirRot.z, MTXMODE_APPLY); + Matrix_InsertYRotation_f(-view->curDistortionDirRot.y, MTXMODE_APPLY); + Matrix_RotateStateAroundXAxis(-view->curDistortionDirRot.x); + Matrix_ToMtx(projectionMtx); - return 1; + return true; } void View_RenderView(View* view, s32 uParm2) { @@ -309,8 +315,8 @@ s32 View_RenderToPerspectiveMatrix(View* view) { guPerspective(projection, &view->normal, view->fovy, aspect, view->zNear, view->zFar, view->scale); view->projection = *projection; - //! @bug: This cast of `projection` is invalid - View_StepQuake(view, (Mtx*)projection); + + View_StepDistortion(view, projection); gSPPerspNormalize(POLY_OPA_DISP++, view->normal); gSPMatrix(POLY_OPA_DISP++, projection, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); diff --git a/src/libultra/io/contramread.c b/src/libultra/io/contramread.c index 420be9d89..d993b47d7 100644 --- a/src/libultra/io/contramread.c +++ b/src/libultra/io/contramread.c @@ -1,3 +1,63 @@ #include "global.h" -#pragma GLOBAL_ASM("asm/non_matchings/boot/contramread/__osContRamRead.s") +#define BLOCKSIZE 32 + +s32 __osPfsLastChannel = -1; + +s32 __osContRamRead(OSMesgQueue* ctrlrqueue, s32 channel, u16 addr, u8* buffer) { + s32 ret; + s32 i; + u8* bufptr; + s32 retryCount = 2; + + __osSiGetAccess(); + do { + bufptr = (u8*)&__osPfsPifRam; + + if ((__osContLastPoll != 2) || (__osPfsLastChannel != channel)) { + __osContLastPoll = 2; + __osPfsLastChannel = channel; + // clang-format off + for (i = 0; i < channel; i++) { *bufptr++ = 0; } + // clang-format on + __osPfsPifRam.status = 1; + ((__OSContRamReadFormat*)bufptr)->dummy = 0xFF; + ((__OSContRamReadFormat*)bufptr)->txsize = 3; + ((__OSContRamReadFormat*)bufptr)->rxsize = 0x21; + ((__OSContRamReadFormat*)bufptr)->cmd = CONT_CMD_READ_MEMPACK; // read mempak; send byte 0 + ((__OSContRamReadFormat*)bufptr)->datacrc = 0xFF; // read mempak; send byte 0 + // Received bytes are 6-26 inclusive + bufptr[sizeof(__OSContRamReadFormat)] = CONT_CMD_END; // End of commands + } else { + bufptr += channel; + } + + ((__OSContRamReadFormat*)bufptr)->hi = addr >> 3; // send byte 1 + ((__OSContRamReadFormat*)bufptr)->lo = (s8)(__osContAddressCrc(addr) | (addr << 5)); // send byte 2 + __osSiRawStartDma(OS_WRITE, &__osPfsPifRam); + osRecvMesg(ctrlrqueue, NULL, OS_MESG_BLOCK); + __osSiRawStartDma(OS_READ, &__osPfsPifRam); + osRecvMesg(ctrlrqueue, NULL, OS_MESG_BLOCK); + + ret = (((__OSContRamReadFormat*)bufptr)->rxsize & 0xC0) >> 4; + if (!ret) { + if (((__OSContRamReadFormat*)bufptr)->datacrc != __osContDataCrc(bufptr + 6)) { + ret = __osPfsGetStatus(ctrlrqueue, channel); + if (ret) { + break; + } + ret = 4; // Retry + } else { + bcopy(bufptr + 6, buffer, BLOCKSIZE); + } + } else { + ret = 1; // Error + } + if (ret != 4) { + break; + } + } while (0 <= retryCount--); + __osSiRelAccess(); + + return ret; +} diff --git a/src/libultra/io/contramwrite.c b/src/libultra/io/contramwrite.c index e6f96b1ef..b2157a2a5 100644 --- a/src/libultra/io/contramwrite.c +++ b/src/libultra/io/contramwrite.c @@ -1,3 +1,68 @@ +#include "ultra64.h" #include "global.h" -#pragma GLOBAL_ASM("asm/non_matchings/boot/contramwrite/__osContRamWrite.s") +s32 __osContRamWrite(OSMesgQueue* mq, s32 channel, u16 address, u8* buffer, s32 force) { + s32 ret = 0; + s32 i; + u8* ptr; + s32 retry = 2; + u8 crc; + + if ((force != PFS_FORCE) && (address < PFS_LABEL_AREA) && (address != 0)) { + return 0; + } + + __osSiGetAccess(); + + do { + ptr = (u8*)(&__osPfsPifRam); + + if (__osContLastPoll != CONT_CMD_WRITE_MEMPACK || __osPfsLastChannel != channel) { + __osContLastPoll = CONT_CMD_WRITE_MEMPACK; + __osPfsLastChannel = channel; + + // clang-format off + for (i = 0; i < channel; i++) { *ptr++ = 0; } + // clang-format on + + __osPfsPifRam.status = 1; + + ((__OSContRamReadFormat*)ptr)->dummy = 0xFF; + ((__OSContRamReadFormat*)ptr)->txsize = 35; + ((__OSContRamReadFormat*)ptr)->rxsize = 1; + ((__OSContRamReadFormat*)ptr)->cmd = CONT_CMD_WRITE_MEMPACK; + ((__OSContRamReadFormat*)ptr)->datacrc = 0xFF; + + ptr[sizeof(__OSContRamReadFormat)] = CONT_CMD_END; + } else { + ptr += channel; + } + ((__OSContRamReadFormat*)ptr)->hi = address >> 3; + ((__OSContRamReadFormat*)ptr)->lo = ((address << 5) | __osContAddressCrc(address)); + + bcopy(buffer, ((__OSContRamReadFormat*)ptr)->data, BLOCKSIZE); + + ret = __osSiRawStartDma(OS_WRITE, &__osPfsPifRam); + crc = __osContDataCrc(buffer); + osRecvMesg(mq, (OSMesg*)NULL, OS_MESG_BLOCK); + + ret = __osSiRawStartDma(OS_READ, &__osPfsPifRam); + osRecvMesg(mq, (OSMesg*)NULL, OS_MESG_BLOCK); + + ret = ((((__OSContRamReadFormat*)ptr)->rxsize & 0xC0) >> 4); + if (!ret) { + if (crc != ((__OSContRamReadFormat*)ptr)->datacrc) { + if ((ret = __osPfsGetStatus(mq, channel))) { + break; + } else { + ret = PFS_ERR_CONTRFAIL; + } + } + } else { + ret = PFS_ERR_NOPACK; + } + } while ((ret == PFS_ERR_CONTRFAIL) && (retry-- >= 0)); + __osSiRelAccess(); + + return ret; +} diff --git a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c index 104597698..1b60a4147 100644 --- a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c +++ b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c @@ -5,6 +5,8 @@ */ #include "z_arms_hook.h" +#include "objects/gameplay_keep/gameplay_keep.h" +#include "objects/object_link_child/object_link_child.h" #define FLAGS 0x00000030 @@ -50,8 +52,6 @@ static ColliderQuadInit D_808C1BC0 = { { { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } }, }; -extern Gfx D_0601D960[]; - void ArmsHook_SetupAction(ArmsHook* this, ArmsHookActionFunc actionFunc) { this->actionFunc = actionFunc; } @@ -323,7 +323,7 @@ void ArmsHook_Draw(Actor* thisx, GlobalContext* globalCtx) { func_80122868(globalCtx, player); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, D_0601D960); + gSPDisplayList(POLY_OPA_DISP++, object_link_child_DL_01D960); Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW); Math_Vec3f_Diff(&player->rightHandWorld.pos, &this->actor.world.pos, &sp68); @@ -334,7 +334,7 @@ void ArmsHook_Draw(Actor* thisx, GlobalContext* globalCtx) { f0 = sqrtf(SQ(sp68.y) + sp48); Matrix_Scale(0.015f, 0.015f, f0 * 0.01f, MTXMODE_APPLY); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, D_040008D0); + gSPDisplayList(POLY_OPA_DISP++, gameplay_keep_DL_0008D0); func_801229A0(globalCtx, player); CLOSE_DISPS(globalCtx->state.gfxCtx); diff --git a/src/overlays/actors/ovl_Bg_Ctower_Gear/z_bg_ctower_gear.c b/src/overlays/actors/ovl_Bg_Ctower_Gear/z_bg_ctower_gear.c index 5ce8f18e9..a504db3f9 100644 --- a/src/overlays/actors/ovl_Bg_Ctower_Gear/z_bg_ctower_gear.c +++ b/src/overlays/actors/ovl_Bg_Ctower_Gear/z_bg_ctower_gear.c @@ -5,20 +5,12 @@ */ #include "z_bg_ctower_gear.h" +#include "objects/object_ctower_rot/object_ctower_rot.h" #define FLAGS 0x00000010 #define THIS ((BgCtowerGear*)thisx) -#define BGCTOWERGEAR_GET_TYPE(this) (((BgCtowerGear*)this)->dyna.actor.params & 3) - -typedef enum { - /* 0x00 */ CEILING_COG, - /* 0x01 */ CENTER_COG, - /* 0x02 */ WATER_WHEEL, - /* 0x03 */ ORGAN -} BgCtowerGearType; - void BgCtowerGear_Init(Actor* thisx, GlobalContext* globalCtx); void BgCtowerGear_Destroy(Actor* thisx, GlobalContext* globalCtx); void BgCtowerGear_Update(Actor* thisx, GlobalContext* globalCtx); @@ -39,19 +31,14 @@ const ActorInit Bg_Ctower_Gear_InitVars = { (ActorFunc)BgCtowerGear_Draw, }; -extern Gfx D_06010828[]; -extern Gfx D_06015F30[]; -extern Gfx D_060160A0[]; -extern CollisionHeader D_06016E70; -extern Gfx D_06017018[]; -extern Gfx D_06018118[]; -extern CollisionHeader D_06018588; - -static Vec3f D_80AD3270[] = { - { -70.0f, -60.0f, 8.0f }, { -60.0f, -60.0f, -9.1f }, { -75.0f, -60.0f, -9.1f }, { -70.0f, -60.0f, -26.2f } +static Vec3f sExitSplashOffsets[] = { + { -70.0f, -60.0f, 8.0f }, + { -60.0f, -60.0f, -9.1f }, + { -75.0f, -60.0f, -9.1f }, + { -70.0f, -60.0f, -26.2f }, }; -static Vec3f D_80AD32A0[] = { +static Vec3f sEnterSplashOffsets[] = { { 85.0f, -60.0f, 8.0f }, { 80.0f, -60.0f, -9.1f }, { 85.0f, -60.0f, -26.2f }, @@ -75,28 +62,26 @@ static InitChainEntry sInitChainOrgan[] = { ICHAIN_F32(uncullZoneDownward, 570, ICHAIN_STOP), }; -static Gfx* D_80AD32E8[] = { D_06010828, D_06017018, D_06018118 }; +static Gfx* sDLists[] = { gClockTowerCeilingCogDL, gClockTowerCenterCogDL, gClockTowerWaterWheelDL }; void BgCtowerGear_Splash(BgCtowerGear* this, GlobalContext* globalCtx) { - int i; - s32 flags; + s32 i; + s32 flag40 = this->dyna.actor.flags & 0x40; Vec3f splashSpawnPos; Vec3f splashOffset; s32 pad; - int j; - s16 rotZ; + s32 j; + s16 rotZ = this->dyna.actor.shape.rot.z & 0x1FFF; - flags = this->dyna.actor.flags & 0x40; - rotZ = this->dyna.actor.shape.rot.z & 0x1FFF; - if ((flags != 0) && (rotZ < 0x1B58) && (rotZ >= 0x1388)) { + if (flag40 && (rotZ < 0x1B58) && (rotZ >= 0x1388)) { Matrix_RotateY(this->dyna.actor.home.rot.y, MTXMODE_NEW); Matrix_InsertXRotation_s(this->dyna.actor.home.rot.x, MTXMODE_APPLY); Matrix_InsertZRotation_s(this->dyna.actor.home.rot.z, MTXMODE_APPLY); for (i = 0; i < 4; i++) { if ((u32)Rand_Next() >= 0x40000000) { - splashOffset.x = D_80AD3270[i].x - (Rand_ZeroOne() * 30.0f); - splashOffset.y = D_80AD3270[i].y; - splashOffset.z = D_80AD3270[i].z; + splashOffset.x = sExitSplashOffsets[i].x - (Rand_ZeroOne() * 30.0f); + splashOffset.y = sExitSplashOffsets[i].y; + splashOffset.z = sExitSplashOffsets[i].z; Matrix_MultiplyVector3fByState(&splashOffset, &splashSpawnPos); splashSpawnPos.x += this->dyna.actor.world.pos.x + ((Rand_ZeroOne() * 20.0f) - 10.0f); splashSpawnPos.y += this->dyna.actor.world.pos.y; @@ -106,15 +91,15 @@ void BgCtowerGear_Splash(BgCtowerGear* this, GlobalContext* globalCtx) { } } if ((rotZ < 0x1F4) && (rotZ >= 0)) { - if (flags != 0) { + if (flag40) { Matrix_RotateY(this->dyna.actor.home.rot.y, MTXMODE_NEW); Matrix_InsertXRotation_s(this->dyna.actor.home.rot.x, MTXMODE_APPLY); Matrix_InsertZRotation_s(this->dyna.actor.home.rot.z, MTXMODE_APPLY); for (i = 0; i < 3; i++) { for (j = 0; j < 2; j++) { - splashOffset.x = D_80AD32A0[i].x + (Rand_ZeroOne() * 10.0f); - splashOffset.y = D_80AD32A0[i].y; - splashOffset.z = D_80AD32A0[i].z; + splashOffset.x = sEnterSplashOffsets[i].x + (Rand_ZeroOne() * 10.0f); + splashOffset.y = sEnterSplashOffsets[i].y; + splashOffset.z = sEnterSplashOffsets[i].z; Matrix_MultiplyVector3fByState(&splashOffset, &splashSpawnPos); splashSpawnPos.x += this->dyna.actor.world.pos.x + ((Rand_ZeroOne() * 20.0f) - 10.0f); splashSpawnPos.y += this->dyna.actor.world.pos.y; @@ -129,50 +114,47 @@ void BgCtowerGear_Splash(BgCtowerGear* this, GlobalContext* globalCtx) { void BgCtowerGear_Init(Actor* thisx, GlobalContext* globalCtx) { BgCtowerGear* this = THIS; - s32 type; + s32 type = BGCTOWERGEAR_GET_TYPE(&this->dyna.actor); - type = BGCTOWERGEAR_GET_TYPE(this); Actor_SetScale(&this->dyna.actor, 0.1f); - if (type == CENTER_COG) { + if (type == BGCTOWERGEAR_CENTER_COG) { Actor_ProcessInitChain(&this->dyna.actor, sInitChainCenterCog); - } else if (type == ORGAN) { + } else if (type == BGCTOWERGEAR_ORGAN) { Actor_ProcessInitChain(&this->dyna.actor, sInitChainOrgan); this->dyna.actor.draw = NULL; this->dyna.actor.update = BgCtowerGear_UpdateOrgan; } else { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); } - if (type == WATER_WHEEL) { + if (type == BGCTOWERGEAR_WATER_WHEEL) { DynaPolyActor_Init(&this->dyna, 3); - DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06018588); - } else if (type == ORGAN) { + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &gClockTowerWaterWheelCol); + } else if (type == BGCTOWERGEAR_ORGAN) { DynaPolyActor_Init(&this->dyna, 0); - DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06016E70); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &gClockTowerOrganCol); func_800C62BC(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId); } } void BgCtowerGear_Destroy(Actor* thisx, GlobalContext* globalCtx) { BgCtowerGear* this = THIS; - s32 type; + s32 type = BGCTOWERGEAR_GET_TYPE(&this->dyna.actor); - type = BGCTOWERGEAR_GET_TYPE(this); - if ((type == WATER_WHEEL) || (type == ORGAN)) { + if ((type == BGCTOWERGEAR_WATER_WHEEL) || (type == BGCTOWERGEAR_ORGAN)) { DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId); } } void BgCtowerGear_Update(Actor* thisx, GlobalContext* globalCtx) { BgCtowerGear* this = THIS; - s32 type; + s32 type = BGCTOWERGEAR_GET_TYPE(&this->dyna.actor); - type = BGCTOWERGEAR_GET_TYPE(this); - if (type == CEILING_COG) { + if (type == BGCTOWERGEAR_CEILING_COG) { this->dyna.actor.shape.rot.x -= 0x1F4; - } else if (type == CENTER_COG) { + } else if (type == BGCTOWERGEAR_CENTER_COG) { this->dyna.actor.shape.rot.y += 0x1F4; func_800B9010(&this->dyna.actor, NA_SE_EV_WINDMILL_LEVEL - SFX_FLAG); - } else if (type == WATER_WHEEL) { + } else if (type == BGCTOWERGEAR_WATER_WHEEL) { this->dyna.actor.shape.rot.z -= 0x1F4; BgCtowerGear_Splash(this, globalCtx); } @@ -198,18 +180,17 @@ void BgCtowerGear_UpdateOrgan(Actor* thisx, GlobalContext* globalCtx) { } } -// Using BgCtowerGear *this = THIS causes regalloc issues void BgCtowerGear_Draw(Actor* thisx, GlobalContext* globalCtx) { - Gfx_DrawDListOpa(globalCtx, D_80AD32E8[BGCTOWERGEAR_GET_TYPE(thisx)]); + Gfx_DrawDListOpa(globalCtx, sDLists[BGCTOWERGEAR_GET_TYPE(thisx)]); } void BgCtowerGear_DrawOrgan(Actor* thisx, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx); func_8012C28C(globalCtx->state.gfxCtx); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, D_060160A0); + gSPDisplayList(POLY_OPA_DISP++, gClockTowerOrganDL); func_8012C2DC(globalCtx->state.gfxCtx); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_XLU_DISP++, D_06015F30); + gSPDisplayList(POLY_XLU_DISP++, gClockTowerOrganPipesDL); CLOSE_DISPS(globalCtx->state.gfxCtx); } diff --git a/src/overlays/actors/ovl_Bg_Ctower_Gear/z_bg_ctower_gear.h b/src/overlays/actors/ovl_Bg_Ctower_Gear/z_bg_ctower_gear.h index caf8d3508..5da321679 100644 --- a/src/overlays/actors/ovl_Bg_Ctower_Gear/z_bg_ctower_gear.h +++ b/src/overlays/actors/ovl_Bg_Ctower_Gear/z_bg_ctower_gear.h @@ -5,6 +5,16 @@ struct BgCtowerGear; + +#define BGCTOWERGEAR_GET_TYPE(thisx) ((thisx)->params & 3) + +typedef enum { + /* 0x00 */ BGCTOWERGEAR_CEILING_COG, + /* 0x01 */ BGCTOWERGEAR_CENTER_COG, + /* 0x02 */ BGCTOWERGEAR_WATER_WHEEL, + /* 0x03 */ BGCTOWERGEAR_ORGAN +} BgCtowerGearType; + typedef struct BgCtowerGear { /* 0x000 */ DynaPolyActor dyna; } BgCtowerGear; // size = 0x15C diff --git a/src/overlays/actors/ovl_Bg_Ctower_Rot/z_bg_ctower_rot.c b/src/overlays/actors/ovl_Bg_Ctower_Rot/z_bg_ctower_rot.c index 168690623..d12c26b8a 100644 --- a/src/overlays/actors/ovl_Bg_Ctower_Rot/z_bg_ctower_rot.c +++ b/src/overlays/actors/ovl_Bg_Ctower_Rot/z_bg_ctower_rot.c @@ -1,10 +1,11 @@ /* * File: z_bg_ctower_rot.c * Overlay: ovl_Bg_CtowerRot - * Description: Twisting path along with the Doors to Clock Tower + * Description: Twisting path along with the Stone Doors to Clock Tower */ #include "z_bg_ctower_rot.h" +#include "objects/object_ctower_rot/object_ctower_rot.h" #define FLAGS 0x00000030 @@ -32,39 +33,32 @@ const ActorInit Bg_Ctower_Rot_InitVars = { (ActorFunc)BgCtowerRot_Draw, }; -extern Gfx D_060129D0[]; -extern Gfx D_06012DA0[]; -extern CollisionHeader D_060142E8; -extern Gfx D_06017220[]; -extern CollisionHeader D_06017410; -extern Gfx D_060174E0[]; -extern CollisionHeader D_06017650; - static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), }; -static Gfx* bgCtowerRotDlists[] = { D_06012DA0, D_06017220, D_060174E0 }; +static Gfx* sDLists[] = { gClockTowerCorridorDL, gClockTowerStoneDoorMainDL, gClockTowerStoneDoorDL }; void BgCtowerRot_Init(Actor* thisx, GlobalContext* globalCtx) { - BgCtowerRot* this = THIS; s32 pad; + BgCtowerRot* this = THIS; Player* player; Vec3f offset; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyActor_Init(&this->dyna, 1); - if (this->dyna.actor.params == CORRIDOR) { - DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_060142E8); + if (this->dyna.actor.params == BGCTOWERROT_CORRIDOR) { + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &gClockTowerCorridorCol); this->actionFunc = BgCtowerRot_CorridorRotate; return; } + player = GET_PLAYER(globalCtx); - if (this->dyna.actor.params == MAIN_DOOR) { - DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06017410); + if (this->dyna.actor.params == BGCTOWERROT_STONE_DOOR_MAIN) { + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &gClockTowerStoneDoorMainCol); this->dyna.actor.world.rot.y = this->dyna.actor.shape.rot.y + 0x4000; } else { - DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06017650); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &gClockTowerStoneDoorCol); this->dyna.actor.world.rot.y = this->dyna.actor.shape.rot.y - 0x4000; } Actor_OffsetOfPointInActorCoords(&this->dyna.actor, &offset, &player->actor.world.pos); @@ -88,22 +82,18 @@ void BgCtowerRot_CorridorRotate(BgCtowerRot* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); Vec3f offset; f32 rotZ; - f32 offsetDiffZ; f32 rotZtmp; Actor_OffsetOfPointInActorCoords(&this->dyna.actor, &offset, &player->actor.world.pos); if (offset.z > 1100.0f) { rotZ = 0.0f; } else { - offsetDiffZ = 1100.0f - offset.z; - rotZtmp = (offsetDiffZ > 1000.0f) - ? 1000.0f - : offsetDiffZ; // Removing rotZtmp just causes regalloc issues and a missing instruction + rotZtmp = CLAMP_MAX(1100.0f - offset.z, 1000.0f); rotZ = rotZtmp; } - func_800DFAC8(globalCtx->cameraPtrs[0], 0x11); + func_800DFAC8(globalCtx->cameraPtrs[MAIN_CAM], 17); this->dyna.actor.shape.rot.z = rotZ * 16.384f; - if (globalCtx->csCtx.frames == 0x84) { + if (globalCtx->csCtx.frames == 132) { play_sound(NA_SE_SY_SPIRAL_DASH); } } @@ -113,12 +103,12 @@ void BgCtowerRot_DoorDoNothing(BgCtowerRot* this, GlobalContext* globalCtx) { void BgCtowerRot_DoorClose(BgCtowerRot* this, GlobalContext* globalCtx) { if (!Math_SmoothStepToF(&this->timer, 0.0f, 0.1f, 15.0f, 0.1f)) { - if (this->dyna.actor.params == MAIN_DOOR) { + if (this->dyna.actor.params == BGCTOWERROT_STONE_DOOR_MAIN) { Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_STONEDOOR_STOP); ActorCutscene_Stop(this->dyna.actor.cutscene); } this->actionFunc = BgCtowerRot_DoorDoNothing; - } else if (this->dyna.actor.params == 1) { + } else if (this->dyna.actor.params == BGCTOWERROT_STONE_DOOR_MAIN) { func_800B9010(&this->dyna.actor, NA_SE_EV_STONE_STATUE_OPEN - SFX_FLAG); } this->dyna.actor.world.pos.x = @@ -141,7 +131,7 @@ void BgCtowerRot_DoorIdle(BgCtowerRot* this, GlobalContext* globalCtx) { void BgCtowerRot_SetupDoorClose(BgCtowerRot* this, GlobalContext* globalCtx) { if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { - if (this->dyna.actor.params == MAIN_DOOR) { + if (this->dyna.actor.params == BGCTOWERROT_STONE_DOOR_MAIN) { ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); } this->actionFunc = BgCtowerRot_DoorClose; @@ -159,8 +149,8 @@ void BgCtowerRot_Update(Actor* thisx, GlobalContext* globalCtx) { void BgCtowerRot_Draw(Actor* thisx, GlobalContext* globalCtx) { BgCtowerRot* this = THIS; - Gfx_DrawDListOpa(globalCtx, bgCtowerRotDlists[this->dyna.actor.params]); - if (this->dyna.actor.params == CORRIDOR) { - Gfx_DrawDListXlu(globalCtx, D_060129D0); + Gfx_DrawDListOpa(globalCtx, sDLists[this->dyna.actor.params]); + if (this->dyna.actor.params == BGCTOWERROT_CORRIDOR) { + Gfx_DrawDListXlu(globalCtx, gClockTowerCorridorFoliageDL); } } diff --git a/src/overlays/actors/ovl_Bg_Ctower_Rot/z_bg_ctower_rot.h b/src/overlays/actors/ovl_Bg_Ctower_Rot/z_bg_ctower_rot.h index 78ff6744b..b8b0dbfb0 100644 --- a/src/overlays/actors/ovl_Bg_Ctower_Rot/z_bg_ctower_rot.h +++ b/src/overlays/actors/ovl_Bg_Ctower_Rot/z_bg_ctower_rot.h @@ -8,10 +8,10 @@ struct BgCtowerRot; typedef void (*BgCtowerRotActionFunc)(struct BgCtowerRot*, GlobalContext*); typedef enum { - /* 0 */ CORRIDOR, - /* 1 */ MAIN_DOOR, // Main door controls cutscene flow (updating Link fields and playing sounds). It is the one on - // the left when entering from the Lost Woods - /* 2 */ DOOR, + /* 0 */ BGCTOWERROT_CORRIDOR, + /* 1 */ BGCTOWERROT_STONE_DOOR_MAIN, // Main door controls cutscene flow (updating Link fields and playing sounds). + // It is the one on the left when entering from the Lost Woods + /* 2 */ BGCTOWERROT_STONE_DOOR, } BgCtowerRotType; typedef struct BgCtowerRot { diff --git a/src/overlays/actors/ovl_Bg_Fu_Kaiten/z_bg_fu_kaiten.c b/src/overlays/actors/ovl_Bg_Fu_Kaiten/z_bg_fu_kaiten.c index 0d215f5c2..8bfdc7a2f 100644 --- a/src/overlays/actors/ovl_Bg_Fu_Kaiten/z_bg_fu_kaiten.c +++ b/src/overlays/actors/ovl_Bg_Fu_Kaiten/z_bg_fu_kaiten.c @@ -5,6 +5,7 @@ */ #include "z_bg_fu_kaiten.h" +#include "objects/object_fu_kaiten/object_fu_kaiten.h" #define FLAGS 0x00000030 @@ -27,56 +28,58 @@ const ActorInit Bg_Fu_Kaiten_InitVars = { (ActorFunc)BgFuKaiten_Draw, }; -extern Gfx D_060005D0[]; -extern CollisionHeader D_06002D30; - void BgFuKaiten_Init(Actor* thisx, GlobalContext* globalCtx) { - UNK_TYPE pad0; - UNK_TYPE pad1; - CollisionHeader* header = 0; + s32 pad; + BgFuKaiten* this = THIS; + CollisionHeader* header = NULL; Actor_SetScale(thisx, 1.0); - DynaPolyActor_Init(&THIS->dyna, 3); - CollisionHeader_GetVirtual(&D_06002D30, &header); - THIS->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &THIS->dyna.actor, header); + DynaPolyActor_Init(&this->dyna, 3); + CollisionHeader_GetVirtual(&object_fu_kaiten_Colheader_002D30, &header); + this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, header); - THIS->bouceHeight = 0.0; - THIS->rotationSpeed = 0; - THIS->bounceSpeed = 0; - THIS->bounce = 0; + this->bounceHeight = 0.0; + this->rotationSpeed = 0; + this->bounceSpeed = 0; + this->bounce = 0; } void BgFuKaiten_Destroy(Actor* thisx, GlobalContext* globalCtx) { - DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, THIS->dyna.bgId); + BgFuKaiten* this = THIS; + + DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId); } void BgFuKaiten_UpdateRotation(BgFuKaiten* this) { f32 f0; + this->dyna.actor.shape.rot.y += this->rotationSpeed; if (this->rotationSpeed > 0) { - f0 = this->rotationSpeed * .002f; - func_8019FAD8(&this->dyna.actor.projectedPos, 8310, f0); + f0 = this->rotationSpeed * 0.002f; + func_8019FAD8(&this->dyna.actor.projectedPos, NA_SE_EV_WOOD_GEAR - SFX_FLAG, f0); } } void BgFuKaiten_UpdateHeight(BgFuKaiten* this) { this->bounce += this->bounceSpeed; - this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + this->elevation + this->bouceHeight; + this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + this->elevation + this->bounceHeight; - this->dyna.actor.world.pos.y -= this->bouceHeight * Math_CosS(this->bounce); + this->dyna.actor.world.pos.y -= this->bounceHeight * Math_CosS(this->bounce); } void BgFuKaiten_Update(Actor* thisx, GlobalContext* globalCtx) { - BgFuKaiten_UpdateRotation(THIS); - BgFuKaiten_UpdateHeight(THIS); + BgFuKaiten* this = THIS; + + BgFuKaiten_UpdateRotation(this); + BgFuKaiten_UpdateHeight(this); } void BgFuKaiten_Draw(Actor* thisx, GlobalContext* globalCtx) { - GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; - UNK_TYPE pad; + OPEN_DISPS(globalCtx->state.gfxCtx); - func_8012C28C(gfxCtx); + func_8012C28C(globalCtx->state.gfxCtx); - gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(gfxCtx->polyOpa.p++, D_060005D0); + gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(POLY_OPA_DISP++, object_fu_kaiten_DL_0005D0); + CLOSE_DISPS(globalCtx->state.gfxCtx); } diff --git a/src/overlays/actors/ovl_Bg_Fu_Kaiten/z_bg_fu_kaiten.h b/src/overlays/actors/ovl_Bg_Fu_Kaiten/z_bg_fu_kaiten.h index a7a589717..6937fbf53 100644 --- a/src/overlays/actors/ovl_Bg_Fu_Kaiten/z_bg_fu_kaiten.h +++ b/src/overlays/actors/ovl_Bg_Fu_Kaiten/z_bg_fu_kaiten.h @@ -9,11 +9,10 @@ typedef struct BgFuKaiten { /* 0x000 */ DynaPolyActor dyna; /* 0x15C */ UNK_TYPE1 pad15C[0x4]; /* 0x160 */ f32 elevation; - /* 0x164 */ f32 bouceHeight; + /* 0x164 */ f32 bounceHeight; /* 0x168 */ s16 rotationSpeed; /* 0x16A */ s16 bounceSpeed; /* 0x16C */ s16 bounce; - /* 0x16E */ UNK_TYPE1 pad16E[0x2]; } BgFuKaiten; // size = 0x170 extern const ActorInit Bg_Fu_Kaiten_InitVars; diff --git a/src/overlays/actors/ovl_Bg_Goron_Oyu/z_bg_goron_oyu.c b/src/overlays/actors/ovl_Bg_Goron_Oyu/z_bg_goron_oyu.c index e75367f60..dee311742 100644 --- a/src/overlays/actors/ovl_Bg_Goron_Oyu/z_bg_goron_oyu.c +++ b/src/overlays/actors/ovl_Bg_Goron_Oyu/z_bg_goron_oyu.c @@ -5,6 +5,7 @@ */ #include "z_bg_goron_oyu.h" +#include "objects/object_oyu/object_oyu.h" #define FLAGS 0x00000030 @@ -34,11 +35,6 @@ const ActorInit Bg_Goron_Oyu_InitVars = { (ActorFunc)BgGoronOyu_Draw, }; -extern Gfx D_06000080; -extern Gfx D_06000158; -extern AnimatedMaterial D_06000968; -extern CollisionHeader D_06000988; - void func_80B40080(BgGoronOyu* this) { this->unk_17E = 1; this->actionFunc = func_80B400C8; @@ -157,7 +153,7 @@ void BgGoronOyu_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_SetScale(&this->dyna.actor, 0.1f); DynaPolyActor_Init(&this->dyna, 1); - CollisionHeader_GetVirtual(&D_06000988, &colHeader); + CollisionHeader_GetVirtual(&object_oyu_Colheader_000988, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader); @@ -188,9 +184,9 @@ void BgGoronOyu_Update(Actor* thisx, GlobalContext* globalCtx) { void BgGoronOyu_Draw(Actor* thisx, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx); func_8012C2DC(globalCtx->state.gfxCtx); - AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&D_06000968)); + AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(object_oyu_Matanimheader_000968)); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_XLU_DISP++, &D_06000158); - gSPDisplayList(POLY_XLU_DISP++, &D_06000080); + gSPDisplayList(POLY_XLU_DISP++, &object_oyu_DL_000158); + gSPDisplayList(POLY_XLU_DISP++, &object_oyu_DL_000080); CLOSE_DISPS(globalCtx->state.gfxCtx); } diff --git a/src/overlays/actors/ovl_Bg_Haka_Curtain/z_bg_haka_curtain.c b/src/overlays/actors/ovl_Bg_Haka_Curtain/z_bg_haka_curtain.c index 87686f4c8..1f39ce6ba 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Curtain/z_bg_haka_curtain.c +++ b/src/overlays/actors/ovl_Bg_Haka_Curtain/z_bg_haka_curtain.c @@ -5,6 +5,7 @@ */ #include "z_bg_haka_curtain.h" +#include "objects/object_haka_obj/object_haka_obj.h" #define FLAGS 0x00000010 @@ -44,15 +45,12 @@ static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), }; -extern CollisionHeader D_06001588; -extern Gfx D_06001410[]; - void BgHakaCurtain_Init(Actor* thisx, GlobalContext* globalCtx) { BgHakaCurtain* this = THIS; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyActor_Init(&this->dyna, 1); - DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06001588); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_haka_obj_Colheader_001588); if (Flags_GetClear(globalCtx, this->dyna.actor.room)) { func_80B6DE80(this); return; @@ -137,5 +135,5 @@ void BgHakaCurtain_Update(Actor* thisx, GlobalContext* globalCtx) { } void BgHakaCurtain_Draw(Actor* thisx, GlobalContext* globalCtx) { - Gfx_DrawDListOpa(globalCtx, D_06001410); + Gfx_DrawDListOpa(globalCtx, object_haka_obj_DL_001410); } diff --git a/src/overlays/actors/ovl_Bg_Haka_Tomb/z_bg_haka_tomb.c b/src/overlays/actors/ovl_Bg_Haka_Tomb/z_bg_haka_tomb.c index a36055a3d..862cf1611 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Tomb/z_bg_haka_tomb.c +++ b/src/overlays/actors/ovl_Bg_Haka_Tomb/z_bg_haka_tomb.c @@ -5,6 +5,7 @@ */ #include "z_bg_haka_tomb.h" +#include "objects/object_haka_obj/object_haka_obj.h" #define FLAGS 0x00000000 @@ -22,9 +23,6 @@ void func_80BD6768(BgHakaTomb* this, GlobalContext* globalCtx); void BgHakaTomb_SetupDoNothing(BgHakaTomb* this); void BgHakaTomb_DoNothing(BgHakaTomb* this, GlobalContext* globalCtx); -extern CollisionHeader D_06000EE8[]; -extern Gfx D_060007B0[]; - const ActorInit Bg_Haka_Tomb_InitVars = { ACTOR_BG_HAKA_TOMB, ACTORCAT_BG, @@ -48,7 +46,7 @@ void BgHakaTomb_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyActor_Init(&this->dyna, 1); - DynaPolyActor_LoadMesh(globalCtx, &this->dyna, D_06000EE8); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_haka_obj_Colheader_000EE8); func_8013E3B8(&this->dyna.actor, this->cutscenes, ARRAY_COUNT(this->cutscenes)); func_80BD6624(this); } @@ -128,5 +126,5 @@ void BgHakaTomb_Update(Actor* thisx, GlobalContext* globalCtx) { } void BgHakaTomb_Draw(Actor* thisx, GlobalContext* globalCtx) { - Gfx_DrawDListOpa(globalCtx, D_060007B0); + Gfx_DrawDListOpa(globalCtx, object_haka_obj_DL_0007B0); } diff --git a/src/overlays/actors/ovl_Bg_Hakugin_Post/z_bg_hakugin_post.c b/src/overlays/actors/ovl_Bg_Hakugin_Post/z_bg_hakugin_post.c index 0a3ef22eb..77e2aa660 100644 --- a/src/overlays/actors/ovl_Bg_Hakugin_Post/z_bg_hakugin_post.c +++ b/src/overlays/actors/ovl_Bg_Hakugin_Post/z_bg_hakugin_post.c @@ -5,6 +5,7 @@ */ #include "z_bg_hakugin_post.h" +#include "objects/object_hakugin_obj/object_hakugin_obj.h" #define FLAGS 0x00000030 @@ -32,13 +33,6 @@ void func_80A9D3E4(BgHakuginPost* this); void func_80A9D434(BgHakuginPost* this, GlobalContext* globalCtx); void func_80A9D61C(Actor* thisx, GlobalContext* globalCtx); -extern Gfx D_0600C1A8[]; -extern Gfx D_0600C568[]; -extern Gfx D_0600CA38[]; -extern Gfx D_0600CEC8[]; -extern Gfx D_0600D098[]; -extern CollisionHeader D_0600D3B0; - BgHakuginPostColliders D_80A9DDC0; BgHakuginPostUnkStruct D_80A9E028; @@ -705,7 +699,7 @@ void BgHakuginPost_Init(Actor* thisx, GlobalContext* globalCtx) { this->dyna.actor.shape.rot.x = 0; this->dyna.actor.shape.rot.z = 0; DynaPolyActor_Init(&this->dyna, 1); - DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_0600D3B0); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_hakugin_obj_Colheader_00D3B0); func_80A9B3BC(this, globalCtx); func_80A9CA94(this); } else { @@ -996,13 +990,14 @@ void BgHakuginPost_Update(Actor* thisx, GlobalContext* globalCtx) { void func_80A9D61C(Actor* thisx, GlobalContext* globalCtx) { static Gfx* D_80A9D900[] = { - D_0600C1A8, D_0600C568, NULL, NULL, D_0600CA38, D_0600CEC8, NULL, + object_hakugin_obj_DL_00C1A8, object_hakugin_obj_DL_00C568, NULL, NULL, + object_hakugin_obj_DL_00CA38, object_hakugin_obj_DL_00CEC8, NULL, }; static Gfx* D_80A9D91C[] = { - D_0600D098, - D_0600D098, - D_0600D098, - D_0600D098, + object_hakugin_obj_DL_00D098, + object_hakugin_obj_DL_00D098, + object_hakugin_obj_DL_00D098, + object_hakugin_obj_DL_00D098, }; BgHakuginPost* this = THIS; BgHakuginPostUnkStruct1* unkStruct1; diff --git a/src/overlays/actors/ovl_Bg_Icicle/z_bg_icicle.c b/src/overlays/actors/ovl_Bg_Icicle/z_bg_icicle.c index d497492f3..bf0851a5b 100644 --- a/src/overlays/actors/ovl_Bg_Icicle/z_bg_icicle.c +++ b/src/overlays/actors/ovl_Bg_Icicle/z_bg_icicle.c @@ -5,6 +5,7 @@ */ #include "z_bg_icicle.h" +#include "objects/object_icicle/object_icicle.h" #define FLAGS 0x00000000 @@ -60,9 +61,6 @@ static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), }; -extern Gfx D_060000D0[]; -extern CollisionHeader D_06000294; - void BgIcicle_Init(Actor* thisx, GlobalContext* globalCtx) { s32 pad; BgIcicle* this = THIS; @@ -71,7 +69,7 @@ void BgIcicle_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(thisx, sInitChain); DynaPolyActor_Init(&this->dyna, 0); - DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06000294); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_icicle_Colheader_000294); Collider_InitAndSetCylinder(globalCtx, &this->collider, thisx, &sCylinderInit); Collider_UpdateCylinder(thisx, &this->collider); @@ -245,5 +243,5 @@ void BgIcicle_Update(Actor* thisx, GlobalContext* globalCtx) { } void BgIcicle_Draw(Actor* thisx, GlobalContext* globalCtx) { - Gfx_DrawDListOpa(globalCtx, D_060000D0); + Gfx_DrawDListOpa(globalCtx, object_icicle_DL_0000D0); } diff --git a/src/overlays/actors/ovl_Bg_Ikana_Ray/z_bg_ikana_ray.c b/src/overlays/actors/ovl_Bg_Ikana_Ray/z_bg_ikana_ray.c index e96c20acc..55c87bafa 100644 --- a/src/overlays/actors/ovl_Bg_Ikana_Ray/z_bg_ikana_ray.c +++ b/src/overlays/actors/ovl_Bg_Ikana_Ray/z_bg_ikana_ray.c @@ -5,6 +5,7 @@ */ #include "z_bg_ikana_ray.h" +#include "objects/object_ikana_obj/object_ikana_obj.h" #define FLAGS 0x00000000 @@ -59,9 +60,6 @@ static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), }; -extern Gfx D_06001100[]; -extern AnimatedMaterial D_06001228[]; - void BgIkanaRay_Init(Actor* thisx, GlobalContext* globalCtx) { BgIkanaRay* this = THIS; ColliderCylinder* collision = &this->collision; @@ -71,7 +69,7 @@ void BgIkanaRay_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_SetCylinder(globalCtx, collision, &this->actor, &sCylinderInit); Collider_UpdateCylinder(&this->actor, &this->collision); - this->animatedTextures = (AnimatedMaterial*)Lib_SegmentedToVirtual(D_06001228); + this->animatedTextures = (AnimatedMaterial*)Lib_SegmentedToVirtual(object_ikana_obj_Matanimheader_001228); if (Flags_GetSwitch(globalCtx, this->actor.params & 0x7F)) { BgIkanaRay_SetActivated(this); @@ -119,5 +117,5 @@ void BgIkanaRay_Draw(Actor* thisx, GlobalContext* globalCtx) { BgIkanaRay* this = THIS; AnimatedMat_Draw(globalCtx, this->animatedTextures); - Gfx_DrawDListXlu(globalCtx, D_06001100); + Gfx_DrawDListXlu(globalCtx, object_ikana_obj_DL_001100); } diff --git a/src/overlays/actors/ovl_Bg_Ikana_Shutter/z_bg_ikana_shutter.c b/src/overlays/actors/ovl_Bg_Ikana_Shutter/z_bg_ikana_shutter.c index 70b58b482..d37d09abf 100644 --- a/src/overlays/actors/ovl_Bg_Ikana_Shutter/z_bg_ikana_shutter.c +++ b/src/overlays/actors/ovl_Bg_Ikana_Shutter/z_bg_ikana_shutter.c @@ -5,6 +5,7 @@ */ #include "z_bg_ikana_shutter.h" +#include "objects/object_ikana_obj/object_ikana_obj.h" #define FLAGS 0x00000010 @@ -53,9 +54,6 @@ static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), }; -extern CollisionHeader D_06000F28; -extern Gfx D_06000CE8[]; - s32 BgIkanaShutter_AllSwitchesPressed(BgIkanaShutter* this, GlobalContext* globalCtx) { return Flags_GetSwitch(globalCtx, this->dyna.actor.params & 0x7F) && Flags_GetSwitch(globalCtx, (this->dyna.actor.params & 0x7F) + 1) && @@ -68,7 +66,7 @@ void BgIkanaShutter_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyActor_Init(&this->dyna, 0); - DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06000F28); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_ikana_obj_Colheader_000F28); if (!((this->dyna.actor.params >> 8) & 1)) { if (BgIkanaShutter_AllSwitchesPressed(this, globalCtx)) { func_80BD599C(this); @@ -213,5 +211,5 @@ void BgIkanaShutter_Update(Actor* thisx, GlobalContext* globalCtx) { } void BgIkanaShutter_Draw(Actor* thisx, GlobalContext* globalCtx) { - Gfx_DrawDListOpa(globalCtx, D_06000CE8); + Gfx_DrawDListOpa(globalCtx, object_ikana_obj_DL_000CE8); } diff --git a/src/overlays/actors/ovl_Bg_Iknin_Susceil/z_bg_iknin_susceil.c b/src/overlays/actors/ovl_Bg_Iknin_Susceil/z_bg_iknin_susceil.c index f4dca549b..2145a3a27 100644 --- a/src/overlays/actors/ovl_Bg_Iknin_Susceil/z_bg_iknin_susceil.c +++ b/src/overlays/actors/ovl_Bg_Iknin_Susceil/z_bg_iknin_susceil.c @@ -5,6 +5,7 @@ */ #include "z_bg_iknin_susceil.h" +#include "objects/object_ikninside_obj/object_ikninside_obj.h" #define FLAGS 0x00000030 @@ -26,10 +27,6 @@ void func_80C0AD44(BgIkninSusceil* this); void func_80C0AD64(BgIkninSusceil* this, GlobalContext* globalCtx); void func_80C0AE5C(BgIkninSusceil* this, GlobalContext* globalCtx); -extern CollisionHeader D_0600CBAC; -extern AnimatedMaterial D_0600C670; -extern Gfx D_0600C308[]; - const ActorInit Bg_Iknin_Susceil_InitVars = { ACTOR_BG_IKNIN_SUSCEIL, ACTORCAT_BG, @@ -116,8 +113,8 @@ void BgIkninSusceil_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyActor_Init(&this->dyna, 1); - DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_0600CBAC); - this->animatedTexture = Lib_SegmentedToVirtual(&D_0600C670); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_ikninside_obj_Colheader_00CBAC); + this->animatedTexture = Lib_SegmentedToVirtual(object_ikninside_obj_Matanimheader_00C670); func_80C0AC74(this); } @@ -260,5 +257,5 @@ void BgIkninSusceil_Draw(Actor* thisx, GlobalContext* globalCtx) { BgIkninSusceil* this = THIS; AnimatedMat_Draw(globalCtx, this->animatedTexture); - Gfx_DrawDListOpa(globalCtx, D_0600C308); + Gfx_DrawDListOpa(globalCtx, object_ikninside_obj_DL_00C308); } diff --git a/src/overlays/actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c b/src/overlays/actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c index 67e8f68e1..84ca4f990 100644 --- a/src/overlays/actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c +++ b/src/overlays/actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c @@ -5,6 +5,7 @@ */ #include "z_bg_iknv_obj.h" +#include "objects/object_iknv_obj/object_iknv_obj.h" #define FLAGS 0x00000010 @@ -20,12 +21,6 @@ void BgIknvObj_UpdateWaterwheel(BgIknvObj* this, GlobalContext* globalCtx); void BgIknvObj_UpdateRaisedDoor(BgIknvObj* this, GlobalContext* globalCtx); void BgIknvObj_UpdateSakonDoor(BgIknvObj* this, GlobalContext* globalCtx); -extern CollisionHeader D_060119D4; -extern CollisionHeader D_06012CA4; -extern Gfx D_06011880[]; -extern Gfx D_060129C8[]; -extern Gfx D_06013058[]; - const ActorInit Bg_Iknv_Obj_InitVars = { ACTOR_BG_IKNV_OBJ, ACTORCAT_BG, @@ -67,24 +62,24 @@ void BgIknvObj_Init(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc = BgIknvObj_DoNothing; switch (IKNV_OBJ_TYPE(this)) { case IKNV_OBJ_WATERWHEEL: - this->displayListPtr = D_06013058; + this->displayListPtr = object_iknv_obj_DL_013058; this->actionFunc = BgIknvObj_UpdateWaterwheel; this->dyna.actor.flags |= 0x100000; this->dyna.actor.flags |= 0x10; break; case IKNV_OBJ_RAISED_DOOR: - this->displayListPtr = D_06011880; + this->displayListPtr = object_iknv_obj_DL_011880; DynaPolyActor_Init(&this->dyna, 0); - CollisionHeader_GetVirtual(&D_060119D4, &colHeader); + CollisionHeader_GetVirtual(&object_iknv_obj_Colheader_0119D4, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader); this->actionFunc = BgIknvObj_UpdateRaisedDoor; this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + 120.0f; break; case IKNV_OBJ_SAKON_DOOR: - this->displayListPtr = D_060129C8; + this->displayListPtr = object_iknv_obj_DL_0129C8; this->actionFunc = BgIknvObj_UpdateSakonDoor; DynaPolyActor_Init(&this->dyna, 0); - CollisionHeader_GetVirtual(&D_06012CA4, &colHeader); + CollisionHeader_GetVirtual(&object_iknv_obj_Colheader_012CA4, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader); Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->dyna.actor, &sCylinderInit); Collider_UpdateCylinder(&this->dyna.actor, &this->collider); diff --git a/src/overlays/actors/ovl_Bg_Inibs_Movebg/z_bg_inibs_movebg.c b/src/overlays/actors/ovl_Bg_Inibs_Movebg/z_bg_inibs_movebg.c index 61e684563..620d55d38 100644 --- a/src/overlays/actors/ovl_Bg_Inibs_Movebg/z_bg_inibs_movebg.c +++ b/src/overlays/actors/ovl_Bg_Inibs_Movebg/z_bg_inibs_movebg.c @@ -5,6 +5,7 @@ */ #include "z_bg_inibs_movebg.h" +#include "objects/object_inibs_object/object_inibs_object.h" #define FLAGS 0x00000030 @@ -26,15 +27,9 @@ const ActorInit Bg_Inibs_Movebg_InitVars = { (ActorFunc)BgInibsMovebg_Draw, }; -extern Gfx D_06001C10[]; -extern Gfx D_06001DC0[]; -extern AnimatedMaterial D_06002598; -extern Gfx D_06006140[]; -extern Gfx D_060062D8[]; -extern AnimatedMaterial D_06006858; -Gfx* D_80B96560[] = { D_060062D8, D_06001DC0 }; -Gfx* D_80B96568[] = { D_06006140, D_06001C10 }; -AnimatedMaterial* D_80B96570[] = { &D_06006858, &D_06002598 }; +Gfx* D_80B96560[] = { object_inibs_object_DL_0062D8, object_inibs_object_DL_001DC0 }; +Gfx* D_80B96568[] = { object_inibs_object_DL_006140, object_inibs_object_DL_001C10 }; +AnimatedMaterial* D_80B96570[] = { object_inibs_object_Matanimheader_006858, object_inibs_object_Matanimheader_002598 }; static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 1000, ICHAIN_STOP), diff --git a/src/overlays/actors/ovl_Bg_Keikoku_Spr/z_bg_keikoku_spr.c b/src/overlays/actors/ovl_Bg_Keikoku_Spr/z_bg_keikoku_spr.c index 3d47988b9..28cea492c 100644 --- a/src/overlays/actors/ovl_Bg_Keikoku_Spr/z_bg_keikoku_spr.c +++ b/src/overlays/actors/ovl_Bg_Keikoku_Spr/z_bg_keikoku_spr.c @@ -5,6 +5,7 @@ */ #include "z_bg_keikoku_spr.h" +#include "objects/object_keikoku_obj/object_keikoku_obj.h" #define FLAGS 0x00000000 @@ -34,13 +35,6 @@ static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 20, ICHAIN_STOP), }; -extern Gfx D_06000100[]; -extern AnimatedMaterial D_060001F8; -extern Gfx D_06000300[]; -extern AnimatedMaterial D_060003F8; -extern Gfx D_06000500[]; -extern AnimatedMaterial D_060005F8; - void BgKeikokuSpr_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(thisx, sInitChain); } @@ -56,13 +50,13 @@ void BgKeikokuSpr_Draw(Actor* thisx, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx); - AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&D_060001F8)); + AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(object_keikoku_obj_Matanimheader_0001F8)); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_XLU_DISP++, D_06000100); - AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&D_060003F8)); - gSPDisplayList(POLY_XLU_DISP++, D_06000300); - AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&D_060005F8)); - gSPDisplayList(POLY_XLU_DISP++, D_06000500); + gSPDisplayList(POLY_XLU_DISP++, object_keikoku_obj_DL_000100); + AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(object_keikoku_obj_Matanimheader_0003F8)); + gSPDisplayList(POLY_XLU_DISP++, object_keikoku_obj_DL_000300); + AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(object_keikoku_obj_Matanimheader_0005F8)); + gSPDisplayList(POLY_XLU_DISP++, object_keikoku_obj_DL_000500); CLOSE_DISPS(globalCtx->state.gfxCtx); } diff --git a/src/overlays/actors/ovl_Bg_Kin2_Fence/z_bg_kin2_fence.c b/src/overlays/actors/ovl_Bg_Kin2_Fence/z_bg_kin2_fence.c index b2d25e23f..d5d28d5a5 100644 --- a/src/overlays/actors/ovl_Bg_Kin2_Fence/z_bg_kin2_fence.c +++ b/src/overlays/actors/ovl_Bg_Kin2_Fence/z_bg_kin2_fence.c @@ -5,6 +5,7 @@ */ #include "z_bg_kin2_fence.h" +#include "objects/object_kin2_obj/object_kin2_obj.h" #define FLAGS 0x00000010 @@ -118,9 +119,6 @@ static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), }; -extern Gfx D_06000828[]; -extern CollisionHeader D_06000908; - s32 BgKin2Fence_CheckHitMask(BgKin2Fence* this) { ColliderJntSphElement* elements = this->collider.elements; @@ -159,7 +157,7 @@ void BgKin2Fence_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyActor_Init(&this->dyna, 0); - DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06000908); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_kin2_obj_Colheader_000908); Collider_InitJntSph(globalCtx, &this->collider); Collider_SetJntSph(globalCtx, &this->collider, &this->dyna.actor, &sJntSphInit, this->colliderElements); Matrix_SetStateRotationAndTranslation(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, @@ -272,5 +270,5 @@ void BgKin2Fence_Update(Actor* thisx, GlobalContext* globalCtx) { } void BgKin2Fence_Draw(Actor* thisx, GlobalContext* globalCtx) { - Gfx_DrawDListOpa(globalCtx, D_06000828); + Gfx_DrawDListOpa(globalCtx, object_kin2_obj_DL_000828); } diff --git a/src/overlays/actors/ovl_Bg_Ladder/z_bg_ladder.c b/src/overlays/actors/ovl_Bg_Ladder/z_bg_ladder.c index 070d8776b..6fec6820a 100644 --- a/src/overlays/actors/ovl_Bg_Ladder/z_bg_ladder.c +++ b/src/overlays/actors/ovl_Bg_Ladder/z_bg_ladder.c @@ -5,6 +5,7 @@ */ #include "z_bg_ladder.h" +#include "objects/object_ladder/object_ladder.h" #define FLAGS 0x00000010 @@ -19,16 +20,6 @@ void BgLadder_ActionStartCutscene(BgLadder* this, GlobalContext* globalCtx); void BgLadder_ActionFadeIn(BgLadder* this, GlobalContext* globalCtx); void BgLadder_ActionIdle(BgLadder* this, GlobalContext* globalCtx); -extern Gfx D_060000A0[]; -extern Gfx D_060002D0[]; -extern Gfx D_06000500[]; -extern Gfx D_06000730[]; - -extern CollisionHeader D_060001D8; -extern CollisionHeader D_06000408; -extern CollisionHeader D_06000638; -extern CollisionHeader D_06000868; - const ActorInit Bg_Ladder_InitVars = { ACTOR_BG_LADDER, ACTORCAT_PROP, @@ -46,10 +37,10 @@ static InitChainEntry sInitChain[] = { }; static Gfx* sLadderDLists[] = { - D_060000A0, // 12 Rung - D_060002D0, // 16 Rung - D_06000500, // 20 Rung - D_06000730, // 24 Rung + object_ladder_DL_0000A0, // 12 Rung + object_ladder_DL_0002D0, // 16 Rung + object_ladder_DL_000500, // 20 Rung + object_ladder_DL_000730, // 24 Rung }; void BgLadder_Init(Actor* thisx, GlobalContext* globalCtx) { @@ -65,13 +56,13 @@ void BgLadder_Init(Actor* thisx, GlobalContext* globalCtx) { size = thisx->params; if (size == LADDER_SIZE_12RUNG) { - DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_060001D8); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_ladder_Colheader_0001D8); } else if (size == LADDER_SIZE_16RUNG) { - DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06000408); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_ladder_Colheader_000408); } else if (size == LADDER_SIZE_20RUNG) { - DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06000638); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_ladder_Colheader_000638); } else if (size == LADDER_SIZE_24RUNG) { - DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06000868); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_ladder_Colheader_000868); } else { Actor_MarkForDeath(&this->dyna.actor); return; diff --git a/src/overlays/actors/ovl_Bg_Lbfshot/z_bg_lbfshot.c b/src/overlays/actors/ovl_Bg_Lbfshot/z_bg_lbfshot.c index 11132cf64..b0ad9d32e 100644 --- a/src/overlays/actors/ovl_Bg_Lbfshot/z_bg_lbfshot.c +++ b/src/overlays/actors/ovl_Bg_Lbfshot/z_bg_lbfshot.c @@ -5,6 +5,7 @@ */ #include "z_bg_lbfshot.h" +#include "objects/object_lbfshot/object_lbfshot.h" #define FLAGS 0x00000000 @@ -30,16 +31,13 @@ static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), }; -extern CollisionHeader D_060014D8; -extern Gfx D_06000228[]; - void BgLbfshot_Init(Actor* thisx, GlobalContext* globalCtx) { BgLbfshot* this = THIS; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); this->dyna.actor.uncullZoneForward = 4000.0f; DynaPolyActor_Init(&this->dyna, 1); - DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_060014D8); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_lbfshot_Colheader_0014D8); } void BgLbfshot_Destroy(Actor* thisx, GlobalContext* globalCtx) { BgLbfshot* this = THIS; @@ -47,5 +45,5 @@ void BgLbfshot_Destroy(Actor* thisx, GlobalContext* globalCtx) { DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId); } void BgLbfshot_Draw(Actor* thisx, GlobalContext* globalCtx) { - Gfx_DrawDListOpa(globalCtx, D_06000228); + Gfx_DrawDListOpa(globalCtx, object_lbfshot_DL_000228); } diff --git a/src/overlays/actors/ovl_Bg_Lotus/z_bg_lotus.c b/src/overlays/actors/ovl_Bg_Lotus/z_bg_lotus.c index 378ea3e0d..41d7e12bb 100644 --- a/src/overlays/actors/ovl_Bg_Lotus/z_bg_lotus.c +++ b/src/overlays/actors/ovl_Bg_Lotus/z_bg_lotus.c @@ -5,6 +5,7 @@ */ #include "z_bg_lotus.h" +#include "objects/object_lotus/object_lotus.h" #define FLAGS 0x00000000 @@ -35,9 +36,6 @@ static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), }; -extern CollisionHeader D_06000A20; // Lilypad collision -extern Gfx D_06000040[]; // Lilypad model - void BgLotus_Init(Actor* thisx, GlobalContext* globalCtx) { BgLotus* this = THIS; s32 pad; @@ -45,7 +43,7 @@ void BgLotus_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyActor_Init(&this->dyna, 1); - DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06000A20); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_lotus_Colheader_000A20); this->dyna.actor.floorHeight = BgCheck_EntityRaycastFloor5(&globalCtx->colCtx, &thisx->floorPoly, &bgId, &this->dyna.actor, &this->dyna.actor.world.pos); this->timer2 = 96; @@ -173,5 +171,5 @@ void BgLotus_Update(Actor* thisx, GlobalContext* globalCtx) { } void BgLotus_Draw(Actor* thisx, GlobalContext* globalCtx) { - Gfx_DrawDListOpa(globalCtx, D_06000040); + Gfx_DrawDListOpa(globalCtx, object_lotus_DL_000040); } diff --git a/src/overlays/actors/ovl_Bg_Market_Step/z_bg_market_step.c b/src/overlays/actors/ovl_Bg_Market_Step/z_bg_market_step.c index e9a365c91..db363498c 100644 --- a/src/overlays/actors/ovl_Bg_Market_Step/z_bg_market_step.c +++ b/src/overlays/actors/ovl_Bg_Market_Step/z_bg_market_step.c @@ -5,6 +5,7 @@ */ #include "z_bg_market_step.h" +#include "objects/object_market_obj/object_market_obj.h" #define FLAGS 0x10000020 @@ -26,12 +27,8 @@ static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 1000, ICHAIN_STOP), }; -extern Gfx D_0601F050[]; -extern Gfx D_06018DA0[]; -extern Gfx D_0601EF10[]; -extern Gfx D_06018C60[]; -Gfx* D_80AF0120[] = { D_0601F050, D_06018DA0 }; -Gfx* D_80AF0128[] = { D_0601EF10, D_06018C60 }; +Gfx* D_80AF0120[] = { object_market_obj_DL_01F050, object_market_obj_DL_018DA0 }; +Gfx* D_80AF0128[] = { object_market_obj_DL_01EF10, object_market_obj_DL_018C60 }; void BgMarketStep_Init(Actor* thisx, GlobalContext* globalCtx) { BgMarketStep* this = THIS; diff --git a/src/overlays/actors/ovl_Bg_Mbar_Chair/z_bg_mbar_chair.c b/src/overlays/actors/ovl_Bg_Mbar_Chair/z_bg_mbar_chair.c index 8a31c536b..e5e300757 100644 --- a/src/overlays/actors/ovl_Bg_Mbar_Chair/z_bg_mbar_chair.c +++ b/src/overlays/actors/ovl_Bg_Mbar_Chair/z_bg_mbar_chair.c @@ -5,6 +5,7 @@ */ #include "z_bg_mbar_chair.h" +#include "objects/object_mbar_obj/object_mbar_obj.h" #define FLAGS 0x00000000 @@ -34,15 +35,12 @@ static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), }; -extern CollisionHeader D_060019B4; -extern Gfx D_06000288[]; - void BgMbarChair_Init(Actor* thisx, GlobalContext* globalCtx) { BgMbarChair* this = THIS; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyActor_Init(&this->dyna, 0); - DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_060019B4); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_mbar_obj_Colheader_0019B4); } void BgMbarChair_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -55,5 +53,5 @@ void BgMbarChair_Update(Actor* thisx, GlobalContext* globalCtx) { } void BgMbarChair_Draw(Actor* thisx, GlobalContext* globalCtx) { - Gfx_DrawDListOpa(globalCtx, D_06000288); + Gfx_DrawDListOpa(globalCtx, object_mbar_obj_DL_000288); } diff --git a/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.c b/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.c index 0d4e9b0aa..8f8788660 100644 --- a/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.c +++ b/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.c @@ -5,6 +5,7 @@ */ #include "z_bg_tobira01.h" +#include "objects/object_spot11_obj/object_spot11_obj.h" #define FLAGS 0x00000030 @@ -27,9 +28,6 @@ const ActorInit Bg_Tobira01_InitVars = { (ActorFunc)BgTobira01_Draw, }; -extern Gfx D_06000088[]; -extern CollisionHeader D_060011C0; - void BgTobira01_Open(BgTobira01* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); s16 cutsceneId = this->dyna.actor.cutscene; @@ -80,7 +78,7 @@ void BgTobira01_Init(Actor* thisx, GlobalContext* globalCtx) { s32 pad; DynaPolyActor_Init(&this->dyna, 1); - DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_060011C0); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_spot11_obj_Colheader_0011C0); gSaveContext.save.weekEventReg[88] &= (u8)~0x40; Actor_SetScale(&this->dyna.actor, 1.0f); this->timer2 = gSaveContext.save.isNight; @@ -107,7 +105,7 @@ void BgTobira01_Draw(Actor* thisx, GlobalContext* globalCtx) { func_8012C28C(globalCtx->state.gfxCtx); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, D_06000088); + gSPDisplayList(POLY_OPA_DISP++, object_spot11_obj_DL_000088); CLOSE_DISPS(globalCtx->state.gfxCtx); } diff --git a/src/overlays/actors/ovl_Boss_02/z_boss_02.c b/src/overlays/actors/ovl_Boss_02/z_boss_02.c index eb8921607..a31a2359f 100644 --- a/src/overlays/actors/ovl_Boss_02/z_boss_02.c +++ b/src/overlays/actors/ovl_Boss_02/z_boss_02.c @@ -7,6 +7,8 @@ #include "z_boss_02.h" #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" #include "overlays/actors/ovl_Item_B_Heart/z_item_b_heart.h" +#include "objects/object_boss02/object_boss02.h" +#include "objects/gameplay_keep/gameplay_keep.h" #define FLAGS 0x00000035 @@ -29,36 +31,6 @@ void func_809DD2F8(GlobalContext* globalCtx); void func_809DD934(Boss02* this, GlobalContext* globalCtx); void func_809DEAC4(Boss02* this, GlobalContext* globalCtx); -extern Gfx D_06000230[]; -extern Gfx D_060002E0[]; -extern UNK_TYPE D_060003A0; -extern UNK_TYPE D_060041A0; -extern UNK_TYPE D_06008650; -extern SkeletonHeader D_06009B10; -extern AnimationHeader D_06009C78; -extern Gfx D_0600ECF0[]; -extern Gfx D_0600EF90[]; -extern Gfx D_0600F310[]; -extern Gfx D_0600F690[]; -extern Gfx D_0600FA10[]; -extern Gfx D_0600FD90[]; -extern Gfx D_06010110[]; -extern Gfx D_06010490[]; -extern Gfx D_06010810[]; -extern Gfx D_06010B90[]; -extern Gfx D_06010F10[]; -extern Gfx D_06011290[]; -extern Gfx D_06011610[]; -extern Gfx D_06011990[]; -extern Gfx D_06011D10[]; -extern Gfx D_06012090[]; -extern Gfx D_06012410[]; -extern Gfx D_06012790[]; -extern Gfx D_06012B10[]; -extern Gfx D_06012E90[]; -extern Gfx D_06013210[]; -extern Gfx D_06013590[]; - static u8 D_809E0420; static u8 D_809E0421; static u8 D_809E0422; @@ -624,7 +596,8 @@ void Boss02_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.colChkInfo.mass = MASS_HEAVY; this->actor.colChkInfo.health = 20; Actor_SetScale(&this->actor, 0.01f); - SkelAnime_Init(globalCtx, &this->skelAnime, &D_06009B10, &D_06009C78, this->jointTable, this->morphTable, 13); + SkelAnime_Init(globalCtx, &this->skelAnime, &object_boss02_Skel_009B10, &object_boss02_Anim_009C78, + this->jointTable, this->morphTable, 13); Collider_InitAndSetJntSph(globalCtx, &this->colliderSphere1, &this->actor, &sJntSphInit1, this->colliderSphere1Elements); Collider_InitAndSetJntSph(globalCtx, &this->colliderSphere2, &this->actor, &sJntSphInit2, @@ -663,7 +636,7 @@ void func_809DAA98(Boss02* this, GlobalContext* globalCtx) { void func_809DAAA8(Boss02* this, GlobalContext* globalCtx) { this->actionFunc = func_809DAB78; - Animation_MorphToLoop(&this->skelAnime, &D_06009C78, 0.0f); + Animation_MorphToLoop(&this->skelAnime, &object_boss02_Anim_009C78, 0.0f); if (D_809E042C->unk_1D20 != 0) { this->unk_0144 = 10; } else { @@ -1351,9 +1324,12 @@ void func_809DC78C(Actor* thisx, GlobalContext* globalCtx) { // matrix stuff at the start? void Boss02_Draw(Actor* thisx, GlobalContext* globalCtx2) { static Gfx* D_809DFA9C[] = { - D_0600ECF0, D_0600EF90, D_0600F310, D_0600F690, D_0600FA10, D_0600FD90, D_06010110, D_06010490, - D_06010810, D_06010B90, D_06010F10, D_06011290, D_06011610, D_06011990, D_06011D10, D_06012090, - D_06012410, D_06012790, D_06012B10, D_06012E90, D_06013210, D_06013590, + object_boss02_DL_00ECF0, object_boss02_DL_00EF90, object_boss02_DL_00F310, object_boss02_DL_00F690, + object_boss02_DL_00FA10, object_boss02_DL_00FD90, object_boss02_DL_010110, object_boss02_DL_010490, + object_boss02_DL_010810, object_boss02_DL_010B90, object_boss02_DL_010F10, object_boss02_DL_011290, + object_boss02_DL_011610, object_boss02_DL_011990, object_boss02_DL_011D10, object_boss02_DL_012090, + object_boss02_DL_012410, object_boss02_DL_012790, object_boss02_DL_012B10, object_boss02_DL_012E90, + object_boss02_DL_013210, object_boss02_DL_013590, }; static Vec3f D_809DFAF4 = { -10000.0f, -100000.0f, -100000.0f }; Boss02* this = THIS; @@ -1378,9 +1354,9 @@ void Boss02_Draw(Actor* thisx, GlobalContext* globalCtx2) { func_8012C28C(globalCtx->state.gfxCtx); if (this->actor.params == 0) { - gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(&D_060003A0)); + gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(object_boss02_Tex_0003A0)); } else { - gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(&D_060041A0)); + gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(object_boss02_Tex_0041A0)); } gSPSegment(POLY_OPA_DISP++, 0x0D, matrix); @@ -1490,9 +1466,12 @@ void Boss02_Draw(Actor* thisx, GlobalContext* globalCtx2) { } #else static Gfx* D_809DFA9C[] = { - D_0600ECF0, D_0600EF90, D_0600F310, D_0600F690, D_0600FA10, D_0600FD90, D_06010110, D_06010490, - D_06010810, D_06010B90, D_06010F10, D_06011290, D_06011610, D_06011990, D_06011D10, D_06012090, - D_06012410, D_06012790, D_06012B10, D_06012E90, D_06013210, D_06013590, + object_boss02_DL_00ECF0, object_boss02_DL_00EF90, object_boss02_DL_00F310, object_boss02_DL_00F690, + object_boss02_DL_00FA10, object_boss02_DL_00FD90, object_boss02_DL_010110, object_boss02_DL_010490, + object_boss02_DL_010810, object_boss02_DL_010B90, object_boss02_DL_010F10, object_boss02_DL_011290, + object_boss02_DL_011610, object_boss02_DL_011990, object_boss02_DL_011D10, object_boss02_DL_012090, + object_boss02_DL_012410, object_boss02_DL_012790, object_boss02_DL_012B10, object_boss02_DL_012E90, + object_boss02_DL_013210, object_boss02_DL_013590, }; static Vec3f D_809DFAF4 = { -10000.0f, -100000.0f, -100000.0f }; #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_02/Boss02_Draw.s") @@ -1562,7 +1541,7 @@ void func_809DD2F8(GlobalContext* globalCtx) { for (i = 0; i < ARRAY_COUNT(D_809E0438); i++, effect++) { if (effect->unk_24 == 1) { if (!flag) { - gSPDisplayList(POLY_XLU_DISP++, D_06000230); + gSPDisplayList(POLY_XLU_DISP++, object_boss02_DL_000230); gDPSetEnvColor(POLY_XLU_DISP++, 185, 140, 70, 128); flag++; } @@ -1583,7 +1562,7 @@ void func_809DD2F8(GlobalContext* globalCtx) { gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_XLU_DISP++, D_060002E0); + gSPDisplayList(POLY_XLU_DISP++, object_boss02_DL_0002E0); } } @@ -1604,7 +1583,7 @@ void func_809DD2F8(GlobalContext* globalCtx) { gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, D_0401A620); + gSPDisplayList(POLY_OPA_DISP++, gameplay_keep_DL_01A620); } } @@ -1612,7 +1591,7 @@ void func_809DD2F8(GlobalContext* globalCtx) { for (i = 0, flag = false; i < ARRAY_COUNT(D_809E0438); i++, effect++) { if (effect->unk_24 == 4) { if (!flag) { //! @bug - dev forgot to set flag to 1, should only apply to first entry? - gSPDisplayList(POLY_XLU_DISP++, D_04023348); + gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_023348); gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 128); } @@ -1624,7 +1603,7 @@ void func_809DD2F8(GlobalContext* globalCtx) { gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_XLU_DISP++, D_04023428); + gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_023428); } } @@ -1632,7 +1611,7 @@ void func_809DD2F8(GlobalContext* globalCtx) { for (i = 0, flag = false; i < ARRAY_COUNT(D_809E0438); i++, effect++) { if (effect->unk_24 == 2) { if (!flag) { - gSPDisplayList(POLY_XLU_DISP++, D_06000230); + gSPDisplayList(POLY_XLU_DISP++, object_boss02_DL_000230); gDPSetEnvColor(POLY_XLU_DISP++, 30, 30, 30, 128); flag++; } @@ -1648,7 +1627,7 @@ void func_809DD2F8(GlobalContext* globalCtx) { gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_XLU_DISP++, D_060002E0); + gSPDisplayList(POLY_XLU_DISP++, object_boss02_DL_0002E0); } } @@ -2178,7 +2157,7 @@ void func_809DEAC4(Boss02* this, GlobalContext* globalCtx) { if (this->unk_1D1C == (u32)(KREG(92) + 125)) { TitleCard_InitBossName(&globalCtx->state, &globalCtx->actorCtx.titleCtxt, - Lib_SegmentedToVirtual(&D_06008650), 160, 180, 128, 40); + Lib_SegmentedToVirtual(object_boss02_Tex_008650), 160, 180, 128, 40); } if (this->unk_1D1C == (u32)(BREG(27) + 335)) { diff --git a/src/overlays/actors/ovl_Boss_06/z_boss_06.c b/src/overlays/actors/ovl_Boss_06/z_boss_06.c index 9e38aaccb..694112c4d 100644 --- a/src/overlays/actors/ovl_Boss_06/z_boss_06.c +++ b/src/overlays/actors/ovl_Boss_06/z_boss_06.c @@ -5,8 +5,11 @@ */ #include "z_boss_06.h" +#include "overlays/actors/ovl_En_Knight/z_en_knight.h" +#include "objects/gameplay_keep/gameplay_keep.h" +#include "objects/object_knight/object_knight.h" -#define FLAGS 0x00000035 +#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_20) #define THIS ((Boss06*)thisx) @@ -15,15 +18,22 @@ void Boss06_Destroy(Actor* thisx, GlobalContext* globalCtx); void Boss06_Update(Actor* thisx, GlobalContext* globalCtx); void Boss06_Draw(Actor* thisx, GlobalContext* globalCtx); +void func_809F24A8(Boss06* this); void func_809F24C8(Boss06* this, GlobalContext* globalCtx); void func_809F2B64(Boss06* this, GlobalContext* globalCtx); void func_809F2C44(Boss06* this, GlobalContext* globalCtx); +void func_809F2E14(Boss06* this, GlobalContext* globalCtx); void func_809F2E34(Boss06* this, GlobalContext* globalCtx); +void func_809F2ED0(Boss06* this, GlobalContext* globalCtx); void func_809F2EE8(Boss06* this, GlobalContext* globalCtx); -#if 0 -// static DamageTable sDamageTable = { -static DamageTable D_809F4080 = { +static Vec3f D_809F4370[128]; +static EnKnight* D_809F4970; +static s32 D_809F4974; +static s32 D_809F4978; +static s32 D_809F497C; + +static DamageTable sDamageTable = { /* Deku Nut */ DMG_ENTRY(0, 0xF), /* Deku Stick */ DMG_ENTRY(0, 0xF), /* Horse trample */ DMG_ENTRY(0, 0x0), @@ -70,47 +80,581 @@ const ActorInit Boss_06_InitVars = { (ActorFunc)Boss06_Draw, }; -// static ColliderCylinderInit sCylinderInit = { -static ColliderCylinderInit D_809F40C0 = { - { COLTYPE_HIT3, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_CYLINDER, }, - { ELEMTYPE_UNK3, { 0xF7CFFFFF, 0x00, 0x04 }, { 0xF7FFFFFF, 0x00, 0x00 }, TOUCH_ON | TOUCH_SFX_NORMAL, BUMP_ON | BUMP_HOOKABLE, OCELEM_ON, }, +static ColliderCylinderInit sCylinderInit = { + { + COLTYPE_HIT3, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK3, + { 0xF7CFFFFF, 0x00, 0x04 }, + { 0xF7FFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, { 90, 140, 10, { 0, 0, 0 } }, }; +static Vec3f D_809F40EC[] = { + { 1081.0f, 235.0f, 3224.0f }, + { 676.0f, 235.0f, 3224.0f }, +}; + +void func_809F2120(s32 arg0, s32 arg1, s32 arg2) { + D_809F4974 = arg0; + D_809F4978 = arg1; + D_809F497C = arg2; +} + +f32 func_809F2140(void) { + f32 temp_f2; + + D_809F4974 = (D_809F4974 * 171) % 30269; + D_809F4978 = (D_809F4978 * 172) % 30307; + D_809F497C = (D_809F497C * 170) % 30323; + temp_f2 = (D_809F4974 / 30269.0f) + (D_809F4978 / 30307.0f) + (D_809F497C / 30323.0f); + + while (temp_f2 >= 1.0f) { + temp_f2 -= 1.0f; + } + + return fabsf(temp_f2); +} + +void Boss06_Init(Actor* thisx, GlobalContext* globalCtx) { + Boss06* this = THIS; + u8* temp_v0; + s32 i; + + D_809F4970 = (EnKnight*)this->actor.parent; + this->actor.colChkInfo.damageTable = &sDamageTable; + + if ((KREG(64) != 0) || (gSaveContext.eventInf[5] & 0x80)) { + this->actionFunc = func_809F2E14; + } else { + this->actionFunc = func_809F2B64; + } + + Actor_SetScale(&this->actor, 0.1f); + Math_Vec3f_Copy(&this->actor.world.pos, &D_809F40EC[ENBOSS06_GET_PARAMS(&this->actor)]); + this->actor.shape.rot.y = -0x8000; + Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); + + temp_v0 = SEGMENTED_TO_VIRTUAL(&object_knight_Tex_019490); + for (i = 0; i < ARRAY_COUNT(this->unk_200); i++) { + this->unk_200[i] = temp_v0[i]; + } + + this->actor.flags &= ~ACTOR_FLAG_1; +} + +void Boss06_Destroy(Actor* thisx, GlobalContext* globalCtx) { +} + +void func_809F23CC(Boss06* this) { + if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; + if ((this->unk_1C9 == 0) && (D_809F4970->unk_68A == 0)) { + if (this->actor.colChkInfo.damageEffect == 2) { + func_809F24A8(this); + play_sound(NA_SE_SY_TRE_BOX_APPEAR); + + this->unk_1B0 = -(this->actor.world.pos.x - this->collider.info.bumper.hitPos.x); + this->unk_1BC = this->unk_1B0 * 0.35f; + + this->unk_1B4 = -((this->actor.world.pos.y + 80.0f) - this->collider.info.bumper.hitPos.y); + this->unk_1C0 = this->unk_1B4 * -0.35f; + } + } + } +} + +void func_809F24A8(Boss06* this) { + this->actionFunc = func_809F24C8; + this->unk_A28 = 0.0f; + this->unk_1AC = 0.0f; +} + +#ifdef NON_MATCHING +// Weird loading of 1 +void func_809F24C8(Boss06* this, GlobalContext* globalCtx) { + s16 sp4E = 0; + Player* player = GET_PLAYER(globalCtx); + Actor* temp_s0; + Actor* temp_v0_2; + Actor* child; + + this->unk_1CA++; + + switch (this->unk_1C9) { + case 0: + if (ActorCutscene_GetCurrentIndex() != -1) { + break; + } + + func_800EA0D4(globalCtx, &globalCtx->csCtx); + func_800B7298(globalCtx, &this->actor, 7); + this->unk_A00 = func_801694DC(globalCtx); + func_80169590(globalCtx, 0, 1); + func_80169590(globalCtx, this->unk_A00, 7); + D_809F4970->unk_151 = 1; + this->unk_1C9 = 1; + this->unk_1C8 = 1; + this->unk_1E0 = 255.0f; + this->unk_1DC = 0.0f; + + temp_s0 = globalCtx->actorCtx.actorLists[ACTORCAT_ITEMACTION].first; + while (temp_s0 != NULL) { + if (temp_s0->id == ACTOR_EN_ARROW) { + Actor_MarkForDeath(temp_s0); + } + temp_s0 = temp_s0->next; + } + + case 1: + if (this->unk_1CA >= 10) { + Math_ApproachF(&this->unk_1E4, 30.0f, 0.2f, 1.0f); + globalCtx->envCtx.unk_E5 = 1; + globalCtx->envCtx.unk_E6[2] = 0; + globalCtx->envCtx.unk_E6[1] = 0; + globalCtx->envCtx.unk_E6[0] = 0; + globalCtx->envCtx.unk_E6[3] = this->unk_A2C; + Math_ApproachF(&this->unk_A2C, 75.0f, 1.0f, 3.0f); + } + + if (this->unk_1CA >= 30) { + play_sound(NA_SE_EV_S_STONE_FLASH); + } + + if (this->unk_1CA >= 60) { + globalCtx->envCtx.unk_E5 = 0; + this->unk_1C8 = 0; + this->unk_1DC = 0.0f; + this->unk_1D8 = 0.0f; + if (this->unk_1CA == 60) { + D_809F4970->unk_154++; + func_800B7298(globalCtx, &this->actor, 0x84); + player->actor.shape.rot.y = 0; + player->actor.world.rot.y = player->actor.shape.rot.y; + } + + this->unk_A04.x = player->actor.world.pos.x + 20.0f; + this->unk_A04.y = player->actor.world.pos.y + 20.0f; + this->unk_A04.z = player->actor.world.pos.z + 30.0f; + + this->unk_A10.x = player->actor.world.pos.x; + this->unk_A10.y = player->actor.world.pos.y + 26.0f; + this->unk_A10.z = player->actor.world.pos.z; + + if (this->unk_1CA >= 75) { + temp_v0_2 = globalCtx->actorCtx.actorLists[ACTORCAT_BOSS].first; + while (temp_v0_2 != NULL) { + if ((temp_v0_2->id == ACTOR_EN_KNIGHT) && (&D_809F4970->actor == temp_v0_2) && + (D_809F4970->unk_680 != 0)) { + this->unk_A04.x = 1307.0f; + this->unk_A04.y = 142.0f; + this->unk_A04.z = 2897.0f; + + this->unk_A10.x = 1376.0f; + this->unk_A10.y = 132.0f; + this->unk_A10.z = 2860.0f; + + if (this->unk_1CA == 75) { + D_809F4970->unk_148 = 1; + } + sp4E = 17; + break; + } + temp_v0_2 = temp_v0_2->next; + } + } + + if ((s16)(sp4E + 80) < this->unk_1CA) { + this->unk_1C9 = 2; + this->unk_1CA = 0; + this->unk_1B4 = 0.0f; + this->unk_1B0 = 0.0f; + this->unk_144 = 2; + this->unk_1A4 = 0.0f; + this->unk_1A0 = 0.0f; + this->unk_1DC = 18.0f; + this->unk_1E0 = 255.0f; + this->unk_19C = 1.0f; + + Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_MIR_RAY2, + this->actor.world.pos.x, this->actor.world.pos.y - 200.0f, + this->actor.world.pos.z - 170.0f, 15, 0, 0, 1); + + if (ENBOSS06_GET_PARAMS(&this->actor) == 0) { + this->unk_A04.x = this->actor.world.pos.x - 200.0f; + } else { + this->unk_A04.x = this->actor.world.pos.x + 200.0f; + } + this->unk_A04.y = (this->actor.world.pos.y - 200.0f) + 100.0f; + this->unk_A04.z = this->actor.world.pos.z - 200.0f; + + this->unk_A10.x = this->actor.world.pos.x; + this->unk_A10.y = this->actor.world.pos.y + 80.0f; + this->unk_A10.z = this->actor.world.pos.z; + } + } else { + this->unk_A10.z = this->actor.world.pos.z; + this->unk_A04.y = this->actor.world.pos.y + 60.0f; + this->unk_A04.x = this->actor.world.pos.x; + + this->unk_A04.z = this->actor.world.pos.z - 210.0f; + this->unk_A10.y = this->actor.world.pos.y + 80.0f; + this->unk_A10.x = this->actor.world.pos.x; + } + break; + + case 2: + child = this->actor.child; + + if (this->unk_1CA == 1) { + this->unk_A1C.x = fabsf(this->unk_A10.x - child->world.pos.x); + this->unk_A1C.y = fabsf(this->unk_A10.y - child->world.pos.y); + this->unk_A1C.z = fabsf(this->unk_A10.z - child->world.pos.z); + } + + Math_ApproachF(&this->unk_A10.x, child->world.pos.x, 0.15f, this->unk_A1C.x * this->unk_A28); + Math_ApproachF(&this->unk_A10.y, child->world.pos.y, 0.15f, this->unk_A1C.y * this->unk_A28); + Math_ApproachF(&this->unk_A10.z, child->world.pos.z, 0.15f, this->unk_A1C.z * this->unk_A28); + Math_ApproachF(&this->unk_A28, 1.0f, 1.0f, 0.001f); + + if (this->unk_1CA > 80) { + func_809F2ED0(this, globalCtx); + func_80169AFC(globalCtx, this->unk_A00, 0); + this->unk_A00 = 0; + func_800EA0EC(globalCtx, &globalCtx->csCtx); + func_800B7298(globalCtx, &this->actor, 6); + D_809F4970->unk_151 = 0; + } + break; + } + + if (this->unk_A00 != 0) { + ShrinkWindow_SetLetterboxTarget(0x1B); + Play_CameraSetAtEye(globalCtx, this->unk_A00, &this->unk_A10, &this->unk_A04); + } +} +#else +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_06/func_809F24C8.s") #endif -extern DamageTable D_809F4080; -extern ColliderCylinderInit D_809F40C0; +void func_809F2B64(Boss06* this, GlobalContext* globalCtx) { + this->actionFunc = func_809F2C44; + this->unk_144 = 3; + this->unk_1A8 = 110.0f; + this->unk_1E0 = 200; + this->unk_1DC = 15.0f; + this->unk_1E4 = 30.0f; + this->unk_1AC = 0.0f; + this->unk_19C = 1.0f; + Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_MIR_RAY2, this->actor.world.pos.x, + this->actor.world.pos.y - 200.0f, this->actor.world.pos.z - 170.0f, 15, 0, 0, 1); + D_809F4970->unk_154++; +} -extern UNK_TYPE D_06018BD0; -extern UNK_TYPE D_06019490; +void func_809F2C44(Boss06* this, GlobalContext* globalCtx) { + if (D_809F4970->unk_153 != 0) { + this->unk_A28 = 0.008f; + Math_ApproachF(&this->unk_1E4, 0.0f, 0.2f, this->unk_A28 * 30.0f); + Math_ApproachF(&this->unk_1AC, -70.0f, 0.2f, this->unk_A28 * 70.0f); + Math_ApproachF(&this->unk_1A8, 0.0f, 0.2f, this->unk_A28 * 110.0f); + Math_ApproachF(&this->unk_1A0, -900.0f, 0.2f, this->unk_A28 * 900.0f); + Math_ApproachF(&this->unk_1A4, 1350.0f, 0.2f, this->unk_A28 * 1350.0f); + Math_ApproachF(&this->unk_1E0, 100.0f, 0.2f, this->unk_A28 * 100.0f); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_06/func_809F2120.s") + if (this->unk_1E4 < 5.0f) { + Math_ApproachF(&this->unk_19C, 0.0f, 1.0f, 0.03f); + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_06/func_809F2140.s") + if ((this->unk_1E4 > 0.1f) && ENBOSS06_GET_PARAMS(&this->actor) == 0) { + play_sound(NA_SE_EV_CURTAIN_DOWN - SFX_FLAG); + } + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_06/Boss06_Init.s") + if (D_809F4970->unk_153 == 2) { + Actor_MarkForDeath(this->actor.child); + this->actor.child = NULL; + func_809F2E14(this, globalCtx); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_06/Boss06_Destroy.s") +void func_809F2E14(Boss06* this, GlobalContext* globalCtx) { + this->actionFunc = func_809F2E34; + this->unk_144 = 1; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_06/func_809F23CC.s") +void func_809F2E34(Boss06* this, GlobalContext* globalCtx) { + this->unk_1E0 = 200.0f; + this->unk_1DC = 15.0f; + func_809F23CC(this); + Collider_UpdateCylinder(&this->actor, &this->collider); + this->collider.dim.pos.z = (this->actor.world.pos.z - 50.0f) + 100.0f; + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_06/func_809F24A8.s") +void func_809F2ED0(Boss06* this, GlobalContext* globalCtx) { + this->actionFunc = func_809F2EE8; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_06/func_809F24C8.s") +void func_809F2EE8(Boss06* this, GlobalContext* globalCtx) { + this->unk_1E0 = 100.0f; + this->unk_1DC = 13.0f; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_06/func_809F2B64.s") +void Boss06_Update(Actor* thisx, GlobalContext* globalCtx) { + Boss06* this = THIS; + s32 i; + Vec3f sp7C; + f32 temp_f22; + f32 phi_f26; + f32 phi_f24; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_06/func_809F2C44.s") + this->actionFunc(this, globalCtx); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_06/func_809F2E14.s") + if (this->unk_146 != 0) { + this->unk_146--; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_06/func_809F2E34.s") + if (this->unk_148 != 0) { + this->unk_148--; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_06/func_809F2ED0.s") + if (this->unk_1E4 > 0.0f) { + if (ENBOSS06_GET_PARAMS(&this->actor) == 0) { + D_801F4E32 = 1; + D_801F4E38.x = this->actor.world.pos.x + this->unk_1B0; + D_801F4E38.y = this->actor.world.pos.y + 80.0f + this->unk_1B4 + this->unk_1AC; + D_801F4E38.z = this->actor.world.pos.z; + D_801F4E44 = this->unk_1E4; + D_801F4E48 = 10.0f; + D_801F4E4C = 0; + } else { + D_801F4E4E = 1; + D_801F4E50.x = this->actor.world.pos.x + this->unk_1B0; + D_801F4E50.y = this->actor.world.pos.y + 80.0f + this->unk_1B4 + this->unk_1AC; + D_801F4E50.z = this->actor.world.pos.z; + D_801F4E5C = this->unk_1E4; + D_801F4E60 = 10.0f; + D_801F4E64 = 0; + } + } else if (ENBOSS06_GET_PARAMS(&this->actor) == 0) { + D_801F4E32 = 0; + } else { + D_801F4E4E = 0; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_06/func_809F2EE8.s") + if ((this->unk_1C8 != 0) && (this->unk_1C8 != 0)) { + play_sound(NA_SE_EV_FIRE_PLATE - SFX_FLAG); + this->unk_1CC += 0.6f; + this->unk_1D0 += 0.1f; + this->unk_1D4 += 0.0200000014156f; + this->unk_1D8 += 0.00016f; + this->unk_1DC += 0.4f; + Math_ApproachZeroF(&this->unk_1B0, 1.0f, 0.7f); + Math_ApproachZeroF(&this->unk_1B4, 1.0f, 0.7f); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_06/Boss06_Update.s") + phi_f26 = 0.0f; + phi_f24 = 0.0f; + for (i = 0; i < 1024; i++) { + temp_f22 = + (((__sinf(phi_f24) * this->unk_1D4) + 1.0f) * ((__sinf(phi_f26) * this->unk_1D0) + this->unk_1D0)) + + this->unk_1CC; + + phi_f26 += (M_PI / 64); + phi_f24 += 0.030679617f; + + Matrix_InsertZRotation_f(i * (M_PI / 512), MTXMODE_NEW); + Matrix_GetStateTranslationAndScaledY(temp_f22, &sp7C); + + sp7C.x += 32.0f + this->unk_1BC; + sp7C.y += 32.0f + this->unk_1C0; + + if ((i % 8) == 0) { + Math_Vec3f_Copy(&D_809F4370[i / 8], &sp7C); + } + + if ((sp7C.x >= 0.0f) && (sp7C.y >= 0.0f) && (sp7C.x < 64.0f) && (sp7C.y < 64.0f)) { + s32 x = sp7C.x; + s32 idx = ((s32)sp7C.y << 5); + + idx += (x / 2); + + if ((x % 2) != 0) { + this->unk_200[idx] &= 0xF0; + } else { + this->unk_200[idx] &= 0xF; + } + } + } + } +} + +#ifdef NON_MATCHING +// v/a flips +void Boss06_Draw(Actor* thisx, GlobalContext* globalCtx2) { + GlobalContext* globalCtx = globalCtx2; + Boss06* this = THIS; + s32 i; + f32 spE0 = 0.0f; + s16 temp_s0; + s16 temp_f10; + Vtx* temp_v0_2; + u32 temp_v0; + u8 spD3; + u8 spD2; + s32 pad; + f32 sp68; + + OPEN_DISPS(globalCtx->state.gfxCtx); + + func_8012C2DC(globalCtx->state.gfxCtx); + func_8012C28C(globalCtx->state.gfxCtx); + + temp_v0 = gSaveContext.save.time; + if (gSaveContext.save.time > 0x8000) { + temp_v0 = (0xFFFF - gSaveContext.save.time) & 0xFFFF; + } + sp68 = (f32)temp_v0 / 0x8000; + spD3 = ((10.0f * sp68) + 105.0f) * this->unk_19C; + spD2 = ((40.0f * sp68) + 55.0f) * this->unk_19C; + + if (this->unk_144 & 2) { + temp_s0 = Math_SinS(D_809F4970->unk_144) * 1000.0f; + temp_f10 = (Math_CosS(D_809F4970->unk_144) * -2000.0f) - 2000.0f; + temp_v0_2 = SEGMENTED_TO_VIRTUAL(&object_knight_Vtx_018BD0); + + temp_v0_2[0].v.ob[1] = (s16)this->unk_1A0 + 0xE92; + temp_v0_2[3].v.ob[1] = (s16)this->unk_1A0 + 0xE92; + temp_v0_2[4].v.ob[1] = (s16)this->unk_1A0 + 0xE92; + temp_v0_2[7].v.ob[1] = (s16)this->unk_1A0 + 0xE92; + + temp_v0_2[5].v.ob[0] = temp_s0 + 0x2A3; + temp_v0_2[5].v.ob[2] = (temp_f10 + (s16)this->unk_1A4) - 0x708; + + temp_v0_2[6].v.ob[0] = temp_s0 - 0x2A3; + temp_v0_2[6].v.ob[2] = (temp_f10 + (s16)this->unk_1A4) - 0x708; + + temp_v0_2[9].v.ob[0] = temp_s0 + 0x2A3; + temp_v0_2[9].v.ob[2] = temp_f10 - 0x1C2; + + temp_v0_2[11].v.ob[0] = temp_s0 - 0x2A3; + temp_v0_2[11].v.ob[2] = temp_f10 - 0x1C2; + + temp_v0_2[12].v.ob[0] = temp_s0 + 0x2A3; + temp_v0_2[12].v.ob[2] = temp_f10 - 0x1C2; + + temp_v0_2[14].v.ob[0] = temp_s0 - 0x339; + temp_v0_2[14].v.ob[2] = temp_f10 - 0x79E; + + temp_v0_2[15].v.ob[0] = temp_s0 - 0x339; + temp_v0_2[15].v.ob[2] = temp_f10; + + temp_v0_2[16].v.ob[0] = temp_s0 + 0x339; + temp_v0_2[16].v.ob[2] = temp_f10; + + temp_v0_2[17].v.ob[0] = temp_s0 + 0x339; + temp_v0_2[17].v.ob[2] = temp_f10 - 0x79E; + + if (this->actor.child != NULL) { + Actor* child = this->actor.child; + + child->world.pos.x = this->actor.world.pos.x + (temp_s0 * 0.1f); + child->world.pos.z = (this->actor.world.pos.z - 170.0f) + (temp_f10 * 0.1f); + } + + AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&object_knight_Matanimheader_019360)); + Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y - 234.0f, + this->actor.world.pos.z + 30.0f, 0); + Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY); + Matrix_InsertTranslation(0.0f, 0.0f, -1112.0f, MTXMODE_APPLY); + + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x9B, 255, 255, (u8)((140.0f * sp68) + 115.0f), spD3); + gSPDisplayList(POLY_XLU_DISP++, object_knight_DL_018CF0); + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0xFF, 255, 255, (u8)((100.0f * sp68) + 65.0f), spD2); + gSPDisplayList(POLY_XLU_DISP++, object_knight_DL_018DE0); + } + + if (this->unk_144 & 1) { + gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(&this->unk_200)); + + Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y + this->unk_1A8, + this->actor.world.pos.z, MTXMODE_NEW); + Matrix_Scale(this->actor.scale.x, this->actor.scale.y, 0.0f, MTXMODE_APPLY); + Matrix_RotateY(this->actor.shape.rot.y, MTXMODE_APPLY); + + gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(POLY_OPA_DISP++, object_knight_DL_0193B0); + + if (this->unk_1D8 > 0.0f) { + Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y + 84.0f, + this->actor.world.pos.z - 2.0f, MTXMODE_NEW); + Matrix_RotateY(this->actor.shape.rot.y, MTXMODE_APPLY); + func_809F2120(1, 0x71A5, 0x263A); + + gDPSetEnvColor(POLY_XLU_DISP++, 255, 10, 0, 0); + gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 255, 0, 230); + + for (i = 0; i < ARRAY_COUNT(D_809F4370); i++) { + if ((fabsf(D_809F4370[i].x - 32.0f) < 30.0f) && (fabsf(D_809F4370[i].y - 32.0f) < 30.0f)) { + Matrix_StatePush(); + + gSPSegment(POLY_XLU_DISP++, 0x08, + Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, 0, 0x20, 0x40, 1, 0, + ((globalCtx->gameplayFrames + (i * 10)) * -20) % 512, 0x20, 0x80)); + + Matrix_InsertTranslation((D_809F4370[i].x - 32.0f) * -2.4f, (D_809F4370[i].y - 32.0f) * -2.4f, 0.0f, + MTXMODE_APPLY); + Matrix_InsertZRotation_f(i * (M_PI / 64), MTXMODE_APPLY); + + if (func_809F2140() < 0.5f) { + Matrix_InsertYRotation_f(M_PI, MTXMODE_APPLY); + } + + Matrix_Scale(-0.002f, -this->unk_1D8, 1.0f, MTXMODE_APPLY); + + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), + G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(POLY_XLU_DISP++, gGameplayKeepDrawFlameDL); + + Matrix_StatePop(); + } + } + } else { + spE0 = 7.0f; + } + } + + if (this->unk_1DC > 0.0f) { + u8 temp_s2 = (this->unk_1E0 - 50.0f) + (50.0f * sp68); + + Matrix_InsertTranslation(this->actor.world.pos.x + this->unk_1B0, + this->actor.world.pos.y + 84.0f + this->unk_1B4, + (this->actor.world.pos.z - 2.0f) + spE0, MTXMODE_NEW); + + gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_023348); + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, (u8)((140.0f * sp68) + 115.0f), temp_s2); + gDPSetEnvColor(POLY_XLU_DISP++, 255, 205, (u8)((100.0f * sp68) + 65.0f), 128); + + Matrix_Scale(this->unk_1DC, this->unk_1DC, 1.0f, MTXMODE_APPLY); + Matrix_InsertZRotation_s(globalCtx->gameplayFrames * 64, MTXMODE_APPLY); + + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_023428); + } + + CLOSE_DISPS(globalCtx->state.gfxCtx); +} +#else #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_06/Boss06_Draw.s") +#endif diff --git a/src/overlays/actors/ovl_Boss_06/z_boss_06.h b/src/overlays/actors/ovl_Boss_06/z_boss_06.h index b793b284b..d7e6875a2 100644 --- a/src/overlays/actors/ovl_Boss_06/z_boss_06.h +++ b/src/overlays/actors/ovl_Boss_06/z_boss_06.h @@ -7,11 +7,47 @@ struct Boss06; typedef void (*Boss06ActionFunc)(struct Boss06*, GlobalContext*); +#define ENBOSS06_GET_PARAMS(thisx) ((thisx)->params) + typedef struct Boss06 { /* 0x0000 */ Actor actor; - /* 0x0144 */ char unk_144[0x54]; + /* 0x0144 */ u8 unk_144; + /* 0x0146 */ s16 unk_146; + /* 0x0148 */ s16 unk_148; + /* 0x014C */ ColliderCylinder collider; /* 0x0198 */ Boss06ActionFunc actionFunc; - /* 0x019C */ char unk_19C[0x894]; + /* 0x019C */ f32 unk_19C; + /* 0x01A0 */ f32 unk_1A0; + /* 0x01A4 */ f32 unk_1A4; + /* 0x01A8 */ f32 unk_1A8; + /* 0x01AC */ f32 unk_1AC; + /* 0x01B0 */ f32 unk_1B0; + /* 0x01B4 */ f32 unk_1B4; + /* 0x01B8 */ UNK_TYPE1 unk1B8[4]; + /* 0x01BC */ f32 unk_1BC; + /* 0x01C0 */ f32 unk_1C0; + /* 0x01C4 */ UNK_TYPE1 unk1C4[4]; + /* 0x01C8 */ u8 unk_1C8; + /* 0x01C9 */ u8 unk_1C9; + /* 0x01CA */ s16 unk_1CA; + /* 0x01CC */ f32 unk_1CC; + /* 0x01D0 */ f32 unk_1D0; + /* 0x01D4 */ f32 unk_1D4; + /* 0x01D8 */ f32 unk_1D8; + /* 0x01DC */ f32 unk_1DC; + /* 0x01E0 */ f32 unk_1E0; + /* 0x01E4 */ f32 unk_1E4; + /* 0x01E8 */ UNK_TYPE1 unk1E8[0x15]; + /* 0x01FD */ u8 unk_1FD; + /* 0x01FE */ u8 unk_1FE; + /* 0x01FF */ u8 unk_1FF; + /* 0x0200 */ u8 unk_200[0x800]; + /* 0x0A00 */ s16 unk_A00; + /* 0x0A04 */ Vec3f unk_A04; + /* 0x0A10 */ Vec3f unk_A10; + /* 0x0A1C */ Vec3f unk_A1C; + /* 0x0A28 */ f32 unk_A28; + /* 0x0A2C */ f32 unk_A2C; } Boss06; // size = 0xA30 extern const ActorInit Boss_06_InitVars; diff --git a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c index 9cc359c9e..c85a48eb8 100644 --- a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c +++ b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c @@ -5,6 +5,8 @@ */ #include "z_demo_kankyo.h" +#include "objects/gameplay_keep/gameplay_keep.h" +#include "objects/object_bubble/object_bubble.h" #define FLAGS 0x00000030 @@ -17,10 +19,6 @@ void DemoKankyo_Draw(Actor* thisx, GlobalContext* globalCtx); void DemoKakyo_MoonSparklesActionFunc(DemoKankyo* this, GlobalContext* globalCtx); -extern Gfx D_0407AB58[]; -extern Gfx D_06001000[]; // the bubble display list used by shabom in giants type -extern Gfx D_04023428[]; - static u8 sLostWoodsSparklesMutex = false; // make sure only one can exist at once static s16 sLostWoodsSkyFishParticleNum = 0; @@ -512,8 +510,8 @@ void DemoKankyo_Update(Actor* thisx, GlobalContext* globalCtx) { } void DemoKakyo_DrawLostWoodsSparkle(Actor* thisx, GlobalContext* globalCtx2) { - DemoKankyo* this = THIS; GlobalContext* globalCtx = globalCtx2; + DemoKankyo* this = THIS; s16 i; f32 scaleAlpha; Vec3f worldPos; @@ -525,8 +523,8 @@ void DemoKakyo_DrawLostWoodsSparkle(Actor* thisx, GlobalContext* globalCtx2) { POLY_XLU_DISP = Gfx_CallSetupDL(POLY_XLU_DISP, 20); - gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(&D_04079B10)); - gSPDisplayList(POLY_XLU_DISP++, D_0407AB10); + gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(gameplay_keep_Tex_079B10)); + gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_07AB10); for (i = 0; i < globalCtx->envCtx.unk_F2[3]; i++) { worldPos.x = this->particles[i].posBase.x + this->particles[i].posOffset.x; @@ -593,7 +591,7 @@ void DemoKakyo_DrawLostWoodsSparkle(Actor* thisx, GlobalContext* globalCtx2) { gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_XLU_DISP++, D_0407AB58); + gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_07AB58); } } @@ -603,8 +601,8 @@ void DemoKakyo_DrawLostWoodsSparkle(Actor* thisx, GlobalContext* globalCtx2) { // draw, giants and moon void DemoKankyo_DrawMoonAndGiant(Actor* thisx, GlobalContext* globalCtx2) { - DemoKankyo* this = THIS; GlobalContext* globalCtx = globalCtx2; + DemoKankyo* this = THIS; s16 i; f32 alphaScale; @@ -657,7 +655,7 @@ void DemoKankyo_DrawMoonAndGiant(Actor* thisx, GlobalContext* globalCtx2) { break; } - gSPDisplayList(POLY_XLU_DISP++, &D_04023348); + gSPDisplayList(POLY_XLU_DISP++, &gameplay_keep_DL_023348); Matrix_InsertMatrix(&globalCtx->billboardMtxF, MTXMODE_APPLY); @@ -667,9 +665,9 @@ void DemoKankyo_DrawMoonAndGiant(Actor* thisx, GlobalContext* globalCtx2) { G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); if (this->actor.params == DEMO_KANKYO_TYPE_GIANTS) { - gSPDisplayList(POLY_XLU_DISP++, D_06001000); + gSPDisplayList(POLY_XLU_DISP++, object_bubble_DL_001000); } else { - gSPDisplayList(POLY_XLU_DISP++, D_04023428); + gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_023428); } } } diff --git a/src/overlays/actors/ovl_Dm_Char07/z_dm_char07.c b/src/overlays/actors/ovl_Dm_Char07/z_dm_char07.c index efb716667..290f5a797 100644 --- a/src/overlays/actors/ovl_Dm_Char07/z_dm_char07.c +++ b/src/overlays/actors/ovl_Dm_Char07/z_dm_char07.c @@ -5,6 +5,7 @@ */ #include "z_dm_char07.h" +#include "objects/object_milkbar/object_milkbar.h" #define FLAGS 0x00000030 @@ -29,24 +30,6 @@ const ActorInit Dm_Char07_InitVars = { (ActorFunc)DmChar07_Draw, }; -extern Gfx D_06000100[]; -extern Gfx D_06000240[]; -extern Gfx D_06000650[]; -extern Gfx D_06000790[]; -extern Gfx D_06000B80[]; -extern Gfx D_06000CC0[]; -extern Gfx D_060010D0[]; -extern Gfx D_06001210[]; -extern Gfx D_060015E0[]; -extern Gfx D_060016B8[]; -extern Gfx D_06002BA0[]; -extern Gfx D_06002CD0[]; -extern CollisionHeader D_06006688; -extern Gfx D_060076A0[]; -extern Gfx D_06007918[]; -extern AnimatedMaterial D_060105F8; -extern Gfx D_06010D68[]; - void DmChar07_SetupAction(DmChar07* this, DmChar07ActionFunc actionFunc) { this->actionFunc = actionFunc; } @@ -62,7 +45,7 @@ void DmChar07_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_SetScale(&this->dyna.actor, 0.1f); this->isStage = 1; DynaPolyActor_Init(&this->dyna, 0); - DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06006688); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_milkbar_Colheader_006688); } else { Actor_SetScale(&this->dyna.actor, 1.0f); } @@ -96,36 +79,36 @@ void DmChar07_Draw(Actor* thisx, GlobalContext* globalCtx) { gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); switch (this->dyna.actor.params) { case DMCHAR07_STAGE: - gSPDisplayList(POLY_OPA_DISP++, D_06002CD0); + gSPDisplayList(POLY_OPA_DISP++, object_milkbar_DL_002CD0); break; case DMCHAR07_CREDITS_STAGE: - AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&D_060105F8)); - gSPDisplayList(POLY_OPA_DISP++, D_06007918); - gSPDisplayList(POLY_OPA_DISP++, D_06000240); - gSPDisplayList(POLY_OPA_DISP++, D_06000790); - gSPDisplayList(POLY_OPA_DISP++, D_06000CC0); - gSPDisplayList(POLY_OPA_DISP++, D_06001210); - gSPDisplayList(POLY_OPA_DISP++, D_060016B8); + AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(object_milkbar_Matanimheader_0105F8)); + gSPDisplayList(POLY_OPA_DISP++, object_milkbar_DL_007918); + gSPDisplayList(POLY_OPA_DISP++, object_milkbar_DL_000240); + gSPDisplayList(POLY_OPA_DISP++, object_milkbar_DL_000790); + gSPDisplayList(POLY_OPA_DISP++, object_milkbar_DL_000CC0); + gSPDisplayList(POLY_OPA_DISP++, object_milkbar_DL_001210); + gSPDisplayList(POLY_OPA_DISP++, object_milkbar_DL_0016B8); break; case DMCHAR07_SPOTLIGHTS: if (this->spotlightFlags & DMCHAR07_STAGE_RIGHT_SPOTLIGHT) { - gSPDisplayList(POLY_OPA_DISP++, D_06000240); + gSPDisplayList(POLY_OPA_DISP++, object_milkbar_DL_000240); } if (this->spotlightFlags & DMCHAR07_UPSTAGE_RIGHT_SPOTLIGHT) { - gSPDisplayList(POLY_OPA_DISP++, D_06000790); + gSPDisplayList(POLY_OPA_DISP++, object_milkbar_DL_000790); } if (this->spotlightFlags & DMCHAR07_STAGE_CENTER_SPOTLIGHT) { - gSPDisplayList(POLY_OPA_DISP++, D_06000CC0); + gSPDisplayList(POLY_OPA_DISP++, object_milkbar_DL_000CC0); } if (this->spotlightFlags & DMCHAR07_UPSTAGE_LEFT_SPOTLIGHT) { - gSPDisplayList(POLY_OPA_DISP++, D_06001210); + gSPDisplayList(POLY_OPA_DISP++, object_milkbar_DL_001210); } if (this->spotlightFlags & DMCHAR07_DOWNSTAGE_CENTER_SPOTLIGHT) { - gSPDisplayList(POLY_OPA_DISP++, D_060016B8); + gSPDisplayList(POLY_OPA_DISP++, object_milkbar_DL_0016B8); } break; case DMCHAR07_DISHES: - gSPDisplayList(POLY_OPA_DISP++, D_06010D68); + gSPDisplayList(POLY_OPA_DISP++, object_milkbar_DL_010D68); break; } @@ -133,31 +116,31 @@ void DmChar07_Draw(Actor* thisx, GlobalContext* globalCtx) { gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); switch (this->dyna.actor.params) { case DMCHAR07_STAGE: - gSPDisplayList(POLY_XLU_DISP++, D_06002BA0); + gSPDisplayList(POLY_XLU_DISP++, object_milkbar_DL_002BA0); break; case DMCHAR07_CREDITS_STAGE: - gSPDisplayList(POLY_XLU_DISP++, D_060076A0); - gSPDisplayList(POLY_XLU_DISP++, D_06000100); - gSPDisplayList(POLY_XLU_DISP++, D_06000650); - gSPDisplayList(POLY_XLU_DISP++, D_06000B80); - gSPDisplayList(POLY_XLU_DISP++, D_060010D0); - gSPDisplayList(POLY_XLU_DISP++, D_060015E0); + gSPDisplayList(POLY_XLU_DISP++, object_milkbar_DL_0076A0); + gSPDisplayList(POLY_XLU_DISP++, object_milkbar_DL_000100); + gSPDisplayList(POLY_XLU_DISP++, object_milkbar_DL_000650); + gSPDisplayList(POLY_XLU_DISP++, object_milkbar_DL_000B80); + gSPDisplayList(POLY_XLU_DISP++, object_milkbar_DL_0010D0); + gSPDisplayList(POLY_XLU_DISP++, object_milkbar_DL_0015E0); break; case DMCHAR07_SPOTLIGHTS: if (this->spotlightFlags & DMCHAR07_STAGE_RIGHT_SPOTLIGHT) { - gSPDisplayList(POLY_OPA_DISP++, D_06000100); + gSPDisplayList(POLY_OPA_DISP++, object_milkbar_DL_000100); } if (this->spotlightFlags & DMCHAR07_UPSTAGE_RIGHT_SPOTLIGHT) { - gSPDisplayList(POLY_OPA_DISP++, D_06000650); + gSPDisplayList(POLY_OPA_DISP++, object_milkbar_DL_000650); } if (this->spotlightFlags & DMCHAR07_STAGE_CENTER_SPOTLIGHT) { - gSPDisplayList(POLY_OPA_DISP++, D_06000B80); + gSPDisplayList(POLY_OPA_DISP++, object_milkbar_DL_000B80); } if (this->spotlightFlags & DMCHAR07_UPSTAGE_LEFT_SPOTLIGHT) { - gSPDisplayList(POLY_OPA_DISP++, D_060010D0); + gSPDisplayList(POLY_OPA_DISP++, object_milkbar_DL_0010D0); } if (this->spotlightFlags & DMCHAR07_DOWNSTAGE_CENTER_SPOTLIGHT) { - gSPDisplayList(POLY_OPA_DISP++, D_060015E0); + gSPDisplayList(POLY_OPA_DISP++, object_milkbar_DL_0015E0); } break; case DMCHAR07_DISHES: diff --git a/src/overlays/actors/ovl_Dm_Nb/z_dm_nb.c b/src/overlays/actors/ovl_Dm_Nb/z_dm_nb.c index 0e9b87191..871cc0cf2 100644 --- a/src/overlays/actors/ovl_Dm_Nb/z_dm_nb.c +++ b/src/overlays/actors/ovl_Dm_Nb/z_dm_nb.c @@ -5,6 +5,7 @@ */ #include "z_dm_nb.h" +#include "objects/object_nb/object_nb.h" #define FLAGS 0x00000009 @@ -27,10 +28,7 @@ const ActorInit Dm_Nb_InitVars = { (ActorFunc)DmNb_Draw, }; -extern AnimationHeader D_06000990; -extern FlexSkeletonHeader D_06008C40; - -static ActorAnimationEntryS D_80C1E200[] = { &D_06000990, 1.0f, 0, -1, 0, 0 }; +static ActorAnimationEntryS D_80C1E200[] = { &object_nb_Anim_000990, 1.0f, 0, -1, 0, 0 }; s32 func_80C1DED0(DmNb* this, s32 arg1) { s32 ret = 0; @@ -72,7 +70,8 @@ void DmNb_Init(Actor* thisx, GlobalContext* globalCtx) { DmNb* this = THIS; ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06008C40, NULL, this->jointTable, this->morphTable, 8); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_nb_Skel_008C40, NULL, this->jointTable, this->morphTable, + 8); this->unk1F0 = -1; func_80C1DED0(this, 0); this->actor.flags &= ~1; diff --git a/src/overlays/actors/ovl_Dm_Sa/z_dm_sa.c b/src/overlays/actors/ovl_Dm_Sa/z_dm_sa.c index 16c559983..53e0fec63 100644 --- a/src/overlays/actors/ovl_Dm_Sa/z_dm_sa.c +++ b/src/overlays/actors/ovl_Dm_Sa/z_dm_sa.c @@ -5,6 +5,7 @@ */ #include "z_dm_sa.h" +#include "objects/object_stk/object_stk.h" #define FLAGS 0x00000030 @@ -29,10 +30,7 @@ const ActorInit Dm_Sa_InitVars = { (ActorFunc)DmSa_Draw, }; -extern FlexSkeletonHeader D_06013328; -extern AnimationHeader D_0600CC94; - -static ActorAnimationEntry D_80A2ED00[] = { { &D_0600CC94, 1.0f, 0, -1.0f, 0, 0 } }; +static ActorAnimationEntry D_80A2ED00[] = { { &object_stk_Anim_00CC94, 1.0f, 0, -1.0f, 0, 0 } }; void func_80A2E960(SkelAnime* arg0, ActorAnimationEntry* animations, u16 index) { f32 frameCount; @@ -54,7 +52,7 @@ void DmSa_Init(Actor* thisx, GlobalContext* globalCtx) { this->alpha = 0xFF; this->actor.targetArrowOffset = 3000.0f; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06013328, NULL, NULL, NULL, 0); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_stk_Skel_013328, NULL, NULL, NULL, 0); func_80A2E960(&this->skelAnime, D_80A2ED00, 0); Actor_SetScale(&this->actor, 0.01f); this->actionFunc = DmSa_DoNothing; diff --git a/src/overlays/actors/ovl_Dm_Statue/z_dm_statue.c b/src/overlays/actors/ovl_Dm_Statue/z_dm_statue.c index edfa0567d..d4ca48e11 100644 --- a/src/overlays/actors/ovl_Dm_Statue/z_dm_statue.c +++ b/src/overlays/actors/ovl_Dm_Statue/z_dm_statue.c @@ -5,6 +5,7 @@ */ #include "z_dm_statue.h" +#include "objects/object_smtower/object_smtower.h" #define FLAGS 0x04000030 @@ -27,9 +28,6 @@ const ActorInit Dm_Statue_InitVars = { (ActorFunc)DmStatue_Draw, }; -extern AnimatedMaterial D_06001788; -extern Gfx D_06000520[]; - void DmStatue_Init(Actor* thisx, GlobalContext* globalCtx) { DmStatue* this = THIS; @@ -43,6 +41,6 @@ void DmStatue_Update(Actor* thisx, GlobalContext* globalCtx) { } void DmStatue_Draw(Actor* thisx, GlobalContext* globalCtx) { - AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&D_06001788)); - Gfx_DrawDListXlu(globalCtx, D_06000520); + AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(object_smtower_Matanimheader_001788)); + Gfx_DrawDListXlu(globalCtx, object_smtower_DL_000520); } diff --git a/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c b/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c index 5c51b8345..a3d109c91 100644 --- a/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c +++ b/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c @@ -5,6 +5,9 @@ */ #include "z_dm_stk.h" +#include "objects/object_stk/object_stk.h" +#include "objects/object_stk2/object_stk2.h" +#include "objects/object_stk3/object_stk3.h" #define FLAGS 0x02000030 @@ -30,96 +33,6 @@ void func_80AA1C64(DmStk* this, GlobalContext* globalCtx); void func_80AA2720(DmStk* this, GlobalContext* globalCtx); void func_80AA27EC(DmStk* this, GlobalContext* globalCtx); -extern AnimationHeader D_0600055C; -extern AnimationHeader D_06001030; -extern AnimationHeader D_0600130C; -extern AnimationHeader D_06001374; -extern AnimationHeader D_06001EDC; -extern AnimationHeader D_06002774; -extern AnimationHeader D_06002CD8; -extern AnimationHeader D_06003068; -extern AnimationHeader D_060035C8; -extern AnimationHeader D_060039F0; -extern AnimationHeader D_06004554; -extern AnimationHeader D_06004580; -extern Gfx D_060046B0[]; -extern AnimationHeader D_060049C8; -extern AnimationHeader D_060051C0; -extern Gfx D_060053C0[]; -extern Gfx D_06005870[]; -extern AnimationHeader D_06005F44; -extern Gfx D_06006BB0[]; -extern AnimationHeader D_060070DC; -extern Gfx D_06007840[]; -extern Gfx D_060079F0[]; -extern Gfx D_060084C0[]; -extern UNK_TYPE D_06008658; -extern Gfx D_060087B0[]; -extern Gfx D_06008A80[]; -extern Gfx D_060090C0[]; -extern Gfx D_06009710[]; -extern Gfx D_06009AC0[]; -extern Gfx D_06009DA0[]; -extern Gfx D_0600A530[]; -extern Gfx D_0600A5C0[]; -extern Gfx D_0600AE30[]; -extern Gfx D_0600AEC0[]; -extern AnimationHeader D_0600BB2C; -extern AnimationHeader D_0600C270; -extern AnimationHeader D_0600C964; -extern Gfx D_0600CAD0[]; -extern AnimationHeader D_0600CBB8; -extern AnimationHeader D_0600D830; -extern AnimationHeader D_0600E6EC; -extern AnimationHeader D_0600EEC0; -extern AnimationHeader D_060101A4; -extern AnimationHeader D_06010B60; -extern AnimationHeader D_060110B4; -extern AnimationHeader D_06011FB0; -extern AnimationHeader D_06012A58; -extern FlexSkeletonHeader D_06013328; -extern AnimationHeader D_060141E4; -extern AnimationHeader D_06014920; -extern AnimationHeader D_06015028; -extern AnimationHeader D_06015C14; -extern AnimationHeader D_06016508; -extern Gfx D_06016620[]; -extern AnimationHeader D_06016910; -extern AnimationHeader D_06018ED0; -extern AnimationHeader D_0601AA80; -extern AnimationHeader D_0601C114; -extern AnimationHeader D_0601C21C; -extern AnimationHeader D_0601D008; -extern AnimationHeader D_0601D07C; -extern AnimationHeader D_0601D3D0; -extern AnimationHeader D_0601DDE0; -extern AnimationHeader D_0601EF50; -extern AnimationHeader D_0601F9E4; -extern AnimationHeader D_06020CAC; -extern AnimationHeader D_0602200C; -extern AnimationHeader D_0602336C; -extern AnimationHeader D_060259F4; -extern AnimationHeader D_060266C8; -extern AnimationHeader D_06026CF4; -extern AnimationHeader D_06027CF4; -extern AnimationHeader D_06028F28; -extern AnimationHeader D_06029A04; -extern AnimationHeader D_0602A2D8; -extern AnimationHeader D_0602AD54; -extern AnimationHeader D_0602DC64; -extern AnimationHeader D_0602E9A0; -extern AnimationHeader D_0602FA70; -extern AnimationHeader D_0603021C; -extern AnimationHeader D_06031210; -extern AnimationHeader D_060322FC; -extern AnimationHeader D_06032AE0; -extern AnimationHeader D_0603323C; -extern AnimationHeader D_06034FD8; -extern AnimationHeader D_06036964; -extern AnimationHeader D_06037B94; -extern AnimationHeader D_0603967C; -extern AnimationHeader D_0603A8F8; - const ActorInit Dm_Stk_InitVars = { ACTOR_DM_STK, ACTORCAT_ITEMACTION, @@ -190,42 +103,42 @@ static DamageTable sDamageTable = { }; static ActorAnimationEntry sAnimations[] = { - { &D_0601C21C, 1.0f, 0.0f, -1.0f, 0, 0.0f }, { &D_0601D3D0, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &D_06001030, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_0601D008, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &D_0601D008, 1.0f, 0.0f, -1.0f, 0, 0.0f }, { &D_06015C14, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &D_060070DC, 1.0f, 0.0f, -1.0f, 0, 0.0f }, { &D_0600D830, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &D_0600055C, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_0600130C, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &D_0600C270, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_0600CBB8, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &D_0601AA80, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_0601D07C, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &D_06016910, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_06018ED0, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &D_0601DDE0, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_0601EF50, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &D_0602DC64, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_0602E9A0, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &D_0602DC64, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_0602E9A0, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &D_060035C8, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_060049C8, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &D_060259F4, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_060266C8, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &D_06026CF4, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_0601C114, 1.0f, 0.0f, -1.0f, 2, 0.0f }, - { &D_06004580, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_06020CAC, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &D_0602200C, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_0602336C, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &D_06002774, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_06003068, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &D_060101A4, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_06010B60, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &D_0602A2D8, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_0601F9E4, 1.0f, 0.0f, -1.0f, 2, 0.0f }, - { &D_06029A04, 1.0f, 0.0f, -1.0f, 0, 0.0f }, { &D_0602AD54, 1.0f, 0.0f, -1.0f, 2, 0.0f }, - { &D_0600BB2C, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_0600C964, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &D_060110B4, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_06011FB0, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &D_06012A58, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_060141E4, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &D_0600E6EC, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_0600EEC0, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &D_06027CF4, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_06028F28, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &D_0603323C, 1.0f, 0.0f, -1.0f, 0, 0.0f }, { &D_06031210, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &D_060322FC, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_06032AE0, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &D_0603021C, 1.0f, 0.0f, -1.0f, 0, 0.0f }, { &D_06036964, 1.0f, 0.0f, -1.0f, 2, 0.0f }, - { &D_06016508, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_06015028, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &D_06014920, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_0602FA70, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &D_06037B94, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_0603967C, 1.0f, 0.0f, -1.0f, 2, 0.0f }, - { &D_0603967C, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_0603A8F8, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &D_06034FD8, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_06005F44, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &D_06002CD8, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_060039F0, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &D_06004554, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_060051C0, 1.0f, 0.0f, -1.0f, 0, 0.0f }, - { &D_06001374, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_06001EDC, 1.0f, 0.0f, -1.0f, 0, 0.0f }, + { &object_stk_Anim_01C21C, 1.0f, 0.0f, -1.0f, 0, 0.0f }, { &object_stk_Anim_01D3D0, 1.0f, 0.0f, -1.0f, 0, 0.0f }, + { &object_stk_Anim_001030, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk_Anim_01D008, 1.0f, 0.0f, -1.0f, 0, 0.0f }, + { &object_stk_Anim_01D008, 1.0f, 0.0f, -1.0f, 0, 0.0f }, { &object_stk_Anim_015C14, 1.0f, 0.0f, -1.0f, 0, 0.0f }, + { &object_stk2_Anim_0070DC, 1.0f, 0.0f, -1.0f, 0, 0.0f }, { &object_stk2_Anim_00D830, 1.0f, 0.0f, -1.0f, 0, 0.0f }, + { &object_stk2_Anim_00055C, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk2_Anim_00130C, 1.0f, 0.0f, -1.0f, 0, 0.0f }, + { &object_stk2_Anim_00C270, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk2_Anim_00CBB8, 1.0f, 0.0f, -1.0f, 0, 0.0f }, + { &object_stk2_Anim_01AA80, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk2_Anim_01D07C, 1.0f, 0.0f, -1.0f, 0, 0.0f }, + { &object_stk2_Anim_016910, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk2_Anim_018ED0, 1.0f, 0.0f, -1.0f, 0, 0.0f }, + { &object_stk2_Anim_01DDE0, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk2_Anim_01EF50, 1.0f, 0.0f, -1.0f, 0, 0.0f }, + { &object_stk2_Anim_02DC64, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk2_Anim_02E9A0, 1.0f, 0.0f, -1.0f, 0, 0.0f }, + { &object_stk2_Anim_02DC64, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk2_Anim_02E9A0, 1.0f, 0.0f, -1.0f, 0, 0.0f }, + { &object_stk2_Anim_0035C8, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk2_Anim_0049C8, 1.0f, 0.0f, -1.0f, 0, 0.0f }, + { &object_stk2_Anim_0259F4, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk2_Anim_0266C8, 1.0f, 0.0f, -1.0f, 0, 0.0f }, + { &object_stk2_Anim_026CF4, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk2_Anim_01C114, 1.0f, 0.0f, -1.0f, 2, 0.0f }, + { &object_stk2_Anim_004580, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk2_Anim_020CAC, 1.0f, 0.0f, -1.0f, 0, 0.0f }, + { &object_stk2_Anim_02200C, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk2_Anim_02336C, 1.0f, 0.0f, -1.0f, 0, 0.0f }, + { &object_stk_Anim_002774, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk_Anim_003068, 1.0f, 0.0f, -1.0f, 0, 0.0f }, + { &object_stk2_Anim_0101A4, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk2_Anim_010B60, 1.0f, 0.0f, -1.0f, 0, 0.0f }, + { &object_stk2_Anim_02A2D8, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk2_Anim_01F9E4, 1.0f, 0.0f, -1.0f, 2, 0.0f }, + { &object_stk2_Anim_029A04, 1.0f, 0.0f, -1.0f, 0, 0.0f }, { &object_stk2_Anim_02AD54, 1.0f, 0.0f, -1.0f, 2, 0.0f }, + { &object_stk_Anim_00BB2C, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk_Anim_00C964, 1.0f, 0.0f, -1.0f, 0, 0.0f }, + { &object_stk2_Anim_0110B4, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk2_Anim_011FB0, 1.0f, 0.0f, -1.0f, 0, 0.0f }, + { &object_stk2_Anim_012A58, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk2_Anim_0141E4, 1.0f, 0.0f, -1.0f, 0, 0.0f }, + { &object_stk2_Anim_00E6EC, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk2_Anim_00EEC0, 1.0f, 0.0f, -1.0f, 0, 0.0f }, + { &object_stk2_Anim_027CF4, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk2_Anim_028F28, 1.0f, 0.0f, -1.0f, 0, 0.0f }, + { &object_stk2_Anim_03323C, 1.0f, 0.0f, -1.0f, 0, 0.0f }, { &object_stk2_Anim_031210, 1.0f, 0.0f, -1.0f, 0, 0.0f }, + { &object_stk2_Anim_0322FC, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk2_Anim_032AE0, 1.0f, 0.0f, -1.0f, 0, 0.0f }, + { &object_stk2_Anim_03021C, 1.0f, 0.0f, -1.0f, 0, 0.0f }, { &object_stk2_Anim_036964, 1.0f, 0.0f, -1.0f, 2, 0.0f }, + { &object_stk_Anim_016508, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk_Anim_015028, 1.0f, 0.0f, -1.0f, 0, 0.0f }, + { &object_stk_Anim_014920, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk2_Anim_02FA70, 1.0f, 0.0f, -1.0f, 0, 0.0f }, + { &object_stk2_Anim_037B94, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk2_Anim_03967C, 1.0f, 0.0f, -1.0f, 2, 0.0f }, + { &object_stk2_Anim_03967C, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk2_Anim_03A8F8, 1.0f, 0.0f, -1.0f, 0, 0.0f }, + { &object_stk2_Anim_034FD8, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk3_Anim_005F44, 1.0f, 0.0f, -1.0f, 0, 0.0f }, + { &object_stk3_Anim_002CD8, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk3_Anim_0039F0, 1.0f, 0.0f, -1.0f, 0, 0.0f }, + { &object_stk3_Anim_004554, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk3_Anim_0051C0, 1.0f, 0.0f, -1.0f, 0, 0.0f }, + { &object_stk3_Anim_001374, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &object_stk3_Anim_001EDC, 1.0f, 0.0f, -1.0f, 0, 0.0f }, }; void func_80A9FDB0(DmStk* this, GlobalContext* globalCtx) { @@ -965,7 +878,7 @@ void DmStk_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.targetArrowOffset = 1100.0f; this->unk_334 = 99; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06013328, NULL, NULL, NULL, 0); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_stk_Skel_013328, NULL, NULL, NULL, 0); func_80A9FE3C(this, globalCtx, &this->skelAnime, &sAnimations[this->unk_2E0], 0); } @@ -1680,11 +1593,11 @@ void DmStk_PostLimbDraw2(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, V gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); if ((this->unk_2E0 == 69) || (this->unk_2E0 == 11) || (this->unk_2E0 == 71)) { - gSPDisplayList(POLY_OPA_DISP++, D_0600AEC0); - gSPDisplayList(POLY_OPA_DISP++, D_0600AE30); + gSPDisplayList(POLY_OPA_DISP++, object_stk_DL_00AEC0); + gSPDisplayList(POLY_OPA_DISP++, object_stk_DL_00AE30); } else { - gSPDisplayList(POLY_OPA_DISP++, D_0600A5C0); - gSPDisplayList(POLY_OPA_DISP++, D_0600A530); + gSPDisplayList(POLY_OPA_DISP++, object_stk_DL_00A5C0); + gSPDisplayList(POLY_OPA_DISP++, object_stk_DL_00A530); } switch (this->unk_32C) { @@ -1699,16 +1612,16 @@ void DmStk_PostLimbDraw2(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, V } POLY_OPA_DISP = Gfx_SetFog(POLY_OPA_DISP, this->unk_2E8, this->unk_2EC, this->unk_2F0, this->unk_2F4, this->unk_2F8, this->unk_2FC); - gSPDisplayList(POLY_OPA_DISP++, D_06006BB0); + gSPDisplayList(POLY_OPA_DISP++, object_stk_DL_006BB0); POLY_OPA_DISP = func_801660B8(globalCtx, POLY_OPA_DISP); } else { - gSPDisplayList(POLY_OPA_DISP++, D_06006BB0); + gSPDisplayList(POLY_OPA_DISP++, object_stk_DL_006BB0); } break; case 2: - gSPDisplayList(POLY_OPA_DISP++, D_06006BB0); - gSPDisplayList(POLY_OPA_DISP++, D_06005870); + gSPDisplayList(POLY_OPA_DISP++, object_stk_DL_006BB0); + gSPDisplayList(POLY_OPA_DISP++, object_stk_DL_005870); if (func_800EE29C(globalCtx, 0x201) && (globalCtx->csCtx.npcActions[func_800EE200(globalCtx, 0x201)]->unk0 == 2) && (this->unk_337 >= 0)) { @@ -1718,8 +1631,8 @@ void DmStk_PostLimbDraw2(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, V gSPSegment(POLY_OPA_DISP++, 0x06, globalCtx->objectCtx.status[this->unk_337].segment); - AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&D_06008658)); - Gfx_DrawDListOpa(globalCtx, D_06007840); + AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(object_stk2_Matanimheader_008658)); + Gfx_DrawDListOpa(globalCtx, object_stk2_DL_007840); gSegments[6] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[this->unk_336].segment); gSPSegment(POLY_OPA_DISP++, 0x06, globalCtx->objectCtx.status[this->unk_336].segment); @@ -1742,20 +1655,20 @@ void DmStk_PostLimbDraw2(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, V switch (this->unk_32D) { case 0: - gSPDisplayList(POLY_OPA_DISP++, D_06009AC0); - gSPDisplayList(POLY_OPA_DISP++, D_060046B0); + gSPDisplayList(POLY_OPA_DISP++, object_stk_DL_009AC0); + gSPDisplayList(POLY_OPA_DISP++, object_stk_DL_0046B0); break; case 1: - gSPDisplayList(POLY_OPA_DISP++, D_06009710); - gSPDisplayList(POLY_OPA_DISP++, D_060053C0); + gSPDisplayList(POLY_OPA_DISP++, object_stk_DL_009710); + gSPDisplayList(POLY_OPA_DISP++, object_stk_DL_0053C0); break; case 3: - gSPDisplayList(POLY_OPA_DISP++, D_06009DA0); + gSPDisplayList(POLY_OPA_DISP++, object_stk_DL_009DA0); if ((globalCtx->sceneNum == SCENE_LOST_WOODS) && (gSaveContext.sceneSetupIndex == 1)) { - gSPDisplayList(POLY_OPA_DISP++, D_0600CAD0); + gSPDisplayList(POLY_OPA_DISP++, object_stk_DL_00CAD0); } break; @@ -1766,7 +1679,7 @@ void DmStk_PostLimbDraw2(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, V gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, D_06006BB0); + gSPDisplayList(POLY_OPA_DISP++, object_stk_DL_006BB0); break; } @@ -1783,33 +1696,33 @@ void DmStk_PostLimbDraw2(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, V break; case 1: - gSPDisplayList(POLY_OPA_DISP++, D_060084C0); + gSPDisplayList(POLY_OPA_DISP++, object_stk_DL_0084C0); break; case 2: - gSPDisplayList(POLY_OPA_DISP++, D_060090C0); - gSPDisplayList(POLY_OPA_DISP++, D_060079F0); + gSPDisplayList(POLY_OPA_DISP++, object_stk_DL_0090C0); + gSPDisplayList(POLY_OPA_DISP++, object_stk_DL_0079F0); break; case 3: if ((globalCtx->sceneNum != SCENE_LOST_WOODS) || (gSaveContext.sceneSetupIndex != 1)) { - gSPDisplayList(POLY_OPA_DISP++, D_0600CAD0); + gSPDisplayList(POLY_OPA_DISP++, object_stk_DL_00CAD0); } - gSPDisplayList(POLY_OPA_DISP++, D_060090C0); + gSPDisplayList(POLY_OPA_DISP++, object_stk_DL_0090C0); break; case 4: - gSPDisplayList(POLY_OPA_DISP++, D_060090C0); + gSPDisplayList(POLY_OPA_DISP++, object_stk_DL_0090C0); break; case 6: - gSPDisplayList(POLY_OPA_DISP++, D_06008A80); - gSPDisplayList(POLY_OPA_DISP++, D_06016620); + gSPDisplayList(POLY_OPA_DISP++, object_stk_DL_008A80); + gSPDisplayList(POLY_OPA_DISP++, object_stk_DL_016620); break; case 9: if (this->unk_2E4 == 255) { - gSPDisplayList(POLY_OPA_DISP++, D_060087B0); + gSPDisplayList(POLY_OPA_DISP++, object_stk_DL_0087B0); } break; } @@ -1829,7 +1742,7 @@ void DmStk_Draw(Actor* thisx, GlobalContext* globalCtx) { if (this->unk_33B != 0) { if (this->actor.params == 1) { - Gfx_DrawDListOpa(globalCtx, D_06006BB0); + Gfx_DrawDListOpa(globalCtx, object_stk_DL_006BB0); return; } diff --git a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c index 167dbfe69..05b79fb63 100644 --- a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c +++ b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c @@ -5,6 +5,7 @@ */ #include "z_door_ana.h" +#include "objects/gameplay_field_keep/gameplay_field_keep.h" #define FLAGS 0x02000000 @@ -208,5 +209,5 @@ void DoorAna_Update(Actor* thisx, GlobalContext* globalCtx) { } void DoorAna_Draw(Actor* thisx, GlobalContext* globalCtx) { - Gfx_DrawDListXlu(globalCtx, D_05000C40); + Gfx_DrawDListXlu(globalCtx, gameplay_field_keep_DL_000C40); } diff --git a/src/overlays/actors/ovl_Door_Spiral/z_door_spiral.c b/src/overlays/actors/ovl_Door_Spiral/z_door_spiral.c index 3e9754ccf..27d8bd211 100644 --- a/src/overlays/actors/ovl_Door_Spiral/z_door_spiral.c +++ b/src/overlays/actors/ovl_Door_Spiral/z_door_spiral.c @@ -5,9 +5,17 @@ */ #include "z_door_spiral.h" +#include "objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h" +#include "objects/object_numa_obj/object_numa_obj.h" +#include "objects/object_hakugin_obj/object_hakugin_obj.h" +#include "objects/object_ikana_obj/object_ikana_obj.h" +#include "objects/object_ikninside_obj/object_ikninside_obj.h" +#include "objects/object_danpei_object/object_danpei_object.h" #define FLAGS 0x00000010 +#define THIS ((DoorSpiral*)thisx) + #define GET_ORIENTATION_PARAM(this) ((((Actor*)(this))->params >> 7) & 0x1) #define GET_UNK145_PARAM(this) ((((Actor*)(this))->params >> 8) & 0x3) #define GET_TRANSITION_ID_PARAM(this) ((u16)((Actor*)(this))->params >> 10) @@ -75,29 +83,16 @@ const ActorInit Door_Spiral_InitVars = { (ActorFunc)DoorSpiral_Draw, }; -extern Gfx D_06000590[]; -extern Gfx D_060007A8[]; -extern Gfx D_06000EA0[]; -extern Gfx D_060012C0[]; -extern Gfx D_060014C8[]; -extern Gfx D_06002110[]; -extern Gfx D_06004448[]; -extern Gfx D_060051B8[]; -extern Gfx D_06006128[]; -extern Gfx D_06009278[]; -extern Gfx D_06012B70[]; -extern Gfx D_06013EA8[]; - // Parameters for each staircase, indexed with SpiralType static SpiralInfo sSpiralInfo[] = { - { { NULL, NULL }, 0, 130, 12, 50, 15 }, // SPIRAL_OVERWORLD - { { D_050219E0, D_0501D980 }, 0, 130, 12, 50, 15 }, // SPIRAL_DUNGEON - { { D_06004448, D_060007A8 }, 0, 130, 12, 50, 15 }, // SPIRAL_WOODFALL_TEMPLE - { { D_060051B8, D_060014C8 }, 0, 130, 12, 50, 15 }, // SPIRAL_WOODFALL_TEMPLE_ALT - { { D_06009278, D_06006128 }, 0, 130, 12, 50, 15 }, // SPIRAL_SNOWHEAD_TEMPLE - { { D_06013EA8, D_06012B70 }, 0, 130, 12, 50, 15 }, // SPIRAL_STONE_TOWER - { { D_06000EA0, D_06000590 }, 0, 130, 12, 50, 15 }, // SPIRAL_IKANA_CASTLE - { { D_06002110, D_060012C0 }, 0, 130, 12, 50, 15 }, // SPIRAL_DAMPES_HOUSE + { { NULL, NULL }, 0, 130, 12, 50, 15 }, // SPIRAL_OVERWORLD + { { gameplay_dangeon_keep_DL_0219E0, gameplay_dangeon_keep_DL_01D980 }, 0, 130, 12, 50, 15 }, // SPIRAL_DUNGEON + { { object_numa_obj_DL_004448, object_numa_obj_DL_0007A8 }, 0, 130, 12, 50, 15 }, // SPIRAL_WOODFALL_TEMPLE + { { object_numa_obj_DL_0051B8, object_numa_obj_DL_0014C8 }, 0, 130, 12, 50, 15 }, // SPIRAL_WOODFALL_TEMPLE_ALT + { { object_hakugin_obj_DL_009278, object_hakugin_obj_DL_006128 }, 0, 130, 12, 50, 15 }, // SPIRAL_SNOWHEAD_TEMPLE + { { object_ikana_obj_DL_013EA8, object_ikana_obj_DL_012B70 }, 0, 130, 12, 50, 15 }, // SPIRAL_STONE_TOWER + { { object_ikninside_obj_DL_000EA0, object_ikninside_obj_DL_000590 }, 0, 130, 12, 50, 15 }, // SPIRAL_IKANA_CASTLE + { { object_danpei_object_DL_002110, object_danpei_object_DL_0012C0 }, 0, 130, 12, 50, 15 }, // SPIRAL_DAMPES_HOUSE }; // Defines which object bank a staircase should use, and its index to `sSpiralInfo` @@ -182,7 +177,7 @@ static InitChainEntry sInitChain[] = { }; void DoorSpiral_Init(Actor* thisx, GlobalContext* globalCtx) { - DoorSpiral* this = (DoorSpiral*)thisx; + DoorSpiral* this = THIS; s32 pad; s32 transition = GET_TRANSITION_ID_PARAM(thisx); s8 objBankId; @@ -308,7 +303,7 @@ void DoorSpiral_PlayerClimb(DoorSpiral* this, GlobalContext* globalCtx) { } void DoorSpiral_Update(Actor* thisx, GlobalContext* globalCtx) { - DoorSpiral* this = (DoorSpiral*)thisx; + DoorSpiral* this = THIS; s32 pad; Player* player = GET_PLAYER(globalCtx); @@ -319,7 +314,7 @@ void DoorSpiral_Update(Actor* thisx, GlobalContext* globalCtx) { void DoorSpiral_Draw(Actor* thisx, GlobalContext* globalCtx) { s32 pad; - DoorSpiral* this = (DoorSpiral*)thisx; + DoorSpiral* this = THIS; if (this->actor.objBankIndex == this->bankIndex) { SpiralInfo* spiralInfo = &sSpiralInfo[this->spiralType]; diff --git a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c index 40afc258f..e128fc945 100644 --- a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c +++ b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c @@ -1035,7 +1035,7 @@ void func_808BB4F4(DoorWarp1* this, GlobalContext* globalCtx2) { Matrix_InsertTranslation(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y + this->unk_1A4, this->dyna.actor.world.pos.z, MTXMODE_NEW); Matrix_Scale(4.0f, this->unk_1AC, 4.0f, MTXMODE_APPLY); - AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&object_warp1_Matanimheader_0044D8)); + AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(object_warp1_Matanimheader_0044D8)); Gfx_DrawDListXlu(globalCtx, object_warp1_DL_003230); return; } @@ -1054,7 +1054,7 @@ void func_808BB4F4(DoorWarp1* this, GlobalContext* globalCtx2) { MTXMODE_NEW); Matrix_RotateY(this->dyna.actor.world.rot.y, MTXMODE_APPLY); Matrix_Scale(1.0f, this->unk_1A8, 1.0f, MTXMODE_APPLY); - AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&object_warp1_Matanimheader_0057D8)); + AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(object_warp1_Matanimheader_0057D8)); OPEN_DISPS(globalCtx->state.gfxCtx); @@ -1066,7 +1066,7 @@ void func_808BB4F4(DoorWarp1* this, GlobalContext* globalCtx2) { gSPDisplayList(POLY_XLU_DISP++, object_warp1_DL_004690); gfxCtx = globalCtx->state.gfxCtx; - AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&object_warp1_Matanimheader_007238)); + AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(object_warp1_Matanimheader_007238)); Matrix_InsertTranslation(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z, MTXMODE_NEW); Matrix_RotateY(this->dyna.actor.world.rot.y, MTXMODE_APPLY); diff --git a/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c b/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c index 697ea58e8..7582a378a 100644 --- a/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c +++ b/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c @@ -5,6 +5,7 @@ */ #include "z_eff_dust.h" +#include "objects/gameplay_keep/gameplay_keep.h" #include "system_malloc.h" #define FLAGS 0x00000030 @@ -295,7 +296,7 @@ void func_80919768(Actor* thisx, GlobalContext* globalCtx2) { gSPClearGeometryMode(POLY_XLU_DISP++, G_FOG | G_LIGHTING); - gSPDisplayList(POLY_XLU_DISP++, D_04054A90); + gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_054A90); gSPSetGeometryMode(POLY_XLU_DISP++, G_FOG | G_LIGHTING); } @@ -351,7 +352,7 @@ void func_809199FC(Actor* thisx, GlobalContext* globalCtx2) { gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPClearGeometryMode(POLY_XLU_DISP++, G_FOG | G_LIGHTING); - gSPDisplayList(POLY_XLU_DISP++, D_04054A90); + gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_054A90); gSPSetGeometryMode(POLY_XLU_DISP++, G_FOG | G_LIGHTING); } diff --git a/src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.c b/src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.c index 8702ecc4d..e973b7016 100644 --- a/src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.c +++ b/src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.c @@ -980,9 +980,9 @@ s32 EnAob01_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dLis Actor* thisx) { EnAob01* this = THIS; TexturePtr sp38[] = { - &object_aob_Tex_000658, - &object_aob_Tex_000E58, - &object_aob_Tex_001658, + object_aob_Tex_000658, + object_aob_Tex_000E58, + object_aob_Tex_001658, }; if (limbIndex == 15) { diff --git a/src/overlays/actors/ovl_En_Baguo/z_en_baguo.c b/src/overlays/actors/ovl_En_Baguo/z_en_baguo.c index 2668c1d68..f6a2895aa 100644 --- a/src/overlays/actors/ovl_En_Baguo/z_en_baguo.c +++ b/src/overlays/actors/ovl_En_Baguo/z_en_baguo.c @@ -5,7 +5,6 @@ */ #include "z_en_baguo.h" -#include "objects/object_gmo/object_gmo.h" #include "objects/gameplay_keep/gameplay_keep.h" #define FLAGS 0x00000005 @@ -28,6 +27,21 @@ void EnBaguo_InitializeParticle(EnBaguo* this, Vec3f* position, Vec3f* velocity, void EnBaguo_UpdateParticles(EnBaguo* this, GlobalContext* globalCtx); void EnBaguo_DrawRockParticles(EnBaguo* this, GlobalContext* globalCtx); +typedef enum { + /* 0x0 */ NEJIRON_ACTION_INACTIVE, // The Nejiron is either underground or emerging from underground + /* 0x1 */ NEJIRON_ACTION_ACTIVE, // The Nejiron is above ground and actively chasing the player + /* 0x2 */ NEJIRON_ACTION_RETREATING, // The Nejiron is burrowing back underground + /* 0x3 */ NEJIRON_ACTION_EXPLODING // The Nejiron has detonated +} NejironAction; + +/** + * These directions are relative to the Nejiron. + */ +typedef enum { + /* 0x0 */ NEJIRON_DIRECTION_RIGHT, + /* 0x1 */ NEJIRON_DIRECTION_LEFT +} NejironRollDirection; + const ActorInit En_Baguo_InitVars = { ACTOR_EN_BAGUO, ACTORCAT_ENEMY, @@ -112,7 +126,8 @@ void EnBaguo_Init(Actor* thisx, GlobalContext* globalCtx) { EnBaguo* this = THIS; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 0.0f); - SkelAnime_Init(globalCtx, &this->skelAnime, &gNejironSkel, NULL, this->jointTable, this->morphTable, 3); + SkelAnime_Init(globalCtx, &this->skelAnime, &gNejironSkel, NULL, this->jointTable, this->morphTable, + NEJIRON_LIMB_MAX); this->actor.hintId = 0xB; this->maxDistanceFromHome = 240.0f; this->maxDistanceFromHome += this->actor.world.rot.z * 40.0f; @@ -120,12 +135,14 @@ void EnBaguo_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, 0.01f); this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->actor.targetMode = 2; + Collider_InitAndSetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, this->colliderElements); this->collider.elements[0].dim.modelSphere.radius = 30; this->collider.elements[0].dim.scale = 1.0f; this->collider.elements[0].dim.modelSphere.center.x = 80; this->collider.elements[0].dim.modelSphere.center.y = 80; this->collider.elements[0].dim.modelSphere.center.z = 0; + this->actor.shape.yOffset = -3000.0f; this->actor.gravity = -3.0f; this->actor.colChkInfo.damageTable = &sDamageTable; @@ -195,26 +212,27 @@ void EnBaguo_Idle(EnBaguo* this, GlobalContext* globalCtx) { } } this->actor.shape.rot.y = this->actor.world.rot.y; - return; - } - - yaw = this->actor.yawTowardsPlayer - this->actor.world.rot.y; - absoluteYaw = ABS_ALT(yaw); - Math_Vec3f_Copy(&this->targetRotation, &gZeroVec3f); - Math_Vec3f_Copy(&this->currentRotation, &gZeroVec3f); - if (absoluteYaw < 0x2000) { - this->targetRotation.x = 2000.0f; } else { - this->zRollDirection = NEJIRON_DIRECTION_RIGHT; - this->targetRotation.z = 2000.0f; - if ((s16)(this->actor.yawTowardsPlayer - this->actor.world.rot.y) > 0) { - this->zRollDirection = NEJIRON_DIRECTION_LEFT; + yaw = this->actor.yawTowardsPlayer - this->actor.world.rot.y; + absoluteYaw = ABS_ALT(yaw); + Math_Vec3f_Copy(&this->targetRotation, &gZeroVec3f); + Math_Vec3f_Copy(&this->currentRotation, &gZeroVec3f); + + if (absoluteYaw < 0x2000) { + this->targetRotation.x = 2000.0f; + } else { + this->zRollDirection = NEJIRON_DIRECTION_RIGHT; + this->targetRotation.z = 2000.0f; + if ((s16)(this->actor.yawTowardsPlayer - this->actor.world.rot.y) > 0) { + this->zRollDirection = NEJIRON_DIRECTION_LEFT; + } } + + this->timer = 38; + this->actor.world.rot.y = this->actor.yawTowardsPlayer; + this->bouncedFlag = 0; + this->actionFunc = EnBaguo_Roll; } - this->timer = 38; - this->actor.world.rot.y = this->actor.yawTowardsPlayer; - this->hardHitFlag = 0; - this->actionFunc = EnBaguo_Roll; } void EnBaguo_Roll(EnBaguo* this, GlobalContext* globalCtx) { @@ -224,35 +242,33 @@ void EnBaguo_Roll(EnBaguo* this, GlobalContext* globalCtx) { if ((sqrtf(SQ(xDistanceFromHome) + SQ(zDistanceFromHome)) > this->maxDistanceFromHome) || (Player_GetMask(globalCtx) == PLAYER_MASK_STONE)) { EnBaguo_SetupRetreatUnderground(this); - return; - } - - if (this->timer == 0) { + } else if (this->timer == 0) { this->timer = 100; this->actor.world.rot.y = this->actor.shape.rot.y; this->actionFunc = EnBaguo_Idle; this->actor.speedXZ = 0.0f; - return; - } - - if (!this->hardHitFlag && this->collider.base.atFlags & AC_HARD) { - this->zRollDirection ^= 1; - this->hardHitFlag = 1; - this->actor.speedXZ = -7.0f; - } - - Math_ApproachF(&this->currentRotation.x, this->targetRotation.x, 0.2f, 1000.0f); - Math_ApproachF(&this->currentRotation.z, this->targetRotation.z, 0.2f, 1000.0f); - Math_ApproachF(&this->actor.speedXZ, 5.0f, 0.3f, 0.5f); - this->actor.world.rot.x += (s16)this->currentRotation.x; - if (this->currentRotation.z != 0.0f) { - if (this->zRollDirection == NEJIRON_DIRECTION_RIGHT) { - this->actor.world.rot.z += (s16)this->currentRotation.z; - } else { - this->actor.world.rot.z -= (s16)this->currentRotation.z; + } else { + if (!this->bouncedFlag && this->collider.base.atFlags & AT_BOUNCED) { + this->zRollDirection ^= 1; + this->bouncedFlag = 1; + this->actor.speedXZ = -7.0f; } + + Math_ApproachF(&this->currentRotation.x, this->targetRotation.x, 0.2f, 1000.0f); + Math_ApproachF(&this->currentRotation.z, this->targetRotation.z, 0.2f, 1000.0f); + Math_ApproachF(&this->actor.speedXZ, 5.0f, 0.3f, 0.5f); + this->actor.world.rot.x += (s16)this->currentRotation.x; + + if (this->currentRotation.z != 0.0f) { + if (this->zRollDirection == NEJIRON_DIRECTION_RIGHT) { + this->actor.world.rot.z += (s16)this->currentRotation.z; + } else { + this->actor.world.rot.z -= (s16)this->currentRotation.z; + } + } + + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BAKUO_ROLL - SFX_FLAG); } - Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BAKUO_ROLL - SFX_FLAG); } void EnBaguo_SetupRetreatUnderground(EnBaguo* this) { @@ -268,8 +284,10 @@ void EnBaguo_RetreatUnderground(EnBaguo* this, GlobalContext* globalCtx) { Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->actor.world.pos, this->actor.shape.shadowScale - 20.0f, 10, 8.0f, 500, 10, 1); } + Math_ApproachF(&this->actor.shape.yOffset, -3000.0f, 100.0f, 500.0f); Math_ApproachZeroF(&this->actor.shape.shadowScale, 0.3f, 5.0f); + if (this->actor.shape.yOffset < -2970.0f) { this->actor.shape.yOffset = -3000.0f; this->actor.draw = EnBaguo_DrawBody; @@ -285,6 +303,7 @@ void EnBaguo_PostDetonation(EnBaguo* this, GlobalContext* globalCtx) { if (this->timer == 0) { Actor_MarkForDeath(&this->actor); } + if (this->timer >= 26) { CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } @@ -331,6 +350,7 @@ void EnBaguo_CheckForDetonation(EnBaguo* this, GlobalContext* globalCtx) { this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, CLEAR_TAG_POP); Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_BOMB_EXPLOSION); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BAKUO_DEAD); + this->timer = 30; this->actor.flags |= 0x8000000; this->actor.flags &= ~1; @@ -362,6 +382,7 @@ void EnBaguo_Update(Actor* thisx, GlobalContext* globalCtx) { if (this->action != NEJIRON_ACTION_EXPLODING) { this->actor.shape.rot.x = this->actor.world.rot.x; this->actor.shape.rot.z = this->actor.world.rot.z; + if (this->blinkTimer == 0) { this->eyeIndex++; if (this->eyeIndex >= 3) { @@ -369,6 +390,7 @@ void EnBaguo_Update(Actor* thisx, GlobalContext* globalCtx) { this->blinkTimer = Rand_ZeroFloat(60.0f) + 20.0f; } } + Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 60.0f, 0x1D); if (this->action != NEJIRON_ACTION_INACTIVE) { @@ -449,12 +471,14 @@ void EnBaguo_UpdateParticles(EnBaguo* this, GlobalContext* globalCtx) { particle->velocity.x += particle->acceleration.x; particle->velocity.y += particle->acceleration.y; particle->velocity.z += particle->acceleration.z; + if (particle->position.y < (this->actor.world.pos.y - 10.0f)) { Math_ApproachZeroF(&particle->scale, 0.2f, 0.001f); if (particle->scale <= 0.0001f) { particle->timer = 0; } } + if (particle->timer != 0) { particle->timer--; } else { @@ -470,6 +494,7 @@ void EnBaguo_DrawRockParticles(EnBaguo* this, GlobalContext* globalCtx) { GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; OPEN_DISPS(gfxCtx); + func_8012C28C(globalCtx->state.gfxCtx); for (i = 0; i < ARRAY_COUNT(this->particles); i++, particle++) { if (particle->isVisible) { @@ -478,10 +503,12 @@ void EnBaguo_DrawRockParticles(EnBaguo* this, GlobalContext* globalCtx) { Matrix_RotateY(particle->rotation.y, MTXMODE_APPLY); Matrix_InsertZRotation_s(particle->rotation.z, MTXMODE_APPLY); Matrix_Scale(particle->scale, particle->scale, particle->scale, MTXMODE_APPLY); + gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gDPSetPrimColor(POLY_OPA_DISP++, 0, 1, 255, 255, 255, 255); - gSPDisplayList(POLY_OPA_DISP++, &gameplay_keep_DL_01FA40); + gSPDisplayList(POLY_OPA_DISP++, gBoulderFragmentsDL); } } + CLOSE_DISPS(gfxCtx); } diff --git a/src/overlays/actors/ovl_En_Baguo/z_en_baguo.h b/src/overlays/actors/ovl_En_Baguo/z_en_baguo.h index 2dc1d7b2c..133e68b3d 100644 --- a/src/overlays/actors/ovl_En_Baguo/z_en_baguo.h +++ b/src/overlays/actors/ovl_En_Baguo/z_en_baguo.h @@ -2,26 +2,12 @@ #define Z_EN_BAGUO_H #include "global.h" +#include "objects/object_gmo/object_gmo.h" struct EnBaguo; typedef void (*EnBaguoActionFunc)(struct EnBaguo*, GlobalContext*); -typedef enum { - /* 0x0 */ NEJIRON_ACTION_INACTIVE, // The Nejiron is either underground or emerging from underground - /* 0x1 */ NEJIRON_ACTION_ACTIVE, // The Nejiron is above ground and actively chasing the player - /* 0x2 */ NEJIRON_ACTION_RETREATING, // The Nejiron is burrowing back underground - /* 0x3 */ NEJIRON_ACTION_EXPLODING // The Nejiron has detonated -} NejironAction; - -/** - * These directions are relative to the Nejiron. - */ -typedef enum { - /* 0x0 */ NEJIRON_DIRECTION_RIGHT, - /* 0x1 */ NEJIRON_DIRECTION_LEFT -} NejironRollDirection; - /** * When a Nejiron explodes, rock particles fly out from where it exploded. * This struct governs how these rock particles behave. @@ -39,8 +25,8 @@ typedef struct NejironParticle { typedef struct EnBaguo { /* 0x000 */ Actor actor; /* 0x144 */ SkelAnime skelAnime; - /* 0x188 */ Vec3s jointTable[3]; - /* 0x19A */ Vec3s morphTable[3]; + /* 0x188 */ Vec3s jointTable[NEJIRON_LIMB_MAX]; + /* 0x19A */ Vec3s morphTable[NEJIRON_LIMB_MAX]; /* 0x1AC */ EnBaguoActionFunc actionFunc; /* 0x1B0 */ s16 eyeIndex; /* 0x1B2 */ s16 blinkTimer; @@ -48,7 +34,7 @@ typedef struct EnBaguo { /* 0x1B6 */ s16 action; /* 0x1B8 */ s16 zRollDirection; /* 0x1BC */ f32 maxDistanceFromHome; - /* 0x1C0 */ u8 hardHitFlag; + /* 0x1C0 */ u8 bouncedFlag; /* 0x1C4 */ Vec3f currentRotation; /* 0x1D0 */ Vec3f targetRotation; /* 0x1DC */ ColliderJntSph collider; diff --git a/src/overlays/actors/ovl_En_Baisen/z_en_baisen.c b/src/overlays/actors/ovl_En_Baisen/z_en_baisen.c index 7b691d11b..35be17fd1 100644 --- a/src/overlays/actors/ovl_En_Baisen/z_en_baisen.c +++ b/src/overlays/actors/ovl_En_Baisen/z_en_baisen.c @@ -5,6 +5,7 @@ */ #include "z_en_baisen.h" +#include "objects/object_bai/object_bai.h" #define FLAGS 0x00000009 @@ -22,11 +23,6 @@ void func_80BE895C(EnBaisen* this, GlobalContext* globalCtx); void func_80BE8AAC(EnBaisen* this, GlobalContext* globalCtx); void func_80BE89D8(EnBaisen* this, GlobalContext* globalCtx); -extern FlexSkeletonHeader D_06007908; -extern AnimationHeader D_060011C0; -extern AnimationHeader D_060008B4; -extern AnimationHeader D_06008198; - const ActorInit En_Baisen_InitVars = { ACTOR_EN_BAISEN, ACTORCAT_NPC, @@ -61,7 +57,7 @@ static ColliderCylinderInit sCylinderInit = { static u16 sTextIds[] = { 0x2ABD, 0x2ABB, 0x2AD5, 0x2AD6, 0x2AD7, 0x2AD8, 0x2AC6 }; -static AnimationHeader* D_80BE8E4C[] = { &D_060011C0, &D_060008B4, &D_06008198 }; +static AnimationHeader* D_80BE8E4C[] = { &object_bai_Anim_0011C0, &object_bai_Anim_0008B4, &object_bai_Anim_008198 }; static u8 animModes[] = { 0, 0 }; @@ -69,7 +65,8 @@ void EnBaisen_Init(Actor* thisx, GlobalContext* globalCtx) { EnBaisen* this = THIS; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06007908, &D_060011C0, this->jointTable, this->morphTable, 20); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_bai_Skel_007908, &object_bai_Anim_0011C0, this->jointTable, + this->morphTable, 20); this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->paramCopy = this->actor.params; if (this->actor.params == 0) { diff --git a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c index 65ef97e26..da18c1180 100644 --- a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c +++ b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c @@ -5,6 +5,7 @@ */ #include "z_en_bigokuta.h" +#include "assets/objects/object_bigokuta/object_bigokuta.h" #define FLAGS 0x00000005 @@ -15,7 +16,21 @@ void EnBigokuta_Destroy(Actor* thisx, GlobalContext* globalCtx); void EnBigokuta_Update(Actor* thisx, GlobalContext* globalCtx); void EnBigokuta_Draw(Actor* thisx, GlobalContext* globalCtx); -#if 0 +void func_80AC2B4C(GlobalContext* globalCtx, EnBigokuta* this); +void EnBigokuta_SetupIdle(EnBigokuta* this); +void EnBigokuta_Idle(EnBigokuta* this, GlobalContext* globalCtx); +void EnBigokuta_SetupRise(EnBigokuta* this, GlobalContext* globalCtx); +void EnBigokuta_RiseOutOfWater(EnBigokuta* this, GlobalContext* globalCtx); +void EnBigokuta_SetupIdleAboveWater(EnBigokuta* this); +void EnBigokuta_IdleAboveWater(EnBigokuta* this, GlobalContext* globalCtx); +void EnBigokuta_SetupSuckInPlayer(EnBigokuta* this, GlobalContext* globalCtx); +void EnBigokuta_SuckInPlayer(EnBigokuta* this, GlobalContext* globalCtx); +void EnBigokuta_SetupHoldPlayer(EnBigokuta* this); +void EnBigokuta_HoldPlayer(EnBigokuta* this, GlobalContext* globalCtx); +void EnBigokuta_PlayDeathCutscene(EnBigokuta* this, GlobalContext* globalCtx); +void EnBigokuta_SetupDeathEffects(EnBigokuta* this); +void EnBigokuta_PlayDeathEffects(EnBigokuta* this, GlobalContext* globalCtx); + const ActorInit En_Bigokuta_InitVars = { ACTOR_EN_BIGOKUTA, ACTORCAT_BOSS, @@ -28,25 +43,54 @@ const ActorInit En_Bigokuta_InitVars = { (ActorFunc)EnBigokuta_Draw, }; -// static ColliderCylinderInit sCylinderInit = { -static ColliderCylinderInit D_80AC4530 = { - { COLTYPE_HARD, AT_NONE, AC_ON | AC_HARD | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_CYLINDER, }, - { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFC74F, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, }, +typedef enum { + BIGOCTO_DRAWEFFECT_ICE = 10, + BIGOCTO_DRAWEFFECT_LIGHT_ORBS = 20, +} EnBigokutaDrawEffect; + +static ColliderCylinderInit sShellCylinderInit = { + { + COLTYPE_HARD, + AT_NONE, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xF7CFC74F, 0x00, 0x00 }, + TOUCH_NONE | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 75, 125, 0, { 0, 0, 0 } }, }; -// static ColliderCylinderInit sCylinderInit = { -static ColliderCylinderInit D_80AC455C = { - { COLTYPE_HIT0, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, OC2_TYPE_1, COLSHAPE_CYLINDER, }, - { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x000038B0, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_NONE, }, +static ColliderCylinderInit sBodyCylinderInit = { + { + COLTYPE_HIT0, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_NONE, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0x000038B0, 0x00, 0x00 }, + TOUCH_NONE | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_NONE, + }, { 70, 125, 0, { 0, 0, 0 } }, }; -// sColChkInfoInit -static CollisionCheckInfoInit D_80AC4588 = { 4, 130, 120, MASS_HEAVY }; +static CollisionCheckInfoInit sColChkInfoInit = { 4, 130, 120, MASS_HEAVY }; -// static InitChainEntry sInitChain[] = { -static InitChainEntry D_80AC4590[] = { +static InitChainEntry sInitChain[] = { ICHAIN_F32(uncullZoneForward, 2500, ICHAIN_CONTINUE), ICHAIN_F32(targetArrowOffset, 2000, ICHAIN_CONTINUE), ICHAIN_U8(targetMode, 2, ICHAIN_CONTINUE), @@ -54,73 +98,585 @@ static InitChainEntry D_80AC4590[] = { ICHAIN_VEC3F_DIV1000(scale, 33, ICHAIN_STOP), }; -#endif +void EnBigokuta_Init(Actor* thisx, GlobalContext* globalCtx) { + EnBigokuta* this = THIS; -extern ColliderCylinderInit D_80AC4530; -extern ColliderCylinderInit D_80AC455C; -extern CollisionCheckInfoInit D_80AC4588; -extern InitChainEntry D_80AC4590[]; + Actor_ProcessInitChain(&this->actor, sInitChain); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gBigOctoSkel, &gBigOctoIdleAnim, this->jointTable, + this->morphTable, BIGOKUTA_LIMB_MAX); -extern UNK_TYPE D_06000444; -extern UNK_TYPE D_06000A74; -extern UNK_TYPE D_060014B8; + Collider_InitAndSetCylinder(globalCtx, &this->shellCollider, &this->actor, &sShellCylinderInit); + Collider_InitAndSetCylinder(globalCtx, &this->bodyCollider, &this->actor, &sBodyCylinderInit); + CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); + this->cutscene = ActorCutscene_GetAdditionalCutscene(this->actor.cutscene); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/EnBigokuta_Init.s") + if (gSaveContext.save.weekEventReg[20] & 2 || + ((this->actor.params != 0xFF) && Flags_GetSwitch(globalCtx, this->actor.params))) { + Actor_MarkForDeath(&this->actor); + } else { + this->actor.world.pos.y -= 99.0f; + EnBigokuta_SetupIdle(this); + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/EnBigokuta_Destroy.s") + this->camAt.x = (Math_SinS(this->actor.home.rot.y) * 66.0f) + this->actor.world.pos.x; + this->camAt.y = (this->actor.home.pos.y - 49.5f) + 42.899998f; + this->camAt.z = (Math_CosS(this->actor.home.rot.y) * 66.0f) + this->actor.world.pos.z; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC28B4.s") + this->unkFunc = func_80AC2B4C; // set but never called +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC299C.s") +void EnBigokuta_Destroy(Actor* thisx, GlobalContext* globalCtx) { + EnBigokuta* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC2A1C.s") + Collider_DestroyCylinder(globalCtx, &this->shellCollider); + Collider_DestroyCylinder(globalCtx, &this->bodyCollider); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC2A7C.s") +void EnBigokuta_SetupCutsceneCamera(EnBigokuta* this, GlobalContext* globalCtx, Vec3f* at, Vec3f* eye) { + s16 angle; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC2B4C.s") + ActorCutscene_Start(this->actor.cutscene, &this->actor); + this->camId = ActorCutscene_GetCurrentCamera(this->actor.cutscene); + Play_CameraSetAtEye(globalCtx, this->camId, at, eye); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC2B98.s") + angle = BINANG_SUB(Actor_YawToPoint(&this->actor, eye), this->actor.home.rot.y); + if (angle > 0) { + angle = BINANG_ADD(this->actor.home.rot.y, 0x1800); + } else { + angle = BINANG_SUB(this->actor.home.rot.y, 0x1800); + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC2C30.s") + this->camEye.x = (Math_SinS(angle) * 250.0f) + this->camAt.x; + this->camEye.y = this->camAt.y + 100.0f; + this->camEye.z = (Math_CosS(angle) * 250.0f) + this->camAt.z; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC2C84.s") +void EnBigokuta_MoveCamera(EnBigokuta* this, GlobalContext* globalCtx) { + Camera* camera = Play_GetCamera(globalCtx, this->camId); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC2CE8.s") + Math_Vec3f_StepTo(&camera->eye, &this->camEye, 20.0f); + Math_Vec3f_StepTo(&camera->at, &this->camAt, 20.0f); + Play_CameraSetAtEye(globalCtx, this->camId, &camera->at, &camera->eye); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC2DAC.s") +void EnBigokuta_ResetCamera(EnBigokuta* this, GlobalContext* globalCtx) { + Camera* camera; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC2EBC.s") + if (this->camId != 0) { + camera = Play_GetCamera(globalCtx, this->camId); + Play_CameraSetAtEye(globalCtx, 0, &camera->at, &camera->eye); + this->camId = 0; + ActorCutscene_Stop(this->actor.cutscene); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC2F20.s") +void EnBigokuta_ShootPlayer(EnBigokuta* this, GlobalContext* globalCtx) { + Player* player = GET_PLAYER(globalCtx); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC2F64.s") + if (&this->actor == player->actor.parent) { + player->actor.parent = NULL; + player->unk_AE8 = 100; + player->actor.velocity.y = 0.0f; + player->actor.world.pos.x += 20.0f * Math_SinS(this->actor.home.rot.y); + player->actor.world.pos.z += 20.0f * Math_CosS(this->actor.home.rot.y); + func_800B8D50(globalCtx, &this->actor, 10.0f, this->actor.home.rot.y, 10.0f, 4); + } + EnBigokuta_ResetCamera(this, globalCtx); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC3054.s") +void func_80AC2B4C(GlobalContext* globalCtx, EnBigokuta* this) { + func_8013A530(globalCtx, &this->actor, 3, &this->actor.focus.pos, &this->actor.shape.rot, 280.0f, 1800.0f, -1); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC30EC.s") +s32 EnBigokuta_IsInWater(EnBigokuta* this, GlobalContext* globalCtx) { + WaterBox* box; + s32 bgId; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC31EC.s") + this->actor.floorHeight = BgCheck_EntityRaycastFloor5(&globalCtx->colCtx, &this->actor.floorPoly, &bgId, + &this->actor, &this->actor.world.pos); + if (!WaterBox_GetSurface1_2(globalCtx, &globalCtx->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, + &this->actor.home.pos.y, &box) || + (this->actor.home.pos.y <= this->actor.floorHeight)) { + return false; + } else { + return true; + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC33A4.s") +void EnBigokuta_SpawnRipple(EnBigokuta* this, GlobalContext* globalCtx) { + Vec3f ripplePos; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC33C0.s") + ripplePos.x = this->actor.world.pos.x; + ripplePos.y = this->actor.home.pos.y; + ripplePos.z = this->actor.world.pos.z; + EffectSsGRipple_Spawn(globalCtx, &ripplePos, 1000, 1400, 0); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC3460.s") +void EnBigokuta_SetupIdle(EnBigokuta* this) { + Animation_Change(&this->skelAnime, &gBigOctoIdleAnim, 0.5f, 0.0f, 0.0f, 1, -3.0f); + this->actionFunc = EnBigokuta_Idle; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC34A8.s") +void EnBigokuta_Idle(EnBigokuta* this, GlobalContext* globalCtx) { + Player* player = GET_PLAYER(globalCtx); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC35E8.s") + SkelAnime_Update(&this->skelAnime); + Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y - 99.0f, 2.5f); + Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 5, 0x1000); + if ((this->actor.xzDistToPlayer < 300.0f) && ((player->actor.world.pos.y - this->actor.home.pos.y) < 100.0f)) { + EnBigokuta_SetupRise(this, globalCtx); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC3650.s") +void EnBigokuta_SetupRise(EnBigokuta* this, GlobalContext* globalCtx) { + Vec3f splashPos; + s32 i; + s16 angle = 0; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC3930.s") + Animation_PlayOnce(&this->skelAnime, &gBigOctoRiseOutOfWaterAnim); + splashPos.y = this->actor.home.pos.y; + for (i = 0; i < 8; i++) { + splashPos.x = Math_SinS(angle) * 70.0f + this->actor.world.pos.x; + splashPos.z = Math_CosS(angle) * 70.0f + this->actor.world.pos.z; + EffectSsGSplash_Spawn(globalCtx, &splashPos, NULL, NULL, 0, Rand_S16Offset(1000, 200)); + angle = BINANG_ADD(angle, 0x2000); + } + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DAIOCTA_LAND); + this->actionFunc = EnBigokuta_RiseOutOfWater; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC39A0.s") +void EnBigokuta_RiseOutOfWater(EnBigokuta* this, GlobalContext* globalCtx) { + Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y - 16.5f, 15.0f); + if (SkelAnime_Update(&this->skelAnime)) { + EnBigokuta_SetupIdleAboveWater(this); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/EnBigokuta_Update.s") +void EnBigokuta_SetupIdleAboveWater(EnBigokuta* this) { + Animation_MorphToLoop(&this->skelAnime, &gBigOctoIdleAnim, -5.0f); + this->actionFunc = EnBigokuta_IdleAboveWater; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC3D48.s") +void EnBigokuta_IdleAboveWater(EnBigokuta* this, GlobalContext* globalCtx) { + SkelAnime_Update(&this->skelAnime); + Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y - 16.5f, 2.5f); + Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 5, 0x1000); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC4204.s") + if ((this->actor.xzDistToPlayer > 400.0f) || (this->actor.playerHeightRel > 200.0f)) { + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DAIOCTA_SINK); + EnBigokuta_SetupIdle(this); + } else if ((this->actor.xzDistToPlayer < 200.0f) && globalCtx->grabPlayer(globalCtx, GET_PLAYER(globalCtx))) { + EnBigokuta_SetupSuckInPlayer(this, globalCtx); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/EnBigokuta_Draw.s") +void EnBigokuta_UpdateOrSetupCam(EnBigokuta* this, GlobalContext* globalCtx) { + if (this->actor.cutscene != -1) { + if (this->camId != 0) { + EnBigokuta_MoveCamera(this, globalCtx); + } else if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { + Camera* camera = Play_GetCamera(globalCtx, 0); + + EnBigokuta_SetupCutsceneCamera(this, globalCtx, &camera->at, &camera->eye); + } else { + ActorCutscene_SetIntentToPlay(this->actor.cutscene); + } + } +} + +void EnBigokuta_SetupSuckInPlayer(EnBigokuta* this, GlobalContext* globalCtx) { + Player* player = GET_PLAYER(globalCtx); + + player->actor.parent = &this->actor; + this->actor.shape.rot.y = this->actor.yawTowardsPlayer; + Math_Vec3f_Copy(&this->playerPos, &player->actor.world.pos); + this->timer = 0; + + Animation_Change(&this->skelAnime, &gBigOctoIdleAnim, 1.0f, 12.0f, 12.0f, 2, -3.0f); + ActorCutscene_SetIntentToPlay(this->actor.cutscene); + + this->playerHoldPos.x = (Math_SinS(this->actor.shape.rot.y) * 66.0f) + this->actor.world.pos.x; + this->playerHoldPos.y = (this->actor.home.pos.y - 49.5f) + 42.899998f; + this->playerHoldPos.z = (Math_CosS(this->actor.shape.rot.y) * 66.0f) + this->actor.world.pos.z; + + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_SLIME_DEAD); + this->actionFunc = EnBigokuta_SuckInPlayer; +} + +void EnBigokuta_SuckInPlayer(EnBigokuta* this, GlobalContext* globalCtx) { + Player* player = GET_PLAYER(globalCtx); + + EnBigokuta_UpdateOrSetupCam(this, globalCtx); + SkelAnime_Update(&this->skelAnime); + Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y - 49.5f, 10.0f); + + if (this->timer < 9) { + this->timer++; + } + + player->unk_AE8 = 0; + Math_Vec3f_Copy(&player->actor.world.pos, &this->playerPos); + if (Math_Vec3f_StepTo(&player->actor.world.pos, &this->playerHoldPos, sqrtf(this->timer) * 5.0f) < 0.1f) { + s16 rotY = this->actor.shape.rot.y; + + if (Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, 0x800)) { + EnBigokuta_SetupHoldPlayer(this); + } + + this->playerHoldPos.x = (Math_SinS(this->actor.shape.rot.y) * 66.0f) + this->actor.world.pos.x; + this->playerHoldPos.y = (this->actor.home.pos.y - 49.5f) + 42.899998f; + this->playerHoldPos.z = (Math_CosS(this->actor.shape.rot.y) * 66.0f) + this->actor.world.pos.z; + + Math_Vec3f_Copy(&player->actor.world.pos, &this->playerHoldPos); + Math_Vec3f_Copy(&this->playerPos, &player->actor.world.pos); + player->actor.shape.rot.y += BINANG_SUB(this->actor.shape.rot.y, rotY); + } else { + Math_Vec3f_Copy(&this->playerPos, &player->actor.world.pos); + player->actor.velocity.y = 0.0f; + } +} + +void EnBigokuta_SetupHoldPlayer(EnBigokuta* this) { + this->timer = 12; + this->actionFunc = EnBigokuta_HoldPlayer; +} + +void EnBigokuta_HoldPlayer(EnBigokuta* this, GlobalContext* globalCtx) { + Player* player = GET_PLAYER(globalCtx); + + this->timer--; + if (this->timer >= 0) { + EnBigokuta_UpdateOrSetupCam(this, globalCtx); + Math_Vec3f_Copy(&player->actor.world.pos, &this->playerHoldPos); + + if (this->timer == 0) { + EnBigokuta_ShootPlayer(this, globalCtx); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DAIOCTA_REVERSE); + } + } else if (this->timer == -24) { + EnBigokuta_SetupIdleAboveWater(this); + } +} + +void EnBigokuta_SetupDeathCutscene(EnBigokuta* this) { + ActorCutscene_SetIntentToPlay(this->cutscene); + this->timer = 0; + this->bodyCollider.base.acFlags &= ~AC_ON; + this->actionFunc = EnBigokuta_PlayDeathCutscene; +} + +void EnBigokuta_PlayDeathCutscene(EnBigokuta* this, GlobalContext* globalCtx) { + Player* player; + + this->actor.colorFilterTimer = Animation_GetLastFrame(&gBigOctoDeathAnim); + + if (this->timer != 0) { + this->timer--; + if (this->timer == 0) { + this->drawEffect = 0; + this->drawEffectAlpha = 0.0f; + Actor_SpawnIceEffects(globalCtx, &this->actor, this->limbPos, ARRAY_COUNT(this->limbPos), 2, 0.5f, 0.35f); + EnBigokuta_SetupDeathEffects(this); + } + } else if (ActorCutscene_GetCanPlayNext(this->cutscene)) { + ActorCutscene_Start(this->cutscene, &this->actor); + + if (!(gSaveContext.eventInf[4] & 2) && !(gSaveContext.eventInf[3] & 0x20)) { + func_800B724C(globalCtx, &this->actor, 7); + } else { + player = GET_PLAYER(globalCtx); + player->stateFlags1 |= 0x20; + } + + if (this->drawEffect == BIGOCTO_DRAWEFFECT_ICE) { + this->timer = 3; + } else { + EnBigokuta_SetupDeathEffects(this); + } + } else { + ActorCutscene_SetIntentToPlay(this->cutscene); + } +} + +void EnBigokuta_SetupDeathEffects(EnBigokuta* this) { + Animation_MorphToPlayOnce(&this->skelAnime, &gBigOctoDeathAnim, -5.0f); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DAIOCTA_DEAD2); + this->actor.flags &= ~1; + this->timer = 10; + this->actionFunc = EnBigokuta_PlayDeathEffects; +} + +void EnBigokuta_PlayDeathEffects(EnBigokuta* this, GlobalContext* globalCtx) { + static Vec3f D_80AC45A4 = { 0.0f, -0.5f, 0.0f }; + static Color_RGBA8 D_80AC45B0 = { 255, 255, 255, 255 }; + static Color_RGBA8 D_80AC45B4 = { 100, 255, 255, 255 }; + static Color_RGBA8 D_80AC45B8 = { 150, 150, 150, 0 }; + + if (SkelAnime_Update(&this->skelAnime)) { + this->actor.world.pos.y -= 0.2f; + + if (this->timer > 0) { + this->timer--; + + if (this->timer == 6) { + Vec3f dustPos; + + dustPos.x = this->actor.world.pos.x; + dustPos.y = this->actor.world.pos.y + 150.0f; + dustPos.z = this->actor.world.pos.z; + + func_800B0DE0(globalCtx, &dustPos, &gZeroVec3f, &gZeroVec3f, &D_80AC45B0, &D_80AC45B4, 1200, 20); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_OCTAROCK_DEAD2); + } + } else { + this->actor.world.pos.y -= 0.2f; + + if (Math_StepToF(&this->actor.scale.y, 0.001f, 0.001f)) { + s32 i; + Vec3f bubbleVel; + Vec3f bubblePos; + + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 50, NA_SE_EN_COMMON_WATER_MID); + bubblePos.y = this->actor.world.pos.y; + + for (i = 0; i < 20; i++) { + bubbleVel.x = randPlusMinusPoint5Scaled(10.0f); + bubbleVel.y = Rand_ZeroFloat(5.5f) + 5.5f; + bubbleVel.z = randPlusMinusPoint5Scaled(10.0f); + bubblePos.x = this->actor.world.pos.x + (2.0f * bubbleVel.x); + bubblePos.z = this->actor.world.pos.z + (2.0f * bubbleVel.z); + + EffectSsDtBubble_SpawnCustomColor(globalCtx, &bubblePos, &bubbleVel, &D_80AC45A4, &D_80AC45B0, + &D_80AC45B8, Rand_S16Offset(150, 50), 25, 0); + } + + if (this->actor.params != 0xFF) { + Flags_SetSwitch(globalCtx, this->actor.params); + } + + ActorCutscene_Stop(this->cutscene); + Actor_MarkForDeath(&this->actor); + + if (!(gSaveContext.eventInf[4] & 2) && !(gSaveContext.eventInf[3] & 0x20)) { + func_800B724C(globalCtx, &this->actor, 6); + } else { + Player* player = GET_PLAYER(globalCtx); + + player->stateFlags1 &= ~0x20; + } + } + + if (this->drawEffectAlpha > 0.0f) { + this->drawEffectAlpha = this->actor.scale.y * 30.30303f; + } + } + } else { + Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y - 16.5f, 15.0f); + } +} + +s32 EnBigokuta_IsNearSwampBoat(EnBigokuta* this, GlobalContext* globalCtx) { + this->actor.child = SubS_FindActor(globalCtx, NULL, ACTORCAT_BG, ACTOR_BG_INGATE); + + if ((this->actor.child != NULL) && (Actor_XZDistanceBetweenActors(&this->actor, this->actor.child) < 250.0f)) { + return true; + } else { + return false; + } +} + +void EnBigokuta_CheckOneHitKill(EnBigokuta* this, GlobalContext* globalCtx) { + if ((this->bodyCollider.base.acFlags & AC_ON) && + ((this->bodyCollider.base.acFlags & AC_HIT) || + ((globalCtx->sceneNum == SCENE_20SICHITAI || globalCtx->sceneNum == SCENE_20SICHITAI2) && + EnBigokuta_IsNearSwampBoat(this, globalCtx)))) { + Enemy_StartFinishingBlow(globalCtx, &this->actor); + + if (this->bodyCollider.base.acFlags & AC_HIT) { + if (this->bodyCollider.info.acHitInfo->toucher.dmgFlags & 0x1000) { // Ice Arrow + this->drawEffect = BIGOCTO_DRAWEFFECT_ICE; + this->drawEffectScale = 1.2f; + this->drawEffectSteamScale = 1.8000001f; + this->drawEffectAlpha = 1.0f; + } else if (this->bodyCollider.info.acHitInfo->toucher.dmgFlags & 0x2000) { // Light Arrow + this->drawEffect = BIGOCTO_DRAWEFFECT_LIGHT_ORBS; + this->drawEffectScale = 1.2f; + this->drawEffectAlpha = 4.0f; + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG, + this->bodyCollider.info.bumper.hitPos.x, this->bodyCollider.info.bumper.hitPos.y, + this->bodyCollider.info.bumper.hitPos.z, 0, 0, 0, CLEAR_TAG_LARGE_LIGHT_RAYS); + } + } + + this->bodyCollider.base.acFlags &= ~AC_HIT; + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, Animation_GetLastFrame(&gBigOctoDeathAnim)); + EnBigokuta_ShootPlayer(this, globalCtx); + EnBigokuta_SetupDeathCutscene(this); + } +} + +void EnBigokuta_Update(Actor* thisx, GlobalContext* globalCtx) { + s32 pad; + EnBigokuta* this = THIS; + + if (!EnBigokuta_IsInWater(this, globalCtx)) { + Actor_MarkForDeath(&this->actor); + return; + } + + if (globalCtx->gameplayFrames % 7 == 0) { + EnBigokuta_SpawnRipple(this, globalCtx); + } + + EnBigokuta_CheckOneHitKill(this, globalCtx); + this->actionFunc(this, globalCtx); + + if ((this->bodyCollider.base.acFlags & AC_ON)) { + this->shellCollider.dim.pos.x = Math_SinS(this->actor.shape.rot.y) * -20.0f + this->actor.world.pos.x; + this->shellCollider.dim.pos.y = this->actor.world.pos.y; + this->shellCollider.dim.pos.z = Math_CosS(this->actor.shape.rot.y) * -20.0f + this->actor.world.pos.z; + + this->bodyCollider.dim.pos.x = this->shellCollider.dim.pos.x; + this->bodyCollider.dim.pos.y = this->shellCollider.dim.pos.y; + this->bodyCollider.dim.pos.z = this->shellCollider.dim.pos.z; + + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->bodyCollider.base); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->shellCollider.base); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->shellCollider.base); + Actor_SetFocus(&this->actor, 82.5f); + } + + if (this->drawEffectAlpha > 0.0f) { + if (this->drawEffect != BIGOCTO_DRAWEFFECT_ICE) { + Math_StepToF(&this->drawEffectAlpha, 0.0f, 0.05f); + this->drawEffectScale = (this->drawEffectAlpha + 1.0f) * 0.6f; + this->drawEffectScale = CLAMP_MAX(this->drawEffectScale, 1.2f); + } else if (!Math_StepToF(&this->drawEffectSteamScale, 1.2f, 0.030000001f)) { + func_800B9010(&this->actor, NA_SE_EV_ICE_FREEZE - SFX_FLAG); + } + } +} + +s32 EnBigokuta_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, + Actor* thisx, Gfx** gfx) { + if (limbIndex == BIGOKUTA_LIMB_HEAD) { + EnBigokuta* this = THIS; + s32 envColor; + s16 rotX; + f32 lastFrame; + + if (this->actionFunc == EnBigokuta_PlayDeathEffects) { + lastFrame = Animation_GetLastFrame(&gBigOctoDeathAnim); + envColor = ((255.0f / lastFrame) * (lastFrame - this->skelAnime.curFrame)); + } else { + envColor = 255; + } + gDPPipeSync((*gfx)++); + gDPSetEnvColor((*gfx)++, envColor, envColor, envColor, envColor); + + if (this->actionFunc == EnBigokuta_SuckInPlayer) { + rotX = (s16)(this->timer * 6144.0f * (1 / 9.0f)); + rot->x -= rotX; + } else if (this->actionFunc == EnBigokuta_HoldPlayer) { + if (this->timer == 1) { + rotX = 0; + } else if (this->timer == 0) { + rotX = -0xC00; + } else if (this->timer > 0) { + rotX = 0x1800; + } else { + rotX = ((this->timer + 0x18) * 0.041666668f * -6144.0f); + } + rot->x -= rotX; + } + } else if (limbIndex == BIGOKUTA_LIMB_SNOUT_CENTER) { + EnBigokuta* this = THIS; + + if (this->actionFunc == EnBigokuta_PlayDeathEffects) { + if (this->timer < 5) { + Matrix_Scale(1.0f, 1.0f, (this->timer * 0.2f * 0.25f) + 1.0f, MTXMODE_APPLY); + } else if (this->timer < 8) { + f32 time = (this->timer - 5) * (1 / 12.0f); + + Matrix_Scale(1.0f + time, 1.0f + time, 1.25f - time, MTXMODE_APPLY); + } else { + Matrix_Scale(1.25f - ((this->timer - 8) * 0.125f), 1.25f - ((this->timer - 8) * 0.125f), 1.0f, + MTXMODE_APPLY); + } + } else if (this->actionFunc == EnBigokuta_SuckInPlayer) { + f32 sin = sin_rad(this->timer * (M_PI / 3.0f)) * 0.5f; + + Matrix_Scale(((this->timer * (2 / 90.0f)) * (0.5f + sin)) + 1.0f, + ((this->timer * (2 / 90.0f)) * (0.5f - sin)) + 1.0f, 1.0f - ((this->timer * 0.3f) / 9.0f), + MTXMODE_APPLY); + } else if (this->actionFunc == EnBigokuta_HoldPlayer && this->timer != 1) { + if (this->timer == 0) { + Matrix_Scale(0.9f, 0.9f, 1.15f, MTXMODE_APPLY); + } else if (this->timer > 0) { + f32 sin = sin_rad(this->timer * (M_PI / 3.0f)) * 0.5f; + + Matrix_Scale(((0.5f + sin) * 0.2f) + 1.0f, ((0.5f - sin) * 0.2f) + 1.0f, 0.7f, MTXMODE_APPLY); + } else { + Matrix_Scale(1.0f - ((this->timer + 0x18) * 0.2f * 0.041666668f), + 1.0f - ((this->timer + 0x18) * 0.2f * 0.041666668f), + ((this->timer + 0x18) * 0.3f * 0.041666668f) + 1.0f, MTXMODE_APPLY); + } + } + } + return false; +} + +void EnBigokuta_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx, + Gfx** gfx) { + static s8 D_80AC45BC[] = { + -1, -1, -1, 0, -1, 1, -1, 2, -1, 3, 8, 4, -1, 5, -1, -1, -1, -1, 6, 7, + }; + static Vec3f D_80AC45D0[] = { + { 0.0f, 2000.0f, 1000.0f }, { 0.0f, 2000.0f, -2000.0f }, { 1700.0f, 700.0f, -600.0f }, + { -1700.0f, 700.0f, -600.0f }, { 0.0f, 500.0f, -2500.0f }, + }; + EnBigokuta* this = THIS; + s32 i; + s8 limbPosIndex = D_80AC45BC[limbIndex]; + + if (limbPosIndex != -1) { + if (limbPosIndex < 6) { + Matrix_GetStateTranslationAndScaledX(800.0f, &this->limbPos[limbPosIndex]); + } else if (limbPosIndex < 8) { + Matrix_GetStateTranslation(&this->limbPos[limbPosIndex]); + } else { + for (i = 0; i < ARRAY_COUNT(D_80AC45D0); i++) { + Matrix_MultiplyVector3fByState(&D_80AC45D0[i], &this->limbPos[limbPosIndex + i]); + } + } + } +} + +void EnBigokuta_Draw(Actor* thisx, GlobalContext* globalCtx) { + s32 pad; + EnBigokuta* this = THIS; + Gfx* gfx; + + OPEN_DISPS(globalCtx->state.gfxCtx); + if ((this->actionFunc != EnBigokuta_PlayDeathEffects) || (this->timer != 0)) { + Scene_SetRenderModeXlu(globalCtx, 0, 1); + gfx = POLY_OPA_DISP; + gSPDisplayList(&gfx[0], &sSetupDL[6 * 25]); + gDPSetEnvColor(&gfx[1], 255, 255, 255, 255); + POLY_OPA_DISP = SkelAnime_DrawFlex(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, + this->skelAnime.dListCount, EnBigokuta_OverrideLimbDraw, + EnBigokuta_PostLimbDraw, &this->actor, &gfx[2]); + } else { + Scene_SetRenderModeXlu(globalCtx, 1, 2); + gfx = POLY_XLU_DISP; + gSPDisplayList(&gfx[0], &sSetupDL[6 * 25]); + gDPSetEnvColor(&gfx[1], 0, 0, 0, (this->actor.scale.y * 7727.273f)); + POLY_XLU_DISP = + SkelAnime_DrawFlex(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, + this->skelAnime.dListCount, NULL, EnBigokuta_PostLimbDraw, &this->actor, &gfx[2]); + } + + func_800BE680(globalCtx, &this->actor, this->limbPos, ARRAY_COUNT(this->limbPos), this->drawEffectScale, + this->drawEffectSteamScale, this->drawEffectAlpha, this->drawEffect); + CLOSE_DISPS(globalCtx->state.gfxCtx); +} diff --git a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.h b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.h index 40b23d63c..ac0cb0158 100644 --- a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.h +++ b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.h @@ -6,12 +6,53 @@ struct EnBigokuta; typedef void (*EnBigokutaActionFunc)(struct EnBigokuta*, GlobalContext*); +typedef void (*EnBigokutaUnkFunc)(GlobalContext*, struct EnBigokuta*); + +typedef enum { + /* 00 */ BIGOKUTA_LIMB_NONE, + /* 01 */ BIGOKUTA_LIMB_BODY, + /* 02 */ BIGOKUTA_LIMB_ARM_BASE_RIGHT_FRONT, + /* 03 */ BIGOKUTA_LIMB_ARM_END_RIGHT_FRONT, + /* 04 */ BIGOKUTA_LIMB_ARM_BASE_LEFT_FRONT, + /* 05 */ BIGOKUTA_LIMB_ARM_END_LEFT_FRONT, + /* 06 */ BIGOKUTA_LIMB_ARM_BASE_RIGHT_BACK, + /* 07 */ BIGOKUTA_LIMB_ARM_END_RIGHT_BACK, + /* 08 */ BIGOKUTA_LIMB_ARM_BASE_LEFT_BACK, + /* 09 */ BIGOKUTA_LIMB_ARM_END_LEFT_BACK, + /* 10 */ BIGOKUTA_LIMB_HEAD, + /* 11 */ BIGOKUTA_LIMB_TENTACLE_BASE_LEFT, + /* 12 */ BIGOKUTA_LIMB_TENTACLE_TIP_LEFT, + /* 13 */ BIGOKUTA_LIMB_TENTACLE_BASE_RIGHT, + /* 14 */ BIGOKUTA_LIMB_TENTACLE_TIP_RIGHT, + /* 15 */ BIGOKUTA_LIMB_WEAK_POINT_LEFT, + /* 16 */ BIGOKUTA_LIMB_WEAK_POINT_RIGHT, + /* 17 */ BIGOKUTA_LIMB_SNOUT_CENTER, + /* 18 */ BIGOKUTA_LIMB_SNOUT_RIGHT, + /* 19 */ BIGOKUTA_LIMB_SNOUT_LEFT, + /* 20 */ BIGOKUTA_LIMB_MAX +} ObjectBigokutaLimbs; typedef struct EnBigokuta { /* 0x0000 */ Actor actor; - /* 0x0144 */ char unk_144[0x48]; + /* 0x0144 */ EnBigokutaUnkFunc unkFunc; // possibly something to do with photographing + /* 0x0148 */ SkelAnime skelAnime; /* 0x018C */ EnBigokutaActionFunc actionFunc; - /* 0x0190 */ char unk_190[0x268]; + /* 0x0190 */ u8 drawEffect; + /* 0x0192 */ s16 timer; + /* 0x0194 */ s16 camId; + /* 0x0196 */ s16 cutscene; + /* 0x0198 */ Vec3s jointTable[BIGOKUTA_LIMB_MAX]; + /* 0x0210 */ Vec3s morphTable[BIGOKUTA_LIMB_MAX]; + /* 0x0288 */ f32 drawEffectAlpha; + /* 0x028C */ f32 drawEffectScale; + /* 0x0290 */ f32 drawEffectSteamScale; // only affects DRAWEFFECT_ICE + /* 0x0294 */ Vec3f playerPos; + /* 0x02A0 */ Vec3f playerHoldPos; + /* 0x02AC */ Vec3f camAt; + /* 0x02B8 */ Vec3f camEye; + /* 0x02C4 */ Vec3f limbPos[13]; + /* 0x0360 */ ColliderCylinder shellCollider; + /* 0x03AC */ ColliderCylinder bodyCollider; } EnBigokuta; // size = 0x3F8 extern const ActorInit En_Bigokuta_InitVars; diff --git a/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c b/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c index db6258a73..a2ba96654 100644 --- a/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c +++ b/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c @@ -175,7 +175,7 @@ static Vec3f D_80B65084[] = { void EnBigpo_Init(Actor* thisx, GlobalContext* globalCtx2) { GlobalContext* globalCtx = globalCtx2; - EnBigpo* this = (EnBigpo*)thisx; + EnBigpo* this = THIS; EnBigpoFireEffect* firesPtr; s32 i; @@ -228,20 +228,19 @@ void EnBigpo_Init(Actor* thisx, GlobalContext* globalCtx2) { } } -void EnBigpo_Destroy(Actor* thisx, GlobalContext* globalCtx) { - EnBigpo* this = (EnBigpo*)thisx; - GlobalContext* globalCtx2; +void EnBigpo_Destroy(Actor* thisx, GlobalContext* globalCtx2) { + GlobalContext* globalCtx = globalCtx2; + EnBigpo* this = THIS; s32 fireCount; if ((this->actor.params != ENBIGPO_POSSIBLEFIRE) && (this->actor.params != ENBIGPO_CHOSENFIRE) && (this->actor.params != ENBIGPO_REVEALEDFIRE) && (this->actor.params != ENBIGPO_UNK5)) { // if NOT a fire type, *ENBIGPO_REGULAR and ENBIGPO_SUMMONED (combat types only) if (1) {} - globalCtx2 = globalCtx; for (fireCount = 0; fireCount < ARRAY_COUNT(this->fires); fireCount++) { - LightContext_RemoveLight(globalCtx2, &globalCtx2->lightCtx, this->fires[fireCount].light); + LightContext_RemoveLight(globalCtx, &globalCtx->lightCtx, this->fires[fireCount].light); } - Collider_DestroyCylinder(globalCtx2, &this->collider); + Collider_DestroyCylinder(globalCtx, &this->collider); } } @@ -1150,7 +1149,7 @@ s32 EnBigpo_ApplyDamage(EnBigpo* this, GlobalContext* globalCtx) { } void EnBigpo_Update(Actor* thisx, GlobalContext* globalCtx) { - EnBigpo* this = (EnBigpo*)thisx; + EnBigpo* this = THIS; s32 pad; ColliderCylinder* thisCollider; @@ -1218,7 +1217,8 @@ void EnBigpo_Update(Actor* thisx, GlobalContext* globalCtx) { * alt update func: the revealed fires under dampe's house */ void EnBigpo_UpdateFire(Actor* thisx, GlobalContext* globalCtx) { - EnBigpo* this = (EnBigpo*)thisx; + EnBigpo* this = THIS; + this->actor.shape.rot.y = BINANG_ROT180(func_800DFCDC(GET_ACTIVE_CAM(globalCtx))); this->actionFunc(this, globalCtx); } @@ -1290,7 +1290,7 @@ void EnBigpo_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, } void EnBigpo_DrawMainBigpo(Actor* thisx, GlobalContext* globalCtx) { - EnBigpo* this = (EnBigpo*)thisx; + EnBigpo* this = THIS; Gfx* dispHead; OPEN_DISPS(globalCtx->state.gfxCtx); @@ -1331,7 +1331,7 @@ void EnBigpo_DrawMainBigpo(Actor* thisx, GlobalContext* globalCtx) { } void EnBigpo_DrawScoopSoul(Actor* thisx, GlobalContext* globalCtx) { - EnBigpo* this = (EnBigpo*)thisx; + EnBigpo* this = THIS; s32 pad; OPEN_DISPS(globalCtx->state.gfxCtx); @@ -1364,7 +1364,7 @@ void EnBigpo_DrawScoopSoul(Actor* thisx, GlobalContext* globalCtx) { * might be able to find an alternative match with the macros, so far no success */ void EnBigpo_DrawLantern(Actor* thisx, GlobalContext* globalCtx) { - EnBigpo* this = (EnBigpo*)thisx; + EnBigpo* this = THIS; f32 magnitude; f32 magnitude2; Gfx* dispHead; @@ -1420,7 +1420,7 @@ void EnBigpo_DrawLantern(Actor* thisx, GlobalContext* globalCtx) { } void EnBigpo_DrawCircleFlames(Actor* thisx, GlobalContext* globalCtx) { - EnBigpo* this = (EnBigpo*)thisx; + EnBigpo* this = THIS; s32 pad[3]; s16 fireRadius; MtxF* mtfxPtr; @@ -1462,7 +1462,7 @@ void EnBigpo_DrawCircleFlames(Actor* thisx, GlobalContext* globalCtx) { } void EnBigpo_RevealedFire(Actor* thisx, GlobalContext* globalCtx) { - EnBigpo* this = (EnBigpo*)thisx; + EnBigpo* this = THIS; EnBigpo* parent = (EnBigpo*)thisx->parent; s32 pad; diff --git a/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c b/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c index 7416efb4f..32875716c 100644 --- a/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c +++ b/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c @@ -7,6 +7,7 @@ #include "z_en_bigslime.h" #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" #include "objects/object_bigslime/object_bigslime.h" +#include "objects/gameplay_keep/gameplay_keep.h" #define FLAGS 0x00000235 @@ -307,7 +308,7 @@ static InitChainEntry sInitChain[] = { ICHAIN_U8(targetMode, 5, ICHAIN_STOP), }; -void EnBigslime_Init(Actor* thisx, GlobalContext* globalCtx) { +void EnBigslime_Init(Actor* thisx, GlobalContext* globalCtx2) { // gSaveContext.save.weekEventReg[KEY] = VALUE // KEY | VALUE static s32 isFrogReturnedFlags[] = { @@ -316,8 +317,8 @@ void EnBigslime_Init(Actor* thisx, GlobalContext* globalCtx) { (33 << 8) | 0x01, // Southern Swamp Frog Returned (33 << 8) | 0x02, // Laundry Pool Frog Returned }; + GlobalContext* globalCtx = globalCtx2; EnBigslime* this = THIS; - GlobalContext* globalCtx2 = globalCtx; s32 i; Actor_ProcessInitChain(&this->actor, sInitChain); @@ -341,7 +342,7 @@ void EnBigslime_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_MarkForDeath(&this->actor); if (!(gSaveContext.save.weekEventReg[isFrogReturnedFlags[this->actor.params - 1] >> 8] & (u8)isFrogReturnedFlags[this->actor.params - 1])) { - Actor_Spawn(&globalCtx2->actorCtx, globalCtx, ACTOR_EN_MINIFROG, this->actor.world.pos.x, + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_MINIFROG, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, this->actor.shape.rot.y, 0, this->actor.params); } @@ -354,7 +355,7 @@ void EnBigslime_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.home.pos.y = GBT_ROOM_5_MAX_Y - 75.0f; this->actor.home.pos.z = GBT_ROOM_5_CENTER_Z; for (i = 0; i < MINISLIME_NUM_SPAWN; i++) { - this->minislime[i] = (EnMinislime*)Actor_SpawnAsChild(&globalCtx2->actorCtx, &this->actor, globalCtx, + this->minislime[i] = (EnMinislime*)Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_MINISLIME, 0.0f, 0.0f, 0.0f, 0, 0, 0, i); if (this->minislime[i] == NULL) { for (i = i - 1; i >= 0; i--) { @@ -2905,9 +2906,9 @@ void EnBigslime_SetSysMatrix(Vec3f* pos, GlobalContext* globalCtx, Gfx* shadowDL CLOSE_DISPS(globalCtx->state.gfxCtx); } -void EnBigslime_DrawMinislime(EnBigslime* this, GlobalContext* globalCtx) { +void EnBigslime_DrawMinislime(EnBigslime* this, GlobalContext* globalCtx2) { EnMinislime* minislime; - GlobalContext* globalCtx2 = globalCtx; + GlobalContext* globalCtx = globalCtx2; s32 pad; s32 currIndex; s32 i; @@ -2933,8 +2934,8 @@ void EnBigslime_DrawMinislime(EnBigslime* this, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx); for (i = 0; i < MINISLIME_NUM_SPAWN; i++) { minislime = this->minislime[indices[i]]; - lights = LightContext_NewLights(&globalCtx2->lightCtx, globalCtx->state.gfxCtx); - Lights_BindAll(lights, globalCtx2->lightCtx.listHead, &minislime->actor.world.pos, globalCtx); + lights = LightContext_NewLights(&globalCtx->lightCtx, globalCtx->state.gfxCtx); + Lights_BindAll(lights, globalCtx->lightCtx.listHead, &minislime->actor.world.pos, globalCtx); Lights_Draw(lights, globalCtx->state.gfxCtx); func_8012C2DC(globalCtx->state.gfxCtx); func_800B8118(&minislime->actor, globalCtx, 0); @@ -3099,7 +3100,7 @@ void EnBigslime_DrawGekko(Actor* thisx, GlobalContext* globalCtx) { func_800AE5A0(globalCtx); } - EnBigslime_SetSysMatrix(&gekkoPos, globalCtx, D_04076BC0, this->gekkoScale * (550.0f / 7.0f), + EnBigslime_SetSysMatrix(&gekkoPos, globalCtx, gCircleShadowDL, this->gekkoScale * (550.0f / 7.0f), this->gekkoScale * (550.0f / 7.0f), 0.0f, 0, 255.0f); if (this->minislimeState != MINISLIME_INACTIVE_STATE) { diff --git a/src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.c b/src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.c index 5eb196292..47d803e81 100644 --- a/src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.c +++ b/src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.c @@ -5,6 +5,7 @@ */ #include "z_en_bji_01.h" +#include "objects/object_bji/object_bji.h" #define FLAGS 0x00000019 @@ -30,15 +31,6 @@ s32 EnBji01_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dLis Actor* thisx); void EnBji01_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx); -extern AnimationHeader D_06000FDC; -extern AnimationHeader D_06005B58; -extern AnimationHeader D_06000AB0; -extern AnimationHeader D_0600066C; -extern void* D_060049F0[]; -extern void* D_06004E70[]; -extern void* D_06005270[]; -extern FlexSkeletonHeader D_0600578C; - const ActorInit En_Bji_01_InitVars = { ACTOR_EN_BJI_01, ACTORCAT_NPC, @@ -73,10 +65,10 @@ static ColliderCylinderInit sCylinderInit = { /* Animations struct */ static struct_80B8E1A8 D_809CDC7C[] = { - { &D_06000FDC, 1.0f, 0, 0.0f }, /* Looking through telescope */ - { &D_06005B58, 1.0f, 0, 10.0f }, /* Breathing? Unused? */ - { &D_06000AB0, 1.0f, 0, 0.0f }, /* Talking */ - { &D_0600066C, 1.0f, 2, -5.0f }, /* Scratching chin? */ + { &object_bji_Anim_000FDC, 1.0f, 0, 0.0f }, /* Looking through telescope */ + { &object_bji_Anim_005B58, 1.0f, 0, 10.0f }, /* Breathing? Unused? */ + { &object_bji_Anim_000AB0, 1.0f, 0, 0.0f }, /* Talking */ + { &object_bji_Anim_00066C, 1.0f, 2, -5.0f }, /* Scratching chin? */ }; void func_809CCDE0(EnBji01* this, GlobalContext* globalCtx) { @@ -339,8 +331,8 @@ void EnBji01_Init(Actor* thisx, GlobalContext* globalCtx) { EnBji01* this = THIS; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600578C, &D_06000FDC, this->jointTable, this->morphTable, - BJI_LIMB_MAX); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_bji_Skel_00578C, &object_bji_Anim_000FDC, this->jointTable, + this->morphTable, BJI_LIMB_MAX); Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); this->actor.colChkInfo.mass = MASS_IMMOVABLE; @@ -442,7 +434,7 @@ void EnBji01_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, } void EnBji01_Draw(Actor* thisx, GlobalContext* globalCtx) { - static TexturePtr sEyeTextures[] = { D_060049F0, D_06004E70, D_06005270 }; + static TexturePtr sEyeTextures[] = { object_bji_Tex_0049F0, object_bji_Tex_004E70, object_bji_Tex_005270 }; EnBji01* this = THIS; OPEN_DISPS(globalCtx->state.gfxCtx); diff --git a/src/overlays/actors/ovl_En_Bom/z_en_bom.c b/src/overlays/actors/ovl_En_Bom/z_en_bom.c index d135e2b35..ad3d37973 100644 --- a/src/overlays/actors/ovl_En_Bom/z_en_bom.c +++ b/src/overlays/actors/ovl_En_Bom/z_en_bom.c @@ -5,6 +5,7 @@ */ #include "z_en_bom.h" +#include "objects/gameplay_keep/gameplay_keep.h" #define FLAGS 0x00000030 @@ -17,8 +18,19 @@ void EnBom_Draw(Actor* thisx, GlobalContext* globalCtx); void func_80871058(EnBom* this, GlobalContext* globalCtx); void func_808714D4(EnBom* this, GlobalContext* globalCtx); +void func_80872648(GlobalContext* globalCtx, Vec3f* arg1); +void func_808726DC(GlobalContext* globalCtx, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3, s32 arg4); +void func_80872BC0(GlobalContext* globalCtx, s32 arg1); + +typedef struct { + /* 0x00 */ Vec3f unk_00; + /* 0x0C */ Vec3f unk_0C; + /* 0x18 */ s16 unk_18; + /* 0x1A */ s16 unk_1A; +} EnBomStruct; // size = 0x1C + +static EnBomStruct D_80874650[16]; -#if 0 const ActorInit En_Bom_InitVars = { ACTOR_EN_BOM, ACTORCAT_EXPLOSIVES, @@ -31,73 +43,762 @@ const ActorInit En_Bom_InitVars = { (ActorFunc)EnBom_Draw, }; -// static ColliderCylinderInit sCylinderInit = { -static ColliderCylinderInit D_80872DC8 = { - { COLTYPE_HIT0, AT_NONE, AC_ON | AC_TYPE_PLAYER | AC_TYPE_OTHER, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_2, COLSHAPE_CYLINDER, }, - { ELEMTYPE_UNK2, { 0x00000000, 0x00, 0x00 }, { 0x00013828, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, }, +static f32 enBomScales[] = { 0.01f, 0.03f }; + +static ColliderCylinderInit sCylinderInit = { + { + COLTYPE_HIT0, + AT_NONE, + AC_ON | AC_TYPE_PLAYER | AC_TYPE_OTHER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_2, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK2, + { 0x00000000, 0x00, 0x00 }, + { 0x00013828, 0x00, 0x00 }, + TOUCH_NONE | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 6, 11, 14, { 0, 0, 0 } }, }; -// static ColliderJntSphElementInit sJntSphElementsInit[1] = { -static ColliderJntSphElementInit D_80872DF4[1] = { +static ColliderJntSphElementInit sJntSphElementsInit1[1] = { { - { ELEMTYPE_UNK0, { 0x00000008, 0x00, 0x02 }, { 0x00000000, 0x00, 0x00 }, TOUCH_ON | TOUCH_SFX_NONE, BUMP_NONE, OCELEM_NONE, }, + { + ELEMTYPE_UNK0, + { 0x00000008, 0x00, 0x02 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_NONE, + }, { 0, { { 0, 0, 0 }, 0 }, 100 }, }, }; -// static ColliderJntSphInit sJntSphInit = { -static ColliderJntSphInit D_80872E18 = { - { COLTYPE_HIT0, AT_ON | AT_TYPE_ALL, AC_NONE, OC1_NONE, OC2_NONE, COLSHAPE_JNTSPH, }, - 1, D_80872DF4, // sJntSphElementsInit, +static ColliderJntSphInit sJntSphInit1 = { + { + COLTYPE_HIT0, + AT_ON | AT_TYPE_ALL, + AC_NONE, + OC1_NONE, + OC2_NONE, + COLSHAPE_JNTSPH, + }, + 1, + sJntSphElementsInit1, }; -// static ColliderJntSphElementInit sJntSphElementsInit[1] = { -static ColliderJntSphElementInit D_80872E28[1] = { +static ColliderJntSphElementInit sJntSphElementsInit2[1] = { { - { ELEMTYPE_UNK0, { 0x80000008, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, TOUCH_ON | TOUCH_SFX_NONE, BUMP_NONE, OCELEM_NONE, }, + { + ELEMTYPE_UNK0, + { 0x80000008, 0x00, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NONE, + BUMP_NONE, + OCELEM_NONE, + }, { 0, { { 0, 0, 0 }, 0 }, 100 }, }, }; -// static ColliderJntSphInit sJntSphInit = { -static ColliderJntSphInit D_80872E4C = { - { COLTYPE_HIT0, AT_ON | AT_TYPE_ALL, AC_NONE, OC1_NONE, OC2_NONE, COLSHAPE_JNTSPH, }, - 1, D_80872E28, // sJntSphElementsInit, +static ColliderJntSphInit sJntSphInit2 = { + { + COLTYPE_HIT0, + AT_ON | AT_TYPE_ALL, + AC_NONE, + OC1_NONE, + OC2_NONE, + COLSHAPE_JNTSPH, + }, + 1, + sJntSphElementsInit2, }; -// static InitChainEntry sInitChain[] = { -static InitChainEntry D_80872E5C[] = { +static InitChainEntry sInitChain[] = { ICHAIN_VEC3F(scale, 0, ICHAIN_CONTINUE), ICHAIN_F32(targetArrowOffset, 2000, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -4000, ICHAIN_STOP), }; -#endif +void EnBom_Init(Actor* thisx, GlobalContext* globalCtx) { + EnBom* this = THIS; + s32 params; -extern ColliderCylinderInit D_80872DC8; -extern ColliderJntSphElementInit D_80872DF4[1]; -extern ColliderJntSphInit D_80872E18; -extern ColliderJntSphElementInit D_80872E28[1]; -extern ColliderJntSphInit D_80872E4C; -extern InitChainEntry D_80872E5C[]; + Actor_ProcessInitChain(&this->actor, sInitChain); + ActorShape_Init(&this->actor.shape, 700.0f, ActorShadow_DrawCircle, 16.0f); + this->actor.colChkInfo.mass = 200; + this->actor.colChkInfo.cylRadius = 5; + this->actor.colChkInfo.cylHeight = 10; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bom/EnBom_Init.s") + this->flashSpeedScale = 7; + this->isPowderKeg = ENBOM_GETX_1(&this->actor); + if (this->isPowderKeg) { + globalCtx->actorCtx.unk5 |= 1; + this->timer = gSaveContext.powderKegTimer; + } else { + this->timer = 70; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bom/EnBom_Destroy.s") + Collider_InitCylinder(globalCtx, &this->collider1); + Collider_InitJntSph(globalCtx, &this->collider2); + Collider_SetCylinder(globalCtx, &this->collider1, &this->actor, &sCylinderInit); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bom/func_80871058.s") + if (!this->isPowderKeg) { + Collider_SetJntSph(globalCtx, &this->collider2, &this->actor, &sJntSphInit1, &this->collider3); + this->collider1.dim.radius = 6; + this->collider1.dim.height = 11; + } else { + Collider_SetJntSph(globalCtx, &this->collider2, &this->actor, &sJntSphInit2, &this->collider3); + this->collider1.dim.radius = 20; + this->collider1.dim.height = 36; + func_80872648(globalCtx, &this->actor.world.pos); + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bom/func_808714D4.s") + this->collider3.info.toucher.damage += ENBOM_GETZ_FF00(thisx); + this->actor.shape.rot.z &= 0xFF; + if (ENBOM_GETZ_80(&this->actor)) { + this->actor.shape.rot.z |= 0xFF00; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bom/func_808715B8.s") + this->collider2.elements[0].dim.worldSphere.center.x = this->actor.world.pos.x; + this->collider2.elements[0].dim.worldSphere.center.y = this->actor.world.pos.y; + this->collider2.elements[0].dim.worldSphere.center.z = this->actor.world.pos.z; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bom/EnBom_Update.s") + this->actor.flags |= 0x100000; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bom/EnBom_Draw.s") + if (Actor_HasParent(&this->actor, globalCtx)) { + this->actionFunc = func_808714D4; + this->actor.room = -1; + Actor_SetScale(&this->actor, enBomScales[this->isPowderKeg]); + } else { + this->actionFunc = func_80871058; + gSaveContext.powderKegTimer = 0; + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bom/func_80872648.s") +void EnBom_Destroy(Actor* thisx, GlobalContext* globalCtx) { + EnBom* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bom/func_808726DC.s") + Collider_DestroyJntSph(globalCtx, &this->collider2); + Collider_DestroyCylinder(globalCtx, &this->collider1); + if (this->isPowderKeg) { + globalCtx->actorCtx.unk5 &= ~1; + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bom/func_80872BC0.s") +void func_80871058(EnBom* this, GlobalContext* globalCtx) { + static Vec3f D_80872E68[] = { + { 2.0f, -6.0f, -0.3f }, + { 1.5f, -5.0f, -0.6f }, + { 0.2f, -6.0f, -0.1f }, + }; + + if (Actor_HasParent(&this->actor, globalCtx)) { + this->actionFunc = func_808714D4; + this->actor.room = -1; + return; + } + + if ((this->actor.velocity.y > 0.0f) && (this->actor.bgCheckFlags & 0x10)) { + this->actor.velocity.y = -this->actor.velocity.y; + } + + if ((this->actor.speedXZ != 0.0f) && (this->actor.bgCheckFlags & 8)) { + s16 yDiff = BINANG_SUB(this->actor.wallYaw, this->actor.world.rot.y); + + if (ABS_ALT(yDiff) > 0x4000) { + this->actor.world.rot.y = + BINANG_SUB(this->actor.wallYaw - this->actor.world.rot.y + this->actor.wallYaw, 0x8000); + } + + Actor_PlaySfxAtPos(&this->actor, this->isPowderKeg ? NA_SE_EV_PUT_DOWN_WOODBOX : NA_SE_EV_BOMB_BOUND); + Actor_MoveWithGravity(&this->actor); + this->actor.speedXZ *= 0.7f; + this->actor.bgCheckFlags &= ~8; + } + + if (!(this->actor.bgCheckFlags & 1)) { + Math_StepToF(&this->actor.speedXZ, 0.0f, 0.08f); + } else { + Vec3f* sp58; + u32 sp54 = func_800C99D4(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId); + Vec3f sp48; + s16 sp46; + f32 sp40; + f32 sp3C; + f32 sp38; + + sp58 = &D_80872E68[this->isPowderKeg]; + + if (sp54 == 5) { + sp58 = &D_80872E68[2]; + } + + if ((sp54 == 4) || (sp54 == 14) || (sp54 == 15)) { + s16 sp36; + + Math_ApproachF(&this->actor.shape.yOffset, 0.0f, 0.1f, 50.0f); + sp36 = this->actor.shape.shadowAlpha; + Math_ApproachS(&sp36, 0, 1, 20); + this->actor.shape.shadowAlpha = sp36; + } else { + Math_ApproachF(&this->actor.shape.yOffset, 700.0f, 1.0f, 700.0f); + } + + sp40 = Math_SinS(this->actor.world.rot.y) * this->actor.speedXZ; + sp3C = Math_CosS(this->actor.world.rot.y) * this->actor.speedXZ; + func_800B75A0(this->actor.floorPoly, &sp48, &sp46); + + sp40 += 3.0f * sp48.x; + sp3C += 3.0f * sp48.z; + sp38 = sqrtf(SQ(sp40) + SQ(sp3C)); + + if ((sp38 < this->actor.speedXZ) || + (SurfaceType_GetSlope(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId) == 1)) { + if (sp38 > 16.0f) { + this->actor.speedXZ = 16.0f; + } else { + this->actor.speedXZ = sp38; + } + this->actor.world.rot.y = Math_FAtan2F(sp3C, sp40); + } + + if (!Math_StepToF(&this->actor.speedXZ, 0.0f, sp58->x)) { + s16 temp = this->actor.world.rot.y; + s32 pad; + + if (ABS_ALT(BINANG_SUB(this->actor.world.rot.y, this->actor.shape.rot.y)) > 0x4000) { + temp = BINANG_ROT180(temp); + } + Math_ScaledStepToS(&this->actor.shape.rot.y, temp, this->actor.speedXZ * 100.0f); + this->unk_1FA += (s16)(this->actor.speedXZ * 800.0f); + } + + if (this->actor.bgCheckFlags & 2) { + Actor_PlaySfxAtPos(&this->actor, this->isPowderKeg ? NA_SE_EV_TRE_BOX_BOUND : NA_SE_EV_BOMB_BOUND); + if (this->actor.velocity.y < sp58->y) { + if ((sp54 == 4) || (sp54 == 14) || (sp54 == 15)) { + this->actor.velocity.y = 0.0f; + } else { + this->actor.velocity.y = this->actor.velocity.y * sp58->z; + } + this->actor.bgCheckFlags &= ~1; + } + } else if (this->timer >= 4) { + Actor_LiftActor(&this->actor, globalCtx); + } + } + + Actor_MoveWithGravity(&this->actor); +} + +void func_808714D4(EnBom* this, GlobalContext* globalCtx) { + if (Actor_HasNoParent(&this->actor, globalCtx)) { + this->actionFunc = func_80871058; + this->actor.room = globalCtx->roomCtx.currRoom.num; + this->actor.flags &= ~0x100000; + this->actor.bgCheckFlags &= ~1; + Math_Vec3s_ToVec3f(&this->actor.prevPos, &this->actor.home.rot); + if (this->isPowderKeg) { + gSaveContext.powderKegTimer = 0; + } + func_80871058(this, globalCtx); + } else { + Math_Vec3f_ToVec3s(&this->actor.home.rot, &this->actor.parent->world.pos); + if (this->isPowderKeg) { + gSaveContext.powderKegTimer = this->timer; + } + } + Math_ScaledStepToS(&this->unk_1FA, 0, 2000); +} + +void func_808715B8(EnBom* this, GlobalContext* globalCtx) { + static s16 D_80872E8C[] = { 100, 200 }; + static Color_RGBA8 D_80872E90 = { 185, 140, 70, 255 }; + static Color_RGBA8 D_80872E94 = { 255, 255, 255, 255 }; + s32 i; + s32 temp_s0; + f32 temp_f20; + s32 pad; + f32 spCC; + Vec3f spC0; + Vec3f spB4; + CollisionPoly* spB0; + s32 spAC; + Vec3f spA0; + Vec3f sp94; + Vec3f sp88; + Color_RGBA8 sp84; + Color_RGBA8 sp80; + + if (this->collider2.elements->dim.modelSphere.radius == 0) { + this->actor.flags |= 0x20; + func_8013ECE0(this->actor.xzDistToPlayer, 255, 20, 150); + } + + this->collider2.elements->dim.worldSphere.radius = D_80872E8C[this->isPowderKeg]; + if (this->timer == 7) { + this->collider2.base.atFlags &= ~OC1_TYPE_1; + } + + if (this->actor.params == ENBOM_1) { + CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider2.base); + } + + if (globalCtx->envCtx.unk_8C.diffuseColor1[0] != 0) { + globalCtx->envCtx.unk_8C.diffuseColor1[0] -= 25; + } + + if (globalCtx->envCtx.unk_8C.diffuseColor1[1] != 0) { + globalCtx->envCtx.unk_8C.diffuseColor1[1] -= 25; + } + + if (globalCtx->envCtx.unk_8C.diffuseColor1[2] != 0) { + globalCtx->envCtx.unk_8C.diffuseColor1[2] -= 25; + } + + if (globalCtx->envCtx.unk_8C.ambientColor[0] != 0) { + globalCtx->envCtx.unk_8C.ambientColor[0] -= 25; + } + + if (globalCtx->envCtx.unk_8C.ambientColor[1] != 0) { + globalCtx->envCtx.unk_8C.ambientColor[1] -= 25; + } + + if (globalCtx->envCtx.unk_8C.ambientColor[2] != 0) { + globalCtx->envCtx.unk_8C.ambientColor[2] -= 25; + } + + if (this->timer == 0) { + func_80123590(globalCtx, &this->actor); + Actor_MarkForDeath(&this->actor); + } + + if ((this->timer & 1) == 0) { + spCC = Rand_ZeroFloat(M_PI); + + for (i = 0; i < 15; i++) { + Matrix_InsertYRotation_f(((2.0f * (i * M_PI)) / 15.0f) + spCC, MTXMODE_NEW); + Matrix_GetStateTranslationAndScaledZ((10 - this->timer) * 300.0f * 0.1f, &spC0); + spB4.x = this->actor.world.pos.x + spC0.x; + spB4.y = this->actor.world.pos.y + 500.0f; + spB4.z = this->actor.world.pos.z + spC0.z; + if (BgCheck_EntityRaycastFloor3(&globalCtx->colCtx, &spB0, &spAC, &spB4) != BGCHECK_Y_MIN) { + temp_s0 = func_800C99D4(&globalCtx->colCtx, spB0, spAC); + temp_f20 = BgCheck_EntityRaycastFloor1(&globalCtx->colCtx, &spB0, &spB4); + + if ((temp_s0 == 4) || (temp_s0 == 15) || (temp_s0 == 14)) { + if (temp_s0 == 4) { + sp84 = D_80872E90; + sp80 = D_80872E90; + } else { + sp84 = D_80872E94; + sp80 = D_80872E94; + } + Matrix_GetStateTranslationAndScaledZ(5.0f, &sp94); + sp88.x = sp88.z = 0.0f; + sp94.y = 2.0f; + sp88.y = 0.2f; + + spA0.x = spB4.x; + spA0.y = temp_f20; + spA0.z = spB4.z; + + temp_f20 = Rand_ZeroFloat(250.0f); + func_800B0F18(globalCtx, &spA0, &sp94, &sp88, &sp84, &sp80, temp_f20 + 950.0f, 10, + Rand_ZeroFloat(5.0f) + 14.0f); + } + } + } + } +} + +static s16 D_80872E98[] = { 3, 5 }; +static s16 D_80872E9C[] = { 10, 15 }; + +void EnBom_Update(Actor* thisx, GlobalContext* globalCtx) { + Vec3f spA4 = { 0.0f, 0.0f, 0.0f }; + Vec3f sp98 = { 0.0f, 0.1f, 0.0f }; + Vec3f sp8C = { 0.0f, 0.0f, 0.0f }; + Vec3f sp80; + Vec3f sp74 = { 0.0f, 0.6f, 0.0f }; + Color_RGBA8 sp70 = { 255, 255, 255, 255 }; + EnBom* this = THIS; + s32 pad; + Player* player = GET_PLAYER(globalCtx); + + if (player->stateFlags1 & 2) { + return; + } + + if (Player_GetMask(globalCtx) == PLAYER_MASK_GIANT) { + Actor_MarkForDeath(thisx); + return; + } + + if (this->unk_1FC != 0) { + this->unk_1FC--; + Math_ApproachZeroF(&thisx->speedXZ, 1.0f, 1.0f); + Actor_MoveWithGravity(thisx); + Actor_UpdateBgCheckInfo(globalCtx, thisx, 35.0f, 10.0f, 36.0f, 4); + if (this->unk_1FC == 0) { + if (this->isPowderKeg) { + gSaveContext.powderKegTimer = 0; + } + Actor_MarkForDeath(thisx); + } + } else { + thisx->gravity = -1.2f; + if (this->timer != 0) { + if (!this->isPowderKeg || (func_808715B8 == this->actionFunc) || !func_801690CC(globalCtx)) { + this->timer--; + } + } + + if ((!this->isPowderKeg && (this->timer == 67)) || (this->isPowderKeg && (this->timer <= 2400))) { + Actor_PlaySfxAtPos(thisx, NA_SE_PL_TAKE_OUT_SHIELD); + Actor_SetScale(thisx, enBomScales[this->isPowderKeg]); + } + + if ((thisx->xzDistToPlayer >= 20.0f) || (fabsf(thisx->playerHeightRel) >= 80.0f)) { + this->unk_1F8 = 1; + } + + this->actionFunc(this, globalCtx); + + Actor_UpdateBgCheckInfo(globalCtx, thisx, 35.0f, 10.0f, 36.0f, 0x1F); + if (thisx->params == ENBOM_0) { + static Vec3us D_80872ED4[] = { + { 40, 20, 100 }, + { 300, 60, 600 }, + }; + Vec3us* sp60 = &D_80872ED4[this->isPowderKeg]; + + sp74.y = 0.2f; + Math_Vec3f_Copy(&sp80, &thisx->home.pos); + if ((globalCtx->gameplayFrames % 2) == 0) { + EffectSsGSpk_SpawnFuse(globalCtx, thisx, &sp80, &spA4, &sp8C); + } + if (this->isPowderKeg) { + func_801A0810(&thisx->projectedPos, NA_SE_IT_BIG_BOMB_IGNIT - SFX_FLAG, + (this->flashSpeedScale == 7) ? 0 + : (this->flashSpeedScale == 3) ? 1 + : 2); + } else { + Actor_PlaySfxAtPos(thisx, NA_SE_IT_BOMB_IGNIT - SFX_FLAG); + } + + sp80.y += 3.0f; + func_800B0DE0(globalCtx, &sp80, &spA4, &sp74, &sp70, &sp70, 50, 5); + + if ((this->collider1.base.acFlags & AC_HIT) || + ((this->collider1.base.ocFlags1 & OC1_HIT) && ((this->collider1.base.oc->category == ACTORCAT_ENEMY) || + (this->collider1.base.oc->category == ACTORCAT_BOSS)))) { + this->timer = 0; + thisx->shape.rot.z = 0; + } else if ((this->timer > 100) && (func_80123F48(globalCtx, &thisx->world.pos, 30.0f, 50.0f))) { + this->timer = 100; + } + + sp74.y = 0.2f; + sp80 = thisx->world.pos; + sp80.y += 10.0f; + + if ((this->timer == sp60->x) || (this->timer == sp60->y) || (this->timer == 3)) { + thisx->shape.rot.z = 0; + this->flashSpeedScale >>= 1; + } + + if ((this->timer < sp60->z) && (this->timer & (this->flashSpeedScale + 1))) { + Math_ApproachF(&this->unk_1F4, 140.0f, 1.0f, 140.0f / this->flashSpeedScale); + } else { + Math_ApproachZeroF(&this->unk_1F4, 1.0f, 140.0f / this->flashSpeedScale); + } + + if (this->timer < 3) { + Actor_SetScale(thisx, thisx->scale.x + 0.002f); + } + + if (this->timer == 0) { + sp80 = thisx->world.pos; + sp80.y += 10.0f; + if (Actor_HasParent(thisx, globalCtx)) { + sp80.y += 30.0f; + } + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG, sp80.x, sp80.y - 10.0f, sp80.z, 0, 0, + 0, this->isPowderKeg); + func_800BC848(thisx, globalCtx, D_80872E98[this->isPowderKeg], D_80872E9C[this->isPowderKeg]); + globalCtx->envCtx.unk_8C.diffuseColor1[0] = globalCtx->envCtx.unk_8C.diffuseColor1[1] = + globalCtx->envCtx.unk_8C.diffuseColor1[2] = 250; + globalCtx->envCtx.unk_8C.ambientColor[0] = globalCtx->envCtx.unk_8C.ambientColor[1] = + globalCtx->envCtx.unk_8C.ambientColor[2] = 250; + func_800DFD04(&globalCtx->mainCamera, 2, 11, 8); + thisx->params = ENBOM_1; + this->timer = 10; + thisx->flags |= (0x100000 | 0x20); + this->actionFunc = func_808715B8; + if (this->isPowderKeg) { + gSaveContext.powderKegTimer = 0; + Actor_PlaySfxAtPos(thisx, NA_SE_IT_BIG_BOMB_EXPLOSION); + } else { + Actor_PlaySfxAtPos(thisx, NA_SE_IT_BOMB_EXPLOSION); + } + } + } + + Actor_SetFocus(thisx, 20.0f); + + if (thisx->params <= ENBOM_0) { + Collider_UpdateCylinder(thisx, &this->collider1); + if (!Actor_HasParent(thisx, globalCtx) && (this->unk_1F8 != 0)) { + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider1.base); + } + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider1.base); + } + + if ((enBomScales[this->isPowderKeg] <= thisx->scale.x) && (thisx->params != ENBOM_1)) { + if (thisx->depthInWater >= 20.0f) { + Vec3f sp54; + + sp54.x = thisx->world.pos.x; + sp54.y = thisx->world.pos.y + thisx->depthInWater; + sp54.z = thisx->world.pos.z; + EffectSsGRipple_Spawn(globalCtx, &sp54, 70, 500, 0); + EffectSsGRipple_Spawn(globalCtx, &sp54, 70, 500, 10); + sp54.y += 10.0f; + EffectSsGSplash_Spawn(globalCtx, &sp54, NULL, NULL, 1, 500); + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG, sp54.x, sp54.y, sp54.z, 0, 0, 1, 200); + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &thisx->world.pos, 30, NA_SE_IT_BOMB_UNEXPLOSION); + this->unk_1F4 = 0.0f; + thisx->velocity.y = (KREG(83) * 0.1f) + -2.0f; + thisx->gravity = (KREG(84) * 0.1f) + -0.5f; + this->unk_1FC = KREG(81) + 10; + } else if (thisx->bgCheckFlags & 0x40) { + thisx->bgCheckFlags &= ~0x40; + Actor_PlaySfxAtPos(thisx, NA_SE_EV_BOMB_DROP_WATER); + } + } + } +} + +static Vec3f D_80872EE0 = { 0.0f, 800.0f, 0.0f }; +static Vec3f D_80872EEC = { -750.0f, 0.0f, 0.0f }; +static Vec3f D_80872EF8 = { -800.0f, 0.0f, 0.0f }; +static Vec3f D_80872F04 = { 0.0f, 0.0f, 0.0f }; + +#include "overlays/ovl_En_Bom/ovl_En_Bom.c" + +void EnBom_Draw(Actor* thisx, GlobalContext* globalCtx) { + s32 pad; + EnBom* this = THIS; + + OPEN_DISPS(globalCtx->state.gfxCtx); + + if (this->actor.params == ENBOM_0) { + func_8012C28C(globalCtx->state.gfxCtx); + + Collider_UpdateSpheres(0, &this->collider2); + + if (!this->isPowderKeg) { + func_800B8050(&this->actor, globalCtx, 0); + Matrix_MultiplyVector3fByState(&D_80872EE0, &this->actor.home.pos); + + gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), + G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(POLY_OPA_DISP++, gameplay_keep_DL_015FA0); + + Matrix_NormalizeXYZ(&globalCtx->billboardMtxF); + Matrix_InsertXRotation_s(0x4000, MTXMODE_APPLY); + + gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), + G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gDPPipeSync(POLY_OPA_DISP++); + gDPSetEnvColor(POLY_OPA_DISP++, (s8)this->unk_1F4, 0, 40, 255); + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, (s8)this->unk_1F4, 0, 40, 255); + gSPDisplayList(POLY_OPA_DISP++, gameplay_keep_DL_015DB0); + } else { + Vec3f sp58; + Vec3f sp4C; + + if (this->unk_1FA != 0) { + s16 sp4A = this->actor.world.rot.y - this->actor.shape.rot.y; + f32 sp44 = (1000.0f / Math_CosS(ABS_ALT((s16)(this->unk_1FA % 10922)) - 0x1555)) + -1000.0f; + + Matrix_RotateY(sp4A, MTXMODE_APPLY); + Matrix_InsertTranslation(0.0f, sp44, 0.0f, MTXMODE_APPLY); + Matrix_InsertXRotation_s(this->unk_1FA, MTXMODE_APPLY); + Matrix_RotateY(-sp4A, MTXMODE_APPLY); + } + + Matrix_MultiplyVector3fByState(&D_80872EEC, &this->actor.home.pos); + Matrix_MultiplyVector3fByState(&D_80872EF8, &sp58); + Matrix_MultiplyVector3fByState(&D_80872F04, &sp4C); + + gDPSetEnvColor(POLY_OPA_DISP++, 255, 255, 255, 255); + gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), + G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(POLY_OPA_DISP++, ovl_En_Bom_DL_80873CA0); + gSPDisplayList(POLY_OPA_DISP++, ovl_En_Bom_DL_808742F8); + + func_808726DC(globalCtx, &this->actor.home.pos, &sp58, &sp4C, this->timer); + func_80872BC0(globalCtx, this->timer); + } + } + + CLOSE_DISPS(globalCtx->state.gfxCtx); +} + +void func_80872648(GlobalContext* globalCtx, Vec3f* arg1) { + EnBomStruct* ptr = &D_80874650[0]; + s32 i; + + for (i = 0; i < ARRAY_COUNT(D_80874650); i++, ptr++) { + Math_Vec3f_Copy(&ptr->unk_00, arg1); + Math_Vec3f_Copy(&ptr->unk_0C, &gZeroVec3f); + ptr->unk_18 = 0; + ptr->unk_1A = 0x4000; + } +} + +void func_808726DC(GlobalContext* globalCtx, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3, s32 arg4) { + s32 i; + f32 temp_f20; + Vec3f spCC; + Vec3f spC0; + EnBomStruct* ptr = &D_80874650[0]; + EnBomStruct* ptr2 = &D_80874650[1]; + f32 temp_f26 = Math_Vec3f_DistXYZ(arg3, arg1); + s32 spB0; + f32 temp_f2; + f32 sqrt; + + Math_Vec3f_Copy(&ptr->unk_00, arg1); + Math_Vec3f_Diff(arg2, arg1, &spCC); + + ptr->unk_18 = Math_FAtan2F(spCC.z, spCC.x); + sqrt = sqrtf(SQ(spCC.x) + SQ(spCC.z)); + ptr->unk_1A = Math_FAtan2F(sqrt, spCC.y); + + spB0 = (arg4 / 240) + 1; + + for (i = 0; i < spB0; i++, ptr++, ptr2++, arg4 -= 240) { + f32 phi_f22; + CollisionPoly* spA0; + s32 sp9C; + Vec3f sp90; + + if (arg4 >= 240) { + phi_f22 = 8.0f; + } else { + phi_f22 = (arg4 % 240) * (1.0f / 240) * 8.0f; + } + + Math_Vec3f_Sum(&ptr2->unk_00, &ptr2->unk_0C, &ptr2->unk_00); + temp_f20 = Math_Vec3f_DistXYZAndStoreDiff(arg3, &ptr2->unk_00, &spCC); + if (temp_f20 < temp_f26) { + if (temp_f20 == 0.0f) { + spCC.x = 0.0f; + spCC.y = temp_f26; + spCC.z = 0.0f; + } else { + temp_f20 = temp_f26 / temp_f20; + spCC.x *= temp_f20; + spCC.y *= temp_f20; + spCC.z *= temp_f20; + } + Math_Vec3f_Sum(arg3, &spCC, &ptr2->unk_00); + } + + if (Math_Vec3f_DistXYZAndStoreDiff(&ptr->unk_00, &ptr2->unk_00, &spCC) == 0.0f) { + spCC.x = 0.0f; + spCC.y = phi_f22; + spCC.z = 0.0f; + } + + ptr2->unk_18 = Math_FAtan2F(spCC.z, spCC.x); + sqrt = sqrtf(SQ(spCC.x) + SQ(spCC.z)); + ptr2->unk_1A = Math_FAtan2F(sqrt, spCC.y); + + ptr2->unk_18 = (s16)CLAMP(BINANG_SUB(ptr2->unk_18, ptr->unk_18), -8000, 8000) + ptr->unk_18; + ptr2->unk_1A = (s16)CLAMP(BINANG_SUB(ptr2->unk_1A, ptr->unk_1A), -8000, 8000) + ptr->unk_1A; + + temp_f20 = Math_CosS(ptr2->unk_1A) * phi_f22; + spC0.x = Math_SinS(ptr2->unk_18) * temp_f20; + spC0.z = Math_CosS(ptr2->unk_18) * temp_f20; + spC0.y = Math_SinS(ptr2->unk_1A) * phi_f22; + + Math_Vec3f_Sum(&ptr->unk_00, &spC0, &ptr2->unk_00); + Math_Vec3f_Copy(&sp90, &ptr2->unk_00); + + sp90.y += 50.0f; + + temp_f2 = BgCheck_EntityRaycastFloor3(&globalCtx->colCtx, &spA0, &sp9C, &sp90) - ptr2->unk_00.y; + if (temp_f2 >= 0.0f) { + spC0.y += temp_f2; + if (phi_f22 < spC0.y) { + spC0.y = phi_f22; + temp_f2 = 0.0f; + } else { + temp_f2 = sqrtf(SQ(phi_f22) - SQ(spC0.y)); + } + + if (temp_f20 == 0.0f) { + spC0.x = temp_f2; + } else { + temp_f2 /= temp_f20; + spC0.x *= temp_f2; + spC0.z *= temp_f2; + } + + Math_Vec3f_Sum(&ptr->unk_00, &spC0, &ptr2->unk_00); + Math_Vec3f_Copy(&ptr2->unk_0C, &gZeroVec3f); + } + + ptr2->unk_0C.y += -1.0f; + if (ptr2->unk_0C.y < -10.0f) { + ptr2->unk_0C.y = -10.0f; + } + } + + Math_Vec3f_Copy(arg1, &ptr->unk_00); +} + +void func_80872BC0(GlobalContext* globalCtx, s32 arg1) { + s32 temp_s5; + s32 i; + EnBomStruct* ptr = &D_80874650[0]; + EnBomStruct* ptr2; + + OPEN_DISPS(globalCtx->state.gfxCtx); + + Matrix_InsertTranslation(ptr->unk_00.x, ptr->unk_00.y, ptr->unk_00.z, MTXMODE_NEW); + Matrix_InsertRotation(ptr->unk_1A, ptr->unk_18, 0, MTXMODE_APPLY); + Matrix_Scale(0.01f, 0.01f, 0.01f, MTXMODE_APPLY); + + gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(POLY_OPA_DISP++, ovl_En_Bom_DL_80872F98); + + temp_s5 = (arg1 / 240) + 1; + ptr2 = &D_80874650[1]; + + for (i = 1; i < temp_s5; i++, ptr2++) { + Matrix_InsertTranslation(ptr2->unk_00.x, ptr2->unk_00.y, ptr2->unk_00.z, MTXMODE_NEW); + Matrix_InsertRotation(ptr2->unk_1A, ptr2->unk_18, 0, MTXMODE_APPLY); + Matrix_Scale(0.01f, 0.01f, 0.01f, MTXMODE_APPLY); + + gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + + if ((i % 2) == 0) { + gSPDisplayList(POLY_OPA_DISP++, ovl_En_Bom_DL_80873020); + } else { + gSPDisplayList(POLY_OPA_DISP++, ovl_En_Bom_DL_80873040); + } + } + + CLOSE_DISPS(globalCtx->state.gfxCtx); +} diff --git a/src/overlays/actors/ovl_En_Bom/z_en_bom.h b/src/overlays/actors/ovl_En_Bom/z_en_bom.h index 60cf065b3..a0555ab24 100644 --- a/src/overlays/actors/ovl_En_Bom/z_en_bom.h +++ b/src/overlays/actors/ovl_En_Bom/z_en_bom.h @@ -7,13 +7,27 @@ struct EnBom; typedef void (*EnBomActionFunc)(struct EnBom*, GlobalContext*); +#define ENBOM_GETX_1(thisx) ((thisx)->shape.rot.x & 1) +#define ENBOM_GETZ_80(thisx) ((thisx)->shape.rot.z & 0x80) +#define ENBOM_GETZ_FF00(thisx) (((thisx)->shape.rot.z & 0xFF00) >> 8) + +enum { + /* 0 */ ENBOM_0, + /* 1 */ ENBOM_1, +}; + typedef struct EnBom { /* 0x000 */ Actor actor; - /* 0x144 */ char unk_144[0xAC]; + /* 0x144 */ ColliderCylinder collider1; + /* 0x190 */ ColliderJntSph collider2; + /* 0x1B0 */ ColliderJntSphElement collider3; /* 0x1F0 */ s16 timer; - /* 0x1F2 */ char unk_1F2[0x7]; - /* 0x1F9 */ u8 unk_1F9; - /* 0x1FA */ char unk_1FA[0x6]; + /* 0x1F2 */ s16 flashSpeedScale; + /* 0x1F4 */ f32 unk_1F4; + /* 0x1F8 */ u8 unk_1F8; + /* 0x1F9 */ u8 isPowderKeg; + /* 0x1FA */ s16 unk_1FA; + /* 0x1FC */ u8 unk_1FC; /* 0x200 */ EnBomActionFunc actionFunc; } EnBom; // size = 0x204 diff --git a/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.c b/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.c index ee169dc36..72a46ecc0 100644 --- a/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.c +++ b/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.c @@ -1101,13 +1101,12 @@ void EnBomjima_Draw(Actor* thisx, GlobalContext* globalCtx) { gEnBomjima_D_80C00B18, gEnBomjima_D_80C00B18, }; static TexturePtr D_80C00B3C[] = { - &object_cs_Tex_00C520, - &object_cs_Tex_00CD20, - &object_cs_Tex_00D520, + object_cs_Tex_00C520, + object_cs_Tex_00CD20, + object_cs_Tex_00D520, }; static TexturePtr D_80C00B48[] = { - &object_cs_Tex_00E620, &object_cs_Tex_00EA20, &object_cs_Tex_00EE20, - &object_cs_Tex_00DD20, &object_cs_Tex_00F220, + object_cs_Tex_00E620, object_cs_Tex_00EA20, object_cs_Tex_00EE20, object_cs_Tex_00DD20, object_cs_Tex_00F220, }; EnBomjima* this = THIS; diff --git a/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c b/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c index 97e421ed5..1a282645f 100644 --- a/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c +++ b/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c @@ -897,13 +897,12 @@ void EnBomjimb_Draw(Actor* thisx, GlobalContext* globalCtx) { gEnBomjimb_D_80C03250, gEnBomjimb_D_80C03250, }; static TexturePtr D_80C03274[] = { - &object_cs_Tex_00C520, - &object_cs_Tex_00CD20, - &object_cs_Tex_00D520, + object_cs_Tex_00C520, + object_cs_Tex_00CD20, + object_cs_Tex_00D520, }; static TexturePtr D_80C03280[] = { - &object_cs_Tex_00E620, &object_cs_Tex_00EA20, &object_cs_Tex_00EE20, - &object_cs_Tex_00DD20, &object_cs_Tex_00F220, + object_cs_Tex_00E620, object_cs_Tex_00EA20, object_cs_Tex_00EE20, object_cs_Tex_00DD20, object_cs_Tex_00F220, }; EnBomjimb* this = THIS; diff --git a/src/overlays/actors/ovl_En_Cha/z_en_cha.c b/src/overlays/actors/ovl_En_Cha/z_en_cha.c index 0e2d26c21..de8c54040 100644 --- a/src/overlays/actors/ovl_En_Cha/z_en_cha.c +++ b/src/overlays/actors/ovl_En_Cha/z_en_cha.c @@ -5,6 +5,7 @@ */ #include "z_en_cha.h" +#include "objects/object_cha/object_cha.h" #define FLAGS 0x00000000 @@ -49,9 +50,6 @@ static ColliderCylinderInit sCylinderInit = { { 10, 40, 0, { 0, 0, 0 } }, }; -extern Gfx D_06000710[]; -extern Gfx D_06000958[]; - void EnCha_Init(Actor* thisx, GlobalContext* globalCtx) { EnCha* this = THIS; s32 pad; @@ -103,22 +101,22 @@ void EnCha_Idle(EnCha* this, GlobalContext* globalCtx) { this->actor.home.rot.z *= 0.96f; } -void EnCha_Update(Actor* thisx, GlobalContext* globalCtx) { +void EnCha_Update(Actor* thisx, GlobalContext* globalCtx2) { + GlobalContext* globalCtx = globalCtx2; EnCha* this = THIS; - GlobalContext* globalCtx2 = globalCtx; - CollisionCheck_SetOC(globalCtx, &globalCtx2->colChkCtx, &this->collider.base); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); this->actionFunc(this, globalCtx); - if ((this->actor.shape.rot.z >= -0x1F3F) && (this->actor.shape.rot.z < 0x1F40)) { - CollisionCheck_SetAC(globalCtx, &globalCtx2->colChkCtx, &this->collider.base); + if ((this->actor.shape.rot.z > -0x1F40) && (this->actor.shape.rot.z < 0x1F40)) { + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } void EnCha_Draw(Actor* thisx, GlobalContext* globalCtx) { EnCha* this = THIS; - Gfx_DrawDListOpa(globalCtx, D_06000710); + Gfx_DrawDListOpa(globalCtx, object_cha_DL_000710); Matrix_InsertTranslation(-1094.0f, 4950.0f, 9.0f, MTXMODE_APPLY); Matrix_InsertXRotation_s(this->actor.home.rot.x, MTXMODE_APPLY); - Gfx_DrawDListOpa(globalCtx, D_06000958); + Gfx_DrawDListOpa(globalCtx, object_cha_DL_000958); } diff --git a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c index d323c98d2..4b7156ad4 100644 --- a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c +++ b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c @@ -5,6 +5,7 @@ */ #include "z_en_clear_tag.h" +#include "objects/gameplay_keep/gameplay_keep.h" #define FLAGS 0x00000035 @@ -81,8 +82,18 @@ static f32 sLightRayMaxScale[] = { 25.0f, 100.0f, 48.0f, 20.0f, 32.0f, }; -static Gfx* sSplashTex[] = { - D_040378F0, D_04037DF0, D_040382F0, D_040387F0, D_04038CF0, D_040391F0, D_040396F0, D_04039BF0, NULL, NULL, NULL, +static TexturePtr sSplashTex[] = { + gExplosionSplashTex1, + gExplosionSplashTex2, + gExplosionSplashTex3, + gExplosionSplashTex4, + gExplosionSplashTex5, + gExplosionSplashTex6, + gExplosionSplashTex7, + gExplosionSplashTex8, + NULL, + NULL, + NULL, }; #include "overlays/ovl_En_Clear_Tag/ovl_En_Clear_Tag.c" @@ -820,7 +831,7 @@ void EnClearTag_DrawEffects(Actor* thisx, GlobalContext* globalCtx) { Matrix_SetCurrentState(&mtxF); Matrix_Scale(effect->scale, 1.0f, effect->scale, MTXMODE_APPLY); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_XLU_DISP++, D_04030100); + gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_030100); } } } @@ -986,7 +997,7 @@ void EnClearTag_DrawEffects(Actor* thisx, GlobalContext* globalCtx) { Matrix_RotateStateAroundXAxis(effect->rotationX); Matrix_Scale(effect->scale, effect->scale, effect->scale, MTXMODE_APPLY); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_XLU_DISP++, D_0403A0F0); + gSPDisplayList(POLY_XLU_DISP++, gExplosionSplashDL); } } } diff --git a/src/overlays/actors/ovl_En_Col_Man/z_en_col_man.c b/src/overlays/actors/ovl_En_Col_Man/z_en_col_man.c index 70e756c63..2b95d0706 100644 --- a/src/overlays/actors/ovl_En_Col_Man/z_en_col_man.c +++ b/src/overlays/actors/ovl_En_Col_Man/z_en_col_man.c @@ -246,7 +246,7 @@ void func_80AFE4AC(Actor* thisx, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx); POLY_OPA_DISP = func_801660B8(globalCtx, POLY_OPA_DISP); POLY_OPA_DISP = func_8012C724(POLY_OPA_DISP); - gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(&gameplay_keep_Tex_05E6F0)); + gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(gameplay_keep_Tex_05E6F0)); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, gameplay_keep_DL_05F6F0); CLOSE_DISPS(globalCtx->state.gfxCtx); @@ -268,7 +268,7 @@ void func_80AFE650(Actor* thisx, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx); POLY_OPA_DISP = func_801660B8(globalCtx, POLY_OPA_DISP); POLY_OPA_DISP = func_8012C724(POLY_OPA_DISP); - gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(&gameplay_keep_Tex_05CEF0)); + gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(gameplay_keep_Tex_05CEF0)); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, gameplay_keep_DL_05F6F0); CLOSE_DISPS(globalCtx->state.gfxCtx); diff --git a/src/overlays/actors/ovl_En_Cow/z_en_cow.c b/src/overlays/actors/ovl_En_Cow/z_en_cow.c index 606ec9128..5175f709e 100644 --- a/src/overlays/actors/ovl_En_Cow/z_en_cow.c +++ b/src/overlays/actors/ovl_En_Cow/z_en_cow.c @@ -5,6 +5,7 @@ */ #include "z_en_cow.h" +#include "objects/object_cow/object_cow.h" #define FLAGS 0x00000009 @@ -61,13 +62,6 @@ static ColliderCylinderInit sCylinderInit = { Vec3f D_8099D63C = { 0.0f, -1300.0f, 1100.0f }; -extern AnimationHeader D_060001CC; // gCowBodyChewAnim -extern FlexSkeletonHeader D_06004010; // gCowBodySkel -extern AnimationHeader D_06004264; // gCowBodyMoveHeadAnim -extern AnimationHeader D_06004348; // gCowTailIdleAnim -extern FlexSkeletonHeader D_06004C30; // gCowTailSkel -extern AnimationHeader D_06004E98; // gCowTailSwishAnim - void EnCow_RotatePoint(Vec3f* vec, s16 angle) { f32 x = (Math_CosS(angle) * vec->x) + (Math_SinS(angle) * vec->z); @@ -113,9 +107,9 @@ void EnCow_Init(Actor* thisx, GlobalContext* globalCtx) { switch (EN_COW_TYPE(thisx)) { case EN_COW_TYPE_DEFAULT: case EN_COW_TYPE_ABDUCTED: - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06004010, NULL, this->jointTable, this->morphTable, + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gCowBodySkel, NULL, this->jointTable, this->morphTable, COW_LIMB_MAX); - Animation_PlayLoop(&this->skelAnime, &D_060001CC); + Animation_PlayLoop(&this->skelAnime, &gCowBodyChewAnim); Collider_InitAndSetCylinder(globalCtx, &this->colliders[0], &this->actor, &sCylinderInit); Collider_InitAndSetCylinder(globalCtx, &this->colliders[1], &this->actor, &sCylinderInit); @@ -141,9 +135,9 @@ void EnCow_Init(Actor* thisx, GlobalContext* globalCtx) { func_801A5080(4); break; case EN_COW_TYPE_TAIL: - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06004C30, NULL, this->jointTable, this->morphTable, + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gCowTailSkel, NULL, this->jointTable, this->morphTable, COW_LIMB_MAX); - Animation_PlayLoop(&this->skelAnime, &D_06004348); + Animation_PlayLoop(&this->skelAnime, &gCowTailIdleAnim); this->actor.update = EnCow_UpdateTail; this->actor.draw = EnCow_DrawTail; @@ -177,13 +171,13 @@ void EnCow_UpdateAnimation(EnCow* this, GlobalContext* globalCtx) { this->animationTimer--; } else { this->animationTimer = Rand_ZeroFloat(500.0f) + 40.0f; - Animation_Change(&this->skelAnime, &D_060001CC, 1.0f, this->skelAnime.curFrame, - Animation_GetLastFrame(&D_060001CC), ANIMMODE_ONCE, 1.0f); + Animation_Change(&this->skelAnime, &gCowBodyChewAnim, 1.0f, this->skelAnime.curFrame, + Animation_GetLastFrame(&gCowBodyChewAnim), ANIMMODE_ONCE, 1.0f); } if (this->actor.xzDistToPlayer < 150.0f) { if (!(this->flags & EN_COW_FLAG_PLAYER_HAS_APPROACHED)) { this->flags |= EN_COW_FLAG_PLAYER_HAS_APPROACHED; - if (this->skelAnime.animation == &D_060001CC) { + if (this->skelAnime.animation == &gCowBodyChewAnim) { this->animationTimer = 0; } } @@ -320,15 +314,15 @@ void EnCow_DoTail(EnCow* this, GlobalContext* globalCtx) { this->animationTimer--; } else { this->animationTimer = Rand_ZeroFloat(200.0f) + 40.0f; - Animation_Change(&this->skelAnime, &D_06004348, 1.0f, this->skelAnime.curFrame, - Animation_GetLastFrame(&D_06004348), ANIMMODE_ONCE, 1.0f); + Animation_Change(&this->skelAnime, &gCowTailIdleAnim, 1.0f, this->skelAnime.curFrame, + Animation_GetLastFrame(&gCowTailIdleAnim), ANIMMODE_ONCE, 1.0f); } if (this->actor.xzDistToPlayer < 150.0f && ABS_ALT((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)) > 25000) { if (!(this->flags & EN_COW_FLAG_PLAYER_HAS_APPROACHED)) { this->flags |= EN_COW_FLAG_PLAYER_HAS_APPROACHED; - if (this->skelAnime.animation == &D_06004348) { + if (this->skelAnime.animation == &gCowTailIdleAnim) { this->animationTimer = 0; } } @@ -350,12 +344,12 @@ void EnCow_Update(Actor* thisx, GlobalContext* globalCtx2) { Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); if (SkelAnime_Update(&this->skelAnime)) { - if (this->skelAnime.animation == &D_060001CC) { + if (this->skelAnime.animation == &gCowBodyChewAnim) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_COW_CRY); - Animation_Change(&this->skelAnime, &D_06004264, 1.0f, 0.0f, Animation_GetLastFrame(&D_06004264), - ANIMMODE_ONCE, 1.0f); + Animation_Change(&this->skelAnime, &gCowBodyMoveHeadAnim, 1.0f, 0.0f, + Animation_GetLastFrame(&gCowBodyMoveHeadAnim), ANIMMODE_ONCE, 1.0f); } else { - Animation_Change(&this->skelAnime, &D_060001CC, 1.0f, 0.0f, Animation_GetLastFrame(&D_060001CC), + Animation_Change(&this->skelAnime, &gCowBodyChewAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gCowBodyChewAnim), ANIMMODE_LOOP, 1.0f); } } @@ -391,11 +385,11 @@ void EnCow_UpdateTail(Actor* thisx, GlobalContext* globalCtx) { EnCow* this = THIS; if (SkelAnime_Update(&this->skelAnime)) { - if (this->skelAnime.animation == &D_06004348) { - Animation_Change(&this->skelAnime, &D_06004E98, 1.0f, 0.0f, Animation_GetLastFrame(&D_06004E98), - ANIMMODE_ONCE, 1.0f); + if (this->skelAnime.animation == &gCowTailIdleAnim) { + Animation_Change(&this->skelAnime, &gCowTailSwishAnim, 1.0f, 0.0f, + Animation_GetLastFrame(&gCowTailSwishAnim), ANIMMODE_ONCE, 1.0f); } else { - Animation_Change(&this->skelAnime, &D_06004348, 1.0f, 0.0f, Animation_GetLastFrame(&D_06004348), + Animation_Change(&this->skelAnime, &gCowTailIdleAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gCowTailIdleAnim), ANIMMODE_LOOP, 1.0f); } } diff --git a/src/overlays/actors/ovl_En_Dai/z_en_dai.c b/src/overlays/actors/ovl_En_Dai/z_en_dai.c index e9a1ab2cc..1ef914e1c 100644 --- a/src/overlays/actors/ovl_En_Dai/z_en_dai.c +++ b/src/overlays/actors/ovl_En_Dai/z_en_dai.c @@ -5,6 +5,7 @@ */ #include "z_en_dai.h" +#include "objects/object_dai/object_dai.h" #define FLAGS 0x02000039 @@ -18,24 +19,6 @@ void EnDai_Draw(Actor* thisx, GlobalContext* globalCtx); void func_80B3F00C(EnDai* this, GlobalContext* globalCtx); void func_80B3EF90(EnDai* this, GlobalContext* globalCtx); -extern AnimationHeader D_060107B0; -extern AnimationHeader D_06010FB0; -extern AnimationHeader D_060117B0; -extern AnimationHeader D_06010FB0; -extern AnimationHeader D_06011FB0; -extern AnimationHeader D_060127B0; -extern AnimationHeader D_060079E4; -extern AnimationHeader D_06007354; -extern AnimationHeader D_06000CEC; -extern AnimationHeader D_060069DC; -extern AnimationHeader D_0600563C; -extern AnimationHeader D_06002E58; -extern AnimationHeader D_06006590; -extern FlexSkeletonHeader D_060130D0; -extern Gfx D_06000230[]; -extern Gfx D_060002E8[]; -extern Gfx D_0600C538[]; - const ActorInit En_Dai_InitVars = { ACTOR_EN_DAI, ACTORCAT_NPC, @@ -87,7 +70,7 @@ void func_80B3E168(EnDaiParticle* particle, GlobalContext* globalCtx2) { gDPPipeSync(POLY_XLU_DISP++); if (!isDisplayListSet) { - gSPDisplayList(POLY_XLU_DISP++, D_06000230); + gSPDisplayList(POLY_XLU_DISP++, object_dai_DL_000230); isDisplayListSet = true; } @@ -108,7 +91,7 @@ void func_80B3E168(EnDaiParticle* particle, GlobalContext* globalCtx2) { gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_XLU_DISP++, D_060002E8); + gSPDisplayList(POLY_XLU_DISP++, object_dai_DL_0002E8); Matrix_StatePop(); } @@ -148,9 +131,11 @@ s32 func_80B3E5B4(EnDai* this, GlobalContext* globalCtx) { s32 func_80B3E5DC(EnDai* this, s32 arg1) { static ActorAnimationEntryS D_80B3FBFC[] = { - { &D_060079E4, 1.0f, 0, -1, 0, 0 }, { &D_060079E4, 1.0f, 0, -1, 0, -4 }, { &D_06007354, 1.0f, 0, -1, 2, -4 }, - { &D_06000CEC, 1.0f, 0, -1, 2, -4 }, { &D_060069DC, 1.0f, 0, -1, 2, -4 }, { &D_0600563C, 1.0f, 0, -1, 2, 0 }, - { &D_0600563C, 1.0f, 0, -1, 2, -4 }, { &D_06002E58, 1.0f, 0, -1, 0, -4 }, { &D_06006590, 1.0f, 0, -1, 2, -4 }, + { &object_dai_Anim_0079E4, 1.0f, 0, -1, 0, 0 }, { &object_dai_Anim_0079E4, 1.0f, 0, -1, 0, -4 }, + { &object_dai_Anim_007354, 1.0f, 0, -1, 2, -4 }, { &object_dai_Anim_000CEC, 1.0f, 0, -1, 2, -4 }, + { &object_dai_Anim_0069DC, 1.0f, 0, -1, 2, -4 }, { &object_dai_Anim_00563C, 1.0f, 0, -1, 2, 0 }, + { &object_dai_Anim_00563C, 1.0f, 0, -1, 2, -4 }, { &object_dai_Anim_002E58, 1.0f, 0, -1, 0, -4 }, + { &object_dai_Anim_006590, 1.0f, 0, -1, 2, -4 }, }; s32 phi_v1 = false; @@ -526,7 +511,8 @@ void EnDai_Init(Actor* thisx, GlobalContext* globalCtx) { EnDai* this = THIS; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 0.0f); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060130D0, NULL, this->jointTable, this->morphTable, 19); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_dai_Skel_0130D0, NULL, this->jointTable, this->morphTable, + 19); this->unk_A70 = -1; func_80B3E5DC(this, 0); Actor_SetScale(&this->actor, 0.2f); @@ -647,10 +633,10 @@ void EnDai_TransformLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thi } void func_80B3F78C(EnDai* this, GlobalContext* globalCtx) { - static AnimationHeader* D_80B3FE58[] = { - &D_060107B0, &D_06010FB0, &D_060117B0, &D_06010FB0, &D_06011FB0, &D_060127B0, + static TexturePtr D_80B3FE58[] = { + object_dai_Tex_0107B0, object_dai_Tex_010FB0, object_dai_Tex_0117B0, + object_dai_Tex_010FB0, object_dai_Tex_011FB0, object_dai_Tex_0127B0, }; - s32 pad; if (globalCtx->actorCtx.unkB != 0) { @@ -676,7 +662,7 @@ void func_80B3F78C(EnDai* this, GlobalContext* globalCtx) { Matrix_SetCurrentState(&this->unk_18C); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_XLU_DISP++, D_0600C538); + gSPDisplayList(POLY_XLU_DISP++, object_dai_DL_00C538); } func_80B3E5B4(this, globalCtx); @@ -685,8 +671,9 @@ void func_80B3F78C(EnDai* this, GlobalContext* globalCtx) { } void func_80B3F920(EnDai* this, GlobalContext* globalCtx) { - static AnimationHeader* D_80B3FE70[] = { - &D_060107B0, &D_06010FB0, &D_060117B0, &D_06010FB0, &D_06011FB0, &D_060127B0, + static TexturePtr D_80B3FE70[] = { + object_dai_Tex_0107B0, object_dai_Tex_010FB0, object_dai_Tex_0117B0, + object_dai_Tex_010FB0, object_dai_Tex_011FB0, object_dai_Tex_0127B0, }; s32 pad; @@ -707,7 +694,7 @@ void func_80B3F920(EnDai* this, GlobalContext* globalCtx) { Matrix_SetCurrentState(&this->unk_18C); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, D_0600C538); + gSPDisplayList(POLY_OPA_DISP++, object_dai_DL_00C538); CLOSE_DISPS(globalCtx->state.gfxCtx); } else { @@ -726,7 +713,7 @@ void func_80B3F920(EnDai* this, GlobalContext* globalCtx) { Matrix_SetCurrentState(&this->unk_18C); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_XLU_DISP++, D_0600C538); + gSPDisplayList(POLY_XLU_DISP++, object_dai_DL_00C538); CLOSE_DISPS(globalCtx->state.gfxCtx); } diff --git a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c index 98e5d31cd..e56e35de8 100644 --- a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c +++ b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c @@ -5,6 +5,7 @@ */ #include "z_en_daiku.h" +#include "objects/object_daiku/object_daiku.h" #define FLAGS 0x00000009 @@ -20,22 +21,6 @@ void func_80943BC0(EnDaiku* this); void func_80943BDC(EnDaiku* this, GlobalContext* globalCtx); void func_809438F8(EnDaiku* this, GlobalContext* globalCtx); -extern AnimationHeader D_06000600; -extern AnimationHeader D_06000C44; -extern AnimationHeader D_06001114; -extern AnimationHeader D_06002FA0; -extern FlexSkeletonHeader D_0600A850; -extern AnimationHeader D_0600ACD0; -extern AnimationHeader D_0600B690; -extern AnimationHeader D_0600BEAC; -extern AnimationHeader D_0600C234; -extern AnimationHeader D_0600C92C; -extern Gfx D_06006D70[]; -extern Gfx D_06006E80[]; -extern Gfx D_06006FB0[]; -extern Gfx D_060070C0[]; -extern Gfx D_06008EC8[]; - const ActorInit En_Daiku_InitVars = { ACTOR_EN_DAIKU, ACTORCAT_NPC, @@ -109,18 +94,18 @@ void EnDaiku_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_27E = this->unk_278 * 4 + 4; case ENDAIKU_PARAMS_FF_1: - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600A850, &D_06002FA0, this->jointTable, - this->morphTable, 17); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_daiku_Skel_00A850, &object_daiku_Anim_002FA0, + this->jointTable, this->morphTable, 17); break; case ENDAIKU_PARAMS_FF_2: - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600A850, &D_0600B690, this->jointTable, - this->morphTable, 17); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_daiku_Skel_00A850, &object_daiku_Anim_00B690, + this->jointTable, this->morphTable, 17); break; case ENDAIKU_PARAMS_FF_3: - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600A850, &D_06001114, this->jointTable, - this->morphTable, 17); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_daiku_Skel_00A850, &object_daiku_Anim_001114, + this->jointTable, this->morphTable, 17); break; } @@ -135,8 +120,9 @@ void EnDaiku_Destroy(Actor* thisx, GlobalContext* globalCtx) { void func_8094373C(EnDaiku* this, s32 arg1) { static AnimationHeader* D_809440A4[] = { - &D_06002FA0, &D_0600ACD0, &D_0600C92C, &D_06000C44, &D_0600C234, - &D_06000600, &D_06001114, &D_0600B690, &D_0600BEAC, + &object_daiku_Anim_002FA0, &object_daiku_Anim_00ACD0, &object_daiku_Anim_00C92C, + &object_daiku_Anim_000C44, &object_daiku_Anim_00C234, &object_daiku_Anim_000600, + &object_daiku_Anim_001114, &object_daiku_Anim_00B690, &object_daiku_Anim_00BEAC, }; static u8 D_809440C8[] = { 0, 0, 0, 0, 2, 0, 0, 2, 2, @@ -310,7 +296,12 @@ s32 EnDaiku_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dLis } void EnDaiku_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { - static Gfx* D_809440D4[] = { D_060070C0, D_06006FB0, D_06006E80, D_06006D70 }; + static Gfx* D_809440D4[] = { + object_daiku_DL_0070C0, + object_daiku_DL_006FB0, + object_daiku_DL_006E80, + object_daiku_DL_006D70, + }; EnDaiku* this = THIS; OPEN_DISPS(globalCtx->state.gfxCtx); @@ -320,7 +311,7 @@ void EnDaiku_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, } if ((this->unk_278 == ENDAIKU_PARAMS_FF_3) && (limbIndex == 8)) { - gSPDisplayList(POLY_OPA_DISP++, D_06008EC8); + gSPDisplayList(POLY_OPA_DISP++, object_daiku_DL_008EC8); } CLOSE_DISPS(globalCtx->state.gfxCtx); diff --git a/src/overlays/actors/ovl_En_Daiku2/z_en_daiku2.c b/src/overlays/actors/ovl_En_Daiku2/z_en_daiku2.c index b423b53b3..9d716fc25 100644 --- a/src/overlays/actors/ovl_En_Daiku2/z_en_daiku2.c +++ b/src/overlays/actors/ovl_En_Daiku2/z_en_daiku2.c @@ -6,6 +6,8 @@ #include "z_en_daiku2.h" #include "overlays/actors/ovl_En_Bom/z_en_bom.h" +#include "objects/object_daiku/object_daiku.h" +#include "objects/object_bombiwa/object_bombiwa.h" #define FLAGS 0x00000009 @@ -30,22 +32,6 @@ void func_80BE71D8(EnDaiku2* this, GlobalContext* globalCtx); void func_80BE7504(EnDaiku2* this, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3, f32 arg4, s16 arg5); void func_80BE7718(EnDaiku2* this, GlobalContext* globalCtx); -extern AnimationHeader D_06002134; -extern AnimationHeader D_06002FA0; -extern AnimationHeader D_0600ACD0; -extern AnimationHeader D_0600C92C; -extern AnimationHeader D_06000C44; -extern AnimationHeader D_0600C234; -extern AnimationHeader D_06000600; -extern AnimationHeader D_06001114; -extern AnimationHeader D_0600B690; -extern AnimationHeader D_06001A24; -extern AnimationHeader D_0600D328; -extern FlexSkeletonHeader D_0600A850; -extern Gfx D_06009638[]; -extern Gfx D_0600A390[]; -extern Gfx D_060009E0[]; - const ActorInit En_Daiku2_InitVars = { ACTOR_EN_DAIKU2, ACTORCAT_NPC, @@ -96,7 +82,8 @@ void EnDaiku2_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.colChkInfo.mass = MASS_IMMOVABLE; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 40.0f); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600A850, &D_06002FA0, this->jointTable, this->morphTable, 17); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_daiku_Skel_00A850, &object_daiku_Anim_002FA0, + this->jointTable, this->morphTable, 17); this->actor.targetMode = 0; Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); this->unk_278 = ENDAIKU2_GET_7F(&this->actor); @@ -135,8 +122,9 @@ void EnDaiku2_Destroy(Actor* thisx, GlobalContext* globalCtx) { void func_80BE6408(EnDaiku2* this, s32 arg1) { static AnimationHeader* sAnimations[] = { - &D_06002FA0, &D_0600ACD0, &D_0600C92C, &D_06000C44, &D_0600C234, &D_06000600, - &D_06001114, &D_0600B690, &D_06001A24, &D_06002134, &D_0600D328, + &object_daiku_Anim_002FA0, &object_daiku_Anim_00ACD0, &object_daiku_Anim_00C92C, &object_daiku_Anim_000C44, + &object_daiku_Anim_00C234, &object_daiku_Anim_000600, &object_daiku_Anim_001114, &object_daiku_Anim_00B690, + &object_daiku_Anim_001A24, &object_daiku_Anim_002134, &object_daiku_Anim_00D328, }; static u8 D_80BE7958[] = { 0, 0, 0, 0, 2, 0, 0, 0, 0, 2, 0, @@ -162,7 +150,7 @@ s32 func_80BE64C0(EnDaiku2* this, GlobalContext* globalCtx) { Math_Vec3f_Copy(&this->actor.world.pos, &sp30); if ((this->unk_278 >= ENDAIKU2_GET_7F_0) && !Flags_GetSwitch(globalCtx, this->unk_278) && (bomb != NULL) && (bomb->actor.id == ACTOR_EN_BOM)) { - if (bomb->unk_1F9 == 0) { + if (!bomb->isPowderKeg) { this->actor.textId = 0x32D3; } else { this->actor.textId = 0x32D4; @@ -274,8 +262,8 @@ void func_80BE66E4(EnDaiku2* this, GlobalContext* globalCtx) { if ((this->unk_276 == 5) || (this->unk_276 == 9)) { func_80BE6408(this, 10); } else if ((this->unk_276 == 10) && (this->unk_284 <= sp9C)) { - this->unk_284 = Animation_GetLastFrame(&D_06002134); - Animation_Change(&this->skelAnime, &D_06002134, -1.0f, this->unk_284, 0.0f, 2, -4.0f); + this->unk_284 = Animation_GetLastFrame(&object_daiku_Anim_002134); + Animation_Change(&this->skelAnime, &object_daiku_Anim_002134, -1.0f, this->unk_284, 0.0f, 2, -4.0f); this->unk_276 = 11; } else if ((this->unk_276 == 11) && (sp9C <= 0.0f)) { func_80BE6408(this, 8); @@ -479,11 +467,11 @@ void EnDaiku2_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, if (limbIndex == 14) { Matrix_Scale(this->unk_260, this->unk_260, this->unk_260, MTXMODE_APPLY); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, D_06009638); + gSPDisplayList(POLY_OPA_DISP++, object_daiku_DL_009638); } if (limbIndex == 15) { - gSPDisplayList(POLY_OPA_DISP++, D_0600A390); + gSPDisplayList(POLY_OPA_DISP++, object_daiku_DL_00A390); } CLOSE_DISPS(globalCtx->state.gfxCtx); @@ -569,7 +557,7 @@ void func_80BE7718(EnDaiku2* this, GlobalContext* globalCtx) { Matrix_Scale(particle->unk_30, particle->unk_30, particle->unk_30, MTXMODE_APPLY); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, D_060009E0); + gSPDisplayList(POLY_OPA_DISP++, object_bombiwa_DL_0009E0); Matrix_StatePop(); } diff --git a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c index d6308cb1a..1d6863400 100644 --- a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c +++ b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c @@ -6,6 +6,7 @@ #include "z_en_dekunuts.h" #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" +#include "objects/object_dekunuts/object_dekunuts.h" #define FLAGS 0x00000005 @@ -38,20 +39,6 @@ void func_808BE4D4(EnDekunuts* this, GlobalContext* globalCtx); void func_808BE680(EnDekunuts* this); void func_808BE6C4(EnDekunuts* this, GlobalContext* globalCtx); -extern AnimationHeader D_06000168; -extern Gfx D_06001E50[]; -extern Gfx D_06001F50[]; -extern SkeletonHeader D_06002468; -extern AnimationHeader D_0600259C; -extern AnimationHeader D_06002A5C; -extern AnimationHeader D_06002BD4; -extern AnimationHeader D_06002DD4; -extern AnimationHeader D_06002FA4; -extern AnimationHeader D_06003180; -extern AnimationHeader D_0600326C; -extern AnimationHeader D_060033E4; -extern AnimationHeader D_06003780; - const ActorInit En_Dekunuts_InitVars = { ACTOR_EN_DEKUNUTS, ACTORCAT_ENEMY, @@ -132,7 +119,8 @@ void EnDekunuts_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChain); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 35.0f); - SkelAnime_Init(globalCtx, &this->skelAnime, &D_06002468, &D_0600326C, this->jointTable, this->morphTable, 10); + SkelAnime_Init(globalCtx, &this->skelAnime, &object_dekunuts_Skel_002468, &object_dekunuts_Anim_00326C, + this->jointTable, this->morphTable, 10); Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); this->unk_194 = ENDEKUNUTS_GET_FF00(&this->actor); @@ -178,7 +166,7 @@ void func_808BD3B4(EnDekunuts* this, GlobalContext* globalCtx) { } void func_808BD428(EnDekunuts* this) { - Animation_PlayOnceSetSpeed(&this->skelAnime, &D_06003180, 0.0f); + Animation_PlayOnceSetSpeed(&this->skelAnime, &object_dekunuts_Anim_003180, 0.0f); this->unk_190 = Rand_S16Offset(100, 50); this->collider.dim.height = 5; Math_Vec3f_Copy(&this->actor.world.pos, &this->actor.home.pos); @@ -233,7 +221,7 @@ void func_808BD49C(EnDekunuts* this, GlobalContext* globalCtx) { } void func_808BD78C(EnDekunuts* this) { - Animation_PlayLoop(&this->skelAnime, &D_06002FA4); + Animation_PlayLoop(&this->skelAnime, &object_dekunuts_Anim_002FA4); this->unk_190 = 2; this->actionFunc = func_808BD7D4; } @@ -253,7 +241,7 @@ void func_808BD7D4(EnDekunuts* this, GlobalContext* globalCtx) { } void func_808BD870(EnDekunuts* this) { - Animation_MorphToLoop(&this->skelAnime, &D_0600326C, -3.0f); + Animation_MorphToLoop(&this->skelAnime, &object_dekunuts_Anim_00326C, -3.0f); if (this->actionFunc == func_808BDA4C) { this->unk_190 = 4098; } else { @@ -292,7 +280,7 @@ void func_808BD8D8(EnDekunuts* this, GlobalContext* globalCtx) { } void func_808BDA08(EnDekunuts* this) { - Animation_PlayOnce(&this->skelAnime, &D_06000168); + Animation_PlayOnce(&this->skelAnime, &object_dekunuts_Anim_000168); this->unk_190 = this->unk_194; this->actionFunc = func_808BDA4C; } @@ -336,7 +324,7 @@ void func_808BDA4C(EnDekunuts* this, GlobalContext* globalCtx) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_THROW); } } else if ((this->unk_190 >= 2) && Animation_OnFrame(&this->skelAnime, 12.0f)) { - Animation_MorphToPlayOnce(&this->skelAnime, &D_06000168, -3.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &object_dekunuts_Anim_000168, -3.0f); if (this->unk_190 != 0) { this->unk_190--; } @@ -344,14 +332,14 @@ void func_808BDA4C(EnDekunuts* this, GlobalContext* globalCtx) { } void func_808BDC9C(EnDekunuts* this) { - Animation_MorphToPlayOnce(&this->skelAnime, &D_06002A5C, -5.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &object_dekunuts_Anim_002A5C, -5.0f); this->unk_190 = 0; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DOWN); this->actionFunc = func_808BDD54; } void func_808BDCF0(EnDekunuts* this) { - Animation_MorphToPlayOnce(&this->skelAnime, &D_06002A5C, -5.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &object_dekunuts_Anim_002A5C, -5.0f); this->collider.base.acFlags &= ~AC_ON; this->unk_190 = 80; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DOWN); @@ -379,7 +367,7 @@ void func_808BDD54(EnDekunuts* this, GlobalContext* globalCtx) { } void func_808BDE7C(EnDekunuts* this) { - Animation_MorphToPlayOnce(&this->skelAnime, &D_06002DD4, -3.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &object_dekunuts_Anim_002DD4, -3.0f); this->collider.dim.height = 37; this->actor.colChkInfo.mass = 50; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DAMAGE); @@ -399,7 +387,7 @@ void func_808BDEF8(EnDekunuts* this, GlobalContext* globalCtx) { } void func_808BDF60(EnDekunuts* this) { - Animation_PlayLoop(&this->skelAnime, &D_06003780); + Animation_PlayLoop(&this->skelAnime, &object_dekunuts_Anim_003780); this->unk_190 = 2; this->unk_18C = 0; this->collider.base.acFlags |= AC_ON; @@ -456,7 +444,7 @@ void func_808BDFB8(EnDekunuts* this, GlobalContext* globalCtx) { } void func_808BE1CC(EnDekunuts* this) { - Animation_PlayLoop(&this->skelAnime, &D_060033E4); + Animation_PlayLoop(&this->skelAnime, &object_dekunuts_Anim_0033E4); this->unk_190 = 3; this->actor.speedXZ = 0.0f; if (this->unk_18D != 0) { @@ -479,7 +467,7 @@ void func_808BE22C(EnDekunuts* this, GlobalContext* globalCtx) { } void func_808BE294(EnDekunuts* this, s32 arg1) { - Animation_MorphToPlayOnce(&this->skelAnime, &D_0600259C, -3.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &object_dekunuts_Anim_00259C, -3.0f); if (this->actor.params == ENDEKUNUTS_GET_FF00_0) { this->actor.speedXZ = 10.0f; if (arg1 != 0) { @@ -492,7 +480,7 @@ void func_808BE294(EnDekunuts* this, s32 arg1) { this->actionFunc = func_808BE358; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DAMAGE); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_CUTBODY); - Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, Animation_GetLastFrame(&D_0600259C)); + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, Animation_GetLastFrame(&object_dekunuts_Anim_00259C)); } void func_808BE358(EnDekunuts* this, GlobalContext* globalCtx) { @@ -531,7 +519,7 @@ void func_808BE3FC(EnDekunuts* this, GlobalContext* globalCtx) { } void func_808BE484(EnDekunuts* this) { - Animation_PlayOnce(&this->skelAnime, &D_06002BD4); + Animation_PlayOnce(&this->skelAnime, &object_dekunuts_Anim_002BD4); this->actionFunc = func_808BE4D4; this->actor.speedXZ = 0.0f; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DEAD); @@ -554,13 +542,14 @@ void func_808BE4D4(EnDekunuts* this, GlobalContext* globalCtx) { Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0xE0); Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_OBJ_ETCETERA, this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z, 0, this->actor.home.rot.y, 0, 0x80); - EffectSsHahen_SpawnBurst(globalCtx, &this->actor.home.pos, 6.0f, 0, 6, 2, 15, 64, 10, D_06001F50); + EffectSsHahen_SpawnBurst(globalCtx, &this->actor.home.pos, 6.0f, 0, 6, 2, 15, 64, 10, + object_dekunuts_DL_001F50); Actor_MarkForDeath(&this->actor); } } void func_808BE680(EnDekunuts* this) { - Animation_MorphToLoop(&this->skelAnime, &D_0600326C, -3.0f); + Animation_MorphToLoop(&this->skelAnime, &object_dekunuts_Anim_00326C, -3.0f); this->actionFunc = func_808BE6C4; } @@ -748,7 +737,7 @@ void EnDekunuts_Draw(Actor* thisx, GlobalContext* globalCtx) { if (this->actor.colorFilterTimer != 0) { func_800AE5A0(globalCtx); } - Gfx_DrawDListOpa(globalCtx, D_06001E50); + Gfx_DrawDListOpa(globalCtx, object_dekunuts_DL_001E50); func_800BE680(globalCtx, &this->actor, this->unk_21C, 8, this->unk_214, this->unk_218, this->unk_210, this->unk_18E); } diff --git a/src/overlays/actors/ovl_En_Dg/z_en_dg.c b/src/overlays/actors/ovl_En_Dg/z_en_dg.c index 2cd27ff39..afc9767dd 100644 --- a/src/overlays/actors/ovl_En_Dg/z_en_dg.c +++ b/src/overlays/actors/ovl_En_Dg/z_en_dg.c @@ -5,6 +5,7 @@ */ #include "z_en_dg.h" +#include "objects/object_dog/object_dog.h" #define FLAGS 0x00800019 @@ -36,17 +37,6 @@ void func_8098BB10(EnDg* this, GlobalContext* globalCtx); void func_8098BBEC(EnDg* this, GlobalContext* globalCtx); void func_8098BC54(EnDg* this, GlobalContext* globalCtx); -extern AnimationHeader D_06000998; -extern AnimationHeader D_06001048; -extern AnimationHeader D_06001348; -extern AnimationHeader D_06001560; -extern AnimationHeader D_060017C0; -extern AnimationHeader D_06001A84; -extern AnimationHeader D_06001BD8; -extern AnimationHeader D_06001FB0; -extern AnimationHeader D_060021C8; -extern FlexSkeletonHeader D_060080F0; - const ActorInit En_Dg_InitVars = { ACTOR_EN_DG, ACTORCAT_ENEMY, @@ -140,12 +130,14 @@ static DamageTable sDamageTable = { }; static ActorAnimationEntryS sAnimations[] = { - { &D_060021C8, 1.0f, 0, -1, 0, 0 }, { &D_060021C8, 1.0f, 0, -1, 0, -6 }, { &D_06001BD8, 1.0f, 0, -1, 0, 0 }, - { &D_06000998, 1.0f, 0, -1, 0, -6 }, { &D_06001FB0, 1.0f, 0, -1, 2, -6 }, { &D_06001FB0, 1.0f, 0, -1, 4, -6 }, - { &D_06001048, 1.0f, 0, -1, 2, -6 }, { &D_06001348, 1.0f, 0, -1, 0, -6 }, { &D_06001048, 1.0f, 0, 27, 2, -6 }, - { &D_06001048, 1.0f, 28, -1, 2, -6 }, { &D_06001048, 1.0f, 54, 54, 2, -6 }, { &D_060021C8, -1.5f, -1, 0, 0, -6 }, - { &D_06001560, 1.0f, 0, -1, 2, 0 }, { &D_06001A84, 1.2f, 0, -1, 2, 0 }, { &D_060017C0, 1.2f, 0, -1, 2, 0 }, - { &D_060021C8, 0.5f, 0, -1, 0, 0 }, + { &object_dog_Anim_0021C8, 1.0f, 0, -1, 0, 0 }, { &object_dog_Anim_0021C8, 1.0f, 0, -1, 0, -6 }, + { &object_dog_Anim_001BD8, 1.0f, 0, -1, 0, 0 }, { &object_dog_Anim_000998, 1.0f, 0, -1, 0, -6 }, + { &object_dog_Anim_001FB0, 1.0f, 0, -1, 2, -6 }, { &object_dog_Anim_001FB0, 1.0f, 0, -1, 4, -6 }, + { &object_dog_Anim_001048, 1.0f, 0, -1, 2, -6 }, { &object_dog_Anim_001348, 1.0f, 0, -1, 0, -6 }, + { &object_dog_Anim_001048, 1.0f, 0, 27, 2, -6 }, { &object_dog_Anim_001048, 1.0f, 28, -1, 2, -6 }, + { &object_dog_Anim_001048, 1.0f, 54, 54, 2, -6 }, { &object_dog_Anim_0021C8, -1.5f, -1, 0, 0, -6 }, + { &object_dog_Anim_001560, 1.0f, 0, -1, 2, 0 }, { &object_dog_Anim_001A84, 1.2f, 0, -1, 2, 0 }, + { &object_dog_Anim_0017C0, 1.2f, 0, -1, 2, 0 }, { &object_dog_Anim_0021C8, 0.5f, 0, -1, 0, 0 }, }; static InitChainEntry sInitChain[] = { @@ -1117,7 +1109,8 @@ void EnDg_Init(Actor* thisx, GlobalContext* globalCtx) { s32 pad; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060080F0, NULL, this->jointTable, this->morphTable, 13); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_dog_Skel_0080F0, NULL, this->jointTable, this->morphTable, + 13); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); diff --git a/src/overlays/actors/ovl_En_Dinofos/z_en_dinofos.c b/src/overlays/actors/ovl_En_Dinofos/z_en_dinofos.c index b6f428714..a17c56f40 100644 --- a/src/overlays/actors/ovl_En_Dinofos/z_en_dinofos.c +++ b/src/overlays/actors/ovl_En_Dinofos/z_en_dinofos.c @@ -5,6 +5,7 @@ */ #include "z_en_dinofos.h" +#include "objects/object_dinofos/object_dinofos.h" #define FLAGS 0x00000435 @@ -56,25 +57,6 @@ void func_8089C398(EnDinofos* this); void func_8089C164(EnDinofos* this); void func_8089C244(EnDinofos* this); -extern FlexSkeletonHeader D_06009570; -extern AnimationHeader D_06002E40; -extern AnimationHeader D_060025B4; -extern AnimationHeader D_06000580; -extern AnimationHeader D_06001CCC; -extern AnimationHeader D_0600ABD0; -extern AnimationHeader D_0600D62C; -extern AnimationHeader D_06001040; -extern AnimationHeader D_060013C0; -extern AnimationHeader D_060017B8; -extern AnimationHeader D_0600C974; -extern AnimationHeader D_06009B70; -extern AnimationHeader D_06000AF0; -extern AnimationHeader D_0600D21C; -extern Gfx D_06008E30[]; -extern Gfx D_06009030[]; -extern Gfx D_06009230[]; -extern Gfx D_06009030[]; - const ActorInit En_Dinofos_InitVars = { ACTOR_EN_DINOFOS, ACTORCAT_ENEMY, @@ -259,11 +241,11 @@ static DamageTable sDamageTable = { static CollisionCheckInfoInit sColChkInfoInit = { 4, 40, 100, 80 }; -static Gfx* D_8089E33C[] = { - D_06008E30, - D_06009030, - D_06009230, - D_06009030, +static TexturePtr D_8089E33C[] = { + object_dinofos_Tex_008E30, + object_dinofos_Tex_009030, + object_dinofos_Tex_009230, + object_dinofos_Tex_009030, }; static s16 D_8089E34C = -1; @@ -293,7 +275,8 @@ void EnDinofos_Init(Actor* thisx, GlobalContext* globalCtx) { this->colliderJntSphElement); Collider_InitAndSetQuad(globalCtx, &this->colliderQuad, &this->actor, &sQuadInit); CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06009570, &D_06002E40, this->jointTable, this->morphTable, 21); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_dinofos_Skel_009570, &object_dinofos_Anim_002E40, + this->jointTable, this->morphTable, 21); if (D_8089E364 == 0) { for (i = 0; i < ARRAY_COUNT(D_8089E33C); i++) { @@ -483,8 +466,9 @@ void func_8089B100(EnDinofos* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); Vec3f sp3C; - Animation_Change(&this->skelAnime, &D_06001CCC, 1.0f, Animation_GetLastFrame(&D_06001CCC), - Animation_GetLastFrame(&D_06001CCC), 2, 0.0f); + Animation_Change(&this->skelAnime, &object_dinofos_Anim_001CCC, 1.0f, + Animation_GetLastFrame(&object_dinofos_Anim_001CCC), + Animation_GetLastFrame(&object_dinofos_Anim_001CCC), 2, 0.0f); func_800BE33C(&camera->eye, &camera->at, &this->unk_29A, true); Math_Vec3f_Diff(&this->actor.world.pos, &player->actor.world.pos, &sp3C); this->unk_2BC.x = player->actor.world.pos.x + (0.4f * sp3C.x); @@ -549,7 +533,7 @@ void func_8089B4A4(EnDinofos* this) { if (this->unk_290 < 10) { func_801A2E54(NA_BGM_MINI_BOSS); } - Animation_PlayOnce(&this->skelAnime, &D_0600C974); + Animation_PlayOnce(&this->skelAnime, &object_dinofos_Anim_00C974); this->unk_2BC.x = (Math_SinS(this->actor.shape.rot.y + 0x200) * 123.0f) + this->actor.world.pos.x; this->unk_2BC.y = this->actor.floorHeight + 11.0f; this->unk_2BC.z = (Math_CosS(this->actor.shape.rot.y + 0x200) * 123.0f) + this->actor.world.pos.z; @@ -589,7 +573,7 @@ void func_8089B580(EnDinofos* this, GlobalContext* globalCtx) { } void func_8089B6E8(EnDinofos* this) { - Animation_MorphToPlayOnce(&this->skelAnime, &D_06009B70, -3.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &object_dinofos_Anim_009B70, -3.0f); this->actionFunc = func_8089B72C; } @@ -607,7 +591,7 @@ void func_8089B72C(EnDinofos* this, GlobalContext* globalCtx) { } void func_8089B7B0(EnDinofos* this) { - Animation_MorphToLoop(&this->skelAnime, &D_06002E40, -4.0f); + Animation_MorphToLoop(&this->skelAnime, &object_dinofos_Anim_002E40, -4.0f); this->unk_290 = (s32)Rand_ZeroFloat(20.0f) + 40; this->unk_292 = 30; this->actor.speedXZ = 0.0f; @@ -635,7 +619,7 @@ void func_8089B8B0(EnDinofos* this, GlobalContext* globalCtx) { f32 phi_f0; if (this->actionFunc != func_8089B98C) { - Animation_MorphToLoop(&this->skelAnime, &D_06000580, -4.0f); + Animation_MorphToLoop(&this->skelAnime, &object_dinofos_Anim_000580, -4.0f); if (Actor_OtherIsTargeted(globalCtx, &this->actor)) { phi_f0 = 170.0f; } else { @@ -690,7 +674,7 @@ void func_8089B98C(EnDinofos* this, GlobalContext* globalCtx) { void func_8089BAC0(EnDinofos* this) { if (this->actionFunc != func_8089BB60) { - Animation_MorphToLoop(&this->skelAnime, &D_06000580, -4.0f); + Animation_MorphToLoop(&this->skelAnime, &object_dinofos_Anim_000580, -4.0f); this->actor.speedXZ = 0.0f; } if (BINANG_SUB(this->actor.yawTowardsPlayer, this->actor.shape.rot.y) > 0) { @@ -731,8 +715,8 @@ void func_8089BBB4(EnDinofos* this, GlobalContext* globalCtx) { if (this->actionFunc == func_8089D1E0) { this->skelAnime.playSpeed = this->actor.speedXZ * 0.166666671634f; } else { - Animation_Change(&this->skelAnime, &D_0600D62C, this->actor.speedXZ * 0.166666671634f, 0.0f, 0.0f, 0, - -4.0f); + Animation_Change(&this->skelAnime, &object_dinofos_Anim_00D62C, this->actor.speedXZ * 0.166666671634f, 0.0f, + 0.0f, 0, -4.0f); } this->actor.world.rot.y = BINANG_ADD(this->actor.shape.rot.y, 0x4000); @@ -811,10 +795,10 @@ void func_8089BD28(EnDinofos* this, GlobalContext* globalCtx) { void func_8089C024(EnDinofos* this, s32 arg1) { if (arg1 == 0) { - Animation_MorphToPlayOnce(&this->skelAnime, &D_06001CCC, 2.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &object_dinofos_Anim_001CCC, 2.0f); func_8089AD70(this); } else { - Animation_MorphToPlayOnce(&this->skelAnime, &D_06001CCC, -1.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &object_dinofos_Anim_001CCC, -1.0f); if ((arg1 == 2) || (arg1 == 3)) { this->colliderJntSph.base.acFlags &= ~AC_ON; func_8089AD70(this); @@ -878,10 +862,10 @@ void func_8089C2A8(EnDinofos* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); this->unk_290++; Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x1800); - if ((this->actor.velocity.y < 0.0f) && (this->skelAnime.animation == &D_06001CCC)) { + if ((this->actor.velocity.y < 0.0f) && (this->skelAnime.animation == &object_dinofos_Anim_001CCC)) { this->colliderQuad.base.atFlags |= AT_ON; this->colliderJntSph.base.acFlags |= AC_ON; - Animation_Change(&this->skelAnime, &D_060025B4, 1.0f, 7.0f, 13.0f, 2, -2.0f); + Animation_Change(&this->skelAnime, &object_dinofos_Anim_0025B4, 1.0f, 7.0f, 13.0f, 2, -2.0f); } if (this->actor.bgCheckFlags & 1) { @@ -892,9 +876,9 @@ void func_8089C2A8(EnDinofos* this, GlobalContext* globalCtx) { void func_8089C398(EnDinofos* this) { if (this->actionFunc != func_8089C2A8) { - Animation_PlayOnce(&this->skelAnime, &D_06000AF0); + Animation_PlayOnce(&this->skelAnime, &object_dinofos_Anim_000AF0); } else { - this->skelAnime.endFrame = Animation_GetLastFrame(&D_060025B4); + this->skelAnime.endFrame = Animation_GetLastFrame(&object_dinofos_Anim_0025B4); } if (this->actor.speedXZ < 0.0f) { @@ -921,7 +905,7 @@ void func_8089C44C(EnDinofos* this, GlobalContext* globalCtx) { } void func_8089C4F8(EnDinofos* this) { - Animation_PlayOnce(&this->skelAnime, &D_060025B4); + Animation_PlayOnce(&this->skelAnime, &object_dinofos_Anim_0025B4); this->colliderQuad.base.atFlags &= ~AT_BOUNCED; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIZA_CRY); this->unk_290 = 0; @@ -952,7 +936,7 @@ void func_8089C56C(EnDinofos* this, GlobalContext* globalCtx) { } void func_8089C690(EnDinofos* this) { - Animation_Change(&this->skelAnime, &D_060025B4, -1.0f, this->skelAnime.curFrame, 0.0f, 2, 0.0f); + Animation_Change(&this->skelAnime, &object_dinofos_Anim_0025B4, -1.0f, this->skelAnime.curFrame, 0.0f, 2, 0.0f); this->colliderQuad.base.atFlags &= ~(AT_ON | AT_BOUNCED); if (this->actionFunc != func_8089C2A8) { this->actor.world.rot.y = this->actor.shape.rot.y; @@ -1002,7 +986,7 @@ void func_8089C7B8(EnDinofos* this, GlobalContext* globalCtx) { } void func_8089C87C(EnDinofos* this, s32 arg1) { - Animation_PlayOnce(&this->skelAnime, &D_0600D21C); + Animation_PlayOnce(&this->skelAnime, &object_dinofos_Anim_00D21C); func_800BE5CC(&this->actor, &this->colliderJntSph, arg1); this->actor.shape.rot.y = BINANG_ROT180(this->actor.world.rot.y); this->actor.speedXZ = 10.0f; @@ -1035,7 +1019,7 @@ void func_8089C938(EnDinofos* this, GlobalContext* globalCtx) { } void func_8089CA14(EnDinofos* this) { - Animation_MorphToPlayOnce(&this->skelAnime, &D_06001040, -5.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &object_dinofos_Anim_001040, -5.0f); this->colliderJntSph.base.acFlags |= AC_ON; this->actor.speedXZ = 0.0f; this->actor.world.rot.y = this->actor.shape.rot.y; @@ -1056,7 +1040,7 @@ void func_8089CB10(EnDinofos* this, GlobalContext* globalCtx) { s32 i; Sphere16* worldSphere; - Animation_PlayLoop(&this->skelAnime, &D_060013C0); + Animation_PlayLoop(&this->skelAnime, &object_dinofos_Anim_0013C0); this->unk_290 = 20; this->actor.speedXZ = 0.0f; this->colliderJntSph.base.atFlags |= AT_ON; @@ -1128,7 +1112,7 @@ void func_8089CBEC(EnDinofos* this, GlobalContext* globalCtx) { } void func_8089CF00(EnDinofos* this, GlobalContext* globalCtx) { - Animation_PlayOnce(&this->skelAnime, &D_060017B8); + Animation_PlayOnce(&this->skelAnime, &object_dinofos_Anim_0017B8); this->colliderJntSph.base.atFlags &= ~AT_ON; if (globalCtx->sceneNum == SCENE_MITURIN) { globalCtx->envCtx.unk_C3 = 255; @@ -1143,7 +1127,7 @@ void func_8089CF70(EnDinofos* this, GlobalContext* globalCtx) { } void func_8089CFAC(EnDinofos* this) { - Animation_PlayOnce(&this->skelAnime, &D_0600ABD0); + Animation_PlayOnce(&this->skelAnime, &object_dinofos_Anim_00ABD0); this->actor.flags &= ~1; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIZA_DEAD); this->actor.speedXZ = 0.0f; @@ -1183,7 +1167,8 @@ void func_8089D11C(EnDinofos* this, s16 arg1) { } else { this->actor.speedXZ = 15.0f; } - Animation_Change(&this->skelAnime, &D_0600D62C, this->actor.speedXZ * (1.0f / 7.5f), 0.0f, 0.0f, 0, -4.0f); + Animation_Change(&this->skelAnime, &object_dinofos_Anim_00D62C, this->actor.speedXZ * (1.0f / 7.5f), 0.0f, 0.0f, 0, + -4.0f); this->actor.world.rot.y = BINANG_ADD(this->actor.shape.rot.y, 0x4000); this->unk_292 = 10; this->unk_2A4 = 0.0f; @@ -1355,8 +1340,8 @@ s32 func_8089D60C(EnDinofos* this, GlobalContext* globalCtx) { } void EnDinofos_Update(Actor* thisx, GlobalContext* globalCtx2) { - EnDinofos* this = THIS; GlobalContext* globalCtx = globalCtx2; + EnDinofos* this = THIS; s32 pad; Vec3f sp30; diff --git a/src/overlays/actors/ovl_En_Dnb/z_en_dnb.c b/src/overlays/actors/ovl_En_Dnb/z_en_dnb.c index 7e4b67b7c..05da2a9b4 100644 --- a/src/overlays/actors/ovl_En_Dnb/z_en_dnb.c +++ b/src/overlays/actors/ovl_En_Dnb/z_en_dnb.c @@ -5,6 +5,8 @@ */ #include "z_en_dnb.h" +#include "objects/object_hanareyama_obj/object_hanareyama_obj.h" +#include "objects/gameplay_keep/gameplay_keep.h" #define FLAGS 0x000000B0 @@ -19,12 +21,6 @@ s32 func_80A507C0(EnDnbUnkStruct* arg0, Vec3f arg1, Vec3f arg2, u8 arg3, f32 arg s32 func_80A5086C(EnDnbUnkStruct* arg0); s32 func_80A50950(EnDnbUnkStruct* arg0, GlobalContext* globalCtx); -extern Gfx D_06000000[]; -extern Gfx D_06000020[]; -extern Gfx D_06004638[]; -extern Vec3s D_06004710[]; -extern CollisionHeader D_06004D8C; - const ActorInit En_Dnb_InitVars = { ACTOR_EN_DNB, ACTORCAT_BG, @@ -109,9 +105,9 @@ void EnDnb_Init(Actor* thisx, GlobalContext* globalCtx) { s16* alloc; DynaPolyActor_Init(&this->dyna, 1); - DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06004D8C); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_hanareyama_obj_Colheader_004D8C); - alloc = (s16*)Lib_SegmentedToVirtual(D_06004710); + alloc = (s16*)Lib_SegmentedToVirtual(object_hanareyama_obj_Vec_004710); for (i = 0; i < ARRAY_COUNT(this->particles); i++) { func_80A4FDD0(&this->particles[i], this, alloc, i); } @@ -156,7 +152,7 @@ void EnDnb_Update(Actor* thisx, GlobalContext* globalCtx) { void func_80A50510(EnDnb* this, GlobalContext* globalCtx) { s32 i; - Gfx** gfx = Lib_SegmentedToVirtual(D_06004638); + Gfx** gfx = Lib_SegmentedToVirtual(object_hanareyama_obj_DLArray_004638); OPEN_DISPS(globalCtx->state.gfxCtx); @@ -181,7 +177,7 @@ void func_80A50510(EnDnb* this, GlobalContext* globalCtx) { void func_80A5063C(EnDnb* this, GlobalContext* globalCtx) { s32 i; - Gfx** gfx = Lib_SegmentedToVirtual(D_06004638); + Gfx** gfx = Lib_SegmentedToVirtual(object_hanareyama_obj_DLArray_004638); OPEN_DISPS(globalCtx->state.gfxCtx); @@ -259,7 +255,7 @@ s32 func_80A5086C(EnDnbUnkStruct* arg0) { s32 func_80A50950(EnDnbUnkStruct* arg0, GlobalContext* globalCtx2) { static TexturePtr D_80A50CBC[] = { - D_0408F7E0, D_0408F3E0, D_0408EFE0, D_0408EBE0, D_0408E7E0, D_0408E3E0, D_0408DFE0, D_0408DBE0, + gDust8Tex, gDust7Tex, gDust6Tex, gDust5Tex, gDust4Tex, gDust3Tex, gDust2Tex, gDust1Tex, }; GlobalContext* globalCtx = globalCtx2; s32 isGfxSetup = false; @@ -275,7 +271,7 @@ s32 func_80A50950(EnDnbUnkStruct* arg0, GlobalContext* globalCtx2) { if (arg0->isEnabled == 1) { if (!isGfxSetup) { POLY_XLU_DISP = Gfx_CallSetupDL(POLY_XLU_DISP, 0); - gSPDisplayList(POLY_XLU_DISP++, D_06000000); + gSPDisplayList(POLY_XLU_DISP++, object_hanareyama_obj_DL_000000); gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 255, 0); isGfxSetup = true; } @@ -294,7 +290,7 @@ s32 func_80A50950(EnDnbUnkStruct* arg0, GlobalContext* globalCtx2) { G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); idx = (arg0->unk_01 / (f32)arg0->unk_02) * 8.0f; gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(D_80A50CBC[idx])); - gSPDisplayList(POLY_XLU_DISP++, D_06000020); + gSPDisplayList(POLY_XLU_DISP++, object_hanareyama_obj_DL_000020); Matrix_StatePop(); sp5C += 1; diff --git a/src/overlays/actors/ovl_En_Dnk/z_en_dnk.c b/src/overlays/actors/ovl_En_Dnk/z_en_dnk.c index 2dcf85e3d..933381034 100644 --- a/src/overlays/actors/ovl_En_Dnk/z_en_dnk.c +++ b/src/overlays/actors/ovl_En_Dnk/z_en_dnk.c @@ -5,6 +5,9 @@ */ #include "z_en_dnk.h" +#include "objects/object_dnk/object_dnk.h" +#include "objects/object_hintnuts/object_hintnuts.h" +#include "objects/object_dekunuts/object_dekunuts.h" #define FLAGS 0x00000009 @@ -19,39 +22,6 @@ void EnDnk_DoNothing(EnDnk* this, GlobalContext* globalCtx); void func_80A52018(Actor* thisx, GlobalContext* globalCtx); void func_80A52134(EnDnk* this, GlobalContext* globalCtx); -extern AnimationHeader D_06000168; -extern AnimationHeader D_0600031C; -extern AnimationHeader D_06000430; -extern AnimationHeader D_060006CC; -extern AnimationHeader D_06000894; -extern AnimationHeader D_06000B70; -extern UNK_PTR D_06001680[]; -extern UNK_PTR D_06001700[]; -extern UNK_PTR D_06001780[]; -extern SkeletonHeader D_060023B8; -extern SkeletonHeader D_06002468; -extern AnimationHeader D_060024CC; -extern AnimationHeader D_0600259C; -extern AnimationHeader D_060026C4; -extern SkeletonHeader D_06002848; -extern AnimationHeader D_06002894; -extern AnimationHeader D_06002950; -extern AnimationHeader D_060029BC; -extern AnimationHeader D_06002A08; -extern AnimationHeader D_06002A5C; -extern AnimationHeader D_06002B6C; -extern AnimationHeader D_06002B90; -extern AnimationHeader D_06002BD4; -extern AnimationHeader D_06002DD4; -extern AnimationHeader D_06002E84; -extern AnimationHeader D_06002F7C; -extern AnimationHeader D_06002FA4; -extern AnimationHeader D_06003128; -extern AnimationHeader D_06003180; -extern AnimationHeader D_0600326C; -extern AnimationHeader D_060033E4; -extern AnimationHeader D_06003780; - static s16 D_80A521A0 = 0; const ActorInit En_Dnk_InitVars = { @@ -124,18 +94,24 @@ static DamageTable sDamageTable = { }; static ActorAnimationEntryS sAnimations[] = { - { &D_06000B70, 1.0f, 0, -1, 2, 0 }, { &D_06000B70, 1.0f, 0, -1, 2, -4 }, { &D_06002A08, 1.0f, 0, -1, 0, -4 }, - { &D_0600031C, 1.0f, 0, -1, 0, -4 }, { &D_06000430, 1.0f, -1, -1, 2, 0 }, { &D_06000430, 1.0f, 0, -1, 2, -4 }, - { &D_06000894, 1.0f, 0, -1, 2, -4 }, { &D_06002B6C, 1.0f, 0, -1, 0, 0 }, { &D_06002B6C, 1.0f, 0, -1, 0, -4 }, - { &D_060006CC, 1.0f, 0, -1, 0, -4 }, { &D_06000168, 1.0f, 0, -1, 2, -4 }, { &D_060024CC, 1.0f, -1, -1, 2, 0 }, - { &D_060024CC, 1.0f, 0, -1, 2, -4 }, { &D_060026C4, 1.0f, 0, -1, 2, -4 }, { &D_06002894, 1.0f, 0, -1, 2, -4 }, - { &D_06002B90, 1.0f, 0, -1, 2, -4 }, { &D_06002F7C, 1.0f, 0, -1, 0, 0 }, { &D_06002F7C, 1.0f, 0, -1, 0, -4 }, - { &D_06003128, 1.0f, 0, -1, 0, 0 }, { &D_06003128, 1.0f, 0, -1, 0, -4 }, { &D_060029BC, 1.0f, 0, -1, 0, -4 }, - { &D_06002E84, 1.0f, 0, -1, 0, -4 }, { &D_06000168, 1.0f, 0, -1, 0, -4 }, { &D_0600259C, 1.0f, 0, -1, 2, -4 }, - { &D_06002A5C, 1.0f, 0, -1, 2, 0 }, { &D_06002A5C, 1.0f, 0, -1, 2, -4 }, { &D_06002BD4, 1.0f, 0, -1, 2, -4 }, - { &D_06002DD4, 1.0f, 0, -1, 2, -4 }, { &D_06002FA4, 1.0f, 0, -1, 0, -4 }, { &D_06003180, 1.0f, 0, -1, 2, -4 }, - { &D_0600326C, 1.0f, 0, -1, 0, 0 }, { &D_0600326C, 1.0f, 0, -1, 0, -4 }, { &D_060033E4, 1.0f, 0, -1, 0, -4 }, - { &D_06003780, 1.0f, 0, -1, 0, 0 }, { &D_06003780, 1.0f, 0, -1, 0, -4 }, { &D_06002950, 1.0f, 0, -1, 0, 0 }, + { &object_dnk_Anim_000B70, 1.0f, 0, -1, 2, 0 }, { &object_dnk_Anim_000B70, 1.0f, 0, -1, 2, -4 }, + { &object_dnk_Anim_002A08, 1.0f, 0, -1, 0, -4 }, { &object_dnk_Anim_00031C, 1.0f, 0, -1, 0, -4 }, + { &object_dnk_Anim_000430, 1.0f, -1, -1, 2, 0 }, { &object_dnk_Anim_000430, 1.0f, 0, -1, 2, -4 }, + { &object_dnk_Anim_000894, 1.0f, 0, -1, 2, -4 }, { &object_dnk_Anim_002B6C, 1.0f, 0, -1, 0, 0 }, + { &object_dnk_Anim_002B6C, 1.0f, 0, -1, 0, -4 }, { &object_dnk_Anim_0006CC, 1.0f, 0, -1, 0, -4 }, + { &object_hintnuts_Anim_000168, 1.0f, 0, -1, 2, -4 }, { &object_hintnuts_Anim_0024CC, 1.0f, -1, -1, 2, 0 }, + { &object_hintnuts_Anim_0024CC, 1.0f, 0, -1, 2, -4 }, { &object_hintnuts_Anim_0026C4, 1.0f, 0, -1, 2, -4 }, + { &object_hintnuts_Anim_002894, 1.0f, 0, -1, 2, -4 }, { &object_hintnuts_Anim_002B90, 1.0f, 0, -1, 2, -4 }, + { &object_hintnuts_Anim_002F7C, 1.0f, 0, -1, 0, 0 }, { &object_hintnuts_Anim_002F7C, 1.0f, 0, -1, 0, -4 }, + { &object_hintnuts_Anim_003128, 1.0f, 0, -1, 0, 0 }, { &object_hintnuts_Anim_003128, 1.0f, 0, -1, 0, -4 }, + { &object_hintnuts_Anim_0029BC, 1.0f, 0, -1, 0, -4 }, { &object_hintnuts_Anim_002E84, 1.0f, 0, -1, 0, -4 }, + { &object_dekunuts_Anim_000168, 1.0f, 0, -1, 0, -4 }, { &object_dekunuts_Anim_00259C, 1.0f, 0, -1, 2, -4 }, + { &object_dekunuts_Anim_002A5C, 1.0f, 0, -1, 2, 0 }, { &object_dekunuts_Anim_002A5C, 1.0f, 0, -1, 2, -4 }, + { &object_dekunuts_Anim_002BD4, 1.0f, 0, -1, 2, -4 }, { &object_dekunuts_Anim_002DD4, 1.0f, 0, -1, 2, -4 }, + { &object_dekunuts_Anim_002FA4, 1.0f, 0, -1, 0, -4 }, { &object_dekunuts_Anim_003180, 1.0f, 0, -1, 2, -4 }, + { &object_dekunuts_Anim_00326C, 1.0f, 0, -1, 0, 0 }, { &object_dekunuts_Anim_00326C, 1.0f, 0, -1, 0, -4 }, + { &object_dekunuts_Anim_0033E4, 1.0f, 0, -1, 0, -4 }, { &object_dekunuts_Anim_003780, 1.0f, 0, -1, 0, 0 }, + { &object_dekunuts_Anim_003780, 1.0f, 0, -1, 0, -4 }, { &object_dekunuts_Anim_002950, 1.0f, 0, -1, 0, 0 }, }; s32 func_80A514F0(SkelAnime* skelAnime, s16 animIndex) { @@ -144,7 +120,7 @@ s32 func_80A514F0(SkelAnime* skelAnime, s16 animIndex) { s32 sp30 = false; if (animIndex >= 0) { - if (animIndex < 36) { + if (animIndex < ARRAY_COUNT(sAnimations)) { sp30 = true; frameCount = sAnimations[animIndex].frameCount; if (frameCount < 0) { @@ -184,17 +160,20 @@ void func_80A51648(EnDnk* this, GlobalContext* globalCtx) { switch (ENDNK_GET_3(&this->actor)) { case ENDNK_GET_3_0: - SkelAnime_Init(globalCtx, &this->skelAnime, &D_06002848, NULL, this->jointTable, this->morphTable, 11); + SkelAnime_Init(globalCtx, &this->skelAnime, &object_dnk_Skel_002848, NULL, this->jointTable, + this->morphTable, 11); func_80A514F0(&this->skelAnime, 7); break; case ENDNK_GET_3_1: - SkelAnime_Init(globalCtx, &this->skelAnime, &D_060023B8, NULL, this->jointTable, this->morphTable, 10); + SkelAnime_Init(globalCtx, &this->skelAnime, &object_hintnuts_Skel_0023B8.sh, NULL, this->jointTable, + this->morphTable, 10); func_80A514F0(&this->skelAnime, 18); break; case ENDNK_GET_3_2: - SkelAnime_Init(globalCtx, &this->skelAnime, &D_06002468, NULL, this->jointTable, this->morphTable, 10); + SkelAnime_Init(globalCtx, &this->skelAnime, &object_dekunuts_Skel_002468, NULL, this->jointTable, + this->morphTable, 10); func_80A514F0(&this->skelAnime, 35); break; } @@ -328,10 +307,10 @@ void func_80A51AA4(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* } void func_80A51CB8(EnDnk* this, GlobalContext* globalCtx) { - static UNK_PTR D_80A5245C[] = { - D_06001680, - D_06001700, - D_06001780, + static TexturePtr D_80A5245C[] = { + object_dnk_Tex_001680, + object_dnk_Tex_001700, + object_dnk_Tex_001780, }; s32 pad; diff --git a/src/overlays/actors/ovl_En_Dno/z_en_dno.c b/src/overlays/actors/ovl_En_Dno/z_en_dno.c index 87222e772..e04a3c98e 100644 --- a/src/overlays/actors/ovl_En_Dno/z_en_dno.c +++ b/src/overlays/actors/ovl_En_Dno/z_en_dno.c @@ -7,6 +7,7 @@ #include "z_en_dno.h" #include "overlays/actors/ovl_Bg_Crace_Movebg/z_bg_crace_movebg.h" #include "objects/gameplay_keep/gameplay_keep.h" +#include "objects/object_dno/object_dno.h" #define FLAGS 0x00000039 @@ -39,37 +40,19 @@ void func_80A732C8(EnDno* this, GlobalContext* globalCtx); s32 EnDno_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx); void EnDno_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx); -extern AnimationHeader D_06000470; -extern AnimationHeader D_060008F0; -extern AnimationHeader D_06000F6C; -extern AnimationHeader D_06001A50; -extern AnimationHeader D_06002530; -extern AnimationHeader D_06003320; -extern AnimationHeader D_060036D0; -extern AnimationHeader D_060041CC; -extern AnimationHeader D_06004DD8; -extern AnimationHeader D_060051E4; -extern AnimationHeader D_06005E20; -extern AnimationHeader D_06005F98; -extern AnimationHeader D_06006488; -extern AnimationHeader D_06006F84; -extern AnimationHeader D_060073E4; -extern AnimationHeader D_060077A8; -extern AnimationHeader D_06007CA4; -extern AnimationHeader D_06008324; -extern AnimationHeader D_06008AE4; -extern AnimationHeader D_06009100; -extern FlexSkeletonHeader D_0600E1F8; extern u8 D_801C20C0; static struct_80B8E1A8 sAnimations[] = { - { &D_06000470, 1.0f, 2, 0.0f }, { &D_060008F0, 1.0f, 2, 0.0f }, { &D_06000F6C, 1.0f, 0, 0.0f }, - { &D_06001A50, 1.0f, 2, 0.0f }, { &D_06002530, 1.0f, 2, 0.0f }, { &D_06003320, 1.0f, 2, 0.0f }, - { &D_060036D0, 1.0f, 0, 0.0f }, { &D_060041CC, 1.0f, 2, 0.0f }, { &D_06004DD8, 1.0f, 2, 0.0f }, - { &D_06005F98, 1.0f, 0, 0.0f }, { &D_06006488, 1.0f, 2, 0.0f }, { &D_060073E4, 1.0f, 0, 0.0f }, - { &D_060077A8, 1.0f, 0, 0.0f }, { &D_06007CA4, 1.0f, 0, 0.0f }, { &D_06008324, 1.0f, 0, 0.0f }, - { &D_06008AE4, 1.0f, 2, 0.0f }, { &D_06009100, 1.0f, 2, 0.0f }, { &D_060051E4, 1.0f, 2, 0.0f }, - { &D_06005E20, 1.0f, 0, 0.0f }, { &D_06006F84, 1.0f, 0, 0.0f }, + { &object_dno_Anim_000470, 1.0f, 2, 0.0f }, { &object_dno_Anim_0008F0, 1.0f, 2, 0.0f }, + { &object_dno_Anim_000F6C, 1.0f, 0, 0.0f }, { &object_dno_Anim_001A50, 1.0f, 2, 0.0f }, + { &object_dno_Anim_002530, 1.0f, 2, 0.0f }, { &object_dno_Anim_003320, 1.0f, 2, 0.0f }, + { &object_dno_Anim_0036D0, 1.0f, 0, 0.0f }, { &object_dno_Anim_0041CC, 1.0f, 2, 0.0f }, + { &object_dno_Anim_004DD8, 1.0f, 2, 0.0f }, { &object_dno_Anim_005F98, 1.0f, 0, 0.0f }, + { &object_dno_Anim_006488, 1.0f, 2, 0.0f }, { &object_dno_Anim_0073E4, 1.0f, 0, 0.0f }, + { &object_dno_Anim_0077A8, 1.0f, 0, 0.0f }, { &object_dno_Anim_007CA4, 1.0f, 0, 0.0f }, + { &object_dno_Anim_008324, 1.0f, 0, 0.0f }, { &object_dno_Anim_008AE4, 1.0f, 2, 0.0f }, + { &object_dno_Anim_009100, 1.0f, 2, 0.0f }, { &object_dno_Anim_0051E4, 1.0f, 2, 0.0f }, + { &object_dno_Anim_005E20, 1.0f, 0, 0.0f }, { &object_dno_Anim_006F84, 1.0f, 0, 0.0f }, }; const ActorInit En_Dno_InitVars = { @@ -213,8 +196,8 @@ void EnDno_Init(Actor* thisx, GlobalContext* globalCtx) { if (actor == NULL) { Actor_ProcessInitChain(thisx, sInitChain); ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawCircle, 21.0f); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600E1F8, &D_06007CA4, this->jointTable, - this->morphTable, 28); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_dno_Skel_00E1F8, &object_dno_Anim_007CA4, + this->jointTable, this->morphTable, 28); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, thisx, &sCylinderInit); Actor_UpdateBgCheckInfo(globalCtx, thisx, 0.0f, 0.0f, 0.0f, 4); diff --git a/src/overlays/actors/ovl_En_Dnp/z_en_dnp.c b/src/overlays/actors/ovl_En_Dnp/z_en_dnp.c index b8cfc9293..aae33de71 100644 --- a/src/overlays/actors/ovl_En_Dnp/z_en_dnp.c +++ b/src/overlays/actors/ovl_En_Dnp/z_en_dnp.c @@ -5,6 +5,7 @@ */ #include "z_en_dnp.h" +#include "objects/object_dnp/object_dnp.h" #define FLAGS 0x00000019 @@ -21,35 +22,6 @@ void func_80B3D338(EnDnp* this, GlobalContext* globalCtx); void func_80B3D3F8(EnDnp* this, GlobalContext* globalCtx); void func_80B3D558(EnDnp* this, GlobalContext* globalCtx); -extern AnimationHeader D_060007D8; -extern AnimationHeader D_0600125C; -extern AnimationHeader D_060017F8; -extern AnimationHeader D_06001C1C; -extern AnimationHeader D_060021DC; -extern AnimationHeader D_060026B8; -extern AnimationHeader D_06004D08; -extern AnimationHeader D_060057AC; -extern AnimationHeader D_0600625C; -extern AnimationHeader D_0600674C; -extern AnimationHeader D_06006B74; -extern AnimationHeader D_060071F4; -extern AnimationHeader D_06007960; -extern AnimationHeader D_06008588; -extern AnimationHeader D_0600923C; -extern AnimationHeader D_06009AA0; -extern AnimationHeader D_0600A900; -extern AnimationHeader D_0600AEB8; -extern AnimationHeader D_0600B324; -extern AnimationHeader D_0600B754; -extern AnimationHeader D_0600BAD8; -extern Gfx D_060103D0[]; -extern Gfx D_060105D0[]; -extern Gfx D_060107D0[]; -extern Gfx D_060109D0[]; -extern FlexSkeletonHeader D_06010D60; -extern AnimationHeader D_060115B8; -extern AnimationHeader D_06012428; - const ActorInit En_Dnp_InitVars = { ACTOR_EN_DNP, ACTORCAT_NPC, @@ -85,15 +57,19 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; static ActorAnimationEntryS sAnimations[] = { - { &D_060007D8, 1.0f, 0, -1, 2, -4 }, { &D_060021DC, 1.0f, 0, -1, 0, 0 }, { &D_060021DC, 1.0f, 0, -1, 0, -4 }, - { &D_060026B8, 1.0f, 0, -1, 2, -4 }, { &D_06004D08, 1.0f, 0, -1, 2, -4 }, { &D_060071F4, 1.0f, 0, -1, 2, -4 }, - { &D_06007960, 1.0f, 0, -1, 0, -4 }, { &D_06008588, 1.0f, 0, -1, 2, 0 }, { &D_0600A900, 1.0f, 0, -1, 0, -4 }, - { &D_0600AEB8, 1.0f, 0, -1, 0, -4 }, { &D_0600B754, 1.0f, 0, -1, 2, -4 }, { &D_0600674C, 1.0f, 0, -1, 0, -4 }, - { &D_0600BAD8, 1.0f, 0, -1, 2, -4 }, { &D_06006B74, 1.0f, 0, -1, 0, -4 }, { &D_06012428, 1.0f, 0, -1, 0, -4 }, - { &D_0600B324, 1.0f, 0, -1, 0, 0 }, { &D_0600B324, 1.0f, 0, -1, 0, -4 }, { &D_060115B8, 1.0f, 0, -1, 0, -4 }, - { &D_060115B8, 1.0f, 0, -1, 0, 0 }, { &D_0600923C, 1.0f, 0, -1, 2, -4 }, { &D_06009AA0, 1.0f, 0, -1, 0, -4 }, - { &D_0600125C, 1.0f, 0, -1, 2, -4 }, { &D_060017F8, 1.0f, 0, -1, 2, 0 }, { &D_06001C1C, 1.0f, 0, -1, 0, -4 }, - { &D_060057AC, 1.0f, 0, -1, 2, 0 }, { &D_0600625C, 1.0f, 0, -1, 0, -4 }, + { &object_dnp_Anim_0007D8, 1.0f, 0, -1, 2, -4 }, { &object_dnp_Anim_0021DC, 1.0f, 0, -1, 0, 0 }, + { &object_dnp_Anim_0021DC, 1.0f, 0, -1, 0, -4 }, { &object_dnp_Anim_0026B8, 1.0f, 0, -1, 2, -4 }, + { &object_dnp_Anim_004D08, 1.0f, 0, -1, 2, -4 }, { &object_dnp_Anim_0071F4, 1.0f, 0, -1, 2, -4 }, + { &object_dnp_Anim_007960, 1.0f, 0, -1, 0, -4 }, { &object_dnp_Anim_008588, 1.0f, 0, -1, 2, 0 }, + { &object_dnp_Anim_00A900, 1.0f, 0, -1, 0, -4 }, { &object_dnp_Anim_00AEB8, 1.0f, 0, -1, 0, -4 }, + { &object_dnp_Anim_00B754, 1.0f, 0, -1, 2, -4 }, { &object_dnp_Anim_00674C, 1.0f, 0, -1, 0, -4 }, + { &object_dnp_Anim_00BAD8, 1.0f, 0, -1, 2, -4 }, { &object_dnp_Anim_006B74, 1.0f, 0, -1, 0, -4 }, + { &object_dnp_Anim_012428, 1.0f, 0, -1, 0, -4 }, { &object_dnp_Anim_00B324, 1.0f, 0, -1, 0, 0 }, + { &object_dnp_Anim_00B324, 1.0f, 0, -1, 0, -4 }, { &object_dnp_Anim_0115B8, 1.0f, 0, -1, 0, -4 }, + { &object_dnp_Anim_0115B8, 1.0f, 0, -1, 0, 0 }, { &object_dnp_Anim_00923C, 1.0f, 0, -1, 2, -4 }, + { &object_dnp_Anim_009AA0, 1.0f, 0, -1, 0, -4 }, { &object_dnp_Anim_00125C, 1.0f, 0, -1, 2, -4 }, + { &object_dnp_Anim_0017F8, 1.0f, 0, -1, 2, 0 }, { &object_dnp_Anim_001C1C, 1.0f, 0, -1, 0, -4 }, + { &object_dnp_Anim_0057AC, 1.0f, 0, -1, 2, 0 }, { &object_dnp_Anim_00625C, 1.0f, 0, -1, 0, -4 }, }; static s32 D_80B3DE58[] = { @@ -358,7 +334,8 @@ void EnDnp_Init(Actor* thisx, GlobalContext* globalCtx) { EnDnp* this = THIS; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 16.0f); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06010D60, NULL, this->jointTable, this->morphTable, 26); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_dnp_Skel_010D60, NULL, this->jointTable, this->morphTable, + 26); this->unk_340 = -1; func_80B3CC38(this, 15); Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); @@ -489,11 +466,11 @@ void EnDnp_TransformLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thi } void EnDnp_Draw(Actor* thisx, GlobalContext* globalCtx) { - static Gfx* D_80B3DEAC[] = { - D_060103D0, - D_060105D0, - D_060107D0, - D_060109D0, + static TexturePtr D_80B3DEAC[] = { + object_dnp_Tex_0103D0, + object_dnp_Tex_0105D0, + object_dnp_Tex_0107D0, + object_dnp_Tex_0109D0, }; EnDnp* this = THIS; diff --git a/src/overlays/actors/ovl_En_Dnq/z_en_dnq.c b/src/overlays/actors/ovl_En_Dnq/z_en_dnq.c index e036626dc..31d98007f 100644 --- a/src/overlays/actors/ovl_En_Dnq/z_en_dnq.c +++ b/src/overlays/actors/ovl_En_Dnq/z_en_dnq.c @@ -5,6 +5,7 @@ */ #include "z_en_dnq.h" +#include "objects/object_dnq/object_dnq.h" #define FLAGS 0x00000009 @@ -17,24 +18,6 @@ void EnDnq_Draw(Actor* thisx, GlobalContext* globalCtx); void func_80A52FB8(EnDnq* this, GlobalContext* globalCtx); -extern AnimationHeader D_060006F0; -extern AnimationHeader D_06000BF8; -extern AnimationHeader D_06001100; -extern AnimationHeader D_06001AEC; -extern AnimationHeader D_06002690; -extern AnimationHeader D_06003408; -extern AnimationHeader D_06003DBC; -extern AnimationHeader D_060047B8; -extern AnimationHeader D_06004EA0; -extern AnimationHeader D_06005284; -extern AnimationHeader D_06005A14; -extern AnimationHeader D_06005E18; -extern AnimationHeader D_06006984; -extern AnimationHeader D_06007528; -extern AnimationHeader D_06008328; -extern FlexSkeletonHeader D_0600EB48; -extern AnimationHeader D_0600F504; - static s32 D_80A53400[] = { 0x00120100, 0x150E0899, 0x0C120F08, 0x9A0C0F08, 0x9B0C0F08, 0x9C0C1112, 0x01100E08, 0x980C1000, 0x00120200, 0x0C0E089D, 0x0C0F089E, 0x0C111202, 0x100E089F, 0x0C100000, 0x0E08A10C, 0x0F08A20C, 0x10000000, @@ -75,13 +58,16 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit2 sColChkInfoInit = { 1, 0, 0, 0, MASS_IMMOVABLE }; static ActorAnimationEntryS D_80A5349C[] = { - { &D_06008328, 1.0f, 0, -1, 0, 0 }, { &D_06008328, 1.0f, 0, -1, 0, -4 }, { &D_06007528, 1.0f, 0, -1, 2, -4 }, - { &D_060006F0, 1.0f, 0, -1, 2, 0 }, { &D_06000BF8, 1.0f, 0, -1, 0, -4 }, { &D_06002690, 0.0f, 0, -1, 2, 0 }, - { &D_06002690, 1.0f, 0, -1, 2, -4 }, { &D_06003408, 1.0f, 0, -1, 0, -4 }, { &D_06006984, 1.0f, 0, -1, 2, -4 }, - { &D_06005E18, 1.0f, 0, -1, 2, -4 }, { &D_06005A14, 1.0f, 0, -1, 2, -4 }, { &D_06005284, 1.0f, 0, -1, 2, -4 }, - { &D_06001AEC, 1.0f, 0, -1, 2, 0 }, { &D_06001100, 1.0f, 0, -1, 2, 0 }, { &D_06004EA0, 1.0f, 0, -1, 0, -4 }, - { &D_0600F504, 1.0f, 0, -1, 0, -4 }, { &D_060047B8, 1.0f, 0, -1, 0, -4 }, { &D_06003DBC, 1.0f, 0, -1, 2, -4 }, - { &D_06005A14, 1.0f, 0, -1, 0, -4 }, { &D_06003DBC, 1.0f, 0, -1, 0, -4 }, + { &object_dnq_Anim_008328, 1.0f, 0, -1, 0, 0 }, { &object_dnq_Anim_008328, 1.0f, 0, -1, 0, -4 }, + { &object_dnq_Anim_007528, 1.0f, 0, -1, 2, -4 }, { &object_dnq_Anim_0006F0, 1.0f, 0, -1, 2, 0 }, + { &object_dnq_Anim_000BF8, 1.0f, 0, -1, 0, -4 }, { &object_dnq_Anim_002690, 0.0f, 0, -1, 2, 0 }, + { &object_dnq_Anim_002690, 1.0f, 0, -1, 2, -4 }, { &object_dnq_Anim_003408, 1.0f, 0, -1, 0, -4 }, + { &object_dnq_Anim_006984, 1.0f, 0, -1, 2, -4 }, { &object_dnq_Anim_005E18, 1.0f, 0, -1, 2, -4 }, + { &object_dnq_Anim_005A14, 1.0f, 0, -1, 2, -4 }, { &object_dnq_Anim_005284, 1.0f, 0, -1, 2, -4 }, + { &object_dnq_Anim_001AEC, 1.0f, 0, -1, 2, 0 }, { &object_dnq_Anim_001100, 1.0f, 0, -1, 2, 0 }, + { &object_dnq_Anim_004EA0, 1.0f, 0, -1, 0, -4 }, { &object_dnq_Anim_00F504, 1.0f, 0, -1, 0, -4 }, + { &object_dnq_Anim_0047B8, 1.0f, 0, -1, 0, -4 }, { &object_dnq_Anim_003DBC, 1.0f, 0, -1, 2, -4 }, + { &object_dnq_Anim_005A14, 1.0f, 0, -1, 0, -4 }, { &object_dnq_Anim_003DBC, 1.0f, 0, -1, 0, -4 }, }; void func_80A52530(GlobalContext* globalCtx, EnDnq* this) { @@ -420,7 +406,8 @@ void EnDnq_Init(Actor* thisx, GlobalContext* globalCtx) { EnDnq* this = THIS; ActorShape_Init(&this->actor.shape, 0.0f, NULL, 14.0f); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600EB48, NULL, this->jointTable, this->morphTable, 33); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_dnq_Skel_00EB48, NULL, this->jointTable, this->morphTable, + 33); this->unk_398 = -1; func_80A5257C(this, 0); Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); diff --git a/src/overlays/actors/ovl_En_Dns/z_en_dns.c b/src/overlays/actors/ovl_En_Dns/z_en_dns.c index fe2402590..213a402af 100644 --- a/src/overlays/actors/ovl_En_Dns/z_en_dns.c +++ b/src/overlays/actors/ovl_En_Dns/z_en_dns.c @@ -5,6 +5,7 @@ */ #include "z_en_dns.h" +#include "objects/object_dns/object_dns.h" #define FLAGS 0x00000019 @@ -19,20 +20,6 @@ void func_8092D330(EnDns* this, GlobalContext* globalCtx); void EnDns_DoNothing(EnDns* this, GlobalContext* globalCtx); void func_8092D4D8(EnDns* this, GlobalContext* globalCtx); -extern AnimationHeader D_060002A8; -extern AnimationHeader D_06000734; -extern AnimationHeader D_060008F4; -extern AnimationHeader D_06000BD8; -extern AnimationHeader D_06000D58; -extern AnimationHeader D_06000FEC; -extern TexturePtr D_060028E8; -extern TexturePtr D_06002968; -extern TexturePtr D_060029E8; -extern Gfx D_06002C48[]; -extern SkeletonHeader D_06002DD8; -extern AnimationHeader D_06003310; -extern AnimationHeader D_060034EC; - static s32 D_8092DCB0[] = { 0x00172000, 0x050E082F, 0x0C100E08, 0x200C1000, 0x00172000, 0x050E0830, 0x0C100E08, 0x210C1000, 0x00172000, 0x050E0831, 0x0C100E08, 0x220C1000, 0x00172000, 0x050E0832, 0x0C100E08, 0x230C1000, @@ -74,10 +61,11 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit2 sColChkInfoInit = { 1, 0, 0, 0, MASS_IMMOVABLE }; static ActorAnimationEntryS sAnimations[] = { - { &D_06003310, 1.0f, 0, -1, 0, 0 }, { &D_06003310, 1.0f, 0, -1, 0, -4 }, { &D_060034EC, 1.0f, 0, -1, 0, 0 }, - { &D_060034EC, 1.0f, 0, -1, 0, -4 }, { &D_060008F4, 1.0f, 0, -1, 2, 0 }, { &D_06000BD8, 1.0f, 0, -1, 0, 0 }, - { &D_06000D58, 1.0f, 0, -1, 2, 0 }, { &D_06000FEC, 1.0f, 0, -1, 0, 0 }, { &D_060002A8, 1.0f, 0, -1, 2, 0 }, - { &D_06000734, 1.0f, 0, -1, 2, 0 }, + { &object_dns_Anim_003310, 1.0f, 0, -1, 0, 0 }, { &object_dns_Anim_003310, 1.0f, 0, -1, 0, -4 }, + { &object_dns_Anim_0034EC, 1.0f, 0, -1, 0, 0 }, { &object_dns_Anim_0034EC, 1.0f, 0, -1, 0, -4 }, + { &object_dns_Anim_0008F4, 1.0f, 0, -1, 2, 0 }, { &object_dns_Anim_000BD8, 1.0f, 0, -1, 0, 0 }, + { &object_dns_Anim_000D58, 1.0f, 0, -1, 2, 0 }, { &object_dns_Anim_000FEC, 1.0f, 0, -1, 0, 0 }, + { &object_dns_Anim_0002A8, 1.0f, 0, -1, 2, 0 }, { &object_dns_Anim_000734, 1.0f, 0, -1, 2, 0 }, }; void func_8092C5C0(EnDns* this) { @@ -376,7 +364,7 @@ void func_8092D108(EnDns* this, GlobalContext* globalCtx) { Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, D_06002C48); + gSPDisplayList(POLY_OPA_DISP++, object_dns_DL_002C48); CLOSE_DISPS(globalCtx->state.gfxCtx); } @@ -496,7 +484,7 @@ void EnDns_Init(Actor* thisx, GlobalContext* globalCtx) { } ActorShape_Init(&this->actor.shape, 0.0f, NULL, 18.0f); - SkelAnime_Init(globalCtx, &this->skelAnime, &D_06002DD8, NULL, this->jointTable, this->morphTable, 13); + SkelAnime_Init(globalCtx, &this->skelAnime, &object_dns_Skel_002DD8, NULL, this->jointTable, this->morphTable, 13); this->unk_2F8 = -1; func_8092C63C(this, 2); Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); @@ -617,7 +605,8 @@ void EnDns_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve } void EnDns_Draw(Actor* thisx, GlobalContext* globalCtx) { - static TexturePtr D_8092DE1C[] = { &D_060028E8, &D_06002968, &D_060029E8, &D_06002968 }; + static TexturePtr D_8092DE1C[] = { object_dns_Tex_0028E8, object_dns_Tex_002968, object_dns_Tex_0029E8, + object_dns_Tex_002968 }; EnDns* this = THIS; OPEN_DISPS(globalCtx->state.gfxCtx); diff --git a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c index bf7955ec7..6b198106b 100644 --- a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c +++ b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c @@ -7,6 +7,7 @@ #include "z_en_dodongo.h" #include "overlays/actors/ovl_En_Bom/z_en_bom.h" #include "overlays/actors/ovl_En_Bombf/z_en_bombf.h" +#include "objects/object_dodongo/object_dodongo.h" #define FLAGS 0x00000405 @@ -34,16 +35,6 @@ void func_808786C8(EnDodongo* this, GlobalContext* globalCtx); void func_80878724(EnDodongo* this); void func_808787B0(EnDodongo* this, GlobalContext* globalCtx); -extern AnimationHeader D_060013C4; -extern AnimationHeader D_06001A44; -extern AnimationHeader D_060028F0; -extern AnimationHeader D_06003088; -extern AnimationHeader D_06003B14; -extern AnimationHeader D_060042C4; -extern AnimationHeader D_06004C20; -extern SkeletonHeader D_06008318; -extern AnimationHeader D_06008B1C; - const ActorInit En_Dodongo_InitVars = { ACTOR_EN_DODONGO, ACTORCAT_ENEMY, @@ -304,7 +295,8 @@ void EnDodongo_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_330.a = 200; Math_Vec3f_Copy(&this->unk_314, &D_801C5DB0); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 48.0f); - SkelAnime_Init(globalCtx, &this->skelAnime, &D_06008318, &D_06004C20, this->jointTable, this->morphTable, 31); + SkelAnime_Init(globalCtx, &this->skelAnime, &object_dodongo_Skel_008318, &object_dodongo_Anim_004C20, + this->jointTable, this->morphTable, 31); CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); Collider_InitAndSetJntSph(globalCtx, &this->collider2, &this->actor, &sJntSphInit2, this->collider2Elements); Collider_InitAndSetJntSph(globalCtx, &this->collider1, &this->actor, &sJntSphInit1, this->collider1Elements); @@ -545,7 +537,7 @@ s32 func_80877278(EnDodongo* this, GlobalContext* globalCtx) { } void func_808773C4(EnDodongo* this) { - Animation_MorphToLoop(&this->skelAnime, &D_06004C20, -4.0f); + Animation_MorphToLoop(&this->skelAnime, &object_dodongo_Anim_004C20, -4.0f); this->actor.speedXZ = 0.0f; this->timer = Rand_S16Offset(30, 50); this->actionFunc = func_80877424; @@ -565,7 +557,7 @@ void func_80877424(EnDodongo* this, GlobalContext* globalCtx) { } void func_80877494(EnDodongo* this) { - Animation_MorphToLoop(&this->skelAnime, &D_06008B1C, -4.0f); + Animation_MorphToLoop(&this->skelAnime, &object_dodongo_Anim_008B1C, -4.0f); this->actor.speedXZ = this->unk_334 * 1.5f; this->timer = Rand_S16Offset(50, 70); this->actionFunc = func_80877500; @@ -624,7 +616,7 @@ void func_808777A8(EnDodongo* this) { s32 i; Sphere16* sph; - Animation_MorphToPlayOnce(&this->skelAnime, &D_060028F0, -4.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &object_dodongo_Anim_0028F0, -4.0f); this->actor.speedXZ = 0.0f; for (i = 0; i < ARRAY_COUNT(this->collider3Elements); i++) { @@ -689,7 +681,7 @@ void func_8087784C(EnDodongo* this, GlobalContext* globalCtx) { } void func_80877D50(EnDodongo* this) { - Animation_PlayOnce(&this->skelAnime, &D_06003088); + Animation_PlayOnce(&this->skelAnime, &object_dodongo_Anim_003088); this->actionFunc = func_80877D90; } @@ -701,7 +693,7 @@ void func_80877D90(EnDodongo* this, GlobalContext* globalCtx) { } void func_80877DE0(EnDodongo* this) { - Animation_Change(&this->skelAnime, &D_060028F0, -1.0f, 35.0f, 0.0f, 2, -4.0f); + Animation_Change(&this->skelAnime, &object_dodongo_Anim_0028F0, -1.0f, 35.0f, 0.0f, 2, -4.0f); this->actor.flags |= 0x10; this->timer = 25; this->actionFunc = func_80877E60; @@ -813,10 +805,10 @@ void func_80878354(EnDodongo* this) { this->unk_306 = (0xFFFF - ABS_ALT(yDiff)) / 15; if (yDiff >= 0) { - sp18 = &D_060042C4; + sp18 = &object_dodongo_Anim_0042C4; this->unk_306 = -this->unk_306; } else { - sp18 = &D_06003B14; + sp18 = &object_dodongo_Anim_003B14; } Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DODO_J_TAIL); @@ -879,7 +871,7 @@ void func_808785B0(EnDodongo* this, GlobalContext* globalCtx) { } void func_8087864C(EnDodongo* this) { - Animation_MorphToPlayOnce(&this->skelAnime, &D_06001A44, -4.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &object_dodongo_Anim_001A44, -4.0f); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DODO_J_DAMAGE); this->timer = 0; this->unk_304 = 0; @@ -899,7 +891,7 @@ void func_808786C8(EnDodongo* this, GlobalContext* globalCtx) { } void func_80878724(EnDodongo* this) { - Animation_MorphToPlayOnce(&this->skelAnime, &D_060013C4, -8.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &object_dodongo_Anim_0013C4, -8.0f); this->timer = 0; this->unk_304 = 0; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DODO_J_DEAD); @@ -1025,8 +1017,8 @@ void EnDodongo_UpdateDamage(EnDodongo* this, GlobalContext* globalCtx) { } void EnDodongo_Update(Actor* thisx, GlobalContext* globalCtx2) { - EnDodongo* this = THIS; GlobalContext* globalCtx = globalCtx2; + EnDodongo* this = THIS; EnDodongo_UpdateDamage(this, globalCtx); this->actionFunc(this, globalCtx); diff --git a/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c b/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c index 564b52fcb..69eb19f58 100644 --- a/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c +++ b/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c @@ -5,6 +5,7 @@ */ #include "z_en_dy_extra.h" +#include "objects/object_dy_obj/object_dy_obj.h" #define FLAGS 0x00000030 @@ -30,9 +31,6 @@ const ActorInit En_Dy_Extra_InitVars = { (ActorFunc)EnDyExtra_Draw, }; -extern Vtx D_0600DD40[]; -extern Gfx D_0600DEF0[]; - void EnDyExtra_Destroy(Actor* thisx, GlobalContext* globalCtx) { } @@ -88,11 +86,10 @@ void EnDyExtra_Update(Actor* thisx, GlobalContext* globalCtx) { } void EnDyExtra_Draw(Actor* thisx, GlobalContext* globalCtx) { - static Color_RGBA8 D_80A61740[] = { { 255, 255, 170, 255 }, - { 255, 170, 255, 255 }, - { 255, 255, 170, 255 }, - { 170, 255, 255, 255 }, - { 255, 255, 170, 255 } }; + static Color_RGBA8 D_80A61740[] = { + { 255, 255, 170, 255 }, { 255, 170, 255, 255 }, { 255, 255, 170, 255 }, + { 170, 255, 255, 255 }, { 255, 255, 170, 255 }, + }; static Color_RGBA8 D_80A61754[] = { { 255, 100, 0, 255 }, { 255, 0, 100, 255 }, { 100, 255, 0, 255 }, { 0, 100, 255, 255 }, { 255, 230, 0, 255 } }; @@ -101,7 +98,7 @@ void EnDyExtra_Draw(Actor* thisx, GlobalContext* globalCtx) { EnDyExtra* this = THIS; s32 pad; GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; - Vtx* vertices = Lib_SegmentedToVirtual(D_0600DD40); + Vtx* vertices = Lib_SegmentedToVirtual(object_dy_obj_Vtx_00DD40); s32 i; u8 unk[3]; @@ -126,7 +123,7 @@ void EnDyExtra_Draw(Actor* thisx, GlobalContext* globalCtx) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, D_80A61740[this->type].r, D_80A61740[this->type].g, D_80A61740[this->type].b, 255); gDPSetEnvColor(POLY_XLU_DISP++, D_80A61754[this->type].r, D_80A61754[this->type].g, D_80A61754[this->type].b, 128); - gSPDisplayList(POLY_XLU_DISP++, D_0600DEF0); + gSPDisplayList(POLY_XLU_DISP++, object_dy_obj_DL_00DEF0); CLOSE_DISPS(gfxCtx); } diff --git a/src/overlays/actors/ovl_En_Elf/z_en_elf.c b/src/overlays/actors/ovl_En_Elf/z_en_elf.c index c666ba32b..472ece34b 100644 --- a/src/overlays/actors/ovl_En_Elf/z_en_elf.c +++ b/src/overlays/actors/ovl_En_Elf/z_en_elf.c @@ -5,6 +5,7 @@ */ #include "z_en_elf.h" +#include "objects/gameplay_keep/gameplay_keep.h" #define FLAGS 0x02000030 @@ -32,8 +33,6 @@ void func_8088F5F4(EnElf* this, GlobalContext* globalCtx, s32 arg2); void func_8089010C(Actor* thisx, GlobalContext* globalCtx); void func_808908D0(Vec3f* arg0, GlobalContext* globalCtx, u32 arg2); -extern SkeletonHeader D_0402AF58; - const ActorInit En_Elf_InitVars = { ACTOR_EN_ELF, ACTORCAT_ITEMACTION, @@ -322,7 +321,8 @@ void EnElf_Init(Actor* thisx, GlobalContext* globalCtx2) { s32 params; Actor_ProcessInitChain(thisx, sInitChain); - SkelAnime_Init(globalCtx, &this->skelAnime, &D_0402AF58, &D_04029140, this->jointTable, this->morphTable, 7); + SkelAnime_Init(globalCtx, &this->skelAnime, &gameplay_keep_Skel_02AF58.sh, &gameplay_keep_Anim_029140, + this->jointTable, this->morphTable, 7); ActorShape_Init(&thisx->shape, 0.0f, NULL, 15.0f); thisx->shape.shadowAlpha = 255; diff --git a/src/overlays/actors/ovl_En_Elfbub/z_en_elfbub.c b/src/overlays/actors/ovl_En_Elfbub/z_en_elfbub.c index e0eed3f3c..264efc2b2 100644 --- a/src/overlays/actors/ovl_En_Elfbub/z_en_elfbub.c +++ b/src/overlays/actors/ovl_En_Elfbub/z_en_elfbub.c @@ -6,6 +6,7 @@ #include "z_en_elfbub.h" #include "overlays/actors/ovl_En_Elforg/z_en_elforg.h" +#include "objects/object_bubble/object_bubble.h" #define FLAGS 0x00000001 @@ -51,8 +52,6 @@ static ColliderCylinderInit sCylinderInit = { { 16, 32, 0, { 0, 0, 0 } }, }; -extern Gfx D_06001000[]; - void EnElfbub_Init(Actor* thisx, GlobalContext* globalCtx) { EnElfbub* this = THIS; Actor* childActor; @@ -162,7 +161,7 @@ void EnElfbub_Draw(Actor* thisx, GlobalContext* globalCtx2) { Matrix_InsertZRotation_s(this->zRot * -1, MTXMODE_APPLY); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_XLU_DISP++, D_06001000); + gSPDisplayList(POLY_XLU_DISP++, object_bubble_DL_001000); CLOSE_DISPS(globalCtx->state.gfxCtx); } diff --git a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c index 58bf7e1fe..07187d90d 100644 --- a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c +++ b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c @@ -5,6 +5,8 @@ */ #include "z_en_encount2.h" +#include "objects/object_fusen/object_fusen.h" +#include "objects/gameplay_keep/gameplay_keep.h" #define FLAGS 0x00000010 @@ -97,17 +99,13 @@ static DamageTable sDamageTable = { /* Powder Keg */ DMG_ENTRY(0, 0xF), }; -extern Gfx D_06000A00[]; -extern Gfx D_06000D78[]; -extern CollisionHeader D_06002420; - void EnEncount2_Init(Actor* thisx, GlobalContext* globalCtx) { EnEncount2* this = THIS; s32 pad; CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, 0); - CollisionHeader_GetVirtual(&D_06002420, &colHeader); + CollisionHeader_GetVirtual(&object_fusen_Colheader_002420, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader); ActorShape_Init(&this->dyna.actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f); this->dyna.actor.colChkInfo.mass = MASS_IMMOVABLE; @@ -209,8 +207,8 @@ void EnEncount2_Update(Actor* thisx, GlobalContext* globalCtx) { void EnEncount2_Draw(Actor* thisx, GlobalContext* globalCtx) { EnEncount2* this = THIS; if (this->isPopped != true) { - Gfx_DrawDListOpa(globalCtx, D_06000A00); - Gfx_DrawDListOpa(globalCtx, D_06000D78); + Gfx_DrawDListOpa(globalCtx, object_fusen_DL_000A00); + Gfx_DrawDListOpa(globalCtx, object_fusen_DL_000D78); } EnEncount2_DrawParticles(this, globalCtx); } @@ -279,8 +277,8 @@ void EnEncount2_DrawParticles(EnEncount2* this, GlobalContext* globalCtx) { Matrix_InsertTranslation(sPtr->pos.x, sPtr->pos.y, sPtr->pos.z, MTXMODE_NEW); Matrix_Scale(sPtr->scale, sPtr->scale, sPtr->scale, MTXMODE_APPLY); POLY_XLU_DISP = Gfx_CallSetupDL(POLY_XLU_DISP, 20); - gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(&D_04079B10)); - gSPDisplayList(POLY_XLU_DISP++, D_0407AB10); + gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(gameplay_keep_Tex_079B10)); + gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_07AB10); gDPPipeSync(POLY_XLU_DISP++); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, 255); gDPSetEnvColor(POLY_XLU_DISP++, 250, 180, 255, sPtr->alpha); @@ -288,7 +286,7 @@ void EnEncount2_DrawParticles(EnEncount2* this, GlobalContext* globalCtx) { Matrix_InsertZRotation_f(DEGTORAD(globalCtx->state.frames * 20.0f), MTXMODE_APPLY); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_XLU_DISP++, D_0407AB58); + gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_07AB58); } } CLOSE_DISPS(gfxCtx); diff --git a/src/overlays/actors/ovl_En_Ending_Hero/z_en_ending_hero.c b/src/overlays/actors/ovl_En_Ending_Hero/z_en_ending_hero.c index 93d4ce1bd..34fa659a8 100644 --- a/src/overlays/actors/ovl_En_Ending_Hero/z_en_ending_hero.c +++ b/src/overlays/actors/ovl_En_Ending_Hero/z_en_ending_hero.c @@ -5,6 +5,7 @@ */ #include "z_en_ending_hero.h" +#include "objects/object_dt/object_dt.h" #define FLAGS 0x00000009 @@ -30,17 +31,6 @@ const ActorInit En_Ending_Hero_InitVars = { (ActorFunc)EnEndingHero_Draw, }; -extern FlexSkeletonHeader D_0600B0CC; -extern AnimationHeader D_06000BE0; -extern UNK_PTR D_06007350[]; -extern UNK_PTR D_06009590[]; -extern UNK_PTR D_06009F90[]; -extern UNK_PTR D_0600A790[]; -extern UNK_PTR D_0600AB90[]; -extern UNK_PTR D_06007750[]; -extern UNK_PTR D_0600A390[]; -extern UNK_PTR D_0600A490[]; - void EnEndingHero_Init(Actor* thisx, GlobalContext* globalCtx) { EnEndingHero* this = THIS; @@ -48,7 +38,8 @@ void EnEndingHero_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, 0.01f); this->actor.targetMode = 6; this->actor.gravity = -3.0f; - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600B0CC, &D_06000BE0, this->jointTable, this->morphTable, 15); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_dt_Skel_00B0CC, &object_dt_Anim_000BE0, this->jointTable, + this->morphTable, 15); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f); func_80C1E748(this); } @@ -80,8 +71,14 @@ void EnEndingHero_Update(Actor* thisx, GlobalContext* globalCtx) { Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 50.0f, 0x1D); } -static UNK_PTR D_80C1E970[] = { D_06007350, D_06009590, D_06009F90, D_0600A790, D_0600AB90 }; -static UNK_PTR D_80C1E984[] = { D_06007750, D_0600A390, D_0600A490 }; +static TexturePtr D_80C1E970[] = { + object_dt_Tex_007350, object_dt_Tex_009590, object_dt_Tex_009F90, object_dt_Tex_00A790, object_dt_Tex_00AB90, +}; +static TexturePtr D_80C1E984[] = { + object_dt_Tex_007750, + object_dt_Tex_00A390, + object_dt_Tex_00A490, +}; void EnEndingHero_Draw(Actor* thisx, GlobalContext* globalCtx) { EnEndingHero* this = THIS; diff --git a/src/overlays/actors/ovl_En_Ending_Hero2/z_en_ending_hero2.c b/src/overlays/actors/ovl_En_Ending_Hero2/z_en_ending_hero2.c index 09c1a950f..ddb5535a7 100644 --- a/src/overlays/actors/ovl_En_Ending_Hero2/z_en_ending_hero2.c +++ b/src/overlays/actors/ovl_En_Ending_Hero2/z_en_ending_hero2.c @@ -5,6 +5,7 @@ */ #include "z_en_ending_hero2.h" +#include "objects/object_bai/object_bai.h" #define FLAGS 0x00000009 @@ -30,9 +31,6 @@ const ActorInit En_Ending_Hero2_InitVars = { (ActorFunc)EnEndingHero2_Draw, }; -extern FlexSkeletonHeader D_06007908; -extern AnimationHeader D_060011C0; - void EnEndingHero2_Init(Actor* thisx, GlobalContext* globalCtx) { EnEndingHero2* this = THIS; @@ -40,7 +38,8 @@ void EnEndingHero2_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, 0.01f); this->actor.targetMode = 6; this->actor.gravity = -3.0f; - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06007908, &D_060011C0, this->jointTable, this->morphTable, 20); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_bai_Skel_007908, &object_bai_Anim_0011C0, this->jointTable, + this->morphTable, 20); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f); func_80C232E8(this); } diff --git a/src/overlays/actors/ovl_En_Ending_Hero3/z_en_ending_hero3.c b/src/overlays/actors/ovl_En_Ending_Hero3/z_en_ending_hero3.c index c314b7b62..9cb297c5c 100644 --- a/src/overlays/actors/ovl_En_Ending_Hero3/z_en_ending_hero3.c +++ b/src/overlays/actors/ovl_En_Ending_Hero3/z_en_ending_hero3.c @@ -5,6 +5,7 @@ */ #include "z_en_ending_hero3.h" +#include "objects/object_toryo/object_toryo.h" #define FLAGS 0x00000009 @@ -30,9 +31,6 @@ const ActorInit En_Ending_Hero3_InitVars = { (ActorFunc)EnEndingHero3_Draw, }; -extern FlexSkeletonHeader D_06007150; -extern AnimationHeader D_06000E50; - void EnEndingHero3_Init(Actor* thisx, GlobalContext* globalCtx) { EnEndingHero3* this = THIS; @@ -40,7 +38,8 @@ void EnEndingHero3_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, 0.01f); this->actor.targetMode = 6; this->actor.gravity = -3.0f; - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06007150, &D_06000E50, this->jointTable, this->morphTable, 17); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_toryo_Skel_007150, &object_toryo_Anim_000E50, + this->jointTable, this->morphTable, 17); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f); func_80C23518(this); } diff --git a/src/overlays/actors/ovl_En_Ending_Hero4/z_en_ending_hero4.c b/src/overlays/actors/ovl_En_Ending_Hero4/z_en_ending_hero4.c index 1b8e7e7a1..59e1fd836 100644 --- a/src/overlays/actors/ovl_En_Ending_Hero4/z_en_ending_hero4.c +++ b/src/overlays/actors/ovl_En_Ending_Hero4/z_en_ending_hero4.c @@ -5,6 +5,7 @@ */ #include "z_en_ending_hero4.h" +#include "objects/object_sdn/object_sdn.h" #define FLAGS 0x00000009 @@ -30,9 +31,6 @@ const ActorInit En_Ending_Hero4_InitVars = { (ActorFunc)EnEndingHero4_Draw, }; -extern FlexSkeletonHeader D_0600D640; -extern AnimationHeader D_06002A84; - void EnEndingHero4_Init(Actor* thisx, GlobalContext* globalCtx) { EnEndingHero4* this = THIS; @@ -40,7 +38,8 @@ void EnEndingHero4_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, 0.01f); this->actor.targetMode = 6; this->actor.gravity = -3.0f; - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600D640, &D_06002A84, this->jointTable, this->morphTable, 17); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_sdn_Skel_00D640, &object_sdn_Anim_002A84, this->jointTable, + this->morphTable, 17); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f); func_80C23748(this); } diff --git a/src/overlays/actors/ovl_En_Ending_Hero5/z_en_ending_hero5.c b/src/overlays/actors/ovl_En_Ending_Hero5/z_en_ending_hero5.c index 8daf7616e..ba77613bd 100644 --- a/src/overlays/actors/ovl_En_Ending_Hero5/z_en_ending_hero5.c +++ b/src/overlays/actors/ovl_En_Ending_Hero5/z_en_ending_hero5.c @@ -5,6 +5,7 @@ */ #include "z_en_ending_hero5.h" +#include "objects/object_daiku/object_daiku.h" #define FLAGS 0x00000009 @@ -30,15 +31,6 @@ const ActorInit En_Ending_Hero5_InitVars = { (ActorFunc)EnEndingHero5_Draw, }; -extern FlexSkeletonHeader D_0600A850; -extern AnimationHeader D_06002FA0; - -extern Gfx D_060070C0[]; -extern Gfx D_06006FB0[]; -extern Gfx D_06006E80[]; -extern Gfx D_06006D70[]; -extern Gfx D_0600A390[]; - void EnEndingHero5_Init(Actor* thisx, GlobalContext* globalCtx) { EnEndingHero5* this = THIS; @@ -46,7 +38,8 @@ void EnEndingHero5_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, 0.01f); this->actor.targetMode = 6; this->actor.gravity = -3.0f; - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600A850, &D_06002FA0, this->jointTable, this->morphTable, 17); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_daiku_Skel_00A850, &object_daiku_Anim_002FA0, + this->jointTable, this->morphTable, 17); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f); this->unk25C = this->actor.params; func_80C23980(this); @@ -72,7 +65,8 @@ void EnEndingHero5_Update(Actor* thisx, GlobalContext* globalCtx) { Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 50.0f, 0x1D); } -Gfx* D_80C23BF0[] = { D_060070C0, D_06006FB0, D_06006E80, D_06006D70, D_0600A390 }; +Gfx* D_80C23BF0[] = { object_daiku_DL_0070C0, object_daiku_DL_006FB0, object_daiku_DL_006E80, object_daiku_DL_006D70, + object_daiku_DL_00A390 }; void EnEndingHero5_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { EnEndingHero5* this = THIS; diff --git a/src/overlays/actors/ovl_En_Ending_Hero6/z_en_ending_hero6.c b/src/overlays/actors/ovl_En_Ending_Hero6/z_en_ending_hero6.c index 7af087433..1b296098f 100644 --- a/src/overlays/actors/ovl_En_Ending_Hero6/z_en_ending_hero6.c +++ b/src/overlays/actors/ovl_En_Ending_Hero6/z_en_ending_hero6.c @@ -5,6 +5,11 @@ */ #include "z_en_ending_hero6.h" +#include "objects/object_dt/object_dt.h" +#include "objects/object_daiku/object_daiku.h" +#include "objects/object_bai/object_bai.h" +#include "objects/object_toryo/object_toryo.h" +#include "objects/object_sdn/object_sdn.h" #define FLAGS 0x00000009 @@ -19,36 +24,6 @@ void EnEndingHero6_InitSkelAnime(EnEndingHero6* this, s32 npcIndex); void EnEndingHero6_SetupIdle(EnEndingHero6* this); void EnEndingHero6_Idle(EnEndingHero6* this, GlobalContext* globalCtx); -extern FlexSkeletonHeader D_0600B0CC; // object_dt -extern FlexSkeletonHeader D_06007908; // object_bai -extern FlexSkeletonHeader D_06007150; // object_toryo -extern FlexSkeletonHeader D_0600D640; // object_sdn -extern FlexSkeletonHeader D_0600A850; // object_daiku - -extern AnimationHeader D_06000BE0; // object_dt -extern AnimationHeader D_060011C0; // object_bai -extern AnimationHeader D_06000E50; // object_toryo -extern AnimationHeader D_06002A84; // object_sdn -extern AnimationHeader D_06002FA0; // object_daiku - -// object_daiku -extern Gfx D_060070C0[]; -extern Gfx D_06006FB0[]; -extern Gfx D_06006E80[]; -extern Gfx D_06006D70[]; -extern Gfx D_0600A390_dl[]; - -// object_dt -extern TexturePtr D_06007350; -extern TexturePtr D_06009590; -extern TexturePtr D_06009F90; -extern TexturePtr D_0600A790; -extern TexturePtr D_0600AB90; - -extern TexturePtr D_06007750; -extern TexturePtr D_0600A390_tex; -extern TexturePtr D_0600A490; - const ActorInit En_Ending_Hero6_InitVars = { ACTOR_EN_ENDING_HERO6, ACTORCAT_NPC, @@ -61,11 +36,17 @@ const ActorInit En_Ending_Hero6_InitVars = { (ActorFunc)EnEndingHero6_Draw, }; -static FlexSkeletonHeader* sSkeletons[] = { &D_0600B0CC, &D_06007908, &D_06007150, &D_0600D640, &D_0600A850, - &D_0600A850, &D_0600A850, &D_0600A850, &D_0600A850 }; +static FlexSkeletonHeader* sSkeletons[] = { + &object_dt_Skel_00B0CC, &object_bai_Skel_007908, &object_toryo_Skel_007150, + &object_sdn_Skel_00D640, &object_daiku_Skel_00A850, &object_daiku_Skel_00A850, + &object_daiku_Skel_00A850, &object_daiku_Skel_00A850, &object_daiku_Skel_00A850, +}; -static AnimationHeader* sAnimations[] = { &D_06000BE0, &D_060011C0, &D_06000E50, &D_06002A84, &D_06002FA0, - &D_06002FA0, &D_06002FA0, &D_06002FA0, &D_06002FA0 }; +static AnimationHeader* sAnimations[] = { + &object_dt_Anim_000BE0, &object_bai_Anim_0011C0, &object_toryo_Anim_000E50, + &object_sdn_Anim_002A84, &object_daiku_Anim_002FA0, &object_daiku_Anim_002FA0, + &object_daiku_Anim_002FA0, &object_daiku_Anim_002FA0, &object_daiku_Anim_002FA0, +}; static s32 sLimbCounts[] = { 15, 20, 17, 17, 17, 17, 17, 17, 17 }; @@ -124,7 +105,8 @@ void EnEndingHero6_Update(Actor* thisx, GlobalContext* globalCtx) { } void EnEndingHero6_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { - static Gfx* D_80C2426C[] = { D_060070C0, D_06006FB0, D_06006E80, D_06006D70, D_0600A390_dl }; + static Gfx* D_80C2426C[] = { object_daiku_DL_0070C0, object_daiku_DL_006FB0, object_daiku_DL_006E80, + object_daiku_DL_006D70, object_daiku_DL_00A390 }; EnEndingHero6* this = THIS; s32 index; @@ -139,8 +121,9 @@ void EnEndingHero6_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** d } void EnEndingHero6_Draw(Actor* thisx, GlobalContext* globalCtx) { - static TexturePtr D_80C24280[] = { &D_06007350, &D_06009590, &D_06009F90, &D_0600A790, &D_0600AB90 }; - static TexturePtr D_80C24294[] = { &D_06007750, &D_0600A390_tex, &D_0600A490 }; + static TexturePtr D_80C24280[] = { object_dt_Tex_007350, object_dt_Tex_009590, object_dt_Tex_009F90, + object_dt_Tex_00A790, object_dt_Tex_00AB90 }; + static TexturePtr D_80C24294[] = { object_dt_Tex_007750, object_dt_Tex_00A390, object_dt_Tex_00A490 }; s32 pad; EnEndingHero6* this = THIS; s32 index = 0; diff --git a/src/overlays/actors/ovl_En_Fall/z_en_fall.c b/src/overlays/actors/ovl_En_Fall/z_en_fall.c index e12f94841..13e4ab023 100644 --- a/src/overlays/actors/ovl_En_Fall/z_en_fall.c +++ b/src/overlays/actors/ovl_En_Fall/z_en_fall.c @@ -4,14 +4,15 @@ * Description: The moon and related effects, along with the Moon's Tear that falls from its eye. * * This actor handles mutliple types of moon as well as a variety of effects. Specifically, it handles: - * - A high-detail moon, used in Termina Field, the Clock Tower, and a few cutscenes - * - A high-detail open-mouthed moon, used in the cutscene prior to warping to the moon's interior. - * - An enlarged high-detail moon, used for when the moon is crashing. - * - A low-detail moon, used everywhere else. Its object file is named "Lodmoon". - * - The Moon's Tear that can be seen falling from the telescope, along with its associated fire trail. - * - The ball of fire that surrounds the moon when it is crashing. - * - The debris that rises from the ground as the moon is crashing. - * - The ring of fire that expands outward when the moon is almost done crashing. + * - Moon: A high-detail moon, used in Termina Field, the Clock Tower, and a few cutscenes. + * - StoppedClosedMouthMoon: A high-detail moon, used in the Clock Tower after the Giants stop the moon from crashing. + * - StoppedOpenMouthMoon: A high-detail open-mouthed moon, used in the cutscene prior to warping to the moon. + * - CrashingMoon: An enlarged high-detail moon, used for when the moon is crashing. + * - LodMoon: A low-detail moon, used everywhere else. + * - MoonsTear: The Moon's Tear that can be seen falling from the telescope, along with its associated fire trail. + * - Fireball: The ball of fire that surrounds the moon when it is crashing. + * - RisingDebris: The debris that rises from the ground as the moon is crashing. + * - FireRing: The ring of fire that expands outward when the moon is almost done crashing. */ #include "z_en_fall.h" @@ -24,6 +25,9 @@ #define THIS ((EnFall*)thisx) +#define FLAG_FIRE_BALL_INTENSIFIES (1 << 0) +#define FLAG_FIRE_RING_APPEARS (1 << 1) + void EnFall_Init(Actor* thisx, GlobalContext* globalCtx); void EnFall_Destroy(Actor* thisx, GlobalContext* globalCtx); void EnFall_Update(Actor* thisx, GlobalContext* globalCtx); @@ -35,20 +39,20 @@ void EnFall_StoppedClosedMouthMoon_PerformCutsceneActions(EnFall* this, GlobalCo void EnFall_ClockTowerOrTitleScreenMoon_PerformCutsceneActions(EnFall* this, GlobalContext* globalCtx); void EnFall_Moon_PerformDefaultActions(EnFall* this, GlobalContext* globalCtx); void EnFall_MoonsTear_Fall(EnFall* this, GlobalContext* globalCtx); -void EnFall_FireBall_Update(Actor* thisx, GlobalContext* globalCtx); +void EnFall_Fireball_Update(Actor* thisx, GlobalContext* globalCtx); void EnFall_RisingDebris_Update(Actor* thisx, GlobalContext* globalCtx); void EnFall_FireRing_Update(Actor* thisx, GlobalContext* globalCtx); void EnFall_Moon_Draw(Actor* thisx, GlobalContext* globalCtx); void EnFall_OpenMouthMoon_Draw(Actor* thisx, GlobalContext* globalCtx); void EnFall_LodMoon_DrawWithoutLerp(Actor* thisx, GlobalContext* globalCtx); void EnFall_LodMoon_DrawWithLerp(Actor* thisx, GlobalContext* globalCtx); -void EnFall_FireBall_Draw(Actor* thisx, GlobalContext* globalCtx); +void EnFall_Fireball_Draw(Actor* thisx, GlobalContext* globalCtx); void EnFall_RisingDebris_Draw(Actor* thisx, GlobalContext* globalCtx); void EnFall_FireRing_Draw(Actor* thisx, GlobalContext* globalCtx); void EnFall_MoonsTear_Draw(Actor* thisx, GlobalContext* globalCtx); typedef struct { - u8 dListIndex; + u8 modelIndex; Vec3f pos; Vec3f velocity; Vec3s rot; @@ -87,14 +91,17 @@ void EnFall_Moon_AdjustScaleAndPosition(EnFall* this, GlobalContext* globalCtx) Actor_SetScale(&this->actor, this->scale * 1.2f); this->actor.world.pos.y = this->actor.home.pos.y; break; + case 1: Actor_SetScale(&this->actor, this->scale * 2.4f); this->actor.world.pos.y = this->actor.home.pos.y; break; + case 2: Actor_SetScale(&this->actor, this->scale * 3.6f); this->actor.world.pos.y = this->actor.home.pos.y; break; + case 3: Actor_SetScale(&this->actor, this->scale * 3.6f); if (EN_FALL_TYPE(&this->actor) == EN_FALL_TYPE_LODMOON_INVERTED_STONE_TOWER) { @@ -112,7 +119,7 @@ void EnFall_RisingDebris_ResetParticles(EnFall* this) { s32 i; for (i = 0; i < ARRAY_COUNT(debrisParticles); i++) { - debrisParticles[i].dListIndex = 3; + debrisParticles[i].modelIndex = 3; } this->activeDebrisParticleCount = 0; } @@ -130,15 +137,19 @@ void EnFall_Init(Actor* thisx, GlobalContext* globalCtx) { case 1: this->scale = 0.08f; break; + case 2: this->scale = 0.04f; break; + case 3: this->scale = 0.02f; break; + case 4: this->scale = 0.01f; break; + default: this->scale = 0.16f; break; @@ -150,12 +161,15 @@ void EnFall_Init(Actor* thisx, GlobalContext* globalCtx) { case EN_FALL_TYPE_LODMOON_INVERTED_STONE_TOWER: objectIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_LODMOON); break; + case EN_FALL_TYPE_MOONS_TEAR: objectIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_MOONSTON); break; + case EN_FALL_TYPE_STOPPED_MOON_OPEN_MOUTH: objectIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_FALL2); break; + default: objectIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_FALL); break; @@ -199,6 +213,7 @@ void EnFall_Setup(EnFall* this, GlobalContext* globalCtx) { this->actionFunc = EnFall_ClockTowerOrTitleScreenMoon_PerformCutsceneActions; Actor_SetScale(&this->actor, this->scale); break; + case EN_FALL_TYPE_STOPPED_MOON_CLOSED_MOUTH: this->actor.draw = EnFall_Moon_Draw; this->actionFunc = EnFall_StoppedClosedMouthMoon_PerformCutsceneActions; @@ -207,6 +222,7 @@ void EnFall_Setup(EnFall* this, GlobalContext* globalCtx) { Actor_MarkForDeath(&this->actor); } break; + case EN_FALL_TYPE_CLOCK_TOWER_MOON: this->actionFunc = EnFall_ClockTowerOrTitleScreenMoon_PerformCutsceneActions; Actor_SetScale(&this->actor, this->scale * 3.0f); @@ -215,20 +231,23 @@ void EnFall_Setup(EnFall* this, GlobalContext* globalCtx) { Actor_MarkForDeath(&this->actor); } break; + case EN_FALL_TYPE_CRASHING_MOON: this->actor.draw = EnFall_Moon_Draw; Actor_SetScale(&this->actor, this->scale * 5.3999996f); this->actionFunc = EnFall_CrashingMoon_PerformCutsceneActions; break; + case EN_FALL_TYPE_CRASH_FIRE_BALL: - this->actor.update = EnFall_FireBall_Update; - this->actor.draw = EnFall_FireBall_Draw; + this->actor.update = EnFall_Fireball_Update; + this->actor.draw = EnFall_Fireball_Draw; this->scale = 1.0f; this->actor.shape.rot.z = 0; - this->fireBallIntensity = 0.0f; - this->fireBallAlpha = 100; + this->fireballIntensity = 0.0f; + this->fireballAlpha = 100; this->actor.shape.rot.x = this->actor.shape.rot.z; break; + case EN_FALL_TYPE_CRASH_RISING_DEBRIS: this->actor.update = EnFall_RisingDebris_Update; this->actor.draw = EnFall_RisingDebris_Draw; @@ -237,12 +256,14 @@ void EnFall_Setup(EnFall* this, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, 1.0f); this->actor.shape.rot.x = 0; break; + case EN_FALL_TYPE_LODMOON_NO_LERP: this->actor.draw = EnFall_LodMoon_DrawWithoutLerp; this->dayStartTime = CLOCK_TIME(6, 0); this->currentDay = CURRENT_DAY; EnFall_Moon_AdjustScaleAndPosition(this, globalCtx); break; + case EN_FALL_TYPE_LODMOON: case EN_FALL_TYPE_LODMOON_INVERTED_STONE_TOWER: this->actor.draw = EnFall_LodMoon_DrawWithLerp; @@ -250,6 +271,7 @@ void EnFall_Setup(EnFall* this, GlobalContext* globalCtx) { this->currentDay = CURRENT_DAY; EnFall_Moon_AdjustScaleAndPosition(this, globalCtx); break; + case EN_FALL_TYPE_MOONS_TEAR: this->actor.update = EnFall_Update; this->actor.draw = NULL; @@ -264,17 +286,21 @@ void EnFall_Setup(EnFall* this, GlobalContext* globalCtx) { Actor_MarkForDeath(&this->actor); } break; + case EN_FALL_TYPE_STOPPED_MOON_OPEN_MOUTH: this->actor.draw = NULL; this->actionFunc = EnFall_StoppedOpenMouthMoon_PerformCutsceneActions; Actor_SetScale(&this->actor, this->scale * 3.0f); break; + case EN_FALL_TYPE_CRASH_FIRE_RING: this->actor.update = EnFall_FireRing_Update; this->actor.draw = EnFall_FireRing_Draw; Actor_SetScale(&this->actor, 0.2f); break; + default: + // used for EN_FALL_TYPE_TERMINA_FIELD_MOON and anything else that isn't in the enum this->actor.draw = EnFall_Moon_Draw; this->dayStartTime = CLOCK_TIME(6, 0); this->currentDay = CURRENT_DAY; @@ -294,6 +320,7 @@ void EnFall_CrashingMoon_HandleGiantsCutscene(EnFall* this, GlobalContext* globa sGiantsCutsceneState += 2; } break; + case 2: if (CHECK_QUEST_ITEM(QUEST_REMAINS_ODOWLA) && CHECK_QUEST_ITEM(QUEST_REMAINS_GOHT) && CHECK_QUEST_ITEM(QUEST_REMAINS_GYORG) && CHECK_QUEST_ITEM(QUEST_REMAINS_TWINMOLD)) { @@ -320,6 +347,7 @@ void EnFall_CrashingMoon_HandleGiantsCutscene(EnFall* this, GlobalContext* globa sGiantsCutsceneState = 9; } break; + case 9: globalCtx->csCtx.frames--; break; @@ -351,11 +379,12 @@ void EnFall_StoppedOpenMouthMoon_PerformCutsceneActions(EnFall* this, GlobalCont if (this->eyeGlowIntensity == 0.0f) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_MOON_EYE_FLASH); } - this->eyeGlowIntensity += 0.033333335f; + this->eyeGlowIntensity += 1 / 30.0f; if (this->eyeGlowIntensity > 1.0f) { this->eyeGlowIntensity = 1.0f; } break; + case 4: this->actor.draw = EnFall_OpenMouthMoon_Draw; break; @@ -369,6 +398,7 @@ void EnFall_StoppedClosedMouthMoon_PerformCutsceneActions(EnFall* this, GlobalCo case 2: func_800EDF24(&this->actor, globalCtx, func_800EE200(globalCtx, 0x85)); break; + case 4: this->actor.draw = NULL; break; @@ -382,9 +412,11 @@ void EnFall_StoppedClosedMouthMoon_PerformCutsceneActions(EnFall* this, GlobalCo case 1060: Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_MOON_SCREAM1); break; + case 1089: Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_MOON_CRY); break; + case 1303: Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SLIP_MOON); break; @@ -393,14 +425,17 @@ void EnFall_StoppedClosedMouthMoon_PerformCutsceneActions(EnFall* this, GlobalCo func_800B9010(&this->actor, NA_SE_EV_FALL_POWER - SFX_FLAG); } break; + case 1: switch (globalCtx->csCtx.frames) { case 561: Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_MOON_SCREAM1); break; + case 590: Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_MOON_CRY); break; + case 737: Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SLIP_MOON); break; @@ -420,9 +455,7 @@ void EnFall_ClockTowerOrTitleScreenMoon_PerformCutsceneActions(EnFall* this, Glo } /** - * This is rarely used in the final game. One example of where it *is* used - * is when the moon is crashing; there is a second, smaller moon hidden within - * the larger moon that uses this action function. + * Used by the Moon in Termina Field, as well as all LodMoons. */ void EnFall_Moon_PerformDefaultActions(EnFall* this, GlobalContext* globalCtx) { u16 currentDay; @@ -467,7 +500,7 @@ void EnFall_MoonsTear_Initialize(EnFall* this) { this->actor.shape.rot.y = this->actor.world.rot.y; } -void EnFall_DoNothing(EnFall* this, GlobalContext* globalCtx) { +void EnFall_MoonsTear_DoNothing(EnFall* this, GlobalContext* globalCtx) { } void EnFall_MoonsTear_Fall(EnFall* this, GlobalContext* globalCtx) { @@ -488,7 +521,7 @@ void EnFall_MoonsTear_Fall(EnFall* this, GlobalContext* globalCtx) { Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, CLEAR_TAG_LARGE_EXPLOSION); this->actor.draw = NULL; - this->actionFunc = EnFall_DoNothing; + this->actionFunc = EnFall_MoonsTear_DoNothing; } else { func_800B9010(&this->actor, NA_SE_EV_MOONSTONE_FALL - SFX_FLAG); } @@ -504,7 +537,7 @@ void EnFall_Update(Actor* thisx, GlobalContext* globalCtx) { * Updates the alpha for every vertex in the fire ball so that some parts of * the sphere are more transparent or opaque than others. */ -void EnFall_FireBall_SetPerVertexAlpha(f32 fireBallAlpha) { +void EnFall_Fireball_SetPerVertexAlpha(f32 fireballAlpha) { static u8 sAlphaTableIndex[] = { 4, 4, 0, 1, 1, 1, 1, 1, 1, 3, 3, 0, 0, 3, 0, 1, 1, 1, 4, 0, 4, 0, 1, 1, 1, 3, 0, 3, 0, 1, 1, 1, 4, 4, 1, 1, 0, 4, 4, 0, 1, 1, 1, 1, 1, 1, 3, 3, 0, 0, 3, 3, 0, 0, 1, 1, 1, 1, 1, 4, 0, 4, 4, 0, 4, 4, 1, 1, 1, 1, @@ -516,24 +549,24 @@ void EnFall_FireBall_SetPerVertexAlpha(f32 fireBallAlpha) { s32 pad; u8 perVertexAlphaTable[5]; - Vtx* vertices = Lib_SegmentedToVirtual(&object_fall_Vtx_0004C0); + Vtx* vertices = Lib_SegmentedToVirtual(gMoonFireballVtx); s32 i; - if (fireBallAlpha > 1.0f) { - fireBallAlpha = 1.0f; + if (fireballAlpha > 1.0f) { + fireballAlpha = 1.0f; } perVertexAlphaTable[0] = 0; - perVertexAlphaTable[1] = (s8)(255.0f * fireBallAlpha); - perVertexAlphaTable[2] = (s8)(155.0f * fireBallAlpha); - perVertexAlphaTable[3] = (s8)(104.0f * fireBallAlpha); - perVertexAlphaTable[4] = (s8)(54.0f * fireBallAlpha); + perVertexAlphaTable[1] = (s8)(255.0f * fireballAlpha); + perVertexAlphaTable[2] = (s8)(155.0f * fireballAlpha); + perVertexAlphaTable[3] = (s8)(104.0f * fireballAlpha); + perVertexAlphaTable[4] = (s8)(54.0f * fireballAlpha); for (i = 0; i < ARRAY_COUNT(sAlphaTableIndex); i++, vertices++) { vertices->v.cn[3] = perVertexAlphaTable[sAlphaTableIndex[i]]; } } -void EnFall_FireBall_Update(Actor* thisx, GlobalContext* globalCtx) { +void EnFall_Fireball_Update(Actor* thisx, GlobalContext* globalCtx) { EnFall* this = THIS; if (globalCtx->sceneNum == SCENE_00KEIKOKU && gSaveContext.sceneSetupIndex == 0 && globalCtx->csCtx.unk_12 == 2) { @@ -541,11 +574,11 @@ void EnFall_FireBall_Update(Actor* thisx, GlobalContext* globalCtx) { } if (func_800EE29C(globalCtx, 0x1C2)) { - this->actor.draw = EnFall_FireBall_Draw; - if (this->flags & EN_FALL_FLAG_FIRE_BALL_INTENSIFIES) { - this->fireBallIntensity += 0.01f; - if (this->fireBallIntensity > 1.0f) { - this->fireBallIntensity = 1.0f; + this->actor.draw = EnFall_Fireball_Draw; + if (this->flags & FLAG_FIRE_BALL_INTENSIFIES) { + this->fireballIntensity += 0.01f; + if (this->fireballIntensity > 1.0f) { + this->fireballIntensity = 1.0f; } } func_800EDF24(&this->actor, globalCtx, func_800EE200(globalCtx, 0x1C2)); @@ -553,29 +586,33 @@ void EnFall_FireBall_Update(Actor* thisx, GlobalContext* globalCtx) { switch (globalCtx->csCtx.npcActions[func_800EE200(globalCtx, 0x1C2)]->unk0) { default: this->actor.draw = NULL; - this->fireBallAlpha = 0; + this->fireballAlpha = 0; break; + case 2: - if (this->fireBallAlpha < 100) { - this->fireBallAlpha += 4; + if (this->fireballAlpha < 100) { + this->fireballAlpha += 4; } - if (this->fireBallAlpha > 100) { - this->fireBallAlpha = 100; + if (this->fireballAlpha > 100) { + this->fireballAlpha = 100; } - EnFall_FireBall_SetPerVertexAlpha(this->fireBallAlpha * 0.01f); + EnFall_Fireball_SetPerVertexAlpha(this->fireballAlpha * 0.01f); break; + case 3: - if (this->fireBallAlpha > 0) { - this->fireBallAlpha -= 2; + if (this->fireballAlpha > 0) { + this->fireballAlpha -= 2; } - if (this->fireBallAlpha < 0) { - this->fireBallAlpha = 0; + if (this->fireballAlpha < 0) { + this->fireballAlpha = 0; } - EnFall_FireBall_SetPerVertexAlpha(this->fireBallAlpha * 0.01f); + EnFall_Fireball_SetPerVertexAlpha(this->fireballAlpha * 0.01f); break; + case 4: - this->flags |= EN_FALL_FLAG_FIRE_BALL_INTENSIFIES; + this->flags |= FLAG_FIRE_BALL_INTENSIFIES; break; + case 5: break; } @@ -583,7 +620,7 @@ void EnFall_FireBall_Update(Actor* thisx, GlobalContext* globalCtx) { this->actor.draw = NULL; } - if (func_800EE29C(globalCtx, 0x1C2) && this->fireBallAlpha > 0) { + if (func_800EE29C(globalCtx, 0x1C2) && this->fireballAlpha > 0) { func_8019F128(NA_SE_EV_MOON_FALL_LAST - SFX_FLAG); } Actor_SetScale(&this->actor, this->scale * 1.74f); @@ -593,7 +630,7 @@ void EnFall_RisingDebris_UpdateParticles(EnFall* this) { s32 i; for (i = 0; i < ARRAY_COUNT(debrisParticles); i++) { - if (debrisParticles[i].dListIndex < 3) { + if (debrisParticles[i].modelIndex < 3) { debrisParticles[i].pos.x += debrisParticles[i].velocity.x; debrisParticles[i].pos.y += debrisParticles[i].velocity.y; debrisParticles[i].pos.z += debrisParticles[i].velocity.z; @@ -601,7 +638,7 @@ void EnFall_RisingDebris_UpdateParticles(EnFall* this) { debrisParticles[i].rot.y += 0xC8; debrisParticles[i].rot.z += 0x12C; if ((this->actor.world.pos.y + 3000.0f) < debrisParticles[i].pos.y) { - debrisParticles[i].dListIndex = 3; + debrisParticles[i].modelIndex = 3; this->activeDebrisParticleCount--; } } @@ -614,8 +651,8 @@ s32 EnFall_RisingDebris_InitializeParticles(EnFall* this) { f32 scale; for (i = 0; i < ARRAY_COUNT(debrisParticles); i++) { - if (debrisParticles[i].dListIndex >= 3) { - debrisParticles[i].dListIndex = (s32)Rand_ZeroFloat(3.0f); + if (debrisParticles[i].modelIndex >= 3) { + debrisParticles[i].modelIndex = (s32)Rand_ZeroFloat(3.0f); debrisParticles[i].pos.x = this->actor.world.pos.x; debrisParticles[i].pos.y = this->actor.world.pos.y; debrisParticles[i].pos.z = this->actor.world.pos.z; @@ -658,13 +695,13 @@ void EnFall_FireRing_Update(Actor* thisx, GlobalContext* globalCtx) { EnFall* this = THIS; if (func_800EE29C(globalCtx, 0x1C2) && globalCtx->csCtx.npcActions[func_800EE200(globalCtx, 0x1C2)]->unk0 == 5) { - if (!(this->flags & EN_FALL_FLAG_FIRE_RING_APPEARS)) { + if (!(this->flags & FLAG_FIRE_RING_APPEARS)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_DM_RING_EXPLOSION); } - this->flags |= EN_FALL_FLAG_FIRE_RING_APPEARS; + this->flags |= FLAG_FIRE_RING_APPEARS; } - if (this->flags & EN_FALL_FLAG_FIRE_RING_APPEARS) { - this->fireRingAlpha += 0.033333335f; + if (this->flags & FLAG_FIRE_RING_APPEARS) { + this->fireRingAlpha += 1 / 30.0f; if (this->fireRingAlpha > 1.0f) { this->fireRingAlpha = 1.0f; } @@ -679,6 +716,10 @@ void EnFall_FireRing_Update(Actor* thisx, GlobalContext* globalCtx) { } } +/** + * Used for all closed-mouth high-detail moons, including + * StoppedClosedMouthMoon and CrashingMoon. + */ void EnFall_Moon_Draw(Actor* thisx, GlobalContext* globalCtx) { // This offsets the moon's focus so that the Moon's Tear actually falls // out of its eye when looking at it through the telescope. @@ -691,9 +732,11 @@ void EnFall_Moon_Draw(Actor* thisx, GlobalContext* globalCtx) { func_8012C28C(globalCtx->state.gfxCtx); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); Matrix_MultiplyVector3fByState(sFocusOffset, &this->actor.focus.pos); + primColor = (this->eyeGlowIntensity * 200.0f) + 40.0f; gDPSetPrimColor(POLY_OPA_DISP++, 0, 0x80, primColor, primColor, primColor, 255); - gSPDisplayList(POLY_OPA_DISP++, object_fall_DL_0077F0); + + gSPDisplayList(POLY_OPA_DISP++, gMoonDL); CLOSE_DISPS(globalCtx->state.gfxCtx); } @@ -706,9 +749,11 @@ void EnFall_OpenMouthMoon_Draw(Actor* thisx, GlobalContext* globalCtx) { func_8012C28C(globalCtx->state.gfxCtx); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + primColor = (this->eyeGlowIntensity * 200.0f) + 40.0f; gDPSetPrimColor(POLY_OPA_DISP++, 0, 0x80, primColor, primColor, primColor, 255); - gSPDisplayList(POLY_OPA_DISP++, object_fall2_DL_002970); + + gSPDisplayList(POLY_OPA_DISP++, gOpenMouthMoonDL); CLOSE_DISPS(globalCtx->state.gfxCtx); } @@ -722,14 +767,17 @@ void EnFall_LodMoon_Draw(Actor* thisx, GlobalContext* globalCtx) { func_8012C28C(globalCtx->state.gfxCtx); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + POLY_OPA_DISP = Gfx_SetFog(POLY_OPA_DISP, 20, 25, 30, 0, 0x3E7, 0x3200); gDPSetRenderMode(POLY_OPA_DISP++, G_RM_PASS, G_RM_AA_ZB_OPA_SURF2); gSPLoadGeometryMode(POLY_OPA_DISP++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH); + primColor = (this->eyeGlowIntensity * 200.0f) + 40.0f; gDPSetPrimColor(POLY_OPA_DISP++, 0, 0x80, primColor, primColor, primColor, 255); - gSPDisplayList(POLY_OPA_DISP++, object_lodmoon_DL_0010E0); + + gSPDisplayList(POLY_OPA_DISP++, gLodmoonEyesDL); gSPLoadGeometryMode(POLY_OPA_DISP++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_LIGHTING | G_SHADING_SMOOTH); - gSPDisplayList(POLY_OPA_DISP++, object_lodmoon_DL_001158); + gSPDisplayList(POLY_OPA_DISP++, gLodmoonMoonDL); POLY_OPA_DISP = func_801660B8(globalCtx, POLY_OPA_DISP); CLOSE_DISPS(globalCtx->state.gfxCtx); @@ -759,57 +807,63 @@ void EnFall_LodMoon_DrawWithLerp(Actor* thisx, GlobalContext* globalCtx) { Matrix_InsertXRotation_s(thisx->shape.rot.x, MTXMODE_APPLY); Matrix_InsertZRotation_s(thisx->shape.rot.z, MTXMODE_APPLY); } + EnFall_LodMoon_Draw(thisx, globalCtx); } -void EnFall_FireBall_Draw(Actor* thisx, GlobalContext* globalCtx) { +void EnFall_Fireball_Draw(Actor* thisx, GlobalContext* globalCtx) { s32 pad; EnFall* this = THIS; u32 gameplayFrames = globalCtx->gameplayFrames; OPEN_DISPS(globalCtx->state.gfxCtx); + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); func_8012C2DC(globalCtx->state.gfxCtx); - this->fireBallYTexScroll1 += (s32)(4.0f + (this->fireBallIntensity * 12.0f)); - this->fireBallYTexScroll2 += (s32)(2.0f + (this->fireBallIntensity * 6.0f)); + + this->fireballYTexScroll1 += (s32)(4.0f + (this->fireballIntensity * 12.0f)); + this->fireballYTexScroll2 += (s32)(2.0f + (this->fireballIntensity * 6.0f)); + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, - (s32)(((1.0f - this->fireBallIntensity) * 160.0f) + (255.0f * this->fireBallIntensity)), - (s32)((70.0f * (1.0f - this->fireBallIntensity)) + (255.0f * this->fireBallIntensity)), - (s32)(70.0f * (1.0f - this->fireBallIntensity)), 255); + (s32)(((1.0f - this->fireballIntensity) * 160.0f) + (255.0f * this->fireballIntensity)), + (s32)((70.0f * (1.0f - this->fireballIntensity)) + (255.0f * this->fireballIntensity)), + (s32)(70.0f * (1.0f - this->fireballIntensity)), 255); gDPSetEnvColor( - POLY_XLU_DISP++, (s32)(((1.0f - this->fireBallIntensity) * 50.0f) + (200.0f * this->fireBallIntensity)), - (s32)(20.0f * (1.0f - this->fireBallIntensity)), (s32)(20.0f * (1.0f - this->fireBallIntensity)), 255); + POLY_XLU_DISP++, (s32)(((1.0f - this->fireballIntensity) * 50.0f) + (200.0f * this->fireballIntensity)), + (s32)(20.0f * (1.0f - this->fireballIntensity)), (s32)(20.0f * (1.0f - this->fireballIntensity)), 255); - // Glowing sphere of fire + // For the glowing sphere of fire gSPSegment(POLY_XLU_DISP++, 0x09, - Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, gameplayFrames, -this->fireBallYTexScroll2, 64, 64, 1, - -gameplayFrames, -this->fireBallYTexScroll1, 64, 64)); + Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, gameplayFrames, -this->fireballYTexScroll2, 64, 64, 1, + -gameplayFrames, -this->fireballYTexScroll1, 64, 64)); - // "Flecks" of fire + // For the "flecks" of fire around the fireball gSPSegment(POLY_XLU_DISP++, 0x0A, - Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, gameplayFrames * 2, -this->fireBallYTexScroll1, 64, 64, 1, - -gameplayFrames * 2, -this->fireBallYTexScroll1, 64, 64)); + Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, gameplayFrames * 2, -this->fireballYTexScroll1, 64, 64, 1, + -gameplayFrames * 2, -this->fireballYTexScroll1, 64, 64)); gDPSetColorDither(POLY_XLU_DISP++, G_CD_NOISE); gDPSetAlphaDither(POLY_XLU_DISP++, G_AD_NOISE); - gSPDisplayList(POLY_XLU_DISP++, object_fall_DL_0011D0); + gSPDisplayList(POLY_XLU_DISP++, gMoonFireballDL); CLOSE_DISPS(globalCtx->state.gfxCtx); } void EnFall_RisingDebris_Draw(Actor* thisx, GlobalContext* globalCtx) { - static Gfx* sDebrisDLists[] = { object_fall_DL_000220, object_fall_DL_000428, object_fall_DL_000498 }; + static Gfx* sDebrisModelDLists[] = { gMoonDebrisModel1DL, gMoonDebrisModel2DL, gMoonDebrisModel3DL }; EnFall* this = THIS; f32 scale = this->scale * 0.06f; s32 i; OPEN_DISPS(globalCtx->state.gfxCtx); + func_8012C28C(globalCtx->state.gfxCtx); - gSPDisplayList(POLY_OPA_DISP++, object_fall_DL_000198); + gSPDisplayList(POLY_OPA_DISP++, gMoonDebrisMaterialDL); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, 255); gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 255); + for (i = 0; i < ARRAY_COUNT(debrisParticles); i++) { - if (debrisParticles[i].dListIndex < 3) { + if (debrisParticles[i].modelIndex < 3) { Matrix_InsertTranslation(debrisParticles[i].pos.x, debrisParticles[i].pos.y, debrisParticles[i].pos.z, MTXMODE_NEW); Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); @@ -817,9 +871,10 @@ void EnFall_RisingDebris_Draw(Actor* thisx, GlobalContext* globalCtx) { MTXMODE_APPLY); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, sDebrisDLists[debrisParticles[i].dListIndex]); + gSPDisplayList(POLY_OPA_DISP++, sDebrisModelDLists[debrisParticles[i].modelIndex]); } } + CLOSE_DISPS(globalCtx->state.gfxCtx); } @@ -832,13 +887,18 @@ void EnFall_FireRing_Draw(Actor* thisx, GlobalContext* globalCtx) { this->fireRingAlpha = 1.0f; } OPEN_DISPS(globalCtx->state.gfxCtx); - AnimatedMat_DrawXlu(globalCtx, Lib_SegmentedToVirtual(&object_fall_Matanimheader_004E38)); + + AnimatedMat_DrawXlu(globalCtx, Lib_SegmentedToVirtual(gMoonFireRingTexAnim)); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); func_8012C2DC(globalCtx->state.gfxCtx); + gDPSetColorDither(POLY_XLU_DISP++, G_CD_NOISE); gDPSetAlphaDither(POLY_XLU_DISP++, G_AD_NOISE); + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 255, 255, 255, (s32)(this->fireRingAlpha * 255.0f)); - gSPDisplayList(POLY_XLU_DISP++, object_fall_DL_003C30); + + gSPDisplayList(POLY_XLU_DISP++, gMoonFireRingDL); + CLOSE_DISPS(globalCtx->state.gfxCtx); } } @@ -847,13 +907,18 @@ void EnFall_MoonsTear_Draw(Actor* thisx, GlobalContext* globalCtx) { s32 pad; OPEN_DISPS(globalCtx->state.gfxCtx); - AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&object_moonston_Matanimheader_001220)); + + AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(gFallingMoonsTearTexAnim)); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); func_8012C28C(globalCtx->state.gfxCtx); - gSPDisplayList(POLY_OPA_DISP++, object_moonston_DL_000400); + + gSPDisplayList(POLY_OPA_DISP++, gFallingMoonsTearDL); + Matrix_Scale(3.0f, 3.0f, 6.0f, MTXMODE_APPLY); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); func_8012C2DC(globalCtx->state.gfxCtx); - gSPDisplayList(POLY_XLU_DISP++, object_moonston_DL_0004C8); + + gSPDisplayList(POLY_XLU_DISP++, gFallingMoonsTearFireDL); + CLOSE_DISPS(globalCtx->state.gfxCtx); } diff --git a/src/overlays/actors/ovl_En_Fall/z_en_fall.h b/src/overlays/actors/ovl_En_Fall/z_en_fall.h index 0124087d9..620c0590a 100644 --- a/src/overlays/actors/ovl_En_Fall/z_en_fall.h +++ b/src/overlays/actors/ovl_En_Fall/z_en_fall.h @@ -6,9 +6,6 @@ #define EN_FALL_SCALE(thisx) ((thisx)->params & 0x7F) #define EN_FALL_TYPE(thisx) (((thisx)->params & 0xF80) >> 7) -#define EN_FALL_FLAG_FIRE_BALL_INTENSIFIES (1 << 0) -#define EN_FALL_FLAG_FIRE_RING_APPEARS (1 << 1) - typedef enum { /* 0 */ EN_FALL_TYPE_TERMINA_FIELD_MOON, /* 1 */ EN_FALL_TYPE_TITLE_SCREEN_MOON, @@ -37,19 +34,19 @@ typedef struct EnFall { /* 0x14C */ f32 scale; /* 0x150 */ union { f32 eyeGlowIntensity; - f32 fireBallIntensity; + f32 fireballIntensity; f32 fireRingAlpha; }; /* 0x154 */ u16 flags; /* 0x158 */ union { - s32 fireBallAlpha; + s32 fireballAlpha; s32 activeDebrisParticleCount; }; /* 0x15C */ union { - s16 fireBallYTexScroll1; + s16 fireballYTexScroll1; s16 fireWallYScale; }; - /* 0x15E */ s16 fireBallYTexScroll2; + /* 0x15E */ s16 fireballYTexScroll2; /* 0x160 */ EnFallActionFunc actionFunc; } EnFall; // size = 0x164 diff --git a/src/overlays/actors/ovl_En_Fg/z_en_fg.c b/src/overlays/actors/ovl_En_Fg/z_en_fg.c index 189f0e2e0..ea0c82027 100644 --- a/src/overlays/actors/ovl_En_Fg/z_en_fg.c +++ b/src/overlays/actors/ovl_En_Fg/z_en_fg.c @@ -5,6 +5,8 @@ */ #include "z_en_fg.h" +#include "objects/object_fr/object_fr.h" +#include "objects/gameplay_keep/gameplay_keep.h" #define FLAGS 0x00004209 @@ -22,14 +24,6 @@ void EnFg_AddDust(EnFgEffectDust* dustEffect, Vec3f* worldPos); void EnFg_UpdateDust(EnFgEffectDust* dustEffect); void EnFg_DrawDust(GlobalContext* globalCtx, EnFgEffectDust* dustEffect); -extern AnimationHeader D_06001534; -extern AnimationHeader D_060011C0; -extern AnimationHeader D_060007BC; -extern Gfx* D_060059A0[]; -extern Gfx* D_0600B328[]; -extern Gfx* D_0600B338[]; -extern FlexSkeletonHeader D_0600B538; - const ActorInit En_Fg_InitVars = { ACTOR_EN_FG, ACTORCAT_NPC, @@ -102,10 +96,10 @@ static DamageTable sDamageTable = { }; static ActorAnimationEntryS sAnimations[] = { - { &D_06001534, 1.0f, 0, -1, 0, 0 }, - { &D_06001534, 1.0f, 0, -1, 0, -4 }, - { &D_060011C0, 1.0f, 0, -1, 0, -4 }, - { &D_060007BC, 1.0f, 0, -1, 2, -4 }, + { &object_fr_Anim_001534, 1.0f, 0, -1, 0, 0 }, + { &object_fr_Anim_001534, 1.0f, 0, -1, 0, -4 }, + { &object_fr_Anim_0011C0, 1.0f, 0, -1, 0, -4 }, + { &object_fr_Anim_0007BC, 1.0f, 0, -1, 2, -4 }, }; s32 EnFg_UpdateAnimation(SkelAnime* skelAnime, s16 animIndex) { @@ -321,7 +315,8 @@ void EnFg_Init(Actor* thisx, GlobalContext* globalCtx) { EnFg* this = THIS; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 10.0f); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600B538, NULL, this->jointTable, this->morphTable, 24); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_fr_Skel_00B538, NULL, this->jointTable, this->morphTable, + 24); EnFg_UpdateAnimation(&this->skelAnime, 0); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); @@ -412,8 +407,8 @@ void EnFg_Draw(Actor* thisx, GlobalContext* globalCtx) { gDPPipeSync(POLY_OPA_DISP++); gDPSetEnvColor(POLY_OPA_DISP++, envColor[this->actor.params].r, envColor[this->actor.params].g, envColor[this->actor.params].b, envColor[this->actor.params].a); - gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(&D_060059A0)); - gSPSegment(POLY_OPA_DISP++, 0x09, Lib_SegmentedToVirtual(&D_060059A0)); + gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(object_fr_Tex_0059A0)); + gSPSegment(POLY_OPA_DISP++, 0x09, Lib_SegmentedToVirtual(object_fr_Tex_0059A0)); SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, EnFg_OverrideLimbDraw, EnFg_PostLimbDraw, &this->actor); CLOSE_DISPS(globalCtx->state.gfxCtx); @@ -451,7 +446,7 @@ void EnFg_UpdateDust(EnFgEffectDust* dustEffect) { } TexturePtr sDustTex[] = { - D_0408F7E0, D_0408F3E0, D_0408EFE0, D_0408EBE0, D_0408E7E0, D_0408E3E0, D_0408DFE0, D_0408DBE0, + gDust8Tex, gDust7Tex, gDust6Tex, gDust5Tex, gDust4Tex, gDust3Tex, gDust2Tex, gDust1Tex, }; void EnFg_DrawDust(GlobalContext* globalCtx, EnFgEffectDust* dustEffect) { @@ -467,7 +462,7 @@ void EnFg_DrawDust(GlobalContext* globalCtx, EnFgEffectDust* dustEffect) { if (dustEffect->type) { if (!firstDone) { POLY_XLU_DISP = Gfx_CallSetupDL(POLY_XLU_DISP, 0); - gSPDisplayList(POLY_XLU_DISP++, D_0600B328); + gSPDisplayList(POLY_XLU_DISP++, object_fr_DL_00B328); gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 0, 0); firstDone = true; } @@ -483,7 +478,7 @@ void EnFg_DrawDust(GlobalContext* globalCtx, EnFgEffectDust* dustEffect) { G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); index = 0.5f * dustEffect->timer; gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(sDustTex[index])); - gSPDisplayList(POLY_XLU_DISP++, D_0600B338); + gSPDisplayList(POLY_XLU_DISP++, object_fr_DL_00B338); } } CLOSE_DISPS(globalCtx->state.gfxCtx); diff --git a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c index 5c5952cc6..af00d0344 100644 --- a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c +++ b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c @@ -6,6 +6,7 @@ #include "z_en_firefly.h" #include "overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.h" +#include "objects/object_firefly/object_firefly.h" #define FLAGS 0x00005005 @@ -119,16 +120,13 @@ static InitChainEntry sInitChain[] = { ICHAIN_F32(targetArrowOffset, 4000, ICHAIN_STOP), }; -extern AnimationHeader D_0600017C; -extern SkeletonHeader D_060018B8; -extern Gfx D_06001678[]; - void EnFirefly_Init(Actor* thisx, GlobalContext* globalCtx) { EnFirefly* this = THIS; Actor_ProcessInitChain(&this->actor, sInitChain); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f); - SkelAnime_Init(globalCtx, &this->skelAnime, &D_060018B8, &D_0600017C, this->jointTable, this->morphTable, 28); + SkelAnime_Init(globalCtx, &this->skelAnime, &object_firefly_Skel_0018B8, &object_firefly_Anim_00017C, + this->jointTable, this->morphTable, 28); Collider_InitAndSetSphere(globalCtx, &this->collider, &this->actor, &sSphereInit); CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); @@ -331,7 +329,7 @@ void EnFirefly_FlyIdle(EnFirefly* this, GlobalContext* globalCtx) { void EnFirefly_SetupFall(EnFirefly* this, GlobalContext* globalCtx) { this->timer = 40; this->actor.velocity.y = 0.0f; - Animation_Change(&this->skelAnime, &D_0600017C, 0.0f, 6.0f, 6.0f, 2, 0.0f); + Animation_Change(&this->skelAnime, &object_firefly_Anim_00017C, 0.0f, 6.0f, 6.0f, 2, 0.0f); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FFLY_DEAD); this->actor.flags |= 0x10; @@ -757,7 +755,7 @@ void EnFirefly_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList EnFirefly* this = THIS; if ((this->currentType != KEESE_FIRE) && (limbIndex == 27)) { - gSPDisplayList((*gfx)++, D_06001678); + gSPDisplayList((*gfx)++, object_firefly_DL_001678); } else if ((this->unk_2F4 != globalCtx->gameplayFrames) && ((this->auraType == KEESE_AURA_FIRE) || (this->auraType == KEESE_AURA_ICE)) && ((limbIndex == 15) || (limbIndex == 21))) { @@ -816,7 +814,7 @@ void EnFirefly_Draw(Actor* thisx, GlobalContext* globalCtx) { gfx = POLY_OPA_DISP; } - gSPDisplayList(gfx, &sSetupDL[150]); + gSPDisplayList(gfx, &sSetupDL[6 * 25]); if (this->currentType == KEESE_FIRE) { gDPSetEnvColor(&gfx[1], 0, 0, 0, 0); diff --git a/src/overlays/actors/ovl_En_Fish2/z_en_fish2.c b/src/overlays/actors/ovl_En_Fish2/z_en_fish2.c index e0b23e727..a009de48a 100644 --- a/src/overlays/actors/ovl_En_Fish2/z_en_fish2.c +++ b/src/overlays/actors/ovl_En_Fish2/z_en_fish2.c @@ -7,6 +7,8 @@ #include "overlays/actors/ovl_En_Fish/z_en_fish.h" #include "overlays/actors/ovl_En_Mushi2/z_en_mushi2.h" #include "z_en_fish2.h" +#include "objects/gameplay_keep/gameplay_keep.h" +#include "objects/object_fb/object_fb.h" #define FLAGS 0x00000019 @@ -40,13 +42,6 @@ void func_80B2ADB0(EnFish2* this, Vec3f* vec, s16 arg2); void func_80B2AF80(EnFish2* this, GlobalContext* globalCtx); void func_80B2B180(EnFish2* this, GlobalContext* globalCtx); -extern AnimationHeader D_060006D8; -extern AnimationHeader D_060007D4; -extern AnimationHeader D_06000ACC; -extern AnimationHeader D_06001174; -extern AnimationHeader D_060013AC; -extern FlexSkeletonHeader D_06006190; - static s32 D_80B2B2E0 = 0; static s32 D_80B2B2E4 = 0; static s32 D_80B2B2E8 = 0; @@ -109,7 +104,8 @@ static f32 D_80B2B380[] = { 0.019f, 0.033f }; void func_80B28370(EnFish2* this, s32 arg0) { static AnimationHeader* D_80B2B388[] = { - &D_060013AC, &D_060007D4, &D_060006D8, &D_060006D8, &D_06001174, &D_06000ACC, + &object_fb_Anim_0013AC, &object_fb_Anim_0007D4, &object_fb_Anim_0006D8, + &object_fb_Anim_0006D8, &object_fb_Anim_001174, &object_fb_Anim_000ACC, }; static u8 D_80B2B3A0[] = { 0, 0, 2, 2, 2, 2 }; f32 sp34; @@ -161,8 +157,8 @@ void EnFish2_Init(Actor* thisx, GlobalContext* globalCtx) { if (this->actor.params == 0) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06006190, &D_060013AC, this->jointTable, this->morphTable, - 24); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_fb_Skel_006190, &object_fb_Anim_0013AC, + this->jointTable, this->morphTable, 24); this->actor.colChkInfo.mass = MASS_IMMOVABLE; if (this->unk_344 == 0) { if (gSaveContext.save.weekEventReg[81] & 0x10) { @@ -937,8 +933,8 @@ void EnFish2_Update(Actor* thisx, GlobalContext* globalCtx2) { static f32 D_80B2B3A8[] = { 0.0f, 40.0f, -40.0f, 0.0f, 0.0f, 0.0f, }; - EnFish2* this = THIS; GlobalContext* globalCtx = globalCtx2; + EnFish2* this = THIS; if ((this->actionFunc != func_80B295A4) && (this->actor.params != 1)) { SkelAnime_Update(&this->skelAnime); @@ -1095,12 +1091,12 @@ void func_80B2ADB0(EnFish2* this, Vec3f* vec, s16 arg2) { for (i = 0; i < ARRAY_COUNT(this->unk_3F8); i++, ptr++) { if (!ptr->unk_00) { - u32 phi_v0; + TexturePtr phi_v0; if (Rand_ZeroOne() < 0.5f) { - phi_v0 = &D_04091CE0; + phi_v0 = gameplay_keep_Tex_091CE0; } else { - phi_v0 = &D_04091BE0; + phi_v0 = gameplay_keep_Tex_091BE0; } ptr->unk_20 = VIRTUAL_TO_PHYSICAL(SEGMENTED_TO_VIRTUAL(phi_v0)); @@ -1172,7 +1168,7 @@ void func_80B2B180(EnFish2* this, GlobalContext* globalCtx) { gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, 255); gDPSetEnvColor(POLY_OPA_DISP++, 150, 150, 150, 0); gSPSegment(POLY_OPA_DISP++, 0x08, ptr->unk_20); - gSPDisplayList(POLY_OPA_DISP++, D_040301B0); + gSPDisplayList(POLY_OPA_DISP++, gameplay_keep_DL_0301B0); } } diff --git a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c index d5cddf966..8b8531a47 100644 --- a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c +++ b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c @@ -5,6 +5,7 @@ */ #include "z_en_floormas.h" +#include "objects/object_wallmaster/object_wallmaster.h" #define FLAGS 0x00000405 @@ -59,19 +60,6 @@ void func_808D2D30(EnFloormas* this, GlobalContext* globalCtx); void func_808D2DC0(EnFloormas* this, GlobalContext* globalCtx); void func_808D3754(Actor* thisx, GlobalContext* globalCtx); -extern AnimationHeader D_06000590; -extern AnimationHeader D_06000EA4; -extern AnimationHeader D_060019CC; -extern AnimationHeader D_06002158; -extern AnimationHeader D_060039B0; -extern AnimationHeader D_060041F4; -extern Gfx D_06008688[]; -extern FlexSkeletonHeader D_06008FB0; -extern AnimationHeader D_06009244; -extern AnimationHeader D_06009520; -extern AnimationHeader D_06009DB0; -extern AnimationHeader D_0600A054; - const ActorInit En_Floormas_InitVars = { ACTOR_EN_FLOORMAS, ACTORCAT_ENEMY, @@ -159,14 +147,15 @@ static s8 D_808D393C[] = { static Color_RGBA8 D_808D3958 = { 0, 255, 0, 0 }; void EnFloormas_Init(Actor* thisx, GlobalContext* globalCtx2) { - EnFloormas* this = THIS; GlobalContext* globalCtx = globalCtx2; + EnFloormas* this = THIS; s32 pad; s32 params; Actor_ProcessInitChain(&this->actor, sInitChain); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 50.0f); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06008FB0, &D_06009DB0, this->jointTable, this->morphTable, 25); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_wallmaster_Skel_008FB0, &object_wallmaster_Anim_009DB0, + this->jointTable, this->morphTable, 25); Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); @@ -270,7 +259,7 @@ void func_808D0A48(EnFloormas* this, GlobalContext* globalCtx) { } void func_808D0B08(EnFloormas* this) { - Animation_PlayOnce(&this->skelAnime, &D_06009DB0); + Animation_PlayOnce(&this->skelAnime, &object_wallmaster_Anim_009DB0); this->actor.speedXZ = 0.0f; this->actionFunc = func_808D0B50; } @@ -289,7 +278,7 @@ void func_808D0B50(EnFloormas* this, GlobalContext* globalCtx) { } void func_808D0C14(EnFloormas* this) { - Animation_MorphToPlayOnce(&this->skelAnime, &D_0600A054, -3.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &object_wallmaster_Anim_00A054, -3.0f); this->actionFunc = func_808D0C58; } @@ -307,7 +296,7 @@ void func_808D0C58(EnFloormas* this, GlobalContext* globalCtx) { void func_808D0CE4(EnFloormas* this) { if (this->actionFunc != func_808D0F80) { - Animation_PlayLoopSetSpeed(&this->skelAnime, &D_060041F4, 1.5f); + Animation_PlayLoopSetSpeed(&this->skelAnime, &object_wallmaster_Anim_0041F4, 1.5f); } else { this->skelAnime.playSpeed = 1.5f; } @@ -345,7 +334,7 @@ void func_808D0D70(EnFloormas* this, GlobalContext* globalCtx) { } void func_808D0ECC(EnFloormas* this) { - Animation_PlayOnce(&this->skelAnime, &D_06009244); + Animation_PlayOnce(&this->skelAnime, &object_wallmaster_Anim_009244); this->actor.speedXZ = 0.0f; this->actionFunc = func_808D0F14; } @@ -384,10 +373,10 @@ void func_808D108C(EnFloormas* this) { this->actor.speedXZ = 0.0f; if (sp36 > 0) { - Animation_MorphToPlayOnce(&this->skelAnime, &D_06002158, -3.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &object_wallmaster_Anim_002158, -3.0f); } else { - Animation_Change(&this->skelAnime, &D_06002158, -1.0f, Animation_GetLastFrame(&D_06002158.common), 0.0f, 2, - -3.0f); + Animation_Change(&this->skelAnime, &object_wallmaster_Anim_002158, -1.0f, + Animation_GetLastFrame(&object_wallmaster_Anim_002158.common), 0.0f, 2, -3.0f); } if (this->actor.scale.x > 0.009f) { @@ -429,7 +418,8 @@ void func_808D11BC(EnFloormas* this, GlobalContext* globalCtx) { } void func_808D1380(EnFloormas* this, GlobalContext* globalCtx) { - Animation_Change(&this->skelAnime, &D_06009520, 3.0f, 0.0f, Animation_GetLastFrame(&D_06009520.common), 2, -3.0f); + Animation_Change(&this->skelAnime, &object_wallmaster_Anim_009520, 3.0f, 0.0f, + Animation_GetLastFrame(&object_wallmaster_Anim_009520.common), 2, -3.0f); this->actor.speedXZ = 0.0f; this->actor.gravity = 0.0f; func_808D08D0(this); @@ -502,7 +492,7 @@ void func_808D1650(EnFloormas* this, GlobalContext* globalCtx) { } void func_808D1740(EnFloormas* this) { - Animation_Change(&this->skelAnime, &D_060019CC, 1.0f, 41.0f, 42.0f, 2, 5.0f); + Animation_Change(&this->skelAnime, &object_wallmaster_Anim_0019CC, 1.0f, 41.0f, 42.0f, 2, 5.0f); if ((this->actor.speedXZ < 0.0f) || (this->actionFunc != func_808D1650)) { this->unk_18E = 30; } else { @@ -548,7 +538,7 @@ void func_808D17EC(EnFloormas* this, GlobalContext* globalCtx) { if ((this->unk_18E == 0) && (sp24 != 0)) { if (this->skelAnime.endFrame < 45.0f) { - this->skelAnime.endFrame = Animation_GetLastFrame(&D_060019CC.common); + this->skelAnime.endFrame = Animation_GetLastFrame(&object_wallmaster_Anim_0019CC.common); } else if (this->actor.params == ENFLOORMAS_GET_7FFF_40) { func_808D2700(this); } else { @@ -579,7 +569,8 @@ void func_808D19D4(EnFloormas* this) { this->actor.shape.rot.y = parent->shape.rot.y + 0x5555; this->actor.world.pos = parent->world.pos; this->actor.params = ENFLOORMAS_GET_7FFF_10; - Animation_Change(&this->skelAnime, &D_060019CC, 1.0f, 41.0f, Animation_GetLastFrame(&D_060019CC.common), 2, 0.0f); + Animation_Change(&this->skelAnime, &object_wallmaster_Anim_0019CC, 1.0f, 41.0f, + Animation_GetLastFrame(&object_wallmaster_Anim_0019CC.common), 2, 0.0f); this->collider.dim.radius = sCylinderInit.dim.radius * 0.6f; this->collider.dim.height = sCylinderInit.dim.height * 0.6f; this->actor.flags &= ~0x400; @@ -605,7 +596,7 @@ void func_808D1B44(EnFloormas* this, GlobalContext* globalCtx) { } void func_808D1BCC(EnFloormas* this) { - Animation_PlayLoopSetSpeed(&this->skelAnime, &D_060041F4, 4.5f); + Animation_PlayLoopSetSpeed(&this->skelAnime, &object_wallmaster_Anim_0041F4, 4.5f); this->actor.speedXZ = 5.0f; this->actionFunc = func_808D1C1C; } @@ -632,7 +623,7 @@ void func_808D1C1C(EnFloormas* this, GlobalContext* globalCtx) { void func_808D1D0C(EnFloormas* this) { if (this->actionFunc != func_808D1C1C) { - Animation_PlayLoopSetSpeed(&this->skelAnime, &D_060041F4, 4.5f); + Animation_PlayLoopSetSpeed(&this->skelAnime, &object_wallmaster_Anim_0041F4, 4.5f); } this->actor.speedXZ = 5.0f; this->actionFunc = func_808D1D6C; @@ -695,7 +686,7 @@ void func_808D1F7C(EnFloormas* this, GlobalContext* globalCtx) { } void func_808D1FD4(EnFloormas* this) { - Animation_Change(&this->skelAnime, &D_060019CC, 2.0f, 0.0f, 41.0f, 2, 0.0f); + Animation_Change(&this->skelAnime, &object_wallmaster_Anim_0019CC, 2.0f, 0.0f, 41.0f, 2, 0.0f); this->actor.speedXZ = 0.0f; this->actionFunc = func_808D2040; } @@ -725,7 +716,7 @@ void func_808D217C(EnFloormas* this, Player* player) { Vec3f* ptr; u8 playerForm; - Animation_Change(&this->skelAnime, &D_060019CC, 1.0f, 36.0f, 45.0f, 2, -3.0f); + Animation_Change(&this->skelAnime, &object_wallmaster_Anim_0019CC, 1.0f, 36.0f, 45.0f, 2, -3.0f); this->actor.flags &= ~1; this->actor.speedXZ = 0.0f; this->actor.velocity.y = 0.0f; @@ -781,7 +772,7 @@ void func_808D22C8(EnFloormas* this, GlobalContext* globalCtx) { } void func_808D2484(EnFloormas* this) { - Animation_Change(&this->skelAnime, &D_060019CC, 2.0f, 0.0f, 41.0f, 2, 0.0f); + Animation_Change(&this->skelAnime, &object_wallmaster_Anim_0019CC, 2.0f, 0.0f, 41.0f, 2, 0.0f); this->actor.speedXZ = 0.0f; this->actionFunc = func_808D24F0; } @@ -825,7 +816,7 @@ void func_808D24F0(EnFloormas* this, GlobalContext* globalCtx) { } void func_808D2700(EnFloormas* this) { - Animation_PlayOnce(&this->skelAnime, &D_06009DB0); + Animation_PlayOnce(&this->skelAnime, &object_wallmaster_Anim_009DB0); this->unk_18E = 0; this->unk_194 = 1500; this->actor.params = ENFLOORMAS_GET_7FFF_40; @@ -890,10 +881,10 @@ void func_808D2764(EnFloormas* this, GlobalContext* globalCtx) { this->actor.colChkInfo.health = sColChkInfoInit.health; func_808D0C14(this); } else if (this->unk_18E == 0) { - Animation_PlayOnce(&this->skelAnime, &D_060039B0); + Animation_PlayOnce(&this->skelAnime, &object_wallmaster_Anim_0039B0); this->unk_18E = 1; } else { - Animation_PlayOnce(&this->skelAnime, &D_06009DB0); + Animation_PlayOnce(&this->skelAnime, &object_wallmaster_Anim_009DB0); this->unk_18E = 0; } } @@ -933,7 +924,7 @@ void func_808D2AF4(EnFloormas* this, GlobalContext* globalCtx) { } void func_808D2B18(EnFloormas* this) { - Animation_MorphToPlayOnce(&this->skelAnime, &D_06000590, -3.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &object_wallmaster_Anim_000590, -3.0f); func_800BE504(&this->actor, &this->collider); Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 20); this->actor.speedXZ = 5.0f; @@ -976,7 +967,7 @@ void func_808D2C08(EnFloormas* this, GlobalContext* globalCtx) { } void func_808D2CDC(EnFloormas* this) { - Animation_PlayOnce(&this->skelAnime, &D_06000EA4); + Animation_PlayOnce(&this->skelAnime, &object_wallmaster_Anim_000EA4); this->actor.speedXZ = 0.0f; this->actor.velocity.y = 0.0f; this->actor.world.rot.y = this->actor.shape.rot.y; @@ -1187,7 +1178,7 @@ void EnFloormas_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dLis Matrix_Scale(2.0f, 2.0f, 2.0f, MTXMODE_APPLY); gSPMatrix((*gfx)++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList((*gfx)++, D_06008688); + gSPDisplayList((*gfx)++, object_wallmaster_DL_008688); Matrix_StatePop(); } diff --git a/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c b/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c index 5c8ebcb17..c3a66b36c 100644 --- a/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c +++ b/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c @@ -5,6 +5,8 @@ */ #include "z_en_fsn.h" +#include "objects/object_fsn/object_fsn.h" +#include "objects/gameplay_keep/gameplay_keep.h" #define FLAGS 0x00000019 @@ -45,25 +47,6 @@ void EnFsn_SelectItem(EnFsn* this, GlobalContext* globalCtx); void EnFsn_LookToShopkeeperFromShelf(EnFsn* this, GlobalContext* globalCtx); void EnFsn_PlayerCannotBuy(EnFsn* this, GlobalContext* globalCtx); -extern AnimationHeader D_06012C34; -extern AnimationHeader D_060131FC; -extern AnimationHeader D_0600C58C; -extern AnimationHeader D_0600E3EC; -extern AnimationHeader D_0600F00C; -extern AnimationHeader D_0600CB3C; -extern AnimationHeader D_0600D354; -extern AnimationHeader D_060138B0; -extern AnimationHeader D_0601430C; -extern AnimationHeader D_0600B9D8; -extern AnimationHeader D_0600C26C; -extern AnimationHeader D_0600DE34; -extern FlexSkeletonHeader D_06013320; -extern UNK_TYPE D_06005BC0; -extern UNK_TYPE D_06006D40; -extern UNK_TYPE D_06007140; -extern Gfx D_0600F180[]; -extern Gfx D_0600F218[]; - const ActorInit En_Fsn_InitVars = { ACTOR_EN_FSN, ACTORCAT_NPC, @@ -77,11 +60,13 @@ const ActorInit En_Fsn_InitVars = { }; static ActorAnimationEntryS sAnimations[] = { - { &D_06012C34, 1.0f, 0, -1, 0, 0 }, { &D_060131FC, 1.0f, 0, -1, 0, 0 }, { &D_0600C58C, 1.0f, 0, -1, 2, 0 }, - { &D_0600C58C, -1.0f, 0, -1, 2, 0 }, { &D_0600E3EC, 1.0f, 0, -1, 2, 0 }, { &D_0600F00C, 1.0f, 0, -1, 0, 0 }, - { &D_0600CB3C, 1.0f, 0, -1, 2, 0 }, { &D_0600D354, 1.0f, 0, -1, 0, 0 }, { &D_060138B0, 1.0f, 0, -1, 2, 0 }, - { &D_0601430C, 1.0f, 0, -1, 0, 0 }, { &D_0600B9D8, 1.0f, 0, -1, 2, 0 }, { &D_0600C26C, 1.0f, 0, -1, 0, 0 }, - { &D_0600DE34, 1.0f, 0, -1, 2, 0 }, + { &object_fsn_Anim_012C34, 1.0f, 0, -1, 0, 0 }, { &object_fsn_Anim_0131FC, 1.0f, 0, -1, 0, 0 }, + { &object_fsn_Anim_00C58C, 1.0f, 0, -1, 2, 0 }, { &object_fsn_Anim_00C58C, -1.0f, 0, -1, 2, 0 }, + { &object_fsn_Anim_00E3EC, 1.0f, 0, -1, 2, 0 }, { &object_fsn_Anim_00F00C, 1.0f, 0, -1, 0, 0 }, + { &object_fsn_Anim_00CB3C, 1.0f, 0, -1, 2, 0 }, { &object_fsn_Anim_00D354, 1.0f, 0, -1, 0, 0 }, + { &object_fsn_Anim_0138B0, 1.0f, 0, -1, 2, 0 }, { &object_fsn_Anim_01430C, 1.0f, 0, -1, 0, 0 }, + { &object_fsn_Anim_00B9D8, 1.0f, 0, -1, 2, 0 }, { &object_fsn_Anim_00C26C, 1.0f, 0, -1, 0, 0 }, + { &object_fsn_Anim_00DE34, 1.0f, 0, -1, 2, 0 }, }; static ColliderCylinderInit sCylinderInit = { @@ -717,30 +702,32 @@ void EnFsn_Idle(EnFsn* this, GlobalContext* globalCtx) { this->animationIdx = 5; func_8013BC6C(&this->skelAnime, sAnimations, this->animationIdx); } - } else if (this->flags & ENFSN_HAGGLE) { - dummy:; + return; + } + + if (this->flags & ENFSN_HAGGLE) { this->actionFunc = EnFsn_Haggle; - } else { - dummy2:; - if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { - if (this->cutsceneState == 0) { - if (ActorCutscene_GetCurrentIndex() == 0x7C) { - ActorCutscene_Stop(0x7C); - } - this->cutscene = this->lookToShopkeeperCutscene; - ActorCutscene_SetIntentToPlay(this->cutscene); - this->cutsceneState = 1; + return; + } + + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { + if (this->cutsceneState == 0) { + if (ActorCutscene_GetCurrentIndex() == 0x7C) { + ActorCutscene_Stop(0x7C); } - this->actor.textId = EnFsn_GetWelcome(globalCtx); - func_801518B0(globalCtx, this->actor.textId, &this->actor); - player->actor.world.pos.x = 1.0f; - player->actor.world.pos.z = -34.0f; - this->actionFunc = EnFsn_BeginInteraction; - } else if (((player->actor.world.pos.x >= -50.0f) && (player->actor.world.pos.x <= 15.0f)) && - (player->actor.world.pos.y > 0.0f) && - ((player->actor.world.pos.z >= -35.0f) && (player->actor.world.pos.z <= -20.0f))) { - func_800B8614(&this->actor, globalCtx, 400.0f); + this->cutscene = this->lookToShopkeeperCutscene; + ActorCutscene_SetIntentToPlay(this->cutscene); + this->cutsceneState = 1; } + this->actor.textId = EnFsn_GetWelcome(globalCtx); + func_801518B0(globalCtx, this->actor.textId, &this->actor); + player->actor.world.pos.x = 1.0f; + player->actor.world.pos.z = -34.0f; + this->actionFunc = EnFsn_BeginInteraction; + } else if (((player->actor.world.pos.x >= -50.0f) && (player->actor.world.pos.x <= 15.0f)) && + (player->actor.world.pos.y > 0.0f) && + ((player->actor.world.pos.z >= -35.0f) && (player->actor.world.pos.z <= -20.0f))) { + func_800B8614(&this->actor, globalCtx, 400.0f); } } @@ -1399,7 +1386,8 @@ void EnFsn_Init(Actor* thisx, GlobalContext* globalCtx) { s32 pad; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06013320, &D_06012C34, this->jointTable, this->morphTable, 19); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_fsn_Skel_013320, &object_fsn_Anim_012C34, this->jointTable, + this->morphTable, 19); if (ENFSN_IS_SHOP(&this->actor)) { this->actor.shape.rot.y = BINANG_ROT180(this->actor.shape.rot.y); this->actor.flags &= ~1; @@ -1459,8 +1447,8 @@ void EnFsn_DrawCursor(EnFsn* this, GlobalContext* globalCtx, f32 x, f32 y, f32 z func_8012C654(globalCtx->state.gfxCtx); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, this->cursorColor.r, this->cursorColor.g, this->cursorColor.b, this->cursorColor.a); - gDPLoadTextureBlock_4b(OVERLAY_DISP++, &D_0401F740, G_IM_FMT_IA, 16, 16, 0, G_TX_MIRROR | G_TX_WRAP, - G_TX_MIRROR | G_TX_WRAP, 4, 4, G_TX_NOLOD, G_TX_NOLOD); + gDPLoadTextureBlock_4b(OVERLAY_DISP++, gameplay_keep_Tex_01F740, G_IM_FMT_IA, 16, 16, 0, + G_TX_MIRROR | G_TX_WRAP, G_TX_MIRROR | G_TX_WRAP, 4, 4, G_TX_NOLOD, G_TX_NOLOD); w = 16.0f * z; ulx = (x - w) * 4.0f; uly = (y - w + -12.0f) * 4.0f; @@ -1507,7 +1495,7 @@ void EnFsn_DrawStickDirectionPrompts(EnFsn* this, GlobalContext* globalCtx) { if (drawStickRightPrompt || drawStickLeftPrompt) { func_8012C654(globalCtx->state.gfxCtx); gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); - gDPSetTextureImage(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, &D_0401F8C0); + gDPSetTextureImage(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, gameplay_keep_Tex_01F8C0); gDPSetTile(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 4, G_TX_NOLOD); gDPLoadSync(OVERLAY_DISP++); @@ -1528,7 +1516,7 @@ void EnFsn_DrawStickDirectionPrompts(EnFsn* this, GlobalContext* globalCtx) { this->stickRightPrompt.arrowTexX, this->stickRightPrompt.arrowTexY, this->stickRightPrompt.texZ, 0, 0, 1.0f, 1.0f); } - gDPSetTextureImage(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, &D_0401F7C0); + gDPSetTextureImage(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, gameplay_keep_Tex_01F7C0); gDPSetTile(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 4, G_TX_NOLOD); gDPLoadSync(OVERLAY_DISP++); @@ -1598,14 +1586,14 @@ void EnFsn_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve this->actor.focus.pos.z = this->actor.world.pos.z; OPEN_DISPS(globalCtx->state.gfxCtx); - gSPDisplayList(POLY_OPA_DISP++, D_0600F180); - gSPDisplayList(POLY_OPA_DISP++, D_0600F218); + gSPDisplayList(POLY_OPA_DISP++, object_fsn_DL_00F180); + gSPDisplayList(POLY_OPA_DISP++, object_fsn_DL_00F218); CLOSE_DISPS(globalCtx->state.gfxCtx); } } void EnFsn_Draw(Actor* thisx, GlobalContext* globalCtx) { - static TexturePtr sEyeTextures[] = { &D_06005BC0, &D_06006D40, &D_06007140 }; + static TexturePtr sEyeTextures[] = { object_fsn_Tex_005BC0, object_fsn_Tex_006D40, object_fsn_Tex_007140 }; EnFsn* this = THIS; s32 pad; s16 i; diff --git a/src/overlays/actors/ovl_En_Fu/z_en_fu.c b/src/overlays/actors/ovl_En_Fu/z_en_fu.c index 99a7853fc..da6cb040d 100644 --- a/src/overlays/actors/ovl_En_Fu/z_en_fu.c +++ b/src/overlays/actors/ovl_En_Fu/z_en_fu.c @@ -10,6 +10,8 @@ #include "overlays/actors/ovl_Bg_Fu_Kaiten/z_bg_fu_kaiten.h" #include "overlays/actors/ovl_En_Bom/z_en_bom.h" #include "z_en_fu.h" +#include "objects/object_mu/object_mu.h" +#include "objects/gameplay_keep/gameplay_keep.h" #define FLAGS 0x0A000019 @@ -54,16 +56,6 @@ void func_80964694(EnFu* this, EnFuUnkStruct* ptr, Vec3f* arg2, s32 len); void func_809647EC(GlobalContext* globalCtx, EnFuUnkStruct* ptr, s32 len); void func_80964950(GlobalContext* globalCtx, EnFuUnkStruct* ptr, s32 len); -extern AnimationHeader D_06001F74; -extern AnimationHeader D_06002F64; -extern AnimationHeader D_06004904; -extern AnimationHeader D_06005304; -extern AnimationHeader D_060053E0; -extern Gfx D_0600B0A0[]; -extern Gfx D_0600B0E0[]; -extern FlexSkeletonHeader D_0600B2B0; -extern AnimationHeader D_0600BAC4; - const ActorInit En_Fu_InitVars = { ACTOR_EN_FU, ACTORCAT_NPC, @@ -83,10 +75,10 @@ static Vec3f D_80964B18 = { 0.0f, 55.0f, 12.0f }; static Vec3f D_80964B24 = { 0.0f, 60.0f, 0.0f }; static ActorAnimationEntry sAnimations[] = { - { &D_060053E0, 1.0f, 0.0f, 0.0f, 0, -4.0f }, { &D_06001F74, 1.0f, 0.0f, 0.0f, 0, -4.0f }, - { &D_06002F64, 1.0f, 0.0f, 0.0f, 0, -4.0f }, { &D_06004904, 1.0f, 0.0f, 0.0f, 0, 0.0f }, - { &D_06005304, 1.0f, 0.0f, 0.0f, 0, -8.0f }, { &D_06005304, 1.0f, 0.0f, 0.0f, 0, 0.0f }, - { &D_0600BAC4, 1.0f, 0.0f, 0.0f, 2, 0.0f }, + { &object_mu_Anim_0053E0, 1.0f, 0.0f, 0.0f, 0, -4.0f }, { &object_mu_Anim_001F74, 1.0f, 0.0f, 0.0f, 0, -4.0f }, + { &object_mu_Anim_002F64, 1.0f, 0.0f, 0.0f, 0, -4.0f }, { &object_mu_Anim_004904, 1.0f, 0.0f, 0.0f, 0, 0.0f }, + { &object_mu_Anim_005304, 1.0f, 0.0f, 0.0f, 0, -8.0f }, { &object_mu_Anim_005304, 1.0f, 0.0f, 0.0f, 0, 0.0f }, + { &object_mu_Anim_00BAC4, 1.0f, 0.0f, 0.0f, 2, 0.0f }, }; static ColliderCylinderInit sCylinderInit = { @@ -200,8 +192,8 @@ void EnFu_Init(Actor* thisx, GlobalContext* globalCtx) { if (fuKaiten != NULL) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600B2B0, &D_06001F74, this->jointTable, this->morphTable, - 21); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_mu_Skel_00B2B0, &object_mu_Anim_001F74, + this->jointTable, this->morphTable, 21); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); this->actor.colChkInfo.mass = MASS_IMMOVABLE; @@ -641,10 +633,10 @@ void func_80962A10(EnFu* this, GlobalContext* globalCtx) { BgFuKaiten* fuKaiten = (BgFuKaiten*)this->actor.child; this->unk_53C = 0; - if ((fuKaiten->rotationSpeed < 300) || (fuKaiten->bouceHeight < 40.0f) || (fuKaiten->bounceSpeed < 600)) { + if ((fuKaiten->rotationSpeed < 300) || (fuKaiten->bounceHeight < 40.0f) || (fuKaiten->bounceSpeed < 600)) { Math_SmoothStepToS(&fuKaiten->rotationSpeed, 300, 10, 5, 5); Math_SmoothStepToS(&fuKaiten->bounceSpeed, 600, 20, 10, 10); - Math_SmoothStepToF(&fuKaiten->bouceHeight, 40.0f, 0.1f, 1.0f, 1.0f); + Math_SmoothStepToF(&fuKaiten->bounceHeight, 40.0f, 0.1f, 1.0f, 1.0f); return; } @@ -678,11 +670,11 @@ void func_80962BCC(EnFu* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); BgFuKaiten* fuKaiten = (BgFuKaiten*)this->actor.child; - if ((fuKaiten->rotationSpeed < 100) || (fuKaiten->bouceHeight < 30.0f) || (fuKaiten->bounceSpeed < 600)) { + if ((fuKaiten->rotationSpeed < 100) || (fuKaiten->bounceHeight < 30.0f) || (fuKaiten->bounceSpeed < 600)) { Math_SmoothStepToS(&fuKaiten->rotationSpeed, 100, 10, 5, 5); Math_SmoothStepToS(&fuKaiten->bounceSpeed, 600, 20, 10, 10); Math_SmoothStepToF(&fuKaiten->elevation, 10.0f, 0.1f, 1.0f, 1.0f); - Math_SmoothStepToF(&fuKaiten->bouceHeight, 30.0f, 0.1f, 1.0f, 1.0f); + Math_SmoothStepToF(&fuKaiten->bounceHeight, 30.0f, 0.1f, 1.0f, 1.0f); return; } @@ -710,10 +702,10 @@ void func_80962D60(EnFu* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); BgFuKaiten* fuKaiten = (BgFuKaiten*)this->actor.child; - if ((fuKaiten->rotationSpeed < 100) || (fuKaiten->bouceHeight < 40.0f) || (fuKaiten->bounceSpeed < 600)) { + if ((fuKaiten->rotationSpeed < 100) || (fuKaiten->bounceHeight < 40.0f) || (fuKaiten->bounceSpeed < 600)) { Math_SmoothStepToS(&fuKaiten->rotationSpeed, 100, 10, 5, 5); Math_SmoothStepToS(&fuKaiten->bounceSpeed, 600, 20, 10, 10); - Math_SmoothStepToF(&fuKaiten->bouceHeight, 40.0f, 0.1f, 1.0f, 1.0f); + Math_SmoothStepToF(&fuKaiten->bounceHeight, 40.0f, 0.1f, 1.0f, 1.0f); return; } @@ -858,11 +850,11 @@ void func_80963350(EnFu* this, GlobalContext* globalCtx) { D_80964C24 = 1; } - if ((fuKaiten->rotationSpeed != 0) || (fuKaiten->bounceSpeed != 0) || (fuKaiten->bouceHeight > 0.0f) || + if ((fuKaiten->rotationSpeed != 0) || (fuKaiten->bounceSpeed != 0) || (fuKaiten->bounceHeight > 0.0f) || !func_809638F8(globalCtx)) { Math_SmoothStepToS(&fuKaiten->rotationSpeed, 0, 10, 10, 5); Math_SmoothStepToS(&fuKaiten->bounceSpeed, 0, 10, 15, 5); - Math_SmoothStepToF(&fuKaiten->bouceHeight, 0.0f, 0.1f, 1.0f, 1.0f); + Math_SmoothStepToF(&fuKaiten->bounceHeight, 0.0f, 0.1f, 1.0f, 1.0f); Math_SmoothStepToF(&fuKaiten->elevation, 0.0f, 0.1f, 1.0f, 1.0f); func_80962EBC(this, globalCtx); } else if (D_80964C24 == 1) { @@ -1459,17 +1451,17 @@ void func_80964950(GlobalContext* globalCtx, EnFuUnkStruct* ptr, s32 len) { for (i = 0; i < len; i++, ptr++) { if (ptr->unk_36 == 1) { if (!flag) { - gSPDisplayList(POLY_OPA_DISP++, D_0600B0A0); + gSPDisplayList(POLY_OPA_DISP++, object_mu_DL_00B0A0); flag = true; } Matrix_InsertTranslation(ptr->unk_08.x, ptr->unk_08.y, ptr->unk_08.z, MTXMODE_NEW); Matrix_NormalizeXYZ(&globalCtx->billboardMtxF); Matrix_Scale(ptr->unk_00, ptr->unk_00, ptr->unk_00, MTXMODE_APPLY); - gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(&D_0405E6F0)); + gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(gameplay_keep_Tex_05E6F0)); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, D_0600B0E0); + gSPDisplayList(POLY_OPA_DISP++, object_mu_DL_00B0E0); } } diff --git a/src/overlays/actors/ovl_En_Geg/z_en_geg.c b/src/overlays/actors/ovl_En_Geg/z_en_geg.c index 28c585b40..2a68ceed9 100644 --- a/src/overlays/actors/ovl_En_Geg/z_en_geg.c +++ b/src/overlays/actors/ovl_En_Geg/z_en_geg.c @@ -277,7 +277,7 @@ u8 func_80BB1B14(EnGeg* this, GlobalContext* globalCtx) { return 0; } - if (((EnBom*)explosive)->unk_1F9 == 0) { + if (((EnBom*)explosive)->isPowderKeg == 0) { return 2; } @@ -1025,10 +1025,10 @@ void EnGeg_TransformLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thi void func_80BB3BE0(EnGeg* this, GlobalContext* globalCtx) { static TexturePtr D_80BB4088[] = { - &object_oF1d_map_Tex_010438, - &object_oF1d_map_Tex_010C38, - &object_oF1d_map_Tex_011038, - &object_oF1d_map_Tex_010838, + object_oF1d_map_Tex_010438, + object_oF1d_map_Tex_010C38, + object_oF1d_map_Tex_011038, + object_oF1d_map_Tex_010838, }; s32 pad; diff --git a/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.c b/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.c index dfdde559a..47af78169 100644 --- a/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.c +++ b/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.c @@ -5,6 +5,7 @@ */ #include "z_en_ginko_man.h" +#include "objects/object_boj/object_boj.h" #define FLAGS 0x00000009 @@ -29,14 +30,6 @@ void EnGinkoMan_Stamp(EnGinkoMan* this, GlobalContext* globalCtx); void EnGinkoMan_Dialogue(EnGinkoMan* this, GlobalContext* globalCtx); void EnGinkoMan_SwitchAnimation(EnGinkoMan* this, GlobalContext* globalCtx); -extern FlexSkeletonHeader D_0600C240; // object_ginko_skeleton -extern Gfx D_0600B1D8[]; // object_ginko_limb15_dlist -extern AnimationHeader D_060008C0; // object_ginko_floorsmacking_anim -extern AnimationHeader D_060043F0; // object_ginko_sitting_anim -extern AnimationHeader D_06004A7C; // object_ginko_amazed_anim -extern AnimationHeader D_06004F40; // object_ginko_stamp_reach_anim -extern AnimationHeader D_06000AC4; // object_ginko_advertising_anim - const ActorInit En_Ginko_Man_InitVars = { ACTOR_EN_GINKO_MAN, ACTORCAT_NPC, @@ -50,11 +43,11 @@ const ActorInit En_Ginko_Man_InitVars = { }; ActorAnimationEntry animations[] = { - { &D_060008C0, 1.0f, 0.0f, 0.0f, 0, -4.0f }, - { &D_060043F0, 1.0f, 0.0f, 0.0f, 0, -4.0f }, - { &D_06004F40, 1.0f, 0.0f, 0.0f, 2, -4.0f }, - { &D_06000AC4, 1.0f, 0.0f, 0.0f, 0, -4.0f }, // looking around for customers - { &D_06004A7C, 1.0f, 0.0f, 0.0f, 0, -4.0f }, + { &object_boj_Anim_0008C0, 1.0f, 0.0f, 0.0f, 0, -4.0f }, + { &object_boj_Anim_0043F0, 1.0f, 0.0f, 0.0f, 0, -4.0f }, + { &object_boj_Anim_004F40, 1.0f, 0.0f, 0.0f, 2, -4.0f }, + { &object_boj_Anim_000AC4, 1.0f, 0.0f, 0.0f, 0, -4.0f }, // looking around for customers + { &object_boj_Anim_004A7C, 1.0f, 0.0f, 0.0f, 0, -4.0f }, }; void EnGinkoMan_Init(Actor* thisx, GlobalContext* globalCtx) { @@ -69,7 +62,8 @@ void EnGinkoMan_Init(Actor* thisx, GlobalContext* globalCtx) { this->isStampChecked = false; this->choiceDepositWithdrawl = GINKOMAN_CHOICE_RESET; this->serviceFee = 0; - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600C240, &D_060043F0, this->jointTable, this->morphTable, 16); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_boj_Skel_00C240, &object_boj_Anim_0043F0, this->jointTable, + this->morphTable, 16); EnGinkoMan_SetupIdle(this); } @@ -502,7 +496,8 @@ void EnGinkoMan_Dialogue(EnGinkoMan* this, GlobalContext* globalCtx) { break; } - if ((this->skelAnime.animation == &D_060008C0) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { + if ((this->skelAnime.animation == &object_boj_Anim_0008C0) && + Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BANK_MAN_HAND_HIT); } } @@ -602,12 +597,12 @@ void EnGinkoMan_Stamp(EnGinkoMan* this, GlobalContext* globalCtx) { void EnGinkoMan_SwitchAnimation(EnGinkoMan* this, GlobalContext* globalCtx) { if (this->actor.xzDistToPlayer > 160.0f) { if (this->animTimer == 0) { - if (this->skelAnime.animation != &D_06004A7C) { + if (this->skelAnime.animation != &object_boj_Anim_004A7C) { this->animTimer = 40; Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_ADVERTISING); } } - } else if ((this->animTimer == 0) && (this->skelAnime.animation != &D_06000AC4)) { + } else if ((this->animTimer == 0) && (this->skelAnime.animation != &object_boj_Anim_000AC4)) { this->animTimer = 40; Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_AMAZED); } @@ -617,7 +612,7 @@ void EnGinkoMan_SwitchAnimation(EnGinkoMan* this, GlobalContext* globalCtx) { void EnGinkoMan_FacePlayer(EnGinkoMan* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); - if (this->skelAnime.animation != &D_06004A7C) { + if (this->skelAnime.animation != &object_boj_Anim_004A7C) { func_800E9250(globalCtx, &this->actor, &this->limb15Rot, &this->limb8Rot, this->actor.focus.pos); } else { func_800E8F08(&this->limb15Rot, &this->limb8Rot); @@ -638,7 +633,7 @@ s32 EnGinkoMan_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** d EnGinkoMan* this = THIS; if (limbIndex == 15) { - *dList = D_0600B1D8; + *dList = object_boj_DL_00B1D8; } if (limbIndex == 15) { diff --git a/src/overlays/actors/ovl_En_Gm/z_en_gm.c b/src/overlays/actors/ovl_En_Gm/z_en_gm.c index 4271434ce..2e3d20e9e 100644 --- a/src/overlays/actors/ovl_En_Gm/z_en_gm.c +++ b/src/overlays/actors/ovl_En_Gm/z_en_gm.c @@ -6,6 +6,7 @@ #include "z_en_gm.h" #include "overlays/actors/ovl_En_Door/z_en_door.h" +#include "objects/object_in2/object_in2.h" #define FLAGS 0x00000019 @@ -19,25 +20,6 @@ void EnGm_Draw(Actor* thisx, GlobalContext* globalCtx); void func_80950CDC(EnGm* this, GlobalContext* globalCtx); void func_80950DB8(EnGm* this, GlobalContext* globalCtx); -extern UNK_PTR D_06005028; -extern UNK_PTR D_060054A8; -extern UNK_PTR D_06005CE8; -extern UNK_PTR D_06006828; -extern UNK_PTR D_06006C68; -extern Gfx D_06007528[]; -extern FlexSkeletonHeader D_060078B0; -extern AnimationHeader D_06008090; -extern AnimationHeader D_0600898C; -extern AnimationHeader D_06009450; -extern AnimationHeader D_06009CDC; -extern AnimationHeader D_0600A5E0; -extern AnimationHeader D_0600A70C; -extern AnimationHeader D_0600AD18; -extern AnimationHeader D_0600B8B0; -extern AnimationHeader D_0600B990; -extern AnimationHeader D_0600BA80; -extern AnimationHeader D_0600C03C; - static u32 D_80951820[] = { 0x0D000101, 0x360A0061, 0x25020600, 0x09001902, 0x0900090A, 0x0D02090A, 0x090F0105, 0x0E090A09, 0x0F0F0E09, 0x00090A18, 0x0E060009, 0x00060A00, 0x6C490209, 0x0A090F3D, 0x02090F0A, 0x0031020A, 0x000A0525, 0x020C0F0C, @@ -147,11 +129,13 @@ static ColliderSphereInit sSphereInit = { static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; static ActorAnimationEntryS D_80951CC0[13] = { - { &D_06009CDC, 1.0f, 0, -1, 0, 0 }, { &D_06009CDC, 1.0f, 0, -1, 0, -4 }, { &D_0600A5E0, 1.0f, 0, -1, 0, 0 }, - { &D_0600A70C, 1.0f, 0, 1, 0, 0 }, { &D_06008090, 1.0f, 0, -1, 0, 0 }, { &D_0600898C, 1.0f, 0, -1, 2, -4 }, - { &D_06009450, 1.0f, 0, -1, 2, -4 }, { &D_0600AD18, 1.0f, 0, -1, 0, 0 }, { &D_0600AD18, 1.0f, 0, -1, 0, -4 }, - { &D_0600B8B0, 1.0f, 0, -1, 2, 0 }, { &D_0600BA80, 1.0f, 0, -1, 0, -4 }, { &D_0600C03C, 1.0f, 0, -1, 0, -4 }, - { &D_0600B990, 1.0f, 0, -1, 0, -4 }, + { &object_in2_Anim_009CDC, 1.0f, 0, -1, 0, 0 }, { &object_in2_Anim_009CDC, 1.0f, 0, -1, 0, -4 }, + { &object_in2_Anim_00A5E0, 1.0f, 0, -1, 0, 0 }, { &object_in2_Anim_00A70C, 1.0f, 0, 1, 0, 0 }, + { &object_in2_Anim_008090, 1.0f, 0, -1, 0, 0 }, { &object_in2_Anim_00898C, 1.0f, 0, -1, 2, -4 }, + { &object_in2_Anim_009450, 1.0f, 0, -1, 2, -4 }, { &object_in2_Anim_00AD18, 1.0f, 0, -1, 0, 0 }, + { &object_in2_Anim_00AD18, 1.0f, 0, -1, 0, -4 }, { &object_in2_Anim_00B8B0, 1.0f, 0, -1, 2, 0 }, + { &object_in2_Anim_00BA80, 1.0f, 0, -1, 0, -4 }, { &object_in2_Anim_00C03C, 1.0f, 0, -1, 0, -4 }, + { &object_in2_Anim_00B990, 1.0f, 0, -1, 0, -4 }, }; Actor* func_8094DEE0(EnGm* this, GlobalContext* globalCtx, u8 arg2, s16 arg3) { @@ -1598,7 +1582,8 @@ void EnGm_Init(Actor* thisx, GlobalContext* globalCtx) { } ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 22.0f); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060078B0, NULL, this->jointTable, this->morphTable, 20); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_in2_Skel_0078B0, NULL, this->jointTable, this->morphTable, + 20); this->unk_3E8 = -1; func_8094E054(this, globalCtx, 0); Collider_InitAndSetCylinder(globalCtx, &this->colliderCylinder, &this->actor, &sCylinderInit); @@ -1699,7 +1684,7 @@ void EnGm_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec OPEN_DISPS(globalCtx->state.gfxCtx); if ((limbIndex == 15) && (this->unk_3A4 & 0x800)) { - gSPDisplayList(POLY_OPA_DISP++, D_06007528); + gSPDisplayList(POLY_OPA_DISP++, object_in2_DL_007528); } CLOSE_DISPS(globalCtx->state.gfxCtx); @@ -1752,7 +1737,8 @@ void EnGm_TransformLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* this } void EnGm_Draw(Actor* thisx, GlobalContext* globalCtx) { - static UNK_PTR D_80951E30[] = { &D_060054A8, &D_06005028, &D_06006828, &D_06005028, &D_06005CE8, &D_06006C68 }; + static TexturePtr D_80951E30[] = { object_in2_Tex_0054A8, object_in2_Tex_005028, object_in2_Tex_006828, + object_in2_Tex_005028, object_in2_Tex_005CE8, object_in2_Tex_006C68 }; EnGm* this = THIS; if ((this->unk_258 != 0) && (this->unk_262 >= 0)) { diff --git a/src/overlays/actors/ovl_En_Go/z_en_go.c b/src/overlays/actors/ovl_En_Go/z_en_go.c index 983691eab..8b6202543 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -290,8 +290,7 @@ void func_80A1143C(EnGoStruct ptr[], Vec3f arg1, Vec3f arg2, Vec3f arg3, f32 arg void func_80A115B4(EnGoStruct ptr[], GlobalContext* globalCtx) { static TexturePtr D_80A16644[] = { - &gameplay_keep_Tex_08F7E0, &gameplay_keep_Tex_08F3E0, &gameplay_keep_Tex_08EFE0, &gameplay_keep_Tex_08EBE0, - &gameplay_keep_Tex_08E7E0, &gameplay_keep_Tex_08E3E0, &gameplay_keep_Tex_08DFE0, &gameplay_keep_Tex_08DBE0, + &gDust8Tex, &gDust7Tex, &gDust6Tex, &gDust5Tex, &gDust4Tex, &gDust3Tex, &gDust2Tex, &gDust1Tex, }; static Color_RGBA8 D_80A16664[] = { { 255, 255, 255, 0 }, @@ -2045,8 +2044,8 @@ void EnGo_TransfromLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* this void func_80A15FEC(Actor* thisx, GlobalContext* globalCtx) { static TexturePtr D_80A1670C[] = { - &object_oF1d_map_Tex_010438, &object_oF1d_map_Tex_010C38, &object_oF1d_map_Tex_011038, - &object_oF1d_map_Tex_010C38, &object_oF1d_map_Tex_010838, + object_oF1d_map_Tex_010438, object_oF1d_map_Tex_010C38, object_oF1d_map_Tex_011038, + object_oF1d_map_Tex_010C38, object_oF1d_map_Tex_010838, }; EnGo* this = THIS; diff --git a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c index 7fbf4213f..8905b116c 100644 --- a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c +++ b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c @@ -5,6 +5,8 @@ */ #include "z_en_goroiwa.h" +#include "objects/object_goroiwa/object_goroiwa.h" +#include "objects/gameplay_keep/gameplay_keep.h" #define FLAGS 0x80000010 @@ -30,21 +32,6 @@ void func_80941FA4(EnGoroiwa* this, GlobalContext* globalCtx); void func_80942084(EnGoroiwa* this); void func_809420F0(EnGoroiwa* this, GlobalContext* globalCtx); -extern Gfx D_060032E0[]; -extern Gfx D_060082D0[]; -extern Gfx D_06005C20[]; -extern Gfx D_06003B40[]; -extern Gfx D_06008B90[]; -extern Gfx D_060042B0[]; -extern Gfx D_06004960[]; -extern Gfx D_06004EF0[]; -extern Gfx D_060003B0[]; -extern Gfx D_060028E0[]; -extern Gfx D_06002D70[]; -extern Gfx D_060072F0[]; -extern Gfx D_060077D0[]; -extern Gfx D_06007C60[]; - const ActorInit En_Goroiwa_InitVars = { ACTOR_EN_GOROIWA, ACTORCAT_PROP, @@ -94,9 +81,9 @@ static f32 D_80942DFC[] = { }; static Gfx* D_80942E0C[][3] = { - { D_060042B0, D_06004960, D_06004EF0 }, - { D_060003B0, D_060028E0, D_06002D70 }, - { D_060072F0, D_060077D0, D_06007C60 }, + { object_goroiwa_DL_0042B0, object_goroiwa_DL_004960, object_goroiwa_DL_004EF0 }, + { object_goroiwa_DL_0003B0, object_goroiwa_DL_0028E0, object_goroiwa_DL_002D70 }, + { object_goroiwa_DL_0072F0, object_goroiwa_DL_0077D0, object_goroiwa_DL_007C60 }, }; static Color_RGBA8 D_80942E30[] = { @@ -1577,9 +1564,9 @@ void func_80942B1C(EnGoroiwa* this, GlobalContext* globalCtx) { Vec3s sp80; if (params == ENGOROIWA_C000_1) { - phi_fp = D_060032E0; + phi_fp = object_goroiwa_DL_0032E0; } else { - phi_fp = D_060082D0; + phi_fp = object_goroiwa_DL_0082D0; } for (i = 0; i < ARRAY_COUNT(this->unk_1E8); i++) { @@ -1609,7 +1596,7 @@ void func_80942B1C(EnGoroiwa* this, GlobalContext* globalCtx) { gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_XLU_DISP++, D_04076BC0); + gSPDisplayList(POLY_XLU_DISP++, gCircleShadowDL); CLOSE_DISPS(globalCtx->state.gfxCtx); } @@ -1619,9 +1606,9 @@ void func_80942B1C(EnGoroiwa* this, GlobalContext* globalCtx) { void EnGoroiwa_Draw(Actor* thisx, GlobalContext* globalCtx) { static Gfx* D_80942EB4[] = { - D_06005C20, - D_06003B40, - D_06008B90, + object_goroiwa_DL_005C20, + object_goroiwa_DL_003B40, + object_goroiwa_DL_008B90, }; EnGoroiwa* this = THIS; s32 params = ENGOROIWA_GET_C000(&this->actor); diff --git a/src/overlays/actors/ovl_En_Gs/z_en_gs.c b/src/overlays/actors/ovl_En_Gs/z_en_gs.c index b50d9b08b..dd28ab8e2 100644 --- a/src/overlays/actors/ovl_En_Gs/z_en_gs.c +++ b/src/overlays/actors/ovl_En_Gs/z_en_gs.c @@ -5,6 +5,7 @@ */ #include "z_en_gs.h" +#include "objects/object_gs/object_gs.h" #include "objects/gameplay_keep/gameplay_keep.h" #define FLAGS 0x02000019 @@ -36,10 +37,6 @@ s32 func_809995A4(EnGs* this, GlobalContext* globalCtx); void func_80999A8C(EnGs* this, GlobalContext* globalCtx); void func_80999AC0(EnGs* this); -extern Gfx D_06000950[]; -extern Gfx D_060009D0[]; -extern Gfx D_06000A60[]; - const ActorInit En_Gs_InitVars = { ACTOR_EN_GS, ACTORCAT_PROP, @@ -1085,10 +1082,10 @@ void EnGs_Draw(Actor* thisx, GlobalContext* globalCtx) { } gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, D_06000950); + gSPDisplayList(POLY_OPA_DISP++, object_gs_DL_000950); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, this->unk_1FA.r, this->unk_1FA.g, this->unk_1FA.b, 255); - gSPDisplayList(POLY_OPA_DISP++, D_060009D0); - gSPDisplayList(POLY_OPA_DISP++, D_06000A60); + gSPDisplayList(POLY_OPA_DISP++, object_gs_DL_0009D0); + gSPDisplayList(POLY_OPA_DISP++, object_gs_DL_000A60); Matrix_StatePop(); diff --git a/src/overlays/actors/ovl_En_Guruguru/z_en_guruguru.c b/src/overlays/actors/ovl_En_Guruguru/z_en_guruguru.c index cb788f196..51bb967c0 100644 --- a/src/overlays/actors/ovl_En_Guruguru/z_en_guruguru.c +++ b/src/overlays/actors/ovl_En_Guruguru/z_en_guruguru.c @@ -5,6 +5,7 @@ */ #include "z_en_guruguru.h" +#include "objects/object_fu/object_fu.h" #define FLAGS 0x00000019 @@ -24,15 +25,7 @@ void func_80BC73F4(EnGuruguru* this); void func_80BC7440(EnGuruguru* this, GlobalContext* globalCtx); void func_80BC7520(EnGuruguru* this, GlobalContext* globalCtx); -extern FlexSkeletonHeader D_06006C90; extern ColliderCylinderInit D_80BC79A0; -extern AnimationHeader D_06000B04; -extern AnimationHeader D_0600057C; - -extern u64 D_06005F20[]; -extern u64 D_06006320[]; -extern u64 D_06006720[]; -extern u64 D_06006920[]; const ActorInit En_Guruguru_InitVars = { ACTOR_EN_GURUGURU, @@ -69,18 +62,19 @@ static ColliderCylinderInit sCylinderInit = { { 15, 20, 0, { 0, 0, 0 } }, }; -static AnimationHeader* D_80BC79CC[] = { &D_06000B04, &D_0600057C }; +static AnimationHeader* D_80BC79CC[] = { &object_fu_Anim_000B04, &object_fu_Anim_00057C }; static u8 D_80BC79D4[] = { 0 }; static f32 D_80BC79D8[] = { 1.0f, 1.0f }; -static void* sEyeTextures[] = { D_06005F20, D_06006320 }; -static void* sMouthTextures[] = { D_06006720, D_06006920 }; +static TexturePtr sEyeTextures[] = { object_fu_Tex_005F20, object_fu_Tex_006320 }; +static TexturePtr sMouthTextures[] = { object_fu_Tex_006720, object_fu_Tex_006920 }; void EnGuruguru_Init(Actor* thisx, GlobalContext* globalCtx) { EnGuruguru* this = THIS; this->actor.colChkInfo.mass = MASS_IMMOVABLE; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 19.0f); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06006C90, &D_06000B04, this->jointTable, this->morphTable, 16); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_fu_Skel_006C90, &object_fu_Anim_000B04, this->jointTable, + this->morphTable, 16); this->actor.targetMode = 0; if (this->actor.params != 2) { Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); diff --git a/src/overlays/actors/ovl_En_Hakurock/z_en_hakurock.c b/src/overlays/actors/ovl_En_Hakurock/z_en_hakurock.c index 416ab1140..1e4da23ea 100644 --- a/src/overlays/actors/ovl_En_Hakurock/z_en_hakurock.c +++ b/src/overlays/actors/ovl_En_Hakurock/z_en_hakurock.c @@ -6,6 +6,8 @@ #include "z_en_hakurock.h" #include "overlays/actors/ovl_Boss_Hakugin/z_boss_hakugin.h" +#include "objects/gameplay_keep/gameplay_keep.h" +#include "objects/object_boss_hakugin/object_boss_hakugin.h" #define FLAGS 0x00000030 @@ -64,10 +66,7 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit sColChkInfoInit = { 0, 60, 60, MASS_IMMOVABLE }; -extern Gfx D_06011100[]; - // Stalactite -extern Gfx D_06011178[]; void EnHakurock_Init(Actor* thisx, GlobalContext* globalCtx) { EnHakurock* this = THIS; @@ -344,7 +343,7 @@ void func_80B228F4(Actor* thisx, GlobalContext* globalCtx) { func_8012C28C(globalCtx->state.gfxCtx); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0x80, 255, 185, 24, 255); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, &D_0406AB30); + gSPDisplayList(POLY_OPA_DISP++, gameplay_keep_DL_06AB30); CLOSE_DISPS(globalCtx->state.gfxCtx); } @@ -353,7 +352,7 @@ void EnHakurock_Draw(Actor* thisx, GlobalContext* globalCtx) { func_8012C28C(globalCtx->state.gfxCtx); Matrix_InsertTranslation(-100.0f, 0.0f, 0.0f, MTXMODE_APPLY); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, D_06011100); - gSPDisplayList(POLY_OPA_DISP++, D_06011178); + gSPDisplayList(POLY_OPA_DISP++, object_boss_hakugin_DL_011100); + gSPDisplayList(POLY_OPA_DISP++, object_boss_hakugin_DL_011178); CLOSE_DISPS(globalCtx->state.gfxCtx); } diff --git a/src/overlays/actors/ovl_En_Hg/z_en_hg.c b/src/overlays/actors/ovl_En_Hg/z_en_hg.c index fe9936bbc..0728b832d 100644 --- a/src/overlays/actors/ovl_En_Hg/z_en_hg.c +++ b/src/overlays/actors/ovl_En_Hg/z_en_hg.c @@ -5,6 +5,7 @@ */ #include "z_en_hg.h" +#include "objects/object_harfgibud/object_harfgibud.h" #define FLAGS 0x02100019 @@ -30,17 +31,6 @@ void func_80BCF95C(EnHg* this, GlobalContext* globalCtx); s32 EnHg_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx); void EnHg_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx); -extern AnimationHeader D_06000370; -extern AnimationHeader D_06001138; -extern AnimationHeader D_060015D4; -extern AnimationHeader D_06001960; -extern AnimationHeader D_0600260C; -extern Gfx D_06005E28[]; -extern FlexSkeletonHeader D_06008580; -extern AnimationHeader D_06009D44; -extern AnimationHeader D_0600A164; -extern AnimationHeader D_0600AE1C; - const ActorInit En_Hg_InitVars = { ACTOR_EN_HG, ACTORCAT_PROP, @@ -113,10 +103,14 @@ static CollisionCheckInfoInit2 sColChkInfoInit2 = { }; static ActorAnimationEntry sAnimations[] = { - { &D_0600260C, 1.0f, 0.0f, 0.0f, 0, -4.0f }, { &D_06009D44, 1.0f, 0.0f, 0.0f, 0, -4.0f }, - { &D_0600A164, 1.0f, 0.0f, 0.0f, 0, -4.0f }, { &D_06000370, 1.0f, 0.0f, 0.0f, 2, 0.0f }, - { &D_06001138, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &D_060015D4, 1.0f, 0.0f, 0.0f, 2, 0.0f }, - { &D_06001960, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &D_0600AE1C, 1.0f, 0.0f, 0.0f, 0, 0.0f }, + { &object_harfgibud_Anim_00260C, 1.0f, 0.0f, 0.0f, 0, -4.0f }, + { &object_harfgibud_Anim_009D44, 1.0f, 0.0f, 0.0f, 0, -4.0f }, + { &object_harfgibud_Anim_00A164, 1.0f, 0.0f, 0.0f, 0, -4.0f }, + { &object_harfgibud_Anim_000370, 1.0f, 0.0f, 0.0f, 2, 0.0f }, + { &object_harfgibud_Anim_001138, 1.0f, 0.0f, 0.0f, 0, 0.0f }, + { &object_harfgibud_Anim_0015D4, 1.0f, 0.0f, 0.0f, 2, 0.0f }, + { &object_harfgibud_Anim_001960, 1.0f, 0.0f, 0.0f, 0, 0.0f }, + { &object_harfgibud_Anim_00AE1C, 1.0f, 0.0f, 0.0f, 0, 0.0f }, }; static u32 D_80BD00C8 = false; @@ -127,8 +121,8 @@ void EnHg_Init(Actor* thisx, GlobalContext* globalCtx) { s32 i; ActorShape_Init(&this->actor.shape, 0.0f, NULL, 36.0f); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06008580, &D_0600260C, this->jointTable, this->morphTable, - HG_LIMB_MAX); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_harfgibud_Skel_008580, &object_harfgibud_Anim_00260C, + this->jointTable, this->morphTable, HG_LIMB_MAX); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit2); @@ -422,6 +416,6 @@ void EnHg_Draw(Actor* thisx, GlobalContext* globalCtx) { EnHg_OverrideLimbDraw, EnHg_PostLimbDraw, &this->actor); Matrix_SetCurrentState(&this->unk1D8); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, D_06005E28); + gSPDisplayList(POLY_OPA_DISP++, object_harfgibud_DL_005E28); CLOSE_DISPS(globalCtx->state.gfxCtx); } diff --git a/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.c b/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.c index 0807f007d..b6d30391d 100644 --- a/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.c +++ b/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.c @@ -5,8 +5,9 @@ */ #include "z_en_hint_skb.h" +#include "objects/object_skb/object_skb.h" -#define FLAGS 0x00000019 +#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10) #define THIS ((EnHintSkb*)thisx) @@ -15,19 +16,28 @@ void EnHintSkb_Destroy(Actor* thisx, GlobalContext* globalCtx); void EnHintSkb_Update(Actor* thisx, GlobalContext* globalCtx); void EnHintSkb_Draw(Actor* thisx, GlobalContext* globalCtx); +void func_80C1FE0C(EnHintSkb* this); void func_80C1FE20(EnHintSkb* this, GlobalContext* globalCtx); void func_80C1FE80(EnHintSkb* this, GlobalContext* globalCtx); +void func_80C1FF30(EnHintSkb* this); void func_80C1FF88(EnHintSkb* this, GlobalContext* globalCtx); +void func_80C2003C(EnHintSkb* this); void func_80C200B8(EnHintSkb* this, GlobalContext* globalCtx); void func_80C2016C(EnHintSkb* this, GlobalContext* globalCtx); void func_80C20334(EnHintSkb* this, GlobalContext* globalCtx); +void func_80C20484(EnHintSkb* this); void func_80C204F0(EnHintSkb* this, GlobalContext* globalCtx); void func_80C20590(EnHintSkb* this, GlobalContext* globalCtx); void func_80C2069C(EnHintSkb* this, GlobalContext* globalCtx); void func_80C2077C(EnHintSkb* this, GlobalContext* globalCtx); +void func_80C208BC(EnHintSkb* this); void func_80C208D0(EnHintSkb* this, GlobalContext* globalCtx); +void func_80C20B88(EnHintSkb* this, GlobalContext* globalCtx); +void func_80C20C24(EnHintSkb* this, GlobalContext* globalCtx); +s32 func_80C21414(EnHintSkb* this); +void func_80C21468(EnHintSkb* this, GlobalContext* globalCtx); +void func_80C215E4(GlobalContext* globalCtx, EnHintSkb* this, Vec3f* arg2); -#if 0 const ActorInit En_Hint_Skb_InitVars = { ACTOR_EN_HINT_SKB, ACTORCAT_NPC, @@ -40,29 +50,47 @@ const ActorInit En_Hint_Skb_InitVars = { (ActorFunc)EnHintSkb_Draw, }; -// static ColliderJntSphElementInit sJntSphElementsInit[2] = { -static ColliderJntSphElementInit D_80C21C80[2] = { +static ColliderJntSphElementInit sJntSphElementsInit[2] = { { - { ELEMTYPE_UNK0, { 0xF7CFFFFF, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, TOUCH_ON | TOUCH_SFX_NORMAL, BUMP_NONE, OCELEM_NONE, }, + { + ELEMTYPE_UNK0, + { 0xF7CFFFFF, 0x00, 0x04 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_NONE, + }, { 15, { { 0, 0, 0 }, 10 }, 100 }, }, { - { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON | BUMP_HOOKABLE, OCELEM_ON, }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xF7CFFFFF, 0x00, 0x00 }, + TOUCH_NONE | TOUCH_SFX_NORMAL, + BUMP_ON | BUMP_HOOKABLE, + OCELEM_ON, + }, { 1, { { 0, 0, 0 }, 20 }, 100 }, }, }; -// static ColliderJntSphInit sJntSphInit = { -static ColliderJntSphInit D_80C21CC8 = { - { COLTYPE_HIT6, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_JNTSPH, }, - 2, D_80C21C80, // sJntSphElementsInit, +static ColliderJntSphInit sJntSphInit = { + { + COLTYPE_HIT6, + AT_ON | AT_TYPE_ENEMY, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_JNTSPH, + }, + 2, + sJntSphElementsInit, }; -// sColChkInfoInit -static CollisionCheckInfoInit2 D_80C21CD8 = { 2, 0, 0, 0, MASS_IMMOVABLE }; +static CollisionCheckInfoInit2 sColChkInfoInit = { 2, 0, 0, 0, MASS_IMMOVABLE }; -// static DamageTable sDamageTable = { -static DamageTable D_80C21CE4 = { +static DamageTable sDamageTable = { /* Deku Nut */ DMG_ENTRY(0, 0x1), /* Deku Stick */ DMG_ENTRY(1, 0xD), /* Horse trample */ DMG_ENTRY(0, 0x0), @@ -97,96 +125,781 @@ static DamageTable D_80C21CE4 = { /* Powder Keg */ DMG_ENTRY(1, 0xF), }; -// static InitChainEntry sInitChain[] = { -static InitChainEntry D_80C21E3C[] = { +static ActorAnimationEntry sAnimations[] = { + { &object_skb_Anim_0064E0, 0.96f, 0.0f, 0.0f, 0, -4.0f }, { &object_skb_Anim_003584, 1.0f, 0.0f, 0.0f, 2, -1.0f }, + { &object_skb_Anim_002190, 0.6f, 0.0f, 0.0f, 3, 4.0f }, { &object_skb_Anim_002AC8, 1.0f, 0.0f, 0.0f, 2, -4.0f }, + { &object_skb_Anim_00270C, 1.0f, 0.0f, 0.0f, 2, -4.0f }, { &object_skb_Anim_00697C, 1.0f, 0.0f, 0.0f, 0, -4.0f }, + { &object_skb_Anim_006D90, 1.0f, 0.0f, 0.0f, 0, -4.0f }, { &object_skb_Anim_001D1C, 1.0f, 0.0f, 0.0f, 0, -4.0f }, + { &object_skb_Anim_003584, 1.0f, 0.0f, 0.0f, 2, -8.0f }, { &object_skb_Anim_003584, 1.0f, 0.0f, 0.0f, 2, -16.0f }, + { &object_skb_Anim_002AC8, 1.0f, 0.0f, 0.0f, 2, -8.0f }, { &object_skb_Anim_0015EC, 1.0f, 0.0f, 0.0f, 2, -8.0f }, + { &object_skb_Anim_0009E4, 1.0f, 0.0f, 0.0f, 0, -8.0f }, +}; + +static InitChainEntry sInitChain[] = { ICHAIN_F32(targetArrowOffset, 2000, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -2000, ICHAIN_STOP), }; -#endif +void EnHintSkb_Init(Actor* thisx, GlobalContext* globalCtx) { + s32 pad; + EnHintSkb* this = THIS; -extern ColliderJntSphElementInit D_80C21C80[2]; -extern ColliderJntSphInit D_80C21CC8; -extern CollisionCheckInfoInit2 D_80C21CD8; -extern DamageTable D_80C21CE4; -extern InitChainEntry D_80C21E3C[]; + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f); + SkelAnime_Init(globalCtx, &this->skelAnime, &object_skb_Skel_005EF8, &object_skb_Anim_00697C, this->jointTable, + this->morphtable, 20); + Collider_InitJntSph(globalCtx, &this->collider); + Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, this->colliderElement); + CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); + Actor_ProcessInitChain(&this->actor, sInitChain); + this->actor.hintId = 0x55; + this->unk_3E4 = 0; + this->unk_3DE = 0; + this->unk_3E0 = 0; + this->unk_3DC = 0; + this->unk_3E9 = 0; + func_80C1FE0C(this); +} -extern UNK_TYPE D_06002190; -extern UNK_TYPE D_06003584; -extern UNK_TYPE D_0600697C; +void EnHintSkb_Destroy(Actor* thisx, GlobalContext* globalCtx) { + EnHintSkb* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/EnHintSkb_Init.s") + Collider_DestroyJntSph(globalCtx, &this->collider); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/EnHintSkb_Destroy.s") +void func_80C1FE0C(EnHintSkb* this) { + this->actionFunc = func_80C1FE20; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C1FE0C.s") +void func_80C1FE20(EnHintSkb* this, GlobalContext* globalCtx) { +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C1FE20.s") +void func_80C1FE30(EnHintSkb* this) { + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 0); + this->actor.speedXZ = 1.6f; + this->actionFunc = func_80C1FE80; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C1FE30.s") +void func_80C1FE80(EnHintSkb* this, GlobalContext* globalCtx) { + if (Animation_OnFrame(&this->skelAnime, 8.0f) || Animation_OnFrame(&this->skelAnime, 15.0f)) { + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_WALK); + } + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 750, 0); + this->actor.world.rot.y = this->actor.shape.rot.y; + if (Actor_IsFacingPlayer(&this->actor, 0x11C7) && (this->actor.xzDistToPlayer < 60.0f)) { + func_80C1FF30(this); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C1FE80.s") +void func_80C1FF30(EnHintSkb* this) { + this->collider.base.atFlags &= ~AT_BOUNCED; + this->actor.speedXZ = 0.0f; + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 2); + this->actionFunc = func_80C1FF88; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C1FF30.s") +void func_80C1FF88(EnHintSkb* this, GlobalContext* globalCtx) { + if (this->collider.base.atFlags & AT_BOUNCED) { + this->collider.base.atFlags &= ~(AT_BOUNCED | AT_HIT); + func_80C2003C(this); + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C1FF88.s") + if (Animation_OnFrame(&this->skelAnime, 3.0f)) { + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_ATTACK); + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C2003C.s") + if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { + if (func_80C21414(this) && (Player_GetMask(globalCtx) != PLAYER_MASK_CAPTAIN)) { + func_80C1FF30(this); + } else { + func_80C1FE30(this); + } + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C200B8.s") +void func_80C2003C(EnHintSkb* this) { + Animation_Change(&this->skelAnime, &object_skb_Anim_002190, -0.4f, this->skelAnime.curFrame - 1.0f, 0.0f, 3, 0.0f); + this->collider.base.atFlags &= ~AT_BOUNCED; + this->actionFunc = func_80C200B8; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C2011C.s") +void func_80C200B8(EnHintSkb* this, GlobalContext* globalCtx) { + if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { + if (func_80C21414(this)) { + func_80C1FF30(this); + } else { + func_80C1FE30(this); + } + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C2016C.s") +void func_80C2011C(EnHintSkb* this) { + if (this->actor.bgCheckFlags & 1) { + this->actor.speedXZ = 0.0f; + } + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + this->actionFunc = func_80C2016C; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C20274.s") +void func_80C2016C(EnHintSkb* this, GlobalContext* globalCtx) { + if (this->actor.bgCheckFlags & 2) { + this->actor.speedXZ = 0.0f; + } else if (this->actor.bgCheckFlags & 1) { + if (this->actor.speedXZ < 0.0f) { + this->actor.speedXZ += 0.05f; + } + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C20334.s") + if ((this->actor.colorFilterTimer == 0) && (this->actor.bgCheckFlags & 1)) { + if (this->actor.colChkInfo.health == 0) { + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 40, NA_SE_EN_STALKID_DEAD); + func_80C20484(this); + } else if (this->skelAnime.animation == &object_skb_Anim_00697C) { + func_80C1FE0C(this); + } else if (func_80C21414(this)) { + func_80C1FF30(this); + } else { + func_80C1FE30(this); + } + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C20484.s") +void func_80C20274(EnHintSkb* this) { + if (this->skelAnime.animation == &object_skb_Anim_00697C) { + this->actor.world.rot.y = this->actor.yawTowardsPlayer; + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 8); + this->actor.gravity = -1.0f; + this->actor.speedXZ = 1.0f; + } else { + this->actor.world.rot.y = this->actor.yawTowardsPlayer; + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3); + if (this->actor.bgCheckFlags & 1) { + this->actor.speedXZ = -4.0f; + } + } + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); + this->actionFunc = func_80C20334; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C204F0.s") +void func_80C20334(EnHintSkb* this, GlobalContext* globalCtx) { + if (this->actor.bgCheckFlags & 2) { + s32 i; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C20540.s") + for (i = 0; i < 10; i++) { + func_80C215E4(globalCtx, this, &this->actor.world.pos); + } + this->actor.speedXZ = 0.0f; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C20590.s") + if (this->actor.bgCheckFlags & 1) { + if (this->actor.speedXZ < 0.0f) { + this->actor.speedXZ += 0.05f; + } else if (this->actor.speedXZ != 0.0f) { + this->actor.speedXZ -= 0.05f; + } + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 2500, 0); + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C2066C.s") + Math_SmoothStepToS(&this->actor.shape.rot.x, 0, 16, 2000, 100); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C2069C.s") + if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame) && (this->actor.bgCheckFlags & 1)) { + this->actor.world.rot = this->actor.shape.rot; + func_80C1FE30(this); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C2075C.s") +void func_80C20484(EnHintSkb* this) { + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 4); + this->unk_3E8 |= 4; + if (this->actor.bgCheckFlags & 1) { + this->actor.speedXZ = -6.0f; + } + this->actionFunc = func_80C204F0; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C2077C.s") +void func_80C204F0(EnHintSkb* this, GlobalContext* globalCtx) { + if (!(this->unk_3E8 & 8)) { + return; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C208BC.s") + Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0x10); + Actor_MarkForDeath(&this->actor); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C208D0.s") +void func_80C20540(EnHintSkb* this) { + if (this->actor.bgCheckFlags & 1) { + this->actor.speedXZ = 0.0f; + } + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE); + this->actionFunc = func_80C20590; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C20A74.s") +void func_80C20590(EnHintSkb* this, GlobalContext* globalCtx) { + if (this->unk_3E2 == 0) { + this->unk_3E2 = 0; + this->unk_2D8 = 0.0f; + this->unk_2D4 = 0.0f; + if (this->actor.colChkInfo.health != 0) { + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); + this->unk_3E8 |= 1; + func_80C20274(this); + } else { + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 40, NA_SE_EN_STALKID_DEAD); + func_80C20484(this); + } + } else if (this->unk_3E2 == 1) { + func_80C21468(this, globalCtx); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C20B88.s") +void func_80C2066C(EnHintSkb* this) { + if (this->actor.bgCheckFlags & 1) { + this->actor.speedXZ = 0.0f; + } + this->actionFunc = func_80C2069C; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C20C24.s") +void func_80C2069C(EnHintSkb* this, GlobalContext* globalCtx) { + if (this->unk_3E2 == 0) { + this->unk_3E2 = 0; + this->unk_2D8 = 0.0f; + this->unk_2D4 = 0.0f; + if (this->actor.colChkInfo.health != 0) { + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); + this->unk_3E8 |= 1; + func_80C20274(this); + } else { + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 40, NA_SE_EN_STALKID_DEAD); + func_80C20484(this); + } + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C20D64.s") +void func_80C2075C(EnHintSkb* this) { + this->unk_3E0 = 0; + this->actor.speedXZ = 0.0f; + this->actionFunc = func_80C2077C; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C20E90.s") +void func_80C2077C(EnHintSkb* this, GlobalContext* globalCtx) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { + this->unk_3E0 = 1; + if (this->unk_3DC == 0) { + this->unk_3DC = 1; + func_801518B0(globalCtx, 0x1147, &this->actor); + this->unk_3E6 = 0x1147; + if (this->skelAnime.animation == &object_skb_Anim_00697C) { + globalCtx->msgCtx.unk11F22 = 0x44; + this->actor.speedXZ = 2.4f; + this->actor.gravity = -1.0f; + this->actor.velocity.y = 3.0f; + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 8); + } + } else { + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 11); + func_801518B0(globalCtx, 0x1148, &this->actor); + this->unk_3E6 = 0x1148; + } + func_80C208BC(this); + } else if ((this->actor.xzDistToPlayer < 100.0f) && !(this->collider.base.acFlags & AC_HIT)) { + func_800B8614(&this->actor, globalCtx, 100.0f); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C21250.s") +void func_80C208BC(EnHintSkb* this) { + this->actionFunc = func_80C208D0; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C21320.s") +void func_80C208D0(EnHintSkb* this, GlobalContext* globalCtx) { + this->unk_3DE = 0; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C21414.s") + switch (Message_GetState(&globalCtx->msgCtx)) { + case 3: + if ((globalCtx->gameplayFrames % 2) != 0) { + this->unk_3DE = 1; + } + break; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C21468.s") + case 4: + func_80C20B88(this, globalCtx); + break; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C215E4.s") + case 5: + func_80C20C24(this, globalCtx); + break; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/EnHintSkb_Update.s") + case 6: + if (func_80147624(globalCtx)) { + func_80C2075C(this); + } + break; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C21858.s") + case 0: + case 1: + case 2: + break; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C219D4.s") + if (this->unk_3E6 == 0x1147) { + if (this->actor.bgCheckFlags & 2) { + s32 i; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/EnHintSkb_Draw.s") + this->actor.speedXZ = 0.0f; + + for (i = 0; i < 10; i++) { + func_80C215E4(globalCtx, this, &this->actor.world.pos); + } + } + + if ((this->skelAnime.animation == &object_skb_Anim_003584) && + Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { + func_801518B0(globalCtx, 0x1147, &this->actor); + this->unk_3E6 = 0x1147; + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 0); + } + } + + if (this->actor.bgCheckFlags & 1) { + Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 5, 0x71C, 0xB6); + this->actor.shape.rot.y = this->actor.world.rot.y; + } +} + +void func_80C20A74(EnHintSkb* this, GlobalContext* globalCtx) { + s32 params = ENHINTSKB_GET_FF(&this->actor); + + switch (params) { + case 1: + func_801518B0(globalCtx, 0x1149, &this->actor); + this->unk_3E6 = 0x1149; + break; + + case 2: + func_801518B0(globalCtx, 0x114A, &this->actor); + this->unk_3E6 = 0x114A; + break; + + case 3: + func_801518B0(globalCtx, 0x114B, &this->actor); + this->unk_3E6 = 0x114B; + break; + + case 4: + func_801518B0(globalCtx, 0x114C, &this->actor); + this->unk_3E6 = 0x114C; + break; + + case 5: + func_801518B0(globalCtx, 0x114D, &this->actor); + this->unk_3E6 = 0x114D; + break; + + case 6: + func_801518B0(globalCtx, 0x114E, &this->actor); + this->unk_3E6 = 0x114E; + break; + + default: + func_801518B0(globalCtx, 0x1149, &this->actor); + this->unk_3E6 = 0x1149; + break; + } +} + +void func_80C20B88(EnHintSkb* this, GlobalContext* globalCtx) { + if (func_80147624(globalCtx)) { + if (globalCtx->msgCtx.choiceIndex == 0) { + func_8019F208(); + this->unk_3E8 |= 0x10; + func_801518B0(globalCtx, 0x1150, &this->actor); + this->unk_3E6 = 0x1150; + } else { + func_8019F230(); + func_801518B0(globalCtx, 0x1152, &this->actor); + this->unk_3E6 = 0x1152; + } + } +} + +void func_80C20C24(EnHintSkb* this, GlobalContext* globalCtx) { + if (!func_80147624(globalCtx)) { + return; + } + + switch (this->unk_3E6) { + case 0x1147: + func_801518B0(globalCtx, 0x1148, &this->actor); + this->unk_3E6 = 0x1148; + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 11); + break; + + case 0x1148: + func_80C20A74(this, globalCtx); + break; + + case 0x1149: + case 0x114A: + case 0x114B: + case 0x114C: + case 0x114D: + case 0x114E: + func_801518B0(globalCtx, 0x114F, &this->actor); + this->unk_3E6 = 0x114F; + break; + + case 0x1152: + func_801518B0(globalCtx, 0x1151, &this->actor); + this->unk_3E6 = 0x1151; + break; + + case 0x1150: + func_801518B0(globalCtx, 0x1151, &this->actor); + this->unk_3E6 = 0x1151; + break; + + case 0x1151: + func_801477B4(globalCtx); + if (this->unk_3E8 & 0x10) { + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 40, NA_SE_EN_STALKID_DEAD); + func_80C20484(this); + } else { + func_80C2075C(this); + } + break; + } +} + +void func_80C20D64(EnHintSkb* this, GlobalContext* globalCtx) { + if ((this->actionFunc == func_80C1FE20) || (this->actionFunc == func_80C2077C) || + (this->actionFunc == func_80C1FE80)) { + if (this->actionFunc != func_80C2077C) { + if (Player_GetMask(globalCtx) == PLAYER_MASK_CAPTAIN) { + this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_4); + this->actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_8); + this->actor.hintId = 255; + this->actor.textId = 0; + if (this->actionFunc == func_80C1FE80) { + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 12); + } + func_80C2075C(this); + } + } else if (Player_GetMask(globalCtx) != PLAYER_MASK_CAPTAIN) { + this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_8); + this->actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_4); + this->actor.hintId = 0x55; + this->actor.textId = 0; + if (this->skelAnime.animation == &object_skb_Anim_00697C) { + func_80C1FE0C(this); + } else { + func_80C1FE30(this); + } + } + } +} + +void func_80C20E90(EnHintSkb* this, GlobalContext* globalCtx) { + Player* player = GET_PLAYER(globalCtx); + + if ((this->actor.bgCheckFlags & 0x60) && (this->actor.depthInWater >= 40.0f)) { + this->actor.colChkInfo.health = 0; + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 40, NA_SE_EN_STALKID_DEAD); + func_80C20484(this); + return; + } + + if (this->collider.base.acFlags & AC_HIT) { + this->collider.base.acFlags &= ~AC_HIT; + if (this->actionFunc == func_80C20590) { + switch (this->actor.colChkInfo.damageEffect) { + case 1: + case 3: + case 4: + case 12: + case 13: + return; + + default: + case 2: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + if (this->unk_3E2 >= 2) { + func_80C21468(this, globalCtx); + } + this->unk_3E2 = 0; + break; + } + } + + if (!Actor_ApplyDamage(&this->actor)) { + if ((this->actor.colChkInfo.damageEffect != 3) && (this->actor.colChkInfo.damageEffect != 4)) { + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 40, NA_SE_EN_STALKID_DEAD); + this->unk_3E8 |= 4; + func_80C20484(this); + return; + } + } + + switch (this->actor.colChkInfo.damageEffect) { + case 11: + this->unk_3E9 = 30; + this->unk_3E2 = 40; + this->unk_2D4 = 1.0f; + this->unk_2D8 = 0.0f; + Actor_SetColorFilter(&this->actor, 0, 120, 0, 40); + func_80C2011C(this); + break; + + case 1: + Actor_SetColorFilter(&this->actor, 0, 120, 0, 40); + func_80C2011C(this); + break; + + case 2: + this->unk_3E2 = 80; + this->unk_3E9 = 0; + this->unk_2D4 = 1.0f; + this->unk_2D8 = 0.0f; + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); + this->unk_3E8 |= 1; + func_80C20274(this); + break; + case 3: + if (this->actor.colChkInfo.health != 0) { + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); + this->unk_3E2 = 80; + } else { + this->unk_3E2 = 3; + } + this->unk_3E9 = 11; + this->unk_2D4 = 1.0f; + this->unk_2D8 = 0.5f; + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); + func_80C20540(this); + break; + case 4: + this->unk_3E2 = 40; + this->unk_3E9 = 20; + this->unk_2D4 = 1.0f; + this->unk_2D8 = 0.5f; + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3); + func_80C2066C(this); + break; + + case 12: + case 14: + this->unk_3E8 |= 1; + + case 15: + if ((player->swordAnimation == 4) || (player->swordAnimation == 11) || (player->swordAnimation == 22) || + (player->swordAnimation == 23)) { + this->unk_3E8 |= 1; + } + + case 13: + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE); + Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3); + func_80C20274(this); + break; + + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + break; + } + } +} + +void func_80C21250(EnHintSkb* this, GlobalContext* globalCtx) { + if (this->unk_3E0 != 1) { + func_80C20E90(this, globalCtx); + if (this->actionFunc == func_80C1FF88) { + CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); + } + + if ((this->actionFunc != func_80C200B8) && (this->actionFunc != func_80C20334) && + (this->actionFunc != func_80C204F0)) { + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); + } + + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); + } +} + +void func_80C21320(EnHintSkb* this, GlobalContext* globalCtx) { + if (this->unk_3E2 > 0) { + this->unk_3E2--; + } + + if (this->actionFunc != func_80C20590) { + if (this->unk_3E2 < 20) { + if (this->actionFunc == func_80C2069C) { + Math_SmoothStepToF(&this->unk_2D8, 0.0f, 0.5f, 0.03f, 0.0f); + } else { + Math_SmoothStepToF(&this->unk_2D8, 0.0f, 0.5f, 0.01f, 0.0f); + } + this->unk_2D4 = this->unk_3E2 * 0.05f; + } else { + Math_SmoothStepToF(&this->unk_2D8, 0.5f, 0.1f, 0.02f, 0.0f); + } + } +} + +s32 func_80C21414(EnHintSkb* this) { + if (Actor_IsFacingPlayer(&this->actor, 0x11C7) && (this->actor.xzDistToPlayer < 60.0f)) { + return true; + } + return false; +} + +void func_80C21468(EnHintSkb* this, GlobalContext* globalCtx) { + static Color_RGBA8 D_80C21E44 = { 170, 255, 255, 255 }; + static Color_RGBA8 D_80C21E48 = { 200, 200, 255, 255 }; + static Vec3f D_80C21E4C = { 0.0f, -1.0f, 0.0f }; + Vec3f sp84; + s32 phi_s4; + s16 temp_s1; + s32 i; + + if (this->unk_3E8 & 2) { + phi_s4 = ARRAY_COUNT(this->unk_22C) - 1; + } else { + phi_s4 = ARRAY_COUNT(this->unk_22C); + } + + SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 30, NA_SE_EV_ICE_BROKEN); + + for (i = 0; i < phi_s4; i++) { + temp_s1 = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_22C[i]); + + sp84.x = Math_SinS(temp_s1) * 3.0f; + sp84.z = Math_CosS(temp_s1) * 3.0f; + sp84.y = (Rand_ZeroOne() * 4.0f) + 4.0f; + + EffectSsEnIce_Spawn(globalCtx, &this->unk_22C[i], 0.6f, &sp84, &D_80C21E4C, &D_80C21E44, &D_80C21E48, 30); + } +} + +void func_80C215E4(GlobalContext* globalCtx, EnHintSkb* this, Vec3f* arg2) { + Vec3f sp5C; + Vec3f sp50 = { 0.0f, 8.0f, 0.0f }; + Vec3f sp44 = { 0.0f, -1.5f, 0.0f }; + f32 sp40 = (Rand_ZeroOne() - 0.5f) * 6.28f; + s32 pad; + + sp5C.y = this->actor.floorHeight; + sp5C.x = (sin_rad(sp40) * 15.0f) + arg2->x; + sp5C.z = (cos_rad(sp40) * 15.0f) + arg2->z; + + sp44.x = randPlusMinusPoint5Scaled(1.0f); + sp44.z = randPlusMinusPoint5Scaled(1.0f); + + sp50.y += (Rand_ZeroOne() - 0.5f) * 4.0f; + + EffectSsHahen_Spawn(globalCtx, &sp5C, &sp50, &sp44, 0, ((Rand_ZeroOne() * 5.0f) + 12.0f) * 0.8f, -1, 10, NULL); + func_800BBFB0(globalCtx, &sp5C, 10.0f, 1, 150, 0, 1); +} + +void EnHintSkb_Update(Actor* thisx, GlobalContext* globalCtx) { + EnHintSkb* this = THIS; + + this->actionFunc(this, globalCtx); + + if ((this->actionFunc != func_80C2016C) && (this->actionFunc != func_80C20590) && + (this->actionFunc != func_80C2069C)) { + SkelAnime_Update(&this->skelAnime); + } + + Actor_MoveWithGravity(&this->actor); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 15.0f, 30.0f, 60.0f, 0x1D); + func_80C21250(this, globalCtx); + func_80C20D64(this, globalCtx); + func_80C21320(this, globalCtx); +} + +s32 EnHintSkb_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, + Actor* thisx) { + EnHintSkb* this = THIS; + f32 temp_f10; + + if (limbIndex == 11) { + OPEN_DISPS(globalCtx->state.gfxCtx); + + temp_f10 = fabsf(Math_SinS(globalCtx->state.frames * 6000) * 95.0f) + 160.0f; + + gDPPipeSync(POLY_OPA_DISP++); + gDPSetEnvColor(POLY_OPA_DISP++, (s16)temp_f10, (s16)temp_f10, (s16)temp_f10, 255); + + CLOSE_DISPS(globalCtx->state.gfxCtx); + } else if (limbIndex == 10) { + Matrix_GetStateTranslation(&this->actor.focus.pos); + } else if ((limbIndex == 12) && (this->unk_3DE == 1)) { + Matrix_InsertZRotation_s(0x71C, MTXMODE_APPLY); + } + + if (((limbIndex == 11) || (limbIndex == 12)) && (this->unk_3E8 & 2)) { + *dList = NULL; + } + + return false; +} + +void EnHintSkb_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { + static Vec3f D_80C21E70 = { 800.0f, 1200.0f, 0.0f }; + EnHintSkb* this = THIS; + + if (!(this->unk_3E8 & 8)) { + Collider_UpdateSpheres(limbIndex, &this->collider); + + if ((limbIndex == 11) && (this->unk_3E8 & 1) && !(this->unk_3E8 & 2)) { + Actor_SpawnBodyParts(&this->actor, globalCtx, 1, dList); + this->unk_3E8 |= 2; + } else if ((this->unk_3E8 & 4) && !(this->unk_3E8 & 8) && ((limbIndex != 11) || !(this->unk_3E8 & 1)) && + (limbIndex != 12)) { + Actor_SpawnBodyParts(&this->actor, globalCtx, 1, dList); + } + + if (this->unk_3E2 != 0) { + if ((limbIndex == 2) || (limbIndex == 4) || (limbIndex == 5) || (limbIndex == 6) || (limbIndex == 7) || + (limbIndex == 8) || (limbIndex == 9) || (limbIndex == 13) || (limbIndex == 14) || (limbIndex == 15) || + (limbIndex == 16) || (limbIndex == 17) || (limbIndex == 18)) { + Matrix_GetStateTranslation(&this->unk_22C[this->unk_2DC]); + this->unk_2DC++; + } else if ((limbIndex == 11) && !(this->unk_3E8 & 2)) { + Matrix_MultiplyVector3fByState(&D_80C21E70, &this->unk_22C[this->unk_2DC]); + this->unk_2DC++; + } + } + } +} + +void EnHintSkb_Draw(Actor* thisx, GlobalContext* globalCtx) { + EnHintSkb* this = THIS; + + this->unk_2DC = 0; + func_8012C28C(globalCtx->state.gfxCtx); + SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, EnHintSkb_OverrideLimbDraw, + EnHintSkb_PostLimbDraw, &this->actor); + if (this->unk_3E2 > 0) { + func_800BE680(globalCtx, &this->actor, this->unk_22C, this->unk_2DC, this->unk_2D8, 0.5f, this->unk_2D4, + this->unk_3E9); + } + + if (this->unk_3E8 & 4) { + this->unk_3E8 |= 8; + } +} diff --git a/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.h b/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.h index b6b98fc46..e399638b7 100644 --- a/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.h +++ b/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.h @@ -7,11 +7,29 @@ struct EnHintSkb; typedef void (*EnHintSkbActionFunc)(struct EnHintSkb*, GlobalContext*); +#define ENHINTSKB_GET_FF(thisx) ((thisx)->params & 0xFF) + typedef struct EnHintSkb { /* 0x0000 */ Actor actor; - /* 0x0144 */ char unk_144[0xE4]; + /* 0x0144 */ ColliderJntSph collider; + /* 0x0164 */ ColliderJntSphElement colliderElement[2]; + /* 0x01E4 */ SkelAnime skelAnime; /* 0x0228 */ EnHintSkbActionFunc actionFunc; - /* 0x022C */ char unk_22C[0x1C0]; + /* 0x022C */ Vec3f unk_22C[14]; + /* 0x02D4 */ f32 unk_2D4; + /* 0x02D8 */ f32 unk_2D8; + /* 0x02DC */ s32 unk_2DC; + /* 0x02E0 */ Vec3s jointTable[20]; + /* 0x0358 */ Vec3s morphtable[20]; + /* 0x03D0 */ UNK_TYPE1 unk3D0[0xC]; + /* 0x03DC */ s16 unk_3DC; + /* 0x03DE */ s16 unk_3DE; + /* 0x03E0 */ s16 unk_3E0; + /* 0x03E2 */ s16 unk_3E2; + /* 0x03E4 */ s16 unk_3E4; + /* 0x03E6 */ u16 unk_3E6; + /* 0x03E8 */ u8 unk_3E8; + /* 0x03E9 */ u8 unk_3E9; } EnHintSkb; // size = 0x3EC extern const ActorInit En_Hint_Skb_InitVars; diff --git a/src/overlays/actors/ovl_En_Ig/z_en_ig.c b/src/overlays/actors/ovl_En_Ig/z_en_ig.c index 9238fbf75..e6ccf277a 100644 --- a/src/overlays/actors/ovl_En_Ig/z_en_ig.c +++ b/src/overlays/actors/ovl_En_Ig/z_en_ig.c @@ -992,8 +992,8 @@ void EnIg_TransformLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* this void EnIg_Draw(Actor* thisx, GlobalContext* globalCtx) { static TexturePtr D_80BF3534[] = { - &object_dai_Tex_0107B0, &object_dai_Tex_010FB0, &object_dai_Tex_0117B0, - &object_dai_Tex_011FB0, &object_dai_Tex_0127B0, + object_dai_Tex_0107B0, object_dai_Tex_010FB0, object_dai_Tex_0117B0, + object_dai_Tex_011FB0, object_dai_Tex_0127B0, }; s32 pad; EnIg* this = THIS; diff --git a/src/overlays/actors/ovl_En_In/z_en_in.c b/src/overlays/actors/ovl_En_In/z_en_in.c index cb1aca72a..2516b49e5 100644 --- a/src/overlays/actors/ovl_En_In/z_en_in.c +++ b/src/overlays/actors/ovl_En_In/z_en_in.c @@ -5,6 +5,7 @@ */ #include "z_en_in.h" +#include "objects/object_in/object_in.h" #define FLAGS 0x00000019 @@ -46,54 +47,6 @@ const ActorInit En_In_InitVars = { (ActorFunc)EnIn_Draw, }; -extern FlexSkeletonHeader D_06014EA8; -extern AnimationHeader D_06015E38; -extern AnimationHeader D_06016484; -extern AnimationHeader D_06016A60; -extern AnimationHeader D_060170DC; -extern AnimationHeader D_060177AC; -extern AnimationHeader D_06018240; -extern AnimationHeader D_060187C8; -extern AnimationHeader D_060198A8; -extern Gfx D_06007A70[]; -extern Gfx D_06007C48[]; -extern Gfx D_0601C528[]; -extern AnimatedMaterial D_06001C30; -extern UNK_TYPE D_06003520; -extern UNK_TYPE D_060035E0; -extern UNK_TYPE D_06004820; -extern UNK_TYPE D_06004C20; -extern UNK_TYPE D_060043E0; -extern AnimationHeader D_06001D10; -extern AnimationHeader D_06014F8C; -extern AnimationHeader D_06000CB0; -extern AnimationHeader D_060003B4; -extern AnimationHeader D_06001BE0; -extern AnimationHeader D_06015918; -extern AnimationHeader D_0601C0B0; -extern AnimationHeader D_0601A140; -extern AnimationHeader D_0601B904; -extern AnimationHeader D_0601B3C4; -extern AnimationHeader D_06019EB4; -extern Gfx D_060137A0[]; -extern Gfx D_06014420[]; -extern Gfx D_06014040[]; -extern Gfx D_06013670[]; -extern Gfx D_06014AE0[]; -extern Gfx D_06012A78[]; -extern Gfx D_06013DE0[]; -extern Gfx D_060138D0[]; -extern Gfx D_06013540[]; -extern Gfx D_06012DF8[]; -extern Gfx D_060145D8[]; -extern Gfx D_06014860[]; -extern Gfx D_06014710[]; -extern Gfx D_06013A00[]; -extern Gfx D_06013F10[]; -extern Gfx D_06014C30[]; -extern Gfx D_060149A8[]; -extern Gfx D_06013440[]; - static ColliderCylinderInit sCylinderInit = { { COLTYPE_HIT0, @@ -179,12 +132,15 @@ static DamageTable sDamageTable = { }; static ActorAnimationEntryS sAnimations[] = { - { &D_06001D10, 1.0f, 0, -1, 0, 0 }, { &D_06001D10, 1.0f, 0, -1, 0, -4 }, { &D_06014F8C, 1.0f, 0, -1, 0, 0 }, - { &D_06014F8C, 1.0f, 0, -1, 0, -4 }, { &D_06000CB0, 1.0f, 0, -1, 0, -4 }, { &D_060003B4, 1.0f, 0, -1, 0, -4 }, - { &D_06001BE0, 1.0f, 0, -1, 0, -4 }, { &D_06015918, 1.0f, 0, -1, 0, -4 }, { &D_0601C0B0, 1.0f, 0, -1, 0, 0 }, - { &D_0601C0B0, 1.0f, 0, -1, 0, -4 }, { &D_0601A140, 1.0f, 0, -1, 0, 0 }, { &D_0601A140, 1.0f, 0, -1, 0, -4 }, - { &D_0601B904, 1.0f, 0, -1, 0, 0 }, { &D_0601B904, 1.0f, 0, -1, 0, -4 }, { &D_0601B3C4, 1.0f, 0, -1, 0, 0 }, - { &D_0601B3C4, 0.0f, 0, -1, 2, 0 }, { &D_0601B3C4, 1.0f, 0, -1, 0, -4 }, { &D_06019EB4, 1.0f, 0, -1, 2, -4 }, + { &object_in_Anim_001D10, 1.0f, 0, -1, 0, 0 }, { &object_in_Anim_001D10, 1.0f, 0, -1, 0, -4 }, + { &object_in_Anim_014F8C, 1.0f, 0, -1, 0, 0 }, { &object_in_Anim_014F8C, 1.0f, 0, -1, 0, -4 }, + { &object_in_Anim_000CB0, 1.0f, 0, -1, 0, -4 }, { &object_in_Anim_0003B4, 1.0f, 0, -1, 0, -4 }, + { &object_in_Anim_001BE0, 1.0f, 0, -1, 0, -4 }, { &object_in_Anim_015918, 1.0f, 0, -1, 0, -4 }, + { &object_in_Anim_01C0B0, 1.0f, 0, -1, 0, 0 }, { &object_in_Anim_01C0B0, 1.0f, 0, -1, 0, -4 }, + { &object_in_Anim_01A140, 1.0f, 0, -1, 0, 0 }, { &object_in_Anim_01A140, 1.0f, 0, -1, 0, -4 }, + { &object_in_Anim_01B904, 1.0f, 0, -1, 0, 0 }, { &object_in_Anim_01B904, 1.0f, 0, -1, 0, -4 }, + { &object_in_Anim_01B3C4, 1.0f, 0, -1, 0, 0 }, { &object_in_Anim_01B3C4, 0.0f, 0, -1, 2, 0 }, + { &object_in_Anim_01B3C4, 1.0f, 0, -1, 0, -4 }, { &object_in_Anim_019EB4, 1.0f, 0, -1, 2, -4 }, }; static u16 D_808F6C0C[] = { @@ -345,10 +301,11 @@ void func_808F3690(EnIn* this, GlobalContext* globalCtx) { } void func_808F374C(EnIn* this, GlobalContext* globalCtx) { - AnimationHeader* animations[] = { &D_06015E38, &D_06016A60, &D_060177AC, &D_06016484, - &D_060170DC, &D_06018240, &D_060187C8, &D_060198A8 }; + AnimationHeader* animations[] = { &object_in_Anim_015E38, &object_in_Anim_016A60, &object_in_Anim_0177AC, + &object_in_Anim_016484, &object_in_Anim_0170DC, &object_in_Anim_018240, + &object_in_Anim_0187C8, &object_in_Anim_0198A8 }; - if (this->skelAnime.animation == &D_06016484 || this->skelAnime.animation == &D_060170DC) { + if (this->skelAnime.animation == &object_in_Anim_016484 || this->skelAnime.animation == &object_in_Anim_0170DC) { if (Animation_OnFrame(&this->skelAnime, 8.0f)) { func_8019F88C(&this->actor.projectedPos, NA_SE_VO_IN_LASH_0, 2); if (Rand_ZeroOne() < 0.3f) { @@ -357,7 +314,7 @@ void func_808F374C(EnIn* this, GlobalContext* globalCtx) { Audio_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_IT_LASH); } } - if (this->skelAnime.animation == &D_060198A8 && Animation_OnFrame(&this->skelAnime, 20.0f)) { + if (this->skelAnime.animation == &object_in_Anim_0198A8 && Animation_OnFrame(&this->skelAnime, 20.0f)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_VO_IN_CRY_0); } if (SkelAnime_Update(&this->skelAnime)) { @@ -1405,7 +1362,8 @@ void EnIn_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChain); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06014EA8, NULL, this->jointTable, this->morphTable, 20); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_in_Skel_014EA8, NULL, this->jointTable, this->morphTable, + 20); func_808F30B0(&this->skelAnime, 0); Collider_InitCylinder(globalCtx, &this->colliderCylinder); Collider_SetCylinder(globalCtx, &this->colliderCylinder, &this->actor, &sCylinderInit); @@ -1421,7 +1379,8 @@ void EnIn_Init(Actor* thisx, GlobalContext* globalCtx) { if (type == ENIN_HORSE_RIDER_YELLOW_SHIRT || type == ENIN_HORSE_RIDER_BLUE_SHIRT) { ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f); this->unk488 = 1; - Animation_Change(&this->skelAnime, &D_06016A60, 1.0f, 0.0f, Animation_GetLastFrame(&D_06016A60), 2, 0.0f); + Animation_Change(&this->skelAnime, &object_in_Anim_016A60, 1.0f, 0.0f, + Animation_GetLastFrame(&object_in_Anim_016A60), 2, 0.0f); Actor_SetScale(&this->actor, 0.01f); this->unk23C = 0; this->unk23D = 1; @@ -1544,9 +1503,26 @@ s32 EnIn_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, EnIn* this = THIS; s32 pad; Gfx* sp50[] = { - NULL, NULL, D_060149A8, D_06014AE0, D_06014C30, D_060145D8, D_06014710, - D_06014860, D_06014420, D_06012A78, D_06013DE0, D_06013F10, D_06014040, D_060137A0, - D_060138D0, D_06013A00, D_06012DF8, D_06013670, D_06013540, D_06013440, + NULL, + NULL, + object_in_DL_0149A8, + object_in_DL_014AE0, + object_in_DL_014C30, + object_in_DL_0145D8, + object_in_DL_014710, + object_in_DL_014860, + object_in_DL_014420, + object_in_DL_012A78, + object_in_DL_013DE0, + object_in_DL_013F10, + object_in_DL_014040, + object_in_DL_0137A0, + object_in_DL_0138D0, + object_in_DL_013A00, + object_in_DL_012DF8, + object_in_DL_013670, + object_in_DL_013540, + object_in_DL_013440, }; if (this->unk23C != 0 && limbIndex != 16) { @@ -1555,16 +1531,18 @@ s32 EnIn_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, } } if (this->unk4AC & 4 && limbIndex == 16) { - *dList = D_0601C528; + *dList = object_in_DL_01C528; } OPEN_DISPS(globalCtx->state.gfxCtx); if (limbIndex == 16) { - void* sp38[] = { &D_060035E0, &D_06004820, &D_06004C20, &D_060043E0 }; + TexturePtr sp38[] = { object_in_Tex_0035E0, object_in_Tex_004820, object_in_Tex_004C20, object_in_Tex_0043E0 }; + gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(sp38[this->unk482])); - gSPSegment(POLY_OPA_DISP++, 0x09, Lib_SegmentedToVirtual(&D_06003520)); + gSPSegment(POLY_OPA_DISP++, 0x09, Lib_SegmentedToVirtual(object_in_Tex_003520)); } else { - AnimatedMat_DrawStep(globalCtx, Lib_SegmentedToVirtual(&D_06001C30), this->unk4AC & 8 ? 1 : 0); + AnimatedMat_DrawStep(globalCtx, Lib_SegmentedToVirtual(object_in_Matanimheader_001C30), + this->unk4AC & 8 ? 1 : 0); } CLOSE_DISPS(globalCtx->state.gfxCtx); @@ -1622,10 +1600,10 @@ void EnIn_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec if (!(this->unk4AC & 8)) { OPEN_DISPS(globalCtx->state.gfxCtx); if (limbIndex == 12) { - gSPDisplayList(POLY_OPA_DISP++, D_06007A70); + gSPDisplayList(POLY_OPA_DISP++, object_in_DL_007A70); } if (limbIndex == 15) { - gSPDisplayList(POLY_OPA_DISP++, D_06007C48); + gSPDisplayList(POLY_OPA_DISP++, object_in_DL_007C48); } CLOSE_DISPS(globalCtx->state.gfxCtx); } @@ -1634,7 +1612,7 @@ void EnIn_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec if (this->unk4AC & 0x20) { OPEN_DISPS(globalCtx->state.gfxCtx); if (limbIndex == 12) { - gSPDisplayList(POLY_OPA_DISP++, D_06007C48); + gSPDisplayList(POLY_OPA_DISP++, object_in_DL_007C48); } CLOSE_DISPS(globalCtx->state.gfxCtx); } diff --git a/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c b/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c index 77aa2c590..e5b52fe49 100644 --- a/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c +++ b/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c @@ -3,9 +3,14 @@ * Overlay: ovl_En_Invadepoh * Description: Ranch nighttime actors */ -#include "prevent_bss_reordering.h" #include "z_en_invadepoh.h" #include "overlays/actors/ovl_En_Door/z_en_door.h" +#include "objects/gameplay_keep/gameplay_keep.h" +#include "objects/object_ma1/object_ma1.h" +#include "objects/object_ma2/object_ma2.h" +#include "objects/object_dog/object_dog.h" +#include "objects/object_cow/object_cow.h" +#include "objects/object_uch/object_uch.h" #define FLAGS 0x00000010 @@ -170,56 +175,6 @@ void func_80B45A4C(EnInvadePohStruct* s, unkstructInvadepoh4** u); void func_80B45A94(EnInvadePohStruct* s, unkstructInvadepoh4** u); void func_80B45B1C(EnInvadePohStruct* s, unkstructInvadepoh4** u); -extern AnimatedMaterial D_06000550; -extern AnimatedMaterial D_06000560; - -extern AnimationHeader D_06000608; -extern AnimationHeader D_060006C8; -extern AnimationHeader D_06000998; -extern AnimationHeader D_06001560; -extern AnimationHeader D_06001674; -extern AnimationHeader D_06001BD8; -extern AnimationHeader D_06001D80; -extern AnimationHeader D_060021C8; -extern AnimationHeader D_06002A8C; -extern AnimationHeader D_06004264; -extern AnimationHeader D_06004E98; -extern AnimationHeader D_06007328; -extern AnimationHeader D_06009E58; -extern AnimationHeader D_0600A174; -extern AnimationHeader D_06014088; -extern AnimationHeader D_06016720; - -extern FlexSkeletonHeader D_060080F0; -extern FlexSkeletonHeader D_06004010; -extern FlexSkeletonHeader D_06004C30; -extern FlexSkeletonHeader D_06004E50; -extern FlexSkeletonHeader D_06013928; -extern FlexSkeletonHeader D_06015C28; - -extern Gfx D_0600FFC8[]; -extern Gfx D_060107C8[]; -extern Gfx D_06010FC8[]; -extern Gfx D_060117C8[]; -extern Gfx D_06011FC8[]; -extern Gfx D_060127C8[]; -extern Gfx D_06012BC8[]; -extern Gfx D_06012FC8[]; -extern Gfx D_060133C8[]; -extern Gfx D_06011AD8[]; -extern Gfx D_060122D8[]; -extern Gfx D_06012AD8[]; -extern Gfx D_060132D8[]; -extern Gfx D_06013AD8[]; -extern Gfx D_060142D8[]; -extern Gfx D_06014AD8[]; -extern Gfx D_06014ED8[]; -extern Gfx D_060152D8[]; -extern Gfx D_060156D8[]; -extern Gfx D_060003B0[]; -extern Gfx D_06000720[]; -extern Gfx D_06000080[]; - extern s32 D_801BDA9C; const ActorInit En_Invadepoh_InitVars = { @@ -298,28 +253,29 @@ static Vec3f D_80B4E934 = { 216.0f, -20.0f, 1395.0f }; static s32 D_80B4E940 = 0; -static Gfx* D_80B4E944[] = { - D_0600FFC8, D_060107C8, D_06010FC8, D_060117C8, D_06011FC8, +static TexturePtr D_80B4E944[] = { + object_ma1_Tex_00FFC8, object_ma1_Tex_0107C8, object_ma1_Tex_010FC8, object_ma1_Tex_0117C8, object_ma1_Tex_011FC8, }; -static Gfx* D_80B4E958[] = { - D_060127C8, - D_06012BC8, - D_06012FC8, - D_060133C8, +static TexturePtr D_80B4E958[] = { + object_ma1_Tex_0127C8, + object_ma1_Tex_012BC8, + object_ma1_Tex_012FC8, + object_ma1_Tex_0133C8, }; static s8 D_80B4E968 = 0; -static Gfx* D_80B4E96C[] = { - D_06011AD8, D_060122D8, D_06012AD8, D_060132D8, D_06013AD8, D_060142D8, +static TexturePtr D_80B4E96C[] = { + object_ma2_Tex_011AD8, object_ma2_Tex_0122D8, object_ma2_Tex_012AD8, + object_ma2_Tex_0132D8, object_ma2_Tex_013AD8, object_ma2_Tex_0142D8, }; -static Gfx* D_80B4E984[] = { - D_06014AD8, - D_06014ED8, - D_060152D8, - D_060156D8, +static TexturePtr D_80B4E984[] = { + object_ma2_Tex_014AD8, + object_ma2_Tex_014ED8, + object_ma2_Tex_0152D8, + object_ma2_Tex_0156D8, }; static s8 D_80B4E994 = 0; @@ -1238,7 +1194,7 @@ void func_80B44EFC(EnInvadepoh* this, GlobalContext* globalCtx) { void func_80B44F58(void) { s32 i; - Gfx** iter; + TexturePtr* iter; if (!D_80B4E968) { D_80B4E968 = true; @@ -1254,7 +1210,7 @@ void func_80B44F58(void) { void func_80B44FEC(void) { s32 i; - Gfx** iter; + TexturePtr* iter; if (!D_80B4E994) { D_80B4E994 = true; @@ -1269,8 +1225,8 @@ void func_80B44FEC(void) { } void func_80B45080(void) { - D_80B50400 = Lib_SegmentedToVirtual(&D_06000560); - D_80B503FC = Lib_SegmentedToVirtual(&D_06000550); + D_80B50400 = Lib_SegmentedToVirtual(object_uch_Matanimheader_000560); + D_80B503FC = Lib_SegmentedToVirtual(object_uch_Matanimheader_000550); } s32 func_80B450C0(f32* x1, f32* z1, f32 x2, f32 z2, f32 speed) { @@ -2160,7 +2116,7 @@ void func_80B474DC(EnInvadepoh* this, GlobalContext* globalCtx) { } void func_80B47568(EnInvadepoh* this) { - Animation_MorphToLoop(&this->skelAnime, &D_06001D80, -6.0f); + Animation_MorphToLoop(&this->skelAnime, &object_uch_Anim_001D80, -6.0f); this->collider.base.atFlags &= ~0x1; this->collider.base.acFlags &= ~0x1; this->collider.base.ocFlags1 &= ~0x1; @@ -2202,8 +2158,8 @@ void func_80B47600(EnInvadepoh* this, GlobalContext* globalCtx) { } void func_80B4770C(EnInvadepoh* this) { - if (this->skelAnime.animation != &D_06001D80) { - Animation_MorphToLoop(&this->skelAnime, &D_06001D80, -6.0f); + if (this->skelAnime.animation != &object_uch_Anim_001D80) { + Animation_MorphToLoop(&this->skelAnime, &object_uch_Anim_001D80, -6.0f); } this->collider.base.atFlags |= 1; this->collider.base.acFlags |= 1; @@ -2231,7 +2187,7 @@ void func_80B47830(EnInvadepoh* this) { this->collider.base.atFlags &= ~1; this->collider.base.acFlags &= ~1; this->collider.base.ocFlags1 |= 1; - Animation_PlayLoop(&this->skelAnime, &D_060006C8); + Animation_PlayLoop(&this->skelAnime, &object_uch_Anim_0006C8); Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 16); this->alienAlpha = 255; this->actor.draw = func_80B4DB14; @@ -2256,7 +2212,7 @@ void func_80B47938(EnInvadepoh* this) { this->collider.base.atFlags &= ~1; this->collider.base.acFlags &= ~1; this->collider.base.ocFlags1 &= ~1; - Animation_PlayLoop(&this->skelAnime, &D_06000608); + Animation_PlayLoop(&this->skelAnime, &object_uch_Anim_000608); this->actor.flags &= ~1; this->actionTimer = 10; this->alienAlpha = 255; @@ -2327,8 +2283,8 @@ void func_80B47BAC(Actor* thisx, GlobalContext* globalCtx) { Actor_SetObjectDependency(globalCtx, &this->actor); func_80B45080(); this->actor.update = func_80B47D30; - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06004E50, &D_06001D80, this->jointTable, this->morphTable, - 14); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_uch_Skel_004E50, &object_uch_Anim_001D80, + this->jointTable, this->morphTable, 14); this->skelAnime.curFrame = (this->actor.params & 7) * this->skelAnime.endFrame * 0.125f; func_80B444BC(this, globalCtx); func_80B442E4(this); @@ -2410,8 +2366,8 @@ void func_80B47FA8(Actor* thisx, GlobalContext* globalCtx) { Actor_SetObjectDependency(globalCtx, thisx); this->actor.update = func_80B48060; this->actor.draw = func_80B4E158; - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06004010, NULL, this->jointTable, this->morphTable, 6); - Animation_PlayLoop(&this->skelAnime, &D_06004264); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gCowBodySkel, NULL, this->jointTable, this->morphTable, 6); + Animation_PlayLoop(&this->skelAnime, &gCowBodyMoveHeadAnim); } } @@ -2453,8 +2409,8 @@ void func_80B481C4(Actor* thisx, GlobalContext* globalCtx) { Actor_SetObjectDependency(globalCtx, &this->actor); this->actor.update = func_80B4827C; this->actor.draw = func_80B4E1B0; - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06004C30, NULL, this->jointTable, this->morphTable, 6); - Animation_PlayLoop(&this->skelAnime, &D_06004E98); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gCowTailSkel, NULL, this->jointTable, this->morphTable, 6); + Animation_PlayLoop(&this->skelAnime, &gCowTailSwishAnim); } } @@ -2471,7 +2427,7 @@ void func_80B4827C(Actor* thisx, GlobalContext* globalCtx) { void func_80B482D4(EnInvadepoh* this) { this->actionTimer = 40; - Animation_MorphToLoop(&this->skelAnime, &D_06002A8C, -10.0f); + Animation_MorphToLoop(&this->skelAnime, &object_ma1_Anim_002A8C, -10.0f); this->actor.draw = NULL; this->actionFunc = func_80B48324; } @@ -2487,7 +2443,7 @@ void func_80B48324(EnInvadepoh* this, GlobalContext* globalCtx) { void func_80B48374(EnInvadepoh* this) { this->actionTimer = 60; - Animation_MorphToLoop(&this->skelAnime, &D_06002A8C, -10.0f); + Animation_MorphToLoop(&this->skelAnime, &object_ma1_Anim_002A8C, -10.0f); this->actor.draw = func_80B4E324; this->actionFunc = func_80B483CC; } @@ -2519,7 +2475,7 @@ void func_80B4843C(EnInvadepoh* this) { this->behaviorInfo.unk44 = 0.1f; this->behaviorInfo.unk48 = 2000; this->actionTimer = 50; - Animation_Change(&this->skelAnime, &D_06007328, 2.0f, 0.0f, 0.0f, 0, -5.0f); + Animation_Change(&this->skelAnime, &object_ma1_Anim_007328, 2.0f, 0.0f, 0.0f, 0, -5.0f); this->actor.draw = func_80B4E324; this->actionFunc = func_80B484EC; } @@ -2549,7 +2505,7 @@ void func_80B48588(EnInvadepoh* this) { this->behaviorInfo.unk42 = 0; this->behaviorInfo.unk44 = 0.28f; this->behaviorInfo.unk48 = 7000; - Animation_MorphToPlayOnce(&this->skelAnime, &D_06009E58, -10.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &object_ma1_Anim_009E58, -10.0f); this->actor.draw = func_80B4E324; this->actionFunc = func_80B48610; } @@ -2566,10 +2522,10 @@ void func_80B48620(Actor* thisx, GlobalContext* globalCtx) { Actor_SetObjectDependency(globalCtx, &this->actor); func_80B44F58(); this->actor.update = func_80B4873C; - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06013928, &D_06009E58, this->jointTable, this->morphTable, - 23); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_ma1_Skel_013928, &object_ma1_Anim_009E58, + this->jointTable, this->morphTable, 23); func_80B45C04(&this->behaviorInfo, D_80B4EA90, 6, D_80B4EB00, 2, &gZeroVec3s, 5000, 0.05f, 0.3f, 0.12f); - Animation_PlayLoop(&this->skelAnime, &D_06009E58); + Animation_PlayLoop(&this->skelAnime, &object_ma1_Anim_009E58); func_80B482D4(this); } } @@ -2602,7 +2558,7 @@ void func_80B487B4(EnInvadepoh* this) { substruct->unk26.z = 0; substruct->unk30 = 0.1f; substruct->unk2C = 800; - Animation_MorphToLoop(&this->skelAnime, &D_06014088, -10.0f); + Animation_MorphToLoop(&this->skelAnime, &object_ma1_Anim_014088, -10.0f); this->actionFunc = func_80B48848; } @@ -2662,7 +2618,7 @@ void func_80B48948(EnInvadepoh* this) { substruct->unk2C = 1000; } - Animation_MorphToLoop(&this->skelAnime, &D_06009E58, -10.0f); + Animation_MorphToLoop(&this->skelAnime, &object_ma1_Anim_009E58, -10.0f); this->actionFunc = func_80B48AD4; } @@ -2733,7 +2689,7 @@ void func_80B48DE4(EnInvadepoh* this) { AlienBehaviorInfo* substruct = &this->behaviorInfo; this->actor.speedXZ = 0.0f; - Animation_MorphToLoop(&this->skelAnime, &D_06009E58, -10.0f); + Animation_MorphToLoop(&this->skelAnime, &object_ma1_Anim_009E58, -10.0f); this->behaviorInfo.unk4C = 0; substruct->unk30 = 0.05f; substruct->unk2C = 1200; @@ -2770,8 +2726,8 @@ void func_80B48FB0(Actor* thisx, GlobalContext* globalCtx) { this->actor.update = func_80B490F0; this->actor.draw = func_80B4E324; this->actor.textId = 0x3330; - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06013928, &D_06009E58, this->jointTable, this->morphTable, - 23); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_ma1_Skel_013928, &object_ma1_Anim_009E58, + this->jointTable, this->morphTable, 23); func_80B45C04(&this->behaviorInfo, D_80B4EA90, 6, D_80B4EB00, 2, &gZeroVec3s, 100, 0.03, 0.3, 0.03); func_80B444F4(this, globalCtx); EnInvadepoh_SetPathPointToWorldPos(this, 0); @@ -3040,7 +2996,7 @@ void func_80B49B1C(Actor* thisx, GlobalContext* globalCtx) { void func_80B49BD0(EnInvadepoh* this) { AlienBehaviorInfo* substruct = &this->behaviorInfo; - Animation_MorphToLoop(&this->skelAnime, &D_06014088, -10.0f); + Animation_MorphToLoop(&this->skelAnime, &object_ma1_Anim_014088, -10.0f); substruct->unk26.x = 0; substruct->unk26.y = 0; substruct->unk26.z = 0; @@ -3084,7 +3040,7 @@ void func_80B49DA0(EnInvadepoh* this) { this->behaviorInfo.unk30 = 0.08f; this->behaviorInfo.unk2C = 2000; this->behaviorInfo.unk4C = 0; - Animation_MorphToLoop(&this->skelAnime, &D_06009E58, -10.0f); + Animation_MorphToLoop(&this->skelAnime, &object_ma1_Anim_009E58, -10.0f); this->actionFunc = func_80B49DFC; } @@ -3122,8 +3078,8 @@ void func_80B49F88(Actor* thisx, GlobalContext* globalCtx) { this->actor.objBankIndex = this->bankIndex; Actor_SetObjectDependency(globalCtx, &this->actor); func_80B44F58(); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06013928, &D_06014088, this->jointTable, this->morphTable, - 23); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_ma1_Skel_013928, &object_ma1_Anim_014088, + this->jointTable, this->morphTable, 23); func_80B45C04(&this->behaviorInfo, D_80B4EA90, 1, D_80B4EB00, 1, &gZeroVec3s, 100, 0.03, 0.3, 0.03); func_80B44540(this, globalCtx); func_80B44570(this); @@ -3189,7 +3145,7 @@ void func_80B4A1B8(Actor* thisx, GlobalContext* globalCtx) { void func_80B4A2C0(EnInvadepoh* this) { AlienBehaviorInfo* substruct = &this->behaviorInfo; - Animation_MorphToLoop(&this->skelAnime, &D_06009E58, -10.0f); + Animation_MorphToLoop(&this->skelAnime, &object_ma1_Anim_009E58, -10.0f); substruct->unk26.x = 0; substruct->unk26.y = 0; substruct->unk26.z = 0; @@ -3248,7 +3204,7 @@ void func_80B4A350(EnInvadepoh* this, GlobalContext* globalCtx) { void func_80B4A570(EnInvadepoh* this) { AlienBehaviorInfo* substruct = &this->behaviorInfo; - Animation_MorphToPlayOnce(&this->skelAnime, &D_06002A8C, -10.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &object_ma1_Anim_002A8C, -10.0f); substruct->unk26.x = 0; substruct->unk26.y = 0; substruct->unk26.z = 0; @@ -3267,7 +3223,7 @@ void func_80B4A5E4(EnInvadepoh* this, GlobalContext* globalCtx) { void func_80B4A614(EnInvadepoh* this) { AlienBehaviorInfo* substruct = &this->behaviorInfo; - Animation_MorphToLoop(&this->skelAnime, &D_06014088, 0.0f); + Animation_MorphToLoop(&this->skelAnime, &object_ma1_Anim_014088, 0.0f); substruct->unk26.x = 0; substruct->unk26.y = 0; substruct->unk26.z = 0; @@ -3310,7 +3266,7 @@ void func_80B4A7C0(EnInvadepoh* this) { this->behaviorInfo.unk30 = 0.08f; this->behaviorInfo.unk2C = 2000; this->behaviorInfo.unk4C = 0; - Animation_MorphToLoop(&this->skelAnime, &D_06009E58, 0.0f); + Animation_MorphToLoop(&this->skelAnime, &object_ma1_Anim_009E58, 0.0f); this->actionFunc = func_80B4A81C; } @@ -3353,8 +3309,8 @@ void func_80B4A9C8(Actor* thisx, GlobalContext* globalCtx) { this->actor.objBankIndex = this->bankIndex; Actor_SetObjectDependency(globalCtx, &this->actor); func_80B44F58(); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06013928, &D_06014088, this->jointTable, this->morphTable, - 23); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_ma1_Skel_013928, &object_ma1_Anim_014088, + this->jointTable, this->morphTable, 23); func_80B45C04(&this->behaviorInfo, D_80B4EA90, 1, D_80B4EB00, 1, &gZeroVec3s, 100, 0.03f, 0.3f, 0.03f); func_80B44620(this, globalCtx); if ((sp38 < CLOCK_TIME(2, 15)) || (sp38 >= CLOCK_TIME(6, 0))) { @@ -3528,9 +3484,9 @@ void func_80B4B0C4(Actor* thisx, GlobalContext* globalCtx) { Actor_SetObjectDependency(globalCtx, &this->actor); func_80B44F58(); this->actor.update = func_80B4B218; - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06013928, &D_06014088, this->jointTable, this->morphTable, - 23); - Animation_MorphToLoop(&this->skelAnime, &D_06009E58, 0.0f); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_ma1_Skel_013928, &object_ma1_Anim_014088, + this->jointTable, this->morphTable, 23); + Animation_MorphToLoop(&this->skelAnime, &object_ma1_Anim_009E58, 0.0f); substruct = &this->behaviorInfo; func_80B45C04(&this->behaviorInfo, D_80B4EA90, 1, D_80B4EB00, 3, &gZeroVec3s, 2000, 0.08f, 0.3f, 0.03f); substruct->unk30 = 0.08f; @@ -3577,7 +3533,7 @@ void func_80B4B3DC(EnInvadepoh* this) { } void func_80B4B430(EnInvadepoh* this) { - Animation_MorphToLoop(&this->skelAnime, &D_060021C8, -6.0f); + Animation_MorphToLoop(&this->skelAnime, &object_dog_Anim_0021C8, -6.0f); this->actionTimer = Rand_S16Offset(50, 80); this->actionFunc = func_80B4B484; } @@ -3600,7 +3556,7 @@ void func_80B4B484(EnInvadepoh* this, GlobalContext* globalCtx) { } void func_80B4B510(EnInvadepoh* this) { - Animation_MorphToLoop(&this->skelAnime, &D_06001BD8, -6.0f); + Animation_MorphToLoop(&this->skelAnime, &object_dog_Anim_001BD8, -6.0f); this->actionTimer = Rand_S16Offset(50, 200); this->actionFunc = func_80B4B564; } @@ -3644,7 +3600,7 @@ void func_80B4B564(EnInvadepoh* this, GlobalContext* globalCtx) { } void func_80B4B724(EnInvadepoh* this) { - Animation_MorphToPlayOnce(&this->skelAnime, &D_06000998, -6.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &object_dog_Anim_000998, -6.0f); this->actionFunc = func_80B4B768; } @@ -3664,7 +3620,7 @@ void func_80B4B768(EnInvadepoh* this, GlobalContext* globalCtx) { } void func_80B4B820(EnInvadepoh* this) { - Animation_MorphToPlayOnce(&this->skelAnime, &D_06001560, -6.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &object_dog_Anim_001560, -6.0f); this->actionFunc = func_80B4B864; } @@ -3683,8 +3639,8 @@ void func_80B4B8BC(Actor* thisx, GlobalContext* globalCtx) { if (Object_IsLoaded(&globalCtx->objectCtx, this->bankIndex)) { this->actor.objBankIndex = this->bankIndex; Actor_SetObjectDependency(globalCtx, &this->actor); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060080F0, &D_060021C8, this->jointTable, this->morphTable, - 13); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_dog_Skel_0080F0, &object_dog_Anim_0021C8, + this->jointTable, this->morphTable, 13); func_80B45C04(&this->behaviorInfo, 0, 0, 0, 0, &gZeroVec3s, 3000, 0.1f, 0.0f, 0.0f); func_80B44664(this, globalCtx); EnInvadepoh_SetPathPointToWorldPos(this, 0); @@ -3764,7 +3720,7 @@ void func_80B4BA84(Actor* thisx, GlobalContext* globalCtx) { void func_80B4BBE0(EnInvadepoh* this) { AlienBehaviorInfo* substruct = &this->behaviorInfo; - Animation_MorphToLoop(&this->skelAnime, &D_06016720, -6.0f); + Animation_MorphToLoop(&this->skelAnime, &object_ma2_Anim_016720, -6.0f); substruct->unk26.x = 0; substruct->unk26.y = 0; substruct->unk26.z = 0; @@ -3845,7 +3801,7 @@ void func_80B4BC4C(EnInvadepoh* this, GlobalContext* globalCtx) { void func_80B4BFFC(EnInvadepoh* this) { this->behaviorInfo.unk30 = 0.08f; this->behaviorInfo.unk2C = 2000; - Animation_MorphToLoop(&this->skelAnime, &D_0600A174, -6.0f); + Animation_MorphToLoop(&this->skelAnime, &object_ma2_Anim_00A174, -6.0f); this->behaviorInfo.unk4C = 0; this->actionFunc = func_80B4C058; } @@ -3877,7 +3833,7 @@ void func_80B4C058(EnInvadepoh* this, GlobalContext* globalCtx) { void func_80B4C1BC(EnInvadepoh* this) { this->behaviorInfo.unk30 = 0.08f; this->behaviorInfo.unk2C = 2000; - Animation_MorphToLoop(&this->skelAnime, &D_0600A174, -6.0f); + Animation_MorphToLoop(&this->skelAnime, &object_ma2_Anim_00A174, -6.0f); this->behaviorInfo.unk4C = 0; this->actionFunc = func_80B4C218; } @@ -3917,8 +3873,8 @@ void func_80B4C3A0(Actor* thisx, GlobalContext* globalCtx) { this->actor.objBankIndex = this->bankIndex; Actor_SetObjectDependency(globalCtx, &this->actor); func_80B44FEC(); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06015C28, &D_06016720, this->jointTable, this->morphTable, - 22); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_ma2_Skel_015C28, &object_ma2_Anim_016720, + this->jointTable, this->morphTable, 22); func_80B45C04(&this->behaviorInfo, D_80B4EBDC, 1, D_80B4EC08, 0, &gZeroVec3s, 100, 0.03f, 0.3f, 0.03f); this->actor.textId = 0x33CD; if (currentTime < 0xD5A0) { @@ -3980,7 +3936,7 @@ void func_80B4C5C0(Actor* thisx, GlobalContext* globalCtx) { void func_80B4C6C8(EnInvadepoh* this) { AlienBehaviorInfo* substruct = &this->behaviorInfo; - Animation_MorphToLoop(&this->skelAnime, &D_06014088, -10.0f); + Animation_MorphToLoop(&this->skelAnime, &object_ma1_Anim_014088, -10.0f); substruct->unk26.x = 0; substruct->unk26.y = 0; substruct->unk26.z = 0; @@ -4070,7 +4026,7 @@ void func_80B4C730(EnInvadepoh* this, GlobalContext* globalCtx) { void func_80B4CAB0(EnInvadepoh* this) { this->behaviorInfo.unk30 = 0.08f; this->behaviorInfo.unk2C = 4000; - Animation_MorphToLoop(&this->skelAnime, &D_06009E58, -10.0f); + Animation_MorphToLoop(&this->skelAnime, &object_ma1_Anim_009E58, -10.0f); this->behaviorInfo.unk4C = 0; this->actionFunc = func_80B4CB0C; } @@ -4099,7 +4055,7 @@ void func_80B4CB0C(EnInvadepoh* this, GlobalContext* globalCtx) { void func_80B4CC70(EnInvadepoh* this) { this->behaviorInfo.unk30 = 0.08f; this->behaviorInfo.unk2C = 2000; - Animation_MorphToLoop(&this->skelAnime, &D_06009E58, -10.0f); + Animation_MorphToLoop(&this->skelAnime, &object_ma1_Anim_009E58, -10.0f); this->behaviorInfo.unk4C = 0; this->actionFunc = func_80B4CCCC; } @@ -4138,8 +4094,8 @@ void func_80B4CE54(Actor* thisx, GlobalContext* globalCtx) { this->actor.objBankIndex = this->bankIndex; Actor_SetObjectDependency(globalCtx, &this->actor); func_80B44F58(); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06013928, &D_06014088, this->jointTable, this->morphTable, - 23); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_ma1_Skel_013928, &object_ma1_Anim_014088, + this->jointTable, this->morphTable, 23); func_80B45C04(&this->behaviorInfo, D_80B4EA90, 1, D_80B4EB00, 3, &gZeroVec3s, 100, 0.03f, 0.3f, 0.03f); func_80B446D0(this, globalCtx); this->actor.world.rot.y = this->actor.shape.rot.y; @@ -4198,7 +4154,7 @@ void func_80B4D15C(EnInvadepoh* this) { s32 temp_v1 = this->actor.params & 7; unkstruct80B4EE0C* temp_v0; - Animation_PlayLoop(&this->skelAnime, &D_06001674); + Animation_PlayLoop(&this->skelAnime, &object_uch_Anim_001674); this->skelAnime.curFrame = ((this->actor.params & 7) * this->skelAnime.endFrame) * 0.25f; this->alienAlpha = 255; this->actor.draw = func_80B4DB14; @@ -4250,7 +4206,7 @@ void func_80B4D290(EnInvadepoh* this, GlobalContext* globalCtx) { } void func_80B4D3E4(EnInvadepoh* this) { - Animation_PlayLoop(&this->skelAnime, &D_06001674); + Animation_PlayLoop(&this->skelAnime, &object_uch_Anim_001674); this->skelAnime.curFrame = (this->actor.params & 7) * this->skelAnime.endFrame * 0.25f; this->alienAlpha = 255; this->actor.draw = NULL; @@ -4327,8 +4283,8 @@ void func_80B4D670(Actor* thisx, GlobalContext* globalCtx) { Actor_SetObjectDependency(globalCtx, &this->actor); func_80B45080(); this->actor.update = func_80B4D760; - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06004E50, &D_06001674, this->jointTable, this->morphTable, - 14); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_uch_Skel_004E50, &object_uch_Anim_001674, + this->jointTable, this->morphTable, 14); if (invadepohType < 3) { func_80B453F4(this, globalCtx, invadepohType); func_80B4D15C(this); @@ -4373,7 +4329,7 @@ void func_80B4D7B8(GlobalContext* globalCtx) { Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, temp_s5, 0, 0x20, 0x40, 1, 0, temp_s6, 0x20, 0x40)); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_XLU_DISP++, &D_0402E510); + gSPDisplayList(POLY_XLU_DISP++, &gameplay_keep_DL_02E510); } } CLOSE_DISPS(globalCtx->state.gfxCtx); @@ -4450,10 +4406,10 @@ void func_80B4DB14(Actor* thisx, GlobalContext* globalCtx) { gDPSetEnvColor(spBC++, 255, 255, 255, this->alienBeamAlpha * (150.0f / 255.0f)); Matrix_InsertMatrix(&D_80B502A0, MTXMODE_NEW); gSPMatrix(spBC++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(spBC++, D_06000080); + gSPDisplayList(spBC++, object_uch_DL_000080); Matrix_InsertMatrix(&D_80B502E0, MTXMODE_NEW); gSPMatrix(spBC++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(spBC++, D_06000080); + gSPDisplayList(spBC++, object_uch_DL_000080); spB8->polyXlu.p = spBC; } } @@ -4465,7 +4421,7 @@ void func_80B4DB14(Actor* thisx, GlobalContext* globalCtx) { MTXMODE_APPLY); gSPMatrix(spCC->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(spCC->polyXlu.p++, D_06000720); + gSPDisplayList(spCC->polyXlu.p++, object_uch_DL_000720); } if (this->drawAlien) { @@ -4488,10 +4444,10 @@ void func_80B4DB14(Actor* thisx, GlobalContext* globalCtx) { Matrix_InsertTranslation(sp74.x, sp74.y, sp74.z, MTXMODE_NEW); Matrix_Scale(0.25f, 0.25f, 0.25f, MTXMODE_APPLY); alpha2 = this->alienAlpha * (100.0f / 255.0f); - gSPDisplayList(gfx++, D_04029CB0); + gSPDisplayList(gfx++, gameplay_keep_DL_029CB0); gDPSetPrimColor(gfx++, 0, 0, 240, 180, 100, alpha2); gSPMatrix(gfx++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(gfx++, D_04029CF0); + gSPDisplayList(gfx++, gameplay_keep_DL_029CF0); sp6C->polyXlu.p = gfx; if ((this->alienAlpha > 128) && func_80B456A8(globalCtx, &sp74)) { func_800F9824(globalCtx, &globalCtx->envCtx, &globalCtx->view, globalCtx->state.gfxCtx, sp74, 10.0f, 9.0f, @@ -4548,7 +4504,7 @@ void func_80B4E2AC(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* if (limbIndex == 19) { OPEN_DISPS(globalCtx->state.gfxCtx); - gSPDisplayList(POLY_OPA_DISP++, D_060003B0); + gSPDisplayList(POLY_OPA_DISP++, object_ma1_DL_0003B0); CLOSE_DISPS(globalCtx->state.gfxCtx); } else if (limbIndex == 14) { Matrix_MultiplyVector3fByState(&D_80B4EE30, &this->actor.focus.pos); @@ -4586,7 +4542,7 @@ void func_80B4E3F0(Actor* thisx, GlobalContext* globalCtx) { gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gDPSetPrimColor(POLY_XLU_DISP++, 0xFF, 0x80, 255, 255, 0, 180); gDPSetEnvColor(POLY_XLU_DISP++, 255, 50, 0, 0); - gSPDisplayList(POLY_XLU_DISP++, D_04023210); + gSPDisplayList(POLY_XLU_DISP++, gOwlStatueWhiteFlashDL); if (func_80B456A8(globalCtx, &sp5C)) { func_800F9824(globalCtx, &globalCtx->envCtx, &globalCtx->view, globalCtx->state.gfxCtx, sp5C, 20.0f, 9.0f, 0, 0); diff --git a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c index 4eb146e53..5e7292df5 100644 --- a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c +++ b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c @@ -430,8 +430,11 @@ void EnIshi_Init(Actor* thisx, GlobalContext* globalCtx) { func_8095E5AC(this); } -void EnIshi_Destroy(Actor* thisx, GlobalContext* globalCtx) { - Collider_DestroyCylinder(globalCtx, &THIS->collider); +void EnIshi_Destroy(Actor* thisx, GlobalContext* globalCtx2) { + GlobalContext* globalCtx = globalCtx2; + EnIshi* this = THIS; + + Collider_DestroyCylinder(globalCtx, &this->collider); } void func_8095E5AC(EnIshi* this) { diff --git a/src/overlays/actors/ovl_En_Jc_Mato/z_en_jc_mato.c b/src/overlays/actors/ovl_En_Jc_Mato/z_en_jc_mato.c index c1b5d1327..46122b537 100644 --- a/src/overlays/actors/ovl_En_Jc_Mato/z_en_jc_mato.c +++ b/src/overlays/actors/ovl_En_Jc_Mato/z_en_jc_mato.c @@ -5,6 +5,7 @@ */ #include "z_en_jc_mato.h" +#include "objects/object_tru/object_tru.h" #define FLAGS 0x00004030 @@ -86,8 +87,6 @@ static DamageTable sDamageTable = { /* Powder Keg */ DMG_ENTRY(1, 0x0), }; -extern Gfx D_06000390[]; - s32 EnJcMato_CheckForHit(EnJcMato* this, GlobalContext* globalCtx) { this->collider.dim.worldSphere.center.x = this->pos.x; this->collider.dim.worldSphere.center.y = this->pos.y; @@ -162,7 +161,7 @@ void EnJcMato_Draw(Actor* thisx, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx); func_8012C28C(globalCtx->state.gfxCtx); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, D_06000390); + gSPDisplayList(POLY_OPA_DISP++, object_tru_DL_000390); Matrix_MultiplyVector3fByState(&movement, &this->pos); CLOSE_DISPS(globalCtx->state.gfxCtx); } diff --git a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c index d9cba2bc5..3e6f67ca8 100644 --- a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c +++ b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c @@ -5,6 +5,7 @@ */ #include "z_en_kakasi.h" +#include "objects/object_ka/object_ka.h" #define FLAGS 0x02000019 @@ -125,18 +126,10 @@ typedef enum { /* 0x8 */ ENKAKASI_ANIM_IDLE, // slow stretching wiggle, ends in regular position } EnKakasi_Animations; -extern AnimationHeader D_06007444; -extern AnimationHeader D_0600686C; -extern AnimationHeader D_060081A4; -extern AnimationHeader D_06007B90; -extern AnimationHeader D_060071EC; -extern AnimationHeader D_06007444; -extern AnimationHeader D_0600686C; -extern AnimationHeader D_060081A4; -extern AnimationHeader D_06000214; - static AnimationHeader* kakasiAnimations[] = { - &D_06007444, &D_0600686C, &D_060081A4, &D_06007B90, &D_060071EC, &D_06007444, &D_0600686C, &D_060081A4, &D_06000214, + &object_ka_Anim_007444, &object_ka_Anim_00686C, &object_ka_Anim_0081A4, + &object_ka_Anim_007B90, &object_ka_Anim_0071EC, &object_ka_Anim_007444, + &object_ka_Anim_00686C, &object_ka_Anim_0081A4, &object_ka_Anim_000214, }; static u8 sAnimModes[] = { ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_ONCE, ANIMMODE_ONCE, @@ -148,15 +141,13 @@ void EnKakasi_Destroy(Actor* thisx, GlobalContext* globalCtx) { Collider_DestroyCylinder(globalCtx, &this->collider); } -extern FlexSkeletonHeader D_060065B0; - void EnKakasi_Init(Actor* thisx, GlobalContext* globalCtx) { EnKakasi* this = THIS; s32 tempCutscene; s32 i; Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &D_80971D80); - SkelAnime_InitFlex(globalCtx, &this->skelanime, &D_060065B0, &D_06000214, 0, 0, 0); + SkelAnime_InitFlex(globalCtx, &this->skelanime, &object_ka_Skel_0065B0, &object_ka_Anim_000214, 0, 0, 0); this->songSummonDist = GET_KAKASI_SUMMON_DISTANCE(this) * 20.0f; if (this->songSummonDist < 40.0f) { diff --git a/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c b/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c index 6d672e003..1895bea75 100644 --- a/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c +++ b/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c @@ -7,6 +7,8 @@ #include "overlays/actors/ovl_En_Kbt/z_en_kbt.h" #include "overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.h" #include "z_en_kgy.h" +#include "objects/object_kgy/object_kgy.h" +#include "objects/gameplay_keep/gameplay_keep.h" #define FLAGS 0x00000009 @@ -31,24 +33,6 @@ void func_80B425A0(EnKgy* this, GlobalContext* globalCtx); void func_80B42714(EnKgy* this, GlobalContext* globalCtx); void func_80B42D28(EnKgy* this, GlobalContext* globalCtx); -extern AnimationHeader D_060008FC; -extern AnimationHeader D_06001764; -extern Gfx D_04001D00[]; -extern AnimationHeader D_06001EA4; -extern Gfx D_040021A8[]; -extern AnimationHeader D_0600292C; -extern AnimationHeader D_06003334; -extern AnimationHeader D_06003D88; -extern AnimationHeader D_060042E4; -extern AnimationHeader D_06004B98; -extern Gfx D_0600E8F0[]; -extern Gfx D_0600EE58[]; -extern Gfx D_0600F180[]; -extern Gfx D_0600F6A0[]; -extern FlexSkeletonHeader D_0600F910; -extern AnimationHeader D_06010B84; -extern AnimationHeader D_060101F0; - const ActorInit En_Kgy_InitVars = { ACTOR_EN_KGY, ACTORCAT_NPC, @@ -67,7 +51,8 @@ void EnKgy_Init(Actor* thisx, GlobalContext* globalCtx) { s32 i; Actor_SetScale(&this->actor, 0.01f); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600F910, &D_06004B98, this->jointTable, this->morphTable, 23); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_kgy_Skel_00F910, &object_kgy_Anim_004B98, this->jointTable, + this->morphTable, 23); this->unk_2D2 = -1; this->unk_29C = 0; this->unk_2E4 = 0; @@ -127,8 +112,9 @@ void EnKgy_Destroy(Actor* thisx, GlobalContext* globalCtx) { void EnKgy_ChangeAnim(EnKgy* this, s16 animIndex, u8 mode, f32 transitionRate) { static AnimationHeader* sAnimations[] = { - &D_06004B98, &D_060008FC, &D_0600292C, &D_060042E4, &D_060101F0, - &D_06001764, &D_06003334, &D_06010B84, &D_06001EA4, &D_06003D88, + &object_kgy_Anim_004B98, &object_kgy_Anim_0008FC, &object_kgy_Anim_00292C, &object_kgy_Anim_0042E4, + &object_kgy_Anim_0101F0, &object_kgy_Anim_001764, &object_kgy_Anim_003334, &object_kgy_Anim_010B84, + &object_kgy_Anim_001EA4, &object_kgy_Anim_003D88, }; Animation_Change(&this->skelAnime, sAnimations[animIndex], 1.0f, 0.0f, @@ -1155,20 +1141,20 @@ void func_80B43074(EnKgy* this, GlobalContext* globalCtx) { Matrix_InsertXRotation_s(0x4000, MTXMODE_APPLY); if (func_80B40D8C(globalCtx)) { - AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(D_0600F6A0)); + AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(object_kgy_Matanimheader_00F6A0)); } else { - AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(D_0600EE58)); + AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(object_kgy_Matanimheader_00EE58)); } gfx = POLY_OPA_DISP; gSPMatrix(gfx, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); if (func_80B40D8C(globalCtx)) { - gSPDisplayList(&gfx[1], D_04001D00); - gSPDisplayList(&gfx[2], D_0600F180); + gSPDisplayList(&gfx[1], gameplay_keep_DL_001D00); + gSPDisplayList(&gfx[2], object_kgy_DL_00F180); } else { - gSPDisplayList(&gfx[1], D_040021A8); - gSPDisplayList(&gfx[2], D_0600E8F0); + gSPDisplayList(&gfx[1], gameplay_keep_DL_0021A8); + gSPDisplayList(&gfx[2], object_kgy_DL_00E8F0); } POLY_OPA_DISP = &gfx[3]; diff --git a/src/overlays/actors/ovl_En_Knight/z_en_knight.h b/src/overlays/actors/ovl_En_Knight/z_en_knight.h index 00c48db91..8191b13a2 100644 --- a/src/overlays/actors/ovl_En_Knight/z_en_knight.h +++ b/src/overlays/actors/ovl_En_Knight/z_en_knight.h @@ -9,9 +9,21 @@ typedef void (*EnKnightActionFunc)(struct EnKnight*, GlobalContext*); typedef struct EnKnight { /* 0x0000 */ Actor actor; - /* 0x0144 */ char unk_144[0x2DC]; + /* 0x0144 */ s16 unk_144; + /* 0x0146 */ char unk_146[0x2]; + /* 0x0148 */ s8 unk_148; + /* 0x0149 */ char pad149[8]; + /* 0x0151 */ s8 unk_151; + /* 0x0152 */ char pad152[1]; + /* 0x0153 */ u8 unk_153; + /* 0x0154 */ u8 unk_154; + /* 0x0155 */ char pad155[0x2CB]; /* 0x0420 */ EnKnightActionFunc actionFunc; - /* 0x0424 */ char unk_424[0x2B0]; + /* 0x0424 */ char unk_424[0x25C]; + /* 0x0680 */ u8 unk_680; + /* 0x0681 */ char pad681[9]; + /* 0x068A */ s16 unk_68A; + /* 0x068C */ char pad68C[0x48]; } EnKnight; // size = 0x6D4 extern const ActorInit En_Knight_InitVars; diff --git a/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c b/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c index d32735035..12ce6eecf 100644 --- a/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c +++ b/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c @@ -5,6 +5,8 @@ */ #include "z_en_kusa2.h" +#include "objects/gameplay_field_keep/gameplay_field_keep.h" +#include "objects/gameplay_keep/gameplay_keep.h" #define FLAGS 0x00800010 @@ -1308,8 +1310,8 @@ void EnKusa2_Update(Actor* thisx, GlobalContext* globalCtx) { void func_80A5E6F0(Actor* thisx, GlobalContext* globalCtx) { static Gfx* D_80A5EB68[] = { - D_040528B0, - D_040527F0, + gameplay_keep_DL_0528B0, + gameplay_keep_DL_0527F0, }; EnKusa2* this = THIS; s32 i; @@ -1341,7 +1343,7 @@ void func_80A5E80C(GlobalContext* globalCtx, s32 arg1) { gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, arg1); - gSPDisplayList(POLY_XLU_DISP++, D_05007938); + gSPDisplayList(POLY_XLU_DISP++, gameplay_field_keep_DL_007938); CLOSE_DISPS(globalCtx->state.gfxCtx); } @@ -1354,7 +1356,7 @@ void EnKusa2_Draw(Actor* thisx, GlobalContext* globalCtx) { (this->actor.projectedPos.z < 400.0f)) { func_80A5B954(&D_80A60908[this->unk_1CE], 0.0015f); } - Gfx_DrawDListOpa(globalCtx, D_050078A0); + Gfx_DrawDListOpa(globalCtx, gameplay_field_keep_DL_0078A0); } else if (this->actor.projectedPos.z < 1300.0f) { func_80A5E80C(globalCtx, (1300.0f - this->actor.projectedPos.z) * 2.55f); } @@ -1368,14 +1370,14 @@ void func_80A5E9B4(Actor* thisx, GlobalContext* globalCtx) { sp18.z = thisx->shape.rot.z + D_80A5EAFC.z; Matrix_SetStateRotationAndTranslation(thisx->world.pos.x, thisx->world.pos.y, thisx->world.pos.z, &sp18); Matrix_Scale(thisx->scale.x, thisx->scale.y, thisx->scale.z, MTXMODE_APPLY); - Gfx_DrawDListOpa(globalCtx, D_050078A0); + Gfx_DrawDListOpa(globalCtx, gameplay_field_keep_DL_0078A0); } void func_80A5EA48(Actor* thisx, GlobalContext* globalCtx) { EnKusa2* this = THIS; if (this->unk_1CF == 0xFF) { - Gfx_DrawDListOpa(globalCtx, D_050078A0); + Gfx_DrawDListOpa(globalCtx, gameplay_field_keep_DL_0078A0); } else { func_80A5E80C(globalCtx, this->unk_1CF); } diff --git a/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c b/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c index 6c6f02f05..264f9ba56 100644 --- a/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c +++ b/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c @@ -5,6 +5,7 @@ */ #include "z_en_ma4.h" +#include "objects/object_ma1/object_ma1.h" #define FLAGS 0x02000039 @@ -54,35 +55,6 @@ typedef enum { /* 3 */ MA4_STATE_AFTERDESCRIBETHEMCS, } EnMa4State; -extern FlexSkeletonHeader D_06013928; - -extern AnimationHeader D_06009E58; -extern AnimationHeader D_06002A8C; -extern AnimationHeader D_06018948; -extern AnimationHeader D_0601B76C; -extern AnimationHeader D_06007328; -extern AnimationHeader D_06014088; -extern AnimationHeader D_06015B7C; -extern AnimationHeader D_06007D98; -extern AnimationHeader D_0600852C; -extern AnimationHeader D_06008F6C; - -extern u64 D_0600FFC8[]; -extern u64 D_060107C8[]; -extern u64 D_06010FC8[]; -extern u64 D_060117C8[]; -extern u64 D_06011FC8[]; - -extern u64 D_060127C8[]; -extern u64 D_06012BC8[]; -extern u64 D_06012FC8[]; -extern u64 D_060133C8[]; - -extern Gfx D_060003B0[]; - -// Box -extern Gfx D_06000A20[]; - const ActorInit En_Ma4_InitVars = { ACTOR_EN_MA4, ACTORCAT_NPC, @@ -117,15 +89,15 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit2 D_80AC00DC = { 0, 0, 0, 0, MASS_IMMOVABLE }; -static void* sEyeTextures[] = { - D_0600FFC8, D_060107C8, D_06010FC8, D_060117C8, D_06011FC8, +static TexturePtr sEyeTextures[] = { + object_ma1_Tex_00FFC8, object_ma1_Tex_0107C8, object_ma1_Tex_010FC8, object_ma1_Tex_0117C8, object_ma1_Tex_011FC8, }; -static void* sMouthTextures[] = { - D_060127C8, - D_06012BC8, - D_06012FC8, - D_060133C8, +static TexturePtr sMouthTextures[] = { + object_ma1_Tex_0127C8, + object_ma1_Tex_012BC8, + object_ma1_Tex_012FC8, + object_ma1_Tex_0133C8, }; void EnMa4_UpdateEyes(EnMa4* this) { @@ -141,16 +113,26 @@ void EnMa4_UpdateEyes(EnMa4* this) { } static struct_80B8E1A8 sAnimationInfo[] = { - { &D_06009E58, 1.0f, 0, 0.0f }, { &D_06009E58, 1.0f, 0, -6.0f }, // Idle anim - { &D_06002A8C, 1.0f, 0, 0.0f }, { &D_06002A8C, 1.0f, 0, -6.0f }, // Looking around anim - { &D_06018948, 1.0f, 2, 0.0f }, { &D_06018948, 1.0f, 2, -6.0f }, // Starts holding hands anim - { &D_0601B76C, 1.0f, 0, 0.0f }, { &D_0601B76C, 1.0f, 0, -6.0f }, // Holnding hands anim - { &D_06007328, 1.0f, 0, 0.0f }, { &D_06007328, 1.0f, 0, -6.0f }, // Walking anim - { &D_06014088, 1.0f, 0, 0.0f }, { &D_06014088, 1.0f, 0, -6.0f }, // - { &D_06015B7C, 1.0f, 2, 0.0f }, { &D_06015B7C, 1.0f, 2, -6.0f }, // Shoot arrow anim - { &D_06007D98, 1.0f, 0, 0.0f }, { &D_06007D98, 1.0f, 0, -6.0f }, // Sitting anim - { &D_0600852C, 1.0f, 0, 0.0f }, { &D_0600852C, 1.0f, 0, -6.0f }, // Sitting traumatized anim - { &D_06008F6C, 1.0f, 0, 0.0f }, { &D_06008F6C, 1.0f, 0, -6.0f }, // Sitting sad anim + { &object_ma1_Anim_009E58, 1.0f, 0, 0.0f }, + { &object_ma1_Anim_009E58, 1.0f, 0, -6.0f }, // Idle anim + { &object_ma1_Anim_002A8C, 1.0f, 0, 0.0f }, + { &object_ma1_Anim_002A8C, 1.0f, 0, -6.0f }, // Looking around anim + { &object_ma1_Anim_018948, 1.0f, 2, 0.0f }, + { &object_ma1_Anim_018948, 1.0f, 2, -6.0f }, // Starts holding hands anim + { &object_ma1_Anim_01B76C, 1.0f, 0, 0.0f }, + { &object_ma1_Anim_01B76C, 1.0f, 0, -6.0f }, // Holnding hands anim + { &object_ma1_Anim_007328, 1.0f, 0, 0.0f }, + { &object_ma1_Anim_007328, 1.0f, 0, -6.0f }, // Walking anim + { &object_ma1_Anim_014088, 1.0f, 0, 0.0f }, + { &object_ma1_Anim_014088, 1.0f, 0, -6.0f }, // + { &object_ma1_Anim_015B7C, 1.0f, 2, 0.0f }, + { &object_ma1_Anim_015B7C, 1.0f, 2, -6.0f }, // Shoot arrow anim + { &object_ma1_Anim_007D98, 1.0f, 0, 0.0f }, + { &object_ma1_Anim_007D98, 1.0f, 0, -6.0f }, // Sitting anim + { &object_ma1_Anim_00852C, 1.0f, 0, 0.0f }, + { &object_ma1_Anim_00852C, 1.0f, 0, -6.0f }, // Sitting traumatized anim + { &object_ma1_Anim_008F6C, 1.0f, 0, 0.0f }, + { &object_ma1_Anim_008F6C, 1.0f, 0, -6.0f }, // Sitting sad anim }; void EnMa4_ChangeAnim(EnMa4* this, s32 index) { @@ -163,9 +145,9 @@ void func_80ABDD9C(EnMa4* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); s16 flag; - if (this->unk_1D8.unk_00 == 0 && - ((this->skelAnime.animation == &D_06007328) || (this->skelAnime.animation == &D_06002A8C) || - (this->skelAnime.animation == &D_06015B7C))) { + if (this->unk_1D8.unk_00 == 0 && ((this->skelAnime.animation == &object_ma1_Anim_007328) || + (this->skelAnime.animation == &object_ma1_Anim_002A8C) || + (this->skelAnime.animation == &object_ma1_Anim_015B7C))) { flag = 1; } else { flag = (this->type == MA4_TYPE_ALIENS_WON && this->actionFunc != EnMa4_DialogueHandler) ? 1 : 0; @@ -201,7 +183,7 @@ void EnMa4_Init(Actor* thisx, GlobalContext* globalCtx) { s32 pad; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 18.0f); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06013928, NULL, this->jointTable, this->morphTable, + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_ma1_Skel_013928, NULL, this->jointTable, this->morphTable, MA1_LIMB_MAX); Collider_InitCylinder(globalCtx, &this->collider); @@ -318,7 +300,7 @@ void EnMa4_RunInCircles(EnMa4* this, GlobalContext* globalCtx) { Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); Actor_MoveWithGravity(&this->actor); - if (this->skelAnime.animation == &D_06007328) { // Walking animation + if (this->skelAnime.animation == &object_ma1_Anim_007328) { // Walking animation if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 4.0f)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_ROMANI_WALK); } @@ -1074,7 +1056,7 @@ void EnMa4_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve } else if (limbIndex == MA1_LIMB_HAND_LEFT) { if (this->hasBow == true) { OPEN_DISPS(globalCtx->state.gfxCtx); - gSPDisplayList(POLY_OPA_DISP++, D_060003B0); + gSPDisplayList(POLY_OPA_DISP++, object_ma1_DL_0003B0); CLOSE_DISPS(globalCtx->state.gfxCtx); } } @@ -1086,7 +1068,7 @@ void EnMa4_Draw(Actor* thisx, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx); if (this->type == MA4_TYPE_ALIENS_WON) { gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, D_06000A20); + gSPDisplayList(POLY_OPA_DISP++, object_ma1_DL_000A20); } func_8012C28C(globalCtx->state.gfxCtx); diff --git a/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.c b/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.c index d210f3da0..05e97af2c 100644 --- a/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.c +++ b/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.c @@ -5,6 +5,7 @@ */ #include "z_en_ma_yto.h" +#include "objects/object_ma2/object_ma2.h" #define FLAGS 0x02100009 @@ -108,60 +109,31 @@ static CollisionCheckInfoInit2 sColChkInfoInit2 = { 0, 0, 0, 0, MASS_IMMOVABLE, }; -extern FlexSkeletonHeader D_06015C28; - -extern AnimationHeader D_0600A174; -extern AnimationHeader D_0600AF7C; -extern AnimationHeader D_06000CC0; -extern AnimationHeader D_06016720; -extern AnimationHeader D_06005314; -extern AnimationHeader D_060093E8; -extern AnimationHeader D_06007E28; -extern AnimationHeader D_060070EC; -extern AnimationHeader D_06003D54; -extern AnimationHeader D_06001FD0; -extern AnimationHeader D_060030B4; -extern AnimationHeader D_06004370; - -extern void* D_06014AD8[]; -extern void* D_06014ED8[]; -extern void* D_060152D8[]; -extern void* D_060156D8[]; - -extern void* D_06011AD8[]; -extern void* D_060122D8[]; -extern void* D_06012AD8[]; -extern void* D_060132D8[]; -extern void* D_06013AD8[]; -extern void* D_060142D8[]; - -// gCremiaWoodenBox -extern Gfx D_06005430[]; - static struct_80B8E1A8 sAnimationInfo[] = { - { &D_0600A174, 1.0f, 0, 0.0f }, { &D_0600A174, 1.0f, 0, -6.0f }, // - { &D_0600AF7C, 1.0f, 2, 0.0f }, { &D_0600AF7C, 1.0f, 2, -6.0f }, // - { &D_06000CC0, 1.0f, 0, 0.0f }, { &D_06000CC0, 1.0f, 0, -6.0f }, // - { &D_06016720, 1.0f, 0, 0.0f }, { &D_06016720, 1.0f, 0, -8.0f }, // - { &D_06005314, 1.0f, 0, 0.0f }, { &D_06005314, 1.0f, 0, -8.0f }, // - { &D_060093E8, 1.0f, 0, 0.0f }, { &D_060093E8, 1.0f, 0, -10.0f }, // - { &D_06007E28, 1.0f, 0, 0.0f }, { &D_06007E28, 1.0f, 0, -8.0f }, // - { &D_060070EC, 1.0f, 0, 0.0f }, { &D_060070EC, 1.0f, 0, -8.0f }, // - { &D_06003D54, 1.0f, 0, 0.0f }, { &D_06003D54, 1.0f, 0, -8.0f }, // - { &D_06001FD0, 1.0f, 0, 0.0f }, { &D_06001FD0, 1.0f, 0, -8.0f }, // - { &D_060030B4, 1.0f, 0, 0.0f }, { &D_060030B4, 1.0f, 0, -8.0f }, // - { &D_06004370, 1.0f, 0, 0.0f }, { &D_06004370, 1.0f, 0, -8.0f }, // + { &object_ma2_Anim_00A174, 1.0f, 0, 0.0f }, { &object_ma2_Anim_00A174, 1.0f, 0, -6.0f }, // + { &object_ma2_Anim_00AF7C, 1.0f, 2, 0.0f }, { &object_ma2_Anim_00AF7C, 1.0f, 2, -6.0f }, // + { &object_ma2_Anim_000CC0, 1.0f, 0, 0.0f }, { &object_ma2_Anim_000CC0, 1.0f, 0, -6.0f }, // + { &object_ma2_Anim_016720, 1.0f, 0, 0.0f }, { &object_ma2_Anim_016720, 1.0f, 0, -8.0f }, // + { &object_ma2_Anim_005314, 1.0f, 0, 0.0f }, { &object_ma2_Anim_005314, 1.0f, 0, -8.0f }, // + { &object_ma2_Anim_0093E8, 1.0f, 0, 0.0f }, { &object_ma2_Anim_0093E8, 1.0f, 0, -10.0f }, // + { &object_ma2_Anim_007E28, 1.0f, 0, 0.0f }, { &object_ma2_Anim_007E28, 1.0f, 0, -8.0f }, // + { &object_ma2_Anim_0070EC, 1.0f, 0, 0.0f }, { &object_ma2_Anim_0070EC, 1.0f, 0, -8.0f }, // + { &object_ma2_Anim_003D54, 1.0f, 0, 0.0f }, { &object_ma2_Anim_003D54, 1.0f, 0, -8.0f }, // + { &object_ma2_Anim_001FD0, 1.0f, 0, 0.0f }, { &object_ma2_Anim_001FD0, 1.0f, 0, -8.0f }, // + { &object_ma2_Anim_0030B4, 1.0f, 0, 0.0f }, { &object_ma2_Anim_0030B4, 1.0f, 0, -8.0f }, // + { &object_ma2_Anim_004370, 1.0f, 0, 0.0f }, { &object_ma2_Anim_004370, 1.0f, 0, -8.0f }, // }; -static void* sMouthTextures[] = { - D_06014AD8, - D_06014ED8, - D_060152D8, - D_060156D8, +static TexturePtr sMouthTextures[] = { + object_ma2_Tex_014AD8, + object_ma2_Tex_014ED8, + object_ma2_Tex_0152D8, + object_ma2_Tex_0156D8, }; -static void* sEyesTextures[] = { - D_06011AD8, D_060122D8, D_06012AD8, D_060132D8, D_06013AD8, D_060142D8, +static TexturePtr sEyesTextures[] = { + object_ma2_Tex_011AD8, object_ma2_Tex_0122D8, object_ma2_Tex_012AD8, + object_ma2_Tex_0132D8, object_ma2_Tex_013AD8, object_ma2_Tex_0142D8, }; void EnMaYto_Init(Actor* thisx, GlobalContext* globalCtx) { @@ -189,7 +161,7 @@ void EnMaYto_Init(Actor* thisx, GlobalContext* globalCtx) { } ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 18.0f); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06015C28, NULL, this->jointTable, this->morphTable, + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_ma2_Skel_015C28, NULL, this->jointTable, this->morphTable, MA2_LIMB_MAX); EnMaYto_InitAnimation(this, globalCtx); @@ -464,7 +436,7 @@ void EnMaYto_DefaultDialogueHandler(EnMaYto* this, GlobalContext* globalCtx) { } Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 5, 0x3000, 0x100); - if (this->textId == 0x3395 && this->skelAnime.animation == &D_0600AF7C && + if (this->textId == 0x3395 && this->skelAnime.animation == &object_ma2_Anim_00AF7C && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { EnMaYto_ChangeAnim(this, 4); } @@ -1081,7 +1053,7 @@ void EnMaYto_WarmFuzzyFeelingCs(EnMaYto* this, GlobalContext* globalCtx) { } func_800EDF24(&this->actor, globalCtx, csActionIndex); - if (D_80B915F0 == 2 && this->skelAnime.animation == &D_06001FD0 && + if (D_80B915F0 == 2 && this->skelAnime.animation == &object_ma2_Anim_001FD0 && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { EnMaYto_ChangeAnim(this, 20); } @@ -1464,12 +1436,14 @@ s32 EnMaYto_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dLis rot->x += sp4.y; rot->z += sp4.x; } else if (limbIndex == MA2_LIMB_TORSO) { - if (this->skelAnime.animation != &D_06007E28 && this->skelAnime.animation != &D_06003D54) { + if (this->skelAnime.animation != &object_ma2_Anim_007E28 && + this->skelAnime.animation != &object_ma2_Anim_003D54) { sp4 = this->unk_1D8.unk_0E; rot->x += sp4.y; - if (this->skelAnime.animation == &D_0600A174 || this->skelAnime.animation == &D_060070EC || - this->skelAnime.animation == &D_06003D54) { + if (this->skelAnime.animation == &object_ma2_Anim_00A174 || + this->skelAnime.animation == &object_ma2_Anim_0070EC || + this->skelAnime.animation == &object_ma2_Anim_003D54) { rot->z += sp4.x; } } @@ -1492,7 +1466,7 @@ void EnMaYto_Draw(Actor* thisx, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx); if (this->type == MA_YTO_TYPE_BARN && (gSaveContext.save.weekEventReg[0x16] & 1)) { // Alieans defeated gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, D_06005430); + gSPDisplayList(POLY_OPA_DISP++, gCremiaWoodenBox); } func_8012C28C(globalCtx->state.gfxCtx); diff --git a/src/overlays/actors/ovl_En_Ma_Yts/z_en_ma_yts.c b/src/overlays/actors/ovl_En_Ma_Yts/z_en_ma_yts.c index dfc12aae8..0929b31cf 100644 --- a/src/overlays/actors/ovl_En_Ma_Yts/z_en_ma_yts.c +++ b/src/overlays/actors/ovl_En_Ma_Yts/z_en_ma_yts.c @@ -5,6 +5,7 @@ */ #include "z_en_ma_yts.h" +#include "objects/object_ma1/object_ma1.h" #define FLAGS 0x02100009 @@ -29,40 +30,6 @@ void EnMaYts_SetFaceExpression(EnMaYts* this, s16 overrideEyeTexIndex, s16 mouth void EnMaYts_DrawSleeping(Actor* thisx, GlobalContext* globalCtx); -extern AnimationHeader D_06009E58; -extern AnimationHeader D_06018948; -extern AnimationHeader D_0601B76C; -extern AnimationHeader D_06007328; -extern AnimationHeader D_06014088; -extern AnimationHeader D_06002A8C; -extern AnimationHeader D_06015B7C; -extern AnimationHeader D_06007D98; -extern AnimationHeader D_0600852C; -extern AnimationHeader D_06008F6C; -extern AnimationHeader D_060180DC; - -extern u64 D_060127C8[]; -extern u64 D_06012BC8[]; -extern u64 D_06012FC8[]; -extern u64 D_060133C8[]; - -extern u64 D_0600FFC8[]; -extern u64 D_060107C8[]; -extern u64 D_06010FC8[]; -extern u64 D_060117C8[]; -extern u64 D_06011FC8[]; - -extern FlexSkeletonHeader D_06013928; - -extern AnimationHeader D_06009E58; -extern AnimationHeader D_06007D98; - -// Bow -extern Gfx D_060003B0[]; - -// Sleeping -extern Gfx D_060043A0[]; - const ActorInit En_Ma_Yts_InitVars = { ACTOR_EN_MA_YTS, ACTORCAT_NPC, @@ -112,28 +79,39 @@ static CollisionCheckInfoInit2 sColChkInfoInit2 = { }; static struct_80B8E1A8 sAnimationInfo[] = { - { &D_06009E58, 1.0f, 0, 0.0f }, { &D_06009E58, 1.0f, 0, -6.0f }, // Idle anim - { &D_06018948, 1.0f, 2, 0.0f }, { &D_06018948, 1.0f, 2, -6.0f }, // Starts holding hands anim - { &D_0601B76C, 1.0f, 0, 0.0f }, { &D_0601B76C, 1.0f, 0, -6.0f }, // Holnding hands anim - { &D_06007328, 1.0f, 0, 0.0f }, { &D_06007328, 1.0f, 0, -6.0f }, // Walking anim - { &D_06014088, 1.0f, 0, 0.0f }, { &D_06014088, 1.0f, 0, -6.0f }, // - { &D_06002A8C, 1.0f, 0, 0.0f }, { &D_06002A8C, 1.0f, 0, -6.0f }, // Looking around anim - { &D_06015B7C, 1.0f, 0, 0.0f }, { &D_06015B7C, 1.0f, 0, -6.0f }, // Shoot arrow anim - { &D_06007D98, 1.0f, 0, 0.0f }, { &D_06007D98, 1.0f, 0, -6.0f }, // Sitting anim - { &D_0600852C, 1.0f, 0, 0.0f }, { &D_0600852C, 1.0f, 0, -6.0f }, // Sitting traumatized anim - { &D_06008F6C, 1.0f, 0, 0.0f }, { &D_06008F6C, 1.0f, 0, -6.0f }, // Sitting sad anim - { &D_060180DC, 1.0f, 2, 0.0f }, { &D_060180DC, 1.0f, 2, -6.0f }, // Turns around anim + { &object_ma1_Anim_009E58, 1.0f, 0, 0.0f }, + { &object_ma1_Anim_009E58, 1.0f, 0, -6.0f }, // Idle anim + { &object_ma1_Anim_018948, 1.0f, 2, 0.0f }, + { &object_ma1_Anim_018948, 1.0f, 2, -6.0f }, // Starts holding hands anim + { &object_ma1_Anim_01B76C, 1.0f, 0, 0.0f }, + { &object_ma1_Anim_01B76C, 1.0f, 0, -6.0f }, // Holnding hands anim + { &object_ma1_Anim_007328, 1.0f, 0, 0.0f }, + { &object_ma1_Anim_007328, 1.0f, 0, -6.0f }, // Walking anim + { &object_ma1_Anim_014088, 1.0f, 0, 0.0f }, + { &object_ma1_Anim_014088, 1.0f, 0, -6.0f }, // + { &object_ma1_Anim_002A8C, 1.0f, 0, 0.0f }, + { &object_ma1_Anim_002A8C, 1.0f, 0, -6.0f }, // Looking around anim + { &object_ma1_Anim_015B7C, 1.0f, 0, 0.0f }, + { &object_ma1_Anim_015B7C, 1.0f, 0, -6.0f }, // Shoot arrow anim + { &object_ma1_Anim_007D98, 1.0f, 0, 0.0f }, + { &object_ma1_Anim_007D98, 1.0f, 0, -6.0f }, // Sitting anim + { &object_ma1_Anim_00852C, 1.0f, 0, 0.0f }, + { &object_ma1_Anim_00852C, 1.0f, 0, -6.0f }, // Sitting traumatized anim + { &object_ma1_Anim_008F6C, 1.0f, 0, 0.0f }, + { &object_ma1_Anim_008F6C, 1.0f, 0, -6.0f }, // Sitting sad anim + { &object_ma1_Anim_0180DC, 1.0f, 2, 0.0f }, + { &object_ma1_Anim_0180DC, 1.0f, 2, -6.0f }, // Turns around anim }; -static void* sMouthTextures[] = { - D_060127C8, - D_06012BC8, - D_06012FC8, - D_060133C8, +static TexturePtr sMouthTextures[] = { + object_ma1_Tex_0127C8, + object_ma1_Tex_012BC8, + object_ma1_Tex_012FC8, + object_ma1_Tex_0133C8, }; -static void* sEyeTextures[] = { - D_0600FFC8, D_060107C8, D_06010FC8, D_060117C8, D_06011FC8, +static TexturePtr sEyeTextures[] = { + object_ma1_Tex_00FFC8, object_ma1_Tex_0107C8, object_ma1_Tex_010FC8, object_ma1_Tex_0117C8, object_ma1_Tex_011FC8, }; void EnMaYts_ChangeAnim(EnMaYts* this, s32 index) { @@ -247,7 +225,7 @@ void EnMaYts_Init(Actor* thisx, GlobalContext* globalCtx) { } ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 18.0f); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06013928, NULL, this->jointTable, this->morphTable, + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_ma1_Skel_013928, NULL, this->jointTable, this->morphTable, MA1_LIMB_MAX); EnMaYts_InitAnimation(this, globalCtx); @@ -531,7 +509,8 @@ s32 EnMaYts_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dLis if (limbIndex == MA1_LIMB_HEAD) { sp4 = this->unk_1D8.unk_08; rot->x += sp4.y; - if ((this->skelAnime.animation == &D_06009E58) || (this->skelAnime.animation == &D_06007D98)) { + if ((this->skelAnime.animation == &object_ma1_Anim_009E58) || + (this->skelAnime.animation == &object_ma1_Anim_007D98)) { rot->z += sp4.x; } } else if (limbIndex == MA1_LIMB_TORSO) { @@ -551,7 +530,7 @@ void EnMaYts_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, } else if (limbIndex == MA1_LIMB_HAND_LEFT) { if (this->hasBow == true) { OPEN_DISPS(globalCtx->state.gfxCtx); - gSPDisplayList(POLY_OPA_DISP++, D_060003B0); + gSPDisplayList(POLY_OPA_DISP++, object_ma1_DL_0003B0); CLOSE_DISPS(globalCtx->state.gfxCtx); } } @@ -578,7 +557,7 @@ void EnMaYts_DrawSleeping(Actor* thisx, GlobalContext* globalCtx) { func_8012C28C(globalCtx->state.gfxCtx); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, D_060043A0); + gSPDisplayList(POLY_OPA_DISP++, object_ma1_DL_0043A0); CLOSE_DISPS(globalCtx->state.gfxCtx); } diff --git a/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c b/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c index 61a9bbc52..9b395b55e 100644 --- a/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c +++ b/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c @@ -5,6 +5,8 @@ */ #include "z_en_minifrog.h" +#include "objects/object_fr/object_fr.h" +#include "objects/gameplay_keep/gameplay_keep.h" #define FLAGS 0x00000019 @@ -24,12 +26,6 @@ void EnMinifrog_UpdateMissingFrog(Actor* thisx, GlobalContext* globalCtx); void EnMinifrog_YellowFrogDialog(EnMinifrog* this, GlobalContext* globalCtx); void EnMinifrog_SetupYellowFrogDialog(EnMinifrog* this, GlobalContext* globalCtx); -extern AnimationHeader D_060007BC; -extern AnimationHeader D_06001534; -extern FlexSkeletonHeader D_0600B538; -extern UNK_TYPE4 D_060059A0; -extern UNK_TYPE4 D_06005BA0; - const ActorInit En_Minifrog_InitVars = { ACTOR_EN_MINIFROG, ACTORCAT_NPC, @@ -65,9 +61,9 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit sColChkInfoInit = { 1, 12, 14, MASS_IMMOVABLE }; // sEyeTextures??? -static UNK_TYPE4* D_808A4D74[] = { - &D_060059A0, - &D_06005BA0, +static TexturePtr D_808A4D74[] = { + object_fr_Tex_0059A0, + object_fr_Tex_005BA0, }; // gSaveContext.save.weekEventReg[KEY] = VALUE @@ -92,7 +88,8 @@ void EnMinifrog_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChain); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 15.0f); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600B538, &D_06001534, this->jointTable, this->morphTable, 24); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_fr_Skel_00B538, &object_fr_Anim_001534, this->jointTable, + this->morphTable, 24); CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); @@ -180,7 +177,7 @@ EnMinifrog* EnMinifrog_GetFrog(GlobalContext* globalCtx) { void EnMinifrog_SetJumpState(EnMinifrog* this) { if (this->jumpState == MINIFROG_STATE_GROUND) { this->jumpState = MINIFROG_STATE_JUMP; - Animation_Change(&this->skelAnime, &D_060007BC, 1.0f, 0.0f, 7.0f, 2, -5.0f); + Animation_Change(&this->skelAnime, &object_fr_Anim_0007BC, 1.0f, 0.0f, 7.0f, 2, -5.0f); } } @@ -207,7 +204,7 @@ void EnMinifrog_Jump(EnMinifrog* this) { case MINIFROG_STATE_AIR: if (this->actor.bgCheckFlags & 1) { this->jumpState = MINIFROG_STATE_GROUND; - Animation_MorphToLoop(&this->skelAnime, &D_06001534, -2.5f); + Animation_MorphToLoop(&this->skelAnime, &object_fr_Anim_001534, -2.5f); SkelAnime_Update(&this->skelAnime); } break; @@ -413,7 +410,7 @@ void EnMinifrog_NextFrogReturned(EnMinifrog* this, GlobalContext* globalCtx) { this->actionFunc = EnMinifrog_ContinueChoirCutscene; this->flags &= ~(0x2 << MINIFROG_YELLOW | 0x2 << MINIFROG_CYAN | 0x2 << MINIFROG_PINK | 0x2 << MINIFROG_BLUE | 0x2 << MINIFROG_WHITE); - globalCtx->setPlayerTalkAnim(globalCtx, &D_0400DEA8, 0); + globalCtx->setPlayerTalkAnim(globalCtx, &gameplay_keep_Linkanim_00DEA8, 0); } } @@ -444,7 +441,7 @@ void EnMinifrog_SetupNextFrogChoir(EnMinifrog* this, GlobalContext* globalCtx) { this->flags &= ~0x100; this->flags &= ~(0x2 << MINIFROG_YELLOW | 0x2 << MINIFROG_CYAN | 0x2 << MINIFROG_PINK | 0x2 << MINIFROG_BLUE | 0x2 << MINIFROG_WHITE); - globalCtx->setPlayerTalkAnim(globalCtx, &D_0400DEA8, 0); + globalCtx->setPlayerTalkAnim(globalCtx, &gameplay_keep_Linkanim_00DEA8, 0); } else if (this->timer <= 0) { this->actionFunc = EnMinifrog_NextFrogReturned; this->timer = 30; @@ -464,7 +461,7 @@ void EnMinifrog_BeginChoirCutscene(EnMinifrog* this, GlobalContext* globalCtx) { this->timer = 5; func_801A1F00(3, NA_BGM_FROG_SONG); this->flags |= 0x100; - globalCtx->setPlayerTalkAnim(globalCtx, &D_0400E2A8, 0); + globalCtx->setPlayerTalkAnim(globalCtx, &gameplay_keep_Linkanim_00E2A8, 0); } else { ActorCutscene_SetIntentToPlay(this->actor.cutscene); } diff --git a/src/overlays/actors/ovl_En_Mm/z_en_mm.c b/src/overlays/actors/ovl_En_Mm/z_en_mm.c index a725fa554..f72ceaf9b 100644 --- a/src/overlays/actors/ovl_En_Mm/z_en_mm.c +++ b/src/overlays/actors/ovl_En_Mm/z_en_mm.c @@ -5,6 +5,7 @@ */ #include "z_en_mm.h" +#include "objects/gameplay_keep/gameplay_keep.h" #define FLAGS 0x00000010 @@ -216,6 +217,6 @@ void EnMm_Draw(Actor* thisx, GlobalContext* globalCtx) { Matrix_RotateY(-rotY, MTXMODE_APPLY); } gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, &D_04055628); + gSPDisplayList(POLY_OPA_DISP++, gameplay_keep_DL_055628); CLOSE_DISPS(globalCtx->state.gfxCtx); } diff --git a/src/overlays/actors/ovl_En_Ms/z_en_ms.c b/src/overlays/actors/ovl_En_Ms/z_en_ms.c index a2f8da87e..8782ea67c 100644 --- a/src/overlays/actors/ovl_En_Ms/z_en_ms.c +++ b/src/overlays/actors/ovl_En_Ms/z_en_ms.c @@ -5,6 +5,7 @@ */ #include "z_en_ms.h" +#include "objects/object_ms/object_ms.h" #define FLAGS 0x00000009 @@ -56,14 +57,12 @@ static InitChainEntry sInitChain[] = { ICHAIN_F32(targetArrowOffset, 500, ICHAIN_STOP), }; -extern AnimationHeader D_060005EC; -extern FlexSkeletonHeader D_06003DC0; - void EnMs_Init(Actor* thisx, GlobalContext* globalCtx) { EnMs* this = THIS; Actor_ProcessInitChain(thisx, sInitChain); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06003DC0, &D_060005EC, this->jointTable, this->morphTable, 9); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_ms_Skel_003DC0, &object_ms_Anim_0005EC, this->jointTable, + this->morphTable, 9); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinderType1(globalCtx, &this->collider, &this->actor, &sCylinderInit); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 35.0f); diff --git a/src/overlays/actors/ovl_En_Mushi2/z_en_mushi2.c b/src/overlays/actors/ovl_En_Mushi2/z_en_mushi2.c index ab94425ea..fecbf05d3 100644 --- a/src/overlays/actors/ovl_En_Mushi2/z_en_mushi2.c +++ b/src/overlays/actors/ovl_En_Mushi2/z_en_mushi2.c @@ -6,6 +6,7 @@ #include "overlays/actors/ovl_Obj_Bean/z_obj_bean.h" #include "z_en_mushi2.h" +#include "objects/gameplay_keep/gameplay_keep.h" #define FLAGS 0x00000010 @@ -31,8 +32,6 @@ void func_80A6AE7C(EnMushi2* this, GlobalContext* globalCtx); void func_80A6B078(EnMushi2* this); void func_80A6B0D8(EnMushi2* this, GlobalContext* globalCtx); -extern SkeletonHeader D_040527A0; - const ActorInit En_Mushi2_InitVars = { ACTOR_EN_MUSHI2, ACTORCAT_ITEMACTION, @@ -751,8 +750,9 @@ void EnMushi2_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.home.rot.y = this->actor.shape.rot.y; this->actor.world.rot.y = this->actor.shape.rot.y; func_80A68F24(this); - SkelAnime_Init(globalCtx, &this->skelAnime, &D_040527A0, &D_0405140C, this->jointTable, this->morphTable, 24); - Animation_Change(&this->skelAnime, &D_0405140C, 1.0f, 0.0f, 0.0f, 1, 0.0f); + SkelAnime_Init(globalCtx, &this->skelAnime, &gameplay_keep_Skel_0527A0, &gameplay_keep_Anim_05140C, + this->jointTable, this->morphTable, 24); + Animation_Change(&this->skelAnime, &gameplay_keep_Anim_05140C, 1.0f, 0.0f, 0.0f, 1, 0.0f); Collider_InitJntSph(globalCtx, &this->collider); Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, this->colliderElements); func_80A68808(this); diff --git a/src/overlays/actors/ovl_En_Muto/z_en_muto.c b/src/overlays/actors/ovl_En_Muto/z_en_muto.c index 895f8f2dd..99092b53a 100644 --- a/src/overlays/actors/ovl_En_Muto/z_en_muto.c +++ b/src/overlays/actors/ovl_En_Muto/z_en_muto.c @@ -5,6 +5,7 @@ */ #include "z_en_muto.h" +#include "objects/object_toryo/object_toryo.h" #define FLAGS 0x00000009 @@ -23,9 +24,6 @@ void EnMuto_SetupDialogue(EnMuto* this, GlobalContext* globalCtx); void EnMuto_InDialogue(EnMuto* this, GlobalContext* globalCtx); s32 EnMuto_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx); -extern AnimationHeader D_06000E50; -extern FlexSkeletonHeader D_06007150; - const ActorInit En_Muto_InitVars = { ACTOR_EN_MUTO, ACTORCAT_NPC, @@ -65,7 +63,8 @@ void EnMuto_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.colChkInfo.mass = MASS_IMMOVABLE; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 40.0f); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06007150, &D_06000E50, this->jointTable, this->morphTable, 17); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_toryo_Skel_007150, &object_toryo_Anim_000E50, + this->jointTable, this->morphTable, 17); this->isInMayorsRoom = this->actor.params; if (!this->isInMayorsRoom) { @@ -101,7 +100,7 @@ void EnMuto_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void EnMuto_ChangeAnim(EnMuto* this, s32 animIndex) { - static AnimationHeader* sAnimations[] = { &D_06000E50, &D_06000E50 }; + static AnimationHeader* sAnimations[] = { &object_toryo_Anim_000E50, &object_toryo_Anim_000E50 }; static u8 sAnimationModes[] = { 0, 2 }; this->animIndex = animIndex; diff --git a/src/overlays/actors/ovl_En_Niw/z_en_niw.c b/src/overlays/actors/ovl_En_Niw/z_en_niw.c index 8cf3c2fce..fa560f013 100644 --- a/src/overlays/actors/ovl_En_Niw/z_en_niw.c +++ b/src/overlays/actors/ovl_En_Niw/z_en_niw.c @@ -5,6 +5,7 @@ */ #include "z_en_niw.h" +#include "objects/object_niw/object_niw.h" #define FLAGS 0x00800010 @@ -32,11 +33,6 @@ void EnNiw_CheckRage(EnNiw* this, GlobalContext* globalCtx); void func_80891320(EnNiw* this, GlobalContext* globalCtx, s16 arg2); void EnNiw_SpawnFeather(EnNiw* this, Vec3f* pos, Vec3f* vel, Vec3f* accel, f32 scale); -extern FlexSkeletonHeader D_06002530; -extern AnimationHeader D_060000E8; -extern Gfx D_060023B0[]; // gNiwFeatherMaterialDL -extern Gfx D_06002428[]; // gNiwFeatherDL - // turned on during cucco storm, but not read by anything? // maybe read by En_Attack_Niw s16 D_80893460 = false; @@ -110,7 +106,7 @@ static Vec3f D_808934E8 = { static s32 pad = 0; void EnNiw_Init(Actor* thisx, GlobalContext* globalCtx) { - EnNiw* this = (EnNiw*)thisx; + EnNiw* this = THIS; Vec3f dTemp = D_808934C4; if (this->actor.params < 0) { // all neg values become zero @@ -126,8 +122,8 @@ void EnNiw_Init(Actor* thisx, GlobalContext* globalCtx) { ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawCircle, 25.0f); - SkelAnime_InitFlex(globalCtx, &this->skelanime, &D_06002530, &D_060000E8, this->jointTable, this->morphTable, - ENNIW_LIMBCOUNT); + SkelAnime_InitFlex(globalCtx, &this->skelanime, &object_niw_Skel_002530, &object_niw_Anim_0000E8, this->jointTable, + this->morphTable, ENNIW_LIMBCOUNT); Math_Vec3f_Copy(&this->unk2A4, &this->actor.world.pos); Math_Vec3f_Copy(&this->unk2B0, &this->actor.world.pos); @@ -163,7 +159,7 @@ void EnNiw_Init(Actor* thisx, GlobalContext* globalCtx) { } void EnNiw_Destroy(Actor* thisx, GlobalContext* globalCtx) { - EnNiw* this = (EnNiw*)thisx; + EnNiw* this = THIS; if (this->niwType == ENNIW_TYPE_REGULAR) { Collider_DestroyCylinder(globalCtx, &this->collider); @@ -327,7 +323,8 @@ void func_808917F8(EnNiw* this, GlobalContext* globalCtx, s32 arg2) { } void EnNiw_SetupIdle(EnNiw* this) { - Animation_Change(&this->skelanime, &D_060000E8, 1.0f, 0.0f, Animation_GetLastFrame(&D_060000E8), 0, -10.0f); + Animation_Change(&this->skelanime, &object_niw_Anim_0000E8, 1.0f, 0.0f, + Animation_GetLastFrame(&object_niw_Anim_0000E8), 0, -10.0f); this->unknownState28E = 0; this->actionFunc = EnNiw_Idle; } @@ -629,7 +626,8 @@ void EnNiw_CuccoStorm(EnNiw* this, GlobalContext* globalCtx) { } void EnNiw_SetupRunAway(EnNiw* this) { - Animation_Change(&this->skelanime, &D_060000E8, 1.0f, 0.0f, Animation_GetLastFrame(&D_060000E8), 0, -10.0f); + Animation_Change(&this->skelanime, &object_niw_Anim_0000E8, 1.0f, 0.0f, + Animation_GetLastFrame(&object_niw_Anim_0000E8), 0, -10.0f); this->unk29A = Rand_ZeroFloat(1.99f); this->unknownState28E = 7; this->actionFunc = EnNiw_RunAway; @@ -732,7 +730,7 @@ void EnNiw_CheckRage(EnNiw* this, GlobalContext* globalCtx) { } void EnNiw_Update(Actor* thisx, GlobalContext* globalCtx) { - EnNiw* this = (EnNiw*)thisx; + EnNiw* this = THIS; s8 pad0; s16 i; Player* player = GET_PLAYER(globalCtx); @@ -929,7 +927,7 @@ s32 EnNiw_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, } void EnNiw_Draw(Actor* thisx, GlobalContext* globalCtx) { - EnNiw* this = (EnNiw*)thisx; + EnNiw* this = THIS; func_8012C28C(globalCtx->state.gfxCtx); SkelAnime_DrawFlexOpa(globalCtx, this->skelanime.skeleton, this->skelanime.jointTable, this->skelanime.dListCount, @@ -1002,7 +1000,7 @@ void EnNiw_DrawFeathers(EnNiw* this, GlobalContext* globalCtx) { if (feather->isEnabled == true) { // Apply the feather material if it has not already been applied. if (!isMaterialApplied) { - gSPDisplayList(POLY_XLU_DISP++, D_060023B0); + gSPDisplayList(POLY_XLU_DISP++, gNiwFeatherMaterialDL); isMaterialApplied++; } @@ -1014,7 +1012,7 @@ void EnNiw_DrawFeathers(EnNiw* this, GlobalContext* globalCtx) { gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_XLU_DISP++, D_06002428); + gSPDisplayList(POLY_XLU_DISP++, gNiwFeatherDL); } } diff --git a/src/overlays/actors/ovl_En_Nnh/z_en_nnh.c b/src/overlays/actors/ovl_En_Nnh/z_en_nnh.c index d10690104..c7e0d5dac 100644 --- a/src/overlays/actors/ovl_En_Nnh/z_en_nnh.c +++ b/src/overlays/actors/ovl_En_Nnh/z_en_nnh.c @@ -5,6 +5,7 @@ */ #include "z_en_nnh.h" +#include "objects/object_nnh/object_nnh.h" #define FLAGS 0x00000019 @@ -52,8 +53,6 @@ static ColliderCylinderInit sCylinderInit = { { 20, 50, 0, { 0, 0, 0 } }, }; -extern Gfx D_06001510[]; - void EnNnh_Init(Actor* thisx, GlobalContext* globalCtx) { EnNnh* this = THIS; @@ -110,5 +109,5 @@ void EnNnh_Draw(Actor* thisx, GlobalContext* globalCtx) { func_8012C28C(gfxCtx); gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(gfxCtx->polyOpa.p++, D_06001510); + gSPDisplayList(gfxCtx->polyOpa.p++, object_nnh_DL_001510); } diff --git a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c index c99daf298..4c2cec3fa 100644 --- a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c +++ b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c @@ -6,6 +6,7 @@ #include "z_en_nutsball.h" #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" +#include "objects/gameplay_keep/gameplay_keep.h" #define FLAGS 0x00000010 @@ -85,10 +86,9 @@ void EnNutsball_InitColliderParams(EnNutsball* this) { this->collider.info.toucher.damage = 2; } -void EnNutsball_Update(Actor* thisx, GlobalContext* globalCtx) { +void EnNutsball_Update(Actor* thisx, GlobalContext* globalCtx2) { + GlobalContext* globalCtx = globalCtx2; EnNutsball* this = THIS; - GlobalContext* globalCtx2 = globalCtx; - Player* player = GET_PLAYER(globalCtx); Vec3f worldPos; Vec3s worldRot; @@ -138,11 +138,11 @@ void EnNutsball_Update(Actor* thisx, GlobalContext* globalCtx) { Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 5.0f, 10.0f, 0x7); if (this->actor.bgCheckFlags & 8) { - if (func_800C9A4C(&globalCtx2->colCtx, this->actor.wallPoly, this->actor.wallBgId) & 0x30) { + if (func_800C9A4C(&globalCtx->colCtx, this->actor.wallPoly, this->actor.wallBgId) & 0x30) { this->actor.bgCheckFlags &= ~8; - if (BgCheck_EntityLineTest1(&globalCtx2->colCtx, &this->actor.prevPos, &worldPos, - &this->actor.world.pos, &poly, true, false, false, true, &bgId)) { - if (func_800C9A4C(&globalCtx2->colCtx, poly, bgId) & 0x30) { + if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->actor.prevPos, &worldPos, &this->actor.world.pos, + &poly, true, false, false, true, &bgId)) { + if (func_800C9A4C(&globalCtx->colCtx, poly, bgId) & 0x30) { this->actor.world.pos.x += this->actor.velocity.x * 0.01f; this->actor.world.pos.z += this->actor.velocity.z * 0.01f; } else { @@ -161,7 +161,7 @@ void EnNutsball_Update(Actor* thisx, GlobalContext* globalCtx) { CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); if (this->timer < this->timerThreshold) { - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); + CollisionCheck_SetOC(globalCtx, &globalCtx2->colChkCtx, &this->collider.base); } } } @@ -174,6 +174,6 @@ void EnNutsball_Draw(Actor* thisx, GlobalContext* globalCtx) { Matrix_InsertMatrix(&globalCtx->billboardMtxF, MTXMODE_APPLY); Matrix_InsertZRotation_s(this->actor.home.rot.z, MTXMODE_APPLY); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, D_04058BA0); + gSPDisplayList(POLY_OPA_DISP++, gameplay_keep_DL_058BA0); CLOSE_DISPS(globalCtx->state.gfxCtx); } diff --git a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c index 29da0d2ce..73ce4b8b6 100644 --- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c +++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c @@ -5,6 +5,9 @@ */ #include "z_en_ossan.h" +#include "objects/gameplay_keep/gameplay_keep.h" +#include "objects/object_fsn/object_fsn.h" +#include "objects/object_ani/object_ani.h" #define FLAGS 0x00000019 @@ -50,29 +53,6 @@ void EnOssan_GetCutscenes(EnOssan* this, GlobalContext* globalCtx); s32 EnOssan_ReturnItemToShelf(EnOssan* this); s32 EnOssan_TakeItemOffShelf(EnOssan* this); -extern FlexSkeletonHeader D_060028A0; -extern TexturePtr D_06005BC0; -extern TexturePtr D_06006498; -extern TexturePtr D_06006B18; -extern TexturePtr D_06006D40; -extern TexturePtr D_06006F18; -extern TexturePtr D_06007140; -extern AnimationHeader D_06009D34; -extern AnimationHeader D_0600A460; -extern AnimationHeader D_0600CB3C; -extern AnimationHeader D_0600DE34; -extern AnimationHeader D_0600E3EC; -extern AnimationHeader D_0600C58C; -extern AnimationHeader D_0600F00C; -extern AnimationHeader D_0600B9D8; -extern AnimationHeader D_0600C26C; -extern AnimationHeader D_0600D354; -extern AnimationHeader D_06012C34; -extern AnimationHeader D_060131FC; -extern FlexSkeletonHeader D_06013320; -extern AnimationHeader D_060138B0; -extern AnimationHeader D_0601430C; - const ActorInit En_Ossan_InitVars = { ACTOR_EN_OSSAN, ACTORCAT_NPC, @@ -86,18 +66,22 @@ const ActorInit En_Ossan_InitVars = { }; static ActorAnimationEntryS sAnimationsCuriosityShopMan[] = { - { &D_06012C34, 1.0f, 0, -1, 0, 0 }, { &D_060131FC, 1.0f, 0, -1, 0, 0 }, { &D_0600C58C, 1.0f, 0, -1, 2, 0 }, - { &D_0600C58C, -1.0f, 0, -1, 2, 0 }, { &D_0600E3EC, 1.0f, 0, -1, 2, 0 }, { &D_0600F00C, 1.0f, 0, -1, 0, 0 }, - { &D_0600CB3C, 1.0f, 0, -1, 2, 0 }, { &D_0600D354, 1.0f, 0, -1, 0, 0 }, { &D_060138B0, 1.0f, 0, -1, 2, 0 }, - { &D_0601430C, 1.0f, 0, -1, 0, 0 }, { &D_0600B9D8, 1.0f, 0, -1, 2, 0 }, { &D_0600C26C, 1.0f, 0, -1, 0, 0 }, - { &D_0600DE34, 1.0f, 0, -1, 2, 0 }, + { &object_fsn_Anim_012C34, 1.0f, 0, -1, 0, 0 }, { &object_fsn_Anim_0131FC, 1.0f, 0, -1, 0, 0 }, + { &object_fsn_Anim_00C58C, 1.0f, 0, -1, 2, 0 }, { &object_fsn_Anim_00C58C, -1.0f, 0, -1, 2, 0 }, + { &object_fsn_Anim_00E3EC, 1.0f, 0, -1, 2, 0 }, { &object_fsn_Anim_00F00C, 1.0f, 0, -1, 0, 0 }, + { &object_fsn_Anim_00CB3C, 1.0f, 0, -1, 2, 0 }, { &object_fsn_Anim_00D354, 1.0f, 0, -1, 0, 0 }, + { &object_fsn_Anim_0138B0, 1.0f, 0, -1, 2, 0 }, { &object_fsn_Anim_01430C, 1.0f, 0, -1, 0, 0 }, + { &object_fsn_Anim_00B9D8, 1.0f, 0, -1, 2, 0 }, { &object_fsn_Anim_00C26C, 1.0f, 0, -1, 0, 0 }, + { &object_fsn_Anim_00DE34, 1.0f, 0, -1, 2, 0 }, }; static ActorAnimationEntryS sAnimationsPartTimeWorker[] = { - { &D_06009D34, 1.0f, 0, -1, 0, -10 }, { &D_06009D34, 1.0f, 0, -1, 0, -10 }, { &D_06009D34, 1.0f, 0, -1, 2, 0 }, - { &D_06009D34, -1.0f, 0, -1, 2, 0 }, { &D_06009D34, 1.0f, 0, -1, 2, 0 }, { &D_06009D34, 1.0f, 0, -1, 0, 0 }, - { &D_06009D34, 1.0f, 0, -1, 2, 0 }, { &D_06009D34, 1.0f, 0, -1, 0, 0 }, { &D_0600A460, 1.0f, 0, -1, 2, -5 }, - { &D_0600A460, 1.0f, 0, -1, 0, -5 }, { &D_06009D34, 1.0f, 0, -1, 2, 0 }, { &D_06009D34, 1.0f, 0, -1, 0, 0 }, + { &object_ani_Anim_009D34, 1.0f, 0, -1, 0, -10 }, { &object_ani_Anim_009D34, 1.0f, 0, -1, 0, -10 }, + { &object_ani_Anim_009D34, 1.0f, 0, -1, 2, 0 }, { &object_ani_Anim_009D34, -1.0f, 0, -1, 2, 0 }, + { &object_ani_Anim_009D34, 1.0f, 0, -1, 2, 0 }, { &object_ani_Anim_009D34, 1.0f, 0, -1, 0, 0 }, + { &object_ani_Anim_009D34, 1.0f, 0, -1, 2, 0 }, { &object_ani_Anim_009D34, 1.0f, 0, -1, 0, 0 }, + { &object_ani_Anim_00A460, 1.0f, 0, -1, 2, -5 }, { &object_ani_Anim_00A460, 1.0f, 0, -1, 0, -5 }, + { &object_ani_Anim_009D34, 1.0f, 0, -1, 2, 0 }, { &object_ani_Anim_009D34, 1.0f, 0, -1, 0, 0 }, }; static s16 sObjectIds[] = { OBJECT_FSN, OBJECT_ANI }; @@ -1329,12 +1313,14 @@ void EnOssan_Blink(EnOssan* this) { } void EnOssan_InitCuriosityShopMan(EnOssan* this, GlobalContext* globalCtx) { - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06013320, &D_06012C34, this->jointTable, this->morphTable, 19); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_fsn_Skel_013320, &object_fsn_Anim_012C34, this->jointTable, + this->morphTable, 19); this->actor.draw = EnOssan_DrawCuriosityShopMan; } void EnOssan_InitPartTimeWorker(EnOssan* this, GlobalContext* globalCtx) { - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060028A0, &D_06009D34, this->jointTable, this->morphTable, 16); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_ani_Skel_0028A0, &object_ani_Anim_009D34, this->jointTable, + this->morphTable, 16); this->actor.draw = EnOssan_DrawPartTimeWorker; } @@ -1537,8 +1523,8 @@ void EnOssan_DrawCursor(GlobalContext* globalCtx, EnOssan* this, f32 x, f32 y, f func_8012C654(globalCtx->state.gfxCtx); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, this->cursorColor.r, this->cursorColor.g, this->cursorColor.b, this->cursorColor.a); - gDPLoadTextureBlock_4b(OVERLAY_DISP++, &D_0401F740, G_IM_FMT_IA, 16, 16, 0, G_TX_MIRROR | G_TX_WRAP, - G_TX_MIRROR | G_TX_WRAP, 4, 4, G_TX_NOLOD, G_TX_NOLOD); + gDPLoadTextureBlock_4b(OVERLAY_DISP++, gameplay_keep_Tex_01F740, G_IM_FMT_IA, 16, 16, 0, + G_TX_MIRROR | G_TX_WRAP, G_TX_MIRROR | G_TX_WRAP, 4, 4, G_TX_NOLOD, G_TX_NOLOD); w = 16.0f * z; ulx = (x - w) * 4.0f; uly = (y - w) * 4.0f; @@ -1589,7 +1575,7 @@ void EnOssan_DrawStickDirectionPrompts(GlobalContext* globalCtx, EnOssan* this) if (drawStickRightPrompt || drawStickLeftPrompt) { func_8012C654(globalCtx->state.gfxCtx); gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); - gDPSetTextureImage(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, &D_0401F8C0); + gDPSetTextureImage(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, gameplay_keep_Tex_01F8C0); gDPSetTile(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 4, G_TX_NOLOD); gDPLoadSync(OVERLAY_DISP++); @@ -1610,7 +1596,7 @@ void EnOssan_DrawStickDirectionPrompts(GlobalContext* globalCtx, EnOssan* this) this->stickRightPrompt.arrowTexX, this->stickRightPrompt.arrowTexY, this->stickRightPrompt.texZ, 0, 0, 1.0f, 1.0f); } - gDPSetTextureImage(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, &D_0401F7C0); + gDPSetTextureImage(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, gameplay_keep_Tex_01F7C0); gDPSetTile(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 4, G_TX_NOLOD); gDPLoadSync(OVERLAY_DISP++); @@ -1677,7 +1663,7 @@ void EnOssan_PostLimbDrawPartTimeWorker(GlobalContext* globalCtx, s32 limbIndex, } void EnOssan_DrawCuriosityShopMan(Actor* thisx, GlobalContext* globalCtx) { - static TexturePtr sEyeTextures[] = { &D_06005BC0, &D_06006D40, &D_06007140 }; + static TexturePtr sEyeTextures[] = { object_fsn_Tex_005BC0, object_fsn_Tex_006D40, object_fsn_Tex_007140 }; EnOssan* this = THIS; s32 pad; @@ -1692,7 +1678,7 @@ void EnOssan_DrawCuriosityShopMan(Actor* thisx, GlobalContext* globalCtx) { } void EnOssan_DrawPartTimeWorker(Actor* thisx, GlobalContext* globalCtx) { - static TexturePtr sEyeTextures[] = { &D_06006498, &D_06006B18, &D_06006F18 }; + static TexturePtr sEyeTextures[] = { object_ani_Tex_006498, object_ani_Tex_006B18, object_ani_Tex_006F18 }; EnOssan* this = THIS; s32 pad; diff --git a/src/overlays/actors/ovl_En_Ot/z_en_ot.c b/src/overlays/actors/ovl_En_Ot/z_en_ot.c index 2e7fc34f6..89b1362e1 100644 --- a/src/overlays/actors/ovl_En_Ot/z_en_ot.c +++ b/src/overlays/actors/ovl_En_Ot/z_en_ot.c @@ -6,6 +6,8 @@ #include "z_en_ot.h" #include "prevent_bss_reordering.h" +#include "objects/object_ot/object_ot.h" +#include "objects/gameplay_keep/gameplay_keep.h" #define FLAGS 0x00000019 @@ -57,15 +59,6 @@ EnOtUnkStruct* func_80B5DF58(EnOtUnkStruct* arg0, u8 arg1, Vec3f* arg2, Vec3s* a void func_80B5E078(GlobalContext* globalCtx, EnOtUnkStruct* arg1, s32 arg2); void func_80B5E1D8(GlobalContext* globalCtx, EnOtUnkStruct* arg1, s32 arg2); -extern Gfx D_06000040[]; -extern Gfx D_06000078[]; -extern AnimationHeader D_06000420; -extern Gfx D_060004A0[]; -extern AnimatedMaterial D_060005F8; -extern AnimationHeader D_060008D8; -extern FlexSkeletonHeader D_06004800; -extern AnimationHeader D_06004B30; - static EnOt* D_80B5E880; static EnOt* D_80B5E884; static EnOt* D_80B5E888; @@ -103,9 +96,9 @@ static ColliderCylinderInit sCylinderInit = { }; static struct_80B8E1A8 sAnimations[] = { - { &D_06004B30, 1.0f, 0, -5.0f }, - { &D_060008D8, 1.0f, 0, -5.0f }, - { &D_06000420, 1.0f, 0, 0.0f }, + { &object_ot_Anim_004B30, 1.0f, 0, -5.0f }, + { &object_ot_Anim_0008D8, 1.0f, 0, -5.0f }, + { &object_ot_Anim_000420, 1.0f, 0, 0.0f }, }; static InitChainEntry sInitChain[] = { @@ -156,7 +149,8 @@ void EnOt_Init(Actor* thisx, GlobalContext* globalCtx) { } ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06004800, &D_060008D8, this->jointTable, this->morphTable, 19); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_ot_Skel_004800, &object_ot_Anim_0008D8, this->jointTable, + this->morphTable, 19); Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); Animation_Change(&this->skelAnime, sAnimations[0].animationSeg, 1.0f, Animation_GetLastFrame(&sAnimations[0].animationSeg->common) * Rand_ZeroOne(), @@ -1044,7 +1038,7 @@ void EnOt_Draw(Actor* thisx, GlobalContext* globalCtx) { CLOSE_DISPS(globalCtx->state.gfxCtx); - AnimatedMat_Draw(globalCtx, (AnimatedMaterial*)Lib_SegmentedToVirtual(&D_060005F8)); + AnimatedMat_Draw(globalCtx, (AnimatedMaterial*)Lib_SegmentedToVirtual(object_ot_Matanimheader_0005F8)); SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, NULL, EnOt_PostLimbDraw, &this->actor); Matrix_InsertTranslation(this->unk_378.x, this->unk_378.y, this->unk_378.z, MTXMODE_NEW); @@ -1057,10 +1051,10 @@ void EnOt_Draw(Actor* thisx, GlobalContext* globalCtx) { gSPSetOtherMode(&gfx[0], G_SETOTHERMODE_H, 4, 4, 0x00000080); gDPSetCombineLERP(&gfx[1], 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0); - gSPDisplayList(&gfx[2], D_04029CB0); + gSPDisplayList(&gfx[2], gameplay_keep_DL_029CB0); gDPSetPrimColor(&gfx[3], 0, 0, this->unk_747.r, this->unk_747.g, this->unk_747.b, 50); gSPMatrix(&gfx[4], Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(&gfx[5], D_04029CF0); + gSPDisplayList(&gfx[5], gameplay_keep_DL_029CF0); POLY_XLU_DISP = &gfx[6]; @@ -1075,7 +1069,7 @@ void EnOt_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec OPEN_DISPS(globalCtx->state.gfxCtx); Gfx* gfx = POLY_OPA_DISP; - gSPDisplayList(&gfx[0], D_060004A0); + gSPDisplayList(&gfx[0], object_ot_DL_0004A0); POLY_OPA_DISP = &gfx[1]; Matrix_MultiplyVector3fByState(&D_80B5E410, &this->unk_74C); @@ -1152,7 +1146,7 @@ void func_80B5E1D8(GlobalContext* globalCtx, EnOtUnkStruct* arg1, s32 arg2) { for (i = 0; i < arg2; i++, arg1++) { if (arg1->unk_00) { if (!flag) { - gSPDisplayList(POLY_OPA_DISP++, D_06000040); + gSPDisplayList(POLY_OPA_DISP++, object_ot_DL_000040); flag = true; if (globalCtx) {} } @@ -1161,10 +1155,10 @@ void func_80B5E1D8(GlobalContext* globalCtx, EnOtUnkStruct* arg1, s32 arg2) { Matrix_RotateY(BINANG_ROT180(func_800DFCDC(GET_ACTIVE_CAM(globalCtx))), MTXMODE_APPLY); Matrix_Scale(arg1->unk_04, arg1->unk_04, arg1->unk_04, MTXMODE_APPLY); - gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(&D_0405E6F0)); + gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(gameplay_keep_Tex_05E6F0)); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, D_06000078); + gSPDisplayList(POLY_OPA_DISP++, object_ot_DL_000078); } } diff --git a/src/overlays/actors/ovl_En_Owl/z_en_owl.c b/src/overlays/actors/ovl_En_Owl/z_en_owl.c index 2694da91f..9ed5c9a3e 100644 --- a/src/overlays/actors/ovl_En_Owl/z_en_owl.c +++ b/src/overlays/actors/ovl_En_Owl/z_en_owl.c @@ -5,6 +5,7 @@ */ #include "z_en_owl.h" +#include "objects/object_owl/object_owl.h" #define FLAGS 0x00000019 @@ -47,18 +48,6 @@ typedef enum { /* 0x01 */ OWL_OK } EnOwlMessageChoice; -extern AnimationHeader D_06001168; -extern Gfx D_06001200[]; -extern AnimationHeader D_06001ADC; -extern TexturePtr D_06008EB8; -extern TexturePtr D_060092B8; -extern TexturePtr D_060096B8; -extern FlexSkeletonHeader D_0600C5F8; -extern AnimationHeader D_0600C6D4; -extern AnimationHeader D_0600CB94; -extern AnimationHeader D_0600CDB0; -extern FlexSkeletonHeader D_060105C0; - const ActorInit En_Owl_InitVars = { ACTOR_EN_OWL, ACTORCAT_NPC, @@ -139,15 +128,15 @@ void EnOwl_Init(Actor* thisx, GlobalContext* globalCtx) { } ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f); - SkelAnime_InitFlex(globalCtx, &this->skelAnime1, &D_0600C5F8, &D_06001ADC, this->jointTable1, this->morphTable1, - 21); - SkelAnime_InitFlex(globalCtx, &this->skelAnime2, &D_060105C0, &D_0600CDB0, this->jointTable2, this->morphTable2, - 16); + SkelAnime_InitFlex(globalCtx, &this->skelAnime1, &object_owl_Skel_00C5F8, &object_owl_Anim_001ADC, + this->jointTable1, this->morphTable1, 21); + SkelAnime_InitFlex(globalCtx, &this->skelAnime2, &object_owl_Skel_0105C0, &object_owl_Anim_00CDB0, + this->jointTable2, this->morphTable2, 16); Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->actor.terminalVelocity = -10.0f; this->actor.targetArrowOffset = 500.0f; - EnOwl_ChangeMode(this, func_8095BF58, func_8095C484, &this->skelAnime2, &D_0600CDB0, 0.0f); + EnOwl_ChangeMode(this, func_8095BF58, func_8095C484, &this->skelAnime2, &object_owl_Anim_00CDB0, 0.0f); this->actionFlags = 0; this->unk_40D = 0; @@ -260,7 +249,7 @@ s32 func_8095A9FC(EnOwl* this, GlobalContext* globalCtx, u16 textId) { } void func_8095AA70(EnOwl* this) { - EnOwl_ChangeMode(this, func_8095C1C8, func_8095C484, &this->skelAnime1, &D_0600CB94, 0.0f); + EnOwl_ChangeMode(this, func_8095C1C8, func_8095C484, &this->skelAnime1, &object_owl_Anim_00CB94, 0.0f); this->eyeTexIndex = 0; this->blinkTimer = Rand_S16Offset(60, 60); } @@ -450,7 +439,7 @@ void func_8095B254(EnOwl* this, GlobalContext* globalCtx) { } if (this->actionFlags & 1) { - EnOwl_ChangeMode(this, func_8095B1E4, func_8095C328, &this->skelAnime1, &D_06001ADC, 0.0f); + EnOwl_ChangeMode(this, func_8095B1E4, func_8095C328, &this->skelAnime1, &object_owl_Anim_001ADC, 0.0f); this->unk_3EA = 6; this->actor.flags |= 0x20; } @@ -468,7 +457,7 @@ void func_8095B2F8(EnOwl* this, GlobalContext* globalCtx) { if ((this->actor.shape.rot.y == this->unk_3EC) && (this->actionFlags & 1)) { this->actionFunc = func_8095B254; Animation_Change(this->skelAnime3, this->skelAnime3->animation, 1.0f, 19.0f, - Animation_GetLastFrame(&D_06001168), 2, 0.0f); + Animation_GetLastFrame(&object_owl_Anim_001168), 2, 0.0f); this->unk_414 = func_8095C484; } @@ -478,7 +467,7 @@ void func_8095B2F8(EnOwl* this, GlobalContext* globalCtx) { void func_8095B3DC(EnOwl* this, GlobalContext* globalCtx) { if (this->actionFlags & 1) { this->actionFunc = func_8095B2F8; - Animation_Change(this->skelAnime3, &D_06001168, 1.0f, 0.0f, 35.0f, 2, 0.0f); + Animation_Change(this->skelAnime3, &object_owl_Anim_001168, 1.0f, 0.0f, 35.0f, 2, 0.0f); this->unk_414 = func_8095C408; this->unk_3EC = 0x5500; this->actor.world.pos.y += 100.0f; @@ -491,7 +480,7 @@ void func_8095B480(EnOwl* this, GlobalContext* globalCtx) { if (player->stateFlags3 & 0x10000000) { this->actor.textId = 0xBF1; - EnOwl_ChangeMode(this, func_8095BF58, func_8095C484, &this->skelAnime2, &D_0600CDB0, 0.0f); + EnOwl_ChangeMode(this, func_8095BF58, func_8095C484, &this->skelAnime2, &object_owl_Anim_00CDB0, 0.0f); this->eyeTexIndex = 0; this->actionFlags &= ~8; this->blinkTimer = Rand_S16Offset(60, 60); @@ -525,7 +514,7 @@ void func_8095B574(EnOwl* this, GlobalContext* globalCtx) { void func_8095B650(EnOwl* this, GlobalContext* globalCtx) { if (this->actionFlags & 1) { - EnOwl_ChangeMode(this, func_8095B574, func_8095C484, &this->skelAnime2, &D_0600CDB0, 0.0f); + EnOwl_ChangeMode(this, func_8095B574, func_8095C484, &this->skelAnime2, &object_owl_Anim_00CDB0, 0.0f); this->actor.textId = 0xBF5; this->actionFlags &= ~8; } @@ -534,7 +523,8 @@ void func_8095B650(EnOwl* this, GlobalContext* globalCtx) { void func_8095B6C8(EnOwl* this, GlobalContext* globalCtx) { if (this->actionFlags & 1) { - Animation_Change(this->skelAnime3, &D_0600CB94, -1.0f, Animation_GetLastFrame(&D_0600CB94), 0.0f, 2, 0.0f); + Animation_Change(this->skelAnime3, &object_owl_Anim_00CB94, -1.0f, + Animation_GetLastFrame(&object_owl_Anim_00CB94), 0.0f, 2, 0.0f); this->unk_414 = func_8095C484; this->actionFunc = func_8095B650; } @@ -606,7 +596,7 @@ void func_8095B960(EnOwl* this, GlobalContext* globalCtx) { void func_8095B9FC(EnOwl* this, GlobalContext* globalCtx) { if (this->actionFlags & 1) { this->actionFunc = func_8095B960; - Animation_Change(this->skelAnime3, &D_06001168, 1.0f, 0.0f, 35.0f, 2, 0.0f); + Animation_Change(this->skelAnime3, &object_owl_Anim_001168, 1.0f, 0.0f, 35.0f, 2, 0.0f); this->unk_414 = func_8095C408; func_8095B0C8(this); } @@ -676,7 +666,8 @@ void func_8095BA84(EnOwl* this, GlobalContext* globalCtx) { case 0xBEE: func_801477B4(globalCtx); Audio_QueueSeqCmd(0x110000FF); - EnOwl_ChangeMode(this, func_8095B9FC, func_8095C484, &this->skelAnime1, &D_0600CB94, 0.0f); + EnOwl_ChangeMode(this, func_8095B9FC, func_8095C484, &this->skelAnime1, &object_owl_Anim_00CB94, + 0.0f); this->eyeTexIndex = 0; this->blinkTimer = Rand_S16Offset(60, 60); this->actionFlags |= 8; @@ -705,7 +696,8 @@ void func_8095BA84(EnOwl* this, GlobalContext* globalCtx) { func_801477B4(globalCtx); Audio_QueueSeqCmd(0x110000FF); this->actor.flags &= ~0x10000; - EnOwl_ChangeMode(this, func_8095B3DC, func_8095C484, &this->skelAnime1, &D_0600CB94, 0.0f); + EnOwl_ChangeMode(this, func_8095B3DC, func_8095C484, &this->skelAnime1, &object_owl_Anim_00CB94, + 0.0f); this->eyeTexIndex = 0; this->blinkTimer = Rand_S16Offset(60, 60); this->actionFlags |= 8; @@ -783,7 +775,7 @@ void func_8095C09C(EnOwl* this, GlobalContext* globalCtx) { } if (this->actionFlags & 1) { - EnOwl_ChangeMode(this, func_8095BF78, func_8095C328, &this->skelAnime1, &D_06001ADC, 0.0f); + EnOwl_ChangeMode(this, func_8095BF78, func_8095C328, &this->skelAnime1, &object_owl_Anim_001ADC, 0.0f); this->unk_3EA = 6; this->unk_3EC += 0x2000; } @@ -794,7 +786,7 @@ void func_8095C09C(EnOwl* this, GlobalContext* globalCtx) { void func_8095C1C8(EnOwl* this, GlobalContext* globalCtx) { if (this->actionFlags & 1) { this->unk_3EA = 3; - EnOwl_ChangeMode(this, func_8095C09C, func_8095C484, &this->skelAnime1, &D_06001168, 0.0f); + EnOwl_ChangeMode(this, func_8095C09C, func_8095C484, &this->skelAnime1, &object_owl_Anim_001168, 0.0f); this->unk_3EC = BINANG_ADD(this->actor.world.rot.y, 0x4000); this->unk_3E4 = this->actor.world.pos.y; this->actor.velocity.y = 2.0f; @@ -810,7 +802,8 @@ void func_8095C258(EnOwl* this) { } else { this->unk_414 = func_8095C328; this->unk_3EA = 6; - Animation_Change(this->skelAnime3, &D_06001ADC, 1.0f, 0.0f, Animation_GetLastFrame(&D_06001ADC), 2, 5.0f); + Animation_Change(this->skelAnime3, &object_owl_Anim_001ADC, 1.0f, 0.0f, + Animation_GetLastFrame(&object_owl_Anim_001ADC), 2, 5.0f); } } @@ -823,7 +816,8 @@ void func_8095C328(EnOwl* this) { } else { this->unk_3EA = 160; this->unk_414 = func_8095C258; - Animation_Change(this->skelAnime3, &D_0600C6D4, 1.0f, 0.0f, Animation_GetLastFrame(&D_0600C6D4), 0, 5.0f); + Animation_Change(this->skelAnime3, &object_owl_Anim_00C6D4, 1.0f, 0.0f, + Animation_GetLastFrame(&object_owl_Anim_00C6D4), 0, 5.0f); } } } @@ -904,7 +898,7 @@ void EnOwl_Update(Actor* thisx, GlobalContext* globalCtx) { Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); if (this->actor.update != NULL) { - if ((this->skelAnime1.animation == &D_06001ADC) && Animation_OnFrame(&this->skelAnime1, 4.0f)) { + if ((this->skelAnime1.animation == &object_owl_Anim_001ADC) && Animation_OnFrame(&this->skelAnime1, 4.0f)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_OWL_FLUTTER); } @@ -1148,9 +1142,9 @@ void EnOwl_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve void EnOwl_Draw(Actor* thisx, GlobalContext* globalCtx) { static TexturePtr eyeTextures[] = { - &D_06008EB8, - &D_060092B8, - &D_060096B8, + object_owl_Tex_008EB8, + object_owl_Tex_0092B8, + object_owl_Tex_0096B8, }; s32 pad; EnOwl* this = THIS; @@ -1182,7 +1176,7 @@ void func_8095D074(Actor* thisx, GlobalContext* globalCtx) { gDPSetRenderMode(POLY_OPA_DISP++, G_RM_FOG_SHADE_A, G_RM_AA_ZB_TEX_EDGE2); gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 255); - gSPDisplayList(POLY_OPA_DISP++, D_06001200); + gSPDisplayList(POLY_OPA_DISP++, object_owl_DL_001200); } else { gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); @@ -1190,7 +1184,7 @@ void func_8095D074(Actor* thisx, GlobalContext* globalCtx) { gDPSetRenderMode(POLY_XLU_DISP++, G_RM_FOG_SHADE_A, G_RM_AA_XLU_SURF2); gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 0, (u8)(this->unk_3DC * 8)); - gSPDisplayList(POLY_XLU_DISP++, D_06001200); + gSPDisplayList(POLY_XLU_DISP++, object_owl_DL_001200); } CLOSE_DISPS(globalCtx->state.gfxCtx); diff --git a/src/overlays/actors/ovl_En_Pamera/z_en_pamera.c b/src/overlays/actors/ovl_En_Pamera/z_en_pamera.c index 4270feb2a..9f2277b08 100644 --- a/src/overlays/actors/ovl_En_Pamera/z_en_pamera.c +++ b/src/overlays/actors/ovl_En_Pamera/z_en_pamera.c @@ -7,6 +7,7 @@ #include "z_en_pamera.h" #include "../ovl_En_Bom/z_en_bom.h" #include "../ovl_En_Door/z_en_door.h" +#include "objects/object_pamera/object_pamera.h" #define FLAGS 0x00000019 @@ -69,29 +70,6 @@ void func_80BDA288(EnPamera* this); void func_80BDA2E0(EnPamera* this, GlobalContext* globalCtx); void func_80BDA344(Actor* thisx, GlobalContext* globalCtx); -extern FlexSkeletonHeader D_06008448; -extern AnimationHeader D_060005BC; -extern AnimationHeader D_06008AE0; // Pamela Walking -extern AnimationHeader D_06008E38; -extern AnimationHeader D_0600A844; // Pamela Looking down the well -extern AnimationHeader D_0600B0C4; -extern AnimationHeader D_06009870; -extern AnimationHeader D_06009F54; // HoldBack En_Hgo -extern AnimationHeader D_0600B5B0; // PushBack En_Hgo -extern AnimationHeader D_0600BCC4; // Defend En_Hgo -extern AnimationHeader D_0600D9DC; -extern AnimationHeader D_0600E16C; // Hugging En_Hg -extern AnimationHeader D_0600C9F4; -extern AnimationHeader D_0600D0F0; - -extern TexturePtr D_060074E8; -extern TexturePtr D_060078E8; -extern TexturePtr D_060066E8; -extern TexturePtr D_06006AE8; -extern TexturePtr D_06006EE8; -extern TexturePtr D_060072E8; -extern TexturePtr D_060073E8; - const ActorInit En_Pamera_InitVars = { ACTOR_EN_PAMERA, ACTORCAT_NPC, @@ -129,22 +107,22 @@ static CollisionCheckInfoInit2 sColChkInfoInit2 = { }; static ActorAnimationEntry sAnimations[] = { - { &D_060005BC, 1.0f, 0, 0.0f, 0, -4.0f }, { &D_06008AE0, 1.0f, 0, 0.0f, 0, -4.0f }, - { &D_06008E38, 1.0f, 0, 0.0f, 0, -4.0f }, { &D_0600A844, 1.0f, 0, 0.0f, 0, -4.0f }, - { &D_0600B0C4, 1.0f, 0, 0.0f, 0, -4.0f }, { &D_06009870, 1.0f, 0, 0.0f, 0, 0.0f }, - { &D_06009F54, 1.0f, 0, 0.0f, 0, 0.0f }, { &D_0600B5B0, 1.0f, 0, 0.0f, 0, 0.0f }, - { &D_0600BCC4, 1.0f, 0, 0.0f, 0, 0.0f }, { &D_0600D9DC, 1.0f, 0, 0.0f, 0, 0.0f }, - { &D_0600E16C, 1.0f, 0, 0.0f, 0, 0.0f }, { &D_0600C9F4, 1.0f, 0, 0.0f, 2, 0.0f }, - { &D_0600D0F0, 1.0f, 0, 0.0f, 0, 0.0f }, + { &object_pamera_Anim_0005BC, 1.0f, 0, 0.0f, 0, -4.0f }, { &object_pamera_Anim_008AE0, 1.0f, 0, 0.0f, 0, -4.0f }, + { &object_pamera_Anim_008E38, 1.0f, 0, 0.0f, 0, -4.0f }, { &object_pamera_Anim_00A844, 1.0f, 0, 0.0f, 0, -4.0f }, + { &object_pamera_Anim_00B0C4, 1.0f, 0, 0.0f, 0, -4.0f }, { &object_pamera_Anim_009870, 1.0f, 0, 0.0f, 0, 0.0f }, + { &object_pamera_Anim_009F54, 1.0f, 0, 0.0f, 0, 0.0f }, { &object_pamera_Anim_00B5B0, 1.0f, 0, 0.0f, 0, 0.0f }, + { &object_pamera_Anim_00BCC4, 1.0f, 0, 0.0f, 0, 0.0f }, { &object_pamera_Anim_00D9DC, 1.0f, 0, 0.0f, 0, 0.0f }, + { &object_pamera_Anim_00E16C, 1.0f, 0, 0.0f, 0, 0.0f }, { &object_pamera_Anim_00C9F4, 1.0f, 0, 0.0f, 2, 0.0f }, + { &object_pamera_Anim_00D0F0, 1.0f, 0, 0.0f, 0, 0.0f }, }; static Vec3f D_80BDA5F0 = { 1000.0f, 0.0f, 0.0f }; -static TexturePtr D_80BDA5FC[] = { &D_060074E8, &D_060078E8 }; +static TexturePtr D_80BDA5FC[] = { object_pamera_Tex_0074E8, object_pamera_Tex_0078E8 }; -static TexturePtr D_80BDA604[] = { &D_060066E8, &D_06006AE8, &D_06006EE8 }; +static TexturePtr D_80BDA604[] = { object_pamera_Tex_0066E8, object_pamera_Tex_006AE8, object_pamera_Tex_006EE8 }; -static TexturePtr D_80BDA610[] = { &D_060072E8, &D_060073E8 }; +static TexturePtr D_80BDA610[] = { object_pamera_Tex_0072E8, object_pamera_Tex_0073E8 }; void EnPamera_Init(Actor* thisx, GlobalContext* globalCtx) { s32 pad; @@ -152,8 +130,8 @@ void EnPamera_Init(Actor* thisx, GlobalContext* globalCtx) { Vec3f sp44; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 15.0f); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06008448, &D_060005BC, this->jointTable, this->morphTable, - PAMERA_LIMB_MAX); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_pamera_Skel_008448, &object_pamera_Anim_0005BC, + this->jointTable, this->morphTable, PAMERA_LIMB_MAX); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &sColChkInfoInit2); @@ -510,11 +488,11 @@ void func_80BD93CC(EnPamera* this, s16 arg1, s16 arg2) { void func_80BD93F4(EnPamera* this, GlobalContext* globalCtx) { if ((this->actionFunc == func_80BD8B70) || (this->actionFunc == func_80BD8DB0) || (this->actionFunc == func_80BD8964) || (this->actionFunc == func_80BD8A7C)) { - if (this->skelAnime.animation == &D_06008AE0) { + if (this->skelAnime.animation == &object_pamera_Anim_008AE0) { if (Animation_OnFrame(&this->skelAnime, 9.0f) || Animation_OnFrame(&this->skelAnime, 18.0f)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_PAMERA_WALK); } - } else if ((this->skelAnime.animation == &D_06008E38) && + } else if ((this->skelAnime.animation == &object_pamera_Anim_008E38) && (Animation_OnFrame(&this->skelAnime, 2.0f) || Animation_OnFrame(&this->skelAnime, 6.0f))) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_PAMERA_WALK); } diff --git a/src/overlays/actors/ovl_En_Pm/z_en_pm.c b/src/overlays/actors/ovl_En_Pm/z_en_pm.c index 5b7424bbf..f2d1b9d34 100644 --- a/src/overlays/actors/ovl_En_Pm/z_en_pm.c +++ b/src/overlays/actors/ovl_En_Pm/z_en_pm.c @@ -6,6 +6,7 @@ #include "z_en_pm.h" #include "overlays/actors/ovl_En_Door/z_en_door.h" +#include "objects/object_mm/object_mm.h" #define FLAGS 0x00000039 @@ -19,25 +20,6 @@ void EnPm_Draw(Actor* thisx, GlobalContext* globalCtx); void func_80AFA4D0(EnPm* this, GlobalContext* globalCtx); void func_80AFA5FC(EnPm* this, GlobalContext* globalCtx); -extern AnimationHeader D_06000468; -extern AnimationHeader D_0600099C; -extern AnimationHeader D_06000FC4; -extern AnimationHeader D_06001F84; -extern AnimationHeader D_06002238; -extern UNK_PTR D_06002750; -extern UNK_PTR D_06002950; -extern Gfx D_06008348[]; -extern Gfx D_060083E0[]; -extern Gfx D_060085C8[]; -extern FlexSkeletonHeader D_060096E8; -extern AnimationHeader D_060099B4; -extern AnimationHeader D_0600A4E0; -extern AnimationHeader D_0600A8D8; -extern AnimationHeader D_0600B09C; -extern AnimationHeader D_0600BA78; -extern AnimationHeader D_0600C32C; -extern AnimationHeader D_0600C640; - // Game scripts static UNK_TYPE D_80AFAD80[] = { 0x0D000102, 0x3B030900, 0x0C00010B, 0x030C000D, 0x0100F902, 0x0D010F00, 0x12020F00, 0x00050105, 0x0A002E06, @@ -249,11 +231,13 @@ static ColliderSphereInit sSphereInit = { static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; static ActorAnimationEntryS sAnimations[] = { - { &D_06002238, 1.0f, 0, -1, 0, 0 }, { &D_06002238, 1.0f, 0, -1, 0, -4 }, { &D_0600A4E0, 1.0f, 0, -1, 2, 0 }, - { &D_0600B09C, 1.0f, 0, -1, 0, 0 }, { &D_0600B09C, 1.0f, 0, -1, 0, -4 }, { &D_0600BA78, 1.0f, 0, -1, 2, 0 }, - { &D_0600C32C, 1.0f, 0, -1, 0, -4 }, { &D_060099B4, 1.0f, 0, -1, 0, 0 }, { &D_06000FC4, 1.0f, 0, -1, 0, 0 }, - { &D_0600A8D8, 1.0f, 0, -1, 0, 0 }, { &D_0600099C, 1.0f, 0, -1, 0, 0 }, { &D_06001F84, 1.0f, 0, -1, 2, 0 }, - { &D_06000468, 1.0f, 0, -1, 0, 0 }, { &D_0600C640, 1.0f, 0, -1, 0, 0 }, + { &object_mm_Anim_002238, 1.0f, 0, -1, 0, 0 }, { &object_mm_Anim_002238, 1.0f, 0, -1, 0, -4 }, + { &object_mm_Anim_00A4E0, 1.0f, 0, -1, 2, 0 }, { &object_mm_Anim_00B09C, 1.0f, 0, -1, 0, 0 }, + { &object_mm_Anim_00B09C, 1.0f, 0, -1, 0, -4 }, { &object_mm_Anim_00BA78, 1.0f, 0, -1, 2, 0 }, + { &object_mm_Anim_00C32C, 1.0f, 0, -1, 0, -4 }, { &object_mm_Anim_0099B4, 1.0f, 0, -1, 0, 0 }, + { &object_mm_Anim_000FC4, 1.0f, 0, -1, 0, 0 }, { &object_mm_Anim_00A8D8, 1.0f, 0, -1, 0, 0 }, + { &object_mm_Anim_00099C, 1.0f, 0, -1, 0, 0 }, { &object_mm_Anim_001F84, 1.0f, 0, -1, 2, 0 }, + { &object_mm_Anim_000468, 1.0f, 0, -1, 0, 0 }, { &object_mm_Anim_00C640, 1.0f, 0, -1, 0, 0 }, }; s32 func_80AF7B40(void) { @@ -754,19 +738,19 @@ void func_80AF8890(EnPm* this, Gfx** gfx, s32 arg2) { switch (arg2) { case 0: if (this->unk_356 & 0x800) { - gSPDisplayList((*gfx)++, D_06008348); + gSPDisplayList((*gfx)++, object_mm_DL_008348); } break; case 1: if (this->unk_356 & 0x1000) { - gSPDisplayList((*gfx)++, D_060085C8); + gSPDisplayList((*gfx)++, object_mm_DL_0085C8); } break; case 2: if (this->unk_356 & 0x1000) { - gSPDisplayList((*gfx)++, D_060083E0); + gSPDisplayList((*gfx)++, object_mm_DL_0083E0); } break; } @@ -1766,7 +1750,8 @@ void EnPm_Init(Actor* thisx, GlobalContext* globalCtx) { EnPm* this = THIS; ActorShape_Init(&this->actor.shape, 0.0f, NULL, 14.0f); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060096E8, NULL, this->jointTable, this->morphTable, 16); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_mm_Skel_0096E8, NULL, this->jointTable, this->morphTable, + 16); this->unk_384 = -1; func_80AF7E98(this, 0); Collider_InitAndSetCylinder(globalCtx, &this->colliderCylinder, &this->actor, &sCylinderInit); @@ -1885,9 +1870,9 @@ void EnPm_TransformLimbDraw(GlobalContext* globalCtx, s32 arg1, Actor* thisx, Gf } void EnPm_Draw(Actor* thisx, GlobalContext* globalCtx) { - static UNK_PTR D_80AFB914[] = { - &D_06002950, - &D_06002750, + static TexturePtr D_80AFB914[] = { + object_mm_Tex_002950, + object_mm_Tex_002750, }; EnPm* this = THIS; s32 pad; diff --git a/src/overlays/actors/ovl_En_Po_Fusen/z_en_po_fusen.c b/src/overlays/actors/ovl_En_Po_Fusen/z_en_po_fusen.c index dae1f4e07..5641c83e7 100644 --- a/src/overlays/actors/ovl_En_Po_Fusen/z_en_po_fusen.c +++ b/src/overlays/actors/ovl_En_Po_Fusen/z_en_po_fusen.c @@ -6,6 +6,7 @@ #include "z_en_po_fusen.h" #include "overlays/actors/ovl_En_Ma4/z_en_ma4.h" +#include "objects/object_po_fusen/object_po_fusen.h" #define FLAGS 0x80100030 @@ -28,9 +29,6 @@ void EnPoFusen_IdleFuse(EnPoFusen* this, GlobalContext* globalCtx); s32 EnPoFusen_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx); -extern AnimationHeader D_06000040; -extern FlexSkeletonHeader D_060024F0; - const ActorInit En_Po_Fusen_InitVars = { ACTOR_EN_PO_FUSEN, ACTORCAT_PROP, @@ -111,7 +109,8 @@ void EnPoFusen_Init(Actor* thisx, GlobalContext* globalCtx) { if (0) {} this->collider.dim.worldSphere.radius = 40; - SkelAnime_InitFlex(globalCtx, &this->anime, &D_060024F0, &D_06000040, this->jointTable, this->morphTable, 10); + SkelAnime_InitFlex(globalCtx, &this->anime, &object_po_fusen_Skel_0024F0, &object_po_fusen_Anim_000040, + this->jointTable, this->morphTable, 10); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f); Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 0x4); diff --git a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c index a2e299290..af8e0f11b 100644 --- a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c +++ b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c @@ -6,6 +6,7 @@ #include "z_en_po_sisters.h" #include "objects/gameplay_keep/gameplay_keep.h" +#include "objects/object_po_sisters/object_po_sisters.h" #define FLAGS 0x00005015 @@ -47,24 +48,6 @@ void func_80B1C0A4(EnPoSisters* this, GlobalContext* globalCtx); void func_80B1C2E8(EnPoSisters* this); void func_80B1C340(EnPoSisters* this, GlobalContext* globalCtx); -extern AnimationHeader D_06000114; -extern AnimationHeader D_060008C0; -extern AnimationHeader D_06000A54; -extern AnimationHeader D_06000D40; -extern AnimationHeader D_0600119C; -extern AnimationHeader D_060014CC; -extern Gfx D_06001CB0[]; -extern Gfx D_06001DE0[]; -extern Gfx D_060027B0[]; -extern Gfx D_06002EB8[]; -extern Gfx D_06002F88[]; -extern Gfx D_06003628[]; -extern Gfx D_06003880[]; -extern Gfx D_06003DC8[]; -extern Gfx D_06004020[]; -extern Gfx D_060046E0[]; -extern SkeletonHeader D_060065C8; - static Color_RGBA8 D_80B1DA30[] = { { 255, 170, 255, 255 }, { 255, 200, 0, 255 }, @@ -159,7 +142,8 @@ void EnPoSisters_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->actor, sInitChain); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 50.0f); - SkelAnime_Init(globalCtx, &this->skelAnime, &D_060065C8, &D_060014CC, this->jointTable, this->morphTable, 12); + SkelAnime_Init(globalCtx, &this->skelAnime, &object_po_sisters_Skel_0065C8, &object_po_sisters_Anim_0014CC, + this->jointTable, this->morphTable, 12); this->unk_226 = 255; this->unk_227 = 255; this->unk_228 = 210; @@ -293,7 +277,7 @@ void func_80B1A9B0(EnPoSisters* this, GlobalContext* globalCtx) { } void func_80B1AA88(EnPoSisters* this) { - Animation_MorphToLoop(&this->skelAnime, &D_060014CC, -3.0f); + Animation_MorphToLoop(&this->skelAnime, &object_po_sisters_Anim_0014CC, -3.0f); this->actor.speedXZ = 0.0f; this->unk_192 = Rand_S16Offset(100, 50); this->actionFunc = func_80B1AAE8; @@ -308,7 +292,7 @@ void func_80B1AAE8(EnPoSisters* this, GlobalContext* globalCtx) { } void func_80B1AB5C(EnPoSisters* this) { - Animation_MorphToLoop(&this->skelAnime, &D_060014CC, -3.0f); + Animation_MorphToLoop(&this->skelAnime, &object_po_sisters_Anim_0014CC, -3.0f); this->unk_192 = Rand_S16Offset(2, 3); this->actor.speedXZ = 0.0f; this->actionFunc = func_80B1ABB8; @@ -329,7 +313,7 @@ void func_80B1ABB8(EnPoSisters* this, GlobalContext* globalCtx) { void func_80B1AC40(EnPoSisters* this) { if (this->actionFunc != func_80B1AE3C) { - Animation_MorphToLoop(&this->skelAnime, &D_06000D40, -3.0f); + Animation_MorphToLoop(&this->skelAnime, &object_po_sisters_Anim_000D40, -3.0f); } this->unk_192 = Rand_S16Offset(15, 3); this->unk_191 |= (0x6 | 0x1); @@ -391,9 +375,9 @@ void func_80B1AF8C(EnPoSisters* this) { this->collider.base.acFlags |= AC_HARD; } - Animation_MorphToLoop(&this->skelAnime, &D_06000114, -5.0f); + Animation_MorphToLoop(&this->skelAnime, &object_po_sisters_Anim_000114, -5.0f); this->actor.speedXZ = 0.0f; - this->unk_192 = Animation_GetLastFrame(&D_06000114.common) * 3 + 3; + this->unk_192 = Animation_GetLastFrame(&object_po_sisters_Anim_000114.common) * 3 + 3; this->unk_191 &= ~2; this->actionFunc = func_80B1B020; } @@ -418,7 +402,7 @@ void func_80B1B0E0(EnPoSisters* this) { if (this->unk_18C == 0) { this->collider.base.colType = COLTYPE_METAL; this->collider.base.acFlags |= AC_HARD; - Animation_MorphToLoop(&this->skelAnime, &D_06000114, -5.0f); + Animation_MorphToLoop(&this->skelAnime, &object_po_sisters_Anim_000114, -5.0f); } this->unk_192 = 5; this->actor.world.rot.y = this->actor.yawTowardsPlayer; @@ -456,7 +440,7 @@ void func_80B1B168(EnPoSisters* this, GlobalContext* globalCtx) { } void func_80B1B280(EnPoSisters* this) { - Animation_MorphToLoop(&this->skelAnime, &D_06000D40, -3.0f); + Animation_MorphToLoop(&this->skelAnime, &object_po_sisters_Anim_000D40, -3.0f); this->actor.world.rot.y = BINANG_ROT180(this->actor.yawTowardsPlayer); if (this->unk_18C != 0) { this->collider.base.colType = COLTYPE_HIT3; @@ -480,7 +464,7 @@ void func_80B1B2F0(EnPoSisters* this, GlobalContext* globalCtx) { } void func_80B1B3A8(EnPoSisters* this) { - Animation_MorphToPlayOnce(&this->skelAnime, &D_060008C0, -3.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &object_po_sisters_Anim_0008C0, -3.0f); if (this->collider.base.ac != NULL) { func_800BE504(&this->actor, &this->collider); } @@ -524,7 +508,7 @@ void func_80B1B444(EnPoSisters* this, GlobalContext* globalCtx) { } void func_80B1B5B4(EnPoSisters* this) { - Animation_MorphToLoop(&this->skelAnime, &D_06000A54, -3.0f); + Animation_MorphToLoop(&this->skelAnime, &object_po_sisters_Anim_000A54, -3.0f); this->actor.world.rot.y = BINANG_ROT180(this->actor.shape.rot.y); this->unk_192 = 5; this->unk_191 |= (0x8 | 0x2 | 0x1); @@ -552,7 +536,8 @@ void func_80B1B628(EnPoSisters* this, GlobalContext* globalCtx) { } void func_80B1B70C(EnPoSisters* this) { - Animation_Change(&this->skelAnime, &D_0600119C, 1.5f, 0.0f, Animation_GetLastFrame(&D_0600119C.common), 2, -3.0f); + Animation_Change(&this->skelAnime, &object_po_sisters_Anim_00119C, 1.5f, 0.0f, + Animation_GetLastFrame(&object_po_sisters_Anim_00119C.common), 2, -3.0f); this->unk_194 = 100; this->actor.speedXZ = 0.0f; this->actor.world.rot.y = this->actor.shape.rot.y; @@ -576,7 +561,8 @@ void func_80B1B7BC(EnPoSisters* this, GlobalContext* globalCtx) { } void func_80B1B860(EnPoSisters* this, GlobalContext* globalCtx) { - Animation_Change(&this->skelAnime, &D_0600119C, 1.5f, 0.0f, Animation_GetLastFrame(&D_0600119C.common), 2, -3.0f); + Animation_Change(&this->skelAnime, &object_po_sisters_Anim_00119C, 1.5f, 0.0f, + Animation_GetLastFrame(&object_po_sisters_Anim_00119C.common), 2, -3.0f); if (this->unk_18C == 0) { this->unk_2EC = 110.0f; func_80B1A768(this, globalCtx); @@ -758,7 +744,7 @@ void func_80B1BF2C(EnPoSisters* this, GlobalContext* globalCtx) { } void func_80B1C030(EnPoSisters* this) { - Animation_MorphToLoop(&this->skelAnime, &D_06000D40, -3.0f); + Animation_MorphToLoop(&this->skelAnime, &object_po_sisters_Anim_000D40, -3.0f); this->unk_229 = 255; this->unk_192 = 300; this->unk_194 = 3; @@ -825,7 +811,7 @@ void func_80B1C0A4(EnPoSisters* this, GlobalContext* globalCtx) { } void func_80B1C2E8(EnPoSisters* this) { - Animation_PlayOnce(&this->skelAnime, &D_0600119C); + Animation_PlayOnce(&this->skelAnime, &object_po_sisters_Anim_00119C); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_APPEAR); this->unk_229 = 0; this->unk_191 = 0x20; @@ -980,15 +966,15 @@ void EnPoSisters_Update(Actor* thisx, GlobalContext* globalCtx) { } void func_80B1C974(EnPoSisters* this) { - if (this->skelAnime.animation == &D_06000114) { + if (this->skelAnime.animation == &object_po_sisters_Anim_000114) { this->unk_226 = CLAMP_MAX(this->unk_226 + 5, 255); this->unk_227 = CLAMP_MIN(this->unk_227 - 5, 50); this->unk_228 = CLAMP_MIN(this->unk_228 - 5, 0); - } else if (this->skelAnime.animation == &D_06000A54) { + } else if (this->skelAnime.animation == &object_po_sisters_Anim_000A54) { this->unk_226 = CLAMP_MAX(this->unk_226 + 5, 80); this->unk_227 = CLAMP_MAX(this->unk_227 + 5, 255); this->unk_228 = CLAMP_MAX(this->unk_228 + 5, 225); - } else if (this->skelAnime.animation == &D_060008C0) { + } else if (this->skelAnime.animation == &object_po_sisters_Anim_0008C0) { if (this->actor.colorFilterTimer & 0x2) { this->unk_226 = 0; this->unk_227 = 0; @@ -1014,16 +1000,16 @@ void func_80B1C974(EnPoSisters* this) { s32 EnPoSisters_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx, Gfx** gfx) { static Gfx* D_80B1DACC[] = { - D_06001DE0, - D_06002F88, - D_06003628, - D_06003DC8, + object_po_sisters_DL_001DE0, + object_po_sisters_DL_002F88, + object_po_sisters_DL_003628, + object_po_sisters_DL_003DC8, }; static Gfx* D_80B1DADC[] = { - D_06001CB0, - D_06002EB8, - D_06003880, - D_06004020, + object_po_sisters_DL_001CB0, + object_po_sisters_DL_002EB8, + object_po_sisters_DL_003880, + object_po_sisters_DL_004020, }; static Color_RGBA8 D_80B1DAEC[] = { { 80, 0, 100, 0 }, @@ -1083,7 +1069,7 @@ void EnPoSisters_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dLi if ((this->actionFunc == func_80B1BA90) && (this->unk_192 >= 8) && (limbIndex == 9)) { gSPMatrix((*gfx)++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList((*gfx)++, D_060046E0); + gSPDisplayList((*gfx)++, object_po_sisters_DL_0046E0); } if (limbIndex == 8) { @@ -1153,7 +1139,7 @@ void EnPoSisters_Draw(Actor* thisx, GlobalContext* globalCtx) { Matrix_SetCurrentState(&this->unk_358); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, D_060027B0); + gSPDisplayList(POLY_OPA_DISP++, object_po_sisters_DL_0027B0); } gSPSegment(POLY_XLU_DISP++, 0x08, diff --git a/src/overlays/actors/ovl_En_Poh/z_en_poh.c b/src/overlays/actors/ovl_En_Poh/z_en_poh.c index aedd9efc1..a5b377ecb 100644 --- a/src/overlays/actors/ovl_En_Poh/z_en_poh.c +++ b/src/overlays/actors/ovl_En_Poh/z_en_poh.c @@ -5,6 +5,7 @@ */ #include "z_en_poh.h" +#include "objects/object_po/object_po.h" #define FLAGS 0x00001205 @@ -45,17 +46,6 @@ void func_80B2E3F8(EnPoh* this, GlobalContext* globalCtx); void func_80B2F328(Actor* thisx, GlobalContext* globalCtx); void func_80B2F37C(Actor* thisx, GlobalContext* globalCtx); -extern AnimationHeader D_060001A8; -extern AnimationHeader D_060004EC; -extern AnimationHeader D_060006E0; -extern AnimationHeader D_06000A60; -extern AnimationHeader D_060011C4; -extern AnimationHeader D_060015B0; -extern Gfx D_06002608[]; -extern Gfx D_06002D28[]; -extern Gfx D_06003850[]; -extern SkeletonHeader D_060050D0; - const ActorInit En_Poh_InitVars = { ACTOR_EN_POH, ACTORCAT_ENEMY, @@ -175,7 +165,8 @@ void EnPoh_Init(Actor* thisx, GlobalContext* globalCtx) { this->lightNode = LightContext_InsertLight(globalCtx, &globalCtx->lightCtx, &this->lightInfo); Lights_PointGlowSetInfo(&this->lightInfo, this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z, 255, 255, 255, 0); - SkelAnime_Init(globalCtx, &this->skelAnime, &D_060050D0, &D_06000A60, this->jointTable, this->morphTable, 21); + SkelAnime_Init(globalCtx, &this->skelAnime, &object_po_Skel_0050D0, &object_po_Anim_000A60, this->jointTable, + this->morphTable, 21); this->actor.bgCheckFlags |= 0x400; func_80B2D0E8(this); } @@ -222,7 +213,7 @@ void func_80B2C9B8(EnPoh* this, GlobalContext* globalCtx) { } void func_80B2CA4C(EnPoh* this) { - Animation_PlayLoop(&this->skelAnime, &D_060015B0); + Animation_PlayLoop(&this->skelAnime, &object_po_Anim_0015B0); this->unk_18E = Rand_S16Offset(2, 3); this->actionFunc = func_80B2CAA4; this->actor.speedXZ = 0.0f; @@ -248,7 +239,7 @@ void func_80B2CAA4(EnPoh* this, GlobalContext* globalCtx) { } void func_80B2CB60(EnPoh* this) { - Animation_PlayLoop(&this->skelAnime, &D_06000A60); + Animation_PlayLoop(&this->skelAnime, &object_po_Anim_000A60); this->unk_18E = Rand_S16Offset(15, 3); this->colliderCylinder.base.acFlags |= AC_ON; this->actionFunc = func_80B2CBBC; @@ -283,7 +274,7 @@ void func_80B2CBBC(EnPoh* this, GlobalContext* globalCtx) { } void func_80B2CD14(EnPoh* this) { - Animation_PlayLoop(&this->skelAnime, &D_06000A60); + Animation_PlayLoop(&this->skelAnime, &object_po_Anim_000A60); this->actionFunc = func_80B2CD64; this->unk_18E = 0; this->actor.speedXZ = 2.0f; @@ -322,7 +313,7 @@ void func_80B2CD64(EnPoh* this, GlobalContext* globalCtx) { } void func_80B2CEC8(EnPoh* this) { - Animation_MorphToLoop(&this->skelAnime, &D_060001A8, -6.0f); + Animation_MorphToLoop(&this->skelAnime, &object_po_Anim_0001A8, -6.0f); this->unk_18E = 12; this->actor.speedXZ = 0.0f; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_LAUGH); @@ -351,7 +342,7 @@ void func_80B2CF28(EnPoh* this, GlobalContext* globalCtx) { } void func_80B2CFF8(EnPoh* this) { - Animation_MorphToPlayOnce(&this->skelAnime, &D_060004EC, -6.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &object_po_Anim_0004EC, -6.0f); func_800BE504(&this->actor, &this->colliderCylinder); this->colliderCylinder.base.acFlags &= ~AC_ON; this->actor.speedXZ = 5.0f; @@ -373,7 +364,7 @@ void func_80B2D07C(EnPoh* this, GlobalContext* globalCtx) { void func_80B2D0E8(EnPoh* this) { this->unk_197 = 0; this->actor.flags &= ~1; - Animation_PlayOnceSetSpeed(&this->skelAnime, &D_060011C4, 0.0f); + Animation_PlayOnceSetSpeed(&this->skelAnime, &object_po_Anim_0011C4, 0.0f); this->actionFunc = func_80B2D140; } @@ -452,7 +443,7 @@ void func_80B2D300(EnPoh* this, GlobalContext* globalCtx) { } void func_80B2D5DC(EnPoh* this) { - Animation_PlayOnce(&this->skelAnime, &D_06000A60); + Animation_PlayOnce(&this->skelAnime, &object_po_Anim_000A60); this->actionFunc = func_80B2D628; this->actor.speedXZ = -5.0f; } @@ -469,7 +460,7 @@ void func_80B2D628(EnPoh* this, GlobalContext* globalCtx) { } void func_80B2D694(EnPoh* this) { - Animation_PlayLoop(&this->skelAnime, &D_060015B0); + Animation_PlayLoop(&this->skelAnime, &object_po_Anim_0015B0); this->unk_192 = BINANG_ROT180(this->actor.world.rot.y); this->actionFunc = func_80B2D6EC; this->actor.speedXZ = 0.0f; @@ -547,7 +538,7 @@ void func_80B2D980(EnPoh* this, GlobalContext* globalCtx) { } void func_80B2DAD0(EnPoh* this) { - Animation_MorphToLoop(&this->skelAnime, &D_060006E0, -5.0f); + Animation_MorphToLoop(&this->skelAnime, &object_po_Anim_0006E0, -5.0f); this->actor.speedXZ = 5.0f; this->actor.world.rot.y = BINANG_ROT180(this->actor.shape.rot.y); this->colliderCylinder.base.acFlags |= AC_ON; @@ -592,7 +583,8 @@ void func_80B2DC50(EnPoh* this, GlobalContext* globalCtx) { void func_80B2DD2C(EnPoh* this, GlobalContext* globalCtx) { if ((this->actor.bgCheckFlags & 1) || (this->actor.floorHeight <= BGCHECK_Y_MIN)) { - EffectSsHahen_SpawnBurst(globalCtx, &this->actor.world.pos, 6.0f, 0, 1, 1, 15, OBJECT_PO, 10, D_06002D28); + EffectSsHahen_SpawnBurst(globalCtx, &this->actor.world.pos, 6.0f, 0, 1, 1, 15, OBJECT_PO, 10, + object_po_DL_002D28); func_80B2E0B0(this); } @@ -805,8 +797,8 @@ void func_80B2E8E0(EnPoh* this) { } void EnPoh_Update(Actor* thisx, GlobalContext* globalCtx2) { - EnPoh* this = THIS; GlobalContext* globalCtx = globalCtx2; + EnPoh* this = THIS; s32 pad; if (this->colliderSph.base.atFlags & AT_HIT) { @@ -888,7 +880,7 @@ void EnPoh_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve Collider_UpdateSpheres(limbIndex, &this->colliderSph); if ((this->actionFunc == func_80B2D300) && (this->unk_18E >= 2) && (limbIndex == 5)) { gSPMatrix((*gfx)++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList((*gfx)++, D_06002608); + gSPDisplayList((*gfx)++, object_po_DL_002608); } if (limbIndex == 18) { @@ -963,7 +955,7 @@ void EnPoh_Draw(Actor* thisx, GlobalContext* globalCtx) { Matrix_SetCurrentState(&this->unk_3D8); gSPMatrix(&gfx[2], Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(&gfx[3], D_06002D28); + gSPDisplayList(&gfx[3], object_po_DL_002D28); POLY_OPA_DISP = &gfx[4]; func_800BE680(globalCtx, &this->actor, this->unk_2A0, 10, this->actor.scale.x * 100.0f * this->unk_29C, 0.0f, @@ -1002,7 +994,7 @@ void func_80B2F37C(Actor* thisx, GlobalContext* globalCtx) { this->actor.world.pos.z + sp7C.z, this->unk_198, this->unk_199, this->unk_19A, 200); gSPMatrix(&gfx[2], Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(&gfx[3], D_06002D28); + gSPDisplayList(&gfx[3], object_po_DL_002D28); POLY_OPA_DISP = &gfx[4]; } else { @@ -1017,7 +1009,7 @@ void func_80B2F37C(Actor* thisx, GlobalContext* globalCtx) { Matrix_InsertYRotation_f((func_800DFCDC(GET_ACTIVE_CAM(globalCtx)) + 0x8000) * (M_PI / 32768), MTXMODE_APPLY); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_XLU_DISP++, D_06003850); + gSPDisplayList(POLY_XLU_DISP++, object_po_DL_003850); } CLOSE_DISPS(globalCtx->state.gfxCtx); diff --git a/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c b/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c index 522f8c6d5..8e34372b7 100644 --- a/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c +++ b/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c @@ -5,6 +5,7 @@ */ #include "z_en_railgibud.h" +#include "objects/object_rd/object_rd.h" #define FLAGS 0x00000415 @@ -47,28 +48,6 @@ void func_80BA7D04(EnRailgibud* this, GlobalContext* globalCtx); void func_80BA7D30(EnRailgibud* this, GlobalContext* globalCtx); void func_80BA8050(Actor* thisx, GlobalContext* globalCtx); -extern AnimationHeader D_060009C4; -extern AnimationHeader D_06000F1C; -extern AnimationHeader D_06001600; -extern FlexSkeletonHeader D_060053E8; -extern AnimationHeader D_06005DF4; -extern AnimationHeader D_060061E4; -extern AnimationHeader D_06006678; -extern AnimationHeader D_06006B08; -extern AnimationHeader D_06006EEC; -extern AnimationHeader D_060073A4; -extern AnimationHeader D_06007BBC; -extern AnimationHeader D_060081A8; -extern AnimationHeader D_06009298; -extern AnimationHeader D_06009900; -extern AnimationHeader D_0600A450; -extern AnimationHeader D_0600ABE0; -extern FlexSkeletonHeader D_06010B88; -extern AnimationHeader D_060113EC; -extern AnimationHeader D_060118D8; -extern AnimationHeader D_06011DB8; -extern AnimationHeader D_0601216C; - const ActorInit En_Railgibud_InitVars = { ACTOR_EN_RAILGIBUD, ACTORCAT_ENEMY, @@ -82,16 +61,16 @@ const ActorInit En_Railgibud_InitVars = { }; static ActorAnimationEntry sAnimations[] = { - { &D_06006678, 1.0f, 0.0f, 0.0f, 0, -8.0f }, { &D_06006B08, 0.5f, 0.0f, 0.0f, 3, 0.0f }, - { &D_06006EEC, 1.0f, 0.0f, 0.0f, 2, -8.0f }, { &D_060073A4, 0.0f, 0.0f, 0.0f, 2, -8.0f }, - { &D_06007BBC, 1.0f, 0.0f, 0.0f, 2, -8.0f }, { &D_060081A8, 1.0f, 0.0f, 0.0f, 0, -8.0f }, - { &D_06009298, 1.0f, 0.0f, 0.0f, 2, -8.0f }, { &D_06009900, 1.0f, 0.0f, 0.0f, 2, -8.0f }, - { &D_0600A450, 1.0f, 0.0f, 0.0f, 2, -8.0f }, { &D_0600ABE0, 1.0f, 0.0f, 0.0f, 0, -8.0f }, - { &D_060113EC, 0.4f, 0.0f, 0.0f, 1, -8.0f }, { &D_0601216C, 1.0f, 0.0f, 0.0f, 0, -8.0f }, - { &D_060118D8, 1.0f, 0.0f, 0.0f, 0, -8.0f }, { &D_06011DB8, 1.0f, 0.0f, 0.0f, 0, -8.0f }, - { &D_0600A450, 3.0f, 0.0f, 0.0f, 2, -6.0f }, { &D_06005DF4, 1.0f, 0.0f, 0.0f, 2, -8.0f }, - { &D_060061E4, 1.0f, 0.0f, 0.0f, 0, -8.0f }, { &D_06001600, 1.0f, 0.0f, 0.0f, 0, -8.0f }, - { &D_060009C4, 1.0f, 0.0f, 0.0f, 2, -8.0f }, { &D_06000F1C, 1.0f, 0.0f, 0.0f, 0, -8.0f }, + { &object_rd_Anim_006678, 1.0f, 0.0f, 0.0f, 0, -8.0f }, { &object_rd_Anim_006B08, 0.5f, 0.0f, 0.0f, 3, 0.0f }, + { &object_rd_Anim_006EEC, 1.0f, 0.0f, 0.0f, 2, -8.0f }, { &object_rd_Anim_0073A4, 0.0f, 0.0f, 0.0f, 2, -8.0f }, + { &object_rd_Anim_007BBC, 1.0f, 0.0f, 0.0f, 2, -8.0f }, { &object_rd_Anim_0081A8, 1.0f, 0.0f, 0.0f, 0, -8.0f }, + { &object_rd_Anim_009298, 1.0f, 0.0f, 0.0f, 2, -8.0f }, { &object_rd_Anim_009900, 1.0f, 0.0f, 0.0f, 2, -8.0f }, + { &object_rd_Anim_00A450, 1.0f, 0.0f, 0.0f, 2, -8.0f }, { &object_rd_Anim_00ABE0, 1.0f, 0.0f, 0.0f, 0, -8.0f }, + { &object_rd_Anim_0113EC, 0.4f, 0.0f, 0.0f, 1, -8.0f }, { &object_rd_Anim_01216C, 1.0f, 0.0f, 0.0f, 0, -8.0f }, + { &object_rd_Anim_0118D8, 1.0f, 0.0f, 0.0f, 0, -8.0f }, { &object_rd_Anim_011DB8, 1.0f, 0.0f, 0.0f, 0, -8.0f }, + { &object_rd_Anim_00A450, 3.0f, 0.0f, 0.0f, 2, -6.0f }, { &object_rd_Anim_005DF4, 1.0f, 0.0f, 0.0f, 2, -8.0f }, + { &object_rd_Anim_0061E4, 1.0f, 0.0f, 0.0f, 0, -8.0f }, { &object_rd_Anim_001600, 1.0f, 0.0f, 0.0f, 0, -8.0f }, + { &object_rd_Anim_0009C4, 1.0f, 0.0f, 0.0f, 2, -8.0f }, { &object_rd_Anim_000F1C, 1.0f, 0.0f, 0.0f, 0, -8.0f }, }; static ColliderCylinderInit sCylinderInit = { @@ -220,7 +199,8 @@ void EnRailgibud_Init(Actor* thisx, GlobalContext* globalCtx) { } ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 28.0f); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060053E8, &D_0600ABE0, this->jointTable, this->morphTable, 26); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_rd_Skel_0053E8, &object_rd_Anim_00ABE0, this->jointTable, + this->morphTable, 26); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); @@ -522,7 +502,8 @@ void func_80BA64AC(EnRailgibud* this, GlobalContext* globalCtx) { this->actor.world.rot.y = this->actor.shape.rot.y; if ((this->unk_3F6 > 0) && (this->unk_404 == 0) && (this->unk_3F8 == 0)) { this->actor.hintId = 0x2A; - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06010B88, NULL, this->jointTable, this->morphTable, 26); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_rd_Skel_010B88, NULL, this->jointTable, + this->morphTable, 26); this->unk_3F8 = 1; } func_80BA6284(this); @@ -585,7 +566,8 @@ void func_80BA66C8(EnRailgibud* this, GlobalContext* globalCtx) { } if ((this->unk_3F2 == 20) && (this->unk_3F6 > 0) && (this->unk_404 == 0) && (this->unk_3F8 == 0)) { - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06010B88, NULL, this->jointTable, this->morphTable, 26); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_rd_Skel_010B88, NULL, this->jointTable, + this->morphTable, 26); this->unk_3F8 = 1; } } @@ -997,7 +979,8 @@ void func_80BA7B6C(EnRailgibud* this, GlobalContext* globalCtx) { this->actor.flags |= 0x100000; this->actor.flags |= 0x10; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 28.0f); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060053E8, &D_0600ABE0, this->jointTable, this->morphTable, 26); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_rd_Skel_0053E8, &object_rd_Anim_00ABE0, this->jointTable, + this->morphTable, 26); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); diff --git a/src/overlays/actors/ovl_En_Rd/z_en_rd.c b/src/overlays/actors/ovl_En_Rd/z_en_rd.c index a92dd20c2..4b942f03f 100644 --- a/src/overlays/actors/ovl_En_Rd/z_en_rd.c +++ b/src/overlays/actors/ovl_En_Rd/z_en_rd.c @@ -5,6 +5,7 @@ */ #include "z_en_rd.h" +#include "objects/object_rd/object_rd.h" #define FLAGS 0x00000415 @@ -49,23 +50,6 @@ void func_808D6200(EnRd* this, GlobalContext* globalCtx); void func_808D6388(EnRd* this, GlobalContext* globalCtx); void func_808D65BC(EnRd* this, GlobalContext* globalCtx); -extern FlexSkeletonHeader D_060053E8; -extern AnimationHeader D_06006678; -extern AnimationHeader D_06006B08; -extern AnimationHeader D_06006EEC; -extern AnimationHeader D_060073A4; -extern AnimationHeader D_06007BBC; -extern AnimationHeader D_060081A8; -extern AnimationHeader D_06009298; -extern AnimationHeader D_06009900; -extern AnimationHeader D_0600A450; -extern AnimationHeader D_0600ABE0; -extern FlexSkeletonHeader D_06010B88; -extern AnimationHeader D_060113EC; -extern AnimationHeader D_060118D8; -extern AnimationHeader D_06011DB8; -extern AnimationHeader D_0601216C; - const ActorInit En_Rd_InitVars = { ACTOR_EN_RD, ACTORCAT_ENEMY, @@ -163,11 +147,11 @@ void EnRd_Init(Actor* thisx, GlobalContext* globalCtx) { } if (this->actor.params >= ENRD_GET_MINUS_1) { - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06010B88, &D_0600ABE0, this->jointTable, this->morphTable, - 26); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_rd_Skel_010B88, &object_rd_Anim_00ABE0, + this->jointTable, this->morphTable, 26); } else { - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060053E8, &D_0600ABE0, this->jointTable, this->morphTable, - 26); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_rd_Skel_0053E8, &object_rd_Anim_00ABE0, + this->jointTable, this->morphTable, 26); } Collider_InitCylinder(globalCtx, &this->collider); @@ -280,9 +264,9 @@ void func_808D4260(EnRd* this, GlobalContext* globalCtx) { void func_808D4308(EnRd* this) { if (this->actor.params != ENRD_GET_2) { - Animation_MorphToLoop(&this->skelAnime, &D_0600ABE0, -6.0f); + Animation_MorphToLoop(&this->skelAnime, &object_rd_Anim_00ABE0, -6.0f); } else { - Animation_PlayLoop(&this->skelAnime, &D_060081A8); + Animation_PlayLoop(&this->skelAnime, &object_rd_Anim_0081A8); } this->unk_3EF = 0; @@ -298,9 +282,9 @@ void func_808D43AC(EnRd* this, GlobalContext* globalCtx) { Math_SmoothStepToS(&this->unk_3DA, 0, 1, 100, 0); if ((this->actor.params == ENRD_GET_2) && Animation_OnFrame(&this->skelAnime, 0.0f)) { if (Rand_ZeroOne() >= 0.5f) { - Animation_PlayLoop(&this->skelAnime, &D_060081A8); + Animation_PlayLoop(&this->skelAnime, &object_rd_Anim_0081A8); } else { - Animation_PlayLoop(&this->skelAnime, &D_06007BBC); + Animation_PlayLoop(&this->skelAnime, &object_rd_Anim_007BBC); } } else { this->unk_3D6--; @@ -343,7 +327,7 @@ void func_808D43AC(EnRd* this, GlobalContext* globalCtx) { } void func_808D45D4(EnRd* this) { - Animation_MorphToLoop(&this->skelAnime, &D_0601216C, -6.0f); + Animation_MorphToLoop(&this->skelAnime, &object_rd_Anim_01216C, -6.0f); this->unk_3EF = 14; this->unk_3D6 = (Rand_ZeroOne() * 10.0f) + 5.0f; this->unk_3E4 = 0; @@ -367,7 +351,7 @@ void func_808D4660(EnRd* this, GlobalContext* globalCtx) { } else { this->actor.hintId = 0x2A; } - Animation_Change(&this->skelAnime, &D_060073A4, 0.0f, 0.0f, 19.0f, 2, -10.0f); + Animation_Change(&this->skelAnime, &object_rd_Anim_0073A4, 0.0f, 0.0f, 19.0f, 2, -10.0f); this->actionFunc = func_808D49E4; } @@ -386,7 +370,7 @@ void func_808D4660(EnRd* this, GlobalContext* globalCtx) { } void func_808D47DC(EnRd* this) { - Animation_MorphToLoop(&this->skelAnime, &D_06011DB8, -6.0f); + Animation_MorphToLoop(&this->skelAnime, &object_rd_Anim_011DB8, -6.0f); this->unk_3EF = 15; this->unk_3D6 = (Rand_ZeroOne() * 10.0f) + 5.0f; this->unk_3E4 = 0; @@ -410,7 +394,7 @@ void func_808D4868(EnRd* this, GlobalContext* globalCtx) { } else { this->actor.hintId = 0x2A; } - Animation_Change(&this->skelAnime, &D_060073A4, 0.0f, 0.0f, 19.0f, 2, -10.0f); + Animation_Change(&this->skelAnime, &object_rd_Anim_0073A4, 0.0f, 0.0f, 19.0f, 2, -10.0f); this->actionFunc = func_808D49E4; } @@ -446,7 +430,7 @@ void func_808D49E4(EnRd* this, GlobalContext* globalCtx) { } void func_808D4A90(EnRd* this) { - Animation_MorphToLoop(&this->skelAnime, &D_060118D8, -6.0f); + Animation_MorphToLoop(&this->skelAnime, &object_rd_Anim_0118D8, -6.0f); this->unk_3EF = 16; this->unk_3D6 = (Rand_ZeroOne() * 10.0f) + 5.0f; this->unk_3E4 = 4370; @@ -507,7 +491,7 @@ void func_808D4CA8(EnRd* this, GlobalContext* globalCtx) { this->unk_3E4 -= 100; if ((this->unk_3E4 < 2100) && (this->unk_3E4 >= 2000)) { - Animation_Change(&this->skelAnime, &D_060073A4, 0.0f, 0.0f, 19.0f, 2, -10.0f); + Animation_Change(&this->skelAnime, &object_rd_Anim_0073A4, 0.0f, 0.0f, 19.0f, 2, -10.0f); } else if (this->unk_3E4 < 1000) { if ((this->actor.params != ENRD_GET_2) && (this->unk_3EC == 0)) { func_808D5C54(this); @@ -518,7 +502,8 @@ void func_808D4CA8(EnRd* this, GlobalContext* globalCtx) { } void func_808D4DC4(EnRd* this) { - Animation_Change(&this->skelAnime, &D_0600ABE0, 0.0f, 0.0f, Animation_GetLastFrame(&D_0600ABE0), 0, -6.0f); + Animation_Change(&this->skelAnime, &object_rd_Anim_00ABE0, 0.0f, 0.0f, + Animation_GetLastFrame(&object_rd_Anim_00ABE0), 0, -6.0f); this->unk_3EF = 13; this->unk_3D6 = 6; this->actor.shape.rot.x = -0x4000; @@ -552,9 +537,9 @@ void func_808D4E60(EnRd* this, GlobalContext* globalCtx) { } void func_808D4FE0(EnRd* this, GlobalContext* globalCtx) { - f32 frameCount = Animation_GetLastFrame(&D_060113EC); + f32 frameCount = Animation_GetLastFrame(&object_rd_Anim_0113EC); - Animation_Change(&this->skelAnime, &D_060113EC, 1.0f, 4.0f, frameCount, 1, -4.0f); + Animation_Change(&this->skelAnime, &object_rd_Anim_0113EC, 1.0f, 4.0f, frameCount, 1, -4.0f); this->actor.speedXZ = 0.4f; this->unk_3EF = 4; this->actionFunc = func_808D506C; @@ -627,7 +612,8 @@ void func_808D506C(EnRd* this, GlobalContext* globalCtx) { } void func_808D53C0(EnRd* this, GlobalContext* globalCtx) { - Animation_Change(&this->skelAnime, &D_060113EC, 0.5f, 0.0f, Animation_GetLastFrame(&D_060113EC), 1, -4.0f); + Animation_Change(&this->skelAnime, &object_rd_Anim_0113EC, 0.5f, 0.0f, + Animation_GetLastFrame(&object_rd_Anim_0113EC), 1, -4.0f); this->unk_3EF = 2; this->actionFunc = func_808D5440; } @@ -677,9 +663,9 @@ void func_808D5440(EnRd* this, GlobalContext* globalCtx) { } void func_808D5660(EnRd* this) { - f32 frameCount = Animation_GetLastFrame(&D_060113EC); + f32 frameCount = Animation_GetLastFrame(&object_rd_Anim_0113EC); - Animation_Change(&this->skelAnime, &D_060113EC, 0.5f, 0.0f, frameCount, 1, -4.0f); + Animation_Change(&this->skelAnime, &object_rd_Anim_0113EC, 0.5f, 0.0f, frameCount, 1, -4.0f); this->unk_3EF = 3; this->unk_3EC = 1; this->actionFunc = func_808D56E4; @@ -722,7 +708,7 @@ void func_808D56E4(EnRd* this, GlobalContext* globalCtx) { } void func_808D586C(EnRd* this) { - Animation_PlayOnce(&this->skelAnime, &D_06006EEC); + Animation_PlayOnce(&this->skelAnime, &object_rd_Anim_006EEC); this->unk_3D6 = 0; this->unk_3EB = 0; this->unk_3EA = 200; @@ -741,7 +727,7 @@ void func_808D58CC(EnRd* this, GlobalContext* globalCtx) { switch (this->unk_3EB) { case 1: - Animation_PlayLoop(&this->skelAnime, &D_06006678); + Animation_PlayLoop(&this->skelAnime, &object_rd_Anim_006678); this->unk_3EB++; globalCtx->damagePlayer(globalCtx, -8); func_8013ECE0(this->actor.xzDistToPlayer, 255, 1, 12); @@ -757,8 +743,8 @@ void func_808D58CC(EnRd* this, GlobalContext* globalCtx) { player->stateFlags2 &= ~0x80; player->unk_AE8 = 100; } - Animation_Change(&this->skelAnime, &D_06006B08, 0.5f, 0.0f, Animation_GetLastFrame(&D_06006B08), 3, - 0.0f); + Animation_Change(&this->skelAnime, &object_rd_Anim_006B08, 0.5f, 0.0f, + Animation_GetLastFrame(&object_rd_Anim_006B08), 3, 0.0f); this->unk_3EB++; this->unk_3EF = 4; break; @@ -818,7 +804,8 @@ void func_808D58CC(EnRd* this, GlobalContext* globalCtx) { } void func_808D5C54(EnRd* this) { - Animation_Change(&this->skelAnime, &D_060073A4, 0.0f, 0.0f, Animation_GetLastFrame(&D_060073A4), 2, 0.0f); + Animation_Change(&this->skelAnime, &object_rd_Anim_0073A4, 0.0f, 0.0f, + Animation_GetLastFrame(&object_rd_Anim_0073A4), 2, 0.0f); this->unk_3EF = 7; this->actionFunc = func_808D5CCC; } @@ -840,7 +827,7 @@ void func_808D5CCC(EnRd* this, GlobalContext* globalCtx) { void func_808D5D88(EnRd* this) { this->unk_3EF = 8; - Animation_MorphToPlayOnce(&this->skelAnime, &D_06009900, -6.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &object_rd_Anim_009900, -6.0f); this->actor.speedXZ = -2.0f; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_DAMAGE); this->unk_3EF = 8; @@ -862,9 +849,9 @@ void func_808D5DF4(EnRd* this, GlobalContext* globalCtx) { } void func_808D5E98(EnRd* this) { - f32 frameCount = Animation_GetLastFrame(&D_060113EC); + f32 frameCount = Animation_GetLastFrame(&object_rd_Anim_0113EC); - Animation_Change(&this->skelAnime, &D_060113EC, 0.5f, 0.0f, frameCount, 1, -4.0f); + Animation_Change(&this->skelAnime, &object_rd_Anim_0113EC, 0.5f, 0.0f, frameCount, 1, -4.0f); this->unk_3EF = 9; this->unk_3D4 = 0; this->actionFunc = func_808D5F18; @@ -884,7 +871,7 @@ void func_808D5F18(EnRd* this, GlobalContext* globalCtx) { } void func_808D6008(EnRd* this) { - Animation_MorphToPlayOnce(&this->skelAnime, &D_0600A450, -4.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &object_rd_Anim_00A450, -4.0f); this->unk_3EF = 5; this->actionFunc = func_808D6054; } @@ -900,7 +887,8 @@ void func_808D6054(EnRd* this, GlobalContext* globalCtx) { } void func_808D60B0(EnRd* this) { - Animation_Change(&this->skelAnime, &D_0600A450, -1.0f, Animation_GetLastFrame(&D_0600A450), 0.0f, 2, -4.0f); + Animation_Change(&this->skelAnime, &object_rd_Anim_00A450, -1.0f, Animation_GetLastFrame(&object_rd_Anim_00A450), + 0.0f, 2, -4.0f); this->unk_3EF = 6; this->actionFunc = func_808D6130; } @@ -913,7 +901,7 @@ void func_808D6130(EnRd* this, GlobalContext* globalCtx) { void func_808D616C(EnRd* this) { this->actor.shape.yOffset = 0.0f; - Animation_MorphToPlayOnce(&this->skelAnime, &D_06009900, -6.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &object_rd_Anim_009900, -6.0f); if (this->actor.bgCheckFlags & 1) { this->actor.speedXZ = -2.0f; } @@ -949,7 +937,7 @@ void func_808D6200(EnRd* this, GlobalContext* globalCtx) { } void func_808D6310(EnRd* this) { - Animation_MorphToPlayOnce(&this->skelAnime, &D_06009298, -1.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &object_rd_Anim_009298, -1.0f); this->unk_3EF = 12; this->unk_3D6 = 300; this->actor.flags &= ~1; diff --git a/src/overlays/actors/ovl_En_Recepgirl/z_en_recepgirl.c b/src/overlays/actors/ovl_En_Recepgirl/z_en_recepgirl.c index d5742150c..7f8d65511 100644 --- a/src/overlays/actors/ovl_En_Recepgirl/z_en_recepgirl.c +++ b/src/overlays/actors/ovl_En_Recepgirl/z_en_recepgirl.c @@ -5,6 +5,7 @@ */ #include "z_en_recepgirl.h" +#include "objects/object_bg/object_bg.h" #define FLAGS 0x00000009 @@ -32,11 +33,8 @@ const ActorInit En_Recepgirl_InitVars = { (ActorFunc)EnRecepgirl_Draw, }; -extern TexturePtr D_0600F8F0; -extern TexturePtr D_0600FCF0; -extern TexturePtr D_060100F0; - -static TexturePtr sEyeTextures[] = { &D_0600F8F0, &D_0600FCF0, &D_060100F0, &D_0600FCF0 }; +static TexturePtr sEyeTextures[] = { object_bg_Tex_00F8F0, object_bg_Tex_00FCF0, object_bg_Tex_0100F0, + object_bg_Tex_00FCF0 }; static InitChainEntry sInitChain[] = { ICHAIN_U8(targetMode, 6, ICHAIN_CONTINUE), @@ -45,20 +43,14 @@ static InitChainEntry sInitChain[] = { static s32 texturesDesegmented = false; -extern AnimationHeader D_06000968; -extern AnimationHeader D_06001384; -extern AnimationHeader D_06009890; -extern AnimationHeader D_0600A280; -extern AnimationHeader D_0600AD98; -extern FlexSkeletonHeader D_06011B60; - void EnRecepgirl_Init(Actor* thisx, GlobalContext* globalCtx) { EnRecepgirl* this = THIS; s32 i; Actor_ProcessInitChain(&this->actor, sInitChain); ActorShape_Init(&this->actor.shape, -60.0f, NULL, 0.0f); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06011B60, &D_06009890, this->jointTable, this->morphTable, 24); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_bg_Skel_011B60, &object_bg_Anim_009890, this->jointTable, + this->morphTable, 24); if (!texturesDesegmented) { for (i = 0; i < ARRAY_COUNT(sEyeTextures); i++) { @@ -93,18 +85,18 @@ void EnRecepgirl_UpdateEyes(EnRecepgirl* this) { } void EnRecepgirl_SetupWait(EnRecepgirl* this) { - if (this->skelAnime.animation == &D_06001384) { - Animation_MorphToPlayOnce(&this->skelAnime, &D_0600AD98, 5.0f); + if (this->skelAnime.animation == &object_bg_Anim_001384) { + Animation_MorphToPlayOnce(&this->skelAnime, &object_bg_Anim_00AD98, 5.0f); } this->actionFunc = EnRecepgirl_Wait; } void EnRecepgirl_Wait(EnRecepgirl* this, GlobalContext* globalCtx) { if (SkelAnime_Update(&this->skelAnime) != 0) { - if (this->skelAnime.animation == &D_0600A280) { - Animation_MorphToPlayOnce(&this->skelAnime, &D_0600AD98, 5.0f); + if (this->skelAnime.animation == &object_bg_Anim_00A280) { + Animation_MorphToPlayOnce(&this->skelAnime, &object_bg_Anim_00AD98, 5.0f); } else { - Animation_MorphToLoop(&this->skelAnime, &D_06009890, -4.0f); + Animation_MorphToLoop(&this->skelAnime, &object_bg_Anim_009890, -4.0f); } } @@ -123,7 +115,7 @@ void EnRecepgirl_Wait(EnRecepgirl* this, GlobalContext* globalCtx) { } void EnRecepgirl_SetupTalk(EnRecepgirl* this) { - Animation_MorphToPlayOnce(&this->skelAnime, &D_0600A280, -4.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &object_bg_Anim_00A280, -4.0f); this->actionFunc = EnRecepgirl_Talk; } @@ -131,19 +123,19 @@ void EnRecepgirl_Talk(EnRecepgirl* this, GlobalContext* globalCtx) { u8 temp_v0_2; if (SkelAnime_Update(&this->skelAnime)) { - if (this->skelAnime.animation == &D_0600A280) { - Animation_PlayLoop(&this->skelAnime, &D_06001384); - } else if (this->skelAnime.animation == &D_0600AD98) { + if (this->skelAnime.animation == &object_bg_Anim_00A280) { + Animation_PlayLoop(&this->skelAnime, &object_bg_Anim_001384); + } else if (this->skelAnime.animation == &object_bg_Anim_00AD98) { if (this->actor.textId == 0x2ADA) { // Mayor's office is on the left (meeting ongoing) - Animation_MorphToPlayOnce(&this->skelAnime, &D_06000968, 10.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &object_bg_Anim_000968, 10.0f); } else { - Animation_MorphToLoop(&this->skelAnime, &D_06009890, 10.0f); + Animation_MorphToLoop(&this->skelAnime, &object_bg_Anim_009890, 10.0f); } } else { if (this->actor.textId == 0x2ADA) { // Mayor's office is on the left (meeting ongoing) - Animation_MorphToLoop(&this->skelAnime, &D_06009890, 10.0f); + Animation_MorphToLoop(&this->skelAnime, &object_bg_Anim_009890, 10.0f); } else { - Animation_MorphToPlayOnce(&this->skelAnime, &D_0600A280, -4.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &object_bg_Anim_00A280, -4.0f); } } } @@ -155,7 +147,7 @@ void EnRecepgirl_Talk(EnRecepgirl* this, GlobalContext* globalCtx) { } else if ((temp_v0_2 == 5) && (func_80147624(globalCtx) != 0)) { if (this->actor.textId == 0x2AD9) { // "Welcome..." Flags_SetSwitch(globalCtx, this->actor.params); - Animation_MorphToPlayOnce(&this->skelAnime, &D_0600AD98, 10.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &object_bg_Anim_00AD98, 10.0f); if (gSaveContext.save.weekEventReg[63] & 0x80) { // showed Couple's Mask to meeting this->actor.textId = 0x2ADF; // Mayor's office is on the left (meeting ended) @@ -163,10 +155,10 @@ void EnRecepgirl_Talk(EnRecepgirl* this, GlobalContext* globalCtx) { this->actor.textId = 0x2ADA; // Mayor's office is on the left (meeting ongoing) } } else if (this->actor.textId == 0x2ADC) { // hear directions again? - Animation_MorphToPlayOnce(&this->skelAnime, &D_0600AD98, 10.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &object_bg_Anim_00AD98, 10.0f); this->actor.textId = 0x2ADD; // "So..." } else { - Animation_MorphToPlayOnce(&this->skelAnime, &D_06000968, 10.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &object_bg_Anim_000968, 10.0f); if (this->actor.textId == 0x2ADD) { // "So..." this->actor.textId = 0x2ADE; // Mayor's office is on the left, drawing room on the right diff --git a/src/overlays/actors/ovl_En_Rg/z_en_rg.c b/src/overlays/actors/ovl_En_Rg/z_en_rg.c index 00f96e291..e5643efd3 100644 --- a/src/overlays/actors/ovl_En_Rg/z_en_rg.c +++ b/src/overlays/actors/ovl_En_Rg/z_en_rg.c @@ -5,8 +5,10 @@ */ #include "z_en_rg.h" +#include "objects/gameplay_keep/gameplay_keep.h" +#include "objects/object_oF1d_map/object_oF1d_map.h" -#define FLAGS 0x80000010 +#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_80000000) #define THIS ((EnRg*)thisx) @@ -18,7 +20,8 @@ void EnRg_Draw(Actor* thisx, GlobalContext* globalCtx); void func_80BF4EBC(EnRg* this, GlobalContext* globalCtx); void func_80BF4FC4(EnRg* this, GlobalContext* globalCtx); -#if 0 +s32 D_80BF5C10; + const ActorInit En_Rg_InitVars = { ACTOR_EN_RG, ACTORCAT_NPC, @@ -31,25 +34,49 @@ const ActorInit En_Rg_InitVars = { (ActorFunc)EnRg_Draw, }; -// static ColliderSphereInit sSphereInit = { -static ColliderSphereInit D_80BF5760 = { - { COLTYPE_METAL, AT_ON | AT_TYPE_PLAYER | AT_TYPE_ENEMY, AC_ON | AC_HARD | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_SPHERE, }, - { ELEMTYPE_UNK0, { 0xF7CFFFFF, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_ON | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, }, +static ColliderSphereInit sSphereInit = { + { + COLTYPE_METAL, + AT_ON | AT_TYPE_PLAYER | AT_TYPE_ENEMY, + AC_ON | AC_HARD | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_SPHERE, + }, + { + ELEMTYPE_UNK0, + { 0xF7CFFFFF, 0x00, 0x00 }, + { 0xF7CFFFFF, 0x00, 0x00 }, + TOUCH_ON | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 0, { { 0, 0, 0 }, 20 }, 100 }, }; -// static ColliderCylinderInit sCylinderInit = { -static ColliderCylinderInit D_80BF578C = { - { COLTYPE_HIT1, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_CYLINDER, }, - { ELEMTYPE_UNK1, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_NONE, OCELEM_ON, }, +static ColliderCylinderInit sCylinderInit = { + { + COLTYPE_HIT1, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK1, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, { 20, 62, 0, { 0, 0, 0 } }, }; -// sColChkInfoInit -static CollisionCheckInfoInit2 D_80BF57B8 = { 0, 0, 0, 0, MASS_IMMOVABLE }; +static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; -// static DamageTable sDamageTable = { -static DamageTable D_80BF57C4 = { +static DamageTable sDamageTable = { /* Deku Nut */ DMG_ENTRY(1, 0x0), /* Deku Stick */ DMG_ENTRY(1, 0x0), /* Horse trample */ DMG_ENTRY(1, 0x0), @@ -84,75 +111,767 @@ static DamageTable D_80BF57C4 = { /* Powder Keg */ DMG_ENTRY(1, 0x0), }; +s32 D_80BF57E4[][4] = { + { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 1, 1, 1, 1 }, + { 11, 11, 8, 10 }, { 16, 12, 12, 14 }, { 19, 15, 15, 18 }, { 25, 17, 18, 22 }, { 29, 20, 23, 28 }, + { 39, 24, 28, 33 }, { 43, 27, 33, 37 }, { 46, 28, 36, 37 }, { 51, 30, 38, 39 }, { 54, 33, 42, 40 }, + { 56, 34, 44, 41 }, { 60, 38, 50, 45 }, { 67, 42, 55, 49 }, { 74, 47, 61, 54 }, +}; + +ActorAnimationEntryS D_80BF5914[] = { + { &object_oF1d_map_Anim_012DE0, 2.0f, 0, -1, 2, 0 }, + { &object_oF1d_map_Anim_012DE0, -2.0f, 0, -1, 2, 0 }, +}; + +TexturePtr D_80BF5934[] = { + gDust8Tex, gDust7Tex, gDust6Tex, gDust5Tex, gDust4Tex, gDust3Tex, gDust2Tex, gDust1Tex, +}; + +Color_RGBA8 D_80BF5954[] = { + { 255, 255, 255, 0 }, + { 170, 130, 90, 0 }, + { 0, 0, 0, 0 }, +}; + +Color_RGBA8 D_80BF5960[] = { + { 255, 255, 255, 0 }, + { 100, 60, 20, 0 }, + { 0, 0, 0, 0 }, +}; + +Vec3f D_80BF596C[] = { + { -2473.0f, 39.0f, 7318.0f }, { -2223.0f, 142.0f, 7184.0f }, { -2281.0f, 41.0f, 7718.0f }, + { -2136.0f, 96.0f, 7840.0f }, { -2432.0f, 6.0f, 7857.0f }, { -2412.0f, 139.0f, 6872.0f }, + { -2719.0f, 39.0f, 7110.0f }, { -2289.0f, 67.0f, 7463.0f }, { -2820.0f, 85.0f, 6605.0f }, + { -2088.0f, 160.0f, 7584.0f }, { -2503.0f, 1.0f, 7643.0f }, +}; + +EffectTireMarkInit D_80BF59F0 = { + 0, + 62, + { 0, 0, 15, 100 }, +}; + +TexturePtr D_80BF59F8[] = { + object_oF1d_map_Tex_010438, object_oF1d_map_Tex_010C38, object_oF1d_map_Tex_011038, + object_oF1d_map_Tex_010C38, object_oF1d_map_Tex_010838, +}; + +void func_80BF3920(EnRgStruct* ptr, GlobalContext* globalCtx) { + f32 temp_f20; + u8 phi_fp = false; + s32 i; + s32 idx; + + OPEN_DISPS(globalCtx->state.gfxCtx); + + func_8012C2DC(globalCtx->state.gfxCtx); + + for (i = 0; i < 32; i++, ptr++) { + if ((ptr->unk_00 >= 4) && (ptr->unk_00 < 7)) { + if (!phi_fp) { + POLY_XLU_DISP = Gfx_CallSetupDL(POLY_XLU_DISP, sizeof(Gfx) * 0); + gSPDisplayList(POLY_XLU_DISP++, object_oF1d_map_DL_014CF0); + phi_fp = true; + } + + Matrix_StatePush(); + + if (globalCtx) {} + temp_f20 = (f32)ptr->unk_02 / ptr->unk_01; + + gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, D_80BF5954[ptr->unk_00 - 4].r, D_80BF5954[ptr->unk_00 - 4].g, + D_80BF5954[ptr->unk_00 - 4].b, (u8)(temp_f20 * 255.0f)); + gDPSetEnvColor(POLY_XLU_DISP++, D_80BF5960[ptr->unk_00 - 4].r, D_80BF5960[ptr->unk_00 - 4].g, + D_80BF5960[ptr->unk_00 - 4].b, 0); + + Matrix_InsertTranslation(ptr->unk_10.x, ptr->unk_10.y, ptr->unk_10.z, MTXMODE_NEW); + Matrix_Scale(ptr->unk_34, ptr->unk_34, 1.0f, MTXMODE_APPLY); + Matrix_NormalizeXYZ(&globalCtx->billboardMtxF); + + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), + G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + idx = temp_f20 * 7.0f; + gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(D_80BF5934[idx])); + gSPDisplayList(POLY_XLU_DISP++, object_oF1d_map_DL_014D00); + + Matrix_StatePop(); + } + } + + CLOSE_DISPS(globalCtx->state.gfxCtx); +} + +void func_80BF3C64(EnRg* this) { + EnRgStruct* ptr = this->unk_34C; + s32 i; + + for (i = 0; i < ARRAY_COUNT(this->unk_34C); i++, ptr++) { + if (ptr->unk_00) { + if (!ptr->unk_02) { + ptr->unk_00 = 0; + } else { + ptr->unk_10.x += ptr->unk_28.x; + ptr->unk_10.y += ptr->unk_28.y; + ptr->unk_10.z += ptr->unk_28.z; + ptr->unk_28.x += ptr->unk_1C.x; + ptr->unk_28.y += ptr->unk_1C.y; + ptr->unk_28.z += ptr->unk_1C.z; + ptr->unk_34 += ptr->unk_38; + ptr->unk_02--; + } + } + } +} + +void func_80BF3DA0(EnRg* this, GlobalContext* globalCtx) { + func_80BF3920(this->unk_34C, globalCtx); +} + +void func_80BF3DC4(EnRg* this, GlobalContext* globalCtx) { + this->collider2.dim.worldSphere.center.x = this->actor.world.pos.x; + this->collider2.dim.worldSphere.center.y = this->actor.world.pos.y + this->actor.shape.yOffset; + this->collider2.dim.worldSphere.center.z = this->actor.world.pos.z; + + if (this->actor.speedXZ >= 10.0f) { + CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider2.base); + } + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider2.base); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider2.base); +} + +void func_80BF3E88(EnRg* this, GlobalContext* globalCtx) { + Math_Vec3f_ToVec3s(&this->collider1.dim.pos, &this->actor.world.pos); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider1.base); +} + +void func_80BF3ED4(EnRg* this, GlobalContext* globalCtx) { + if (this->unk_310 & 0x10) { + func_80BF3DC4(this, globalCtx); + } else { + func_80BF3E88(this, globalCtx); + } +} + +s32 func_80BF3F14(EnRg* this, GlobalContext* globalCtx) { + this->unk_310 &= ~0x20; + this->unk_310 &= ~0x40; + this->unk_310 &= ~0x80; + + if ((this->collider1.base.atFlags & AT_HIT) || (this->collider2.base.atFlags & AT_HIT)) { + this->collider1.base.atFlags &= ~AT_HIT; + this->collider2.base.atFlags &= ~AT_HIT; + this->unk_310 |= 0x20; + } + + if ((this->collider1.base.acFlags & AC_HIT) || (this->collider2.base.acFlags & AC_HIT)) { + this->collider1.base.acFlags &= ~AC_HIT; + this->collider2.base.acFlags &= ~AC_HIT; + this->unk_310 |= 0x40; + } + + if ((this->collider1.base.ocFlags1 & OC1_HIT) || (this->collider2.base.ocFlags1 & OC1_HIT)) { + this->collider1.base.ocFlags1 &= ~OC1_HIT; + this->collider2.base.ocFlags1 &= ~OC1_HIT; + this->unk_310 |= 0x80; + } + + return false; +} + +void func_80BF3FF8(EnRg* this) { + this->skelAnime.playSpeed = this->unk_314; + SkelAnime_Update(&this->skelAnime); +} + +s32 func_80BF4024(EnRg* this, GlobalContext* globalCtx) { + if ((globalCtx->csCtx.state == 0) && (this->unk_334 == 1)) { + if (Animation_OnFrame(&this->skelAnime, 2.0f)) { + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_CIRCLE); + } + + if (Animation_OnFrame(&this->skelAnime, 22.0f)) { + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_SIT_IMT); + } + } + + return false; +} + +s32 func_80BF409C(EnRg* this, s32 arg1) { + s32 ret = false; + + if (arg1 != this->unk_334) { + this->unk_334 = arg1; + ret = func_8013BC6C(&this->skelAnime, D_80BF5914, arg1); + this->unk_314 = this->skelAnime.playSpeed; + } + return ret; +} + +void func_80BF40F4(EnRg* this) { + if (DECR(this->unk_31C) == 0) { + this->unk_31E++; + if (this->unk_31E >= 4) { + this->unk_31C = Rand_S16Offset(30, 30); + this->unk_31E = 0; + } + } +} + +s32 func_80BF416C(EnRg* this, GlobalContext* globalCtx) { + if ((this->actor.bgCheckFlags & 1) && (this->actor.speedXZ >= 0.01f)) { + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_ROLLING - SFX_FLAG); + func_800AE930(&globalCtx->colCtx, Effect_GetByIndex(this->unk_340), &this->actor.world.pos, 18.0f, + this->actor.shape.rot.y, this->actor.floorPoly, this->actor.floorBgId); + } else { + func_800AEF44(Effect_GetByIndex(this->unk_340)); + } + return false; +} + +s32 func_80BF4220(EnRg* this, GlobalContext* globalCtx, Actor* arg2) { + CollisionPoly* sp44 = NULL; + s32 sp40; + Vec3f sp34; + + if (Actor_ActorAIsFacingAndNearActorB(&this->actor, arg2, 400.0f, 0x2000) && + !BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->actor.world.pos, &arg2->world.pos, &sp34, &sp44, true, + false, false, true, &sp40)) { + return true; + } + return false; +} + +s32 func_80BF42BC(EnRg* this, f32 arg1) { + f32 sp2C; + s32 sp24; + + Math_ApproachF(&this->actor.speedXZ, arg1, 0.3f, 0.5f); + + sp2C = this->actor.speedXZ * (1.0f / 26); + if (sp2C > 1.0f) { + sp2C = 1.0f; + } + sp24 = 5460.0f * sp2C; + + this->actor.scale.x = 0.01f - (Math_SinS(sp24) * 0.01f); + this->actor.scale.y = (Math_SinS(sp24) * 0.01f) + 0.01f; + this->actor.scale.z = (Math_SinS(sp24) * 0.01f) + 0.01f; + + this->actor.shape.yOffset = this->actor.scale.y * 100.0f * 14.0f; + if (!(this->unk_310 & 0x1000)) { + this->actor.shape.rot.x += (s16)(13650.0f * sp2C); + } + + this->actor.world.rot.x = this->actor.shape.rot.x; + return false; +} + +#ifdef NON_MATCHING +s32 func_80BF43FC(EnRg* this) { + Vec3f sp9C; + Vec3f sp90; + f32 sp8C; + f32 sp88; + f32 sp84; + f32 phi_f20 = 0.0f; + s32 temp_s7 = ENRG_GET_7F80(&this->actor); + s32 phi_s4 = -1; + s16 phi_s6 = 0; + s32 temp_s5 = this->unk_344; + s32 phi_s0 = D_80BF57E4[this->unk_344][temp_s7]; + + while (true) { + func_8013C8B8(this->path, phi_s0 - 1, &sp9C); + func_8013C8B8(this->path, phi_s0 + 1, &sp90); + if (Math3D_PointDistToLine2D(this->actor.world.pos.x, this->actor.world.pos.z, sp9C.x, sp9C.z, sp90.x, sp90.z, + &sp8C, &sp88, &sp84) && + (!phi_s6 || ((phi_s4 + 1) == phi_s0) || (sp84 < phi_f20))) { + phi_s6 = 1; + phi_f20 = sp84; + phi_s4 = phi_s0; + } + phi_s0++; + if ((temp_s5 == 18) || (phi_s0 >= D_80BF57E4[temp_s5 + 1][temp_s7])) { + break; + } + } + + return phi_s4; +} +#else +#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF43FC.s") #endif -extern ColliderSphereInit D_80BF5760; -extern ColliderCylinderInit D_80BF578C; -extern CollisionCheckInfoInit2 D_80BF57B8; -extern DamageTable D_80BF57C4; +s32 func_80BF4560(EnRg* this, GlobalContext* globalCtx) { + s32 temp_v0 = SurfaceType_GetSceneExitIndex(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId); -extern UNK_TYPE D_060091A8; -extern UNK_TYPE D_06011AC8; -extern UNK_TYPE D_06014D00; + if ((temp_v0 < 4) || (temp_v0 >= 19)) { + temp_v0 = -1; + } + return temp_v0; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF3920.s") +s32 func_80BF45B4(EnRg* this) { + s32 sp24 = 0; + s32 ret = false; + s16 temp_v0; + s16 temp_v1; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF3C64.s") + if ((this->actor.bgCheckFlags & 8) && (this->actor.speedXZ >= 5.0f)) { + temp_v1 = this->actor.world.rot.y; + temp_v0 = temp_v1 - BINANG_ROT180(this->actor.wallYaw); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF3DA0.s") + if (ABS_ALT(temp_v0) >= 0x3400) { + this->actor.world.rot.y = BINANG_ROT180(BINANG_ROT180(this->actor.wallYaw) - temp_v0); + this->unk_322 = 0xA; + } else if (ABS_ALT(temp_v0) >= 0x1000) { + this->actor.world.rot.y = BINANG_ROT180(BINANG_ROT180(this->actor.wallYaw) - temp_v0); + this->actor.speedXZ *= 0.75f; + this->unk_322 = 0xA; + } else { + this->actor.world.rot.y = BINANG_ROT180(temp_v1); + ret = 1; + this->actor.speedXZ *= 0.25f; + } + sp24 = 1; + } else if (this->unk_310 & 0x40) { + s16 yaw = Actor_YawBetweenActors(&this->actor, ((void)0, this->collider2.base.ac)); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF3DC4.s") + sp24 = 2; + if (this->actor.colorFilterTimer == 0) { + this->actor.speedXZ *= 0.5f; + if ((s16)(yaw - this->actor.world.rot.y) > 0) { + this->actor.world.rot.y -= 0x2000; + } else { + this->actor.world.rot.y += 0x2000; + } + } + Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 40); + this->unk_322 = 0xA; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF3E88.s") + if (sp24) { + this->unk_310 &= ~0x800; + this->unk_310 &= ~0x40; + if ((this->unk_18C != NULL) && (this->unk_18C->id == ACTOR_PLAYER)) { + D_80BF5C10 = 0; + } + this->unk_18C = NULL; + this->unk_324 = 0; + } + return ret; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF3ED4.s") +s32 func_80BF47AC(EnRg* this, GlobalContext* globalCtx) { + Player* player = GET_PLAYER(globalCtx); + f32 phi_f0; + f32 phi_f2; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF3F14.s") + if (player->linearVelocity < 20.0f) { + phi_f2 = 20.0f; + } else { + phi_f2 = player->linearVelocity; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF3FF8.s") + if ((this->unk_310 & 0x400) || (this->unk_310 & 0x1000)) { + phi_f0 = 0.0f; + } else if (this->unk_348 >= 2) { + phi_f0 = phi_f2 * 0.5f; + } else if (this->unk_348 == 1) { + phi_f0 = phi_f2 * 0.75f; + } else if (this->unk_348 == 0) { + s16 temp_v0_3 = this->actor.yawTowardsPlayer - this->actor.world.rot.y; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF4024.s") + if ((ABS_ALT(temp_v0_3) > 0x4000) || (this->unk_326 > 0)) { + phi_f0 = phi_f2 * 0.72f; + } else { + phi_f0 = phi_f2 * 0.94f; + } + } else if (this->unk_348 == -1) { + phi_f0 = phi_f2 * 1.6f; + } else { + phi_f0 = 2.0f * phi_f2; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF409C.s") + if (phi_f0 > 0.0f) { + if (this->unk_320 != 0) { + this->unk_320--; + } + phi_f2 = this->unk_320 * 0.01f; + phi_f0 += phi_f2; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF40F4.s") + func_80BF42BC(this, phi_f0); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF416C.s") + return false; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF4220.s") +void func_80BF4934(EnRg* this) { + if (this->unk_318 == 1) { + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_DASH); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF42BC.s") +void func_80BF4964(EnRg* this) { + Vec3s* sp3C; + Vec3f sp30; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF43FC.s") + if (this->path != NULL) { + sp3C = Lib_SegmentedToVirtual(this->path->points); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF4560.s") + if (func_8013BD40(&this->actor, this->path, this->unk_33C)) { + if ((this->path->count - 1) < (this->unk_33C + 1)) { + this->unk_33C = this->path->count - 1; + } else { + this->unk_33C++; + } + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF45B4.s") + if (this->unk_322 != 0) { + this->unk_322--; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF47AC.s") + if (this->unk_324 != 0) { + this->unk_324--; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF4934.s") + if (this->unk_326 != 0) { + this->unk_326--; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF4964.s") + if (!(this->unk_310 & 0x400) && !(this->unk_310 & 0x1000) && (this->unk_322 == 0) && (this->unk_324 == 0) && + (this->actor.bgCheckFlags & 1)) { + if (this->unk_18C == NULL) { + Math_Vec3s_ToVec3f(&sp30, &sp3C[this->unk_33C]); + } else { + Math_Vec3f_Copy(&sp30, &this->unk_18C->world.pos); + } + Math_ApproachS(&this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &sp30), 10, 0x71C); + } + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF4AB8.s") +void func_80BF4AB8(EnRg* this, GlobalContext* globalCtx) { + Player* player = GET_PLAYER(globalCtx); + Actor* phi_s0; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF4D64.s") + phi_s0 = NULL; + if (!(this->unk_310 & 0x800)) { + if (this->unk_320 == 0) { + do { + phi_s0 = SubS_FindActor(globalCtx, phi_s0, 6, ACTOR_OBJ_TSUBO); + if (phi_s0 != NULL) { + if (func_80BF4220(this, globalCtx, phi_s0) && (phi_s0->update != NULL)) { + this->unk_18C = phi_s0; + this->unk_310 |= 0x800; + break; + } + phi_s0 = phi_s0->next; + } + } while (phi_s0 != NULL); + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF4DA8.s") + if ((phi_s0 == NULL) && (D_80BF5C10 == 0) && (this->unk_326 == 0) && (player->stateFlags3 & 0x80000) && + (player->invincibilityTimer == 0) && func_80BF4220(this, globalCtx, &player->actor)) { + this->unk_18C = &player->actor; + this->unk_310 |= 0x800; + D_80BF5C10 = 1; + } + } else if ((this->unk_18C != NULL) && !func_80BF4220(this, globalCtx, this->unk_18C)) { + if (this->unk_18C->id == ACTOR_PLAYER) { + D_80BF5C10 = 0; + } + this->unk_18C = NULL; + this->unk_310 &= ~0x800; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF4EBC.s") + if (this->unk_310 & 0x20) { + if (this->collider2.base.at != NULL) { + if (this->collider2.base.at->id == ACTOR_OBJ_TSUBO) { + this->collider2.base.at->params |= 0x3F; + this->unk_320 += 0x190; + this->unk_320 = CLAMP_MAX(this->unk_320, 0x190); + } else if (this->collider2.base.at->id == ACTOR_PLAYER) { + this->unk_326 = 0x28; + if (player->stateFlags3 & 0x1000) { + player->linearVelocity *= 0.5f; + player->unk_B08[0] = player->linearVelocity; + player->unk_B08[1] += player->linearVelocity * 0.05f; + if (BINANG_SUB(this->actor.yawTowardsPlayer, player->currentYaw) > 0) { + player->currentYaw += 0x2000; + } else { + player->currentYaw -= 0x2000; + } + player->unk_B8C = 4; + player->invincibilityTimer = 20; + player->actor.home.rot.y = player->actor.world.rot.y; + player->actor.shape.rot.y = player->actor.world.rot.y; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF4FC4.s") + if ((this->unk_18C != NULL) && (this->unk_18C->id == ACTOR_PLAYER)) { + D_80BF5C10 = 0; + } + } + } + this->unk_18C = NULL; + this->unk_310 &= ~0x800; + this->unk_310 &= ~0x20; + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/EnRg_Init.s") +s32 func_80BF4D64(Vec3f* arg0) { + return Math3D_XZBoundCheck(-1261.0f, -901.0f, -1600.0f, -1520.0f, arg0->x, arg0->z); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/EnRg_Destroy.s") +s32 func_80BF4DA8(EnRg* this) { + s32 pad[4]; + s32 ret = false; + f32 temp_f20; + s16 temp_v1; + s32 i; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/EnRg_Update.s") + for (i = 0; i < ARRAY_COUNT(D_80BF596C); i++) { + temp_f20 = Actor_XZDistanceToPoint(&this->actor, &D_80BF596C[i]); + temp_v1 = Actor_YawToPoint(&this->actor, &D_80BF596C[i]) - this->actor.world.rot.y; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF547C.s") + if ((temp_f20 < 100.0f) && (ABS_ALT(temp_v1) < 0xC00)) { + if (temp_v1 > 0) { + this->actor.world.rot.y -= 0x1600; + } else { + this->actor.world.rot.y += 0x1600; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF5588.s") + this->unk_324 = 20; + this->unk_310 &= ~0x800; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/EnRg_Draw.s") + if ((this->unk_18C != NULL) && (this->unk_18C->id == ACTOR_PLAYER)) { + D_80BF5C10 = 0; + } + + this->unk_18C = NULL; + ret = true; + break; + } + } + return ret; +} + +void func_80BF4EBC(EnRg* this, GlobalContext* globalCtx) { + if (this->unk_310 & 0x100) { + if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { + this->unk_310 &= ~0x100; + this->unk_310 |= 0x10; + this->unk_320 = 0; + this->actor.shape.yOffset = 14.0f; + this->actionFunc = func_80BF4FC4; + } + } else if (gSaveContext.save.weekEventReg[12] & 2) { + if (DECR(this->unk_318) == 0) { + func_80BF409C(this, 1); + this->unk_310 &= ~8; + this->unk_310 &= ~0x10; + this->unk_310 |= 0x100; + this->actor.shape.yOffset = 0.0f; + this->unk_318 = Rand_S16Offset(0, 20); + } + } + func_8013D9C8(globalCtx, this->unk_32E, this->unk_328, ARRAY_COUNT(this->unk_328)); +} + +void func_80BF4FC4(EnRg* this, GlobalContext* globalCtx) { + this->unk_344 = func_80BF4560(this, globalCtx); + + if (!func_801690CC(globalCtx)) { + if (this->actor.bgCheckFlags & 2) { + if (this->unk_310 & 0x400) { + this->unk_310 &= ~0x400; + this->actor.speedXZ = 0.0f; + } + + if (this->unk_344 != -1) { + this->unk_33C = func_80BF43FC(this); + if (this->unk_33C >= 0) { + this->unk_33C++; + } + } + } else if ((this->actor.bgCheckFlags & 1) && !(this->unk_310 & 0x1000) && + func_80BF4D64(&this->actor.world.pos)) { + this->unk_310 |= 0x1000; + } + + if ((this->unk_18C != NULL) && (this->unk_18C->update == NULL)) { + this->unk_18C = NULL; + this->unk_310 &= ~0x800; + } + + if (gSaveContext.eventInf[1] & 1) { + if (DECR(this->unk_318) == 0) { + func_80BF47AC(this, globalCtx); + + if ((this->unk_324 == 0) && !func_80BF4DA8(this)) { + func_80BF4AB8(this, globalCtx); + } + + if (func_80BF45B4(this)) { + this->unk_310 |= 0x400; + this->actor.velocity.y = 7.0f; + } + + func_80BF4964(this); + Actor_UpdateVelocityWithGravity(&this->actor); + Actor_UpdatePos(&this->actor); + func_80BF416C(this, globalCtx); + return; + } + } + func_80BF4934(this); + } +} + +void EnRg_Init(Actor* thisx, GlobalContext* globalCtx) { + EnRg* this = THIS; + + if (gSaveContext.save.entranceIndex == 0xD010) { + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_oF1d_map_Skel_011AC8, NULL, this->jointTable, + this->morphTable, 18); + + this->unk_334 = -1; + func_80BF409C(this, 0); + this->skelAnime.curFrame = this->skelAnime.endFrame; + + Collider_InitAndSetSphere(globalCtx, &this->collider2, &this->actor, &sSphereInit); + Collider_InitAndSetCylinder(globalCtx, &this->collider1, &this->actor, &sCylinderInit); + this->collider2.dim.worldSphere.radius = this->collider2.dim.modelSphere.radius; + CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); + + Effect_Add(globalCtx, &this->unk_340, EFFECT_TIRE_MARK, 0, 0, &D_80BF59F0); + + this->path = func_8013BEDC(globalCtx, ENRG_GET_7F80(&this->actor), 255, &this->unk_33C); + if (this->path != NULL) { + this->unk_33C = 1; + } + + this->actor.flags &= ~ACTOR_FLAG_1; + this->unk_310 = 8; + this->actor.gravity = -1.0f; + func_8013AED4(&this->unk_310, 3, 7); + + if (!(gSaveContext.save.weekEventReg[12] & 2)) { + this->unk_318 = Rand_S16Offset(30, 30); + } + + this->unk_31C = 0; + this->unk_31E = 0; + this->actionFunc = func_80BF4EBC; + } else { + Actor_MarkForDeath(&this->actor); + } +} + +void EnRg_Destroy(Actor* thisx, GlobalContext* globalCtx) { + EnRg* this = THIS; + + Collider_DestroyCylinder(globalCtx, &this->collider1); + Collider_DestroySphere(globalCtx, &this->collider2); + Effect_Destroy(globalCtx, this->unk_340); +} + +void EnRg_Update(Actor* thisx, GlobalContext* globalCtx) { + EnRg* this = THIS; + + func_80BF3F14(this, globalCtx); + + this->actionFunc(this, globalCtx); + + this->actor.shape.rot.y = this->actor.world.rot.y; + + if (!(this->unk_310 & 0x10)) { + func_80BF40F4(this); + func_80BF3FF8(this); + func_80BF4024(this, globalCtx); + } + + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 30.0f, 20.0f, 0.0f, 0x1D); + + if (this->actor.floorHeight <= BGCHECK_Y_MIN) { + Math_Vec3f_Copy(&this->actor.world.pos, &this->actor.prevPos); + } + + func_80BF3ED4(this, globalCtx); + + if (!func_801690CC(globalCtx)) { + func_80BF3C64(this); + } +} + +void func_80BF547C(EnRg* this, GlobalContext* globalCtx) { + OPEN_DISPS(globalCtx->state.gfxCtx); + + func_8012C28C(globalCtx->state.gfxCtx); + Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y + this->actor.shape.yOffset, + this->actor.world.pos.z, MTXMODE_NEW); + Matrix_RotateY(this->actor.shape.rot.y, MTXMODE_APPLY); + Matrix_InsertTranslation(0.0f, -this->actor.shape.yOffset, 0.0f, MTXMODE_APPLY); + Matrix_InsertZRotation_s(this->actor.shape.rot.z, MTXMODE_APPLY); + Matrix_InsertTranslation(0.0f, this->actor.shape.yOffset, 0.0f, MTXMODE_APPLY); + Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY); + Matrix_InsertXRotation_s(this->actor.shape.rot.x, MTXMODE_APPLY); + + gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(POLY_OPA_DISP++, object_oF1d_map_DL_0091A8); + + CLOSE_DISPS(globalCtx->state.gfxCtx); +} + +s32 func_80BF5588(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { + EnRg* this = THIS; + s32 phi_v0; + + switch (limbIndex) { + case 10: + phi_v0 = 0; + break; + + case 11: + phi_v0 = 1; + break; + + case 14: + phi_v0 = 2; + break; + + default: + phi_v0 = 9; + break; + } + + if (((this->unk_310 & 8) != 0) && (phi_v0 < 9)) { + rot->y += (s16)(Math_SinS(this->unk_32E[phi_v0]) * 200.0f); + rot->z += (s16)(Math_CosS(this->unk_328[phi_v0]) * 200.0f); + } + + return false; +} + +void EnRg_Draw(Actor* thisx, GlobalContext* globalCtx) { + EnRg* this = THIS; + + if (!(this->unk_310 & 0x10)) { + OPEN_DISPS(globalCtx->state.gfxCtx); + + func_8012C28C(globalCtx->state.gfxCtx); + + gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(D_80BF59F8[this->unk_31E])); + + SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, + this->skelAnime.dListCount, func_80BF5588, NULL, &this->actor); + + CLOSE_DISPS(globalCtx->state.gfxCtx); + } else { + func_80BF547C(this, globalCtx); + } + func_80BF3DA0(this, globalCtx); +} diff --git a/src/overlays/actors/ovl_En_Rg/z_en_rg.h b/src/overlays/actors/ovl_En_Rg/z_en_rg.h index 2a34ecf8e..87f712fe8 100644 --- a/src/overlays/actors/ovl_En_Rg/z_en_rg.h +++ b/src/overlays/actors/ovl_En_Rg/z_en_rg.h @@ -7,11 +7,49 @@ struct EnRg; typedef void (*EnRgActionFunc)(struct EnRg*, GlobalContext*); +#define ENRG_GET_7F80(thisx) ((((thisx)->params & 0x7F80) >> 7) & 0xFF) + +typedef struct { + /* 0x00 */ u8 unk_00; + /* 0x01 */ u8 unk_01; + /* 0x02 */ u8 unk_02; + /* 0x03 */ UNK_TYPE1 unk_03[0xD]; + /* 0x10 */ Vec3f unk_10; + /* 0x1C */ Vec3f unk_1C; + /* 0x28 */ Vec3f unk_28; + /* 0x34 */ f32 unk_34; + /* 0x38 */ f32 unk_38; +} EnRgStruct; // size = 0x3C + typedef struct EnRg { /* 0x0000 */ Actor actor; - /* 0x0144 */ char unk_144[0x44]; + /* 0x0144 */ SkelAnime skelAnime; /* 0x0188 */ EnRgActionFunc actionFunc; - /* 0x018C */ char unk_18C[0x940]; + /* 0x018C */ Actor* unk_18C; + /* 0x0190 */ ColliderCylinder collider1; + /* 0x01DC */ ColliderSphere collider2; + /* 0x0234 */ Path* path; + /* 0x0238 */ Vec3s jointTable[18]; + /* 0x02A4 */ Vec3s morphTable[18]; + /* 0x0310 */ u16 unk_310; + /* 0x0314 */ f32 unk_314; + /* 0x0318 */ s16 unk_318; + /* 0x031A */ UNK_TYPE1 unk31A[2]; + /* 0x031C */ s16 unk_31C; + /* 0x031E */ s16 unk_31E; + /* 0x0320 */ s16 unk_320; + /* 0x0322 */ s16 unk_322; + /* 0x0324 */ s16 unk_324; + /* 0x0326 */ s16 unk_326; + /* 0x0328 */ s16 unk_328[3]; + /* 0x032E */ s16 unk_32E[3]; + /* 0x0334 */ s32 unk_334; + /* 0x0338 */ UNK_TYPE1 unk338[4]; + /* 0x033C */ s32 unk_33C; + /* 0x0340 */ s32 unk_340; + /* 0x0344 */ s32 unk_344; + /* 0x0348 */ s32 unk_348; + /* 0x034C */ EnRgStruct unk_34C[32]; } EnRg; // size = 0xACC extern const ActorInit En_Rg_InitVars; diff --git a/src/overlays/actors/ovl_En_Rr/z_en_rr.c b/src/overlays/actors/ovl_En_Rr/z_en_rr.c index e39df03f3..058442b90 100644 --- a/src/overlays/actors/ovl_En_Rr/z_en_rr.c +++ b/src/overlays/actors/ovl_En_Rr/z_en_rr.c @@ -5,6 +5,7 @@ */ #include "z_en_rr.h" +#include "objects/object_rr/object_rr.h" #define FLAGS 0x00000405 @@ -26,8 +27,6 @@ void func_808FB710(EnRr* this, GlobalContext* globalCtx); void func_808FAD1C(EnRr* this, GlobalContext* globalCtx); void func_808FB398(EnRr* this, GlobalContext* globalCtx); -extern Gfx D_06000470[]; - const ActorInit En_Rr_InitVars = { ACTOR_EN_RR, ACTORCAT_ENEMY, @@ -931,7 +930,7 @@ void EnRr_Draw(Actor* thisx, GlobalContext* globalCtx2) { this->collider2.dim.pos.y = ((this->unk_228.y - spA4.y) * 0.85f) + spA4.y; this->collider2.dim.pos.z = ((this->unk_228.z - spA4.z) * 0.85f) + spA4.z; - gSPDisplayList(POLY_OPA_DISP++, D_06000470); + gSPDisplayList(POLY_OPA_DISP++, object_rr_DL_000470); func_800BE680(globalCtx, &this->actor, this->unk_234, ARRAY_COUNT(this->unk_234), this->actor.scale.y * 66.66667f * this->unk_220, this->unk_224, this->unk_21C, this->unk_1E0); diff --git a/src/overlays/actors/ovl_En_Rsn/z_en_rsn.c b/src/overlays/actors/ovl_En_Rsn/z_en_rsn.c index 32b199da1..cd7bcf6fa 100644 --- a/src/overlays/actors/ovl_En_Rsn/z_en_rsn.c +++ b/src/overlays/actors/ovl_En_Rsn/z_en_rsn.c @@ -5,6 +5,7 @@ */ #include "z_en_rsn.h" +#include "objects/object_rs/object_rs.h" #define FLAGS 0x02000019 @@ -29,12 +30,7 @@ const ActorInit En_Rsn_InitVars = { (ActorFunc)EnRsn_Draw, }; -extern FlexSkeletonHeader D_06009220; -extern AnimationHeader D_06009120; -extern AnimationHeader D_0600788C; -extern Gfx D_06005458[]; - -static ActorAnimationEntry animations[] = { { &D_0600788C, 1.0f, 0.0f, 0.0f, 0x00, 0.0f } }; +static ActorAnimationEntry animations[] = { { &object_rs_Anim_00788C, 1.0f, 0.0f, 0.0f, 0, 0.0f } }; void func_80C25D40(EnRsn* this) { Actor_ChangeAnimation(&this->skelAnime, animations, 0); @@ -48,7 +44,7 @@ void EnRsn_Init(Actor* thisx, GlobalContext* globalCtx) { EnRsn* this = THIS; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06009220, &D_06009120, NULL, NULL, 0); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_rs_Skel_009220, &object_rs_Anim_009120, NULL, NULL, 0); this->actor.flags &= ~1; func_80C25D40(this); } @@ -93,7 +89,7 @@ void EnRsn_Draw(Actor* thisx, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx); func_8012C5B0(globalCtx->state.gfxCtx); - gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(D_06005458)); + gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(object_rs_Tex_005458)); SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, EnRsn_OverrideLimbDraw, EnRsn_PostLimbDraw, &this->actor); CLOSE_DISPS(globalCtx->state.gfxCtx); diff --git a/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c b/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c index a11b482ec..034004cc3 100644 --- a/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c +++ b/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c @@ -623,8 +623,8 @@ void EnRuppecrow_FallToDespawn(EnRuppecrow* this, GlobalContext* globalCtx) { } void EnRuppecrow_Init(Actor* thisx, GlobalContext* globalCtx2) { - EnRuppecrow* this = THIS; GlobalContext* globalCtx = globalCtx2; + EnRuppecrow* this = THIS; Actor_ProcessInitChain(&this->actor, sInitChain); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_crow_Skel_0010C0, &object_crow_Anim_0000F0, this->joinTable, diff --git a/src/overlays/actors/ovl_En_Sb/z_en_sb.c b/src/overlays/actors/ovl_En_Sb/z_en_sb.c index 59417e2b2..b264a068b 100644 --- a/src/overlays/actors/ovl_En_Sb/z_en_sb.c +++ b/src/overlays/actors/ovl_En_Sb/z_en_sb.c @@ -5,6 +5,7 @@ */ #include "z_en_sb.h" +#include "objects/object_sb/object_sb.h" #define FLAGS 0x00000005 @@ -103,13 +104,6 @@ static Vec3f sFlamePosOffsets[] = { { 0.0f, 0.0f, -5.0f }, }; -extern FlexSkeletonHeader D_06002BF0; -extern AnimationHeader D_06000194; -extern AnimationHeader D_0600004C; -extern AnimationHeader D_06000124; -extern AnimationHeader D_06002C8C; -extern AnimationHeader D_060000B4; - void EnSb_Init(Actor* thisx, GlobalContext* globalCtx) { EnSb* this = THIS; @@ -117,7 +111,8 @@ void EnSb_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.colChkInfo.damageTable = &sDamageTable; this->actor.colChkInfo.mass = 0xA; this->actor.colChkInfo.health = 2; - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06002BF0, &D_06000194, this->jointTable, this->morphTable, 9); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_sb_Skel_002BF0, &object_sb_Anim_000194, this->jointTable, + this->morphTable, 9); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinderType1(globalCtx, &this->collider, &this->actor, &sCylinderInit); this->isDead = false; @@ -149,45 +144,49 @@ void EnSb_SpawnBubbles(GlobalContext* globalCtx, EnSb* this) { } void EnSb_SetupWaitClosed(EnSb* this) { - Animation_Change(&this->skelAnime, &D_0600004C, 1.0f, 0, Animation_GetLastFrame(&D_0600004C), 2, 0.0f); + Animation_Change(&this->skelAnime, &object_sb_Anim_00004C, 1.0f, 0, Animation_GetLastFrame(&object_sb_Anim_00004C), + 2, 0.0f); this->state = SHELLBLADE_WAIT_CLOSED; this->actionFunc = EnSb_Idle; } void EnSb_SetupOpen(EnSb* this) { - Animation_Change(&this->skelAnime, &D_06000194, 1.0f, 0, Animation_GetLastFrame(&D_06000194), 2, 0.0f); + Animation_Change(&this->skelAnime, &object_sb_Anim_000194, 1.0f, 0, Animation_GetLastFrame(&object_sb_Anim_000194), + 2, 0.0f); this->state = SHELLBLADE_OPEN; this->actionFunc = EnSb_Open; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KUSAMUSHI_VIBE); } void EnSb_SetupWaitOpen(EnSb* this) { - Animation_Change(&this->skelAnime, &D_06002C8C, 1.0f, 0, Animation_GetLastFrame(&D_06002C8C), 0, 0.0f); + Animation_Change(&this->skelAnime, &object_sb_Anim_002C8C, 1.0f, 0, Animation_GetLastFrame(&object_sb_Anim_002C8C), + 0, 0.0f); this->state = SHELLBLADE_WAIT_OPEN; this->actionFunc = EnSb_WaitOpen; } void EnSb_SetupLunge(EnSb* this) { - f32 frameCount = Animation_GetLastFrame(&D_06000124); + f32 frameCount = Animation_GetLastFrame(&object_sb_Anim_000124); f32 playbackSpeed = this->actor.depthInWater > 0.0f ? 1.0f : 0.0f; - Animation_Change(&this->skelAnime, &D_06000124, playbackSpeed, 0.0f, frameCount, 2, 0); + Animation_Change(&this->skelAnime, &object_sb_Anim_000124, playbackSpeed, 0.0f, frameCount, 2, 0); this->state = SHELLBLADE_LUNGE; this->actionFunc = EnSb_Lunge; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KUSAMUSHI_VIBE); } void EnSb_SetupBounce(EnSb* this) { - Animation_Change(&this->skelAnime, &D_060000B4, 1.0f, 0, Animation_GetLastFrame(&D_060000B4), 2, 0.0f); + Animation_Change(&this->skelAnime, &object_sb_Anim_0000B4, 1.0f, 0, Animation_GetLastFrame(&object_sb_Anim_0000B4), + 2, 0.0f); this->state = SHELLBLADE_BOUNCE; this->actionFunc = EnSb_Bounce; } void EnSb_SetupIdle(EnSb* this, s32 changeSpeed) { - f32 frameCount = Animation_GetLastFrame(&D_0600004C); + f32 frameCount = Animation_GetLastFrame(&object_sb_Anim_00004C); if (this->state != SHELLBLADE_WAIT_CLOSED) { - Animation_Change(&this->skelAnime, &D_0600004C, 1.0f, 0, frameCount, 2, 0.0f); + Animation_Change(&this->skelAnime, &object_sb_Anim_00004C, 1.0f, 0, frameCount, 2, 0.0f); } this->state = SHELLBLADE_WAIT_CLOSED; if (changeSpeed) { @@ -217,7 +216,7 @@ void EnSb_Idle(EnSb* this, GlobalContext* globalCtx) { void EnSb_Open(EnSb* this, GlobalContext* globalCtx) { f32 currentFrame = this->skelAnime.curFrame; - if (Animation_GetLastFrame(&D_06000194) <= currentFrame) { + if (Animation_GetLastFrame(&object_sb_Anim_000194) <= currentFrame) { this->vulnerableTimer = 20; EnSb_SetupWaitOpen(this); } else { @@ -281,7 +280,7 @@ void EnSb_Lunge(EnSb* this, GlobalContext* globalCtx) { void EnSb_Bounce(EnSb* this, GlobalContext* globalCtx) { s32 pad; f32 currentFrame = currentFrame = this->skelAnime.curFrame; - f32 frameCount = frameCount = Animation_GetLastFrame(&D_060000B4); + f32 frameCount = frameCount = Animation_GetLastFrame(&object_sb_Anim_0000B4); Math_StepToF(&this->actor.speedXZ, 0.0f, 0.2f); if (currentFrame == frameCount) { diff --git a/src/overlays/actors/ovl_En_Scopecoin/z_en_scopecoin.c b/src/overlays/actors/ovl_En_Scopecoin/z_en_scopecoin.c index e71a241e7..136586072 100644 --- a/src/overlays/actors/ovl_En_Scopecoin/z_en_scopecoin.c +++ b/src/overlays/actors/ovl_En_Scopecoin/z_en_scopecoin.c @@ -5,6 +5,7 @@ */ #include "z_en_scopecoin.h" +#include "objects/gameplay_keep/gameplay_keep.h" #define FLAGS 0x00000030 @@ -83,8 +84,10 @@ void EnScopecoin_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); } -static UNK_PTR D_80BFD280[] = { &D_04061FC0, &D_04061FE0, &D_04062000, &D_04062040, - &D_04062020, &D_04062060, &D_04062000 }; +static TexturePtr D_80BFD280[] = { + gameplay_keep_Tex_061FC0, gameplay_keep_Tex_061FE0, gameplay_keep_Tex_062000, gameplay_keep_Tex_062040, + gameplay_keep_Tex_062020, gameplay_keep_Tex_062060, gameplay_keep_Tex_062000, +}; void EnScopecoin_Draw(Actor* thisx, GlobalContext* globalCtx) { EnScopecoin* this = THIS; @@ -96,7 +99,7 @@ void EnScopecoin_Draw(Actor* thisx, GlobalContext* globalCtx) { gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(D_80BFD280[this->unk148])); - gSPDisplayList(POLY_OPA_DISP++, D_040622C0); + gSPDisplayList(POLY_OPA_DISP++, gameplay_keep_DL_0622C0); CLOSE_DISPS(gfxCtx); } diff --git a/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c b/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c index 9e2a1579d..7e8eea792 100644 --- a/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c +++ b/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c @@ -5,8 +5,10 @@ */ #include "z_en_scopenuts.h" +#include "objects/gameplay_keep/gameplay_keep.h" +#include "objects/object_dnt/object_dnt.h" -#define FLAGS 0x00000039 +#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10 | ACTOR_FLAG_20) #define THIS ((EnScopenuts*)thisx) @@ -15,7 +17,22 @@ void EnScopenuts_Destroy(Actor* thisx, GlobalContext* globalCtx); void EnScopenuts_Update(Actor* thisx, GlobalContext* globalCtx); void EnScopenuts_Draw(Actor* thisx, GlobalContext* globalCtx); -#if 0 +void func_80BCB078(EnScopenuts* this, GlobalContext* globalCtx); +void func_80BCB1C8(EnScopenuts* this, GlobalContext* globalCtx); +void func_80BCB4DC(EnScopenuts* this, GlobalContext* globalCtx); +void func_80BCB52C(EnScopenuts* this, GlobalContext* globalCtx); +void func_80BCB6D0(EnScopenuts* this, GlobalContext* globalCtx); +void func_80BCB90C(EnScopenuts* this, GlobalContext* globalCtx); +void func_80BCB980(EnScopenuts* this, GlobalContext* globalCtx); +void func_80BCBA00(EnScopenuts* this, GlobalContext* globalCtx); +void func_80BCBC60(EnScopenuts* this, GlobalContext* globalCtx); +void func_80BCBD28(EnScopenuts* this, GlobalContext* globalCtx); +void func_80BCBF0C(EnScopenuts* this, GlobalContext* globalCtx); +void func_80BCBFFC(EnScopenuts* this, GlobalContext* globalCtx); +void func_80BCC288(EnScopenuts* this, GlobalContext* globalCtx); +s32 func_80BCC2AC(EnScopenuts* this, Path* path, s32 arg2_); +f32 func_80BCC448(Path* path, s32 arg1, Vec3f* arg2, Vec3s* arg3); + const ActorInit En_Scopenuts_InitVars = { ACTOR_EN_SCOPENUTS, ACTORCAT_NPC, @@ -28,81 +45,775 @@ const ActorInit En_Scopenuts_InitVars = { (ActorFunc)EnScopenuts_Draw, }; -// static ColliderCylinderInitType1 sCylinderInit = { -static ColliderCylinderInitType1 D_80BCCB40 = { - { COLTYPE_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, COLSHAPE_CYLINDER, }, - { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, }, +static ColliderCylinderInitType1 sCylinderInit = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xF7CFFFFF, 0x00, 0x00 }, + TOUCH_NONE | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 27, 32, 0, { 0, 0, 0 } }, }; -// static InitChainEntry sInitChain[] = { -static InitChainEntry D_80BCCCF0[] = { +static ActorAnimationEntryS sAnimations[] = { + { &object_dnt_Anim_005488, 1.0f, 0, -1, 0, 0 }, { &object_dnt_Anim_00B0B4, 1.0f, 0, -1, 0, 0 }, + { &object_dnt_Anim_004AA0, 1.0f, 0, -1, 2, 0 }, { &object_dnt_Anim_004E38, 1.0f, 0, -1, 2, 0 }, + { &object_dnt_Anim_0029E8, 1.0f, 0, -1, 2, 0 }, { &object_dnt_Anim_005CA8, 1.0f, 0, -1, 2, 0 }, + { &object_dnt_Anim_0038CC, 1.0f, 0, -1, 0, 0 }, { &object_dnt_Anim_003CC0, 1.0f, 0, -1, 0, 0 }, + { &object_dnt_Anim_0012F4, 1.0f, 0, -1, 2, 0 }, { &object_dnt_Anim_004700, 1.0f, 0, -1, 2, 0 }, + { &object_dnt_Anim_001BC8, 1.0f, 0, -1, 0, 0 }, { &object_dnt_Anim_003438, 1.0f, 0, -1, 2, 0 }, + { &object_dnt_Anim_001E2C, 1.0f, 0, -1, 0, 0 }, { &object_dnt_Anim_000994, 1.0f, 0, -1, 0, 0 }, + { &object_dnt_Anim_002268, 1.0f, 0, -1, 2, 0 }, { &object_dnt_Anim_002F08, 1.0f, 0, -1, 0, 0 }, + { &object_dnt_Anim_00577C, 1.0f, 0, -1, 0, -4 }, { &object_dnt_Anim_0029E8, 1.0f, 8, -1, 2, 0 }, + { &object_dnt_Anim_0029E8, 1.0f, 4, -1, 2, -4 }, { &object_dnt_Anim_0029E8, 1.0f, 0, -1, 2, 0 }, + { &object_dnt_Anim_001BC8, 1.0f, 0, -1, 0, 0 }, { &object_dnt_Anim_0012F4, -1.0f, 0, -1, 2, 0 }, + { &object_dnt_Anim_002670, 1.0f, 0, -1, 2, 0 }, +}; + +Gfx* D_80BCCCDC[] = { gameplay_keep_DL_0527F0, gameplay_keep_DL_0528B0 }; + +Vec3f D_80BCCCE4 = { 0.0f, -0.5f, 0.0f }; + +static InitChainEntry sInitChain[] = { ICHAIN_U8(targetMode, 0, ICHAIN_CONTINUE), ICHAIN_F32(targetArrowOffset, 30, ICHAIN_STOP), }; -#endif +s16 func_80BCABF0(Path* path) { + Vec3s* sp34 = Lib_SegmentedToVirtual(path->points); + Vec3f sp28; + Vec3f sp1C; -extern ColliderCylinderInit D_80BCCB40; -extern InitChainEntry D_80BCCCF0[]; + Math_Vec3s_ToVec3f(&sp28, &sp34[0]); + Math_Vec3s_ToVec3f(&sp1C, &sp34[1]); + return Math_Vec3f_Yaw(&sp28, &sp1C); +} -extern UNK_TYPE D_06001420; -extern UNK_TYPE D_06005488; +void func_80BCAC40(EnScopenuts* this, GlobalContext* globalCtx) { + s16 i; + Vec3f sp60; + Vec3f sp54; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCABF0.s") + sp60 = this->actor.world.pos; + sp60.y += 100.0f; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCAC40.s") + for (i = 0; i < 36; i++) { + sp54.x = Rand_Centered() * 10.0f; + sp54.y = 2.0f * Rand_Centered(); + sp54.z = Rand_Centered() * 10.0f; + EffectSsHahen_Spawn(globalCtx, &sp60, &sp54, &D_80BCCCE4, 0, 0x96, 1, 0x10, D_80BCCCDC[i & 1]); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCAD64.s") +void func_80BCAD64(EnScopenuts* this, s16 arg1) { + f32 sp24 = Math_CosS(this->actor.world.rot.x) * this->actor.speedXZ; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCAE78.s") + switch (arg1) { + case 1: + this->actor.velocity.y = this->actor.speedXZ; + this->actor.velocity.x = 0.0f; + this->actor.velocity.z = 0.0f; + break; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCAF0C.s") + case 2: + this->actor.velocity.x = Math_SinS(this->actor.world.rot.y) * this->actor.speedXZ; + this->actor.velocity.y = 0.0f; + this->actor.velocity.z = Math_CosS(this->actor.world.rot.y) * this->actor.speedXZ; + break; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCAFA8.s") + case 3: + this->actor.velocity.x = 0.0f; + this->actor.velocity.y = 0.0f; + this->actor.velocity.z = 0.0f; + break; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCB078.s") + default: + this->actor.velocity.x = Math_SinS(this->actor.world.rot.y) * sp24; + this->actor.velocity.y = Math_SinS(this->actor.world.rot.x) * this->actor.speedXZ; + this->actor.velocity.z = Math_CosS(this->actor.world.rot.y) * sp24; + break; + } + Actor_UpdatePos(&this->actor); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCB1C8.s") +void func_80BCAE78(EnScopenuts* this, GlobalContext* globalCtx) { + if (this->unk_328 & 4) { + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCB230.s") + if (this->unk_328 & 2) { + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 20.0f, 5); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCB4DC.s") +s16 func_80BCAF0C(EnScopenuts* this) { + switch (this->unk_33C) { + case 0x0: + if (gSaveContext.save.weekEventReg[53] & 2) { + this->unk_328 |= 1; + return 0x1638; + } + return 0x162F; + case 0x162F: + return 0x1630; + case 0x1630: + return 0x1631; + case 0x1631: + this->unk_358 = 150; + return 0x1632; + case 0x1633: + this->unk_358 = 100; + return 0x1634; + } + return 0; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCB52C.s") +void func_80BCAFA8(EnScopenuts* this, GlobalContext* globalCtx) { + Vec3f sp1C; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCB6D0.s") + func_80169474(globalCtx, &this->actor.world.pos, &sp1C); + if ((sp1C.x >= 130.0f) && (sp1C.x < 190.0f) && (sp1C.y >= 90.0f)) { + if (sp1C.y < 150.0f) { + this->actor.draw = EnScopenuts_Draw; + this->unk_348 = 10; + func_8013BC6C(&this->skelAnime, sAnimations, 10); + this->actionFunc = func_80BCB078; + } + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCB90C.s") +void func_80BCB078(EnScopenuts* this, GlobalContext* globalCtx) { + Vec3s sp30; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCB980.s") + if (this->path != NULL) { + func_80BCC448(this->path, this->unk_334, &this->actor.world.pos, &sp30); + if (this->actor.bgCheckFlags & 8) { + sp30.y = this->actor.wallYaw; + } + Math_SmoothStepToS(&this->actor.world.rot.y, sp30.y, 10, 300, 0); + this->actor.shape.rot.y = this->actor.world.rot.y; + this->unk_33E = 0x1000; + this->unk_340 += 0x1C71; + this->actor.world.rot.x = -sp30.x; + if (func_80BCC2AC(this, this->path, this->unk_334)) { + if (this->unk_334 >= (this->path->count - 1)) { + this->actionFunc = func_80BCB1C8; + this->actor.speedXZ = 0.0f; + this->actor.gravity = -1.0f; + return; + } + this->unk_334++; + } + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCBA00.s") + if (this->unk_334 >= (this->path->count - 2)) { + Math_ApproachF(&this->actor.speedXZ, 1.5f, 0.2f, 1.0f); + } else { + Math_ApproachF(&this->actor.speedXZ, 5.0f, 0.2f, 1.0f); + } + Actor_MoveWithoutGravity(&this->actor); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCBC60.s") +void func_80BCB1C8(EnScopenuts* this, GlobalContext* globalCtx) { + this->unk_350 *= 0.92f; + Actor_SetScale(&this->actor, this->unk_350); + if (this->actor.bgCheckFlags & 1) { + gSaveContext.save.weekEventReg[52] |= 0x40; + Actor_MarkForDeath(&this->actor); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCBD28.s") +void func_80BCB230(EnScopenuts* this, GlobalContext* globalCtx) { + s16 sp26 = this->skelAnime.curFrame; + s16 sp24 = Animation_GetLastFrame(sAnimations[this->unk_348].animationSeg); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCBF0C.s") + Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0xE38); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCBFFC.s") + if ((((this->actor.playerHeightRel < 50.0f) && (this->actor.playerHeightRel > -50.0f)) ? true : false) && + ((this->actor.xzDistToPlayer < 200.0f) ? true : false)) { + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); + this->actionFunc = func_80BCB4DC; + this->unk_348 = 3; + this->collider.dim.height = 64; + func_80BCAC40(this, globalCtx); + func_8013BC6C(&this->skelAnime, sAnimations, 3); + } else if (sp26 == sp24) { + if ((this->unk_348 == 4) || (this->unk_348 == 18)) { + this->unk_348 = 17; + this->collider.dim.height = 0; + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DOWN); + func_8013BC6C(&this->skelAnime, sAnimations, 17); + } else if (this->unk_348 == 2) { + this->unk_348 = 16; + this->collider.dim.height = 32; + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_UP); + func_8013BC6C(&this->skelAnime, sAnimations, 16); + } else if (this->unk_348 == 17) { + if (DECR(this->unk_34E) == 0) { + this->unk_34E = Rand_ZeroOne() * 10.0f; + this->unk_348 = 2; + this->collider.dim.height = 32; + func_8013BC6C(&this->skelAnime, sAnimations, 2); + } + } else if ((this->unk_348 == 16) && (DECR(this->unk_34E) == 0)) { + this->unk_34E = Rand_S16Offset(40, 40); + this->unk_348 = 18; + this->collider.dim.height = 32; + func_8013BC6C(&this->skelAnime, sAnimations, 18); + } + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCC288.s") +void func_80BCB4DC(EnScopenuts* this, GlobalContext* globalCtx) { + if (this->skelAnime.curFrame == this->skelAnime.endFrame) { + this->actionFunc = func_80BCB52C; + func_8013BC6C(&this->skelAnime, sAnimations, 0); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCC2AC.s") +void func_80BCB52C(EnScopenuts* this, GlobalContext* globalCtx) { + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 2000, 0); + this->actor.world.rot.y = this->actor.shape.rot.y; + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { + this->unk_33C = func_80BCAF0C(this); + func_801518B0(globalCtx, this->unk_33C, &this->actor); + this->actionFunc = func_80BCB6D0; + } else if (((this->actor.xzDistToPlayer < 100.0f) && + (((this->actor.playerHeightRel < 50.0f) && (this->actor.playerHeightRel > -50.0f)) ? true : false)) || + this->actor.isTargeted) { + func_800B8614(&this->actor, globalCtx, 100.0f); + } else if (!(((this->actor.playerHeightRel < 50.0f) && (this->actor.playerHeightRel > -50.0f)) ? true : false) || + !((this->actor.xzDistToPlayer < 200.0f) ? true : false)) { + this->unk_348 = 4; + func_8013BC6C(&this->skelAnime, sAnimations, 4); + this->actionFunc = func_80BCB230; + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCC448.s") +void func_80BCB6D0(EnScopenuts* this, GlobalContext* globalCtx) { + u8 temp_v0 = Message_GetState(&globalCtx->msgCtx); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/EnScopenuts_Init.s") + if (temp_v0 == 5) { + if (func_80147624(globalCtx)) { + if (this->unk_328 & 1) { + this->unk_328 &= ~1; + globalCtx->msgCtx.unk11F22 = 0x43; + globalCtx->msgCtx.unk12023 = 4; + this->actor.flags &= ~ACTOR_FLAG_1; + this->unk_328 &= ~4; + this->unk_348 = 8; + func_8013BC6C(&this->skelAnime, sAnimations, 8); + this->actionFunc = func_80BCBA00; + } else { + this->unk_33C = func_80BCAF0C(this); + func_801518B0(globalCtx, this->unk_33C, &this->actor); + } + } + } else if (temp_v0 == 4) { + if (func_80147624(globalCtx) != 0) { + switch (globalCtx->msgCtx.choiceIndex) { + case 0: + if (gSaveContext.save.playerData.rupees < this->unk_358) { + play_sound(NA_SE_SY_ERROR); + this->unk_33C = 0x1636; + this->unk_328 |= 1; + func_801518B0(globalCtx, this->unk_33C, &this->actor); + } else { + func_8019F208(); + globalCtx->msgCtx.unk11F22 = 0x43; + globalCtx->msgCtx.unk12023 = 4; + Rupees_ChangeBy(this->unk_358 * -1); + this->actionFunc = func_80BCB90C; + } + break; + case 1: + func_8019F230(); + if (this->unk_358 == 150) { + this->unk_33C = 0x1633; + } else { + this->unk_33C = 0x1635; + this->unk_328 |= 1; + } + func_801518B0(globalCtx, this->unk_33C, &this->actor); + break; + } + } + } else if (temp_v0 == 6) { + func_800B85E0(&this->actor, globalCtx, 400.0f, -1); + this->actionFunc = func_80BCB980; + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/EnScopenuts_Destroy.s") +void func_80BCB90C(EnScopenuts* this, GlobalContext* globalCtx) { + if (Actor_HasParent(&this->actor, globalCtx)) { + this->actor.parent = NULL; + gSaveContext.save.weekEventReg[53] |= 2; + this->actionFunc = func_80BCB6D0; + } else { + Actor_PickUp(&this->actor, globalCtx, GI_HEART_PIECE, 300.0f, 300.0f); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/EnScopenuts_Update.s") +void func_80BCB980(EnScopenuts* this, GlobalContext* globalCtx) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { + this->unk_33C = 0x1637; + this->unk_328 |= 1; + func_801518B0(globalCtx, this->unk_33C, &this->actor); + this->actionFunc = func_80BCB6D0; + } else { + func_800B85E0(&this->actor, globalCtx, 400.0f, -1); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCC828.s") +void func_80BCBA00(EnScopenuts* this, GlobalContext* globalCtx) { + s16 sp26 = this->skelAnime.curFrame; + s16 sp24 = Animation_GetLastFrame(sAnimations[this->unk_348].animationSeg); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCC9CC.s") + switch (sp26) { + case 10: + this->unk_35A = 1; + this->unk_35C = 0.1f; + this->unk_360 = 0.1f; + this->unk_364 = 0.1f; + break; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCC9E4.s") + case 11: + case 12: + this->unk_35C += 0.15f; + this->unk_360 += 0.32f; + this->unk_364 += 0.15f; + break; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/EnScopenuts_Draw.s") + case 13: + this->unk_35C = 0.55f; + this->unk_360 = 1.05f; + this->unk_364 = 0.55f; + break; + + case 14: + this->unk_35C = 1.0f; + this->unk_360 = 2.0f; + this->unk_364 = 1.0f; + break; + + case 15: + case 16: + this->unk_360 -= 0.33f; + break; + + case 17: + this->unk_360 = 1.0f; + break; + + case 18: + case 19: + this->unk_360 += 0.27f; + break; + + case 20: + this->unk_35A = 2; + this->unk_360 = 1.8f; + break; + + case 21: + case 22: + case 23: + this->unk_360 -= 0.2f; + break; + + case 24: + this->unk_360 = 1.0f; + break; + } + + if (this->unk_36C == 0) { + if (ActorCutscene_GetCanPlayNext(this->unk_338)) { + ActorCutscene_StartAndSetUnkLinkFields(this->unk_338, &this->actor); + this->unk_36C = 1; + } else { + if (ActorCutscene_GetCurrentIndex() == 0x7C) { + ActorCutscene_Stop(0x7C); + } + ActorCutscene_SetIntentToPlay(this->unk_338); + return; + } + } + + if (sp26 == sp24) { + this->unk_35A = 3; + this->unk_348 = 19; + func_8013BC6C(&this->skelAnime, sAnimations, 19); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DOWN); + this->unk_328 &= ~2; + this->unk_34E = 50; + this->unk_328 |= 8; + this->unk_32C = this->actor.world.pos.y; + this->actionFunc = func_80BCBC60; + } +} + +void func_80BCBC60(EnScopenuts* this, GlobalContext* globalCtx) { + f32 sp24; + Vec3f sp18; + + this->unk_340 += this->unk_34C; + sp24 = this->unk_32C - this->actor.world.pos.y; + + if (!(this->unk_370 & 3)) { + sp18.x = this->actor.world.pos.x; + sp18.y = this->unk_32C; + sp18.z = this->actor.world.pos.z; + func_800B14D4(globalCtx, 20.0f, &sp18); + } + + if (sp24 > 5.0f) { + this->actor.velocity.y = 0.0f; + this->actor.gravity = 0.0f; + this->unk_372 = func_80BCABF0(this->path); + this->actionFunc = func_80BCBD28; + } +} + +void func_80BCBD28(EnScopenuts* this, GlobalContext* globalCtx) { + Vec3f sp44; + s16 sp42 = this->skelAnime.curFrame; + s16 sp40 = Animation_GetLastFrame(sAnimations[this->unk_348].animationSeg); + Vec3s sp38; + + func_80BCC448(this->path, this->unk_334, &this->actor.world.pos, &sp38); + if (sp42 == sp40) { + Math_SmoothStepToS(&this->unk_34C, 0x1C71, 3, 0x100, 0); + this->unk_340 += this->unk_34C; + this->actor.shape.yOffset = 1500.0f; + } + + Math_SmoothStepToS(&this->actor.shape.rot.y, this->unk_372, 3, 2000, 0); + this->actor.world.rot.y = this->actor.shape.rot.y; + + if (DECR(this->unk_34E) == 0) { + if (!(this->unk_370 & 3)) { + sp44 = this->actor.world.pos; + func_800B14D4(globalCtx, 20.0f, &sp44); + } + this->actor.velocity.y = 5.0f; + } else if (!(this->unk_370 & 3)) { + sp44.x = this->actor.world.pos.x; + sp44.y = this->unk_32C; + sp44.z = this->actor.world.pos.z; + func_800B14D4(globalCtx, 20.0f, &sp44); + } + + if ((this->actor.home.pos.y + 22.5f) < this->actor.world.pos.y) { + this->unk_368 = 0.3f; + this->unk_348 = 9; + func_8013BC6C(&this->skelAnime, sAnimations, 9); + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); + func_80BCAC40(this, globalCtx); + this->actionFunc = func_80BCBF0C; + } +} + +void func_80BCBF0C(EnScopenuts* this, GlobalContext* globalCtx) { + this->unk_340 += this->unk_34C; + if (this->unk_368 >= 1.0f) { + this->unk_368 = 1.0f; + this->actor.velocity.y = 5.0f; + } else { + this->actor.velocity.y = 5.0f; + this->unk_368 += 0.1f; + } + + if ((this->actor.home.pos.y + 50.0f) < this->actor.world.pos.y) { + Math_ApproachF(&this->actor.velocity.y, 0.0f, 0.2f, 1.0f); + this->unk_348 = 10; + func_8013BC6C(&this->skelAnime, sAnimations, 10); + this->unk_328 |= 2; + this->unk_36E = 0; + this->actionFunc = func_80BCBFFC; + } +} + +void func_80BCBFFC(EnScopenuts* this, GlobalContext* globalCtx) { + Vec3s sp38; + f32 sp34; + s16 sp32 = 0; + + this->actor.velocity.y = 0.0f; + this->actor.gravity = 0.0f; + + if (this->path != NULL) { + sp34 = func_80BCC448(this->path, this->unk_334, &this->actor.world.pos, &sp38); + if (this->actor.bgCheckFlags & 8) { + sp38.y = this->actor.wallYaw; + } + + if (this->unk_334 < 6) { + Math_SmoothStepToS(&this->actor.world.rot.y, sp38.y, 10, 300, 0); + } else { + Math_SmoothStepToS(&this->actor.world.rot.y, sp38.y, 10, 1500, 0); + } + + this->actor.shape.rot.y = this->actor.world.rot.y; + this->unk_33E = 0x1000; + this->unk_340 += this->unk_34C; + this->actor.world.rot.x = -sp38.x; + + if (func_80BCC2AC(this, this->path, this->unk_334)) { + sp32 = 1; + } + + if (sp34 < 10.0f) { + if (sp32 == 1) { + sp32 = 3; + } else { + sp32 = 2; + } + } + + if (sp32 == 3) { + if (this->unk_334 >= (this->path->count - 1)) { + ActorCutscene_Stop(this->unk_338); + gSaveContext.save.weekEventReg[52] &= (u8)~0x40; + this->actionFunc = func_80BCC288; + } else { + this->unk_334++; + } + } + } else if (this->actor.playerHeightRel > 500.0f) { + ActorCutscene_Stop(this->unk_338); + this->actionFunc = func_80BCC288; + } + + Math_ApproachF(&this->actor.speedXZ, 1.0f, 0.2f, 1.0f); + func_80BCAD64(this, sp32); + + if (this->unk_36C == 2) { + if (ActorCutscene_GetCanPlayNext(this->unk_338)) { + ActorCutscene_StartAndSetUnkLinkFields(this->unk_338, &this->actor); + this->unk_36C = 3; + } else { + ActorCutscene_SetIntentToPlay(this->unk_338); + return; + } + } else if ((this->unk_36C == 1) && (this->unk_36E == 20)) { + ActorCutscene_Stop(this->unk_338); + this->unk_338 = ActorCutscene_GetAdditionalCutscene(this->unk_338); + ActorCutscene_SetIntentToPlay(this->unk_338); + this->unk_36C = 2; + } + this->unk_36E++; +} + +void func_80BCC288(EnScopenuts* this, GlobalContext* globalCtx) { + Actor_MarkForDeath(&this->actor); +} + +s32 func_80BCC2AC(EnScopenuts* this, Path* path, s32 arg2_) { + Vec3s* sp5C = Lib_SegmentedToVirtual(path->points); + s32 sp58 = path->count; + s32 arg2 = arg2_; + s32 sp50 = false; + f32 phi_f12; + f32 phi_f14; + f32 sp44; + f32 sp40; + f32 sp3C; + Vec3f sp30; + + Math_Vec3s_ToVec3f(&sp30, &sp5C[arg2]); + + if (arg2 == 0) { + phi_f12 = sp5C[1].x - sp5C[0].x; + phi_f14 = sp5C[1].z - sp5C[0].z; + } else if ((sp58 - 1) == arg2) { + phi_f12 = sp5C[sp58 - 1].x - sp5C[sp58 - 2].x; + phi_f14 = sp5C[sp58 - 1].z - sp5C[sp58 - 2].z; + } else { + phi_f12 = sp5C[arg2 + 1].x - sp5C[arg2 - 1].x; + phi_f14 = sp5C[arg2 + 1].z - sp5C[arg2 - 1].z; + } + + func_8017B7F8(&sp30, RADF_TO_BINANG(func_80086B30(phi_f12, phi_f14)), &sp44, &sp40, &sp3C); + + if (((this->actor.world.pos.x * sp44) + (sp40 * this->actor.world.pos.z) + sp3C) > 0.0f) { + sp50 = true; + } + return sp50; +} + +f32 func_80BCC448(Path* path, s32 arg1, Vec3f* arg2, Vec3s* arg3) { + Vec3s* temp_v1; + Vec3f sp20; + + if (path != NULL) { + temp_v1 = Lib_SegmentedToVirtual(path->points); + temp_v1 = &temp_v1[arg1]; + sp20.x = temp_v1[0].x; + sp20.y = temp_v1[0].y; + sp20.z = temp_v1[0].z; + } + + arg3->y = Math_Vec3f_Yaw(arg2, &sp20); + arg3->x = Math_Vec3f_Pitch(arg2, &sp20); + + return sp20.y - arg2->y; +} + +void EnScopenuts_Init(Actor* thisx, GlobalContext* globalCtx) { + s32 pad; + EnScopenuts* this = THIS; + + if (!(gSaveContext.save.weekEventReg[74] & 0x40) && (gSaveContext.save.inventory.items[ITEM_OCARINA] == ITEM_NONE)) { + Actor_MarkForDeath(&this->actor); + return; + } + + Actor_ProcessInitChain(&this->actor, sInitChain); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_dnt_Skel_00AC70, &object_dnt_Anim_005488, this->jointTable, + this->morphTable, 28); + Collider_InitCylinder(globalCtx, &this->collider); + Collider_SetCylinderType1(globalCtx, &this->collider, &this->actor, &sCylinderInit); + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 35.0f); + this->unk_350 = 0.01f; + Actor_SetScale(&this->actor, 0.01f); + this->actor.colChkInfo.cylRadius = 0; + this->actor.colChkInfo.mass = MASS_IMMOVABLE; + this->unk_328 |= 2; + this->unk_328 |= 4; + this->actor.speedXZ = 0.0f; + + if (ENSCOPENUTS_GET_3E0(&this->actor) == ENSCOPENUTS_3E0_0) { + if (gSaveContext.save.weekEventReg[52] & 0x40) { + Actor_MarkForDeath(&this->actor); + } else if (globalCtx->actorCtx.unk5 & 2) { + this->path = func_8013D648(globalCtx, ENSCOPENUTS_GET_FC00(&this->actor), 0x3F); + this->actor.draw = NULL; + this->actionFunc = func_80BCAFA8; + this->actor.gravity = 0.0f; + } else { + Actor_MarkForDeath(&this->actor); + } + } else if (ENSCOPENUTS_GET_3E0(&this->actor) == ENSCOPENUTS_3E0_1) { + if (gSaveContext.save.weekEventReg[52] & 0x40) { + this->path = func_8013D648(globalCtx, ENSCOPENUTS_GET_FC00(&this->actor), 0x3F); + if (this->path == NULL) { + Actor_MarkForDeath(&this->actor); + } else { + this->actor.gravity = -1.0f; + this->actor.draw = EnScopenuts_Draw; + this->unk_338 = this->actor.cutscene; + this->unk_33C = 0; + this->unk_358 = 150; + this->unk_348 = 4; + this->unk_35A = 0; + func_8013BC6C(&this->skelAnime, sAnimations, 4); + this->actionFunc = func_80BCB230; + } + } else { + Actor_MarkForDeath(&this->actor); + } + } else { + Actor_MarkForDeath(&this->actor); + } +} + +void EnScopenuts_Destroy(Actor* thisx, GlobalContext* globalCtx) { + EnScopenuts* this = THIS; + + Collider_DestroyCylinder(globalCtx, &this->collider); +} + +void EnScopenuts_Update(Actor* thisx, GlobalContext* globalCtx) { + EnScopenuts* this = THIS; + + Actor_SetFocus(&this->actor, 60.0f); + SkelAnime_Update(&this->skelAnime); + Actor_MoveWithGravity(&this->actor); + + this->actionFunc(this, globalCtx); + + if (this->unk_328 & 8) { + func_800B9010(&this->actor, NA_SE_EN_AKINDO_FLY - SFX_FLAG); + } + func_80BCAE78(this, globalCtx); +} + +s32 EnScopenuts_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, + Actor* thisx) { + EnScopenuts* this = THIS; + + if (((this->unk_348 == 4) && (this->unk_35A == 0)) || ((this->unk_348 == 8) && (this->unk_35A == 0)) || + (this->unk_348 == 18) || (this->unk_348 == 2) || (this->unk_348 == 3) || (this->unk_348 == 17) || + (this->unk_348 == 16)) { + if ((limbIndex == 16) || (limbIndex == 21) || (limbIndex == 27) || (limbIndex == 23) || (limbIndex == 24) || + (limbIndex == 15)) { + *dList = NULL; + } + } else if ((this->unk_348 == 8) || (this->unk_348 == 19)) { + switch (this->unk_35A) { + case 1: + if ((limbIndex == 16) || (limbIndex == 21) || (limbIndex == 27) || (limbIndex == 25)) { + *dList = NULL; + } + break; + + case 2: + case 3: + if ((limbIndex == 16) || (limbIndex == 21) || (limbIndex == 27) || (limbIndex == 15) || + (limbIndex == 25)) { + *dList = NULL; + } + break; + } + } else if (((this->unk_348 == 9) || (this->unk_348 == 10)) && ((limbIndex == 15) || (limbIndex == 25))) { + *dList = NULL; + } + + if (limbIndex == 26) { + if ((this->unk_33C == 0x162F) || (this->unk_33C == 0x1630)) { + *dList = object_dnt_DL_001420; + } else { + *dList = object_dnt_DL_008290; + } + } + + return false; +} + +void EnScopenuts_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { +} + +void EnScopenuts_TransformLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) { + EnScopenuts* this = THIS; + + if (((this->unk_35A == 1) || (this->unk_35A == 2)) && ((limbIndex == 23) || (limbIndex == 24))) { + Matrix_Scale(this->unk_35C, this->unk_360, this->unk_364, MTXMODE_APPLY); + } + + if ((this->unk_348 == 9) && ((limbIndex == 16) || (limbIndex == 21) || (limbIndex == 27))) { + Matrix_Scale(this->unk_368, this->unk_368, this->unk_368, MTXMODE_APPLY); + } + + if (limbIndex == 24) { + Matrix_RotateY(this->unk_340, MTXMODE_APPLY); + } +} + +void EnScopenuts_Draw(Actor* thisx, GlobalContext* globalCtx) { + EnScopenuts* this = THIS; + + func_8012C28C(globalCtx->state.gfxCtx); + SkelAnime_DrawTransformFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, + this->skelAnime.dListCount, EnScopenuts_OverrideLimbDraw, EnScopenuts_PostLimbDraw, + EnScopenuts_TransformLimbDraw, &this->actor); +} diff --git a/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.h b/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.h index 2eed1584f..c4a00f84a 100644 --- a/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.h +++ b/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.h @@ -7,11 +7,44 @@ struct EnScopenuts; typedef void (*EnScopenutsActionFunc)(struct EnScopenuts*, GlobalContext*); +#define ENSCOPENUTS_GET_3E0(thisx) (((thisx)->params & 0x3E0) >> 5) +#define ENSCOPENUTS_GET_FC00(thisx) (((thisx)->params & 0xFC00) >> 0xA) + +#define ENSCOPENUTS_3E0_0 0 +#define ENSCOPENUTS_3E0_1 1 + typedef struct EnScopenuts { /* 0x0000 */ Actor actor; - /* 0x0144 */ char unk_144[0x194]; + /* 0x0144 */ SkelAnime skelAnime; + /* 0x0188 */ Vec3s jointTable[28]; + /* 0x0230 */ Vec3s morphTable[28]; /* 0x02D8 */ EnScopenutsActionFunc actionFunc; - /* 0x02DC */ char unk_2DC[0x98]; + /* 0x02DC */ ColliderCylinder collider; + /* 0x0328 */ u16 unk_328; + /* 0x032C */ f32 unk_32C; + /* 0x0330 */ Path* path; + /* 0x0334 */ s32 unk_334; + /* 0x0338 */ s16 unk_338; + /* 0x033A */ UNK_TYPE1 unk33A[2]; + /* 0x033C */ u16 unk_33C; + /* 0x033E */ s16 unk_33E; + /* 0x0340 */ s16 unk_340; + /* 0x0342 */ UNK_TYPE1 unk342[0x6]; + /* 0x0348 */ s32 unk_348; + /* 0x034C */ s16 unk_34C; + /* 0x034E */ s16 unk_34E; + /* 0x0350 */ f32 unk_350; + /* 0x0354 */ UNK_TYPE1 unk354[4]; + /* 0x0358 */ s16 unk_358; + /* 0x035A */ s16 unk_35A; + /* 0x035C */ f32 unk_35C; + /* 0x0360 */ f32 unk_360; + /* 0x0364 */ f32 unk_364; + /* 0x0368 */ f32 unk_368; + /* 0x036C */ s16 unk_36C; + /* 0x036E */ s16 unk_36E; + /* 0x0370 */ s16 unk_370; + /* 0x0372 */ s16 unk_372; } EnScopenuts; // size = 0x374 extern const ActorInit En_Scopenuts_InitVars; diff --git a/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c b/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c index e6f2625fa..a6f579f85 100644 --- a/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c +++ b/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c @@ -5,6 +5,7 @@ */ #include "z_en_sellnuts.h" +#include "objects/object_dnt/object_dnt.h" #define FLAGS 0x00000039 @@ -34,28 +35,6 @@ void func_80ADCA64(EnSellnuts* this, GlobalContext* globalCtx); s32 func_80ADCE4C(EnSellnuts* this, Path* path, s32 arg2); f32 func_80ADCFE8(Path* path, s32 arg1, Vec3f* pos, Vec3s* arg3); -extern AnimationHeader D_06000994; -extern AnimationHeader D_060012F4; -extern Gfx D_06001350[]; -extern AnimationHeader D_06001BC8; -extern AnimationHeader D_06001E2C; -extern AnimationHeader D_06002268; -extern AnimationHeader D_06002670; -extern AnimationHeader D_060029E8; -extern AnimationHeader D_06002F08; -extern AnimationHeader D_06003438; -extern AnimationHeader D_060038CC; -extern AnimationHeader D_06003CC0; -extern AnimationHeader D_06004700; -extern AnimationHeader D_06004AA0; -extern AnimationHeader D_06004E38; -extern AnimationHeader D_06005488; -extern AnimationHeader D_0600577C; -extern AnimationHeader D_06005CA8; -extern Gfx D_06008290[]; -extern FlexSkeletonHeader D_0600AC70; -extern AnimationHeader D_0600B0B4; - static u16 D_80ADD910[] = { 0x0614, 0x060E, @@ -106,14 +85,18 @@ static ColliderCylinderInitType1 sCylinderInit = { }; static ActorAnimationEntryS D_80ADD990[] = { - { &D_06005488, 1.0f, 0, -1, 0, 0 }, { &D_0600B0B4, 1.0f, 0, -1, 0, 0 }, { &D_06004AA0, 1.0f, 0, -1, 2, 0 }, - { &D_06004E38, 1.0f, 0, -1, 2, 0 }, { &D_060029E8, 1.0f, 0, -1, 2, 0 }, { &D_06005CA8, 1.0f, 0, -1, 2, 0 }, - { &D_060038CC, 1.0f, 0, -1, 0, 0 }, { &D_06003CC0, 1.0f, 0, -1, 0, 0 }, { &D_060012F4, 1.0f, 0, -1, 2, 0 }, - { &D_06004700, 1.0f, 0, -1, 2, 0 }, { &D_06001BC8, 1.0f, 0, -1, 0, 0 }, { &D_06003438, 1.0f, 0, -1, 2, 0 }, - { &D_06001E2C, 1.0f, 0, -1, 0, 0 }, { &D_06000994, 1.0f, 0, -1, 0, 0 }, { &D_06002268, 1.0f, 0, -1, 2, 0 }, - { &D_06002F08, 1.0f, 0, -1, 0, 0 }, { &D_0600577C, 1.0f, 0, -1, 0, -4 }, { &D_060029E8, 1.0f, 8, -1, 2, 0 }, - { &D_060029E8, 1.0f, 4, -1, 2, -4 }, { &D_060029E8, 1.0f, 0, -1, 2, 0 }, { &D_06001BC8, 1.0f, 0, -1, 0, 0 }, - { &D_060012F4, -1.0f, 0, -1, 2, 0 }, { &D_06002670, 1.0f, 0, -1, 2, 0 }, + { &object_dnt_Anim_005488, 1.0f, 0, -1, 0, 0 }, { &object_dnt_Anim_00B0B4, 1.0f, 0, -1, 0, 0 }, + { &object_dnt_Anim_004AA0, 1.0f, 0, -1, 2, 0 }, { &object_dnt_Anim_004E38, 1.0f, 0, -1, 2, 0 }, + { &object_dnt_Anim_0029E8, 1.0f, 0, -1, 2, 0 }, { &object_dnt_Anim_005CA8, 1.0f, 0, -1, 2, 0 }, + { &object_dnt_Anim_0038CC, 1.0f, 0, -1, 0, 0 }, { &object_dnt_Anim_003CC0, 1.0f, 0, -1, 0, 0 }, + { &object_dnt_Anim_0012F4, 1.0f, 0, -1, 2, 0 }, { &object_dnt_Anim_004700, 1.0f, 0, -1, 2, 0 }, + { &object_dnt_Anim_001BC8, 1.0f, 0, -1, 0, 0 }, { &object_dnt_Anim_003438, 1.0f, 0, -1, 2, 0 }, + { &object_dnt_Anim_001E2C, 1.0f, 0, -1, 0, 0 }, { &object_dnt_Anim_000994, 1.0f, 0, -1, 0, 0 }, + { &object_dnt_Anim_002268, 1.0f, 0, -1, 2, 0 }, { &object_dnt_Anim_002F08, 1.0f, 0, -1, 0, 0 }, + { &object_dnt_Anim_00577C, 1.0f, 0, -1, 0, -4 }, { &object_dnt_Anim_0029E8, 1.0f, 8, -1, 2, 0 }, + { &object_dnt_Anim_0029E8, 1.0f, 4, -1, 2, -4 }, { &object_dnt_Anim_0029E8, 1.0f, 0, -1, 2, 0 }, + { &object_dnt_Anim_001BC8, 1.0f, 0, -1, 0, 0 }, { &object_dnt_Anim_0012F4, -1.0f, 0, -1, 2, 0 }, + { &object_dnt_Anim_002670, 1.0f, 0, -1, 2, 0 }, }; static InitChainEntry sInitChain[] = { @@ -962,7 +945,8 @@ void EnSellnuts_Init(Actor* thisx, GlobalContext* globalCtx) { } Actor_ProcessInitChain(&this->actor, sInitChain); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600AC70, &D_06005488, this->jointTable, this->morphTable, 28); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_dnt_Skel_00AC70, &object_dnt_Anim_005488, this->jointTable, + this->morphTable, 28); Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinderType1(globalCtx, &this->collider, &this->actor, &sCylinderInit); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 35.0f); @@ -1115,9 +1099,9 @@ s32 EnSellnuts_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** d if (limbIndex == 26) { if ((this->unk_34C == 6) || (this->unk_34C == 5) || (this->unk_34C == 7)) { - *dList = D_06001350; + *dList = object_dnt_DL_001350; } else { - *dList = D_06008290; + *dList = object_dnt_DL_008290; } } diff --git a/src/overlays/actors/ovl_En_Skb/z_en_skb.c b/src/overlays/actors/ovl_En_Skb/z_en_skb.c index a25003ee6..05929a181 100644 --- a/src/overlays/actors/ovl_En_Skb/z_en_skb.c +++ b/src/overlays/actors/ovl_En_Skb/z_en_skb.c @@ -7,6 +7,7 @@ #include "z_en_skb.h" #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" #include "overlays/actors/ovl_En_Encount4/z_en_encount4.h" +#include "objects/object_skb/object_skb.h" #define FLAGS 0x00000005 @@ -48,26 +49,14 @@ void func_809964A0(EnSkb* this, GlobalContext* globalCtx); s32 func_80996594(EnSkb* this, GlobalContext* globalCtx); void func_80996BEC(EnSkb* this, GlobalContext* globalCtx); -extern AnimationHeader D_060009E4; -extern AnimationHeader D_060015EC; -extern AnimationHeader D_06001D1C; -extern AnimationHeader D_06002190; -extern AnimationHeader D_0600270C; -extern AnimationHeader D_06002AC8; -extern AnimationHeader D_06003584; -extern SkeletonHeader D_06005EF8; -extern AnimationHeader D_060064E0; -extern AnimationHeader D_0600697C; -extern AnimationHeader D_06006D90; - static ActorAnimationEntry sAnimations[] = { - { &D_060064E0, 1.0f, 0.0f, 0.0f, 0, -4.0 }, { &D_06003584, 1.0f, 0.0f, 0.0f, 2, -1.0f }, - { &D_06002190, 0.6f, 0.0f, 0.0f, 3, 4.0f }, { &D_06002AC8, 1.0f, 0.0f, 0.0f, 2, -4.0 }, - { &D_0600270C, 1.0f, 0.0f, 0.0f, 2, -4.0 }, { &D_0600697C, 1.0f, 0.0f, 0.0f, 0, -4.0 }, - { &D_06006D90, 1.0f, 0.0f, 0.0f, 0, -4.0 }, { &D_06001D1C, 1.0f, 0.0f, 0.0f, 0, -4.0 }, - { &D_06003584, 1.0f, 0.0f, 0.0f, 2, -8.0f }, { &D_06003584, 1.0f, 0.0f, 0.0f, 2, -16.0f }, - { &D_06002AC8, 1.0f, 0.0f, 0.0f, 2, -8.0f }, { &D_060015EC, 1.0f, 0.0f, 0.0f, 2, -4.0 }, - { &D_060009E4, 1.0f, 0.0f, 0.0f, 0, -4.0 }, + { &object_skb_Anim_0064E0, 1.0f, 0.0f, 0.0f, 0, -4.0 }, { &object_skb_Anim_003584, 1.0f, 0.0f, 0.0f, 2, -1.0f }, + { &object_skb_Anim_002190, 0.6f, 0.0f, 0.0f, 3, 4.0f }, { &object_skb_Anim_002AC8, 1.0f, 0.0f, 0.0f, 2, -4.0 }, + { &object_skb_Anim_00270C, 1.0f, 0.0f, 0.0f, 2, -4.0 }, { &object_skb_Anim_00697C, 1.0f, 0.0f, 0.0f, 0, -4.0 }, + { &object_skb_Anim_006D90, 1.0f, 0.0f, 0.0f, 0, -4.0 }, { &object_skb_Anim_001D1C, 1.0f, 0.0f, 0.0f, 0, -4.0 }, + { &object_skb_Anim_003584, 1.0f, 0.0f, 0.0f, 2, -8.0f }, { &object_skb_Anim_003584, 1.0f, 0.0f, 0.0f, 2, -16.0f }, + { &object_skb_Anim_002AC8, 1.0f, 0.0f, 0.0f, 2, -8.0f }, { &object_skb_Anim_0015EC, 1.0f, 0.0f, 0.0f, 2, -4.0 }, + { &object_skb_Anim_0009E4, 1.0f, 0.0f, 0.0f, 0, -4.0 }, }; static Vec3f D_80997468[] = { @@ -181,25 +170,29 @@ void func_809947B0(GlobalContext* globalCtx, EnSkb* this, Vec3f* inPos) { } void func_8099495C(EnSkb* this, GlobalContext* globalCtx) { - SkelAnime_Init(globalCtx, &this->skelAnime, &D_06005EF8, &D_06003584, this->jointTable, this->morphTable, 20); + SkelAnime_Init(globalCtx, &this->skelAnime, &object_skb_Skel_005EF8, &object_skb_Anim_003584, this->jointTable, + this->morphTable, 20); this->unk_3DC = 0; func_80994E2C(this); } void func_809949C4(EnSkb* this, GlobalContext* globalCtx) { - SkelAnime_Init(globalCtx, &this->skelAnime, &D_06005EF8, &D_0600697C, this->jointTable, this->morphTable, 20); + SkelAnime_Init(globalCtx, &this->skelAnime, &object_skb_Skel_005EF8, &object_skb_Anim_00697C, this->jointTable, + this->morphTable, 20); this->unk_3DC = 1; func_809952D8(this); } void func_80994A30(EnSkb* this, GlobalContext* globalCtx) { - SkelAnime_Init(globalCtx, &this->skelAnime, &D_06005EF8, &D_06006D90, this->jointTable, this->morphTable, 20); + SkelAnime_Init(globalCtx, &this->skelAnime, &object_skb_Skel_005EF8, &object_skb_Anim_006D90, this->jointTable, + this->morphTable, 20); this->unk_3DC = 1; func_809953E8(this); } void func_80994A9C(EnSkb* this, GlobalContext* globalCtx) { - SkelAnime_Init(globalCtx, &this->skelAnime, &D_06005EF8, &D_06001D1C, this->jointTable, this->morphTable, 20); + SkelAnime_Init(globalCtx, &this->skelAnime, &object_skb_Skel_005EF8, &object_skb_Anim_001D1C, this->jointTable, + this->morphTable, 20); this->unk_3DC = 1; func_809954F8(this); } @@ -536,7 +529,8 @@ void func_80995818(EnSkb* this, GlobalContext* globalCtx) { } void func_809958F4(EnSkb* this) { - Animation_Change(&this->skelAnime, &D_06003584, -1.0f, Animation_GetLastFrame(&D_06003584), 0.0f, 2, -4.0f); + Animation_Change(&this->skelAnime, &object_skb_Anim_003584, -1.0f, Animation_GetLastFrame(&object_skb_Anim_003584), + 0.0f, 2, -4.0f); this->unk_3E4 = 0; this->actor.flags &= ~1; this->actor.speedXZ = 0.0f; @@ -620,7 +614,7 @@ void func_80995C84(EnSkb* this, GlobalContext* globalCtx) { } void func_80995D3C(EnSkb* this) { - Animation_Change(&this->skelAnime, &D_06002190, -0.4f, this->skelAnime.curFrame - 1.0f, 0.0f, 3, 0.0f); + Animation_Change(&this->skelAnime, &object_skb_Anim_002190, -0.4f, this->skelAnime.curFrame - 1.0f, 0.0f, 3, 0.0f); this->collider.base.atFlags &= ~AT_BOUNCED; this->unk_3DE = 4; this->unk_3E4 = 0; diff --git a/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c b/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c index 58d9d92e8..a238e55dc 100644 --- a/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c +++ b/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c @@ -5,6 +5,12 @@ */ #include "z_en_sob1.h" +#include "objects/object_rs/object_rs.h" +#include "objects/object_zo/object_zo.h" +#include "objects/object_mastergolon/object_mastergolon.h" +#include "objects/object_masterzoora/object_masterzoora.h" +#include "objects/object_oF1d_map/object_oF1d_map.h" +#include "objects/gameplay_keep/gameplay_keep.h" #define FLAGS 0x00000019 @@ -48,30 +54,10 @@ s32 EnSob1_TakeItemOffShelf(EnSob1* this); s32 EnSob1_ReturnItemToShelf(EnSob1* this); s16 EnSob1_GetXZAngleAndDistanceSqToPoint(Path* path, s32 pointIdx, Vec3f* pos, f32* distSq); -extern UNK_TYPE D_0401F740; -extern UNK_TYPE D_0401F8C0; -extern UNK_TYPE D_0401F7C0; -extern AnimationHeader D_06009120; -extern AnimationHeader D_06008268; -extern FlexSkeletonHeader D_0600D208; -extern AnimationHeader D_0600078C; -extern AnimationHeader D_060087BC; -extern FlexSkeletonHeader D_06011AC8; -extern AnimationHeader D_060000FC; -extern FlexSkeletonHeader D_06009220; -extern Gfx D_06000970[]; -extern UNK_TYPE D_06005458; -extern TexturePtr D_060050A0; -extern TexturePtr D_060058A0; -extern TexturePtr D_060060A0; -extern TexturePtr D_06010438; -extern TexturePtr D_06010C38; -extern TexturePtr D_06011038; - static ActorAnimationEntryS sAnimationsBombShopkeeper[] = { - { &D_06009120, 2.0f, 0, -1, 0, 20 }, - { &D_06008268, 1.0f, 0, -1, 2, 0 }, - { &D_060087BC, 1.0f, 0, -1, 0, 0 }, + { &object_rs_Anim_009120, 2.0f, 0, -1, 0, 20 }, + { &object_rs_Anim_008268, 1.0f, 0, -1, 2, 0 }, + { &object_rs_Anim_0087BC, 1.0f, 0, -1, 0, 0 }, }; const ActorInit En_Sob1_InitVars = { @@ -722,7 +708,7 @@ void EnSob1_EndWalk(EnSob1* this, GlobalContext* globalCtx) { s32 pad; f32 distSq; s16 curFrame = this->skelAnime.curFrame / this->skelAnime.playSpeed; - s16 animLastFrame = Animation_GetLastFrame(&D_06009120) / (s16)this->skelAnime.playSpeed; + s16 animLastFrame = Animation_GetLastFrame(&object_rs_Anim_009120) / (s16)this->skelAnime.playSpeed; Math_SmoothStepToS( &this->actor.world.rot.y, @@ -743,7 +729,7 @@ void EnSob1_EndWalk(EnSob1* this, GlobalContext* globalCtx) { void EnSob1_SetupIdle(EnSob1* this, GlobalContext* globalCtx) { s16 curFrame = this->skelAnime.curFrame; - if (Animation_GetLastFrame(&D_06008268) == curFrame) { + if (Animation_GetLastFrame(&object_rs_Anim_008268) == curFrame) { EnSob1_ChangeAnim(&this->skelAnime, sAnimationsBombShopkeeper, 2); EnSob1_SetupAction(this, EnSob1_Idle); } @@ -1334,23 +1320,27 @@ s32 EnSob1_AreObjectsLoaded(EnSob1* this, GlobalContext* globalCtx) { } void EnSob1_InitZoraShopkeeper(EnSob1* this, GlobalContext* globalCtx) { - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600D208, NULL, this->jointTable, this->morphTable, 20); - gSegments[0x06] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[this->objIndices[2]].segment); - Animation_Change(&this->skelAnime, &D_0600078C, 1.0f, 0.0f, Animation_GetLastFrame(&D_0600078C), 0, 0.0f); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gZoraSkel, NULL, this->jointTable, this->morphTable, 20); + gSegments[6] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[this->objIndices[2]].segment); + Animation_Change(&this->skelAnime, &object_masterzoora_Anim_00078C, 1.0f, 0.0f, + Animation_GetLastFrame(&object_masterzoora_Anim_00078C), 0, 0.0f); this->actor.draw = EnSob1_DrawZoraShopkeeper; this->changeObjectFunc = EnSob1_ChangeObject; } void EnSob1_InitGoronShopkeeper(EnSob1* this, GlobalContext* globalCtx) { - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06011AC8, NULL, this->jointTable, this->morphTable, 18); - gSegments[0x06] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[this->objIndices[2]].segment); - Animation_Change(&this->skelAnime, &D_060000FC, 1.0f, 0.0f, Animation_GetLastFrame(&D_060000FC), 0, 0.0f); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_oF1d_map_Skel_011AC8, NULL, this->jointTable, + this->morphTable, 18); + gSegments[6] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[this->objIndices[2]].segment); + Animation_Change(&this->skelAnime, &object_mastergolon_Anim_0000FC, 1.0f, 0.0f, + Animation_GetLastFrame(&object_mastergolon_Anim_0000FC), 0, 0.0f); this->actor.draw = EnSob1_DrawGoronShopkeeper; this->changeObjectFunc = EnSob1_ChangeObject; } void EnSob1_InitBombShopkeeper(EnSob1* this, GlobalContext* globalCtx) { - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06009220, &D_06009120, this->jointTable, this->morphTable, 16); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_rs_Skel_009220, &object_rs_Anim_009120, this->jointTable, + this->morphTable, 16); this->actor.draw = EnSob1_DrawBombShopkeeper; this->changeObjectFunc = NULL; this->skelAnime.playSpeed = 2.0f; @@ -1495,8 +1485,8 @@ void EnSob1_DrawCursor(GlobalContext* globalCtx, EnSob1* this, f32 x, f32 y, f32 func_8012C654(globalCtx->state.gfxCtx); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, this->cursorColor.r, this->cursorColor.g, this->cursorColor.b, this->cursorColor.a); - gDPLoadTextureBlock_4b(OVERLAY_DISP++, &D_0401F740, G_IM_FMT_IA, 16, 16, 0, G_TX_MIRROR | G_TX_WRAP, - G_TX_MIRROR | G_TX_WRAP, 4, 4, G_TX_NOLOD, G_TX_NOLOD); + gDPLoadTextureBlock_4b(OVERLAY_DISP++, gameplay_keep_Tex_01F740, G_IM_FMT_IA, 16, 16, 0, + G_TX_MIRROR | G_TX_WRAP, G_TX_MIRROR | G_TX_WRAP, 4, 4, G_TX_NOLOD, G_TX_NOLOD); w = 16.0f * z; ulx = (x - w) * 4.0f; uly = (y - w + -12.0f) * 4.0f; @@ -1547,7 +1537,7 @@ void EnSob1_DrawStickDirectionPrompt(GlobalContext* globalCtx, EnSob1* this) { if (drawStickRightPrompt || drawStickLeftPrompt) { func_8012C654(globalCtx->state.gfxCtx); gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); - gDPSetTextureImage(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, &D_0401F8C0); + gDPSetTextureImage(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, gameplay_keep_Tex_01F8C0); gDPSetTile(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 4, G_TX_NOLOD); gDPLoadSync(OVERLAY_DISP++); @@ -1568,7 +1558,7 @@ void EnSob1_DrawStickDirectionPrompt(GlobalContext* globalCtx, EnSob1* this) { this->stickRightPrompt.arrowTexX, this->stickRightPrompt.arrowTexY, this->stickRightPrompt.texZ, 0, 0, 1.0f, 1.0f); } - gDPSetTextureImage(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, &D_0401F7C0); + gDPSetTextureImage(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, gameplay_keep_Tex_01F7C0); gDPSetTile(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 4, G_TX_NOLOD); gDPLoadSync(OVERLAY_DISP++); @@ -1616,7 +1606,7 @@ s32 EnSob1_OverrideLimbDrawBombShopkeeper(GlobalContext* globalCtx, s32 limbInde void EnSob1_PostLimbDrawBombShopkeeper(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { OPEN_DISPS(globalCtx->state.gfxCtx); if (limbIndex == 11) { - gSPDisplayList(POLY_OPA_DISP++, D_06000970); + gSPDisplayList(POLY_OPA_DISP++, object_rs_DL_000970); } CLOSE_DISPS(globalCtx->state.gfxCtx); } @@ -1632,7 +1622,7 @@ Gfx* EnSob1_EndDList(GraphicsContext* gfxCtx) { } void EnSob1_DrawZoraShopkeeper(Actor* thisx, GlobalContext* globalCtx) { - static TexturePtr sZoraShopkeeperEyeTextures[] = { &D_060050A0, &D_060058A0, &D_060060A0 }; + static TexturePtr sZoraShopkeeperEyeTextures[] = { gZoraEyeOpenTex, gZoraEyeHalfTex, gZoraEyeClosedTex }; EnSob1* this = THIS; s32 pad; s32 i; @@ -1655,7 +1645,8 @@ void EnSob1_DrawZoraShopkeeper(Actor* thisx, GlobalContext* globalCtx) { } void EnSob1_DrawGoronShopkeeper(Actor* thisx, GlobalContext* globalCtx) { - static TexturePtr sGoronShopkeeperEyeTextures[] = { &D_06010438, &D_06010C38, &D_06011038 }; + static TexturePtr sGoronShopkeeperEyeTextures[] = { object_oF1d_map_Tex_010438, object_oF1d_map_Tex_010C38, + object_oF1d_map_Tex_011038 }; EnSob1* this = THIS; s32 pad; s32 i; @@ -1683,7 +1674,7 @@ void EnSob1_DrawBombShopkeeper(Actor* thisx, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx); func_8012C28C(globalCtx->state.gfxCtx); - gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(&D_06005458)); + gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(object_rs_Tex_005458)); SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, EnSob1_OverrideLimbDrawBombShopkeeper, EnSob1_PostLimbDrawBombShopkeeper, &this->actor); for (i = 0; i < ARRAY_COUNT(this->items); i++) { diff --git a/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c b/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c index aab7e5b4d..c58d780b9 100644 --- a/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c +++ b/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c @@ -7,6 +7,7 @@ #include "z_en_suttari.h" #include "overlays/actors/ovl_En_Elf/z_en_elf.h" #include "overlays/actors/ovl_En_Door/z_en_door.h" +#include "objects/object_boj/object_boj.h" #define FLAGS 0x00000019 @@ -36,17 +37,6 @@ void func_80BADE14(EnSuttari* this, GlobalContext* globalCtx); void func_80BADE8C(EnSuttari* this, GlobalContext* globalCtx); void func_80BADF3C(EnSuttari* this, GlobalContext* globalCtx); -extern FlexSkeletonHeader D_0600C240; -extern AnimationHeader D_0600071C; -extern AnimationHeader D_06010BDC; -extern AnimationHeader D_0601139C; -extern AnimationHeader D_06011F84; -extern AnimationHeader D_06011C38; -extern AnimationHeader D_060128F4; -extern AnimationHeader D_06012E84; -extern Gfx D_0600AF90[]; -extern Gfx D_06013380[]; - const ActorInit En_Suttari_InitVars = { ACTOR_EN_SUTTARI, ACTORCAT_NPC, @@ -60,11 +50,11 @@ const ActorInit En_Suttari_InitVars = { }; static ActorAnimationEntry sAnimations[] = { - { &D_0600071C, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &D_060128F4, 1.0f, 0.0f, 0.0f, 0, 0.0f }, - { &D_06011F84, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &D_06012E84, 1.0f, 0.0f, 0.0f, 0, -6.0f }, - { &D_0601139C, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &D_0600071C, 2.0f, 0.0f, 0.0f, 0, 0.0f }, - { &D_06011F84, 2.0f, 0.0f, 0.0f, 0, 0.0f }, { &D_06011C38, 1.0f, 0.0f, 0.0f, 2, 0.0f }, - { &D_06010BDC, 1.0f, 0.0f, 0.0f, 0, 0.0f }, + { &object_boj_Anim_00071C, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_boj_Anim_0128F4, 1.0f, 0.0f, 0.0f, 0, 0.0f }, + { &object_boj_Anim_011F84, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_boj_Anim_012E84, 1.0f, 0.0f, 0.0f, 0, -6.0f }, + { &object_boj_Anim_01139C, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_boj_Anim_00071C, 2.0f, 0.0f, 0.0f, 0, 0.0f }, + { &object_boj_Anim_011F84, 2.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_boj_Anim_011C38, 1.0f, 0.0f, 0.0f, 2, 0.0f }, + { &object_boj_Anim_010BDC, 1.0f, 0.0f, 0.0f, 0, 0.0f }, }; static ColliderCylinderInit sCylinderInit = { @@ -908,7 +898,8 @@ void func_80BAC2FC(EnSuttari* this, GlobalContext* globalCtx) { void func_80BAC6E8(EnSuttari* this, GlobalContext* globalCtx) { ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600C240, &D_0600071C, this->jointTable, this->morphTable, 16); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_boj_Skel_00C240, &object_boj_Anim_00071C, this->jointTable, + this->morphTable, 16); this->actor.draw = EnSuttari_Draw; this->actor.flags |= 1; if (globalCtx->sceneNum == SCENE_IKANA) { @@ -1471,7 +1462,7 @@ s32 EnSuttari_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dL EnSuttari* this = THIS; if (limbIndex == 15) { - *dList = D_0600AF90; + *dList = object_boj_DL_00AF90; if (!(this->flags1 & 4)) { Matrix_InsertTranslation(1500.0f, 0.0f, 0.0f, MTXMODE_APPLY); Matrix_InsertXRotation_s(this->unk3F2, MTXMODE_APPLY); @@ -1514,7 +1505,7 @@ void EnSuttari_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList } else { func_8012C28C(globalCtx->state.gfxCtx); OPEN_DISPS(globalCtx->state.gfxCtx); - gSPDisplayList(POLY_OPA_DISP++, D_06013380); + gSPDisplayList(POLY_OPA_DISP++, object_boj_DL_013380); CLOSE_DISPS(globalCtx->state.gfxCtx); } } diff --git a/src/overlays/actors/ovl_En_Sw/z_en_sw.c b/src/overlays/actors/ovl_En_Sw/z_en_sw.c index a851f2ee9..392fe62bc 100644 --- a/src/overlays/actors/ovl_En_Sw/z_en_sw.c +++ b/src/overlays/actors/ovl_En_Sw/z_en_sw.c @@ -5,6 +5,7 @@ */ #include "z_en_sw.h" +#include "objects/object_st/object_st.h" #define FLAGS 0x00000005 @@ -27,21 +28,6 @@ void func_808DB100(EnSw* this, GlobalContext* globalCtx); void func_808DB25C(EnSw* this, GlobalContext* globalCtx); void func_808DB2E0(EnSw* this, GlobalContext* globalCtx); -extern AnimationHeader D_06000304; -extern Gfx D_06003FB0[]; -extern Gfx D_060043D8[]; -extern Gfx D_060045C0[]; -extern Gfx D_06004658[]; -extern Gfx D_060046F0[]; -extern Gfx D_06004788[]; -extern Gfx D_06004820[]; -extern Gfx D_060048B8[]; -extern Gfx D_06004950[]; -extern Gfx D_060049E8[]; -extern SkeletonHeader D_06005298; -extern AnimationHeader D_060055A8; -extern AnimationHeader D_06005B98; - const ActorInit En_Sw_InitVars = { ACTOR_EN_SW, ACTORCAT_NPC, @@ -149,10 +135,10 @@ static DamageTable sDamageTable2 = { }; static ActorAnimationEntryS sAnimations[] = { - { &D_06000304, 1.0f, 0, -1, 3, 0 }, - { &D_06000304, 1.0f, 0, -1, 3, -4 }, - { &D_060055A8, 1.0f, 0, -1, 1, -4 }, - { &D_06005B98, 1.0f, 0, -1, 1, -4 }, + { &object_st_Anim_000304, 1.0f, 0, -1, 3, 0 }, + { &object_st_Anim_000304, 1.0f, 0, -1, 3, -4 }, + { &object_st_Anim_0055A8, 1.0f, 0, -1, 1, -4 }, + { &object_st_Anim_005B98, 1.0f, 0, -1, 1, -4 }, }; void func_808D8940(EnSw* this, GlobalContext* globalCtx) { @@ -1171,7 +1157,8 @@ void EnSw_Init(Actor* thisx, GlobalContext* globalCtx) { if (!func_808D9968(this, globalCtx)) { ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f); - SkelAnime_Init(globalCtx, &this->skelAnime, &D_06005298, NULL, this->jointTable, this->morphTable, 30); + SkelAnime_Init(globalCtx, &this->skelAnime, &object_st_Skel_005298, NULL, this->jointTable, this->morphTable, + 30); func_8013BC6C(&this->skelAnime, sAnimations, 0); this->skelAnime.playSpeed = 4.0f; @@ -1276,43 +1263,43 @@ s32 EnSw_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, if (ENSW_GET_3(&this->actor)) { switch (limbIndex) { case 23: - *dList = D_06004788; + *dList = object_st_DL_004788; break; case 8: - *dList = D_060046F0; + *dList = object_st_DL_0046F0; break; case 14: - *dList = D_06004658; + *dList = object_st_DL_004658; break; case 11: - *dList = D_060045C0; + *dList = object_st_DL_0045C0; break; case 26: - *dList = D_06004820; + *dList = object_st_DL_004820; break; case 20: - *dList = D_060048B8; + *dList = object_st_DL_0048B8; break; case 17: - *dList = D_06004950; + *dList = object_st_DL_004950; break; case 29: - *dList = D_060049E8; + *dList = object_st_DL_0049E8; break; case 5: - *dList = D_06003FB0; + *dList = object_st_DL_003FB0; break; case 4: - *dList = D_060043D8; + *dList = object_st_DL_0043D8; break; } } diff --git a/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c b/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c index 61e79de85..7f4e5f2ea 100644 --- a/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c +++ b/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c @@ -5,6 +5,7 @@ */ #include "z_en_syateki_man.h" +#include "objects/object_shn/object_shn.h" #define FLAGS 0x08000019 @@ -34,16 +35,6 @@ void func_809C8808(EnSyatekiMan* this, GlobalContext* globalCtx); void func_809C898C(EnSyatekiMan* this, GlobalContext* globalCtx); void func_809C8BF0(EnSyatekiMan* this, GlobalContext* globalCtx); -extern UNK_PTR D_06005AC8; -extern UNK_PTR D_060062C8; -extern AnimationHeader D_0600D2F8; -extern AnimationHeader D_0600D9D0; -extern AnimationHeader D_0600DFEC; -extern FlexSkeletonHeader D_0600E7D0; -extern Gfx D_0600F2D0[]; -extern UNK_PTR D_0600FB90; -extern UNK_PTR D_06010390; - const ActorInit En_Syateki_Man_InitVars = { ACTOR_EN_SYATEKI_MAN, ACTORCAT_NPC, @@ -57,9 +48,9 @@ const ActorInit En_Syateki_Man_InitVars = { }; static ActorAnimationEntry sAnimations[] = { - { &D_0600D9D0, 1.0f, 0.0f, 0.0f, 0, -8.0f }, - { &D_0600DFEC, 1.0f, 0.0f, 0.0f, 0, -8.0f }, - { &D_0600D2F8, 1.0f, 0.0f, 0.0f, 2, -8.0f }, + { &object_shn_Anim_00D9D0, 1.0f, 0.0f, 0.0f, 0, -8.0f }, + { &object_shn_Anim_00DFEC, 1.0f, 0.0f, 0.0f, 0, -8.0f }, + { &object_shn_Anim_00D2F8, 1.0f, 0.0f, 0.0f, 2, -8.0f }, }; static s16 D_809C91C8[] = { @@ -141,11 +132,11 @@ void EnSyatekiMan_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.targetMode = 1; Actor_SetScale(&this->actor, 0.01f); if (globalCtx->sceneNum == SCENE_SYATEKI_MORI) { - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600E7D0, &D_0600DFEC, this->jointTable, this->morphTable, - 16); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_shn_Skel_00E7D0, &object_shn_Anim_00DFEC, + this->jointTable, this->morphTable, 16); } else { - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600E7D0, &D_0600D9D0, this->jointTable, this->morphTable, - 16); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_shn_Skel_00E7D0, &object_shn_Anim_00D9D0, + this->jointTable, this->morphTable, 16); } this->actor.colChkInfo.cylRadius = 100; @@ -417,7 +408,7 @@ void func_809C6E30(EnSyatekiMan* this, GlobalContext* globalCtx) { break; } - if (this->skelAnime.animation == &D_0600D2F8) { + if (this->skelAnime.animation == &object_shn_Anim_00D2F8) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { Actor_ChangeAnimation(&this->skelAnime, sAnimations, 0); } @@ -1252,7 +1243,7 @@ s32 EnSyatekiMan_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** EnSyatekiMan* this = THIS; if ((globalCtx->sceneNum == SCENE_SYATEKI_MIZU) && (limbIndex == 15)) { - *dList = D_0600F2D0; + *dList = object_shn_DL_00F2D0; } if (limbIndex == 15) { @@ -1277,22 +1268,22 @@ void EnSyatekiMan_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dL } void EnSyatekiMan_Draw(Actor* thisx, GlobalContext* globalCtx) { - static UNK_PTR D_809C94B8[] = { - &D_06005AC8, - &D_060062C8, - &D_060062C8, + static TexturePtr D_809C94B8[] = { + object_shn_Tex_005AC8, + object_shn_Tex_0062C8, + object_shn_Tex_0062C8, }; EnSyatekiMan* this = THIS; s32 pad; if (globalCtx->sceneNum == SCENE_SYATEKI_MIZU) { - D_809C94B8[0] = &D_0600FB90; - D_809C94B8[1] = &D_06010390; - D_809C94B8[2] = &D_06010390; + D_809C94B8[0] = object_shn_Tex_00FB90; + D_809C94B8[1] = object_shn_Tex_010390; + D_809C94B8[2] = object_shn_Tex_010390; } else { - D_809C94B8[0] = &D_06005AC8; - D_809C94B8[1] = &D_060062C8; - D_809C94B8[2] = &D_060062C8; + D_809C94B8[0] = object_shn_Tex_005AC8; + D_809C94B8[1] = object_shn_Tex_0062C8; + D_809C94B8[2] = object_shn_Tex_0062C8; } OPEN_DISPS(globalCtx->state.gfxCtx); diff --git a/src/overlays/actors/ovl_En_Tag_Obj/z_en_tag_obj.c b/src/overlays/actors/ovl_En_Tag_Obj/z_en_tag_obj.c index 2c4c50049..5504dabdb 100644 --- a/src/overlays/actors/ovl_En_Tag_Obj/z_en_tag_obj.c +++ b/src/overlays/actors/ovl_En_Tag_Obj/z_en_tag_obj.c @@ -47,7 +47,7 @@ const ActorInit En_Tag_Obj_InitVars = { }; void EnTagObj_Init(Actor* thisx, GlobalContext* globalCtx) { - EnTagObj* this = (EnTagObj*)thisx; + EnTagObj* this = THIS; this->hasSpawnedSeahorse = 0; } @@ -56,7 +56,7 @@ void EnTagObj_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void EnTagObj_Update(Actor* thisx, GlobalContext* globalCtx) { - EnTagObj* this = (EnTagObj*)thisx; + EnTagObj* this = THIS; if (!this->hasSpawnedSeahorse) { Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_OT, this->actor.world.pos.x, this->actor.world.pos.y, diff --git a/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.c b/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.c index c735f4ca2..ba49ab93e 100644 --- a/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.c +++ b/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.c @@ -6,11 +6,18 @@ #include "z_en_tanron3.h" #include "overlays/actors/ovl_Boss_03/z_boss_03.h" +#include "objects/object_boss03/object_boss03.h" #define FLAGS 0x00000035 #define THIS ((EnTanron3*)thisx) +#define WORK_TIMER_PICK_NEW_DEVIATION 0 +#define WORK_TIMER_DIE 0 +#define WORK_TIMER_OUT_OF_WATER 1 +#define WORK_TIMER_ATTACK 2 +#define WORK_TIMER_WAIT 2 + void EnTanron3_Init(Actor* thisx, GlobalContext* globalCtx); void EnTanron3_Destroy(Actor* thisx, GlobalContext* globalCtx); void EnTanron3_Update(Actor* thisx, GlobalContext* globalCtx); @@ -78,9 +85,6 @@ static ColliderCylinderInit sUnusedCylinderInit = { { 20, 20, -10, { 0, 0, 0 } }, }; -extern FlexSkeletonHeader D_0600DA20; -extern AnimationHeader D_0600DAAC; - void EnTanron3_CreateEffect(GlobalContext* globalCtx, Vec3f* effectPos) { UnkTanron3Effect* effectPtr = (UnkTanron3Effect*)globalCtx->specialEffects; s16 i; @@ -109,7 +113,8 @@ void EnTanron3_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.gravity = -1.0f; Collider_InitAndSetCylinder(globalCtx, &this->atCollider, &this->actor, &sCylinderInit); Collider_InitAndSetCylinder(globalCtx, &this->acCollider, &this->actor, &sCylinderInit); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600DA20, &D_0600DAAC, this->jointTable, this->morphTable, 10); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gGyorgSmallFishSkel, &gGyorgSmallFishSwimAnim, this->jointTable, + this->morphTable, GYORG_SMALL_FISH_LIMB_MAX); Actor_SetScale(&this->actor, 0.02f); EnTanron3_SetupLive(this, globalCtx); this->actor.flags &= ~1; @@ -143,10 +148,10 @@ void EnTanron3_SpawnBubbles(EnTanron3* this, GlobalContext* globalCtx) { void EnTanron3_SetupLive(EnTanron3* this, GlobalContext* globalCtx) { this->actionFunc = EnTanron3_Live; - Animation_MorphToLoop(&this->skelAnime, &D_0600DAAC, -10.0f); + Animation_MorphToLoop(&this->skelAnime, &gGyorgSmallFishSwimAnim, -10.0f); this->rotationStep = 0; this->rotationScale = 5; - this->workTimer[TANRON3_WORK_TIMER_PICK_NEW_DEVIATION] = 50; + this->workTimer[WORK_TIMER_PICK_NEW_DEVIATION] = 50; this->actor.speedXZ = 5.0f; this->speedMaxStep = 0.5f; this->deviation.x = randPlusMinusPoint5Scaled(500.0f); @@ -177,13 +182,13 @@ void EnTanron3_Live(EnTanron3* this, GlobalContext* globalCtx) { if ((player->actor.bgCheckFlags & 1) && player->actor.shape.feetPos[0].y >= 438.0f) { // Player is standing on the central platform, so stop chasing them this->isNonHostile = true; - } else if (this->isNonHostile && this->workTimer[TANRON3_WORK_TIMER_WAIT] == 0 && !(this->timer & 0x1F)) { + } else if (this->isNonHostile && this->workTimer[WORK_TIMER_WAIT] == 0 && !(this->timer & 0x1F)) { xDistance = this->targetPos.x - player->actor.world.pos.x; zDistance = this->targetPos.z - player->actor.world.pos.z; if (sqrtf(SQ(xDistance) + SQ(zDistance)) < 500.0f) { // Player is in the water and close enough, so start chasing them this->isNonHostile = false; - this->workTimer[TANRON3_WORK_TIMER_ATTACK] = 150; + this->workTimer[WORK_TIMER_ATTACK] = 150; } } @@ -205,8 +210,8 @@ void EnTanron3_Live(EnTanron3* this, GlobalContext* globalCtx) { // If the player gets eaten by Gyorg, or if the attack timer ran out, // stop chasing the player for a little bit. - if (this->workTimer[TANRON3_WORK_TIMER_ATTACK] == 0 || (player->stateFlags2 & 0x80)) { - this->workTimer[TANRON3_WORK_TIMER_WAIT] = 150; + if (this->workTimer[WORK_TIMER_ATTACK] == 0 || (player->stateFlags2 & 0x80)) { + this->workTimer[WORK_TIMER_WAIT] = 150; this->isNonHostile = true; } break; @@ -235,9 +240,9 @@ void EnTanron3_Live(EnTanron3* this, GlobalContext* globalCtx) { break; } - if (this->workTimer[TANRON3_WORK_TIMER_OUT_OF_WATER] == 0) { - if (this->workTimer[TANRON3_WORK_TIMER_PICK_NEW_DEVIATION] == 0 && this->actor.speedXZ > 1.0f) { - this->workTimer[TANRON3_WORK_TIMER_PICK_NEW_DEVIATION] = Rand_ZeroFloat(20.0f); + if (this->workTimer[WORK_TIMER_OUT_OF_WATER] == 0) { + if (this->workTimer[WORK_TIMER_PICK_NEW_DEVIATION] == 0 && this->actor.speedXZ > 1.0f) { + this->workTimer[WORK_TIMER_PICK_NEW_DEVIATION] = Rand_ZeroFloat(20.0f); this->deviation.x = randPlusMinusPoint5Scaled(100.0f); this->deviation.y = randPlusMinusPoint5Scaled(50.0f + extraScaleY); this->deviation.z = randPlusMinusPoint5Scaled(100.0f); @@ -267,7 +272,7 @@ void EnTanron3_Live(EnTanron3* this, GlobalContext* globalCtx) { // Fish is above water but hasn't touched land before this->actor.gravity = -1.0f; this->targetPosWithDeviation.y = this->waterSurfaceYPos - 50.0f; - this->workTimer[TANRON3_WORK_TIMER_OUT_OF_WATER] = 25; + this->workTimer[WORK_TIMER_OUT_OF_WATER] = 25; Math_ApproachS(&this->actor.world.rot.x, 0x3000, 5, 0xBD0); if (this->actor.bgCheckFlags & 8) { this->actor.speedXZ = 0.0f; @@ -319,9 +324,9 @@ void EnTanron3_Live(EnTanron3* this, GlobalContext* globalCtx) { } this->currentRotationAngle += this->nextRotationAngle; - this->trunkRotation = Math_SinS(this->currentRotationAngle) * 5000.0f; - this->bodyRotation = Math_SinS(this->currentRotationAngle + 0x6978) * 5000.0f; this->tailRotation = Math_SinS(this->currentRotationAngle) * 5000.0f; + this->bodyRotation = Math_SinS(this->currentRotationAngle + 0x6978) * 5000.0f; + this->trunkRotation = Math_SinS(this->currentRotationAngle) * 5000.0f; if (!this->isBeached) { this->actor.shape.rot = this->actor.world.rot; } @@ -339,14 +344,14 @@ void EnTanron3_SetupDie(EnTanron3* this, GlobalContext* globalCtx) { zDistance = this->actor.world.pos.z - player->actor.world.pos.z; this->actor.world.rot.x = Math_FAtan2F(sqrtf(SQ(xDistance) + SQ(zDistance)), -yDistance); this->actor.world.rot.y = Math_FAtan2F(zDistance, xDistance); - this->workTimer[TANRON3_WORK_TIMER_DIE] = 6; + this->workTimer[WORK_TIMER_DIE] = 6; this->actor.speedXZ = 10.0f; Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KONB_MINI_DEAD); } void EnTanron3_Die(EnTanron3* this, GlobalContext* globalCtx) { Actor_MoveWithoutGravityReverse(&this->actor); - if (this->workTimer[TANRON3_WORK_TIMER_DIE] == 0) { + if (this->workTimer[WORK_TIMER_DIE] == 0) { EnTanron3_SpawnBubbles(this, globalCtx); Actor_MarkForDeath(&this->actor); if (Rand_ZeroOne() < 0.3f) { @@ -419,7 +424,7 @@ void EnTanron3_Update(Actor* thisx, GlobalContext* globalCtx) { if ((s8)sGyorg->actor.colChkInfo.health <= 0 && this->actionFunc != EnTanron3_Die) { EnTanron3_SetupDie(this, globalCtx); - this->workTimer[TANRON3_WORK_TIMER_DIE] = 0; + this->workTimer[WORK_TIMER_DIE] = 0; } } @@ -427,15 +432,18 @@ s32 EnTanron3_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dL Actor* thisx) { EnTanron3* this = THIS; - if (limbIndex == 1) { + if (limbIndex == GYORG_SMALL_FISH_LIMB_ROOT) { rot->y += this->bodyRotation; } - if (limbIndex == 3) { - rot->y += this->tailRotation; - } - if (limbIndex == 4) { + + if (limbIndex == GYORG_SMALL_FISH_LIMB_TRUNK_ROOT) { rot->y += this->trunkRotation; } + + if (limbIndex == GYORG_SMALL_FISH_LIMB_TAIL_FIN) { + rot->y += this->tailRotation; + } + return false; } @@ -443,6 +451,7 @@ void EnTanron3_Draw(Actor* thisx, GlobalContext* globalCtx) { EnTanron3* this = THIS; OPEN_DISPS(globalCtx->state.gfxCtx); + func_8012C28C(globalCtx->state.gfxCtx); if ((this->fogTimer % 2) != 0) { POLY_OPA_DISP = Gfx_SetFog(POLY_OPA_DISP, 255, 0, 0, 255, 900, 1099); @@ -450,5 +459,6 @@ void EnTanron3_Draw(Actor* thisx, GlobalContext* globalCtx) { SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, EnTanron3_OverrideLimbDraw, NULL, &this->actor); POLY_OPA_DISP = func_801660B8(globalCtx, POLY_OPA_DISP); + CLOSE_DISPS(globalCtx->state.gfxCtx); } diff --git a/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.h b/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.h index 9a2cb25da..9d67154df 100644 --- a/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.h +++ b/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.h @@ -2,16 +2,12 @@ #define Z_EN_TANRON3_H #include "global.h" +#include "objects/object_boss03/object_boss03.h" struct EnTanron3; typedef void (*EnTanron3ActionFunc)(struct EnTanron3*, GlobalContext*); -#define TANRON3_WORK_TIMER_PICK_NEW_DEVIATION 0 -#define TANRON3_WORK_TIMER_DIE 0 -#define TANRON3_WORK_TIMER_OUT_OF_WATER 1 -#define TANRON3_WORK_TIMER_ATTACK 2 -#define TANRON3_WORK_TIMER_WAIT 2 #define TANRON3_WORK_TIMER_MAX 3 typedef struct { @@ -28,8 +24,8 @@ typedef struct { typedef struct EnTanron3 { /* 0x000 */ Actor actor; /* 0x144 */ SkelAnime skelAnime; - /* 0x188 */ Vec3s jointTable[10]; - /* 0x1C4 */ Vec3s morphTable[10]; + /* 0x188 */ Vec3s jointTable[GYORG_SMALL_FISH_LIMB_MAX]; + /* 0x1C4 */ Vec3s morphTable[GYORG_SMALL_FISH_LIMB_MAX]; /* 0x200 */ s16 timer; /* 0x202 */ u8 isNonHostile; // If true, the fish will not move towards the player to attack them /* 0x203 */ u8 isBeached; // If true, the fish is on the central platform flopping around @@ -48,8 +44,8 @@ typedef struct EnTanron3 { /* 0x248 */ Vec3s targetShapeRotation; /* 0x250 */ s32 currentRotationAngle; /* 0x254 */ s32 nextRotationAngle; - /* 0x258 */ s16 tailRotation; - /* 0x25A */ s16 trunkRotation; + /* 0x258 */ s16 trunkRotation; + /* 0x25A */ s16 tailRotation; /* 0x25C */ s16 bodyRotation; /* 0x260 */ ColliderCylinder atCollider; /* 0x2AC */ ColliderCylinder acCollider; diff --git a/src/overlays/actors/ovl_En_Test5/z_en_test5.c b/src/overlays/actors/ovl_En_Test5/z_en_test5.c index 0360af927..81e92103b 100644 --- a/src/overlays/actors/ovl_En_Test5/z_en_test5.c +++ b/src/overlays/actors/ovl_En_Test5/z_en_test5.c @@ -33,10 +33,10 @@ void EnTest5_SetupAction(EnTest5* this, EnTest5ActionFunc actionFunc) { } void EnTest5_Init(Actor* thisx, GlobalContext* globalCtx2) { - EnTest5* this = THIS; GlobalContext* globalCtx = globalCtx2; + EnTest5* this = THIS; WaterBox* water; - f32 ySurface; // Unused + f32 ySurface; // If not spawned above a water source, immediately despawn if (!WaterBox_GetSurface1(globalCtx, &globalCtx->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, @@ -80,11 +80,11 @@ void EnTest5_HandleBottleAction(EnTest5* this, GlobalContext* globalCtx) { } void EnTest5_Update(Actor* thisx, GlobalContext* globalCtx2) { - EnTest5* this = THIS; GlobalContext* globalCtx = globalCtx2; + EnTest5* this = THIS; Vec3f steamPos; - CollisionPoly* poly; // Unused - s32 pad; // Unused + CollisionPoly* poly; + s32 pad; this->actionFunc(this, globalCtx); diff --git a/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c b/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c index 4eb4c7623..6e626b752 100644 --- a/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c +++ b/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c @@ -5,6 +5,7 @@ */ #include "z_en_thiefbird.h" +#include "objects/object_thiefbird/object_thiefbird.h" #define FLAGS 0x80001205 @@ -32,19 +33,6 @@ void func_80C126D8(EnThiefbird* this, GlobalContext* globalCtx); void func_80C12744(EnThiefbird* this); void func_80C127F4(EnThiefbird* this, GlobalContext* globalCtx); -extern AnimationHeader D_06000088; -extern AnimationHeader D_06000278; -extern AnimationHeader D_06000604; -extern Gfx D_06003060[]; -extern Gfx D_060030D8[]; -extern Gfx D_060033B0[]; -extern Gfx D_06003D58[]; -extern Gfx D_06004348[]; -extern Gfx D_06004B88[]; -extern Gfx D_060055E0[]; -extern FlexSkeletonHeader D_060061A0; -extern AnimationHeader D_060063C4; - const ActorInit En_Thiefbird_InitVars = { ACTOR_EN_THIEFBIRD, ACTORCAT_ENEMY, @@ -162,7 +150,8 @@ void EnThiefbird_Init(Actor* thisx, GlobalContext* globalCtx) { ColliderJntSphElementDim* dim; Actor_ProcessInitChain(&this->actor, sInitChain); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060061A0, &D_06000604, this->jointTable, this->morphTable, 17); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_thiefbird_Skel_0061A0, &object_thiefbird_Anim_000604, + this->jointTable, this->morphTable, 17); Collider_InitAndSetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, this->colliderElements); for (i = 0; i < ARRAY_COUNT(this->colliderElements); i++) { @@ -217,7 +206,7 @@ void func_80C10984(EnThiefbird* this, s32 arg1) { } s32 func_80C10B0C(EnThiefbird* this, GlobalContext* globalCtx) { - static Gfx* D_80C13680[] = { D_06004348, D_06004B88, D_060055E0 }; + static Gfx* D_80C13680[] = { object_thiefbird_DL_004348, object_thiefbird_DL_004B88, object_thiefbird_DL_0055E0 }; s32 isItemFound = false; s32 phi_a3 = 0; s32 slotId = SLOT_BOTTLE_1; @@ -250,7 +239,7 @@ s32 func_80C10B0C(EnThiefbird* this, GlobalContext* globalCtx) { if (isItemFound) { Inventory_DeleteItem(itemId2, slotId); - this->unk_3E8 = D_060033B0; + this->unk_3E8 = object_thiefbird_DL_0033B0; if (!Message_GetState(&globalCtx->msgCtx)) { func_801518B0(globalCtx, 0xF4, NULL); } @@ -267,7 +256,7 @@ s32 func_80C10B0C(EnThiefbird* this, GlobalContext* globalCtx) { itemId1 = phi_a3 + (ITEM_SWORD_KOKIRI - 1); if (phi_a3 == 4) { Inventory_DeleteItem(ITEM_SWORD_GREAT_FAIRY, SLOT_SWORD_GREAT_FAIRY); - this->unk_3E8 = D_06003D58; + this->unk_3E8 = object_thiefbird_DL_003D58; itemId1 = ITEM_SWORD_GREAT_FAIRY; } else { CUR_FORM_EQUIP(EQUIP_SLOT_B) = ITEM_NONE; @@ -473,7 +462,7 @@ void func_80C114C0(EnThiefbird* this, GlobalContext* globalCtx) { } void func_80C11538(EnThiefbird* this) { - Animation_MorphToLoop(&this->skelAnime, &D_06000604, -4.0f); + Animation_MorphToLoop(&this->skelAnime, &object_thiefbird_Anim_000604, -4.0f); this->unk_18E = 60; this->collider.base.acFlags |= AC_ON; this->actionFunc = func_80C11590; @@ -537,7 +526,7 @@ void func_80C11590(EnThiefbird* this, GlobalContext* globalCtx) { } void func_80C118E4(EnThiefbird* this) { - Animation_MorphToLoop(&this->skelAnime, &D_060063C4, -10.0f); + Animation_MorphToLoop(&this->skelAnime, &object_thiefbird_Anim_0063C4, -10.0f); this->unk_18E = 300; this->actionFunc = func_80C1193C; this->actor.speedXZ = 5.0f; @@ -604,7 +593,7 @@ void func_80C1193C(EnThiefbird* this, GlobalContext* globalCtx) { void func_80C11C60(EnThiefbird* this) { this->actor.speedXZ = 0.0f; this->actor.velocity.y = 0.0f; - Animation_PlayOnce(&this->skelAnime, &D_06000088); + Animation_PlayOnce(&this->skelAnime, &object_thiefbird_Anim_000088); this->actor.bgCheckFlags &= ~1; this->actor.shape.rot.x = 0; this->unk_18E = 40; @@ -676,7 +665,7 @@ void func_80C11DF0(EnThiefbird* this, GlobalContext* globalCtx) { } void func_80C11F6C(EnThiefbird* this, GlobalContext* globalCtx) { - Animation_MorphToLoop(&this->skelAnime, &D_06000278, -4.0f); + Animation_MorphToLoop(&this->skelAnime, &object_thiefbird_Anim_000278, -4.0f); func_80C10984(this, 15); if (this->actor.colChkInfo.damageEffect != 3) { this->actor.speedXZ = 4.0f; @@ -760,7 +749,7 @@ void func_80C1215C(EnThiefbird* this, GlobalContext* globalCtx) { } void func_80C12308(EnThiefbird* this) { - Animation_MorphToLoop(&this->skelAnime, &D_06000278, -4.0f); + Animation_MorphToLoop(&this->skelAnime, &object_thiefbird_Anim_000278, -4.0f); func_80C10984(this, 15); this->unk_190 = -0x1000; this->unk_192 = BINANG_ROT180(this->actor.yawTowardsPlayer); @@ -789,7 +778,7 @@ void func_80C12378(EnThiefbird* this, GlobalContext* globalCtx) { } void func_80C1242C(EnThiefbird* this) { - Animation_Change(&this->skelAnime, &D_06000278, 2.0f, 0.0f, 0.0f, 0, -4.0f); + Animation_Change(&this->skelAnime, &object_thiefbird_Anim_000278, 2.0f, 0.0f, 0.0f, 0, -4.0f); this->actor.flags |= 0x10; this->collider.base.acFlags |= AC_ON; this->actionFunc = func_80C124B0; @@ -849,8 +838,8 @@ void func_80C126D8(EnThiefbird* this, GlobalContext* globalCtx) { } void func_80C12744(EnThiefbird* this) { - Animation_MorphToLoop(&this->skelAnime, &D_06000604, -4.0f); - Animation_Change(&this->skelAnime, &D_06000604, 1.0f, 0.0f, 0.0f, 1, -4.0f); + Animation_MorphToLoop(&this->skelAnime, &object_thiefbird_Anim_000604, -4.0f); + Animation_Change(&this->skelAnime, &object_thiefbird_Anim_000604, 1.0f, 0.0f, 0.0f, 1, -4.0f); this->unk_190 = 0; this->collider.base.acFlags |= AC_ON; this->actor.flags |= 0x10; @@ -1009,8 +998,8 @@ void func_80C12D00(EnThiefbird* this) { } void EnThiefbird_Update(Actor* thisx, GlobalContext* globalCtx2) { - EnThiefbird* this = THIS; GlobalContext* globalCtx = globalCtx2; + EnThiefbird* this = THIS; func_80C12B1C(this, globalCtx); this->actionFunc(this, globalCtx); @@ -1043,8 +1032,8 @@ void EnThiefbird_Update(Actor* thisx, GlobalContext* globalCtx2) { } func_80C12D00(this); - if (((this->skelAnime.animation == &D_06000604) && Animation_OnFrame(&this->skelAnime, 13.0f)) || - ((this->skelAnime.animation == &D_06000278) && Animation_OnFrame(&this->skelAnime, 1.0f))) { + if (((this->skelAnime.animation == &object_thiefbird_Anim_000604) && Animation_OnFrame(&this->skelAnime, 13.0f)) || + ((this->skelAnime.animation == &object_thiefbird_Anim_000278) && Animation_OnFrame(&this->skelAnime, 1.0f))) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KAICHO_FLUTTER); } } @@ -1089,7 +1078,7 @@ void EnThiefbird_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dLi if (this->unk_3E8 != NULL) { OPEN_DISPS(globalCtx->state.gfxCtx); - if (this->unk_3E8 == D_060033B0) { + if (this->unk_3E8 == object_thiefbird_DL_0033B0) { gfx = POLY_XLU_DISP; } else { gfx = POLY_OPA_DISP; @@ -1098,7 +1087,7 @@ void EnThiefbird_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dLi gSPMatrix(&gfx[0], Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(&gfx[1], this->unk_3E8); - if (this->unk_3E8 == D_060033B0) { + if (this->unk_3E8 == object_thiefbird_DL_0033B0) { POLY_XLU_DISP = &gfx[2]; } else { POLY_OPA_DISP = &gfx[2]; @@ -1131,7 +1120,7 @@ void func_80C13354(EnThiefbird* this, GlobalContext* globalCtx2) { gfx = POLY_OPA_DISP; gSPDisplayList(&gfx[0], &sSetupDL[6 * 25]); - gSPDisplayList(&gfx[1], D_06003060); + gSPDisplayList(&gfx[1], object_thiefbird_DL_003060); gfx = &gfx[2]; for (i = 0; i < ARRAY_COUNT(this->unk_3F0); i++, ptr++) { @@ -1144,7 +1133,7 @@ void func_80C13354(EnThiefbird* this, GlobalContext* globalCtx2) { Matrix_Scale(ptr->unk_18, ptr->unk_18, 1.0f, MTXMODE_APPLY); gSPMatrix(&gfx[0], Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(&gfx[1], D_060030D8); + gSPDisplayList(&gfx[1], object_thiefbird_DL_0030D8); gfx = &gfx[2]; } } diff --git a/src/overlays/actors/ovl_En_Tite/z_en_tite.c b/src/overlays/actors/ovl_En_Tite/z_en_tite.c index 5afdd500f..ba37818aa 100644 --- a/src/overlays/actors/ovl_En_Tite/z_en_tite.c +++ b/src/overlays/actors/ovl_En_Tite/z_en_tite.c @@ -5,6 +5,7 @@ */ #include "z_en_tite.h" +#include "objects/object_tite/object_tite.h" #define FLAGS 0x00000205 @@ -45,20 +46,6 @@ void func_80895CB0(EnTite* this); void func_80895D08(EnTite* this, GlobalContext* globalCtx); void func_80895E28(EnTite* this, GlobalContext* globalCtx); -extern AnimationHeader D_060004F8; -extern AnimationHeader D_0600069C; -extern AnimationHeader D_0600083C; -extern AnimationHeader D_06000A14; -extern AnimationHeader D_06000C70; -extern AnimationHeader D_060012E4; -extern SkeletonHeader D_06003A20; -extern UNK_PTR D_06001300; -extern UNK_PTR D_06001700; -extern UNK_PTR D_06001900; -extern UNK_PTR D_06001B00; -extern UNK_PTR D_06001F00; -extern UNK_PTR D_06002100; - const ActorInit En_Tite_InitVars = { ACTOR_EN_TITE, ACTORCAT_ENEMY, @@ -128,9 +115,9 @@ static DamageTable sDamageTable = { static CollisionCheckInfoInit sColChkInfoInit = { 2, 40, 40, MASS_HEAVY }; -static UNK_PTR D_80896B24[2][3] = { - { &D_06001300, &D_06001700, &D_06001900 }, - { &D_06001B00, &D_06001F00, &D_06002100 }, +static TexturePtr D_80896B24[2][3] = { + { object_tite_Tex_001300, object_tite_Tex_001700, object_tite_Tex_001900 }, + { object_tite_Tex_001B00, object_tite_Tex_001F00, object_tite_Tex_002100 }, }; static Color_RGBA8 D_80896B3C = { 250, 250, 250, 255 }; @@ -153,7 +140,8 @@ void EnTite_Init(Actor* thisx, GlobalContext* globalCtx) { s32 j; Actor_ProcessInitChain(&this->actor, sInitChain); - SkelAnime_Init(globalCtx, &this->skelAnime, &D_06003A20, &D_060012E4, this->jointTable, this->morphTable, 25); + SkelAnime_Init(globalCtx, &this->skelAnime, &object_tite_Skel_003A20, &object_tite_Anim_0012E4, this->jointTable, + this->morphTable, 25); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 60.0f); Actor_SetFocus(&this->actor, 20.0f); CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); @@ -297,7 +285,7 @@ void func_80893E54(EnTite* this, GlobalContext* globalCtx) { } void func_80893ED4(EnTite* this) { - Animation_MorphToLoop(&this->skelAnime, &D_060012E4, 4.0f); + Animation_MorphToLoop(&this->skelAnime, &object_tite_Anim_0012E4, 4.0f); this->unk_2BC = Rand_S16Offset(15, 30); this->actor.speedXZ = 0.0f; this->actionFunc = func_80893F30; @@ -315,7 +303,7 @@ void func_80893F30(EnTite* this, GlobalContext* globalCtx) { } void func_80893FD0(EnTite* this) { - Animation_PlayOnce(&this->skelAnime, &D_0600083C); + Animation_PlayOnce(&this->skelAnime, &object_tite_Anim_00083C); this->actor.velocity.y = 0.0f; this->actor.speedXZ = 0.0f; this->actor.world.rot.y = this->actor.shape.rot.y; @@ -333,7 +321,7 @@ void func_80894024(EnTite* this, GlobalContext* globalCtx) { } void func_8089408C(EnTite* this, GlobalContext* globalCtx) { - Animation_PlayOnce(&this->skelAnime, &D_060004F8); + Animation_PlayOnce(&this->skelAnime, &object_tite_Anim_0004F8); if (!func_80893ADC(this)) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_TEKU_JUMP); } else { @@ -403,7 +391,7 @@ void func_808942B4(EnTite* this, GlobalContext* globalCtx) { } void func_80894414(EnTite* this) { - Animation_PlayOnce(&this->skelAnime, &D_0600069C); + Animation_PlayOnce(&this->skelAnime, &object_tite_Anim_00069C); this->actionFunc = func_80894454; } @@ -441,7 +429,7 @@ void func_808945B4(EnTite* this, GlobalContext* globalCtx) { } void func_808945EC(EnTite* this) { - Animation_PlayLoop(&this->skelAnime, &D_06000A14); + Animation_PlayLoop(&this->skelAnime, &object_tite_Anim_000A14); this->actor.speedXZ = 0.0f; this->actor.velocity.y = 0.0f; this->actionFunc = func_80894638; @@ -486,7 +474,7 @@ void func_80894638(EnTite* this, GlobalContext* globalCtx) { } void func_8089484C(EnTite* this) { - Animation_MorphToPlayOnce(&this->skelAnime, &D_06000C70, -3.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &object_tite_Anim_000C70, -3.0f); if (this->actionFunc != func_80894910) { this->unk_2B8 = Rand_S16Offset(1, 3); } @@ -547,7 +535,7 @@ void func_80894910(EnTite* this, GlobalContext* globalCtx) { } void func_80894B2C(EnTite* this) { - Animation_MorphToLoop(&this->skelAnime, &D_060012E4, 4.0f); + Animation_MorphToLoop(&this->skelAnime, &object_tite_Anim_0012E4, 4.0f); this->actor.speedXZ = -6.0f; this->actor.gravity = -1.0f; if (this->collider.base.ac != NULL) { @@ -690,7 +678,7 @@ void func_808951B8(EnTite* this, GlobalContext* globalCtx) { } void func_808952EC(EnTite* this) { - Animation_PlayLoopSetSpeed(&this->skelAnime, &D_06000A14, 1.5f); + Animation_PlayLoopSetSpeed(&this->skelAnime, &object_tite_Anim_000A14, 1.5f); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST1_GROW_HEAD); this->collider.base.acFlags &= ~AC_ON; func_80893A18(this); @@ -823,7 +811,7 @@ void func_80895A10(EnTite* this) { s32 pad; s16 rand; - Animation_Change(&this->skelAnime, &D_06000A14, 2.0f, 0.0f, 0.0f, 0, 4.0f); + Animation_Change(&this->skelAnime, &object_tite_Anim_000A14, 2.0f, 0.0f, 0.0f, 0, 4.0f); this->actor.speedXZ = 0.0f; rand = Rand_S16Offset(20, 20); this->unk_2BC = ((Rand_ZeroOne() < 0.5f) ? -1 : 1) * rand; diff --git a/src/overlays/actors/ovl_En_Tk/z_en_tk.c b/src/overlays/actors/ovl_En_Tk/z_en_tk.c index fb24138a8..137012525 100644 --- a/src/overlays/actors/ovl_En_Tk/z_en_tk.c +++ b/src/overlays/actors/ovl_En_Tk/z_en_tk.c @@ -7,6 +7,7 @@ #include "z_en_tk.h" #include "overlays/actors/ovl_Bg_Danpei_Movebg/z_bg_danpei_movebg.h" #include "overlays/actors/ovl_En_Door/z_en_door.h" +#include "objects/object_tk/object_tk.h" #define FLAGS 0x00000009 @@ -59,19 +60,6 @@ void func_80AEF2C8(Actor* thisx, GlobalContext* globalCtx); void func_80AEF2D8(Actor* thisx, GlobalContext* globalCtx); void func_80AEF5F4(Actor* thisx, GlobalContext* globalCtx); -extern AnimationHeader D_06001144; -extern AnimationHeader D_06001FA8; -extern AnimationHeader D_060020C8; -extern AnimationHeader D_060030A4; -extern AnimationHeader D_06003724; -extern AnimationHeader D_06003B10; -extern AnimationHeader D_06003FB8; -extern UNK_PTR D_06004390; -extern UNK_PTR D_06004B90; -extern UNK_PTR D_06005390; -extern Gfx D_0600B530[]; -extern FlexSkeletonHeader D_0600B9E8; - static s32 D_80AF0050; static u32 D_80AEF800[] = { @@ -121,9 +109,10 @@ static u32 D_80AEF85C[] = { }; static struct_80B8E1A8 D_80AEF868[] = { - { &D_06001FA8, 1.0f, 0, -10.0f }, { &D_06001FA8, 2.0f, 0, -10.0f }, { &D_060030A4, 1.0f, 0, -10.0f }, - { &D_06001144, 1.0f, 2, -10.0f }, { &D_06003724, 1.0f, 2, -10.0f }, { &D_06003FB8, 1.0f, 0, -10.0f }, - { &D_060020C8, 1.0f, 0, -10.0f }, { &D_06003B10, 1.0f, 0, -10.0f }, + { &object_tk_Anim_001FA8, 1.0f, 0, -10.0f }, { &object_tk_Anim_001FA8, 2.0f, 0, -10.0f }, + { &object_tk_Anim_0030A4, 1.0f, 0, -10.0f }, { &object_tk_Anim_001144, 1.0f, 2, -10.0f }, + { &object_tk_Anim_003724, 1.0f, 2, -10.0f }, { &object_tk_Anim_003FB8, 1.0f, 0, -10.0f }, + { &object_tk_Anim_0020C8, 1.0f, 0, -10.0f }, { &object_tk_Anim_003B10, 1.0f, 0, -10.0f }, }; static s32 D_80AEF8E8[2] = { 0, 0 }; @@ -236,8 +225,10 @@ void EnTk_Init(Actor* thisx, GlobalContext* globalCtx) { } ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f); - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600B9E8, NULL, this->jointTable, this->morphTable, 18); - Animation_Change(&this->skelAnime, &D_060030A4, 1.0f, 0.0f, Animation_GetLastFrame(&D_060030A4.common), 0, 0.0f); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_tk_Skel_00B9E8, NULL, this->jointTable, this->morphTable, + 18); + Animation_Change(&this->skelAnime, &object_tk_Anim_0030A4, 1.0f, 0.0f, + Animation_GetLastFrame(&object_tk_Anim_0030A4.common), 0, 0.0f); this->unk_318 = 0; this->unk_2D4 = -1; Actor_SetScale(&this->actor, 0.01f); @@ -1369,7 +1360,7 @@ void EnTk_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec OPEN_DISPS(globalCtx->state.gfxCtx); - gSPDisplayList(POLY_OPA_DISP++, D_0600B530); + gSPDisplayList(POLY_OPA_DISP++, object_tk_DL_00B530); CLOSE_DISPS(globalCtx->state.gfxCtx); break; @@ -1378,10 +1369,10 @@ void EnTk_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec } void EnTk_Draw(Actor* thisx, GlobalContext* globalCtx) { - static UNK_PTR D_80AEFA90[] = { - &D_06004390, - &D_06004B90, - &D_06005390, + static TexturePtr D_80AEFA90[] = { + object_tk_Tex_004390, + object_tk_Tex_004B90, + object_tk_Tex_005390, }; s32 pad; EnTk* this = THIS; diff --git a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c index 9f0ce13f8..50ff93937 100644 --- a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c +++ b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c @@ -5,6 +5,8 @@ */ #include "z_en_torch2.h" +#include "objects/gameplay_keep/gameplay_keep.h" + #define FLAGS 0x00000010 #define THIS ((EnTorch2*)thisx) @@ -43,11 +45,11 @@ static InitChainEntry sInitChain[] = { // Shells for each of Link's different forms // (Playing elegy as Fierce Deity puts down a human shell) static Gfx* sShellDLists[] = { - D_0401C430, // Human - D_04048DF0, // Zora - D_04089070, // Deku - D_04057B10, // Goron - D_0401C430, // Human + gameplay_keep_DL_01C430, // Human + gameplay_keep_DL_048DF0, // Zora + gameplay_keep_DL_089070, // Deku + gameplay_keep_DL_057B10, // Goron + gameplay_keep_DL_01C430, // Human }; void EnTorch2_Init(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_En_Toto/z_en_toto.c b/src/overlays/actors/ovl_En_Toto/z_en_toto.c index c6db674d5..8ca0e45dd 100644 --- a/src/overlays/actors/ovl_En_Toto/z_en_toto.c +++ b/src/overlays/actors/ovl_En_Toto/z_en_toto.c @@ -5,6 +5,7 @@ */ #include "z_en_toto.h" +#include "objects/object_zm/object_zm.h" #define FLAGS 0x00000009 @@ -61,23 +62,6 @@ const ActorInit En_Toto_InitVars = { (ActorFunc)EnToto_Draw, }; -extern AnimationHeader D_06000C80; -extern AnimationHeader D_06001324; -extern AnimationHeader D_060016A4; -extern AnimationHeader D_06001DF0; -extern AnimationHeader D_060022C8; -extern AnimationHeader D_060028B8; -extern AnimationHeader D_06002F20; -extern AnimationHeader D_06003AA8; -extern UNK_TYPE D_06008AE8; -extern UNK_TYPE D_0600A068; -extern UNK_TYPE D_0600A468; -extern FlexSkeletonHeader D_0600A978; -extern AnimationHeader D_0600B3E0; -extern AnimationHeader D_0600B894; -extern AnimationHeader D_0600BC08; -extern AnimationHeader D_0600C880; - static ColliderCylinderInit sCylinderInit = { { COLTYPE_METAL, @@ -142,7 +126,8 @@ static EnTotoText D_80BA5074[] = { { 4, 0, 0x2AE4 }, }; -static AnimationHeader* D_80BA5078[] = { &D_060028B8, &D_0600B894, &D_06002F20, &D_0600BC08 }; +static AnimationHeader* D_80BA5078[] = { &object_zm_Anim_0028B8, &object_zm_Anim_00B894, &object_zm_Anim_002F20, + &object_zm_Anim_00BC08 }; static EnTotoText D_80BA5088[] = { { 5, 0, 0 }, { 6, 20, 0 }, { 7, 0, 0 }, { 8, 9, 0 }, { 9, 10, 0 }, { 1, 0, 0 }, { 10, 0, 0 }, @@ -205,9 +190,9 @@ void EnToto_Init(Actor* thisx, GlobalContext* globalCtx) { } ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); this->actor.bgCheckFlags |= 0x400; - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600A978, - ((globalCtx->sceneNum == 0x12) ? &D_06003AA8 : &D_0600C880), this->jointTable, this->morphTable, - 18); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_zm_Skel_00A978, + ((globalCtx->sceneNum == 0x12) ? &object_zm_Anim_003AA8 : &object_zm_Anim_00C880), + this->jointTable, this->morphTable, 18); func_80BA36C0(this, globalCtx, 0); this->actor.shape.rot.x = 0; } @@ -219,7 +204,8 @@ void EnToto_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void func_80BA383C(EnToto* this, GlobalContext* globalCtx) { - if (SkelAnime_Update(&this->skelAnime) && this->actionFuncIndex == 1 && this->skelAnime.animation != &D_06000C80) { + if (SkelAnime_Update(&this->skelAnime) && this->actionFuncIndex == 1 && + this->skelAnime.animation != &object_zm_Anim_000C80) { if (globalCtx->msgCtx.unk11F04 != 0x2A98 && globalCtx->msgCtx.unk11F04 != 0x2A99) { if (this->unk2B4 & 1 || Rand_ZeroOne() > 0.5f) { this->unk2B4 = (this->unk2B4 + 1) & 3; @@ -231,10 +217,10 @@ void func_80BA383C(EnToto* this, GlobalContext* globalCtx) { } void func_80BA3930(EnToto* this, GlobalContext* globalCtx) { - AnimationHeader* animationHeader = &D_0600C880; + AnimationHeader* animationHeader = &object_zm_Anim_00C880; if (globalCtx->sceneNum == 0x12) { - animationHeader = &D_06003AA8; + animationHeader = &object_zm_Anim_003AA8; } Animation_MorphToLoop(&this->skelAnime, animationHeader, -4.0f); } @@ -298,13 +284,13 @@ void func_80BA39C8(EnToto* this, GlobalContext* globalCtx) { void func_80BA3BFC(EnToto* this, GlobalContext* globalCtx) { if (globalCtx->sceneNum == 0x12) { - Animation_MorphToPlayOnce(&this->skelAnime, &D_06000C80, -4.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &object_zm_Anim_000C80, -4.0f); this->unk2B4 = 0; } else { if (this->text->unk0 == 4) { func_80151BB4(globalCtx, 9); } - Animation_MorphToLoop(&this->skelAnime, &D_0600B3E0, -4.0f); + Animation_MorphToLoop(&this->skelAnime, &object_zm_Anim_00B3E0, -4.0f); } } @@ -652,7 +638,7 @@ s32 func_80BA4B24(EnToto* this, GlobalContext* globalCtx) { if (func_80BA40D4(this, globalCtx)) { player = GET_PLAYER(globalCtx); - Animation_MorphToPlayOnce(&this->skelAnime, &D_060028B8, -4.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &object_zm_Anim_0028B8, -4.0f); if (player->transformation == PLAYER_FORM_ZORA) { if (!Flags_GetSwitch(globalCtx, this->actor.params & 0x7F)) { Flags_SetSwitch(globalCtx, this->actor.params & 0x7F); @@ -695,9 +681,10 @@ void func_80BA4CB4(EnToto* this, GlobalContext* globalCtx) { this->unk2B5 = action->unk0; if (this->unk2B5 != 4) { if (this->unk2B5 == 3) { - Animation_MorphToPlayOnce(&this->skelAnime, &D_06001DF0, -4.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &object_zm_Anim_001DF0, -4.0f); } else { - Animation_PlayOnce(&this->skelAnime, this->unk2B5 == 1 ? &D_060016A4 : &D_060022C8); + Animation_PlayOnce(&this->skelAnime, + this->unk2B5 == 1 ? &object_zm_Anim_0016A4 : &object_zm_Anim_0022C8); if (this->unk2B5 == 2 && this->unk2B3 != 0xF) { func_80151BB4(globalCtx, 9); func_80151BB4(globalCtx, 10); @@ -708,7 +695,7 @@ void func_80BA4CB4(EnToto* this, GlobalContext* globalCtx) { Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, 0x320); if (SkelAnime_Update(&this->skelAnime)) { if (this->unk2B5 != 3) { - Animation_PlayLoop(&this->skelAnime, this->unk2B5 == 1 ? &D_0600C880 : &D_06001324); + Animation_PlayLoop(&this->skelAnime, this->unk2B5 == 1 ? &object_zm_Anim_00C880 : &object_zm_Anim_001324); } } if (this->unk2B5 == 4 && !Actor_HasParent(&this->actor, globalCtx)) { @@ -734,7 +721,7 @@ void EnToto_Update(Actor* thisx, GlobalContext* globalCtx) { } void EnToto_Draw(Actor* thisx, GlobalContext* globalCtx) { - void* sp4C[] = { &D_06008AE8, &D_0600A068, &D_0600A468 }; + TexturePtr sp4C[] = { object_zm_Tex_008AE8, object_zm_Tex_00A068, object_zm_Tex_00A468 }; EnToto* this = THIS; s32 pad; diff --git a/src/overlays/actors/ovl_En_Trt/z_en_trt.c b/src/overlays/actors/ovl_En_Trt/z_en_trt.c index 126a0abdf..e644b7322 100644 --- a/src/overlays/actors/ovl_En_Trt/z_en_trt.c +++ b/src/overlays/actors/ovl_En_Trt/z_en_trt.c @@ -5,6 +5,8 @@ */ #include "z_en_trt.h" +#include "objects/object_trt/object_trt.h" +#include "objects/gameplay_keep/gameplay_keep.h" #define FLAGS 0x00000009 @@ -62,29 +64,12 @@ void EnTrt_Blink(EnTrt* this); void EnTrt_OpenEyes2(EnTrt* this); void EnTrt_NodOff(EnTrt* this); -extern UNK_TYPE D_0401F740; -extern UNK_TYPE D_0401F8C0; -extern UNK_TYPE D_0401F7C0; -extern FlexSkeletonHeader D_0600FEF0; -extern AnimationHeader D_0600FD34; -extern AnimationHeader D_0600DE68; -extern AnimationHeader D_06002224; -extern AnimationHeader D_06001EF4; -extern AnimationHeader D_060030EC; -extern AnimationHeader D_0600D52C; -extern AnimationHeader D_06002CB0; -extern AnimationHeader D_0600EE98; -extern AnimationHeader D_06003D78; -extern AnimationHeader D_06000A44; -extern TexturePtr D_0600B0B8; -extern TexturePtr D_0600B8B8; -extern TexturePtr D_0600C0B8; - static ActorAnimationEntryS sAnimations[] = { - { &D_0600DE68, 1.0f, 0, -1, 2, 0 }, { &D_0600EE98, 1.0f, 0, -1, 2, 0 }, { &D_0600FD34, 1.0f, 0, -1, 0, 0 }, - { &D_060030EC, 1.0f, 0, -1, 2, 0 }, { &D_06003D78, 1.0f, 0, -1, 2, 0 }, { &D_0600D52C, 1.0f, 0, -1, 0, 0 }, - { &D_06000A44, 1.0f, 0, -1, 0, 0 }, { &D_06001EF4, 1.0f, 0, -1, 0, 0 }, { &D_06002224, 1.0f, 0, -1, 0, 0 }, - { &D_06002CB0, 1.0f, 0, -1, 0, 0 }, + { &object_trt_Anim_00DE68, 1.0f, 0, -1, 2, 0 }, { &object_trt_Anim_00EE98, 1.0f, 0, -1, 2, 0 }, + { &object_trt_Anim_00FD34, 1.0f, 0, -1, 0, 0 }, { &object_trt_Anim_0030EC, 1.0f, 0, -1, 2, 0 }, + { &object_trt_Anim_003D78, 1.0f, 0, -1, 2, 0 }, { &object_trt_Anim_00D52C, 1.0f, 0, -1, 0, 0 }, + { &object_trt_Anim_000A44, 1.0f, 0, -1, 0, 0 }, { &object_trt_Anim_001EF4, 1.0f, 0, -1, 0, 0 }, + { &object_trt_Anim_002224, 1.0f, 0, -1, 0, 0 }, { &object_trt_Anim_002CB0, 1.0f, 0, -1, 0, 0 }, }; const ActorInit En_Trt_InitVars = { @@ -852,7 +837,7 @@ void EnTrt_IdleAwake(EnTrt* this, GlobalContext* globalCtx) { void EnTrt_BeginInteraction(EnTrt* this, GlobalContext* globalCtx) { s16 curFrame = this->skelAnime.curFrame / this->skelAnime.playSpeed; - s16 animLastFrame = Animation_GetLastFrame(&D_060030EC) / (s16)this->skelAnime.playSpeed; + s16 animLastFrame = Animation_GetLastFrame(&object_trt_Anim_0030EC) / (s16)this->skelAnime.playSpeed; if (this->cutsceneState == ENTRT_CUTSCENESTATE_WAITING) { if (ActorCutscene_GetCanPlayNext(this->cutscene)) { @@ -1452,7 +1437,7 @@ void EnTrt_LookToShopkeeperFromShelf(EnTrt* this, GlobalContext* globalCtx) { } void EnTrt_InitShopkeeper(EnTrt* this, GlobalContext* globalCtx) { - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600FEF0, &D_0600FD34, NULL, NULL, 0); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_trt_Skel_00FEF0, &object_trt_Anim_00FD34, NULL, NULL, 0); if (!(gSaveContext.save.weekEventReg[0xC] & 8) && !(gSaveContext.save.weekEventReg[0x54] & 0x40) && gSaveContext.save.day >= 2) { this->actor.draw = NULL; @@ -1566,8 +1551,8 @@ void EnTrt_DrawCursor(GlobalContext* globalCtx, EnTrt* this, f32 x, f32 y, f32 z func_8012C654(globalCtx->state.gfxCtx); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, this->cursorColor.r, this->cursorColor.g, this->cursorColor.b, this->cursorColor.a); - gDPLoadTextureBlock_4b(OVERLAY_DISP++, &D_0401F740, G_IM_FMT_IA, 16, 16, 0, G_TX_MIRROR | G_TX_WRAP, - G_TX_MIRROR | G_TX_WRAP, 4, 4, G_TX_NOLOD, G_TX_NOLOD); + gDPLoadTextureBlock_4b(OVERLAY_DISP++, gameplay_keep_Tex_01F740, G_IM_FMT_IA, 16, 16, 0, + G_TX_MIRROR | G_TX_WRAP, G_TX_MIRROR | G_TX_WRAP, 4, 4, G_TX_NOLOD, G_TX_NOLOD); w = 16.0f * z; ulx = (x - w) * 4.0f; uly = (y - w + -12.0f) * 4.0f; @@ -1618,7 +1603,7 @@ void EnTrt_DrawStickDirectionPrompt(GlobalContext* globalCtx, EnTrt* this) { if (drawStickRightPrompt || drawStickLeftPrompt) { func_8012C654(globalCtx->state.gfxCtx); gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); - gDPSetTextureImage(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, &D_0401F8C0); + gDPSetTextureImage(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, gameplay_keep_Tex_01F8C0); gDPSetTile(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 4, G_TX_NOLOD); gDPLoadSync(OVERLAY_DISP++); @@ -1639,7 +1624,7 @@ void EnTrt_DrawStickDirectionPrompt(GlobalContext* globalCtx, EnTrt* this) { this->stickRightPrompt.arrowTexX, this->stickRightPrompt.arrowTexY, this->stickRightPrompt.texZ, 0, 0, 1.0f, 1.0f); } - gDPSetTextureImage(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, &D_0401F7C0); + gDPSetTextureImage(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, gameplay_keep_Tex_01F7C0); gDPSetTile(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 4, G_TX_NOLOD); gDPLoadSync(OVERLAY_DISP++); @@ -1782,7 +1767,7 @@ void EnTrt_TransformLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thi } void EnTrt_Draw(Actor* thisx, GlobalContext* globalCtx) { - static TexturePtr sEyeTextures[] = { &D_0600B0B8, &D_0600B8B8, &D_0600C0B8 }; + static TexturePtr sEyeTextures[] = { object_trt_Tex_00B0B8, object_trt_Tex_00B8B8, object_trt_Tex_00C0B8 }; EnTrt* this = THIS; s32 pad; diff --git a/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c b/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c index e74a5dd4d..296341f20 100644 --- a/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c +++ b/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c @@ -5,8 +5,9 @@ */ #include "z_en_trt2.h" +#include "objects/object_trt/object_trt.h" -#define FLAGS 0x00000009 +#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8) #define THIS ((EnTrt2*)thisx) @@ -14,10 +15,25 @@ void EnTrt2_Init(Actor* thisx, GlobalContext* globalCtx); void EnTrt2_Destroy(Actor* thisx, GlobalContext* globalCtx); void EnTrt2_Update(Actor* thisx, GlobalContext* globalCtx); +void func_80AD46F8(EnTrt2* this); +s32 func_80AD475C(EnTrt2* this, Path* path, s32 arg2); +s16 func_80AD48F8(Path* path, s32 arg1, Vec3f* arg2, f32* arg3); +f32 func_80AD49B8(Path* path, s32 arg1, Vec3f* arg2, Vec3s* arg3); +void func_80AD4A78(EnTrt2* this, GlobalContext* globalCtx); +s32 func_80AD4B08(GlobalContext* globalCtx); void func_80AD4DB4(EnTrt2* this, GlobalContext* globalCtx); void func_80AD4FE4(EnTrt2* this, GlobalContext* globalCtx); +void func_80AD5234(EnTrt2* this, GlobalContext* globalCtx); +void func_80AD56E8(Actor* thisx, GlobalContext* globalCtx); + +static ActorAnimationEntryS sAnimations[] = { + { &object_trt_Anim_00DE68, 1.0f, 0, -1, 2, 0 }, { &object_trt_Anim_00EE98, 1.0f, 0, -1, 2, 0 }, + { &object_trt_Anim_00FD34, 1.0f, 0, -1, 0, 0 }, { &object_trt_Anim_0030EC, 1.0f, 0, -1, 2, 0 }, + { &object_trt_Anim_003D78, 1.0f, 0, -1, 2, 0 }, { &object_trt_Anim_00D52C, 1.0f, 0, -1, 0, 0 }, + { &object_trt_Anim_000A44, 1.0f, 0, -1, 0, 0 }, { &object_trt_Anim_001EF4, 1.0f, 0, -1, 0, 0 }, + { &object_trt_Anim_002224, 1.0f, 0, -1, 0, 0 }, { &object_trt_Anim_002CB0, 1.0f, 0, -1, 0, 0 }, +}; -#if 0 const ActorInit En_Trt2_InitVars = { ACTOR_EN_TRT2, ACTORCAT_NPC, @@ -30,18 +46,29 @@ const ActorInit En_Trt2_InitVars = { (ActorFunc)NULL, }; -// static ColliderCylinderInit sCylinderInit = { -static ColliderCylinderInit D_80AD58A0 = { - { COLTYPE_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_CYLINDER, }, - { ELEMTYPE_UNK1, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_NONE, OCELEM_ON, }, +static ColliderCylinderInit sCylinderInit = { + { + COLTYPE_NONE, + AT_NONE, + AC_NONE, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK1, + { 0x00000000, 0x00, 0x00 }, + { 0x00000000, 0x00, 0x00 }, + TOUCH_NONE | TOUCH_SFX_NORMAL, + BUMP_NONE, + OCELEM_ON, + }, { 32, 56, 30, { 0, 0, 0 } }, }; -// sColChkInfoInit -static CollisionCheckInfoInit2 D_80AD58CC = { 1, 0, 0, 0, MASS_IMMOVABLE }; +static CollisionCheckInfoInit2 sColChkInfoInit = { 1, 0, 0, 0, MASS_IMMOVABLE }; -// static DamageTable sDamageTable = { -static DamageTable D_80AD58D8 = { +static DamageTable sDamageTable = { /* Deku Nut */ DMG_ENTRY(1, 0x0), /* Deku Stick */ DMG_ENTRY(1, 0x0), /* Horse trample */ DMG_ENTRY(1, 0x0), @@ -76,111 +103,833 @@ static DamageTable D_80AD58D8 = { /* Powder Keg */ DMG_ENTRY(1, 0x0), }; -// static InitChainEntry sInitChain[] = { -static InitChainEntry D_80AD5964[] = { +void func_80AD3380(SkelAnime* skelAnime, ActorAnimationEntryS* animation, s32 arg2) { + f32 phi_f0; + + animation += arg2; + + if (animation->frameCount < 0) { + phi_f0 = Animation_GetLastFrame(animation->animationSeg); + } else { + phi_f0 = animation->frameCount; + } + Animation_Change(skelAnime, animation->animationSeg, animation->playbackSpeed, animation->frame, phi_f0, + animation->mode, animation->transitionRate); +} + +void func_80AD341C(EnTrt2* this, GlobalContext* globalCtx) { + this->collider.dim.pos.x = this->actor.world.pos.x; + this->collider.dim.pos.y = this->actor.world.pos.y; + this->collider.dim.pos.z = this->actor.world.pos.z; + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); +} + +void func_80AD349C(EnTrt2* this) { + if ((gSaveContext.save.weekEventReg[85] & 0x10) && !(gSaveContext.save.weekEventReg[84] & 0x40)) { + this->unk_3A8 = 0x88F; + } else if (this->unk_3A8 == 0) { + this->unk_3A8 = 0x84B; + } else if (gSaveContext.save.weekEventReg[16] & 0x10) { + this->unk_3A8 = 0x838; + } else if (gSaveContext.save.weekEventReg[17] & 1) { + this->unk_3A8 = 0x84D; + } else { + this->unk_3A8 = 0x849; + } +} + +void func_80AD3530(EnTrt2* this, GlobalContext* globalCtx) { + s16 phi_a1; + f32 sp30; + + func_80AD46F8(this); + if (this->path != NULL) { + phi_a1 = func_80AD48F8(this->path, this->unk_1E4, &this->actor.world.pos, &sp30); + if (this->actor.bgCheckFlags & 8) { + phi_a1 = this->actor.wallYaw; + } + Math_SmoothStepToS(&this->actor.world.rot.y, phi_a1, 4, 1000, 1); + this->actor.shape.rot.y = this->actor.world.rot.y; + if (func_80AD475C(this, this->path, this->unk_1E4)) { + if (this->unk_1E4 >= (this->path->count - 1)) { + this->unk_1E4 = 0; + } else { + this->unk_1E4++; + } + } + Math_ApproachF(&this->actor.speedXZ, 1.5f, 0.2f, 1.0f); + } + + Actor_MoveWithGravity(&this->actor); + + if (DECR(this->unk_3AE) == 0) { + this->unk_3AE = Rand_S16Offset(20, 20); + func_80AD3380(&this->skelAnime, sAnimations, 7); + this->unk_3B2 = 5; + } +} + +void func_80AD3664(EnTrt2* this, GlobalContext* globalCtx) { + if (ActorCutscene_GetCanPlayNext(this->unk_3DA)) { + ActorCutscene_StartAndSetUnkLinkFields(this->unk_3DA, &this->actor); + if (this->unk_3D9 == 0) { + this->unk_3B2 = 1; + } else { + this->unk_3B2 = 2; + } + } else { + ActorCutscene_SetIntentToPlay(this->unk_3DA); + return; + } + func_800B9010(&this->actor, NA_SE_EN_KOTAKE_FLY - SFX_FLAG); +} + +void func_80AD36EC(EnTrt2* this, GlobalContext* globalCtx) { + Vec3s sp30; + f32 sp2C; + + if (this->path != NULL) { + sp2C = func_80AD49B8(this->path, this->unk_1E4, &this->actor.world.pos, &sp30); + this->actor.shape.rot.y += 0x1000; + Math_ApproachF(&this->actor.velocity.y, 0.5f, 0.2f, 1.0f); + if (sp2C < 5.0f) { + if (this->unk_1E4 >= (this->path->count - 1)) { + this->unk_1E4 = 0; + this->unk_3D9 = 1; + this->actor.velocity.y = 0.0f; + this->path = func_8013D648(globalCtx, this->path->unk1, -1); + ActorCutscene_Stop(this->unk_3DA); + this->unk_3DA = ActorCutscene_GetAdditionalCutscene(this->unk_3DA); + ActorCutscene_SetIntentToPlay(this->unk_3DA); + this->unk_3B2 = 0; + } else { + this->unk_1E4++; + } + } + } + Actor_MoveWithGravity(&this->actor); + func_800B9010(&this->actor, NA_SE_EN_KOTAKE_FLY - SFX_FLAG); + if ((this->actor.shape.rot.y >= 0x2800) && (this->actor.shape.rot.y < 0x3800)) { + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KOTAKE_ROLL); + } +} + +void func_80AD381C(EnTrt2* this, GlobalContext* globalCtx) { + if ((CURRENT_DAY == 2) || (CURRENT_DAY == 3)) { + if (func_80AD4B08(globalCtx) == 1) { + this->actor.world.pos.y -= 50.0f; + this->unk_3D9 = 0; + this->unk_3B2 = 0; + this->actor.flags &= ~ACTOR_FLAG_1; + this->actor.flags |= ACTOR_FLAG_10; + } + } else { + Actor_MarkForDeath(&this->actor); + } +} + +void func_80AD38B8(EnTrt2* this, GlobalContext* globalCtx) { + Vec3s sp30; + + if (this->unk_3D9 == 2) { + Actor_MarkForDeath(&this->actor); + } + + if (this->path != NULL) { + func_80AD49B8(this->path, this->unk_1E4, &this->actor.world.pos, &sp30); + Math_SmoothStepToS(&this->actor.world.rot.y, sp30.y, 4, 1000, 1); + this->actor.shape.rot.y = this->actor.world.rot.y; + Math_SmoothStepToS(&this->actor.shape.rot.x, sp30.x, 4, 1000, 1); + this->actor.world.rot.x = -this->actor.shape.rot.x; + if (func_80AD475C(this, this->path, this->unk_1E4)) { + if (this->unk_1E4 >= (this->path->count - 1)) { + ActorCutscene_Stop(this->unk_3DA); + this->unk_3D9 = 2; + } else { + this->unk_1E4++; + } + } + + if (this->actor.bgCheckFlags & 8) { + if (this->unk_1E4 >= (this->path->count - 1)) { + ActorCutscene_Stop(this->unk_3DA); + this->unk_3D9 = 2; + } else { + sp30.y = this->actor.wallYaw; + } + } + Math_ApproachF(&this->actor.speedXZ, 5.0f, 0.2f, 1.0f); + } + + Actor_MoveWithoutGravity(&this->actor); + func_800B9010(&this->actor, NA_SE_EN_KOTAKE_FLY - SFX_FLAG); +} + +void func_80AD3A24(EnTrt2* this, GlobalContext* globalCtx) { + func_80AD46F8(this); + if (this->actor.speedXZ > 0.05f) { + Math_ApproachF(&this->actor.speedXZ, 0.0f, 0.2f, 1.0f); + } else if (DECR(this->unk_3AE) == 0) { + this->unk_3AE = Rand_S16Offset(100, 50); + func_80AD3380(&this->skelAnime, sAnimations, 6); + this->unk_3B2 = 4; + } + Actor_MoveWithGravity(&this->actor); +} + +void func_80AD3AE4(EnTrt2* this, GlobalContext* globalCtx) { + if (this->actor.world.pos.y < this->actor.home.pos.y) { + Math_ApproachF(&this->actor.velocity.y, 0.5f, 0.2f, 0.1f); + } else { + this->actor.velocity.y = 0.0f; + func_80AD3380(&this->skelAnime, sAnimations, 6); + this->unk_3B2 = 4; + } + Actor_MoveWithGravity(&this->actor); +} + +void func_80AD3B6C(EnTrt2* this, GlobalContext* globalCtx) { + if (DECR(this->unk_3B0) == 0) { + this->unk_3B0 = 10; + this->actor.velocity.y = -1.0f; + func_80AD3380(&this->skelAnime, sAnimations, 8); + this->unk_3B2 = 8; + } +} + +void func_80AD3BE4(EnTrt2* this, GlobalContext* globalCtx) { + s16 sp2E = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; + + Math_ScaledStepToS(&this->unk_3C0, sp2E, 400); + Math_SmoothStepToS(&this->unk_3C0, sp2E, 4, 10000, 0); + this->actor.world.rot.y += this->unk_3C0; + this->actor.shape.rot.y = this->actor.world.rot.y; + if (this->actor.world.pos.y < 5.0f) { + func_80AD3380(&this->skelAnime, sAnimations, 9); + this->unk_3B2 = 9; + } +} + +void func_80AD3C94(EnTrt2* this, GlobalContext* globalCtx) { + if (this->actor.world.pos.y < 5.0f) { + func_80AD4A78(this, globalCtx); + if (this->actor.bgCheckFlags & 1) { + this->unk_3B2 = 0xF; + } + } +} + +void func_80AD3CEC(EnTrt2* this, GlobalContext* globalCtx) { + u8 sp27 = Message_GetState(&globalCtx->msgCtx); + + func_80AD46F8(this); + if (this->unk_3D8) { + func_801518B0(globalCtx, this->unk_3A8, &this->actor); + this->unk_3D8 = false; + } else if ((sp27 == 5) && func_80147624(globalCtx)) { + globalCtx->msgCtx.unk11F22 = 0x43; + globalCtx->msgCtx.unk12023 = 4; + func_80AD3380(&this->skelAnime, sAnimations, 6); + this->unk_3B2 = 4; + } +} + +void func_80AD3DA4(EnTrt2* this, GlobalContext* globalCtx) { + this->actor.velocity.y = 0.0f; + func_801518B0(globalCtx, this->unk_3A8, &this->actor); + + if (this->unk_3A8 == 0x838) { + this->unk_3B2 = 11; + return; + } else if (this->unk_3A8 == 0x88F) { + if (Inventory_HasEmptyBottle()) { + this->unk_3B2 = 11; + } else { + this->unk_3B2 = 10; + } + } else { + this->unk_3B2 = 10; + } +} + +void func_80AD3E34(EnTrt2* this, GlobalContext* globalCtx) { + if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { + if (Inventory_HasEmptyBottle()) { + globalCtx->msgCtx.unk11F22 = 0x43; + globalCtx->msgCtx.unk12023 = 4; + this->unk_3B2 = 12; + } else { + gSaveContext.save.weekEventReg[85] |= 0x10; + this->unk_3A8 = 0x88E; + func_801518B0(globalCtx, this->unk_3A8, &this->actor); + this->unk_3B2 = 10; + } + } +} + +void func_80AD3EF0(EnTrt2* this, GlobalContext* globalCtx) { + u8 temp_v0 = Message_GetState(&globalCtx->msgCtx); + + if (temp_v0 == 6) { + if (func_80147624(globalCtx)) { + if ((Inventory_HasEmptyBottle() && !(gSaveContext.save.weekEventReg[84] & 0x40)) || + !(gSaveContext.save.weekEventReg[12] & 0x10)) { + this->unk_3B2 = 12; + } else { + gSaveContext.save.weekEventReg[85] |= 0x10; + this->unk_3A8 = 0x88E; + func_801518B0(globalCtx, this->unk_3A8, &this->actor); + this->unk_3B2 = 10; + } + } + } else if ((temp_v0 == 5) && func_80147624(globalCtx)) { + globalCtx->msgCtx.unk11F22 = 0x43; + globalCtx->msgCtx.unk12023 = 4; + this->unk_3B2 = 12; + } +} + +void func_80AD3FF4(EnTrt2* this, GlobalContext* globalCtx) { + if (Actor_HasParent(&this->actor, globalCtx)) { + if (!(gSaveContext.save.weekEventReg[12] & 0x10)) { + gSaveContext.save.weekEventReg[12] |= 0x10; + } + gSaveContext.save.weekEventReg[84] |= 0x40; + this->actor.parent = NULL; + this->unk_3B2 = 14; + } else if (gSaveContext.save.weekEventReg[12] & 0x10) { + Actor_PickUp(&this->actor, globalCtx, GI_POTION_RED, 300.0f, 300.0f); + } else { + Actor_PickUp(&this->actor, globalCtx, GI_BOTTLE_POTION_RED, 300.0f, 300.0f); + } +} + +void func_80AD40AC(EnTrt2* this, GlobalContext* globalCtx) { + if ((Message_GetState(&globalCtx->msgCtx) == 6) && func_80147624(globalCtx)) { + func_800B85E0(&this->actor, globalCtx, 400.0f, -1); + this->unk_3B2 = 13; + } +} + +void func_80AD4110(EnTrt2* this, GlobalContext* globalCtx) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { + this->unk_3A8 = 0x84C; + func_80151938(globalCtx, this->unk_3A8); + this->unk_3B2 = 10; + } else { + func_800B85E0(&this->actor, globalCtx, 400.0f, -1); + } +} + +void func_80AD417C(EnTrt2* this, GlobalContext* globalCtx) { + if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { + if (this->unk_3A8 == 0x84B) { + func_80AD349C(this); + func_80AD3DA4(this, globalCtx); + } else { + globalCtx->msgCtx.unk11F22 = 0x43; + globalCtx->msgCtx.unk12023 = 4; + if (this->unk_3A8 == 0x84C) { + func_80AD3380(&this->skelAnime, sAnimations, 6); + this->path = func_8013D648(globalCtx, ENTRT2_GET_FC00(&this->actor), 0x3F); + this->unk_3B2 = 18; + } else if (this->unk_3A8 == 0x88F) { + this->unk_3A8 = 0x88E; + func_801518B0(globalCtx, this->unk_3A8, &this->actor); + } else { + this->actor.textId = 0; + this->unk_3B2 = 15; + } + } + } +} + +void func_80AD4298(EnTrt2* this, GlobalContext* globalCtx) { + Player* player = GET_PLAYER(globalCtx); + + if (ActorCutscene_GetCanPlayNext(this->unk_3DA)) { + ActorCutscene_StartAndSetUnkLinkFields(this->unk_3DA, &this->actor); + player->stateFlags1 |= 0x20; + this->unk_3B2 = 6; + } else { + if (ActorCutscene_GetCurrentIndex() == 0x7C) { + ActorCutscene_Stop(0x7C); + } + ActorCutscene_SetIntentToPlay(this->unk_3DA); + } +} + +void func_80AD431C(EnTrt2* this, GlobalContext* globalCtx) { + Player* player = GET_PLAYER(globalCtx); + + player->stateFlags1 &= ~0x20; + Actor_MarkForDeath(&this->actor); +} + +void func_80AD434C(EnTrt2* this, GlobalContext* globalCtx) { + this->actor.shape.rot.y += 0x1000; + Math_ApproachF(&this->actor.velocity.y, 1.5f, 0.2f, 0.1f); + + if (this->actor.world.pos.y > 200.0f) { + if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { + this->unk_3B2 = 0x13; + ActorCutscene_Stop(this->unk_3DA); + } else { + s32 i; + Vec3f sp68; + Vec3f sp5C = { 0.0f, 0.5f, 0.0f }; + + for (i = (s32)this->skelAnime.animLength - (s32)this->skelAnime.curFrame; i >= 0; i -= 2) { + sp68.x = randPlusMinusPoint5Scaled(60.0f) + this->actor.world.pos.x; + sp68.z = randPlusMinusPoint5Scaled(60.0f) + this->actor.world.pos.z; + sp68.y = randPlusMinusPoint5Scaled(50.0f) + (this->actor.world.pos.y + 20.0f); + func_800B3030(globalCtx, &sp68, &sp5C, &sp5C, 100, 0, 3); + } + + func_800B9010(&this->actor, NA_SE_EN_COMMON_EXTINCT_LEV - SFX_FLAG); + } + } else if (this->actor.world.pos.y < 5.0f) { + func_80AD4A78(this, globalCtx); + } + + Actor_MoveWithGravity(&this->actor); + + if ((this->actor.shape.rot.y >= 0x2800) && (this->actor.shape.rot.y < 0x3800)) { + Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KOTAKE_ROLL); + } +} + +void func_80AD4550(EnTrt2* this, GlobalContext* globalCtx) { + Player* player = GET_PLAYER(globalCtx); + u8 sp23 = Message_GetState(&globalCtx->msgCtx); + + if ((player->transformation != PLAYER_FORM_HUMAN) && (player->transformation != PLAYER_FORM_FIERCE_DEITY)) { + func_80AD3380(&this->skelAnime, sAnimations, 7); + this->unk_3B2 = 17; + } + + if ((sp23 == 5) && func_80147624(globalCtx)) { + globalCtx->msgCtx.unk11F22 = 0x43; + globalCtx->msgCtx.unk12023 = 4; + } +} + +void func_80AD4608(EnTrt2* this) { + s16 temp = this->unk_3B6 - 1; + + if (temp != 0) { + this->unk_3B6 = temp; + return; + } + + temp = this->unk_3B8 + 1; + if (temp >= 3) { + this->unk_3B8 = 0; + this->unk_3B6 = (s32)(Rand_ZeroOne() * 60.0f) + 20; + } else { + this->unk_3B8 = temp; + this->unk_3B6 = 1; + } +} + +void func_80AD469C(EnTrt2* this, GlobalContext* globalCtx) { + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_trt_Skel_00FEF0, &object_trt_Anim_000A44, NULL, NULL, 0); + this->actor.draw = func_80AD56E8; +} + +void func_80AD46F8(EnTrt2* this) { + if ((this->actor.home.pos.y + 60.0f) < this->actor.world.pos.y) { + this->actor.velocity.y = -0.2f; + } else if (this->actor.world.pos.y <= (this->actor.home.pos.y + 50.0f)) { + this->actor.velocity.y = 0.2f; + } +} + +s32 func_80AD475C(EnTrt2* this, Path* path, s32 arg2) { + Vec3s* points; + s32 count; + f32 phi_f12; + s32 ret; + f32 phi_f14; + s32 arg = arg2; + f32 sp44; + f32 sp40; + f32 sp3C; + Vec3f sp30; + + points = Lib_SegmentedToVirtual(path->points); + count = path->count; + ret = false; + Math_Vec3s_ToVec3f(&sp30, &points[arg]); + + if (arg == 0) { + phi_f12 = points[1].x - points[0].x; + phi_f14 = points[1].z - points[0].z; + } else if ((count - 1) == arg) { + phi_f12 = points[count - 1].x - points[count - 2].x; + phi_f14 = points[count - 1].z - points[count - 2].z; + } else { + phi_f12 = points[arg + 1].x - points[arg - 1].x; + phi_f14 = points[arg + 1].z - points[arg - 1].z; + } + + func_8017B7F8(&sp30, RADF_TO_BINANG(func_80086B30(phi_f12, phi_f14)), &sp44, &sp40, &sp3C); + + if (((this->actor.world.pos.x * sp44) + (sp40 * this->actor.world.pos.z) + sp3C) > 0.0f) { + ret = true; + } + return ret; +} + +s16 func_80AD48F8(Path* path, s32 arg1, Vec3f* arg2, f32* arg3) { + Vec3s* points; + f32 phi_f14; + f32 phi_f12; + + if (path != NULL) { + points = Lib_SegmentedToVirtual(path->points); + points = &points[arg1]; + phi_f14 = points->x - arg2->x; + phi_f12 = points->z - arg2->z; + } else { + phi_f14 = 0.0f; + phi_f12 = 0.0f; + } + *arg3 = SQ(phi_f14) + SQ(phi_f12); + return RADF_TO_BINANG(Math_Acot2F(phi_f12, phi_f14)); +} + +f32 func_80AD49B8(Path* path, s32 arg1, Vec3f* arg2, Vec3s* arg3) { + s32 pad; + Vec3f sp20; + Vec3s* temp_v1; + + if (path != NULL) { + temp_v1 = Lib_SegmentedToVirtual(path->points); + temp_v1 = &temp_v1[arg1]; + + sp20.x = temp_v1->x; + sp20.y = temp_v1->y; + sp20.z = temp_v1->z; + } + arg3->y = Math_Vec3f_Yaw(arg2, &sp20); + arg3->x = Math_Vec3f_Pitch(arg2, &sp20); + return sp20.y - arg2->y; +} + +void func_80AD4A78(EnTrt2* this, GlobalContext* globalCtx) { + Vec3f sp34; + + sp34.x = randPlusMinusPoint5Scaled(15.0f) + this->actor.world.pos.x; + sp34.y = this->actor.world.pos.y; + sp34.z = randPlusMinusPoint5Scaled(15.0f) + this->actor.world.pos.z; + Actor_SpawnFloorDustRing(globalCtx, &this->actor, &sp34, 50.0f, 0, 2.0f, 0, 0, 0); +} + +s32 func_80AD4B08(GlobalContext* globalCtx) { + Player* player = GET_PLAYER(globalCtx); + s32 ret; + + if (SurfaceType_GetSceneExitIndex(&globalCtx->colCtx, player->actor.floorPoly, player->actor.floorBgId) == 0x15) { + ret = true; + } else { + ret = false; + } + return ret; +} + +s32 func_80AD4B4C(EnTrt2* this, GlobalContext* globalCtx) { + s32 sp24 = false; + Player* player = GET_PLAYER(globalCtx); + + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { + sp24 = true; + this->actor.speedXZ = 0.0f; + func_80AD349C(this); + this->unk_3B4 = this->unk_3B2; + if (this->actor.bgCheckFlags & 1) { + if ((player->transformation != PLAYER_FORM_HUMAN) && (player->transformation != PLAYER_FORM_FIERCE_DEITY)) { + this->unk_3A8 = 0x84F; + } + func_80AD3DA4(this, globalCtx); + } else if ((player->transformation == PLAYER_FORM_HUMAN) || + (player->transformation == PLAYER_FORM_FIERCE_DEITY)) { + this->unk_3B2 = 16; + this->actor.velocity.y = 1.5f; + } else { + this->unk_3A8 = 0x84F; + this->unk_3D8 = true; + func_80AD3380(&this->skelAnime, sAnimations, 7); + this->unk_3B2 = 7; + } + } + return sp24; +} + +s32 func_80AD4C4C(EnTrt2* this) { + if (this->actor.bgCheckFlags & 1) { + if (this->actor.xzDistToPlayer < 100.0f) { + return true; + } + } else if ((this->actor.xzDistToPlayer > 50.0f) && (this->actor.xzDistToPlayer < 200.0f)) { + return true; + } + return false; +} + +s32 func_80AD4CCC(EnTrt2* this, GlobalContext* globalCtx) { + s16 sp1E = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; + Player* player = GET_PLAYER(globalCtx); + + if (((this->unk_3B2 == 4) || (this->unk_3B2 == 5)) && this->actor.isTargeted && !(this->actor.bgCheckFlags & 1) && + ((player->transformation == PLAYER_FORM_HUMAN) || (player->transformation == PLAYER_FORM_FIERCE_DEITY))) { + this->actor.speedXZ = 0.0f; + this->actor.velocity.y = 1.5f; + this->unk_3B2 = 16; + return true; + } + + if (func_80AD4C4C(this) && this->actor.isTargeted && (sp1E < 0x4000) && (sp1E > -0x4000)) { + func_800B863C(&this->actor, globalCtx); + } + + return true; +} + +void func_80AD4DB4(EnTrt2* this, GlobalContext* globalCtx) { + static Vec3f D_80AD5904 = { 0.0f, 50.0f, 0.0 }; + + this->actor.flags &= ~ACTOR_FLAG_10; + Actor_SetObjectDependency(globalCtx, &this->actor); + Actor_SetScale(&this->actor, 0.008f); + this->path = func_8013D648(globalCtx, ENTRT2_GET_FC00(&this->actor), 0x3F); + this->unk_3AE = Rand_S16Offset(100, 50); + this->unk_3B0 = 10; + this->unk_3A8 = 0; + + this->actor.world.pos.x += D_80AD5904.x; + this->actor.world.pos.y += D_80AD5904.y; + this->actor.world.pos.z += D_80AD5904.z; + + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f); + func_80AD469C(this, globalCtx); + this->actor.colChkInfo.mass = MASS_IMMOVABLE; + this->actor.colChkInfo.cylRadius = 50; + + this->unk_3C0 = 0; + this->unk_3D8 = false; + this->unk_3DA = this->actor.cutscene; + this->unk_3B6 = 20; + this->unk_3B8 = 0; + this->unk_3BC = func_80AD4608; + + if (gSaveContext.save.weekEventReg[12] & 8) { + Actor_MarkForDeath(&this->actor); + return; + } + + if (gSaveContext.save.weekEventReg[84] & 0x40) { + Actor_MarkForDeath(&this->actor); + return; + } + + if ((globalCtx->sceneNum == SCENE_20SICHITAI) || (globalCtx->sceneNum == SCENE_20SICHITAI2)) { + if (gSaveContext.save.day == 2) { + if (!(gSaveContext.save.weekEventReg[15] & 0x80)) { + gSaveContext.save.weekEventReg[15] |= 0x80; + this->unk_3B2 = 3; + } else { + Actor_MarkForDeath(&this->actor); + return; + } + } else { + Actor_MarkForDeath(&this->actor); + return; + } + } else if (gSaveContext.save.day == 2) { + if (gSaveContext.save.weekEventReg[15] & 0x80) { + this->unk_3B2 = 4; + } else { + Actor_MarkForDeath(&this->actor); + return; + } + } else if (gSaveContext.save.day == 3) { + this->unk_3B2 = 4; + } + this->actionFunc = func_80AD4FE4; +} + +void func_80AD4FE4(EnTrt2* this, GlobalContext* globalCtx) { + static EnTrt2UnkFunc2 D_80AD5910[] = { + func_80AD3664, func_80AD36EC, func_80AD38B8, func_80AD381C, func_80AD3530, func_80AD3A24, func_80AD434C, + func_80AD3CEC, func_80AD3BE4, func_80AD3C94, func_80AD417C, func_80AD3EF0, func_80AD3FF4, func_80AD4110, + func_80AD40AC, func_80AD4550, func_80AD3B6C, func_80AD3AE4, func_80AD4298, func_80AD431C, func_80AD3E34, + }; + + this->unk_3BC(this); + + D_80AD5910[this->unk_3B2](this, globalCtx); + Actor_MoveWithGravity(&this->actor); + + if (globalCtx->sceneNum != SCENE_20SICHITAI) { + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 26.0f, 10.0f, 0.0f, 5); + } + + Actor_SetFocus(&this->actor, 90.0f); + SkelAnime_Update(&this->skelAnime); +} + +static InitChainEntry sInitChain[] = { ICHAIN_U8(targetMode, 3, ICHAIN_CONTINUE), ICHAIN_F32(targetArrowOffset, 500, ICHAIN_STOP), }; -#endif +void EnTrt2_Init(Actor* thisx, GlobalContext* globalCtx) { + EnTrt2* this = THIS; -extern ColliderCylinderInit D_80AD58A0; -extern CollisionCheckInfoInit2 D_80AD58CC; -extern DamageTable D_80AD58D8; -extern InitChainEntry D_80AD5964[]; + Collider_InitCylinder(globalCtx, &this->collider); + Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); + CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); + Actor_ProcessInitChain(&this->actor, sInitChain); + this->actionFunc = func_80AD4DB4; +} -extern UNK_TYPE D_06000A44; +void EnTrt2_Destroy(Actor* thisx, GlobalContext* globalCtx) { + EnTrt2* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD3380.s") + SkelAnime_Free(&this->skelAnime, globalCtx); + Collider_DestroyCylinder(globalCtx, &this->collider); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD341C.s") +void EnTrt2_Update(Actor* thisx, GlobalContext* globalCtx) { + EnTrt2* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD349C.s") + if ((this->unk_3B2 != 6) && (this->unk_3B2 != 10) && (this->unk_3B2 != 13) && (this->unk_3B2 != 14) && + (this->unk_3B2 != 16) && (this->unk_3B2 != 8) && (this->unk_3B2 != 9)) { + func_80AD4B4C(this, globalCtx); + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD3530.s") + this->actionFunc(this, globalCtx); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD3664.s") + func_80AD341C(this, globalCtx); + func_80AD5234(this, globalCtx); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD36EC.s") + if ((this->unk_3B2 != 6) && (this->unk_3B2 != 10) && (this->unk_3B2 != 13) && (this->unk_3B2 != 14) && + (this->unk_3B2 != 16) && (this->unk_3B2 != 8) && (this->unk_3B2 != 9)) { + func_80AD4CCC(this, globalCtx); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD381C.s") +void func_80AD5234(EnTrt2* this, GlobalContext* globalCtx) { + Player* player = GET_PLAYER(globalCtx); + Vec3f sp40; + Vec3f sp34; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD38B8.s") + Math_SmoothStepToS(&this->unk_3D6, this->actor.yawTowardsPlayer - this->actor.shape.rot.y, 4, 0x38E0, 1); + this->unk_3D6 = CLAMP(this->unk_3D6, -0x38E0, 0x38E0); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD3A24.s") + sp40 = player->actor.world.pos; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD3AE4.s") + if (this->unk_3B2 == 8) { + sp40.y = player->bodyPartsPos[7].y + 3.0f; + } else { + sp40.y = player->bodyPartsPos[7].y + 45.0f; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD3B6C.s") + sp34 = this->actor.world.pos; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD3BE4.s") + Math_SmoothStepToS(&this->unk_3D4, Math_Vec3f_Pitch(&sp34, &sp40), 4, 0x1C70, 1); + this->unk_3D4 = CLAMP(this->unk_3D4, -0x1C70, 0x1C70); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD3C94.s") +void func_80AD5394(s16 arg0, s16 arg1, Vec3f* arg2, Vec3s* arg3, s32 arg4) { + Vec3f sp7C; + Vec3f sp70 = gZeroVec3f; + Vec3s sp68; + MtxF sp28; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD3CEC.s") + Matrix_MultiplyVector3fByState(&sp70, &sp7C); + Matrix_CopyCurrentState(&sp28); + func_8018219C(&sp28, &sp68, 0); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD3DA4.s") + *arg2 = sp7C; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD3E34.s") + if (arg4) { + sp68.x += arg0; + sp68.y += arg1; + Math_SmoothStepToS(&arg3->x, sp68.x, 4, 0x1FFE, 1); + Math_SmoothStepToS(&arg3->y, sp68.y, 4, 0x1FFE, 1); + Math_SmoothStepToS(&arg3->z, sp68.z, 4, 0x1FFE, 1); + } else { + arg3->x = sp68.x; + arg3->y = sp68.y; + arg3->z = sp68.z; + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD3EF0.s") +s32 EnTrt2_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, + Actor* thisx) { + EnTrt2* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD3FF4.s") + if ((limbIndex == 8) || (limbIndex == 13) || (limbIndex == 19)) { + rot->y += (s16)Math_SinS(this->unk_33C[limbIndex]) * 200; + rot->z += (s16)Math_CosS(this->unk_372[limbIndex]) * 200; + } + return false; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD40AC.s") +void EnTrt2_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { + EnTrt2* this = THIS; + Vec3f sp30 = { 0.0f, -30.0f, 0.0f }; + s32 phi_v0 = false; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD4110.s") + if (this->unk_3B2 >= 8) { + phi_v0 = true; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD417C.s") + if (limbIndex == 21) { + func_80AD5394(this->unk_3D4, this->unk_3D6, &this->unk_3C8, &this->unk_3C2, phi_v0); + Matrix_InsertTranslation(this->unk_3C8.x, this->unk_3C8.y, this->unk_3C8.z, MTXMODE_NEW); + Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY); + Matrix_RotateY(this->unk_3C2.y, MTXMODE_APPLY); + Matrix_InsertXRotation_s(this->unk_3C2.x, MTXMODE_APPLY); + Matrix_InsertZRotation_s(this->unk_3C2.z, MTXMODE_APPLY); + Matrix_MultiplyVector3fByState(&sp30, &this->actor.focus.pos); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD4298.s") +void EnTrt2_UnkDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) { + EnTrt2* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD431C.s") + if (limbIndex == 21) { + Matrix_InsertTranslation(this->unk_3C8.x, this->unk_3C8.y, this->unk_3C8.z, MTXMODE_NEW); + Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY); + Matrix_RotateY(this->unk_3C2.y, MTXMODE_APPLY); + Matrix_InsertXRotation_s(this->unk_3C2.x, MTXMODE_APPLY); + Matrix_InsertZRotation_s(this->unk_3C2.z, MTXMODE_APPLY); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD434C.s") +void func_80AD56E8(Actor* thisx, GlobalContext* globalCtx) { + static TexturePtr D_80AD5978[] = { + object_trt_Tex_00B0B8, + object_trt_Tex_00B8B8, + object_trt_Tex_00C0B8, + }; + s32 pad; + EnTrt2* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD4550.s") + OPEN_DISPS(globalCtx->state.gfxCtx); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD4608.s") + func_8012C28C(globalCtx->state.gfxCtx); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD469C.s") + gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(D_80AD5978[this->unk_3B8])); + gSPSegment(POLY_OPA_DISP++, 0x09, Lib_SegmentedToVirtual(D_80AD5978[this->unk_3B8])); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD46F8.s") + SkelAnime_DrawTransformFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, + this->skelAnime.dListCount, EnTrt2_OverrideLimbDraw, EnTrt2_PostLimbDraw, + EnTrt2_UnkDraw, &this->actor); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD475C.s") - -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD48F8.s") - -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD49B8.s") - -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD4A78.s") - -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD4B08.s") - -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD4B4C.s") - -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD4C4C.s") - -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD4CCC.s") - -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD4DB4.s") - -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD4FE4.s") - -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/EnTrt2_Init.s") - -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/EnTrt2_Destroy.s") - -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/EnTrt2_Update.s") - -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD5234.s") - -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD5394.s") - -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD54C8.s") - -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD5584.s") - -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD566C.s") - -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD56E8.s") + CLOSE_DISPS(globalCtx->state.gfxCtx); +} diff --git a/src/overlays/actors/ovl_En_Trt2/z_en_trt2.h b/src/overlays/actors/ovl_En_Trt2/z_en_trt2.h index 11320af0c..bab274721 100644 --- a/src/overlays/actors/ovl_En_Trt2/z_en_trt2.h +++ b/src/overlays/actors/ovl_En_Trt2/z_en_trt2.h @@ -6,11 +6,39 @@ struct EnTrt2; typedef void (*EnTrt2ActionFunc)(struct EnTrt2*, GlobalContext*); +typedef void (*EnTrt2UnkFunc)(struct EnTrt2*); +typedef void (*EnTrt2UnkFunc2)(struct EnTrt2*, GlobalContext*); + +#define ENTRT2_GET_FC00(thisx) (((thisx)->params & 0xFC00) >> 0xA) typedef struct EnTrt2 { - /* 0x0000 */ Actor actor; - /* 0x0144 */ EnTrt2ActionFunc actionFunc; - /* 0x0148 */ char unk_148[0x294]; + /* 0x000 */ Actor actor; + /* 0x144 */ EnTrt2ActionFunc actionFunc; + /* 0x148 */ UNK_TYPE1 unk_148[8]; + /* 0x150 */ SkelAnime skelAnime; + /* 0x194 */ ColliderCylinder collider; + /* 0x1E0 */ Path* path; + /* 0x1E4 */ s32 unk_1E4; + /* 0x1E8 */ UNK_TYPE1 unk_1E8[0x154]; + /* 0x33C */ s16 unk_33C[27]; + /* 0x372 */ s16 unk_372[27]; + /* 0x3A8 */ u16 unk_3A8; + /* 0x3AA */ UNK_TYPE1 unk_3AA[4]; + /* 0x3AE */ s16 unk_3AE; + /* 0x3B0 */ s16 unk_3B0; + /* 0x3B2 */ s16 unk_3B2; + /* 0x3B4 */ s16 unk_3B4; + /* 0x3B6 */ s16 unk_3B6; + /* 0x3B8 */ s16 unk_3B8; + /* 0x3BC */ EnTrt2UnkFunc unk_3BC; + /* 0x3C0 */ s16 unk_3C0; + /* 0x3C2 */ Vec3s unk_3C2; + /* 0x3C8 */ Vec3f unk_3C8; + /* 0x3D4 */ s16 unk_3D4; + /* 0x3D6 */ s16 unk_3D6; + /* 0x3D8 */ u8 unk_3D8; + /* 0x3D9 */ u8 unk_3D9; + /* 0x3DA */ s16 unk_3DA; } EnTrt2; // size = 0x3DC extern const ActorInit En_Trt2_InitVars; diff --git a/src/overlays/actors/ovl_En_Tru/z_en_tru.c b/src/overlays/actors/ovl_En_Tru/z_en_tru.c index f6abc465e..2541301c5 100644 --- a/src/overlays/actors/ovl_En_Tru/z_en_tru.c +++ b/src/overlays/actors/ovl_En_Tru/z_en_tru.c @@ -69,6 +69,7 @@ const ActorInit En_Tru_InitVars = { }; #include "overlays/ovl_En_Tru/ovl_En_Tru.c" +#include "objects/gameplay_keep/gameplay_keep.h" static Vec3f D_80A8B250 = { 0.0f, 0.02f, 0.0f }; @@ -79,8 +80,8 @@ static Color_RGBA8 D_80A8B25C[] = { static f32 D_80A8B274[] = { 60.0f, 255.0f, 60.0f }; -static UNK_TYPE D_80A8B280[] = { - &D_0408F7E0, &D_0408F3E0, &D_0408EFE0, &D_0408EBE0, &D_0408E7E0, &D_0408E3E0, &D_0408DFE0, &D_0408DBE0, +static TexturePtr D_80A8B280[] = { + gDust8Tex, gDust7Tex, gDust6Tex, gDust5Tex, gDust4Tex, gDust3Tex, gDust2Tex, gDust1Tex, }; static ColliderSphereInit sSphereInit = { @@ -1235,10 +1236,10 @@ void EnTru_TransformLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thi void EnTru_Draw(Actor* thisx, GlobalContext* globalCtx) { static TexturePtr D_80A8B408[] = { - &object_tru_Tex_018FA0, - &object_tru_Tex_0197A0, - &object_tru_Tex_019FA0, - &object_tru_Tex_0197A0, + object_tru_Tex_018FA0, + object_tru_Tex_0197A0, + object_tru_Tex_019FA0, + object_tru_Tex_0197A0, }; s32 pad; EnTru* this = THIS; diff --git a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c index 05f4e76d7..c2d9e8d64 100644 --- a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c +++ b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c @@ -120,7 +120,8 @@ void EnTuboTrap_SpawnEffectsOnLand(EnTuboTrap* this, GlobalContext* globalCtx) { arg5 = 0x20; } EffectSsKakera_Spawn(globalCtx, &pos, &vel, actorPos, -0xF0, arg5, 0x14, 0, 0, - ((Rand_ZeroOne() * 85.0f) + 15.0f), 0, 0, 0x3C, -1, GAMEPLAY_DANGEON_KEEP, D_05018090); + ((Rand_ZeroOne() * 85.0f) + 15.0f), 0, 0, 0x3C, -1, GAMEPLAY_DANGEON_KEEP, + gameplay_dangeon_keep_DL_018090); } func_800BBFB0(globalCtx, actorPos, 30.0f, 4, 0x14, 0x32, 0); @@ -165,7 +166,8 @@ void EnTuboTrap_SpawnEffectsInWater(EnTuboTrap* this, GlobalContext* globalCtx) } EffectSsKakera_Spawn(globalCtx, &pos, &vel, actorPos, -0xAA, arg5, 0x32, 5, 0, - ((Rand_ZeroOne() * 85.0f) + 15.0f), 0, 0, 0x46, -1, GAMEPLAY_DANGEON_KEEP, D_05018090); + ((Rand_ZeroOne() * 85.0f) + 15.0f), 0, 0, 0x46, -1, GAMEPLAY_DANGEON_KEEP, + gameplay_dangeon_keep_DL_018090); } } diff --git a/src/overlays/actors/ovl_En_Warp_Uzu/z_en_warp_uzu.c b/src/overlays/actors/ovl_En_Warp_Uzu/z_en_warp_uzu.c index 595984190..2a38c9042 100644 --- a/src/overlays/actors/ovl_En_Warp_Uzu/z_en_warp_uzu.c +++ b/src/overlays/actors/ovl_En_Warp_Uzu/z_en_warp_uzu.c @@ -5,6 +5,7 @@ */ #include "z_en_warp_uzu.h" +#include "objects/object_warp_uzu/object_warp_uzu.h" #define FLAGS 0x00000019 @@ -59,8 +60,6 @@ static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), }; -extern Gfx D_06000EC0[]; - void EnWarpUzu_Init(Actor* thisx, GlobalContext* globalCtx) { EnWarpUzu* this = THIS; @@ -133,5 +132,5 @@ void EnWarpUzu_Update(Actor* thisx, GlobalContext* globalCtx) { } void EnWarpUzu_Draw(Actor* thisx, GlobalContext* globalCtx) { - Gfx_DrawDListOpa(globalCtx, D_06000EC0); + Gfx_DrawDListOpa(globalCtx, object_warp_uzu_DL_000EC0); } diff --git a/src/overlays/actors/ovl_En_Water_Effect/z_en_water_effect.c b/src/overlays/actors/ovl_En_Water_Effect/z_en_water_effect.c index 5e45f8c03..3d2f837a0 100644 --- a/src/overlays/actors/ovl_En_Water_Effect/z_en_water_effect.c +++ b/src/overlays/actors/ovl_En_Water_Effect/z_en_water_effect.c @@ -285,7 +285,7 @@ void EnWaterEffect_Draw(Actor* thisx, GlobalContext* globalCtx2) { if (!phi_s4) { POLY_XLU_DISP = Gfx_CallSetupDL(POLY_XLU_DISP, 0); - gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(gameplay_keep_Tex_08DBE0)); + gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(gDust1Tex)); gSPDisplayList(POLY_XLU_DISP++, object_water_effect_DL_004260); gDPSetEnvColor(POLY_XLU_DISP++, 250, 250, 255, 0); phi_s4++; @@ -317,7 +317,7 @@ void EnWaterEffect_Draw(Actor* thisx, GlobalContext* globalCtx2) { if (!phi_s4) { func_8012C448(gfxCtx); - gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(gameplay_keep_Tex_08DBE0)); + gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(gDust1Tex)); gDPSetEnvColor(POLY_XLU_DISP++, 250, 250, 255, 0); gSPDisplayList(POLY_XLU_DISP++, object_water_effect_DL_004260); phi_s4++; @@ -624,7 +624,7 @@ void func_80A5A6B8(Actor* thisx, GlobalContext* globalCtx2) { if ((this->actor.params == ENWATEREFFECT_777) || (this->actor.params == ENWATEREFFECT_778)) { if (this->unk_E2C > 1.0f) { func_8012C2DC(globalCtx->state.gfxCtx); - AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&object_water_effect_Matanimheader_000DE0)); + AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(object_water_effect_Matanimheader_000DE0)); Matrix_Scale(this->unk_DC8[1].y, this->unk_DC8[1].z, this->unk_DC8[1].y, MTXMODE_APPLY); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), @@ -637,7 +637,7 @@ void func_80A5A6B8(Actor* thisx, GlobalContext* globalCtx2) { if (this->unk_E30 > 1.0f) { func_8012C2DC(globalCtx->state.gfxCtx); - AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&object_water_effect_Matanimheader_000E0C)); + AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(object_water_effect_Matanimheader_000E0C)); Matrix_Scale(this->unk_DC8[2].y, this->unk_DC8[2].z, this->unk_DC8[2].y, MTXMODE_APPLY); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), @@ -653,7 +653,7 @@ void func_80A5A6B8(Actor* thisx, GlobalContext* globalCtx2) { if ((this->unk_E34 > 1.0f) && (this->actor.params != ENWATEREFFECT_780)) { func_8012C2DC(globalCtx->state.gfxCtx); - AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&object_water_effect_Matanimheader_000E40)); + AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(object_water_effect_Matanimheader_000E40)); Matrix_Scale(this->unk_DC8[3].y, this->unk_DC8[3].z, this->unk_DC8[3].y, MTXMODE_APPLY); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); @@ -665,7 +665,7 @@ void func_80A5A6B8(Actor* thisx, GlobalContext* globalCtx2) { if ((this->actor.params == ENWATEREFFECT_777) || (this->actor.params == ENWATEREFFECT_780)) { func_8012C2DC(globalCtx->state.gfxCtx); - AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&object_water_effect_Matanimheader_000E58)); + AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(object_water_effect_Matanimheader_000E58)); Matrix_Scale(this->unk_DC8[4].y, this->unk_DC8[4].z, this->unk_DC8[4].y, MTXMODE_APPLY); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); @@ -681,7 +681,7 @@ void func_80A5A6B8(Actor* thisx, GlobalContext* globalCtx2) { if (!phi_s4) { func_8012C448(globalCtx->state.gfxCtx); - gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(gameplay_keep_Tex_08DBE0)); + gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(gDust1Tex)); gDPSetEnvColor(POLY_XLU_DISP++, 250, 250, 255, 0); gSPDisplayList(POLY_XLU_DISP++, object_water_effect_DL_004260); phi_s4++; diff --git a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c index 3a5eeb3fc..3aa692b90 100644 --- a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c +++ b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c @@ -61,7 +61,7 @@ void EnWeatherTag_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void EnWeatherTag_Init(Actor* thisx, GlobalContext* globalCtx) { - EnWeatherTag* this = (EnWeatherTag*)thisx; + EnWeatherTag* this = THIS; s32 pad; Path* path; s32 pathID; @@ -481,7 +481,7 @@ void func_80967608(EnWeatherTag* this, GlobalContext* globalCtx) { } void EnWeatherTag_Update(Actor* thisx, GlobalContext* globalCtx) { - EnWeatherTag* this = (EnWeatherTag*)thisx; + EnWeatherTag* this = THIS; u16 oldTime; this->actionFunc(this, globalCtx); diff --git a/src/overlays/actors/ovl_En_Wf/z_en_wf.c b/src/overlays/actors/ovl_En_Wf/z_en_wf.c index 080aeeba5..12bed5ca1 100644 --- a/src/overlays/actors/ovl_En_Wf/z_en_wf.c +++ b/src/overlays/actors/ovl_En_Wf/z_en_wf.c @@ -7,6 +7,7 @@ #include "z_en_wf.h" #include "overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.h" #include "overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.h" +#include "objects/object_wf/object_wf.h" #define FLAGS 0x00000415 @@ -55,23 +56,6 @@ void func_80993524(EnWf* this); void func_8099357C(EnWf* this, GlobalContext* globalCtx); s32 func_8099408C(GlobalContext* globalCtx, EnWf* this); -extern UNK_TYPE D_06000300; -extern UNK_TYPE D_060027D8; -extern UNK_TYPE D_060029D8; -extern FlexSkeletonHeader D_06003BC0; -extern AnimationHeader D_06004638; -extern AnimationHeader D_06004A90; -extern AnimationHeader D_06004C44; -extern AnimationHeader D_060053D0; -extern AnimationHeader D_06005700; -extern UNK_TYPE D_06007AA8; -extern UNK_TYPE D_060082A8; -extern UNK_TYPE D_060084A8; -extern FlexSkeletonHeader D_060095D0; -extern AnimationHeader D_06009808; -extern AnimationHeader D_06009A50; -extern AnimationHeader D_0600A3CC; - const ActorInit En_Wf_InitVars = { ACTOR_EN_WF, ACTORCAT_PROP, @@ -256,18 +240,18 @@ static DamageTable sDamageTable2 = { static CollisionCheckInfoInit sColChkInfoInit = { 8, 50, 100, MASS_HEAVY }; -static UNK_TYPE D_809942B0[] = { - &D_06007AA8, - &D_060082A8, - &D_060084A8, - &D_060082A8, +static TexturePtr D_809942B0[] = { + object_wf_Tex_007AA8, + object_wf_Tex_0082A8, + object_wf_Tex_0084A8, + object_wf_Tex_0082A8, }; -static UNK_TYPE D_809942C0[] = { - &D_06000300, - &D_060027D8, - &D_060029D8, - &D_060027D8, +static TexturePtr D_809942C0[] = { + object_wf_Tex_000300, + object_wf_Tex_0027D8, + object_wf_Tex_0029D8, + object_wf_Tex_0027D8, }; static InitChainEntry sInitChain[] = { @@ -334,16 +318,16 @@ void EnWf_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, 0.0075f); if (this->actor.params == 0) { - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060095D0, &D_0600A3CC, this->jointTable, this->morphTable, - 22); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_wf_Skel_0095D0, &object_wf_Anim_00A3CC, + this->jointTable, this->morphTable, 22); this->actor.hintId = 0x4C; CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable2, &sColChkInfoInit); this->collider1.elements[0].info.toucher.damage = 8; this->collider1.elements[1].info.toucher.damage = 8; this->actor.colChkInfo.health = 6; } else { - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06003BC0, &D_0600A3CC, this->jointTable, this->morphTable, - 22); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_wf_Skel_003BC0, &object_wf_Anim_00A3CC, + this->jointTable, this->morphTable, 22); this->actor.hintId = 0x57; CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable1, &sColChkInfoInit); } @@ -566,7 +550,7 @@ void func_80990F50(EnWf* this, GlobalContext* globalCtx) { } void func_80990FC8(EnWf* this) { - Animation_Change(&this->skelAnime, &D_060053D0, 0.5f, 0.0f, 7.0f, 3, 0.0f); + Animation_Change(&this->skelAnime, &object_wf_Anim_0053D0, 0.5f, 0.0f, 7.0f, 3, 0.0f); this->unk_2A0 = 5; this->actor.flags |= 1; this->actionFunc = func_80991040; @@ -589,7 +573,7 @@ void func_80991040(EnWf* this, GlobalContext* globalCtx) { void func_809910F0(EnWf* this) { this->collider2.base.acFlags &= ~AC_ON; this->actor.speedXZ = 0.0f; - Animation_Change(&this->skelAnime, &D_060053D0, 0.5f, 0.0f, 7.0f, 3, -5.0f); + Animation_Change(&this->skelAnime, &object_wf_Anim_0053D0, 0.5f, 0.0f, 7.0f, 3, -5.0f); this->unk_2A0 = 5; this->actionFunc = func_80991174; } @@ -608,7 +592,7 @@ void func_80991174(EnWf* this, GlobalContext* globalCtx) { void func_80991200(EnWf* this) { this->collider2.base.acFlags |= AC_ON; - Animation_MorphToLoop(&this->skelAnime, &D_0600A3CC, -4.0f); + Animation_MorphToLoop(&this->skelAnime, &object_wf_Anim_00A3CC, -4.0f); this->unk_2A0 = (s32)Rand_ZeroFloat(10.0f) + 2; this->actor.world.rot.y = this->actor.shape.rot.y; this->actionFunc = func_80991280; @@ -659,7 +643,7 @@ void func_80991280(EnWf* this, GlobalContext* globalCtx) { void func_80991438(EnWf* this) { this->collider2.base.acFlags |= AC_ON; - Animation_MorphToLoop(&this->skelAnime, &D_06005700, -4.0f); + Animation_MorphToLoop(&this->skelAnime, &object_wf_Anim_005700, -4.0f); this->actor.world.rot.y = this->actor.shape.rot.y; this->actor.speedXZ = 8.0f; this->actionFunc = func_8099149C; @@ -720,7 +704,7 @@ void func_8099149C(EnWf* this, GlobalContext* globalCtx) { } void func_80991738(EnWf* this) { - Animation_MorphToLoop(&this->skelAnime, &D_06009808, -4.0f); + Animation_MorphToLoop(&this->skelAnime, &object_wf_Anim_009808, -4.0f); this->actionFunc = func_8099177C; } @@ -772,7 +756,7 @@ void func_8099177C(EnWf* this, GlobalContext* globalCtx) { void func_80991948(EnWf* this) { this->collider2.base.acFlags |= AC_ON; - Animation_MorphToLoop(&this->skelAnime, &D_06005700, -4.0f); + Animation_MorphToLoop(&this->skelAnime, &object_wf_Anim_005700, -4.0f); if (Rand_ZeroOne() > 0.5f) { this->unk_29A = 16000; } else { @@ -826,7 +810,7 @@ void func_809919F4(EnWf* this, GlobalContext* globalCtx) { void func_80991C04(EnWf* this) { this->collider2.base.acFlags |= AC_ON; - Animation_PlayOnce(&this->skelAnime, &D_06004638); + Animation_PlayOnce(&this->skelAnime, &object_wf_Anim_004638); this->collider1.base.atFlags &= ~AT_BOUNCED; this->actor.shape.rot.y = this->actor.yawTowardsPlayer; this->unk_2A0 = 7; @@ -896,7 +880,7 @@ void func_80991FD8(EnWf* this) { if (this->skelAnime.curFrame > 15.0f) { phi_f0 = 15.0f; } - Animation_Change(&this->skelAnime, &D_06004638, -0.5f, this->skelAnime.curFrame - 1.0f, phi_f0, 3, 0.0f); + Animation_Change(&this->skelAnime, &object_wf_Anim_004638, -0.5f, this->skelAnime.curFrame - 1.0f, phi_f0, 3, 0.0f); this->collider1.base.atFlags &= ~AT_ON; this->actionFunc = func_80992068; } @@ -939,7 +923,7 @@ void func_80992068(EnWf* this, GlobalContext* globalCtx) { void func_8099223C(EnWf* this) { this->collider2.base.acFlags &= ~AC_ON; - Animation_MorphToPlayOnce(&this->skelAnime, &D_06004A90, -3.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &object_wf_Anim_004A90, -3.0f); this->unk_2A0 = 0; this->actor.speedXZ = -6.0f; this->actor.shape.rot.y = this->actor.yawTowardsPlayer; @@ -989,7 +973,7 @@ void func_809923E4(EnWf* this, GlobalContext* globalCtx) { void func_8099245C(EnWf* this) { this->collider2.base.acFlags &= ~AC_ON; - Animation_MorphToPlayOnce(&this->skelAnime, &D_06009A50, -4.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &object_wf_Anim_009A50, -4.0f); if (this->actor.bgCheckFlags & 1) { this->actor.speedXZ = -4.0f; } @@ -1037,7 +1021,8 @@ void func_809924EC(EnWf* this, GlobalContext* globalCtx) { void func_809926D0(EnWf* this) { this->collider2.base.acFlags &= ~AC_ON; - Animation_Change(&this->skelAnime, &D_06004A90, -1.0f, Animation_GetLastFrame(&D_06004A90.common), 0.0f, 2, -3.0f); + Animation_Change(&this->skelAnime, &object_wf_Anim_004A90, -1.0f, + Animation_GetLastFrame(&object_wf_Anim_004A90.common), 0.0f, 2, -3.0f); this->unk_2A0 = 0; this->actor.speedXZ = 6.5f; this->actor.velocity.y = 15.0f; @@ -1068,7 +1053,8 @@ void func_8099282C(EnWf* this) { this->collider1.base.atFlags &= ~AT_ON; this->unk_2A0 = 10; this->actor.speedXZ = 0.0f; - Animation_Change(&this->skelAnime, &D_06004C44, -1.0f, Animation_GetLastFrame(&D_06004C44.common), 0.0f, 2, -2.0f); + Animation_Change(&this->skelAnime, &object_wf_Anim_004C44, -1.0f, + Animation_GetLastFrame(&object_wf_Anim_004C44.common), 0.0f, 2, -2.0f); this->actionFunc = func_809928CC; } @@ -1105,7 +1091,7 @@ void func_80992A74(EnWf* this, GlobalContext* globalCtx) { f32 temp_f0; this->collider2.base.acFlags |= AC_ON; - Animation_MorphToLoop(&this->skelAnime, &D_06005700, -4.0f); + Animation_MorphToLoop(&this->skelAnime, &object_wf_Anim_005700, -4.0f); player = GET_PLAYER(globalCtx); temp_f0 = Math_SinS((player->actor.shape.rot.y + this->unk_29A) - this->actor.yawTowardsPlayer); if (temp_f0 > 0.0f) { @@ -1167,7 +1153,7 @@ void func_80992B8C(EnWf* this, GlobalContext* globalCtx) { void func_80992D6C(EnWf* this) { this->collider2.base.acFlags &= ~AC_ON; - Animation_MorphToPlayOnce(&this->skelAnime, &D_060053D0, -4.0f); + Animation_MorphToPlayOnce(&this->skelAnime, &object_wf_Anim_0053D0, -4.0f); this->actor.world.rot.y = this->actor.yawTowardsPlayer; if (this->actor.bgCheckFlags & 1) { this->actor.speedXZ = -6.0f; @@ -1219,7 +1205,7 @@ void func_80992E0C(EnWf* this, GlobalContext* globalCtx) { } void func_80992FD4(EnWf* this) { - Animation_MorphToLoop(&this->skelAnime, &D_0600A3CC, -4.0f); + Animation_MorphToLoop(&this->skelAnime, &object_wf_Anim_00A3CC, -4.0f); this->actionFunc = func_80993018; } @@ -1246,7 +1232,7 @@ void func_80993018(EnWf* this, GlobalContext* globalCtx) { } void func_80993148(EnWf* this) { - Animation_MorphToLoop(&this->skelAnime, &D_06005700, -4.0f); + Animation_MorphToLoop(&this->skelAnime, &object_wf_Anim_005700, -4.0f); this->actor.speedXZ = 0.0f; this->actionFunc = func_80993194; } @@ -1291,7 +1277,7 @@ void func_80993194(EnWf* this, GlobalContext* globalCtx) { } void func_80993350(EnWf* this) { - Animation_MorphToLoop(&this->skelAnime, &D_06005700, -4.0f); + Animation_MorphToLoop(&this->skelAnime, &object_wf_Anim_005700, -4.0f); Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WOLFOS_APPEAR); this->actionFunc = func_809933A0; } @@ -1331,7 +1317,7 @@ void func_809933A0(EnWf* this, GlobalContext* globalCtx) { } void func_80993524(EnWf* this) { - Animation_MorphToLoop(&this->skelAnime, &D_06005700, -4.0f); + Animation_MorphToLoop(&this->skelAnime, &object_wf_Anim_005700, -4.0f); this->actor.speedXZ = 6.0f; this->actor.world.rot.y = this->actor.shape.rot.y; this->actionFunc = func_8099357C; diff --git a/src/overlays/actors/ovl_En_Zo/z_en_zo.c b/src/overlays/actors/ovl_En_Zo/z_en_zo.c index 730bcf10b..432fbec9d 100644 --- a/src/overlays/actors/ovl_En_Zo/z_en_zo.c +++ b/src/overlays/actors/ovl_En_Zo/z_en_zo.c @@ -1,10 +1,11 @@ /* * File: z_en_zo.c * Overlay: ovl_En_Zo - * Description: Zoras + * Description: Zoras (unused) */ #include "z_en_zo.h" +#include "objects/object_zo/object_zo.h" #define FLAGS 0x00000019 @@ -15,12 +16,12 @@ void EnZo_Destroy(Actor* thisx, GlobalContext* globalCtx); void EnZo_Update(Actor* thisx, GlobalContext* globalCtx); void EnZo_Draw(Actor* thisx, GlobalContext* globalCtx); -void func_8099EBD8(EnZo* this, GlobalContext* globalCtx); -void func_8099EC50(EnZo* this, GlobalContext* globalCtx); -void func_8099ED4C(EnZo* this, GlobalContext* globalCtx); -void func_8099EE24(EnZo* this, GlobalContext* globalCtx); +void EnZo_FollowPath(EnZo* this, GlobalContext* globalCtx); +void EnZo_TreadWater(EnZo* this, GlobalContext* globalCtx); +void EnZo_DoNothing(EnZo* this, GlobalContext* globalCtx); + +typedef enum { ZO_DMG_EFF_NONE } EnZoDamageEffect; -#if 0 const ActorInit En_Zo_InitVars = { ACTOR_EN_ZO, ACTORCAT_NPC, @@ -33,86 +34,333 @@ const ActorInit En_Zo_InitVars = { (ActorFunc)EnZo_Draw, }; -// static ColliderCylinderInit sCylinderInit = { -static ColliderCylinderInit D_8099F4B0 = { - { COLTYPE_HIT0, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_CYLINDER, }, - { ELEMTYPE_UNK1, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, }, +static ColliderCylinderInit sCylinderInit = { + { + COLTYPE_HIT0, + AT_NONE, + AC_ON | AC_TYPE_PLAYER, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK1, + { 0x00000000, 0x00, 0x00 }, + { 0xF7CFFFFF, 0x00, 0x00 }, + TOUCH_NONE | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 18, 64, 0, { 0, 0, 0 } }, }; -// sColChkInfoInit -static CollisionCheckInfoInit2 D_8099F4DC = { 0, 0, 0, 0, MASS_IMMOVABLE }; +static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; -// static DamageTable sDamageTable = { -static DamageTable D_8099F4E8 = { - /* Deku Nut */ DMG_ENTRY(0, 0x0), - /* Deku Stick */ DMG_ENTRY(0, 0x0), - /* Horse trample */ DMG_ENTRY(0, 0x0), - /* Explosives */ DMG_ENTRY(0, 0x0), - /* Zora boomerang */ DMG_ENTRY(0, 0x0), - /* Normal arrow */ DMG_ENTRY(0, 0x0), - /* UNK_DMG_0x06 */ DMG_ENTRY(0, 0x0), - /* Hookshot */ DMG_ENTRY(0, 0x0), - /* Goron punch */ DMG_ENTRY(0, 0x0), - /* Sword */ DMG_ENTRY(0, 0x0), - /* Goron pound */ DMG_ENTRY(0, 0x0), - /* Fire arrow */ DMG_ENTRY(0, 0x0), - /* Ice arrow */ DMG_ENTRY(0, 0x0), - /* Light arrow */ DMG_ENTRY(0, 0x0), - /* Goron spikes */ DMG_ENTRY(0, 0x0), - /* Deku spin */ DMG_ENTRY(0, 0x0), - /* Deku bubble */ DMG_ENTRY(0, 0x0), - /* Deku launch */ DMG_ENTRY(0, 0x0), - /* UNK_DMG_0x12 */ DMG_ENTRY(0, 0x0), - /* Zora barrier */ DMG_ENTRY(0, 0x0), - /* Normal shield */ DMG_ENTRY(0, 0x0), - /* Light ray */ DMG_ENTRY(0, 0x0), - /* Thrown object */ DMG_ENTRY(0, 0x0), - /* Zora punch */ DMG_ENTRY(0, 0x0), - /* Spin attack */ DMG_ENTRY(0, 0x0), - /* Sword beam */ DMG_ENTRY(0, 0x0), - /* Normal Roll */ DMG_ENTRY(0, 0x0), - /* UNK_DMG_0x1B */ DMG_ENTRY(0, 0x0), - /* UNK_DMG_0x1C */ DMG_ENTRY(0, 0x0), - /* Unblockable */ DMG_ENTRY(0, 0x0), - /* UNK_DMG_0x1E */ DMG_ENTRY(0, 0x0), - /* Powder Keg */ DMG_ENTRY(0, 0x0), +static DamageTable sDamageTable = { + /* Deku Nut */ DMG_ENTRY(0, ZO_DMG_EFF_NONE), + /* Deku Stick */ DMG_ENTRY(0, ZO_DMG_EFF_NONE), + /* Horse trample */ DMG_ENTRY(0, ZO_DMG_EFF_NONE), + /* Explosives */ DMG_ENTRY(0, ZO_DMG_EFF_NONE), + /* Zora boomerang */ DMG_ENTRY(0, ZO_DMG_EFF_NONE), + /* Normal arrow */ DMG_ENTRY(0, ZO_DMG_EFF_NONE), + /* UNK_DMG_0x06 */ DMG_ENTRY(0, ZO_DMG_EFF_NONE), + /* Hookshot */ DMG_ENTRY(0, ZO_DMG_EFF_NONE), + /* Goron punch */ DMG_ENTRY(0, ZO_DMG_EFF_NONE), + /* Sword */ DMG_ENTRY(0, ZO_DMG_EFF_NONE), + /* Goron pound */ DMG_ENTRY(0, ZO_DMG_EFF_NONE), + /* Fire arrow */ DMG_ENTRY(0, ZO_DMG_EFF_NONE), + /* Ice arrow */ DMG_ENTRY(0, ZO_DMG_EFF_NONE), + /* Light arrow */ DMG_ENTRY(0, ZO_DMG_EFF_NONE), + /* Goron spikes */ DMG_ENTRY(0, ZO_DMG_EFF_NONE), + /* Deku spin */ DMG_ENTRY(0, ZO_DMG_EFF_NONE), + /* Deku bubble */ DMG_ENTRY(0, ZO_DMG_EFF_NONE), + /* Deku launch */ DMG_ENTRY(0, ZO_DMG_EFF_NONE), + /* UNK_DMG_0x12 */ DMG_ENTRY(0, ZO_DMG_EFF_NONE), + /* Zora barrier */ DMG_ENTRY(0, ZO_DMG_EFF_NONE), + /* Normal shield */ DMG_ENTRY(0, ZO_DMG_EFF_NONE), + /* Light ray */ DMG_ENTRY(0, ZO_DMG_EFF_NONE), + /* Thrown object */ DMG_ENTRY(0, ZO_DMG_EFF_NONE), + /* Zora punch */ DMG_ENTRY(0, ZO_DMG_EFF_NONE), + /* Spin attack */ DMG_ENTRY(0, ZO_DMG_EFF_NONE), + /* Sword beam */ DMG_ENTRY(0, ZO_DMG_EFF_NONE), + /* Normal Roll */ DMG_ENTRY(0, ZO_DMG_EFF_NONE), + /* UNK_DMG_0x1B */ DMG_ENTRY(0, ZO_DMG_EFF_NONE), + /* UNK_DMG_0x1C */ DMG_ENTRY(0, ZO_DMG_EFF_NONE), + /* Unblockable */ DMG_ENTRY(0, ZO_DMG_EFF_NONE), + /* UNK_DMG_0x1E */ DMG_ENTRY(0, ZO_DMG_EFF_NONE), + /* Powder Keg */ DMG_ENTRY(0, ZO_DMG_EFF_NONE), }; -#endif +static ActorAnimationEntryS sAnimations[] = { + { &gZoraIdleAnim, 1.0f, 0, -1, 0, 0 }, { &gZoraIdleAnim, 1.0f, 0, -1, 0, -4 }, + { &gZoraSurfacingAnim, 1.0f, 0, -1, 0, -4 }, { &gZoraHandsOnHipsTappingFootAnim, 1.0f, 0, -1, 0, -4 }, + { &gZoraArmsOpenAnim, 1.0f, 0, -1, 0, -4 }, { &gZoraThrowRupeeAnim, 1.0f, 0, -1, 0, -4 }, + { &gZoraWalkAnim, 1.0f, 0, -1, 0, -4 }, +}; -extern ColliderCylinderInit D_8099F4B0; -extern CollisionCheckInfoInit2 D_8099F4DC; -extern DamageTable D_8099F4E8; +s8 D_8099F578[] = { -1, 1, 12, 13, 14, 9, 10, 11, 0, 6, 7, 8, 3, 4, 5, 2, -1, -1, -1, -1 }; +s8 D_8099F58C[] = { 0, 0, 0, 0, 3, 4, 0, 6, 7, 0, 9, 10, 0, 12, 13 }; +u8 D_8099F59C[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -extern UNK_TYPE D_0600D208; +s32 EnZo_SetAnimation(SkelAnime* skelAnime, s16 index) { + s16 frameCount; + s32 didChange = false; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zo/func_8099E790.s") + if ((index >= 0) && (index < ARRAY_COUNT(sAnimations))) { + didChange = true; + frameCount = sAnimations[index].frameCount; + if (frameCount < 0) { + frameCount = Animation_GetLastFrame(sAnimations[index].animationSeg); + } + Animation_Change(skelAnime, sAnimations[index].animationSeg, sAnimations[index].playbackSpeed, + sAnimations[index].frame, frameCount, sAnimations[index].mode, + sAnimations[index].transitionRate); + } + return didChange; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zo/func_8099E858.s") +s32 EnZo_PlayWalkingSound(EnZo* this, GlobalContext* globalCtx) { + u8 leftWasGrounded; + u8 rightWasGrounded; + s32 waterSfxId; + u16 sfxId; + u8 isFootGrounded; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zo/func_8099E96C.s") + leftWasGrounded = this->isLeftFootGrounded; + rightWasGrounded = this->isRightFootGrounded; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zo/func_8099E9E0.s") + if (this->actor.bgCheckFlags & 0x20) { + if (this->actor.depthInWater < 20.0f) { + waterSfxId = NA_SE_PL_WALK_WATER0 - SFX_FLAG; + } else { + waterSfxId = NA_SE_PL_WALK_WATER1 - SFX_FLAG; + } + sfxId = waterSfxId + SFX_FLAG; + } else { + sfxId = SurfaceType_GetSfx(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId) + SFX_FLAG; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zo/func_8099EA60.s") + this->isLeftFootGrounded = isFootGrounded = func_8013DB90(globalCtx, &this->leftFootPos, -6.0f); + if ((this->isLeftFootGrounded) && (!leftWasGrounded) && (isFootGrounded)) { + Actor_PlaySfxAtPos(&this->actor, sfxId); + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zo/func_8099EBD8.s") + this->isRightFootGrounded = isFootGrounded = func_8013DB90(globalCtx, &this->rightFootPos, -6.0f); + if ((this->isRightFootGrounded) && (!rightWasGrounded) && (isFootGrounded)) { + Actor_PlaySfxAtPos(&this->actor, sfxId); + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zo/func_8099EC50.s") + return 0; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zo/func_8099ED4C.s") +void EnZo_Blink(EnZo* this, s32 maxEyeIndex) { + if (DECR(this->blinkTimer) == 0) { + this->eyeIndex++; + if (this->eyeIndex >= maxEyeIndex) { + this->eyeIndex = 0; + this->blinkTimer = Rand_S16Offset(30, 30); + } + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zo/func_8099EE24.s") +void EnZo_UpdateCollider(EnZo* this, GlobalContext* globalCtx) { + this->collider.dim.pos.x = this->actor.world.pos.x; + this->collider.dim.pos.y = this->actor.world.pos.y; + this->collider.dim.pos.z = this->actor.world.pos.z; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zo/EnZo_Init.s") + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zo/EnZo_Destroy.s") +void EnZo_LookAtPlayer(EnZo* this, GlobalContext* globalCtx) { + static u16 D_8099F5AC[] = { 4000, 4, 1, 3, 6000, 4, 1, 6, 4000, 4, 1, 3, 6000, 4, 1, 6 }; + Player* player = GET_PLAYER(globalCtx); + Vec3f focus; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zo/EnZo_Update.s") + SkelAnime_Update(&this->skelAnime); + if (func_8013D5E8(this->actor.shape.rot.y, 10000, this->actor.yawTowardsPlayer)) { + focus.x = player->actor.world.pos.x; + focus.y = player->bodyPartsPos[7].y + 3.0f; + focus.z = player->actor.world.pos.z; + func_8013D2E0(&focus, &this->actor.focus.pos, &this->actor.shape.rot, &this->headRotTarget, &this->headRot, + &this->upperBodyRot, D_8099F5AC); + } else { + Math_SmoothStepToS(&this->headRotTarget.x, 0, 4, 1000, 1); + Math_SmoothStepToS(&this->headRotTarget.y, 0, 4, 1000, 1); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zo/func_8099EFF4.s") + Math_SmoothStepToS(&this->headRot.x, 0, 4, 1000, 1); + Math_SmoothStepToS(&this->headRot.y, 0, 4, 1000, 1); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zo/func_8099F15C.s") + Math_SmoothStepToS(&this->upperBodyRot.x, 0, 4, 1000, 1); + Math_SmoothStepToS(&this->upperBodyRot.y, 0, 4, 1000, 1); + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zo/EnZo_Draw.s") + EnZo_Blink(this, 3); + func_8013D9C8(globalCtx, this->limbRotY, this->limbRotZ, 20); +} + +void EnZo_Walk(EnZo* this, GlobalContext* globalCtx) { + if (ENZO_GET_PATH(&this->actor) != ENZO_NO_PATH) { + EnZo_SetAnimation(&this->skelAnime, 6); + } + + if (ENZO_GET_PATH(&this->actor) != ENZO_NO_PATH) { + this->actionFunc = EnZo_FollowPath; + } else { + this->actionFunc = EnZo_DoNothing; + } +} + +void EnZo_FollowPath(EnZo* this, GlobalContext* globalCtx) { + s16 speed; + Vec3f pos; + + Math_SmoothStepToF(&this->actor.speedXZ, 1.0f, 0.4f, 1000.0f, 0.0f); + speed = this->actor.speedXZ * 400.0f; + if (func_8013D68C(this->path, this->waypoint, &pos) && func_8013D768(&this->actor, &pos, speed)) { + this->waypoint++; + if (this->waypoint >= this->path->count) { + this->waypoint = 0; + } + } + + if (this->actor.depthInWater > 60.0f) { + EnZo_SetAnimation(&this->skelAnime, 1); + this->actionFunc = EnZo_TreadWater; + this->actor.gravity = 0.0f; + this->actor.speedXZ = 0.0f; + } +} + +void EnZo_TreadWater(EnZo* this, GlobalContext* globalCtx) { + f32 targetYVel; + + if (this->actor.depthInWater < (sREG(0) + 50.0f)) { + targetYVel = -1.0f; + } else { + targetYVel = 1.0f; + } + Math_ApproachF(&this->actor.velocity.y, targetYVel, (sREG(1) + 18.0f) * 0.01f, (sREG(2) + 12.0f) * 0.01f); +} + +void EnZo_DoNothing(EnZo* this, GlobalContext* globalCtx) { +} + +void EnZo_Init(Actor* thisx, GlobalContext* globalCtx) { + EnZo* this = THIS; + s32 pad; + + ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gZoraSkel, NULL, this->jointTable, this->morphTable, 20); + EnZo_SetAnimation(&this->skelAnime, 0); + + Collider_InitCylinder(globalCtx, &this->collider); + Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); + CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); + + this->path = func_8013D648(globalCtx, ENZO_GET_PATH(&this->actor), ENZO_NO_PATH); + Actor_SetScale(&this->actor, 0.01f); + + this->actionFunc = EnZo_Walk; + this->actor.gravity = -4.0f; +} + +void EnZo_Destroy(Actor* thisx, GlobalContext* globalCtx) { + EnZo* this = THIS; + + Collider_DestroyCylinder(globalCtx, &this->collider); +} + +void EnZo_Update(Actor* thisx, GlobalContext* globalCtx) { + EnZo* this = THIS; + + this->actionFunc(this, globalCtx); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4); + EnZo_LookAtPlayer(this, globalCtx); + EnZo_PlayWalkingSound(this, globalCtx); + EnZo_UpdateCollider(this, globalCtx); +} + +s32 EnZo_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx, + Gfx** gfx) { + EnZo* this = THIS; + + if (limbIndex == 15) { + Matrix_InsertTranslation(1500.0f, 0.0f, 0.0f, MTXMODE_APPLY); + Matrix_InsertXRotation_s(this->headRot.y, MTXMODE_APPLY); + Matrix_InsertZRotation_s(-this->headRot.x, MTXMODE_APPLY); + Matrix_InsertTranslation(-1500.0f, 0.0f, 0.0f, MTXMODE_APPLY); + } + + if (limbIndex == 8) { + Matrix_InsertXRotation_s(-this->upperBodyRot.y, MTXMODE_APPLY); + Matrix_InsertZRotation_s(-this->upperBodyRot.x, MTXMODE_APPLY); + } + + if ((limbIndex == 8) || (limbIndex == 9) || (limbIndex == 12)) { + rot->y += (s16)(Math_SinS(this->limbRotY[limbIndex]) * 200.0f); + rot->z += (s16)(Math_CosS(this->limbRotZ[limbIndex]) * 200.0f); + } + return false; +} + +void EnZo_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx, Gfx** gfx) { + EnZo* this = THIS; + Vec3f sp30 = { 400.0f, 0.0f, 0.0f }; + Vec3f zeroVec = { 0.0f, 0.0f, 0.0f }; + + if (D_8099F578[limbIndex] >= 0) { + Matrix_MultiplyVector3fByState(&zeroVec, &this->unk_364[D_8099F578[limbIndex]]); + } + if (limbIndex == 15) { + Matrix_MultiplyVector3fByState(&sp30, &this->actor.focus.pos); + } + if (limbIndex == 4) { + Matrix_MultiplyVector3fByState(&zeroVec, &this->leftFootPos); + } + if (limbIndex == 7) { + Matrix_MultiplyVector3fByState(&zeroVec, &this->rightFootPos); + } +} + +static Gfx sTransparencyDlist[] = { + gsDPSetRenderMode(AA_EN | Z_CMP | Z_UPD | IM_RD | CLR_ON_CVG | CVG_DST_WRAP | ZMODE_XLU | FORCE_BL | + G_RM_FOG_SHADE_A, + AA_EN | Z_CMP | Z_UPD | IM_RD | CLR_ON_CVG | CVG_DST_WRAP | ZMODE_XLU | FORCE_BL | + GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)), + gsDPSetAlphaCompare(G_AC_THRESHOLD), + gsSPEndDisplayList(), +}; + +void EnZo_Draw(Actor* thisx, GlobalContext* globalCtx) { + EnZo* this = THIS; + s32 i; + u8* shadowTex = GRAPH_ALLOC(globalCtx->state.gfxCtx, sizeof(u8) * SQ(64)); + u8* shadowTexIter; + TexturePtr eyeTextures[] = { &gZoraEyeOpenTex, &gZoraEyeHalfTex, &gZoraEyeClosedTex }; + + OPEN_DISPS(globalCtx->state.gfxCtx); + func_8012C28C(globalCtx->state.gfxCtx); + + gDPPipeSync(POLY_OPA_DISP++); + gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 255); + gDPPipeSync(POLY_OPA_DISP++); + gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(eyeTextures[this->eyeIndex])); + gSPSegment(POLY_OPA_DISP++, 0x0C, &sTransparencyDlist[2]); + + POLY_OPA_DISP = + SkelAnime_DrawFlex(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, + EnZo_OverrideLimbDraw, EnZo_PostLimbDraw, &this->actor, POLY_OPA_DISP); + Matrix_InsertXRotation_s(0, 0); + + for (i = 0, shadowTexIter = shadowTex; i < (s32)sizeof(u8) * SQ(64); i++) { + *shadowTexIter = 0; + shadowTexIter++; + } + for (i = 0; i < 5; i++) { + func_8013CD64(this->unk_364, &this->actor.world.pos, shadowTex, i / 5.0f, 15, D_8099F59C, D_8099F58C); + } + + func_8013CF04(&this->actor, &globalCtx->state.gfxCtx, shadowTex); + CLOSE_DISPS(globalCtx->state.gfxCtx); +} diff --git a/src/overlays/actors/ovl_En_Zo/z_en_zo.h b/src/overlays/actors/ovl_En_Zo/z_en_zo.h index a823a1ec0..0b9f8dab1 100644 --- a/src/overlays/actors/ovl_En_Zo/z_en_zo.h +++ b/src/overlays/actors/ovl_En_Zo/z_en_zo.h @@ -7,12 +7,33 @@ struct EnZo; typedef void (*EnZoActionFunc)(struct EnZo*, GlobalContext*); +#define ENZO_GET_PATH(thisx) (((thisx)->params & 0x7E00) >> 9) +#define ENZO_NO_PATH 0x3F + typedef struct EnZo { /* 0x0000 */ Actor actor; /* 0x0144 */ EnZoActionFunc actionFunc; - /* 0x0148 */ char unk_148[0x2DC]; + /* 0x0148 */ SkelAnime skelAnime; + /* 0x0194 */ ColliderCylinder collider; + /* 0x01D8 */ UNK_TYPE1 unk_1D8[0x4]; + /* 0x01DC */ Path* path; + /* 0x01E0 */ s16 waypoint; + /* 0x01E4 */ Vec3f leftFootPos; + /* 0x01F0 */ Vec3f rightFootPos; + /* 0x01FC */ u8 isLeftFootGrounded; + /* 0x01FD */ u8 isRightFootGrounded; + /* 0x01FE */ Vec3s jointTable[20]; + /* 0x0276 */ Vec3s morphTable[20]; + /* 0x02EE */ Vec3s headRotTarget; + /* 0x02F4 */ Vec3s headRot; + /* 0x02FA */ Vec3s upperBodyRot; + /* 0x0300 */ UNK_TYPE1 unk_300[0x12]; + /* 0x0312 */ s16 limbRotY[20]; + /* 0x033A */ s16 limbRotZ[20]; + /* 0x0364 */ Vec3f unk_364[15]; + /* 0x041A */ UNK_TYPE1 unk_41A[0x6]; + /* 0x041E */ s16 eyeIndex; + /* 0x0420 */ s16 blinkTimer; } EnZo; // size = 0x424 -extern const ActorInit En_Zo_InitVars; - #endif // Z_EN_ZO_H diff --git a/src/overlays/actors/ovl_En_Zog/z_en_zog.c b/src/overlays/actors/ovl_En_Zog/z_en_zog.c index edd5c56b5..fa59fd48a 100644 --- a/src/overlays/actors/ovl_En_Zog/z_en_zog.c +++ b/src/overlays/actors/ovl_En_Zog/z_en_zog.c @@ -65,9 +65,9 @@ static ColliderCylinderInit sCylinderInit = { { 30, 40, 0, { 0, 0, 0 } }, }; -static TexturePtr D_80B958AC[] = { &object_zog_Tex_024750, &object_zog_Tex_024F50, &object_zog_Tex_025750 }; +static TexturePtr D_80B958AC[] = { object_zog_Tex_024750, object_zog_Tex_024F50, object_zog_Tex_025750 }; -static TexturePtr D_80B958B8[] = { &object_zog_Tex_025F50, &object_zog_Tex_026750 }; +static TexturePtr D_80B958B8[] = { object_zog_Tex_025F50, object_zog_Tex_026750 }; static AnimationHeader* D_80B958C0[] = { &object_zog_Anim_00FC0C, &object_zog_Anim_0106B0, &object_zog_Anim_0166F4, &object_zog_Anim_017170, diff --git a/src/overlays/actors/ovl_En_Zos/z_en_zos.c b/src/overlays/actors/ovl_En_Zos/z_en_zos.c index 713547400..d18469e23 100644 --- a/src/overlays/actors/ovl_En_Zos/z_en_zos.c +++ b/src/overlays/actors/ovl_En_Zos/z_en_zos.c @@ -5,8 +5,9 @@ */ #include "z_en_zos.h" +#include "objects/object_zos/object_zos.h" -#define FLAGS 0x02000009 +#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_2000000) #define THIS ((EnZos*)thisx) @@ -15,7 +16,24 @@ void EnZos_Destroy(Actor* thisx, GlobalContext* globalCtx); void EnZos_Update(Actor* thisx, GlobalContext* globalCtx); void EnZos_Draw(Actor* thisx, GlobalContext* globalCtx); -#if 0 +void func_80BBAE84(EnZos* this, s16 arg1, u8 arg2); +void func_80BBB2C4(EnZos* this, GlobalContext* globalCtx); +void func_80BBB354(EnZos* this, GlobalContext* globalCtx); +void func_80BBB4CC(EnZos* this, GlobalContext* globalCtx); +void func_80BBB574(EnZos* this, GlobalContext* globalCtx); +void func_80BBB718(EnZos* this, GlobalContext* globalCtx); +void func_80BBB8AC(EnZos* this, GlobalContext* globalCtx); +void func_80BBBB84(EnZos* this, GlobalContext* globalCtx); +void func_80BBBCBC(EnZos* this, GlobalContext* globalCtx); +void func_80BBBD5C(EnZos* this, GlobalContext* globalCtx); +void func_80BBBDE0(EnZos* this, GlobalContext* globalCtx); +void func_80BBC070(EnZos* this, GlobalContext* globalCtx); +void func_80BBC14C(EnZos* this, GlobalContext* globalCtx); +void func_80BBC22C(EnZos* this, GlobalContext* globalCtx); +void func_80BBC24C(EnZos* this, GlobalContext* globalCtx); +void func_80BBC298(EnZos* this, GlobalContext* globalCtx); +void func_80BBC37C(EnZos* this, GlobalContext* globalCtx); + const ActorInit En_Zos_InitVars = { ACTOR_EN_ZOS, ACTORCAT_NPC, @@ -28,74 +46,695 @@ const ActorInit En_Zos_InitVars = { (ActorFunc)EnZos_Draw, }; -// static ColliderCylinderInit sCylinderInit = { -static ColliderCylinderInit D_80BBC6F0 = { - { COLTYPE_NONE, AT_NONE, AC_ON | AC_TYPE_ENEMY, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_CYLINDER, }, - { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, }, +static ColliderCylinderInit sCylinderInit = { + { + COLTYPE_NONE, + AT_NONE, + AC_ON | AC_TYPE_ENEMY, + OC1_ON | OC1_TYPE_ALL, + OC2_TYPE_1, + COLSHAPE_CYLINDER, + }, + { + ELEMTYPE_UNK0, + { 0x00000000, 0x00, 0x00 }, + { 0xF7CFFFFF, 0x00, 0x00 }, + TOUCH_NONE | TOUCH_SFX_NORMAL, + BUMP_ON, + OCELEM_ON, + }, { 60, 40, 0, { 0, 0, 0 } }, }; -#endif +void EnZos_Init(Actor* thisx, GlobalContext* globalCtx) { + EnZos* this = THIS; -extern ColliderCylinderInit D_80BBC6F0; + Actor_SetScale(&this->actor, 0.0115f); + this->actionFunc = func_80BBBDE0; + ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); + this->actor.colChkInfo.mass = MASS_IMMOVABLE; + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_zos_Skel_015238, &object_zos_Anim_00A164, this->jointTable, + this->morphTable, 18); + Animation_PlayLoop(&this->skelAnime, &object_zos_Anim_00A164); + Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); + this->unk_2B6 = 0; + this->actor.terminalVelocity = -4.0f; + this->actor.gravity = -4.0f; + func_80BBAE84(this, 0, 2); -extern UNK_TYPE D_0600A164; -extern UNK_TYPE D_060136E0; + switch (ENZOS_GET_F(&this->actor)) { + case ENZOS_F_1: + if (!(gSaveContext.save.weekEventReg[55] & 0x80)) { + Actor_MarkForDeath(&this->actor); + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/EnZos_Init.s") + if (gSaveContext.save.weekEventReg[78] & 1) { + this->actionFunc = func_80BBC24C; + } else { + this->actionFunc = func_80BBC14C; + } + func_80BBAE84(this, 0, 2); + break; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/EnZos_Destroy.s") + case ENZOS_F_2: + this->actionFunc = func_80BBC37C; + func_80BBAE84(this, 7, 2); + this->unk_2BC = -1; + this->unk_2B6 |= 0x40; + break; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBAE84.s") + default: + if (gSaveContext.save.weekEventReg[55] & 0x80) { + Actor_MarkForDeath(&this->actor); + } + this->actor.flags |= ACTOR_FLAG_10; + break; + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBAF5C.s") +void EnZos_Destroy(Actor* thisx, GlobalContext* globalCtx) { + EnZos* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBAFFC.s") + gSaveContext.save.weekEventReg[52] &= (u8)~0x10; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBB0D4.s") +void func_80BBAE84(EnZos* this, s16 arg1, u8 arg2) { + static AnimationHeader* sAnimations[] = { + &object_zos_Anim_00A164, &object_zos_Anim_01621C, &object_zos_Anim_016980, &object_zos_Anim_007C40, + &object_zos_Anim_008630, &object_zos_Anim_0090CC, &object_zos_Anim_009830, &object_zos_Anim_005E04, + &object_zos_Anim_007334, &object_zos_Anim_0048D4, &object_zos_Anim_001CFC, &object_zos_Anim_005E04, + &object_zos_Anim_007334, + }; + f32 phi_f0; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBB15C.s") + if ((arg1 != this->unk_2B8) && (arg1 >= 0) && (arg1 < 13)) { + if (arg1 > 10) { + phi_f0 = 29.0f; + } else { + phi_f0 = Animation_GetLastFrame(sAnimations[arg1]); + } + Animation_Change(&this->skelAnime, sAnimations[arg1], 1.0f, 0.0f, phi_f0, arg2, -5.0f); + this->unk_2B8 = arg1; + this->unk_2B6 &= ~0x80; + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBB2C4.s") +s32 func_80BBAF5C(EnZos* this, GlobalContext* globalCtx) { + if (Player_IsFacingActor(&this->actor, 0x3000, globalCtx) && + ((!Actor_IsFacingPlayer(&this->actor, 0x4000) && (this->actor.home.rot.y == this->actor.shape.rot.y)) || + (Actor_IsFacingPlayer(&this->actor, 0x3000) && (this->actor.home.rot.y != this->actor.shape.rot.y))) && + (this->actor.xzDistToPlayer < 100.0f)) { + return true; + } + return false; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBB354.s") +s32 func_80BBAFFC(EnZos* this, GlobalContext* globalCtx) { + if (SkelAnime_Update(&this->skelAnime)) { + switch ((s16)Rand_ZeroFloat(4.0f)) { + case 0: + func_80BBAE84(this, 7, 2); + break; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBB414.s") + case 1: + func_80BBAE84(this, 8, 2); + break; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBB4CC.s") + case 2: + func_80BBAE84(this, 11, 2); + break; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBB574.s") + default: + func_80BBAE84(this, 12, 2); + break; + } + return true; + } + return false; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBB718.s") +void func_80BBB0D4(EnZos* this, GlobalContext* globalCtx) { + if (SkelAnime_Update(&this->skelAnime)) { + if (Rand_ZeroFloat(1.0f) < 0.9f) { + func_80BBAE84(this, 0, 2); + } else { + func_80BBAE84(this, 1, 2); + } + SkelAnime_Update(&this->skelAnime); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBB8AC.s") +void func_80BBB15C(EnZos* this, GlobalContext* globalCtx) { + s32 textId; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBBB84.s") + if (gSaveContext.save.playerForm == PLAYER_FORM_ZORA) { + if (this->unk_2B6 & 8) { + textId = 0x1235; + func_80BBAE84(this, 6, 0); + this->unk_2B6 |= 2; + } else if (this->unk_2B6 & 4) { + textId = 0x123E; + func_80BBAE84(this, 6, 0); + this->unk_2B6 |= 2; + } else if (gSaveContext.save.weekEventReg[40] & 0x20) { + textId = 0x1236; + func_80BBAE84(this, 6, 0); + this->unk_2B6 |= 0x80; + } else { + textId = 0x1231; + func_80BBAE84(this, 6, 0); + this->unk_2B6 |= 0x80; + } + } else { + this->unk_2B6 &= ~2; + if (gSaveContext.save.weekEventReg[39] & 0x10) { + textId = 0x1243; + func_80BBAE84(this, 6, 0); + this->unk_2B6 |= 0x80; + } else { + textId = 0x1244; + gSaveContext.save.weekEventReg[39] |= 0x10; + func_80BBAE84(this, 4, 0); + this->unk_2B6 |= 0x10; + } + } + func_801518B0(globalCtx, textId, &this->actor); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBBCBC.s") +void func_80BBB2C4(EnZos* this, GlobalContext* globalCtx) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { + func_801518B0(globalCtx, 0x124F, &this->actor); + this->actionFunc = func_80BBB8AC; + this->actor.flags &= ~ACTOR_FLAG_10000; + } else { + func_800B8500(&this->actor, globalCtx, 1000.0f, 1000.0f, -1); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBBD5C.s") +void func_80BBB354(EnZos* this, GlobalContext* globalCtx) { + s32 item; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBBDE0.s") + if (Actor_HasParent(&this->actor, globalCtx)) { + this->actor.parent = NULL; + this->actionFunc = func_80BBB2C4; + gSaveContext.save.weekEventReg[39] |= 0x20; + this->actor.flags |= ACTOR_FLAG_10000; + func_800B8500(&this->actor, globalCtx, 1000.0f, 1000.0f, -1); + } else { + if (gSaveContext.save.weekEventReg[39] & 0x20) { + item = GI_RUPEE_PURPLE; + } else { + item = GI_HEART_PIECE; + } + Actor_PickUp(&this->actor, globalCtx, item, 10000.0f, 50.0f); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBBFBC.s") +void func_80BBB414(EnZos* this, GlobalContext* globalCtx) { + SkelAnime_Update(&this->skelAnime); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBC070.s") + if (func_800EE29C(globalCtx, 0x1F5)) { + s16 temp = globalCtx->csCtx.npcActions[func_800EE200(globalCtx, 0x1F5)]->unk0; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBC14C.s") + if (temp != this->unk_2BA) { + this->unk_2BA = temp; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBC22C.s") + switch (temp) { + case 1: + func_80BBAE84(this, 1, 0); + break; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBC24C.s") + case 2: + func_80BBAE84(this, 10, 0); + break; + } + } + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBC298.s") +void func_80BBB4CC(EnZos* this, GlobalContext* globalCtx) { + func_80BBB414(this, globalCtx); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBC37C.s") + if ((this->actor.cutscene != -1) && (ActorCutscene_GetCurrentIndex() != this->actor.cutscene)) { + if (ActorCutscene_GetCurrentIndex() == 0x7C) { + ActorCutscene_Stop(0x7C); + ActorCutscene_SetIntentToPlay(this->actor.cutscene); + } else if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) { + ActorCutscene_Start(this->actor.cutscene, &this->actor); + this->actor.cutscene = -1; + } else { + ActorCutscene_SetIntentToPlay(this->actor.cutscene); + } + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/EnZos_Update.s") +void func_80BBB574(EnZos* this, GlobalContext* globalCtx) { + if (!(this->unk_2B6 & 0x10)) { + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0x1000, 0x200); + this->actor.world.rot.y = this->actor.shape.rot.y; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBC4E4.s") + if (func_80BBAFFC(this, globalCtx)) { + if (this->unk_2B6 & 0x20) { + this->unk_2B6 &= ~0x20; + func_80151938(globalCtx, 0x124C); + } + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBC500.s") + if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { + switch (globalCtx->msgCtx.unk11F04) { + case 0x124B: + if (this->unk_2B8 == 9) { + globalCtx->msgCtx.unk11F10 = 0; + this->unk_2B6 |= 0x20; + } else { + func_80151938(globalCtx, 0x124C); + } + break; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/EnZos_Draw.s") + case 0x124C: + globalCtx->msgCtx.unk11F10 = 0; + this->actionFunc = func_80BBB4CC; + func_80BBAE84(this, 10, 0); + break; + + case 0x124D: + this->unk_2B6 &= ~0x10; + func_80BBAE84(this, 6, 0); + func_80151938(globalCtx, 0x124E); + break; + + case 0x124E: + func_801477B4(globalCtx); + this->actionFunc = func_80BBB354; + func_80BBB354(this, globalCtx); + break; + } + } +} + +void func_80BBB718(EnZos* this, GlobalContext* globalCtx) { + s32 sp24; + Player* player = GET_PLAYER(globalCtx); + + SkelAnime_Update(&this->skelAnime); + + if (Message_GetState(&globalCtx->msgCtx) == 0x10) { + sp24 = func_80123810(globalCtx); + if (sp24 > 0) { + func_801477B4(globalCtx); + + if (sp24 == 25) { + player->actor.textId = 0x1232; + func_80BBAE84(this, 5, 0); + this->unk_2B6 |= 8; + gSaveContext.save.weekEventReg[40] |= 0x20; + } else if (gSaveContext.save.weekEventReg[39] & 8) { + player->actor.textId = 0x1241; + } else { + player->actor.textId = 0x1237; + gSaveContext.save.weekEventReg[39] |= 8; + func_80BBAE84(this, 4, 0); + this->unk_2B6 |= 4; + } + this->actionFunc = func_80BBB8AC; + } else if (sp24 < 0) { + if (gSaveContext.save.weekEventReg[39] & 8) { + func_80151938(globalCtx, 0x1241); + } else { + func_80151938(globalCtx, 0x1237); + gSaveContext.save.weekEventReg[39] |= 8; + func_80BBAE84(this, 4, 0); + this->unk_2B6 |= 4; + } + this->actionFunc = func_80BBB8AC; + } + } +} + +void func_80BBB8AC(EnZos* this, GlobalContext* globalCtx) { + s32 pad; + Player* player = GET_PLAYER(globalCtx); + + SkelAnime_Update(&this->skelAnime); + + if (!(this->unk_2B6 & 0x10)) { + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0x1000, 0x200); + this->actor.world.rot.y = this->actor.shape.rot.y; + if ((this->unk_2B6 & 0x80) && (this->actor.yawTowardsPlayer == this->actor.shape.rot.y)) { + func_80BBAE84(this, 3, 0); + } + } + + if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) { + switch (globalCtx->msgCtx.unk11F04) { + case 0x1237: + player->exchangeItemId = 0; + + case 0x1238: + case 0x123A: + case 0x123B: + case 0x123C: + case 0x123E: + case 0x123F: + func_80151938(globalCtx, globalCtx->msgCtx.unk11F04 + 1); + break; + + case 0x1244: + this->unk_2B6 &= ~0x10; + func_80BBAE84(this, 6, 0); + func_80151938(globalCtx, globalCtx->msgCtx.unk11F04 + 1); + break; + + case 0x1232: + case 0x1241: + player->exchangeItemId = 0; + + case 0x1239: + case 0x1246: + func_80BBAE84(this, 6, 0); + func_80151938(globalCtx, globalCtx->msgCtx.unk11F04 + 1); + break; + + case 0x1233: + func_80BBAE84(this, 5, 0); + func_80151938(globalCtx, globalCtx->msgCtx.unk11F04 + 1); + break; + + case 0x1245: + case 0x1248: + func_80BBAE84(this, 3, 0); + func_80151938(globalCtx, globalCtx->msgCtx.unk11F04 + 1); + break; + + case 0x1231: + func_80151938(globalCtx, 0xFF); + this->actionFunc = func_80BBB718; + break; + + case 0x1243: + case 0x1249: + func_80BBAE84(this, 2, 0); + func_801477B4(globalCtx); + this->actionFunc = func_80BBBDE0; + this->unk_2B6 |= 1; + break; + + case 0x1234: + case 0x123D: + case 0x1242: + func_80BBAE84(this, 2, 0); + Actor_ProcessTalkRequest(&this->actor, &globalCtx->state); + func_801477B4(globalCtx); + this->actionFunc = func_80BBBDE0; + this->unk_2B6 |= 1; + break; + + case 0x1236: + func_80BBAE84(this, 2, 0); + func_801477B4(globalCtx); + this->actionFunc = func_80BBBDE0; + this->unk_2B6 |= 1; + break; + + default: + if (0) {} + func_801477B4(globalCtx); + this->actionFunc = func_80BBBDE0; + this->unk_2B6 |= 1; + break; + } + } +} + +void func_80BBBB84(EnZos* this, GlobalContext* globalCtx) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { + this->actor.flags &= ~ACTOR_FLAG_10000; + if (gSaveContext.save.playerForm == PLAYER_FORM_ZORA) { + func_801518B0(globalCtx, 0x1248, &this->actor); + this->actionFunc = func_80BBB8AC; + func_80BBAE84(this, 6, 0); + this->unk_2B6 |= 2; + } else if (gSaveContext.save.weekEventReg[41] & 0x10) { + func_801518B0(globalCtx, 0x124A, &this->actor); + this->actionFunc = func_80BBB8AC; + func_80BBAE84(this, 6, 0); + } else { + gSaveContext.save.weekEventReg[41] |= 0x10; + func_801518B0(globalCtx, 0x124B, &this->actor); + this->actionFunc = func_80BBB574; + func_80BBAE84(this, 9, 2); + this->unk_2B6 |= 0x10; + } + } else { + func_800B8614(&this->actor, globalCtx, 300.0f); + } +} + +void func_80BBBCBC(EnZos* this, GlobalContext* globalCtx) { + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { + this->actor.flags &= ~ACTOR_FLAG_10000; + func_80BBAE84(this, 5, 0); + func_801518B0(globalCtx, 0x124D, &this->actor); + this->actionFunc = func_80BBB574; + } else { + func_800B8500(&this->actor, globalCtx, 1000.0f, 1000.0f, -1); + } +} + +void func_80BBBD5C(EnZos* this, GlobalContext* globalCtx) { + func_80BBB414(this, globalCtx); + if (!func_800EE29C(globalCtx, 0x1F5)) { + this->actionFunc = func_80BBBCBC; + this->actor.flags |= ACTOR_FLAG_10000; + func_800B8500(&this->actor, globalCtx, 1000.0f, 1000.0f, -1); + } +} + +void func_80BBBDE0(EnZos* this, GlobalContext* globalCtx) { + Actor* thisx = &this->actor; + Vec3f sp28; + + if (this->unk_2B6 & 1) { + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, 2, 0x1000, 0x200); + this->actor.world.rot.y = thisx->shape.rot.y; + if (this->actor.home.rot.y == thisx->shape.rot.y) { + func_80BBAE84(this, 0, 2); + this->unk_2B6 &= ~1; + } + } + + func_80BBB0D4(this, globalCtx); + + if (globalCtx->msgCtx.ocarinaMode == 0x2A) { + globalCtx->msgCtx.ocarinaMode = 4; + this->actionFunc = func_80BBBB84; + this->actor.flags |= ACTOR_FLAG_10000; + func_800B8614(&this->actor, globalCtx, 120.0f); + return; + } + + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { + this->actionFunc = func_80BBB8AC; + func_80BBB15C(this, globalCtx); + } else if (func_800EE29C(globalCtx, 0x1F5)) { + this->actionFunc = func_80BBBD5C; + } else if (func_80BBAF5C(this, globalCtx)) { + func_800B8614(&this->actor, globalCtx, 120.0f); + } + + if (!Actor_IsFacingPlayer(&this->actor, 0x4000) && (this->actor.xzDistToPlayer < 100.0f)) { + gSaveContext.save.weekEventReg[52] |= 0x10; + } else { + gSaveContext.save.weekEventReg[52] &= (u8)~0x10; + } + + sp28.x = this->actor.projectedPos.x; + sp28.y = this->actor.projectedPos.y; + sp28.z = this->actor.projectedPos.z; + func_801A1FB4(3, &sp28, 110, 1000.0f); +} + +void func_80BBBFBC(EnZos* this, GlobalContext* globalCtx) { + u16 textId; + + if (gSaveContext.save.playerForm == PLAYER_FORM_ZORA) { + if (gSaveContext.save.weekEventReg[79] & 1) { + textId = 0x125B; + } else if (gSaveContext.save.weekEventReg[78] & 0x80) { + textId = 0x125A; + } else { + textId = 0x1259; + gSaveContext.save.weekEventReg[78] |= 0x80; + } + func_80BBAE84(this, 5, 0); + } else { + textId = 0x1258; + func_80BBAE84(this, 6, 0); + } + func_801518B0(globalCtx, textId, &this->actor); +} + +void func_80BBC070(EnZos* this, GlobalContext* globalCtx) { + SkelAnime_Update(&this->skelAnime); + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0x1000, 0x200); + this->actor.world.rot.y = this->actor.shape.rot.y; + + switch (Message_GetState(&globalCtx->msgCtx)) { + case 5: + if (func_80147624(globalCtx)) { + func_80BBAE84(this, 2, 0); + func_801477B4(globalCtx); + this->actionFunc = func_80BBC14C; + this->unk_2B6 |= 1; + } + break; + + case 2: + func_80BBAE84(this, 2, 0); + this->actionFunc = func_80BBC14C; + this->unk_2B6 |= 1; + break; + } +} + +void func_80BBC14C(EnZos* this, GlobalContext* globalCtx) { + Actor* thisx = &this->actor; + + if (this->unk_2B6 & 1) { + Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, 2, 0x1000, 0x200); + this->actor.world.rot.y = thisx->shape.rot.y; + if (this->actor.home.rot.y == this->actor.shape.rot.y) { + func_80BBAE84(this, 0, 2); + this->unk_2B6 &= ~1; + } + } + + func_80BBB0D4(this, globalCtx); + + if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) { + this->actionFunc = func_80BBC070; + func_80BBBFBC(this, globalCtx); + } else if (func_80BBAF5C(this, globalCtx)) { + func_800B8614(&this->actor, globalCtx, 120.0f); + } +} + +void func_80BBC22C(EnZos* this, GlobalContext* globalCtx) { + func_80BBAFFC(this, globalCtx); +} + +void func_80BBC24C(EnZos* this, GlobalContext* globalCtx) { + func_80BBB0D4(this, globalCtx); + if (gSaveContext.save.weekEventReg[79] & 1) { + this->actionFunc = func_80BBC22C; + func_80BBAE84(this, 7, 2); + } +} + +void func_80BBC298(EnZos* this, GlobalContext* globalCtx) { + func_80BBAFFC(this, globalCtx); + + if (this->unk_2BC < 799) { + this->unk_2BC += 200; + } else { + this->unk_2BC += 30; + } + + if (this->unk_2BC > 999) { + this->unk_2BC = 999; + } + + if (func_800EE29C(globalCtx, 0x203)) { + if (globalCtx->csCtx.npcActions[func_800EE200(globalCtx, 0x203)]->unk0 == 1) { + this->actionFunc = func_80BBC37C; + this->unk_2BC = -1; + } + } else { + this->actionFunc = func_80BBC37C; + this->unk_2BC = -1; + } +} + +void func_80BBC37C(EnZos* this, GlobalContext* globalCtx) { + func_80BBAFFC(this, globalCtx); + if (func_800EE29C(globalCtx, 0x203) && (globalCtx->csCtx.npcActions[func_800EE200(globalCtx, 0x203)]->unk0 == 3)) { + this->actionFunc = func_80BBC298; + } +} + +void EnZos_Update(Actor* thisx, GlobalContext* globalCtx) { + s32 pad; + EnZos* this = THIS; + + Actor_MoveWithGravity(&this->actor); + Collider_UpdateCylinder(&this->actor, &this->collider); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 10.0f, 30.0f, 4); + + this->actionFunc(this, globalCtx); + + if (DECR(this->unk_2AE) == 0) { + this->unk_2AE = Rand_S16Offset(60, 60); + } + + this->unk_2AC = this->unk_2AE; + if (this->unk_2AC >= 3) { + this->unk_2AC = 0; + } +} + +s32 func_80BBC4E4(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { + return false; +} + +void func_80BBC500(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { + static Vec3f D_80BBC750 = { 0.0f, 0.0f, 0.0f }; + + if (limbIndex == 9) { + Matrix_MultiplyVector3fByState(&D_80BBC750, &thisx->focus.pos); + } +} + +void EnZos_Draw(Actor* thisx, GlobalContext* globalCtx) { + static TexturePtr D_80BBC75C[] = { + object_zos_Tex_010918, + object_zos_Tex_011118, + object_zos_Tex_011918, + }; + EnZos* this = THIS; + Gfx* gfx; + + OPEN_DISPS(globalCtx->state.gfxCtx); + + func_8012C28C(globalCtx->state.gfxCtx); + + if (this->unk_2B6 & 0x40) { + POLY_OPA_DISP = Gfx_SetFog(POLY_OPA_DISP, 0, 0, 0, 0, this->unk_2BC, 1000); + } + + gfx = POLY_OPA_DISP; + + gSPSegment(&gfx[0], 0x08, Lib_SegmentedToVirtual(D_80BBC75C[this->unk_2AC])); + + Matrix_StatePush(); + Matrix_RotateY(this->actor.home.rot.y - this->actor.shape.rot.y, MTXMODE_APPLY); + Matrix_InsertTranslation(0.0f, 0.0f, -974.4f, MTXMODE_APPLY); + + gSPMatrix(&gfx[1], Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(&gfx[2], object_zos_DL_0136E0); + gSPDisplayList(&gfx[3], object_zos_DL_013088); + + POLY_OPA_DISP = &gfx[4]; + + Matrix_StatePop(); + + SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, + func_80BBC4E4, func_80BBC500, &this->actor); + + if (this->unk_2B6 & 0x40) { + POLY_OPA_DISP = func_801660B8(globalCtx, POLY_OPA_DISP); + } + + CLOSE_DISPS(globalCtx->state.gfxCtx); +} diff --git a/src/overlays/actors/ovl_En_Zos/z_en_zos.h b/src/overlays/actors/ovl_En_Zos/z_en_zos.h index dbee5eb8c..991f08d57 100644 --- a/src/overlays/actors/ovl_En_Zos/z_en_zos.h +++ b/src/overlays/actors/ovl_En_Zos/z_en_zos.h @@ -7,9 +7,26 @@ struct EnZos; typedef void (*EnZosActionFunc)(struct EnZos*, GlobalContext*); +#define ENZOS_GET_F(thisx) ((thisx)->params & 0xF) + +enum { + /* 1 */ ENZOS_F_1 = 1, + /* 2 */ ENZOS_F_2, +}; + typedef struct EnZos { /* 0x0000 */ Actor actor; - /* 0x0144 */ char unk_144[0x17C]; + /* 0x0144 */ Vec3s jointTable[18]; + /* 0x01B0 */ Vec3s morphTable[18]; + /* 0x021C */ SkelAnime skelAnime; + /* 0x0260 */ ColliderCylinder collider; + /* 0x02AC */ s16 unk_2AC; + /* 0x02AE */ s16 unk_2AE; + /* 0x02B0 */ UNK_TYPE1 unk2B0[6]; + /* 0x02B6 */ u16 unk_2B6; + /* 0x02B8 */ s16 unk_2B8; + /* 0x02BA */ s16 unk_2BA; + /* 0x02BC */ s16 unk_2BC; /* 0x02C0 */ EnZosActionFunc actionFunc; } EnZos; // size = 0x2C4 diff --git a/src/overlays/actors/ovl_En_Zot/z_en_zot.c b/src/overlays/actors/ovl_En_Zot/z_en_zot.c index e8e82ad2d..62a6f8f42 100644 --- a/src/overlays/actors/ovl_En_Zot/z_en_zot.c +++ b/src/overlays/actors/ovl_En_Zot/z_en_zot.c @@ -5,6 +5,7 @@ */ #include "z_en_zot.h" +#include "objects/object_zo/object_zo.h" #define FLAGS 0x00000019 @@ -30,21 +31,6 @@ void func_80B990A4(EnZot* this, GlobalContext* globalCtx); void func_80B992C0(EnZot* this, GlobalContext* globalCtx); void func_80B99384(EnZot* this, GlobalContext* globalCtx); -extern AnimationHeader D_06002898; -extern AnimationHeader D_06004248; -extern UNK_PTR D_060050A0; -extern UNK_PTR D_060058A0; -extern UNK_PTR D_060060A0; -extern FlexSkeletonHeader D_0600D208; -extern AnimationHeader D_0600DE20; -extern AnimationHeader D_0600DF54; -extern AnimationHeader D_0600E400; -extern AnimationHeader D_0600EDF0; -extern AnimationHeader D_0600F4E8; -extern AnimationHeader D_0600FDF0; -extern AnimationHeader D_06010B18; -extern AnimationHeader D_06011424; - const ActorInit En_Zot_InitVars = { ACTOR_EN_ZOT, ACTORCAT_NPC, @@ -93,15 +79,15 @@ void func_80B965D0(EnZot* this, GlobalContext* globalCtx) { } void EnZot_Init(Actor* thisx, GlobalContext* globalCtx2) { - EnZot* this = THIS; GlobalContext* globalCtx = globalCtx2; + EnZot* this = THIS; s32 i; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f); Actor_SetScale(&this->actor, 0.01f); this->actionFunc = func_80B97100; - SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600D208, &D_06004248, this->jointTable, this->morphTable, 20); - Animation_PlayLoop(&this->skelAnime, &D_0600DE20); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gZoraSkel, &gZoraIdleAnim, this->jointTable, this->morphTable, 20); + Animation_PlayLoop(&this->skelAnime, &object_zo_Anim_00DE20); this->unk_2F0 = 0; Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); @@ -249,8 +235,9 @@ void EnZot_Destroy(Actor* thisx, GlobalContext* globalCtx) { void func_80B96BEC(EnZot* this, s16 arg1, u8 arg2) { static AnimationHeader* sAnimations[] = { - &D_0600DE20, &D_06002898, &D_0600F4E8, &D_0600E400, &D_0600FDF0, - &D_06010B18, &D_06011424, &D_0600EDF0, &D_0600DF54, &D_0600DF54, + &object_zo_Anim_00DE20, &gZoraWalkAnim, &object_zo_Anim_00F4E8, &object_zo_Anim_00E400, + &object_zo_Anim_00FDF0, &object_zo_Anim_010B18, &object_zo_Anim_011424, &object_zo_Anim_00EDF0, + &object_zo_Anim_00DF54, &object_zo_Anim_00DF54, }; if ((arg1 >= 0) && (arg1 < 10)) { @@ -1397,10 +1384,10 @@ void EnZot_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve } void EnZot_Draw(Actor* thisx, GlobalContext* globalCtx) { - UNK_PTR sp4C[] = { - &D_060050A0, - &D_060058A0, - &D_060060A0, + TexturePtr sp4C[] = { + gZoraEyeOpenTex, + gZoraEyeHalfTex, + gZoraEyeClosedTex, }; EnZot* this = THIS; diff --git a/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c b/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c index 519d87e7f..d02bb91da 100644 --- a/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c +++ b/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c @@ -5,6 +5,7 @@ */ #include "z_item_b_heart.h" +#include "objects/object_gi_hearts/object_gi_hearts.h" #define FLAGS 0x00000000 @@ -36,9 +37,6 @@ static InitChainEntry sInitChain[] = { ICHAIN_F32(uncullZoneDownward, 800, ICHAIN_STOP), }; -extern Gfx D_06001290[]; -extern Gfx D_06001470[]; - void ItemBHeart_Init(Actor* thisx, GlobalContext* globalCtx) { ItemBHeart* this = THIS; @@ -103,13 +101,13 @@ void ItemBHeart_Draw(Actor* thisx, GlobalContext* globalCtx) { if (flag || thisx->world.rot.y != 0) { func_8012C2DC(globalCtx->state.gfxCtx); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_XLU_DISP++, D_06001290); - gSPDisplayList(POLY_XLU_DISP++, D_06001470); + gSPDisplayList(POLY_XLU_DISP++, object_gi_hearts_DL_001290); + gSPDisplayList(POLY_XLU_DISP++, object_gi_hearts_DL_001470); } else { func_8012C28C(globalCtx->state.gfxCtx); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, D_06001290); - gSPDisplayList(POLY_OPA_DISP++, D_06001470); + gSPDisplayList(POLY_OPA_DISP++, object_gi_hearts_DL_001290); + gSPDisplayList(POLY_OPA_DISP++, object_gi_hearts_DL_001470); } CLOSE_DISPS(globalCtx->state.gfxCtx); diff --git a/src/overlays/actors/ovl_Obj_Bell/z_obj_bell.c b/src/overlays/actors/ovl_Obj_Bell/z_obj_bell.c index 651adf6d2..3b00578a2 100644 --- a/src/overlays/actors/ovl_Obj_Bell/z_obj_bell.c +++ b/src/overlays/actors/ovl_Obj_Bell/z_obj_bell.c @@ -5,6 +5,7 @@ */ #include "z_obj_bell.h" +#include "objects/object_f52_obj/object_f52_obj.h" #define FLAGS 0x00000030 @@ -111,14 +112,6 @@ static DamageTable sDamageTable = { /* Powder Keg */ DMG_ENTRY(1, 0xE), }; -extern CollisionHeader D_06001BA8; -extern Gfx D_06000570[]; // Bell post -extern Gfx D_06000698[]; // Bell -extern Gfx D_060007A8[]; // Bell Base -extern Gfx D_06000840[]; // Bell Shadow -extern Gfx D_060008D0[]; // Bell Hook -extern Gfx D_06000960[]; // Bell Designs - s32 func_80A35510(ObjBell* this, s32 arg1) { Vec3f bumperPos; Vec3f worldPos; @@ -233,10 +226,10 @@ void func_80A359B4(Actor* thisx, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx); func_8012C28C(globalCtx->state.gfxCtx); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, D_06000698); - gSPDisplayList(POLY_OPA_DISP++, D_060008D0); - gSPDisplayList(POLY_OPA_DISP++, D_06000960); - gSPDisplayList(POLY_OPA_DISP++, D_060007A8); + gSPDisplayList(POLY_OPA_DISP++, object_f52_obj_DL_000698); + gSPDisplayList(POLY_OPA_DISP++, object_f52_obj_DL_0008D0); + gSPDisplayList(POLY_OPA_DISP++, object_f52_obj_DL_000960); + gSPDisplayList(POLY_OPA_DISP++, object_f52_obj_DL_0007A8); CLOSE_DISPS(globalCtx->state.gfxCtx); } @@ -247,7 +240,7 @@ void func_80A35B18(Actor* thisx, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx); func_8012C28C(globalCtx->state.gfxCtx); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, D_06000570); + gSPDisplayList(POLY_OPA_DISP++, object_f52_obj_DL_000570); CLOSE_DISPS(globalCtx->state.gfxCtx); } @@ -257,7 +250,7 @@ void func_80A35BD4(Actor* thisx, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx); func_8012C2DC(globalCtx->state.gfxCtx); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_XLU_DISP++, D_06000840); + gSPDisplayList(POLY_XLU_DISP++, object_f52_obj_DL_000840); CLOSE_DISPS(globalCtx->state.gfxCtx); } @@ -265,7 +258,7 @@ void ObjBell_Init(Actor* thisx, GlobalContext* globalCtx) { ObjBell* this = THIS; DynaPolyActor_Init(&this->dyna, 0); - DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06001BA8); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_f52_obj_Colheader_001BA8); Actor_SetScale(&this->dyna.actor, 0.08f); Collider_InitAndSetSphere(globalCtx, &this->collider1, &this->dyna.actor, &sCylinderInit1); Collider_InitAndSetSphere(globalCtx, &this->collider2, &this->dyna.actor, &sCylinderInit2); diff --git a/src/overlays/actors/ovl_Obj_Boyo/z_obj_boyo.c b/src/overlays/actors/ovl_Obj_Boyo/z_obj_boyo.c index a0d6301f3..c4af83d59 100644 --- a/src/overlays/actors/ovl_Obj_Boyo/z_obj_boyo.c +++ b/src/overlays/actors/ovl_Obj_Boyo/z_obj_boyo.c @@ -7,6 +7,7 @@ #include "z_obj_boyo.h" #include "overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.h" #include "overlays/actors/ovl_En_Bom/z_en_bom.h" +#include "objects/object_boyo/object_boyo.h" #define FLAGS 0x00000010 @@ -56,9 +57,6 @@ static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), }; -extern Gfx D_06000300[]; -extern AnimatedMaterial D_06000E88; - void ObjBoyo_Init(Actor* thisx, GlobalContext* globalCtx) { ObjBoyo* this = THIS; @@ -67,7 +65,7 @@ void ObjBoyo_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); Collider_UpdateCylinder(&this->actor, &this->collider); this->actor.colChkInfo.mass = MASS_IMMOVABLE; - this->unk_190 = Lib_SegmentedToVirtual(&D_06000E88); + this->unk_190 = Lib_SegmentedToVirtual(object_boyo_Matanimheader_000E88); } void ObjBoyo_Destroy(Actor* thisx, GlobalContext* globalCtx2) { @@ -121,8 +119,8 @@ Actor* ObjBoyo_GetCollidedActor(ObjBoyo* this, GlobalContext* globalCtx, s32* nu } void ObjBoyo_Update(Actor* thisx, GlobalContext* globalCtx2) { - ObjBoyo* this = THIS; GlobalContext* globalCtx = globalCtx2; + ObjBoyo* this = THIS; Actor* target; s32 num; @@ -182,5 +180,5 @@ void ObjBoyo_Draw(Actor* thisx, GlobalContext* globalCtx) { ObjBoyo* this = THIS; AnimatedMat_Draw(globalCtx, this->unk_190); - Gfx_DrawDListOpa(globalCtx, D_06000300); + Gfx_DrawDListOpa(globalCtx, object_boyo_DL_000300); } diff --git a/src/overlays/actors/ovl_Obj_Chan/z_obj_chan.c b/src/overlays/actors/ovl_Obj_Chan/z_obj_chan.c index 2ac00d73f..4dd0a78b1 100644 --- a/src/overlays/actors/ovl_Obj_Chan/z_obj_chan.c +++ b/src/overlays/actors/ovl_Obj_Chan/z_obj_chan.c @@ -23,7 +23,7 @@ const ActorInit Obj_Chan_InitVars = { ACTOR_OBJ_CHAN, ACTORCAT_BG, FLAGS, - OBJECT_OBJECT_UNSET_CHAN, + OBJECT_OBJ_CHAN, sizeof(ObjChan), (ActorFunc)ObjChan_Init, (ActorFunc)ObjChan_Destroy, diff --git a/src/overlays/actors/ovl_Obj_Danpeilift/z_obj_danpeilift.c b/src/overlays/actors/ovl_Obj_Danpeilift/z_obj_danpeilift.c index 91e4e24c7..6e14ea096 100644 --- a/src/overlays/actors/ovl_Obj_Danpeilift/z_obj_danpeilift.c +++ b/src/overlays/actors/ovl_Obj_Danpeilift/z_obj_danpeilift.c @@ -20,7 +20,7 @@ const ActorInit Obj_Danpeilift_InitVars = { ACTOR_OBJ_DANPEILIFT, ACTORCAT_BG, FLAGS, - OBJECT_OBJECT_UNSET_DANPEILIFT, + OBJECT_OBJ_DANPEILIFT, sizeof(ObjDanpeilift), (ActorFunc)ObjDanpeilift_Init, (ActorFunc)ObjDanpeilift_Destroy, diff --git a/src/overlays/actors/ovl_Obj_Dinner/z_obj_dinner.c b/src/overlays/actors/ovl_Obj_Dinner/z_obj_dinner.c index 6f04ac880..bca94a538 100644 --- a/src/overlays/actors/ovl_Obj_Dinner/z_obj_dinner.c +++ b/src/overlays/actors/ovl_Obj_Dinner/z_obj_dinner.c @@ -5,6 +5,7 @@ */ #include "z_obj_dinner.h" +#include "objects/object_obj_dinner/object_obj_dinner.h" #define FLAGS 0x00000020 @@ -19,7 +20,7 @@ const ActorInit Obj_Dinner_InitVars = { ACTOR_OBJ_DINNER, ACTORCAT_PROP, FLAGS, - OBJECT_OBJECT_UNSET_DINNER, + OBJECT_OBJ_DINNER, sizeof(ObjDinner), (ActorFunc)ObjDinner_Init, (ActorFunc)ObjDinner_Destroy, @@ -27,8 +28,6 @@ const ActorInit Obj_Dinner_InitVars = { (ActorFunc)ObjDinner_Draw, }; -extern Gfx D_060011E0[]; - void ObjDinner_Init(Actor* thisx, GlobalContext* globalCtx) { ObjDinner* this = THIS; @@ -49,7 +48,7 @@ void ObjDinner_Draw(Actor* thisx, GlobalContext* globalCtx) { func_8012C28C(globalCtx->state.gfxCtx); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, D_060011E0); + gSPDisplayList(POLY_OPA_DISP++, object_obj_dinner_DL_0011E0); CLOSE_DISPS(globalCtx->state.gfxCtx); } diff --git a/src/overlays/actors/ovl_Obj_Ending/z_obj_ending.c b/src/overlays/actors/ovl_Obj_Ending/z_obj_ending.c index cb6aabaff..be348ef1c 100644 --- a/src/overlays/actors/ovl_Obj_Ending/z_obj_ending.c +++ b/src/overlays/actors/ovl_Obj_Ending/z_obj_ending.c @@ -5,6 +5,7 @@ */ #include "z_obj_ending.h" +#include "objects/object_ending_obj/object_ending_obj.h" #define FLAGS 0x00000030 @@ -26,14 +27,9 @@ const ActorInit Obj_Ending_InitVars = { (ActorFunc)ObjEnding_Draw, }; -extern Gfx D_060003D0[]; -extern Gfx D_060031A0[]; -extern Gfx D_06003440[]; -extern AnimatedMaterial D_06001FF8; - static ObjEndingModelInfo sModelInfo[] = { - { { D_06003440, D_060031A0 }, NULL }, - { { NULL, D_060003D0 }, &D_06001FF8 }, + { { object_ending_obj_DL_003440, object_ending_obj_DL_0031A0 }, NULL }, + { { NULL, object_ending_obj_DL_0003D0 }, object_ending_obj_Matanimheader_001FF8 }, }; static InitChainEntry sInitChain[] = { diff --git a/src/overlays/actors/ovl_Obj_Etcetera/z_obj_etcetera.c b/src/overlays/actors/ovl_Obj_Etcetera/z_obj_etcetera.c index ca6ea9f6f..23d2dfa7f 100644 --- a/src/overlays/actors/ovl_Obj_Etcetera/z_obj_etcetera.c +++ b/src/overlays/actors/ovl_Obj_Etcetera/z_obj_etcetera.c @@ -53,8 +53,6 @@ static ColliderCylinderInit sCylinderInit = { { 20, 14, 0, { 0, 0, 0 } }, }; -extern ColliderCylinderInit D_80A7C790; - static s16 objectIds[] = { GAMEPLAY_KEEP, GAMEPLAY_KEEP, diff --git a/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.c b/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.c index 282aa3407..0365f3420 100644 --- a/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.c +++ b/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.c @@ -428,8 +428,11 @@ void ObjFlowerpot_Init(Actor* thisx, GlobalContext* globalCtx) { D_80A1D400++; } -void ObjFlowerpot_Destroy(Actor* thisx, GlobalContext* globalCtx) { - Collider_DestroyJntSph(globalCtx, &THIS->collider); +void ObjFlowerpot_Destroy(Actor* thisx, GlobalContext* globalCtx2) { + GlobalContext* globalCtx = globalCtx2; + ObjFlowerpot* this = THIS; + + Collider_DestroyJntSph(globalCtx, &this->collider); } void func_80A1C818(ObjFlowerpot* this) { diff --git a/src/overlays/actors/ovl_Obj_Funen/z_obj_funen.c b/src/overlays/actors/ovl_Obj_Funen/z_obj_funen.c index 30d0b2f0a..5dac29b65 100644 --- a/src/overlays/actors/ovl_Obj_Funen/z_obj_funen.c +++ b/src/overlays/actors/ovl_Obj_Funen/z_obj_funen.c @@ -5,6 +5,7 @@ */ #include "z_obj_funen.h" +#include "objects/object_funen/object_funen.h" #define FLAGS 0x00000030 @@ -19,8 +20,6 @@ const ActorInit Obj_Funen_InitVars = { (ActorFunc)Actor_Noop, (ActorFunc)Actor_Noop, (ActorFunc)ObjFunen_Draw, }; -extern Gfx D_060000D0[]; - f32 D_80A198D0[] = { 0.1f, 0.024390244f }; void ObjFunen_Init(Actor* thisx, GlobalContext* globalCtx) { @@ -44,6 +43,6 @@ void ObjFunen_Draw(Actor* thisx, GlobalContext* globalCtx) { gSPSegment(POLY_XLU_DISP++, 0x08, Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, temp, 0x20, 0x20, 1, 0, temp, 0x20, 0x20)); - gSPDisplayList(POLY_XLU_DISP++, D_060000D0); + gSPDisplayList(POLY_XLU_DISP++, object_funen_DL_0000D0); CLOSE_DISPS(globalCtx->state.gfxCtx); } diff --git a/src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.c b/src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.c index fb454f109..379d78c52 100644 --- a/src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.c +++ b/src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.c @@ -5,6 +5,7 @@ */ #include "z_obj_ghaka.h" +#include "objects/object_ghaka/object_ghaka.h" #define FLAGS 0x00000029 @@ -42,10 +43,6 @@ static InitChainEntry D_80B3C96C[] = { ICHAIN_F32(targetArrowOffset, 30, ICHAIN_STOP), }; -extern Gfx D_06001A20[]; -extern Gfx D_06001980[]; -extern CollisionHeader D_06003CD0; - void func_80B3C260(ObjGhaka* this) { if (gSaveContext.save.weekEventReg[20] & 0x20) { this->dyna.actor.world.pos.z = this->dyna.actor.home.pos.z + 100.0f; @@ -154,7 +151,7 @@ void ObjGhaka_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->dyna.actor, D_80B3C96C); Actor_SetScale(&this->dyna.actor, 0.1f); DynaPolyActor_Init(&this->dyna, 1); - CollisionHeader_GetVirtual(&D_06003CD0, &colHeader); + CollisionHeader_GetVirtual(&object_ghaka_Colheader_003CD0, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader); Actor_UpdateBgCheckInfo(globalCtx, &this->dyna.actor, 0.0f, 0.0f, 0.0f, 0x4); if (this->dyna.actor.floorPoly == 0) { @@ -185,9 +182,9 @@ void ObjGhaka_Draw(Actor* thisx, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx); func_8012C28C(globalCtx->state.gfxCtx); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, D_06001A20); + gSPDisplayList(POLY_OPA_DISP++, object_ghaka_DL_001A20); func_8012C2DC(globalCtx->state.gfxCtx); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_XLU_DISP++, D_06001980); + gSPDisplayList(POLY_XLU_DISP++, object_ghaka_DL_001980); CLOSE_DISPS(globalCtx->state.gfxCtx); } diff --git a/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c b/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c index d7e0d6633..93578ac40 100644 --- a/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c +++ b/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c @@ -5,6 +5,7 @@ */ #include "z_obj_hana.h" +#include "objects/object_hana/object_hana.h" #define FLAGS 0x00000000 @@ -27,8 +28,6 @@ const ActorInit Obj_Hana_InitVars = { (ActorFunc)ObjHana_Draw, }; -extern Gfx D_06000500[]; - static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 10, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneForward, 900, ICHAIN_CONTINUE), @@ -49,5 +48,5 @@ void ObjHana_Update(Actor* thisx, GlobalContext* globalCtx) { } void ObjHana_Draw(Actor* thisx, GlobalContext* globalCtx) { - Gfx_DrawDListOpa(globalCtx, D_06000500); + Gfx_DrawDListOpa(globalCtx, object_hana_DL_000500); } diff --git a/src/overlays/actors/ovl_Obj_Hgdoor/z_obj_hgdoor.c b/src/overlays/actors/ovl_Obj_Hgdoor/z_obj_hgdoor.c index 2223bd434..e759bc419 100644 --- a/src/overlays/actors/ovl_Obj_Hgdoor/z_obj_hgdoor.c +++ b/src/overlays/actors/ovl_Obj_Hgdoor/z_obj_hgdoor.c @@ -5,6 +5,7 @@ */ #include "z_obj_hgdoor.h" +#include "objects/object_hgdoor/object_hgdoor.h" #define FLAGS 0x00100000 @@ -25,13 +26,6 @@ void func_80BD4460(ObjHgdoor* this); void func_80BD4478(ObjHgdoor* this, GlobalContext* globalCtx); s32 func_80BD44D0(ObjHgdoor* this, GlobalContext* globalCtx); -extern CollisionHeader D_06001D10; -extern CollisionHeader D_060018C0; -extern Gfx D_06001AB0[]; -extern Gfx D_06001BA8[]; -extern Gfx D_06001670[]; -extern Gfx D_06001768[]; - const ActorInit Obj_Hgdoor_InitVars = { ACTOR_OBJ_HGDOOR, ACTORCAT_PROP, @@ -80,9 +74,9 @@ void ObjHgdoor_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_SetScale(&this->dyna.actor, 0.1f); DynaPolyActor_Init(&this->dyna, 1); if (OBJHGDOOR_IS_RIGHT_DOOR(&this->dyna.actor)) { - CollisionHeader_GetVirtual(&D_06001D10, &header); + CollisionHeader_GetVirtual(&object_hgdoor_Colheader_001D10, &header); } else { - CollisionHeader_GetVirtual(&D_060018C0, &header); + CollisionHeader_GetVirtual(&object_hgdoor_Colheader_0018C0, &header); } this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, header); this->rotation = 0; @@ -203,11 +197,11 @@ void ObjHgdoor_Draw(Actor* thisx, GlobalContext* globalCtx) { gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); if (OBJHGDOOR_IS_RIGHT_DOOR(thisx)) { - gSPDisplayList(POLY_OPA_DISP++, D_06001AB0); - gSPDisplayList(POLY_OPA_DISP++, D_06001BA8); + gSPDisplayList(POLY_OPA_DISP++, object_hgdoor_DL_001AB0); + gSPDisplayList(POLY_OPA_DISP++, object_hgdoor_DL_001BA8); } else { - gSPDisplayList(POLY_OPA_DISP++, D_06001670); - gSPDisplayList(POLY_OPA_DISP++, D_06001768); + gSPDisplayList(POLY_OPA_DISP++, object_hgdoor_DL_001670); + gSPDisplayList(POLY_OPA_DISP++, object_hgdoor_DL_001768); } CLOSE_DISPS(globalCtx->state.gfxCtx); diff --git a/src/overlays/actors/ovl_Obj_HsStump/z_obj_hsstump.c b/src/overlays/actors/ovl_Obj_HsStump/z_obj_hsstump.c index cf84a1bd7..c1a308bae 100644 --- a/src/overlays/actors/ovl_Obj_HsStump/z_obj_hsstump.c +++ b/src/overlays/actors/ovl_Obj_HsStump/z_obj_hsstump.c @@ -5,6 +5,7 @@ */ #include "z_obj_hsstump.h" +#include "objects/object_hsstump/object_hsstump.h" #define FLAGS 0x00000010 @@ -38,9 +39,6 @@ static InitChainEntry sInitChain[] = { static Vec3f iceSmokeAccel = { 0.0f, 0.0f, 0.0f }; -extern Gfx D_060003B8[]; -extern CollisionHeader D_060011B0; - void ObjHsStump_Init(Actor* thisx, GlobalContext* globalCtx) { ObjHsStump* this = THIS; @@ -48,7 +46,7 @@ void ObjHsStump_Init(Actor* thisx, GlobalContext* globalCtx) { this->isHidden = OBJHSSTUMP_GET_ISHIDDEN(thisx); this->switchFlag = OBJHSSTUMP_GET_SWITCHFLAG(thisx); // Must be thisx to match DynaPolyActor_Init(&this->dyna, 1); - DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_060011B0); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_hsstump_Colheader_0011B0); switch (this->isHidden) { case true: if (Flags_GetSwitch(globalCtx, this->switchFlag)) { @@ -146,5 +144,5 @@ void ObjHsStump_Update(Actor* thisx, GlobalContext* globalCtx) { } void ObjHsStump_Draw(Actor* thisx, GlobalContext* globalCtx) { - Gfx_DrawDListOpa(globalCtx, D_060003B8); + Gfx_DrawDListOpa(globalCtx, object_hsstump_DL_0003B8); } diff --git a/src/overlays/actors/ovl_Obj_Hugebombiwa/z_obj_hugebombiwa.c b/src/overlays/actors/ovl_Obj_Hugebombiwa/z_obj_hugebombiwa.c index 06ab9ed65..79880eaf5 100644 --- a/src/overlays/actors/ovl_Obj_Hugebombiwa/z_obj_hugebombiwa.c +++ b/src/overlays/actors/ovl_Obj_Hugebombiwa/z_obj_hugebombiwa.c @@ -358,8 +358,11 @@ void ObjHugebombiwa_Init(Actor* thisx, GlobalContext* globalCtx) { func_80A54BF0(this); } -void ObjHugebombiwa_Destroy(Actor* thisx, GlobalContext* globalCtx) { - Collider_DestroyCylinder(globalCtx, &THIS->collider); +void ObjHugebombiwa_Destroy(Actor* thisx, GlobalContext* globalCtx2) { + GlobalContext* globalCtx = globalCtx2; + ObjHugebombiwa* this = THIS; + + Collider_DestroyCylinder(globalCtx, &this->collider); } void func_80A54BF0(ObjHugebombiwa* this) { diff --git a/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.c b/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.c index 0c4f8f63e..6ccc8217d 100644 --- a/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.c +++ b/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.c @@ -934,7 +934,7 @@ void ObjIceblock_Init(Actor* thisx, GlobalContext* globalCtx) { } if (D_80A26E7C == NULL) { - D_80A26E7C = Lib_SegmentedToVirtual(&object_ice_block_Matanimheader_000328); + D_80A26E7C = Lib_SegmentedToVirtual(object_ice_block_Matanimheader_000328); } if (!(this->unk_1B0 & 8)) { @@ -1510,7 +1510,7 @@ void func_80A26B64(ObjIceblock* this, GlobalContext* globalCtx) { void func_80A26B74(ObjIceblock* this, GlobalContext* globalCtx) { Gfx_DrawDListXlu(globalCtx, object_ice_block_DL_0001A0); if (OBJICEBLOCK_GET_1(&this->dyna.actor) && (this->unk_2B4 > 0.0f)) { - AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&object_ice_block_Matanimheader_0009D0)); + AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(object_ice_block_Matanimheader_0009D0)); Gfx_DrawDListXlu(globalCtx, object_ice_block_DL_0007F0); } } @@ -1539,7 +1539,7 @@ void func_80A26BF8(ObjIceblock* this, GlobalContext* globalCtx) { } if (OBJICEBLOCK_GET_1(&this->dyna.actor) && (this->unk_2B4 > 0.0f)) { - AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&object_ice_block_Matanimheader_0009D0)); + AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(object_ice_block_Matanimheader_0009D0)); Matrix_SetStateRotationAndTranslation(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y - 20.0f, this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot); Matrix_Scale(this->unk_2B4, this->unk_2B4, this->unk_2B4, MTXMODE_APPLY); diff --git a/src/overlays/actors/ovl_Obj_Jg_Gakki/z_obj_jg_gakki.c b/src/overlays/actors/ovl_Obj_Jg_Gakki/z_obj_jg_gakki.c index 433465986..a70d14600 100644 --- a/src/overlays/actors/ovl_Obj_Jg_Gakki/z_obj_jg_gakki.c +++ b/src/overlays/actors/ovl_Obj_Jg_Gakki/z_obj_jg_gakki.c @@ -5,6 +5,7 @@ */ #include "z_obj_jg_gakki.h" +#include "objects/object_jg/object_jg.h" #define FLAGS 0x00000020 @@ -27,22 +28,19 @@ const ActorInit Obj_Jg_Gakki_InitVars = { (ActorFunc)ObjJgGakki_Draw, }; -extern AnimationHeader D_0601B1E8; // gGoronElderDrumAnim -extern SkeletonHeader D_0601B210; // gGoronElderDrumSkel - void ObjJgGakki_Init(Actor* thisx, GlobalContext* globalCtx2) { GlobalContext* globalCtx = globalCtx2; ObjJgGakki* this = THIS; - f32 frameCount = Animation_GetLastFrame(&D_0601B1E8); + f32 frameCount = Animation_GetLastFrame(&gGoronElderDrumAnim); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f); - SkelAnime_Init(globalCtx, &this->skelAnime, &D_0601B210, NULL, NULL, NULL, 0); + SkelAnime_Init(globalCtx, &this->skelAnime, &gGoronElderDrumSkel, NULL, NULL, NULL, 0); if (((globalCtx->sceneNum == SCENE_SPOT00) && (gSaveContext.sceneSetupIndex == 7)) && (globalCtx->csCtx.unk_12 == 0)) { - Animation_Change(&this->skelAnime, &D_0601B1E8, 1.0f, frameCount, frameCount, 2, 0.0f); + Animation_Change(&this->skelAnime, &gGoronElderDrumAnim, 1.0f, frameCount, frameCount, 2, 0.0f); } else if ((globalCtx->sceneNum == SCENE_17SETUGEN) || (globalCtx->sceneNum == SCENE_10YUKIYAMANOMURA)) { - Animation_Change(&this->skelAnime, &D_0601B1E8, 1.0f, 0.0f, frameCount, 2, 0.0f); + Animation_Change(&this->skelAnime, &gGoronElderDrumAnim, 1.0f, 0.0f, frameCount, 2, 0.0f); } else { Actor_MarkForDeath(&this->actor); } diff --git a/src/overlays/actors/ovl_Obj_Kepn_Koya/z_obj_kepn_koya.c b/src/overlays/actors/ovl_Obj_Kepn_Koya/z_obj_kepn_koya.c index 6782e15eb..4f8bc1d3a 100644 --- a/src/overlays/actors/ovl_Obj_Kepn_Koya/z_obj_kepn_koya.c +++ b/src/overlays/actors/ovl_Obj_Kepn_Koya/z_obj_kepn_koya.c @@ -5,6 +5,7 @@ */ #include "z_obj_kepn_koya.h" +#include "objects/object_kepn_koya/object_kepn_koya.h" #define FLAGS 0x00000000 @@ -32,16 +33,13 @@ static InitChainEntry sInitChain[] = { ICHAIN_F32(uncullZoneDownward, 900, ICHAIN_STOP), }; -extern CollisionHeader D_0600805C; -extern Gfx D_06003478[]; - void ObjKepnKoya_Init(Actor* thisx, GlobalContext* globalCtx) { ObjKepnKoya* this = THIS; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); Actor_SetScale(&this->dyna.actor, 0.1f); DynaPolyActor_Init(&this->dyna, 0); - DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_0600805C); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_kepn_koya_Colheader_00805C); if (this->dyna.bgId == BG_ACTOR_MAX) { Actor_MarkForDeath(&this->dyna.actor); } @@ -57,5 +55,5 @@ void ObjKepnKoya_Update(Actor* thisx, GlobalContext* globalCtx) { } void ObjKepnKoya_Draw(Actor* thisx, GlobalContext* globalCtx) { - Gfx_DrawDListOpa(globalCtx, D_06003478); + Gfx_DrawDListOpa(globalCtx, object_kepn_koya_DL_003478); } diff --git a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c index 34d45038a..9a31d39f5 100644 --- a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c +++ b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c @@ -133,8 +133,8 @@ void func_80926394(ObjKibako* this, GlobalContext* globalCtx) { } void ObjKibako_Init(Actor* thisx, GlobalContext* globalCtx2) { - ObjKibako* this = THIS; GlobalContext* globalCtx = globalCtx2; + ObjKibako* this = THIS; s32 whichBankIndex; whichBankIndex = KIBAKO_BANK_INDEX(thisx); diff --git a/src/overlays/actors/ovl_Obj_Kzsaku/z_obj_kzsaku.c b/src/overlays/actors/ovl_Obj_Kzsaku/z_obj_kzsaku.c index d00746c37..1f9548839 100644 --- a/src/overlays/actors/ovl_Obj_Kzsaku/z_obj_kzsaku.c +++ b/src/overlays/actors/ovl_Obj_Kzsaku/z_obj_kzsaku.c @@ -5,6 +5,7 @@ */ #include "z_obj_kzsaku.h" +#include "objects/object_kzsaku/object_kzsaku.h" #define FLAGS 0x00000030 @@ -15,7 +16,13 @@ void ObjKzsaku_Destroy(Actor* thisx, GlobalContext* globalCtx); void ObjKzsaku_Update(Actor* thisx, GlobalContext* globalCtx); void ObjKzsaku_Draw(Actor* thisx, GlobalContext* globalCtx); -#if 0 +void ObjKzsaku_SetupIdle(ObjKzsaku* this); +void func_80C08BBC(ObjKzsaku* this); +void func_80C08C84(ObjKzsaku* this); +void ObjKzsaku_Idle(ObjKzsaku* this, GlobalContext* globalCtx); +void ObjKzsaku_Rise(ObjKzsaku* this, GlobalContext* globalCtx); +void func_80C08CB0(ObjKzsaku* this, GlobalContext* globalCtx); + const ActorInit Obj_Kzsaku_InitVars = { ACTOR_OBJ_KZSAKU, ACTORCAT_PROP, @@ -28,27 +35,96 @@ const ActorInit Obj_Kzsaku_InitVars = { (ActorFunc)ObjKzsaku_Draw, }; -#endif +void ObjKzsaku_Init(Actor* thisx, GlobalContext* globalCtx) { + s32 pad; + ObjKzsaku* this = THIS; + CollisionHeader* col = NULL; -extern UNK_TYPE D_06000040; -extern UNK_TYPE D_06001118; + Actor_SetScale(&this->dyna.actor, 1.0f); + DynaPolyActor_Init(&this->dyna, 1); + CollisionHeader_GetVirtual(&object_kzsaku_Colheader_001118, &col); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Kzsaku/ObjKzsaku_Init.s") + this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, thisx, col); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Kzsaku/ObjKzsaku_Destroy.s") + this->switchFlag = KZSAKU_GET_SWITCHFLAG(thisx); + this->raisedAmount = 0.0f; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Kzsaku/func_80C08B60.s") + if (Flags_GetSwitch(globalCtx, this->switchFlag)) { + func_80C08C84(this); + } else { + ObjKzsaku_SetupIdle(this); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Kzsaku/func_80C08B7C.s") +void ObjKzsaku_Destroy(Actor* thisx, GlobalContext* globalCtx) { + ObjKzsaku* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Kzsaku/func_80C08BBC.s") + DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Kzsaku/func_80C08BD0.s") +void ObjKzsaku_SetupIdle(ObjKzsaku* this) { + this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y; + this->actionFunc = ObjKzsaku_Idle; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Kzsaku/func_80C08C84.s") +void ObjKzsaku_Idle(ObjKzsaku* this, GlobalContext* globalCtx) { + if (Flags_GetSwitch(globalCtx, this->switchFlag)) { + func_80C08BBC(this); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Kzsaku/func_80C08CB0.s") +void func_80C08BBC(ObjKzsaku* this) { + this->actionFunc = ObjKzsaku_Rise; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Kzsaku/ObjKzsaku_Update.s") +void ObjKzsaku_Rise(ObjKzsaku* this, GlobalContext* globalCtx) { + if (this->dyna.actor.cutscene != -1) { + if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { + ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); + } else { + ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); + } + } + if (this->raisedAmount < 450.0f) { + func_800B9010(&this->dyna.actor, NA_SE_EV_METALDOOR_SLIDE - SFX_FLAG); + this->raisedAmount += 15.0f; + } else { + func_80C08C84(this); + } + this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + this->raisedAmount; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Kzsaku/ObjKzsaku_Draw.s") +void func_80C08C84(ObjKzsaku* this) { + this->timer = 0; + this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + 450.0f; + this->actionFunc = func_80C08CB0; +} + +void func_80C08CB0(ObjKzsaku* this, GlobalContext* globalCtx) { + if (this->timer <= 20) { + if (this->timer == 20) { + if (ActorCutscene_GetCurrentIndex() == this->dyna.actor.cutscene) { + ActorCutscene_Stop(this->dyna.actor.cutscene); + } + this->timer = 21; + } else { + this->timer++; + } + } +} + +void ObjKzsaku_Update(Actor* thisx, GlobalContext* globalCtx) { + ObjKzsaku* this = THIS; + + this->actionFunc(this, globalCtx); +} + +void ObjKzsaku_Draw(Actor* thisx, GlobalContext* globalCtx) { + OPEN_DISPS(globalCtx->state.gfxCtx); + + func_8012C28C(globalCtx->state.gfxCtx); + gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(POLY_OPA_DISP++, object_kzsaku_DL_000040); + + CLOSE_DISPS(globalCtx->state.gfxCtx); +} diff --git a/src/overlays/actors/ovl_Obj_Kzsaku/z_obj_kzsaku.h b/src/overlays/actors/ovl_Obj_Kzsaku/z_obj_kzsaku.h index 32b634677..8c126412d 100644 --- a/src/overlays/actors/ovl_Obj_Kzsaku/z_obj_kzsaku.h +++ b/src/overlays/actors/ovl_Obj_Kzsaku/z_obj_kzsaku.h @@ -3,15 +3,18 @@ #include "global.h" +#define KZSAKU_GET_SWITCHFLAG(thisx) (((thisx)->params & 0x7F00) >> 8) + struct ObjKzsaku; typedef void (*ObjKzsakuActionFunc)(struct ObjKzsaku*, GlobalContext*); typedef struct ObjKzsaku { - /* 0x0000 */ Actor actor; - /* 0x0144 */ char unk_144[0x18]; + /* 0x0000 */ DynaPolyActor dyna; /* 0x015C */ ObjKzsakuActionFunc actionFunc; - /* 0x0160 */ char unk_160[0xC]; + /* 0x0160 */ f32 raisedAmount; + /* 0x0164 */ s32 switchFlag; + /* 0x0168 */ s16 timer; } ObjKzsaku; // size = 0x16C extern const ActorInit Obj_Kzsaku_InitVars; diff --git a/src/overlays/actors/ovl_Obj_Lightblock/z_obj_lightblock.c b/src/overlays/actors/ovl_Obj_Lightblock/z_obj_lightblock.c index 185361c41..bd86f2dea 100644 --- a/src/overlays/actors/ovl_Obj_Lightblock/z_obj_lightblock.c +++ b/src/overlays/actors/ovl_Obj_Lightblock/z_obj_lightblock.c @@ -5,6 +5,7 @@ */ #include "z_obj_lightblock.h" +#include "objects/object_lightblock/object_lightblock.h" #define FLAGS 0x00000000 @@ -72,9 +73,7 @@ static InitChainEntry sInitChain[] = { ICHAIN_F32(uncullZoneDownward, 500, ICHAIN_STOP), }; -extern CollisionHeader D_06000B80; extern Gfx D_801AEF88[]; -extern Gfx D_06000178[]; extern Gfx D_801AEFA0[]; void func_80AF3910(ObjLightblock* this, GlobalContext* globalCtx) { @@ -96,7 +95,7 @@ void ObjLightblock_Init(Actor* thisx, GlobalContext* globalCtx) { if (Flags_GetSwitch(globalCtx, LIGHTBLOCK_DESTROYED(&this->dyna.actor))) { Actor_MarkForDeath(&this->dyna.actor); } else { - DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06000B80); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_lightblock_Colheader_000B80); Collider_SetCylinder(globalCtx, &this->collider, &this->dyna.actor, &sCylinderInit); Collider_UpdateCylinder(&this->dyna.actor, &this->collider); this->collider.dim.radius = typeVars->radius; @@ -195,13 +194,13 @@ void ObjLightblock_Draw(Actor* thisx, GlobalContext* globalCtx) { gSPSegment(POLY_XLU_DISP++, 0x08, D_801AEF88); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 255, 255, 255, this->alpha); - gSPDisplayList(POLY_XLU_DISP++, D_06000178); + gSPDisplayList(POLY_XLU_DISP++, object_lightblock_DL_000178); } else { func_8012C28C(globalCtx->state.gfxCtx); gSPSegment(POLY_OPA_DISP++, 0x08, D_801AEFA0); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0x80, 255, 255, 255, 255); - gSPDisplayList(POLY_OPA_DISP++, D_06000178); + gSPDisplayList(POLY_OPA_DISP++, object_lightblock_DL_000178); } CLOSE_DISPS(globalCtx->state.gfxCtx); } diff --git a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c index 3d8b8d307..ae7b508bd 100644 --- a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c +++ b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c @@ -5,6 +5,7 @@ */ #include "z_obj_lightswitch.h" +#include "objects/object_lightswitch/object_lightswitch.h" #define FLAGS 0x00000010 @@ -26,13 +27,6 @@ void ObjLightSwitch_SetupDisabled(ObjLightswitch* this); void ObjLightSwitch_Disabled(ObjLightswitch* this, GlobalContext* globalCtx); void ObjLightswitch_Idle(ObjLightswitch* this, GlobalContext* globalCtx); -extern Gfx D_06000260[]; -extern Gfx D_06000398[]; -extern Gfx D_06000408[]; -extern Gfx D_06000C20[]; -extern Gfx D_06000420[]; -extern Gfx D_06001420[]; - const ActorInit Obj_Lightswitch_InitVars = { ACTOR_OBJ_LIGHTSWITCH, ACTORCAT_SWITCH, @@ -73,10 +67,10 @@ static ColliderJntSphInit sJntSphInit = { }; // different face addresses for (sleep -> waking -> awake) of light switch face -static Gfx* sLightswitchFaceGfx[] = { - D_06000C20, - D_06000420, - D_06001420, +static TexturePtr sLightswitchFaceGfx[] = { + object_lightswitch_Tex_000C20, + object_lightswitch_Tex_000420, + object_lightswitch_Tex_001420, }; static Color_RGBA8 sLightswitchEffectPrimColor = { 255, 255, 160, 160 }; @@ -385,7 +379,7 @@ void ObjLightSwitch_DrawOpa(ObjLightswitch* this, GlobalContext* globalCtx) { tempPos.z = this->actor.world.pos.z; gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(sLightswitchFaceGfx[this->faceState])); - gSPDisplayList(POLY_OPA_DISP++, D_06000260); + gSPDisplayList(POLY_OPA_DISP++, object_lightswitch_DL_000260); tempRot.x = this->actor.shape.rot.x; tempRot.y = this->actor.shape.rot.y; @@ -393,13 +387,13 @@ void ObjLightSwitch_DrawOpa(ObjLightswitch* this, GlobalContext* globalCtx) { Matrix_SetStateRotationAndTranslation(tempPos.x, tempPos.y, tempPos.z, &tempRot); Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, D_06000398); + gSPDisplayList(POLY_OPA_DISP++, object_lightswitch_DL_000398); tempRot.z = this->actor.shape.rot.z - this->edgeRot; Matrix_SetStateRotationAndTranslation(tempPos.x, tempPos.y, tempPos.z, &tempRot); Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, D_06000408); + gSPDisplayList(POLY_OPA_DISP++, object_lightswitch_DL_000408); CLOSE_DISPS(globalCtx->state.gfxCtx); } @@ -421,7 +415,7 @@ void ObjLightSwitch_DrawXlu(ObjLightswitch* this, GlobalContext* globalCtx) { tempPos.z = this->actor.world.pos.z; gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(sLightswitchFaceGfx[this->faceState])); - gSPDisplayList(POLY_XLU_DISP++, D_06000260); + gSPDisplayList(POLY_XLU_DISP++, object_lightswitch_DL_000260); tempRot.x = this->actor.shape.rot.x; tempRot.y = this->actor.shape.rot.y; @@ -429,13 +423,13 @@ void ObjLightSwitch_DrawXlu(ObjLightswitch* this, GlobalContext* globalCtx) { Matrix_SetStateRotationAndTranslation(tempPos.x, tempPos.y, tempPos.z, &tempRot); Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_XLU_DISP++, D_06000398); + gSPDisplayList(POLY_XLU_DISP++, object_lightswitch_DL_000398); tempRot.z = this->actor.shape.rot.z - this->edgeRot; Matrix_SetStateRotationAndTranslation(tempPos.x, tempPos.y, tempPos.z, &tempRot); Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_XLU_DISP++, D_06000408); + gSPDisplayList(POLY_XLU_DISP++, object_lightswitch_DL_000408); CLOSE_DISPS(globalCtx->state.gfxCtx); } diff --git a/src/overlays/actors/ovl_Obj_Milk_Bin/z_obj_milk_bin.c b/src/overlays/actors/ovl_Obj_Milk_Bin/z_obj_milk_bin.c index 3ce3bf57e..1e17d7902 100644 --- a/src/overlays/actors/ovl_Obj_Milk_Bin/z_obj_milk_bin.c +++ b/src/overlays/actors/ovl_Obj_Milk_Bin/z_obj_milk_bin.c @@ -5,6 +5,7 @@ */ #include "z_obj_milk_bin.h" +#include "objects/object_obj_milk_bin/object_obj_milk_bin.h" #define FLAGS 0x00000000 @@ -16,13 +17,12 @@ void ObjMilkBin_Update(Actor* thisx, GlobalContext* globalCtx); void ObjMilkBin_Draw(Actor* thisx, GlobalContext* globalCtx); // gMilkBinMilkJarDL -extern Gfx D_060004B0[]; const ActorInit Obj_Milk_Bin_InitVars = { ACTOR_OBJ_MILK_BIN, ACTORCAT_PROP, FLAGS, - OBJECT_OBJECT_UNSET_MILK_BIN, + OBJECT_OBJ_MILK_BIN, sizeof(ObjMilkBin), (ActorFunc)ObjMilkBin_Init, (ActorFunc)ObjMilkBin_Destroy, @@ -72,8 +72,8 @@ void ObjMilkBin_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void ObjMilkBin_Update(Actor* thisx, GlobalContext* globalCtx2) { - ObjMilkBin* this = THIS; GlobalContext* globalCtx = globalCtx2; + ObjMilkBin* this = THIS; if (this->type == OBJ_MILK_BIN_TYPE_1) { if (gSaveContext.save.weekEventReg[0x16] & 1) { @@ -100,6 +100,6 @@ void ObjMilkBin_Draw(Actor* thisx, GlobalContext* globalCtx) { ObjMilkBin* this = THIS; if (!(this->disableDraw & 1)) { - Gfx_DrawDListOpa(globalCtx, D_060004B0); + Gfx_DrawDListOpa(globalCtx, gMilkBinMilkJarDL); } } diff --git a/src/overlays/actors/ovl_Obj_Moon_Stone/z_obj_moon_stone.c b/src/overlays/actors/ovl_Obj_Moon_Stone/z_obj_moon_stone.c index fc9150f14..247e01f06 100644 --- a/src/overlays/actors/ovl_Obj_Moon_Stone/z_obj_moon_stone.c +++ b/src/overlays/actors/ovl_Obj_Moon_Stone/z_obj_moon_stone.c @@ -5,6 +5,7 @@ */ #include "z_obj_moon_stone.h" +#include "objects/object_gi_reserve00/object_gi_reserve00.h" #define FLAGS 0x00100010 @@ -36,10 +37,6 @@ const ActorInit Obj_Moon_Stone_InitVars = { (ActorFunc)ObjMoonStone_Draw, }; -extern AnimatedMaterial D_06001C60; -extern Gfx D_06000D78[]; -extern Gfx D_06000C80[]; - void ObjMoonStone_Init(Actor* thisx, GlobalContext* globalCtx) { ObjMoonStone* this = THIS; @@ -153,11 +150,11 @@ void ObjMoonStone_Draw(Actor* thisx, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx); func_8012C28C(globalCtx->state.gfxCtx); func_8012C2DC(globalCtx->state.gfxCtx); - AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&D_06001C60)); + AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(object_gi_reserve00_Matanimheader_001C60)); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, D_06000D78); + gSPDisplayList(POLY_OPA_DISP++, object_gi_reserve00_DL_000D78); Matrix_NormalizeXYZ(&globalCtx->billboardMtxF); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_XLU_DISP++, D_06000C80); + gSPDisplayList(POLY_XLU_DISP++, object_gi_reserve00_DL_000C80); CLOSE_DISPS(globalCtx->state.gfxCtx); } diff --git a/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c b/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c index 1519f92eb..f41e577b4 100644 --- a/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c +++ b/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c @@ -162,8 +162,8 @@ void ObjMure_SpawnActors0(Actor* thisx, GlobalContext* globalCtx) { } } -void ObjMure_SpawnActors1(ObjMure* this, GlobalContext* globalCtx) { - GlobalContext* globalCtx2 = globalCtx; +void ObjMure_SpawnActors1(ObjMure* this, GlobalContext* globalCtx2) { + GlobalContext* globalCtx = globalCtx2; Actor* actor = &this->actor; Vec3f spawnPos; s32 maxChildren = ObjMure_GetMaxChildSpawns(this); @@ -172,7 +172,7 @@ void ObjMure_SpawnActors1(ObjMure* this, GlobalContext* globalCtx) { for (i = 0; i < maxChildren; i++) { ObjMure_GetSpawnPos(&spawnPos, &actor->world.pos, this->ptn, i); this->children[i] = Actor_SpawnAsChildAndCutscene( - &globalCtx->actorCtx, globalCtx, sSpawnActorIds[this->type], spawnPos.x, spawnPos.y, spawnPos.z, + &globalCtx2->actorCtx, globalCtx, sSpawnActorIds[this->type], spawnPos.x, spawnPos.y, spawnPos.z, actor->world.rot.x, actor->world.rot.y, actor->world.rot.z, (this->type == OBJMURE_TYPE_BUTTERFLY && i == 0) ? 1 : sSpawnParams[this->type], this->actor.cutscene, this->actor.unk20, NULL); diff --git a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c index 523cd7fb9..2d1149715 100644 --- a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c +++ b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c @@ -5,8 +5,10 @@ */ #include "z_obj_oshihiki.h" +#include "overlays/actors/ovl_Obj_Switch/z_obj_switch.h" +#include "objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h" -#define FLAGS 0x00000010 +#define FLAGS (ACTOR_FLAG_10) #define THIS ((ObjOshihiki*)thisx) @@ -15,7 +17,14 @@ void ObjOshihiki_Destroy(Actor* thisx, GlobalContext* globalCtx); void ObjOshihiki_Update(Actor* thisx, GlobalContext* globalCtx); void ObjOshihiki_Draw(Actor* thisx, GlobalContext* globalCtx); -#if 0 +void ObjOshihiki_OnScene(ObjOshihiki* this, GlobalContext* globalCtx); +void ObjOshihiki_SetupOnActor(ObjOshihiki* this, GlobalContext* globalCtx); +void ObjOshihiki_OnActor(ObjOshihiki* this, GlobalContext* globalCtx); +void ObjOshihiki_SetupPush(ObjOshihiki* this, GlobalContext* globalCtx); +void ObjOshihiki_Push(ObjOshihiki* this, GlobalContext* globalCtx); +void ObjOshihiki_SetupFall(ObjOshihiki* this, GlobalContext* globalCtx); +void ObjOshihiki_Fall(ObjOshihiki* this, GlobalContext* globalCtx); + const ActorInit Obj_Oshihiki_InitVars = { ACTOR_OBJ_OSHIHIKI, ACTORCAT_PROP, @@ -28,69 +37,567 @@ const ActorInit Obj_Oshihiki_InitVars = { (ActorFunc)ObjOshihiki_Draw, }; -// static InitChainEntry sInitChain[] = { -static InitChainEntry D_80918898[] = { +static f32 sScales[] = { 0.1f, 0.2f, 0.4f, 0.1f, 0.2f, 0.4f }; + +static Color_RGB8 sColors[] = { + { 255, 255, 255 }, { 255, 255, 255 }, { 255, 255, 255 }, { 255, 255, 255 }, { 255, 255, 255 }, { 255, 255, 255 }, + { 255, 255, 255 }, { 255, 255, 255 }, { 255, 255, 255 }, { 255, 255, 255 }, { 255, 255, 255 }, { 255, 255, 255 }, + { 255, 255, 255 }, { 255, 255, 255 }, { 255, 255, 255 }, { 255, 255, 255 }, +}; + +static InitChainEntry sInitChain[] = { ICHAIN_F32(uncullZoneForward, 4000, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneScale, 500, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneDownward, 500, ICHAIN_STOP), }; -#endif +// The vertices and center of the bottom face +static Vec3f sColCheckPoints[] = { + { 29.99f, 1.01f, -29.99f }, { -29.99f, 1.01f, -29.99f }, { -29.99f, 1.01f, 29.99f }, + { 29.99f, 1.01f, 29.99f }, { 0.0f, 1.01f, 0.0f }, +}; -extern InitChainEntry D_80918898[]; +static Vec2f sFaceVtx[] = { + { -30.0f, 0.0f }, { 30.0f, 0.0f }, { -30.0f, 60.0f }, { 30.0f, 60.0f }, { -30.0f, 20.0f }, { 30.0f, 20.0f }, +}; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/func_80917290.s") +static Vec2f sFaceDirection[] = { + { 1.0f, 1.0f }, { -1.0f, 1.0f }, { 1.0f, -1.0f }, { -1.0f, -1.0f }, { 1.0f, 3.0f }, { -1.0f, 3.0f }, +}; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/func_809172E4.s") +s8 D_80918940[] = { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/func_8091734C.s") +void ObjOshihiki_RotateXZ(Vec3f* out, Vec3f* in, f32 sn, f32 cs) { + out->x = (in->z * sn) + (in->x * cs); + out->y = in->y; + out->z = (in->z * cs) - (in->x * sn); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/func_80917378.s") +s32 ObjOshihiki_StrongEnough(ObjOshihiki* this, GlobalContext* globalCtx) { + s32 strength = OBJOSHIHIKI_GET_F(&this->dyna.actor); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/func_80917408.s") + if (this->cantMove) { + return false; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/func_80917538.s") + if ((strength == OBJOSHIHIKI_F_0) || (strength == OBJOSHIHIKI_F_3)) { + return true; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/func_80917604.s") + if (func_80124020() >= 2) { + return true; + } + return false; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/func_8091763C.s") +void ObjOshihiki_ResetFloors(ObjOshihiki* this) { + s32 i; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/func_8091768C.s") + for (i = 0; i < ARRAY_COUNT(this->floorBgIds); i++) { + this->floorBgIds[i] = BGCHECK_SCENE; + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/ObjOshihiki_Init.s") +ObjOshihiki* ObjOshihiki_GetBlockUnder(ObjOshihiki* this, GlobalContext* globalCtx) { + DynaPolyActor* dyna; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/ObjOshihiki_Destroy.s") + if ((this->floorBgIds[this->highestFloor] != BGCHECK_SCENE) && + (fabsf(this->dyna.actor.floorHeight - this->dyna.actor.world.pos.y) < 0.001f)) { + dyna = DynaPoly_GetActor(&globalCtx->colCtx, this->floorBgIds[this->highestFloor]); + if ((dyna != NULL) && (dyna->actor.id == ACTOR_OBJ_OSHIHIKI)) { + return (ObjOshihiki*)dyna; + } + } + return NULL; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/func_80917840.s") +void ObjOshihiki_UpdateInitPos(ObjOshihiki* this) { + if (this->dyna.actor.home.pos.x < this->dyna.actor.world.pos.x) { + while ((this->dyna.actor.world.pos.x - this->dyna.actor.home.pos.x) >= 60.0f) { + this->dyna.actor.home.pos.x += 60.0f; + } + } else { + while ((this->dyna.actor.home.pos.x - this->dyna.actor.world.pos.x) >= 60.0f) { + this->dyna.actor.home.pos.x -= 60.0f; + } + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/func_809179A0.s") + if (this->dyna.actor.home.pos.z < this->dyna.actor.world.pos.z) { + while ((this->dyna.actor.world.pos.z - this->dyna.actor.home.pos.z) >= 60.0f) { + this->dyna.actor.home.pos.z += 60.0f; + } + } else { + while ((this->dyna.actor.home.pos.z - this->dyna.actor.world.pos.z) >= 60.0f) { + this->dyna.actor.home.pos.z -= 60.0f; + } + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/func_80917AEC.s") +s32 ObjOshihiki_NoSwitchPress(ObjOshihiki* this, DynaPolyActor* dyna, GlobalContext* globalCtx) { + s16 dynaSwitchFlag; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/func_80917B44.s") + if (dyna == NULL) { + return true; + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/func_80917B9C.s") + if (dyna->actor.id == ACTOR_OBJ_SWITCH) { + dynaSwitchFlag = OBJSWITCH_GET_7F00(&dyna->actor); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/func_80917C14.s") + switch (OBJSWITCH_GET_33(&dyna->actor)) { + case OBJSWITCH_NORMAL_BLUE: + if ((dynaSwitchFlag == OBJOSHIHIKI_GET_7F00(&this->dyna.actor)) && + Flags_GetSwitch(globalCtx, dynaSwitchFlag)) { + return false; + } + break; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/func_80917E8C.s") + case OBJSWITCH_INVERSE_BLUE: + if ((dynaSwitchFlag == OBJOSHIHIKI_GET_7F00(&this->dyna.actor)) && + !Flags_GetSwitch(globalCtx, dynaSwitchFlag)) { + return false; + } + break; + } + } + return true; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/func_80917F88.s") +void ObjOshihiki_SetScale(ObjOshihiki* this, GlobalContext* globalCtx) { + Actor_SetScale(&this->dyna.actor, sScales[OBJOSHIHIKI_GET_F(&this->dyna.actor)]); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/func_80917FC0.s") +void ObjOshihiki_SetTextureStep(ObjOshihiki* this, GlobalContext* globalCtx) { + switch (OBJOSHIHIKI_GET_F(&this->dyna.actor)) { + case OBJOSHIHIKI_F_0: + case OBJOSHIHIKI_F_3: + this->textureStep = 0; + break; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/func_809180C8.s") + case OBJOSHIHIKI_F_1: + case OBJOSHIHIKI_F_4: + this->textureStep = 1; + break; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/func_80918108.s") + case OBJOSHIHIKI_F_2: + case OBJOSHIHIKI_F_5: + this->textureStep = 2; + break; + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/func_80918314.s") +void ObjOshihiki_SetColor(ObjOshihiki* this, GlobalContext* globalCtx) { + Color_RGB8* src = &sColors[OBJOSHIHIKI_GET_F0(&this->dyna.actor)]; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/func_8091834C.s") + this->color.r = src->r; + this->color.g = src->g; + this->color.b = src->b; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/func_8091851C.s") +void ObjOshihiki_Init(Actor* thisx, GlobalContext* globalCtx) { + ObjOshihiki* this = THIS; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/func_80918574.s") + DynaPolyActor_Init(&this->dyna, 1); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/ObjOshihiki_Update.s") + if ((OBJOSHIHIKI_GET_FF00(&this->dyna.actor) >= OBJOSHIHIKI_FF00_0) && + (OBJOSHIHIKI_GET_FF00(&this->dyna.actor) < OBJOSHIHIKI_FF00_80)) { + if (Flags_GetSwitch(globalCtx, OBJOSHIHIKI_GET_7F00(&this->dyna.actor))) { + switch (OBJOSHIHIKI_GET_F(&this->dyna.actor)) { + case OBJOSHIHIKI_F_0: + case OBJOSHIHIKI_F_1: + case OBJOSHIHIKI_F_2: + Actor_MarkForDeath(&this->dyna.actor); + return; + } + } else { + switch (OBJOSHIHIKI_GET_F(&this->dyna.actor)) { + case OBJOSHIHIKI_F_3: + case OBJOSHIHIKI_F_4: + case OBJOSHIHIKI_F_5: + Actor_MarkForDeath(&this->dyna.actor); + return; + } + } + } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/ObjOshihiki_Draw.s") + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &gameplay_dangeon_keep_Colheader_007498); + this->texture = Lib_SegmentedToVirtual(gameplay_dangeon_keep_Matanimheader_01B370); + ObjOshihiki_SetScale(this, globalCtx); + ObjOshihiki_SetTextureStep(this, globalCtx); + Actor_ProcessInitChain(&this->dyna.actor, sInitChain); + this->dyna.actor.colChkInfo.mass = MASS_IMMOVABLE; + ObjOshihiki_SetColor(this, globalCtx); + ObjOshihiki_ResetFloors(this); + ObjOshihiki_SetupOnActor(this, globalCtx); +} + +void ObjOshihiki_Destroy(Actor* thisx, GlobalContext* globalCtx) { + ObjOshihiki* this = THIS; + + DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId); +} + +void ObjOshihiki_SetFloors(ObjOshihiki* this, GlobalContext* globalCtx) { + s32 pad; + Vec3f colCheckPoint; + Vec3f colCheckOffset; + s32 i; + + for (i = 0; i < ARRAY_COUNT(sColCheckPoints); i++) { + colCheckOffset.x = sColCheckPoints[i].x * (this->dyna.actor.scale.x * 10.0f); + colCheckOffset.y = sColCheckPoints[i].y * (this->dyna.actor.scale.y * 10.0f); + colCheckOffset.z = sColCheckPoints[i].z * (this->dyna.actor.scale.z * 10.0f); + + ObjOshihiki_RotateXZ(&colCheckPoint, &colCheckOffset, this->yawSin, this->yawCos); + + colCheckPoint.x += this->dyna.actor.world.pos.x; + colCheckPoint.y += this->dyna.actor.prevPos.y; + colCheckPoint.z += this->dyna.actor.world.pos.z; + + this->floorHeights[i] = BgCheck_EntityRaycastFloor6( + &globalCtx->colCtx, &this->floorPolys[i], &this->floorBgIds[i], &this->dyna.actor, &colCheckPoint, 0.0f); + } +} + +s16 ObjOshihiki_GetHighestFloor(ObjOshihiki* this) { + s32 i; + s16 highestFloor = 0; + + for (i = 1; i < ARRAY_COUNT(this->floorHeights); i++) { + if (this->floorHeights[i] > this->floorHeights[highestFloor]) { + highestFloor = i; + } else if ((this->floorBgIds[i] == BGCHECK_SCENE) && + ((this->floorHeights[i] - this->floorHeights[highestFloor]) > -0.001f)) { + highestFloor = i; + } + } + + return highestFloor; +} + +void ObjOshihiki_SetGround(ObjOshihiki* this, GlobalContext* globalCtx) { + ObjOshihiki_ResetFloors(this); + ObjOshihiki_SetFloors(this, globalCtx); + this->highestFloor = ObjOshihiki_GetHighestFloor(this); + this->dyna.actor.floorHeight = this->floorHeights[this->highestFloor]; +} + +s32 ObjOshihiki_CheckFloor(ObjOshihiki* this, GlobalContext* globalCtx) { + ObjOshihiki_SetGround(this, globalCtx); + + if ((this->dyna.actor.floorHeight - this->dyna.actor.world.pos.y) >= -0.001f) { + this->dyna.actor.world.pos.y = this->dyna.actor.floorHeight; + return true; + } + return false; +} + +s32 ObjOshihiki_CheckGround(ObjOshihiki* this, GlobalContext* globalCtx) { + if (this->dyna.actor.world.pos.y <= BGCHECK_Y_MIN + 10.0f) { + Actor_MarkForDeath(&this->dyna.actor); + return false; + } + + if ((this->dyna.actor.floorHeight - this->dyna.actor.world.pos.y) >= -0.001f) { + this->dyna.actor.world.pos.y = this->dyna.actor.floorHeight; + return true; + } + return false; +} + +s32 ObjOshihiki_CheckWall(GlobalContext* globalCtx, s16 angle, f32 direction, ObjOshihiki* this) { + f32 maxDists[2]; + f32 maxDist; + f32 sn; + f32 cs; + s32 i; + Vec3f faceVtx; + Vec3f faceVtxNext; + Vec3f posResult; + Vec3f faceVtxOffset; + s32 bgId; + CollisionPoly* outPoly; + + sn = Math_SinS(angle); + cs = Math_CosS(angle); + + maxDists[0] = ((this->dyna.actor.scale.x * 300.0f) + 60.0f) - 0.5f; + if (direction > 0.0f) { + maxDists[1] = maxDists[0]; + } else { + maxDists[0] = -maxDists[0]; + maxDists[1] = -(((this->dyna.actor.scale.x * 300.0f) + 90.0f) - 0.5f); + } + + for (i = 0; i < ARRAY_COUNT(sFaceDirection); i++) { + maxDist = maxDists[D_80918940[i]]; + + faceVtxOffset.x = (sFaceVtx[i].x * this->dyna.actor.scale.x * 10.0f) + sFaceDirection[i].x; + faceVtxOffset.y = (sFaceVtx[i].y * this->dyna.actor.scale.y * 10.0f) + sFaceDirection[i].y; + faceVtxOffset.z = 0.0f; + + ObjOshihiki_RotateXZ(&faceVtx, &faceVtxOffset, sn, cs); + + faceVtx.x += this->dyna.actor.world.pos.x; + faceVtx.y += this->dyna.actor.world.pos.y; + faceVtx.z += this->dyna.actor.world.pos.z; + + faceVtxNext.x = (maxDist * sn) + faceVtx.x; + faceVtxNext.y = faceVtx.y; + faceVtxNext.z = (maxDist * cs) + faceVtx.z; + + if (BgCheck_EntityLineTest3(&globalCtx->colCtx, &faceVtx, &faceVtxNext, &posResult, &outPoly, 1, 0, 0, 1, &bgId, + &this->dyna.actor, 0.0f)) { + return true; + } + } + return false; +} + +s32 ObjOshihiki_MoveWithBlockUnder(ObjOshihiki* this, GlobalContext* globalCtx) { + s32 pad; + ObjOshihiki* blockUnder = ObjOshihiki_GetBlockUnder(this, globalCtx); + + if ((blockUnder != NULL) && (blockUnder->stateFlags & PUSHBLOCK_SETUP_PUSH)) { + if (!ObjOshihiki_CheckWall(globalCtx, blockUnder->dyna.yRotation, blockUnder->direction, this)) { + this->blockUnder = blockUnder; + } + } + + if (this->stateFlags & PUSHBLOCK_MOVE_UNDER) { + if (this->blockUnder != NULL) { + if (this->blockUnder->stateFlags & PUSHBLOCK_PUSH) { + this->underDistX = this->blockUnder->dyna.actor.world.pos.x - this->blockUnder->dyna.actor.prevPos.x; + this->underDistZ = this->blockUnder->dyna.actor.world.pos.z - this->blockUnder->dyna.actor.prevPos.z; + this->dyna.actor.world.pos.x += this->underDistX; + this->dyna.actor.world.pos.z += this->underDistZ; + ObjOshihiki_UpdateInitPos(this); + return true; + } + + if (!(this->blockUnder->stateFlags & PUSHBLOCK_SETUP_PUSH)) { + this->blockUnder = NULL; + } + } + } + return false; +} + +void ObjOshihiki_SetupOnScene(ObjOshihiki* this, GlobalContext* globalCtx) { + this->stateFlags |= PUSHBLOCK_SETUP_ON_SCENE; + this->dyna.actor.gravity = 0.0f; + this->dyna.actor.velocity.z = 0.0f; + this->dyna.actor.velocity.y = 0.0f; + this->dyna.actor.velocity.x = 0.0f; + this->actionFunc = ObjOshihiki_OnScene; +} + +void ObjOshihiki_OnScene(ObjOshihiki* this, GlobalContext* globalCtx) { + s32 pad; + Player* player = GET_PLAYER(globalCtx); + + this->stateFlags |= PUSHBLOCK_ON_SCENE; + + if (this->timer <= 0) { + if (fabsf(this->dyna.pushForce) > 0.001f) { + if (ObjOshihiki_StrongEnough(this, globalCtx)) { + if (!ObjOshihiki_CheckWall(globalCtx, this->dyna.yRotation, this->dyna.pushForce, this)) { + this->direction = this->dyna.pushForce; + ObjOshihiki_SetupPush(this, globalCtx); + return; + } + } + player->stateFlags2 &= ~0x10; + this->dyna.pushForce = 0.0f; + } + } else if (fabsf(this->dyna.pushForce) > 0.001f) { + player->stateFlags2 &= ~0x10; + this->dyna.pushForce = 0.0f; + } +} + +void ObjOshihiki_SetupOnActor(ObjOshihiki* this, GlobalContext* globalCtx) { + this->stateFlags |= PUSHBLOCK_SETUP_ON_ACTOR; + this->dyna.actor.velocity.z = 0.0f; + this->dyna.actor.velocity.y = 0.0f; + this->dyna.actor.velocity.x = 0.0f; + this->dyna.actor.gravity = -1.0f; + this->actionFunc = ObjOshihiki_OnActor; +} + +void ObjOshihiki_OnActor(ObjOshihiki* this, GlobalContext* globalCtx) { + s32 pad; + Player* player = GET_PLAYER(globalCtx); + DynaPolyActor* dyna; + s32 sp20 = false; + + this->stateFlags |= PUSHBLOCK_ON_ACTOR; + Actor_MoveWithGravity(&this->dyna.actor); + + if (ObjOshihiki_CheckFloor(this, globalCtx)) { + if (this->floorBgIds[this->highestFloor] == BGCHECK_SCENE) { + ObjOshihiki_SetupOnScene(this, globalCtx); + } else { + dyna = DynaPoly_GetActor(&globalCtx->colCtx, this->floorBgIds[this->highestFloor]); + if (dyna != NULL) { + DynaPolyActor_SetRidingFallingState(dyna); + DynaPolyActor_SetSwitchPressedState(dyna); + if ((this->timer <= 0) && (fabsf(this->dyna.pushForce) > 0.001f) && + ObjOshihiki_StrongEnough(this, globalCtx) && ObjOshihiki_NoSwitchPress(this, dyna, globalCtx) && + !ObjOshihiki_CheckWall(globalCtx, this->dyna.yRotation, this->dyna.pushForce, this)) { + this->direction = this->dyna.pushForce; + ObjOshihiki_SetupPush(this, globalCtx); + sp20 = true; + } + } else { + ObjOshihiki_SetupOnScene(this, globalCtx); + } + } + } else if (this->floorBgIds[this->highestFloor] == BGCHECK_SCENE) { + ObjOshihiki_SetupFall(this, globalCtx); + } else { + dyna = DynaPoly_GetActor(&globalCtx->colCtx, this->floorBgIds[this->highestFloor]); + if ((dyna != NULL) && (dyna->flags & 1)) { + DynaPolyActor_SetRidingFallingState(dyna); + DynaPolyActor_SetSwitchPressedState(dyna); + this->dyna.actor.world.pos.y = this->dyna.actor.floorHeight; + } else { + ObjOshihiki_SetupFall(this, globalCtx); + } + } + + if (!sp20 && (fabsf(this->dyna.pushForce) > 0.001f)) { + player->stateFlags2 &= ~0x10; + this->dyna.pushForce = 0.0f; + } +} + +void ObjOshihiki_SetupPush(ObjOshihiki* this, GlobalContext* globalCtx) { + this->stateFlags |= PUSHBLOCK_SETUP_PUSH; + this->dyna.actor.gravity = 0.0f; + this->pushSpeed = 2.0f; + this->actionFunc = ObjOshihiki_Push; +} + +void ObjOshihiki_Push(ObjOshihiki* this, GlobalContext* globalCtx) { + s32 pad; + Player* player = GET_PLAYER(globalCtx); + f32 pushDistSigned; + s32 stopFlag; + + this->stateFlags |= PUSHBLOCK_PUSH; + stopFlag = Math_StepToF(&this->pushDist, 60.0f, this->pushSpeed); + + pushDistSigned = ((this->direction >= 0.0f) ? 1.0f : -1.0f) * this->pushDist; + this->dyna.actor.world.pos.x = this->dyna.actor.home.pos.x + (pushDistSigned * this->yawSin); + this->dyna.actor.world.pos.z = this->dyna.actor.home.pos.z + (pushDistSigned * this->yawCos); + + if (!ObjOshihiki_CheckFloor(this, globalCtx)) { + this->dyna.actor.home.pos.x = this->dyna.actor.world.pos.x; + this->dyna.actor.home.pos.z = this->dyna.actor.world.pos.z; + player->stateFlags2 &= ~0x10; + this->dyna.pushForce = 0.0f; + this->pushDist = 0.0f; + this->pushSpeed = 0.0f; + ObjOshihiki_SetupFall(this, globalCtx); + } else if (stopFlag) { + player = GET_PLAYER(globalCtx); + + if (ObjOshihiki_CheckWall(globalCtx, this->dyna.yRotation, this->dyna.pushForce, this)) { + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); + } + + this->dyna.actor.home.pos.x = this->dyna.actor.world.pos.x; + this->dyna.actor.home.pos.z = this->dyna.actor.world.pos.z; + player->stateFlags2 &= ~0x10; + this->dyna.pushForce = 0.0f; + this->pushDist = 0.0f; + this->pushSpeed = 0.0f; + this->timer = 10; + + if (this->floorBgIds[this->highestFloor] == BGCHECK_SCENE) { + ObjOshihiki_SetupOnScene(this, globalCtx); + } else { + ObjOshihiki_SetupOnActor(this, globalCtx); + } + } + + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_ROCK_SLIDE - SFX_FLAG); +} + +void ObjOshihiki_SetupFall(ObjOshihiki* this, GlobalContext* globalCtx) { + this->stateFlags |= PUSHBLOCK_SETUP_FALL; + this->dyna.actor.velocity.z = 0.0f; + this->dyna.actor.velocity.y = 0.0f; + this->dyna.actor.velocity.x = 0.0f; + this->dyna.actor.gravity = -1.0f; + ObjOshihiki_SetGround(this, globalCtx); + this->actionFunc = ObjOshihiki_Fall; +} + +void ObjOshihiki_Fall(ObjOshihiki* this, GlobalContext* globalCtx) { + Player* player = GET_PLAYER(globalCtx); + s16 temp_t4; + + this->stateFlags |= PUSHBLOCK_FALL; + + if (fabsf(this->dyna.pushForce) > 0.001f) { + this->dyna.pushForce = 0.0f; + player->stateFlags2 &= ~0x10; + } + + Actor_MoveWithGravity(&this->dyna.actor); + + if (ObjOshihiki_CheckGround(this, globalCtx)) { + if (this->floorBgIds[this->highestFloor] == BGCHECK_SCENE) { + ObjOshihiki_SetupOnScene(this, globalCtx); + } else { + ObjOshihiki_SetupOnActor(this, globalCtx); + } + Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); + Actor_PlaySfxAtPos(&this->dyna.actor, + SurfaceType_GetSfx(&globalCtx->colCtx, this->floorPolys[this->highestFloor], + this->floorBgIds[this->highestFloor]) + + SFX_FLAG); + } +} + +void ObjOshihiki_Update(Actor* thisx, GlobalContext* globalCtx) { + ObjOshihiki* this = THIS; + + this->stateFlags &= + ~(PUSHBLOCK_SETUP_FALL | PUSHBLOCK_FALL | PUSHBLOCK_SETUP_PUSH | PUSHBLOCK_PUSH | PUSHBLOCK_SETUP_ON_ACTOR | + PUSHBLOCK_ON_ACTOR | PUSHBLOCK_SETUP_ON_SCENE | PUSHBLOCK_ON_SCENE); + this->stateFlags |= PUSHBLOCK_MOVE_UNDER; + if (this->timer > 0) { + this->timer--; + } + + this->dyna.actor.world.rot.y = this->dyna.yRotation; + this->yawSin = Math_SinS(this->dyna.actor.world.rot.y); + this->yawCos = Math_CosS(this->dyna.actor.world.rot.y); + + if (this->actionFunc != NULL) { + this->actionFunc(this, globalCtx); + } +} + +void ObjOshihiki_Draw(Actor* thisx, GlobalContext* globalCtx) { + s32 pad; + ObjOshihiki* this = THIS; + + OPEN_DISPS(globalCtx->state.gfxCtx); + + if (ObjOshihiki_MoveWithBlockUnder(this, globalCtx)) { + Matrix_InsertTranslation(this->underDistX * 10.0f, 0.0f, this->underDistZ * 10.0f, MTXMODE_APPLY); + } + + this->stateFlags &= ~PUSHBLOCK_MOVE_UNDER; + func_8012C28C(globalCtx->state.gfxCtx); + AnimatedMat_DrawStep(globalCtx, this->texture, this->textureStep); + + gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gDPSetPrimColor(POLY_OPA_DISP++, 0xFF, 0xFF, this->color.r, this->color.g, this->color.b, 255); + gSPDisplayList(POLY_OPA_DISP++, gameplay_dangeon_keep_DL_0182A8); + + CLOSE_DISPS(globalCtx->state.gfxCtx); +} diff --git a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.h b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.h index 4b265f4be..e08630132 100644 --- a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.h +++ b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.h @@ -7,11 +7,57 @@ struct ObjOshihiki; typedef void (*ObjOshihikiActionFunc)(struct ObjOshihiki*, GlobalContext*); +#define OBJOSHIHIKI_GET_F(thisx) ((thisx)->params & 0xF) +#define OBJOSHIHIKI_GET_F0(thisx) (((thisx)->params >> 4) & 0xF) +#define OBJOSHIHIKI_GET_7F00(thisx) (((thisx)->params >> 8) & 0x7F) +#define OBJOSHIHIKI_GET_FF00(thisx) (((thisx)->params >> 8) & 0xFF) + +enum { + /* 0 */ OBJOSHIHIKI_F_0, + /* 1 */ OBJOSHIHIKI_F_1, + /* 2 */ OBJOSHIHIKI_F_2, + /* 3 */ OBJOSHIHIKI_F_3, + /* 4 */ OBJOSHIHIKI_F_4, + /* 5 */ OBJOSHIHIKI_F_5, + /* 6 */ OBJOSHIHIKI_F_6, + /* 7 */ OBJOSHIHIKI_F_7, + /* 8 */ OBJOSHIHIKI_F_8, +}; + +#define OBJOSHIHIKI_FF00_0 0 +#define OBJOSHIHIKI_FF00_80 0x80 + +#define PUSHBLOCK_ON_SCENE (1 << 0) +#define PUSHBLOCK_SETUP_ON_SCENE (1 << 1) +#define PUSHBLOCK_ON_ACTOR (1 << 2) +#define PUSHBLOCK_SETUP_ON_ACTOR (1 << 3) +#define PUSHBLOCK_PUSH (1 << 4) +#define PUSHBLOCK_SETUP_PUSH (1 << 5) +#define PUSHBLOCK_FALL (1 << 6) +#define PUSHBLOCK_SETUP_FALL (1 << 7) +#define PUSHBLOCK_MOVE_UNDER (1 << 8) + typedef struct ObjOshihiki { - /* 0x0000 */ Actor actor; - /* 0x0144 */ char unk_144[0x18]; + /* 0x0000 */ DynaPolyActor dyna; /* 0x015C */ ObjOshihikiActionFunc actionFunc; - /* 0x0160 */ char unk_160[0x6C]; + /* 0x0160 */ u16 stateFlags; + /* 0x0162 */ s16 timer; + /* 0x0164 */ f32 yawSin; + /* 0x0168 */ f32 yawCos; + /* 0x016C */ f32 pushSpeed; + /* 0x0170 */ f32 pushDist; + /* 0x0174 */ f32 direction; + /* 0x0178 */ s32 floorBgIds[5]; + /* 0x018C */ CollisionPoly* floorPolys[5]; + /* 0x01A0 */ f32 floorHeights[5]; + /* 0x01B4 */ s16 highestFloor; + /* 0x01B6 */ u8 cantMove; + /* 0x01B8 */ struct ObjOshihiki* blockUnder; + /* 0x01BC */ f32 underDistX; + /* 0x01C0 */ f32 underDistZ; + /* 0x01C4 */ s8 textureStep; + /* 0x01C5 */ Color_RGB8 color; + /* 0x01C8 */ AnimatedMaterial* texture; } ObjOshihiki; // size = 0x1CC extern const ActorInit Obj_Oshihiki_InitVars; diff --git a/src/overlays/actors/ovl_Obj_Raillift/z_obj_raillift.c b/src/overlays/actors/ovl_Obj_Raillift/z_obj_raillift.c index 45bb9ffca..17490112f 100644 --- a/src/overlays/actors/ovl_Obj_Raillift/z_obj_raillift.c +++ b/src/overlays/actors/ovl_Obj_Raillift/z_obj_raillift.c @@ -5,6 +5,7 @@ */ #include "z_obj_raillift.h" +#include "objects/object_raillift/object_raillift.h" #define FLAGS 0x00000010 @@ -26,12 +27,6 @@ void ObjRaillift_Teleport(ObjRaillift* this, GlobalContext* globalCtx); void ObjRaillift_Wait(ObjRaillift* this, GlobalContext* globalCtx); void ObjRaillift_Move(ObjRaillift* this, GlobalContext* globalCtx); -extern CollisionHeader D_06004FF8; -extern CollisionHeader D_060048D0; -extern Gfx D_06004BF0[]; -extern Gfx D_06000208[]; -extern Gfx D_060071B8[]; - const ActorInit Obj_Raillift_InitVars = { ACTOR_OBJ_RAILLIFT, ACTORCAT_BG, @@ -51,7 +46,7 @@ static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), }; -static CollisionHeader* sColHeaders[] = { &D_06004FF8, &D_060048D0 }; +static CollisionHeader* sColHeaders[] = { &object_raillift_Colheader_004FF8, &object_raillift_Colheader_0048D0 }; void ObjRaillift_UpdatePosition(ObjRaillift* this, s32 idx) { Math_Vec3s_ToVec3f(&this->dyna.actor.world.pos, &this->points[idx]); @@ -275,7 +270,7 @@ void ObjRaillift_Draw(Actor* thisx, GlobalContext* globalCtx) { Gfx_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, 0, globalCtx->gameplayFrames, 0, 32, 32, 1, 0, 0, 32, 32, 0, 0, 0, 160)); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, D_06004BF0); + gSPDisplayList(POLY_OPA_DISP++, object_raillift_DL_004BF0); CLOSE_DISPS(globalCtx->state.gfxCtx); } @@ -283,12 +278,12 @@ void ObjRaillift_Draw(Actor* thisx, GlobalContext* globalCtx) { The non-colorful platforms are the ones found in Woodfall Temple */ void ObjRaillift_DrawDekuFlowerPlatform(Actor* thisx, GlobalContext* globalCtx) { - Gfx_DrawDListOpa(globalCtx, D_06000208); + Gfx_DrawDListOpa(globalCtx, object_raillift_DL_000208); } /* The colorful platforms are the ones found in Deku Palace */ void ObjRaillift_DrawDekuFlowerPlatformColorful(Actor* thisx, GlobalContext* globalCtx) { - Gfx_DrawDListOpa(globalCtx, D_060071B8); + Gfx_DrawDListOpa(globalCtx, object_raillift_DL_0071B8); } diff --git a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.h b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.h index 96b5f2bb6..5d1134f12 100644 --- a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.h +++ b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.h @@ -7,6 +7,12 @@ struct ObjSwitch; typedef void (*ObjSwitchActionFunc)(struct ObjSwitch*, GlobalContext*); +#define OBJSWITCH_GET_33(thisx) ((thisx)->params & 0x33) +#define OBJSWITCH_GET_7F00(thisx) (((thisx)->params >> 8) & 0x7F) + +#define OBJSWITCH_NORMAL_BLUE 0x20 +#define OBJSWITCH_INVERSE_BLUE 0x30 + typedef struct ObjSwitch { /* 0x0000 */ Actor actor; /* 0x0144 */ char unk_144[0x18]; diff --git a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c index d1fb1b23e..5033a1dc0 100644 --- a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c +++ b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c @@ -7,6 +7,7 @@ #include "z_obj_syokudai.h" #include "objects/gameplay_keep/gameplay_keep.h" #include "overlays/actors/ovl_En_Arrow/z_en_arrow.h" +#include "objects/object_syokudai/object_syokudai.h" #define FLAGS 0x00000410 @@ -17,10 +18,6 @@ void ObjSyokudai_Destroy(Actor* thisx, GlobalContext* globalCtx); void ObjSyokudai_Update(Actor* thisx, GlobalContext* globalCtx); void ObjSyokudai_Draw(Actor* thisx, GlobalContext* globalCtx); -extern Gfx D_060003A0[]; // sObjectSyokudaiTypeSwitchCausesFlameDL -extern Gfx D_06000870[]; // sObjectSyokudaiTypeNoSwitchDL -extern Gfx D_06000B90[]; // sObjectSyokudaiTypeFlameCausesSwitchDL - const ActorInit Obj_Syokudai_InitVars = { ACTOR_OBJ_SYOKUDAI, ACTORCAT_PROP, @@ -82,7 +79,11 @@ static InitChainEntry sInitChain[] = { static u8 sColTypes[] = { COLTYPE_METAL, COLTYPE_WOOD, COLTYPE_WOOD }; -static Gfx* sDLists[] = { D_060003A0, D_06000B90, D_06000870 }; +static Gfx* sDLists[] = { + gObjectSyokudaiTypeSwitchCausesFlameDL, + gObjectSyokudaiTypeFlameCausesSwitchDL, + gObjectSyokudaiTypeNoSwitchDL, +}; static s32 sNumLitTorchesInGroup; diff --git a/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c b/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c index dfdca8be6..8e88b39c6 100644 --- a/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c +++ b/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c @@ -1,17 +1,32 @@ /* * File: z_obj_tokeidai.c * Overlay: ovl_Obj_Tokeidai - * Description: Components of the Clock Tower (gears, clock face, counterweight, etc). Also used for wall clocks. + * Description: Components of the Clock Tower. Also used for wall clocks. The specific components are: + * - ClockFace: The decorated face of the clock that spins every hour. + * - MinuteRing: The ring around the clock face that spins every two minutes. + * - ExteriorGear: The two gears on the side of the tower that spin every two minutes. + * - SunAndMoonPanel: A panel with a sun and moon image that tells whether it is day or night. + * - Counterweight: The spinning weight on top of the tower that emits a spotlight at night. + * - StaircaseToRooftop: The staircase to tower's rooftop that opens after midnight on the Final Day. + * - TerminaFieldWalls: The walls of the Clock Tower visible from Termina Field. + * - UnusedWall: A single wall of the Clock Tower, unused in the final game. * - * This actor handles most of the functionality related to the Clock Tower and the various - * wall clocks around Clock Town. Among its responsibilities are making the clocks correctly - * tell the time by spinning the various pieces and gears and controlling the spotlight that - * is emitted from the Clock Tower at night. + * Sometimes, the ClockFace, MinuteRing, and SunAndMoonPanel are treated as a single clock entity. + * This is called Clock if it applies to both the Clock Tower clock and wall clocks, and + * TowerClock/WallClock, respectively, if it only applies to one of them. * * On the midnight of the Final Day, the Clock Tower opens up, and the various pieces of it - * are moved around. This actor is responsible for managing all of this movement. Additionally, - * if the moon crashes into Termina, this actor is responsible for making the pieces of the - * Clock Tower collapse. + * are moved around. This actor is responsible for managing all of this movement, which is handled + * via the series of action functions labeled with TowerOpening. + * + * All components have at least one of these three actions: + * - Idle: The "default" action, and for some components the only action. + * The component is either completely still, or it's telling the time, depending on the component. + * - OpenedIdle: The action for certain Clock Tower components after midnight on the Final Day. + * The TowerClock, ExteriorGears, and Counterweight no longer tell time and are moved to a different position. + * Called "opened" because it corresponds to when the staircase to the tower's rooftop is opened up. + * - Collapse: The action for certain Clock Tower components when the moon crashes into Termina. + * This action is responsible for making the component fall during the moon crash cutscene. */ #include "z_obj_tokeidai.h" @@ -21,10 +36,11 @@ #define THIS ((ObjTokeidai*)thisx) -#define GET_CURRENT_HOUR(this) ((s32)((this)->currentTime * (24.0f / 0x10000))) -#define GET_CURRENT_MINUTE(this) ((s32)((this)->currentTime * (360 * 2.0f / 0x10000)) % 30) -#define GET_CLOCK_FACE_ROTATION(currentHour) ((s16)(currentHour * (0x10000 / 24.0f))) -#define GET_OUTER_RING_OR_GEAR_ROTATION(currentMinute) ((s16)(currentMinute * (0x10000 * 12.0f / 360))) +#define GET_CURRENT_CLOCK_HOUR(this) ((s32)((this)->clockTime * (24.0f / 0x10000))) +#define GET_CURRENT_CLOCK_MINUTE(this) ((s32)((this)->clockTime * (360 * 2.0f / 0x10000)) % 30) +#define GET_CLOCK_FACE_ROTATION(currentClockHour) ((s16)(currentClockHour * (0x10000 / 24.0f))) +#define GET_MINUTE_RING_OR_EXTERIOR_GEAR_ROTATION(currentClockMinute) \ + ((s16)(currentClockMinute * (0x10000 * 12.0f / 360))) void ObjTokeidai_Init(Actor* thisx, GlobalContext* globalCtx); void ObjTokeidai_Destroy(Actor* thisx, GlobalContext* globalCtx); @@ -33,24 +49,24 @@ void ObjTokeidai_Draw(Actor* thisx, GlobalContext* globalCtx); void ObjTokeidai_DoNothing(ObjTokeidai* this, GlobalContext* globalCtx); void ObjTokeidai_TowerClock_OpenedIdle(ObjTokeidai* this, GlobalContext* globalCtx); -void ObjTokeidai_TowerGear_OpenedIdle(ObjTokeidai* this, GlobalContext* globalCtx); +void ObjTokeidai_ExteriorGear_OpenedIdle(ObjTokeidai* this, GlobalContext* globalCtx); void ObjTokeidai_Counterweight_OpenedIdle(ObjTokeidai* this, GlobalContext* globalCtx); void ObjTokeidai_TowerClock_Idle(ObjTokeidai* this, GlobalContext* globalCtx); void ObjTokeidai_WallClock_Idle(ObjTokeidai* this, GlobalContext* globalCtx); -void ObjTokeidai_TowerGear_Idle(ObjTokeidai* this, GlobalContext* globalCtx); +void ObjTokeidai_ExteriorGear_Idle(ObjTokeidai* this, GlobalContext* globalCtx); void ObjTokeidai_Counterweight_Idle(ObjTokeidai* this, GlobalContext* globalCtx); -void ObjTokeidai_Walls_Idle(ObjTokeidai* this, GlobalContext* globalCtx); -void ObjTokeidai_StaircaseIntoTower_Idle(ObjTokeidai* this, GlobalContext* globalCtx); +void ObjTokeidai_TerminaFieldWalls_Idle(ObjTokeidai* this, GlobalContext* globalCtx); +void ObjTokeidai_StaircaseToRooftop_Idle(ObjTokeidai* this, GlobalContext* globalCtx); void ObjTokeidai_SetupTowerOpening(ObjTokeidai* this); void ObjTokeidai_Clock_Draw(Actor* thisx, GlobalContext* globalCtx); void ObjTokeidai_Counterweight_Draw(Actor* thisx, GlobalContext* globalCtx); -void ObjTokeidai_TowerGear_Draw(Actor* thisx, GlobalContext* globalCtx); +void ObjTokeidai_ExteriorGear_Draw(Actor* thisx, GlobalContext* globalCtx); const ActorInit Obj_Tokeidai_InitVars = { ACTOR_OBJ_TOKEIDAI, ACTORCAT_PROP, FLAGS, - OBJECT_OBJECT_UNSET_TOKEIDAI, + OBJECT_OBJ_TOKEIDAI, sizeof(ObjTokeidai), (ActorFunc)ObjTokeidai_Init, (ActorFunc)ObjTokeidai_Destroy, @@ -67,43 +83,43 @@ static InitChainEntry sInitChain[] = { /** * Returns the angle necessary to show the correct side of - * the sun and moon disk based on the time of day. The actual - * angle can differ from the target angle if the disk is in + * the sun and moon panel based on the time of day. The actual + * angle can differ from the target angle if the panel is in * the middle of rotating. */ -s32 ObjTokeidai_GetTargetSunMoonDiskRotation() { +s32 ObjTokeidai_GetTargetSunMoonPanelRotation() { if (gSaveContext.save.isNight) { return 0x8000; } return 0; } -void ObjTokeidai_SetupClockOrGear(ObjTokeidai* this) { - s32 currentMinute = GET_CURRENT_MINUTE(this); +void ObjTokeidai_SetupClockOrExteriorGear(ObjTokeidai* this) { + s32 currentClockMinute = GET_CURRENT_CLOCK_MINUTE(this); - this->clockMinute = currentMinute; - this->outerRingOrGearRotation = GET_OUTER_RING_OR_GEAR_ROTATION(currentMinute); - this->outerRingOrGearRotationalVelocity = 0x3C; - this->outerRingOrGearRotationTimer = 0; + this->clockMinute = currentClockMinute; + this->minuteRingOrExteriorGearRotation = GET_MINUTE_RING_OR_EXTERIOR_GEAR_ROTATION(currentClockMinute); + this->minuteRingOrExteriorGearRotationalVelocity = 0x3C; + this->minuteRingOrExteriorGearRotationTimer = 0; } void ObjTokeidai_Clock_Init(ObjTokeidai* this) { - s32 currentHour; + s32 currentClockHour; - ObjTokeidai_SetupClockOrGear(this); - currentHour = GET_CURRENT_HOUR(this); - this->clockHour = currentHour; - this->clockFaceRotation = GET_CLOCK_FACE_ROTATION(currentHour); + ObjTokeidai_SetupClockOrExteriorGear(this); + currentClockHour = GET_CURRENT_CLOCK_HOUR(this); + this->clockHour = currentClockHour; + this->clockFaceRotation = GET_CLOCK_FACE_ROTATION(currentClockHour); this->clockFaceRotationalVelocity = 0; this->clockFaceRotationTimer = 0; - this->sunMoonDiskRotationalVelocity = 0; - this->sunMoonDiskRotation = ObjTokeidai_GetTargetSunMoonDiskRotation(); + this->sunMoonPanelRotationalVelocity = 0; + this->sunMoonPanelRotation = ObjTokeidai_GetTargetSunMoonPanelRotation(); } -void ObjTokeidai_TowerGear_Init(ObjTokeidai* this, GlobalContext* globalCtx) { - this->actor.draw = ObjTokeidai_TowerGear_Draw; - this->opaDList = object_obj_tokeidai_DL_00BA78; - ObjTokeidai_SetupClockOrGear(this); +void ObjTokeidai_ExteriorGear_Init(ObjTokeidai* this, GlobalContext* globalCtx) { + this->actor.draw = ObjTokeidai_ExteriorGear_Draw; + this->opaDList = gClockTowerExteriorGearDL; + ObjTokeidai_SetupClockOrExteriorGear(this); if (((globalCtx->sceneNum == SCENE_CLOCKTOWER) && (gSaveContext.sceneSetupIndex == 2) && (globalCtx->csCtx.unk_12 == 0)) || @@ -111,12 +127,12 @@ void ObjTokeidai_TowerGear_Init(ObjTokeidai* this, GlobalContext* globalCtx) { (globalCtx->csCtx.unk_12 == 0))) { ObjTokeidai_SetupTowerOpening(this); } else if ((CURRENT_DAY == 3 && gSaveContext.save.time < CLOCK_TIME(6, 0)) || CURRENT_DAY >= 4) { - this->actionFunc = ObjTokeidai_TowerGear_OpenedIdle; + this->actionFunc = ObjTokeidai_ExteriorGear_OpenedIdle; this->actor.world.pos.y += this->actor.scale.y * 1900.0f; this->actor.shape.yOffset = 1500.0f; gSaveContext.save.weekEventReg[8] |= 0x40; } else { - this->actionFunc = ObjTokeidai_TowerGear_Idle; + this->actionFunc = ObjTokeidai_ExteriorGear_Idle; } } @@ -133,11 +149,14 @@ void ObjTokeidai_TowerClock_Init(ObjTokeidai* this, GlobalContext* globalCtx) { this->actor.world.pos.y += (this->actor.scale.y * 5191.0f) - 50.0f; this->actor.world.pos.x += Math_SinS(this->actor.world.rot.y) * this->actor.scale.z * 1791.0f; this->actor.world.pos.z += -Math_CosS(this->actor.world.rot.y) * this->actor.scale.z * 1791.0f; + this->clockFaceZTranslation = -0x140; this->actor.shape.rot.x = -0x4000; + this->actor.home.pos = this->actor.world.pos; this->actor.home.pos.y -= 1178.0f; this->actor.home.pos.z += 13.0f; + this->actionFunc = ObjTokeidai_TowerClock_OpenedIdle; } else { this->actionFunc = ObjTokeidai_TowerClock_Idle; @@ -148,8 +167,8 @@ void ObjTokeidai_Counterweight_Init(ObjTokeidai* this, GlobalContext* globalCtx) s32 type; this->actor.draw = ObjTokeidai_Counterweight_Draw; - this->opaDList = object_obj_tokeidai_DL_00B208; - this->xluDList = object_obj_tokeidai_DL_00B0C0; + this->opaDList = gClockTowerCounterweightDL; + this->xluDList = gClockTowerSpotlightDL; if (gSaveContext.save.isNight) { this->spotlightIntensity = 100; } else { @@ -162,6 +181,7 @@ void ObjTokeidai_Counterweight_Init(ObjTokeidai* this, GlobalContext* globalCtx) (globalCtx->csCtx.unk_12 == 0))) { this->spotlightIntensity = 0; ObjTokeidai_SetupTowerOpening(this); + if (this->actor.child == NULL) { type = OBJ_TOKEIDAI_TYPE(&this->actor); if (type == OBJ_TOKEIDAI_TYPE_COUNTERWEIGHT_CLOCK_TOWN || @@ -171,6 +191,7 @@ void ObjTokeidai_Counterweight_Init(ObjTokeidai* this, GlobalContext* globalCtx) this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0); } } + if (this->actor.child != NULL) { if (OBJ_TOKEIDAI_TYPE(&this->actor) == OBJ_TOKEIDAI_TYPE_COUNTERWEIGHT_TERMINA_FIELD) { this->actor.child->home.rot.x = 0x384; @@ -200,55 +221,65 @@ void ObjTokeidai_Init(Actor* thisx, GlobalContext* globalCtx) { this->xRotation = 0; this->yTranslation = 0; this->clockFaceZTranslation = 0; - this->currentTime = gSaveContext.save.time; + this->clockTime = gSaveContext.save.time; this->actor.home.rot.x = 0; switch (OBJ_TOKEIDAI_TYPE(&this->actor)) { - case OBJ_TOKEIDAI_TYPE_TOWER_GEAR_TERMINA_FIELD: + case OBJ_TOKEIDAI_TYPE_EXTERIOR_GEAR_TERMINA_FIELD: Actor_SetScale(&this->actor, 0.15f); - ObjTokeidai_TowerGear_Init(this, globalCtx); + ObjTokeidai_ExteriorGear_Init(this, globalCtx); break; - case OBJ_TOKEIDAI_TYPE_TOWER_GEAR_CLOCK_TOWN: - ObjTokeidai_TowerGear_Init(this, globalCtx); + + case OBJ_TOKEIDAI_TYPE_EXTERIOR_GEAR_CLOCK_TOWN: + ObjTokeidai_ExteriorGear_Init(this, globalCtx); break; + case OBJ_TOKEIDAI_TYPE_UNUSED_WALL: - this->opaDList = object_obj_tokeidai_DL_00D388; + this->opaDList = gClockTowerUnusedTowerWallDL; break; + case OBJ_TOKEIDAI_TYPE_TOWER_WALLS_TERMINA_FIELD: Actor_SetScale(&this->actor, 1.0f); - this->opaDList = object_obj_tokeidai_DL_009A08; - this->actionFunc = ObjTokeidai_Walls_Idle; + this->opaDList = gClockTowerTerminaFieldWallsDL; + this->actionFunc = ObjTokeidai_TerminaFieldWalls_Idle; break; + case OBJ_TOKEIDAI_TYPE_TOWER_CLOCK_TERMINA_FIELD: Actor_SetScale(&this->actor, 0.15f); ObjTokeidai_TowerClock_Init(this, globalCtx); break; + case OBJ_TOKEIDAI_TYPE_TOWER_CLOCK_CLOCK_TOWN: ObjTokeidai_TowerClock_Init(this, globalCtx); break; + case OBJ_TOKEIDAI_TYPE_WALL_CLOCK: Actor_SetScale(&this->actor, 0.02f); this->actor.draw = ObjTokeidai_Clock_Draw; ObjTokeidai_Clock_Init(this); this->actionFunc = ObjTokeidai_WallClock_Idle; break; + case OBJ_TOKEIDAI_TYPE_SMALL_WALL_CLOCK: Actor_SetScale(&this->actor, 0.01f); this->actor.draw = ObjTokeidai_Clock_Draw; ObjTokeidai_Clock_Init(this); this->actionFunc = ObjTokeidai_WallClock_Idle; break; + case OBJ_TOKEIDAI_TYPE_COUNTERWEIGHT_TERMINA_FIELD: Actor_SetScale(&this->actor, 0.15f); ObjTokeidai_Counterweight_Init(this, globalCtx); break; + case OBJ_TOKEIDAI_TYPE_COUNTERWEIGHT_CLOCK_TOWN: ObjTokeidai_Counterweight_Init(this, globalCtx); break; - case OBJ_TOKEIDAI_TYPE_STAIRCASE_INTO_TOWER: - this->opaDList = object_obj_tokeidai_DL_00D8E8; - this->xluDList = object_obj_tokeidai_DL_00D8E0; - this->actionFunc = ObjTokeidai_StaircaseIntoTower_Idle; + + case OBJ_TOKEIDAI_TYPE_STAIRCASE_TO_ROOFTOP: + this->opaDList = gClockTowerStaircaseToRooftopDL; + this->xluDList = gClockTowerEmptyDL; + this->actionFunc = ObjTokeidai_StaircaseToRooftop_Idle; break; } } @@ -257,41 +288,43 @@ void ObjTokeidai_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void ObjTokeidai_RotateOnMinuteChange(ObjTokeidai* this, s32 playSfx) { - s32 currentMinute = GET_CURRENT_MINUTE(this); + s32 currentClockMinute = GET_CURRENT_CLOCK_MINUTE(this); - if (currentMinute != this->clockMinute) { - if (this->outerRingOrGearRotationTimer == 8 && playSfx) { + if (currentClockMinute != this->clockMinute) { + if (this->minuteRingOrExteriorGearRotationTimer == 8 && playSfx) { Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CLOCK_TOWER_SECOND_HAND); } - if (this->outerRingOrGearRotationTimer > 8) { + if (this->minuteRingOrExteriorGearRotationTimer > 8) { // This actually performs the rotation to the next minute - // for the outer ring or gear. - this->outerRingOrGearRotationalVelocity += 0x3C; - this->outerRingOrGearRotation += this->outerRingOrGearRotationalVelocity; + // for the minute ring or exterior gear. + this->minuteRingOrExteriorGearRotationalVelocity += 0x3C; + this->minuteRingOrExteriorGearRotation += this->minuteRingOrExteriorGearRotationalVelocity; } else { - // This makes the outer ring or gear wiggle in place for a bit + // This makes the minute ring or exterior gear wiggle in place for a bit // before rotating to the next position. - if ((this->outerRingOrGearRotationTimer & 3) == 0) { - this->outerRingOrGearRotation += 0x5A; + if ((this->minuteRingOrExteriorGearRotationTimer & 3) == 0) { + this->minuteRingOrExteriorGearRotation += 0x5A; } - if ((this->outerRingOrGearRotationTimer & 3) == 1) { - this->outerRingOrGearRotation -= 0x5A; + if ((this->minuteRingOrExteriorGearRotationTimer & 3) == 1) { + this->minuteRingOrExteriorGearRotation -= 0x5A; } } - this->outerRingOrGearRotationTimer++; - if ((currentMinute == 15 && this->outerRingOrGearRotation < 0) || - (currentMinute != 15 && this->outerRingOrGearRotation > GET_OUTER_RING_OR_GEAR_ROTATION(currentMinute))) { - this->outerRingOrGearRotation = GET_OUTER_RING_OR_GEAR_ROTATION(currentMinute); - this->clockMinute = currentMinute; - this->outerRingOrGearRotationalVelocity = 0x5A; - this->outerRingOrGearRotationTimer = 0; + this->minuteRingOrExteriorGearRotationTimer++; + + if ((currentClockMinute == 15 && this->minuteRingOrExteriorGearRotation < 0) || + (currentClockMinute != 15 && + this->minuteRingOrExteriorGearRotation > GET_MINUTE_RING_OR_EXTERIOR_GEAR_ROTATION(currentClockMinute))) { + this->minuteRingOrExteriorGearRotation = GET_MINUTE_RING_OR_EXTERIOR_GEAR_ROTATION(currentClockMinute); + this->clockMinute = currentClockMinute; + this->minuteRingOrExteriorGearRotationalVelocity = 0x5A; + this->minuteRingOrExteriorGearRotationTimer = 0; } } } -void ObjTokeidai_TowerGear_Collapse(ObjTokeidai* this, GlobalContext* globalCtx) { +void ObjTokeidai_ExteriorGear_Collapse(ObjTokeidai* this, GlobalContext* globalCtx) { if ((this->actor.bgCheckFlags & 1) || this->actor.world.pos.y < 0.0f) { this->actionFunc = ObjTokeidai_DoNothing; } else { @@ -302,9 +335,9 @@ void ObjTokeidai_TowerGear_Collapse(ObjTokeidai* this, GlobalContext* globalCtx) } } -void ObjTokeidai_TowerGear_OpenedIdle(ObjTokeidai* this, GlobalContext* globalCtx) { +void ObjTokeidai_ExteriorGear_OpenedIdle(ObjTokeidai* this, GlobalContext* globalCtx) { if (func_800EE29C(globalCtx, 0x84) && globalCtx->csCtx.npcActions[func_800EE200(globalCtx, 0x84)]->unk0 == 2) { - this->actionFunc = ObjTokeidai_TowerGear_Collapse; + this->actionFunc = ObjTokeidai_ExteriorGear_Collapse; this->actor.speedXZ = this->actor.scale.y * 5.0f; this->actor.velocity.y = 0.0f; this->actor.terminalVelocity = this->actor.scale.y * -50.0f; @@ -313,15 +346,15 @@ void ObjTokeidai_TowerGear_OpenedIdle(ObjTokeidai* this, GlobalContext* globalCt } /** - * This is hard to see in the final game. This, used in conjunction - * with the following function, makes the tower's clock slide off the - * tower and spin through the air when the moon crashes. + * This, used in conjunction with the following function, makes the + * tower's clock slide off the tower and spin through the air when the moon crashes. */ void ObjTokeidai_TowerClock_Fall(ObjTokeidai* this, GlobalContext* globalCtx) { this->actor.shape.rot.x += this->fallingClockFaceRotationalVelocity; if (this->fallingClockFaceRotationalVelocity > 0xA0) { this->fallingClockFaceRotationalVelocity -= 5; } + this->actor.world.pos.z += 4.0f; Actor_MoveWithGravity(&this->actor); if (this->actor.world.pos.y < 0.0f) { @@ -330,8 +363,8 @@ void ObjTokeidai_TowerClock_Fall(ObjTokeidai* this, GlobalContext* globalCtx) { } /** - * This is hard to see in the final game. This makes the - * tower's clock slide off as the moon crashes into it. + * This makes the tower's clock slide off as the moon crashes into it. It's + * the tower clock's equivalent to other components' Collapse functions. */ void ObjTokeidai_TowerClock_SlideOff(ObjTokeidai* this, GlobalContext* globalCtx) { f32 cos; @@ -396,20 +429,15 @@ void ObjTokeidai_Counterweight_OpenedIdle(ObjTokeidai* this, GlobalContext* glob } } -/** - * This is hard to see in the final game. It makes the walls of - * the clock tower tip over as the moon crashes into it, but the - * giant moon mostly obscures it. - */ -void ObjTokeidai_Walls_Collapse(ObjTokeidai* this, GlobalContext* globalCtx) { +void ObjTokeidai_TerminaFieldWalls_Collapse(ObjTokeidai* this, GlobalContext* globalCtx) { if (this->actor.shape.rot.x < 0x4000) { this->actor.shape.rot.x += 0x28; } } -void ObjTokeidai_Walls_Idle(ObjTokeidai* this, GlobalContext* globalCtx) { +void ObjTokeidai_TerminaFieldWalls_Idle(ObjTokeidai* this, GlobalContext* globalCtx) { if (func_800EE29C(globalCtx, 0x84) != 0 && globalCtx->csCtx.npcActions[func_800EE200(globalCtx, 0x84)]->unk0 == 1) { - this->actionFunc = ObjTokeidai_Walls_Collapse; + this->actionFunc = ObjTokeidai_TerminaFieldWalls_Collapse; } } @@ -480,9 +508,11 @@ void ObjTokeidai_TowerOpening_DropCounterweight(ObjTokeidai* this, GlobalContext case 0: Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CLOCK_TOWER_BOUND_0); break; + case 1: Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CLOCK_TOWER_BOUND_1); break; + case 2: Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CLOCK_TOWER_BOUND_2); break; @@ -565,7 +595,7 @@ void ObjTokeidai_TowerOpening_Start(ObjTokeidai* this, GlobalContext* globalCtx) } /** - * Sets up the sequence where the Clock Tower "transforms" and opens up + * Sets up the sequence where the Clock Tower opens up * on the midnight of the Final Day. */ void ObjTokeidai_SetupTowerOpening(ObjTokeidai* this) { @@ -580,7 +610,7 @@ void ObjTokeidai_SetupTowerOpening(ObjTokeidai* this) { void ObjTokeidai_DoNothing(ObjTokeidai* this, GlobalContext* globalCtx) { } -void ObjTokeidai_StaircaseIntoTower_Idle(ObjTokeidai* this, GlobalContext* globalCtx) { +void ObjTokeidai_StaircaseToRooftop_Idle(ObjTokeidai* this, GlobalContext* globalCtx) { if (((CURRENT_DAY == 3 && gSaveContext.save.time < CLOCK_TIME(6, 0)) || CURRENT_DAY >= 4) || (gSaveContext.save.weekEventReg[8] & 0x40)) { this->actor.draw = ObjTokeidai_Draw; @@ -601,9 +631,9 @@ s32 ObjTokeidai_IsPostFirstCycleFinalHours(ObjTokeidai* this, GlobalContext* glo } void ObjTokeidai_RotateOnHourChange(ObjTokeidai* this, GlobalContext* globalCtx) { - s32 currentHour = GET_CURRENT_HOUR(this); + s32 currentClockHour = GET_CURRENT_CLOCK_HOUR(this); - if (currentHour != this->clockHour) { + if (currentClockHour != this->clockHour) { if (this->clockFaceRotationTimer > 12) { // This actually performs the rotation to the next hour // for the clock face. @@ -621,32 +651,33 @@ void ObjTokeidai_RotateOnHourChange(ObjTokeidai* this, GlobalContext* globalCtx) } this->clockFaceRotationTimer++; - if ((currentHour == 12 && this->clockFaceRotation < 0) || - (currentHour != 12 && this->clockFaceRotation > GET_CLOCK_FACE_ROTATION(currentHour))) { - this->clockFaceRotation = GET_CLOCK_FACE_ROTATION(currentHour); - this->clockHour = currentHour; + + if ((currentClockHour == 12 && this->clockFaceRotation < 0) || + (currentClockHour != 12 && this->clockFaceRotation > GET_CLOCK_FACE_ROTATION(currentClockHour))) { + this->clockFaceRotation = GET_CLOCK_FACE_ROTATION(currentClockHour); + this->clockHour = currentClockHour; this->clockFaceRotationalVelocity = 0; this->clockFaceRotationTimer = 0; } } - // If the sun and moon disk doesn't have the target rotation (e.g., the time of day + // If the sun and moon panel doesn't have the target rotation (e.g., the time of day // just changed), rotate it until it matches the target. - if (this->sunMoonDiskRotation != ObjTokeidai_GetTargetSunMoonDiskRotation()) { + if (this->sunMoonPanelRotation != ObjTokeidai_GetTargetSunMoonPanelRotation()) { if (this->clockHour == 6) { - this->sunMoonDiskRotationalVelocity += 0x222; - this->sunMoonDiskRotation += this->sunMoonDiskRotationalVelocity; - if (this->sunMoonDiskRotation > 0x10000) { - this->sunMoonDiskRotation = ObjTokeidai_GetTargetSunMoonDiskRotation(); - this->sunMoonDiskRotationalVelocity = 0; + this->sunMoonPanelRotationalVelocity += 0x222; + this->sunMoonPanelRotation += this->sunMoonPanelRotationalVelocity; + if (this->sunMoonPanelRotation > 0x10000) { + this->sunMoonPanelRotation = ObjTokeidai_GetTargetSunMoonPanelRotation(); + this->sunMoonPanelRotationalVelocity = 0; } } if (this->clockHour == 18) { - this->sunMoonDiskRotationalVelocity += 0x222; - this->sunMoonDiskRotation += this->sunMoonDiskRotationalVelocity; - if (this->sunMoonDiskRotation > 0x8000) { - this->sunMoonDiskRotation = ObjTokeidai_GetTargetSunMoonDiskRotation(); - this->sunMoonDiskRotationalVelocity = 0; + this->sunMoonPanelRotationalVelocity += 0x222; + this->sunMoonPanelRotation += this->sunMoonPanelRotationalVelocity; + if (this->sunMoonPanelRotation > 0x8000) { + this->sunMoonPanelRotation = ObjTokeidai_GetTargetSunMoonPanelRotation(); + this->sunMoonPanelRotationalVelocity = 0; } } } @@ -662,7 +693,7 @@ void ObjTokeidai_TowerClock_Idle(ObjTokeidai* this, GlobalContext* globalCtx) { if (globalCtx->csCtx.state != 0) { this->actor.home.rot.x = 1; - this->currentTime += 3; + this->clockTime += 3; this->actor.draw = ObjTokeidai_Clock_Draw; } else { if (!(globalCtx->actorCtx.unk5 & 2) && @@ -670,7 +701,7 @@ void ObjTokeidai_TowerClock_Idle(ObjTokeidai* this, GlobalContext* globalCtx) { ActorCutscene_GetCurrentIndex() == -1) { this->actor.draw = NULL; } - this->currentTime = gSaveContext.save.time; + this->clockTime = gSaveContext.save.time; if (this->actor.home.rot.x != 0) { ObjTokeidai_Clock_Init(this); this->actor.home.rot.x = 0; @@ -684,28 +715,28 @@ void ObjTokeidai_TowerClock_Idle(ObjTokeidai* this, GlobalContext* globalCtx) { } void ObjTokeidai_WallClock_Idle(ObjTokeidai* this, GlobalContext* globalCtx) { - this->currentTime = gSaveContext.save.time; + this->clockTime = gSaveContext.save.time; ObjTokeidai_RotateOnMinuteChange(this, true); ObjTokeidai_RotateOnHourChange(this, globalCtx); } -void ObjTokeidai_TowerGear_Idle(ObjTokeidai* this, GlobalContext* globalCtx) { +void ObjTokeidai_ExteriorGear_Idle(ObjTokeidai* this, GlobalContext* globalCtx) { if (ObjTokeidai_IsPostFirstCycleFinalHours(this, globalCtx)) { - this->actor.draw = ObjTokeidai_TowerGear_Draw; + this->actor.draw = ObjTokeidai_ExteriorGear_Draw; } else { if (globalCtx->csCtx.state != 0) { this->actor.home.rot.x = 1; - this->currentTime += 3; - this->actor.draw = ObjTokeidai_TowerGear_Draw; + this->clockTime += 3; + this->actor.draw = ObjTokeidai_ExteriorGear_Draw; } else { if ((globalCtx->actorCtx.unk5 & 2) == 0 && - OBJ_TOKEIDAI_TYPE(&this->actor) == OBJ_TOKEIDAI_TYPE_TOWER_GEAR_TERMINA_FIELD && + OBJ_TOKEIDAI_TYPE(&this->actor) == OBJ_TOKEIDAI_TYPE_EXTERIOR_GEAR_TERMINA_FIELD && ActorCutscene_GetCurrentIndex() == -1) { this->actor.draw = NULL; } - this->currentTime = gSaveContext.save.time; + this->clockTime = gSaveContext.save.time; if (this->actor.home.rot.x != 0) { - ObjTokeidai_SetupClockOrGear(this); + ObjTokeidai_SetupClockOrExteriorGear(this); this->actor.home.rot.x = 0; } } @@ -718,6 +749,7 @@ void ObjTokeidai_Counterweight_Idle(ObjTokeidai* this, GlobalContext* globalCtx) if (ObjTokeidai_IsPostFirstCycleFinalHours(this, globalCtx)) { this->spotlightIntensity = 0; + if (this->actor.child == NULL) { type = OBJ_TOKEIDAI_TYPE(&this->actor); if (type == OBJ_TOKEIDAI_TYPE_COUNTERWEIGHT_CLOCK_TOWN || @@ -727,6 +759,7 @@ void ObjTokeidai_Counterweight_Idle(ObjTokeidai* this, GlobalContext* globalCtx) this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0); } } + if (this->actor.child != NULL) { if (OBJ_TOKEIDAI_TYPE(&this->actor) == OBJ_TOKEIDAI_TYPE_COUNTERWEIGHT_TERMINA_FIELD) { this->actor.child->home.rot.x = 0x384; @@ -751,6 +784,9 @@ void ObjTokeidai_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); } +/** + * Used for TerminaFieldWalls StaircaseToRooftop, and UnusedWall + */ void ObjTokeidai_Draw(Actor* thisx, GlobalContext* globalCtx) { ObjTokeidai* this = THIS; @@ -761,6 +797,7 @@ void ObjTokeidai_Draw(Actor* thisx, GlobalContext* globalCtx) { func_8012C28C(globalCtx->state.gfxCtx); gSPDisplayList(POLY_OPA_DISP++, this->opaDList); } + if (this->xluDList != NULL) { gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); func_8012C2DC(globalCtx->state.gfxCtx); @@ -780,26 +817,30 @@ void ObjTokeidai_Clock_Draw(Actor* thisx, GlobalContext* globalCtx) { Matrix_InsertTranslation(0.0f, 0.0f, -1791.0f, MTXMODE_APPLY); Matrix_InsertXRotation_s(-this->xRotation, MTXMODE_APPLY); Matrix_InsertTranslation(0.0f, 0.0f, 1791.0f, MTXMODE_APPLY); + Matrix_StatePush(); - Matrix_InsertZRotation_s(-this->outerRingOrGearRotation, MTXMODE_APPLY); + Matrix_InsertZRotation_s(-this->minuteRingOrExteriorGearRotation, MTXMODE_APPLY); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, object_obj_tokeidai_DL_00CF28); + gSPDisplayList(POLY_OPA_DISP++, gClockTowerMinuteRingDL); Matrix_StatePop(); + Matrix_InsertTranslation(0.0f, 0.0f, this->clockFaceZTranslation, MTXMODE_APPLY); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, object_obj_tokeidai_DL_00BEE8); + gSPDisplayList(POLY_OPA_DISP++, gClockTowerClockCenterAndHandDL); + Matrix_InsertZRotation_s(-this->clockFaceRotation * 2, MTXMODE_APPLY); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); if (OBJ_TOKEIDAI_TYPE(&this->actor) == OBJ_TOKEIDAI_TYPE_WALL_CLOCK || OBJ_TOKEIDAI_TYPE(&this->actor) == OBJ_TOKEIDAI_TYPE_SMALL_WALL_CLOCK) { - gSPDisplayList(POLY_OPA_DISP++, object_obj_tokeidai_DL_00F518); + gSPDisplayList(POLY_OPA_DISP++, gWallClockClockFace); } else { - gSPDisplayList(POLY_OPA_DISP++, object_obj_tokeidai_DL_00E818); + gSPDisplayList(POLY_OPA_DISP++, gClockTowerClockFace); } + Matrix_InsertTranslation(0.0f, -1112.0f, -19.6f, MTXMODE_APPLY); - Matrix_RotateY((s16)this->sunMoonDiskRotation, MTXMODE_APPLY); + Matrix_RotateY((s16)this->sunMoonPanelRotation, MTXMODE_APPLY); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, object_obj_tokeidai_DL_00C368); + gSPDisplayList(POLY_OPA_DISP++, gClockTowerSunAndMoonPanelDL); CLOSE_DISPS(globalCtx->state.gfxCtx); } @@ -818,11 +859,16 @@ void ObjTokeidai_Counterweight_Draw(Actor* thisx, GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx); + // For scrolling the spotlight's mask texture down the length of the light beam. gSPSegment(POLY_XLU_DISP++, 0x08, Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, 0, 0x20, 0x40, 1, -gameplayFrames, 0, 0x20, 0x20)); + + // Draws the counterweight gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); func_8012C28C(globalCtx->state.gfxCtx); gSPDisplayList(POLY_OPA_DISP++, this->opaDList); + + // Draws the spotlight gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); func_8012C2DC(globalCtx->state.gfxCtx); gDPSetPrimColor(POLY_XLU_DISP++, 0, 255, 255, 235, 180, (s32)(this->spotlightIntensity * 2.55f)); @@ -831,7 +877,7 @@ void ObjTokeidai_Counterweight_Draw(Actor* thisx, GlobalContext* globalCtx) { CLOSE_DISPS(globalCtx->state.gfxCtx); } -void ObjTokeidai_TowerGear_Draw(Actor* thisx, GlobalContext* globalCtx) { +void ObjTokeidai_ExteriorGear_Draw(Actor* thisx, GlobalContext* globalCtx) { ObjTokeidai* this = THIS; OPEN_DISPS(globalCtx->state.gfxCtx); @@ -842,10 +888,10 @@ void ObjTokeidai_TowerGear_Draw(Actor* thisx, GlobalContext* globalCtx) { Matrix_InsertXRotation_s(-this->xRotation, MTXMODE_APPLY); Matrix_RotateY(thisx->shape.rot.y, MTXMODE_APPLY); Matrix_InsertTranslation(0.0f, 0.0f, 1791.0f, MTXMODE_APPLY); - Matrix_InsertZRotation_s(this->outerRingOrGearRotation, MTXMODE_APPLY); + Matrix_InsertZRotation_s(this->minuteRingOrExteriorGearRotation, MTXMODE_APPLY); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); func_8012C28C(globalCtx->state.gfxCtx); - gSPDisplayList(POLY_OPA_DISP++, object_obj_tokeidai_DL_00BA78); + gSPDisplayList(POLY_OPA_DISP++, gClockTowerExteriorGearDL); CLOSE_DISPS(globalCtx->state.gfxCtx); } diff --git a/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.h b/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.h index c5cf8d70c..48e44614d 100644 --- a/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.h +++ b/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.h @@ -6,17 +6,17 @@ #define OBJ_TOKEIDAI_TYPE(thisx) (((thisx)->params & 0xF000) >> 12) typedef enum { - /* 0 */ OBJ_TOKEIDAI_TYPE_TOWER_GEAR_CLOCK_TOWN, + /* 0 */ OBJ_TOKEIDAI_TYPE_EXTERIOR_GEAR_CLOCK_TOWN, /* 1 */ OBJ_TOKEIDAI_TYPE_UNUSED_WALL, /* 2 */ OBJ_TOKEIDAI_TYPE_TOWER_CLOCK_CLOCK_TOWN, /* 3 */ OBJ_TOKEIDAI_TYPE_COUNTERWEIGHT_CLOCK_TOWN, - /* 4 */ OBJ_TOKEIDAI_TYPE_TOWER_GEAR_TERMINA_FIELD, + /* 4 */ OBJ_TOKEIDAI_TYPE_EXTERIOR_GEAR_TERMINA_FIELD, /* 5 */ OBJ_TOKEIDAI_TYPE_TOWER_CLOCK_TERMINA_FIELD, /* 6 */ OBJ_TOKEIDAI_TYPE_COUNTERWEIGHT_TERMINA_FIELD, /* 8 */ OBJ_TOKEIDAI_TYPE_TOWER_WALLS_TERMINA_FIELD = 8, /* 9 */ OBJ_TOKEIDAI_TYPE_WALL_CLOCK, /* 10 */ OBJ_TOKEIDAI_TYPE_SMALL_WALL_CLOCK, - /* 11 */ OBJ_TOKEIDAI_TYPE_STAIRCASE_INTO_TOWER, + /* 11 */ OBJ_TOKEIDAI_TYPE_STAIRCASE_TO_ROOFTOP, } ObjTokeidaiType; struct ObjTokeidai; @@ -27,9 +27,9 @@ typedef struct ObjTokeidai { /* 0x000 */ Actor actor; /* 0x144 */ Gfx* opaDList; /* 0x148 */ Gfx* xluDList; - /* 0x14C */ s16 outerRingOrGearRotation; - /* 0x14E */ s16 outerRingOrGearRotationalVelocity; - /* 0x150 */ s16 outerRingOrGearRotationTimer; + /* 0x14C */ s16 minuteRingOrExteriorGearRotation; + /* 0x14E */ s16 minuteRingOrExteriorGearRotationalVelocity; + /* 0x150 */ s16 minuteRingOrExteriorGearRotationTimer; /* 0x152 */ s16 clockFaceRotation; /* 0x154 */ union { s16 clockFaceRotationalVelocity; @@ -44,9 +44,9 @@ typedef struct ObjTokeidai { s16 counterweightRotationalAcceleration; s16 aerialClockFaceSpeed; }; - /* 0x158 */ s32 sunMoonDiskRotation; + /* 0x158 */ s32 sunMoonPanelRotation; /* 0x15C */ union { - s16 sunMoonDiskRotationalVelocity; + s16 sunMoonPanelRotationalVelocity; s16 fallingClockFaceRotationalVelocity; }; /* 0x15E */ s16 yTranslation; @@ -58,7 +58,7 @@ typedef struct ObjTokeidai { s32 clockHour; s32 spotlightIntensity; }; - /* 0x170 */ u16 currentTime; + /* 0x170 */ u16 clockTime; // can differ from the actual time, e.g., in cutscenes /* 0x174 */ ObjTokeidaiActionFunc actionFunc; } ObjTokeidai; // size = 0x178 diff --git a/src/overlays/actors/ovl_Obj_Tree/z_obj_tree.c b/src/overlays/actors/ovl_Obj_Tree/z_obj_tree.c index 7b756a10f..d767e8b3b 100644 --- a/src/overlays/actors/ovl_Obj_Tree/z_obj_tree.c +++ b/src/overlays/actors/ovl_Obj_Tree/z_obj_tree.c @@ -5,6 +5,7 @@ */ #include "z_obj_tree.h" +#include "objects/object_tree/object_tree.h" #define FLAGS 0x02000000 @@ -88,10 +89,6 @@ static DamageTable sDamageTable = { static CollisionCheckInfoInit2 sColchkInfoInit = { 8, 0, 0, 0, MASS_HEAVY }; -extern Gfx D_06000680[]; -extern Gfx D_060007C8[]; -extern CollisionHeader D_06001B2C; - void ObjTree_Init(Actor* thisx, GlobalContext* globalCtx) { s32 pad; ObjTree* this = THIS; @@ -103,7 +100,7 @@ void ObjTree_Init(Actor* thisx, GlobalContext* globalCtx) { } else { Actor_SetScale(&this->dyna.actor, 0.1f); DynaPolyActor_Init(&this->dyna, 1); - CollisionHeader_GetVirtual(&D_06001B2C, &colHeader); + CollisionHeader_GetVirtual(&object_tree_Colheader_001B2C, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader); } @@ -190,11 +187,11 @@ void ObjTree_Draw(Actor* thisx, GlobalContext* globalCtx) { func_8012C28C(globalCtx->state.gfxCtx); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, D_06000680); + gSPDisplayList(POLY_OPA_DISP++, object_tree_DL_000680); Matrix_InsertRotation(xRot, 0, zRot, MTXMODE_APPLY); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, D_060007C8); + gSPDisplayList(POLY_OPA_DISP++, object_tree_DL_0007C8); CLOSE_DISPS(globalCtx->state.gfxCtx); } diff --git a/src/overlays/actors/ovl_Obj_Usiyane/z_obj_usiyane.c b/src/overlays/actors/ovl_Obj_Usiyane/z_obj_usiyane.c index 2a1f4bf30..8ed03a8ef 100644 --- a/src/overlays/actors/ovl_Obj_Usiyane/z_obj_usiyane.c +++ b/src/overlays/actors/ovl_Obj_Usiyane/z_obj_usiyane.c @@ -20,7 +20,7 @@ const ActorInit Obj_Usiyane_InitVars = { ACTOR_OBJ_USIYANE, ACTORCAT_PROP, FLAGS, - OBJECT_OBJECT_UNSET_USIYANE, + OBJECT_OBJ_USIYANE, sizeof(ObjUsiyane), (ActorFunc)ObjUsiyane_Init, (ActorFunc)ObjUsiyane_Destroy, diff --git a/src/overlays/actors/ovl_Obj_Visiblock/z_obj_visiblock.c b/src/overlays/actors/ovl_Obj_Visiblock/z_obj_visiblock.c index ea27c1ad9..4fc6200c5 100644 --- a/src/overlays/actors/ovl_Obj_Visiblock/z_obj_visiblock.c +++ b/src/overlays/actors/ovl_Obj_Visiblock/z_obj_visiblock.c @@ -5,6 +5,7 @@ */ #include "z_obj_visiblock.h" +#include "objects/object_visiblock/object_visiblock.h" #define FLAGS 0x00000080 @@ -33,15 +34,12 @@ static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), }; -extern CollisionHeader D_06000AD0; -extern Gfx D_06000140[]; - void ObjVisiblock_Init(Actor* thisx, GlobalContext* globalCtx) { ObjVisiblock* this = THIS; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyActor_Init(&this->dyna, 0); - DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06000AD0); + DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_visiblock_Colheader_000AD0); } void ObjVisiblock_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -51,5 +49,5 @@ void ObjVisiblock_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void ObjVisiblock_Draw(Actor* thisx, GlobalContext* globalCtx) { - Gfx_DrawDListXlu(globalCtx, D_06000140); + Gfx_DrawDListXlu(globalCtx, object_visiblock_DL_000140); } diff --git a/src/overlays/actors/ovl_Obj_Warpstone/z_obj_warpstone.c b/src/overlays/actors/ovl_Obj_Warpstone/z_obj_warpstone.c index df7c9d605..e8ec61d28 100644 --- a/src/overlays/actors/ovl_Obj_Warpstone/z_obj_warpstone.c +++ b/src/overlays/actors/ovl_Obj_Warpstone/z_obj_warpstone.c @@ -5,6 +5,8 @@ */ #include "z_obj_warpstone.h" +#include "objects/object_sek/object_sek.h" +#include "objects/gameplay_keep/gameplay_keep.h" #define FLAGS 0x00000009 @@ -20,10 +22,6 @@ s32 ObjWarpstone_BeginOpeningCutscene(ObjWarpstone* this, GlobalContext* globalC s32 ObjWarpstone_PlayOpeningCutscene(ObjWarpstone* this, GlobalContext* globalCtx); s32 ObjWarpstone_OpenedIdle(ObjWarpstone* this, GlobalContext* globalCtx); -extern Gfx D_04023210[]; // gOwlStatueWhiteFlashDL -extern Gfx D_060001D0[]; // gOwlStatueClosedDL -extern Gfx D_06003770[]; // gOwlStatueOpenedDL - const ActorInit Obj_Warpstone_InitVars = { ACTOR_OBJ_WARPSTONE, ACTORCAT_ITEMACTION, @@ -60,7 +58,7 @@ static InitChainEntry sInitChain[] = { ICHAIN_U8(targetMode, 1, ICHAIN_STOP), }; -static Gfx* sOwlStatueDLs[] = { D_060001D0, D_06003770 }; +static Gfx* sOwlStatueDLs[] = { gOwlStatueClosedDL, gOwlStatueOpenedDL }; void ObjWarpstone_SetupAction(ObjWarpstone* this, ObjWarpstoneActionFunc actionFunc) { this->actionFunc = actionFunc; @@ -164,8 +162,8 @@ void ObjWarpstone_Update(Actor* thisx, GlobalContext* globalCtx) { } void ObjWarpstone_Draw(Actor* thisx, GlobalContext* globalCtx2) { - ObjWarpstone* this = THIS; GlobalContext* globalCtx = globalCtx2; + ObjWarpstone* this = THIS; Gfx_DrawDListOpa(globalCtx, sOwlStatueDLs[this->modelIndex]); if (this->dyna.actor.home.rot.x != 0) { @@ -183,11 +181,11 @@ void ObjWarpstone_Draw(Actor* thisx, GlobalContext* globalCtx2) { gDPSetEnvColor(POLY_XLU_DISP++, 100, 200, 0, 255); Matrix_InsertZRotation_f((((globalCtx->gameplayFrames * 1500) & 0xFFFF) * M_PI) / 0x8000, MTXMODE_APPLY); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_XLU_DISP++, D_04023210); + gSPDisplayList(POLY_XLU_DISP++, gOwlStatueWhiteFlashDL); Matrix_StatePop(); Matrix_InsertZRotation_f((~((globalCtx->gameplayFrames * 1200) & 0xFFFF) * M_PI) / 0x8000, MTXMODE_APPLY); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_XLU_DISP++, D_04023210); + gSPDisplayList(POLY_XLU_DISP++, gOwlStatueWhiteFlashDL); CLOSE_DISPS(globalCtx->state.gfxCtx); } } diff --git a/src/overlays/actors/ovl_Obj_Yado/z_obj_yado.c b/src/overlays/actors/ovl_Obj_Yado/z_obj_yado.c index 27e2f94b4..ebce0d712 100644 --- a/src/overlays/actors/ovl_Obj_Yado/z_obj_yado.c +++ b/src/overlays/actors/ovl_Obj_Yado/z_obj_yado.c @@ -5,6 +5,7 @@ */ #include "z_obj_yado.h" +#include "objects/object_yado_obj/object_yado_obj.h" #define FLAGS 0x00000030 @@ -33,15 +34,11 @@ static InitChainEntry sInitChain[] = { AnimatedMaterial* D_80C16470; -extern Gfx D_06000320[]; -extern Gfx D_06000430[]; -extern AnimatedMaterial D_060012E8; - void ObjYado_Init(Actor* thisx, GlobalContext* globalCtx) { ObjYado* this = THIS; Actor_ProcessInitChain(&this->actor, sInitChain); - D_80C16470 = (AnimatedMaterial*)Lib_SegmentedToVirtual(&D_060012E8); + D_80C16470 = (AnimatedMaterial*)Lib_SegmentedToVirtual(object_yado_obj_Matanimheader_0012E8); this->isNight = gSaveContext.save.isNight; } @@ -69,8 +66,8 @@ void ObjYado_Draw(Actor* thisx, GlobalContext* globalCtx) { } AnimatedMat_Draw(globalCtx, D_80C16470); - Gfx_DrawDListOpa(globalCtx, D_06000430); - Gfx_DrawDListXlu(globalCtx, D_06000320); + Gfx_DrawDListOpa(globalCtx, object_yado_obj_DL_000430); + Gfx_DrawDListXlu(globalCtx, object_yado_obj_DL_000320); CLOSE_DISPS(globalCtx->state.gfxCtx); } diff --git a/src/overlays/actors/ovl_Obj_Yasi/z_obj_yasi.c b/src/overlays/actors/ovl_Obj_Yasi/z_obj_yasi.c index e79af5a3c..5668371fb 100644 --- a/src/overlays/actors/ovl_Obj_Yasi/z_obj_yasi.c +++ b/src/overlays/actors/ovl_Obj_Yasi/z_obj_yasi.c @@ -20,7 +20,7 @@ const ActorInit Obj_Yasi_InitVars = { ACTOR_OBJ_YASI, ACTORCAT_PROP, FLAGS, - OBJECT_OBJECT_UNSET_YASI, + OBJECT_OBJ_YASI, sizeof(ObjYasi), (ActorFunc)ObjYasi_Init, (ActorFunc)ObjYasi_Destroy, diff --git a/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c b/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c index 0c0a72279..3195c7877 100644 --- a/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c +++ b/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c @@ -554,7 +554,7 @@ void func_808DD3C8(Actor* thisx, GlobalContext* globalCtx2) { gDPSetRenderMode(POLY_XLU_DISP++, G_RM_FOG_SHADE_A, G_RM_ZB_CLD_SURF2); gSPSetGeometryMode(POLY_XLU_DISP++, G_FOG); - gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(gameplay_keep_Tex_08EBE0)); + gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(gDust5Tex)); } Matrix_InsertTranslation(spC4.x, spC4.y, spC4.z, MTXMODE_NEW); @@ -629,7 +629,7 @@ void func_808DD970(Actor* thisx, GlobalContext* globalCtx2) { gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(gameplay_keep_Tex_08EBE0)); + gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(gDust5Tex)); gSPClearGeometryMode(POLY_XLU_DISP++, G_LIGHTING); POLY_XLU_DISP = Gfx_CallSetupDL(POLY_XLU_DISP, 0); diff --git a/tools/ZAPD/.gitrepo b/tools/ZAPD/.gitrepo index a57e9e52c..475415d99 100644 --- a/tools/ZAPD/.gitrepo +++ b/tools/ZAPD/.gitrepo @@ -6,7 +6,7 @@ [subrepo] remote = https://github.com/zeldaret/ZAPD.git branch = master - commit = 0ba78130478ee1272bc0e2f2fec2d162e7f7f995 - parent = aa90d1ee2be577fb8a18c1c3c6dcafda2e732190 + commit = 119a6883e6f795815744b9afd6a79084c619ddb6 + parent = 66a66f61b6368af0ed711803c54a963494329217 method = merge cmdver = 0.4.3 diff --git a/tools/ZAPD/ZAPD/WarningHandler.cpp b/tools/ZAPD/ZAPD/WarningHandler.cpp index 29f8352a7..163b028b5 100644 --- a/tools/ZAPD/ZAPD/WarningHandler.cpp +++ b/tools/ZAPD/ZAPD/WarningHandler.cpp @@ -199,8 +199,16 @@ bool WarningHandler::WasElevatedToError(WarningType warnType) { * Print file/line/function info for debugging */ void WarningHandler::FunctionPreamble(const char* filename, int32_t line, const char* function) { - if (Globals::Instance->verbosity >= VerbosityLevel::VERBOSITY_DEBUG) { - fprintf(stderr, "%s:%i: in function %s:\n", filename, line, function); + bool forcePrint = false; + +#ifdef DEVELOPMENT + forcePrint = true; +#endif + + fprintf(stderr, "\n"); + + if (forcePrint || Globals::Instance->verbosity >= VerbosityLevel::VERBOSITY_DEBUG) { + fprintf(stderr, "%s:%i: in function <%s>:\n", filename, line, function); } } diff --git a/tools/ZAPD/ZAPD/ZAnimation.cpp b/tools/ZAPD/ZAPD/ZAnimation.cpp index 4d9266b09..74b520b50 100644 --- a/tools/ZAPD/ZAPD/ZAnimation.cpp +++ b/tools/ZAPD/ZAPD/ZAnimation.cpp @@ -51,7 +51,7 @@ void ZNormalAnimation::ParseRawData() { ZAnimation::ParseRawData(); - const uint8_t* data = parent->GetRawData().data(); + auto& data = parent->GetRawData(); rotationValuesSeg = BitConverter::ToInt32BE(data, rawDataIndex + 4); rotationIndicesSeg = BitConverter::ToInt32BE(data, rawDataIndex + 8); diff --git a/tools/ZAPD/ZAPD/ZCollision.cpp b/tools/ZAPD/ZAPD/ZCollision.cpp index 6554005ec..0b04ca5c1 100644 --- a/tools/ZAPD/ZAPD/ZCollision.cpp +++ b/tools/ZAPD/ZAPD/ZCollision.cpp @@ -256,32 +256,28 @@ size_t ZCollisionHeader::GetRawDataSize() const PolygonEntry::PolygonEntry(const std::vector& rawData, uint32_t rawDataIndex) { - const uint8_t* data = rawData.data(); - - type = BitConverter::ToUInt16BE(data, rawDataIndex + 0); - vtxA = BitConverter::ToUInt16BE(data, rawDataIndex + 2); - vtxB = BitConverter::ToUInt16BE(data, rawDataIndex + 4); - vtxC = BitConverter::ToUInt16BE(data, rawDataIndex + 6); - a = BitConverter::ToUInt16BE(data, rawDataIndex + 8); - b = BitConverter::ToUInt16BE(data, rawDataIndex + 10); - c = BitConverter::ToUInt16BE(data, rawDataIndex + 12); - d = BitConverter::ToUInt16BE(data, rawDataIndex + 14); + type = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0); + vtxA = BitConverter::ToUInt16BE(rawData, rawDataIndex + 2); + vtxB = BitConverter::ToUInt16BE(rawData, rawDataIndex + 4); + vtxC = BitConverter::ToUInt16BE(rawData, rawDataIndex + 6); + a = BitConverter::ToUInt16BE(rawData, rawDataIndex + 8); + b = BitConverter::ToUInt16BE(rawData, rawDataIndex + 10); + c = BitConverter::ToUInt16BE(rawData, rawDataIndex + 12); + d = BitConverter::ToUInt16BE(rawData, rawDataIndex + 14); } WaterBoxHeader::WaterBoxHeader(const std::vector& rawData, uint32_t rawDataIndex) { - const uint8_t* data = rawData.data(); - - xMin = BitConverter::ToInt16BE(data, rawDataIndex + 0); - ySurface = BitConverter::ToInt16BE(data, rawDataIndex + 2); - zMin = BitConverter::ToInt16BE(data, rawDataIndex + 4); - xLength = BitConverter::ToInt16BE(data, rawDataIndex + 6); - zLength = BitConverter::ToInt16BE(data, rawDataIndex + 8); + xMin = BitConverter::ToInt16BE(rawData, rawDataIndex + 0); + ySurface = BitConverter::ToInt16BE(rawData, rawDataIndex + 2); + zMin = BitConverter::ToInt16BE(rawData, rawDataIndex + 4); + xLength = BitConverter::ToInt16BE(rawData, rawDataIndex + 6); + zLength = BitConverter::ToInt16BE(rawData, rawDataIndex + 8); if (Globals::Instance->game == ZGame::OOT_SW97) - properties = BitConverter::ToInt16BE(data, rawDataIndex + 10); + properties = BitConverter::ToInt16BE(rawData, rawDataIndex + 10); else - properties = BitConverter::ToInt32BE(data, rawDataIndex + 12); + properties = BitConverter::ToInt32BE(rawData, rawDataIndex + 12); } std::string WaterBoxHeader::GetBodySourceCode() const diff --git a/tools/ZAPD/ZAPD/ZCutscene.cpp b/tools/ZAPD/ZAPD/ZCutscene.cpp index ba8fe8963..71bb690c7 100644 --- a/tools/ZAPD/ZAPD/ZCutscene.cpp +++ b/tools/ZAPD/ZAPD/ZCutscene.cpp @@ -445,30 +445,26 @@ size_t CutsceneCommand::GetCommandSize() CutsceneCameraPoint::CutsceneCameraPoint(const std::vector& rawData, uint32_t rawDataIndex) { - const uint8_t* data = rawData.data(); + continueFlag = rawData.at(rawDataIndex + 0); + cameraRoll = rawData.at(rawDataIndex + 1); + nextPointFrame = BitConverter::ToInt16BE(rawData, rawDataIndex + 2); + viewAngle = BitConverter::ToFloatBE(rawData, rawDataIndex + 4); - continueFlag = data[rawDataIndex + 0]; - cameraRoll = data[rawDataIndex + 1]; - nextPointFrame = BitConverter::ToInt16BE(data, rawDataIndex + 2); - viewAngle = BitConverter::ToFloatBE(data, rawDataIndex + 4); + posX = BitConverter::ToInt16BE(rawData, rawDataIndex + 8); + posY = BitConverter::ToInt16BE(rawData, rawDataIndex + 10); + posZ = BitConverter::ToInt16BE(rawData, rawDataIndex + 12); - posX = BitConverter::ToInt16BE(data, rawDataIndex + 8); - posY = BitConverter::ToInt16BE(data, rawDataIndex + 10); - posZ = BitConverter::ToInt16BE(data, rawDataIndex + 12); - - unused = BitConverter::ToInt16BE(data, rawDataIndex + 14); + unused = BitConverter::ToInt16BE(rawData, rawDataIndex + 14); } CutsceneCommandSetCameraPos::CutsceneCommandSetCameraPos(const std::vector& rawData, uint32_t rawDataIndex) : CutsceneCommand(rawData, rawDataIndex) { - const uint8_t* data = rawData.data(); - - base = BitConverter::ToUInt16BE(data, rawDataIndex + 0); - startFrame = BitConverter::ToUInt16BE(data, rawDataIndex + 2); - endFrame = BitConverter::ToUInt16BE(data, rawDataIndex + 4); - unused = BitConverter::ToUInt16BE(data, rawDataIndex + 6); + base = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0); + startFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 2); + endFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 4); + unused = BitConverter::ToUInt16BE(rawData, rawDataIndex + 6); entries = std::vector(); @@ -711,17 +707,17 @@ size_t CutsceneCommandStopBGM::GetCommandSize() EnvLightingEntry::EnvLightingEntry(const std::vector& rawData, uint32_t rawDataIndex) { - setting = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 0); - startFrame = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 2); - endFrame = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 4); - unused0 = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 6); - unused1 = (uint32_t)BitConverter::ToInt32BE(rawData, rawDataIndex + 8); - unused2 = (uint32_t)BitConverter::ToInt32BE(rawData, rawDataIndex + 12); - unused3 = (uint32_t)BitConverter::ToInt32BE(rawData, rawDataIndex + 16); - unused4 = (uint32_t)BitConverter::ToInt32BE(rawData, rawDataIndex + 20); - unused5 = (uint32_t)BitConverter::ToInt32BE(rawData, rawDataIndex + 24); - unused6 = (uint32_t)BitConverter::ToInt32BE(rawData, rawDataIndex + 28); - unused7 = (uint32_t)BitConverter::ToInt32BE(rawData, rawDataIndex + 32); + setting = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0); + startFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 2); + endFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 4); + unused0 = BitConverter::ToUInt16BE(rawData, rawDataIndex + 6); + unused1 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 8); + unused2 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 12); + unused3 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 16); + unused4 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 20); + unused5 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 24); + unused6 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 28); + unused7 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 32); } CutsceneCommandEnvLighting::CutsceneCommandEnvLighting(const std::vector& rawData, @@ -769,9 +765,9 @@ size_t CutsceneCommandEnvLighting::GetCommandSize() Unknown9Entry::Unknown9Entry(const std::vector& rawData, uint32_t rawDataIndex) { - base = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 0); - startFrame = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 2); - endFrame = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 4); + base = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0); + startFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 2); + endFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 4); unk2 = rawData[rawDataIndex + 6]; unk3 = rawData[rawDataIndex + 7]; unk4 = rawData[rawDataIndex + 8]; @@ -824,18 +820,18 @@ size_t CutsceneCommandUnknown9::GetCommandSize() UnkEntry::UnkEntry(const std::vector& rawData, uint32_t rawDataIndex) { - unused0 = (uint32_t)BitConverter::ToInt32BE(rawData, rawDataIndex + 0); - unused1 = (uint32_t)BitConverter::ToInt32BE(rawData, rawDataIndex + 4); - unused2 = (uint32_t)BitConverter::ToInt32BE(rawData, rawDataIndex + 8); - unused3 = (uint32_t)BitConverter::ToInt32BE(rawData, rawDataIndex + 12); - unused4 = (uint32_t)BitConverter::ToInt32BE(rawData, rawDataIndex + 16); - unused5 = (uint32_t)BitConverter::ToInt32BE(rawData, rawDataIndex + 20); - unused6 = (uint32_t)BitConverter::ToInt32BE(rawData, rawDataIndex + 24); - unused7 = (uint32_t)BitConverter::ToInt32BE(rawData, rawDataIndex + 28); - unused8 = (uint32_t)BitConverter::ToInt32BE(rawData, rawDataIndex + 32); - unused9 = (uint32_t)BitConverter::ToInt32BE(rawData, rawDataIndex + 36); - unused10 = (uint32_t)BitConverter::ToInt32BE(rawData, rawDataIndex + 40); - unused11 = (uint32_t)BitConverter::ToInt32BE(rawData, rawDataIndex + 44); + unused0 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0); + unused1 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 4); + unused2 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 8); + unused3 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 12); + unused4 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 16); + unused5 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 20); + unused6 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 24); + unused7 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 28); + unused8 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 32); + unused9 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 36); + unused10 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 40); + unused11 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 44); } CutsceneCommandUnknown::CutsceneCommandUnknown(const std::vector& rawData, @@ -883,9 +879,9 @@ size_t CutsceneCommandUnknown::GetCommandSize() DayTimeEntry::DayTimeEntry(const std::vector& rawData, uint32_t rawDataIndex) { - base = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 0); - startFrame = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 2); - endFrame = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 4); + base = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0); + startFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 2); + endFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 4); hour = rawData[rawDataIndex + 6]; minute = rawData[rawDataIndex + 7]; unused = rawData[rawDataIndex + 8]; @@ -934,12 +930,12 @@ size_t CutsceneCommandDayTime::GetCommandSize() TextboxEntry::TextboxEntry(const std::vector& rawData, uint32_t rawDataIndex) { - base = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 0); - startFrame = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 2); - endFrame = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 4); - type = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 6); - textID1 = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 8); - textID2 = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 10); + base = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0); + startFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 2); + endFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 4); + type = BitConverter::ToUInt16BE(rawData, rawDataIndex + 6); + textID1 = BitConverter::ToUInt16BE(rawData, rawDataIndex + 8); + textID2 = BitConverter::ToUInt16BE(rawData, rawDataIndex + 10); } CutsceneCommandTextbox::CutsceneCommandTextbox(const std::vector& rawData, @@ -994,23 +990,21 @@ size_t CutsceneCommandTextbox::GetCommandSize() ActorAction::ActorAction(const std::vector& rawData, uint32_t rawDataIndex) { - const uint8_t* data = rawData.data(); - - action = (uint16_t)BitConverter::ToInt16BE(data, rawDataIndex + 0); - startFrame = (uint16_t)BitConverter::ToInt16BE(data, rawDataIndex + 2); - endFrame = (uint16_t)BitConverter::ToInt16BE(data, rawDataIndex + 4); - rotX = (uint16_t)BitConverter::ToInt16BE(data, rawDataIndex + 6); - rotY = (uint16_t)BitConverter::ToInt16BE(data, rawDataIndex + 8); - rotZ = (uint16_t)BitConverter::ToInt16BE(data, rawDataIndex + 10); - startPosX = BitConverter::ToInt32BE(data, rawDataIndex + 12); - startPosY = BitConverter::ToInt32BE(data, rawDataIndex + 16); - startPosZ = BitConverter::ToInt32BE(data, rawDataIndex + 20); - endPosX = BitConverter::ToInt32BE(data, rawDataIndex + 24); - endPosY = BitConverter::ToInt32BE(data, rawDataIndex + 28); - endPosZ = BitConverter::ToInt32BE(data, rawDataIndex + 32); - normalX = BitConverter::ToFloatBE(data, rawDataIndex + 36); - normalY = BitConverter::ToFloatBE(data, rawDataIndex + 40); - normalZ = BitConverter::ToFloatBE(data, rawDataIndex + 44); + action = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0); + startFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 2); + endFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 4); + rotX = BitConverter::ToUInt16BE(rawData, rawDataIndex + 6); + rotY = BitConverter::ToUInt16BE(rawData, rawDataIndex + 8); + rotZ = BitConverter::ToUInt16BE(rawData, rawDataIndex + 10); + startPosX = BitConverter::ToInt32BE(rawData, rawDataIndex + 12); + startPosY = BitConverter::ToInt32BE(rawData, rawDataIndex + 16); + startPosZ = BitConverter::ToInt32BE(rawData, rawDataIndex + 20); + endPosX = BitConverter::ToInt32BE(rawData, rawDataIndex + 24); + endPosY = BitConverter::ToInt32BE(rawData, rawDataIndex + 28); + endPosZ = BitConverter::ToInt32BE(rawData, rawDataIndex + 32); + normalX = BitConverter::ToFloatBE(rawData, rawDataIndex + 36); + normalY = BitConverter::ToFloatBE(rawData, rawDataIndex + 40); + normalZ = BitConverter::ToFloatBE(rawData, rawDataIndex + 44); } CutsceneCommandActorAction::CutsceneCommandActorAction(const std::vector& rawData, @@ -1074,10 +1068,10 @@ CutsceneCommandTerminator::CutsceneCommandTerminator(const std::vector& { rawDataIndex += 4; - base = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 0); - startFrame = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 2); - endFrame = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 4); - unknown = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 6); // endFrame duplicate + base = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0); + startFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 2); + endFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 4); + unknown = BitConverter::ToUInt16BE(rawData, rawDataIndex + 6); // endFrame duplicate } std::string CutsceneCommandTerminator::GetCName() @@ -1102,9 +1096,9 @@ size_t CutsceneCommandTerminator::GetCommandSize() CutsceneCommandEnd::CutsceneCommandEnd(const std::vector& rawData, uint32_t rawDataIndex) : CutsceneCommand(rawData, rawDataIndex) { - base = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 0); - startFrame = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 2); - endFrame = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 4); + base = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0); + startFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 2); + endFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 4); } std::string CutsceneCommandEnd::GenerateSourceCode([[maybe_unused]] uint32_t baseAddress) @@ -1128,22 +1122,20 @@ size_t CutsceneCommandEnd::GetCommandSize() SpecialActionEntry::SpecialActionEntry(const std::vector& rawData, uint32_t rawDataIndex) { - const uint8_t* data = rawData.data(); - - base = BitConverter::ToUInt16BE(data, rawDataIndex + 0); - startFrame = BitConverter::ToUInt16BE(data, rawDataIndex + 2); - endFrame = BitConverter::ToUInt16BE(data, rawDataIndex + 4); - unused0 = BitConverter::ToUInt16BE(data, rawDataIndex + 6); - unused1 = BitConverter::ToUInt32BE(data, rawDataIndex + 8); - unused2 = BitConverter::ToUInt32BE(data, rawDataIndex + 12); - unused3 = BitConverter::ToUInt32BE(data, rawDataIndex + 16); - unused4 = BitConverter::ToUInt32BE(data, rawDataIndex + 20); - unused5 = BitConverter::ToUInt32BE(data, rawDataIndex + 24); - unused6 = BitConverter::ToUInt32BE(data, rawDataIndex + 28); - unused7 = BitConverter::ToUInt32BE(data, rawDataIndex + 32); - unused8 = BitConverter::ToUInt32BE(data, rawDataIndex + 36); - unused9 = BitConverter::ToUInt32BE(data, rawDataIndex + 40); - unused10 = BitConverter::ToUInt32BE(data, rawDataIndex + 44); + base = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0); + startFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 2); + endFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 4); + unused0 = BitConverter::ToUInt16BE(rawData, rawDataIndex + 6); + unused1 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 8); + unused2 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 12); + unused3 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 16); + unused4 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 20); + unused5 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 24); + unused6 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 28); + unused7 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 32); + unused8 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 36); + unused9 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 40); + unused10 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 44); } CutsceneCommandSpecialAction::CutsceneCommandSpecialAction(const std::vector& rawData, @@ -1194,9 +1186,9 @@ size_t CutsceneCommandSpecialAction::GetCommandSize() CutsceneCommandNop::CutsceneCommandNop(const std::vector& rawData, uint32_t rawDataIndex) : CutsceneCommand(rawData, rawDataIndex) { - base = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 0); - startFrame = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 2); - endFrame = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 4); + base = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0); + startFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 2); + endFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 4); } std::string CutsceneCommandNop::GetCName() @@ -1215,9 +1207,9 @@ CutsceneCommandSceneTransFX::CutsceneCommandSceneTransFX(const std::vectorGetSourceOutputHeader(""); @@ -792,6 +797,8 @@ void ZFile::GenerateSourceHeaderFiles() formatter.Write(ProcessExterns()); + formatter.Write("#endif\n"); + fs::path headerFilename = GetSourceOutputFolderPath() / outName.stem().concat(".h"); if (Globals::Instance->verbosity >= VerbosityLevel::VERBOSITY_INFO) diff --git a/tools/ZAPD/ZAPD/ZFile.h b/tools/ZAPD/ZAPD/ZFile.h index ac4062d5b..365c7bbbb 100644 --- a/tools/ZAPD/ZAPD/ZFile.h +++ b/tools/ZAPD/ZAPD/ZFile.h @@ -52,7 +52,7 @@ public: void ExtractResources(); void BuildSourceFile(); void AddResource(ZResource* res); - ZResource* FindResource(uint32_t rawDataIndex); + ZResource* FindResource(offset_t rawDataIndex); std::vector GetResourcesOfType(ZResourceType resType); Declaration* AddDeclaration(offset_t address, DeclarationAlignment alignment, size_t size, diff --git a/tools/ZAPD/ZAPD/ZLimb.cpp b/tools/ZAPD/ZAPD/ZLimb.cpp index 330fbaf7c..034d0850b 100644 --- a/tools/ZAPD/ZAPD/ZLimb.cpp +++ b/tools/ZAPD/ZAPD/ZLimb.cpp @@ -4,12 +4,15 @@ #include "Globals.h" #include "Utils/BitConverter.h" +#include "Utils/StringHelper.h" #include "WarningHandler.h" +#include "ZSkeleton.h" REGISTER_ZFILENODE(Limb, ZLimb); ZLimb::ZLimb(ZFile* nParent) : ZResource(nParent), segmentStruct(nParent) { + RegisterOptionalAttribute("EnumName"); RegisterOptionalAttribute("LimbType"); RegisterOptionalAttribute("Type"); } @@ -30,6 +33,12 @@ void ZLimb::ParseXML(tinyxml2::XMLElement* reader) { ZResource::ParseXML(reader); + auto& enumNameXml = registeredAttributes.at("EnumName").value; + if (enumNameXml != "") + { + enumName = enumNameXml; + } + // Reading from a std::string limbType = registeredAttributes.at("LimbType").value; if (limbType == "") // Reading from a @@ -240,11 +249,24 @@ std::string ZLimb::GetBodySourceCode() const } else { + std::string childStr; + std::string siblingStr; + if (limbsTable != nullptr) + { + childStr = limbsTable->GetLimbEnumName(childIndex); + siblingStr = limbsTable->GetLimbEnumName(siblingIndex); + } + else + { + childStr = StringHelper::Sprintf("0x%02X", childIndex); + siblingStr = StringHelper::Sprintf("0x%02X", siblingIndex); + } + if (type != ZLimbType::Curve) { entryStr += StringHelper::Sprintf("{ %i, %i, %i }, ", transX, transY, transZ); } - entryStr += StringHelper::Sprintf("0x%02X, 0x%02X,\n", childIndex, siblingIndex); + entryStr += StringHelper::Sprintf("%s, %s,\n", childStr.c_str(), siblingStr.c_str()); switch (type) { @@ -352,6 +374,11 @@ ZLimbType ZLimb::GetTypeByAttributeName(const std::string& attrName) return ZLimbType::Invalid; } +void ZLimb::SetLimbIndex(uint8_t nLimbIndex) +{ + limbIndex = nLimbIndex; +} + void ZLimb::DeclareDList(segptr_t dListSegmentedPtr, const std::string& prefix, const std::string& limbSuffix) { diff --git a/tools/ZAPD/ZAPD/ZLimb.h b/tools/ZAPD/ZAPD/ZLimb.h index 53a414329..ce31e4295 100644 --- a/tools/ZAPD/ZAPD/ZLimb.h +++ b/tools/ZAPD/ZAPD/ZLimb.h @@ -18,9 +18,14 @@ enum class ZLimbType Legacy, }; +class ZLimbTable; + class ZLimb : public ZResource { public: + std::string enumName; + ZLimbTable* limbsTable = nullptr; // borrowed pointer, do not delete! + ZLimbType type = ZLimbType::Standard; ZLimbSkinType skinSegmentType = ZLimbSkinType::SkinType_0; // Skin only @@ -39,6 +44,8 @@ public: int16_t transX, transY, transZ; uint8_t childIndex, siblingIndex; + uint8_t limbIndex = 0; + ZLimb(ZFile* nParent); void ExtractFromBinary(uint32_t nRawDataIndex, ZLimbType nType); @@ -59,6 +66,8 @@ public: static const char* GetSourceTypeName(ZLimbType limbType); static ZLimbType GetTypeByAttributeName(const std::string& attrName); + void SetLimbIndex(uint8_t nLimbIndex); + protected: void DeclareDList(segptr_t dListSegmentedPtr, const std::string& prefix, const std::string& limbSuffix); diff --git a/tools/ZAPD/ZAPD/ZSkeleton.cpp b/tools/ZAPD/ZAPD/ZSkeleton.cpp index 4467c9632..ff4333129 100644 --- a/tools/ZAPD/ZAPD/ZSkeleton.cpp +++ b/tools/ZAPD/ZAPD/ZSkeleton.cpp @@ -10,10 +10,13 @@ REGISTER_ZFILENODE(Skeleton, ZSkeleton); REGISTER_ZFILENODE(LimbTable, ZLimbTable); -ZSkeleton::ZSkeleton(ZFile* nParent) : ZResource(nParent), limbsTable(nParent) +ZSkeleton::ZSkeleton(ZFile* nParent) : ZResource(nParent) { RegisterRequiredAttribute("Type"); RegisterRequiredAttribute("LimbType"); + RegisterOptionalAttribute("EnumName"); + RegisterOptionalAttribute("LimbNone"); + RegisterOptionalAttribute("LimbMax"); } void ZSkeleton::ParseXML(tinyxml2::XMLElement* reader) @@ -42,6 +45,41 @@ void ZSkeleton::ParseXML(tinyxml2::XMLElement* reader) limbTypeXml.c_str()), "Defaulting to 'Standard'."); } + + enumName = registeredAttributes.at("EnumName").value; + limbNoneName = registeredAttributes.at("LimbNone").value; + limbMaxName = registeredAttributes.at("LimbMax").value; + + if (enumName != "") + { + if (limbNoneName == "" || limbMaxName == "") + { + HANDLE_ERROR_RESOURCE(WarningType::MissingAttribute, parent, this, rawDataIndex, + "'EnumName' attribute was used but either 'LimbNone' or " + "'LimbMax' attribute is missing", + ""); + } + } + + if (limbNoneName != "") + { + if (limbMaxName == "") + { + HANDLE_ERROR_RESOURCE( + WarningType::MissingAttribute, parent, this, rawDataIndex, + "'LimbNone' attribute was used but 'LimbMax' attribute is missing", ""); + } + } + + if (limbMaxName != "") + { + if (limbNoneName == "") + { + HANDLE_ERROR_RESOURCE( + WarningType::MissingAttribute, parent, this, rawDataIndex, + "'LimbMax' attribute was used but 'LimbNone' attribute is missing", ""); + } + } } void ZSkeleton::ParseRawData() @@ -56,12 +94,6 @@ void ZSkeleton::ParseRawData() { dListCount = BitConverter::ToUInt8BE(rawData, rawDataIndex + 8); } - - if (limbsArrayAddress != 0 && GETSEGNUM(limbsArrayAddress) == parent->segment) - { - uint32_t ptr = Seg2Filespace(limbsArrayAddress, parent->baseAddress); - limbsTable.ExtractFromBinary(ptr, limbType, limbCount); - } } void ZSkeleton::DeclareReferences(const std::string& prefix) @@ -72,14 +104,33 @@ void ZSkeleton::DeclareReferences(const std::string& prefix) ZResource::DeclareReferences(defaultPrefix); - if (limbsArrayAddress != 0 && GETSEGNUM(limbsArrayAddress) == parent->segment) + if (limbsArrayAddress != SEGMENTED_NULL && GETSEGNUM(limbsArrayAddress) == parent->segment) { - uint32_t ptr = Seg2Filespace(limbsArrayAddress, parent->baseAddress); + offset_t ptr = Seg2Filespace(limbsArrayAddress, parent->baseAddress); + if (!parent->HasDeclaration(ptr)) { - limbsTable.SetName(StringHelper::Sprintf("%sLimbs", defaultPrefix.c_str())); - limbsTable.DeclareReferences(prefix); - limbsTable.GetSourceOutputCode(prefix); + limbsTable = new ZLimbTable(parent); + limbsTable->ExtractFromBinary(ptr, limbType, limbCount); + limbsTable->SetName(StringHelper::Sprintf("%sLimbs", defaultPrefix.c_str())); + parent->AddResource(limbsTable); + } + else + { + limbsTable = static_cast(parent->FindResource(ptr)); + } + + if (limbsTable->enumName == "") + { + limbsTable->enumName = enumName; + } + if (limbsTable->limbNoneName == "") + { + limbsTable->limbNoneName = limbNoneName; + } + if (limbsTable->limbMaxName == "") + { + limbsTable->limbMaxName = limbMaxName; } } } @@ -89,14 +140,26 @@ std::string ZSkeleton::GetBodySourceCode() const std::string limbArrayName; Globals::Instance->GetSegmentedPtrName(limbsArrayAddress, parent, "", limbArrayName); + std::string countStr; + assert(limbsTable != nullptr); + // There are some Skeletons with the wrong limb count on them, so this check is necessary. + if (limbsTable->count == limbCount) + { + countStr = StringHelper::Sprintf("ARRAY_COUNT(%s)", limbArrayName.c_str()); + } + else + { + countStr = StringHelper::Sprintf("%i", limbCount); + } + switch (type) { case ZSkeletonType::Normal: case ZSkeletonType::Curve: - return StringHelper::Sprintf("\n\t%s, %i\n", limbArrayName.c_str(), limbCount); + return StringHelper::Sprintf("\n\t%s, %s\n", limbArrayName.c_str(), countStr.c_str()); case ZSkeletonType::Flex: - return StringHelper::Sprintf("\n\t{ %s, %i }, %i\n", limbArrayName.c_str(), limbCount, + return StringHelper::Sprintf("\n\t{ %s, %s }, %i\n", limbArrayName.c_str(), countStr.c_str(), dListCount); } @@ -153,6 +216,9 @@ ZLimbTable::ZLimbTable(ZFile* nParent) : ZResource(nParent) { RegisterRequiredAttribute("LimbType"); RegisterRequiredAttribute("Count"); + RegisterOptionalAttribute("EnumName"); + RegisterOptionalAttribute("LimbNone"); + RegisterOptionalAttribute("LimbMax"); } void ZLimbTable::ExtractFromBinary(uint32_t nRawDataIndex, ZLimbType nLimbType, size_t nCount) @@ -179,6 +245,40 @@ void ZLimbTable::ParseXML(tinyxml2::XMLElement* reader) } count = StringHelper::StrToL(registeredAttributes.at("Count").value); + + enumName = registeredAttributes.at("EnumName").value; + limbNoneName = registeredAttributes.at("LimbNone").value; + limbMaxName = registeredAttributes.at("LimbMax").value; + + if (enumName != "") + { + if (limbNoneName == "" || limbMaxName == "") + { + HANDLE_ERROR_RESOURCE( + WarningType::MissingAttribute, parent, this, rawDataIndex, + "'EnumName' attribute was used but 'LimbNone'/'LimbMax' attributes is missing", ""); + } + } + + if (limbNoneName != "") + { + if (limbMaxName == "") + { + HANDLE_ERROR_RESOURCE( + WarningType::MissingAttribute, parent, this, rawDataIndex, + "'LimbNone' attribute was used but 'LimbMax' attribute is missing", ""); + } + } + + if (limbMaxName != "") + { + if (limbNoneName == "") + { + HANDLE_ERROR_RESOURCE( + WarningType::MissingAttribute, parent, this, rawDataIndex, + "'LimbMax' attribute was used but 'LimbNone' attribute is missing", ""); + } + } } void ZLimbTable::ParseRawData() @@ -209,15 +309,28 @@ void ZLimbTable::DeclareReferences(const std::string& prefix) if (limbAddress != 0 && GETSEGNUM(limbAddress) == parent->segment) { uint32_t limbOffset = Seg2Filespace(limbAddress, parent->baseAddress); + ZLimb* limb; + if (!parent->HasDeclaration(limbOffset)) { - ZLimb* limb = new ZLimb(parent); + limb = new ZLimb(parent); limb->ExtractFromBinary(limbOffset, limbType); limb->SetName(limb->GetDefaultName(varPrefix)); limb->DeclareVar(varPrefix, ""); limb->DeclareReferences(varPrefix); parent->AddResource(limb); } + else + { + limb = static_cast(parent->FindResource(limbOffset)); + assert(limb != nullptr); + assert(limb->GetResourceType() == ZResourceType::Limb); + } + + limb->limbsTable = this; + limb->SetLimbIndex(i + 1); + + limbsReferences.push_back(limb); } } } @@ -246,6 +359,13 @@ std::string ZLimbTable::GetBodySourceCode() const Globals::Instance->GetSegmentedPtrName(limbsAddresses[i], parent, "", limbName); body += StringHelper::Sprintf("\t%s,", limbName.c_str()); + auto& limb = limbsReferences.at(i); + std::string limbEnumName = limb->enumName; + if (limbEnumName != "") + { + body += StringHelper::Sprintf(" /* %s */", limbEnumName.c_str()); + } + if (i + 1 < count) body += "\n"; } @@ -253,6 +373,46 @@ std::string ZLimbTable::GetBodySourceCode() const return body; } +std::string ZLimbTable::GetSourceOutputHeader([[maybe_unused]] const std::string& prefix) +{ + if (limbNoneName == "" || limbMaxName == "" || enumName == "") + { + // Don't produce a enum of any of those attributes is missing + return ""; + } + + std::string limbEnum = StringHelper::Sprintf("typedef enum %s {\n", enumName.c_str()); + + // This assumes there isn't any skeleton with more than 0x100 limbs + + limbEnum += StringHelper::Sprintf(" /* 0x00 */ %s,\n", limbNoneName.c_str()); + + size_t i = 0; + for (; i < count; i++) + { + auto& limb = limbsReferences.at(i); + std::string limbEnumName = limb->enumName; + + if (limbEnumName == "") + { + HANDLE_ERROR_RESOURCE( + WarningType::MissingAttribute, parent, this, rawDataIndex, + "Skeleton's enum attributes were used but at least one limb is missing its " + "'LimbName' attribute", + StringHelper::Sprintf("When processing limb %02i, named '%s' at offset '0x%X'", + i + 1, limb->GetName().c_str(), limb->GetRawDataIndex())); + } + + limbEnum += StringHelper::Sprintf(" /* 0x%02X */ %s,\n", i + 1, limbEnumName.c_str()); + } + + limbEnum += StringHelper::Sprintf(" /* 0x%02X */ %s\n", i + 1, limbMaxName.c_str()); + + limbEnum += StringHelper::Sprintf("} %s;\n", enumName.c_str()); + + return limbEnum; +} + std::string ZLimbTable::GetSourceTypeName() const { switch (limbType) @@ -283,3 +443,28 @@ size_t ZLimbTable::GetRawDataSize() const { return 4 * limbsAddresses.size(); } + +std::string ZLimbTable::GetLimbEnumName(uint8_t limbIndex) const +{ + if (limbIndex == 0xFF) + { + return "LIMB_DONE"; + } + + if (limbIndex < count) + { + std::string limbEnumName = limbsReferences.at(limbIndex)->enumName; + if (limbEnumName != "") + { + return StringHelper::Sprintf("%s - 1", limbEnumName.c_str()); + } + } + else + { + HANDLE_WARNING_RESOURCE(WarningType::InvalidExtractedData, parent, this, rawDataIndex, + StringHelper::Sprintf("Limb index '%02i' out of range", limbIndex), + ""); + } + + return StringHelper::Sprintf("0x%02X", limbIndex); +} diff --git a/tools/ZAPD/ZAPD/ZSkeleton.h b/tools/ZAPD/ZAPD/ZSkeleton.h index ed003ceaf..c437a8484 100644 --- a/tools/ZAPD/ZAPD/ZSkeleton.h +++ b/tools/ZAPD/ZAPD/ZSkeleton.h @@ -18,6 +18,17 @@ enum class ZSkeletonType class ZLimbTable : public ZResource { public: + ZLimbType limbType = ZLimbType::Standard; + size_t count = 0; + + std::vector limbsAddresses; + std::vector limbsReferences; // borrowed pointers, do not delete! + + // XML attributes + std::string enumName; + std::string limbNoneName; + std::string limbMaxName; + ZLimbTable(ZFile* nParent); void ExtractFromBinary(uint32_t nRawDataIndex, ZLimbType nLimbType, size_t nCount); @@ -30,16 +41,14 @@ public: std::string GetBodySourceCode() const override; + std::string GetSourceOutputHeader(const std::string& prefix) override; + std::string GetSourceTypeName() const override; ZResourceType GetResourceType() const override; size_t GetRawDataSize() const override; -protected: - ZLimbType limbType = ZLimbType::Standard; - size_t count = 0; - - std::vector limbsAddresses; + std::string GetLimbEnumName(uint8_t limbIndex) const; }; class ZSkeleton : public ZResource @@ -47,6 +56,10 @@ class ZSkeleton : public ZResource public: ZSkeletonType type = ZSkeletonType::Normal; ZLimbType limbType = ZLimbType::Standard; + std::string enumName; + std::string limbNoneName; + std::string limbMaxName; + segptr_t limbsArrayAddress; uint8_t limbCount = 0; uint8_t dListCount = 0; // FLEX SKELETON ONLY @@ -68,5 +81,5 @@ public: uint8_t GetLimbCount(); protected: - ZLimbTable limbsTable; + ZLimbTable* limbsTable = nullptr; // borrowed pointer, do not delete! }; diff --git a/tools/ZAPD/ZAPD/ZTexture.cpp b/tools/ZAPD/ZAPD/ZTexture.cpp index 255d30886..a9cb53941 100644 --- a/tools/ZAPD/ZAPD/ZTexture.cpp +++ b/tools/ZAPD/ZAPD/ZTexture.cpp @@ -350,34 +350,42 @@ void ZTexture::DeclareReferences([[maybe_unused]] const std::string& prefix) void ZTexture::PrepareRawDataFromFile(const fs::path& pngFilePath) { + textureData.ReadPng(pngFilePath); + + width = textureData.GetWidth(); + height = textureData.GetHeight(); + + textureDataRaw.clear(); + textureDataRaw.resize(ALIGN8(GetRawDataSize())); + switch (format) { case TextureType::RGBA16bpp: - PrepareRawDataRGBA16(pngFilePath); + PrepareRawDataRGBA16(); break; case TextureType::RGBA32bpp: - PrepareRawDataRGBA32(pngFilePath); + PrepareRawDataRGBA32(); break; case TextureType::Grayscale4bpp: - PrepareRawDataGrayscale4(pngFilePath); + PrepareRawDataGrayscale4(); break; case TextureType::Grayscale8bpp: - PrepareRawDataGrayscale8(pngFilePath); + PrepareRawDataGrayscale8(); break; case TextureType::GrayscaleAlpha4bpp: - PrepareRawDataGrayscaleAlpha4(pngFilePath); + PrepareRawDataGrayscaleAlpha4(); break; case TextureType::GrayscaleAlpha8bpp: - PrepareRawDataGrayscaleAlpha8(pngFilePath); + PrepareRawDataGrayscaleAlpha8(); break; case TextureType::GrayscaleAlpha16bpp: - PrepareRawDataGrayscaleAlpha16(pngFilePath); + PrepareRawDataGrayscaleAlpha16(); break; case TextureType::Palette4bpp: - PrepareRawDataPalette4(pngFilePath); + PrepareRawDataPalette4(); break; case TextureType::Palette8bpp: - PrepareRawDataPalette8(pngFilePath); + PrepareRawDataPalette8(); break; case TextureType::Error: HANDLE_ERROR_PROCESS(WarningType::InvalidPNG, "Input PNG file has invalid format type", ""); @@ -385,15 +393,8 @@ void ZTexture::PrepareRawDataFromFile(const fs::path& pngFilePath) } } -void ZTexture::PrepareRawDataRGBA16(const fs::path& rgbaPath) +void ZTexture::PrepareRawDataRGBA16() { - textureData.ReadPng(rgbaPath); - - width = textureData.GetWidth(); - height = textureData.GetHeight(); - - textureDataRaw.clear(); - textureDataRaw.resize(GetRawDataSize()); for (uint16_t y = 0; y < height; y++) { for (uint16_t x = 0; x < width; x++) @@ -415,15 +416,8 @@ void ZTexture::PrepareRawDataRGBA16(const fs::path& rgbaPath) } } -void ZTexture::PrepareRawDataRGBA32(const fs::path& rgbaPath) +void ZTexture::PrepareRawDataRGBA32() { - textureData.ReadPng(rgbaPath); - - width = textureData.GetWidth(); - height = textureData.GetHeight(); - - textureDataRaw.clear(); - textureDataRaw.resize(GetRawDataSize()); for (uint16_t y = 0; y < height; y++) { for (uint16_t x = 0; x < width; x++) @@ -439,15 +433,8 @@ void ZTexture::PrepareRawDataRGBA32(const fs::path& rgbaPath) } } -void ZTexture::PrepareRawDataGrayscale4(const fs::path& grayPath) +void ZTexture::PrepareRawDataGrayscale4() { - textureData.ReadPng(grayPath); - - width = textureData.GetWidth(); - height = textureData.GetHeight(); - - textureDataRaw.clear(); - textureDataRaw.resize(GetRawDataSize()); for (uint16_t y = 0; y < height; y++) { for (uint16_t x = 0; x < width; x += 2) @@ -461,15 +448,8 @@ void ZTexture::PrepareRawDataGrayscale4(const fs::path& grayPath) } } -void ZTexture::PrepareRawDataGrayscale8(const fs::path& grayPath) +void ZTexture::PrepareRawDataGrayscale8() { - textureData.ReadPng(grayPath); - - width = textureData.GetWidth(); - height = textureData.GetHeight(); - - textureDataRaw.clear(); - textureDataRaw.resize(GetRawDataSize()); for (uint16_t y = 0; y < height; y++) { for (uint16_t x = 0; x < width; x++) @@ -481,15 +461,8 @@ void ZTexture::PrepareRawDataGrayscale8(const fs::path& grayPath) } } -void ZTexture::PrepareRawDataGrayscaleAlpha4(const fs::path& grayAlphaPath) +void ZTexture::PrepareRawDataGrayscaleAlpha4() { - textureData.ReadPng(grayAlphaPath); - - width = textureData.GetWidth(); - height = textureData.GetHeight(); - - textureDataRaw.clear(); - textureDataRaw.resize(GetRawDataSize()); for (uint16_t y = 0; y < height; y++) { for (uint16_t x = 0; x < width; x += 2) @@ -514,15 +487,8 @@ void ZTexture::PrepareRawDataGrayscaleAlpha4(const fs::path& grayAlphaPath) } } -void ZTexture::PrepareRawDataGrayscaleAlpha8(const fs::path& grayAlphaPath) +void ZTexture::PrepareRawDataGrayscaleAlpha8() { - textureData.ReadPng(grayAlphaPath); - - width = textureData.GetWidth(); - height = textureData.GetHeight(); - - textureDataRaw.clear(); - textureDataRaw.resize(GetRawDataSize()); for (uint16_t y = 0; y < height; y++) { for (uint16_t x = 0; x < width; x++) @@ -538,15 +504,8 @@ void ZTexture::PrepareRawDataGrayscaleAlpha8(const fs::path& grayAlphaPath) } } -void ZTexture::PrepareRawDataGrayscaleAlpha16(const fs::path& grayAlphaPath) +void ZTexture::PrepareRawDataGrayscaleAlpha16() { - textureData.ReadPng(grayAlphaPath); - - width = textureData.GetWidth(); - height = textureData.GetHeight(); - - textureDataRaw.clear(); - textureDataRaw.resize(GetRawDataSize()); for (uint16_t y = 0; y < height; y++) { for (uint16_t x = 0; x < width; x++) @@ -563,15 +522,8 @@ void ZTexture::PrepareRawDataGrayscaleAlpha16(const fs::path& grayAlphaPath) } } -void ZTexture::PrepareRawDataPalette4(const fs::path& palPath) +void ZTexture::PrepareRawDataPalette4() { - textureData.ReadPng(palPath); - - width = textureData.GetWidth(); - height = textureData.GetHeight(); - - textureDataRaw.clear(); - textureDataRaw.resize(GetRawDataSize()); for (uint16_t y = 0; y < height; y++) { for (uint16_t x = 0; x < width; x += 2) @@ -586,15 +538,8 @@ void ZTexture::PrepareRawDataPalette4(const fs::path& palPath) } } -void ZTexture::PrepareRawDataPalette8(const fs::path& palPath) +void ZTexture::PrepareRawDataPalette8() { - textureData.ReadPng(palPath); - - width = textureData.GetWidth(); - height = textureData.GetHeight(); - - textureDataRaw.clear(); - textureDataRaw.resize(GetRawDataSize()); for (uint16_t y = 0; y < height; y++) { for (uint16_t x = 0; x < width; x++) diff --git a/tools/ZAPD/ZAPD/ZTexture.h b/tools/ZAPD/ZAPD/ZTexture.h index 29c3fbc0a..6f2c49935 100644 --- a/tools/ZAPD/ZAPD/ZTexture.h +++ b/tools/ZAPD/ZAPD/ZTexture.h @@ -40,15 +40,15 @@ protected: void PrepareBitmapPalette8(); void PrepareRawDataFromFile(const fs::path& inFolder); - void PrepareRawDataRGBA16(const fs::path& rgbaPath); - void PrepareRawDataRGBA32(const fs::path& rgbaPath); - void PrepareRawDataGrayscale4(const fs::path& grayPath); - void PrepareRawDataGrayscale8(const fs::path& grayPath); - void PrepareRawDataGrayscaleAlpha4(const fs::path& grayAlphaPath); - void PrepareRawDataGrayscaleAlpha8(const fs::path& grayAlphaPath); - void PrepareRawDataGrayscaleAlpha16(const fs::path& grayAlphaPath); - void PrepareRawDataPalette4(const fs::path& palPath); - void PrepareRawDataPalette8(const fs::path& palPath); + void PrepareRawDataRGBA16(); + void PrepareRawDataRGBA32(); + void PrepareRawDataGrayscale4(); + void PrepareRawDataGrayscale8(); + void PrepareRawDataGrayscaleAlpha4(); + void PrepareRawDataGrayscaleAlpha8(); + void PrepareRawDataGrayscaleAlpha16(); + void PrepareRawDataPalette4(); + void PrepareRawDataPalette8(); public: ZTexture(ZFile* nParent); diff --git a/tools/ZAPD/ZAPDUtils/Utils/BitConverter.h b/tools/ZAPD/ZAPDUtils/Utils/BitConverter.h index e672b97c2..98c46bc79 100644 --- a/tools/ZAPD/ZAPDUtils/Utils/BitConverter.h +++ b/tools/ZAPD/ZAPDUtils/Utils/BitConverter.h @@ -1,155 +1,155 @@ #pragma once +#include #include +#include #include #include +#define ALIGN8(val) (((val) + 7) & ~7) +#define ALIGN16(val) (((val) + 0xF) & ~0xF) +#define ALIGN64(val) (((val) + 0x3F) & ~0x3F) + class BitConverter { public: - static inline int8_t ToInt8BE(const uint8_t* data, int32_t offset) + static inline int8_t ToInt8BE(const std::vector& data, size_t offset) { - return (uint8_t)data[offset + 0]; + if (offset + 0 > data.size()) + { + fprintf(stderr, "%s\n", __PRETTY_FUNCTION__); + fprintf(stderr, "Error: Trying a out-of-bounds reading from a data buffer\n"); + fprintf(stderr, "\t Buffer size: 0x%zX\n", data.size()); + fprintf(stderr, "\t Trying to read at offset: 0x%zX\n", offset); + } + return (int8_t)data.at(offset + 0); } - static inline int8_t ToInt8BE(const std::vector& data, int32_t offset) + static inline uint8_t ToUInt8BE(const std::vector& data, size_t offset) { - return (uint8_t)data[offset + 0]; + if (offset + 0 > data.size()) + { + fprintf(stderr, "%s\n", __PRETTY_FUNCTION__); + fprintf(stderr, "Error: Trying an out-of-bounds reading from a data buffer\n"); + fprintf(stderr, "\t Buffer size: 0x%zX\n", data.size()); + fprintf(stderr, "\t Trying to read at offset: 0x%zX\n", offset); + } + return (uint8_t)data.at(offset + 0); } - static inline uint8_t ToUInt8BE(const uint8_t* data, int32_t offset) + static inline int16_t ToInt16BE(const std::vector& data, size_t offset) { - return (uint8_t)data[offset + 0]; + if (offset + 1 > data.size()) + { + fprintf(stderr, "%s\n", __PRETTY_FUNCTION__); + fprintf(stderr, "Error: Trying a out-of-bounds reading from a data buffer\n"); + fprintf(stderr, "\t Buffer size: 0x%zX\n", data.size()); + fprintf(stderr, "\t Trying to read at offset: 0x%zX\n", offset); + } + return ((uint16_t)data.at(offset + 0) << 8) + (uint16_t)data.at(offset + 1); } - static inline uint8_t ToUInt8BE(const std::vector& data, int32_t offset) + static inline uint16_t ToUInt16BE(const std::vector& data, size_t offset) { - return (uint8_t)data[offset + 0]; + if (offset + 1 > data.size()) + { + fprintf(stderr, "%s\n", __PRETTY_FUNCTION__); + fprintf(stderr, "Error: Trying a out-of-bounds reading from a data buffer\n"); + fprintf(stderr, "\t Buffer size: 0x%zX\n", data.size()); + fprintf(stderr, "\t Trying to read at offset: 0x%zX\n", offset); + } + return ((uint16_t)data.at(offset + 0) << 8) + (uint16_t)data.at(offset + 1); } - static inline int16_t ToInt16BE(const uint8_t* data, int32_t offset) + static inline int32_t ToInt32BE(const std::vector& data, size_t offset) { - return ((uint16_t)data[offset + 0] << 8) + (uint16_t)data[offset + 1]; + if (offset + 3 > data.size()) + { + fprintf(stderr, "%s\n", __PRETTY_FUNCTION__); + fprintf(stderr, "Error: Trying a out-of-bounds reading from a data buffer\n"); + fprintf(stderr, "\t Buffer size: 0x%zX\n", data.size()); + fprintf(stderr, "\t Trying to read at offset: 0x%zX\n", offset); + } + return ((uint32_t)data.at(offset + 0) << 24) + ((uint32_t)data.at(offset + 1) << 16) + + ((uint32_t)data.at(offset + 2) << 8) + (uint32_t)data.at(offset + 3); } - static inline int16_t ToInt16BE(const std::vector& data, int32_t offset) + static inline uint32_t ToUInt32BE(const std::vector& data, size_t offset) { - return ((uint16_t)data[offset + 0] << 8) + (uint16_t)data[offset + 1]; + if (offset + 3 > data.size()) + { + fprintf(stderr, "%s\n", __PRETTY_FUNCTION__); + fprintf(stderr, "Error: Trying a out-of-bounds reading from a data buffer\n"); + fprintf(stderr, "\t Buffer size: 0x%zX\n", data.size()); + fprintf(stderr, "\t Trying to read at offset: 0x%zX\n", offset); + } + return ((uint32_t)data.at(offset + 0) << 24) + ((uint32_t)data.at(offset + 1) << 16) + + ((uint32_t)data.at(offset + 2) << 8) + (uint32_t)data.at(offset + 3); } - static inline uint16_t ToUInt16BE(const uint8_t* data, int32_t offset) + static inline int64_t ToInt64BE(const std::vector& data, size_t offset) { - return ((uint16_t)data[offset + 0] << 8) + (uint16_t)data[offset + 1]; + if (offset + 7 > data.size()) + { + fprintf(stderr, "%s\n", __PRETTY_FUNCTION__); + fprintf(stderr, "Error: Trying a out-of-bounds reading from a data buffer\n"); + fprintf(stderr, "\t Buffer size: 0x%zX\n", data.size()); + fprintf(stderr, "\t Trying to read at offset: 0x%zX\n", offset); + } + return ((uint64_t)data.at(offset + 0) << 56) + ((uint64_t)data.at(offset + 1) << 48) + + ((uint64_t)data.at(offset + 2) << 40) + ((uint64_t)data.at(offset + 3) << 32) + + ((uint64_t)data.at(offset + 4) << 24) + ((uint64_t)data.at(offset + 5) << 16) + + ((uint64_t)data.at(offset + 6) << 8) + ((uint64_t)data.at(offset + 7)); } - static inline uint16_t ToUInt16BE(const std::vector& data, int32_t offset) + static inline uint64_t ToUInt64BE(const std::vector& data, size_t offset) { - return ((uint16_t)data[offset + 0] << 8) + (uint16_t)data[offset + 1]; + if (offset + 7 > data.size()) + { + fprintf(stderr, "%s\n", __PRETTY_FUNCTION__); + fprintf(stderr, "Error: Trying a out-of-bounds reading from a data buffer\n"); + fprintf(stderr, "\t Buffer size: 0x%zX\n", data.size()); + fprintf(stderr, "\t Trying to read at offset: 0x%zX\n", offset); + } + return ((uint64_t)data.at(offset + 0) << 56) + ((uint64_t)data.at(offset + 1) << 48) + + ((uint64_t)data.at(offset + 2) << 40) + ((uint64_t)data.at(offset + 3) << 32) + + ((uint64_t)data.at(offset + 4) << 24) + ((uint64_t)data.at(offset + 5) << 16) + + ((uint64_t)data.at(offset + 6) << 8) + ((uint64_t)data.at(offset + 7)); } - static inline int32_t ToInt32BE(const uint8_t* data, int32_t offset) - { - return ((uint32_t)data[offset + 0] << 24) + ((uint32_t)data[offset + 1] << 16) + - ((uint32_t)data[offset + 2] << 8) + (uint32_t)data[offset + 3]; - } - - static inline int32_t ToInt32BE(const std::vector& data, int32_t offset) - { - return ((uint32_t)data[offset + 0] << 24) + ((uint32_t)data[offset + 1] << 16) + - ((uint32_t)data[offset + 2] << 8) + (uint32_t)data[offset + 3]; - } - - static inline uint32_t ToUInt32BE(const uint8_t* data, int32_t offset) - { - return ((uint32_t)data[offset + 0] << 24) + ((uint32_t)data[offset + 1] << 16) + - ((uint32_t)data[offset + 2] << 8) + (uint32_t)data[offset + 3]; - } - - static inline uint32_t ToUInt32BE(const std::vector& data, int32_t offset) - { - return ((uint32_t)data[offset + 0] << 24) + ((uint32_t)data[offset + 1] << 16) + - ((uint32_t)data[offset + 2] << 8) + (uint32_t)data[offset + 3]; - } - - static inline int64_t ToInt64BE(const uint8_t* data, int32_t offset) - { - return ((uint64_t)data[offset + 0] << 56) + ((uint64_t)data[offset + 1] << 48) + - ((uint64_t)data[offset + 2] << 40) + ((uint64_t)data[offset + 3] << 32) + - ((uint64_t)data[offset + 4] << 24) + ((uint64_t)data[offset + 5] << 16) + - ((uint64_t)data[offset + 6] << 8) + ((uint64_t)data[offset + 7]); - } - - static inline int64_t ToInt64BE(const std::vector& data, int32_t offset) - { - return ((uint64_t)data[offset + 0] << 56) + ((uint64_t)data[offset + 1] << 48) + - ((uint64_t)data[offset + 2] << 40) + ((uint64_t)data[offset + 3] << 32) + - ((uint64_t)data[offset + 4] << 24) + ((uint64_t)data[offset + 5] << 16) + - ((uint64_t)data[offset + 6] << 8) + ((uint64_t)data[offset + 7]); - } - - static inline uint64_t ToUInt64BE(const uint8_t* data, int32_t offset) - { - return ((uint64_t)data[offset + 0] << 56) + ((uint64_t)data[offset + 1] << 48) + - ((uint64_t)data[offset + 2] << 40) + ((uint64_t)data[offset + 3] << 32) + - ((uint64_t)data[offset + 4] << 24) + ((uint64_t)data[offset + 5] << 16) + - ((uint64_t)data[offset + 6] << 8) + ((uint64_t)data[offset + 7]); - } - - static inline uint64_t ToUInt64BE(const std::vector& data, int32_t offset) - { - return ((uint64_t)data[offset + 0] << 56) + ((uint64_t)data[offset + 1] << 48) + - ((uint64_t)data[offset + 2] << 40) + ((uint64_t)data[offset + 3] << 32) + - ((uint64_t)data[offset + 4] << 24) + ((uint64_t)data[offset + 5] << 16) + - ((uint64_t)data[offset + 6] << 8) + ((uint64_t)data[offset + 7]); - } - - static inline float ToFloatBE(const uint8_t* data, int32_t offset) + static inline float ToFloatBE(const std::vector& data, size_t offset) { + if (offset + 3 > data.size()) + { + fprintf(stderr, "%s\n", __PRETTY_FUNCTION__); + fprintf(stderr, "Error: Trying a out-of-bounds reading from a data buffer\n"); + fprintf(stderr, "\t Buffer size: 0x%zX\n", data.size()); + fprintf(stderr, "\t Trying to read at offset: 0x%zX\n", offset); + } float value; - uint32_t floatData = ((uint32_t)data[offset + 0] << 24) + - ((uint32_t)data[offset + 1] << 16) + - ((uint32_t)data[offset + 2] << 8) + (uint32_t)data[offset + 3]; + uint32_t floatData = ((uint32_t)data.at(offset + 0) << 24) + + ((uint32_t)data.at(offset + 1) << 16) + + ((uint32_t)data.at(offset + 2) << 8) + (uint32_t)data.at(offset + 3); static_assert(sizeof(uint32_t) == sizeof(float), "expected 32-bit float"); std::memcpy(&value, &floatData, sizeof(value)); return value; } - static inline float ToFloatBE(const std::vector& data, int32_t offset) - { - float value; - uint32_t floatData = ((uint32_t)data[offset + 0] << 24) + - ((uint32_t)data[offset + 1] << 16) + - ((uint32_t)data[offset + 2] << 8) + (uint32_t)data[offset + 3]; - static_assert(sizeof(uint32_t) == sizeof(float), "expected 32-bit float"); - std::memcpy(&value, &floatData, sizeof(value)); - return value; - } - - static inline double ToDoubleBE(const uint8_t* data, int32_t offset) + static inline double ToDoubleBE(const std::vector& data, size_t offset) { + if (offset + 7 > data.size()) + { + fprintf(stderr, "%s\n", __PRETTY_FUNCTION__); + fprintf(stderr, "Error: Trying a out-of-bounds reading from a data buffer\n"); + fprintf(stderr, "\t Buffer size: 0x%zX\n", data.size()); + fprintf(stderr, "\t Trying to read at offset: 0x%zX\n", offset); + } double value; uint64_t floatData = - ((uint64_t)data[offset + 0] << 56) + ((uint64_t)data[offset + 1] << 48) + - ((uint64_t)data[offset + 2] << 40) + ((uint64_t)data[offset + 3] << 32) + - ((uint64_t)data[offset + 4] << 24) + ((uint64_t)data[offset + 5] << 16) + - ((uint64_t)data[offset + 6] << 8) + ((uint64_t)data[offset + 7]); - static_assert(sizeof(uint64_t) == sizeof(double), "expected 64-bit double"); - // Checks if the float format on the platform the ZAPD binary is running on supports the - // same float format as the object file. - static_assert(std::numeric_limits::is_iec559, - "expected IEC559 floats on host machine"); - std::memcpy(&value, &floatData, sizeof(value)); - return value; - } - - static inline double ToDoubleBE(const std::vector& data, int32_t offset) - { - double value; - uint64_t floatData = - ((uint64_t)data[offset + 0] << 56) + ((uint64_t)data[offset + 1] << 48) + - ((uint64_t)data[offset + 2] << 40) + ((uint64_t)data[offset + 3] << 32) + - ((uint64_t)data[offset + 4] << 24) + ((uint64_t)data[offset + 5] << 16) + - ((uint64_t)data[offset + 6] << 8) + ((uint64_t)data[offset + 7]); + ((uint64_t)data.at(offset + 0) << 56) + ((uint64_t)data.at(offset + 1) << 48) + + ((uint64_t)data.at(offset + 2) << 40) + ((uint64_t)data.at(offset + 3) << 32) + + ((uint64_t)data.at(offset + 4) << 24) + ((uint64_t)data.at(offset + 5) << 16) + + ((uint64_t)data.at(offset + 6) << 8) + ((uint64_t)data.at(offset + 7)); static_assert(sizeof(uint64_t) == sizeof(double), "expected 64-bit double"); // Checks if the float format on the platform the ZAPD binary is running on supports the // same float format as the object file. diff --git a/tools/ZAPD/ZAPDUtils/Utils/StringHelper.h b/tools/ZAPD/ZAPDUtils/Utils/StringHelper.h index 6c9e54119..2289927d8 100644 --- a/tools/ZAPD/ZAPDUtils/Utils/StringHelper.h +++ b/tools/ZAPD/ZAPDUtils/Utils/StringHelper.h @@ -106,6 +106,13 @@ public: return std::all_of(str.begin(), str.end(), ::isdigit); } + static std::string ToUpper(const std::string& str) + { + std::string buff = str; + std::transform(buff.begin(), buff.end(), buff.begin(), ::toupper); + return buff; + } + static bool IEquals(const std::string& a, const std::string& b) { return std::equal(a.begin(), a.end(), b.begin(), b.end(), diff --git a/tools/ZAPD/docs/zapd_extraction_xml_reference.md b/tools/ZAPD/docs/zapd_extraction_xml_reference.md index b3f5575c1..89ce33a6e 100644 --- a/tools/ZAPD/docs/zapd_extraction_xml_reference.md +++ b/tools/ZAPD/docs/zapd_extraction_xml_reference.md @@ -382,6 +382,13 @@ Useful only for the unused `object_human`'s animation data. - `Name`: Required. Suxffixed by `Skel`. - `Type`: Required. Valid values: `Normal`, `Flex` and `Curve`. - `LimbType`: Required. Valid values: `Standard`, `LOD`, `Skin`, `Curve` and `Legacy`. + - `EnumName`: Optional. The name of `typedef`'d limb enum. + - `LimbNone`: Optional. The name of the limb with index zero in the limb enum. + - `LimbMax`: Optional. The name of the max limb index in the limb enum. + +ZAPD is able to generate a limb enum by itself only if all the required data is provided. Providing some but not all the required data would trigger an error and the execution will halt. + +The required data is providing the `EnumName`, `LimbNone` and `LimbMax` attributes in the `Skeleton` or `LimbTable` node and the `EnumName` attribute in every `Limb` of this skeleton. ※ There are no restrictions in the `Type` and `LimbType` attributes besides the valid values, so any skeleton type can be combined with any limb type. @@ -400,6 +407,11 @@ Useful only for the unused `object_human`'s animation data. - `Name`: Required. Suxffixed by `Skel`. - `LimbType`: Required. Valid values: `Standard`, `LOD`, `Skin`, `Curve` and `Legacy`. - `Count`: Required. Amount of limbs. Integer. + - `EnumName`: Optional. The name of `typedef`'d limb enum. + - `LimbNone`: Optional. The name of the limb with index zero in the limb enum. + - `LimbMax`: Optional. The name of the max limb index in the limb enum. + +See [Skeleton](#skeleton) for info on the limb enum generation. ------------------------- @@ -415,6 +427,9 @@ Useful only for the unused `object_human`'s animation data. - `Name`: Required. Suxffixed by `Limb`. - `LimbType`: Required. Valid values: `Standard`, `LOD`, `Skin`, `Curve` and `Legacy`. + - `EnumName`: Optional. The name used for this limb in the limbs enum. It must be either present in every limb or in none. + +See [Skeleton](#skeleton) for info on the limb enum generation. ------------------------- diff --git a/tools/ZAPDConfigs/MM/ObjectList_MM.txt b/tools/ZAPDConfigs/MM/ObjectList_MM.txt index 5d8968d97..c3848574c 100644 --- a/tools/ZAPDConfigs/MM/ObjectList_MM.txt +++ b/tools/ZAPDConfigs/MM/ObjectList_MM.txt @@ -394,7 +394,7 @@ OBJECT_FALL OBJECT_HANAREYAMA_OBJ OBJECT_CRACE_OBJECT OBJECT_DNQ -OBJECT_OBJECT_UNSET_TOKEIDAI +OBJECT_OBJ_TOKEIDAI OBJECT_EG OBJECT_TRU OBJECT_TRT @@ -534,13 +534,13 @@ OBJECT_MASK_KYOJIN OBJECT_GI_RESERVE_C_01 OBJECT_ZOD OBJECT_KUMO30 -OBJECT_OBJECT_UNSET_YASI +OBJECT_OBJ_YASI OBJECT_MASK_ROMERNY OBJECT_TANRON1 OBJECT_TANRON2 OBJECT_TANRON3 OBJECT_GI_MAGICMUSHROOM -OBJECT_OBJECT_UNSET_CHAN +OBJECT_OBJ_CHAN OBJECT_GI_MASK10 OBJECT_ZOS OBJECT_MASK_POSTHAT @@ -578,7 +578,7 @@ OBJECT_TANRON5 OBJECT_DT OBJECT_GI_MASK03 OBJECT_CHA -OBJECT_OBJECT_UNSET_DINNER +OBJECT_OBJ_DINNER OBJECT_GI_RESERVE_B_01 OBJECT_LASTDAY OBJECT_BAI @@ -597,7 +597,7 @@ OBJECT_GI_SCHEDULE OBJECT_GI_STONEMASK OBJECT_ZORABAND OBJECT_KEPN_KOYA -OBJECT_OBJECT_UNSET_USIYANE +OBJECT_OBJ_USIYANE OBJECT_GI_MASK05 OBJECT_GI_MASK11 OBJECT_GI_MASK20 @@ -607,7 +607,7 @@ OBJECT_MASK_YOFUKASI OBJECT_MASK_MEOTO OBJECT_MASK_DANCER OBJECT_KZSAKU -OBJECT_OBJECT_UNSET_MILK_BIN +OBJECT_OBJ_MILK_BIN OBJECT_RANDOM_OBJ OBJECT_KUJIYA OBJECT_KITAN @@ -625,7 +625,7 @@ OBJECT_SYOTEN OBJECT_MOONEND OBJECT_OB OBJECT_GI_BOTTLE_04 -OBJECT_OBJECT_UNSET_DANPEILIFT +OBJECT_OBJ_DANPEILIFT OBJECT_WDOR01 OBJECT_WDOR02 OBJECT_WDOR03 @@ -640,4 +640,4 @@ OBJECT_GI_MASK22 OBJECT_LBFSHOT OBJECT_FUSEN OBJECT_ENDING_OBJ -OBJECT_GI_MASK13 \ No newline at end of file +OBJECT_GI_MASK13 diff --git a/tools/actorfixer.py b/tools/actorfixer.py index 384821a55..990d67251 100755 --- a/tools/actorfixer.py +++ b/tools/actorfixer.py @@ -344,7 +344,7 @@ animdict = { "func_800C9CEC": "SurfaceType_IsHookshotSurface", "func_800C9D14": "SurfaceType_IsIgnoredByEntities", "func_800C9D50": "SurfaceType_IsIgnoredByProjectiles", - "func_800C9D8C": "SurfaceType_IsConveyor", + "func_800C9D8C": "SurfaceType_GetConveyorType", "func_800C9E18": "SurfaceType_GetConveyorSpeed", "func_800C9E40": "SurfaceType_GetConveyorDirection", "func_800C9E88": "SurfaceType_IsWallDamage", diff --git a/tools/disasm/files.txt b/tools/disasm/files.txt index 8268b1694..9cc4d20fe 100644 --- a/tools/disasm/files.txt +++ b/tools/disasm/files.txt @@ -245,7 +245,7 @@ 0x80096930 : "__osMemcpy", # .data section - 0x800969C0 : "rsp_boot", + 0x800969C0 : "rspboot", 0x80096B20 : "idle", 0x80096B40 : "viconfig", 0x80096B50 : "z_std_dma", @@ -503,7 +503,9 @@ 0x801AAAA0 : "z_construct", # .data section - 0x801AAAB0 : "rsp", + 0x801AAAB0 : "aspMain", + 0x801ABAB0 : "gspS2DEX2.fifo", + 0x801AD370 : "njpgdspMain", 0x801ADE60 : "", 0x801ADEC0 : "z_en_item00", 0x801AE240 : "z_eff_blure", @@ -674,7 +676,11 @@ 0x801E1070 : "code_801A7B10", 0x801E1100 : "audio_init_params", 0x801E1110 : "z_game_over", - 0x801E1180 : "rsp", + 0x801E1180 : "audio_tables", + 0x801E1E80 : "aspMain", + 0x801E2160 : "gspF3DZEX2.NoN.PosLight.fifo", + 0x801E3BB0 : "gspS2DEX2.fifo", + 0x801E3F40 : "njpgdspMain", # .bss section 0x801E3FA0 : "code_801E3FA0", diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index e09e37e46..7bd647b78 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -1075,7 +1075,7 @@ 0x800C9CEC:("SurfaceType_IsHookshotSurface",), 0x800C9D14:("SurfaceType_IsIgnoredByEntities",), 0x800C9D50:("SurfaceType_IsIgnoredByProjectiles",), - 0x800C9D8C:("SurfaceType_IsConveyor",), + 0x800C9D8C:("SurfaceType_GetConveyorType",), 0x800C9DDC:("func_800C9DDC",), 0x800C9E18:("SurfaceType_GetConveyorSpeed",), 0x800C9E40:("SurfaceType_GetConveyorDirection",), @@ -2302,14 +2302,14 @@ 0x8012AA9C:("Quake_Add",), 0x8012AAC0:("Quake_RemoveFromIdx",), 0x8012AB08:("Quake_Calc",), - 0x8012AE68:("Quake2_Init",), - 0x8012AEAC:("Quake2_SetCountdown",), - 0x8012AED4:("Quake2_GetCountdown",), - 0x8012AEE4:("Quake2_GetType",), - 0x8012AEF4:("Quake2_SetType",), - 0x8012AF18:("Quake2_ClearType",), - 0x8012AF38:("Quake2_GetFloorQuake",), - 0x8012AF9C:("Quake2_Update",), + 0x8012AE68:("Distortion_Init",), + 0x8012AEAC:("Distortion_SetCountdown",), + 0x8012AED4:("Distortion_GetCountdown",), + 0x8012AEE4:("Distortion_GetType",), + 0x8012AEF4:("Distortion_SetType",), + 0x8012AF18:("Distortion_ClearType",), + 0x8012AF38:("Distortion_GetUnderwaterCurrentSpeed",), + 0x8012AF9C:("Distortion_Update",), 0x8012BBE8:("Quake_NumActiveQuakes",), 0x8012BC50:("Gfx_SetFog",), 0x8012BD8C:("Gfx_SetFogWithSync",), @@ -2734,13 +2734,13 @@ 0x8013F1D8:("View_WriteScissor",), 0x8013F28C:("View_SyncAndWriteScissor",), 0x8013F2F8:("View_SetScissorForLetterbox",), - 0x8013F3F8:("View_SetQuakeRotation",), - 0x8013F420:("View_SetQuakeScale",), - 0x8013F448:("View_SetQuakeSpeed",), - 0x8013F45C:("View_InitCameraQuake",), - 0x8013F4C0:("View_ClearQuake",), - 0x8013F4F4:("View_SetQuake",), - 0x8013F54C:("View_StepQuake",), + 0x8013F3F8:("View_SetDistortionDirRot",), + 0x8013F420:("View_SetDistortionScale",), + 0x8013F448:("View_SetDistortionSpeed",), + 0x8013F45C:("View_InitDistortion",), + 0x8013F4C0:("View_ClearDistortion",), + 0x8013F4F4:("View_SetDistortion",), + 0x8013F54C:("View_StepDistortion",), 0x8013F6FC:("View_RenderView",), 0x8013F748:("View_RenderToPerspectiveMatrix",), 0x8013FA1C:("View_RenderToOrthographicMatrix",), @@ -3555,7 +3555,7 @@ 0x8018B4F8:("func_8018B4F8",), 0x8018B520:("func_8018B520",), 0x8018B578:("func_8018B578",), - 0x8018B5D0:("func_8018B5D0",), + 0x8018B5D0:("AudioHeap_AllocDmaMemory",), 0x8018B608:("func_8018B608",), 0x8018B640:("func_8018B640",), 0x8018B69C:("func_8018B69C",), @@ -3604,7 +3604,7 @@ 0x8018EB60:("func_8018EB60",), 0x8018EC4C:("func_8018EC4C",), 0x8018EF88:("func_8018EF88",), - 0x8018F220:("func_8018F220",), + 0x8018F220:("AudioLoad_IsFontLoadComplete",), 0x8018F298:("func_8018F298",), 0x8018F310:("func_8018F310",), 0x8018F388:("func_8018F388",), @@ -3726,37 +3726,37 @@ 0x80194804:("func_80194804",), 0x80194840:("func_80194840",), 0x801948B0:("func_801948B0",), - 0x80194930:("func_80194930",), - 0x80194DB0:("func_80194DB0",), - 0x80194E60:("func_80194E60",), - 0x80194F20:("func_80194F20",), - 0x80194F84:("func_80194F84",), - 0x801954CC:("func_801954CC",), - 0x80195508:("func_80195508",), - 0x801955DC:("func_801955DC",), - 0x801956C0:("func_801956C0",), - 0x801957B4:("func_801957B4",), - 0x801958F8:("func_801958F8",), - 0x80195C40:("func_80195C40",), - 0x80195C60:("func_80195C60",), - 0x80195C80:("func_80195C80",), - 0x80195D84:("func_80195D84",), - 0x80195DDC:("func_80195DDC",), - 0x80195DEC:("func_80195DEC",), - 0x80195E3C:("func_80195E3C",), - 0x80195EE0:("func_80195EE0",), - 0x80196040:("func_80196040",), - 0x8019617C:("func_8019617C",), - 0x801961BC:("func_801961BC",), - 0x801961E8:("func_801961E8",), - 0x80196268:("func_80196268",), + 0x80194930:("AudioPlayback_InitNoteSub",), + 0x80194DB0:("AudioPlayback_NoteSetResamplingRate",), + 0x80194E60:("AudioPlayback_NoteInit",), + 0x80194F20:("AudioPlayback_NoteDisable",), + 0x80194F84:("AudioPlayback_ProcessNotes",), + 0x801954CC:("AudioPlayback_InstrumentGetSound",), + 0x80195508:("AudioPlayback_GetInstrumentInner",), + 0x801955DC:("AudioPlayback_GetDrum",), + 0x801956C0:("AudioPlayback_GetSfx",), + 0x801957B4:("AudioPlayback_SetFontInstrument",), + 0x801958F8:("AudioPlayback_SeqLayerDecayRelease",), + 0x80195C40:("AudioPlayback_SeqLayerNoteDecay",), + 0x80195C60:("AudioPlayback_SeqLayerNoteRelease",), + 0x80195C80:("AudioPlayback_BuildSyntheticWave",), + 0x80195D84:("AudioPlayback_InitSyntheticWave",), + 0x80195DDC:("AudioPlayback_InitNoteList",), + 0x80195DEC:("AudioPlayback_InitNoteLists",), + 0x80195E3C:("AudioPlayback_InitNoteFreeList",), + 0x80195EE0:("AudioPlayback_NotePoolClear",), + 0x80196040:("AudioPlayback_NotePoolFill",), + 0x8019617C:("AudioPlayback_AudioListPushFront",), + 0x801961BC:("AudioPlayback_AudioListRemove",), + 0x801961E8:("AudioPlayback_FindNodeWithPrioLessThan",), + 0x80196268:("AudioPlayback_NoteInitForLayer",), 0x801963E8:("func_801963E8",), - 0x8019641C:("func_8019641C",), - 0x80196448:("func_80196448",), - 0x80196494:("func_80196494",), - 0x801964F8:("func_801964F8",), - 0x801965F0:("func_801965F0",), - 0x801968C4:("func_801968C4",), + 0x8019641C:("AudioPlayback_NoteReleaseAndTakeOwnership",), + 0x80196448:("AudioPlayback_AllocNoteFromDisabled",), + 0x80196494:("AudioPlayback_AllocNoteFromDecaying",), + 0x801964F8:("AudioPlayback_AllocNoteFromActive",), + 0x801965F0:("AudioPlayback_AllocNote",), + 0x801968C4:("AudioPlayback_NoteInitAll",), 0x80196A00:("AudioEffects_SequenceChannelProcessSound",), 0x80196BC8:("AudioEffects_SequencePlayerProcessSound",), 0x80196D20:("AudioEffects_GetPortamentoFreqScale",), @@ -3773,14 +3773,14 @@ 0x80197880:("func_80197880",), 0x801979D8:("func_801979D8",), 0x80197A54:("func_80197A54",), - 0x80197AA4:("func_80197AA4",), + 0x80197AA4:("AudioSeq_SequenceChannelDisable",), 0x80197B14:("func_80197B14",), 0x80197C0C:("func_80197C0C",), 0x80197C8C:("func_80197C8C",), 0x80197D24:("func_80197D24",), 0x80197D4C:("AudioSeq_SequencePlayerDisable",), - 0x80197E08:("func_80197E08",), - 0x80197E48:("func_80197E48",), + 0x80197E08:("AudioSeq_AudioListPushBack",), + 0x80197E48:("AudioSeq_AudioListPopBack",), 0x80197E88:("func_80197E88",), 0x80197F28:("func_80197F28",), 0x80197F3C:("func_80197F3C",), @@ -6864,32 +6864,32 @@ 0x8090C884:("EnFishing_OwnerOverrideLimbDraw",), 0x8090C8BC:("EnFishing_OwnerPostLimbDraw",), 0x8090C96C:("EnFishing_DrawOwner",), - 0x80917290:("func_80917290",), - 0x809172E4:("func_809172E4",), - 0x8091734C:("func_8091734C",), - 0x80917378:("func_80917378",), - 0x80917408:("func_80917408",), - 0x80917538:("func_80917538",), - 0x80917604:("func_80917604",), - 0x8091763C:("func_8091763C",), - 0x8091768C:("func_8091768C",), + 0x80917290:("ObjOshihiki_RotateXZ",), + 0x809172E4:("ObjOshihiki_StrongEnough",), + 0x8091734C:("ObjOshihiki_ResetFloors",), + 0x80917378:("ObjOshihiki_GetBlockUnder",), + 0x80917408:("ObjOshihiki_UpdateInitPos",), + 0x80917538:("ObjOshihiki_NoSwitchPress",), + 0x80917604:("ObjOshihiki_SetScale",), + 0x8091763C:("ObjOshihiki_SetTextureStep",), + 0x8091768C:("ObjOshihiki_SetColor",), 0x809176D0:("ObjOshihiki_Init",), 0x8091780C:("ObjOshihiki_Destroy",), - 0x80917840:("func_80917840",), - 0x809179A0:("func_809179A0",), - 0x80917AEC:("func_80917AEC",), - 0x80917B44:("func_80917B44",), - 0x80917B9C:("func_80917B9C",), - 0x80917C14:("func_80917C14",), - 0x80917E8C:("func_80917E8C",), - 0x80917F88:("func_80917F88",), - 0x80917FC0:("func_80917FC0",), - 0x809180C8:("func_809180C8",), - 0x80918108:("func_80918108",), - 0x80918314:("func_80918314",), - 0x8091834C:("func_8091834C",), - 0x8091851C:("func_8091851C",), - 0x80918574:("func_80918574",), + 0x80917840:("ObjOshihiki_SetFloors",), + 0x809179A0:("ObjOshihiki_GetHighestFloor",), + 0x80917AEC:("ObjOshihiki_SetGround",), + 0x80917B44:("ObjOshihiki_CheckFloor",), + 0x80917B9C:("ObjOshihiki_CheckGround",), + 0x80917C14:("ObjOshihiki_CheckWall",), + 0x80917E8C:("ObjOshihiki_MoveWithBlockUnder",), + 0x80917F88:("ObjOshihiki_SetupOnScene",), + 0x80917FC0:("ObjOshihiki_OnScene",), + 0x809180C8:("ObjOshihiki_SetupOnActor",), + 0x80918108:("ObjOshihiki_OnActor",), + 0x80918314:("ObjOshihiki_SetupPush",), + 0x8091834C:("ObjOshihiki_Push",), + 0x8091851C:("ObjOshihiki_SetupFall",), + 0x80918574:("ObjOshihiki_Fall",), 0x80918678:("ObjOshihiki_Update",), 0x80918700:("ObjOshihiki_Draw",), 0x80918B40:("func_80918B40",), @@ -8615,20 +8615,20 @@ 0x8099D7DC:("OceffWipe4_Destroy",), 0x8099D810:("OceffWipe4_Update",), 0x8099D870:("OceffWipe4_Draw",), - 0x8099E790:("func_8099E790",), - 0x8099E858:("func_8099E858",), - 0x8099E96C:("func_8099E96C",), - 0x8099E9E0:("func_8099E9E0",), - 0x8099EA60:("func_8099EA60",), - 0x8099EBD8:("func_8099EBD8",), - 0x8099EC50:("func_8099EC50",), - 0x8099ED4C:("func_8099ED4C",), - 0x8099EE24:("func_8099EE24",), + 0x8099E790:("EnZo_SetAnimation",), + 0x8099E858:("EnZo_PlayWalkingSound",), + 0x8099E96C:("EnZo_Blink",), + 0x8099E9E0:("EnZo_UpdateCollider",), + 0x8099EA60:("EnZo_LookAtPlayer",), + 0x8099EBD8:("EnZo_Walk",), + 0x8099EC50:("EnZo_FollowPath",), + 0x8099ED4C:("EnZo_TreadWater",), + 0x8099EE24:("EnZo_DoNothing",), 0x8099EE34:("EnZo_Init",), 0x8099EF40:("EnZo_Destroy",), 0x8099EF6C:("EnZo_Update",), - 0x8099EFF4:("func_8099EFF4",), - 0x8099F15C:("func_8099F15C",), + 0x8099EFF4:("EnZo_OverrideLimbDraw",), + 0x8099F15C:("EnZo_PostLimbDraw",), 0x8099F268:("EnZo_Draw",), 0x8099F730:("EffectSsIceSmoke_Init",), 0x8099F7F4:("EffectSsIceSmoke_Draw",), @@ -10920,7 +10920,7 @@ 0x80A6CD38:("EnFall_ClockTowerOrTitleScreenMoon_PerformCutsceneActions",), 0x80A6CD74:("EnFall_Moon_PerformDefaultActions",), 0x80A6CECC:("EnFall_MoonsTear_Initialize",), - 0x80A6CF60:("EnFall_DoNothing",), + 0x80A6CF60:("EnFall_MoonsTear_DoNothing",), 0x80A6CF70:("EnFall_MoonsTear_Fall",), 0x80A6D0DC:("EnFall_Update",), 0x80A6D100:("EnFall_FireBall_SetPerVertexAlpha",), @@ -11667,24 +11667,24 @@ 0x80AB2544:("DmChar09_Update",), 0x80AB25D8:("func_80AB25D8",), 0x80AB261C:("DmChar09_Draw",), - 0x80AB2790:("ObjTokeidai_GetTargetSunMoonDiskRotation",), - 0x80AB27B4:("ObjTokeidai_SetupClockOrGear",), + 0x80AB2790:("ObjTokeidai_GetTargetSunMoonPanelRotation",), + 0x80AB27B4:("ObjTokeidai_SetupClockOrExteriorGear",), 0x80AB2834:("ObjTokeidai_Clock_Init",), - 0x80AB28C8:("ObjTokeidai_TowerGear_Init",), + 0x80AB28C8:("ObjTokeidai_ExteriorGear_Init",), 0x80AB29F8:("ObjTokeidai_TowerClock_Init",), 0x80AB2BBC:("ObjTokeidai_Counterweight_Init",), 0x80AB2DEC:("ObjTokeidai_Init",), 0x80AB3000:("ObjTokeidai_Destroy",), 0x80AB3010:("ObjTokeidai_RotateOnMinuteChange",), - 0x80AB319C:("ObjTokeidai_TowerGear_Collapse",), - 0x80AB3240:("ObjTokeidai_TowerGear_OpenedIdle",), + 0x80AB319C:("ObjTokeidai_ExteriorGear_Collapse",), + 0x80AB3240:("ObjTokeidai_ExteriorGear_OpenedIdle",), 0x80AB32F0:("ObjTokeidai_TowerClock_Fall",), 0x80AB3370:("ObjTokeidai_TowerClock_SlideOff",), 0x80AB34CC:("ObjTokeidai_TowerClock_OpenedIdle",), 0x80AB3544:("ObjTokeidai_Counterweight_Collapse",), 0x80AB3598:("ObjTokeidai_Counterweight_OpenedIdle",), - 0x80AB363C:("ObjTokeidai_Walls_Collapse",), - 0x80AB365C:("ObjTokeidai_Walls_Idle",), + 0x80AB363C:("ObjTokeidai_TerminaFieldWalls_Collapse",), + 0x80AB365C:("ObjTokeidai_TerminaFieldWalls_Idle",), 0x80AB36C4:("ObjTokeidai_TowerTransformation_EndCutscene",), 0x80AB3808:("ObjTokeidai_TowerOpening_FinishOpening",), 0x80AB3880:("ObjTokeidai_TowerOpening_Wait",), @@ -11694,18 +11694,18 @@ 0x80AB3B34:("ObjTokeidai_TowerOpening_Start",), 0x80AB3BB0:("ObjTokeidai_SetupTowerOpening",), 0x80AB3BD8:("ObjTokeidai_DoNothing",), - 0x80AB3BE8:("ObjTokeidai_StaircaseIntoTower_Idle",), + 0x80AB3BE8:("ObjTokeidai_StaircaseToRooftop_Idle",), 0x80AB3C50:("ObjTokeidai_IsPostFirstCycleFinalHours",), 0x80AB3CCC:("ObjTokeidai_RotateOnHourChange",), 0x80AB3ED0:("ObjTokeidai_TowerClock_Idle",), 0x80AB4040:("ObjTokeidai_WallClock_Idle",), - 0x80AB4080:("ObjTokeidai_TowerGear_Idle",), + 0x80AB4080:("ObjTokeidai_ExteriorGear_Idle",), 0x80AB4160:("ObjTokeidai_Counterweight_Idle",), 0x80AB4278:("ObjTokeidai_Update",), 0x80AB429C:("ObjTokeidai_Draw",), 0x80AB4394:("ObjTokeidai_Clock_Draw",), 0x80AB4664:("ObjTokeidai_Counterweight_Draw",), - 0x80AB4894:("ObjTokeidai_TowerGear_Draw",), + 0x80AB4894:("ObjTokeidai_ExteriorGear_Draw",), 0x80AB4D10:("func_80AB4D10",), 0x80AB4E34:("func_80AB4E34",), 0x80AB4E58:("func_80AB4E58",), @@ -11912,33 +11912,33 @@ 0x80AC24A8:("func_80AC24A8",), 0x80AC26F0:("EnBigokuta_Init",), 0x80AC2874:("EnBigokuta_Destroy",), - 0x80AC28B4:("func_80AC28B4",), - 0x80AC299C:("func_80AC299C",), - 0x80AC2A1C:("func_80AC2A1C",), - 0x80AC2A7C:("func_80AC2A7C",), + 0x80AC28B4:("EnBigokuta_SetupCutsceneCamera",), + 0x80AC299C:("EnBigokuta_MoveCamera",), + 0x80AC2A1C:("EnBigokuta_ResetCamera",), + 0x80AC2A7C:("EnBigokuta_ShootPlayer",), 0x80AC2B4C:("func_80AC2B4C",), - 0x80AC2B98:("func_80AC2B98",), - 0x80AC2C30:("func_80AC2C30",), - 0x80AC2C84:("func_80AC2C84",), - 0x80AC2CE8:("func_80AC2CE8",), - 0x80AC2DAC:("func_80AC2DAC",), - 0x80AC2EBC:("func_80AC2EBC",), - 0x80AC2F20:("func_80AC2F20",), - 0x80AC2F64:("func_80AC2F64",), - 0x80AC3054:("func_80AC3054",), - 0x80AC30EC:("func_80AC30EC",), - 0x80AC31EC:("func_80AC31EC",), - 0x80AC33A4:("func_80AC33A4",), - 0x80AC33C0:("func_80AC33C0",), - 0x80AC3460:("func_80AC3460",), - 0x80AC34A8:("func_80AC34A8",), - 0x80AC35E8:("func_80AC35E8",), - 0x80AC3650:("func_80AC3650",), - 0x80AC3930:("func_80AC3930",), - 0x80AC39A0:("func_80AC39A0",), + 0x80AC2B98:("EnBigokuta_IsInWater",), + 0x80AC2C30:("EnBigokuta_SpawnRipple",), + 0x80AC2C84:("EnBigokuta_SetupIdle",), + 0x80AC2CE8:("EnBigokuta_Idle",), + 0x80AC2DAC:("EnBigokuta_SetupRise",), + 0x80AC2EBC:("EnBigokuta_RiseOutOfWater",), + 0x80AC2F20:("EnBigokuta_SetupIdleAboveWater",), + 0x80AC2F64:("EnBigokuta_IdleAboveWater",), + 0x80AC3054:("EnBigokuta_UpdateOrSetupCam",), + 0x80AC30EC:("EnBigokuta_SetupSuckInPlayer",), + 0x80AC31EC:("EnBigokuta_SuckInPlayer",), + 0x80AC33A4:("EnBigokuta_SetupHoldPlayer",), + 0x80AC33C0:("EnBigokuta_HoldPlayer",), + 0x80AC3460:("EnBigokuta_SetupDeathCutscene",), + 0x80AC34A8:("EnBigokuta_PlayDeathCutscene",), + 0x80AC35E8:("EnBigokuta_SetupDeathEffects",), + 0x80AC3650:("EnBigokuta_PlayDeathEffects",), + 0x80AC3930:("EnBigokuta_IsNearSwampBoat",), + 0x80AC39A0:("EnBigokuta_CheckOneHitKill",), 0x80AC3B2C:("EnBigokuta_Update",), - 0x80AC3D48:("func_80AC3D48",), - 0x80AC4204:("func_80AC4204",), + 0x80AC3D48:("EnBigokuta_OverrideLimbDraw",), + 0x80AC4204:("EnBigokuta_PostLimbDraw",), 0x80AC42F8:("EnBigokuta_Draw",), 0x80AC48F0:("BgIcefloe_Init",), 0x80AC4A04:("BgIcefloe_Destroy",), @@ -12206,9 +12206,9 @@ 0x80AD5150:("EnTrt2_Update",), 0x80AD5234:("func_80AD5234",), 0x80AD5394:("func_80AD5394",), - 0x80AD54C8:("func_80AD54C8",), - 0x80AD5584:("func_80AD5584",), - 0x80AD566C:("func_80AD566C",), + 0x80AD54C8:("EnTrt2_OverrideLimbDraw",), + 0x80AD5584:("EnTrt2_PostLimbDraw",), + 0x80AD566C:("EnTrt2_UnkDraw",), 0x80AD56E8:("func_80AD56E8",), 0x80AD5BB0:("ObjTokeiStep_SetSysMatrix",), 0x80AD5BE8:("ObjTokeiStep_AddQuake",), @@ -15641,9 +15641,9 @@ 0x80BCC508:("EnScopenuts_Init",), 0x80BCC77C:("EnScopenuts_Destroy",), 0x80BCC7A8:("EnScopenuts_Update",), - 0x80BCC828:("func_80BCC828",), - 0x80BCC9CC:("func_80BCC9CC",), - 0x80BCC9E4:("func_80BCC9E4",), + 0x80BCC828:("EnScopenuts_OverrideLimbDraw",), + 0x80BCC9CC:("EnScopenuts_PostLimbDraw",), + 0x80BCC9E4:("EnScopenuts_TransformLimbDraw",), 0x80BCCAAC:("EnScopenuts_Draw",), 0x80BCD000:("func_80BCD000",), 0x80BCD09C:("func_80BCD09C",), @@ -16618,10 +16618,10 @@ 0x80C08950:("EnNnh_Draw",), 0x80C08A80:("ObjKzsaku_Init",), 0x80C08B2C:("ObjKzsaku_Destroy",), - 0x80C08B60:("func_80C08B60",), - 0x80C08B7C:("func_80C08B7C",), + 0x80C08B60:("ObjKzsaku_SetupIdle",), + 0x80C08B7C:("ObjKzsaku_Idle",), 0x80C08BBC:("func_80C08BBC",), - 0x80C08BD0:("func_80C08BD0",), + 0x80C08BD0:("ObjKzsaku_Rise",), 0x80C08C84:("func_80C08C84",), 0x80C08CB0:("func_80C08CB0",), 0x80C08D20:("ObjKzsaku_Update",), @@ -17046,8 +17046,8 @@ 0x80C21468:("func_80C21468",), 0x80C215E4:("func_80C215E4",), 0x80C21790:("EnHintSkb_Update",), - 0x80C21858:("func_80C21858",), - 0x80C219D4:("func_80C219D4",), + 0x80C21858:("EnHintSkb_OverrideLimbDraw",), + 0x80C219D4:("EnHintSkb_PostLimbDraw",), 0x80C21B9C:("EnHintSkb_Draw",), 0x80C22350:("func_80C22350",), 0x80C22400:("func_80C22400",), diff --git a/tools/disasm/variables.txt b/tools/disasm/variables.txt index 520a9f04c..49823cee3 100644 --- a/tools/disasm/variables.txt +++ b/tools/disasm/variables.txt @@ -72,7 +72,7 @@ 0x80097FA0:("D_80097FA0","UNK_TYPE1","",0x1), 0x80097FA4:("D_80097FA4","UNK_TYPE1","",0x1), 0x80097FA5:("D_80097FA5","UNK_TYPE1","",0x1), - 0x80097FB0:("D_80097FB0","UNK_TYPE4","",0x4), + 0x80097FB0:("__osPfsLastChannel","s32","",0x4), 0x80097FC0:("osViModeNtscLan1","OSViMode","",0x50), 0x80098010:("osViModeMpalLan1","OSViMode","",0x50), 0x80098060:("D_80098060","__OSViContext","[2]",0x60), @@ -365,9 +365,9 @@ 0x8009F8A0:("viRetrace","u16","",0x2), 0x8009F8B0:("dmadata","DmaEntry","[1568]",0x6200), 0x80186028:("D_80186028","s16","[1316]",0xa48), - 0x801AAAB0:("D_801AAAB0","UNK_TYPE1","",0x1), - 0x801ABAB0:("D_801ABAB0","UNK_TYPE1","",0x1), - 0x801AD370:("gJpegUCode","UNK_TYPE1","",0x1), + 0x801AAAB0:("aspMainTextStart","UNK_TYPE1","",0x1), + 0x801ABAB0:("gspS2DEX2_fifoTextStart","UNK_TYPE1","",0x1), + 0x801AD370:("njpgdspMainTextStart","UNK_TYPE1","",0x1), 0x801ADE60:("En_A_Obj_InitVars","ActorInit","",0x20), 0x801ADE80:("enAObjCylinderInit","ColliderCylinderInit","",0x2c), 0x801ADEAC:("enAObjInitVar","ActorInitVar","",0x4), @@ -2253,14 +2253,14 @@ 0x801D57B4:("D_801D57B4","UNK_TYPE1","",0x1), 0x801D57C4:("D_801D57C4","UNK_TYPE1","",0x1), 0x801D57D4:("D_801D57D4","UNK_TYPE1","",0x1), - 0x801D57E4:("D_801D57E4","UNK_TYPE4","",0x4), - 0x801D5804:("D_801D5804","UNK_TYPE4","",0x4), - 0x801D5824:("D_801D5824","UNK_TYPE2","",0x2), + 0x801D57E4:("gZeroNoteSub","UNK_TYPE4","",0x4), + 0x801D5804:("gDefaultNoteSub","UNK_TYPE4","",0x4), + 0x801D5824:("gHeadsetPanQuantization","UNK_TYPE2","",0x2), 0x801D58A2:("D_801D58A2","UNK_TYPE2","",0x2), 0x801D58AA:("D_801D58AA","UNK_TYPE1","",0x1), - 0x801D5928:("D_801D5928","f32","[128]",0x200), - 0x801D5B28:("D_801D5B28","f32","[128]",0x200), - 0x801D5D28:("D_801D5D28","f32","[128]",0x200), + 0x801D5928:("gHeadsetPanVolume","f32","[128]",0x200), + 0x801D5B28:("gStereoPanVolume","f32","[128]",0x200), + 0x801D5D28:("gDefaultPanVolume","f32","[128]",0x200), 0x801D5F28:("D_801D5F28","s16","[64]",0x80), 0x801D5FB0:("D_801D5FB0","UNK_TYPE4","",0x4), 0x801D5FB4:("D_801D5FB4","UNK_TYPE4","",0x4), @@ -3856,15 +3856,15 @@ 0x801E1104:("gAudioContextInitSizes","AudioContextInitSizes","",0xC), 0x801E1110:("sGameOverTimer","UNK_TYPE2","",0x2), 0x801E1120:("jtbl_801E1120","UNK_PTR","",0x4), - 0x801E1180:("D_801E1180","UNK_TYPE2","",0x2), - 0x801E1420:("D_801E1420","UNK_TYPE1","",0x1), - 0x801E1630:("D_801E1630","UNK_TYPE2","",0x2), - 0x801E1E40:("D_801E1E40","UNK_TYPE1","",0x1), - 0x801E1E80:("D_801E1E80","UNK_TYPE1","",0x1), - 0x801E2160:("gspF3DEX2_NoN_fifoTextStart","UNK_TYPE1","",0x1), - 0x801E3790:("gspF3DEX2_NoN_fifoDataStart","UNK_TYPE1","",0x1), - 0x801E3BB0:("D_801E3BB0","UNK_TYPE1","",0x1), - 0x801E3F40:("gJpegUCodeData","UNK_TYPE1","",0x1), + 0x801E1180:("gSoundFontTable","UNK_TYPE2","",0x2), + 0x801E1420:("gSequenceFontTable","UNK_TYPE1","",0x1), + 0x801E1630:("gSequenceTable","UNK_TYPE2","",0x2), + 0x801E1E40:("gSampleBankTable","UNK_TYPE1","",0x1), + 0x801E1E80:("aspMainDataStart","UNK_TYPE1","",0x2E0), + 0x801E2160:("gspF3DZEX2_NoN_PosLight_fifoTextStart","UNK_TYPE1","",0x1), + 0x801E3790:("gspF3DZEX2_NoN_PosLight_fifoDataStart","UNK_TYPE1","",0x1), + 0x801E3BB0:("gspS2DEX2_fifoDataStart","UNK_TYPE1","",0x1), + 0x801E3F40:("njpgdspMainDataStart","UNK_TYPE1","",0x1), 0x801E3FA0:("D_801E3FA0","UNK_TYPE1","",0x1), 0x801E3FB0:("sEffectContext","EffectContext","",0x98E0), 0x801ED890:("D_801ED890","UNK_TYPE1","",0x1), @@ -4058,7 +4058,7 @@ 0x801F59F4:("D_801F59F4","UNK_TYPE1","",0x1), 0x801F59F8:("D_801F59F8","UNK_TYPE1","",0x1), 0x801F5A00:("sQuakeRequest","QuakeRequest","[4]",0x90), - 0x801F5A90:("sQuake2Context","Quake2Context","",0xc), + 0x801F5A90:("sDistortionContext","DistortionContext","",0xc), 0x801F5AA0:("sMatAnimStep","s32","",0x4), 0x801F5AA4:("sMatAnimFlags","u32","",0x4), 0x801F5AA8:("sMatAnimAlphaRatio","f32","",0x4), diff --git a/tools/sizes/code_functions.csv b/tools/sizes/code_functions.csv index 08093d830..e1e6075fb 100644 --- a/tools/sizes/code_functions.csv +++ b/tools/sizes/code_functions.csv @@ -589,7 +589,7 @@ asm/non_matchings/code/z_bgcheck/SurfaceType_GetEcho.s,SurfaceType_GetEcho,0x800 asm/non_matchings/code/z_bgcheck/SurfaceType_IsHookshotSurface.s,SurfaceType_IsHookshotSurface,0x800C9CEC,0xA asm/non_matchings/code/z_bgcheck/SurfaceType_IsIgnoredByEntities.s,SurfaceType_IsIgnoredByEntities,0x800C9D14,0xF asm/non_matchings/code/z_bgcheck/SurfaceType_IsIgnoredByProjectiles.s,SurfaceType_IsIgnoredByProjectiles,0x800C9D50,0xF -asm/non_matchings/code/z_bgcheck/SurfaceType_IsConveyor.s,SurfaceType_IsConveyor,0x800C9D8C,0x14 +asm/non_matchings/code/z_bgcheck/SurfaceType_GetConveyorType.s,SurfaceType_GetConveyorType,0x800C9D8C,0x14 asm/non_matchings/code/z_bgcheck/func_800C9DDC.s,func_800C9DDC,0x800C9DDC,0xF asm/non_matchings/code/z_bgcheck/SurfaceType_GetConveyorSpeed.s,SurfaceType_GetConveyorSpeed,0x800C9E18,0xA asm/non_matchings/code/z_bgcheck/SurfaceType_GetConveyorDirection.s,SurfaceType_GetConveyorDirection,0x800C9E40,0x12 @@ -1816,14 +1816,14 @@ asm/non_matchings/code/z_quake/Quake_Init.s,Quake_Init,0x8012AA48,0x15 asm/non_matchings/code/z_quake/Quake_Add.s,Quake_Add,0x8012AA9C,0x9 asm/non_matchings/code/z_quake/Quake_RemoveFromIdx.s,Quake_RemoveFromIdx,0x8012AAC0,0x12 asm/non_matchings/code/z_quake/Quake_Calc.s,Quake_Calc,0x8012AB08,0xD8 -asm/non_matchings/code/z_quake/Quake2_Init.s,Quake2_Init,0x8012AE68,0x11 -asm/non_matchings/code/z_quake/Quake2_SetCountdown.s,Quake2_SetCountdown,0x8012AEAC,0xA -asm/non_matchings/code/z_quake/Quake2_GetCountdown.s,Quake2_GetCountdown,0x8012AED4,0x4 -asm/non_matchings/code/z_quake/Quake2_GetType.s,Quake2_GetType,0x8012AEE4,0x4 -asm/non_matchings/code/z_quake/Quake2_SetType.s,Quake2_SetType,0x8012AEF4,0x9 -asm/non_matchings/code/z_quake/Quake2_ClearType.s,Quake2_ClearType,0x8012AF18,0x8 -asm/non_matchings/code/z_quake/Quake2_GetFloorQuake.s,Quake2_GetFloorQuake,0x8012AF38,0x19 -asm/non_matchings/code/z_quake/Quake2_Update.s,Quake2_Update,0x8012AF9C,0x313 +asm/non_matchings/code/z_quake/Distortion_Init.s,Distortion_Init,0x8012AE68,0x11 +asm/non_matchings/code/z_quake/Distortion_SetCountdown.s,Distortion_SetCountdown,0x8012AEAC,0xA +asm/non_matchings/code/z_quake/Distortion_GetCountdown.s,Distortion_GetCountdown,0x8012AED4,0x4 +asm/non_matchings/code/z_quake/Distortion_GetType.s,Distortion_GetType,0x8012AEE4,0x4 +asm/non_matchings/code/z_quake/Distortion_SetType.s,Distortion_SetType,0x8012AEF4,0x9 +asm/non_matchings/code/z_quake/Distortion_ClearType.s,Distortion_ClearType,0x8012AF18,0x8 +asm/non_matchings/code/z_quake/Distortion_GetUnderwaterCurrentSpeed.s,Distortion_GetUnderwaterCurrentSpeed,0x8012AF38,0x19 +asm/non_matchings/code/z_quake/Distortion_Update.s,Distortion_Update,0x8012AF9C,0x313 asm/non_matchings/code/z_quake/Quake_NumActiveQuakes.s,Quake_NumActiveQuakes,0x8012BBE8,0x1A asm/non_matchings/code/z_rcp/Gfx_SetFog.s,Gfx_SetFog,0x8012BC50,0x4F asm/non_matchings/code/z_rcp/Gfx_SetFogWithSync.s,Gfx_SetFogWithSync,0x8012BD8C,0x5F @@ -2248,13 +2248,13 @@ asm/non_matchings/code/z_view/View_GetViewport.s,View_GetViewport,0x8013F1B0,0xA asm/non_matchings/code/z_view/View_WriteScissor.s,View_WriteScissor,0x8013F1D8,0x2D asm/non_matchings/code/z_view/View_SyncAndWriteScissor.s,View_SyncAndWriteScissor,0x8013F28C,0x1B asm/non_matchings/code/z_view/View_SetScissorForLetterbox.s,View_SetScissorForLetterbox,0x8013F2F8,0x40 -asm/non_matchings/code/z_view/View_SetQuakeRotation.s,View_SetQuakeRotation,0x8013F3F8,0xA -asm/non_matchings/code/z_view/View_SetQuakeScale.s,View_SetQuakeScale,0x8013F420,0xA -asm/non_matchings/code/z_view/View_SetQuakeSpeed.s,View_SetQuakeSpeed,0x8013F448,0x5 -asm/non_matchings/code/z_view/View_InitCameraQuake.s,View_InitCameraQuake,0x8013F45C,0x19 -asm/non_matchings/code/z_view/View_ClearQuake.s,View_ClearQuake,0x8013F4C0,0xD -asm/non_matchings/code/z_view/View_SetQuake.s,View_SetQuake,0x8013F4F4,0x16 -asm/non_matchings/code/z_view/View_StepQuake.s,View_StepQuake,0x8013F54C,0x6C +asm/non_matchings/code/z_view/View_SetDistortionDirRot.s,View_SetDistortionDirRot,0x8013F3F8,0xA +asm/non_matchings/code/z_view/View_SetDistortionScale.s,View_SetDistortionScale,0x8013F420,0xA +asm/non_matchings/code/z_view/View_SetDistortionSpeed.s,View_SetDistortionSpeed,0x8013F448,0x5 +asm/non_matchings/code/z_view/View_InitDistortion.s,View_InitDistortion,0x8013F45C,0x19 +asm/non_matchings/code/z_view/View_ClearDistortion.s,View_ClearDistortion,0x8013F4C0,0xD +asm/non_matchings/code/z_view/View_SetDistortion.s,View_SetDistortion,0x8013F4F4,0x16 +asm/non_matchings/code/z_view/View_StepDistortion.s,View_StepDistortion,0x8013F54C,0x6C asm/non_matchings/code/z_view/View_RenderView.s,View_RenderView,0x8013F6FC,0x13 asm/non_matchings/code/z_view/View_RenderToPerspectiveMatrix.s,View_RenderToPerspectiveMatrix,0x8013F748,0xB5 asm/non_matchings/code/z_view/View_RenderToOrthographicMatrix.s,View_RenderToOrthographicMatrix,0x8013FA1C,0x6B @@ -3073,7 +3073,7 @@ asm/non_matchings/code/audio_heap/func_8018B474.s,func_8018B474,0x8018B474,0x21 asm/non_matchings/code/audio_heap/func_8018B4F8.s,func_8018B4F8,0x8018B4F8,0xA asm/non_matchings/code/audio_heap/func_8018B520.s,func_8018B520,0x8018B520,0x16 asm/non_matchings/code/audio_heap/func_8018B578.s,func_8018B578,0x8018B578,0x16 -asm/non_matchings/code/audio_heap/func_8018B5D0.s,func_8018B5D0,0x8018B5D0,0xE +asm/non_matchings/code/audio_heap/AudioHeap_AllocDmaMemory.s,AudioHeap_AllocDmaMemory,0x8018B5D0,0xE asm/non_matchings/code/audio_heap/func_8018B608.s,func_8018B608,0x8018B608,0xE asm/non_matchings/code/audio_heap/func_8018B640.s,func_8018B640,0x8018B640,0x17 asm/non_matchings/code/audio_heap/func_8018B69C.s,func_8018B69C,0x8018B69C,0x13 @@ -3122,7 +3122,7 @@ asm/non_matchings/code/audio_heap/func_8018E8C8.s,func_8018E8C8,0x8018E8C8,0xA6 asm/non_matchings/code/audio_load/func_8018EB60.s,func_8018EB60,0x8018EB60,0x3B asm/non_matchings/code/audio_load/func_8018EC4C.s,func_8018EC4C,0x8018EC4C,0xCF asm/non_matchings/code/audio_load/func_8018EF88.s,func_8018EF88,0x8018EF88,0xA6 -asm/non_matchings/code/audio_load/func_8018F220.s,func_8018F220,0x8018F220,0x1E +asm/non_matchings/code/audio_load/AudioLoad_IsFontLoadComplete.s,AudioLoad_IsFontLoadComplete,0x8018F220,0x1E asm/non_matchings/code/audio_load/func_8018F298.s,func_8018F298,0x8018F298,0x1E asm/non_matchings/code/audio_load/func_8018F310.s,func_8018F310,0x8018F310,0x1E asm/non_matchings/code/audio_load/func_8018F388.s,func_8018F388,0x8018F388,0xC @@ -3244,37 +3244,37 @@ asm/non_matchings/code/code_80194710/func_80194790.s,func_80194790,0x80194790,0x asm/non_matchings/code/code_80194710/func_80194804.s,func_80194804,0x80194804,0xF asm/non_matchings/code/code_80194710/func_80194840.s,func_80194840,0x80194840,0x1C asm/non_matchings/code/code_80194710/func_801948B0.s,func_801948B0,0x801948B0,0x20 -asm/non_matchings/code/audio_playback/func_80194930.s,func_80194930,0x80194930,0x120 -asm/non_matchings/code/audio_playback/func_80194DB0.s,func_80194DB0,0x80194DB0,0x2C -asm/non_matchings/code/audio_playback/func_80194E60.s,func_80194E60,0x80194E60,0x30 -asm/non_matchings/code/audio_playback/func_80194F20.s,func_80194F20,0x80194F20,0x19 -asm/non_matchings/code/audio_playback/func_80194F84.s,func_80194F84,0x80194F84,0x152 -asm/non_matchings/code/audio_playback/func_801954CC.s,func_801954CC,0x801954CC,0xF -asm/non_matchings/code/audio_playback/func_80195508.s,func_80195508,0x80195508,0x35 -asm/non_matchings/code/audio_playback/func_801955DC.s,func_801955DC,0x801955DC,0x39 -asm/non_matchings/code/audio_playback/func_801956C0.s,func_801956C0,0x801956C0,0x3D -asm/non_matchings/code/audio_playback/func_801957B4.s,func_801957B4,0x801957B4,0x51 -asm/non_matchings/code/audio_playback/func_801958F8.s,func_801958F8,0x801958F8,0xD2 -asm/non_matchings/code/audio_playback/func_80195C40.s,func_80195C40,0x80195C40,0x8 -asm/non_matchings/code/audio_playback/func_80195C60.s,func_80195C60,0x80195C60,0x8 -asm/non_matchings/code/audio_playback/func_80195C80.s,func_80195C80,0x80195C80,0x41 -asm/non_matchings/code/audio_playback/func_80195D84.s,func_80195D84,0x80195D84,0x16 -asm/non_matchings/code/audio_playback/func_80195DDC.s,func_80195DDC,0x80195DDC,0x4 -asm/non_matchings/code/audio_playback/func_80195DEC.s,func_80195DEC,0x80195DEC,0x14 -asm/non_matchings/code/audio_playback/func_80195E3C.s,func_80195E3C,0x80195E3C,0x29 -asm/non_matchings/code/audio_playback/func_80195EE0.s,func_80195EE0,0x80195EE0,0x58 -asm/non_matchings/code/audio_playback/func_80196040.s,func_80196040,0x80196040,0x4F -asm/non_matchings/code/audio_playback/func_8019617C.s,func_8019617C,0x8019617C,0x10 -asm/non_matchings/code/audio_playback/func_801961BC.s,func_801961BC,0x801961BC,0xB -asm/non_matchings/code/audio_playback/func_801961E8.s,func_801961E8,0x801961E8,0x20 -asm/non_matchings/code/audio_playback/func_80196268.s,func_80196268,0x80196268,0x60 +asm/non_matchings/code/audio_playback/AudioPlayback_InitNoteSub.s,AudioPlayback_InitNoteSub,0x80194930,0x120 +asm/non_matchings/code/audio_playback/AudioPlayback_NoteSetResamplingRate.s,AudioPlayback_NoteSetResamplingRate,0x80194DB0,0x2C +asm/non_matchings/code/audio_playback/AudioPlayback_NoteInit.s,AudioPlayback_NoteInit,0x80194E60,0x30 +asm/non_matchings/code/audio_playback/AudioPlayback_NoteDisable.s,AudioPlayback_NoteDisable,0x80194F20,0x19 +asm/non_matchings/code/audio_playback/AudioPlayback_ProcessNotes.s,AudioPlayback_ProcessNotes,0x80194F84,0x152 +asm/non_matchings/code/audio_playback/AudioPlayback_InstrumentGetSound.s,AudioPlayback_InstrumentGetSound,0x801954CC,0xF +asm/non_matchings/code/audio_playback/AudioPlayback_GetInstrumentInner.s,AudioPlayback_GetInstrumentInner,0x80195508,0x35 +asm/non_matchings/code/audio_playback/AudioPlayback_GetDrum.s,AudioPlayback_GetDrum,0x801955DC,0x39 +asm/non_matchings/code/audio_playback/AudioPlayback_GetSfx.s,AudioPlayback_GetSfx,0x801956C0,0x3D +asm/non_matchings/code/audio_playback/AudioPlayback_SetFontInstrument.s,AudioPlayback_SetFontInstrument,0x801957B4,0x51 +asm/non_matchings/code/audio_playback/AudioPlayback_SeqLayerDecayRelease.s,AudioPlayback_SeqLayerDecayRelease,0x801958F8,0xD2 +asm/non_matchings/code/audio_playback/AudioPlayback_SeqLayerNoteDecay.s,AudioPlayback_SeqLayerNoteDecay,0x80195C40,0x8 +asm/non_matchings/code/audio_playback/AudioPlayback_SeqLayerNoteRelease.s,AudioPlayback_SeqLayerNoteRelease,0x80195C60,0x8 +asm/non_matchings/code/audio_playback/AudioPlayback_BuildSyntheticWave.s,AudioPlayback_BuildSyntheticWave,0x80195C80,0x41 +asm/non_matchings/code/audio_playback/AudioPlayback_InitSyntheticWave.s,AudioPlayback_InitSyntheticWave,0x80195D84,0x16 +asm/non_matchings/code/audio_playback/AudioPlayback_InitNoteList.s,AudioPlayback_InitNoteList,0x80195DDC,0x4 +asm/non_matchings/code/audio_playback/AudioPlayback_InitNoteLists.s,AudioPlayback_InitNoteLists,0x80195DEC,0x14 +asm/non_matchings/code/audio_playback/AudioPlayback_InitNoteFreeList.s,AudioPlayback_InitNoteFreeList,0x80195E3C,0x29 +asm/non_matchings/code/audio_playback/AudioPlayback_NotePoolClear.s,AudioPlayback_NotePoolClear,0x80195EE0,0x58 +asm/non_matchings/code/audio_playback/AudioPlayback_NotePoolFill.s,AudioPlayback_NotePoolFill,0x80196040,0x4F +asm/non_matchings/code/audio_playback/AudioPlayback_AudioListPushFront.s,AudioPlayback_AudioListPushFront,0x8019617C,0x10 +asm/non_matchings/code/audio_playback/AudioPlayback_AudioListRemove.s,AudioPlayback_AudioListRemove,0x801961BC,0xB +asm/non_matchings/code/audio_playback/AudioPlayback_FindNodeWithPrioLessThan.s,AudioPlayback_FindNodeWithPrioLessThan,0x801961E8,0x20 +asm/non_matchings/code/audio_playback/AudioPlayback_NoteInitForLayer.s,AudioPlayback_NoteInitForLayer,0x80196268,0x60 asm/non_matchings/code/audio_playback/func_801963E8.s,func_801963E8,0x801963E8,0xD -asm/non_matchings/code/audio_playback/func_8019641C.s,func_8019641C,0x8019641C,0xB -asm/non_matchings/code/audio_playback/func_80196448.s,func_80196448,0x80196448,0x13 -asm/non_matchings/code/audio_playback/func_80196494.s,func_80196494,0x80196494,0x19 -asm/non_matchings/code/audio_playback/func_801964F8.s,func_801964F8,0x801964F8,0x3E -asm/non_matchings/code/audio_playback/func_801965F0.s,func_801965F0,0x801965F0,0xB5 -asm/non_matchings/code/audio_playback/func_801968C4.s,func_801968C4,0x801968C4,0x4F +asm/non_matchings/code/audio_playback/AudioPlayback_NoteReleaseAndTakeOwnership.s,AudioPlayback_NoteReleaseAndTakeOwnership,0x8019641C,0xB +asm/non_matchings/code/audio_playback/AudioPlayback_AllocNoteFromDisabled.s,AudioPlayback_AllocNoteFromDisabled,0x80196448,0x13 +asm/non_matchings/code/audio_playback/AudioPlayback_AllocNoteFromDecaying.s,AudioPlayback_AllocNoteFromDecaying,0x80196494,0x19 +asm/non_matchings/code/audio_playback/AudioPlayback_AllocNoteFromActive.s,AudioPlayback_AllocNoteFromActive,0x801964F8,0x3E +asm/non_matchings/code/audio_playback/AudioPlayback_AllocNote.s,AudioPlayback_AllocNote,0x801965F0,0xB5 +asm/non_matchings/code/audio_playback/AudioPlayback_NoteInitAll.s,AudioPlayback_NoteInitAll,0x801968C4,0x4F asm/non_matchings/code/audio_effects/AudioEffects_SequenceChannelProcessSound.s,AudioEffects_SequenceChannelProcessSound,0x80196A00,0x72 asm/non_matchings/code/audio_effects/AudioEffects_SequencePlayerProcessSound.s,AudioEffects_SequencePlayerProcessSound,0x80196BC8,0x56 asm/non_matchings/code/audio_effects/AudioEffects_GetPortamentoFreqScale.s,AudioEffects_GetPortamentoFreqScale,0x80196D20,0x17 @@ -3291,14 +3291,14 @@ asm/non_matchings/code/audio_seqplayer/func_80197714.s,func_80197714,0x80197714, asm/non_matchings/code/audio_seqplayer/func_80197880.s,func_80197880,0x80197880,0x56 asm/non_matchings/code/audio_seqplayer/func_801979D8.s,func_801979D8,0x801979D8,0x1F asm/non_matchings/code/audio_seqplayer/func_80197A54.s,func_80197A54,0x80197A54,0x14 -asm/non_matchings/code/audio_seqplayer/func_80197AA4.s,func_80197AA4,0x80197AA4,0x1C +asm/non_matchings/code/audio_seqplayer/AudioSeq_SequenceChannelDisable.s,AudioSeq_SequenceChannelDisable,0x80197AA4,0x1C asm/non_matchings/code/audio_seqplayer/func_80197B14.s,func_80197B14,0x80197B14,0x3E asm/non_matchings/code/audio_seqplayer/func_80197C0C.s,func_80197C0C,0x80197C0C,0x20 asm/non_matchings/code/audio_seqplayer/func_80197C8C.s,func_80197C8C,0x80197C8C,0x26 asm/non_matchings/code/audio_seqplayer/func_80197D24.s,func_80197D24,0x80197D24,0xA asm/non_matchings/code/audio_seqplayer/AudioSeq_SequencePlayerDisable.s,AudioSeq_SequencePlayerDisable,0x80197D4C,0x2F -asm/non_matchings/code/audio_seqplayer/func_80197E08.s,func_80197E08,0x80197E08,0x10 -asm/non_matchings/code/audio_seqplayer/func_80197E48.s,func_80197E48,0x80197E48,0x10 +asm/non_matchings/code/audio_seqplayer/AudioSeq_AudioListPushBack.s,AudioSeq_AudioListPushBack,0x80197E08,0x10 +asm/non_matchings/code/audio_seqplayer/AudioSeq_AudioListPopBack.s,AudioSeq_AudioListPopBack,0x80197E48,0x10 asm/non_matchings/code/audio_seqplayer/func_80197E88.s,func_80197E88,0x80197E88,0x28 asm/non_matchings/code/audio_seqplayer/func_80197F28.s,func_80197F28,0x80197F28,0x5 asm/non_matchings/code/audio_seqplayer/func_80197F3C.s,func_80197F3C,0x80197F3C,0xE diff --git a/undefined_syms.txt b/undefined_syms.txt index 2d897a3ec..2881bd48e 100644 --- a/undefined_syms.txt +++ b/undefined_syms.txt @@ -211,9 +211,6 @@ D_0200B998 = 0x0200B998; D_04000320 = 0x04000320; D_040003E0 = 0x040003E0; -D_040008D0 = 0x040008D0; -D_04001D00 = 0x04001D00; -D_040021A8 = 0x040021A8; D_040032B0 = 0x040032B0; D_0400CF48 = 0x0400CF48; D_0400CF58 = 0x0400CF58; @@ -382,18 +379,9 @@ D_0400E408 = 0x0400E408; D_0400E410 = 0x0400E410; D_0400E418 = 0x0400E418; D_0400E430 = 0x0400E430; -D_0400EB7C = 0x0400EB7C; -D_0400ED80 = 0x0400ED80; -D_0400E710 = 0x0400E710; -D_04011518 = 0x04011518; -D_040117A8 = 0x040117A8; -D_040118D8 = 0x040118D8; -D_04011BD0 = 0x04011BD0; -D_040127E8 = 0x040127E8; D_04012860 = 0x04012860; D_040128BC = 0x040128BC; D_04014560 = 0x04014560; -D_04014570 = 0x04014570; D_04015DB0 = 0x04015DB0; D_04015FA0 = 0x04015FA0; D_04016360 = 0x04016360; @@ -403,10 +391,7 @@ D_0401A590 = 0x0401A590; D_0401A620 = 0x0401A620; D_0401ACF0 = 0x0401ACF0; D_0401ED00 = 0x0401ED00; -D_0401F740 = 0x0401F740; -D_0401F7C0 = 0x0401F7C0; -D_0401F8C0 = 0x0401F8C0; -D_0401FA40 = 0x0401FA40; +D_0401F0F0 = 0x0401F0F0; D_04020658 = 0x04020658; D_04020BB8 = 0x04020BB8; D_04020D00 = 0x04020D00; @@ -435,13 +420,6 @@ D_04029CB0 = 0x04029CB0; D_04029CF0 = 0x04029CF0; D_04029D20 = 0x04029D20; D_0402AF58 = 0x0402AF58; -D_0402B494 = 0x0402B494; -D_0402C818 = 0x0402C818; -D_0402C890 = 0x0402C890; -D_0402C908 = 0x0402C908; -D_0402C980 = 0x0402C980; -D_0402C9F8 = 0x0402C9F8; -D_0402CA98 = 0x0402CA98; D_0402E510 = 0x0402E510; D_0402E65C = 0x0402E65C; D_0402F028 = 0x0402F028; @@ -453,14 +431,6 @@ D_04035710 = 0x04035710; D_040367B0 = 0x040367B0; D_040377B0 = 0x040377B0; D_04037850 = 0x04037850; -D_040378F0 = 0x040378F0; -D_04037DF0 = 0x04037DF0; -D_040382F0 = 0x040382F0; -D_040387F0 = 0x040387F0; -D_04038CF0 = 0x04038CF0; -D_040391F0 = 0x040391F0; -D_040396F0 = 0x040396F0; -D_04039BF0 = 0x04039BF0; D_0403A0F0 = 0x0403A0F0; D_0403C190 = 0x0403C190; D_0403F230 = 0x0403F230; @@ -482,28 +452,15 @@ D_040549A8 = 0x040549A8; D_04054A90 = 0x04054A90; D_04054C90 = 0x04054C90; D_04054F18 = 0x04054F18; -D_04054F20 = 0x04054F20; -D_04055628 = 0x04055628; D_04058BA0 = 0x04058BA0; D_0405AAB0 = 0x0405AAB0; D_0405AED0 = 0x0405AED0; -D_0405B6F0 = 0x0405B6F0; D_0405BEF0 = 0x0405BEF0; -D_0405C6F0 = 0x0405C6F0; D_0405CEF0 = 0x0405CEF0; D_0405E6F0 = 0x0405E6F0; D_0405F6F0 = 0x0405F6F0; -D_0405F7C0 = 0x0405F7C0; D_0405FFC0 = 0x0405FFC0; -D_040607C0 = 0x040607C0; -D_04060FC0 = 0x04060FC0; D_040617C0 = 0x040617C0; -D_04061FC0 = 0x04061FC0; -D_04061FE0 = 0x04061FE0; -D_04062000 = 0x04062000; -D_04062020 = 0x04062020; -D_04062040 = 0x04062040; -D_04062060 = 0x04062060; D_040622C0 = 0x040622C0; D_0406A800 = 0x0406A800; D_0406AB30 = 0x0406AB30; @@ -536,13 +493,7 @@ D_04081628 = 0x04081628; D_04083534 = 0x04083534; D_04085640 = 0x04085640; D_0408DBE0 = 0x0408DBE0; -D_0408DFE0 = 0x0408DFE0; -D_0408E3E0 = 0x0408E3E0; -D_0408E7E0 = 0x0408E7E0; D_0408EBE0 = 0x0408EBE0; -D_0408EFE0 = 0x0408EFE0; -D_0408F3E0 = 0x0408F3E0; -D_0408F7E0 = 0x0408F7E0; D_04091BE0 = 0x04091BE0; D_04091CE0 = 0x04091CE0; D_04091DE0 = 0x04091DE0; @@ -552,7 +503,6 @@ D_040923E0 = 0x040923E0; // segment 0x05 -D_05000C40 = 0x05000C40; D_05001D20 = 0x05001D20; D_05002FA0 = 0x05002FA0; D_050061E8 = 0x050061E8; @@ -560,16 +510,12 @@ D_05006420 = 0x05006420; D_050066B0 = 0x050066B0; D_05006760 = 0x05006760; D_05007498 = 0x05007498; -D_05007890 = 0x05007890; D_050078A0 = 0x050078A0; D_05007938 = 0x05007938; -D_05007980 = 0x05007980; D_05007E00 = 0x05007E00; D_05008018 = 0x05008018; D_050085F0 = 0x050085F0; D_050089D0 = 0x050089D0; -D_05017EA0 = 0x05017EA0; -D_05018090 = 0x05018090; D_050182A8 = 0x050182A8; D_0501B370 = 0x0501B370; D_0501B508 = 0x0501B508; @@ -577,8 +523,6 @@ D_0501BEE0 = 0x0501BEE0; D_0501BFB8 = 0x0501BFB8; D_0501C058 = 0x0501C058; D_0501C118 = 0x0501C118; -D_0501D980 = 0x0501D980; -D_050219E0 = 0x050219E0; D_05021EF0 = 0x05021EF0; D_05023008 = 0x05023008; D_0502324C = 0x0502324C; @@ -588,8 +532,6 @@ D_0502324C = 0x0502324C; // code D_06001254 = 0x06001254; -D_06001290 = 0x06001290; -D_06001470 = 0x06001470; D_06001C60 = 0x06001C60; D_06007390 = 0x06007390; D_06008AA0 = 0x06008AA0; @@ -609,6 +551,7 @@ D_06012A80 = 0x06012A80; D_06013138 = 0x06013138; // z_en_hy.c + D_0600007C = 0x0600007C; D_0600066C = 0x0600066C; D_0600071C = 0x0600071C; @@ -626,10 +569,6 @@ D_0600FC1C = 0x0600FC1C; D_0600FEE4 = 0x0600FEE4; D_06010330 = 0x06010330; -// ovl_Arms_Hook - -D_0601D960 = 0x0601D960; - // ovl_Bg_Astr_Bombwall D_06002178 = 0x06002178; @@ -652,26 +591,6 @@ D_06000C98 = 0x06000C98; D_060003A0 = 0x060003A0; D_06000E00 = 0x06000E00; -// ovl_Bg_Ctower_Gear - -D_06010828 = 0x06010828; -D_06015F30 = 0x06015F30; -D_060160A0 = 0x060160A0; -D_06016E70 = 0x06016E70; -D_06017018 = 0x06017018; -D_06018118 = 0x06018118; -D_06018588 = 0x06018588; - -// ovl_Bg_Ctower_Rot - -D_060129D0 = 0x060129D0; -D_06012DA0 = 0x06012DA0; -D_060142E8 = 0x060142E8; -D_06017220 = 0x06017220; -D_06017410 = 0x06017410; -D_060174E0 = 0x060174E0; -D_06017650 = 0x06017650; - // ovl_Bg_Dblue_Balance D_0600CD10 = 0x0600CD10; @@ -739,40 +658,18 @@ D_06003E80 = 0x06003E80; D_06000040 = 0x06000040; -// ovl_Bg_Fu_Kaiten - -D_060005D0 = 0x060005D0; -D_06002D30 = 0x06002D30; - // ovl_Bg_Fu_Mizu D_06002FC0 = 0x06002FC0; D_060037D8 = 0x060037D8; D_060037F8 = 0x060037F8; -// ovl_Bg_Goron_Oyu - -D_06000080 = 0x06000080; -D_06000158 = 0x06000158; -D_06000968 = 0x06000968; -D_06000988 = 0x06000988; - // ovl_Bg_Haka_Bombwall D_06000040 = 0x06000040; D_06000148 = 0x06000148; D_06001680 = 0x06001680; -// ovl_Bg_Haka_Curtain - -D_06001410 = 0x06001410; -D_06001588 = 0x06001588; - -// ovl_Bg_Haka_Tomb - -D_060007B0 = 0x060007B0; -D_06000EE8 = 0x06000EE8; - // ovl_Bg_Hakugin_Bombwall D_06009830 = 0x06009830; @@ -782,15 +679,6 @@ D_06009830 = 0x06009830; D_0600ACB8 = 0x0600ACB8; D_0600BF40 = 0x0600BF40; -// ovl_Bg_Hakugin_Post - -D_0600D3B0 = 0x0600D3B0; -D_0600C1A8 = 0x0600C1A8; -D_0600C568 = 0x0600C568; -D_0600CA38 = 0x0600CA38; -D_0600CEC8 = 0x0600CEC8; -D_0600D098 = 0x0600D098; - // ovl_Bg_Hakugin_Switch D_06000268 = 0x06000268; @@ -801,11 +689,6 @@ D_060005C8 = 0x060005C8; D_060001E0 = 0x060001E0; D_06000C90 = 0x06000C90; -// ovl_Bg_Icicle - -D_060000D0 = 0x060000D0; -D_06000294 = 0x06000294; - // ovl_Bg_Ikana_Bombwall D_06000128 = 0x06000128; @@ -826,11 +709,6 @@ D_06001AD8 = 0x06001AD8; D_06001E18 = 0x06001E18; D_06002358 = 0x06002358; -// ovl_Bg_Ikana_Ray - -D_06001100 = 0x06001100; -D_06001228 = 0x06001228; - // ovl_Bg_Ikana_Rotaryroom D_06004710 = 0x06004710; @@ -839,22 +717,11 @@ D_06007360 = 0x06007360; D_06007448 = 0x06007448; D_06007B68 = 0x06007B68; -// ovl_Bg_Ikana_Shutter - -D_06000CE8 = 0x06000CE8; -D_06000F28 = 0x06000F28; - // ovl_Bg_Ikninside D_0600CC78 = 0x0600CC78; D_0600DE48 = 0x0600DE48; -// ovl_Bg_Iknin_Susceil - -D_0600C308 = 0x0600C308; -D_0600C670 = 0x0600C670; -D_0600CBAC = 0x0600CBAC; - // ovl_Bg_Iknv_Doukutu D_0600DB60 = 0x0600DB60; @@ -868,42 +735,16 @@ D_06012700 = 0x06012700; D_06012728 = 0x06012728; D_06012788 = 0x06012788; -// ovl_Bg_Iknv_Obj - -D_06011880 = 0x06011880; -D_060119D4 = 0x060119D4; -D_060129C8 = 0x060129C8; -D_06012CA4 = 0x06012CA4; -D_06013058 = 0x06013058; - // ovl_Bg_Ingate D_060006B0 = 0x060006B0; D_060016DC = 0x060016DC; -// ovl_Bg_Inibs_Movebg - -D_06001C10 = 0x06001C10; -D_06001DC0 = 0x06001DC0; -D_06002598 = 0x06002598; -D_06006140 = 0x06006140; -D_060062D8 = 0x060062D8; -D_06006858 = 0x06006858; - // ovl_Bg_Keikoku_Saku D_06001640 = 0x06001640; D_06002300 = 0x06002300; -// ovl_Bg_Keikoku_Spr - -D_06000100 = 0x06000100; -D_060001F8 = 0x060001F8; -D_06000300 = 0x06000300; -D_060003F8 = 0x060003F8; -D_06000500 = 0x06000500; -D_060005F8 = 0x060005F8; - // ovl_Bg_Kin2_Bombwall D_06000128 = 0x06000128; @@ -911,53 +752,15 @@ D_060002C0 = 0x060002C0; D_06000360 = 0x06000360; D_06000490 = 0x06000490; -// ovl_Bg_Kin2_Fence - -D_06000828 = 0x06000828; -D_06000908 = 0x06000908; - // ovl_Bg_Kin2_Picture D_06000658 = 0x06000658; D_06000798 = 0x06000798; -// ovl_Bg_Ladder - -D_060000A0 = 0x060000A0; -D_060001D8 = 0x060001D8; -D_060002D0 = 0x060002D0; -D_06000408 = 0x06000408; -D_06000500 = 0x06000500; -D_06000638 = 0x06000638; -D_06000730 = 0x06000730; -D_06000868 = 0x06000868; - // ovl_Bg_Last_Bwall D_06000098 = 0x06000098; -// ovl_Bg_Lbfshot - -D_06000228 = 0x06000228; -D_060014D8 = 0x060014D8; - -// ovl_Bg_Lotus - -D_06000040 = 0x06000040; -D_06000A20 = 0x06000A20; - -// ovl_Bg_Market_Step - -D_0601F050 = 0x0601F050; -D_06018DA0 = 0x06018DA0; -D_0601EF10 = 0x0601EF10; -D_06018C60 = 0x06018C60; - -// ovl_Bg_Mbar_Chair - -D_06000288 = 0x06000288; -D_060019B4 = 0x060019B4; - // ovl_Bg_Numa_Hana D_06000870 = 0x06000870; @@ -993,11 +796,6 @@ D_06002678 = 0x06002678; D_06000040 = 0x06000040; -// ovl_Bg_Tobira01 - -D_06000088 = 0x06000088; -D_060011C0 = 0x060011C0; - // ovl_Bg_Umajump D_06001220 = 0x06001220; @@ -1042,35 +840,8 @@ D_06022550 = 0x06022550; // ovl_Boss_02 -D_06000230 = 0x06000230; -D_060002E0 = 0x060002E0; D_060003A0 = 0x060003A0; D_060041A0 = 0x060041A0; -D_06008650 = 0x06008650; -D_06009B10 = 0x06009B10; -D_06009C78 = 0x06009C78; -D_0600ECF0 = 0x0600ECF0; -D_0600EF90 = 0x0600EF90; -D_0600F310 = 0x0600F310; -D_0600F690 = 0x0600F690; -D_0600FA10 = 0x0600FA10; -D_0600FD90 = 0x0600FD90; -D_06010110 = 0x06010110; -D_06010490 = 0x06010490; -D_06010810 = 0x06010810; -D_06010B90 = 0x06010B90; -D_06010F10 = 0x06010F10; -D_06011290 = 0x06011290; -D_06011610 = 0x06011610; -D_06011990 = 0x06011990; -D_06011D10 = 0x06011D10; -D_06012090 = 0x06012090; -D_06012410 = 0x06012410; -D_06012790 = 0x06012790; -D_06012B10 = 0x06012B10; -D_06012E90 = 0x06012E90; -D_06013210 = 0x06013210; -D_06013590 = 0x06013590; // ovl_Boss_03 @@ -1109,7 +880,6 @@ D_06018CF0 = 0x06018CF0; D_06018DE0 = 0x06018DE0; D_06019360 = 0x06019360; D_060193B0 = 0x060193B0; -D_06019490 = 0x06019490; // ovl_Boss_07 @@ -1203,10 +973,6 @@ D_06000050 = 0x06000050; D_06000060 = 0x06000060; D_060012E8 = 0x060012E8; -// ovl_Demo_Kankyo - -D_06001000 = 0x06001000; - // ovl_Demo_Moonend D_06001214 = 0x06001214; @@ -1298,26 +1064,6 @@ D_060042B0 = 0x060042B0; D_060013A8 = 0x060013A8; D_06006868 = 0x06006868; -// ovl_Dm_Char07 - -D_06000100 = 0x06000100; -D_06000240 = 0x06000240; -D_06000650 = 0x06000650; -D_06000790 = 0x06000790; -D_06000B80 = 0x06000B80; -D_06000CC0 = 0x06000CC0; -D_060010D0 = 0x060010D0; -D_06001210 = 0x06001210; -D_060015E0 = 0x060015E0; -D_060016B8 = 0x060016B8; -D_06002BA0 = 0x06002BA0; -D_06002CD0 = 0x06002CD0; -D_06006688 = 0x06006688; -D_060076A0 = 0x060076A0; -D_06007918 = 0x06007918; -D_060105F8 = 0x060105F8; -D_06010D68 = 0x06010D68; - // ovl_Dm_Char08 D_06002328 = 0x06002328; @@ -1335,11 +1081,6 @@ D_06001398 = 0x06001398; D_06000E70 = 0x06000E70; D_06012618 = 0x06012618; -// ovl_Dm_Nb - -D_06000990 = 0x06000990; -D_06008C40 = 0x06008C40; - // ovl_Dm_Opstage D_06000970 = 0x06000970; @@ -1352,108 +1093,6 @@ D_06003068 = 0x06003068; D_06003720 = 0x06003720; D_06003728 = 0x06003728; -// ovl_Dm_Sa - -D_0600CC94 = 0x0600CC94; -D_06013328 = 0x06013328; - -// ovl_Dm_Statue - -D_06000520 = 0x06000520; -D_06001788 = 0x06001788; - -// ovl_Dm_Stk - -D_0600055C = 0x0600055C; -D_06001030 = 0x06001030; -D_0600130C = 0x0600130C; -D_06001374 = 0x06001374; -D_06001EDC = 0x06001EDC; -D_06002774 = 0x06002774; -D_06002CD8 = 0x06002CD8; -D_06003068 = 0x06003068; -D_060035C8 = 0x060035C8; -D_060039F0 = 0x060039F0; -D_06004554 = 0x06004554; -D_06004580 = 0x06004580; -D_060046B0 = 0x060046B0; -D_060049C8 = 0x060049C8; -D_060051C0 = 0x060051C0; -D_060053C0 = 0x060053C0; -D_06005870 = 0x06005870; -D_06005F44 = 0x06005F44; -D_06006BB0 = 0x06006BB0; -D_060070DC = 0x060070DC; -D_06007840 = 0x06007840; -D_060079F0 = 0x060079F0; -D_060084C0 = 0x060084C0; -D_06008658 = 0x06008658; -D_060087B0 = 0x060087B0; -D_06008A80 = 0x06008A80; -D_060090C0 = 0x060090C0; -D_06009710 = 0x06009710; -D_06009AC0 = 0x06009AC0; -D_06009DA0 = 0x06009DA0; -D_0600A530 = 0x0600A530; -D_0600A5C0 = 0x0600A5C0; -D_0600AE30 = 0x0600AE30; -D_0600AEC0 = 0x0600AEC0; -D_0600BB2C = 0x0600BB2C; -D_0600C270 = 0x0600C270; -D_0600C964 = 0x0600C964; -D_0600CAD0 = 0x0600CAD0; -D_0600CBB8 = 0x0600CBB8; -D_0600D830 = 0x0600D830; -D_0600E6EC = 0x0600E6EC; -D_0600EEC0 = 0x0600EEC0; -D_060101A4 = 0x060101A4; -D_06010B60 = 0x06010B60; -D_060110B4 = 0x060110B4; -D_06011FB0 = 0x06011FB0; -D_06012A58 = 0x06012A58; -D_06013328 = 0x06013328; -D_060141E4 = 0x060141E4; -D_06014920 = 0x06014920; -D_06015028 = 0x06015028; -D_06015C14 = 0x06015C14; -D_06016508 = 0x06016508; -D_06016620 = 0x06016620; -D_06016910 = 0x06016910; -D_06018ED0 = 0x06018ED0; -D_0601AA80 = 0x0601AA80; -D_0601C114 = 0x0601C114; -D_0601C21C = 0x0601C21C; -D_0601D008 = 0x0601D008; -D_0601D07C = 0x0601D07C; -D_0601D3D0 = 0x0601D3D0; -D_0601DDE0 = 0x0601DDE0; -D_0601EF50 = 0x0601EF50; -D_0601F9E4 = 0x0601F9E4; -D_06020CAC = 0x06020CAC; -D_0602200C = 0x0602200C; -D_0602336C = 0x0602336C; -D_060259F4 = 0x060259F4; -D_060266C8 = 0x060266C8; -D_06026CF4 = 0x06026CF4; -D_06027CF4 = 0x06027CF4; -D_06028F28 = 0x06028F28; -D_06029A04 = 0x06029A04; -D_0602A2D8 = 0x0602A2D8; -D_0602AD54 = 0x0602AD54; -D_0602DC64 = 0x0602DC64; -D_0602E9A0 = 0x0602E9A0; -D_0602FA70 = 0x0602FA70; -D_0603021C = 0x0603021C; -D_06031210 = 0x06031210; -D_060322FC = 0x060322FC; -D_06032AE0 = 0x06032AE0; -D_0603323C = 0x0603323C; -D_06034FD8 = 0x06034FD8; -D_06036964 = 0x06036964; -D_06037B94 = 0x06037B94; -D_0603967C = 0x0603967C; -D_0603A8F8 = 0x0603A8F8; - // ovl_Dm_Tsg D_06002D30 = 0x06002D30; @@ -1464,21 +1103,6 @@ D_06011458 = 0x06011458; D_0600DE08 = 0x0600DE08; D_0600E038 = 0x0600E038; -// ovl_Door_Spiral - -D_06000590 = 0x06000590; -D_060007A8 = 0x060007A8; -D_06000EA0 = 0x06000EA0; -D_060012C0 = 0x060012C0; -D_060014C8 = 0x060014C8; -D_06002110 = 0x06002110; -D_06004448 = 0x06004448; -D_060051B8 = 0x060051B8; -D_06006128 = 0x06006128; -D_06009278 = 0x06009278; -D_06012B70 = 0x06012B70; -D_06013EA8 = 0x06013EA8; - // ovl_Door_Warp1 D_06003230 = 0x06003230; @@ -1588,13 +1212,6 @@ D_06005EF0 = 0x06005EF0; D_06006B10 = 0x06006B10; D_060092A0 = 0x060092A0; -// ovl_En_Baisen - -D_060008B4 = 0x060008B4; -D_06008198 = 0x06008198; -D_060011C0 = 0x060011C0; -D_06007908 = 0x06007908; - // ovl_En_Bal D_060005FC = 0x060005FC; @@ -1635,13 +1252,6 @@ D_06001398 = 0x06001398; D_06000074 = 0x06000074; D_06001E60 = 0x06001E60; -// ovl_En_Bigokuta - -D_06000444 = 0x06000444; -D_06000A74 = 0x06000A74; -D_060014B8 = 0x060014B8; -D_06006BC0 = 0x06006BC0; - // ovl_En_Bigpamet D_06000440 = 0x06000440; @@ -1654,17 +1264,6 @@ D_06004210 = 0x06004210; D_06007C70 = 0x06007C70; D_0600823C = 0x0600823C; -// ovl_En_Bji_01 - -D_0600066C = 0x0600066C; -D_06000AB0 = 0x06000AB0; -D_06000FDC = 0x06000FDC; -D_060049F0 = 0x060049F0; -D_06004E70 = 0x06004E70; -D_06005270 = 0x06005270; -D_0600578C = 0x0600578C; -D_06005B58 = 0x06005B58; - // ovl_En_Bjt D_06002390 = 0x06002390; @@ -1723,86 +1322,16 @@ D_0600C3E0 = 0x0600C3E0; D_06001000 = 0x06001000; -// ovl_En_Cha - -D_06000710 = 0x06000710; -D_06000958 = 0x06000958; - // ovl_En_Cne_01 D_060000F0 = 0x060000F0; D_06001300 = 0x06001300; -// ovl_En_Cow - -D_060001CC = 0x060001CC; -D_06004010 = 0x06004010; -D_06004264 = 0x06004264; -D_06004348 = 0x06004348; -D_06004C30 = 0x06004C30; -D_06004E98 = 0x06004E98; - // ovl_En_Crow D_060000F0 = 0x060000F0; D_060010C0 = 0x060010C0; -// ovl_En_Dai - -D_06000230 = 0x06000230; -D_060002E8 = 0x060002E8; -D_0600C538 = 0x0600C538; -D_060130D0 = 0x060130D0; -D_060107B0 = 0x060107B0; -D_06010FB0 = 0x06010FB0; -D_060117B0 = 0x060117B0; -D_06010FB0 = 0x06010FB0; -D_06011FB0 = 0x06011FB0; -D_060127B0 = 0x060127B0; -D_060079E4 = 0x060079E4; -D_06007354 = 0x06007354; -D_06000CEC = 0x06000CEC; -D_060069DC = 0x060069DC; -D_0600563C = 0x0600563C; -D_06002E58 = 0x06002E58; -D_06006590 = 0x06006590; - -// ovl_En_Daiku - -D_06001114 = 0x06001114; -D_06002FA0 = 0x06002FA0; -D_06008EC8 = 0x06008EC8; -D_0600A850 = 0x0600A850; -D_0600B690 = 0x0600B690; -D_0600ACD0 = 0x0600ACD0; -D_0600C92C = 0x0600C92C; -D_06000C44 = 0x06000C44; -D_0600C234 = 0x0600C234; -D_06000600 = 0x06000600; -D_0600BEAC = 0x0600BEAC; -D_060070C0 = 0x060070C0; -D_06006FB0 = 0x06006FB0; -D_06006E80 = 0x06006E80; -D_06006D70 = 0x06006D70; - -// ovl_En_Daiku2 - -D_0600ACD0 = 0x0600ACD0; -D_0600C92C = 0x0600C92C; -D_06000C44 = 0x06000C44; -D_0600C234 = 0x0600C234; -D_06000600 = 0x06000600; -D_06001114 = 0x06001114; -D_0600B690 = 0x0600B690; -D_06001A24 = 0x06001A24; -D_0600D328 = 0x0600D328; -D_060009E0 = 0x060009E0; -D_06002134 = 0x06002134; -D_06002FA0 = 0x06002FA0; -D_06009638 = 0x06009638; -D_0600A390 = 0x0600A390; -D_0600A850 = 0x0600A850; - // ovl_En_Death D_06000E64 = 0x06000E64; @@ -1834,211 +1363,18 @@ D_06001828 = 0x06001828; D_06002A40 = 0x06002A40; D_06003070 = 0x06003070; -// ovl_En_Dekunuts - -D_06000168 = 0x06000168; -D_06001E50 = 0x06001E50; -D_06001F50 = 0x06001F50; -D_06002468 = 0x06002468; -D_0600259C = 0x0600259C; -D_06002A5C = 0x06002A5C; -D_06002BD4 = 0x06002BD4; -D_06002DD4 = 0x06002DD4; -D_06002FA4 = 0x06002FA4; -D_06003180 = 0x06003180; -D_0600326C = 0x0600326C; -D_060033E4 = 0x060033E4; -D_06003780 = 0x06003780; - // ovl_En_Demo_heishi D_06003BFC = 0x06003BFC; D_0600D640 = 0x0600D640; -// ovl_En_Dg - -D_060080F0 = 0x060080F0; -D_060021C8 = 0x060021C8; -D_06001BD8 = 0x06001BD8; -D_06000998 = 0x06000998; -D_06001FB0 = 0x06001FB0; -D_06001048 = 0x06001048; -D_06001348 = 0x06001348; -D_06001560 = 0x06001560; -D_06001A84 = 0x06001A84; -D_060017C0 = 0x060017C0; - -// ovl_En_Dinofos - -D_06000580 = 0x06000580; -D_06000AF0 = 0x06000AF0; -D_06001040 = 0x06001040; -D_060013C0 = 0x060013C0; -D_060017B8 = 0x060017B8; -D_06001CCC = 0x06001CCC; -D_060025B4 = 0x060025B4; -D_06002E40 = 0x06002E40; -D_06009570 = 0x06009570; -D_06009B70 = 0x06009B70; -D_0600ABD0 = 0x0600ABD0; -D_0600C974 = 0x0600C974; -D_0600D21C = 0x0600D21C; -D_0600D62C = 0x0600D62C; -D_06008E30 = 0x06008E30; -D_06009030 = 0x06009030; -D_06009230 = 0x06009230; - -// ovl_En_Dnb - -D_06000000 = 0x06000000; -D_06000020 = 0x06000020; -D_06004638 = 0x06004638; -D_06004710 = 0x06004710; -D_06004D8C = 0x06004D8C; - // ovl_En_Dnh D_06002950 = 0x06002950; -// ovl_En_Dnk - -D_060023B8 = 0x060023B8; -D_06002468 = 0x06002468; -D_06002848 = 0x06002848; -D_06000B70 = 0x06000B70; -D_06002A08 = 0x06002A08; -D_0600031C = 0x0600031C; -D_06000430 = 0x06000430; -D_06000894 = 0x06000894; -D_06002B6C = 0x06002B6C; -D_060006CC = 0x060006CC; -D_060024CC = 0x060024CC; -D_060026C4 = 0x060026C4; -D_06002894 = 0x06002894; -D_06002B90 = 0x06002B90; -D_06002F7C = 0x06002F7C; -D_06003128 = 0x06003128; -D_060029BC = 0x060029BC; -D_06002E84 = 0x06002E84; -D_06000168 = 0x06000168; -D_0600259C = 0x0600259C; -D_06002A5C = 0x06002A5C; -D_06002BD4 = 0x06002BD4; -D_06002DD4 = 0x06002DD4; -D_06002FA4 = 0x06002FA4; -D_06003180 = 0x06003180; -D_0600326C = 0x0600326C; -D_060033E4 = 0x060033E4; -D_06003780 = 0x06003780; -D_06002950 = 0x06002950; -D_06001680 = 0x06001680; -D_06001700 = 0x06001700; -D_06001780 = 0x06001780; - // ovl_En_Dno -D_06007CA4 = 0x06007CA4; -D_0600E1F8 = 0x0600E1F8; D_801C20C0 = 0x801C20C0; -D_06000470 = 0x06000470; -D_060008F0 = 0x060008F0; -D_06000F6C = 0x06000F6C; -D_06001A50 = 0x06001A50; -D_06002530 = 0x06002530; -D_06003320 = 0x06003320; -D_060036D0 = 0x060036D0; -D_060041CC = 0x060041CC; -D_06004DD8 = 0x06004DD8; -D_06005F98 = 0x06005F98; -D_06006488 = 0x06006488; -D_060073E4 = 0x060073E4; -D_060077A8 = 0x060077A8; -D_06008324 = 0x06008324; -D_06008AE4 = 0x06008AE4; -D_06009100 = 0x06009100; -D_060051E4 = 0x060051E4; -D_06005E20 = 0x06005E20; -D_06006F84 = 0x06006F84; - -// ovl_En_Dnp - -D_06010D60 = 0x06010D60; -D_060007D8 = 0x060007D8; -D_060021DC = 0x060021DC; -D_060026B8 = 0x060026B8; -D_06004D08 = 0x06004D08; -D_060071F4 = 0x060071F4; -D_06007960 = 0x06007960; -D_06008588 = 0x06008588; -D_0600A900 = 0x0600A900; -D_0600AEB8 = 0x0600AEB8; -D_0600B754 = 0x0600B754; -D_0600674C = 0x0600674C; -D_0600BAD8 = 0x0600BAD8; -D_06006B74 = 0x06006B74; -D_06012428 = 0x06012428; -D_0600B324 = 0x0600B324; -D_060115B8 = 0x060115B8; -D_0600923C = 0x0600923C; -D_06009AA0 = 0x06009AA0; -D_0600125C = 0x0600125C; -D_060017F8 = 0x060017F8; -D_06001C1C = 0x06001C1C; -D_060057AC = 0x060057AC; -D_0600625C = 0x0600625C; -D_060103D0 = 0x060103D0; -D_060105D0 = 0x060105D0; -D_060107D0 = 0x060107D0; -D_060109D0 = 0x060109D0; - -// ovl_En_Dnq - -D_0600EB48 = 0x0600EB48; -D_06008328 = 0x06008328; -D_06007528 = 0x06007528; -D_060006F0 = 0x060006F0; -D_06000BF8 = 0x06000BF8; -D_06002690 = 0x06002690; -D_06003408 = 0x06003408; -D_06006984 = 0x06006984; -D_06005E18 = 0x06005E18; -D_06005284 = 0x06005284; -D_06001AEC = 0x06001AEC; -D_06001100 = 0x06001100; -D_06004EA0 = 0x06004EA0; -D_0600F504 = 0x0600F504; -D_060047B8 = 0x060047B8; -D_06005A14 = 0x06005A14; -D_06003DBC = 0x06003DBC; - -// ovl_En_Dns - -D_06002C48 = 0x06002C48; -D_06002DD8 = 0x06002DD8; -D_06003310 = 0x06003310; -D_060034EC = 0x060034EC; -D_060008F4 = 0x060008F4; -D_06000BD8 = 0x06000BD8; -D_06000D58 = 0x06000D58; -D_06000FEC = 0x06000FEC; -D_060002A8 = 0x060002A8; -D_06000734 = 0x06000734; -D_060028E8 = 0x060028E8; -D_06002968 = 0x06002968; -D_060029E8 = 0x060029E8; -D_06002968 = 0x06002968; - -// ovl_En_Dodongo - -D_060013C4 = 0x060013C4; -D_06001A44 = 0x06001A44; -D_060028F0 = 0x060028F0; -D_06003088 = 0x06003088; -D_06003B14 = 0x06003B14; -D_060042C4 = 0x060042C4; -D_06004C20 = 0x06004C20; -D_06008318 = 0x06008318; -D_06008B1C = 0x06008B1C; // ovl_En_Dragon @@ -2060,11 +1396,6 @@ D_06008170 = 0x06008170; D_0600112C = 0x0600112C; D_0600B0CC = 0x0600B0CC; -// ovl_En_Dy_Extra - -D_0600DD40 = 0x0600DD40; -D_0600DEF0 = 0x0600DEF0; - // ovl_En_Egblock D_06001698 = 0x06001698; @@ -2083,84 +1414,10 @@ D_060094E4 = 0x060094E4; D_06009664 = 0x06009664; D_0600EE4C = 0x0600EE4C; -// ovl_En_Elfbub - -D_06001000 = 0x06001000; - -// ovl_En_Encount2 - -D_06000A00 = 0x06000A00; -D_06000D78 = 0x06000D78; -D_06002420 = 0x06002420; - // ovl_En_Encount3 D_060009A0 = 0x060009A0; -// ovl_En_Ending_Hero - -D_06000BE0 = 0x06000BE0; -D_0600B0CC = 0x0600B0CC; -D_06007350 = 0x06007350; -D_06007750 = 0x06007750; -D_06009590 = 0x06009590; -D_06009F90 = 0x06009F90; -D_0600A390 = 0x0600A390; -D_0600A490 = 0x0600A490; -D_0600A790 = 0x0600A790; -D_0600AB90 = 0x0600AB90; - -// ovl_En_Ending_Hero2 - -D_060011C0 = 0x060011C0; -D_06007908 = 0x06007908; - -// ovl_En_Ending_Hero3 - -D_06000E50 = 0x06000E50; -D_06007150 = 0x06007150; - -// ovl_En_Ending_Hero4 - -D_06002A84 = 0x06002A84; -D_0600D640 = 0x0600D640; - -// ovl_En_Ending_Hero5 - -D_06002FA0 = 0x06002FA0; -D_06006D70 = 0x06006D70; -D_06006E80 = 0x06006E80; -D_06006FB0 = 0x06006FB0; -D_060070C0 = 0x060070C0; -D_0600A390 = 0x0600A390; -D_0600A850 = 0x0600A850; - -// ovl_En_Ending_Hero6 - -D_0600B0CC = 0x0600B0CC; -D_06007908 = 0x06007908; -D_06007150 = 0x06007150; -D_0600D640 = 0x0600D640; -D_0600A850 = 0x0600A850; -D_06000BE0 = 0x06000BE0; -D_060011C0 = 0x060011C0; -D_06000E50 = 0x06000E50; -D_06002A84 = 0x06002A84; -D_06002FA0 = 0x06002FA0; -D_060070C0 = 0x060070C0; -D_06006FB0 = 0x06006FB0; -D_06006E80 = 0x06006E80; -D_06006D70 = 0x06006D70; -D_0600A390_dl = 0x0600A390; -D_06007350 = 0x06007350; -D_06009590 = 0x06009590; -D_06009F90 = 0x06009F90; -D_0600A790 = 0x0600A790; -D_0600AB90 = 0x0600AB90; -D_06007750 = 0x06007750; -D_0600A390_tex = 0x0600A390; -D_0600A490 = 0x0600A490; - // ovl_En_Estone D_06010240 = 0x06010240; @@ -2178,84 +1435,11 @@ D_060000F8 = 0x060000F8; D_06003D38 = 0x06003D38; D_06003DC8 = 0x06003DC8; -// ovl_En_Fg - -D_060007BC = 0x060007BC; -D_060011C0 = 0x060011C0; -D_06001534 = 0x06001534; -D_060059A0 = 0x060059A0; -D_0600B328 = 0x0600B328; -D_0600B338 = 0x0600B338; -D_0600B538 = 0x0600B538; - -// ovl_En_Firefly - -D_0600017C = 0x0600017C; -D_06001678 = 0x06001678; -D_060018B8 = 0x060018B8; - -// ovl_En_Fish2 - -D_060006D8 = 0x060006D8; -D_060007D4 = 0x060007D4; -D_06000ACC = 0x06000ACC; -D_06001174 = 0x06001174; -D_060013AC = 0x060013AC; -D_06006190 = 0x06006190; - // ovl_En_Fishing D_0600CFE0 = 0x0600CFE0; D_06011058 = 0x06011058; -// ovl_En_Floormas - -D_06000590 = 0x06000590; -D_06000EA4 = 0x06000EA4; -D_060019CC = 0x060019CC; -D_06002158 = 0x06002158; -D_060039B0 = 0x060039B0; -D_060041F4 = 0x060041F4; -D_06008688 = 0x06008688; -D_06008FB0 = 0x06008FB0; -D_06009244 = 0x06009244; -D_06009520 = 0x06009520; -D_06009DB0 = 0x06009DB0; -D_0600A054 = 0x0600A054; - -// ovl_En_Fsn - -D_06005BC0 = 0x06005BC0; -D_06006D40 = 0x06006D40; -D_06007140 = 0x06007140; -D_0600B9D8 = 0x0600B9D8; -D_0600C26C = 0x0600C26C; -D_0600C58C = 0x0600C58C; -D_0600CB3C = 0x0600CB3C; -D_0600D354 = 0x0600D354; -D_0600DE34 = 0x0600DE34; -D_0600E3EC = 0x0600E3EC; -D_0600F00C = 0x0600F00C; -D_0600F180 = 0x0600F180; -D_0600F218 = 0x0600F218; -D_06012C34 = 0x06012C34; -D_060131FC = 0x060131FC; -D_06013320 = 0x06013320; -D_060138B0 = 0x060138B0; -D_0601430C = 0x0601430C; - -// ovl_En_Fu - -D_06001F74 = 0x06001F74; -D_06002F64 = 0x06002F64; -D_06004904 = 0x06004904; -D_06005304 = 0x06005304; -D_060053E0 = 0x060053E0; -D_0600B0A0 = 0x0600B0A0; -D_0600B0E0 = 0x0600B0E0; -D_0600B2B0 = 0x0600B2B0; -D_0600BAC4 = 0x0600BAC4; - // ovl_En_Fu_Kago D_060006A0 = 0x060006A0; @@ -2301,16 +1485,6 @@ D_0600F6C0 = 0x0600F6C0; D_0600F578 = 0x0600F578; D_0600F6C0 = 0x0600F6C0; -// ovl_En_Ginko_Man - -D_060008C0 = 0x060008C0; -D_06000AC4 = 0x06000AC4; -D_060043F0 = 0x060043F0; -D_06004A7C = 0x06004A7C; -D_06004F40 = 0x06004F40; -D_0600B1D8 = 0x0600B1D8; -D_0600C240 = 0x0600C240; - // ovl_En_Gk D_06006680 = 0x06006680; @@ -2318,76 +1492,21 @@ D_06006688 = 0x06006688; D_0600787C = 0x0600787C; D_060079C0 = 0x060079C0; -// ovl_En_Gm +// ovl_En_Goron_Oyu -D_06005028 = 0x06005028; -D_060054A8 = 0x060054A8; -D_06005CE8 = 0x06005CE8; -D_06006828 = 0x06006828; -D_06006C68 = 0x06006C68; -D_06007528 = 0x06007528; -D_060078B0 = 0x060078B0; -D_06008090 = 0x06008090; -D_0600898C = 0x0600898C; -D_06009450 = 0x06009450; -D_06009CDC = 0x06009CDC; -D_0600A5E0 = 0x0600A5E0; -D_0600A70C = 0x0600A70C; -D_0600AD18 = 0x0600AD18; -D_0600B8B0 = 0x0600B8B0; -D_0600B990 = 0x0600B990; -D_0600BA80 = 0x0600BA80; -D_0600C03C = 0x0600C03C; - -// ovl_En_Goroiwa - -D_060032E0 = 0x060032E0; -D_060082D0 = 0x060082D0; -D_06005C20 = 0x06005C20; -D_06003B40 = 0x06003B40; -D_06008B90 = 0x06008B90; -D_060042B0 = 0x060042B0; -D_06004960 = 0x06004960; -D_06004EF0 = 0x06004EF0; -D_060003B0 = 0x060003B0; -D_060028E0 = 0x060028E0; -D_06002D70 = 0x06002D70; -D_060072F0 = 0x060072F0; -D_060077D0 = 0x060077D0; -D_06007C60 = 0x06007C60; +D_06000988 = 0x06000988; // ovl_En_Grasshopper D_06000F9C = 0x06000F9C; D_06003F00 = 0x06003F00; -// ovl_En_Gs - -D_06000950 = 0x06000950; -D_060009D0 = 0x060009D0; -D_06000A60 = 0x06000A60; - // ovl_En_Guard_Nuts D_06002700 = 0x06002700; D_06002848 = 0x06002848; D_06002A08 = 0x06002A08; -// ovl_En_Guruguru - -D_06000B04 = 0x06000B04; -D_0600057C = 0x0600057C; -D_06005F20 = 0x06005F20; -D_06006320 = 0x06006320; -D_06006720 = 0x06006720; -D_06006920 = 0x06006920; -D_06006C90 = 0x06006C90; - -// ovl_En_Hakurock - -D_06011100 = 0x06011100; -D_06011178 = 0x06011178; - // ovl_En_Hata D_060000C0 = 0x060000C0; @@ -2399,31 +1518,17 @@ D_06002FD0 = 0x06002FD0; D_06003BFC = 0x06003BFC; D_0600D640 = 0x0600D640; -// ovl_En_Hg +// ovl_En_Hgo -D_06000370 = 0x06000370; -D_06001138 = 0x06001138; -D_060015D4 = 0x060015D4; -D_06001960 = 0x06001960; -D_0600260C = 0x0600260C; -D_06005E28 = 0x06005E28; -D_06008580 = 0x06008580; -D_06009D44 = 0x06009D44; -D_0600A164 = 0x0600A164; -D_0600AE1C = 0x0600AE1C; +D_0600B644 = 0x0600B644; +D_0600F248 = 0x0600F248; +D_06012A58 = 0x06012A58; // ovl_En_Hidden_Nuts D_060023B8 = 0x060023B8; D_060024CC = 0x060024CC; -// ovl_En_Hint_Skb - -D_06002190 = 0x06002190; -D_06003584 = 0x06003584; -D_06005EF8 = 0x06005EF8; -D_0600697C = 0x0600697C; - // ovl_En_Horse D_06008C68 = 0x06008C68; @@ -2469,105 +1574,6 @@ D_060057F4 = 0x060057F4; D_06006294 = 0x06006294; D_060136A0 = 0x060136A0; -// ovl_En_In - -D_060003B4 = 0x060003B4; -D_06000CB0 = 0x06000CB0; -D_06001BE0 = 0x06001BE0; -D_06001C30 = 0x06001C30; -D_06001D10 = 0x06001D10; -D_06003520 = 0x06003520; -D_060035E0 = 0x060035E0; -D_060043E0 = 0x060043E0; -D_06004820 = 0x06004820; -D_06004C20 = 0x06004C20; -D_06007A70 = 0x06007A70; -D_06007C48 = 0x06007C48; -D_06012A78 = 0x06012A78; -D_06012DF8 = 0x06012DF8; -D_06013440 = 0x06013440; -D_06013540 = 0x06013540; -D_06013670 = 0x06013670; -D_060137A0 = 0x060137A0; -D_060138D0 = 0x060138D0; -D_06013A00 = 0x06013A00; -D_06013DE0 = 0x06013DE0; -D_06013F10 = 0x06013F10; -D_06014040 = 0x06014040; -D_06014420 = 0x06014420; -D_060145D8 = 0x060145D8; -D_06014710 = 0x06014710; -D_06014860 = 0x06014860; -D_060149A8 = 0x060149A8; -D_06014AE0 = 0x06014AE0; -D_06014C30 = 0x06014C30; -D_06014EA8 = 0x06014EA8; -D_06014F8C = 0x06014F8C; -D_06015918 = 0x06015918; -D_06015E38 = 0x06015E38; -D_06016484 = 0x06016484; -D_06016A60 = 0x06016A60; -D_060170DC = 0x060170DC; -D_060177AC = 0x060177AC; -D_06018240 = 0x06018240; -D_060187C8 = 0x060187C8; -D_060198A8 = 0x060198A8; -D_06019EB4 = 0x06019EB4; -D_0601A140 = 0x0601A140; -D_0601B3C4 = 0x0601B3C4; -D_0601B904 = 0x0601B904; -D_0601C0B0 = 0x0601C0B0; -D_0601C528 = 0x0601C528; - -// ovl_En_Invadepoh - -D_06000080 = 0x06000080; -D_060003B0 = 0x060003B0; -D_06000550 = 0x06000550; -D_06000560 = 0x06000560; -D_06000608 = 0x06000608; -D_060006C8 = 0x060006C8; -D_06000720 = 0x06000720; -D_06000998 = 0x06000998; -D_06001560 = 0x06001560; -D_06001674 = 0x06001674; -D_06001BD8 = 0x06001BD8; -D_06001D80 = 0x06001D80; -D_060021C8 = 0x060021C8; -D_06002A8C = 0x06002A8C; -D_06004010 = 0x06004010; -D_06004264 = 0x06004264; -D_06004C30 = 0x06004C30; -D_06004E50 = 0x06004E50; -D_06004E98 = 0x06004E98; -D_06007328 = 0x06007328; -D_060080F0 = 0x060080F0; -D_06009E58 = 0x06009E58; -D_0600A174 = 0x0600A174; -D_0600FFC8 = 0x0600FFC8; -D_060107C8 = 0x060107C8; -D_06010FC8 = 0x06010FC8; -D_060117C8 = 0x060117C8; -D_06011AD8 = 0x06011AD8; -D_06011FC8 = 0x06011FC8; -D_060122D8 = 0x060122D8; -D_060127C8 = 0x060127C8; -D_06012AD8 = 0x06012AD8; -D_06012BC8 = 0x06012BC8; -D_06012FC8 = 0x06012FC8; -D_060132D8 = 0x060132D8; -D_060133C8 = 0x060133C8; -D_06013928 = 0x06013928; -D_06013AD8 = 0x06013AD8; -D_06014088 = 0x06014088; -D_060142D8 = 0x060142D8; -D_06014AD8 = 0x06014AD8; -D_06014ED8 = 0x06014ED8; -D_060152D8 = 0x060152D8; -D_060156D8 = 0x060156D8; -D_06015C28 = 0x06015C28; -D_06016720 = 0x06016720; - // ovl_En_Invadepoh_Demo D_06000080 = 0x06000080; @@ -2590,10 +1596,6 @@ D_0600BA30 = 0x0600BA30; D_0600BCC8 = 0x0600BCC8; D_0600C240 = 0x0600C240; -// ovl_En_Jc_Mato - -D_06000390 = 0x06000390; - // ovl_En_Jg D_0601ADC0 = 0x0601ADC0; @@ -2629,20 +1631,6 @@ D_060081F4 = 0x060081F4; D_060058B8 = 0x060058B8; D_0600D828 = 0x0600D828; -// ovl_En_Kakasi - -D_06000214 = 0x06000214; -D_060065B0 = 0x060065B0; -D_06007444 = 0x06007444; -D_0600686C = 0x0600686C; -D_060081A4 = 0x060081A4; -D_06007B90 = 0x06007B90; -D_060071EC = 0x060071EC; -D_06007444 = 0x06007444; -D_0600686C = 0x0600686C; -D_060081A4 = 0x060081A4; -D_06000214 = 0x06000214; - // ovl_En_Kanban D_06000C30 = 0x06000C30; @@ -2668,26 +1656,6 @@ D_060003DC = 0x060003DC; D_06000F4C = 0x06000F4C; D_06006990 = 0x06006990; -// ovl_En_Kgy - -D_06004B98 = 0x06004B98; -D_0600E8F0 = 0x0600E8F0; -D_0600EE58 = 0x0600EE58; -D_0600F180 = 0x0600F180; -D_0600F6A0 = 0x0600F6A0; -D_0600F910 = 0x0600F910; -D_060008FC = 0x060008FC; -D_0600292C = 0x0600292C; -D_060042E4 = 0x060042E4; -D_060101F0 = 0x060101F0; -D_06001764 = 0x06001764; -D_06003334 = 0x06003334; -D_06010B84 = 0x06010B84; -D_06001EA4 = 0x06001EA4; -D_06003D88 = 0x06003D88; -D_04001D00 = 0x04001D00; -D_040021A8 = 0x040021A8; - // ovl_En_Kitan D_06000CE8 = 0x06000CE8; @@ -2784,31 +1752,6 @@ D_06000430 = 0x06000430; D_06002848 = 0x06002848; D_06002B6C = 0x06002B6C; -// ovl_En_Ma4 - -D_060003B0 = 0x060003B0; -D_06000A20 = 0x06000A20; -D_06002A8C = 0x06002A8C; -D_06007328 = 0x06007328; -D_06007D98 = 0x06007D98; -D_0600852C = 0x0600852C; -D_06008F6C = 0x06008F6C; -D_06009E58 = 0x06009E58; -D_0600FFC8 = 0x0600FFC8; -D_060107C8 = 0x060107C8; -D_06010FC8 = 0x06010FC8; -D_060117C8 = 0x060117C8; -D_06011FC8 = 0x06011FC8; -D_060127C8 = 0x060127C8; -D_06012BC8 = 0x06012BC8; -D_06012FC8 = 0x06012FC8; -D_060133C8 = 0x060133C8; -D_06013928 = 0x06013928; -D_06014088 = 0x06014088; -D_06015B7C = 0x06015B7C; -D_06018948 = 0x06018948; -D_0601B76C = 0x0601B76C; - // ovl_En_Mag D_06000000 = 0x06000000; @@ -2824,67 +1767,6 @@ D_06011E48 = 0x06011E48; D_06002EC0 = 0x06002EC0; -// ovl_En_Ma_Yto - -D_06000CC0 = 0x06000CC0; -D_06001FD0 = 0x06001FD0; -D_060030B4 = 0x060030B4; -D_06003D54 = 0x06003D54; -D_06004370 = 0x06004370; -D_06005314 = 0x06005314; -D_06005430 = 0x06005430; -D_060070EC = 0x060070EC; -D_06007E28 = 0x06007E28; -D_060093E8 = 0x060093E8; -D_0600A174 = 0x0600A174; -D_0600AF7C = 0x0600AF7C; -D_06011AD8 = 0x06011AD8; -D_060122D8 = 0x060122D8; -D_06012AD8 = 0x06012AD8; -D_060132D8 = 0x060132D8; -D_06013AD8 = 0x06013AD8; -D_060142D8 = 0x060142D8; -D_06014AD8 = 0x06014AD8; -D_06014ED8 = 0x06014ED8; -D_060152D8 = 0x060152D8; -D_060156D8 = 0x060156D8; -D_06015C28 = 0x06015C28; -D_06016720 = 0x06016720; - -// ovl_En_Ma_Yts - -D_060003B0 = 0x060003B0; -D_06002A8C = 0x06002A8C; -D_060043A0 = 0x060043A0; -D_06007328 = 0x06007328; -D_06007D98 = 0x06007D98; -D_0600852C = 0x0600852C; -D_06008F6C = 0x06008F6C; -D_06009E58 = 0x06009E58; -D_0600FFC8 = 0x0600FFC8; -D_060107C8 = 0x060107C8; -D_06010FC8 = 0x06010FC8; -D_060117C8 = 0x060117C8; -D_06011FC8 = 0x06011FC8; -D_060127C8 = 0x060127C8; -D_06012BC8 = 0x06012BC8; -D_06012FC8 = 0x06012FC8; -D_060133C8 = 0x060133C8; -D_06013928 = 0x06013928; -D_06014088 = 0x06014088; -D_06015B7C = 0x06015B7C; -D_060180DC = 0x060180DC; -D_06018948 = 0x06018948; -D_0601B76C = 0x0601B76C; - -// ovl_En_Minifrog - -D_060007BC = 0x060007BC; -D_06001534 = 0x06001534; -D_060059A0 = 0x060059A0; -D_06005BA0 = 0x06005BA0; -D_0600B538 = 0x0600B538; - // ovl_En_Mk D_06001C38 = 0x06001C38; @@ -2906,16 +1788,6 @@ D_060105DC = 0x060105DC; D_06019B88 = 0x06019B88; D_0601D518 = 0x0601D518; -// ovl_En_Ms - -D_060005EC = 0x060005EC; -D_06003DC0 = 0x06003DC0; - -// ovl_En_Muto - -D_06000E50 = 0x06000E50; -D_06007150 = 0x06007150; - // ovl_En_Nb D_06008C40 = 0x06008C40; @@ -2929,17 +1801,6 @@ D_06001EE8 = 0x06001EE8; D_06013380 = 0x06013380; -// ovl_En_Niw - -D_060000E8 = 0x060000E8; -D_060023B0 = 0x060023B0; -D_06002428 = 0x06002428; -D_06002530 = 0x06002530; - -// ovl_En_Nnh - -D_06001510 = 0x06001510; - // ovl_En_Nwc D_060000E8 = 0x060000E8; @@ -2972,119 +1833,10 @@ D_060192A0 = 0x060192A0; D_060201BC = 0x060201BC; D_060202F0 = 0x060202F0; -// ovl_En_Ossan - -D_060028A0 = 0x060028A0; -D_06005BC0 = 0x06005BC0; -D_06006498 = 0x06006498; -D_06006B18 = 0x06006B18; -D_06006D40 = 0x06006D40; -D_06006F18 = 0x06006F18; -D_06007140 = 0x06007140; -D_06009D34 = 0x06009D34; -D_0600A460 = 0x0600A460; -D_0600CB3C = 0x0600CB3C; -D_0600DE34 = 0x0600DE34; -D_0600E3EC = 0x0600E3EC; -D_0600C58C = 0x0600C58C; -D_0600F00C = 0x0600F00C; -D_0600B9D8 = 0x0600B9D8; -D_0600C26C = 0x0600C26C; -D_0600D354 = 0x0600D354; -D_06012C34 = 0x06012C34; -D_060131FC = 0x060131FC; -D_06013320 = 0x06013320; -D_060138B0 = 0x060138B0; -D_0601430C = 0x0601430C; - -// ovl_En_Ot - -D_06000040 = 0x06000040; -D_06000078 = 0x06000078; -D_060004A0 = 0x060004A0; -D_060005F8 = 0x060005F8; -D_060008D8 = 0x060008D8; -D_06004800 = 0x06004800; -D_06000420 = 0x06000420; -D_06004B30 = 0x06004B30; - -// ovl_En_Owl - -D_06001168 = 0x06001168; -D_06001200 = 0x06001200; -D_06001ADC = 0x06001ADC; -D_0600C5F8 = 0x0600C5F8; -D_0600C6D4 = 0x0600C6D4; -D_0600CB94 = 0x0600CB94; -D_0600CDB0 = 0x0600CDB0; -D_060105C0 = 0x060105C0; -D_06008EB8 = 0x06008EB8; -D_060092B8 = 0x060092B8; -D_060096B8 = 0x060096B8; - -// ovl_En_Pamera - - -D_06008448 = 0x06008448; -D_060005BC = 0x060005BC; -D_06008AE0 = 0x06008AE0; -D_06008E38 = 0x06008E38; -D_0600A844 = 0x0600A844; -D_0600B0C4 = 0x0600B0C4; -D_06009870 = 0x06009870; -D_06009F54 = 0x06009F54; -D_0600B5B0 = 0x0600B5B0; -D_0600BCC4 = 0x0600BCC4; -D_0600D9DC = 0x0600D9DC; -D_0600E16C = 0x0600E16C; -D_0600C9F4 = 0x0600C9F4; -D_0600D0F0 = 0x0600D0F0; -D_060074E8 = 0x060074E8; -D_060078E8 = 0x060078E8; -D_060066E8 = 0x060066E8; -D_06006AE8 = 0x06006AE8; -D_06006EE8 = 0x06006EE8; -D_060072E8 = 0x060072E8; -D_060073E8 = 0x060073E8; - // ovl_En_Paper D_0600D5A0 = 0x0600D5A0; -// ovl_En_Pm - -D_06008348 = 0x06008348; -D_060083E0 = 0x060083E0; -D_060085C8 = 0x060085C8; -D_060096E8 = 0x060096E8; -D_06002238 = 0x06002238; -D_0600A4E0 = 0x0600A4E0; -D_0600B09C = 0x0600B09C; -D_0600BA78 = 0x0600BA78; -D_0600C32C = 0x0600C32C; -D_060099B4 = 0x060099B4; -D_06000FC4 = 0x06000FC4; -D_0600A8D8 = 0x0600A8D8; -D_0600099C = 0x0600099C; -D_06001F84 = 0x06001F84; -D_06000468 = 0x06000468; -D_0600C640 = 0x0600C640; -D_06002950 = 0x06002950; -D_06002750 = 0x06002750; - -// ovl_En_Poh - -D_060001A8 = 0x060001A8; -D_060004EC = 0x060004EC; -D_060006E0 = 0x060006E0; -D_06000A60 = 0x06000A60; -D_060011C4 = 0x060011C4; -D_060015B0 = 0x060015B0; -D_06002608 = 0x06002608; -D_06002D28 = 0x06002D28; -D_06003850 = 0x06003850; -D_060050D0 = 0x060050D0; - // ovl_En_Po_Composer D_0600188C = 0x0600188C; @@ -3094,31 +1846,6 @@ D_06006F38 = 0x06006F38; D_06006FD8 = 0x06006FD8; D_06009930 = 0x06009930; -// ovl_En_Po_Fusen - -D_06000040 = 0x06000040; -D_060024F0 = 0x060024F0; - -// ovl_En_Po_Sisters - -D_06000114 = 0x06000114; -D_060008C0 = 0x060008C0; -D_06000A54 = 0x06000A54; -D_06000D40 = 0x06000D40; -D_0600119C = 0x0600119C; -D_060014CC = 0x060014CC; -D_06001CB0 = 0x06001CB0; -D_06001DE0 = 0x06001DE0; -D_060027B0 = 0x060027B0; -D_06002EB8 = 0x06002EB8; -D_06002F88 = 0x06002F88; -D_06003628 = 0x06003628; -D_06003880 = 0x06003880; -D_06003DC8 = 0x06003DC8; -D_06004020 = 0x06004020; -D_060046E0 = 0x060046E0; -D_060065C8 = 0x060065C8; - // ovl_En_Pp D_0600A844 = 0x0600A844; @@ -3159,86 +1886,12 @@ D_06002EF8 = 0x06002EF8; D_060032F8 = 0x060032F8; D_06003428 = 0x06003428; -// ovl_En_Railgibud - -D_060053E8 = 0x060053E8; -D_0600ABE0 = 0x0600ABE0; -D_06010B88 = 0x06010B88; -D_06006678 = 0x06006678; -D_06006B08 = 0x06006B08; -D_06006EEC = 0x06006EEC; -D_060073A4 = 0x060073A4; -D_06007BBC = 0x06007BBC; -D_060081A8 = 0x060081A8; -D_06009298 = 0x06009298; -D_06009900 = 0x06009900; -D_0600A450 = 0x0600A450; -D_060113EC = 0x060113EC; -D_0601216C = 0x0601216C; -D_060118D8 = 0x060118D8; -D_06011DB8 = 0x06011DB8; -D_0600A450 = 0x0600A450; -D_06005DF4 = 0x06005DF4; -D_060061E4 = 0x060061E4; -D_06001600 = 0x06001600; -D_060009C4 = 0x060009C4; -D_06000F1C = 0x06000F1C; - // ovl_En_Rat D_06000174 = 0x06000174; D_0600026C = 0x0600026C; D_06001858 = 0x06001858; -// ovl_En_Rd - -D_060053E8 = 0x060053E8; -D_06006678 = 0x06006678; -D_06006B08 = 0x06006B08; -D_06006EEC = 0x06006EEC; -D_060073A4 = 0x060073A4; -D_06007BBC = 0x06007BBC; -D_060081A8 = 0x060081A8; -D_06009298 = 0x06009298; -D_06009900 = 0x06009900; -D_0600A450 = 0x0600A450; -D_0600ABE0 = 0x0600ABE0; -D_06010B88 = 0x06010B88; -D_060113EC = 0x060113EC; -D_060118D8 = 0x060118D8; -D_06011DB8 = 0x06011DB8; -D_0601216C = 0x0601216C; - -// ovl_En_Recepgirl - -D_06000968 = 0x06000968; -D_06001384 = 0x06001384; -D_06009890 = 0x06009890; -D_0600A280 = 0x0600A280; -D_0600AD98 = 0x0600AD98; -D_0600F8F0 = 0x0600F8F0; -D_0600FCF0 = 0x0600FCF0; -D_060100F0 = 0x060100F0; -D_06011B60 = 0x06011B60; - -// ovl_En_Rg - -D_060091A8 = 0x060091A8; -D_06011AC8 = 0x06011AC8; -D_06014CF0 = 0x06014CF0; -D_06014D00 = 0x06014D00; - -// ovl_En_Rr - -D_06000470 = 0x06000470; - -// ovl_En_Rsn - -D_06005458 = 0x06005458; -D_0600788C = 0x0600788C; -D_06009120 = 0x06009120; -D_06009220 = 0x06009220; - // ovl_En_Ru D_0600C700 = 0x0600C700; @@ -3249,70 +1902,16 @@ D_06003A20 = 0x06003A20; D_0600D768 = 0x0600D768; D_0600D8D8 = 0x0600D8D8; -// ovl_En_Sb - -D_0600004C = 0x0600004C; -D_060000B4 = 0x060000B4; -D_06000124 = 0x06000124; -D_06000194 = 0x06000194; -D_06002BF0 = 0x06002BF0; -D_06002C8C = 0x06002C8C; - // ovl_En_Scopecrow D_060000F0 = 0x060000F0; D_060010C0 = 0x060010C0; -// ovl_En_Scopenuts - -D_06001420 = 0x06001420; -D_06005488 = 0x06005488; -D_06008290 = 0x06008290; -D_0600AC70 = 0x0600AC70; - -// ovl_En_Sellnuts - -D_06001350 = 0x06001350; -D_06005488 = 0x06005488; -D_06008290 = 0x06008290; -D_0600AC70 = 0x0600AC70; -D_06000994 = 0x06000994; -D_060012F4 = 0x060012F4; -D_06001BC8 = 0x06001BC8; -D_06001E2C = 0x06001E2C; -D_06002268 = 0x06002268; -D_06002670 = 0x06002670; -D_060029E8 = 0x060029E8; -D_06002F08 = 0x06002F08; -D_06003438 = 0x06003438; -D_060038CC = 0x060038CC; -D_06003CC0 = 0x06003CC0; -D_06004700 = 0x06004700; -D_06004AA0 = 0x06004AA0; -D_06004E38 = 0x06004E38; -D_0600577C = 0x0600577C; -D_06005CA8 = 0x06005CA8; -D_0600B0B4 = 0x0600B0B4; - // ovl_En_Shn D_0600B738 = 0x0600B738; D_0600E7D0 = 0x0600E7D0; -// ovl_En_Skb - -D_06001D1C = 0x06001D1C; -D_06002190 = 0x06002190; -D_06003584 = 0x06003584; -D_06005EF8 = 0x06005EF8; -D_0600697C = 0x0600697C; -D_06006D90 = 0x06006D90; -D_060009E4 = 0x060009E4; -D_060015EC = 0x060015EC; -D_0600270C = 0x0600270C; -D_06002AC8 = 0x06002AC8; -D_060064E0 = 0x060064E0; - // ovl_En_Slime D_060004C0 = 0x060004C0; @@ -3338,22 +1937,6 @@ D_060058CC = 0x060058CC; D_06000198 = 0x06000198; D_06001AA0 = 0x06001AA0; -// ovl_En_Sob1 - -D_06008268 = 0x06008268; -D_0600D208 = 0x0600D208; -D_0600078C = 0x0600078C; -D_06011AC8 = 0x06011AC8; -D_060000FC = 0x060000FC; -D_06000970 = 0x06000970; -D_060087BC = 0x060087BC; -D_060050A0 = 0x060050A0; -D_060058A0 = 0x060058A0; -D_060060A0 = 0x060060A0; -D_06010438 = 0x06010438; -D_06010C38 = 0x06010C38; -D_06011038 = 0x06011038; - // ovl_En_Ssh D_06000304 = 0x06000304; @@ -3379,36 +1962,6 @@ D_0600D640 = 0x0600D640; D_06006C18 = 0x06006C18; D_0600D640 = 0x0600D640; -// ovl_En_Suttari - -D_0600071C = 0x0600071C; -D_0600AF90 = 0x0600AF90; -D_0600C240 = 0x0600C240; -D_06010BDC = 0x06010BDC; -D_0601139C = 0x0601139C; -D_06011C38 = 0x06011C38; -D_06011F84 = 0x06011F84; -D_060128F4 = 0x060128F4; -D_06012E84 = 0x06012E84; -D_06013380 = 0x06013380; - -// ovl_En_Sw - -D_06003FB0 = 0x06003FB0; -D_060043D8 = 0x060043D8; -D_060045C0 = 0x060045C0; -D_06004658 = 0x06004658; -D_060046F0 = 0x060046F0; -D_06004788 = 0x06004788; -D_06004820 = 0x06004820; -D_060048B8 = 0x060048B8; -D_06004950 = 0x06004950; -D_060049E8 = 0x060049E8; -D_06005298 = 0x06005298; -D_06000304 = 0x06000304; -D_060055A8 = 0x060055A8; -D_06005B98 = 0x06005B98; - // ovl_En_Syateki_Crow D_060000F0 = 0x060000F0; @@ -3421,18 +1974,6 @@ D_06002468 = 0x06002468; D_06002A5C = 0x06002A5C; D_06003180 = 0x06003180; -// ovl_En_Syateki_Man - -D_06005AC8 = 0x06005AC8; -D_060062C8 = 0x060062C8; -D_0600D2F8 = 0x0600D2F8; -D_0600D9D0 = 0x0600D9D0; -D_0600DFEC = 0x0600DFEC; -D_0600E7D0 = 0x0600E7D0; -D_0600F2D0 = 0x0600F2D0; -D_0600FB90 = 0x0600FB90; -D_06010390 = 0x06010390; - // ovl_En_Syateki_Okuta D_060033D0 = 0x060033D0; @@ -3469,11 +2010,6 @@ D_060034C8 = 0x060034C8; D_06004510 = 0x06004510; D_06004550 = 0x06004550; -// ovl_En_Tanron3 - -D_0600DA20 = 0x0600DA20; -D_0600DAAC = 0x0600DAAC; - // ovl_En_Tanron4 D_06000168 = 0x06000168; @@ -3497,99 +2033,10 @@ D_0600B0A0 = 0x0600B0A0; D_0600B0E0 = 0x0600B0E0; D_0600B2B0 = 0x0600B2B0; -// ovl_En_Thiefbird - -D_06000088 = 0x06000088; -D_06000278 = 0x06000278; -D_06000604 = 0x06000604; -D_06003060 = 0x06003060; -D_060030D8 = 0x060030D8; -D_060033B0 = 0x060033B0; -D_06003D58 = 0x06003D58; -D_060061A0 = 0x060061A0; -D_060063C4 = 0x060063C4; -D_06004348 = 0x06004348; -D_06004B88 = 0x06004B88; -D_060055E0 = 0x060055E0; - -// ovl_En_Tite - -D_060004F8 = 0x060004F8; -D_0600069C = 0x0600069C; -D_0600083C = 0x0600083C; -D_06000A14 = 0x06000A14; -D_06000C70 = 0x06000C70; -D_060012E4 = 0x060012E4; -D_06003A20 = 0x06003A20; -D_06001300 = 0x06001300; -D_06001700 = 0x06001700; -D_06001900 = 0x06001900; -D_06001B00 = 0x06001B00; -D_06001F00 = 0x06001F00; -D_06002100 = 0x06002100; - -// ovl_En_Tk - -D_06001144 = 0x06001144; -D_06001FA8 = 0x06001FA8; -D_060020C8 = 0x060020C8; -D_060030A4 = 0x060030A4; -D_06003724 = 0x06003724; -D_06003B10 = 0x06003B10; -D_06003FB8 = 0x06003FB8; -D_06004390 = 0x06004390; -D_06004B90 = 0x06004B90; -D_06005390 = 0x06005390; -D_0600B530 = 0x0600B530; -D_0600B9E8 = 0x0600B9E8; - -// ovl_En_Torch2 - -D_0401C430 = 0x0401C430; -D_04048DF0 = 0x04048DF0; -D_04057B10 = 0x04057B10; -D_04089070 = 0x04089070; - -// ovl_En_Toto - -D_06000C80 = 0x06000C80; -D_06001324 = 0x06001324; -D_060016A4 = 0x060016A4; -D_06001DF0 = 0x06001DF0; -D_060022C8 = 0x060022C8; -D_060028B8 = 0x060028B8; -D_06002F20 = 0x06002F20; -D_06003AA8 = 0x06003AA8; -D_06008AE8 = 0x06008AE8; -D_0600A068 = 0x0600A068; -D_0600A468 = 0x0600A468; -D_0600A978 = 0x0600A978; -D_0600B3E0 = 0x0600B3E0; -D_0600B894 = 0x0600B894; -D_0600BC08 = 0x0600BC08; -D_0600C880 = 0x0600C880; - // ovl_En_Trt D_0600FEF0 = 0x0600FEF0; -D_0600FD34 = 0x0600FD34; -D_0600DE68 = 0x0600DE68; -D_06002224 = 0x06002224; -D_06001EF4 = 0x06001EF4; -D_060030EC = 0x060030EC; -D_0600D52C = 0x0600D52C; -D_06002CB0 = 0x06002CB0; -D_0600EE98 = 0x0600EE98; -D_06003D78 = 0x06003D78; D_06000A44 = 0x06000A44; -D_0600B0B8 = 0x0600B0B8; -D_0600B8B8 = 0x0600B8B8; -D_0600C0B8 = 0x0600C0B8; - -// ovl_En_Trt2 - -D_06000A44 = 0x06000A44; -D_0600FEF0 = 0x0600FEF0; // ovl_En_Tru @@ -3633,10 +2080,6 @@ D_06009520 = 0x06009520; D_06009DB0 = 0x06009DB0; D_0600A054 = 0x0600A054; -// ovl_En_Warp_Uzu - -D_06000EC0 = 0x06000EC0; - // ovl_En_Wdhand D_060000F4 = 0x060000F4; @@ -3647,25 +2090,6 @@ D_060014C0 = 0x060014C0; D_060015B0 = 0x060015B0; D_06001E20 = 0x06001E20; -// ovl_En_Wf - -D_06000300 = 0x06000300; -D_060027D8 = 0x060027D8; -D_060029D8 = 0x060029D8; -D_06003BC0 = 0x06003BC0; -D_06004638 = 0x06004638; -D_06004A90 = 0x06004A90; -D_06004C44 = 0x06004C44; -D_060053D0 = 0x060053D0; -D_06005700 = 0x06005700; -D_06007AA8 = 0x06007AA8; -D_060082A8 = 0x060082A8; -D_060084A8 = 0x060084A8; -D_060095D0 = 0x060095D0; -D_06009808 = 0x06009808; -D_06009A50 = 0x06009A50; -D_0600A3CC = 0x0600A3CC; - // ovl_En_Wiz D_06001860 = 0x06001860; @@ -3694,10 +2118,6 @@ D_06005F48 = 0x06005F48; D_06013328 = 0x06013328; -// ovl_En_Zo - -D_0600D208 = 0x0600D208; - // ovl_En_Zob D_06006998 = 0x06006998; @@ -3720,30 +2140,6 @@ D_06004FE4 = 0x06004FE4; D_06005098 = 0x06005098; D_06005250 = 0x06005250; -// ovl_En_Zos - -D_0600A164 = 0x0600A164; -D_06013088 = 0x06013088; -D_060136E0 = 0x060136E0; -D_06015238 = 0x06015238; - -// ovl_En_Zot - -D_06002898 = 0x06002898; -D_06004248 = 0x06004248; -D_060050A0 = 0x060050A0; -D_060058A0 = 0x060058A0; -D_060060A0 = 0x060060A0; -D_0600D208 = 0x0600D208; -D_0600DE20 = 0x0600DE20; -D_0600DF54 = 0x0600DF54; -D_0600E400 = 0x0600E400; -D_0600EDF0 = 0x0600EDF0; -D_0600F4E8 = 0x0600F4E8; -D_0600FDF0 = 0x0600FDF0; -D_06010B18 = 0x06010B18; -D_06011424 = 0x06011424; - // ovl_En_Zov D_0600D3EC = 0x0600D3EC; @@ -3761,11 +2157,6 @@ D_0600D208 = 0x0600D208; D_0600D220 = 0x0600D220; D_0600D288 = 0x0600D288; -// ovl_Item_B_Heart - -D_06001290 = 0x06001290; -D_06001470 = 0x06001470; - // ovl_Mir_Ray D_06000168 = 0x06000168; @@ -3792,16 +2183,6 @@ D_060004BC = 0x060004BC; D_06000530 = 0x06000530; D_06002208 = 0x06002208; -// ovl_Obj_Bell - -D_06000570 = 0x06000570; -D_06000698 = 0x06000698; -D_060007A8 = 0x060007A8; -D_06000840 = 0x06000840; -D_060008D0 = 0x060008D0; -D_06000960 = 0x06000960; -D_06001BA8 = 0x06001BA8; - // ovl_Obj_Bigicicle D_060009B0 = 0x060009B0; @@ -3820,11 +2201,6 @@ D_06004560 = 0x06004560; D_06004688 = 0x06004688; D_06005990 = 0x06005990; -// ovl_Obj_Boyo - -D_06000300 = 0x06000300; -D_06000E88 = 0x06000E88; - // ovl_Obj_Chan D_06000A10 = 0x06000A10; @@ -3854,10 +2230,6 @@ D_06005A78 = 0x06005A78; D_06008040 = 0x06008040; D_060081D8 = 0x060081D8; -// ovl_Obj_Dinner - -D_060011E0 = 0x060011E0; - // ovl_Obj_Dora D_06003FD0 = 0x06003FD0; @@ -3868,28 +2240,11 @@ D_06004160 = 0x06004160; D_060016A0 = 0x060016A0; D_06001AA8 = 0x06001AA8; -// ovl_Obj_Ending - -D_060003D0 = 0x060003D0; -D_06001FF8 = 0x06001FF8; -D_060031A0 = 0x060031A0; -D_06003440 = 0x06003440; - // ovl_Obj_Entotu D_06000158 = 0x06000158; D_06001C00 = 0x06001C00; -// ovl_Obj_Funen - -D_060000D0 = 0x060000D0; - -// ovl_Obj_Ghaka - -D_06001980 = 0x06001980; -D_06001A20 = 0x06001A20; -D_06003CD0 = 0x06003CD0; - // ovl_Obj_Hakaisi D_06001F10 = 0x06001F10; @@ -3899,29 +2254,11 @@ D_060029C0 = 0x060029C0; D_06002CC0 = 0x06002CC0; D_06002FC4 = 0x06002FC4; -// ovl_Obj_Hana - -D_06000500 = 0x06000500; - // ovl_Obj_Hariko D_06000080 = 0x06000080; D_06000110 = 0x06000110; -// ovl_Obj_Hgdoor - -D_06001670 = 0x06001670; -D_06001768 = 0x06001768; -D_060018C0 = 0x060018C0; -D_06001AB0 = 0x06001AB0; -D_06001BA8 = 0x06001BA8; -D_06001D10 = 0x06001D10; - -// ovl_Obj_HsStump - -D_060003B8 = 0x060003B8; -D_060011B0 = 0x060011B0; - // ovl_Obj_Hunsui D_06000220 = 0x06000220; @@ -3943,56 +2280,22 @@ D_0601B210 = 0x0601B210; D_06000180 = 0x06000180; -// ovl_Obj_Kepn_Koya - -D_06003478 = 0x06003478; -D_0600805C = 0x0600805C; - -// ovl_Obj_Kzsaku - -D_06000040 = 0x06000040; -D_06001118 = 0x06001118; - // ovl_Obj_Lift D_06000D10 = 0x06000D10; D_06000F00 = 0x06000F00; -// ovl_Obj_Lightblock - -D_06000178 = 0x06000178; -D_06000B80 = 0x06000B80; - -// ovl_Obj_Lightswitch - -D_06000260 = 0x06000260; -D_06000398 = 0x06000398; -D_06000408 = 0x06000408; -D_06000420 = 0x06000420; -D_06000C20 = 0x06000C20; -D_06001420 = 0x06001420; - // ovl_Obj_Lupygamelift D_060048D0 = 0x060048D0; D_060071B8 = 0x060071B8; -// ovl_Obj_Milk_Bin - -D_060004B0 = 0x060004B0; - // ovl_Obj_Mine D_06000030 = 0x06000030; D_06002068 = 0x06002068; D_06002188 = 0x06002188; -// ovl_Obj_Moon_Stone - -D_06000C80 = 0x06000C80; -D_06000D78 = 0x06000D78; -D_06001C60 = 0x06001C60; - // ovl_Obj_Nozoki D_060001C0 = 0x060001C0; @@ -4003,14 +2306,6 @@ D_06001DB0 = 0x06001DB0; D_06001E40 = 0x06001E40; D_060048D0 = 0x060048D0; -// ovl_Obj_Raillift - -D_06000208 = 0x06000208; -D_060048D0 = 0x060048D0; -D_06004BF0 = 0x06004BF0; -D_06004FF8 = 0x06004FF8; -D_060071B8 = 0x060071B8; - // ovl_Obj_Shutter D_060011E0 = 0x060011E0; @@ -4028,12 +2323,6 @@ D_06008B90 = 0x06008B90; D_06000460 = 0x06000460; D_06000E68 = 0x06000E68; -// ovl_Obj_Syokudai - -D_060003A0 = 0x060003A0; -D_06000870 = 0x06000870; -D_06000B90 = 0x06000B90; - // ovl_Obj_Takaraya_Wall D_06000B70 = 0x06000B70; @@ -4065,12 +2354,6 @@ D_06003038 = 0x06003038; D_060023B0 = 0x060023B0; D_060024E8 = 0x060024E8; -// ovl_Obj_Tree - -D_06000680 = 0x06000680; -D_060007C8 = 0x060007C8; -D_06001B2C = 0x06001B2C; - // ovl_Obj_Um D_06007E20 = 0x06007E20; @@ -4084,11 +2367,6 @@ D_06000098 = 0x06000098; D_06000838 = 0x06000838; D_060022AC = 0x060022AC; -// ovl_Obj_Visiblock - -D_06000140 = 0x06000140; -D_06000AD0 = 0x06000AD0; - // ovl_Obj_Vspinyroll D_06000460 = 0x06000460; @@ -4099,12 +2377,6 @@ D_06000F80 = 0x06000F80; D_06001680 = 0x06001680; D_060019B0 = 0x060019B0; -// ovl_Obj_Yado - -D_06000320 = 0x06000320; -D_06000430 = 0x06000430; -D_060012E8 = 0x060012E8; - // ovl_Obj_Yasi D_06000360 = 0x06000360;