From 9a19ec0c134699c8fd893336345d5fc953a38581 Mon Sep 17 00:00:00 2001 From: Howard Luck Date: Sun, 21 Sep 2025 10:00:19 -0600 Subject: [PATCH] d_a_obj_bemos equivalent (#2679) * checkpoint * e_wb changes * checkpoint * small fix * d_a_obj_bemos equivalent * add comment, fix other version symbols * fixes for hatal --- config/GZ2E01/rels/d_a_obj_bemos/symbols.txt | 83 +- config/GZ2J01/rels/d_a_obj_bemos/symbols.txt | 83 +- config/GZ2P01/rels/d_a_obj_bemos/symbols.txt | 83 +- configure.py | 2 +- include/d/actor/d_a_e_wb.h | 67 +- include/d/actor/d_a_obj_bemos.h | 194 +- src/d/actor/d_a_e_rd.cpp | 86 +- src/d/actor/d_a_e_wb.cpp | 865 ++--- src/d/actor/d_a_obj_bemos.cpp | 3302 +++++++++--------- src/d/d_a_horse_static.cpp | 6 +- src/m_Do/m_Do_mtx.cpp | 14 + 11 files changed, 2458 insertions(+), 2327 deletions(-) diff --git a/config/GZ2E01/rels/d_a_obj_bemos/symbols.txt b/config/GZ2E01/rels/d_a_obj_bemos/symbols.txt index 2457efaead1..b86ab75819a 100644 --- a/config/GZ2E01/rels/d_a_obj_bemos/symbols.txt +++ b/config/GZ2E01/rels/d_a_obj_bemos/symbols.txt @@ -4,7 +4,7 @@ _unresolved = .text:0x00000058; // type:function size:0x20 scope:global __register_global_object = .text:0x00000078; // type:function size:0x1C scope:global __destroy_global_chain = .text:0x00000094; // type:function size:0x58 scope:global PPCallBack__9daObjBm_cFP10fopAc_ac_cP10fopAc_ac_csQ29dBgW_Base13PushPullLabel = .text:0x000000EC; // type:function size:0x13C scope:global -nodeCallBack__FP8J3DJointi = .text:0x00000228; // type:function size:0x154 scope:global +nodeCallBack__FP8J3DJointi = .text:0x00000228; // type:function size:0x154 scope:local initBaseMtx__9daObjBm_cFv = .text:0x0000037C; // type:function size:0x90 scope:global setBaseMtx__9daObjBm_cFv = .text:0x0000040C; // type:function size:0xEC scope:global Create__9daObjBm_cFv = .text:0x000004F8; // type:function size:0x364 scope:global @@ -90,11 +90,11 @@ _ctors = .ctors:0x00000000; // type:label scope:global __destroy_global_chain_reference = .dtors:0x00000000; // type:object size:0x4 scope:global _dtors = .dtors:0x00000000; // type:label scope:global ...rodata.0 = .rodata:0x00000000; // type:label scope:local -l_eye_offset = .rodata:0x00000000; // type:object size:0xC scope:global -l_high_beam_offset = .rodata:0x0000000C; // type:object size:0xC scope:global -l_mid_beam_offset = .rodata:0x00000018; // type:object size:0xC scope:global -l_low_beam_offset = .rodata:0x00000024; // type:object size:0xC scope:global -l_craw_offset = .rodata:0x00000030; // type:object size:0x30 scope:global +l_eye_offset = .rodata:0x00000000; // type:object size:0xC scope:local +l_high_beam_offset = .rodata:0x0000000C; // type:object size:0xC scope:local +l_mid_beam_offset = .rodata:0x00000018; // type:object size:0xC scope:local +l_low_beam_offset = .rodata:0x00000024; // type:object size:0xC scope:local +l_craw_offset = .rodata:0x00000030; // type:object size:0x30 scope:local M_dir_base__9daObjBm_c = .rodata:0x00000060; // type:object size:0x8 scope:global @3933 = .rodata:0x00000068; // type:object size:0x4 scope:local align:4 data:float @3934 = .rodata:0x0000006C; // type:object size:0x4 scope:local align:4 data:float @@ -136,21 +136,22 @@ l_eff_id2$5639 = .rodata:0x00000278; // type:object size:0x6 scope:local @5876 = .rodata:0x00000284; // type:object size:0x4 scope:local @stringBase0 = .rodata:0x00000288; // type:object size:0x34 scope:local data:string_table ...data.0 = .data:0x00000000; // type:label scope:local -cNullVec__6Z2Calc = .data:0x00000000; // type:object size:0xC scope:global +cNullVec__6Z2Calc = .data:0x00000000; // type:object size:0xC scope:local @1787 = .data:0x0000000C; // type:object size:0x4 scope:local -lbl_406_data_10 = .data:0x00000010; // type:object size:0x10 -l_arcName = .data:0x00000020; // type:object size:0x4 scope:global data:4byte -l_eye_matName = .data:0x00000024; // type:object size:0x4 scope:global -l_head_joint = .data:0x00000028; // type:object size:0x4 scope:global -l_bigGear_joint = .data:0x0000002C; // type:object size:0x4 scope:global -l_smallGear0_joint = .data:0x00000030; // type:object size:0x4 scope:global -l_smallGear1_joint = .data:0x00000034; // type:object size:0x4 scope:global -l_smallGear2_joint = .data:0x00000038; // type:object size:0x4 scope:global -l_joint_table = .data:0x0000003C; // type:object size:0x14 scope:global -l_cull_box = .data:0x00000050; // type:object size:0x18 scope:global -l_sph_src = .data:0x00000068; // type:object size:0x40 scope:global -l_cps_src = .data:0x000000A8; // type:object size:0x4C scope:global -l_cyl_src = .data:0x000000F4; // type:object size:0x44 scope:global +_three$localstatic4$sqrtf = .data:0x00000010; // type:object size:0x8 +_half$localstatic3$sqrtf = .data:0x00000018; // type:object size:0x8 +l_arcName = .data:0x00000020; // type:object size:0x4 scope:local data:4byte +l_eye_matName = .data:0x00000024; // type:object size:0x4 scope:local +l_head_joint = .data:0x00000028; // type:object size:0x4 scope:local +l_bigGear_joint = .data:0x0000002C; // type:object size:0x4 scope:local +l_smallGear0_joint = .data:0x00000030; // type:object size:0x4 scope:local +l_smallGear1_joint = .data:0x00000034; // type:object size:0x4 scope:local +l_smallGear2_joint = .data:0x00000038; // type:object size:0x4 scope:local +l_joint_table = .data:0x0000003C; // type:object size:0x14 scope:local +l_cull_box = .data:0x00000050; // type:object size:0x18 scope:local +l_sph_src = .data:0x00000068; // type:object size:0x40 scope:local +l_cps_src = .data:0x000000A8; // type:object size:0x4C scope:local +l_cyl_src = .data:0x000000F4; // type:object size:0x44 scope:local @4298 = .data:0x00000138; // type:object size:0xC scope:local @4299 = .data:0x00000144; // type:object size:0xC scope:local l_func$4297 = .data:0x00000150; // type:object size:0x18 scope:local @@ -172,7 +173,7 @@ mode_proc$4406 = .data:0x00000210; // type:object size:0x30 scope:local l_eff_func$4732 = .data:0x00000270; // type:object size:0x30 scope:local M_lin5__Q29daObjBm_c5Bgc_c = .data:0x000002A0; // type:object size:0x50 scope:global @6065 = .data:0x000002F0; // type:object size:0x20 scope:local -daObjBm_METHODS = .data:0x00000310; // type:object size:0x20 scope:global +daObjBm_METHODS = .data:0x00000310; // type:object size:0x20 scope:local g_profile_Obj_Bemos = .data:0x00000330; // type:object size:0x30 scope:global __vt__12dBgS_AcchCir = .data:0x00000360; // type:object size:0xC scope:global __vt__10cCcD_GStts = .data:0x0000036C; // type:object size:0xC scope:global @@ -188,26 +189,26 @@ __vt__14dBgS_ObjGndChk = .data:0x0000040C; // type:object size:0x30 scope:global __vt__11dBgS_WtrChk = .data:0x0000043C; // type:object size:0x30 scope:global __global_destructor_chain = .bss:0x00000000; // type:object size:0x4 scope:global ...bss.0 = .bss:0x00000008; // type:label scope:local -@1109 = .bss:0x00000008; // type:object size:0x1 scope:local data:byte -@1107 = .bss:0x0000000C; // type:object size:0x1 scope:local -@1105 = .bss:0x00000010; // type:object size:0x1 scope:local -@1104 = .bss:0x00000014; // type:object size:0x1 scope:local -@1099 = .bss:0x00000018; // type:object size:0x1 scope:local -@1097 = .bss:0x0000001C; // type:object size:0x1 scope:local -@1095 = .bss:0x00000020; // type:object size:0x1 scope:local -@1094 = .bss:0x00000024; // type:object size:0x1 scope:local -@1057 = .bss:0x00000028; // type:object size:0x1 scope:local -@1055 = .bss:0x0000002C; // type:object size:0x1 scope:local -@1053 = .bss:0x00000030; // type:object size:0x1 scope:local -@1052 = .bss:0x00000034; // type:object size:0x1 scope:local -@1014 = .bss:0x00000038; // type:object size:0x1 scope:local -@1012 = .bss:0x0000003C; // type:object size:0x1 scope:local -@1010 = .bss:0x00000040; // type:object size:0x1 scope:local -@1009 = .bss:0x00000044; // type:object size:0x1 scope:local -lbl_406_bss_45 = .bss:0x00000045; // type:object size:0x1 data:byte -lbl_406_bss_46 = .bss:0x00000046; // type:object size:0x1 data:byte -lbl_406_bss_47 = .bss:0x00000047; // type:object size:0x1 data:byte -lbl_406_bss_48 = .bss:0x00000048; // type:object size:0x1 data:byte +lit_1109 = .bss:0x00000008; // type:object size:0x1 scope:local data:byte +lit_1107 = .bss:0x0000000C; // type:object size:0x1 scope:local +lit_1105 = .bss:0x00000010; // type:object size:0x1 scope:local +lit_1104 = .bss:0x00000014; // type:object size:0x1 scope:local +lit_1099 = .bss:0x00000018; // type:object size:0x1 scope:local +lit_1097 = .bss:0x0000001C; // type:object size:0x1 scope:local +lit_1095 = .bss:0x00000020; // type:object size:0x1 scope:local +lit_1094 = .bss:0x00000024; // type:object size:0x1 scope:local +lit_1057 = .bss:0x00000028; // type:object size:0x1 scope:local +lit_1055 = .bss:0x0000002C; // type:object size:0x1 scope:local +lit_1053 = .bss:0x00000030; // type:object size:0x1 scope:local +lit_1052 = .bss:0x00000034; // type:object size:0x1 scope:local +lit_1014 = .bss:0x00000038; // type:object size:0x1 scope:local +lit_1012 = .bss:0x0000003C; // type:object size:0x1 scope:local +lit_1010 = .bss:0x00000040; // type:object size:0x1 scope:local +lit_1009 = .bss:0x00000044; // type:object size:0x1 scope:local +init$2123 = .bss:0x00000045; // type:object size:0x1 scope:local data:byte +init$2180 = .bss:0x00000046; // type:object size:0x1 scope:local data:byte +init$2232 = .bss:0x00000047; // type:object size:0x1 scope:local data:byte +init$2548 = .bss:0x00000048; // type:object size:0x1 scope:local data:byte @4973 = .bss:0x0000004C; // type:object size:0xC scope:local @4976 = .bss:0x0000005C; // type:object size:0xC scope:local @4977 = .bss:0x00000068; // type:object size:0xC scope:local diff --git a/config/GZ2J01/rels/d_a_obj_bemos/symbols.txt b/config/GZ2J01/rels/d_a_obj_bemos/symbols.txt index e7966ef8536..d29d7230ffe 100644 --- a/config/GZ2J01/rels/d_a_obj_bemos/symbols.txt +++ b/config/GZ2J01/rels/d_a_obj_bemos/symbols.txt @@ -4,7 +4,7 @@ _unresolved = .text:0x00000058; // type:function size:0x20 scope:global __register_global_object = .text:0x00000078; // type:function size:0x1C scope:global __destroy_global_chain = .text:0x00000094; // type:function size:0x58 scope:global PPCallBack__9daObjBm_cFP10fopAc_ac_cP10fopAc_ac_csQ29dBgW_Base13PushPullLabel = .text:0x000000EC; // type:function size:0x13C scope:global -nodeCallBack__FP8J3DJointi = .text:0x00000228; // type:function size:0x154 scope:global +nodeCallBack__FP8J3DJointi = .text:0x00000228; // type:function size:0x154 scope:local initBaseMtx__9daObjBm_cFv = .text:0x0000037C; // type:function size:0x90 scope:global setBaseMtx__9daObjBm_cFv = .text:0x0000040C; // type:function size:0xEC scope:global Create__9daObjBm_cFv = .text:0x000004F8; // type:function size:0x364 scope:global @@ -90,11 +90,11 @@ _ctors = .ctors:0x00000000; // type:label scope:global __destroy_global_chain_reference = .dtors:0x00000000; // type:object size:0x4 scope:global _dtors = .dtors:0x00000000; // type:label scope:global ...rodata.0 = .rodata:0x00000000; // type:label scope:local -l_eye_offset = .rodata:0x00000000; // type:object size:0xC scope:global -l_high_beam_offset = .rodata:0x0000000C; // type:object size:0xC scope:global -l_mid_beam_offset = .rodata:0x00000018; // type:object size:0xC scope:global -l_low_beam_offset = .rodata:0x00000024; // type:object size:0xC scope:global -l_craw_offset = .rodata:0x00000030; // type:object size:0x30 scope:global +l_eye_offset = .rodata:0x00000000; // type:object size:0xC scope:local +l_high_beam_offset = .rodata:0x0000000C; // type:object size:0xC scope:local +l_mid_beam_offset = .rodata:0x00000018; // type:object size:0xC scope:local +l_low_beam_offset = .rodata:0x00000024; // type:object size:0xC scope:local +l_craw_offset = .rodata:0x00000030; // type:object size:0x30 scope:local M_dir_base__9daObjBm_c = .rodata:0x00000060; // type:object size:0x8 scope:global @3933 = .rodata:0x00000068; // type:object size:0x4 scope:local align:4 data:float @3934 = .rodata:0x0000006C; // type:object size:0x4 scope:local align:4 data:float @@ -135,21 +135,22 @@ l_eff_id2$5639 = .rodata:0x00000278; // type:object size:0x6 scope:local @5875 = .rodata:0x00000280; // type:object size:0x4 scope:local @5876 = .rodata:0x00000284; // type:object size:0x4 scope:local @stringBase0 = .rodata:0x00000288; // type:object size:0x34 scope:local data:string_table -cNullVec__6Z2Calc = .data:0x00000000; // type:object size:0xC scope:global +cNullVec__6Z2Calc = .data:0x00000000; // type:object size:0xC scope:local @1787 = .data:0x0000000C; // type:object size:0x4 scope:local -lbl_406_data_10 = .data:0x00000010; // type:object size:0x10 -l_arcName = .data:0x00000020; // type:object size:0x4 scope:global data:4byte -l_eye_matName = .data:0x00000024; // type:object size:0x4 scope:global -l_head_joint = .data:0x00000028; // type:object size:0x4 scope:global -l_bigGear_joint = .data:0x0000002C; // type:object size:0x4 scope:global -l_smallGear0_joint = .data:0x00000030; // type:object size:0x4 scope:global -l_smallGear1_joint = .data:0x00000034; // type:object size:0x4 scope:global -l_smallGear2_joint = .data:0x00000038; // type:object size:0x4 scope:global -l_joint_table = .data:0x0000003C; // type:object size:0x14 scope:global -l_cull_box = .data:0x00000050; // type:object size:0x18 scope:global -l_sph_src = .data:0x00000068; // type:object size:0x40 scope:global -l_cps_src = .data:0x000000A8; // type:object size:0x4C scope:global -l_cyl_src = .data:0x000000F4; // type:object size:0x44 scope:global +_three$localstatic4$sqrtf = .data:0x00000010; // type:object size:0x8 +_half$localstatic3$sqrtf = .data:0x00000018; // type:object size:0x8 +l_arcName = .data:0x00000020; // type:object size:0x4 scope:local data:4byte +l_eye_matName = .data:0x00000024; // type:object size:0x4 scope:local +l_head_joint = .data:0x00000028; // type:object size:0x4 scope:local +l_bigGear_joint = .data:0x0000002C; // type:object size:0x4 scope:local +l_smallGear0_joint = .data:0x00000030; // type:object size:0x4 scope:local +l_smallGear1_joint = .data:0x00000034; // type:object size:0x4 scope:local +l_smallGear2_joint = .data:0x00000038; // type:object size:0x4 scope:local +l_joint_table = .data:0x0000003C; // type:object size:0x14 scope:local +l_cull_box = .data:0x00000050; // type:object size:0x18 scope:local +l_sph_src = .data:0x00000068; // type:object size:0x40 scope:local +l_cps_src = .data:0x000000A8; // type:object size:0x4C scope:local +l_cyl_src = .data:0x000000F4; // type:object size:0x44 scope:local @4298 = .data:0x00000138; // type:object size:0xC scope:local @4299 = .data:0x00000144; // type:object size:0xC scope:local l_func$4297 = .data:0x00000150; // type:object size:0x18 scope:local @@ -171,7 +172,7 @@ mode_proc$4406 = .data:0x00000210; // type:object size:0x30 scope:local l_eff_func$4732 = .data:0x00000270; // type:object size:0x30 scope:local M_lin5__Q29daObjBm_c5Bgc_c = .data:0x000002A0; // type:object size:0x50 scope:global @6065 = .data:0x000002F0; // type:object size:0x20 scope:local -daObjBm_METHODS = .data:0x00000310; // type:object size:0x20 scope:global +daObjBm_METHODS = .data:0x00000310; // type:object size:0x20 scope:local g_profile_Obj_Bemos = .data:0x00000330; // type:object size:0x30 scope:global __vt__12dBgS_AcchCir = .data:0x00000360; // type:object size:0xC scope:global __vt__10cCcD_GStts = .data:0x0000036C; // type:object size:0xC scope:global @@ -187,26 +188,26 @@ __vt__14dBgS_ObjGndChk = .data:0x0000040C; // type:object size:0x30 scope:global __vt__11dBgS_WtrChk = .data:0x0000043C; // type:object size:0x30 scope:global __global_destructor_chain = .bss:0x00000000; // type:object size:0x4 scope:global ...bss.0 = .bss:0x00000008; // type:label scope:local -@1109 = .bss:0x00000008; // type:object size:0x1 scope:local data:byte -@1107 = .bss:0x0000000C; // type:object size:0x1 scope:local -@1105 = .bss:0x00000010; // type:object size:0x1 scope:local -@1104 = .bss:0x00000014; // type:object size:0x1 scope:local -@1099 = .bss:0x00000018; // type:object size:0x1 scope:local -@1097 = .bss:0x0000001C; // type:object size:0x1 scope:local -@1095 = .bss:0x00000020; // type:object size:0x1 scope:local -@1094 = .bss:0x00000024; // type:object size:0x1 scope:local -@1057 = .bss:0x00000028; // type:object size:0x1 scope:local -@1055 = .bss:0x0000002C; // type:object size:0x1 scope:local -@1053 = .bss:0x00000030; // type:object size:0x1 scope:local -@1052 = .bss:0x00000034; // type:object size:0x1 scope:local -@1014 = .bss:0x00000038; // type:object size:0x1 scope:local -@1012 = .bss:0x0000003C; // type:object size:0x1 scope:local -@1010 = .bss:0x00000040; // type:object size:0x1 scope:local -@1009 = .bss:0x00000044; // type:object size:0x1 scope:local -lbl_406_bss_45 = .bss:0x00000045; // type:object size:0x1 data:byte -lbl_406_bss_46 = .bss:0x00000046; // type:object size:0x1 data:byte -lbl_406_bss_47 = .bss:0x00000047; // type:object size:0x1 data:byte -lbl_406_bss_48 = .bss:0x00000048; // type:object size:0x1 data:byte +lit_1109 = .bss:0x00000008; // type:object size:0x1 scope:local data:byte +lit_1107 = .bss:0x0000000C; // type:object size:0x1 scope:local +lit_1105 = .bss:0x00000010; // type:object size:0x1 scope:local +lit_1104 = .bss:0x00000014; // type:object size:0x1 scope:local +lit_1099 = .bss:0x00000018; // type:object size:0x1 scope:local +lit_1097 = .bss:0x0000001C; // type:object size:0x1 scope:local +lit_1095 = .bss:0x00000020; // type:object size:0x1 scope:local +lit_1094 = .bss:0x00000024; // type:object size:0x1 scope:local +lit_1057 = .bss:0x00000028; // type:object size:0x1 scope:local +lit_1055 = .bss:0x0000002C; // type:object size:0x1 scope:local +lit_1053 = .bss:0x00000030; // type:object size:0x1 scope:local +lit_1052 = .bss:0x00000034; // type:object size:0x1 scope:local +lit_1014 = .bss:0x00000038; // type:object size:0x1 scope:local +lit_1012 = .bss:0x0000003C; // type:object size:0x1 scope:local +lit_1010 = .bss:0x00000040; // type:object size:0x1 scope:local +lit_1009 = .bss:0x00000044; // type:object size:0x1 scope:local +init$2123 = .bss:0x00000045; // type:object size:0x1 scope:local data:byte +init$2180 = .bss:0x00000046; // type:object size:0x1 scope:local data:byte +init$2232 = .bss:0x00000047; // type:object size:0x1 scope:local data:byte +init$2548 = .bss:0x00000048; // type:object size:0x1 scope:local data:byte @4973 = .bss:0x0000004C; // type:object size:0xC scope:local @4976 = .bss:0x0000005C; // type:object size:0xC scope:local @4977 = .bss:0x00000068; // type:object size:0xC scope:local diff --git a/config/GZ2P01/rels/d_a_obj_bemos/symbols.txt b/config/GZ2P01/rels/d_a_obj_bemos/symbols.txt index e7966ef8536..d29d7230ffe 100644 --- a/config/GZ2P01/rels/d_a_obj_bemos/symbols.txt +++ b/config/GZ2P01/rels/d_a_obj_bemos/symbols.txt @@ -4,7 +4,7 @@ _unresolved = .text:0x00000058; // type:function size:0x20 scope:global __register_global_object = .text:0x00000078; // type:function size:0x1C scope:global __destroy_global_chain = .text:0x00000094; // type:function size:0x58 scope:global PPCallBack__9daObjBm_cFP10fopAc_ac_cP10fopAc_ac_csQ29dBgW_Base13PushPullLabel = .text:0x000000EC; // type:function size:0x13C scope:global -nodeCallBack__FP8J3DJointi = .text:0x00000228; // type:function size:0x154 scope:global +nodeCallBack__FP8J3DJointi = .text:0x00000228; // type:function size:0x154 scope:local initBaseMtx__9daObjBm_cFv = .text:0x0000037C; // type:function size:0x90 scope:global setBaseMtx__9daObjBm_cFv = .text:0x0000040C; // type:function size:0xEC scope:global Create__9daObjBm_cFv = .text:0x000004F8; // type:function size:0x364 scope:global @@ -90,11 +90,11 @@ _ctors = .ctors:0x00000000; // type:label scope:global __destroy_global_chain_reference = .dtors:0x00000000; // type:object size:0x4 scope:global _dtors = .dtors:0x00000000; // type:label scope:global ...rodata.0 = .rodata:0x00000000; // type:label scope:local -l_eye_offset = .rodata:0x00000000; // type:object size:0xC scope:global -l_high_beam_offset = .rodata:0x0000000C; // type:object size:0xC scope:global -l_mid_beam_offset = .rodata:0x00000018; // type:object size:0xC scope:global -l_low_beam_offset = .rodata:0x00000024; // type:object size:0xC scope:global -l_craw_offset = .rodata:0x00000030; // type:object size:0x30 scope:global +l_eye_offset = .rodata:0x00000000; // type:object size:0xC scope:local +l_high_beam_offset = .rodata:0x0000000C; // type:object size:0xC scope:local +l_mid_beam_offset = .rodata:0x00000018; // type:object size:0xC scope:local +l_low_beam_offset = .rodata:0x00000024; // type:object size:0xC scope:local +l_craw_offset = .rodata:0x00000030; // type:object size:0x30 scope:local M_dir_base__9daObjBm_c = .rodata:0x00000060; // type:object size:0x8 scope:global @3933 = .rodata:0x00000068; // type:object size:0x4 scope:local align:4 data:float @3934 = .rodata:0x0000006C; // type:object size:0x4 scope:local align:4 data:float @@ -135,21 +135,22 @@ l_eff_id2$5639 = .rodata:0x00000278; // type:object size:0x6 scope:local @5875 = .rodata:0x00000280; // type:object size:0x4 scope:local @5876 = .rodata:0x00000284; // type:object size:0x4 scope:local @stringBase0 = .rodata:0x00000288; // type:object size:0x34 scope:local data:string_table -cNullVec__6Z2Calc = .data:0x00000000; // type:object size:0xC scope:global +cNullVec__6Z2Calc = .data:0x00000000; // type:object size:0xC scope:local @1787 = .data:0x0000000C; // type:object size:0x4 scope:local -lbl_406_data_10 = .data:0x00000010; // type:object size:0x10 -l_arcName = .data:0x00000020; // type:object size:0x4 scope:global data:4byte -l_eye_matName = .data:0x00000024; // type:object size:0x4 scope:global -l_head_joint = .data:0x00000028; // type:object size:0x4 scope:global -l_bigGear_joint = .data:0x0000002C; // type:object size:0x4 scope:global -l_smallGear0_joint = .data:0x00000030; // type:object size:0x4 scope:global -l_smallGear1_joint = .data:0x00000034; // type:object size:0x4 scope:global -l_smallGear2_joint = .data:0x00000038; // type:object size:0x4 scope:global -l_joint_table = .data:0x0000003C; // type:object size:0x14 scope:global -l_cull_box = .data:0x00000050; // type:object size:0x18 scope:global -l_sph_src = .data:0x00000068; // type:object size:0x40 scope:global -l_cps_src = .data:0x000000A8; // type:object size:0x4C scope:global -l_cyl_src = .data:0x000000F4; // type:object size:0x44 scope:global +_three$localstatic4$sqrtf = .data:0x00000010; // type:object size:0x8 +_half$localstatic3$sqrtf = .data:0x00000018; // type:object size:0x8 +l_arcName = .data:0x00000020; // type:object size:0x4 scope:local data:4byte +l_eye_matName = .data:0x00000024; // type:object size:0x4 scope:local +l_head_joint = .data:0x00000028; // type:object size:0x4 scope:local +l_bigGear_joint = .data:0x0000002C; // type:object size:0x4 scope:local +l_smallGear0_joint = .data:0x00000030; // type:object size:0x4 scope:local +l_smallGear1_joint = .data:0x00000034; // type:object size:0x4 scope:local +l_smallGear2_joint = .data:0x00000038; // type:object size:0x4 scope:local +l_joint_table = .data:0x0000003C; // type:object size:0x14 scope:local +l_cull_box = .data:0x00000050; // type:object size:0x18 scope:local +l_sph_src = .data:0x00000068; // type:object size:0x40 scope:local +l_cps_src = .data:0x000000A8; // type:object size:0x4C scope:local +l_cyl_src = .data:0x000000F4; // type:object size:0x44 scope:local @4298 = .data:0x00000138; // type:object size:0xC scope:local @4299 = .data:0x00000144; // type:object size:0xC scope:local l_func$4297 = .data:0x00000150; // type:object size:0x18 scope:local @@ -171,7 +172,7 @@ mode_proc$4406 = .data:0x00000210; // type:object size:0x30 scope:local l_eff_func$4732 = .data:0x00000270; // type:object size:0x30 scope:local M_lin5__Q29daObjBm_c5Bgc_c = .data:0x000002A0; // type:object size:0x50 scope:global @6065 = .data:0x000002F0; // type:object size:0x20 scope:local -daObjBm_METHODS = .data:0x00000310; // type:object size:0x20 scope:global +daObjBm_METHODS = .data:0x00000310; // type:object size:0x20 scope:local g_profile_Obj_Bemos = .data:0x00000330; // type:object size:0x30 scope:global __vt__12dBgS_AcchCir = .data:0x00000360; // type:object size:0xC scope:global __vt__10cCcD_GStts = .data:0x0000036C; // type:object size:0xC scope:global @@ -187,26 +188,26 @@ __vt__14dBgS_ObjGndChk = .data:0x0000040C; // type:object size:0x30 scope:global __vt__11dBgS_WtrChk = .data:0x0000043C; // type:object size:0x30 scope:global __global_destructor_chain = .bss:0x00000000; // type:object size:0x4 scope:global ...bss.0 = .bss:0x00000008; // type:label scope:local -@1109 = .bss:0x00000008; // type:object size:0x1 scope:local data:byte -@1107 = .bss:0x0000000C; // type:object size:0x1 scope:local -@1105 = .bss:0x00000010; // type:object size:0x1 scope:local -@1104 = .bss:0x00000014; // type:object size:0x1 scope:local -@1099 = .bss:0x00000018; // type:object size:0x1 scope:local -@1097 = .bss:0x0000001C; // type:object size:0x1 scope:local -@1095 = .bss:0x00000020; // type:object size:0x1 scope:local -@1094 = .bss:0x00000024; // type:object size:0x1 scope:local -@1057 = .bss:0x00000028; // type:object size:0x1 scope:local -@1055 = .bss:0x0000002C; // type:object size:0x1 scope:local -@1053 = .bss:0x00000030; // type:object size:0x1 scope:local -@1052 = .bss:0x00000034; // type:object size:0x1 scope:local -@1014 = .bss:0x00000038; // type:object size:0x1 scope:local -@1012 = .bss:0x0000003C; // type:object size:0x1 scope:local -@1010 = .bss:0x00000040; // type:object size:0x1 scope:local -@1009 = .bss:0x00000044; // type:object size:0x1 scope:local -lbl_406_bss_45 = .bss:0x00000045; // type:object size:0x1 data:byte -lbl_406_bss_46 = .bss:0x00000046; // type:object size:0x1 data:byte -lbl_406_bss_47 = .bss:0x00000047; // type:object size:0x1 data:byte -lbl_406_bss_48 = .bss:0x00000048; // type:object size:0x1 data:byte +lit_1109 = .bss:0x00000008; // type:object size:0x1 scope:local data:byte +lit_1107 = .bss:0x0000000C; // type:object size:0x1 scope:local +lit_1105 = .bss:0x00000010; // type:object size:0x1 scope:local +lit_1104 = .bss:0x00000014; // type:object size:0x1 scope:local +lit_1099 = .bss:0x00000018; // type:object size:0x1 scope:local +lit_1097 = .bss:0x0000001C; // type:object size:0x1 scope:local +lit_1095 = .bss:0x00000020; // type:object size:0x1 scope:local +lit_1094 = .bss:0x00000024; // type:object size:0x1 scope:local +lit_1057 = .bss:0x00000028; // type:object size:0x1 scope:local +lit_1055 = .bss:0x0000002C; // type:object size:0x1 scope:local +lit_1053 = .bss:0x00000030; // type:object size:0x1 scope:local +lit_1052 = .bss:0x00000034; // type:object size:0x1 scope:local +lit_1014 = .bss:0x00000038; // type:object size:0x1 scope:local +lit_1012 = .bss:0x0000003C; // type:object size:0x1 scope:local +lit_1010 = .bss:0x00000040; // type:object size:0x1 scope:local +lit_1009 = .bss:0x00000044; // type:object size:0x1 scope:local +init$2123 = .bss:0x00000045; // type:object size:0x1 scope:local data:byte +init$2180 = .bss:0x00000046; // type:object size:0x1 scope:local data:byte +init$2232 = .bss:0x00000047; // type:object size:0x1 scope:local data:byte +init$2548 = .bss:0x00000048; // type:object size:0x1 scope:local data:byte @4973 = .bss:0x0000004C; // type:object size:0xC scope:local @4976 = .bss:0x0000005C; // type:object size:0xC scope:local @4977 = .bss:0x00000068; // type:object size:0xC scope:local diff --git a/configure.py b/configure.py index ec1ed43fa83..df71a226031 100755 --- a/configure.py +++ b/configure.py @@ -1932,7 +1932,7 @@ config.libs = [ ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_obj_batta"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_obj_bbox"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_obj_bed"), - ActorRel(NonMatching, "d_a_obj_bemos"), + ActorRel(Equivalent, "d_a_obj_bemos"), # .rodata incorrect order / missing data ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_obj_bhbridge"), # vtable order ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_obj_bk_leaf"), ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_obj_bky_rock"), diff --git a/include/d/actor/d_a_e_wb.h b/include/d/actor/d_a_e_wb.h index 3b70e40d384..65c4e698d63 100644 --- a/include/d/actor/d_a_e_wb.h +++ b/include/d/actor/d_a_e_wb.h @@ -65,9 +65,9 @@ struct himo_s { * @ingroup actors-enemies * @class e_wb_class * @brief Bullbo (Wild Boar) - * - * @details - * + * + * @details + * */ class e_wb_class { public: @@ -96,29 +96,29 @@ public: } public: - /* 0x0000 */ fopEn_enemy_c mEnemy; - /* 0x05AC */ request_of_phase_process_class mPhase; - /* 0x05B4 */ s16 mActionMode; - /* 0x05B8 */ char* mResName; - /* 0x05BC */ u8 mParam; - /* 0x05BD */ u8 mParam2; + /* 0x0000 */ fopEn_enemy_c mEnemy; ///< @brief Base enemy class instance. + /* 0x05AC */ request_of_phase_process_class mPhase; ///< @brief Phase process request handler. + /* 0x05B4 */ s16 mActionMode; ///< @brief Current sub-action mode within the run action. + /* 0x05B8 */ char* mResName; ///< @brief Resource name for loading models/animations. + /* 0x05BC */ u8 mParam; ///< @brief Creation parameter 1. + /* 0x05BD */ u8 mParam2; ///< @brief Creation parameter 2. /* 0x05BE */ u8 field_0x5be; /* 0x05BF */ bool field_0x5bf; /* 0x05C0 */ u8 field_0x5c0; /* 0x05C4 */ cXyz field_0x5c4; /* 0x05D0 */ cXyz field_0x5d0; - /* 0x05DC */ s16 mAngleTarget; + /* 0x05DC */ s16 mTargetFacingAngle; ///< @brief Target facing angle for turning towards path point. /* 0x05DE */ s16 field_0x5de; - /* 0x05E0 */ mDoExt_McaMorfSO* mpModelMorf; - /* 0x05E4 */ f32 mPlaySpeed; - /* 0x05E8 */ int mAnmID; - /* 0x05EC */ Z2CreatureRide mZ2Ride; + /* 0x05E0 */ mDoExt_McaMorfSO* mpModelMorf; ///< @brief Pointer to model morph animator. + /* 0x05E4 */ f32 mPlaySpeed; ///< @brief Animation playback speed. + /* 0x05E8 */ int mAnmID; ///< @brief Current animation ID. + /* 0x05EC */ Z2CreatureRide mZ2Ride; ///< @brief Z2 sound creature for ride effects. /* 0x0688 */ int field_0x688; - /* 0x068C */ s8 field_0x68c; + /* 0x068C */ s8 mPathInitialized; ///< @brief Flag indicating if path has been initialized. /* 0x068E */ s16 field_0x68e; - /* 0x0690 */ s16 mActionID; + /* 0x0690 */ s16 mActionID; ///< @brief High-level action ID. /* 0x0692 */ s16 field_0x692; - /* 0x0694 */ int mShadowKey; + /* 0x0694 */ int mShadowKey; ///< @brief Shadow drawing key. /* 0x0698 */ s16 field_0x698[4]; /* 0x06A0 */ s16 field_0x6a0; /* 0x06A2 */ u8 field_0x6a2[0x6ae - 0x6a2]; @@ -128,14 +128,14 @@ public: /* 0x06B8 */ u8 field_0x6b8[0x6ba - 0x6b8]; /* 0x06BA */ s16 field_0x6ba; /* 0x06BC */ u8 field_0x6bc; - /* 0x06BD */ s8 field_0x6bd; - /* 0x06BE */ u16 field_0x6be; + /* 0x06BD */ s8 mPursuitFlag; ///< @brief Flag indicating pursuit mode. + /* 0x06BE */ u16 mStatusFlags; ///< @brief Bitfield for various status flags. /* 0x06C0 */ s8 field_0x6c0; /* 0x06C4 */ f32 field_0x6c4; - /* 0x06C8 */ int mBPathIdx; // The b_path indexer - /* 0x06CC */ int mBPathIdxIter; // The amount to change the b_path indexer by + /* 0x06C8 */ int mCurrentPathIndex; ///< @brief Current index in the path points array. + /* 0x06CC */ int mPathDirection; ///< @brief Direction to iterate path points (+1 or -1). /* 0x06D0 */ s16 field_0x6d0; - /* 0x06D2 */ s16 mTargetAngleStep; + /* 0x06D2 */ s16 mTurnStep; ///< @brief Step value for turning angle adjustment. /* 0x06D4 */ s16 field_0x6d4; /* 0x06D6 */ s16 field_0x6d6; /* 0x06D8 */ s16 field_0x6d8; @@ -147,11 +147,11 @@ public: /* 0x06E4 */ s8 field_0x6e4; /* 0x06E5 */ u8 field_0x6e5[0x6ec - 0x6e5]; /* 0x06EC */ csXyz field_0x6ec[0x1d]; - /* 0x079A */ s16 field_0x79a; + /* 0x079A */ s16 mBodyTiltAngle; ///< @brief Body tilt angle based on turning. /* 0x079C */ u8 field_0x79c; /* 0x079D */ s8 field_0x79d; - /* 0x079E */ s8 field_0x79e; - /* 0x079F */ s8 field_0x79f; + /* 0x079E */ s8 mLapCount; ///< @brief Lap or progress count affecting path generation. + /* 0x079F */ s8 mPathAdjustCounter; ///< @brief Counter for periodic path adjustment. /* 0x07A0 */ s16 field_0x7a0; /* 0x07A2 */ s8 field_0x7a2; /* 0x07A4 */ s16 field_0x7a4; @@ -178,18 +178,18 @@ public: /* 0x1418 */ u32 field_0x1418; /* 0x141C */ u32 field_0x141c; /* 0x1420 */ u32 field_0x1420[3]; - /* 0x142C */ u8 field_0x142c; - /* 0x142D */ u8 field_0x142d; - /* 0x142E */ u8 field_0x142e; - /* 0x142F */ s8 field_0x142f; + /* 0x142C */ u8 mMovementType; ///< @brief Type of movement (1 for normal, 2 for faster). + /* 0x142D */ u8 mCollisionFlags; ///< @brief Flags for collision states. + /* 0x142E */ u8 mLandingFlag; ///< @brief Flag for landing after jump. + /* 0x142F */ s8 mSpeedCapTimer; ///< @brief Timer to cap speed at 30. /* 0x1430 */ s8 field_0x1430; /* 0x1432 */ s16 field_0x1432; - /* 0x1434 */ fpc_ProcID field_0x1434; // Rider actor ID? + /* 0x1434 */ fpc_ProcID field_0x1434; // Rider actor ID? ///< @brief Process ID of rider actor. /* 0x1438 */ cXyz field_0x1438[2]; /* 0x1450 */ himo_s field_0x1450[2]; /* 0x15D0 */ mDoExt_3DlineMat1_c field_0x15d0[2]; /* 0x1648 */ mDoExt_3DlineMat1_c field_0x1648; - /* 0x1684 */ f32 field_0x1684; + /* 0x1684 */ f32 mAnimDuration; ///< @brief Duration or timer for animation. /* 0x1688 */ s16 field_0x1688; /* 0x168A */ s16 field_0x168a; /* 0x168C */ f32 field_0x168c; @@ -221,13 +221,12 @@ public: /* 0x17D0 */ u32 field_0x17d0[4]; /* 0x17E0 */ u8 field_0x17e0; /* 0x17E1 */ u8 field_0x17e1; - /* 0x17E2 */ s16 mWaitRollAngle; + /* 0x17E2 */ s16 mWaitRollAngle; ///< @brief Roll angle during wait state. /* 0x17E4 */ u8 field_0x17e4[0x17e8 - 0x17e4]; - /* 0x17E8 */ f32 mSpeedRate; + /* 0x17E8 */ f32 mSpeedRate; ///< @brief Speed rate for riding calculations. }; STATIC_ASSERT(sizeof(e_wb_class) == 0x17EC); - #endif /* D_A_E_WB_H */ diff --git a/include/d/actor/d_a_obj_bemos.h b/include/d/actor/d_a_obj_bemos.h index a294a038934..3faa5e1eafe 100644 --- a/include/d/actor/d_a_obj_bemos.h +++ b/include/d/actor/d_a_obj_bemos.h @@ -1,10 +1,11 @@ #ifndef D_A_OBJ_BEMOS_H #define D_A_OBJ_BEMOS_H -#include "f_op/f_op_actor_mng.h" +#include "d/d_bg_s_acch.h" #include "d/d_bg_s_movebg_actor.h" -#include "d/d_bg_w_base.h" +#include "d/d_bg_w.h" #include "d/d_cc_d.h" +#include "f_op/f_op_actor_mng.h" #include "m_Do/m_Do_ext.h" /** @@ -17,37 +18,71 @@ */ class daObjBm_c : public dBgS_MoveBgActor { public: - class BgcSrc_c {}; + typedef void (daObjBm_c::*procFunc)(); + typedef void (daObjBm_c::*modeFunc)(); + typedef void (daObjBm_c::*effectFunc)(); + + class BgcSrc_c { + public: + /* 0x0 */ f32 field_0x0; + /* 0x4 */ f32 field_0x4; + /* 0x8 */ f32 field_0x8; + /* 0xC */ f32 field_0xc; + }; class Bgc_c { public: + enum State_e { + STATE_0_e = 0x0, + STATE_1_e = 0x1, + STATE_2_e = 0x2, + STATE_4_e = 0x4, + STATE_8_e = 0x8, + STATE_10_e = 0x10, + STATE_20_e = 0x20, + STATE_40_e = 0x40, + }; + /* 80BB0E0C */ Bgc_c(); /* 80BB0ED4 */ void wall_pos(fopAc_ac_c const*, daObjBm_c::BgcSrc_c const*, int, s16, f32); - /* 80BB1154 */ void chk_wall_pre(fopAc_ac_c const*, daObjBm_c::BgcSrc_c const*, int, s16); - - static u8 const M_lin20[368]; - static u8 M_lin5[80]; - static u8 M_gnd_work[1932]; - static u8 M_wrt_work[84]; - static u8 M_wall_work[2576]; + /* 80BB1154 */ bool chk_wall_pre(fopAc_ac_c const*, daObjBm_c::BgcSrc_c const*, int, s16); + + static daObjBm_c::BgcSrc_c M_lin5[]; + static const daObjBm_c::BgcSrc_c M_lin20[]; + + static dBgS_ObjGndChk M_gnd_work[23]; + static dBgS_WtrChk M_wrt_work; + static dBgS_ObjLinChk M_wall_work[23]; + + /* 0x000 */ f32 field_0x0[23]; + /* 0x05C */ int field_0x5c; + /* 0x060 */ f32 field_0x60; + /* 0x064 */ cXyz field_0x64[23]; + /* 0x178 */ int field_0x178; + /* 0x17C */ f32 field_0x17c; + /* 0x180 */ State_e mState; }; - u32 getSwNo3() { return fopAcM_GetParamBit(this, 16,8); } - u32 getMoveType() { return fopAcM_GetParamBit(this, 24, 4); } - s16 getHeadJoint() { return mHeadJntNo; } - s16 getBigGearJoint() { return mBigGearJntNo; } - s16 getSmallGear0Joint() { return mSmallGear0JntNo; } - s16 getSmallGear1Joint() { return mSmallGear1JntNo; } - s16 getSmallGear2Joint() { return mSmallGear2JntNo; } - s8 getSwNo() { return fopAcM_GetParamBit(this,8,8);} - s8 getSwNo2() { return fopAcM_GetParamBit(this,0,8);} - - /* 80BAE36C */ void PPCallBack(fopAc_ac_c*, fopAc_ac_c*, s16, dBgW_Base::PushPullLabel); + u8 getMoveType() { return fopAcM_GetParamBit(this, 24, 4); } + s16 getHeadJoint() { return mJoints[0]; } + s16 getBigGearJoint() { return mJoints[1]; } + s16 getSmallGear0Joint() { return mJoints[2]; } + s16 getSmallGear1Joint() { return mJoints[3]; } + s16 getSmallGear2Joint() { return mJoints[4]; } + u8 getSwNo() { return fopAcM_GetParamBit(this, 0, 8); } + u8 getSwNo2() { return fopAcM_GetParamBit(this, 8, 8); } + u8 getSwNo3() { return fopAcM_GetParamBit(this, 16, 8); } + u8 getSearchDist() { return fopAcM_GetParamBit(this, 28, 4); } + u8 getBeamSearchDist() { return field_0x100a & 15; } + u8 checkLockOnCamera() { return (field_0x100a & 0x8000) >> 15; } + + /* 80BAE36C */ static fopAc_ac_c* PPCallBack(fopAc_ac_c*, fopAc_ac_c*, s16, + dBgW_Base::PushPullLabel); /* 80BAE5FC */ void initBaseMtx(); /* 80BAE68C */ void setBaseMtx(); /* 80BAE778 */ int Create(); /* 80BAEADC */ int CreateHeap(); - /* 80BAEFD8 */ void create1st(); + /* 80BAEFD8 */ int create1st(); /* 80BAF09C */ int Execute(Mtx**); /* 80BAF29C */ void main_proc_call(); /* 80BAF328 */ void initActionEnBemos(); @@ -57,17 +92,17 @@ public: /* 80BAF80C */ void setCrawCO(); /* 80BAF8F8 */ void calcBeamPos(); /* 80BAFC08 */ void calcBeamLenAndAt(); - /* 80BAFFA8 */ void checkFindPlayer(); - /* 80BB0104 */ void checkSearchPlayer(); - /* 80BB0260 */ void getSearchDistance(); - /* 80BB02B8 */ void getBeamSearchDistance(); + /* 80BAFFA8 */ s8 checkFindPlayer(); + /* 80BB0104 */ s8 checkSearchPlayer(); + /* 80BB0260 */ f32 getSearchDistance(); + /* 80BB02B8 */ f32 getBeamSearchDistance(); /* 80BB0310 */ void effect_proc(); /* 80BB0580 */ void effectWait(); /* 80BB0584 */ void initEffectSet0(); /* 80BB0718 */ void effectSet0(); /* 80BB071C */ void effectSet1(); /* 80BB0720 */ void effectEnd(); - /* 80BB0724 */ void check_to_walk(); + /* 80BB0724 */ int check_to_walk(); /* 80BB0824 */ void mode_wait_init(); /* 80BB0888 */ void mode_wait(); /* 80BB09C8 */ void mode_walk_init(); @@ -87,30 +122,32 @@ public: /* 80BB248C */ void initActionDead(); /* 80BB2700 */ void actionDead(); /* 80BB2AB0 */ int Draw(); +#ifdef DEBUG + /* 0x000000 */ void debugDraw(); +#endif /* 80BB2C8C */ int Delete(); - static u8 const M_dir_base[8]; -// private: - /* 0x05A0 */ u8 field_0x5a0[0x8]; + static s16 const M_dir_base[4]; + // private: + /* 0x05A0 */ request_of_phase_process_class mPhase; /* 0x05A8 */ J3DModel* mpModel; /* 0x05AC */ mDoExt_brkAnm* mpBrkAnm; - /* 0x05B0 */ mDoExt_baseAnm* mpBaseAnm; + /* 0x05B0 */ mDoExt_bckAnm* mpBckAnm; /* 0x05B4 */ J3DModel* mpModel2; - /* 0x05B8 */ u8 field_0x5b8[0xa]; + /* 0x05B8 */ mDoExt_btkAnm* mpBtkAnm; + /* 0x05BC */ mDoExt_btkAnm* mpBtkAnm2; + /* 0x05C0 */ mDoExt_bckAnm* mpBckAnm2; /* 0x05C4 */ J3DModel* mpModel3; - /* 0x05C8 */ mDoExt_baseAnm* mpBaseAnm2; - /* 0x05CC */ u8 field_0x5cc[0x7e4 - 0x5cc]; + /* 0x05C8 */ mDoExt_bckAnm* mpBckAnm3; + /* 0x05CC */ dBgS_ObjAcch mAcch; + /* 0x07A4 */ dBgS_AcchCir mAcchCir; /* 0x07E4 */ dCcD_Stts mStts; /* 0x0820 */ dCcD_Sph mSph; /* 0x0958 */ dCcD_Cps mCps; - /* 0x0A9c */ dCcD_Cyl mCyl[4]; - /* 0x0F8C */ s16 mHeadJntNo; - /* 0x0F8E */ s16 mBigGearJntNo; - /* 0x0F90 */ s16 mSmallGear0JntNo; - /* 0x0F92 */ s16 mSmallGear1JntNo; - /* 0x0F94 */ s16 mSmallGear2JntNo; + /* 0x0A9C */ dCcD_Cyl mCyl[4]; + /* 0x0F8C */ s16 mJoints[5]; /* 0x0F96 */ s16 field_0xf96; - /* 0x0F96 */ s16 field_0xf98; + /* 0x0F98 */ s16 field_0xf98; /* 0x0F9A */ s16 field_0xf9a; /* 0x0F9C */ s16 field_0xf9c; /* 0x0F9E */ s16 field_0xf9e; @@ -118,39 +155,70 @@ public: /* 0x0FA2 */ s16 field_0xfa2; /* 0x0FA4 */ s16 field_0xfa4; /* 0x0FA6 */ s16 field_0xfa6; - /* 0x0FA8 */ u8 field_0xfa8[0xfb4 - 0xfa8]; + /* 0x0FA8 */ s16 field_0xfa8; + /* 0x0FAA */ s16 field_0xfaa; + /* 0x0FAC */ s16 field_0xfac; + /* 0x0FAE */ s16 field_0xfae; + /* 0x0FB0 */ s16 field_0xfb0; + /* 0x0FB2 */ s16 field_0xfb2; /* 0x0FB4 */ J3DMaterial* mpMaterial; /* 0x0FB8 */ cXyz field_0xfb8; /* 0x0FC4 */ csXyz field_0xfc4; /* 0x0FCA */ u8 field_0xfca[2]; - /* 0x0FCC */ u32 field_0xfcc; - /* 0x0FD0 */ u8 field_0xfd0[0xff0 - 0xfd0]; - /* 0x0FF0 */ f32 field_0xff0; - /* 0x0FF4 */ u8 field_0xff4[3]; + /* 0x0FCC */ cXyz field_0xfcc; + /* 0x0FD8 */ cXyz field_0xfd8; + /* 0x0FE4 */ u8 field_0xfe4; + /* 0x0FE5 */ u8 field_0xfe5; + /* 0x0FE6 */ u8 field_0xfe6; + /* 0x0FE7 */ s8 field_0xfe7; + /* 0x0FE8 */ u8 field_0xfe8; + /* 0x0FE9 */ u8 field_0xfe9; + /* 0x0FEA */ u8 field_0xfea; + /* 0x0FEB */ u8 field_0xfeb; + /* 0x0FEC */ u8 field_0xfec; + /* 0x0FED */ u8 field_0xfed; + /* 0x0FF0 */ u32 field_0xff0; + /* 0x0FF4 */ u8 field_0xff4; + /* 0x0FF5 */ u8 field_0xff5; + /* 0x0FF6 */ u8 field_0xff6; /* 0x0FF7 */ u8 field_0xff7; - /* 0x0FF8 */ f32 field_0xff8; - /* 0x0FFC */ f32 field_0xffc; + /* 0x0FF8 */ JPABaseEmitter* field_0xff8[2]; /* 0x1000 */ f32 field_0x1000; - /* 0x1004 */ u8 field_0x1004[0x100c - 0x1004]; - /* 0x100C */ f32 field_0x100c; - /* 0x1010 */ u8 field_0x1010[0x1038 - 0x1010]; - /* 0x1038 */ u8 field_0x1038; - /* 0x1039 */ u8 field_0x1039; - /* 0x103A */ u8 field_0x103a[0x10a0 - 0x103a]; + /* 0x1004 */ f32 field_0x1004; + /* 0x1008 */ u16 field_0x1008; + /* 0x100A */ u16 field_0x100a; + /* 0x100C */ u16 field_0x100c; + /* 0x100E */ u8 field_0x100e; + /* 0x100F */ u8 field_0x100f; + /* 0x1010 */ JPABaseEmitter* field_0x1010[2]; + /* 0x1018 */ JPABaseEmitter* field_0x1018[2]; + /* 0x1010 */ JPABaseEmitter* field_0x1020[3]; + /* 0x102C */ JPABaseEmitter* field_0x102c; + /* 0x1030 */ JPABaseEmitter* field_0x1030; + /* 0x1034 */ JPABaseEmitter* field_0x1034; + /* 0x1038 */ s8 field_0x1038; + /* 0x1039 */ s8 field_0x1039; + /* 0x103C */ cXyz field_0x103c; + /* 0x1048 */ cXyz field_0x1048; + /* 0x1054 */ cXyz field_0x1054; + /* 0x1060 */ Z2SoundObjSimple mSound; + /* 0x1080 */ Z2SoundObjSimple mSound2; /* 0x10A0 */ cXyz field_0x10a0; - /* 0x10AC */ u8 field_0x10ac[0x10c0 - 0x10ac]; - /* 0x10C0 */ int field_0x10c0; - /* 0x10C4 */ s16 field_0x10c4[4]; - /* 0x10D4 */ u8 field_0x10cc[0x10d2 - 0x10cc]; + /* 0x10AC */ int field_0x10ac; + /* 0x10B0 */ int field_0x10b0; + /* 0x10B4 */ int field_0x10b4; + /* 0x10B8 */ f32 field_0x10b8; + /* 0x10BC */ int field_0x10bc; + /* 0x10C0 */ dBgW::PushPullLabel mPPLabel; + /* 0x10C4 */ s16 mMomentCnt[4]; + /* 0x10CC */ s16 field_0x10cc; + /* 0x10CE */ s16 field_0x10ce; + /* 0x10D0 */ s16 field_0x10d0; /* 0x10D2 */ u8 field_0x10d2; /* 0x10D3 */ u8 field_0x10d3; - /* 0x10D4 */ u8 field_0x10d4[0x10e8 - 0x10d4]; - /* 0x10E8 */ f32 field_0x10e8; - /* 0x10EC */ f32 field_0x10ec; - /* 0x10F0 */ u8 field_0x10f0[0x1258 - 0x10f0]; + /* 0x10D4 */ Bgc_c mBgc; }; STATIC_ASSERT(sizeof(daObjBm_c) == 0x1258); - #endif /* D_A_OBJ_BEMOS_H */ diff --git a/src/d/actor/d_a_e_rd.cpp b/src/d/actor/d_a_e_rd.cpp index 8c91a61223b..85a234ea4c2 100644 --- a/src/d/actor/d_a_e_rd.cpp +++ b/src/d/actor/d_a_e_rd.cpp @@ -674,12 +674,12 @@ static void ride_off(e_rd_class* i_this) { e_wb_class* bullbo = (e_wb_class*)fopAcM_SearchByID(i_this->mWbActorID); if (bullbo != NULL) { - bullbo->field_0x6be &= ~i_this->field_0x9be; + bullbo->mStatusFlags &= ~i_this->field_0x9be; i_this->field_0x9be = 0; if (bullbo->mActionID != 22 && bullbo->mActionID != 23 && bullbo->mActionID != 24) { if (bullbo->mActionID == 1) { - if ((bullbo->field_0x6be & 3) != 0) { + if ((bullbo->mStatusFlags & 3) != 0) { bullbo->mActionID = 6; } else { bullbo->mActionID = 0; @@ -688,7 +688,7 @@ static void ride_off(e_rd_class* i_this) { bullbo->mActionMode = 0; } else if (bullbo->mActionID == 21) { bullbo->mActionMode = 0; - } else if ((bullbo->field_0x6be & 1) == 0) { + } else if ((bullbo->mStatusFlags & 1) == 0) { if (bullbo->mActionID == 6 && (bullbo->mActionMode == 2 || bullbo->mActionMode == 3)) { bullbo->mActionMode = 1; } else { @@ -720,7 +720,7 @@ static void* s_wb_sub(void* i_actor, void* i_data) { ((e_wb_class*)i_actor)->mActionID != ACTION_DAMAGE && ((e_wb_class*)i_actor)->mActionID != ACTION_A_DAMAGE && ((e_wb_class*)i_actor)->mActionID != ACTION_STAND) { e_rd_class* i_this = (e_rd_class*)i_data; if (i_this->mBossMode == ((e_wb_class*)i_actor)->field_0x79d && - (data_80519230 != 0 || (((e_wb_class*)i_actor)->field_0x6be & 3) != 3) && target_info_count < 10) { + (data_80519230 != 0 || (((e_wb_class*)i_actor)->mStatusFlags & 3) != 3) && target_info_count < 10) { target_info[target_info_count] = (fopAc_ac_c*)i_actor; target_info_count++; } @@ -799,10 +799,10 @@ static void wb_check(e_rd_class* i_this, s16 param_2) { if (bullbo != NULL) { if (data_80519200 != 0) { if (i_this->field_0x5bc != 1) { - if ((bullbo->field_0x6be & 1) == 0) { + if ((bullbo->mStatusFlags & 1) == 0) { return; } - } else if ((bullbo->field_0x6be & 1) != 0) { + } else if ((bullbo->mStatusFlags & 1) != 0) { return; } } @@ -810,11 +810,11 @@ static void wb_check(e_rd_class* i_this, s16 param_2) { i_this->mAction = ACTION_WB_SEARCH; i_this->mMode = 0; - if ((bullbo->field_0x6be & 1) == 0) { - bullbo->field_0x6be |= 1; + if ((bullbo->mStatusFlags & 1) == 0) { + bullbo->mStatusFlags |= 1; i_this->field_0x9be = 1; - } else if ((bullbo->field_0x6be & 2) == 0) { - bullbo->field_0x6be |= 2; + } else if ((bullbo->mStatusFlags & 2) == 0) { + bullbo->mStatusFlags |= 2; i_this->field_0x9be = 2; } } @@ -831,7 +831,7 @@ static BOOL wb_init_ride(e_rd_class* i_this) { i_this->mMode = 0; i_this->field_0x9bc = 2; i_this->field_0x9be = i_this->field_0x5b6; - bullbo->field_0x6be |= (s8)i_this->field_0x5b6; + bullbo->mStatusFlags |= (s8)i_this->field_0x5b6; bullbo->mActionID = 1; if (i_this->field_0x5bc != 0 && i_this->field_0x9be == 1) { @@ -1998,7 +1998,7 @@ static void e_rd_wb_ride(e_rd_class* i_this) { i_this->mAction = ACTION_NORMAL; i_this->mMode = 0; ride_off(i_this); - } else if ((bullbo->field_0x6be & 3) == 0) { + } else if ((bullbo->mStatusFlags & 3) == 0) { OS_REPORT("......BOSS DL !!!!\n"); if (bullbo->mActionID == 1) { bullbo->mActionID = 0; @@ -2069,7 +2069,7 @@ static void e_rd_wb_run(e_rd_class* i_this) { fopAcM_setStageLayer(a_this); } - if ((bullbo->field_0x6be & 3) == 0) { + if ((bullbo->mStatusFlags & 3) == 0) { fopAcM_delete(a_this); return; } @@ -2081,7 +2081,7 @@ static void e_rd_wb_run(e_rd_class* i_this) { } } - if ((bullbo->field_0x6be & 1) == 0 && bullbo->mActionID == ACTION_BOW2 && i_this->mMode != 40) { + if ((bullbo->mStatusFlags & 1) == 0 && bullbo->mActionID == ACTION_BOW2 && i_this->mMode != 40) { anm_init(i_this, BCK_RD_RRUN02_BACK, 5.0f, 2, 1.0f); i_this->mMode = 40; @@ -2096,7 +2096,7 @@ static void e_rd_wb_run(e_rd_class* i_this) { switch (i_this->mMode) { case 0: - if ((bullbo->field_0x6be & 4) != 0) { + if ((bullbo->mStatusFlags & 4) != 0) { if (i_this->field_0x9be == 1) { if (bullbo->field_0x6d0 < 0) { anm_init(i_this, BCK_RD_RSTEP_L, 10.0f, 2, 1.0f); @@ -2107,7 +2107,7 @@ static void e_rd_wb_run(e_rd_class* i_this) { anm_init(i_this, BCK_RD_RSTEP_BACK, 10.0f, 2, 1.0f); } } else { - if ((bullbo->field_0x6be & 8) != 0) { + if ((bullbo->mStatusFlags & 8) != 0) { if (i_this->field_0x9be == 1) { anm_init(i_this, BCK_RD_RDAMAGE, 3.0f, 0, 1.0f); } else { @@ -2116,14 +2116,14 @@ static void e_rd_wb_run(e_rd_class* i_this) { i_this->field_0x990[1] = cM_rndF(50.0f) + 50.0f; } else { - if ((bullbo->field_0x6be & 16) != 0) { + if ((bullbo->mStatusFlags & 16) != 0) { if (i_this->field_0x9be == 1) { anm_init(i_this, BCK_RD_RRUN, 5.0f, 2, 1.0f); } else { anm_init(i_this, BCK_RD_RRUN_BACK, 5.0f, 2, 1.0f); } } else { - if ((bullbo->field_0x6be & 32) != 0) { + if ((bullbo->mStatusFlags & 32) != 0) { if (i_this->field_0x9be == 1) { anm_init(i_this, BCK_RD_RWAIT, 5.0f, 2, 1.0f); } else { @@ -2342,9 +2342,9 @@ static void e_rd_wb_run_B(e_rd_class* i_this) { switch (i_this->mMode) { case 0: { - if ((bullbo->field_0x6be & 0x400) != 0) { + if ((bullbo->mStatusFlags & 0x400) != 0) { anm_init(i_this, e_rdb_class::BCK_RB_RSTARTLOOP, 10.0f, 2, 1.0f); - } else if ((bullbo->field_0x6be & 0x800) != 0) { + } else if ((bullbo->mStatusFlags & 0x800) != 0) { anm_init(i_this, e_rdb_class::BCK_RB_RSTART, 10.0f, 2, 1.0f); } @@ -2396,7 +2396,7 @@ static void e_rd_wb_run_B(e_rd_class* i_this) { } // check if we need to jump a fence - if ((bullbo->field_0x6be & 0x100) != 0) { + if ((bullbo->mStatusFlags & 0x100) != 0) { i_this->mAction = ACTION_WB_BJUMP; i_this->mMode = 0; } @@ -2433,7 +2433,7 @@ static void e_rd_wb_bjump(e_rd_class* i_this) { break; case 2: - if ((bullbo->field_0x6be & 0x200) != 0) { + if ((bullbo->mStatusFlags & 0x200) != 0) { anm_init(i_this, BCK_RD_RUN02, 2.0f, 0, 1.0f); i_this->mMode = 3; } @@ -2559,7 +2559,7 @@ static void e_rd_s_damage(e_rd_class* i_this) { if (i_this->field_0x9be != 0) { e_wb_class* bullbo = (e_wb_class*)fopAcM_SearchByID(i_this->mWbActorID); if (bullbo != NULL) { - bullbo->field_0x6be &= ~i_this->field_0x9be; + bullbo->mStatusFlags &= ~i_this->field_0x9be; } i_this->field_0x9be = 0; @@ -2660,7 +2660,7 @@ static void rd_disappear(e_rd_class* i_this) { if (i_this->field_0x9be != 0) { e_wb_class* bullbo = (e_wb_class*)fopAcM_SearchByID(i_this->mWbActorID); if (bullbo != NULL) { - bullbo->field_0x6be &= ~i_this->field_0x9be; + bullbo->mStatusFlags &= ~i_this->field_0x9be; if (bullbo->mActionID == 1) { bullbo->mActionID = 0; } @@ -3767,7 +3767,7 @@ static void e_rd_kiba_end(e_rd_class* i_this) { i_this->field_0x9c8 = 1; } - if ((bullbo->field_0x6be & 0x100) != 0) { + if ((bullbo->mStatusFlags & 0x100) != 0) { i_this->mAction = ACTION_WB_BJUMP; i_this->mMode = 0; i_this->field_0x990[1] = 2000; @@ -3794,7 +3794,7 @@ static void e_rd_ikki_end(e_rd_class* i_this) { i_this->field_0x9bc = 0; if (daPy_getPlayerActorClass()->checkHorseRide() && bullbo != NULL) { - bullbo->field_0x6be &= ~i_this->field_0x9be; + bullbo->mStatusFlags &= ~i_this->field_0x9be; i_this->field_0x9be = 0; bullbo->mActionID = 16; bullbo->mActionMode = 0; @@ -3863,7 +3863,7 @@ static void e_rd_ikki2_end(e_rd_class* i_this) { i_this->field_0x9bc = 0; if (bullbo != NULL) { - bullbo->field_0x6be &= ~i_this->field_0x9be; + bullbo->mStatusFlags &= ~i_this->field_0x9be; i_this->field_0x9be = 0; } @@ -3906,14 +3906,14 @@ static void e_rd_lv9_end(e_rd_class* i_this) { break; case 1: - if ((bullbo->field_0x6be & 8) != 0) { + if ((bullbo->mStatusFlags & 8) != 0) { anm_init(i_this, e_rdb_class::BCK_RB_RWAIT, 10.0f, 2, 1.0f); i_this->mMode = 2; } break; case 2: - if ((bullbo->field_0x6be & 8) != 0) { + if ((bullbo->mStatusFlags & 8) != 0) { anm_init(i_this, e_rdb_class::BCK_RB_LV9_END03, 5.0f, 0, 1.0f); i_this->mSound.startCreatureVoice(Z2SE_EN_RDB_V_LV9_END03, -1); i_this->mMode = 3; @@ -4090,7 +4090,7 @@ static void damage_check(e_rd_class* i_this) { e_wb_class* bullbo_p = (e_wb_class*)bullbo; int iVar1; - if (i_this->field_0x9bc == 2 && bullbo != NULL && (bullbo_p->field_0x6be & 0xC0) != 0) { + if (i_this->field_0x9bc == 2 && bullbo != NULL && (bullbo_p->mStatusFlags & 0xC0) != 0) { if (i_this->mAction == ACTION_IKKI2_END) { i_this->mMode = 10; return; @@ -4100,7 +4100,7 @@ static void damage_check(e_rd_class* i_this) { i_this->mMode = 0; i_this->field_0x998 = 1000; - if ((bullbo_p->field_0x6be & 0x80) != 0) { + if ((bullbo_p->mStatusFlags & 0x80) != 0) { i_this->field_0xa0e = a_this->shape_angle.y + 0x8000 + (s16)cM_rndFX(3000.0f); i_this->field_0x9f6 = (s16)cM_rndFX(1000.0f); } else { @@ -4132,8 +4132,8 @@ static void damage_check(e_rd_class* i_this) { if (dComIfGp_getHorseActor()->speedF > 20.0f || sVar1 > 0x7800 || sVar1 < -0x7800) { cc_at_check(a_this, &i_this->mAtInfo); dScnPly_c::setPauseTimer(0); - bullbo_p->field_0x79e++; - if (bullbo_p->field_0x79e >= 3) { + bullbo_p->mLapCount++; + if (bullbo_p->mLapCount >= 3) { mDoAud_bgmStop(30); i_this->mAction = ACTION_IKKI2_END; i_this->mMode = 0; @@ -4264,8 +4264,8 @@ static void damage_check(e_rd_class* i_this) { if (i_this->mBossMode != 0 && bullbo != NULL) { i_this->field_0x998 = 20; if (i_this->mBossMode == 2) { - bullbo_p->field_0x79e++; - if (bullbo_p->field_0x79e == 1) { + bullbo_p->mLapCount++; + if (bullbo_p->mLapCount == 1) { a_this->health = 0; /* dSv_event_flag_c::M_055 - Main Event - Did damage at least once during joust/one-on-one battle */ dComIfGs_onEventBit(dSv_event_flag_c::saveBitLabels[0x58]); @@ -4274,7 +4274,7 @@ static void damage_check(e_rd_class* i_this) { dScnPly_c::setPauseTimer(0); } - if (l_HIO.one_hit_kill != 0 || bullbo_p->field_0x79e >= 2) { + if (l_HIO.one_hit_kill != 0 || bullbo_p->mLapCount >= 2) { mDoAud_bgmStop(30); i_this->mAction = ACTION_IKKI_END; i_this->mMode = 0; @@ -4299,25 +4299,25 @@ static void damage_check(e_rd_class* i_this) { } } - bullbo_p->field_0x79e++; - bullbo_p->field_0x79f++; + bullbo_p->mLapCount++; + bullbo_p->mPathAdjustCounter++; part_break(i_this); - if (bullbo_p->field_0x79e == 1 || bullbo_p->field_0x79e == 2 || bullbo_p->field_0x79e == 3 || - bullbo_p->field_0x79e == 4 || bullbo_p->field_0x79e == 6) { + if (bullbo_p->mLapCount == 1 || bullbo_p->mLapCount == 2 || bullbo_p->mLapCount == 3 || + bullbo_p->mLapCount == 4 || bullbo_p->mLapCount == 6) { part_break(i_this); } - s8 sVar2 = 8 - bullbo_p->field_0x79e; + s8 sVar2 = 8 - bullbo_p->mLapCount; if (sVar2 > 8) { sVar2 = 8; } dComIfGs_BossLife_public_Set(sVar2); - if (bullbo_p->field_0x79e == 5) { + if (bullbo_p->mLapCount == 5) { Z2GetAudioMgr()->changeSubBgmStatus(2); } - if (bullbo_p->field_0x79e >= 8) { + if (bullbo_p->mLapCount >= 8) { i_this->mAction = ACTION_KIBA_END; i_this->mMode = 0; mDoAud_seStart(Z2SE_EN_RDB_V_FAINT, 0, 0, 0); diff --git a/src/d/actor/d_a_e_wb.cpp b/src/d/actor/d_a_e_wb.cpp index 98686f08d5a..e17bcc57865 100644 --- a/src/d/actor/d_a_e_wb.cpp +++ b/src/d/actor/d_a_e_wb.cpp @@ -9,6 +9,7 @@ #include "d/actor/d_a_obj_crvsteel.h" #include "d/d_msg_object.h" #include "d/actor/d_a_e_wb.h" +#include "Z2AudioLib/Z2Instances.h" #include "c/c_damagereaction.h" #include "d/actor/d_a_alink.h" #include "d/actor/d_a_e_rd.h" @@ -16,7 +17,6 @@ #include "d/d_s_play.h" #include "m_Do/m_Do_controller_pad.h" #include "m_Do/m_Do_graphic.h" -#include "Z2AudioLib/Z2Instances.h" class daE_WB_HIO_c : public JORReflexible { @@ -90,8 +90,8 @@ void daE_WB_HIO_c::genMessage(JORMContext* ctx) { ctx->genSlider("リーダーサイズ比", &leader_size_ratio, 0.0f, 5.0, 0, NULL, 0xFFFF, 0xFFFF, 512, 24); ctx->genSlider("移動速度", &movement_speed, 0.0f, 20.0f, 0, NULL, 0xFFFF, 0xFFFF, 512, 24); - ctx->genSlider("PL認識距離", &player_recognition_dist, 0.0f, 2000.0f, 0, NULL, 0xFFFF, - 0xFFFF, 512, 24); + ctx->genSlider("PL認識距離", &player_recognition_dist, 0.0f, 2000.0f, 0, NULL, 0xFFFF, 0xFFFF, + 512, 24); ctx->genSlider("最速度", &max_speed, 0.0f, 100.0f, 0, NULL, 0xFFFF, 0xFFFF, 512, 24); ctx->genSlider("騎馬戦最速", &cavalry_battle_max_speed, 0.0f, 100.0f, 0, NULL, 0xFFFF, 0xFFFF, 512, 24); @@ -99,10 +99,12 @@ void daE_WB_HIO_c::genMessage(JORMContext* ctx) { 24); ctx->genSlider("最速度(リ)", &leader_max_speed, 0.0f, 100.0f, 0, NULL, 0xFFFF, 0xFFFF, 512, 24); - ctx->genSlider("騎馬戦最(リ)", &leader_cavalry_battle_max_speed, 0.0f, 100.0f, 0, NULL, 0xFFFF, - 0xFFFF, 512, 24); - ctx->genSlider("通常速(車)", &normal_speed_vi, 0.0f, 100.0f, 0, NULL, 0xFFFF, 0xFFFF, 512, 24); - ctx->genSlider("中速度(車)", &medium_speed_vi, 0.0f, 100.0f, 0, NULL, 0xFFFF, 0xFFFF, 512, 24); + ctx->genSlider("騎馬戦最(リ)", &leader_cavalry_battle_max_speed, 0.0f, 100.0f, 0, NULL, + 0xFFFF, 0xFFFF, 512, 24); + ctx->genSlider("通常速(車)", &normal_speed_vi, 0.0f, 100.0f, 0, NULL, 0xFFFF, 0xFFFF, 512, + 24); + ctx->genSlider("中速度(車)", &medium_speed_vi, 0.0f, 100.0f, 0, NULL, 0xFFFF, 0xFFFF, 512, + 24); ctx->genSlider("最速度(車)", &mMaxSpeedVi, 0.0f, 100.0f, 0, NULL, 0xFFFF, 0xFFFF, 512, 24); ctx->genSlider("一騎速", &mSingleRiderSpeed, 0.0f, 100.0f, 0, NULL, 0xFFFF, 0xFFFF, 512, 24); ctx->genCheckBox("手綱ナシ", &mNoReins, 1, 0, NULL, 0xFFFF, 0xFFFF, 512, 24); @@ -150,7 +152,7 @@ static int nodeCallBack(J3DJoint* i_joint, int param_1) { MTXCopy(model->getAnmMtx(joint_no), *calc_mtx); if (joint_no == 0) { - cMtx_ZrotM(*calc_mtx, bullbo_p->field_0x79a); + cMtx_ZrotM(*calc_mtx, bullbo_p->mBodyTiltAngle); } else if (joint_no == 2 || joint_no == bullbo_p->field_0x688 + 0xb) { cMtx_YrotM(*calc_mtx, bullbo_p->field_0x6d8); } else if (joint_no == 4 || joint_no == 8 || @@ -159,7 +161,7 @@ static int nodeCallBack(J3DJoint* i_joint, int param_1) { (joint_no == 0x16 && bullbo_p->field_0x79d != 0) || (joint_no == 0x1B && bullbo_p->field_0x79d != 0)) { - cMtx_YrotM(*calc_mtx, bullbo_p->field_0x79a << 1); + cMtx_YrotM(*calc_mtx, bullbo_p->mBodyTiltAngle << 1); } if (bullbo_p->field_0x79d && joint_no == 0xd) { @@ -225,14 +227,14 @@ static void himo_control1(e_wb_class* i_this, cXyz* i_pos, int i_idx, s8 param_3 cXyz sp24; sp60.x = 0.0f; - sp60.y = i_this->field_0x1684; + sp60.y = i_this->mAnimDuration; sp60.z = sp60.y; MtxPosition(&sp60, &sp30); if (a_this->speedF > 20.0f) { - sp60.x = i_this->field_0x1684 * 0.4f; + sp60.x = i_this->mAnimDuration * 0.4f; } else { - sp60.x = i_this->field_0x1684 * 0.1f; + sp60.x = i_this->mAnimDuration * 0.1f; } if (i_idx == 0) { @@ -422,7 +424,7 @@ static int daE_WB_Draw(e_wb_class* i_this) { s8 cVar7 = 0; e_rd_class* pfVar4 = (e_rd_class*)fopAcM_SearchByID(i_this->field_0x1434); - if ((i_this->field_0x6be & 1) != 0) { + if ((i_this->mStatusFlags & 1) != 0) { if (pfVar4 && pfVar4->field_0x9bc == 2) { if (i_this->field_0x7a2 == 0) { model = pfVar4->mpModelMorf->getModel(); @@ -545,7 +547,7 @@ static s16 e_wb_wall_check(e_wb_class* i_this) { fopAc_ac_c* uVar3 = dComIfG_Bgsp().GetActorPointer(linChk); if (fopAcM_GetName(uVar3) != PROC_BG) { return 0; - } + } cXyz cStack_c4(linChk.GetCross()); cXyz cStack_d0; local_a0.x *= -1.0f; @@ -672,7 +674,7 @@ static BOOL e_wb_saku_jump_check(e_wb_class* i_this) { cStack_d8 = dStack_98.GetCross(); } else { return 0; - } + } local_a8 = cStack_d8 - cStack_cc; s16 sVar1 = (cM_atan2s(local_a8.x, local_a8.z) + 0x4000) - a_this->shape_angle.y; @@ -744,12 +746,12 @@ static void e_wb_wait(e_wb_class* i_this) { i_this->mActionMode = 1; case 1: if (a_this->speedF > 15.0f) { - i_this->field_0x142c = 2; + i_this->mMovementType = 2; i_this->mZ2Ride.startCreatureSoundLevel(Z2SE_EN_WB_L_SLIP, 0, -1); } else { anm_init(i_this, 0x2a, 10.0f, 2, 1.0f); i_this->mActionMode = 2; - i_this->field_0x6be |= 0x20; + i_this->mStatusFlags |= 0x20; } case 2: default: @@ -818,7 +820,7 @@ static void e_wb_pl_ride(e_wb_class* i_this) { } if (a_this->speedF > 10.0f) { - i_this->field_0x142c = 2; + i_this->mMovementType = 2; } } else { f32 stick_value = mDoCPd_c::getStickValue(0); @@ -846,8 +848,9 @@ static void e_wb_pl_ride(e_wb_class* i_this) { } } } - - s16 angle_y = dCam_getControledAngleY(dComIfGp_getCamera(dComIfGp_getPlayerCameraID(0))) + 0x10000 + stick_angle - 0x8000; + + s16 angle_y = dCam_getControledAngleY(dComIfGp_getCamera(dComIfGp_getPlayerCameraID(0))) + + 0x10000 + stick_angle - 0x8000; int iVar4 = 0; s16 angle_delta = angle_y - a_this->current.angle.y; @@ -865,7 +868,7 @@ static void e_wb_pl_ride(e_wb_class* i_this) { iVar4 = 3; } - if (i_this->field_0x142f == 2) { + if (i_this->mSpeedCapTimer == 2) { if (a_this->speedF < 0.1f) { if (iVar4 == 0) { fVar2 = 0.0; @@ -882,7 +885,7 @@ static void e_wb_pl_ride(e_wb_class* i_this) { a_this->speedF = l_HIO.mPlayerMountedMaxSpeed; } } - } else if (i_this->field_0x142f < 0 && iVar4 == 1) { + } else if (i_this->mSpeedCapTimer < 0 && iVar4 == 1) { fVar2 = 0.0f; } @@ -900,7 +903,7 @@ static void e_wb_pl_ride(e_wb_class* i_this) { if (i_this->mActionID == ACT_PL_RIDE) { cLib_addCalcAngleS2(&a_this->current.angle.y, angle_y, 4, 500); - i_this->mTargetAngleStep = 0; + i_this->mTurnStep = 0; } else { s16 local_94 = 0; s16 local_96 = KREG_S(3) + 0x40; @@ -913,14 +916,13 @@ static void e_wb_pl_ride(e_wb_class* i_this) { local_96 = KREG_S(4) + 0x10; } - cLib_addCalcAngleS2(&i_this->mTargetAngleStep, local_94, 4, local_96); - a_this->current.angle.y += i_this->mTargetAngleStep; + cLib_addCalcAngleS2(&i_this->mTurnStep, local_94, 4, local_96); + a_this->current.angle.y += i_this->mTurnStep; } i_this->mWaitRollAngle = a_this->current.angle.y - curr_angle_y; s16 temAngle = i_this->mWaitRollAngle * (TREG_S(7) - 8); - f32 fVar10 = - temAngle * a_this->speedF / (l_HIO.mPlayerMountedMaxSpeed + 1.0f); + f32 fVar10 = temAngle * a_this->speedF / (l_HIO.mPlayerMountedMaxSpeed + 1.0f); if (fVar10 > NREG_F(0x11) + 4500.0f) { fVar10 = NREG_F(0x11) + 4500.0f; @@ -928,7 +930,7 @@ static void e_wb_pl_ride(e_wb_class* i_this) { fVar10 = -NREG_F(0x11) - 4500.0f; } - cLib_addCalcAngleS2(&i_this->field_0x79a, (s16)fVar10, 8, 0x140); + cLib_addCalcAngleS2(&i_this->mBodyTiltAngle, (s16)fVar10, 8, 0x140); } if (a_this->speedF < 0.01f) { @@ -988,11 +990,12 @@ static void e_wb_pl_ride(e_wb_class* i_this) { } if (i_this->mAnmID == 0x20) { - i_this->mpModelMorf->setPlaySpeed(BREG_F(0) + 0.4f + - (l_HIO.mPlayerMountedMotionPlaybackSpeed * a_this->speedF) / - l_HIO.mPlayerMountedMaxSpeed); - i_this->field_0x142c = 1; - i_this->field_0x6bd = 1; + i_this->mpModelMorf->setPlaySpeed( + BREG_F(0) + 0.4f + + (l_HIO.mPlayerMountedMotionPlaybackSpeed * a_this->speedF) / + l_HIO.mPlayerMountedMaxSpeed); + i_this->mMovementType = 1; + i_this->mPursuitFlag = 1; } else if (i_this->mAnmID == 0x2b) { i_this->mpModelMorf->setPlaySpeed(TREG_F(4) + 0.7f + (TREG_F(5) + 0.05f) * a_this->speedF); @@ -1020,22 +1023,22 @@ static void e_wb_f_wait(e_wb_class* i_this) { } else { anm_init(i_this, 0x28, 5.0f, 2, 1.5f); i_this->mActionMode = 1; - i_this->field_0x6be |= 4; + i_this->mStatusFlags |= 4; } // fallthrough case 1: - + cLib_addCalcAngleS2(&a_this->current.angle.y, new_angle, 8, 0x200); i_this->field_0x6d0 = new_angle - a_this->current.angle.y; if (i_this->field_0x6d0 < 0x800 && i_this->field_0x6d0 > -0x800) { - if (i_this->field_0x142f > 0) { + if (i_this->mSpeedCapTimer > 0) { if (i_this->mAnmID != 0x2a) { anm_init(i_this, 0x2a, 10.0f, 2, 1.0f); } } else { fopAc_ac_c* player = dComIfGp_getPlayer(0); - i_this->mActionID = 6; + i_this->mActionID = ACT_C_F_RUN; i_this->mActionMode = 0; i_this->field_0x5d0 = player->current.pos; } @@ -1084,8 +1087,8 @@ static void e_wb_f_wait(e_wb_class* i_this) { } } - if (i_this->field_0x142f == 0) { - i_this->mActionID = 6; + if (i_this->mSpeedCapTimer == 0) { + i_this->mActionID = ACT_C_F_RUN; i_this->mActionMode = 0; } } @@ -1116,7 +1119,7 @@ static void e_wb_f_run(e_wb_class* i_this) { f32 dVar13 = fopAcM_searchPlayerDistanceXZ(a_this); f32 dVar16 = 0.0f; f32 uVar15 = 1.0f; - if ((i_this->field_0x6be & 1) == 0) { + if ((i_this->mStatusFlags & 1) == 0) { i_this->mActionID = ACT_A_RUN; i_this->mActionMode = 0; } else { @@ -1140,39 +1143,39 @@ static void e_wb_f_run(e_wb_class* i_this) { s16 sVar2 = a_this->current.angle.y; - switch(i_this->mActionMode) { + switch (i_this->mActionMode) { case 0: if (i_this->field_0x7a6 == 0) { anm_init(i_this, 0x1b, 3.0f, 0, 1.0f); i_this->mActionMode = 1; - i_this->field_0x1684 = 40.0f; - i_this->field_0x6be |= 8; + i_this->mAnimDuration = 40.0f; + i_this->mStatusFlags |= 8; } else { i_this->field_0x7a6 = 0; anm_init(i_this, 0x20, 5.0f, 2, 1.0f); i_this->mpModelMorf->setFrame(cM_rndF(10.0f)); i_this->mActionMode = 2; - i_this->field_0x6be |= 0x10; + i_this->mStatusFlags |= 0x10; i_this->mZ2Ride.startCreatureSound(Z2SE_EN_WB_KICK_GROUND, 0, -1); } break; case 1: if (i_this->mpModelMorf->checkFrame(3.0f)) { - i_this->field_0x142d |= 2; - i_this->field_0x142c = 10; + i_this->mCollisionFlags |= 2; + i_this->mMovementType = 10; } else if (i_this->mpModelMorf->checkFrame(15.0f)) { - i_this->field_0x142d |= 3; + i_this->mCollisionFlags |= 3; } if (i_this->mpModelMorf->isStop()) { anm_init(i_this, 0x20, 5.0f, 2, 1.0f); i_this->mActionMode = 2; - i_this->field_0x6be |= 0x10; + i_this->mStatusFlags |= 0x10; i_this->mZ2Ride.startCreatureSound(Z2SE_EN_WB_KICK_GROUND, 0, -1); } break; case 2: - i_this->field_0x6bd = 1; + i_this->mPursuitFlag = 1; if (bVar7) { dVar16 = dComIfGp_getHorseActor()->speedF; if (dVar16 > l_HIO.cavalry_battle_max_speed) { @@ -1183,7 +1186,7 @@ static void e_wb_f_run(e_wb_class* i_this) { s16 local_a4 = 0x80; if (i_this->field_0x6c0 != 0) { - i_this->mAngleTarget = local_8c->shape_angle.y; + i_this->mTargetFacingAngle = local_8c->shape_angle.y; i_this->field_0x5de = 0; uVar15 = 0.5f; } else { @@ -1196,7 +1199,7 @@ static void e_wb_f_run(e_wb_class* i_this) { MtxPosition(&local_70, &cStack_7c); cStack_7c += local_8c->current.pos; local_70 = cStack_7c - a_this->current.pos; - i_this->mAngleTarget = cM_atan2s(local_70.x, local_70.z); + i_this->mTargetFacingAngle = cM_atan2s(local_70.x, local_70.z); } if (pl_pass_check(i_this, i_this->field_0x7a8)) { @@ -1214,9 +1217,10 @@ static void e_wb_f_run(e_wb_class* i_this) { local_a4 = 0x400; } - cLib_addCalcAngleS2( - &a_this->current.angle.y, - i_this->mAngleTarget + i_this->field_0x5de + i_this->field_0x6d6, 8, local_a4); + cLib_addCalcAngleS2(&a_this->current.angle.y, + i_this->mTargetFacingAngle + i_this->field_0x5de + + i_this->field_0x6d6, + 8, local_a4); cLib_addCalcAngleS2(&i_this->field_0x5de, 0, 1, 100); f32 fVar1 = a_this->speedF / 40.0f; if (fVar1 < 1.0f) { @@ -1242,14 +1246,14 @@ static void e_wb_f_run(e_wb_class* i_this) { i_this->field_0x698[0] = 40; } } - i_this->field_0x142c = 1; + i_this->mMovementType = 1; break; case 3: - i_this->field_0x6bd = 1; + i_this->mPursuitFlag = 1; dVar16 = l_HIO.max_speed; uVar15 = 3.0f; - if (i_this->field_0x698[0] == 0xf) { - i_this->field_0x6be |= 0x20; + if (i_this->field_0x698[0] == 15) { + i_this->mStatusFlags |= 0x20; } if (i_this->field_0x698[0] == 0) { @@ -1257,11 +1261,11 @@ static void e_wb_f_run(e_wb_class* i_this) { anm_init(i_this, 0x25, 3.0f, 2, 1.0f); } - i_this->field_0x142c = 1; + i_this->mMovementType = 1; break; case ACT_RIDE: if (a_this->speedF > 15.0f) { - i_this->field_0x142c = 2; + i_this->mMovementType = 2; i_this->mZ2Ride.startCreatureSoundLevel(Z2SE_EN_WB_L_SLIP, 0, -1); } @@ -1274,11 +1278,10 @@ static void e_wb_f_run(e_wb_class* i_this) { } cLib_addCalc2(&a_this->speedF, dVar16, 1.0f, uVar15); - cLib_addCalcAngleS2( - &i_this->field_0x79a, - ( - 8) * (a_this->current.angle.y - sVar2), 8, 0x200); - if (i_this->mActionMode < 4 && i_this->field_0x142f > 0) { - i_this->field_0x6be |= 0x20; + cLib_addCalcAngleS2(&i_this->mBodyTiltAngle, (-8) * (a_this->current.angle.y - sVar2), 8, + 0x200); + if (i_this->mActionMode < 4 && i_this->mSpeedCapTimer > 0) { + i_this->mStatusFlags |= 0x20; anm_init(i_this, 0x25, 3.0f, 2, 1.0f); if (a_this->speedF > 30.0f) { a_this->speedF = 30.0f; @@ -1317,10 +1320,10 @@ static void e_wb_b_wait(e_wb_class* i_this) { anm_init(i_this, 0x2a, 10.0f, 2, 1.0f); i_this->mActionMode = 1; i_this->field_0x698[0] = cM_rndF(100.0f) + 100.0f; - i_this->field_0x6be |= 0x20; + i_this->mStatusFlags |= 0x20; // fallthrough case 1: - if (i_this->field_0x698[0] == 0 && i_this->field_0x68c != 0) { + if (i_this->field_0x698[0] == 0 && i_this->mPathInitialized != 0) { i_this->mActionMode = 2; } else if (dVar7 < 2000.0f) { i_this->mActionID = ACT_B_RUN; @@ -1332,7 +1335,7 @@ static void e_wb_b_wait(e_wb_class* i_this) { cLib_addCalcAngleS2(&a_this->current.angle.y, sVar5, 8, 0x200); i_this->field_0x6d0 = sVar5 - a_this->current.angle.y; if (i_this->field_0x6d0 < 0x800 && i_this->field_0x6d0 > -0x800) { - if (i_this->field_0x142f > 0) { + if (i_this->mSpeedCapTimer > 0) { if (i_this->mAnmID != 0x2a) { anm_init(i_this, 0x2a, 10.0f, 2, 1.0f); } @@ -1345,7 +1348,7 @@ static void e_wb_b_wait(e_wb_class* i_this) { } break; } - + cLib_addCalc0(&a_this->speedF, 1.0f, 2.0f); } @@ -1370,17 +1373,17 @@ static void e_wb_b_run2(e_wb_class* i_this) { case 0: anm_init(i_this, 0x1b, 3.0f, 0, 1.0f); i_this->mActionMode = 1; - i_this->field_0x6be |= 8; - i_this->field_0x1684 = 40.0f; + i_this->mStatusFlags |= 8; + i_this->mAnimDuration = 40.0f; i_this->mPlaySpeed = 1.0f; break; case 1: if (i_this->mpModelMorf->checkFrame(3.0f) != 0) { - i_this->field_0x142d |= 2; - i_this->field_0x142c = 10; + i_this->mCollisionFlags |= 2; + i_this->mMovementType = 10; } else { if (i_this->mpModelMorf->checkFrame(15.0f) != 0) { - i_this->field_0x142d |= 3; + i_this->mCollisionFlags |= 3; } } @@ -1400,13 +1403,13 @@ static void e_wb_b_run2(e_wb_class* i_this) { } } - i_this->mBPathIdx = local_e0; + i_this->mCurrentPathIndex = local_e0; i_this->field_0x698[0] = cM_rndF(100.0f) + 100.0f; } break; case 2: - i_this->field_0x6bd = 1; + i_this->mPursuitFlag = 1; for (int i = 0; i < 8; i++) { cMtx_YrotS(*calc_mtx, i << 0xd); @@ -1416,35 +1419,35 @@ static void e_wb_b_run2(e_wb_class* i_this) { b_path2[i] = pos2; } - pos1 = b_path2[i_this->mBPathIdx] - a_this->current.pos; + pos1 = b_path2[i_this->mCurrentPathIndex] - a_this->current.pos; pos1.y = 0.0f; if (pos1.abs() < 600.0f) { int local_ec = 1; - pos1 = b_path2[(i_this->mBPathIdx + 1) & 7] - a_this->current.pos; + pos1 = b_path2[(i_this->mCurrentPathIndex + 1) & 7] - a_this->current.pos; s16 tmp = a_this->current.angle.y - cM_atan2s(pos1.x, pos1.z); if (tmp < 0x4000 && tmp > -0x4000) { - i_this->mBPathIdx += local_ec; + i_this->mCurrentPathIndex += local_ec; } else { - i_this->mBPathIdx -= local_ec; + i_this->mCurrentPathIndex -= local_ec; } - i_this->mBPathIdx &= 7; - i_this->mTargetAngleStep = 0; + i_this->mCurrentPathIndex &= 7; + i_this->mTurnStep = 0; } - pos1 = b_path2[i_this->mBPathIdx] - a_this->current.pos; - i_this->mAngleTarget = cM_atan2s(pos1.x, pos1.z); + pos1 = b_path2[i_this->mCurrentPathIndex] - a_this->current.pos; + i_this->mTargetFacingAngle = cM_atan2s(pos1.x, pos1.z); - cLib_addCalcAngleS2(&a_this->current.angle.y, i_this->mAngleTarget, 8, - i_this->mTargetAngleStep); - cLib_addCalcAngleS2(&i_this->mTargetAngleStep, 0x400, 1, 0x10); + cLib_addCalcAngleS2(&a_this->current.angle.y, i_this->mTargetFacingAngle, 8, + i_this->mTurnStep); + cLib_addCalcAngleS2(&i_this->mTurnStep, 0x400, 1, 0x10); fVar1 = 3.0f; fVar10 = l_HIO.leader_max_speed; - i_this->field_0x142c = 1; + i_this->mMovementType = 1; if (i_this->field_0x698[0] == 0 && dist < 5000.0f) { anm_init(i_this, 0x25, 3.0f, 2, 1.0f); @@ -1453,7 +1456,7 @@ static void e_wb_b_run2(e_wb_class* i_this) { break; case 3: if (a_this->speedF > 15.0f) { - i_this->field_0x142c = 2; + i_this->mMovementType = 2; } if (a_this->speedF < 1.0f) { @@ -1464,7 +1467,7 @@ static void e_wb_b_run2(e_wb_class* i_this) { } cLib_addCalc2(&a_this->speedF, fVar10, 1.0f, fVar1); - cLib_addCalcAngleS2(&i_this->field_0x79a, -4 * (a_this->current.angle.y - curr_angle), 8, + cLib_addCalcAngleS2(&i_this->mBodyTiltAngle, -4 * (a_this->current.angle.y - curr_angle), 8, 0x200); i_this->mpModelMorf->setPlaySpeed(i_this->mPlaySpeed); cLib_addCalc2(&i_this->mPlaySpeed, 1.0f, 1.0f, 0.1f); @@ -1480,7 +1483,7 @@ static void e_wb_b_run2(e_wb_class* i_this) { } } - if (i_this->mActionMode < 3 && i_this->field_0x142f > 0) { + if (i_this->mActionMode < 3 && i_this->mSpeedCapTimer > 0) { anm_init(i_this, 0x25, 3.0f, 2, 1.0f); if (a_this->speedF > 30.0f) @@ -1501,16 +1504,16 @@ static void e_wb_b_wait2(e_wb_class* i_this) { switch (i_this->mActionMode) { case 0: - if ( cM_rndF(1.0f) < 0.5f) { - i_this->mAngleTarget = sVar5 + 0x4000; + if (cM_rndF(1.0f) < 0.5f) { + i_this->mTargetFacingAngle = sVar5 + 0x4000; } else { - i_this->mAngleTarget = sVar5 - 0x4000; + i_this->mTargetFacingAngle = sVar5 - 0x4000; } i_this->mActionMode = 1; // fallthrough case 1: - cLib_addCalcAngleS2(&a_this->current.angle.y, i_this->mAngleTarget, 8, 0x200); - i_this->field_0x6d0 = i_this->mAngleTarget - a_this->current.angle.y; + cLib_addCalcAngleS2(&a_this->current.angle.y, i_this->mTargetFacingAngle, 8, 0x200); + i_this->field_0x6d0 = i_this->mTargetFacingAngle - a_this->current.angle.y; if (i_this->field_0x6d0 < 0x800 && i_this->field_0x6d0 > -0x800) { anm_init(i_this, 0x2a, 10.0f, 2, 1.0f); i_this->mActionMode = 2; @@ -1531,163 +1534,177 @@ static void e_wb_b_wait2(e_wb_class* i_this) { } /* 807D6058-807D6C2C 003CB8 0BD4+00 2/1 0/0 0/0 .text e_wb_b_run__FP10e_wb_class */ +/** + * @brief Handles the running action state for the Bullbo enemy. + * + * This function controls the Bullbo's behavior while running, including path initialization, + * following a generated path, adjusting speed based on the player's horse, handling jumps over fences or walls, + * and transitioning to other states like waiting or catching up. + * + * The path is an octagonal loop with randomized radii, regenerated when the Bullbo reaches a waypoint or periodically. + * Speed and animation are adjusted dynamically to match or exceed the player's pace during chases. + * + * @param i_this Pointer to the Bullbo instance (e_wb_class). + */ static void e_wb_b_run(e_wb_class* i_this) { fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; - fopAc_ac_c* player_p = dComIfGp_getPlayer(0); - cXyz pos1; - cXyz pos2; - f32 dist = fopAcM_searchPlayerDistanceXZ(a_this); - f32 speed_target = 0.0; - f32 speed_step = 1.0; + fopAc_ac_c* player = dComIfGp_getPlayer(0); + cXyz target_vector; + cXyz rotated_position; + f32 player_xz_distance = fopAcM_searchPlayerDistanceXZ(a_this); + f32 target_speed = 0.0; + f32 acceleration = 1.0; - if ((i_this->field_0x6be & 1) == 0) { - i_this->mActionID = 7; + if ((i_this->mStatusFlags & 1) == 0) { + i_this->mActionID = ACT_A_RUN; i_this->mActionMode = 0; } else { - s8 bVar11 = false; - f32 fVar14 = l_HIO.leader_cavalry_battle_max_speed; + s8 is_player_on_fast_horse = false; + f32 cavalry_max_speed = l_HIO.leader_cavalry_battle_max_speed; + if (daPy_getPlayerActorClass()->checkHorseRide() && dComIfGp_getHorseActor()->speedF >= 30.0f) { - bVar11 = true; + is_player_on_fast_horse = true; } - s16 sVar3 = a_this->current.angle.y; - f32 horse_speed = 1.0f; - s8 bVar4 = false; + s16 initial_facing_angle = a_this->current.angle.y; + f32 anim_speed_factor = 1.0f; + s8 regenerate_path = false; switch (i_this->mActionMode) { case 0: - i_this->field_0x6be |= 8; - case 1: - i_this->field_0x1684 = 30.0f; + i_this->mStatusFlags |= 8; + case 1: // path initialization + i_this->mAnimDuration = 30.0f; i_this->mPlaySpeed = 1.0f; anm_init(i_this, 0x20, 5.0f, 2, 1.0f); i_this->mActionMode = 2; - i_this->field_0x6be |= 0x10; + i_this->mStatusFlags |= 0x10; i_this->mZ2Ride.startCreatureSound(Z2SE_EN_WB_KICK_GROUND, 0, -1); - if (i_this->field_0x68c != 0) { - cXyz loop_pos1; - cXyz loop_pos2; - int local_e4 = 0; + if (i_this->mPathInitialized != 0) { + cXyz dist_to_point; + cXyz dist_to_other; + int closest_index = 0; for (int i = 1; i < 8; i++) { - loop_pos1 = b_path[local_e4] - a_this->current.pos; - loop_pos2 = b_path[i] - a_this->current.pos; + dist_to_point = b_path[closest_index] - a_this->current.pos; + dist_to_other = b_path[i] - a_this->current.pos; - if (loop_pos1.abs() > loop_pos2.abs()) { - local_e4 = i; + if (dist_to_point.abs() > dist_to_other.abs()) { + closest_index = i; } } - i_this->mBPathIdx = local_e4; + i_this->mCurrentPathIndex = closest_index; } else { if (lbl_244_bss_45 == 1) { - i_this->mBPathIdx = 6; + i_this->mCurrentPathIndex = 6; } else { - i_this->mBPathIdx = 2; + i_this->mCurrentPathIndex = 2; } - i_this->mBPathIdxIter = 1; - i_this->field_0x68c = 1; + i_this->mPathDirection = 1; + i_this->mPathInitialized = 1; } break; - case 2: // link giving chase - i_this->field_0x6bd = 1; - pos1 = b_path[i_this->mBPathIdx] - a_this->current.pos; - pos1.y = 0.0; + case 2: // path following + i_this->mPursuitFlag = 1; + target_vector = b_path[i_this->mCurrentPathIndex] - a_this->current.pos; + target_vector.y = 0.0; - if (pos1.abs() < 800.0f) { - if (i_this->field_0x79e >= 4 && cM_rndF(1.0f) < 0.05f) { - i_this->mBPathIdxIter = cM_rndF(6.0f) + 1.0f; + if (target_vector.abs() < 800.0f) { + if (i_this->mLapCount >= 4 && cM_rndF(1.0f) < 0.05f) { + i_this->mPathDirection = cM_rndF(6.0f) + 1.0f; } - pos1 = b_path[(i_this->mBPathIdx + 1) & 7] - a_this->current.pos; - s16 angle = a_this->current.angle.y - cM_atan2s(pos1.x, pos1.z); + target_vector = b_path[(i_this->mCurrentPathIndex + 1) & 7] - a_this->current.pos; + s16 angle_to_next = + a_this->current.angle.y - cM_atan2s(target_vector.x, target_vector.z); - if (angle < 0x4000 && angle > -0x4000) { - i_this->mBPathIdxIter = 1; + if (angle_to_next < 0x4000 && angle_to_next > -0x4000) { + i_this->mPathDirection = 1; } else { - i_this->mBPathIdxIter = -1; + i_this->mPathDirection = -1; } - OS_REPORT(" PT %d\n", i_this->mBPathIdx); - OS_REPORT(" DIR %d\n", i_this->mBPathIdxIter); + OS_REPORT(" PT %d\n", i_this->mCurrentPathIndex); + OS_REPORT(" DIR %d\n", i_this->mPathDirection); - i_this->mBPathIdx += i_this->mBPathIdxIter; - i_this->mBPathIdx &= 7; - bVar4 = true; - i_this->mTargetAngleStep = 0; + i_this->mCurrentPathIndex += i_this->mPathDirection; + i_this->mCurrentPathIndex &= 7; + regenerate_path = true; + i_this->mTurnStep = 0; } else { - if (i_this->field_0x79f >= 3) { - i_this->field_0x79f = 0; + if (i_this->mPathAdjustCounter >= 3) { + i_this->mPathAdjustCounter = 0; if (cM_rndF(1.0f) < 0.5f) { - i_this->mBPathIdx += 3; + i_this->mCurrentPathIndex += 3; } else { - i_this->mBPathIdx -= 3; + i_this->mCurrentPathIndex -= 3; } - i_this->mBPathIdx &= 7; - bVar4 = true; + i_this->mCurrentPathIndex &= 7; + regenerate_path = true; } } - pos1 = b_path[i_this->mBPathIdx] - a_this->current.pos; - i_this->mAngleTarget = cM_atan2s(pos1.x, pos1.z); - cLib_addCalcAngleS2(&a_this->current.angle.y, i_this->mAngleTarget, 8, - i_this->mTargetAngleStep); - cLib_addCalcAngleS2(&i_this->mTargetAngleStep, 0x400, 1, 0x10); + target_vector = b_path[i_this->mCurrentPathIndex] - a_this->current.pos; + i_this->mTargetFacingAngle = cM_atan2s(target_vector.x, target_vector.z); + cLib_addCalcAngleS2(&a_this->current.angle.y, i_this->mTargetFacingAngle, 8, + i_this->mTurnStep); + cLib_addCalcAngleS2(&i_this->mTurnStep, 0x400, 1, 0x10); - if (bVar11) { - speed_target = dComIfGp_getHorseActor()->speedF; + if (is_player_on_fast_horse) { + target_speed = dComIfGp_getHorseActor()->speedF; - if (speed_target > l_HIO.leader_cavalry_battle_max_speed) { - speed_target = l_HIO.leader_cavalry_battle_max_speed; + if (target_speed > l_HIO.leader_cavalry_battle_max_speed) { + target_speed = l_HIO.leader_cavalry_battle_max_speed; } else { - if (speed_target < l_HIO.leader_max_speed) { - speed_target = l_HIO.leader_max_speed; + if (target_speed < l_HIO.leader_max_speed) { + target_speed = l_HIO.leader_max_speed; } } if (fopAcM_searchPlayerDistanceXZ(a_this) < 2000.0f) { - speed_target *= 1.2f; + target_speed *= 1.2f; if (a_this->speedF < l_HIO.max_speed) { - speed_step = 1.5f; + acceleration = 1.5f; } else { - speed_step = 0.5f; + acceleration = 0.5f; } } - horse_speed = a_this->speedF / 40.0f; + anim_speed_factor = a_this->speedF / 40.0f; - if (horse_speed < 1.0f) - horse_speed = 1.0f; + if (anim_speed_factor < 1.0f) + anim_speed_factor = 1.0f; - if (horse_speed > 1.2f) - horse_speed = 1.2f; + if (anim_speed_factor > 1.2f) + anim_speed_factor = 1.2f; } else { - speed_step = 3.0; - speed_target = l_HIO.leader_max_speed; + acceleration = 3.0; + target_speed = l_HIO.leader_max_speed; } - if (dist > 6000.0f) { + if (player_xz_distance > 6000.0f) { i_this->mActionMode = 3; - i_this->field_0x698[0] = 0xd; + i_this->field_0x698[0] = 13; } - i_this->field_0x142c = 1; + i_this->mMovementType = 1; break; - case 3: - i_this->field_0x6bd = 1; - speed_target = l_HIO.max_speed; - speed_step = 3.0f; + case 3: + i_this->mPursuitFlag = 1; + target_speed = l_HIO.max_speed; + acceleration = 3.0f; if (i_this->field_0x698[0] == 10) { - i_this->field_0x6be |= 0x20; + i_this->mStatusFlags |= 0x20; } if (i_this->field_0x698[0] == 0) { @@ -1695,11 +1712,11 @@ static void e_wb_b_run(e_wb_class* i_this) { anm_init(i_this, 0x25, 3.0f, 2, 1.0f); } - i_this->field_0x142c = 1; + i_this->mMovementType = 1; break; - case 4: + case 4: // decelerating back to wait action if (a_this->speedF > 15.0f) { - i_this->field_0x142c = 2; + i_this->mMovementType = 2; } if (a_this->speedF < 1.0f) { @@ -1709,76 +1726,76 @@ static void e_wb_b_run(e_wb_class* i_this) { break; case 10: // jumping a fence / hit wall - speed_target = l_HIO.max_speed; - speed_step = 3.0f; - int anm_id = i_this->mAnmID; + target_speed = l_HIO.max_speed; + acceleration = 3.0f; + int current_anim = i_this->mAnmID; - if (anm_id == 0x18) { + if (current_anim == 0x18) { if (a_this->speed.y < 10.0f) { - anm_init(i_this, 0x19, 10.0f, 0, horse_speed); + anm_init(i_this, 0x19, 10.0f, 0, anim_speed_factor); } - } else if (anm_id == 0x19) { + } else if (current_anim == 0x19) { if (a_this->speed.y < -30.0f || i_this->mAcch.ChkGroundHit()) { anm_init(i_this, 0x1a, 2.0f, 0, 1.0f); - i_this->field_0x142d |= 0xc; - i_this->field_0x142e = 1; - i_this->field_0x6be |= 0x200; + i_this->mCollisionFlags |= 0xc; + i_this->mLandingFlag = 1; + i_this->mStatusFlags |= 0x200; } - } else if (anm_id == 0x1a) { - i_this->field_0x142c = 1; + } else if (current_anim == 0x1a) { + i_this->mMovementType = 1; if (i_this->mpModelMorf->isStop()) { anm_init(i_this, 0x20, 2.0f, 2, i_this->mPlaySpeed); - i_this->field_0x1684 = 30.0f; + i_this->mAnimDuration = 30.0f; i_this->mActionMode = 2; } } } if (i_this->mActionMode < 10) { - cLib_addCalc2(&a_this->speedF, speed_target, 1.0f, speed_step); - cLib_addCalcAngleS2(&i_this->field_0x79a, -4 * (a_this->current.angle.y - sVar3), 8, - 0x200); + cLib_addCalc2(&a_this->speedF, target_speed, 1.0f, acceleration); + cLib_addCalcAngleS2(&i_this->mBodyTiltAngle, + -4 * (a_this->current.angle.y - initial_facing_angle), 8, 0x200); i_this->mpModelMorf->setPlaySpeed(i_this->mPlaySpeed); - cLib_addCalc2(&i_this->mPlaySpeed, horse_speed, 1.0f, 0.1f); + cLib_addCalc2(&i_this->mPlaySpeed, anim_speed_factor, 1.0f, 0.1f); if (a_this->speedF >= 30.0f && i_this->mAcch.ChkGroundHit()) { if (i_this->mAcch.ChkWallHit() || e_wb_saku_jump_check(i_this)) { i_this->mActionMode = 10; a_this->speed.y = 55.0f; anm_init(i_this, 0x18, 2.0f, 0, 1.0f); - i_this->field_0x6be |= 0x100; + i_this->mStatusFlags |= 0x100; } } } - if (bVar4) { - pos1.x = 0.0f; - pos1.y = 1000.0f; + if (regenerate_path) { + target_vector.x = 0.0f; + target_vector.y = 1000.0f; for (int i = 0; i < 8; i++) { cMtx_YrotS(*calc_mtx, i << 0xd); if (lbl_244_bss_45 == 1) { - pos1.z = cM_rndF(3000.0f) + 12000.0f; - MtxPosition(&pos1, &pos2); - } else if (i_this->field_0x79e >= 4) { - pos1.z = cM_rndF(1000.0f) + 9000.0f; - MtxPosition(&pos1, &pos2); - pos2.x += 28108.0f; - pos2.z += 6640.0f; + target_vector.z = cM_rndF(3000.0f) + 12000.0f; + MtxPosition(&target_vector, &rotated_position); + } else if (i_this->mLapCount >= 4) { + target_vector.z = cM_rndF(1000.0f) + 9000.0f; + MtxPosition(&target_vector, &rotated_position); + rotated_position.x += 28108.0f; + rotated_position.z += 6640.0f; } else { - pos1.z = cM_rndF(3000.0f) + 12000.0f; - MtxPosition(&pos1, &pos2); - pos2.x += -2989.0f; - pos2.z += 1364.0f; + target_vector.z = cM_rndF(3000.0f) + 12000.0f; + MtxPosition(&target_vector, &rotated_position); + rotated_position.x += -2989.0f; + rotated_position.z += 1364.0f; } - b_path[i] = pos2; + b_path[i] = rotated_position; } } - if (i_this->field_0x142f > 0 && a_this->speedF > 30.0f) { + if (i_this->mSpeedCapTimer > 0 && a_this->speedF > 30.0f) { a_this->speedF = 30.0f; } } @@ -1790,9 +1807,7 @@ static void arrow_rd_set(e_wb_class* i_this) { fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; static cXyz arrow_rd_pos[1] = {cXyz(36460.0f, 1040.0f, -17020.0f)}; for (int i = 0; i < 1; i++) { - fopAcM_create( - PROC_E_RD, 0xff00a3ff, &arrow_rd_pos[i], - fopAcM_GetRoomNo(a_this), 0, 0, -1); + fopAcM_create(PROC_E_RD, 0xff00a3ff, &arrow_rd_pos[i], fopAcM_GetRoomNo(a_this), 0, 0, -1); } } @@ -1805,7 +1820,8 @@ static cXyz saku_p2(34800.0f, 0.0f, -37200.0f); /* 807D6CE0-807D79B0 004940 0CD0+00 1/1 0/0 0/0 .text e_wb_b_ikki__FP10e_wb_class */ static void e_wb_b_ikki(e_wb_class* i_this) { fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; - static cXyz ikki_pos[2] = { cXyz(34789.0f, -290.0f, -36200.0f), cXyz(34789.0f, -290.0f, -16600.0f) }; + static cXyz ikki_pos[2] = {cXyz(34789.0f, -290.0f, -36200.0f), + cXyz(34789.0f, -290.0f, -16600.0f)}; fopAc_ac_c* local_ac = dComIfGp_getPlayer(0); cXyz local_88; @@ -1821,53 +1837,52 @@ static void e_wb_b_ikki(e_wb_class* i_this) { switch (i_this->mActionMode) { case -100: - anm_init(i_this, 0x27, 5.0f, 2, 1.0f); - i_this->mActionMode = -99; - i_this->field_0x6be |= 0x400; - break; + anm_init(i_this, 0x27, 5.0f, 2, 1.0f); + i_this->mActionMode = -99; + i_this->mStatusFlags |= 0x400; + break; case -99: if (i_this->mpModelMorf->checkFrame(10.0f) || i_this->mpModelMorf->checkFrame(31.0f)) { - i_this->field_0x142d |= 1; - i_this->field_0x142c = 10; + i_this->mCollisionFlags |= 1; + i_this->mMovementType = 10; } break; case -98: anm_init(i_this, 0x26, 10.0f, 0, 1.0f); i_this->mActionMode = 0xff9f; - i_this->field_0x6be |= 0x800; + i_this->mStatusFlags |= 0x800; break; case -97: - if (i_this->mpModelMorf->checkFrame(38.0f) || - i_this->mpModelMorf->checkFrame(50.0f) || - i_this->mpModelMorf->checkFrame(65.0f) || - i_this->mpModelMorf->checkFrame(108.0f)) { - i_this->field_0x142d |= 1; - i_this->field_0x142c = 10; + if (i_this->mpModelMorf->checkFrame(38.0f) || i_this->mpModelMorf->checkFrame(50.0f) || + i_this->mpModelMorf->checkFrame(65.0f) || i_this->mpModelMorf->checkFrame(108.0f)) + { + i_this->mCollisionFlags |= 1; + i_this->mMovementType = 10; } else if (i_this->mpModelMorf->checkFrame(82.0f)) { - i_this->field_0x142d |= 3; + i_this->mCollisionFlags |= 3; } else if (i_this->mpModelMorf->checkFrame(106.0f)) { - i_this->field_0x142d |= 2; - i_this->field_0x142c = 10; + i_this->mCollisionFlags |= 2; + i_this->mMovementType = 10; } if (local_b0 >= 0x70) { if (local_b0 == 0x70) { - i_this->field_0x6be |= 0x10; + i_this->mStatusFlags |= 0x10; i_this->mZ2Ride.startCreatureSound(Z2SE_EN_WB_KICK_GROUND, 0, -1); i_this->mZ2Ride.startCreatureVoice(Z2SE_EN_RDB_V_HOICK, -1); - i_this->field_0x1684 = 40.0f; + i_this->mAnimDuration = 40.0f; } dVar17 = l_HIO.mSingleRiderSpeed; dVar16 = l_HIO.mSingleRiderSpeed * 0.2f; - i_this->field_0x142c = 1; + i_this->mMovementType = 1; } if (i_this->mpModelMorf->isStop()) { anm_init(i_this, 0x20, 1.0f, 2, 1.0f); i_this->mActionMode = 4; i_this->field_0x1690 = 0; - i_this->mBPathIdx = 1; - i_this->field_0x5c4 = ikki_pos[i_this->mBPathIdx]; + i_this->mCurrentPathIndex = 1; + i_this->field_0x5c4 = ikki_pos[i_this->mCurrentPathIndex]; } break; case 0: @@ -1878,30 +1893,30 @@ static void e_wb_b_ikki(e_wb_class* i_this) { case 1: if (i_this->field_0x698[3] == 0 && !dComIfGp_event_runCheck()) { i_this->mActionMode = 2; - i_this->mBPathIdx = 1; + i_this->mCurrentPathIndex = 1; } break; case 2: if (!i_this->field_0x5bf) { anm_init(i_this, 0x1b, 3.0f, 0, 1.0f); - i_this->field_0x6be |= 8; - i_this->field_0x1684 = 40.0f; - i_this->field_0x5c4 = ikki_pos[i_this->mBPathIdx]; + i_this->mStatusFlags |= 8; + i_this->mAnimDuration = 40.0f; + i_this->field_0x5c4 = ikki_pos[i_this->mCurrentPathIndex]; i_this->mActionMode = 3; } break; case 3: if (i_this->mpModelMorf->checkFrame(3.0f)) { - i_this->field_0x142d |= 2; - i_this->field_0x142c = 10; + i_this->mCollisionFlags |= 2; + i_this->mMovementType = 10; } else if (i_this->mpModelMorf->checkFrame(15.0)) { - i_this->field_0x142d |= 3; + i_this->mCollisionFlags |= 3; } if (i_this->mpModelMorf->isStop()) { anm_init(i_this, 0x20, 5.0f, 2, 1.0f); i_this->mActionMode = 4; - i_this->field_0x6be |= 0x10; + i_this->mStatusFlags |= 0x10; i_this->mZ2Ride.startCreatureSound(Z2SE_EN_WB_KICK_GROUND, 0, -1); i_this->field_0x1690 = 0; } @@ -1909,7 +1924,7 @@ static void e_wb_b_ikki(e_wb_class* i_this) { case 4: dVar17 = l_HIO.mSingleRiderSpeed; dVar16 = 5.0f; - i_this->field_0x142c = 1; + i_this->mMovementType = 1; if (sVar11 < 0x3000 && sVar11 > -0x3000 && dVar14 < 4000.0f && dVar14 > 600.0f) { i_this->field_0x6dc = 13; } else if (sVar11 < 0x800 && sVar11 > -0x800) { @@ -1921,7 +1936,7 @@ static void e_wb_b_ikki(e_wb_class* i_this) { } f32 fVar1; f32 fVar2; - if (i_this->field_0x79e == 0) { + if (i_this->mLapCount == 0) { fVar2 = l_HIO.mSearchIgnoreDistance2; fVar1 = l_HIO.mGuidanceDisplayDistance2; } else { @@ -1929,7 +1944,7 @@ static void e_wb_b_ikki(e_wb_class* i_this) { fVar1 = l_HIO.mGuidanceDisplayDistance1; } f32 dVar15 = fVar1; - + if (sVar11 < 0x3000 && sVar11 > -0x3000) { if (dVar14 > fVar2) { cLib_addCalc2(&a_this->current.pos.x, local_ac->current.pos.x, 0.05f, @@ -1953,37 +1968,37 @@ static void e_wb_b_ikki(e_wb_class* i_this) { } local_88 = i_this->field_0x5c4 - a_this->current.pos; - i_this->mAngleTarget = cM_atan2s(local_88.x, local_88.z); + i_this->mTargetFacingAngle = cM_atan2s(local_88.x, local_88.z); if (local_88.abs() < 600.0f) { anm_init(i_this, 0x25, 3.0f, 2, 1.0f); i_this->mActionMode = 5; - i_this->field_0x6be |= 0x20; + i_this->mStatusFlags |= 0x20; } local_d6 = 0x800; break; case 5: if (a_this->speedF > 15.0f) { - i_this->field_0x142c = 2; + i_this->mMovementType = 2; i_this->mZ2Ride.startCreatureSoundLevel(Z2SE_EN_WB_L_SLIP, 0, -1); } else if (a_this->speedF < 1.0f) { anm_init(i_this, 0x2a, 10.0f, 2, 1.0f); i_this->mActionMode = 6; - i_this->mAngleTarget -= 0x8000; + i_this->mTargetFacingAngle -= 0x8000; } break; case 6: local_d6 = 0x200; - i_this->field_0x6d0 = i_this->mAngleTarget - a_this->current.angle.y; + i_this->field_0x6d0 = i_this->mTargetFacingAngle - a_this->current.angle.y; if (i_this->field_0x6d0 < 0x800 && i_this->field_0x6d0 > -0x800) { i_this->mActionMode = 2; - i_this->mBPathIdx = 1 - i_this->mBPathIdx; + i_this->mCurrentPathIndex = 1 - i_this->mCurrentPathIndex; } else if (i_this->mAnmID != 0x28) { anm_init(i_this, 0x28, 5.0f, 2, 1.5f); } break; } - cLib_addCalcAngleS2(&a_this->current.angle.y, i_this->mAngleTarget, 2, local_d6); + cLib_addCalcAngleS2(&a_this->current.angle.y, i_this->mTargetFacingAngle, 2, local_d6); cLib_addCalcAngleS2(&i_this->field_0x7a4, local_d8, 8, i_this->field_0x1690 + 10000.0f); cLib_addCalc2(&a_this->speedF, dVar17, 1.0f, dVar16); if (a_this->current.pos.x > 35350.0f) { @@ -1993,7 +2008,7 @@ static void e_wb_b_ikki(e_wb_class* i_this) { } if (i_this->mActionMode == 4 && (sVar11 > 0x4000 || sVar11 < -0x4000) && i_this->field_0x5bf) { - if (i_this->mBPathIdx == 1 && local_ac->current.pos.z < ikki_pos[0].z + 12000.0f && + if (i_this->mCurrentPathIndex == 1 && local_ac->current.pos.z < ikki_pos[0].z + 12000.0f && a_this->current.pos.z > ikki_pos[1].z - 12000.0f) { a_this->current.pos.z = ikki_pos[1].z; @@ -2001,8 +2016,8 @@ static void e_wb_b_ikki(e_wb_class* i_this) { a_this->speedF = 0.0f; OS_REPORT(" WB CULL !!\n"); } else { - if (i_this->mBPathIdx == 0 && - local_ac->current.pos.z > ikki_pos[1].z - 12000.0f && + if (i_this->mCurrentPathIndex == 0 && + local_ac->current.pos.z > ikki_pos[1].z - 12000.0f && a_this->current.pos.z < ikki_pos[0].z + 12000.0f) { a_this->current.pos.z = ikki_pos[0].z; @@ -2012,10 +2027,11 @@ static void e_wb_b_ikki(e_wb_class* i_this) { } } } - + if (i_this->field_0x1722 != 0) { if (i_this->field_0x1722 == 1) { - static cXyz f_pos[2] = {cXyz(34800.0f, -300.0f, -15150.0f), cXyz(34800.0f, -300.0f, -37200.0f)}; + static cXyz f_pos[2] = {cXyz(34800.0f, -300.0f, -15150.0f), + cXyz(34800.0f, -300.0f, -37200.0f)}; csXyz cStack_a8; for (int i = 0; i < 2; i++) { static s16 f_ya[2] = { @@ -2034,8 +2050,10 @@ static void e_wb_b_ikki(e_wb_class* i_this) { } i_this->field_0x1722++; } - Z2GetAudioMgr()->seStartLevel(Z2SE_OBJ_STRAWFENCE_BURNING, &saku_p, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); - Z2GetAudioMgr()->seStartLevel(Z2SE_OBJ_STRAWFENCE_BURNING, &saku_p2, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); + Z2GetAudioMgr()->seStartLevel(Z2SE_OBJ_STRAWFENCE_BURNING, &saku_p, 0, 0, 1.0f, 1.0f, -1.0f, + -1.0f, 0); + Z2GetAudioMgr()->seStartLevel(Z2SE_OBJ_STRAWFENCE_BURNING, &saku_p2, 0, 0, 1.0f, 1.0f, + -1.0f, -1.0f, 0); } } @@ -2068,8 +2086,9 @@ static void e_wb_b_ikki_end(e_wb_class* i_this) { /* 807D7AD4-807D8490 005734 09BC+00 1/1 0/0 0/0 .text e_wb_b_ikki2__FP10e_wb_class */ static void e_wb_b_ikki2(e_wb_class* i_this) { fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; - static cXyz ikki2_pos[2] = { cXyz(-93620.0f, -5750.0f, 48944.0f), cXyz(-93620.0f, -5750.0f, 28423.0f) }; - + static cXyz ikki2_pos[2] = {cXyz(-93620.0f, -5750.0f, 48944.0f), + cXyz(-93620.0f, -5750.0f, 28423.0f)}; + fopAc_ac_c* player = dComIfGp_getPlayer(0); cXyz local_78; cXyz local_84; @@ -2080,11 +2099,11 @@ static void e_wb_b_ikki2(e_wb_class* i_this) { s16 turn_speed = 0x400; s16 local_b8 = 0; int local_b6; - + int frame = i_this->mpModelMorf->getFrame(); e_rd_class* rider = (e_rd_class*)fopAcM_SearchByID(i_this->field_0x1434); - - switch(i_this->mActionMode) { + + switch (i_this->mActionMode) { case -100: int local_a0 = dComIfGp_getEventManager().getMyStaffId("RiderBoss", NULL, 0); if (local_a0 != -1) { @@ -2111,50 +2130,50 @@ static void e_wb_b_ikki2(e_wb_class* i_this) { i_this->mActionMode = 1; i_this->field_0x698[3] = 10; break; - + case 1: if (i_this->field_0x698[3] == 0 && !dComIfGp_event_runCheck()) { i_this->mActionMode = 2; - i_this->mBPathIdx = 1; + i_this->mCurrentPathIndex = 1; Z2GetAudioMgr()->subBgmStart(Z2BGM_FACE_OFF_BATTLE); } break; - + case 2: if (!i_this->field_0x5bf) { anm_init(i_this, 0x1b, 3.0f, 0, 1.0f); - i_this->field_0x6be |= 8; - i_this->field_0x1684 = 40.0f; - i_this->field_0x5c4 = ikki2_pos[i_this->mBPathIdx]; + i_this->mStatusFlags |= 8; + i_this->mAnimDuration = 40.0f; + i_this->field_0x5c4 = ikki2_pos[i_this->mCurrentPathIndex]; i_this->mActionMode = 3; } break; - + case 3: if (frame < 15) { turn_speed = 0; } if (i_this->mpModelMorf->checkFrame(3.0f)) { - i_this->field_0x142d |= 2; - i_this->field_0x142c = 10; + i_this->mCollisionFlags |= 2; + i_this->mMovementType = 10; } else if (i_this->mpModelMorf->checkFrame(15.0f)) { - i_this->field_0x142d |= 3; + i_this->mCollisionFlags |= 3; } - + if (i_this->mpModelMorf->isStop()) { anm_init(i_this, 0x20, 5.0f, 2, 1.0f); i_this->mActionMode = 4; - i_this->field_0x6be |= 0x10; + i_this->mStatusFlags |= 0x10; i_this->mZ2Ride.startCreatureSound(Z2SE_EN_WB_KICK_GROUND, 0, -1); i_this->field_0x1690 = 0.0f; } break; - + case 4: target_speed = l_HIO.mSingleRiderSpeed; speed_step = 5.0f; - i_this->field_0x142c = 1; - + i_this->mMovementType = 1; + if (angle_diff < 0x3000 && angle_diff > -0x3000 && dist < 4000.0f && dist > 600.0f) { i_this->field_0x6dc = 13; } else if (angle_diff < 0x800 && angle_diff > -0x800) { @@ -2164,29 +2183,29 @@ static void e_wb_b_ikki2(e_wb_class* i_this) { } else { i_this->field_0x6da = 2; } - + f32 ignore_dist; f32 guidance_dist; - if (i_this->field_0x79e == 0) { + if (i_this->mLapCount == 0) { ignore_dist = l_HIO.mSearchIgnoreDistance2; guidance_dist = l_HIO.mGuidanceDisplayDistance2; } else { ignore_dist = l_HIO.mSearchIgnoreDistance1; guidance_dist = l_HIO.mGuidanceDisplayDistance1; } - + if (i_this->field_0x698[3] == 0 && angle_diff < 0x3000 && angle_diff > -0x3000) { if (dist > ignore_dist) { - cLib_addCalc2(&a_this->current.pos.x, player->current.pos.x, 0.05f, - a_this->speedF * i_this->field_0x1690); + cLib_addCalc2(&a_this->current.pos.x, player->current.pos.x, 0.05f, + a_this->speedF * i_this->field_0x1690); cLib_addCalc2(&i_this->field_0x1690, 0.6f, 1.0f, 0.06f); - + cMtx_YrotS(*calc_mtx, a_this->current.angle.y); local_78.x = a_this->current.pos.x - player->current.pos.x; local_78.z = 0.0f; local_78.y = 0.0f; MtxPosition(&local_78, &local_84); - + local_b8 = (s16)(local_84.x * -20.0f); if (local_b8 > 0x1000) { local_b8 = 0x1000; @@ -2194,67 +2213,71 @@ static void e_wb_b_ikki2(e_wb_class* i_this) { local_b8 = -0x1000; } } - } if (dist < guidance_dist) { daPy_getPlayerActorClass()->onSingleBoarAvoid(); } - - local_78 = i_this->field_0x5c4 - a_this->current.pos; - i_this->mAngleTarget = cM_atan2s(local_78.x, local_78.z); - if (i_this->field_0x79e >= 2) { - i_this->mAngleTarget += (s16)(2500.0f * cM_ssin(i_this->field_0x68e * 800)); + local_78 = i_this->field_0x5c4 - a_this->current.pos; + i_this->mTargetFacingAngle = cM_atan2s(local_78.x, local_78.z); + + if (i_this->mLapCount >= 2) { + i_this->mTargetFacingAngle += (s16)(2500.0f * cM_ssin(i_this->field_0x68e * 800)); } if (local_78.abs() < 700.0f) { anm_init(i_this, 0x25, 3.0f, 2, 1.0f); i_this->mActionMode = 5; - i_this->field_0x6be |= 0x20; + i_this->mStatusFlags |= 0x20; } - + turn_speed = 0x800; break; - + case 5: if (a_this->speedF > 15.0f) { - i_this->field_0x142c = 2; + i_this->mMovementType = 2; i_this->mZ2Ride.startCreatureSoundLevel(Z2SE_EN_WB_L_SLIP, 0, -1); } else if (a_this->speedF < 1.0f) { anm_init(i_this, 0x2a, 10.0f, 2, 1.0f); i_this->mActionMode = 6; - i_this->mAngleTarget -= 0x8000; + i_this->mTargetFacingAngle -= 0x8000; } break; - + case 6: turn_speed = 0x200; - i_this->field_0x6d0 = i_this->mAngleTarget - a_this->current.angle.y; - + i_this->field_0x6d0 = i_this->mTargetFacingAngle - a_this->current.angle.y; + if (i_this->field_0x6d0 < 0x800 && i_this->field_0x6d0 > -0x800) { i_this->mActionMode = 2; - i_this->mBPathIdx = 1 - i_this->mBPathIdx; + i_this->mCurrentPathIndex = 1 - i_this->mCurrentPathIndex; } else if (i_this->mAnmID != 0x28) { anm_init(i_this, 0x28, 5.0f, 2, 1.5f); } break; } - - cLib_addCalcAngleS2(&a_this->current.angle.y, i_this->mAngleTarget, 2, turn_speed); + + cLib_addCalcAngleS2(&a_this->current.angle.y, i_this->mTargetFacingAngle, 2, turn_speed); cLib_addCalcAngleS2(&i_this->field_0x7a4, local_b8, 8, i_this->field_0x1690 + 10000.0f); cLib_addCalc2(&a_this->speedF, target_speed, 1.0f, speed_step); - + // Handle position culling logic - if (i_this->mActionMode == 4 && (angle_diff > 0x4000 || angle_diff < -0x4000) && i_this->field_0x5bf) { - if (i_this->mBPathIdx == 1 && player->current.pos.z < ikki2_pos[0].z + 12000.0f && - a_this->current.pos.z > ikki2_pos[1].z - 12000.0f) { + if (i_this->mActionMode == 4 && (angle_diff > 0x4000 || angle_diff < -0x4000) && + i_this->field_0x5bf) + { + if (i_this->mCurrentPathIndex == 1 && player->current.pos.z < ikki2_pos[0].z + 12000.0f && + a_this->current.pos.z > ikki2_pos[1].z - 12000.0f) + { a_this->current.pos.z = ikki2_pos[1].z; i_this->mActionMode = 5; a_this->speedF = 0.0f; OS_REPORT(" WB CULL !!\n"); - } else if (i_this->mBPathIdx == 0 && player->current.pos.z > ikki2_pos[1].z - 12000.0f && - a_this->current.pos.z < ikki2_pos[0].z + 12000.0f) { + } else if (i_this->mCurrentPathIndex == 0 && + player->current.pos.z > ikki2_pos[1].z - 12000.0f && + a_this->current.pos.z < ikki2_pos[0].z + 12000.0f) + { a_this->current.pos.z = ikki2_pos[0].z; i_this->mActionMode = 5; a_this->speedF = 0.0f; @@ -2266,43 +2289,43 @@ static void e_wb_b_ikki2(e_wb_class* i_this) { /* 807D8490-807D8648 0060F0 01B8+00 1/1 0/0 0/0 .text e_wb_b_ikki2_end__FP10e_wb_class */ static void e_wb_b_ikki2_end(e_wb_class* i_this) { fopAc_ac_c* a_this = (fopAc_ac_c*)i_this; - + switch (i_this->mActionMode) { case 0: a_this->current.pos.x = -93620.0f; anm_init(i_this, 0x20, 1.0f, 2, 1.0f); i_this->mActionMode = 1; i_this->field_0x68e = 0; - // fallthrough + // fallthrough case 1: if (i_this->field_0x68e > 170 && i_this->mAcch.ChkWallHit()) { i_this->mActionID = ACT_BG_DAMAGE; i_this->mActionMode = 0; - i_this->field_0x1684 = 50.0f; + i_this->mAnimDuration = 50.0f; i_this->mZ2Ride.startCreatureVoice(Z2SE_EN_WB_V_DAMAGE, -1); dComIfGp_getVibration().StartShock(8, 0x4f, cXyz(0.0f, 1.0f, 0.0f)); - i_this->field_0x142e = 1; + i_this->mLandingFlag = 1; } break; } - + a_this->speedF = l_HIO.mSingleRiderSpeed; - + if (i_this->field_0x68e == 180) { i_this->field_0x7ac.SetWall(100.0f, 300.0f + BREG_F(11)); } - + s16 angle_offset; if (i_this->field_0x68e > 170) { angle_offset = -15000; } else { angle_offset = (s16)(3000.0f * cM_ssin(i_this->field_0x68e * 1000)); } - + s16 curr_angle = a_this->current.angle.y; cLib_addCalcAngleS2(&a_this->current.angle.y, angle_offset + 0x8000, 2, 0x800); - cLib_addCalcAngleS2(&i_this->field_0x79a, - -13 * (a_this->current.angle.y - curr_angle), 8, 0x800); + cLib_addCalcAngleS2(&i_this->mBodyTiltAngle, -13 * (a_this->current.angle.y - curr_angle), 8, + 0x800); } /* 807D8648-807D88D8 0062A8 0290+00 2/1 0/0 0/0 .text e_wb_b_lv9_end__FP10e_wb_class */ @@ -2312,7 +2335,7 @@ static void e_wb_b_lv9_end(e_wb_class* i_this) { f32 target_speed = 0.0f; f32 speed_step = 0.5f; s16 curr_angle = a_this->current.angle.y; - + switch (i_this->mActionMode) { case 0: i_this->field_0x698[0] = 30; @@ -2323,7 +2346,7 @@ static void e_wb_b_lv9_end(e_wb_class* i_this) { local_44.z = -2729.0f - a_this->current.pos.z; a_this->current.angle.y = cM_atan2s(local_44.x, local_44.z); a_this->shape_angle.y = a_this->current.angle.y; - i_this->mAngleTarget = a_this->current.angle.y; + i_this->mTargetFacingAngle = a_this->current.angle.y; // fallthrough case 1: if (i_this->field_0x698[0] == 0) { @@ -2336,13 +2359,13 @@ static void e_wb_b_lv9_end(e_wb_class* i_this) { if (i_this->field_0x698[0] == 0) { anm_init(i_this, 0x2a, 10.0f, 2, 1.0f); i_this->mActionMode = 3; - i_this->field_0x6be |= 8; + i_this->mStatusFlags |= 8; i_this->field_0x698[0] = 40; } break; case 3: if (i_this->field_0x698[0] == 1) { - i_this->field_0x6be |= 8; + i_this->mStatusFlags |= 8; } break; case 4: @@ -2360,19 +2383,19 @@ static void e_wb_b_lv9_end(e_wb_class* i_this) { target_speed = NREG_F(13) + 40.0f; speed_step = 5.0f; if (i_this->field_0x698[0] < 30) { - i_this->field_0x142c = 1; + i_this->mMovementType = 1; } if (i_this->field_0x698[0] == 0) { local_44.x = -12682.0f - a_this->current.pos.x; local_44.z = -2701.0f - a_this->current.pos.z; - i_this->mAngleTarget = cM_atan2s(local_44.x, local_44.z); + i_this->mTargetFacingAngle = cM_atan2s(local_44.x, local_44.z); } break; } - + cLib_addCalc2(&a_this->speedF, target_speed, 1.0f, speed_step); - cLib_addCalcAngleS2(&a_this->current.angle.y, i_this->mAngleTarget, 4, 0x100); - cLib_addCalcAngleS2(&i_this->field_0x79a, + cLib_addCalcAngleS2(&a_this->current.angle.y, i_this->mTargetFacingAngle, 4, 0x100); + cLib_addCalcAngleS2(&i_this->mBodyTiltAngle, (NREG_S(0) + -8) * (a_this->current.angle.y - curr_angle), 8, 0x200); } @@ -2386,27 +2409,27 @@ static void e_wb_a_run(e_wb_class* i_this) { case 0: anm_init(i_this, 0x20, 5.0f, 2, 1.399999976158142f); i_this->mActionMode = 1; - i_this->mAngleTarget = a_this->current.angle.y; + i_this->mTargetFacingAngle = a_this->current.angle.y; i_this->field_0x698[1] = cM_rndF(30.0f) + 80.0f; case 1: - i_this->field_0x6bd = 1; - i_this->field_0x142c = 1; + i_this->mPursuitFlag = 1; + i_this->mMovementType = 1; if (i_this->field_0x698[0] == 0) { i_this->field_0x698[0] = cM_rndF(30.0f) + 10.0f; - i_this->mAngleTarget += (s16)cM_rndFX(10000.0f); + i_this->mTargetFacingAngle += (s16)cM_rndFX(10000.0f); } - if (i_this->field_0x698[1] == 1 || i_this->field_0x142f == 2) { + if (i_this->field_0x698[1] == 1 || i_this->mSpeedCapTimer == 2) { i_this->mActionID = ACT_LR_DAMAGE; i_this->mZ2Ride.startCreatureVoice(Z2SE_EN_WB_V_DAMAGE, -1); i_this->mActionMode = 0; } default: - cLib_addCalcAngleS2(&a_this->current.angle.y, i_this->mAngleTarget, 8, 0x800); + cLib_addCalcAngleS2(&a_this->current.angle.y, i_this->mTargetFacingAngle, 8, 0x800); cLib_addCalc2(&a_this->speedF, l_HIO.max_speed * 1.2f, 1.0f, 2.0f); - cLib_addCalcAngleS2(&i_this->field_0x79a, (a_this->current.angle.y - curr_angle_y) * -8, 8, - 0x200); + cLib_addCalcAngleS2(&i_this->mBodyTiltAngle, (a_this->current.angle.y - curr_angle_y) * -8, + 8, 0x200); } } @@ -2420,11 +2443,11 @@ static void e_wb_s_damage(e_wb_class* i_this) { switch (i_this->mActionMode) { case 0: if (a_this->speedF <= 5.0f) { - if ((i_this->field_0x6be & 3) != 0) { + if ((i_this->mStatusFlags & 3) != 0) { anm_init(i_this, 9, 2.0f, 0, 1.0f); } else { anm_init(i_this, 8, 2.0f, 0, 1.0f); - i_this->field_0x1684 = 50.0f; + i_this->mAnimDuration = 50.0f; i_this->field_0x168a = 5000; } } else { @@ -2434,7 +2457,7 @@ static void e_wb_s_damage(e_wb_class* i_this) { break; case 1: if (i_this->mpModelMorf->isStop()) { - if ((i_this->field_0x6be & 3) != 0) { + if ((i_this->mStatusFlags & 3) != 0) { i_this->mActionID = i_this->field_0x692; if (i_this->mActionID == ACT_WAIT2) { i_this->mActionID = ACT_C_F_RUN; @@ -2446,7 +2469,7 @@ static void e_wb_s_damage(e_wb_class* i_this) { i_this->field_0x1432 = l_HIO.mPlayerMountedDashTime; a_this->speedF = 0.0f; anm_init(i_this, 0x1b, 3.0f, 0, 1.0f); - i_this->field_0x1684 = 40.0f; + i_this->mAnimDuration = 40.0f; OS_REPORT(" RIDE RUN START \n"); return; } @@ -2480,7 +2503,7 @@ static int e_wb_damage(e_wb_class* i_this) { a_this->speedF = -15.0f; a_this->speed.y = 50.0f + cM_rndF(20.0f); a_this->current.angle.y += (s16)cM_rndFX(3000.0f); - i_this->field_0x6be |= 0x40; + i_this->mStatusFlags |= 0x40; break; case 1: @@ -2570,7 +2593,7 @@ static int e_wb_bg_damage(e_wb_class* i_this) { anm_init(i_this, 5, 2.0f, 0, 1.0f); i_this->mActionMode = 1; a_this->speedF = 0.0f; - i_this->field_0x6be |= 0x80; + i_this->mStatusFlags |= 0x80; i_this->field_0x1432 = 0; break; @@ -2622,7 +2645,7 @@ static int e_wb_lr_damage(e_wb_class* i_this) { i_this->field_0x6e4 = 1; } i_this->mActionMode = 1; - i_this->field_0x6be |= 0x40; + i_this->mStatusFlags |= 0x40; i_this->field_0x698[0] = (s16)(cM_rndF(60.0f) + 150.0f); i_this->field_0x698[1] = 15; @@ -2639,7 +2662,7 @@ static int e_wb_lr_damage(e_wb_class* i_this) { { int frame = i_this->mpModelMorf->getFrame(); if (frame == 10) { - i_this->field_0x1684 = 40.0f; + i_this->mAnimDuration = 40.0f; i_this->field_0x168a = 4000; if (a_this->speedF > 30.0f) { @@ -2651,7 +2674,7 @@ static int e_wb_lr_damage(e_wb_class* i_this) { i_this->mActionMode = 2; a_this->speedF = 30.0f; } - i_this->field_0x142e = 1; + i_this->mLandingFlag = 1; dKy_Sound_set(a_this->current.pos, 100, fopAcM_GetID(a_this), 5); } @@ -2684,7 +2707,7 @@ static int e_wb_lr_damage(e_wb_class* i_this) { } if (a_this->speedF > 15.0f) { - i_this->field_0x142c = 2; + i_this->mMovementType = 2; } if (i_this->field_0x698[0] == 0 && i_this->field_0x1720 == 0) { @@ -2752,8 +2775,8 @@ static void e_wb_kiba_end(e_wb_class* i_this) { break; case 1: - i_this->field_0x142c = 1; - i_this->field_0x1684 = 60.0f; + i_this->mMovementType = 1; + i_this->mAnimDuration = 60.0f; i_this->field_0x168a = 5000; if (a_this->current.pos.x > 34000.0f && a_this->current.pos.x < 35500.0f && @@ -2763,7 +2786,7 @@ static void e_wb_kiba_end(e_wb_class* i_this) { anm_init(i_this, 0x18, 2.0f, 0, 1.0f); i_this->mActionMode = 2; i_this->mZ2Ride.startCreatureVoice(Z2SE_EN_RDB_V_HOICK, -1); - i_this->field_0x6be |= 0x100; + i_this->mStatusFlags |= 0x100; } break; @@ -2778,9 +2801,9 @@ static void e_wb_kiba_end(e_wb_class* i_this) { if (i_this->mAnmID == 0x19) { if (a_this->speed.y < -30.0f || i_this->mAcch.ChkGroundHit()) { anm_init(i_this, 0x1a, 2.0f, 0, 1.0f); - i_this->field_0x142d |= 0xc; - i_this->field_0x142e = 1; - i_this->field_0x6be |= 0x200; + i_this->mCollisionFlags |= 0xc; + i_this->mLandingFlag = 1; + i_this->mStatusFlags |= 0x200; } } else if (i_this->mAnmID == 0x1a && i_this->mpModelMorf->isStop()) { anm_init(i_this, 0x20, 2.0f, 2, 1.0f); @@ -2842,7 +2865,7 @@ static void damage_check(e_wb_class* i_this) { e_rd_class* rider = (e_rd_class*)fopAcM_SearchByID(i_this->field_0x1434); rider->field_0x998 = 20; } else { - if (i_this->field_0x79d == 0 || i_this->field_0x142f == 0) { + if (i_this->field_0x79d == 0 || i_this->mSpeedCapTimer == 0) { fopAc_ac_c* hit_actor = i_this->field_0xa00[i].GetCoHitObj()->GetAc(); if (a_this->speedF >= 20.0f) { @@ -2880,7 +2903,7 @@ static void damage_check(e_wb_class* i_this) { i_this->field_0x13c0.mpCollider = i_this->field_0xa00[i].GetTgHitObj(); if (i_this->field_0x79d != 0 || (daPy_getPlayerActorClass()->checkHorseRide() && - (i_this->field_0x6be & 3) != 0)) { + (i_this->mStatusFlags & 3) != 0)) { if (i_this->field_0x79d != 0) { def_se_set(&i_this->mZ2Ride, i_this->field_0x13c0.mpCollider, 0x28, NULL); } @@ -2888,7 +2911,7 @@ static void damage_check(e_wb_class* i_this) { at_power_check(&i_this->field_0x13c0); cc_at_check(a_this, &i_this->field_0x13c0); - if ((i_this->field_0x6be & 3) != 0) { + if ((i_this->mStatusFlags & 3) != 0) { if (i_this->field_0x13c0.mAttackPower < 30) { i_this->field_0x692 = i_this->mActionID; i_this->mActionID = ACT_S_DAMAGE; @@ -2908,7 +2931,7 @@ static void damage_check(e_wb_class* i_this) { i_this->field_0x6a0 = 10; } - i_this->field_0x1684 = 30.0f; + i_this->mAnimDuration = 30.0f; return; } } @@ -2935,13 +2958,13 @@ static void effect_set(e_wb_class* i_this) { is_water = true; } - if (i_this->field_0x142c == 1) { + if (i_this->mMovementType == 1) { if (i_this->mpModelMorf->checkFrame(11.0f)) { - i_this->field_0x142d |= 4; + i_this->mCollisionFlags |= 4; } else if (i_this->mpModelMorf->checkFrame(13.0f)) { - i_this->field_0x142d |= 8; + i_this->mCollisionFlags |= 8; } - } else if (i_this->field_0x142c == 2) { + } else if (i_this->mMovementType == 2) { pos.set(0.0f, 0.0f, 0.0f); J3DModel* model = i_this->mpModelMorf->getModel(); int foot_idx = (i_this->field_0x68e & 2) >> 1; @@ -2971,11 +2994,11 @@ static void effect_set(e_wb_class* i_this) { } } - if (i_this->field_0x142d != 0) { + if (i_this->mCollisionFlags != 0) { J3DModel* model = i_this->mpModelMorf->getModel(); pos.set(0.0f, 0.0f, 0.0f); - if ((i_this->field_0x142d & 1) != 0) { + if ((i_this->mCollisionFlags & 1) != 0) { MTXCopy(model->getAnmMtx(10), *calc_mtx); MtxPosition(&pos, &effect_pos); if (is_water) { @@ -2983,14 +3006,14 @@ static void effect_set(e_wb_class* i_this) { } else { fopAcM_effSmokeSet2(i_this->field_0x13e8 + 1, i_this->field_0x1408 + 1, &effect_pos, &a_this->shape_angle, a_this->scale.z * 2.0f, &a_this->tevStr); - if (i_this->field_0x142c != 0) { + if (i_this->mMovementType != 0) { i_this->field_0x13fc = dComIfGp_particle_set(i_this->field_0x13fc, dPa_RM(ID_ZI_S_WBCLOD_A), &effect_pos, &a_this->shape_angle, 0); } } } - if ((i_this->field_0x142d & 2) != 0) { + if ((i_this->mCollisionFlags & 2) != 0) { MTXCopy(model->getAnmMtx(6), *calc_mtx); MtxPosition(&pos, &effect_pos); if (is_water) { @@ -2998,14 +3021,14 @@ static void effect_set(e_wb_class* i_this) { } else { fopAcM_effSmokeSet2(i_this->field_0x13e8, i_this->field_0x1408, &effect_pos, &a_this->shape_angle, a_this->scale.z * 2.0f, &a_this->tevStr); - if (i_this->field_0x142c != 0) { + if (i_this->mMovementType != 0) { i_this->field_0x13f8 = dComIfGp_particle_set(i_this->field_0x13f8, dPa_RM(ID_ZI_S_WBCLOD_A), &effect_pos, &a_this->shape_angle, 0); } } } - if ((i_this->field_0x142d & 4) != 0) { + if ((i_this->mCollisionFlags & 4) != 0) { if (i_this->field_0x79d != 0) { MTXCopy(model->getAnmMtx(29), *calc_mtx); } else { @@ -3017,14 +3040,14 @@ static void effect_set(e_wb_class* i_this) { } else { fopAcM_effSmokeSet2(&i_this->field_0x13f0, &i_this->field_0x1410, &effect_pos, &a_this->shape_angle, a_this->scale.z * 2.0f, &a_this->tevStr); - if (i_this->field_0x142c != 0) { + if (i_this->mMovementType != 0) { i_this->field_0x1400 = dComIfGp_particle_set(i_this->field_0x1400, dPa_RM(ID_ZI_S_WBCLOD_A), &effect_pos, &a_this->shape_angle, 0); } } } - if ((i_this->field_0x142d & 8) != 0) { + if ((i_this->mCollisionFlags & 8) != 0) { if (i_this->field_0x79d != 0) { MTXCopy(model->getAnmMtx(24), *calc_mtx); } else { @@ -3036,7 +3059,7 @@ static void effect_set(e_wb_class* i_this) { } else { fopAcM_effSmokeSet2(&i_this->field_0x13f4, &i_this->field_0x1414, &effect_pos, &a_this->shape_angle, a_this->scale.z * 2.0f, &a_this->tevStr); - if (i_this->field_0x142c != 0) { + if (i_this->mMovementType != 0) { i_this->field_0x1404 = dComIfGp_particle_set(i_this->field_0x1404, dPa_RM(ID_ZI_S_WBCLOD_A), &effect_pos, &a_this->shape_angle, 0); } @@ -3044,7 +3067,7 @@ static void effect_set(e_wb_class* i_this) { } } - if (i_this->field_0x142e != 0) { + if (i_this->mLandingFlag != 0) { if (is_water) { in_water = true; } else { @@ -3074,7 +3097,7 @@ static void effect_set(e_wb_class* i_this) { }; for (int i = 0; i < 3; i++) { - if (i_this->field_0x142c == 2) { + if (i_this->mMovementType == 2) { i_this->field_0x1420[i] = dComIfGp_particle_set(i_this->field_0x1420[i], w_eff_name2[i], &effect_pos, &a_this->tevStr, &angle, &scale, 0xff, 0, -1, 0, 0, 0); } else { @@ -3102,9 +3125,9 @@ static void effect_set(e_wb_class* i_this) { i_this->field_0x1721 = 0; } - i_this->field_0x142c = 0; - i_this->field_0x142d = 0; - i_this->field_0x142e = 0; + i_this->mMovementType = 0; + i_this->mCollisionFlags = 0; + i_this->mLandingFlag = 0; } /* 807DA5D8-807DA6EC 008238 0114+00 1/1 0/0 0/0 .text wb_rd_reset__FP10e_wb_class */ @@ -3236,7 +3259,7 @@ static s8 e_wb_c_run(e_wb_class* i_this) { wall_check = e_wb_lr_wall_check(i_this); - if ((i_this->field_0x6be & 1) == 0) { + if ((i_this->mStatusFlags & 1) == 0) { i_this->mActionID = ACT_A_RUN; i_this->mActionMode = 0; return false; @@ -3249,7 +3272,7 @@ static s8 e_wb_c_run(e_wb_class* i_this) { case 0: anm_init(i_this, 0x2a, 10.0f, 2, 1.0f); i_this->mActionMode = 1; - i_this->field_0x6be |= 0x20; + i_this->mStatusFlags |= 0x20; // fallthrough case 1: @@ -3273,30 +3296,30 @@ static s8 e_wb_c_run(e_wb_class* i_this) { if (i_this->field_0x7a6 == 0) { anm_init(i_this, 0x1b, 3.0f, 0, 1.0f); i_this->mActionMode = 0xb; - i_this->field_0x1684 = 40.0f; - i_this->field_0x6be |= 8; + i_this->mAnimDuration = 40.0f; + i_this->mStatusFlags |= 8; } else { i_this->field_0x7a6 = 0; anm_init(i_this, 0x20, 5.0f, 2, 1.0f); f32 rnd_frame = cM_rndF(10.0f); i_this->mpModelMorf->setFrame(rnd_frame); i_this->mActionMode = 0xc; - i_this->field_0x6be |= 0x10; + i_this->mStatusFlags |= 0x10; i_this->mZ2Ride.startCreatureSound(Z2SE_EN_WB_KICK_GROUND, 0, -1); } break; case 0xb: if (i_this->mpModelMorf->checkFrame(3.0f)) { - i_this->field_0x142d |= 2; - i_this->field_0x142c = 10; + i_this->mCollisionFlags |= 2; + i_this->mMovementType = 10; } else if (i_this->mpModelMorf->checkFrame(15.0f)) { - i_this->field_0x142d |= 3; + i_this->mCollisionFlags |= 3; } if (i_this->mpModelMorf->isStop()) { anm_init(i_this, 0x20, 5.0f, 2, 1.0f); i_this->mActionMode = 0xc; - i_this->field_0x6be |= 0x10; + i_this->mStatusFlags |= 0x10; i_this->mZ2Ride.startCreatureSound(Z2SE_EN_WB_KICK_GROUND, 0, -1); } break; @@ -3375,25 +3398,25 @@ static s8 e_wb_c_run(e_wb_class* i_this) { target_speed = l_HIO.medium_speed_vi; } - if ((i_this->field_0x6be & 2) == 0) { + if ((i_this->mStatusFlags & 2) == 0) { target_speed = 20.0f; return_value = 1; } s16 turn_speed = 0x200; s16 calc_angle = cM_atan2s(local_10c.x, local_10c.z); - i_this->mAngleTarget = calc_angle; + i_this->mTargetFacingAngle = calc_angle; if (rider && rider->mAnmID == 0x27) { f32 sin_val = cM_ssin(i_this->field_0x68e * (BREG_S(7) + 1000)); s16 add_angle = static_cast((BREG_F(16) + 5000.0f) * sin_val); - i_this->mAngleTarget += add_angle; + i_this->mTargetFacingAngle += add_angle; turn_speed = 0x400; } else if (wall_check != 0) { - i_this->mAngleTarget += (s16)(wall_check * (BREG_S(8) + -8000)); + i_this->mTargetFacingAngle += (s16)(wall_check * (BREG_S(8) + -8000)); } - cLib_addCalcAngleS2(&a_this->current.angle.y, i_this->mAngleTarget, 8, turn_speed); + cLib_addCalcAngleS2(&a_this->current.angle.y, i_this->mTargetFacingAngle, 8, turn_speed); f32 anim_speed = a_this->speedF / 40.0f; if (anim_speed < 1.0f) { @@ -3405,8 +3428,8 @@ static s8 e_wb_c_run(e_wb_class* i_this) { } i_this->mpModelMorf->setPlaySpeed(anim_speed); - i_this->field_0x142c = 1; - i_this->field_0x6bd = 1; + i_this->mMovementType = 1; + i_this->mPursuitFlag = 1; break; case 0x14: @@ -3416,12 +3439,12 @@ static s8 e_wb_c_run(e_wb_class* i_this) { case 0x15: if (a_this->speedF > 15.0f) { - i_this->field_0x142c = 2; + i_this->mMovementType = 2; i_this->mZ2Ride.startCreatureSoundLevel(Z2SE_EN_WB_L_SLIP, 0, -1); } else { anm_init(i_this, 0x2a, 10.0f, 2, 1.0f); i_this->mActionMode = 0x16; - i_this->field_0x6be |= 0x20; + i_this->mStatusFlags |= 0x20; } break; } @@ -3444,7 +3467,7 @@ static s8 e_wb_c_run(e_wb_class* i_this) { } cLib_addCalc2(&a_this->speedF, target_speed, 1.0f, 1.0f); - cLib_addCalcAngleS2(&i_this->field_0x79a, + cLib_addCalcAngleS2(&i_this->mBodyTiltAngle, (TREG_S(7) + -8) * (a_this->current.angle.y - sVar1), 8, 0x200); return return_value; @@ -3456,7 +3479,7 @@ static void action(e_wb_class* i_this) { fopEn_enemy_c* a_this = (fopEn_enemy_c*)i_this; cXyz pos1; cXyz pos2; - cLib_addCalcAngleS2(&i_this->field_0x79a, 0, 8, 0x100); + cLib_addCalcAngleS2(&i_this->mBodyTiltAngle, 0, 8, 0x100); if (i_this->mActionID != 0x67) { damage_check(i_this); @@ -3466,7 +3489,7 @@ static void action(e_wb_class* i_this) { a_this->offDownFlg(); if (lbl_244_bss_45 != 0 || lbl_244_bss_46 != 0) { - i_this->field_0x142f = gake_check(i_this); + i_this->mSpeedCapTimer = gake_check(i_this); } switch (i_this->mActionID) { @@ -3601,7 +3624,7 @@ static void action(e_wb_class* i_this) { i_this->mActionID = ACT_WAIT2; i_this->mActionMode = 0; i_this->field_0x6a0 = 0x1e; - i_this->field_0x6be = 3; + i_this->mStatusFlags = 3; i_this->field_0x6ae.set(0, 0, 0); wb_rd_reset(i_this); if (i_this->field_0x79d == 0) { @@ -3625,7 +3648,7 @@ static void action(e_wb_class* i_this) { i_this->mActionID = ACT_WAIT2; i_this->mActionMode = 0; i_this->field_0x6a0 = 0x1e; - i_this->field_0x6be = 3; + i_this->mStatusFlags = 3; i_this->field_0x6ae.set(0, 0, 0); wb_c_rd_reset(i_this); i_this->field_0x68e = (s16)cM_rndF(65535.0f); @@ -3647,7 +3670,7 @@ static void action(e_wb_class* i_this) { if (a_this->speed.y < -120.0f) a_this->speed.y = -120.0f; - if (i_this->mActionID == ACT_WAIT && (i_this->field_0x6be & 3) == 0 && + if (i_this->mActionID == ACT_WAIT && (i_this->mStatusFlags & 3) == 0 && // Bulblin Camp (strcmp(dComIfGp_getStartStageName(), "F_SP118") == 0 || // Gerudo Desert @@ -3680,7 +3703,7 @@ static void action(e_wb_class* i_this) { if (lbl_244_bss_45 != 0 && a_this->home.pos.y - a_this->current.pos.y > 5000.0f) { i_this->mActionID = ACT_EVENT; i_this->mActionMode = 0; - i_this->field_0x6be |= 0x40; + i_this->mStatusFlags |= 0x40; a_this->current.pos = a_this->home.pos; a_this->old = a_this->current; } @@ -4773,7 +4796,7 @@ static void demo_camera(e_wb_class* i_this) { case 0x51: a_this->current.angle.y = 0x8000; a_this->shape_angle.y = 0x8000; - i_this->mTargetAngleStep = 0; + i_this->mTurnStep = 0; cLib_addCalc2(&i_this->field_0x16bc.x, a_this->eyePos.x, 0.2f, 200.0f); cLib_addCalc2(&i_this->field_0x16bc.y, a_this->eyePos.y, 0.2f, 200.0f); cLib_addCalc2(&i_this->field_0x16bc.z, a_this->eyePos.z, 0.2f, 200.0f); @@ -5202,7 +5225,7 @@ static int daE_WB_Execute(e_wb_class* i_this) { if (i_this->field_0x1430 == 0) { fopAcM_OffStatus(a_this, 0); a_this->attention_info.flags = 0; - i_this->field_0x6be &= 3; + i_this->mStatusFlags &= 3; for (int i = 0; i < 4; i++) { if (i_this->field_0x698[i] != 0) { @@ -5230,7 +5253,7 @@ static int daE_WB_Execute(e_wb_class* i_this) { return 1; } - if (i_this->field_0x79d == 0 || i_this->field_0x142f == 0) { + if (i_this->field_0x79d == 0 || i_this->mSpeedCapTimer == 0) { cXyz* move_p = i_this->mStts.GetCCMoveP(); if (move_p != NULL) { f32 move_scale = TREG_F(19) + 0.3f; @@ -5253,7 +5276,7 @@ static int daE_WB_Execute(e_wb_class* i_this) { } i_this->mActionID = ACT_BG_DAMAGE; i_this->mActionMode = 0; - i_this->field_0x1684 = 50.0f; + i_this->mAnimDuration = 50.0f; i_this->mZ2Ride.startCreatureVoice(Z2SE_EN_WB_V_DAMAGE, -1); } else { if (i_this->mActionID != ACT_PL_RIDE2) { @@ -5401,7 +5424,7 @@ static int daE_WB_Execute(e_wb_class* i_this) { dComIfG_Ccsp()->Set(&i_this->field_0xa00[0]); - if (i_this->field_0x6bd != 0) { + if (i_this->mPursuitFlag != 0) { local_130.set(KREG_F(10) + -30.0f, KREG_F(11) + -50.0f, KREG_F(12)); MtxPosition(&local_130, &local_13c); @@ -5443,7 +5466,7 @@ static int daE_WB_Execute(e_wb_class* i_this) { i_this->field_0x1288.OnAtVsPlayerBit(); } - i_this->field_0x6bd = 0; + i_this->mPursuitFlag = 0; } else { cXyz temp_pos(-200000.0f, -200000.0f, 200000.0f); i_this->field_0x1288.SetC(temp_pos); @@ -5494,7 +5517,7 @@ static int daE_WB_Execute(e_wb_class* i_this) { i_this->field_0x1688 += i_this->field_0x168a; cLib_addCalcAngleS2(&i_this->field_0x168a, a_this->speedF * 50.0f + 1500.0f, 1, 0x3c); - cLib_addCalc2(&i_this->field_0x1684, a_this->speedF * (YREG_F(8) + 1.5f) + BREG_F(6), 1.0f, BREG_F(7) + 0.9f); + cLib_addCalc2(&i_this->mAnimDuration, a_this->speedF * (YREG_F(8) + 1.5f) + BREG_F(6), 1.0f, BREG_F(7) + 0.9f); i_this->field_0x1434 = fpcM_ERROR_PROCESS_ID_e; @@ -5641,10 +5664,10 @@ static int daE_WB_Create(fopAc_ac_c* a_this) { i_this->mParam = 0; } else if (i_this->mParam == 5) { i_this->field_0x79d = 1; - i_this->mActionID = 8; + i_this->mActionID = ACT_B_WAIT; } else if (i_this->mParam == 7) { i_this->field_0x79d = 2; - i_this->mActionID = 0xf; + i_this->mActionID = ACT_B_IKKI; if (cDmr_SkipInfo == 0) { i_this->field_0x169e = 0x28; @@ -5655,18 +5678,18 @@ static int daE_WB_Create(fopAc_ac_c* a_this) { } } else if (i_this->mParam == 8) { i_this->field_0x79d = 3; - i_this->mActionID = 0x11; + i_this->mActionID = ACT_B_IKKI2; // Hyrule Field if (!strcmp(dComIfGp_getStartStageName(), "F_SP121")) { i_this->mActionMode = -100; } - i_this->mAngleTarget = 0x8000; + i_this->mTargetFacingAngle = 0x8000; } else if (i_this->mParam == 6) { - i_this->mActionID = 0x32; + i_this->mActionID = ACT_EVENT; } else if (i_this->mParam == 10) { - i_this->mActionID = 6; + i_this->mActionID = ACT_C_F_RUN; i_this->field_0x7a6 = 1; i_this->field_0x7a7 = 1; @@ -5708,7 +5731,7 @@ static int daE_WB_Create(fopAc_ac_c* a_this) { if (i_this->field_0x79d == 1 || i_this->field_0x79d == 2) { s8 room_no = fopAcM_GetRoomNo(a_this); - fopAcM_createChild((s16)0x119, fopAcM_GetID(i_this), 0, &a_this->current.pos, + fopAcM_createChild(PROC_OBJ_WFLAG, fopAcM_GetID(i_this), 0, &a_this->current.pos, room_no, 0, 0, -1, 0); } @@ -5858,7 +5881,7 @@ static int daE_WB_Create(fopAc_ac_c* a_this) { c_start = 0; if (dComIfGs_isEventBit(dSv_event_flag_c::saveBitLabels[88])) { - i_this->field_0x79e = 1; + i_this->mLapCount = 1; } } } diff --git a/src/d/actor/d_a_obj_bemos.cpp b/src/d/actor/d_a_obj_bemos.cpp index da3fead668a..7b5bbbde4e1 100644 --- a/src/d/actor/d_a_obj_bemos.cpp +++ b/src/d/actor/d_a_obj_bemos.cpp @@ -1,415 +1,198 @@ /** * @file d_a_obj_bemos.cpp - * -*/ + * + */ #include "d/dolzel_rel.h" -#include "d/actor/d_a_obj_bemos.h" -#include "d/d_cc_d.h" -#include "dol2asm.h" -#include "d/d_camera.h" -#include "d/d_com_inf_game.h" #include "SSystem/SComponent/c_lib.h" +#include "d/actor/d_a_obj_bemos.h" +#include "d/d_camera.h" +#include "d/d_cc_d.h" +#include "d/d_com_inf_game.h" +#include "d/d_debug_viewer.h" +#include "d/d_s_play.h" +#include "dol2asm.h" -// -// Forward References: -// +/* ############################################################################################## */ +/* 80BB37B8-80BB37C4 000000 000C+00 13/13 0/0 0/0 .rodata l_eye_offset */ +static Vec const l_eye_offset = {0.0f, 330.0f, 75.0f}; -extern "C" void PPCallBack__9daObjBm_cFP10fopAc_ac_cP10fopAc_ac_csQ29dBgW_Base13PushPullLabel(); -extern "C" static void nodeCallBack__FP8J3DJointi(); -extern "C" void initBaseMtx__9daObjBm_cFv(); -extern "C" void setBaseMtx__9daObjBm_cFv(); -extern "C" void Create__9daObjBm_cFv(); -extern "C" void CreateHeap__9daObjBm_cFv(); -extern "C" void __dt__12J3DFrameCtrlFv(); -extern "C" void create1st__9daObjBm_cFv(); -extern "C" void Execute__9daObjBm_cFPPA3_A4_f(); -extern "C" void main_proc_call__9daObjBm_cFv(); -extern "C" void initActionEnBemos__9daObjBm_cFv(); -extern "C" void initActionObjBemos__9daObjBm_cFv(); -extern "C" void actionEnBemos__9daObjBm_cFv(); -extern "C" void actionObjBemos__9daObjBm_cFv(); -extern "C" void setCrawCO__9daObjBm_cFv(); -extern "C" void __dt__4cXyzFv(); -extern "C" void calcBeamPos__9daObjBm_cFv(); -extern "C" void calcBeamLenAndAt__9daObjBm_cFv(); -extern "C" void __dt__8cM3dGPlaFv(); -extern "C" void checkFindPlayer__9daObjBm_cFv(); -extern "C" void checkSearchPlayer__9daObjBm_cFv(); -extern "C" void getSearchDistance__9daObjBm_cFv(); -extern "C" void getBeamSearchDistance__9daObjBm_cFv(); -extern "C" void effect_proc__9daObjBm_cFv(); -extern "C" void effectWait__9daObjBm_cFv(); -extern "C" void initEffectSet0__9daObjBm_cFv(); -extern "C" void effectSet0__9daObjBm_cFv(); -extern "C" void effectSet1__9daObjBm_cFv(); -extern "C" void effectEnd__9daObjBm_cFv(); -extern "C" void check_to_walk__9daObjBm_cFv(); -extern "C" void mode_wait_init__9daObjBm_cFv(); -extern "C" void mode_wait__9daObjBm_cFv(); -extern "C" void mode_walk_init__9daObjBm_cFv(); -extern "C" void mode_walk__9daObjBm_cFv(); -extern "C" void mode_afl__9daObjBm_cFv(); -extern "C" void mode_dead_init__9daObjBm_cFv(); -extern "C" void mode_dead__9daObjBm_cFv(); -extern "C" void clr_moment_cnt__9daObjBm_cFv(); -extern "C" void __ct__Q29daObjBm_c5Bgc_cFv(); -extern "C" void __ct__4cXyzFv(); -extern "C" void wall_pos__Q29daObjBm_c5Bgc_cFPC10fopAc_ac_cPCQ29daObjBm_c8BgcSrc_cisf(); -extern "C" void chk_wall_pre__Q29daObjBm_c5Bgc_cFPC10fopAc_ac_cPCQ29daObjBm_c8BgcSrc_cis(); -extern "C" void initActionSwWait__9daObjBm_cFv(); -extern "C" void actionSwWait__9daObjBm_cFv(); -extern "C" void initActionWarning__9daObjBm_cFv(); -extern "C" void actionWarning__9daObjBm_cFv(); -extern "C" void initActionFindPlayer__9daObjBm_cFv(); -extern "C" void actionFindPlayer__9daObjBm_cFv(); -extern "C" void initActionAttack__9daObjBm_cFv(); -extern "C" void actionAttack__9daObjBm_cFv(); -extern "C" void initActionDead__9daObjBm_cFv(); -extern "C" void actionDead__9daObjBm_cFv(); -extern "C" void Draw__9daObjBm_cFv(); -extern "C" void Delete__9daObjBm_cFv(); -extern "C" static void daObjBm_create1st__FP9daObjBm_c(); -extern "C" void __dt__8dCcD_CylFv(); -extern "C" void __ct__8dCcD_CylFv(); -extern "C" void __dt__8cM3dGCylFv(); -extern "C" void __dt__8cM3dGSphFv(); -extern "C" void __dt__8cM3dGAabFv(); -extern "C" void __dt__10dCcD_GSttsFv(); -extern "C" void __dt__12dBgS_AcchCirFv(); -extern "C" void __dt__12dBgS_ObjAcchFv(); -extern "C" static void daObjBm_MoveBGDelete__FP9daObjBm_c(); -extern "C" static void daObjBm_MoveBGExecute__FP9daObjBm_c(); -extern "C" static void daObjBm_MoveBGDraw__FP9daObjBm_c(); -extern "C" void __dt__10cCcD_GSttsFv(); -extern "C" void func_80BB3490(void* _this, u16*); -extern "C" void func_80BB34AC(void* _this, u8*); -extern "C" void __sinit_d_a_obj_bemos_cpp(); -extern "C" void func_80BB35A8(); -extern "C" void __dt__11dBgS_WtrChkFv(); -extern "C" void func_80BB3658(); -extern "C" void __dt__14dBgS_ObjGndChkFv(); -extern "C" void __ct__14dBgS_ObjGndChkFv(); -extern "C" static void func_80BB3764(); -extern "C" static void func_80BB376C(); -extern "C" static void func_80BB3774(); -extern "C" static void func_80BB377C(); -extern "C" static void func_80BB3784(); -extern "C" static void func_80BB378C(); -extern "C" static void func_80BB3794(); -extern "C" static void func_80BB379C(); -extern "C" u8 const M_dir_base__9daObjBm_c[8]; -extern "C" u8 const M_lin20__Q29daObjBm_c5Bgc_c[368]; -extern "C" extern char const* const d_a_obj_bemos__stringBase0; -extern "C" u8 M_lin5__Q29daObjBm_c5Bgc_c[80]; -extern "C" u8 M_gnd_work__Q29daObjBm_c5Bgc_c[1932]; -extern "C" u8 M_wrt_work__Q29daObjBm_c5Bgc_c[84]; -extern "C" u8 M_wall_work__Q29daObjBm_c5Bgc_c[2576]; +/* 80BB37C4-80BB37D0 00000C 000C+00 0/1 0/0 0/0 .rodata l_high_beam_offset */ +static Vec const l_high_beam_offset = {0.0f, 255.0f, 65.0f}; -// -// External References: -// +/* 80BB37D0-80BB37DC 000018 000C+00 0/1 0/0 0/0 .rodata l_mid_beam_offset */ +static Vec const l_mid_beam_offset = {0.0f, 205.0f, 65.0f}; -extern "C" void mDoMtx_XYZrotM__FPA4_fsss(); -extern "C" void mDoMtx_ZXYrotM__FPA4_fsss(); -extern "C" void mDoMtx_XrotS__FPA4_fs(); -extern "C" void mDoMtx_XrotM__FPA4_fs(); -extern "C" void mDoMtx_YrotS__FPA4_fs(); -extern "C" void mDoMtx_YrotM__FPA4_fs(); -extern "C" void transS__14mDoMtx_stack_cFRC4cXyz(); -extern "C" void transM__14mDoMtx_stack_cFfff(); -extern "C" void transM__14mDoMtx_stack_cFRC4cXyz(); -extern "C" void scaleM__14mDoMtx_stack_cFfff(); -extern "C" void ZXYrotM__14mDoMtx_stack_cFRC5csXyz(); -extern "C" void play__14mDoExt_baseAnmFv(); -extern "C" void init__13mDoExt_btkAnmFP16J3DMaterialTableP19J3DAnmTextureSRTKeyiifss(); -extern "C" void entry__13mDoExt_btkAnmFP16J3DMaterialTablef(); -extern "C" void init__13mDoExt_brkAnmFP16J3DMaterialTableP15J3DAnmTevRegKeyiifss(); -extern "C" void entry__13mDoExt_brkAnmFP16J3DMaterialTablef(); -extern "C" void init__13mDoExt_bckAnmFP15J3DAnmTransformiifssb(); -extern "C" void entry__13mDoExt_bckAnmFP12J3DModelDataf(); -extern "C" void mDoExt_modelUpdateDL__FP8J3DModel(); -extern "C" void mDoExt_btkAnmRemove__FP12J3DModelData(); -extern "C" void mDoExt_brkAnmRemove__FP12J3DModelData(); -extern "C" void mDoExt_J3DModel__create__FP12J3DModelDataUlUl(); -extern "C" void fopAcM_setCullSizeBox__FP10fopAc_ac_cffffff(); -extern "C" void fopAcM_searchActorAngleY__FPC10fopAc_ac_cPC10fopAc_ac_c(); -extern "C" void fopAcM_searchActorDistanceXZ__FPC10fopAc_ac_cPC10fopAc_ac_c(); -extern "C" void lineCheck__11fopAcM_lc_cFPC4cXyzPC4cXyzPC10fopAc_ac_c(); -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 onSwitch__10dSv_info_cFii(); -extern "C" void isSwitch__10dSv_info_cCFii(); -extern "C" void getRes__14dRes_control_cFPCclP11dRes_info_ci(); -extern "C" void -set__13dPa_control_cFUcUsPC4cXyzPC12dKy_tevstr_cPC5csXyzPC4cXyzUcP18dPa_levelEcallBackScPC8_GXColorPC8_GXColorPC4cXyzf(); -extern "C" void LineCross__4cBgSFP11cBgS_LinChk(); -extern "C" void GetTriPla__4cBgSCFRC13cBgS_PolyInfoP8cM3dGPla(); -extern "C" void dBgS_MoveBGProc_TypicalRotY__FP4dBgWPvRC13cBgS_PolyInfobP4cXyzP5csXyzP5csXyz(); -extern "C" void dBgS_MoveBGProc_Trans__FP4dBgWPvRC13cBgS_PolyInfobP4cXyzP5csXyzP5csXyz(); -extern "C" void __ct__12dBgS_AcchCirFv(); -extern "C" void __dt__9dBgS_AcchFv(); -extern "C" void __ct__9dBgS_AcchFv(); -extern "C" void __ct__11dBgS_GndChkFv(); -extern "C" void __dt__11dBgS_GndChkFv(); -extern "C" void Set__11dBgS_LinChkFPC4cXyzPC4cXyzPC10fopAc_ac_c(); -extern "C" void __ct__14dBgS_ObjLinChkFv(); -extern "C" void __dt__14dBgS_ObjLinChkFv(); -extern "C" void __ct__16dBgS_MoveBgActorFv(); -extern "C" bool IsDelete__16dBgS_MoveBgActorFv(); -extern "C" bool ToFore__16dBgS_MoveBgActorFv(); -extern "C" bool ToBack__16dBgS_MoveBgActorFv(); -extern "C" void -MoveBGCreate__16dBgS_MoveBgActorFPCciPFP4dBgWPvRC13cBgS_PolyInfobP4cXyzP5csXyzP5csXyz_vUlPA3_A4_f(); -extern "C" void MoveBGDelete__16dBgS_MoveBgActorFv(); -extern "C" void MoveBGExecute__16dBgS_MoveBgActorFv(); -extern "C" void __dt__14dBgS_SplGrpChkFv(); -extern "C" void SetObj__16dBgS_PolyPassChkFv(); -extern "C" void __ct__11dBgS_WtrChkFv(); -extern "C" void __ct__10dCcD_GSttsFv(); -extern "C" void Init__9dCcD_SttsFiiP10fopAc_ac_c(); -extern "C" void __ct__12dCcD_GObjInfFv(); -extern "C" void __dt__12dCcD_GObjInfFv(); -extern "C" void ChkTgHit__12dCcD_GObjInfFv(); -extern "C" void GetTgHitObj__12dCcD_GObjInfFv(); -extern "C" void Set__8dCcD_CpsFRC11dCcD_SrcCps(); -extern "C" void CalcAtVec__8dCcD_CpsFv(); -extern "C" void Set__8dCcD_CylFRC11dCcD_SrcCyl(); -extern "C" void Set__8dCcD_SphFRC11dCcD_SrcSph(); -extern "C" void ForceLockOn__9dCamera_cFP10fopAc_ac_c(); -extern "C" void dCam_getBody__Fv(); -extern "C" void settingTevStruct__18dScnKy_env_light_cFiP4cXyzP12dKy_tevstr_c(); -extern "C" void setLightTevColorType_MAJI__18dScnKy_env_light_cFP12J3DModelDataP12dKy_tevstr_c(); -extern "C" void Set__4cCcSFP8cCcD_Obj(); -extern "C" void __pl__4cXyzCFRC3Vec(); -extern "C" void __mi__4cXyzCFRC3Vec(); -extern "C" void __ml__4cXyzCFf(); -extern "C" void normalizeZP__4cXyzFv(); -extern "C" bool __ne__4cXyzCFRC3Vec(); -extern "C" void __ct__5csXyzFsss(); -extern "C" void cM_atan2s__Fff(); -extern "C" void __dt__13cBgS_PolyInfoFv(); -extern "C" void ChkUsed__9cBgW_BgIdCFv(); -extern "C" void cBgW_CheckBGround__Ff(); -extern "C" void cM3d_CalcVecAngle__FRC3VecPsPs(); -extern "C" void __dt__8cM3dGCirFv(); -extern "C" void __ct__8cM3dGCpsFv(); -extern "C" void Set__8cM3dGCpsFRC4cXyzRC4cXyzf(); -extern "C" void SetC__8cM3dGCylFRC4cXyz(); -extern "C" void SetC__8cM3dGSphFRC4cXyz(); -extern "C" void cLib_addCalc__FPfffff(); -extern "C" void cLib_addCalcAngleS__FPsssss(); -extern "C" void cLib_chaseF__FPfff(); -extern "C" void cLib_chasePos__FP4cXyzRC4cXyzf(); -extern "C" void cLib_chaseAngleS__FPsss(); -extern "C" void func_802807E0(); -extern "C" void seStart__7Z2SeMgrF10JAISoundIDPC3VecUlScffffUc(); -extern "C" void seStartLevel__7Z2SeMgrF10JAISoundIDPC3VecUlScffffUc(); -extern "C" void deleteObject__14Z2SoundObjBaseFv(); -extern "C" void __ct__16Z2SoundObjSimpleFv(); -extern "C" void* __nw__FUl(); -extern "C" void __dl__FPv(); -extern "C" void getName__10JUTNameTabCFUs(); -extern "C" void init__12J3DFrameCtrlFs(); -extern "C" void __destroy_arr(); -extern "C" void __construct_array(); -extern "C" void __ptmf_scall(); -extern "C" void _savegpr_14(); -extern "C" void _savegpr_23(); -extern "C" void _savegpr_24(); -extern "C" void _savegpr_25(); -extern "C" void _savegpr_26(); -extern "C" void _savegpr_27(); -extern "C" void _savegpr_28(); -extern "C" void _savegpr_29(); -extern "C" void _restgpr_14(); -extern "C" void _restgpr_23(); -extern "C" void _restgpr_24(); -extern "C" void _restgpr_25(); -extern "C" void _restgpr_26(); -extern "C" void _restgpr_27(); -extern "C" void _restgpr_28(); -extern "C" void _restgpr_29(); -extern "C" extern void* __vt__8dCcD_Sph[36]; -extern "C" extern void* __vt__8dCcD_Cyl[36]; -extern "C" extern void* __vt__8dCcD_Cps[36]; -extern "C" extern void* __vt__9dCcD_Stts[11]; -extern "C" extern void* __vt__12cCcD_SphAttr[25]; -extern "C" extern void* __vt__12cCcD_CylAttr[25]; -extern "C" extern void* __vt__12cCcD_CpsAttr[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" u8 mLineCheck__11fopAcM_lc_c[112]; -extern "C" f32 Zero__4cXyz[3]; -extern "C" u8 BaseY__4cXyz[12]; -extern "C" u8 sincosTable___5JMath[65536]; -extern "C" u8 mAudioMgrPtr__10Z2AudioMgr[4 + 4 /* padding */]; -extern "C" void __register_global_object(); +/* 80BB37DC-80BB37E8 000024 000C+00 0/1 0/0 0/0 .rodata l_low_beam_offset */ +static Vec const l_low_beam_offset = {0.0f, 160.0f, 65.0f}; -// -// Declarations: -// +/* 80BB37E8-80BB3818 000030 0030+00 1/1 0/0 0/0 .rodata l_craw_offset */ +static Vec const l_craw_offset[4] = { + {-95.0f, 0.0f, 0.0f}, + {95.0f, 0.0f, 0.0f}, + {0.0f, 0.0f, -95.0f}, + {0.0f, 0.0f, 95.0f}, +}; + +/* 80BB3818-80BB3820 000060 0008+00 1/2 0/0 0/0 .rodata M_dir_base__9daObjBm_c */ +s16 const daObjBm_c::M_dir_base[4] = { + 0x0000, + 0x4000, + 0x8000, + 0xC000, +}; + +#ifdef DEBUG +class daObjBm_HIO_c : public mDoHIO_entry_c { +public: + daObjBm_HIO_c(); + + void genMessage(JORMContext*); + + /* 0x08 */ cXyz mBeamScale; + /* 0x14 */ f32 mBeamLowerDistance; + /* 0x18 */ f32 mBeamMiddleDistance; + /* 0x1C */ f32 field_0x1C; + /* 0x20 */ f32 mSearchDistance; + /* 0x24 */ f32 mTargetOffsetDistance; + /* 0x28 */ s16 mSearchAngle; + /* 0x2A */ s16 mPatrolRotationSpeed; + /* 0x0C */ s16 mAttackRotationSpeed; + /* 0x2E */ s16 mNoSearchTimeAfterSwitchActivation; + /* 0x30 */ s16 mDetectionAngle; + /* 0x32 */ s16 mSearchSpeedOnDetection; + /* 0x34 */ f32 mBodyScale; + /* 0x38 */ f32 mSoundPositionMoveSpeed; + /* 0x3C */ u8 mNoSearchAttackTime; + /* 0x3D */ u8 mDebugDraw; + /* 0x3E */ u8 mCheckDraw; +}; + +daObjBm_HIO_c l_HIO; + +daObjBm_HIO_c::daObjBm_HIO_c() { + mBeamScale.set(0.5f, 0.5f, 1.0f); + mSearchDistance = 1000.0f; + mSearchAngle = 30000; + mPatrolRotationSpeed = 500; + mAttackRotationSpeed = 450; + mBeamLowerDistance = 300.0f; + mBeamMiddleDistance = 600.0f; + field_0x1C = 1000.0f; + mTargetOffsetDistance = 0.0f; + mNoSearchTimeAfterSwitchActivation = 20; + mDetectionAngle = 25000; + mSoundPositionMoveSpeed = 60.0f; + mNoSearchAttackTime = 0; + mSearchSpeedOnDetection = 1000; + mBodyScale = 1.0f; + mDebugDraw = 0; + mCheckDraw = 0; +} + +void daObjBm_HIO_c::genMessage(JORMContext* ctx) { + ctx->genLabel("ビーモス", 0, 0, NULL, -1, -1, 512, 24); + ctx->genCheckBox("デバッグ描画", &mDebugDraw, 1, 0, NULL, -1, -1, 512, 24); + ctx->genSlider("サーチ距離", &mSearchDistance, 100.0f, 5000.0f, 0, NULL, -1, -1, 512, 24); + ctx->genSlider("サーチ角度", &mSearchAngle, 0.0f, 32767.0f, 0, NULL, -1, -1, 512, 24); + ctx->genSlider("発見角度", &mDetectionAngle, 0.0f, 32767.0f, 0, NULL, -1, -1, 512, 24); + ctx->genSlider("巡回回転速度", &mPatrolRotationSpeed, 0.0f, 1000.0f, 0, NULL, -1, -1, 512, 24); + ctx->genSlider("攻撃回転速度", &mAttackRotationSpeed, 0.0f, 1000.0f, 0, NULL, -1, -1, 512, 24); + ctx->genSlider("ビーム発射・下距離", &mBeamLowerDistance, 0.0f, 1000.0f, 0, NULL, -1, -1, 512, + 24); + ctx->genSlider("ビーム発射・中距離", &mBeamMiddleDistance, 0.0f, 1000.0f, 0, NULL, -1, -1, 512, + 24); + ctx->genSlider("目標オフセット距離", &mTargetOffsetDistance, 0.0f, 500.0f, 0, NULL, -1, -1, 512, + 24); + ctx->genSlider("SW起動後サーチ無し時間", &mNoSearchTimeAfterSwitchActivation, 0.0f, 1000.0f, + 0, NULL, -1, -1, 512, 24); + ctx->genSlider("発音位置移動速度", &mSoundPositionMoveSpeed, 0.0f, 1000.0f, 0, NULL, -1, -1, + 512, 24); + ctx->genSlider("サーチ無し攻撃時間", &mNoSearchAttackTime, 0.0f, 100.0f, 0, NULL, -1, -1, 512, + 24); + ctx->genSlider("発見時のサーチ速度", &mSearchSpeedOnDetection, 0.0f, 10000.0f, 0, NULL, -1, -1, + 512, 24); + ctx->genSlider("本体スケール", &mBodyScale, 0.1f, 5.0f, 0, NULL, -1, -1, 512, 24); + ctx->genSlider("ビームXスケール", &mBeamScale.x, 0.1f, 10.0f, 0, NULL, -1, -1, 512, 24); + ctx->genSlider("ビームYスケール", &mBeamScale.y, 0.1f, 10.0f, 0, NULL, -1, -1, 512, 24); + ctx->genCheckBox("チェック描画", &mCheckDraw, 1, 0, NULL, -1, -1, 512, 24); +} +#endif /* 80BAE36C-80BAE4A8 0000EC 013C+00 1/1 0/0 0/0 .text * PPCallBack__9daObjBm_cFP10fopAc_ac_cP10fopAc_ac_csQ29dBgW_Base13PushPullLabel */ -// NONMATCHING -void daObjBm_c::PPCallBack(fopAc_ac_c* param_0, fopAc_ac_c* i_actorP, s16 param_2, - dBgW_Base::PushPullLabel param_3) { - int tmp = cLib_checkBit((int)param_2, 3); - u32 l_swNo3 = getSwNo3(); - u32 l_moveType = getMoveType(); +fopAc_ac_c* daObjBm_c::PPCallBack(fopAc_ac_c* i_bgActor, fopAc_ac_c* i_actorP, s16 param_2, + dBgW_Base::PushPullLabel pp_field) { + dBgW::PushPullLabel pp_label = cLib_checkBit(pp_field, dBgW::PPLABEL_3); + u8 l_swNo3 = ((daObjBm_c*)i_bgActor)->getSwNo3(); + u8 l_moveType = ((daObjBm_c*)i_bgActor)->getMoveType(); - if (tmp && !fopAcM_isSwitch(this,l_swNo3)) { - int tmp2 = cLib_checkBit(tmp,2); - s16 angle = param_2; - - if (tmp2) { - angle -= -0x8000; - } - - angle -= home.angle.y; + if (pp_label != dBgW::PPLABEL_NONE && !fopAcM_isSwitch(i_bgActor, l_swNo3)) { + s16 spE = cLib_checkBit(pp_label, dBgW::PPLABEL_PULL) ? + (s16)param_2 - 0x8000 : + (s16)param_2; + s16 angle = spE - ((daObjBm_c*)i_bgActor)->home.angle.y; + + JUT_ASSERT(513, pp_label != pp_field); + + ((daObjBm_c*)i_bgActor)->mPPLabel = pp_field; - JUT_PANIC(513,"0"); - - field_0x10c0 = param_2; - if (angle >= -0x2000 && angle < 0x2000) { - tmp = 0; + pp_label = dBgW::PPLABEL_NONE; + } else if (angle >= 0x2000 && angle < 0x6000) { + pp_label = dBgW::PPLABEL_PUSH; + } else if (angle >= 0x6000 || angle < -0x6000) { + pp_label = dBgW::PPLABEL_PULL; } else { - if (angle >= 0x2000 && angle < 0x6000) { - tmp = 1; - } else { - if (angle < 0x6000 && angle < -0x6000) { - tmp = 2; - } else { - tmp = 3; - } - } + pp_label = dBgW::PPLABEL_3; } - if (l_moveType != 0 || tmp == 0) { + if (l_moveType != 0 || (l_moveType == 0 && pp_label == dBgW::PPLABEL_NONE)) { for (int i = 0; i < 4; i++) { - if (tmp == 1) { - field_0x10c4[i] = field_0x10c4[i]+1; + if (i == pp_label) { + ((daObjBm_c*)i_bgActor)->mMomentCnt[i]++; } else { - field_0x10c4[i] = 0; + ((daObjBm_c*)i_bgActor)->mMomentCnt[i] = 0; } } - - field_0x10d2 = 1; + + ((daObjBm_c*)i_bgActor)->field_0x10d2 = 1; } } + + return i_bgActor; } /* 80BAE4A8-80BAE5FC 000228 0154+00 1/1 0/0 0/0 .text nodeCallBack__FP8J3DJointi */ // NONMATCHING -static int nodeCallBack(J3DJoint* param_0, int param_1) { - if (param_1 == 0) { - u16 jnt_no = param_0->getJntNo(); +static int nodeCallBack(J3DJoint* i_joint, int param_2) { + if (param_2 == 0) { + int jnt_no = i_joint->getJntNo(); J3DModel* model = j3dSys.getModel(); - daObjBm_c* beamos = (daObjBm_c*)model->getUserArea(); - cMtx_copy(model->getAnmMtx(jnt_no), mDoMtx_stack_c::get()); + daObjBm_c* i_this = (daObjBm_c*)model->getUserArea(); - if (jnt_no == beamos->getHeadJoint()) { - mDoMtx_stack_c::XrotM(beamos->field_0xf96 + (beamos->field_0x1000 * cM_scos(beamos->field_0x1000 * beamos->field_0xff0))); - } else { - if (jnt_no == beamos->getBigGearJoint()) { - mDoMtx_stack_c::XrotM(beamos->field_0xf9a); - } else { - if (jnt_no == beamos->getSmallGear0Joint()) { - mDoMtx_stack_c::XrotM(beamos->field_0xf9e); - } else { - if (jnt_no == beamos->getSmallGear1Joint()) { - mDoMtx_stack_c::XrotM(beamos->field_0xfa2); - } else { - if (jnt_no == beamos->getSmallGear2Joint()) { - mDoMtx_stack_c::XrotM(beamos->field_0xfa6); - } - } - } - } + cMtx_copy(model->getAnmMtx(jnt_no), mDoMtx_stack_c::get()); + s16 sVar1 = i_this->field_0x1000 * cM_scos(i_this->field_0xff0 * 0x2cec + KREG_S(6)); + + if (jnt_no == i_this->getHeadJoint()) { + mDoMtx_stack_c::XrotM(i_this->field_0xf96 + sVar1); + } else if (jnt_no == i_this->getBigGearJoint()) { + mDoMtx_stack_c::XrotM(i_this->field_0xf9a); + } else if (jnt_no == i_this->getSmallGear0Joint()) { + mDoMtx_stack_c::XrotM(i_this->field_0xf9e); + } else if (jnt_no == i_this->getSmallGear1Joint()) { + mDoMtx_stack_c::XrotM(i_this->field_0xfa2); + } else if (jnt_no == i_this->getSmallGear2Joint()) { + mDoMtx_stack_c::XrotM(i_this->field_0xfa6); } - cMtx_copy(mDoMtx_stack_c::get(),model->getAnmMtx(jnt_no)); + cMtx_copy(mDoMtx_stack_c::get(), model->getAnmMtx(jnt_no)); } + + return 1; } -/* ############################################################################################## */ -/* 80BB37B8-80BB37C4 000000 000C+00 13/13 0/0 0/0 .rodata l_eye_offset */ -SECTION_RODATA static f32 const l_eye_offset[4] = { - 0.0f, - 330.0f, - 75.0f, -}; -COMPILER_STRIP_GATE(0x80BB37B8, &l_eye_offset); - -/* 80BB37C4-80BB37D0 00000C 000C+00 0/1 0/0 0/0 .rodata l_high_beam_offset */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const l_high_beam_offset[4] = { - 0.0f, - 255.0f, - 65.0f, -}; -COMPILER_STRIP_GATE(0x80BB37C4, &l_high_beam_offset); -#pragma pop - -/* 80BB37D0-80BB37DC 000018 000C+00 0/1 0/0 0/0 .rodata l_mid_beam_offset */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const l_mid_beam_offset[3] = { - 0.0f, - 205.0f, - 65.0f, -}; -COMPILER_STRIP_GATE(0x80BB37D0, &l_mid_beam_offset); -#pragma pop - -/* 80BB37DC-80BB37E8 000024 000C+00 0/1 0/0 0/0 .rodata l_low_beam_offset */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const l_low_beam_offset[3] = { - 0.0f, - 160.0f, - 65.0f, -}; -COMPILER_STRIP_GATE(0x80BB37DC, &l_low_beam_offset); -#pragma pop - -/* 80BB37E8-80BB3818 000030 0030+00 1/1 0/0 0/0 .rodata l_craw_offset */ -SECTION_RODATA static f32 const l_craw_offset[12] = { - -95.0f, - 0.0f, - 0.0f, - 95.0f, - 0.0f, - 0.0f, - 0.0f, - 0.0f, - -95.0f, - 0.0f, - 0.0f, - 95.0f, -}; -COMPILER_STRIP_GATE(0x80BB37E8, &l_craw_offset); - -/* 80BB3818-80BB3820 000060 0008+00 1/2 0/0 0/0 .rodata M_dir_base__9daObjBm_c */ -SECTION_RODATA u8 const daObjBm_c::M_dir_base[8] = { - 0x00, 0x00, 0x40, 0x00, 0x80, 0x00, 0xC0, 0x00, -}; -COMPILER_STRIP_GATE(0x80BB3818, &daObjBm_c::M_dir_base); - -/* 80BB3820-80BB3824 000068 0004+00 1/3 0/0 0/0 .rodata @3933 */ -SECTION_RODATA static f32 const lit_3933 = 0.5f; -COMPILER_STRIP_GATE(0x80BB3820, &lit_3933); - -/* 80BB3824-80BB3828 00006C 0004+00 8/16 0/0 0/0 .rodata @3934 */ -SECTION_RODATA static f32 const lit_3934 = 1.0f; -COMPILER_STRIP_GATE(0x80BB3824, &lit_3934); - /* 80BAE5FC-80BAE68C 00037C 0090+00 1/1 0/0 0/0 .text initBaseMtx__9daObjBm_cFv */ void daObjBm_c::initBaseMtx() { field_0x10a0.set(0.5f, 0.5f, 1.0f); @@ -421,15 +204,15 @@ void daObjBm_c::initBaseMtx() { /* 80BAE68C-80BAE778 00040C 00EC+00 2/2 0/0 0/0 .text setBaseMtx__9daObjBm_cFv */ void daObjBm_c::setBaseMtx() { - mDoMtx_stack_c::transS(current.pos.x,current.pos.y,current.pos.z); + mDoMtx_stack_c::transS(current.pos.x, current.pos.y, current.pos.z); mDoMtx_stack_c::YrotM(shape_angle.y); mpModel->setBaseTRMtx(mDoMtx_stack_c::get()); - mDoMtx_stack_c::scaleM(1.0f,1.0f,1.0f); - PSMTXCopy(mDoMtx_stack_c::get(),mBgMtx); - + mDoMtx_stack_c::scaleM(1.0f, 1.0f, 1.0f); + PSMTXCopy(mDoMtx_stack_c::get(), mBgMtx); + #if DEBUG - field_0x10e8 = 0.0f; // change to l_HIO - field_0x10ec = 0.0f; // change to l_HIO + field_0x10b8 = l_HIO.mBeamScale.x; + field_0x10bc = l_HIO.mBeamScale.y; #endif mpModel2->setBaseScale(field_0x10a0); @@ -441,1538 +224,1779 @@ void daObjBm_c::setBaseMtx() { mpModel3->setBaseTRMtx(mDoMtx_stack_c::get()); } -/* ############################################################################################## */ -/* 80BB3828-80BB3830 000070 0008+00 2/4 0/0 0/0 .rodata @4106 */ -SECTION_RODATA static u8 const lit_4106[8] = { - 0x43, 0x30, 0x00, 0x00, - 0x80, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x80BB3828, &lit_4106); - -/* 80BB3A40-80BB3A40 000288 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ -#pragma push -#pragma force_active on -SECTION_DEAD static char const* const stringBase_80BB3A40 = "Obj_bm"; -SECTION_DEAD static char const* const stringBase_80BB3A47 = "bmEye"; -SECTION_DEAD static char const* const stringBase_80BB3A4D = "head"; -SECTION_DEAD static char const* const stringBase_80BB3A52 = "cogRed"; -SECTION_DEAD static char const* const stringBase_80BB3A59 = "cogBlue"; -SECTION_DEAD static char const* const stringBase_80BB3A61 = "cogGreen"; -SECTION_DEAD static char const* const stringBase_80BB3A6A = "cogYellow"; -#pragma pop - /* 80BB3A94-80BB3A98 -00001 0004+00 8/9 0/0 0/0 .data l_arcName */ -SECTION_DATA static void* l_arcName = (void*)&d_a_obj_bemos__stringBase0; +static const char* l_arcName = "Obj_bm"; /* 80BB3A98-80BB3A9C -00001 0004+00 0/1 0/0 0/0 .data l_eye_matName */ -#pragma push -#pragma force_active on -SECTION_DATA static void* l_eye_matName = (void*)(((char*)&d_a_obj_bemos__stringBase0) + 0x7); -#pragma pop +static const char* l_eye_matName = "bmEye"; /* 80BB3A9C-80BB3AA0 -00001 0004+00 0/1 0/0 0/0 .data l_head_joint */ -#pragma push -#pragma force_active on -SECTION_DATA static char* l_head_joint = "head"; -#pragma pop +static char* l_head_joint = "head"; /* 80BB3AA0-80BB3AA4 -00001 0004+00 0/1 0/0 0/0 .data l_bigGear_joint */ -#pragma push -#pragma force_active on -SECTION_DATA static char* l_bigGear_joint = "cogRed"; -#pragma pop +static char* l_bigGear_joint = "cogRed"; /* 80BB3AA4-80BB3AA8 -00001 0004+00 0/1 0/0 0/0 .data l_smallGear0_joint */ -#pragma push -#pragma force_active on -SECTION_DATA static char* l_smallGear0_joint = "cogBlue"; -#pragma pop +static char* l_smallGear0_joint = "cogBlue"; /* 80BB3AA8-80BB3AAC -00001 0004+00 0/1 0/0 0/0 .data l_smallGear1_joint */ -#pragma push -#pragma force_active on -SECTION_DATA static char* l_smallGear1_joint = "cogGreen"; -#pragma pop +static char* l_smallGear1_joint = "cogGreen"; /* 80BB3AAC-80BB3AB0 -00001 0004+00 0/1 0/0 0/0 .data l_smallGear2_joint */ -#pragma push -#pragma force_active on -SECTION_DATA static char* l_smallGear2_joint = "cogYellow"; -#pragma pop +static char* l_smallGear2_joint = "cogYellow"; /* 80BB3AB0-80BB3AC4 00003C 0014+00 0/2 0/0 0/0 .data l_joint_table */ -#pragma push -#pragma force_active on -SECTION_DATA static char* l_joint_table[5] = { - l_head_joint, - l_bigGear_joint, - l_smallGear0_joint, - l_smallGear1_joint, - l_smallGear2_joint, +static char* l_joint_table[5] = { + l_head_joint, l_bigGear_joint, l_smallGear0_joint, l_smallGear1_joint, l_smallGear2_joint, }; -#pragma pop /* 80BB3AC4-80BB3ADC 000050 0018+00 0/1 0/0 0/0 .data l_cull_box */ -#pragma push -#pragma force_active on -SECTION_DATA static Vec l_cull_box[2] = { - {-1200.0f, - -100.0f, - -1200.0f - }, - { - 1200.0f, - 400.0f, - 1200.0f - }, +static Vec l_cull_box[2] = { + {-1200.0f, -100.0f, -1200.0f}, + {1200.0f, 400.0f, 1200.0f}, }; -#pragma pop /* 80BB3ADC-80BB3B1C 000068 0040+00 0/1 0/0 0/0 .data l_sph_src */ -#pragma push -#pragma force_active on static dCcD_SrcSph l_sph_src = { { - {0x0, {{0x0, 0x0, 0x0}, {0x402020, 0x11}, 0x58}}, // mObj - {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt - {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjTg - {0x0}, // mGObjCo - }, // mObjInf + {0x0, {{0x0, 0x0, 0x0}, {0x402020, 0x11}, 0x58}}, // mObj + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjTg + {0x0}, // mGObjCo + }, // mObjInf { - {{0.0f, 0.0f, 0.0f}, 50.0f} // mSph - } // mSphAttr + {{0.0f, 0.0f, 0.0f}, 50.0f} // mSph + } // mSphAttr }; -#pragma pop /* 80BB3B1C-80BB3B68 0000A8 004C+00 0/1 0/0 0/0 .data l_cps_src */ -#pragma push -#pragma force_active on static dCcD_SrcCps l_cps_src = { { - {0x0, {{0x100, 0x1, 0x1d}, {0x0, 0x0}, 0x0}}, // mObj - {dCcD_SE_SWORD, 0x0, 0x0, 0x1, 0x0}, // mGObjAt - {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x4}, // mGObjTg - {0x0}, // mGObjCo - }, // mObjInf + {0x0, {{0x100, 0x1, 0x1d}, {0x0, 0x0}, 0x0}}, // mObj + {dCcD_SE_SWORD, 0x0, 0x0, 0x1, 0x0}, // mGObjAt + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x4}, // mGObjTg + {0x0}, // mGObjCo + }, // mObjInf { - {{0.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 0.0f}, 20.0f}, // mCps - } // mCpsAttr + {{0.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 0.0f}, 20.0f}, // mCps + } // mCpsAttr }; -#pragma pop /* 80BB3B68-80BB3BAC 0000F4 0044+00 0/1 0/0 0/0 .data l_cyl_src */ -#pragma push -#pragma force_active on static dCcD_SrcCyl l_cyl_src = { { - {0x0, {{0x0, 0x0, 0x1f}, {0x0, 0x0}, 0x79}}, // mObj - {dCcD_SE_NONE, 0x1, 0x0, 0x0, 0x0}, // mGObjAt - {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x6}, // mGObjTg - {0x0}, // mGObjCo - }, // mObjInf + {0x0, {{0x0, 0x0, 0x1f}, {0x0, 0x0}, 0x79}}, // mObj + {dCcD_SE_NONE, 0x1, 0x0, 0x0, 0x0}, // mGObjAt + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x6}, // mGObjTg + {0x0}, // mGObjCo + }, // mObjInf { - {0.0f, 0.0f, 0.0f}, // mCenter - 15.0f, // mRadius - 60.0f // mHeight - } // mCyl + {0.0f, 0.0f, 0.0f}, // mCenter + 15.0f, // mRadius + 60.0f // mHeight + } // mCyl }; -#pragma pop /* 80BAE778-80BAEADC 0004F8 0364+00 1/0 0/0 0/0 .text Create__9daObjBm_cFv */ int daObjBm_c::Create() { - fopAcM_SetMtx(this,mpModel->getBaseTRMtx()); + fopAcM_SetMtx(this, mpModel->getBaseTRMtx()); mStts.Init(0xff, 0xff, this); mSph.Set(l_sph_src); mSph.SetStts(&mStts); mCps.Set(l_cps_src); mCps.SetStts(&mStts); - + for (int i = 0; i < 4; i++) { mCyl[i].Set(l_cyl_src); mCyl[i].SetStts(&mStts); } - - fopAcM_setCullSizeBox(this,l_cull_box[0].x,l_cull_box[0].y,l_cull_box[0].z,l_cull_box[1].x, l_cull_box[1].y, l_cull_box[1].z); + + fopAcM_setCullSizeBox(this, l_cull_box[0].x, l_cull_box[0].y, l_cull_box[0].z, l_cull_box[1].x, + l_cull_box[1].y, l_cull_box[1].z); JUTNameTab* joint_name = mpModel->getModelData()->getJointTree().getJointName(); for (int i = 0; i < 5; i++) { - if ( mpModel->getModelData()->getJointNum() <= i) break; - if (!strcmp(joint_name->getName(i), l_joint_table[2])) { - mHeadJntNo = i; - mpModel->getModelData()->getJointNodePointer(i)->setCallBack(nodeCallBack); + for (u16 j = 0; j < mpModel->getModelData()->getJointNum(); j++) { + if (strcmp(joint_name->getName(j), l_joint_table[i]) == 0) { + mJoints[i] = j; + mpModel->getModelData()->getJointNodePointer(j)->setCallBack(nodeCallBack); + } } } mpModel->setUserArea((uintptr_t)this); JUTNameTab* material_name = mpModel->getModelData()->getMaterialTable().getMaterialName(); - u32 uVar12 = 0; - while( true ) { - if ( mpModel->getModelData()->getMaterialNum() <= uVar12) break; - if (strcmp(material_name->getName(uVar12),"bmEye") == 0) { - mpMaterial = mpModel->getModelData()->getMaterialNodePointer(uVar12); + for (u16 i = 0; i < mpModel->getModelData()->getMaterialNum(); i++) { + if (strcmp(material_name->getName(i), l_eye_matName) == 0) { + mpMaterial = mpModel->getModelData()->getMaterialNodePointer(i); } - uVar12 = uVar12 + 1; } - + #if DEBUG - if (field_0xfcc == 0) { + if (field_0xfcc.x == 0) { OSReport_Error("ブ[モス]。苔のマテリアルがありません"); return 0; } #endif - - // (**(code **)(*(int *)(this + 0x10a0) + 0x14))(this + 0x1080,this + 0x1068,1); - // (**(code **)(*(int *)(this + 0x10d0) + 0x14))(this + 0x10b0,this + 0x1074,1); + + mSound.init(&field_0x1048, 1); + mSound2.init(&field_0x1054, 1); field_0x1039 = 1; - if (fopAcM_isSwitch(this,getSwNo2())) { + if (fopAcM_isSwitch(this, getSwNo2())) { field_0xff7 = 0x0; if (getMoveType() != 1) { - mpBaseAnm2->setFrame(mpBaseAnm2->getEndFrame()); + mpBckAnm3->setFrame(mpBckAnm3->getEndFrame()); } - + initActionObjBemos(); } else { initActionEnBemos(); - if (getSwNo() != -1) { - if (fopAcM_isSwitch(this,getSwNo())) { - field_0xff7 = 0; - initActionSwWait(); - } + + if (getSwNo() != 0xFF && !fopAcM_isSwitch(this, getSwNo())) { + field_0xff7 = 0; + initActionSwWait(); + } else { + field_0xff7 = 1; + J3DAnmTevRegKey* model_data = (J3DAnmTevRegKey*)dComIfG_getObjectRes(l_arcName, 0x14); + mpBrkAnm->init(mpModel->getModelData(), model_data, 1, 2, 1.0f, 0, -1); + mpBckAnm->setFrame(mpBckAnm->getEndFrame()); + initActionWarning(); } - field_0xff7 = 1; - J3DAnmTevRegKey* model_data = (J3DAnmTevRegKey*)dComIfG_getObjectRes("Obj_bm", 0x14); - mpBrkAnm->init(mpModel->getModelData(),model_data,1,2,1.0f,0,-1); - mpBaseAnm->setFrame(mpBaseAnm->getEndFrame()); - initActionWarning(); } - + initBaseMtx(); return 1; } -/* ############################################################################################## */ -/* 80BB3830-80BB3834 000078 0004+00 9/19 0/0 0/0 .rodata @4250 */ -SECTION_RODATA static u8 const lit_4250[4] = { - 0x00, - 0x00, - 0x00, - 0x00, -}; -COMPILER_STRIP_GATE(0x80BB3830, &lit_4250); - -/* 80BB3BAC-80BB3BB8 -00001 000C+00 0/1 0/0 0/0 .data @4298 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4298[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)actionEnBemos__9daObjBm_cFv, -}; -#pragma pop - -/* 80BB3BB8-80BB3BC4 -00001 000C+00 0/1 0/0 0/0 .data @4299 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4299[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)actionObjBemos__9daObjBm_cFv, -}; -#pragma pop - -/* 80BB3BC4-80BB3BDC 000150 0018+00 0/1 0/0 0/0 .data l_func$4297 */ -#pragma push -#pragma force_active on -SECTION_DATA static u8 l_func_4297[24] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -#pragma pop - -/* 80BB3BDC-80BB3BE8 -00001 000C+00 0/1 0/0 0/0 .data @4354 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4354[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)actionSwWait__9daObjBm_cFv, -}; -#pragma pop - -/* 80BB3BE8-80BB3BF4 -00001 000C+00 0/1 0/0 0/0 .data @4355 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4355[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)actionWarning__9daObjBm_cFv, -}; -#pragma pop - -/* 80BB3BF4-80BB3C00 -00001 000C+00 0/1 0/0 0/0 .data @4356 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4356[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)actionFindPlayer__9daObjBm_cFv, -}; -#pragma pop - -/* 80BB3C00-80BB3C0C -00001 000C+00 0/1 0/0 0/0 .data @4357 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4357[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)actionAttack__9daObjBm_cFv, -}; -#pragma pop - -/* 80BB3C0C-80BB3C18 -00001 000C+00 0/1 0/0 0/0 .data @4358 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4358[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)actionDead__9daObjBm_cFv, -}; -#pragma pop - -/* 80BB3C18-80BB3C54 0001A4 003C+00 0/1 0/0 0/0 .data l_func$4353 */ -#pragma push -#pragma force_active on -SECTION_DATA static u8 l_func_4353[60] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -#pragma pop - -/* 80BB3C54-80BB3C60 -00001 000C+00 0/1 0/0 0/0 .data @4407 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4407[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)mode_wait__9daObjBm_cFv, -}; -#pragma pop - -/* 80BB3C60-80BB3C6C -00001 000C+00 0/1 0/0 0/0 .data @4408 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4408[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)mode_walk__9daObjBm_cFv, -}; -#pragma pop - -/* 80BB3C6C-80BB3C78 -00001 000C+00 0/1 0/0 0/0 .data @4409 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4409[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)mode_afl__9daObjBm_cFv, -}; -#pragma pop - -/* 80BB3C78-80BB3C84 -00001 000C+00 0/1 0/0 0/0 .data @4410 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4410[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)mode_dead__9daObjBm_cFv, -}; -#pragma pop - -/* 80BB3C84-80BB3CB4 000210 0030+00 0/1 0/0 0/0 .data mode_proc$4406 */ -#pragma push -#pragma force_active on -SECTION_DATA static u8 mode_proc[48] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -#pragma pop - -/* 80BB3CB4-80BB3CC0 -00001 000C+00 0/1 0/0 0/0 .data @4733 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4733[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)effectWait__9daObjBm_cFv, -}; -#pragma pop - -/* 80BB3CC0-80BB3CCC -00001 000C+00 0/1 0/0 0/0 .data @4734 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4734[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)effectSet0__9daObjBm_cFv, -}; -#pragma pop - -/* 80BB3CCC-80BB3CD8 -00001 000C+00 0/1 0/0 0/0 .data @4735 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4735[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)effectSet1__9daObjBm_cFv, -}; -#pragma pop - -/* 80BB3CD8-80BB3CE4 -00001 000C+00 0/1 0/0 0/0 .data @4736 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_4736[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)effectEnd__9daObjBm_cFv, -}; -#pragma pop - -/* 80BB3CE4-80BB3D14 000270 0030+00 0/1 0/0 0/0 .data l_eff_func$4732 */ -#pragma push -#pragma force_active on -SECTION_DATA static u8 l_eff_func[48] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -#pragma pop - -/* 80BB3D14-80BB3D64 0002A0 0050+00 2/2 0/0 0/0 .data M_lin5__Q29daObjBm_c5Bgc_c */ -SECTION_DATA u8 daObjBm_c::Bgc_c::M_lin5[80] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xBF, 0x00, 0x00, 0x00, 0xBF, 0x00, 0x00, 0x00, 0xBF, 0x80, 0x00, 0x00, 0xBF, 0x80, 0x00, 0x00, - 0x3F, 0x00, 0x00, 0x00, 0xBF, 0x00, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, 0xBF, 0x80, 0x00, 0x00, - 0x3F, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, - 0xBF, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0xBF, 0x80, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, -}; - -/* 80BB3D64-80BB3D84 -00001 0020+00 1/1 0/0 0/0 .data @6065 */ -SECTION_DATA static void* lit_6065[8] = { - (void*)(((char*)actionDead__9daObjBm_cFv) + 0x44), - (void*)(((char*)actionDead__9daObjBm_cFv) + 0x60), - (void*)(((char*)actionDead__9daObjBm_cFv) + 0xE4), - (void*)(((char*)actionDead__9daObjBm_cFv) + 0x174), - (void*)(((char*)actionDead__9daObjBm_cFv) + 0x188), - (void*)(((char*)actionDead__9daObjBm_cFv) + 0x1FC), - (void*)(((char*)actionDead__9daObjBm_cFv) + 0x2DC), - (void*)(((char*)actionDead__9daObjBm_cFv) + 0x34C), -}; - -/* 80BB3D84-80BB3DA4 -00001 0020+00 1/0 0/0 0/0 .data daObjBm_METHODS */ -static actor_method_class daObjBm_METHODS = { - (process_method_func)daObjBm_create1st__FP9daObjBm_c, - (process_method_func)daObjBm_MoveBGDelete__FP9daObjBm_c, - (process_method_func)daObjBm_MoveBGExecute__FP9daObjBm_c, - 0, - (process_method_func)daObjBm_MoveBGDraw__FP9daObjBm_c, -}; - -/* 80BB3DA4-80BB3DD4 -00001 0030+00 0/0 0/0 1/0 .data g_profile_Obj_Bemos */ -extern actor_process_profile_definition g_profile_Obj_Bemos = { - fpcLy_CURRENT_e, // mLayerID - 3, // mListID - fpcPi_CURRENT_e, // mListPrio - PROC_Obj_Bemos, // mProcName - &g_fpcLf_Method.base, // sub_method - sizeof(daObjBm_c), // mSize - 0, // mSizeOther - 0, // mParameters - &g_fopAc_Method.base, // sub_method - 604, // mPriority - &daObjBm_METHODS, // sub_method - 0x00040100, // mStatus - fopAc_ACTOR_e, // mActorType - fopAc_CULLBOX_CUSTOM_e, // cullType -}; - -/* 80BB3DD4-80BB3DE0 000360 000C+00 1/1 0/0 0/0 .data __vt__12dBgS_AcchCir */ -SECTION_DATA extern void* __vt__12dBgS_AcchCir[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__12dBgS_AcchCirFv, -}; - -/* 80BB3DE0-80BB3DEC 00036C 000C+00 2/2 0/0 0/0 .data __vt__10cCcD_GStts */ -SECTION_DATA extern void* __vt__10cCcD_GStts[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__10cCcD_GSttsFv, -}; - -/* 80BB3DEC-80BB3DF8 000378 000C+00 1/1 0/0 0/0 .data __vt__10dCcD_GStts */ -SECTION_DATA extern void* __vt__10dCcD_GStts[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__10dCcD_GSttsFv, -}; - -/* 80BB3DF8-80BB3E04 000384 000C+00 3/3 0/0 0/0 .data __vt__8cM3dGCyl */ -SECTION_DATA extern void* __vt__8cM3dGCyl[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__8cM3dGCylFv, -}; - -/* 80BB3E04-80BB3E10 000390 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, -}; - -/* 80BB3E10-80BB3E1C 00039C 000C+00 4/4 0/0 0/0 .data __vt__8cM3dGAab */ -SECTION_DATA extern void* __vt__8cM3dGAab[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__8cM3dGAabFv, -}; - -/* 80BB3E1C-80BB3E40 0003A8 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_80BB379C, - (void*)NULL, - (void*)NULL, - (void*)func_80BB3794, -}; - -/* 80BB3E40-80BB3E4C 0003CC 000C+00 3/3 0/0 0/0 .data __vt__8cM3dGPla */ -SECTION_DATA extern void* __vt__8cM3dGPla[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__8cM3dGPlaFv, -}; - -/* 80BB3E4C-80BB3E58 0003D8 000C+00 2/2 0/0 0/0 .data __vt__12J3DFrameCtrl */ -SECTION_DATA extern void* __vt__12J3DFrameCtrl[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__12J3DFrameCtrlFv, -}; - /* 80BAEADC-80BAEF90 00085C 04B4+00 1/0 0/0 0/0 .text CreateHeap__9daObjBm_cFv */ int daObjBm_c::CreateHeap() { - // NONMATCHING -} + J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_arcName, 0xd); + JUT_ASSERT(767, modelData != 0); -/* 80BAEF90-80BAEFD8 000D10 0048+00 1/0 0/0 0/0 .text __dt__12J3DFrameCtrlFv */ -// J3DFrameCtrl::~J3DFrameCtrl() { -extern "C" void __dt__12J3DFrameCtrlFv() { - // NONMATCHING + mpModel = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000084); + if (mpModel == NULL) { + return 0; + } + + J3DAnmTevRegKey* pbrk = (J3DAnmTevRegKey*)dComIfG_getObjectRes(l_arcName, 0x13); + JUT_ASSERT(780, pbrk != 0); + mpBrkAnm = new mDoExt_brkAnm(); + if (mpBrkAnm == NULL || mpBrkAnm->init(modelData, pbrk, 1, 0, 1.0f, 0, -1) == 0) { + return 0; + } + + J3DAnmTransform* pbck; +#if DEBUG + pbck = (J3DAnmTransform*)dComIfG_getObjectRes(l_arcName, 7); + JUT_ASSERT(791, pbck != 0); +#endif + + pbck = (J3DAnmTransform*)dComIfG_getObjectRes(l_arcName, 7); + JUT_ASSERT(798, pbck != 0); + mpBckAnm = new mDoExt_bckAnm(); + if (mpBckAnm == NULL || mpBckAnm->init(pbck, 1, 0, 1.0f, 0, -1, false) == 0) { + return 0; + } + + modelData = (J3DModelData*)dComIfG_getObjectRes(l_arcName, 0xe); + JUT_ASSERT(813, modelData != 0); + mpModel2 = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000284); + if (mpModel2 == NULL) { + return 0; + } + + J3DAnmTextureSRTKey* pbtk = (J3DAnmTextureSRTKey*)dComIfG_getObjectRes(l_arcName, 0x1a); + JUT_ASSERT(827, pbtk != 0); + mpBtkAnm = new mDoExt_btkAnm(); + if (mpBtkAnm == NULL || mpBtkAnm->init(modelData, pbtk, 1, 0, 1.0f, 0, -1) == 0) { + return 0; + } + mpBtkAnm->setFrame(mpBtkAnm->getEndFrame()); + +#ifdef DEBUG + pbtk = (J3DAnmTextureSRTKey*)dComIfG_getObjectRes(l_arcName, 0x18); + JUT_ASSERT(840, pbtk != 0); +#endif + + pbtk = (J3DAnmTextureSRTKey*)dComIfG_getObjectRes(l_arcName, 0x18); + JUT_ASSERT(846, pbtk != 0); + mpBtkAnm2 = new mDoExt_btkAnm(); + if (mpBtkAnm2 == NULL || mpBtkAnm2->init(modelData, pbtk, 1, 2, 1.0f, 0, -1) == 0) { + return 0; + } + + J3DAnmTransform* pbck2 = (J3DAnmTransform*)dComIfG_getObjectRes(l_arcName, 9); + JUT_ASSERT(858, pbck != 0); + mpBckAnm2 = new mDoExt_bckAnm(); + if (mpBckAnm2 == NULL || mpBckAnm2->init(pbck2, 1, 2, 1.0f, 0, -1, false) == 0) { + return 0; + } + + modelData = (J3DModelData*)dComIfG_getObjectRes(l_arcName, 0xf); + JUT_ASSERT(873, modelData != 0); + mpModel3 = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000084); + if (mpModel3 == NULL) { + return 0; + } + + J3DAnmTransform* pbck3 = (J3DAnmTransform*)dComIfG_getObjectRes(l_arcName, 8); + JUT_ASSERT(885, pbck3 != 0); + mpBckAnm3 = new mDoExt_bckAnm(); + if (mpBckAnm3 == NULL || mpBckAnm3->init(pbck3, 1, 0, 1.0f, 0, -1, false) == 0) { + return 0; + } + mpBckAnm3->setPlaySpeed(0.0f); + + return 1; } /* 80BAEFD8-80BAF09C 000D58 00C4+00 1/1 0/0 0/0 .text create1st__9daObjBm_cFv */ -void daObjBm_c::create1st() { - // NONMATCHING +int daObjBm_c::create1st() { + if (field_0x100e == 0) { + field_0x100a = home.angle.x; + field_0x100c = home.angle.z; + home.angle.x = home.angle.z = 0; + current.angle.x = current.angle.z = 0; + shape_angle.x = shape_angle.z = 0; + field_0x100e = 1; + } + + cPhs__Step phase_state = (cPhs__Step)dComIfG_resLoad(&mPhase, l_arcName); + + if (phase_state == cPhs_COMPLEATE_e) { + phase_state = + (cPhs__Step)MoveBGCreate(l_arcName, 0x1e, dBgS_MoveBGProc_TypicalRotY, 0x5500, NULL); + if (phase_state == cPhs_ERROR_e) { + return phase_state; + } + +#ifdef DEBUG + OS_REPORT("新ビーモス:0x%x\n", fopAcM_GetParam(this)); + l_HIO.entryHIO("ビーモス"); +#endif + } + + return phase_state; } -/* ############################################################################################## */ -/* 80BB3834-80BB3838 00007C 0004+00 0/1 0/0 0/0 .rodata @4291 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4291 = 1.0f / 5.0f; -COMPILER_STRIP_GATE(0x80BB3834, &lit_4291); -#pragma pop - -/* 80BB3838-80BB383C 000080 0004+00 2/3 0/0 0/0 .rodata @4292 */ -SECTION_RODATA static f32 const lit_4292 = 50.0f; -COMPILER_STRIP_GATE(0x80BB3838, &lit_4292); - -/* 80BB383C-80BB3840 000084 0004+00 0/1 0/0 0/0 .rodata @4293 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4293 = 10.0f; -COMPILER_STRIP_GATE(0x80BB383C, &lit_4293); -#pragma pop - /* 80BAF09C-80BAF29C 000E1C 0200+00 1/0 0/0 0/0 .text Execute__9daObjBm_cFPPA3_A4_f */ int daObjBm_c::Execute(Mtx** param_0) { - // NONMATCHING +#ifdef DEBUG + scale.setall(l_HIO.mBodyScale); + mpModel->setBaseScale(scale); + daPy_py_c* player = daPy_getPlayerActorClass(); +#endif + + field_0xff0++; + + if (field_0xf96 != field_0xf98 && field_0xfaa == 0) { + field_0xfaa = 0xFA; + } + + cLib_chaseAngleS(&field_0xf96, field_0xf98, field_0xfaa); + cLib_chaseAngleS(&field_0xf9a, field_0xf9c, field_0xfae); + cLib_chaseAngleS(&field_0xf9e, field_0xfa0, field_0xfae); + cLib_chaseAngleS(&field_0xfa2, field_0xfa4, field_0xfae); + cLib_chaseAngleS(&field_0xfa6, field_0xfa8, field_0xfae); + + main_proc_call(); + + eyePos = l_eye_offset; + + mDoMtx_stack_c::transS(current.pos); + mDoMtx_stack_c::YrotM(home.angle.y + field_0xf96); + mDoMtx_stack_c::multVec(&eyePos, &eyePos); + attention_info.position = eyePos; + + *param_0 = &mBgMtx; + setBaseMtx(); + + cLib_addCalcAngleS(&field_0xfaa, field_0xfac, 0x1e, 0x14, 10); + cLib_addCalcAngleS(&field_0xfae, field_0xfb0, 0x1e, 0x14, 10); + cLib_addCalc(&field_0x1000, 0.0f, 0.2f, KREG_F(2) + 50.0f, KREG_F(3) + 10.0f); + field_0xfb2 = field_0xf96; + + if (mpBckAnm3->getFrame() == 0.0f) { + setCrawCO(); + } + + mSound.framework(0, dComIfGp_getReverb(fopAcM_GetRoomNo(this))); + mSound2.framework(0, dComIfGp_getReverb(fopAcM_GetRoomNo(this))); + return 1; } /* 80BAF29C-80BAF328 00101C 008C+00 1/1 0/0 0/0 .text main_proc_call__9daObjBm_cFv */ void daObjBm_c::main_proc_call() { - // NONMATCHING + static daObjBm_c::procFunc l_func[] = { + &daObjBm_c::actionEnBemos, + &daObjBm_c::actionObjBemos, + }; + + (this->*l_func[field_0xfeb])(); } /* 80BAF328-80BAF37C 0010A8 0054+00 1/1 0/0 0/0 .text initActionEnBemos__9daObjBm_cFv */ void daObjBm_c::initActionEnBemos() { - // NONMATCHING + if (mpBgW && mpBgW->ChkUsed()) { + mpBgW->OffPushPullOk(); + } + + field_0xfeb = 0; } /* 80BAF37C-80BAF46C 0010FC 00F0+00 2/2 0/0 0/0 .text initActionObjBemos__9daObjBm_cFv */ void daObjBm_c::initActionObjBemos() { - // NONMATCHING -} + if (mpBgW && mpBgW->ChkUsed()) { + mpBgW->OnPushPullOk(); + } -/* ############################################################################################## */ -/* 80BB3840-80BB3844 000088 0004+00 3/5 0/0 0/0 .rodata @4402 */ -SECTION_RODATA static f32 const lit_4402 = -1.0f; -COMPILER_STRIP_GATE(0x80BB3840, &lit_4402); + mpBgW->SetPushPullCallback((dBgW_Base::PushPull_CallBack)PPCallBack); + + u8 move_type = getMoveType(); + switch (move_type) { + case 0: + if (fopAcM_isSwitch(this, getSwNo3())) { + field_0x10b4 = 4; + mode_wait(); + mode_dead_init(); + } + break; + case 1: + if (fopAcM_isSwitch(this, getSwNo2())) { + mode_wait(); + mode_dead_init(); + } + break; + } + + field_0xfeb = 1; +} /* 80BAF46C-80BAF750 0011EC 02E4+00 1/0 0/0 0/0 .text actionEnBemos__9daObjBm_cFv */ void daObjBm_c::actionEnBemos() { - // NONMATCHING + static daObjBm_c::procFunc l_func[] = { + &daObjBm_c::actionSwWait, &daObjBm_c::actionWarning, &daObjBm_c::actionFindPlayer, + &daObjBm_c::actionAttack, &daObjBm_c::actionDead, + }; + + if (mSph.ChkTgHit()) { + cCcD_Obj* hitobj = mSph.GetTgHitObj(); + + if (hitobj) { + if (hitobj->ChkAtType(AT_TYPE_ARROW) || hitobj->ChkAtType(AT_TYPE_BOMB) || + hitobj->ChkAtType(AT_TYPE_IRON_BALL)) + { + mDoAud_seStart(Z2SE_EN_BM_EYE_BREAK, &eyePos, 0, + dComIfGp_getReverb((int)fopAcM_GetRoomNo(this))); + initEffectSet0(); + fopAcM_onSwitch(this, getSwNo2()); + initActionDead(); + OS_REPORT("ビーモス死亡!<%d>\n", getSwNo2()); + } + } + } + + mSph.ClrTgHit(); + calcBeamPos(); + effect_proc(); + (this->*l_func[field_0xfe4])(); + calcBeamLenAndAt(); + mpBckAnm2->play(); + mpBtkAnm->play(); + mpBtkAnm2->play(); + mpBrkAnm->play(); + mpBckAnm->play(); + mpBckAnm3->play(); + + if (field_0xfaa != 0) { + fopAcM_seStartLevel(this, Z2SE_EN_BM_TURN, 0); + } + + if (field_0xfe4 != 4 && field_0xfe4 != 0) { + mSph.SetC(eyePos); + dComIfG_Ccsp()->Set(&mSph); + } + + if (field_0xfe4 == 3) { + dComIfG_Ccsp()->Set(&mCps); + mSound.startLevelSound(Z2SE_EN_BM_BEAM, 0, -1); + } } /* 80BAF750-80BAF80C 0014D0 00BC+00 1/0 0/0 0/0 .text actionObjBemos__9daObjBm_cFv */ void daObjBm_c::actionObjBemos() { - // NONMATCHING + static daObjBm_c::modeFunc mode_proc[] = { + &daObjBm_c::mode_wait, + &daObjBm_c::mode_walk, + &daObjBm_c::mode_afl, + &daObjBm_c::mode_dead, + }; + + (this->*mode_proc[field_0x10ac])(); } /* 80BAF80C-80BAF8BC 00158C 00B0+00 1/1 0/0 0/0 .text setCrawCO__9daObjBm_cFv */ void daObjBm_c::setCrawCO() { - // NONMATCHING + mDoMtx_stack_c::transS(current.pos); + mDoMtx_stack_c::YrotM(home.angle.y); + cXyz acStack_28; + + for (int i = 0; i < 4; i++) { + mDoMtx_stack_c::multVec(&l_craw_offset[i], &acStack_28); + mCyl[i].SetC(acStack_28); + dComIfG_Ccsp()->Set(&mCyl[i]); + } } -/* 80BAF8BC-80BAF8F8 00163C 003C+00 2/2 0/0 0/0 .text __dt__4cXyzFv */ -// cXyz::~cXyz() { -extern "C" void __dt__4cXyzFv() { - // NONMATCHING -} - -/* ############################################################################################## */ -/* 80BB3844-80BB3848 00008C 0004+00 0/1 0/0 0/0 .rodata @4515 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4515 = 600.0f; -COMPILER_STRIP_GATE(0x80BB3844, &lit_4515); -#pragma pop - -/* 80BB3848-80BB384C 000090 0004+00 1/2 0/0 0/0 .rodata @4516 */ -SECTION_RODATA static f32 const lit_4516 = 300.0f; -COMPILER_STRIP_GATE(0x80BB3848, &lit_4516); - -/* 80BB384C-80BB3850 000094 0004+00 0/2 0/0 0/0 .rodata @4517 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4517 = 5.0f; -COMPILER_STRIP_GATE(0x80BB384C, &lit_4517); -#pragma pop - -/* 80BB3850-80BB3858 000098 0008+00 0/2 0/0 0/0 .rodata @4518 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_4518[8] = { - 0x3F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x80BB3850, &lit_4518); -#pragma pop - -/* 80BB3858-80BB3860 0000A0 0008+00 0/2 0/0 0/0 .rodata @4519 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_4519[8] = { - 0x40, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x80BB3858, &lit_4519); -#pragma pop - -/* 80BB3860-80BB3868 0000A8 0008+00 0/2 0/0 0/0 .rodata @4520 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_4520[8] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x80BB3860, &lit_4520); -#pragma pop - /* 80BAF8F8-80BAFC08 001678 0310+00 1/1 0/0 0/0 .text calcBeamPos__9daObjBm_cFv */ void daObjBm_c::calcBeamPos() { - // NONMATCHING + daPy_py_c* player = daPy_getPlayerActorClass(); + f32 dist = fopAcM_searchPlayerDistanceXZ(this); + cXyz cStack_30 = l_low_beam_offset; + + if (dist > 600.0f) { + cStack_30 = l_high_beam_offset; + } else { + if (dist > 300.0f) { + cStack_30 = l_mid_beam_offset; + } + } + + s16 sVar2 = field_0xf96; + cLib_chasePos(&field_0xfd8, cStack_30, 5.0f); + mDoMtx_stack_c::transS(current.pos); + mDoMtx_stack_c::YrotM(sVar2 + current.angle.y); + mDoMtx_stack_c::multVec(&field_0xfd8, &field_0xfb8); + + f32 fVar1 = field_0x1004; + if (fVar1 < 300.0f) + fVar1 = 300.0f; + + cXyz cStack_3c(0.0f, 0.0f, fVar1); + mDoMtx_stack_c::multVec(&cStack_3c, &field_0xfcc); + field_0xfcc = player->current.pos; + cXyz cStack_48 = field_0xfb8 - field_0xfcc; + field_0xfc4.x = cM_atan2s(cStack_48.y, field_0xfcc.absXZ(field_0xfb8)); + field_0xfc4.y = sVar2 + current.angle.y; + field_0xfc4.z = 0; + + if (field_0xfc4.x < cM_deg2s(DREG_F(15) + 20.0f)) + field_0xfc4.x = cM_deg2s(DREG_F(15) + 20.0f); + + mDoMtx_stack_c::transS(field_0xfb8); + mDoMtx_stack_c::ZXYrotM(field_0xfc4.x, sVar2 + current.angle.y, 0); + mDoMtx_stack_c::multVec(&cStack_3c, &field_0xfcc); } -/* ############################################################################################## */ -/* 80BB3868-80BB386C 0000B0 0004+00 0/2 0/0 0/0 .rodata @4628 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4628 = 1200.0f; -COMPILER_STRIP_GATE(0x80BB3868, &lit_4628); -#pragma pop - -/* 80BB386C-80BB3870 0000B4 0004+00 0/1 0/0 0/0 .rodata @4629 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4629 = 20.0f; -COMPILER_STRIP_GATE(0x80BB386C, &lit_4629); -#pragma pop - -/* 80BB3870-80BB3874 0000B8 0004+00 0/1 0/0 0/0 .rodata @4630 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4630 = 60.0f; -COMPILER_STRIP_GATE(0x80BB3870, &lit_4630); -#pragma pop - -/* 80BAFC08-80BAFF60 001988 0358+00 1/1 0/0 0/0 .text calcBeamLenAndAt__9daObjBm_cFv */ +/* 80BAFC08-80BAFF60 001988 0358+00 1/1 0/0 0/0 .text calcBeamLenAndAt__9daObjBm_cFv */ +// NONMATCHING void daObjBm_c::calcBeamLenAndAt() { - // NONMATCHING -} + cXyz cStack_50 = field_0xfcc - field_0xfb8; + cXyz cStack_5c(field_0xfb8); + cStack_50.normalizeZP(); + cStack_5c += cStack_50 * 1200.0f; -/* 80BAFF60-80BAFFA8 001CE0 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGPlaFv */ -// cM3dGPla::~cM3dGPla() { -extern "C" void __dt__8cM3dGPlaFv() { - // NONMATCHING +#if DEBUG + f32 dVar4 = mpBtkAnm->getFrame(); +#endif + + if (fopAcM_lc_c::lineCheck(&field_0xfb8, &cStack_5c, this) && fopAcM_lc_c::checkGroundHit()) { + field_0x10a0.z = field_0xfb8.abs(fopAcM_lc_c::getCross()) / 1200.0f; + } else { + field_0x10a0.z = 1.0f; + } + + cStack_5c = field_0xfb8 + (cStack_50 * (field_0x10a0.z * 1200.0f)); + mCps.cM3dGCps::Set(field_0xfb8, cStack_5c, 20.0f); + mCps.CalcAtVec(); + + if (field_0x1039 > 0) { + cXyz cStack_68(field_0xfcc); + + if (fopAcM_lc_c::lineCheck(&field_0xfb8, &cStack_5c, this) && fopAcM_lc_c::checkGroundHit()) + { + cStack_68 = fopAcM_lc_c::getCross(); + } + + if (cLib_chasePos(&field_0x1048, cStack_68, 60.0f) != 0) { + field_0x1039 = -1; + } + } else { + if (cLib_chasePos(&field_0x1048, cStack_5c, 60.0f) != 0) { + field_0x1039 = 1; + } + } } /* 80BAFFA8-80BB0104 001D28 015C+00 1/1 0/0 0/0 .text checkFindPlayer__9daObjBm_cFv */ -void daObjBm_c::checkFindPlayer() { - // NONMATCHING +// NONMATCHING +s8 daObjBm_c::checkFindPlayer() { + daPy_py_c* player = daPy_getPlayerActorClass(); + f32 searchDistance = getSearchDistance(); +#if DEBUG + s16 search_angle = l_HIO.mDetectionAngle; +#else + s16 search_angle = 25000; +#endif + + s8 ret = -1; + + field_0xfe8 = 0; + + f32 playerDistanceXZ = fopAcM_searchPlayerDistanceXZ(this); + f32 fVar1 = current.pos.y - player->current.pos.y; + if (playerDistanceXZ > searchDistance) { + return ret; + } else { + if (fVar1 < 0.0f) { + if (std::fabs(fVar1) > (1.0f - (playerDistanceXZ / searchDistance)) * l_eye_offset.y) { + return ret; + } + } + + if ((s16)abs((s16)(fopAcM_searchPlayerAngleY(this) - field_0xf96 - home.angle.y)) < + (s16)(search_angle / 2)) + { + ret = 0; + } + + if (ret == 0) { + cXyz eye(eyePos); + cXyz eye2(player->eyePos); + + if (fopAcM_lc_c::lineCheck(&eye, &eye2, this)) { + field_0xfe8 = 1; + } + } + } + + return ret; } /* 80BB0104-80BB0260 001E84 015C+00 1/1 0/0 0/0 .text checkSearchPlayer__9daObjBm_cFv */ -void daObjBm_c::checkSearchPlayer() { - // NONMATCHING +// NONMATCHING +s8 daObjBm_c::checkSearchPlayer() { + daPy_py_c* player = daPy_getPlayerActorClass(); + f32 searchDistance = getSearchDistance(); +#if DEBUG + s16 search_angle = l_HIO.mSearchAngle; +#else + s16 search_angle = 30000; +#endif + + s8 ret = -1; + + field_0xfe8 = 0; + + f32 playerDistanceXZ = fopAcM_searchPlayerDistanceXZ(this); + f32 fVar1 = current.pos.y - player->current.pos.y; + if (playerDistanceXZ > searchDistance) { + return ret; + } + + if (fVar1 < 0.0f) { + if (std::fabs(fVar1) > (1.0f - (playerDistanceXZ / searchDistance)) * l_eye_offset.y) { + return ret; + } + } + + if ((s16)abs((s16)(fopAcM_searchPlayerAngleY(this) - field_0xf96 - home.angle.y)) < + (s16)(search_angle / 2)) + { + ret = 0; + } + + if (ret == 0) { + cXyz eye(eyePos); + cXyz eye2(player->eyePos); + + if (fopAcM_lc_c::lineCheck(&eye, &eye2, this)) { + field_0xfe8 = 1; + } + } + + return ret; } -/* ############################################################################################## */ -/* 80BB3874-80BB3878 0000BC 0004+00 2/2 0/0 0/0 .rodata @4714 */ -SECTION_RODATA static f32 const lit_4714 = 1000.0f; -COMPILER_STRIP_GATE(0x80BB3874, &lit_4714); - -/* 80BB3878-80BB3880 0000C0 0008+00 2/2 0/0 0/0 .rodata @4716 */ -SECTION_RODATA static u8 const lit_4716[8] = { - 0x43, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x80BB3878, &lit_4716); - /* 80BB0260-80BB02B8 001FE0 0058+00 2/2 0/0 0/0 .text getSearchDistance__9daObjBm_cFv */ -void daObjBm_c::getSearchDistance() { - // NONMATCHING +f32 daObjBm_c::getSearchDistance() { +#if DEBUG + f32 ret = l_HIO.mSearchDistance; +#else + f32 ret = 1000.0f; +#endif + + if (getSearchDist() != 15 && getSearchDist()) { + ret -= getSearchDist() * 50.0f; + } + + return ret; } /* 80BB02B8-80BB0310 002038 0058+00 1/1 0/0 0/0 .text getBeamSearchDistance__9daObjBm_cFv */ -void daObjBm_c::getBeamSearchDistance() { - // NONMATCHING -} +f32 daObjBm_c::getBeamSearchDistance() { +#if DEBUG + f32 ret = l_HIO.mSearchDistance; +#else + f32 ret = 1000.0f; +#endif -/* ############################################################################################## */ -/* 80BB3F28-80BB3F2C 000048 0004+00 1/1 0/0 0/0 .bss None */ -static u8 data_80BB3F28[4]; + if (getBeamSearchDist() != 15 && getBeamSearchDist()) { + ret -= getBeamSearchDist() * 50.0f; + } + + return ret; +} /* 80BB0310-80BB0580 002090 0270+00 1/1 0/0 0/0 .text effect_proc__9daObjBm_cFv */ void daObjBm_c::effect_proc() { - // NONMATCHING + static daObjBm_c::effectFunc l_eff_func[4] = { + &daObjBm_c::effectWait, + &daObjBm_c::effectSet0, + &daObjBm_c::effectSet1, + &daObjBm_c::effectEnd, + }; + + (this->*l_eff_func[field_0xff6])(); + + for (int i = 0; i < 2; i++) { + if (field_0xff8[i] != NULL) { + field_0xff8[i]->setGlobalRTMatrix(mpModel->getAnmMtx(getHeadJoint())); + + if (cLib_calcTimer(&field_0xff5) == 0) { + field_0xff8[i]->becomeInvalidEmitter(); + field_0xff8[i]->quitImmortalEmitter(); + field_0xff8[i] = NULL; + } + } + } + + if (field_0x1034 != NULL) { + J3DJoint* joint = mpModel->getModelData()->getJointNodePointer(getHeadJoint()); + J3DTransformInfo* info = &joint->getTransformInfo(); + mDoMtx_stack_c::transS(current.pos); + mDoMtx_stack_c::YrotM(home.angle.y); + mDoMtx_stack_c::transM(info->mTranslate.y, info->mTranslate.x, info->mTranslate.z); + mDoMtx_stack_c::YrotM(field_0xf96); + field_0x1034->setGlobalRTMatrix(mDoMtx_stack_c::get()); + } + + if (field_0x102c != NULL) { + mDoMtx_stack_c::copy(mpModel->getAnmMtx((u16)getBigGearJoint())); + mDoMtx_stack_c::multVecZero(&field_0x103c); + mDoAud_seStartLevel(Z2SE_EN_BM_SPARK, &field_0x103c, 0, 0); + } } +/* 80BB3D14-80BB3D64 0002A0 0050+00 2/2 0/0 0/0 .data M_lin5__Q29daObjBm_c5Bgc_c */ +daObjBm_c::BgcSrc_c daObjBm_c::Bgc_c::M_lin5[] = { + {0.0f, 0.0f, 0.0f, 0.0f}, {-0.5f, -0.5f, -1.0f, -1.0f}, {0.5f, -0.5f, 1.0f, -1.0f}, + {0.5f, 0.5f, 1.0f, 1.0f}, {-0.5f, 0.5f, -1.0f, 1.0f}, +}; + /* 80BB0580-80BB0584 002300 0004+00 1/0 0/0 0/0 .text effectWait__9daObjBm_cFv */ -void daObjBm_c::effectWait() { - /* empty function */ -} - -/* ############################################################################################## */ -/* 80BB3880-80BB3884 0000C8 0004+00 0/1 0/0 0/0 .rodata eff_id_f$4818 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const eff_id_f[4] = { - 0x84, - 0x50, - 0x84, - 0x51, -}; -COMPILER_STRIP_GATE(0x80BB3880, &eff_id_f); -#pragma pop - -/* 80BB3884-80BB388C 0000CC 0008+00 0/1 0/0 0/0 .rodata hit_eff_id$4819 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const hit_eff_id[8] = { - 0x85, 0xA2, 0x85, 0xA3, 0x85, 0xA4, 0x85, 0xA5, -}; -COMPILER_STRIP_GATE(0x80BB3884, &hit_eff_id); -#pragma pop +void daObjBm_c::effectWait() {} /* 80BB0584-80BB0718 002304 0194+00 1/1 0/0 0/0 .text initEffectSet0__9daObjBm_cFv */ void daObjBm_c::initEffectSet0() { - // NONMATCHING + static u16 const eff_id_f[2] = { + dPa_RM(ID_ZF_S_BM_BROKENEYE_F_L), + dPa_RM(ID_ZF_S_BM_BROKENEYE_F_S), + }; + + static u16 const hit_eff_id[4] = { + dPa_RM(ID_ZF_S_BM_BROKENEYE_HIT01), + dPa_RM(ID_ZF_S_BM_BROKENEYE_HIT02), + dPa_RM(ID_ZF_S_BM_BROKENEYE_HIT03), + dPa_RM(ID_ZF_S_BM_BROKENEYE_HIT04), + }; + + csXyz i_rotation(home.angle); + i_rotation.y += field_0xf96; + + for (int i = 0; i < 2; i++) { + dComIfGp_particle_set(eff_id_f[i], &eyePos, &i_rotation, &scale, 0xFF, NULL, -1, NULL, NULL, + NULL); + } + + for (int i = 0; i < 4; i++) { + dComIfGp_particle_set(hit_eff_id[i], &eyePos, &i_rotation, &scale, 0xFF, NULL, -1, NULL, + NULL, NULL); + } + + field_0xff8[0] = dComIfGp_particle_set(dPa_RM(ID_ZF_S_BM_BROKENSMK_F), ¤t.pos, + &home.angle, &scale, 0xFF, NULL, -1, NULL, NULL, NULL); + if (field_0xff8[0] != NULL) { + field_0xff8[0]->becomeImmortalEmitter(); + } + + field_0xff5 = 200; + field_0xff6 = 1; } /* 80BB0718-80BB071C 002498 0004+00 1/0 0/0 0/0 .text effectSet0__9daObjBm_cFv */ -void daObjBm_c::effectSet0() { - /* empty function */ -} +void daObjBm_c::effectSet0() {} /* 80BB071C-80BB0720 00249C 0004+00 1/0 0/0 0/0 .text effectSet1__9daObjBm_cFv */ -void daObjBm_c::effectSet1() { - /* empty function */ -} +void daObjBm_c::effectSet1() {} /* 80BB0720-80BB0724 0024A0 0004+00 1/0 0/0 0/0 .text effectEnd__9daObjBm_cFv */ -void daObjBm_c::effectEnd() { - /* empty function */ -} +void daObjBm_c::effectEnd() {} /* 80BB0724-80BB0824 0024A4 0100+00 1/1 0/0 0/0 .text check_to_walk__9daObjBm_cFv */ -void daObjBm_c::check_to_walk() { - // NONMATCHING -} +int daObjBm_c::check_to_walk() { + int ret = -1; + bool bVar1 = true; -/* ############################################################################################## */ -/* 80BB388C-80BB3890 0000D4 0004+00 1/1 0/0 0/0 .rodata @4936 */ -SECTION_RODATA static f32 const lit_4936 = -4.0f; -COMPILER_STRIP_GATE(0x80BB388C, &lit_4936); + if (field_0x10d2) { + dBgW::PushPullLabel iVar2 = + cLib_checkBit(mPPLabel, dBgW::PPLABEL_PULL); + dBgW::PushPullLabel iVar3 = cLib_checkBit(mPPLabel, dBgW::PPLABEL_4); + + s16 sVar5; + if (iVar2) { + if (iVar3) { + sVar5 = 8; + } else { + sVar5 = 0x13; + } + } else if (iVar3) { + sVar5 = 8; + } else { + sVar5 = 0x13; + } + + for (int i = 0; i < 4; i++) { + if (mMomentCnt[i] >= sVar5) { + if (!mBgc.chk_wall_pre(this, mBgc.M_lin5, 5, M_dir_base[i])) { + ret = i; + } + } else { + bVar1 = false; + } + } + } + + if (bVar1) { + clr_moment_cnt(); + } + + field_0x10d2 = 0; + return ret; +} /* 80BB0824-80BB0888 0025A4 0064+00 1/1 0/0 0/0 .text mode_wait_init__9daObjBm_cFv */ void daObjBm_c::mode_wait_init() { - // NONMATCHING + fopAcM_SetSpeedF(this, 0.0f); + fopAcM_SetGravity(this, -4.0f); + mpBgW->SetCrrFunc(dBgS_MoveBGProc_Trans); + clr_moment_cnt(); + field_0x10bc = -1; + field_0x10ac = 0; } -/* ############################################################################################## */ -/* 80BB3890-80BB3894 0000D8 0004+00 0/2 0/0 0/0 .rodata @4960 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4960 = 75.0f; -COMPILER_STRIP_GATE(0x80BB3890, &lit_4960); -#pragma pop - -/* 80BB3894-80BB3898 0000DC 0004+00 0/1 0/0 0/0 .rodata @4961 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_4961 = 0x451D89D9; -COMPILER_STRIP_GATE(0x80BB3894, &lit_4961); -#pragma pop - /* 80BB0888-80BB09C8 002608 0140+00 2/1 0/0 0/0 .text mode_wait__9daObjBm_cFv */ void daObjBm_c::mode_wait() { - // NONMATCHING + f32 tmp1 = l_eye_offset.x; + f32 tmp2 = l_eye_offset.z; + + if (field_0x10ce > 0) + field_0x10ce--; + + int walk_check = check_to_walk(); + cXyz local_38; + mDoMtx_stack_c::transS(home.pos); + mDoMtx_stack_c::YrotM(home.angle.y); + mDoMtx_stack_c::transM(field_0x10b0 * 75.0f, 0.0f, field_0x10b4 * 75.0f); + mDoMtx_stack_c::multVecZero(&local_38); + current.pos.x = local_38.x; + current.pos.z = local_38.z; + + if (walk_check != -1) { + field_0x10bc = walk_check; + + ((daPy_py_c*)dComIfGp_getPlayer(0))->onPushPullKeep(); + mode_walk_init(); + + if (cLib_checkBit(mPPLabel, dBgW::PPLABEL_PULL) != 0) { + field_0x10cc = 13; + field_0x10b8 = 2520.6155f; + } else { + field_0x10cc = 13; + field_0x10b8 = 2520.6155f; + } + } } /* 80BB09C8-80BB09E0 002748 0018+00 1/1 0/0 0/0 .text mode_walk_init__9daObjBm_cFv */ void daObjBm_c::mode_walk_init() { - // NONMATCHING + fopAcM_SetSpeedF(this, 0.0f); + field_0x10ac = 1; } -/* ############################################################################################## */ -/* 80BB3F2C-80BB3F3C 00004C 000C+04 0/1 0/0 0/0 .bss @4973 */ -#pragma push -#pragma force_active on -static u8 lit_4973[12 + 4 /* padding */]; -#pragma pop - -/* 80BB3F3C-80BB3F48 00005C 000C+00 0/1 0/0 0/0 .bss @4976 */ -#pragma push -#pragma force_active on -static u8 lit_4976[12]; -#pragma pop - -/* 80BB3F48-80BB3F54 000068 000C+00 0/1 0/0 0/0 .bss @4977 */ -#pragma push -#pragma force_active on -static u8 lit_4977[12]; -#pragma pop - -/* 80BB3F54-80BB3F60 000074 000C+00 0/1 0/0 0/0 .bss @4978 */ -#pragma push -#pragma force_active on -static u8 lit_4978[12]; -#pragma pop - /* 80BB3F60-80BB3F90 000080 0030+00 0/1 0/0 0/0 .bss dir_vec$4972 */ -#pragma push -#pragma force_active on -static u8 dir_vec[48]; -#pragma pop +// static u8 dir_vec[48]; /* 80BB09E0-80BB0DA8 002760 03C8+00 1/0 0/0 0/0 .text mode_walk__9daObjBm_cFv */ void daObjBm_c::mode_walk() { - // NONMATCHING + static cXyz dir_vec[] = { + cXyz(0.0f, 0.0f, 1.0f), + cXyz(1.0f, 0.0f, 0.0f), + cXyz(0.0f, 0.0f, -1.0f), + cXyz(-1.0f, 0.0f, 0.0f), + }; + + bool uVar5 = --field_0x10cc <= 0; + f32 fVar6 = (cM_scos(field_0x10cc * field_0x10b8) + 1.0f) * 0.5f; + + cXyz local_58; + mDoMtx_stack_c::transS(home.pos); + mDoMtx_stack_c::YrotM(home.angle.y); + mDoMtx_stack_c::transM((field_0x10b0 + fVar6 * dir_vec[field_0x10bc].x) * 75.0f, 0.0f, + (field_0x10b4 + fVar6 * dir_vec[field_0x10bc].z) * 75.0f); + mDoMtx_stack_c::multVecZero(&local_58); + + current.pos.x = local_58.x; + current.pos.z = local_58.z; + eyePos = current.pos; + + if (uVar5 != 0) { + mBgc.chk_wall_pre(this, mBgc.M_lin5, 5, M_dir_base[field_0x10bc]); + } + + current.pos.x = local_58.x; + current.pos.z = local_58.z; + fopAcM_seStartLevel(this, Z2SE_EN_BM_SLIDE, 0); + + if (uVar5 != 0) { + if (field_0x10bc == 0) { + field_0x10b4++; + } else if (field_0x10bc == 1) { + field_0x10b0++; + } else if (field_0x10bc == 2) { + field_0x10b4--; + } else if (field_0x10bc == 3) { + field_0x10b0--; + } + + ((daPy_py_c*)dComIfGp_getPlayer(0))->offPushPullKeep(); + + if (getMoveType() == 0 && field_0x10b4 == 4) { + fopAcM_onSwitch(this, getSwNo3()); + mode_dead_init(); + } else { + mode_wait_init(); + } + } } /* 80BB0DA8-80BB0DC0 002B28 0018+00 1/0 0/0 0/0 .text mode_afl__9daObjBm_cFv */ void daObjBm_c::mode_afl() { - // NONMATCHING + fopAcM_SetSpeedF(this, 0.0f); + field_0x10ac = 2; } /* 80BB0DC0-80BB0DE4 002B40 0024+00 2/2 0/0 0/0 .text mode_dead_init__9daObjBm_cFv */ void daObjBm_c::mode_dead_init() { - // NONMATCHING + mpBgW->OffPushPullOk(); + fopAcM_SetSpeedF(this, 0.0f); + field_0x10ac = 3; } /* 80BB0DE4-80BB0DE8 002B64 0004+00 1/0 0/0 0/0 .text mode_dead__9daObjBm_cFv */ -void daObjBm_c::mode_dead() { - /* empty function */ -} +void daObjBm_c::mode_dead() {} /* 80BB0DE8-80BB0E0C 002B68 0024+00 2/2 0/0 0/0 .text clr_moment_cnt__9daObjBm_cFv */ void daObjBm_c::clr_moment_cnt() { - // NONMATCHING + for (int i = 0; i < 4; i++) { + mMomentCnt[i] = 0; + } } /* 80BB0E0C-80BB0ED0 002B8C 00C4+00 1/1 0/0 0/0 .text __ct__Q29daObjBm_c5Bgc_cFv */ daObjBm_c::Bgc_c::Bgc_c() { - // NONMATCHING -} + for (int i = 0; i < 23; i++) { + field_0x0[i] = 0.0f; + field_0x64[i] = cXyz::Zero; + } -/* 80BB0ED0-80BB0ED4 002C50 0004+00 1/1 0/0 0/0 .text __ct__4cXyzFv */ -// cXyz::cXyz() { -extern "C" void __ct__4cXyzFv() { - /* empty function */ + field_0x5c = 0xFFFFFFFF; + field_0x178 = 0xFFFFFFFF; + field_0x17c = FLT_MAX; + field_0x60 = 0.0f; + mState = STATE_0_e; } /* ############################################################################################## */ /* 80BB3898-80BB3A08 0000E0 0170+00 0/0 0/0 0/0 .rodata M_lin20__Q29daObjBm_c5Bgc_c */ -#pragma push -#pragma force_active on -SECTION_RODATA u8 const daObjBm_c::Bgc_c::M_lin20[368] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xBE, 0x80, 0x00, 0x00, 0xBE, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xBF, 0x00, 0x00, 0x00, 0xBF, 0x00, 0x00, 0x00, 0xBF, 0x80, 0x00, 0x00, 0xBF, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xBF, 0x00, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, 0xBF, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, - 0xBF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBF, 0x80, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, - 0x3E, 0x80, 0x00, 0x00, 0xBE, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xBF, 0x00, 0x00, 0x00, 0xBF, 0x80, 0x00, 0x00, 0xBF, 0x80, 0x00, 0x00, - 0x3F, 0x00, 0x00, 0x00, 0xBF, 0x00, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, 0xBF, 0x80, 0x00, 0x00, - 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBF, 0x80, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, - 0x3E, 0x80, 0x00, 0x00, 0x3E, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBF, 0x80, 0x00, 0x00, 0xBF, 0x80, 0x00, 0x00, - 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, 0xBF, 0x80, 0x00, 0x00, - 0x3F, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0xBF, 0x80, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, - 0xBE, 0x80, 0x00, 0x00, 0x3E, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xBF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBF, 0x80, 0x00, 0x00, 0xBF, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, 0xBF, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, - 0xBF, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0xBF, 0x80, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, - 0xBF, 0x40, 0x00, 0x00, 0x3E, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xBF, 0x40, 0x00, 0x00, 0xBE, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +const daObjBm_c::BgcSrc_c daObjBm_c::Bgc_c::M_lin20[] = { + {0.0f, 0.0f, 0.0f, 0.0f}, {-0.25f, -0.25f, 0.0f, 0.0f}, {-0.5f, -0.5f, -1.0f, -1.0f}, + {0.0f, -0.5f, 1.0f, -1.0f}, {0.0f, 0.0f, 1.0f, 1.0f}, {-0.5f, 0.0f, -1.0f, 1.0f}, + {0.25f, -0.25f, 0.0f, 0.0f}, {0.0f, -0.5f, -1.0f, -1.0f}, {0.5f, -0.5f, 1.0f, -1.0f}, + {0.5f, 0.0f, 1.0f, 1.0f}, {0.0f, 0.0f, -1.0f, 1.0f}, {0.25f, 0.25f, 0.0f, 0.0f}, + {0.0f, 0.0f, -1.0f, -1.0f}, {0.5f, 0.0f, 1.0f, -1.0f}, {0.5f, 0.5f, 1.0f, 1.0f}, + {0.0f, 0.5f, -1.0f, 1.0f}, {-0.25f, 0.25f, 0.0f, 0.0f}, {-0.5f, 0.0f, -1.0f, -1.0f}, + {0.0f, 0.0f, 1.0f, -1.0f}, {0.0f, 0.5f, 1.0f, 1.0f}, {-0.5f, 0.5f, -1.0f, 1.0f}, + {-0.75f, 0.25f, 0.0f, 0.0f}, {-0.75f, -0.25f, 0.0f, 0.0f}, }; -COMPILER_STRIP_GATE(0x80BB3898, &daObjBm_c::Bgc_c::M_lin20); -#pragma pop - -/* 80BB3A08-80BB3A0C 000250 0004+00 0/0 0/0 0/0 .rodata @5157 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5157 = -1000000000.0f; -COMPILER_STRIP_GATE(0x80BB3A08, &lit_5157); -#pragma pop - -/* 80BB3A0C-80BB3A10 000254 0004+00 0/2 0/0 0/0 .rodata @5158 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5158 = 200.0f; -COMPILER_STRIP_GATE(0x80BB3A0C, &lit_5158); -#pragma pop - -/* 80BB3A10-80BB3A14 000258 0004+00 0/1 0/0 0/0 .rodata @5234 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5234 = 100.0f; -COMPILER_STRIP_GATE(0x80BB3A10, &lit_5234); -#pragma pop - -/* 80BB3A14-80BB3A18 00025C 0004+00 0/1 0/0 0/0 .rodata @5235 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5235 = 400.0f; -COMPILER_STRIP_GATE(0x80BB3A14, &lit_5235); -#pragma pop - -/* 80BB3F90-80BB3F9C 0000B0 000C+00 0/1 0/0 0/0 .bss @5101 */ -#pragma push -#pragma force_active on -static u8 lit_5101[12]; -#pragma pop /* 80BB3F9C-80BB4728 0000BC 078C+00 1/2 0/0 0/0 .bss M_gnd_work__Q29daObjBm_c5Bgc_c */ -u8 daObjBm_c::Bgc_c::M_gnd_work[1932]; - -/* 80BB4728-80BB4734 000848 000C+00 0/1 0/0 0/0 .bss @5102 */ -#pragma push -#pragma force_active on -static u8 lit_5102[12]; -#pragma pop +dBgS_ObjGndChk daObjBm_c::Bgc_c::M_gnd_work[23]; /* 80BB4734-80BB4788 000854 0054+00 0/1 0/0 0/0 .bss M_wrt_work__Q29daObjBm_c5Bgc_c */ -#pragma push -#pragma force_active on -u8 daObjBm_c::Bgc_c::M_wrt_work[84]; -#pragma pop - -/* 80BB4788-80BB4794 0008A8 000C+00 0/1 0/0 0/0 .bss @5104 */ -#pragma push -#pragma force_active on -static u8 lit_5104[12]; -#pragma pop +dBgS_WtrChk daObjBm_c::Bgc_c::M_wrt_work; /* 80BB4794-80BB51A4 0008B4 0A10+00 2/3 0/0 0/0 .bss M_wall_work__Q29daObjBm_c5Bgc_c */ -u8 daObjBm_c::Bgc_c::M_wall_work[2576]; +dBgS_ObjLinChk daObjBm_c::Bgc_c::M_wall_work[23]; /* 80BB0ED4-80BB1154 002C54 0280+00 1/1 0/0 0/0 .text * wall_pos__Q29daObjBm_c5Bgc_cFPC10fopAc_ac_cPCQ29daObjBm_c8BgcSrc_cisf */ -void daObjBm_c::Bgc_c::wall_pos(fopAc_ac_c const* param_0, daObjBm_c::BgcSrc_c const* param_1, - int param_2, s16 param_3, f32 param_4) { - // NONMATCHING -} +// NONMATCHING - copied from d_a_obj_movebox +void daObjBm_c::Bgc_c::wall_pos(fopAc_ac_c const* i_actor, daObjBm_c::BgcSrc_c const* i_bgcSrc, + int i_num, s16 param_3, f32 param_4) { + const s16 sp8C = i_actor->home.angle.y + param_3; -/* ############################################################################################## */ -/* 80BB3A18-80BB3A1C 000260 0004+00 1/1 0/0 0/0 .rodata @5242 */ -SECTION_RODATA static f32 const lit_5242 = 76.0f; -COMPILER_STRIP_GATE(0x80BB3A18, &lit_5242); + cXyz sp48; + cXyz sp54; + cXyz sp60; + cXyz sp6C; + cXyz sp78; + + field_0x178 = -1; + field_0x17c = FLT_MAX; + + mDoMtx_stack_c::YrotS(sp8C); + mDoMtx_stack_c::XrotM(0x4000); + mDoMtx_stack_c::multVec(&cXyz::BaseY, &sp6C); + sp6C *= param_4 + 100.0f; + + for (int i = 0; i < i_num; i++, i_bgcSrc++) { + mDoMtx_stack_c::XrotS(0x4000); + sp78.set(i_bgcSrc->field_0xc, 0.0f, i_bgcSrc->field_0x8); + mDoMtx_stack_c::multVec(&sp78, &sp60); + + mDoMtx_stack_c::YrotS(sp8C); + mDoMtx_stack_c::transM(sp60); + mDoMtx_stack_c::scaleM(200.0f, 400.0f, 200.0f); + mDoMtx_stack_c::transM(0.0f, 0.5f, 0.0f); + mDoMtx_stack_c::XrotM(0x4000); + + sp78.set(i_bgcSrc->field_0x4, 0.0f, i_bgcSrc->field_0x0); + mDoMtx_stack_c::multVec(&sp78, &sp48); + sp48 += i_actor->current.pos; + sp54 = sp48 + sp6C; + + M_wall_work[i].Set(&sp48, &sp54, i_actor); + M_wall_work[i].SetActorPid(i_actor->base.id); + + if (dComIfG_Bgsp().LineCross(&M_wall_work[i])) { + field_0x64[i] = M_wall_work[i].GetCross(); + + f32 var_f31 = sp48.abs2(field_0x64[i]); + if (var_f31 < field_0x17c) { + field_0x17c = var_f31; + field_0x178 = i; + } + } else { + field_0x64[i] = cXyz::Zero; + } + } +} /* 80BB1154-80BB1194 002ED4 0040+00 2/2 0/0 0/0 .text * chk_wall_pre__Q29daObjBm_c5Bgc_cFPC10fopAc_ac_cPCQ29daObjBm_c8BgcSrc_cis */ -void daObjBm_c::Bgc_c::chk_wall_pre(fopAc_ac_c const* param_0, - daObjBm_c::BgcSrc_c const* param_1, int param_2, - s16 param_3) { - // NONMATCHING +bool daObjBm_c::Bgc_c::chk_wall_pre(fopAc_ac_c const* i_actor, daObjBm_c::BgcSrc_c const* i_bgcSrc, + int i_num, s16 param_3) { + wall_pos(i_actor, i_bgcSrc, i_num, param_3, 76.0f); + return field_0x178 >= 0; } /* 80BB1194-80BB11D4 002F14 0040+00 1/1 0/0 0/0 .text initActionSwWait__9daObjBm_cFv */ void daObjBm_c::initActionSwWait() { - // NONMATCHING + field_0xfaa = 0; + field_0xfac = 0; + field_0xfae = field_0xfaa; + field_0xfae = field_0xfac; + mpBrkAnm->setPlaySpeed(0.0f); + mpBckAnm->setPlaySpeed(0.0f); + field_0xfea = 0; + field_0xfe4 = 0; } /* 80BB11D4-80BB14C8 002F54 02F4+00 1/0 0/0 0/0 .text actionSwWait__9daObjBm_cFv */ void daObjBm_c::actionSwWait() { - // NONMATCHING + cXyz i_sePos; + switch (field_0xfea) { + case 0: + if (fopAcM_isSwitch(this, getSwNo())) { + mpBrkAnm->init(mpModel->getModelData(), + (J3DAnmTevRegKey*)dComIfG_getObjectRes(l_arcName, 0x15), 1, 0, 1.0f, 0, + -1); + i_sePos = home.pos; + i_sePos.y += 200.0f; + mDoAud_seStart(Z2SE_EN_BM_BOOT, &i_sePos, 0, + dComIfGp_getReverb(fopAcM_GetRoomNo(this))); + field_0xff7 = 1; + field_0xfea = 1; + } + break; + + case 1: + if (mpBrkAnm->isStop()) { + field_0xfe5 = 0; + field_0xfea = 2; + } + break; + + case 2: + if (cLib_calcTimer(&field_0xfe5) == 0) { + mpBtkAnm->init(mpModel2->getModelData(), + (J3DAnmTextureSRTKey*)dComIfG_getObjectRes(l_arcName, 0x19), 1, 0, 0.0f, + 0, -1); + mpBtkAnm2->setPlaySpeed(0.0f); + mpBrkAnm->init(mpModel->getModelData(), + (J3DAnmTevRegKey*)dComIfG_getObjectRes(l_arcName, 0x14), 1, 2, 1.0f, 0, + -1); + mpBckAnm->init((J3DAnmTransform*)dComIfG_getObjectRes(l_arcName, 7), 1, 0, 1.0f, 0, -1, + true); + fopAcM_seStart(this, Z2SE_EN_BM_UP, 0); + field_0x1008 = 20; + initActionWarning(); + } + break; + } } /* 80BB14C8-80BB154C 003248 0084+00 3/3 0/0 0/0 .text initActionWarning__9daObjBm_cFv */ void daObjBm_c::initActionWarning() { - // NONMATCHING + if (field_0x102c) { + field_0x102c->becomeInvalidEmitter(); + field_0x102c->quitImmortalEmitter(); + field_0x102c = NULL; + } + + if (field_0x1030) { + field_0x1030->becomeInvalidEmitter(); + field_0x1030->quitImmortalEmitter(); + field_0x1030 = NULL; + } + + field_0xfea = 0; + field_0xfe4 = 1; } /* 80BB154C-80BB1654 0032CC 0108+00 1/0 0/0 0/0 .text actionWarning__9daObjBm_cFv */ void daObjBm_c::actionWarning() { - // NONMATCHING +#if DEBUG + field_0xfac = l_HIO.mPatrolRotationSpeed; +#else + field_0xfac = 500; +#endif + + switch (field_0xfea) { + case 0: + field_0xfea = 1; + break; + + case 1: + if (cLib_calcTimer(&field_0x1008) == 0) { + field_0xfe7 = checkFindPlayer(); + if (field_0xfe7 != -1 && field_0xfe8 == 0) { + field_0xfe5 = 0; + initActionFindPlayer(); + } + } + break; + } + + field_0xfb0 = field_0xfac + 100; + + if (field_0xfea != 5) { + field_0xf98 = field_0xf96 + field_0xfaa; + } + + field_0xf9c = field_0xf9a - field_0xfae; + field_0xfa0 = field_0xf9e + field_0xfae; + field_0xfa4 = field_0xfa2 + field_0xfae; + field_0xfa8 = field_0xfa6 + field_0xfae; } /* 80BB1654-80BB1814 0033D4 01C0+00 1/1 0/0 0/0 .text initActionFindPlayer__9daObjBm_cFv */ void daObjBm_c::initActionFindPlayer() { - // NONMATCHING + mpBrkAnm->init(mpModel->getModelData(), (J3DAnmTevRegKey*)dComIfG_getObjectRes(l_arcName, 0x13), + 1, 0, 1.0f, 0, -1); + field_0x1034 = dComIfGp_particle_set(dPa_RM(ID_ZF_S_BM_NESSENHEAT), ¤t.pos, 0, 0, 0xff, 0, + -1, 0, 0, 0); + field_0x1038 = -1; + fopAcM_seStart(this, Z2SE_EN_BM_FIND, 0); + fopAcM_seStart(this, Z2SE_EN_BM_HEAT, 0); + field_0xfe5 = 0; + field_0xfea = 0; +#if DEBUG + field_0xfac = l_HIO.mSearchSpeedOnDetection; +#else + field_0xfac = 1000; +#endif + field_0xfaa = field_0xfac; + field_0xfb0 = field_0xfac; + field_0xfe4 = 2; } /* 80BB1814-80BB1960 003594 014C+00 1/0 0/0 0/0 .text actionFindPlayer__9daObjBm_cFv */ void daObjBm_c::actionFindPlayer() { - // NONMATCHING + switch (field_0xfea) { + case 0: + field_0xf98 = fopAcM_searchPlayerAngleY(this) - home.angle.y; + field_0xf9c = field_0xf9a - field_0xfae; + field_0xfa0 = field_0xf9e + field_0xfae; + field_0xfa4 = field_0xfa2 + field_0xfae; + field_0xfa8 = field_0xfa6 + field_0xfae; + + if ((s16)abs((s16)(fopAcM_searchPlayerAngleY(this) - field_0xf96 - home.angle.y)) < + KREG_S(4) + 2000) + { + field_0xfea = 1; + } + break; + case 1: + field_0xf98 = field_0xf96; + field_0xfac = 0; + field_0xfaa = 0; + field_0x1000 = KREG_F(10) + 300.0f; + field_0xfea = 2; + break; + case 2: + field_0xf98 = field_0xf96; + field_0xfac = 0; + field_0xfaa = 0; + + if (field_0x1000 == 0.0f) { + field_0xfe5 = 0; + initActionAttack(); + } + } } -/* ############################################################################################## */ -/* 80BB3A1C-80BB3A20 000264 0004+00 0/0 0/0 0/0 .rodata @5299 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5299 = 110.0f; -COMPILER_STRIP_GATE(0x80BB3A1C, &lit_5299); -#pragma pop - -/* 80BB3A20-80BB3A24 000268 0004+00 0/1 0/0 0/0 .rodata l_eff_id$5506 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const l_eff_id_5506[4] = { - 0x84, - 0x67, - 0x84, - 0x68, -}; -COMPILER_STRIP_GATE(0x80BB3A20, &l_eff_id_5506); -#pragma pop - -/* 80BB3A24-80BB3A28 00026C 0004+00 0/1 0/0 0/0 .rodata @5564 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5564 = 6.5f; -COMPILER_STRIP_GATE(0x80BB3A24, &lit_5564); -#pragma pop - -/* 80BB3A28-80BB3A2C 000270 0004+00 0/1 0/0 0/0 .rodata @5565 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5565 = 32.0f; -COMPILER_STRIP_GATE(0x80BB3A28, &lit_5565); -#pragma pop - /* 80BB1960-80BB1BD0 0036E0 0270+00 1/1 0/0 0/0 .text initActionAttack__9daObjBm_cFv */ void daObjBm_c::initActionAttack() { - // NONMATCHING + static u16 const l_eff_id[2] = { + dPa_RM(ID_ZF_S_BM_NESSENSRC00), + dPa_RM(ID_ZF_S_BM_NESSENSRC01), + }; + + f32 dist = fopAcM_searchPlayerDistanceXZ(this); + field_0x1004 = dist; // debug diff here + daPy_py_c* player = daPy_getPlayerActorClass(); + + mpBtkAnm->init(mpModel2->getModelData(), + (J3DAnmTextureSRTKey*)dComIfG_getObjectRes(l_arcName, 0x19), 1, 0, 1.0f, 0, -1); + mpBtkAnm2->setPlaySpeed(1.0f); + + field_0xfe5 = 0x14; + field_0xfe6 = 0; // debug diff here + + if (field_0x102c == NULL) + field_0x102c = dComIfGp_particle_set(dPa_RM(ID_ZF_S_BM_GEARSPARK), ¤t.pos, NULL, NULL, + 0xff, NULL, -1, NULL, NULL, NULL); + + if (field_0x1030 == NULL) + field_0x1030 = dComIfGp_particle_set(dPa_RM(ID_ZF_S_BM_GEARROCK), ¤t.pos, NULL, NULL, + 0xff, NULL, -1, NULL, NULL, NULL); + + if (field_0x102c != NULL) { + field_0x102c->setRateStep(9); + field_0x102c->setLifeTime(6); + field_0x102c->setRate(6.5f); + } + + if (field_0x1030 != NULL) { + field_0x1030->setRateStep(2); + field_0x1030->setAwayFromCenterSpeed(32.0f); + } + + for (int i = 0; i < 2; i++) { + csXyz cStack_20(0, 0, 0); + cStack_20.y = home.angle.y + field_0xf96; + field_0x1018[i] = dComIfGp_particle_set(l_eff_id[i], &field_0xfb8, &cStack_20, NULL, 0xff, + NULL, -1, NULL, NULL, NULL); + } + + field_0xfed = 0; + field_0xfea = 0; + field_0xfe4 = 3; } -/* ############################################################################################## */ -/* 80BB3A2C-80BB3A30 000274 0004+00 0/1 0/0 0/0 .rodata l_eff_id$5631 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const l_eff_id_5631[4] = { - 0x84, - 0x62, - 0x84, - 0x63, -}; -COMPILER_STRIP_GATE(0x80BB3A2C, &l_eff_id_5631); -#pragma pop - -/* 80BB3A30-80BB3A38 000278 0006+02 0/1 0/0 0/0 .rodata l_eff_id2$5639 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const l_eff_id2[6 + 2 /* padding */] = { - 0x84, - 0x65, - 0x84, - 0x66, - 0x84, - 0x6B, - /* padding */ - 0x00, - 0x00, -}; -COMPILER_STRIP_GATE(0x80BB3A30, &l_eff_id2); -#pragma pop - -/* 80BB3A38-80BB3A3C 000280 0004+00 0/1 0/0 0/0 .rodata @5875 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5875 = 15.0f; -COMPILER_STRIP_GATE(0x80BB3A38, &lit_5875); -#pragma pop - -/* 80BB3A3C-80BB3A40 000284 0004+00 0/1 0/0 0/0 .rodata @5876 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5876 = 2.0f; -COMPILER_STRIP_GATE(0x80BB3A3C, &lit_5876); -#pragma pop - /* 80BB1BD0-80BB248C 003950 08BC+00 1/0 0/0 0/0 .text actionAttack__9daObjBm_cFv */ void daObjBm_c::actionAttack() { - // NONMATCHING + static u16 const l_eff_id[2] = { + dPa_RM(ID_ZF_S_BM_NESSENBURN00), + dPa_RM(ID_ZF_S_BM_NESSENBURN01), + }; + + static u16 const l_eff_id2[3] = { + dPa_RM(ID_ZF_S_BM_NESSENSPLASH00), + dPa_RM(ID_ZF_S_BM_NESSENSPLASH01), + dPa_RM(ID_ZF_S_BM_NESSENSPLASH02), + }; + + f32 dVar17 = fopAcM_searchPlayerDistanceXZ(this); + f32 dVar18 = getBeamSearchDistance(); + + if (dVar17 > dVar18) { + dVar17 = getBeamSearchDistance(); + } + + bool bVar4 = true; + + if (checkSearchPlayer() == -1 && cLib_calcTimer(&field_0xfe5) == 0 || field_0xfe8 != 0) { + bVar4 = false; + } + + switch (field_0xfea) { + case 0: + if (cLib_calcTimer(&field_0xfe6) == 0) { + field_0xfea = 2; + } + break; + case 1: + field_0xfac = 200 - KREG_S(0); // debug diff here + field_0xf98 = fopAcM_searchPlayerAngleY(this) - home.angle.y; + cLib_chaseF(&field_0x1004, dVar17, KREG_F(16) + 5.0f); + + if (!bVar4) { + field_0xfea = 3; + } + + if (cLib_calcTimer(&field_0xfec) == 0) { + field_0xfea = 2; + } + break; + case 2: + field_0xfac = 0x1c2; // debug diff here + field_0xf98 = fopAcM_searchPlayerAngleY(this) - home.angle.y; + cLib_chaseF(&field_0x1004, dVar17, KREG_F(16) + 15.0f); + + if (!bVar4) { + field_0xfea = 0x3; + } + break; + case 3: + mpBtkAnm->init(mpModel2->getModelData(), + (J3DAnmTextureSRTKey*)dComIfG_getObjectRes(l_arcName, 0x1a), 1, 0, 1.0f, 0, + -1); + mpBrkAnm->init(mpModel->getModelData(), + (J3DAnmTevRegKey*)dComIfG_getObjectRes(l_arcName, 0x14), 1, 2, 1.0f, 0, -1); + field_0x1038 = 0x14; + + if (field_0x1034 != NULL) { + field_0x1034->becomeInvalidEmitter(); + field_0x1034->quitImmortalEmitter(); + field_0x1034 = NULL; + } + + for (int i = 0; i < 2; i++) { + if (field_0x1018[i] != NULL) { + field_0x1018[i]->becomeInvalidEmitter(); + field_0x1018[i]->quitImmortalEmitter(); + field_0x1018[i] = NULL; + } + } + + field_0xfea = 4; + break; + case 4: + if (mpBtkAnm->isStop()) { + for (int i = 0; i < 2; i++) { + if (field_0x1010[i] != NULL) { + field_0x1010[i]->becomeInvalidEmitter(); + field_0x1010[i]->quitImmortalEmitter(); + field_0x1010[i] = NULL; + } + } + + for (int i = 0; i < 3; i++) { + if (field_0x1020[i] != NULL) { + field_0x1020[i]->becomeInvalidEmitter(); + field_0x1020[i]->quitImmortalEmitter(); + field_0x1020[i] = NULL; + } + } + + initActionWarning(); + } + } + + for (int i = 0; i < 2; i++) { // local_a4 + csXyz cStack_8c(0, 0, 0); + cStack_8c.y = home.angle.y + field_0xf96; + mDoMtx_stack_c::transS(field_0xfb8); + mDoMtx_stack_c::YrotM(cStack_8c.y); + + if (field_0x1018[i] != 0) { + field_0x1018[i]->setGlobalRTMatrix(mDoMtx_stack_c::get()); + } + } + + field_0x1054 = home.pos; + cXyz cStack60 = field_0xfcc - field_0xfb8; + cXyz cStack_6c(field_0xfb8); + cStack60.normalizeZP(); + cStack_6c += cStack60 * 1200.0f; + + if (fopAcM_lc_c::lineCheck(&field_0xfb8, &cStack_6c, this) && fopAcM_lc_c::checkGroundHit()) { + if (field_0xfed == 0) { + for (int i = 0; i < 2; i++) { + if (field_0x1010[i] == NULL) { + field_0x1010[i] = + dComIfGp_particle_set(l_eff_id[i], fopAcM_lc_c::getCrossP(), NULL, NULL, + 0xff, NULL, -1, NULL, NULL, NULL); + } + } + + for (int i = 0; i < 3; i++) { + if (field_0x1020[i] == NULL) { + field_0x1020[i] = + dComIfGp_particle_set(l_eff_id2[i], fopAcM_lc_c::getCrossP(), NULL, NULL, + 0xff, NULL, -1, NULL, NULL, NULL); + } + } + + field_0xfed = 1; + } else { + cXyz* pfVar7 = fopAcM_lc_c::getCrossP(); + f32 fVar2 = pfVar7->z; + pfVar7 = fopAcM_lc_c::getCrossP(); + f32 fVar3 = pfVar7->y; + cXyz* pfVar9 = fopAcM_lc_c::getCrossP(); + mDoMtx_stack_c::transS(pfVar9->x, fVar3 + 2.0f, fVar2); + cM3dGPla cStack_54; + csXyz local_94; + + if (fopAcM_lc_c::checkGroundHit() && fopAcM_lc_c::getTriPla(&cStack_54)) { + cM3d_CalcVecAngle(cStack_54.mNormal, &local_94.x, &local_94.z); + mDoMtx_stack_c::XYZrotM(local_94.x, 0, local_94.z); + } + + for (int i = 0; i < 2; i++) { + if (field_0x1010[i] != NULL) { + field_0x1010[i]->setGlobalRTMatrix(mDoMtx_stack_c::get()); + } + } + + for (int i = 0; i < 3; i++) { + if (field_0x1020[i] != NULL) { + field_0x1020[i]->setGlobalRTMatrix(mDoMtx_stack_c::get()); + } + } + + field_0x1054 = fopAcM_lc_c::getCross(); + field_0x1054.y += 2.0f; + } + } + + if (field_0x1054 != home.pos) { + mSound2.startLevelSound(Z2SE_EN_BM_BURN, 0, -1); + } + + if (mpBrkAnm->isStop()) { + mpBrkAnm->init(mpModel->getModelData(), + (J3DAnmTevRegKey*)dComIfG_getObjectRes(l_arcName, 0x12), 1, 2, 1.0f, 0, -1); + } + + field_0xfb0 = field_0xfac * 3; + field_0xf9c = field_0xf9a - field_0xfae; + field_0xfa0 = field_0xf9e + field_0xfae; + field_0xfa4 = field_0xfa2 + field_0xfae; + field_0xfa8 = field_0xfa6 + field_0xfae; + + if (checkLockOnCamera() == 0) { + dCam_getBody()->ForceLockOn(this); + } } /* 80BB248C-80BB2700 00420C 0274+00 1/1 0/0 0/0 .text initActionDead__9daObjBm_cFv */ void daObjBm_c::initActionDead() { - // NONMATCHING + if (field_0xf96 > -0x4000 && field_0xf96 < 0x4000) { + field_0xf98 = 0; + } else { + field_0xf98 = 0x7FFF; + } + + field_0xfaa = 0; + field_0xfac = 0; + + mpBckAnm->init((J3DAnmTransform*)dComIfG_getObjectRes(l_arcName, 10), 1, 0, 0.0f, 0, -1, true); + if (mpBtkAnm->getBtkAnm() == (J3DAnmTextureSRTKey*)dComIfG_getObjectRes(l_arcName, 0x19)) { + mpBtkAnm->init(mpModel2->getModelData(), + (J3DAnmTextureSRTKey*)dComIfG_getObjectRes(l_arcName, 0x1a), 1, 0, 1.0f, 0, + -1); + } + + field_0x1038 = 0x14; + + for (int i = 0; i < 2; i++) { + if (field_0x1018[i] != NULL) { + field_0x1018[i]->becomeInvalidEmitter(); + field_0x1018[i]->quitImmortalEmitter(); + field_0x1018[i] = NULL; + } + + if (field_0x1010[i] != NULL) { + field_0x1010[i]->becomeInvalidEmitter(); + field_0x1010[i]->quitImmortalEmitter(); + field_0x1010[i] = NULL; + } + } + + for (int i = 0; i < 3; i++) { + if (field_0x1020[i] != NULL) { + field_0x1020[i]->becomeInvalidEmitter(); + field_0x1020[i]->quitImmortalEmitter(); + field_0x1020[i] = NULL; + } + } + + if (field_0x1034 != NULL) { + field_0x1034->becomeInvalidEmitter(); + field_0x1034->quitImmortalEmitter(); + field_0x1034 = NULL; + } + + field_0xfe5 = 20; + field_0xfe9 = 0; + field_0xff7 = 0; + fopAcM_OffStatus(this, 0); + field_0xfea = 0; + field_0xfe4 = 4; } /* 80BB2700-80BB2AB0 004480 03B0+00 2/0 0/0 0/0 .text actionDead__9daObjBm_cFv */ void daObjBm_c::actionDead() { - // NONMATCHING + switch (field_0xfea) { + case 0: + if (!cLib_calcTimer(&field_0xfe5)) { + field_0xfea = 1; + } + break; + + case 1: + field_0xfac = 500; + if (field_0x102c != NULL) { + field_0x102c->becomeInvalidEmitter(); + field_0x102c->quitImmortalEmitter(); + field_0x102c = NULL; + } + + if (field_0x1030 != NULL) { + field_0x1030->becomeInvalidEmitter(); + field_0x1030->quitImmortalEmitter(); + field_0x1030 = NULL; + } + + field_0xfea = 2; + break; + + case 2: + cLib_addCalcAngleS(&field_0xfac, 0, 0x5A, 10, 5); + if (field_0xf96 == field_0xf98) { + field_0xfac = 0; + field_0x1000 = 200.0f; + field_0xfea = 3; + fopAcM_seStart(this, Z2SE_EN_BM_TURN_END, 0); + } + break; + + case 3: + field_0xfe5 = 20; + field_0xfea = 4; + break; + + case 4: + if (!cLib_calcTimer(&field_0xfe5)) { + mpBckAnm->setPlaySpeed(1.0f); + dComIfGp_particle_set(dPa_RM(ID_ZF_S_BM_SMOKE), ¤t.pos, NULL, NULL, 0xff, NULL, + -1, NULL, NULL, NULL); + field_0xfea = 5; + } + break; + + case 5: + if (mpBckAnm->isStop()) { + field_0xfe5 = 10; + fopAcM_seStart(this, Z2SE_EN_BM_DOWN, 0); + field_0xfea = 6; + fopAcM_seStart(this, Z2SE_EN_BM_UNLOCK, 0); + } + break; + + case 6: + if (getMoveType() == 1) { + initActionObjBemos(); + } else { + if (cLib_calcTimer(&field_0xfe5) == 0) { + mpBckAnm3->setPlaySpeed(1.0f); + + if (mpBckAnm3->isStop()) { + field_0xfea = 7; + } + } + } + + break; + case 7: + initActionObjBemos(); + } + + field_0xfb0 = field_0xfac; + field_0xf9c = field_0xf9a - field_0xfae; + field_0xfa0 = field_0xf9e + field_0xfae; + field_0xfa4 = field_0xfa2 + field_0xfae; + field_0xfa8 = field_0xfa6 + field_0xfae; } /* 80BB2AB0-80BB2C8C 004830 01DC+00 1/0 0/0 0/0 .text Draw__9daObjBm_cFv */ int daObjBm_c::Draw() { - // NONMATCHING + g_env_light.settingTevStruct(0x10, ¤t.pos, &tevStr); + g_env_light.setLightTevColorType_MAJI(mpModel, &tevStr); + dComIfGd_setListBG(); + + J3DShape* shape = mpMaterial->getShape(); + if (field_0xff7 == 0) { + shape->hide(); + } + + mpBrkAnm->entry(mpModel->getModelData()); + mpBckAnm->entry(mpModel->getModelData()); + mDoExt_modelUpdateDL(mpModel); + mDoExt_brkAnmRemove(mpModel->getModelData()); + mDoExt_bckAnmRemove(mpModel->getModelData()); + shape->show(); + dComIfGd_setList(); + g_env_light.setLightTevColorType_MAJI(mpModel2, &tevStr); + + mpBtkAnm2->entry(mpModel2->getModelData()); + mpBtkAnm->entry(mpModel2->getModelData()); + mpBckAnm2->entry(mpModel2->getModelData()); + mDoExt_modelUpdateDL(mpModel2); + mDoExt_btkAnmRemove(mpModel2->getModelData()); + mDoExt_bckAnmRemove(mpModel2->getModelData()); + + g_env_light.setLightTevColorType_MAJI(mpModel3, &tevStr); + mpBckAnm3->entry(mpModel3->getModelData()); + mDoExt_modelUpdateDL(mpModel3); + +#if DEBUG + debugDraw(); +#endif + + return 1; } +#ifdef DEBUG +void daObjBm_c::debugDraw() { + if (l_HIO.mDebugDraw) { + GXColor local_4c = { + 0xff, + 0, + 0, + 0x80, + }; + + GXColor local_50 = { + 0xff, + 0xff, + 0xff, + 0x80, + }; + + cXyz* pVVar2 = mCps.GetAtVecP(); + + if (pVVar2 != NULL) { + cXyz cStack_24 = mCps.GetStart(); + cXyz cStack_30 = mCps.GetStart(); + cStack_30 += *pVVar2; + dDbVw_drawArrowXlu(cStack_24, cStack_30, local_4c, 1, 0xc); + } + + cXyz cStack_3c(current.pos); + cStack_3c.y += 50.0f; + + dDbVw_drawCircleXlu(cStack_3c, getSearchDistance(), local_4c, 1, 0xc); + dDbVw_drawCircleXlu(cStack_3c, getBeamSearchDistance(), local_50, 1, 0xc); + dDbVw_drawCircleXlu(cStack_3c, l_HIO.mBeamMiddleDistance, local_4c, 1, 0xc); + dDbVw_drawCircleXlu(cStack_3c, l_HIO.mBeamLowerDistance, local_4c, 1, 0xc); + + GXColor local_54 = { + 0, + 0, + 0xff, + 0xff, + }; + + local_4c = local_54; + cXyz cStack_48; + + cStack_48.set(0.0f, 10.0f, getSearchDistance()); + + s16 sVar1 = l_HIO.mSearchAngle / 2; + mDoMtx_stack_c::YrotS((home.angle.y + field_0xf96) + sVar1); + mDoMtx_stack_c::multVec(&cStack_48, &cStack_48); + cStack_48 += cStack_3c; + dDbVw_drawLineOpa(cStack_3c, cStack_48, local_4c, 1, 0xc); + cStack_48.set(0.0f, 10.0f, getSearchDistance()); + + mDoMtx_stack_c::YrotS((home.angle.y + field_0xf96) - sVar1); + mDoMtx_stack_c::multVec(&cStack_48, &cStack_48); + cStack_48 += cStack_3c; + dDbVw_drawLineOpa(cStack_3c, cStack_48, local_4c, 1, 0xc); + + GXColor local_58 = { + 0, + 0xff, + 0xff, + 0xff, + }; + + local_4c = local_58; + cStack_48.set(0.0f, 10.0f, getSearchDistance()); + + sVar1 = l_HIO.mDetectionAngle / 2; + mDoMtx_stack_c::YrotS((home.angle.y + field_0xf96) + sVar1); + mDoMtx_stack_c::multVec(&cStack_48, &cStack_48); + cStack_48 += cStack_3c; + dDbVw_drawLineOpa(cStack_3c, cStack_48, local_4c, 1, 0xc); + + cStack_48.set(0.0f, 10.0f, getSearchDistance()); + mDoMtx_stack_c::YrotS((home.angle.y + field_0xf96) - sVar1); + mDoMtx_stack_c::multVec(&cStack_48, &cStack_48); + cStack_48 += cStack_3c; + dDbVw_drawLineOpa(cStack_3c, cStack_48, local_4c, 1, 0xc); + + GXColor local_5c = { + 0xff, + 0xff, + 0xff, + 0xff, + }; + + dDbVw_drawSphereOpa(field_0xfcc, 0.0f, local_5c, 1); + } + + if (l_HIO.mCheckDraw) { + mpBgW->CalcPlane(); + } +} +#endif + /* 80BB2C8C-80BB2EB8 004A0C 022C+00 1/0 0/0 0/0 .text Delete__9daObjBm_cFv */ int daObjBm_c::Delete() { - // NONMATCHING -} + for (int i = 0; i < 2; i++) { + if (field_0xff8[i]) { + field_0xff8[i]->becomeInvalidEmitter(); + field_0xff8[i]->quitImmortalEmitter(); + field_0xff8[i] = NULL; + } + } -/* ############################################################################################## */ -/* 80BB3E58-80BB3E80 0003E4 0028+00 1/1 0/0 0/0 .data __vt__9daObjBm_c */ -SECTION_DATA extern void* __vt__9daObjBm_c[10] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)CreateHeap__9daObjBm_cFv, - (void*)Create__9daObjBm_cFv, - (void*)Execute__9daObjBm_cFPPA3_A4_f, - (void*)Draw__9daObjBm_cFv, - (void*)Delete__9daObjBm_cFv, - (void*)IsDelete__16dBgS_MoveBgActorFv, - (void*)ToFore__16dBgS_MoveBgActorFv, - (void*)ToBack__16dBgS_MoveBgActorFv, -}; + if (field_0x102c) { + field_0x102c->becomeInvalidEmitter(); + field_0x102c->quitImmortalEmitter(); + field_0x102c = NULL; + } + + if (field_0x1030) { + field_0x1030->becomeInvalidEmitter(); + field_0x1030->quitImmortalEmitter(); + field_0x1030 = NULL; + } + + if (field_0x1034) { + field_0x1034->becomeInvalidEmitter(); + field_0x1034->quitImmortalEmitter(); + field_0x1034 = NULL; + } + + for (int i = 0; i < 2; i++) { + if (field_0x1010[i]) { + field_0x1010[i]->becomeInvalidEmitter(); + field_0x1010[i]->quitImmortalEmitter(); + field_0x1010[i] = NULL; + } + + if (field_0x1018[i]) { + field_0x1018[i]->becomeInvalidEmitter(); + field_0x1018[i]->quitImmortalEmitter(); + field_0x1018[i] = NULL; + } + } + + for (int i = 0; i < 3; i++) { + if (field_0x1020[i]) { + field_0x1020[i]->becomeInvalidEmitter(); + field_0x1020[i]->quitImmortalEmitter(); + field_0x1020[i] = NULL; + } + } + + mpBgW->SetPushPullCallback(NULL); + mSound.deleteObject(); + mSound2.deleteObject(); + dComIfG_resDelete(&mPhase, l_arcName); +#if DEBUG + l_HIO.removeHIO(); +#endif + return 1; +} /* 80BB2EB8-80BB3078 004C38 01C0+00 1/0 0/0 0/0 .text daObjBm_create1st__FP9daObjBm_c */ -static void daObjBm_create1st(daObjBm_c* param_0) { - // NONMATCHING -} - -/* 80BB3078-80BB3144 004DF8 00CC+00 1/1 0/0 0/0 .text __dt__8dCcD_CylFv */ -// dCcD_Cyl::~dCcD_Cyl() { -extern "C" void __dt__8dCcD_CylFv() { - // NONMATCHING -} - -/* 80BB3144-80BB31C8 004EC4 0084+00 1/1 0/0 0/0 .text __ct__8dCcD_CylFv */ -// dCcD_Cyl::dCcD_Cyl() { -extern "C" void __ct__8dCcD_CylFv() { - // NONMATCHING -} - -/* 80BB31C8-80BB3210 004F48 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGCylFv */ -// cM3dGCyl::~cM3dGCyl() { -extern "C" void __dt__8cM3dGCylFv() { - // NONMATCHING -} - -/* 80BB3210-80BB3258 004F90 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGSphFv */ -// cM3dGSph::~cM3dGSph() { -extern "C" void __dt__8cM3dGSphFv() { - // NONMATCHING -} - -/* 80BB3258-80BB32A0 004FD8 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGAabFv */ -// cM3dGAab::~cM3dGAab() { -extern "C" void __dt__8cM3dGAabFv() { - // NONMATCHING -} - -/* 80BB32A0-80BB32FC 005020 005C+00 1/0 0/0 0/0 .text __dt__10dCcD_GSttsFv */ -// dCcD_GStts::~dCcD_GStts() { -extern "C" void __dt__10dCcD_GSttsFv() { - // NONMATCHING -} - -/* 80BB32FC-80BB336C 00507C 0070+00 1/0 0/0 0/0 .text __dt__12dBgS_AcchCirFv */ -// dBgS_AcchCir::~dBgS_AcchCir() { -extern "C" void __dt__12dBgS_AcchCirFv() { - // NONMATCHING -} - -/* 80BB336C-80BB33DC 0050EC 0070+00 3/2 0/0 0/0 .text __dt__12dBgS_ObjAcchFv */ -// dBgS_ObjAcch::~dBgS_ObjAcch() { -extern "C" void __dt__12dBgS_ObjAcchFv() { - // NONMATCHING +static int daObjBm_create1st(daObjBm_c* i_this) { + fopAcM_SetupActor(i_this, daObjBm_c); + return i_this->create1st(); } /* 80BB33DC-80BB33FC 00515C 0020+00 1/0 0/0 0/0 .text daObjBm_MoveBGDelete__FP9daObjBm_c */ -static void daObjBm_MoveBGDelete(daObjBm_c* param_0) { - // NONMATCHING +static int daObjBm_MoveBGDelete(daObjBm_c* i_this) { + return i_this->MoveBGDelete(); } /* 80BB33FC-80BB341C 00517C 0020+00 1/0 0/0 0/0 .text daObjBm_MoveBGExecute__FP9daObjBm_c */ -static void daObjBm_MoveBGExecute(daObjBm_c* param_0) { - // NONMATCHING +static int daObjBm_MoveBGExecute(daObjBm_c* i_this) { + return i_this->MoveBGExecute(); } /* 80BB341C-80BB3448 00519C 002C+00 1/0 0/0 0/0 .text daObjBm_MoveBGDraw__FP9daObjBm_c */ -static void daObjBm_MoveBGDraw(daObjBm_c* param_0) { - // NONMATCHING +static int daObjBm_MoveBGDraw(daObjBm_c* i_this) { + return i_this->MoveBGDraw(); } -/* 80BB3448-80BB3490 0051C8 0048+00 1/0 0/0 0/0 .text __dt__10cCcD_GSttsFv */ -// cCcD_GStts::~cCcD_GStts() { -extern "C" void __dt__10cCcD_GSttsFv() { - // NONMATCHING -} - -/* 80BB3490-80BB34AC 005210 001C+00 1/1 0/0 0/0 .text cLib_calcTimer__FPUs */ -extern "C" void func_80BB3490(void* _this, u16* param_0) { - // NONMATCHING -} - -/* 80BB34AC-80BB34C8 00522C 001C+00 4/4 0/0 0/0 .text cLib_calcTimer__FPUc */ -extern "C" void func_80BB34AC(void* _this, u8* param_0) { - // NONMATCHING -} - -/* 80BB34C8-80BB35A8 005248 00E0+00 0/0 1/0 0/0 .text __sinit_d_a_obj_bemos_cpp */ -void __sinit_d_a_obj_bemos_cpp() { - // NONMATCHING -} - -#pragma push -#pragma force_active on -REGISTER_CTORS(0x80BB34C8, __sinit_d_a_obj_bemos_cpp); -#pragma pop - -/* 80BB35A8-80BB35E0 005328 0038+00 1/1 0/0 0/0 .text __arraydtor$5103 */ -void func_80BB35A8() { - // NONMATCHING -} - -/* ############################################################################################## */ -/* 80BB3E80-80BB3EB0 00040C 0030+00 2/2 0/0 0/0 .data __vt__14dBgS_ObjGndChk */ -SECTION_DATA extern void* __vt__14dBgS_ObjGndChk[12] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__14dBgS_ObjGndChkFv, - (void*)NULL, - (void*)NULL, - (void*)func_80BB377C, - (void*)NULL, - (void*)NULL, - (void*)func_80BB378C, - (void*)NULL, - (void*)NULL, - (void*)func_80BB3784, +/* 80BB3D84-80BB3DA4 -00001 0020+00 1/0 0/0 0/0 .data daObjBm_METHODS */ +static actor_method_class daObjBm_METHODS = { + (process_method_func)daObjBm_create1st, (process_method_func)daObjBm_MoveBGDelete, + (process_method_func)daObjBm_MoveBGExecute, 0, + (process_method_func)daObjBm_MoveBGDraw, }; -/* 80BB3EB0-80BB3EE0 00043C 0030+00 1/1 0/0 0/0 .data __vt__11dBgS_WtrChk */ -SECTION_DATA extern void* __vt__11dBgS_WtrChk[12] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__11dBgS_WtrChkFv, - (void*)NULL, - (void*)NULL, - (void*)func_80BB3764, - (void*)NULL, - (void*)NULL, - (void*)func_80BB3774, - (void*)NULL, - (void*)NULL, - (void*)func_80BB376C, +/* 80BB3DA4-80BB3DD4 -00001 0030+00 0/0 0/0 1/0 .data g_profile_Obj_Bemos */ +extern actor_process_profile_definition g_profile_Obj_Bemos = { + fpcLy_CURRENT_e, // mLayerID + 3, // mListID + fpcPi_CURRENT_e, // mListPrio + PROC_Obj_Bemos, // mProcName + &g_fpcLf_Method.base, // sub_method + sizeof(daObjBm_c), // mSize + 0, // mSizeOther + 0, // mParameters + &g_fopAc_Method.base, // sub_method + 604, // mPriority + &daObjBm_METHODS, // sub_method + 0x00040100, // mStatus + fopAc_ACTOR_e, // mActorType + fopAc_CULLBOX_CUSTOM_e, // cullType }; - -/* 80BB35E0-80BB3658 005360 0078+00 5/4 0/0 0/0 .text __dt__11dBgS_WtrChkFv */ -// dBgS_WtrChk::~dBgS_WtrChk() { -extern "C" void __dt__11dBgS_WtrChkFv() { - // NONMATCHING -} - -/* 80BB3658-80BB3690 0053D8 0038+00 1/1 0/0 0/0 .text __arraydtor$5100 */ -void func_80BB3658() { - // NONMATCHING -} - -/* 80BB3690-80BB3708 005410 0078+00 6/5 0/0 0/0 .text __dt__14dBgS_ObjGndChkFv */ -// dBgS_ObjGndChk::~dBgS_ObjGndChk() { -extern "C" void __dt__14dBgS_ObjGndChkFv() { - // NONMATCHING -} - -/* 80BB3708-80BB3764 005488 005C+00 1/1 0/0 0/0 .text __ct__14dBgS_ObjGndChkFv */ -// dBgS_ObjGndChk::dBgS_ObjGndChk() { -extern "C" void __ct__14dBgS_ObjGndChkFv() { - // NONMATCHING -} - -/* 80BB3764-80BB376C 0054E4 0008+00 1/0 0/0 0/0 .text @16@__dt__11dBgS_WtrChkFv */ -static void func_80BB3764() { - // NONMATCHING -} - -/* 80BB376C-80BB3774 0054EC 0008+00 1/0 0/0 0/0 .text @52@__dt__11dBgS_WtrChkFv */ -static void func_80BB376C() { - // NONMATCHING -} - -/* 80BB3774-80BB377C 0054F4 0008+00 1/0 0/0 0/0 .text @36@__dt__11dBgS_WtrChkFv */ -static void func_80BB3774() { - // NONMATCHING -} - -/* 80BB377C-80BB3784 0054FC 0008+00 1/0 0/0 0/0 .text @20@__dt__14dBgS_ObjGndChkFv */ -static void func_80BB377C() { - // NONMATCHING -} - -/* 80BB3784-80BB378C 005504 0008+00 1/0 0/0 0/0 .text @76@__dt__14dBgS_ObjGndChkFv */ -static void func_80BB3784() { - // NONMATCHING -} - -/* 80BB378C-80BB3794 00550C 0008+00 1/0 0/0 0/0 .text @60@__dt__14dBgS_ObjGndChkFv */ -static void func_80BB378C() { - // NONMATCHING -} - -/* 80BB3794-80BB379C 005514 0008+00 1/0 0/0 0/0 .text @36@__dt__12dBgS_ObjAcchFv */ -static void func_80BB3794() { - // NONMATCHING -} - -/* 80BB379C-80BB37A4 00551C 0008+00 1/0 0/0 0/0 .text @20@__dt__12dBgS_ObjAcchFv */ -static void func_80BB379C() { - // NONMATCHING -} - -/* ############################################################################################## */ -/* 80BB51A4-80BB51B4 0012C4 000C+04 0/0 0/0 0/0 .bss @5249 */ -#pragma push -#pragma force_active on -static u8 lit_5249[12 + 4 /* padding */]; -#pragma pop - -/* 80BB51B4-80BB5224 0012D4 0070+00 0/0 0/0 0/0 .bss touch_work$5248 */ -#pragma push -#pragma force_active on -static u8 touch_work[112]; -#pragma pop - -/* 80BB5224-80BB5228 001344 0004+00 0/0 0/0 0/0 .bss - * sInstance__40JASGlobalInstance<19JASDefaultBankTable> */ -#pragma push -#pragma force_active on -static u8 data_80BB5224[4]; -#pragma pop - -/* 80BB5228-80BB522C 001348 0004+00 0/0 0/0 0/0 .bss - * sInstance__35JASGlobalInstance<14JASAudioThread> */ -#pragma push -#pragma force_active on -static u8 data_80BB5228[4]; -#pragma pop - -/* 80BB522C-80BB5230 00134C 0004+00 0/0 0/0 0/0 .bss sInstance__27JASGlobalInstance<7Z2SeMgr> */ -#pragma push -#pragma force_active on -static u8 data_80BB522C[4]; -#pragma pop - -/* 80BB5230-80BB5234 001350 0004+00 0/0 0/0 0/0 .bss sInstance__28JASGlobalInstance<8Z2SeqMgr> */ -#pragma push -#pragma force_active on -static u8 data_80BB5230[4]; -#pragma pop - -/* 80BB5234-80BB5238 001354 0004+00 0/0 0/0 0/0 .bss sInstance__31JASGlobalInstance<10Z2SceneMgr> - */ -#pragma push -#pragma force_active on -static u8 data_80BB5234[4]; -#pragma pop - -/* 80BB5238-80BB523C 001358 0004+00 0/0 0/0 0/0 .bss sInstance__32JASGlobalInstance<11Z2StatusMgr> - */ -#pragma push -#pragma force_active on -static u8 data_80BB5238[4]; -#pragma pop - -/* 80BB523C-80BB5240 00135C 0004+00 0/0 0/0 0/0 .bss sInstance__31JASGlobalInstance<10Z2DebugSys> - */ -#pragma push -#pragma force_active on -static u8 data_80BB523C[4]; -#pragma pop - -/* 80BB5240-80BB5244 001360 0004+00 0/0 0/0 0/0 .bss - * sInstance__36JASGlobalInstance<15JAISoundStarter> */ -#pragma push -#pragma force_active on -static u8 data_80BB5240[4]; -#pragma pop - -/* 80BB5244-80BB5248 001364 0004+00 0/0 0/0 0/0 .bss - * sInstance__35JASGlobalInstance<14Z2SoundStarter> */ -#pragma push -#pragma force_active on -static u8 data_80BB5244[4]; -#pragma pop - -/* 80BB5248-80BB524C 001368 0004+00 0/0 0/0 0/0 .bss - * sInstance__33JASGlobalInstance<12Z2SpeechMgr2> */ -#pragma push -#pragma force_active on -static u8 data_80BB5248[4]; -#pragma pop - -/* 80BB524C-80BB5250 00136C 0004+00 0/0 0/0 0/0 .bss sInstance__28JASGlobalInstance<8JAISeMgr> */ -#pragma push -#pragma force_active on -static u8 data_80BB524C[4]; -#pragma pop - -/* 80BB5250-80BB5254 001370 0004+00 0/0 0/0 0/0 .bss sInstance__29JASGlobalInstance<9JAISeqMgr> */ -#pragma push -#pragma force_active on -static u8 data_80BB5250[4]; -#pragma pop - -/* 80BB5254-80BB5258 001374 0004+00 0/0 0/0 0/0 .bss - * sInstance__33JASGlobalInstance<12JAIStreamMgr> */ -#pragma push -#pragma force_active on -static u8 data_80BB5254[4]; -#pragma pop - -/* 80BB5258-80BB525C 001378 0004+00 0/0 0/0 0/0 .bss sInstance__31JASGlobalInstance<10Z2SoundMgr> - */ -#pragma push -#pragma force_active on -static u8 data_80BB5258[4]; -#pragma pop - -/* 80BB525C-80BB5260 00137C 0004+00 0/0 0/0 0/0 .bss - * sInstance__33JASGlobalInstance<12JAISoundInfo> */ -#pragma push -#pragma force_active on -static u8 data_80BB525C[4]; -#pragma pop - -/* 80BB5260-80BB5264 001380 0004+00 0/0 0/0 0/0 .bss - * sInstance__34JASGlobalInstance<13JAUSoundTable> */ -#pragma push -#pragma force_active on -static u8 data_80BB5260[4]; -#pragma pop - -/* 80BB5264-80BB5268 001384 0004+00 0/0 0/0 0/0 .bss - * sInstance__38JASGlobalInstance<17JAUSoundNameTable> */ -#pragma push -#pragma force_active on -static u8 data_80BB5264[4]; -#pragma pop - -/* 80BB5268-80BB526C 001388 0004+00 0/0 0/0 0/0 .bss - * sInstance__33JASGlobalInstance<12JAUSoundInfo> */ -#pragma push -#pragma force_active on -static u8 data_80BB5268[4]; -#pragma pop - -/* 80BB526C-80BB5270 00138C 0004+00 0/0 0/0 0/0 .bss sInstance__32JASGlobalInstance<11Z2SoundInfo> - */ -#pragma push -#pragma force_active on -static u8 data_80BB526C[4]; -#pragma pop - -/* 80BB5270-80BB5274 001390 0004+00 0/0 0/0 0/0 .bss - * sInstance__34JASGlobalInstance<13Z2SoundObjMgr> */ -#pragma push -#pragma force_active on -static u8 data_80BB5270[4]; -#pragma pop - -/* 80BB5274-80BB5278 001394 0004+00 0/0 0/0 0/0 .bss sInstance__31JASGlobalInstance<10Z2Audience> - */ -#pragma push -#pragma force_active on -static u8 data_80BB5274[4]; -#pragma pop - -/* 80BB5278-80BB527C 001398 0004+00 0/0 0/0 0/0 .bss sInstance__32JASGlobalInstance<11Z2FxLineMgr> - */ -#pragma push -#pragma force_active on -static u8 data_80BB5278[4]; -#pragma pop - -/* 80BB527C-80BB5280 00139C 0004+00 0/0 0/0 0/0 .bss sInstance__31JASGlobalInstance<10Z2EnvSeMgr> - */ -#pragma push -#pragma force_active on -static u8 data_80BB527C[4]; -#pragma pop - -/* 80BB5280-80BB5284 0013A0 0004+00 0/0 0/0 0/0 .bss sInstance__32JASGlobalInstance<11Z2SpeechMgr> - */ -#pragma push -#pragma force_active on -static u8 data_80BB5280[4]; -#pragma pop - -/* 80BB5284-80BB5288 0013A4 0004+00 0/0 0/0 0/0 .bss - * sInstance__34JASGlobalInstance<13Z2WolfHowlMgr> */ -#pragma push -#pragma force_active on -static u8 data_80BB5284[4]; -#pragma pop - -/* 80BB3A40-80BB3A40 000288 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ diff --git a/src/d/d_a_horse_static.cpp b/src/d/d_a_horse_static.cpp index 2740058c899..d4e2e7a3f45 100644 --- a/src/d/d_a_horse_static.cpp +++ b/src/d/d_a_horse_static.cpp @@ -16,13 +16,13 @@ BOOL e_wb_class::checkWait() { void e_wb_class::setPlayerRideNow() { mActionID = ACT_PL_RIDE_NOW; mActionMode = 0; - field_0x6be |= 3; + mStatusFlags |= 3; } void e_wb_class::setPlayerRide() { mActionID = ACT_PL_RIDE; mActionMode = 0; - field_0x6be |= 3; + mStatusFlags |= 3; mZ2Ride.setLinkRiding(true); } @@ -35,7 +35,7 @@ void e_wb_class::getOff() { } mActionMode = 0; - field_0x6be &= ~3; + mStatusFlags &= ~3; mZ2Ride.setLinkRiding(false); } diff --git a/src/m_Do/m_Do_mtx.cpp b/src/m_Do/m_Do_mtx.cpp index cc32bb0fdf1..6ec8f417581 100644 --- a/src/m_Do/m_Do_mtx.cpp +++ b/src/m_Do/m_Do_mtx.cpp @@ -152,6 +152,20 @@ void mDoMtx_XrotM(Mtx mtx, s16 x) { } /* 8000C3DC-8000C434 006D1C 0058+00 5/5 24/24 809/809 .text mDoMtx_YrotS__FPA4_fs */ +/** + * @brief Sets the given matrix to a rotation transformation around the Y-axis. + * + * This function constructs a 3x4 rotation matrix for rotating around the Y-axis by the specified angle. + * The matrix is filled directly with cosine and sine values computed from the angle. + * + * The resulting matrix layout is: + * - Row 0: cos(y), 0, sin(y), 0 + * - Row 1: 0, 1, 0, 0 + * - Row 2: -sin(y), 0, cos(y), 0 + * + * @param mtx The 3x4 matrix to modify (output parameter). + * @param y The rotation angle as a signed 16-bit integer. + */ void mDoMtx_YrotS(Mtx mtx, s16 y) { f32 l_cos = JMASCos(y); f32 l_sin = JMASSin(y);