Card::Save/LoadSnapshot (PR #1003)

Add 2 virtual methods to Card to load and save snapshots.
This commit is contained in:
Andrea
2021-11-25 20:23:21 +00:00
committed by GitHub
parent abc631432d
commit 0b2104cc89
25 changed files with 132 additions and 148 deletions
+5 -5
View File
@@ -138,6 +138,9 @@ CMouseInterface::CMouseInterface(UINT slot) :
m_pSlotRom(NULL),
m_syncEvent(slot, 0, SyncEventCallback) // use slot# as "unique" id for MouseInterfaces
{
if (m_slot != 4) // fixme
throw std::string("Card: wrong slot");
m_6821.SetListenerB( this, M6821_Listener_B );
m_6821.SetListenerA( this, M6821_Listener_A );
@@ -651,7 +654,7 @@ void CMouseInterface::SaveSnapshotMC6821(YamlSaveHelper& yamlSaveHelper, std::st
yamlSaveHelper.SaveUint(SS_YAML_KEY_IB, byIB);
}
void CMouseInterface::SaveSnapshot(class YamlSaveHelper& yamlSaveHelper)
void CMouseInterface::SaveSnapshot(YamlSaveHelper& yamlSaveHelper)
{
// if (!m_bActive)
// return;
@@ -710,11 +713,8 @@ void CMouseInterface::LoadSnapshotMC6821(YamlLoadHelper& yamlLoadHelper, std::st
yamlLoadHelper.PopMap();
}
bool CMouseInterface::LoadSnapshot(class YamlLoadHelper& yamlLoadHelper, UINT slot, UINT version)
bool CMouseInterface::LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT version)
{
if (slot != 4) // fixme
throw std::string("Card: wrong slot");
if (version != 1)
throw std::string("Card: wrong version");