mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-31 11:17:01 -07:00
Fix several embarassingly stupid bugs in the brother 120kB encoder code path.
This commit is contained in:
@@ -135,7 +135,7 @@ std::unique_ptr<Fluxmap> BrotherEncoder::encode(
|
||||
switch (_format)
|
||||
{
|
||||
case 120:
|
||||
if ((physicalTrack < 0) || (physicalTrack >= BROTHER_TRACKS_PER_120KB_DISK)
|
||||
if ((physicalTrack < 0) || (physicalTrack >= (BROTHER_TRACKS_PER_120KB_DISK*2))
|
||||
|| (physicalTrack & 1))
|
||||
return std::unique_ptr<Fluxmap>();
|
||||
logicalTrack = physicalTrack/2;
|
||||
@@ -164,7 +164,7 @@ std::unique_ptr<Fluxmap> BrotherEncoder::encode(
|
||||
const auto& sectorData = allSectors.get(logicalTrack, 0, sectorId);
|
||||
|
||||
fillBitmapTo(bits, cursor, headerCursor, { true, false });
|
||||
write_sector_header(bits, cursor, physicalTrack, sectorId);
|
||||
write_sector_header(bits, cursor, logicalTrack, sectorId);
|
||||
fillBitmapTo(bits, cursor, dataCursor, { true, false });
|
||||
write_sector_data(bits, cursor, sectorData->data);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user