Add per-game return to for Devolution

This commit is contained in:
wiidev 2023-01-01 17:00:07 +00:00
parent ab94417c1f
commit 4406ae25bd
2 changed files with 24 additions and 3 deletions

View File

@ -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;

View File

@ -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)
{