mirror of
https://github.com/AppleWin/AppleWin.git
synced 2026-04-20 15:17:50 +00:00
Make harddisk a class (#995)
. Add user-protection when unchecking HDD controller (as images aren't restored on a 'cancel') . Fix possible crash when removing (via Config->Disk) either Disk2 card(s5) or HDD card(s7), then cancelling during emulation . Fix m_buf[] size
This commit is contained in:
+7
-10
@@ -147,7 +147,10 @@ void Snapshot_GetDefaultFilenameAndPath(std::string& defaultFilename, std::strin
|
||||
{
|
||||
// Attempt to get a default filename/path based on harddisk plugged-in or floppy disk inserted
|
||||
// . Priority given to harddisk over floppy images
|
||||
HD_GetFilenameAndPathForSaveState(defaultFilename, defaultPath);
|
||||
|
||||
if (GetCardMgr().QuerySlot(SLOT7) == CT_GenericHDD)
|
||||
dynamic_cast<HarddiskInterfaceCard&>(GetCardMgr().GetRef(SLOT7)).GetFilenameAndPathForSaveState(defaultFilename, defaultPath);
|
||||
|
||||
if (defaultFilename.empty())
|
||||
GetCardMgr().GetDisk2CardMgr().GetFilenameAndPathForSaveState(defaultFilename, defaultPath);
|
||||
}
|
||||
@@ -370,11 +373,11 @@ static void ParseSlots(YamlLoadHelper& yamlLoadHelper, UINT unitVersion)
|
||||
GetCardMgr().Insert(slot, type);
|
||||
bRes = dynamic_cast<Disk2InterfaceCard&>(GetCardMgr().GetRef(slot)).LoadSnapshot(yamlLoadHelper, slot, cardVersion);
|
||||
}
|
||||
else if (card == HD_GetSnapshotCardName())
|
||||
else if (card == HarddiskInterfaceCard::GetSnapshotCardName())
|
||||
{
|
||||
type = CT_GenericHDD;
|
||||
GetCardMgr().Insert(slot, type);
|
||||
bRes = HD_LoadSnapshot(yamlLoadHelper, slot, cardVersion, g_strSaveStatePath);
|
||||
bRes = dynamic_cast<HarddiskInterfaceCard&>(GetCardMgr().GetRef(slot)).LoadSnapshot(yamlLoadHelper, slot, cardVersion, g_strSaveStatePath);
|
||||
}
|
||||
else if (card == tfe_GetSnapshotCardName())
|
||||
{
|
||||
@@ -496,9 +499,6 @@ static void Snapshot_LoadState_v2(void)
|
||||
MemReset(); // Also calls CpuInitialize()
|
||||
GetPravets().Reset();
|
||||
|
||||
HD_Reset();
|
||||
HD_SetEnabled(false); // Set disabled & also removes card from slot 7
|
||||
|
||||
KeybReset();
|
||||
GetVideo().VideoResetState();
|
||||
GetVideo().SetVideoRefreshRate(VR_60HZ); // Default to 60Hz as older save-states won't contain refresh rate
|
||||
@@ -574,9 +574,6 @@ void Snapshot_LoadState()
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// todo:
|
||||
// . Uthernet card
|
||||
|
||||
void Snapshot_SaveState(void)
|
||||
{
|
||||
try
|
||||
@@ -646,7 +643,7 @@ void Snapshot_SaveState(void)
|
||||
dynamic_cast<Disk2InterfaceCard&>(GetCardMgr().GetRef(SLOT6)).SaveSnapshot(yamlSaveHelper);
|
||||
|
||||
if (GetCardMgr().QuerySlot(SLOT7) == CT_GenericHDD)
|
||||
HD_SaveSnapshot(yamlSaveHelper);
|
||||
dynamic_cast<HarddiskInterfaceCard&>(GetCardMgr().GetRef(SLOT7)).SaveSnapshot(yamlSaveHelper);
|
||||
|
||||
for (UINT slot = SLOT3; slot <= SLOT5; slot++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user