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;
}
if (input->data.buttons_d & Input::BUTTON_HOME) {
if (RunningFromMiiMaker()) {
return SUBSTATE_RETURN;
}
}
} else if (this->state == STATE_DO_SUBSTATE) {
auto retSubState = this->subState->update(input);

View File

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

View File

@ -1,5 +1,7 @@
#pragma once
#include <coreinit/title.h>
#define BACKGROUND_COLOR COLOR_BLACK
#define AROMA_DOWNLOAD_URL "https://aroma.foryour.cafe/"
@ -14,3 +16,9 @@
#define UPDATER_VERSION "v0.2.3"
#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 <rpxloader/rpxloader.h>
#include <sndcore2/core.h>
#include <sysapp/launch.h>
#include <whb/proc.h>
void main_loop() {
@ -34,12 +35,23 @@ void main_loop() {
baseInput.combine(wpadInput);
}
}
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();
}
}
bool gDeleteDefaultEnvironmentOnSuccess = false;
int main() {
initLogging();
@ -78,6 +90,9 @@ int main() {
IMDisableAPD();
}
if (RunningFromMiiMaker()) {
OSEnableHomeButtonMenu(false);
}
main_loop();
if (isAPDEnabled) {
@ -96,6 +111,9 @@ int main() {
DrawUtils::DeInit();
AXQuit();
WHBProcShutdown();
deinitLogging();