The NEW Build Your Own Arcade Controls

Main => Main Forum => Topic started by: BadMouth on October 19, 2010, 02:51:07 pm

Title: The Riddle of the 4-way Shifter (solution posted)
Post by: BadMouth on October 19, 2010, 02:51:07 pm
****SPOILER ALERT****  solution (mine anyway) has been posted on down the page.

I think I got this figured out (good use of work time), but haven't tested it yet.
I think it makes an excellent brain teaser.  
Anyone else care to give it a shot?

I have a 4-speed shifter (H pattern) that utilizes 3 microswitches.
Each switch has 3 terminals; In, Normally Open, & Normally Closed.
One on each side registers whether the shifter is forward or backwards (both do this).
One on the front registers whether the shifter is to the left or right.

I need to wire it in such a way that it will register a button press for each gear.
It must be able to work with a pad hack, keyboard encoder, or any other interface.
It all must be done with the wiring to these switches.  No extra relays, no scripts, etc.
If you've done this before, acknowledge it, but don't post the answer just yet.

(http://farm5.static.flickr.com/4110/5096925957_1e25ea38a7.jpg)


Title: Re: The Riddle of the 4-way Shifter
Post by: lilshawn on October 19, 2010, 02:56:21 pm
i know, did you want an answer now, or later? :D

if i think hard, i might be able to do it with 2 switches.
Title: Re: The Riddle of the 4-way Shifter
Post by: BadMouth on October 19, 2010, 03:02:48 pm
 :cheers: Later.
I thought others might enjoy working it out.

I had a hard enough time doing it with 3 switches.
Not sure I want to attempt 2, but now you got me thinking.

Maybe it doesn't take so much to tease my brain.  :o
Title: Re: The Riddle of the 4-way Shifter
Post by: RayB on October 19, 2010, 03:40:23 pm
The way the shifters work in arcade games is that if NONE of the buttons are pressed, that means it's in 1st gear. That probably won't work for MAME and you'll need to rig in a 4th switch.

Other than that, just ignore the NC tabs and wire it all up like you would any other button
Title: Re: The Riddle of the 4-way Shifter
Post by: BadMouth on October 19, 2010, 03:57:18 pm
The way the shifters work in arcade games is that if NONE of the buttons are pressed, that means it's in 1st gear. That probably won't work for MAME and you'll need to rig in a 4th switch.

Other than that, just ignore the NC tabs and wire it all up like you would any other button


That is the way it's wired for the arcade machine, but there is a way for MAME (or other emulator, or a console) that uses only the three switches already there.
Title: Re: The Riddle of the 4-way Shifter
Post by: saint on October 19, 2010, 04:04:19 pm
Yep, not too hard. Do we PM you the answer? :)
Title: Re: The Riddle of the 4-way Shifter
Post by: BadMouth on October 19, 2010, 04:09:41 pm
Yep, not too hard. Do we PM you the answer? :)

Nah.  I have the above pic done up with the answer (or what I believe to be the answer).
I was gonna wait a while before posting it, but it doesn't seem to be much of a challenge for some of you.  ;D
Title: Re: The Riddle of the 4-way Shifter
Post by: saint on October 19, 2010, 04:57:53 pm
Yep, not too hard. Do we PM you the answer? :)

Nah.  I have the above pic done up with the answer (or what I believe to be the answer).
I was gonna wait a while before posting it, but it doesn't seem to be much of a challenge for some of you.  ;D

Let it run for a while. Just because I think I know doesn't mean I'm right since I haven't done it :)
Title: Re: The Riddle of the 4-way Shifter
Post by: Xiaou2 on October 19, 2010, 05:03:44 pm
Actually, many arcade 4way shifters have 4 switches.

Title: Re: The Riddle of the 4-way Shifter
Post by: RayB on October 19, 2010, 05:07:47 pm
Sorry, i didnt realize this thread was a "puzzle".
Carry on...
Title: Re: The Riddle of the 4-way Shifter
Post by: BadMouth on October 19, 2010, 05:42:28 pm
Actually, many arcade 4way shifters have 4 switches.

I didn't know that.  Had a look at the Happ website and they all use 4 switches, even the Daytona USA replacement.   :o

The shifter I'm working with is from a Sega GT.  I'm assuming it's the same as what was used in most of the Model 2 driving games.
So...... the Happ ones from the Midway & Atari games may be more straightforward.
Title: Re: The Riddle of the 4-way Shifter
Post by: BadMouth on October 19, 2010, 06:54:16 pm
Here's what I came up with.
Haven't tried it in real life yet or checked the position of the switches against the real shifter, but here's the general idea:

(http://farm2.static.flickr.com/1077/5098130664_f0a7b5c4b8.jpg)

Is that what everyone else came up with?

One gear is always going to be triggered, so it will have to be disconnected when mapping keys.
After I make sure it works in real life, I'll add it to the driving cab thread.
Title: Re: The Riddle of the 4-way Shifter (solution posted)
Post by: RayB on October 19, 2010, 08:26:15 pm
With that idea, what is the 3rd switch for?
Title: Re: The Riddle of the 4-way Shifter (solution posted)
Post by: lilshawn on October 19, 2010, 08:31:19 pm
With that idea, what is the 3rd switch for?

it switches the ground connection between switch 1 and switch 2.
Title: Re: The Riddle of the 4-way Shifter (solution posted)
Post by: RayB on October 19, 2010, 09:33:53 pm
I dont see how that works. Switch 3 will be open whenever the shifter is in position 1 or 3 and closed in 2 or 4

Do the mechanics of the shifter allow for this?
Title: Re: The Riddle of the 4-way Shifter (solution posted)
Post by: BadMouth on October 19, 2010, 09:53:52 pm
I dont see how that works. Switch 3 will be open whenever the shifter is in position 1 or 3 and closed in 2 or 4

Do the mechanics of the shifter allow for this?


Yeah, there's a rod sticking out the sides of the shifter that activates/deactivates switches 1 and 2 simultaneously when you move it forward or backwards.
Gear 1 and 3 would both be activated at the same time if it weren't for switch #3 allowing only switch 1 or switch 2 (not both) from going to ground.
Switch 3 is activated by the left/right action of the shifter.

I stared at it for a while yesterday and didn't get anywhere.
Took a break from work today and it came to me.
Title: Re: The Riddle of the 4-way Shifter (solution posted)
Post by: BadMouth on October 19, 2010, 09:56:38 pm
Just re-read your post.  I might have misunderstood.
The switches aren't actually in the positions on the shifter as they are in the diagram.
It was just a diagram to draw the connections.

Switch 3 is closed when in 1st or 2nd gear and open when in 3rd or 4th gear.
Title: Re: The Riddle of the 4-way Shifter (solution posted)
Post by: ABACABB on June 25, 2012, 06:51:25 pm
Hey Badmouth - I have a question.  With this 3-switch shifter could you split the gears up between 2 different input devices so you would still have a neutral when no switches are pressed? 

For example:  1st and 2nd gear (with left/right switch open) to a USB gamepad and then 3rd and 4th gear (left/right switch closed) to buttons on a USB wheel?  I'm guessing this wouldn't work with pc games but emulators allow inputs from different devices.  So would this work?
Title: Re: The Riddle of the 4-way Shifter (solution posted)
Post by: BadMouth on June 26, 2012, 10:11:47 am
Hey Badmouth - I have a question.  With this 3-switch shifter could you split the gears up between 2 different input devices so you would still have a neutral when no switches are pressed? 

For example:  1st and 2nd gear (with left/right switch open) to a USB gamepad and then 3rd and 4th gear (left/right switch closed) to buttons on a USB wheel?  I'm guessing this wouldn't work with pc games but emulators allow inputs from different devices.  So would this work?

I'm having trouble coming up with a way that avoids having the leads from both interfaces connected to the same terminals, which I'm not comfortable with.
Adding a 2nd left/right switch upside down above the current one and running one of the ground wires through that so that nothing is grounded when the shifter is centered left to right would be much better IMO.
Title: Re: The Riddle of the 4-way Shifter (solution posted)
Post by: drventure on June 26, 2012, 10:48:06 am
Hey Badmouth - I have a question.  With this 3-switch shifter could you split the gears up between 2 different input devices so you would still have a neutral when no switches are pressed? 

For example:  1st and 2nd gear (with left/right switch open) to a USB gamepad and then 3rd and 4th gear (left/right switch closed) to buttons on a USB wheel?  I'm guessing this wouldn't work with pc games but emulators allow inputs from different devices.  So would this work?

I'm having trouble coming up with a way that avoids having the leads from both interfaces connected to the same terminals, which I'm not comfortable with.
Adding a 2nd left/right switch upside down above the current one and running one of the ground wires through that so that nothing is grounded when the shifter is centered left to right would be much better IMO.

Connecting the existing switches to a couple of optoisolators to drive separate inputs to your interfaces should also work, and might be easier if it proves difficult to mount a second switch on the shifter itself.
Title: Re: The Riddle of the 4-way Shifter (solution posted)
Post by: BadMouth on June 26, 2012, 11:03:45 am
Mounting another switch was easier than I expected.  The metal was surprisingly soft.
Drill the holes small and the screws will cut their own threads.
The switch costs a few bucks at radio shack.

IGNORE THE WIRING IN THIS PICTURE, AS IT'S WIRED FOR A MOMO WHEEL HACK WHICH WORKS DIFFERENTLY THAN MOST.
(http://forum.arcadecontrols.com/index.php?action=dlattach;topic=103207.0;attach=170320;image)
Title: Re: The Riddle of the 4-way Shifter (solution posted)
Post by: bkenobi on June 26, 2012, 11:22:25 am
That looks like cheap pot metal and should be really easy to drill.  The problem with it is that threads may strip quite easily.  Be very careful about over tightening or you'll have to come up with some kind of heli-coil solution.  For stripped holes in wood I use a toothpick.  I don't know a really good solution for metal other than a larger screw.
Title: Re: The Riddle of the 4-way Shifter (solution posted)
Post by: drventure on June 26, 2012, 11:38:31 am
Definitely simpler than an optoisolator circuit  :)

Damn, I so want to put together a driving cab....
Title: Re: The Riddle of the 4-way Shifter (solution posted)
Post by: RandyT on June 26, 2012, 01:21:23 pm

I realize that this may be cheating a bit, but if you are just concerned with MAME, the method below should work and it saves an input (and a switch.)

Assuming that I understand the mechanics correctly, and that the following is true;

GEAR 1: Switch 1 = Open AND Switch 3 = Closed
GEAR 2: Switch 1 AND Switch 3 = Closed
GEAR 3: Switch 1 AND Switch 3 = Open
GEAR 4: Switch 1 = Closed and Switch 3 = Open

Leave Switch 2 unconnected....

(http://groovygamegear.com/Shifter Wiring.jpg)
Title: Re: The Riddle of the 4-way Shifter (solution posted)
Post by: BadMouth on June 26, 2012, 02:12:02 pm

I realize that this may be cheating a bit, but if you are just concerned with MAME, the method below should work and it saves an input (and a switch.)

Assuming that I understand the mechanics correctly, and that the following is true;

GEAR 1: Switch 1 = Open AND Switch 3 = Closed
GEAR 2: Switch 1 AND Switch 3 = Closed
GEAR 3: Switch 1 AND Switch 3 = Open
GEAR 4: Switch 1 = Closed and Switch 3 = Open

Leave Switch 2 unconnected....

(http://groovygamegear.com/Shifter Wiring.jpg)

That could actually be made to work in Supermodel Model 3 emulator by manually modifying the cfg file.
(I have neutral mapped to no switches being pressed)

If it could be made to work in El Semi's model 2 emulator, you might have something there.  ;)

The only game I think might have issues with it in MAME is Hard Drivin' since it used a joystick.
A regular 4 speed shifter can be mapped to work just fine.
http://forum.arcadecontrols.com/index.php?topic=105961.msg1226703#msg1226703 (http://forum.arcadecontrols.com/index.php?topic=105961.msg1226703#msg1226703)

EDIT: Now that I look at it a bit more, your setup will also always have an input registering.

.
Title: Re: The Riddle of the 4-way Shifter (solution posted)
Post by: RandyT on June 26, 2012, 02:50:08 pm
Now that I look at it a bit more, your setup will also always have an input registering.

Did you want one of the gears to be a "default" gear when nothing is pressed?  Is a "Neutral" possible with a 1 of 4 shifter?  Just trying to understand the hardware and your goal.
Title: Re: The Riddle of the 4-way Shifter (solution posted)
Post by: BadMouth on June 26, 2012, 03:23:56 pm
Now that I look at it a bit more, your setup will also always have an input registering.

Did you want one of the gears to be a "default" gear when nothing is pressed?  Is a "Neutral" possible with a 1 of 4 shifter?  Just trying to understand the hardware and your goal.

Goal would be whatever works for ABACABB.

Hey Badmouth - I have a question.  With this 3-switch shifter could you split the gears up between 2 different input devices so you would still have a neutral when no switches are pressed? 

For example:  1st and 2nd gear (with left/right switch open) to a USB gamepad and then 3rd and 4th gear (left/right switch closed) to buttons on a USB wheel?  I'm guessing this wouldn't work with pc games but emulators allow inputs from different devices.  So would this work?
(my personal goal is for every driving game to be playable and feel correct on one cab. ;)  )

The big flaw of my solution was that one gear will always be registering, so some kind of disconnect or switch must be used when mapping other controls.
It was brilliant to take into account what could be done with the mapping in MAME and get it done with only 2 switches, but it has the same flaw.

The happ 4-speeds have 4 switches and nothing registers when they are centered.
That makes them simple to interface and set up in software.  It's no different than wiring 4 buttons.

The shifter I used and ABACABB is probably using is a Ketz brand from a Sega Model 3 cab.
People seem to end up with them when collecting parts for a driving cab, then end up switching to a Happ because it's simpler.
I like the feel of these shifters much better than Happ.  No reason they can't be used with a little modification.
Title: Re: The Riddle of the 4-way Shifter (solution posted)
Post by: ABACABB on June 26, 2012, 04:36:19 pm
Badmouth is correct in his assumption.  I have this Sega shifter with 3 switches but 4 gears.  I would like it to register neutral when no gears are pressed, just like a real shifter in a car.  I also agree with Badmouth that I like the feel of the Sega shifter better than the Happ 4 speed so I'd like to try to use this.  I actually have 2 of these shifters so I guess I'll be removing a switch from one and adding a 4th switch to another.

I still might try my previous idea where I use 2 different input devices.  I have a few cheapo gamepads lying around so if I burn one up I won't be too sad.  I understand where Badmouth said that I will have to share terminals from the shifter switches to input on the gamepads but they could have different grounds so it should still work right?
Title: Re: The Riddle of the 4-way Shifter (solution posted)
Post by: BadMouth on June 26, 2012, 04:52:11 pm
they could have different grounds so it should still work right?

Your guess is as good as mine when it comes to that.  :lol

I'd rather see you use a 4th switch and and hook it up to a keyboard encoder or the steering wheel hack already in use for the steering and pedals.
It would avoid headaches caused by multiple controllers when setting things up down the road.
Title: Re: The Riddle of the 4-way Shifter (solution posted)
Post by: RandyT on June 26, 2012, 07:05:28 pm
The big flaw of my solution was that one gear will always be registering, so some kind of disconnect or switch must be used when mapping other controls.
It was brilliant to take into account what could be done with the mapping in MAME and get it done with only 2 switches, but it has the same flaw.

There is no flaw in the wiring.  The problem is that, mechanically, there is no difference between 3rd gear and the switch states you desire for a true "neutral".  It can still be done with 3 switches, but would require re-location of the unused switch so that it would be activated at the center of the "H".  You would only need to run the ground for the entire group of switches through the "NC" of that switch first, so when it is activated, all the switches in the assembly go "dead".  Of course, unless the game supports a true neutral, it will just probably still just revert to 1st, or stay stuck in whatever the last gear was.

Might be easier to to go the "1 switch per gear" route.
Title: Re: The Riddle of the 4-way Shifter (solution posted)
Post by: BadMouth on July 25, 2012, 03:46:22 pm
For the benefit of people who may come accross this thread in a search,
RetroRepair posted a cool solution to his youtube channel a few weeks ago.
Sega shifter to USB Pad Hack or Microcontroller Decoder (http://www.youtube.com/watch?v=x0grHZs-vp4#ws)
(part # and pinouts are in the youtube description)

Copied and pasted from the youtube notes without permission  :P :
Check out his youtube channel!

Quote
So here I thought I'd show you guys my solution to wiring up a regular Sega shifter (should work with the Ketz shifters too) to a normal common ground USB pad hack or micro controller while keeping the original wiring of the cabinet intact.

I've been using it for a while and it works great, no lag at all!

If you want to try it yourself then here is the list of pinouts you'll need to get it working.

Use a 74LS138 to convert to 4 (or 5 if you want neutral) outputs for a normal USB game pad hack/microcontroller

74LS138 pins:

1 - Shifter Grey/Red wire
2 - Shifter Grey/Blue wire
3 - Shifter Grey/Yellow wire
4 - GND
5 - GND
6 - VCC
7 - neutral output (tie to 12)
8 - GND
9 - 2nd gear output
10 - 1st gear output
11 - NC
12 - neutral output (tie to 7)
13 - 4th gear output
14 - 3rd gear output
15 - NC
16 - NC

I'll add it to the shifter section of the driving cab thread when I get around to revamping it.
Title: Re: The Riddle of the 4-way Shifter (solution posted)
Post by: hiljak on July 21, 2014, 05:56:41 pm
FYI, the above is not the correct pinout. 

See here for basic pinout from chip data sheet.

http://circuits.datasheetdir.com/255/74LS138-pinout.jpg (http://circuits.datasheetdir.com/255/74LS138-pinout.jpg)
Title: Re: The Riddle of the 4-way Shifter (solution posted)
Post by: bsoder52 on June 08, 2022, 01:55:56 pm
Old string I know.  I'm considering building twin Daytona cabs from scratch and running PCs. I have a G27 I was initially considering for the build but probably want to go with a Sega or Happ 4way H shifter after some consideration. Curious if this mod here is the best yet to get that accomplished?  Thanks for the help!
Title: Re: The Riddle of the 4-way Shifter (solution posted)
Post by: PL1 on June 08, 2022, 03:03:54 pm
Old string I know.  I'm considering building twin Daytona cabs from scratch and running PCs. I have a G27 I was initially considering for the build but probably want to go with a Sega or Happ 4way H shifter after some consideration. Curious if this mod here is the best yet to get that accomplished?  Thanks for the help!
Fancy way:
Baritonomarchetto designed a PCB  for the 74__138 IC and posted the Gerber files in reply #13 (http://forum.arcadecontrols.com/index.php/topic,164398.msg1731796.html#msg1731796) of his shifter thread.
- Lots of good info and discussion in that thread.   ;D

http://forum.arcadecontrols.com/index.php/topic,164398.0.html (http://forum.arcadecontrols.com/index.php/topic,164398.0.html)

(http://forum.arcadecontrols.com/index.php?action=dlattach;topic=164398.0;attach=386078;image)

Simple way:
Another option is to use a modified version of the wiring-only diagram from earlier in this thread.
If you want to add a "Neutral" switch and LED indicator to the wiring-only diagram, insert an SPDT switch between ground and switch 3 "IN". (COM)
- SPDT COM to ground.
- SPDT NC to switch 3 "IN".
- SPDT NO to LED, current limiting resistor, and 5v.

(https://farm2.static.flickr.com/1077/5098130664_f0a7b5c4b8.jpg)

Other way:
A third option is to use an Arduino.
- I don't recall if anyone has already done a sketch for this type of shifter.   :dunno
I could also develop the arduino code if of any interest for someone, just for reference


Scott