From d253deb2b95e96323d9b8fddd3e4aa629203ebd4 Mon Sep 17 00:00:00 2001 From: Caroline Madsen <69010899+randomsalience@users.noreply.github.com> Date: Wed, 17 Apr 2024 10:47:22 -0400 Subject: [PATCH] d_a_do done but nonmatching, d_a_obj_food OK (#2135) --- Progress.md | 10 +- .../d_a_obj_food/__ct__16daObj_Food_HIO_cFv.s | 10 - .../d_a_obj_food/__dt__12dBgS_ObjAcchFv.s | 30 - .../d_a_obj_food/__dt__16daObj_Food_HIO_cFv.s | 20 - .../d_a_obj_food/__dt__8cM3dGAabFv.s | 20 - .../d_a_obj_food/__dt__8cM3dGSphFv.s | 20 - .../d_a_obj_food/__sinit_d_a_obj_food_cpp.s | 16 - .../d_a_obj_food/action__FP14obj_food_class.s | 376 --- .../ball_move__FP14obj_food_class.s | 114 - .../daObj_Food_Create__FP10fopAc_ac_c.s | 209 -- .../daObj_Food_Delete__FP14obj_food_class.s | 29 - .../daObj_Food_Draw__FP14obj_food_class.s | 78 - .../daObj_Food_Execute__FP14obj_food_class.s | 40 - .../food_carry__FP14obj_food_class.s | 79 - .../food_normal__FP14obj_food_class.s | 224 -- .../d_a_obj_food/d_a_obj_food/func_80BF1D6C.s | 3 - .../d_a_obj_food/d_a_obj_food/func_80BF1D74.s | 3 - .../ground_ang_set__FP14obj_food_class.s | 87 - .../useHeapInit__FP10fopAc_ac_c.s | 55 - .../wall_angle_get__FP14obj_food_class.s | 110 - include/f_op/f_op_actor_mng.h | 17 + include/rel/d/a/d_a_do/d_a_do.h | 145 +- .../rel/d/a/obj/d_a_obj_food/d_a_obj_food.h | 46 + rel/d/a/d_a_do/d_a_do.cpp | 538 ++-- rel/d/a/d_a_do/d_a_do_NONMATCHING.cpp | 2827 +++++++++++++++++ rel/d/a/obj/d_a_obj_food/d_a_obj_food.cpp | 1245 +++----- 26 files changed, 3722 insertions(+), 2629 deletions(-) delete mode 100644 asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/__ct__16daObj_Food_HIO_cFv.s delete mode 100644 asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/__dt__12dBgS_ObjAcchFv.s delete mode 100644 asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/__dt__16daObj_Food_HIO_cFv.s delete mode 100644 asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/__dt__8cM3dGAabFv.s delete mode 100644 asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/__dt__8cM3dGSphFv.s delete mode 100644 asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/__sinit_d_a_obj_food_cpp.s delete mode 100644 asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/action__FP14obj_food_class.s delete mode 100644 asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/ball_move__FP14obj_food_class.s delete mode 100644 asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/daObj_Food_Create__FP10fopAc_ac_c.s delete mode 100644 asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/daObj_Food_Delete__FP14obj_food_class.s delete mode 100644 asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/daObj_Food_Draw__FP14obj_food_class.s delete mode 100644 asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/daObj_Food_Execute__FP14obj_food_class.s delete mode 100644 asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/food_carry__FP14obj_food_class.s delete mode 100644 asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/food_normal__FP14obj_food_class.s delete mode 100644 asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/func_80BF1D6C.s delete mode 100644 asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/func_80BF1D74.s delete mode 100644 asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/ground_ang_set__FP14obj_food_class.s delete mode 100644 asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/useHeapInit__FP10fopAc_ac_c.s delete mode 100644 asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/wall_angle_get__FP14obj_food_class.s create mode 100644 rel/d/a/d_a_do/d_a_do_NONMATCHING.cpp diff --git a/Progress.md b/Progress.md index a9bea36f0c4..7dfac5aadab 100644 --- a/Progress.md +++ b/Progress.md @@ -21,8 +21,8 @@ Total | 54.157315% | 2177488 | 4020672 Section | Percentage | Decompiled (bytes) | Total (bytes) ---|---|---|--- main.dol | 54.157315% | 2177488 | 4020672 -RELs | 37.663808% | 4331460 | 11500324 -Total | 41.936407% | 6508948 | 15520996 +RELs | 37.780466% | 4344876 | 11500324 +Total | 42.022844% | 6522364 | 15520996 ## RELs @@ -78,7 +78,7 @@ d_a_door_boss | 100.000000% | 9056 | 9056 d_a_door_bossL1 | 100.000000% | 18732 | 18732 d_a_door_bossL5 | 100.000000% | 10280 | 10280 d_a_door_dbdoor00 | 100.000000% | 7620 | 7620 -d_a_door_knob00 | 37.500000% | 4608 | 12288 +d_a_door_knob00 | 100.000000% | 12288 | 12288 d_a_door_mbossL1 | 34.467633% | 10372 | 30092 d_a_door_push | 100.000000% | 7032 | 7032 d_a_door_shutter | 37.465797% | 14240 | 38008 @@ -408,7 +408,7 @@ d_a_obj_flag | 37.518248% | 2056 | 5480 d_a_obj_flag2 | 46.370840% | 5852 | 12620 d_a_obj_flag3 | 33.292929% | 3296 | 9900 d_a_obj_fmobj | 80.800000% | 1616 | 2000 -d_a_obj_food | 36.994728% | 3368 | 9104 +d_a_obj_food | 100.000000% | 9104 | 9104 d_a_obj_fw | 43.368592% | 2132 | 4916 d_a_obj_gadget | 34.371565% | 3752 | 10916 d_a_obj_ganonwall | 38.930481% | 1456 | 3740 @@ -785,4 +785,4 @@ d_a_vrbox2 | 44.907111% | 2804 | 6244 d_a_warp_bug | 100.000000% | 2024 | 2024 d_a_ykgr | 44.400631% | 2252 | 5072 f_pc_profile_lst | 100.000000% | 28156 | 28156 -Total | 37.663808% | 4331460 | 11500324 +Total | 37.780466% | 4344876 | 11500324 diff --git a/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/__ct__16daObj_Food_HIO_cFv.s b/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/__ct__16daObj_Food_HIO_cFv.s deleted file mode 100644 index 1179c6be91d..00000000000 --- a/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/__ct__16daObj_Food_HIO_cFv.s +++ /dev/null @@ -1,10 +0,0 @@ -lbl_80BF070C: -/* 80BF070C 3C 80 80 BF */ lis r4, __vt__16daObj_Food_HIO_c@ha /* 0x80BF1F2C@ha */ -/* 80BF0710 38 04 1F 2C */ addi r0, r4, __vt__16daObj_Food_HIO_c@l /* 0x80BF1F2C@l */ -/* 80BF0714 90 03 00 00 */ stw r0, 0(r3) -/* 80BF0718 38 00 FF FF */ li r0, -1 -/* 80BF071C 98 03 00 04 */ stb r0, 4(r3) -/* 80BF0720 3C 80 80 BF */ lis r4, lit_3647@ha /* 0x80BF1D90@ha */ -/* 80BF0724 C0 04 1D 90 */ lfs f0, lit_3647@l(r4) /* 0x80BF1D90@l */ -/* 80BF0728 D0 03 00 08 */ stfs f0, 8(r3) -/* 80BF072C 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/__dt__12dBgS_ObjAcchFv.s b/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/__dt__12dBgS_ObjAcchFv.s deleted file mode 100644 index bf88d6fca5e..00000000000 --- a/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/__dt__12dBgS_ObjAcchFv.s +++ /dev/null @@ -1,30 +0,0 @@ -lbl_80BF1C78: -/* 80BF1C78 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 80BF1C7C 7C 08 02 A6 */ mflr r0 -/* 80BF1C80 90 01 00 14 */ stw r0, 0x14(r1) -/* 80BF1C84 93 E1 00 0C */ stw r31, 0xc(r1) -/* 80BF1C88 93 C1 00 08 */ stw r30, 8(r1) -/* 80BF1C8C 7C 7E 1B 79 */ or. r30, r3, r3 -/* 80BF1C90 7C 9F 23 78 */ mr r31, r4 -/* 80BF1C94 41 82 00 38 */ beq lbl_80BF1CCC -/* 80BF1C98 3C 80 80 BF */ lis r4, __vt__12dBgS_ObjAcch@ha /* 0x80BF1F08@ha */ -/* 80BF1C9C 38 84 1F 08 */ addi r4, r4, __vt__12dBgS_ObjAcch@l /* 0x80BF1F08@l */ -/* 80BF1CA0 90 9E 00 10 */ stw r4, 0x10(r30) -/* 80BF1CA4 38 04 00 0C */ addi r0, r4, 0xc -/* 80BF1CA8 90 1E 00 14 */ stw r0, 0x14(r30) -/* 80BF1CAC 38 04 00 18 */ addi r0, r4, 0x18 -/* 80BF1CB0 90 1E 00 24 */ stw r0, 0x24(r30) -/* 80BF1CB4 38 80 00 00 */ li r4, 0 -/* 80BF1CB8 4B 48 42 DD */ bl __dt__9dBgS_AcchFv -/* 80BF1CBC 7F E0 07 35 */ extsh. r0, r31 -/* 80BF1CC0 40 81 00 0C */ ble lbl_80BF1CCC -/* 80BF1CC4 7F C3 F3 78 */ mr r3, r30 -/* 80BF1CC8 4B 6D D0 75 */ bl __dl__FPv -lbl_80BF1CCC: -/* 80BF1CCC 7F C3 F3 78 */ mr r3, r30 -/* 80BF1CD0 83 E1 00 0C */ lwz r31, 0xc(r1) -/* 80BF1CD4 83 C1 00 08 */ lwz r30, 8(r1) -/* 80BF1CD8 80 01 00 14 */ lwz r0, 0x14(r1) -/* 80BF1CDC 7C 08 03 A6 */ mtlr r0 -/* 80BF1CE0 38 21 00 10 */ addi r1, r1, 0x10 -/* 80BF1CE4 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/__dt__16daObj_Food_HIO_cFv.s b/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/__dt__16daObj_Food_HIO_cFv.s deleted file mode 100644 index f7a5953bc95..00000000000 --- a/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/__dt__16daObj_Food_HIO_cFv.s +++ /dev/null @@ -1,20 +0,0 @@ -lbl_80BF1CE8: -/* 80BF1CE8 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 80BF1CEC 7C 08 02 A6 */ mflr r0 -/* 80BF1CF0 90 01 00 14 */ stw r0, 0x14(r1) -/* 80BF1CF4 93 E1 00 0C */ stw r31, 0xc(r1) -/* 80BF1CF8 7C 7F 1B 79 */ or. r31, r3, r3 -/* 80BF1CFC 41 82 00 1C */ beq lbl_80BF1D18 -/* 80BF1D00 3C A0 80 BF */ lis r5, __vt__16daObj_Food_HIO_c@ha /* 0x80BF1F2C@ha */ -/* 80BF1D04 38 05 1F 2C */ addi r0, r5, __vt__16daObj_Food_HIO_c@l /* 0x80BF1F2C@l */ -/* 80BF1D08 90 1F 00 00 */ stw r0, 0(r31) -/* 80BF1D0C 7C 80 07 35 */ extsh. r0, r4 -/* 80BF1D10 40 81 00 08 */ ble lbl_80BF1D18 -/* 80BF1D14 4B 6D D0 29 */ bl __dl__FPv -lbl_80BF1D18: -/* 80BF1D18 7F E3 FB 78 */ mr r3, r31 -/* 80BF1D1C 83 E1 00 0C */ lwz r31, 0xc(r1) -/* 80BF1D20 80 01 00 14 */ lwz r0, 0x14(r1) -/* 80BF1D24 7C 08 03 A6 */ mtlr r0 -/* 80BF1D28 38 21 00 10 */ addi r1, r1, 0x10 -/* 80BF1D2C 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/__dt__8cM3dGAabFv.s b/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/__dt__8cM3dGAabFv.s deleted file mode 100644 index 4ce44ec1e25..00000000000 --- a/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/__dt__8cM3dGAabFv.s +++ /dev/null @@ -1,20 +0,0 @@ -lbl_80BF1C30: -/* 80BF1C30 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 80BF1C34 7C 08 02 A6 */ mflr r0 -/* 80BF1C38 90 01 00 14 */ stw r0, 0x14(r1) -/* 80BF1C3C 93 E1 00 0C */ stw r31, 0xc(r1) -/* 80BF1C40 7C 7F 1B 79 */ or. r31, r3, r3 -/* 80BF1C44 41 82 00 1C */ beq lbl_80BF1C60 -/* 80BF1C48 3C A0 80 BF */ lis r5, __vt__8cM3dGAab@ha /* 0x80BF1EFC@ha */ -/* 80BF1C4C 38 05 1E FC */ addi r0, r5, __vt__8cM3dGAab@l /* 0x80BF1EFC@l */ -/* 80BF1C50 90 1F 00 18 */ stw r0, 0x18(r31) -/* 80BF1C54 7C 80 07 35 */ extsh. r0, r4 -/* 80BF1C58 40 81 00 08 */ ble lbl_80BF1C60 -/* 80BF1C5C 4B 6D D0 E1 */ bl __dl__FPv -lbl_80BF1C60: -/* 80BF1C60 7F E3 FB 78 */ mr r3, r31 -/* 80BF1C64 83 E1 00 0C */ lwz r31, 0xc(r1) -/* 80BF1C68 80 01 00 14 */ lwz r0, 0x14(r1) -/* 80BF1C6C 7C 08 03 A6 */ mtlr r0 -/* 80BF1C70 38 21 00 10 */ addi r1, r1, 0x10 -/* 80BF1C74 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/__dt__8cM3dGSphFv.s b/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/__dt__8cM3dGSphFv.s deleted file mode 100644 index d641c9e6319..00000000000 --- a/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/__dt__8cM3dGSphFv.s +++ /dev/null @@ -1,20 +0,0 @@ -lbl_80BF1BE8: -/* 80BF1BE8 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 80BF1BEC 7C 08 02 A6 */ mflr r0 -/* 80BF1BF0 90 01 00 14 */ stw r0, 0x14(r1) -/* 80BF1BF4 93 E1 00 0C */ stw r31, 0xc(r1) -/* 80BF1BF8 7C 7F 1B 79 */ or. r31, r3, r3 -/* 80BF1BFC 41 82 00 1C */ beq lbl_80BF1C18 -/* 80BF1C00 3C A0 80 BF */ lis r5, __vt__8cM3dGSph@ha /* 0x80BF1EF0@ha */ -/* 80BF1C04 38 05 1E F0 */ addi r0, r5, __vt__8cM3dGSph@l /* 0x80BF1EF0@l */ -/* 80BF1C08 90 1F 00 10 */ stw r0, 0x10(r31) -/* 80BF1C0C 7C 80 07 35 */ extsh. r0, r4 -/* 80BF1C10 40 81 00 08 */ ble lbl_80BF1C18 -/* 80BF1C14 4B 6D D1 29 */ bl __dl__FPv -lbl_80BF1C18: -/* 80BF1C18 7F E3 FB 78 */ mr r3, r31 -/* 80BF1C1C 83 E1 00 0C */ lwz r31, 0xc(r1) -/* 80BF1C20 80 01 00 14 */ lwz r0, 0x14(r1) -/* 80BF1C24 7C 08 03 A6 */ mtlr r0 -/* 80BF1C28 38 21 00 10 */ addi r1, r1, 0x10 -/* 80BF1C2C 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/__sinit_d_a_obj_food_cpp.s b/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/__sinit_d_a_obj_food_cpp.s deleted file mode 100644 index 0daa18ecb50..00000000000 --- a/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/__sinit_d_a_obj_food_cpp.s +++ /dev/null @@ -1,16 +0,0 @@ -lbl_80BF1D30: -/* 80BF1D30 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 80BF1D34 7C 08 02 A6 */ mflr r0 -/* 80BF1D38 90 01 00 14 */ stw r0, 0x14(r1) -/* 80BF1D3C 3C 60 80 BF */ lis r3, l_HIO@ha /* 0x80BF1F50@ha */ -/* 80BF1D40 38 63 1F 50 */ addi r3, r3, l_HIO@l /* 0x80BF1F50@l */ -/* 80BF1D44 4B FF E9 C9 */ bl __ct__16daObj_Food_HIO_cFv -/* 80BF1D48 3C 80 80 BF */ lis r4, __dt__16daObj_Food_HIO_cFv@ha /* 0x80BF1CE8@ha */ -/* 80BF1D4C 38 84 1C E8 */ addi r4, r4, __dt__16daObj_Food_HIO_cFv@l /* 0x80BF1CE8@l */ -/* 80BF1D50 3C A0 80 BF */ lis r5, lit_3642@ha /* 0x80BF1F44@ha */ -/* 80BF1D54 38 A5 1F 44 */ addi r5, r5, lit_3642@l /* 0x80BF1F44@l */ -/* 80BF1D58 4B FF E9 41 */ bl __register_global_object -/* 80BF1D5C 80 01 00 14 */ lwz r0, 0x14(r1) -/* 80BF1D60 7C 08 03 A6 */ mtlr r0 -/* 80BF1D64 38 21 00 10 */ addi r1, r1, 0x10 -/* 80BF1D68 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/action__FP14obj_food_class.s b/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/action__FP14obj_food_class.s deleted file mode 100644 index bbc35f12d98..00000000000 --- a/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/action__FP14obj_food_class.s +++ /dev/null @@ -1,376 +0,0 @@ -lbl_80BF1168: -/* 80BF1168 94 21 FF 50 */ stwu r1, -0xb0(r1) -/* 80BF116C 7C 08 02 A6 */ mflr r0 -/* 80BF1170 90 01 00 B4 */ stw r0, 0xb4(r1) -/* 80BF1174 39 61 00 B0 */ addi r11, r1, 0xb0 -/* 80BF1178 4B 77 10 51 */ bl _savegpr_24 -/* 80BF117C 7C 7E 1B 78 */ mr r30, r3 -/* 80BF1180 3C 80 80 BF */ lis r4, lit_3647@ha /* 0x80BF1D90@ha */ -/* 80BF1184 3B E4 1D 90 */ addi r31, r4, lit_3647@l /* 0x80BF1D90@l */ -/* 80BF1188 88 03 05 67 */ lbz r0, 0x567(r3) -/* 80BF118C 7C 00 07 74 */ extsb r0, r0 -/* 80BF1190 2C 00 00 03 */ cmpwi r0, 3 -/* 80BF1194 41 82 00 60 */ beq lbl_80BF11F4 -/* 80BF1198 40 80 00 1C */ bge lbl_80BF11B4 -/* 80BF119C 2C 00 00 01 */ cmpwi r0, 1 -/* 80BF11A0 41 82 00 2C */ beq lbl_80BF11CC -/* 80BF11A4 40 80 00 3C */ bge lbl_80BF11E0 -/* 80BF11A8 2C 00 00 00 */ cmpwi r0, 0 -/* 80BF11AC 40 80 00 18 */ bge lbl_80BF11C4 -/* 80BF11B0 48 00 00 68 */ b lbl_80BF1218 -lbl_80BF11B4: -/* 80BF11B4 2C 00 00 05 */ cmpwi r0, 5 -/* 80BF11B8 41 82 00 5C */ beq lbl_80BF1214 -/* 80BF11BC 40 80 00 5C */ bge lbl_80BF1218 -/* 80BF11C0 48 00 00 44 */ b lbl_80BF1204 -lbl_80BF11C4: -/* 80BF11C4 4B FF FA B1 */ bl food_normal__FP14obj_food_class -/* 80BF11C8 48 00 00 50 */ b lbl_80BF1218 -lbl_80BF11CC: -/* 80BF11CC 4B FF FA A9 */ bl food_normal__FP14obj_food_class -/* 80BF11D0 80 1E 05 5C */ lwz r0, 0x55c(r30) -/* 80BF11D4 54 00 07 34 */ rlwinm r0, r0, 0, 0x1c, 0x1a -/* 80BF11D8 90 1E 05 5C */ stw r0, 0x55c(r30) -/* 80BF11DC 48 00 00 3C */ b lbl_80BF1218 -lbl_80BF11E0: -/* 80BF11E0 4B FF F7 C5 */ bl food_carry__FP14obj_food_class -/* 80BF11E4 80 1E 05 5C */ lwz r0, 0x55c(r30) -/* 80BF11E8 54 00 07 34 */ rlwinm r0, r0, 0, 0x1c, 0x1a -/* 80BF11EC 90 1E 05 5C */ stw r0, 0x55c(r30) -/* 80BF11F0 48 00 00 28 */ b lbl_80BF1218 -lbl_80BF11F4: -/* 80BF11F4 80 1E 05 5C */ lwz r0, 0x55c(r30) -/* 80BF11F8 54 00 07 34 */ rlwinm r0, r0, 0, 0x1c, 0x1a -/* 80BF11FC 90 1E 05 5C */ stw r0, 0x55c(r30) -/* 80BF1200 48 00 00 18 */ b lbl_80BF1218 -lbl_80BF1204: -/* 80BF1204 38 00 00 00 */ li r0, 0 -/* 80BF1208 98 1E 05 67 */ stb r0, 0x567(r30) -/* 80BF120C B0 1E 05 7E */ sth r0, 0x57e(r30) -/* 80BF1210 48 00 00 08 */ b lbl_80BF1218 -lbl_80BF1214: -/* 80BF1214 4B FF FD AD */ bl ball_move__FP14obj_food_class -lbl_80BF1218: -/* 80BF1218 88 1E 05 70 */ lbz r0, 0x570(r30) -/* 80BF121C 28 00 00 01 */ cmplwi r0, 1 -/* 80BF1220 40 82 01 98 */ bne lbl_80BF13B8 -/* 80BF1224 A8 7E 04 DC */ lha r3, 0x4dc(r30) -/* 80BF1228 C0 3F 00 64 */ lfs f1, 0x64(r31) -/* 80BF122C C0 1E 05 2C */ lfs f0, 0x52c(r30) -/* 80BF1230 EC 01 00 32 */ fmuls f0, f1, f0 -/* 80BF1234 FC 00 00 1E */ fctiwz f0, f0 -/* 80BF1238 D8 01 00 80 */ stfd f0, 0x80(r1) -/* 80BF123C 80 01 00 84 */ lwz r0, 0x84(r1) -/* 80BF1240 7C 03 02 14 */ add r0, r3, r0 -/* 80BF1244 B0 1E 04 DC */ sth r0, 0x4dc(r30) -/* 80BF1248 3C 60 80 45 */ lis r3, calc_mtx@ha /* 0x80450768@ha */ -/* 80BF124C 38 63 07 68 */ addi r3, r3, calc_mtx@l /* 0x80450768@l */ -/* 80BF1250 80 63 00 00 */ lwz r3, 0(r3) -/* 80BF1254 A8 9E 04 DE */ lha r4, 0x4de(r30) -/* 80BF1258 4B 41 B1 85 */ bl mDoMtx_YrotS__FPA4_fs -/* 80BF125C C0 1F 00 0C */ lfs f0, 0xc(r31) -/* 80BF1260 D0 01 00 70 */ stfs f0, 0x70(r1) -/* 80BF1264 D0 01 00 74 */ stfs f0, 0x74(r1) -/* 80BF1268 C0 1E 05 2C */ lfs f0, 0x52c(r30) -/* 80BF126C D0 01 00 78 */ stfs f0, 0x78(r1) -/* 80BF1270 38 61 00 70 */ addi r3, r1, 0x70 -/* 80BF1274 38 81 00 64 */ addi r4, r1, 0x64 -/* 80BF1278 4B 67 FC 75 */ bl MtxPosition__FP4cXyzP4cXyz -/* 80BF127C C0 01 00 64 */ lfs f0, 0x64(r1) -/* 80BF1280 D0 1E 04 F8 */ stfs f0, 0x4f8(r30) -/* 80BF1284 C0 01 00 6C */ lfs f0, 0x6c(r1) -/* 80BF1288 D0 1E 05 00 */ stfs f0, 0x500(r30) -/* 80BF128C 38 7E 04 D0 */ addi r3, r30, 0x4d0 -/* 80BF1290 38 9E 04 F8 */ addi r4, r30, 0x4f8 -/* 80BF1294 7C 65 1B 78 */ mr r5, r3 -/* 80BF1298 4B 75 5D F9 */ bl PSVECAdd -/* 80BF129C C0 3E 04 FC */ lfs f1, 0x4fc(r30) -/* 80BF12A0 C0 1F 00 58 */ lfs f0, 0x58(r31) -/* 80BF12A4 EC 01 00 28 */ fsubs f0, f1, f0 -/* 80BF12A8 D0 1E 04 FC */ stfs f0, 0x4fc(r30) -/* 80BF12AC C0 1E 04 D4 */ lfs f0, 0x4d4(r30) -/* 80BF12B0 C0 3F 00 68 */ lfs f1, 0x68(r31) -/* 80BF12B4 EC 00 08 28 */ fsubs f0, f0, f1 -/* 80BF12B8 D0 1E 04 D4 */ stfs f0, 0x4d4(r30) -/* 80BF12BC C0 1E 04 C0 */ lfs f0, 0x4c0(r30) -/* 80BF12C0 EC 00 08 28 */ fsubs f0, f0, f1 -/* 80BF12C4 D0 1E 04 C0 */ stfs f0, 0x4c0(r30) -/* 80BF12C8 38 7E 06 08 */ addi r3, r30, 0x608 -/* 80BF12CC 3C 80 80 40 */ lis r4, g_dComIfG_gameInfo@ha /* 0x804061C0@ha */ -/* 80BF12D0 38 84 61 C0 */ addi r4, r4, g_dComIfG_gameInfo@l /* 0x804061C0@l */ -/* 80BF12D4 38 84 0F 38 */ addi r4, r4, 0xf38 -/* 80BF12D8 4B 48 57 D5 */ bl CrrPos__9dBgS_AcchFR4dBgS -/* 80BF12DC C0 1E 04 D4 */ lfs f0, 0x4d4(r30) -/* 80BF12E0 C0 3F 00 68 */ lfs f1, 0x68(r31) -/* 80BF12E4 EC 00 08 2A */ fadds f0, f0, f1 -/* 80BF12E8 D0 1E 04 D4 */ stfs f0, 0x4d4(r30) -/* 80BF12EC C0 1E 04 C0 */ lfs f0, 0x4c0(r30) -/* 80BF12F0 EC 00 08 2A */ fadds f0, f0, f1 -/* 80BF12F4 D0 1E 04 C0 */ stfs f0, 0x4c0(r30) -/* 80BF12F8 3C 60 80 3E */ lis r3, now__14mDoMtx_stack_c@ha /* 0x803DD470@ha */ -/* 80BF12FC 38 63 D4 70 */ addi r3, r3, now__14mDoMtx_stack_c@l /* 0x803DD470@l */ -/* 80BF1300 C0 3E 04 D0 */ lfs f1, 0x4d0(r30) -/* 80BF1304 C0 5E 04 D4 */ lfs f2, 0x4d4(r30) -/* 80BF1308 C0 7E 04 D8 */ lfs f3, 0x4d8(r30) -/* 80BF130C 4B 75 55 DD */ bl PSMTXTrans -/* 80BF1310 3C 60 80 3E */ lis r3, now__14mDoMtx_stack_c@ha /* 0x803DD470@ha */ -/* 80BF1314 38 63 D4 70 */ addi r3, r3, now__14mDoMtx_stack_c@l /* 0x803DD470@l */ -/* 80BF1318 A8 9E 04 DE */ lha r4, 0x4de(r30) -/* 80BF131C 4B 41 B1 19 */ bl mDoMtx_YrotM__FPA4_fs -/* 80BF1320 3C 60 80 3E */ lis r3, now__14mDoMtx_stack_c@ha /* 0x803DD470@ha */ -/* 80BF1324 38 63 D4 70 */ addi r3, r3, now__14mDoMtx_stack_c@l /* 0x803DD470@l */ -/* 80BF1328 A8 9E 04 DC */ lha r4, 0x4dc(r30) -/* 80BF132C 4B 41 B0 71 */ bl mDoMtx_XrotM__FPA4_fs -/* 80BF1330 C0 3F 00 34 */ lfs f1, 0x34(r31) -/* 80BF1334 FC 40 08 90 */ fmr f2, f1 -/* 80BF1338 FC 60 08 90 */ fmr f3, f1 -/* 80BF133C 4B 41 BA FD */ bl scaleM__14mDoMtx_stack_cFfff -/* 80BF1340 C0 3F 00 0C */ lfs f1, 0xc(r31) -/* 80BF1344 C0 5F 00 28 */ lfs f2, 0x28(r31) -/* 80BF1348 FC 60 08 90 */ fmr f3, f1 -/* 80BF134C 4B 41 BA 51 */ bl transM__14mDoMtx_stack_cFfff -/* 80BF1350 3C 60 80 3E */ lis r3, now__14mDoMtx_stack_c@ha /* 0x803DD470@ha */ -/* 80BF1354 38 63 D4 70 */ addi r3, r3, now__14mDoMtx_stack_c@l /* 0x803DD470@l */ -/* 80BF1358 80 9E 05 74 */ lwz r4, 0x574(r30) -/* 80BF135C 38 84 00 24 */ addi r4, r4, 0x24 -/* 80BF1360 4B 75 51 51 */ bl PSMTXCopy -/* 80BF1364 C0 3F 00 0C */ lfs f1, 0xc(r31) -/* 80BF1368 D0 21 00 58 */ stfs f1, 0x58(r1) -/* 80BF136C C0 1F 00 68 */ lfs f0, 0x68(r31) -/* 80BF1370 D0 01 00 5C */ stfs f0, 0x5c(r1) -/* 80BF1374 D0 21 00 60 */ stfs f1, 0x60(r1) -/* 80BF1378 38 61 00 28 */ addi r3, r1, 0x28 -/* 80BF137C 38 9E 04 D0 */ addi r4, r30, 0x4d0 -/* 80BF1380 38 A1 00 58 */ addi r5, r1, 0x58 -/* 80BF1384 4B 67 57 61 */ bl __pl__4cXyzCFRC3Vec -/* 80BF1388 38 7E 09 40 */ addi r3, r30, 0x940 -/* 80BF138C 38 81 00 28 */ addi r4, r1, 0x28 -/* 80BF1390 4B 67 E2 B9 */ bl SetC__8cM3dGSphFRC4cXyz -/* 80BF1394 38 7E 09 40 */ addi r3, r30, 0x940 -/* 80BF1398 C0 3F 00 5C */ lfs f1, 0x5c(r31) -/* 80BF139C 4B 67 E3 6D */ bl SetR__8cM3dGSphFf -/* 80BF13A0 3C 60 80 40 */ lis r3, g_dComIfG_gameInfo@ha /* 0x804061C0@ha */ -/* 80BF13A4 38 63 61 C0 */ addi r3, r3, g_dComIfG_gameInfo@l /* 0x804061C0@l */ -/* 80BF13A8 38 63 23 3C */ addi r3, r3, 0x233c -/* 80BF13AC 38 9E 08 1C */ addi r4, r30, 0x81c -/* 80BF13B0 4B 67 37 F9 */ bl Set__4cCcSFP8cCcD_Obj -/* 80BF13B4 48 00 03 04 */ b lbl_80BF16B8 -lbl_80BF13B8: -/* 80BF13B8 88 1E 05 67 */ lbz r0, 0x567(r30) -/* 80BF13BC 2C 00 00 03 */ cmpwi r0, 3 -/* 80BF13C0 41 82 02 F0 */ beq lbl_80BF16B0 -/* 80BF13C4 3C 60 80 45 */ lis r3, calc_mtx@ha /* 0x80450768@ha */ -/* 80BF13C8 38 63 07 68 */ addi r3, r3, calc_mtx@l /* 0x80450768@l */ -/* 80BF13CC 80 63 00 00 */ lwz r3, 0(r3) -/* 80BF13D0 A8 9E 04 DE */ lha r4, 0x4de(r30) -/* 80BF13D4 4B 41 B0 09 */ bl mDoMtx_YrotS__FPA4_fs -/* 80BF13D8 C0 1F 00 0C */ lfs f0, 0xc(r31) -/* 80BF13DC D0 01 00 70 */ stfs f0, 0x70(r1) -/* 80BF13E0 D0 01 00 74 */ stfs f0, 0x74(r1) -/* 80BF13E4 C0 1E 05 2C */ lfs f0, 0x52c(r30) -/* 80BF13E8 D0 01 00 78 */ stfs f0, 0x78(r1) -/* 80BF13EC 38 61 00 70 */ addi r3, r1, 0x70 -/* 80BF13F0 38 81 00 64 */ addi r4, r1, 0x64 -/* 80BF13F4 4B 67 FA F9 */ bl MtxPosition__FP4cXyzP4cXyz -/* 80BF13F8 C0 01 00 64 */ lfs f0, 0x64(r1) -/* 80BF13FC D0 1E 04 F8 */ stfs f0, 0x4f8(r30) -/* 80BF1400 C0 01 00 6C */ lfs f0, 0x6c(r1) -/* 80BF1404 D0 1E 05 00 */ stfs f0, 0x500(r30) -/* 80BF1408 C0 3E 04 FC */ lfs f1, 0x4fc(r30) -/* 80BF140C C0 1E 05 30 */ lfs f0, 0x530(r30) -/* 80BF1410 EC 01 00 2A */ fadds f0, f1, f0 -/* 80BF1414 D0 1E 04 FC */ stfs f0, 0x4fc(r30) -/* 80BF1418 38 7E 04 D0 */ addi r3, r30, 0x4d0 -/* 80BF141C 38 9E 04 F8 */ addi r4, r30, 0x4f8 -/* 80BF1420 7C 65 1B 78 */ mr r5, r3 -/* 80BF1424 4B 75 5C 6D */ bl PSVECAdd -/* 80BF1428 C0 1E 04 FC */ lfs f0, 0x4fc(r30) -/* 80BF142C C0 3E 05 34 */ lfs f1, 0x534(r30) -/* 80BF1430 FC 00 08 40 */ fcmpo cr0, f0, f1 -/* 80BF1434 40 80 00 08 */ bge lbl_80BF143C -/* 80BF1438 D0 3E 04 FC */ stfs f1, 0x4fc(r30) -lbl_80BF143C: -/* 80BF143C C0 1E 04 FC */ lfs f0, 0x4fc(r30) -/* 80BF1440 D0 1E 05 94 */ stfs f0, 0x594(r30) -/* 80BF1444 C0 1E 04 D0 */ lfs f0, 0x4d0(r30) -/* 80BF1448 D0 01 00 4C */ stfs f0, 0x4c(r1) -/* 80BF144C C0 3E 04 D4 */ lfs f1, 0x4d4(r30) -/* 80BF1450 D0 21 00 50 */ stfs f1, 0x50(r1) -/* 80BF1454 C0 1E 04 D8 */ lfs f0, 0x4d8(r30) -/* 80BF1458 D0 01 00 54 */ stfs f0, 0x54(r1) -/* 80BF145C C0 1F 00 30 */ lfs f0, 0x30(r31) -/* 80BF1460 EC 01 00 2A */ fadds f0, f1, f0 -/* 80BF1464 D0 01 00 50 */ stfs f0, 0x50(r1) -/* 80BF1468 38 61 00 4C */ addi r3, r1, 0x4c -/* 80BF146C 38 81 00 24 */ addi r4, r1, 0x24 -/* 80BF1470 4B 42 C4 21 */ bl fopAcM_getWaterY__FPC4cXyzPf -/* 80BF1474 C0 3E 04 FC */ lfs f1, 0x4fc(r30) -/* 80BF1478 C0 1F 00 28 */ lfs f0, 0x28(r31) -/* 80BF147C FC 01 00 40 */ fcmpo cr0, f1, f0 -/* 80BF1480 4C 40 13 82 */ cror 2, 0, 2 -/* 80BF1484 40 82 01 1C */ bne lbl_80BF15A0 -/* 80BF1488 C0 1E 04 D4 */ lfs f0, 0x4d4(r30) -/* 80BF148C C0 21 00 24 */ lfs f1, 0x24(r1) -/* 80BF1490 FC 00 08 40 */ fcmpo cr0, f0, f1 -/* 80BF1494 40 80 01 0C */ bge lbl_80BF15A0 -/* 80BF1498 C0 1E 04 C0 */ lfs f0, 0x4c0(r30) -/* 80BF149C FC 00 08 40 */ fcmpo cr0, f0, f1 -/* 80BF14A0 4C 41 13 82 */ cror 2, 1, 2 -/* 80BF14A4 40 82 00 FC */ bne lbl_80BF15A0 -/* 80BF14A8 C0 1F 00 6C */ lfs f0, 0x6c(r31) -/* 80BF14AC D0 01 00 40 */ stfs f0, 0x40(r1) -/* 80BF14B0 D0 01 00 44 */ stfs f0, 0x44(r1) -/* 80BF14B4 D0 01 00 48 */ stfs f0, 0x48(r1) -/* 80BF14B8 C0 1E 04 D0 */ lfs f0, 0x4d0(r30) -/* 80BF14BC D0 01 00 34 */ stfs f0, 0x34(r1) -/* 80BF14C0 C0 1E 04 D4 */ lfs f0, 0x4d4(r30) -/* 80BF14C4 D0 01 00 38 */ stfs f0, 0x38(r1) -/* 80BF14C8 C0 1E 04 D8 */ lfs f0, 0x4d8(r30) -/* 80BF14CC D0 01 00 3C */ stfs f0, 0x3c(r1) -/* 80BF14D0 D0 21 00 38 */ stfs f1, 0x38(r1) -/* 80BF14D4 3B 00 00 00 */ li r24, 0 -/* 80BF14D8 3B A0 00 00 */ li r29, 0 -/* 80BF14DC 3B 80 00 00 */ li r28, 0 -/* 80BF14E0 3C 60 80 40 */ lis r3, g_dComIfG_gameInfo@ha /* 0x804061C0@ha */ -/* 80BF14E4 3B 43 61 C0 */ addi r26, r3, g_dComIfG_gameInfo@l /* 0x804061C0@l */ -/* 80BF14E8 3C 60 80 BF */ lis r3, w_eff_id@ha /* 0x80BF1E18@ha */ -/* 80BF14EC 3B 63 1E 18 */ addi r27, r3, w_eff_id@l /* 0x80BF1E18@l */ -lbl_80BF14F0: -/* 80BF14F0 80 7A 5D 3C */ lwz r3, 0x5d3c(r26) -/* 80BF14F4 38 00 00 FF */ li r0, 0xff -/* 80BF14F8 90 01 00 08 */ stw r0, 8(r1) -/* 80BF14FC 38 80 00 00 */ li r4, 0 -/* 80BF1500 90 81 00 0C */ stw r4, 0xc(r1) -/* 80BF1504 38 00 FF FF */ li r0, -1 -/* 80BF1508 90 01 00 10 */ stw r0, 0x10(r1) -/* 80BF150C 90 81 00 14 */ stw r4, 0x14(r1) -/* 80BF1510 90 81 00 18 */ stw r4, 0x18(r1) -/* 80BF1514 90 81 00 1C */ stw r4, 0x1c(r1) -/* 80BF1518 3B 3C 05 B8 */ addi r25, r28, 0x5b8 -/* 80BF151C 7C 9E C8 2E */ lwzx r4, r30, r25 -/* 80BF1520 38 A0 00 00 */ li r5, 0 -/* 80BF1524 7C DB EA 2E */ lhzx r6, r27, r29 -/* 80BF1528 38 E1 00 34 */ addi r7, r1, 0x34 -/* 80BF152C 39 1E 01 0C */ addi r8, r30, 0x10c -/* 80BF1530 39 20 00 00 */ li r9, 0 -/* 80BF1534 39 41 00 40 */ addi r10, r1, 0x40 -/* 80BF1538 C0 3F 00 00 */ lfs f1, 0(r31) -/* 80BF153C 4B 45 BF 91 */ bl set__13dPa_control_cFUlUcUsPC4cXyzPC12dKy_tevstr_cPC5csXyzPC4cXyzUcP18dPa_levelEcallBackScPC8_GXColorPC8_GXColorPC4cXyzf -/* 80BF1540 7C 7E C9 2E */ stwx r3, r30, r25 -/* 80BF1544 3B 18 00 01 */ addi r24, r24, 1 -/* 80BF1548 2C 18 00 04 */ cmpwi r24, 4 -/* 80BF154C 3B BD 00 02 */ addi r29, r29, 2 -/* 80BF1550 3B 9C 00 04 */ addi r28, r28, 4 -/* 80BF1554 41 80 FF 9C */ blt lbl_80BF14F0 -/* 80BF1558 3C 60 00 06 */ lis r3, 0x0006 /* 0x00060031@ha */ -/* 80BF155C 38 03 00 31 */ addi r0, r3, 0x0031 /* 0x00060031@l */ -/* 80BF1560 90 01 00 20 */ stw r0, 0x20(r1) -/* 80BF1564 38 7E 05 98 */ addi r3, r30, 0x598 -/* 80BF1568 38 81 00 20 */ addi r4, r1, 0x20 -/* 80BF156C 38 A0 00 00 */ li r5, 0 -/* 80BF1570 38 C0 FF FF */ li r6, -1 -/* 80BF1574 81 9E 05 A8 */ lwz r12, 0x5a8(r30) -/* 80BF1578 81 8C 00 18 */ lwz r12, 0x18(r12) -/* 80BF157C 7D 89 03 A6 */ mtctr r12 -/* 80BF1580 4E 80 04 21 */ bctrl -/* 80BF1584 C0 1F 00 20 */ lfs f0, 0x20(r31) -/* 80BF1588 D0 1E 04 FC */ stfs f0, 0x4fc(r30) -/* 80BF158C 38 00 00 00 */ li r0, 0 -/* 80BF1590 B0 1E 05 8C */ sth r0, 0x58c(r30) -/* 80BF1594 B0 1E 05 8A */ sth r0, 0x58a(r30) -/* 80BF1598 C0 1F 00 0C */ lfs f0, 0xc(r31) -/* 80BF159C D0 1E 05 2C */ stfs f0, 0x52c(r30) -lbl_80BF15A0: -/* 80BF15A0 C0 3E 04 D4 */ lfs f1, 0x4d4(r30) -/* 80BF15A4 C0 01 00 24 */ lfs f0, 0x24(r1) -/* 80BF15A8 FC 01 00 40 */ fcmpo cr0, f1, f0 -/* 80BF15AC 4C 40 13 82 */ cror 2, 0, 2 -/* 80BF15B0 40 82 00 18 */ bne lbl_80BF15C8 -/* 80BF15B4 C0 1F 00 3C */ lfs f0, 0x3c(r31) -/* 80BF15B8 D0 1E 05 30 */ stfs f0, 0x530(r30) -/* 80BF15BC C0 1F 00 70 */ lfs f0, 0x70(r31) -/* 80BF15C0 D0 1E 05 34 */ stfs f0, 0x534(r30) -/* 80BF15C4 48 00 00 14 */ b lbl_80BF15D8 -lbl_80BF15C8: -/* 80BF15C8 C0 1F 00 74 */ lfs f0, 0x74(r31) -/* 80BF15CC D0 1E 05 30 */ stfs f0, 0x530(r30) -/* 80BF15D0 C0 1F 00 78 */ lfs f0, 0x78(r31) -/* 80BF15D4 D0 1E 05 34 */ stfs f0, 0x534(r30) -lbl_80BF15D8: -/* 80BF15D8 38 7E 06 08 */ addi r3, r30, 0x608 -/* 80BF15DC 3C 80 80 40 */ lis r4, g_dComIfG_gameInfo@ha /* 0x804061C0@ha */ -/* 80BF15E0 38 84 61 C0 */ addi r4, r4, g_dComIfG_gameInfo@l /* 0x804061C0@l */ -/* 80BF15E4 38 84 0F 38 */ addi r4, r4, 0xf38 -/* 80BF15E8 4B 48 54 C5 */ bl CrrPos__9dBgS_AcchFR4dBgS -/* 80BF15EC 80 1E 06 34 */ lwz r0, 0x634(r30) -/* 80BF15F0 54 00 06 B5 */ rlwinm. r0, r0, 0, 0x1a, 0x1a -/* 80BF15F4 41 82 00 0C */ beq lbl_80BF1600 -/* 80BF15F8 7F C3 F3 78 */ mr r3, r30 -/* 80BF15FC 4B FF F2 59 */ bl ground_ang_set__FP14obj_food_class -lbl_80BF1600: -/* 80BF1600 3C 60 80 3E */ lis r3, now__14mDoMtx_stack_c@ha /* 0x803DD470@ha */ -/* 80BF1604 38 63 D4 70 */ addi r3, r3, now__14mDoMtx_stack_c@l /* 0x803DD470@l */ -/* 80BF1608 C0 3E 04 D0 */ lfs f1, 0x4d0(r30) -/* 80BF160C C0 5F 00 7C */ lfs f2, 0x7c(r31) -/* 80BF1610 C0 1E 04 D4 */ lfs f0, 0x4d4(r30) -/* 80BF1614 EC 42 00 2A */ fadds f2, f2, f0 -/* 80BF1618 C0 7E 04 D8 */ lfs f3, 0x4d8(r30) -/* 80BF161C 4B 75 52 CD */ bl PSMTXTrans -/* 80BF1620 3C 60 80 3E */ lis r3, now__14mDoMtx_stack_c@ha /* 0x803DD470@ha */ -/* 80BF1624 38 63 D4 70 */ addi r3, r3, now__14mDoMtx_stack_c@l /* 0x803DD470@l */ -/* 80BF1628 A8 9E 05 8E */ lha r4, 0x58e(r30) -/* 80BF162C 4B 41 AD 71 */ bl mDoMtx_XrotM__FPA4_fs -/* 80BF1630 3C 60 80 3E */ lis r3, now__14mDoMtx_stack_c@ha /* 0x803DD470@ha */ -/* 80BF1634 38 63 D4 70 */ addi r3, r3, now__14mDoMtx_stack_c@l /* 0x803DD470@l */ -/* 80BF1638 A8 9E 05 90 */ lha r4, 0x590(r30) -/* 80BF163C 4B 41 AE 91 */ bl mDoMtx_ZrotM__FPA4_fs -/* 80BF1640 3C 60 80 3E */ lis r3, now__14mDoMtx_stack_c@ha /* 0x803DD470@ha */ -/* 80BF1644 38 63 D4 70 */ addi r3, r3, now__14mDoMtx_stack_c@l /* 0x803DD470@l */ -/* 80BF1648 A8 9E 04 E6 */ lha r4, 0x4e6(r30) -/* 80BF164C 4B 41 AD E9 */ bl mDoMtx_YrotM__FPA4_fs -/* 80BF1650 3C 60 80 3E */ lis r3, now__14mDoMtx_stack_c@ha /* 0x803DD470@ha */ -/* 80BF1654 38 63 D4 70 */ addi r3, r3, now__14mDoMtx_stack_c@l /* 0x803DD470@l */ -/* 80BF1658 A8 9E 04 E4 */ lha r4, 0x4e4(r30) -/* 80BF165C 4B 41 AD 41 */ bl mDoMtx_XrotM__FPA4_fs -/* 80BF1660 3C 60 80 3E */ lis r3, now__14mDoMtx_stack_c@ha /* 0x803DD470@ha */ -/* 80BF1664 38 63 D4 70 */ addi r3, r3, now__14mDoMtx_stack_c@l /* 0x803DD470@l */ -/* 80BF1668 A8 9E 04 E8 */ lha r4, 0x4e8(r30) -/* 80BF166C 4B 41 AE 61 */ bl mDoMtx_ZrotM__FPA4_fs -/* 80BF1670 C0 3F 00 0C */ lfs f1, 0xc(r31) -/* 80BF1674 FC 40 08 90 */ fmr f2, f1 -/* 80BF1678 C0 7F 00 74 */ lfs f3, 0x74(r31) -/* 80BF167C 4B 41 B7 21 */ bl transM__14mDoMtx_stack_cFfff -/* 80BF1680 3C 60 80 BF */ lis r3, l_HIO@ha /* 0x80BF1F50@ha */ -/* 80BF1684 38 63 1F 50 */ addi r3, r3, l_HIO@l /* 0x80BF1F50@l */ -/* 80BF1688 C0 23 00 08 */ lfs f1, 8(r3) -/* 80BF168C FC 40 08 90 */ fmr f2, f1 -/* 80BF1690 FC 60 08 90 */ fmr f3, f1 -/* 80BF1694 4B 41 B7 A5 */ bl scaleM__14mDoMtx_stack_cFfff -/* 80BF1698 3C 60 80 3E */ lis r3, now__14mDoMtx_stack_c@ha /* 0x803DD470@ha */ -/* 80BF169C 38 63 D4 70 */ addi r3, r3, now__14mDoMtx_stack_c@l /* 0x803DD470@l */ -/* 80BF16A0 80 9E 05 74 */ lwz r4, 0x574(r30) -/* 80BF16A4 38 84 00 24 */ addi r4, r4, 0x24 -/* 80BF16A8 4B 75 4E 09 */ bl PSMTXCopy -/* 80BF16AC 48 00 00 0C */ b lbl_80BF16B8 -lbl_80BF16B0: -/* 80BF16B0 38 00 00 04 */ li r0, 4 -/* 80BF16B4 98 1E 05 67 */ stb r0, 0x567(r30) -lbl_80BF16B8: -/* 80BF16B8 C0 1E 04 D0 */ lfs f0, 0x4d0(r30) -/* 80BF16BC D0 1E 05 38 */ stfs f0, 0x538(r30) -/* 80BF16C0 C0 1E 04 D4 */ lfs f0, 0x4d4(r30) -/* 80BF16C4 D0 1E 05 3C */ stfs f0, 0x53c(r30) -/* 80BF16C8 C0 1E 04 D8 */ lfs f0, 0x4d8(r30) -/* 80BF16CC D0 1E 05 40 */ stfs f0, 0x540(r30) -/* 80BF16D0 C0 1E 05 38 */ lfs f0, 0x538(r30) -/* 80BF16D4 D0 1E 05 50 */ stfs f0, 0x550(r30) -/* 80BF16D8 C0 1E 05 3C */ lfs f0, 0x53c(r30) -/* 80BF16DC D0 1E 05 54 */ stfs f0, 0x554(r30) -/* 80BF16E0 C0 1E 05 40 */ lfs f0, 0x540(r30) -/* 80BF16E4 D0 1E 05 58 */ stfs f0, 0x558(r30) -/* 80BF16E8 39 61 00 B0 */ addi r11, r1, 0xb0 -/* 80BF16EC 4B 77 0B 29 */ bl _restgpr_24 -/* 80BF16F0 80 01 00 B4 */ lwz r0, 0xb4(r1) -/* 80BF16F4 7C 08 03 A6 */ mtlr r0 -/* 80BF16F8 38 21 00 B0 */ addi r1, r1, 0xb0 -/* 80BF16FC 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/ball_move__FP14obj_food_class.s b/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/ball_move__FP14obj_food_class.s deleted file mode 100644 index 28263427069..00000000000 --- a/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/ball_move__FP14obj_food_class.s +++ /dev/null @@ -1,114 +0,0 @@ -lbl_80BF0FC0: -/* 80BF0FC0 94 21 FF C0 */ stwu r1, -0x40(r1) -/* 80BF0FC4 7C 08 02 A6 */ mflr r0 -/* 80BF0FC8 90 01 00 44 */ stw r0, 0x44(r1) -/* 80BF0FCC 39 61 00 40 */ addi r11, r1, 0x40 -/* 80BF0FD0 4B 77 12 09 */ bl _savegpr_28 -/* 80BF0FD4 7C 7E 1B 78 */ mr r30, r3 -/* 80BF0FD8 3C 60 80 BF */ lis r3, lit_3647@ha /* 0x80BF1D90@ha */ -/* 80BF0FDC 3B E3 1D 90 */ addi r31, r3, lit_3647@l /* 0x80BF1D90@l */ -/* 80BF0FE0 A8 1E 05 80 */ lha r0, 0x580(r30) -/* 80BF0FE4 2C 00 00 00 */ cmpwi r0, 0 -/* 80BF0FE8 40 82 00 E0 */ bne lbl_80BF10C8 -/* 80BF0FEC 38 7E 08 1C */ addi r3, r30, 0x81c -/* 80BF0FF0 4B 49 34 71 */ bl ChkTgHit__12dCcD_GObjInfFv -/* 80BF0FF4 28 03 00 00 */ cmplwi r3, 0 -/* 80BF0FF8 40 82 00 14 */ bne lbl_80BF100C -/* 80BF0FFC 38 7E 08 1C */ addi r3, r30, 0x81c -/* 80BF1000 4B 49 36 59 */ bl ChkCoHit__12dCcD_GObjInfFv -/* 80BF1004 28 03 00 00 */ cmplwi r3, 0 -/* 80BF1008 41 82 00 C0 */ beq lbl_80BF10C8 -lbl_80BF100C: -/* 80BF100C 38 7E 08 1C */ addi r3, r30, 0x81c -/* 80BF1010 4B 49 34 51 */ bl ChkTgHit__12dCcD_GObjInfFv -/* 80BF1014 28 03 00 00 */ cmplwi r3, 0 -/* 80BF1018 41 82 00 10 */ beq lbl_80BF1028 -/* 80BF101C 38 7E 08 1C */ addi r3, r30, 0x81c -/* 80BF1020 4B 49 34 D9 */ bl GetTgHitObj__12dCcD_GObjInfFv -/* 80BF1024 48 00 00 0C */ b lbl_80BF1030 -lbl_80BF1028: -/* 80BF1028 38 7E 08 1C */ addi r3, r30, 0x81c -/* 80BF102C 4B 49 36 C5 */ bl GetCoHitObj__12dCcD_GObjInfFv -lbl_80BF1030: -/* 80BF1030 4B 67 2A 19 */ bl GetAc__8cCcD_ObjFv -/* 80BF1034 7C 7C 1B 78 */ mr r28, r3 -/* 80BF1038 38 61 00 08 */ addi r3, r1, 8 -/* 80BF103C 38 9E 04 D0 */ addi r4, r30, 0x4d0 -/* 80BF1040 38 BC 04 D0 */ addi r5, r28, 0x4d0 -/* 80BF1044 4B 67 5A F1 */ bl __mi__4cXyzCFRC3Vec -/* 80BF1048 C0 01 00 08 */ lfs f0, 8(r1) -/* 80BF104C D0 01 00 14 */ stfs f0, 0x14(r1) -/* 80BF1050 C0 01 00 0C */ lfs f0, 0xc(r1) -/* 80BF1054 D0 01 00 18 */ stfs f0, 0x18(r1) -/* 80BF1058 C0 01 00 10 */ lfs f0, 0x10(r1) -/* 80BF105C D0 01 00 1C */ stfs f0, 0x1c(r1) -/* 80BF1060 C0 3F 00 40 */ lfs f1, 0x40(r31) -/* 80BF1064 4B 67 69 29 */ bl cM_rndFX__Ff -/* 80BF1068 FC 00 08 1E */ fctiwz f0, f1 -/* 80BF106C D8 01 00 20 */ stfd f0, 0x20(r1) -/* 80BF1070 83 A1 00 24 */ lwz r29, 0x24(r1) -/* 80BF1074 C0 21 00 14 */ lfs f1, 0x14(r1) -/* 80BF1078 C0 41 00 1C */ lfs f2, 0x1c(r1) -/* 80BF107C 4B 67 65 F9 */ bl cM_atan2s__Fff -/* 80BF1080 7C 03 EA 14 */ add r0, r3, r29 -/* 80BF1084 B0 1E 04 DE */ sth r0, 0x4de(r30) -/* 80BF1088 38 00 00 0A */ li r0, 0xa -/* 80BF108C B0 1E 05 80 */ sth r0, 0x580(r30) -/* 80BF1090 A8 1C 05 60 */ lha r0, 0x560(r28) -/* 80BF1094 2C 00 00 23 */ cmpwi r0, 0x23 -/* 80BF1098 40 82 00 1C */ bne lbl_80BF10B4 -/* 80BF109C C0 3F 00 00 */ lfs f1, 0(r31) -/* 80BF10A0 4B 67 68 B5 */ bl cM_rndF__Ff -/* 80BF10A4 C0 1F 00 58 */ lfs f0, 0x58(r31) -/* 80BF10A8 EC 00 08 2A */ fadds f0, f0, f1 -/* 80BF10AC D0 1E 05 2C */ stfs f0, 0x52c(r30) -/* 80BF10B0 48 00 00 18 */ b lbl_80BF10C8 -lbl_80BF10B4: -/* 80BF10B4 C0 3F 00 60 */ lfs f1, 0x60(r31) -/* 80BF10B8 4B 67 68 9D */ bl cM_rndF__Ff -/* 80BF10BC C0 1F 00 5C */ lfs f0, 0x5c(r31) -/* 80BF10C0 EC 00 08 2A */ fadds f0, f0, f1 -/* 80BF10C4 D0 1E 05 2C */ stfs f0, 0x52c(r30) -lbl_80BF10C8: -/* 80BF10C8 80 1E 06 34 */ lwz r0, 0x634(r30) -/* 80BF10CC 54 00 06 F7 */ rlwinm. r0, r0, 0, 0x1b, 0x1b -/* 80BF10D0 41 82 00 64 */ beq lbl_80BF1134 -/* 80BF10D4 A8 1E 05 82 */ lha r0, 0x582(r30) -/* 80BF10D8 2C 00 00 00 */ cmpwi r0, 0 -/* 80BF10DC 40 82 00 58 */ bne lbl_80BF1134 -/* 80BF10E0 38 00 00 0A */ li r0, 0xa -/* 80BF10E4 B0 1E 05 82 */ sth r0, 0x582(r30) -/* 80BF10E8 7F C3 F3 78 */ mr r3, r30 -/* 80BF10EC 4B FF F9 E5 */ bl wall_angle_get__FP14obj_food_class -/* 80BF10F0 7C 60 07 34 */ extsh r0, r3 -/* 80BF10F4 2C 00 00 23 */ cmpwi r0, 0x23 -/* 80BF10F8 41 82 00 3C */ beq lbl_80BF1134 -/* 80BF10FC A8 BE 04 DE */ lha r5, 0x4de(r30) -/* 80BF1100 7C 03 28 50 */ subf r0, r3, r5 -/* 80BF1104 7C 00 07 34 */ extsh r0, r0 -/* 80BF1108 54 04 08 3C */ slwi r4, r0, 1 -/* 80BF110C 3C 60 00 01 */ lis r3, 0x0001 /* 0x00008000@ha */ -/* 80BF1110 38 03 80 00 */ addi r0, r3, 0x8000 /* 0x00008000@l */ -/* 80BF1114 7C 04 00 50 */ subf r0, r4, r0 -/* 80BF1118 7C 00 07 34 */ extsh r0, r0 -/* 80BF111C 7C 05 02 14 */ add r0, r5, r0 -/* 80BF1120 B0 1E 04 DE */ sth r0, 0x4de(r30) -/* 80BF1124 C0 3E 05 2C */ lfs f1, 0x52c(r30) -/* 80BF1128 C0 1F 00 44 */ lfs f0, 0x44(r31) -/* 80BF112C EC 01 00 32 */ fmuls f0, f1, f0 -/* 80BF1130 D0 1E 05 2C */ stfs f0, 0x52c(r30) -lbl_80BF1134: -/* 80BF1134 80 1E 06 34 */ lwz r0, 0x634(r30) -/* 80BF1138 54 00 06 B5 */ rlwinm. r0, r0, 0, 0x1a, 0x1a -/* 80BF113C 41 82 00 14 */ beq lbl_80BF1150 -/* 80BF1140 38 7E 05 2C */ addi r3, r30, 0x52c -/* 80BF1144 C0 3F 00 00 */ lfs f1, 0(r31) -/* 80BF1148 C0 5F 00 44 */ lfs f2, 0x44(r31) -/* 80BF114C 4B 67 E9 35 */ bl cLib_addCalc0__FPfff -lbl_80BF1150: -/* 80BF1150 39 61 00 40 */ addi r11, r1, 0x40 -/* 80BF1154 4B 77 10 D1 */ bl _restgpr_28 -/* 80BF1158 80 01 00 44 */ lwz r0, 0x44(r1) -/* 80BF115C 7C 08 03 A6 */ mtlr r0 -/* 80BF1160 38 21 00 40 */ addi r1, r1, 0x40 -/* 80BF1164 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/daObj_Food_Create__FP10fopAc_ac_c.s b/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/daObj_Food_Create__FP10fopAc_ac_c.s deleted file mode 100644 index 47f3e4299e3..00000000000 --- a/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/daObj_Food_Create__FP10fopAc_ac_c.s +++ /dev/null @@ -1,209 +0,0 @@ -lbl_80BF18CC: -/* 80BF18CC 94 21 FF D0 */ stwu r1, -0x30(r1) -/* 80BF18D0 7C 08 02 A6 */ mflr r0 -/* 80BF18D4 90 01 00 34 */ stw r0, 0x34(r1) -/* 80BF18D8 39 61 00 30 */ addi r11, r1, 0x30 -/* 80BF18DC 4B 77 08 F1 */ bl _savegpr_25 -/* 80BF18E0 7C 7B 1B 78 */ mr r27, r3 -/* 80BF18E4 3C 80 80 BF */ lis r4, lit_3647@ha /* 0x80BF1D90@ha */ -/* 80BF18E8 3B E4 1D 90 */ addi r31, r4, lit_3647@l /* 0x80BF1D90@l */ -/* 80BF18EC 80 03 04 A0 */ lwz r0, 0x4a0(r3) -/* 80BF18F0 54 00 07 39 */ rlwinm. r0, r0, 0, 0x1c, 0x1c -/* 80BF18F4 40 82 01 3C */ bne lbl_80BF1A30 -/* 80BF18F8 7F 60 DB 79 */ or. r0, r27, r27 -/* 80BF18FC 41 82 01 28 */ beq lbl_80BF1A24 -/* 80BF1900 7C 1A 03 78 */ mr r26, r0 -/* 80BF1904 4B 42 72 61 */ bl __ct__10fopAc_ac_cFv -/* 80BF1908 38 7A 05 98 */ addi r3, r26, 0x598 -/* 80BF190C 4B 6C CF 39 */ bl __ct__16Z2SoundObjSimpleFv -/* 80BF1910 38 7A 05 C8 */ addi r3, r26, 0x5c8 -/* 80BF1914 4B 48 45 99 */ bl __ct__12dBgS_AcchCirFv -/* 80BF1918 3B 3A 06 08 */ addi r25, r26, 0x608 -/* 80BF191C 7F 23 CB 78 */ mr r3, r25 -/* 80BF1920 4B 48 47 81 */ bl __ct__9dBgS_AcchFv -/* 80BF1924 3C 60 80 BF */ lis r3, __vt__12dBgS_ObjAcch@ha /* 0x80BF1F08@ha */ -/* 80BF1928 38 63 1F 08 */ addi r3, r3, __vt__12dBgS_ObjAcch@l /* 0x80BF1F08@l */ -/* 80BF192C 90 79 00 10 */ stw r3, 0x10(r25) -/* 80BF1930 38 03 00 0C */ addi r0, r3, 0xc -/* 80BF1934 90 19 00 14 */ stw r0, 0x14(r25) -/* 80BF1938 38 03 00 18 */ addi r0, r3, 0x18 -/* 80BF193C 90 19 00 24 */ stw r0, 0x24(r25) -/* 80BF1940 38 79 00 14 */ addi r3, r25, 0x14 -/* 80BF1944 4B 48 75 25 */ bl SetObj__16dBgS_PolyPassChkFv -/* 80BF1948 3C 60 80 3C */ lis r3, __vt__9cCcD_Stts@ha /* 0x803C3728@ha */ -/* 80BF194C 38 03 37 28 */ addi r0, r3, __vt__9cCcD_Stts@l /* 0x803C3728@l */ -/* 80BF1950 90 1A 07 F8 */ stw r0, 0x7f8(r26) -/* 80BF1954 38 7A 07 FC */ addi r3, r26, 0x7fc -/* 80BF1958 4B 49 1E 09 */ bl __ct__10dCcD_GSttsFv -/* 80BF195C 3C 60 80 3B */ lis r3, __vt__9dCcD_Stts@ha /* 0x803AC2E4@ha */ -/* 80BF1960 38 63 C2 E4 */ addi r3, r3, __vt__9dCcD_Stts@l /* 0x803AC2E4@l */ -/* 80BF1964 90 7A 07 F8 */ stw r3, 0x7f8(r26) -/* 80BF1968 38 03 00 20 */ addi r0, r3, 0x20 -/* 80BF196C 90 1A 07 FC */ stw r0, 0x7fc(r26) -/* 80BF1970 3B 3A 08 1C */ addi r25, r26, 0x81c -/* 80BF1974 7F 23 CB 78 */ mr r3, r25 -/* 80BF1978 4B 49 20 B1 */ bl __ct__12dCcD_GObjInfFv -/* 80BF197C 3C 60 80 3C */ lis r3, __vt__14cCcD_ShapeAttr@ha /* 0x803C36D0@ha */ -/* 80BF1980 38 03 36 D0 */ addi r0, r3, __vt__14cCcD_ShapeAttr@l /* 0x803C36D0@l */ -/* 80BF1984 90 19 01 20 */ stw r0, 0x120(r25) -/* 80BF1988 3C 60 80 BF */ lis r3, __vt__8cM3dGAab@ha /* 0x80BF1EFC@ha */ -/* 80BF198C 38 03 1E FC */ addi r0, r3, __vt__8cM3dGAab@l /* 0x80BF1EFC@l */ -/* 80BF1990 90 19 01 1C */ stw r0, 0x11c(r25) -/* 80BF1994 3C 60 80 BF */ lis r3, __vt__8cM3dGSph@ha /* 0x80BF1EF0@ha */ -/* 80BF1998 38 03 1E F0 */ addi r0, r3, __vt__8cM3dGSph@l /* 0x80BF1EF0@l */ -/* 80BF199C 90 19 01 34 */ stw r0, 0x134(r25) -/* 80BF19A0 3C 60 80 3C */ lis r3, __vt__12cCcD_SphAttr@ha /* 0x803C3540@ha */ -/* 80BF19A4 38 63 35 40 */ addi r3, r3, __vt__12cCcD_SphAttr@l /* 0x803C3540@l */ -/* 80BF19A8 90 79 01 20 */ stw r3, 0x120(r25) -/* 80BF19AC 3B C3 00 58 */ addi r30, r3, 0x58 -/* 80BF19B0 93 D9 01 34 */ stw r30, 0x134(r25) -/* 80BF19B4 3C 60 80 3B */ lis r3, __vt__8dCcD_Sph@ha /* 0x803ABFC0@ha */ -/* 80BF19B8 38 63 BF C0 */ addi r3, r3, __vt__8dCcD_Sph@l /* 0x803ABFC0@l */ -/* 80BF19BC 90 79 00 3C */ stw r3, 0x3c(r25) -/* 80BF19C0 3B A3 00 2C */ addi r29, r3, 0x2c -/* 80BF19C4 93 B9 01 20 */ stw r29, 0x120(r25) -/* 80BF19C8 3B 83 00 84 */ addi r28, r3, 0x84 -/* 80BF19CC 93 99 01 34 */ stw r28, 0x134(r25) -/* 80BF19D0 3B 3A 09 54 */ addi r25, r26, 0x954 -/* 80BF19D4 7F 23 CB 78 */ mr r3, r25 -/* 80BF19D8 4B 49 20 51 */ bl __ct__12dCcD_GObjInfFv -/* 80BF19DC 3C 60 80 3C */ lis r3, __vt__14cCcD_ShapeAttr@ha /* 0x803C36D0@ha */ -/* 80BF19E0 38 03 36 D0 */ addi r0, r3, __vt__14cCcD_ShapeAttr@l /* 0x803C36D0@l */ -/* 80BF19E4 90 19 01 20 */ stw r0, 0x120(r25) -/* 80BF19E8 3C 60 80 BF */ lis r3, __vt__8cM3dGAab@ha /* 0x80BF1EFC@ha */ -/* 80BF19EC 38 03 1E FC */ addi r0, r3, __vt__8cM3dGAab@l /* 0x80BF1EFC@l */ -/* 80BF19F0 90 19 01 1C */ stw r0, 0x11c(r25) -/* 80BF19F4 3C 60 80 BF */ lis r3, __vt__8cM3dGSph@ha /* 0x80BF1EF0@ha */ -/* 80BF19F8 38 03 1E F0 */ addi r0, r3, __vt__8cM3dGSph@l /* 0x80BF1EF0@l */ -/* 80BF19FC 90 19 01 34 */ stw r0, 0x134(r25) -/* 80BF1A00 3C 60 80 3C */ lis r3, __vt__12cCcD_SphAttr@ha /* 0x803C3540@ha */ -/* 80BF1A04 38 03 35 40 */ addi r0, r3, __vt__12cCcD_SphAttr@l /* 0x803C3540@l */ -/* 80BF1A08 90 19 01 20 */ stw r0, 0x120(r25) -/* 80BF1A0C 93 D9 01 34 */ stw r30, 0x134(r25) -/* 80BF1A10 3C 60 80 3B */ lis r3, __vt__8dCcD_Sph@ha /* 0x803ABFC0@ha */ -/* 80BF1A14 38 03 BF C0 */ addi r0, r3, __vt__8dCcD_Sph@l /* 0x803ABFC0@l */ -/* 80BF1A18 90 19 00 3C */ stw r0, 0x3c(r25) -/* 80BF1A1C 93 B9 01 20 */ stw r29, 0x120(r25) -/* 80BF1A20 93 99 01 34 */ stw r28, 0x134(r25) -lbl_80BF1A24: -/* 80BF1A24 80 1B 04 A0 */ lwz r0, 0x4a0(r27) -/* 80BF1A28 60 00 00 08 */ ori r0, r0, 8 -/* 80BF1A2C 90 1B 04 A0 */ stw r0, 0x4a0(r27) -lbl_80BF1A30: -/* 80BF1A30 38 7B 05 68 */ addi r3, r27, 0x568 -/* 80BF1A34 3C 80 80 BF */ lis r4, d_a_obj_food__stringBase0@ha /* 0x80BF1E10@ha */ -/* 80BF1A38 38 84 1E 10 */ addi r4, r4, d_a_obj_food__stringBase0@l /* 0x80BF1E10@l */ -/* 80BF1A3C 4B 43 B4 81 */ bl dComIfG_resLoad__FP30request_of_phase_process_classPCc -/* 80BF1A40 7C 7C 1B 78 */ mr r28, r3 -/* 80BF1A44 2C 1C 00 04 */ cmpwi r28, 4 -/* 80BF1A48 40 82 01 84 */ bne lbl_80BF1BCC -/* 80BF1A4C 80 1B 00 B0 */ lwz r0, 0xb0(r27) -/* 80BF1A50 98 1B 05 70 */ stb r0, 0x570(r27) -/* 80BF1A54 80 1B 00 B0 */ lwz r0, 0xb0(r27) -/* 80BF1A58 54 00 C6 3E */ rlwinm r0, r0, 0x18, 0x18, 0x1f -/* 80BF1A5C 98 1B 05 71 */ stb r0, 0x571(r27) -/* 80BF1A60 80 1B 00 B0 */ lwz r0, 0xb0(r27) -/* 80BF1A64 54 00 86 3E */ rlwinm r0, r0, 0x10, 0x18, 0x1f -/* 80BF1A68 98 1B 05 72 */ stb r0, 0x572(r27) -/* 80BF1A6C 88 1B 05 70 */ lbz r0, 0x570(r27) -/* 80BF1A70 28 00 00 FF */ cmplwi r0, 0xff -/* 80BF1A74 40 82 00 0C */ bne lbl_80BF1A80 -/* 80BF1A78 38 00 00 00 */ li r0, 0 -/* 80BF1A7C 98 1B 05 70 */ stb r0, 0x570(r27) -lbl_80BF1A80: -/* 80BF1A80 7F 63 DB 78 */ mr r3, r27 -/* 80BF1A84 3C 80 80 BF */ lis r4, useHeapInit__FP10fopAc_ac_c@ha /* 0x80BF1804@ha */ -/* 80BF1A88 38 84 18 04 */ addi r4, r4, useHeapInit__FP10fopAc_ac_c@l /* 0x80BF1804@l */ -/* 80BF1A8C 38 A0 08 10 */ li r5, 0x810 -/* 80BF1A90 4B 42 8A 21 */ bl fopAcM_entrySolidHeap__FP10fopAc_ac_cPFP10fopAc_ac_c_iUl -/* 80BF1A94 54 60 06 3F */ clrlwi. r0, r3, 0x18 -/* 80BF1A98 40 82 00 0C */ bne lbl_80BF1AA4 -/* 80BF1A9C 38 60 00 05 */ li r3, 5 -/* 80BF1AA0 48 00 01 30 */ b lbl_80BF1BD0 -lbl_80BF1AA4: -/* 80BF1AA4 3C 60 80 BF */ lis r3, data_80BF1F40@ha /* 0x80BF1F40@ha */ -/* 80BF1AA8 8C 03 1F 40 */ lbzu r0, data_80BF1F40@l(r3) /* 0x80BF1F40@l */ -/* 80BF1AAC 28 00 00 00 */ cmplwi r0, 0 -/* 80BF1AB0 40 82 00 20 */ bne lbl_80BF1AD0 -/* 80BF1AB4 38 00 00 01 */ li r0, 1 -/* 80BF1AB8 98 1B 0A 8C */ stb r0, 0xa8c(r27) -/* 80BF1ABC 98 03 00 00 */ stb r0, 0(r3) -/* 80BF1AC0 38 00 FF FF */ li r0, -1 -/* 80BF1AC4 3C 60 80 BF */ lis r3, l_HIO@ha /* 0x80BF1F50@ha */ -/* 80BF1AC8 38 63 1F 50 */ addi r3, r3, l_HIO@l /* 0x80BF1F50@l */ -/* 80BF1ACC 98 03 00 04 */ stb r0, 4(r3) -lbl_80BF1AD0: -/* 80BF1AD0 80 7B 05 74 */ lwz r3, 0x574(r27) -/* 80BF1AD4 38 03 00 24 */ addi r0, r3, 0x24 -/* 80BF1AD8 90 1B 05 04 */ stw r0, 0x504(r27) -/* 80BF1ADC 38 7B 07 E0 */ addi r3, r27, 0x7e0 -/* 80BF1AE0 38 80 00 0A */ li r4, 0xa -/* 80BF1AE4 38 A0 00 00 */ li r5, 0 -/* 80BF1AE8 7F 66 DB 78 */ mr r6, r27 -/* 80BF1AEC 4B 49 1D 75 */ bl Init__9dCcD_SttsFiiP10fopAc_ac_c -/* 80BF1AF0 38 7B 08 1C */ addi r3, r27, 0x81c -/* 80BF1AF4 3C 80 80 BF */ lis r4, cc_sph_src@ha /* 0x80BF1E20@ha */ -/* 80BF1AF8 38 84 1E 20 */ addi r4, r4, cc_sph_src@l /* 0x80BF1E20@l */ -/* 80BF1AFC 4B 49 2F 39 */ bl Set__8dCcD_SphFRC11dCcD_SrcSph -/* 80BF1B00 38 1B 07 E0 */ addi r0, r27, 0x7e0 -/* 80BF1B04 90 1B 08 60 */ stw r0, 0x860(r27) -/* 80BF1B08 38 00 00 00 */ li r0, 0 -/* 80BF1B0C 90 01 00 08 */ stw r0, 8(r1) -/* 80BF1B10 38 7B 06 08 */ addi r3, r27, 0x608 -/* 80BF1B14 38 9B 04 D0 */ addi r4, r27, 0x4d0 -/* 80BF1B18 38 BB 04 BC */ addi r5, r27, 0x4bc -/* 80BF1B1C 7F 66 DB 78 */ mr r6, r27 -/* 80BF1B20 38 E0 00 01 */ li r7, 1 -/* 80BF1B24 39 1B 05 C8 */ addi r8, r27, 0x5c8 -/* 80BF1B28 39 3B 04 F8 */ addi r9, r27, 0x4f8 -/* 80BF1B2C 39 40 00 00 */ li r10, 0 -/* 80BF1B30 4B 48 47 19 */ bl Set__9dBgS_AcchFP4cXyzP4cXyzP10fopAc_ac_ciP12dBgS_AcchCirP4cXyzP5csXyzP5csXyz -/* 80BF1B34 88 1B 05 70 */ lbz r0, 0x570(r27) -/* 80BF1B38 28 00 00 01 */ cmplwi r0, 1 -/* 80BF1B3C 40 82 00 20 */ bne lbl_80BF1B5C -/* 80BF1B40 38 7B 05 C8 */ addi r3, r27, 0x5c8 -/* 80BF1B44 C0 3F 00 4C */ lfs f1, 0x4c(r31) -/* 80BF1B48 FC 40 08 90 */ fmr f2, f1 -/* 80BF1B4C 4B 48 44 0D */ bl SetWall__12dBgS_AcchCirFff -/* 80BF1B50 38 00 00 05 */ li r0, 5 -/* 80BF1B54 98 1B 05 67 */ stb r0, 0x567(r27) -/* 80BF1B58 48 00 00 5C */ b lbl_80BF1BB4 -lbl_80BF1B5C: -/* 80BF1B5C 38 7B 05 C8 */ addi r3, r27, 0x5c8 -/* 80BF1B60 C0 3F 00 54 */ lfs f1, 0x54(r31) -/* 80BF1B64 FC 40 08 90 */ fmr f2, f1 -/* 80BF1B68 4B 48 43 F1 */ bl SetWall__12dBgS_AcchCirFff -/* 80BF1B6C 38 00 00 07 */ li r0, 7 -/* 80BF1B70 98 1B 05 48 */ stb r0, 0x548(r27) -/* 80BF1B74 C0 1F 00 74 */ lfs f0, 0x74(r31) -/* 80BF1B78 D0 1B 05 30 */ stfs f0, 0x530(r27) -/* 80BF1B7C 38 00 00 00 */ li r0, 0 -/* 80BF1B80 98 1B 05 67 */ stb r0, 0x567(r27) -/* 80BF1B84 88 1B 04 9A */ lbz r0, 0x49a(r27) -/* 80BF1B88 60 00 00 30 */ ori r0, r0, 0x30 -/* 80BF1B8C 98 1B 04 9A */ stb r0, 0x49a(r27) -/* 80BF1B90 38 7B 09 54 */ addi r3, r27, 0x954 -/* 80BF1B94 3C 80 80 BF */ lis r4, at_sph_src@ha /* 0x80BF1E60@ha */ -/* 80BF1B98 38 84 1E 60 */ addi r4, r4, at_sph_src@l /* 0x80BF1E60@l */ -/* 80BF1B9C 4B 49 2E 99 */ bl Set__8dCcD_SphFRC11dCcD_SrcSph -/* 80BF1BA0 38 1B 07 E0 */ addi r0, r27, 0x7e0 -/* 80BF1BA4 90 1B 09 98 */ stw r0, 0x998(r27) -/* 80BF1BA8 80 1B 09 54 */ lwz r0, 0x954(r27) -/* 80BF1BAC 54 00 07 B6 */ rlwinm r0, r0, 0, 0x1e, 0x1b -/* 80BF1BB0 90 1B 09 54 */ stw r0, 0x954(r27) -lbl_80BF1BB4: -/* 80BF1BB4 C0 1F 00 74 */ lfs f0, 0x74(r31) -/* 80BF1BB8 D0 1B 05 30 */ stfs f0, 0x530(r27) -/* 80BF1BBC C0 1F 00 78 */ lfs f0, 0x78(r31) -/* 80BF1BC0 D0 1B 05 34 */ stfs f0, 0x534(r27) -/* 80BF1BC4 7F 63 DB 78 */ mr r3, r27 -/* 80BF1BC8 4B FF FB 39 */ bl daObj_Food_Execute__FP14obj_food_class -lbl_80BF1BCC: -/* 80BF1BCC 7F 83 E3 78 */ mr r3, r28 -lbl_80BF1BD0: -/* 80BF1BD0 39 61 00 30 */ addi r11, r1, 0x30 -/* 80BF1BD4 4B 77 06 45 */ bl _restgpr_25 -/* 80BF1BD8 80 01 00 34 */ lwz r0, 0x34(r1) -/* 80BF1BDC 7C 08 03 A6 */ mtlr r0 -/* 80BF1BE0 38 21 00 30 */ addi r1, r1, 0x30 -/* 80BF1BE4 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/daObj_Food_Delete__FP14obj_food_class.s b/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/daObj_Food_Delete__FP14obj_food_class.s deleted file mode 100644 index 0f314a1ade1..00000000000 --- a/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/daObj_Food_Delete__FP14obj_food_class.s +++ /dev/null @@ -1,29 +0,0 @@ -lbl_80BF179C: -/* 80BF179C 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 80BF17A0 7C 08 02 A6 */ mflr r0 -/* 80BF17A4 90 01 00 14 */ stw r0, 0x14(r1) -/* 80BF17A8 93 E1 00 0C */ stw r31, 0xc(r1) -/* 80BF17AC 7C 7F 1B 78 */ mr r31, r3 -/* 80BF17B0 38 7F 05 68 */ addi r3, r31, 0x568 -/* 80BF17B4 3C 80 80 BF */ lis r4, d_a_obj_food__stringBase0@ha /* 0x80BF1E10@ha */ -/* 80BF17B8 38 84 1E 10 */ addi r4, r4, d_a_obj_food__stringBase0@l /* 0x80BF1E10@l */ -/* 80BF17BC 4B 43 B8 4D */ bl dComIfG_resDelete__FP30request_of_phase_process_classPCc -/* 80BF17C0 88 1F 0A 8C */ lbz r0, 0xa8c(r31) -/* 80BF17C4 28 00 00 00 */ cmplwi r0, 0 -/* 80BF17C8 41 82 00 10 */ beq lbl_80BF17D8 -/* 80BF17CC 38 00 00 00 */ li r0, 0 -/* 80BF17D0 3C 60 80 BF */ lis r3, data_80BF1F40@ha /* 0x80BF1F40@ha */ -/* 80BF17D4 98 03 1F 40 */ stb r0, data_80BF1F40@l(r3) /* 0x80BF1F40@l */ -lbl_80BF17D8: -/* 80BF17D8 80 1F 00 F0 */ lwz r0, 0xf0(r31) -/* 80BF17DC 28 00 00 00 */ cmplwi r0, 0 -/* 80BF17E0 41 82 00 0C */ beq lbl_80BF17EC -/* 80BF17E4 38 7F 05 98 */ addi r3, r31, 0x598 -/* 80BF17E8 4B 6C C8 11 */ bl deleteObject__14Z2SoundObjBaseFv -lbl_80BF17EC: -/* 80BF17EC 38 60 00 01 */ li r3, 1 -/* 80BF17F0 83 E1 00 0C */ lwz r31, 0xc(r1) -/* 80BF17F4 80 01 00 14 */ lwz r0, 0x14(r1) -/* 80BF17F8 7C 08 03 A6 */ mtlr r0 -/* 80BF17FC 38 21 00 10 */ addi r1, r1, 0x10 -/* 80BF1800 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/daObj_Food_Draw__FP14obj_food_class.s b/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/daObj_Food_Draw__FP14obj_food_class.s deleted file mode 100644 index f0961cfec17..00000000000 --- a/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/daObj_Food_Draw__FP14obj_food_class.s +++ /dev/null @@ -1,78 +0,0 @@ -lbl_80BF0730: -/* 80BF0730 94 21 FF E0 */ stwu r1, -0x20(r1) -/* 80BF0734 7C 08 02 A6 */ mflr r0 -/* 80BF0738 90 01 00 24 */ stw r0, 0x24(r1) -/* 80BF073C 93 E1 00 1C */ stw r31, 0x1c(r1) -/* 80BF0740 93 C1 00 18 */ stw r30, 0x18(r1) -/* 80BF0744 7C 7E 1B 78 */ mr r30, r3 -/* 80BF0748 3C 80 80 BF */ lis r4, lit_3647@ha /* 0x80BF1D90@ha */ -/* 80BF074C 3B E4 1D 90 */ addi r31, r4, lit_3647@l /* 0x80BF1D90@l */ -/* 80BF0750 4B 56 EE BD */ bl wolfGrabSubjectNoDraw__9daPy_py_cFP10fopAc_ac_c -/* 80BF0754 54 60 06 3F */ clrlwi. r0, r3, 0x18 -/* 80BF0758 41 82 00 0C */ beq lbl_80BF0764 -/* 80BF075C 38 60 00 01 */ li r3, 1 -/* 80BF0760 48 00 00 DC */ b lbl_80BF083C -lbl_80BF0764: -/* 80BF0764 3C 60 80 43 */ lis r3, g_env_light@ha /* 0x8042CA54@ha */ -/* 80BF0768 38 63 CA 54 */ addi r3, r3, g_env_light@l /* 0x8042CA54@l */ -/* 80BF076C 38 80 00 00 */ li r4, 0 -/* 80BF0770 38 BE 04 D0 */ addi r5, r30, 0x4d0 -/* 80BF0774 38 DE 01 0C */ addi r6, r30, 0x10c -/* 80BF0778 4B 5B 30 4D */ bl settingTevStruct__18dScnKy_env_light_cFiP4cXyzP12dKy_tevstr_c -/* 80BF077C 3C 60 80 43 */ lis r3, g_env_light@ha /* 0x8042CA54@ha */ -/* 80BF0780 38 63 CA 54 */ addi r3, r3, g_env_light@l /* 0x8042CA54@l */ -/* 80BF0784 80 9E 05 74 */ lwz r4, 0x574(r30) -/* 80BF0788 80 84 00 04 */ lwz r4, 4(r4) -/* 80BF078C 38 BE 01 0C */ addi r5, r30, 0x10c -/* 80BF0790 4B 5B 46 11 */ bl setLightTevColorType_MAJI__18dScnKy_env_light_cFP12J3DModelDataP12dKy_tevstr_c -/* 80BF0794 80 7E 05 74 */ lwz r3, 0x574(r30) -/* 80BF0798 4B 41 D5 2D */ bl mDoExt_modelUpdateDL__FP8J3DModel -/* 80BF079C 80 1E 04 9C */ lwz r0, 0x49c(r30) -/* 80BF07A0 54 00 04 A5 */ rlwinm. r0, r0, 0, 0x12, 0x12 -/* 80BF07A4 40 82 00 94 */ bne lbl_80BF0838 -/* 80BF07A8 88 1E 05 70 */ lbz r0, 0x570(r30) -/* 80BF07AC 28 00 00 01 */ cmplwi r0, 1 -/* 80BF07B0 41 82 00 64 */ beq lbl_80BF0814 -/* 80BF07B4 C0 5E 04 D8 */ lfs f2, 0x4d8(r30) -/* 80BF07B8 C0 1F 00 04 */ lfs f0, 4(r31) -/* 80BF07BC C0 7E 04 D4 */ lfs f3, 0x4d4(r30) -/* 80BF07C0 EC 20 18 2A */ fadds f1, f0, f3 -/* 80BF07C4 C0 1E 04 D0 */ lfs f0, 0x4d0(r30) -/* 80BF07C8 D0 01 00 08 */ stfs f0, 8(r1) -/* 80BF07CC D0 21 00 0C */ stfs f1, 0xc(r1) -/* 80BF07D0 D0 41 00 10 */ stfs f2, 0x10(r1) -/* 80BF07D4 80 7E 05 78 */ lwz r3, 0x578(r30) -/* 80BF07D8 38 80 00 01 */ li r4, 1 -/* 80BF07DC 80 BE 05 74 */ lwz r5, 0x574(r30) -/* 80BF07E0 38 C1 00 08 */ addi r6, r1, 8 -/* 80BF07E4 C0 3F 00 08 */ lfs f1, 8(r31) -/* 80BF07E8 C0 5F 00 0C */ lfs f2, 0xc(r31) -/* 80BF07EC C0 9E 06 A0 */ lfs f4, 0x6a0(r30) -/* 80BF07F0 38 FE 06 F8 */ addi r7, r30, 0x6f8 -/* 80BF07F4 39 1E 01 0C */ addi r8, r30, 0x10c -/* 80BF07F8 39 20 00 00 */ li r9, 0 -/* 80BF07FC C0 BF 00 00 */ lfs f5, 0(r31) -/* 80BF0800 3D 40 80 42 */ lis r10, mSimpleTexObj__21dDlst_shadowControl_c@ha /* 0x804248D0@ha */ -/* 80BF0804 39 4A 48 D0 */ addi r10, r10, mSimpleTexObj__21dDlst_shadowControl_c@l /* 0x804248D0@l */ -/* 80BF0808 4B 43 E1 09 */ bl dComIfGd_setShadow__FUlScP8J3DModelP4cXyzffffR13cBgS_PolyInfoP12dKy_tevstr_csfP9_GXTexObj -/* 80BF080C 90 7E 05 78 */ stw r3, 0x578(r30) -/* 80BF0810 48 00 00 28 */ b lbl_80BF0838 -lbl_80BF0814: -/* 80BF0814 38 7E 04 D0 */ addi r3, r30, 0x4d0 -/* 80BF0818 C0 3E 06 A0 */ lfs f1, 0x6a0(r30) -/* 80BF081C C0 5F 00 10 */ lfs f2, 0x10(r31) -/* 80BF0820 38 9E 06 F8 */ addi r4, r30, 0x6f8 -/* 80BF0824 38 A0 00 00 */ li r5, 0 -/* 80BF0828 C0 7F 00 00 */ lfs f3, 0(r31) -/* 80BF082C 3C C0 80 42 */ lis r6, mSimpleTexObj__21dDlst_shadowControl_c@ha /* 0x804248D0@ha */ -/* 80BF0830 38 C6 48 D0 */ addi r6, r6, mSimpleTexObj__21dDlst_shadowControl_c@l /* 0x804248D0@l */ -/* 80BF0834 4B 43 C8 81 */ bl dComIfGd_setSimpleShadow__FP4cXyzffR13cBgS_PolyInfosfP9_GXTexObj -lbl_80BF0838: -/* 80BF0838 38 60 00 01 */ li r3, 1 -lbl_80BF083C: -/* 80BF083C 83 E1 00 1C */ lwz r31, 0x1c(r1) -/* 80BF0840 83 C1 00 18 */ lwz r30, 0x18(r1) -/* 80BF0844 80 01 00 24 */ lwz r0, 0x24(r1) -/* 80BF0848 7C 08 03 A6 */ mtlr r0 -/* 80BF084C 38 21 00 20 */ addi r1, r1, 0x20 -/* 80BF0850 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/daObj_Food_Execute__FP14obj_food_class.s b/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/daObj_Food_Execute__FP14obj_food_class.s deleted file mode 100644 index 56633684ca8..00000000000 --- a/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/daObj_Food_Execute__FP14obj_food_class.s +++ /dev/null @@ -1,40 +0,0 @@ -lbl_80BF1700: -/* 80BF1700 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 80BF1704 7C 08 02 A6 */ mflr r0 -/* 80BF1708 90 01 00 14 */ stw r0, 0x14(r1) -/* 80BF170C 93 E1 00 0C */ stw r31, 0xc(r1) -/* 80BF1710 7C 7F 1B 78 */ mr r31, r3 -/* 80BF1714 A8 63 05 7C */ lha r3, 0x57c(r3) -/* 80BF1718 38 03 00 01 */ addi r0, r3, 1 -/* 80BF171C B0 1F 05 7C */ sth r0, 0x57c(r31) -/* 80BF1720 38 60 00 00 */ li r3, 0 -/* 80BF1724 38 00 00 04 */ li r0, 4 -/* 80BF1728 7C 09 03 A6 */ mtctr r0 -lbl_80BF172C: -/* 80BF172C 38 A3 05 80 */ addi r5, r3, 0x580 -/* 80BF1730 7C 9F 2A AE */ lhax r4, r31, r5 -/* 80BF1734 2C 04 00 00 */ cmpwi r4, 0 -/* 80BF1738 41 82 00 0C */ beq lbl_80BF1744 -/* 80BF173C 38 04 FF FF */ addi r0, r4, -1 -/* 80BF1740 7C 1F 2B 2E */ sthx r0, r31, r5 -lbl_80BF1744: -/* 80BF1744 38 63 00 02 */ addi r3, r3, 2 -/* 80BF1748 42 00 FF E4 */ bdnz lbl_80BF172C -/* 80BF174C 7F E3 FB 78 */ mr r3, r31 -/* 80BF1750 4B FF FA 19 */ bl action__FP14obj_food_class -/* 80BF1754 88 1F 04 E2 */ lbz r0, 0x4e2(r31) -/* 80BF1758 7C 03 07 74 */ extsb r3, r0 -/* 80BF175C 4B 43 B9 11 */ bl dComIfGp_getReverb__Fi -/* 80BF1760 7C 65 1B 78 */ mr r5, r3 -/* 80BF1764 38 7F 05 98 */ addi r3, r31, 0x598 -/* 80BF1768 38 80 00 00 */ li r4, 0 -/* 80BF176C 81 9F 05 A8 */ lwz r12, 0x5a8(r31) -/* 80BF1770 81 8C 00 08 */ lwz r12, 8(r12) -/* 80BF1774 7D 89 03 A6 */ mtctr r12 -/* 80BF1778 4E 80 04 21 */ bctrl -/* 80BF177C 38 60 00 01 */ li r3, 1 -/* 80BF1780 83 E1 00 0C */ lwz r31, 0xc(r1) -/* 80BF1784 80 01 00 14 */ lwz r0, 0x14(r1) -/* 80BF1788 7C 08 03 A6 */ mtlr r0 -/* 80BF178C 38 21 00 10 */ addi r1, r1, 0x10 -/* 80BF1790 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/food_carry__FP14obj_food_class.s b/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/food_carry__FP14obj_food_class.s deleted file mode 100644 index 93bb8700750..00000000000 --- a/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/food_carry__FP14obj_food_class.s +++ /dev/null @@ -1,79 +0,0 @@ -lbl_80BF09A4: -/* 80BF09A4 94 21 FF E0 */ stwu r1, -0x20(r1) -/* 80BF09A8 7C 08 02 A6 */ mflr r0 -/* 80BF09AC 90 01 00 24 */ stw r0, 0x24(r1) -/* 80BF09B0 93 E1 00 1C */ stw r31, 0x1c(r1) -/* 80BF09B4 7C 7F 1B 78 */ mr r31, r3 -/* 80BF09B8 3C 60 80 BF */ lis r3, lit_3647@ha /* 0x80BF1D90@ha */ -/* 80BF09BC 39 03 1D 90 */ addi r8, r3, lit_3647@l /* 0x80BF1D90@l */ -/* 80BF09C0 3C 60 80 40 */ lis r3, g_dComIfG_gameInfo@ha /* 0x804061C0@ha */ -/* 80BF09C4 38 63 61 C0 */ addi r3, r3, g_dComIfG_gameInfo@l /* 0x804061C0@l */ -/* 80BF09C8 80 63 5D AC */ lwz r3, 0x5dac(r3) -/* 80BF09CC C0 28 00 0C */ lfs f1, 0xc(r8) -/* 80BF09D0 D0 3F 04 FC */ stfs f1, 0x4fc(r31) -/* 80BF09D4 80 1F 04 9C */ lwz r0, 0x49c(r31) -/* 80BF09D8 54 00 04 A5 */ rlwinm. r0, r0, 0, 0x12, 0x12 -/* 80BF09DC 40 82 00 B8 */ bne lbl_80BF0A94 -/* 80BF09E0 80 1F 08 48 */ lwz r0, 0x848(r31) -/* 80BF09E4 60 00 00 01 */ ori r0, r0, 1 -/* 80BF09E8 90 1F 08 48 */ stw r0, 0x848(r31) -/* 80BF09EC C0 1F 05 2C */ lfs f0, 0x52c(r31) -/* 80BF09F0 FC 00 08 40 */ fcmpo cr0, f0, f1 -/* 80BF09F4 40 81 00 48 */ ble lbl_80BF0A3C -/* 80BF09F8 C0 08 00 1C */ lfs f0, 0x1c(r8) -/* 80BF09FC D0 1F 05 2C */ stfs f0, 0x52c(r31) -/* 80BF0A00 C0 08 00 04 */ lfs f0, 4(r8) -/* 80BF0A04 D0 1F 04 FC */ stfs f0, 0x4fc(r31) -/* 80BF0A08 38 00 00 01 */ li r0, 1 -/* 80BF0A0C 98 1F 05 67 */ stb r0, 0x567(r31) -/* 80BF0A10 38 00 EE 00 */ li r0, -4608 -/* 80BF0A14 B0 1F 05 8C */ sth r0, 0x58c(r31) -/* 80BF0A18 38 80 00 00 */ li r4, 0 -/* 80BF0A1C B0 9F 05 8A */ sth r4, 0x58a(r31) -/* 80BF0A20 A8 03 04 E6 */ lha r0, 0x4e6(r3) -/* 80BF0A24 B0 1F 04 DE */ sth r0, 0x4de(r31) -/* 80BF0A28 A8 63 04 E6 */ lha r3, 0x4e6(r3) -/* 80BF0A2C 38 03 40 00 */ addi r0, r3, 0x4000 -/* 80BF0A30 B0 1F 04 E6 */ sth r0, 0x4e6(r31) -/* 80BF0A34 B0 9F 05 7E */ sth r4, 0x57e(r31) -/* 80BF0A38 48 00 00 54 */ b lbl_80BF0A8C -lbl_80BF0A3C: -/* 80BF0A3C 38 00 00 00 */ li r0, 0 -/* 80BF0A40 98 1F 05 67 */ stb r0, 0x567(r31) -/* 80BF0A44 3C 60 00 08 */ lis r3, 0x0008 /* 0x00080282@ha */ -/* 80BF0A48 38 03 02 82 */ addi r0, r3, 0x0282 /* 0x00080282@l */ -/* 80BF0A4C 90 01 00 08 */ stw r0, 8(r1) -/* 80BF0A50 3C 60 80 45 */ lis r3, mAudioMgrPtr__10Z2AudioMgr@ha /* 0x80451368@ha */ -/* 80BF0A54 38 63 13 68 */ addi r3, r3, mAudioMgrPtr__10Z2AudioMgr@l /* 0x80451368@l */ -/* 80BF0A58 80 63 00 00 */ lwz r3, 0(r3) -/* 80BF0A5C 38 81 00 08 */ addi r4, r1, 8 -/* 80BF0A60 38 BF 04 D0 */ addi r5, r31, 0x4d0 -/* 80BF0A64 38 C0 00 00 */ li r6, 0 -/* 80BF0A68 38 E0 00 00 */ li r7, 0 -/* 80BF0A6C C0 28 00 00 */ lfs f1, 0(r8) -/* 80BF0A70 FC 40 08 90 */ fmr f2, f1 -/* 80BF0A74 C0 68 00 20 */ lfs f3, 0x20(r8) -/* 80BF0A78 FC 80 18 90 */ fmr f4, f3 -/* 80BF0A7C 39 00 00 00 */ li r8, 0 -/* 80BF0A80 4B 6B AF 05 */ bl seStart__7Z2SeMgrF10JAISoundIDPC3VecUlScffffUc -/* 80BF0A84 38 00 00 03 */ li r0, 3 -/* 80BF0A88 B0 1F 05 7E */ sth r0, 0x57e(r31) -lbl_80BF0A8C: -/* 80BF0A8C 7F E3 FB 78 */ mr r3, r31 -/* 80BF0A90 4B 42 C7 6D */ bl fopAcM_carryOffRevise__FP10fopAc_ac_c -lbl_80BF0A94: -/* 80BF0A94 38 7F 05 8E */ addi r3, r31, 0x58e -/* 80BF0A98 38 80 00 00 */ li r4, 0 -/* 80BF0A9C 38 A0 00 01 */ li r5, 1 -/* 80BF0AA0 38 C0 08 00 */ li r6, 0x800 -/* 80BF0AA4 4B 67 FB 65 */ bl cLib_addCalcAngleS2__FPssss -/* 80BF0AA8 38 7F 05 90 */ addi r3, r31, 0x590 -/* 80BF0AAC 38 80 00 00 */ li r4, 0 -/* 80BF0AB0 38 A0 00 01 */ li r5, 1 -/* 80BF0AB4 38 C0 08 00 */ li r6, 0x800 -/* 80BF0AB8 4B 67 FB 51 */ bl cLib_addCalcAngleS2__FPssss -/* 80BF0ABC 83 E1 00 1C */ lwz r31, 0x1c(r1) -/* 80BF0AC0 80 01 00 24 */ lwz r0, 0x24(r1) -/* 80BF0AC4 7C 08 03 A6 */ mtlr r0 -/* 80BF0AC8 38 21 00 20 */ addi r1, r1, 0x20 -/* 80BF0ACC 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/food_normal__FP14obj_food_class.s b/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/food_normal__FP14obj_food_class.s deleted file mode 100644 index 81d1ffcfb17..00000000000 --- a/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/food_normal__FP14obj_food_class.s +++ /dev/null @@ -1,224 +0,0 @@ -lbl_80BF0C74: -/* 80BF0C74 94 21 FF C0 */ stwu r1, -0x40(r1) -/* 80BF0C78 7C 08 02 A6 */ mflr r0 -/* 80BF0C7C 90 01 00 44 */ stw r0, 0x44(r1) -/* 80BF0C80 93 E1 00 3C */ stw r31, 0x3c(r1) -/* 80BF0C84 93 C1 00 38 */ stw r30, 0x38(r1) -/* 80BF0C88 7C 7E 1B 78 */ mr r30, r3 -/* 80BF0C8C 3C 80 80 BF */ lis r4, lit_3647@ha /* 0x80BF1D90@ha */ -/* 80BF0C90 3B E4 1D 90 */ addi r31, r4, lit_3647@l /* 0x80BF1D90@l */ -/* 80BF0C94 80 83 06 34 */ lwz r4, 0x634(r3) -/* 80BF0C98 54 80 06 B5 */ rlwinm. r0, r4, 0, 0x1a, 0x1a -/* 80BF0C9C 41 82 01 98 */ beq lbl_80BF0E34 -/* 80BF0CA0 38 80 00 00 */ li r4, 0 -/* 80BF0CA4 98 9E 05 67 */ stb r4, 0x567(r30) -/* 80BF0CA8 A8 7E 05 7E */ lha r3, 0x57e(r30) -/* 80BF0CAC 2C 03 00 03 */ cmpwi r3, 3 -/* 80BF0CB0 41 80 00 70 */ blt lbl_80BF0D20 -/* 80BF0CB4 80 1E 05 5C */ lwz r0, 0x55c(r30) -/* 80BF0CB8 60 00 00 10 */ ori r0, r0, 0x10 -/* 80BF0CBC 90 1E 05 5C */ stw r0, 0x55c(r30) -/* 80BF0CC0 C0 1F 00 0C */ lfs f0, 0xc(r31) -/* 80BF0CC4 D0 1E 05 2C */ stfs f0, 0x52c(r30) -/* 80BF0CC8 80 1E 04 9C */ lwz r0, 0x49c(r30) -/* 80BF0CCC 54 00 04 A5 */ rlwinm. r0, r0, 0, 0x12, 0x12 -/* 80BF0CD0 41 82 00 1C */ beq lbl_80BF0CEC -/* 80BF0CD4 38 00 00 02 */ li r0, 2 -/* 80BF0CD8 98 1E 05 67 */ stb r0, 0x567(r30) -/* 80BF0CDC B0 9E 05 7E */ sth r4, 0x57e(r30) -/* 80BF0CE0 80 1E 08 48 */ lwz r0, 0x848(r30) -/* 80BF0CE4 54 00 00 3C */ rlwinm r0, r0, 0, 0, 0x1e -/* 80BF0CE8 90 1E 08 48 */ stw r0, 0x848(r30) -lbl_80BF0CEC: -/* 80BF0CEC A8 1E 04 E8 */ lha r0, 0x4e8(r30) -/* 80BF0CF0 2C 00 40 00 */ cmpwi r0, 0x4000 -/* 80BF0CF4 40 80 00 14 */ bge lbl_80BF0D08 -/* 80BF0CF8 2C 00 C0 00 */ cmpwi r0, -16384 -/* 80BF0CFC 40 81 00 0C */ ble lbl_80BF0D08 -/* 80BF0D00 38 80 00 00 */ li r4, 0 -/* 80BF0D04 48 00 00 08 */ b lbl_80BF0D0C -lbl_80BF0D08: -/* 80BF0D08 38 80 80 00 */ li r4, -32768 -lbl_80BF0D0C: -/* 80BF0D0C 38 7E 04 E8 */ addi r3, r30, 0x4e8 -/* 80BF0D10 38 A0 00 01 */ li r5, 1 -/* 80BF0D14 38 C0 10 00 */ li r6, 0x1000 -/* 80BF0D18 4B 67 F8 F1 */ bl cLib_addCalcAngleS2__FPssss -/* 80BF0D1C 48 00 02 8C */ b lbl_80BF0FA8 -lbl_80BF0D20: -/* 80BF0D20 38 03 00 01 */ addi r0, r3, 1 -/* 80BF0D24 B0 1E 05 7E */ sth r0, 0x57e(r30) -/* 80BF0D28 C0 3E 05 2C */ lfs f1, 0x52c(r30) -/* 80BF0D2C C0 1F 00 00 */ lfs f0, 0(r31) -/* 80BF0D30 FC 01 00 40 */ fcmpo cr0, f1, f0 -/* 80BF0D34 40 81 00 14 */ ble lbl_80BF0D48 -/* 80BF0D38 C0 1F 00 34 */ lfs f0, 0x34(r31) -/* 80BF0D3C EC 01 00 32 */ fmuls f0, f1, f0 -/* 80BF0D40 D0 1E 05 2C */ stfs f0, 0x52c(r30) -/* 80BF0D44 48 00 00 20 */ b lbl_80BF0D64 -lbl_80BF0D48: -/* 80BF0D48 C0 3E 05 94 */ lfs f1, 0x594(r30) -/* 80BF0D4C C0 1F 00 38 */ lfs f0, 0x38(r31) -/* 80BF0D50 FC 01 00 40 */ fcmpo cr0, f1, f0 -/* 80BF0D54 40 80 00 10 */ bge lbl_80BF0D64 -/* 80BF0D58 C0 3F 00 2C */ lfs f1, 0x2c(r31) -/* 80BF0D5C 4B 67 6B F9 */ bl cM_rndF__Ff -/* 80BF0D60 D0 3E 05 2C */ stfs f1, 0x52c(r30) -lbl_80BF0D64: -/* 80BF0D64 C0 3F 00 3C */ lfs f1, 0x3c(r31) -/* 80BF0D68 C0 1E 05 94 */ lfs f0, 0x594(r30) -/* 80BF0D6C EC 01 00 32 */ fmuls f0, f1, f0 -/* 80BF0D70 D0 1E 04 FC */ stfs f0, 0x4fc(r30) -/* 80BF0D74 C0 1E 05 94 */ lfs f0, 0x594(r30) -/* 80BF0D78 FC 00 02 10 */ fabs f0, f0 -/* 80BF0D7C FC 20 00 18 */ frsp f1, f0 -/* 80BF0D80 3C 60 00 08 */ lis r3, 0x0008 /* 0x00080283@ha */ -/* 80BF0D84 38 03 02 83 */ addi r0, r3, 0x0283 /* 0x00080283@l */ -/* 80BF0D88 90 01 00 0C */ stw r0, 0xc(r1) -/* 80BF0D8C 4B 77 13 21 */ bl __cvt_fp2unsigned -/* 80BF0D90 7C 66 1B 78 */ mr r6, r3 -/* 80BF0D94 3C 60 80 45 */ lis r3, mAudioMgrPtr__10Z2AudioMgr@ha /* 0x80451368@ha */ -/* 80BF0D98 38 63 13 68 */ addi r3, r3, mAudioMgrPtr__10Z2AudioMgr@l /* 0x80451368@l */ -/* 80BF0D9C 80 63 00 00 */ lwz r3, 0(r3) -/* 80BF0DA0 38 81 00 0C */ addi r4, r1, 0xc -/* 80BF0DA4 38 BE 04 D0 */ addi r5, r30, 0x4d0 -/* 80BF0DA8 38 E0 00 00 */ li r7, 0 -/* 80BF0DAC C0 3F 00 00 */ lfs f1, 0(r31) -/* 80BF0DB0 FC 40 08 90 */ fmr f2, f1 -/* 80BF0DB4 C0 7F 00 20 */ lfs f3, 0x20(r31) -/* 80BF0DB8 FC 80 18 90 */ fmr f4, f3 -/* 80BF0DBC 39 00 00 00 */ li r8, 0 -/* 80BF0DC0 4B 6B AB C5 */ bl seStart__7Z2SeMgrF10JAISoundIDPC3VecUlScffffUc -/* 80BF0DC4 C0 3F 00 40 */ lfs f1, 0x40(r31) -/* 80BF0DC8 4B 67 6B C5 */ bl cM_rndFX__Ff -/* 80BF0DCC FC 00 08 1E */ fctiwz f0, f1 -/* 80BF0DD0 D8 01 00 20 */ stfd f0, 0x20(r1) -/* 80BF0DD4 80 61 00 24 */ lwz r3, 0x24(r1) -/* 80BF0DD8 A8 1E 04 DE */ lha r0, 0x4de(r30) -/* 80BF0DDC 7C 00 1A 14 */ add r0, r0, r3 -/* 80BF0DE0 B0 1E 04 DE */ sth r0, 0x4de(r30) -/* 80BF0DE4 A8 1E 05 7E */ lha r0, 0x57e(r30) -/* 80BF0DE8 2C 00 00 03 */ cmpwi r0, 3 -/* 80BF0DEC 40 82 00 14 */ bne lbl_80BF0E00 -/* 80BF0DF0 38 00 00 00 */ li r0, 0 -/* 80BF0DF4 B0 1E 05 8C */ sth r0, 0x58c(r30) -/* 80BF0DF8 B0 1E 05 8A */ sth r0, 0x58a(r30) -/* 80BF0DFC 48 00 01 AC */ b lbl_80BF0FA8 -lbl_80BF0E00: -/* 80BF0E00 C0 3F 00 40 */ lfs f1, 0x40(r31) -/* 80BF0E04 4B 67 6B 89 */ bl cM_rndFX__Ff -/* 80BF0E08 FC 00 08 1E */ fctiwz f0, f1 -/* 80BF0E0C D8 01 00 20 */ stfd f0, 0x20(r1) -/* 80BF0E10 80 01 00 24 */ lwz r0, 0x24(r1) -/* 80BF0E14 B0 1E 05 8A */ sth r0, 0x58a(r30) -/* 80BF0E18 C0 3F 00 40 */ lfs f1, 0x40(r31) -/* 80BF0E1C 4B 67 6B 71 */ bl cM_rndFX__Ff -/* 80BF0E20 FC 00 08 1E */ fctiwz f0, f1 -/* 80BF0E24 D8 01 00 28 */ stfd f0, 0x28(r1) -/* 80BF0E28 80 01 00 2C */ lwz r0, 0x2c(r1) -/* 80BF0E2C B0 1E 05 8C */ sth r0, 0x58c(r30) -/* 80BF0E30 48 00 01 78 */ b lbl_80BF0FA8 -lbl_80BF0E34: -/* 80BF0E34 A8 1E 05 82 */ lha r0, 0x582(r30) -/* 80BF0E38 2C 00 00 00 */ cmpwi r0, 0 -/* 80BF0E3C 40 82 00 DC */ bne lbl_80BF0F18 -/* 80BF0E40 54 80 06 F7 */ rlwinm. r0, r4, 0, 0x1b, 0x1b -/* 80BF0E44 41 82 00 D4 */ beq lbl_80BF0F18 -/* 80BF0E48 4B FF FC 89 */ bl wall_angle_get__FP14obj_food_class -/* 80BF0E4C 7C 60 07 34 */ extsh r0, r3 -/* 80BF0E50 2C 00 00 23 */ cmpwi r0, 0x23 -/* 80BF0E54 41 82 00 C4 */ beq lbl_80BF0F18 -/* 80BF0E58 A8 BE 04 DE */ lha r5, 0x4de(r30) -/* 80BF0E5C 7C 03 28 50 */ subf r0, r3, r5 -/* 80BF0E60 7C 00 07 34 */ extsh r0, r0 -/* 80BF0E64 54 04 08 3C */ slwi r4, r0, 1 -/* 80BF0E68 3C 60 00 01 */ lis r3, 0x0001 /* 0x00008000@ha */ -/* 80BF0E6C 38 03 80 00 */ addi r0, r3, 0x8000 /* 0x00008000@l */ -/* 80BF0E70 7C 04 00 50 */ subf r0, r4, r0 -/* 80BF0E74 7C 04 07 34 */ extsh r4, r0 -/* 80BF0E78 7C 05 22 14 */ add r0, r5, r4 -/* 80BF0E7C B0 1E 04 DE */ sth r0, 0x4de(r30) -/* 80BF0E80 C0 3F 00 44 */ lfs f1, 0x44(r31) -/* 80BF0E84 3C 60 80 44 */ lis r3, sincosTable___5JMath@ha /* 0x80439A20@ha */ -/* 80BF0E88 38 63 9A 20 */ addi r3, r3, sincosTable___5JMath@l /* 0x80439A20@l */ -/* 80BF0E8C 7C 80 0E 70 */ srawi r0, r4, 1 -/* 80BF0E90 7C 00 01 94 */ addze r0, r0 -/* 80BF0E94 54 00 04 38 */ rlwinm r0, r0, 0, 0x10, 0x1c -/* 80BF0E98 7C 63 02 14 */ add r3, r3, r0 -/* 80BF0E9C C0 03 00 04 */ lfs f0, 4(r3) -/* 80BF0EA0 EC 01 00 32 */ fmuls f0, f1, f0 -/* 80BF0EA4 FC 00 02 10 */ fabs f0, f0 -/* 80BF0EA8 C0 5E 05 2C */ lfs f2, 0x52c(r30) -/* 80BF0EAC C0 3F 00 48 */ lfs f1, 0x48(r31) -/* 80BF0EB0 FC 00 00 18 */ frsp f0, f0 -/* 80BF0EB4 EC 01 00 2A */ fadds f0, f1, f0 -/* 80BF0EB8 EC 02 00 32 */ fmuls f0, f2, f0 -/* 80BF0EBC D0 1E 05 2C */ stfs f0, 0x52c(r30) -/* 80BF0EC0 C0 1F 00 0C */ lfs f0, 0xc(r31) -/* 80BF0EC4 D0 1E 04 FC */ stfs f0, 0x4fc(r30) -/* 80BF0EC8 38 00 00 0A */ li r0, 0xa -/* 80BF0ECC B0 1E 05 82 */ sth r0, 0x582(r30) -/* 80BF0ED0 3C 60 00 08 */ lis r3, 0x0008 /* 0x00080283@ha */ -/* 80BF0ED4 38 03 02 83 */ addi r0, r3, 0x0283 /* 0x00080283@l */ -/* 80BF0ED8 90 01 00 08 */ stw r0, 8(r1) -/* 80BF0EDC C0 3E 05 2C */ lfs f1, 0x52c(r30) -/* 80BF0EE0 4B 77 11 CD */ bl __cvt_fp2unsigned -/* 80BF0EE4 7C 66 1B 78 */ mr r6, r3 -/* 80BF0EE8 3C 60 80 45 */ lis r3, mAudioMgrPtr__10Z2AudioMgr@ha /* 0x80451368@ha */ -/* 80BF0EEC 38 63 13 68 */ addi r3, r3, mAudioMgrPtr__10Z2AudioMgr@l /* 0x80451368@l */ -/* 80BF0EF0 80 63 00 00 */ lwz r3, 0(r3) -/* 80BF0EF4 38 81 00 08 */ addi r4, r1, 8 -/* 80BF0EF8 38 BE 04 D0 */ addi r5, r30, 0x4d0 -/* 80BF0EFC 38 E0 00 00 */ li r7, 0 -/* 80BF0F00 C0 3F 00 00 */ lfs f1, 0(r31) -/* 80BF0F04 FC 40 08 90 */ fmr f2, f1 -/* 80BF0F08 C0 7F 00 20 */ lfs f3, 0x20(r31) -/* 80BF0F0C FC 80 18 90 */ fmr f4, f3 -/* 80BF0F10 39 00 00 00 */ li r8, 0 -/* 80BF0F14 4B 6B AA 71 */ bl seStart__7Z2SeMgrF10JAISoundIDPC3VecUlScffffUc -lbl_80BF0F18: -/* 80BF0F18 A8 7E 04 E6 */ lha r3, 0x4e6(r30) -/* 80BF0F1C A8 1E 05 8A */ lha r0, 0x58a(r30) -/* 80BF0F20 7C 03 02 14 */ add r0, r3, r0 -/* 80BF0F24 B0 1E 04 E6 */ sth r0, 0x4e6(r30) -/* 80BF0F28 A8 7E 04 E8 */ lha r3, 0x4e8(r30) -/* 80BF0F2C A8 1E 05 8C */ lha r0, 0x58c(r30) -/* 80BF0F30 7C 03 02 14 */ add r0, r3, r0 -/* 80BF0F34 B0 1E 04 E8 */ sth r0, 0x4e8(r30) -/* 80BF0F38 C0 1E 04 D0 */ lfs f0, 0x4d0(r30) -/* 80BF0F3C D0 01 00 10 */ stfs f0, 0x10(r1) -/* 80BF0F40 C0 1E 04 D4 */ lfs f0, 0x4d4(r30) -/* 80BF0F44 D0 01 00 14 */ stfs f0, 0x14(r1) -/* 80BF0F48 C0 1E 04 D8 */ lfs f0, 0x4d8(r30) -/* 80BF0F4C D0 01 00 18 */ stfs f0, 0x18(r1) -/* 80BF0F50 A8 1E 05 7E */ lha r0, 0x57e(r30) -/* 80BF0F54 2C 00 00 00 */ cmpwi r0, 0 -/* 80BF0F58 40 82 00 14 */ bne lbl_80BF0F6C -/* 80BF0F5C C0 3E 05 2C */ lfs f1, 0x52c(r30) -/* 80BF0F60 C0 1F 00 4C */ lfs f0, 0x4c(r31) -/* 80BF0F64 FC 01 00 40 */ fcmpo cr0, f1, f0 -/* 80BF0F68 40 80 00 14 */ bge lbl_80BF0F7C -lbl_80BF0F6C: -/* 80BF0F6C C0 21 00 18 */ lfs f1, 0x18(r1) -/* 80BF0F70 C0 1F 00 50 */ lfs f0, 0x50(r31) -/* 80BF0F74 EC 01 00 2A */ fadds f0, f1, f0 -/* 80BF0F78 D0 01 00 18 */ stfs f0, 0x18(r1) -lbl_80BF0F7C: -/* 80BF0F7C 38 7E 0A 78 */ addi r3, r30, 0xa78 -/* 80BF0F80 38 81 00 10 */ addi r4, r1, 0x10 -/* 80BF0F84 4B 67 E6 C5 */ bl SetC__8cM3dGSphFRC4cXyz -/* 80BF0F88 38 7E 0A 78 */ addi r3, r30, 0xa78 -/* 80BF0F8C C0 3F 00 54 */ lfs f1, 0x54(r31) -/* 80BF0F90 4B 67 E7 79 */ bl SetR__8cM3dGSphFf -/* 80BF0F94 3C 60 80 40 */ lis r3, g_dComIfG_gameInfo@ha /* 0x804061C0@ha */ -/* 80BF0F98 38 63 61 C0 */ addi r3, r3, g_dComIfG_gameInfo@l /* 0x804061C0@l */ -/* 80BF0F9C 38 63 23 3C */ addi r3, r3, 0x233c -/* 80BF0FA0 38 9E 09 54 */ addi r4, r30, 0x954 -/* 80BF0FA4 4B 67 3C 05 */ bl Set__4cCcSFP8cCcD_Obj -lbl_80BF0FA8: -/* 80BF0FA8 83 E1 00 3C */ lwz r31, 0x3c(r1) -/* 80BF0FAC 83 C1 00 38 */ lwz r30, 0x38(r1) -/* 80BF0FB0 80 01 00 44 */ lwz r0, 0x44(r1) -/* 80BF0FB4 7C 08 03 A6 */ mtlr r0 -/* 80BF0FB8 38 21 00 40 */ addi r1, r1, 0x40 -/* 80BF0FBC 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/func_80BF1D6C.s b/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/func_80BF1D6C.s deleted file mode 100644 index 0ebfdf33cba..00000000000 --- a/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/func_80BF1D6C.s +++ /dev/null @@ -1,3 +0,0 @@ -lbl_80BF1D6C: -/* 80BF1D6C 38 63 FF DC */ addi r3, r3, -36 -/* 80BF1D70 4B FF FF 08 */ b __dt__12dBgS_ObjAcchFv diff --git a/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/func_80BF1D74.s b/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/func_80BF1D74.s deleted file mode 100644 index 6315961a643..00000000000 --- a/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/func_80BF1D74.s +++ /dev/null @@ -1,3 +0,0 @@ -lbl_80BF1D74: -/* 80BF1D74 38 63 FF EC */ addi r3, r3, -20 -/* 80BF1D78 4B FF FF 00 */ b __dt__12dBgS_ObjAcchFv diff --git a/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/ground_ang_set__FP14obj_food_class.s b/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/ground_ang_set__FP14obj_food_class.s deleted file mode 100644 index 4d5ca6f1f94..00000000000 --- a/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/ground_ang_set__FP14obj_food_class.s +++ /dev/null @@ -1,87 +0,0 @@ -lbl_80BF0854: -/* 80BF0854 94 21 FF 70 */ stwu r1, -0x90(r1) -/* 80BF0858 7C 08 02 A6 */ mflr r0 -/* 80BF085C 90 01 00 94 */ stw r0, 0x94(r1) -/* 80BF0860 39 61 00 90 */ addi r11, r1, 0x90 -/* 80BF0864 4B 77 19 79 */ bl _savegpr_29 -/* 80BF0868 7C 7D 1B 78 */ mr r29, r3 -/* 80BF086C 3C 60 80 BF */ lis r3, lit_3647@ha /* 0x80BF1D90@ha */ -/* 80BF0870 3B E3 1D 90 */ addi r31, r3, lit_3647@l /* 0x80BF1D90@l */ -/* 80BF0874 38 61 00 20 */ addi r3, r1, 0x20 -/* 80BF0878 4B 48 6D 05 */ bl __ct__11dBgS_GndChkFv -/* 80BF087C C0 7D 04 D0 */ lfs f3, 0x4d0(r29) -/* 80BF0880 D0 61 00 08 */ stfs f3, 8(r1) -/* 80BF0884 C0 1D 04 D4 */ lfs f0, 0x4d4(r29) -/* 80BF0888 D0 01 00 0C */ stfs f0, 0xc(r1) -/* 80BF088C C0 5D 04 D8 */ lfs f2, 0x4d8(r29) -/* 80BF0890 D0 41 00 10 */ stfs f2, 0x10(r1) -/* 80BF0894 C0 3D 06 A0 */ lfs f1, 0x6a0(r29) -/* 80BF0898 D0 21 00 0C */ stfs f1, 0xc(r1) -/* 80BF089C D0 61 00 14 */ stfs f3, 0x14(r1) -/* 80BF08A0 C0 1F 00 04 */ lfs f0, 4(r31) -/* 80BF08A4 EC 00 08 2A */ fadds f0, f0, f1 -/* 80BF08A8 D0 01 00 18 */ stfs f0, 0x18(r1) -/* 80BF08AC C0 1F 00 14 */ lfs f0, 0x14(r31) -/* 80BF08B0 EC 00 10 2A */ fadds f0, f0, f2 -/* 80BF08B4 D0 01 00 1C */ stfs f0, 0x1c(r1) -/* 80BF08B8 38 61 00 20 */ addi r3, r1, 0x20 -/* 80BF08BC 38 81 00 14 */ addi r4, r1, 0x14 -/* 80BF08C0 4B 67 74 4D */ bl SetPos__11cBgS_GndChkFPC3Vec -/* 80BF08C4 3C 60 80 40 */ lis r3, g_dComIfG_gameInfo@ha /* 0x804061C0@ha */ -/* 80BF08C8 38 63 61 C0 */ addi r3, r3, g_dComIfG_gameInfo@l /* 0x804061C0@l */ -/* 80BF08CC 3B C3 0F 38 */ addi r30, r3, 0xf38 -/* 80BF08D0 7F C3 F3 78 */ mr r3, r30 -/* 80BF08D4 38 81 00 20 */ addi r4, r1, 0x20 -/* 80BF08D8 4B 48 3B C9 */ bl GroundCross__4cBgSFP11cBgS_GndChk -/* 80BF08DC D0 21 00 18 */ stfs f1, 0x18(r1) -/* 80BF08E0 C0 1F 00 18 */ lfs f0, 0x18(r31) -/* 80BF08E4 FC 20 08 18 */ frsp f1, f1 -/* 80BF08E8 FC 00 08 00 */ fcmpu cr0, f0, f1 -/* 80BF08EC 41 82 00 24 */ beq lbl_80BF0910 -/* 80BF08F0 C0 01 00 0C */ lfs f0, 0xc(r1) -/* 80BF08F4 EC 21 00 28 */ fsubs f1, f1, f0 -/* 80BF08F8 C0 41 00 1C */ lfs f2, 0x1c(r1) -/* 80BF08FC C0 01 00 10 */ lfs f0, 0x10(r1) -/* 80BF0900 EC 42 00 28 */ fsubs f2, f2, f0 -/* 80BF0904 4B 67 6D 71 */ bl cM_atan2s__Fff -/* 80BF0908 7C 03 00 D0 */ neg r0, r3 -/* 80BF090C B0 1D 05 8E */ sth r0, 0x58e(r29) -lbl_80BF0910: -/* 80BF0910 C0 3F 00 14 */ lfs f1, 0x14(r31) -/* 80BF0914 C0 01 00 08 */ lfs f0, 8(r1) -/* 80BF0918 EC 01 00 2A */ fadds f0, f1, f0 -/* 80BF091C D0 01 00 14 */ stfs f0, 0x14(r1) -/* 80BF0920 C0 3F 00 04 */ lfs f1, 4(r31) -/* 80BF0924 C0 01 00 0C */ lfs f0, 0xc(r1) -/* 80BF0928 EC 01 00 2A */ fadds f0, f1, f0 -/* 80BF092C D0 01 00 18 */ stfs f0, 0x18(r1) -/* 80BF0930 C0 01 00 10 */ lfs f0, 0x10(r1) -/* 80BF0934 D0 01 00 1C */ stfs f0, 0x1c(r1) -/* 80BF0938 38 61 00 20 */ addi r3, r1, 0x20 -/* 80BF093C 38 81 00 14 */ addi r4, r1, 0x14 -/* 80BF0940 4B 67 73 CD */ bl SetPos__11cBgS_GndChkFPC3Vec -/* 80BF0944 7F C3 F3 78 */ mr r3, r30 -/* 80BF0948 38 81 00 20 */ addi r4, r1, 0x20 -/* 80BF094C 4B 48 3B 55 */ bl GroundCross__4cBgSFP11cBgS_GndChk -/* 80BF0950 D0 21 00 18 */ stfs f1, 0x18(r1) -/* 80BF0954 C0 1F 00 18 */ lfs f0, 0x18(r31) -/* 80BF0958 FC 20 08 18 */ frsp f1, f1 -/* 80BF095C FC 00 08 00 */ fcmpu cr0, f0, f1 -/* 80BF0960 41 82 00 20 */ beq lbl_80BF0980 -/* 80BF0964 C0 01 00 0C */ lfs f0, 0xc(r1) -/* 80BF0968 EC 21 00 28 */ fsubs f1, f1, f0 -/* 80BF096C C0 41 00 14 */ lfs f2, 0x14(r1) -/* 80BF0970 C0 01 00 08 */ lfs f0, 8(r1) -/* 80BF0974 EC 42 00 28 */ fsubs f2, f2, f0 -/* 80BF0978 4B 67 6C FD */ bl cM_atan2s__Fff -/* 80BF097C B0 7D 05 90 */ sth r3, 0x590(r29) -lbl_80BF0980: -/* 80BF0980 38 61 00 20 */ addi r3, r1, 0x20 -/* 80BF0984 38 80 FF FF */ li r4, -1 -/* 80BF0988 4B 48 6C 69 */ bl __dt__11dBgS_GndChkFv -/* 80BF098C 39 61 00 90 */ addi r11, r1, 0x90 -/* 80BF0990 4B 77 18 99 */ bl _restgpr_29 -/* 80BF0994 80 01 00 94 */ lwz r0, 0x94(r1) -/* 80BF0998 7C 08 03 A6 */ mtlr r0 -/* 80BF099C 38 21 00 90 */ addi r1, r1, 0x90 -/* 80BF09A0 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/useHeapInit__FP10fopAc_ac_c.s b/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/useHeapInit__FP10fopAc_ac_c.s deleted file mode 100644 index 7ae72ee85f3..00000000000 --- a/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/useHeapInit__FP10fopAc_ac_c.s +++ /dev/null @@ -1,55 +0,0 @@ -lbl_80BF1804: -/* 80BF1804 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 80BF1808 7C 08 02 A6 */ mflr r0 -/* 80BF180C 90 01 00 14 */ stw r0, 0x14(r1) -/* 80BF1810 93 E1 00 0C */ stw r31, 0xc(r1) -/* 80BF1814 7C 7F 1B 78 */ mr r31, r3 -/* 80BF1818 88 03 05 70 */ lbz r0, 0x570(r3) -/* 80BF181C 28 00 00 01 */ cmplwi r0, 1 -/* 80BF1820 40 82 00 2C */ bne lbl_80BF184C -/* 80BF1824 3C 60 80 BF */ lis r3, d_a_obj_food__stringBase0@ha /* 0x80BF1E10@ha */ -/* 80BF1828 38 63 1E 10 */ addi r3, r3, d_a_obj_food__stringBase0@l /* 0x80BF1E10@l */ -/* 80BF182C 38 80 00 03 */ li r4, 3 -/* 80BF1830 3C A0 80 40 */ lis r5, g_dComIfG_gameInfo@ha /* 0x804061C0@ha */ -/* 80BF1834 38 A5 61 C0 */ addi r5, r5, g_dComIfG_gameInfo@l /* 0x804061C0@l */ -/* 80BF1838 3C A5 00 02 */ addis r5, r5, 2 -/* 80BF183C 38 C0 00 80 */ li r6, 0x80 -/* 80BF1840 38 A5 C2 F8 */ addi r5, r5, -15624 -/* 80BF1844 4B 44 AA A9 */ bl getRes__14dRes_control_cFPCclP11dRes_info_ci -/* 80BF1848 48 00 00 28 */ b lbl_80BF1870 -lbl_80BF184C: -/* 80BF184C 3C 60 80 BF */ lis r3, d_a_obj_food__stringBase0@ha /* 0x80BF1E10@ha */ -/* 80BF1850 38 63 1E 10 */ addi r3, r3, d_a_obj_food__stringBase0@l /* 0x80BF1E10@l */ -/* 80BF1854 38 80 00 04 */ li r4, 4 -/* 80BF1858 3C A0 80 40 */ lis r5, g_dComIfG_gameInfo@ha /* 0x804061C0@ha */ -/* 80BF185C 38 A5 61 C0 */ addi r5, r5, g_dComIfG_gameInfo@l /* 0x804061C0@l */ -/* 80BF1860 3C A5 00 02 */ addis r5, r5, 2 -/* 80BF1864 38 C0 00 80 */ li r6, 0x80 -/* 80BF1868 38 A5 C2 F8 */ addi r5, r5, -15624 -/* 80BF186C 4B 44 AA 81 */ bl getRes__14dRes_control_cFPCclP11dRes_info_ci -lbl_80BF1870: -/* 80BF1870 3C 80 00 08 */ lis r4, 8 -/* 80BF1874 3C A0 11 00 */ lis r5, 0x1100 /* 0x11000084@ha */ -/* 80BF1878 38 A5 00 84 */ addi r5, r5, 0x0084 /* 0x11000084@l */ -/* 80BF187C 4B 42 33 D9 */ bl mDoExt_J3DModel__create__FP12J3DModelDataUlUl -/* 80BF1880 90 7F 05 74 */ stw r3, 0x574(r31) -/* 80BF1884 80 1F 05 74 */ lwz r0, 0x574(r31) -/* 80BF1888 28 00 00 00 */ cmplwi r0, 0 -/* 80BF188C 40 82 00 0C */ bne lbl_80BF1898 -/* 80BF1890 38 60 00 00 */ li r3, 0 -/* 80BF1894 48 00 00 24 */ b lbl_80BF18B8 -lbl_80BF1898: -/* 80BF1898 38 7F 05 98 */ addi r3, r31, 0x598 -/* 80BF189C 38 9F 04 D0 */ addi r4, r31, 0x4d0 -/* 80BF18A0 38 A0 00 01 */ li r5, 1 -/* 80BF18A4 81 9F 05 A8 */ lwz r12, 0x5a8(r31) -/* 80BF18A8 81 8C 00 14 */ lwz r12, 0x14(r12) -/* 80BF18AC 7D 89 03 A6 */ mtctr r12 -/* 80BF18B0 4E 80 04 21 */ bctrl -/* 80BF18B4 38 60 00 01 */ li r3, 1 -lbl_80BF18B8: -/* 80BF18B8 83 E1 00 0C */ lwz r31, 0xc(r1) -/* 80BF18BC 80 01 00 14 */ lwz r0, 0x14(r1) -/* 80BF18C0 7C 08 03 A6 */ mtlr r0 -/* 80BF18C4 38 21 00 10 */ addi r1, r1, 0x10 -/* 80BF18C8 4E 80 00 20 */ blr diff --git a/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/wall_angle_get__FP14obj_food_class.s b/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/wall_angle_get__FP14obj_food_class.s deleted file mode 100644 index a150463de1f..00000000000 --- a/asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/wall_angle_get__FP14obj_food_class.s +++ /dev/null @@ -1,110 +0,0 @@ -lbl_80BF0AD0: -/* 80BF0AD0 94 21 FF 20 */ stwu r1, -0xe0(r1) -/* 80BF0AD4 7C 08 02 A6 */ mflr r0 -/* 80BF0AD8 90 01 00 E4 */ stw r0, 0xe4(r1) -/* 80BF0ADC DB E1 00 D0 */ stfd f31, 0xd0(r1) -/* 80BF0AE0 F3 E1 00 D8 */ psq_st f31, 216(r1), 0, 0 /* qr0 */ -/* 80BF0AE4 39 61 00 D0 */ addi r11, r1, 0xd0 -/* 80BF0AE8 4B 77 16 ED */ bl _savegpr_27 -/* 80BF0AEC 3C 80 80 BF */ lis r4, lit_3647@ha /* 0x80BF1D90@ha */ -/* 80BF0AF0 3B C4 1D 90 */ addi r30, r4, lit_3647@l /* 0x80BF1D90@l */ -/* 80BF0AF4 7C 7C 1B 78 */ mr r28, r3 -/* 80BF0AF8 38 61 00 44 */ addi r3, r1, 0x44 -/* 80BF0AFC 4B 48 71 6D */ bl __ct__11dBgS_LinChkFv -/* 80BF0B00 3C 60 80 45 */ lis r3, calc_mtx@ha /* 0x80450768@ha */ -/* 80BF0B04 38 63 07 68 */ addi r3, r3, calc_mtx@l /* 0x80450768@l */ -/* 80BF0B08 80 63 00 00 */ lwz r3, 0(r3) -/* 80BF0B0C A8 9C 04 DE */ lha r4, 0x4de(r28) -/* 80BF0B10 4B 41 B8 CD */ bl mDoMtx_YrotS__FPA4_fs -/* 80BF0B14 C0 1E 00 0C */ lfs f0, 0xc(r30) -/* 80BF0B18 D0 01 00 20 */ stfs f0, 0x20(r1) -/* 80BF0B1C C0 1E 00 24 */ lfs f0, 0x24(r30) -/* 80BF0B20 D0 01 00 24 */ stfs f0, 0x24(r1) -/* 80BF0B24 C0 1E 00 28 */ lfs f0, 0x28(r30) -/* 80BF0B28 D0 01 00 28 */ stfs f0, 0x28(r1) -/* 80BF0B2C 38 61 00 20 */ addi r3, r1, 0x20 -/* 80BF0B30 38 81 00 14 */ addi r4, r1, 0x14 -/* 80BF0B34 4B 68 03 B9 */ bl MtxPosition__FP4cXyzP4cXyz -/* 80BF0B38 38 61 00 14 */ addi r3, r1, 0x14 -/* 80BF0B3C 38 9C 04 D0 */ addi r4, r28, 0x4d0 -/* 80BF0B40 7C 65 1B 78 */ mr r5, r3 -/* 80BF0B44 4B 75 65 4D */ bl PSVECAdd -/* 80BF0B48 C0 1E 00 2C */ lfs f0, 0x2c(r30) -/* 80BF0B4C D0 01 00 20 */ stfs f0, 0x20(r1) -/* 80BF0B50 C0 1E 00 24 */ lfs f0, 0x24(r30) -/* 80BF0B54 D0 01 00 24 */ stfs f0, 0x24(r1) -/* 80BF0B58 C0 1E 00 30 */ lfs f0, 0x30(r30) -/* 80BF0B5C D0 01 00 28 */ stfs f0, 0x28(r1) -/* 80BF0B60 3B 60 00 00 */ li r27, 0 -/* 80BF0B64 3B E0 00 00 */ li r31, 0 -/* 80BF0B68 3C 60 80 40 */ lis r3, g_dComIfG_gameInfo@ha /* 0x804061C0@ha */ -/* 80BF0B6C 38 63 61 C0 */ addi r3, r3, g_dComIfG_gameInfo@l /* 0x804061C0@l */ -/* 80BF0B70 3B A3 0F 38 */ addi r29, r3, 0xf38 -/* 80BF0B74 C3 FE 00 20 */ lfs f31, 0x20(r30) -lbl_80BF0B78: -/* 80BF0B78 38 61 00 20 */ addi r3, r1, 0x20 -/* 80BF0B7C 3B C1 00 2C */ addi r30, r1, 0x2c -/* 80BF0B80 7F DE FA 14 */ add r30, r30, r31 -/* 80BF0B84 7F C4 F3 78 */ mr r4, r30 -/* 80BF0B88 4B 68 03 65 */ bl MtxPosition__FP4cXyzP4cXyz -/* 80BF0B8C C0 01 00 20 */ lfs f0, 0x20(r1) -/* 80BF0B90 EC 00 07 F2 */ fmuls f0, f0, f31 -/* 80BF0B94 D0 01 00 20 */ stfs f0, 0x20(r1) -/* 80BF0B98 7F C3 F3 78 */ mr r3, r30 -/* 80BF0B9C 38 81 00 14 */ addi r4, r1, 0x14 -/* 80BF0BA0 7F C5 F3 78 */ mr r5, r30 -/* 80BF0BA4 4B 75 64 ED */ bl PSVECAdd -/* 80BF0BA8 38 61 00 44 */ addi r3, r1, 0x44 -/* 80BF0BAC 38 81 00 14 */ addi r4, r1, 0x14 -/* 80BF0BB0 7F C5 F3 78 */ mr r5, r30 -/* 80BF0BB4 7F 86 E3 78 */ mr r6, r28 -/* 80BF0BB8 4B 48 71 AD */ bl Set__11dBgS_LinChkFPC4cXyzPC4cXyzPC10fopAc_ac_c -/* 80BF0BBC 7F A3 EB 78 */ mr r3, r29 -/* 80BF0BC0 38 81 00 44 */ addi r4, r1, 0x44 -/* 80BF0BC4 4B 48 37 F1 */ bl LineCross__4cBgSFP11cBgS_LinChk -/* 80BF0BC8 54 60 06 3F */ clrlwi. r0, r3, 0x18 -/* 80BF0BCC 41 82 00 20 */ beq lbl_80BF0BEC -/* 80BF0BD0 C0 01 00 74 */ lfs f0, 0x74(r1) -/* 80BF0BD4 D0 1E 00 00 */ stfs f0, 0(r30) -/* 80BF0BD8 C0 01 00 78 */ lfs f0, 0x78(r1) -/* 80BF0BDC D0 1E 00 04 */ stfs f0, 4(r30) -/* 80BF0BE0 C0 01 00 7C */ lfs f0, 0x7c(r1) -/* 80BF0BE4 D0 1E 00 08 */ stfs f0, 8(r30) -/* 80BF0BE8 48 00 00 18 */ b lbl_80BF0C00 -lbl_80BF0BEC: -/* 80BF0BEC 38 61 00 44 */ addi r3, r1, 0x44 -/* 80BF0BF0 38 80 FF FF */ li r4, -1 -/* 80BF0BF4 4B 48 70 E9 */ bl __dt__11dBgS_LinChkFv -/* 80BF0BF8 38 60 00 23 */ li r3, 0x23 -/* 80BF0BFC 48 00 00 58 */ b lbl_80BF0C54 -lbl_80BF0C00: -/* 80BF0C00 3B 7B 00 01 */ addi r27, r27, 1 -/* 80BF0C04 2C 1B 00 02 */ cmpwi r27, 2 -/* 80BF0C08 3B FF 00 0C */ addi r31, r31, 0xc -/* 80BF0C0C 41 80 FF 6C */ blt lbl_80BF0B78 -/* 80BF0C10 38 61 00 08 */ addi r3, r1, 8 -/* 80BF0C14 38 81 00 38 */ addi r4, r1, 0x38 -/* 80BF0C18 38 A1 00 2C */ addi r5, r1, 0x2c -/* 80BF0C1C 4B 67 5F 19 */ bl __mi__4cXyzCFRC3Vec -/* 80BF0C20 C0 21 00 08 */ lfs f1, 8(r1) -/* 80BF0C24 D0 21 00 20 */ stfs f1, 0x20(r1) -/* 80BF0C28 C0 01 00 0C */ lfs f0, 0xc(r1) -/* 80BF0C2C D0 01 00 24 */ stfs f0, 0x24(r1) -/* 80BF0C30 C0 41 00 10 */ lfs f2, 0x10(r1) -/* 80BF0C34 D0 41 00 28 */ stfs f2, 0x28(r1) -/* 80BF0C38 4B 67 6A 3D */ bl cM_atan2s__Fff -/* 80BF0C3C 38 03 40 00 */ addi r0, r3, 0x4000 -/* 80BF0C40 7C 1E 07 34 */ extsh r30, r0 -/* 80BF0C44 38 61 00 44 */ addi r3, r1, 0x44 -/* 80BF0C48 38 80 FF FF */ li r4, -1 -/* 80BF0C4C 4B 48 70 91 */ bl __dt__11dBgS_LinChkFv -/* 80BF0C50 7F C3 F3 78 */ mr r3, r30 -lbl_80BF0C54: -/* 80BF0C54 E3 E1 00 D8 */ psq_l f31, 216(r1), 0, 0 /* qr0 */ -/* 80BF0C58 CB E1 00 D0 */ lfd f31, 0xd0(r1) -/* 80BF0C5C 39 61 00 D0 */ addi r11, r1, 0xd0 -/* 80BF0C60 4B 77 15 C1 */ bl _restgpr_27 -/* 80BF0C64 80 01 00 E4 */ lwz r0, 0xe4(r1) -/* 80BF0C68 7C 08 03 A6 */ mtlr r0 -/* 80BF0C6C 38 21 00 E0 */ addi r1, r1, 0xe0 -/* 80BF0C70 4E 80 00 20 */ blr diff --git a/include/f_op/f_op_actor_mng.h b/include/f_op/f_op_actor_mng.h index e50091daf88..bd354844419 100644 --- a/include/f_op/f_op_actor_mng.h +++ b/include/f_op/f_op_actor_mng.h @@ -690,4 +690,21 @@ inline void fopAcM_OnCarryType(fopAc_ac_c* pActor, fopAcM_CARRY param_2) { pActor->carryType |= param_2; } +enum fopAcM_FOOD { + fopAcM_FOOD_0, + fopAcM_FOOD_1, + fopAcM_FOOD_2, + fopAcM_FOOD_3, + fopAcM_FOOD_4, + fopAcM_FOOD_5, +}; + +inline void fopAcM_SetFoodStatus(fopAc_ac_c* actor, fopAcM_FOOD status) { + actor->field_0x567 = status; +} + +inline bool fopAcM_CheckFoodStatus(const fopAc_ac_c* actor, fopAcM_FOOD status) { + return actor->field_0x567 == status; +} + #endif diff --git a/include/rel/d/a/d_a_do/d_a_do.h b/include/rel/d/a/d_a_do/d_a_do.h index 761f8807a2a..0a0e447d052 100644 --- a/include/rel/d/a/d_a_do/d_a_do.h +++ b/include/rel/d/a/d_a_do/d_a_do.h @@ -1,11 +1,11 @@ #ifndef D_A_DO_H #define D_A_DO_H -#include "d/a/d_a_item_static.h" -#include "d/a/d_a_player.h" +#include "SSystem/SComponent/c_phase.h" +#include "d/bg/d_bg_s_acch.h" +#include "d/cc/d_cc_d.h" #include "d/msg/d_msg_flow.h" -#include "m_Do/m_Do_ext.h" -#include "m_Do/m_Do_mtx.h" +#include "f_op/f_op_actor.h" enum daDo_Anm { ANM_BULBUL = 6, @@ -46,18 +46,18 @@ enum daDo_Action { ACT_MESSAGE = 39 }; +// Remove this once the TU matches struct daDo_HIO_tmp { /* 0x00 */ u8 field_0x00[4]; /* 0x04 */ s8 field_0x04; - /* 0x05 */ u8 field_0x05[3]; /* 0x08 */ f32 mBaseSize; /* 0x0C */ f32 mWalkSpeed; /* 0x10 */ f32 mRunSpeed; /* 0x14 */ f32 mSwimSpeed; - /* 0x18 */ f32 mPlayerRecogniztionDist; - /* 0x1C */ u8 field_0x1c; + /* 0x18 */ f32 mPlayerRecognitionDist; + /* 0x1C */ u8 mWaitType; /* 0x1D */ u8 mSwimming; - /* 0x1E */ u16 mWaterHuntAnimType; + /* 0x1E */ s16 mWaterHuntAnimType; }; class daDo_HIO_c { @@ -65,95 +65,87 @@ public: /* 80667D4C */ daDo_HIO_c(); /* 8066ED40 */ virtual ~daDo_HIO_c(); // should be inlined -public: /* 0x04 */ s8 field_0x04; - /* 0x05 */ u8 field_0x05[3]; /* 0x08 */ f32 mBaseSize; /* 0x0C */ f32 mWalkSpeed; /* 0x10 */ f32 mRunSpeed; /* 0x14 */ f32 mSwimSpeed; - /* 0x18 */ f32 mPlayerRecogniztionDist; - /* 0x1C */ u8 field_0x1c; + /* 0x18 */ f32 mPlayerRecognitionDist; + /* 0x1C */ u8 mWaitType; /* 0x1D */ u8 mSwimming; - /* 0x1E */ u16 mWaterHuntAnimType; + /* 0x1E */ s16 mWaterHuntAnimType; }; class do_class : public fopEn_enemy_c { public: /* 0x5AC */ request_of_phase_process_class mPhase; - /* 0x5B4 */ u8 field_0x5b4; - /* 0x5B5 */ u8 field_0x5b5; - /* 0x5B6 */ u8 field_0x5b6; - /* 0x5B7 */ u8 field_0x5b7; - /* 0x5B8 */ cXyz field_0x5b8; + /* 0x5B4 */ u8 mParam0; + /* 0x5B5 */ u8 mParam1; + /* 0x5B6 */ u8 mParam2; + /* 0x5B8 */ cXyz mTargetPos; /* 0x5C4 */ u8 field_0x5c4[4]; /* 0x5C8 */ f32 mDistFromPlayer; - /* 0x5CC */ s16 mAngleYFromPlayer; - /* 0x5CE */ u8 field_0x5ce[2]; + /* 0x5CC */ s16 mTargetAngleY; /* 0x5D8 */ mDoExt_McaMorf* mpMorf; /* 0x5D4 */ mDoExt_btkAnm* mpBtk; /* 0x5D8 */ mDoExt_btpAnm* mpBtp; - /* 0x5DC */ s8 field_0x5dc; - /* 0x5DD */ u8 field_0x5dd; - /* 0x5DE */ s16 field_0x5de; - /* 0x5E0 */ s16 field_0x5e0; - /* 0x5E2 */ u8 field_0x5e2; - /* 0x5E3 */ u8 field_0x5e3; - /* 0x5E4 */ u32 mAnmID; - /* 0x5E8 */ f32 field_0x5e8; - /* 0x5EC */ f32 field_0x5ec; - /* 0x5F0 */ s16 field_0x5f0; + /* 0x5DC */ s8 mBtkFrame; + /* 0x5DE */ s16 mBtpFrame; + /* 0x5E0 */ s16 mBtpTimer; + /* 0x5E2 */ s8 mBtpReset; + /* 0x5E4 */ int mAnmID; + /* 0x5E8 */ f32 mAnmSpeed; + /* 0x5EC */ f32 mTargetAnmSpeed; + /* 0x5F0 */ s16 mCounter; /* 0x5F2 */ s16 mAction; /* 0x5F4 */ s16 field_0x5f4; - /* 0x5F6 */ s16 mStayStatus; // probably a better name for this + /* 0x5F6 */ s16 mMode; /* 0x5F8 */ u32 mShadowKey; - /* 0x5FC */ s16 field_0x5fc[4]; - /* 0x604 */ u16 field_0x604; - /* 0x606 */ s16 field_0x606; + /* 0x5FC */ s16 mTimer[4]; + /* 0x604 */ s16 mCcDisableTimer; + /* 0x606 */ s16 mSwimEffectTimer; /* 0x608 */ f32 field_0x608; /* 0x60C */ s16 field_0x60c; - /* 0x60E */ csXyz field_0x60e; - /* 0x614 */ s16 field_0x614; - /* 0x616 */ u8 field_0x616; - /* 0x617 */ u8 field_0x617; - /* 0x618 */ cXyz mUnkPos; // something to do with the dog's eye position - /* 0x624 */ s16 field_0x624; - /* 0x626 */ csXyz field_0x626; - /* 0x62C */ u8 field_0x62c[18]; - /* 0x63E */ csXyz field_0x63e; - /* 0x644 */ f32 field_0x644; - /* 0x648 */ f32 field_0x648; - /* 0x64C */ f32 field_0x64c; - /* 0x650 */ f32 field_0x650; - /* 0x654 */ s16 field_0x654; - /* 0x656 */ s16 field_0x656; - /* 0x658 */ f32 mEyePosYDistFromPlayer; - /* 0x65C */ f32 field_0x65c; - /* 0x660 */ s16 field_0x660; - /* 0x662 */ u8 field_0x662[2]; - /* 0x664 */ cXyz field_0x664; - /* 0x670 */ f32 field_0x670; - /* 0x674 */ cXyz field_0x674; + /* 0x60E */ csXyz mHeadAngle; + /* 0x614 */ s16 mHeadTilt; + /* 0x616 */ s8 field_0x616; + /* 0x618 */ cXyz mLookPos; + /* 0x624 */ s16 mLookTimer; + /* 0x626 */ csXyz mHeadBob; + /* 0x62C */ csXyz mHeadBobTarget; + /* 0x632 */ s16 mHeadBobTimer; + /* 0x634 */ f32 mShakeSpeed; + /* 0x638 */ f32 mShakeTargetSpeed; + /* 0x63C */ s16 mASwimTimer; + /* 0x63E */ csXyz mTailAngle; + /* 0x644 */ f32 mTailWag; + /* 0x648 */ f32 mTailWagTarget; + /* 0x64C */ f32 mTailPhaseY; + /* 0x650 */ f32 mTailPhaseX; + /* 0x654 */ s16 mRandomAngleY; + /* 0x656 */ s16 mRandomTargetAngleY; + /* 0x658 */ f32 field_0x658; + /* 0x65C */ f32 mWaterY; + /* 0x660 */ s16 mHangAngleY; + /* 0x664 */ cXyz mHangPos; + /* 0x670 */ f32 mHangSpeed; + /* 0x674 */ cXyz mScale; /* 0x680 */ u32 mItemActorID; /* 0x684 */ u32 mFoodActorID; - /* 0x688 */ u8 field_0x688; - /* 0x689 */ u8 field_0x689; - /* 0x68A */ u8 field_0x68a; - /* 0x68B */ u8 field_0x68b; + /* 0x688 */ s8 mFoodInMouth; + /* 0x689 */ s8 mNoDraw; /* 0x68C */ cXyz field_0x68c; /* 0x698 */ cXyz field_0x698; /* 0x6A4 */ u8 field_0x6a4[10]; - /* 0x6AE */ s8 field_0x6ae; + /* 0x6AE */ s8 mRunningSoundTimer; /* 0x6B0 */ s16 field_0x6b0; - /* 0x6B2 */ u8 field_0x6b2[2]; /* 0x6B4 */ f32 field_0x6b4; - /* 0x6B8 */ u8 field_0x6b8; - /* 0x6B9 */ u8 field_0x6b9[3]; + /* 0x6B8 */ u8 mItemControlTimer; /* 0x6BC */ dBgS_AcchCir mBgS_AcchCir; /* 0x6FC */ dBgS_ObjAcch mBgS_Acch; /* 0x8D4 */ dCcD_Stts mStts; - /* 0x910 */ dCcD_Sph mCcSph1; - /* 0xA48 */ dCcD_Sph mCcSph2; + /* 0x910 */ dCcD_Sph mCcSph; + /* 0xA48 */ dCcD_Sph field_0xa48; /* 0xB80 */ cXyz field_0xb80; /* 0xB8C */ cXyz field_0xb8c; /* 0xB98 */ cXyz field_0xb98; @@ -161,28 +153,23 @@ public: /* 0xBB0 */ cXyz field_0xbb0; /* 0xBBC */ cXyz field_0xbbc; /* 0xBC8 */ u8 field_0xb4c[4]; - /* 0xBCC */ u32 field_0xbcc; + /* 0xBCC */ u32 mRippleKey; /* 0xBD0 */ u8 field_0xbd0[4]; - /* 0xBD4 */ u32 field_0xbd4[4]; + /* 0xBD4 */ u32 mParticleKey[4]; /* 0xBE4 */ Z2SoundObjSimple mSound; - /* 0xC04 */ u8 field_0xc04; - /* 0xC05 */ s8 field_0xc05; - /* 0xC06 */ s16 field_0xc06; - /* 0xC08 */ s16 field_0xc08; - /* 0xC0A */ u8 field_0xc0a[2]; + /* 0xC04 */ u8 mFoodEndTimer; + /* 0xC05 */ s8 mMessageState; + /* 0xC06 */ s16 mIsTalking; + /* 0xC08 */ s16 mFlowID; /* 0xC0C */ dMsgFlow_c mMsg; /* 0xC58 */ u8 field_0xc58[40]; - /* 0xC80 */ u8 field_0xc80; - /* 0xC81 */ u8 field_0xc81[3]; + /* 0xC80 */ bool field_0xc80; /* 0xC84 */ cXyz field_0xc84; /* 0xC90 */ cXyz field_0xc90; /* 0xC9C */ cXyz field_0xc9c; /* 0xCA8 */ cXyz field_0xca8; /* 0xCB4 */ cXyz field_0xcb4; - /* 0xCC0 */ u8 field_0xcc0; - -public: - /* 8066EAE4 */ do_class(); + /* 0xCC0 */ bool mHIOInit; }; #endif /* D_A_DO_H */ diff --git a/include/rel/d/a/obj/d_a_obj_food/d_a_obj_food.h b/include/rel/d/a/obj/d_a_obj_food/d_a_obj_food.h index 963fa5e56cc..5b05e509998 100644 --- a/include/rel/d/a/obj/d_a_obj_food/d_a_obj_food.h +++ b/include/rel/d/a/obj/d_a_obj_food/d_a_obj_food.h @@ -1,5 +1,51 @@ #ifndef D_A_OBJ_FOOD_H #define D_A_OBJ_FOOD_H +#include "SSystem/SComponent/c_phase.h" +#include "d/bg/d_bg_s_acch.h" +#include "d/cc/d_cc_d.h" +#include "f_op/f_op_actor.h" + +class obj_food_class : public fopAc_ac_c { +public: + enum Type { + /* 0 */ TYPE_BONE, + /* 1 */ TYPE_BALL, + }; + + /* 0x568 */ request_of_phase_process_class mPhase; + /* 0x570 */ u8 mType; + /* 0x571 */ u8 mParam1; + /* 0x572 */ u8 mParam2; + /* 0x574 */ J3DModel* mpModel; + /* 0x578 */ u32 mShadowKey; + /* 0x57C */ s16 mCounter; + /* 0x57E */ s16 mBounces; + /* 0x580 */ s16 mTimer[4]; + /* 0x588 */ csXyz mRotSpeed; + /* 0x58E */ s16 mGroundAngleX; + /* 0x590 */ s16 mGroundAngleZ; + /* 0x594 */ f32 mOldSpeedY; + /* 0x598 */ Z2SoundObjSimple mSound; + /* 0x5B8 */ u32 mParticleKey[4]; + /* 0x5C8 */ dBgS_AcchCir mAcchCir; + /* 0x608 */ dBgS_ObjAcch mAcch; + /* 0x7E0 */ dCcD_Stts mCcStts; + /* 0x81C */ dCcD_Sph mCcSph; + /* 0x954 */ dCcD_Sph mAtSph; + /* 0xA8C */ bool mHIOInit; +}; + +STATIC_ASSERT(sizeof(obj_food_class) == 0xA90); + +struct daObj_Food_HIO_c { + /* 80BF070C */ daObj_Food_HIO_c(); + /* 80BF1CE8 */ virtual ~daObj_Food_HIO_c() {} + + /* 0x4 */ s8 field_0x4; + /* 0x8 */ f32 mBoneScale; +}; + +STATIC_ASSERT(sizeof(daObj_Food_HIO_c) == 0xC); #endif /* D_A_OBJ_FOOD_H */ diff --git a/rel/d/a/d_a_do/d_a_do.cpp b/rel/d/a/d_a_do/d_a_do.cpp index dfd2f4c990c..4d5bb07a61e 100644 --- a/rel/d/a/d_a_do/d_a_do.cpp +++ b/rel/d/a/d_a_do/d_a_do.cpp @@ -3,9 +3,12 @@ // Translation Unit: d_a_do // +// See d_a_do_NONMATCHING.cpp + #include "rel/d/a/d_a_do/d_a_do.h" #include "SSystem/SComponent/c_math.h" #include "d/com/d_com_inf_game.h" +#include "d/a/d_a_player.h" #include "dol2asm.h" #include "f_op/f_op_actor_mng.h" @@ -393,8 +396,8 @@ daDo_HIO_c::daDo_HIO_c() { mWalkSpeed = FLOAT_LABEL(lit_3663); mRunSpeed = FLOAT_LABEL(lit_3664); mSwimSpeed = FLOAT_LABEL(lit_3665); - mPlayerRecogniztionDist = FLOAT_LABEL(lit_3666); - field_0x1c = 0; + mPlayerRecognitionDist = FLOAT_LABEL(lit_3666); + mWaitType = 0; mSwimming = 1; mWaterHuntAnimType = 0; } @@ -445,15 +448,15 @@ static int nodeCallBack(J3DJoint* i_jntP, int param_1) { MTXCopy(model->getAnmMtx(joint_num), *calc_mtx); if (joint_num == 9 || joint_num == 10) { - cMtx_YrotM(*calc_mtx, user_area->field_0x60e.y + user_area->field_0x626.y); - cMtx_XrotM(*calc_mtx, user_area->field_0x60e.z + user_area->field_0x626.z); - cMtx_ZrotM(*calc_mtx, user_area->field_0x60e.x); + cMtx_YrotM(*calc_mtx, user_area->mHeadAngle.y + user_area->mHeadBob.y); + cMtx_XrotM(*calc_mtx, user_area->mHeadAngle.z + user_area->mHeadBob.z); + cMtx_ZrotM(*calc_mtx, user_area->mHeadAngle.x); } else if (joint_num == 22) { - cMtx_YrotM(*calc_mtx, user_area->field_0x63e.y << 1); - cMtx_ZrotM(*calc_mtx, user_area->field_0x63e.x << 1); + cMtx_YrotM(*calc_mtx, user_area->mTailAngle.y << 1); + cMtx_ZrotM(*calc_mtx, user_area->mTailAngle.x << 1); } else { - cMtx_YrotM(*calc_mtx, user_area->field_0x63e.y); - cMtx_ZrotM(*calc_mtx, user_area->field_0x63e.x); + cMtx_YrotM(*calc_mtx, user_area->mTailAngle.y); + cMtx_ZrotM(*calc_mtx, user_area->mTailAngle.x); } model->setAnmMtx(joint_num, *calc_mtx); @@ -749,7 +752,7 @@ static u32 search_food(do_class* i_this) { i++; pos_check += 100.0f; - } while (pos_check <= i_this->field_0x674.z * 240.0f); + } while (pos_check <= i_this->mScale.z * 240.0f); } else { ret = -1; } @@ -773,7 +776,7 @@ static void food_check(do_class* i_this) { if (fopAcM_SearchByID(i_this->mFoodActorID)) { i_this->mAction = ACT_FOOD; - i_this->mStayStatus = 0; + i_this->mMode = 0; } } @@ -781,7 +784,7 @@ static void food_check(do_class* i_this) { static int do_carry_check(do_class* i_this) { if (i_this->mAction != ACT_CARRY && fopAcM_checkCarryNow(i_this)) { i_this->mAction = ACT_CARRY; - i_this->mStayStatus = 0; + i_this->mMode = 0; return 1; } @@ -819,7 +822,7 @@ static BOOL depth_check(do_class* i_this, cXyz i_pos, f32 param_2) { sub_res = f_gnd_chk_spl - f_gnd_chk; mul_res = FLOAT_LABEL(lit_3665) * param_2 * FLOAT_LABEL(lit_3981); - f_res = mul_res * i_this->field_0x674.z; + f_res = mul_res * i_this->mScale.z; if (sub_res > f_res) { return 1; @@ -846,9 +849,9 @@ static bool water_check(do_class* i_this) { dBgS_ObjGndChk_Spl gnd_chk_spl; gnd_chk_spl.SetPos(&pos); - i_this->field_0x65c = dComIfG_Bgsp().GroundCross(&gnd_chk_spl); - f32 sub_res = i_this->field_0x65c - f_gnd_chk; - f32 mul_res = FLOAT_LABEL(lit_3994) * i_this->field_0x674.z; + i_this->mWaterY = dComIfG_Bgsp().GroundCross(&gnd_chk_spl); + f32 sub_res = i_this->mWaterY - f_gnd_chk; + f32 mul_res = FLOAT_LABEL(lit_3994) * i_this->mScale.z; if (sub_res > mul_res) { return 1; @@ -955,7 +958,7 @@ static bool dansa_check2(do_class* i_this, f32 param_1) { mDoMtx_YrotS((MtxP)calc_mtx, i_this->current.angle.y); pos.x = FLOAT_LABEL(lit_3682); pos.y = FLOAT_LABEL(lit_4057); - f32 tmp = i_this->field_0x674.z; + f32 tmp = i_this->mScale.z; pos.z = tmp * (FLOAT_LABEL(lit_3981) * param_1) + tmp * (FLOAT_LABEL(lit_3981) * i_this->speedF) * FLOAT_LABEL(lit_4058); @@ -989,9 +992,9 @@ static int move_dansa_check(do_class* i_this, f32 i_speed) { i_this->mAction = ACT_WAIT_1; if (i_speed > FLOAT_LABEL(lit_4069)) { - i_this->mStayStatus = 10; + i_this->mMode = 10; } else { - i_this->mStayStatus = 0; + i_this->mMode = 0; } return 1; @@ -1047,8 +1050,8 @@ static void area_check(do_class* i_this) { if ((i_this->field_0x5b6 * FLOAT_LABEL(lit_3772) * FLOAT_LABEL(lit_3665)) > pos_delta.abs()) { i_this->mAction = ACT_WALK; - i_this->mStayStatus = -1; - i_this->field_0x5fc[2] = cM_rndF(FLOAT_LABEL(lit_3772)) + + i_this->mMode = -1; + i_this->mTimer[2] = cM_rndF(FLOAT_LABEL(lit_3772)) + FLOAT_LABEL(lit_3772); // random value between 100 and 200 } } @@ -1139,22 +1142,22 @@ COMPILER_STRIP_GATE(0x8066EE84, &lit_4339); #ifdef NONMATCHING // regalloc and float literals static void do_stay(do_class* i_this) { - switch (i_this->mStayStatus) { + switch (i_this->mMode) { case 0: { if (i_this->field_0x5b4 == 0) { anm_init(i_this, ANM_DOWN_WT, FLOAT_LABEL(lit_4069), 2, FLOAT_LABEL(lit_3662)); - i_this->mStayStatus++; - i_this->field_0x5fc[0] = 10; + i_this->mMode++; + i_this->mTimer[0] = 10; } else { i_this->mAction = ACT_WALK; - i_this->mStayStatus = 0; + i_this->mMode = 0; return; } } case 1: { - if (i_this->field_0x5fc[0] == 0 && i_this->mDistFromPlayer < l_HIO.mRunSpeed) { - i_this->mStayStatus++; - i_this->field_0x5fc[0] = cM_rndF(FLOAT_LABEL(lit_3816)) + + if (i_this->mTimer[0] == 0 && i_this->mDistFromPlayer < l_HIO.mRunSpeed) { + i_this->mMode++; + i_this->mTimer[0] = cM_rndF(FLOAT_LABEL(lit_3816)) + FLOAT_LABEL(lit_4189); // random number between 20 and 70 } break; @@ -1162,66 +1165,66 @@ static void do_stay(do_class* i_this) { case 2: { i_this->field_0x616 = 1; i_this->field_0x614 = 0xe764; - i_this->field_0x648 = FLOAT_LABEL(lit_4190); - if (i_this->field_0x5fc[0] == 0) { + i_this->mTailWagTarget = FLOAT_LABEL(lit_4190); + if (i_this->mTimer[0] == 0) { anm_init(i_this, ANM_DOWN, FLOAT_LABEL(lit_4027), 0, FLOAT_LABEL(lit_3662)); - i_this->mStayStatus++; + i_this->mMode++; } break; } case 3: { i_this->field_0x616 = 1; - i_this->field_0x648 = FLOAT_LABEL(lit_4191); + i_this->mTailWagTarget = FLOAT_LABEL(lit_4191); if (i_this->mpMorf->isStop()) { i_this->mAction = ACT_WALK_RUN; - i_this->mStayStatus = 0; + i_this->mMode = 0; } break; } case 10: { anm_init(i_this, ANM_DOWN_WT, FLOAT_LABEL(lit_4069), 2, FLOAT_LABEL(lit_3662)); - i_this->mStayStatus++; + i_this->mMode++; } case 11: { i_this->field_0x616 = 1; i_this->field_0x614 = 0xe764; - i_this->field_0x648 = FLOAT_LABEL(lit_4190); + i_this->mTailWagTarget = FLOAT_LABEL(lit_4190); if (i_this->mEyePosYDistFromPlayer > FLOAT_LABEL(lit_3846)) { - i_this->mStayStatus++; - i_this->field_0x5fc[0] = cM_rndF(FLOAT_LABEL(lit_4192)) + + i_this->mMode++; + i_this->mTimer[0] = cM_rndF(FLOAT_LABEL(lit_4192)) + FLOAT_LABEL(lit_4192); // random number between 10 and 20 } - if (i_this->mDistFromPlayer > FLOAT_LABEL(lit_3772) + l_HIO.mPlayerRecogniztionDist) { + if (i_this->mDistFromPlayer > FLOAT_LABEL(lit_3772) + l_HIO.mPlayerRecognitionDist) { i_this->field_0x5f4 = 0; - i_this->mStayStatus = 0; + i_this->mMode = 0; } break; } case 12: { i_this->field_0x616 = 1; i_this->field_0x614 = 0xe764; - i_this->field_0x648 = FLOAT_LABEL(lit_4193); + i_this->mTailWagTarget = FLOAT_LABEL(lit_4193); if (i_this->mEyePosYDistFromPlayer > FLOAT_LABEL(lit_3846)) { - if (i_this->field_0x5fc[0] == 0) { + if (i_this->mTimer[0] == 0) { anm_init(i_this, ANM_DOWN, FLOAT_LABEL(lit_4194), 0, FLOAT_LABEL(lit_3662)); - i_this->mStayStatus = 13; + i_this->mMode = 13; } } else { - i_this->mStayStatus = 11; + i_this->mMode = 11; } break; } case 13: { i_this->field_0x616 = 1; - i_this->field_0x648 = FLOAT_LABEL(lit_4193); + i_this->mTailWagTarget = FLOAT_LABEL(lit_4193); if (i_this->mpMorf->isStop()) { i_this->mAction = ACT_WAIT_1; - i_this->mStayStatus = 0; + i_this->mMode = 0; } } } @@ -1289,16 +1292,16 @@ COMPILER_STRIP_GATE(0x8066EE9C, &lit_4345); // float literals + regalloc static void do_walk(do_class* i_this) { cXyz local_5c; - i_this->field_0x648 = 1000.0; + i_this->mTailWagTarget = 1000.0; - switch (i_this->mStayStatus + 1) { + switch (i_this->mMode + 1) { case 12: { - i_this->field_0x5b8 = i_this->home.pos; - i_this->speedF >= l_HIO.mRunSpeed ? i_this->field_0x5e8 = 1.7 : i_this->field_0x5e8 = 4.0; + i_this->mTargetPos = i_this->home.pos; + i_this->speedF >= l_HIO.mRunSpeed ? i_this->mAnmSpeed = 1.7 : i_this->mAnmSpeed = 4.0; - i_this->field_0x5ec = 1.7; - anm_init(i_this, ANM_WALK, 0.0, 2, i_this->field_0x5e8); - i_this->mStayStatus = 3; + i_this->mTargetAnmSpeed = 1.7; + anm_init(i_this, ANM_WALK, 0.0, 2, i_this->mAnmSpeed); + i_this->mMode = 3; break; } case 0: { @@ -1308,13 +1311,13 @@ static void do_walk(do_class* i_this) { anm_init(i_this, ANM_DOWN, 0.0, 0, 1.0); } - i_this->mStayStatus++; + i_this->mMode++; break; } case 1: { if (i_this->mpMorf->isStop()) { - i_this->mStayStatus++; + i_this->mMode++; ; } break; @@ -1328,12 +1331,12 @@ static void do_walk(do_class* i_this) { mDoMtx_YrotS((MtxP)calc_mtx, cM_rndF(65536.0)); local_5c.z = cM_rndF(100.0f * i_this->field_0x5b6); - MtxPosition(&local_5c, &i_this->field_0x5b8); + MtxPosition(&local_5c, &i_this->mTargetPos); - i_this->field_0x5b8 += i_this->home.pos; + i_this->mTargetPos += i_this->home.pos; - if (dansa_check(i_this, i_this->field_0x5b8, 0.0) == 0) { - local_5c = i_this->field_0x5b8 - i_this->current.pos; + if (dansa_check(i_this, i_this->mTargetPos, 0.0) == 0) { + local_5c = i_this->mTargetPos - i_this->current.pos; if (local_5c.abs() > 300.0f) break; @@ -1341,31 +1344,31 @@ static void do_walk(do_class* i_this) { } f32 rnd_number = cM_rndF(0.6); - i_this->field_0x5ec = rnd_number + 1.3; - i_this->field_0x5e8 = rnd_number + 1.3; + i_this->mTargetAnmSpeed = rnd_number + 1.3; + i_this->mAnmSpeed = rnd_number + 1.3; - anm_init(i_this, ANM_WALK, 0.0, 2, i_this->field_0x5e8); + anm_init(i_this, ANM_WALK, 0.0, 2, i_this->mAnmSpeed); - i_this->mStayStatus++; + i_this->mMode++; } case 3: { - local_5c = i_this->field_0x5b8 - i_this->current.pos; + local_5c = i_this->mTargetPos - i_this->current.pos; cLib_addCalcAngleS2(&i_this->current.angle.y, (s16)cM_atan2s(local_5c.x, local_5c.z), 0x10, 0x100); - cLib_addCalc2(&i_this->speedF, i_this->field_0x5e8 * l_HIO.mWalkSpeed, 1.0, + cLib_addCalc2(&i_this->speedF, i_this->mAnmSpeed * l_HIO.mWalkSpeed, 1.0, l_HIO.mWalkSpeed * 0.2); if (local_5c.abs() < 150.0) { if (i_this->field_0x5b4 == 0) { i_this->mAction = ACT_STAY; - i_this->mStayStatus = 0; + i_this->mMode = 0; } else { anm_init(i_this, ANM_WAIT, 0.0, 2, 1.0); - i_this->field_0x5fc[0] = cM_rndF(50.0) + 20.0; - i_this->field_0x5ec = 1.0; - i_this->mStayStatus++; + i_this->mTimer[0] = cM_rndF(50.0) + 20.0; + i_this->mTargetAnmSpeed = 1.0; + i_this->mMode++; } } @@ -1375,8 +1378,8 @@ static void do_walk(do_class* i_this) { case 4: { cLib_addCalc0(&i_this->speedF, 1.0, 1.0); - if (i_this->field_0x5fc[0] == 0) { - i_this->mStayStatus = 2; + if (i_this->mTimer[0] == 0) { + i_this->mMode = 2; } break; @@ -1384,22 +1387,22 @@ static void do_walk(do_class* i_this) { case 10: { cLib_addCalc0(&i_this->speedF, 1.0, 1.0); - cLib_addCalcAngleS2(&i_this->current.angle.y, i_this->mAngleYFromPlayer, 4, 0x400); + cLib_addCalcAngleS2(&i_this->current.angle.y, i_this->mTargetAngleY, 4, 0x400); i_this->field_0x616 = 1; - i_this->field_0x648 = 2000.0; + i_this->mTailWagTarget = 2000.0; - s16 angle_diff = i_this->current.angle.y - i_this->mAngleYFromPlayer; + s16 angle_diff = i_this->current.angle.y - i_this->mTargetAngleY; if (angle_diff < 0) { angle_diff *= -1; } if (angle_diff < 0x800) { - i_this->mStayStatus++; + i_this->mMode++; anm_init(i_this, ANM_WAIT, 0.0, 2, 1.0); - i_this->field_0x5ec = 1.0; - i_this->field_0x5fc[0] = cM_rndF(10.0) + 10.0; + i_this->mTargetAnmSpeed = 1.0; + i_this->mTimer[0] = cM_rndF(10.0) + 10.0; } break; @@ -1407,24 +1410,24 @@ static void do_walk(do_class* i_this) { case 11: { i_this->field_0x616 = 1; - i_this->field_0x648 = 3000.0; - if (i_this->field_0x5fc[0] == 0) { + i_this->mTailWagTarget = 3000.0; + if (i_this->mTimer[0] == 0) { i_this->mAction = ACT_WALK_RUN; - i_this->mStayStatus = 0; + i_this->mMode = 0; return; } break; } } - cLib_addCalc2(&i_this->field_0x5e8, i_this->field_0x5ec, 1.0, 0.05); - i_this->mpMorf->setPlaySpeed(i_this->field_0x5e8); + cLib_addCalc2(&i_this->mAnmSpeed, i_this->mTargetAnmSpeed, 1.0, 0.05); + i_this->mpMorf->setPlaySpeed(i_this->mAnmSpeed); - if (i_this->field_0x5fc[2] == 0 && i_this->mStayStatus < 10 && - i_this->mDistFromPlayer < l_HIO.mPlayerRecogniztionDist) + if (i_this->mTimer[2] == 0 && i_this->mMode < 10 && + i_this->mDistFromPlayer < l_HIO.mPlayerRecognitionDist) { anm_init(i_this, ANM_STEP_2, 0.0, 2, 1.0); - i_this->mStayStatus = 10; + i_this->mMode = 10; } move_dansa_check(i_this, i_this->speedF); @@ -1458,33 +1461,33 @@ COMPILER_STRIP_GATE(0x8066EEA4, &lit_4378); /* 8066973C-806698D0 001ADC 0194+00 1/1 0/0 0/0 .text do_walk_run__FP8do_class */ static void do_walk_run(do_class* i_this) { i_this->field_0x616 = 1; - i_this->field_0x648 = FLOAT_LABEL(lit_4344); + i_this->mTailWagTarget = FLOAT_LABEL(lit_4344); - switch (i_this->mStayStatus) { + switch (i_this->mMode) { case 0: { - i_this->field_0x5e8 = FLOAT_LABEL(lit_4377); - anm_init(i_this, 22, FLOAT_LABEL(lit_4192), 2, i_this->field_0x5e8); - i_this->mStayStatus++; + i_this->mAnmSpeed = FLOAT_LABEL(lit_4377); + anm_init(i_this, 22, FLOAT_LABEL(lit_4192), 2, i_this->mAnmSpeed); + i_this->mMode++; } case 1: { - cLib_addCalc2(&i_this->field_0x5e8, FLOAT_LABEL(lit_3665), FLOAT_LABEL(lit_3662), + cLib_addCalc2(&i_this->mAnmSpeed, FLOAT_LABEL(lit_3665), FLOAT_LABEL(lit_3662), FLOAT_LABEL(lit_4345)); - i_this->mpMorf->setPlaySpeed(i_this->field_0x5e8); + i_this->mpMorf->setPlaySpeed(i_this->mAnmSpeed); - if (i_this->field_0x5e8 >= FLOAT_LABEL(lit_3665)) { + if (i_this->mAnmSpeed >= FLOAT_LABEL(lit_3665)) { i_this->mAction = ACT_RUN; - i_this->mStayStatus = 0; + i_this->mMode = 0; i_this->mSound.startSound(Z2SE_DOG_BARK, 0, -1); } } default: { - cLib_addCalc2(&i_this->speedF, i_this->field_0x5e8 * l_HIO.mWalkSpeed, + cLib_addCalc2(&i_this->speedF, i_this->mAnmSpeed * l_HIO.mWalkSpeed, FLOAT_LABEL(lit_3662), FLOAT_LABEL(lit_4342) * l_HIO.mWalkSpeed); - cLib_addCalcAngleS2(&i_this->current.angle.y, i_this->mAngleYFromPlayer, 8, 0x400); + cLib_addCalcAngleS2(&i_this->current.angle.y, i_this->mTargetAngleY, 8, 0x400); - if (i_this->mDistFromPlayer < FLOAT_LABEL(lit_4378) * i_this->field_0x674.z) { - l_HIO.field_0x1c != 0 ? i_this->mAction = ACT_WAIT_2 : i_this->mAction = ACT_WAIT_1; - i_this->mStayStatus = 0; + if (i_this->mDistFromPlayer < FLOAT_LABEL(lit_4378) * i_this->mScale.z) { + l_HIO.mWaitType != 0 ? i_this->mAction = ACT_WAIT_2 : i_this->mAction = ACT_WAIT_1; + i_this->mMode = 0; } area_check(i_this); @@ -1546,30 +1549,30 @@ COMPILER_STRIP_GATE(0x8066EEC0, &lit_4406); /* 806698D0-80669A1C 001C70 014C+00 1/1 0/0 0/0 .text do_run__FP8do_class */ static void do_run(do_class* i_this) { i_this->field_0x616 = 1; - i_this->field_0x648 = FLOAT_LABEL(lit_4400); + i_this->mTailWagTarget = FLOAT_LABEL(lit_4400); - switch (i_this->mStayStatus) { + switch (i_this->mMode) { case 0: { - i_this->field_0x5e8 = FLOAT_LABEL(lit_3662); - i_this->field_0x5ec = cM_rndF(FLOAT_LABEL(lit_4402)) + FLOAT_LABEL(lit_4401); - anm_init(i_this, 14, FLOAT_LABEL(lit_3665), 2, FLOAT_LABEL(lit_4403) * i_this->field_0x5e8); - i_this->mStayStatus++; + i_this->mAnmSpeed = FLOAT_LABEL(lit_3662); + i_this->mTargetAnmSpeed = cM_rndF(FLOAT_LABEL(lit_4402)) + FLOAT_LABEL(lit_4401); + anm_init(i_this, 14, FLOAT_LABEL(lit_3665), 2, FLOAT_LABEL(lit_4403) * i_this->mAnmSpeed); + i_this->mMode++; } case 1: { - cLib_addCalc2(&i_this->field_0x5e8, i_this->field_0x5ec, FLOAT_LABEL(lit_3662), + cLib_addCalc2(&i_this->mAnmSpeed, i_this->mTargetAnmSpeed, FLOAT_LABEL(lit_3662), FLOAT_LABEL(lit_4404)); - i_this->mpMorf->setPlaySpeed(i_this->field_0x5e8); + i_this->mpMorf->setPlaySpeed(i_this->mAnmSpeed); - if (i_this->mDistFromPlayer < FLOAT_LABEL(lit_4405) * i_this->field_0x674.z) { + if (i_this->mDistFromPlayer < FLOAT_LABEL(lit_4405) * i_this->mScale.z) { i_this->mAction = ACT_RUN_WALK; - i_this->mStayStatus = 0; + i_this->mMode = 0; } } default: { cLib_addCalc2(&i_this->speedF, - i_this->field_0x5e8 * l_HIO.mRunSpeed * FLOAT_LABEL(lit_4406), + i_this->mAnmSpeed * l_HIO.mRunSpeed * FLOAT_LABEL(lit_4406), FLOAT_LABEL(lit_3662), FLOAT_LABEL(lit_4342) * l_HIO.mRunSpeed); - cLib_addCalcAngleS2(&i_this->current.angle.y, i_this->mAngleYFromPlayer, 8, 0x800); + cLib_addCalcAngleS2(&i_this->current.angle.y, i_this->mTargetAngleY, 8, 0x800); area_check(i_this); move_dansa_check(i_this, i_this->speedF); } @@ -1587,31 +1590,31 @@ COMPILER_STRIP_GATE(0x8066EEC4, &lit_4435); /* 80669A1C-80669B80 001DBC 0164+00 1/1 0/0 0/0 .text do_run_walk__FP8do_class */ static void do_run_walk(do_class* i_this) { i_this->field_0x616 = 1; - i_this->field_0x648 = FLOAT_LABEL(lit_4344); + i_this->mTailWagTarget = FLOAT_LABEL(lit_4344); - switch (i_this->mStayStatus) { + switch (i_this->mMode) { case 0: { - i_this->field_0x5e8 = FLOAT_LABEL(lit_4336); - anm_init(i_this, 22, FLOAT_LABEL(lit_4194), 2, i_this->field_0x5e8); - i_this->mStayStatus++; + i_this->mAnmSpeed = FLOAT_LABEL(lit_4336); + anm_init(i_this, 22, FLOAT_LABEL(lit_4194), 2, i_this->mAnmSpeed); + i_this->mMode++; } case 1: { - cLib_addCalc2(&i_this->field_0x5e8, FLOAT_LABEL(lit_4401), FLOAT_LABEL(lit_3662), + cLib_addCalc2(&i_this->mAnmSpeed, FLOAT_LABEL(lit_4401), FLOAT_LABEL(lit_3662), FLOAT_LABEL(lit_4345)); - i_this->mpMorf->setPlaySpeed(i_this->field_0x5e8); + i_this->mpMorf->setPlaySpeed(i_this->mAnmSpeed); } default: { - cLib_addCalc2(&i_this->speedF, i_this->field_0x5e8 * l_HIO.mWalkSpeed, + cLib_addCalc2(&i_this->speedF, i_this->mAnmSpeed * l_HIO.mWalkSpeed, FLOAT_LABEL(lit_3662), FLOAT_LABEL(lit_4027)); - cLib_addCalcAngleS2(&i_this->current.angle.y, i_this->mAngleYFromPlayer, 8, 0x400); + cLib_addCalcAngleS2(&i_this->current.angle.y, i_this->mTargetAngleY, 8, 0x400); - if (i_this->mDistFromPlayer < FLOAT_LABEL(lit_4378) * i_this->field_0x674.z) { - l_HIO.field_0x1c != 0 ? i_this->mAction = ACT_WAIT_2 : i_this->mAction = ACT_WAIT_1; - i_this->mStayStatus = 0; + if (i_this->mDistFromPlayer < FLOAT_LABEL(lit_4378) * i_this->mScale.z) { + l_HIO.mWaitType != 0 ? i_this->mAction = ACT_WAIT_2 : i_this->mAction = ACT_WAIT_1; + i_this->mMode = 0; } else { - if (i_this->mDistFromPlayer > FLOAT_LABEL(lit_4435) * i_this->field_0x674.z) { + if (i_this->mDistFromPlayer > FLOAT_LABEL(lit_4435) * i_this->mScale.z) { i_this->mAction = ACT_RUN; - i_this->mStayStatus = 0; + i_this->mMode = 0; } } @@ -1626,9 +1629,9 @@ static void do_run_walk(do_class* i_this) { static void do_wait_1(do_class* i_this) { fopAc_ac_c* player = dComIfGp_getPlayer(0); i_this->field_0x616 = 1; - i_this->field_0x648 = 2000.0; + i_this->mTailWagTarget = 2000.0; - s16 player_angle = i_this->mAngleYFromPlayer; + s16 player_angle = i_this->mTargetAngleY; s16 angle_diff = i_this->current.angle.y - player_angle; if (angle_diff < 0) { @@ -1641,14 +1644,14 @@ static void do_wait_1(do_class* i_this) { some_val = 0x1000; } - switch (i_this->mStayStatus) { + switch (i_this->mMode) { case 0: { - if (i_this->mDistFromPlayer <= i_this->field_0x674.z * 320.0) { + if (i_this->mDistFromPlayer <= i_this->mScale.z * 320.0) { anm_init(i_this, ANM_WAIT, 0.0, 2, 0.0); - i_this->mStayStatus++; + i_this->mMode++; } else { anm_init(i_this, ANM_JOYFUL, 0.0, 2, cM_rndFX(0.1) + 0.6); - i_this->mStayStatus = -1; + i_this->mMode = -1; } // goto default; } @@ -1656,55 +1659,55 @@ static void do_wait_1(do_class* i_this) { cLib_addCalcAngleS2(&i_this->current.angle.y, player_angle, 4, 0x400); if (angle_diff < 0x800) { - i_this->mStayStatus = 0; + i_this->mMode = 0; } break; } case 3: { if (75.0 <= i_this->mEyePosYDistFromPlayer) { - i_this->mStayStatus = 1; - } else if (i_this->field_0x5fc[0] == 0) { + i_this->mMode = 1; + } else if (i_this->mTimer[0] == 0) { if (30.0 <= i_this->mEyePosYDistFromPlayer) { i_this->mAction = ACT_SIT; - i_this->mStayStatus = 0; + i_this->mMode = 0; } else { i_this->mAction = ACT_STAY; - i_this->mStayStatus = 10; + i_this->mMode = 10; } } break; } case 5: { - cLib_addCalcAngleS2(&i_this->current.angle.y, player_angle + i_this->field_0x654, 4, 0x800); - cLib_addCalcAngleS2(&i_this->field_0x654, i_this->field_0x656, 4, 0x1000); - cLib_addCalc2(&i_this->current.pos.x, i_this->field_0x5b8.x, 0.2, 3.5); - cLib_addCalc2(&i_this->current.pos.z, i_this->field_0x5b8.z, 0.2, 3.5); + cLib_addCalcAngleS2(&i_this->current.angle.y, player_angle + i_this->mRandomAngleY, 4, 0x800); + cLib_addCalcAngleS2(&i_this->mRandomAngleY, i_this->mRandomTargetAngleY, 4, 0x1000); + cLib_addCalc2(&i_this->current.pos.x, i_this->mTargetPos.x, 0.2, 3.5); + cLib_addCalc2(&i_this->current.pos.z, i_this->mTargetPos.z, 0.2, 3.5); - if (i_this->field_0x5fc[0] == 0) { - i_this->mStayStatus = 0; + if (i_this->mTimer[0] == 0) { + i_this->mMode = 0; } break; } case 6: { - i_this->field_0x648 = 4000.0; + i_this->mTailWagTarget = 4000.0; - if (i_this->field_0x674.z * 176.0 < i_this->mDistFromPlayer) { - i_this->mStayStatus = 0; + if (i_this->mScale.z * 176.0 < i_this->mDistFromPlayer) { + i_this->mMode = 0; } } default: { if (some_val < angle_diff) { anm_init(i_this, ANM_STEP_2, 0.0, 2, 0.0); - i_this->mStayStatus = 2; + i_this->mMode = 2; } else if (75.0 <= i_this->mEyePosYDistFromPlayer) { - // i_this->field_0x674.z might be a store in a variable - if (i_this->field_0x674.z * 96.0 <= i_this->mDistFromPlayer) { - if ((i_this->mStayStatus != 6) && - (i_this->mDistFromPlayer < i_this->field_0x674.z * 120.0)) + // i_this->mScale.z might be a store in a variable + if (i_this->mScale.z * 96.0 <= i_this->mDistFromPlayer) { + if ((i_this->mMode != 6) && + (i_this->mDistFromPlayer < i_this->mScale.z * 120.0)) { anm_init(i_this, ANM_JOYFUL, 0.0, 2, cM_rndFX(0.1) + 1.0); - i_this->mStayStatus = 6; + i_this->mMode = 6; } } else { cXyz local_68; @@ -1717,51 +1720,51 @@ static void do_wait_1(do_class* i_this) { for (int i = 0; i < 20; i++) { if (i < 10) { - mDoMtx_YrotS((MtxP)calc_mtx, i_this->mAngleYFromPlayer + cM_rndFX(5000.0)); + mDoMtx_YrotS((MtxP)calc_mtx, i_this->mTargetAngleY + cM_rndFX(5000.0)); } else { mDoMtx_YrotS((MtxP)calc_mtx, cM_rndF(65536.0)); } - local_68.z = dVar11 * i_this->field_0x674.z; + local_68.z = dVar11 * i_this->mScale.z; - MtxPosition(&local_68, &i_this->field_0x5b8); - i_this->field_0x5b8 += player->current.pos; + MtxPosition(&local_68, &i_this->mTargetPos); + i_this->mTargetPos += player->current.pos; if (cM_rndF(1.0) < dVar12) break; // local_74 = i_this->field6_0x5b8; - if (dansa_check(i_this, i_this->field_0x5b8, 0.0) == 0) + if (dansa_check(i_this, i_this->mTargetPos, 0.0) == 0) break; - i_this->mUnkPos = i_this->field_0x5b8; + i_this->mUnkPos = i_this->mTargetPos; i_this->field_0x624 = dVar10 + cM_rndF(10.0); } - i_this->mStayStatus = 5; - i_this->field_0x656 = cM_rndFX(10000.0); + i_this->mMode = 5; + i_this->mRandomTargetAngleY = cM_rndFX(10000.0); anm_init(i_this, ANM_WALK, 0.0, 2, 0.0); - i_this->field_0x5fc[0] = cM_rndF(10.0) + 15.0; + i_this->mTimer[0] = cM_rndF(10.0) + 15.0; } } else { - i_this->mStayStatus = 3; - i_this->field_0x5fc[0] = cM_rndF(10.0) + 10.0; + i_this->mMode = 3; + i_this->mTimer[0] = cM_rndF(10.0) + 10.0; } break; } case 10: { - i_this->field_0x5e8 = 5.0; - anm_init(i_this, ANM_WALK, 0.0, 2, i_this->field_0x5e8); + i_this->mAnmSpeed = 5.0; + anm_init(i_this, ANM_WALK, 0.0, 2, i_this->mAnmSpeed); - i_this->mStayStatus++; + i_this->mMode++; } case 11: { - cLib_addCalc2(&i_this->field_0x5e8, 2.0, 1.0, 0.2); - i_this->mpMorf->setPlaySpeed(i_this->field_0x5e8); + cLib_addCalc2(&i_this->mAnmSpeed, 2.0, 1.0, 0.2); + i_this->mpMorf->setPlaySpeed(i_this->mAnmSpeed); - if (i_this->field_0x5e8 <= 2.2) { - i_this->mStayStatus = 0; + if (i_this->mAnmSpeed <= 2.2) { + i_this->mMode = 0; } break; @@ -1775,19 +1778,19 @@ static void do_wait_1(do_class* i_this) { cLib_addCalc0(&i_this->speedF, 1.0, 1.0); - if (i_this->field_0x674.z * 240.0 < i_this->mDistFromPlayer && !dansa_check2(i_this, 0.0) && - i_this->mStayStatus < 10) + if (i_this->mScale.z * 240.0 < i_this->mDistFromPlayer && !dansa_check2(i_this, 0.0) && + i_this->mMode < 10) { i_this->mAction = ACT_WALK_RUN; - i_this->field_0x5e8 = 1.5; - anm_init(i_this, ANM_WALK, 0.0, 2, i_this->field_0x5e8); - i_this->mStayStatus = 1; + i_this->mAnmSpeed = 1.5; + anm_init(i_this, ANM_WALK, 0.0, 2, i_this->mAnmSpeed); + i_this->mMode = 1; } // might be a seperate variable for link if (daPy_getLinkPlayerActorClass()->checkCanoeRide() && i_this->mDistFromPlayer < 1000.0) { i_this->mAction = ACT_HELP; - i_this->mStayStatus = 0; + i_this->mMode = 0; } if (i_this->field_0x5b4 == 2) { @@ -1915,22 +1918,22 @@ static void do_wait_2(do_class* i_this) { fopAc_ac_c* player = dComIfGp_getPlayer(0); i_this->field_0x616 = 1; - i_this->field_0x648 = FLOAT_LABEL(lit_4400); + i_this->mTailWagTarget = FLOAT_LABEL(lit_4400); - switch (i_this->mStayStatus) { + switch (i_this->mMode) { case 0: { - i_this->mStayStatus++; + i_this->mMode++; } case 1: { - if (i_this->field_0x5fc[0] == 0) { - i_this->field_0x5fc[0] = cM_rndF(FLOAT_LABEL(lit_4189)) + FLOAT_LABEL(lit_4192); - i_this->field_0x656 = cM_rndFX(FLOAT_LABEL(lit_4587)); + if (i_this->mTimer[0] == 0) { + i_this->mTimer[0] = cM_rndF(FLOAT_LABEL(lit_4189)) + FLOAT_LABEL(lit_4192); + i_this->mRandomTargetAngleY = cM_rndFX(FLOAT_LABEL(lit_4587)); cM_rndF(FLOAT_LABEL(lit_3662)) < FLOAT_LABEL(lit_4588) ? - i_this->field_0x5e8 = cM_rndF(FLOAT_LABEL(lit_4342)) + FLOAT_LABEL(lit_3665) : - i_this->field_0x5e8 = -(cM_rndF(FLOAT_LABEL(lit_4342)) + FLOAT_LABEL(lit_3665)); + i_this->mAnmSpeed = cM_rndF(FLOAT_LABEL(lit_4342)) + FLOAT_LABEL(lit_3665) : + i_this->mAnmSpeed = -(cM_rndF(FLOAT_LABEL(lit_4342)) + FLOAT_LABEL(lit_3665)); - anm_init(i_this, ANM_STEP, FLOAT_LABEL(lit_4194), 2, i_this->field_0x5e8); + anm_init(i_this, ANM_STEP, FLOAT_LABEL(lit_4194), 2, i_this->mAnmSpeed); mDoMtx_YrotS((MtxP)calc_mtx, player->shape_angle.y); Vec local_38; @@ -1939,26 +1942,26 @@ static void do_wait_2(do_class* i_this) { local_38.y = FLOAT_LABEL(lit_3682); local_38.z = cM_rndF(FLOAT_LABEL(lit_3816)) + FLOAT_LABEL(lit_4551); - MtxPosition((cXyz*)&local_38, &i_this->field_0x5b8); - i_this->field_0x5b8 += player->current.pos; + MtxPosition((cXyz*)&local_38, &i_this->mTargetPos); + i_this->mTargetPos += player->current.pos; } break; } } - cLib_addCalc2(&i_this->current.pos.x, i_this->field_0x5b8.x, FLOAT_LABEL(lit_4342), + cLib_addCalc2(&i_this->current.pos.x, i_this->mTargetPos.x, FLOAT_LABEL(lit_4342), FLOAT_LABEL(lit_3665)); - cLib_addCalc2(&i_this->current.pos.z, i_this->field_0x5b8.z, FLOAT_LABEL(lit_4342), + cLib_addCalc2(&i_this->current.pos.z, i_this->mTargetPos.z, FLOAT_LABEL(lit_4342), FLOAT_LABEL(lit_3665)); cLib_addCalc0(&i_this->speedF, FLOAT_LABEL(lit_3662), FLOAT_LABEL(lit_3665)); - cLib_addCalcAngleS2(&i_this->current.angle.y, i_this->mAngleYFromPlayer + i_this->field_0x654, + cLib_addCalcAngleS2(&i_this->current.angle.y, i_this->mTargetAngleY + i_this->mRandomAngleY, 4, 0x800); - cLib_addCalcAngleS2(&i_this->field_0x654, i_this->field_0x656, 4, 0x1000); + cLib_addCalcAngleS2(&i_this->mRandomAngleY, i_this->mRandomTargetAngleY, 4, 0x1000); - if (i_this->mDistFromPlayer > FLOAT_LABEL(lit_3923) * i_this->field_0x674.z) { + if (i_this->mDistFromPlayer > FLOAT_LABEL(lit_3923) * i_this->mScale.z) { i_this->mAction = ACT_RUN; - i_this->mStayStatus = 0; + i_this->mMode = 0; } area_check(i_this); @@ -1969,22 +1972,22 @@ static void do_wait_2(do_class* i_this) { // matches except float literal in inline static void do_sit(do_class* i_this) { i_this->field_0x616 = 1; - i_this->field_0x648 = FLOAT_LABEL(lit_4190); + i_this->mTailWagTarget = FLOAT_LABEL(lit_4190); - switch (i_this->mStayStatus) { + switch (i_this->mMode) { case 0: { anm_init(i_this, ANM_SIT_WAIT, FLOAT_LABEL(lit_4192), 2, FLOAT_LABEL(lit_3662)); - i_this->mStayStatus++; + i_this->mMode++; } case 1: { if (i_this->mEyePosYDistFromPlayer > FLOAT_LABEL(lit_4545)) { - i_this->mStayStatus = 3; - i_this->field_0x5fc[0] = cM_rndF(FLOAT_LABEL(lit_4192)) + FLOAT_LABEL(lit_4192); + i_this->mMode = 3; + i_this->mTimer[0] = cM_rndF(FLOAT_LABEL(lit_4192)) + FLOAT_LABEL(lit_4192); } else { if (i_this->mEyePosYDistFromPlayer < FLOAT_LABEL(lit_3846)) { - i_this->mStayStatus = 2; - i_this->field_0x5fc[0] = cM_rndF(FLOAT_LABEL(lit_4192)) + FLOAT_LABEL(lit_4192); + i_this->mMode = 2; + i_this->mTimer[0] = cM_rndF(FLOAT_LABEL(lit_4192)) + FLOAT_LABEL(lit_4192); } } break; @@ -1992,24 +1995,24 @@ static void do_sit(do_class* i_this) { case 2: { if (i_this->mEyePosYDistFromPlayer < FLOAT_LABEL(lit_3846)) { - if (i_this->field_0x5fc[0] == 0) { + if (i_this->mTimer[0] == 0) { i_this->mAction = ACT_STAY; - i_this->mStayStatus = 10; + i_this->mMode = 10; } } else { - i_this->mStayStatus = 1; + i_this->mMode = 1; } break; } case 3: { if (i_this->mEyePosYDistFromPlayer > FLOAT_LABEL(lit_4545)) { - if (i_this->field_0x5fc[0] == 0) { + if (i_this->mTimer[0] == 0) { anm_init(i_this, ANM_SIT, FLOAT_LABEL(lit_4194), 0, FLOAT_LABEL(lit_3662)); - i_this->mStayStatus++; + i_this->mMode++; } } else { - i_this->mStayStatus = 1; + i_this->mMode = 1; } break; @@ -2018,7 +2021,7 @@ static void do_sit(do_class* i_this) { case 4: { if (i_this->mpMorf->isStop()) { i_this->mAction = ACT_WAIT_1; - i_this->mStayStatus = 0; + i_this->mMode = 0; } break; } @@ -2026,10 +2029,10 @@ static void do_sit(do_class* i_this) { cLib_addCalc0(&i_this->speedF, FLOAT_LABEL(lit_3662), FLOAT_LABEL(lit_3665)); - if (i_this->mDistFromPlayer > FLOAT_LABEL(lit_3773) * i_this->field_0x674.z) { + if (i_this->mDistFromPlayer > FLOAT_LABEL(lit_3773) * i_this->mScale.z) { i_this->mAction = ACT_STAY; i_this->field_0x5f4 = 8; - i_this->mStayStatus = 0; + i_this->mMode = 0; } area_check(i_this); @@ -2200,34 +2203,34 @@ static void do_swim(do_class* i_this) { Vec pos; // this is probably cXyz but defining it as such moves ~cXyz to right after this // function, breaking the TU match i_this->field_0x616 = 1; - i_this->field_0x648 = FLOAT_LABEL(lit_4191); + i_this->mTailWagTarget = FLOAT_LABEL(lit_4191); - switch (i_this->mStayStatus) { + switch (i_this->mMode) { case 1: { break; } case 0: { anm_init(i_this, 19, FLOAT_LABEL(lit_4027), 2, cM_rndF(FLOAT_LABEL(lit_4991)) + FLOAT_LABEL(lit_4340)); - i_this->mStayStatus++; + i_this->mMode++; break; } } cLib_addCalc2(&i_this->speedF, l_HIO.mSwimSpeed, FLOAT_LABEL(lit_3662), FLOAT_LABEL(lit_4588) * l_HIO.mSwimSpeed); - cLib_addCalcAngleS2(&i_this->current.angle.y, i_this->mAngleYFromPlayer, 16, 0x100); + cLib_addCalcAngleS2(&i_this->current.angle.y, i_this->mTargetAngleY, 16, 0x100); i_this->speed.y = FLOAT_LABEL(lit_3682); i_this->gravity = FLOAT_LABEL(lit_3682); - cLib_addCalc2(&i_this->current.pos.y, i_this->field_0x65c - FLOAT_LABEL(lit_4992), + cLib_addCalc2(&i_this->current.pos.y, i_this->mWaterY - FLOAT_LABEL(lit_4992), FLOAT_LABEL(lit_3662), FLOAT_LABEL(lit_4027)); pos = i_this->eyePos; - pos.y = i_this->field_0x65c; + pos.y = i_this->mWaterY; - fopAcM_effHamonSet(&i_this->field_0xbcc, (cXyz*)&pos, FLOAT_LABEL(lit_4993), + fopAcM_effHamonSet(&i_this->mRippleKey, (cXyz*)&pos, FLOAT_LABEL(lit_4993), FLOAT_LABEL(lit_4402)); } @@ -2343,10 +2346,10 @@ COMPILER_STRIP_GATE(0x8066EF5C, &lit_5407); /* 8066C894-8066CAA8 004C34 0214+00 1/1 0/0 0/0 .text do_a_swim__FP8do_class */ #ifdef NONMATCHING static void do_a_swim(do_class* i_this) { - i_this->field_0x648 = 2000.0; + i_this->mTailWagTarget = 2000.0; cLib_addCalc0(&i_this->speedF, 1.0, 1.0); - switch (i_this->mStayStatus) { + switch (i_this->mMode) { case 2: { l_HIO.mWaterHuntAnimType == 1 ? i_this->mpMorf->setPlaySpeed(i_this->field46_0x634 * 5.0) : i_this->mpMorf->setPlaySpeed(i_this->field46_0x634 * 5.0); @@ -2357,13 +2360,13 @@ static void do_a_swim(do_class* i_this) { i_this->field_0x634 = 0.0; i_this->mAction = ACT_WAIT_1; - i_this->mStayStatus = 0; + i_this->mMode = 0; break; } case 0: { l_HIO.mWaterHuntAnimType == 1 ? anm_init(param_1, ANM_JOYFUL, 0.0, 2, 0.0) : anm_init(param_1, ANM_BULBUL, 0.0, 2, 0.0); - i_this->mStayStatus = 1; + i_this->mMode = 1; i_this->field32_0x5fc[0] = 0x14; JPABaseEmitter* emitter = dComIfGp_particle_set(0x2a3, &i_this->.current.pos, 0, 0); @@ -2376,8 +2379,8 @@ static void do_a_swim(do_class* i_this) { } } - if (i_this->field_0x5fc[0] == 0) { - i_this->mStayStatus = 2; + if (i_this->mTimer[0] == 0) { + i_this->mMode = 2; i_this->field_0x634 = 0.1; i_this->field_0x638 = 1.0; } @@ -2430,26 +2433,26 @@ static asm u8 do_carry(do_class* i_this) { /* 8066CDEC-8066CEC4 00518C 00D8+00 1/1 0/0 0/0 .text do_message__FP8do_class */ static void do_message(do_class* i_this) { - i_this->field_0x648 = FLOAT_LABEL(lit_4191); + i_this->mTailWagTarget = FLOAT_LABEL(lit_4191); - switch (i_this->mStayStatus) { + switch (i_this->mMode) { case 1: { break; } case 0: { anm_init(i_this, 21, FLOAT_LABEL(lit_4027), 2, FLOAT_LABEL(lit_3662)); - i_this->mStayStatus++; + i_this->mMode++; break; } } cLib_addCalc0(&i_this->speedF, FLOAT_LABEL(lit_3662), FLOAT_LABEL(lit_3665)); i_this->field_0x616 = 1; - cLib_addCalcAngleS2(&i_this->current.angle.y, i_this->mAngleYFromPlayer, 2, 0x1000); + cLib_addCalcAngleS2(&i_this->current.angle.y, i_this->mTargetAngleY, 2, 0x1000); if (dComIfGp_event_runCheck() == 0 && i_this->mDistFromPlayer > FLOAT_LABEL(lit_3773)) { i_this->mAction = ACT_STAY; - i_this->mStayStatus = 0; + i_this->mMode = 0; } } @@ -2558,7 +2561,7 @@ static void action(do_class* i_this) { i_this->mDistFromPlayer -= FLOAT_LABEL(lit_3772); } - i_this->mAngleYFromPlayer = fopAcM_searchPlayerAngleY(i_this); + i_this->mTargetAngleY = fopAcM_searchPlayerAngleY(i_this); i_this->mEyePosYDistFromPlayer = fabsf(i_this->eyePos.y - player->current.pos.y); if (!mDoCPd_c::getHoldR(PAD_1) || @@ -2576,60 +2579,60 @@ static void action(do_class* i_this) { i_this->mCcD_GObjInf1.OnCoSetBit(); if (i_this->field_0x608 < FLOAT_LABEL(lit_3662)) { - i_this->field_0xc05 = 0; + i_this->mMessageState = 0; switch (i_this->mAction) { case ACT_STAY: { do_stay(i_this); food_check(i_this); - i_this->field_0xc05 = 1; + i_this->mMessageState = 1; break; } case ACT_WALK: { do_walk(i_this); food_check(i_this); - i_this->field_0xc05 = 1; + i_this->mMessageState = 1; break; } case ACT_WALK_RUN: { do_walk_run(i_this); food_check(i_this); - i_this->field_0xc05 = 1; + i_this->mMessageState = 1; break; } case ACT_RUN: { do_run(i_this); food_check(i_this); - i_this->field_0xc05 = 1; + i_this->mMessageState = 1; break; } case ACT_RUN_WALK: { do_run_walk(i_this); food_check(i_this); - i_this->field_0xc05 = 1; + i_this->mMessageState = 1; break; } case ACT_FOOD: { do_food(i_this); - i_this->field_0xc05 = 1; + i_this->mMessageState = 1; break; } case ACT_WAIT_1: { do_wait_1(i_this); food_check(i_this); - i_this->field_0xc05 = 1; + i_this->mMessageState = 1; break; } case ACT_WAIT_2: { do_wait_2(i_this); food_check(i_this); - i_this->field_0xc05 = 1; + i_this->mMessageState = 1; break; } case ACT_SIT: { do_sit(i_this); food_check(i_this); - i_this->field_0xc05 = 1; + i_this->mMessageState = 1; break; } case ACT_A_SWIM: { @@ -2663,13 +2666,13 @@ static void action(do_class* i_this) { } case ACT_MESSAGE: { do_message(i_this); - i_this->field_0xc05 = 2; + i_this->mMessageState = 2; } } } if (i_this->mItemPcId != -1 && - i_this->mDistFromPlayer < FLOAT_LABEL(lit_4378) * i_this->field_0x674.z) + i_this->mDistFromPlayer < FLOAT_LABEL(lit_4378) * i_this->mScale.z) { daItem_c* item = (daItem_c*)fopAcM_SearchByID(i_this->mItemPcId); @@ -2688,11 +2691,11 @@ static void action(do_class* i_this) { } } - if (i_this->field_0xc05 == 1 && daPy_py_c::i_checkNowWolf() && + if (i_this->mMessageState == 1 && daPy_py_c::i_checkNowWolf() && i_this->mDistFromPlayer < FLOAT_LABEL(lit_4339)) { i_this->mAction = ACT_MESSAGE; - i_this->mStayStatus = 0; + i_this->mMode = 0; } if (tmp2 != 0 && player->mSpeedF < FLOAT_LABEL(lit_3665)) { @@ -2713,7 +2716,7 @@ static void action(do_class* i_this) { pos1.x = FLOAT_LABEL(lit_3682); pos1.y = FLOAT_LABEL(lit_3682); pos1.z = FLOAT_LABEL(lit_3981) * i_this->speedF; - pos1.z *= i_this->field_0x674.z; + pos1.z *= i_this->mScale.z; MtxPosition(&pos1, &pos2); @@ -2764,7 +2767,7 @@ static void action(do_class* i_this) { pos1.x = FLOAT_LABEL(lit_3682); pos1.y = FLOAT_LABEL(lit_3682); - pos1.z = FLOAT_LABEL(lit_5950) * i_this->field_0x674.z; + pos1.z = FLOAT_LABEL(lit_5950) * i_this->mScale.z; MtxPosition(&pos1, &pos2); pos2 += i_this->current.pos; @@ -2794,7 +2797,7 @@ static void action(do_class* i_this) { if (i_this->field_0x660 == 0xdcf) { i_this->mAction = ACT_HANG; - i_this->mStayStatus = 0; + i_this->mMode = 0; i_this->field_0x63c = 0; } } @@ -2807,30 +2810,30 @@ static void action(do_class* i_this) { if (i_this->mAction == ACT_CARRY) { if (i_this->field_0x63c != 0 && i_this->field_0x63c--, i_this->field_0x63c == 0) { i_this->mAction = ACT_A_SWIM; - i_this->mStayStatus = 0; + i_this->mMode = 0; } - if (45.0f < i_this->field_0x65c - i_this->current.pos.y) { + if (45.0f < i_this->mWaterY - i_this->current.pos.y) { i_this->mAction = ACT_SWIM; - i_this->mStayStatus = 0; + i_this->mMode = 0; i_this->field_0x608 = FLOAT_LABEL(lit_3682); if (i_this->field_0x606 == 0) { i_this->field_0x606 = 0x14; cXyz pos = i_this->current.pos; - pos.y = i_this->field_0x65c; + pos.y = i_this->mWaterY; if (l_HIO.mRunSpeed == 0) { scc[0] = 0; // fix later l_HIO.mWalkSpeed = FLOAT_LABEL(lit_3682); l_HIO.mRunSpeed = FLOAT_LABEL(lit_3682); - l_HIO.field_0x1c = 1; + l_HIO.mWaitType = 1; } for (int i = 0; i < 4; i++) { // wrong i_this->mMsg.setMsg(dComIfGp_particle_set( - (u32)0, (u16)l_HIO.field_0x1c, &pos, &i_this->tevStr, (csXyz*)0, + (u32)0, (u16)l_HIO.mWaitType, &pos, &i_this->tevStr, (csXyz*)0, (cXyz*)&scc, (u8)0xFF, (dPa_levelEcallBack*)0, (s8)-1, (GXColor*)0, (GXColor*)0, (cXyz*)0)); } @@ -2842,9 +2845,9 @@ static void action(do_class* i_this) { } else { i_this->field_0x63c = cM_rndF(FLOAT_LABEL(lit_4025)) + FLOAT_LABEL(lit_3846); - if (i_this->field_0x65c - i_this->current.pos.y < FLOAT_LABEL(lit_5951)) { + if (i_this->mWaterY - i_this->current.pos.y < FLOAT_LABEL(lit_5951)) { i_this->mAction = ACT_WAIT_1; - i_this->mStayStatus = 0; + i_this->mMode = 0; } } @@ -2869,7 +2872,7 @@ static void action(do_class* i_this) { eyePosDiff = i_this->mUnkPos - i_this->eyePos; } - eyePosDiff.y += i_this->field_0x674.z * FLOAT_LABEL(lit_5952); + eyePosDiff.y += i_this->mScale.z * FLOAT_LABEL(lit_5952); s16 some_angle = cM_atan2s(eyePosDiff.x, eyePosDiff.z) - i_this->shape_angle.y; s16 some_angle2 = cM_atan2s(eyePosDiff.y, JMAFastSqrt(eyePosDiff.x * eyePosDiff.x + @@ -2903,7 +2906,7 @@ static void action(do_class* i_this) { } cLib_addCalcAngleS2(&i_this->field_0x610, tmp4 / 2, 4, 0x2000); - cLib_addCalcAngleS2(&i_this->field_0x60e, tmp5 / 2, 4, 0x2000); + cLib_addCalcAngleS2(&i_this->mHeadAngle, tmp5 / 2, 4, 0x2000); cLib_addCalcAngleS2(&i_this->field_0x614, 0, 2, 0x300); cLib_addCalcAngleS2(&i_this->field_0x628, i_this->field_0x62e, 4, 0x400); cLib_addCalcAngleS2(&i_this->field_0x62a, i_this->field_0x630, 4, 0x400); @@ -2927,7 +2930,7 @@ static void action(do_class* i_this) { } if (0.025 <= i_this->field_0x634) { - if (l_HIO.field_0x1c == 0) { + if (l_HIO.mWaitType == 0) { i_this->field_0x612 = 0; i_this->field_0x610 = 0; } else { @@ -2940,23 +2943,23 @@ static void action(do_class* i_this) { FLOAT_LABEL(lit_5407)); cLib_addCalc0(&i_this->field_0x638, FLOAT_LABEL(lit_3662), FLOAT_LABEL(lit_5954)); - i_this->field_0x640 = cM_ssin(i_this->field_0x648 * i_this->field_0x64c); - i_this->field_0x63e = cM_ssin(i_this->field_0x648 * i_this->field_0x650); - i_this->field_0x64c += i_this->field_0x648 * FLOAT_LABEL(lit_3682); + i_this->field_0x640 = cM_ssin(i_this->mTailWagTarget * i_this->field_0x64c); + i_this->mTailAngle = cM_ssin(i_this->mTailWagTarget * i_this->field_0x650); + i_this->field_0x64c += i_this->mTailWagTarget * FLOAT_LABEL(lit_3682); if (65536.0 < i_this->field_0x64c) { i_this->field_0x64c -= FLOAT_LABEL(lit_4338); } - i_this->field_0x650 += i_this->field_0x648 * FLOAT_LABEL(lit_4401); + i_this->field_0x650 += i_this->mTailWagTarget * FLOAT_LABEL(lit_4401); if (65536.0 < i_this->field_0x650) { i_this->field_0x650 -= FLOAT_LABEL(lit_4338); } - cLib_addCalc2(&i_this->field_0x648, i_this->field_0x648, FLOAT_LABEL(lit_3662), + cLib_addCalc2(&i_this->mTailWagTarget, i_this->mTailWagTarget, FLOAT_LABEL(lit_3662), FLOAT_LABEL(lit_3772)); - i_this->field_0x648 = FLOAT_LABEL(lit_3682); + i_this->mTailWagTarget = FLOAT_LABEL(lit_3682); if (i_this->field_0x5e2 == 0) { if (i_this->field_0x5e0 == 0) { @@ -2985,21 +2988,21 @@ static asm void action(do_class* i_this) { /* 8066DD48-8066DE64 0060E8 011C+00 1/1 0/0 0/0 .text message__FP8do_class */ static void message(do_class* i_this) { - if (i_this->field_0xc06 != 0) { - i_this->field_0x604 = 10; + if (i_this->mIsTalking != 0) { + i_this->mCcDisableTimer = 10; if (i_this->mMsg.doFlow(i_this, 0, 0)) { dComIfGp_event_reset(); - i_this->field_0xc06 = 0; + i_this->mIsTalking = 0; } } else { if (dComIfGp_event_runCheck() && i_this->eventInfo.checkCommandTalk()) { - i_this->mMsg.init(i_this, i_this->field_0xc08, 0, 0); - i_this->field_0xc06 = 1; + i_this->mMsg.init(i_this, i_this->mFlowID, 0, 0); + i_this->mIsTalking = 1; } - if (i_this->field_0xc05 == 2 && i_this->field_0xc08 != -1 && daPy_py_c::i_checkNowWolf()) { + if (i_this->mMessageState == 2 && i_this->mFlowID != -1 && daPy_py_c::i_checkNowWolf()) { fopAcM_OnStatus(i_this, 0); cLib_onBit(i_this->attention_info.flags, 0xa); i_this->eventInfo.i_onCondition(dEvtCnd_CANTALK_e); @@ -3179,7 +3182,8 @@ do_class::do_class() {} #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm do_class::do_class() { +// asm do_class::do_class() { +extern "C" asm void __ct__8do_classFv() { nofralloc #include "asm/rel/d/a/d_a_do/d_a_do/__ct__8do_classFv.s" } diff --git a/rel/d/a/d_a_do/d_a_do_NONMATCHING.cpp b/rel/d/a/d_a_do/d_a_do_NONMATCHING.cpp new file mode 100644 index 00000000000..bd1a9687971 --- /dev/null +++ b/rel/d/a/d_a_do/d_a_do_NONMATCHING.cpp @@ -0,0 +1,2827 @@ +/** + * d_a_do.cpp + * Dog + */ + +// Every function matches, but a Z2SoundObjSimple dtor is generated that should not exist + +#include "rel/d/a/d_a_do/d_a_do.h" +#include "JSystem/JGeometry.h" +#include "SSystem/SComponent/c_math.h" +#include "m_Do/m_Do_controller_pad.h" +#include "c/c_damagereaction.h" +#include "d/com/d_com_inf_game.h" +#include "d/a/d_a_player.h" +#include "d/a/d_a_item_static.h" +#include "d/d_procname.h" +#include "f_op/f_op_actor_mng.h" +#include "rel/d/a/d_a_canoe/d_a_canoe.h" +#include "rel/d/a/obj/d_a_obj_food/d_a_obj_food.h" + +/* 8066F278-8066F27C 000008 0001+03 3/3 0/0 0/0 .bss @1109 */ +static u8 lit_1109[1 + 3 /* padding */]; + +/* 8066F27C-8066F280 00000C 0001+03 0/0 0/0 0/0 .bss @1107 */ +#pragma push +#pragma force_active on +static u8 lit_1107[1 + 3 /* padding */]; +#pragma pop + +/* 8066F280-8066F284 000010 0001+03 0/0 0/0 0/0 .bss @1105 */ +#pragma push +#pragma force_active on +static u8 lit_1105[1 + 3 /* padding */]; +#pragma pop + +/* 8066F284-8066F288 000014 0001+03 0/0 0/0 0/0 .bss @1104 */ +#pragma push +#pragma force_active on +static u8 lit_1104[1 + 3 /* padding */]; +#pragma pop + +/* 8066F288-8066F28C 000018 0001+03 0/0 0/0 0/0 .bss @1099 */ +#pragma push +#pragma force_active on +static u8 lit_1099[1 + 3 /* padding */]; +#pragma pop + +/* 8066F28C-8066F290 00001C 0001+03 0/0 0/0 0/0 .bss @1097 */ +#pragma push +#pragma force_active on +static u8 lit_1097[1 + 3 /* padding */]; +#pragma pop + +/* 8066F290-8066F294 000020 0001+03 0/0 0/0 0/0 .bss @1095 */ +#pragma push +#pragma force_active on +static u8 lit_1095[1 + 3 /* padding */]; +#pragma pop + +/* 8066F294-8066F298 000024 0001+03 0/0 0/0 0/0 .bss @1094 */ +#pragma push +#pragma force_active on +static u8 lit_1094[1 + 3 /* padding */]; +#pragma pop + +/* 8066F298-8066F29C 000028 0001+03 0/0 0/0 0/0 .bss @1057 */ +#pragma push +#pragma force_active on +static u8 lit_1057[1 + 3 /* padding */]; +#pragma pop + +/* 8066F29C-8066F2A0 00002C 0001+03 0/0 0/0 0/0 .bss @1055 */ +#pragma push +#pragma force_active on +static u8 lit_1055[1 + 3 /* padding */]; +#pragma pop + +/* 8066F2A0-8066F2A4 000030 0001+03 0/0 0/0 0/0 .bss @1053 */ +#pragma push +#pragma force_active on +static u8 lit_1053[1 + 3 /* padding */]; +#pragma pop + +/* 8066F2A4-8066F2A8 000034 0001+03 0/0 0/0 0/0 .bss @1052 */ +#pragma push +#pragma force_active on +static u8 lit_1052[1 + 3 /* padding */]; +#pragma pop + +/* 8066F2A8-8066F2AC 000038 0001+03 0/0 0/0 0/0 .bss @1014 */ +#pragma push +#pragma force_active on +static u8 lit_1014[1 + 3 /* padding */]; +#pragma pop + +/* 8066F2AC-8066F2B0 00003C 0001+03 0/0 0/0 0/0 .bss @1012 */ +#pragma push +#pragma force_active on +static u8 lit_1012[1 + 3 /* padding */]; +#pragma pop + +/* 8066F2B0-8066F2B4 000040 0001+03 0/0 0/0 0/0 .bss @1010 */ +#pragma push +#pragma force_active on +static u8 lit_1010[1 + 3 /* padding */]; +#pragma pop + +/* 8066F2B4-8066F2B8 -00001 0004+00 1/2 0/0 0/0 .bss None */ +/* 8066F2B4 0001+01 data_8066F2B4 @1009 */ +/* 8066F2B6 0002+00 data_8066F2B6 None */ +static u8 data_8066F2B4; +static bool noFallCheck; +static bool hioInit; + +/* 8066F2C4-8066F2E4 000054 0020+00 11/12 0/0 0/0 .bss l_HIO */ +static daDo_HIO_c l_HIO; + +/* 80667D4C-80667DA8 0000EC 005C+00 1/1 0/0 0/0 .text __ct__10daDo_HIO_cFv */ +daDo_HIO_c::daDo_HIO_c() { + field_0x04 = -1; + mBaseSize = 1.0f; + mWalkSpeed = 2.5f; + mRunSpeed = 12.0f; + mSwimSpeed = 2.0f; + mPlayerRecognitionDist = 600.0f; + mWaitType = 0; + mSwimming = 1; + mWaterHuntAnimType = 0; +} + +/* 80667DA8-80667E68 000148 00C0+00 16/16 0/0 0/0 .text anm_init__FP8do_classifUcf */ +static void anm_init(do_class* i_this, int i_resIdx, f32 i_morf, u8 i_mode, f32 i_speed) { + if (!(i_this->field_0x608 > 1.0f)) { + i_this->mpMorf->setAnm(static_cast(dComIfG_getObjectRes("Do", i_resIdx)), + i_mode, i_morf, i_speed, 0.0f, -1.0f, 0); + i_this->mAnmID = i_resIdx; + } +} + +/* 80667E68-80667FE4 000208 017C+00 1/1 0/0 0/0 .text nodeCallBack__FP8J3DJointi */ +static int nodeCallBack(J3DJoint* i_jntP, int param_1) { + if (param_1 == 0) { + int joint_num = i_jntP->getJntNo(); + J3DModel* model = j3dSys.getModel(); + do_class* _this = (do_class*)model->getUserArea(); + + if (_this != NULL) { + MTXCopy(model->getAnmMtx(joint_num), *calc_mtx); + + if (joint_num == 9 || joint_num == 10) { + cMtx_YrotM(*calc_mtx, _this->mHeadAngle.y + _this->mHeadBob.y); + cMtx_XrotM(*calc_mtx, _this->mHeadAngle.z + _this->mHeadBob.z); + cMtx_ZrotM(*calc_mtx, _this->mHeadAngle.x); + } else if (joint_num == 22) { + cMtx_YrotM(*calc_mtx, _this->mTailAngle.y << 1); + cMtx_ZrotM(*calc_mtx, _this->mTailAngle.x << 1); + } else { + cMtx_YrotM(*calc_mtx, _this->mTailAngle.y); + cMtx_ZrotM(*calc_mtx, _this->mTailAngle.x); + } + + model->setAnmMtx(joint_num, *calc_mtx); + MTXCopy(*calc_mtx, j3dSys.mCurrentMtx); + } + } + return 1; +} + +/* 80667FE4-80668134 000384 0150+00 1/0 0/0 0/0 .text daDo_Draw__FP8do_class */ +static int daDo_Draw(do_class* i_this) { + if (i_this->mNoDraw != 0) { + i_this->mNoDraw = 0; + return 1; + } + + if (daPy_py_c::linkGrabSubjectNoDraw(i_this)) { + return 1; + } + + J3DModel* model = i_this->mpMorf->getModel(); + g_env_light.settingTevStruct(0, &i_this->current.pos, &i_this->tevStr); + g_env_light.setLightTevColorType_MAJI(model, &i_this->tevStr); + i_this->mpBtk->entry(model->getModelData()); + i_this->mpBtp->entry(model->getModelData()); + i_this->mpMorf->entryDL(); + + if (!fopAcM_checkCarryNow(i_this) && i_this->mAction != ACT_BOAT) { + cXyz pos; + pos.set(i_this->current.pos.x, i_this->current.pos.y + 100.0f, i_this->current.pos.z); + i_this->mShadowKey = + dComIfGd_setShadow(i_this->mShadowKey, 1, model, &pos, 400.0f, 0.0f, + i_this->current.pos.y, i_this->mBgS_Acch.GetGroundH(), + i_this->mBgS_Acch.m_gnd, &i_this->tevStr, 0, 1.0f, + dDlst_shadowControl_c::getSimpleTex()); + } + + return 1; +} + +/* 80668170-80668264 000510 00F4+00 1/1 0/0 0/0 .text + * daDo_other_bg_check__FP8do_classP10fopAc_ac_c */ +static BOOL daDo_other_bg_check(do_class* i_this, fopAc_ac_c* i_actor) { + fopAc_ac_c* _this = static_cast(i_this); + cXyz dog_pos; + cXyz actor_pos; + dBgS_LinChk lin_chk; + + if (i_actor != NULL) { + actor_pos = i_actor->current.pos; + actor_pos.y += 50.0f; + + dog_pos = _this->current.pos; + dog_pos.y = _this->eyePos.y; + + lin_chk.Set(&dog_pos, &actor_pos, _this); + if (dComIfG_Bgsp().LineCross(&lin_chk)) { + return true; + } else { + return false; + } + } else { + return true; + } +} + +/* 80668264-8066833C 000604 00D8+00 1/1 0/0 0/0 .text daDo_other_bg_check2__FP8do_classP4cXyz */ +static BOOL daDo_other_bg_check2(do_class* i_this, cXyz* i_pos) { + fopAc_ac_c* _this = static_cast(i_this); + cXyz dog_pos; + cXyz pos; + dBgS_LinChk lin_chk; + + pos = *i_pos; + pos.y += 30.0f; + + dog_pos = _this->current.pos; + dog_pos.y += 30.0f; + + lin_chk.Set(&dog_pos, &pos, _this); + if (dComIfG_Bgsp().LineCross(&lin_chk)) { + return true; + } else { + return false; + } +} + +/* 8066F2E4-8066F2F8 000074 0014+00 1/2 0/0 0/0 .bss target_info */ +static fopAc_ac_c* target_info[5]; + +/* 8066F2F8-8066F2FC 000088 0004+00 1/2 0/0 0/0 .bss target_info_count */ +static int target_info_count; + +/* 8066F2FC-8066F310 00008C 0014+00 0/1 0/0 0/0 .bss target_bgc */ +static BOOL target_bgc[5]; + +/* 8066833C-806683C0 0006DC 0084+00 1/1 0/0 0/0 .text s_w_sub__FPvPv */ +static void* s_w_sub(void* i_proc, void* i_this) { + if (fopAcM_IsActor(i_proc) && + (fopAcM_GetName(i_proc) == PROC_OBJ_FOOD || fopAcM_GetName(i_proc) == PROC_OBJ_KANBAN2) && + fopAcM_checkCarryNow(static_cast(i_proc)) && target_info_count < 5) + { + target_info[target_info_count] = static_cast(i_proc); + target_info_count++; + } + return NULL; +} + +/* 806683C0-8066858C 000760 01CC+00 1/1 0/0 0/0 .text search_food__FP8do_class */ +static u32 search_food(do_class* i_this) { + target_info_count = 0; + + for (int i = 0; i < 5; i++) { + target_info[i] = NULL; + target_bgc[i] = false; + } + + fpcM_Search(s_w_sub, i_this); + f32 pos_check = 200.0f; + + if (target_info_count != 0) { + fopAc_ac_c* actor; + int i = 0; + while (i < target_info_count) { + actor = target_info[i]; + cXyz delta; + delta.x = actor->current.pos.x - i_this->eyePos.x; + delta.y = actor->current.pos.y + 50.0f - i_this->eyePos.y; + delta.z = actor->current.pos.z - i_this->eyePos.z; + f32 dist_xz = JMAFastSqrt(delta.x * delta.x + delta.z * delta.z); + + if (dist_xz < pos_check) { + if (target_bgc[i] || daDo_other_bg_check(i_this, actor)) { + target_bgc[i] = true; + } else { + return fopAcM_GetID(actor); + } + } + + i++; + if (i == target_info_count) { + i = 0; + pos_check += 100.0f; + if (pos_check > i_this->mScale.z * 240.0f) { + return -1; + } + } + } + } else { + return -1; + } + return -1; +} + +/* 8066858C-806685EC 00092C 0060+00 1/1 0/0 0/0 .text food_check__FP8do_class */ +static void food_check(do_class* i_this) { + i_this->mFoodActorID = search_food(i_this); + + if (fopAcM_SearchByID(i_this->mFoodActorID)) { + i_this->mAction = ACT_FOOD; + i_this->mMode = 0; + } +} + +/* 806685EC-80668624 00098C 0038+00 1/1 0/0 0/0 .text do_carry_check__FP8do_class */ +static BOOL do_carry_check(do_class* i_this) { + if (i_this->mAction != ACT_CARRY && fopAcM_checkCarryNow(i_this)) { + i_this->mAction = ACT_CARRY; + i_this->mMode = 0; + return true; + } + + return false; +} + +/* 80668624-80668754 0009C4 0130+00 1/1 0/0 0/0 .text depth_check__FP8do_class4cXyzf */ +static BOOL depth_check(do_class* i_this, cXyz i_pos, f32 param_2) { + dBgS_GndChk gnd_chk; + Vec pos; + f32 f_gnd_chk; + f32 f_gnd_chk_spl; + + pos.x = i_pos.x; + pos.y = i_pos.y + 200.0f; + pos.z = i_pos.z; + + gnd_chk.SetPos(&pos); + f_gnd_chk = dComIfG_Bgsp().GroundCross(&gnd_chk); + + dBgS_ObjGndChk_Spl gnd_chk_spl; + gnd_chk_spl.SetPos(&pos); + f_gnd_chk_spl = dComIfG_Bgsp().GroundCross(&gnd_chk_spl); + + if (f_gnd_chk_spl - f_gnd_chk > 2.0f * param_2 * 0.8f * i_this->mScale.z) { + return 1; + } else { + return 0; + } +} + +/* 80668754-8066886C 000AF4 0118+00 1/1 0/0 0/0 .text water_check__FP8do_class */ +static bool water_check(do_class* i_this) { + dBgS_GndChk gnd_chk; + Vec pos; + + pos = i_this->current.pos; + pos.y += 200.0f; + + gnd_chk.SetPos(&pos); + f32 f_gnd_chk = dComIfG_Bgsp().GroundCross(&gnd_chk); + + dBgS_ObjGndChk_Spl gnd_chk_spl; + gnd_chk_spl.SetPos(&pos); + i_this->mWaterY = dComIfG_Bgsp().GroundCross(&gnd_chk_spl); + + if (i_this->mWaterY - f_gnd_chk > 8.0f * i_this->mScale.z) { + return true; + } else { + return false; + } +} + +/* 8066886C-80668A30 000C0C 01C4+00 4/4 0/0 0/0 .text dansa_check__FP8do_class4cXyzf */ +static int dansa_check(do_class* i_this, cXyz i_pos, f32 param_2) { + fopAc_ac_c* _this = static_cast(i_this); + i_pos.y += 25.0f; + dBgS_GndChk gnd_chk; + + Vec pos; + pos.x = i_pos.x; + pos.y = i_pos.y + 25.0f; + pos.z = i_pos.z; + + gnd_chk.SetPos(&pos); + f32 f_gnd_chk = dComIfG_Bgsp().GroundCross(&gnd_chk); + + if (i_this->current.pos.y - f_gnd_chk > param_2) { + return 1; + } else { + dBgS_LinChk lin_chk; + cXyz pos2; + + pos2 = _this->current.pos; + pos2.y += 60.0f; + + lin_chk.Set(&pos2, &i_pos, _this); + + if (dComIfG_Bgsp().LineCross(&lin_chk) != 0) { + return -1; + } else if (depth_check(i_this, i_pos, 5.0f) && l_HIO.mSwimming == 0) { + return -100; + } else { + return 0; + } + } +} + +/* 80668A30-80668B18 000DD0 00E8+00 3/3 0/0 0/0 .text dansa_check2__FP8do_classf */ +static BOOL dansa_check2(do_class* i_this, f32 param_1) { + cXyz pos, pos2; + + cMtx_YrotS(*calc_mtx, i_this->current.angle.y); + pos.x = 0.0f; + pos.y = 70.0f; + pos.z = 0.8f * param_1 * i_this->mScale.z + + 0.8f * i_this->speedF * i_this->mScale.z * 9.0f; + + MtxPosition(&pos, &pos2); + pos2 += i_this->current.pos; + return dansa_check(i_this, pos2, 100.0f) != 0 ? TRUE : FALSE; +} + +/* 80668B18-80668BA0 000EB8 0088+00 4/4 0/0 0/0 .text move_dansa_check__FP8do_classf */ +static BOOL move_dansa_check(do_class* i_this, f32 i_speed) { + if (dansa_check2(i_this, 130.0f)) { + i_this->mAction = ACT_WAIT_1; + + if (i_speed > 15.0f) { + i_this->mMode = 10; + } else { + i_this->mMode = 0; + } + + return true; + } else { + return false; + } +} + +/* 80668BA0-80668D5C 000F40 01BC+00 5/5 0/0 0/0 .text area_check__FP8do_class */ +static void area_check(do_class* i_this) { + cXyz pos_delta = i_this->home.pos - i_this->current.pos; + + if (i_this->mParam2 != 0xff) { + if (pos_delta.abs() > i_this->mParam2 * 100.0f * 2.0f) { + i_this->mAction = ACT_WALK; + i_this->mMode = -1; + i_this->mTimer[2] = cM_rndF(100.0f) + 100.0f; + } + } +} + +/* 80668D5C-80669050 0010FC 02F4+00 2/1 0/0 0/0 .text do_stay__FP8do_class */ +static void do_stay(do_class* i_this) { + switch (i_this->mMode) { + case 0: + if (i_this->mParam0 == 0) { + anm_init(i_this, ANM_DOWN_WT, 15.0f, 2, 1.0f); + i_this->mMode++; + i_this->mTimer[0] = 10; + } else { + i_this->mAction = ACT_WALK; + i_this->mMode = 0; + return; + } + // fallthrough + + case 1: + if (i_this->mTimer[0] == 0 && i_this->mDistFromPlayer < l_HIO.mPlayerRecognitionDist) { + i_this->mMode++; + i_this->mTimer[0] = cM_rndF(50.0f) + 20.0f; + } + break; + + case 2: + i_this->field_0x616 = 1; + i_this->mHeadTilt = -6300; + i_this->mTailWagTarget = 1000.0f; + if (i_this->mTimer[0] == 0) { + anm_init(i_this, ANM_DOWN, 5.0f, 0, 1.0f); + i_this->mMode++; + } + break; + + case 3: + i_this->field_0x616 = 1; + i_this->mTailWagTarget = 2000.0f; + + if (i_this->mpMorf->isStop()) { + i_this->mAction = ACT_WALK_RUN; + i_this->mMode = 0; + } + break; + + case 10: + anm_init(i_this, ANM_DOWN_WT, 15.0f, 2, 1.0f); + i_this->mMode++; + // fallthrough + + case 11: + i_this->field_0x616 = 1; + i_this->mHeadTilt = -6300; + i_this->mTailWagTarget = 1000.0f; + + if (i_this->field_0x658 > 30.0f) { + i_this->mMode++; + i_this->mTimer[0] = cM_rndF(10.0f) + 10.0f; + } + + if (i_this->mDistFromPlayer > 100.0f + l_HIO.mPlayerRecognitionDist) { + i_this->field_0x5f4 = 0; + i_this->mMode = 0; + } + break; + + case 12: + i_this->field_0x616 = 1; + i_this->mHeadTilt = -6300; + i_this->mTailWagTarget = 1500.0f; + + if (i_this->field_0x658 > 30.0f) { + if (i_this->mTimer[0] == 0) { + anm_init(i_this, ANM_DOWN, 3.0f, 0, 1.0f); + i_this->mMode = 13; + } + } else { + i_this->mMode = 11; + } + break; + + case 13: + i_this->field_0x616 = 1; + i_this->mTailWagTarget = 1500.0f; + + if (i_this->mpMorf->isStop()) { + i_this->mAction = ACT_WAIT_1; + i_this->mMode = 0; + } + break; + } + + cLib_addCalc0(&i_this->speedF, 1.0f, 1.0f); +} + +/* 80669050-8066973C 0013F0 06EC+00 2/1 0/0 0/0 .text do_walk__FP8do_class */ +static void do_walk(do_class* i_this) { + cXyz local_5c; + s16 angle_diff; + i_this->mTailWagTarget = 1000.0f; + + switch (i_this->mMode) { + case 11: + i_this->mTargetPos = i_this->home.pos; + if (i_this->speedF >= l_HIO.mRunSpeed) { + i_this->mAnmSpeed = 4.0f; + } else { + i_this->mAnmSpeed = 1.7f; + } + + i_this->mTargetAnmSpeed = 1.7f; + anm_init(i_this, ANM_WALK, 3.0f, 2, i_this->mAnmSpeed); + i_this->mMode = 3; + break; + + case -1: + if (i_this->field_0x5f4 == 8) { + anm_init(i_this, ANM_SIT, 5.0f, 0, 1.0f); + } else { + anm_init(i_this, ANM_DOWN, 5.0f, 0, 1.0f); + } + + i_this->mMode++; + break; + + case 0: + if (i_this->mpMorf->isStop()) { + i_this->mMode++; + } + break; + + case 1: + local_5c.x = 0.0f; + local_5c.y = 20.0f; + + for (int i = 0; i < 100; i++) { + cMtx_YrotS(*calc_mtx, cM_rndF(65536.0f)); + + local_5c.z = cM_rndF(100.0f * i_this->mParam2); + MtxPosition(&local_5c, &i_this->mTargetPos); + + i_this->mTargetPos += i_this->home.pos; + + if (dansa_check(i_this, i_this->mTargetPos, 100.0f) == 0) { + local_5c = i_this->mTargetPos - i_this->current.pos; + + if (local_5c.abs() > 300.0f) + break; + } + } + + i_this->mAnmSpeed = i_this->mTargetAnmSpeed = 1.3f + cM_rndF(0.6f); + anm_init(i_this, ANM_WALK, 5.0f, 2, i_this->mAnmSpeed); + i_this->mMode++; + + case 2: + local_5c = i_this->mTargetPos - i_this->current.pos; + + cLib_addCalcAngleS2(&i_this->current.angle.y, (s16)cM_atan2s(local_5c.x, local_5c.z), 0x10, + 0x100); + cLib_addCalc2(&i_this->speedF, i_this->mAnmSpeed * l_HIO.mWalkSpeed, 1.0f, + l_HIO.mWalkSpeed * 0.2f); + + if (local_5c.abs() < 150.0f) { + if (i_this->mParam0 == 0) { + i_this->mAction = ACT_STAY; + i_this->mMode = 0; + } else { + anm_init(i_this, ANM_WAIT, 5.0f, 2, 1.0f); + i_this->mTimer[0] = cM_rndF(50.0f) + 20.0f; + i_this->mTargetAnmSpeed = 1.0f; + i_this->mMode++; + } + } + + break; + + case 3: + cLib_addCalc0(&i_this->speedF, 1.0f, 1.0f); + + if (i_this->mTimer[0] == 0) { + i_this->mMode = 2; + } + + break; + + case 9: + cLib_addCalc0(&i_this->speedF, 1.0f, 1.0f); + cLib_addCalcAngleS2(&i_this->current.angle.y, i_this->mTargetAngleY, 4, 0x400); + + i_this->field_0x616 = 1; + i_this->mTailWagTarget = 2000.0f; + + angle_diff = i_this->current.angle.y - i_this->mTargetAngleY; + + if (angle_diff < 0) { + angle_diff *= -1; + } + + if (angle_diff < 0x800) { + i_this->mMode++; + anm_init(i_this, ANM_WAIT, 5.0f, 2, 1.0f); + i_this->mTargetAnmSpeed = 1.0f; + i_this->mTimer[0] = cM_rndF(10.0f) + 10.0f; + } + + break; + + case 10: + i_this->field_0x616 = 1; + i_this->mTailWagTarget = 3000.0f; + if (i_this->mTimer[0] == 0) { + i_this->mAction = ACT_WALK_RUN; + i_this->mMode = 0; + return; + } + break; + } + + cLib_addCalc2(&i_this->mAnmSpeed, i_this->mTargetAnmSpeed, 1.0f, 0.05f); + i_this->mpMorf->setPlaySpeed(i_this->mAnmSpeed); + + if (i_this->mTimer[2] == 0 && i_this->mMode < 10 && + i_this->mDistFromPlayer < l_HIO.mPlayerRecognitionDist) + { + anm_init(i_this, ANM_STEP_2, 2.0f, 2, 3.0f); + i_this->mMode = 10; + } + + move_dansa_check(i_this, i_this->speedF); +} + +/* 8066973C-806698D0 001ADC 0194+00 1/1 0/0 0/0 .text do_walk_run__FP8do_class */ +static void do_walk_run(do_class* i_this) { + i_this->field_0x616 = 1; + i_this->mTailWagTarget = 3000.0f; + + switch (i_this->mMode) { + case 0: + i_this->mAnmSpeed = 0.25f; + anm_init(i_this, 22, 10.0f, 2, i_this->mAnmSpeed); + i_this->mMode++; + // fallthrough + + case 1: + cLib_addCalc2(&i_this->mAnmSpeed, 2.0f, 1.0f, 0.05f); + i_this->mpMorf->setPlaySpeed(i_this->mAnmSpeed); + + if (i_this->mAnmSpeed >= 2.0f) { + i_this->mAction = ACT_RUN; + i_this->mMode = 0; + i_this->mSound.startSound(Z2SE_DOG_BARK, 0, -1); + } + // fallthrough + + default: + cLib_addCalc2(&i_this->speedF, i_this->mAnmSpeed * l_HIO.mWalkSpeed, + 1.0f, 0.2f * l_HIO.mWalkSpeed); + cLib_addCalcAngleS2(&i_this->current.angle.y, i_this->mTargetAngleY, 8, 0x400); + + if (i_this->mDistFromPlayer < 160.0f * i_this->mScale.z) { + if (l_HIO.mWaitType != 0) { + i_this->mAction = ACT_WAIT_2; + } else { + i_this->mAction = ACT_WAIT_1; + } + i_this->mMode = 0; + } + + area_check(i_this); + move_dansa_check(i_this, i_this->speedF); + break; + } +} + +/* 806698D0-80669A1C 001C70 014C+00 1/1 0/0 0/0 .text do_run__FP8do_class */ +static void do_run(do_class* i_this) { + i_this->field_0x616 = 1; + i_this->mTailWagTarget = 4000.0f; + + switch (i_this->mMode) { + case 0: + i_this->mAnmSpeed = 1.0f; + i_this->mTargetAnmSpeed = cM_rndF(0.1f) + 1.5f; + anm_init(i_this, 14, 2.0f, 2, 1.2f * i_this->mAnmSpeed); + i_this->mMode++; + // fallthrough + + case 1: + cLib_addCalc2(&i_this->mAnmSpeed, i_this->mTargetAnmSpeed, 1.0f, 0.02f); + i_this->mpMorf->setPlaySpeed(i_this->mAnmSpeed); + + if (i_this->mDistFromPlayer < 320.0f * i_this->mScale.z) { + i_this->mAction = ACT_RUN_WALK; + i_this->mMode = 0; + } + // fallthrough + + default: + cLib_addCalc2(&i_this->speedF, i_this->mAnmSpeed * l_HIO.mRunSpeed * 1.4f, + 1.0f, 0.2f * l_HIO.mRunSpeed); + cLib_addCalcAngleS2(&i_this->current.angle.y, i_this->mTargetAngleY, 8, 0x800); + area_check(i_this); + move_dansa_check(i_this, i_this->speedF); + break; + } +} + +/* 80669A1C-80669B80 001DBC 0164+00 1/1 0/0 0/0 .text do_run_walk__FP8do_class */ +static void do_run_walk(do_class* i_this) { + i_this->field_0x616 = 1; + i_this->mTailWagTarget = 3000.0f; + + switch (i_this->mMode) { + case 0: + i_this->mAnmSpeed = 4.0f; + anm_init(i_this, 22, 3.0f, 2, i_this->mAnmSpeed); + i_this->mMode++; + // fallthrough + + case 1: + cLib_addCalc2(&i_this->mAnmSpeed, 1.5f, 1.0f, 0.05f); + i_this->mpMorf->setPlaySpeed(i_this->mAnmSpeed); + // fallthrough + + default: + cLib_addCalc2(&i_this->speedF, i_this->mAnmSpeed * l_HIO.mWalkSpeed, 1.0f, 5.0f); + cLib_addCalcAngleS2(&i_this->current.angle.y, i_this->mTargetAngleY, 8, 0x400); + + if (i_this->mDistFromPlayer < 160.0f * i_this->mScale.z) { + if (l_HIO.mWaitType != 0) { + i_this->mAction = ACT_WAIT_2; + } else { + i_this->mAction = ACT_WAIT_1; + } + i_this->mMode = 0; + } else { + if (i_this->mDistFromPlayer > 360.0f * i_this->mScale.z) { + i_this->mAction = ACT_RUN; + i_this->mMode = 0; + } + } + + area_check(i_this); + move_dansa_check(i_this, i_this->speedF); + } +} + +/* 80669B80-8066A1C4 001F20 0644+00 2/1 0/0 0/0 .text do_wait_1__FP8do_class */ +static void do_wait_1(do_class* i_this) { + fopAc_ac_c* player = dComIfGp_getPlayer(0); + i_this->field_0x616 = 1; + i_this->mTailWagTarget = 2000.0f; + + s16 angle_diff = i_this->current.angle.y - i_this->mTargetAngleY; + + if (angle_diff < 0) { + angle_diff *= -1; + } + + s16 angle_check = 0x3000; + if ((i_this->mCounter & 0x7fU) == 0) { + angle_check = 0x1000; + } + + switch (i_this->mMode) { + case 0: + if (i_this->mDistFromPlayer > i_this->mScale.z * 320.0f) { + anm_init(i_this, ANM_JOYFUL, 5.0f, 2, cM_rndFX(0.1f) + 0.6f); + i_this->mMode = -1; + } else { + anm_init(i_this, ANM_WAIT, 10.0f, 2, 1.0f); + i_this->mMode++; + } + // fallthrough + + case -1: + case 1: +case1: + if (angle_diff > angle_check) { + anm_init(i_this, ANM_STEP_2, 2.0f, 2, 3.0f); + i_this->mMode = 2; + } else if (i_this->field_0x658 < 75.0f) { + i_this->mMode = 3; + i_this->mTimer[0] = cM_rndF(10.0f) + 10.0f; + } else { + if (i_this->mDistFromPlayer < i_this->mScale.z * 96.0f) { + cXyz local_68; + local_68.x = 0.0f; + local_68.y = 20.0f; + + for (int i = 0; i < 20; i++) { + if (i < 10) { + cMtx_YrotS(*calc_mtx, i_this->mTargetAngleY + (s16)cM_rndFX(5000.0f)); + } else { + cMtx_YrotS(*calc_mtx, cM_rndF(65536.0f)); + } + + local_68.z = -176.0f * i_this->mScale.z; + + MtxPosition(&local_68, &i_this->mTargetPos); + i_this->mTargetPos += player->current.pos; + + if (cM_rndF(1.0f) < 0.2f) + break; + + if (dansa_check(i_this, i_this->mTargetPos, 100.0f) == 0) + break; + + i_this->mLookPos = i_this->mTargetPos; + i_this->mLookTimer = 20.0f + cM_rndF(10.0f); + } + + i_this->mMode = 5; + i_this->mRandomTargetAngleY = cM_rndFX(10000.0f); + + anm_init(i_this, ANM_WALK, 2.0f, 2, -3.0f); + i_this->mTimer[0] = cM_rndF(10.0f) + 15.0f; + } else { + if (i_this->mMode != 6 && i_this->mDistFromPlayer < i_this->mScale.z * 120.0f) + { + anm_init(i_this, ANM_JOYFUL, 3.0f, 2, cM_rndFX(0.1f) + 1.0f); + i_this->mMode = 6; + } + } + } + break; + + case 2: + cLib_addCalcAngleS2(&i_this->current.angle.y, i_this->mTargetAngleY, 4, 0x400); + + if (angle_diff < 0x800) { + i_this->mMode = 0; + } + + break; + + case 3: + if (i_this->field_0x658 < 75.0f) { + if (i_this->mTimer[0] == 0) { + if (i_this->field_0x658 < 30.0f) { + i_this->mAction = ACT_STAY; + i_this->mMode = 10; + } else { + i_this->mAction = ACT_SIT; + i_this->mMode = 0; + } + } + } else { + i_this->mMode = 1; + } + break; + + case 5: + cLib_addCalcAngleS2(&i_this->current.angle.y, + i_this->mTargetAngleY + i_this->mRandomAngleY, 4, 0x800); + cLib_addCalcAngleS2(&i_this->mRandomAngleY, i_this->mRandomTargetAngleY, 4, 0x1000); + cLib_addCalc2(&i_this->current.pos.x, i_this->mTargetPos.x, 0.2f, 3.5f); + cLib_addCalc2(&i_this->current.pos.z, i_this->mTargetPos.z, 0.2f, 3.5f); + + if (i_this->mTimer[0] == 0) { + i_this->mMode = 0; + } + break; + + case 6: + i_this->mTailWagTarget = 4000.0f; + + if (i_this->mDistFromPlayer > i_this->mScale.z * 176.0f) { + i_this->mMode = 0; + } + goto case1; + + case 10: + i_this->mAnmSpeed = 5.0f; + anm_init(i_this, ANM_WALK, 2.0f, 2, i_this->mAnmSpeed); + + i_this->mMode++; + // fallthrough + + case 11: + cLib_addCalc2(&i_this->mAnmSpeed, 2.0f, 1.0f, 0.2f); + i_this->mpMorf->setPlaySpeed(i_this->mAnmSpeed); + + if (i_this->mAnmSpeed <= 2.2f) { + i_this->mMode = 0; + } + + break; + } + + cLib_addCalc0(&i_this->speedF, 1.0f, 1.0f); + + if (i_this->mDistFromPlayer > i_this->mScale.z * 240.0f && !dansa_check2(i_this, 130.0f) && + i_this->mMode < 10) + { + i_this->mAction = ACT_WALK_RUN; + i_this->mAnmSpeed = 1.5f; + anm_init(i_this, ANM_WALK, 5.0f, 2, i_this->mAnmSpeed); + i_this->mMode = 1; + } + + if (daPy_getLinkPlayerActorClass()->checkCanoeRide() && i_this->mDistFromPlayer < 1000.0f) { + i_this->mAction = ACT_HELP; + i_this->mMode = 0; + } + + if (i_this->mParam0 == 2) { + f32 distance = i_this->mDistFromPlayer * 0.0215f; + + if (distance > 127.0f) { + distance = 127.0f; + } + + i_this->mSound.startLevelSound(Z2SE_DOG_V_CALL_HELP, (u8)distance, -1); + } +} + +/* 8066A1C4-8066A3D0 002564 020C+00 1/1 0/0 0/0 .text do_wait_2__FP8do_class */ +static void do_wait_2(do_class* i_this) { + fopAc_ac_c* player = dComIfGp_getPlayer(0); + + i_this->field_0x616 = 1; + i_this->mTailWagTarget = 4000.0f; + + switch (i_this->mMode) { + case 0: + i_this->mMode++; + // fallthrough + + case 1: + if (i_this->mTimer[0] == 0) { + i_this->mTimer[0] = cM_rndF(20.0f) + 10.0f; + i_this->mRandomTargetAngleY = cM_rndFX(15000.0f); + + if (cM_rndF(1.0f) < 0.5f) { + i_this->mAnmSpeed = cM_rndF(0.2f) + 2.0f; + } else { + i_this->mAnmSpeed = -(cM_rndF(0.2f) + 2.0f); + } + + anm_init(i_this, ANM_STEP, 3.0f, 2, i_this->mAnmSpeed); + cMtx_YrotS(*calc_mtx, player->shape_angle.y); + + cXyz local_38; + + local_38.x = cM_rndFX(100.0f); + local_38.y = 0.0f; + local_38.z = cM_rndF(50.0f) + 120.0f; + + MtxPosition(&local_38, &i_this->mTargetPos); + i_this->mTargetPos += player->current.pos; + } + + break; + } + + cLib_addCalc2(&i_this->current.pos.x, i_this->mTargetPos.x, 0.2f, 2.0f); + cLib_addCalc2(&i_this->current.pos.z, i_this->mTargetPos.z, 0.2f, 2.0f); + cLib_addCalc0(&i_this->speedF, 1.0f, 2.0f); + cLib_addCalcAngleS2(&i_this->current.angle.y, i_this->mTargetAngleY + i_this->mRandomAngleY, + 4, 0x800); + cLib_addCalcAngleS2(&i_this->mRandomAngleY, i_this->mRandomTargetAngleY, 4, 0x1000); + + if (i_this->mDistFromPlayer > 240.0f * i_this->mScale.z) { + i_this->mAction = ACT_RUN; + i_this->mMode = 0; + } + + area_check(i_this); +} + +/* 8066A3D0-8066A5DC 002770 020C+00 1/1 0/0 0/0 .text do_sit__FP8do_class */ +static void do_sit(do_class* i_this) { + i_this->field_0x616 = 1; + i_this->mTailWagTarget = 1000.0f; + + switch (i_this->mMode) { + case 0: + anm_init(i_this, ANM_SIT_WAIT, 10.0f, 2, 1.0f); + i_this->mMode++; + // fallthrough + + case 1: + if (i_this->field_0x658 > 75.0f) { + i_this->mMode = 3; + i_this->mTimer[0] = cM_rndF(10.0f) + 10.0f; + } else { + if (i_this->field_0x658 < 30.0f) { + i_this->mMode = 2; + i_this->mTimer[0] = cM_rndF(10.0f) + 10.0f; + } + } + break; + + case 2: + if (i_this->field_0x658 < 30.0f) { + if (i_this->mTimer[0] == 0) { + i_this->mAction = ACT_STAY; + i_this->mMode = 10; + } + } else { + i_this->mMode = 1; + } + break; + + case 3: + if (i_this->field_0x658 > 75.0f) { + if (i_this->mTimer[0] == 0) { + anm_init(i_this, ANM_SIT, 3.0f, 0, 1.0f); + i_this->mMode++; + } + } else { + i_this->mMode = 1; + } + + break; + + case 4: + if (i_this->mpMorf->isStop()) { + i_this->mAction = ACT_WAIT_1; + i_this->mMode = 0; + } + break; + } + + cLib_addCalc0(&i_this->speedF, 1.0f, 2.0f); + + if (i_this->mDistFromPlayer > 400.0f * i_this->mScale.z) { + i_this->mAction = ACT_STAY; + i_this->field_0x5f4 = 8; + i_this->mMode = 0; + } + + area_check(i_this); +} + +/* 8066A5DC-8066A80C 00297C 0230+00 1/1 0/0 0/0 .text hang_set__FP8do_class */ +static s16 hang_set(do_class* i_this) { + fopAc_ac_c* _this = static_cast(i_this); + dBgS_LinChk lin_chk; + cXyz vec1, vec2, vec3[2]; + vec1 = _this->old.pos - _this->current.pos; + cMtx_YrotS(*calc_mtx, cM_atan2s(vec1.x, vec1.z)); + + vec1.x = 0.0f; + vec1.y = 0.0f; + vec1.z = -100.0f; + MtxPosition(&vec1, &vec2); + vec2 += _this->current.pos; + vec2.y = _this->old.pos.y - 5.0f; + + vec1.x = 10.0f; + vec1.y = 0.0f; + vec1.z = 250.0f; + + for (int i = 0; i < 2; i++) { + MtxPosition(&vec1, &vec3[i]); + vec1.x *= -1.0f; + vec3[i] += vec2; + lin_chk.Set(&vec2, &vec3[i], _this); + if (dComIfG_Bgsp().LineCross(&lin_chk)) { + vec3[i] = lin_chk.i_GetCross(); + } else { + return 0xDCF; + } + } + + i_this->mHangPos = vec3[0] + (vec3[1] - vec3[0]) * 0.5f; + i_this->mHangPos.y = _this->old.pos.y; + + vec1 = vec3[1] - vec3[0]; + return cM_atan2s(vec1.x, vec1.z) + 0x4000; +} + +/* 8066A80C-8066AB78 002BAC 036C+00 1/1 0/0 0/0 .text do_hang__FP8do_class */ +static void do_hang(do_class* i_this) { + i_this->mTailWagTarget = 3000.0f; + i_this->field_0x616 = 2; + cXyz vec1, vec2; + + switch (i_this->mMode) { + case 0: + anm_init(i_this, ANM_CLIFF_WT, 3.0f, 2, 1.0f); + i_this->mMode++; + i_this->speedF = 0.0f; + i_this->mHangSpeed = 0.0f; + i_this->mTimer[0] = cM_rndF(30.0f) + 30.0f; + // fallthrough + + case 1: + cLib_addCalcAngleS2(&i_this->current.angle.y, i_this->mHangAngleY, 1, 0x1000); + + if (i_this->mTimer[0] == 0) { + if (cM_rndF(1.0f) < 0.5f) { + i_this->speed.y = 0.0f; + i_this->mMode = 5; + i_this->mTimer[0] = 3; + anm_init(i_this, ANM_RUN, 5.0f, 2, 3.0f); + } else { + anm_init(i_this, ANM_CLIFF, 2.0f, 0, 1.0f); + i_this->mMode = 2; + } + } + + cMtx_YrotS(*calc_mtx, i_this->mHangAngleY); + vec1.x = 0.0f; + vec1.y = 0.0f; + vec1.z = i_this->mScale.z * 28.0f; + MtxPosition(&vec1, &vec2); + cLib_addCalc2(&i_this->current.pos.x, i_this->mHangPos.x + vec2.x, 1.0f, + i_this->mHangSpeed); + cLib_addCalc2(&i_this->current.pos.y, i_this->mHangPos.y + vec2.y, 1.0f, + i_this->mHangSpeed); + cLib_addCalc2(&i_this->current.pos.z, i_this->mHangPos.z + vec2.z, 1.0f, + i_this->mHangSpeed); + cLib_addCalc2(&i_this->mHangSpeed, 100.0f, 1.0f, 20.0f); + break; + + case 2: + if (i_this->mpMorf->isStop()) { + i_this->mAction = ACT_STAY; + i_this->mMode = 13; + } + break; + + case 5: + cMtx_YrotS(*calc_mtx, i_this->mHangAngleY); + vec1.x = 0.0f; + vec1.y = 0.0f; + vec1.z = i_this->mScale.z * -60.0f; + MtxPosition(&vec1, &vec2); + cLib_addCalc2(&i_this->current.pos.x, i_this->mHangPos.x + vec2.x, 1.0f, 15.0f); + cLib_addCalc2(&i_this->current.pos.z, i_this->mHangPos.z + vec2.z, 1.0f, 15.0f); + i_this->current.pos.y += i_this->speed.y; + i_this->speed.y += i_this->gravity; + + if (i_this->mTimer[0] == 0) { + i_this->mBgS_Acch.CrrPos(dComIfG_Bgsp()); + if (i_this->mBgS_Acch.i_ChkGroundHit()) { + i_this->current.angle.x = 0; + anm_init(i_this, ANM_DOWN, 2.0f, 0, 2.0f); + i_this->mMode = 6; + } + } + break; + + case 6: + if (i_this->mpMorf->isStop()) { + i_this->mAction = ACT_WAIT_1; + i_this->mMode = 0; + } + break; + } +} + +/* 8066AB78-8066B650 002F18 0AD8+00 2/1 0/0 0/0 .text do_food__FP8do_class */ +static void do_food(do_class* i_this) { + fopAc_ac_c* food = fopAcM_SearchByID(i_this->mFoodActorID); + fopAc_ac_c* player = dComIfGp_getPlayer(0); + cXyz vec; + s16 angle_step; + + BOOL end = false; + if (food == NULL) { + end = true; + } + + if (i_this->mBgS_Acch.ChkWallHit()) { + i_this->mFoodEndTimer += 2; + if (i_this->mFoodEndTimer >= 60) { + end = true; + } + } else if (i_this->mFoodEndTimer != 0) { + i_this->mFoodEndTimer--; + } + + if (end) { + i_this->mAction = ACT_WAIT_1; + i_this->mMode = 0; + return; + } + + i_this->mTailWagTarget = 4000.0f; + + switch (i_this->mMode) { + case 0: + i_this->mMode++; + i_this->mTimer[1] = cM_rndF(10.0f) + 10.0f; + i_this->mTimer[0] = 0; + // fallthrough + + case 1: + i_this->speedF = 0.0f; + + if (i_this->mTimer[1] == 0) { + if (i_this->mTimer[0] == 0) { + if (cM_rndF(1.0f) < 0.5f) { + anm_init(i_this, ANM_JOYFUL, 3.0f, 2, 1.0f + cM_rndFX(0.1f)); + i_this->mMode = 2; + i_this->mTimer[0] = cM_rndF(20.0f) + 10.0f; + } else { + i_this->mTimer[0] = cM_rndF(20.0f) + 10.0f; + i_this->mRandomTargetAngleY = cM_rndFX(15000.0f); + i_this->mAnmSpeed = cM_rndF(0.2f) + 2.0f; + anm_init(i_this, ANM_STEP, 3.0f, 2, i_this->mAnmSpeed); + + cMtx_YrotS(*calc_mtx, player->shape_angle.y); + vec.x = cM_rndFX(100.0f); + vec.y = 0.0f; + vec.z = cM_rndF(50.0f) + 120.0f; + MtxPosition(&vec, &i_this->mTargetPos); + i_this->mTargetPos += player->current.pos; + } + } + + cLib_addCalc2(&i_this->current.pos.x, i_this->mTargetPos.x, 0.2f, 1.5f); + cLib_addCalc2(&i_this->current.pos.z, i_this->mTargetPos.z, 0.2f, 1.5f); + cLib_addCalcAngleS2(&i_this->current.angle.y, + i_this->mTargetAngleY + i_this->mRandomAngleY, 4, 0x800); + cLib_addCalcAngleS2(&i_this->mRandomAngleY, i_this->mRandomTargetAngleY, 4, 0x1000); + } + +case1and2: + i_this->field_0x616 = 1; + + if (fopAcM_CheckFoodStatus(food, fopAcM_FOOD_1)) { + i_this->mMode = 10; + i_this->mTimer[0] = cM_rndF(20.0f); + i_this->mTimer[2] = cM_rndF(50.0f) + 70.0f; + } else if (fopAcM_CheckFoodStatus(food, fopAcM_FOOD_0)) { + i_this->mAction = ACT_WAIT_1; + i_this->mMode = 0; + } else if (i_this->mDistFromPlayer > 240.0f * i_this->mScale.z) { + i_this->mAction = ACT_RUN; + i_this->mMode = 0; + } + break; + + case 2: + if (i_this->mTimer[0] == 0) { + i_this->mMode = 1; + } + goto case1and2; + + case 10: + if (i_this->mTimer[0] == 0) { + i_this->mAnmSpeed = 1.0f; + i_this->mTargetAnmSpeed = cM_rndF(0.1f) + 1.5f; + anm_init(i_this, ANM_RUN, 2.0f, 2, 1.2f * i_this->mAnmSpeed); + i_this->mMode++; + } else { + i_this->mLookPos = food->current.pos; + i_this->mLookTimer = 10; + break; + } + // fallthrough + + case 11: + i_this->mLookPos = food->current.pos; + i_this->mLookTimer = 10; + + cLib_addCalc2(&i_this->mAnmSpeed, i_this->mTargetAnmSpeed, 1.0f, 0.02f); + i_this->mpMorf->setPlaySpeed(i_this->mAnmSpeed); + cLib_addCalc2(&i_this->speedF, i_this->mAnmSpeed * l_HIO.mRunSpeed, 1.0f, + 0.2f * l_HIO.mRunSpeed); + + vec = food->current.pos - i_this->current.pos; + angle_step = 0x1000; + if (vec.abs() < 120.0f * i_this->mScale.z) { + angle_step = 0x2000; + cLib_addCalc2(&i_this->speedF, i_this->mAnmSpeed * l_HIO.mRunSpeed * 0.75f, 1.0f, + 0.2f * l_HIO.mRunSpeed * 1.5f); + } + cLib_addCalcAngleS2(&i_this->current.angle.y, cM_atan2s(vec.x, vec.z), 8, angle_step); + + if (fopAcM_CheckFoodStatus(food, fopAcM_FOOD_2) + || fopAcM_CheckFoodStatus(food, fopAcM_FOOD_3) + || fopAcM_CheckFoodStatus(food, fopAcM_FOOD_4)) + { + i_this->mMode = 25; + i_this->mTimer[0] = cM_rndF(20.0f) + 5.0f; + } else if (vec.abs() < 50.0f * i_this->mScale.z) { + bool get_item = false; + if (i_this->mDistFromPlayer > 400.0f + && !strcmp(dComIfGp_getStartStageName(), "F_SP116")) + { + if (fopAcM_GetRoomNo(i_this) == 4) { + if (i_this->current.pos.z < -1050.f) { + get_item = true; + } + } else if (fopAcM_GetRoomNo(i_this) == 2) { + vec.x = -4314.0f - i_this->current.pos.x; + vec.z = 728.0f - i_this->current.pos.z; + if (JMAFastSqrt(vec.x * vec.x + vec.z * vec.z) < 300.0f) { + get_item = true; + } + } + } + + if (get_item) { + int item_no; + if (dComIfGs_getLife() <= 4) { + item_no = HEART; + } else { + int rnd = cM_rndF(11.0f); + if (rnd <= 5) { + item_no = HEART; + } else if (rnd <= 9) { + item_no = GREEN_RUPEE; + } else { + item_no = BLUE_RUPEE; + } + } + + i_this->mItemActorID = + fopAcM_createItem(&i_this->eyePos, item_no, -1, -1, NULL, NULL, 0); + i_this->mMode = 25; + i_this->mTimer[0] = cM_rndF(10.0f) + 5.0f; + } else { + i_this->mMode = 20; + i_this->mFoodInMouth = 1; + i_this->mAnmSpeed = 4.0f; + anm_init(i_this, ANM_JOYFUL, 3.0f, 2, 0.3f); + } + } + break; + + case 20: + i_this->mLookPos = player->current.pos; + i_this->mLookTimer = 10; + cLib_addCalc2(&i_this->mAnmSpeed, 1.5f, 1.0f, 0.2f); + cLib_addCalc2(&i_this->speedF, i_this->mAnmSpeed * l_HIO.mWalkSpeed, 1.0f, 5.0f); + + if (i_this->mAnmSpeed <= 1.6f) { + i_this->mTargetAnmSpeed = cM_rndF(0.1f) + 1.5f; + anm_init(i_this, ANM_RUN, 2.0f, 2, 1.2f * i_this->mAnmSpeed); + i_this->mMode++; + } + + i_this->mFoodInMouth = 1; + break; + + case 21: + i_this->field_0x616 = 1; + cLib_addCalc2(&i_this->mAnmSpeed, i_this->mTargetAnmSpeed, 1.0f, 0.02f); + i_this->mpMorf->setPlaySpeed(i_this->mAnmSpeed); + cLib_addCalc2(&i_this->speedF, i_this->mAnmSpeed * l_HIO.mRunSpeed, 1.0f, + 0.2f * l_HIO.mRunSpeed); + cLib_addCalcAngleS2(&i_this->current.angle.y, i_this->mTargetAngleY, 8, 0x1000); + i_this->mFoodInMouth = 1; + + if (i_this->mDistFromPlayer < 120.0f * i_this->mScale.z) { + i_this->mAction = ACT_RUN_WALK; + i_this->mMode = 0; + food->speedF = 0.0f; + } + break; + + case 25: + if (i_this->mTimer[0] != 0) { + if (i_this->mTimer[0] == 1) { + i_this->mAnmSpeed = cM_rndFX(1.0f) + 3.0f; + anm_init(i_this, ANM_JOYFUL, 3.0f, 2, 0.3f); + } + } else { + i_this->mLookPos = player->current.pos; + i_this->mLookTimer = 10; + cLib_addCalc2(&i_this->mAnmSpeed, 1.5f, 1.0f, 0.1f); + cLib_addCalc2(&i_this->speedF, i_this->mAnmSpeed * l_HIO.mWalkSpeed, 1.0f, 5.0f); + + if (i_this->mAnmSpeed <= 1.6f) { + i_this->mAction = ACT_RUN; + i_this->mMode = 0; + } + } + break; + } +} + +/* 8066B650-8066B774 0039F0 0124+00 1/1 0/0 0/0 .text do_swim__FP8do_class */ +static void do_swim(do_class* i_this) { + cXyz pos; + i_this->field_0x616 = 1; + i_this->mTailWagTarget = 2000.0f; + + switch (i_this->mMode) { + case 0: + anm_init(i_this, 19, 5.0f, 2, cM_rndF(0.15f) + 1.3f); + i_this->mMode++; + break; + + case 1: + break; + } + + cLib_addCalc2(&i_this->speedF, l_HIO.mSwimSpeed, 1.0f, 0.5f * l_HIO.mSwimSpeed); + cLib_addCalcAngleS2(&i_this->current.angle.y, i_this->mTargetAngleY, 16, 0x100); + + i_this->speed.y = 0.0f; + i_this->gravity = 0.0f; + + cLib_addCalc2(&i_this->current.pos.y, i_this->mWaterY - 45.0f, 1.0f, 5.0f); + + pos = i_this->eyePos; + pos.y = i_this->mWaterY; + + fopAcM_effHamonSet(&i_this->mRippleKey, &pos, 0.7f, 0.1f); +} + +/* 8066B774-8066B7C0 003B14 004C+00 2/2 0/0 0/0 .text s_c_sub__FPvPv */ +static void* s_c_sub(void* param_0, void* param_1) { + if (fopAcM_IsActor(param_0) && fopAcM_GetName(param_0) == PROC_CANOE) { + return param_0; + } + return 0; +} + +/* 8066B7C0-8066BD3C 003B60 057C+00 1/1 0/0 0/0 .text do_help__FP8do_class */ +static void do_help(do_class* i_this) { + f32 target_speed = 0.0f; + i_this->field_0x616 = 1; + + switch (i_this->mMode) { + case 0: + anm_init(i_this, ANM_WALK, 3.0f, 2, 2.0f); + i_this->mMode++; + break; + + case 1: + target_speed = 5.0f; + cLib_addCalcAngleS2(&i_this->current.angle.y, i_this->mTargetAngleY, 2, 0x800); + if (dansa_check2(i_this, 50.0f)) { + anm_init(i_this, ANM_WAIT, 5.0f, 2, 1.0f); + i_this->mMode++; + } + break; + + case 2: + if (i_this->mDistFromPlayer < 800.0f) { + i_this->mTailWagTarget = 1000.0f; + } + if (i_this->mDistFromPlayer < 500.0f) { + i_this->mMode++; + anm_init(i_this, ANM_JOYFUL, 3.0f, 2, 1.0f); + } + break; + + case 3: + i_this->mTailWagTarget = 2000.0f; + if (i_this->mDistFromPlayer > 550.0f) { + anm_init(i_this, ANM_WAIT, 5.0f, 2, 1.0f); + i_this->mMode = 2; + } + + if (i_this->mTimer[2] == 0 && daPy_getLinkPlayerActorClass()->checkCanoeRide()) { + cXyz vec1, vec2, vec3; + daCanoe_c* canoe = (daCanoe_c*)fpcM_Search(s_c_sub, i_this); + if (canoe != NULL) { + vec3 = i_this->field_0x68c; + MTXCopy(canoe->getModelMtx(), *calc_mtx); + vec1.set(0.0f, 52.0f, 150.0f); + MtxPosition(&vec1, &i_this->field_0x68c); + i_this->mLookPos = i_this->field_0x68c; + i_this->mLookTimer = 20; + vec2 = i_this->field_0x68c - i_this->current.pos; + vec2.y = 0.0f; + if ((i_this->field_0x68c - vec3).abs() <= 5.0f && vec2.abs() < 230.0f) { + i_this->mParam0 = 0; + i_this->mAction = ACT_BOAT; + i_this->mMode = 0; + anm_init(i_this, ANM_DEFEND, 10.0f, 0, 1.0f); + i_this->mTimer[0] = 20; + } + } + i_this->mTargetAngleY = cM_atan2s(vec2.x, vec2.z); + } + + cLib_addCalcAngleS2(&i_this->current.angle.y, i_this->mTargetAngleY, 4, 0x400); + break; + } + + cLib_addCalc2(&i_this->speedF, target_speed, 1.0f, 2.0f); + + if (!daPy_getLinkPlayerActorClass()->checkCanoeRide() && i_this->mDistFromPlayer < 200.0f) { + i_this->mAction = ACT_WAIT_1; + i_this->mMode = 0; + } + + if (i_this->mParam0 == 2) { + f32 fvar2 = i_this->mDistFromPlayer * 0.0215f; + if (fvar2 > 127.0f) { + fvar2 = 127.0f; + } + i_this->mSound.startLevelSound(Z2SE_DOG_V_CALL_HELP, (u8)fvar2, -1); + } +} + +/* 8066BD3C-8066C894 0040DC 0B58+00 2/1 0/0 0/0 .text do_boat__FP8do_class */ +static s8 do_boat(do_class* i_this) { + fopAc_ac_c* _this = static_cast(i_this); + s8 ret = 1; + i_this->mCcDisableTimer = 10; + f32 fvar3; + + daCanoe_c* canoe = (daCanoe_c*)fpcM_Search(s_c_sub, i_this); + if (canoe == NULL) { + return 1; + } + + cXyz vec1, vec2; + s16 canoe_angle = canoe->shape_angle.y; + vec2 = i_this->field_0x68c; + MTXCopy(canoe->getModelMtx(), *calc_mtx); + vec1.set(0.0f, 52.0f, 150.0f); + MtxPosition(&vec1, &i_this->field_0x68c); + f32 fvar4 = (i_this->field_0x68c - vec2).abs(); + if (!daPy_getLinkPlayerActorClass()->checkCanoeRide() && (i_this->mCounter & 0x200) != 0) { + fvar4 = 5.0f; + } + s8 bvar2 = false; + + switch (i_this->mMode) { + case 0: + if (daDo_other_bg_check2(i_this, &i_this->field_0x68c)) { + i_this->mAction = ACT_HELP; + i_this->mMode = 0; + _this->speedF = 0.0f; + i_this->mTimer[2] = 50; + break; + } + + if (i_this->mTimer[0] == 2) { + anm_init(i_this, ANM_RUN, 2.0f, 0, 2.0f); + } + + if (i_this->mTimer[0] != 0) { + break; + } + + i_this->mMode++; + _this->speed.y = 30.0f; + _this->speedF = 0.0f; + i_this->mSound.startSound(Z2SE_DOG_V_JUMP, 0, -1); + i_this->mTimer[1] = 7; + // fallthrough + + case 1: + if (i_this->mTimer[1] != 0) { + ret = 0; + } + + vec1 = i_this->field_0x68c - _this->current.pos; + fvar3 = vec1.abs(); + cMtx_YrotS(*calc_mtx, cM_atan2s(vec1.x, vec1.z)); + vec1.x = 0.0f; + vec1.y = 0.0f; + vec1.z = fvar3 * 0.075f + 10.0f; + MtxPosition(&vec1, &i_this->field_0x698); + + cLib_addCalc2(&i_this->current.pos.x, i_this->field_0x68c.x, 1.0f, + fabsf(i_this->field_0x698.x) + 2.0f); + cLib_addCalc2(&i_this->current.pos.z, i_this->field_0x68c.z, 1.0f, + fabsf(i_this->field_0x698.z) + 2.0f); + + if (_this->speed.y <= -80.0f) { + _this->speed.y = -80.0f; + } + + if (_this->current.pos.y <= i_this->field_0x68c.y) { + _this->current.pos.y = i_this->field_0x68c.y; + _this->speed.y = 0.0f; + } + + if ((i_this->field_0x68c - _this->current.pos).abs() <= 5.0f) { + i_this->mMode = 2; + anm_init(i_this, ANM_STEP_2, 3.0f, 2, 3.0f); + } else { + break; + } + // fallthrough + + case 2: + ret = 0; + + i_this->field_0x616 = 1; + _this->speed.y = 0.0f; + _this->gravity = 0.0f; + _this->current.pos = i_this->field_0x68c; + cLib_addCalcAngleS2(&_this->current.angle.y, i_this->mTargetAngleY, 2, 0x800); + _this->current.angle.x = 2700; + + if (i_this->mAnmID == ANM_STEP_2) { + s16 angle = i_this->mTargetAngleY - _this->current.angle.y; + if (angle < 0x800 && angle > -0x800) { + anm_init(i_this, ANM_JOYFUL, 3.0f, 2, 1.0f); + } + } else if (i_this->mAnmID == ANM_JOYFUL && fvar4 > 3.0f) { + i_this->mMode = 3; + anm_init(i_this, ANM_STEP_2, 3.0f, 2, 4.0f); + } + break; + + case 3: + ret = 0; + + if (i_this->mTimer[0] == 0) { + i_this->mTimer[0] = cM_rndF(70.0f) + 50.0f; + cMtx_YrotS(*calc_mtx, _this->shape_angle.y); + vec1.x = cM_rndFX(2000.0f); + vec1.y = cM_rndF(50.0f) + 50.0f; + vec1.z = 2000.0f; + MtxPosition(&vec1, &i_this->mLookPos); + i_this->mLookPos += _this->current.pos; + } + + i_this->mLookTimer = 2; + _this->speed.y = 0.0f; + _this->gravity = 0.0f; + _this->current.pos = i_this->field_0x68c; + cLib_addCalcAngleS2(&_this->current.angle.y, canoe_angle, 2, 0x800); + _this->current.angle.x = -2700; + + if (i_this->mAnmID == ANM_STEP_2) { + s16 angle = canoe_angle - _this->current.angle.y; + if (angle < 0x800 && angle > -0x800) { + anm_init(i_this, ANM_WAIT, 3.0f, 2, 1.0f); + } + } else if (i_this->mAnmID == ANM_WAIT && fvar4 < 10.0f) { + bvar2 = 1; + if (fvar4 < 1.0f) { + i_this->mMode = 2; + anm_init(i_this, ANM_STEP_2, 3.0f, 2, 4.0f); + } + } + break; + + case 5: + anm_init(i_this, ANM_DEFEND, 10.0f, 0, 1.0f); + i_this->mTimer[0] = 20; + i_this->mMode++; + // fallthrough + + case 6: + ret = 0; + i_this->mLookPos = i_this->mTargetPos; + i_this->mLookTimer = 2; + _this->speed.y = 0.0f; + _this->gravity = 0.0f; + _this->current.pos = i_this->field_0x68c; + vec1 = i_this->mTargetPos - _this->current.pos; + cLib_addCalcAngleS2(&_this->current.angle.y, cM_atan2s(vec1.x, vec1.z), 2, 0x800); + + if (i_this->mTimer[0] == 2) { + anm_init(i_this, ANM_RUN, 2.0f, 0, 2.0f); + } + + if (i_this->mTimer[0] == 0) { + i_this->mMode++; + _this->speed.y = 30.0f; + _this->speedF = 30.0f; + _this->current.angle.x = 0; + i_this->mSound.startSound(Z2SE_DOG_V_JUMP, 0, -1); + } + break; + + case 7: + if (i_this->mBgS_Acch.i_ChkGroundHit()) { + i_this->mAction = ACT_HELP; + i_this->mMode = 0; + _this->speedF = 0.0f; + i_this->mTimer[2] = 100; + } + break; + } + + if (bvar2) { + i_this->field_0xc84 = _this->current.pos; + i_this->field_0xc84.y += 40.0f; + cMtx_YrotS(*calc_mtx, canoe->shape_angle.y); + vec1.x = 0.0f; + vec1.y = 0.0f; + vec1.z = 250.0f; + MtxPosition(&vec1, &i_this->field_0xc90); + i_this->field_0xc90 += i_this->field_0xc84; + i_this->field_0xc9c = i_this->field_0xc90; + i_this->field_0xc9c.y += -100.0f; + vec1.x = 0.0f; + vec1.y = 0.0f; + vec1.z = 180.0f; + MtxPosition(&vec1, &i_this->field_0xca8); + i_this->field_0xca8 += i_this->field_0xc84; + i_this->field_0xcb4 = i_this->field_0xca8; + i_this->field_0xcb4.y += -100.0f; + + dBgS_LinChk lin_chk; + lin_chk.Set(&i_this->field_0xc84, &i_this->field_0xc90, _this); + i_this->field_0xc80 = true; + if (!dComIfG_Bgsp().LineCross(&lin_chk)) { + lin_chk.Set(&i_this->field_0xca8, &i_this->field_0xcb4, _this); + if (dComIfG_Bgsp().LineCross(&lin_chk)) { + lin_chk.Set(&i_this->field_0xc90, &i_this->field_0xc9c, _this); + if (dComIfG_Bgsp().LineCross(&lin_chk)) { + i_this->field_0xc80 = false; + i_this->mTargetPos = lin_chk.i_GetCross(); + i_this->mMode = 5; + } + } + } + } + + return ret; +} + +/* 8066C894-8066CAA8 004C34 0214+00 1/1 0/0 0/0 .text do_a_swim__FP8do_class */ +static void do_a_swim(do_class* i_this) { + i_this->mTailWagTarget = 2000.0f; + cLib_addCalc0(&i_this->speedF, 1.0f, 1.0f); + JPABaseEmitter* emitter; + + switch (i_this->mMode) { + case 0: + if (l_HIO.mWaterHuntAnimType == 1) { + anm_init(i_this, ANM_JOYFUL, 5.0f, 2, 1.0f); + } else { + anm_init(i_this, ANM_BULBUL, 5.0f, 2, 1.0f); + } + + i_this->mMode = 1; + i_this->mTimer[0] = 20; + + emitter = dComIfGp_particle_set(0x2a3, &i_this->current.pos, 0, 0); + + if (emitter) { + emitter->setGlobalRTMatrix(i_this->mpMorf->getModel()->getAnmMtx(2)); + cXyz _pos(0.6f, 0.6f, 0.6f); + JGeometry::TVec3 pos; + JGeometry::setTVec3f(&_pos.x, &pos.x); + emitter->setGlobalScale(pos); + } + // fallthrough + + case 1: + if (i_this->mTimer[0] == 0) { + i_this->mMode = 2; + i_this->mShakeSpeed = 0.1f; + i_this->mShakeTargetSpeed = 1.0f; + } + break; + + case 2: + if (l_HIO.mWaterHuntAnimType == 1) { + i_this->mpMorf->setPlaySpeed(i_this->mShakeSpeed * 5.0f); + } else { + i_this->mpMorf->setPlaySpeed(i_this->mShakeSpeed * 5.0f); + } + + if (i_this->mShakeSpeed <= 0.025f) { + i_this->mShakeSpeed = 0.0f; + i_this->mAction = ACT_WAIT_1; + i_this->mMode = 0; + } + break; + } +} + +/* 8066CAA8-8066CDEC 004E48 0344+00 1/1 0/0 0/0 .text do_carry__FP8do_class */ +static s8 do_carry(do_class* i_this) { + fopAc_ac_c* _this = static_cast(i_this); + s8 ret = 0; + i_this->mCcDisableTimer = 5; + _this->speed.y = 0.0f; + _this->speedF = 0.0f; + + switch (i_this->mMode) { + case 0: + anm_init(i_this, ANM_TO_CARRY_B, 1.0f, 0, + daPy_getLinkPlayerActorClass()->getBaseAnimeFrameRate()); + i_this->mpMorf->setFrame(daPy_getLinkPlayerActorClass()->getBaseAnimeFrame()); + i_this->mTimer[0] = 20; + i_this->mMode++; + break; + + case 1: + if (i_this->mpMorf->checkFrame(10.0f)) { + i_this->mSound.startSound(Z2SE_DOG_CARRIED, 0, -1); + } + + if (daPy_getLinkPlayerActorClass()->getGrabPutStart()) { + anm_init(i_this, ANM_TO_CARRY_B, 1.0f, 0, + daPy_getLinkPlayerActorClass()->getBaseAnimeFrameRate()); + i_this->mpMorf->setFrame(daPy_getLinkPlayerActorClass()->getBaseAnimeFrame()); + i_this->mMode++; + } + break; + } + + if (!fopAcM_checkCarryNow(_this)) { + i_this->mAction = ACT_WAIT_1; + i_this->mMode = 0; + + dBgS_GndChk gnd_chk; + cXyz vec = _this->current.pos; + vec.y += 50.0f; + gnd_chk.SetPos(&vec); + if (fabsf(_this->current.pos.y - dComIfG_Bgsp().GroundCross(&gnd_chk)) < 30.0f) { + _this->current.pos.y = dComIfG_Bgsp().GroundCross(&gnd_chk); + _this->gravity = 0.0f; + } + } + + i_this->mTailWagTarget = 1000.0f; + _this->speedF = 0.0f; + + if (i_this->mTimer[0] != 0) { + ret = 1; + _this->speed.y = -0.1f; + } else { + _this->speed.y = 0.0f; + } + + fopAc_ac_c* player = dComIfGp_getPlayer(0); + dBgS_LinChk lin_chk; + cXyz vec = _this->current.pos; + vec.y += 2.0f; + lin_chk.Set(&player->eyePos, &vec, _this); + if (dComIfG_Bgsp().LineCross(&lin_chk)) { + _this->current.pos = lin_chk.i_GetCross(); + } + + return ret; +} + +/* 8066CDEC-8066CEC4 00518C 00D8+00 1/1 0/0 0/0 .text do_message__FP8do_class */ +static void do_message(do_class* i_this) { + i_this->mTailWagTarget = 2000.0f; + + switch (i_this->mMode) { + case 0: + anm_init(i_this, 21, 5.0f, 2, 1.0f); + i_this->mMode++; + break; + + case 1: + break; + } + + cLib_addCalc0(&i_this->speedF, 1.0f, 2.0f); + i_this->field_0x616 = 1; + cLib_addCalcAngleS2(&i_this->current.angle.y, i_this->mTargetAngleY, 2, 0x1000); + + if (!dComIfGp_event_runCheck() && i_this->mDistFromPlayer > 400.0f) { + i_this->mAction = ACT_STAY; + i_this->mMode = 0; + } +} + +/* 8066CEC4-8066DD48 005264 0E84+00 2/1 0/0 0/0 .text action__FP8do_class */ +static void action(do_class* i_this) { + fopAc_ac_c* _this = static_cast(i_this); + cXyz vec1, vec2; + daPy_py_c* player = static_cast(dComIfGp_getPlayer(0)); + + _this->gravity = -7.0f; + + i_this->mDistFromPlayer = fopAcM_searchPlayerDistance(_this); + if (daPy_getPlayerActorClass()->checkHorseRide()) { + i_this->mDistFromPlayer -= 100.0f; + } + + i_this->mTargetAngleY = fopAcM_searchPlayerAngleY(_this); + + i_this->field_0x658 = fabsf(player->eyePos.y - player->current.pos.y); + if (!mDoCPd_c::getHoldR(PAD_1) || fabsf(_this->current.pos.y - player->current.pos.y) > 50.0f) { + i_this->field_0x658 = 300.0f; + } + i_this->field_0x658 *= 0.6f; + + s8 ground_check = 1; + s8 carry_check = 1; + s8 swim_check = 1; + + i_this->mCcSph.OnCoSetBit(); + + if (i_this->field_0x608 < 1.0f) { + i_this->mMessageState = 0; + + switch (i_this->mAction) { + case ACT_STAY: + do_stay(i_this); + food_check(i_this); + i_this->mMessageState = 1; + break; + case ACT_WALK: + do_walk(i_this); + food_check(i_this); + i_this->mMessageState = 1; + break; + case ACT_WALK_RUN: + do_walk_run(i_this); + food_check(i_this); + i_this->mMessageState = 1; + break; + case ACT_RUN: + do_run(i_this); + food_check(i_this); + i_this->mMessageState = 1; + break; + case ACT_RUN_WALK: + do_run_walk(i_this); + food_check(i_this); + i_this->mMessageState = 1; + break; + case ACT_FOOD: + do_food(i_this); + i_this->mMessageState = 1; + break; + case ACT_WAIT_1: + do_wait_1(i_this); + food_check(i_this); + i_this->mMessageState = 1; + break; + case ACT_WAIT_2: + do_wait_2(i_this); + food_check(i_this); + i_this->mMessageState = 1; + break; + case ACT_SIT: + do_sit(i_this); + food_check(i_this); + i_this->mMessageState = 1; + break; + case ACT_A_SWIM: + do_a_swim(i_this); + break; + case ACT_SWIM: + do_swim(i_this); + swim_check = 0; + fopAcM_riverStream(&_this->current.pos, &i_this->field_0x6b0, &i_this->field_0x6b4, + 0.5f); + break; + case ACT_HELP: + do_help(i_this); + break; + case ACT_BOAT: + ground_check = do_boat(i_this); + break; + case ACT_HANG: + do_hang(i_this); + break; + case ACT_CARRY: + ground_check = do_carry(i_this); + i_this->mCcSph.OffCoSetBit(); + carry_check = 0; + break; + case ACT_MESSAGE: + do_message(i_this); + i_this->mMessageState = 2; + } + } + + if (i_this->mItemActorID != -1 && i_this->mDistFromPlayer < 160.0f * i_this->mScale.z) { + daItem_c* item = static_cast(fopAcM_SearchByID(i_this->mItemActorID)); + + if (item) { + item->endControl(); + } + + i_this->mItemControlTimer = 0; + i_this->mItemActorID = -1; + } + + if (i_this->mRunningSoundTimer != 0) { + i_this->mRunningSoundTimer--; + if (i_this->mRunningSoundTimer == 0) { + i_this->mSound.startSound(Z2SE_M007_DOG_COME_RUNNING, 0, -1); + } + } + + if (i_this->mMessageState == 1 && daPy_py_c::i_checkNowWolf() + && i_this->mDistFromPlayer < 300.0f) + { + i_this->mAction = ACT_MESSAGE; + i_this->mMode = 0; + } + + if (carry_check && player->speedF < 2.0f) { + cLib_onBit(_this->attention_info.flags, 0x10); + + if (do_carry_check(i_this)) { + return; + } + } else { + cLib_offBit(_this->attention_info.flags, 0x10); + } + + cLib_addCalcAngleS2(&_this->current.angle.x, 0, 1, 0x400); + + if (i_this->mAction != ACT_HANG) { + cMtx_YrotS(*calc_mtx, _this->current.angle.y); + + vec1.x = 0.0f; + vec1.y = 0.0f; + vec1.z = _this->speedF * 0.8f * i_this->mScale.z * l_HIO.mBaseSize; + + MtxPosition(&vec1, &vec2); + + _this->speed.x = vec2.x; + _this->speed.z = vec2.z; + _this->speed.y += _this->gravity; + + _this->current.pos += _this->speed; + + if (_this->speed.y < -80.0f) { + _this->speed.y = -80.0f; + } + + if (!fopAcM_checkCarryNow(_this)) { + cXyz* cc_move = i_this->mStts.GetCCMoveP(); + if (cc_move != NULL) { + _this->current.pos.x += 0.3f * cc_move->x; + _this->current.pos.z += 0.3f * cc_move->z; + } + } + + if (i_this->field_0x608 > 1.0f) { + vec1.x = 0.0f; + vec1.y = 0.0f; + vec1.z = -i_this->field_0x608; + + cMtx_YrotS(*calc_mtx, i_this->field_0x60c); + MtxPosition(&vec1, &vec2); + + _this->current.pos += vec2; + cLib_addCalc0(&i_this->field_0x608, 1.0f, 6.0f); + + _this->speedF = 0.0f; + ground_check = 1; + } + + if (ground_check) { + i_this->mBgS_AcchCir.SetWall(30.0f, + fabsf(_this->speedF) + fabsf(i_this->field_0x608) + 30.0f); + i_this->mBgS_Acch.CrrPos(dComIfG_Bgsp()); + + if (i_this->mBgS_Acch.ChkGroundHit() && !noFallCheck && !fopAcM_checkCarryNow(_this)) + { + dBgS_GndChk gnd_chk; + + cMtx_YrotS(*calc_mtx, _this->shape_angle.y); + + vec1.x = 0.0f; + vec1.y = 0.0f; + vec1.z = -25.0f * i_this->mScale.z; + + MtxPosition(&vec1, &vec2); + vec2 += _this->current.pos; + + Vec pos; + pos.x = vec2.x; + pos.y = vec2.y + 100.0f; + pos.z = vec2.z; + + gnd_chk.SetPos(&pos); + vec2.y = dComIfG_Bgsp().GroundCross(&gnd_chk); + + vec1 = vec2 - _this->current.pos; + + if (fabsf(vec1.y) < 50.0f) { + _this->current.angle.x = + cM_atan2s(vec1.y, JMAFastSqrt(vec1.x * vec1.x + vec1.z * vec1.z)); + } + } + } + } else { + if (i_this->field_0x608 < 1.0f && dansa_check(i_this, _this->current.pos, 100.0f) > 0) { + i_this->mHangAngleY = hang_set(i_this); + + if (i_this->mHangAngleY != 0xdcf) { + i_this->mAction = ACT_HANG; + i_this->mMode = 0; + i_this->mASwimTimer = 0; + } + } + } + + water_check(i_this); + + if (swim_check) { + if (i_this->mAction != ACT_CARRY) { + if (i_this->mASwimTimer != 0) { + i_this->mASwimTimer--; + if (i_this->mASwimTimer == 0) { + i_this->mAction = ACT_A_SWIM; + i_this->mMode = 0; + } + } + + if (i_this->mWaterY - _this->current.pos.y > 45.0f) { + i_this->mAction = ACT_SWIM; + i_this->mMode = 0; + i_this->field_0x608 = 0.0f; + + if (i_this->mSwimEffectTimer == 0) { + i_this->mSwimEffectTimer = 20; + cXyz pos = _this->current.pos; + pos.y = i_this->mWaterY; + + static cXyz scc(0.7f, 0.7f, 0.7f); + static u16 w_eff_id[4] = {0x1B8, 0x1B9, 0x1BA, 0x1BB}; + + for (int i = 0; i < 4; i++) { + i_this->mParticleKey[i] = + dComIfGp_particle_set(i_this->mParticleKey[i], w_eff_id[i], &pos, + &_this->tevStr, NULL, &scc, 0xff, NULL, -1, + NULL, NULL, NULL); + } + + i_this->mSound.startSound(Z2SE_CM_BODYFALL_WATER_S, 0, -1); + } + } + } + } else { + i_this->mASwimTimer = cM_rndF(25.0f) + 30.0f; + + if (i_this->mWaterY - _this->current.pos.y < 35.0f) { + i_this->mAction = ACT_WAIT_1; + i_this->mMode = 0; + } + } + + cLib_addCalcAngleS2(&_this->shape_angle.y, _this->current.angle.y, 2, 0x2000); + cLib_addCalcAngleS2(&_this->shape_angle.x, _this->current.angle.x, 4, 0x1000); + _this->shape_angle.z = _this->current.angle.z; + + s16 head_angle_y = 0; + s16 head_angle_x = 0; + + if (i_this->field_0x616 != 0 || i_this->mLookTimer != 0) { + if (i_this->field_0x616 == 2) { + if (i_this->mCounter & 8) { + head_angle_y = 10000; + } else { + head_angle_y = -10000; + } + } else { + if (i_this->mLookTimer != 0) { + i_this->mLookTimer--; + vec1 = i_this->mLookPos - _this->eyePos; + } else { + vec1 = player->eyePos - _this->eyePos; + } + + vec1.y += i_this->mScale.z * -16.0f; + + head_angle_y = cM_atan2s(vec1.x, vec1.z) - _this->shape_angle.y; + head_angle_x = _this->shape_angle.x + + cM_atan2s(vec1.y, JMAFastSqrt(vec1.x * vec1.x + vec1.z * vec1.z)); + + if (i_this->mLookTimer == 0 && (head_angle_y > 24000 || head_angle_y < -24000)) { + head_angle_y = 0; + } + + if (head_angle_y > 12000) { + head_angle_y = 12000; + } else if (head_angle_y < -12000) { + head_angle_y = -12000; + } + + if (head_angle_x > 12000) { + head_angle_x = 12000; + } else if (head_angle_x < -12000) { + head_angle_x = -12000; + } + + head_angle_y += i_this->mHeadTilt; + } + + i_this->field_0x616 = 0; + } + + cLib_addCalcAngleS2(&i_this->mHeadAngle.y, head_angle_y / 2, 4, 0x2000); + cLib_addCalcAngleS2(&i_this->mHeadAngle.x, head_angle_x / 2, 4, 0x2000); + cLib_addCalcAngleS2(&i_this->mHeadTilt, 0, 2, 0x300); + cLib_addCalcAngleS2(&i_this->mHeadBob.y, i_this->mHeadBobTarget.y, 4, 0x400); + cLib_addCalcAngleS2(&i_this->mHeadBob.z, i_this->mHeadBobTarget.z, 4, 0x400); + + if (fabsf(player->speedF) < 2.0f && fabsf(_this->speedF) < 2.0f) { + if (i_this->mHeadBobTimer != 0) { + i_this->mHeadBobTimer--; + if (i_this->mHeadBobTimer == 0) { + i_this->mHeadBobTimer = cM_rndF(100.0f) + 20.0f; + + if (cM_rndF(1.0f) < 0.5f) { + i_this->mHeadBobTarget.y = cM_rndFX(2000.0f); + } + + if (cM_rndF(1.0f) < 0.5f) { + i_this->mHeadBobTarget.z = cM_rndFX(2000.0f); + } + } + } + } else { + i_this->mHeadBobTarget.z = 0; + i_this->mHeadBobTarget.y = 0; + i_this->mHeadBobTimer = cM_rndF(60.0f) + 80.0f; + } + + if (i_this->mShakeSpeed >= 0.025f) { + if (l_HIO.mWaterHuntAnimType != 0) { + f32 fvar17 = i_this->mShakeSpeed * 3000.0f; + i_this->mHeadAngle.y = fvar17 * cM_ssin(i_this->mCounter * 22000) * 0.5f; + i_this->mHeadAngle.z = fvar17 * cM_ssin(i_this->mCounter * 25000); + } else { + i_this->mHeadAngle.z = 0; + i_this->mHeadAngle.y = 0; + } + } + + cLib_addCalc2(&i_this->mShakeSpeed, i_this->mShakeTargetSpeed, 1.0f, 0.15f); + cLib_addCalc0(&i_this->mShakeTargetSpeed, 1.0f, 0.04f); + + i_this->mTailAngle.y = i_this->mTailWag * cM_ssin(i_this->mTailPhaseY); + i_this->mTailAngle.x = i_this->mTailWag * cM_ssin(i_this->mTailPhaseX) * 0.5f; + + i_this->mTailPhaseY += i_this->mTailWag * 2.0f; + if (i_this->mTailPhaseY > 65536.0f) { + i_this->mTailPhaseY -= 65536.0f; + } + + i_this->mTailPhaseX += i_this->mTailWag * 1.5f; + if (i_this->mTailPhaseX > 65536.0f) { + i_this->mTailPhaseX -= 65536.0f; + } + + cLib_addCalc2(&i_this->mTailWag, i_this->mTailWagTarget, 1.0f, 100.0f); + i_this->mTailWagTarget = 0.0f; + + if (i_this->mBtpReset != 0) { + cLib_addCalcAngleS2(&i_this->mBtpFrame, 3, 1, 1); + i_this->mBtpReset = 0; + i_this->mBtpTimer = 60; + } else { + if (i_this->mBtpTimer == 0) { + i_this->mBtpTimer = cM_rndF(100.0f) + 30.0f; + } else { + i_this->mBtpTimer--; + if (i_this->mBtpTimer <= 5) { + i_this->mBtpFrame = 5 - i_this->mBtpTimer; + } else { + i_this->mBtpFrame = 0; + } + } + } +} + +/* 8066DD48-8066DE64 0060E8 011C+00 1/1 0/0 0/0 .text message__FP8do_class */ +static void message(do_class* i_this) { + if (i_this->mIsTalking) { + i_this->mCcDisableTimer = 10; + + if (i_this->mMsg.doFlow(i_this, 0, 0)) { + dComIfGp_event_reset(); + i_this->mIsTalking = 0; + } + + } else { + if (dComIfGp_event_runCheck() && i_this->eventInfo.checkCommandTalk()) { + i_this->mMsg.init(i_this, i_this->mFlowID, 0, 0); + i_this->mIsTalking = 1; + } + + if (i_this->mMessageState == 2 && i_this->mFlowID != -1 && daPy_py_c::i_checkNowWolf()) { + fopAcM_OnStatus(i_this, 0); + cLib_onBit(i_this->attention_info.flags, 0xa); + i_this->eventInfo.i_onCondition(dEvtCnd_CANTALK_e); + } else { + fopAcM_OffStatus(i_this, 0); + cLib_offBit(i_this->attention_info.flags, 0xa); + } + } +} + +/* 8066DE64-8066E494 006204 0630+00 2/1 0/0 0/0 .text daDo_Execute__FP8do_class */ +static int daDo_Execute(do_class* i_this) { + if (cDmrNowMidnaTalk() && !fopAcM_checkCarryNow(i_this)) { + return 1; + } + + i_this->mCounter++; + + for (int i = 0; i < 4; i++) { + if (i_this->mTimer[i] != 0) { + i_this->mTimer[i]--; + } + } + + if (i_this->mCcDisableTimer != 0) { + i_this->mCcDisableTimer--; + } + + if (i_this->mSwimEffectTimer != 0) { + i_this->mSwimEffectTimer--; + } + + action(i_this); + + mDoMtx_stack_c::transS(i_this->current.pos.x, i_this->current.pos.y, i_this->current.pos.z); + mDoMtx_stack_c::YrotM(i_this->shape_angle.y); + mDoMtx_stack_c::XrotM(i_this->shape_angle.x); + mDoMtx_stack_c::ZrotM(i_this->shape_angle.z); + i_this->scale.set(i_this->mScale.x * l_HIO.mBaseSize, + i_this->mScale.y * l_HIO.mBaseSize, + i_this->mScale.z * l_HIO.mBaseSize); + mDoMtx_stack_c::scaleM(i_this->scale.x, i_this->scale.y, i_this->scale.z); + J3DModel* model = i_this->mpMorf->getModel(); + model->setBaseTRMtx(mDoMtx_stack_c::get()); + i_this->mpMorf->play(&i_this->eyePos, 0, 0); + + if (i_this->mAnmID == ANM_JOYFUL) { + if (i_this->mpMorf->checkFrame(16.0f)) { + i_this->mpMorf->setFrame(0.0f); + } + } else if (i_this->mAnmID == ANM_RUN) { + if (i_this->mpMorf->checkFrame(15.0f)) { + i_this->mpMorf->setFrame(0.0f); + } + } + + if ((i_this->mAnmID == ANM_JOYFUL || i_this->mAnmID == ANM_STEP) && i_this->mTimer[3] == 0) { + i_this->mTimer[3] = cM_rndF(4.0f) + 13.0f; + i_this->mSound.startSound(Z2SE_DOG_BREATH, 0, -1); + } + + i_this->mpBtk->setFrame(i_this->mBtkFrame); + i_this->mpBtp->setFrame(i_this->mBtpFrame); + i_this->mpMorf->modelCalc(); + + cXyz vec, center; + MTXCopy(model->getAnmMtx(10), *calc_mtx); + vec.set(5.0f, 5.0f, 0.0f); + MtxPosition(&vec, &i_this->eyePos); + i_this->attention_info.position = i_this->eyePos; + i_this->attention_info.position.y += i_this->mScale.y * 16.0f; + + vec.set(-15.0f, -15.0f, 0.0f); + MtxPosition(&vec, ¢er); + if (i_this->mCcDisableTimer != 0) { + center.y += 13000.0f; + } + i_this->mCcSph.SetC(center); + + if (i_this->mAction == ACT_A_SWIM) { + i_this->mCcSph.SetR(i_this->mScale.z * 45.0f); + } else { + i_this->mCcSph.SetR(i_this->mScale.z * 30.0f); + } + + dComIfG_Ccsp()->Set(&i_this->mCcSph); + + if (i_this->mItemActorID != -1) { + daItem_c* item = static_cast(fopAcM_SearchByID(i_this->mItemActorID)); + if (item != NULL) { + if (i_this->mItemControlTimer < 10) { + i_this->mItemControlTimer++; + if (i_this->mItemControlTimer == 10) { + item->startControl(); + i_this->mItemControlTimer = 20; + } + } + + MTXCopy(i_this->mpMorf->getModel()->getAnmMtx(10), *calc_mtx); + cMtx_YrotM(*calc_mtx, 0); + cMtx_XrotM(*calc_mtx, 0); + cMtx_ZrotM(*calc_mtx, 0); + MtxTrans(20.0f, -24.0f, 0.0f, 1); + vec.set(0.0f, 0.0f, 0.0f); + MtxPosition(&vec, &item->current.pos); + + item->shape_angle = i_this->shape_angle; + item->current.angle = item->shape_angle; + item->speed.zero(); + item->speedF = 0.0f; + } + } + + if (i_this->mFoodInMouth) { + obj_food_class* food = + static_cast(fopAcM_SearchByID(i_this->mFoodActorID)); + if (food != NULL) { + if (fopAcM_GetName(food) == PROC_OBJ_FOOD) { + MTXCopy(i_this->mpMorf->getModel()->getAnmMtx(10), *calc_mtx); + cMtx_YrotM(*calc_mtx, 0x4000); + MtxTrans(0.0f, -7.0f, 25.0f, 1); + food->mpModel->setBaseTRMtx(*calc_mtx); + vec.set(0.0f, 0.0f, 0.0f); + MtxPosition(&vec, &food->current.pos); + fopAcM_SetFoodStatus(food, fopAcM_FOOD_3); + } + } else { + //!@bug: the last two lines will fail because this path only executes if food is null + MTXCopy(i_this->mpMorf->getModel()->getAnmMtx(10), *calc_mtx); + cMtx_YrotM(*calc_mtx, 0x4000); + MtxTrans(0.0f, -7.0f, 25.0f, 1); + vec.set(0.0f, 0.0f, 0.0f); + MtxPosition(&vec, &food->current.pos); + fopAcM_SetFoodStatus(food, fopAcM_FOOD_3); + } + i_this->mFoodInMouth = 0; + } + + i_this->mSound.framework(0, dComIfGp_getReverb(fopAcM_GetRoomNo(i_this))); + message(i_this); + return 1; +} + +/* 8066E494-8066E49C 006834 0008+00 1/0 0/0 0/0 .text daDo_IsDelete__FP8do_class */ +static int daDo_IsDelete(do_class* i_this) { + return 1; +} + +/* 8066E49C-8066E504 00683C 0068+00 1/0 0/0 0/0 .text daDo_Delete__FP8do_class */ +static int daDo_Delete(do_class* i_this) { + u32 actor_id = fopAcM_GetID(i_this); + dComIfG_resDelete(&i_this->mPhase, "Do"); + if (i_this->mHIOInit) { + hioInit = false; + } + if (i_this->heap) { + i_this->mSound.deleteObject(); + } + return 1; +} + +/* 8066E504-8066E7D4 0068A4 02D0+00 1/1 0/0 0/0 .text useHeapInit__FP10fopAc_ac_c */ +static int useHeapInit(fopAc_ac_c* i_this) { + do_class* _this = (do_class*)i_this; + + _this->mpMorf = new mDoExt_McaMorf((J3DModelData*)dComIfG_getObjectRes("Do", 25), NULL, NULL, + (J3DAnmTransform*)dComIfG_getObjectRes("Do", 14), 2, + 1.0f, 0, -1, 1, NULL, 0x80000, 0x11020284); + + if (_this->mpMorf == NULL || _this->mpMorf->getModel() == NULL) { + return 0; + } + + J3DModel* model = _this->mpMorf->getModel(); + _this->model = model; + model->setUserArea((u32)i_this); + + for (u16 jnt_no = 0; jnt_no < model->getModelData()->getJointNum(); jnt_no++) { + if (jnt_no == 9 || jnt_no == 10 || jnt_no == 22 || jnt_no == 23) { + model->getModelData()->getJointNodePointer(jnt_no)->setCallBack(nodeCallBack); + } + } + + _this->mpBtk = new mDoExt_btkAnm(); + if (_this->mpBtk == NULL) { + return 0; + } + + if (!_this->mpBtk->init(_this->mpMorf->getModel()->getModelData(), + (J3DAnmTextureSRTKey*)dComIfG_getObjectRes("Do", 29), TRUE, 0, + 1.0f, 0, -1)) + { + return 0; + } + + _this->mpBtp = new mDoExt_btpAnm(); + if (_this->mpBtp == NULL) { + return 0; + } + + if (!_this->mpBtp->init(_this->mpMorf->getModel()->getModelData(), + (J3DAnmTexPattern*)dComIfG_getObjectRes("Do", 32), TRUE, 0, + 1.0f, 0, -1)) + { + return 0; + } + + _this->mSound.init(&_this->current.pos, 1); + return 1; +} + +/* 8066E81C-8066EAE4 006BBC 02C8+00 1/0 0/0 0/0 .text daDo_Create__FP10fopAc_ac_c */ +static cPhs__Step daDo_Create(fopAc_ac_c* i_this) { + do_class* _this = static_cast(i_this); + fopAcM_SetupActor(i_this, do_class); + + cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&_this->mPhase, "Do"); + + if (step == cPhs_COMPLEATE_e) { + _this->mParam0 = fopAcM_GetParam(i_this) & 7; + _this->mParam1 = fopAcM_GetParam(i_this) >> 4 & 0xf; + _this->mParam2 = (u8)(fopAcM_GetParam(i_this) >> 8); + if (_this->mParam0 != 2) { + _this->mParam0 = 0; + } + + _this->mFlowID = i_this->current.angle.x; + i_this->shape_angle.x = 0; + i_this->current.angle.x = 0; + + if (!fopAcM_entrySolidHeap(i_this, useHeapInit, 0x2120)) { + return cPhs_ERROR_e; + } + + if (!hioInit) { + _this->mHIOInit = true; + hioInit = 1; + l_HIO.field_0x04 = -1; + } + + fopAcM_OnStatus(i_this, fopAcStts_CULL_e); + fopAcM_OnCarryType(i_this, fopAcM_CARRY_TYPE_8); + i_this->attention_info.flags = 0; + i_this->attention_info.field_0x0[4] = 7; + fopAcM_SetMtx(i_this, _this->mpMorf->getModel()->getBaseTRMtx()); + _this->mBgS_Acch.Set(fopAcM_GetPosition_p(i_this), fopAcM_GetOldPosition_p(i_this), i_this, + 1, &_this->mBgS_AcchCir, fopAcM_GetSpeed_p(i_this), NULL, NULL); + _this->mBgS_AcchCir.SetWall(30.0f, 30.0f); + i_this->health = 1; + _this->field_0x560 = 1; + _this->mStts.Init(100, 0, i_this); + + static dCcD_SrcSph cc_sph_src = { + { + {0x0, {{0x0, 0x0, 0x0}, {0x0, 0x0}, 0x75}}, // mObj + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x2}, // mGObjTg + {0x0}, // mGObjCo + }, // mObjInf + { + {{0.0f, 0.0f, 0.0f}, 20.0f} // mSph + } // mSphAttr + }; + _this->mCcSph.Set(cc_sph_src); + _this->mCcSph.SetStts(&_this->mStts); + _this->mCcSph.OnTgNoHitMark(); + + if (_this->mParam1 == 0xff) { + _this->mBtkFrame = cM_rndF(3.999f); + } else { + _this->mBtkFrame = _this->mParam1; + if (_this->mBtkFrame > 3) { + _this->mBtkFrame = 3; + } + } + + _this->mTailPhaseY = cM_rndF(0x10000); + _this->mTailPhaseX = cM_rndF(0x10000); + _this->mCounter = cM_rndF(0x10000); + _this->mScale.set(1.0f, 1.0f, 1.0f); + + if (_this->mParam0 == 2) { + _this->mAction = ACT_HELP; + i_this->current.pos.set(7216.0f, 220.0f, -4808.0f); + } + + noFallCheck = false; + if (dStage_stagInfo_GetSTType(dComIfGp_getStage()->getStagInfo()) != ST_FIELD) { + noFallCheck = true; + _this->mParam2 = 200; + } + + _this->mItemActorID = -1; + daDo_Execute(_this); + } + + return step; +} + +/* 8066F32C-8066F330 0000BC 0004+00 0/0 0/0 0/0 .bss + * sInstance__40JASGlobalInstance<19JASDefaultBankTable> */ +#pragma push +#pragma force_active on +static u8 data_8066F32C[4]; +#pragma pop + +/* 8066F330-8066F334 0000C0 0004+00 0/0 0/0 0/0 .bss + * sInstance__35JASGlobalInstance<14JASAudioThread> */ +#pragma push +#pragma force_active on +static u8 data_8066F330[4]; +#pragma pop + +/* 8066F334-8066F338 0000C4 0004+00 0/0 0/0 0/0 .bss sInstance__27JASGlobalInstance<7Z2SeMgr> */ +#pragma push +#pragma force_active on +static u8 data_8066F334[4]; +#pragma pop + +/* 8066F338-8066F33C 0000C8 0004+00 0/0 0/0 0/0 .bss sInstance__28JASGlobalInstance<8Z2SeqMgr> */ +#pragma push +#pragma force_active on +static u8 data_8066F338[4]; +#pragma pop + +/* 8066F33C-8066F340 0000CC 0004+00 0/0 0/0 0/0 .bss sInstance__31JASGlobalInstance<10Z2SceneMgr> + */ +#pragma push +#pragma force_active on +static u8 data_8066F33C[4]; +#pragma pop + +/* 8066F340-8066F344 0000D0 0004+00 0/0 0/0 0/0 .bss sInstance__32JASGlobalInstance<11Z2StatusMgr> + */ +#pragma push +#pragma force_active on +static u8 data_8066F340[4]; +#pragma pop + +/* 8066F344-8066F348 0000D4 0004+00 0/0 0/0 0/0 .bss sInstance__31JASGlobalInstance<10Z2DebugSys> + */ +#pragma push +#pragma force_active on +static u8 data_8066F344[4]; +#pragma pop + +/* 8066F348-8066F34C 0000D8 0004+00 0/0 0/0 0/0 .bss + * sInstance__36JASGlobalInstance<15JAISoundStarter> */ +#pragma push +#pragma force_active on +static u8 data_8066F348[4]; +#pragma pop + +/* 8066F34C-8066F350 0000DC 0004+00 0/0 0/0 0/0 .bss + * sInstance__35JASGlobalInstance<14Z2SoundStarter> */ +#pragma push +#pragma force_active on +static u8 data_8066F34C[4]; +#pragma pop + +/* 8066F350-8066F354 0000E0 0004+00 0/0 0/0 0/0 .bss + * sInstance__33JASGlobalInstance<12Z2SpeechMgr2> */ +#pragma push +#pragma force_active on +static u8 data_8066F350[4]; +#pragma pop + +/* 8066F354-8066F358 0000E4 0004+00 0/0 0/0 0/0 .bss sInstance__28JASGlobalInstance<8JAISeMgr> */ +#pragma push +#pragma force_active on +static u8 data_8066F354[4]; +#pragma pop + +/* 8066F358-8066F35C 0000E8 0004+00 0/0 0/0 0/0 .bss sInstance__29JASGlobalInstance<9JAISeqMgr> */ +#pragma push +#pragma force_active on +static u8 data_8066F358[4]; +#pragma pop + +/* 8066F35C-8066F360 0000EC 0004+00 0/0 0/0 0/0 .bss + * sInstance__33JASGlobalInstance<12JAIStreamMgr> */ +#pragma push +#pragma force_active on +static u8 data_8066F35C[4]; +#pragma pop + +/* 8066F360-8066F364 0000F0 0004+00 0/0 0/0 0/0 .bss sInstance__31JASGlobalInstance<10Z2SoundMgr> + */ +#pragma push +#pragma force_active on +static u8 data_8066F360[4]; +#pragma pop + +/* 8066F364-8066F368 0000F4 0004+00 0/0 0/0 0/0 .bss + * sInstance__33JASGlobalInstance<12JAISoundInfo> */ +#pragma push +#pragma force_active on +static u8 data_8066F364[4]; +#pragma pop + +/* 8066F368-8066F36C 0000F8 0004+00 0/0 0/0 0/0 .bss + * sInstance__34JASGlobalInstance<13JAUSoundTable> */ +#pragma push +#pragma force_active on +static u8 data_8066F368[4]; +#pragma pop + +/* 8066F36C-8066F370 0000FC 0004+00 0/0 0/0 0/0 .bss + * sInstance__38JASGlobalInstance<17JAUSoundNameTable> */ +#pragma push +#pragma force_active on +static u8 data_8066F36C[4]; +#pragma pop + +/* 8066F370-8066F374 000100 0004+00 0/0 0/0 0/0 .bss + * sInstance__33JASGlobalInstance<12JAUSoundInfo> */ +#pragma push +#pragma force_active on +static u8 data_8066F370[4]; +#pragma pop + +/* 8066F374-8066F378 000104 0004+00 0/0 0/0 0/0 .bss sInstance__32JASGlobalInstance<11Z2SoundInfo> + */ +#pragma push +#pragma force_active on +static u8 data_8066F374[4]; +#pragma pop + +/* 8066F378-8066F37C 000108 0004+00 0/0 0/0 0/0 .bss + * sInstance__34JASGlobalInstance<13Z2SoundObjMgr> */ +#pragma push +#pragma force_active on +static u8 data_8066F378[4]; +#pragma pop + +/* 8066F37C-8066F380 00010C 0004+00 0/0 0/0 0/0 .bss sInstance__31JASGlobalInstance<10Z2Audience> + */ +#pragma push +#pragma force_active on +static u8 data_8066F37C[4]; +#pragma pop + +/* 8066F380-8066F384 000110 0004+00 0/0 0/0 0/0 .bss sInstance__32JASGlobalInstance<11Z2FxLineMgr> + */ +#pragma push +#pragma force_active on +static u8 data_8066F380[4]; +#pragma pop + +/* 8066F384-8066F388 000114 0004+00 0/0 0/0 0/0 .bss sInstance__31JASGlobalInstance<10Z2EnvSeMgr> + */ +#pragma push +#pragma force_active on +static u8 data_8066F384[4]; +#pragma pop + +/* 8066F388-8066F38C 000118 0004+00 0/0 0/0 0/0 .bss sInstance__32JASGlobalInstance<11Z2SpeechMgr> + */ +#pragma push +#pragma force_active on +static u8 data_8066F388[4]; +#pragma pop + +/* 8066F38C-8066F390 00011C 0004+00 0/0 0/0 0/0 .bss + * sInstance__34JASGlobalInstance<13Z2WolfHowlMgr> */ +#pragma push +#pragma force_active on +static u8 data_8066F38C[4]; +#pragma pop + +/* 8066F1CC-8066F1EC -00001 0020+00 1/0 0/0 0/0 .data l_daDo_Method */ +static actor_method_class l_daDo_Method = { + (process_method_func)daDo_Create, + (process_method_func)daDo_Delete, + (process_method_func)daDo_Execute, + (process_method_func)daDo_IsDelete, + (process_method_func)daDo_Draw, +}; + +/* 8066F1EC-8066F21C -00001 0030+00 0/0 0/0 1/0 .data g_profile_DO */ +extern actor_process_profile_definition g_profile_DO = { + fpcLy_CURRENT_e, + 7, + fpcPi_CURRENT_e, + PROC_DO, + &g_fpcLf_Method.mBase, + sizeof(do_class), + 0, + 0, + &g_fopAc_Method.base, + 0x2BB, + &l_daDo_Method, + 0x8044000, + fopAc_NPC_e, + fopAc_CULLBOX_0_e, +}; diff --git a/rel/d/a/obj/d_a_obj_food/d_a_obj_food.cpp b/rel/d/a/obj/d_a_obj_food/d_a_obj_food.cpp index 907582bde97..9da817fce7e 100644 --- a/rel/d/a/obj/d_a_obj_food/d_a_obj_food.cpp +++ b/rel/d/a/obj/d_a_obj_food/d_a_obj_food.cpp @@ -1,804 +1,539 @@ -// -// Generated By: dol2asm -// Translation Unit: d_a_obj_food -// +/** + * d_a_obj_food.cpp + * Object - Bone / Ball + */ #include "rel/d/a/obj/d_a_obj_food/d_a_obj_food.h" -#include "d/cc/d_cc_d.h" -#include "dol2asm.h" +#include "SSystem/SComponent/c_math.h" +#include "JSystem/JKernel/JKRHeap.h" +#include "f_op/f_op_actor_mng.h" +#include "d/cc/d_cc_uty.h" +#include "d/com/d_com_inf_game.h" +#include "d/a/d_a_player.h" +#include "d/d_procname.h" -// -// Types: -// +/* 80BF1F40-80BF1F44 000008 0004+00 2/2 0/0 0/0 .bss None */ +static bool hioInit; -struct request_of_phase_process_class {}; - -struct obj_food_class {}; - -struct mDoMtx_stack_c { - /* 8000CD9C */ void transM(f32, f32, f32); - /* 8000CE38 */ void scaleM(f32, f32, f32); - - static u8 now[48]; -}; - -struct fopAc_ac_c { - /* 80018B64 */ fopAc_ac_c(); -}; - -struct daPy_py_c { - /* 8015F60C */ void wolfGrabSubjectNoDraw(fopAc_ac_c*); -}; - -struct daObj_Food_HIO_c { - /* 80BF070C */ daObj_Food_HIO_c(); - /* 80BF1CE8 */ ~daObj_Food_HIO_c(); -}; - -struct dKy_tevstr_c {}; - -struct J3DModelData {}; - -struct dScnKy_env_light_c { - /* 801A37C4 */ void settingTevStruct(int, cXyz*, dKy_tevstr_c*); - /* 801A4DA0 */ void setLightTevColorType_MAJI(J3DModelData*, dKy_tevstr_c*); -}; - -struct dRes_info_c {}; - -struct dRes_control_c { - /* 8003C2EC */ void getRes(char const*, s32, dRes_info_c*, int); -}; - -struct dPa_levelEcallBack {}; - -struct csXyz {}; - -struct _GXColor {}; - -struct dPa_control_c { - /* 8004D4CC */ void set(u32, u8, u16, cXyz const*, dKy_tevstr_c const*, csXyz const*, - cXyz const*, u8, dPa_levelEcallBack*, s8, _GXColor const*, - _GXColor const*, cXyz const*, f32); -}; - -struct dDlst_shadowControl_c { - static u8 mSimpleTexObj[32]; -}; - -struct dBgS_PolyPassChk { - /* 80078E68 */ void SetObj(); -}; - -struct dBgS_ObjAcch { - /* 80BF1C78 */ ~dBgS_ObjAcch(); -}; - -struct dBgS_LinChk { - /* 80077C68 */ dBgS_LinChk(); - /* 80077CDC */ ~dBgS_LinChk(); - /* 80077D64 */ void Set(cXyz const*, cXyz const*, fopAc_ac_c const*); -}; - -struct dBgS_GndChk { - /* 8007757C */ dBgS_GndChk(); - /* 800775F0 */ ~dBgS_GndChk(); -}; - -struct dBgS_AcchCir { - /* 80075EAC */ dBgS_AcchCir(); - /* 80075F58 */ void SetWall(f32, f32); -}; - -struct dBgS {}; - -struct dBgS_Acch { - /* 80075F94 */ ~dBgS_Acch(); - /* 800760A0 */ dBgS_Acch(); - /* 80076248 */ void Set(cXyz*, cXyz*, fopAc_ac_c*, int, dBgS_AcchCir*, cXyz*, csXyz*, csXyz*); - /* 80076AAC */ void CrrPos(dBgS&); -}; - -struct cCcS { - /* 80264BA8 */ void Set(cCcD_Obj*); -}; - -struct cBgS_PolyInfo {}; - -struct cBgS_LinChk {}; - -struct cBgS_GndChk { - /* 80267D0C */ void SetPos(Vec const*); -}; - -struct cBgS { - /* 800743B4 */ void LineCross(cBgS_LinChk*); - /* 800744A0 */ void GroundCross(cBgS_GndChk*); -}; - -struct _GXTexObj {}; - -struct Z2SoundObjSimple { - /* 802BE844 */ Z2SoundObjSimple(); -}; - -struct Z2SoundObjBase { - /* 802BDFF8 */ void deleteObject(); -}; - -struct JMath { - static u8 sincosTable_[65536]; -}; - -struct J3DModel {}; - -// -// Forward References: -// - -extern "C" void __ct__16daObj_Food_HIO_cFv(); -extern "C" static void daObj_Food_Draw__FP14obj_food_class(); -extern "C" static void ground_ang_set__FP14obj_food_class(); -extern "C" static void food_carry__FP14obj_food_class(); -extern "C" static void wall_angle_get__FP14obj_food_class(); -extern "C" static void food_normal__FP14obj_food_class(); -extern "C" static void ball_move__FP14obj_food_class(); -extern "C" static void action__FP14obj_food_class(); -extern "C" static void daObj_Food_Execute__FP14obj_food_class(); -extern "C" static bool daObj_Food_IsDelete__FP14obj_food_class(); -extern "C" static void daObj_Food_Delete__FP14obj_food_class(); -extern "C" static void useHeapInit__FP10fopAc_ac_c(); -extern "C" static void daObj_Food_Create__FP10fopAc_ac_c(); -extern "C" void __dt__8cM3dGSphFv(); -extern "C" void __dt__8cM3dGAabFv(); -extern "C" void __dt__12dBgS_ObjAcchFv(); -extern "C" void __dt__16daObj_Food_HIO_cFv(); -extern "C" void __sinit_d_a_obj_food_cpp(); -extern "C" static void func_80BF1D6C(); -extern "C" static void func_80BF1D74(); -extern "C" extern char const* const d_a_obj_food__stringBase0; - -// -// External References: -// - -extern "C" void mDoMtx_XrotM__FPA4_fs(); -extern "C" void mDoMtx_YrotS__FPA4_fs(); -extern "C" void mDoMtx_YrotM__FPA4_fs(); -extern "C" void mDoMtx_ZrotM__FPA4_fs(); -extern "C" void transM__14mDoMtx_stack_cFfff(); -extern "C" void scaleM__14mDoMtx_stack_cFfff(); -extern "C" void mDoExt_modelUpdateDL__FP8J3DModel(); -extern "C" void mDoExt_J3DModel__create__FP12J3DModelDataUlUl(); -extern "C" void __ct__10fopAc_ac_cFv(); -extern "C" void fopAcM_entrySolidHeap__FP10fopAc_ac_cPFP10fopAc_ac_c_iUl(); -extern "C" void fopAcM_carryOffRevise__FP10fopAc_ac_c(); -extern "C" void fopAcM_getWaterY__FPC4cXyzPf(); -extern "C" void dComIfG_resLoad__FP30request_of_phase_process_classPCc(); -extern "C" void dComIfG_resDelete__FP30request_of_phase_process_classPCc(); -extern "C" void dComIfGp_getReverb__Fi(); -extern "C" void dComIfGd_setSimpleShadow__FP4cXyzffR13cBgS_PolyInfosfP9_GXTexObj(); -extern "C" void -dComIfGd_setShadow__FUlScP8J3DModelP4cXyzffffR13cBgS_PolyInfoP12dKy_tevstr_csfP9_GXTexObj(); -extern "C" void getRes__14dRes_control_cFPCclP11dRes_info_ci(); -extern "C" void -set__13dPa_control_cFUlUcUsPC4cXyzPC12dKy_tevstr_cPC5csXyzPC4cXyzUcP18dPa_levelEcallBackScPC8_GXColorPC8_GXColorPC4cXyzf(); -extern "C" void LineCross__4cBgSFP11cBgS_LinChk(); -extern "C" void GroundCross__4cBgSFP11cBgS_GndChk(); -extern "C" void __ct__12dBgS_AcchCirFv(); -extern "C" void SetWall__12dBgS_AcchCirFff(); -extern "C" void __dt__9dBgS_AcchFv(); -extern "C" void __ct__9dBgS_AcchFv(); -extern "C" void Set__9dBgS_AcchFP4cXyzP4cXyzP10fopAc_ac_ciP12dBgS_AcchCirP4cXyzP5csXyzP5csXyz(); -extern "C" void CrrPos__9dBgS_AcchFR4dBgS(); -extern "C" void __ct__11dBgS_GndChkFv(); -extern "C" void __dt__11dBgS_GndChkFv(); -extern "C" void __ct__11dBgS_LinChkFv(); -extern "C" void __dt__11dBgS_LinChkFv(); -extern "C" void Set__11dBgS_LinChkFPC4cXyzPC4cXyzPC10fopAc_ac_c(); -extern "C" void SetObj__16dBgS_PolyPassChkFv(); -extern "C" void __ct__10dCcD_GSttsFv(); -extern "C" void Init__9dCcD_SttsFiiP10fopAc_ac_c(); -extern "C" void __ct__12dCcD_GObjInfFv(); -extern "C" void ChkTgHit__12dCcD_GObjInfFv(); -extern "C" void GetTgHitObj__12dCcD_GObjInfFv(); -extern "C" void ChkCoHit__12dCcD_GObjInfFv(); -extern "C" void GetCoHitObj__12dCcD_GObjInfFv(); -extern "C" void Set__8dCcD_SphFRC11dCcD_SrcSph(); -extern "C" void wolfGrabSubjectNoDraw__9daPy_py_cFP10fopAc_ac_c(); -extern "C" void settingTevStruct__18dScnKy_env_light_cFiP4cXyzP12dKy_tevstr_c(); -extern "C" void setLightTevColorType_MAJI__18dScnKy_env_light_cFP12J3DModelDataP12dKy_tevstr_c(); -extern "C" void GetAc__8cCcD_ObjFv(); -extern "C" void Set__4cCcSFP8cCcD_Obj(); -extern "C" void __pl__4cXyzCFRC3Vec(); -extern "C" void __mi__4cXyzCFRC3Vec(); -extern "C" void cM_atan2s__Fff(); -extern "C" void cM_rndF__Ff(); -extern "C" void cM_rndFX__Ff(); -extern "C" void SetPos__11cBgS_GndChkFPC3Vec(); -extern "C" void SetC__8cM3dGSphFRC4cXyz(); -extern "C" void SetR__8cM3dGSphFf(); -extern "C" void cLib_addCalc0__FPfff(); -extern "C" void cLib_addCalcAngleS2__FPssss(); -extern "C" void MtxPosition__FP4cXyzP4cXyz(); -extern "C" void seStart__7Z2SeMgrF10JAISoundIDPC3VecUlScffffUc(); -extern "C" void deleteObject__14Z2SoundObjBaseFv(); -extern "C" void __ct__16Z2SoundObjSimpleFv(); -extern "C" void __dl__FPv(); -extern "C" void PSMTXCopy(); -extern "C" void PSMTXTrans(); -extern "C" void __cvt_fp2unsigned(); -extern "C" void _savegpr_24(); -extern "C" void _savegpr_25(); -extern "C" void _savegpr_27(); -extern "C" void _savegpr_28(); -extern "C" void _savegpr_29(); -extern "C" void _restgpr_24(); -extern "C" void _restgpr_25(); -extern "C" void _restgpr_27(); -extern "C" void _restgpr_28(); -extern "C" void _restgpr_29(); -extern "C" extern void* g_fopAc_Method[8]; -extern "C" extern void* g_fpcLf_Method[5 + 1 /* padding */]; -extern "C" extern void* __vt__8dCcD_Sph[36]; -extern "C" extern void* __vt__9dCcD_Stts[11]; -extern "C" extern void* __vt__12cCcD_SphAttr[25]; -extern "C" extern void* __vt__14cCcD_ShapeAttr[22]; -extern "C" extern void* __vt__9cCcD_Stts[8]; -extern "C" u8 now__14mDoMtx_stack_c[48]; -extern "C" extern u8 g_dComIfG_gameInfo[122384]; -extern "C" u8 mSimpleTexObj__21dDlst_shadowControl_c[32]; -extern "C" extern u8 g_env_light[4880]; -extern "C" u8 sincosTable___5JMath[65536]; -extern "C" extern void* calc_mtx[1 + 1 /* padding */]; -extern "C" u8 mAudioMgrPtr__10Z2AudioMgr[4 + 4 /* padding */]; -extern "C" void __register_global_object(); - -// -// Declarations: -// - -/* ############################################################################################## */ -/* 80BF1D90-80BF1D94 000000 0004+00 9/9 0/0 0/0 .rodata @3647 */ -SECTION_RODATA static f32 const lit_3647 = 1.0f; -COMPILER_STRIP_GATE(0x80BF1D90, &lit_3647); - -/* 80BF1E18-80BF1E20 000000 0008+00 1/1 0/0 0/0 .data w_eff_id$3948 */ -SECTION_DATA static u8 w_eff_id[8] = { - 0x01, 0xB8, 0x01, 0xB9, 0x01, 0xBA, 0x01, 0xBB, -}; - -/* 80BF1E20-80BF1E60 000008 0040+00 1/1 0/0 0/0 .data cc_sph_src$4146 */ -static dCcD_SrcSph cc_sph_src = { - { - {0x0, {{0x0, 0x0, 0x0}, {0xd8fbfdff, 0x3}, 0x75}}, // mObj - {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt - {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x2}, // mGObjTg - {0x0}, // mGObjCo - }, // mObjInf - { - {{0.0f, 0.0f, 0.0f}, 20.0f} // mSph - } // mSphAttr -}; - -/* 80BF1E60-80BF1EA0 000048 0040+00 1/1 0/0 0/0 .data at_sph_src$4147 */ -static dCcD_SrcSph at_sph_src = { - { - {0x0, {{AT_TYPE_THROW_OBJ, 0x0, 0x1f}, {0x0, 0x0}, 0x0}}, // mObj - {dCcD_SE_NONE, 0x1, 0x0, 0x0, 0x0}, // mGObjAt - {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x2}, // mGObjTg - {0x0}, // mGObjCo - }, // mObjInf - { - {{0.0f, 0.0f, 0.0f}, 15.0f} // mSph - } // mSphAttr -}; - -/* 80BF1EA0-80BF1EC0 -00001 0020+00 1/0 0/0 0/0 .data l_daObj_Food_Method */ -SECTION_DATA static void* l_daObj_Food_Method[8] = { - (void*)daObj_Food_Create__FP10fopAc_ac_c, - (void*)daObj_Food_Delete__FP14obj_food_class, - (void*)daObj_Food_Execute__FP14obj_food_class, - (void*)daObj_Food_IsDelete__FP14obj_food_class, - (void*)daObj_Food_Draw__FP14obj_food_class, - (void*)NULL, - (void*)NULL, - (void*)NULL, -}; - -/* 80BF1EC0-80BF1EF0 -00001 0030+00 0/0 0/0 1/0 .data g_profile_OBJ_FOOD */ -SECTION_DATA extern void* g_profile_OBJ_FOOD[12] = { - (void*)0xFFFFFFFD, (void*)0x0007FFFD, - (void*)0x01100000, (void*)&g_fpcLf_Method, - (void*)0x00000A90, (void*)NULL, - (void*)NULL, (void*)&g_fopAc_Method, - (void*)0x02C80000, (void*)&l_daObj_Food_Method, - (void*)0x00044100, (void*)NULL, -}; - -/* 80BF1EF0-80BF1EFC 0000D8 000C+00 2/2 0/0 0/0 .data __vt__8cM3dGSph */ -SECTION_DATA extern void* __vt__8cM3dGSph[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__8cM3dGSphFv, -}; - -/* 80BF1EFC-80BF1F08 0000E4 000C+00 2/2 0/0 0/0 .data __vt__8cM3dGAab */ -SECTION_DATA extern void* __vt__8cM3dGAab[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__8cM3dGAabFv, -}; - -/* 80BF1F08-80BF1F2C 0000F0 0024+00 2/2 0/0 0/0 .data __vt__12dBgS_ObjAcch */ -SECTION_DATA extern void* __vt__12dBgS_ObjAcch[9] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__12dBgS_ObjAcchFv, - (void*)NULL, - (void*)NULL, - (void*)func_80BF1D74, - (void*)NULL, - (void*)NULL, - (void*)func_80BF1D6C, -}; - -/* 80BF1F2C-80BF1F38 000114 000C+00 2/2 0/0 0/0 .data __vt__16daObj_Food_HIO_c */ -SECTION_DATA extern void* __vt__16daObj_Food_HIO_c[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__16daObj_Food_HIO_cFv, -}; +/* 80BF1F50-80BF1F5C 000018 000C+00 3/3 0/0 0/0 .bss l_HIO */ +static daObj_Food_HIO_c l_HIO; /* 80BF070C-80BF0730 0000EC 0024+00 1/1 0/0 0/0 .text __ct__16daObj_Food_HIO_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm daObj_Food_HIO_c::daObj_Food_HIO_c() { - nofralloc -#include "asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/__ct__16daObj_Food_HIO_cFv.s" +daObj_Food_HIO_c::daObj_Food_HIO_c() { + field_0x4 = -1; + mBoneScale = 1.0f; } -#pragma pop - -/* ############################################################################################## */ -/* 80BF1D94-80BF1D98 000004 0004+00 0/3 0/0 0/0 .rodata @3679 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3679 = 50.0f; -COMPILER_STRIP_GATE(0x80BF1D94, &lit_3679); -#pragma pop - -/* 80BF1D98-80BF1D9C 000008 0004+00 0/1 0/0 0/0 .rodata @3680 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3680 = 200.0f; -COMPILER_STRIP_GATE(0x80BF1D98, &lit_3680); -#pragma pop - -/* 80BF1D9C-80BF1DA0 00000C 0004+00 0/5 0/0 0/0 .rodata @3681 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_3681[4] = { - 0x00, - 0x00, - 0x00, - 0x00, -}; -COMPILER_STRIP_GATE(0x80BF1D9C, &lit_3681); -#pragma pop - -/* 80BF1DA0-80BF1DA4 000010 0004+00 0/1 0/0 0/0 .rodata @3682 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3682 = 19.0f; -COMPILER_STRIP_GATE(0x80BF1DA0, &lit_3682); -#pragma pop /* 80BF0730-80BF0854 000110 0124+00 1/0 0/0 0/0 .text daObj_Food_Draw__FP14obj_food_class */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void daObj_Food_Draw(obj_food_class* param_0) { - nofralloc -#include "asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/daObj_Food_Draw__FP14obj_food_class.s" +static int daObj_Food_Draw(obj_food_class* i_this) { + if (daPy_py_c::wolfGrabSubjectNoDraw(i_this)) { + return 1; + } + + g_env_light.settingTevStruct(0, &i_this->current.pos, &i_this->tevStr); + g_env_light.setLightTevColorType_MAJI(i_this->mpModel, &i_this->tevStr); + mDoExt_modelUpdateDL(i_this->mpModel); + + if (!fopAcM_checkCarryNow(i_this)) { + if (i_this->mType != obj_food_class::TYPE_BALL) { + cXyz pos; + pos.set(i_this->current.pos.x, i_this->current.pos.y + 50.0f, i_this->current.pos.z); + i_this->mShadowKey = + dComIfGd_setShadow(i_this->mShadowKey, 1, i_this->mpModel, &pos, 200.0f, 0.0f, + i_this->current.pos.y, i_this->mAcch.GetGroundH(), + i_this->mAcch.m_gnd, &i_this->tevStr, 0, 1.0f, + dDlst_shadowControl_c::getSimpleTex()); + } else { + dComIfGd_setSimpleShadow(&i_this->current.pos, i_this->mAcch.GetGroundH(), + 19.0f, i_this->mAcch.m_gnd, 0, 1.0f, + dDlst_shadowControl_c::getSimpleTex()); + } + } + + return 1; } -#pragma pop - -/* ############################################################################################## */ -/* 80BF1DA4-80BF1DA8 000014 0004+00 0/1 0/0 0/0 .rodata @3707 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3707 = 10.0f; -COMPILER_STRIP_GATE(0x80BF1DA4, &lit_3707); -#pragma pop - -/* 80BF1DA8-80BF1DAC 000018 0004+00 0/1 0/0 0/0 .rodata @3708 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3708 = -1000000000.0f; -COMPILER_STRIP_GATE(0x80BF1DA8, &lit_3708); -#pragma pop /* 80BF0854-80BF09A4 000234 0150+00 1/1 0/0 0/0 .text ground_ang_set__FP14obj_food_class */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void ground_ang_set(obj_food_class* param_0) { - nofralloc -#include "asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/ground_ang_set__FP14obj_food_class.s" +static void ground_ang_set(obj_food_class* i_this) { + dBgS_GndChk gnd_chk; + Vec vec1; + cXyz vec2 = i_this->current.pos; + vec2.y = i_this->mAcch.GetGroundH(); + + vec1.x = vec2.x; + vec1.y = vec2.y + 50.0f; + vec1.z = vec2.z + 10.0f; + gnd_chk.SetPos(&vec1); + vec1.y = dComIfG_Bgsp().GroundCross(&gnd_chk); + if (vec1.y != -1e9f) { + i_this->mGroundAngleX = -cM_atan2s(vec1.y - vec2.y, vec1.z - vec2.z); + } + + vec1.x = vec2.x + 10.0f; + vec1.y = vec2.y + 50.0f; + vec1.z = vec2.z; + gnd_chk.SetPos(&vec1); + vec1.y = dComIfG_Bgsp().GroundCross(&gnd_chk); + if (vec1.y != -1e9f) { + i_this->mGroundAngleZ = cM_atan2s(vec1.y - vec2.y, vec1.x - vec2.x); + } } -#pragma pop - -/* ############################################################################################## */ -/* 80BF1DAC-80BF1DB0 00001C 0004+00 0/1 0/0 0/0 .rodata @3727 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3727 = 70.0f; -COMPILER_STRIP_GATE(0x80BF1DAC, &lit_3727); -#pragma pop - -/* 80BF1DB0-80BF1DB4 000020 0004+00 0/4 0/0 0/0 .rodata @3728 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3728 = -1.0f; -COMPILER_STRIP_GATE(0x80BF1DB0, &lit_3728); -#pragma pop /* 80BF09A4-80BF0AD0 000384 012C+00 1/1 0/0 0/0 .text food_carry__FP14obj_food_class */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void food_carry(obj_food_class* param_0) { - nofralloc -#include "asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/food_carry__FP14obj_food_class.s" + +static void food_carry(obj_food_class* i_this) { + fopAc_ac_c* player = dComIfGp_getPlayer(0); + i_this->speed.y = 0.0f; + + if (!fopAcM_checkCarryNow(i_this)) { + i_this->mCcSph.OnCoSetBit(); + if (i_this->speedF > 0.0f) { + i_this->speedF = 70.0f; + i_this->speed.y = 50.0f; + fopAcM_SetFoodStatus(i_this, fopAcM_FOOD_1); + i_this->mRotSpeed.z = -0x1200; + i_this->mRotSpeed.y = 0; + i_this->current.angle.y = player->shape_angle.y; + i_this->shape_angle.y = player->shape_angle.y + 0x4000; + i_this->mBounces = 0; + } else { + fopAcM_SetFoodStatus(i_this, fopAcM_FOOD_0); + Z2GetAudioMgr()->seStart(Z2SE_OBJ_TOY_BONE_PUT, &i_this->current.pos, + 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); + i_this->mBounces = 3; + } + fopAcM_carryOffRevise(i_this); + } + + cLib_addCalcAngleS2(&i_this->mGroundAngleX, 0, 1, 0x800); + cLib_addCalcAngleS2(&i_this->mGroundAngleZ, 0, 1, 0x800); } -#pragma pop - -/* ############################################################################################## */ -/* 80BF1DB4-80BF1DB8 000024 0004+00 0/1 0/0 0/0 .rodata @3782 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3782 = 2.0f; -COMPILER_STRIP_GATE(0x80BF1DB4, &lit_3782); -#pragma pop - -/* 80BF1DB8-80BF1DBC 000028 0004+00 0/2 0/0 0/0 .rodata @3783 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3783 = -20.0f; -COMPILER_STRIP_GATE(0x80BF1DB8, &lit_3783); -#pragma pop - -/* 80BF1DBC-80BF1DC0 00002C 0004+00 0/2 0/0 0/0 .rodata @3784 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3784 = 15.0f; -COMPILER_STRIP_GATE(0x80BF1DBC, &lit_3784); -#pragma pop - -/* 80BF1DC0-80BF1DC4 000030 0004+00 0/2 0/0 0/0 .rodata @3785 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3785 = 100.0f; -COMPILER_STRIP_GATE(0x80BF1DC0, &lit_3785); -#pragma pop /* 80BF0AD0-80BF0C74 0004B0 01A4+00 2/2 0/0 0/0 .text wall_angle_get__FP14obj_food_class */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void wall_angle_get(obj_food_class* param_0) { - nofralloc -#include "asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/wall_angle_get__FP14obj_food_class.s" +static s16 wall_angle_get(obj_food_class* i_this) { + fopAc_ac_c* _this = static_cast(i_this); + dBgS_LinChk lin_chk; + cXyz vec1[2], vec2, vec3; + cMtx_YrotS(*calc_mtx, _this->current.angle.y); + + vec2.x = 0.0f; + vec2.y = 2.0f; + vec2.z = -20.0f; + MtxPosition(&vec2, &vec3); + vec3 += _this->current.pos; + + vec2.x = 15.0f; + vec2.y = 2.0f; + vec2.z = 100.0f; + + for (int i = 0; i < 2; i++) { + MtxPosition(&vec2, &vec1[i]); + vec2.x *= -1.0f; + vec1[i] += vec3; + + lin_chk.Set(&vec3, &vec1[i], _this); + if (dComIfG_Bgsp().LineCross(&lin_chk)) { + vec1[i] = lin_chk.i_GetCross(); + } else { + return 0x23; + } + } + + vec2 = vec1[1] - vec1[0]; + return cM_atan2s(vec2.x, vec2.z) + 0x4000; } -#pragma pop - -/* ############################################################################################## */ -/* 80BF1DC4-80BF1DC8 000034 0004+00 0/2 0/0 0/0 .rodata @3875 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3875 = 3.0f / 5.0f; -COMPILER_STRIP_GATE(0x80BF1DC4, &lit_3875); -#pragma pop - -/* 80BF1DC8-80BF1DCC 000038 0004+00 0/1 0/0 0/0 .rodata @3876 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3876 = -40.0f; -COMPILER_STRIP_GATE(0x80BF1DC8, &lit_3876); -#pragma pop - -/* 80BF1DCC-80BF1DD0 00003C 0004+00 0/2 0/0 0/0 .rodata @3877 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3877 = -0.5f; -COMPILER_STRIP_GATE(0x80BF1DCC, &lit_3877); -#pragma pop - -/* 80BF1DD0-80BF1DD4 000040 0004+00 0/2 0/0 0/0 .rodata @3878 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3878 = 8000.0f; -COMPILER_STRIP_GATE(0x80BF1DD0, &lit_3878); -#pragma pop - -/* 80BF1DD4-80BF1DD8 000044 0004+00 0/2 0/0 0/0 .rodata @3879 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3879 = 0.5f; -COMPILER_STRIP_GATE(0x80BF1DD4, &lit_3879); -#pragma pop - -/* 80BF1DD8-80BF1DDC 000048 0004+00 0/1 0/0 0/0 .rodata @3880 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3880 = 1.0f / 5.0f; -COMPILER_STRIP_GATE(0x80BF1DD8, &lit_3880); -#pragma pop - -/* 80BF1DDC-80BF1DE0 00004C 0004+00 0/2 0/0 0/0 .rodata @3881 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3881 = 20.0f; -COMPILER_STRIP_GATE(0x80BF1DDC, &lit_3881); -#pragma pop - -/* 80BF1DE0-80BF1DE4 000050 0004+00 0/1 0/0 0/0 .rodata @3882 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3882 = 20000.0f; -COMPILER_STRIP_GATE(0x80BF1DE0, &lit_3882); -#pragma pop - -/* 80BF1DE4-80BF1DE8 000054 0004+00 0/2 0/0 0/0 .rodata @3883 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3883 = 30.0f; -COMPILER_STRIP_GATE(0x80BF1DE4, &lit_3883); -#pragma pop /* 80BF0C74-80BF0FC0 000654 034C+00 1/1 0/0 0/0 .text food_normal__FP14obj_food_class */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void food_normal(obj_food_class* param_0) { - nofralloc -#include "asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/food_normal__FP14obj_food_class.s" +static void food_normal(obj_food_class* i_this) { + if (i_this->mAcch.ChkGroundHit()) { + fopAcM_SetFoodStatus(i_this, fopAcM_FOOD_0); + if (i_this->mBounces >= 3) { + cLib_onBit(i_this->attention_info.flags, 0x10); + i_this->speedF = 0.0f; + + if (fopAcM_checkCarryNow(i_this)) { + fopAcM_SetFoodStatus(i_this, fopAcM_FOOD_2); + i_this->mBounces = 0; + i_this->mCcSph.OffCoSetBit(); + } + + s16 target_angle; + if (i_this->shape_angle.z < 0x4000 && i_this->shape_angle.z > -0x4000) { + target_angle = 0; + } else { + target_angle = -0x8000; + } + cLib_addCalcAngleS2(&i_this->shape_angle.z, target_angle, 1, 0x1000); + } else { + i_this->mBounces++; + + if (i_this->speedF > 1.0f) { + i_this->speedF *= 0.6f; + } else if (i_this->mOldSpeedY < -40.0f) { + i_this->speedF = cM_rndF(15.0f); + } + i_this->speed.y = i_this->mOldSpeedY * -0.5f; + + Z2GetAudioMgr()->seStart(Z2SE_OBJ_TOY_BONE_BOUND, &i_this->current.pos, + fabsf(i_this->mOldSpeedY), 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); + + i_this->current.angle.y += (s16)cM_rndFX(8000.0f); + + if (i_this->mBounces == 3) { + i_this->mRotSpeed.z = 0; + i_this->mRotSpeed.y = 0; + } else { + i_this->mRotSpeed.y = cM_rndFX(8000.0f); + i_this->mRotSpeed.z = cM_rndFX(8000.0f); + } + } + } else { + if (i_this->mTimer[1] == 0 && i_this->mAcch.ChkWallHit()) { + s16 wall_angle = wall_angle_get(i_this); + if (wall_angle != 0x23) { + s16 refl_angle = 0x8000 - (s16)(i_this->current.angle.y - wall_angle) * 2; + i_this->current.angle.y += refl_angle; + i_this->speedF *= (f32)fabs(cM_scos(refl_angle / 2) * 0.5f) + 0.2f; + i_this->speed.y = 0.0f; + i_this->mTimer[1] = 10; + Z2GetAudioMgr()->seStart(Z2SE_OBJ_TOY_BONE_BOUND, &i_this->current.pos, + i_this->speedF, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); + } + } + + i_this->shape_angle.y += i_this->mRotSpeed.y; + i_this->shape_angle.z += i_this->mRotSpeed.z; + + cXyz pos = i_this->current.pos; + if (i_this->mBounces != 0 || i_this->speedF < 20.0f) { + pos.z += 20000.0f; + } + i_this->mAtSph.SetC(pos); + i_this->mAtSph.SetR(30.0f); + dComIfG_Ccsp()->Set(&i_this->mAtSph); + } } -#pragma pop - -/* ############################################################################################## */ -/* 80BF1DE8-80BF1DEC 000058 0004+00 0/2 0/0 0/0 .rodata @3922 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3922 = 3.0f; -COMPILER_STRIP_GATE(0x80BF1DE8, &lit_3922); -#pragma pop - -/* 80BF1DEC-80BF1DF0 00005C 0004+00 0/2 0/0 0/0 .rodata @3923 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3923 = 6.0f; -COMPILER_STRIP_GATE(0x80BF1DEC, &lit_3923); -#pragma pop - -/* 80BF1DF0-80BF1DF4 000060 0004+00 0/1 0/0 0/0 .rodata @3924 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3924 = 2.5f; -COMPILER_STRIP_GATE(0x80BF1DF0, &lit_3924); -#pragma pop /* 80BF0FC0-80BF1168 0009A0 01A8+00 1/1 0/0 0/0 .text ball_move__FP14obj_food_class */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void ball_move(obj_food_class* param_0) { - nofralloc -#include "asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/ball_move__FP14obj_food_class.s" +static void ball_move(obj_food_class* i_this) { + if (i_this->mTimer[0] == 0 && (i_this->mCcSph.ChkTgHit() || i_this->mCcSph.ChkCoHit())) { + cCcD_Obj* hit_obj; + if (i_this->mCcSph.ChkTgHit()) { + hit_obj = i_this->mCcSph.GetTgHitObj(); + } else { + hit_obj = i_this->mCcSph.GetCoHitObj(); + } + fopAc_ac_c* actor = dCc_GetAc(hit_obj->GetAc()); + + cXyz vec = i_this->current.pos - actor->current.pos; + i_this->current.angle.y = cM_atan2s(vec.x, vec.z) + (s16)cM_rndFX(8000.0f); + i_this->mTimer[0] = 10; + if (actor->field_0x560 == 0x23) { + i_this->speedF = cM_rndF(1.0f) + 3.0f; + } else { + i_this->speedF = cM_rndF(2.5f) + 6.0f; + } + } + + if (i_this->mAcch.ChkWallHit() && i_this->mTimer[1] == 0) { + i_this->mTimer[1] = 10; + s16 wall_angle = wall_angle_get(i_this); + if (wall_angle != 0x23) { + s16 refl_angle = 0x8000 - (s16)(i_this->current.angle.y - wall_angle) * 2; + i_this->current.angle.y += refl_angle; + i_this->speedF *= 0.5f; + } + } + + if (i_this->mAcch.ChkGroundHit()) { + cLib_addCalc0(&i_this->speedF, 1.0f, 0.5f); + } } -#pragma pop - -/* ############################################################################################## */ -/* 80BF1DF4-80BF1DF8 000064 0004+00 0/1 0/0 0/0 .rodata @4085 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4085 = 700.0f; -COMPILER_STRIP_GATE(0x80BF1DF4, &lit_4085); -#pragma pop - -/* 80BF1DF8-80BF1DFC 000068 0004+00 0/1 0/0 0/0 .rodata @4086 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4086 = 12.0f; -COMPILER_STRIP_GATE(0x80BF1DF8, &lit_4086); -#pragma pop - -/* 80BF1DFC-80BF1E00 00006C 0004+00 0/1 0/0 0/0 .rodata @4087 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4087 = 7.0f / 10.0f; -COMPILER_STRIP_GATE(0x80BF1DFC, &lit_4087); -#pragma pop - -/* 80BF1E00-80BF1E04 000070 0004+00 0/1 0/0 0/0 .rodata @4088 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4088 = -8.0f; -COMPILER_STRIP_GATE(0x80BF1E00, &lit_4088); -#pragma pop - -/* 80BF1E04-80BF1E08 000074 0004+00 0/2 0/0 0/0 .rodata @4089 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4089 = -5.0f; -COMPILER_STRIP_GATE(0x80BF1E04, &lit_4089); -#pragma pop - -/* 80BF1E08-80BF1E0C 000078 0004+00 0/2 0/0 0/0 .rodata @4090 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4090 = -90.0f; -COMPILER_STRIP_GATE(0x80BF1E08, &lit_4090); -#pragma pop - -/* 80BF1E0C-80BF1E10 00007C 0004+00 0/1 0/0 0/0 .rodata @4091 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4091 = 5.0f; -COMPILER_STRIP_GATE(0x80BF1E0C, &lit_4091); -#pragma pop - -/* 80BF1F40-80BF1F44 000008 0004+00 2/2 0/0 0/0 .bss None */ -static u8 data_80BF1F40[4]; - -/* 80BF1F44-80BF1F50 00000C 000C+00 1/1 0/0 0/0 .bss @3642 */ -static u8 lit_3642[12]; - -/* 80BF1F50-80BF1F5C 000018 000C+00 3/3 0/0 0/0 .bss l_HIO */ -static u8 l_HIO[12]; /* 80BF1168-80BF1700 000B48 0598+00 1/1 0/0 0/0 .text action__FP14obj_food_class */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void action(obj_food_class* param_0) { - nofralloc -#include "asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/action__FP14obj_food_class.s" +static void action(obj_food_class* i_this) { + cXyz vec1, vec2; + + switch (i_this->field_0x567) { + case fopAcM_FOOD_0: + food_normal(i_this); + break; + case fopAcM_FOOD_1: + food_normal(i_this); + cLib_offBit(i_this->attention_info.flags, 0x10); + break; + case fopAcM_FOOD_2: + food_carry(i_this); + cLib_offBit(i_this->attention_info.flags, 0x10); + break; + case fopAcM_FOOD_3: + cLib_offBit(i_this->attention_info.flags, 0x10); + break; + case fopAcM_FOOD_4: + fopAcM_SetFoodStatus(i_this, fopAcM_FOOD_0); + i_this->mBounces = 0; + break; + case fopAcM_FOOD_5: + ball_move(i_this); + break; + } + + if (i_this->mType == obj_food_class::TYPE_BALL) { + i_this->current.angle.x += (s16)(i_this->speedF * 700.0f); + cMtx_YrotS(*calc_mtx, i_this->current.angle.y); + vec1.x = 0.0f; + vec1.y = 0.0f; + vec1.z = i_this->speedF; + MtxPosition(&vec1, &vec2); + i_this->speed.x = vec2.x; + i_this->speed.z = vec2.z; + i_this->current.pos += i_this->speed; + i_this->speed.y -= 3.0f; + + i_this->current.pos.y -= 12.0f; + i_this->old.pos.y -= 12.0f; + i_this->mAcch.CrrPos(dComIfG_Bgsp()); + i_this->current.pos.y += 12.0f; + i_this->old.pos.y += 12.0f; + + mDoMtx_stack_c::transS(i_this->current.pos.x, i_this->current.pos.y, i_this->current.pos.z); + mDoMtx_stack_c::YrotM(i_this->current.angle.y); + mDoMtx_stack_c::XrotM(i_this->current.angle.x); + mDoMtx_stack_c::scaleM(0.6f, 0.6f, 0.6f); + mDoMtx_stack_c::transM(0.0f, -20.0f, 0.0f); + i_this->mpModel->setBaseTRMtx(mDoMtx_stack_c::get()); + + cXyz vec3(0.0f, 12.0f, 0.0f); + i_this->mCcSph.SetC(i_this->current.pos + vec3); + i_this->mCcSph.SetR(6.0f); + dComIfG_Ccsp()->Set(&i_this->mCcSph); + } else if (!fopAcM_CheckFoodStatus(i_this, fopAcM_FOOD_3)) { + cMtx_YrotS(*calc_mtx, i_this->current.angle.y); + vec1.x = 0.0f; + vec1.y = 0.0f; + vec1.z = i_this->speedF; + MtxPosition(&vec1, &vec2); + i_this->speed.x = vec2.x; + i_this->speed.z = vec2.z; + i_this->speed.y += i_this->gravity; + i_this->current.pos += i_this->speed; + if (i_this->speed.y < i_this->maxFallSpeed) { + i_this->speed.y = i_this->maxFallSpeed; + } + i_this->mOldSpeedY = i_this->speed.y; + + cXyz vec3 = i_this->current.pos; + vec3.y += 100.0f; + f32 water_y; + fopAcM_getWaterY(&vec3, &water_y); + + if (i_this->speed.y <= -20.0f + && i_this->current.pos.y < water_y && i_this->old.pos.y >= water_y) + { + cXyz scale(0.7f, 0.7f, 0.7f); + cXyz pos = i_this->current.pos; + pos.y = water_y; + static u16 w_eff_id[4] = {0x1B8, 0x1B9, 0x1BA, 0x1BB}; + for (int i = 0; i < 4; i++) { + i_this->mParticleKey[i] = + dComIfGp_particle_set(i_this->mParticleKey[i], w_eff_id[i], &pos, + &i_this->tevStr, NULL, &scale, 0xff, NULL, -1, + NULL, NULL, NULL); + } + i_this->mSound.startSound(Z2SE_CM_BODYFALL_WATER_S, 0, -1); + i_this->speed.y = -1.0f; + i_this->mRotSpeed.z = 0; + i_this->mRotSpeed.y = 0; + i_this->speedF = 0.0f; + } + + if (i_this->current.pos.y <= water_y) { + i_this->gravity = -0.5f; + i_this->maxFallSpeed = -8.0f; + } else { + i_this->gravity = -5.0f; + i_this->maxFallSpeed = -90.0f; + } + + i_this->mAcch.CrrPos(dComIfG_Bgsp()); + if (i_this->mAcch.ChkGroundHit()) { + ground_ang_set(i_this); + } + + mDoMtx_stack_c::transS(i_this->current.pos.x, + i_this->current.pos.y + 5.0f, + i_this->current.pos.z); + mDoMtx_stack_c::XrotM(i_this->mGroundAngleX); + mDoMtx_stack_c::ZrotM(i_this->mGroundAngleZ); + mDoMtx_stack_c::YrotM(i_this->shape_angle.y); + mDoMtx_stack_c::XrotM(i_this->shape_angle.x); + mDoMtx_stack_c::ZrotM(i_this->shape_angle.z); + mDoMtx_stack_c::transM(0.0f, 0.0f, -5.0f); + mDoMtx_stack_c::scaleM(l_HIO.mBoneScale, l_HIO.mBoneScale, l_HIO.mBoneScale); + i_this->mpModel->setBaseTRMtx(mDoMtx_stack_c::get()); + } else { + fopAcM_SetFoodStatus(i_this, fopAcM_FOOD_4); + } + + i_this->attention_info.position = i_this->eyePos = i_this->current.pos; } -#pragma pop /* 80BF1700-80BF1794 0010E0 0094+00 2/1 0/0 0/0 .text daObj_Food_Execute__FP14obj_food_class */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void daObj_Food_Execute(obj_food_class* param_0) { - nofralloc -#include "asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/daObj_Food_Execute__FP14obj_food_class.s" +static int daObj_Food_Execute(obj_food_class* i_this) { + i_this->mCounter++; + for (int i = 0; i < 4; i++) { + if (i_this->mTimer[i] != 0) { + i_this->mTimer[i]--; + } + } + action(i_this); + i_this->mSound.framework(0, dComIfGp_getReverb(fopAcM_GetRoomNo(i_this))); + return 1; } -#pragma pop /* 80BF1794-80BF179C 001174 0008+00 1/0 0/0 0/0 .text daObj_Food_IsDelete__FP14obj_food_class */ -static bool daObj_Food_IsDelete(obj_food_class* param_0) { - return true; +static int daObj_Food_IsDelete(obj_food_class* i_this) { + return 1; } -/* ############################################################################################## */ -/* 80BF1E10-80BF1E10 000080 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ -#pragma push -#pragma force_active on -SECTION_DEAD static char const* const stringBase_80BF1E10 = "Obj_fd"; -#pragma pop - /* 80BF179C-80BF1804 00117C 0068+00 1/0 0/0 0/0 .text daObj_Food_Delete__FP14obj_food_class */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void daObj_Food_Delete(obj_food_class* param_0) { - nofralloc -#include "asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/daObj_Food_Delete__FP14obj_food_class.s" +static int daObj_Food_Delete(obj_food_class* i_this) { + dComIfG_resDelete(&i_this->mPhase, "Obj_fd"); + if (i_this->mHIOInit) { + hioInit = false; + } + if (i_this->heap != NULL) { + i_this->mSound.deleteObject(); + } + return 1; } -#pragma pop /* 80BF1804-80BF18CC 0011E4 00C8+00 1/1 0/0 0/0 .text useHeapInit__FP10fopAc_ac_c */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void useHeapInit(fopAc_ac_c* param_0) { - nofralloc -#include "asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/useHeapInit__FP10fopAc_ac_c.s" +static int useHeapInit(fopAc_ac_c* i_this) { + obj_food_class* _this = static_cast(i_this); + + J3DModelData* model_data; + if (_this->mType == obj_food_class::TYPE_BALL) { + model_data = static_cast(dComIfG_getObjectRes("Obj_fd", 3)); + } else { + model_data = static_cast(dComIfG_getObjectRes("Obj_fd", 4)); + } + + _this->mpModel = mDoExt_J3DModel__create(model_data, 0x80000, 0x11000084); + if (_this->mpModel == NULL) { + return 0; + } + + _this->mSound.init(&_this->current.pos, 1); + return 1; } -#pragma pop /* 80BF18CC-80BF1BE8 0012AC 031C+00 1/0 0/0 0/0 .text daObj_Food_Create__FP10fopAc_ac_c */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void daObj_Food_Create(fopAc_ac_c* param_0) { - nofralloc -#include "asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/daObj_Food_Create__FP10fopAc_ac_c.s" +static cPhs__Step daObj_Food_Create(fopAc_ac_c* i_this) { + obj_food_class* _this = static_cast(i_this); + fopAcM_SetupActor(i_this, obj_food_class); + + cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&_this->mPhase, "Obj_fd"); + if (step == cPhs_COMPLEATE_e) { + _this->mType = (u8)fopAcM_GetParam(_this); + _this->mParam1 = (u8)(fopAcM_GetParam(_this) >> 8); + _this->mParam2 = (u8)(fopAcM_GetParam(_this) >> 0x10); + if (_this->mType == 0xff) { + _this->mType = obj_food_class::TYPE_BONE; + } + + if (!fopAcM_entrySolidHeap(_this, useHeapInit, 0x810)) { + return cPhs_ERROR_e; + } + + if (!hioInit) { + _this->mHIOInit = true; + hioInit = true; + l_HIO.field_0x4 = -1; + } + + fopAcM_SetMtx(_this, _this->mpModel->getBaseTRMtx()); + _this->mCcStts.Init(10, 0, _this); + + static dCcD_SrcSph cc_sph_src = { + { + {0x0, {{0x0, 0x0, 0x0}, {0xd8fbfdff, 0x3}, 0x75}}, // mObj + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x2}, // mGObjTg + {0x0}, // mGObjCo + }, // mObjInf + { + {{0.0f, 0.0f, 0.0f}, 20.0f} // mSph + } // mSphAttr + }; + _this->mCcSph.Set(cc_sph_src); + _this->mCcSph.SetStts(&_this->mCcStts); + + _this->mAcch.Set(fopAcM_GetPosition_p(_this), fopAcM_GetOldPosition_p(_this), _this, 1, + &_this->mAcchCir, fopAcM_GetSpeed_p(_this), NULL, NULL); + + if (_this->mType == obj_food_class::TYPE_BALL) { + _this->mAcchCir.SetWall(20.0f, 20.0f); + fopAcM_SetFoodStatus(_this, fopAcM_FOOD_5); + } else { + _this->mAcchCir.SetWall(30.0f, 30.0f); + _this->attention_info.field_0x0[4] = 7; + _this->gravity = -5.0f; + fopAcM_SetFoodStatus(_this, fopAcM_FOOD_0); + fopAcM_OnCarryType(_this, fopAcM_CARRY_UNK_30); + + static dCcD_SrcSph at_sph_src = { + { + {0x0, {{AT_TYPE_THROW_OBJ, 0x0, 0x1f}, {0x0, 0x0}, 0x0}}, // mObj + {dCcD_SE_NONE, 0x1, 0x0, 0x0, 0x0}, // mGObjAt + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x2}, // mGObjTg + {0x0}, // mGObjCo + }, // mObjInf + { + {{0.0f, 0.0f, 0.0f}, 15.0f} // mSph + } // mSphAttr + }; + _this->mAtSph.Set(at_sph_src); + _this->mAtSph.SetStts(&_this->mCcStts); + _this->mAtSph.OffAtVsPlayerBit(); + } + + _this->gravity = -5.0f; + _this->maxFallSpeed = -90.0f; + + daObj_Food_Execute(_this); + } + + return step; } -#pragma pop -/* 80BF1BE8-80BF1C30 0015C8 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGSphFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -// asm cM3dGSph::~cM3dGSph() { -extern "C" asm void __dt__8cM3dGSphFv() { - nofralloc -#include "asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/__dt__8cM3dGSphFv.s" -} -#pragma pop +/* 80BF1EA0-80BF1EC0 -00001 0020+00 1/0 0/0 0/0 .data l_daObj_Food_Method */ +static actor_method_class l_daObj_Food_Method = { + (process_method_func)daObj_Food_Create, + (process_method_func)daObj_Food_Delete, + (process_method_func)daObj_Food_Execute, + (process_method_func)daObj_Food_IsDelete, + (process_method_func)daObj_Food_Draw, +}; -/* 80BF1C30-80BF1C78 001610 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGAabFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -// asm cM3dGAab::~cM3dGAab() { -extern "C" asm void __dt__8cM3dGAabFv() { - nofralloc -#include "asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/__dt__8cM3dGAabFv.s" -} -#pragma pop - -/* 80BF1C78-80BF1CE8 001658 0070+00 3/2 0/0 0/0 .text __dt__12dBgS_ObjAcchFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm dBgS_ObjAcch::~dBgS_ObjAcch() { - nofralloc -#include "asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/__dt__12dBgS_ObjAcchFv.s" -} -#pragma pop - -/* 80BF1CE8-80BF1D30 0016C8 0048+00 2/1 0/0 0/0 .text __dt__16daObj_Food_HIO_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm daObj_Food_HIO_c::~daObj_Food_HIO_c() { - nofralloc -#include "asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/__dt__16daObj_Food_HIO_cFv.s" -} -#pragma pop - -/* 80BF1D30-80BF1D6C 001710 003C+00 0/0 1/0 0/0 .text __sinit_d_a_obj_food_cpp */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void __sinit_d_a_obj_food_cpp() { - nofralloc -#include "asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/__sinit_d_a_obj_food_cpp.s" -} -#pragma pop - -#pragma push -#pragma force_active on -REGISTER_CTORS(0x80BF1D30, __sinit_d_a_obj_food_cpp); -#pragma pop - -/* 80BF1D6C-80BF1D74 00174C 0008+00 1/0 0/0 0/0 .text @36@__dt__12dBgS_ObjAcchFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void func_80BF1D6C() { - nofralloc -#include "asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/func_80BF1D6C.s" -} -#pragma pop - -/* 80BF1D74-80BF1D7C 001754 0008+00 1/0 0/0 0/0 .text @20@__dt__12dBgS_ObjAcchFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void func_80BF1D74() { - nofralloc -#include "asm/rel/d/a/obj/d_a_obj_food/d_a_obj_food/func_80BF1D74.s" -} -#pragma pop - -/* 80BF1E10-80BF1E10 000080 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ +/* 80BF1EC0-80BF1EF0 -00001 0030+00 0/0 0/0 1/0 .data g_profile_OBJ_FOOD */ +extern actor_process_profile_definition g_profile_OBJ_FOOD = { + fpcLy_CURRENT_e, + 7, + fpcPi_CURRENT_e, + PROC_OBJ_FOOD, + &g_fpcLf_Method.mBase, + sizeof(obj_food_class), + 0, + 0, + &g_fopAc_Method.base, + 0x2C8, + &l_daObj_Food_Method, + 0x44100, + fopAc_ACTOR_e, + fopAc_CULLBOX_0_e, +};