Page 1 of 2

Using standard joysticks

Posted: Thu Mar 17, 2016 9:23 am
by kevgal
Here's a little circuit to connect standard joysticks to the Creativision. Probably could have done it with a couple of 74XX's but I had a heap of transistors lying around.

Re: Using standard joysticks

Posted: Thu Mar 17, 2016 10:21 am
by kevgal
Here are the keyboard scan codes. Handy for fault finding dodgy controllers.

Re: Using standard joysticks

Posted: Thu Mar 17, 2016 11:30 am
by Scouter3d
I am amazed! congratulations!

Is it possible to build this circiuit "plug and play" without any internal soldering?

Using standard Joysticks one may lose the diagonal movements?... (not sure if the commercial carts check for the respective codes...)
Would need to check on the Laser or Salora...

TOM:0)

Re: Using standard joysticks

Posted: Thu Mar 17, 2016 12:45 pm
by kevgal
Should be able to use this externally, certainly if the start buttons weren't required. This is one advantage of transistors over ICs - no need for VCC.
Can't remember why I soldered straight to pin 12 of the PIA for the start buttons, maybe my multi console setup was loading the circuit? Too much drop with forward bias?
The circuit I use actually has a few more components so I could accomodate that damned tank game!
Diagonals should be no different, seems to work okay with planet defender, don't think any of the other games use diagonal?

Re: Using standard joysticks

Posted: Thu Mar 17, 2016 1:15 pm
by kevgal
Here it is in circuit

Re: Using standard joysticks

Posted: Thu Mar 17, 2016 10:22 pm
by kevgal
My circuit is only needed for a ground 'common' connection for multiple joysticks and buttons. If you want to connect a 1 fire button joystick you can wire directly without any circuit. Second fire button requires a second separate 'common' line and letters would need a 2 pole push button. The scan codes PDF posted previously shows which pins are connected for various letters.
Eg left controller:
Common - pin 2
Up - pin 6
Down - pin 4
Left - pin 10
Right - pin 5
Right button - pin 8
Left button - Common pin 1 and button pin 8

Re: Using standard joysticks

Posted: Mon Mar 21, 2016 11:56 am
by carlsson
Creativision joysticks though have 16 directions: Up, Up-Up-Left, Up-Left, Up-Left-Left, Left, Down-Left-Left, Down-Left, Down-Down-Left, Down etc. When converting an Atari style joystick, games that only use the "regular" 8 directions will work.

Re: Using standard joysticks

Posted: Mon Mar 21, 2016 10:16 pm
by @username@
Which games use 16 positions? The joy function in CV basic can only see the standard 8, so would be interesting to look at the 16 position code.

Re: Using standard joysticks

Posted: Tue Mar 22, 2016 11:32 am
by carlsson
Mobsie wrote that his Color Maze uses all directions, for improved diagonal movement.

As far as I understood, there are two sets of values to read:

$11 and $13 = Values $40 - $4F representing each of the 16 directions on respective joysticks
$18 and $1A = Values $02, $04, $08, $20 represent down, right, up, left and can be combined into 8 directions

Also the keyboard is decoded twice, first at $12 and $14 (excluding columns 1 and 7), then at $19 and $1B (entirely combined with $18 and $1A). Same about the fire buttons, decoded at $15 or $16-$17. Exactly which of these addresses the BASIC uses, I can't recall. There may be additional ways to read the joysticks too, if not relying on the BIOS to decode input into zeropage locations. I haven't disassembled any of the existing games to find out how they do it.

Re: Using standard joysticks

Posted: Tue Mar 22, 2016 5:36 pm
by @username@
OK - I think I see the confusion.

The low bit of bytes $11 and $13 should be discarded.

The read functions do the following

Code: Select all

ROM:AB2F loc_AB2F:                               ; CODE XREF: sub_BDC3-12A4j
ROM:AB2F                 LDA     $11
ROM:AB31
ROM:AB31 loc_AB31:                               ; CODE XREF: sub_BDC3-1284j
ROM:AB31                 BEQ     loc_AB46
ROM:AB33                 AND     #$F
ROM:AB35                 LSR     A
ROM:AB36                 STA     $2D
ROM:AB38                 INC     $2D
ROM:AB3A                 JMP     loc_AB48
ROM:AB3D ; ---------------------------------------------------------------------------
ROM:AB3D
ROM:AB3D loc_AB3D:                               ; CODE XREF: sub_BDC3-12A1j
ROM:AB3D                 LDA     $13
ROM:AB3F                 JMP     loc_AB31
This is simply, and off the lower nibble - shift it right 1 (so only 3 significant bits) then increment for BASIC.

So direction is only 3 bits, which in my book == 8 positions.