Correctly write physical sector at the end of the track

In particular, `dos33.a2r` linked in
https://github.com/a2-4am/passport.py/issues/3
ends up with sector 0 having a start of 49255 and an end of 3295.

This fixes `dos33.a2r` but not `Copy II Plus Parameter Disk - Disk 1, Side A.a2r`.
Its .woz file will now `passport.py verify` but still doesn't boot
in an emulator. (in fact, it may have passed `verify woz` before and my
report otherwise was incorrect)
This commit is contained in:
Jeff Epler 2022-03-23 12:39:33 -05:00
parent 11c93c1f2b
commit a4060ed7c3
No known key found for this signature in database
GPG Key ID: D5BF15AB975AB4DE

View File

@ -727,7 +727,11 @@ class Convert(BasePassportProcessor):
if physical_sectors:
b = bitarray.bitarray(endian="big")
for s in physical_sectors.values():
b.extend(track.bits[s.start_bit_index:s.end_bit_index])
if s.start_bit_index <= s.end_bit_index:
b.extend(track.bits[s.start_bit_index:s.end_bit_index])
else:
b.extend(track.bits[s.start_bit_index:])
b.extend(track.bits[:s.end_bit_index])
else:
# TODO call wozify here instead
b = track.bits[:51021]