mirror of https://github.com/PCSX2/pcsx2.git
Merge pull request #687 from AdmiralCurtiss/memcard-type-detection-fix
Auto-detect memory card types instead of trusting the config ini.
This commit is contained in:
commit
0c86dd5763
|
@ -611,10 +611,6 @@ void AppConfig::LoadSaveMemcards( IniInterface& ini )
|
||||||
Mcd[slot].Enabled, Mcd[slot].Enabled );
|
Mcd[slot].Enabled, Mcd[slot].Enabled );
|
||||||
ini.Entry( pxsFmt( L"Slot%u_Filename", slot+1 ),
|
ini.Entry( pxsFmt( L"Slot%u_Filename", slot+1 ),
|
||||||
Mcd[slot].Filename, Mcd[slot].Filename );
|
Mcd[slot].Filename, Mcd[slot].Filename );
|
||||||
int type = (int)Mcd[slot].Type;
|
|
||||||
ini.Entry( pxsFmt( L"Slot%u_Type", slot + 1 ),
|
|
||||||
type, (int)MemoryCardType::MemoryCard_File );
|
|
||||||
Mcd[slot].Type = (MemoryCardType)type;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for( uint slot=2; slot<8; ++slot )
|
for( uint slot=2; slot<8; ++slot )
|
||||||
|
@ -626,10 +622,6 @@ void AppConfig::LoadSaveMemcards( IniInterface& ini )
|
||||||
Mcd[slot].Enabled, Mcd[slot].Enabled );
|
Mcd[slot].Enabled, Mcd[slot].Enabled );
|
||||||
ini.Entry( pxsFmt( L"Multitap%u_Slot%u_Filename", mtport, mtslot ),
|
ini.Entry( pxsFmt( L"Multitap%u_Slot%u_Filename", mtport, mtslot ),
|
||||||
Mcd[slot].Filename, Mcd[slot].Filename );
|
Mcd[slot].Filename, Mcd[slot].Filename );
|
||||||
int type = (int)Mcd[slot].Type;
|
|
||||||
ini.Entry( pxsFmt( L"Multitap%u_Slot%u_Type", mtport, mtslot ),
|
|
||||||
type, (int)MemoryCardType::MemoryCard_File );
|
|
||||||
Mcd[slot].Type = (MemoryCardType)type;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -428,6 +428,22 @@ uint FileMcd_ConvertToSlot( uint port, uint slot )
|
||||||
|
|
||||||
static void PS2E_CALLBACK FileMcd_EmuOpen( PS2E_THISPTR thisptr, const PS2E_SessionInfo *session )
|
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->impl.Open();
|
||||||
thisptr->implFolder.SetFiltering( g_Conf->EmuOptions.McdFolderAutoManage );
|
thisptr->implFolder.SetFiltering( g_Conf->EmuOptions.McdFolderAutoManage );
|
||||||
thisptr->implFolder.Open();
|
thisptr->implFolder.Open();
|
||||||
|
|
Loading…
Reference in New Issue