acorn 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. #------------------------------------------------------------------------------
  2. # $File: acorn,v 1.8 2021/04/26 15:56:00 christos Exp $
  3. # acorn: file(1) magic for files found on Acorn systems
  4. #
  5. # RISC OS Chunk File Format
  6. # From RISC OS Programmer's Reference Manual, Appendix D
  7. # We guess the file type from the type of the first chunk.
  8. 0 lelong 0xc3cbc6c5 RISC OS Chunk data
  9. >12 string OBJ_ \b, AOF object
  10. >12 string LIB_ \b, ALF library
  11. # RISC OS AIF, contains "SWI OS_Exit" at offset 16.
  12. 16 lelong 0xef000011 RISC OS AIF executable
  13. # RISC OS Draw files
  14. # From RISC OS Programmer's Reference Manual, Appendix E
  15. 0 string Draw RISC OS Draw file data
  16. # RISC OS new format font files
  17. # From RISC OS Programmer's Reference Manual, Appendix E
  18. 0 string FONT\0 RISC OS outline font data,
  19. >5 byte x version %d
  20. 0 string FONT\1 RISC OS 1bpp font data,
  21. >5 byte x version %d
  22. 0 string FONT\4 RISC OS 4bpp font data
  23. >5 byte x version %d
  24. # RISC OS Music files
  25. # From RISC OS Programmer's Reference Manual, Appendix E
  26. 0 string Maestro\r RISC OS music file
  27. >8 byte x version %d
  28. >8 byte x type %d
  29. # Digital Symphony data files
  30. # From: Bernard Jungen (bern8817@euphonynet.be)
  31. 0 string \x02\x01\x13\x13\x13\x01\x0d\x10 Digital Symphony sound sample (RISC OS),
  32. >8 byte x version %d,
  33. >9 pstring x named "%s",
  34. >(9.b+19) byte =0 8-bit logarithmic
  35. >(9.b+19) byte =1 LZW-compressed linear
  36. >(9.b+19) byte =2 8-bit linear signed
  37. >(9.b+19) byte =3 16-bit linear signed
  38. >(9.b+19) byte =4 SigmaDelta-compressed linear
  39. >(9.b+19) byte =5 SigmaDelta-compressed logarithmic
  40. >(9.b+19) byte >5 unknown format
  41. 0 string \x02\x01\x13\x13\x14\x12\x01\x0b Digital Symphony song (RISC OS),
  42. >8 byte x version %d,
  43. >9 byte =1 1 voice,
  44. >9 byte !1 %d voices,
  45. >10 leshort =1 1 track,
  46. >10 leshort !1 %d tracks,
  47. >12 leshort =1 1 pattern
  48. >12 leshort !1 %d patterns
  49. 0 string \x02\x01\x13\x13\x10\x14\x12\x0e
  50. >9 byte =0 Digital Symphony sequence (RISC OS),
  51. >>8 byte x version %d,
  52. >>10 byte =1 1 line,
  53. >>10 byte !1 %d lines,
  54. >>11 leshort =1 1 position
  55. >>11 leshort !1 %d positions
  56. >9 byte =1 Digital Symphony pattern data (RISC OS),
  57. >>8 byte x version %d,
  58. >>10 leshort =1 1 pattern
  59. >>10 leshort !1 %d patterns
  60. # From: Joerg Jenderek
  61. # URL: https://www.kyzer.me.uk/pack/xad/#PackDir
  62. # reference: https://www.kyzer.me.uk/pack/xad/xad_PackDir.lha/PackDir.c
  63. # GRR: line below is too general as it matches also "Git pack" in ./revision
  64. 0 string PACK\0
  65. # check for valid compression method 0-4
  66. >5 ulelong <5
  67. # https://www.riscosopen.org/wiki/documentation/show/Introduction%20To%20Filing%20Systems
  68. # To skip "Git pack" version 0 test for root directory object like
  69. # ADFS::RPC.$.websitezip.FONTFIX
  70. >>9 string >ADFS\ PackDir archive (RISC OS)
  71. # TrID labels above as "Acorn PackDir compressed Archive"
  72. # compression mode y (0 - 4) for GIF LZW with a maximum n bits
  73. # (y~n,0~12,1~13,2~14,3~15,4~16)
  74. >>>5 ulelong+12 x \b, LZW %u-bits compression
  75. # https://www.filebase.org.uk/filetypes
  76. # !Packdir compressed archive has three hexadecimal digits code 68E
  77. !:mime application/x-acorn-68E
  78. !:ext pkd/bin
  79. # null terminated root directory object like IDEFS::IDE-4.$.Apps.GRAPHICS.!XFMPdemo
  80. >>>9 string x \b, root "%s"
  81. # load address 0xFFFtttdd, ttt is the object filetype and dddddddddd is time
  82. >>>>&1 ulelong x \b, load address %#x
  83. # execution address 0xdddddddd dddddddddd is 40 bit unsigned centiseconds since 1.1.1900 UTC
  84. >>>>&5 ulelong x \b, exec address %#x
  85. # attributes (bits: 0~owner read,1~owner write,3~no delete,4~public read,5~public write)
  86. >>>>&9 ulelong x \b, attributes %#x
  87. # number of entries in this directory. for root dir 0
  88. #>>>&13 ulelong x \b, entries %#x
  89. # the entries start here with object name
  90. >>>>&17 string x \b, 1st object "%s"