NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
dScBoot_c Class Reference

#include <game/bases/d_s_boot.hpp>

Inheritance diagram for dScBoot_c:
[legend]

Description

This scene handles the game's boot process. It does the following:

  • Shows the Wii strap information screen.
  • Shows the controller information screen.
  • Checks for existing save data, creating new save data if none exists.
  • Shows save data-related error messages
  • Finally, transitions to the title screen.

    States

Definition at line 19 of file d_s_boot.hpp.

Public Member Functions

 dScBoot_c ()
 Creates a new scene.
 
virtual ~dScBoot_c ()
 Destroys the scene.
 
virtual int create ()
 do method for the create operation.
 
virtual int execute ()
 do method for the execute operation.
 
virtual int preExecute ()
 pre method for the execute operation.
 
virtual int draw ()
 do method for the draw operation.
 
virtual int doDelete ()
 do method for the delete operation.
 
virtual void deleteReady ()
 Informs the base that it's about to be deleted.
 
bool isState (const sStateIDIf_c &state) const
 
void DUMMY_FUNCTION_ORDER ()
 Deadstripped dummy function to force weak function order.
 
- Public Member Functions inherited from dScene_c
 dScene_c ()
 Creates a new scene.
 
 ~dScene_c ()
 Destroys the scene.
 
virtual int preCreate ()
 pre method for the create operation.
 
virtual void postCreate (fBase_c::MAIN_STATE_e status)
 post method for the create operation.
 
virtual int preDelete ()
 pre method for the delete operation.
 
virtual void postDelete (fBase_c::MAIN_STATE_e status)
 post method for the delete operation.
 
virtual void postExecute (fBase_c::MAIN_STATE_e status)
 post method for the execute operation.
 
virtual int preDraw ()
 pre method for the draw operation.
 
virtual void postDraw (fBase_c::MAIN_STATE_e status)
 post method for the draw operation.
 
- Public Member Functions inherited from dBase_c
 dBase_c ()
 Constructs a new base.
 
virtual ~dBase_c ()
 Destroys the base.
 
virtual const char * getKindString () const
 Gets the base's kind string.
 
- Public Member Functions inherited from fBase_c
 fBase_c ()
 Constructs a new base.
 
void deleteRequest ()
 Requests deletion of the base.
 
fBase_cgetConnectParent () const
 Gets the base's parent.
 
fBase_cgetConnectChild () const
 Gets the base's first child.
 
fBase_cgetConnectBrNext () const
 Gets the base's next sibling.
 
bool checkChildProcessCreateState () const
 Checks if the base has at least one child in the CREATING state.
 
- Public Member Functions inherited from cOwnerSetMg_c
 cOwnerSetMg_c ()
 Constructs a new set container.
 
 ~cOwnerSetMg_c ()
 Destroys the set.
 
void add (cOwnerSetNd_c *nd, void *owner)
 Adds a node to the set.
 
void remove (cOwnerSetNd_c *nd, void *owner)
 Removes a node from the set.
 

Public Attributes

dWiiStrapScreen_cmpWiiStrapScreen
 The Wii strap screen instance.
 
dYesNoWindow_cmpYesNoWindow
 The yes/no window instance.
 
dSelectCursor_cmpSelectCursor
 The select cursor instance.
 
dControllerInformation_cmpControllerInformation
 The controller information instance.
 
bool mSceneSoundLoaded
 Whether the sound (for the button press) has finished loading.
 
- Public Attributes inherited from dScene_c
sPhase_cmpPhase
 The phase used for scene initialization.
 
- Public Attributes inherited from fBase_c
fBaseID_e mUniqueID
 The base's unique identifier.
 
u32 mParam
 A bitfield that configures the base's behaviour. Its usage varies from profile to profile.
 
ProfileName mProfName
 The base's profile name.
 

Static Public Attributes

static dScBoot_cm_instance
 The singleton instance of the boot scene.
 
- Static Public Attributes inherited from dScene_c
static u32 mPara
 The parameters for the next scene.
 
static ProfileName m_nextScene = fProfile::INVALID
 The profile name of the next scene.
 
static ProfileName m_nowScene = fProfile::INVALID
 The profile name of the current scene.
 
static ProfileName m_oldScene = fProfile::INVALID
 The profile name of the previous scene.
 
static bool m_otherSceneFlg = true
 Whether the next scene has already been created.
 
static u16 m_fadeInFrame = 30
 The duration of the next fade-in.
 
static u16 m_fadeOutFrame = 30
 The duration of the next fade-out.
 
static bool m_isAutoFadeIn = true
 If a fade-in should automatically be performed on scene load.
 

Private Attributes

sFStateMgr_c< dScBoot_c, sStateMethodUsr_FI_cmStateMgr
 The main state manager for the boot scene.
 
sFStateMgr_c< dScBoot_c, sStateMethodUsr_FI_cmResetStateMgr
 The state manager for the ResetXXX states.
 
u8 mPad
 
bool mNewSaveFileCreated
 Whether new save data was created during boot.
 
bool mResetFaderDone
 Whether the reset fade-out has completed.
 
bool mIsResetting
 Whether the game is currently resetting.
 
bool mResetFadeOutStarted
 Whether the reset fade-out has started.
 
bool mSaveDataCreatedMessageShown
 Whether the "new save data created" message has been shown.
 
int mAutoAdvanceTimer
 The number of frames after which the scene will automatically advance.
 
int mMinWaitTimer
 The minimum number of frames to wait before a button may be pressed to advance the scene.
 

Static Private Attributes

static sFStateID_c< dScBoot_cStateID_ResetWait
 Waiting for a reset event.
 
static sFStateID_c< dScBoot_cStateID_ResetFadeOut
 Fading out the game for the reset.
 
static sFStateID_c< dScBoot_cStateID_ResetFadeIn
 Fading back in after the reset.
 
static sFStateID_c< dScBoot_cStateID_FadeOutWait
 Waiting for fade out to complete.
 
static sFStateID_c< dScBoot_cStateID_WiiStrapKeyWait
 Forced delay before key press is accepted.
 
static sFStateID_c< dScBoot_cStateID_WiiStrapDispEndWait
 Waiting for key press to continue.
 
static sFStateID_c< dScBoot_cStateID_WiiStrapFadeOut
 The Wii strap screen is fading out.
 
static sFStateID_c< dScBoot_cStateID_ControllerInformationFadeIn
 The controller information screen is fading in.
 
static sFStateID_c< dScBoot_cStateID_ControllerInformationSoundWait
 Waiting for the scene sound to load.
 
static sFStateID_c< dScBoot_cStateID_ControllerInformationKeyWait
 Forced delay before key press is accepted.
 
static sFStateID_c< dScBoot_cStateID_ControllerInformationDispEndWait
 Waiting for key press to continue.
 
static sFStateID_c< dScBoot_cStateID_NandCommandEndWait
 Waiting for the system to be ready for a NAND command.
 
static sFStateID_c< dScBoot_cStateID_ExistFileCheck
 Checking for existing save data.
 
static sFStateID_c< dScBoot_cStateID_NandSpaceCheck
 Checking for sufficient NAND space for the save data.
 
static sFStateID_c< dScBoot_cStateID_CreateFile
 Creating new save data.
 
static sFStateID_c< dScBoot_cStateID_Load
 Loading existing save data.
 
static sFStateID_c< dScBoot_cStateID_GoToErrorFadeOut
 Fading out to show an error message.
 
static sFStateID_c< dScBoot_cStateID_GoToErrorFadeIn
 Fading in the error message.
 
static sFStateID_c< dScBoot_cStateID_NewSaveFileDisp
 Animating in the "new save data created" message.
 
static sFStateID_c< dScBoot_cStateID_ButtonInputWait
 Waiting for button input after creating new save data.
 
static sFStateID_c< dScBoot_cStateID_WindowExitWait
 Waiting for the "save data created" window to close.
 
static sFStateID_c< dScBoot_cStateID_ProcEnd
 Going to the title screen.
 
static sFStateID_c< dScBoot_cStateID_ErrorWindowOnStageWait
 Showing an error message.
 
static sFStateID_c< dScBoot_cStateID_ErrorInfinityDisp
 Showing an irrecoverable error message.
 

Additional Inherited Members

- Public Types inherited from fBase_c
enum  LIFECYCLE_e {
  CREATING ,
  ACTIVE ,
  DELETING
}
 The possible lifecycle states. More...
 
enum  GROUP_TYPE_e {
  OTHER ,
  SCENE ,
  ACTOR
}
 The possible group types. More...
 
enum  MAIN_STATE_e {
  CANCELED ,
  ERROR ,
  SUCCESS ,
  WAITING
}
 The possible operation results. More...
 
enum  PACK_RESULT_e {
  NOT_READY ,
  SUCCEEDED ,
  FAILED
}
 The possible operation step results. More...
 
enum  PROC_DISABLE_e {
  ROOT_DISABLE_EXECUTE = BIT_FLAG(0) ,
  DISABLE_EXECUTE = BIT_FLAG(1) ,
  ROOT_DISABLE_DRAW = BIT_FLAG(2) ,
  DISABLE_DRAW = BIT_FLAG(3)
}
 Controls if the execute and draw operations should be skipped. More...
 
- Static Public Member Functions inherited from dScene_c
static void setStartScene ()
 Sets up the scene to be shown when the game boots up.
 
static void setResetScene ()
 Sets up the scene to be shown after a game reset.
 
static dScene_ccreateNextScene ()
 Creates and returns a root base for the next scene.
 
static void setNextScene (ProfileName nextScene, unsigned long param, bool forceChange)
 Attempts to prepare the transition to a new scene.
 
static void setFadeInFrame (unsigned short length)
 Sets the duration of the next fade-in transition to length.
 
static void setFadeOutFrame (unsigned short length)
 Sets the duration of the next fade-out transition to length.
 
static void setFadeInOutFrame (unsigned short length)
 Sets the duration of the next fade-in and fade-out transitions to length.
 
- Static Public Member Functions inherited from dBase_c
static dBase_csearchBaseByProfName (ProfileName profile, const dBase_c *parent)
 Searches for a base with a given profile name, optionally under a given parent.
 
static void initLoader ()
 Sets the callbacks for the scrapped relocatable profile system.
 
static dBase_ccreateBase (ProfileName profName, dBase_c *parent, unsigned long param, u8 groupType)
 Creates a child base under the given parent.
 
static dBase_ccreateRoot (ProfileName profName, unsigned long param, u8 groupType)
 Creates a root base.
 
- Static Public Member Functions inherited from fBase_c
static void * operator new (size_t)
 new operator override for all bases.
 
static void operator delete (void *)
 delete operator override for all bases.
 
static fBase_ccreateChild (ProfileName profName, fBase_c *parent, unsigned long param, u8 groupType)
 Creates a child base under the given parent.
 
static fBase_ccreateRoot (ProfileName profName, unsigned long param, u8 groupType)
 Creates a root base.
 
- Protected Member Functions inherited from fBase_c
bool isProcControlFlag (u8 flag) const
 Checks if a flag is set in mProcControl.
 
void setProcControlFlag (u8 flag)
 Sets a flag in mProcControl.
 
void clearProcControlFlag (u8 flag)
 Clears a flag in mProcControl.
 
virtual bool entryFrmHeap (unsigned long size, EGG::Heap *parentHeap)
 Creates a heap of the given size for the base.
 
virtual bool entryFrmHeapNonAdjust (unsigned long size, EGG::Heap *parentHeap)
 Creates a heap of the given size for the base.
 
virtual bool createHeap ()
 [Does nothing].
 
virtual ~fBase_c ()
 Destroys the base.
 
- Protected Attributes inherited from dBase_c
const char * mpKindString
 The base's kind string.
 
const char * mpNameString
 The base's profile name string.
 
- Protected Attributes inherited from fBase_c
u8 mLifecycleState
 The base's lifecycle state. Value is a LIFECYCLE_e.
 
bool mDeleteRequested
 If deletion of the base was requested, but the delete operation has not been scheduled yet.
 
bool mDeferExecute
 If the create operation was completed, but scheduling the execute and draw operations isn't possible at this time.
 
bool mDeferRetryCreate
 If the create operation has not been completed, and rescheduling it isn't possible at this time.
 
u8 mGroupType
 The base's group type. Value is a GROUP_TYPE_e.
 
u8 mProcControl
 The operations to be skipped. Value is a PROC_DISABLE_e.
 
fManager_c mMng
 The base's process manager.
 
fBaHelper_cmpUnusedHelper
 See Unused Content.
 
fLiMgBa_c mUnusedList
 See Unused Content.
 
EGG::FrmHeapmHeap
 The base's dedicated heap.
 
- Static Protected Attributes inherited from fBase_c
static int(* sLoadAsyncCallback )()
 See Unused Content.
 
static void(* sUnloadCallback )()
 See Unused Content.
 

Constructor & Destructor Documentation

◆ dScBoot_c()

dScBoot_c::dScBoot_c ( )

Creates a new scene.

Definition at line 366 of file d_s_boot.cpp.

◆ ~dScBoot_c()

dScBoot_c::~dScBoot_c ( )
virtual

Destroys the scene.

Definition at line 374 of file d_s_boot.cpp.

Member Function Documentation

◆ create()

int dScBoot_c::create ( )
virtual

do method for the create operation.

Returns
A PACK_RESULT_e value.

Reimplemented from fBase_c.

Definition at line 378 of file d_s_boot.cpp.

◆ execute()

int dScBoot_c::execute ( )
virtual

do method for the execute operation.

Returns
A PACK_RESULT_e value.

Reimplemented from fBase_c.

Definition at line 434 of file d_s_boot.cpp.

◆ preExecute()

int dScBoot_c::preExecute ( )
virtual

pre method for the execute operation.

If m_nextScene is set, prepares to transition to the next scene. Once all initial child bases have been added, the execute and draw operations are enabled on this base and its children.

Reimplemented from dScene_c.

Definition at line 426 of file d_s_boot.cpp.

◆ draw()

int dScBoot_c::draw ( )
virtual

do method for the draw operation.

Returns
A PACK_RESULT_e value.

Reimplemented from fBase_c.

Definition at line 443 of file d_s_boot.cpp.

◆ doDelete()

int dScBoot_c::doDelete ( )
virtual

do method for the delete operation.

This method was renamed due to conflict with the delete C++ keyword.

Returns
A PACK_RESULT_e value.

Reimplemented from fBase_c.

Definition at line 404 of file d_s_boot.cpp.

◆ deleteReady()

void dScBoot_c::deleteReady ( )
virtual

Informs the base that it's about to be deleted.

Reimplemented from fBase_c.

Definition at line 400 of file d_s_boot.cpp.

◆ isState()

bool dScBoot_c::isState ( const sStateIDIf_c & state) const
inline

Definition at line 30 of file d_s_boot.hpp.

◆ DUMMY_FUNCTION_ORDER()

void dScBoot_c::DUMMY_FUNCTION_ORDER ( )
inline

Deadstripped dummy function to force weak function order.

Definition at line 35 of file d_s_boot.hpp.

Member Data Documentation

◆ StateID_ResetWait

sFStateID_c< dScBoot_c > dScBoot_c::StateID_ResetWait
staticprivate

Waiting for a reset event.

Definition at line 42 of file d_s_boot.hpp.

◆ StateID_ResetFadeOut

sFStateID_c< dScBoot_c > dScBoot_c::StateID_ResetFadeOut
staticprivate

Fading out the game for the reset.

Definition at line 43 of file d_s_boot.hpp.

◆ StateID_ResetFadeIn

sFStateID_c< dScBoot_c > dScBoot_c::StateID_ResetFadeIn
staticprivate

Fading back in after the reset.

Definition at line 44 of file d_s_boot.hpp.

◆ StateID_FadeOutWait

sFStateID_c< dScBoot_c > dScBoot_c::StateID_FadeOutWait
staticprivate

Waiting for fade out to complete.

Definition at line 46 of file d_s_boot.hpp.

◆ StateID_WiiStrapKeyWait

sFStateID_c< dScBoot_c > dScBoot_c::StateID_WiiStrapKeyWait
staticprivate

Forced delay before key press is accepted.

Definition at line 47 of file d_s_boot.hpp.

◆ StateID_WiiStrapDispEndWait

sFStateID_c< dScBoot_c > dScBoot_c::StateID_WiiStrapDispEndWait
staticprivate

Waiting for key press to continue.

Definition at line 48 of file d_s_boot.hpp.

◆ StateID_WiiStrapFadeOut

sFStateID_c< dScBoot_c > dScBoot_c::StateID_WiiStrapFadeOut
staticprivate

The Wii strap screen is fading out.

Definition at line 49 of file d_s_boot.hpp.

◆ StateID_ControllerInformationFadeIn

sFStateID_c< dScBoot_c > dScBoot_c::StateID_ControllerInformationFadeIn
staticprivate

The controller information screen is fading in.

Definition at line 50 of file d_s_boot.hpp.

◆ StateID_ControllerInformationSoundWait

sFStateID_c< dScBoot_c > dScBoot_c::StateID_ControllerInformationSoundWait
staticprivate

Waiting for the scene sound to load.

Definition at line 51 of file d_s_boot.hpp.

◆ StateID_ControllerInformationKeyWait

sFStateID_c< dScBoot_c > dScBoot_c::StateID_ControllerInformationKeyWait
staticprivate

Forced delay before key press is accepted.

Definition at line 52 of file d_s_boot.hpp.

◆ StateID_ControllerInformationDispEndWait

sFStateID_c< dScBoot_c > dScBoot_c::StateID_ControllerInformationDispEndWait
staticprivate

Waiting for key press to continue.

Definition at line 53 of file d_s_boot.hpp.

◆ StateID_NandCommandEndWait

sFStateID_c< dScBoot_c > dScBoot_c::StateID_NandCommandEndWait
staticprivate

Waiting for the system to be ready for a NAND command.

Definition at line 54 of file d_s_boot.hpp.

◆ StateID_ExistFileCheck

sFStateID_c< dScBoot_c > dScBoot_c::StateID_ExistFileCheck
staticprivate

Checking for existing save data.

Definition at line 55 of file d_s_boot.hpp.

◆ StateID_NandSpaceCheck

sFStateID_c< dScBoot_c > dScBoot_c::StateID_NandSpaceCheck
staticprivate

Checking for sufficient NAND space for the save data.

Definition at line 56 of file d_s_boot.hpp.

◆ StateID_CreateFile

sFStateID_c< dScBoot_c > dScBoot_c::StateID_CreateFile
staticprivate

Creating new save data.

Definition at line 57 of file d_s_boot.hpp.

◆ StateID_Load

sFStateID_c< dScBoot_c > dScBoot_c::StateID_Load
staticprivate

Loading existing save data.

Definition at line 58 of file d_s_boot.hpp.

◆ StateID_GoToErrorFadeOut

sFStateID_c< dScBoot_c > dScBoot_c::StateID_GoToErrorFadeOut
staticprivate

Fading out to show an error message.

Definition at line 59 of file d_s_boot.hpp.

◆ StateID_GoToErrorFadeIn

sFStateID_c< dScBoot_c > dScBoot_c::StateID_GoToErrorFadeIn
staticprivate

Fading in the error message.

Definition at line 60 of file d_s_boot.hpp.

◆ StateID_NewSaveFileDisp

sFStateID_c< dScBoot_c > dScBoot_c::StateID_NewSaveFileDisp
staticprivate

Animating in the "new save data created" message.

Definition at line 61 of file d_s_boot.hpp.

◆ StateID_ButtonInputWait

sFStateID_c< dScBoot_c > dScBoot_c::StateID_ButtonInputWait
staticprivate

Waiting for button input after creating new save data.

Definition at line 62 of file d_s_boot.hpp.

◆ StateID_WindowExitWait

sFStateID_c< dScBoot_c > dScBoot_c::StateID_WindowExitWait
staticprivate

Waiting for the "save data created" window to close.

Definition at line 63 of file d_s_boot.hpp.

◆ StateID_ProcEnd

sFStateID_c< dScBoot_c > dScBoot_c::StateID_ProcEnd
staticprivate

Going to the title screen.

Definition at line 64 of file d_s_boot.hpp.

◆ StateID_ErrorWindowOnStageWait

sFStateID_c< dScBoot_c > dScBoot_c::StateID_ErrorWindowOnStageWait
staticprivate

Showing an error message.

Definition at line 65 of file d_s_boot.hpp.

◆ StateID_ErrorInfinityDisp

sFStateID_c< dScBoot_c > dScBoot_c::StateID_ErrorInfinityDisp
staticprivate

Showing an irrecoverable error message.

Definition at line 66 of file d_s_boot.hpp.

◆ mStateMgr

sFStateMgr_c<dScBoot_c, sStateMethodUsr_FI_c> dScBoot_c::mStateMgr
private

The main state manager for the boot scene.

Definition at line 68 of file d_s_boot.hpp.

◆ mResetStateMgr

sFStateMgr_c<dScBoot_c, sStateMethodUsr_FI_c> dScBoot_c::mResetStateMgr
private

The state manager for the ResetXXX states.

Definition at line 69 of file d_s_boot.hpp.

◆ mPad

u8 dScBoot_c::mPad
private

Definition at line 71 of file d_s_boot.hpp.

◆ mpWiiStrapScreen

dWiiStrapScreen_c* dScBoot_c::mpWiiStrapScreen

The Wii strap screen instance.

Definition at line 73 of file d_s_boot.hpp.

◆ mpYesNoWindow

dYesNoWindow_c* dScBoot_c::mpYesNoWindow

The yes/no window instance.

Definition at line 74 of file d_s_boot.hpp.

◆ mpSelectCursor

dSelectCursor_c* dScBoot_c::mpSelectCursor

The select cursor instance.

Definition at line 75 of file d_s_boot.hpp.

◆ mpControllerInformation

dControllerInformation_c* dScBoot_c::mpControllerInformation

The controller information instance.

Definition at line 76 of file d_s_boot.hpp.

◆ mNewSaveFileCreated

bool dScBoot_c::mNewSaveFileCreated
private

Whether new save data was created during boot.

Definition at line 79 of file d_s_boot.hpp.

◆ mResetFaderDone

bool dScBoot_c::mResetFaderDone
private

Whether the reset fade-out has completed.

Definition at line 80 of file d_s_boot.hpp.

◆ mSceneSoundLoaded

bool dScBoot_c::mSceneSoundLoaded

Whether the sound (for the button press) has finished loading.

Definition at line 82 of file d_s_boot.hpp.

◆ mIsResetting

bool dScBoot_c::mIsResetting
private

Whether the game is currently resetting.

Definition at line 84 of file d_s_boot.hpp.

◆ mResetFadeOutStarted

bool dScBoot_c::mResetFadeOutStarted
private

Whether the reset fade-out has started.

Definition at line 86 of file d_s_boot.hpp.

◆ mSaveDataCreatedMessageShown

bool dScBoot_c::mSaveDataCreatedMessageShown
private

Whether the "new save data created" message has been shown.

Definition at line 87 of file d_s_boot.hpp.

◆ mAutoAdvanceTimer

int dScBoot_c::mAutoAdvanceTimer
private

The number of frames after which the scene will automatically advance.

Definition at line 88 of file d_s_boot.hpp.

◆ mMinWaitTimer

int dScBoot_c::mMinWaitTimer
private

The minimum number of frames to wait before a button may be pressed to advance the scene.

Definition at line 89 of file d_s_boot.hpp.

◆ m_instance

dScBoot_c * dScBoot_c::m_instance
static

The singleton instance of the boot scene.

Definition at line 92 of file d_s_boot.hpp.