mirror of
https://github.com/AppleWin/AppleWin.git
synced 2026-04-21 23:16:39 +00:00
Save-state: refactor: added a LoadMemory() specialisation for vector<BYTE>
This commit is contained in:
+1
-4
@@ -1934,10 +1934,7 @@ bool Disk2InterfaceCard::LoadSnapshotFloppy(YamlLoadHelper& yamlLoadHelper, UINT
|
||||
|
||||
if (yamlLoadHelper.GetSubMap(SS_YAML_KEY_TRACK_IMAGE))
|
||||
{
|
||||
const UINT maxNibblesPerTrack = ImageGetMaxNibblesPerTrack(m_floppyDrive[unit].m_disk.m_imagehandle);
|
||||
track.reserve(maxNibblesPerTrack); // expand (but don't shrink) vector's capacity (NB. vector's size doesn't change)
|
||||
UINT bytes = yamlLoadHelper.LoadMemory(&track[0], maxNibblesPerTrack);
|
||||
track.resize(bytes); // resize so that vector contains /bytes/ elements
|
||||
yamlLoadHelper.LoadMemory(track, ImageGetMaxNibblesPerTrack(m_floppyDrive[unit].m_disk.m_imagehandle));
|
||||
yamlLoadHelper.PopMap();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user