From: unknown@Apple.COM (Matt Ackeret)
Newsgroups: alt.emulators.ibmpc.apple2
Subject: Reply from author of Nulib about moving disks to emulator
Date: 13 Dec 92 22:46:07 GMT
Organization: Apple Computer Inc, Cupertino, CA

Here's a reply from Andy McFadden, author of Nulib, that he asked me to
post since his site hasn't gotten this group yet.  It's about moving
disks to the emulator.

--start of forwarded message
Here's what I've got.  I haven't actually tried it though.
 
The problem is that ShrinkIt stores files in ProDOS block order; block 0
has sectors 0 and 2 in it (they're skewed for speed reasons).  The Apple II
emulator is expecting DOS 3.3 sector ordering, so you need to fix it.
 
The UNIX emulator expects ProDOS block ordering, so the output of NuLib
will work just fine.
 
----- forwarded message -----
Article 24906 of comp.sys.apple2:
>From: reneg@cpqhou.compaq.com (Rene Gaudet)
Subject: Re: *** WANTED: APL2EM Apple Emulator Info ***
Date: 5 Nov 92 14:46:48 GMT
 
> 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
 
--
fadden@uts.amdahl.com (Andy McFadden)
[ Above opinions are mine, Amdahl has nothing to do with them, etc, etc. ]
--end of forwarded message

Sure is awful funny you guys are now trying to emulate the II. Regret getting
some boring PC rather than a fun Apple II?
-- 
unknown@apple.com		Apple II Forever
unknown@ucscb.ucsc.edu
Newsgroups: alt.emulators.ibmpc.apple2