NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
d_s_boot.hpp
1#pragma once
2
3#include <game/bases/d_scene.hpp>
4#include <game/bases/d_wii_strap_screen.hpp>
5#include <game/bases/d_controller_information.hpp>
6#include <game/bases/d_cursor_select.hpp>
7#include <game/bases/d_yes_no_window.hpp>
9
10/// @brief This scene handles the game's boot process.
11/// It does the following:
12/// - Shows the Wii strap information screen.
13/// - Shows the controller information screen.
14/// - Checks for existing save data, creating new save data if none exists.
15/// - Shows save data-related error messages
16/// - Finally, transitions to the title screen.
17/// @statetable
18/// @ingroup bases
19class dScBoot_c : public dScene_c {
20public:
21 dScBoot_c(); ///< @copydoc dScene_c::dScene_c
22 virtual ~dScBoot_c(); ///< @copydoc dScene_c::~dScene_c
23 virtual int create();
24 virtual int execute();
25 virtual int preExecute();
26 virtual int draw();
27 virtual int doDelete();
28 virtual void deleteReady();
29
30 bool isState(const sStateIDIf_c &state) const {
31 return *mStateMgr.getStateID() == state;
32 }
33
34 /// @brief Deadstripped dummy function to force weak function order
36 mStateMgr.initializeState();
37 mStateMgr.finalizeState();
38 mStateMgr.getOldStateID();
39 }
40
41private:
42 STATE_FUNC_DECLARE(dScBoot_c, ResetWait); ///< Waiting for a reset event.
43 STATE_FUNC_DECLARE(dScBoot_c, ResetFadeOut); ///< Fading out the game for the reset.
44 STATE_FUNC_DECLARE(dScBoot_c, ResetFadeIn); ///< Fading back in after the reset.
45
46 STATE_FUNC_DECLARE(dScBoot_c, FadeOutWait); ///< Waiting for fade out to complete.
47 STATE_FUNC_DECLARE(dScBoot_c, WiiStrapKeyWait); ///< Forced delay before key press is accepted.
48 STATE_FUNC_DECLARE(dScBoot_c, WiiStrapDispEndWait); ///< Waiting for key press to continue.
49 STATE_FUNC_DECLARE(dScBoot_c, WiiStrapFadeOut); ///< The Wii strap screen is fading out.
50 STATE_FUNC_DECLARE(dScBoot_c, ControllerInformationFadeIn); ///< The controller information screen is fading in.
51 STATE_FUNC_DECLARE(dScBoot_c, ControllerInformationSoundWait); ///< Waiting for the scene sound to load.
52 STATE_FUNC_DECLARE(dScBoot_c, ControllerInformationKeyWait); ///< Forced delay before key press is accepted.
53 STATE_FUNC_DECLARE(dScBoot_c, ControllerInformationDispEndWait); ///< Waiting for key press to continue.
54 STATE_FUNC_DECLARE(dScBoot_c, NandCommandEndWait); ///< Waiting for the system to be ready for a NAND command.
55 STATE_FUNC_DECLARE(dScBoot_c, ExistFileCheck); ///< Checking for existing save data.
56 STATE_FUNC_DECLARE(dScBoot_c, NandSpaceCheck); ///< Checking for sufficient NAND space for the save data.
57 STATE_FUNC_DECLARE(dScBoot_c, CreateFile); ///< Creating new save data.
58 STATE_FUNC_DECLARE(dScBoot_c, Load); ///< Loading existing save data.
59 STATE_FUNC_DECLARE(dScBoot_c, GoToErrorFadeOut); ///< Fading out to show an error message.
60 STATE_FUNC_DECLARE(dScBoot_c, GoToErrorFadeIn); ///< Fading in the error message.
61 STATE_FUNC_DECLARE(dScBoot_c, NewSaveFileDisp); ///< Animating in the "new save data created" message.
62 STATE_FUNC_DECLARE(dScBoot_c, ButtonInputWait); ///< Waiting for button input after creating new save data.
63 STATE_FUNC_DECLARE(dScBoot_c, WindowExitWait); ///< Waiting for the "save data created" window to close.
64 STATE_FUNC_DECLARE(dScBoot_c, ProcEnd); ///< Going to the title screen.
65 STATE_FUNC_DECLARE(dScBoot_c, ErrorWindowOnStageWait); ///< Showing an error message.
66 STATE_FUNC_DECLARE(dScBoot_c, ErrorInfinityDisp); ///< Showing an irrecoverable error message.
67
68 sFStateMgr_c<dScBoot_c, sStateMethodUsr_FI_c> mStateMgr; ///< The main state manager for the boot scene.
69 sFStateMgr_c<dScBoot_c, sStateMethodUsr_FI_c> mResetStateMgr; ///< The state manager for the ResetXXX states.
70
71 u8 mPad; ///< @unused
72public:
73 dWiiStrapScreen_c *mpWiiStrapScreen; ///< The Wii strap screen instance.
74 dYesNoWindow_c *mpYesNoWindow; ///< The yes/no window instance.
75 dSelectCursor_c *mpSelectCursor; ///< The select cursor instance.
76 dControllerInformation_c *mpControllerInformation; ///< The controller information instance.
77
78private:
79 bool mNewSaveFileCreated; ///< Whether new save data was created during boot.
80 bool mResetFaderDone; ///< Whether the reset fade-out has completed.
81public:
82 bool mSceneSoundLoaded; ///< Whether the sound (for the button press) has finished loading.
83private:
84 bool mIsResetting; ///< Whether the game is currently resetting.
85
86 bool mResetFadeOutStarted; ///< Whether the reset fade-out has started.
87 bool mSaveDataCreatedMessageShown; ///< Whether the "new save data created" message has been shown.
88 int mAutoAdvanceTimer; ///< The number of frames after which the scene will automatically advance.
89 int mMinWaitTimer; ///< The minimum number of frames to wait before a button may be pressed to advance the scene.
90
91public:
92 static dScBoot_c *m_instance; ///< The singleton instance of the boot scene.
93};
Displays the controller information screen.
dSelectCursor_c * mpSelectCursor
The select cursor instance.
Definition d_s_boot.hpp:75
virtual int create()
do method for the create operation.
Definition d_s_boot.cpp:378
sFStateMgr_c< dScBoot_c, sStateMethodUsr_FI_c > mResetStateMgr
The state manager for the ResetXXX states.
Definition d_s_boot.hpp:69
virtual void deleteReady()
Informs the base that it's about to be deleted.
Definition d_s_boot.cpp:400
virtual int doDelete()
do method for the delete operation.
Definition d_s_boot.cpp:404
bool mSceneSoundLoaded
Whether the sound (for the button press) has finished loading.
Definition d_s_boot.hpp:82
dScBoot_c()
Creates a new scene.
Definition d_s_boot.cpp:366
dYesNoWindow_c * mpYesNoWindow
The yes/no window instance.
Definition d_s_boot.hpp:74
bool mResetFaderDone
Whether the reset fade-out has completed.
Definition d_s_boot.hpp:80
int mAutoAdvanceTimer
The number of frames after which the scene will automatically advance.
Definition d_s_boot.hpp:88
dControllerInformation_c * mpControllerInformation
The controller information instance.
Definition d_s_boot.hpp:76
bool mNewSaveFileCreated
Whether new save data was created during boot.
Definition d_s_boot.hpp:79
bool mSaveDataCreatedMessageShown
Whether the "new save data created" message has been shown.
Definition d_s_boot.hpp:87
virtual int preExecute()
pre method for the execute operation.
Definition d_s_boot.cpp:426
int mMinWaitTimer
The minimum number of frames to wait before a button may be pressed to advance the scene.
Definition d_s_boot.hpp:89
virtual int draw()
do method for the draw operation.
Definition d_s_boot.cpp:443
virtual ~dScBoot_c()
Destroys the scene.
Definition d_s_boot.cpp:374
bool mResetFadeOutStarted
Whether the reset fade-out has started.
Definition d_s_boot.hpp:86
dWiiStrapScreen_c * mpWiiStrapScreen
The Wii strap screen instance.
Definition d_s_boot.hpp:73
virtual int execute()
do method for the execute operation.
Definition d_s_boot.cpp:434
static dScBoot_c * m_instance
The singleton instance of the boot scene.
Definition d_s_boot.hpp:92
void DUMMY_FUNCTION_ORDER()
Deadstripped dummy function to force weak function order.
Definition d_s_boot.hpp:35
sFStateMgr_c< dScBoot_c, sStateMethodUsr_FI_c > mStateMgr
The main state manager for the boot scene.
Definition d_s_boot.hpp:68
bool mIsResetting
Whether the game is currently resetting.
Definition d_s_boot.hpp:84
dScene_c()
Creates a new scene.
Definition d_scene.cpp:23
Displays a confirmation prompt.
A wrapper for sStateMgr_c that uses sFStateFct_c and sStateIDChk_c.
The interface for state IDs.
#define STATE_FUNC_DECLARE(class, name)
Declares a state.
Definition s_State.hpp:12