2 #------------------------------------------------------------------------------
3 # $File: spectrum,v 1.8 2017/09/11 23:51:12 christos Exp $
4 # spectrum: file(1) magic for Spectrum emulator files.
6 # John Elliott <jce@seasip.demon.co.uk>
9 # Spectrum +3DOS header
11 0 string PLUS3DOS\032 Spectrum +3 data
12 >15 byte 0 - BASIC program
13 >15 byte 1 - number array
14 >15 byte 2 - character array
15 >15 byte 3 - memory block
16 >>16 belong 0x001B0040 (screen)
17 >15 byte 4 - Tasword document
18 >15 string TAPEFILE - ZXT tapefile
20 # Tape file. This assumes the .TAP starts with a Spectrum-format header,
21 # which nearly all will.
23 # Update: Sanity-check string contents to be printable.
24 # -Adam Buchbinder <adam.buchbinder@gmail.com>
28 >>4 string <\177 Spectrum .TAP data "%-10.10s"
29 >>>3 byte 0 - BASIC program
30 >>>3 byte 1 - number array
31 >>>3 byte 2 - character array
32 >>>3 byte 3 - memory block
33 >>>>14 belong 0x001B0040 (screen)
35 # The following three blocks are from pak21-spectrum@srcf.ucam.org
37 0 string ZXTape!\x1a Spectrum .TZX data
41 # RZX input recording files
42 0 string RZX! Spectrum .RZX data
47 0 string MV\ -\ CPCEMU\ Disk-Fil Amstrad/Spectrum .DSK data
48 0 string MV\ -\ CPC\ format\ Dis Amstrad/Spectrum DU54 .DSK data
49 0 string EXTENDED\ CPC\ DSK\ Fil Amstrad/Spectrum Extended .DSK data
50 0 string SINCLAIR Spectrum .SCL Betadisk image
53 0 string RS-IDE\x1a Spectrum .HDF hard disk image
54 >7 byte x \b, version 0x%02x
56 # SZX snapshots (fuse and spectaculator)
57 # Martin M. S. Pedersen <martin@linux.com>
58 # http://www.spectaculator.com/docs/zx-state/header.shtml
60 0 string ZXST zx-state snapshot
63 >>6 byte 0 16k ZX Spectrum
64 >>6 byte 1 48k ZX Spectrum/ZX Spectrum+
65 >>6 byte 2 ZX Spectrum 128
66 >>6 byte 3 ZX Spectrum +2
67 >>6 byte 4 ZX Spectrum +2A/+2B
68 >>6 byte 5 ZX Spectrum +3
69 >>6 byte 6 ZX Spectrum +3e
70 >>6 byte 7 Pentagon 128
71 >>6 byte 8 Timex Sinclair TC2048
72 >>6 byte 9 Timex Sinclair TC2068
73 >>6 byte 10 Scorpion ZS-256
74 >>6 byte 11 ZX Spectrum SE
75 >>6 byte 12 Timex Sinclair TS2068
76 >>6 byte 13 Pentagon 512
77 >>6 byte 14 Pentagon 1024
78 >>6 byte 15 48k ZX Spectrum (NTSC)
79 >>6 byte 16 ZX Spectrum 12Ke
80 >>>7 byte 1 (alternate timings)