diff --git a/Source/Core/Core/BootManager.cpp b/Source/Core/Core/BootManager.cpp index ec894b285c..217566be80 100644 --- a/Source/Core/Core/BootManager.cpp +++ b/Source/Core/Core/BootManager.cpp @@ -344,6 +344,8 @@ bool BootCore(const std::string& _rFilename) StringFromFormat("Movie%s.raw", (i == 0) ? "A" : "B"))) File::Delete(File::GetUserPath(D_GCUSER_IDX) + StringFromFormat("Movie%s.raw", (i == 0) ? "A" : "B")); + if (File::Exists(File::GetUserPath(D_GCUSER_IDX) + "Movie")) + File::DeleteDirRecursively(File::GetUserPath(D_GCUSER_IDX) + "Movie"); } } } diff --git a/Source/Core/Core/HW/EXI/EXI.cpp b/Source/Core/Core/HW/EXI/EXI.cpp index d47ffb478e..a983e98eba 100644 --- a/Source/Core/Core/HW/EXI/EXI.cpp +++ b/Source/Core/Core/HW/EXI/EXI.cpp @@ -33,6 +33,34 @@ static std::array, MAX_EXI_CHANNELS> g_Channels; static void ChangeDeviceCallback(u64 userdata, s64 cyclesLate); static void UpdateInterruptsCallback(u64 userdata, s64 cycles_late); +namespace +{ +void AddMemoryCards(int i) +{ + TEXIDevices memorycard_device; + if (Movie::IsPlayingInput() && Movie::IsConfigSaved()) + { + if (Movie::IsUsingMemcard(i)) + { + if (SConfig::GetInstance().m_EXIDevice[i] == EXIDEVICE_MEMORYCARDFOLDER) + memorycard_device = EXIDEVICE_MEMORYCARDFOLDER; + else + memorycard_device = EXIDEVICE_MEMORYCARD; + } + else + { + memorycard_device = EXIDEVICE_NONE; + } + } + else + { + memorycard_device = SConfig::GetInstance().m_EXIDevice[i]; + } + + g_Channels[i]->AddDevice(memorycard_device, 0); +} +} // namespace + void Init() { if (!g_SRAM_netplay_initialized) @@ -44,18 +72,9 @@ void Init() for (u32 i = 0; i < MAX_EXI_CHANNELS; i++) g_Channels[i] = std::make_unique(i); - if (Movie::IsPlayingInput() && Movie::IsConfigSaved()) - { - g_Channels[0]->AddDevice(Movie::IsUsingMemcard(0) ? EXIDEVICE_MEMORYCARD : EXIDEVICE_NONE, - 0); // SlotA - g_Channels[1]->AddDevice(Movie::IsUsingMemcard(1) ? EXIDEVICE_MEMORYCARD : EXIDEVICE_NONE, - 0); // SlotB - } - else - { - g_Channels[0]->AddDevice(SConfig::GetInstance().m_EXIDevice[0], 0); // SlotA - g_Channels[1]->AddDevice(SConfig::GetInstance().m_EXIDevice[1], 0); // SlotB - } + for (int i = 0; i < MAX_MEMORYCARD_SLOTS; i++) + AddMemoryCards(i); + g_Channels[0]->AddDevice(EXIDEVICE_MASKROM, 1); g_Channels[0]->AddDevice(SConfig::GetInstance().m_EXIDevice[2], 2); // Serial Port 1 g_Channels[2]->AddDevice(EXIDEVICE_AD16, 0); diff --git a/Source/Core/Core/HW/EXI/EXI.h b/Source/Core/Core/HW/EXI/EXI.h index f6c6395e18..9476e10c16 100644 --- a/Source/Core/Core/HW/EXI/EXI.h +++ b/Source/Core/Core/HW/EXI/EXI.h @@ -21,6 +21,7 @@ class Mapping; enum { + MAX_MEMORYCARD_SLOTS = 2, MAX_EXI_CHANNELS = 3 }; diff --git a/Source/Core/Core/HW/EXI/EXI_DeviceMemoryCard.cpp b/Source/Core/Core/HW/EXI/EXI_DeviceMemoryCard.cpp index 801d2b1580..86fa60db5a 100644 --- a/Source/Core/Core/HW/EXI/EXI_DeviceMemoryCard.cpp +++ b/Source/Core/Core/HW/EXI/EXI_DeviceMemoryCard.cpp @@ -163,9 +163,14 @@ void CEXIMemoryCard::SetupGciFolder(u16 sizeMb) const bool shift_jis = region == DiscIO::Region::NTSC_J; - std::string strDirectoryName = File::GetUserPath(D_GCUSER_IDX) + - SConfig::GetDirectoryForRegion(region) + DIR_SEP + - StringFromFormat("Card %c", 'A' + card_index); + std::string strDirectoryName = File::GetUserPath(D_GCUSER_IDX); + + if (Movie::IsPlayingInput() && Movie::IsConfigSaved() && Movie::IsUsingMemcard(card_index) && + Movie::IsStartingFromClearSave()) + strDirectoryName += "Movie" DIR_SEP; + + strDirectoryName = strDirectoryName + SConfig::GetDirectoryForRegion(region) + DIR_SEP + + StringFromFormat("Card %c", 'A' + card_index); if (!File::Exists(strDirectoryName)) // first use of memcard folder, migrate automatically { diff --git a/Source/Core/Core/Movie.cpp b/Source/Core/Core/Movie.cpp index aa823dbd55..0f34fa0b31 100644 --- a/Source/Core/Core/Movie.cpp +++ b/Source/Core/Core/Movie.cpp @@ -465,6 +465,7 @@ bool IsUsingMemcard(int memcard) { return (s_memcards & (1 << memcard)) != 0; } + bool IsSyncGPU() { return s_bSyncGPU; @@ -1486,8 +1487,12 @@ void GetSettings() s_bClearSave = !File::Exists(SConfig::GetInstance().m_strMemoryCardA); s_language = SConfig::GetInstance().SelectedLanguage; } - s_memcards |= (SConfig::GetInstance().m_EXIDevice[0] == EXIDEVICE_MEMORYCARD) << 0; - s_memcards |= (SConfig::GetInstance().m_EXIDevice[1] == EXIDEVICE_MEMORYCARD) << 1; + s_memcards |= (SConfig::GetInstance().m_EXIDevice[0] == EXIDEVICE_MEMORYCARD || + SConfig::GetInstance().m_EXIDevice[0] == EXIDEVICE_MEMORYCARDFOLDER) + << 0; + s_memcards |= (SConfig::GetInstance().m_EXIDevice[1] == EXIDEVICE_MEMORYCARD || + SConfig::GetInstance().m_EXIDevice[1] == EXIDEVICE_MEMORYCARDFOLDER) + << 1; std::array revision = ConvertGitRevisionToBytes(scm_rev_git_str); std::copy(std::begin(revision), std::end(revision), std::begin(s_revision));