Skip to content

Commit

Permalink
Merge pull request #2594 from degasus/master
Browse files Browse the repository at this point in the history
Options: merge SCoreStartupParameter into SConfig
  • Loading branch information
degasus committed Jun 12, 2015
2 parents 5ae1c07 + c375111 commit 740e344
Show file tree
Hide file tree
Showing 116 changed files with 1,233 additions and 1,306 deletions.
4 changes: 2 additions & 2 deletions Source/Core/AudioCommon/OpenALStream.cpp
Expand Up @@ -129,7 +129,7 @@ void OpenALStream::SoundLoop()
{
Common::SetCurrentThreadName("Audio thread - openal");

bool surround_capable = SConfig::GetInstance().m_LocalCoreStartupParameter.bDPL2Decoder;
bool surround_capable = SConfig::GetInstance().bDPL2Decoder;
#if defined(__APPLE__)
bool float32_capable = false;
const ALenum AL_FORMAT_STEREO_FLOAT32 = 0;
Expand All @@ -141,7 +141,7 @@ void OpenALStream::SoundLoop()
#endif

u32 ulFrequency = m_mixer->GetSampleRate();
numBuffers = SConfig::GetInstance().m_LocalCoreStartupParameter.iLatency + 2; // OpenAL requires a minimum of two buffers
numBuffers = SConfig::GetInstance().iLatency + 2; // OpenAL requires a minimum of two buffers

memset(uiBuffers, 0, numBuffers * sizeof(ALuint));
uiSource = 0;
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/AudioCommon/PulseAudioStream.cpp
Expand Up @@ -21,7 +21,7 @@ PulseAudio::PulseAudio()

bool PulseAudio::Start()
{
m_stereo = !SConfig::GetInstance().m_LocalCoreStartupParameter.bDPL2Decoder;
m_stereo = !SConfig::GetInstance().bDPL2Decoder;
m_channels = m_stereo ? 2 : 5; // will tell PA we use a Stereo or 5.0 channel setup

NOTICE_LOG(AUDIO, "PulseAudio backend using %d channels", m_channels);
Expand Down
10 changes: 5 additions & 5 deletions Source/Core/Core/ActionReplay.cpp
Expand Up @@ -105,7 +105,7 @@ struct ARAddr
void LoadCodes(const IniFile& globalIni, const IniFile& localIni, bool forceLoad)
{
// Parses the Action Replay section of a game ini file.
if (!SConfig::GetInstance().m_LocalCoreStartupParameter.bEnableCheats &&
if (!SConfig::GetInstance().bEnableCheats &&
!forceLoad)
return;

Expand Down Expand Up @@ -276,16 +276,16 @@ void SetARCode_IsActive(bool active, size_t index)

void UpdateActiveList()
{
bool old_value = SConfig::GetInstance().m_LocalCoreStartupParameter.bEnableCheats;
SConfig::GetInstance().m_LocalCoreStartupParameter.bEnableCheats = false;
bool old_value = SConfig::GetInstance().bEnableCheats;
SConfig::GetInstance().bEnableCheats = false;
b_RanOnce = false;
activeCodes.clear();
for (auto& arCode : arCodes)
{
if (arCode.active)
activeCodes.push_back(arCode);
}
SConfig::GetInstance().m_LocalCoreStartupParameter.bEnableCheats = old_value;
SConfig::GetInstance().bEnableCheats = old_value;
}

void EnableSelfLogging(bool enable)
Expand Down Expand Up @@ -760,7 +760,7 @@ static bool ConditionalCode(const ARAddr& addr, const u32 data, int* const pSkip

void RunAllActive()
{
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bEnableCheats)
if (SConfig::GetInstance().bEnableCheats)
{
for (auto& activeCode : activeCodes)
{
Expand Down
26 changes: 12 additions & 14 deletions Source/Core/Core/Boot/Boot.cpp
Expand Up @@ -12,7 +12,6 @@

#include "Core/ConfigManager.h"
#include "Core/Core.h"
#include "Core/CoreParameter.h"
#include "Core/Host.h"
#include "Core/PatchEngine.h"
#include "Core/Boot/Boot.h"
Expand Down Expand Up @@ -75,10 +74,10 @@ bool CBoot::FindMapFile(std::string* existing_map_file,
std::string title_id_str;
size_t name_begin_index;

SCoreStartupParameter& _StartupPara = SConfig::GetInstance().m_LocalCoreStartupParameter;
SConfig& _StartupPara = SConfig::GetInstance();
switch (_StartupPara.m_BootType)
{
case SCoreStartupParameter::BOOT_WII_NAND:
case SConfig::BOOT_WII_NAND:
{
const DiscIO::INANDContentLoader& Loader =
DiscIO::CNANDContentManager::Access().GetNANDLoader(_StartupPara.m_strFilename);
Expand All @@ -92,8 +91,8 @@ bool CBoot::FindMapFile(std::string* existing_map_file,
break;
}

case SCoreStartupParameter::BOOT_ELF:
case SCoreStartupParameter::BOOT_DOL:
case SConfig::BOOT_ELF:
case SConfig::BOOT_DOL:
// Strip the .elf/.dol file extension and directories before the name
name_begin_index = _StartupPara.m_strFilename.find_last_of("/") + 1;
if ((_StartupPara.m_strFilename.find_last_of("\\") + 1) > name_begin_index)
Expand Down Expand Up @@ -220,8 +219,7 @@ bool CBoot::Load_BS2(const std::string& _rBootROMFilename)
// Third boot step after BootManager and Core. See Call schedule in BootManager.cpp
bool CBoot::BootUp()
{
SCoreStartupParameter& _StartupPara =
SConfig::GetInstance().m_LocalCoreStartupParameter;
SConfig& _StartupPara = SConfig::GetInstance();

NOTICE_LOG(BOOT, "Booting %s", _StartupPara.m_strFilename.c_str());

Expand All @@ -234,7 +232,7 @@ bool CBoot::BootUp()
switch (_StartupPara.m_BootType)
{
// GCM and Wii
case SCoreStartupParameter::BOOT_ISO:
case SConfig::BOOT_ISO:
{
DVDInterface::SetVolumeName(_StartupPara.m_strFilename);
DVDInterface::SetDiscInside(DVDInterface::VolumeIsValid());
Expand Down Expand Up @@ -299,7 +297,7 @@ bool CBoot::BootUp()
}

// DOL
case SCoreStartupParameter::BOOT_DOL:
case SConfig::BOOT_DOL:
{
CDolLoader dolLoader(_StartupPara.m_strFilename);
if (!dolLoader.IsValid())
Expand Down Expand Up @@ -366,7 +364,7 @@ bool CBoot::BootUp()
}

// ELF
case SCoreStartupParameter::BOOT_ELF:
case SConfig::BOOT_ELF:
{
// load image or create virtual drive from directory
if (!_StartupPara.m_strDVDRoot.empty())
Expand Down Expand Up @@ -402,7 +400,7 @@ bool CBoot::BootUp()
}

// Wii WAD
case SCoreStartupParameter::BOOT_WII_NAND:
case SConfig::BOOT_WII_NAND:
Boot_WiiWAD(_StartupPara.m_strFilename);

if (LoadMapFromFilename())
Expand All @@ -419,7 +417,7 @@ bool CBoot::BootUp()


// Bootstrap 2 (AKA: Initial Program Loader, "BIOS")
case SCoreStartupParameter::BOOT_BS2:
case SConfig::BOOT_BS2:
{
DVDInterface::SetDiscInside(DVDInterface::VolumeIsValid());
if (Load_BS2(_StartupPara.m_strBootROM))
Expand All @@ -434,7 +432,7 @@ bool CBoot::BootUp()
break;
}

case SCoreStartupParameter::BOOT_DFF:
case SConfig::BOOT_DFF:
// do nothing
break;

Expand All @@ -446,7 +444,7 @@ bool CBoot::BootUp()
}

// HLE jump to loader (homebrew). Disabled when Gecko is active as it interferes with the code handler
if (!SConfig::GetInstance().m_LocalCoreStartupParameter.bEnableCheats)
if (!SConfig::GetInstance().bEnableCheats)
{
HLE::Patch(0x80001800, "HBReload");
Memory::CopyToEmu(0x00001804, "STUBHAXX", 8);
Expand Down
6 changes: 3 additions & 3 deletions Source/Core/Core/Boot/Boot_BS2Emu.cpp
Expand Up @@ -63,7 +63,7 @@ bool CBoot::EmulatedBS2_GC(bool skipAppLoader)
// TODO determine why some games fail when using a retail ID. (Seem to take different EXI paths, see Ikaruga for example)
PowerPC::HostWrite_U32(0x10000006, 0x8000002C); // Console type - DevKit (retail ID == 0x00000003) see YAGCD 4.2.1.1.2

PowerPC::HostWrite_U32(SConfig::GetInstance().m_LocalCoreStartupParameter.bNTSC
PowerPC::HostWrite_U32(SConfig::GetInstance().bNTSC
? 0 : 1, 0x800000CC); // Fake the VI Init of the IPL (YAGCD 4.2.1.4)

PowerPC::HostWrite_U32(0x01000000, 0x800000d0); // ARAM Size. 16MB main + 4/16/32MB external (retail consoles have no external ARAM)
Expand Down Expand Up @@ -95,7 +95,7 @@ bool CBoot::EmulatedBS2_GC(bool skipAppLoader)
DVDInterface::DVDRead(iAppLoaderOffset + 0x20, 0x01200000, iAppLoaderSize, false);

// Setup pointers like real BS2 does
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bNTSC)
if (SConfig::GetInstance().bNTSC)
{
PowerPC::ppcState.gpr[1] = 0x81566550; // StackPointer, used to be set to 0x816ffff0
PowerPC::ppcState.gpr[2] = 0x81465cc0; // Global pointer to Small Data Area 2 Base (haven't seen anything use it...meh)
Expand Down Expand Up @@ -294,7 +294,7 @@ bool CBoot::SetupWiiMemory(DiscIO::IVolume::ECountry country)
Memory::Write_U32(0x80000000, 0x00003184); // GameID Address

// Fake the VI Init of the IPL
Memory::Write_U32(SConfig::GetInstance().m_LocalCoreStartupParameter.bNTSC ? 0 : 1, 0x000000CC);
Memory::Write_U32(SConfig::GetInstance().bNTSC ? 0 : 1, 0x000000CC);

// Clear exception handler. Why? Don't we begin with only zeros?
for (int i = 0x3000; i <= 0x3038; i += 4)
Expand Down
8 changes: 4 additions & 4 deletions Source/Core/Core/BootManager.cpp
Expand Up @@ -77,12 +77,12 @@ static GPUDeterminismMode ParseGPUDeterminismMode(const std::string& mode)
// Boot the ISO or file
bool BootCore(const std::string& _rFilename)
{
SCoreStartupParameter& StartUp = SConfig::GetInstance().m_LocalCoreStartupParameter;
SConfig& StartUp = SConfig::GetInstance();

// Use custom settings for debugging mode
Host_SetStartupDebuggingParameters();

StartUp.m_BootType = SCoreStartupParameter::BOOT_ISO;
StartUp.m_BootType = SConfig::BOOT_ISO;
StartUp.m_strFilename = _rFilename;
SConfig::GetInstance().m_LastFilename = _rFilename;
SConfig::GetInstance().SaveSettings();
Expand All @@ -93,7 +93,7 @@ bool BootCore(const std::string& _rFilename)
config_cache.bHLE_BS2 = StartUp.bHLE_BS2;

// If for example the ISO file is bad we return here
if (!StartUp.AutoSetup(SCoreStartupParameter::BOOT_DEFAULT))
if (!StartUp.AutoSetup(SConfig::BOOT_DEFAULT))
return false;

// Load game specific settings
Expand Down Expand Up @@ -272,7 +272,7 @@ void Stop()
{
Core::Stop();

SCoreStartupParameter& StartUp = SConfig::GetInstance().m_LocalCoreStartupParameter;
SConfig& StartUp = SConfig::GetInstance();

StartUp.m_strUniqueID = "00000000";
if (config_cache.valid)
Expand Down
1 change: 0 additions & 1 deletion Source/Core/Core/CMakeLists.txt
Expand Up @@ -3,7 +3,6 @@ set(SRCS ActionReplay.cpp
BootManager.cpp
ConfigManager.cpp
Core.cpp
CoreParameter.cpp
CoreTiming.cpp
DSPEmulator.cpp
ec_wii.cpp
Expand Down

0 comments on commit 740e344

Please sign in to comment.