From 3fe20ea5b8066a18efe72650aa92e42a9cd2d365 Mon Sep 17 00:00:00 2001 From: Jcw87 Date: Tue, 30 Jan 2024 01:32:25 -0800 Subject: [PATCH] d_s_name --- include/d/d_s_name.h | 163 ++++++++++++++++++++++++++++++++++ src/d/d_s_name.cpp | 202 +++++++++++++++++++++++++++++++++---------- 2 files changed, 318 insertions(+), 47 deletions(-) create mode 100644 include/d/d_s_name.h diff --git a/include/d/d_s_name.h b/include/d/d_s_name.h new file mode 100644 index 000000000..d764887df --- /dev/null +++ b/include/d/d_s_name.h @@ -0,0 +1,163 @@ +#ifndef D_S_NAME +#define D_S_NAME + +#include "d/d_drawlist.h" +#include "f_op/f_op_msg_mng.h" +#include "f_op/f_op_scene.h" + +class J2DScreen; +class JKRMemArchive; +class dFile_error_c; +class dFile_select_c; +class dMCloth; +class dMenu_save_c; +class dName_c; +class mDoDvdThd_toMainRam_c; + +class dSn_HIO_c { +public: + dSn_HIO_c(); + virtual ~dSn_HIO_c() {} + + /* 0x04 */ u8 field_0x4; + /* 0x05 */ u8 field_0x5; + /* 0x06 */ u8 field_0x6; + /* 0x07 */ u8 field_0x7; + /* 0x08 */ u8 field_0x8; + /* 0x09 */ u8 field_0x9; + /* 0x0A */ u8 field_0xa; + /* 0x0B */ u8 field_0xb; + /* 0x0C */ s16 field_0xc; + /* 0x0E */ u8 field_0xe; + /* 0x0F */ u8 field_0xf; + /* 0x10 */ u8 field_0x10; + /* 0x11 */ u8 field_0x11; + /* 0x12 */ u8 field_0x12; + /* 0x13 */ u8 field_0x13; + /* 0x14 */ u8 field_0x14; + /* 0x15 */ u8 field_0x15; + /* 0x16 */ u8 field_0x16; + /* 0x17 */ u8 field_0x17; + /* 0x18 */ u8 field_0x18; + /* 0x19 */ u8 field_0x19; + /* 0x1A */ u8 field_0x1a; + /* 0x1B */ u8 field_0x1b; +}; + +class dDlst_BTICN_c : public dDlst_base_c { +public: + ~dDlst_BTICN_c() {} + void draw(); + + /* 0x04 */ J2DScreen* scr; +}; + +class dDlst_FLSEL_CLOTH_c : public dDlst_base_c { +public: + ~dDlst_FLSEL_CLOTH_c() {} + void draw(); + + /* 0x04 */ dMCloth* cloth_c; +}; + +class dScnName_c : public scene_class { +public: + ~dScnName_c(); + s32 create(); + void cloth_create(); + void cloth_move(); + void cloth2D_create(); + void buttonIconCreate(); + void paneTransButtonIcon(s16, u8, f32, f32, u8); + s32 execute(); + void setView(); + s32 draw(); + void MemCardCheckMain(); + void MemCardStatCheck(); + void MemCardLoadWait(); + void MemCardErrMsgWaitKey(); + void MemCardErrMsgWaitKey2(); + void MemCardGotoIPLSelect(); + void MemCardGotoIPL(); + void MemCardErrMsgWaitNoSaveSel(); + void MemCardErrMsgWaitFormatSel(); + void MemCardErrMsgWaitFormatSel2(); + void MemCardFormat(); + void MemCardFormatCheck(); + void MemCardMakeGameFileSel(); + void MemCardMakeGameFile(); + void MemCardMakeGameFileCheck(); + void MemCardGotoFileSelect(); + void MemCardCheckDbg(); + void MemCardCheckDbgWait(); + void FileErrorDraw(); + void NoteOpen(); + void NoteOpenWait(); + void FileSelectOpen(); + void buttonIconProc(); + void FileSelOpenMain(); + void FileselOpenWait(); + void FileSelectMain(); + void FileSelectMainNormal(); + void FileSelectMainExSave(); + void ResetWait(); + void FileSelectClose(); + void FileSelectDraw(); + void NameInOpen(); + void NameOpenMain(); + void NameOpenWait(); + void NameInMain(); + void NameInClose(); + void NameInDraw(); + void ShopDemoDataLoad(); + void ShopDemoDataSet(); + void SaveOpen(); + void SaveMain(); + void SaveClose(); + void SaveDraw(); + void NoneDraw(); + void changeGameScene(); + + /* 0x1C4 */ request_of_phase_process_class mPhs; + /* 0x1CC */ JKRHeap* heap; + /* 0x1D0 */ JKRHeap* field_0x1d0; + /* 0x1D4 */ u8 field_0x1d4[0x29C - 0x1D4]; + /* 0x29C */ f32 field_0x29c; + /* 0x2A0 */ f32 field_0x2a0; + /* 0x2A4 */ f32 field_0x2a4; + /* 0x2A8 */ f32 field_0x2a8; + /* 0x2AC */ Vec field_0x2ac; + /* 0x2B8 */ Vec field_0x2b8; + /* 0x2C4 */ u8 field_0x2c4[0x2D0 - 0x2C4]; + /* 0x2D0 */ s16 field_0x2d0; + /* 0x2D4 */ Mtx44 field_0x2d4; + /* 0x314 */ Mtx field_0x314; + /* 0x344 */ Mtx field_0x344; + /* 0x374 */ Mtx field_0x374; + /* 0x3A4 */ u8 field_0x3a4[0x3B4 - 0x3A4]; + /* 0x3B4 */ Mtx field_0x3b4; + /* 0x3E4 */ u8 field_0x3e4[0x40C - 0x3E4]; + /* 0x40C */ JKRMemArchive* field_0x40c; + /* 0x410 */ mDoDvdThd_toMainRam_c* field_0x410; + /* 0x414 */ dDlst_BTICN_c btnIcon; + /* 0x41C */ dDlst_FLSEL_CLOTH_c cloth; + /* 0x424 */ dName_c* dNm_c; + /* 0x428 */ dFile_select_c* dFs_c; + /* 0x42C */ dFile_error_c* dFe_c; + /* 0x430 */ dMenu_save_c* dMs_c; + /* 0x434 */ u8 field_0x434[0x43C - 0x434]; + /* 0x43C */ fopMsgM_pane_class field_0x43c; + /* 0x474 */ fopMsgM_pane_class field_0x474; + /* 0x4AC */ fopMsgM_pane_class field_0x4ac; + /* 0x4E4 */ fopMsgM_pane_class field_0x4e4; + /* 0x41C */ fopMsgM_pane_class field_0x51c; + /* 0x554 */ u8 field_0x554[0x560 - 0x554]; + /* 0x560 */ u8 field_0x560[0x1650]; + /* 0x1BB0 */ void* savePicDatabuf; + /* 0x1BB4 */ short field_0x1bb4; + /* 0x1BB6 */ u8 field_0x1bb6; + /* 0x1BB7 */ u8 field_0x1bb7[0x1BBC - 0x1BB7]; + /* 0x1BBC */ int field_0x1bbc; +}; + +#endif /* D_S_NAME */ diff --git a/src/d/d_s_name.cpp b/src/d/d_s_name.cpp index 63a3996e7..4abb4a763 100644 --- a/src/d/d_s_name.cpp +++ b/src/d/d_s_name.cpp @@ -3,36 +3,73 @@ // Translation Unit: d_s_name.cpp // -#include "d_s_name.h" -#include "dolphin/types.h" +#include "d/d_s_name.h" +#include "d/d_com_lib_game.h" +#include "d/d_procname.h" +#include "new.h" + +static Vec lit_2100 = {1.0f, 1.0f, 1.0f}; +static Vec lit_2080 = {1.0f, 1.0f, 1.0f}; + +dSn_HIO_c g_snHIO; /* 8022F86C-8022F8F0 .text __ct__9dSn_HIO_cFv */ dSn_HIO_c::dSn_HIO_c() { - /* Nonmatching */ + this->field_0x5 = 20; + this->field_0x6 = 15; + this->field_0x7 = 30; + this->field_0x8 = 0; + this->field_0x9 = 0; + this->field_0xa = 0; + this->field_0xb = 0; + this->field_0xe = 7; + this->field_0xc = -200; + this->field_0xf = 2; + this->field_0x10 = 0; + this->field_0x11 = 0; + this->field_0x12 = 0; + this->field_0x13 = 0; + this->field_0x14 = 0; + this->field_0x15 = 0; + this->field_0x16 = 0; + this->field_0x17 = 0; + this->field_0x18 = 0; + this->field_0x19 = 0; + this->field_0x1a = 0; + this->field_0x1b = 0; } /* 8022F8F0-8022F95C .text phase_1__FPc */ -void phase_1(char*) { +static void phase_1(char*) { /* Nonmatching */ } /* 8022F95C-8022F9B4 .text phase_2__FPc */ -void phase_2(char*) { +static void phase_2(char*) { /* Nonmatching */ } /* 8022F9B4-8022F9BC .text phase_3__FPc */ -void phase_3(char*) { - /* Nonmatching */ +static s32 phase_3(char*) { + return cPhs_COMPLEATE_e; } /* 8022F9BC-8022F9FC .text resLoad__FP30request_of_phase_process_classPc */ -void resLoad(request_of_phase_process_class*, char*) { +s32 resLoad(request_of_phase_process_class* param_1, char* param_2) { /* Nonmatching */ + static cPhs__Handler l_method[] = { + (cPhs__Handler)phase_1, + (cPhs__Handler)phase_2, + (cPhs__Handler)phase_3, + }; + if (param_1->id == 2) { + return cPhs_COMPLEATE_e; + } + return dComLbG_PhaseHandler(param_1, l_method, param_2); } /* 8022F9FC-802301C8 .text create__10dScnName_cFv */ -void dScnName_c::create() { +s32 dScnName_c::create() { /* Nonmatching */ } @@ -57,12 +94,69 @@ void dScnName_c::buttonIconCreate() { } /* 80230500-802305E0 .text paneTransButtonIcon__10dScnName_cFsUcffUc */ -void dScnName_c::paneTransButtonIcon(short, unsigned char, float, float, unsigned char) { +void dScnName_c::paneTransButtonIcon(s16, u8, f32, f32, u8) { /* Nonmatching */ } +void (dScnName_c::*MainProc[])() = { + &dScnName_c::MemCardCheckMain, + &dScnName_c::NoteOpen, + &dScnName_c::NoteOpenWait, + &dScnName_c::FileSelectOpen, + &dScnName_c::FileSelectMain, + &dScnName_c::FileSelectClose, + &dScnName_c::NameInOpen, + &dScnName_c::NameInMain, + &dScnName_c::NameInClose, + &dScnName_c::changeGameScene, + &dScnName_c::SaveOpen, + &dScnName_c::SaveMain, + &dScnName_c::SaveClose, + &dScnName_c::ResetWait, + &dScnName_c::ShopDemoDataLoad, + &dScnName_c::ShopDemoDataSet, +}; + +void (dScnName_c::*MemCardCheckProc[])() = { + &dScnName_c::MemCardStatCheck, + &dScnName_c::MemCardLoadWait, + &dScnName_c::MemCardErrMsgWaitKey, + &dScnName_c::MemCardErrMsgWaitKey2, + &dScnName_c::MemCardErrMsgWaitNoSaveSel, + &dScnName_c::MemCardErrMsgWaitFormatSel, + &dScnName_c::MemCardErrMsgWaitFormatSel2, + &dScnName_c::MemCardFormat, + &dScnName_c::MemCardFormatCheck, + &dScnName_c::MemCardMakeGameFileSel, + &dScnName_c::MemCardMakeGameFile, + &dScnName_c::MemCardMakeGameFileCheck, + &dScnName_c::MemCardGotoFileSelect, + &dScnName_c::MemCardGotoIPLSelect, + &dScnName_c::MemCardGotoIPL, + &dScnName_c::MemCardCheckDbg, + &dScnName_c::MemCardCheckDbgWait, +}; + +void (dScnName_c::*NameOpenProc[])() = { + &dScnName_c::NameOpenMain, + &dScnName_c::NameOpenWait, +}; + +void (dScnName_c::*FileSelOpenProc[])() = { + &dScnName_c::FileSelOpenMain, + &dScnName_c::FileselOpenWait, +}; + +void (dScnName_c::*DrawProc[])() = { + &dScnName_c::FileErrorDraw, + &dScnName_c::FileSelectDraw, + &dScnName_c::NameInDraw, + &dScnName_c::SaveDraw, + &dScnName_c::NoneDraw, +}; + /* 802305E0-80230678 .text execute__10dScnName_cFv */ -void dScnName_c::execute() { +s32 dScnName_c::execute() { /* Nonmatching */ } @@ -72,7 +166,7 @@ void dScnName_c::setView() { } /* 80230714-802307EC .text draw__10dScnName_cFv */ -void dScnName_c::draw() { +s32 dScnName_c::draw() { /* Nonmatching */ } @@ -162,9 +256,7 @@ void dScnName_c::MemCardGotoFileSelect() { } /* 802313AC-802313B0 .text MemCardCheckDbg__10dScnName_cFv */ -void dScnName_c::MemCardCheckDbg() { - /* Nonmatching */ -} +void dScnName_c::MemCardCheckDbg() {} /* 802313B0-80231428 .text MemCardCheckDbgWait__10dScnName_cFv */ void dScnName_c::MemCardCheckDbgWait() { @@ -202,9 +294,7 @@ void dScnName_c::FileSelOpenMain() { } /* 80231A24-80231A28 .text FileselOpenWait__10dScnName_cFv */ -void dScnName_c::FileselOpenWait() { - /* Nonmatching */ -} +void dScnName_c::FileselOpenWait() {} /* 80231A28-80231A8C .text FileSelectMain__10dScnName_cFv */ void dScnName_c::FileSelectMain() { @@ -247,9 +337,7 @@ void dScnName_c::NameOpenMain() { } /* 80231F44-80231F48 .text NameOpenWait__10dScnName_cFv */ -void dScnName_c::NameOpenWait() { - /* Nonmatching */ -} +void dScnName_c::NameOpenWait() {} /* 80231F48-80231FF4 .text NameInMain__10dScnName_cFv */ void dScnName_c::NameInMain() { @@ -297,9 +385,7 @@ void dScnName_c::SaveDraw() { } /* 8023229C-802322A0 .text NoneDraw__10dScnName_cFv */ -void dScnName_c::NoneDraw() { - /* Nonmatching */ -} +void dScnName_c::NoneDraw() {} /* 802322A0-80232338 .text changeGameScene__10dScnName_cFv */ void dScnName_c::changeGameScene() { @@ -307,28 +393,30 @@ void dScnName_c::changeGameScene() { } /* 80232338-80232358 .text dScnName_Draw__FP10dScnName_c */ -void dScnName_Draw(dScnName_c*) { - /* Nonmatching */ +s32 dScnName_Draw(dScnName_c* i_this) { + return i_this->draw(); } /* 80232358-80232378 .text dScnName_Execute__FP10dScnName_c */ -void dScnName_Execute(dScnName_c*) { - /* Nonmatching */ +s32 dScnName_Execute(dScnName_c* i_this) { + return i_this->execute(); } /* 80232378-80232380 .text dScnName_IsDelete__FP10dScnName_c */ -void dScnName_IsDelete(dScnName_c*) { - /* Nonmatching */ +s32 dScnName_IsDelete(dScnName_c*) { + return 1; } /* 80232380-802323A8 .text dScnName_Delete__FP10dScnName_c */ -void dScnName_Delete(dScnName_c*) { - /* Nonmatching */ +s32 dScnName_Delete(dScnName_c* i_this) { + i_this->~dScnName_c(); + return 1; } /* 802323A8-802323F8 .text dScnName_Create__FP11scene_class */ -void dScnName_Create(scene_class*) { - /* Nonmatching */ +s32 dScnName_Create(scene_class* i_scn) { + dScnName_c* i_this = new (i_scn) dScnName_c(); + return i_this->create(); } /* 802323F8-8023245C .text draw__13dDlst_BTICN_cFv */ @@ -341,18 +429,38 @@ void dDlst_FLSEL_CLOTH_c::draw() { /* Nonmatching */ } -/* 80232518-80232574 .text __dt__19dDlst_FLSEL_CLOTH_cFv */ -dDlst_FLSEL_CLOTH_c::~dDlst_FLSEL_CLOTH_c() { - /* Nonmatching */ -} +scene_method_class l_dScnName_Method = { + (process_method_func)dScnName_Create, + (process_method_func)dScnName_Delete, + (process_method_func)dScnName_Execute, + (process_method_func)dScnName_IsDelete, + (process_method_func)dScnName_Draw, +}; -/* 80232574-802325D0 .text __dt__13dDlst_BTICN_cFv */ -dDlst_BTICN_c::~dDlst_BTICN_c() { - /* Nonmatching */ -} - -/* 802325D0-80232618 .text __dt__9dSn_HIO_cFv */ -dSn_HIO_c::~dSn_HIO_c() { - /* Nonmatching */ -} +scene_process_profile_definition g_profile_NAME_SCENE = { + fpcLy_ROOT_e, + 1, + fpcPi_CURRENT_e, + PROC_NAME_SCENE, + &g_fpcNd_Method.mBase, + sizeof(dScnName_c), + 0, + 0, + &g_fopScn_Method.mBase, + &l_dScnName_Method, + NULL, +}; +scene_process_profile_definition g_profile_NAMEEX_SCENE = { + fpcLy_ROOT_e, + 1, + fpcPi_CURRENT_e, + PROC_NAMEEX_SCENE, + &g_fpcNd_Method.mBase, + sizeof(dScnName_c), + 0, + 0, + &g_fopScn_Method.mBase, + &l_dScnName_Method, + NULL, +};