amigaos 8.6 KB

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