Netplay: Get memory card size override setting from config system instead of manually parsing INI.
This commit is contained in:
parent
b88507a3ed
commit
407aefb6b9
|
@ -40,6 +40,7 @@ public:
|
||||||
layer->Set(Config::MAIN_OVERCLOCK, m_settings.m_OCFactor);
|
layer->Set(Config::MAIN_OVERCLOCK, m_settings.m_OCFactor);
|
||||||
for (ExpansionInterface::Slot slot : ExpansionInterface::SLOTS)
|
for (ExpansionInterface::Slot slot : ExpansionInterface::SLOTS)
|
||||||
layer->Set(Config::GetInfoForEXIDevice(slot), m_settings.m_EXIDevice[slot]);
|
layer->Set(Config::GetInfoForEXIDevice(slot), m_settings.m_EXIDevice[slot]);
|
||||||
|
layer->Set(Config::MAIN_MEMORY_CARD_SIZE, m_settings.m_MemcardSizeOverride);
|
||||||
layer->Set(Config::SESSION_SAVE_DATA_WRITABLE, m_settings.m_WriteToMemcard);
|
layer->Set(Config::SESSION_SAVE_DATA_WRITABLE, m_settings.m_WriteToMemcard);
|
||||||
layer->Set(Config::MAIN_RAM_OVERRIDE_ENABLE, m_settings.m_RAMOverrideEnable);
|
layer->Set(Config::MAIN_RAM_OVERRIDE_ENABLE, m_settings.m_RAMOverrideEnable);
|
||||||
layer->Set(Config::MAIN_MEM1_SIZE, m_settings.m_Mem1Size);
|
layer->Set(Config::MAIN_MEM1_SIZE, m_settings.m_Mem1Size);
|
||||||
|
|
|
@ -822,6 +822,8 @@ void NetPlayClient::OnStartGame(sf::Packet& packet)
|
||||||
for (auto slot : ExpansionInterface::SLOTS)
|
for (auto slot : ExpansionInterface::SLOTS)
|
||||||
packet >> m_net_settings.m_EXIDevice[slot];
|
packet >> m_net_settings.m_EXIDevice[slot];
|
||||||
|
|
||||||
|
packet >> m_net_settings.m_MemcardSizeOverride;
|
||||||
|
|
||||||
for (u32& value : m_net_settings.m_SYSCONFSettings)
|
for (u32& value : m_net_settings.m_SYSCONFSettings)
|
||||||
packet >> value;
|
packet >> value;
|
||||||
|
|
||||||
|
|
|
@ -47,6 +47,7 @@ struct NetSettings
|
||||||
bool m_OCEnable = false;
|
bool m_OCEnable = false;
|
||||||
float m_OCFactor = 0;
|
float m_OCFactor = 0;
|
||||||
Common::EnumMap<ExpansionInterface::EXIDeviceType, ExpansionInterface::MAX_SLOT> m_EXIDevice{};
|
Common::EnumMap<ExpansionInterface::EXIDeviceType, ExpansionInterface::MAX_SLOT> m_EXIDevice{};
|
||||||
|
int m_MemcardSizeOverride = -1;
|
||||||
|
|
||||||
std::array<u32, Config::SYSCONF_SETTINGS.size()> m_SYSCONFSettings{};
|
std::array<u32, Config::SYSCONF_SETTINGS.size()> m_SYSCONFSettings{};
|
||||||
|
|
||||||
|
|
|
@ -1324,6 +1324,8 @@ bool NetPlayServer::SetupNetSettings()
|
||||||
settings.m_EXIDevice[slot] = device;
|
settings.m_EXIDevice[slot] = device;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
settings.m_MemcardSizeOverride = Config::Get(Config::MAIN_MEMORY_CARD_SIZE);
|
||||||
|
|
||||||
for (size_t i = 0; i < Config::SYSCONF_SETTINGS.size(); ++i)
|
for (size_t i = 0; i < Config::SYSCONF_SETTINGS.size(); ++i)
|
||||||
{
|
{
|
||||||
std::visit(
|
std::visit(
|
||||||
|
@ -1510,6 +1512,8 @@ bool NetPlayServer::StartGame()
|
||||||
for (auto slot : ExpansionInterface::SLOTS)
|
for (auto slot : ExpansionInterface::SLOTS)
|
||||||
spac << static_cast<int>(m_settings.m_EXIDevice[slot]);
|
spac << static_cast<int>(m_settings.m_EXIDevice[slot]);
|
||||||
|
|
||||||
|
spac << m_settings.m_MemcardSizeOverride;
|
||||||
|
|
||||||
for (u32 value : m_settings.m_SYSCONFSettings)
|
for (u32 value : m_settings.m_SYSCONFSettings)
|
||||||
spac << value;
|
spac << value;
|
||||||
|
|
||||||
|
@ -1674,10 +1678,7 @@ bool NetPlayServer::SyncSaveData()
|
||||||
|
|
||||||
MemoryCard::CheckPath(path, region, slot);
|
MemoryCard::CheckPath(path, region, slot);
|
||||||
|
|
||||||
int size_override;
|
const int size_override = m_settings.m_MemcardSizeOverride;
|
||||||
IniFile gameIni = SConfig::LoadGameIni(game->GetGameID(), game->GetRevision());
|
|
||||||
gameIni.GetOrCreateSection("Core")->Get("MemoryCardSize", &size_override, -1);
|
|
||||||
|
|
||||||
if (size_override >= 0 && size_override <= 4)
|
if (size_override >= 0 && size_override <= 4)
|
||||||
{
|
{
|
||||||
path.insert(path.find_last_of('.'),
|
path.insert(path.find_last_of('.'),
|
||||||
|
|
Loading…
Reference in New Issue