Merge pull request #3576 from lioncash/boot

BootManager: Minor changes
This commit is contained in:
Pierre Bourdon 2016-01-30 13:14:52 +01:00
commit 50221088a9
1 changed files with 92 additions and 82 deletions

View File

@ -20,6 +20,8 @@
// Includes // Includes
// ---------------- // ----------------
#include <algorithm>
#include <array>
#include <string> #include <string>
#include <vector> #include <vector>
@ -52,73 +54,80 @@ public:
// restore values to the configuration from the cache // restore values to the configuration from the cache
void RestoreConfig(SConfig* config); void RestoreConfig(SConfig* config);
// these store if the relevant setting should be reset back later (true) or if it should be left alone on restore (false) // These store if the relevant setting should be reset back later (true) or if it should be left alone on restore (false)
bool bSetEmulationSpeed, bSetEXIDevice[MAX_EXI_CHANNELS], bSetVolume, bSetPads[MAX_SI_CHANNELS], bSetWiimoteSource[MAX_BBMOTES], bSetFrameSkip; bool bSetEmulationSpeed;
bool bSetVolume;
bool bSetFrameSkip;
std::array<bool, MAX_BBMOTES> bSetWiimoteSource;
std::array<bool, MAX_SI_CHANNELS> bSetPads;
std::array<bool, MAX_EXI_CHANNELS> bSetEXIDevice;
private: private:
bool valid, bCPUThread, bSkipIdle, bSyncGPUOnSkipIdleHack, bFPRF, bAccurateNaNs, bMMU, bDCBZOFF, m_EnableJIT, bool valid;
bSyncGPU, bFastDiscSpeed, bDSPHLE, bHLE_BS2, bProgressive, bPAL60; bool bCPUThread;
bool bSkipIdle;
bool bSyncGPUOnSkipIdleHack;
bool bFPRF;
bool bAccurateNaNs;
bool bMMU;
bool bDCBZOFF;
bool m_EnableJIT;
bool bSyncGPU;
bool bFastDiscSpeed;
bool bDSPHLE;
bool bHLE_BS2;
bool bProgressive;
bool bPAL60;
int iSelectedLanguage; int iSelectedLanguage;
int iCPUCore, Volume; int iCPUCore;
int iWiimoteSource[MAX_BBMOTES]; int Volume;
SIDevices Pads[MAX_SI_CHANNELS];
unsigned int frameSkip; unsigned int frameSkip;
float m_EmulationSpeed; float m_EmulationSpeed;
TEXIDevices m_EXIDevice[MAX_EXI_CHANNELS]; std::string strBackend;
std::string strBackend, sBackend; std::string sBackend;
std::string m_strGPUDeterminismMode; std::string m_strGPUDeterminismMode;
std::array<int, MAX_BBMOTES> iWiimoteSource;
std::array<SIDevices, MAX_SI_CHANNELS> Pads;
std::array<TEXIDevices, MAX_EXI_CHANNELS> m_EXIDevice;
}; };
void ConfigCache::SaveConfig(const SConfig& config) void ConfigCache::SaveConfig(const SConfig& config)
{ {
valid = true; valid = true;
bCPUThread = config.bCPUThread; bCPUThread = config.bCPUThread;
bSkipIdle = config.bSkipIdle; bSkipIdle = config.bSkipIdle;
bSyncGPUOnSkipIdleHack = config.bSyncGPUOnSkipIdleHack; bSyncGPUOnSkipIdleHack = config.bSyncGPUOnSkipIdleHack;
bFPRF = config.bFPRF; bFPRF = config.bFPRF;
bAccurateNaNs = config.bAccurateNaNs; bAccurateNaNs = config.bAccurateNaNs;
bMMU = config.bMMU; bMMU = config.bMMU;
bDCBZOFF = config.bDCBZOFF; bDCBZOFF = config.bDCBZOFF;
m_EnableJIT = config.m_DSPEnableJIT; m_EnableJIT = config.m_DSPEnableJIT;
bSyncGPU = config.bSyncGPU; bSyncGPU = config.bSyncGPU;
bFastDiscSpeed = config.bFastDiscSpeed; bFastDiscSpeed = config.bFastDiscSpeed;
bDSPHLE = config.bDSPHLE; bDSPHLE = config.bDSPHLE;
bHLE_BS2 = config.bHLE_BS2; bHLE_BS2 = config.bHLE_BS2;
bProgressive = config.bProgressive; bProgressive = config.bProgressive;
bPAL60 = config.bPAL60; bPAL60 = config.bPAL60;
iSelectedLanguage = config.SelectedLanguage; iSelectedLanguage = config.SelectedLanguage;
iCPUCore = config.iCPUCore; iCPUCore = config.iCPUCore;
Volume = config.m_Volume; Volume = config.m_Volume;
m_EmulationSpeed = config.m_EmulationSpeed;
for (unsigned int i = 0; i < MAX_BBMOTES; ++i) frameSkip = config.m_FrameSkip;
{ strBackend = config.m_strVideoBackend;
iWiimoteSource[i] = g_wiimote_sources[i]; sBackend = config.sBackend;
}
for (unsigned int i = 0; i < MAX_SI_CHANNELS; ++i)
{
Pads[i] = config.m_SIDevice[i];
}
m_EmulationSpeed = config.m_EmulationSpeed;
frameSkip = config.m_FrameSkip;
for (unsigned int i = 0; i < MAX_EXI_CHANNELS; ++i)
{
m_EXIDevice[i] = config.m_EXIDevice[i];
}
strBackend = config.m_strVideoBackend;
sBackend = config.sBackend;
m_strGPUDeterminismMode = config.m_strGPUDeterminismMode; m_strGPUDeterminismMode = config.m_strGPUDeterminismMode;
std::copy(std::begin(g_wiimote_sources), std::end(g_wiimote_sources), std::begin(iWiimoteSource));
std::copy(std::begin(config.m_SIDevice), std::end(config.m_SIDevice), std::begin(Pads));
std::copy(std::begin(config.m_EXIDevice), std::end(config.m_EXIDevice), std::begin(m_EXIDevice));
bSetEmulationSpeed = false; bSetEmulationSpeed = false;
std::fill_n(bSetEXIDevice, (int)MAX_EXI_CHANNELS, false);
bSetVolume = false; bSetVolume = false;
std::fill_n(bSetPads, (int)MAX_SI_CHANNELS, false);
std::fill_n(bSetWiimoteSource, (int)MAX_BBMOTES, false);
bSetFrameSkip = false; bSetFrameSkip = false;
bSetWiimoteSource.fill(false);
bSetPads.fill(false);
bSetEXIDevice.fill(false);
} }
void ConfigCache::RestoreConfig(SConfig* config) void ConfigCache::RestoreConfig(SConfig* config)
@ -128,24 +137,25 @@ void ConfigCache::RestoreConfig(SConfig* config)
valid = false; valid = false;
config->bCPUThread = bCPUThread; config->bCPUThread = bCPUThread;
config->bSkipIdle = bSkipIdle; config->bSkipIdle = bSkipIdle;
config->bSyncGPUOnSkipIdleHack = bSyncGPUOnSkipIdleHack; config->bSyncGPUOnSkipIdleHack = bSyncGPUOnSkipIdleHack;
config->bFPRF = bFPRF; config->bFPRF = bFPRF;
config->bAccurateNaNs = bAccurateNaNs; config->bAccurateNaNs = bAccurateNaNs;
config->bMMU = bMMU; config->bMMU = bMMU;
config->bDCBZOFF = bDCBZOFF; config->bDCBZOFF = bDCBZOFF;
config->m_DSPEnableJIT = m_EnableJIT; config->m_DSPEnableJIT = m_EnableJIT;
config->bSyncGPU = bSyncGPU; config->bSyncGPU = bSyncGPU;
config->bFastDiscSpeed = bFastDiscSpeed; config->bFastDiscSpeed = bFastDiscSpeed;
config->bDSPHLE = bDSPHLE; config->bDSPHLE = bDSPHLE;
config->bHLE_BS2 = bHLE_BS2; config->bHLE_BS2 = bHLE_BS2;
config->bProgressive = bProgressive; config->bProgressive = bProgressive;
config->bPAL60 = bPAL60;
config->SelectedLanguage = iSelectedLanguage;
config->iCPUCore = iCPUCore;
config->m_SYSCONF->SetData("IPL.PGS", bProgressive); config->m_SYSCONF->SetData("IPL.PGS", bProgressive);
config->bPAL60 = bPAL60;
config->m_SYSCONF->SetData("IPL.E60", bPAL60); config->m_SYSCONF->SetData("IPL.E60", bPAL60);
config->SelectedLanguage = iSelectedLanguage;
config->iCPUCore = iCPUCore;
// Only change these back if they were actually set by game ini, since they can be changed while a game is running. // Only change these back if they were actually set by game ini, since they can be changed while a game is running.
if (bSetVolume) if (bSetVolume)
@ -308,14 +318,14 @@ bool BootCore(const std::string& _rFilename)
// Movie settings // Movie settings
if (Movie::IsPlayingInput() && Movie::IsConfigSaved()) if (Movie::IsPlayingInput() && Movie::IsConfigSaved())
{ {
StartUp.bCPUThread = Movie::IsDualCore(); StartUp.bCPUThread = Movie::IsDualCore();
StartUp.bSkipIdle = Movie::IsSkipIdle(); StartUp.bSkipIdle = Movie::IsSkipIdle();
StartUp.bDSPHLE = Movie::IsDSPHLE(); StartUp.bDSPHLE = Movie::IsDSPHLE();
StartUp.bProgressive = Movie::IsProgressive(); StartUp.bProgressive = Movie::IsProgressive();
StartUp.bPAL60 = Movie::IsPAL60(); StartUp.bPAL60 = Movie::IsPAL60();
StartUp.bFastDiscSpeed = Movie::IsFastDiscSpeed(); StartUp.bFastDiscSpeed = Movie::IsFastDiscSpeed();
StartUp.iCPUCore = Movie::GetCPUMode(); StartUp.iCPUCore = Movie::GetCPUMode();
StartUp.bSyncGPU = Movie::IsSyncGPU(); StartUp.bSyncGPU = Movie::IsSyncGPU();
for (int i = 0; i < 2; ++i) for (int i = 0; i < 2; ++i)
{ {
if (Movie::IsUsingMemcard(i) && Movie::IsStartingFromClearSave() && !StartUp.bWii) if (Movie::IsUsingMemcard(i) && Movie::IsStartingFromClearSave() && !StartUp.bWii)
@ -328,17 +338,17 @@ bool BootCore(const std::string& _rFilename)
if (NetPlay::IsNetPlayRunning()) if (NetPlay::IsNetPlayRunning())
{ {
StartUp.bCPUThread = g_NetPlaySettings.m_CPUthread; StartUp.bCPUThread = g_NetPlaySettings.m_CPUthread;
StartUp.bDSPHLE = g_NetPlaySettings.m_DSPHLE; StartUp.bDSPHLE = g_NetPlaySettings.m_DSPHLE;
StartUp.bEnableMemcardSdWriting = g_NetPlaySettings.m_WriteToMemcard; StartUp.bEnableMemcardSdWriting = g_NetPlaySettings.m_WriteToMemcard;
StartUp.iCPUCore = g_NetPlaySettings.m_CPUcore; StartUp.iCPUCore = g_NetPlaySettings.m_CPUcore;
StartUp.SelectedLanguage = g_NetPlaySettings.m_SelectedLanguage; StartUp.SelectedLanguage = g_NetPlaySettings.m_SelectedLanguage;
StartUp.bOverrideGCLanguage = g_NetPlaySettings.m_OverrideGCLanguage; StartUp.bOverrideGCLanguage = g_NetPlaySettings.m_OverrideGCLanguage;
StartUp.bProgressive = g_NetPlaySettings.m_ProgressiveScan; StartUp.bProgressive = g_NetPlaySettings.m_ProgressiveScan;
StartUp.bPAL60 = g_NetPlaySettings.m_PAL60; StartUp.bPAL60 = g_NetPlaySettings.m_PAL60;
SConfig::GetInstance().m_DSPEnableJIT = g_NetPlaySettings.m_DSPEnableJIT; SConfig::GetInstance().m_DSPEnableJIT = g_NetPlaySettings.m_DSPEnableJIT;
SConfig::GetInstance().m_OCEnable = g_NetPlaySettings.m_OCEnable; SConfig::GetInstance().m_OCEnable = g_NetPlaySettings.m_OCEnable;
SConfig::GetInstance().m_OCFactor = g_NetPlaySettings.m_OCFactor; SConfig::GetInstance().m_OCFactor = g_NetPlaySettings.m_OCFactor;
SConfig::GetInstance().m_EXIDevice[0] = g_NetPlaySettings.m_EXIDevice[0]; SConfig::GetInstance().m_EXIDevice[0] = g_NetPlaySettings.m_EXIDevice[0];
SConfig::GetInstance().m_EXIDevice[1] = g_NetPlaySettings.m_EXIDevice[1]; SConfig::GetInstance().m_EXIDevice[1] = g_NetPlaySettings.m_EXIDevice[1];
config_cache.bSetEXIDevice[0] = true; config_cache.bSetEXIDevice[0] = true;