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