1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-25 18:30:21 +00:00

Fixed: tags go first, then data.

This commit is contained in:
Thomas Harte 2019-06-16 22:00:12 -04:00
parent 05c2854dbc
commit 756641e837

View File

@ -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) { for(int c = 0; c < included_sectors.length; ++c) {
uint8_t sector_plus_tags[524]; 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. // Copy in the tags, if provided; otherwise generate them.
if(tags) { if(tags) {
memcpy(&sector_plus_tags[512], tags, 12); memcpy(sector_plus_tags, tags, 12);
tags += 12; tags += 12;
} else { } else {
// TODO: generate tags. // TODO: fill in tags properly.
memset(sector_plus_tags, 0, 12);
} }
// Copy in the sector body.
memcpy(&sector_plus_tags[12], sector, 512);
sector += 512;
// NB: sync lengths below are identical to those for // NB: sync lengths below are identical to those for
// the Apple II, as I have no idea whatsoever what they // the Apple II, as I have no idea whatsoever what they
// should be. // should be.