Jump to content

Atari VCS Controllers Backward Compatible to 2600


flickertail

716 views

It's nice that Atari made its VCS Classic and Modern game controllers backwards compatible all the way back to the 2600 and 7800 systems.

 

Got it working! There were a number of various problems:

  • bad 9 pin cable
  • power issues (not fully resolved)
  • realized that my analysis of USB data packets was wrong.
  • my poorly written C code for the Rpi Pico

 

Here is the USB adapter in action:

 

So my biggest problem was that I had done the USB data packet analysis completely on the Rpi Pico.

 

I was using the PS4 Dual Shock "TU_ATTR_PACKED" struct to receive the data packets, which apparently is somewhat close to they USB packets for the Xbox 360 controller. I thought I was analyzing the Classic Atari packets, but what I was really analyzing was the Xbox 360 USB data packets. In other words, I thought I had the Classic controller Atari mode, but in actuality it was in Xbox 360 mode.

 

(Beware -- I'm not going to use proper USB terminology)

This is a problem as the Atari Classic controller mode has USB packets with a data payload of 5 bytes versus the Xbox 360 USB packets with a data payload 20 bytes.

 

So once I started using a 5 byte "TU_ATTR_PACKED" struct for the controller's incoming data, while using the controller in the Atari Classic mode, I was at least getting the actual button press info from the controller.

 

I'm sure this is information that other people probably know, but I'm going to share what I learned today (refer to the attached Wireshark readout). Take everything I say below with a grain of salt. 50% of what I'm about to write is probably wrong... much like my last blog post.

  • Byte 0 - referred to box A in the image... I think is some kind of packet overhead... I'm not sure what... probably has a similar use to the first two bytes of the Xbox 360 packet.
  • Byte 1 - boxes B and C in the image
    • The left four bits (designated as Box B), in all of my tests, have always had a value of 0. If it is used for anything, I don't know what it is.
    • The right four bits (designated as Box C) contains the fire button information
      • 0000 - no fire buttons are pressed
      • 0001 - only thumb button is pressed 
      • 0010 - only side button is pressed
      • 0011 - both thumb and side buttons are pressed
  • Byte 2 - boxes D and E in the image
    • The left four bits (designated as Box D) contains the joystick directional information.
      • 0x10-N, 0x20-NE, 0x30-E, 0x40-SE, 0x50-S, 0x60-SW, 0x70-W, 0x80-NW
    • The right four bits (designated as Box E) contains the controller's function button info
      • 0001 - only "Back" button is pressed
      • 0010 - only "Hamburger" (Ham) button is pressed
      • 0011 - both Back and Ham are pressed
        • Holding Back and Ham for several seconds causes controller to switch between Atari and Xbox configurations
      • 0100 - Atari button
        • Although I didn't test for it, I would imagine that 0101, 0110, and 0111 are valid input if multiples of these buttons are pressed
  • Byte 4 - box F
    • All 8 bits of this byte provide 256 steps (0-255) of a 90 degree rotation
    • The value increases as you rotate the pole clockwise
    • a step, in theory, is thus 1/512th of a radian
  • Byte 5 - boxes G and H
    • The left four bits (designated as Box G), in all of my tests, have always had a value of 0. If it is used for anything, I don't know what it is.
    • The right four bits (Box H) indicates the quadrant value, that is - which quadrant of a full circle is currently serving as the base of 90 degree rotation discussed above
      • The value increases as you rotate the pole clockwise
      • The rotation value resets to 0 as you increment to a higher quadrant
      • The rotation value resets to 255 as you decrement to a lower quadrant 
      • The quadrant resets to 0 if the value increments above 3
      • The quadrant resets to 3 if the value decrements below 0

Power Issues

I had various power problems, which were exaggerated by a bad 9pin cable. My best result so far has come from powering the Pico directly from the left controller port's Pin 7. This also powers the ADG715 chip (the digital switches) and apparently the USB controller itself.

 

This appear to be a bit much for my 7800. Some games either don't play or aren't fully functional.

 

The breadboard configuration is designed to emulate a 7800 controller... so in theory, this design should work with all 2600 joystick games and all 7800 games. The Classic controller thumb button was mapped to the Pin 6/8/9 combination (using the appropriate resistor), the side button was mapped to Pin 5/6/8 with resistor.

 

The following 2600 games were tested:

  • Space Invaders - Port didn't recognize Classic controller input at first, but after some tweaking with the breadboard connections
    • Joystick and Thumb button worked
    • Side button did not
  • River Raid - Classic Controller was immediately recognized (across multiple power on/off's)
    • Joystick worked perfectly
    • Thumb button worked perfectly
    • Side button worked perfectly
  • Asteroids - Classic Controller was immediately recognized
    • Joystick worked perfectly
    • Thumb button worked perfectly
    • Side button worked perfectly
  • Frogger - Classic Controller was immediately recognized
    • Joystick worked perfectly
    • Fire buttons - well, it's Frogger, so not applicable
  • Starmaster - Classic Controller was immediately recognized
    • Joystick worked perfectly
    • Thumb button worked perfectly
    • Side button did not work

The following 7800 games were tested:

  • Xenophobe - Classic Controller was not immediate recognized
    • Game had a tendency to start without any input from user
    • Game didn't recognize controller input if joystick was plugged in when 7800 was turned on
    • If Classic controller was plugged in after the 7800 was turned on
      • Xenophobe didn't autostart
      • Joystick worked perfectly
      • Thumb button worked perfectly as 7800 left fire button
      • Side button worked perfectly as 7800 right fire button
  • Baby Pacman - Classic Controller was not immediate recognized
    • Game had a tendency to go directly to the options screen without any input from user
    • Game didn't recognize controller input if joystick was plugged in when 7800 was turned on
    • If Classic controller was plugged in after the 7800 was turned on
      • Baby Pacman functioned as expected on start up
      • Joystick worked perfectly
      • Thumb button worked perfectly as left flipper
      • Side button worked perfectly as right flipper

 

Wondering if the issue with the 2600 button games not working with the side button could be resolved if the Classic controller was plugged in after the 7800 was turned on.

atari-classic-data.png

  • Like 1

2 Comments


Recommended Comments

20 hours ago, neogeo1982 said:

Very detailed analysis and troubleshooting.

Thanks for noticing. Quite frankly I was surprised that I was able to figure out TinyUSB enough to make it work. I really felt like I was wondering around in the dark for a while. It's good that the Atari controllers support USB 1.1. Before I bought the Atari controllers I was just going to shoot for the 8BitDo SN30 Pro... but as it turns out the Pi Pico doesn't like the SN30, The Pico spits out an error whenever I plug a SN30 into it: "Speed too High".

Edited by flickertail
Link to comment
Guest
Add a comment...

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