From c1cf2a9a9985d2c91f1009bc2fc3a5fc4f98f96d Mon Sep 17 00:00:00 2001 From: Shawn Hoffman Date: Sat, 28 Feb 2009 21:46:04 +0000 Subject: [PATCH] allow changing of memcard path(and device) during emulation. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2482 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/DolphinWX/Src/ConfigMain.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Source/Core/DolphinWX/Src/ConfigMain.cpp b/Source/Core/DolphinWX/Src/ConfigMain.cpp index d4b8f807ed..6256416bc1 100644 --- a/Source/Core/DolphinWX/Src/ConfigMain.cpp +++ b/Source/Core/DolphinWX/Src/ConfigMain.cpp @@ -137,7 +137,6 @@ void CConfigMain::UpdateGUI() SkipIdle->Disable(); EnableCheats->Disable(); GCSystemLang->Disable(); - GCMemcardPath[0]->Disable(); GCMemcardPath[1]->Disable(); // Disable GC SI Stuff, but devices should be dynamic soon GCSIDevice[0]->Disable(); GCSIDevice[1]->Disable(); GCSIDevice[2]->Disable(); GCSIDevice[3]->Disable(); WiiPage->Disable(); @@ -671,7 +670,18 @@ void CConfigMain::ChooseMemcardPath(std::string& strMemcard, bool isSlotA) wxT("Gamecube Memory Cards (*.raw,*.gcp)|*.raw;*.gcp")).mb_str()); if (!filename.empty()) + { strMemcard = filename; + + if (Core::GetState() != Core::CORE_UNINITIALIZED) + { + // Change memcard to the new file + ExpansionInterface::ChangeDevice( + (isSlotA) ? 0 : 1, // SlotA: channel 0, SlotB channel 1 + (isSlotA) ? EXIDEVICE_MEMORYCARD_A : EXIDEVICE_MEMORYCARD_B, + 0); // SP1 is device 2, slots are device 0 + } + } } void CConfigMain::ChooseSIDevice(std::string deviceName, int deviceNum)