Jump to content
Moonbeam

Atari 7800 (and 2600) joystick port question

Recommended Posts

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

 

Yeah, but how many cycles would it take to read the joystick?

STX SWCHA # 4 set clock pin high
LDA SWCHA # 4 read data pin
ROL       # 2 shift bit 7 to carry (ROR for player 2)
STY SWCHA # 4 set clock pin low
ROR JOY1  # 5 shift C into ZP register

So that's 19 cycles for one bit, or 158 cycles (and 104 bytes) for all 8 bits. (Adding 4 cycles to set up X & Y and 6 cycles to send the LATCH, but making the first ROL into a STA.) Actually, that's not too bad.

Edited by EricBall

Share this post


Link to post
Share on other sites

Why isn't RevEng's post #6

http://atariage.com/forums/topic/228835-atari-7800-and-2600-joystick-port-question/?p=3055063

the end of this topic?

 

He shows with an abundantly available 3 button Genesis pad, 2 swapped pins, and a 10K resistor, the Atari 7800 and 2600 can read a joystick, including diagonals, with 4 buttons (button A, B, C, and Select).

Then you don't need a matrix and all the processor time to read it.

Share this post


Link to post
Share on other sites

Why isn't RevEng's post #6

http://atariage.com/forums/topic/228835-atari-7800-and-2600-joystick-port-question/?p=3055063

the end of this topic?

 

He shows with an abundantly available 3 button Genesis pad, 2 swapped pins, and a 10K resistor, the Atari 7800 and 2600 can read a joystick, including diagonals, with 4 buttons (button A, B, C, and Select).

Then you don't need a matrix and all the processor time to read it.

 

Perhaps it was not the end of the topic because even if it is an excellent solution, depending on what you want to do, another one may be preferred :-)

I'm very glad I've had all your posts, ideas and help. I have learnt some very interesting stuff. Thanks to all of you !

Share this post


Link to post
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.

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...