diff --git a/include/d/d_com/d_com_inf_game/asm/func_8002B22C.s b/include/d/d_com/d_com_inf_game/asm/func_8002B22C.s index 3e1d245934d..75118765df9 100644 --- a/include/d/d_com/d_com_inf_game/asm/func_8002B22C.s +++ b/include/d/d_com/d_com_inf_game/asm/func_8002B22C.s @@ -22,7 +22,7 @@ lbl_8002B260: /* 8002B27C 000281BC 3C 60 80 40 */ lis r3, g_dComIfG_gameInfo@ha /* 8002B280 000281C0 38 63 61 C0 */ addi r3, r3, g_dComIfG_gameInfo@l /* 8002B284 000281C4 38 63 4E C4 */ addi r3, r3, 0x4ec4 -/* 8002B288 000281C8 4B FF 90 B1 */ bl dStage_roomControl_c_NS_initZone +/* 8002B288 000281C8 4B FF 90 B1 */ bl init__20dStage_roomControl_cFvZone lbl_8002B28C: /* 8002B28C 000281CC 38 00 00 00 */ li r0, 0 /* 8002B290 000281D0 98 1F 4F 51 */ stb r0, 0x4f51(r31) diff --git a/include/d/d_stage/asm/func_800241E8.s b/include/d/d_stage/asm/func_800241E8.s index 77b525350f5..04affba7ee9 100644 --- a/include/d/d_stage/asm/func_800241E8.s +++ b/include/d/d_stage/asm/func_800241E8.s @@ -18,7 +18,7 @@ /* 8002422C 0002116C 2C 00 FF FC */ cmpwi r0, -4 /* 80024230 00021170 40 82 00 08 */ bne lbl_80024238 lbl_80024234: -/* 80024234 00021174 48 00 01 05 */ bl dStage_roomControl_c_NS_initZone +/* 80024234 00021174 48 00 01 05 */ bl init__20dStage_roomControl_cFvZone lbl_80024238: /* 80024238 00021178 3C 60 80 3F */ lis r3, lbl_803F6094@ha /* 8002423C 0002117C 3B E3 60 94 */ addi r31, r3, lbl_803F6094@l diff --git a/include/d/d_stage/asm/func_80026CDC.s b/include/d/d_stage/asm/func_80026CDC.s index 6d8cb591df7..567e8a628b9 100644 --- a/include/d/d_stage/asm/func_80026CDC.s +++ b/include/d/d_stage/asm/func_80026CDC.s @@ -11,7 +11,7 @@ /* 80026D04 00023C44 3C 60 80 40 */ lis r3, g_dComIfG_gameInfo@ha /* 80026D08 00023C48 3B E3 61 C0 */ addi r31, r3, g_dComIfG_gameInfo@l /* 80026D0C 00023C4C 38 7F 4E C4 */ addi r3, r31, 0x4ec4 -/* 80026D10 00023C50 4B FF D4 D9 */ bl dStage_roomControl_c_NS_init +/* 80026D10 00023C50 4B FF D4 D9 */ bl init__20dStage_roomControl_cFv /* 80026D14 00023C54 7F C3 F3 78 */ mr r3, r30 /* 80026D18 00023C58 38 9F 4E 20 */ addi r4, r31, 0x4e20 /* 80026D1C 00023C5C 4B FF FC 25 */ bl dStage_dt_c_stageInitLoader diff --git a/include/d/d_stage/asm/func_8002824C.s b/include/d/d_stage/asm/func_8002824C.s index 8660a32e0fd..553f287b849 100644 --- a/include/d/d_stage/asm/func_8002824C.s +++ b/include/d/d_stage/asm/func_8002824C.s @@ -5,7 +5,7 @@ /* 8002825C 0002519C 3C 60 80 3F */ lis r3, lbl_803F4E68@ha /* 80028260 000251A0 3B E3 4E 68 */ addi r31, r3, lbl_803F4E68@l /* 80028264 000251A4 38 7F 00 0C */ addi r3, r31, 0xc -/*.global stage_tgsc_data_class*/ +/*.global stage_tgsc_data_class /* 80028268 000251A8 3C 80 80 03 */ lis r4, stage_tgsc_data_class@ha /*.global stage_tgsc_data_class*/ /* 8002826C 000251AC 38 84 84 B8 */ addi r4, r4, stage_tgsc_data_class@l diff --git a/include/d/d_stage/d_stage.h b/include/d/d_stage/d_stage.h index 14894bb3c6e..c193d5cae5a 100644 --- a/include/d/d_stage/d_stage.h +++ b/include/d/d_stage/d_stage.h @@ -62,6 +62,8 @@ class dStage_Lbnk_c {}; class stage_pure_lightvec_info_class {}; +class stage_tgsc_data_class {}; + class dStage_stageDt_c { public: stage_camera_class* getCamera(void) const; @@ -336,6 +338,8 @@ private: #pragma pack(push, 1) class dStage_roomControl_c { public: + void init(void); + private: u8 field_0x0[164]; }; @@ -344,7 +348,8 @@ private: #pragma pack(push, 1) class dStage_nextStage_c { public: -void set(const char*, s8, s16, s8, s8, u8); + void set(const char*, s8, s16, s8, s8, u8); + private: u8 field_0x0; u8 field_0x1; @@ -369,7 +374,8 @@ private: #pragma pack(push, 1) class dStage_startStage_c { public: -void set(const char*, s8, s16, s8); + void set(const char*, s8, s16, s8); + private: /* 0x0 */ char mStage[8]; /* 0x8 */ s16 mPoint; @@ -379,4 +385,10 @@ private: }; #pragma pack(pop) +extern u32* lbl_803F4E74; + +extern "C" { +void init__20dStage_roomControl_cFv(void); +} + #endif \ No newline at end of file diff --git a/include/functions.h b/include/functions.h index 150d9721f1e..fbf19cbe31a 100644 --- a/include/functions.h +++ b/include/functions.h @@ -141,7 +141,7 @@ void func_80362540(void); void dDlst_list_c_NS_set(void); void init__14dComIfG_play_cFv(void); void* memset(void* dest, int ch, u32 count); -void dStage_roomControl_c_NS_initZone(void); +void init__20dStage_roomControl_cFvZone(void); void JUTWarningConsole(void); void JUTConsole_NS_print(void); void JUTConsole_NS_check(void); @@ -349,7 +349,7 @@ void setPlayTime__12dFile_info_cFP10dSv_save_c(void); void func_80362540(void); void dDlst_list_c_NS_set(void); void init__14dComIfG_play_cFv(void); -void dStage_roomControl_c_NS_initZone(void); +void init__20dStage_roomControl_cFvZone(void); void JUTWarningConsole(void); void JUTConsole_NS_print(void); void JUTConsole_NS_check(void); @@ -6171,13 +6171,13 @@ void dRes_control_c_NS_deleteRes(void); void dRes_control_c_NS_syncRes(void); void dStage_Create(void); void dStage_Delete(void); -void dStage_GetKeepDoorInfo(void); +// void dStage_GetKeepDoorInfo(void); void dStage_GetRoomKeepDoorInfo(void); void dStage_KeepDoorInfoInit(void); void dStage_KeepDoorInfoProc(void); void dStage_KeepDoorInfo_NS_dtor(void); void dStage_RoomKeepDoorInfoProc(void); -//void dStage_SetErrorRoom(void); +// void dStage_SetErrorRoom(void); void dStage_SetErrorStage(void); void dStage_actorCreate(void); void dStage_actorInit(void); diff --git a/include/variables.h b/include/variables.h index a7ff78cae27..f00390601d7 100644 --- a/include/variables.h +++ b/include/variables.h @@ -59,7 +59,7 @@ extern u8 __ct__12dSv_memory_cFv; extern u8 __ct__13dSv_memory2_cFv; extern u8 lbl_803D3420; extern u8 lbl_80450B0C; -//struct ResetData; +// struct ResetData; extern u8 lbl_80450B08; extern u8 lbl_803DB420; extern u8 main01__Fv; @@ -2910,7 +2910,7 @@ extern u8 lbl_803A6AAC; extern u8 lbl_803A6D94; extern u8 lbl_803F0000; extern u8 lbl_803F4E68; -extern u8 lbl_803F4E74; +// extern stage_tgsc_data_class* lbl_803F4E74; extern u8 lbl_803F5784; extern u8 lbl_804307EC; extern u8 lbl_804505F0; diff --git a/src/d/d_stage.cpp b/src/d/d_stage.cpp index 2de9547a93f..f6fc9647402 100644 --- a/src/d/d_stage.cpp +++ b/src/d/d_stage.cpp @@ -6,16 +6,14 @@ #include "global.h" #include "m_Do/m_Do_Reset/m_Do_Reset.h" -// set__18dStage_nextStage_cFPCcScsScScUc -// #ifdef NONMATCHING void dStage_nextStage_c::set(const char* param_1, s8 param_2, s16 param_3, s8 param_4, s8 param_5, u8 param_6) { - if (!enabled) { enabled = 1; wipe = param_5; wipe_speed = param_6; + // this generates extra mr instructions dStage_startStage_c::set(param_1, param_2, param_3, param_4); if (!strcmp(param_1, lbl_80378A50)) { m_Do_Reset_NS_mDoRst_NS_mResetData->field_0x0 = 1; @@ -31,20 +29,24 @@ asm void dStage_nextStage_c::set(const char* param_1, s8 param_2, s16 param_3, s #endif void dStage_SetErrorRoom(void) { - OSReport_Error(lbl_80378A50+8); + OSReport_Error(lbl_80378A50 + 8); } void dStage_SetErrorStage(void) { - OSReport_Error(lbl_80378A50+73); + OSReport_Error(lbl_80378A50 + 73); } extern "C" { -// dStage_GetKeepDoorInfo__Fv -// dStage_GetKeepDoorInfo(void) +#ifdef NONMATCHING +u32* dStage_GetKeepDoorInfo(void) { + return lbl_803F4E74; +} +#else asm void dStage_GetKeepDoorInfo(void) { nofralloc #include "d/d_stage/asm/func_80023EF4.s" } +#endif // dStage_isBossStage__FP11dStage_dt_c // dStage_isBossStage(dStage_dt_c*) @@ -98,22 +100,20 @@ asm void func_80024174(void) { } void dStage_startStage_c::set(const char* i_Stage, s8 i_RoomNo, s16 i_Point, s8 i_Layer) { - strcpy(mStage,i_Stage); + strcpy(mStage, i_Stage); mRoomNo = i_RoomNo; mPoint = i_Point; mLayer = i_Layer; } -// init__20dStage_roomControl_cFv -// dStage_roomControl_c::init(void) -asm void dStage_roomControl_c_NS_init(void) { +asm void dStage_roomControl_c::init(void) { nofralloc #include "d/d_stage/asm/func_800241E8.s" } // initZone__20dStage_roomControl_cFv // dStage_roomControl_c::initZone(void) -asm void dStage_roomControl_c_NS_initZone(void) { +asm void init__20dStage_roomControl_cFvZone(void) { nofralloc #include "d/d_stage/asm/func_80024338.s" }