1#include <game/bases/d_s_boot.hpp>
2#include <game/bases/d_system.hpp>
3#include <game/bases/d_game_com.hpp>
4#include <game/bases/d_graph.hpp>
6#include <game/bases/d_info.hpp>
7#include <game/bases/d_s_stage.hpp>
9#include <game/bases/d_reset.hpp>
10#include <game/bases/d_remocon_manager.hpp>
11#include <game/bases/d_dylink.hpp>
12#include <game/bases/d_hbm.hpp>
13#include <game/bases/d_fader.hpp>
14#include <game/bases/d_wipe_kuppa.hpp>
15#include <game/bases/d_wipe_dokan.hpp>
16#include <game/bases/d_wipe_mario.hpp>
17#include <game/bases/d_wipe_circle.hpp>
18#include <game/bases/d_nand_thread.hpp>
19#include <game/bases/d_s_restart_crsin.hpp>
20#include <game/bases/d_save_mng.hpp>
21#include <game/bases/d_WarningManager.hpp>
22#include <game/mLib/m_pad.hpp>
23#include <revolution/VI.h>
40 if (s_DBasesDMC.load_async()) {
48 if (s_EnemiesDMC.load_async()) {
56 if (s_En_BossDMC.load_async()) {
145 dWarningManager_c::CreateWarningManager();
146 dWarningManager_c::addWarningForbid();
151 dGraph_c::ms_Instance->mpPainterFunc = painter;
155sPhase_c::phaseMethod myCreate_PhaseMethod[] = {
158 myCreate_setPainterCallbackProc
162sPhase_c myCreate_InitPhase(myCreate_PhaseMethod, ARRAY_SIZE(myCreate_PhaseMethod));
166void *BootSound(
void *) {
172 s_dvdcb = mDvd_callback_c::createOrDie(BootSound,
nullptr);
177 if (!s_dvdcb->mDone) {
183 dAudio::loadSceneSnd();
189 if (dAudio::isLoadedSceneSnd()) {
205 const char *saveBannerPath =
"/EU/save_banner";
206 static const char saveBannerName[] =
"save_banner";
212const char *l_env_names[] = {
267 if (!dWarningManager_c::m_Created) {
300sPhase_c::phaseMethod myBackGround_PhaseMethod[] = {
301 myCreate_linkWaitProc,
302 dSystem::createFontManagerPhase,
303 dSystem::createMessageManagerPhase,
304 myCreate_CreateYesNoWindow,
305 myCreate_YesNoWindowReady,
306 myCreate_ExtensionMng,
307 myReadArc_ExtensionMng,
308 myReadArc_PhaseHbm_0,
309 myReadArc_MakeControllerInformation,
310 myCreate_ControllerInformationReady,
313 myReadArc_resSndWait,
314 myReadArc_SaveBanner,
316 myDylinkInitPhase_0a,
317 myDylinkInitPhase_0b,
318 myDylinkInitPhase_0c,
319 myDylinkInitPhase_2a,
320 myDylinkInitPhase_2b,
321 myDylinkInitPhase_2c,
322 myDylinkInitPhase_2d,
323 myDylinkInitPhase_2e,
324 myDylinkInitPhase_3a,
325 myDylinkInitPhase_3b,
331 myReadArc_WipeCircle,
332 dSystem::createEffectManagerPhase1
336sPhase_c myBackGround_Phase(myBackGround_PhaseMethod, ARRAY_SIZE(myBackGround_PhaseMethod));
377 dSys_c::setClearColor(nw4r::ut::Color::BLACK);
378 dSys_c::setFrameRate(1);
387 dScStage_c::setTitleReplayRandomTable();
388 dGameCom::initGame();
393 VIEnableDimming(
true);
399 dGraph_c::ms_Instance->mpPainterFunc =
nullptr;
408 dRemoconMng_c::dConnect_c::m_isBoot = 0;
419 dSystem::createEffectManagerPhase2(
nullptr);
433 myBackGround_Phase.callMethod(
this);
449void dScBoot_c::initializeState_ResetWait() {
454void dScBoot_c::executeState_ResetWait() {
462void dScBoot_c::finalizeState_ResetWait() {}
464void dScBoot_c::initializeState_ResetFadeOut() {
467 dFader_c::setFader(dFader_c::FADER_FADE);
472void dScBoot_c::executeState_ResetFadeOut() {
482 if (dWarningManager_c::m_instance->m_b00 >= 1) {
483 dWarningManager_c::m_instance->AllWarningEnd(
false);
487 finalizeState_ResetFadeIn();
501void dScBoot_c::finalizeState_ResetFadeOut() {
506 dWarningManager_c::m_instance->AllWarningEnd(
false);
520void dScBoot_c::initializeState_ResetFadeIn() {
522 dFader_c::setFader(dFader_c::FADER_FADE);
524 mpWiiStrap->mLayout.getAnmGroup(0).setAndUpdate(0.0f);
527void dScBoot_c::executeState_ResetFadeIn() {
533void dScBoot_c::finalizeState_ResetFadeIn() {
551void dScBoot_c::initializeState_FadeOutWait() {}
553void dScBoot_c::executeState_FadeOutWait() {
559void dScBoot_c::finalizeState_FadeOutWait() {}
563void dScBoot_c::initializeState_WiiStrapKeyWait() {
566 mpWiiStrap->mLayout.getAnmGroup(0).setAndUpdate(0.0f);
569void dScBoot_c::executeState_WiiStrapKeyWait() {
577void dScBoot_c::finalizeState_WiiStrapKeyWait() {}
579void dScBoot_c::initializeState_WiiStrapDispEndWait() {}
581void dScBoot_c::executeState_WiiStrapDispEndWait() {
584 WPAD_BUTTON_LEFT | WPAD_BUTTON_RIGHT | WPAD_BUTTON_DOWN | WPAD_BUTTON_UP |
585 WPAD_BUTTON_A | WPAD_BUTTON_B | WPAD_BUTTON_1 | WPAD_BUTTON_2 |
586 WPAD_BUTTON_PLUS | WPAD_BUTTON_MINUS |
587 WPAD_BUTTON_FS_Z | WPAD_BUTTON_FS_C
594void dScBoot_c::finalizeState_WiiStrapDispEndWait() {}
596void dScBoot_c::initializeState_WiiStrapFadeOut() {
598 dFader_c::setFader(dFader_c::FADER_FADE);
604void dScBoot_c::executeState_WiiStrapFadeOut() {
613void dScBoot_c::finalizeState_WiiStrapFadeOut() {
614 dWarningManager_c::m_instance->AllWarningEnd(
false);
617void dScBoot_c::initializeState_ControllerInformationFadeIn() {
618 dFader_c::setFader(dFader_c::FADER_FADE);
623void dScBoot_c::executeState_ControllerInformationFadeIn() {
629void dScBoot_c::finalizeState_ControllerInformationFadeIn() {
633 dWarningManager_c::subWarningForbid();
636void dScBoot_c::initializeState_ControllerInformationSoundWait() {
642void dScBoot_c::executeState_ControllerInformationSoundWait() {
654void dScBoot_c::finalizeState_ControllerInformationSoundWait() {}
656void dScBoot_c::initializeState_ControllerInformationKeyWait() {}
658void dScBoot_c::executeState_ControllerInformationKeyWait() {
669void dScBoot_c::finalizeState_ControllerInformationKeyWait() {}
671void dScBoot_c::initializeState_ControllerInformationDispEndWait() {}
673void dScBoot_c::executeState_ControllerInformationDispEndWait() {
678 WPAD_BUTTON_LEFT | WPAD_BUTTON_RIGHT | WPAD_BUTTON_DOWN | WPAD_BUTTON_UP |
679 WPAD_BUTTON_A | WPAD_BUTTON_B | WPAD_BUTTON_1 | WPAD_BUTTON_2 |
680 WPAD_BUTTON_PLUS | WPAD_BUTTON_MINUS |
681 WPAD_BUTTON_FS_Z | WPAD_BUTTON_FS_C
692void dScBoot_c::finalizeState_ControllerInformationDispEndWait() {}
694void dScBoot_c::initializeState_NandCommandEndWait() {}
696void dScBoot_c::executeState_NandCommandEndWait() {
697 if (dNandThread_c::m_instance->mState == 0) {
704void dScBoot_c::finalizeState_NandCommandEndWait() {}
706void dScBoot_c::initializeState_ExistFileCheck() {
709 dNandThread_c::m_instance->cmdExistCheck();
713void dScBoot_c::finalizeState_ExistFileCheck() {}
715void dScBoot_c::executeState_ExistFileCheck() {
716 if (dSaveMng_c::m_instance->isNandBusy()) {
719 if (dNandThread_c::m_instance->mError != 0) {
721 }
else if (dNandThread_c::m_instance->mFileExists) {
728void dScBoot_c::initializeState_NandSpaceCheck() {
729 dNandThread_c::m_instance->cmdSpaceCheck();
732void dScBoot_c::finalizeState_NandSpaceCheck() {}
734void dScBoot_c::executeState_NandSpaceCheck() {
735 if (dSaveMng_c::m_instance->isNandBusy()) {
738 if (dNandThread_c::m_instance->mError != 0) {
741 const char *save_icon =
"save_icon.bti";
742 const char *save_banner =
"save_banner";
749void dScBoot_c::initializeState_CreateFile() {
750 dSaveMng_c *saveMng = dSaveMng_c::m_instance;
757 saveMng->startNandSave();
760void dScBoot_c::executeState_CreateFile() {
761 if (dSaveMng_c::m_instance->isNandBusy()) {
764 if (dNandThread_c::m_instance->mError == 0) {
771void dScBoot_c::finalizeState_CreateFile() {}
773void dScBoot_c::initializeState_Load() {
774 dSaveMng_c::m_instance->startNandLoad();
777void dScBoot_c::executeState_Load() {
778 if (dSaveMng_c::m_instance->isNandBusy()) {
781 if (dNandThread_c::m_instance->mError != 0) {
790void dScBoot_c::finalizeState_Load() {}
792void dScBoot_c::initializeState_ProcEnd() {}
794void dScBoot_c::executeState_ProcEnd() {
798void dScBoot_c::finalizeState_ProcEnd() {}
800void dScBoot_c::initializeState_NewSaveFileDisp() {
805void dScBoot_c::executeState_NewSaveFileDisp() {
811void dScBoot_c::finalizeState_NewSaveFileDisp() {
815void dScBoot_c::initializeState_ButtonInputWait() {
819void dScBoot_c::executeState_ButtonInputWait() {
826void dScBoot_c::finalizeState_ButtonInputWait() {}
828void dScBoot_c::initializeState_WindowExitWait() {
832void dScBoot_c::executeState_WindowExitWait() {
841void dScBoot_c::finalizeState_WindowExitWait() {}
843void dScBoot_c::initializeState_GoToErrorFadeOut() {
845 dFader_c::setFader(dFader_c::FADER_FADE);
850void dScBoot_c::executeState_GoToErrorFadeOut() {
858void dScBoot_c::finalizeState_GoToErrorFadeOut() {}
860void dScBoot_c::initializeState_GoToErrorFadeIn() {
861 dFader_c::setFader(dFader_c::FADER_FADE);
865void dScBoot_c::executeState_GoToErrorFadeIn() {
878void dScBoot_c::finalizeState_GoToErrorFadeIn() {
882void dScBoot_c::initializeState_ErrorWindowOnStageWait() {
883 dWarningManager_c::m_instance->setError(dNandThread_c::m_instance->mError);
886void dScBoot_c::executeState_ErrorWindowOnStageWait() {
887 dWarningManager_c *warningMgr = dWarningManager_c::m_instance;
889 if (warningMgr->mErrorID == 6) {
890 if (!warningMgr->m_b09) {
894 }
else if (!dWarningManager_c::isWarningInline()) {
900void dScBoot_c::finalizeState_ErrorWindowOnStageWait() {}
902void dScBoot_c::initializeState_ErrorInfinityDisp() {}
904void dScBoot_c::executeState_ErrorInfinityDisp() {}
906void dScBoot_c::finalizeState_ErrorInfinityDisp() {}
Constructs a new DynamicModuleControl.
static bool startFadeOut(u16 duration)
Starts a fade out with the current fader.
static bool startFadeIn(u16 duration)
Starts a fade in with the current fader.
static dHbm::Manage_c * GetInstance()
Gets a pointer to the instance of this class.
static unsigned int mGameFlag
See GAME_FLAG_e.
@ GAME_FLAG_AUTO_SKIP
Whether to automatically skip the Wii strap and controller information screens.
void initialize()
Initializes the slot data.
A higher-level archive resource management class.
static dResMng_c * m_instance
The instance of this class.
static dReset::Manage_c * GetInstance()
Gets a pointer to the instance of this class.
This scene handles the game's boot process. It does the following:
dSelectCursor_c * mpSelectCursor
The select cursor instance.
virtual int create()
do method for the create operation.
sFStateMgr_c< dScBoot_c, sStateMethodUsr_FI_c > mResetStateMgr
The state manager for the ResetXXX states.
virtual void deleteReady()
Informs the base that it's about to be deleted.
virtual int doDelete()
do method for the delete operation.
bool mSceneSoundLoaded
Whether the sound (for the button press) has finished loading.
static sFStateID_c< dScBoot_c > StateID_WiiStrapFadeOut
The Wii strap screen is fading out.
static sFStateID_c< dScBoot_c > StateID_GoToErrorFadeIn
Fading in the error message.
static sFStateID_c< dScBoot_c > StateID_ButtonInputWait
Waiting for button input after creating new save data.
dScBoot_c()
Creates a new scene.
static sFStateID_c< dScBoot_c > StateID_ResetFadeOut
Fading out the game for the reset.
static sFStateID_c< dScBoot_c > StateID_ExistFileCheck
Checking for existing save data.
static sFStateID_c< dScBoot_c > StateID_CreateFile
Creating new save data.
static sFStateID_c< dScBoot_c > StateID_ControllerInformationSoundWait
Waiting for the scene sound to load.
dYesNoWindow_c * mpYesNoWindow
The yes/no window instance.
static sFStateID_c< dScBoot_c > StateID_ResetFadeIn
Fading back in after the reset.
bool mResetFaderDone
Whether the reset fade-out has completed.
int mAutoAdvanceTimer
The number of frames after which the scene will automatically advance.
dControllerInformation_c * mpControllerInformation
The controller information instance.
static sFStateID_c< dScBoot_c > StateID_FadeOutWait
Waiting for fade out to complete.
static sFStateID_c< dScBoot_c > StateID_ControllerInformationKeyWait
Forced delay before key press is accepted.
static sFStateID_c< dScBoot_c > StateID_WiiStrapDispEndWait
Waiting for key press to continue.
static sFStateID_c< dScBoot_c > StateID_ResetWait
Waiting for a reset event.
bool mNewSaveFileCreated
Whether new save data was created during boot.
bool mSaveDataCreatedMessageShown
Whether the "new save data created" message has been shown.
static sFStateID_c< dScBoot_c > StateID_GoToErrorFadeOut
Fading out to show an error message.
static sFStateID_c< dScBoot_c > StateID_ErrorInfinityDisp
Showing an irrecoverable error message.
dWiiStrap_c * mpWiiStrap
The Wii strap screen instance.
virtual int preExecute()
pre method for the execute operation.
int mMinWaitTimer
The minimum number of frames to wait before a button may be pressed to advance the scene.
virtual int draw()
do method for the draw operation.
virtual ~dScBoot_c()
Destroys the scene.
static sFStateID_c< dScBoot_c > StateID_ErrorWindowOnStageWait
Showing an error message.
static sFStateID_c< dScBoot_c > StateID_Load
Loading existing save data.
bool mResetFadeOutStarted
Whether the reset fade-out has started.
static sFStateID_c< dScBoot_c > StateID_NandSpaceCheck
Checking for sufficient NAND space for the save data.
virtual int execute()
do method for the execute operation.
static sFStateID_c< dScBoot_c > StateID_NewSaveFileDisp
Animating in the "new save data created" message.
static sFStateID_c< dScBoot_c > StateID_WiiStrapKeyWait
Forced delay before key press is accepted.
static sFStateID_c< dScBoot_c > StateID_ControllerInformationFadeIn
The controller information screen is fading in.
static dScBoot_c * m_instance
The singleton instance of the boot scene.
sFStateMgr_c< dScBoot_c, sStateMethodUsr_FI_c > mStateMgr
The main state manager for the boot scene.
bool mIsResetting
Whether the game is currently resetting.
static sFStateID_c< dScBoot_c > StateID_ControllerInformationDispEndWait
Waiting for key press to continue.
static sFStateID_c< dScBoot_c > StateID_ProcEnd
Going to the title screen.
static sFStateID_c< dScBoot_c > StateID_WindowExitWait
Waiting for the "save data created" window to close.
static sFStateID_c< dScBoot_c > StateID_NandCommandEndWait
Waiting for the system to be ready for a NAND command.
static void startTitle(u8 isReplay, bool forceChange)
Starts the title screen stage or a title replay.
virtual int preExecute()
pre method for the execute operation.
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 bool m_isAutoFadeIn
If a fade-in should automatically be performed on scene load.
sPhase_c * mpPhase
The phase used for scene initialization.
Manages the animated L-shaped corner rectangles around selected buttons.
void Cancel(int layoutId)
Deactivates and hides the specified cursor layout.
bool mHasLoadedLayout
Whether the layout has been loaded.
static dSelectCursor_c * m_instance
The static instance of the selection cursor manager.
Displays the Wii Strap safety warning screen.
LytBase_c mLayout
The layout for the screen.
bool mHasLoadedLayout
Whether the layout has been loaded.
static dWipeCircle_c * m_instance
The instance of the fader.
static dWipeDokan_c * m_instance
The instance of the fader.
static dWipeKuppa_c * m_instance
The instance of the fader.
static dWipeMario_c * m_instance
The instance of the fader.
Displays a confirmation prompt.
bool mIsActive
Whether the window is currently open.
bool mHasLoadedLayout
Whether the layout has been loaded.
static fBase_c * createChild(ProfileName profName, fBase_c *parent, unsigned long param, u8 groupType)
Creates a child base under the given parent.
@ NOT_READY
The step could not completed at this time.
@ SUCCEEDED
The step was completed successfully.
@ HIDDEN
The screen is completely unblocked.
@ OPAQUE
The screen is completely blacked out.
static bool isStatus(mFaderBase_c::EStatus status)
Checks if the current fader's status matches status .
A phase is a list of methods to be called in order.
METHOD_RESULT_e
Return value of a phase method and callMethod().
@ OK
Proceed to the next method in the phase.
@ WAIT
Do not proceed to the next method in the phase.
#define SAVE_SLOT_COUNT
The total save slot count.
#define BASE_PROFILE(profName, className)
Creates a basic profile, using the profile number as the execute and draw order value.
@ CONTROLLER_INFORMATION
The profile for dControllerInformation_c.
@ YES_NO_WINDOW
The profile for dYesNoWindow_c.
void draw()
Draws all registered 2D objects.
int LinkASync(ProfileName profile)
Links the module associated with the given profile.
bool Unlink(ProfileName profile)
Unlinks the module associated with the given profile.
void initRandomSeed()
Initializes the random seed used for randomness.
#define STATE_DEFINE(class, name)
Defines a state.