From ca287e7957c7a6ddca4275ce8299c9730e38ac29 Mon Sep 17 00:00:00 2001 From: skidau Date: Tue, 3 Jan 2012 15:36:32 +1100 Subject: [PATCH] Removed the "Reload MemCard on load state" hack as it is no longer needed with the new save states system. Fixes issue 4898. --- Source/Core/Core/Src/ConfigManager.cpp | 2 -- Source/Core/Core/Src/ConfigManager.h | 4 ---- Source/Core/Core/Src/HW/EXI_Channel.cpp | 6 +----- Source/Core/Core/Src/HW/EXI_DeviceMemoryCard.cpp | 12 ++---------- Source/Core/Core/Src/HW/EXI_DeviceMemoryCard.h | 1 - 5 files changed, 3 insertions(+), 22 deletions(-) diff --git a/Source/Core/Core/Src/ConfigManager.cpp b/Source/Core/Core/Src/ConfigManager.cpp index e70b021a0c..da8337bd04 100644 --- a/Source/Core/Core/Src/ConfigManager.cpp +++ b/Source/Core/Core/Src/ConfigManager.cpp @@ -223,7 +223,6 @@ void SConfig::SaveSettings() ini.Set("Core", "SelectedLanguage", m_LocalCoreStartupParameter.SelectedLanguage); ini.Set("Core", "MemcardA", m_strMemoryCardA); ini.Set("Core", "MemcardB", m_strMemoryCardB); - ini.Set("Core", "ReloadMemcardOnState", b_reloadMCOnState); ini.Set("Core", "SlotA", m_EXIDevice[0]); ini.Set("Core", "SlotB", m_EXIDevice[1]); ini.Set("Core", "SerialPort1", m_EXIDevice[2]); @@ -354,7 +353,6 @@ void SConfig::LoadSettings() ini.Get("Core", "SelectedLanguage", &m_LocalCoreStartupParameter.SelectedLanguage, 0); ini.Get("Core", "MemcardA", &m_strMemoryCardA); ini.Get("Core", "MemcardB", &m_strMemoryCardB); - ini.Get("Core", "ReloadMemcardOnState", &b_reloadMCOnState, true); ini.Get("Core", "SlotA", (int*)&m_EXIDevice[0], EXIDEVICE_MEMORYCARD); ini.Get("Core", "SlotB", (int*)&m_EXIDevice[1], EXIDEVICE_NONE); ini.Get("Core", "SerialPort1", (int*)&m_EXIDevice[2], EXIDEVICE_NONE); diff --git a/Source/Core/Core/Src/ConfigManager.h b/Source/Core/Core/Src/ConfigManager.h index 35ac8269e9..0c8f3f1af1 100644 --- a/Source/Core/Core/Src/ConfigManager.h +++ b/Source/Core/Core/Src/ConfigManager.h @@ -47,10 +47,6 @@ struct SConfig : NonCopyable std::string m_strMemoryCardA; std::string m_strMemoryCardB; - // eject and reload the memory card on state - // in ZTP and other games if the save file has been deleted from the memory card - //this is necessary to save after loading a savestate - bool b_reloadMCOnState; TEXIDevices m_EXIDevice[3]; SIDevices m_SIDevice[4]; std::string m_bba_mac; diff --git a/Source/Core/Core/Src/HW/EXI_Channel.cpp b/Source/Core/Core/Src/HW/EXI_Channel.cpp index c29a6f2bb2..91cb691546 100644 --- a/Source/Core/Core/Src/HW/EXI_Channel.cpp +++ b/Source/Core/Core/Src/HW/EXI_Channel.cpp @@ -284,8 +284,6 @@ void CEXIChannel::DoState(PointerWrap &p) p.Do(m_Control); p.Do(m_ImmData); - bool reloadOnState = SConfig::GetInstance().b_reloadMCOnState; - for (int d = 0; d < NUM_DEVICES; ++d) { IEXIDevice* pDevice = m_pDevices[d]; @@ -299,9 +297,7 @@ void CEXIChannel::DoState(PointerWrap &p) // also, if no movie is active, we'll assume the user wants to keep their current devices // instead of the ones they had when the savestate was created, // unless the device is NONE (since ChangeDevice sets that temporarily). - if(p.GetMode() != PointerWrap::MODE_READ || - (pDevice->m_deviceType != EXIDEVICE_NONE && - reloadOnState && !Movie::IsRecordingInput() && !Movie::IsPlayingInput())) + if(p.GetMode() != PointerWrap::MODE_READ) { delete pSaveDevice; } diff --git a/Source/Core/Core/Src/HW/EXI_DeviceMemoryCard.cpp b/Source/Core/Core/Src/HW/EXI_DeviceMemoryCard.cpp index 88116e9c7c..e7f052b864 100644 --- a/Source/Core/Core/Src/HW/EXI_DeviceMemoryCard.cpp +++ b/Source/Core/Core/Src/HW/EXI_DeviceMemoryCard.cpp @@ -52,7 +52,6 @@ CEXIMemoryCard::CEXIMemoryCard(const int index) m_strFilename = (card_index == 0) ? SConfig::GetInstance().m_strMemoryCardA : SConfig::GetInstance().m_strMemoryCardB; // we're potentially leaking events here, since there's no UnregisterEvent until emu shutdown, but I guess it's inconsequential et_this_card = CoreTiming::RegisterEvent((card_index == 0) ? "memcardA" : "memcardB", FlushCallback); - reloadOnState = SConfig::GetInstance().b_reloadMCOnState; interruptSwitch = 0; m_bInterruptSet = 0; @@ -426,14 +425,7 @@ void CEXIMemoryCard::TransferByte(u8 &byte) void CEXIMemoryCard::OnAfterLoad() { - // hack for memory card switching, so you can load an old savestate and expect your newer memcard data to show up. - // it breaks movie sync, so we disable it if a movie is active. - // this was moved out of DoState because other things that got loaded later conflicted with it. - // note: the reloadOnState flag is almost always true. maybe only a few TASers have it off. - if (reloadOnState && !Movie::IsRecordingInput() && !Movie::IsPlayingInput()) - { - ExpansionInterface::ChangeDevice(card_index, EXIDEVICE_MEMORYCARD, 0); - } + } void CEXIMemoryCard::DoState(PointerWrap &p) @@ -441,7 +433,7 @@ void CEXIMemoryCard::DoState(PointerWrap &p) // for movie sync, we need to save/load memory card contents (and other data) in savestates. // otherwise, we'll assume the user wants to keep their memcards and saves separate, // unless we're loading (in which case we let the savestate contents decide, in order to stay aligned with them). - bool storeContents = (!reloadOnState || Movie::IsRecordingInput() || Movie::IsPlayingInput()); + bool storeContents = (Movie::IsRecordingInput() || Movie::IsPlayingInput()); p.Do(storeContents); if (storeContents) diff --git a/Source/Core/Core/Src/HW/EXI_DeviceMemoryCard.h b/Source/Core/Core/Src/HW/EXI_DeviceMemoryCard.h index ac2cdd69f8..5da8c63183 100644 --- a/Source/Core/Core/Src/HW/EXI_DeviceMemoryCard.h +++ b/Source/Core/Core/Src/HW/EXI_DeviceMemoryCard.h @@ -71,7 +71,6 @@ private: std::string m_strFilename; int card_index; int et_this_card; - bool reloadOnState; //! memory card state // STATE_TO_SAVE