fix Windows prompts to insert disk if memory card not present
This commit is contained in:
@@ -317,6 +317,7 @@ void PrefsManager::ReadGlobalPrefsFromDisk()
|
||||
ini.GetValue( "Options", ssprintf("DefaultMachineProfileIDP%d",p+1), m_sDefaultMachineProfileID[p] );
|
||||
ini.GetValue( "Options", ssprintf("MemoryCardDirP%d",p+1), m_sMemoryCardDir[p] );
|
||||
FixSlashesInPlace( m_sMemoryCardDir[p] );
|
||||
ini.GetValue( "Options", ssprintf("MemoryCardMountCommandP%d",p+1), m_sMemoryCardMountCommand[p] );
|
||||
}
|
||||
|
||||
ini.GetValue( "Options", "CenterImageTranslateX", m_iCenterImageTranslateX );
|
||||
@@ -453,6 +454,7 @@ void PrefsManager::SaveGlobalPrefsToDisk() const
|
||||
{
|
||||
ini.SetValue( "Options", ssprintf("DefaultMachineProfileIDP%d",p+1), m_sDefaultMachineProfileID[p] );
|
||||
ini.SetValue( "Options", ssprintf("MemoryCardDirP%d",p+1), m_sMemoryCardDir[p] );
|
||||
ini.SetValue( "Options", ssprintf("MemoryCardMountCommandP%d",p+1), m_sMemoryCardMountCommand[p] );
|
||||
}
|
||||
|
||||
ini.SetValue( "Options", "CenterImageTranslateX", m_iCenterImageTranslateX );
|
||||
|
||||
@@ -108,6 +108,7 @@ public:
|
||||
CString m_sLanguage;
|
||||
CString m_sDefaultMachineProfileID[NUM_PLAYERS];
|
||||
CString m_sMemoryCardDir[NUM_PLAYERS];
|
||||
CString m_sMemoryCardMountCommand[NUM_PLAYERS];
|
||||
int m_iCenterImageTranslateX;
|
||||
int m_iCenterImageTranslateY;
|
||||
float m_fCenterImageScaleX;
|
||||
|
||||
@@ -163,9 +163,25 @@ bool ProfileManager::IsMemoryCardInserted( PlayerNumber pn )
|
||||
sizeof(szFileSystemNameBuffer) );
|
||||
return !!bResult;
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
|
||||
return true;
|
||||
// Try to create directory before writing a temp file.
|
||||
CreateDirectories( sDir );
|
||||
|
||||
// Test whether a memory card is usable by trying to write a file.
|
||||
CString sFile = sDir + "temp";
|
||||
FILE* fp = fopen( sFile, "w" );
|
||||
if( fp )
|
||||
{
|
||||
fclose( fp );
|
||||
remove( sFile );
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
bool ProfileManager::LoadProfileFromMemoryCard( PlayerNumber pn )
|
||||
@@ -182,6 +198,10 @@ bool ProfileManager::LoadProfileFromMemoryCard( PlayerNumber pn )
|
||||
|
||||
bool ProfileManager::LoadFirstAvailableProfile( PlayerNumber pn )
|
||||
{
|
||||
// mount card
|
||||
if( !PREFSMAN->m_sMemoryCardMountCommand[pn].empty() )
|
||||
system( PREFSMAN->m_sMemoryCardMountCommand[pn] );
|
||||
|
||||
if( IsMemoryCardInserted(pn) )
|
||||
{
|
||||
if( LoadProfileFromMemoryCard(pn) )
|
||||
|
||||
Reference in New Issue
Block a user