From 683cf9324dcf8d182ec35d86874dd87a63364ebe Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Fri, 19 Apr 2024 22:07:48 -0700 Subject: [PATCH] d_s_name minor work --- include/JSystem/J2DGraph/J2DPane.h | 2 +- include/d/d_s_name.h | 2 +- src/d/d_s_name.cpp | 105 ++++++++++++++++++++++++++++- 3 files changed, 104 insertions(+), 5 deletions(-) diff --git a/include/JSystem/J2DGraph/J2DPane.h b/include/JSystem/J2DGraph/J2DPane.h index a554af3a8..3a2a9c77b 100644 --- a/include/JSystem/J2DGraph/J2DPane.h +++ b/include/JSystem/J2DGraph/J2DPane.h @@ -83,11 +83,11 @@ public: bool isConnectParent() const { return mIsConnectParent; } void show() { mVisible = true; } void hide() { mVisible = false; } + bool isVisible() { return mVisible; } void getBounds() {} void getGlbBounds() {} void getRotate() const {} - void isVisible() {} void place(const JGeometry::TBox2&) {} void rotate(f32) {} void rotate(f32, f32, J2DRotateAxis, f32) {} diff --git a/include/d/d_s_name.h b/include/d/d_s_name.h index 8c1cea787..bc9627c00 100644 --- a/include/d/d_s_name.h +++ b/include/d/d_s_name.h @@ -151,7 +151,7 @@ public: /* 0x474 */ fopMsgM_pane_class field_0x474; /* 0x4AC */ fopMsgM_pane_class field_0x4ac; /* 0x4E4 */ fopMsgM_pane_class field_0x4e4; - /* 0x41C */ fopMsgM_pane_class field_0x51c; + /* 0x51C */ fopMsgM_pane_class field_0x51c; /* 0x554 */ u8 mMainProc; /* 0x555 */ u8 field_0x555; /* 0x556 */ u8 field_0x556; diff --git a/src/d/d_s_name.cpp b/src/d/d_s_name.cpp index 57169bf6d..899f60966 100644 --- a/src/d/d_s_name.cpp +++ b/src/d/d_s_name.cpp @@ -22,6 +22,7 @@ #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_MemCard.h" #include "m_Do/m_Do_mtx.h" #include "m_Do/m_Do_Reset.h" #include "JSystem/J2DGraph/J2DOrthoGraph.h" @@ -416,7 +417,7 @@ void dScnName_c::MemCardGotoIPLSelect() { /* 80230E50-80230E7C .text MemCardGotoIPL__10dScnName_cFv */ void dScnName_c::MemCardGotoIPL() { - /* Nonmatching */ + OSResetSystem(1, 1, TRUE); } /* 80230E7C-80230F4C .text MemCardErrMsgWaitNoSaveSel__10dScnName_cFv */ @@ -437,6 +438,11 @@ void dScnName_c::MemCardErrMsgWaitFormatSel2() { /* 8023106C-802310C0 .text MemCardFormat__10dScnName_cFv */ void dScnName_c::MemCardFormat() { /* Nonmatching */ + field_0x1bbc = g_mDoMemCd_control.FormatSync(); + if (field_0x1bbc != 0) { + dFe_c->closeMessage(); + field_0x556 = 8; + } } /* 802310C0-8023117C .text MemCardFormatCheck__10dScnName_cFv */ @@ -451,7 +457,11 @@ void dScnName_c::MemCardMakeGameFileSel() { /* 80231284-802312D8 .text MemCardMakeGameFile__10dScnName_cFv */ void dScnName_c::MemCardMakeGameFile() { - /* Nonmatching */ + field_0x1bbc = g_mDoMemCd_control.SaveSync(); + if (field_0x1bbc != 0) { + dFe_c->closeMessage(); + field_0x556 = 11; + } } /* 802312D8-80231398 .text MemCardMakeGameFileCheck__10dScnName_cFv */ @@ -461,7 +471,8 @@ void dScnName_c::MemCardMakeGameFileCheck() { /* 80231398-802313AC .text MemCardGotoFileSelect__10dScnName_cFv */ void dScnName_c::MemCardGotoFileSelect() { - /* Nonmatching */ + mMainProc = 1; + mDrawProc = 4; } /* 802313AC-802313B0 .text MemCardCheckDbg__10dScnName_cFv */ @@ -522,6 +533,94 @@ void dScnName_c::FileSelectOpen() { /* 802315E0-802319B4 .text buttonIconProc__10dScnName_cFv */ void dScnName_c::buttonIconProc() { /* Nonmatching */ + switch (field_0x1bb6) { + case 0: + { + s32 ret = paneTransButtonIcon(field_0x1bb4 - g_snHIO.field_0xf, g_snHIO.field_0xe, g_snHIO.field_0xc, 0.0f, 1); + field_0x1bb4++; + if (ret == 1) { + field_0x1bb4 = 0; + field_0x1bb6 = 6; + dFs_c->field_0x3936 = field_0x1bb6; + } + } + break; + case 1: + { + if (field_0x51c.pane->isVisible()) { + field_0x51c.pane->hide(); + field_0x474.pane->hide(); + field_0x4ac.pane->hide(); + } + s32 ret = paneTransButtonIcon(field_0x1bb4 - g_snHIO.field_0xf, g_snHIO.field_0xe, g_snHIO.field_0xc, 0.0f, 1); + field_0x1bb4++; + if (ret == 1) { + field_0x1bb4 = 0; + field_0x1bb6 = 6; + dFs_c->field_0x3936 = field_0x1bb6; + } + } + break; + case 2: + { + if (!field_0x51c.pane->isVisible()) { + field_0x51c.pane->show(); + field_0x474.pane->show(); + field_0x4ac.pane->show(); + } + s32 ret = paneTransButtonIcon(field_0x1bb4 - g_snHIO.field_0xf, g_snHIO.field_0xe, g_snHIO.field_0xc, 0.0f, 1); + field_0x1bb4++; + if (ret == 1) { + field_0x1bb4 = 0; + field_0x1bb6 = 6; + dFs_c->field_0x3936 = field_0x1bb6; + } + } + break; + case 3: + { + s32 ret = paneTransButtonIcon(field_0x1bb4 - g_snHIO.field_0xf, g_snHIO.field_0xe, g_snHIO.field_0xc, 0.0f, 1); + field_0x1bb4++; + if (ret == 1) { + field_0x1bb4 = 0; + field_0x1bb6 = 6; + dFs_c->field_0x3936 = field_0x1bb6; + } + } + break; + case 4: + { + s32 ret = paneTransButtonIcon(field_0x1bb4 - g_snHIO.field_0xf, g_snHIO.field_0xe, g_snHIO.field_0xc, 0.0f, 1); + field_0x1bb4++; + if (ret == 1) { + field_0x1bb4 = 0; + if (!field_0x51c.pane->isVisible()) { + field_0x51c.pane->show(); + field_0x474.pane->show(); + field_0x4ac.pane->show(); + } + field_0x1bb6 = 0; + dFs_c->field_0x3936 = field_0x1bb6; + } + } + break; + case 5: + { + s32 ret = paneTransButtonIcon(field_0x1bb4 - g_snHIO.field_0xf, g_snHIO.field_0xe, g_snHIO.field_0xc, 0.0f, 1); + field_0x1bb4++; + if (ret == 1) { + field_0x1bb4 = 0; + if (field_0x51c.pane->isVisible()) { + field_0x51c.pane->hide(); + field_0x474.pane->hide(); + field_0x4ac.pane->hide(); + } + field_0x1bb6 = 0; + dFs_c->field_0x3936 = field_0x1bb6; + } + } + break; + } } /* 802319B4-80231A24 .text FileSelOpenMain__10dScnName_cFv */