From ff65a9f6bf98adc0a208d666e20c20b3cab5f9f3 Mon Sep 17 00:00:00 2001 From: tomcw Date: Sat, 18 Dec 2021 21:31:17 +0000 Subject: [PATCH] Save-state: remove ASSERT when saving LC for //e or Enhanced //e --- source/CardManager.cpp | 18 +++++++++--------- source/LanguageCard.h | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/source/CardManager.cpp b/source/CardManager.cpp index 31554031..fabecaa6 100644 --- a/source/CardManager.cpp +++ b/source/CardManager.cpp @@ -216,7 +216,7 @@ void CardManager::InitializeIO(LPBYTE pCxRomPeripheral) // if it is a //e then SLOT0 must be CT_LanguageCardIIe (and the other way round) _ASSERT(IsApple2PlusOrClone(GetApple2Type()) != (m_slot[SLOT0]->QueryType() == CT_LanguageCardIIe)); - for (UINT i = 0; i < NUM_SLOTS; ++i) + for (UINT i = SLOT0; i < NUM_SLOTS; ++i) { if (m_slot[i]) { @@ -227,18 +227,18 @@ void CardManager::InitializeIO(LPBYTE pCxRomPeripheral) void CardManager::Update(const ULONG nExecutedCycles) { - for (UINT i = 0; i < NUM_SLOTS; ++i) - { - if (m_slot[i]) - { - m_slot[i]->Update(nExecutedCycles); - } - } + for (UINT i = SLOT0; i < NUM_SLOTS; ++i) + { + if (m_slot[i]) + { + m_slot[i]->Update(nExecutedCycles); + } + } } void CardManager::SaveSnapshot(YamlSaveHelper& yamlSaveHelper) { - for (UINT i = 0; i < NUM_SLOTS; ++i) + for (UINT i = SLOT0; i < NUM_SLOTS; ++i) { if (m_slot[i]) { diff --git a/source/LanguageCard.h b/source/LanguageCard.h index 80fd408c..ca2bac75 100644 --- a/source/LanguageCard.h +++ b/source/LanguageCard.h @@ -21,7 +21,7 @@ public: virtual void InitializeIO(LPBYTE pCxRomPeripheral); virtual UINT GetActiveBank(void) { return 0; } // Always 0 as only 1x 16K bank - virtual void SaveSnapshot(YamlSaveHelper& yamlSaveHelper) { _ASSERT(0); } // Not used for //e + virtual void SaveSnapshot(YamlSaveHelper& yamlSaveHelper) { } // A no-op for //e - called from CardManager::SaveSnapshot() virtual bool LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT version) { _ASSERT(0); return false; } // Not used for //e BOOL GetLastRamWrite(void) { return m_uLastRamWrite; }