Jump to content
Sign in to follow this  
tjb

Using Sega Genesis controllers for new games

Recommended Posts

I'm looking to blow the dust off my WIP Rasteroids game and finish it. It currently runs on the Atari 5200 and makes use of both fire buttons as well as the keypad. One of the suggestions for the 8-bit computer version (by Rybags IIRC) was to support the Sega Genesis controller since it provides more buttons. I wrote a small BASIC program to monitor memory locations 624 to 647 to try and determine if it would be possible to read all the buttons without having to use a modified controller. It would appear that the controller would need to be modified to make this happen. Is this true? Has anyone looked into this?

 

tjb

Share this post


Link to post
Share on other sites

Fairly sure the Sega controller uses an IC to serially output the other button values, much in the same way as the Amiga CD32 one does.

 

Not sure what it uses to control output, but the Amiga one you need to output on the TRIG line, which Atari can't do.

 

I was thinking about posting a thread proposing some new controller standard. We need 3 or 4 buttons and we need them 20 years ago.

 

One idea I had was to just use PS1 controllers (since they're so common and can be had for like $4).

Just bypass the logic entirely, add a little circuit that hooks up some of the extra buttons to the POT inputs. Use the D-pad, maybe have a switch for the analog ones that allows POT inputs as either the analog stick, or button combos.

Then do a bit of rewiring, cut the plug off and put a normal Atari type on the end, with luck we could just use the entire existing PS1 lead, so the only visual change would be the plug end.

Share this post


Link to post
Share on other sites

The Atari controller port has this pinout:

 

Up

Down

Left

Right

PotB

Trigger

5V

Gnd

PotA

 

The Genesis control pad has this pinout:

 

Up

Down

Left

Right

5V

TL (can be either B or A depending on the state of TH)

TH (selects which buttons to read)

GND

TR (can be either C or START depending on TH)

 

As you can see, the 5V line for the Genesis pad connects to the PotB line on the Atari. However, that line is pulled high through a resistor to charge a cap to read the pot the Atari expects there. As long as the pad doesn't draw too much current, the voltage drop across the resistor in the Atari is low and the pad gets enough voltage to work anyway.

 

The TH line on the Genesis pad is used to switch between two banks of buttons (on 3-button pads... there's a more complicated method to read the 6-button pads using this line, but we're ignoring that for now). When TH is high, we get B and C buttons on the TL and TR lines; when TH is low, we get A and START instead. Notice that TH connects to the 5V line on the Atari, so it's always high, so we always get B and C on TL and TR.

 

TL hooks to the Trigger line on the Atari, so the B button is always the Trigger on the Atari. TR hooks to PotA, so the C button is always PotB (you can use the fast pot mode for faster reading of PotA).

 

So as you can see, with no changes at all you can read Up, Down, Left, Right, B, and C on the Atari. If it doesn't work, your pad is probably drawing too much current as mentioned above.

 

If you wish to use a pad no matter what, you would need to swap the 5V and TH lines on the Genesis pad. You would still be restricted to just the dpad and B and C buttons.

 

If you wish to read ALL the buttons, you need to connect the pad TH line to a line from the Atari that can be set as an output so you can switch from high to low to get the other buttons. That means one of the direction lines as the PIA lines are the only ones you can set the direction of. If someone in interested in that much, I can explain further, but I think most folks just want the two buttons as mentioned without making any changes. :)

 

The Amiga had a slight advantage here that the pot lines could be set as outputs, so swapping the 5V line and the TH line in the Genesis pad not only allowed for all pads, but allows you to then read all the buttons. I put this in a readme for my port of Doom to the Amiga detailing which lines to swap, and I included the code in the Doom source for reading 3 and 6 button Genesis pads.

Edited by Chilly Willy

Share this post


Link to post
Share on other sites

How about SMS pads? They have no IC's inside and they'd give at least one extra button.

Share this post


Link to post
Share on other sites

Only one extra button is kinda lame... there should be a mod around for 7800 controllers to satisfy that.

 

I think the idea could take off - existing games could be modded with ease e.g. smart bombs via button instead of SPACE.

In fact, an even easier way would be a RAM-patch OS mod which would work instantly with most games.

Share this post


Link to post
Share on other sites

Fairly sure the Sega controller uses an IC to serially output the other button values, much in the same way as the Amiga CD32 one does.

 

Not sure what it uses to control output, but the Amiga one you need to output on the TRIG line, which Atari can't do.

 

I was thinking about posting a thread proposing some new controller standard. We need 3 or 4 buttons and we need them 20 years ago.

 

One idea I had was to just use PS1 controllers (since they're so common and can be had for like $4).

Just bypass the logic entirely, add a little circuit that hooks up some of the extra buttons to the POT inputs. Use the D-pad, maybe have a switch for the analog ones that allows POT inputs as either the analog stick, or button combos.

Then do a bit of rewiring, cut the plug off and put a normal Atari type on the end, with luck we could just use the entire existing PS1 lead, so the only visual change would be the plug end.

You could do a custom controller using the trigger lines for added buttons (let alone adding a few resistors to multiplex analog buttons as such). The genesis would allow 2 buttons just like the SMS given the discussion in a recent 7800 forum thread, but making use of the internal multiplex circuit is far more complex and further complicated by the the differing pinouts. (might be able to work around that if you used a jumper to flip select line and 5V, but in any case it would take a software routine to poll it -more of a headache and more intensive than simply modifying a controller for 2 POT based buttons -let alone analog multiplexing -for 4 buttons on one analog line you'd need 16 different resistance values for full multi-press buttons, or 4 resistance values for 2 buttons per pot)

 

You could also do additional functions for non-action-critical buttons (pause/select/etc) as unused directional inputs (up+dn simultaneously, L/R simultaneously, etc) so long as software recognized such inputs correctly. (Up+dn and L+R are the most foolproof for using 2 unique button as such that also give a unique output when pressed simultaneously, though another fairly foolproof configutation is using up/L/R, dn/L/R, up/r/dn, dn/l/up and register up+l+dn+r as an error/null function -using those 4 combinations along with the up/dn pairs and/or all 4 directions at once would be less favorable as combinations of the stick and function button combos could give false inputs)

Albeit doing a homebrew controller using such would be a bit messy due to all the wires. (just doing Up+dn and L+R or just one of those 2 might not be too bad though)

 

 

 

The Atari controller port has this pinout:

 

Up

Down

Left

Right

PotB

Trigger

5V

Gnd

PotA

 

The Genesis control pad has this pinout:

 

Up

Down

Left

Right

5V

TL (can be either B or A depending on the state of TH)

TH (selects which buttons to read)

GND

TR (can be either C or START depending on TH)

Hmm, then how can A+B act as buttons 1 and 2 for the SMS/SG-1000? (pins 5 and 9 respectively) Or am I mistaken and B and C are used for buttons 1 and 2 on the SMS?

 

In any case, the SMS (or SG-1000) controllers shoudl behave similarly to MD/Genny pads on the Ataris... other than eliminating any possibility of drawing too much current as there's no logic to power, just bare parallel directions/buttons.

 

 

 

And didn't the 6 button pad just multiplex the directional inputs as well for the added 4 buttons? (since there's only 2 multiplexed inputs on the 3 button pad with the 4 directional lines left alone)

Edited by kool kitty89

Share this post


Link to post
Share on other sites

Grovybee has been working on a playstation to Atari 7800 adaptor , maybe that could be usedb somehow on the 8bits?

Share this post


Link to post
Share on other sites

The Atari controller port has this pinout:

 

Up

Down

Left

Right

PotB

Trigger

5V

Gnd

PotA

 

The Genesis control pad has this pinout:

 

Up

Down

Left

Right

5V

TL (can be either B or A depending on the state of TH)

TH (selects which buttons to read)

GND

TR (can be either C or START depending on TH)

 

As you can see, the 5V line for the Genesis pad connects to the PotB line on the Atari. However, that line is pulled high through a resistor to charge a cap to read the pot the Atari expects there. As long as the pad doesn't draw too much current, the voltage drop across the resistor in the Atari is low and the pad gets enough voltage to work anyway.

 

The TH line on the Genesis pad is used to switch between two banks of buttons (on 3-button pads... there's a more complicated method to read the 6-button pads using this line, but we're ignoring that for now). When TH is high, we get B and C buttons on the TL and TR lines; when TH is low, we get A and START instead. Notice that TH connects to the 5V line on the Atari, so it's always high, so we always get B and C on TL and TR.

 

TL hooks to the Trigger line on the Atari, so the B button is always the Trigger on the Atari. TR hooks to PotA, so the C button is always PotB (you can use the fast pot mode for faster reading of PotA).

 

So as you can see, with no changes at all you can read Up, Down, Left, Right, B, and C on the Atari. If it doesn't work, your pad is probably drawing too much current as mentioned above.

 

If you wish to use a pad no matter what, you would need to swap the 5V and TH lines on the Genesis pad. You would still be restricted to just the dpad and B and C buttons.

 

If you wish to read ALL the buttons, you need to connect the pad TH line to a line from the Atari that can be set as an output so you can switch from high to low to get the other buttons. That means one of the direction lines as the PIA lines are the only ones you can set the direction of. If someone in interested in that much, I can explain further, but I think most folks just want the two buttons as mentioned without making any changes. :)

 

The Amiga had a slight advantage here that the pot lines could be set as outputs, so swapping the 5V line and the TH line in the Genesis pad not only allowed for all pads, but allows you to then read all the buttons. I put this in a readme for my port of Doom to the Amiga detailing which lines to swap, and I included the code in the Doom source for reading 3 and 6 button Genesis pads.

 

This is consistent with the behavior I was seeing. As you mentioned the stick is detected just like a normal Atari joystick and I can read when the B & C buttons are pressed.

 

tjb

 

 

 

Share this post


Link to post
Share on other sites

Hmm, then how can A+B act as buttons 1 and 2 for the SMS/SG-1000? (pins 5 and 9 respectively) Or am I mistaken and B and C are used for buttons 1 and 2 on the SMS?

 

It's B and C.

 

 

In any case, the SMS (or SG-1000) controllers shoudl behave similarly to MD/Genny pads on the Ataris... other than eliminating any possibility of drawing too much current as there's no logic to power, just bare parallel directions/buttons.

 

Yep. The SMS pad would be like the 3-button Genesis pad, returning the dpad and two buttons on the same lines as B and C in my description.

 

 

 

And didn't the 6 button pad just multiplex the directional inputs as well for the added 4 buttons? (since there's only 2 multiplexed inputs on the 3 button pad with the 4 directional lines left alone)

 

The 6 button uses a packet system where you toggle the TH line and get different values. If you get cbrldu, toggle TH and get sa, then toggle TH back high, you'll get these returns for four fetches from a 6-button pad:

 

/* - 0 s a 0 0 d u - 1 c b r l d u */
/* - 0 s a 0 0 d u - 1 c b r l d u */
/* - 0 s a 0 0 0 0 - 1 c b m x y z */
/* - 0 s a 1 1 1 1 - 1 c b r l d u */

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...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...