[Coco] DUMPROM.BAS

Barry Nelson barry.nelson at amobiledevice.com
Wed Jan 17 13:53:24 EST 2018


> rietveld rietveld
> Wed Jan 17 13:30:59 EST 2018
> 
> Thanks Barry.
> 
> Just curious. With LINE 100.     Why did u limit the filename to 7 characters instead of 8

Look at the end of line 117, if the rom is bigger than 16k, each 16k section is saved to a separate file with a number on the end of the file name.

===

10 F$="PRGFLASH.BIN":GOSUB 3000:CLEAR 200,SA-1:CLS
15 BA=&H64:GOSUB 4000:'SET COCOFLASH BASE ADDRESS
90 LOADM"PRGFLASH.BIN":EXEC:'SETS UP ALL RAM MODE AND DEFINES USR    FUNCTIONS
100 INPUT "DUMP FILE NAME";D$:IF LEN(D$)>7 THEN PRINT "7 CHARACTERS OR LESS.":GOTO 100
110 INPUT "SIZE OF ROM IN K";K:IF K<>2 AND K<>4 AND K<>8 AND K<>16 AND K<>32 AND K<>64 AND K<>128 THEN PRINT "NOT SUPPORTED.":GOTO 110
111 IF K<16 THEN K=16:PRINT "DUMPING 16K."
112 INPUT "SLOT NUMBER";N:IF N<1 OR N>4 THEN 112 ELSE OLDSLOT=PEEK(&HFF7F):POKE 65315,54
115 KL=K:P=0:PRINT "PROGRESS..."
117 STRT=&HC000:POKE &HFF7F,&H11*(N-1):FF90=&HF4:O$=D$:IF K>16 THEN POKE &HFF40,P:P=P+1:O$=D$+RIGHT$(STR$(P),1)
118 IF PEEK(&HFFFE)=&H8C AND PEEK(&HFFFF)=&H1B AND P=1 AND K=32 THEN STRT=&H8000:FF90=&HF7
120 KL=KL-16:FOR O=0 TO 16383:ADD=STRT+O:IF ADD<&HFF00 THEN POKE &HE032,FF90:POKE &HFF90,FF90:POKE &H4000+O,USR4(ADD-65536) AND 255 ELSE POKE &H4000+O,&HFF
130 IF O/1024=INT(O/1024) THEN PRINT CHR$(128);:IF K=16 THEN PRINT CHR$(128);
140 NEXT O:POKE &HE032,&HC4:POKE &HFF90,&HC4:POKE &HFF7F,OLDSLOT:SAVEM O$,&H4000,&H7FFF,&H4000:IF KL>0 THEN 117
150 CLS:POKE 113,0:POKE &HC000,0:POKE &HC001,0:EXEC PEEK(&HFFFE)*256+PEEK(&HFFFF)
2999 END
3000 OPEN "D",1,F$,5:FIELD #1,5 AS H$:GET #1,1:SA=ASC(MID$(H$,4,1))*256+ASC(MID$(H$,5,1)):BL=ASC(MID$(H$,2,1))*256+ASC(MID$(H$,3,1)):CLOSE #1:RETURN
4000 P=PEEK(&HFF80):POKE &HFF80,&H55:POKE &HFF80,&HAA:POKE &HFF80,&H21:POKE &HFF80,&H01:POKE &HFF80,BA:RETURN



More information about the Coco mailing list