mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-28 16:49:58 -06:00
Create Slot enum class for EXI slots
This commit is contained in:
@ -40,6 +40,8 @@
|
||||
#include "Core/ConfigManager.h"
|
||||
#include "Core/GeckoCode.h"
|
||||
#include "Core/GeckoCodeConfig.h"
|
||||
#include "Core/HW/EXI/EXI.h"
|
||||
#include "Core/HW/EXI/EXI_Device.h"
|
||||
#ifdef HAS_LIBMGBA
|
||||
#include "Core/HW/GBACore.h"
|
||||
#endif
|
||||
@ -1306,10 +1308,21 @@ bool NetPlayServer::SetupNetSettings()
|
||||
settings.m_CopyWiiSave = Config::Get(Config::NETPLAY_LOAD_WII_SAVE);
|
||||
settings.m_OCEnable = Config::Get(Config::MAIN_OVERCLOCK_ENABLE);
|
||||
settings.m_OCFactor = Config::Get(Config::MAIN_OVERCLOCK);
|
||||
settings.m_EXIDevice[0] = Config::Get(Config::MAIN_SLOT_A);
|
||||
settings.m_EXIDevice[1] = Config::Get(Config::MAIN_SLOT_B);
|
||||
// There's no way the BBA is going to sync, disable it
|
||||
settings.m_EXIDevice[2] = ExpansionInterface::EXIDeviceType::None;
|
||||
|
||||
for (ExpansionInterface::Slot slot : ExpansionInterface::SLOTS)
|
||||
{
|
||||
ExpansionInterface::EXIDeviceType device;
|
||||
if (slot == ExpansionInterface::Slot::SP1)
|
||||
{
|
||||
// There's no way the BBA is going to sync, disable it
|
||||
device = ExpansionInterface::EXIDeviceType::None;
|
||||
}
|
||||
else
|
||||
{
|
||||
device = Config::Get(Config::GetInfoForEXIDevice(slot));
|
||||
}
|
||||
settings.m_EXIDevice[slot] = device;
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < Config::SYSCONF_SETTINGS.size(); ++i)
|
||||
{
|
||||
@ -1494,8 +1507,8 @@ bool NetPlayServer::StartGame()
|
||||
spac << m_settings.m_OCEnable;
|
||||
spac << m_settings.m_OCFactor;
|
||||
|
||||
for (auto& device : m_settings.m_EXIDevice)
|
||||
spac << static_cast<int>(device);
|
||||
for (auto slot : ExpansionInterface::SLOTS)
|
||||
spac << static_cast<int>(m_settings.m_EXIDevice[slot]);
|
||||
|
||||
for (u32 value : m_settings.m_SYSCONFSettings)
|
||||
spac << value;
|
||||
@ -1592,11 +1605,10 @@ bool NetPlayServer::SyncSaveData()
|
||||
|
||||
u8 save_count = 0;
|
||||
|
||||
constexpr int exi_device_count = 2;
|
||||
for (int i = 0; i < exi_device_count; ++i)
|
||||
for (ExpansionInterface::Slot slot : ExpansionInterface::MEMCARD_SLOTS)
|
||||
{
|
||||
if (m_settings.m_EXIDevice[i] == ExpansionInterface::EXIDeviceType::MemoryCard ||
|
||||
Config::Get(Config::GetInfoForEXIDevice(i)) ==
|
||||
if (m_settings.m_EXIDevice[slot] == ExpansionInterface::EXIDeviceType::MemoryCard ||
|
||||
Config::Get(Config::GetInfoForEXIDevice(slot)) ==
|
||||
ExpansionInterface::EXIDeviceType::MemoryCardFolder)
|
||||
{
|
||||
save_count++;
|
||||
@ -1652,11 +1664,11 @@ bool NetPlayServer::SyncSaveData()
|
||||
const std::string region =
|
||||
SConfig::GetDirectoryForRegion(SConfig::ToGameCubeRegion(game->GetRegion()));
|
||||
|
||||
for (int i = 0; i < exi_device_count; ++i)
|
||||
for (ExpansionInterface::Slot slot : ExpansionInterface::MEMCARD_SLOTS)
|
||||
{
|
||||
const bool is_slot_a = i == 0;
|
||||
const bool is_slot_a = slot == ExpansionInterface::Slot::A;
|
||||
|
||||
if (m_settings.m_EXIDevice[i] == ExpansionInterface::EXIDeviceType::MemoryCard)
|
||||
if (m_settings.m_EXIDevice[slot] == ExpansionInterface::EXIDeviceType::MemoryCard)
|
||||
{
|
||||
std::string path = is_slot_a ? Config::Get(Config::MAIN_MEMCARD_A_PATH) :
|
||||
Config::Get(Config::MAIN_MEMCARD_B_PATH);
|
||||
@ -1693,7 +1705,7 @@ bool NetPlayServer::SyncSaveData()
|
||||
SendChunkedToClients(std::move(pac), 1,
|
||||
fmt::format("Memory Card {} Synchronization", is_slot_a ? 'A' : 'B'));
|
||||
}
|
||||
else if (Config::Get(Config::GetInfoForEXIDevice(i)) ==
|
||||
else if (Config::Get(Config::GetInfoForEXIDevice(slot)) ==
|
||||
ExpansionInterface::EXIDeviceType::MemoryCardFolder)
|
||||
{
|
||||
const std::string path = File::GetUserPath(D_GCUSER_IDX) + region + DIR_SEP +
|
||||
|
Reference in New Issue
Block a user