Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: How to interface an ANALOG Race Drivin Shifter???  (Read 3700 times)

0 Members and 1 Guest are viewing this topic.

mark shaker

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 293
  • Last login:March 04, 2022, 09:27:06 pm
  • Oh Crikey!
    • Mark's Basement Arcade
How to interface an ANALOG Race Drivin Shifter???
« on: June 06, 2003, 02:39:16 pm »
Greetings,

I bought an NOS shifter to the deluxe Race Drivin game, which I intended to use in a Sit Down MAME cabinet I'm building (well ... customizing).

Anyway, much to my surprise the darn thing is analog. It doesn't have microswitches, it has 2 5K pots.

The shifter is gated. Race Drivin determines the gear by the joystick position:

1|3|X
-------
N|N|N
-------
2|4|R

I know how to substituite 100 K pots, and wire the thing to a joystick port.

But then what?

Could MAME correctly interpite a joystick position as a gear?

If not, is there any software than could translate a shift in joystick position to either a joystick button press or a keystroke???

Thanks for your help!

   - Mark

P.S. There also seems to be an electric magnet in the base of the shifter. Does anyone have any idea what that was used for?

 

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8190
  • Last login:August 18, 2025, 08:28:46 pm
  • The Bears Still Suck!
Re:How to interface an ANALOG Race Drivin Shifter???
« Reply #1 on: June 06, 2003, 03:21:57 pm »
Two ways, first the cheap but crappy way, just hook directly to the correct pins on the gameport.

The way I wuld do it, get a cheap usb joystick and take out it's pots.  many controlers have 100k pots, but calibration with 5k pots should probably be fine, I think.

u_rebelscum

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3633
  • Last login:April 21, 2010, 03:06:26 pm
  • You rebel scum
    • Mame:Analog+
Re:How to interface an ANALOG Race Drivin Shifter???
« Reply #2 on: June 06, 2003, 04:26:24 pm »
It looks like the racedrivin driver (scr/drivers/harddriv.c) is set up with an analog joystick as the shifter :) ;  your stick should be fine once you install it into windows.
Robin
Knowledge is Power

Xiaou2

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4136
  • Last login:Yesterday at 08:27:09 pm
  • NOM NOM NOM
Re:How to interface an ANALOG Race Drivin Shifter???
« Reply #3 on: June 06, 2003, 06:16:57 pm »

 The electromagnet was for locking the gears in place i believe.  most operators either disabled this... or it just broke and they never bothered to repair it.


StephenH

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 544
  • Last login:January 09, 2023, 06:15:45 am
  • I'm a llama!
Re:How to interface an ANALOG Race Drivin Shifter???
« Reply #4 on: June 08, 2003, 02:45:55 am »
You could certainly use the POT inputs, by swapping 5K for 100K, and connect to the PCs Game Port, or a USB based Analog input.

Also, you can build a A to D circuit, that would "turn on" digital outputs" at certain voltage levels.  Assuming the Race Drivin Shifter pattern is 3X3 (Reverse plus 1-4), as follows:

Assuming a +5V input to the pots, and the range the pots output was 0-5V, and assuming the "in gear areas" are symmetrical (as refered to pot positions), you would need three voltage comparators that turn on if the input voltage was between 0 and 1.66V, 1.67V and 3.33V and 3.33V and 5V, respectively per axis (6 comparators in all).

Assuming the top is 0V and the bottom is 5V on the Y axis, and the Left is 0V and the right is 5V on the X axis.   So, the voltage pattern of the gears is:

1st: When the X axis and Y axis  voltage is between 0V and 1.66V

2nd: When the X axis voltage is between 0V and 1.66V and the Y axis voltage is between 3.33V and 5V.

3rd: When the X axis voltage is between 1.67V and 3.33V and the Y sxis voltage is between 0V and 1.66V.

4th: When the X axis voltage is between 1.67V and 3.33V and the Y voltage between 3.33V and 5V.

Reverse:  When both the X and Y axis voltages are between 3.33V and 5V.

Neutral:  When the Y Axis voltage is between 1.67V and 3.33V.  The X Axis voltage does not matter.

Once you have these comparators for the correct voltages, you then connect their outputs with AND gates, as above, and connect these AND gate outputs to your "gear keys"


As for the magnet, it is a force feedback device to lock the shift position, if the clutch was not in.  To implement this, you would need to get the voltage, and connect your analog clutch's pot (the other side, as you want it to be energised when the clutch is OUT), to a MOSFET or relay, and then connect that output to it and a power source of the correct voltage and current for the magnet.    The other possibility is to modify the software to send this output or clutch position to the keyboard lights, or some time of parallel or USB port output, and connect the output to a relay or MOSFET controller, with the proper voltage and amperage power source.

mark shaker

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 293
  • Last login:March 04, 2022, 09:27:06 pm
  • Oh Crikey!
    • Mark's Basement Arcade
Re:How to interface an ANALOG Race Drivin Shifter???
« Reply #5 on: June 08, 2003, 08:47:09 am »

Stephen,

Thank you for pointing towards a good hardware solution.

I will have to read-up on "voltage comparators" to see how flexiable they are, because moving the shifter does not rotate the pot a full 270 degrees, so the resistance range is actually a much smaller than from 0K - 5K.

I am still hoping that someone has a software solution, as I know that all the necessary hardware is already in the PC's joystick ports. It's just a matter of reading and reacting to the data.

If I can't find a software solution, I will definatly go this route.  

Thanks again!


 - Mark



You could certainly use the POT inputs, by swapping 5K for 100K, and connect to the PCs Game Port, or a USB based Analog input.

Also, you can build a A to D circuit, that would "turn on" digital outputs" at certain voltage levels.  Assuming the Race Drivin Shifter pattern is 3X3 (Reverse plus 1-4), as follows:

Assuming a +5V input to the pots, and the range the pots output was 0-5V, and assuming the "in gear areas" are symmetrical (as refered to pot positions), you would need three voltage comparators that turn on if the input voltage was between 0 and 1.66V, 1.67V and 3.33V and 3.33V and 5V, respectively per axis (6 comparators in all).

Assuming the top is 0V and the bottom is 5V on the Y axis, and the Left is 0V and the right is 5V on the X axis.   So, the voltage pattern of the gears is:

1st: When the X axis and Y axis  voltage is between 0V and 1.66V

2nd: When the X axis voltage is between 0V and 1.66V and the Y axis voltage is between 3.33V and 5V.

3rd: When the X axis voltage is between 1.67V and 3.33V and the Y sxis voltage is between 0V and 1.66V.

4th: When the X axis voltage is between 1.67V and 3.33V and the Y voltage between 3.33V and 5V.

Reverse:  When both the X and Y axis voltages are between 3.33V and 5V.

Neutral:  When the Y Axis voltage is between 1.67V and 3.33V.  The X Axis voltage does not matter.

Once you have these comparators for the correct voltages, you then connect their outputs with AND gates, as above, and connect these AND gate outputs to your "gear keys"


As for the magnet, it is a force feedback device to lock the shift position, if the clutch was not in.  To implement this, you would need to get the voltage, and connect your analog clutch's pot (the other side, as you want it to be energised when the clutch is OUT), to a MOSFET or relay, and then connect that output to it and a power source of the correct voltage and current for the magnet.    The other possibility is to modify the software to send this output or clutch position to the keyboard lights, or some time of parallel or USB port output, and connect the output to a relay or MOSFET controller, with the proper voltage and amperage power source.

StephenH

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 544
  • Last login:January 09, 2023, 06:15:45 am
  • I'm a llama!
Re:How to interface an ANALOG Race Drivin Shifter???
« Reply #6 on: June 08, 2003, 01:30:58 pm »
If it does not rotate the pots fully, modify the above voltages, with the correct "High" and "Low" points, and divide by 3.   You can connect a voltmeter to the Pots, and shift to different positions, and read the X and Y voltages, and modify the comparators accordingly.

u_rebelscum

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3633
  • Last login:April 21, 2010, 03:06:26 pm
  • You rebel scum
    • Mame:Analog+
Re:How to interface an ANALOG Race Drivin Shifter???
« Reply #7 on: June 09, 2003, 12:56:08 am »
I am still hoping that someone has a software solution, as I know that all the necessary hardware is already in the PC's joystick ports. It's just a matter of reading and reacting to the data.

As mentioned earilier, you can hook the analog shifter to the computer as a normal analog joystick, and mame is already correctly set up for an analog joystick as the gear shift in race drivin.  No software hacks needed.  No hardware hacks besides the normal "attach an analog joystick" hack.

Also, mame already can take analog inputs and translate them into digital-like inputs.  The "switching point" can be adjusted by increasing/decreasing the "a2d_deadzone" setting in mame.ini or mame32.  So no need for the hardware circuit mentioned above for mame.  Other emus, I don't know, but mame is already set up for analog gear (joystick) inputs for games originally with digital gear shifts.  (err, if mame didn't simulate the original momentary switch as a toggle switch for easy keyboard use.)

If you have an analog joystick, test the above out, with the analog stick mapped to the gear shift.
Robin
Knowledge is Power

mark shaker

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 293
  • Last login:March 04, 2022, 09:27:06 pm
  • Oh Crikey!
    • Mark's Basement Arcade
Re:How to interface an ANALOG Race Drivin Shifter???
« Reply #8 on: June 10, 2003, 07:26:04 pm »

Please correct me if I'm wrong, but I think that this solution only works with Hard Drivin and Race Drivin, as they seem to be the only games set-up for an Analog Shifter.

Ex: How could I set-up Sprint or Drag Race to shift to 3 gear when the analog shifter moved from any position to the top right corner?

If I shift from 1'th to 3'rd the movement is -X then +Y, +X.
If I shift from 2'nd to 3'rd the movement is +X, +Y.    
If I shift from 4'th to 3'rd the movement is "no X", -Y.  
 
   - Mark


Also, mame already can take analog inputs and translate them into digital-like inputs.  The "switching point" can be adjusted by increasing/decreasing the "a2d_deadzone" setting in mame.ini or mame32.  So no need for the hardware circuit mentioned above for mame.  Other emus, I don't know, but mame is already set up for analog gear (joystick) inputs for games originally with digital gear shifts.  (err, if mame didn't simulate the original momentary switch as a toggle switch for easy keyboard use.)

u_rebelscum

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3633
  • Last login:April 21, 2010, 03:06:26 pm
  • You rebel scum
    • Mame:Analog+
Re:How to interface an ANALOG Race Drivin Shifter???
« Reply #9 on: June 10, 2003, 11:25:42 pm »
Sprint and Drag Race should be fine.  (I'll assume normal, non-reveresed POTs of X- = left and Y- = up, and going by the drawing on your first post.)  Using ctrlr ini of the old [tab] way of remapping inputs, set:
  • game gear 1 to the device's first gear position (looks like joy X- and joy Y-),
  • game gear 2 to device second gear position (looks like joy X- and joy Y-)
  • game gear 3 to device third gear position (looks like joy Y- not joy X- not joy X+)
  • game gear 4 to device forth gear position (looks like joy Y+ not joy X- not joy X+)
Notice only the position matters, not the relative movement, as far as the device's inputs are concerned.  If the original game had an engine die (or something) with a 1st to 4th gear shift, the ROM will know what to do; mame does not worry about that.

BTW, netural in drag race looks a little harder to map.  I think a "gas pedal/button not joy Y- not joy Y+ OR joy X+ not joy Y- not joy y+ OR joy X- not joy Y- not joy y+" will work, but IIRC there's a limit of eight stuff mapped to one input.  :-\  In which case "joy X+ not joy Y- not joy y+ OR joy X- not joy Y- not joy y+" should be okay.

Again noting from my past post, you might need to adjust (increase most likely) the a2d_deadzone setting (in mame.ini for mame or controller tab setting in mame32) so the game doesn't shift too early or late.

Please correct me if I'm wrong, but I think that this solution only works with Hard Drivin and Race Drivin, as they seem to be the only games set-up for an Analog Shifter.

Ex: How could I set-up Sprint or Drag Race to shift to 3 gear when the analog shifter moved from any position to the top right corner?

If I shift from 1'th to 3'rd the movement is -X then +Y, +X.
If I shift from 2'nd to 3'rd the movement is +X, +Y.    
If I shift from 4'th to 3'rd the movement is "no X", -Y.  
 
   - Mark


Also, mame already can take analog inputs and translate them into digital-like inputs.  The "switching point" can be adjusted by increasing/decreasing the "a2d_deadzone" setting in mame.ini or mame32.  So no need for the hardware circuit mentioned above for mame.  Other emus, I don't know, but mame is already set up for analog gear (joystick) inputs for games originally with digital gear shifts.  (err, if mame didn't simulate the original momentary switch as a toggle switch for easy keyboard use.)
Robin
Knowledge is Power

Wade

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1639
  • Last login:August 18, 2025, 08:14:20 am
  • 80's Child
    • Wade's Gameroom
Re:How to interface an ANALOG Race Drivin Shifter???
« Reply #10 on: June 11, 2003, 10:23:05 am »
On a related note... Race/Hard drivin' are REALLY slow on my notebook.  Haven't tried it on my Mame arcade yet (much more trouble to set up games on that, I only do it after I'm sure the game will run correctly and with my existing controls).

Do I just need more processor or do I need to do something to the settings?  Machine is a P3 1ghz.  I used the Aaron Giles control setup file for it.

Thanks,
Wade

mark shaker

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 293
  • Last login:March 04, 2022, 09:27:06 pm
  • Oh Crikey!
    • Mark's Basement Arcade
Re:How to interface an ANALOG Race Drivin Shifter???
« Reply #11 on: June 11, 2003, 07:57:30 pm »
Robin,

Thank you.  I finally get it!

With luck I'll have my driving MAME Cabinet operational this weekend, and I'll start fooling around with the Stick Shift next weekend,

   - Mark

  • game gear 1 to the device's first gear position (looks like joy X- and joy Y-),
  • game gear 2 to device second gear position (looks like joy X- and joy Y-)
  • game gear 3 to device third gear position (looks like joy Y- not joy X- not joy X+)
  • game gear 4 to device forth gear position (looks like joy Y+ not joy X- not joy X+)

mark shaker

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 293
  • Last login:March 04, 2022, 09:27:06 pm
  • Oh Crikey!
    • Mark's Basement Arcade
Race Drivin Frame Rate
« Reply #12 on: June 11, 2003, 08:04:13 pm »


My experience is similar to Wade's.  Race Drivin, Hard Drivin and Crusi'n USA all seem to operate at about 1 frame a second on my machine.  (1.2 GHZ AMD w/ TNT 64 Video).

Is there currently any way to make these games playable?

   - Mark  


On a related note... Race/Hard drivin' are REALLY slow on my notebook.  Haven't tried it on my Mame arcade yet (much more trouble to set up games on that, I only do it after I'm sure the game will run correctly and with my existing controls).

Do I just need more processor or do I need to do something to the settings?  Machine is a P3 1ghz.  I used the Aaron Giles control setup file for it.

Thanks,
Wade

AX

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 188
  • Last login:April 20, 2004, 02:07:53 pm
  • The only way to win is to cheat!
Re:How to interface an ANALOG Race Drivin Shifter???
« Reply #13 on: June 11, 2003, 09:34:09 pm »
same thing on my 2 ghz.  They aren't finished works yet i don't think.

u_rebelscum

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3633
  • Last login:April 21, 2010, 03:06:26 pm
  • You rebel scum
    • Mame:Analog+
Re:Race Drivin Frame Rate
« Reply #14 on: June 12, 2003, 02:33:44 am »
On a related note... Race/Hard drivin' are REALLY slow on my notebook.  Haven't tried it on my Mame arcade yet (much more trouble to set up games on that, I only do it after I'm sure the game will run correctly and with my existing controls).

Do I just need more processor or do I need to do something to the settings?  Machine is a P3 1ghz.  I used the Aaron Giles control setup file for it.

Thanks,
Wade


My experience is similar to Wade's.  Race Drivin, Hard Drivin and Crusi'n USA all seem to operate at about 1 frame a second on my machine.  (1.2 GHZ AMD w/ TNT 64 Video).

Is there currently any way to make these games playable?

   - Mark  

There's not that much you can do:

a) buy a 4 ghz cpu (for crusin')  I would have said 2 ghz cpu for hard/race drivin', except AX just said his 2 ghz was slow.
b) Turn off frame skip


FWIW, before the crusin' games came out in mame, hard drivin's hardware was one of the most demanding drivers in mame (actually, stun runner & race drivin were the more demanding, but they use the same hardware).  5 "cpu"s + 2 (or 3) sound chips, for a minimum of 7 pretty heavy chips to emulate (see system16.com for more info).  No surprise you need a fast cpu to run them.
Robin
Knowledge is Power

StephenH

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 544
  • Last login:January 09, 2023, 06:15:45 am
  • I'm a llama!
Re:How to interface an ANALOG Race Drivin Shifter???
« Reply #15 on: June 13, 2003, 12:58:29 am »
You need this amount of power:

2Ghz for Hard Drivin (68010, ADSP-2100, 2xTMS34010, 68000, TMS32010).

3Ghz for Race Drivin (68010, ADSP-2100, TMS34010, DSP32C, 68000, TMS32010).

4Ghz for Crusin USA (R3000 and a few others)