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

Method SaveSnapshotHDDUnit

source/Harddisk.cpp:1294–1314  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1292}
1293
1294void HarddiskInterfaceCard::SaveSnapshotHDDUnit(YamlSaveHelper& yamlSaveHelper, const UINT unit)
1295{
1296 const UINT baseUnitNum = 1; // Unit0 is the SP Controller, so SP units start from 1
1297
1298 YamlSaveHelper::Label label(yamlSaveHelper, "%s%d:\n", SS_YAML_KEY_HDDUNIT, baseUnitNum + unit);
1299 yamlSaveHelper.SaveString(SS_YAML_KEY_FILENAME, m_hardDiskDrive[unit].m_fullname);
1300 yamlSaveHelper.SaveString(SS_YAML_KEY_ABSOLUTE_PATH, ImageGetPathname(m_hardDiskDrive[unit].m_imagehandle));
1301 yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_ERROR, m_hardDiskDrive[unit].m_error);
1302 yamlSaveHelper.SaveHexUint16(SS_YAML_KEY_MEMBLOCK, m_hardDiskDrive[unit].m_memblock);
1303 yamlSaveHelper.SaveHexUint32(SS_YAML_KEY_DISKBLOCK, m_hardDiskDrive[unit].m_diskblock);
1304 yamlSaveHelper.SaveBool(SS_YAML_KEY_IMAGELOADED, m_hardDiskDrive[unit].m_imageloaded);
1305 yamlSaveHelper.SaveUint(SS_YAML_KEY_STATUS_NEXT, m_hardDiskDrive[unit].m_status_next);
1306 yamlSaveHelper.SaveUint(SS_YAML_KEY_STATUS_PREV, m_hardDiskDrive[unit].m_status_prev);
1307 yamlSaveHelper.SaveHexUint16(SS_YAML_KEY_BUF_PTR, m_hardDiskDrive[unit].m_buf_ptr);
1308
1309 // New label
1310 {
1311 YamlSaveHelper::Label buffer(yamlSaveHelper, "%s:\n", SS_YAML_KEY_BUF);
1312 yamlSaveHelper.SaveMemory(m_hardDiskDrive[unit].m_buf, HD_BLOCK_SIZE);
1313 }
1314}
1315
1316void HarddiskInterfaceCard::SaveSnapshot(YamlSaveHelper& yamlSaveHelper)
1317{

Callers

nothing calls this directly

Calls 7

SaveStringMethod · 0.80
SaveHexUint8Method · 0.80
SaveHexUint16Method · 0.80
SaveHexUint32Method · 0.80
SaveBoolMethod · 0.80
SaveUintMethod · 0.80
SaveMemoryMethod · 0.80

Tested by

no test coverage detected