From 5f30b342979f41b07fbf2f110fa61e8fff48842d Mon Sep 17 00:00:00 2001 From: LagoLunatic Date: Wed, 24 Dec 2025 16:43:46 -0500 Subject: [PATCH] Copy OptRuby inline name from TWW debug --- include/d/d_com_inf_game.h | 79 ++++++++++++++++++------------------ include/d/d_save.h | 9 ++-- src/d/d_menu_letter.cpp | 2 +- src/d/d_menu_option.cpp | 6 +-- src/d/d_meter_button.cpp | 2 +- src/d/d_msg_scrn_3select.cpp | 4 +- src/d/d_msg_scrn_explain.cpp | 2 +- src/d/d_msg_scrn_item.cpp | 2 +- src/d/d_msg_scrn_jimaku.cpp | 2 +- src/d/d_msg_scrn_kanban.cpp | 2 +- src/d/d_msg_scrn_talk.cpp | 2 +- src/d/d_msg_scrn_tree.cpp | 2 +- src/d/d_save.cpp | 4 +- 13 files changed, 58 insertions(+), 60 deletions(-) diff --git a/include/d/d_com_inf_game.h b/include/d/d_com_inf_game.h index 72f31ecbc0a..2d395f3a563 100644 --- a/include/d/d_com_inf_game.h +++ b/include/d/d_com_inf_game.h @@ -1462,27 +1462,63 @@ inline u8 dComIfGs_getSelectItemIndex(int i_no) { return g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusA().getSelectItemIndex(i_no); } -//TODO: actual name is unknown -inline u8 dComIfGs_getOptUnk0() { - return g_dComIfG_gameInfo.info.getPlayer().getConfig().getUnk0(); +// Ruby inline names are from TWW debug. +inline u8 dComIfGs_getOptRuby() { + return g_dComIfG_gameInfo.info.getPlayer().getConfig().getRuby(); +} + +inline void dComIfGs_setOptRuby(u8 i_ruby) { + g_dComIfG_gameInfo.info.getPlayer().getConfig().setRuby(i_ruby); } inline u8 dComIfGs_getOptVibration() { return g_dComIfG_gameInfo.info.getPlayer().getConfig().getVibration(); } +inline void dComIfGs_setOptVibration(u8 i_status) { + g_dComIfG_gameInfo.info.getPlayer().getConfig().setVibration(i_status); +} + inline u8 dComIfGs_getOptAttentionType() { return g_dComIfG_gameInfo.info.getPlayer().getConfig().getAttentionType(); } +inline void dComIfGs_setOptAttentionType(u8 i_attentionType) { + g_dComIfG_gameInfo.info.getPlayer().getConfig().setAttentionType(i_attentionType); +} + inline u8 dComIfGs_getOptCameraControl() { return g_dComIfG_gameInfo.info.getPlayer().getConfig().getCameraControl(); } +inline void dComIfGs_setOptCameraControl(u8 i_cameraControl) { + g_dComIfG_gameInfo.info.getPlayer().getConfig().setCameraControl(i_cameraControl); +} + inline u8 dComIfGs_getOptSound() { return g_dComIfG_gameInfo.info.getPlayer().getConfig().getSound(); } +inline void dComIfGs_setOptSound(u8 i_mode) { + g_dComIfG_gameInfo.info.getPlayer().getConfig().setSound(i_mode); +} + +inline void dComIfGs_setOptCalValue(s8 i_calValue) { + g_dComIfG_gameInfo.info.getPlayer().getConfig().setCalValue(i_calValue); +} + +inline void dComIfGs_setOptCalibrateDist(u16 i_calibrateDist) { + g_dComIfG_gameInfo.info.getPlayer().getConfig().setCalibrateDist(i_calibrateDist); +} + +inline u8 dComIfGs_getOptPointer() { + return g_dComIfG_gameInfo.info.getPlayer().getConfig().getPointer(); +} + +inline void dComIfGs_setOptPointer(u8 i_pointer) { + g_dComIfG_gameInfo.info.getPlayer().getConfig().setPointer(i_pointer); +} + inline BOOL dComIfGs_isTbox(int i_no) { return g_dComIfG_gameInfo.info.getMemory().getBit().isTbox(i_no); } @@ -2034,35 +2070,6 @@ inline void dComIfGs_setLastWarpAcceptStage(s8 param_0) { g_dComIfG_gameInfo.info.getPlayer().getPlayerLastMarkInfo().setWarpAcceptStage(param_0); } -//TODO: actual name is unknown -inline void dComIfGs_setOptUnk0(u8 i_unk0) { - g_dComIfG_gameInfo.info.getPlayer().getConfig().setUnk0(i_unk0); -} - -inline void dComIfGs_setOptSound(u8 i_mode) { - g_dComIfG_gameInfo.info.getPlayer().getConfig().setSound(i_mode); -} - -inline void dComIfGs_setOptVibration(u8 i_status) { - g_dComIfG_gameInfo.info.getPlayer().getConfig().setVibration(i_status); -} - -inline void dComIfGs_setOptAttentionType(u8 i_attentionType) { - g_dComIfG_gameInfo.info.getPlayer().getConfig().setAttentionType(i_attentionType); -} - -inline void dComIfGs_setOptCameraControl(u8 i_cameraControl) { - g_dComIfG_gameInfo.info.getPlayer().getConfig().setCameraControl(i_cameraControl); -} - -inline void dComIfGs_setOptPointer(u8 i_pointer) { - g_dComIfG_gameInfo.info.getPlayer().getConfig().setPointer(i_pointer); -} - -inline u8 dComIfGs_getOptPointer() { - return g_dComIfG_gameInfo.info.getPlayer().getConfig().getPointer(); -} - inline u8 dComIfGs_getNewFile() { return g_dComIfG_gameInfo.info.getNewFile(); } @@ -2091,14 +2098,6 @@ inline u8 dComIfGs_getWalletSize() { return g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusA().getWalletSize(); } -inline void dComIfGs_setOptCalValue(s8 i_calValue) { - g_dComIfG_gameInfo.info.getPlayer().getConfig().setCalValue(i_calValue); -} - -inline void dComIfGs_setOptCalibrateDist(u16 i_calibrateDist) { - g_dComIfG_gameInfo.info.getPlayer().getConfig().setCalibrateDist(i_calibrateDist); -} - inline u16 dComIfGs_getFishNum(u8 param_0) { return g_dComIfG_gameInfo.info.getPlayer().getFishingInfo().getFishCount(param_0); } diff --git a/include/d/d_save.h b/include/d/d_save.h index e8eccb9d1b0..fff3db0a7a6 100644 --- a/include/d/d_save.h +++ b/include/d/d_save.h @@ -506,10 +506,9 @@ public: void setVibration(u8 i_status); u8 getPalLanguage() const; - //TODO: placeholder name, actual name is not known - u8 getUnk0() { return unk0; } - void setUnk0(u8 i_unk0) { unk0 = i_unk0; } - + // Ruby inline names are from TWW debug. + u8 getRuby() { return mRuby; } + void setRuby(u8 i_ruby) { mRuby = i_ruby; } u8 getAttentionType() { return mAttentionType; } void setAttentionType(u8 i_mAttentionType) { mAttentionType = i_mAttentionType; } u16 getCalibrateDist() { return mCalibrateDist; } @@ -532,7 +531,7 @@ public: }; private: - /* 0x0 */ u8 unk0; + /* 0x0 */ u8 mRuby; /* 0x1 */ u8 mSoundMode; /* 0x2 */ u8 mAttentionType; // Lock-On Type; 0 : hold, 1 : switch /* 0x3 */ u8 mVibration; // Rumble status diff --git a/src/d/d_menu_letter.cpp b/src/d/d_menu_letter.cpp index 65abead0630..7e45500dc9d 100644 --- a/src/d/d_menu_letter.cpp +++ b/src/d/d_menu_letter.cpp @@ -981,7 +981,7 @@ void dMenu_Letter_c::screenSetLetter() { dPaneClass_showNullPane(mpLetterScreen[0]); #if VERSION == VERSION_GCN_JPN - if (dComIfGs_getOptUnk0() == 0) { + if (dComIfGs_getOptRuby() == 0) { field_0x2ec[0] = new CPaneMgr(mpLetterScreen[0], 't3f_s', 0, NULL); field_0x2ec[1] = new CPaneMgr(mpLetterScreen[0], 'mg_3flin', 0, NULL); field_0x2f4[0] = new CPaneMgr(mpLetterScreen[0], 'mg_3f_s', 0, NULL); diff --git a/src/d/d_menu_option.cpp b/src/d/d_menu_option.cpp index 1e2226db891..07cac3bdee0 100644 --- a/src/d/d_menu_option.cpp +++ b/src/d/d_menu_option.cpp @@ -1128,9 +1128,9 @@ void dMenu_Option_c::confirm_close_move() { dComIfGs_setOptAttentionType(field_0x3e4); #if VERSION == VERSION_GCN_JPN if (field_0x3e5_JPN == 0) { - dComIfGs_setOptUnk0(1); + dComIfGs_setOptRuby(1); } else { - dComIfGs_setOptUnk0(0); + dComIfGs_setOptRuby(0); } #endif if (isRumbleSupported()) { @@ -2144,7 +2144,7 @@ void dMenu_Option_c::paneResize(u64 i_tag) { void dMenu_Option_c::initialize() { field_0x3e4 = dComIfGs_getOptAttentionType(); #if VERSION == VERSION_GCN_JPN - if (dComIfGs_getOptUnk0() == 0) { + if (dComIfGs_getOptRuby() == 0) { field_0x3e5_JPN = 1; } else { field_0x3e5_JPN = 0; diff --git a/src/d/d_meter_button.cpp b/src/d/d_meter_button.cpp index 2995517ef0a..7147e97bc33 100644 --- a/src/d/d_meter_button.cpp +++ b/src/d/d_meter_button.cpp @@ -1444,7 +1444,7 @@ void dMeterButton_c::screenInitText() { JUT_ASSERT(2499, mpTmRoot_c != NULL); #if VERSION == VERSION_GCN_JPN - if (dComIfGs_getOptUnk0() == 0) { + if (dComIfGs_getOptRuby() == 0) { mpTm_c[0] = new CPaneMgr(mpTextScreen, 'mg_3flin', 0, NULL); mpTm_c[1] = new CPaneMgr(mpTextScreen, 't3f_s', 0, NULL); diff --git a/src/d/d_msg_scrn_3select.cpp b/src/d/d_msg_scrn_3select.cpp index bfd268aab6a..834919ff1d6 100644 --- a/src/d/d_msg_scrn_3select.cpp +++ b/src/d/d_msg_scrn_3select.cpp @@ -108,7 +108,7 @@ dMsgScrn3Select_c::dMsgScrn3Select_c() { } #if VERSION == VERSION_GCN_JPN - if (dComIfGs_getOptUnk0() == 0) { + if (dComIfGs_getOptRuby() == 0) { mpTmSel_c[0] = new CPaneMgr(mpScreen, 'a_tf', 0, NULL); mpTmSel_c[1] = new CPaneMgr(mpScreen, 'b_tf', 0, NULL); @@ -911,7 +911,7 @@ void dMsgScrn3Select_c::selectTrans() { f32 sp68[3]; for (int i = 0; i < 3; i++) { #if VERSION == VERSION_GCN_JPN - if (dComIfGs_getOptUnk0() == 0 && (field_0x112 & (u8)(1 << i)) != 0) { + if (dComIfGs_getOptRuby() == 0 && (field_0x112 & (u8)(1 << i)) != 0) { sp68[i] = 0.0f; } else { f32 temp = mpTmSel_c[i]->getInitPosY(); diff --git a/src/d/d_msg_scrn_explain.cpp b/src/d/d_msg_scrn_explain.cpp index 8ffd59b5ded..01794f419e9 100644 --- a/src/d/d_msg_scrn_explain.cpp +++ b/src/d/d_msg_scrn_explain.cpp @@ -90,7 +90,7 @@ dMsgScrnExplain_c::dMsgScrnExplain_c(STControl* i_stick, u8 param_1, bool param_ #if VERSION == VERSION_GCN_JPN field_0x50 = 0.0f; - if (dComIfGs_getOptUnk0() == 0) { + if (dComIfGs_getOptRuby() == 0) { mpTm_c[0] = new CPaneMgr(mpTxScreen, 'mg_3flin', 0, NULL); mpTm_c[1] = new CPaneMgr(mpTxScreen, 't3f_s', 0, NULL); diff --git a/src/d/d_msg_scrn_item.cpp b/src/d/d_msg_scrn_item.cpp index 02943d326c8..e6cd7f582af 100644 --- a/src/d/d_msg_scrn_item.cpp +++ b/src/d/d_msg_scrn_item.cpp @@ -198,7 +198,7 @@ dMsgScrnItem_c::dMsgScrnItem_c(u8 param_1, u8 param_2, JKRExpHeap* param_3) { mpPmP_c->scale(g_MsgObject_HIO_c.mBoxItemScaleX, g_MsgObject_HIO_c.mBoxItemScaleY); #if VERSION == VERSION_GCN_JPN - if (dComIfGs_getOptUnk0() == 0) { + if (dComIfGs_getOptRuby() == 0) { mpTm_c[0] = new CPaneMgr(mpTxScreen, 'mg_3flin', 0, NULL); JUT_ASSERT(407, mpTm_c[0] != NULL); diff --git a/src/d/d_msg_scrn_jimaku.cpp b/src/d/d_msg_scrn_jimaku.cpp index 0d921528e96..53d83df3207 100644 --- a/src/d/d_msg_scrn_jimaku.cpp +++ b/src/d/d_msg_scrn_jimaku.cpp @@ -46,7 +46,7 @@ dMsgScrnJimaku_c::dMsgScrnJimaku_c(u8 param_0, JKRExpHeap* i_heap) { mpPmP_c->paneTrans(0.0f, field_0xcc); #if VERSION == VERSION_GCN_JPN - if (dComIfGs_getOptUnk0() == 0) { + if (dComIfGs_getOptRuby() == 0) { mpTm_c[0] = new CPaneMgr(mpScreen, 'mg_3flin', 0, NULL); mpTm_c[1] = new CPaneMgr(mpScreen, 't3f_s', 0, NULL); diff --git a/src/d/d_msg_scrn_kanban.cpp b/src/d/d_msg_scrn_kanban.cpp index 4a84e0f9e3e..864d533bff5 100644 --- a/src/d/d_msg_scrn_kanban.cpp +++ b/src/d/d_msg_scrn_kanban.cpp @@ -58,7 +58,7 @@ dMsgScrnKanban_c::dMsgScrnKanban_c(JKRExpHeap* param_0) { #if VERSION == VERSION_GCN_JPN - if (dComIfGs_getOptUnk0() != 0) { + if (dComIfGs_getOptRuby() != 0) { static u64 const t_tag[3] = {'mg_3line', 't3_w', 't3_s'}; for (int i = 0; i < 3; i++) { mpTm_c[i] = new CPaneMgr(mpScreen, t_tag[i], 0, NULL); diff --git a/src/d/d_msg_scrn_talk.cpp b/src/d/d_msg_scrn_talk.cpp index d45b67c2199..5324728edcc 100644 --- a/src/d/d_msg_scrn_talk.cpp +++ b/src/d/d_msg_scrn_talk.cpp @@ -106,7 +106,7 @@ dMsgScrnTalk_c::dMsgScrnTalk_c(u8 param_1, u8 param_2, JKRExpHeap* param_3) { mpPmP_c->scale(g_MsgObject_HIO_c.mBoxTalkScaleX, g_MsgObject_HIO_c.mBoxTalkScaleY); #if VERSION == VERSION_GCN_JPN - if (dComIfGs_getOptUnk0() == 0) { + if (dComIfGs_getOptRuby() == 0) { mpTm_c[0] = new CPaneMgr(mpTxScreen, 'mg_3flin', 0, NULL); mpTm_c[1] = new CPaneMgr(mpTxScreen, 't3f_s', 0, NULL); diff --git a/src/d/d_msg_scrn_tree.cpp b/src/d/d_msg_scrn_tree.cpp index 15403b83b90..6165a62b8f3 100644 --- a/src/d/d_msg_scrn_tree.cpp +++ b/src/d/d_msg_scrn_tree.cpp @@ -58,7 +58,7 @@ dMsgScrnTree_c::dMsgScrnTree_c(JUTFont* param_0, JKRExpHeap* param_1) { mpScreen->search('white_m')->setAnimation(field_0xd4); #if VERSION == VERSION_GCN_JPN - if (dComIfGs_getOptUnk0() != 0) { + if (dComIfGs_getOptRuby() != 0) { for (int i = 0; i < 3; i++) { static u64 const t_tag[3] = {'mg_3line', 't3_w', 't3_s'}; diff --git a/src/d/d_save.cpp b/src/d/d_save.cpp index 0395d351dc8..78b7c536a5f 100644 --- a/src/d/d_save.cpp +++ b/src/d/d_save.cpp @@ -973,9 +973,9 @@ void dSv_player_info_c::init() { void dSv_player_config_c::init() { #if VERSION == VERSION_GCN_JPN - unk0 = 0; + mRuby = 0; #else - unk0 = 1; + mRuby = 1; #endif #if PLATFORM_GCN