Fix exiting in Tiramisu

This commit is contained in:
Maschell 2024-05-06 14:48:51 +02:00
parent ce617aeb67
commit c3b06522b0
4 changed files with 35 additions and 3 deletions

View File

@ -64,6 +64,11 @@ ApplicationState::eSubState MainApplicationState::update(Input *input) {
} }
this->selectedOptionY = 0; this->selectedOptionY = 0;
} }
if (input->data.buttons_d & Input::BUTTON_HOME) {
if (RunningFromMiiMaker()) {
return SUBSTATE_RETURN;
}
}
} else if (this->state == STATE_DO_SUBSTATE) { } else if (this->state == STATE_DO_SUBSTATE) {
auto retSubState = this->subState->update(input); auto retSubState = this->subState->update(input);

View File

@ -23,6 +23,7 @@ ApplicationState::eSubState UpdaterState::UpdateCheckEnvironmentDirectory(Input
} }
if (this->mCurEnvironmentPath == DEFAULT_TIRAMISU_ENVIRONMENT_SD_PATH) { if (this->mCurEnvironmentPath == DEFAULT_TIRAMISU_ENVIRONMENT_SD_PATH) {
gDeleteDefaultEnvironmentOnSuccess = true;
mCurEnvironmentPath = DEFAULT_AROMA_ENVIRONMENT_SD_PATH; mCurEnvironmentPath = DEFAULT_AROMA_ENVIRONMENT_SD_PATH;
this->mState = STATE_CHECK_VERSIONS; this->mState = STATE_CHECK_VERSIONS;
return SUBSTATE_RUNNING; return SUBSTATE_RUNNING;

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
#include <coreinit/title.h>
#define BACKGROUND_COLOR COLOR_BLACK #define BACKGROUND_COLOR COLOR_BLACK
#define AROMA_DOWNLOAD_URL "https://aroma.foryour.cafe/" #define AROMA_DOWNLOAD_URL "https://aroma.foryour.cafe/"
@ -14,3 +16,9 @@
#define UPDATER_VERSION "v0.2.3" #define UPDATER_VERSION "v0.2.3"
#define UPDATER_VERSION_FULL UPDATER_VERSION UPDATER_VERSION_EXTRA #define UPDATER_VERSION_FULL UPDATER_VERSION UPDATER_VERSION_EXTRA
inline bool RunningFromMiiMaker() {
return (OSGetTitleID() & 0xFFFFFFFFFFFFF0FFull) == 0x000500101004A000ull;
}
extern bool gDeleteDefaultEnvironmentOnSuccess;

View File

@ -10,6 +10,7 @@
#include <mocha/mocha.h> #include <mocha/mocha.h>
#include <rpxloader/rpxloader.h> #include <rpxloader/rpxloader.h>
#include <sndcore2/core.h> #include <sndcore2/core.h>
#include <sysapp/launch.h>
#include <whb/proc.h> #include <whb/proc.h>
void main_loop() { void main_loop() {
@ -34,12 +35,23 @@ void main_loop() {
baseInput.combine(wpadInput); baseInput.combine(wpadInput);
} }
} }
baseInput.process(); baseInput.process();
state->update(&baseInput); if (state->update(&baseInput) == ApplicationState::SUBSTATE_RETURN) {
if (RunningFromMiiMaker()) {
// legacy way, just quit
break;
} else {
// launch menu otherwise
SYSLaunchMenu();
}
}
state->render(); state->render();
} }
} }
bool gDeleteDefaultEnvironmentOnSuccess = false;
int main() { int main() {
initLogging(); initLogging();
@ -78,6 +90,9 @@ int main() {
IMDisableAPD(); IMDisableAPD();
} }
if (RunningFromMiiMaker()) {
OSEnableHomeButtonMenu(false);
}
main_loop(); main_loop();
if (isAPDEnabled) { if (isAPDEnabled) {
@ -96,6 +111,9 @@ int main() {
DrawUtils::DeInit(); DrawUtils::DeInit();
AXQuit(); AXQuit();
WHBProcShutdown();
deinitLogging(); deinitLogging();