d_a_tag_gra OK, d_a_suspend work (#286)

This commit is contained in:
Pheenoh 2023-02-14 23:37:09 -07:00 committed by GitHub
parent 88cbbead87
commit 82ff815386
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 131 additions and 186 deletions

View File

@ -21,8 +21,8 @@ Total | 32.316787% | 1299352 | 4020672
Section | Percentage | Decompiled (bytes) | Total (bytes)
---|---|---|---
main.dol | 32.316787% | 1299352 | 4020672
RELs | 33.192839% | 3817284 | 11500324
Total | 32.965900% | 5116636 | 15520996
RELs | 33.195239% | 3817560 | 11500324
Total | 32.967678% | 5116912 | 15520996
## RELs
@ -697,7 +697,7 @@ d_a_skip_2D | 100.000000% | 1332 | 1332
d_a_spinner | 27.874187% | 5140 | 18440
d_a_sq | 35.488722% | 3776 | 10640
d_a_startAndGoal | 41.918528% | 1276 | 3044
d_a_suspend | 68.303571% | 612 | 896
d_a_suspend | 77.678571% | 696 | 896
d_a_swBall | 33.297414% | 1236 | 3712
d_a_swLBall | 33.651805% | 1268 | 3768
d_a_swTime | 63.076923% | 656 | 1040
@ -725,7 +725,7 @@ d_a_tag_evt | 37.815126% | 1620 | 4284
d_a_tag_evtarea | 37.091319% | 1316 | 3548
d_a_tag_evtmsg | 39.491150% | 1428 | 3616
d_a_tag_firewall | 35.325132% | 1608 | 4552
d_a_tag_gra | 76.000000% | 608 | 800
d_a_tag_gra | 100.000000% | 800 | 800
d_a_tag_gstart | 100.000000% | 1208 | 1208
d_a_tag_guard | 100.000000% | 1176 | 1176
d_a_tag_hinit | 100.000000% | 1440 | 1440
@ -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.192839% | 3817284 | 11500324
Total | 33.195239% | 3817560 | 11500324

View File

@ -1,24 +0,0 @@
lbl_804D51E0:
/* 804D51E0 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 804D51E4 7C 08 02 A6 */ mflr r0
/* 804D51E8 90 01 00 14 */ stw r0, 0x14(r1)
/* 804D51EC 93 E1 00 0C */ stw r31, 0xc(r1)
/* 804D51F0 7C 7F 1B 78 */ mr r31, r3
/* 804D51F4 80 03 04 A0 */ lwz r0, 0x4a0(r3)
/* 804D51F8 54 00 07 39 */ rlwinm. r0, r0, 0, 0x1c, 0x1c
/* 804D51FC 40 82 00 1C */ bne lbl_804D5218
/* 804D5200 28 1F 00 00 */ cmplwi r31, 0
/* 804D5204 41 82 00 08 */ beq lbl_804D520C
/* 804D5208 4B B4 39 5D */ bl __ct__10fopAc_ac_cFv
lbl_804D520C:
/* 804D520C 80 1F 04 A0 */ lwz r0, 0x4a0(r31)
/* 804D5210 60 00 00 08 */ ori r0, r0, 8
/* 804D5214 90 1F 04 A0 */ stw r0, 0x4a0(r31)
lbl_804D5218:
/* 804D5218 7F E3 FB 78 */ mr r3, r31
/* 804D521C 4B FF FE FD */ bl create__7daSus_cFv
/* 804D5220 83 E1 00 0C */ lwz r31, 0xc(r1)
/* 804D5224 80 01 00 14 */ lwz r0, 0x14(r1)
/* 804D5228 7C 08 03 A6 */ mtlr r0
/* 804D522C 38 21 00 10 */ addi r1, r1, 0x10
/* 804D5230 4E 80 00 20 */ blr

View File

@ -1,41 +0,0 @@
lbl_80D59658:
/* 80D59658 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 80D5965C 7C 08 02 A6 */ mflr r0
/* 80D59660 90 01 00 14 */ stw r0, 0x14(r1)
/* 80D59664 93 E1 00 0C */ stw r31, 0xc(r1)
/* 80D59668 7C 7F 1B 78 */ mr r31, r3
/* 80D5966C 80 03 04 A0 */ lwz r0, 0x4a0(r3)
/* 80D59670 54 00 07 39 */ rlwinm. r0, r0, 0, 0x1c, 0x1c
/* 80D59674 40 82 00 1C */ bne lbl_80D59690
/* 80D59678 28 1F 00 00 */ cmplwi r31, 0
/* 80D5967C 41 82 00 08 */ beq lbl_80D59684
/* 80D59680 4B 2B F4 E5 */ bl __ct__10fopAc_ac_cFv
lbl_80D59684:
/* 80D59684 80 1F 04 A0 */ lwz r0, 0x4a0(r31)
/* 80D59688 60 00 00 08 */ ori r0, r0, 8
/* 80D5968C 90 1F 04 A0 */ stw r0, 0x4a0(r31)
lbl_80D59690:
/* 80D59690 80 9F 00 B0 */ lwz r4, 0xb0(r31)
/* 80D59694 54 80 C6 3E */ rlwinm r0, r4, 0x18, 0x18, 0x1f
/* 80D59698 7C 00 07 34 */ extsh r0, r0
/* 80D5969C 2C 00 00 02 */ cmpwi r0, 2
/* 80D596A0 40 82 00 30 */ bne lbl_80D596D0
/* 80D596A4 3C 60 80 40 */ lis r3, g_dComIfG_gameInfo@ha /* 0x804061C0@ha */
/* 80D596A8 38 63 61 C0 */ addi r3, r3, g_dComIfG_gameInfo@l /* 0x804061C0@l */
/* 80D596AC 54 80 86 3E */ rlwinm r0, r4, 0x10, 0x18, 0x1f
/* 80D596B0 7C 04 07 34 */ extsh r4, r0
/* 80D596B4 88 1F 04 E2 */ lbz r0, 0x4e2(r31)
/* 80D596B8 7C 05 07 74 */ extsb r5, r0
/* 80D596BC 4B 2D BC A5 */ bl isSwitch__10dSv_info_cCFii
/* 80D596C0 2C 03 00 00 */ cmpwi r3, 0
/* 80D596C4 41 82 00 0C */ beq lbl_80D596D0
/* 80D596C8 38 60 00 05 */ li r3, 5
/* 80D596CC 48 00 00 08 */ b lbl_80D596D4
lbl_80D596D0:
/* 80D596D0 38 60 00 04 */ li r3, 4
lbl_80D596D4:
/* 80D596D4 83 E1 00 0C */ lwz r31, 0xc(r1)
/* 80D596D8 80 01 00 14 */ lwz r0, 0x14(r1)
/* 80D596DC 7C 08 03 A6 */ mtlr r0
/* 80D596E0 38 21 00 10 */ addi r1, r1, 0x10
/* 80D596E4 4E 80 00 20 */ blr

View File

@ -1,14 +0,0 @@
lbl_80D596E8:
/* 80D596E8 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 80D596EC 7C 08 02 A6 */ mflr r0
/* 80D596F0 90 01 00 14 */ stw r0, 0x14(r1)
/* 80D596F4 28 03 00 00 */ cmplwi r3, 0
/* 80D596F8 41 82 00 0C */ beq lbl_80D59704
/* 80D596FC 38 80 00 00 */ li r4, 0
/* 80D59700 4B 2B F5 8D */ bl __dt__10fopAc_ac_cFv
lbl_80D59704:
/* 80D59704 38 60 00 01 */ li r3, 1
/* 80D59708 80 01 00 14 */ lwz r0, 0x14(r1)
/* 80D5970C 7C 08 03 A6 */ mtlr r0
/* 80D59710 38 21 00 10 */ addi r1, r1, 0x10
/* 80D59714 4E 80 00 20 */ blr

View File

@ -2,5 +2,34 @@
#define D_A_SUSPEND_H
#include "dolphin/types.h"
#include "f_op/f_op_actor_mng.h"
class daSus_c : public fopAc_ac_c {
public:
u32 getScale() {
return fopAcM_GetParam(this) >> 0x1E;
}
u8 getArg1() {
return (fopAcM_GetParam(this) >> 9) & 1;
}
u8 getArg0() {
return (fopAcM_GetParam(this) >> 8) & 1;
}
u8 getSw() {
return fopAcM_GetParam(this) & 0xFF;
}
u8 getRoom() {
return fopAcM_GetParam(this) >> 10;
}
/* 80031248 */ void newData(s8, cXyz const&, cXyz const&, u8, u8, u8);
/* 804D5118 */ int create();
};
#endif /* D_A_SUSPEND_H */

View File

@ -2,5 +2,32 @@
#define D_A_TAG_GRA_H
#include "dolphin/types.h"
#include "f_op/f_op_actor_mng.h"
#include "d/com/d_com_inf_game.h"
class daTagGra_c : public fopAc_ac_c {
public:
s16 getMode() {
return (fopAcM_GetParam(this) >> 8) & 0xFF;
}
s16 getSwBit() {
return (fopAcM_GetParam(this) >> 16) & 0xFF;
}
int create() {
if (!fopAcM_CheckCondition(this, 8)) {
new (this) daTagGra_c();
fopAcM_OnCondition(this, 8);
}
if (getMode() == 2) {
if (dComIfGs_isSwitch(getSwBit(),fopAcM_GetRoomNo(this))) {
return cPhs_ERROR_e;
}
}
return cPhs_COMPLEATE_e;
}
};
#endif /* D_A_TAG_GRA_H */

View File

@ -7,21 +7,6 @@
#include "dol2asm.h"
#include "dolphin/types.h"
//
// Types:
//
struct fopAc_ac_c {
/* 80018B64 */ fopAc_ac_c();
};
struct cXyz {};
struct daSus_c {
/* 80031248 */ void newData(s8, cXyz const&, cXyz const&, u8, u8, u8);
/* 804D5118 */ void create();
};
//
// Forward References:
//
@ -36,12 +21,6 @@ extern "C" extern void* g_profile_SUSPEND[12];
extern "C" void __ct__10fopAc_ac_cFv();
extern "C" void newData__7daSus_cFScRC4cXyzRC4cXyzUcUcUc();
extern "C" extern void* g_fopAc_Method[8];
extern "C" extern void* g_fpcLf_Method[5 + 1 /* padding */];
//
// Declarations:
//
/* ############################################################################################## */
/* 804D523C-804D5240 000000 0004+00 1/1 0/0 0/0 .rodata @3640 */
@ -70,25 +49,52 @@ COMPILER_STRIP_GATE(0x804D5248, &lit_3643);
#pragma pop
/* 804D5118-804D51E0 000078 00C8+00 1/1 0/0 0/0 .text create__7daSus_cFv */
#ifdef NONMATCHING
// missing mr instruction
int daSus_c::create() {
daSus_c* suspend = static_cast<daSus_c*>(this);
s8 roomNo = fopAcM_GetRoomNo(suspend);
if (roomNo < 0) {
roomNo = suspend->getRoom();
}
u8 sw = suspend->getSw();
u8 arg0 = suspend->getArg0();
u8 arg1 = suspend->getArg1();
if (suspend->getScale() != 0) {
mScale.x *= 1250.0f;
mScale.y *= 2500.0f;
mScale.z *= 1250.0f;
} else {
mScale.x *= 125.0f;
mScale.y *= 250.0f;
mScale.z *= 125.0f;
}
newData(roomNo,current.pos,mScale,sw,arg0,arg1);
return cPhs_COMPLEATE_e;
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void daSus_c::create() {
asm int daSus_c::create() {
nofralloc
#include "asm/rel/d/a/d_a_suspend/d_a_suspend/create__7daSus_cFv.s"
}
#pragma pop
#endif
/* 804D51E0-804D5234 000140 0054+00 1/0 0/0 0/0 .text daSus_create__FP7daSus_c */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
static asm void daSus_create(daSus_c* param_0) {
nofralloc
#include "asm/rel/d/a/d_a_suspend/d_a_suspend/daSus_create__FP7daSus_c.s"
static int daSus_create(daSus_c* i_this) {
if (!fopAcM_CheckCondition(i_this, 8)) {
new (i_this) daSus_c();
fopAcM_OnCondition(i_this, 8);
}
return i_this->create();
}
#pragma pop
/* ############################################################################################## */
/* 804D524C-804D526C -00001 0020+00 1/0 0/0 0/0 .data daSus_METHODS */
SECTION_DATA static void* daSus_METHODS[8] = {

View File

@ -1,89 +1,51 @@
//
// Generated By: dol2asm
// Translation Unit: d_a_tag_gra
//
/**
* d_a_tag_gra.cpp
*
*/
#include "rel/d/a/tag/d_a_tag_gra/d_a_tag_gra.h"
#include "dol2asm.h"
#include "dolphin/types.h"
//
// Types:
//
struct fopAc_ac_c {
/* 80018B64 */ fopAc_ac_c();
/* 80018C8C */ ~fopAc_ac_c();
};
struct daTagGra_c {};
struct dSv_info_c {
/* 80035360 */ void isSwitch(int, int) const;
};
//
// Forward References:
//
extern "C" static void daTagGra_Create__FP10fopAc_ac_c();
extern "C" static void daTagGra_Delete__FP10daTagGra_c();
extern "C" extern void* g_profile_TAG_GRA[12];
//
// External References:
//
extern "C" void __ct__10fopAc_ac_cFv();
extern "C" void __dt__10fopAc_ac_cFv();
extern "C" void isSwitch__10dSv_info_cCFii();
extern "C" extern void* g_fopAc_Method[8];
extern "C" extern void* g_fpcLf_Method[5 + 1 /* padding */];
extern "C" extern u8 g_dComIfG_gameInfo[122384];
//
// Declarations:
//
#include "d/d_procname.h"
/* 80D59658-80D596E8 000078 0090+00 1/0 0/0 0/0 .text daTagGra_Create__FP10fopAc_ac_c */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
static asm void daTagGra_Create(fopAc_ac_c* param_0) {
nofralloc
#include "asm/rel/d/a/tag/d_a_tag_gra/d_a_tag_gra/daTagGra_Create__FP10fopAc_ac_c.s"
static int daTagGra_Create(fopAc_ac_c* i_this) {
daTagGra_c* gra_tag = (daTagGra_c*)i_this;
return gra_tag->create();
}
#pragma pop
/* 80D596E8-80D59718 000108 0030+00 1/0 0/0 0/0 .text daTagGra_Delete__FP10daTagGra_c */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
static asm void daTagGra_Delete(daTagGra_c* param_0) {
nofralloc
#include "asm/rel/d/a/tag/d_a_tag_gra/d_a_tag_gra/daTagGra_Delete__FP10daTagGra_c.s"
static int daTagGra_Delete(daTagGra_c* i_this) {
i_this->~daTagGra_c();
return 1;
}
#pragma pop
/* ############################################################################################## */
/* 80D59720-80D59740 -00001 0020+00 1/0 0/0 0/0 .data l_daTagGra_Method */
SECTION_DATA static void* l_daTagGra_Method[8] = {
(void*)daTagGra_Create__FP10fopAc_ac_c,
(void*)daTagGra_Delete__FP10daTagGra_c,
(void*)NULL,
(void*)NULL,
(void*)NULL,
(void*)NULL,
(void*)NULL,
(void*)NULL,
static actor_method_class l_daTagGra_Method = {
(process_method_func)daTagGra_Create,
(process_method_func)daTagGra_Delete
};
/* 80D59740-80D59770 -00001 0030+00 0/0 0/0 1/0 .data g_profile_TAG_GRA */
SECTION_DATA extern void* g_profile_TAG_GRA[12] = {
(void*)0xFFFFFFFD, (void*)0x0003FFFD,
(void*)0x00220000, (void*)&g_fpcLf_Method,
(void*)0x00000568, (void*)NULL,
(void*)NULL, (void*)&g_fopAc_Method,
(void*)0x00140000, (void*)&l_daTagGra_Method,
(void*)0x00040000, (void*)0x000E0000,
extern actor_process_profile_definition g_profile_TAG_GRA = {
-3, // mLayerID
3, // mListID
-3, // mListPrio
PROC_TAG_GRA, // mProcName
0, // padding
&g_fpcLf_Method.mBase, // mSubMtd
sizeof(daTagGra_c), // mSize
0, // mSizeOther
0, // mParameters
&g_fopAc_Method.base, // mSubMtd
0x0014, // mPriority
0, // padding
0, // padding
&l_daTagGra_Method, // mSubMtd
0x00040000, // mStatus
0, // mActorType
0x0E, // mCullType
0, // padding
0 // padding
};