Jump to content
IGNORED

Sega Genesis 3 and 6 button controller project.


undeadmechanic

Recommended Posts

It's been several years since I have posted on AA (or even dusted off my A8s), but last week I posted on the AA Facebook page that I was starting a project to bring full functionality of the Sega 3/6 btn controllers to the A8s. This is a project that I am working on in my free time, what little there is.

 

After tinkering for a couple of nights, I have reached 100% functionality for the 3 btn controller. The 6 btn is a different critter and requires a rework of my mod circuit. There was a hiccup I discovered in the way the 6 btn responds to report the state of X/Y/Z. Work is in progress and the handler is not complete yet since I plan to write only one version to work with both.

 

I started this for fun, and, to the best of my knowledge, because no one else has done it.

 

Hopefully when I'm done, I'll add one more thing to the bag of tricks for the A8s, and I will post a full write up on it.

  • Like 10
Link to comment
Share on other sites

Hello undeadmechanic

 

Is this going to be an internal (to the Sega controller) mod? Or something that plugs between the controller and the computer?

 

Sincerely

 

Mathy

 

 

It started out as an internal mod, but as size and complexity increased, I quickly scrapped that idea in favor of an inline module.

 

The 3-button isn't hard because, two of the buttons (b and c) already have functionality. One of them maps to PADDL(0), I used this trick in my own Tetricize game on the Atari.

 

Yes, and when the select line is shifted low, A and Start are read at STRIG(0) and PADDLE(0).

 

Does the Paddle gives you also a range value (0 to 255)?

 

No. PADDLE(0) reads 1 when the button is released and... "not 1" when pressed. I don't know if there is any variance between systems and controllers, but my system reads 228 when pressed. All I care about is 1 and "not 1." :)
  • Like 3
Link to comment
Share on other sites

undeadmechanic,

 

Thanks.

I was asking about the the actual paddle (not the button). as you move in from one side to the other, doesn't that give you a range.

Say for example, 0 to 255 (or less than that)

I asked this because one may map values to the other buttons there.

 

Anyways, interesting to have more than one button for the Atari. I don't remember any games that used more than one button.

  • Like 1
Link to comment
Share on other sites

Yes,the paddle lines just read the potentiometer as it sweeps through its range. I guess you could connect the different buttons by using different value resistors for each, but it would likely be difficult to maintain consistency across each controller mod.

 

The Genesis controllers already have all the circuitry in them needed to generate the different signals. The 3 btn has a 75HC157 multiplexer, and the 6 btn has a microcontroller. All I'm doing is building a circuit to allow the Atari to drive the controller exactly how the Genesis would.

 

The 3 btn only required a 74LS32 and 4 diodes to get it to read correctly. The 6 btn responds by pulling all 4 of the dpad lines low the instant it begins to report the X/Y/Z/Mode button states.

 

This caused me to rethink my circuit and change it to an inline module, which doesn't mod the controller itself and will work with any genesis pad, 3 or 6. Personally, I'm excited to try out my huge 6 btn arcade stick. :)

  • Like 1
Link to comment
Share on other sites

Didn't the MultiJoy (Joy4) interface that connected up to 8 joysticks to 2 joystick ports do something to divide up the signals from each joystick. I believe it did something to wait for something back to PORTA / PACTL be written back to the joystick port to read the values from the next joystick. I am wondering if something can do done to read a joystick with multiple fire buttons. Some information on How to query is here. https://atariwiki.org/wiki/Wiki.jsp?page=How%20to%20query%20the%20MultiJoy%20Interface

  • Like 1
Link to comment
Share on other sites

That's an interesting little device. I never knew they made anything like that for the A8s.

 

That was exactly the approach I had decided on when I started this, except I have to generate a PWM signal to tell the 6 btn that I want the extra button states. I played around with assembly and realized that I could generate a pulse only 2 microseconds wide, which I think is too fast for the controller. I hope to have the hardware part done by this weekend and start on the coding, but I first have to find the low limit for the PWM.

 

I'm just waiting on parts to arrive now.

Link to comment
Share on other sites

Quick update before bed. The last parts arrived in the mail this morning and I just finished assembling it and ran some quick tests in BASIC to verify I can successfully control the select line. I will run tests tomorrow to check PWM response.

 

Parts list on the hardware is one 74LS08, one 74LS266, four 1 amp diodes, one 1.1kOhm 1/4 watt resistor, and one 2N3904 NPN transistor.

 

I installed the gates, tried to test it and got really weird behavior out of the controller. The controllers have an 800 ohm discreet pullup resistor on the select line that I didn't know about and it caused strange things to happen just by pressing the dpad in any direction. I added the transistor and a 1.1k pulldown resistor to overpower the built-in pullup and everything is working correctly now.

 

More updates to come.

Edited by undeadmechanic
  • Like 1
Link to comment
Share on other sites

It's been a long day. My boss is out sick with pneumonia and the flu, and one of the other guys has a bad eye infection. All this means that I am pulling triple the workload. Yay.

 

Anyways, progress report: I didn't get to tinker with my project as much as I had wanted to this weekend and I haven't been back to it since, but I did get a good bit of work done on it.

 

First, the 3btn part of the handler is working about 90% as I had intended. I can read A, B, C, and start, but with one caveat: C and start cannot be read simultaneously. Both appear on pot 0 and due to the small window of time to read start, C over rides the start value. I don't think this would ever be an issue, because there is no reason I can think of to need to read both of those buttons at the same time.

 

I consistently get 3 different readings from the pot register: 1 = no button pressed. 228 = c pressed. Depending on how many instructions there are between setting select low and reading the register, it reads between 2 and 5. So, 1 is nothing, 228 is c, and anything else is start. I also discovered that occasionally you can manage to press start in the middle of a vblank and get some random value other than 1, 2-5, and 228. To overcome this, I had to add a verify process where it must read the same value for 2 consecutive frames before registering the start button pressed. Translation: instead of reading the start button 60x/second, it updates it 30x. Again, I don't see this as being a problem.

 

Second: Unfortunately, I might have to write 2 different versions of the handler. One each for 3 and 6btn. I thought that I could just drive both with the 6btn routine and the 3btn wouldn't give the extra data. That is the case, but the 6btn pulses switches the select line so rapidly that the reading from the 3 btn drives the stick(0) register crazy. This is where I need some input from you guys. Should I write a "bare bones" 3btn handler for minimum memory usage, or would one handler that can identify which controller type is connected and read it accordingly be preferred? Or, I can do all of the above, if need be. Will just take time.

 

Third: Holy cow, OEM Genesis pads are noisy as hell. There is sooooooo much noise coming out of them. I thought my oscilloscope was spazzed out for a minute. Cheap 3rd party controllers generate nice, clean, square signals. I would have expected the total opposite. Go figure.

 

Fourth: I have not yet been able to get my OEM 6btn controllers to respond to the "secret handshake" to request X/Y/Z/Mode status. Something has got to be off in my timing. 3rd party controllers respond perfectly. Again, go figure. This is where I had to stop.

 

I may not resume until after Christmas.

 

Any questions or suggestions?

  • Like 1
Link to comment
Share on other sites

You might be able to use the ALLPOT register to read the Start button instead. It's basically the set of raw POTx inputs into POKEY that determine whether each pot counter keeps getting updated from the master counter or stops. ALLPOT is only meaningful during the pot scan, though (228 scanlines after POTGO for normal scan speed).

Link to comment
Share on other sites

Sorry if I missed this question already being asked in the thread, but what use would the extra buttons be on our Atari's? I regularly use a Genesis 3 button pad with my Atari, using the B button and pad. If you make the Sega controller's buttons all work on the Atari, there's absolutely nothing that can take advantage of it, so I ask why? Unless you intend to also write games that use it, all but the B button working are useless.

Link to comment
Share on other sites

  • 2 weeks later...

Sorry for the long delay in replying. I do not work a 9-5 job. I am a heavy tow operator and mechanic and this is the time of year we get slammed.

 

What would be nice is a mem resident mapping tool for old games that used say space to do something like Defender or Whisters Brother etc

 

Possible (depending on game mem use?)

 

Exactly my thoughts. Basically, we can simulate space (or any key) being pressed by stuffing a value directly into the register.

 

Sorry if I missed this question already being asked in the thread, but what use would the extra buttons be on our Atari's? I regularly use a Genesis 3 button pad with my Atari, using the B button and pad. If you make the Sega controller's buttons all work on the Atari, there's absolutely nothing that can take advantage of it, so I ask why? Unless you intend to also write games that use it, all but the B button working are useless.

 

We can still find a use for them. From replicating the buttons on the console to simulating key presses as mentioned above. And, we can always write new games to use whatever we like.

 

 

 

I tweaked the handler just a tad and now instead of reading the start button 30x/sec (every other vblank), it reads it every single one. But, if it *thinks* the start button is pressed, it waits an extra vbi cycle to verify that it is indeed the start button before it updates the register.

 

I need to draw out the circuit so other people can build it if interested. The whole thing is about $10.00 worth of parts, depending on where you purchase them.

  • Like 3
Link to comment
Share on other sites

  • 1 month later...

This is not dead, far from it. It is merely stalled. I just don't have the time to fiddle with it right now. I work too many hours during the week and my days off are divided between sleeping and doing the whole family thing.

 

I'm taking some vacation time next month and intend to dedicate a couple of days to this project...

  • Like 3
Link to comment
Share on other sites

I recently played around with the programming code for Multijoy8 interface. Been considering have a few of my future games support it, as well as the 4 joystick ports on the 400/800.

 

It works be setting the 2nd joystick port to output, upper 4 bits of PORTA. The value written to the upper 4 bits are the joystick #, so it is (Joystick#-1) x 16. 0 will be joystick 1, 16 will be joystick 2, 32 = 3, 48 = 4, etc.

 

So there still may be a way to write to your interface to indicate which firebutton you want to read. Wait an a few cycles, and have it send it as a series of bits to PortA. Default can be Joystick + A for Trig0. But send a value to your interface, and then reads PORTA as the 4 direction bits + trig as buttons C, D, E, F, + Start. Writing 0 back to PortA, will return it back to Direction bits.

Link to comment
Share on other sites

I already have my code down for the 3btn. The 6btn requires more analysis with the oscilloscope because I have not yet been able to get the oem sega 6btn to respond to the secret handshake.

 

I use the lower 4 bits of porta to drive pins 1-4 low simultaneously. The genesis controllers output +5 volts until that button is pressed, so I put a diode in each of the direction lines and hooked up a xnor gate to either side of the diode.

 

If both sides of the diode are high, it's not pressed. If both sides are low, the button is pressed. If the atari side is low and the controller side is high, the button is not pressed and the select line is requested low.

 

 

The output of the XNOR is run into an AND gate which is wired to require that either the left and right or the up and down lines on the atari side are low at the same time. This is physically impossible so it means the atari has set the pins low.

 

Once these conditions are met, the select line on the controller side is set low.

 

It's actually pretty simple and I can read the button presses fine on the 3btn. I have even gotten aftermarket 6btn to respond and I can read the additional 4 buttons on them, but not original sega brand 6btn. That's where I need to focus my efforts and it's finished.

  • Like 4
Link to comment
Share on other sites

  • 3 months later...

Hello timofonic

 

Any news? It would be amazing to have a multijoy8/multijoy16 with sega genesis 6 button controller support, but I suppose that would be too complex to do...

 

HardwareDoc is going to continu his UltraJoyPro project as soon as his condition allows him to, he promised me. The UltraJoyPro is an intelligent version of the MultiJoy interface. I'm not sure, but I wouldn't be surprised if the UltraJoyPro would work with the sega genesis controller.

 

Sincerely

 

Mathy

Link to comment
Share on other sites

Any news? It would be amazing to have a multijoy8/multijoy16 with sega genesis 6 button controller support, but I suppose that would be too complex to do...

 

Ed Kelley (of Edladdin Controllers) has made the Seagull 78 adapter available for several years that lets you use buttons B and C of a 3-button Genesis pad with the 7800. There's absolutely no reason that the same device shouldn't work with an A8 computer so long as there was software written that could read and recognize the paddle inputs as a button presses.

  • Like 1
Link to comment
Share on other sites

  • 2 months later...

Ok, guys. This project got put on hold for a while, but not cancelled. I was working for a towing company when I started this and I had very little free time. When I did manage to get a day off, I was usually on call... You can imagine how that usually went. I changed jobs recently, and now I work M-F, 8-5. After getting caught up on the more pressing things on the to-do list (read: "Honey-Do"), I am back on the case.

 

I went digging through my stuff and pulled out all of my old Sega gear and hooked up my Sega CDX to the oscilloscope. This is from Super Street Fighter 2.

post-13069-0-78309000-1504573172_thumb.png

It's been a minute (almost a year) since I was tinkering with this last, but I think I wasn't completing the secret knock correctly. Here, it's a long low select pulse, followed by 2 short pulses, and the final long pulse.

 

More to come. Now I've got to clear the desk and reconnect my 800XL.

 

Sorry for the delay, guys. :(

  • Like 2
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...