From 4d8a99efcbca4568c4d5a88dad028785d036b17e Mon Sep 17 00:00:00 2001 From: Tanline666 <93364055+Tanline666@users.noreply.github.com> Date: Sat, 29 Aug 2026 12:55:46 -0600 Subject: [PATCH 1/7] RPSysSystem WIP, RPSysHomeMenuMgr WIP, RPSysPauseMgr WIP (#143) * RPSysSystem::softResetCallback 100%, beginning RPSysHomeMenuMgr and RPSysPauseMgr * Fixed build.yml * fixed for real * softResetCallBack 100%, HomeMenuMgr WIP * More work on RPSysSystem, reverting build.yml * Implementing requested changes * Update RPSndMoveParam.h Reverting offsets * Fixing startLoadCount, now 100% (part 1, header will be changed) * Header change * Another change I forgot to make --------- Co-authored-by: Texline666 --- config/RSPE01_01/symbols.txt | 58 ++--- include/Pack/RPGraphics.h | 1 + include/Pack/RPGraphics/IRPGrpDrawObject.h | 40 ++++ include/Pack/RPGraphics/RPGrpRenderer.h | 8 + include/Pack/RPKernel.h | 2 + include/Pack/RPKernel/RPSysController.h | 6 +- include/Pack/RPKernel/RPSysEffectCreator.h | 23 ++ include/Pack/RPKernel/RPSysEffectMgr.h | 38 ++++ include/Pack/RPKernel/RPSysHomeMenuMgr.h | 47 ++++ .../RPKernel/RPSysKokeshiCtrlDataLoader.h | 2 +- .../Pack/RPKernel/RPSysKokeshiCtrlDataMgr.h | 4 +- include/Pack/RPSystem.h | 1 + include/Pack/RPSystem/RPSysDvdStatus.h | 13 +- include/Pack/RPSystem/RPSysPauseMgr.h | 33 +++ include/Pack/RPSystem/RPSysRenderMode.h | 24 ++ include/Pack/RPSystem/RPSysScene.h | 202 +++++++++++++++- include/Pack/RPSystem/RPSysSceneMgr.h | 215 +++++++++++++++++- include/Pack/RPSystem/RPSysSystem.h | 64 +++++- include/egg/core/eggDisplay.h | 2 +- include/nw4r/snd/snd_SoundArchivePlayer.h | 4 +- include/nw4r/snd/snd_SoundHeap.h | 2 +- include/revolution/VI/vi.h | 2 + .../RPKernel/RPSysKokeshiCtrlDataLoader.cpp | 2 +- src/Pack/RPKernel/RPSysKokeshiCtrlDataMgr.cpp | 2 +- src/Pack/RPKernel/RPSysSystem.cpp | 81 +++++++ src/Pack/RPSystem/RPSysScene.cpp | 192 ++++++++++++++++ 26 files changed, 1013 insertions(+), 55 deletions(-) create mode 100644 include/Pack/RPGraphics/IRPGrpDrawObject.h create mode 100644 include/Pack/RPKernel/RPSysEffectCreator.h create mode 100644 include/Pack/RPKernel/RPSysEffectMgr.h create mode 100644 include/Pack/RPSystem/RPSysPauseMgr.h create mode 100644 include/Pack/RPSystem/RPSysRenderMode.h create mode 100644 src/Pack/RPKernel/RPSysSystem.cpp create mode 100644 src/Pack/RPSystem/RPSysScene.cpp diff --git a/config/RSPE01_01/symbols.txt b/config/RSPE01_01/symbols.txt index 1c230d2e4..c452a375e 100644 --- a/config/RSPE01_01/symbols.txt +++ b/config/RSPE01_01/symbols.txt @@ -6834,40 +6834,40 @@ Play__Q210homebutton9RemoteSpkFliSc = .text:0x80182AAC; // type:function size:0x isPlaying__Q210homebutton9RemoteSpkCFl = .text:0x80182B44; // type:function size:0x1C scope:global isPlayingId__Q210homebutton9RemoteSpkCFli = .text:0x80182B60; // type:function size:0x30 scope:global isPlayReady__Q210homebutton9RemoteSpkCFl = .text:0x80182B90; // type:function size:0x1C -fn_80182BAC = .text:0x80182BAC; // type:function size:0xC -fn_80182BB8 = .text:0x80182BB8; // type:function size:0x70 -fn_80182C28 = .text:0x80182C28; // type:function size:0x34 +shutdownSystemCallBack__11RPSysSystemFv = .text:0x80182BAC; // type:function size:0xC +softResetCallBack__11RPSysSystemFv = .text:0x80182BB8; // type:function size:0x70 +setCallBack__11RPSysSystemFv = .text:0x80182C28; // type:function size:0x34 fn_80182C5C = .text:0x80182C5C; // type:function size:0xA0 -fn_80182CFC = .text:0x80182CFC; // type:function size:0xA8 +setupLocalSettings__11RPSysSystemFv = .text:0x80182CFC; // type:function size:0xA8 fn_80182DA4 = .text:0x80182DA4; // type:function size:0x148 fn_80182EEC = .text:0x80182EEC; // type:function size:0x1B0 fn_8018309C = .text:0x8018309C; // type:function size:0xDC fn_80183178 = .text:0x80183178; // type:function size:0x40 -fn_801831B8 = .text:0x801831B8; // type:function size:0x8 -fn_801831C0 = .text:0x801831C0; // type:function size:0x8 -fn_801831C8 = .text:0x801831C8; // type:function size:0x8 +getTimeStampString__11RPSysSystemFv = .text:0x801831B8; // type:function size:0x8 +getDvdEndMessage__11RPSysSystemCFv = .text:0x801831C0; // type:function size:0x8 +getNandEndMessage__11RPSysSystemCFv = .text:0x801831C8; // type:function size:0x8 fn_801831D0 = .text:0x801831D0; // type:function size:0x8 -fn_801831D8 = .text:0x801831D8; // type:function size:0x8 -fn_801831E0 = .text:0x801831E0; // type:function size:0x8 +getDvdThread__11RPSysSystemFv = .text:0x801831D8; // type:function size:0x8 +getNandThread__11RPSysSystemFv = .text:0x801831E0; // type:function size:0x8 fn_801831E8 = .text:0x801831E8; // type:function size:0x8 systemShutDown__11RPSysSystemFv = .text:0x801831F0; // type:function size:0xD8 fn_801832C8 = .text:0x801832C8; // type:function size:0x28 fn_801832F0 = .text:0x801832F0; // type:function size:0x18 -fn_80183308 = .text:0x80183308; // type:function size:0xC +startLoadCount__11RPSysSystemFP11RPSysSystem = .text:0x80183308; // type:function size:0xC fn_80183314 = .text:0x80183314; // type:function size:0xA0 fn_801833B4 = .text:0x801833B4; // type:function size:0xBC -fn_80183470 = .text:0x80183470; // type:function size:0x4C -fn_801834BC = .text:0x801834BC; // type:function size:0x5C +getCalendarTime16__11RPSysSystemFv = .text:0x80183470; // type:function size:0x4C +getCalendarTime32__11RPSysSystemFv = .text:0x801834BC; // type:function size:0x5C fn_80183518 = .text:0x80183518; // type:function size:0x14 -fn_8018352C = .text:0x8018352C; // type:function size:0x8 +getBootScene__11RPSysSystemFv = .text:0x8018352C; // type:function size:0x8 fn_80183534 = .text:0x80183534; // type:function size:0x50 fn_80183584 = .text:0x80183584; // type:function size:0x24 fn_801835A8 = .text:0x801835A8; // type:function size:0xC fn_801835B4 = .text:0x801835B4; // type:function size:0xC fn_801835C0 = .text:0x801835C0; // type:function size:0x14 fn_801835D4 = .text:0x801835D4; // type:function size:0x8 -fn_801835DC = .text:0x801835DC; // type:function size:0x130 -fn_8018370C = .text:0x8018370C; // type:function size:0x6C +setupRenderMode__11RPSysSystemFv = .text:0x801835DC; // type:function size:0x130 +setupTVMode__11RPSysSystemFv = .text:0x8018370C; // type:function size:0x6C fn_80183778 = .text:0x80183778; // type:function size:0x180 mainLoop__11RPSysSystemFv = .text:0x801838F8; // type:function size:0x16C setup__11RPSysSystemFv = .text:0x80183A64; // type:function size:0x13C @@ -6933,7 +6933,7 @@ fn_801855A0 = .text:0x801855A0; // type:function size:0x4 fn_801855A4 = .text:0x801855A4; // type:function size:0x4 fn_801855A8 = .text:0x801855A8; // type:function size:0xC fn_801855B4 = .text:0x801855B4; // type:function size:0x8 -fn_801855BC = .text:0x801855BC; // type:function size:0xBC +adjust__19RPSysRenderModeFPUsPUsii = .text:0x801855BC; // type:function size:0xBC fn_80185678 = .text:0x80185678; // type:function size:0x58 fn_801856D0 = .text:0x801856D0; // type:function size:0x198 fn_80185868 = .text:0x80185868; // type:function size:0x34 @@ -6962,10 +6962,10 @@ isDvdErrorApplicationEnd__13RPSysSceneMgrCFv = .text:0x80185F04; // type:functio fn_80185F18 = .text:0x80185F18; // type:function size:0x20 fn_80185F38 = .text:0x80185F38; // type:function size:0x18 fn_80185F50 = .text:0x80185F50; // type:function size:0x14 -fn_80185F64 = .text:0x80185F64; // type:function size:0x10 -fn_80185F74 = .text:0x80185F74; // type:function size:0x70 -fn_80185FE4 = .text:0x80185FE4; // type:function size:0x70 -fn_80186054 = .text:0x80186054; // type:function size:0xAC +isNormalState__13RPSysSceneMgrFv = .text:0x80185F64; // type:function size:0x10 +shutdownSystem__13RPSysSceneMgrFi = .text:0x80185F74; // type:function size:0x70 +returnToMenu__13RPSysSceneMgrFi = .text:0x80185FE4; // type:function size:0x70 +softReset__13RPSysSceneMgrFi = .text:0x80186054; // type:function size:0xAC fn_80186100 = .text:0x80186100; // type:function size:0x8 fn_80186108 = .text:0x80186108; // type:function size:0x12C setLanguage__17RPSysProjectLocalFQ217RPSysProjectLocal5EArea = .text:0x80186234; // type:function size:0x8 @@ -7662,7 +7662,7 @@ fn_801A48D0 = .text:0x801A48D0; // type:function size:0x60 fn_801A4930 = .text:0x801A4930; // type:function size:0x24 fn_801A4954 = .text:0x801A4954; // type:function size:0x2C update__16RPSysHomeMenuMgrFv = .text:0x801A4980; // type:function size:0x390 -fn_801A4D10 = .text:0x801A4D10; // type:function size:0x58 +startBlackOut__16RPSysHomeMenuMgrFv = .text:0x801A4D10; // type:function size:0x58 fn_801A4D68 = .text:0x801A4D68; // type:function size:0x124 fn_801A4E8C = .text:0x801A4E8C; // type:function size:0x12C fn_801A4FB8 = .text:0x801A4FB8; // type:function size:0x224 @@ -15054,7 +15054,7 @@ lbl_803823F6 = .rodata:0x803823F6; // type:object size:0x11 lbl_80382407 = .rodata:0x80382407; // type:object size:0xD lbl_80382414 = .rodata:0x80382414; // type:object size:0xD lbl_80382421 = .rodata:0x80382421; // type:object size:0x17 -lbl_80382438 = .rodata:0x80382438; // type:object size:0x18 +sRenderModeTable__19RPSysRenderMode = .rodata:0x80382438; // type:object size:0x18 @stringBase0 = .rodata:0x80382450; // type:object size:0x1C scope:local data:string_table @stringBase0 = .rodata:0x80382470; // type:object size:0xF2 scope:local data:string_table lbl_80382568 = .rodata:0x80382568; // type:object size:0x48 @@ -18550,15 +18550,15 @@ __vt__Q310homebutton3gui7Manager = .data:0x803B94CC; // type:object size:0x3C __vt__Q310homebutton3gui9Component = .data:0x803B9508; // type:object size:0x60 __vt__Q210homebutton9RemoteSpk = .data:0x803B9568; // type:object size:0xC __vt__11RPSysSystem = .data:0x803B9578; // type:object size:0xC scope:global -__vt__15RPSysConfigData = .data:0x803B9584; // type:object size:0x34 scope:global +lbl_803B9584 = .data:0x803B9584; // type:object size:0x34 scope:global jumptable_803B95B8 = .data:0x803B95B8; // type:object size:0x30 scope:local __vt__17RPSysSceneCreator = .data:0x803B95E8; // type:object size:0x18 scope:global __vt__10RPSysScene = .data:0x803B9600; // type:object size:0x60 scope:global -lbl_803B9660 = .data:0x803B9660; // type:object size:0x3C -lbl_803B969C = .data:0x803B969C; // type:object size:0x3C -lbl_803B96D8 = .data:0x803B96D8; // type:object size:0x3C -lbl_803B9714 = .data:0x803B9714; // type:object size:0x3C -lbl_803B9750 = .data:0x803B9750; // type:object size:0x40 +NtscInt__11RPSysSystem = .data:0x803B9660; // type:object size:0x3C +NtscProg__11RPSysSystem = .data:0x803B969C; // type:object size:0x3C +PalInt__11RPSysSystem = .data:0x803B96D8; // type:object size:0x3C +EuRgb60Int__11RPSysSystem = .data:0x803B9714; // type:object size:0x3C +EuRgb60Prog__11RPSysSystem = .data:0x803B9750; // type:object size:0x40 jumptable_803B9790 = .data:0x803B9790; // type:object size:0x20 scope:local __vt__13RPSysSceneMgr = .data:0x803B97B0; // type:object size:0x28 scope:global @7080 = .data:0x803B97D8; // type:object size:0x20 scope:local @@ -21857,7 +21857,7 @@ sRFLBrokenType = .sbss:0x804BF4B0; // type:object size:0x1 scope:local data:byte spInstance__11RPSysSystem = .sbss:0x804BF4B8; // type:object size:0x4 data:4byte lbl_804BF4BC = .sbss:0x804BF4BC; // type:object size:0x4 data:4byte lbl_804BF4C0 = .sbss:0x804BF4C0; // type:object size:0x4 data:4byte -lbl_804BF4C4 = .sbss:0x804BF4C4; // type:object size:0x4 data:4byte +sRenderModeFormat__11RPSysSystem = .sbss:0x804BF4C4; // type:object size:0x4 data:4byte lbl_804BF4C8 = .sbss:0x804BF4C8; // type:object size:0x8 data:4byte lbl_804BF4D0 = .sbss:0x804BF4D0; // type:object size:0x8 data:4byte spInstance__13RPSysSceneMgr = .sbss:0x804BF4D8; // type:object size:0x8 data:4byte diff --git a/include/Pack/RPGraphics.h b/include/Pack/RPGraphics.h index 3dc6abaa4..3b6b9d180 100644 --- a/include/Pack/RPGraphics.h +++ b/include/Pack/RPGraphics.h @@ -1,6 +1,7 @@ #ifndef RP_PUBLIC_GRAPHICS_H #define RP_PUBLIC_GRAPHICS_H +#include #include #include #include diff --git a/include/Pack/RPGraphics/IRPGrpDrawObject.h b/include/Pack/RPGraphics/IRPGrpDrawObject.h new file mode 100644 index 000000000..ce0d1388a --- /dev/null +++ b/include/Pack/RPGraphics/IRPGrpDrawObject.h @@ -0,0 +1,40 @@ +#ifndef RP_GRAPHICS_I_DRAW_OBJECT_H +#define RP_GRAPHICS_I_DRAW_OBJECT_H +#include + +//! @addtogroup rp_graphics +//! @{ + +/** + * @brief Interface for renderable objects + */ +class IRPGrpDrawObject { +private: + //! Next renderable in the linked list + IRPGrpDrawObject* mpNext; // at 0x0 + +public: + /** + * @brief Constructor + */ + IRPGrpDrawObject() : mpNext(NULL) {} + + /** + * @brief Destructor + */ + virtual ~IRPGrpDrawObject() {} // at 0x4 + + /** + * @brief Standard draw pass + */ + virtual void UserDraw() {} // at 0x8 + + /** + * @brief Additional draw pass for debugging + */ + virtual void DebugDraw() {} // at 0xC +}; + +//! @} + +#endif diff --git a/include/Pack/RPGraphics/RPGrpRenderer.h b/include/Pack/RPGraphics/RPGrpRenderer.h index 984a707f4..8ff704506 100644 --- a/include/Pack/RPGraphics/RPGrpRenderer.h +++ b/include/Pack/RPGraphics/RPGrpRenderer.h @@ -31,6 +31,14 @@ class RPGrpRenderer { return spCurrentScreen; } + static void Begin(); + static void End(); + + static void StartDebugDraw(); + + void Rendering(); + void Destruct(); + private: //! Allocator used for model-related allocations static RPGrpRenderer* spCurrent; diff --git a/include/Pack/RPKernel.h b/include/Pack/RPKernel.h index 9912de53d..abbbd570a 100644 --- a/include/Pack/RPKernel.h +++ b/include/Pack/RPKernel.h @@ -8,6 +8,8 @@ #include #include #include +#include +#include #include #include #include diff --git a/include/Pack/RPKernel/RPSysController.h b/include/Pack/RPKernel/RPSysController.h index 6d6d73deb..708500aca 100644 --- a/include/Pack/RPKernel/RPSysController.h +++ b/include/Pack/RPKernel/RPSysController.h @@ -126,7 +126,7 @@ class RPSysCoreInfo : public WPADInfo { private: //! Information flags - u16 mFlags; // at 0x0 + u16 mFlags; // at 0x18 }; /****************************************************************************** @@ -307,9 +307,9 @@ class RPSysCoreController : public EGG::CoreController, /** * @brief Constructor * - * @param id Unique ID + * @param playerNo Player ID */ - RPSysCoreController(u32 id); + RPSysCoreController(u32 playerNo); /** * @brief Destructor diff --git a/include/Pack/RPKernel/RPSysEffectCreator.h b/include/Pack/RPKernel/RPSysEffectCreator.h new file mode 100644 index 000000000..e9fd23ef4 --- /dev/null +++ b/include/Pack/RPKernel/RPSysEffectCreator.h @@ -0,0 +1,23 @@ +#ifndef RP_KERNEL_EFFECT_CREATOR_H +#define RP_KERNEL_EFFECT_CREATOR_H +#include + +//! @addtogroup rp_kernel +//! @{ + +/** + * @brief Effect creator + */ +class RPSysEffectCreator { +public: + /** + * @brief Constructor + * + * @param effectScene Effect scene index + */ + RPSysEffectCreator(u32 effectScene); +}; + +//! @} + +#endif diff --git a/include/Pack/RPKernel/RPSysEffectMgr.h b/include/Pack/RPKernel/RPSysEffectMgr.h new file mode 100644 index 000000000..00cb44281 --- /dev/null +++ b/include/Pack/RPKernel/RPSysEffectMgr.h @@ -0,0 +1,38 @@ +#ifndef RP_KERNEL_EFFECT_MANAGER_H +#define RP_KERNEL_EFFECT_MANAGER_H +#include + +#include + +//! @addtogroup rp_kernel +//! @{ + +// Forward declarations +class RPSysEffectCreator; + +/** + * @brief Effect manager + */ +class RPSysEffectMgr { + RP_SINGLETON_DECL_EX(RPSysEffectMgr); + +public: + /** + * @brief Effect scene index + */ + enum EEffectScene { + EEffectScene_Scene, //!< Scene effects + EEffectScene_Cursor, //!< Cursor effects + EEffectScene_Work, //!< Miscellaneous effects + + EEffectScene_Max + }; + +public: + void stopAllEffect(); + void resetCreator(RPSysEffectCreator* pCreator); +}; + +//! @} + +#endif diff --git a/include/Pack/RPKernel/RPSysHomeMenuMgr.h b/include/Pack/RPKernel/RPSysHomeMenuMgr.h index 133bbfc67..ce4b9527f 100644 --- a/include/Pack/RPKernel/RPSysHomeMenuMgr.h +++ b/include/Pack/RPKernel/RPSysHomeMenuMgr.h @@ -1,8 +1,10 @@ #ifndef RP_KERNEL_HOME_MENU_MANAGER_H #define RP_KERNEL_HOME_MENU_MANAGER_H #include +#include #include +#include //! @addtogroup rp_kernel //! @{ @@ -15,6 +17,51 @@ class RPSysHomeMenuMgr { public: void update(); + + /** + * @brief Check if program is exiting/resetting and black out if true + * + * @return BOOL + */ + BOOL startBlackOut(); + +private: + struct unknownArcStruct { + void *mArcFile; + u32 UNK_0x04; // set to 1 if DVD error occurs in function 801A4E8C + u16 UNK_0x08; + u16 UNK_0x0A; + }; + + u8 mUNK_0x08; // set to 1 at the end of LoadResource. bool? + bool mUNK_0x09; // checked in 801A4E8C to make sure error has not occurred + bool mUNK_0x0A; // set to true if no DVD error and scene change disabled + bool mBlackOutOk; + u8 mUNK_0x0C; + u8 mUNK_0x0D; + u32 mUNK_0x10; + u16 mUNK_0x14; + RPSysProjectLocal* mProjectLocal; + unknownArcStruct* mARC_0x1C; + HBMDataInfo *mMenuDataInfo; + u32 mUNK_0x24; + u32 mUNK_0x28; + u32 mUNK_0x2C; + void* mUNK_0x30; + void* mSoundCallback; + u32 mUNK_0x38; + u32 mUNK_0x3C; + u32 mUNK_0x40; + u32 mUNK_0x44; // Seemingly skipped in constructor? + u32 mUNK_0x48; + u32 mUNK_0x4C; + f32 mUNK_0x50; // Set to 1.2 if the console is in PAL 50 Hz mode, otherwise 1.0 + f32 mUNK_0x54; + f32 mUNK_0x58; + u32 mUNK_0x5C; + const HBMControllerData *mHbmControllerData; + u8 mUNK_0x64[60]; + KPADStatus mKpadStatus; }; //! @} diff --git a/include/Pack/RPKernel/RPSysKokeshiCtrlDataLoader.h b/include/Pack/RPKernel/RPSysKokeshiCtrlDataLoader.h index ff6f3ddd3..b4d94c53e 100644 --- a/include/Pack/RPKernel/RPSysKokeshiCtrlDataLoader.h +++ b/include/Pack/RPKernel/RPSysKokeshiCtrlDataLoader.h @@ -29,7 +29,7 @@ class RPSysKokeshiCtrlDataLoader { /** * @brief Constructor * - * @param chan WPAD channel to use + * @param chan Remote channel */ explicit RPSysKokeshiCtrlDataLoader(s32 chan); diff --git a/include/Pack/RPKernel/RPSysKokeshiCtrlDataMgr.h b/include/Pack/RPKernel/RPSysKokeshiCtrlDataMgr.h index d6eb816c9..94c072fd0 100644 --- a/include/Pack/RPKernel/RPSysKokeshiCtrlDataMgr.h +++ b/include/Pack/RPKernel/RPSysKokeshiCtrlDataMgr.h @@ -79,12 +79,12 @@ class RPSysKokeshiCtrlDataMgr { public: /** - * @brief Construct + * @brief Constructor * * @param pCallback Controller data callback * @param pParentHeap Heap to use as the parent of the controller data heap * @param heapSize Size of the controller data heap - * @param index WPAD channel to use + * @param chan Remote channel */ RPSysKokeshiCtrlDataMgr(IRPSysKokeshiCtrlDataCallback* pCallback, EGG::Heap* pParentHeap, u32 heapSize, s32 chan); diff --git a/include/Pack/RPSystem.h b/include/Pack/RPSystem.h index 65aece802..9536c76ae 100644 --- a/include/Pack/RPSystem.h +++ b/include/Pack/RPSystem.h @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include diff --git a/include/Pack/RPSystem/RPSysDvdStatus.h b/include/Pack/RPSystem/RPSysDvdStatus.h index 56ff36e5c..515b5a1b3 100644 --- a/include/Pack/RPSystem/RPSysDvdStatus.h +++ b/include/Pack/RPSystem/RPSysDvdStatus.h @@ -28,6 +28,12 @@ class RPSysDvdStatus { */ void draw(); + /** + * @brief Tests whether a disc drive error has occurred + * @typo + */ + bool isErrorOccured() const; + private: /** * @brief Disc drive error type @@ -50,13 +56,6 @@ class RPSysDvdStatus { //! Size of the error message buffer static const int MESSAGE_BUFFER_SIZE = 256; -private: - /** - * @brief Tests whether a disc drive error has occurred - * @typo - */ - bool isErrorOccured() const; - private: //! Game disc name static const char* GAME_DISK_NAME; diff --git a/include/Pack/RPSystem/RPSysPauseMgr.h b/include/Pack/RPSystem/RPSysPauseMgr.h new file mode 100644 index 000000000..4d8cbab55 --- /dev/null +++ b/include/Pack/RPSystem/RPSysPauseMgr.h @@ -0,0 +1,33 @@ +#ifndef RP_SYSTEM_PAUSE_MGR_H +#define RP_SYSTEM_PAUSE_MGR_H + +#include + +//! @addtogroup rp_system +//! @{ + +/** + * @brief + * Pause manager + */ + +class RPSysPauseMgr { + RP_SINGLETON_DECL_EX(RPSysPauseMgr); + +public: + /** + * @brief + * Draws pause screen. Passes to RPSysPauseMenu + */ + void draw(void); + +private: + u32 mUNK_0x08; + u32 mUNK_0x0C; + f32 mFloats_0x10[0x78]; // TODO(Texline666) What are all these floats for? + void* mLytPause; // placeholder for RPSysLytPause +}; + +//! @} + +#endif diff --git a/include/Pack/RPSystem/RPSysRenderMode.h b/include/Pack/RPSystem/RPSysRenderMode.h new file mode 100644 index 000000000..2acdd8763 --- /dev/null +++ b/include/Pack/RPSystem/RPSysRenderMode.h @@ -0,0 +1,24 @@ +#ifndef RP_SYSTEM_RENDER_MODE_H +#define RP_SYSTEM_RENDER_MODE_H + +#include + +#include + +class RPSysRenderMode { +public: + enum EFormat { + EFormat_NTSC, + EFormat_NTSC_Prog, + EFormat_PAL50, + EFormat_PAL60, + EFormat_PAL_Prog, + + EFormat_Max + }; + +void adjust(u16 *pOriginX, u16 *pWidth, EFormat pFormat, EGG::Screen::TVMode pTvMode); + +}; + +#endif diff --git a/include/Pack/RPSystem/RPSysScene.h b/include/Pack/RPSystem/RPSysScene.h index c2e47ce67..fee636a4e 100644 --- a/include/Pack/RPSystem/RPSysScene.h +++ b/include/Pack/RPSystem/RPSysScene.h @@ -2,17 +2,217 @@ #define RP_SYSTEM_SCENE_H #include +#include +#include + #include //! @addtogroup rp_system //! @{ +// Forward declarations +class RPSysCommonObject; + /** * @brief Pack Project scene */ -class RPSysScene : public EGG::Scene { +class RPSysScene : public EGG::Scene, public IRPGrpDrawObject { public: + struct UnkStruct { + u32 unk0; + UnkStruct() : unk0(0) {} + }; + +public: + /** + * @brief Constructor + */ + RPSysScene(); + + /** + * @brief Destructor + */ + virtual ~RPSysScene() override {} // at 0x8 + + /** + * @name Internal events + * @brief These event functions are internal and should not be overriden. + */ + /**@{*/ + /** + * @brief Updates the scene state + */ + virtual void calc() override; // at 0xC + + /** + * @brief Renders the scene state + */ + virtual void draw() override; // at 0x10 + + /** + * @brief Enters the scene + */ + virtual void enter() override; // at 0x14 + + /** + * @brief Exits the scene + */ + virtual void exit() override; // at 0x18 + + /** + * @brief Re-initializes the scene + */ + virtual void reinit() override; // at 0x1C + + /** + * @brief Prepares for destruction of (and transition from) a child scene + */ + virtual void incoming_childDestroy() override; // at 0x20 + + /** + * @brief Prepares for creation of (and transition to) a child scene + */ + virtual void outgoing_childCreate() override; // at 0x24 + /**@}*/ + + /** + * @name User events + * @brief These event functions are mostly empty stubs and should be + * overriden to provide scene functionality. + */ + /**@{*/ + virtual UnkStruct& VF_0x3C() { + return sUnkStruct; + } // at 0x3C + + /** + * @brief Pause callback + * + * @param enter Whether the pause menu is being entered + */ + virtual void pauseCallBack(bool enter); // at 0x40 + + /** + * @brief Initializes the scene's state for the first time + */ + virtual void Configure() {} // at 0x44 + + /** + * @brief Loads the scene's required assets + */ + virtual void LoadResource() {} // at 0x48 + + /** + * @brief Re-initializes the scene's state + */ + virtual void Reset() {} // at 0x4C + + /** + * @brief Updates the scene's state + */ + virtual void Calculate() {} // at 0x50 + + /** + * @brief Exits the scene + */ + virtual void Exit() {} // at 0x54 + + /** + * @brief Runs an asynchronous task on the DVD thread + */ + virtual void taskAsync() {} // at 0x58 + /**@}*/ + + /** + * @brief Tests whether the scene is fully visible + */ + bool isSceneDisplay() const; + + /** + * @brief Tests whether the scene is visibly obscured + */ + bool isSceneBlank() const; + + /** + * @brief Tests whether a scene change would be allowed + */ + bool isSceneChangeEnable() const; + + /** + * @brief Tests whether NAND access would be safe + */ bool isNandAccessEnable() const; + + /** + * @brief Sets the current frame of both faders + * + * @param frame Frame count + */ + void setFadeFrame(u16 frame); + + /** + * @brief Gets the color of the manager fader + */ + nw4r::ut::Color getFadeColor() const; + + /** + * @brief Sets the color of both faders + * + * @param color Fade color + */ + void setFadeColor(nw4r::ut::Color color); + + /** + * @brief Sets the color of the scene fader + * + * @param color Fade color + */ + void setSceneFadeColor(nw4r::ut::Color color); + + /** + * @brief Begins fading in the scene fader + */ + void startFadeIn(); + + /** + * @brief Begins fading out the scene fader + */ + void startFadeOut(); + + /** + * @brief Toggles screen dimming + * @note If "Screen Saver Mode" is disabled, dimming is always OFF. + * + * @param enable Whether to dim the screen + */ + void setDimming(bool enable); + +protected: + void outgoingScene(); + + void exitScenePost(); + + void init(); + + void setCreatorSceneID(s32 id); + + s32 getCreatorSceneID() const; + +private: + static UnkStruct sUnkStruct; + + //! Scene renderer + RPGrpRenderer* mpRenderer; // at 0x2C + //! Common draw functionality + RPSysCommonObject* mpCommonObject; // at 0x30 + //! Scene effect creator + RPSysEffectCreator* mpEffectCreator; // at 0x34 + //! Scene heap + EGG::Heap* mpSceneHeap; // at 0x38 + //! Scene flags + EGG::TBitFlag mFlags; // at 0x3C + //! ID of the previous scene + s32 mCreatorSceneID; // at 0x40 }; //! @} diff --git a/include/Pack/RPSystem/RPSysSceneMgr.h b/include/Pack/RPSystem/RPSysSceneMgr.h index 183e5c6e6..8db28eebc 100644 --- a/include/Pack/RPSystem/RPSysSceneMgr.h +++ b/include/Pack/RPSystem/RPSysSceneMgr.h @@ -7,6 +7,8 @@ #include +#include + //! @addtogroup rp_system //! @{ @@ -14,15 +16,224 @@ * @brief Scene manager */ class RPSysSceneMgr : public EGG::SceneManager { - RP_SINGLETON_DECL(RPSysSceneMgr); + RP_SINGLETON_DECL_EX(RPSysSceneMgr); public: + /** +<<<<<<< HEAD + * @brief + * Gives system status. Indicates if an error has occurred + */ + enum ApplicationStatus { + NORMAL_STATUS, + RESET_STATUS, + UNK2_STATUS, + MENU_RETURN_STATUS, + SHUTTING_DOWN_STATUS + }; bool isShutDownReserved() const; bool isDvdErrorApplicationEnd() const; + bool isNormalState(); RPSysScene* getCurrentSceneRP() const; - void returnToMenu(bool); + void shutdownSystem(BOOL pBlack); + BOOL returnToMenu(BOOL pBlack); + void softReset(BOOL pFade); + +private: + char mPlaceholder[4]; + ApplicationStatus mApplicationStatus; + EGG::ColorFader* mColorFader; +======= + * @brief Performs a soft reset + * + * @param skipFade Whether to skip the fade to black (for HBM) + * @return Success + */ + bool softReset(bool skipFade); + /** + * @brief Returns to the system menu + * + * @param setBlack Whether to call VISetBlack before exiting + * @return Success + */ + bool returnToMenu(bool setBlack); + /** + * @brief Shuts down the console + * + * @param setBlack Whether to call VISetBlack before exiting + * @return Success + */ + bool shutdownSystem(bool setBlack); + + /** + * @brief Tests whether the manager is operating normally + */ + bool isNormalState() const; + /** + * @brief Tests whether the manager is currently shutting down the system + */ + bool isShutDownReserved() const; + + /** + * @brief Disables the guard state and returns to normal operation + */ + void resetGuard(); + + /** + * @brief Tests whether the manager is currently returning to the menu or + * shutting down the system + */ + bool isApplicationEndReserved(); + /** + * @brief Tests whether the application should end in its current state due + * to a DVD error + * @details Any state other than normal operation will result in the + * application ending. + */ + bool isDvdErrorApplicationEnd(); + + /** + * @brief Fades out the display and changes to the specified scene + * @remark Supply -1 as the scene ID to use the current scene ID. + * @note If you are changing to the current scene ID again, set @p + * forceChange so the scene is completely teared down. + * + * @param id Scene ID + * @param forceChange Force a full scene change when a re-init would + * otherwise happen + * @return Success + */ + bool changeNextSceneAfterFade(s32 id, bool forceChange); + + /** + * @name Faders + * @note The scene manager owns two faders: the "manager" fader (inherited + * from @ref EGG::SceneManager) and the "scene" fader (@ref mpSceneFader). + * The manager fader is used for fading between scene transitions, while the + * scene fader can be controlled at any time by the current scene. + */ + /**@{*/ + /** + * @brief Resets the fade duration of both the scene and manager faders + * @remark The default duration is 20 frames. + */ + void resetFadeFrame(); + /** + * @brief Gets the fade duration of the scene fader + */ + u16 getSceneFadeFrame(); + /** + * @brief Sets the duration of both the scene and manager faders + * @note The fade duration cannot be zero. + * + * @param frame Fade duration, in frames + */ + void setFadeFrame(u16 frame); + + /** + * @brief Resets the fade color of both the scene and manager faders + * @remark The default color is white with full opacity. + */ + void resetFadeColor(); + + /** + * @brief Gets the fade color of the manager fader + */ + nw4r::ut::Color getMgrFadeColor(); + + /** + * @brief Sets the fade color of both faders + * + * @param color Fade color + */ + void setFadeColor(nw4r::ut::Color color); + + /** + * @brief Sets the fade color of the scene fader + * + * @param color Fade color + */ + void setSceneFadeColor(nw4r::ut::Color color); + + /** + * @brief Gets the fade status of the scene fader + */ + EGG::Fader::EStatus getSceneStatus(); + /** + * @brief Sets the fade status of the scene fader + * + * @param status Fade status + */ + void setSceneStatus(EGG::Fader::EStatus status); + + /** + * @brief Begins to fade in the manager fader + */ + void startMgrFadeIn(); + + /** + * @brief Begins to fade in the scene fader + */ + void startSceneFadeIn(); + /** + * @brief Begins to fade out the scene fader + */ + void startSceneFadeOut(); + + /** + * @brief Tests whether the scene is currently fully visible + */ + bool isDisplay(); + /** + * @brief Tests whether the scene is currently not visible + */ + bool isBlank(); + /** + * @brief Tests whether the scene is currently fading out + */ + bool isFadeOut(); + /**@}*/ + + /** + * @brief Tests whether all asynchronous tasks have been completed + * @details The system threads (DVD, NAND, WiiConnect24) must all be idle, + * and the system must not currently be writing save data to the NAND. + */ + bool isTaskFinished(); + /** + * @brief Tests whether the scene is currently permitted to change + * @details The scene can only change once all tasks have finished and the + * manager fader is prepared to fade out. + */ + bool isSceneChangeEnable(); + + /** + * @name Faders + */ + /**@{*/ + /** + * @brief Updates the scene fader's state + */ + void calcSceneFader(); + /** + * @brief Renders the scene fader's state + */ + void drawSceneFader(); + /** + * @brief Renders the manager fader's state + */ + void drawMgrFader(); + /**@}*/ + + /** + * @brief Updates the scene manager's state + */ + void updateState(); + + RPSysScene* getCurrentSceneRP() const; +>>>>>>> 15d86d66 (type shit..) }; //! @} diff --git a/include/Pack/RPSystem/RPSysSystem.h b/include/Pack/RPSystem/RPSysSystem.h index 9a0d35d2f..6276a805e 100644 --- a/include/Pack/RPSystem/RPSysSystem.h +++ b/include/Pack/RPSystem/RPSysSystem.h @@ -3,6 +3,7 @@ #include #include +#include #include @@ -14,6 +15,61 @@ //! @addtogroup rp_system //! @{ +/** + * @brief Pack Project configuration data. Derives from EGG::ConfigurationData. + */ + +class RPSysConfigData { +public: + explicit RPSysConfigData(u32 systemHeapSize) + : mSystemHeapSize(systemHeapSize) {} + + virtual EGG::Video* GetVideo() { + return mVideo; + } + virtual EGG::Heap* GetSystemHeap() { + return mSystemHeap; + } + virtual EGG::Display* GetDisplay() { + return mDisplay; + } + virtual EGG::XfbManager* GetXfbMgr() { + return mXfbMgr; + } + virtual EGG::PerformanceView* GetPerfView() { + return mPerfView; + } + virtual EGG::SceneManager* GetSceneMgr() { + return mSceneMgr; + } + virtual EGG::IAudioMgr* GetAudioMgr() { + return mAudioMgr; + } + virtual void StubA() {} + virtual void StubB() {} +private: + void* mMem1Start; + void* mMem1End; + void* mMem2Start; + void* mMem2End; + u32 mMemSize; + EGG::Heap *mRootHeapMem1; + EGG::Heap *mRootHeapMem2; + EGG::Heap *mRootHeapDebug; +protected: + EGG::Heap* mSystemHeap; + EGG::Thread* mCreatorThread; + void* mCodeStart; + void* mCodeEnd; + u32 mSystemHeapSize; + EGG::Video *mVideo; + EGG::XfbManager *mXfbMgr; + EGG::Display *mDisplay; + EGG::PerformanceView *mPerfView; + EGG::SceneManager *mSceneMgr; + EGG::IAudioMgr *mAudioMgr; +}; + /** * @brief Pack Project engine system */ @@ -296,7 +352,7 @@ class RPSysSystem { //! Task-end thread message for asynchronous NAND operations u32 mNandEndMessage; // at 0x40 //! Task-end thread message for asynchronous disc operations - u32 mDvdEndMessage; // at 0x44 + OSMessage mDvdEndMessage; // at 0x44 //! Task-end thread message for asynchronous WiiConnect24 operations u32 mWc24EndMessage; // at 0x48 @@ -311,12 +367,12 @@ class RPSysSystem { char* mpTimeStampString; // at 0x58 //! Engine configuration - // static RPSysConfigData sConfigData; + static RPSysConfigData sConfigData; //! Active render mode static GXRenderModeObj* spRenderModeObj; - //! Render mode format @see RPSysRenderMode::EFormat - // static u32 sRenderModeFormat; + //! Render mode format + static RPSysRenderMode::EFormat sRenderModeFormat; //! @brief Time (in milliseconds) when the render mode was setup //! @remark This value is only non-zero when scan mode/TV format is changed //! and the system must wait. diff --git a/include/egg/core/eggDisplay.h b/include/egg/core/eggDisplay.h index b5c6e325e..db73c67bf 100644 --- a/include/egg/core/eggDisplay.h +++ b/include/egg/core/eggDisplay.h @@ -58,7 +58,7 @@ class Display { u32 mRetraceCount; // at 0xC u32 mFrameCount; // at 0x10 nw4r::ut::Color mClearColor; // at 0x14 - u32 mClearZ; // at 0x20 + u32 mClearZ; // at 0x18 s32 mPrevFrameTick; // at 0x1C s32 mFrameCostTick; // at 0x20 f32 mFrequency; // at 0x24 diff --git a/include/nw4r/snd/snd_SoundArchivePlayer.h b/include/nw4r/snd/snd_SoundArchivePlayer.h index 069f19b20..7e328f6b9 100644 --- a/include/nw4r/snd/snd_SoundArchivePlayer.h +++ b/include/nw4r/snd/snd_SoundArchivePlayer.h @@ -141,7 +141,7 @@ class SoundArchivePlayer : public detail::DisposeCallback, const detail::NoteOnInfo& rInfo); // at 0xC private: - const SoundArchivePlayer& mSoundArchivePlayer; // at 0x0 + const SoundArchivePlayer& mSoundArchivePlayer; // at 0x4 }; /****************************************************************************** @@ -160,7 +160,7 @@ class SoundArchivePlayer : public detail::DisposeCallback, u32 callbackArg) const; // at 0xC private: - const SoundArchivePlayer& mSoundArchivePlayer; // at 0x0 + const SoundArchivePlayer& mSoundArchivePlayer; // at 0x4 }; private: diff --git a/include/nw4r/snd/snd_SoundHeap.h b/include/nw4r/snd/snd_SoundHeap.h index ac67d7085..ab6d8304b 100644 --- a/include/nw4r/snd/snd_SoundHeap.h +++ b/include/nw4r/snd/snd_SoundHeap.h @@ -49,7 +49,7 @@ class SoundHeap : public SoundMemoryAllocatable { void* pCallbackArg); private: - mutable OSMutex mMutex; // at 0x0 + mutable OSMutex mMutex; // at 0x4 detail::FrameHeap mFrameHeap; // at 0x1C }; diff --git a/include/revolution/VI/vi.h b/include/revolution/VI/vi.h index 95696787d..8f7a44b6f 100644 --- a/include/revolution/VI/vi.h +++ b/include/revolution/VI/vi.h @@ -80,6 +80,8 @@ VITVFormat VIGetTvFormat(void); VIScanMode VIGetScanMode(void); u32 VIGetDTVStatus(void); +BOOL VIEnableDimming(BOOL enable); + #ifdef __cplusplus } #endif diff --git a/src/Pack/RPKernel/RPSysKokeshiCtrlDataLoader.cpp b/src/Pack/RPKernel/RPSysKokeshiCtrlDataLoader.cpp index aa22ea783..f1fd8a514 100644 --- a/src/Pack/RPKernel/RPSysKokeshiCtrlDataLoader.cpp +++ b/src/Pack/RPKernel/RPSysKokeshiCtrlDataLoader.cpp @@ -5,7 +5,7 @@ /** * @brief Constructor * - * @param chan WPAD channel to use + * @param chan Remote channel */ RPSysKokeshiCtrlDataLoader::RPSysKokeshiCtrlDataLoader(s32 chan) : mChannel(chan), mLoadState(ELoadState_Start) {} diff --git a/src/Pack/RPKernel/RPSysKokeshiCtrlDataMgr.cpp b/src/Pack/RPKernel/RPSysKokeshiCtrlDataMgr.cpp index 26012574e..2e7460959 100644 --- a/src/Pack/RPKernel/RPSysKokeshiCtrlDataMgr.cpp +++ b/src/Pack/RPKernel/RPSysKokeshiCtrlDataMgr.cpp @@ -13,7 +13,7 @@ * @param pCallback Controller data callback * @param pParentHeap Heap to use as the parent of the controller data heap * @param heapSize Size of the controller data heap - * @param chan WPAD channel to use + * @param chan Remote channel */ RPSysKokeshiCtrlDataMgr::RPSysKokeshiCtrlDataMgr( IRPSysKokeshiCtrlDataCallback* pCallback, EGG::Heap* pParentHeap, diff --git a/src/Pack/RPKernel/RPSysSystem.cpp b/src/Pack/RPKernel/RPSysSystem.cpp new file mode 100644 index 000000000..10b8e9ce7 --- /dev/null +++ b/src/Pack/RPKernel/RPSysSystem.cpp @@ -0,0 +1,81 @@ +#include +#include +#include +#include +#include +#include +#include + +void RPSysSystem::setupTVMode() { + int i; + + VIInit(); + for (i = 0; i < 60; i++) { + if (SCCheckStatus() == SC_STATUS_OK) { + break; + } + VIWaitForRetrace(); + } + if (SCGetAspectRatio() == SC_ASPECT_WIDE) { + EGG::Screen::SetTVMode(EGG::Screen::TV_MODE_WIDE); + } + else { + EGG::Screen::SetTVMode(EGG::Screen::TV_MODE_STD); + } +} + +RPSysSceneCreator::ESceneID RPSysSystem::getBootScene() { + // this function is hardcoded (symbol name is official, weirdly enough) + return RPSysSceneCreator::ESceneID_RPSportsTitleScene; +} + +void RPSysSystem::startLoadCount() { + mLoadCount = 0; // wrong register, should be r3 but this compiles to r4 +} + +const char* RPSysSystem::getTimeStampString() { + return mpTimeStampString; +} + +void RPSysSystem::setupLocalSettings() { + u8 sysLanguage = SCGetLanguage(); + + if (sysLanguage == SC_LANG_EN) { + RP_GET_INSTANCE(RPSysProjectLocal)->setLocale(RPSysProjectLocal::EArea_USA); + RP_GET_INSTANCE(RPSysProjectLocal)->setLanguage(RPSysProjectLocal::EArea_USA); + } + else if (sysLanguage == SC_LANG_FR) { + RP_GET_INSTANCE(RPSysProjectLocal)->setLocale(RPSysProjectLocal::EArea_USA); + RP_GET_INSTANCE(RPSysProjectLocal)->setLanguage(RPSysProjectLocal::EArea_France); + } + else if (sysLanguage == SC_LANG_SP) { + RP_GET_INSTANCE(RPSysProjectLocal)->setLocale(RPSysProjectLocal::EArea_USA); + RP_GET_INSTANCE(RPSysProjectLocal)->setLanguage(RPSysProjectLocal::EArea_Spain); + } + //! Requires ifdef for non Americas versions + else { + RP_GET_INSTANCE(RPSysProjectLocal)->setLocale(RPSysProjectLocal::EArea_USA); + RP_GET_INSTANCE(RPSysProjectLocal)->setLanguage(RPSysProjectLocal::EArea_USA); + } +} + +/** + * @brief Controls whether the game restarts or returns to the Wii Menu upon a + * soft reset. + */ + +void RPSysSystem::softResetCallBack() { + if (RP_GET_INSTANCE(RPSysDvdStatus)->isErrorOccured()) { + RP_GET_INSTANCE(RPSysSceneMgr)->returnToMenu(FALSE); + } else { + VIEnableDimming(FALSE); + if (RP_GET_INSTANCE(RPSysSceneMgr)->isNormalState() && + !RP_GET_INSTANCE(RPSysHomeMenuMgr)->startBlackOut()) { + RP_GET_INSTANCE(RPSysSceneMgr)->softReset(FALSE); + } + } +} + +void RPSysSystem::shutdownSystemCallBack() { + RP_GET_INSTANCE(RPSysSceneMgr)->shutdownSystem(FALSE); +} diff --git a/src/Pack/RPSystem/RPSysScene.cpp b/src/Pack/RPSystem/RPSysScene.cpp new file mode 100644 index 000000000..0c8ca723b --- /dev/null +++ b/src/Pack/RPSystem/RPSysScene.cpp @@ -0,0 +1,192 @@ +#include +#include +#include + +#include + +RPSysScene::UnkStruct RPSysScene::sUnkStruct; + +/** + * @brief Tests whether the scene is fully visible + */ +bool RPSysScene::isSceneDisplay() const { + return RP_GET_INSTANCE(RPSysSceneMgr)->isDisplay(); +} + +/** + * @brief Tests whether the scene is visibly obscured + */ +bool RPSysScene::isSceneBlank() const { + return RP_GET_INSTANCE(RPSysSceneMgr)->isBlank(); +} + +/** + * @brief Tests whether a scene change would be allowed + */ +bool RPSysScene::isSceneChangeEnable() const { + return RP_GET_INSTANCE(RPSysSceneMgr)->isSceneChangeEnable(); +} + +/** + * @brief Tests whether NAND access would be safe + */ +bool RPSysScene::isNandAccessEnable() const { + return !RP_GET_INSTANCE(RPSysSceneMgr)->isFadeOut() && + RP_GET_INSTANCE(RPSysSceneMgr)->isTaskFinished(); +} + +/** + * @brief Sets the current frame of both faders + * + * @param frame Frame count + */ +void RPSysScene::setFadeFrame(u16 frame) { + RP_GET_INSTANCE(RPSysSceneMgr)->setFadeFrame(frame); +} + +/** + * @brief Gets the color of the manager fader + */ +nw4r::ut::Color RPSysScene::getFadeColor() const { + return RP_GET_INSTANCE(RPSysSceneMgr)->getMgrFadeColor(); +} + +/** + * @brief Sets the color of both faders + * + * @param color Fade color + */ +void RPSysScene::setFadeColor(nw4r::ut::Color color) { + RP_GET_INSTANCE(RPSysSceneMgr)->setSceneFadeColor(color); +} + +/** + * @brief Sets the color of the scene fader + * + * @param color Fade color + */ +void RPSysScene::setSceneFadeColor(nw4r::ut::Color color) { + RP_GET_INSTANCE(RPSysSceneMgr)->setSceneFadeColor(color); +} + +/** + * @brief Begins fading in the scene fader + */ +void RPSysScene::startFadeIn() { + RP_GET_INSTANCE(RPSysSceneMgr)->startSceneFadeIn(); +} + +/** + * @brief Begins fading out the scene fader + */ +void RPSysScene::startFadeOut() { + RP_GET_INSTANCE(RPSysSceneMgr)->startSceneFadeOut(); +} + +/** + * @brief Toggles screen dimming + * @note If "Screen Saver Mode" is disabled, dimming is always OFF. + * + * @param enable Whether to dim the screen + */ +void RPSysScene::setDimming(bool enable) { + RP_GET_INSTANCE(RPSysSystem)->setDimming(enable); +} + +/** + * @brief Constructor + */ +RPSysScene::RPSysScene() + : mpRenderer(NULL), + mpCommonObject(NULL), + mpEffectCreator(NULL), + mpSceneHeap(NULL), + mCreatorSceneID(-1) {} + +/** + * @brief Enters the scene + */ +void RPSysScene::enter() { + ; +} + +void RPSysScene::outgoingScene() { + RPSysCoreController::stopMotorAll(); + + RP_GET_INSTANCE(RPSysEffectMgr)->stopAllEffect(); + RP_GET_INSTANCE(RPSysEffectMgr)->resetCreator(mpEffectCreator); +} + +/** + * @brief Re-initializes the scene + */ +void RPSysScene::reinit() { + ; +} + +/** + * @brief Prepares for destruction of (and transition from) a child scene + */ +void RPSysScene::incoming_childDestroy() { + ; +} + +/** + * @brief Updates the scene state + */ +void RPSysScene::calc() { + ; +} + +/** + * @brief Renders the scene state + */ +void RPSysScene::draw() { + RP_GET_INSTANCE(RPSysKokeshiManager)->UpdateCtrlMgr(); + + RPGrpRenderer::Begin(); + { + mpRenderer->Rendering(); + + RPGrpRenderer::StartDebugDraw(); + RP_GET_INSTANCE(RP_DEBUG_STUB_0)->DebugDraw(); + } + RPGrpRenderer::End(); +} + +/** + * @brief Prepares for creation of (and transition to) a child scene + */ +void RPSysScene::outgoing_childCreate() { + outgoingScene(); +} + +void RPSysScene::exitScenePost() { + GXDrawDone(); + mpRenderer->Destruct(); + + if (mpSceneHeap != NULL) { + RP_GET_INSTANCE(RPSysSystem)->destroyHeap(mpSceneHeap); + } +} + +/** + * @brief Exits the scene + */ +void RPSysScene::exit() { + outgoingScene(); + Exit(); + exitScenePost(); +} + +void RPSysScene::init() { + ; +} + +void RPSysScene::setCreatorSceneID(s32 id) { + mCreatorSceneID = id; +} + +s32 RPSysScene::getCreatorSceneID() const { + return mCreatorSceneID; +} From e5ae91db9e3c39a8cd120f303ba0cc86e12f09f4 Mon Sep 17 00:00:00 2001 From: kiwi515 <49212064+kiwi515@users.noreply.github.com> Date: Wed, 26 Aug 2026 22:59:26 -0400 Subject: [PATCH 2/7] type shit.. --- config/RSPE01_01/symbols.txt | 66 +++++++++++++-------------- include/Pack/RPSystem/RPSysSceneMgr.h | 27 ----------- 2 files changed, 33 insertions(+), 60 deletions(-) diff --git a/config/RSPE01_01/symbols.txt b/config/RSPE01_01/symbols.txt index c452a375e..0f4bfed0f 100644 --- a/config/RSPE01_01/symbols.txt +++ b/config/RSPE01_01/symbols.txt @@ -6899,39 +6899,39 @@ fn_80184B98 = .text:0x80184B98; // type:function size:0xC fn_80184BA4 = .text:0x80184BA4; // type:function size:0x26C fn_80184E10 = .text:0x80184E10; // type:function size:0x70 fn_80184E80 = .text:0x80184E80; // type:function size:0x10 -fn_80184E90 = .text:0x80184E90; // type:function size:0x8 -fn_80184E98 = .text:0x80184E98; // type:function size:0x8 -fn_80184EA0 = .text:0x80184EA0; // type:function size:0xF0 -fn_80184F90 = .text:0x80184F90; // type:function size:0x74 -fn_80185004 = .text:0x80185004; // type:function size:0x4 -fn_80185008 = .text:0x80185008; // type:function size:0x40 -fn_80185048 = .text:0x80185048; // type:function size:0x4C -fn_80185094 = .text:0x80185094; // type:function size:0xD0 -fn_80185164 = .text:0x80185164; // type:function size:0x4 -fn_80185168 = .text:0x80185168; // type:function size:0xC0 -fn_80185228 = .text:0x80185228; // type:function size:0x4 -fn_8018522C = .text:0x8018522C; // type:function size:0xD8 -fn_80185304 = .text:0x80185304; // type:function size:0xFC -fn_80185400 = .text:0x80185400; // type:function size:0x4 -fn_80185404 = .text:0x80185404; // type:function size:0x68 -fn_8018546C = .text:0x8018546C; // type:function size:0x8 -fn_80185474 = .text:0x80185474; // type:function size:0x8 -fn_8018547C = .text:0x8018547C; // type:function size:0x8 -fn_80185484 = .text:0x80185484; // type:function size:0x48 -fn_801854CC = .text:0x801854CC; // type:function size:0x48 -fn_80185514 = .text:0x80185514; // type:function size:0x8 -fn_8018551C = .text:0x8018551C; // type:function size:0x8 -fn_80185524 = .text:0x80185524; // type:function size:0x50 -fn_80185574 = .text:0x80185574; // type:function size:0x8 -fn_8018557C = .text:0x8018557C; // type:function size:0x8 -fn_80185584 = .text:0x80185584; // type:function size:0x8 -fn_8018558C = .text:0x8018558C; // type:function size:0x8 -fn_80185594 = .text:0x80185594; // type:function size:0x4 -fn_80185598 = .text:0x80185598; // type:function size:0x4 -fn_8018559C = .text:0x8018559C; // type:function size:0x4 -fn_801855A0 = .text:0x801855A0; // type:function size:0x4 -fn_801855A4 = .text:0x801855A4; // type:function size:0x4 -fn_801855A8 = .text:0x801855A8; // type:function size:0xC +getCreatorSceneID__10RPSysSceneCFv = .text:0x80184E90; // type:function size:0x8 +setCreatorSceneID__10RPSysSceneFl = .text:0x80184E98; // type:function size:0x8 +init__10RPSysSceneFv = .text:0x80184EA0; // type:function size:0xF0 +exit__10RPSysSceneFv = .text:0x80184F90; // type:function size:0x74 +Exit__10RPSysSceneFv = .text:0x80185004; // type:function size:0x4 +outgoing_childCreate__10RPSysSceneFv = .text:0x80185008; // type:function size:0x40 +draw__10RPSysSceneFv = .text:0x80185048; // type:function size:0x4C +calc__10RPSysSceneFv = .text:0x80185094; // type:function size:0xD0 +Calculate__10RPSysSceneFv = .text:0x80185164; // type:function size:0x4 +incoming_childDestroy__10RPSysSceneFv = .text:0x80185168; // type:function size:0xC0 +Reset__10RPSysSceneFv = .text:0x80185228; // type:function size:0x4 +reinit__10RPSysSceneFv = .text:0x8018522C; // type:function size:0xD8 +enter__10RPSysSceneFv = .text:0x80185304; // type:function size:0xFC +Configure__10RPSysSceneFv = .text:0x80185400; // type:function size:0x4 +__ct__10RPSysSceneFv = .text:0x80185404; // type:function size:0x68 +setDimming__10RPSysSceneFb = .text:0x8018546C; // type:function size:0x8 +startFadeOut__10RPSysSceneFv = .text:0x80185474; // type:function size:0x8 +startFadeIn__10RPSysSceneFv = .text:0x8018547C; // type:function size:0x8 +setSceneFadeColor__10RPSysSceneFQ34nw4r2ut5Color = .text:0x80185484; // type:function size:0x48 +setFadeColor__10RPSysSceneFQ34nw4r2ut5Color = .text:0x801854CC; // type:function size:0x48 +getFadeColor__10RPSysSceneCFv = .text:0x80185514; // type:function size:0x8 +setFadeFrame__10RPSysSceneFUs = .text:0x8018551C; // type:function size:0x8 +isNandAccessEnable__10RPSysSceneCFv = .text:0x80185524; // type:function size:0x50 +isSceneChangeEnable__10RPSysSceneCFv = .text:0x80185574; // type:function size:0x8 +isSceneBlank__10RPSysSceneCFv = .text:0x8018557C; // type:function size:0x8 +isSceneDisplay__10RPSysSceneCFv = .text:0x80185584; // type:function size:0x8 +VF_0x3C__10RPSysSceneFv = .text:0x8018558C; // type:function size:0x8 +pauseCallBack__10RPSysSceneFv = .text:0x80185594; // type:function size:0x4 +LoadResource__10RPSysSceneFv = .text:0x80185598; // type:function size:0x4 +taskAsync__10RPSysSceneFv = .text:0x8018559C; // type:function size:0x4 +UserDraw__16IRPGrpDrawObjectFv = .text:0x801855A0; // type:function size:0x4 +DebugDraw__16IRPGrpDrawObjectFv = .text:0x801855A4; // type:function size:0x4 +__sinit_\RPSysScene_cpp = .text:0x801855A8; // type:function size:0xC scope:local fn_801855B4 = .text:0x801855B4; // type:function size:0x8 adjust__19RPSysRenderModeFPUsPUsii = .text:0x801855BC; // type:function size:0xBC fn_80185678 = .text:0x80185678; // type:function size:0x58 diff --git a/include/Pack/RPSystem/RPSysSceneMgr.h b/include/Pack/RPSystem/RPSysSceneMgr.h index 8db28eebc..0568f0300 100644 --- a/include/Pack/RPSystem/RPSysSceneMgr.h +++ b/include/Pack/RPSystem/RPSysSceneMgr.h @@ -20,32 +20,6 @@ class RPSysSceneMgr : public EGG::SceneManager { public: /** -<<<<<<< HEAD - * @brief - * Gives system status. Indicates if an error has occurred - */ - enum ApplicationStatus { - NORMAL_STATUS, - RESET_STATUS, - UNK2_STATUS, - MENU_RETURN_STATUS, - SHUTTING_DOWN_STATUS - }; - bool isShutDownReserved() const; - bool isDvdErrorApplicationEnd() const; - bool isNormalState(); - - RPSysScene* getCurrentSceneRP() const; - - void shutdownSystem(BOOL pBlack); - BOOL returnToMenu(BOOL pBlack); - void softReset(BOOL pFade); - -private: - char mPlaceholder[4]; - ApplicationStatus mApplicationStatus; - EGG::ColorFader* mColorFader; -======= * @brief Performs a soft reset * * @param skipFade Whether to skip the fade to black (for HBM) @@ -233,7 +207,6 @@ class RPSysSceneMgr : public EGG::SceneManager { void updateState(); RPSysScene* getCurrentSceneRP() const; ->>>>>>> 15d86d66 (type shit..) }; //! @} From c258ea59b69a16fc8faa468ce056289cb7b9632a Mon Sep 17 00:00:00 2001 From: kiwi515 <49212064+kiwi515@users.noreply.github.com> Date: Sat, 29 Aug 2026 11:27:29 -0400 Subject: [PATCH 3/7] more work --- .clangd | 8 + config/RSPE01_01/symbols.txt | 119 ++-- configure.py | 2 +- include/Pack/RPGraphics/IRPGrpDrawObject.h | 6 +- include/Pack/RPGraphics/RPGrpRenderer.h | 12 + include/Pack/RPKernel/RPSysEffectCreator.h | 8 + include/Pack/RPKernel/RPSysEffectMgr.h | 6 +- include/Pack/RPKernel/RPSysHomeMenuMgr.h | 28 +- include/Pack/RPParty.h | 6 - include/Pack/RPParty/RPBilScene.h | 6 + include/Pack/RPParty/RPBilScene/RPBilScene.h | 19 + include/Pack/RPParty/RPBomScene.h | 6 + include/Pack/RPParty/RPBomScene/RPBomScene.h | 19 + include/Pack/RPParty/RPCowScene.h | 6 + include/Pack/RPParty/RPCowScene/RPCowScene.h | 17 + include/Pack/RPParty/RPDucScene.h | 6 + include/Pack/RPParty/RPDucScene/RPDucScene.h | 19 + include/Pack/RPParty/RPFshScene.h | 6 + include/Pack/RPParty/RPFshScene/RPFshScene.h | 19 + include/Pack/RPParty/RPHkyScene.h | 6 + include/Pack/RPParty/RPHkyScene/RPHkyScene.h | 19 + include/Pack/RPParty/RPPartyCommon.h | 10 + .../{ => RPPartyCommon}/RPPartyBodyManager.h | 4 +- .../RPPartyMainScene/RPPartyMainScene.h | 17 + .../RPPartyPackTitleScene.h | 19 + .../RPPartyRootScene/RPPartyRootScene.h | 17 + .../RPParty/RPPartyCommon/RPPartySeqScene.h | 19 + include/Pack/RPParty/RPPnpScene.h | 6 + include/Pack/RPParty/RPPnpScene/RPPnpScene.h | 19 + include/Pack/RPParty/RPTnkScene.h | 6 + include/Pack/RPParty/RPTnkScene/RPTnkScene.h | 19 + include/Pack/RPParty/RPWlyScene.h | 6 + include/Pack/RPParty/RPWlyScene/RPWlyScene.h | 19 + include/Pack/RPSports.h | 7 - include/Pack/RPSports/RPBowScene.h | 6 + include/Pack/RPSports/RPBowScene/RPBowScene.h | 21 + include/Pack/RPSports/RPBoxScene.h | 6 + include/Pack/RPSports/RPBoxScene/RPBoxScene.h | 20 + include/Pack/RPSports/RPBsbScene.h | 6 + include/Pack/RPSports/RPBsbScene/RPBsbScene.h | 20 + include/Pack/RPSports/RPGolScene.h | 7 + include/Pack/RPSports/RPGolScene/RPGolScene.h | 20 + .../RPSports/RPGolScene/RPGolSelectScene.h | 19 + include/Pack/RPSports/RPSportsCommon.h | 14 + .../RPSportsAppMiiManager.h | 4 +- .../RPSportsCommon/RPSportsBaseScene.h | 38 ++ .../RPSportsBodyManager.h | 4 +- .../RPSportsMainScene/RPSportsMainScene.h | 19 + .../RPSportsPackTitleScene.h | 31 + .../RPSportsPhysicalMenuScene.h | 19 + .../RPSportsPhysicalPreviewScene.h | 19 + .../RPSportsPhysicalResultScene.h | 19 + .../RPSportsTrainingMenuScene.h | 19 + include/Pack/RPSports/RPTnsScene.h | 6 + include/Pack/RPSports/RPTnsScene/RPTnsScene.h | 20 + include/Pack/RPSystem.h | 4 + include/Pack/RPSystem/RPSysBootScene.h | 20 + include/Pack/RPSystem/RPSysCommonObject.h | 43 ++ .../Pack/RPSystem/RPSysNunchukCheckScene.h | 21 + include/Pack/RPSystem/RPSysPauseMgr.h | 18 +- .../Pack/RPSystem/RPSysPlayerSelectScene.h | 20 + include/Pack/RPSystem/RPSysResourceManager.h | 2 +- include/Pack/RPSystem/RPSysScene.h | 107 +++- include/Pack/RPSystem/RPSysSceneCreator.h | 242 +++++--- include/Pack/RPSystem/RPSysSceneMgr.h | 179 +++--- include/Pack/RPUtility.h | 1 + .../Pack/RPUtility/RPUtlLoadSaveDataScene.h | 14 + include/egg/core/eggColorFader.h | 7 + include/egg/core/eggSceneManager.h | 6 +- include/egg/core/eggTaskThread.h | 4 + src/Pack/RPSystem/RPSysLoadScene.cpp | 125 ++++ src/Pack/RPSystem/RPSysResourceManager.cpp | 18 +- src/Pack/RPSystem/RPSysSaveDataMgr.cpp | 6 +- src/Pack/RPSystem/RPSysScene.cpp | 159 ++++- src/Pack/RPSystem/RPSysSceneCreator.cpp | 564 ++++++++++++++++++ src/Pack/RPSystem/RPSysSceneMgr.cpp | 501 ++++++++++++++++ 76 files changed, 2594 insertions(+), 315 deletions(-) create mode 100644 .clangd delete mode 100644 include/Pack/RPParty.h create mode 100644 include/Pack/RPParty/RPBilScene.h create mode 100644 include/Pack/RPParty/RPBilScene/RPBilScene.h create mode 100644 include/Pack/RPParty/RPBomScene.h create mode 100644 include/Pack/RPParty/RPBomScene/RPBomScene.h create mode 100644 include/Pack/RPParty/RPCowScene.h create mode 100644 include/Pack/RPParty/RPCowScene/RPCowScene.h create mode 100644 include/Pack/RPParty/RPDucScene.h create mode 100644 include/Pack/RPParty/RPDucScene/RPDucScene.h create mode 100644 include/Pack/RPParty/RPFshScene.h create mode 100644 include/Pack/RPParty/RPFshScene/RPFshScene.h create mode 100644 include/Pack/RPParty/RPHkyScene.h create mode 100644 include/Pack/RPParty/RPHkyScene/RPHkyScene.h create mode 100644 include/Pack/RPParty/RPPartyCommon.h rename include/Pack/RPParty/{ => RPPartyCommon}/RPPartyBodyManager.h (94%) create mode 100644 include/Pack/RPParty/RPPartyCommon/RPPartyMainScene/RPPartyMainScene.h create mode 100644 include/Pack/RPParty/RPPartyCommon/RPPartyPackTitleScene/RPPartyPackTitleScene.h create mode 100644 include/Pack/RPParty/RPPartyCommon/RPPartyRootScene/RPPartyRootScene.h create mode 100644 include/Pack/RPParty/RPPartyCommon/RPPartySeqScene.h create mode 100644 include/Pack/RPParty/RPPnpScene.h create mode 100644 include/Pack/RPParty/RPPnpScene/RPPnpScene.h create mode 100644 include/Pack/RPParty/RPTnkScene.h create mode 100644 include/Pack/RPParty/RPTnkScene/RPTnkScene.h create mode 100644 include/Pack/RPParty/RPWlyScene.h create mode 100644 include/Pack/RPParty/RPWlyScene/RPWlyScene.h delete mode 100644 include/Pack/RPSports.h create mode 100644 include/Pack/RPSports/RPBowScene.h create mode 100644 include/Pack/RPSports/RPBowScene/RPBowScene.h create mode 100644 include/Pack/RPSports/RPBoxScene.h create mode 100644 include/Pack/RPSports/RPBoxScene/RPBoxScene.h create mode 100644 include/Pack/RPSports/RPBsbScene.h create mode 100644 include/Pack/RPSports/RPBsbScene/RPBsbScene.h create mode 100644 include/Pack/RPSports/RPGolScene.h create mode 100644 include/Pack/RPSports/RPGolScene/RPGolScene.h create mode 100644 include/Pack/RPSports/RPGolScene/RPGolSelectScene.h create mode 100644 include/Pack/RPSports/RPSportsCommon.h rename include/Pack/RPSports/{ => RPSportsCommon}/RPSportsAppMiiManager.h (85%) create mode 100644 include/Pack/RPSports/RPSportsCommon/RPSportsBaseScene.h rename include/Pack/RPSports/{ => RPSportsCommon}/RPSportsBodyManager.h (94%) create mode 100644 include/Pack/RPSports/RPSportsCommon/RPSportsMainScene/RPSportsMainScene.h create mode 100644 include/Pack/RPSports/RPSportsCommon/RPSportsPackTitleScene/RPSportsPackTitleScene.h create mode 100644 include/Pack/RPSports/RPSportsCommon/RPSportsPhysicalMenuScene/RPSportsPhysicalMenuScene.h create mode 100644 include/Pack/RPSports/RPSportsCommon/RPSportsPhysicalPreviewScene/RPSportsPhysicalPreviewScene.h create mode 100644 include/Pack/RPSports/RPSportsCommon/RPSportsPhysicalResultScene/RPSportsPhysicalResultScene.h create mode 100644 include/Pack/RPSports/RPSportsCommon/RPSportsTrainingMenuScene/RPSportsTrainingMenuScene.h create mode 100644 include/Pack/RPSports/RPTnsScene.h create mode 100644 include/Pack/RPSports/RPTnsScene/RPTnsScene.h create mode 100644 include/Pack/RPSystem/RPSysBootScene.h create mode 100644 include/Pack/RPSystem/RPSysCommonObject.h create mode 100644 include/Pack/RPSystem/RPSysNunchukCheckScene.h create mode 100644 include/Pack/RPSystem/RPSysPlayerSelectScene.h create mode 100644 include/Pack/RPUtility/RPUtlLoadSaveDataScene.h create mode 100644 src/Pack/RPSystem/RPSysLoadScene.cpp create mode 100644 src/Pack/RPSystem/RPSysSceneCreator.cpp create mode 100644 src/Pack/RPSystem/RPSysSceneMgr.cpp diff --git a/.clangd b/.clangd new file mode 100644 index 000000000..8d7b85d93 --- /dev/null +++ b/.clangd @@ -0,0 +1,8 @@ +CompileFlags: + Add: -ferror-limit=100 + +Diagnostics: + Suppress: + - bad_cxx_cast_unrelated_class + - init_conversion_failed + - member_function_call_bad_type diff --git a/config/RSPE01_01/symbols.txt b/config/RSPE01_01/symbols.txt index 0f4bfed0f..dfb70dbd3 100644 --- a/config/RSPE01_01/symbols.txt +++ b/config/RSPE01_01/symbols.txt @@ -6883,22 +6883,22 @@ fn_80183ED4 = .text:0x80183ED4; // type:function size:0x8 fn_80183EDC = .text:0x80183EDC; // type:function size:0x8 main = .text:0x80183EE4; // type:function size:0x34 scope:global OSReport = .text:0x80183F18; // type:function size:0x50 scope:global -fn_80183F68 = .text:0x80183F68; // type:function size:0x40 -fn_80183FA8 = .text:0x80183FA8; // type:function size:0x58 -fn_80184000 = .text:0x80184000; // type:function size:0x460 -fn_80184460 = .text:0x80184460; // type:function size:0x5C -fn_801844BC = .text:0x801844BC; // type:function size:0x9C -fn_80184558 = .text:0x80184558; // type:function size:0x9C -fn_801845F4 = .text:0x801845F4; // type:function size:0x9C -fn_80184690 = .text:0x80184690; // type:function size:0x5C -fn_801846EC = .text:0x801846EC; // type:function size:0x6C -fn_80184758 = .text:0x80184758; // type:function size:0xAC -fn_80184804 = .text:0x80184804; // type:function size:0x34 -fn_80184838 = .text:0x80184838; // type:function size:0x360 -fn_80184B98 = .text:0x80184B98; // type:function size:0xC -fn_80184BA4 = .text:0x80184BA4; // type:function size:0x26C -fn_80184E10 = .text:0x80184E10; // type:function size:0x70 -fn_80184E80 = .text:0x80184E80; // type:function size:0x10 +__dt__17RPSysSceneCreatorFv = .text:0x80183F68; // type:function size:0x40 +__dt__10RPSysSceneFv = .text:0x80183FA8; // type:function size:0x58 +createSportsScene__17RPSysSceneCreatorFl = .text:0x80184000; // type:function size:0x460 +__dt__17RPSportsBaseSceneFv = .text:0x80184460; // type:function size:0x5C +getAudioType__17RPSysSceneCreatorFl = .text:0x801844BC; // type:function size:0x9C +getExitType__17RPSysSceneCreatorFl = .text:0x80184558; // type:function size:0x9C +getCreateType__17RPSysSceneCreatorFl = .text:0x801845F4; // type:function size:0x9C +getSceneID__17RPSysSceneCreatorFQ217RPSysSceneCreator8ESportID = .text:0x80184690; // type:function size:0x5C +getSportID__17RPSysSceneCreatorFl = .text:0x801846EC; // type:function size:0x6C +getResDirName__17RPSysSceneCreatorFl = .text:0x80184758; // type:function size:0xAC +destroy__17RPSysSceneCreatorFl = .text:0x80184804; // type:function size:0x34 +create__17RPSysSceneCreatorFl = .text:0x80184838; // type:function size:0x360 +changeSoftReset__17RPSysSceneCreatorFv = .text:0x80184B98; // type:function size:0xC +changeSceneAfterFade__17RPSysSceneCreatorFlb = .text:0x80184BA4; // type:function size:0x26C +CreateInstance__17RPSysSceneCreatorFPQ23EGG4Heap = .text:0x80184E10; // type:function size:0x70 +setChildScene__10RPSysSceneFv = .text:0x80184E80; // type:function size:0x10 getCreatorSceneID__10RPSysSceneCFv = .text:0x80184E90; // type:function size:0x8 setCreatorSceneID__10RPSysSceneFl = .text:0x80184E98; // type:function size:0x8 init__10RPSysSceneFv = .text:0x80184EA0; // type:function size:0xF0 @@ -6926,7 +6926,7 @@ isSceneChangeEnable__10RPSysSceneCFv = .text:0x80185574; // type:function size:0 isSceneBlank__10RPSysSceneCFv = .text:0x8018557C; // type:function size:0x8 isSceneDisplay__10RPSysSceneCFv = .text:0x80185584; // type:function size:0x8 VF_0x3C__10RPSysSceneFv = .text:0x8018558C; // type:function size:0x8 -pauseCallBack__10RPSysSceneFv = .text:0x80185594; // type:function size:0x4 +pauseCallBack__10RPSysSceneFb = .text:0x80185594; // type:function size:0x4 LoadResource__10RPSysSceneFv = .text:0x80185598; // type:function size:0x4 taskAsync__10RPSysSceneFv = .text:0x8018559C; // type:function size:0x4 UserDraw__16IRPGrpDrawObjectFv = .text:0x801855A0; // type:function size:0x4 @@ -6934,40 +6934,41 @@ DebugDraw__16IRPGrpDrawObjectFv = .text:0x801855A4; // type:function size:0x4 __sinit_\RPSysScene_cpp = .text:0x801855A8; // type:function size:0xC scope:local fn_801855B4 = .text:0x801855B4; // type:function size:0x8 adjust__19RPSysRenderModeFPUsPUsii = .text:0x801855BC; // type:function size:0xBC -fn_80185678 = .text:0x80185678; // type:function size:0x58 -fn_801856D0 = .text:0x801856D0; // type:function size:0x198 -fn_80185868 = .text:0x80185868; // type:function size:0x34 -fn_8018589C = .text:0x8018589C; // type:function size:0x14 -fn_801858B0 = .text:0x801858B0; // type:function size:0x14 -fn_801858C4 = .text:0x801858C4; // type:function size:0x14 -fn_801858D8 = .text:0x801858D8; // type:function size:0x90 -fn_80185968 = .text:0x80185968; // type:function size:0x74 -fn_801859DC = .text:0x801859DC; // type:function size:0x74 -fn_80185A50 = .text:0x80185A50; // type:function size:0x74 -fn_80185AC4 = .text:0x80185AC4; // type:function size:0x74 -fn_80185B38 = .text:0x80185B38; // type:function size:0x14 -fn_80185B4C = .text:0x80185B4C; // type:function size:0x14 -fn_80185B60 = .text:0x80185B60; // type:function size:0x4 -fn_80185B64 = .text:0x80185B64; // type:function size:0x14 -fn_80185B78 = .text:0x80185B78; // type:function size:0x14 -fn_80185B8C = .text:0x80185B8C; // type:function size:0x48 -fn_80185BD4 = .text:0x80185BD4; // type:function size:0x8C -fn_80185C60 = .text:0x80185C60; // type:function size:0x2C -fn_80185C8C = .text:0x80185C8C; // type:function size:0x54 -fn_80185CE0 = .text:0x80185CE0; // type:function size:0x48 -fn_80185D28 = .text:0x80185D28; // type:function size:0xC -fn_80185D34 = .text:0x80185D34; // type:function size:0x40 -fn_80185D74 = .text:0x80185D74; // type:function size:0x190 -isDvdErrorApplicationEnd__13RPSysSceneMgrCFv = .text:0x80185F04; // type:function size:0x14 -fn_80185F18 = .text:0x80185F18; // type:function size:0x20 -fn_80185F38 = .text:0x80185F38; // type:function size:0x18 -fn_80185F50 = .text:0x80185F50; // type:function size:0x14 -isNormalState__13RPSysSceneMgrFv = .text:0x80185F64; // type:function size:0x10 -shutdownSystem__13RPSysSceneMgrFi = .text:0x80185F74; // type:function size:0x70 -returnToMenu__13RPSysSceneMgrFi = .text:0x80185FE4; // type:function size:0x70 -softReset__13RPSysSceneMgrFi = .text:0x80186054; // type:function size:0xAC -fn_80186100 = .text:0x80186100; // type:function size:0x8 -fn_80186108 = .text:0x80186108; // type:function size:0x12C +__dt__13RPSysSceneMgrFv = .text:0x80185678; // type:function size:0x58 +updateState__13RPSysSceneMgrFv = .text:0x801856D0; // type:function size:0x198 +calcCurrentScene__13RPSysSceneMgrFv = .text:0x80185868; // type:function size:0x34 +drawMgrFader__13RPSysSceneMgrFv = .text:0x8018589C; // type:function size:0x14 +drawSceneFader__13RPSysSceneMgrFv = .text:0x801858B0; // type:function size:0x14 +calcSceneFader__13RPSysSceneMgrFv = .text:0x801858C4; // type:function size:0x14 +isSceneChangeEnable__13RPSysSceneMgrFv = .text:0x801858D8; // type:function size:0x90 +isTaskFinished__13RPSysSceneMgrFv = .text:0x80185968; // type:function size:0x74 +isFadeOut__13RPSysSceneMgrFv = .text:0x801859DC; // type:function size:0x74 +isBlank__13RPSysSceneMgrFv = .text:0x80185A50; // type:function size:0x74 +isDisplay__13RPSysSceneMgrFv = .text:0x80185AC4; // type:function size:0x74 +startSceneFadeOut__13RPSysSceneMgrFv = .text:0x80185B38; // type:function size:0x14 +startSceneFadeIn__13RPSysSceneMgrFv = .text:0x80185B4C; // type:function size:0x14 +startMgrFadeIn__13RPSysSceneMgrFv = .text:0x80185B60; // type:function size:0x4 +setSceneStatus__13RPSysSceneMgrFQ33EGG5Fader7EStatus = .text:0x80185B64; // type:function size:0x14 +getSceneStatus__13RPSysSceneMgrFv = .text:0x80185B78; // type:function size:0x14 +setSceneFadeColor__13RPSysSceneMgrFQ34nw4r2ut5Color = .text:0x80185B8C; // type:function size:0x48 +setFadeColor__13RPSysSceneMgrFQ34nw4r2ut5Color = .text:0x80185BD4; // type:function size:0x8C +getFadeColor__13RPSysSceneMgrFv = .text:0x80185C60; // type:function size:0x8 +getColor__Q23EGG10ColorFaderCFv = .text:0x80185C68; // type:function size:0x24 +resetFadeColor__13RPSysSceneMgrFv = .text:0x80185C8C; // type:function size:0x54 +setFadeFrame__13RPSysSceneMgrFUs = .text:0x80185CE0; // type:function size:0x48 +getFadeFrame__13RPSysSceneMgrFv = .text:0x80185D28; // type:function size:0xC +resetFadeFrame__13RPSysSceneMgrFv = .text:0x80185D34; // type:function size:0x40 +changeNextSceneAfterFade__13RPSysSceneMgrFlb = .text:0x80185D74; // type:function size:0x190 +isDvdErrorApplicationEnd__13RPSysSceneMgrFv = .text:0x80185F04; // type:function size:0x14 +isApplicationEndReserved__13RPSysSceneMgrFv = .text:0x80185F18; // type:function size:0x20 +resetGuard__13RPSysSceneMgrFv = .text:0x80185F38; // type:function size:0x18 +isShutDownReserved__13RPSysSceneMgrCFv = .text:0x80185F50; // type:function size:0x14 +isNormalState__13RPSysSceneMgrCFv = .text:0x80185F64; // type:function size:0x10 +shutdownSystem__13RPSysSceneMgrFb = .text:0x80185F74; // type:function size:0x70 +returnToMenu__13RPSysSceneMgrFb = .text:0x80185FE4; // type:function size:0x70 +softReset__13RPSysSceneMgrFb = .text:0x80186054; // type:function size:0xAC +getCurrentSceneRP__13RPSysSceneMgrCFv = .text:0x80186100; // type:function size:0x8 +CreateInstance__13RPSysSceneMgrFPQ23EGG4Heap = .text:0x80186108; // type:function size:0x12C setLanguage__17RPSysProjectLocalFQ217RPSysProjectLocal5EArea = .text:0x80186234; // type:function size:0x8 setLocale__17RPSysProjectLocalFQ217RPSysProjectLocal5EArea = .text:0x8018623C; // type:function size:0x8 appendLocalDirectory__17RPSysProjectLocalFPcPCc = .text:0x80186244; // type:function size:0x120 @@ -6994,12 +6995,12 @@ fn_80186960 = .text:0x80186960; // type:function size:0xBC fn_80186A1C = .text:0x80186A1C; // type:function size:0x8C fn_80186AA8 = .text:0x80186AA8; // type:function size:0x78 fn_80186B20 = .text:0x80186B20; // type:function size:0x114 -fn_80186C34 = .text:0x80186C34; // type:function size:0xB8 -fn_80186CEC = .text:0x80186CEC; // type:function size:0x10 -fn_80186CFC = .text:0x80186CFC; // type:function size:0x20 -fn_80186D1C = .text:0x80186D1C; // type:function size:0x10 -fn_80186D2C = .text:0x80186D2C; // type:function size:0x4 -fn_80186D30 = .text:0x80186D30; // type:function size:0x110 +load__10RPSysSceneFv = .text:0x80186C34; // type:function size:0xB8 +enableLoadMessage__10RPSysSceneFv = .text:0x80186CEC; // type:function size:0x10 +isTaskAsyncFinish__10RPSysSceneCFv = .text:0x80186CFC; // type:function size:0x20 +setTaskAsync__10RPSysSceneFv = .text:0x80186D1C; // type:function size:0x10 +loadUpdate__10RPSysSceneFv = .text:0x80186D2C; // type:function size:0x4 +drawTimeStamp__10RPSysSceneFQ34nw4r2ut5Color = .text:0x80186D30; // type:function size:0x110 fn_80186E40 = .text:0x80186E40; // type:function size:0x58 fn_80186E98 = .text:0x80186E98; // type:function size:0x1C LoadFromDVD__20RPSysResourceManagerFPCcPQ23EGG4HeapQ33EGG9DvdRipper15EAllocDirectionPl = .text:0x80186EB4; // type:function size:0xEC @@ -15028,7 +15029,7 @@ cubeScale$10537 = .rodata:0x803820A4; // type:object size:0x4 scope:local @10977 = .rodata:0x803820B0; // type:object size:0x4 scope:local align:4 data:float lbl_803820B8 = .rodata:0x803820B8; // type:object size:0x10 lbl_803820C8 = .rodata:0x803820C8; // type:object size:0x30 -lbl_803820F8 = .rodata:0x803820F8; // type:object size:0x1E0 data:4byte +SCENE_ATTR_TABLE__17RPSysSceneCreator = .rodata:0x803820F8; // type:object size:0x1E0 data:4byte lbl_803822D8 = .rodata:0x803822D8; // type:object size:0xA data:string lbl_803822E2 = .rodata:0x803822E2; // type:object size:0x5 lbl_803822E7 = .rodata:0x803822E7; // type:object size:0x13 @@ -21859,7 +21860,7 @@ lbl_804BF4BC = .sbss:0x804BF4BC; // type:object size:0x4 data:4byte lbl_804BF4C0 = .sbss:0x804BF4C0; // type:object size:0x4 data:4byte sRenderModeFormat__11RPSysSystem = .sbss:0x804BF4C4; // type:object size:0x4 data:4byte lbl_804BF4C8 = .sbss:0x804BF4C8; // type:object size:0x8 data:4byte -lbl_804BF4D0 = .sbss:0x804BF4D0; // type:object size:0x8 data:4byte +sUnkStruct__10RPSysScene = .sbss:0x804BF4D0; // type:object size:0x4 data:4byte spInstance__13RPSysSceneMgr = .sbss:0x804BF4D8; // type:object size:0x8 data:4byte spInstance__17RPSysProjectLocal = .sbss:0x804BF4E0; // type:object size:0x4 data:4byte spInstance__15RPSysGameConfig = .sbss:0x804BF4E8; // type:object size:0x4 data:4byte diff --git a/configure.py b/configure.py index 6a143faf1..d102444cf 100755 --- a/configure.py +++ b/configure.py @@ -1206,7 +1206,7 @@ def MatchingFor(*versions): "progress_category": "system", # str | List[str] "objects": [ Object(NonMatching, "Pack/RPSystem/RPSysSceneCreator.cpp"), - Object(NonMatching, "Pack/RPSystem/RPSysScene.cpp"), + Object(Matching, "Pack/RPSystem/RPSysScene.cpp"), Object(NonMatching, "Pack/RPSystem/RPSysRenderMode.cpp"), Object(NonMatching, "Pack/RPSystem/RPSysSceneMgr.cpp"), Object(Matching, "Pack/RPSystem/RPSysProjectLocal.cpp"), diff --git a/include/Pack/RPGraphics/IRPGrpDrawObject.h b/include/Pack/RPGraphics/IRPGrpDrawObject.h index ce0d1388a..a20e87ae4 100644 --- a/include/Pack/RPGraphics/IRPGrpDrawObject.h +++ b/include/Pack/RPGraphics/IRPGrpDrawObject.h @@ -22,17 +22,17 @@ class IRPGrpDrawObject { /** * @brief Destructor */ - virtual ~IRPGrpDrawObject() {} // at 0x4 + virtual ~IRPGrpDrawObject() {} // at 0x8 /** * @brief Standard draw pass */ - virtual void UserDraw() {} // at 0x8 + virtual void UserDraw() {} // at 0xC /** * @brief Additional draw pass for debugging */ - virtual void DebugDraw() {} // at 0xC + virtual void DebugDraw() {} // at 0x10 }; //! @} diff --git a/include/Pack/RPGraphics/RPGrpRenderer.h b/include/Pack/RPGraphics/RPGrpRenderer.h index 8ff704506..9a4278c18 100644 --- a/include/Pack/RPGraphics/RPGrpRenderer.h +++ b/include/Pack/RPGraphics/RPGrpRenderer.h @@ -2,10 +2,13 @@ #define RP_GRAPHICS_RENDERER_H #include +#include + //! @addtogroup rp_graphics //! @{ // Forward declarations +class IRPGrpDrawObject; class RPGrpScreen; /** @@ -36,8 +39,17 @@ class RPGrpRenderer { static void StartDebugDraw(); + static RPGrpRenderer* Construct(EGG::Allocator* pAllocator, u16 id); + void Rendering(); void Destruct(); + void BecomeCurrent(); + + void AppendDrawObject(IRPGrpDrawObject* pObject); + + void PreCalculate(); + void PostCalculate(); + void CalculateInPause(); private: //! Allocator used for model-related allocations diff --git a/include/Pack/RPKernel/RPSysEffectCreator.h b/include/Pack/RPKernel/RPSysEffectCreator.h index e9fd23ef4..bfd43719d 100644 --- a/include/Pack/RPKernel/RPSysEffectCreator.h +++ b/include/Pack/RPKernel/RPSysEffectCreator.h @@ -16,6 +16,14 @@ class RPSysEffectCreator { * @param effectScene Effect scene index */ RPSysEffectCreator(u32 effectScene); + + /** + * @brief Destructor + */ + virtual ~RPSysEffectCreator(); // at 0x8 + +private: + char unk4[0x44 - 0x4]; }; //! @} diff --git a/include/Pack/RPKernel/RPSysEffectMgr.h b/include/Pack/RPKernel/RPSysEffectMgr.h index 00cb44281..36159494b 100644 --- a/include/Pack/RPKernel/RPSysEffectMgr.h +++ b/include/Pack/RPKernel/RPSysEffectMgr.h @@ -1,5 +1,5 @@ -#ifndef RP_KERNEL_EFFECT_MANAGER_H -#define RP_KERNEL_EFFECT_MANAGER_H +#ifndef RP_KERNEL_EFFECT_MGR_H +#define RP_KERNEL_EFFECT_MGR_H #include #include @@ -30,6 +30,8 @@ class RPSysEffectMgr { public: void stopAllEffect(); + + void setCreator(RPSysEffectCreator* pCreator, u32 effectScene); void resetCreator(RPSysEffectCreator* pCreator); }; diff --git a/include/Pack/RPKernel/RPSysHomeMenuMgr.h b/include/Pack/RPKernel/RPSysHomeMenuMgr.h index ce4b9527f..5c61d8b3f 100644 --- a/include/Pack/RPKernel/RPSysHomeMenuMgr.h +++ b/include/Pack/RPKernel/RPSysHomeMenuMgr.h @@ -1,9 +1,10 @@ -#ifndef RP_KERNEL_HOME_MENU_MANAGER_H -#define RP_KERNEL_HOME_MENU_MANAGER_H +#ifndef RP_KERNEL_HOME_MENU_MGR_H +#define RP_KERNEL_HOME_MENU_MGR_H #include -#include #include +#include + #include //! @addtogroup rp_kernel @@ -18,32 +19,36 @@ class RPSysHomeMenuMgr { public: void update(); + bool isOpen() const { + return mIsOpen; + } + /** * @brief Check if program is exiting/resetting and black out if true - * - * @return BOOL + * + * @return BOOL */ BOOL startBlackOut(); private: struct unknownArcStruct { - void *mArcFile; + void* mArcFile; u32 UNK_0x04; // set to 1 if DVD error occurs in function 801A4E8C u16 UNK_0x08; u16 UNK_0x0A; }; - u8 mUNK_0x08; // set to 1 at the end of LoadResource. bool? + u8 mUNK_0x08; // set to 1 at the end of LoadResource. bool? bool mUNK_0x09; // checked in 801A4E8C to make sure error has not occurred bool mUNK_0x0A; // set to true if no DVD error and scene change disabled - bool mBlackOutOk; + bool mIsOpen; u8 mUNK_0x0C; u8 mUNK_0x0D; u32 mUNK_0x10; u16 mUNK_0x14; RPSysProjectLocal* mProjectLocal; unknownArcStruct* mARC_0x1C; - HBMDataInfo *mMenuDataInfo; + HBMDataInfo* mMenuDataInfo; u32 mUNK_0x24; u32 mUNK_0x28; u32 mUNK_0x2C; @@ -55,11 +60,12 @@ class RPSysHomeMenuMgr { u32 mUNK_0x44; // Seemingly skipped in constructor? u32 mUNK_0x48; u32 mUNK_0x4C; - f32 mUNK_0x50; // Set to 1.2 if the console is in PAL 50 Hz mode, otherwise 1.0 + f32 mUNK_0x50; // Set to 1.2 if the console is in PAL 50 Hz mode, + // otherwise 1.0 f32 mUNK_0x54; f32 mUNK_0x58; u32 mUNK_0x5C; - const HBMControllerData *mHbmControllerData; + const HBMControllerData* mHbmControllerData; u8 mUNK_0x64[60]; KPADStatus mKpadStatus; }; diff --git a/include/Pack/RPParty.h b/include/Pack/RPParty.h deleted file mode 100644 index 0147f07be..000000000 --- a/include/Pack/RPParty.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef RP_PUBLIC_PARTY_H -#define RP_PUBLIC_PARTY_H - -#include - -#endif diff --git a/include/Pack/RPParty/RPBilScene.h b/include/Pack/RPParty/RPBilScene.h new file mode 100644 index 000000000..5a022c078 --- /dev/null +++ b/include/Pack/RPParty/RPBilScene.h @@ -0,0 +1,6 @@ +#ifndef RP_PUBLIC_PARTY_BIL_H +#define RP_PUBLIC_PARTY_BIL_H + +#include + +#endif diff --git a/include/Pack/RPParty/RPBilScene/RPBilScene.h b/include/Pack/RPParty/RPBilScene/RPBilScene.h new file mode 100644 index 000000000..e5cfd578c --- /dev/null +++ b/include/Pack/RPParty/RPBilScene/RPBilScene.h @@ -0,0 +1,19 @@ +#ifndef RP_PARTY_BIL_SCENE_H +#define RP_PARTY_BIL_SCENE_H +#include + +#include + +//! @addtogroup rp_bil +//! @{ + +/** + * @brief Party Pack Billiards scene + */ +class RPBilScene : public RPSysScene { + char unk44[0x58 - 0x44]; +}; + +//! @} + +#endif diff --git a/include/Pack/RPParty/RPBomScene.h b/include/Pack/RPParty/RPBomScene.h new file mode 100644 index 000000000..c5aba73ba --- /dev/null +++ b/include/Pack/RPParty/RPBomScene.h @@ -0,0 +1,6 @@ +#ifndef RP_PUBLIC_PARTY_BOM_H +#define RP_PUBLIC_PARTY_BOM_H + +#include + +#endif diff --git a/include/Pack/RPParty/RPBomScene/RPBomScene.h b/include/Pack/RPParty/RPBomScene/RPBomScene.h new file mode 100644 index 000000000..527c6e884 --- /dev/null +++ b/include/Pack/RPParty/RPBomScene/RPBomScene.h @@ -0,0 +1,19 @@ +#ifndef RP_PARTY_BOM_SCENE_H +#define RP_PARTY_BOM_SCENE_H +#include + +#include + +//! @addtogroup rp_bom +//! @{ + +/** + * @brief Party Pack Pose Mii scene + */ +class RPBomScene : public RPSysScene { + char unk44[0x8C - 0x44]; +}; + +//! @} + +#endif diff --git a/include/Pack/RPParty/RPCowScene.h b/include/Pack/RPParty/RPCowScene.h new file mode 100644 index 000000000..34dd1b9ef --- /dev/null +++ b/include/Pack/RPParty/RPCowScene.h @@ -0,0 +1,6 @@ +#ifndef RP_PUBLIC_PARTY_COW_H +#define RP_PUBLIC_PARTY_COW_H + +#include + +#endif diff --git a/include/Pack/RPParty/RPCowScene/RPCowScene.h b/include/Pack/RPParty/RPCowScene/RPCowScene.h new file mode 100644 index 000000000..29dda4f6b --- /dev/null +++ b/include/Pack/RPParty/RPCowScene/RPCowScene.h @@ -0,0 +1,17 @@ +#ifndef RP_PARTY_COW_SCENE_H +#define RP_PARTY_COW_SCENE_H +#include + +#include + +//! @addtogroup rp_cow +//! @{ + +/** + * @brief Party Pack Charge! scene + */ +class RPCowScene : public RPPartySeqScene {}; + +//! @} + +#endif diff --git a/include/Pack/RPParty/RPDucScene.h b/include/Pack/RPParty/RPDucScene.h new file mode 100644 index 000000000..43774685f --- /dev/null +++ b/include/Pack/RPParty/RPDucScene.h @@ -0,0 +1,6 @@ +#ifndef RP_PUBLIC_PARTY_DUC_H +#define RP_PUBLIC_PARTY_DUC_H + +#include + +#endif diff --git a/include/Pack/RPParty/RPDucScene/RPDucScene.h b/include/Pack/RPParty/RPDucScene/RPDucScene.h new file mode 100644 index 000000000..7ca5e2333 --- /dev/null +++ b/include/Pack/RPParty/RPDucScene/RPDucScene.h @@ -0,0 +1,19 @@ +#ifndef RP_PARTY_DUC_SCENE_H +#define RP_PARTY_DUC_SCENE_H +#include + +#include + +//! @addtogroup rp_duc +//! @{ + +/** + * @brief Party Pack Shooting Range scene + */ +class RPDucScene : public RPSysScene { + char unk44[0x80 - 0x44]; +}; + +//! @} + +#endif diff --git a/include/Pack/RPParty/RPFshScene.h b/include/Pack/RPParty/RPFshScene.h new file mode 100644 index 000000000..e3854eecc --- /dev/null +++ b/include/Pack/RPParty/RPFshScene.h @@ -0,0 +1,6 @@ +#ifndef RP_PUBLIC_PARTY_FSH_H +#define RP_PUBLIC_PARTY_FSH_H + +#include + +#endif diff --git a/include/Pack/RPParty/RPFshScene/RPFshScene.h b/include/Pack/RPParty/RPFshScene/RPFshScene.h new file mode 100644 index 000000000..92c5fa692 --- /dev/null +++ b/include/Pack/RPParty/RPFshScene/RPFshScene.h @@ -0,0 +1,19 @@ +#ifndef RP_PARTY_FSH_SCENE_H +#define RP_PARTY_FSH_SCENE_H +#include + +#include + +//! @addtogroup rp_fsh +//! @{ + +/** + * @brief Party Pack Fishing scene + */ +class RPFshScene : public RPSysScene { + char unk44[0x48 - 0x44]; +}; + +//! @} + +#endif diff --git a/include/Pack/RPParty/RPHkyScene.h b/include/Pack/RPParty/RPHkyScene.h new file mode 100644 index 000000000..48f1a7e03 --- /dev/null +++ b/include/Pack/RPParty/RPHkyScene.h @@ -0,0 +1,6 @@ +#ifndef RP_PUBLIC_PARTY_HKY_H +#define RP_PUBLIC_PARTY_HKY_H + +#include + +#endif diff --git a/include/Pack/RPParty/RPHkyScene/RPHkyScene.h b/include/Pack/RPParty/RPHkyScene/RPHkyScene.h new file mode 100644 index 000000000..f8349df6c --- /dev/null +++ b/include/Pack/RPParty/RPHkyScene/RPHkyScene.h @@ -0,0 +1,19 @@ +#ifndef RP_PARTY_HKY_SCENE_H +#define RP_PARTY_HKY_SCENE_H +#include + +#include + +//! @addtogroup rp_hky +//! @{ + +/** + * @brief Party Pack Laser Hockey scene + */ +class RPHkyScene : public RPSysScene { + char unk44[0x4C - 0x44]; +}; + +//! @} + +#endif diff --git a/include/Pack/RPParty/RPPartyCommon.h b/include/Pack/RPParty/RPPartyCommon.h new file mode 100644 index 000000000..0eaf86d36 --- /dev/null +++ b/include/Pack/RPParty/RPPartyCommon.h @@ -0,0 +1,10 @@ +#ifndef RP_PUBLIC_PARTY_COMMON_H +#define RP_PUBLIC_PARTY_COMMON_H + +#include +#include +#include +#include +#include + +#endif diff --git a/include/Pack/RPParty/RPPartyBodyManager.h b/include/Pack/RPParty/RPPartyCommon/RPPartyBodyManager.h similarity index 94% rename from include/Pack/RPParty/RPPartyBodyManager.h rename to include/Pack/RPParty/RPPartyCommon/RPPartyBodyManager.h index 83a7d48aa..45fdaa662 100644 --- a/include/Pack/RPParty/RPPartyBodyManager.h +++ b/include/Pack/RPParty/RPPartyCommon/RPPartyBodyManager.h @@ -1,5 +1,5 @@ -#ifndef RP_PARTY_BODY_MANAGER_H -#define RP_PARTY_BODY_MANAGER_H +#ifndef RP_PARTY_COMMON_BODY_MANAGER_H +#define RP_PARTY_COMMON_BODY_MANAGER_H #include #include diff --git a/include/Pack/RPParty/RPPartyCommon/RPPartyMainScene/RPPartyMainScene.h b/include/Pack/RPParty/RPPartyCommon/RPPartyMainScene/RPPartyMainScene.h new file mode 100644 index 000000000..6279affec --- /dev/null +++ b/include/Pack/RPParty/RPPartyCommon/RPPartyMainScene/RPPartyMainScene.h @@ -0,0 +1,17 @@ +#ifndef RP_PARTY_COMMON_MAIN_SCENE_H +#define RP_PARTY_COMMON_MAIN_SCENE_H +#include + +#include + +//! @addtogroup rp_party +//! @{ + +/** + * @brief Party Pack main menu scene + */ +class RPPartyMainScene : public RPSysScene {}; + +//! @} + +#endif diff --git a/include/Pack/RPParty/RPPartyCommon/RPPartyPackTitleScene/RPPartyPackTitleScene.h b/include/Pack/RPParty/RPPartyCommon/RPPartyPackTitleScene/RPPartyPackTitleScene.h new file mode 100644 index 000000000..ed6c2e74c --- /dev/null +++ b/include/Pack/RPParty/RPPartyCommon/RPPartyPackTitleScene/RPPartyPackTitleScene.h @@ -0,0 +1,19 @@ +#ifndef RP_PARTY_COMMON_PACK_TITLE_SCENE_H +#define RP_PARTY_COMMON_PACK_TITLE_SCENE_H +#include + +#include + +//! @addtogroup rp_party +//! @{ + +/** + * @brief Party Pack title screen scene + */ +class RPPartyPackTitleScene : public RPUtlLoadSaveDataScene { + char unk44[0x68 - 0x44]; +}; + +//! @} + +#endif diff --git a/include/Pack/RPParty/RPPartyCommon/RPPartyRootScene/RPPartyRootScene.h b/include/Pack/RPParty/RPPartyCommon/RPPartyRootScene/RPPartyRootScene.h new file mode 100644 index 000000000..6a16b1ecb --- /dev/null +++ b/include/Pack/RPParty/RPPartyCommon/RPPartyRootScene/RPPartyRootScene.h @@ -0,0 +1,17 @@ +#ifndef RP_PARTY_COMMON_ROOT_SCENE_H +#define RP_PARTY_COMMON_ROOT_SCENE_H +#include + +#include + +//! @addtogroup rp_party +//! @{ + +/** + * @brief Party Pack root scene + */ +class RPPartyRootScene : public RPSysScene {}; + +//! @} + +#endif diff --git a/include/Pack/RPParty/RPPartyCommon/RPPartySeqScene.h b/include/Pack/RPParty/RPPartyCommon/RPPartySeqScene.h new file mode 100644 index 000000000..b4a7fe67a --- /dev/null +++ b/include/Pack/RPParty/RPPartyCommon/RPPartySeqScene.h @@ -0,0 +1,19 @@ +#ifndef RP_PARTY_COMMON_SEQ_SCENE_H +#define RP_PARTY_COMMON_SEQ_SCENE_H +#include + +#include + +//! @addtogroup rp_party +//! @{ + +/** + * @brief Base class for Party Pack scenes using sequence logic + */ +class RPPartySeqScene : public RPSysScene { +private: +}; + +//! @} + +#endif diff --git a/include/Pack/RPParty/RPPnpScene.h b/include/Pack/RPParty/RPPnpScene.h new file mode 100644 index 000000000..2534ca311 --- /dev/null +++ b/include/Pack/RPParty/RPPnpScene.h @@ -0,0 +1,6 @@ +#ifndef RP_PUBLIC_PARTY_PNP_H +#define RP_PUBLIC_PARTY_PNP_H + +#include + +#endif diff --git a/include/Pack/RPParty/RPPnpScene/RPPnpScene.h b/include/Pack/RPParty/RPPnpScene/RPPnpScene.h new file mode 100644 index 000000000..01402d44f --- /dev/null +++ b/include/Pack/RPParty/RPPnpScene/RPPnpScene.h @@ -0,0 +1,19 @@ +#ifndef RP_PARTY_PNP_SCENE_H +#define RP_PARTY_PNP_SCENE_H +#include + +#include + +//! @addtogroup rp_pnp +//! @{ + +/** + * @brief Party Pack Table Tennis scene + */ +class RPPnpScene : public RPSysScene { + char unk44[0x4C - 0x44]; +}; + +//! @} + +#endif diff --git a/include/Pack/RPParty/RPTnkScene.h b/include/Pack/RPParty/RPTnkScene.h new file mode 100644 index 000000000..9989682e9 --- /dev/null +++ b/include/Pack/RPParty/RPTnkScene.h @@ -0,0 +1,6 @@ +#ifndef RP_PUBLIC_PARTY_TNK_H +#define RP_PUBLIC_PARTY_TNK_H + +#include + +#endif diff --git a/include/Pack/RPParty/RPTnkScene/RPTnkScene.h b/include/Pack/RPParty/RPTnkScene/RPTnkScene.h new file mode 100644 index 000000000..e67f8e22b --- /dev/null +++ b/include/Pack/RPParty/RPTnkScene/RPTnkScene.h @@ -0,0 +1,19 @@ +#ifndef RP_PARTY_TNK_SCENE_H +#define RP_PARTY_TNK_SCENE_H +#include + +#include + +//! @addtogroup rp_tnk +//! @{ + +/** + * @brief Party Pack Tanks! scene + */ +class RPTnkScene : public RPSysScene { + char unk44[0x8C - 0x44]; +}; + +//! @} + +#endif diff --git a/include/Pack/RPParty/RPWlyScene.h b/include/Pack/RPParty/RPWlyScene.h new file mode 100644 index 000000000..9984101bf --- /dev/null +++ b/include/Pack/RPParty/RPWlyScene.h @@ -0,0 +1,6 @@ +#ifndef RP_PUBLIC_PARTY_WLY_H +#define RP_PUBLIC_PARTY_WLY_H + +#include + +#endif diff --git a/include/Pack/RPParty/RPWlyScene/RPWlyScene.h b/include/Pack/RPParty/RPWlyScene/RPWlyScene.h new file mode 100644 index 000000000..e9cbd50ff --- /dev/null +++ b/include/Pack/RPParty/RPWlyScene/RPWlyScene.h @@ -0,0 +1,19 @@ +#ifndef RP_PARTY_WLY_SCENE_H +#define RP_PARTY_WLY_SCENE_H +#include + +#include + +//! @addtogroup rp_wly +//! @{ + +/** + * @brief Party Pack Find Mii scene + */ +class RPWlyScene : public RPSysScene { + char unk44[0x4C - 0x44]; +}; + +//! @} + +#endif diff --git a/include/Pack/RPSports.h b/include/Pack/RPSports.h deleted file mode 100644 index 9568e059d..000000000 --- a/include/Pack/RPSports.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef RP_PUBLIC_SPORTS_H -#define RP_PUBLIC_SPORTS_H - -#include -#include - -#endif diff --git a/include/Pack/RPSports/RPBowScene.h b/include/Pack/RPSports/RPBowScene.h new file mode 100644 index 000000000..e734eea71 --- /dev/null +++ b/include/Pack/RPSports/RPBowScene.h @@ -0,0 +1,6 @@ +#ifndef RP_PUBLIC_SPORTS_BOW_H +#define RP_PUBLIC_SPORTS_BOW_H + +#include + +#endif diff --git a/include/Pack/RPSports/RPBowScene/RPBowScene.h b/include/Pack/RPSports/RPBowScene/RPBowScene.h new file mode 100644 index 000000000..e0675908b --- /dev/null +++ b/include/Pack/RPSports/RPBowScene/RPBowScene.h @@ -0,0 +1,21 @@ +#ifndef RP_SPORTS_BOW_SCENE_H +#define RP_SPORTS_BOW_SCENE_H +#include + +#include +#include + +//! @addtogroup rp_bow +//! @{ + +/** + * @brief Sports Pack Bowling scene + */ +class RPBowScene : public RPSportsBaseScene, public IRPSysHostIOSocket { +private: + char unkA0[0x13C - 0xA0]; +}; + +//! @} + +#endif diff --git a/include/Pack/RPSports/RPBoxScene.h b/include/Pack/RPSports/RPBoxScene.h new file mode 100644 index 000000000..313ddb18c --- /dev/null +++ b/include/Pack/RPSports/RPBoxScene.h @@ -0,0 +1,6 @@ +#ifndef RP_PUBLIC_SPORTS_BOX_H +#define RP_PUBLIC_SPORTS_BOX_H + +#include + +#endif diff --git a/include/Pack/RPSports/RPBoxScene/RPBoxScene.h b/include/Pack/RPSports/RPBoxScene/RPBoxScene.h new file mode 100644 index 000000000..8c6a4879f --- /dev/null +++ b/include/Pack/RPSports/RPBoxScene/RPBoxScene.h @@ -0,0 +1,20 @@ +#ifndef RP_SPORTS_BOX_SCENE_H +#define RP_SPORTS_BOX_SCENE_H +#include + +#include + +//! @addtogroup rp_box +//! @{ + +/** + * @brief Sports Pack Boxing scene + */ +class RPBoxScene : public RPSportsBaseScene { +private: + char unk9C[0x10C - 0x9C]; +}; + +//! @} + +#endif diff --git a/include/Pack/RPSports/RPBsbScene.h b/include/Pack/RPSports/RPBsbScene.h new file mode 100644 index 000000000..cb6cdfbc8 --- /dev/null +++ b/include/Pack/RPSports/RPBsbScene.h @@ -0,0 +1,6 @@ +#ifndef RP_PUBLIC_SPORTS_BSB_H +#define RP_PUBLIC_SPORTS_BSB_H + +#include + +#endif diff --git a/include/Pack/RPSports/RPBsbScene/RPBsbScene.h b/include/Pack/RPSports/RPBsbScene/RPBsbScene.h new file mode 100644 index 000000000..007a97e4a --- /dev/null +++ b/include/Pack/RPSports/RPBsbScene/RPBsbScene.h @@ -0,0 +1,20 @@ +#ifndef RP_SPORTS_BSB_SCENE_H +#define RP_SPORTS_BSB_SCENE_H +#include + +#include + +//! @addtogroup rp_bsb +//! @{ + +/** + * @brief Sports Pack Baseball scene + */ +class RPBsbScene : public RPSportsBaseScene { +private: + char unk9C[0xA8 - 0x9C]; +}; + +//! @} + +#endif diff --git a/include/Pack/RPSports/RPGolScene.h b/include/Pack/RPSports/RPGolScene.h new file mode 100644 index 000000000..fbcb80f80 --- /dev/null +++ b/include/Pack/RPSports/RPGolScene.h @@ -0,0 +1,7 @@ +#ifndef RP_PUBLIC_SPORTS_GOL_H +#define RP_PUBLIC_SPORTS_GOL_H + +#include +#include + +#endif diff --git a/include/Pack/RPSports/RPGolScene/RPGolScene.h b/include/Pack/RPSports/RPGolScene/RPGolScene.h new file mode 100644 index 000000000..9c48919cc --- /dev/null +++ b/include/Pack/RPSports/RPGolScene/RPGolScene.h @@ -0,0 +1,20 @@ +#ifndef RP_SPORTS_GOL_SCENE_H +#define RP_SPORTS_GOL_SCENE_H +#include + +#include + +//! @addtogroup rp_gol +//! @{ + +/** + * @brief Sports Pack Golf scene + */ +class RPGolScene : public RPSportsBaseScene { +private: + char unk9C[0xA0 - 0x9C]; +}; + +//! @} + +#endif diff --git a/include/Pack/RPSports/RPGolScene/RPGolSelectScene.h b/include/Pack/RPSports/RPGolScene/RPGolSelectScene.h new file mode 100644 index 000000000..ee792ee87 --- /dev/null +++ b/include/Pack/RPSports/RPGolScene/RPGolSelectScene.h @@ -0,0 +1,19 @@ +#ifndef RP_SPORTS_GOL_COURSE_SELECT_SCENE_H +#define RP_SPORTS_GOL_COURSE_SELECT_SCENE_H +#include + +#include + +//! @addtogroup rp_gol +//! @{ + +/** + * @brief Sports Pack golf course select scene + */ +class RPGolCourseSelectScene : public RPSysScene { + char unk44[0xE4 - 0x44]; +}; + +//! @} + +#endif diff --git a/include/Pack/RPSports/RPSportsCommon.h b/include/Pack/RPSports/RPSportsCommon.h new file mode 100644 index 000000000..f762160ec --- /dev/null +++ b/include/Pack/RPSports/RPSportsCommon.h @@ -0,0 +1,14 @@ +#ifndef RP_PUBLIC_SPORTS_COMMON_H +#define RP_PUBLIC_SPORTS_COMMON_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/include/Pack/RPSports/RPSportsAppMiiManager.h b/include/Pack/RPSports/RPSportsCommon/RPSportsAppMiiManager.h similarity index 85% rename from include/Pack/RPSports/RPSportsAppMiiManager.h rename to include/Pack/RPSports/RPSportsCommon/RPSportsAppMiiManager.h index 8102dada7..89e2084a5 100644 --- a/include/Pack/RPSports/RPSportsAppMiiManager.h +++ b/include/Pack/RPSports/RPSportsCommon/RPSportsAppMiiManager.h @@ -1,5 +1,5 @@ -#ifndef RP_SPORTS_APP_MII_MANAGER_H -#define RP_SPORTS_APP_MII_MANAGER_H +#ifndef RP_SPORTS_COMMON_APP_MII_MANAGER_H +#define RP_SPORTS_COMMON_APP_MII_MANAGER_H #include #include diff --git a/include/Pack/RPSports/RPSportsCommon/RPSportsBaseScene.h b/include/Pack/RPSports/RPSportsCommon/RPSportsBaseScene.h new file mode 100644 index 000000000..a85b9a0d2 --- /dev/null +++ b/include/Pack/RPSports/RPSportsCommon/RPSportsBaseScene.h @@ -0,0 +1,38 @@ +#ifndef RP_SPORTS_COMMON_BASE_SCENE_H +#define RP_SPORTS_COMMON_BASE_SCENE_H +#include + +#include + +//! @addtogroup rp_sports +//! @{ + +/** + * @brief Base class for Sports Pack scenes + */ +class RPSportsBaseScene : public RPSysScene { +public: + virtual void Configure() override; + virtual void LoadResource() override; + virtual void Reset() override; + virtual void Calculate() override; + virtual void Exit() override; + + virtual void OnConfigure(); + virtual void OnLoadResource(); + virtual void OnReset(); + virtual void OnCalculate(); + virtual void OnUserDraw(); + virtual void OnDebugDraw(); + virtual void OnExit(); + + virtual void UserDraw() override; + virtual void DebugDraw() override; + +private: + char unk44[0x9C - 0x44]; +}; + +//! @} + +#endif diff --git a/include/Pack/RPSports/RPSportsBodyManager.h b/include/Pack/RPSports/RPSportsCommon/RPSportsBodyManager.h similarity index 94% rename from include/Pack/RPSports/RPSportsBodyManager.h rename to include/Pack/RPSports/RPSportsCommon/RPSportsBodyManager.h index 6e3f7e149..f2919ebec 100644 --- a/include/Pack/RPSports/RPSportsBodyManager.h +++ b/include/Pack/RPSports/RPSportsCommon/RPSportsBodyManager.h @@ -1,5 +1,5 @@ -#ifndef RP_SPORTS_BODY_MANAGER_H -#define RP_SPORTS_BODY_MANAGER_H +#ifndef RP_SPORTS_COMMON_BODY_MANAGER_H +#define RP_SPORTS_COMMON_BODY_MANAGER_H #include #include diff --git a/include/Pack/RPSports/RPSportsCommon/RPSportsMainScene/RPSportsMainScene.h b/include/Pack/RPSports/RPSportsCommon/RPSportsMainScene/RPSportsMainScene.h new file mode 100644 index 000000000..97c60185e --- /dev/null +++ b/include/Pack/RPSports/RPSportsCommon/RPSportsMainScene/RPSportsMainScene.h @@ -0,0 +1,19 @@ +#ifndef RP_SPORTS_COMMON_MAIN_SCENE_H +#define RP_SPORTS_COMMON_MAIN_SCENE_H +#include + +#include + +//! @addtogroup rp_sports +//! @{ + +/** + * @brief Sports Pack main menu scene + */ +class RPSportsMainScene : public RPSysScene { + char unk44[0x58 - 0x44]; +}; + +//! @} + +#endif diff --git a/include/Pack/RPSports/RPSportsCommon/RPSportsPackTitleScene/RPSportsPackTitleScene.h b/include/Pack/RPSports/RPSportsCommon/RPSportsPackTitleScene/RPSportsPackTitleScene.h new file mode 100644 index 000000000..84a448939 --- /dev/null +++ b/include/Pack/RPSports/RPSportsCommon/RPSportsPackTitleScene/RPSportsPackTitleScene.h @@ -0,0 +1,31 @@ +#ifndef RP_SPORTS_COMMON_PACK_TITLE_SCENE_H +#define RP_SPORTS_COMMON_PACK_TITLE_SCENE_H +#include + +#include + +//! @addtogroup rp_sports +//! @{ + +/** + * @brief Sports Pack title screen scene + */ +class RPSportsPackTitleScene : public RPUtlLoadSaveDataScene { +private: + struct UnkStruct { + u32 unk0; + u32 unk4; + u32 unk8; + + UnkStruct() : unk0(0), unk4(0), unk8(0) {} + }; + +private: + char unk44[0x54 - 0x44]; + UnkStruct unk60[(0x84 - 0x54) / sizeof(UnkStruct)]; + char unk84[0xA0 - 0x84]; +}; + +//! @} + +#endif diff --git a/include/Pack/RPSports/RPSportsCommon/RPSportsPhysicalMenuScene/RPSportsPhysicalMenuScene.h b/include/Pack/RPSports/RPSportsCommon/RPSportsPhysicalMenuScene/RPSportsPhysicalMenuScene.h new file mode 100644 index 000000000..3f7f323da --- /dev/null +++ b/include/Pack/RPSports/RPSportsCommon/RPSportsPhysicalMenuScene/RPSportsPhysicalMenuScene.h @@ -0,0 +1,19 @@ +#ifndef RP_SPORTS_COMMON_PHYSICAL_MENU_SCENE_H +#define RP_SPORTS_COMMON_PHYSICAL_MENU_SCENE_H +#include + +#include + +//! @addtogroup rp_sports +//! @{ + +/** + * @brief Sports Pack Wii Fitness menu scene + */ +class RPSportsPhysicalMenuScene : public RPSysScene { + char unk44[0x5C - 0x44]; +}; + +//! @} + +#endif diff --git a/include/Pack/RPSports/RPSportsCommon/RPSportsPhysicalPreviewScene/RPSportsPhysicalPreviewScene.h b/include/Pack/RPSports/RPSportsCommon/RPSportsPhysicalPreviewScene/RPSportsPhysicalPreviewScene.h new file mode 100644 index 000000000..db58d2567 --- /dev/null +++ b/include/Pack/RPSports/RPSportsCommon/RPSportsPhysicalPreviewScene/RPSportsPhysicalPreviewScene.h @@ -0,0 +1,19 @@ +#ifndef RP_SPORTS_COMMON_PHYSICAL_PREVIEW_SCENE_H +#define RP_SPORTS_COMMON_PHYSICAL_PREVIEW_SCENE_H +#include + +#include + +//! @addtogroup rp_sports +//! @{ + +/** + * @brief Sports Pack Wii Fitness game preview scene + */ +class RPSportsPhysicalPreviewScene : public RPSysScene { + char unk44[0x60 - 0x44]; +}; + +//! @} + +#endif diff --git a/include/Pack/RPSports/RPSportsCommon/RPSportsPhysicalResultScene/RPSportsPhysicalResultScene.h b/include/Pack/RPSports/RPSportsCommon/RPSportsPhysicalResultScene/RPSportsPhysicalResultScene.h new file mode 100644 index 000000000..a01bf689e --- /dev/null +++ b/include/Pack/RPSports/RPSportsCommon/RPSportsPhysicalResultScene/RPSportsPhysicalResultScene.h @@ -0,0 +1,19 @@ +#ifndef RP_SPORTS_COMMON_PHYSICAL_RESULT_SCENE_H +#define RP_SPORTS_COMMON_PHYSICAL_RESULT_SCENE_H +#include + +#include + +//! @addtogroup rp_sports +//! @{ + +/** + * @brief Sports Pack Wii Fitness results scene + */ +class RPSportsPhysicalResultScene : public RPSysScene { + char unk44[0x58 - 0x44]; +}; + +//! @} + +#endif diff --git a/include/Pack/RPSports/RPSportsCommon/RPSportsTrainingMenuScene/RPSportsTrainingMenuScene.h b/include/Pack/RPSports/RPSportsCommon/RPSportsTrainingMenuScene/RPSportsTrainingMenuScene.h new file mode 100644 index 000000000..417170f58 --- /dev/null +++ b/include/Pack/RPSports/RPSportsCommon/RPSportsTrainingMenuScene/RPSportsTrainingMenuScene.h @@ -0,0 +1,19 @@ +#ifndef RP_SPORTS_COMMON_TRAINING_MENU_SCENE_H +#define RP_SPORTS_COMMON_TRAINING_MENU_SCENE_H +#include + +#include + +//! @addtogroup rp_sports +//! @{ + +/** + * @brief Sports Pack training menu scene + */ +class RPSportsTrainingMenuScene : public RPSysScene { + char unk44[0x78 - 0x44]; +}; + +//! @} + +#endif diff --git a/include/Pack/RPSports/RPTnsScene.h b/include/Pack/RPSports/RPTnsScene.h new file mode 100644 index 000000000..e162e1220 --- /dev/null +++ b/include/Pack/RPSports/RPTnsScene.h @@ -0,0 +1,6 @@ +#ifndef RP_PUBLIC_SPORTS_TNS_H +#define RP_PUBLIC_SPORTS_TNS_H + +#include + +#endif diff --git a/include/Pack/RPSports/RPTnsScene/RPTnsScene.h b/include/Pack/RPSports/RPTnsScene/RPTnsScene.h new file mode 100644 index 000000000..6c3e37fe8 --- /dev/null +++ b/include/Pack/RPSports/RPTnsScene/RPTnsScene.h @@ -0,0 +1,20 @@ +#ifndef RP_SPORTS_TNS_SCENE_H +#define RP_SPORTS_TNS_SCENE_H +#include + +#include + +//! @addtogroup rp_tns +//! @{ + +/** + * @brief Sports Pack Tennis scene + */ +class RPTnsScene : public RPSportsBaseScene { +private: + char unk9C[0xA0 - 0x9C]; +}; + +//! @} + +#endif diff --git a/include/Pack/RPSystem.h b/include/Pack/RPSystem.h index 9536c76ae..7970b81f7 100644 --- a/include/Pack/RPSystem.h +++ b/include/Pack/RPSystem.h @@ -5,12 +5,16 @@ #include #include #include +#include +#include #include #include #include +#include #include #include #include +#include #include #include #include diff --git a/include/Pack/RPSystem/RPSysBootScene.h b/include/Pack/RPSystem/RPSysBootScene.h new file mode 100644 index 000000000..56d051232 --- /dev/null +++ b/include/Pack/RPSystem/RPSysBootScene.h @@ -0,0 +1,20 @@ +#ifndef RP_SYSTEM_BOOT_SCENE_H +#define RP_SYSTEM_BOOT_SCENE_H +#include + +#include + +//! @addtogroup rp_system +//! @{ + +/** + * @brief Pack Project bootup scene + */ +class RPSysBootScene : public RPSysScene { +private: + char unk44[0x58 - 0x44]; +}; + +//! @} + +#endif diff --git a/include/Pack/RPSystem/RPSysCommonObject.h b/include/Pack/RPSystem/RPSysCommonObject.h new file mode 100644 index 000000000..c81dc6244 --- /dev/null +++ b/include/Pack/RPSystem/RPSysCommonObject.h @@ -0,0 +1,43 @@ +#ifndef RP_SYSTEM_COMMON_OBJECT_H +#define RP_SYSTEM_COMMON_OBJECT_H +#include + +#include + +//! @addtogroup rp_system +//! @{ + +/** + * @brief Encapsulates common object behavior/rendering + */ +class RPSysCommonObject : public IRPGrpDrawObject { +public: + /** + * @brief Constructor + */ + RPSysCommonObject(); + + /** + * @brief Renders common objects' state + */ + virtual void UserDraw() override; // at 0xC + + /** + * @brief Initializes common objects' state + */ + void init(); + + /** + * @brief Updates common objects' state before the scene gets to update + */ + void preUpdate(); + + /** + * @brief Updates common objects' state after the scene gets to update + */ + void postUpdate(); +}; + +//! @} + +#endif diff --git a/include/Pack/RPSystem/RPSysNunchukCheckScene.h b/include/Pack/RPSystem/RPSysNunchukCheckScene.h new file mode 100644 index 000000000..9f948e1d3 --- /dev/null +++ b/include/Pack/RPSystem/RPSysNunchukCheckScene.h @@ -0,0 +1,21 @@ +#ifndef RP_SYSTEM_NUNCHUK_CHECK_SCENE_H +#define RP_SYSTEM_NUNCHUK_CHECK_SCENE_H +#include + +#include +#include + +//! @addtogroup rp_system +//! @{ + +/** + * @brief Pack Project Nunchuk check scene + */ +class RPSysNunchukCheckScene : public RPSysScene, public IRPSysHostIOSocket { +private: + char unk48[0x98 - 0x48]; +}; + +//! @} + +#endif diff --git a/include/Pack/RPSystem/RPSysPauseMgr.h b/include/Pack/RPSystem/RPSysPauseMgr.h index 4d8cbab55..afcd258f1 100644 --- a/include/Pack/RPSystem/RPSysPauseMgr.h +++ b/include/Pack/RPSystem/RPSysPauseMgr.h @@ -1,5 +1,6 @@ #ifndef RP_SYSTEM_PAUSE_MGR_H #define RP_SYSTEM_PAUSE_MGR_H +#include #include @@ -7,25 +8,18 @@ //! @{ /** - * @brief - * Pause manager + * @brief Pause menu manager */ - class RPSysPauseMgr { RP_SINGLETON_DECL_EX(RPSysPauseMgr); public: - /** - * @brief - * Draws pause screen. Passes to RPSysPauseMenu - */ - void draw(void); + bool isPause() const { + return unk8 & 1; + } private: - u32 mUNK_0x08; - u32 mUNK_0x0C; - f32 mFloats_0x10[0x78]; // TODO(Texline666) What are all these floats for? - void* mLytPause; // placeholder for RPSysLytPause + u32 unk8; }; //! @} diff --git a/include/Pack/RPSystem/RPSysPlayerSelectScene.h b/include/Pack/RPSystem/RPSysPlayerSelectScene.h new file mode 100644 index 000000000..6d6f1dc1b --- /dev/null +++ b/include/Pack/RPSystem/RPSysPlayerSelectScene.h @@ -0,0 +1,20 @@ +#ifndef RP_SYSTEM_PLAYER_SELECT_SCENE_H +#define RP_SYSTEM_PLAYER_SELECT_SCENE_H +#include + +#include + +//! @addtogroup rp_system +//! @{ + +/** + * @brief Pack Project player select scene + */ +class RPSysPlayerSelectScene : public RPSysScene { +private: + char unk44[0x8C - 0x44]; +}; + +//! @} + +#endif diff --git a/include/Pack/RPSystem/RPSysResourceManager.h b/include/Pack/RPSystem/RPSysResourceManager.h index 430fc1cf8..484b73ba9 100644 --- a/include/Pack/RPSystem/RPSysResourceManager.h +++ b/include/Pack/RPSystem/RPSysResourceManager.h @@ -3,7 +3,7 @@ #include #include -#include +#include #include #include diff --git a/include/Pack/RPSystem/RPSysScene.h b/include/Pack/RPSystem/RPSysScene.h index fee636a4e..881392bf2 100644 --- a/include/Pack/RPSystem/RPSysScene.h +++ b/include/Pack/RPSystem/RPSysScene.h @@ -17,6 +17,8 @@ class RPSysCommonObject; * @brief Pack Project scene */ class RPSysScene : public EGG::Scene, public IRPGrpDrawObject { + friend class RPSysSceneCreator; + public: struct UnkStruct { u32 unk0; @@ -29,14 +31,9 @@ class RPSysScene : public EGG::Scene, public IRPGrpDrawObject { */ RPSysScene(); - /** - * @brief Destructor - */ - virtual ~RPSysScene() override {} // at 0x8 - /** * @name Internal events - * @brief These event functions are internal and should not be overriden. + * @brief These functions are internal, and should not be overriden. */ /**@{*/ /** @@ -76,9 +73,9 @@ class RPSysScene : public EGG::Scene, public IRPGrpDrawObject { /**@}*/ /** - * @name User events - * @brief These event functions are mostly empty stubs and should be - * overriden to provide scene functionality. + * @name Lifecycle hooks + * @brief These functions are mostly empty stubs, and should be overridden + * to provide scene functionality. */ /**@{*/ virtual UnkStruct& VF_0x3C() { @@ -90,7 +87,7 @@ class RPSysScene : public EGG::Scene, public IRPGrpDrawObject { * * @param enter Whether the pause menu is being entered */ - virtual void pauseCallBack(bool enter); // at 0x40 + virtual void pauseCallBack(bool /* enter */) {} // at 0x40 /** * @brief Initializes the scene's state for the first time @@ -144,9 +141,9 @@ class RPSysScene : public EGG::Scene, public IRPGrpDrawObject { bool isNandAccessEnable() const; /** - * @brief Sets the current frame of both faders + * @brief Sets the duration of all faders * - * @param frame Frame count + * @param frame Fade duration, in frames */ void setFadeFrame(u16 frame); @@ -156,7 +153,7 @@ class RPSysScene : public EGG::Scene, public IRPGrpDrawObject { nw4r::ut::Color getFadeColor() const; /** - * @brief Sets the color of both faders + * @brief Sets the color of all faders * * @param color Fade color */ @@ -171,13 +168,17 @@ class RPSysScene : public EGG::Scene, public IRPGrpDrawObject { /** * @brief Begins fading in the scene fader + * + * @return Success */ - void startFadeIn(); + bool startFadeIn(); /** * @brief Begins fading out the scene fader + * + * @return Success */ - void startFadeOut(); + bool startFadeOut(); /** * @brief Toggles screen dimming @@ -187,16 +188,88 @@ class RPSysScene : public EGG::Scene, public IRPGrpDrawObject { */ void setDimming(bool enable); + /** + * @brief Sets this scene's parent/creator ID + * + * @param id ID of this scene's parent/creator + */ + void setCreatorSceneID(s32 id); + + /** + * @brief Gets this scene's parent/creator ID + */ + s32 getCreatorSceneID() const; + + /** + * @brief Marks this scene as a child of the previous scene + */ + void setChildScene(); + protected: + /** + * @brief Prepares this scene to be entered + */ + DECOMP_INLINE void incomingScene(); + + /** + * @brief Prepares this scene to be exited + */ void outgoingScene(); + /** + * @brief Finalizes this scene after being exited + */ void exitScenePost(); + /** + * @brief Initializes this scene's members + */ void init(); - void setCreatorSceneID(s32 id); + /** + * @brief Displays the game's build date timestamp + * + * @param color Text color + */ + void drawTimeStamp(nw4r::ut::Color color); - s32 getCreatorSceneID() const; + void loadUpdate(); + + void initTaskAsync(); + void setTaskAsync(); + bool isTaskAsyncFinish() const; + + /** + * @brief Enables the "Now Loading" message display + */ + void enableLoadMessage(); + + /** + * @brief Loads this scene's resources asynchronously + */ + void load(); + + /** + * @brief Loads this scene's resources asynchronously, displaying a "Now + * Loading" message if the feature is enabled + */ + void loadMessage(); + + void updateDvdEndMessage(); + void updateNandEndMessage(); + + static void loadResourceFunc(void* pArg); + +private: + /** + * @brief Scene flags + */ + enum { + EFlag_LoadMessage, //!< Display "Now Loading" message + EFlag_1 = 1, + EFlag_2, + EFlag_IsChild, //!< This scene was created as a child + }; private: static UnkStruct sUnkStruct; diff --git a/include/Pack/RPSystem/RPSysSceneCreator.h b/include/Pack/RPSystem/RPSysSceneCreator.h index be7028d22..d2444a526 100644 --- a/include/Pack/RPSystem/RPSysSceneCreator.h +++ b/include/Pack/RPSystem/RPSysSceneCreator.h @@ -9,21 +9,24 @@ //! @addtogroup rp_system //! @{ +// Forward declarations +class RPSysScene; + /** - * @brief Scene factory + * @brief Pack Project scene factory */ class RPSysSceneCreator : public EGG::SceneCreator { RP_SINGLETON_DECL_EX(RPSysSceneCreator); public: /** - * @brief Game scene ID + * @brief Pack Project scene ID */ enum ESceneID { // RPSystem ESceneID_RPSysBootScene, //!< Logo ESceneID_RPSysPlayerSelectScene, //!< Player Select - ESceneID_RPSysNunchukScene, //!< Nunchuk Check + ESceneID_RPSysNunchukCheckScene, //!< Nunchuk Check // RPSports ESceneID_RPBsbScene, //!< Baseball @@ -31,13 +34,13 @@ class RPSysSceneCreator : public EGG::SceneCreator { ESceneID_RPGolScene, //!< Golf ESceneID_RPTnsScene, //!< Tennis ESceneID_RPBoxScene, //!< Boxing - ESceneID_RPSportsTitleScene, //!< Sports Pack - ESceneID_RPSportsMenuScene, //!< Main Menu + ESceneID_RPSportsPackTitleScene, //!< Sports Pack + ESceneID_RPSportsMainScene, //!< Main Menu ESceneID_RPSportsTrainingMenuScene, //!< Training Menu ESceneID_RPSportsPhysicalMenuScene, //!< Physical Test (Menu) ESceneID_RPSportsPhysicalPreviewScene, //!< Physical Test (Description) ESceneID_RPSportsPhysicalResultScene, //!< Physical Test (Result) - ESceneID_RPGolSelectScene, //!< Golf (Course Select) + ESceneID_RPGolCourseSelectScene, //!< Golf (Course Select) #if defined(PACK_SPORTS) ESceneID_Max, @@ -45,23 +48,26 @@ class RPSysSceneCreator : public EGG::SceneCreator { // RPParty ESceneID_Unknown09h, - ESceneID_RPFshScene, //!< Fishing - ESceneID_RPHkyScene, //!< Laser Hockey - ESceneID_RPDucScene, //!< Shooting Range - ESceneID_RPPnpScene, //!< Table Tennis - ESceneID_RPBilScene, //!< Billiards - ESceneID_RPCowScene, //!< Charge! - ESceneID_RPWlyScene, //!< Find Mii - ESceneID_RPTnkScene, //!< Tanks! - ESceneID_RPBomScene, //!< Pose Mii - ESceneID_RPPartyTitleScene, //!< Party Pack - ESceneID_RPPartyMiiLoadScene, //!< Mii/GameMgr Setup - ESceneID_RPPartyMenuScene, //!< Main Menu + ESceneID_RPFshScene, //!< Fishing + ESceneID_RPHkyScene, //!< Laser Hockey + ESceneID_RPDucScene, //!< Shooting Range + ESceneID_RPPnpScene, //!< Table Tennis + ESceneID_RPBilScene, //!< Billiards + ESceneID_RPCowScene, //!< Charge! + ESceneID_RPWlyScene, //!< Find Mii + ESceneID_RPTnkScene, //!< Tanks! + ESceneID_RPBomScene, //!< Pose Mii + ESceneID_RPPartyPackTitleScene, //!< Party Pack + ESceneID_RPPartyRootScene, //!< Mii/GameMgr Setup + ESceneID_RPPartyMainScene, //!< Main Menu #if defined(PACK_PARTY) ESceneID_Max, #endif + // During the development of Wii Sports and Wii Play, + // Wii Fit and Wii Music were very early in development. +#if defined(PACK_SPORTS) || defined(PACK_PARTY) // RPHealth ESceneID_RPHealthTitleScene, //!< Health Pack ESceneID_RPHealthCounselScene, //!< Counseling @@ -100,19 +106,7 @@ class RPSysSceneCreator : public EGG::SceneCreator { ESceneID_RPDrmDebugScene, //!< Drum Debug ESceneID_RPOchDebugScene, //!< Orchestra Debug ESceneID_RPOchSelectScene, //!< Orchestra Music Select - }; - - /** - * @brief Sport ID - */ - enum ESportID { - ESportID_Bsb, //!< Baseball - ESportID_Tns, //!< Tennis - ESportID_Gol, //!< Golf - ESportID_Box, //!< Boxing - ESportID_Bow, //!< Bowling - - ESportID_Max +#endif }; /** @@ -137,6 +131,14 @@ class RPSysSceneCreator : public EGG::SceneCreator { ECreateType_Child, //!< Become child of outgoing scene }; + /** + * @brief Scene load type + */ + enum ELoadType { + ELoadType_Blank, //!< No additional display + ELoadType_Message, //!< Display "Now Loading" message + }; + /** * @brief Scene exit type */ @@ -149,126 +151,194 @@ class RPSysSceneCreator : public EGG::SceneCreator { }; /** - * @brief Scene information + * @brief Scene audio type + */ + enum EAudioType { + EAudioType_Scene, //!< Use the scene's sound archive + EAudioType_Common, //!< Use the common sound archive + }; + + /** + * @brief Sport ID + */ + enum ESportID { + ESportID_Bsb, //!< Baseball + ESportID_Tns, //!< Tennis + ESportID_Gol, //!< Golf + ESportID_Box, //!< Boxing + ESportID_Bow, //!< Bowling + + ESportID_Max, + }; + + /** + * @brief Scene attributes */ - struct SceneEntry { + struct SceneAttr { //! Scene ID ESceneID scene; // at 0x0 //! Pack ID EPackID pack; // at 0x4 + //! How to create the scene ECreateType createType; // at 0x8 - //! Toggle "Now Loading" text (unused) - BOOL loadingText; // at 0xC + //! How to load the scene + ELoadType loadType; // at 0xC //! How to exit the scene EExitType exitType; // at 0x10 - //! Whether to use the RP common sound archive - BOOL commonSound; // at 0x14 - //! Scene resource directory + //! How to configure the scene audio + EAudioType audioType; // at 0x14 + + //! Root resource directory const char* pResDirName; // at 0x18 - //! Proper name + //! Readable name const char* pSceneName; // at 0x1C }; public: /** - * @brief Creates a scene by ID + * @brief Creates the specified scene * * @param id Scene ID */ virtual EGG::Scene* create(s32 id); // at 0x8 + /** - * @brief Destroys a scene - * @remark If the scene manager has requested a shutdown, this function will - * tell the system to shutdown. + * @brief Destroys the specified scene * - * @param id ID of the scene being destroyed + * @param id Scene ID */ virtual void destroy(s32 id); // at 0xC -#if defined(PACK_SPORTS) /** - * @brief Creates a Sports Pack scene by ID + * @brief Requests a scene change after fading out + * @details A scene id of -1 will select the current scene. + * + * @param id New scene ID + * @param reconfigure Whether to fully reconfigure the scene + * @return Success + */ + bool changeSceneAfterFade(s32 id, bool reconfigure = false) + DECOMP_DONT_INLINE; + + /** + * @brief Changes to the title scene + * + * @return Success + */ + bool changeSoftReset(); + + /** + * @brief Gets the specified scene's resource directory + * @details A scene id of -1 will select the current scene. * * @param id Scene ID */ - EGG::Scene* createSportsScene(s32 id); -#elif defined(PACK_PARTY) + const char* getResDirName(s32 id = -1); + /** - * @brief Creates a Party Pack scene by ID + * @brief Gets the specified scene's sport ID + * @details A scene id of -1 will select the current scene. + * @note If no sport corresponds to the scene, this function returns -1. * * @param id Scene ID */ - EGG::Scene* createPartyScene(s32 id); -#endif + s32 getSportID(s32 id = -1); /** - * @brief Fades out the current scene and changes to a new scene - * @note Supply an ID of -1 to use the ID of the current scene + * @brief Gets the specified sport's scene ID + * @note If no scene corresponds to the sport, this function returns -1. * - * @param id New scene ID (-1 for current scene) - * @param reload Whether to reload the current scene - * @return Success + * @param sport Sport ID */ - bool changeSceneAfterFade(s32 id, bool reload = false); + s32 getSceneID(ESportID sport); + /** - * @brief Changes to the boot scene (performs a soft reset) + * @brief Gets the specified scene's pack ID + * + * @param id Scene ID */ - void changeSoftReset(); + EPackID getPackID(s32 id); /** - * @brief Gets the scene's resource directory + * @brief Gets the specified scene's creation type * - * @param id Scene ID (-1 to use the current scene) + * @param id Scene ID */ - const char* getResDirName(s32 id = -1); + ECreateType getCreateType(s32 id); -#if defined(PACK_SPORTS) /** - * @brief Gets the sport corresponding to the scene ID - * @note If the specified scene has no entry, this function returns -1. + * @brief Gets the specified scene's load type * - * @param id Scene ID (-1 to use the current scene) + * @param id Scene ID */ - s32 getSportID(s32 id = -1); -#endif + ELoadType getLoadType(s32 id); /** - * @brief Gets the scene ID corresponding to the sport - * @note If the specified sport has no entry, this function returns -1. + * @brief Gets the specified scene's exit type * - * @param sport Sport ID + * @param id Scene ID */ - s32 getSceneID(ESportID sport); + EExitType getExitType(s32 id); /** - * @brief Gets the scene's create logic type + * @brief Gets the specified scene's audio type * - * @param id Scene ID (-1 to use the current scene) + * @param id Scene ID */ - s32 getCreateType(s32 id = -1); + EAudioType getAudioType(s32 id); +private: /** - * @brief Gets the scene's exit logic type + * @brief Gets the index of the specified scene's entry in the table * - * @param id Scene ID (-1 to use the current scene) + * @param id Scene ID + * @return Entry index, or -1 if not found */ - s32 getExitType(s32 id = -1); + s32 getEntryIndex(ESceneID id); +#if defined(PACK_SPORTS) /** - * @brief Tests whether the scene should use the pack's common sound - * archive. + * @brief Creates the specified Sports Pack scene * - * @param id Scene ID (-1 to use the current scene) + * @param id Scene ID + */ + RPSysScene* createSportsScene(s32 id) DECOMP_DONT_INLINE; +#endif + +#if defined(PACK_PARTY) + /** + * @brief Creates the specified Party Pack scene + * + * @param id Scene ID */ - bool isCommonSound(s32 id = -1); + RPSysScene* createPartyScene(s32 id) DECOMP_DONT_INLINE; +#endif + +#if defined(PACK_HEALTH) + /** + * @brief Creates the specified Health Pack scene + * + * @param id Scene ID + */ + RPSysScene* createHealthScene(s32 id) DECOMP_DONT_INLINE; +#endif + +#if defined(PACK_MUSIC) + /** + * @brief Creates the specified Music Pack scene + * + * @param id Scene ID + */ + RPSysScene* createMusicScene(s32 id) DECOMP_DONT_INLINE; +#endif private: - //! ID of the previous scene - s32 mLastSceneID; // at 0x8 + //! Information about every Pack Project scene + static const SceneAttr SCENE_ATTR_TABLE[]; - //! Entries for all Pack Project scenes - static SceneEntry sSceneEntryTable[]; + //! ID of the previous scene + s32 mPrevSceneID; // at 0x8 }; //! @} diff --git a/include/Pack/RPSystem/RPSysSceneMgr.h b/include/Pack/RPSystem/RPSysSceneMgr.h index 0568f0300..ce4c9f75b 100644 --- a/include/Pack/RPSystem/RPSysSceneMgr.h +++ b/include/Pack/RPSystem/RPSysSceneMgr.h @@ -13,200 +13,231 @@ //! @{ /** - * @brief Scene manager + * @brief Pack Project scene manager */ class RPSysSceneMgr : public EGG::SceneManager { RP_SINGLETON_DECL_EX(RPSysSceneMgr); public: + /** + * @brief Updates the state of the current scene + */ + virtual void calcCurrentScene() override; // at 0x10 + + /** + * @brief Gets the currently active scene as the Pack Project type + */ + RPSysScene* getCurrentSceneRP() const; + /** * @brief Performs a soft reset * - * @param skipFade Whether to skip the fade to black (for HBM) + * @param fromHBM Whether the request came from HBM * @return Success */ - bool softReset(bool skipFade); + bool softReset(bool fromHBM); + /** - * @brief Returns to the system menu + * @brief Returns to the IPL * - * @param setBlack Whether to call VISetBlack before exiting + * @param fromHBM Whether the request came from HBM * @return Success */ - bool returnToMenu(bool setBlack); + bool returnToMenu(bool fromHBM); + /** - * @brief Shuts down the console + * @brief Powers off the console * - * @param setBlack Whether to call VISetBlack before exiting + * @param fromHBM Whether the request came from HBM * @return Success */ - bool shutdownSystem(bool setBlack); + bool shutdownSystem(bool fromHBM); /** - * @brief Tests whether the manager is operating normally + * @brief Tests whether this manager is operating normally */ bool isNormalState() const; + /** - * @brief Tests whether the manager is currently shutting down the system + * @brief Tests whether this manager is currently shutting down the system */ bool isShutDownReserved() const; + /** + * @brief Tests whether this manager is currently returning to the IPL + */ + bool getReturnToMenu() const; + /** * @brief Disables the guard state and returns to normal operation */ void resetGuard(); /** - * @brief Tests whether the manager is currently returning to the menu or - * shutting down the system + * @brief Tests whether this manager is currently exiting the program */ bool isApplicationEndReserved(); + /** - * @brief Tests whether the application should end in its current state due - * to a DVD error - * @details Any state other than normal operation will result in the - * application ending. + * @brief Tests whether a DVD error should exit the program */ bool isDvdErrorApplicationEnd(); /** - * @brief Fades out the display and changes to the specified scene - * @remark Supply -1 as the scene ID to use the current scene ID. - * @note If you are changing to the current scene ID again, set @p - * forceChange so the scene is completely teared down. + * @brief Requests a scene change after fading out + * @details A scene id of -1 will select the current scene. * - * @param id Scene ID - * @param forceChange Force a full scene change when a re-init would - * otherwise happen + * @param id New scene ID + * @param reconfigure Whether to fully reconfigure the scene * @return Success */ - bool changeNextSceneAfterFade(s32 id, bool forceChange); + bool changeNextSceneAfterFade(s32 id, bool reconfigure = false); /** - * @name Faders - * @note The scene manager owns two faders: the "manager" fader (inherited - * from @ref EGG::SceneManager) and the "scene" fader (@ref mpSceneFader). - * The manager fader is used for fading between scene transitions, while the - * scene fader can be controlled at any time by the current scene. - */ - /**@{*/ - /** - * @brief Resets the fade duration of both the scene and manager faders - * @remark The default duration is 20 frames. + * @brief Resets the duration of all faders */ void resetFadeFrame(); + /** - * @brief Gets the fade duration of the scene fader + * @brief Gets the duration of the scene fader */ - u16 getSceneFadeFrame(); + u16 getFadeFrame(); + /** - * @brief Sets the duration of both the scene and manager faders - * @note The fade duration cannot be zero. + * @brief Sets the duration of all faders * * @param frame Fade duration, in frames */ void setFadeFrame(u16 frame); /** - * @brief Resets the fade color of both the scene and manager faders - * @remark The default color is white with full opacity. + * @brief Resets the color of all faders + * @details The default fader color is black. */ void resetFadeColor(); /** - * @brief Gets the fade color of the manager fader + * @brief Gets the color of the manager fader */ - nw4r::ut::Color getMgrFadeColor(); + nw4r::ut::Color getFadeColor(); /** - * @brief Sets the fade color of both faders + * @brief Sets the color of all faders * * @param color Fade color */ void setFadeColor(nw4r::ut::Color color); /** - * @brief Sets the fade color of the scene fader + * @brief Sets the color of the scene fader * * @param color Fade color */ void setSceneFadeColor(nw4r::ut::Color color); /** - * @brief Gets the fade status of the scene fader + * @brief Gets the status of the scene fader */ EGG::Fader::EStatus getSceneStatus(); + /** - * @brief Sets the fade status of the scene fader + * @brief Sets the status of the scene fader * * @param status Fade status */ void setSceneStatus(EGG::Fader::EStatus status); /** - * @brief Begins to fade in the manager fader + * @brief Begins fading in the manager fader + * + * @return Success */ - void startMgrFadeIn(); + bool startMgrFadeIn(); /** - * @brief Begins to fade in the scene fader + * @brief Begins fading in the scene fader + * + * @return Success */ - void startSceneFadeIn(); + bool startSceneFadeIn(); + /** - * @brief Begins to fade out the scene fader + * @brief Begins fading out the scene fader + * + * @return Success */ - void startSceneFadeOut(); + bool startSceneFadeOut(); /** - * @brief Tests whether the scene is currently fully visible + * @brief Tests whether the scene is fully visible */ bool isDisplay(); + /** - * @brief Tests whether the scene is currently not visible + * @brief Tests whether the scene is visibly obscured */ bool isBlank(); + /** - * @brief Tests whether the scene is currently fading out + * @brief Tests whether the scene is fading out */ bool isFadeOut(); - /**@}*/ /** - * @brief Tests whether all asynchronous tasks have been completed - * @details The system threads (DVD, NAND, WiiConnect24) must all be idle, - * and the system must not currently be writing save data to the NAND. + * @brief Tests whether all asynchronous tasks have finished */ bool isTaskFinished(); + /** - * @brief Tests whether the scene is currently permitted to change - * @details The scene can only change once all tasks have finished and the - * manager fader is prepared to fade out. + * @brief Tests whether a scene change would be allowed */ bool isSceneChangeEnable(); /** - * @name Faders - */ - /**@{*/ - /** - * @brief Updates the scene fader's state + * @brief Updates the state of the scene fader + * + * @return Whether the fade has finished */ - void calcSceneFader(); + bool calcSceneFader(); + /** - * @brief Renders the scene fader's state + * @brief Displays the state of the scene fader */ void drawSceneFader(); + /** - * @brief Renders the manager fader's state + * @brief Displays the state of the manager fader */ void drawMgrFader(); - /**@}*/ /** - * @brief Updates the scene manager's state + * @brief Updates the state of this manager */ void updateState(); - RPSysScene* getCurrentSceneRP() const; +private: + /** + * @brief Scene manager state + */ + enum EState { + EState_Normal, //!< Normal operation + EState_Guard, //!< Prevents operations during soft reset + EState_SoftReset, //!< Perform soft reset + EState_ReturnToMenu, //!< Return to system menu + EState_Shutdown //!< Shutdown the system + }; + + //! The default fade duration, in frames + static const int DEFAULT_FADE_FRAME = 20; + + //! The default fade color + static const u32 DEFAULT_FADE_COLOR = nw4r::ut::Color::BLACK; + +private: + //! Manager state + EState mState; // at 0x30 + //! Fader usable by the current scene + EGG::ColorFader* mpSceneFader; // at 0x34 }; //! @} diff --git a/include/Pack/RPUtility.h b/include/Pack/RPUtility.h index 2044045db..bdd2d9fb6 100644 --- a/include/Pack/RPUtility.h +++ b/include/Pack/RPUtility.h @@ -1,6 +1,7 @@ #ifndef RP_PUBLIC_UTILITY_H #define RP_PUBLIC_UTILITY_H +#include #include #endif diff --git a/include/Pack/RPUtility/RPUtlLoadSaveDataScene.h b/include/Pack/RPUtility/RPUtlLoadSaveDataScene.h new file mode 100644 index 000000000..10e1032b1 --- /dev/null +++ b/include/Pack/RPUtility/RPUtlLoadSaveDataScene.h @@ -0,0 +1,14 @@ +#ifndef RP_UTILITY_LOAD_SAVE_DATA_SCENE_H +#define RP_UTILITY_LOAD_SAVE_DATA_SCENE_H +#include + +#include + +/** + * @brief Base class for scenes which need to load the save file + */ +class RPUtlLoadSaveDataScene : public RPSysScene { +public: +}; + +#endif diff --git a/include/egg/core/eggColorFader.h b/include/egg/core/eggColorFader.h index 2cb917d5d..fc30d8eee 100644 --- a/include/egg/core/eggColorFader.h +++ b/include/egg/core/eggColorFader.h @@ -28,7 +28,14 @@ class ColorFader : public Fader { virtual bool calc(); // at 0x18 virtual void draw(); // at 0x1C + u16 getFrame() const { + return mFadeFrame; + } void setFrame(u16 frame); + + nw4r::ut::Color getColor() const { + return mColor; + } void setColor(nw4r::ut::Color color); private: diff --git a/include/egg/core/eggSceneManager.h b/include/egg/core/eggSceneManager.h index 888c372e8..4ff05835d 100644 --- a/include/egg/core/eggSceneManager.h +++ b/include/egg/core/eggSceneManager.h @@ -5,7 +5,7 @@ namespace EGG { // Forward declarations -class Fader; +class ColorFader; class Heap; class SceneCreator; @@ -106,7 +106,7 @@ class SceneManager { mAfterFadeType = AFTER_FADE_TYPE_NONE; } -private: +protected: SceneCreator* mSceneCreator; // at 0x4 char UNK_0x8[0xC - 0x8]; // at 0x8 Scene* mCurrentScene; // at 0xC @@ -115,7 +115,7 @@ class SceneManager { s32 mCurrentSceneID; // at 0x18 s32 mPreviousSceneID; // at 0x1C eAfterFadeType mAfterFadeType; // at 0x20 - Fader* mCurrentFader; // at 0x24 + ColorFader* mCurrentFader; // at 0x24 eRootHeapType mRootHeapType; // at 0x28 static u16 sHeapOptionFlg; diff --git a/include/egg/core/eggTaskThread.h b/include/egg/core/eggTaskThread.h index d64c8e7d0..2134dc5fa 100644 --- a/include/egg/core/eggTaskThread.h +++ b/include/egg/core/eggTaskThread.h @@ -54,9 +54,13 @@ class TaskThread : public Thread { return mCurrentJob != NULL; } + OSMessageQueue* getEndMessageQueue() const { + return mEndMesgQueue; + } void setEndMessageQueue(OSMessageQueue* pQueue) { mEndMesgQueue = pQueue; } + OSMessage waitTaskEndMessage(BOOL* pSuccess) { OSMessage msg; *pSuccess = OSReceiveMessage(mEndMesgQueue, &msg, 0); diff --git a/src/Pack/RPSystem/RPSysLoadScene.cpp b/src/Pack/RPSystem/RPSysLoadScene.cpp new file mode 100644 index 000000000..a17ae8d87 --- /dev/null +++ b/src/Pack/RPSystem/RPSysLoadScene.cpp @@ -0,0 +1,125 @@ +#include + +#include + +#include + +/** + * @brief Displays the game's build date timestamp + * + * @param color Text color + */ +void RPSysScene::drawTimeStamp(nw4r::ut::Color color) { + enum { + YEAR_SZ = sizeof("yyyy") - 1, + MONTH_SZ = sizeof("mm") - 1, + DAY_SZ = sizeof("dd") - 1, + TIME_SZ = sizeof("hh:mm") - 1, + }; + + RP_GET_INSTANCE(RPSysTextWriter)->Begin(); + { + RP_GET_INSTANCE(RPSysTextWriter)->SetDrawFlag(0); + RP_GET_INSTANCE(RPSysTextWriter)->SetScale(0.65f, 0.65f); + RP_GET_INSTANCE(RPSysTextWriter)->SetTextColor(color); + + const char* pTimeStamp = + RP_GET_INSTANCE(RPSysSystem)->getTimeStampString(); + + char year[8]; + std::strncpy( // + year, // + pTimeStamp, // + YEAR_SZ); + + char month[8]; + std::strncpy( // + month, // + pTimeStamp + YEAR_SZ + sizeof('/'), // + MONTH_SZ); + + char day[8]; + std::strncpy( // + day, // + pTimeStamp + YEAR_SZ + sizeof('/') + MONTH_SZ + sizeof('/'), // + DAY_SZ); + + char time[8]; + std::strncpy( // + time, // + pTimeStamp + YEAR_SZ + sizeof('/') + MONTH_SZ + sizeof('/') + + DAY_SZ + sizeof(" \r\n") - 1, + TIME_SZ); + + year[YEAR_SZ] = 0; + month[MONTH_SZ] = 0; + day[DAY_SZ] = 0; + time[TIME_SZ] = 0; + + RP_GET_INSTANCE(RPSysTextWriter) + ->PrintfZeroCenter(-0.95f, -0.90f, "%s %s %s %s", // + month, day, year, time); + } + RP_GET_INSTANCE(RPSysTextWriter)->End(); +} + +void RPSysScene::loadUpdate() {} + +void RPSysScene::setTaskAsync() { + mFlags.setBit(EFlag_1); + mFlags.setBit(EFlag_2); +} + +bool RPSysScene::isTaskAsyncFinish() const { + return mFlags.onBit(EFlag_1) && !mFlags.onBit(EFlag_2); +} + +/** + * @brief Enables the "Now Loading" message display + */ +void RPSysScene::enableLoadMessage() { + mFlags.setBit(EFlag_LoadMessage); +} + +/** + * @brief Loads this scene's resources asynchronously + */ +void RPSysScene::load() { + // Need to use loadMessage() + if (mFlags.onBit(EFlag_LoadMessage)) { + return; + } + + BOOL success = FALSE; + OSMessage msg; + + RP_GET_INSTANCE(RPSysSystem) + ->getDvdThread() + ->request(loadResourceFunc, // + this, // + RP_GET_INSTANCE(RPSysSystem)->getDvdEndMessage()); + + do { + do { + RP_GET_INSTANCE(RPSysSystem)->loadFrameWork(true); + + EGG::TaskThread* pDvdThread = + RP_GET_INSTANCE(RPSysSystem)->getDvdThread(); + + msg = pDvdThread->waitQueueMessage( // + pDvdThread->getEndMessageQueue(), &success); + + } while (!success); + } while (msg != RP_GET_INSTANCE(RPSysSystem)->getDvdEndMessage()); +} + +/** + * @brief Loads this scene's resources asynchronously, displaying a "Now + * Loading" message if the feature is enabled + */ +void RPSysScene::loadMessage() { + // Need to use load() + if (mFlags.offBit(EFlag_LoadMessage)) { + return; + } +} diff --git a/src/Pack/RPSystem/RPSysResourceManager.cpp b/src/Pack/RPSystem/RPSysResourceManager.cpp index 66819b29d..ce7069a4b 100644 --- a/src/Pack/RPSystem/RPSysResourceManager.cpp +++ b/src/Pack/RPSystem/RPSysResourceManager.cpp @@ -1,6 +1,6 @@ #include -#include -#include +#include +#include #include #include @@ -14,7 +14,7 @@ RP_SINGLETON_IMPL(RPSysResourceManager); */ const RPSysSceneCreator::ESceneID RPSysResourceManager::CACHED_SCENES[] = { RPSysSceneCreator::ESceneID_RPSysPlayerSelectScene, - RPSysSceneCreator::ESceneID_RPSysNunchukScene, + RPSysSceneCreator::ESceneID_RPSysNunchukCheckScene, #if defined(PACK_SPORTS) RPSysSceneCreator::ESceneID_RPBsbScene, @@ -22,13 +22,13 @@ const RPSysSceneCreator::ESceneID RPSysResourceManager::CACHED_SCENES[] = { RPSysSceneCreator::ESceneID_RPGolScene, RPSysSceneCreator::ESceneID_RPTnsScene, RPSysSceneCreator::ESceneID_RPBoxScene, - RPSysSceneCreator::ESceneID_RPSportsTitleScene, - RPSysSceneCreator::ESceneID_RPSportsMenuScene, + RPSysSceneCreator::ESceneID_RPSportsPackTitleScene, + RPSysSceneCreator::ESceneID_RPSportsMainScene, RPSysSceneCreator::ESceneID_RPSportsTrainingMenuScene, RPSysSceneCreator::ESceneID_RPSportsPhysicalMenuScene, RPSysSceneCreator::ESceneID_RPSportsPhysicalPreviewScene, RPSysSceneCreator::ESceneID_RPSportsPhysicalResultScene, - RPSysSceneCreator::ESceneID_RPGolSelectScene, + RPSysSceneCreator::ESceneID_RPGolCourseSelectScene, #elif defined(PACK_PARTY) RPSysSceneCreator::ESceneID_RPFshScene, RPSysSceneCreator::ESceneID_RPHkyScene, @@ -39,9 +39,9 @@ const RPSysSceneCreator::ESceneID RPSysResourceManager::CACHED_SCENES[] = { RPSysSceneCreator::ESceneID_RPWlyScene, RPSysSceneCreator::ESceneID_RPTnkScene, RPSysSceneCreator::ESceneID_RPBomScene, - RPSysSceneCreator::ESceneID_RPPartyTitleScene, - RPSysSceneCreator::ESceneID_RPPartyMiiLoadScene, - RPSysSceneCreator::ESceneID_RPPartyMenuScene, + RPSysSceneCreator::ESceneID_RPPartyPackTitleScene, + RPSysSceneCreator::ESceneID_RPPartyRootScene, + RPSysSceneCreator::ESceneID_RPPartyMainScene, #endif }; diff --git a/src/Pack/RPSystem/RPSysSaveDataMgr.cpp b/src/Pack/RPSystem/RPSysSaveDataMgr.cpp index 1a0f6f2b2..d48c04c9a 100644 --- a/src/Pack/RPSystem/RPSysSaveDataMgr.cpp +++ b/src/Pack/RPSystem/RPSysSaveDataMgr.cpp @@ -810,10 +810,8 @@ void RPSysSaveDataMgr::loadSync() { // No early return? } - { - EGG::RamStream strm(mpSaveFile, mSaveFileSize); - mpSaveData->read(strm, mpSaveFile); - } + EGG::RamStream strm(mpSaveFile, mSaveFileSize); + mpSaveData->read(strm, mpSaveFile); } } diff --git a/src/Pack/RPSystem/RPSysScene.cpp b/src/Pack/RPSystem/RPSysScene.cpp index 0c8ca723b..c915c0221 100644 --- a/src/Pack/RPSystem/RPSysScene.cpp +++ b/src/Pack/RPSystem/RPSysScene.cpp @@ -1,7 +1,10 @@ +#include #include #include #include +#include + #include RPSysScene::UnkStruct RPSysScene::sUnkStruct; @@ -36,9 +39,9 @@ bool RPSysScene::isNandAccessEnable() const { } /** - * @brief Sets the current frame of both faders + * @brief Sets the duration of all faders * - * @param frame Frame count + * @param frame Fade duration, in frames */ void RPSysScene::setFadeFrame(u16 frame) { RP_GET_INSTANCE(RPSysSceneMgr)->setFadeFrame(frame); @@ -48,16 +51,16 @@ void RPSysScene::setFadeFrame(u16 frame) { * @brief Gets the color of the manager fader */ nw4r::ut::Color RPSysScene::getFadeColor() const { - return RP_GET_INSTANCE(RPSysSceneMgr)->getMgrFadeColor(); + return RP_GET_INSTANCE(RPSysSceneMgr)->getFadeColor(); } /** - * @brief Sets the color of both faders + * @brief Sets the color of all faders * * @param color Fade color */ void RPSysScene::setFadeColor(nw4r::ut::Color color) { - RP_GET_INSTANCE(RPSysSceneMgr)->setSceneFadeColor(color); + RP_GET_INSTANCE(RPSysSceneMgr)->setFadeColor(color); } /** @@ -71,16 +74,20 @@ void RPSysScene::setSceneFadeColor(nw4r::ut::Color color) { /** * @brief Begins fading in the scene fader + * + * @return Success */ -void RPSysScene::startFadeIn() { - RP_GET_INSTANCE(RPSysSceneMgr)->startSceneFadeIn(); +bool RPSysScene::startFadeIn() { + return RP_GET_INSTANCE(RPSysSceneMgr)->startSceneFadeIn(); } /** * @brief Begins fading out the scene fader + * + * @return Success */ -void RPSysScene::startFadeOut() { - RP_GET_INSTANCE(RPSysSceneMgr)->startSceneFadeOut(); +bool RPSysScene::startFadeOut() { + return RP_GET_INSTANCE(RPSysSceneMgr)->startSceneFadeOut(); } /** @@ -103,13 +110,59 @@ RPSysScene::RPSysScene() mpSceneHeap(NULL), mCreatorSceneID(-1) {} +/** + * @brief Prepares this scene to be entered + */ +void RPSysScene::incomingScene() { + RPSysCoreController::initScene(); + + RP_GET_INSTANCE(RPSysTextWriter)->Reset(); + + if (!mFlags.onBit(EFlag_IsChild)) { + initTaskAsync(); + } + + mpRenderer->BecomeCurrent(); + mpCommonObject->init(); + + RP_GET_INSTANCE(RPSysSceneMgr)->resetFadeColor(); + RP_GET_INSTANCE(RPSysSceneMgr)->resetFadeFrame(); + RP_GET_INSTANCE(RPSysSceneMgr) + ->setSceneStatus(EGG::Fader::STATUS_PREPARE_OUT); + + RP_GET_INSTANCE(RPSysSceneMgr)->resetGuard(); + setDimming(true); + + RP_GET_INSTANCE(RPSysEffectMgr) + ->setCreator(mpEffectCreator, RPSysEffectMgr::EEffectScene_Scene); + + Reset(); + + if (!mFlags.onBit(EFlag_IsChild)) { + RP_GET_INSTANCE(RPSysSceneMgr)->startMgrFadeIn(); + } +} + /** * @brief Enters the scene */ void RPSysScene::enter() { - ; + init(); + Configure(); + + if (!mFlags.onBit(EFlag_IsChild)) { + RP_GET_INSTANCE(RPSysSceneMgr)->drawMgrFader(); + + load(); + loadMessage(); + } + + incomingScene(); } +/** + * @brief Prepares this scene to be exited + */ void RPSysScene::outgoingScene() { RPSysCoreController::stopMotorAll(); @@ -121,21 +174,45 @@ void RPSysScene::outgoingScene() { * @brief Re-initializes the scene */ void RPSysScene::reinit() { - ; + outgoingScene(); + incomingScene(); } /** * @brief Prepares for destruction of (and transition from) a child scene */ void RPSysScene::incoming_childDestroy() { - ; + incomingScene(); } /** * @brief Updates the scene state */ void RPSysScene::calc() { - ; + if (!RP_GET_INSTANCE(RPSysDvdStatus)->isErrorOccured()) { + mpCommonObject->preUpdate(); + + loadUpdate(); + + if (RP_GET_INSTANCE(RPSysSceneMgr)->isNormalState() && + !RP_GET_INSTANCE(RPSysHomeMenuMgr)->isOpen() && + !RP_GET_INSTANCE(RPSysPauseMgr)->isPause()) { + + mpRenderer->PreCalculate(); + Calculate(); + mpRenderer->PostCalculate(); + } else { + mpRenderer->CalculateInPause(); + } + + RP_GET_INSTANCE(RP_DEBUG_STUB_0)->Calculate(); + RP_GET_INSTANCE(RPSysHostIOSocketManager)->Update(); + + mpCommonObject->postUpdate(); + } + + updateDvdEndMessage(); + updateNandEndMessage(); } /** @@ -161,6 +238,9 @@ void RPSysScene::outgoing_childCreate() { outgoingScene(); } +/** + * @brief Finalizes this scene after being exited + */ void RPSysScene::exitScenePost() { GXDrawDone(); mpRenderer->Destruct(); @@ -179,14 +259,65 @@ void RPSysScene::exit() { exitScenePost(); } +/** + * @brief Initializes this scene's members + */ void RPSysScene::init() { - ; + EGG::Allocator* pAllocator = new EGG::Allocator(getHeap()); + mpRenderer = RPGrpRenderer::Construct(pAllocator, getSceneID()); + + mpRenderer->BecomeCurrent(); + + // TODO(kiwi) Is there a version of this function that uses a reference? + IRPGrpDrawObject& rDrawObject = static_cast(*this); + RPGrpRenderer::GetCurrent()->AppendDrawObject(&rDrawObject); + + mpCommonObject = new RPSysCommonObject(); + + mpEffectCreator = + new RPSysEffectCreator(RPSysEffectMgr::EEffectScene_Scene); + + RP_GET_INSTANCE(RPSysKokeshiManager)->Reset(); + + RPSysSceneCreator::EAudioType audioType = + RP_GET_INSTANCE(RPSysSceneCreator)->getAudioType(getSceneID()); + + if (audioType == RPSysSceneCreator::EAudioType_Common) { + RP_GET_INSTANCE(RPSndAudioMgr)->configureTitle(); + } + + RPSysSceneCreator::EExitType exitType = + RP_GET_INSTANCE(RPSysSceneCreator)->getExitType(getSceneID()); + + if (exitType == RPSysSceneCreator::EExitType_Standard) { + RP_GET_INSTANCE(RPSysPlayerMgr)->loadAllData(); + + } else if (exitType == RPSysSceneCreator::EExitType_Sibling || + exitType == RPSysSceneCreator::EExitType_2) { + + RP_GET_INSTANCE(RPSysPlayerMgr)->reset(); + } } +/** + * @brief Sets this scene's parent/creator ID + * + * @param id ID of this scene's parent/creator + */ void RPSysScene::setCreatorSceneID(s32 id) { mCreatorSceneID = id; } +/** + * @brief Gets this scene's parent/creator ID + */ s32 RPSysScene::getCreatorSceneID() const { return mCreatorSceneID; } + +/** + * @brief Marks this scene as a child of the previous scene + */ +void RPSysScene::setChildScene() { + mFlags.setBit(EFlag_IsChild); +} diff --git a/src/Pack/RPSystem/RPSysSceneCreator.cpp b/src/Pack/RPSystem/RPSysSceneCreator.cpp new file mode 100644 index 000000000..9f9585a94 --- /dev/null +++ b/src/Pack/RPSystem/RPSysSceneCreator.cpp @@ -0,0 +1,564 @@ +#include +#include + +#if defined(PACK_SPORTS) +#include +#include +#include +#include +#include +#include +#elif defined(PACK_PARTY) +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#endif + +RP_SINGLETON_IMPL_EX(RPSysSceneCreator); + +#if defined(PACK_SPORTS) +#define RP_COMMON_DIR "RPCommon/" +#elif defined(PACK_PARTY) +#define RP_COMMON_DIR "RPPartyCommon/" +#endif + +/** + * @brief Information about every Pack Project scene + */ +const RPSysSceneCreator::SceneAttr RPSysSceneCreator::SCENE_ATTR_TABLE[] = { + // clang-format off + {ESceneID_RPSysBootScene, EPackID_AllPack, ECreateType_Standard, ELoadType_Blank, EExitType_Sibling, EAudioType_Common, RP_COMMON_DIR, /* Logo */ "ロゴ"}, + {ESceneID_RPSysPlayerSelectScene, EPackID_AllPack, ECreateType_Standard, ELoadType_Blank, EExitType_2, EAudioType_Common, RP_COMMON_DIR, /* Player Select */ "プレイヤーセレクト"}, + {ESceneID_RPSysNunchukCheckScene, EPackID_AllPack, ECreateType_Sibling, ELoadType_Blank, EExitType_3, EAudioType_Scene, RP_COMMON_DIR, /* Nunchuk Check */ "ヌンチャクチェック"}, + +#if defined(PACK_SPORTS) + {ESceneID_RPBsbScene, EPackID_SportsPack, ECreateType_Sibling, ELoadType_Blank, EExitType_Standard, EAudioType_Scene, "RPBsbScene/", /* Baseball */ "野球"}, + {ESceneID_RPBowScene, EPackID_SportsPack, ECreateType_Sibling, ELoadType_Blank, EExitType_Standard, EAudioType_Scene, "RPBowScene/", /* Bowling */ "ボウリング"}, + {ESceneID_RPGolScene, EPackID_SportsPack, ECreateType_Sibling, ELoadType_Blank, EExitType_Standard, EAudioType_Scene, "RPGolScene/", /* Golf */ "ゴルフ"}, + {ESceneID_RPTnsScene, EPackID_SportsPack, ECreateType_Sibling, ELoadType_Blank, EExitType_Standard, EAudioType_Scene, "RPTnsScene/", /* Tennis */ "テニス"}, + {ESceneID_RPBoxScene, EPackID_SportsPack, ECreateType_Sibling, ELoadType_Blank, EExitType_Standard, EAudioType_Scene, "RPBoxScene/", /* Boxing */ "ボクシング"}, + {ESceneID_RPSportsPackTitleScene, EPackID_SportsPack, ECreateType_Standard, ELoadType_Blank, EExitType_Sibling, EAudioType_Common, "RPSportsTitle/", /* Sports Pack */ "スポーツパック"}, + {ESceneID_RPSportsMainScene, EPackID_SportsPack, ECreateType_Standard, ELoadType_Blank, EExitType_2, EAudioType_Common, "RPSportsCommon/", /* Sports Menu Select */ "スポーツメニューセレクト"}, + {ESceneID_RPSportsTrainingMenuScene, EPackID_SportsPack, ECreateType_Sibling, ELoadType_Blank, EExitType_3, EAudioType_Common, "RPSportsTrainingMenu/", /* Training Menu */ "トレーニングメニュー"}, + {ESceneID_RPSportsPhysicalMenuScene, EPackID_SportsPack, ECreateType_Sibling, ELoadType_Blank, EExitType_3, EAudioType_Common, "RPSportsPhysical/", /* Physical Measure Menu */ "体力測定メニュー"}, + {ESceneID_RPSportsPhysicalPreviewScene, EPackID_SportsPack, ECreateType_Sibling, ELoadType_Blank, EExitType_3, EAudioType_Common, "RPSportsPhysical/", /* Physical Measure Explanation */ "体力測定説明"}, + {ESceneID_RPSportsPhysicalResultScene, EPackID_SportsPack, ECreateType_Sibling, ELoadType_Blank, EExitType_3, EAudioType_Common, "RPSportsPhysical/", /* Physical Measure Results */ "体力測定結果"}, + {ESceneID_RPGolCourseSelectScene, EPackID_SportsPack, ECreateType_Sibling, ELoadType_Blank, EExitType_Standard, EAudioType_Scene, "RPGolScene/", /* Golf Course Select */ "ゴルフコースセレクト"}, +#endif + +#if defined(PACK_PARTY) + {ESceneID_RPFshScene, EPackID_PartyPack, ECreateType_Sibling, ELoadType_Blank, EExitType_Standard, EAudioType_Scene, "RPFshScene/", /* Fishing */ "釣り"}, + {ESceneID_RPHkyScene, EPackID_PartyPack, ECreateType_Sibling, ELoadType_Blank, EExitType_Standard, EAudioType_Scene, "RPHkyScene/", /* Hockey */ "ホッケー"}, + {ESceneID_RPDucScene, EPackID_PartyPack, ECreateType_Sibling, ELoadType_Blank, EExitType_Standard, EAudioType_Scene, "RPDucScene/", /* Shooting */ "射撃"}, + {ESceneID_RPPnpScene, EPackID_PartyPack, ECreateType_Sibling, ELoadType_Blank, EExitType_Standard, EAudioType_Scene, "RPPnpScene/", /* Table Tennis */ "卓球"}, + {ESceneID_RPBilScene, EPackID_PartyPack, ECreateType_Sibling, ELoadType_Blank, EExitType_Standard, EAudioType_Scene, "RPBilScene/", /* Billiards */ "ビリヤード"}, + {ESceneID_RPCowScene, EPackID_PartyPack, ECreateType_Sibling, ELoadType_Blank, EExitType_Standard, EAudioType_Scene, "RPCowScene/", /* Charge! */ "牛レース"}, + {ESceneID_RPWlyScene, EPackID_PartyPack, ECreateType_Sibling, ELoadType_Blank, EExitType_Standard, EAudioType_Scene, "RPWlyScene/", /* Find Mii */ "ウォーリー "}, + {ESceneID_RPTnkScene, EPackID_PartyPack, ECreateType_Sibling, ELoadType_Blank, EExitType_Standard, EAudioType_Scene, "RPTnkScene/", /* Tanks! */ "タンク"}, + {ESceneID_RPBomScene, EPackID_PartyPack, ECreateType_Sibling, ELoadType_Blank, EExitType_Standard, EAudioType_Scene, "RPBomScene/", /* Pose Mii */ "爆弾"}, + {ESceneID_RPPartyPackTitleScene, EPackID_PartyPack, ECreateType_Standard, ELoadType_Blank, EExitType_Sibling, EAudioType_Common, "RPPartyTitle/", /* Party Pack */ "パーティパック"}, + {ESceneID_RPPartyRootScene, EPackID_PartyPack, ECreateType_Standard, ELoadType_Blank, EExitType_Child, EAudioType_Common, "RPPartyCommon/", /* Tour Menu */ "ツアーメニュー"}, + {ESceneID_RPPartyMainScene, EPackID_PartyPack, ECreateType_Sibling, ELoadType_Blank, EExitType_3, EAudioType_Common, "RPPartyCommon/", /* Tour Menu */ "ツアーメニュー"}, +#endif + // clang-format on +}; + +/** + * @brief Constructor + * + * @param pHeap Heap to use for allocations + */ +RPSysSceneCreator::RPSysSceneCreator(EGG::Heap* pHeap) + : mpParentHeap(pHeap), mPrevSceneID(-1) {} + +/** + * @brief Gets the index of the specified scene's entry in the table + * + * @param id Scene ID + * @return Entry index, or -1 if not found + */ +s32 RPSysSceneCreator::getEntryIndex(ESceneID id) { + for (s32 i = 0; i < LENGTHOF(SCENE_ATTR_TABLE); i++) { + if (SCENE_ATTR_TABLE[i].scene == id) { + return i; + } + } + + return -1; +} + +/** + * @brief Requests a scene change after fading out + * @details A scene id of -1 will select the current scene. + * + * @param id New scene ID + * @param reconfigure Whether to fully reconfigure the scene + * @return Success + */ +bool RPSysSceneCreator::changeSceneAfterFade(s32 id, bool reconfigure) { + bool success = false; + + if (RP_GET_INSTANCE(RPSysSceneMgr)->isTaskFinished()) { + s32 current = RP_GET_INSTANCE(RPSysSceneMgr)->getCurrentSceneID(); + + if (reconfigure) { + id = current; + } + + success = RP_GET_INSTANCE(RPSysSceneMgr) + ->changeNextSceneAfterFade(id, reconfigure); + + if (success && current >= 0) { + // Fade out audio before switching sound archives + if (getAudioType(current) != getAudioType(id)) { + u16 frames = RP_GET_INSTANCE(RPSysSceneMgr)->getFadeFrame(); + RP_GET_INSTANCE(RPSndAudioMgr)->fadeOutAllSound(frames); + } + + if (getExitType(id) != EExitType_Child) { + mPrevSceneID = current; + } + } + } + + return success; +} + +/** + * @brief Changes to the title scene + * + * @return Success + */ +bool RPSysSceneCreator::changeSoftReset() { +#if defined(PACK_SPORTS) + return changeSceneAfterFade(ESceneID_RPSportsPackTitleScene); +#elif defined(PACK_PARTY) + return changeSceneAfterFade(ESceneID_RPPartyPackTitleScene); +#endif +} + +/** + * @brief Creates the specified scene + * + * @param id Scene ID + */ +EGG::Scene* RPSysSceneCreator::create(s32 id) { + RPSysScene* pScene = NULL; + + switch (getPackID(id)) { + case EPackID_SportsPack: { +#if defined(PACK_SPORTS) + pScene = createSportsScene(id); +#else + pScene = NULL; +#endif + break; + } + + case EPackID_PartyPack: { +#if defined(PACK_PARTY) + pScene = createPartyScene(id); +#else + pScene = NULL; +#endif + break; + } + + case EPackID_HealthPack: { +#if defined(PACK_HEALTH) + pScene = createHealthScene(id); +#else + pScene = NULL; +#endif + break; + } + + case EPackID_MusicPack: { +#if defined(PACK_MUSIC) + pScene = createMusicScene(id); +#else + pScene = NULL; +#endif + break; + } + + case EPackID_AllPack: { + switch (id) { + case ESceneID_RPSysBootScene: { + pScene = new RPSysBootScene(); + break; + } + + case ESceneID_RPSysPlayerSelectScene: { + pScene = new RPSysPlayerSelectScene(); + break; + } + + case ESceneID_RPSysNunchukCheckScene: { + pScene = new RPSysNunchukCheckScene(); + break; + } + + default: { + pScene = NULL; + break; + } + } + + break; + } + + default: { + break; + } + } + + if (pScene != NULL) { + if (getLoadType(id) == ELoadType_Message) { + pScene->enableLoadMessage(); + } + + if (getExitType(id) == EExitType_Child) { + pScene->setChildScene(); + } + + pScene->setCreatorSceneID(mPrevSceneID); + } + + return pScene; +} + +/** + * @brief Destroys the specified scene + * + * @param id Scene ID + */ +void RPSysSceneCreator::destroy(s32 /* id */) { + if (RP_GET_INSTANCE(RPSysSceneMgr)->isApplicationEndReserved()) { + RP_GET_INSTANCE(RPSysSystem)->systemShutDown(); + } +} + +/** + * @brief Gets the specified scene's resource directory + * @details A scene id of -1 will select the current scene. + * + * @param id Scene ID + */ +const char* RPSysSceneCreator::getResDirName(s32 id) { + if (id < 0) { + id = RP_GET_INSTANCE(RPSysSceneMgr)->getCurrentSceneID(); + } + + s32 index = getEntryIndex(static_cast(id)); + +// @bug Table index is not validated +#if defined(BUG_FIX) + if (index < 0) { + return RP_COMMON_DIR; + } +#endif + + return SCENE_ATTR_TABLE[index].pResDirName; +} + +/** + * @brief Gets the specified scene's sport ID + * @details A scene id of -1 will select the current scene. + * @note If no sport corresponds to the scene, this function returns -1. + * + * @param id Scene ID + */ +s32 RPSysSceneCreator::getSportID(s32 id) { + if (id < 0) { + id = RP_GET_INSTANCE(RPSysSceneMgr)->getCurrentSceneID(); + } + + switch (id) { + case ESceneID_RPBsbScene: { + return ESportID_Bsb; + } + + case ESceneID_RPTnsScene: { + return ESportID_Tns; + } + + case ESceneID_RPGolScene: { + return ESportID_Gol; + } + + case ESceneID_RPBoxScene: { + return ESportID_Box; + } + + case ESceneID_RPBowScene: { + return ESportID_Bow; + } + + default: { + return -1; + } + } +} + +/** + * @brief Gets the specified sport's scene ID + * @note If no scene corresponds to the sport, this function returns -1. + * + * @param sport Sport ID + */ +s32 RPSysSceneCreator::getSceneID(ESportID sport) { + switch (sport) { + case ESportID_Bsb: { + return ESceneID_RPBsbScene; + } + + case ESportID_Tns: { + return ESceneID_RPTnsScene; + } + + case ESportID_Gol: { + return ESceneID_RPGolScene; + } + + case ESportID_Box: { + return ESceneID_RPBoxScene; + } + + case ESportID_Bow: { + return ESceneID_RPBowScene; + } + + default: { + return -1; + } + } +} + +/** + * @brief Gets the specified scene's pack ID + * + * @param id Scene ID + */ +RPSysSceneCreator::EPackID RPSysSceneCreator::getPackID(s32 id) { + s32 index = getEntryIndex(static_cast(id)); + +// @bug Table index is not validated +#if defined(BUG_FIX) + if (index < 0) { + return EPackID_AllPack; + } +#endif + + return SCENE_ATTR_TABLE[index].pack; +} + +/** + * @brief Gets the specified scene's creation type + * + * @param id Scene ID + */ +RPSysSceneCreator::ECreateType RPSysSceneCreator::getCreateType(s32 id) { + s32 index = getEntryIndex(static_cast(id)); + +// @bug Table index is not validated +#if defined(BUG_FIX) + if (index < 0) { + return ECreateType_Standard; + } +#endif + + return SCENE_ATTR_TABLE[index].createType; +} + +/** + * @brief Gets the specified scene's load type + * + * @param id Scene ID + */ +RPSysSceneCreator::ELoadType RPSysSceneCreator::getLoadType(s32 id) { + s32 index = getEntryIndex(static_cast(id)); + +// @bug Table index is not validated +#if defined(BUG_FIX) + if (index < 0) { + return ELoadType_Blank; + } +#endif + + return SCENE_ATTR_TABLE[index].loadType; +} + +/** + * @brief Gets the specified scene's exit type + * + * @param id Scene ID + */ +RPSysSceneCreator::EExitType RPSysSceneCreator::getExitType(s32 id) { + s32 index = getEntryIndex(static_cast(id)); + +// @bug Table index is not validated +#if defined(BUG_FIX) + if (index < 0) { + return EExitType_Standard; + } +#endif + + return SCENE_ATTR_TABLE[index].exitType; +} + +/** + * @brief Gets the specified scene's audio type + * + * @param id Scene ID + */ +RPSysSceneCreator::EAudioType RPSysSceneCreator::getAudioType(s32 id) { + s32 index = getEntryIndex(static_cast(id)); + +// @bug Table index is not validated +#if defined(BUG_FIX) + if (index < 0) { + return EAudioType_Scene; + } +#endif + + return SCENE_ATTR_TABLE[index].audioType; +} + +#if defined(PACK_SPORTS) +/** + * @brief Creates the specified Sports Pack scene + * + * @param id Scene ID + */ +RPSysScene* RPSysSceneCreator::createSportsScene(s32 id) { + switch (id) { + case ESceneID_RPBsbScene: { + return new RPBsbScene(); + } + + case ESceneID_RPBowScene: { + return new RPBowScene(); + } + + case ESceneID_RPGolScene: { + return new RPGolScene(); + } + + case ESceneID_RPTnsScene: { + return new RPTnsScene(); + } + + case ESceneID_RPBoxScene: { + return new RPBoxScene(); + } + + case ESceneID_RPSportsPackTitleScene: { + return new RPSportsPackTitleScene(); + } + + case ESceneID_RPSportsMainScene: { + return new RPSportsMainScene(); + } + + case ESceneID_RPSportsTrainingMenuScene: { + return new RPSportsTrainingMenuScene(); + } + + case ESceneID_RPSportsPhysicalMenuScene: { + return new RPSportsPhysicalMenuScene(); + } + + case ESceneID_RPSportsPhysicalPreviewScene: { + return new RPSportsPhysicalPreviewScene(); + } + + case ESceneID_RPSportsPhysicalResultScene: { + return new RPSportsPhysicalResultScene(); + } + + case ESceneID_RPGolCourseSelectScene: { + return new RPGolCourseSelectScene(); + } + + default: { + return NULL; + } + } +} +#endif + +#if defined(PACK_PARTY) +/** + * @brief Creates the specified Party Pack scene + * + * @param id Scene ID + */ +RPSysScene* RPSysSceneCreator::createPartyScene(s32 id) { + switch (id) { + case ESceneID_RPFshScene: { + return new RPFshScene(); + } + + case ESceneID_RPHkyScene: { + return new RPHkyScene(); + } + + case ESceneID_RPDucScene: { + return new RPDucScene(); + } + + case ESceneID_RPPnpScene: { + return new RPPnpScene(); + } + + case ESceneID_RPBilScene: { + return new RPBilScene(); + } + + case ESceneID_RPCowScene: { + return new RPCowScene(); + } + + case ESceneID_RPWlyScene: { + return new RPWlyScene(); + } + + case ESceneID_RPTnkScene: { + return new RPTnkScene(); + } + + case ESceneID_RPBomScene: { + return new RPBomScene(); + } + + case ESceneID_RPPartyPackTitleScene: { + return new RPPartyPackTitleScene(); + } + + case ESceneID_RPPartyRootScene: { + return new RPPartyRootScene(); + } + + case ESceneID_RPPartyMainScene: { + return new RPPartyMainScene(); + } + + default: { + return NULL; + } + } +} +#endif + +/** + * @brief Destructor + */ +RPSysSceneCreator::~RPSysSceneCreator() {} diff --git a/src/Pack/RPSystem/RPSysSceneMgr.cpp b/src/Pack/RPSystem/RPSysSceneMgr.cpp new file mode 100644 index 000000000..13e9cb7d4 --- /dev/null +++ b/src/Pack/RPSystem/RPSysSceneMgr.cpp @@ -0,0 +1,501 @@ +#include +#include + +#include + +#include + +RP_SINGLETON_IMPL_EX(RPSysSceneMgr); + +/** + * @brief Constructor + * + * @param pHeap Heap to use for allocations + */ +RPSysSceneMgr::RPSysSceneMgr(EGG::Heap* pHeap) + : mpParentHeap(pHeap), mState(EState_Normal) { + + mpSceneFader = new EGG::ColorFader( // + 0.0f, 0.0f, // + RP_GET_INSTANCE(RPSysSystem)->getFBWidth(), // + RP_GET_INSTANCE(RPSysSystem)->getFBHeight() // + ); +} + +/** + * @brief Gets the currently active scene as the Pack Project type + */ +RPSysScene* RPSysSceneMgr::getCurrentSceneRP() const { + return static_cast(getCurrentScene()); +} + +/** + * @brief Performs a soft reset + * + * @param fromHBM Whether the request came from HBM + * @return Success + */ +bool RPSysSceneMgr::softReset(bool fromHBM) { + if (mState == EState_Normal) { + mState = EState_SoftReset; + + // HBM does its own fadeout + if (fromHBM) { + resetFadeFrame(); + resetFadeColor(); + setSceneStatus(EGG::Fader::STATUS_PREPARE_IN); + } + + return true; + } + + return false; +} + +/** + * @brief Returns to the IPL + * + * @param fromHBM Whether the request came from HBM + * @return Success + */ +bool RPSysSceneMgr::returnToMenu(bool fromHBM) { + if (mState == EState_Normal) { + RP_GET_INSTANCE(RPSysSaveDataMgr)->setSaveDisable(true); + mState = EState_ReturnToMenu; + + // HBM does its own fadeout + if (fromHBM) { + VISetBlack(TRUE); + } + + return true; + } + + return false; +} + +/** + * @brief Powers off the console + * + * @param fromHBM Whether the request came from HBM + * @return Success + */ +bool RPSysSceneMgr::shutdownSystem(bool fromHBM) { + if (mState == EState_Normal) { + RP_GET_INSTANCE(RPSysSaveDataMgr)->setSaveDisable(true); + mState = EState_Shutdown; + + // HBM does its own fadeout + if (fromHBM) { + VISetBlack(TRUE); + } + + return true; + } + + return false; +} + +/** + * @brief Tests whether this manager is operating normally + */ +bool RPSysSceneMgr::isNormalState() const { + return mState == EState_Normal; +} + +/** + * @brief Tests whether this manager is currently shutting down the system + */ +bool RPSysSceneMgr::isShutDownReserved() const { + return mState == EState_Shutdown; +} + +/** + * @brief Tests whether this manager is currently returning to the IPL + */ +bool RPSysSceneMgr::getReturnToMenu() const { + return mState == EState_ReturnToMenu; +} + +/** + * @brief Disables the guard state and returns to normal operation + */ +void RPSysSceneMgr::resetGuard() { + if (mState == EState_Guard) { + mState = EState_Normal; + } +} + +/** + * @brief Tests whether this manager is currently exiting the program + */ +bool RPSysSceneMgr::isApplicationEndReserved() { + return getReturnToMenu() || isShutDownReserved(); +} + +/** + * @brief Tests whether a DVD error should exit the program + */ +bool RPSysSceneMgr::isDvdErrorApplicationEnd() { + return mState != EState_Normal; +} + +/** + * @brief Requests a scene change after fading out + * @details A scene id of -1 will select the current scene. + * + * @param id New scene ID + * @param reconfigure Whether to fully reconfigure the scene + * @return Success + */ +bool RPSysSceneMgr::changeNextSceneAfterFade(s32 id, bool reconfigure) { + //! Scene change method + enum EMethod { + Default, + ChangeSiblingSceneAfterFadeOut, + CreateChildSceneAfterFadeOut, + ReInitCurrentSceneAfterFadeOut, + DestroyToSelectSceneIDAfterFadeOut, + ChangeSceneAfterFadeOut, + ChangeScene, // no fadeout + CreateChildScene, // no fadeout + }; + + EMethod method = Default; + + if (getCurrentSceneRP() != NULL) { + s32 current = getCurrentSceneRP()->getSceneID(); + + // Parent scene's exit type takes priority over the new create type + RPSysSceneCreator::EExitType exitType = + RP_GET_INSTANCE(RPSysSceneCreator)->getExitType(current); + + // Current scene requests that new scenes are children + if (exitType == RPSysSceneCreator::EExitType_Child) { + method = CreateChildScene; + + goto _do_change; + } + + // Current scene is being reloaded + if (current == id) { + // Usual behavior is re-init, which skips the Configure phase. + // The reconfigure parameter forces a full destroy -> create. + if (reconfigure || + exitType == RPSysSceneCreator::EExitType_Sibling) { + method = ChangeSiblingSceneAfterFadeOut; + } else { + method = ReInitCurrentSceneAfterFadeOut; + } + + goto _do_change; + } + + // Orphan scenes can be freely destroyed + if (findParentScene(id) != NULL) { + method = DestroyToSelectSceneIDAfterFadeOut; + + goto _do_change; + } + + // New scene's create type takes the lowest priority + switch (RP_GET_INSTANCE(RPSysSceneCreator)->getCreateType(id)) { + case RPSysSceneCreator::ECreateType_Standard: { + method = ChangeSceneAfterFadeOut; + break; + } + + case RPSysSceneCreator::ECreateType_Sibling: { + method = ChangeSiblingSceneAfterFadeOut; + break; + } + + case RPSysSceneCreator::ECreateType_Child: { + method = CreateChildSceneAfterFadeOut; + break; + } + } + + } else { + // No scene exists yet, nothing else needs to be done + method = ChangeScene; + } + +_do_change: + switch (method) { + case Default: + case ChangeSiblingSceneAfterFadeOut: { + return changeSiblingSceneAfterFadeOut(id); + } + + case CreateChildSceneAfterFadeOut: { + return createChildSceneAfterFadeOut(id, getCurrentSceneRP()); + } + + case CreateChildScene: { + createChildScene(id, getCurrentSceneRP()); + return true; + } + + case ReInitCurrentSceneAfterFadeOut: { + return reinitCurrentSceneAfterFadeOut(); + } + + case DestroyToSelectSceneIDAfterFadeOut: { + return destroyToSelectSceneIDAfterFadeOut(id); + } + + case ChangeSceneAfterFadeOut: { + return changeSceneAfterFadeOut(id); + } + + case ChangeScene: { + changeScene(id); + return true; + } + + default: { + return false; + } + } +} + +/** + * @brief Resets the duration of all faders + */ +void RPSysSceneMgr::resetFadeFrame() { + mpSceneFader->setFrame(DEFAULT_FADE_FRAME); + mCurrentFader->setFrame(DEFAULT_FADE_FRAME); +} + +/** + * @brief Gets the duration of the scene fader + */ +u16 RPSysSceneMgr::getFadeFrame() { + return mpSceneFader->getFrame(); +} + +/** + * @brief Sets the duration of all faders + * + * @param frame Fade duration, in frames + */ +void RPSysSceneMgr::setFadeFrame(u16 frame) { + mpSceneFader->setFrame(frame); + mCurrentFader->setFrame(frame); +} + +/** + * @brief Resets the color of all faders + * @details The default fader color is white. + */ +void RPSysSceneMgr::resetFadeColor() { + mpSceneFader->setColor(DEFAULT_FADE_COLOR); + mCurrentFader->setColor(DEFAULT_FADE_COLOR); +} + +/** + * @brief Gets the color of the manager fader + */ +nw4r::ut::Color RPSysSceneMgr::getFadeColor() { + return mCurrentFader->getColor(); +} + +/** + * @brief Sets the color of all faders + * + * @param color Fade color + */ +void RPSysSceneMgr::setFadeColor(nw4r::ut::Color color) { + mpSceneFader->setColor(color); + mCurrentFader->setColor(color); +} + +/** + * @brief Sets the color of the scene fader + * + * @param color Fade color + */ +void RPSysSceneMgr::setSceneFadeColor(nw4r::ut::Color color) { + mpSceneFader->setColor(color); +} + +/** + * @brief Gets the status of the scene fader + */ +EGG::Fader::EStatus RPSysSceneMgr::getSceneStatus() { + return mpSceneFader->getStatus(); +} + +/** + * @brief Sets the status of the scene fader + * + * @param status Fade status + */ +void RPSysSceneMgr::setSceneStatus(EGG::Fader::EStatus status) { + mpSceneFader->setStatus(status); +} + +/** + * @brief Begins fading in the manager fader + * + * @return Success + */ +bool RPSysSceneMgr::startMgrFadeIn() { + return fadeIn(); +} + +/** + * @brief Begins fading in the scene fader + * + * @return Success + */ +bool RPSysSceneMgr::startSceneFadeIn() { + return mpSceneFader->fadeIn(); +} + +/** + * @brief Begins fading out the scene fader + * + * @return Success + */ +bool RPSysSceneMgr::startSceneFadeOut() { + return mpSceneFader->fadeOut(); +} + +/** + * @brief Tests whether the scene is fully visible + */ +bool RPSysSceneMgr::isDisplay() { + return mCurrentFader->getStatus() == EGG::Fader::STATUS_PREPARE_OUT && + mpSceneFader->getStatus() == EGG::Fader::STATUS_PREPARE_OUT; +} + +/** + * @brief Tests whether the scene is visibly obscured + */ +bool RPSysSceneMgr::isBlank() { + return mCurrentFader->getStatus() == EGG::Fader::STATUS_PREPARE_IN || + mpSceneFader->getStatus() == EGG::Fader::STATUS_PREPARE_IN; +} + +/** + * @brief Tests whether the scene is fading out + */ +bool RPSysSceneMgr::isFadeOut() { + return mCurrentFader->getStatus() == EGG::Fader::STATUS_FADE_OUT || + mpSceneFader->getStatus() == EGG::Fader::STATUS_FADE_OUT; +} + +/** + * @brief Tests whether all asynchronous tasks have finished + */ +bool RPSysSceneMgr::isTaskFinished() { + if (RP_GET_INSTANCE(RPSysSaveDataMgr)->isNandAccessFinish() && + !RP_GET_INSTANCE(RPSysSystem)->getNandThread()->isTaskExist() && + !RP_GET_INSTANCE(RPSysSystem)->getDvdThread()->isTaskExist() && + !RP_GET_INSTANCE(RPSysSystem)->getWc24Thread()->isTaskExist()) { + + return true; + } + + return false; +} + +/** + * @brief Tests whether a scene change would be allowed + */ +bool RPSysSceneMgr::isSceneChangeEnable() { + if (mCurrentFader->getStatus() == EGG::Fader::STATUS_PREPARE_OUT && + RP_GET_INSTANCE(RPSysSaveDataMgr)->isNandAccessFinish() && + !RP_GET_INSTANCE(RPSysSystem)->getNandThread()->isTaskExist() && + !RP_GET_INSTANCE(RPSysSystem)->getDvdThread()->isTaskExist() && + !RP_GET_INSTANCE(RPSysSystem)->getWc24Thread()->isTaskExist()) { + + return true; + } + + return false; +} + +/** + * @brief Updates the state of the scene fader + * + * @return Whether the fade has finished + */ +bool RPSysSceneMgr::calcSceneFader() { + return mpSceneFader->calc(); +} + +/** + * @brief Displays the state of the scene fader + */ +void RPSysSceneMgr::drawSceneFader() { + mpSceneFader->draw(); +} + +/** + * @brief Displays the state of the manager fader + */ +void RPSysSceneMgr::drawMgrFader() { + mCurrentFader->draw(); +} + +/** + * @brief Updates the state of the current scene + */ +void RPSysSceneMgr::calcCurrentScene() { + updateState(); + EGG::SceneManager::calcCurrentScene(); +} + +/** + * @brief Updates the state of this manager + */ +void RPSysSceneMgr::updateState() { + if (mState == EState_Normal) { + RP_GET_INSTANCE(RPSysSystem)->setCallBack(); + return; + } + + if (isSceneChangeEnable()) { + bool success = false; + + if (mState == EState_SoftReset) { + success = RP_GET_INSTANCE(RPSysSceneCreator)->changeSoftReset(); + + } else if (mState == EState_ReturnToMenu || mState == EState_Shutdown) { + // Dummy scene change to allow RPSysSceneCreator::destroy() to exit + success = changeSceneAfterFadeOut( + RPSysSceneCreator::ESceneID_RPSysBootScene); + } + + if (success) { + resetFadeFrame(); + + if (mState == EState_SoftReset) { + if (getCurrentSceneID() != + RPSysSceneCreator::ESceneID_RPSysBootScene) { + + resetFadeColor(); + } + + RP_GET_INSTANCE(RPSndAudioMgr)->resetSystem(DEFAULT_FADE_FRAME); + mState = EState_Guard; + + } else if (mState == EState_ReturnToMenu || + mState == EState_Shutdown) { + + setSceneFadeColor(DEFAULT_FADE_COLOR); + + RP_GET_INSTANCE(RPSndAudioMgr) + ->shutdownSystem(DEFAULT_FADE_FRAME); + } + } + } +} + +/** + * @brief Destructor + */ +RPSysSceneMgr::~RPSysSceneMgr() {} From dc4a0c2aafade7544be0904a31c19b9d2d0d8949 Mon Sep 17 00:00:00 2001 From: kiwi515 <49212064+kiwi515@users.noreply.github.com> Date: Sat, 29 Aug 2026 15:17:08 -0400 Subject: [PATCH 4/7] aa --- .clangd | 1 + config/RSPE01_01/symbols.txt | 106 ++++++------ include/Pack/RPGraphics/RPGrpRenderer.h | 3 + include/Pack/RPSystem/RPSysScene.h | 58 +++++-- src/Pack/RPSystem/RPSysLoadScene.cpp | 216 ++++++++++++++++++++---- src/Pack/RPSystem/RPSysScene.cpp | 5 +- 6 files changed, 289 insertions(+), 100 deletions(-) diff --git a/.clangd b/.clangd index 8d7b85d93..31d8a8001 100644 --- a/.clangd +++ b/.clangd @@ -6,3 +6,4 @@ Diagnostics: - bad_cxx_cast_unrelated_class - init_conversion_failed - member_function_call_bad_type + - ovl_no_viable_member_function_in_call diff --git a/config/RSPE01_01/symbols.txt b/config/RSPE01_01/symbols.txt index dfb70dbd3..497b3621a 100644 --- a/config/RSPE01_01/symbols.txt +++ b/config/RSPE01_01/symbols.txt @@ -6846,10 +6846,10 @@ fn_80183178 = .text:0x80183178; // type:function size:0x40 getTimeStampString__11RPSysSystemFv = .text:0x801831B8; // type:function size:0x8 getDvdEndMessage__11RPSysSystemCFv = .text:0x801831C0; // type:function size:0x8 getNandEndMessage__11RPSysSystemCFv = .text:0x801831C8; // type:function size:0x8 -fn_801831D0 = .text:0x801831D0; // type:function size:0x8 +getWc24Thread__11RPSysSystemFv = .text:0x801831D0; // type:function size:0x8 getDvdThread__11RPSysSystemFv = .text:0x801831D8; // type:function size:0x8 getNandThread__11RPSysSystemFv = .text:0x801831E0; // type:function size:0x8 -fn_801831E8 = .text:0x801831E8; // type:function size:0x8 +setDimming__11RPSysSystemFi = .text:0x801831E8; // type:function size:0x8 systemShutDown__11RPSysSystemFv = .text:0x801831F0; // type:function size:0xD8 fn_801832C8 = .text:0x801832C8; // type:function size:0x28 fn_801832F0 = .text:0x801832F0; // type:function size:0x18 @@ -6858,17 +6858,17 @@ fn_80183314 = .text:0x80183314; // type:function size:0xA0 fn_801833B4 = .text:0x801833B4; // type:function size:0xBC getCalendarTime16__11RPSysSystemFv = .text:0x80183470; // type:function size:0x4C getCalendarTime32__11RPSysSystemFv = .text:0x801834BC; // type:function size:0x5C -fn_80183518 = .text:0x80183518; // type:function size:0x14 +destroyHeap__11RPSysSystemFPQ23EGG4Heap = .text:0x80183518; // type:function size:0x14 getBootScene__11RPSysSystemFv = .text:0x8018352C; // type:function size:0x8 fn_80183534 = .text:0x80183534; // type:function size:0x50 fn_80183584 = .text:0x80183584; // type:function size:0x24 -fn_801835A8 = .text:0x801835A8; // type:function size:0xC -fn_801835B4 = .text:0x801835B4; // type:function size:0xC +getFBHeight__11RPSysSystemCFv = .text:0x801835A8; // type:function size:0xC +getFBWidth__11RPSysSystemCFv = .text:0x801835B4; // type:function size:0xC fn_801835C0 = .text:0x801835C0; // type:function size:0x14 fn_801835D4 = .text:0x801835D4; // type:function size:0x8 setupRenderMode__11RPSysSystemFv = .text:0x801835DC; // type:function size:0x130 setupTVMode__11RPSysSystemFv = .text:0x8018370C; // type:function size:0x6C -fn_80183778 = .text:0x80183778; // type:function size:0x180 +loadFrameWork__11RPSysSystemFb = .text:0x80183778; // type:function size:0x180 mainLoop__11RPSysSystemFv = .text:0x801838F8; // type:function size:0x16C setup__11RPSysSystemFv = .text:0x80183A64; // type:function size:0x13C create__11RPSysSystemFv = .text:0x80183BA0; // type:function size:0x44 @@ -6932,7 +6932,7 @@ taskAsync__10RPSysSceneFv = .text:0x8018559C; // type:function size:0x4 UserDraw__16IRPGrpDrawObjectFv = .text:0x801855A0; // type:function size:0x4 DebugDraw__16IRPGrpDrawObjectFv = .text:0x801855A4; // type:function size:0x4 __sinit_\RPSysScene_cpp = .text:0x801855A8; // type:function size:0xC scope:local -fn_801855B4 = .text:0x801855B4; // type:function size:0x8 +@36@__dt__10RPSysSceneFv = .text:0x801855B4; // type:function size:0x8 adjust__19RPSysRenderModeFPUsPUsii = .text:0x801855BC; // type:function size:0xBC __dt__13RPSysSceneMgrFv = .text:0x80185678; // type:function size:0x58 updateState__13RPSysSceneMgrFv = .text:0x801856D0; // type:function size:0x198 @@ -6989,12 +6989,12 @@ dump__19RPSysPrimTagParmFv = .text:0x801867F8; // type:function size:0x4 write__19RPSysPrimTagParmFRQ23EGG6Stream = .text:0x801867FC; // type:function size:0x10 read__19RPSysPrimTagParmFRQ23EGG6Stream = .text:0x8018680C; // type:function size:0x34 __ct__12RPSysTagParmFP18RPSysTagParametersPc = .text:0x80186840; // type:function size:0x38 -fn_80186878 = .text:0x80186878; // type:function size:0x10 -fn_80186888 = .text:0x80186888; // type:function size:0xD8 -fn_80186960 = .text:0x80186960; // type:function size:0xBC -fn_80186A1C = .text:0x80186A1C; // type:function size:0x8C -fn_80186AA8 = .text:0x80186AA8; // type:function size:0x78 -fn_80186B20 = .text:0x80186B20; // type:function size:0x114 +taskAsyncFunc__10RPSysSceneFPv = .text:0x80186878; // type:function size:0x10 +loadResourceFunc__10RPSysSceneFPv = .text:0x80186888; // type:function size:0xD8 +updateNandEndMessage__10RPSysSceneFv = .text:0x80186960; // type:function size:0xBC +updateDvdEndMessage__10RPSysSceneFv = .text:0x80186A1C; // type:function size:0x8C +initTaskAsync__10RPSysSceneFv = .text:0x80186AA8; // type:function size:0x78 +loadMessage__10RPSysSceneFv = .text:0x80186B20; // type:function size:0x114 load__10RPSysSceneFv = .text:0x80186C34; // type:function size:0xB8 enableLoadMessage__10RPSysSceneFv = .text:0x80186CEC; // type:function size:0x10 isTaskAsyncFinish__10RPSysSceneCFv = .text:0x80186CFC; // type:function size:0x20 @@ -7026,10 +7026,10 @@ fn_80187B54 = .text:0x80187B54; // type:function size:0x40 fn_80187B94 = .text:0x80187B94; // type:function size:0xC fn_80187BA0 = .text:0x80187BA0; // type:function size:0x70 fn_80187C10 = .text:0x80187C10; // type:function size:0x7C -fn_80187C8C = .text:0x80187C8C; // type:function size:0x88 -fn_80187D14 = .text:0x80187D14; // type:function size:0x64 -fn_80187D78 = .text:0x80187D78; // type:function size:0x44 -fn_80187DBC = .text:0x80187DBC; // type:function size:0x128 +postUpdate__17RPSysCommonObjectFv = .text:0x80187C8C; // type:function size:0x88 +preUpdate__17RPSysCommonObjectFv = .text:0x80187D14; // type:function size:0x64 +init__17RPSysCommonObjectFv = .text:0x80187D78; // type:function size:0x44 +__ct__17RPSysCommonObjectFv = .text:0x80187DBC; // type:function size:0x128 __dt__11RPGrpScreenFv = .text:0x80187EE4; // type:function size:0x40 scope:weak fn_80187F24 = .text:0x80187F24; // type:function size:0x40 __dt__14RPSysDvdStatusFv = .text:0x80187F64; // type:function size:0x40 @@ -7313,9 +7313,9 @@ fn_80193278 = .text:0x80193278; // type:function size:0x10 fn_80193288 = .text:0x80193288; // type:function size:0x22C fn_801934B4 = .text:0x801934B4; // type:function size:0xD0 fn_80193584 = .text:0x80193584; // type:function size:0x7C -fn_80193600 = .text:0x80193600; // type:function size:0x9C -fn_8019369C = .text:0x8019369C; // type:function size:0x48 -fn_801936E4 = .text:0x801936E4; // type:function size:0x18 +stopAllEffect__14RPSysEffectMgrFv = .text:0x80193600; // type:function size:0x9C +resetCreator__14RPSysEffectMgrFP18RPSysEffectCreator = .text:0x8019369C; // type:function size:0x48 +setCreator__14RPSysEffectMgrFP18RPSysEffectCreatorUl = .text:0x801936E4; // type:function size:0x18 fn_801936FC = .text:0x801936FC; // type:function size:0x9C fn_80193798 = .text:0x80193798; // type:function size:0x10 fn_801937A8 = .text:0x801937A8; // type:function size:0x10 @@ -7460,7 +7460,7 @@ fn_80198770 = .text:0x80198770; // type:function size:0x4 fn_80198774 = .text:0x80198774; // type:function size:0x4 fn_80198778 = .text:0x80198778; // type:function size:0x8C fn_80198804 = .text:0x80198804; // type:function size:0xD4 -fn_801988D8 = .text:0x801988D8; // type:function size:0x90 +__ct__18RPSysEffectCreatorFUl = .text:0x801988D8; // type:function size:0x90 Initialize__19RPSysWideTextWriterFv = .text:0x80198968; // type:function size:0x28 getFrameMax__14RPSysLytAnmObjFv = .text:0x80198990; // type:function size:0x40 init__14RPSysLytAnmObjFssQ214RPSysFrameCtrl9EPlayMode = .text:0x801989D0; // type:function size:0x7C @@ -7944,22 +7944,22 @@ fn_801AF1D4 = .text:0x801AF1D4; // type:function size:0x4 fn_801AF1D8 = .text:0x801AF1D8; // type:function size:0x230 fn_801AF408 = .text:0x801AF408; // type:function size:0x4 fn_801AF40C = .text:0x801AF40C; // type:function size:0x24 -fn_801AF430 = .text:0x801AF430; // type:function size:0x24 +AppendDrawObject__13RPGrpRendererFP16IRPGrpDrawObject = .text:0x801AF430; // type:function size:0x24 fn_801AF454 = .text:0x801AF454; // type:function size:0x138 fn_801AF58C = .text:0x801AF58C; // type:function size:0x9C fn_801AF628 = .text:0x801AF628; // type:function size:0x98 fn_801AF6C0 = .text:0x801AF6C0; // type:function size:0x54 -fn_801AF714 = .text:0x801AF714; // type:function size:0x58 -fn_801AF76C = .text:0x801AF76C; // type:function size:0x84 -fn_801AF7F0 = .text:0x801AF7F0; // type:function size:0x8 -fn_801AF7F8 = .text:0x801AF7F8; // type:function size:0x4F0 +CalculateInPause__13RPGrpRendererFv = .text:0x801AF714; // type:function size:0x58 +PostCalculate__13RPGrpRendererFv = .text:0x801AF76C; // type:function size:0x84 +PreCalculate__13RPGrpRendererFv = .text:0x801AF7F0; // type:function size:0x8 +Rendering__13RPGrpRendererFv = .text:0x801AF7F8; // type:function size:0x4F0 fn_801AFCE8 = .text:0x801AFCE8; // type:function size:0x60 -fn_801AFD48 = .text:0x801AFD48; // type:function size:0x30 -fn_801AFD78 = .text:0x801AFD78; // type:function size:0x8 -fn_801AFD80 = .text:0x801AFD80; // type:function size:0x160 -fn_801AFEE0 = .text:0x801AFEE0; // type:function size:0xC -fn_801AFEEC = .text:0x801AFEEC; // type:function size:0x80 -fn_801AFF6C = .text:0x801AFF6C; // type:function size:0x98 +BecomeCurrent__13RPGrpRendererFv = .text:0x801AFD48; // type:function size:0x30 +Destruct__13RPGrpRendererFv = .text:0x801AFD78; // type:function size:0x8 +Construct__13RPGrpRendererFPQ23EGG9AllocatorUs = .text:0x801AFD80; // type:function size:0x160 +End__13RPGrpRendererFv = .text:0x801AFEE0; // type:function size:0xC +StartDebugDraw__13RPGrpRendererFv = .text:0x801AFEEC; // type:function size:0x80 +Begin__13RPGrpRendererFv = .text:0x801AFF6C; // type:function size:0x98 fn_801B0004 = .text:0x801B0004; // type:function size:0x48 fn_801B004C = .text:0x801B004C; // type:function size:0x16C fn_801B01B8 = .text:0x801B01B8; // type:function size:0x40 @@ -18773,8 +18773,8 @@ lbl_803C1D68 = .data:0x803C1D68; // type:object size:0x10 lbl_803C1D78 = .data:0x803C1D78; // type:object size:0x180 lbl_803C1EF8 = .data:0x803C1EF8; // type:object size:0x50 lbl_803C1F48 = .data:0x803C1F48; // type:object size:0x30 -lbl_803C1F78 = .data:0x803C1F78; // type:object size:0x60 -lbl_803C1FD8 = .data:0x803C1FD8; // type:object size:0x60 +__vt__14RPSysBootScene = .data:0x803C1F78; // type:object size:0x60 +__vt__22RPSysPlayerSelectScene = .data:0x803C1FD8; // type:object size:0x60 lbl_803C2038 = .data:0x803C2038; // type:object size:0xC lbl_803C2044 = .data:0x803C2044; // type:object size:0x22 data:string lbl_803C2068 = .data:0x803C2068; // type:object size:0x12 data:string @@ -18791,7 +18791,7 @@ jumptable_803C2278 = .data:0x803C2278; // type:object size:0x30 scope:local jumptable_803C22A8 = .data:0x803C22A8; // type:object size:0x30 scope:local jumptable_803C22D8 = .data:0x803C22D8; // type:object size:0x30 scope:local jumptable_803C2308 = .data:0x803C2308; // type:object size:0x30 scope:local -lbl_803C2338 = .data:0x803C2338; // type:object size:0xE0 +__vt__22RPSysNunchukCheckScene = .data:0x803C2338; // type:object size:0xE0 lbl_803C2418 = .data:0x803C2418; // type:object size:0x78 lbl_803C2490 = .data:0x803C2490; // type:object size:0xB8 data:4byte lbl_803C2548 = .data:0x803C2548; // type:object size:0x20 data:4byte @@ -18804,14 +18804,14 @@ lbl_803C2618 = .data:0x803C2618; // type:object size:0x20 lbl_803C2638 = .data:0x803C2638; // type:object size:0x18 lbl_803C2650 = .data:0x803C2650; // type:object size:0x10 lbl_803C2660 = .data:0x803C2660; // type:object size:0x20 -lbl_803C2680 = .data:0x803C2680; // type:object size:0xE8 +__vt__22RPSportsPackTitleScene = .data:0x803C2680; // type:object size:0xE8 jumptable_803C2768 = .data:0x803C2768; // type:object size:0x24 scope:local gap_08_803C278C_data = .data:0x803C278C; // type:object size:0x4 scope:global -lbl_803C2790 = .data:0x803C2790; // type:object size:0x60 -lbl_803C27F0 = .data:0x803C27F0; // type:object size:0x60 -lbl_803C2850 = .data:0x803C2850; // type:object size:0x60 -lbl_803C28B0 = .data:0x803C28B0; // type:object size:0x60 -lbl_803C2910 = .data:0x803C2910; // type:object size:0x80 +__vt__25RPSportsTrainingMenuScene = .data:0x803C2790; // type:object size:0x60 +__vt__25RPSportsPhysicalMenuScene = .data:0x803C27F0; // type:object size:0x60 +__vt__27RPSportsPhysicalResultScene = .data:0x803C2850; // type:object size:0x60 +__vt__28RPSportsPhysicalPreviewScene = .data:0x803C28B0; // type:object size:0x60 +__vt__17RPSportsBaseScene = .data:0x803C2910; // type:object size:0x80 lbl_803C2990 = .data:0x803C2990; // type:object size:0x10 lbl_803C29A0 = .data:0x803C29A0; // type:object size:0x10 lbl_803C29B0 = .data:0x803C29B0; // type:object size:0x24 data:4byte @@ -18834,7 +18834,7 @@ lbl_803C2C68 = .data:0x803C2C68; // type:object size:0x2C lbl_803C2C94 = .data:0x803C2C94; // type:object size:0x5C lbl_803C2CF0 = .data:0x803C2CF0; // type:object size:0x18 lbl_803C2D08 = .data:0x803C2D08; // type:object size:0xC0 -lbl_803C2DC8 = .data:0x803C2DC8; // type:object size:0x60 +__vt__17RPSportsMainScene = .data:0x803C2DC8; // type:object size:0x60 lbl_803C2E28 = .data:0x803C2E28; // type:object size:0x18 lbl_803C2E40 = .data:0x803C2E40; // type:object size:0x18 lbl_803C2E58 = .data:0x803C2E58; // type:object size:0x10 @@ -18881,7 +18881,7 @@ lbl_803C35E8 = .data:0x803C35E8; // type:object size:0x10 data:4byte lbl_803C35F8 = .data:0x803C35F8; // type:object size:0xD0 data:4byte lbl_803C36C8 = .data:0x803C36C8; // type:object size:0x50 lbl_803C3718 = .data:0x803C3718; // type:object size:0x18 -lbl_803C3730 = .data:0x803C3730; // type:object size:0x80 +__vt__10RPTnsScene = .data:0x803C3730; // type:object size:0x80 lbl_803C37B0 = .data:0x803C37B0; // type:object size:0x68 lbl_803C3818 = .data:0x803C3818; // type:object size:0x10 __vt__19RPSndAudioActorBase = .data:0x803C3828; // type:object size:0x28 @@ -19044,7 +19044,7 @@ lbl_803C4F48 = .data:0x803C4F48; // type:object size:0x10 lbl_803C4F58 = .data:0x803C4F58; // type:object size:0x28 lbl_803C4F80 = .data:0x803C4F80; // type:object size:0x48 lbl_803C4FC8 = .data:0x803C4FC8; // type:object size:0x10 -lbl_803C4FD8 = .data:0x803C4FD8; // type:object size:0x80 +__vt__10RPBsbScene = .data:0x803C4FD8; // type:object size:0x80 jumptable_803C5058 = .data:0x803C5058; // type:object size:0x7C scope:local jumptable_803C50D4 = .data:0x803C50D4; // type:object size:0x20 scope:local gap_08_803C50F4_data = .data:0x803C50F4; // type:object size:0xA8 scope:global @@ -19155,7 +19155,7 @@ lbl_803C7658 = .data:0x803C7658; // type:object size:0x50 jumptable_803C76A8 = .data:0x803C76A8; // type:object size:0x20 scope:local lbl_803C76C8 = .data:0x803C76C8; // type:object size:0x28 lbl_803C76F0 = .data:0x803C76F0; // type:object size:0x28 -lbl_803C7718 = .data:0x803C7718; // type:object size:0x80 +__vt__10RPGolScene = .data:0x803C7718; // type:object size:0x80 lbl_803C7798 = .data:0x803C7798; // type:object size:0x10 lbl_803C77A8 = .data:0x803C77A8; // type:object size:0xC lbl_803C77B4 = .data:0x803C77B4; // type:object size:0xC @@ -19214,7 +19214,7 @@ lbl_803C7F38 = .data:0x803C7F38; // type:object size:0xC lbl_803C7F44 = .data:0x803C7F44; // type:object size:0xC lbl_803C7F50 = .data:0x803C7F50; // type:object size:0xC lbl_803C7F5C = .data:0x803C7F5C; // type:object size:0x2C -lbl_803C7F88 = .data:0x803C7F88; // type:object size:0x60 +__vt__22RPGolCourseSelectScene = .data:0x803C7F88; // type:object size:0x60 lbl_803C7FE8 = .data:0x803C7FE8; // type:object size:0x40 lbl_803C8028 = .data:0x803C8028; // type:object size:0x40 lbl_803C8068 = .data:0x803C8068; // type:object size:0x30 @@ -19299,7 +19299,7 @@ lbl_803C8988 = .data:0x803C8988; // type:object size:0xC lbl_803C8994 = .data:0x803C8994; // type:object size:0xC jumptable_803C89A0 = .data:0x803C89A0; // type:object size:0x28 scope:local lbl_803C89C8 = .data:0x803C89C8; // type:object size:0x38 -lbl_803C8A00 = .data:0x803C8A00; // type:object size:0x80 +__vt__10RPBoxScene = .data:0x803C8A00; // type:object size:0x80 jumptable_803C8A80 = .data:0x803C8A80; // type:object size:0x28 scope:local jumptable_803C8AA8 = .data:0x803C8AA8; // type:object size:0x24 scope:local jumptable_803C8ACC = .data:0x803C8ACC; // type:object size:0x28 scope:local @@ -19474,7 +19474,7 @@ lbl_803CA274 = .data:0x803CA274; // type:object size:0x34 lbl_803CA2A8 = .data:0x803CA2A8; // type:object size:0x18 lbl_803CA2C0 = .data:0x803CA2C0; // type:object size:0x10 lbl_803CA2D0 = .data:0x803CA2D0; // type:object size:0x14 -lbl_803CA2E4 = .data:0x803CA2E4; // type:object size:0x94 +__vt__10RPBowScene = .data:0x803CA2E4; // type:object size:0x94 lbl_803CA378 = .data:0x803CA378; // type:object size:0x20 lbl_803CA398 = .data:0x803CA398; // type:object size:0x18 lbl_803CA3B0 = .data:0x803CA3B0; // type:object size:0x14 @@ -21859,7 +21859,7 @@ spInstance__11RPSysSystem = .sbss:0x804BF4B8; // type:object size:0x4 data:4byte lbl_804BF4BC = .sbss:0x804BF4BC; // type:object size:0x4 data:4byte lbl_804BF4C0 = .sbss:0x804BF4C0; // type:object size:0x4 data:4byte sRenderModeFormat__11RPSysSystem = .sbss:0x804BF4C4; // type:object size:0x4 data:4byte -lbl_804BF4C8 = .sbss:0x804BF4C8; // type:object size:0x8 data:4byte +spInstance__17RPSysSceneCreator = .sbss:0x804BF4C8; // type:object size:0x8 data:4byte sUnkStruct__10RPSysScene = .sbss:0x804BF4D0; // type:object size:0x4 data:4byte spInstance__13RPSysSceneMgr = .sbss:0x804BF4D8; // type:object size:0x8 data:4byte spInstance__17RPSysProjectLocal = .sbss:0x804BF4E0; // type:object size:0x4 data:4byte @@ -21869,13 +21869,13 @@ lbl_804BF4F8 = .sbss:0x804BF4F8; // type:object size:0x8 data:4byte spInstance__14RPSysDvdStatus = .sbss:0x804BF500; // type:object size:0x4 data:4byte spInstance__16RPSysSaveDataMgr = .sbss:0x804BF508; // type:object size:0x8 data:4byte spInstance__16RPSysFontManager = .sbss:0x804BF510; // type:object size:0x8 data:4byte -lbl_804BF518 = .sbss:0x804BF518; // type:object size:0x8 data:4byte -lbl_804BF520 = .sbss:0x804BF520; // type:object size:0x8 data:4byte +spInstance__13RPSysPauseMgr = .sbss:0x804BF518; // type:object size:0x8 data:4byte +spInstance__14RPSysPlayerMgr = .sbss:0x804BF520; // type:object size:0x8 data:4byte spInstance__24RPSysHostIOSocketManager = .sbss:0x804BF528; // type:object size:0x4 data:4byte spInstance__15RP_DEBUG_STUB_0 = .sbss:0x804BF530; // type:object size:0x4 data:4byte spInstance__15RPSysTextWriter = .sbss:0x804BF538; // type:object size:0x4 data:4byte spInstance__19RPSysKokeshiManager = .sbss:0x804BF540; // type:object size:0x8 data:4byte -lbl_804BF548 = .sbss:0x804BF548; // type:object size:0x8 data:4byte +spInstance__14RPSysEffectMgr = .sbss:0x804BF548; // type:object size:0x8 data:4byte lbl_804BF550 = .sbss:0x804BF550; // type:object size:0x8 spTextBuffer__19RPSysWideTextWriter = .sbss:0x804BF558; // type:object size:0x4 data:4byte lbl_804BF560 = .sbss:0x804BF560; // type:object size:0x8 data:4byte @@ -21909,7 +21909,7 @@ lbl_804BF5F0 = .sbss:0x804BF5F0; // type:object size:0x8 data:byte lbl_804BF5F8 = .sbss:0x804BF5F8; // type:object size:0x8 data:4byte spCurrent__20RPGrpModelResManager = .sbss:0x804BF600; // type:object size:0x8 data:4byte lbl_804BF608 = .sbss:0x804BF608; // type:object size:0x8 data:4byte -lbl_804BF610 = .sbss:0x804BF610; // type:object size:0x4 data:4byte +spCurrent__13RPGrpRenderer = .sbss:0x804BF610; // type:object size:0x4 data:4byte lbl_804BF614 = .sbss:0x804BF614; // type:object size:0x1 data:byte lbl_804BF615 = .sbss:0x804BF615; // type:object size:0x1 data:byte gap_11_804BF616_sbss = .sbss:0x804BF616; // type:object size:0x2 scope:global diff --git a/include/Pack/RPGraphics/RPGrpRenderer.h b/include/Pack/RPGraphics/RPGrpRenderer.h index 9a4278c18..c10526ccb 100644 --- a/include/Pack/RPGraphics/RPGrpRenderer.h +++ b/include/Pack/RPGraphics/RPGrpRenderer.h @@ -46,6 +46,9 @@ class RPGrpRenderer { void BecomeCurrent(); void AppendDrawObject(IRPGrpDrawObject* pObject); + void AppendDrawObject(IRPGrpDrawObject& rObject) { + AppendDrawObject(&rObject); + } void PreCalculate(); void PostCalculate(); diff --git a/include/Pack/RPSystem/RPSysScene.h b/include/Pack/RPSystem/RPSysScene.h index 881392bf2..cc5573659 100644 --- a/include/Pack/RPSystem/RPSysScene.h +++ b/include/Pack/RPSystem/RPSysScene.h @@ -205,7 +205,24 @@ class RPSysScene : public EGG::Scene, public IRPGrpDrawObject { */ void setChildScene(); -protected: + /** + * @brief Displays the game's build date timestamp + * + * @param color Text color + */ + void drawTimeStamp(nw4r::ut::Color color); + + /** + * @brief Marks that this scene requires an asynchronous task + */ + void setTaskAsync(); + + /** + * @brief Tests whether this scene's asynchronous task has finished + */ + bool isTaskAsyncFinish() const; + +private: /** * @brief Prepares this scene to be entered */ @@ -226,18 +243,12 @@ class RPSysScene : public EGG::Scene, public IRPGrpDrawObject { */ void init(); - /** - * @brief Displays the game's build date timestamp - * - * @param color Text color - */ - void drawTimeStamp(nw4r::ut::Color color); - void loadUpdate(); + /** + * @brief Creates the asynchronous task thread if requested by the scene + */ void initTaskAsync(); - void setTaskAsync(); - bool isTaskAsyncFinish() const; /** * @brief Enables the "Now Loading" message display @@ -255,20 +266,39 @@ class RPSysScene : public EGG::Scene, public IRPGrpDrawObject { */ void loadMessage(); + /** + * @brief Polls the status of the DVD task thread + */ void updateDvdEndMessage(); + + /** + * @brief Polls the status of the NAND task thread + */ void updateNandEndMessage(); + /** + * @brief Thread function for the LoadResource phase + * + * @param pArg Thread function argument + */ static void loadResourceFunc(void* pArg); + /** + * @brief Thread function for the scene's task + * + * @param pArg Thread function argument + */ + static void taskAsyncFunc(void* pArg); + private: /** * @brief Scene flags */ enum { - EFlag_LoadMessage, //!< Display "Now Loading" message - EFlag_1 = 1, - EFlag_2, - EFlag_IsChild, //!< This scene was created as a child + EFlag_LoadMessage, //!< Display "Now Loading" message + EFlag_TaskAsyncSet, //!< The scene requested an asynchronous task + EFlag_TaskAsyncRunning, //!< The asynchronous task is running + EFlag_IsChild, //!< This scene was created as a child }; private: diff --git a/src/Pack/RPSystem/RPSysLoadScene.cpp b/src/Pack/RPSystem/RPSysLoadScene.cpp index a17ae8d87..81f1a70ef 100644 --- a/src/Pack/RPSystem/RPSysLoadScene.cpp +++ b/src/Pack/RPSystem/RPSysLoadScene.cpp @@ -1,9 +1,16 @@ +#include #include #include #include +#if defined(PACK_SPORTS) +#define RP_COMMON_SOUND_PATH "Sound/RPSportsCommon/rp_Common_Sports.brsar" +#elif defined(PACK_PARTY) +#define RP_COMMON_SOUND_PATH "Sound/RPPartyCommon/rp_Common_Party.brsar" +#endif + /** * @brief Displays the game's build date timestamp * @@ -11,10 +18,11 @@ */ void RPSysScene::drawTimeStamp(nw4r::ut::Color color) { enum { - YEAR_SZ = sizeof("yyyy") - 1, - MONTH_SZ = sizeof("mm") - 1, - DAY_SZ = sizeof("dd") - 1, - TIME_SZ = sizeof("hh:mm") - 1, + YEARSIZE = sizeof("yyyy") - 1, + MONTHSIZE = sizeof("mm") - 1, + DAYSIZE = sizeof("dd") - 1, + TIMESIZE = sizeof("hh:mm") - 1, + BUFSIZE = 8 }; RP_GET_INSTANCE(RPSysTextWriter)->Begin(); @@ -26,35 +34,35 @@ void RPSysScene::drawTimeStamp(nw4r::ut::Color color) { const char* pTimeStamp = RP_GET_INSTANCE(RPSysSystem)->getTimeStampString(); - char year[8]; + char year[BUFSIZE]; std::strncpy( // year, // pTimeStamp, // - YEAR_SZ); + YEARSIZE); - char month[8]; - std::strncpy( // - month, // - pTimeStamp + YEAR_SZ + sizeof('/'), // - MONTH_SZ); + char month[BUFSIZE]; + std::strncpy( // + month, // + pTimeStamp + YEARSIZE + sizeof('/'), // + MONTHSIZE); - char day[8]; - std::strncpy( // - day, // - pTimeStamp + YEAR_SZ + sizeof('/') + MONTH_SZ + sizeof('/'), // - DAY_SZ); + char day[BUFSIZE]; + std::strncpy( // + day, // + pTimeStamp + YEARSIZE + sizeof('/') + MONTHSIZE + sizeof('/'), // + DAYSIZE); - char time[8]; + char time[BUFSIZE]; std::strncpy( // time, // - pTimeStamp + YEAR_SZ + sizeof('/') + MONTH_SZ + sizeof('/') + - DAY_SZ + sizeof(" \r\n") - 1, - TIME_SZ); + pTimeStamp + YEARSIZE + sizeof('/') + MONTHSIZE + sizeof('/') + + DAYSIZE + sizeof(" \r\n") - 1, + TIMESIZE); - year[YEAR_SZ] = 0; - month[MONTH_SZ] = 0; - day[DAY_SZ] = 0; - time[TIME_SZ] = 0; + year[YEARSIZE] = 0; + month[MONTHSIZE] = 0; + day[DAYSIZE] = 0; + time[TIMESIZE] = 0; RP_GET_INSTANCE(RPSysTextWriter) ->PrintfZeroCenter(-0.95f, -0.90f, "%s %s %s %s", // @@ -65,13 +73,20 @@ void RPSysScene::drawTimeStamp(nw4r::ut::Color color) { void RPSysScene::loadUpdate() {} +/** + * @brief Marks that this scene requires an asynchronous task + */ void RPSysScene::setTaskAsync() { - mFlags.setBit(EFlag_1); - mFlags.setBit(EFlag_2); + mFlags.setBit(EFlag_TaskAsyncSet); + mFlags.setBit(EFlag_TaskAsyncRunning); } +/** + * @brief Tests whether this scene's asynchronous task has finished + */ bool RPSysScene::isTaskAsyncFinish() const { - return mFlags.onBit(EFlag_1) && !mFlags.onBit(EFlag_2); + return mFlags.onBit(EFlag_TaskAsyncSet) && + mFlags.offBit(EFlag_TaskAsyncRunning); } /** @@ -85,8 +100,8 @@ void RPSysScene::enableLoadMessage() { * @brief Loads this scene's resources asynchronously */ void RPSysScene::load() { - // Need to use loadMessage() if (mFlags.onBit(EFlag_LoadMessage)) { + // Need to use loadMessage() return; } @@ -118,8 +133,151 @@ void RPSysScene::load() { * Loading" message if the feature is enabled */ void RPSysScene::loadMessage() { - // Need to use load() if (mFlags.offBit(EFlag_LoadMessage)) { + // Need to use load() return; } + + bool finished = false; + + RP_GET_INSTANCE(RPSysSceneMgr) + ->setSceneStatus(EGG::Fader::STATUS_PREPARE_IN); + + RP_GET_INSTANCE(RPSysSceneMgr)->startSceneFadeIn(); + + RP_GET_INSTANCE(RPSysSystem) + ->getDvdThread() + ->request(loadResourceFunc, // + this, // + RP_GET_INSTANCE(RPSysSystem)->getDvdEndMessage()); + + while (true) { + BOOL success = FALSE; + + RP_GET_INSTANCE(RPSysSystem)->loadFrameWork(false); + + if (RP_GET_INSTANCE(RPSysSceneMgr)->calcSceneFader()) { + break; + } + + if (!finished) { + EGG::TaskThread* pDvdThread = + RP_GET_INSTANCE(RPSysSystem)->getDvdThread(); + + OSMessage msg = pDvdThread->waitQueueMessage( // + pDvdThread->getEndMessageQueue(), &success); + + if (success && + msg == RP_GET_INSTANCE(RPSysSystem)->getDvdEndMessage()) { + + finished = true; + } + + } else if (RP_GET_INSTANCE(RPSysSceneMgr)->getSceneStatus() == + EGG::Fader::STATUS_PREPARE_OUT) { + + RP_GET_INSTANCE(RPSysSceneMgr)->startSceneFadeOut(); + } + } +} + +/** + * @brief Creates the asynchronous task thread if requested by the scene + */ +void RPSysScene::initTaskAsync() { + if (mFlags.onBit(EFlag_TaskAsyncSet) && + mFlags.onBit(EFlag_TaskAsyncRunning)) { + + RP_GET_INSTANCE(RPSysSystem) + ->getDvdThread() + ->request(taskAsyncFunc, // + this, // + RP_GET_INSTANCE(RPSysSystem)->getDvdEndMessage()); + } +} + +/** + * @brief Polls the status of the DVD task thread + */ +void RPSysScene::updateDvdEndMessage() { + if (mFlags.onBit(EFlag_TaskAsyncSet) && + mFlags.onBit(EFlag_TaskAsyncRunning)) { + + BOOL success = FALSE; + + EGG::TaskThread* pDvdThread = + RP_GET_INSTANCE(RPSysSystem)->getDvdThread(); + + OSMessage msg = pDvdThread->waitQueueMessage( + pDvdThread->getEndMessageQueue(), &success); + + if (success && + msg == RP_GET_INSTANCE(RPSysSystem)->getDvdEndMessage()) { + + mFlags.resetBit(EFlag_TaskAsyncRunning); + } + } +} + +/** + * @brief Polls the status of the NAND task thread + */ +void RPSysScene::updateNandEndMessage() { + if (!RP_GET_INSTANCE(RPSysSaveDataMgr)->isNandAccessFinish()) { + BOOL success = FALSE; + + EGG::TaskThread* pNandThread = + RP_GET_INSTANCE(RPSysSystem)->getNandThread(); + + OSMessage msg = pNandThread->waitQueueMessage( + pNandThread->getEndMessageQueue(), &success); + + if (success && + msg == RP_GET_INSTANCE(RPSysSystem)->getNandEndMessage()) { + + RP_GET_INSTANCE(RPSysSaveDataMgr)->finishNandAccess(); + } + } + + if (!RP_GET_INSTANCE(RPSysHomeMenuMgr)->isOpen() && + !RP_GET_INSTANCE(RPSysPauseMgr)->isPause()) { + + RP_GET_INSTANCE(RPSysSaveDataMgr)->update(isSceneDisplay()); + } +} + +/** + * @brief Thread function for the LoadResource phase + * + * @param pArg Thread function argument + */ +void RPSysScene::loadResourceFunc(void* pArg) { + RPSysScene* p = static_cast(pArg); + + if (RP_GET_INSTANCE(RPSysSceneCreator)->getAudioType(p->getSceneID()) == + RPSysSceneCreator::EAudioType_Common) { + + RP_GET_INSTANCE(RPSndAudioMgr) + ->openArchive(RP_COMMON_SOUND_PATH, NULL, + EGG::ArcPlayer::SARC_STORAGE_DVD, NULL); + + if (p->getSceneID() == RPSysSceneCreator::ESceneID_RPSysBootScene) { + RP_GET_INSTANCE(RPSndAudioMgr)->loadGroup("GROUP_LOGO"); + } else { + RP_GET_INSTANCE(RPSndAudioMgr)->loadGroup("GROUP_COMMON_01"); + } + } + + p->LoadResource(); +} + +/** + * @brief Thread function for the scene's task + * + * @param pArg Thread function argument + */ +void RPSysScene::taskAsyncFunc(void* pArg) { + RPSysScene* p = static_cast(pArg); + + p->taskAsync(); } diff --git a/src/Pack/RPSystem/RPSysScene.cpp b/src/Pack/RPSystem/RPSysScene.cpp index c915c0221..9b52dd9d2 100644 --- a/src/Pack/RPSystem/RPSysScene.cpp +++ b/src/Pack/RPSystem/RPSysScene.cpp @@ -267,10 +267,7 @@ void RPSysScene::init() { mpRenderer = RPGrpRenderer::Construct(pAllocator, getSceneID()); mpRenderer->BecomeCurrent(); - - // TODO(kiwi) Is there a version of this function that uses a reference? - IRPGrpDrawObject& rDrawObject = static_cast(*this); - RPGrpRenderer::GetCurrent()->AppendDrawObject(&rDrawObject); + RPGrpRenderer::GetCurrent()->AppendDrawObject(*this); mpCommonObject = new RPSysCommonObject(); From 7720da716ad934db41b38a51ceced375ecda104a Mon Sep 17 00:00:00 2001 From: kiwi515 <49212064+kiwi515@users.noreply.github.com> Date: Sat, 29 Aug 2026 15:17:28 -0400 Subject: [PATCH 5/7] Update symbols.txt --- config/RSPE01_01/symbols.txt | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/config/RSPE01_01/symbols.txt b/config/RSPE01_01/symbols.txt index 497b3621a..a743b23b7 100644 --- a/config/RSPE01_01/symbols.txt +++ b/config/RSPE01_01/symbols.txt @@ -6903,16 +6903,16 @@ getCreatorSceneID__10RPSysSceneCFv = .text:0x80184E90; // type:function size:0x8 setCreatorSceneID__10RPSysSceneFl = .text:0x80184E98; // type:function size:0x8 init__10RPSysSceneFv = .text:0x80184EA0; // type:function size:0xF0 exit__10RPSysSceneFv = .text:0x80184F90; // type:function size:0x74 -Exit__10RPSysSceneFv = .text:0x80185004; // type:function size:0x4 +Exit__10RPSysSceneFv = .text:0x80185004; // type:function size:0x4 scope:weak outgoing_childCreate__10RPSysSceneFv = .text:0x80185008; // type:function size:0x40 draw__10RPSysSceneFv = .text:0x80185048; // type:function size:0x4C calc__10RPSysSceneFv = .text:0x80185094; // type:function size:0xD0 -Calculate__10RPSysSceneFv = .text:0x80185164; // type:function size:0x4 +Calculate__10RPSysSceneFv = .text:0x80185164; // type:function size:0x4 scope:weak incoming_childDestroy__10RPSysSceneFv = .text:0x80185168; // type:function size:0xC0 -Reset__10RPSysSceneFv = .text:0x80185228; // type:function size:0x4 +Reset__10RPSysSceneFv = .text:0x80185228; // type:function size:0x4 scope:weak reinit__10RPSysSceneFv = .text:0x8018522C; // type:function size:0xD8 enter__10RPSysSceneFv = .text:0x80185304; // type:function size:0xFC -Configure__10RPSysSceneFv = .text:0x80185400; // type:function size:0x4 +Configure__10RPSysSceneFv = .text:0x80185400; // type:function size:0x4 scope:weak __ct__10RPSysSceneFv = .text:0x80185404; // type:function size:0x68 setDimming__10RPSysSceneFb = .text:0x8018546C; // type:function size:0x8 startFadeOut__10RPSysSceneFv = .text:0x80185474; // type:function size:0x8 @@ -6925,14 +6925,14 @@ isNandAccessEnable__10RPSysSceneCFv = .text:0x80185524; // type:function size:0x isSceneChangeEnable__10RPSysSceneCFv = .text:0x80185574; // type:function size:0x8 isSceneBlank__10RPSysSceneCFv = .text:0x8018557C; // type:function size:0x8 isSceneDisplay__10RPSysSceneCFv = .text:0x80185584; // type:function size:0x8 -VF_0x3C__10RPSysSceneFv = .text:0x8018558C; // type:function size:0x8 -pauseCallBack__10RPSysSceneFb = .text:0x80185594; // type:function size:0x4 -LoadResource__10RPSysSceneFv = .text:0x80185598; // type:function size:0x4 -taskAsync__10RPSysSceneFv = .text:0x8018559C; // type:function size:0x4 -UserDraw__16IRPGrpDrawObjectFv = .text:0x801855A0; // type:function size:0x4 -DebugDraw__16IRPGrpDrawObjectFv = .text:0x801855A4; // type:function size:0x4 +VF_0x3C__10RPSysSceneFv = .text:0x8018558C; // type:function size:0x8 scope:weak +pauseCallBack__10RPSysSceneFb = .text:0x80185594; // type:function size:0x4 scope:weak +LoadResource__10RPSysSceneFv = .text:0x80185598; // type:function size:0x4 scope:weak +taskAsync__10RPSysSceneFv = .text:0x8018559C; // type:function size:0x4 scope:weak +UserDraw__16IRPGrpDrawObjectFv = .text:0x801855A0; // type:function size:0x4 scope:weak +DebugDraw__16IRPGrpDrawObjectFv = .text:0x801855A4; // type:function size:0x4 scope:weak __sinit_\RPSysScene_cpp = .text:0x801855A8; // type:function size:0xC scope:local -@36@__dt__10RPSysSceneFv = .text:0x801855B4; // type:function size:0x8 +@36@__dt__10RPSysSceneFv = .text:0x801855B4; // type:function size:0x8 scope:weak adjust__19RPSysRenderModeFPUsPUsii = .text:0x801855BC; // type:function size:0xBC __dt__13RPSysSceneMgrFv = .text:0x80185678; // type:function size:0x58 updateState__13RPSysSceneMgrFv = .text:0x801856D0; // type:function size:0x198 @@ -18554,7 +18554,7 @@ __vt__11RPSysSystem = .data:0x803B9578; // type:object size:0xC scope:global lbl_803B9584 = .data:0x803B9584; // type:object size:0x34 scope:global jumptable_803B95B8 = .data:0x803B95B8; // type:object size:0x30 scope:local __vt__17RPSysSceneCreator = .data:0x803B95E8; // type:object size:0x18 scope:global -__vt__10RPSysScene = .data:0x803B9600; // type:object size:0x60 scope:global +__vt__10RPSysScene = .data:0x803B9600; // type:object size:0x5C scope:global NtscInt__11RPSysSystem = .data:0x803B9660; // type:object size:0x3C NtscProg__11RPSysSystem = .data:0x803B969C; // type:object size:0x3C PalInt__11RPSysSystem = .data:0x803B96D8; // type:object size:0x3C From b8b1655f6e26aa974b27ae8207bd45202eaa3a96 Mon Sep 17 00:00:00 2001 From: kiwi515 <49212064+kiwi515@users.noreply.github.com> Date: Sat, 29 Aug 2026 15:33:29 -0400 Subject: [PATCH 6/7] Update RPSysSystem.cpp --- src/Pack/RPKernel/RPSysSystem.cpp | 42 ++++++++++++++++++------------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/src/Pack/RPKernel/RPSysSystem.cpp b/src/Pack/RPKernel/RPSysSystem.cpp index 10b8e9ce7..9751545f4 100644 --- a/src/Pack/RPKernel/RPSysSystem.cpp +++ b/src/Pack/RPKernel/RPSysSystem.cpp @@ -1,10 +1,12 @@ -#include #include +#include + #include #include + +#include #include #include -#include void RPSysSystem::setupTVMode() { int i; @@ -18,15 +20,14 @@ void RPSysSystem::setupTVMode() { } if (SCGetAspectRatio() == SC_ASPECT_WIDE) { EGG::Screen::SetTVMode(EGG::Screen::TV_MODE_WIDE); - } - else { + } else { EGG::Screen::SetTVMode(EGG::Screen::TV_MODE_STD); } } RPSysSceneCreator::ESceneID RPSysSystem::getBootScene() { // this function is hardcoded (symbol name is official, weirdly enough) - return RPSysSceneCreator::ESceneID_RPSportsTitleScene; + return RPSysSceneCreator::ESceneID_RPSportsPackTitleScene; } void RPSysSystem::startLoadCount() { @@ -41,21 +42,27 @@ void RPSysSystem::setupLocalSettings() { u8 sysLanguage = SCGetLanguage(); if (sysLanguage == SC_LANG_EN) { - RP_GET_INSTANCE(RPSysProjectLocal)->setLocale(RPSysProjectLocal::EArea_USA); - RP_GET_INSTANCE(RPSysProjectLocal)->setLanguage(RPSysProjectLocal::EArea_USA); - } - else if (sysLanguage == SC_LANG_FR) { - RP_GET_INSTANCE(RPSysProjectLocal)->setLocale(RPSysProjectLocal::EArea_USA); - RP_GET_INSTANCE(RPSysProjectLocal)->setLanguage(RPSysProjectLocal::EArea_France); - } - else if (sysLanguage == SC_LANG_SP) { - RP_GET_INSTANCE(RPSysProjectLocal)->setLocale(RPSysProjectLocal::EArea_USA); - RP_GET_INSTANCE(RPSysProjectLocal)->setLanguage(RPSysProjectLocal::EArea_Spain); + RP_GET_INSTANCE(RPSysProjectLocal) + ->setLocale(RPSysProjectLocal::EArea_USA); + RP_GET_INSTANCE(RPSysProjectLocal) + ->setLanguage(RPSysProjectLocal::EArea_USA); + } else if (sysLanguage == SC_LANG_FR) { + RP_GET_INSTANCE(RPSysProjectLocal) + ->setLocale(RPSysProjectLocal::EArea_USA); + RP_GET_INSTANCE(RPSysProjectLocal) + ->setLanguage(RPSysProjectLocal::EArea_France); + } else if (sysLanguage == SC_LANG_SP) { + RP_GET_INSTANCE(RPSysProjectLocal) + ->setLocale(RPSysProjectLocal::EArea_USA); + RP_GET_INSTANCE(RPSysProjectLocal) + ->setLanguage(RPSysProjectLocal::EArea_Spain); } //! Requires ifdef for non Americas versions else { - RP_GET_INSTANCE(RPSysProjectLocal)->setLocale(RPSysProjectLocal::EArea_USA); - RP_GET_INSTANCE(RPSysProjectLocal)->setLanguage(RPSysProjectLocal::EArea_USA); + RP_GET_INSTANCE(RPSysProjectLocal) + ->setLocale(RPSysProjectLocal::EArea_USA); + RP_GET_INSTANCE(RPSysProjectLocal) + ->setLanguage(RPSysProjectLocal::EArea_USA); } } @@ -63,7 +70,6 @@ void RPSysSystem::setupLocalSettings() { * @brief Controls whether the game restarts or returns to the Wii Menu upon a * soft reset. */ - void RPSysSystem::softResetCallBack() { if (RP_GET_INSTANCE(RPSysDvdStatus)->isErrorOccured()) { RP_GET_INSTANCE(RPSysSceneMgr)->returnToMenu(FALSE); From 6c875f2addfd23e5691f2a4e0f937f01efd31126 Mon Sep 17 00:00:00 2001 From: kiwi515 <49212064+kiwi515@users.noreply.github.com> Date: Sat, 29 Aug 2026 15:36:31 -0400 Subject: [PATCH 7/7] Move RPSysSystem header --- include/Pack/RPKernel.h | 1 + .../Pack/{RPSystem => RPKernel}/RPSysSystem.h | 28 ++++++++++--------- include/Pack/RPSystem.h | 1 - 3 files changed, 16 insertions(+), 14 deletions(-) rename include/Pack/{RPSystem => RPKernel}/RPSysSystem.h (96%) diff --git a/include/Pack/RPKernel.h b/include/Pack/RPKernel.h index abbbd570a..29c0be6c9 100644 --- a/include/Pack/RPKernel.h +++ b/include/Pack/RPKernel.h @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include diff --git a/include/Pack/RPSystem/RPSysSystem.h b/include/Pack/RPKernel/RPSysSystem.h similarity index 96% rename from include/Pack/RPSystem/RPSysSystem.h rename to include/Pack/RPKernel/RPSysSystem.h index 6276a805e..b8cc1b2d3 100644 --- a/include/Pack/RPSystem/RPSysSystem.h +++ b/include/Pack/RPKernel/RPSysSystem.h @@ -1,9 +1,9 @@ -#ifndef RP_SYSTEM_SYSTEM_H -#define RP_SYSTEM_SYSTEM_H +#ifndef RP_KERNEL_SYSTEM_H +#define RP_KERNEL_SYSTEM_H #include -#include #include +#include #include @@ -26,7 +26,7 @@ class RPSysConfigData { virtual EGG::Video* GetVideo() { return mVideo; - } + } virtual EGG::Heap* GetSystemHeap() { return mSystemHeap; } @@ -47,27 +47,29 @@ class RPSysConfigData { } virtual void StubA() {} virtual void StubB() {} + private: void* mMem1Start; void* mMem1End; void* mMem2Start; void* mMem2End; u32 mMemSize; - EGG::Heap *mRootHeapMem1; - EGG::Heap *mRootHeapMem2; - EGG::Heap *mRootHeapDebug; + EGG::Heap* mRootHeapMem1; + EGG::Heap* mRootHeapMem2; + EGG::Heap* mRootHeapDebug; + protected: EGG::Heap* mSystemHeap; EGG::Thread* mCreatorThread; void* mCodeStart; void* mCodeEnd; u32 mSystemHeapSize; - EGG::Video *mVideo; - EGG::XfbManager *mXfbMgr; - EGG::Display *mDisplay; - EGG::PerformanceView *mPerfView; - EGG::SceneManager *mSceneMgr; - EGG::IAudioMgr *mAudioMgr; + EGG::Video* mVideo; + EGG::XfbManager* mXfbMgr; + EGG::Display* mDisplay; + EGG::PerformanceView* mPerfView; + EGG::SceneManager* mSceneMgr; + EGG::IAudioMgr* mAudioMgr; }; /** diff --git a/include/Pack/RPSystem.h b/include/Pack/RPSystem.h index 7970b81f7..200ef229d 100644 --- a/include/Pack/RPSystem.h +++ b/include/Pack/RPSystem.h @@ -22,7 +22,6 @@ #include #include #include -#include #include #endif