Skip to content

Commit 23beec7

Browse files
authored
[atari][media] fix sector/offset calculations for 512 b/s on ATR files. (#997)
1 parent 8e86312 commit 23beec7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/media/atari/diskTypeAtr.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ uint32_t MediaTypeATR::_sector_to_offset(uint16_t sectorNum)
3838
else
3939
offset = 272;
4040
break;
41-
default:
41+
default: // TODO: refactor this to generalize.
4242
if (_disk_sector_size == 256)
4343
offset = ((sectorNum - 3) * 256) + 16 + 128;
4444
else if (_disk_sector_size == 512)
45-
offset = (sectorNum * 512) + 16;
45+
offset = ((sectorNum - 1) * 512) + 16;
4646
else
4747
offset = ((sectorNum - 1) * 128) + 16;
4848
break;

0 commit comments

Comments
 (0)