Merge pull request #559 from RachelBryk/gci-folder-state

Merge pull request #559 from RachelBryk/gci-folder-state

Keep device type EXIDEVICE_MEMORYCARDFOLDER for gci folder.
This commit is contained in:
Dolphin Bot 2014-07-06 07:34:55 +02:00
commit 8da2bc63cf
3 changed files with 5 additions and 2 deletions

View File

@ -103,7 +103,6 @@ IEXIDevice* EXIDevice_Create(TEXIDevices device_type, const int channel_num)
{
bool gci_folder = (device_type == EXIDEVICE_MEMORYCARDFOLDER);
result = new CEXIMemoryCard(channel_num, gci_folder);
device_type = EXIDEVICE_MEMORYCARD;
break;
}
case EXIDEVICE_MASKROM:

View File

@ -33,6 +33,8 @@ void CEXIMemoryCard::FlushCallback(u64 userdata, int cyclesLate)
// note that userdata is forbidden to be a pointer, due to the implementation of EventDoState
int card_index = (int)userdata;
CEXIMemoryCard* pThis = (CEXIMemoryCard*)ExpansionInterface::FindDevice(EXIDEVICE_MEMORYCARD, card_index);
if (pThis == nullptr)
pThis = (CEXIMemoryCard*)ExpansionInterface::FindDevice(EXIDEVICE_MEMORYCARDFOLDER, card_index);
if (pThis && pThis->memorycard)
pThis->memorycard->Flush();
}
@ -41,6 +43,8 @@ void CEXIMemoryCard::CmdDoneCallback(u64 userdata, int cyclesLate)
{
int card_index = (int)userdata;
CEXIMemoryCard* pThis = (CEXIMemoryCard*)ExpansionInterface::FindDevice(EXIDEVICE_MEMORYCARD, card_index);
if (pThis == nullptr)
pThis = (CEXIMemoryCard*)ExpansionInterface::FindDevice(EXIDEVICE_MEMORYCARDFOLDER, card_index);
if (pThis)
pThis->CmdDone();
}

View File

@ -63,7 +63,7 @@ static Common::Event g_compressAndDumpStateSyncEvent;
static std::thread g_save_thread;
// Don't forget to increase this after doing changes on the savestate system
static const u32 STATE_VERSION = 27;
static const u32 STATE_VERSION = 28;
enum
{