System: Disallow booting when SBI files are missing

This commit is contained in:
Connor McLaughlin 2021-04-22 13:39:38 +10:00
parent 558978b7f2
commit fe1a582909
2 changed files with 24 additions and 8 deletions

View file

@ -1935,6 +1935,8 @@ bool CheckForSBIFile(CDImage* image)
Log_WarningPrintf("SBI file missing but required for %s (%s)", s_running_game_code.c_str(), Log_WarningPrintf("SBI file missing but required for %s (%s)", s_running_game_code.c_str(),
s_running_game_title.c_str()); s_running_game_title.c_str());
if (g_host_interface->GetBoolSettingValue("CDROM", "AllowBootingWithoutSBIFile", false))
{
return g_host_interface->ConfirmMessage( return g_host_interface->ConfirmMessage(
StringUtil::StdStringFromFormat( StringUtil::StdStringFromFormat(
g_host_interface->TranslateString( g_host_interface->TranslateString(
@ -1945,6 +1947,16 @@ bool CheckForSBIFile(CDImage* image)
s_running_game_code.c_str(), s_running_game_title.c_str()) s_running_game_code.c_str(), s_running_game_title.c_str())
.c_str()); .c_str());
} }
else
{
g_host_interface->ReportError(SmallString::FromFormat(
g_host_interface->TranslateString(
"System", "You are attempting to run a libcrypt protected game without an SBI file:\n\n%s: %s\n\nYour dump is "
"incomplete, you must add the SBI file to run this game."),
s_running_game_code.c_str(), s_running_game_title.c_str()));
return false;
}
}
bool HasMediaSubImages() bool HasMediaSubImages()
{ {

View file

@ -193,6 +193,9 @@ AdvancedSettingsWidget::AdvancedSettingsWidget(QtHostInterface* host_interface,
addBooleanTweakOption(m_host_interface, m_ui.tweakOptionTable, tr("Increase Timer Resolution"), "Main", addBooleanTweakOption(m_host_interface, m_ui.tweakOptionTable, tr("Increase Timer Resolution"), "Main",
"IncreaseTimerResolution", true); "IncreaseTimerResolution", true);
addBooleanTweakOption(m_host_interface, m_ui.tweakOptionTable, tr("Allow Booting Without SBI File"), "CDROM",
"AllowBootingWithoutSBIFile", false);
dialog->registerWidgetHelp(m_ui.logLevel, tr("Log Level"), tr("Information"), dialog->registerWidgetHelp(m_ui.logLevel, tr("Log Level"), tr("Information"),
tr("Sets the verbosity of messages logged. Higher levels will log more messages.")); tr("Sets the verbosity of messages logged. Higher levels will log more messages."));
dialog->registerWidgetHelp(m_ui.logToConsole, tr("Log To System Console"), tr("User Preference"), dialog->registerWidgetHelp(m_ui.logToConsole, tr("Log To System Console"), tr("User Preference"),
@ -231,4 +234,5 @@ void AdvancedSettingsWidget::onResetToDefaultClicked()
setIntRangeTweakOption(m_ui.tweakOptionTable, 17, static_cast<int>(Settings::DEFAULT_GPU_MAX_RUN_AHEAD)); setIntRangeTweakOption(m_ui.tweakOptionTable, 17, static_cast<int>(Settings::DEFAULT_GPU_MAX_RUN_AHEAD));
setBooleanTweakOption(m_ui.tweakOptionTable, 18, false); setBooleanTweakOption(m_ui.tweakOptionTable, 18, false);
setBooleanTweakOption(m_ui.tweakOptionTable, 19, true); setBooleanTweakOption(m_ui.tweakOptionTable, 19, true);
setBooleanTweakOption(m_ui.tweakOptionTable, 20, false);
} }