Jump to content
RevEng

rom hacks to support 2 buttons with genesis controllers

Recommended Posts

Continuing my work from the defender 2-button hack thread, I've hacked a few more games for 2 button support with the Genesis controller. (buttons B and C)

 

Many thanks to all of you who made game suggestions so far! If anybody else has any suggestions for games that would make good use of the second fire button, feel free to let us know.

 

Converted games...

Homebrew games with Genesis controller 2-button support...Genesis 2600 control tester...FAQs...
  • Where do I get a controller that works with these hacks? You can follow nems' instructions to build a second button into a regular Atari joystick, get a used genesis controller, or you can pick a 3rd party new genesis-compatible controller from Deal Extreme for less than $5 shipped. (review here.)
  • Do these hacks work with 7800 2-button controllers? No, unfortunately the 2600 isn't wired for 7800 2-button support.
  • Why does the Harmony menu not work with my Genesis controller plugged in? It thinks you have paddles plugged in - to override this, make sure you're using the latest Harmony firmware, and hold down the genesis "B" button while you turn the Atari on. You can also clip the wire from pin 5 inside the controller, and you won't have to hold down the button for Harmony. (pin 5 info courtesy nems)
  • How is the sega controller read by the 2600? Everything is the same as a regular 2600 joystick, except for button C which is read with INPT1, just as you'd read the regular INPT4 button. See the assembly example or the batari Basic example
  • How do I setup Genesis controller emulation in Stella? See this section at RT's site.
  • Like 8

Share this post


Link to post
Share on other sites

Sounds really neat. What's the appropriate controller to select in Stella to get this to work?

 

Also, how are you detecting the second fire button? Is it mapped to one of the INPTs?

 

As for suggestions, Asteroids would have to be at the top of the list: you could make the second button hyperspace and have joystick down turn on the shields.

 

--Will

Share this post


Link to post
Share on other sites

Awesome - thank you! Speaking of ROM hacks, I've greatly enjoyed the Omega Race one (up is thrust and fire 'shoots') as that one definitely needed it. I even have the Booster Grip, but it totally sucks to play with! lol

  • Like 1

Share this post


Link to post
Share on other sites

Will, I don't think there is any stella support for the genesis pad presently. Surprisingly, I don't think there were any 2600 games that used it before these.

The "b" button is the same as the regular joystick fire button, and the "c" button uses the second paddle. So you can read it through INPT1.

I think you need to set it up same as a paddle during VSYNC, but I'm not 100% sure on that.

The Asteroids suggestion is a good one. I considered it initially but discarded it because the joystick-down wasn't all that bad. But I like your combo-power idea!

Save2600, you're welcome!

Share this post


Link to post
Share on other sites

Will, I don't think there is any stella support for the genesis pad presently. Surprisingly, I don't think there were any 2600 games that used it before these.

 

The "b" button is the same as the regular joystick fire button, and the "c" button uses the second paddle. So you can read it through INPT1.

 

I think you need to set it up same as a paddle during VSYNC, but I'm not 100% sure on that.

 

The Asteroids suggestion is a good one. I considered it initially but discarded it because the joystick-down wasn't all that bad. But I like your combo-power idea!

 

Save2600, you're welcome!

VBLANK discharges the cap. The paddle is supposed to slowly charge this cap through its pot that runs to VCC. The joystick button also discharges the cap when pressed (or it should, if button C is like button B) so VBLANK shouldn't be needed.

 

There is one issue though. A regular joystick button has a logic zero when pressed and floating otherwise. Also, VBLANK likely has an open drain output and there are no pullup resistors in the console, so it's not clear how the cap ever gets charged. Does the Sega controller have internal pullups? If not, I don't see how this second button could work reliably without modifications.

Edited by batari

Share this post


Link to post
Share on other sites

OK, do your hacks actually work with regular Atari 2-button controllers? I have one of these (was packed with Junior). But I don't think it will work since both buttons act as one on 2600 console. I don't have a clue how this is internally engineered though (2600 has both buttons as one and 7800 as 2 different).

 

AtariGamepad2.jpg

Edited by maiki

Share this post


Link to post
Share on other sites

There is one issue though. A regular joystick button has a logic zero when pressed and floating otherwise. Also, VBLANK likely has an open drain output and there are no pullup resistors in the console, so it's not clear how the cap ever gets charged. Does the Sega controller have internal pullups? If not, I don't see how this second button could work reliably without modifications.

I don't recall seeing any resistors last time I did a genesis-to-7800 mod, but there is a multiplexer chip to allow for the all the extra button inputs. Almost every input goes to it, so maybe its acting in that capacity somehow?

 

I do know that there are A8 games that use the technique, and I haven't seen any response issues or false triggers while playing.

 

@maiki: the hacks won't work with 7800 controllers. The 2600 lacks the hardware to use the second 7800 button.

Share this post


Link to post
Share on other sites

Edited the first post and added Asteroids, Solaris, and Star Voyager. Asteroids still uses the joystick-down power for whatever game variation you've selected, and always hyperspace for button C. That way its up to the player as to which dual power they want. (none, shields or flip)

 

That's probably it for the 2 button hacks; I started doing this for my own intellectual curiosity, and that's now satisfied. Looking at the download count I can see it wasn't wildly popular. :P

 

That said, I'll be adding optional genesis 2-button code to my own WIP homebrews, and invite other homebrewers to do the same, since it only costs a few bytes of rom space and hardly any cycles.

Share this post


Link to post
Share on other sites

I just opened mine up but sure enough, no resistors but only a glob of epoxy which contains the MUX. I'm not sure if it's a genuine Sega controller though.

 

Even a weak pullup effect, even if unintentional, may work (paddles have a 1M-ohm pot) but keep in mind that if the pullup effect is weak, the button response may be laggy (i.e. it will "think" it's held down longer than it really is, and rapid fire won't work very well.)

Share this post


Link to post
Share on other sites

According to this document, genesis gamepads have pull-up resistors so that they output a digital 1 when a button is not pressed.

 

[...]

Inside the controller is a small PC board which contains the 74HC157,

some 10K pull-up resistors and some bypass capacitors. The switches

are connected so when a switch is pressed (closed) it shorts its

output to ground, otherwise it's output is 5 volts (via the pull-up

resistors). One additional connection is a pull-up resistor on the

select line. If it is left unconnected it will be "pulled" high.

[...]

Share this post


Link to post
Share on other sites

So that means the three-button controllers should work fine. 10k should bring the logic level to 1 quickly.

 

However, the document also says this about six-button controllers (emphasis mine):

The three button controller description was just a preamble for the

six button controller. When you open up the six button controller,

you notice a bunch of differences in the circuit besides the three

new buttons. The simple one is the addition of a fourth button which

acts as a mode select and tells the controller to be compatible with

three button controller games. The ugly one is that the nice standard

HC157 has been replaced with a custom chip (a microcontroller, a GAL?)

and most of the pull-up resistors are gone.

 

Might be worth testing with a 6-button controller.

Share this post


Link to post
Share on other sites

I've actually been testing it with a 3rd-party 6-button controller all along. My 3 button Genesis pad was modded for my 7800 a while back, and the 3rd party pads are the only stock ones I own.

I've cracked them open in the past and again there weren't any resistors in sight, just the epoxy blob. Maybe the pull-ups are integrated with the mux or under the blob.

Share this post


Link to post
Share on other sites

I have modified my homebrew Gingerbread Man to allow for 2-button control. On the original game, you would move up to throw objects and sometimes I accidentally move up and throw when I don't mean to, and this will remedy that situation. Anyway, B is jump and C is throw. It's intended for play on a Harmony (note the file extension.)

Gingerbread Man SEGA-controller.zip

Edited by batari
  • Like 1

Share this post


Link to post
Share on other sites

Ok, here's something interesting. Your 2-button Gingerbread Man doesn't work with my 6-button controller.

[edit - resolved. See post below]

I took a look and saw that you used INPT0 instead of INPT1 like I was. I changed the INPT0 to INPT1 and things worked fine.

Does the INPT0 version work with your genesis controller? How about my posted INPT1 hacks?

Share this post


Link to post
Share on other sites

Ok, here's something interesting. Your 2-button Gingerbread Man doesn't work with my 6-button controller.

 

I took a look and saw that you used INPT0 instead of INPT1 like I was. I changed the INPT0 to INPT1 and things worked fine.

 

Does the INPT0 version work with your genesis controller? How about my posted INPT1 hacks?

Oh, oops. I initially did INPT0 before realizing it was INPT1 but the old version got posted instead. Luckily I was able to edit the post and upload the corrected version.

Share this post


Link to post
Share on other sites

Ah, I'm glad it was something mundane, rather than an incompatibility.

 

I've added a link to your Gingerbread Man post in the first post. I believe that's the first 2600 homebrew to have sega 2-button support!

 

I also tidied up that first post, and added a FAQ.

Share this post


Link to post
Share on other sites

How is the 2nd button read in code?

 

Maybe I could adapt Thrust to it. It already supports the Omega Booster Grip, so this should be no big problem.

Share this post


Link to post
Share on other sites

How is the 2nd button read in code?

 

Maybe I could adapt Thrust to it. It already supports the Omega Booster Grip, so this should be no big problem.

Just read INPT1 for button C just like you read INPT4 for the other button. No need to dump paddle ports.

Share this post


Link to post
Share on other sites

I'll take a look in the next few days. It's pretty easy to DIY; if you're interested I posted a short demo program.

 

Re Defender/Defender 2, if you wanted to get REALLY fancy:

 

C button alone = nothing

C + joystick left = hyperspace

C + joystick right = smart bomb

 

--Will

 

Dammit, stop with the intriguing ideas Will! ;)

Share this post


Link to post
Share on other sites

Another possible suggestion: Sea Hawk

 

Fire button launches an air-to-surface torpedo.

But to fire an air-to-air missile you have to move the stick left or right and then press the button.

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

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...