From 9efb8a341d751bacd4c090b8275d5b76a1e67993 Mon Sep 17 00:00:00 2001 From: "Admiral H. Curtiss" Date: Fri, 31 Jul 2015 01:06:31 +0200 Subject: [PATCH] MemoryCard: Auto-detect memory card type. Should fix the issue discussed here: http://forums.pcsx2.net/Thread-Memory-cards-not-showing --- pcsx2/gui/MemoryCardFile.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pcsx2/gui/MemoryCardFile.cpp b/pcsx2/gui/MemoryCardFile.cpp index 5463334cce..07d2e64a3f 100644 --- a/pcsx2/gui/MemoryCardFile.cpp +++ b/pcsx2/gui/MemoryCardFile.cpp @@ -428,6 +428,22 @@ uint FileMcd_ConvertToSlot( uint port, uint slot ) static void PS2E_CALLBACK FileMcd_EmuOpen( PS2E_THISPTR thisptr, const PS2E_SessionInfo *session ) { + // detect inserted memory card types + for ( uint slot = 0; slot < 8; ++slot ) { + if ( g_Conf->Mcd[slot].Enabled ) { + MemoryCardType type = MemoryCardType::MemoryCard_File; // default to file if we can't find anything at the path so it gets auto-generated + + const wxString path = g_Conf->FullpathToMcd( slot ); + if ( wxFileExists( path ) ) { + type = MemoryCardType::MemoryCard_File; + } else if ( wxDirExists( path ) ) { + type = MemoryCardType::MemoryCard_Folder; + } + + g_Conf->Mcd[slot].Type = type; + } + } + thisptr->impl.Open(); thisptr->implFolder.SetFiltering( g_Conf->EmuOptions.McdFolderAutoManage ); thisptr->implFolder.Open();