home *** CD-ROM | disk | FTP | other *** search
- 5 rem *** demo program for mr joystick ***
- 10 sys57812"mrj49152",8,1:sys62631
- 20 sys49152,"abcdefghij"
- 100 gosub3000
- 110 print"this program starts with the line:":printchr$(142)""
- 120 print"10 poke147,0:sys57812";chr$(34);"mrj49152";chr$(34);","
- 130 print"8,1:sys62631":print
- 140 print"this loads mr joystick. the program"
- 150 print"is activated by the line:":print
- 160 print"20 sys49152,";chr$(34);"abcdefghij";chr$(34):print
- 170 print"insert the joystick into either port"
- 180 print"and experiment by moving the joystick"
- 190 print"and pressing the fire button":print
- 200 print"...then try the other port!"
- 210 gosub2000:gosub3000
- 220 print"the first 5 characters of the string"
- 230 print"passed to mr joystick indicate"
- 240 print"which characters to use for port 1,"
- 250 print"while the second 5 are the return"
- 260 print"characters for port 2. (if only"
- 270 print"5 characters are given, they are"
- 280 print"used for both ports.)":print
- 290 print"the first character of each group is"
- 300 print"the return value for the fire button."
- 310 print"the remaining characters, in order,"
- 320 print"are the return values for up, down,"
- 330 print"left, and right."
- 340 gosub2000:gosub3000
- 350 sys49152,"f"+chr$(145)+chr$(17)+chr$(157)+chr$(29)
- 360 print"we can change these return values by"
- 370 print"a second sys to 49152:":print
- 380 print"sys49152,";chr$(34);"f";chr$(34);"+chr$(145)+chr$(17)+"
- 390 print"chr$(157)+chr$(29)":print
- 400 print"with these values, both joysticks act"
- 410 print"like the cursor keys (the fire"
- 420 print"buttons return 'f')."
- 430 gosub2000:gosub3000
- 440 print"you may have noticed that only one"
- 450 print"character is generated, no matter how"
- 460 print"long you keep the joystick in one"
- 470 print"direction. by default, mr joystick"
- 480 print"will not auto-repeat. however, by"
- 490 print"passing additional parameters after"
- 500 print"the string, auto-repeat will be"
- 510 print"enabled. the first number gives the"
- 520 print"number of jiffies before the fire"
- 530 print"button should repeat, the second"
- 540 print"gives the repeat rate. the third and"
- 550 print"fourth numbers (if present), give the"
- 560 print"delay and repeat rates for the"
- 570 print"direction characters (i.e. 'up')."
- 580 print"we have now recalled 49152 as follows":print
- 590 print"sys49152,";chr$(34);"fudlr";chr$(34);",10,4,20,5"
- 600 sys49152,"fudlr",10,4,20,5:gosub2000:gosub3000:sys49155
- 610 print"[154](s[154])ee demo again"
- 620 print"(r[154])eturn to loadstar"
- 630 geta$:ifa$<>"s"anda$<>"r"then630
- 640 ifa$="s"then20
- 650 goto60000
- 2000 rem *** run keyboard ***
- 2010 print"[154][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][192][192][174] [158]press[154]"
- 2020 print"[221][155]abcdefghijklmnopqrstuvwxyz[154][221] [158][return][154]"
- 2030 print"[221][155] 0123456789 up dn lf rt [154][221] [158]to[154]"
- 2040 print"[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][192][192][189] [158]continue[154]"
- 2050 geta$:ifa$=""then2050
- 2060 a=asc(a$):ifa>64anda<91thenl=55272+a:r=l:goto2140
- 2070 ifa>47anda<58thenl=55331+a:r=l:goto2140
- 2080 ifa=17thenl=55393:r=l+1:goto2140
- 2090 ifa=29thenl=55399:r=l+1:goto2140
- 2100 ifa=145thenl=55390:r=l+1:goto2140
- 2110 ifa=157thenl=55396:r=l+1:goto2140
- 2120 ifa=13thenreturn
- 2130 goto2050
- 2140 pokel,1:poker,1:fori=0to100:next:pokel,15:poker,15:goto2050
- 3000 rem *** draw frame ***
- 3010 poke53280,0:poke53281,0
- 3020 print"[147][150][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][201]"
- 3030 fori=6to24:print"[221] [221]":next
- 3040 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]";:return
- 10000 open15,8,15,"s0:bits":close15:save"bits",8:end
- 60000 a$="hello connect":open15,8,15,"r0:"+a$+"="+a$:input#15,er:close15
- 60010 if er<>63 then print"[147]":end
- 60011 q$=chr$(34):print"[147]":poke646,peek(53281)
- 60020 print"load"q$a$q$",8"
- 60030 poke631,13:poke632,82:poke633,213:poke634,58:poke635,13:poke198,5:end
-