diff --git a/config/RSPE01_01/symbols.txt b/config/RSPE01_01/symbols.txt index 1c230d2e..c452a375 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/RPKernel/RPSysController.h b/include/Pack/RPKernel/RPSysController.h index 6d6d73de..83af9c93 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 }; /****************************************************************************** diff --git a/include/Pack/RPKernel/RPSysHomeMenuMgr.h b/include/Pack/RPKernel/RPSysHomeMenuMgr.h index 133bbfc6..ce4b9527 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/RPSystem.h b/include/Pack/RPSystem.h index 65aece80..9536c76a 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 56ff36e5..515b5a1b 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 00000000..4d8cbab5 --- /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 00000000..2acdd876 --- /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/RPSysSceneMgr.h b/include/Pack/RPSystem/RPSysSceneMgr.h index 183e5c6e..c6bfe379 100644 --- a/include/Pack/RPSystem/RPSysSceneMgr.h +++ b/include/Pack/RPSystem/RPSysSceneMgr.h @@ -17,12 +17,31 @@ class RPSysSceneMgr : public EGG::SceneManager { RP_SINGLETON_DECL(RPSysSceneMgr); public: + /** + * @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; }; //! @} diff --git a/include/Pack/RPSystem/RPSysSystem.h b/include/Pack/RPSystem/RPSysSystem.h index 9a0d35d2..6276a805 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 b5c6e325..db73c67b 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 069f19b2..7e328f6b 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 ac67d708..ab6d8304 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 95696787..8f7a44b6 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/RPSysSystem.cpp b/src/Pack/RPKernel/RPSysSystem.cpp new file mode 100644 index 00000000..10b8e9ce --- /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); +}