From 4406ae25bd2fe93380e372fed93fdf8fea3a53e3 Mon Sep 17 00:00:00 2001 From: wiidev Date: Sun, 1 Jan 2023 17:00:07 +0000 Subject: [PATCH] Add per-game return to for Devolution --- source/settings/menus/GCGameLoadSM.cpp | 25 +++++++++++++++++++++++-- source/usbloader/GameBooter.cpp | 2 +- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/source/settings/menus/GCGameLoadSM.cpp b/source/settings/menus/GCGameLoadSM.cpp index 5d727195..151cc782 100644 --- a/source/settings/menus/GCGameLoadSM.cpp +++ b/source/settings/menus/GCGameLoadSM.cpp @@ -228,6 +228,7 @@ void GCGameLoadSM::SetOptionNames() Options->SetName(Idx++, "%s", tr( "Crop Overscan" )); Options->SetName(Idx++, "%s", tr( "Disc Read Delay" )); Options->SetName(Idx++, "%s", tr( "Progressive Patch" )); + Options->SetName(Idx++, "%s", tr( "Return To" )); } } @@ -557,12 +558,26 @@ void GCGameLoadSM::SetOptionValues() else Options->SetValue(Idx++, "%s", tr(OnOffText[GameConfig.DEVODiscDelay])); - //! Settings: DML + NIN + Devo Progressive Patch + //! Settings: DML + NIN + DEVO Progressive Patch if(GameConfig.DMLProgPatch == INHERIT) Options->SetValue(Idx++, tr("Use global")); else Options->SetValue(Idx++, "%s", tr(OnOffText[GameConfig.DMLProgPatch])); - + + //! Settings: DEVO Return To + if(GameConfig.returnTo) + { + const char* TitleName = NULL; + u64 tid = NandTitles.FindU32(Settings.returnTo); + if (tid > 0) + TitleName = NandTitles.NameOf(tid); + Options->SetValue(Idx++, "%s", TitleName ? TitleName : strlen(Settings.returnTo) > 0 ? + Settings.returnTo : tr( OnOffText[0] )); + } + else + { + Options->SetValue(Idx++, "%s", tr( OnOffText[0] )); + } } } @@ -963,6 +978,12 @@ int GCGameLoadSM::GetMenuInternal() if (++GameConfig.DMLProgPatch >= MAX_ON_OFF) GameConfig.DMLProgPatch = INHERIT; } + //! Settings: DEVO Return To + else if (currentGCmode == GC_MODE_DEVOLUTION && ret == ++Idx) + { + if (++GameConfig.returnTo >= MAX_ON_OFF) GameConfig.returnTo = 0; + } + SetOptionValues(); return MENU_NONE; diff --git a/source/usbloader/GameBooter.cpp b/source/usbloader/GameBooter.cpp index fac2f28f..43f8030f 100644 --- a/source/usbloader/GameBooter.cpp +++ b/source/usbloader/GameBooter.cpp @@ -820,7 +820,7 @@ int GameBooter::BootDevolution(struct discHdr *gameHdr) u8 devoDButtonsChoice = game_cfg->DEVODButtons == INHERIT ? Settings.DEVODButtons : game_cfg->DEVODButtons; u8 devoCropOverscanChoice = game_cfg->DEVOCropOverscan == INHERIT ? Settings.DEVOCropOverscan : game_cfg->DEVOCropOverscan; u8 devoDiscDelayChoice = game_cfg->DEVODiscDelay == INHERIT ? Settings.DEVODiscDelay : game_cfg->DEVODiscDelay; - u64 returnToChoice = strlen(Settings.returnTo) > 0 ? NandTitles.FindU32(Settings.returnTo) : 0; + u64 returnToChoice = strlen(Settings.returnTo) > 0 ? (game_cfg->returnTo ? NandTitles.FindU32(Settings.returnTo) : 0) : 0; if(gameHdr->type == TYPE_GAME_GC_DISC) {