Skip to content

Commit

Permalink
Merge pull request #4 from OpenEmu/July2020
Browse files Browse the repository at this point in the history
Merge July 2020 Branch
  • Loading branch information
duckey77 authored Aug 28, 2020
2 parents 13aaf1d + 1dc48c3 commit 9af3f8d
Show file tree
Hide file tree
Showing 14 changed files with 3,037 additions and 2,727 deletions.
File renamed without changes.
16 changes: 9 additions & 7 deletions Compatibility/Common/Layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ Layer::~Layer()
Save();
}

bool Layer::Exists(const ConfigLocation& location) const
bool Layer::Exists(const Location& location) const
{
const auto iter = m_map.find(location);
return iter != m_map.end() && iter->second.has_value();
}

bool Layer::DeleteKey(const ConfigLocation& location)
bool Layer::DeleteKey(const Location& location)
{
m_is_dirty = true;
bool had_value = false;
Expand All @@ -68,19 +68,21 @@ void Layer::DeleteAllKeys()

Section Layer::GetSection(System system, const std::string& section)
{
return Section{m_map.lower_bound(ConfigLocation{system, section, ""}),
m_map.lower_bound(ConfigLocation{system, section + '\001', ""})};
return Section{m_map.lower_bound(Location{system, section, ""}),
m_map.lower_bound(Location{system, section + '\001', ""})};
}

ConstSection Layer::GetSection(System system, const std::string& section) const
{
return ConstSection{m_map.lower_bound(ConfigLocation{system, section, ""}),
m_map.lower_bound(ConfigLocation{system, section + '\001', ""})};
return ConstSection{m_map.lower_bound(Location{system, section, ""}),
m_map.lower_bound(Location{system, section + '\001', ""})};
}

void Layer::Load()
{
return;
if (m_loader)
m_loader->Load(this);
m_is_dirty = false;
}

void Layer::Save()
Expand Down
49 changes: 18 additions & 31 deletions Compatibility/Core/ConfigManager.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
//// Copyright 2008 Dolphin Emulator Project
//// Licensed under GPLv2+
//// Refer to the license.txt file included.
// Copyright 2008 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
Expand Down Expand Up @@ -96,7 +93,6 @@ void SConfig::SaveSettings()
SaveInputSettings(ini);
SaveFifoPlayerSettings(ini);
SaveAnalyticsSettings(ini);
SaveNetworkSettings(ini);
SaveBluetoothPassthroughSettings(ini);
SaveUSBPassthroughSettings(ini);
SaveAutoUpdateSettings(ini);
Expand Down Expand Up @@ -191,9 +187,13 @@ void SConfig::SaveGameListSettings(IniFile& ini)
gamelist->Set("ColumnTitle", m_showTitleColumn);
gamelist->Set("ColumnNotes", m_showMakerColumn);
gamelist->Set("ColumnFileName", m_showFileNameColumn);
gamelist->Set("ColumnFilePath", m_showFilePathColumn);
gamelist->Set("ColumnID", m_showIDColumn);
gamelist->Set("ColumnRegion", m_showRegionColumn);
gamelist->Set("ColumnSize", m_showSizeColumn);
gamelist->Set("ColumnFileFormat", m_showFileFormatColumn);
gamelist->Set("ColumnBlockSize", m_showBlockSizeColumn);
gamelist->Set("ColumnCompression", m_showCompressionColumn);
gamelist->Set("ColumnTags", m_showTagsColumn);
}

Expand Down Expand Up @@ -227,6 +227,8 @@ void SConfig::SaveCoreSettings(IniFile& ini)
core->Set("SlotB", m_EXIDevice[1]);
core->Set("SerialPort1", m_EXIDevice[2]);
core->Set("BBA_MAC", m_bba_mac);
core->Set("BBA_XLINK_IP", m_bba_xlink_ip);
core->Set("BBA_XLINK_CHAT_OSD", m_bba_xlink_chat_osd);
for (int i = 0; i < SerialInterface::MAX_SI_CHANNELS; ++i)
{
core->Set(fmt::format("SIDevice{}", i), m_SIDevice[i]);
Expand All @@ -237,13 +239,13 @@ void SConfig::SaveCoreSettings(IniFile& ini)
core->Set("WiiKeyboard", m_WiiKeyboard);
core->Set("WiimoteContinuousScanning", m_WiimoteContinuousScanning);
core->Set("WiimoteEnableSpeaker", m_WiimoteEnableSpeaker);
core->Set("WiimoteControllerInterface", connect_wiimotes_for_ciface);
core->Set("RunCompareServer", bRunCompareServer);
core->Set("RunCompareClient", bRunCompareClient);
core->Set("MMU", bMMU);
core->Set("EmulationSpeed", m_EmulationSpeed);
core->Set("Overclock", m_OCFactor);
core->Set("OverclockEnable", m_OCEnable);
core->Set("GFXBackend", m_strVideoBackend);
core->Set("GPUDeterminismMode", m_strGPUDeterminismMode);
core->Set("PerfMapDir", m_perfDir);
core->Set("EnableCustomRTC", bEnableCustomRTC);
Expand Down Expand Up @@ -293,17 +295,6 @@ void SConfig::SaveFifoPlayerSettings(IniFile& ini)
fifoplayer->Set("LoopReplay", bLoopFifoReplay);
}

void SConfig::SaveNetworkSettings(IniFile& ini)
{
IniFile::Section* network = ini.GetOrCreateSection("Network");

network->Set("SSLDumpRead", m_SSLDumpRead);
network->Set("SSLDumpWrite", m_SSLDumpWrite);
network->Set("SSLVerifyCertificates", m_SSLVerifyCert);
network->Set("SSLDumpRootCA", m_SSLDumpRootCA);
network->Set("SSLDumpPeerCert", m_SSLDumpPeerCert);
}

void SConfig::SaveAnalyticsSettings(IniFile& ini)
{
IniFile::Section* analytics = ini.GetOrCreateSection("Analytics");
Expand Down Expand Up @@ -358,6 +349,7 @@ void SConfig::SaveJitDebugSettings(IniFile& ini)
section->Set("JitPairedOff", bJITPairedOff);
section->Set("JitSystemRegistersOff", bJITSystemRegistersOff);
section->Set("JitBranchOff", bJITBranchOff);
section->Set("JitRegisterCacheOff", bJITRegisterCacheOff);
}

void SConfig::LoadSettings()
Expand All @@ -376,7 +368,6 @@ void SConfig::LoadSettings()
LoadDSPSettings(ini);
LoadInputSettings(ini);
LoadFifoPlayerSettings(ini);
LoadNetworkSettings(ini);
LoadAnalyticsSettings(ini);
LoadBluetoothPassthroughSettings(ini);
LoadUSBPassthroughSettings(ini);
Expand Down Expand Up @@ -465,9 +456,13 @@ void SConfig::LoadGameListSettings(IniFile& ini)
gamelist->Get("ColumnTitle", &m_showTitleColumn, true);
gamelist->Get("ColumnNotes", &m_showMakerColumn, true);
gamelist->Get("ColumnFileName", &m_showFileNameColumn, false);
gamelist->Get("ColumnFilePath", &m_showFilePathColumn, false);
gamelist->Get("ColumnID", &m_showIDColumn, false);
gamelist->Get("ColumnRegion", &m_showRegionColumn, true);
gamelist->Get("ColumnSize", &m_showSizeColumn, true);
gamelist->Get("ColumnFileFormat", &m_showFileFormatColumn, false);
gamelist->Get("ColumnBlockSize", &m_showBlockSizeColumn, false);
gamelist->Get("ColumnCompression", &m_showCompressionColumn, false);
gamelist->Get("ColumnTags", &m_showTagsColumn, false);
}

Expand Down Expand Up @@ -502,18 +497,20 @@ void SConfig::LoadCoreSettings(IniFile& ini)
core->Get("SlotB", (int*)&m_EXIDevice[1], ExpansionInterface::EXIDEVICE_NONE);
core->Get("SerialPort1", (int*)&m_EXIDevice[2], ExpansionInterface::EXIDEVICE_NONE);
core->Get("BBA_MAC", &m_bba_mac);
core->Get("BBA_XLINK_IP", &m_bba_xlink_ip, "127.0.0.1");
core->Get("BBA_XLINK_CHAT_OSD", &m_bba_xlink_chat_osd, true);
for (size_t i = 0; i < std::size(m_SIDevice); ++i)
{
//OpenEmu make all devices GCpads
core->Get(fmt::format("SIDevice{}", i), &m_SIDevice[i], SerialInterface::SIDEVICE_GC_CONTROLLER);

core->Get(fmt::format("AdapterRumble{}", i), &m_AdapterRumble[i], true);
core->Get(fmt::format("SimulateKonga{}", i), &m_AdapterKonga[i], false);
}
core->Get("WiiSDCard", &m_WiiSDCard, false);
core->Get("WiiSDCard", &m_WiiSDCard, true);
core->Get("WiiKeyboard", &m_WiiKeyboard, false);
core->Get("WiimoteContinuousScanning", &m_WiimoteContinuousScanning, false);
core->Get("WiimoteEnableSpeaker", &m_WiimoteEnableSpeaker, false);
core->Get("WiimoteControllerInterface", &connect_wiimotes_for_ciface, false);
core->Get("RunCompareServer", &bRunCompareServer, false);
core->Get("RunCompareClient", &bRunCompareClient, false);
core->Get("MMU", &bMMU, bMMU);
Expand All @@ -529,7 +526,6 @@ void SConfig::LoadCoreSettings(IniFile& ini)
core->Get("EmulationSpeed", &m_EmulationSpeed, 1.0f);
core->Get("Overclock", &m_OCFactor, 1.0f);
core->Get("OverclockEnable", &m_OCEnable, false);
core->Get("GFXBackend", &m_strVideoBackend, "");
core->Get("GPUDeterminismMode", &m_strGPUDeterminismMode, "auto");
core->Get("PerfMapDir", &m_perfDir, "");
core->Get("EnableCustomRTC", &bEnableCustomRTC, false);
Expand Down Expand Up @@ -582,17 +578,6 @@ void SConfig::LoadFifoPlayerSettings(IniFile& ini)
fifoplayer->Get("LoopReplay", &bLoopFifoReplay, true);
}

void SConfig::LoadNetworkSettings(IniFile& ini)
{
IniFile::Section* network = ini.GetOrCreateSection("Network");

network->Get("SSLDumpRead", &m_SSLDumpRead, false);
network->Get("SSLDumpWrite", &m_SSLDumpWrite, false);
network->Get("SSLVerifyCertificates", &m_SSLVerifyCert, true);
network->Get("SSLDumpRootCA", &m_SSLDumpRootCA, false);
network->Get("SSLDumpPeerCert", &m_SSLDumpPeerCert, false);
}

void SConfig::LoadAnalyticsSettings(IniFile& ini)
{
IniFile::Section* analytics = ini.GetOrCreateSection("Analytics");
Expand Down Expand Up @@ -651,6 +636,7 @@ void SConfig::LoadJitDebugSettings(IniFile& ini)
section->Get("JitPairedOff", &bJITPairedOff, false);
section->Get("JitSystemRegistersOff", &bJITSystemRegistersOff, false);
section->Get("JitBranchOff", &bJITBranchOff, false);
section->Get("JitRegisterCacheOff", &bJITRegisterCacheOff, false);
}

void SConfig::ResetRunningGameMetadata()
Expand Down Expand Up @@ -803,6 +789,7 @@ void SConfig::LoadDefaults()
bJITPairedOff = false;
bJITSystemRegistersOff = false;
bJITBranchOff = false;
bJITRegisterCacheOff = false;

ResetRunningGameMetadata();
}
Expand Down
Loading

0 comments on commit 9af3f8d

Please sign in to comment.