From b50185f8aacddc1e157d4bdd782cd5b0e49a617d Mon Sep 17 00:00:00 2001 From: Maschell Date: Mon, 11 Oct 2021 22:15:23 +0200 Subject: [PATCH] Display a proper error message when no disc is inserted --- source/ApplicationState.cpp | 8 +++++++- source/ApplicationState.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/source/ApplicationState.cpp b/source/ApplicationState.cpp index f5393cd..c43fc4a 100644 --- a/source/ApplicationState.cpp +++ b/source/ApplicationState.cpp @@ -172,6 +172,8 @@ void ApplicationState::render() { WiiUScreen::drawLinef("Dumping done! Press A to continue"); } else if (this->state == STATE_DUMP_APP_FILES_DONE) { WiiUScreen::drawLinef("Dumping done! Press A to continue"); + } else if (this->state == STATE_PLEASE_INSERT_DISC) { + WiiUScreen::drawLinef("Please insert a Disc. Press A to continue"); } printFooter(); WiiUScreen::flipBuffers(); @@ -245,7 +247,7 @@ void ApplicationState::update(Input *input) { } DEBUG_FUNCTION_LINE("STATE_OPEN_ODD1"); if (this->retryCount-- <= 0) { - this->setError(ERROR_OPEN_ODD1); + this->state = STATE_PLEASE_INSERT_DISC; return; } auto ret = IOSUHAX_FSA_RawOpen(gFSAfd, "/dev/odd01", &(this->oddFd)); @@ -474,6 +476,10 @@ void ApplicationState::update(Input *input) { this->writtenSector = 0; return; } + } else if (this->state == STATE_PLEASE_INSERT_DISC){ + if (entrySelected(input)) { + this->state = STATE_WELCOME_SCREEN; + } } } diff --git a/source/ApplicationState.h b/source/ApplicationState.h index 54f0b1d..e25baec 100644 --- a/source/ApplicationState.h +++ b/source/ApplicationState.h @@ -54,6 +54,7 @@ public: STATE_WELCOME_SCREEN, STATE_CHOOSE_TARGET, STATE_OPEN_ODD1, + STATE_PLEASE_INSERT_DISC, STATE_DUMP_APP_FILES, STATE_DUMP_APP_FILES_DONE, STATE_READ_DISC_INFO,