1 REMark rcopy (c) Timo Salmi
2 REMark Sat 1987 May 30 10:07:29
3 REMark version 2.1
4 :
100 CLS#0
110 _a=RESPR(2118)
120 LBYTES fdk1_cst_ram_bin,_a
130 CALL _a
140 IF room THEN 
150  PRINT#0,"Ramdisk"!"by"!"CST"!"loaded"
160  PRINT#0,"RCOPY by"!"Timo Salmi"!"loaded"
170 ELSE 
180  BEEP 4000,8:PRINT#0,"Error:"!"out"!"of"!"memory"!;
190  PRINT#0,"or"!"loaded"!"twice":PRINT#0,"RESET QL"
200 END IF 
210 :
2000 DEFine FuNction room
2010  LOCal sec%
2020  sec%=INT(f_mem/512)-16:IF sec%>200 THEN sec%=200
2030  IF sec%>20 THEN 
2040   FORMAT "ram8_"&sec%
2050   PRINT"AVAILABLE"!"FOR"!"RCOPY":RETurn 1:END IF 
2060  RETurn 0
2070 END DEFine room
2080 :
2090 DEFine PROCedure rcopy(a%,b%,f$)
2100  LOCal d1$(5),d2$(5),key%,loop
2110  d1$=device$((a%)):d2$=device$((b%))
2120  COPY d1$&f$ TO "ram8_"&f$:DIR ram8_
2130  IF a%=b% THEN 
2140   CLS#0:BEEP 800,50
2150   PRINT#0,"destination"!"to"!"drive"!d2$;","!;
2160   PRINT#0,"then"!"press"!"F5"!"(or ESC)"
2170   clb=KEYROW(0)
2180   REPeat loop
2190    key%=CODE(INKEY$(-1))
2200    IF key%=27:DELETE "ram8_"&f$:RETurn :END IF 
2210    IF key%=248 THEN EXIT loop
2220   END REPeat loop
2230  END IF 
2240  IF d2$<>"scr_" THEN 
2250   DELETE d2$&f$:COPY "ram8_"&f$ TO d2$&f$
2260   CLS#0:PRINT#0,d1$&f$!"copied"!"to"!d2$&f$
2270   ELSE : COPY "ram8_"&f$ TO scr_:END IF 
2280   DELETE "ram8_"&f$
2290 END DEFine rcopy
2300 :
2310 DEFine FuNction device$(a%)
2320  IF a%=1 THEN RETurn "mdv1_"
2330  IF a%=2 THEN RETurn "mdv2_"
2340  IF a%=3 THEN RETurn "fdk1_"
2350  IF a%=4 THEN RETurn "fdk2_"
2360  RETurn "scr_"
2370 END DEFine device$
2380 :
18500 DEFine FuNction f_mem
18510  RETurn PEEK_L(163856)-PEEK_L(163852)
18520 END DEFine f_mem
18530 :
31000 DEFine PROCedure reset(i)
31010  LOCal il:MODE i
31020  WINDOW 513,256,0,0:PAPER 0:CLS
31030  OPEN#2,con_:WINDOW#2,448,200,32,16
31040  PAPER#2,1:INK#2,7
31050  WINDOW#0,448,40-(i=4),32,216+(i=4)
31060  WINDOW 448+8*(i=4),200+2*(i=4),32-4*(i=4),16-(i=4)
31070  PAPER 2*(i=8):BORDER (i=4),4*(i=4)
31080  FOR il=0,1,2:CSIZE#il,(i=4)+2*(i=8),0:END FOR il
31090  PAPER#0,0:INK#0,7-3*(i=0):INK 7:CLS
31100  SCALE 100,0,0:FILL 0
31110 END DEFine reset
31120 :
31990 STOP
32000 vsave 1:STOP
32010 vsave 2:STOP
32020 vsave 3:STOP
32030 vsave 4:STOP
32040 vsave 5:STOP
32050 vsave 6:STOP
32060 DEFine PROCedure vsave(dr)
32070  LOCal a$,b$,d$(6,5):a$="rcopy"
32080  b$=DATE$:b$=b$(1 TO 4)
32090  IF b$<>1987 THEN
32100   PRINT#0,DAY$!DATE$!"date error, SDATE first"
32110   BEEP 4000,12:STOP:END IF 
32120  ver1%=2:ver2%=1
32130  d$(1)="mdv1_":d$(2)="mdv2_"
32140  d$(3)="fdk1_":d$(4)="fdk2_"
32150  d$(5)="ram1_":d$(6)="ram2_"
32160  b$=d$(dr)&a$
32170  DELETE b$:OPEN_NEW#3,b$:ver%=ver2%+1
32180  PRINT#3,"1 REMark ";a$!"(c) Timo Salmi"
32190  PRINT#3,"2 REMark ";DAY$!DATE$
32200  PRINT#3,"3 REMark version"!ver1%;".";ver%
32210  PRINT#3,"4 :"
32220  LIST#3,100 TO 32110
32230  PRINT#3,"32120  ver1%=";ver1%;":ver2%=";ver%
32240  LIST#3,32130 TO:CLOSE#3
32250  PRINT#0,"Saved"!b$!"version"!ver1%;".";ver%
32260 END DEFine vsave
