From 88cbbead876100fe4ea0e67e6f83487346534406 Mon Sep 17 00:00:00 2001 From: Pheenoh Date: Tue, 14 Feb 2023 18:51:00 -0700 Subject: [PATCH] d_a_kytag17 (#284) --- Progress.md | 8 +- .../daKytag17_Create__FP10fopAc_ac_c.s | 29 ----- .../rel/d/a/kytag/d_a_kytag17/d_a_kytag17.h | 7 + rel/d/a/kytag/d_a_kytag17/d_a_kytag17.cpp | 120 ++++++++---------- 4 files changed, 62 insertions(+), 102 deletions(-) delete mode 100644 asm/rel/d/a/kytag/d_a_kytag17/d_a_kytag17/daKytag17_Create__FP10fopAc_ac_c.s diff --git a/Progress.md b/Progress.md index ac380b0e12b..185bee4c087 100644 --- a/Progress.md +++ b/Progress.md @@ -21,8 +21,8 @@ Total | 32.316787% | 1299352 | 4020672 Section | Percentage | Decompiled (bytes) | Total (bytes) ---|---|---|--- main.dol | 32.316787% | 1299352 | 4020672 -RELs | 33.191934% | 3817180 | 11500324 -Total | 32.965230% | 5116532 | 15520996 +RELs | 33.192839% | 3817284 | 11500324 +Total | 32.965900% | 5116636 | 15520996 ## RELs @@ -208,7 +208,7 @@ d_a_kytag13 | 30.696576% | 2080 | 6776 d_a_kytag14 | 100.000000% | 1408 | 1408 d_a_kytag15 | 49.443561% | 1244 | 2516 d_a_kytag16 | 47.212544% | 1084 | 2296 -d_a_kytag17 | 86.170213% | 648 | 752 +d_a_kytag17 | 100.000000% | 752 | 752 d_a_mant | 86.020312% | 40316 | 46868 d_a_mg_fish | 26.024167% | 17660 | 67860 d_a_mg_fshop | 36.363636% | 9360 | 25740 @@ -785,4 +785,4 @@ d_a_vrbox2 | 34.977578% | 2184 | 6244 d_a_warp_bug | 54.940711% | 1112 | 2024 d_a_ykgr | 44.400631% | 2252 | 5072 f_pc_profile_lst | 100.000000% | 28156 | 28156 -Total | 33.191934% | 3817180 | 11500324 +Total | 33.192839% | 3817284 | 11500324 diff --git a/asm/rel/d/a/kytag/d_a_kytag17/d_a_kytag17/daKytag17_Create__FP10fopAc_ac_c.s b/asm/rel/d/a/kytag/d_a_kytag17/d_a_kytag17/daKytag17_Create__FP10fopAc_ac_c.s deleted file mode 100644 index 0b48a7f185e..00000000000 --- a/asm/rel/d/a/kytag/d_a_kytag17/d_a_kytag17/daKytag17_Create__FP10fopAc_ac_c.s +++ /dev/null @@ -1,29 +0,0 @@ -lbl_8046DB78: -/* 8046DB78 94 21 FF F0 */ stwu r1, -0x10(r1) -/* 8046DB7C 7C 08 02 A6 */ mflr r0 -/* 8046DB80 90 01 00 14 */ stw r0, 0x14(r1) -/* 8046DB84 93 E1 00 0C */ stw r31, 0xc(r1) -/* 8046DB88 7C 7F 1B 78 */ mr r31, r3 -/* 8046DB8C 80 03 04 A0 */ lwz r0, 0x4a0(r3) -/* 8046DB90 54 00 07 39 */ rlwinm. r0, r0, 0, 0x1c, 0x1c -/* 8046DB94 40 82 00 1C */ bne lbl_8046DBB0 -/* 8046DB98 28 1F 00 00 */ cmplwi r31, 0 -/* 8046DB9C 41 82 00 08 */ beq lbl_8046DBA4 -/* 8046DBA0 4B BA AF C5 */ bl __ct__10fopAc_ac_cFv -lbl_8046DBA4: -/* 8046DBA4 80 1F 04 A0 */ lwz r0, 0x4a0(r31) -/* 8046DBA8 60 00 00 08 */ ori r0, r0, 8 -/* 8046DBAC 90 1F 04 A0 */ stw r0, 0x4a0(r31) -lbl_8046DBB0: -/* 8046DBB0 80 1F 00 B0 */ lwz r0, 0xb0(r31) -/* 8046DBB4 98 1F 05 68 */ stb r0, 0x568(r31) -/* 8046DBB8 88 1F 05 68 */ lbz r0, 0x568(r31) -/* 8046DBBC 3C 60 80 43 */ lis r3, g_env_light@ha /* 0x8042CA54@ha */ -/* 8046DBC0 38 63 CA 54 */ addi r3, r3, g_env_light@l /* 0x8042CA54@l */ -/* 8046DBC4 98 03 13 08 */ stb r0, 0x1308(r3) -/* 8046DBC8 38 60 00 04 */ li r3, 4 -/* 8046DBCC 83 E1 00 0C */ lwz r31, 0xc(r1) -/* 8046DBD0 80 01 00 14 */ lwz r0, 0x14(r1) -/* 8046DBD4 7C 08 03 A6 */ mtlr r0 -/* 8046DBD8 38 21 00 10 */ addi r1, r1, 0x10 -/* 8046DBDC 4E 80 00 20 */ blr diff --git a/include/rel/d/a/kytag/d_a_kytag17/d_a_kytag17.h b/include/rel/d/a/kytag/d_a_kytag17/d_a_kytag17.h index b1c41a0acf9..1f8582a662c 100644 --- a/include/rel/d/a/kytag/d_a_kytag17/d_a_kytag17.h +++ b/include/rel/d/a/kytag/d_a_kytag17/d_a_kytag17.h @@ -2,5 +2,12 @@ #define D_A_KYTAG17_H #include "dolphin/types.h" +#include "f_op/f_op_actor_mng.h" + + +class kytag17_class : public fopAc_ac_c { +public: + /* 0x568 */ u8 mParameters; +}; #endif /* D_A_KYTAG17_H */ diff --git a/rel/d/a/kytag/d_a_kytag17/d_a_kytag17.cpp b/rel/d/a/kytag/d_a_kytag17/d_a_kytag17.cpp index 0468da26a0d..96ccbd9fe42 100644 --- a/rel/d/a/kytag/d_a_kytag17/d_a_kytag17.cpp +++ b/rel/d/a/kytag/d_a_kytag17/d_a_kytag17.cpp @@ -1,97 +1,79 @@ -// -// Generated By: dol2asm -// Translation Unit: d_a_kytag17 -// +/** + * d_a_kytag17.cpp + * Environment Tag 17 + */ #include "rel/d/a/kytag/d_a_kytag17/d_a_kytag17.h" #include "dol2asm.h" #include "dolphin/types.h" - -// -// Types: -// - -struct kytag17_class {}; - -struct fopAc_ac_c { - /* 80018B64 */ fopAc_ac_c(); -}; - -// -// Forward References: -// - -extern "C" static bool daKytag17_Draw__FP13kytag17_class(); -extern "C" static bool daKytag17_Execute__FP13kytag17_class(); -extern "C" static bool daKytag17_IsDelete__FP13kytag17_class(); -extern "C" static bool daKytag17_Delete__FP13kytag17_class(); -extern "C" static void daKytag17_Create__FP10fopAc_ac_c(); -extern "C" extern void* g_profile_KYTAG17[12]; - -// -// External References: -// - -extern "C" void __ct__10fopAc_ac_cFv(); -extern "C" extern void* g_fopAc_Method[8]; -extern "C" extern void* g_fpcLf_Method[5 + 1 /* padding */]; -extern "C" extern u8 g_env_light[4880]; - -// -// Declarations: -// +#include "d/kankyo/d_kankyo.h" +#include "d/d_procname.h" /* 8046DB58-8046DB60 000078 0008+00 1/0 0/0 0/0 .text daKytag17_Draw__FP13kytag17_class */ -static bool daKytag17_Draw(kytag17_class* param_0) { - return true; +static int daKytag17_Draw(kytag17_class* i_this) { + return 1; } /* 8046DB60-8046DB68 000080 0008+00 1/0 0/0 0/0 .text daKytag17_Execute__FP13kytag17_class */ -static bool daKytag17_Execute(kytag17_class* param_0) { - return true; +static int daKytag17_Execute(kytag17_class* i_this) { + return 1; } /* 8046DB68-8046DB70 000088 0008+00 1/0 0/0 0/0 .text daKytag17_IsDelete__FP13kytag17_class */ -static bool daKytag17_IsDelete(kytag17_class* param_0) { - return true; +static int daKytag17_IsDelete(kytag17_class* i_this) { + return 1; } /* 8046DB70-8046DB78 000090 0008+00 1/0 0/0 0/0 .text daKytag17_Delete__FP13kytag17_class */ -static bool daKytag17_Delete(kytag17_class* param_0) { - return true; +static int daKytag17_Delete(kytag17_class* i_this) { + return 1; } /* 8046DB78-8046DBE0 000098 0068+00 1/0 0/0 0/0 .text daKytag17_Create__FP10fopAc_ac_c */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void daKytag17_Create(fopAc_ac_c* param_0) { - nofralloc -#include "asm/rel/d/a/kytag/d_a_kytag17/d_a_kytag17/daKytag17_Create__FP10fopAc_ac_c.s" +static int daKytag17_Create(fopAc_ac_c* i_this) { + kytag17_class* kytag17 = (kytag17_class*)i_this; + + if (!fopAcM_CheckCondition(kytag17, 8)) { + new (kytag17) kytag17_class(); + fopAcM_OnCondition(kytag17, 8); + } + + kytag17->mParameters = fopAcM_GetParam(kytag17); + g_env_light.field_0x1308 = kytag17->mParameters; + return cPhs_COMPLEATE_e; } -#pragma pop /* ############################################################################################## */ /* 8046DBE8-8046DC08 -00001 0020+00 1/0 0/0 0/0 .data l_daKytag17_Method */ -SECTION_DATA static void* l_daKytag17_Method[8] = { - (void*)daKytag17_Create__FP10fopAc_ac_c, - (void*)daKytag17_Delete__FP13kytag17_class, - (void*)daKytag17_Execute__FP13kytag17_class, - (void*)daKytag17_IsDelete__FP13kytag17_class, - (void*)daKytag17_Draw__FP13kytag17_class, - (void*)NULL, - (void*)NULL, - (void*)NULL, +static actor_method_class l_daKytag17_Method = { + (process_method_func)daKytag17_Create, + (process_method_func)daKytag17_Delete, + (process_method_func)daKytag17_Execute, + (process_method_func)daKytag17_IsDelete, + (process_method_func)daKytag17_Draw }; /* 8046DC08-8046DC38 -00001 0030+00 0/0 0/0 1/0 .data g_profile_KYTAG17 */ -SECTION_DATA extern void* g_profile_KYTAG17[12] = { - (void*)0xFFFFFFFD, (void*)0x0007FFFD, - (void*)0x02BB0000, (void*)&g_fpcLf_Method, - (void*)0x0000056C, (void*)NULL, - (void*)NULL, (void*)&g_fopAc_Method, - (void*)0x006F0000, (void*)&l_daKytag17_Method, - (void*)0x00044000, (void*)NULL, +extern actor_process_profile_definition g_profile_KYTAG17 = { + -3, // mLayerID + 7, // mListID + -3, // mListPrio + PROC_KYTAG17, // mProcName + 0, // padding + &g_fpcLf_Method.mBase, // mSubMtd + sizeof(kytag17_class), // mSize + 0, // mSizeOther + 0, // mParameters + &g_fopAc_Method.base, // mSubMtd + 0x006F, // mPriority + 0, // padding + 0, // padding + &l_daKytag17_Method, // mSubMtd + 0x00044000, // mStatus + 0, // mActorType + 0, // mCullType + 0, // padding + 0 // padding };