Skip to content

Commit

Permalink
Make utils/rzxplay.py reject RZX files recorded in +2 mode
Browse files Browse the repository at this point in the history
  • Loading branch information
skoolkid committed Feb 14, 2024
1 parent fa007fa commit a4a5adc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions utils/rzxplay.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,21 +193,23 @@ def check_supported(snapshot, options):
if len(header) == 30:
# Version 1
return
if header[37] & 128:
return 'Unsupported machine type'
machine_id = header[34]
if len(header) == 55:
# Version 2
if machine_id not in (0, 3):
return 'Unsupported machine type'
# Version 3
elif machine_id not in (0, 4, 12):
elif machine_id not in (0, 4):
return 'Unsupported machine type'
elif snapshot.type == 'SZX':
supported_blocks = {'AY', 'CRTR', 'KEYB', 'JOY', 'RAMP', 'SPCR', 'TAPE', 'Z80R'}
unsupported_blocks = set(b[0] for b in snapshot.tail) - supported_blocks
if unsupported_blocks:
return 'Unsupported block(s) ({}) in SZX snapshot'.format(', '.join(unsupported_blocks))
machine_id = snapshot.header[6]
if machine_id > 3:
if machine_id > 2:
return 'Unsupported machine type'

def run(infile, options):
Expand Down

0 comments on commit a4a5adc

Please sign in to comment.