Jump to content
IGNORED

Atari 7800 (and 2600) joystick port question


Moonbeam

Recommended Posts

Hi,

 

Let's imagine a game which for some reason would need a joystick with 4 directions and 4 fire buttons.

 

I'm not sure but I think I understand that only 4 directions and only 2 fire buttons could be managed by one joystick port with an Atari 2600. Not 3 and not 4 buttons, right?

I know I did not try to get some information with Atari 7800 hardware features yet, but would it be possible with the Atari 7800?

 

Thanks in advance for your replies.

Link to comment
Share on other sites

With one Atari port, the 2 paddles could be an analog joystick, and up down left and right can be four buttons, just like the Vectrex controller. With using the fire button that would be five buttons.

A 2600 game would spend a lot of time reading both paddles for joystick coordinates (that's why the Vectrex only uses analog stick control on a few games).

You would have to have a very good game to sell a custom stick, even a game with an adapter to use the Vectrex stick, the Vectrex stick is quite uncommon and expensive.

Link to comment
Share on other sites

With one Atari port, the 2 paddles could be an analog joystick, and up down left and right can be four buttons, just like the Vectrex controller. With using the fire button that would be five buttons.

A 2600 game would spend a lot of time reading both paddles for joystick coordinates (that's why the Vectrex only uses analog stick control on a few games).

You would have to have a very good game to sell a custom stick, even a game with an adapter to use the Vectrex stick, the Vectrex stick is quite uncommon and expensive.

 

I don't really understand... My question is about digital directions and buttons.

Link to comment
Share on other sites

And is there a way to get the significative information from the joystick port (4 directions + 4 buttons) with batari BASIC and 7800basic (without writing assemby code)?

 

You could start with my 2 button bB code. Using the code there as-is will let you read the first set of buttons. To read the alternate 2 buttons, you'd issue the bB statement "VBLANK=$82", read the buttons just like you did the first time around, and then issue "VBLANK=0".

 

There is likely some extra finessing required for all of this under 7800basic, as it sets up the ports for 7800 2-button joysticks. This would need to be skipped or undone.

Link to comment
Share on other sites

I think I answered your first post quite clearly. I even showed a way to get 5 buttons.

 

 

Oh sorry... I had to take some time to make an understanding effort. I looked at paddles pinout and Atari 2600 motherboard schematics. And I found out you already talked about this here: http://atariage.com/forums/topic/226294-analog-stick-4-buttons/.
So, that's clearer for me now. What I understand is that the joystick port pins 5 and 9 were in fact originally planned for an analogue purpose. So what you say is that getting the information from the TIA analogue inputs (to convert it into a digital information) takes a lot of time, right? And I guess this would need the use of resistors inside the joystick, right?
But I don't see exatly how to convert the analogue information into 3 digital information (for instance: right, left, neither left nor right).
The matrix could be a good idea, if considering the buttons are not pressed simultaneously...
Edited by Moonbeam
Link to comment
Share on other sites

The Atari 2600/7800 joystick port has 9 pins

4 connected to the 6532 RIOT - used for joystick switches (note: these can be inputs or outputs)

2 "analog" inputs connected to the TIA - used for the paddle

1 "digital" input connected to the TIA - used for the joystick button

(Note: The 2600 and 7800 are identical from a joystick port perspective - the ports are connected RIOT & TIA.)

 

The analog inputs work on a charge / discharge system. During VBLANK the program sets the pins to charge mode, then the program counts the number of lines during the active screen it takes for the pins to discharge. So while these inputs could be used to detect multiple buttons using different resistance values, it requires some kernel time to do so. However, there could be calibration issues as I don't know if the resistance to number of lines is consistent for everyone.

 

A better alternative might be to use a variation of the keypad matrix (see http://atariage.com/2600/archives/schematics/Schematic_2600_Accessories_Low.html ). This uses the 4 RIOT pins in a row & column matrix. The big advantage of going this route is keypad support is already built into emulators. You might want / need to add some diodes (along with an intelligent mapping) like they do for a keyboard matrix to limit ghosting.

 

Or, if it's a one player game, use both joystick ports and just the RIOT pins.

Edited by EricBall
Link to comment
Share on other sites

A better alternative might be to use a variation of the keypad matrix (see http://atariage.com/2600/archives/schematics/Schematic_2600_Accessories_Low.html ). This uses the 4 RIOT pins in a row & column matrix. The big advantage of going this route is keypad support is already built into emulators. You might want / need to add some diodes (along with an intelligent mapping) like they do for a keyboard matrix to limit ghosting.

 

Or, if it's a one player game, use both joystick ports and just the RIOT pins.

 

Thanks for your post. As I wrote before, the matrix is smart... if there is no need to press 2 or more buttons /directions simultaneously. So I can't plan the use of a matrix...

Edited by Moonbeam
Link to comment
Share on other sites

With diodes, the ghosting problem can be reduced / eliminated : http://pcbheaven.com/wikipages/How_Key_Matrices_Works/

 

Oh sure ! I didn't know the matrix with diodes... Actually I knew it... in the Colecovision controller! But untill now I did not know why these diodes were there... :-)

 

Thanks a lot for the link!

 

So, let's say I can now manage 6 digital inputs with 5 wires. So that the code would know what to do, all the combinations would have to be tested, that is to say 2^5 = 32. Would not that represent quite a long time to be processed (with "if... then conditions"), even for the Atari 7800?

Edited by Moonbeam
Link to comment
Share on other sites

You would configure the 6 switches as a 2x3 matrix, with one side of the matrix connected to the RIOT pins so they can be used as outputs. See "A matrix in the real life" on the webpage. The other side is connected to the other pins. You then strobe each output pin and read the input pins. For the if/then you would use the AND or BIT operators to test whether the input pin is high or low and act appropriately.

Link to comment
Share on other sites

You would configure the 6 switches as a 2x3 matrix, with one side of the matrix connected to the RIOT pins so they can be used as outputs. See "A matrix in the real life" on the webpage. The other side is connected to the other pins. You then strobe each output pin and read the input pins. For the if/then you would use the AND or BIT operators to test whether the input pin is high or low and act appropriately.

That is quite brilliant, as is using all 8 RIOT pins in both ports for a one player only game.

But your 2x3 matrix only gives 6 switches, right? So wouldn't that be the same as a Genesis controller stick and reading its 2 buttons? Up, down, left & right and diagonals and two buttons already there in the Genesis pad, or can your 2x3 matrix do joystick and 4 buttons like the original post requests?

Link to comment
Share on other sites

But your 2x3 matrix only gives 6 switches, right? So wouldn't that be the same as a Genesis controller stick and reading its 2 buttons? Up, down, left & right and diagonals and two buttons already there in the Genesis pad, or can your 2x3 matrix do joystick and 4 buttons like the original post requests?

 

Right, this enables no more than 4 directions and 2 buttons to be managed. Nothing more than the 4 directions and 2 buttons that some other solutions can supply (like the Genesis pad, for instance). For 2 more buttons, the 2 original Atari 7800 buttons can be used (with the corresponding circuitry).

Link to comment
Share on other sites

If you really want to roll your own, then you can take a queue from NES/SNES controllers and use shift registers. A single 8-bit register will get you 8 inputs, or you could use 2 in parallel for 16 inputs, or go whole hog and chain as a bunch serially so you can use a Sinistar 49-direction joystick and 32 buttons! :P

Link to comment
Share on other sites

That is quite brilliant, as is using all 8 RIOT pins in both ports for a one player only game.

But your 2x3 matrix only gives 6 switches, right? So wouldn't that be the same as a Genesis controller stick and reading its 2 buttons? Up, down, left & right and diagonals and two buttons already there in the Genesis pad, or can your 2x3 matrix do joystick and 4 buttons like the original post requests?

 

 

 

Right, this enables no more than 4 directions and 2 buttons to be managed. Nothing more than the 4 directions and 2 buttons that some other solutions can supply (like the Genesis pad, for instance). For 2 more buttons, the 2 original Atari 7800 buttons can be used (with the corresponding circuitry).

 

Right, and in a 7800 (which has additional internal circuitry I'd forgotten about) it would be better for a 4-way + 2-button joystick to mimic the 7800 joystick rather than some 2x3 matrix. See http://atariage.com/forums/topic/212043-atari-7800-arcade-style-joysticks/#entry2774182 for a good summary of how the 7800 joystick works.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...