From 756641e83742410654f594a72ec0938f11742fe9 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sun, 16 Jun 2019 22:00:12 -0400 Subject: [PATCH] Fixed: tags go first, then data. --- Storage/Disk/DiskImage/Formats/DiskCopy42.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Storage/Disk/DiskImage/Formats/DiskCopy42.cpp b/Storage/Disk/DiskImage/Formats/DiskCopy42.cpp index e762b1ae1..fb02a08d3 100644 --- a/Storage/Disk/DiskImage/Formats/DiskCopy42.cpp +++ b/Storage/Disk/DiskImage/Formats/DiskCopy42.cpp @@ -138,18 +138,19 @@ std::shared_ptr<::Storage::Disk::Track> DiskCopy42::get_track_at_position(::Stor for(int c = 0; c < included_sectors.length; ++c) { uint8_t sector_plus_tags[524]; - // Copy in the sector body. - memcpy(sector_plus_tags, sector, 512); - sector += 512; - // Copy in the tags, if provided; otherwise generate them. if(tags) { - memcpy(§or_plus_tags[512], tags, 12); + memcpy(sector_plus_tags, tags, 12); tags += 12; } else { - // TODO: generate tags. + // TODO: fill in tags properly. + memset(sector_plus_tags, 0, 12); } + // Copy in the sector body. + memcpy(§or_plus_tags[12], sector, 512); + sector += 512; + // NB: sync lengths below are identical to those for // the Apple II, as I have no idea whatsoever what they // should be.