I've been working on Cylon Attack for 4051, 4052 and 4054 computers with R12 Graphics Enhancement ROM or vintagetek.org MAXIROM with Fast Graphics ROM or
@jdreesen 4052/4054 Multifunction ROM Pack with R12.
I have it working with my Flash Drive Vectrex joystick interface and just added the Tektronix 4952 Joystick support. The 4952 manual on
bitsavers.org does NOT describe the expected output from BASIC of the 4952, although the Electrical Characteristics Table 2-1 indicates 1024 units of addressable information per axis.
I experimented with the R12 CALL "JGIN",M,X,Y,A$ function using my Tek 4952 joystick with the following test code where T$ is the R12 targeting circle object and M=10 msec in the CALL "JGIN" command. CALL "JGIN" will return to the BASIC program after 10 msec with the joystick X and Y values and A$="" or if a key is pressed before 10 msec has elapsed the key pressed will be returned in A$.
1390 PAGE
1400 CALL "RDRAW",T$,1,0,0
1410 CALL "JGIN",10,X,Y,A$
1420 PRINT X,Y,A$
1430 GO TO 1410
I found the following X and Y approximate values at these joystick positions:
X=65, Y=50 for joystick centered
X=35, Y=50 for joystick full left
X=95, Y=50 for joystick full right
X=65, Y=75 for joystick full up
X=65, Y=25 for joystick full down
My Flash Drive Vectrex code emulates the Vectrex joystick output values which are centered at 0,0 are negative for left and down and positive for up and right and returned as a single signed byte on Vectrex. Since Tek 4050 BASIC does not support integers, I return the X and Y values as numeric with no fractions up to +/-300 as that was the range of values returned by the Arduino after I "centered" the outputs. My game program converts the 4952 joystick values from absolute position to relative position and scales them to match my Vectrex joystick outputs with these two BASIC statements:
1000 REM CONVERT 4952 ABS X/Y TO RELATIVE
1010 P=(P-65)*10
1020 Q=(Q-50)*12
My Cylon Attack game for the 4050 computers with Fast Graphics or R12 Enhanced Graphics ROMs allows you to select whether you have a 4952 Joystick or Flash Drive with Vectrex joystick.
Here is a screenshot from the 405x Emulator - although it does not (yet) have 4952 or Flash Drive Vectrex joystick support (hint, hint
@WaveyDipole ).
In the screenshot below you can see that I fired the lasers at the center target - but missed the Cylon.
I sped up the drawing of the targeting circles by creating a single R12 object for them that displays them in a fraction of a second on the 405x emulator - which should be the same speed as on the 4051. All the R12 objects are in a single BINARY File - loaded in less than a second on the 405x emulator and my 4052. Now I need to update my 4054A program to use that targeting object!
I have also attached Cylon Attack R12 to this post - in Flash Drive format.