Jump to content

Photo

rom hacks to support 2 buttons with genesis controllers


152 replies to this topic

#1 RevEng OFFLINE  

RevEng

    River Patroller

  • 3,155 posts
  • bit player
  • Location:Canada

Posted Fri Feb 19, 2010 8:26 PM

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)

Much thanks to tkarner and xybot67 who made game suggestions so far. I'm looking at all of them, and will update this thread with my successes.

If anybody else has any suggestions for games that would make good use of the second fire button, feel free to let me 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.


#2 e1will OFFLINE  

e1will

    Moonsweeper

  • 345 posts

Posted Sat Feb 20, 2010 5:45 PM

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

#3 save2600 OFFLINE  

save2600

    Quadrunner

  • 7,793 posts
  • Location:WI

Posted Sat Feb 20, 2010 5:53 PM

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

#4 RevEng OFFLINE  

RevEng

    River Patroller

  • Topic Starter
  • 3,155 posts
  • bit player
  • Location:Canada

Posted Sat Feb 20, 2010 6:14 PM

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!

Edited by RevEng, Sat Feb 20, 2010 6:44 PM.


#5 RevEng OFFLINE  

RevEng

    River Patroller

  • Topic Starter
  • 3,155 posts
  • bit player
  • Location:Canada

Posted Sat Feb 20, 2010 6:15 PM

[edit - double post]



#6 thegoldenband OFFLINE  

thegoldenband

    River Patroller

  • 3,762 posts
  • Location:Long Island, NY

Posted Sat Feb 20, 2010 6:45 PM

Great thread, and great idea! One that came to mind immediately is Double Dragon -- a lot of the control issues in that game could be solved with an extra button.

#7 batari OFFLINE  

batari

    )66]U('=I;B$*

  • 6,454 posts
  • begin 644 contest

Posted Sun Feb 21, 2010 3:39 AM

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, Sun Feb 21, 2010 3:41 AM.


#8 maiki OFFLINE  

maiki

    Dragonstomper

  • 531 posts

Posted Sun Feb 21, 2010 4:25 AM

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

Posted Image

Edited by maiki, Sun Feb 21, 2010 4:38 AM.


#9 RevEng OFFLINE  

RevEng

    River Patroller

  • Topic Starter
  • 3,155 posts
  • bit player
  • Location:Canada

Posted Sun Feb 21, 2010 7:06 AM

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.

#10 RevEng OFFLINE  

RevEng

    River Patroller

  • Topic Starter
  • 3,155 posts
  • bit player
  • Location:Canada

Posted Sun Feb 21, 2010 8:32 AM

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.

#11 batari OFFLINE  

batari

    )66]U('=I;B$*

  • 6,454 posts
  • begin 644 contest

Posted Sun Feb 21, 2010 1:09 PM

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

#12 alex_79 OFFLINE  

alex_79

    Moonsweeper

  • 372 posts
  • Location:Italy

Posted Sun Feb 21, 2010 1:47 PM

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



#13 batari OFFLINE  

batari

    )66]U('=I;B$*

  • 6,454 posts
  • begin 644 contest

Posted Sun Feb 21, 2010 3:38 PM

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.

#14 RevEng OFFLINE  

RevEng

    River Patroller

  • Topic Starter
  • 3,155 posts
  • bit player
  • Location:Canada

Posted Sun Feb 21, 2010 3:43 PM

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.



#15 batari OFFLINE  

batari

    )66]U('=I;B$*

  • 6,454 posts
  • begin 644 contest

Posted Sun Feb 21, 2010 7:57 PM

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

Attached Files


Edited by batari, Sun Feb 21, 2010 11:09 PM.


#16 RevEng OFFLINE  

RevEng

    River Patroller

  • Topic Starter
  • 3,155 posts
  • bit player
  • Location:Canada

Posted Sun Feb 21, 2010 9:30 PM

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?

Edited by RevEng, Fri Feb 26, 2010 5:30 AM.


#17 batari OFFLINE  

batari

    )66]U('=I;B$*

  • 6,454 posts
  • begin 644 contest

Posted Sun Feb 21, 2010 11:09 PM

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.

#18 RevEng OFFLINE  

RevEng

    River Patroller

  • Topic Starter
  • 3,155 posts
  • bit player
  • Location:Canada

Posted Mon Feb 22, 2010 7:02 AM

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.

#19 PacManPlus OFFLINE  

PacManPlus

    River Patroller

  • 4,055 posts
  • Atari 7800 Dev
  • Location:SouthWest Florida

Posted Mon Feb 22, 2010 7:59 AM

Defender Arcade? :sad:

http://www.atariage....-much-complete/

#20 e1will OFFLINE  

e1will

    Moonsweeper

  • 345 posts

Posted Mon Feb 22, 2010 10:03 AM

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

#21 Thomas Jentzsch OFFLINE  

Thomas Jentzsch

    Thrust, Jammed, SWOOPS!, Boulder Dash

  • 18,591 posts
  • Always left from right here!
  • Location:Düsseldorf, Germany

Posted Mon Feb 22, 2010 10:24 AM

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.

#22 batari OFFLINE  

batari

    )66]U('=I;B$*

  • 6,454 posts
  • begin 644 contest

Posted Mon Feb 22, 2010 11:09 AM

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.

#23 RevEng OFFLINE  

RevEng

    River Patroller

  • Topic Starter
  • 3,155 posts
  • bit player
  • Location:Canada

Posted Mon Feb 22, 2010 8:31 PM

Defender Arcade? :sad:

http://www.atariage....-much-complete/

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! ;)

#24 tkarner OFFLINE  

tkarner

    Moonsweeper

  • 338 posts

Posted Mon Feb 22, 2010 9:48 PM

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.

#25 maiki OFFLINE  

maiki

    Dragonstomper

  • 531 posts

Posted Tue Feb 23, 2010 6:53 AM

I'd like to see an interface that would use both Atari gamepad buttons. You could simply plug this in both ports.




0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users