only remount cards that were in use
This commit is contained in:
@@ -271,7 +271,7 @@ void GameState::PlayersFinalized()
|
||||
}
|
||||
|
||||
if( PREFSMAN->m_bMemoryCardsMountOnlyWhenNecessary )
|
||||
MEMCARDMAN->UnmountAllCards();
|
||||
MEMCARDMAN->UnmountAllUsedCards();
|
||||
}
|
||||
|
||||
/* This data is added to each player profile, and to the machine profile per-player. */
|
||||
@@ -345,7 +345,7 @@ void GameState::EndGame()
|
||||
|
||||
|
||||
if( PREFSMAN->m_bMemoryCardsMountOnlyWhenNecessary )
|
||||
MEMCARDMAN->MountAllCards();
|
||||
MEMCARDMAN->UnmountAllUsedCards();
|
||||
|
||||
|
||||
BOOKKEEPER->WriteToDisk();
|
||||
|
||||
@@ -222,7 +222,7 @@ void MemoryCardManager::LockCards( bool bLock )
|
||||
m_pDriver->SetMountThreadState( MemoryCardDriver::detect_and_mount );
|
||||
}
|
||||
|
||||
void MemoryCardManager::MountAllCards()
|
||||
void MemoryCardManager::TryMountAllCards()
|
||||
{
|
||||
FOREACH_PlayerNumber( p )
|
||||
{
|
||||
@@ -233,13 +233,30 @@ void MemoryCardManager::MountAllCards()
|
||||
}
|
||||
}
|
||||
|
||||
void MemoryCardManager::UnmountAllCards()
|
||||
void MemoryCardManager::MountAllUsedCards()
|
||||
{
|
||||
FOREACH_PlayerNumber( p )
|
||||
{
|
||||
if( m_Device[p].IsBlank() ) // they don't have an assigned card
|
||||
continue;
|
||||
|
||||
if( m_bTooLate[p] || !m_Device[p].bWriteTestSucceeded )
|
||||
continue;
|
||||
|
||||
m_pDriver->MountAndTestWrite(&m_Device[p], MEM_CARD_MOUNT_POINT[p]);
|
||||
}
|
||||
}
|
||||
|
||||
void MemoryCardManager::UnmountAllUsedCards()
|
||||
{
|
||||
FOREACH_PlayerNumber( p )
|
||||
{
|
||||
if( m_Device[p].IsBlank() ) // they don't have an assigned card
|
||||
continue;
|
||||
|
||||
if( m_bTooLate[p] || !m_Device[p].bWriteTestSucceeded )
|
||||
continue;
|
||||
|
||||
m_pDriver->Unmount(&m_Device[p], MEM_CARD_MOUNT_POINT[p]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,8 +27,9 @@ public:
|
||||
// CString GetOsMountDir( PlayerNumber pn ); // only valid when state = ready
|
||||
|
||||
void LockCards( bool bLock ); // prevent removing or changing of memory cards
|
||||
void MountAllCards();
|
||||
void UnmountAllCards();
|
||||
void TryMountAllCards();
|
||||
void MountAllUsedCards();
|
||||
void UnmountAllUsedCards();
|
||||
void MountCard( PlayerNumber pn );
|
||||
void UnmountCard( PlayerNumber pn );
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
static void SaveMachineStatsToFirstMemCard()
|
||||
{
|
||||
MEMCARDMAN->MountAllCards();
|
||||
MEMCARDMAN->TryMountAllCards();
|
||||
|
||||
FOREACH_PlayerNumber( pn )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user