mirror of
https://github.com/TomHarte/CLK.git
synced 2025-04-05 04:37:41 +00:00
That should be that, I hope.
This commit is contained in:
parent
02c9a82cb5
commit
d1c861d3a5
@ -59,10 +59,22 @@ std::shared_ptr<Track> SSD::get_track_at_position(unsigned int head, unsigned in
|
||||
long file_offset = (position * (_head_count ? 2 : 1) + head) * 256 * 10;
|
||||
fseek(_file, file_offset, SEEK_SET);
|
||||
|
||||
// std::vector<
|
||||
std::vector<Storage::Encodings::MFM::Sector> sectors;
|
||||
for(int sector = 0; sector < 10; sector++)
|
||||
{
|
||||
Storage::Encodings::MFM::Sector new_sector;
|
||||
new_sector.track = (uint8_t)position;
|
||||
new_sector.side = 0;
|
||||
new_sector.sector = (uint8_t)sector;
|
||||
|
||||
new_sector.data.resize(256);
|
||||
fread(&new_sector.data[0], 1, 256, _file);
|
||||
if(feof(_file)) break;
|
||||
|
||||
sectors.push_back(std::move(new_sector));
|
||||
}
|
||||
|
||||
if(sectors.size()) return Storage::Encodings::MFM::GetFMTrackWithSectors(sectors);
|
||||
|
||||
return track;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user