Jump to content

Baby Pac-man on 7800 using VCS Modern Controller


flickertail

401 views

After some additional hacking on the USB today, I have created a definition for the Atari VCS Modern Controller. So now both the Classic and the Modern controllers work with the 2600/7800.

 

Here's a link of me playing Baby Pac-man on the 7800 using the Modern controller. I apologize for the video. It's just to demo the fact that it works. It was hard to film one-handed, so I apologize for the controller covering the TV half the time.

 

USB Packet Payloads

Where as the Classic controller has a 5 byte USB message payload, the Modern controller has a 15 byte payload. Here is how they match up (C) on the Classic, (M) on the Modern

Byte 0 - Header Info

Byte 1 - Fire Button Info

  • 0x01 (C) Thumb Button, (M) 'A' Button
  • 0x02 (C) Side Button,     (M) 'B' Button
  • 0x04                             (M) 'X' Button
  • 0x08                             (M) 'Y' Button
  • 0x10                             (M) 'L' Shoulder Button
  • 0x20                             (M) 'R' Shoulder Button
  • 0x40                             (M) 'L' Joystick Button
  • 0x80                             (M) 'R' Joystick Button

Byte 2 - D-Pad Direction and Function Buttons - Essentially the same on both

  • 0x01 (C & M) 'Back' Function Button
  • 0x02 (C & M) 'Ham' Function Button (aka Fwd)
  • 0x04 (C & M) 'Atari' Function Button
  • 0x10 (C & M) D-Pad North
  • 0x20 (C & M) D-Pad North East
  • 0x30 (C & M) D-Pad East
  • 0x40 (C & M) D-Pad South East
  • 0x50 (C & M) D-Pad South
  • 0x60 (C & M) D-Pad South West
  • 0x70 (C & M) D-Pad West
  • 0x80 (C & M) D-Pad North West

Bytes 3 & 4

  • Byte 3 (C): 0-255 Unsigned Int
    • Used to determine 90 rotation through 1/4 of a circle
    • Primary use for emulation of paddle around classic controller central pole
  • Byte 4 (C): 0-3 Unsigned Int
    • Used to identify which quadrant of the circle that is currently being used as the base for the paddle rotation

Bytes 3 & 4 (M): 16bit Signed Int

  • Used for Left Joystick X-Axis
  • Full Left Value: -32,XXX; Center Value: 0; Full Right Value: 32,XXX

Bytes 5 & 6 (M): 16bit Signed Int

  • Used for Left Joystick Y-Axis
  • Full North Value: -32,XXX; Center Value: 0; Full South Value: 32,XXX

Bytes 7 & 8 (M): 16bit Signed Int

  • Used for Right Joystick X-Axis
  • Full West Value: -32,XXX; Center Value: 0; Full East Value: 32,XXX

Bytes 9 & 10 (M): 16bit Signed Int

  • Used for Right Joystick Y-Axis
  • Full North Value: -32,XXX; Center Value: 0; Full South Value: 32,XXX

Bytes 11 & 12 (M): 16bit Unsigned Int

  • Used for Left Trigger Axis
  • Not Pulled: 0, Full Pull Value: 65,XXX

Bytes 13 & 14 (M): 16bit Unsigned Int

  • Used for Right Trigger Axis
  • Not Pulled: 0, Full Pull Value: 65,XXX

 

What About the Paddles?

The paddle won't be difficult to implement. It's just a matter of adding an AD5242 digital pot chip along with two N-Channel MOSFETs. The MOSFETs aren't entirely necessary, but they implement the Paddle Pin 3/4 fire buttons, and will be controlled by the AD5242 chip. This makes coding for the paddles easier on the Pico as only one I2C command to AD5242 will be required, rather than two... one each to the AD5242 chip and the ADG715 chip.

 

This reduction may help with performance later when implementing 4 x controllers at the same time.

 

However, I'm not sure how to implement 4 controllers yet, as TinyUSB doesn't support more than 1 level of USB, so utilizing a USB hub is not an option. I think it would be possible to design a custom RP2040 board with additional USB ports, so that may be one way around it - worst case scenario.

2 Comments


Recommended Comments

I haven't posted about it in the forums. For one, I'm not entirely sure which forum is appropriate. But also, I'm about to head into a period at work with a looming deadline... and I don't know that I'll be able to do anything with this over the next month. I don't want to post about it, and then disappear from the forums for an extended period of time. Once my work deadline has been met, I'll have a lot more freedom to work on this in my spare time throughout the next year.

 

But yeah, I agree it's kinda a cool. Everything I did for the 2600/7800 could easily be applied to the 5200... and in fact, it would likely be easier to implement for the 5200 as unlike the 2600/7800 you only have one or two controller configurations to deal with.

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