home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.apple2
- Path: sparky!uunet!cpqhou!reneg
- From: reneg@cpqhou.compaq.com (Rene Gaudet)
- Subject: Re: *** WANTED: APL2EM Apple Emulator Info ***
- Organization: Compaq Computer Corporation
- Date: Thu, 05 Nov 92 14:46:48 GMT
- Message-ID: <1992Nov05.144648.14321@cpqhou.compaq.com>
- References: <1d1jfoINN1u4@haydn.crhc.uiuc.edu>
- Lines: 94
-
- > NNTP-Posting-Host: haydn.crhc.uiuc.edu
- >
- > I also have a question as to how to transfer a Apple disk image
- > to the the APL2EM's .DSK format. Can you use a standard null-modem
- > cable with some kind of serial transfer protocol (ie, xmodem)?
- > Also what utility on the Apple do you use to convert the entire
- > disk image into a single file (in this case, a .DSK format)?
- > I believe the .DSK format is a pure binary image without
- > any special checksums, headers, etc.
- >
- > Any help would be appreciated!
- >
- > Thanks
-
- Here is what I have found to be an easy way to transfer disk images
- from apple to the .DSK format on the PC.
-
- 1) Use shrinkit to compress the Disk into an archive on your apple.
- 2) Transfer the the compressed file to the PC using a comm program on
- each end, such as ProTerm and Telix.
- 3) Use nulib to extract the compressed file into a disk image file on your PC.
- 4) Run the mapper program listed below on the disk image file, it reorders
- the prodos sectors to DOS sectors.
-
- Both shrinkit and nulib are available at cco.caltech.edu.
-
- /* Code starts here: It's not pretty, but it works.
-
- #include <stdio.h>
- #include <stdlib.h>
-
-
- /*
- * Map a disk image in Prodos block ordering to DOS 3.3 block ordering
- * usage: mapper old_image new_image
- */
-
- void main (argc, argv)
- int argc;
- char *argv[];
- {
- unsigned char buf[4096];
- int track;
- FILE *i, *o;
-
- if (argc < 3) {
- printf ("MAPPER Utility for Apple disk images\n");
- printf ("Converts ProDOS sectors to DOS 3.3 sectors\n");
- printf ("Mapper Usage: \n");
- printf ("mapper <inputfile> <outputfile>");
- exit(1);
- }
- i = fopen(argv[1],"r+b");
- if (i == NULL)
- {
- printf("Error opening file %s for input\n",argv[2]);
- exit(1);
- }
- o = fopen(argv[2],"w+b");
- if (o == NULL)
- {
- printf("Error opening file %s for output\n",argv[3]);
- exit(1);
- }
-
-
- for (track = 0; track < 35; track++) {
- if (fread(buf, 1, 4096, i) != 4096) {
- perror("bad read");
- exit(1);
- }
-
- fwrite(buf,1 , 256, o);
- fwrite(&buf[0xE00],1 , 256, o);
- fwrite(&buf[0xD00],1 , 256, o);
- fwrite(&buf[0xC00],1 , 256, o);
- fwrite(&buf[0xB00],1 , 256, o);
- fwrite(&buf[0xA00],1 , 256, o);
- fwrite(&buf[0x900],1 , 256, o);
- fwrite(&buf[0x800],1 , 256, o);
- fwrite(&buf[0x700],1 , 256, o);
- fwrite(&buf[0x600],1 , 256, o);
- fwrite(&buf[0x500],1 , 256, o);
- fwrite(&buf[0x400],1 , 256, o);
- fwrite(&buf[0x300],1 , 256, o);
- fwrite(&buf[0x200],1 , 256, o);
- fwrite(&buf[0x100],1 , 256, o);
- fwrite(&buf[0xF00],1 , 256, o);
- }
- }
-
-
- Rene Gaudet
- reneg@cpqhou.se.hou.compaq.com
-