Jump to content



0

2-button games in bB - using sega genesis pads with the 2600


15 replies to this topic

#1 RevEng ONLINE  

RevEng

    River Patroller

  • 2,010 posts
  • bit shoveler
  • Location:Canada

Posted Mon Feb 22, 2010 7:52 PM

I threw together a quick little bB demo program that demonstrates how to read the B and C buttons on the Sega Genesis controller.

Why bother? 3rd party genesis pads can be had cheaply and they work without mods on the 2600, making them a popular choice for those of us that like gamepads. On top of that, they're trivial to support in your code.

Attached File  2buttonread.bas   2K   136 downloads
Attached File  2buttonread.bas.bin   4K   128 downloads

The program shows a red screen if the genesis controller was NOT detected, or a light-blue one if it WAS detected. Then pressing the B and C buttons will show up on the controller on the screen.

If anyone wants to see more proof-of-concepts, take a look at my 2-button hack thread which has a homebrew contribution from our very own batari.

Edited by RevEng, Tue Feb 23, 2010 2:15 PM.


#2 Random Terrain ONLINE  

Random Terrain

    Visual batari Basic User

  • 20,914 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Mon Feb 22, 2010 8:14 PM

It would be great to have an extra button, but how do we make it work using Stella?


Thanks.

#3 RevEng ONLINE  

RevEng

    River Patroller

  • 2,010 posts
  • bit shoveler
  • Location:Canada

Posted Mon Feb 22, 2010 8:22 PM

Yeah, stella is a sticking point. I'm kind of hoping that the 2-button hack thread prods Stephen into updating stella.

As a workaround until he does, you can skip the detection stuff in my demo. Then just use "INPT5" instead of "INPT1" as you're working, which will use the second joysick's button instead. This maps to "f" by default in stella.

Then when you're ready to test on real hardware, just search and replace INPT5 with INPT1 and rebuild.

Edited by RevEng, Mon Feb 22, 2010 8:25 PM.


#4 Random Terrain ONLINE  

Random Terrain

    Visual batari Basic User

  • 20,914 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Mon Feb 22, 2010 8:32 PM

View PostRevEng, on Mon Feb 22, 2010 8:22 PM, said:

Yeah, stella is a sticking point. I'm kind of hoping that the 2-button hack thread prods Stephen into updating stella.

As a workaround until he does, you can skip the detection stuff in my demo. Then just use "INPT5" instead of "INPT1" as you're working, which will use the second joysick's button instead. This maps to "f" by default in stella.

Then when you're ready to test on real hardware, just search and replace INPT5 with INPT1 and rebuild.
OK, I did that and mapped the second joystick fire button to another button on my USB controller:

mycontroller.jpg

Now I have two working fire buttons!

Thanks.

#5 RevEng ONLINE  

RevEng

    River Patroller

  • 2,010 posts
  • bit shoveler
  • Location:Canada

Posted Mon Feb 22, 2010 9:06 PM

No problem. Glad to help!

If anybody has any more questions on the genesis controllers, feel free to post them here.

#6 stephena ONLINE  

stephena

    Stargunner

  • 1,967 posts
  • Stella maintainer
  • Location:Newfoundland, Canada

Posted Tue Feb 23, 2010 6:25 AM

View PostRevEng, on Mon Feb 22, 2010 8:22 PM, said:

Yeah, stella is a sticking point. I'm kind of hoping that the 2-button hack thread prods Stephen into updating stella.

As a workaround until he does, you can skip the detection stuff in my demo. Then just use "INPT5" instead of "INPT1" as you're working, which will use the second joysick's button instead. This maps to "f" by default in stella.

Then when you're ready to test on real hardware, just search and replace INPT5 with INPT1 and rebuild.
I am still working on Stella, but I've had to take a break for the last few weeks due to exhaustion from other things. Not to mention that I'm just now starting to watch the Farscape box set I bought before Christmas (yes, I don't normally get to watch a movie until 2 months after I buy it). And as I'm finding the series extremely addictive, I still haven't gotten back to Stella. :)

There are quite a few fixes already in what will become Stella 3.1. However, I've torn out the old disassembler and integrated Distella, and it's all still a WIP. And I can't do a new release until it's back to the same functionality as before. However, I see no reason why a new controller can't be added to Stella.

As to the new controller, I have a few questions (probably already answered in this thread, but better to ask again for clarity):

1) It uses the normal joystick directions, correct?

2) There are two buttons, one the normal joystick button, and the other INPT5?

3) What should I name this new 'controller' (Stella identifies controllers by name, so I have to call it something).

#7 RevEng ONLINE  

RevEng

    River Patroller

  • 2,010 posts
  • bit shoveler
  • Location:Canada

Posted Tue Feb 23, 2010 7:03 AM

Take your time Stephen. Having a burned out Stella maintainer won't help anyone!

View Poststephena, on Tue Feb 23, 2010 6:25 AM, said:

As to the new controller, I have a few questions (probably already answered in this thread, but better to ask again for clarity):

1) It uses the normal joystick directions, correct?

2) There are two buttons, one the normal joystick button, and the other INPT5?

3) What should I name this new 'controller' (Stella identifies controllers by name, so I have to call it something).
1) correct

2) 2 buttons. One the normal joystick button, the other is INPT1. Yes, the paddle1 line. The INPT5 suggestion to RT was just a workaround for testing.

3) "sega genesis compatible" or similar will do, I think.

#8 stephena ONLINE  

stephena

    Stargunner

  • 1,967 posts
  • Stella maintainer
  • Location:Newfoundland, Canada

Posted Tue Feb 23, 2010 9:16 AM

View PostRevEng, on Tue Feb 23, 2010 7:03 AM, said:

Take your time Stephen. Having a burned out Stella maintainer won't help anyone!

View Poststephena, on Tue Feb 23, 2010 6:25 AM, said:

As to the new controller, I have a few questions (probably already answered in this thread, but better to ask again for clarity):

1) It uses the normal joystick directions, correct?

2) There are two buttons, one the normal joystick button, and the other INPT5?

3) What should I name this new 'controller' (Stella identifies controllers by name, so I have to call it something).
1) correct

2) 2 buttons. One the normal joystick button, the other is INPT1. Yes, the paddle1 line. The INPT5 suggestion to RT was just a workaround for testing.

3) "sega genesis compatible" or similar will do, I think.
OK, I just got this added to Stella. It took a little longer than I expected, as I was basing the code on the BoosterGrip stuff. What I didn't realize at first is that the logic is reversed compared to a BoosterGrip. I had to bypass your autodetection, and then I noticed the button was always being pressed. Once I reversed the logic, the autodetect and button works fine. I've tested with several of the 2-button ROMs, and everything is working fine so far.

I might be able to provide some test builds of Stella with this enabled, but keep in mind that other parts of the code (particularly the disassembler) are not completely working yet.

#9 RevEng ONLINE  

RevEng

    River Patroller

  • 2,010 posts
  • bit shoveler
  • Location:Canada

Posted Tue Feb 23, 2010 9:31 AM

Very cool! Thanks! :thumbsup:

#10 Random Terrain ONLINE  

Random Terrain

    Visual batari Basic User

  • 20,914 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Fri Feb 26, 2010 12:29 AM

I added this to the bB page:

http://www.randomter...s.html#2buttons

I'll update it when the new version of Stella is released.

#11 MausGames OFFLINE  

MausGames

    Dragonstomper

  • 851 posts
  • Location:MO, USA

Posted Fri Feb 26, 2010 9:36 AM

This is excellent; does a lot for potential nes/sms-to-2600 ports. I'd like to work this into the game I'm working on right now.

#12 RevEng ONLINE  

RevEng

    River Patroller

  • 2,010 posts
  • bit shoveler
  • Location:Canada

Posted Sun Jul 4, 2010 8:00 AM

View PostRandom Terrain, on Fri Feb 26, 2010 12:29 AM, said:

I added this to the bB page:

http://www.randomter...s.html#2buttons

I'll update it when the new version of Stella is released.
You can update it. The latest released version of Stella supports genesis controller emulation. :)

#13 Random Terrain ONLINE  

Random Terrain

    Visual batari Basic User

  • 20,914 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Sun Jul 4, 2010 11:11 AM

View PostRevEng, on Sun Jul 4, 2010 8:00 AM, said:

View PostRandom Terrain, on Fri Feb 26, 2010 12:29 AM, said:

I added this to the bB page:

http://www.randomter...s.html#2buttons

I'll update it when the new version of Stella is released.
You can update it. The latest released version of Stella supports genesis controller emulation. :)
Thanks. Is there something special you have to do to make the first program work in Stella as if you have the Sega controller hooked up?

Edited by Random Terrain, Sun Jul 4, 2010 11:52 AM.


#14 Random Terrain ONLINE  

Random Terrain

    Visual batari Basic User

  • 20,914 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Sun Jul 4, 2010 4:41 PM

Got the answer:

View Poststephena, on Sun Jul 4, 2010 2:57 PM, said:

You have to use the 'Genesis' controller with this ROM. To do so, go to Options -> Game Properties -> Controller, and set 'P0 Controller' to 'Sega Genesis'. Click OK, and then restart the ROM. The first button is tied to the normal joystick button, so it will be the Space key, left Control, or whatever you have that mapped to. The second button is tied to the BoosterGrip 'booster' button, which by default is the '5' key. This can be remapped if you like.


#15 jbs30000 OFFLINE  

jbs30000

    Moonsweeper

  • 459 posts

Posted Wed Jul 7, 2010 1:25 AM

What about multi-button PC joysticks or game pads? Sounds like it should be easy to use a Saitek or something like that.

#16 Nukey Shay OFFLINE  

Nukey Shay

    Sheik Yerbouti

  • 20,458 posts
  • Location:The land of Gorch

Posted Wed Jul 7, 2010 8:19 AM

The point is that the extra button works in programs without modifying any hardware. If you have a Sega pad and a 2600-compatable console, you are good to go.

BTW computers can read a Gemini stick's paddle without using the wye cable (IIRC, it reads as the second paddle). Is this true for the 2600 as well? If so, a stick+fire+paddle game should be possible to create.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users