home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CBM Funet Archive
/
cbm-funet-archive-2003.iso
/
cbm
/
demodisks
/
drives
/
1581-demo.lzh
/
backup128-1581
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
1994-10-19
|
4KB
|
93 lines
100 f=abs(peek(65533)=255):remf=0if 64
105 iff=1thenpoke48,4:poke47,0:clr
110 sys10246:r$="try"
115 poke53281,0:poke53280,0
120 wd=0:ps=0:bl$=" "
125 bl$=bl$+"[157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157]":d$=""
130 l2$="[155][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192]":zz=8:px=57093:pokepx,0:if(peek(px)<>0)then145
135 pokepx,255:if(peek(px)<>255)then145
140 zz=2:if((peek(px-5)and16)=0)thenzz=4
145 nd=0:u=8:gosub415
150 u=9:gosub415:ifnd=2then165
155 u=10:gosub415:ifnd=2then165
160 u=11:gosub415
165 u=su:ap$=right$(str$(zz),2)+" passes ":ifnd=2thenap$=" one pass "
170 print"[147]"spc(7)l2$:printspc(7)"[159] c128 backup 1581 disk ":printspc(7)l2$
175 print"[159] to avoid mistakes, slide the write "
180 print" protect tab on the right side of "
185 print" your original disk into the open "
190 print" position. it will take"ap$
195 print" to backup the whole disk. "
200 ln$=" "+l2$+"[192][192][192][192][192][192][192][192][192][192][192]":u$="[145][145][145][145][145][145][145][145]"
205 print""ln$:printspc(2)"[159] instructions:":println$""d$
210 uu=1:ifu>9thenuu=2
215 ifpeek((NULL)("280c"))<>0then305
220 if nd=0 then305
225 ifnd=2then460
230 println$:print" [159]unit:"u spc(uu)"[159] pass: 1 [159]r to restart":println$"[145][145][145][145]"u$
235 gosub450:poke(NULL)("2811"),u:gosub315:sys(NULL)("2800")
240 gosub400:ifa<>0then380
245 gosub315
250 sys(NULL)("2803")
255 gosub400:ifa<>0then380
260 forpx=0tozz-2
265 gosub315:sys(NULL)("2800")
270 gosub400:ifa<>0then380
275 gosub315:sys(NULL)("2803")
280 gosub400:ifa<>0then380
285 nextpx
290 open15,u,15,"i0":close15
295 print""d$d$d$:gosub410:printspc(13)"all done.":r$="run":goto385
300 poke48,4:clr:end
305 print""d$d$d$:gosub410:printspc(9)"sorry, this runs on a"
310 printspc(8)"c128 with 1581 only.":goto385
315 if(ps>1)and((psand1)=0)thengosub405
320 ap$="writ":dp$="destination":ps=ps+1
325 if(psand1)=1thendp$="original":ap$="read"
330 ag$=" again,":ifps<3thenag$=","
335 ifwd=0then ag$=","
345 ifpeek(11226)<>0then360
350 if(ap$="writ")then printspc(7)"empty buffer...":return
355 ifps>1thenprintspc(7)"still "ap$"ing the":printspc(7)dp$" disk...":return
360 printspc(7)"insert "dp$" disk"ag$
361 printspc(7)"press any key when ready."
365 get(NULL)a$:ifa$="r"thenclr:goto395
370 if(wd=0 and ap$="writ")thengosub435:wd=1
375 printspc(7)ap$"ing...":return
380 print""d$d$d$:gosub410:printspc(11)"sorry, disk error"
385 print:printspc(7)"press q to quit; or press":printspc(7)"any other key to "r$" again."
390 get(NULL)a$:ifa$="q"thenprint"[147]":goto300
395 poke48,4:poke50,4:poke52,4:clr:run
400 open15,u,15:input#15,a,b$,c,d:close15
401 ifpeek((NULL)("280e"))<>0thena=78:b$="backup error"
402 return
405 print""spc(19)ps/2+1"[145][145][145]"
410 printu$;:forx=1to8:printbl$"";:nextx:print"[145]"u$:return
415 b$="":(NULL)420:open15,u,15:print#15,"m-r"chr$(198)chr$(229)chr$(1):get#15,b$
420 close15:ifasc(b$)<>255then430
425 nd=nd+1:du=u:ifnd=1thensu=u
430 return
435 open15,u,15,"i0":input#15,a,b$,c,d:close15:ifa<20thenreturn
440 ifwd=0thenap$="formatt":gosub375:print"[145][145]"
441 (NULL)"tem,"+id$,u(u):ap$="writ":return
450 open2,u,0,"$0:":forx=1to26:get#2,a$:next:get#2,a$,b$:id$=a$+b$:close2:return
455 rem--------
460 println$:print" [159]unit:"su"[159]to"du"[159] pass: 1 [159]r to restart":println$"[145][145][145][145]"u$
465 if(NULL)(2)>4 then (NULL)%:(NULL):(NULL)&:(NULL)0
470 poke(NULL)("281f"),0:wd=1
475 poke(NULL)("2820"),1
480 printspc(7)"insert the original disk in"
485 printspc(7)"unit"u"[157]. put the destination"
490 printspc(7)"disk in unit"du"[157]."
495 ap$="work":print:gosub361:print
500 gosub450:u=du:gosub435
505 open 8,su,15,"i0":gosub530:ifa<>0thenclose8:goto380
506 open9,du,15:gosub535:ifa<>0thenclose9:close8:goto380
510 sys(NULL)("2809")
515 x=peek((NULL)("2810")):y=peek((NULL)("280e")):z=peek((NULL)("280f")):y=z*256+y
520 ifx>128thenx=x-128:ify<>0thenclose8:close9:goto380
525 close9:close8:open9,du,15,"i0":close9:goto295
530 input#8,a,b$,c,d:return
535 input#9,a,a$,b$,c$:return
540 "##############################"