home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.binaries.ibm.pc.archives
- Path: sparky!uunet!cpqhou!reneg
- From: reneg@cpqhou.compaq.com (Rene Gaudet)
- Subject: Re: Apple IIe emulator for the PC
- Organization: Compaq Computer Corporation
- Date: Fri, 13 Nov 92 04:15:05 GMT
- Message-ID: <1992Nov13.041505.27692@cpqhou.compaq.com>
- References: <1992Nov11.093249.4247@nntp.hut.fi>
- Lines: 87
-
- >
- > Lets say I have access to an Apple II computer and a IBM computer.
- > How do I get an image of an Apple floppy onto my MSDOS hard disk?
- > Through a serial cable, I guess. However, how do I make an image file
- > out of the Apple disk? What program or utility can create the image?
-
- Here is what I have found to be an easy way to transfer disk images
- from apple to the .DSK format on the PC. Assuming you have a serial
- card for the apple 2 as well as comm software.
-
- 1) Use shrinkit to compress the Disk into an archive on your apple.
- 2) Transfer 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.
-
- The apple 2 emulator, 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
-
-