home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 38 / 038.d81 / autorun (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  5KB  |  181 lines

  1. 10 gosub60100:clr
  2. 200 cl$=chr$(147):ho$=chr$(19):poke646,1
  3. 210 e$=chr$(13)
  4. 220 poke53280,6:poke53281,6:gosub1070:poke53265,11
  5. 230 dv=peek(693):open15,dv,15:r$=chr$(18):o$=chr$(146)
  6. 235 fort=1to7:l$=l$+chr$(163):next
  7. 236 fort=1to40:ul$=ul$+chr$(163):next
  8. 240 rem   setup menu
  9. 250 :
  10. 260 printcl$e$tab(16)"autorun"
  11. 280 print tab(16)l$:print tab(19)"by"
  12. 290 print tab(13)"jonathan rodda":d=4:gosub1630
  13. 300 print tab(9)"a - create autorun boot"e$
  14. 310 print tab(9)"v - view directory"e$
  15. 320 print tab(9)"d - send disk command"e$
  16. 330 print tab(9)"c - change device number"e$
  17. 340 print tab(9)"q - quit"
  18. 360 d=3:gosub1630:printul$
  19. 370 printtab(8)"select one of the above":poke53265,27
  20. 380 fort=0to9:poke631+t,0:next
  21. 385 a=peek(203):ifa<>10anda<>31anda<>18anda<>20anda<>62then385
  22. 390 poke198,.
  23. 400 ifa=10then700
  24. 402 ifa=31then500
  25. 404 ifa=18then540
  26. 406 ifa=20then460
  27. 410 rem return to basic
  28. 420 :
  29. 430 print"[145]  are you sure you want to quit? (y/n)"
  30. 432 a=peek(203):ifa<>25anda<>39then432
  31. 434 ifa=39thenprint"[145]                                      [145]":goto370
  32. 436 close15:open15,8,15,"r0:hello connect=hello connect":input#15,er:close15
  33. 437 ifer<>63thenend
  34. 438 load"hello connect",8
  35. 440 rem change device number
  36. 450 :
  37. 460 z=2:gosub570:v=val(s$):ifv<8orv>11then460
  38. 462 close15:open15,v,15:close15:ifst=0then470
  39. 465 print"drive #"v"not connected."
  40. 466 foreu=1to2500:next
  41. 468 goto 460
  42. 470 poke693,v:run 200
  43. 480 rem read directory
  44. 490 :
  45. 500 printcl$:open1,dv,0,"$":sys926
  46. 510 close1:gosub1460:run200
  47. 520 rem send disk command
  48. 530 :
  49. 540 z=255:gosub570:print#15,s$:gosub1430:run 200
  50. 550 rem keyboard input routine
  51. 560 :
  52. 570 gosub1480:gosub1520:printho$:d=5
  53. 580 gosub1630:printc$;:s$="":sc=1
  54. 590 gosub1380:ifa$=e$ands$<>""thenreturn
  55. 600 ifa$=chr$(34)then590
  56. 610 ifa$=chr$(20)andlen(s$)>0thenprinta$;:s$=left$(s$,len(s$)-1):goto590
  57. 620 ifz=5orz=2thenifa$<"0"ora$>"9"then590
  58. 630 ifz=1anda$<>"b"anda$<>"m"then590
  59. 640 ifz=1andlen(s$)=1anda$<>e$then590
  60. 645 if z=1   then return
  61. 650 ifa$<" "ora$>chr$(128)anda$<chr$(160)then590
  62. 655 iflen(s$)>zorz=17andlen(s$)>=16then590
  63. 660 s$=s$+a$
  64. 670 printa$;:goto590
  65. 680 rem main autorun routine
  66. 690 :
  67. 700 z=16:gosub570:m=751:gosub1590:poke698,l:f$=s$
  68. 710 z=1:gosub570:sh=2:ifa$="b"thensl=119:goto750
  69. 720 z=5:gosub570:sa=val(s$):h=sa/256
  70. 730 hi=int(h):lo=(h-hi)*256:sl=167
  71. 740 ifsa>65535then720
  72. 750 print e$e$e$"blank screen during load (y/n)? ";:sc=1
  73. 760 gosub1380:ifa$<>"y"anda$<>"n"then760
  74. 770 printa$:a1$=a$
  75. 780 :
  76. 790 poke710,11:ifa1$="n"thenpoke710,27
  77. 800 z=17:gosub570:gosub1480
  78. 810 printho$e$"insert a disk with"e$
  79. 820 print"a copy of: "r$f$e$
  80. 830 print"and press 'return'"e$:sc=0
  81. 840 gosub1380:ifa$<>e$then840
  82. 850 rem save autorun boot
  83. 860 :
  84. 870 printe$"writing: "r$s$
  85. 880 m=49151:gosub1590
  86. 890 ifsl=167thenpoke723,lo:poke724,hi
  87. 900 poke780,1:poke781,dv:poke782,1:sys65466
  88. 910 poke780,l:poke781,0:poke782,192:sys65469
  89. 920 poke251,sl:poke252,sh:poke780,251
  90. 930 poke781,4:poke782,3
  91. 940 ifsl=119thenpoke631,147:poke632,82:poke633,213:poke634,13
  92. 950 poke770,167:poke771,2:poke646,14:sys65496
  93. 960 poke770,131:poke771,164:poke646,1
  94. 970 poke723,216:poke724,2:gosub1430
  95. 980 ifu$<>"63"then run 200
  96. 990 printe$r$s$o$" exists"e$
  97. 1000 print"press 'r' to replace: ";r$s$:sc=0
  98. 1010 gosub1380:ifa$="r"then1030
  99. 1020 goto800
  100. 1030 printe$e$"replacing: "r$s$
  101. 1040 print#15,"s0:"+s$:goto880
  102. 1050 rem read machine language data
  103. 1060 :
  104. 1070 ifpeek(679)=169andpeek(926)=162thenreturn
  105. 1080 printcl$e$"      please wait, reading data..."
  106. 1090 fort=0to87:readd:poke926+t,d
  107. 1100 ck=ck+d:next:ifck<>12826then1620
  108. 1110 ck=0:fort=0to65:readd:poke679+t,d
  109. 1120 ck=ck+d:next:ifck<>7617then1620
  110. 1130 return
  111. 1140 data 162,001,032,198,255,032,207
  112. 1150 data 255,032,207,255,032,207,255
  113. 1160 data 165,144,208,066,032,207,255
  114. 1170 data 240,061,032,204,255,032,228
  115. 1180 data 255,201,032,208,005,032,228
  116. 1190 data 255,240,251,162,001,032,198
  117. 1200 data 255,032,207,255,141,000,206
  118. 1210 data 032,207,255,168,174,000,206
  119. 1220 data 152,032,205,189,169,032,032
  120. 1230 data 210,255,032,207,255,240,006
  121. 1240 data 032,210,255,076,223,003,169
  122. 1250 data 013,032,210,255,076,169,003
  123. 1260 data 032,204,255,096,169,131,141
  124. 1270 data 002,003,169,164,141,003,003
  125. 1280 data 169,001,168,162,008,032,186
  126. 1290 data 255,169,003,162,240,160,002
  127. 1300 data 032,189,255,032,066,166,169
  128. 1310 data 011,141,017,208,169,000,032
  129. 1320 data 213,255,032,129,255,032,216
  130. 1330 data 002,076,116,164,166,174,164
  131. 1340 data 175,134,045,134,047,132,046
  132. 1350 data 132,048,169,004,133,198,096
  133. 1360 rem get keyboard character
  134. 1370 :
  135. 1380 if(sc) then  print"[164]";
  136. 1381 geta$:ifa$=""then1381
  137. 1390 ifa$=chr$(133)thenrun200
  138. 1395 if(sc) then  print"[157] [157]";
  139. 1400 return
  140. 1410 rem read disk error
  141. 1420 :
  142. 1430 print:input#15,u$,v$,w$,x$
  143. 1440 if u$="63" or u$="00" then return
  144. 1450 printe$r$u$","v$","w$","x$
  145. 1460 printe$"press any key to continue"
  146. 1470 gosub1380:return
  147. 1480 printcl$:d=20:gosub1630:printul$
  148. 1490 print tab(11)"press f1 for menu":return
  149. 1500 rem message routine
  150. 1510 :
  151. 1520 ifz<>1then1530
  152. 1525 c$="is "+r$+f$+o$+" in"+e$+e$+"(b)asic or (m)achine language? "
  153. 1530 ifz=2thenc$="enter new device number (8-11): "
  154. 1540 ifz=5thenc$="enter start address"+e$+e$+"of "+r$+f$+o$+": "
  155. 1550 ifz=16thenc$="enter file name"+e$+e$+"of program to autorun: "
  156. 1560 ifz=17thenc$="enter file name of"+e$+e$+"the autorun boot: "
  157. 1570 ifz=255thenc$="enter disk command"+e$+e$+">"
  158. 1580 return
  159. 1590 l=len(s$):fort=1tol
  160. 1600 pokem+t,asc(mid$(s$,t,1))
  161. 1610 next:return
  162. 1620 print"error in data":end
  163. 1630 fort=1tod:print:next:return
  164. 60100 poke53280,14:poke53281,14
  165. 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]";
  166. 60120 fora=1to23:print"[221]"spc(38)"[221]";:next
  167. 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]"
  168. 60135 fora=217to242:pokea,peek(a)or128:next
  169. 60140 print"          loadstar presents:"
  170. 60150 print"                               "
  171. 60160 print"               auto  run        "
  172. 60170 print"                                "
  173. 60180 print"           by jonathan rodda    "
  174. 60190 print"                                "
  175. 60200 print"            copyright  1987     "
  176. 60210 print"                                "
  177. 60220 print"                                "
  178. 60230 print"        press space to continue"
  179. 60240 ifpeek(203)<>60then60240
  180. 60250 return
  181.