home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Commodore Disk User Volume 3 #7
/
Commodore_Disk_User_Vol.3_7_1990_-.d64
/
pointers
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
5KB
|
184 lines
5 ifz%=0thenz%=1:poke631,32:poke198,1:load"p.code",8,1
10 rem *** preferences program
20 rem *** to demonstrate use of
30 rem *** pointer code.
40 rem *** by william phillips 1988.
50 :
60 gosub5010
70 gosub5220
80 gosub5180
90 gosub5260
95 ifpeek(49886)>0then90
100 x%=peek(49872)+256*(peek(49873)and1)
110 ifx%>25andx%<162then150
120 ifx%>164andx%<259then550
130 ifx%>260andx%<341thensys49274:printchr$(147):end
140 goto90
150 m%=0:gosub5320
160 poke684,7:poke679,1
170 gosub5260:ifpeek(710)=0then170
180 gosub5470
190 y%=s%-4
200 ony%goto210,250,290,330,390,540
210 m%=7:gosub5320
220 a%=peek(49413)
230 x%=7:y%=19:l%=31:n%=19:gosub5560
240 poke49413,a%:goto90
250 m%=12:gosub5320
260 a%=peek(49408)
270 x%=8:y%=23:l%=7:n%=1:gosub5560
280 poke49408,a%:goto90
290 m%=17:gosub5320
300 a%=peek(49396)
310 x%=9:y%=23:l%=7:n%=5:gosub5560
320 poke49396,a%:goto90
330 m%=22:gosub5320
340 poke684,3:poke679,1
350 gosub5260:ifpeek(710)=0then350
360 gosub5470:gosub5520
370 dc%=s%-12:ifdc%=3then540
380 dv%=dc%:ifdv%=2then80
385 dv%=1-dv%:goto80
390 m%=27:gosub5320
400 poke684,14:poke679,1
410 gosub5260:ifpeek(710)=0then410
420 gosub5470
430 g%=s%-13:ifg%=3then540
440 l%=0:ifg%=2thenl%=1
450 x%=14+g%:gosub5680
460 gosub5260
470 y%=peek(49886)
480 ify%<(x%+1)ory%>(x%+2)thengoto460
490 y%=peek(49885)
495 ify%<3ory%>2*(17-l%)thengoto460
500 p%=int((y%-3)/2)+l%
510 ifg%=0thentl%=p%
520 ifg%=1thenpoke49332,p%
530 ifg%=2thenpoke53287,p%
540 gosub5520:goto70
550 m%=32:gosub5320
560 poke781,6:poke782,10:sys58634:printchr$(158)"]"left$(y$,13):poke53269,0
565 t%=peek(49408):t1%=peek(49396):poke49396,0:poke49408,0
570 f$=""
580 poke781,6:poke782,11:sys58634:printf$;" ";chr$(157);:poke204,0
590 geta$:ifa$=chr$(13)then640
600 ifa$=chr$(20)andlen(f$)>0thenpoke204,1:print" "
605 ifa$=chr$(20)andlen(f$)>0thenf$=left$(f$,len(f$)-1):goto580
610 ifa$<" "ora$>"[218]"then590
620 iflen(f$)<13thenf$=f$+a$
630 goto580
640 poke204,1:iff$=""then800
660 m%=35:gosub5320
670 r%=0:geta$:ifa$="[212]"ora$="t"thenr%=1:f$=chr$(5)+chr$(14)+chr$(8)+f$
680 ifa$="[196]"ora$="d"thenr%=8:goto710
690 ifr%=0then670
700 m%=38:gosub5320
705 if(peek(1)and16)=16then705
706 geta$:ifa$=""then705
710 sys49274:savef$,r%,1
720 poke186,r%:poke184,1:poke185,1
740 f$="p.code":fori=1to6:poke53230+i,asc(mid$(f$,i,1)):next
750 poke183,6:poke187,239:poke188,207
760 poke251,0:poke252,192
770 poke781,93:poke782,195
780 poke780,251
790 sys65496:sys65484
800 sys49152
810 poke49408,t%:poke49396,t1%:goto540
3999 end
5000 rem *** initialise
5010 poke679,0:poke710,0:printchr$(147)chr$(14)chr$(8)
5020 poke53280,0:poke53281,0
5030 fori=685to709:pokei,1:next
5040 poke49332,1:poke49413,19
5045 poke49396,5:poke49408,1
5050 poke49872,128:poke49874,128
5060 poke49873,0:poke53287,1
5070 dv%=2:tl%=6
5080 dimc%(15),m$(40)
5090 fori=0to15:readc%(i):next
5100 z$="[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]"
5110 y$=" "
5115 k%=0:fori=0to8
5120 readx%,y%,l%,d%,q%,b%,v%,t$:m$(k%)=chr$(x%)+chr$(y%)+chr$(l%)+chr$(d%)
5130 m$(k%)=m$(k%)+chr$(q%)+chr$(b%)+chr$(v%)+t$:ford=1tod%:readm$(k%+d):next
5140 k%=k%+1+d%:next
5150 poke781,24:poke782,1:poke783,48:poke658,1:sys58634
5155 printchr$(153)"'[208]references' program by [215]. [208]hillips"
5160 sys49152:return
5170 rem *** set device
5180 poke49884,dv%and2
5190 poke49337,dv%and1
5200 return
5210 rem *** print top line
5220 printchr$(19)chr$(c%(tl%))chr$(18)chr$(165)" [208]references [221] [211]torage [221]";
5230 print" [209]uit "chr$(167)chr$(146)
5240 return
5250 rem *** check fire
5260 ifdv%=2then5290
5270 f%=peek(56320+dv%)and16:iff%=16then5270
5280 return
5290 geta$:ifa$<>chr$(13)then5290
5300 return
5310 rem *** print menu
5320 x%=asc(left$(m$(m%),1)):y%=asc(mid$(m$(m%),2,1))
5330 l%=asc(mid$(m$(m%),3,1)):d%=asc(mid$(m$(m%),4,1))
5340 q%=asc(mid$(m$(m%),5,1)):b%=asc(mid$(m$(m%),6,1))
5350 v%=asc(mid$(m$(m%),7,1))
5360 poke781,x%:poke782,0:poke783,48:sys58634
5370 printtab(y%)chr$(b%)"[176]"left$(z$,l%)"[174]"
5380 ifq%=1thenprinttab(y%)"[221]"chr$(30)right$(m$(m%),l%)chr$(b%)"[221]"
5390 ifq%=1thenprinttab(y%)"[171]"left$(z$,l%)"[179]"
5400 fori=1tod%
5410 printtab(y%)"[221]"chr$(v%)m$(m%+i)left$(y$,l%-len(m$(m%+i)))chr$(b%)"[221]":next
5420 printtab(y%)"[173]"left$(z$,l%)"[189]"
5430 poke680,y%+1:poke681,y%+l%
5440 poke682,x%+1+2*q%:poke683,peek(682)+d%-1
5450 return
5460 rem *** flash bar
5470 t%=peek(49408):t1%=peek(49396):poke49396,0:poke49408,0:poke49871,0
5480 fori=0to14:poke679,1-peek(679)
5490 ford=0to18:next
5500 next:s%=peek(49886):poke679,0:poke49408,t%:poke49396,t1%:return
5510 rem *** clear window space
5520 printchr$(19)chr$(17)
5530 fori=0to17:printy$:next
5540 return
5550 rem *** handle accel & veloc
5560 poke684,15
5570 poke679,1:poke781,x%:poke782,y%:sys58634
5580 a$=str$(a%)+" ":printchr$(150)mid$(a$,2,2)
5590 gosub5260:ifpeek(710)=0then5590
5600 gosub5470
5610 p%=s%-(x%+1)
5620 onp%goto5630,5640,5650,5660
5630 a%=a%+1:a%=a%andl%:goto5570
5640 a%=a%-1:a%=a%andl%:goto5570
5650 a%=n%:goto5570
5660 gosub5520:return
5670 rem *** print colour blocks
5680 poke781,x%:poke782,0:sys58634
5690 printtab(2)chr$(158)"[176]"left$(z$,2*(16-l%))"[174]"
5700 printtab(2)"[221]"chr$(18);:fori=l%to15:printchr$(c%(i))" ";:next
5710 printchr$(146)chr$(158)"[221]"
5720 printtab(2)"[221]"chr$(18);:fori=l%to15:printchr$(c%(i))" ";:next
5730 printchr$(146)chr$(158)"[221]"
5740 printtab(2)"[173]"left$(z$,2*(16-l%))"[189]":return
8000 data144,5,28,159,156,30,31,158,129,149,150,151,152,153,154,155
8010 data2,1,16,6,1,154,155," [208]references "
8020 data"[193]cceleration","[201]nitial velocity","[205]aximum velocity","[195]ontrol device"
8025 data"[193]ttributes","[197]xit"
8030 data6,5,15,4,1,158,153,"[193]cceleration "
8040 data"[193]cceleration +1","[193]cceleration -1","[206]ormal accel.","[197]xit"
8050 data7,5,19,4,1,158,153,"[201]nitial [214]elocity "
8060 data"[201]nitial velocity +1","[201]nitial velocity -1","[206]ormal velocity","[197]xit"
8070 data8,5,19,4,1,158,153,"[205]aximum [214]elocity "
8080 data"[205]aximum velocity +1","[205]aximum velocity -1","[206]ormal maximum","[197]xit"
8090 data9,5,14,4,1,158,154,"[195]ontrol [196]evice"
8100 data"[202]oystick 1","[202]oystick 2","[203]eyboard","[197]xit"
8110 data10,5,19,4,1,159,155," [193]ttributes "
8120 data"[212]op line text","[212]op line background","[208]ointer colour","[197]xit"
8130 data2,9,22,2,1,159,154,"[211]ave [208]rogram and [195]ode ","[208]lease enter filename:",""
8140 data6,13,19,2,0,155,154,"","[208]lease enter device","([212])ape or ([196])isk"
8150 data8,15,22,2,0,154,155,"","[211]tart tape,","then press any key"