Jump to content
IGNORED

How do I read input from controllers?


Recommended Posts

So I have a reference on the 2600's specs and I found these here. Are they for reading input from the controller? If so, how do I read it? If not, what do I use to read the input?

 

 

38 INPT0 1....... read pot port

39 INPT1 1....... read pot port
3A INPT2 1....... read pot port
3B INPT3 1....... read pot port
3C INPT4 1....... read input
3D INPT5 1....... read input

 

Thank you for reading this far.

Link to comment
Share on other sites

If you haven't already, get the Stella Programmer's Guide" here. That's the official programming guide for the 2600.


The answer to your question depends on what controller you're trying to read (joystick, paddle, driving, trackball, keypad...).

For joystick, which is the most common case, the firebuttons are read from TIA registers INPT4 (left port) and INPT5 (right port).
Only bit 7 is used (bit7="0"-> button pressed; bit7="1"-> button released).

Joystick directions are read from RIOT register SWCHA. Bits 7 to 4 are for left port, bits 3 to 0 for the right one. See section 5.3 in the Stella guide.

Check the Collect tutorial to see example code. Each step include a fully commented source.
http://atariage.com/forums/blog/148/entry-13884-collect-tutorial-index/

Edited by alex_79
  • Like 1
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...