diff --git a/include/d/d_file_error.h b/include/d/d_file_error.h index 6328d046..cabfb1a3 100644 --- a/include/d/d_file_error.h +++ b/include/d/d_file_error.h @@ -1,8 +1,7 @@ #ifndef D_FILE_ERROR_H #define D_FILE_ERROR_H -#include "dolphin/types.h" -#include "JSystem/J2DGraph/J2DPane.h" +#include "d/d_drawlist.h" class MyScreen { public: @@ -14,13 +13,19 @@ public: dFe_HIO_c(); }; +class dDlst_FileErr_c : public dDlst_base_c { +public: + void draw(); +}; + class dFile_error_c { public: void getStatus() {} void getYesNo() {} void setDbgErrMessage(char*, int) {} void setTimeCountDownMode() {} - + + virtual ~dFile_error_c() {} void _create(); void initial(); void _delete(); @@ -44,11 +49,10 @@ public: void PaneTranceBase(s16, u8, f32, f32, f32, f32, u8, int); void _draw(); void draw2(); -}; -class dDlst_FileErr_c { -public: - void draw(); + /* 0x004 */ u8 field_0x4[0x008 - 0x004]; + /* 0x008 */ dDlst_FileErr_c field_0x8; + /* 0x00C */ u8 field_0xc[0x30C - 0x00C]; }; #endif /* D_FILE_ERROR_H */ diff --git a/include/d/d_file_select.h b/include/d/d_file_select.h index 49247d04..1041d940 100644 --- a/include/d/d_file_select.h +++ b/include/d/d_file_select.h @@ -2,18 +2,25 @@ #define D_S_FILE_SELECT #include "d/d_drawlist.h" +#include "f_op/f_op_msg_mng.h" + +class JKRMemArchive; +class STControl; class dFs_HIO_c { public: dFs_HIO_c(); }; -class dDlst_FileSel_c { +class dDlst_FileSel_c : public dDlst_base_c { public: void draw(); + + /* 0x04 */ J2DScreen* Scr; + /* 0x08 */ JUTFont* font; }; -class dFile_select_c : public dDlst_base_c { +class dFile_select_c { public: void getErrType() {} void getIconMode() {} @@ -25,14 +32,14 @@ public: void setSaveDataPtr(u8*) {} void setSavePicDataPtr(u8*) {} void setUseType(u8) {} - - dFile_select_c(); + + dFile_select_c() {} void _create(); void initial(); void _delete(); void _move(); - void _open(); - void _close(); + bool _open(); + bool _close(); void closeEnd(); void closeCardErr(); void closeBack(); @@ -128,8 +135,117 @@ public: void ExErrorMsgPaneMove(); void ExErrorMsgPaneMove2(); -private: - u32 field_0x00[100]; +public: + /* 0x0000 */ JKRMemArchive* field_0x0; + /* 0x0004 */ dDlst_FileSel_c fileSel; + /* 0x0010 */ fopMsgM_pane_class field_0x10; + /* 0x0048 */ fopMsgM_pane_class field_0x48; + /* 0x0080 */ fopMsgM_pane_class field_0x80; + /* 0x00B8 */ fopMsgM_pane_class field_0xb8; + /* 0x00F0 */ fopMsgM_pane_class field_0xf0; + /* 0x0128 */ fopMsgM_pane_class field_0x128; + /* 0x0160 */ fopMsgM_pane_class field_0x160; + /* 0x0198 */ fopMsgM_pane_class field_0x198; + /* 0x01D0 */ fopMsgM_pane_class field_0x1d0; + /* 0x0208 */ fopMsgM_pane_class field_0x208[12]; + /* 0x04A8 */ fopMsgM_pane_class field_0x4a8; + /* 0x04E0 */ fopMsgM_pane_class field_0x4e0; + /* 0x0518 */ fopMsgM_pane_class field_0x518; + /* 0x0550 */ fopMsgM_pane_class field_0x550; + /* 0x0588 */ fopMsgM_pane_class field_0x588; + /* 0x05c0 */ fopMsgM_pane_class field_0x5c0; + /* 0x05f8 */ fopMsgM_pane_class field_0x5f8; + /* 0x0630 */ fopMsgM_pane_class field_0x630[9]; + /* 0x0828 */ fopMsgM_pane_class field_0x828[20]; + /* 0x0C88 */ fopMsgM_pane_class field_0xc88[20]; + /* 0x10E8 */ fopMsgM_pane_class field_0x10e8; + /* 0x1120 */ fopMsgM_pane_class field_0x1120; + /* 0x1158 */ fopMsgM_pane_class field_0x1158; + /* 0x1190 */ fopMsgM_pane_class field_0x1190; + /* 0x11C8 */ fopMsgM_pane_class field_0x11c8; + /* 0x1200 */ fopMsgM_pane_class field_0x1200; + /* 0x1238 */ fopMsgM_pane_class field_0x1238[16]; + /* 0x15B8 */ fopMsgM_pane_class field_0x15b8[16]; + /* 0x1938 */ fopMsgM_pane_class field_0x1938[16]; + /* 0x1CB8 */ fopMsgM_pane_class field_0x1cb8[29]; + /* 0x2310 */ fopMsgM_pane_class field_0x2310[29]; + /* 0x2968 */ fopMsgM_pane_class field_0x2968[29]; + /* 0x2FC0 */ fopMsgM_pane_class field_0x2fc0[5]; + /* 0x30D8 */ fopMsgM_pane_class field_0x30d8; + /* 0x3110 */ fopMsgM_pane_class field_0x3110; + /* 0x3148 */ fopMsgM_pane_class field_0x3148; + /* 0x3180 */ fopMsgM_pane_class field_0x3180; + /* 0x31B8 */ fopMsgM_pane_class field_0x31b8; + /* 0x31F0 */ fopMsgM_pane_class field_0x31f0; + /* 0x3228 */ fopMsgM_pane_class field_0x3228; + /* 0x3260 */ fopMsgM_pane_class field_0x3260; + /* 0x3298 */ fopMsgM_pane_class field_0x3298; + /* 0x32D0 */ fopMsgM_pane_class field_0x32d0; + /* 0x3308 */ fopMsgM_pane_class field_0x3308; + /* 0x3340 */ fopMsgM_pane_class field_0x3340; + /* 0x3378 */ fopMsgM_pane_class field_0x3378; + /* 0x33B0 */ fopMsgM_pane_class field_0x33b0; + /* 0x33E8 */ fopMsgM_pane_class field_0x33e8; + /* 0x3420 */ fopMsgM_pane_class field_0x3420; + /* 0x3458 */ fopMsgM_pane_class field_0x3458; + /* 0x3490 */ fopMsgM_pane_class field_0x3490; + /* 0x34C8 */ fopMsgM_pane_class field_0x34c8; + /* 0x3500 */ fopMsgM_pane_class field_0x3500; + /* 0x3538 */ fopMsgM_pane_class field_0x3538; + /* 0x3570 */ fopMsgM_pane_class field_0x3570; + /* 0x35A8 */ fopMsgM_pane_class field_0x35a8; + /* 0x35E0 */ fopMsgM_pane_class field_0x35e0; + /* 0x3618 */ fopMsgM_pane_class field_0x3618; + /* 0x3650 */ fopMsgM_pane_class field_0x3650; + /* 0x3688 */ fopMsgM_pane_class field_0x3688; + /* 0x36C0 */ fopMsgM_pane_class field_0x36c0; + /* 0x36F8 */ fopMsgM_pane_class field_0x36f8; + /* 0x3730 */ fopMsgM_pane_class field_0x3730; + /* 0x3768 */ fopMsgM_pane_class field_0x3768; + /* 0x37A0 */ fopMsgM_pane_class field_0x37a0; + /* 0x37D8 */ JUtility::TColor field_0x37d8[11]; + /* 0x3804 */ JUtility::TColor field_0x3804[11]; + /* 0x3830 */ JUtility::TColor field_0x3830[18]; + /* 0x3878 */ JUtility::TColor field_0x3878[18]; + /* 0x38C0 */ JUtility::TColor field_0x38c0[2]; + /* 0x38C8 */ JUtility::TColor field_0x38c8[2]; + /* 0x38D0 */ JUtility::TColor field_0x38d0[2]; + /* 0x38D8 */ JUtility::TColor field_0x38d8[2]; + /* 0x38E0 */ f32 field_0x38e0; + /* 0x38E4 */ f32 field_0x38e4; + /* 0x38D8 */ char* field_0x38e8[3]; + /* 0x38F4 */ char* field_0x38f4; + /* 0x38F8 */ char* field_0x38f8; + /* 0x38FC */ char* field_0x38fc; + /* 0x3900 */ char* field_0x3900; + /* 0x3904 */ char* field_0x3904; + /* 0x3908 */ char* field_0x3908; + /* 0x390C */ STControl* stick; + /* 0x3910 */ STControl* stick2; + /* 0x3914 */ u8 field_0x3914[0x3921 - 0x3914]; + /* 0x3921 */ u8 field_0x3921; + /* 0x3922 */ u8 field_0x3922; + /* 0x3923 */ u8 field_0x3923; + /* 0x3924 */ u8 field_0x3924[0x3927 - 0x3924]; + /* 0x3927 */ u8 field_0x3927; + /* 0x3928 */ u8 field_0x3928; + /* 0x3929 */ u8 field_0x3929; + /* 0x392A */ u8 field_0x392a; + /* 0x392B */ u8 field_0x392b; + /* 0x392C */ u8 field_0x392c; + /* 0x392D */ u8 field_0x392d; + /* 0x392E */ u8 field_0x392e; + /* 0x392F */ u8 field_0x392f; + /* 0x3930 */ s16 field_0x3930; + /* 0x3932 */ s16 field_0x3932; + /* 0x3934 */ u8 field_0x3934[0x3936 - 0x3934]; + /* 0x3936 */ u8 field_0x3936; + /* 0x3938 */ void* field_0x3938; + /* 0x393C */ void* field_0x393c; + /* 0x3940 */ u8 field_0x3940; + /* 0x3941 */ u8 field_0x3941; + /* 0x3942 */ u8 field_0x3942[0x3948 - 0x3942]; + /* 0x3948 */ f32 field_0x3948; }; #endif diff --git a/include/d/d_menu_cloth.h b/include/d/d_menu_cloth.h index 92fd6637..018fd1e3 100644 --- a/include/d/d_menu_cloth.h +++ b/include/d/d_menu_cloth.h @@ -10,7 +10,7 @@ class JKRArchive; class dMCloth_c { public: dMCloth_c(); - ~dMCloth_c(); + virtual ~dMCloth_c(); void getBackNrm() {} void getNrm() {} @@ -18,8 +18,8 @@ public: void getPos() {} void getShadowPos() {} void getTexObj() {} - void setArchive(JKRArchive* arc) {} - void setClothType(unsigned char) {} + void setArchive(JKRArchive* arc) { field_0x44 = arc; } + void setClothType(u8 type) { field_0x913d = type; } // ? void lightSet1(cXyz); void cloth_init(); @@ -39,6 +39,18 @@ public: void cloth_move_sin(); void cloth_move_simple(); void cloth_move(); + + /* 0x0004 */ u8 field_0x4[0x44 - 0x04]; + /* 0x0044 */ JKRArchive* field_0x44; + /* 0x0048 */ cXyz field_0x48[882]; + /* 0x29A0 */ cXyz field_0x29a0[882]; + /* 0x52F8 */ cXyz field_0x52f8[441]; + /* 0x67A4 */ cXyz field_0x67a4[441]; + /* 0x7C50 */ cXyz field_0x7c50[441]; + /* 0x90FC */ GXTexObj field_0x90fc; + /* 0x911C */ u8 field_0x911c[0x913D - 0x911C]; + /* 0x913D */ u8 field_0x913d; + /* 0x913E */ u8 field_913e[0x9168 - 0x913E]; }; class daCLOTH_HIO_c { diff --git a/include/d/d_menu_save.h b/include/d/d_menu_save.h index ab9c58db..0ce47c11 100644 --- a/include/d/d_menu_save.h +++ b/include/d/d_menu_save.h @@ -117,7 +117,11 @@ public: /* 0x0536 */ u8 field_0x0536; /* 0x0537 */ u8 field_0x0537; /* 0x0538 */ u8 field_0x0538; - /* 0x0539 */ u8 field_0x0539[0x1ba4 - 0x0539]; + /* 0x0539 */ u8 field_0x0539[0x053C - 0x0539]; + /* 0x053C */ u8 field_0x053c; + /* 0x053D */ u8 field_0x053d; + /* 0x053E */ u8 field_0x053e[0x0554 - 0x053E]; + /* 0x0554 */ u8 field_0x0554[0x1BA4 - 0x0554]; }; class dMs_HIO_c { diff --git a/include/d/d_name.h b/include/d/d_name.h index 49dff3ad..eac2a01b 100644 --- a/include/d/d_name.h +++ b/include/d/d_name.h @@ -1,28 +1,33 @@ #ifndef D_NAME_H #define D_NAME_H -#include "dolphin/types.h" +#include "d/d_drawlist.h" class dNm_HIO_c { public: dNm_HIO_c(); }; +class dDlst_NameIN_c : public dDlst_base_c { + void draw(); +}; + class dName_c { public: void draw() {} void getInputStrPtr() {} void isInputEnd() {} void setNextNameStr(char*) {} - + + virtual ~dName_c() {} void _create(); void initial(); void _delete(); void _move(); void nameCheck(); void playNameSet(int); - void _open(); - void _close(); + bool _open(); + bool _close(); void NameInMain(); void nameCursorAnime(); void EndWait(); @@ -59,10 +64,11 @@ public: void PaneTranceEnd(s16, u8, f32, f32, u8, int); void displayInit(); void NameStrSet(); -}; -class dDlst_NameIN_c { - void draw(); + /* 0x0004 */ u8 field_0x4[0x0008 - 0x0004]; + /* 0x0008 */ dDlst_NameIN_c field_0x8; + /* 0x000C */ u8 field_0xc[0x2AD0 - 0x000C]; + /* 0x2AD0 */ char field_0x2ad0[0x2AE8 - 0x2AD0]; }; #endif /* D_NAME_H */ diff --git a/include/d/d_s_name.h b/include/d/d_s_name.h index c1db7367..8c1cea78 100644 --- a/include/d/d_s_name.h +++ b/include/d/d_s_name.h @@ -4,6 +4,7 @@ #include "d/d_drawlist.h" #include "f_op/f_op_msg_mng.h" #include "f_op/f_op_scene.h" +#include "m_Do/m_Do_hostIO.h" class J2DScreen; class JKRMemArchive; @@ -14,12 +15,12 @@ class dMCloth_c; class dName_c; class mDoDvdThd_toMainRam_c; -class dSn_HIO_c { +class dSn_HIO_c : public JORReflexible { public: dSn_HIO_c(); virtual ~dSn_HIO_c() {} - /* 0x04 */ u8 field_0x4; + /* 0x04 */ s8 field_0x4; /* 0x05 */ u8 field_0x5; /* 0x06 */ u8 field_0x6; /* 0x07 */ u8 field_0x7; @@ -68,7 +69,7 @@ public: void cloth_move(); void cloth2D_create(); void buttonIconCreate(); - void paneTransButtonIcon(s16, u8, f32, f32, u8); + BOOL paneTransButtonIcon(s16, u8, f32, f32, u8); BOOL execute(); void setView(); BOOL draw(); @@ -167,7 +168,9 @@ public: /* 0x1BB0 */ void* savePicDatabuf; /* 0x1BB4 */ short field_0x1bb4; /* 0x1BB6 */ u8 field_0x1bb6; - /* 0x1BB7 */ u8 field_0x1bb7[0x1BBC - 0x1BB7]; + /* 0x1BB7 */ u8 field_0x1bb7; + /* 0x1BB8 */ u8 field_0x1bb8; + /* 0x1BB9 */ u8 field_0x1bb9[0x1BBC - 0x1BB9]; /* 0x1BBC */ int field_0x1bbc; }; diff --git a/src/d/d_file_select.cpp b/src/d/d_file_select.cpp index cc896d38..9842d273 100644 --- a/src/d/d_file_select.cpp +++ b/src/d/d_file_select.cpp @@ -32,12 +32,12 @@ void dFile_select_c::_move() { } /* 8017FE10-80180118 .text _open__14dFile_select_cFv */ -void dFile_select_c::_open() { +bool dFile_select_c::_open() { /* Nonmatching */ } /* 80180118-801801C8 .text _close__14dFile_select_cFv */ -void dFile_select_c::_close() { +bool dFile_select_c::_close() { /* Nonmatching */ } diff --git a/src/d/d_name.cpp b/src/d/d_name.cpp index 680b298e..38131e2b 100644 --- a/src/d/d_name.cpp +++ b/src/d/d_name.cpp @@ -42,12 +42,12 @@ void dName_c::playNameSet(int) { } /* 802162F8-80216670 .text _open__7dName_cFv */ -void dName_c::_open() { +bool dName_c::_open() { /* Nonmatching */ } /* 80216670-802169E0 .text _close__7dName_cFv */ -void dName_c::_close() { +bool dName_c::_close() { /* Nonmatching */ } diff --git a/src/d/d_s_name.cpp b/src/d/d_s_name.cpp index ec7bd5a2..278c2913 100644 --- a/src/d/d_s_name.cpp +++ b/src/d/d_s_name.cpp @@ -6,13 +6,23 @@ #include "d/d_s_name.h" #include "d/d_com_inf_game.h" #include "d/d_com_lib_game.h" +#include "d/d_file_error.h" #include "d/d_file_select.h" #include "d/d_procname.h" #include "d/d_menu_cloth.h" +#include "d/d_menu_save.h" +#include "d/d_name.h" +#include "f_ap/f_ap_game.h" #include "f_op/f_op_draw_iter.h" +#include "f_op/f_op_kankyo_mng.h" #include "f_op/f_op_overlap_mng.h" #include "f_op/f_op_scene_mng.h" #include "m_Do/m_Do_audio.h" +#include "m_Do/m_Do_dvd_thread.h" +#include "m_Do/m_Do_graphic.h" +#include "m_Do/m_Do_hostIO.h" +#include "m_Do/m_Do_machine.h" +#include "m_Do/m_Do_mtx.h" #include "m_Do/m_Do_Reset.h" #include "JSystem/J2DGraph/J2DOrthoGraph.h" #include "JSystem/J2DGraph/J2DScreen.h" @@ -21,11 +31,6 @@ static Vec lit_2100 = {1.0f, 1.0f, 1.0f}; static Vec lit_2080 = {1.0f, 1.0f, 1.0f}; -class dFile_error_c { -public: - void _move(); -}; - dSn_HIO_c g_snHIO; /* 8022F86C-8022F8F0 .text __ct__9dSn_HIO_cFv */ @@ -100,14 +105,91 @@ s32 dScnName_c::create() { if (rt == cPhs_COMPLEATE_e) { heap = JKRCreateExpHeap(0x68000, mDoExt_getGameHeap(), false); JUT_ASSERT(0x1c8, heap != 0); - } - oldHeap = mDoExt_setCurrentHeap(heap); - mArchive = new JKRMemArchive(); - mArchive->mountFixed(dComIfG_getStageRes("Stage", 0x17), JKRMEMBREAK_FLAG_UNKNOWN0); - cloth_create(); - buttonIconCreate(); - dFs_c = new dFile_select_c(); + oldHeap = mDoExt_setCurrentHeap(heap); + mArchive = new JKRMemArchive(); + mArchive->mountFixed(dComIfG_getStageRes("Stage", 0x17), JKRMEMBREAK_FLAG_UNKNOWN0); + cloth_create(); + buttonIconCreate(); + dFs_c = new dFile_select_c(); + JUT_ASSERT(470, dFs_c != 0); + dFs_c->field_0x0 = mArchive; + savePicDatabuf = new (0x20) u8[0x12000]; + JUT_ASSERT(476, savePicDatabuf != 0); + if (fpcM_GetName(this) == PROC_NAME_SCENE) { + dFs_c->field_0x3940 = 0; + dNm_c = new dName_c(); + JUT_ASSERT(484, dNm_c != 0); + dNm_c->_create(); + dFe_c = new dFile_error_c(); + JUT_ASSERT(489, dFe_c != 0); + dFe_c->_create(); + dMs_c = NULL; + g_dComIfG_gameInfo.save.field_0x1291 = 0; + g_dComIfG_gameInfo.save.field_0x1292 = 0; + } + if (fpcM_GetName(this) == PROC_NAMEEX_SCENE) { + dComIfGs_setClearCount(1); + dFs_c->field_0x3940 = 1; + dMs_c = new dMenu_save_c(); + JUT_ASSERT(511, dMs_c != 0); + dMs_c->field_0x0537 = 3; + dMs_c->_create(); + dFe_c = NULL; + dNm_c = NULL; + } + dFs_c->_create(); + g_snHIO.field_0x4 = mDoHIO_root.m_subroot.createChild("名前登録シーン", &g_snHIO); + dComIfGp_setWindowNum(1); + dComIfGp_setWindow(0, 0.0f, 0.0f, mDoMch_render_c::getFbWidth(), mDoMch_render_c::getEfbHeight(), 0.0f, 1.0f, 0, 2); + g_dComIfG_gameInfo.play.mCameraInfo[0].mpCamera = (camera_class*)&field_0x1d4; + field_0x29c = 5.0f; + field_0x2a0 = 160000.0f; + field_0x2a4 = 60.0f; + field_0x2a8 = (g_dComIfG_gameInfo.play.mDlstWindow[0].getViewPort()->mWidth / g_dComIfG_gameInfo.play.mDlstWindow[0].getViewPort()->mHeight) * g_HIO.field_0x0c; + field_0x2ac.x = 9377.0f; + field_0x2ac.y = 0.0; + field_0x2ac.z = 7644.0; + field_0x2b8.x = 0.0; + field_0x2b8.y = 6311.0; + field_0x2b8.z = 1000.0; + field_0x2d0 = 0; + dComIfGp_setPlayer(0, NULL); + dComIfGd_setWindow(dComIfGp_getWindow(0)); + dComIfGd_setViewport(dComIfGp_getWindow(0)->getViewPort()); + dComIfGd_setView((view_class*)&field_0x1d4); + mDoGph_gInf_c::offAutoForcus(); + setView(); + dKy_setLight_init(); + fopKyM_Create(PROC_KYEFF, 0, 0); + fopKyM_Create(PROC_KYEFF2, 0, 0); + fpcSCtRq_Request(fpcLy_CurrentLayer(), PROC_VRBOX, NULL, NULL, NULL); + fpcSCtRq_Request(fpcLy_CurrentLayer(), PROC_VRBOX2, NULL, NULL, NULL); + g_env_light.mVrSkyColor.r = 0x50; + g_env_light.mVrSkyColor.g = 0x78; + g_env_light.mVrSkyColor.b = 0xff; + g_env_light.mVrSkyColor.a = 0xff; + g_env_light.mVrkumoColor.r = 0xff; + g_env_light.mVrkumoColor.g = 0xff; + g_env_light.mVrkumoColor.b = 0xff; + g_env_light.mVrkumoColor.a = 0xff; + g_env_light.mVrKasumiMaeColor.r = 0xd2; + g_env_light.mVrKasumiMaeColor.g = 0xe5; + g_env_light.mVrKasumiMaeColor.b = 0xff; + g_env_light.mVrKasumiMaeColor.a = 0xff; + field_0x558 = g_snHIO.field_0x5; + field_0x1bb8 = 0; + if (fpcM_GetName(this) == PROC_NAME_SCENE) { + mMainProc = 0; + field_0x556 = 0; + mDrawProc = 0; + } else if (fpcM_GetName(this) == PROC_NAMEEX_SCENE) { + mMainProc = 10; + mDrawProc = 3; + } + JFWDisplay::getManager()->setTickRate(OS_TIMER_CLOCK / 30); + } + return rt; } /* 802301C8-802301FC .text cloth_create__10dScnName_cFv */ @@ -118,29 +200,58 @@ void dScnName_c::cloth_create() { /* 802301FC-80230240 .text cloth_move__10dScnName_cFv */ void dScnName_c::cloth_move() { - /* Nonmatching */ - if (field_0x55d && !g_snHIO.field_0xb) + if (field_0x55d && !g_snHIO.field_0xb) { cloth.cloth_c->cloth_move(); + } } /* 80230240-802302F8 .text cloth2D_create__10dScnName_cFv */ void dScnName_c::cloth2D_create() { - /* Nonmatching */ JKRArchive* clothRes = dComIfGp_getClothResArchive(); cloth.cloth_c = new dMCloth_c(); - JUT_ASSERT(0x321, cloth.cloth_c != 0); + JUT_ASSERT(801, cloth.cloth_c != 0); cloth.cloth_c->setArchive(clothRes); cloth.cloth_c->setClothType(1); // ? } +static void dummy() { + OSReport("baseMdl != 0"); + OSReport("baseMdl->getModel() != 0"); + OSReport("brkAnm != 0"); + OSReport("res != 0"); +} + /* 802302F8-80230500 .text buttonIconCreate__10dScnName_cFv */ void dScnName_c::buttonIconCreate() { - /* Nonmatching */ + btnIcon.scr = new J2DScreen(); + JUT_ASSERT(866, btnIcon.scr != 0); + btnIcon.scr->set("main_parts_fileselect.blo", mArchive); + fopMsgM_setPaneData(&field_0x43c, btnIcon.scr->search('cent')); + fopMsgM_setPaneData(&field_0x474, btnIcon.scr->search('bab')); + fopMsgM_setPaneData(&field_0x4ac, btnIcon.scr->search('baat')); + fopMsgM_setPaneData(&field_0x4e4, btnIcon.scr->search('bawp')); + fopMsgM_setPaneData(&field_0x51c, btnIcon.scr->search('bawd')); + field_0x1bb4 = 0; + paneTransButtonIcon(field_0x1bb4, g_snHIO.field_0xe, g_snHIO.field_0xc, 0.0f, 0); + field_0x1bb6 = 6; } /* 80230500-802305E0 .text paneTransButtonIcon__10dScnName_cFsUcffUc */ -void dScnName_c::paneTransButtonIcon(s16, u8, f32, f32, u8) { +BOOL dScnName_c::paneTransButtonIcon(s16 param_1, u8 param_2, f32 param_3, f32 param_4, u8 param_5) { /* Nonmatching */ + if (param_1 < 0) { + return false; + } + if (param_1 > param_2) { + return true; + } + f32 tmp = fopMsgM_valueIncrease(param_2, param_1, param_5) * (param_4 - param_3); + fopMsgM_paneTrans(&field_0x43c, 0.0f, param_3 + tmp); + fopMsgM_paneTrans(&field_0x474, 0.0f, param_3 + tmp); + fopMsgM_paneTrans(&field_0x4ac, 0.0f, param_3 + tmp); + fopMsgM_paneTrans(&field_0x4e4, 0.0f, param_3 + tmp); + fopMsgM_paneTrans(&field_0x51c, 0.0f, param_3 + tmp); + return false; } void (dScnName_c::*MainProc[])() = { @@ -202,16 +313,18 @@ void (dScnName_c::*DrawProc[])() = { /* 802305E0-80230678 .text execute__10dScnName_cFv */ BOOL dScnName_c::execute() { - /* Nonmatching */ - if (!fopOvlpM_IsPeek()) + if (!fopOvlpM_IsPeek()) { dComIfG_resetToOpening(this); + } - if (mDoRst::isReset()) + if (mDoRst::isReset()) { return TRUE; + } cloth_move(); - if (dFe_c != NULL) + if (dFe_c != NULL) { dFe_c->_move(); + } (this->*(MainProc[mMainProc]))(); buttonIconProc(); return TRUE; @@ -219,7 +332,15 @@ BOOL dScnName_c::execute() { /* 80230678-80230714 .text setView__10dScnName_cFv */ void dScnName_c::setView() { - /* Nonmatching */ + C_MTXPerspective(field_0x2d4, field_0x2a4, field_0x2a8, field_0x29c, field_0x2a0); + mDoMtx_lookAt(field_0x314, &field_0x2ac, &field_0x2b8, field_0x2d0); + mDoMtx_inverse(field_0x314, field_0x344); + mDoMtx_copy(field_0x314, field_0x3b4); + field_0x3b4[0][3] = 0.0f; + field_0x3b4[1][3] = 0.0f; + field_0x3b4[2][3] = 0.0f; + j3dSys.setViewMtx(field_0x314); + mDoMtx_concatProjView(field_0x2d4, field_0x314, field_0x374); } /* 80230714-802307EC .text draw__10dScnName_cFv */ @@ -237,7 +358,30 @@ BOOL dScnName_c::draw() { /* 802307EC-80230A14 .text __dt__10dScnName_cFv */ dScnName_c::~dScnName_c() { - /* Nonmatching */ + dFs_c->_delete(); + delete dFs_c; + if (dNm_c) { + dNm_c->_delete(); + delete dNm_c; + } + if (dFe_c) { + dFe_c->_delete(); + delete dFe_c; + } + if (dMs_c) { + dMs_c->_delete(); + delete dMs_c; + } + delete savePicDatabuf; + delete btnIcon.scr; + mArchive->unmountFixed(); + delete cloth.cloth_c; + mDoHIO_root.m_subroot.deleteChild(g_snHIO.field_0x4); + JKRSetCurrentHeap(oldHeap); + heap->destroy(); + dComIfG_deleteStageRes("Stage"); + dComIfGp_setWindowNum(0); + dComIfGs_setRestartOption(0); } /* 80230A14-80230AD0 .text MemCardCheckMain__10dScnName_cFv */ @@ -330,22 +474,49 @@ void dScnName_c::MemCardCheckDbgWait() { /* 80231428-80231454 .text FileErrorDraw__10dScnName_cFv */ void dScnName_c::FileErrorDraw() { - /* Nonmatching */ + if (dFe_c) { + dFe_c->_draw(); + } } /* 80231454-802314E8 .text NoteOpen__10dScnName_cFv */ void dScnName_c::NoteOpen() { - /* Nonmatching */ + if (field_0x558) { + field_0x558--; + return; + } + mDoAud_seStart(2201, NULL, 0, 0); + mMainProc = 2; + field_0x55d = 1; + cloth.cloth_c->init(); + field_0x559 = g_snHIO.field_0x6; } /* 802314E8-802315A8 .text NoteOpenWait__10dScnName_cFv */ void dScnName_c::NoteOpenWait() { - /* Nonmatching */ + if (field_0x559) { + field_0x559--; + return; + } + if (g_snHIO.field_0x8 == 0) { + if (fpcM_GetName(this) == PROC_NAME_SCENE) { + dFs_c->field_0x3938 = field_0x560; + dFs_c->field_0x393c = savePicDatabuf; + } + if (fpcM_GetName(this) == PROC_NAMEEX_SCENE) { + dFs_c->field_0x3938 = dMs_c->field_0x0554; + dFs_c->field_0x393c = savePicDatabuf; + } + dFs_c->initial(); + mMainProc = 3; + field_0x555 = 0; + mDrawProc = 1; + } } /* 802315A8-802315E0 .text FileSelectOpen__10dScnName_cFv */ void dScnName_c::FileSelectOpen() { - /* Nonmatching */ + (this->*(FileSelOpenProc[field_0x555]))(); } /* 802315E0-802319B4 .text buttonIconProc__10dScnName_cFv */ @@ -355,7 +526,16 @@ void dScnName_c::buttonIconProc() { /* 802319B4-80231A24 .text FileSelOpenMain__10dScnName_cFv */ void dScnName_c::FileSelOpenMain() { - /* Nonmatching */ + if (dFs_c->_open() != 1) { + return; + } + if (fpcM_GetName(this) == PROC_NAMEEX_SCENE) { + field_0x1bb6 = 2; + } else { + field_0x1bb6 = 1; + } + dFs_c->field_0x3936 = field_0x1bb6; + mMainProc = 4; } /* 80231A24-80231A28 .text FileselOpenWait__10dScnName_cFv */ @@ -363,7 +543,14 @@ void dScnName_c::FileselOpenWait() {} /* 80231A28-80231A8C .text FileSelectMain__10dScnName_cFv */ void dScnName_c::FileSelectMain() { - /* Nonmatching */ + dFs_c->_move(); + field_0x1bb6 = dFs_c->field_0x3936; + if (fpcM_GetName(this) == PROC_NAME_SCENE) { + FileSelectMainNormal(); + } + if (fpcM_GetName(this) == PROC_NAMEEX_SCENE) { + FileSelectMainExSave(); + } } /* 80231A8C-80231CB8 .text FileSelectMainNormal__10dScnName_cFv */ @@ -374,6 +561,19 @@ void dScnName_c::FileSelectMainNormal() { /* 80231CB8-80231D00 .text FileSelectMainExSave__10dScnName_cFv */ void dScnName_c::FileSelectMainExSave() { /* Nonmatching */ + switch (dFs_c->field_0x392c) { + case 1: + field_0x558 = 0x2d; + mMainProc = 13; + return; + case 2: + case 3: + field_0x1bb6 = 3; + mMainProc = 5; + return; + default: + return; + } } /* 80231D00-80231D28 .text ResetWait__10dScnName_cFv */ @@ -387,22 +587,64 @@ void dScnName_c::ResetWait() { /* 80231D28-80231E9C .text FileSelectClose__10dScnName_cFv */ void dScnName_c::FileSelectClose() { - /* Nonmatching */ + if (dFs_c->_close() == 1) { + switch (dFs_c->field_0x392c) { + case 2: + if (fpcM_GetName(this) == PROC_NAMEEX_SCENE) { + dMs_c->initialize(); + dMs_c->field_0x053c = 1; + dMs_c->field_0x053d = dFs_c->field_0x392f; + if (dFs_c->field_0x392f == 2) { + dMs_c->initializeEx(); + } + mMainProc = 10; + mDrawProc = 3; + } else { + field_0x55d = 0; + cloth.cloth_c->init(); + mMainProc = 0; + field_0x556 = 0; + mDrawProc = 0; + } + cloth.cloth_c->alpha_out(); + break; + case 3: + cloth.cloth_c->alpha_out(); + dMs_c->initialize(); + mMainProc = 10; + mDrawProc = 3; + break; + case 1: + if (field_0x1bb9[0]) { + strcpy(dNm_c->field_0x2ad0, dComIfGs_getPlayerName()); + } else { + strcpy(dNm_c->field_0x2ad0,""); + } + dNm_c->initial(); + mMainProc = 6; + field_0x555 = 0; + mDrawProc = 2; + break; + } + } } /* 80231E9C-80231EC0 .text FileSelectDraw__10dScnName_cFv */ void dScnName_c::FileSelectDraw() { - /* Nonmatching */ + dFs_c->_draw(); } /* 80231EC0-80231EF8 .text NameInOpen__10dScnName_cFv */ void dScnName_c::NameInOpen() { - /* Nonmatching */ + (this->*(NameOpenProc[field_0x555]))(); } /* 80231EF8-80231F44 .text NameOpenMain__10dScnName_cFv */ void dScnName_c::NameOpenMain() { - /* Nonmatching */ + if (dNm_c->_open() == true) { + field_0x1bb6 = 0; + mMainProc = 7; + } } /* 80231F44-80231F48 .text NameOpenWait__10dScnName_cFv */ @@ -416,41 +658,77 @@ void dScnName_c::NameInMain() { /* 80231FF4-80232050 .text NameInClose__10dScnName_cFv */ void dScnName_c::NameInClose() { /* Nonmatching */ + if (dNm_c->_close() == 1) { + dFs_c->initial(); + mMainProc = 3; + field_0x555 = 0; + mDrawProc = 1; + } } /* 80232050-80232074 .text NameInDraw__10dScnName_cFv */ void dScnName_c::NameInDraw() { - /* Nonmatching */ + dNm_c->_draw(); } /* 80232074-802320C0 .text ShopDemoDataLoad__10dScnName_cFv */ void dScnName_c::ShopDemoDataLoad() { - /* Nonmatching */ + field_0x410 = mDoDvdThd_toMainRam_c::create("/res/ShopDemo/zelda_save.bin", 0, NULL); + mMainProc = 15; } /* 802320C0-8023213C .text ShopDemoDataSet__10dScnName_cFv */ void dScnName_c::ShopDemoDataSet() { - /* Nonmatching */ + if (field_0x410->sync()) { + memcpy(field_0x560, ((u8*)field_0x410->getMemAddress()) + 8, 0x1650); + delete field_0x410; + mMainProc = 1; + mDrawProc = 4; + } } /* 8023213C-802321AC .text SaveOpen__10dScnName_cFv */ void dScnName_c::SaveOpen() { - /* Nonmatching */ + if (field_0x558) { + field_0x558--; + return; + } + if (dMs_c->_open() == 1) { + field_0x1bb6 = 1; + dFs_c->field_0x3936 = field_0x1bb6; + mMainProc = 11; + } } /* 802321AC-8023222C .text SaveMain__10dScnName_cFv */ void dScnName_c::SaveMain() { - /* Nonmatching */ + switch (dMs_c->field_0x0531) { + case 2: + dMs_c->_move(); + if (!dMs_c->field_0x0538) { + field_0x558 = 0x2d; + mMainProc = 13; + } + break; + case 3: + field_0x1bb6 = 3; + mMainProc = 12; + break; + } } /* 8023222C-80232278 .text SaveClose__10dScnName_cFv */ void dScnName_c::SaveClose() { - /* Nonmatching */ + if (dMs_c->_close() == true) { + mMainProc = 1; + mDrawProc = 4; + } + } /* 80232278-8023229C .text SaveDraw__10dScnName_cFv */ void dScnName_c::SaveDraw() { - /* Nonmatching */ + dMs_c->_draw2(); } /* 8023229C-802322A0 .text NoneDraw__10dScnName_cFv */ @@ -508,6 +786,12 @@ void dDlst_BTICN_c::draw() { /* 8023245C-80232518 .text draw__19dDlst_FLSEL_CLOTH_cFv */ void dDlst_FLSEL_CLOTH_c::draw() { /* Nonmatching */ + Mtx44 mtx; + view_port_class* viewport = g_dComIfG_gameInfo.play.mCurrentViewport; + C_MTXPerspective(mtx, 30.0f, (viewport->mWidth / viewport->mHeight) * g_HIO.field_0x0c, 1.0f, 100000.0f); + GXSetProjection(mtx, GX_PERSPECTIVE); + cloth_c->draw(0.0f, (GXColor){0xe3, 0xff, 0xb3, 0xff}, GXColor(), 0); + dComIfGp_getCurrentGrafPort()->setPort(); } scene_method_class l_dScnName_Method = {