home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1991 February / 1991-02.d64 / periscope.64 (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  4KB  |  125 lines

  1. 0 clr
  2. 10 rem copyright 1991 - compute publications intl ltd - all rights reserved
  3. 40 gosub720
  4. 50 gosub870
  5. 60 input "device number8[157][157][157]";dr:if dr<8 or dr>11 then 60
  6. 70 print"[147]"
  7. 80 open15,dr,15:open5,dr,5,"#":open4,dr,4,"#":gosub220:goto270
  8. 90 input "track,sector number          [157][157][157][157][157][157][157][157][157][157]";tr,se
  9. 100 print "                                       "
  10. 110 ifty$="a"and(tr<1ortr>80orse<0orse>39)thenreturn
  11. 120 ifty$<>"b"then170
  12. 130 if(tr<1ortr>70orse<0orse>20)thenreturn
  13. 140 if((tr>17andtr<25)or(tr>52andtr<60))andse>18thenreturn
  14. 150 if((tr>24andtr<31)or(tr>59andtr<66))andse>17thenreturn
  15. 160 if((tr>30andtr<36)or(tr>65andtr<71))andse>16thenreturn
  16. 170 ifty$<>"c"then220
  17. 180 iftr<1ortr>35orse<0orse>20thenreturn
  18. 190 iftr>17andtr<25andse>18thenreturn
  19. 200 iftr>24andtr<31andse>17thenreturn
  20. 210 iftr>30andse>16thenreturn
  21. 220 print#15,"u1";5;0;tr;se
  22. 230 sys49152
  23. 240 bk(po)=tr:bk(po+1)=se:po=po+2:ifpo>51thenpo=0
  24. 250 ifpo>lithenli=po
  25. 260 return
  26. 270 gosub850:print""me$:print"track      [157][157][157][157][157][157]"tr;
  27. 280 print" sector      [157][157][157][157][157][157]"se"        "
  28. 290 get c$:ifc$=""then 290
  29. 300 ifc$="j"thengosub680
  30. 310 ifc$="e"thengosub370
  31. 320 ifc$="n"thengosub90
  32. 330 ifc$="b"thengosub650
  33. 340 ifc$="q"then690
  34. 350 ifc$="v"thengosub990
  35. 360 goto270
  36. 370 cl=0
  37. 380 gosub1020
  38. 390 gosub590:getin$:ifin$=""then390
  39. 400 in=asc(in$):ifin=23then630
  40. 410 ifin=22thengosub990:in$="":goto390
  41. 420 ifincos13thenreturn
  42. 430 ifin=19then370
  43. 440 ifin=10thentr=peek(c1):se=peek(c1+1):gosub110:poke197,0:goto370
  44. 450 ifincos2thengosub650:poke208,0:goto370
  45. 460 ifin=17andcl<215thencl=cl+40:goto530
  46. 470 ifin=29andcl<255then520
  47. 480 ifin=145andcl>39thencl=cl-40:goto530
  48. 490 ifin=157andcl>0thencl=cl-1:goto530
  49. 500 ifin=18orin=146then530
  50. 510 ifin<32or(in>127andin<160)then390
  51. 520 cl=cl+1:ifcl>256then370
  52. 530 poke781,(c1-1024)/40
  53. 540 c2=(c1-1024)
  54. 550 ifc2>39thenc2=c2-40:goto550
  55. 560 poke782,c2
  56. 570 poke783,peek(783)and254:sys65520
  57. 580 printin$;:goto390
  58. 590 c1=1024+cl:c2=peek(c1):poke820,c2:sys49198
  59. 600 pokec1,peek(820):c3=peek(c1+1):c4=c2+c3*256
  60. 610 pokec1,c2:poke782,19:poke781,7:poke783,peek(783)and254:sys65520
  61. 620 print"      [157][157][157][157][157][157]"c2"      [157][157][157][157][157][157]"c4:return
  62. 621 print"";
  63. 622 input"write this to disk <y/n>                [157][157][157][157][157][157][157][157][157][157][157][157]"
  64. 623 ifwr$<>"y"then200
  65. 630 print"";
  66. 631 input"write sector to disk <y/n> n            [157][157][157][157][157][157][157][157][157][157][157][157][157]";wr$
  67. 632 print"                                                 "
  68. 633 ifwr$<>"y"then220
  69. 635 sys49171
  70. 640 print#15,"u2";4;0;tr;se:return
  71. 650 po=po-4:ifpo<0thenpo=li:print"no previous sector":goto670
  72. 660 tr=bk(po):se=bk(po+1)
  73. 670 gosub1030:print"                    ":goto110
  74. 680 tr=peek(1024):se=peek(1025):goto110
  75. 690 input#15,a,b$,c,d:printa;b$;c;d
  76. 700 close4:close5:close15:print"[147]"
  77. 710 poke808,237:end:rem enable stop key and run/stop-restore
  78. 720 po=0:c1=1024:dim bk(51):printchr$(14)chr$(8):poke248,192:tr=1:se=1
  79. 730 poke53280,0:poke53281,0:print"[147]"tab(14)"[208]eriscope 2.0":print
  80. 740 bx$="[195]opyright 1991 [195][207][205][208][213][212][197] [208]ub. [201]ntl. [204]td.":gosub 9998
  81. 750 bx$="[193]ll [210]ights [210]eserved":gosub 9998
  82. 760 re$=chr$(13):me$="[158]j       jump to next link"+re$+"q       quit"+re$
  83. 770 me$=me$+"e       edit"+re$+"n       new sector"+re$
  84. 780 me$=me$+"b       back up     "+re$
  85. 785 me$=me$+"v       value         "+re$+"press key"
  86. 790 ee$="[158]ctrl-j  jump to next link"+re$+"[210]eturn  exit           "+re$
  87. 800 ee$=ee$+"ctrl-b  back up   "+re$+"ctrl-v  value         "
  88. 805 ee$=ee$+re$+"ctrl-w  write sector"
  89. 810 ee$=ee$+"            "+re$+"             "+re$+"press key          "
  90. 820 cl$="                                        "
  91. 830 restore:fori=0to54:reada:poke49152+i,a:b=b+a
  92. 840 next:ifb<>7120thenprint"[147]error  in data statements":end
  93. 850 :
  94. 860 poke808,234:return:rem disable stop and run/stop-restore
  95. 870 s1=0:s$="158115711541":ty$="abc"
  96. 880 goto940
  97. 890 geta$:ifa$=""then 890
  98. 900 ifa$="[145]"ora$=""ora$=chr$(13)then920
  99. 910 goto870
  100. 920 ifa$=chr$(13)thenty$=mid$(ty$,s1+1,1):return
  101. 930 s1=s1+(a$="[145]")-(a$=""):if(s1<0ors1>2)thens1=-2*(s1<0):ifs1>2thens1=0
  102. 940 print"cursor to":print"highlight":print"drive type":print
  103. 950 fori=0to2:gosub970:next
  104. 960 goto890
  105. 970 ifs1=ithenprint"";
  106. 980 forj=0to3:printmid$(s$,i*4+j+1,1);:next:print:return
  107. 990 input"enter value to insert";a$
  108. 1000 a=int(val(a$)):ifa>-1anda<256thenpokec1,a
  109. 1005 print"                          ":return
  110. 1010 goto990
  111. 1020 print""ee$:print"track"tr"[157]  sector"se"[157]  ":return
  112. 1030 fori=0to1000:next:return
  113. 1040 data162,005,032,198,255
  114. 1050 data160,000,032,207,255
  115. 1060 data153,000,004,200,208
  116. 1070 data247,076,204,255,162
  117. 1080 data004,032,201,255,160
  118. 1090 data000,185,001,004,032
  119. 1100 data210,255,200,192,255
  120. 1110 data144,245,173,000,004
  121. 1120 data032,210,255,076,204
  122. 1130 data255,173,052,003,073
  123. 1140 data128,141,052,003,096
  124. 9998 for tx=1 to 20-len(bx$)/2:printchr$(32);:next:printbx$:return
  125.