From b83ff695890e4f971cec4661ce07308e95ceb925 Mon Sep 17 00:00:00 2001 From: hatal175 Date: Fri, 11 Jul 2025 11:11:21 +0300 Subject: [PATCH] Improve various partially matched TUs (#2526) --- config/GZ2E01/rels/d_a_obj_hfuta/symbols.txt | 3 +- config/GZ2E01/rels/d_a_obj_ice_s/symbols.txt | 2 +- .../rels/d_a_obj_lv4CandleDemoTag/symbols.txt | 5 +- config/GZ2J01/rels/d_a_obj_hfuta/symbols.txt | 3 +- config/GZ2J01/rels/d_a_obj_ice_s/symbols.txt | 2 +- .../rels/d_a_obj_lv4CandleDemoTag/symbols.txt | 5 +- config/GZ2P01/rels/d_a_obj_hfuta/symbols.txt | 3 +- config/GZ2P01/rels/d_a_obj_ice_s/symbols.txt | 2 +- .../rels/d_a_obj_lv4CandleDemoTag/symbols.txt | 5 +- .../RZDE01_00/rels/d_a_obj_ice_s/symbols.txt | 2 +- configure.py | 16 +- include/SSystem/SComponent/c_m3d_g_aab.h | 4 +- include/d/actor/d_a_obj_hbombkoya.h | 2 +- include/d/actor/d_a_obj_ice_s.h | 2 +- include/d/actor/d_a_obj_lp.h | 9 +- include/d/actor/d_a_obj_lv4CandleDemoTag.h | 5 +- include/d/actor/d_a_obj_rfHole.h | 3 +- src/d/actor/d_a_obj_hbombkoya.cpp | 240 +------- src/d/actor/d_a_obj_hfuta.cpp | 22 +- src/d/actor/d_a_obj_ice_s.cpp | 515 +++--------------- src/d/actor/d_a_obj_iceleaf.cpp | 20 +- src/d/actor/d_a_obj_lp.cpp | 75 ++- src/d/actor/d_a_obj_lv4CandleDemoTag.cpp | 288 ++-------- src/d/actor/d_a_obj_rfHole.cpp | 24 +- src/d/actor/d_a_obj_so.cpp | 168 +++--- 25 files changed, 285 insertions(+), 1140 deletions(-) diff --git a/config/GZ2E01/rels/d_a_obj_hfuta/symbols.txt b/config/GZ2E01/rels/d_a_obj_hfuta/symbols.txt index e2cd7c2ef2..7b5e12bf42 100644 --- a/config/GZ2E01/rels/d_a_obj_hfuta/symbols.txt +++ b/config/GZ2E01/rels/d_a_obj_hfuta/symbols.txt @@ -35,8 +35,7 @@ _dtors = .dtors:0x00000000; // type:label scope:global @stringBase0 = .rodata:0x00000020; // type:object size:0xA scope:local data:string_table ...data.0 = .data:0x00000000; // type:label scope:local cNullVec__6Z2Calc = .data:0x00000000; // type:object size:0xC scope:global -@1787 = .data:0x0000000C; // type:object size:0x4 scope:local -lbl_477_data_10 = .data:0x00000010; // type:object size:0x10 +lit_1787 = .data:0x0000000C; // type:object size:0x14 scope:local l_arcName = .data:0x00000020; // type:object size:0x4 scope:global data:4byte @3966 = .data:0x00000024; // type:object size:0xC scope:local @3967 = .data:0x00000030; // type:object size:0xC scope:local diff --git a/config/GZ2E01/rels/d_a_obj_ice_s/symbols.txt b/config/GZ2E01/rels/d_a_obj_ice_s/symbols.txt index d900a536ef..cfb339d7b3 100644 --- a/config/GZ2E01/rels/d_a_obj_ice_s/symbols.txt +++ b/config/GZ2E01/rels/d_a_obj_ice_s/symbols.txt @@ -65,6 +65,6 @@ g_profile_Obj_Ice_s = .data:0x00000024; // type:object size:0x30 scope:global __vt__12daObjIce_s_c = .data:0x00000054; // type:object size:0x28 scope:global __vt__17daOBJ_ICE_S_HIO_c = .data:0x0000007C; // type:object size:0xC scope:global __global_destructor_chain = .bss:0x00000000; // type:object size:0x4 scope:global -lbl_480_bss_8 = .bss:0x00000008; // type:object size:0x1 data:byte +l_HIOInit = .bss:0x00000008; // type:object size:0x1 data:byte @3639 = .bss:0x0000000C; // type:object size:0xC scope:local l_HIO = .bss:0x00000018; // type:object size:0x10 scope:global align:4 data:float diff --git a/config/GZ2E01/rels/d_a_obj_lv4CandleDemoTag/symbols.txt b/config/GZ2E01/rels/d_a_obj_lv4CandleDemoTag/symbols.txt index 5ac30cf09e..a253b2a87a 100644 --- a/config/GZ2E01/rels/d_a_obj_lv4CandleDemoTag/symbols.txt +++ b/config/GZ2E01/rels/d_a_obj_lv4CandleDemoTag/symbols.txt @@ -39,8 +39,7 @@ __destroy_global_chain_reference = .dtors:0x00000000; // type:object size:0x4 sc _dtors = .dtors:0x00000000; // type:label scope:global ...data.0 = .data:0x00000000; // type:label scope:local cNullVec__6Z2Calc = .data:0x00000000; // type:object size:0xC scope:global -@1787 = .data:0x0000000C; // type:object size:0x4 scope:local -lbl_523_data_10 = .data:0x00000010; // type:object size:0x10 +lit_1787 = .data:0x0000000C; // type:object size:0x14 scope:local @3702 = .data:0x00000020; // type:object size:0xC scope:local @3703 = .data:0x0000002C; // type:object size:0xC scope:local @3704 = .data:0x00000038; // type:object size:0xC scope:local @@ -55,4 +54,4 @@ __vt__14mDoHIO_entry_c = .data:0x0000011C; // type:object size:0xC scope:global __global_destructor_chain = .bss:0x00000000; // type:object size:0x4 scope:global @3632 = .bss:0x00000008; // type:object size:0xC scope:local l_HIO = .bss:0x00000014; // type:object size:0x8 scope:global data:2byte -lbl_523_bss_1C = .bss:0x0000001C; // type:object size:0x1 data:byte +l_HIOInit = .bss:0x0000001C; // type:object size:0x1 data:byte diff --git a/config/GZ2J01/rels/d_a_obj_hfuta/symbols.txt b/config/GZ2J01/rels/d_a_obj_hfuta/symbols.txt index 2ce98056b3..5cb0f1d61d 100644 --- a/config/GZ2J01/rels/d_a_obj_hfuta/symbols.txt +++ b/config/GZ2J01/rels/d_a_obj_hfuta/symbols.txt @@ -34,8 +34,7 @@ _dtors = .dtors:0x00000000; // type:label scope:global @3998 = .rodata:0x0000001C; // type:object size:0x4 scope:local @stringBase0 = .rodata:0x00000020; // type:object size:0xA scope:local data:string_table cNullVec__6Z2Calc = .data:0x00000000; // type:object size:0xC scope:global -@1787 = .data:0x0000000C; // type:object size:0x4 scope:local -lbl_477_data_10 = .data:0x00000010; // type:object size:0x10 +lit_1787 = .data:0x0000000C; // type:object size:0x14 scope:local l_arcName = .data:0x00000020; // type:object size:0x4 scope:global data:4byte @3966 = .data:0x00000024; // type:object size:0xC scope:local @3967 = .data:0x00000030; // type:object size:0xC scope:local diff --git a/config/GZ2J01/rels/d_a_obj_ice_s/symbols.txt b/config/GZ2J01/rels/d_a_obj_ice_s/symbols.txt index d900a536ef..cfb339d7b3 100644 --- a/config/GZ2J01/rels/d_a_obj_ice_s/symbols.txt +++ b/config/GZ2J01/rels/d_a_obj_ice_s/symbols.txt @@ -65,6 +65,6 @@ g_profile_Obj_Ice_s = .data:0x00000024; // type:object size:0x30 scope:global __vt__12daObjIce_s_c = .data:0x00000054; // type:object size:0x28 scope:global __vt__17daOBJ_ICE_S_HIO_c = .data:0x0000007C; // type:object size:0xC scope:global __global_destructor_chain = .bss:0x00000000; // type:object size:0x4 scope:global -lbl_480_bss_8 = .bss:0x00000008; // type:object size:0x1 data:byte +l_HIOInit = .bss:0x00000008; // type:object size:0x1 data:byte @3639 = .bss:0x0000000C; // type:object size:0xC scope:local l_HIO = .bss:0x00000018; // type:object size:0x10 scope:global align:4 data:float diff --git a/config/GZ2J01/rels/d_a_obj_lv4CandleDemoTag/symbols.txt b/config/GZ2J01/rels/d_a_obj_lv4CandleDemoTag/symbols.txt index 9833ae7f3e..1df1fe2b88 100644 --- a/config/GZ2J01/rels/d_a_obj_lv4CandleDemoTag/symbols.txt +++ b/config/GZ2J01/rels/d_a_obj_lv4CandleDemoTag/symbols.txt @@ -38,8 +38,7 @@ _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 cNullVec__6Z2Calc = .data:0x00000000; // type:object size:0xC scope:global -@1787 = .data:0x0000000C; // type:object size:0x4 scope:local -lbl_523_data_10 = .data:0x00000010; // type:object size:0x10 +lit_1787 = .data:0x0000000C; // type:object size:0x14 scope:local @3702 = .data:0x00000020; // type:object size:0xC scope:local @3703 = .data:0x0000002C; // type:object size:0xC scope:local @3704 = .data:0x00000038; // type:object size:0xC scope:local @@ -54,4 +53,4 @@ __vt__14mDoHIO_entry_c = .data:0x0000011C; // type:object size:0xC scope:global __global_destructor_chain = .bss:0x00000000; // type:object size:0x4 scope:global @3632 = .bss:0x00000008; // type:object size:0xC scope:local l_HIO = .bss:0x00000014; // type:object size:0x8 scope:global data:2byte -lbl_523_bss_1C = .bss:0x0000001C; // type:object size:0x1 data:byte +l_HIOInit = .bss:0x0000001C; // type:object size:0x1 data:byte diff --git a/config/GZ2P01/rels/d_a_obj_hfuta/symbols.txt b/config/GZ2P01/rels/d_a_obj_hfuta/symbols.txt index 2ce98056b3..5cb0f1d61d 100644 --- a/config/GZ2P01/rels/d_a_obj_hfuta/symbols.txt +++ b/config/GZ2P01/rels/d_a_obj_hfuta/symbols.txt @@ -34,8 +34,7 @@ _dtors = .dtors:0x00000000; // type:label scope:global @3998 = .rodata:0x0000001C; // type:object size:0x4 scope:local @stringBase0 = .rodata:0x00000020; // type:object size:0xA scope:local data:string_table cNullVec__6Z2Calc = .data:0x00000000; // type:object size:0xC scope:global -@1787 = .data:0x0000000C; // type:object size:0x4 scope:local -lbl_477_data_10 = .data:0x00000010; // type:object size:0x10 +lit_1787 = .data:0x0000000C; // type:object size:0x14 scope:local l_arcName = .data:0x00000020; // type:object size:0x4 scope:global data:4byte @3966 = .data:0x00000024; // type:object size:0xC scope:local @3967 = .data:0x00000030; // type:object size:0xC scope:local diff --git a/config/GZ2P01/rels/d_a_obj_ice_s/symbols.txt b/config/GZ2P01/rels/d_a_obj_ice_s/symbols.txt index d900a536ef..cfb339d7b3 100644 --- a/config/GZ2P01/rels/d_a_obj_ice_s/symbols.txt +++ b/config/GZ2P01/rels/d_a_obj_ice_s/symbols.txt @@ -65,6 +65,6 @@ g_profile_Obj_Ice_s = .data:0x00000024; // type:object size:0x30 scope:global __vt__12daObjIce_s_c = .data:0x00000054; // type:object size:0x28 scope:global __vt__17daOBJ_ICE_S_HIO_c = .data:0x0000007C; // type:object size:0xC scope:global __global_destructor_chain = .bss:0x00000000; // type:object size:0x4 scope:global -lbl_480_bss_8 = .bss:0x00000008; // type:object size:0x1 data:byte +l_HIOInit = .bss:0x00000008; // type:object size:0x1 data:byte @3639 = .bss:0x0000000C; // type:object size:0xC scope:local l_HIO = .bss:0x00000018; // type:object size:0x10 scope:global align:4 data:float diff --git a/config/GZ2P01/rels/d_a_obj_lv4CandleDemoTag/symbols.txt b/config/GZ2P01/rels/d_a_obj_lv4CandleDemoTag/symbols.txt index 9833ae7f3e..1df1fe2b88 100644 --- a/config/GZ2P01/rels/d_a_obj_lv4CandleDemoTag/symbols.txt +++ b/config/GZ2P01/rels/d_a_obj_lv4CandleDemoTag/symbols.txt @@ -38,8 +38,7 @@ _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 cNullVec__6Z2Calc = .data:0x00000000; // type:object size:0xC scope:global -@1787 = .data:0x0000000C; // type:object size:0x4 scope:local -lbl_523_data_10 = .data:0x00000010; // type:object size:0x10 +lit_1787 = .data:0x0000000C; // type:object size:0x14 scope:local @3702 = .data:0x00000020; // type:object size:0xC scope:local @3703 = .data:0x0000002C; // type:object size:0xC scope:local @3704 = .data:0x00000038; // type:object size:0xC scope:local @@ -54,4 +53,4 @@ __vt__14mDoHIO_entry_c = .data:0x0000011C; // type:object size:0xC scope:global __global_destructor_chain = .bss:0x00000000; // type:object size:0x4 scope:global @3632 = .bss:0x00000008; // type:object size:0xC scope:local l_HIO = .bss:0x00000014; // type:object size:0x8 scope:global data:2byte -lbl_523_bss_1C = .bss:0x0000001C; // type:object size:0x1 data:byte +l_HIOInit = .bss:0x0000001C; // type:object size:0x1 data:byte diff --git a/config/RZDE01_00/rels/d_a_obj_ice_s/symbols.txt b/config/RZDE01_00/rels/d_a_obj_ice_s/symbols.txt index 2fa41a7d8b..5f62551e27 100644 --- a/config/RZDE01_00/rels/d_a_obj_ice_s/symbols.txt +++ b/config/RZDE01_00/rels/d_a_obj_ice_s/symbols.txt @@ -69,6 +69,6 @@ __RTTI__12daObjIce_s_c = .data:0x000000DC; // type:object size:0x8 scope:global lbl_480_data_E4 = .data:0x000000E4; // type:object size:0xA data:string lbl_480_data_EE = .data:0x000000EE; // type:object size:0xA data:string __global_destructor_chain = .bss:0x00000000; // type:object size:0x4 scope:global -lbl_480_bss_8 = .bss:0x00000008; // type:object size:0x1 data:byte +l_HIOInit = .bss:0x00000008; // type:object size:0x1 data:byte @91760 = .bss:0x0000000C; // type:object size:0xC scope:local l_HIO = .bss:0x00000018; // type:object size:0x10 scope:global align:4 data:float diff --git a/configure.py b/configure.py index 5c48ce4592..848067c7d0 100755 --- a/configure.py +++ b/configure.py @@ -1947,9 +1947,9 @@ config.libs = [ ActorRel(NonMatching, "d_a_obj_hasu2"), ActorRel(NonMatching, "d_a_obj_hata"), ActorRel(NonMatching, "d_a_obj_hb"), - ActorRel(NonMatching, "d_a_obj_hbombkoya"), + ActorRel(Equivalent, "d_a_obj_hbombkoya"), ActorRel(MatchingFor("GZ2E01"), "d_a_obj_heavySw"), - ActorRel(NonMatching, "d_a_obj_hfuta"), + ActorRel(MatchingFor("GZ2E01"), "d_a_obj_hfuta"), ActorRel(MatchingFor("GZ2E01"), "d_a_obj_hsTarget"), ActorRel(MatchingFor("GZ2E01"), "d_a_obj_ice_l"), ActorRel(NonMatching, "d_a_obj_ice_s"), @@ -1986,7 +1986,7 @@ config.libs = [ ActorRel(Equivalent, "d_a_obj_laundry"), # weak func order ActorRel(MatchingFor("GZ2E01"), "d_a_obj_laundry_rope"), ActorRel(MatchingFor("GZ2E01"), "d_a_obj_lbox"), - ActorRel(NonMatching, "d_a_obj_lp"), + ActorRel(MatchingFor("GZ2E01"), "d_a_obj_lp"), ActorRel(MatchingFor("GZ2E01"), "d_a_obj_lv1Candle00"), ActorRel(MatchingFor("GZ2E01"), "d_a_obj_lv1Candle01"), ActorRel(MatchingFor("GZ2E01"), "d_a_obj_lv3Candle"), @@ -1995,7 +1995,7 @@ config.libs = [ ActorRel(MatchingFor("GZ2E01"), "d_a_obj_lv3WaterB"), ActorRel(MatchingFor("GZ2E01"), "d_a_obj_lv3saka00"), ActorRel(MatchingFor("GZ2E01"), "d_a_obj_lv3waterEff"), - ActorRel(NonMatching, "d_a_obj_lv4CandleDemoTag"), + ActorRel(Equivalent, "d_a_obj_lv4CandleDemoTag"), # weak function order ActorRel(NonMatching, "d_a_obj_lv4CandleTag"), ActorRel(NonMatching, "d_a_obj_lv4EdShutter"), ActorRel(MatchingFor("GZ2E01"), "d_a_obj_lv4Gate"), @@ -2040,7 +2040,7 @@ config.libs = [ ActorRel(MatchingFor("GZ2E01"), "d_a_obj_magLift"), ActorRel(MatchingFor("GZ2E01"), "d_a_obj_magLiftRot"), ActorRel(MatchingFor("GZ2E01"), "d_a_obj_maki"), - ActorRel(NonMatching, "d_a_obj_master_sword"), + ActorRel(Equivalent, "d_a_obj_master_sword"), #weak function and vtable order ActorRel(NonMatching, "d_a_obj_mato"), ActorRel(MatchingFor("GZ2E01"), "d_a_obj_mhole"), ActorRel(NonMatching, "d_a_obj_mie"), @@ -2053,7 +2053,7 @@ config.libs = [ ActorRel(NonMatching, "d_a_obj_mvstair"), ActorRel(MatchingFor("GZ2E01"), "d_a_obj_myogan"), ActorRel(NonMatching, "d_a_obj_nagaisu"), - ActorRel(Equivalent, "d_a_obj_nan"), + ActorRel(Equivalent, "d_a_obj_nan"), # weak function order ActorRel(NonMatching, "d_a_obj_ndoor"), ActorRel(NonMatching, "d_a_obj_nougu"), ActorRel(Equivalent, "d_a_obj_octhashi"), @@ -2073,7 +2073,7 @@ config.libs = [ ActorRel(MatchingFor("GZ2E01"), "d_a_obj_prop"), ActorRel(NonMatching, "d_a_obj_pumpkin"), ActorRel(MatchingFor("GZ2E01"), "d_a_obj_rcircle"), - ActorRel(NonMatching, "d_a_obj_rfHole"), + ActorRel(MatchingFor("GZ2E01"), "d_a_obj_rfHole"), ActorRel(MatchingFor("GZ2E01"), "d_a_obj_rgate"), ActorRel(MatchingFor("GZ2E01"), "d_a_obj_riverrock"), ActorRel(MatchingFor("GZ2E01"), "d_a_obj_rock"), @@ -2090,7 +2090,7 @@ config.libs = [ ActorRel(NonMatching, "d_a_obj_scannon_ten"), ActorRel(MatchingFor("GZ2E01"), "d_a_obj_sekidoor"), ActorRel(MatchingFor("GZ2E01"), "d_a_obj_sekizo"), - ActorRel(Equivalent, "d_a_obj_sekizoa"), + ActorRel(Equivalent, "d_a_obj_sekizoa"), # weak function order ActorRel(MatchingFor("GZ2E01"), "d_a_obj_shield"), ActorRel(Equivalent, "d_a_obj_sm_door"), # vtable order ActorRel(NonMatching, "d_a_obj_smallkey"), diff --git a/include/SSystem/SComponent/c_m3d_g_aab.h b/include/SSystem/SComponent/c_m3d_g_aab.h index 43ae9226c2..6317065a31 100644 --- a/include/SSystem/SComponent/c_m3d_g_aab.h +++ b/include/SSystem/SComponent/c_m3d_g_aab.h @@ -26,9 +26,9 @@ public: void CalcCenter(cXyz*) const; void PlusR(f32); const cXyz* GetMaxP(void) const { return &mMax; } - const cXyz* GetMaxP(void) { return &mMax; } + cXyz* GetMaxP(void) { return &mMax; } const cXyz* GetMinP(void) const { return &mMin; } - const cXyz* GetMinP(void) { return &mMin; } + cXyz* GetMinP(void) { return &mMin; } const f32 GetMaxX(void) const { return mMax.x; } const f32 GetMaxY(void) const { return mMax.y; } const f32 GetMaxZ(void) const { return mMax.z; } diff --git a/include/d/actor/d_a_obj_hbombkoya.h b/include/d/actor/d_a_obj_hbombkoya.h index 6671e53276..6303b6d0a2 100644 --- a/include/d/actor/d_a_obj_hbombkoya.h +++ b/include/d/actor/d_a_obj_hbombkoya.h @@ -28,7 +28,7 @@ public: /* 80C1B878 */ int create1st(); /* 80C1BB7C */ bool setParticle(u16*, int, PSetTbl*, int, int); - /* 80C1C474 */ virtual ~daObjHBombkoya_c(); + /* 80C1C474 */ virtual ~daObjHBombkoya_c() {} /* 80C1B938 */ virtual int CreateHeap(); /* 80C1B9CC */ virtual int Create(); diff --git a/include/d/actor/d_a_obj_ice_s.h b/include/d/actor/d_a_obj_ice_s.h index c51e5dbd2a..fe816df2aa 100644 --- a/include/d/actor/d_a_obj_ice_s.h +++ b/include/d/actor/d_a_obj_ice_s.h @@ -60,7 +60,7 @@ STATIC_ASSERT(sizeof(daObjIce_s_c) == 0x644); class daOBJ_ICE_S_HIO_c { public: /* 80C209AC */ daOBJ_ICE_S_HIO_c(); - /* 80C21A60 */ virtual ~daOBJ_ICE_S_HIO_c(); + /* 80C21A60 */ virtual ~daOBJ_ICE_S_HIO_c() {} /* 0x4 */ s8 field_0x4; /* 0x8 */ f32 field_0x8; diff --git a/include/d/actor/d_a_obj_lp.h b/include/d/actor/d_a_obj_lp.h index dcba5ac809..69657755ca 100644 --- a/include/d/actor/d_a_obj_lp.h +++ b/include/d/actor/d_a_obj_lp.h @@ -14,8 +14,8 @@ struct wd_ss { public: - /* 80C559C8 */ ~wd_ss() {}; - /* 80C55A04 */ wd_ss() {}; + /* 80C559C8 */ ~wd_ss() {} + /* 80C55A04 */ wd_ss() {} /* 0x00 */ J3DModel* mpModel; /* 0x04 */ cXyz field_0x4; @@ -31,15 +31,16 @@ public: /* 0x42 */ s16 field_0x42; /* 0x44 */ s16 field_0x44; /* 0x46 */ u8 field_0x46[0x4e - 0x46]; - /* 0x4E */ u8 field_0x4e; + /* 0x4E */ s8 field_0x4e; /* 0x4F */ u8 field_0x4f; /* 0x50 */ int field_0x50; }; STATIC_ASSERT(sizeof(wd_ss) == 0x54); -class obj_lp_class : public fopAc_ac_c { +class obj_lp_class { public: + /* 0x0000 */ fopAc_ac_c mActor; /* 0x0568 */ request_of_phase_process_class mPhase; /* 0x0570 */ u8 field_0x570; /* 0x0571 */ u8 field_0x571; diff --git a/include/d/actor/d_a_obj_lv4CandleDemoTag.h b/include/d/actor/d_a_obj_lv4CandleDemoTag.h index de15710694..b7cdb98686 100644 --- a/include/d/actor/d_a_obj_lv4CandleDemoTag.h +++ b/include/d/actor/d_a_obj_lv4CandleDemoTag.h @@ -15,6 +15,7 @@ */ class dalv4CandleDemoTag_c : public fopAc_ac_c, public request_of_phase_process_class, public dEvLib_callback_c { public: + typedef void (dalv4CandleDemoTag_c::*procFunc)(); dalv4CandleDemoTag_c() : dEvLib_callback_c(this) {} /* 80C5CA58 */ void setBaseMtx(); @@ -39,7 +40,7 @@ public: int getSwOK() { return shape_angle.x & 0xFF; } int getEventID() { return fopAcM_GetParamBit(this, 0x18, 8); } - /* 80C5D184 */ virtual ~dalv4CandleDemoTag_c(); + /* 80C5D184 */ virtual ~dalv4CandleDemoTag_c() {} /* 80C5CF78 */ virtual bool eventStart(); private: @@ -56,7 +57,7 @@ STATIC_ASSERT(sizeof(dalv4CandleDemoTag_c) == 0x590); class dalv4CandleDemoTag_HIO_c : public mDoHIO_entry_c { public: /* 80C5C9EC */ dalv4CandleDemoTag_HIO_c(); - /* 80C5D07C */ virtual ~dalv4CandleDemoTag_HIO_c(); + /* 80C5D07C */ virtual ~dalv4CandleDemoTag_HIO_c() {} void genMessage(JORMContext*); diff --git a/include/d/actor/d_a_obj_rfHole.h b/include/d/actor/d_a_obj_rfHole.h index 0bbdbb2dba..e195931d9d 100644 --- a/include/d/actor/d_a_obj_rfHole.h +++ b/include/d/actor/d_a_obj_rfHole.h @@ -28,7 +28,7 @@ public: /* 80CB8FF8 */ int create(); /* 80CB9148 */ static void rideCallBack(dBgW*, fopAc_ac_c*, fopAc_ac_c*); /* 80CB9194 */ int playerAreaCheck(); - /* 80CB940C */ int Execute(f32 (**)[3][4]); + /* 80CB940C */ int Execute(Mtx**); /* 80CB9464 */ void holeProc(); /* 80CB9520 */ void init_modeWait(); /* 80CB952C */ void modeWait(); @@ -50,7 +50,6 @@ private: /* 0x5AE */ u8 field_0x5ae; /* 0x5AF */ u8 field_0x5af; /* 0x5B0 */ s8 mRoofSoundOn; - /* 0x5B1 */ u8 field_0x5b1[0x5b4 - 0x5b1]; }; STATIC_ASSERT(sizeof(daRfHole_c) == 0x5b4); diff --git a/src/d/actor/d_a_obj_hbombkoya.cpp b/src/d/actor/d_a_obj_hbombkoya.cpp index bf5a1aa5fa..9ab73cd0b4 100644 --- a/src/d/actor/d_a_obj_hbombkoya.cpp +++ b/src/d/actor/d_a_obj_hbombkoya.cpp @@ -6,98 +6,6 @@ #include "d/actor/d_a_obj_hbombkoya.h" #include "d/d_com_inf_game.h" #include "d/d_bg_w.h" -#include "dol2asm.h" - -// -// Forward References: -// - -extern "C" void create1st__16daObjHBombkoya_cFv(); -extern "C" void CreateHeap__16daObjHBombkoya_cFv(); -extern "C" void Create__16daObjHBombkoya_cFv(); -extern "C" void __dt__8cM3dGAabFv(); -extern "C" void setParticle__16daObjHBombkoya_cFPUsiPQ216daObjHBombkoya_c7PSetTblii(); -extern "C" void Execute__16daObjHBombkoya_cFPPA3_A4_f(); -extern "C" void Draw__16daObjHBombkoya_cFv(); -extern "C" void Delete__16daObjHBombkoya_cFv(); -extern "C" static void daObjHBombkoya_create1st__FP16daObjHBombkoya_c(); -extern "C" void __dt__8cM3dGCylFv(); -extern "C" void __dt__10dCcD_GSttsFv(); -extern "C" static void daObjHBombkoya_MoveBGDelete__FP16daObjHBombkoya_c(); -extern "C" static void daObjHBombkoya_MoveBGExecute__FP16daObjHBombkoya_c(); -extern "C" static void daObjHBombkoya_MoveBGDraw__FP16daObjHBombkoya_c(); -extern "C" void __dt__10cCcD_GSttsFv(); -extern "C" void __dt__17dEvLib_callback_cFv(); -extern "C" bool eventStart__17dEvLib_callback_cFv(); -extern "C" bool eventRun__17dEvLib_callback_cFv(); -extern "C" bool eventEnd__17dEvLib_callback_cFv(); -extern "C" void __dt__16daObjHBombkoya_cFv(); -extern "C" static void func_80C1C5E8(); -extern "C" extern char const* const d_a_obj_hbombkoya__stringBase0; - -// -// External References: -// - -extern "C" void mDoMtx_YrotM__FPA4_fs(); -extern "C" void scaleM__14mDoMtx_stack_cFfff(); -extern "C" void mDoExt_modelUpdateDL__FP8J3DModel(); -extern "C" void mDoExt_J3DModel__create__FP12J3DModelDataUlUl(); -extern "C" void __dt__10fopAc_ac_cFv(); -extern "C" void fopAcM_delete__FP10fopAc_ac_c(); -extern "C" void fopAcM_setCullSizeBox__FP10fopAc_ac_cffffff(); -extern "C" void dComIfG_resLoad__FP30request_of_phase_process_classPCc(); -extern "C" void dComIfG_resDelete__FP30request_of_phase_process_classPCc(); -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 -set__13dPa_control_cFUlUcUsPC4cXyzPC12dKy_tevstr_cPC5csXyzPC4cXyzUcP18dPa_levelEcallBackScPC8_GXColorPC8_GXColorPC4cXyzf(); -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 __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 Set__8dCcD_CylFRC11dCcD_SrcCyl(); -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 SetC__8cM3dGCylFRC4cXyz(); -extern "C" void seStart__7Z2SeMgrF10JAISoundIDPC3VecUlScffffUc(); -extern "C" void seStartLevel__7Z2SeMgrF10JAISoundIDPC3VecUlScffffUc(); -extern "C" void __dl__FPv(); -extern "C" void _savegpr_19(); -extern "C" void _savegpr_24(); -extern "C" void _restgpr_19(); -extern "C" void _restgpr_24(); -extern "C" extern void* __vt__16dBgS_MoveBgActor[10]; -extern "C" extern void* __vt__8dCcD_Cyl[36]; -extern "C" extern void* __vt__9dCcD_Stts[11]; -extern "C" extern void* __vt__12cCcD_CylAttr[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 mAudioMgrPtr__10Z2AudioMgr[4 + 4 /* padding */]; - -extern void* __vt__10cCcD_GStts[3]; -extern void* __vt__10dCcD_GStts[3]; -extern void* __vt__8cM3dGCyl[3]; -extern void* __vt__17dEvLib_callback_c[6]; -extern void* __vt__8cM3dGAab[3]; -extern void* __vt__16daObjHBombkoya_c[17]; - -// -// Declarations: -// /* 80C1C734-80C1C738 -00001 0004+00 3/3 0/0 0/0 .data l_arcName */ static char* l_arcName = "H_Bombkoy"; @@ -137,11 +45,6 @@ int daObjHBombkoya_c::CreateHeap() { return 1; } -/* ############################################################################################## */ -/* 80C1C5F8-80C1C5FC 000000 0004+00 2/2 0/0 0/0 .rodata @3699 */ -SECTION_RODATA static f32 const lit_3699 = 200.0f; -COMPILER_STRIP_GATE(0x80C1C5F8, &lit_3699); - /* 80C1C738-80C1C77C 000004 0044+00 1/1 0/0 0/0 .data l_cc_cyl_src */ static dCcD_SrcCyl l_cc_cyl_src = { { @@ -163,8 +66,9 @@ int daObjHBombkoya_c::Create() { fopAcM_SetMtx(this, NULL); cM3dGAab aab(*mpBgW->GetBnd()); + aab.GetMaxP()->y += 200.0f; fopAcM_setCullSizeBox(this, aab.GetMinP()->x, aab.GetMinP()->y, aab.GetMinP()->z, - aab.GetMaxP()->x, aab.GetMaxP()->y + 200.0f, aab.GetMaxP()->z); + aab.GetMaxP()->x, aab.GetMaxP()->y, aab.GetMaxP()->z); mTimer = 0; mDoMtx_stack_c::transS(current.pos.x, current.pos.y, current.pos.z); @@ -176,20 +80,13 @@ int daObjHBombkoya_c::Create() { mEmitterKeys[i] = 0; } - mActive = false; + mActive = true; mStts.Init(0xFF, 0, this); mCyl.Set(l_cc_cyl_src); mCyl.SetStts(&mStts); return 1; } - -/* 80C1BB34-80C1BB7C 000334 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGAabFv */ -// cM3dGAab::~cM3dGAab() { -extern "C" void __dt__8cM3dGAabFv() { - // NONMATCHING -} - /* 80C1BB7C-80C1BCA0 00037C 0124+00 1/1 0/0 0/0 .text * setParticle__16daObjHBombkoya_cFPUsiPQ216daObjHBombkoya_c7PSetTblii */ bool daObjHBombkoya_c::setParticle(u16* i_particleIDs, int i_particleMax, @@ -355,8 +252,6 @@ int daObjHBombkoya_c::Delete() { return 1; } -/* ############################################################################################## */ - /* 80C1C1A8-80C1C2BC 0009A8 0114+00 1/0 0/0 0/0 .text * daObjHBombkoya_create1st__FP16daObjHBombkoya_c */ // NONMATCHING - vtable issues, read more below @@ -366,18 +261,6 @@ static int daObjHBombkoya_create1st(daObjHBombkoya_c* i_this) { return i_this->create1st(); } -/* 80C1C2BC-80C1C304 000ABC 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGCylFv */ -// cM3dGCyl::~cM3dGCyl() { -extern "C" void __dt__8cM3dGCylFv() { - // NONMATCHING -} - -/* 80C1C304-80C1C360 000B04 005C+00 1/0 0/0 0/0 .text __dt__10dCcD_GSttsFv */ -// dCcD_GStts::~dCcD_GStts() { -extern "C" void __dt__10dCcD_GSttsFv() { - // NONMATCHING -} - /* 80C1C360-80C1C380 000B60 0020+00 1/0 0/0 0/0 .text * daObjHBombkoya_MoveBGDelete__FP16daObjHBombkoya_c */ static int daObjHBombkoya_MoveBGDelete(daObjHBombkoya_c* i_this) { @@ -396,61 +279,13 @@ static int daObjHBombkoya_MoveBGDraw(daObjHBombkoya_c* i_this) { return i_this->MoveBGDraw(); } -/** - * Vtables for daObjHBombkoya_c mostly match, but __dt__17dEvLib_callback_cFv keeps getting - * generated above after daObjHBombkoya_create1st instead of down here. If that can be fixed, - * it should fix all vtable issues for this TU - */ - -/* 80C1C3CC-80C1C414 000BCC 0048+00 1/0 0/0 0/0 .text __dt__10cCcD_GSttsFv */ -// cCcD_GStts::~cCcD_GStts() { -extern "C" void __dt__10cCcD_GSttsFv() { - // NONMATCHING -} - -/* 80C1C414-80C1C45C 000C14 0048+00 1/0 0/0 0/0 .text __dt__17dEvLib_callback_cFv */ -// dEvLib_callback_c::~dEvLib_callback_c() { -extern "C" void __dt__17dEvLib_callback_cFv() { - // NONMATCHING -} - -/* 80C1C45C-80C1C464 000C5C 0008+00 2/0 0/0 0/0 .text eventStart__17dEvLib_callback_cFv - */ -// bool dEvLib_callback_c::eventStart()() { -extern "C" bool eventStart__17dEvLib_callback_cFv() { - return true; -} - -/* 80C1C464-80C1C46C 000C64 0008+00 2/0 0/0 0/0 .text eventRun__17dEvLib_callback_cFv */ -// bool dEvLib_callback_c::eventRun() { -extern "C" bool eventRun__17dEvLib_callback_cFv() { - return true; -} - -/* 80C1C46C-80C1C474 000C6C 0008+00 2/0 0/0 0/0 .text eventEnd__17dEvLib_callback_cFv */ -// bool dEvLib_callback_c::eventEnd() { -extern "C" bool eventEnd__17dEvLib_callback_cFv() { - return true; -} - -/* 80C1C474-80C1C5E8 000C74 0174+00 2/1 0/0 0/0 .text __dt__16daObjHBombkoya_cFv */ -// daObjHBombkoya_c::~daObjHBombkoya_c() { -extern "C" void __dt__16daObjHBombkoya_cFv() { - // NONMATCHING -} - -/* 80C1C5E8-80C1C5F0 000DE8 0008+00 1/0 0/0 0/0 .text @1448@__dt__16daObjHBombkoya_cFv */ -static void func_80C1C5E8() { - // NONMATCHING -} - /* 80C1C910-80C1C930 -00001 0020+00 1/0 0/0 0/0 .data daObjHBombkoya_METHODS */ static actor_method_class daObjHBombkoya_METHODS = { - (process_method_func)daObjHBombkoya_create1st__FP16daObjHBombkoya_c, - (process_method_func)daObjHBombkoya_MoveBGDelete__FP16daObjHBombkoya_c, - (process_method_func)daObjHBombkoya_MoveBGExecute__FP16daObjHBombkoya_c, - 0, - (process_method_func)daObjHBombkoya_MoveBGDraw__FP16daObjHBombkoya_c, + (process_method_func)daObjHBombkoya_create1st, + (process_method_func)daObjHBombkoya_MoveBGDelete, + (process_method_func)daObjHBombkoya_MoveBGExecute, + NULL, + (process_method_func)daObjHBombkoya_MoveBGDraw, }; /* 80C1C930-80C1C960 -00001 0030+00 0/0 0/0 1/0 .data g_profile_Obj_HBombkoya */ @@ -470,62 +305,3 @@ extern actor_process_profile_definition g_profile_Obj_HBombkoya = { fopAc_ACTOR_e, // mActorType fopAc_CULLBOX_CUSTOM_e, // cullType }; - -/* 80C1C960-80C1C96C 00022C 000C+00 3/3 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, -}; - -/* 80C1C96C-80C1C978 000238 000C+00 2/2 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, -}; - -/* 80C1C978-80C1C984 000244 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, -}; - -/* 80C1C984-80C1C99C 000250 0018+00 3/3 0/0 0/0 .data __vt__17dEvLib_callback_c */ -SECTION_DATA extern void* __vt__17dEvLib_callback_c[6] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__17dEvLib_callback_cFv, - (void*)eventStart__17dEvLib_callback_cFv, - (void*)eventRun__17dEvLib_callback_cFv, - (void*)eventEnd__17dEvLib_callback_cFv, -}; - -/* 80C1C99C-80C1C9A8 000268 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, -}; - -/* 80C1C9A8-80C1C9EC 000274 0044+00 2/2 0/0 0/0 .data __vt__16daObjHBombkoya_c */ -SECTION_DATA extern void* __vt__16daObjHBombkoya_c[17] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)CreateHeap__16daObjHBombkoya_cFv, - (void*)Create__16daObjHBombkoya_cFv, - (void*)Execute__16daObjHBombkoya_cFPPA3_A4_f, - (void*)Draw__16daObjHBombkoya_cFv, - (void*)Delete__16daObjHBombkoya_cFv, - (void*)IsDelete__16dBgS_MoveBgActorFv, - (void*)ToFore__16dBgS_MoveBgActorFv, - (void*)ToBack__16dBgS_MoveBgActorFv, - (void*)NULL, - (void*)NULL, - (void*)func_80C1C5E8, - (void*)eventStart__17dEvLib_callback_cFv, - (void*)eventRun__17dEvLib_callback_cFv, - (void*)eventEnd__17dEvLib_callback_cFv, - (void*)__dt__16daObjHBombkoya_cFv, -}; diff --git a/src/d/actor/d_a_obj_hfuta.cpp b/src/d/actor/d_a_obj_hfuta.cpp index 4b64a37b82..021f54b7ce 100644 --- a/src/d/actor/d_a_obj_hfuta.cpp +++ b/src/d/actor/d_a_obj_hfuta.cpp @@ -5,9 +5,6 @@ #include "d/actor/d_a_obj_hfuta.h" #include "d/d_com_inf_game.h" -#include "Z2AudioLib/Z2WolfHowlMgr.h" -#include "JSystem/JAudio2/JASAudioThread.h" -#include "JSystem/JAudio2/JAUSoundTable.h" #include "Z2AudioLib/Z2Instances.h" /* 80C1DD8C-80C1DDC8 0000EC 003C+00 1/1 0/0 0/0 .text initBaseMtx__11daObjFuta_cFv */ @@ -17,7 +14,6 @@ void daObjFuta_c::initBaseMtx() { } /* 80C1DDC8-80C1DE94 000128 00CC+00 2/2 0/0 0/0 .text setBaseMtx__11daObjFuta_cFv */ -// Matches with literals void daObjFuta_c::setBaseMtx() { mDoMtx_stack_c::transS(current.pos.x, current.pos.y, current.pos.z); mDoMtx_stack_c::YrotM(shape_angle.y); @@ -44,23 +40,7 @@ int daObjFuta_c::Create() { return 1; } -/* 80C1EEA4-80C1EEB0 000000 000C+00 1/1 0/0 0/0 .data cNullVec__6Z2Calc */ -static u8 cNullVec__6Z2Calc[12] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -/* 80C1EEB0-80C1EEC4 00000C 0004+10 0/0 0/0 0/0 .data @1787 */ -#pragma push -#pragma force_active on -static u32 lit_1787[1 + 4 /* padding */] = { - 0x02000201, - /* padding */ - 0x40080000, - 0x00000000, - 0x3FE00000, - 0x00000000, -}; -#pragma pop +UNK_REL_DATA /* 80C1EEC4-80C1EEC8 -00001 0004+00 3/3 0/0 0/0 .data l_arcName */ static char* l_arcName = "Obj_hfuta"; diff --git a/src/d/actor/d_a_obj_ice_s.cpp b/src/d/actor/d_a_obj_ice_s.cpp index 9fa30a3332..ebc59842eb 100644 --- a/src/d/actor/d_a_obj_ice_s.cpp +++ b/src/d/actor/d_a_obj_ice_s.cpp @@ -7,152 +7,14 @@ #include "d/actor/d_a_player.h" #include "d/d_com_inf_game.h" #include "d/d_bg_w.h" +#include "d/d_s_play.h" #include "SSystem/SComponent/c_lib.h" #include "SSystem/SComponent/c_math.h" -#include "dol2asm.h" - - - -// -// Forward References: -// - -extern "C" void __ct__17daOBJ_ICE_S_HIO_cFv(); -extern "C" void RideOn_Angle__12daObjIce_s_cFRsfsf(); -extern "C" void Check_LinkRideOn__12daObjIce_s_cF4cXyz(); -extern "C" void Check_RideOn__12daObjIce_s_cF4cXyz(); -extern "C" void initBaseMtx__12daObjIce_s_cFv(); -extern "C" void setBaseMtx__12daObjIce_s_cFv(); -extern "C" static void rideCallBack__FP4dBgWP10fopAc_ac_cP10fopAc_ac_c(); -extern "C" static void daObjIce_s_Draw__FP12daObjIce_s_c(); -extern "C" static void daObjIce_s_Execute__FP12daObjIce_s_c(); -extern "C" static bool daObjIce_s_IsDelete__FP12daObjIce_s_c(); -extern "C" static void daObjIce_s_Delete__FP12daObjIce_s_c(); -extern "C" static void daObjIce_s_Create__FP10fopAc_ac_c(); -extern "C" void create__12daObjIce_s_cFv(); -extern "C" void CreateHeap__12daObjIce_s_cFv(); -extern "C" void Create__12daObjIce_s_cFv(); -extern "C" void Execute__12daObjIce_s_cFPPA3_A4_f(); -extern "C" void Draw__12daObjIce_s_cFv(); -extern "C" void Delete__12daObjIce_s_cFv(); -extern "C" void __dt__17daOBJ_ICE_S_HIO_cFv(); -extern "C" void __sinit_d_a_obj_ice_s_cpp(); -extern "C" extern char const* const d_a_obj_ice_s__stringBase0; - -// -// External References: -// - -extern "C" void transS__14mDoMtx_stack_cFRC4cXyz(); -extern "C" void ZXYrotM__14mDoMtx_stack_cFRC5csXyz(); -extern "C" void mDoExt_modelUpdateDL__FP8J3DModel(); -extern "C" void mDoExt_J3DModel__create__FP12J3DModelDataUlUl(); -extern "C" void fopAcM_SetMin__FP10fopAc_ac_cfff(); -extern "C" void fopAcM_SetMax__FP10fopAc_ac_cfff(); -extern "C" void fopAcM_setCullSizeBox__FP10fopAc_ac_cffffff(); -extern "C" void dComIfG_resLoad__FP30request_of_phase_process_classPCc(); -extern "C" void dComIfG_resDelete__FP30request_of_phase_process_classPCc(); -extern "C" void getRes__14dRes_control_cFPCcPCcP11dRes_info_ci(); -extern "C" void getObjectResName2Index__14dRes_control_cFPCcPCc(); -extern "C" void dBgS_MoveBGProc_TypicalRotY__FP4dBgWPvRC13cBgS_PolyInfobP4cXyzP5csXyzP5csXyz(); -extern "C" void __ct__18dBgS_ObjGndChk_SplFv(); -extern "C" void __dt__18dBgS_ObjGndChk_SplFv(); -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 __ct__10dCcD_GSttsFv(); -extern "C" void settingTevStruct__18dScnKy_env_light_cFiP4cXyzP12dKy_tevstr_c(); -extern "C" void setLightTevColorType_MAJI__18dScnKy_env_light_cFP12J3DModelDataP12dKy_tevstr_c(); -extern "C" void cM_rndFX__Ff(); -extern "C" void SetPos__11cBgS_GndChkFPC4cXyz(); -extern "C" void cLib_addCalc__FPfffff(); -extern "C" void cLib_addCalcAngleS__FPsssss(); -extern "C" void cLib_chaseS__FPsss(); -extern "C" void cLib_chaseF__FPfff(); -extern "C" void cLib_chaseAngleS__FPsss(); -extern "C" void cLib_targetAngleY__FPC3VecPC3Vec(); -extern "C" void __dl__FPv(); -extern "C" void _savegpr_26(); -extern "C" void _savegpr_28(); -extern "C" void _savegpr_29(); -extern "C" void _restgpr_26(); -extern "C" void _restgpr_28(); -extern "C" void _restgpr_29(); -extern "C" extern void* __vt__9dCcD_Stts[11]; -extern "C" extern void* __vt__9cCcD_Stts[8]; -extern "C" u8 now__14mDoMtx_stack_c[48]; -extern "C" u8 sincosTable___5JMath[65536]; -extern "C" void __register_global_object(); - -// -// Declarations: -// - -/* ############################################################################################## */ -/* 80C21AF8-80C21AFC 000000 0004+00 6/6 0/0 0/0 .rodata @3644 */ -SECTION_RODATA static f32 const lit_3644 = 5000.0f; -COMPILER_STRIP_GATE(0x80C21AF8, &lit_3644); - -/* 80C21AFC-80C21B00 000004 0004+00 1/1 0/0 0/0 .rodata @3645 */ -SECTION_RODATA static f32 const lit_3645 = 20.0f; -COMPILER_STRIP_GATE(0x80C21AFC, &lit_3645); +#include /* 80C21BA8-80C21BAC -00001 0004+00 3/3 0/0 0/0 .data l_arcName */ static char* l_arcName = "V_Ice_s"; -/* 80C21BAC-80C21BCC -00001 0020+00 1/0 0/0 0/0 .data l_daObjIce_s_Method */ -static actor_method_class l_daObjIce_s_Method = { - (process_method_func)daObjIce_s_Create__FP10fopAc_ac_c, - (process_method_func)daObjIce_s_Delete__FP12daObjIce_s_c, - (process_method_func)daObjIce_s_Execute__FP12daObjIce_s_c, - (process_method_func)daObjIce_s_IsDelete__FP12daObjIce_s_c, - (process_method_func)daObjIce_s_Draw__FP12daObjIce_s_c, -}; - -/* 80C21BCC-80C21BFC -00001 0030+00 0/0 0/0 1/0 .data g_profile_Obj_Ice_s */ -extern actor_process_profile_definition g_profile_Obj_Ice_s = { - fpcLy_CURRENT_e, // mLayerID - 3, // mListID - fpcPi_CURRENT_e, // mListPrio - PROC_Obj_Ice_s, // mProcName - &g_fpcLf_Method.base, // sub_method - sizeof(daObjIce_s_c), // mSize - 0, // mSizeOther - 0, // mParameters - &g_fopAc_Method.base, // sub_method - 457, // mPriority - &l_daObjIce_s_Method, // sub_method - 0x00044180, // mStatus - fopAc_ACTOR_e, // mActorType - fopAc_CULLBOX_CUSTOM_e, // cullType -}; - -/* 80C21BFC-80C21C24 000054 0028+00 1/1 0/0 0/0 .data __vt__12daObjIce_s_c */ -SECTION_DATA extern void* __vt__12daObjIce_s_c[10] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)CreateHeap__12daObjIce_s_cFv, - (void*)Create__12daObjIce_s_cFv, - (void*)Execute__12daObjIce_s_cFPPA3_A4_f, - (void*)Draw__12daObjIce_s_cFv, - (void*)Delete__12daObjIce_s_cFv, - (void*)IsDelete__16dBgS_MoveBgActorFv, - (void*)ToFore__16dBgS_MoveBgActorFv, - (void*)ToBack__16dBgS_MoveBgActorFv, -}; - -/* 80C21C24-80C21C30 00007C 000C+00 2/2 0/0 0/0 .data __vt__17daOBJ_ICE_S_HIO_c */ -SECTION_DATA extern void* __vt__17daOBJ_ICE_S_HIO_c[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__17daOBJ_ICE_S_HIO_cFv, -}; - /* 80C209AC-80C209DC 0000EC 0030+00 1/1 0/0 0/0 .text __ct__17daOBJ_ICE_S_HIO_cFv */ daOBJ_ICE_S_HIO_c::daOBJ_ICE_S_HIO_c() { field_0x4 = -1; @@ -160,29 +22,7 @@ daOBJ_ICE_S_HIO_c::daOBJ_ICE_S_HIO_c() { field_0xc = 20.0f; } -/* ############################################################################################## */ -/* 80C21B00-80C21B08 000008 0004+04 0/4 0/0 0/0 .rodata @3686 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_3686[4 + 4 /* padding */] = { - 0x00, - 0x00, - 0x00, - 0x00, - /* padding */ - 0x00, - 0x00, - 0x00, - 0x00, -}; -COMPILER_STRIP_GATE(0x80C21B00, &lit_3686); -#pragma pop - -/* 80C21B08-80C21B10 000010 0008+00 1/3 0/0 0/0 .rodata @3688 */ -SECTION_RODATA static u8 const lit_3688[8] = { - 0x43, 0x30, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x80C21B08, &lit_3688); +f32 dummyLiteral() { return 0.0f; } /* 80C209DC-80C20A44 00011C 0068+00 2/2 0/0 0/0 .text RideOn_Angle__12daObjIce_s_cFRsfsf */ @@ -190,127 +30,61 @@ void daObjIce_s_c::RideOn_Angle(s16& param_1, f32 param_2, s16 param_3, f32 para cLib_addCalcAngleS(¶m_1, param_3 * (param_2 / param_4), 5, 0x100, 1); } -/* ############################################################################################## */ -/* 80C21B10-80C21B18 000018 0008+00 0/3 0/0 0/0 .rodata @3746 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_3746[8] = { - 0x3F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x80C21B10, &lit_3746); -#pragma pop - -/* 80C21B18-80C21B20 000020 0008+00 0/3 0/0 0/0 .rodata @3747 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_3747[8] = { - 0x40, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x80C21B18, &lit_3747); -#pragma pop - -/* 80C21B20-80C21B28 000028 0008+00 0/3 0/0 0/0 .rodata @3748 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_3748[8] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x80C21B20, &lit_3748); -#pragma pop - -/* 80C21B28-80C21B2C 000030 0004+00 0/3 0/0 0/0 .rodata @3749 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3749 = 1000.0f; -COMPILER_STRIP_GATE(0x80C21B28, &lit_3749); -#pragma pop - -/* 80C21B2C-80C21B30 000034 0004+00 0/1 0/0 0/0 .rodata @3750 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3750 = 98.0f; -COMPILER_STRIP_GATE(0x80C21B2C, &lit_3750); -#pragma pop - -/* 80C21B30-80C21B34 000038 0004+00 0/1 0/0 0/0 .rodata @3751 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_3751 = 0x3C75C28F; -COMPILER_STRIP_GATE(0x80C21B30, &lit_3751); -#pragma pop - -/* 80C21B34-80C21B38 00003C 0004+00 0/2 0/0 0/0 .rodata @3752 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3752 = 100.0f; -COMPILER_STRIP_GATE(0x80C21B34, &lit_3752); -#pragma pop - -/* 80C20A44-80C20C98 000184 0254+00 1/1 0/0 0/0 .text Check_LinkRideOn__12daObjIce_s_cF4cXyz */ -// NONMATCHING -// float register issues around abs/sin/cos -bool daObjIce_s_c::Check_LinkRideOn(cXyz param_1) { - daPy_py_c* player = daPy_getPlayerActorClass(); - s16 sVar8 = 0; - field_0x5e8 = 1; - s16 sVar7 = cLib_targetAngleY(¤t.pos, ¶m_1); - f32 dVar11 = current.pos.abs(param_1); - f32 cosangle = (f32)cM_scos(sVar7 - shape_angle.y); - cosangle = (-dVar11) * cosangle; - f32 sinangle = (f32)cM_ssin(sVar7 - shape_angle.y); - sinangle = dVar11 * sinangle; - RideOn_Angle(field_0x5da, cosangle, -0xaa0, 1000.0f * field_0x5c8.x); - RideOn_Angle(field_0x5de, sinangle, -0xaa0, 1000.0f * field_0x5c8.x); - field_0x5e8 = 1; - f32 speedF = fopAcM_GetSpeedF(player); - if (speedF > 0.0f) { - sVar8 = 98.0f * speedF; - } - field_0x5e0 = 1000.0f; - cLib_addCalc(&field_0x5a0, sVar8, 0.015f, 100.0f, 1000.0f); - cLib_chaseAngleS(&field_0x5ac, 0x120, 0x10); - return false; -} - -/* ############################################################################################## */ -/* 80C21B38-80C21B3C 000040 0004+00 0/1 0/0 0/0 .rodata @3801 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3801 = 1024.0f; -COMPILER_STRIP_GATE(0x80C21B38, &lit_3801); -#pragma pop - /* 80C21C38-80C21C3C 000008 0004+00 2/2 0/0 0/0 .bss None */ -static u8 data_80C21C38[4]; - -/* 80C21C3C-80C21C48 00000C 000C+00 1/1 0/0 0/0 .bss @3639 */ -static u8 lit_3639[12]; +static u8 l_HIOInit; /* 80C21C48-80C21C58 000018 0010+00 4/4 0/0 0/0 .bss l_HIO */ static daOBJ_ICE_S_HIO_c l_HIO; -/* 80C20C98-80C20EC0 0003D8 0228+00 1/1 0/0 0/0 .text Check_RideOn__12daObjIce_s_cF4cXyz - */ -// NONMATCHING -// float issues. -bool daObjIce_s_c::Check_RideOn(cXyz param_1) { +/* 80C20A44-80C20C98 000184 0254+00 1/1 0/0 0/0 .text Check_LinkRideOn__12daObjIce_s_cF4cXyz */ +bool daObjIce_s_c::Check_LinkRideOn(cXyz param_1) { daPy_py_c* player = daPy_getPlayerActorClass(); + f32 speedF = 0.0f; + s16 sVar8 = 0; field_0x5e8 = 1; s16 sVar7 = cLib_targetAngleY(¤t.pos, ¶m_1); f32 dVar11 = current.pos.abs(param_1); - f32 cosangle = (f32)cM_scos(sVar7 - shape_angle.y); - cosangle = (-dVar11) * cosangle; - f32 sinangle = (f32)cM_ssin(sVar7 - shape_angle.y); - sinangle = dVar11 * sinangle; + f32 cosangle = (-dVar11) * cM_scos(sVar7 - shape_angle.y); + f32 sinangle = dVar11 * cM_ssin(sVar7 - shape_angle.y); + f32 var_f27; + if (field_0x5c5 == 0xff) { + var_f27 = l_HIO.field_0x8; + } + RideOn_Angle(field_0x5da, cosangle, -0xaa0, (XREG_F(0) + 1000.0f) * field_0x5c8.x); + RideOn_Angle(field_0x5de, sinangle, -0xaa0, (XREG_F(0) + 1000.0f) * field_0x5c8.x); + f32 var_f26 = 0.0f; + field_0x5e8 = 1; + speedF = fopAcM_GetSpeedF(player); + if (speedF > 0.0f) { + sVar8 = (HREG_F(15) + 98.0f) * speedF; + } + field_0x5e0 = HREG_F(3) * (1.0f - std::abs(cosangle) / 2500.0f * (1.0f - (std::abs(sinangle) / 300.0f))); + cLib_addCalc(&field_0x5a0, sVar8, HREG_F(13) + 0.015f, 100.0f, 0.0f); + cLib_chaseAngleS(&field_0x5ac, 0x120, 0x10); + return false; +} + +/* 80C20C98-80C20EC0 0003D8 0228+00 1/1 0/0 0/0 .text Check_RideOn__12daObjIce_s_cF4cXyz + */ +bool daObjIce_s_c::Check_RideOn(cXyz param_1) { + daPy_py_c* player = daPy_getPlayerActorClass(); + f32 var_f27 = 0.0f; + int var_r27 = 0; + field_0x5e8 = 1; + s16 sVar7 = cLib_targetAngleY(¤t.pos, ¶m_1); + f32 dVar11 = current.pos.abs(param_1); + f32 cosangle = -dVar11 * cM_scos(sVar7 - shape_angle.y); + f32 sinangle = dVar11 * cM_ssin(sVar7 - shape_angle.y); f32 fVar1; // !@bug fVar1 might be uninitialized if (field_0x5c5 == 0xff) { fVar1 = l_HIO.field_0x8; } - RideOn_Angle(field_0x5da, cosangle, (fVar1 + 1024.0f) / field_0x5c8.x, 1000.0f * field_0x5c8.x); - RideOn_Angle(field_0x5de, sinangle, (fVar1 + 1024.0f) / field_0x5c8.x, 1000.0f * field_0x5c8.x); + RideOn_Angle(field_0x5da, cosangle, (yREG_F(0) + 1024.0f + fVar1) / field_0x5c8.x, (XREG_F(0) + 1000.0f) * field_0x5c8.x); + RideOn_Angle(field_0x5de, sinangle, (yREG_F(0) + 1024.0f + fVar1) / field_0x5c8.x, (XREG_F(0) + 1000.0f) * field_0x5c8.x); + f32 var_f26 = 0.0f; field_0x5e8 = 1; - field_0x5e0 = 1000.0f; + field_0x5e0 = HREG_F(3) * (1.0f - std::abs(cosangle) / 2500.0f * (1.0f - (std::abs(sinangle) / 300.0f)));; return false; } @@ -328,44 +102,17 @@ void daObjIce_s_c::setBaseMtx() { cMtx_copy(mDoMtx_stack_c::get(), mBgMtx); } -/* ############################################################################################## */ -/* 80C21B3C-80C21B40 000044 0004+00 0/1 0/0 0/0 .rodata @3905 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3905 = -1.0f; -COMPILER_STRIP_GATE(0x80C21B3C, &lit_3905); -#pragma pop - -/* 80C21B40-80C21B44 000048 0004+00 0/1 0/0 0/0 .rodata @3906 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3906 = -13.0f / 10.0f; -COMPILER_STRIP_GATE(0x80C21B40, &lit_3906); -#pragma pop - -/* 80C21B44-80C21B48 00004C 0004+00 0/1 0/0 0/0 .rodata @3907 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3907 = 600.0f; -COMPILER_STRIP_GATE(0x80C21B44, &lit_3907); -#pragma pop - -/* 80C21B48-80C21B4C 000050 0004+00 0/1 0/0 0/0 .rodata @3908 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3908 = -11.0f; -COMPILER_STRIP_GATE(0x80C21B48, &lit_3908); -#pragma pop - /* 80C20F48-80C21234 000688 02EC+00 1/1 0/0 0/0 .text * rideCallBack__FP4dBgWP10fopAc_ac_cP10fopAc_ac_c */ // NONMATCHING // reg alloc static void rideCallBack(dBgW* param_1, fopAc_ac_c* param_2, fopAc_ac_c* param_3) { + (void)param_1; + cXyz* icePos; daObjIce_s_c* ice = (daObjIce_s_c*)param_2; daPy_py_c* player = daPy_getPlayerActorClass(); cXyz& playerPos = fopAcM_GetPosition(player); - cXyz* pVVar4 = player->getIronBallCenterPos(); + cXyz* pBallCenter = player->getIronBallCenterPos(); // !@bug misplaced ! operator. This condition is probably always false if (!fopAcM_GetName(param_3) == PROC_ALINK) { @@ -376,8 +123,9 @@ static void rideCallBack(dBgW* param_1, fopAc_ac_c* param_2, fopAc_ac_c* param_3 ice->field_0x5a4 = -1.3f; ice->Check_LinkRideOn(playerPos); } - cXyz* icePos = &fopAcM_GetPosition(param_2); - if (pVVar4 != NULL && icePos != NULL && icePos->absXZ(*pVVar4) < ice->field_0x5c8.x * 600.0f) { + + icePos = &fopAcM_GetPosition(param_2); + if (pBallCenter != NULL && icePos != NULL && icePos->absXZ(*pBallCenter) < ice->field_0x5c8.x * 600.0f) { ice->field_0x5d8 = 0x300; ice->field_0x5a4 = -11.0f; ice->field_0x5ac = 0x1000; @@ -430,57 +178,6 @@ static int daObjIce_s_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -/* ############################################################################################## */ -/* 80C21B4C-80C21B50 000054 0004+00 0/1 0/0 0/0 .rodata @4000 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4000 = 500.0f; -COMPILER_STRIP_GATE(0x80C21B4C, &lit_4000); -#pragma pop - -/* 80C21B50-80C21B54 000058 0004+00 0/1 0/0 0/0 .rodata @4001 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4001 = 3.0f; -COMPILER_STRIP_GATE(0x80C21B50, &lit_4001); -#pragma pop - -/* 80C21B54-80C21B58 00005C 0004+00 0/1 0/0 0/0 .rodata @4002 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4002 = 1.0f; -COMPILER_STRIP_GATE(0x80C21B54, &lit_4002); -#pragma pop - -/* 80C21B58-80C21B5C 000060 0004+00 0/1 0/0 0/0 .rodata @4003 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4003 = 32000.0f; -COMPILER_STRIP_GATE(0x80C21B58, &lit_4003); -#pragma pop - -/* 80C21B5C-80C21B60 000064 0004+00 0/2 0/0 0/0 .rodata @4004 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4004 = 300.0f; -COMPILER_STRIP_GATE(0x80C21B5C, &lit_4004); -#pragma pop - -/* 80C21B60-80C21B68 000068 0008+00 0/1 0/0 0/0 .rodata @4006 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_4006[8] = { - 0x43, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x80C21B60, &lit_4006); -#pragma pop - -/* 80C21B8C-80C21B8C 000094 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ -#pragma push -#pragma force_active on -SECTION_DEAD static char const* const stringBase_80C21B94 = "Ice_s.dzb"; -#pragma pop - /* 80C212CC-80C2157C 000A0C 02B0+00 1/1 0/0 0/0 .text create__12daObjIce_s_cFv */ int daObjIce_s_c::create() { fopAcM_SetupActor(this, daObjIce_s_c); @@ -493,8 +190,8 @@ int daObjIce_s_c::create() { return rv; } } - if (data_80C21C38[0] == 0) { - data_80C21C38[0] = 1; + if (!l_HIOInit) { + l_HIOInit = TRUE; field_0x640 = 1; l_HIO.field_0x4 = -1; } @@ -521,20 +218,13 @@ int daObjIce_s_c::create() { cXyz cStack_c4(current.pos.x, current.pos.y + 300.0f, current.pos.z); dBgS_ObjGndChk_Spl adStack_b8; adStack_b8.SetPos(&cStack_c4); - field_0x5b0 = current.pos.x; + field_0x5b0 = current.pos.y; f32 dVar12 = field_0x5c8.x * 500.0f; fopAcM_SetMin(this, -dVar12, -dVar12, -dVar12); fopAcM_SetMax(this, dVar12, dVar12, dVar12); return rv; } -/* ############################################################################################## */ -/* 80C21B8C-80C21B8C 000094 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ -#pragma push -#pragma force_active on -SECTION_DEAD static char const* const stringBase_80C21B9E = "Ice_s.bmd"; -#pragma pop - /* 80C2157C-80C215F4 000CBC 0078+00 1/0 0/0 0/0 .text CreateHeap__12daObjIce_s_cFv */ int daObjIce_s_c::CreateHeap() { J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_arcName, "Ice_s.bmd"); @@ -550,70 +240,6 @@ int daObjIce_s_c::Create() { return cPhs_COMPLEATE_e; } -/* ############################################################################################## */ -/* 80C21B68-80C21B6C 000070 0004+00 0/1 0/0 0/0 .rodata @4060 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4060 = 1.0f / 25.0f; -COMPILER_STRIP_GATE(0x80C21B68, &lit_4060); -#pragma pop - -/* 80C21B6C-80C21B70 000074 0004+00 0/1 0/0 0/0 .rodata @4061 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4061 = 848.0f; -COMPILER_STRIP_GATE(0x80C21B6C, &lit_4061); -#pragma pop - -/* 80C21B70-80C21B74 000078 0004+00 0/1 0/0 0/0 .rodata @4062 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4062 = 9.0f / 5.0f; -COMPILER_STRIP_GATE(0x80C21B70, &lit_4062); -#pragma pop - -/* 80C21B74-80C21B78 00007C 0004+00 0/1 0/0 0/0 .rodata @4063 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4063 = 6.0f; -COMPILER_STRIP_GATE(0x80C21B74, &lit_4063); -#pragma pop - -/* 80C21B78-80C21B7C 000080 0004+00 0/1 0/0 0/0 .rodata @4064 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4064 = 5.0f; -COMPILER_STRIP_GATE(0x80C21B78, &lit_4064); -#pragma pop - -/* 80C21B7C-80C21B80 000084 0004+00 0/1 0/0 0/0 .rodata @4065 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4065 = 1.0f / 10.0f; -COMPILER_STRIP_GATE(0x80C21B7C, &lit_4065); -#pragma pop - -/* 80C21B80-80C21B84 000088 0004+00 0/1 0/0 0/0 .rodata @4066 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4066 = 0.5f; -COMPILER_STRIP_GATE(0x80C21B80, &lit_4066); -#pragma pop - -/* 80C21B84-80C21B88 00008C 0004+00 0/1 0/0 0/0 .rodata @4067 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4067 = 1.0f / 5.0f; -COMPILER_STRIP_GATE(0x80C21B84, &lit_4067); -#pragma pop - -/* 80C21B88-80C21B8C 000090 0004+00 0/1 0/0 0/0 .rodata @4068 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4068 = 1.0f / 20.0f; -COMPILER_STRIP_GATE(0x80C21B88, &lit_4068); -#pragma pop - /* 80C21634-80C21964 000D74 0330+00 1/0 0/0 0/0 .text Execute__12daObjIce_s_cFPPA3_A4_f */ int daObjIce_s_c::Execute(f32 (**param_1)[3][4]) { @@ -659,22 +285,37 @@ int daObjIce_s_c::Draw() { int daObjIce_s_c::Delete() { dComIfG_resDelete(&mPhase, l_arcName); if (field_0x640 != 0) { - data_80C21C38[0] = 0; + l_HIOInit = FALSE; } return 1; } -/* 80C21A60-80C21AA8 0011A0 0048+00 2/1 0/0 0/0 .text __dt__17daOBJ_ICE_S_HIO_cFv */ -daOBJ_ICE_S_HIO_c::~daOBJ_ICE_S_HIO_c() {} -/* 80C21AA8-80C21AE4 0011E8 003C+00 0/0 1/0 0/0 .text __sinit_d_a_obj_ice_s_cpp */ -void __sinit_d_a_obj_ice_s_cpp() { - // NONMATCHING -} +/* 80C21BAC-80C21BCC -00001 0020+00 1/0 0/0 0/0 .data l_daObjIce_s_Method */ +static actor_method_class l_daObjIce_s_Method = { + (process_method_func)daObjIce_s_Create, + (process_method_func)daObjIce_s_Delete, + (process_method_func)daObjIce_s_Execute, + (process_method_func)daObjIce_s_IsDelete, + (process_method_func)daObjIce_s_Draw, +}; -#pragma push -#pragma force_active on -REGISTER_CTORS(0x80C21AA8, __sinit_d_a_obj_ice_s_cpp); -#pragma pop +/* 80C21BCC-80C21BFC -00001 0030+00 0/0 0/0 1/0 .data g_profile_Obj_Ice_s */ +extern actor_process_profile_definition g_profile_Obj_Ice_s = { + fpcLy_CURRENT_e, // mLayerID + 3, // mListID + fpcPi_CURRENT_e, // mListPrio + PROC_Obj_Ice_s, // mProcName + &g_fpcLf_Method.base, // sub_method + sizeof(daObjIce_s_c), // mSize + 0, // mSizeOther + 0, // mParameters + &g_fopAc_Method.base, // sub_method + 457, // mPriority + &l_daObjIce_s_Method, // sub_method + 0x00044180, // mStatus + fopAc_ACTOR_e, // mActorType + fopAc_CULLBOX_CUSTOM_e, // cullType +}; /* 80C21B8C-80C21B8C 000094 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ diff --git a/src/d/actor/d_a_obj_iceleaf.cpp b/src/d/actor/d_a_obj_iceleaf.cpp index ad07fac945..6d9c642720 100644 --- a/src/d/actor/d_a_obj_iceleaf.cpp +++ b/src/d/actor/d_a_obj_iceleaf.cpp @@ -20,23 +20,7 @@ void daObjIceLeaf_c::initBaseMtx() { setBaseMtx(); } -/* 80C25DB0-80C25DBC 000000 000C+00 2/2 0/0 0/0 .data cNullVec__6Z2Calc */ -static u8 cNullVec__6Z2Calc[12] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -/* 80C25DBC-80C25DD0 00000C 0004+10 0/0 0/0 0/0 .data @1787 */ -#pragma push -#pragma force_active on -static u32 lit_1787[1 + 4 /* padding */] = { - 0x02000201, - /* padding */ - 0x40080000, - 0x00000000, - 0x3FE00000, - 0x00000000, -}; -#pragma pop +UNK_REL_DATA /* 80C25DD0-80C25DD4 -00001 0004+00 7/7 0/0 0/0 .data l_arcName */ static char* l_arcName = "V_IceLeaf"; @@ -111,7 +95,7 @@ static dCcD_SrcCyl l_cyl_src = { }; /* 80C249E4-80C24BC4 000344 01E0+00 1/1 0/0 0/0 .text Create__14daObjIceLeaf_cFv */ -// NONMATCHING - J3DTransformInfo operator= seems to be inline asm, needs work +// NONMATCHING - regalloc int daObjIceLeaf_c::Create() { J3DJoint* joint = mpModel->getModelData()->getJointNodePointer(0); mTransformInfo = joint->getTransformInfo(); diff --git a/src/d/actor/d_a_obj_lp.cpp b/src/d/actor/d_a_obj_lp.cpp index 7b89564699..43ec98d1df 100644 --- a/src/d/actor/d_a_obj_lp.cpp +++ b/src/d/actor/d_a_obj_lp.cpp @@ -10,13 +10,13 @@ #include "d/actor/d_a_player.h" #include "Z2AudioLib/Z2Instances.h" - - UNK_REL_BSS /* 80C54198-80C542FC 000078 0164+00 1/0 0/0 0/0 .text daObj_Lp_Draw__FP12obj_lp_class */ static int daObj_Lp_Draw(obj_lp_class* i_this) { - // NONMATCHING + fopAc_ac_c* a_this = (fopAc_ac_c*)&i_this->mActor; + wd_ss* mWdSs = i_this->mWdSs; + int roomNo = fopAcM_GetRoomNo(a_this); static _GXColor l_color = { 0x14, 0x0A, @@ -24,25 +24,24 @@ static int daObj_Lp_Draw(obj_lp_class* i_this) { 0xFF, }; - wd_ss* mWdSs = i_this->mWdSs; J3DGXColorS10 color; - for (int i = 0; i < i_this->field_0xad98; i++) { - if (mWdSs[i].field_0x4e && !mWdSs[i].field_0x4f) { + for (int i = 0; i < i_this->field_0xad98; i++, mWdSs++) { + if (mWdSs->field_0x4e && !mWdSs->field_0x4f) { if (g_env_light.fishing_hole_season == 1) { color.r = 6; color.g = 6; color.b = 4; color.a = 0xff; - mWdSs[i].mpModel->getModelData()->getMaterialNodePointer(0)->setTevColor(0, &color); + mWdSs->mpModel->getModelData()->getMaterialNodePointer(0)->setTevColor(0, &color); } - dComIfGp_entrySimpleModel(mWdSs[i].mpModel, fopAcM_GetRoomNo(i_this)); + dComIfGp_entrySimpleModel(mWdSs->mpModel, roomNo); } } if (i_this->field_0xadb1 && !i_this->field_0xadb2) { - i_this->field_0xad7c.update(3, l_color, &i_this->tevStr); + i_this->field_0xad7c.update(3, l_color, &a_this->tevStr); dComIfGd_set3DlineMat(&i_this->field_0xad7c); } @@ -76,7 +75,6 @@ static void* s_ks_sub(void* param_1, void* param_2) { /* 80C54374-80C546D8 000254 0364+00 1/1 0/0 0/0 .text hit_check__FP12obj_lp_classP5wd_ss */ static int hit_check(obj_lp_class* i_this, wd_ss* WdSs) { - // NONMATCHING daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0); cXyz sp6c, sp60; f32 fVar1, fVar2; @@ -86,8 +84,9 @@ static int hit_check(obj_lp_class* i_this, wd_ss* WdSs) { for (int i = 0; i < target_info_count; i++) { sp6c = WdSs->field_0x10 - *(cXyz *)(target_info[i] + 0x4d0); if (sp6c.y >= -3.0f) { - if (JMAFastSqrt(sp6c.x * sp6c.x + sp6c.z * sp6c.z) <= fVar1 * WdSs->field_0x3c) { - fVar2 = fVar1 * WdSs->field_0x3c - fVar1; + f32 dist = JMAFastSqrt(sp6c.x * sp6c.x + sp6c.z * sp6c.z); + if (dist <= fVar1 * WdSs->field_0x3c) { + fVar2 = fVar1 * WdSs->field_0x3c - dist; cLib_addCalc2(&WdSs->field_0x28.x, fVar2, 0.1f, fVar2 * 0.5f); cLib_addCalcAngleS2(&WdSs->field_0x34, cM_atan2s(sp6c.x, sp6c.z), 0x20, 0x400); cLib_addCalcAngleS2(&WdSs->field_0x36, -4000, 0x20, 0x400); @@ -122,9 +121,9 @@ static int hit_check(obj_lp_class* i_this, wd_ss* WdSs) { fVar2 = 300.0f; } - if (fabsf(sp60.x) < fVar8 + 70.0f && fVar1 > sp60.z && sp60.z < fVar2) { + if (fabsf(sp60.x) < fVar8 + 70.0f && sp60.z > fVar1 && sp60.z < fVar2) { fVar8 = fVar8 + 70.0f - fabsf(sp60.x); - if (fVar1 > sp60.z && sp60.z < fVar1 + 75.0f) { + if (sp60.z > fVar1 && sp60.z < fVar1 + 75.0f) { sp60.z -= fVar1; fVar8 *= fabsf(sp60.z) * 0.01333f; } @@ -199,9 +198,9 @@ static void hasu_action(obj_lp_class* i_this, wd_ss* WdSs) { /* 80C54B20-80C54D40 000A00 0220+00 1/1 0/0 0/0 .text set_out_check__FP12obj_lp_classP4cXyz */ static int set_out_check(obj_lp_class* i_this, cXyz* param_2) { - // NONMATCHING - cXyz sp3c = *param_2 - i_this->current.pos; - if (fabsf(sp3c.y) > 100.0f || 100.0f > i_this->field_0x571 * sp3c.abs()) { + fopAc_ac_c* a_this = (fopAc_ac_c*)&i_this->mActor; + cXyz sp3c = *param_2 - a_this->current.pos; + if (fabsf(sp3c.y) > 100.0f || sp3c.abs() > i_this->field_0x571 * 100.0f) { return 1; } @@ -210,8 +209,9 @@ static int set_out_check(obj_lp_class* i_this, cXyz* param_2) { s16 sVar1 = cM_atan2s(sp3c.x, sp3c.z); sp3c = *param_2 - camera->lookat.eye; s16 sVar2 = cM_atan2s(sp3c.x, sp3c.z); + s16 diff = sVar1 - sVar2; - if (sVar1 - sVar2 > 0x3000 || sVar1 - sVar2 < -0x3000) { + if (diff > 0x3000 || diff < -0x3000) { return 1; } @@ -220,7 +220,6 @@ static int set_out_check(obj_lp_class* i_this, cXyz* param_2) { /* 80C54D40-80C550F0 000C20 03B0+00 2/1 0/0 0/0 .text daObj_Lp_Execute__FP12obj_lp_class */ static int daObj_Lp_Execute(obj_lp_class* i_this) { - // NONMATCHING i_this->field_0x574++; if (i_this->field_0xadb0) { i_this->field_0xadb0 += -1; @@ -278,7 +277,8 @@ static int daObj_Lp_Execute(obj_lp_class* i_this) { if ((i_this->field_0x574 & 15) == 0) { fopAc_ac_c* player = dComIfGp_getPlayer(0); if (!set_out_check(i_this, &player->current.pos)) { - if (fabsf(player->speedF) > 1.0f) { + fVar7 = fabsf(player->speedF); + if (fVar7 > 1.0f) { i_this->field_0xad9c = player->current.pos; } } @@ -319,10 +319,10 @@ static int daObj_Lp_IsDelete(obj_lp_class* i_this) { /* 80C550F8-80C5518C 000FD8 0094+00 1/0 0/0 0/0 .text daObj_Lp_Delete__FP12obj_lp_class */ static int daObj_Lp_Delete(obj_lp_class* i_this) { - // NONMATCHING + fopAc_ac_c* a_this = (fopAc_ac_c*)&i_this->mActor; if (i_this->field_0xadb4) { J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes("Obj_lp", 3); - dComIfGp_removeSimpleModel(modelData, fopAcM_GetRoomNo(i_this)); + dComIfGp_removeSimpleModel(modelData, fopAcM_GetRoomNo(a_this)); } dComIfG_resDelete(&i_this->mPhase, "Obj_lp"); return 1; @@ -377,9 +377,8 @@ static int set_pos_check(obj_lp_class* i_this, int param_2) { /* 80C55488-80C559C8 001368 0540+00 1/0 0/0 0/0 .text daObj_Lp_Create__FP10fopAc_ac_c */ static int daObj_Lp_Create(fopAc_ac_c* a_this) { - // NONMATCHING + fopAcM_SetupActor(a_this, obj_lp_class); obj_lp_class* i_this = (obj_lp_class*)a_this; - fopAcM_SetupActor(i_this, obj_lp_class); int phase_state = dComIfG_resLoad(&i_this->mPhase, "Obj_lp"); if (phase_state == cPhs_COMPLEATE_e) { @@ -414,19 +413,19 @@ static int daObj_Lp_Create(fopAc_ac_c* a_this) { iVar3 = 0x1e8; } - if (!fopAcM_entrySolidHeap(i_this, useHeapInit, i_this->field_0xad98 * iVar3)) { + if (!fopAcM_entrySolidHeap(a_this, useHeapInit, i_this->field_0xad98 * iVar3)) { OS_REPORT("//////////////OBJ_LP SET NON !!\n"); return cPhs_ERROR_e; } OS_REPORT("//////////////OBJ_LP NUM : %d !!\n", i_this->field_0xad98); - fopAcM_SetMtx(i_this, i_this->mWdSs[0].mpModel->getBaseTRMtx()); + fopAcM_SetMtx(a_this, i_this->mWdSs[0].mpModel->getBaseTRMtx()); f32 fVar1 = i_this->field_0x571 * 70.0f + 50.0f; - fopAcM_SetMin(i_this, -fVar1, -100.0f, -fVar1); - fopAcM_SetMax(i_this, fVar1, 100.0f, fVar1); - MtxTrans(i_this->current.pos.x, i_this->current.pos.y, i_this->current.pos.z, 0); + fopAcM_SetMin(a_this, -fVar1, -100.0f, -fVar1); + fopAcM_SetMax(a_this, fVar1, 100.0f, fVar1); + MtxTrans(a_this->current.pos.x, a_this->current.pos.y, a_this->current.pos.z, 0); cXyz sp13c(0.0f, 0.0f, 0.0f); dBgS_GndChk dStack_dc; @@ -441,30 +440,30 @@ static int daObj_Lp_Create(fopAc_ac_c* a_this) { MtxPush(); cMtx_YrotM(*calc_mtx, cM_rndF(65536.0f)); MtxPosition(&sp13c, &i_this->mWdSs[i].field_0x10); - f32 rndF = cM_rndF(1.0f); - f32 fVar1 = 1.0f - rndF * rndF; - sp13c.z = fVar1 * (i_this->field_0x571 * 100.0f); + sp13c.z = cM_rndF(1.0f); + sp13c.z = 1.0f - sp13c.z * sp13c.z; + sp13c.z *= (i_this->field_0x571 * 100.0f); MtxPull(); - cXyz sp148; + Vec sp148; sp148.x = i_this->mWdSs[i].field_0x10.x; sp148.y = i_this->mWdSs[i].field_0x10.y + 100.0f; sp148.z = i_this->mWdSs[i].field_0x10.z; - dStack_dc.SetPos(&(Vec)sp148); - cStack_130.SetPos(&(Vec)sp148); + dStack_dc.SetPos(&sp148); + cStack_130.SetPos(&sp148); i_this->mWdSs[i].field_0x10.y = dComIfG_Bgsp().GroundCross(&cStack_130); i_this->mWdSs[i].field_0x38 = cM_rndF(65536.0f); if (i == 0) { - i_this->current.pos.y = i_this->mWdSs[i].field_0x10.y; + a_this->current.pos.y = i_this->mWdSs[i].field_0x10.y; } i_this->mWdSs[i].field_0x1c.y = dComIfG_Bgsp().GroundCross(&dStack_dc); if ((set_pos_check(i_this, i) && i_this->mWdSs[i].field_0x10.y - i_this->mWdSs[i].field_0x1c.y > 10.0f) && - (i_this->field_0xadb1 != 0 && i_this->mWdSs[i].field_0x10.y - i_this->mWdSs[i].field_0x1c.y < 200.0f)) { + (i_this->field_0xadb1 == 0 || i_this->mWdSs[i].field_0x10.y - i_this->mWdSs[i].field_0x1c.y < 200.0f)) { i_this->mWdSs[i].field_0x4e = 1; i_this->mWdSs[i].field_0x3c = fVar13 * (cM_rndFX(0.2f) + 1.0f); i_this->mWdSs[i].field_0x4 = i_this->mWdSs[i].field_0x10; @@ -489,7 +488,7 @@ static int daObj_Lp_Create(fopAc_ac_c* a_this) { J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes("Obj_lp", 3); JUT_ASSERT(0x3b0, modelData != 0); - dComIfGp_addSimpleModel(modelData, fopAcM_GetRoomNo(i_this), 0); + dComIfGp_addSimpleModel(modelData, fopAcM_GetRoomNo(a_this), 0); if (modelData == NULL) { OS_REPORT("\x1b[43;30mリリーパッド:シンプルモデル登録失敗しました。\n"); } diff --git a/src/d/actor/d_a_obj_lv4CandleDemoTag.cpp b/src/d/actor/d_a_obj_lv4CandleDemoTag.cpp index 47e952b56f..14506c73d8 100644 --- a/src/d/actor/d_a_obj_lv4CandleDemoTag.cpp +++ b/src/d/actor/d_a_obj_lv4CandleDemoTag.cpp @@ -6,192 +6,9 @@ #include "d/actor/d_a_obj_lv4CandleDemoTag.h" #include "d/d_com_inf_game.h" #include "d/d_path.h" -#include "d/d_event_lib.h" -#include "dol2asm.h" #include "m_Do/m_Do_hostIO.h" -// -// Forward References: -// - -extern "C" void __ct__24dalv4CandleDemoTag_HIO_cFv(); -extern "C" void __dt__14mDoHIO_entry_cFv(); -extern "C" void setBaseMtx__20dalv4CandleDemoTag_cFv(); -extern "C" void create__20dalv4CandleDemoTag_cFv(); -extern "C" void Execute__20dalv4CandleDemoTag_cFv(); -extern "C" void procMain__20dalv4CandleDemoTag_cFv(); -extern "C" void init_modeWatch__20dalv4CandleDemoTag_cFv(); -extern "C" void modeWatch__20dalv4CandleDemoTag_cFv(); -extern "C" void init_modeEnemyCreate__20dalv4CandleDemoTag_cFv(); -extern "C" void modeEnemyCreate__20dalv4CandleDemoTag_cFv(); -extern "C" void init_modeNG__20dalv4CandleDemoTag_cFv(); -extern "C" void modeNG__20dalv4CandleDemoTag_cFv(); -extern "C" void init_modeEnd__20dalv4CandleDemoTag_cFv(); -extern "C" void modeEnd__20dalv4CandleDemoTag_cFv(); -extern "C" void eventStart__20dalv4CandleDemoTag_cFv(); -extern "C" void searchShutterAct__20dalv4CandleDemoTag_cFPvPv(); -extern "C" bool Draw__20dalv4CandleDemoTag_cFv(); -extern "C" bool Delete__20dalv4CandleDemoTag_cFv(); -extern "C" static void dalv4CandleDemoTag_Draw__FP20dalv4CandleDemoTag_c(); -extern "C" static void dalv4CandleDemoTag_Execute__FP20dalv4CandleDemoTag_c(); -extern "C" static void dalv4CandleDemoTag_Delete__FP20dalv4CandleDemoTag_c(); -extern "C" static void dalv4CandleDemoTag_Create__FP10fopAc_ac_c(); -extern "C" void __dt__24dalv4CandleDemoTag_HIO_cFv(); -extern "C" void __sinit_d_a_obj_lv4CandleDemoTag_cpp(); -extern "C" static void func_80C5D114(); -extern "C" static void func_80C5D11C(); -extern "C" void __dt__17dEvLib_callback_cFv(); -extern "C" bool eventRun__17dEvLib_callback_cFv(); -extern "C" bool eventEnd__17dEvLib_callback_cFv(); -extern "C" bool eventStart__17dEvLib_callback_cFv(); -extern "C" void __dt__20dalv4CandleDemoTag_cFv(); - -// -// External References: -// - -extern "C" void __ct__10fopAc_ac_cFv(); -extern "C" void __dt__10fopAc_ac_cFv(); -extern "C" void fopAc_IsActor__FPv(); -extern "C" void fopAcIt_Judge__FPFPvPv_PvPv(); -extern "C" void fopAcM_create__FsUlPC4cXyziPC5csXyzPC4cXyzSc(); -extern "C" void fopAcM_myRoomSearchEnemy__FSc(); -extern "C" void onSwitch__10dSv_info_cFii(); -extern "C" void offSwitch__10dSv_info_cFii(); -extern "C" void isSwitch__10dSv_info_cCFii(); -extern "C" void eventUpdate__17dEvLib_callback_cFv(); -extern "C" void orderEvent__17dEvLib_callback_cFiii(); -extern "C" void dPath_GetRoomPath__Fii(); -extern "C" void __dl__FPv(); -extern "C" void __ptmf_scall(); -extern "C" void _savegpr_28(); -extern "C" void _restgpr_28(); -extern "C" u8 now__14mDoMtx_stack_c[48]; -extern "C" void __register_global_object(); - -// -// Declarations: -// - -/* ############################################################################################## */ -/* 80C5D218-80C5D224 000000 000C+00 1/1 0/0 0/0 .data cNullVec__6Z2Calc */ -SECTION_DATA static u8 cNullVec__6Z2Calc[12] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -/* 80C5D224-80C5D238 00000C 0004+10 0/0 0/0 0/0 .data @1787 */ -#pragma push -#pragma force_active on -SECTION_DATA static u32 lit_1787[1 + 4 /* padding */] = { - 0x02000201, - /* padding */ - 0x40080000, - 0x00000000, - 0x3FE00000, - 0x00000000, -}; -#pragma pop - -/* 80C5D238-80C5D244 -00001 000C+00 0/1 0/0 0/0 .data @3702 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_3702[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)modeWatch__20dalv4CandleDemoTag_cFv, -}; -#pragma pop - -/* 80C5D244-80C5D250 -00001 000C+00 0/1 0/0 0/0 .data @3703 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_3703[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)modeEnemyCreate__20dalv4CandleDemoTag_cFv, -}; -#pragma pop - -/* 80C5D250-80C5D25C -00001 000C+00 0/1 0/0 0/0 .data @3704 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_3704[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)modeNG__20dalv4CandleDemoTag_cFv, -}; -#pragma pop - -/* 80C5D25C-80C5D268 -00001 000C+00 0/1 0/0 0/0 .data @3705 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_3705[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)modeEnd__20dalv4CandleDemoTag_cFv, -}; -#pragma pop - -/* 80C5D268-80C5D298 000050 0030+00 0/1 0/0 0/0 .data mode_proc$3701 */ -#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 - -/* 80C5D298-80C5D2B8 -00001 0020+00 1/0 0/0 0/0 .data l_dalv4CandleDemoTag_Method */ -static actor_method_class l_dalv4CandleDemoTag_Method = { - (process_method_func)dalv4CandleDemoTag_Create__FP10fopAc_ac_c, - (process_method_func)dalv4CandleDemoTag_Delete__FP20dalv4CandleDemoTag_c, - (process_method_func)dalv4CandleDemoTag_Execute__FP20dalv4CandleDemoTag_c, - 0, - (process_method_func)dalv4CandleDemoTag_Draw__FP20dalv4CandleDemoTag_c, -}; - -/* 80C5D2B8-80C5D2E8 -00001 0030+00 0/0 0/0 1/0 .data g_profile_Tag_Lv4CandleDm */ -extern actor_process_profile_definition g_profile_Tag_Lv4CandleDm = { - fpcLy_CURRENT_e, // mLayerID - 7, // mListID - fpcPi_CURRENT_e, // mListPrio - PROC_Tag_Lv4CandleDm, // mProcName - &g_fpcLf_Method.base, // sub_method - sizeof(dalv4CandleDemoTag_c), // mSize - 0, // mSizeOther - 0, // mParameters - &g_fopAc_Method.base, // sub_method - 541, // mPriority - &l_dalv4CandleDemoTag_Method, // sub_method - 0x00044000, // mStatus - fopAc_ACTOR_e, // mActorType - fopAc_CULLBOX_CUSTOM_e, // cullType -}; - -/* 80C5D2E8-80C5D310 0000D0 0028+00 2/2 0/0 0/0 .data __vt__20dalv4CandleDemoTag_c */ -SECTION_DATA extern void* __vt__20dalv4CandleDemoTag_c[10] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)NULL, - (void*)NULL, - (void*)func_80C5D11C, - (void*)func_80C5D114, - (void*)eventRun__17dEvLib_callback_cFv, - (void*)eventEnd__17dEvLib_callback_cFv, - (void*)__dt__20dalv4CandleDemoTag_cFv, - (void*)eventStart__20dalv4CandleDemoTag_cFv, -}; - -/* 80C5D310-80C5D328 0000F8 0018+00 3/3 0/0 0/0 .data __vt__17dEvLib_callback_c */ -SECTION_DATA extern void* __vt__17dEvLib_callback_c[6] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__17dEvLib_callback_cFv, - (void*)eventStart__17dEvLib_callback_cFv, - (void*)eventRun__17dEvLib_callback_cFv, - (void*)eventEnd__17dEvLib_callback_cFv, -}; +UNK_REL_DATA /* 80C5C9EC-80C5CA10 0000EC 0024+00 1/1 0/0 0/0 .text __ct__24dalv4CandleDemoTag_HIO_cFv */ @@ -239,32 +56,25 @@ int dalv4CandleDemoTag_c::Execute() { return 1; } -/* ############################################################################################## */ -/* 80C5D348-80C5D354 000008 000C+00 1/1 0/0 0/0 .bss @3632 */ -static u8 lit_3632[12]; - /* 80C5D354-80C5D35C 000014 0008+00 2/2 0/0 0/0 .bss l_HIO */ -static u8 l_HIO[8]; - -/* 80C5D35C-80C5D360 00001C 0004+00 1/1 0/0 0/0 .bss None */ -static u8 data_80C5D35C[4]; +static dalv4CandleDemoTag_HIO_c l_HIO; /* 80C5CBE8-80C5CCA4 0002E8 00BC+00 1/1 0/0 0/0 .text procMain__20dalv4CandleDemoTag_cFv */ -// need virtuals to match so sinit can also be matched -#ifdef NONMATCHING void dalv4CandleDemoTag_c::procMain() { + static dalv4CandleDemoTag_c::procFunc mode_proc[4] = { + &dalv4CandleDemoTag_c::modeWatch, + &dalv4CandleDemoTag_c::modeEnemyCreate, + &dalv4CandleDemoTag_c::modeNG, + &dalv4CandleDemoTag_c::modeEnd, + }; + (this->*mode_proc[mMode])(); } -#else -void dalv4CandleDemoTag_c::procMain() { - // NONMATCHING -} -#endif /* 80C5CCA4-80C5CCC0 0003A4 001C+00 2/2 0/0 0/0 .text init_modeWatch__20dalv4CandleDemoTag_cFv */ void dalv4CandleDemoTag_c::init_modeWatch() { - mEnemyWaitTime = (*(dalv4CandleDemoTag_HIO_c*)l_HIO).mEnemyWaitTime; + mEnemyWaitTime = l_HIO.mEnemyWaitTime; mMode = 0; } @@ -399,57 +209,29 @@ static int dalv4CandleDemoTag_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -/* 80C5D07C-80C5D0D8 00077C 005C+00 2/1 0/0 0/0 .text __dt__24dalv4CandleDemoTag_HIO_cFv - */ -dalv4CandleDemoTag_HIO_c::~dalv4CandleDemoTag_HIO_c() {} +/* 80C5D298-80C5D2B8 -00001 0020+00 1/0 0/0 0/0 .data l_dalv4CandleDemoTag_Method */ +static actor_method_class l_dalv4CandleDemoTag_Method = { + (process_method_func)dalv4CandleDemoTag_Create, + (process_method_func)dalv4CandleDemoTag_Delete, + (process_method_func)dalv4CandleDemoTag_Execute, + NULL, + (process_method_func)dalv4CandleDemoTag_Draw, +}; -/* 80C5D0D8-80C5D114 0007D8 003C+00 0/0 1/0 0/0 .text __sinit_d_a_obj_lv4CandleDemoTag_cpp */ -void __sinit_d_a_obj_lv4CandleDemoTag_cpp(){// NONMATCHING -} - -#pragma push -#pragma force_active on -REGISTER_CTORS(0x80C5D0D8, __sinit_d_a_obj_lv4CandleDemoTag_cpp); -#pragma pop - -/* 80C5D114-80C5D11C 000814 0008+00 1/0 0/0 0/0 .text @1392@eventStart__20dalv4CandleDemoTag_cFv - */ -static void func_80C5D114() { - // NONMATCHING -} - -/* 80C5D11C-80C5D124 00081C 0008+00 1/0 0/0 0/0 .text @1392@__dt__20dalv4CandleDemoTag_cFv */ -static void func_80C5D11C() { - // NONMATCHING -} - -/* 80C5D124-80C5D16C 000824 0048+00 1/0 0/0 0/0 .text __dt__17dEvLib_callback_cFv */ -// dEvLib_callback_c::~dEvLib_callback_c() { -extern "C" void __dt__17dEvLib_callback_cFv() { - // NONMATCHING -} - -/* 80C5D16C-80C5D174 00086C 0008+00 2/0 0/0 0/0 .text eventRun__17dEvLib_callback_cFv */ -// bool dEvLib_callback_c::eventRun() { -extern "C" bool eventRun__17dEvLib_callback_cFv() { - return true; -} - -/* 80C5D174-80C5D17C 000874 0008+00 2/0 0/0 0/0 .text eventEnd__17dEvLib_callback_cFv */ -// bool dEvLib_callback_c::eventEnd() { -extern "C" bool eventEnd__17dEvLib_callback_cFv() { - return true; -} - -/* 80C5D17C-80C5D184 00087C 0008+00 1/0 0/0 0/0 .text eventStart__17dEvLib_callback_cFv - */ -// bool dEvLib_callback_c::eventStart()() { -extern "C" bool eventStart__17dEvLib_callback_cFv() { - return true; -} - -/* 80C5D184-80C5D204 000884 0080+00 2/1 0/0 0/0 .text __dt__20dalv4CandleDemoTag_cFv */ -// dalv4CandleDemoTag_c::~dalv4CandleDemoTag_c() { -extern "C" void __dt__20dalv4CandleDemoTag_cFv() { - // NONMATCHING -} +/* 80C5D2B8-80C5D2E8 -00001 0030+00 0/0 0/0 1/0 .data g_profile_Tag_Lv4CandleDm */ +extern actor_process_profile_definition g_profile_Tag_Lv4CandleDm = { + fpcLy_CURRENT_e, // mLayerID + 7, // mListID + fpcPi_CURRENT_e, // mListPrio + PROC_Tag_Lv4CandleDm, // mProcName + &g_fpcLf_Method.base, // sub_method + sizeof(dalv4CandleDemoTag_c), // mSize + 0, // mSizeOther + 0, // mParameters + &g_fopAc_Method.base, // sub_method + 541, // mPriority + &l_dalv4CandleDemoTag_Method, // sub_method + 0x00044000, // mStatus + fopAc_ACTOR_e, // mActorType + fopAc_CULLBOX_CUSTOM_e, // cullType +}; diff --git a/src/d/actor/d_a_obj_rfHole.cpp b/src/d/actor/d_a_obj_rfHole.cpp index a35515c0b1..a1b69a85df 100644 --- a/src/d/actor/d_a_obj_rfHole.cpp +++ b/src/d/actor/d_a_obj_rfHole.cpp @@ -7,23 +7,7 @@ #include "d/d_com_inf_game.h" #include "d/d_bg_w.h" -/* 80CB9ACC-80CB9AD8 000000 000C+00 1/1 0/0 0/0 .data cNullVec__6Z2Calc */ -static u8 cNullVec__6Z2Calc[12] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -/* 80CB9AD8-80CB9AEC 00000C 0004+10 0/0 0/0 0/0 .data @1787 */ -#pragma push -#pragma force_active on -static u32 lit_1787[1 + 4 /* padding */] = { - 0x02000201, - /* padding */ - 0x40080000, - 0x00000000, - 0x3FE00000, - 0x00000000, -}; -#pragma pop +UNK_REL_DATA /* 80CB8E6C-80CB8EBC 0000EC 0050+00 1/1 0/0 0/0 .text __ct__14daRfHole_HIO_cFv */ daRfHole_HIO_c::daRfHole_HIO_c() { @@ -115,9 +99,9 @@ int daRfHole_c::playerAreaCheck() { } /* 80CB940C-80CB9464 00068C 0058+00 1/0 0/0 0/0 .text Execute__10daRfHole_cFPPA3_A4_f */ -int daRfHole_c::Execute(f32 (**param_1)[3][4]) { +int daRfHole_c::Execute(Mtx** i_mtx) { holeProc(); - *param_1 = &mModel->getBaseTRMtx(); + *i_mtx = &mModel->getBaseTRMtx(); setBaseMtx(); field_0x5ae = 0; return 1; @@ -240,7 +224,7 @@ static actor_method_class l_daRfHole_Method = { (process_method_func)daRfHole_Create, (process_method_func)daRfHole_Delete, (process_method_func)daRfHole_Execute, - 0, + NULL, (process_method_func)daRfHole_Draw, }; diff --git a/src/d/actor/d_a_obj_so.cpp b/src/d/actor/d_a_obj_so.cpp index 32d014392b..1b401a876a 100644 --- a/src/d/actor/d_a_obj_so.cpp +++ b/src/d/actor/d_a_obj_so.cpp @@ -11,6 +11,7 @@ #include "d/actor/d_a_obj_pillar.h" #include "d/actor/d_a_player.h" #include "d/d_cc_uty.h" +#include "d/d_s_play.h" /* 80CE03CC-80CE03F0 0000EC 0024+00 1/1 0/0 0/0 .text __ct__14daObj_So_HIO_cFv */ daObj_So_HIO_c::daObj_So_HIO_c() { @@ -112,26 +113,24 @@ static void so_hasira(obj_so_class* i_this) { /* 80CE0744-80CE0C54 000464 0510+00 4/4 0/0 0/0 .text part_set__FP12obj_so_classSc */ static void part_set(obj_so_class* i_this, s8 param_2) { - // NONMATCHING fopAc_ac_c* a_this = &i_this->actor; cXyz sp48, sp54; mDoMtx_stack_c::transS(a_this->current.pos.x, a_this->current.pos.y, a_this->current.pos.z); - mDoMtx_stack_c::YrotM(a_this->shape_angle.y); - mDoMtx_stack_c::XrotM(a_this->shape_angle.x); + mDoMtx_stack_c::YrotM((s16)a_this->shape_angle.y); + mDoMtx_stack_c::XrotM((s16)a_this->shape_angle.x); f32 scale = a_this->scale.x; mDoMtx_stack_c::scaleM(scale, scale, scale); - int sVar8, sVar7, sVar6, sVar5, sVar4 = 0; for (int i = 0; i < 26; i++) { mDoMtx_stack_c::push(); if (i < 2) { sp48.x = 0.0f; if (i == 0) { - sp48.y = 210.0f; + sp48.y = VREG_F(6) + 210.0f; } else { - sp48.y = 0.0f; + sp48.y = VREG_F(7); } sp48.z = 0.0f; mDoMtx_stack_c::multVec(&sp48, &i_this->field_0x618[i]); @@ -141,7 +140,7 @@ static void part_set(obj_so_class* i_this, s8 param_2) { i_this->field_0xa28[i].x = a_this->shape_angle.x + (int)cM_rndFX(4000.0f); } } else if (i < 10) { - mDoMtx_stack_c::YrotM(sVar4 + -0xF18); + mDoMtx_stack_c::YrotM(8092 * i - 0xF18); sp48.x = 0.0f; sp48.y = 110.0f; sp48.z = 90.0f; @@ -155,14 +154,13 @@ static void part_set(obj_so_class* i_this, s8 param_2) { i_this->field_0x618[i].y += 60.0f; } } else { - mDoMtx_stack_c::YrotM(sVar4 + 0x4718); + mDoMtx_stack_c::YrotM(8092 * i + 18200); sp48.x = 0.0f; if (i <= 17) { - scale = 205.0f; + sp48.y = 205.0f; } else { - scale = -5.0f; + sp48.y = -5.0f; } - sp48.y = scale; if ((i & 1) != 0) { sp48.y += 8.0f; } @@ -171,7 +169,7 @@ static void part_set(obj_so_class* i_this, s8 param_2) { mDoMtx_stack_c::multVec(&sp48, &i_this->field_0x618[i]); i_this->field_0xa28[i].y = a_this->shape_angle.y; i_this->field_0xa28[i].x = a_this->shape_angle.x; - i_this->field_0xb60[i] = sVar4 + 0x4CE; + i_this->field_0xb60[i] = 8092 * i + 0x4CE; i_this->field_0x7b8[i].set(1.0f, 0.8f, 1.0f); } @@ -183,9 +181,9 @@ static void part_set(obj_so_class* i_this, s8 param_2) { if (i_this->field_0x570 != 1) { if (fopAcM_GetRoomNo(a_this) == 4) { if (i < 2) { - cMtx_YrotS(*calc_mtx, sVar5 + 0x1EFF); + cMtx_YrotS(*calc_mtx, 0x2000 * i + 0x1EFF); } else { - cMtx_YrotS(*calc_mtx, sVar6 + 0x253B); + cMtx_YrotS(*calc_mtx, 500 * i + 0x253B); i_this->field_0xbfc[i] = cM_rndFX(6000.0f); } @@ -193,12 +191,12 @@ static void part_set(obj_so_class* i_this, s8 param_2) { sp48.z = cM_rndFX(5.0f) + 20.0f; } else { if (i < 2) { - cMtx_YrotS(*calc_mtx, sVar7 + (u16)-0x2000); + cMtx_YrotS(*calc_mtx, 0x8000 * i + (u16)-0x2000); } else if (i < 10) { - cMtx_YrotS(*calc_mtx, sVar5 + 0xAAA); + cMtx_YrotS(*calc_mtx, 0x2000 * i + 0xAAA); i_this->field_0xbfc[i] = cM_rndFX(4000.0f); } else { - cMtx_YrotS(*calc_mtx, sVar8 + 0x1554); + cMtx_YrotS(*calc_mtx, 0x1000 * i + 0x1554); i_this->field_0xbfc[i] = cM_rndFX(6000.0f); } @@ -207,7 +205,7 @@ static void part_set(obj_so_class* i_this, s8 param_2) { } } else { if (i < 2) { - cMtx_YrotS(*calc_mtx, sVar7 + 0x6000); + cMtx_YrotS(*calc_mtx, 0x8000 * i + 0x6000); } else { cMtx_YrotS(*calc_mtx, cM_rndFX(32768.0f)); i_this->field_0xbfc[i] = cM_rndFX(1000.0f); @@ -225,12 +223,6 @@ static void part_set(obj_so_class* i_this, s8 param_2) { MtxPosition(&sp48, &i_this->field_0x8f0[i]); i_this->field_0xbc8[i] = cM_rndFX(32768.0f); } - - sVar8 += 0x1000; - sVar7 += -0x8000; - sVar6 += 500; - sVar5 += 0x2000; - sVar4 += 0x1F9C; } } @@ -323,7 +315,6 @@ static void so_break(obj_so_class* i_this) { /* 80CE1084-80CE12D8 000DA4 0254+00 1/1 0/0 0/0 .text so_hang__FP12obj_so_class */ static void so_hang(obj_so_class* i_this) { - // NONMATCHING fopAc_ac_c* a_this = &i_this->actor; fopAc_ac_c* actor = fopAcM_SearchByID(i_this->field_0x1b94); @@ -364,6 +355,9 @@ static void so_hang(obj_so_class* i_this) { dComIfGp_particle_levelEmitterOnEventMove(i_this->field_0x1b9c); dComIfGp_getVibration().StartShock(5, 1, cXyz(0.0f, 1.0f, 0.0f)); } + break; + case 3: + break; } } @@ -427,9 +421,12 @@ static void part_move(obj_so_class* i_this) { 0x82AD, }; - fopAc_ac_c* a_this = &i_this->actor; fopAc_ac_c* player = dComIfGp_getPlayer(0); + fopAc_ac_c* a_this = (fopAc_ac_c*)&i_this->actor; cXyz spec, spf8, sp104; + s16 tempCos; + s16 iVar16 = 0; + s16 iVar17 = 0; csXyz cStack_13c(0, 0, 0); dBgS_ObjGndChk cStack_e0; f32 fVar1; @@ -439,11 +436,12 @@ static void part_move(obj_so_class* i_this) { if (i_this->field_0x5fc[i] == 1) { if (i < 2) { if (i_this->field_0xc30[i] != 0) { - cLib_addCalcAngleS2(&i_this->field_0xa28[i].x, 0, 2, 300); - i_this->field_0xb94[i] += (s16)(cM_scos(i_this->field_0xa28[i].x) * 12000.0f); + cLib_addCalcAngleS2(&i_this->field_0xa28[i].x, NREG_S(7), 2, NREG_S(5) + 300); + tempCos = cM_scos(i_this->field_0xa28[i].x) * 12000.0f; + i_this->field_0xb94[i] += tempCos; } - fVar1 = fabsf(70.0f * cM_ssin(i_this->field_0xa28[i].x)) + 5.0f; + fVar1 = fabsf((BREG_F(0) + 70.0f) * cM_ssin(i_this->field_0xa28[i].x)) + 5.0f; } else if (i < 10) { cLib_addCalcAngleS2(&i_this->field_0xa28[i].y, i_this->field_0xbc8[i], 1, 0x800); if (i_this->field_0xc30[i] == 0) { @@ -452,8 +450,9 @@ static void part_move(obj_so_class* i_this) { cLib_addCalcAngleS2(&i_this->field_0xa28[i].x, -0x4000, 1, 0xC00); } - fVar1 = fabsf(110.0f * cM_ssin(i_this->field_0xa28[i].x)) + 5.0f; + fVar1 = fabsf((BREG_F(2) + 110.0f) * cM_scos(i_this->field_0xa28[i].x)) + 5.0f; } else { + fVar1 = 5.0f; cLib_addCalcAngleS2(&i_this->field_0xa28[i].y, i_this->field_0xbc8[i], 1, 0x800); if (i_this->field_0xc30[i] == 0) { i_this->field_0xa28[i].x += i_this->field_0xbfc[i]; @@ -462,7 +461,7 @@ static void part_move(obj_so_class* i_this) { } cLib_addCalcAngleS2(&i_this->field_0xb60[i], 0, 1, 0xC00); - fVar1 = fabsf(40.0f * cM_ssin(i_this->field_0xa28[i].x)) + 5.0f; + fVar1 = fabsf((BREG_F(3) + 40.0f) * cM_ssin(i_this->field_0xa28[i].x)) + 5.0f; } i_this->field_0x618[i] += i_this->field_0x8f0[i]; @@ -488,8 +487,8 @@ static void part_move(obj_so_class* i_this) { i_this->field_0x618[i].y = a_this->home.pos.y + fVar1; if (i_this->field_0x8f0[i].y < 0.0f && i_this->field_0xc30[i] < 3) { if (i_this->field_0xc30[i] == 0) { - fopAcM_effSmokeSet1(&i_this->field_0xc4c[i], &i_this->field_0xcb4[i], &i_this->field_0x618[i], - &cStack_13c, 1.0f, &a_this->tevStr, 0); + fopAcM_effSmokeSet2(&i_this->field_0xc4c[i], &i_this->field_0xcb4[i], &i_this->field_0x618[i], + &cStack_13c, TREG_F(19) + 1.0f, &a_this->tevStr); dComIfGp_particle_levelEmitterOnEventMove(i_this->field_0xc4c[i]); dComIfGp_particle_levelEmitterOnEventMove(i_this->field_0xcb4[i]); @@ -531,7 +530,7 @@ static void part_move(obj_so_class* i_this) { i_this->field_0x8f0[i].y = 5.0f; i_this->field_0xc30[i] = 1; - i_this->field_0xa28[i].x = cM_rndFX(500.0f) + 1024.0f; + i_this->field_0xa28[i].x = cM_rndFX(500.0f) + -1024.0f; } } } @@ -543,11 +542,11 @@ static void part_move(obj_so_class* i_this) { spec.x = i_this->field_0x618[i].x - i_this->field_0x618[j].x; spec.z = i_this->field_0x618[i].z - i_this->field_0x618[j].z; - if (JMAFastSqrt(spec.x * spec.x + spec.z * spec.z) < 180.0f) { + if (JMAFastSqrt(spec.x * spec.x + spec.z * spec.z) < BREG_F(9) + 180.0f) { cMtx_YrotS(*calc_mtx, cM_atan2s(spec.x, spec.z)); spec.x = 0.0f; spec.y = 0.0f; - spec.z = 180.0f; + spec.z = BREG_F(9) + 180.0f; MtxPosition(&spec, &spf8); i_this->field_0x618[i].x = i_this->field_0x618[j].x + spf8.x; i_this->field_0x618[i].z = i_this->field_0x618[j].z + spf8.z; @@ -556,16 +555,16 @@ static void part_move(obj_so_class* i_this) { } mDoMtx_stack_c::transS(i_this->field_0x618[i].x, i_this->field_0x618[i].y + i_this->field_0x750[i], i_this->field_0x618[i].z); - mDoMtx_stack_c::XrotM(i_this->field_0xdc2); + mDoMtx_stack_c::XrotM((s16)i_this->field_0xdc2); if (i == 0 || (i >= 10 && i <= 17)) { - mDoMtx_stack_c::YrotM(i_this->field_0xdb8); + mDoMtx_stack_c::YrotM((s16)i_this->field_0xdb8); mDoMtx_stack_c::XrotM(i_this->field_0xdb6); mDoMtx_stack_c::YrotM(-i_this->field_0xdb8); } if (i == 0) { - mDoMtx_stack_c::YrotM(i_this->field_0xb94[i]); + mDoMtx_stack_c::YrotM((s16)i_this->field_0xb94[i]); mDoMtx_stack_c::XrotM(i_this->field_0xdb6); } else if (i == 1) { mDoMtx_stack_c::YrotM(-i_this->field_0xb94[i]); @@ -591,9 +590,9 @@ static void part_move(obj_so_class* i_this) { if (i >= 2 && i < 10 && i_this->field_0x5fc[i] == 2) { sp104 = i_this->field_0x618[i]; if (i_this->field_0x1a98[i - 2] < 2) { - sp104.y += -80.0f; - i_this->field_0x10b8[i - 2].SetR(20.0f); - i_this->field_0x10b8[i - 2].SetH(165.0f); + sp104.y += XREG_F(5) + -80.0f; + i_this->field_0x10b8[i - 2].SetR(XREG_F(6) + 20.0f); + i_this->field_0x10b8[i - 2].SetH(XREG_F(7) + 165.0f); if (i_this->field_0x1056 == 0) { if (i_this->field_0x10b8[i - 2].ChkTgHit() != 0) { i_this->mAtInfo.mpCollider = i_this->field_0x10b8[i - 2].GetTgHitObj(); @@ -619,9 +618,9 @@ static void part_move(obj_so_class* i_this) { i_this->field_0x1ac0[i - 2] = i_this->field_0x618[i]; if (i_this->field_0x1a98[i - 2] >= 2) { i_this->field_0x1a98[i - 2] = 2; - i_this->field_0x1ac0[i - 2].y += -90.0f; + i_this->field_0x1ac0[i - 2].y += AREG_F(9) + -90.0f; } else { - i_this->field_0x1ac0[i - 2].y += -87.0f; + i_this->field_0x1ac0[i - 2].y += VREG_F(9) + -87.0f; } if (i_this->field_0x1a98[i - 2] == 2) { @@ -643,7 +642,7 @@ static void part_move(obj_so_class* i_this) { i_this->field_0x1b30[i - 2] = cM_rndFX(200.0f); } - cXyz sp110(0.3f, 0.3f, 0.3f); + cXyz sp110(AREG_F(19) + 0.3f, AREG_F(19) + 0.3f, AREG_F(19) + 0.3f); for (int j = 0; j < 3; j++) { dComIfGp_particle_set(e_id[j], &i_this->field_0x618[i], &a_this->shape_angle, &sp110); } @@ -657,11 +656,12 @@ static void part_move(obj_so_class* i_this) { if (i_this->field_0x1a98[i - 2] == 2) { spec = i_this->field_0x618[i] - player->current.pos; spec.y = 0.0f; - if (spec.abs() < 50.0f) { + f32 var_f30 = spec.abs(); + if (var_f30 < 50.0f) { cMtx_YrotS(*calc_mtx, cM_atan2s(spec.x, spec.z)); spec.x = 0.0f; spec.y = 0.0f; - spec.z = (50.0f - fVar1) * 100.0f; + spec.z = (50.0f - var_f30) * (JREG_F(0) + 100.0f); MtxPosition(&spec, &spf8); cLib_addCalcAngleS2(&i_this->field_0xa28[i].x, spf8.z, 2, 0x400); cLib_addCalcAngleS2(&i_this->field_0xa28[i].z, -spf8.x, 2, 0x400); @@ -671,17 +671,17 @@ static void part_move(obj_so_class* i_this) { i_this->field_0x1b40[i - 2]--; } - int iVar4 = (i_this->field_0x1b40[i - 2] * 700) * cM_ssin(i_this->field_0xdac * 0x1300); - u32 uVar8 = (i_this->field_0x1b40[i - 2] * 700) * cM_ssin(i_this->field_0xdac * 0x1800); - mDoMtx_stack_c::YrotM(uVar8); - mDoMtx_stack_c::XrotM(iVar4); - mDoMtx_stack_c::scaleM(1.0f, 0.45f, 1.0f); - mDoMtx_stack_c::transM(0.0f, -20.0f, 0.0f); - i_this->field_0x750[i] = 80.0f; + iVar16 = (i_this->field_0x1b40[i - 2] * 700) * cM_ssin(i_this->field_0xdac * 0x1300); + iVar17 = (i_this->field_0x1b40[i - 2] * 700) * cM_ssin(i_this->field_0xdac * 0x1800); + mDoMtx_stack_c::YrotM(iVar17); + mDoMtx_stack_c::XrotM(iVar16); + mDoMtx_stack_c::scaleM(1.0f, AREG_F(6) + 0.45f, 1.0f); + mDoMtx_stack_c::transM(0.0f, AREG_F(8) + -20.0f, 0.0f); + i_this->field_0x750[i] = AREG_F(7) + 80.0f; } else { - mDoMtx_stack_c::scaleM(1.0f, 0.5f, 1.0f); - mDoMtx_stack_c::transM(0.0f, -20.0f, 0.0f); - i_this->field_0x750[i] = 77.0f; + mDoMtx_stack_c::scaleM(1.0f, VREG_F(6) + 0.5f, 1.0f); + mDoMtx_stack_c::transM(0.0f, VREG_F(8) + -20.0f, 0.0f); + i_this->field_0x750[i] = VREG_F(7) + 77.0f; } } @@ -692,8 +692,8 @@ static void part_move(obj_so_class* i_this) { i_this->field_0x594[i]->setBaseTRMtx(mDoMtx_stack_c::get()); if (i <= 1 && fopAcM_GetRoomNo(a_this) == 2 && i_this->mBgW[i] != NULL && (i_this->field_0xc30[i] != 0 || i == 1)) { - mDoMtx_stack_c::transM(0.0f, -30.0f, 0.0f); - mDoMtx_stack_c::scaleM(1.0f, 8.0f, 1.0f); + mDoMtx_stack_c::transM(0.0f, KREG_F(6) + -30.0f, 0.0f); + mDoMtx_stack_c::scaleM(1.0f, KREG_F(7) + 8.0f, 1.0f); MTXCopy(mDoMtx_stack_c::get(), i_this->mBgMtx[i]); i_this->mBgW[i]->Move(); } @@ -701,15 +701,16 @@ static void part_move(obj_so_class* i_this) { } for (int i = 0; i < 8; i++) { - if (i_this->field_0x1a98[i - 2] != 0) { - if (i_this->field_0x1a98[i - 2] == 2) { + if (i_this->field_0x1a98[i] != 0) { + if (i_this->field_0x1a98[i] == 2) { spec = i_this->field_0x618[i + 2] - player->current.pos; spec.y = 0.0f; - if (spec.abs() < 50.0f) { + f32 var_f29 = spec.abs(); + if (var_f29 < 50.0f) { cMtx_YrotS(*calc_mtx, cM_atan2s(spec.x, spec.z)); spec.x = 0.0f; spec.y = 0.0f; - spec.z = (50.0f - fVar1) * 100.0f; + spec.z = (50.0f - var_f29) * (JREG_F(1) + 100.0f); MtxPosition(&spec, &spf8); cLib_addCalcAngleS2(&i_this->field_0x1b20[i], spec.z, 2, 0x400); cLib_addCalcAngleS2(&i_this->field_0x1b30[i], -spec.x, 2, 0x400); @@ -722,18 +723,18 @@ static void part_move(obj_so_class* i_this) { i_this->field_0x1b50[i]--; } - int iVar16 = (i_this->field_0x1b50[i] * 700) + cM_ssin(i_this->field_0xdac * 0x1500); - int iVar17 = (i_this->field_0x1b50[i] * 700) + cM_ssin(i_this->field_0xdac * 0x1200); + iVar16 = (i_this->field_0x1b50[i] * 700) * cM_ssin(i_this->field_0xdac * 0x1500); + iVar17 = (i_this->field_0x1b50[i] * 700) * cM_ssin(i_this->field_0xdac * 0x1200); mDoMtx_stack_c::XrotM(i_this->field_0x1b20[i] + iVar16); - mDoMtx_stack_c::ZrotM(i_this->field_0x1b30[i] + iVar17 + -0x8000); + mDoMtx_stack_c::ZrotM(i_this->field_0x1b30[i] + iVar17 + 0x8000); mDoMtx_stack_c::scaleM(i_this->field_0x7b8[i + 2].x, i_this->field_0x7b8[i + 2].y, i_this->field_0x7b8[i + 2].z); - if (i_this->field_0x1a98[i - 2] == 2) { - mDoMtx_stack_c::scaleM(1.0f, 0.45f, 1.0f); - mDoMtx_stack_c::transM(0.0f, -30.0f, 0.0f); + if (i_this->field_0x1a98[i] == 2) { + mDoMtx_stack_c::scaleM(1.0f, AREG_F(6) + 0.45f, 1.0f); + mDoMtx_stack_c::transM(0.0f, AREG_F(10) + -30.0f, 0.0f); } else { - mDoMtx_stack_c::scaleM(1.0f, 0.5f, 1.0f); - mDoMtx_stack_c::transM(0.0f, -30.0f, 0.0f); + mDoMtx_stack_c::scaleM(1.0f, VREG_F(6) + 0.5f, 1.0f); + mDoMtx_stack_c::transM(0.0f, VREG_F(10) + -30.0f, 0.0f); } i_this->field_0x1aa0[i]->setBaseTRMtx(mDoMtx_stack_c::get()); @@ -741,16 +742,17 @@ static void part_move(obj_so_class* i_this) { } if (i_this->field_0x1054 == 0) { + s8 sVar2 = 0; s8 sVar1 = 0; u32 uVar1 = 0; u32 uVar2 = 0; for (int i = 0; i < 8; i++) { if (i_this->field_0x1a98[i] == 2) { - s8 sVar2 = 0; + sVar2 = 0; for (int j = 1; j < 8; j++) { - if (i_this->field_0x1a98[j] == 2) { + if (i_this->field_0x1a98[(i + j) & 7] == 2) { sVar2++; - uVar1 &= 7; + uVar1 = (i + j) & 7; } else { sVar2 = 0; } @@ -760,6 +762,8 @@ static void part_move(obj_so_class* i_this) { sVar1 = sVar2; uVar2 = uVar1; } + } else { + sVar2 = 0; } } @@ -777,7 +781,7 @@ static void part_move(obj_so_class* i_this) { cXyz sp11c(i_this->field_0x618[uVar2 + 2] - a_this->current.pos); i_this->field_0xdbc = cM_atan2s(sp11c.x, sp11c.z); - i_this->field_0xdba = sVar1 * 500; + i_this->field_0xdba = sVar1 * (AREG_S(7) + 500); if (sVar1 == 7) { part_set(i_this, 1); @@ -790,15 +794,15 @@ static void part_move(obj_so_class* i_this) { i_this->field_0x750[i + 2] = 0.0f; } - i_this->field_0xdba = 0; - i_this->field_0xdb6 = 0; - i_this->field_0xdbc = 0; - i_this->field_0xdb8 = 0; + i_this->field_0xdb8 = i_this->field_0xdbc = i_this->field_0xdb6 = i_this->field_0xdba = 0; - if (dStage_stagInfo_GetSTType(dComIfGp_getStage()->getStagInfo()) == 0) { - dComIfGs_onSwitch(fopAcM_GetParam(a_this) >> 24, fopAcM_GetRoomNo(a_this)); + stage_stag_info_class* info = dComIfGp_getStage()->getStagInfo(); + if (dStage_stagInfo_GetSTType(info) == 0) { + int sw = ((fopAcM_GetParam(a_this) & 0xff000000) >> 24); + dComIfGs_onSwitch(sw, fopAcM_GetRoomNo(a_this)); } else { - dComIfGs_onSwitch(fopAcM_GetParam(a_this) >> 16, fopAcM_GetRoomNo(a_this)); + int sw = (fopAcM_GetParam(a_this) & 0xff0000) >> 16; + dComIfGs_onSwitch(sw, fopAcM_GetRoomNo(a_this)); } } }