NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
d_reset.hpp
1#pragma once
2#include <lib/egg/core/eggColorFader.h>
3#include <lib/egg/core/eggHeap.h>
4#include <types.h>
5
6/// @ingroup bases
7namespace dReset {
8
9 /// @brief System reset management class.
10 class Manage_c {
11 public:
12
13 /// @brief The game's possible running states.
14 enum Mode_e {
15 NORMAL, ///< The game is running regularly.
16 SOFT_RESET, ///< The game is being soft reset (from the Home Menu).
17 HBM_WAIT, ///< The home menu is open.
18 DISK_WAIT, ///< The game cannot read the DVD and cannot proceed.
19 FATAL_ERROR, ///< The game cannot read the NAND and cannot proceed.
20 SAFETY_WAIT, ///< The game is about to execute the hard reset procedure indicated in #mExecMode.
21 NO_CHANGE ///< The game's running state hasn't changed [value used in #mModeInit].
22 };
23
24 /// @brief The possible hard reset procedures.
25 enum Exec_e {
26 RESTART_GAME, ///< Reboots the game's DOL. @unused
27 REBOOT_SYSTEM, ///< Reboots the entire console. @unused
28 RETURN_WII_MENU, ///< Returns to the Wii Menu.
29 RETURN_DATA_MANAGER, ///< Returns to the Wii Menu's Data Manager.
30 POWER_OFF, ///< Turns off the console.
31 NONE ///< Does not execute any reset procedure.
32 };
33
34 void SetSoftResetFinish();
35 void SetSoftResetScene();
36 void PostDeleteScene();
37 void BootComplete();
38 void PermitSoftReset(bool);
39 bool IsFaderBlank() const;
40 void ActiveSaveWindow(bool);
41
42 bool isSafetyWait() const { return mModeInit == SAFETY_WAIT || mModeProc == SAFETY_WAIT; }
43
44 EGG::Heap *mpHeap;
45 EGG::ColorFader *mpColorFader;
46
47 int mModeProc; ///< The game's current running state. See Mode_e.
48
49 /// @brief The running state the game's about to switch to. See Mode_e.
50 /// @details The state does not change if this is set to Mode_e::NO_CHANGE.
52
53 int mPrevMode;
54 int mExecMode; ///< The hard reset procedure to be executed. See Exec_e.
55
56 bool mHbmReset;
57 bool mHbmReturnMenu;
58
59 bool mResetCallbackCalled;
60 bool mPowerCallbackCalled;
61 bool mInteriorReturnDataManager;
62
63 u32 mHbmResetTypeMaybe;
64 u32 mHbmPowerOffTypeMaybe;
65 int mSoftResetStateMaybe;
66 bool mSoftResetPermitted;
67 bool mUnknown2D;
68
69 bool mSoftResetRequested;
70 bool mFadeOutRequested;
71 bool mUnknown30;
72
73 void *mpAudioResetFunc;
74 void *mpAudioExitFunc;
75
76 bool mBootCompleted;
77 bool mExecutingFade;
78 bool mUnknown3E;
79
80 static dReset::Manage_c* GetInstance(); ///< Gets a pointer to the instance of this class.
81 };
82
83} // namespace dReset
System reset management class.
Definition d_reset.hpp:10
Exec_e
The possible hard reset procedures.
Definition d_reset.hpp:25
@ RESTART_GAME
Reboots the game's DOL.
Definition d_reset.hpp:26
@ RETURN_DATA_MANAGER
Returns to the Wii Menu's Data Manager.
Definition d_reset.hpp:29
@ RETURN_WII_MENU
Returns to the Wii Menu.
Definition d_reset.hpp:28
@ REBOOT_SYSTEM
Reboots the entire console.
Definition d_reset.hpp:27
@ NONE
Does not execute any reset procedure.
Definition d_reset.hpp:31
@ POWER_OFF
Turns off the console.
Definition d_reset.hpp:30
static dReset::Manage_c * GetInstance()
Gets a pointer to the instance of this class.
int mModeProc
The game's current running state. See Mode_e.
Definition d_reset.hpp:47
Mode_e
The game's possible running states.
Definition d_reset.hpp:14
@ NORMAL
The game is running regularly.
Definition d_reset.hpp:15
@ FATAL_ERROR
The game cannot read the NAND and cannot proceed.
Definition d_reset.hpp:19
@ HBM_WAIT
The home menu is open.
Definition d_reset.hpp:17
@ SAFETY_WAIT
The game is about to execute the hard reset procedure indicated in mExecMode.
Definition d_reset.hpp:20
@ DISK_WAIT
The game cannot read the DVD and cannot proceed.
Definition d_reset.hpp:18
@ SOFT_RESET
The game is being soft reset (from the Home Menu).
Definition d_reset.hpp:16
@ NO_CHANGE
The game's running state hasn't changed [value used in mModeInit].
Definition d_reset.hpp:21
int mExecMode
The hard reset procedure to be executed. See Exec_e.
Definition d_reset.hpp:54
int mModeInit
The running state the game's about to switch to. See Mode_e.
Definition d_reset.hpp:51