Rename cylinder to track throughout (mostly).

This commit is contained in:
David Given
2022-03-25 20:16:12 +01:00
parent ea8af83d61
commit 86c5cccb08
115 changed files with 344 additions and 344 deletions

View File

@@ -87,7 +87,7 @@ public:
continue;
int currentTrackOffset = trackOffset;
int currentTrackCylinder = -1;
int currentTrackTrack = -1;
int currentSectorsInTrack =
0xffff; // don't know # of sectors until we read the first one
int trackSectorSize = -1;
@@ -105,7 +105,7 @@ public:
inputFile.read(
(char*)sectorHeader.begin(), sectorHeader.size());
ByteReader sectorHeaderReader(sectorHeader);
int cylinder = sectorHeaderReader.seek(0).read_8();
int track = sectorHeaderReader.seek(0).read_8();
int head = sectorHeaderReader.seek(1).read_8();
int sectorId = sectorHeaderReader.seek(2).read_8();
int sectorSize = 128 << sectorHeaderReader.seek(3).read_8();
@@ -132,21 +132,21 @@ public:
{
Error() << "D88: mismatched number of sectors in track";
}
if (currentTrackCylinder < 0)
if (currentTrackTrack < 0)
{
currentTrackCylinder = cylinder;
currentTrackTrack = track;
}
else if (currentTrackCylinder != cylinder)
else if (currentTrackTrack != track)
{
Error() << "D88: all sectors in a track must belong to the "
"same cylinder";
"same track";
}
if (trackSectorSize < 0)
{
trackSectorSize = sectorSize;
// this is the first sector we've read, use it settings for
// per-track data
trackdata->set_cylinder(cylinder * physicalStep);
trackdata->set_track(track * physicalStep);
trackdata->set_head(head);
trackdata->set_sector_size(sectorSize);
trackdata->set_use_fm(fm);
@@ -177,10 +177,10 @@ public:
Bytes data(sectorSize);
inputFile.read((char*)data.begin(), data.size());
const auto& sector =
image->put(cylinder * physicalStep, head, sectorId);
image->put(track * physicalStep, head, sectorId);
sector->status = Sector::OK;
sector->logicalTrack = cylinder;
sector->physicalCylinder = cylinder * physicalStep;
sector->logicalTrack = track;
sector->physicalTrack = track * physicalStep;
sector->logicalSide = sector->physicalHead = head;
sector->logicalSector = sectorId;
sector->data = data;
@@ -209,11 +209,11 @@ public:
heads->set_end(geometry.numSides - 1);
}
if (!config.has_cylinders())
if (!config.has_tracks())
{
auto* cylinders = config.mutable_cylinders();
cylinders->set_start(0);
cylinders->set_end(geometry.numTracks - 1);
auto* tracks = config.mutable_tracks();
tracks->set_start(0);
tracks->set_end(geometry.numTracks - 1);
}
return image;