[File] [PATCH] for Apple ][ emulator formats

Greg Wildman lists at itns.co.za
Tue Feb 26 15:36:23 UTC 2019


Hello,

I have updated my local magic for the many Apple ][ emulator formats I
am using. I thought it would be best to send you a patch.

- WOZ format support
https://applesaucefdc.com/woz/reference/
https://applesaucefdc.com/woz/reference2/

  $ file *.woz
  Aquatron.woz:                 Apple ][ WOZ 1.0 Disk Image, 5.25 inch, cross track synchronized, Applesauce v1.0.2
  Captain Goodnight Side A.woz: Apple ][ WOZ 2.0 Disk Image, 5.25 inch, cross track synchronized, Passport.py by 4am (2019-02-02) 
  Captain Goodnight Side B.woz: Apple ][ WOZ 2.0 Disk Image, 5.25 inch, cross track synchronized, Passport.py by 4am (2019-02-02) 
  Hard Hat Mack.woz:            Apple ][ WOZ 1.0 Disk Image, 5.25 inch, write protected, cross track synchronized, Applesauce v1.0.1


- Generic DSK/PO disk images
DOS3.2, DOS3.3, Pascal and ProDOS support

  $ file *.dsk *.po
  Apple ProFile - Side 1.dsk:      Apple Pascal Image, Volume PPMSTAR:, 280 Blocks, 1 Files
  Apple ProFile - Side 2.dsk:      Apple Pascal Image, Volume PPMPROG:, 280 Blocks, 11 Files
  BEZARE_hr.dsk:                   Apple DOS 3.2 Image, Volume 254, 35 Tracks, 16 Sectors, 256 bytes per sector
  AROS.dsk:                        Apple DOS 3.3 Image, Volume 1, 35 Tracks, 16 Sectors, 256 bytes per sector
  KART.24.dsk:                     Apple DOS 3.3 Image, Volume 254, 35 Tracks, 16 Sectors, 256 bytes per sector
  DiskMaker8v1.1.dsk:              Apple ProDOS Image, Volume /DM8, 280 Blocks
  Marinetti3.0b9.po:               Apple ProDOS Image, Volume /MARINETTI3.0B9, 1600 Blocks
  Star Trek: First Contact 2.1.po: Apple ProDOS Image, Volume /STFC, 1600 Blocks
  Virtual.po:                      Apple ProDOS Image, Volume /VIRTUAL, 1600 Blocks


- Fixed the 2IMG format and added all the creator tags I could find.

  OLD Output
  ----------
  
  Word_Perfect_Main.2mg:         Apple ][ 2IMG Disk Image, Sweet 16, ASIMOV2, Unknown Format, ProDOS sector order, 1600 Blocks
  Xenocide-infinite-lives.2mg:   Apple ][ 2IMG Disk Image, ASIMOV2, Unknown Format, ProDOS sector order, 1600 Blocks
  
  NEW Output
  ----------
  $ file *.2mg
  1942.2mg:                                 Apple ][ 2IMG Disk Image, ASIMOV2, ProDOS sector order, 1600 Blocks
  2400AD.2mg:                               Apple ][ 2IMG Disk Image, Sweet 16, ProDOS sector order, 1600 Blocks
  72-CPMHD.170612.2mg:                      Apple ][ 2IMG Disk Image, Virtual ][, ProDOS sector order, 65535 Blocks
  Applefest 89 clvrleaf System.2mg:         Apple ][ 2IMG Disk Image, Sheppy's ImageMaker, ProDOS sector order, 1600 Blocks
  BENCHMARKv5.2mg:                          Apple ][ 2IMG Disk Image, XGS, ProDOS sector order, 1600 Blocks
  Pitch-Dark-20180721.2mg:                  Apple ][ 2IMG Disk Image, CiderPress, ProDOS sector order, 65535 Blocks
  Tinies and Tinies Construction Kit.2mg:   Apple ][ 2IMG Disk Image, Creator tag "pdos", ProDOS sector order, 2880 Blocks
  Word_Perfect_Main.2mg:                    Apple ][ 2IMG Disk Image, Sweet 16, ProDOS sector order, 1600 Blocks
  Xenocide-infinite-lives.2mg:              Apple ][ 2IMG Disk Image, Revival for Windows, ProDOS sector order, 1600 Blocks






diff -Naur file-5.36.orig/magic/Magdir/apple file-5.36/magic/Magdir/apple
--- file-5.36.orig/magic/Magdir/apple	2018-03-02 17:26:39.000000000 +0200
+++ file-5.36/magic/Magdir/apple	2019-02-26 17:26:28.679814598 +0200
@@ -11,22 +11,97 @@
 0	belong		0x00051600		AppleSingle encoded Macintosh file
 0	belong		0x00051607		AppleDouble encoded Macintosh file
 
+# Type: Apple Emulator WOZ format
+# From: Greg Wildman <greg at apple2.org.za>
+# Ref: https://applesaucefdc.com/woz/reference/
+# Ref: https://applesaucefdc.com/woz/reference2/
+#
+# Note: The following test are mostly identical. I would rather not
+# use a regex to identify the WOZ format number.
+0	string		WOZ1
+>4	string		\xFF\x0A\x0D\x0A	Apple ][ WOZ 1.0 Disk Image
+>12	string		INFO
+>>21	byte		01			\b, 5.25 inch
+>>21	byte		02			\b, 3.5 inch
+>>22	byte		01			\b, write protected
+>>23	byte		01			\b, cross track synchronized
+>>25	string/T	x			\b, %.32s
+0	string		WOZ2
+>4	string		\xFF\x0A\x0D\x0A	Apple ][ WOZ 2.0 Disk Image
+>12	string		INFO
+>>21	byte		01			\b, 5.25 inch
+>>21	byte		02			\b, 3.5 inch
+>>22	byte		01			\b, write protected
+>>23	byte		01			\b, cross track synchronized
+>>25	string/T	x			\b, %.32s
+
+# Type: Apple Emulator disk images
+# From: Greg Wildman <greg at apple2.org.za>
+# ProDOS boot loader?
+0		string	\x01\x38\xB0\x03\x4C	Apple ProDOS Image
+# Detect Volume Directory block ($02)
+>0x400		string	\x00\x00\x03\x00
+>>0x404		byte	&0xF0
+>>>0x405	string	x			\b, Volume /%s
+>>>0x429	leshort	x			\b, %u Blocks
+# ProDOS ordered ?
+>0xb00		string	\x00\x00\x03\x00
+>>0xb04		byte	&0xF0
+>>>0xb05	string	x			\b, Volume /%s
+>>>0xb29	leshort	x			\b, %u Blocks
+#
+# DOS3.3 boot loader?
+0		string	\x01\xA5\x27\xC9\x09\xD0\x18\xA5\x2B
+>0x11001	string	\x11\x0F\x03	Apple DOS 3.3 Image
+>>0x11006	byte	x		\b, Volume %u
+>>0x11034	byte	x		\b, %u Tracks
+>>0x11035	byte	x		\b, %u Sectors
+>>0x11036	leshort	x		\b, %u bytes per sector
+# DOS3.2 ?
+>0x11001	string	\x11\x0C\x02	Apple DOS 3.2 Image
+>>0x11006	byte	x		\b, Volume %u
+>>0x11034	byte	x		\b, %u Tracks
+>>0x11035	byte	x		\b, %u Sectors
+>>0x11036	leshort	x		\b, %u bytes per sector
+# DOS3.1 ?
+>0x11001	string	\x11\x0C\x01
+>>0x11c00	string	\x00\x11\x0B	Apple DOS 3.1 Image
+#
+# Pascal boot loader?
+0		string	\x01\xE0\x60\xF0\x03\x4C\xE3\x08\xAD
+>0xd6		pstring SYSTEM.APPLE
+>>0xb00		leshort	0x0000
+>>>0xb04	leshort 0x0000		Apple Pascal Image
+>>>>0xb06	pstring x		\b, Volume %s:
+>>>>0xb0e	leshort x		\b, %u Blocks
+>>>>0xb10	leshort x		\b, %u Files
+
 # Type: Apple Emulator 2IMG format
 # From: Radek Vokal <rvokal at redhat.com>
-0	string		2IMG	Apple ][ 2IMG Disk Image
->4	string		XGS!	\b, XGS
->4	string		CTKG	\b, Catakig
->4	string		ShIm	\b, Sheppy's ImageMaker
->4	string		WOOF	\b, Sweet 16
->4	string		B2TR	\b, Bernie ][ the Rescue
->4	string		!nfc	\b, ASIMOV2
->4	string		x	\b, Unknown Format
->0xc	byte		00	\b, DOS 3.3 sector order
->>0x10	byte		00	\b, Volume 254
->>0x10	byte&0x7f	x	\b, Volume %u
->0xc	byte		01	\b, ProDOS sector order
->>0x14	short		x	\b, %u Blocks
->0xc	byte		02	\b, NIB data
+# Update: Greg Wildman <greg at apple2.org.za>
+0	string		2IMG		Apple ][ 2IMG Disk Image
+>4	clear
+>4	string		XGS!		\b, XGS
+>4	string		CTKG		\b, Catakig
+>4	string		ShIm		\b, Sheppy's ImageMaker
+>4	string		SHEP		\b, Sheppy's ImageMaker
+>4	string		WOOF		\b, Sweet 16
+>4	string		B2TR		\b, Bernie ][ the Rescue
+>4	string		\!nfc		\b, ASIMOV2
+>4	string		\>BD\<		\b, Brutal Deluxe's Cadius
+>4	string		CdrP		\b, CiderPress
+>4	string		Vi\]\[		\b, Virtual ][
+>4	string		PRFS		\b, ProFUSE
+>4	string		FISH		\b, FishWings
+>4	string		RVLW		\b, Revival for Windows
+>4	default		x
+>>4	string		x		\b, Creator tag "%-4.4s"
+>0xc	byte		00		\b, DOS 3.3 sector order
+>>0x10	byte		00		\b, Volume 254
+>>0x10	byte&0x7f	x		\b, Volume %u
+>0xc	byte		01		\b, ProDOS sector order
+>>0x14	short		x		\b, %u Blocks
+>0xc	byte		02		\b, NIB data
 
 # magic for Newton PDA package formats
 # from Ruda Moura <ruda at helllabs.org>


-- 
Greg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <https://mailman.astron.com/pipermail/file/attachments/20190226/11cfb340/attachment.asc>


More information about the File mailing list