July 17, 2019, 04:59:39 am

News:

Upload your images to this forum!.  The internet can't be trusted.  NFG can.  (probably)


Sega Genesis/Mega Drive 6 button pinout?

Started by eastx, October 13, 2006, 10:58:36 am

Previous topic - Next topic

eastx

Hi,

Can anyone provide the info needed to build a Genesis 6 button controller? Gamesx.com's Genesis page only covers the 3 button pad. I gotta have X, Y, Z, and Mode!


NFG

The 6-button pad is wickedly more complicated than the 3-button, and involves a half dozen chips if you're not using Sega's custom chip.

The schematic is huge, maybe I'll dig it out and post it.

eastx


KillingBeans

June 21, 2008, 02:36:06 am #3 Last Edit: June 21, 2008, 04:11:29 am by KillingBeans
Quote from: Lawrence on October 13, 2006, 12:39:42 pm
The schematic is huge, maybe I'll dig it out and post it.


Please, do so! I'd love to see it too  :)

I'm dreaming of building my own custom 6-button arcade stick with Sanwa parts, and I want to do it without gutting a "real" 6-button controller. I found these two documents, and I'm trying to use them to construct my own piece of circuitry:

http://applause.elfmimi.jp/md6bpad-e.html

http://www.cs.cmu.edu/~chuck/infopg/segasix.txt

Some "inspiration" would be very much appreciated  ;D

albino_vulpix

If you want a custon Mega Drive/Genesis stick, you can buy really cheap controllers from a company called, I think, Innovations. You can find them on eBay for next to nothing, and you won't feel guilty about ripping them apart because the plastic is utter crap  ;D

KillingBeans

Yes, but that won't be any fun, and I won't learn anything  :'(

I'v got a keen interest in electronics, and I really, really want to build it myself.

Lawrence where are you?! I need that schematic!  ;D

NFG

It's a hugely complicated circuit, you won't enjoy it.

When I find a scanner, I'll put the schems up. 

KillingBeans

Quote from: Lawrence on June 21, 2008, 07:21:01 pm
It's a hugely complicated circuit, you won't enjoy it.


Huge complicated circuits turn me on  ;D

Quote from: Lawrence on June 21, 2008, 07:21:01 pm
When I find a scanner, I'll put the schems up. 


That would be absolutely awesome!  8)

NFG

I still haven't stumbled across a scanner, so I created a new schematic the hard way. 

The circuit's stupid: it uses four chips just to create a clock signal and then six more chips to multiplex the buttons.  It's bloody annoying!!  Ten chips for a megadrive pad?  Screw that!

Anyway, I'll check it for errors in the morning and put it online then (took me 3 hours to make the damned schematic.  zzzzz)

KillingBeans

June 25, 2008, 06:45:49 am #9 Last Edit: June 27, 2008, 02:01:34 am by KillingBeans
Cool, I could have waited for the scanner to show up, but I surely appreciate the extra hard work  ;D

This is my own first take at it:

NFG

Yours is quite a bit less complex than the one I found in a 1994 Backup Technik magazine. 

Your choice of the 74153 makes far more sense than the use, in mine, of the 4539.  They're functionally identical except the 4539 has two enable lines to completely shut down either of the 4-line inputs.

For your amusement, the Backup Technik one is here but it's massive, uses ten chips, and probably shouldn't be used.  =(

The BT design uses the 4359 chips in a counterintuitive fashion: Instead of using the 2 x (4-in 1-out) function of the chip with two select lines activated by the clock, he's run the clock to one bank of (4-in 1-out) inputs, turned off the other four, and tied two pad buttons to the SELECT lines on the chip.  Basically now when a padd button is pressed the chip passes the state of the clock lines to the system, where normally the clock selects which of the pad buttons to pass through.  It's fucking stupid, and unnecessarily doubles the chipcount.

It should be noted that BOTH circuits are ONLY good for six-button games.  The real pads have a clever enabling mechanism that is not easily duplicated.  In order to activate the extra buttons in a six button pad, the software pulses the clock line four times in rapid succession.  This sends the pad into longer loop, returning results for all the extra buttons, at which point it resets and goes back to 3-button mode.  Neither of the above two circuits have a 3-button fallback mode nor any timers, so if your game expects this behaviour or doesn't cope with six-buttons, you'll get some rather strange results.

kyuusaku

Anyone sure the mode button actually toggles between 3 and 6 button in hardware? It seems to me that it's just used by software to confirm you want to use the 6 button configuration instead of 3 button. I'd think if it actually toggled modes, the button status bit wouldn't exist, or do you have to hold the button for a specific period to toggle?

NFG

kyuusaku: I was thinking the same thing.  I'm reasonably sure it only tells the hardware how to deal with it, it doesn't disable the mode entirely. 

If it DID, games like MsPacMan wouldn't freak out with a 6-button pad attached.

kyuusaku

June 25, 2008, 06:28:26 pm #13 Last Edit: June 25, 2008, 06:50:31 pm by kyuusaku
Good. Disregarding compatibility mode--if it exists, I think this is closer than either circuit. It has only one glitch on reset which needs to be modeled to the real thing, and the RC charge and discharge needs tweaking, maybe separate constants even, but it closely models Ein's description above.

KillingBeans

I think this is the circuit I'm going to build as my first prototype. I have just added a manual switch for 6/3-button modes. I don't mind having to flip a switch, when I change games  :)

kyuusaku

June 27, 2008, 01:56:36 pm #15 Last Edit: June 27, 2008, 03:28:53 pm by kyuusaku
Your S0 should be connected to the neg-edge counter's Q1 since reset doesn't count as a clock. Also what about D4 and D5 on the 3rd rising edge?

Edit: Here's an update for my version. It can be fit into a 7400, 74164, 3x74153 or a single 22V10.

KillingBeans

June 27, 2008, 04:31:07 pm #16 Last Edit: June 27, 2008, 11:13:32 pm by KillingBeans
Quote from: kyuusaku on June 27, 2008, 01:56:36 pm
Your S0 should be connected to the neg-edge counter's Q1 since reset doesn't count as a clock.


??? That would totally mess up my counting system. I might just be stupid, but I don't see the logic in any of that.

Quote from: kyuusaku on June 27, 2008, 01:56:36 pm
Also what about D4 and D5 on the 3rd rising edge?


Good point. I guess they should be set high, but I'll leave them multiplexed for now and see what happens.

kyuusaku

June 28, 2008, 03:16:01 am #17 Last Edit: June 28, 2008, 04:36:55 am by kyuusaku
I think you possibly may be right because the reset happens on the rising edge, so the first falling edge registers. The diagram however makes the cycle appear as though the reset (4th rising) is also the same thing as the 1st rising, so that would make it the second falling edge that triggers the first new condition (all buttons low), not the third. All you'd have to do is disconnect the falling edge ctr's Q0, and tie the AND input to 1 if this is the case.

I added synchronous reset to my design though I'm not sure it matters since BT's very glitchy circuit works well enough to publish.

KillingBeans

June 28, 2008, 08:05:39 pm #18 Last Edit: July 03, 2008, 05:47:03 pm by KillingBeans
Quote from: kyuusaku on June 28, 2008, 03:16:01 am
The diagram however makes the cycle appear as though the reset (4th rising) is also the same thing as the 1st rising, so that would make it the second falling edge that triggers the first new condition (all buttons low), not the third.


I think I need a lesson in flip-flops  :-\

This is the way I see my counting circuit. Unless I'm all wrong about it (?), I can't see how the reset would mess with the reading sequence...

Come to think of it, my reset is actually completely useless  :D

kyuusaku

June 29, 2008, 02:07:05 am #19 Last Edit: June 29, 2008, 02:52:56 am by kyuusaku
Your way must be correct, my confusion was in that select was high during and after reset. This makes the shift register and synchronous reset way all pointless ;) Internally there must be just a single 2-bit counter reset only by the timer.

Asynchronous reset in your circuit isn't useless, it will work, but not great because it has a mild race condition. You can make it synchronous by simply ignoring the high bits of the positive counter (still must reset the negative counter).

KillingBeans

Quote from: kyuusaku on June 29, 2008, 02:07:05 am
Asynchronous reset in your circuit isn't useless, it will work, but not great because it has a mild race condition. You can make it synchronous by simply ignoring the high bits.


By "useless" I meant "pointless", since the counters (as far as I can see) will go 0 -> 3 every time they recive the select sequence, no matter if I reset them or not  :)

kyuusaku

June 29, 2008, 03:13:14 am #21 Last Edit: June 29, 2008, 03:41:31 am by kyuusaku
Right but you must synchronize the counters so the negative must be reset before or at the same time as the positive counter. Since you need to use the third falling edge, you have to manually reset it.  I just realized that if you reset it with Q2 but not reset the positive counter, then it won't work properly because you then can't ignore Q2, and the negative counter won't count. It only works if you keep it how it is.

I've changed my design to use only a 2-bit counter + 3xAND2, 1xOR2, 1xNOT. Now with only a 2-bit counter, I think the entire design should fit into a cheap 20V8 but I can't find a 74 series chip providing these combinational functions... I'm stuck with 6 chips I guess.

KillingBeans

I have started testing my circuit using this marvelous rig  ;D

It seems to work just fine, but just as predicted 3-button games act strange when I try to play them with all 6 buttons enabled. Therefor i tried to add the simple charging timer from Kyuusaku's circuit, but I don't seem to be able to make it work  :-[

It also looks like I was right about the reset. Apparently it makes no difference whether it's connected to the pos counter's Q2 or just held low.

kyuusaku

Did you invert the RC constant for your active high reset? The select line is used to charge the cap, and after 1.8ms or so of the select line low, the cap will discharge past the logic 0 threshold so the counter will be reset. I assumed the threshold was 1.5V, and it took 1.8ms to fall from 4.3V (5V - 0.7V diode drop), but of course I don't know your diode's true drop, 4000 series 0 level threshold or the true RC time.

To me it doesn't make sense for there to be no difference with the negative counters reset since with Q2 disconnected they aren't synchronized, you must be lucky and the counters initialize by chance to the right states. What if the counters initialized to 0 and 2? A game could keep toggling select the line and never get the expected responses since they wouldn't ever be synced from the fourth pulse or by the timer.

KillingBeans

Quote from: kyuusaku on July 06, 2008, 12:28:11 pm
What if the counters initialized to 0 and 2?


Why would they do that? And what if the pos counter initialized wrong? Then both counters would just keep resetting at the wrong point.

Well here's the score:

Street Fighter 2 and Super Street Fighter 2 seems to work  ;D

Streets of Rage 3 don't work  :'(

I need to get myself an oscilloscope...

kyuusaku

Generally you can't assume a flipflop will initialize to a specific state unless you have a power on reset circuit. If the counters kept resetting at the wrong point, that would be problematic unless the game reads all the postive and negative edges separately, but why would they do this since that's not how the official controller works?

Do you have a parallel port? They make great free 100kHz+ logic analyzers.

KillingBeans

Quote from: kyuusaku on July 07, 2008, 09:45:41 am
Generally you can't assume a flipflop will initialize to a specific state unless you have a power on reset circuit.


Since I'm using prefab'ed counters instead of making my own from flip-flops, I would assume this is part of the design.

Quote from: kyuusaku on July 07, 2008, 09:45:41 am
If the counters kept resetting at the wrong point, that would be problematic unless the game reads all the postive and negative edges separately, but why would they do this since that's not how the official controller works?


Because my crappy circuit does not work like the official controller. If I could get the reset timer to work, then the Q2 -> reset thing would be a great addition though, since the counters would become in sync with both the reading sequence and each other.

Quote from: kyuusaku on July 07, 2008, 09:45:41 am
Do you have a parallel port? They make great free 100kHz+ logic analyzers.


Nope, not at the moment. But I'm always looking for new excuses for building an extra PC  ;D

l_oliveira

Just a comment.  If you guys try any of the two MEGA-CD "Game no Kanzame" discs, at the title screen the lady talks "It's not button <button>" in japanese.
So you press mode button she say mode button.  It means the Mega Drive can read mode button status when in six button mode, too.
Any idea about how this work ?

NFG

If you have a look at the circuit, the MODE button is a button just like all the rest.  There's no reason the MD would be unaware of it...  in fact, it HAS to be: since the MD disables the 6-button mode through SOFTWARE, if it couldn't sense the button, how would it know?  =)

l_oliveira

Ya ... after posting that I had another look at the second diagram and indeed I was like "wtf brainfart" lol

Anyway I remember something on the controller manual stating that for incompatible 3 button games if the console was turned on with the mode button being hold it would enforce 3 button mode regardless of what the software does.

I can't edit my posts that's why I am posting again :)

Tiido Priimägi

6 buttons are disabled only through hardware, by holding Mode down during power up. The TH line of the controller must be pulsed 4 times to get XYZM data, and all other pulses yeld 3 button readings. There is a timeout feature, and about (unknown) time, you can read the 6 button data again. I will need to look up some docs as my memory is probably not too correct.
Mida sa loed ? Nagunii aru ei saa ;)

NFG

Quote from: TmEE on July 16, 2008, 04:27:37 am
6 buttons are disabled only through hardware, by holding Mode down during power up. The TH line of the controller must be pulsed 4 times to get XYZM data, and all other pulses yeld 3 button readings. There is a timeout feature, and about (unknown) time, you can read the 6 button data again. I will need to look up some docs as my memory is probably not too correct.

Yes, this is known, but these features only apply to the REAL controller, and not the ones we're building here.  And, in fact, it's not even sure that the REAL controller works that way: if it did, Ms PacMan would be playable if you held the MODE button down, and it's not.

Tiido Priimägi

original 6-button controllers don't like the lack of waits sfter the TH transitions... games that don't do these waits will have issues with 6-button pads. 6-button pads hate overclocked systems.
Mida sa loed ? Nagunii aru ei saa ;)

Segasonicfan

epic thread deservez a BUMP!

stumbled over here from another forum and am just blown away by all the good info here.  I plan to use it to make a non-CPLD 6-button version of my Uni-Gen Converter some day.

did anyone figure out all the bugs eventually?  Lawrence, did you ever upload that nasty 10 IC version you had?

NFG



T_O

June 17, 2019, 04:01:51 am #36 Last Edit: June 17, 2019, 04:47:17 am by T_O
Quote from: KillingBeans on June 27, 2008, 02:45:46 am
I think this is the circuit I'm going to build as my first prototype. I have just added a manual switch for 6/3-button modes. I don't mind having to flip a switch, when I change games  :)


I know this is ridiculously late--11 years after this post--but was there ever a final version (or verdict?) on KillingBeans's circuit? Was SoR3 the only 6-button game that didn't work properly, or were there more?

I ask because I'm likely going to build my own circuit based on this design, plus a simple 3-button circuit, with a SPDT switch for the 5v rail between the two circuits. Game doesn't work with 6-button? Power off and switch to 3-button. It increases the pcb size slightly, but is actually probably MORE user-intuitive than remembering to hold a shoulder button down while powering on the console.


Segasonicfan

Quote from: T_O on June 17, 2019, 04:01:51 am
Quote from: KillingBeans on June 27, 2008, 02:45:46 am
I think this is the circuit I'm going to build as my first prototype. I have just added a manual switch for 6/3-button modes. I don't mind having to flip a switch, when I change games  :)


I know this is ridiculously late--11 years after this post--but was there ever a final version (or verdict?) on KillingBeans's circuit? Was SoR3 the only 6-button game that didn't work properly, or were there more?

I ask because I'm likely going to build my own circuit based on this design, plus a simple 3-button circuit, with a SPDT switch for the 5v rail between the two circuits. Game doesn't work with 6-button? Power off and switch to 3-button. It increases the pcb size slightly, but is actually probably MORE user-intuitive than remembering to hold a shoulder button down while powering on the console.


AFAIK theres not much movement on the hardware side of this, but theres some Arduino / MCU solutions floating around.
I designed a 3-button hardware only solution that I sell here: https://segasonicfan.wixsite.com/retro/uni-gen

I'd like to make it open source one day, but can't do it until my finances are in better order.

I's be interested in seeing what you come up with though!  maybe I could lend a hand.

-SSF