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

Method SaveSnapshot

source/Mockingboard.cpp:1242–1275  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1240}
1241
1242void MockingboardCard::SaveSnapshot(YamlSaveHelper& yamlSaveHelper)
1243{
1244 if (QueryType() == CT_Phasor)
1245 return Phasor_SaveSnapshot(yamlSaveHelper);
1246
1247 //
1248
1249 std::string cardName = GetSnapshotCardName();
1250 if (QueryType() == CT_MegaAudio)
1251 cardName = GetSnapshotCardNameMegaAudio();
1252 else if (QueryType() == CT_SDMusic)
1253 cardName = GetSnapshotCardNameSDMusic();
1254
1255 YamlSaveHelper::Slot slot(yamlSaveHelper, cardName, m_slot, kUNIT_VERSION);
1256
1257 YamlSaveHelper::Label state(yamlSaveHelper, "%s:\n", SS_YAML_KEY_STATE);
1258
1259 for (UINT subunit = 0; subunit < NUM_SUBUNITS_PER_MB; subunit++)
1260 {
1261 MB_SUBUNIT* pMB = &m_MBSubUnit[subunit];
1262
1263 YamlSaveHelper::Label unit(yamlSaveHelper, "%s%d:\n", SS_YAML_KEY_MB_UNIT, subunit);
1264
1265 pMB->sy6522.SaveSnapshot(yamlSaveHelper);
1266 AY8910_SaveSnapshot(yamlSaveHelper, subunit, AY8913_DEVICE_A, std::string(""));
1267 pMB->ssi263.SaveSnapshot(yamlSaveHelper, subunit);
1268
1269 yamlSaveHelper.SaveHexUint4(SS_YAML_KEY_MB_UNIT_STATE, pMB->state[0]);
1270 yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_AY_CURR_REG, pMB->nAYCurrentRegister[0]); // save all 8 bits (even though top 4 bits should be 0)
1271 yamlSaveHelper.SaveBool(SS_YAML_KEY_CS_A, pMB->isChipSelected[0]);
1272 yamlSaveHelper.SaveBool(SS_YAML_KEY_LATCH_ADDR_VALID_A, pMB->isAYLatchedAddressValid[0]);
1273 yamlSaveHelper.SaveBool(SS_YAML_KEY_BUS_DRIVEN, pMB->isBusDriven);
1274 }
1275}
1276
1277bool MockingboardCard::LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT version)
1278{

Callers 2

AY8910_SaveSnapshotMethod · 0.45
Phasor_SaveSnapshotMethod · 0.45

Calls 3

SaveHexUint4Method · 0.80
SaveHexUint8Method · 0.80
SaveBoolMethod · 0.80

Tested by

no test coverage detected