Apple II File Type Notes _____________________________________________________________________________ Developer Technical Support File Type: $E0 (224) Auxiliary Type: $0005 Full Name: DiskCopy disk image Short Name: DiskCopy disk image Written by: Matt Deatherage, Dave Lyons & Steve Christensen May 1992 Files of this type and auxiliary type contain disk images from Apple's DiskCopy program on the Macintosh. _____________________________________________________________________________ DiskCopy is a program written by Steve Christensen of Apple Computer, Inc., for internal use in duplicating and distributing 3.5" floppy disks. Because of its utility in distributing disk images on the Macintosh, DiskCopy is used in several Apple developer products even though DiskCopy is not an official Apple product and is not supported as such. Since the monthly Developer CD Series discs contain many DiskCopy disk images, and since the AppleShare and HFS FSTs in System Software 6.0 and later automatically translate DiskCopy files (HFS file type dImg and creator dCpy) to Apple II file type $E0 and auxiliary type $0005, the format is provided here for your utility use only. Apple does not guarantee that files not generated by DiskCopy will work with DiskCopy. DEFINITIONS DiskCopy uses a simple checksum algorithm to help insure data integrity for archived disk images. The algorithm for generating the 32-bit checksum is as follows: Initialize checksum to zero For each data REVERSE WORD: Add the data REVERSE WORD to the checksum Rotate the 32-bit checksum right one bit (wrapping bit 0 to bit 31) The following 65816 assembly language routine calculates a DiskCopy checksum. It's not a speedy operation--it takes about 12 seconds to calculate the checksum on an 800K disk image. Anyone finding an assembly routine that can perform this task in under 5 seconds may apply for their IIgs Certificate of Deityship, as documented in the File Type Note for file type $B6. (Oh, by the way, any entries have to be under 1K in size--the following routine is 88 bytes. So don't think unwinding loops is your ticket to fame and fortune.) **************************************************************************** * * Compute checksum for DiskCopy data * * v1.2 by David A. Lyons, 18-May-92 * * MPW IIgs assembly format * * Inputs on stack: * Push pointer to data (long) * Push size of data (long) (Must be even!) * JSL CalcChecksum * STA TheChecksum+2 * STX TheChecksum * * Output: * Checksum in A and X (bytes +0 and +1 in X, bytes +2 and +3 in A) * (The inputs have been removed from the stack) * **************************************************************************** CalcChecksum PROC phd ;save caller's direct page reg lda #0 pha pha ;push initial checksum value (zero) tsc tcd checksum equ 1 oldD equ checksum+4 theRTL equ oldD+2 dataSize equ theRTL+3 dataPtr equ dataSize+4 *** Set dataSize to -(dataSize/2)-1 so we can count up by one *** (instead of down by two) to see when we're done lda 400K Macintosh (DiskCopy uses this value for all Apple II disks not 800K in size, and even for some of those) $24 = 800K Apple II disk private (+082) Rev. Word Must be $0100. If this field is not $0100, the file may be in a different format. userData (+084) dataSize Bytes The data blocks for the disk. These are in order from block zero through the end of the disk. tagData (+xxx) tagSize Bytes The tag data for this disk, starting with the tag data for the first block and proceeding in order. This field is not present for 720K and 1440K disks, but it is present for all other formats even if all the data is zeroes. Further Reference _____________________________________________________________________________ o GS/OS Reference