MCPcopy Create free account
hub / github.com/AppleWin/AppleWin / MemSaveSnapshot

Function MemSaveSnapshot

source/Memory.cpp:2832–2863  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2830}
2831
2832void MemSaveSnapshot(YamlSaveHelper& yamlSaveHelper)
2833{
2834 // Scope so that "Memory" & "Main Memory" are at same indent level
2835 {
2836 YamlSaveHelper::Label state(yamlSaveHelper, "%s:\n", MemGetSnapshotStructName().c_str());
2837 // LC bits
2838 // . For II,II+: set later by slot-0 LC or Saturn
2839 // . For //e,//c: set in SS_YAML_KEY_MMULCMODE
2840 yamlSaveHelper.SaveHexUint32(SS_YAML_KEY_MEMORYMODE, g_memmode & ~MF_LANGCARD_MASK); // Clear LC bits
2841 if (!IsApple2PlusOrClone(GetApple2Type())) // NB. Thesed are set later for II,II+ by slot-0 LC or Saturn
2842 {
2843 yamlSaveHelper.SaveHexUint32(SS_YAML_KEY_MMULCMODE, g_memmode & MF_LANGCARD_MASK);
2844 yamlSaveHelper.SaveUint(SS_YAML_KEY_LASTRAMWRITE, GetLastRamWrite() ? 1 : 0);
2845 }
2846 yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_IOSELECT, IO_SELECT);
2847 yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_IOSELECT_INT, INTC8ROM ? 1 : 0);
2848 yamlSaveHelper.SaveUint(SS_YAML_KEY_EXPANSIONROMTYPE, (UINT) g_eExpansionRomType);
2849 yamlSaveHelper.SaveUint(SS_YAML_KEY_PERIPHERALROMSLOT, g_uPeripheralRomSlot);
2850 yamlSaveHelper.SaveUint(SS_YAML_KEY_LASTSLOTTOSETMAINMEMLC, GetCardMgr().GetLanguageCardMgr().GetLastSlotToSetMainMemLC());
2851
2852 for (UINT i=0; i<kNumAnnunciators; i++)
2853 {
2854 std::string annunciator = SS_YAML_KEY_ANNUNCIATOR + std::string(1,'0'+i);
2855 yamlSaveHelper.SaveBool(annunciator.c_str(), g_Annunciator[i]);
2856 }
2857 }
2858
2859 if (IsApple2PlusOrClone(GetApple2Type()))
2860 MemSaveSnapshotMemory(yamlSaveHelper, true, 0, 48*1024); // NB. Language Card/Saturn provides the remaining 16K (or multiple) bank(s)
2861 else
2862 MemSaveSnapshotMemory(yamlSaveHelper, true);
2863}
2864
2865bool MemLoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT unitVersion)
2866{

Callers 1

Snapshot_SaveStateFunction · 0.85

Calls 9

IsApple2PlusOrCloneFunction · 0.85
GetApple2TypeFunction · 0.85
GetLastRamWriteFunction · 0.85
MemSaveSnapshotMemoryFunction · 0.85
SaveHexUint32Method · 0.80
SaveUintMethod · 0.80
SaveHexUint8Method · 0.80
SaveBoolMethod · 0.80

Tested by

no test coverage detected