home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 38
/
038.d81
/
autorun
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
5KB
|
181 lines
10 gosub60100:clr
200 cl$=chr$(147):ho$=chr$(19):poke646,1
210 e$=chr$(13)
220 poke53280,6:poke53281,6:gosub1070:poke53265,11
230 dv=peek(693):open15,dv,15:r$=chr$(18):o$=chr$(146)
235 fort=1to7:l$=l$+chr$(163):next
236 fort=1to40:ul$=ul$+chr$(163):next
240 rem setup menu
250 :
260 printcl$e$tab(16)"autorun"
280 print tab(16)l$:print tab(19)"by"
290 print tab(13)"jonathan rodda":d=4:gosub1630
300 print tab(9)"a - create autorun boot"e$
310 print tab(9)"v - view directory"e$
320 print tab(9)"d - send disk command"e$
330 print tab(9)"c - change device number"e$
340 print tab(9)"q - quit"
360 d=3:gosub1630:printul$
370 printtab(8)"select one of the above":poke53265,27
380 fort=0to9:poke631+t,0:next
385 a=peek(203):ifa<>10anda<>31anda<>18anda<>20anda<>62then385
390 poke198,.
400 ifa=10then700
402 ifa=31then500
404 ifa=18then540
406 ifa=20then460
410 rem return to basic
420 :
430 print"[145] are you sure you want to quit? (y/n)"
432 a=peek(203):ifa<>25anda<>39then432
434 ifa=39thenprint"[145] [145]":goto370
436 close15:open15,8,15,"r0:hello connect=hello connect":input#15,er:close15
437 ifer<>63thenend
438 load"hello connect",8
440 rem change device number
450 :
460 z=2:gosub570:v=val(s$):ifv<8orv>11then460
462 close15:open15,v,15:close15:ifst=0then470
465 print"drive #"v"not connected."
466 foreu=1to2500:next
468 goto 460
470 poke693,v:run 200
480 rem read directory
490 :
500 printcl$:open1,dv,0,"$":sys926
510 close1:gosub1460:run200
520 rem send disk command
530 :
540 z=255:gosub570:print#15,s$:gosub1430:run 200
550 rem keyboard input routine
560 :
570 gosub1480:gosub1520:printho$:d=5
580 gosub1630:printc$;:s$="":sc=1
590 gosub1380:ifa$=e$ands$<>""thenreturn
600 ifa$=chr$(34)then590
610 ifa$=chr$(20)andlen(s$)>0thenprinta$;:s$=left$(s$,len(s$)-1):goto590
620 ifz=5orz=2thenifa$<"0"ora$>"9"then590
630 ifz=1anda$<>"b"anda$<>"m"then590
640 ifz=1andlen(s$)=1anda$<>e$then590
645 if z=1 then return
650 ifa$<" "ora$>chr$(128)anda$<chr$(160)then590
655 iflen(s$)>zorz=17andlen(s$)>=16then590
660 s$=s$+a$
670 printa$;:goto590
680 rem main autorun routine
690 :
700 z=16:gosub570:m=751:gosub1590:poke698,l:f$=s$
710 z=1:gosub570:sh=2:ifa$="b"thensl=119:goto750
720 z=5:gosub570:sa=val(s$):h=sa/256
730 hi=int(h):lo=(h-hi)*256:sl=167
740 ifsa>65535then720
750 print e$e$e$"blank screen during load (y/n)? ";:sc=1
760 gosub1380:ifa$<>"y"anda$<>"n"then760
770 printa$:a1$=a$
780 :
790 poke710,11:ifa1$="n"thenpoke710,27
800 z=17:gosub570:gosub1480
810 printho$e$"insert a disk with"e$
820 print"a copy of: "r$f$e$
830 print"and press 'return'"e$:sc=0
840 gosub1380:ifa$<>e$then840
850 rem save autorun boot
860 :
870 printe$"writing: "r$s$
880 m=49151:gosub1590
890 ifsl=167thenpoke723,lo:poke724,hi
900 poke780,1:poke781,dv:poke782,1:sys65466
910 poke780,l:poke781,0:poke782,192:sys65469
920 poke251,sl:poke252,sh:poke780,251
930 poke781,4:poke782,3
940 ifsl=119thenpoke631,147:poke632,82:poke633,213:poke634,13
950 poke770,167:poke771,2:poke646,14:sys65496
960 poke770,131:poke771,164:poke646,1
970 poke723,216:poke724,2:gosub1430
980 ifu$<>"63"then run 200
990 printe$r$s$o$" exists"e$
1000 print"press 'r' to replace: ";r$s$:sc=0
1010 gosub1380:ifa$="r"then1030
1020 goto800
1030 printe$e$"replacing: "r$s$
1040 print#15,"s0:"+s$:goto880
1050 rem read machine language data
1060 :
1070 ifpeek(679)=169andpeek(926)=162thenreturn
1080 printcl$e$" please wait, reading data..."
1090 fort=0to87:readd:poke926+t,d
1100 ck=ck+d:next:ifck<>12826then1620
1110 ck=0:fort=0to65:readd:poke679+t,d
1120 ck=ck+d:next:ifck<>7617then1620
1130 return
1140 data 162,001,032,198,255,032,207
1150 data 255,032,207,255,032,207,255
1160 data 165,144,208,066,032,207,255
1170 data 240,061,032,204,255,032,228
1180 data 255,201,032,208,005,032,228
1190 data 255,240,251,162,001,032,198
1200 data 255,032,207,255,141,000,206
1210 data 032,207,255,168,174,000,206
1220 data 152,032,205,189,169,032,032
1230 data 210,255,032,207,255,240,006
1240 data 032,210,255,076,223,003,169
1250 data 013,032,210,255,076,169,003
1260 data 032,204,255,096,169,131,141
1270 data 002,003,169,164,141,003,003
1280 data 169,001,168,162,008,032,186
1290 data 255,169,003,162,240,160,002
1300 data 032,189,255,032,066,166,169
1310 data 011,141,017,208,169,000,032
1320 data 213,255,032,129,255,032,216
1330 data 002,076,116,164,166,174,164
1340 data 175,134,045,134,047,132,046
1350 data 132,048,169,004,133,198,096
1360 rem get keyboard character
1370 :
1380 if(sc) then print"[164]";
1381 geta$:ifa$=""then1381
1390 ifa$=chr$(133)thenrun200
1395 if(sc) then print"[157] [157]";
1400 return
1410 rem read disk error
1420 :
1430 print:input#15,u$,v$,w$,x$
1440 if u$="63" or u$="00" then return
1450 printe$r$u$","v$","w$","x$
1460 printe$"press any key to continue"
1470 gosub1380:return
1480 printcl$:d=20:gosub1630:printul$
1490 print tab(11)"press f1 for menu":return
1500 rem message routine
1510 :
1520 ifz<>1then1530
1525 c$="is "+r$+f$+o$+" in"+e$+e$+"(b)asic or (m)achine language? "
1530 ifz=2thenc$="enter new device number (8-11): "
1540 ifz=5thenc$="enter start address"+e$+e$+"of "+r$+f$+o$+": "
1550 ifz=16thenc$="enter file name"+e$+e$+"of program to autorun: "
1560 ifz=17thenc$="enter file name of"+e$+e$+"the autorun boot: "
1570 ifz=255thenc$="enter disk command"+e$+e$+">"
1580 return
1590 l=len(s$):fort=1tol
1600 pokem+t,asc(mid$(s$,t,1))
1610 next:return
1620 print"error in data":end
1630 fort=1tod:print:next:return
60100 poke53280,14:poke53281,14
60110 printchr$(142)"[147][213][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][192][192][192][192][192][192][192][192][192][192][192][192][192][201]";
60120 fora=1to23:print"[221]"spc(38)"[221]";:next
60130 print"[202][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][192][192][192][192][192][192][192][192][192][192][192][192][203][157][148][192]"
60135 fora=217to242:pokea,peek(a)or128:next
60140 print" loadstar presents:"
60150 print" "
60160 print" auto run "
60170 print" "
60180 print" by jonathan rodda "
60190 print" "
60200 print" copyright 1987 "
60210 print" "
60220 print" "
60230 print" press space to continue"
60240 ifpeek(203)<>60then60240
60250 return