home *** CD-ROM | disk | FTP | other *** search
- 10 rem keyboard and joystick driver demo
- 20 rem initialize variables
- 30 poke53280,0:poke53281,0:printchr$(147)chr$(14)chr$(8)
- 40 v=53248:speed=2
- 50 printtab(11)"[159][205]ousing [193]round [215]ith"
- 60 printtab(10)"[203]eyboard [193]nd [202]oystick"
- 70 cr$=""
- 80 dimm$(4):fori=1to4:readm$(i):next
- 90 data " [211]elect [202]oystick [196]river "
- 100 data " [211]elect [203]eyboard [196]river "
- 110 data " [211]prite [196]emo "
- 120 data " [210]eturn to [204]oadstar "
- 130 rem load sprite pointer definition
- 140 sa=832:hi=int(sa/256):lo=sa-hi*256
- 150 sys57812"mouse.spr",8,0
- 160 poke780,0:poke781,lo:poke782,hi:sys65493
- 170 sa=12288:hi=int(sa/256):lo=sa-hi*256
- 180 sys57812"demo.spr",8,0
- 190 poke780,0:poke781,lo:poke782,hi:sys65493
- 200 rem select input device
- 210 print""tab(6)"[208]lease select input device:"
- 220 printtab(14)"1] [202]oystick
- 230 [153][163]14)"2] (NULL)eyboard
- 240 getk$:ifk$=""then240
- 250 k=val(k$):ifk<>1andk<>2then240
- 260 dv=k
- 270 ifk=1then360
- 280 rem load keyboard driver
- 290 r=15:gosub1140
- 300 poke147,0:sys57812"key driver 64",8,1:sys62631:poke49175,speed
- 310 printtab(5)"[156][203]eyboard driver installed."
- 320 printtab(5)"[208]ress [210][197][212][213][210][206] to continue with demo."
- 330 getk$:ifk$<>chr$(13)then330
- 340 goto430
- 350 rem load joystick driver
- 360 r=15:gosub1190
- 370 poke147,0:sys57812"joy driver 64",8,1:sys62631:poke49175,speed
- 380 printtab(5)"[156][202]oystick driver installed."
- 390 printtab(5)"[208]ress [198][201][210][197] to continue with demo."
- 400 if(peek(56320)and31)<>15then400
- 410 :
- 420 rem menu demo
- 430 print"[147]":printtab(15)"[159][205]enu [196]emo"
- 440 rem set up pointer sprite
- 450 pokev,50:pokev+16,0:pokev+1,100
- 460 pokev+39,1
- 470 poke2040,832/64
- 480 pokev+21,1
- 490 sys49155:rem activate driver
- 500 print""tab(7)"[176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174]"
- 510 fori=1to4:printtab(7)"[221]";m$(i);"[146][221]":next
- 520 printtab(7)"[173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][189]"
- 530 r=15:ondvgosub1190,1140
- 540 y1=7
- 550 rem check pointer location
- 560 getk$
- 570 x=int((peek(v)+(peek(v+16)and1)*256-24)/8)
- 580 y=int((peek(v+1)-50)/8)
- 590 ifx<8orx>31thenprintleft$(cr$,y1+1)tab(8)"[159]"m$(y1-5):goto560
- 600 ify<6ory>9thenprintleft$(cr$,y1+1)tab(8)"[159]"m$(y1-5):goto560
- 610 ify1<>ythenprintleft$(cr$,y1+1)tab(8)"[159]"m$(y1-5)
- 620 printleft$(cr$,y+1)tab(8)"[156]"m$(y-5):y1=y
- 630 ifdv=1thenif(peek(56320)and31)<>15then560
- 640 ifdv=2thenifk$<>chr$(13)then560
- 650 ony-5goto680,750,820,1020
- 660 :
- 670 rem load joystick driver
- 680 sys49158
- 690 poke147,0:sys57812"joy driver 64",8,1:sys62631:poke49175,speed
- 700 sys49155
- 710 r=15:gosub1190:dv=1
- 720 goto560
- 730 :
- 740 rem load keyboard driver
- 750 sys49158
- 760 poke147,0:sys57812"key driver 64",8,1:sys62631:poke49175,speed
- 770 sys49155
- 780 r=15:gosub1140:dv=2
- 790 goto560
- 800 :
- 810 rem sprite demo
- 820 print"[147]":printtab(15)"[211]prite [196]emo"
- 830 fori=0to3:poke2041+i,192+i:next
- 840 fori=0to3:pokev+40+i,i+2:next
- 850 pokev+16,0
- 860 fori=2to8step2:pokev+i,100+i*15:next
- 870 fori=3to9step2:pokev+i,150:next
- 880 pokev+21,31:r=20:ondvgosub1190,1140
- 890 sp=0
- 900 rem check for sprite collision
- 910 getk$:ifk$=chr$(13)then930
- 920 if(peek(56320)and31)<>15thenx=peek(v+30):goto890
- 930 x=peek(v+30)-1
- 940 ifx>0thensp=log(x)/log(2)
- 950 ifsp=0then910
- 960 ifsp=4then430
- 970 co=peek(v+39+sp)+1:ifco>255thenco=1
- 980 pokev+39+sp,co
- 990 goto890
- 1000 :
- 1010 rem return to loadstar
- 1020 printleft$(cr$,20)tab(10)"[193]re you sure? [y/n]"
- 1025 sys49158:rem turn off driver
- 1030 getk$:ifk$=""then1030
- 1040 ifk$="y"then1050
- 1045 printleft$(cr$,20)tab(10)" ":sys49155:goto560
- 1050 pokev+21,0:rem turn off sprites
- 1060 sys49158:rem turn off driver
- 1070 open15,8,15,"r0:hello connect=hello connect"
- 1080 input#15,er%:close15
- 1090 ifer%<>63thenprint"[147]":end
- 1100 poke646,peek(53281):print"[147]load"chr$(34)"hello connect"chr$(34)",8"
- 1110 print"run"
- 1120 poke631,13:poke632,13:poke633,13:poke198,3:end
- 1130 :
- 1140 printleft$(cr$,r);
- 1150 printtab(5)"[158][213]se cursor keys to move pointer"
- 1160 printtab(5)"and [210][197][212][213][210][206] to make your choice."
- 1170 return
- 1180 :
- 1190 printleft$(cr$,r);
- 1200 printtab(5)"[158][213]se joystick to move pointer. "
- 1210 printtab(5)"[208]ress [198][201][210][197] to make your choice."
- 1220 return
- 1230 :
- 1240 open15,8,15,"s0:mouse demo":close15:save"mouse demo",8
-