xref: /freebsd/contrib/file/magic/Magdir/amigaos (revision 43a5ec4eb41567cc92586503212743d89686d78f)
1b6cee71dSXin LI
2b6cee71dSXin LI#------------------------------------------------------------------------------
3*43a5ec4eSXin LI# $File: amigaos,v 1.20 2021/09/20 00:42:19 christos Exp $
4b6cee71dSXin LI# amigaos:  file(1) magic for AmigaOS binary formats:
5b6cee71dSXin LI
6b6cee71dSXin LI#
7b6cee71dSXin LI# From ignatios@cs.uni-bonn.de (Ignatios Souvatzis)
8b6cee71dSXin LI#
9b6cee71dSXin LI0	belong		0x000003fa	AmigaOS shared library
10b6cee71dSXin LI0	belong		0x000003f3	AmigaOS loadseg()ble executable/binary
11b6cee71dSXin LI0	belong		0x000003e7	AmigaOS object/library data
12b6cee71dSXin LI#
13b6cee71dSXin LI0	beshort		0xe310		Amiga Workbench
14b6cee71dSXin LI>2	beshort		1
15b6cee71dSXin LI>>48	byte		1		disk icon
16b6cee71dSXin LI>>48	byte		2		drawer icon
17b6cee71dSXin LI>>48	byte		3		tool icon
18b6cee71dSXin LI>>48	byte		4		project icon
19b6cee71dSXin LI>>48	byte		5		garbage icon
20b6cee71dSXin LI>>48	byte		6		device icon
21b6cee71dSXin LI>>48	byte		7		kickstart icon
22b6cee71dSXin LI>>48	byte		8		workbench application icon
23b6cee71dSXin LI>2	beshort		>1		icon, vers. %d
24b6cee71dSXin LI#
25b6cee71dSXin LI# various sound formats from the Amiga
26b6cee71dSXin LI# G=F6tz Waschk <waschk@informatik.uni-rostock.de>
27b6cee71dSXin LI#
28b6cee71dSXin LI0	string		FC14		Future Composer 1.4 Module sound file
29b6cee71dSXin LI0	string		SMOD		Future Composer 1.3 Module sound file
30b6cee71dSXin LI0	string		AON4artofnoise	Art Of Noise Module sound file
31b6cee71dSXin LI1	string		MUGICIAN/SOFTEYES Mugician Module sound file
32b6cee71dSXin LI58	string		SIDMON\ II\ -\ THE	Sidmon 2.0 Module sound file
33b6cee71dSXin LI0	string		Synth4.0	Synthesis Module sound file
34b6cee71dSXin LI0	string		ARP.		The Holy Noise Module sound file
35b6cee71dSXin LI0	string		BeEp\0		JamCracker Module sound file
36b6cee71dSXin LI0	string		COSO\0		Hippel-COSO Module sound file
37b6cee71dSXin LI# Too simple (short, pure ASCII, deep), MPi
38b6cee71dSXin LI#26	string		V.3		Brian Postma's Soundmon Module sound file v3
39b6cee71dSXin LI#26	string		BPSM		Brian Postma's Soundmon Module sound file v3
40b6cee71dSXin LI#26	string		V.2		Brian Postma's Soundmon Module sound file v2
41b6cee71dSXin LI
42b6cee71dSXin LI# The following are from: "Stefan A. Haubenthal" <polluks@web.de>
43*43a5ec4eSXin LI# Update:	Joerg Jenderek
44*43a5ec4eSXin LI# URL:		http://fileformats.archiveteam.org/wiki/Amiga_bitmap_font
45*43a5ec4eSXin LI# Reference:	http://mark0.net/download/triddefs_xml.7z/defs/f/font-amiga.trid.xml
46*43a5ec4eSXin LI#		https://wiki.amigaos.net/wiki/Graphics_Library_and_Text
47*43a5ec4eSXin LI# fch_FileID=FCH_ID=0x0f00
48*43a5ec4eSXin LI0	beshort		0x0f00
49*43a5ec4eSXin LI# skip some AVM powerline firmware images by check for positive number of font elements
50*43a5ec4eSXin LI# https://download.avm.de/fritzpowerline/fritzpowerline-1000e-t/other/fritz.os/fritz.powerline_1000ET_01_05.image
51*43a5ec4eSXin LI>2	ubeshort	>0		AmigaOS bitmap font
52*43a5ec4eSXin LI#!:mime	application/octet-stream
53*43a5ec4eSXin LI!:mime	font/x-amiga-font
54*43a5ec4eSXin LI!:ext	font
55*43a5ec4eSXin LI# struct FontContents fch_FC; 1st fc_FileName [MAXFONTPATH=256]; ~ filename "/" fc_YSize
56*43a5ec4eSXin LI# like: topazb/6 suits/8  Excel/9e emerald/17 Franklin/23 DIAMONDS/60.8C
57*43a5ec4eSXin LI>>4	string		x		"%.256s"
58*43a5ec4eSXin LI# fc_YSize ~number after slash in fc_FileName; like: 6 7 8 9 11 12 16 17 21 23 45 60
59*43a5ec4eSXin LI>>260	beshort		x		\b, fc_YSize %u
60*43a5ec4eSXin LI# fch_NumEntries; number of FontContents elements like:
61*43a5ec4eSXin LI# 1 (often) 2 3 (IconCondensed.font tempfont.font) 4 (Franklin.font) 6 (mcoop.font)
62*43a5ec4eSXin LI>>2	ubeshort	>1		\b, %u elements
63*43a5ec4eSXin LI#>>2	beshort		x		\b, %u element
64*43a5ec4eSXin LI# plural s
65*43a5ec4eSXin LI#>>2	beshort		!1		\bs
66*43a5ec4eSXin LI# like: 6 7 8 9 11 12 16 17 21 23 45 60
67*43a5ec4eSXin LI#>>262	beshort		x		\b, FLAGS_STYLE
68*43a5ec4eSXin LI>>2	beshort		>1		\b, 2nd
69*43a5ec4eSXin LI# 2nd fc_FileName like: Franklin/36
70*43a5ec4eSXin LI>>>264	string		x		"%.256s"
71*43a5ec4eSXin LI>>2	beshort		>2		\b, 3rd
72*43a5ec4eSXin LI# 3rd fc_FileName like: Franklin/18
73*43a5ec4eSXin LI>>>524	string		x		"%.256s"
74*43a5ec4eSXin LI# URL:		http://fileformats.archiveteam.org/wiki/Amiga_bitmap_font
75*43a5ec4eSXin LI# Reference:	https://wiki.amigaos.net/wiki/Graphics_Library_and_Text
76*43a5ec4eSXin LI#		http://mark0.net/download/triddefs_xml.7z/defs/f/font-amiga-var2.trid.xml
77*43a5ec4eSXin LI# Note:		called by TrID "Amiga bitmap Font (var.2)"
78*43a5ec4eSXin LI# fch_FileID=TFCH_ID=0x0f02
79*43a5ec4eSXin LI0	beshort		0x0f02
80*43a5ec4eSXin LI# skip possible misidentified foo by check for positive number of font elements
81*43a5ec4eSXin LI>2	ubeshort	>0		AmigaOS bitmap font (TFCH)
82*43a5ec4eSXin LI#!:mime	application/octet-stream
83*43a5ec4eSXin LI!:mime	font/x-amiga-font
84*43a5ec4eSXin LI!:ext	font
85*43a5ec4eSXin LI# struct TFontContents fch_TFC[]; 1st tfc_FileName [254]; ~ filename "/" fc_YSize
86*43a5ec4eSXin LI# like: Abbey/45 XScript/75 XTriumvirate/45
87*43a5ec4eSXin LI>>4	string		x		"%.254s"
88*43a5ec4eSXin LI# tfc_TagCount; including the TAG_END tag like: 4
89*43a5ec4eSXin LI>>258	ubeshort	x		\b, tfc_TagCount %u
90*43a5ec4eSXin LI# tfc_YSize ~number after slash in tfc_FileName; like: 45 75
91*43a5ec4eSXin LI>>260	beshort		x		\b, tfc_YSize %u
92*43a5ec4eSXin LI# tfc_Style; tfc_Flags like: 8022h 8222h
93*43a5ec4eSXin LI#>>262	ubeshort	x		\b, FLAGS_STYLE %#x
94*43a5ec4eSXin LI# fch_NumEntries; number of FontContents elements like: 1 (abbey.font) 2 (xscript.font xtriumvirate.font)
95*43a5ec4eSXin LI>>2	ubeshort	>1		\b, %u elements
96*43a5ec4eSXin LI>>2	beshort		>1		\b, 2nd
97*43a5ec4eSXin LI# 2nd tfc_FileName like: XScript/45 XTriumvirate/30
98*43a5ec4eSXin LI>>>264	string		x		"%.254s"
99b6cee71dSXin LI0	beshort		0x0f03		AmigaOS outline font
100b6cee71dSXin LI0	belong		0x80001001	AmigaOS outline tag
101b6cee71dSXin LI0	string		##\ version	catalog translation
102b6cee71dSXin LI0	string		EMOD\0		Amiga E module
103b6cee71dSXin LI8	string		ECXM\0		ECX module
104b6cee71dSXin LI0	string/c	@database	AmigaGuide file
105b6cee71dSXin LI
106b6cee71dSXin LI# Amiga disk types
107*43a5ec4eSXin LI#	display information like volume name of root block on Amiga (floppy) disk
108*43a5ec4eSXin LI0	name   	adf-rootblock
109*43a5ec4eSXin LI# block primary type = T_HEADER (value 2)
110*43a5ec4eSXin LI>0x000	ubelong		!2		\b, type %u
111*43a5ec4eSXin LI# header_key; unused in rootblock (value 0)
112*43a5ec4eSXin LI>0x004	ubelong		!0		\b, header_key %u
113*43a5ec4eSXin LI# high_seq; unused (value 0)
114*43a5ec4eSXin LI>0x008	ubelong		!0		\b, high_seq %u
115*43a5ec4eSXin LI# ht_size; hash table size; 0x48 for flopies
116*43a5ec4eSXin LI>0x00c	ubelong		!0x48		\b, hash table size %#x
117*43a5ec4eSXin LI# bm_flag; bitmap flag, -1 means VALID
118*43a5ec4eSXin LI>0x138	belong		!-1		\b, bitmap flag %#x
119*43a5ec4eSXin LI# bm_ext; first bitmap extension block (Hard disks only)
120*43a5ec4eSXin LI>0x1A0	ubelong		!0		\b, bitmap extension block %#x
121*43a5ec4eSXin LI# name_len; volume name length; diskname[30]; volume name
122*43a5ec4eSXin LI>0x1B0	pstring		>\0		\b, "%s"
123*43a5ec4eSXin LI# first directory cache block for FFS; otherwise 0
124*43a5ec4eSXin LI>0x1F8	ubelong		!0		\b, directory cache block %#x
125*43a5ec4eSXin LI# block secondary type = ST_ROOT (value 1)
126*43a5ec4eSXin LI>0x1FC	ubelong		!1		\b, sec_type %#x
127b6cee71dSXin LI#
128b6cee71dSXin LI0	string		RDSK		Rigid Disk Block
129b6cee71dSXin LI>160	string		x		on %.24s
130*43a5ec4eSXin LI# URL:		http://fileformats.archiveteam.org/wiki/ADF_(Amiga)
131*43a5ec4eSXin LI#		https://en.wikipedia.org/wiki/Amiga_Fast_File_System
132*43a5ec4eSXin LI# Reference:	http://lclevy.free.fr/adflib/adf_info.html
133*43a5ec4eSXin LI# Update:	Joerg Jenderek
134*43a5ec4eSXin LI# Note:		created by ADFOpus.exe
135*43a5ec4eSXin LI# 		and verified by `unadf -l TURBO_SILVER_SV.ADF`
136*43a5ec4eSXin LI0	string		DOS
137*43a5ec4eSXin LI# skip DOS Client Message Files like IPXODI.MSG DOSRQSTR.MSG
138*43a5ec4eSXin LI>3	ubyte		<8		Amiga
139*43a5ec4eSXin LI# https://reposcope.com/mimetype/application/x-amiga-disk-format
140*43a5ec4eSXin LI!:mime	application/x-amiga-disk-format
141*43a5ec4eSXin LI!:ext	adf
142*43a5ec4eSXin LI>>3	ubyte		0		DOS disk
143*43a5ec4eSXin LI>>3	ubyte		1		FFS disk
144*43a5ec4eSXin LI>>3	ubyte		2		Inter DOS disk
145*43a5ec4eSXin LI>>3	ubyte		3		Inter FFS disk
146*43a5ec4eSXin LI# For Fastdir mode the international mode is also enabled,
147*43a5ec4eSXin LI>>3	ubyte		4		Fastdir DOS disk
148*43a5ec4eSXin LI>>3	ubyte		5		Fastdir FFS dis
149*43a5ec4eSXin LI# called by TrID "Amiga Disk image File (OFS+INTL+DIRC)"
150*43a5ec4eSXin LI>>3	ubyte		6		Inter Fastdir DOS disk
151*43a5ec4eSXin LI# called by TrID "Amiga Disk image File (FFS+INTL+DIRC)"
152*43a5ec4eSXin LI>>3	ubyte		7		Inter Fastdir FFS disk
153*43a5ec4eSXin LI# but according to Wikipedia variants with long name support
154*43a5ec4eSXin LI#>>3	ubyte		6		long name DOS disk
155*43a5ec4eSXin LI#>>3	ubyte		7		long name FFS disk
156*43a5ec4eSXin LI# DOES NOT only work! Partly for file size  ~< FILE_BYTES_MAX=1 MiB defined in ../../src/file.h
157*43a5ec4eSXin LI#>>-0		offset	x		\b, %lld bytes
158*43a5ec4eSXin LI# Correct file size, but next lines are NOT executed
159*43a5ec4eSXin LI#>>-0		offset	901120		(DD 880 KiB floppy)
160*43a5ec4eSXin LI# 880 KiB Double Density floppy disk by characteristic hash table size 0x48 and T_HEADER=2
161*43a5ec4eSXin LI>>0x6E00C	ubelong	0x48
162*43a5ec4eSXin LI>>>0x6E000	ubelong	2		(DD 880 KiB)
163*43a5ec4eSXin LI# 1760 KiB High Density floppy disk (1802240 bytes) by characteristic hash table size 0x48
164*43a5ec4eSXin LI>>0xDC00C	ubelong	0x48
165*43a5ec4eSXin LI>>>0xDC000	ubelong	2		(HD 1760 KiB)
166*43a5ec4eSXin LI# Chksum; special block checksum like: 0 0x44ccf4c0 0x51f32cac 0xe33d0e7d ...
167*43a5ec4eSXin LI#>>4	ubelong		x		\b, CRC %#x
168*43a5ec4eSXin LI# Rootblock: 0 880 (often for DD and HD) 1146049280 (IMAGINE_1_0_DISK_01.ADF TURBO_SILVER_SV.ADF)
169*43a5ec4eSXin LI>>8	ubelong		>0		\b, probably root block %d
170*43a5ec4eSXin LI# bootblock code
171*43a5ec4eSXin LI>>12	quad		!0		\b, bootable
172*43a5ec4eSXin LI# assembler instructions: lea exp(pc),a1; moveq 25h,d0; jsr -552(a6)
173*43a5ec4eSXin LI>>>12	ubequad	=0x43fa003e70254eae	AmigaDOS 3.0
174*43a5ec4eSXin LI>>>12	default	x
175*43a5ec4eSXin LI>>>>12	ubequad	!0x43fa003e70254eae	%#llx..
176*43a5ec4eSXin LI# 880 KiB Double Density floppy disk (901120 bytes)
177*43a5ec4eSXin LI>>0x6E00C	ubelong	0x48
178*43a5ec4eSXin LI>>>0x6E000	ubelong	2
179*43a5ec4eSXin LI>>>>0x6E000	use			adf-rootblock
180*43a5ec4eSXin LI# 1760 KiB High Density floppy disk (1802240 bytes)
181*43a5ec4eSXin LI>>0xDC00C	ubelong	0x48
182*43a5ec4eSXin LI>>>0xDC000	ubelong	2
183*43a5ec4eSXin LI>>>>0xDC000	use			adf-rootblock
184*43a5ec4eSXin LI# 1 MiB hard disc by test for T_HEADER=2 and header_key=0=high_seq
185*43a5ec4eSXin LI>>0x80000	ubelong	2
186*43a5ec4eSXin LI>>>0x80004	quad	0
187*43a5ec4eSXin LI>>>>0x80000	use			adf-rootblock
188*43a5ec4eSXin LI# 2 MiB hard disc; only works if in ../../src/file.h FILE_BYTES_MAX is raised to 2 MiB
189*43a5ec4eSXin LI#>>0x100000	ubelong	x		2 MiB TEST
190*43a5ec4eSXin LI#>>0x100000	ubelong	2		\b, 2 MiB hard disc rootblock
191*43a5ec4eSXin LI#>>>0x100000	use			adf-rootblock
192b6cee71dSXin LI0	string		KICK		Kickstart disk
193b6cee71dSXin LI
194b6cee71dSXin LI# From: Alex Beregszaszi <alex@fsn.hu>
195b6cee71dSXin LI0	string		LZX		LZX compressed archive (Amiga)
196b6cee71dSXin LI
197b6cee71dSXin LI# From: Przemek Kramarczyk <pkramarczyk@gmail.com>
198b6cee71dSXin LI0	string 		.KEY		AmigaDOS script
199b6cee71dSXin LI0	string 		.key		AmigaDOS script
20048c779cdSXin LI
20148c779cdSXin LI# AMOS Basic file formats
20248c779cdSXin LI# https://www.exotica.org.uk/wiki/AMOS_file_formats
20348c779cdSXin LI0	string		AMOS\040Basic\040 	AMOS Basic source code
20448c779cdSXin LI>11	byte		=0x56 			\b, tested
20548c779cdSXin LI>11	byte		=0x76 			\b, untested
20648c779cdSXin LI0 	string		AMOS\040Pro		AMOS Basic source code
20748c779cdSXin LI>11	byte		=0x56 			\b, tested
20848c779cdSXin LI>11	byte		=0x76 			\b, untested
20948c779cdSXin LI0	string		AmSp			AMOS Basic sprite bank
21048c779cdSXin LI>4	beshort		x			\b, %d sprites
21148c779cdSXin LI0	string		AmIc			AMOS Basic icon bank
21248c779cdSXin LI>4	beshort		x			\b, %d icons
21348c779cdSXin LI0	string		AmBk			AMOS Basic memory bank
21448c779cdSXin LI>4	beshort		x			\b, bank number %d
21548c779cdSXin LI>8	belong&0xFFFFFFF	x		\b, length %d
21648c779cdSXin LI>12	regex		.{8}			\b, type %s
21748c779cdSXin LI0	string		AmBs			AMOS Basic memory banks
21848c779cdSXin LI>4	beshort		x			\b, %d banks
219