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
This commit is contained in:
Shawn Hoffman 2009-02-28 22:01:58 +00:00
parent c1cf2a9a99
commit ee44b2a639
1 changed files with 18 additions and 8 deletions

View File

@ -670,6 +670,10 @@ void CConfigMain::ChooseMemcardPath(std::string& strMemcard, bool isSlotA)
wxT("Gamecube Memory Cards (*.raw,*.gcp)|*.raw;*.gcp")).mb_str()); wxT("Gamecube Memory Cards (*.raw,*.gcp)|*.raw;*.gcp")).mb_str());
if (!filename.empty()) if (!filename.empty())
{
// 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)
{ {
strMemcard = filename; strMemcard = filename;
@ -677,11 +681,17 @@ void CConfigMain::ChooseMemcardPath(std::string& strMemcard, bool isSlotA)
{ {
// Change memcard to the new file // Change memcard to the new file
ExpansionInterface::ChangeDevice( ExpansionInterface::ChangeDevice(
(isSlotA) ? 0 : 1, // SlotA: channel 0, SlotB channel 1 isSlotA ? 0 : 1, // SlotA: channel 0, SlotB channel 1
(isSlotA) ? EXIDEVICE_MEMORYCARD_A : EXIDEVICE_MEMORYCARD_B, isSlotA ? EXIDEVICE_MEMORYCARD_A : EXIDEVICE_MEMORYCARD_B,
0); // SP1 is device 2, slots are device 0 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?");
}
}
} }
void CConfigMain::ChooseSIDevice(std::string deviceName, int deviceNum) void CConfigMain::ChooseSIDevice(std::string deviceName, int deviceNum)