Improved determining path & filename when saving/loading a save-state (#691) (PR #849)

Whenever harddisks/disks are inserted (or removed) and *if path has changed* then:
. Then the internal save-state's path & filename will be updated to reflect the new defaults.
. LoadConfiguration(): Read the save-state pathname from Registry before harddisks/disks.

Also:
. CiderPress: only save pathname on OK.
. Refactored CPropertySheetHelper::BrowseToFile().
. Extended support for -d1,-d2,-h1, etc such that if the param is "", then it will eject/unplug the disk/harddisk.
This commit is contained in:
TomCh
2020-10-25 17:14:23 +00:00
committed by GitHub
parent aa322dbd53
commit 43455eb4fe
16 changed files with 207 additions and 140 deletions
+13
View File
@@ -132,3 +132,16 @@ bool Disk2CardManager::IsAnyFirmware13Sector(void)
}
return false;
}
void Disk2CardManager::GetFilenameAndPathForSaveState(std::string& filename, std::string& path)
{
for (int i = NUM_SLOTS-1; i >= 0; i--) // scan slots backwards: 7->0
{
if (GetCardMgr().QuerySlot(i) == CT_Disk2)
{
dynamic_cast<Disk2InterfaceCard&>(GetCardMgr().GetRef(i)).GetFilenameAndPathForSaveState(filename, path);
if (!filename.empty())
return;
}
}
}