add back in boot default iso behavior

This commit is contained in:
R2DLiu 2020-12-26 23:32:58 -05:00
commit 23aee0ebe0
8 changed files with 25 additions and 33 deletions

View file

@ -76,6 +76,7 @@ private:
bool bCPUThread;
bool bJITFollowBranch;
bool bEnableCheats;
bool bBootDefaultISO;
bool bSyncGPUOnSkipIdleHack;
bool bFPRF;
bool bAccurateNaNs;
@ -110,6 +111,7 @@ void ConfigCache::SaveConfig(const SConfig& config)
bCPUThread = config.bCPUThread;
bJITFollowBranch = config.bJITFollowBranch;
bEnableCheats = config.bEnableCheats;
bBootDefaultISO = config.bBootDefaultISO;
bSyncGPUOnSkipIdleHack = config.bSyncGPUOnSkipIdleHack;
bFPRF = config.bFPRF;
bAccurateNaNs = config.bAccurateNaNs;
@ -155,6 +157,7 @@ void ConfigCache::RestoreConfig(SConfig* config)
config->bCPUThread = bCPUThread;
config->bJITFollowBranch = bJITFollowBranch;
config->bEnableCheats = bEnableCheats;
config->bBootDefaultISO = bBootDefaultISO;
config->bSyncGPUOnSkipIdleHack = bSyncGPUOnSkipIdleHack;
config->bFPRF = bFPRF;
config->bAccurateNaNs = bAccurateNaNs;
@ -265,6 +268,7 @@ bool BootCore(std::unique_ptr<BootParameters> boot, const WindowSystemInfo& wsi)
core_section->Get("CPUThread", &StartUp.bCPUThread, StartUp.bCPUThread);
core_section->Get("JITFollowBranch", &StartUp.bJITFollowBranch, StartUp.bJITFollowBranch);
core_section->Get("EnableCheats", &StartUp.bEnableCheats, StartUp.bEnableCheats);
core_section->Get("BootDefaultISO", &StartUp.bBootDefaultISO, StartUp.bBootDefaultISO);
core_section->Get("SyncOnSkipIdle", &StartUp.bSyncGPUOnSkipIdleHack,
StartUp.bSyncGPUOnSkipIdleHack);
core_section->Get("FPRF", &StartUp.bFPRF, StartUp.bFPRF);

View file

@ -213,6 +213,7 @@ void SConfig::SaveCoreSettings(IniFile& ini)
core->Set("FPRF", bFPRF);
core->Set("AccurateNaNs", bAccurateNaNs);
core->Set("EnableCheats", bEnableCheats);
core->Set("BootDefaultISO", bBootDefaultISO);
core->Set("SelectedLanguage", SelectedLanguage);
core->Set("OverrideRegionSettings", bOverrideRegionSettings);
core->Set("DPL2Decoder", bDPL2Decoder);
@ -482,6 +483,7 @@ void SConfig::LoadCoreSettings(IniFile& ini)
core->Get("CPUThread", &bCPUThread, true);
core->Get("SyncOnSkipIdle", &bSyncGPUOnSkipIdleHack, true);
core->Get("EnableCheats", &bEnableCheats, true);
core->Get("BootDefaultISO", &bBootDefaultISO, true);
core->Get("SelectedLanguage", &SelectedLanguage, 0);
core->Get("OverrideRegionSettings", &bOverrideRegionSettings, false);
core->Get("DPL2Decoder", &bDPL2Decoder, false);

View file

@ -118,6 +118,7 @@ struct SConfig
bool bSyncGPUOnSkipIdleHack = true;
bool bHLE_BS2 = true;
bool bEnableCheats = false;
bool bBootDefaultISO = true;
bool bEnableMemcardSdWriting = true;
bool bCopyWiiSaveNetplay = true;
@ -155,7 +156,7 @@ struct SConfig
bool m_slippiSaveReplays = true;
bool m_slippiReplayMonthFolders = false;
std::string m_strSlippiReplayDir;
bool bBootDefaultISO = false; //move maybe
bool m_blockingPipes = false;
// Interface settings
bool bConfirmStop = false;

View file

@ -197,7 +197,6 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine
save_state_path = static_cast<const char*>(options.get("save_state"));
}
// for now, only initialize the server for non playback instances
#ifndef IS_PLAYBACK
SlippiSpectateServer::getInstance().endGame();
#endif
@ -256,43 +255,16 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine
}
else
{
DolphinAnalytics::Instance().ReportDolphinStart("qt");
if (Settings::Instance().IsBootDefaultISO() && !Settings::Instance().GetDefaultGame().isEmpty())
{
boot = BootParameters::GenerateFromFile(Settings::Instance().GetDefaultGame().toStdString(), save_state_path);
}
MainWindow win{std::move(boot), static_cast<const char*>(options.get("movie"))};
if (options.is_set("debugger"))
Settings::Instance().SetDebugModeEnabled(true);
win.Show();
#if defined(USE_ANALYTICS) && USE_ANALYTICS
if (!Config::Get(Config::MAIN_ANALYTICS_PERMISSION_ASKED))
{
ModalMessageBox analytics_prompt(&win);
analytics_prompt.setIcon(QMessageBox::Question);
analytics_prompt.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
analytics_prompt.setWindowTitle(QObject::tr("Allow Usage Statistics Reporting"));
analytics_prompt.setText(
QObject::tr("Do you authorize Dolphin to report information to Dolphin's developers?"));
analytics_prompt.setInformativeText(
QObject::tr("If authorized, Dolphin can collect data on its performance, "
"feature usage, and configuration, as well as data on your system's "
"hardware and operating system.\n\n"
"No private data is ever collected. This data helps us understand "
"how people and emulated games use Dolphin and prioritize our "
"efforts. It also helps us identify rare configurations that are "
"causing bugs, performance and stability issues.\n"
"This authorization can be revoked at any time through Dolphin's "
"settings."));
const int answer = analytics_prompt.exec();
Config::SetBase(Config::MAIN_ANALYTICS_PERMISSION_ASKED, true);
Settings::Instance().SetAnalyticsEnabled(answer == QMessageBox::Yes);
DolphinAnalytics::Instance().ReloadConfig();
}
#endif
if (!Settings::Instance().IsBatchModeEnabled())
{
auto* updater = new Updater(&win);

View file

@ -592,6 +592,11 @@ void Settings::SetSlippiSeekbarEnabled(bool enabled)
SConfig::GetInstance().m_slippiEnableSeek = enabled;
}
bool Settings::IsBootDefaultISO() const
{
return SConfig::GetInstance().bBootDefaultISO;
}
bool Settings::IsSDCardInserted() const
{
return SConfig::GetInstance().m_WiiSDCard;

View file

@ -95,6 +95,7 @@ public:
void SetSDCardInserted(bool inserted);
bool IsUSBKeyboardConnected() const;
void SetUSBKeyboardConnected(bool connected);
bool IsBootDefaultISO() const;
// Graphics
void SetHideCursor(bool hide_cursor);

View file

@ -95,6 +95,7 @@ void GeneralPane::ConnectLayout()
{
connect(m_checkbox_dualcore, &QCheckBox::toggled, this, &GeneralPane::OnSaveConfig);
connect(m_checkbox_cheats, &QCheckBox::toggled, this, &GeneralPane::OnSaveConfig);
connect(m_checkbox_default_boot_iso, &QCheckBox::toggled, this, &GeneralPane::OnSaveConfig);
connect(m_checkbox_override_region_settings, &QCheckBox::stateChanged, this,
&GeneralPane::OnSaveConfig);
connect(m_checkbox_auto_disc_change, &QCheckBox::toggled, this, &GeneralPane::OnSaveConfig);
@ -139,6 +140,9 @@ void GeneralPane::CreateBasic()
m_checkbox_cheats = new QCheckBox(tr("Enable Cheats"));
basic_group_layout->addWidget(m_checkbox_cheats);
m_checkbox_default_boot_iso = new QCheckBox(tr("Start Default ISO at launch"));
basic_group_layout->addWidget(m_checkbox_default_boot_iso);
m_checkbox_override_region_settings = new QCheckBox(tr("Allow Mismatched Region Settings"));
basic_group_layout->addWidget(m_checkbox_override_region_settings);
@ -254,6 +258,7 @@ void GeneralPane::LoadConfig()
#endif
m_checkbox_dualcore->setChecked(SConfig::GetInstance().bCPUThread);
m_checkbox_cheats->setChecked(Settings::Instance().GetCheatsEnabled());
m_checkbox_default_boot_iso->setChecked(SConfig::GetInstance().bBootDefaultISO);
m_checkbox_override_region_settings->setChecked(SConfig::GetInstance().bOverrideRegionSettings);
m_checkbox_auto_disc_change->setChecked(Config::Get(Config::MAIN_AUTO_DISC_CHANGE));
#ifdef USE_DISCORD_PRESENCE
@ -348,6 +353,7 @@ void GeneralPane::OnSaveConfig()
settings.bCPUThread = m_checkbox_dualcore->isChecked();
Config::SetBaseOrCurrent(Config::MAIN_CPU_THREAD, m_checkbox_dualcore->isChecked());
Settings::Instance().SetCheatsEnabled(m_checkbox_cheats->isChecked());
settings.bBootDefaultISO = m_checkbox_default_boot_iso->isChecked();
settings.bOverrideRegionSettings = m_checkbox_override_region_settings->isChecked();
Config::SetBaseOrCurrent(Config::MAIN_OVERRIDE_REGION_SETTINGS,
m_checkbox_override_region_settings->isChecked());

View file

@ -43,6 +43,7 @@ private:
QComboBox* m_combobox_fallback_region;
QCheckBox* m_checkbox_dualcore;
QCheckBox* m_checkbox_cheats;
QCheckBox* m_checkbox_default_boot_iso;
QCheckBox* m_checkbox_override_region_settings;
QCheckBox* m_checkbox_auto_disc_change;
#ifdef USE_DISCORD_PRESENCE