Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support for the DSK/DO Disk Image Format #1

Open
trudnai opened this issue May 19, 2020 · 2 comments
Open

Add Support for the DSK/DO Disk Image Format #1

trudnai opened this issue May 19, 2020 · 2 comments

Comments

@trudnai
Copy link
Owner

trudnai commented May 19, 2020

File Extension (DO/*.DSK) - This image is 143360 bytes in size (143488 with MacBinary header). It usually has the *.DSK extension, but may also be found with the *.DO extension as well. As suggested by the title, data is stored track by track and sector by sector (Track 0, Sector 0 -> Track 22, Sector 15) for a standard 1:1 copy of a 35 track, 16 sector DOS 3.3 disk (256 bytes per sector). This is the most widely-used disk-image format for 8-bit emulators, and is easily translated into other formats. This format is incapable of storing copy-protected software unless it has been "cracked" first. A basic guide to determining what type is software may be stored in a DO image is whether it can be first duplicated on an Apple with standard copy utilities such as "copya".
On the MACINTOSH - Unlike the PC, which determines file-types by the extension, the Macintosh adds a "resource header" to all files containing file type and creator information (creating a "forked" file). Files stored on Internet FTP sites, or transferred from a Unix or PC platform, will generally not contain this resource header. As such, the disk-image will not appear as a file usuable by any of the Macintosh emulators. It is a (relatively) simple case to change the File Type and File Creator information to "register" the disk-images to belong to a certain emulator. The relevant disk-image File Type and Creator information is displayed in the reviews of each Macintosh emulator in Section 2. For example, to use this format with Stop The Madness, ensure that the file is downloaded or transferred in binary - not Macbinary - mode (and is 143360 bytes). STM will NOT recognize the disk-image unless it has the correct file type/creator, even if it is of the correct size and is a binary file. Set the file type to 'DSK5' and the creator to 'A2EM' using ResEdit, UUlite, etc. Alternatively "Drop?Disk" is a drag-and-drop application which automatically converts the file type and creator of disk-images for use with STM. For the other Macintosh emulators, a useful utility to bulk- change resource information is the "Snitch" extension by Mitch Jones [email protected], which adds resource functionality to the Finder's "Get Info" window. Simply select a number of disk-image files, do a simultaneous "Get Info" command and change the active window's resource information. Then select "Change All" from Snitch's menu.
There are a number of utilities for the Macintosh which modify to and from ProDOS Order disk-images: "Easy.STM Convert.1.0" by Jim Surine [email protected], "Aconv v1.0" by Dan Bornstein and "Converter" will reorder PO disk-image sectors into the DO type used by STM. To re-order the sectors into ProDOS order, use "DOS Order Converter" by Rene Gaudet [email protected] or "ProDOS-Order Converter" (the "mapper" algorithm automatically reorders between the two formats).
PROGRAM LOCATIONS:
ftp:https://ftp.wustl.edu/systems/mac/info-mac/cfg/snitch-251.hqx
ftp:https://cassandra.ucr.edu/pub/apple2/converter.hqx
ftp:https://cassandra.ucr.edu/pub/apple2/easy.convert.1.0.sea.hqx
ftp:https://ftp.apple.asimov.net/pub/apple_II/utility/do2po_v0.1.sit.hqx
ftp:https://ftp.apple.asimov.net/pub/apple_II/utility/Po_to_Do.gz
ftp:https://ftp.apple.asimov.net/pub/apple_II/utility/ProDOSOrderConv.sit.bin
On the PC - The PC simply determines file-type by extension (although the emulators themselves may do some checking with regard to correct file size). To use this format with all of the PC emulators, ensure that the file is downloaded or transferred in binary mode (and is 143360 bytes) and that it has an eight character filename and *.DSK extension. The current version of Apl2Em requires that the D1 and D2 disk-images have default names (usually SYSTEM.DSK and BLANK.DSK respectively), so you will have to rename your disk-image files to use them. Applewin can actually read *.DSK files of 143488 bytes (MacBinary files with the *BIN extension) but for compatibility with other emulators it is better to translate the files correctly prior to use - see Section 4. No other form of conversion is necessary.

@trudnai trudnai changed the title Handle DSK/DO Disk Images Add Support for the DSK/DO Disk Image Format May 19, 2020
@trudnai
Copy link
Owner Author

trudnai commented May 23, 2020

Track 11, Sector 0

(bold is what we can use to identify if image is a DOS image)

When file size is 143360 bytes, it is located at offset $11000.
In 143488 and 143616 byte files, the disk image's sector 0 probably starts at offset $00080

offset

$00    not used
$01    track number of first catalog sector
$02    sector number of first catalog sector
** $03    release number of DOS used to INIT this disk **
$04-05 not used
$06    Diskette volume number (1-254)
$07-26 not used
** $27    maximum number of track/sector pairs which will fit in one file track/sector
    	    list sector (122 for 256 byte sectors) **
$28-2F not used
$30    last track where sectors were allocated
$31    direction of track allocation (+1 or -1)
$32-33 not used
** $34    number of tracks per diskette (normally 35) **
** $35    number of sectors per track (13 or 16) **
** $36-37 number of bytes per sector (LO/HI format) **
$38-3B bit map of free sectors in track 0
$3C-3F bit map of free sectors in track 1
$40-43 bit map of free sectors in track 2
$BC-BF bit map of free sectors in track 33
$CO-C3 bit map of free sectors in track 34
$C4-FF bit maps for additional tracks if there are more than 35 tracks per diskette

@trudnai
Copy link
Owner Author

trudnai commented May 25, 2020

We should convert DSK/DO/PO files to WOZ internally, so they can be used by existing WOZ disk image routines. For that we can use a modified version of dsk2woz tool written by Tom Harte:

Apple GCR disk encoding

A command-line tool to convert Apple II DSK images to WOZ format

dsk2woz/dsk2woz.c

trudnai added a commit that referenced this issue Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant