mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-01 02:29:59 -06:00
Core: Unify handling of raw memory card path.
This commit is contained in:
@ -1665,8 +1665,8 @@ bool NetPlayServer::SyncSaveData()
|
||||
if (save_count == 0)
|
||||
return true;
|
||||
|
||||
const std::string region =
|
||||
Config::GetDirectoryForRegion(Config::ToGameCubeRegion(game->GetRegion()));
|
||||
const auto game_region = game->GetRegion();
|
||||
const std::string region = Config::GetDirectoryForRegion(Config::ToGameCubeRegion(game_region));
|
||||
|
||||
for (ExpansionInterface::Slot slot : ExpansionInterface::MEMCARD_SLOTS)
|
||||
{
|
||||
@ -1674,17 +1674,12 @@ bool NetPlayServer::SyncSaveData()
|
||||
|
||||
if (m_settings.m_EXIDevice[slot] == ExpansionInterface::EXIDeviceType::MemoryCard)
|
||||
{
|
||||
std::string path = Config::Get(Config::GetInfoForMemcardPath(slot));
|
||||
|
||||
MemoryCard::CheckPath(path, region, slot);
|
||||
|
||||
const int size_override = m_settings.m_MemcardSizeOverride;
|
||||
if (size_override >= 0 && size_override <= 4)
|
||||
{
|
||||
path.insert(path.find_last_of('.'),
|
||||
fmt::format(".{}", Memcard::MbitToFreeBlocks(Memcard::MBIT_SIZE_MEMORY_CARD_59
|
||||
<< size_override)));
|
||||
}
|
||||
const u16 card_size_mbits =
|
||||
size_override >= 0 && size_override <= 4 ?
|
||||
static_cast<u16>(Memcard::MBIT_SIZE_MEMORY_CARD_59 << size_override) :
|
||||
Memcard::MBIT_SIZE_MEMORY_CARD_2043;
|
||||
const std::string path = Config::GetMemcardPath(slot, game_region, card_size_mbits);
|
||||
|
||||
sf::Packet pac;
|
||||
pac << MessageID::SyncSaveData;
|
||||
|
Reference in New Issue
Block a user