home *** CD-ROM | disk | FTP | other *** search
- /* JoyTest.rexx - Weird ide By Thomas Beck - Optimized by PMK - FREEWARE 8)
- No docs, just a test prg. for ya' joystick(s), run as arexx door from CNET!
- ===============================================================================*/
- options results;signal on error;signal on syntax;signal on ioerr
-
- transmit "f1 JOYTESTn1 .-----.n1 | |n1 | |n1 | |n1 `-----'n1 Press any keyn1 to quit"
-
- do forever
- a=joy(1)
- select
- when a=0 then sendstring "f0n2>5 n1>5 n1>5 "
- when a=8 then sendstring "f0n2>5 | n1>5 n1>5 "
- when a=2 then sendstring "f0n2>5 n1>5 n1>5 | "
- when a=4 then sendstring "f0n2>5 n1>5- n1>5 "
- when a=6 then sendstring "f0n2>5 n1>5 -n1>5 "
- when a=7 then sendstring "f0n2>5\ n1>5 n1>5 "
- when a=9 then sendstring "f0n2>5 /n1>5 n1>5 "
- when a=1 then sendstring "f0n2>5 n1>5 n1>5/ "
- when a=3 then sendstring "f0n2>5 n1>5 n1>5 \"
- when a=10 then sendstring "f0n2>5 n1>5 * n1>5 "
- when a=18 then sendstring "f0n2>5 | n1>5 * n1>5 "
- when a=12 then sendstring "f0n2>5 n1>5 * n1>5 | "
- when a=14 then sendstring "f0n2>5 n1>5- * n1>5 "
- when a=16 then sendstring "f0n2>5 n1>5 * -n1>5 "
- when a=17 then sendstring "f0n2>5\ n1>5 * n1>5 "
- when a=19 then sendstring "f0n2>5 /n1>5 * n1>5 "
- when a=11 then sendstring "f0n2>5 n1>5 * n1>5/ "
- when a=13 then sendstring "f0n2>5 n1>5 * n1>5 \"
- end
- maygetchar;if result~='NOCHAR' then do;transmit "f1";exit;end
- end
-
- /* JOY - Check JoyStick & fire button
- usage: a=joy(<joynum>) 0=Port1. 1=Port2.
- returns: keypad values for directions, 0 if none, +10 if fire pressed */
-
- JOY: procedure;arg w;a=import(d2c(14675978+w*2,4),2);b=~bittst(import('00BF E001'x,1),6+w)*10
- return x2d(translate(c2x(b2c(bittst(a,8)bittst(a,9)bittst(a,0)bittst(a,1))),'963147','B31EC4'))+b
-
- SYNTAX:;ERROR:;IOERR:
- transmit 'Error Code 'rc' ('errortext(rc)') in line 'sigl;bufferflush;exit
-