xref: /freebsd/contrib/file/magic/Magdir/c64 (revision ae316d1d1cffd71ab7751f94e10118777a88e027)
1b6cee71dSXin LI
2b6cee71dSXin LI#------------------------------------------------------------------------------
3*ae316d1dSXin LI# $File: c64,v 1.16 2024/03/07 22:30:21 christos Exp $
4b6cee71dSXin LI# c64:  file(1) magic for various commodore 64 related files
5b6cee71dSXin LI#
6b6cee71dSXin LI# From: Dirk Jagdmann <doj@cubic.org>
7b6cee71dSXin LI
8b6cee71dSXin LI0x16500	belong		0x12014100	D64 Image
9b6cee71dSXin LI0x16500	belong		0x12014180	D71 Image
10b6cee71dSXin LI0x61800 belong		0x28034400	D81 Image
11b6cee71dSXin LI0	belong		0x43154164	X64 Image
12b6cee71dSXin LI
13a4d6d3b8SXin LI# C64 (and other CBM) cartridges
14a4d6d3b8SXin LI# Extended by David Korth <gerbilsoft@gerbilsoft.com>
15*ae316d1dSXin LI# Update:	Joerg Jenderek
16a4d6d3b8SXin LI# Reference: https://vice-emu.sourceforge.io/vice_17.html#SEC391
17*ae316d1dSXin LI#		http://ist.uwaterloo.ca/~schepers/formats/CRT.TTX
18*ae316d1dSXin LI#		http://mark0.net/download/triddefs_xml.7z/defs/c/crt-c64.trid.xml
19*ae316d1dSXin LI# Note:		called "C64 Cartridge image" by TrID and
20*ae316d1dSXin LI#		"CRT C64 Cartridge Image Format" by DROID via PUID fmt/822
21a4d6d3b8SXin LI
22*ae316d1dSXin LI0	string		C64\40CARTRIDGE
23*ae316d1dSXin LI# skip DROID fmt-822-signature-id-1179.crt with missing packet length
24*ae316d1dSXin LI>0x44	ubelong		>0x10
25*ae316d1dSXin LI>>0	use		c64-crt
26*ae316d1dSXin LI#	display Commodore 64 cartridge information
27*ae316d1dSXin LI0	name		c64-crt
28*ae316d1dSXin LI>0	string		x		Commodore 64 cartridge
29*ae316d1dSXin LI#!:mime	application/octet-stream
30*ae316d1dSXin LI!:mime	application/x-commodore-crt
31*ae316d1dSXin LI!:ext	crt
32*ae316d1dSXin LI#		http://mark0.net/download/triddefs_xml.7z/defs/c/car-ccs64.trid.xml
33*ae316d1dSXin LI#!:ext	crt/car
34a4d6d3b8SXin LI>0x20	ubyte	0	\b,
35a4d6d3b8SXin LI>0x20	ubyte	!0
36*ae316d1dSXin LI# 32-byte null padded cartridge name like: "BUGS BUNNY" "CART64" "EasyFlash" "FINAL CARTRIDGE" "Magic Desk" "VICE CART"
37a4d6d3b8SXin LI>>0x20	string/T	x	\b: "%.32s",
38*ae316d1dSXin LI# cartridge hardware type
39a4d6d3b8SXin LI>0x16	beshort	0
40*ae316d1dSXin LI# cartridge port EXROM line status
41a4d6d3b8SXin LI>>0x18	beshort	0x0000	16 KB game
42a4d6d3b8SXin LI>>0x18	beshort	0x0001	8 KB game
43a4d6d3b8SXin LI>>0x18	beshort	0x0100	UltiMax mode
44a4d6d3b8SXin LI>>0x18	beshort	0x0101	RAM/disabled
45a4d6d3b8SXin LI>0x16	beshort	1	Action Replay
46a4d6d3b8SXin LI>0x16	beshort	2	KCS Power Cartridge
47a4d6d3b8SXin LI>0x16	beshort	3	Final Cartridge III
48a4d6d3b8SXin LI>0x16	beshort	4	Simons' BASIC
49a4d6d3b8SXin LI>0x16	beshort	5	Ocean type 1
50a4d6d3b8SXin LI>0x16	beshort	6	Expert Cartridge
51a4d6d3b8SXin LI>0x16	beshort	7	Fun Play, Power Play
52a4d6d3b8SXin LI>0x16	beshort	8	Super Games
53a4d6d3b8SXin LI>0x16	beshort	9	Atomic Power
54a4d6d3b8SXin LI>0x16	beshort	10	Epyx Fastload
55a4d6d3b8SXin LI>0x16	beshort	11	Westermann Learning
56a4d6d3b8SXin LI>0x16	beshort	12	Rex Utility
57a4d6d3b8SXin LI>0x16	beshort	13	Final Cartridge I
58a4d6d3b8SXin LI>0x16	beshort	14	Magic Formel
59a4d6d3b8SXin LI>0x16	beshort	15	C64 Game System, System 3
60a4d6d3b8SXin LI>0x16	beshort	16	Warp Speed
61a4d6d3b8SXin LI>0x16	beshort	17	Dinamic
62a4d6d3b8SXin LI>0x16	beshort	18	Zaxxon / Super Zaxxon (Sega)
63a4d6d3b8SXin LI>0x16	beshort	19	Magic Desk, Domark, HES Australia
64a4d6d3b8SXin LI>0x16	beshort	20	Super Snapshot V5
65a4d6d3b8SXin LI>0x16	beshort	21	Comal-80
66a4d6d3b8SXin LI>0x16	beshort	22	Structured BASIC
67a4d6d3b8SXin LI>0x16	beshort	23	Ross
68a4d6d3b8SXin LI>0x16	beshort	24	Dela EP64
69a4d6d3b8SXin LI>0x16	beshort	25	Dela EP7x8
70a4d6d3b8SXin LI>0x16	beshort	26	Dela EP256
71a4d6d3b8SXin LI>0x16	beshort	27	Rex EP256
72a4d6d3b8SXin LI>0x16	beshort	28	Mikro Assembler
73a4d6d3b8SXin LI>0x16	beshort	29	Final Cartridge Plus
74a4d6d3b8SXin LI>0x16	beshort	30	Action Replay 4
75a4d6d3b8SXin LI>0x16	beshort	31	Stardos
76a4d6d3b8SXin LI>0x16	beshort	32	EasyFlash
77a4d6d3b8SXin LI>0x16	beshort	33	EasyFlash Xbank
78a4d6d3b8SXin LI>0x16	beshort	34	Capture
79a4d6d3b8SXin LI>0x16	beshort	35	Action Replay 3
80a4d6d3b8SXin LI>0x16	beshort	36
81*ae316d1dSXin LI# cartridge Hardware Revision/Subtype (usually 0) (added in v1.01)
82a4d6d3b8SXin LI>>0x1A	ubyte	1	Nordic Replay
83a4d6d3b8SXin LI>>0x1A	ubyte	!1	Retro Replay
84a4d6d3b8SXin LI>0x16	beshort	37	MMC64
85a4d6d3b8SXin LI>0x16	beshort	38	MMC Replay
86a4d6d3b8SXin LI>0x16	beshort	39	IDE64
87a4d6d3b8SXin LI>0x16	beshort	40	Super Snapshot V4
88a4d6d3b8SXin LI>0x16	beshort	41	IEEE-488
89a4d6d3b8SXin LI>0x16	beshort	42	Game Killer
90a4d6d3b8SXin LI>0x16	beshort	43	Prophet64
91a4d6d3b8SXin LI>0x16	beshort	44	EXOS
92a4d6d3b8SXin LI>0x16	beshort	45	Freeze Frame
93a4d6d3b8SXin LI>0x16	beshort	46	Freeze Machine
94a4d6d3b8SXin LI>0x16	beshort	47	Snapshot64
95a4d6d3b8SXin LI>0x16	beshort	48	Super Explode V5.0
96a4d6d3b8SXin LI>0x16	beshort	49	Magic Voice
97a4d6d3b8SXin LI>0x16	beshort	50	Action Replay 2
98a4d6d3b8SXin LI>0x16	beshort	51	MACH 5
99a4d6d3b8SXin LI>0x16	beshort	52	Diashow-Maker
100a4d6d3b8SXin LI>0x16	beshort	53	Pagefox
101a4d6d3b8SXin LI>0x16	beshort	54	Kingsoft
102a4d6d3b8SXin LI>0x16	beshort	55	Silverrock 128K Cartridge
103a4d6d3b8SXin LI>0x16	beshort	56	Formel 64
104a4d6d3b8SXin LI>0x16	beshort	57
105a4d6d3b8SXin LI>>0x1A	ubyte	1	Hucky
106a4d6d3b8SXin LI>>0x1A	ubyte	!1	RGCD
107a4d6d3b8SXin LI>0x16	beshort	58	RR-Net MK3
108a4d6d3b8SXin LI>0x16	beshort	59	EasyCalc
109a4d6d3b8SXin LI>0x16	beshort	60	GMod2
110a4d6d3b8SXin LI>0x16	beshort	61	MAX Basic
111a4d6d3b8SXin LI>0x16	beshort	62	GMod3
112a4d6d3b8SXin LI>0x16	beshort	63	ZIPP-CODE 48
113a4d6d3b8SXin LI>0x16	beshort	64	Blackbox V8
114a4d6d3b8SXin LI>0x16	beshort	65	Blackbox V3
115a4d6d3b8SXin LI>0x16	beshort	66	Blackbox V4
116a4d6d3b8SXin LI>0x16	beshort	67	REX RAM-Floppy
117a4d6d3b8SXin LI>0x16	beshort	68	BIS-Plus
118a4d6d3b8SXin LI>0x16	beshort	69	SD-BOX
119a4d6d3b8SXin LI>0x16	beshort	70	MultiMAX
120a4d6d3b8SXin LI>0x16	beshort	71	Blackbox V9
121a4d6d3b8SXin LI>0x16	beshort	72	Lt. Kernal Host Adaptor
122a4d6d3b8SXin LI>0x16	beshort	73	RAMLink
123a4d6d3b8SXin LI>0x16	beshort	74	H.E.R.O.
124a4d6d3b8SXin LI>0x16	beshort	75	IEEE Flash! 64
125a4d6d3b8SXin LI>0x16	beshort	76	Turtle Graphics II
126a4d6d3b8SXin LI>0x16	beshort	77	Freeze Frame MK2
127*ae316d1dSXin LI>0x16	beshort	78	Partner 64
128*ae316d1dSXin LI# cartridge hardware type: (0-78)
129*ae316d1dSXin LI>0x16	ubeshort >78	unknown type %#x
130*ae316d1dSXin LI# Cartridge Hardware Revision/Subtype (usually 0 added in v1.01)
131*ae316d1dSXin LI>>0x1A	ubyte	>0	revision %#x
132*ae316d1dSXin LI# padded with 3 space characters for CRT but for CCS64 Cartridge (*.CAR) maybe different according to TrID
133*ae316d1dSXin LI>14	ubeshort	!0x2020	\b, at 14 %#x
134*ae316d1dSXin LI# file header length like: 20h (reported wrong) 40h (default and minimum)
135*ae316d1dSXin LI>0x10	ubelong	!0x40	\b, header length %#x
136*ae316d1dSXin LI# cartridge version like: 1.0 1.1 (adds CRT sub type/hardware revision) 2.0 (introduces VIC20, PLUS4, C128, CBM2)
137*ae316d1dSXin LI>0x14	ubeshort	!0x0100
138*ae316d1dSXin LI>>0x14	ubyte		x	\b, version %u
139*ae316d1dSXin LI>>0x15	ubyte		x	\b.%u
140*ae316d1dSXin LI# cartridge content start with ROM signature which must be CHIP
141*ae316d1dSXin LI>0x40	ubelong	!0x43484950	\b, invalid ROM signature
142*ae316d1dSXin LI>>0x40	string	x		"%0.4s"
143*ae316d1dSXin LI# total packet length (length of ROM image size and header combined) like: 2010h 4010h
144*ae316d1dSXin LI>0x44	ubelong	x	\b, packet length %#x
145a4d6d3b8SXin LI
146a4d6d3b8SXin LI0	string		C128\40CARTRIDGE	Commodore 128 cartridge
147a4d6d3b8SXin LI>0x20	ubyte	0	\b,
148a4d6d3b8SXin LI>0x20	ubyte	!0
149a4d6d3b8SXin LI>>0x20	string/T	x	\b: "%.32s",
150a4d6d3b8SXin LI>0x16	beshort	0	generic cartridge
151a4d6d3b8SXin LI>0x16	beshort	1	Warpspeed128
152a4d6d3b8SXin LI>>0x1A	ubyte	1	\b, REU support
153a4d6d3b8SXin LI>>0x1A	ubyte	2	\b, REU support, with I/O and ROM banking
154a4d6d3b8SXin LI
155a4d6d3b8SXin LI0	string		CBM2\40CARTRIDGE	Commodore CBM-II cartridge
156a4d6d3b8SXin LI>0x20	ubyte	!0
157a4d6d3b8SXin LI>>0x20	string/T	x	\b: "%.32s"
158a4d6d3b8SXin LI
159a4d6d3b8SXin LI0	string		VIC20\40CARTRIDGE	Commodore VIC-20 cartridge
160a4d6d3b8SXin LI>0x20	ubyte	0	\b,
161a4d6d3b8SXin LI>0x20	ubyte	!0
162a4d6d3b8SXin LI>>0x20	string/T	x	\b: "%.32s",
163a4d6d3b8SXin LI>0x16	beshort	0	generic cartridge
164a4d6d3b8SXin LI>0x16	beshort	1	Mega-Cart
165a4d6d3b8SXin LI>0x16	beshort	2	Behr Bonz
166a4d6d3b8SXin LI>0x16	beshort	3	Vic Flash Plugin
167a4d6d3b8SXin LI>0x16	beshort	4	UltiMem
168a4d6d3b8SXin LI>0x16	beshort	5	Final Expansion
169a4d6d3b8SXin LI
170a4d6d3b8SXin LI0	string		PLUS4\40CARTRIDGE	Commodore 16/Plus4 cartridge
171a4d6d3b8SXin LI>0x20	ubyte	!0
172a4d6d3b8SXin LI>>0x20	string/T	x	\b: "%.32s"
173a4d6d3b8SXin LI
174a4d6d3b8SXin LI
175a4d6d3b8SXin LI# DreamLoad archives see:
176a4d6d3b8SXin LI# https://www.lemon64.com/forum/viewtopic.php?t=37415\
177a4d6d3b8SXin LI# &sid=494dc2ca91289e05dadf80a7f8a968fe (at the bottom).
178a4d6d3b8SXin LI# https://www.c64-wiki.com/wiki/DreamLoad.
179a4d6d3b8SXin LI# Example HVSC Commodore 64 music collection:
180a4d6d3b8SXin LI# https://kohina.duckdns.org/HVSC/C64Music/10_Years_HVSC.dfi
181a4d6d3b8SXin LI
182a4d6d3b8SXin LI0	byte	0
183a4d6d3b8SXin LI>1	string	DREAMLOAD\40FILE\40ARCHIVE
184a4d6d3b8SXin LI>>0x17	byte	0	DFI Image
185a4d6d3b8SXin LI>>>0x1a	leshort	x	version: %d.
186a4d6d3b8SXin LI>>>0x18	leshort	x	\b%d
187a4d6d3b8SXin LI>>>0x1c	lelong	x	tracks: %d
188a4d6d3b8SXin LI
189b6cee71dSXin LI0	string		GCR-1541	GCR Image
190b6cee71dSXin LI>8	byte		x		version: %i
191b6cee71dSXin LI>9	byte		x		tracks: %i
192b6cee71dSXin LI
193b6cee71dSXin LI9	string		PSUR		ARC archive (c64)
194b6cee71dSXin LI2	string		-LH1-		LHA archive (c64)
195b6cee71dSXin LI
196b6cee71dSXin LI0	string		C64File		PC64 Emulator file
197b6cee71dSXin LI>8	string		>\0		"%s"
198b6cee71dSXin LI0	string		C64Image	PC64 Freezer Image
199b6cee71dSXin LI
200b6cee71dSXin LI0	beshort		0x38CD		C64 PCLink Image
201b6cee71dSXin LI0	string		CBM\144\0\0	Power 64 C64 Emulator Snapshot
202b6cee71dSXin LI
203b6cee71dSXin LI0	belong		0xFF424CFF	WRAptor packer (c64)
204b6cee71dSXin LI
205*ae316d1dSXin LI# URL:		http://fileformats.archiveteam.org/wiki/T64
206*ae316d1dSXin LI# Reference:	http://ist.uwaterloo.ca/~schepers/formats/T64.TXT
207*ae316d1dSXin LI#		https://vice-emu.sourceforge.io/vice_16.html#SEC394
208*ae316d1dSXin LI#		https://www.infinite-loop.at/Power64/Documentation/Power64-ReadMe/AE-File_Formats.html
209*ae316d1dSXin LI#		http://mark0.net/download/triddefs_xml.7z/defs/e/emu-t64.trid.xml
210*ae316d1dSXin LI# Note:		called "Commodore 64 Tape container" by TrID, "T64 Tape Image Format" by DROID via PUID fmt/820 and
211*ae316d1dSXin LI# 		"T64 tape Image" by ./c64,v 1.14
212*ae316d1dSXin LI#		verified by command like `deark -m t64 -l -d2 Caitan_the_Demo.t64` and
213*ae316d1dSXin LI#		`cbmconvert -v2 -t -D4 ironmanoffroad.d64 ironmanoffroad.t64`
214*ae316d1dSXin LI# 32 byte signature starting like C64S\x20tape\x20file
215*ae316d1dSXin LI# C64\x20tape\x20image\x20file\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0
216*ae316d1dSXin LI# C64S\x20tape\x20image\x20file\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0
217*ae316d1dSXin LI0	string/b	C64
218*ae316d1dSXin LI# skip raw Commodore TAPe by check for unsed areas (\0 filled) and valid low (40h+m*20h; m=0-FFffh) offset
219*ae316d1dSXin LI>0x46	ubequad&0xFFff1F00C0ffFFff	0	Commodore Tape image
220*ae316d1dSXin LI#!:mime	application/octet-stream
221*ae316d1dSXin LI#!:mime	application/x-commodore-tape
222*ae316d1dSXin LI!:ext	t64
223*ae316d1dSXin LI# version like: 0100h (examples found) 0101h 0200h (no examples)
224*ae316d1dSXin LI>>32	leshort		x		Version:%#x
225*ae316d1dSXin LI#>>32	leshort		!0x0100		Version:%#x
226*ae316d1dSXin LI# number of used directory entries like: 0 1 2 5
227*ae316d1dSXin LI>>36	leshort		!0		Entries:%i
228*ae316d1dSXin LI# tape container name, 24 characters (padded with 20h but with A0h for DirMaster created samples) like:
229*ae316d1dSXin LI# ->ZYRON'S PD<- IMAGETAPE MY-T64-TEST\240\240\240 OPERATIONWOLF+3-711.T64
230*ae316d1dSXin LI>>40	string/24/Tb	>\040		Name:%.24s
231*ae316d1dSXin LI# MaxFiles; maximal directory entries like: 0 1 2 5 30 (=1Eh some emulators expect exactly this value) 31 32
232*ae316d1dSXin LI>>34	uleshort	x		MaxFiles:%u
233*ae316d1dSXin LI# 1st C64 filetype: 0~free 1~normal tape file 2~tape file with header 3~memory snapshot 4~tape block 5~digitized stream 6-255~reserved
234*ae316d1dSXin LI>>0x40	ubyte		!1		\b, C64 file type %#x
235*ae316d1dSXin LI# 1st start address or load address of first entry like: 0000 (empty|snapshot) 04a0h (ironmanoffroad.t64) 0801h (typically) 1201h (3501_quizmaster_program_s1.t64)
236*ae316d1dSXin LI>>0x42	uleshort	!0x0801		\b, load address %#4.4x
237*ae316d1dSXin LI# 1st actual end address in memory
238*ae316d1dSXin LI>>0x44	uleshort	x		\b, end address %#4.4x
239*ae316d1dSXin LI# reserved; must be 0
240*ae316d1dSXin LI>>0x26	ubeshort	!0		\b, at +0x26 %#x
241*ae316d1dSXin LI# not used like: 0 (examples found and according to TrID)
242*ae316d1dSXin LI>>0x46	ubeshort	!0		\b, at 0x46 %#4.4x
243*ae316d1dSXin LI# not used like: 0 (examples found and according to TrID)
244*ae316d1dSXin LI>>0x4c	ubelong		!0		\b, at 0x4C %#8.8x
245*ae316d1dSXin LI# offset (=64+32*m) into 1st container file like: 0 (empty) 60h 80h E0h 400h 440h ...
246*ae316d1dSXin LI>>0x48	ulelong		>0		\b, at %#x
247*ae316d1dSXin LI# 1st filename (in PETASCII, padded with 20h, not A0h) like: "DRILLINSTR. /HTL" "WIZBALL+        " ...
248*ae316d1dSXin LI>>>0x50	string/16/bT	x		"%0.16s"
249*ae316d1dSXin LI# https://www.lyonlabs.org/commodore/onrequest/Inside_Commodore_Dos.pdf
250*ae316d1dSXin LI# file type like: 0~Scratched 1~SEQunclosed 81h~SEQ 82h~PRG C2h~PRGlocked ...
251*ae316d1dSXin LI>>>0x41	ubyte		x
252*ae316d1dSXin LI>>>>0x41	ubyte	=0x00		Scratched type
253*ae316d1dSXin LI>>>>0x41	ubyte	=0x01		SEQ unclosed type
254*ae316d1dSXin LI#>>>>0x41	ubyte	=0x44		foo type
255*ae316d1dSXin LI>>>>0x41	ubyte	=0x80		DEL type
256*ae316d1dSXin LI>>>>0x41	ubyte	=0x81		SEQ type
257*ae316d1dSXin LI>>>>0x41	ubyte	=0x82		PRG type
258*ae316d1dSXin LI>>>>0x41	ubyte	=0x83		USR type
259*ae316d1dSXin LI>>>>0x41	ubyte	=0x84		REL type
260*ae316d1dSXin LI>>>>0x41	ubyte	=0xC2		PRG locked type
261*ae316d1dSXin LI# other 	unusual file type
262*ae316d1dSXin LI>>>>0x41	default	x
263*ae316d1dSXin LI>>>>>0x41	ubyte	x		%#2.2x type
264*ae316d1dSXin LI# inspect 1st entry content (often Commodore C64 BASIC program *.PRG) without load adress
265*ae316d1dSXin LI#>>(0x48.l)	ubequad		x	\b, 1st data %16.16llx...
2669ce06829SXin LI
2679ce06829SXin LI# Raw tape file format (.tap files)
2689ce06829SXin LI# Esa Hyyti <esa@netlab.tkk.fi>
269*ae316d1dSXin LI# Update:	Joerg Jenderek
270*ae316d1dSXin LI# URL:		http://fileformats.archiveteam.org/wiki/Tap_file
271*ae316d1dSXin LI#		https://vice-emu.sourceforge.io/vice_16.html#SEC392
272*ae316d1dSXin LI# Reference:	http://ist.uwaterloo.ca/~schepers/formats/TAP.TXT
273*ae316d1dSXin LI# Note:		called "TAP (Commodore 64)" by DROID via PUID fmt/802
274*ae316d1dSXin LI#		a variant starting with C16-TAPE-RAW should exist, but no examples found
275*ae316d1dSXin LI0	string/b	C64-TAPE-RAW	Commodore raw Tape image (platform
276*ae316d1dSXin LI#0	string		C64-TAPE-RAW	C64 Raw Tape File (.tap),
277*ae316d1dSXin LI#!:mime	application/octet-stream
278*ae316d1dSXin LI!:mime	application/x-commodore-tape
279*ae316d1dSXin LI!:ext	tap
280*ae316d1dSXin LI# According to TrID als raw suffix, but no such samples found
281*ae316d1dSXin LI#!:ext	tap/raw
282*ae316d1dSXin LI# computer platform like: 0~C64 1~VIC-20 2~C16 Plus/4 3~PET 4~C5x0 5~C6x0 C7x0
283*ae316d1dSXin LI>0xD	ubyte		0		C64
284*ae316d1dSXin LI>0xD	ubyte		1		VIC-20
285*ae316d1dSXin LI>0xD	ubyte		2		C16 Plus/4
286*ae316d1dSXin LI>0xD	ubyte		3		PET
287*ae316d1dSXin LI>0xD	ubyte		4		C5x0
288*ae316d1dSXin LI>0xD	ubyte		5		C6x0 C7x0
289*ae316d1dSXin LI# this should not happen!
290*ae316d1dSXin LI>0xD	ubyte		>5		%#2.2x
291*ae316d1dSXin LI>0xD	ubyte		x		\b),
292*ae316d1dSXin LI# Reference:	http://mark0.net/download/triddefs_xml.7z/defs/t/tap.trid.xml
293*ae316d1dSXin LI#		http://mark0.net/download/triddefs_xml.7z/defs/t/tap-1.trid.xml
294*ae316d1dSXin LI# Note:		called "C64 Tape image format" (v0-original) (v1-updated)" by TrID
295*ae316d1dSXin LI# TAP version like: 0~OriginalLayout 1~Updated (often)
2969ce06829SXin LI>0x0c	byte		x		Version:%u,
297*ae316d1dSXin LI# file data size (not including header)
2989ce06829SXin LI>0x10	lelong		x		Length:%u cycles
299*ae316d1dSXin LI# video standard like: 0~PAL 1~NTSC 2~OLD NTSC 3~PALN
300*ae316d1dSXin LI>0xE	ubyte		x    		\b, video
301*ae316d1dSXin LI>0xE	ubyte		0		PAL
302*ae316d1dSXin LI>0xE	ubyte		1		NTSC
303*ae316d1dSXin LI>0xE	ubyte		2		old NTSC
304*ae316d1dSXin LI>0xE	ubyte		3		PALN
305*ae316d1dSXin LI# this should not happen!
306*ae316d1dSXin LI>0xE	ubyte		>3		%#2.2x
307*ae316d1dSXin LI# reserved for future expansion like: 0
308*ae316d1dSXin LI>0xF	ubyte		!0		\b, at 0xF %#2.2x
309*ae316d1dSXin LI# file data
310*ae316d1dSXin LI#>014	ubequad		x		\b, data %16.16llx
31158a0f0d0SEitan Adler
31258a0f0d0SEitan Adler# magic for Goattracker2, http://covertbitops.c64.org/
31358a0f0d0SEitan Adler# from Alex Myczko <alex@aiei.ch>
31458a0f0d0SEitan Adler0	string		GTS5		GoatTracker 2 song
31558a0f0d0SEitan Adler>4	string		>\0		\b, "%s"
31658a0f0d0SEitan Adler>36	string		>\0		\b by %s
31758a0f0d0SEitan Adler>68	string		>\0		\b (C) %s
31858a0f0d0SEitan Adler>100	byte		>0		\b, %u subsong(s)
31958a0f0d0SEitan Adler
32043a5ec4eSXin LI# CBM BASIC (cc65 compiled)
321898496eeSXin LI# Summary:	binary executable or Basic program for Commodore C64 computers
322898496eeSXin LI# Update:	Joerg Jenderek
323898496eeSXin LI# URL:		http://fileformats.archiveteam.org/wiki/Commodore_BASIC_tokenized_file
324898496eeSXin LI# Reference:	https://www.c64-wiki.com/wiki/BASIC_token
325898496eeSXin LI#		https://github.com/thezerobit/bastext/blob/master/bastext.doc
326898496eeSXin LI#		http://mark0.net/download/triddefs_xml.7z/defs/p/prg-c64.trid.xml
327898496eeSXin LI# TODO:		unify Commodore BASIC/program sub routines
328898496eeSXin LI# Note:		"PUCrunch archive data" moved from ./archive and merged with c64-exe
32943a5ec4eSXin LI0	leshort		0x0801
330898496eeSXin LI# display Commodore C64 BASIC program (strength=50) after "Lynx archive" (strength=330) handled by ./archive
331898496eeSXin LI#!:strength +0
332898496eeSXin LI# if first token is not SYS this implies BASIC program in most cases
333898496eeSXin LI>6		ubyte		!0x9e
334898496eeSXin LI# but sELF-ExTRACTING-zIP executable unzp6420.prg contains SYS token at end of second BASIC line (at 0x35)
335898496eeSXin LI>>23		search/30	\323ELF-E\330TRACTING-\332IP
336898496eeSXin LI>>>0		use		c64-exe
337898496eeSXin LI>>23		default		x
338898496eeSXin LI>>>0		use		c64-prg
339898496eeSXin LI# if first token is SYS this implies binary executable
340898496eeSXin LI>6		ubyte		=0x9e
341898496eeSXin LI>>0		use		c64-exe
342898496eeSXin LI# display information about C64 binary executable (memory address, line number, token)
343898496eeSXin LI0	name	c64-exe
344898496eeSXin LI>0		uleshort	x	Commodore C64
345898496eeSXin LI# http://a1bert.kapsi.fi/Dev/pucrunch/
346898496eeSXin LI# start address 0801h; next offset 080bh; BASIC line number is 239=00EFh; BASIC instruction is SYS 2061
347898496eeSXin LI# the above combination appartly also occur for other Commodore programs like: gunzip111.c64.prg
348898496eeSXin LI# and there exist PUCrunch archive for other machines like C16 with other magics
349898496eeSXin LI>0		string	\x01\x08\x0b\x08\xef\x00\x9e\x32\x30\x36\x31	program, probably PUCrunch archive data
350898496eeSXin LI!:mime	application/x-compress-pucrunch
351898496eeSXin LI!:ext	prg/pck
352898496eeSXin LI>0		string	!\x01\x08\x0b\x08\xef\x00\x9e\x32\x30\x36\x31	program
353898496eeSXin LI!:mime	application/x-commodore-exec
354898496eeSXin LI!:ext	prg/
355898496eeSXin LI# start address like: 801h
356898496eeSXin LI>0		uleshort	!0x0801	\b, start address %#4.4x
357898496eeSXin LI# 1st BASIC fragment
358898496eeSXin LI>2		use		basic-line
359898496eeSXin LI# jump to 1 byte before next BASIC fragment; this must be zero-byte marking the end of line
360898496eeSXin LI>(2.s-0x800)	ubyte		x
361898496eeSXin LI>>&-1		ubyte		!0	\b, no EOL=%#x
362898496eeSXin LI# valid 2nd BASIC fragment found only in sELF-ExTRACTING-zIP executable unzp6420.prg
363898496eeSXin LI>>23		search/30	\323ELF-E\330TRACTING-\332IP
364898496eeSXin LI# jump again from beginning
365898496eeSXin LI>>>(2.s-0x800)	ubyte		x
366898496eeSXin LI>>>>&0		use		basic-line
367898496eeSXin LI# Zero-byte marking the end of the BASIC line
368898496eeSXin LI>-3		ubyte		!0	\b, 3 last bytes %#2.2x
369898496eeSXin LI# Two zero-bytes in place of the pointer to next BASIC line indicates the end of the program
370898496eeSXin LI>>-2		ubeshort	x	\b%4.4x
371898496eeSXin LI# display information about tokenized C64 BASIC program (memory address, line number, token)
372898496eeSXin LI0	name	c64-prg
373898496eeSXin LI>0		uleshort	x	Commodore C64 BASIC program
374898496eeSXin LI!:mime	application/x-commodore-basic
375898496eeSXin LI# Tokenized BASIC programs were stored by Commodore as file type program "PRG" in separate field in directory structures.
376898496eeSXin LI# So file name can have no suffix like in saveroms; When transferring to other platforms, they are often saved with .prg extensions.
377898496eeSXin LI# BAS suffix is typically used for the BASIC source but also found in program pods.bas
378898496eeSXin LI!:ext	prg/bas/
379898496eeSXin LI# start address like: 801h
380898496eeSXin LI>0		uleshort	!0x0801	\b, start address %#4.4x
381898496eeSXin LI# 1st BASIC fragment
382898496eeSXin LI>2		use		basic-line
383898496eeSXin LI# jump to 1 byte before next BASIC fragment; this must be zero-byte marking the end of line
384898496eeSXin LI>(2.s-0x0800)	ubyte		x
385898496eeSXin LI>>&-1		ubyte		!0	\b, no EOL=%#x
386898496eeSXin LI# 2nd BASIC fragment
387898496eeSXin LI>>&0		use		basic-line
388898496eeSXin LI# zero-byte marking the end of the BASIC line
389898496eeSXin LI>-3		ubyte		!0	\b, 3 last bytes %#2.2x
390898496eeSXin LI# Two zero-bytes in place of the pointer to next BASIC line indicates the end of the program
391898496eeSXin LI>>-2		ubeshort	x	\b%4.4x
392898496eeSXin LI# Summary:	binary executable or Basic program for Commodore C128 computers
393898496eeSXin LI# URL:		https://en.wikipedia.org/wiki/Commodore_128
394898496eeSXin LI# Reference:	http://mark0.net/download/triddefs_xml.7z/defs/p/prg-c128.trid.xml
395898496eeSXin LI# From:		Joerg Jenderek
396898496eeSXin LI# Note:		Commodore 128 BASIC 7.0 variant; there exist varaints with different start addresses
397898496eeSXin LI0		leshort		0x1C01
398898496eeSXin LI!:strength	+1
399898496eeSXin LI# GRR: line above with strength 51 (50+1) is too generic because it matches SVr3 curses screen image, big-endian with strength (50) handled by ./terminfo
400898496eeSXin LI# probably skip SVr3 curses images with "invalid high" second line offset
401898496eeSXin LI>2		uleshort	<0x1D02
402898496eeSXin LI# skip foo with "invalid low" second line offset
403898496eeSXin LI>>2		uleshort	>0x1C06
404898496eeSXin LI# if first token is not SYS this implies BASIC program
405898496eeSXin LI>>>6		ubyte		!0x9e
406898496eeSXin LI>>>>0			use	c128-prg
407898496eeSXin LI# if first token is SYS this implies binary executable
408898496eeSXin LI>>>6		ubyte		=0x9e
409898496eeSXin LI>>>>0		use		c128-exe
410898496eeSXin LI# Summary:	binary executable or Basic program for Commodore C128 computers
411898496eeSXin LI# Note:		Commodore 128 BASIC 7.1 extension by Rick Simon
412898496eeSXin LI# start adress 132Dh
413898496eeSXin LI#0		leshort		0x132D	THIS_IS_C128_7.1
414898496eeSXin LI#>0			use	c128-prg
415898496eeSXin LI# Summary:	binary executable or Basic program for Commodore C128 computers
416898496eeSXin LI# Note:		Commodore 128 BASIC 7.0 saved with graphics mode enabled
417898496eeSXin LI# start adress 4001h
418898496eeSXin LI#0		leshort		0x4001	THIS_IS_C128_GRAPHIC
419898496eeSXin LI#>0			use	c128-prg
420898496eeSXin LI# display information about tokenized C128 BASIC program (memory address, line number, token)
421898496eeSXin LI0	name	c128-prg
422898496eeSXin LI>0		uleshort	x	Commodore C128 BASIC program
423898496eeSXin LI!:mime	application/x-commodore-basic
424898496eeSXin LI!:ext	prg
425898496eeSXin LI# start address like: 1C01h
426898496eeSXin LI>0		uleshort	!0x1C01	\b, start address %#4.4x
427898496eeSXin LI# 1st BASIC fragment
428898496eeSXin LI>2		use		basic-line
429898496eeSXin LI# jump to 1 byte before next BASIC fragment; this must be zero-byte marking the end of line
430898496eeSXin LI>(2.s-0x1C00)	ubyte		x
431898496eeSXin LI>>&-1		ubyte		!0	\b, no EOL=%#x
432898496eeSXin LI# 2nd BASIC fragment
433898496eeSXin LI>>&0		use		basic-line
434898496eeSXin LI# Zero-byte marking the end of the BASIC line
435898496eeSXin LI>-3		ubyte		!0	\b, 3 last bytes %#2.2x
436898496eeSXin LI# Two zero-bytes in place of the pointer to next BASIC line indicates the end of the program
437898496eeSXin LI>>-2		ubeshort	x	\b%4.4x
438898496eeSXin LI# display information about C128 program (memory address, line number, token)
439898496eeSXin LI0	name	c128-exe
440898496eeSXin LI>0		uleshort	x	Commodore C128 program
441898496eeSXin LI!:mime	application/x-commodore-exec
442898496eeSXin LI!:ext	prg/
443898496eeSXin LI# start address like: 1C01h
444898496eeSXin LI>0		uleshort	!0x1C01	\b, start address %#4.4x
445898496eeSXin LI# 1st BASIC fragment
446898496eeSXin LI>2		use		basic-line
447898496eeSXin LI# jump to 1 byte before next BASIC fragment; this must be zero-byte marking the end of line
448898496eeSXin LI>(2.s-0x1C00)	ubyte		x
449898496eeSXin LI>>&-1		ubyte		!0	\b, no EOL=%#x
450898496eeSXin LI# no valid 2nd BASIC fragment in Commodore executables
451898496eeSXin LI#>>&0		use		basic-line
452898496eeSXin LI# Zero-byte marking the end of the BASIC line
453898496eeSXin LI>-3		ubyte		!0	\b, 3 last bytes %#2.2x
454898496eeSXin LI# Two zero-bytes in place of the pointer to next BASIC line indicates the end of the program
455898496eeSXin LI>>-2		ubeshort	x	\b%4.4x
456898496eeSXin LI# Summary:	binary executable or Basic program for Commodore C16/VIC-20/Plus4 computers
457898496eeSXin LI# URL:		https://en.wikipedia.org/wiki/Commodore_Plus/4
458898496eeSXin LI# Reference:	http://mark0.net/download/triddefs_xml.7z/defs/p/prg-vic20.trid.xml
459898496eeSXin LI#		defs/p/prg-plus4.trid.xml
460898496eeSXin LI# From:		Joerg Jenderek
461898496eeSXin LI# Note:		there exist VIC-20 variants with different start address
462898496eeSXin LI# GRR: line below is too generic because it matches Novell LANalyzer capture
463898496eeSXin LI# with regular trace header record handled by ./sniffer
464898496eeSXin LI0		leshort		0x1001
465898496eeSXin LI# skip regular Novell LANalyzer capture (novell-2.tr1 novell-lanalyzer.tr1 novell-win10.tr1) with "invalid low" token value 54h
466898496eeSXin LI>6		ubyte		>0x7F
467898496eeSXin LI# skip regular Novell LANalyzer capture (novell-2.tr1 novell-lanalyzer.tr1 novell-win10.tr1) with "invalid low" second line offset 4Ch
468898496eeSXin LI#>>2		uleshort	>0x1006	OFFSET_NOT_TOO_LOW
469898496eeSXin LI# skip foo with "invalid high" second line offset but not for 0x123b (Minefield.prg)
470898496eeSXin LI#>>>2		uleshort	<0x1102	OFFSET_NOT_TOO_HIGH
471898496eeSXin LI# if first token is not SYS this implies BASIC program
472898496eeSXin LI>>6		ubyte		!0x9e
473898496eeSXin LI# valid second end of line separator implies BASIC program
474898496eeSXin LI>>>(2.s-0x1000)		ubyte	=0
475898496eeSXin LI>>>>0			use	c16-prg
476898496eeSXin LI# invalid second end of line separator !=0 implies binary executable like: Minefield.prg
477898496eeSXin LI>>>(2.s-0x1000)		ubyte	!0
478898496eeSXin LI>>>>0			use	c16-exe
479898496eeSXin LI# if first token is SYS this implies binary executable
480898496eeSXin LI>>6		ubyte		=0x9e
481898496eeSXin LI>>>0		use		c16-exe
482898496eeSXin LI# display information about C16 program (memory address, line number, token)
483898496eeSXin LI0	name	c16-exe
484898496eeSXin LI>0		uleshort	x	Commodore C16/VIC-20/Plus4 program
485898496eeSXin LI!:mime	application/x-commodore-exec
486898496eeSXin LI!:ext	prg/
487898496eeSXin LI# start address like: 1001h
488898496eeSXin LI>0		uleshort	!0x1001	\b, start address %#4.4x
489898496eeSXin LI# 1st BASIC fragment
490898496eeSXin LI>2		use		basic-line
491898496eeSXin LI# jump to 1 byte before next BASIC fragment; this must be zero-byte marking the end of line
492898496eeSXin LI>(2.s-0x1000)	ubyte		x
493898496eeSXin LI>>&-1		ubyte		!0	\b, no EOL=%#x
494898496eeSXin LI# no valid 2nd BASIC fragment in excutables
495898496eeSXin LI#>>&0		use		basic-line
496898496eeSXin LI# Zero-byte marking the end of the BASIC line
497898496eeSXin LI>-3		ubyte		!0	\b, 3 last bytes %#2.2x
498898496eeSXin LI# Two zero-bytes in place of the pointer to next BASIC line indicates the end of the program
499898496eeSXin LI>>-2		ubeshort	x	\b%4.4x
500898496eeSXin LI# display information about tokenized C16 BASIC program (memory address, line number, token)
501898496eeSXin LI0	name	c16-prg
502898496eeSXin LI>0		uleshort	x	Commodore C16/VIC-20/Plus4 BASIC program
503898496eeSXin LI!:mime	application/x-commodore-basic
504898496eeSXin LI!:ext	prg
505898496eeSXin LI# start address like: 1001h
506898496eeSXin LI>0		uleshort	!0x1001	\b, start address %#4.4x
507898496eeSXin LI# 1st BASIC fragment
508898496eeSXin LI>2		use		basic-line
509898496eeSXin LI# jump to 1 byte before next BASIC fragment; this must be zero-byte marking the end of line
510898496eeSXin LI>(2.s-0x1000)	ubyte		x
511898496eeSXin LI>>&-1		ubyte		!0	\b, no EOL=%#x
512898496eeSXin LI# 2nd BASIC fragment
513898496eeSXin LI>>&0		use		basic-line
514898496eeSXin LI# Zero-byte marking the end of the BASIC line
515898496eeSXin LI>-3		ubyte		!0	\b, 3 last bytes %#2.2x
516898496eeSXin LI# Two zero-bytes in place of the pointer to next BASIC line indicates the end of the program
517898496eeSXin LI>>-2		ubeshort	x	\b%4.4x
518898496eeSXin LI# Summary:	binary executable or Basic program for Commodore VIC-20 computer with 8K RAM expansion
519898496eeSXin LI# URL:		https://en.wikipedia.org/wiki/VIC-20
520898496eeSXin LI# Reference:	http://mark0.net/download/triddefs_xml.7z/defs/p/prg-vic20-8k.trid.xml
521898496eeSXin LI# From:		Joerg Jenderek
522898496eeSXin LI# Note:		Basic v2.0 with Basic v4.0 extension (VIC20); there exist VIC-20 variants with different start addresses
523898496eeSXin LI# start adress 1201h
524898496eeSXin LI0		leshort		0x1201
525898496eeSXin LI# if first token is not SYS this implies BASIC program
526898496eeSXin LI>6		ubyte		!0x9e
527898496eeSXin LI>>0		use		vic-prg
528898496eeSXin LI# if first token is SYS this implies binary executable
529898496eeSXin LI>6		ubyte		=0x9e
530898496eeSXin LI>>0		use		vic-exe
531898496eeSXin LI# display information about Commodore VIC-20 BASIC+8K program (memory address, line number, token)
532898496eeSXin LI0	name	vic-prg
533898496eeSXin LI>0		uleshort	x	Commodore VIC-20 +8K BASIC program
534898496eeSXin LI!:mime	application/x-commodore-basic
535898496eeSXin LI!:ext	prg
536898496eeSXin LI# start address like: 1201h
537898496eeSXin LI>0		uleshort	!0x1201	\b, start address %#4.4x
538898496eeSXin LI# 1st BASIC fragment
539898496eeSXin LI>2		use		basic-line
540898496eeSXin LI# jump to 1 byte before next BASIC fragment; this must be zero-byte marking the end of line
541898496eeSXin LI>(2.s-0x1200)	ubyte		x
542898496eeSXin LI>>&-1		ubyte		!0	\b, no EOL=%#x
543898496eeSXin LI# 2nd BASIC fragment
544898496eeSXin LI>>&0		use		basic-line
545898496eeSXin LI# Zero-byte marking the end of the BASIC line
546898496eeSXin LI>-3		ubyte		!0	\b, 3 last bytes %#2.2x
547898496eeSXin LI# Two zero-bytes in place of the pointer to next BASIC line indicates the end of the program
548898496eeSXin LI>>-2		ubeshort	x	\b%4.4x
549898496eeSXin LI# display information about Commodore VIC-20 +8K program (memory address, line number, token)
550898496eeSXin LI0	name	vic-exe
551898496eeSXin LI>0		uleshort	x	Commodore VIC-20 +8K program
552898496eeSXin LI!:mime	application/x-commodore-exec
553898496eeSXin LI!:ext	prg/
554898496eeSXin LI# start address like: 1201h
555898496eeSXin LI>0		uleshort	!0x1201	\b, start address %#4.4x
556898496eeSXin LI# 1st BASIC fragment
557898496eeSXin LI>2		use		basic-line
558898496eeSXin LI# jump to 1 byte before next BASIC fragment; this must be zero-byte marking the end of line
559898496eeSXin LI>(2.s-0x0400)	ubyte		x
560898496eeSXin LI>>&-1		ubyte		!0	\b, no EOL=%#x
561898496eeSXin LI# no valid 2nd BASIC fragment in excutables
562898496eeSXin LI#>>&0		use		basic-line
563898496eeSXin LI# Zero-byte marking the end of the BASIC line
564898496eeSXin LI>-3		ubyte		!0	\b, 3 last bytes %#2.2x
565898496eeSXin LI# Two zero-bytes in place of the pointer to next BASIC line indicates the end of the program
566898496eeSXin LI>>-2		ubeshort	x	\b%4.4x
567898496eeSXin LI# Summary:	binary executable or Basic program for Commodore PET computers
568898496eeSXin LI# URL:		https://en.wikipedia.org/wiki/Commodore_PET
569898496eeSXin LI# Reference:	http://mark0.net/download/triddefs_xml.7z/defs/p/prg-pet.trid.xml
570898496eeSXin LI# From:		Joerg Jenderek
571898496eeSXin LI# start adress 0401h
572898496eeSXin LI0		leshort		0x0401
573898496eeSXin LI!:strength	+1
574898496eeSXin LI# GRR: line above with strength 51 (50+1) is too generic because it matches TTComp archive data, ASCII, 1K dictionary
575898496eeSXin LI# (strength=48=50-2) handled by ./archive and shared library (strength=50) handled by ./ibm6000
576898496eeSXin LI# skip TTComp archive data, ASCII, 1K dictionary ttcomp-ascii-1k.bin with "invalid high" second line offset 4162h
577898496eeSXin LI>2		uleshort	<0x0502
578898496eeSXin LI# skip foo with "invalid low" second line offset
579898496eeSXin LI#>>2		uleshort	>0x0406	OFFSET_NOT_TOO_LOW
580898496eeSXin LI# skip bar with "invalid end of line"
581898496eeSXin LI#>>>(2.s-0x0400)	ubyte		=0	END_OF_LINE_OK
582898496eeSXin LI# if first token is not SYS this implies BASIC program
583898496eeSXin LI>>6		ubyte		!0x9e
584898496eeSXin LI>>>0		use		pet-prg
585898496eeSXin LI# if first token is SYS this implies binary executable
586898496eeSXin LI>>6		ubyte		=0x9e
587898496eeSXin LI>>>0		use		pet-exe
588898496eeSXin LI# display information about Commodore PET BASIC program (memory address, line number, token)
589898496eeSXin LI0	name	pet-prg
590898496eeSXin LI>0		uleshort	x	Commodore PET BASIC program
591898496eeSXin LI!:mime	application/x-commodore-basic
592898496eeSXin LI!:ext	prg
593898496eeSXin LI# start address like: 0401h
594898496eeSXin LI>0		uleshort	!0x0401	\b, start address %#4.4x
595898496eeSXin LI# 1st BASIC fragment
596898496eeSXin LI>2		use		basic-line
597898496eeSXin LI# jump to 1 byte before next BASIC fragment; this must be zero-byte marking the end of line
598898496eeSXin LI>(2.s-0x0400)	ubyte		x
599898496eeSXin LI# 2nd BASIC fragment
600898496eeSXin LI>>&0		use		basic-line
601898496eeSXin LI# zero-byte marking the end of the BASIC line
602898496eeSXin LI>-3		ubyte		!0	\b, 3 last bytes %#2.2x
603898496eeSXin LI# Two zero-bytes in place of the pointer to next BASIC line indicates the end of the program
604898496eeSXin LI>>-2		ubeshort	x	\b%4.4x
605898496eeSXin LI# display information about Commodore PET program (memory address, line number, token)
606898496eeSXin LI0	name	pet-exe
607898496eeSXin LI>0		uleshort	x	Commodore PET program
608898496eeSXin LI!:mime	application/x-commodore-exec
609898496eeSXin LI!:ext	prg/
610898496eeSXin LI# start address like: 0401h
611898496eeSXin LI>0		uleshort	!0x0401	\b, start address %#4.4x
612898496eeSXin LI# 1st BASIC fragment
613898496eeSXin LI>2		use		basic-line
614898496eeSXin LI# jump to 1 byte before next BASIC fragment; this must be zero-byte marking the end of line
615898496eeSXin LI>(2.s-0x0400)	ubyte		x
616898496eeSXin LI>>&-1		ubyte		!0	\b, no EOL=%#x
617898496eeSXin LI# no valid 2nd BASIC fragment in excutables
618898496eeSXin LI#>>&0		use		basic-line
619898496eeSXin LI# Zero-byte marking the end of the BASIC line
620898496eeSXin LI>-3		ubyte		!0	\b, 3 last bytes %#2.2x
621898496eeSXin LI# Two zero-bytes in place of the pointer to next BASIC line indicates the end of the program
622898496eeSXin LI>>-2		ubeshort	x	\b%4.4x
623898496eeSXin LI# display information about tokenized BASIC line (memory address, line number, Token)
624898496eeSXin LI0	name	basic-line
625898496eeSXin LI# pointer to memory address of beginning of "next" BASIC line
626898496eeSXin LI# greater then previous offset but maximal 100h difference
627898496eeSXin LI>0		uleshort	x	\b, offset %#4.4x
628898496eeSXin LI# offset 0x0000 indicates the end of BASIC program; so bytes afterwards may be some other data
629898496eeSXin LI>0		uleshort	0
630898496eeSXin LI# not line number but first 2 data bytes
631898496eeSXin LI>>2		ubeshort	x	\b, data %#4.4x
632898496eeSXin LI# not token but next 2 data bytes
633898496eeSXin LI>>4		ubeshort	x	\b%4.4x
634898496eeSXin LI# not token arguments but next data bytes
635898496eeSXin LI>>6		ubequad		x 	\b%16.16llx
636898496eeSXin LI>>14		ubequad		x 	\b%16.16llx...
637898496eeSXin LI# like 0x0d20352020204c594e5820495820204259205749 "\r 5   LYNX IX  BY WILL CORLEY" for LyNX archive Darkon.lnx handled by ./archive
638898496eeSXin LI#>>3		string		x 	"%-0.30s"
639898496eeSXin LI>0		uleshort	>0
640898496eeSXin LI# BASIC line number with range from 0 to 65520; practice to increment numbers by some value (5, 10 or 100)
641898496eeSXin LI>>2		uleshort	x	\b, line %u
642898496eeSXin LI# https://www.c64-wiki.com/wiki/BASIC_token
643898496eeSXin LI# The "high-bit" bytes from #128-#254 stood for the various BASIC commands and mathematical operators
644898496eeSXin LI>>4		ubyte		x	\b, token (%#x)
645898496eeSXin LI# https://www.c64-wiki.com/wiki/REM
646898496eeSXin LI>>4		string		\x8f	REM
647898496eeSXin LI# remark string like: ** SYNTHESIZER BY RICOCHET **
648898496eeSXin LI>>>5		string		>\0	%s
649898496eeSXin LI#>>>>&1		uleshort	x	\b, NEXT OFFSET %#4.4x
650898496eeSXin LI# https://www.c64-wiki.com/wiki/PRINT
651898496eeSXin LI>>4		string		\x99	PRINT
652898496eeSXin LI# string like: "Hello world" "\021 \323ELF-E\330TRACTING-\332IP (64 ONLY)\016\231":\2362141
653898496eeSXin LI>>>5		string		x	%s
654898496eeSXin LI#>>>>&0		ubequad		x	AFTER_PRINT=%#16.16llx
655898496eeSXin LI# https://www.c64-wiki.com/wiki/POKE
656898496eeSXin LI>>4		string		\x97	POKE
657898496eeSXin LI# <Memory address>,<number>
658898496eeSXin LI>>>5		regex		\^[0-9,\040]+	%s
659898496eeSXin LI# BASIC command delimiter colon (:=3Ah)
660898496eeSXin LI>>>>&-2		ubyte		=0x3A
661898496eeSXin LI# after BASIC command delimiter colon remaining (<255) other tokenized BASIC commands
662898496eeSXin LI>>>>>&0		string		x		"%s"
663898496eeSXin LI# https://www.c64-wiki.com/wiki/SYS	0x9e=\236
664898496eeSXin LI>>4		string		\x9e	SYS
665898496eeSXin LI# SYS <Address> parameter is a 16-bit unsigned integer; in the range 0 - 65535
666898496eeSXin LI>>>5		regex		\^[0-9]{1,5}	%s
667898496eeSXin LI# maybe followed by spaces, "control-characters" or colon (:) followed by next commnds or in victracker.prg
668898496eeSXin LI# (\302(43)\252256\254\302(44)\25236) /T.L.R/
669898496eeSXin LI#>>>5		string		x	SYS_STRING="%s"
670898496eeSXin LI# https://www.c64-wiki.com/wiki/GOSUB
671898496eeSXin LI>>4		string		\x8d	GOSUB
672898496eeSXin LI# <line>
673898496eeSXin LI>>>5		string		>\0	%s
674