Skip to content

Commit

Permalink
td0: Fix flag handling for images with per-track is_fm flag
Browse files Browse the repository at this point in the history
Also fix another misuse of Python logical operator with non-boolean
argument elsewhere in the code base.
  • Loading branch information
keirf committed Jun 14, 2024
1 parent f30023c commit 4022500
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/greaseweazle/image/scp.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def from_bytes(self, dat: bytes) -> None:
if sum(dat[16:]) & 0xffffffff != checksum:
print('SCP: WARNING: Bad image checksum')

index_cued = flags & 1 or nr_revs == 1
index_cued = (flags & 1) == 1 or nr_revs == 1

# Some tools generate a short TLUT. We handle this by truncating the
# TLUT at the first Track Data Header.
Expand Down
2 changes: 1 addition & 1 deletion src/greaseweazle/image/td0.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def from_bytes(self, dat: bytes) -> None:
'TD0: bad track header crc')
off += 4

track_is_fm = (head & 128) or global_is_fm
track_is_fm = (head & 128) == 128 or global_is_fm
head &= 127

fmt = ibm.IBMTrack_FixedDef(['ibm.mfm','ibm.fm'][track_is_fm])
Expand Down

0 comments on commit 4022500

Please sign in to comment.