Actually start using the new physical sector stuff.

This commit is contained in:
David Given
2022-09-10 20:43:24 +02:00
parent e40e6bd07f
commit 085ad5f2a4
25 changed files with 80 additions and 95 deletions

View File

@@ -63,7 +63,7 @@ public:
{
unsigned track = trackid.first;
unsigned side = trackid.second;
auto trackLayout = Layout::getLayoutOfTrack(track, side);
auto& trackLayout = Layout::getLayoutOfTrack(track, side);
locations.insert(Mapper::computeLocationFor(track, side));
/* If we don't have all the sectors of this track, we may need to
@@ -131,7 +131,7 @@ private:
auto trackdata = readAndDecodeTrack(*_fluxSource, *_decoder, location);
for (const auto& sector : trackdata->sectors)
*_loadedSectors.put(track, side, sector->physicalSector) = *sector;
*_loadedSectors.put(track, side, sector->logicalSector) = *sector;
_loadedTracks.insert(trackid_t(track, side));
}

View File

@@ -164,7 +164,7 @@ Filesystem::Filesystem(std::shared_ptr<SectorInterface> sectors):
int track = p.first;
int side = p.second;
auto trackLayout = Layout::getLayoutOfTrack(track, side);
auto& trackLayout = Layout::getLayoutOfTrack(track, side);
if (trackLayout.logicalSectors.empty())
Error() << "FS: filesystem support cannot be used without concrete "
"layout information";
@@ -268,7 +268,7 @@ Bytes Filesystem::getLogicalSector(uint32_t number, uint32_t count)
int track = std::get<0>(it);
int side = std::get<1>(it);
int sector = std::get<2>(it);
auto trackLayout = Layout::getLayoutOfTrack(track, side);
auto& trackLayout = Layout::getLayoutOfTrack(track, side);
bw += _sectors->get(track, side, sector)
->data.slice(0, trackLayout.sectorSize);
}