Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!lll-winken!unixhub!shelby!helens!calvin!zimmer From: zimmer@calvin.tmc.edu (Andrew Zimmerman) Newsgroups: comp.sys.handhelds Subject: coversion program for Sad Message-ID: <1067@helens.Stanford.EDU> Date: 25 Sep 90 19:22:32 GMT References: <1049@helens.Stanford.EDU> <1990Sep24.082943@ultnix.enet.dec.com> Sender: news@helens.Stanford.EDU Reply-To: zimmer@calvin.stanford.edu (Andrew Zimmerman) Organization: Stanford University Lines: 57 This program will convert a memory scan dump of the 48sx to the format used by SAD 1.01. (SAD 1.01 is a great program) #include #include FILE *infp; FILE *outfp; char rom[524288]; main(argc,argv) int argc; char *argv[]; { int address; int chkaddress; int nibble[17]; int n1; int i; if(argc < 2) { infp = stdin; } else { infp = fopen(argv[1],"r"); } if(argc < 3) { outfp = stdout; } else { outfp = fopen(argv[2],"w"); } chkaddress = 0; while(fscanf(infp,"%05X:",&address) != EOF) { if(address != chkaddress) { fprintf(stderr,"[%05X] != [%05X]\n",chkaddress,address); } chkaddress += 16; for(i=0; i < 16; i ++) { fscanf(infp,"%1X",&n1); fprintf(outfp,"%c",n1); } } } Andrew zimmer@calvin.stanford.edu