From ee44b2a639a4e33fd0240f89d71e83babc91857f Mon Sep 17 00:00:00 2001 From: Shawn Hoffman Date: Sat, 28 Feb 2009 22:01:58 +0000 Subject: [PATCH] add a simple check to keep people from using the same memcard in both slots. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2483 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/DolphinWX/Src/ConfigMain.cpp | 26 ++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/Source/Core/DolphinWX/Src/ConfigMain.cpp b/Source/Core/DolphinWX/Src/ConfigMain.cpp index 6256416bc1..292432bf40 100644 --- a/Source/Core/DolphinWX/Src/ConfigMain.cpp +++ b/Source/Core/DolphinWX/Src/ConfigMain.cpp @@ -671,15 +671,25 @@ void CConfigMain::ChooseMemcardPath(std::string& strMemcard, bool isSlotA) if (!filename.empty()) { - strMemcard = filename; - - if (Core::GetState() != Core::CORE_UNINITIALIZED) + // also check that the path isn't used for the other memcard... + if (filename.compare(isSlotA ? SConfig::GetInstance().m_strMemoryCardB + : SConfig::GetInstance().m_strMemoryCardA) != 0) { - // 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 + 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 + } + } + else + { + PanicAlert("Cannot use that file as a memory card.\n" + "Are you trying to use the same file in both slots?"); } } }