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: MAME Driver Patch for Hardware Gear Shift Support  (Read 15701 times)

0 Members and 1 Guest are viewing this topic.

Dmod

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 315
  • Last login:July 12, 2012, 06:50:45 pm
MAME Driver Patch for Hardware Gear Shift Support
« on: August 28, 2008, 12:37:25 pm »
I created a simple driver patch to incorporate use of a Happ 2-position (High/Low) Speed Shifter for games like pole position, outrun, and spy hunter, whose drivers, by default, use a single keypress to toggle the gear shift position.

The patch is attached below.  I'm releasing it here in case it may be of benefit to others.  It was created using the current drivers in Mame v0127 but it is likely useful for other versions as well.

HOW TO USE IT

This file can be used to modify the driver files in the main MAME distribution prior to compilation.  A simple way to use the patch is to apply it using HeadKaze's excellent Mame Compiler front end which can be found by searching the archives.  The Happ 2-position speed shifter uses only one switch.  The state of the switch controls the gear selection.  The modified drivers expect that "High Gear" is selected when the switch is closed (or for keyboards, when the button is pressed).  Otherwise "Low Gear" is selected.  For games which use "Forward" and "Reverse" gears, the "High Gear" position is mapped to "Reverse".  For each ROM file, you will need to configure your ingame options to map the "Gear Shift" input to your shift controller.

WHAT IT DOES

The patch modifies a number of driver files which use the "PORT_TOGGLE" macro for a single button gear shift controller.  The modified driver files and associated roms are listed below.  The PORT_TOGGLE macro is removed and PORT_NAME is modified to indicate "Gear Shift/Hi" or "Gear Shift/Reverse" to indicate the expected state of the shifter when the button is pressed or the switch is closed.  When the button is not pressed, the gear shifter will operate in the opposite state.  On some drivers, the port behavior is modified from ACTIVE_HIGH to ACTIVE_LOW (or vice-versa) so that the behavior of the gearshift button is consistent across all the modified drivers.

MODIFIED DRIVERS AND ROMS

changela.c       changela
chqflag.c        chqflag
gaelco2.c        wrally2
gaelco3d.c       speedup
grchamp.c    grchamp
mcr3.c           powerdrv, spyhunt, turbotag
mw8080bw.c       280zzzap, lagunar
namcos2.c        finallap, finallap3
overdriv.c       overdriv
polepos.c        polepos, topracra, polepos2
seagorun.c       outrun, toutrun
sega32.c         radr, slipstrm
segaybd.c        pdrift
turbo.c          turbo
tx1.c            buggybjr, tx1
undrfire.c       cbombers
wecleman.c       hotchase, wecleman
wrally.c         wrally
« Last Edit: August 28, 2008, 04:35:32 pm by Dmod »
My Projects:
Suspended Animation Scratch-built Cab
Driveshaft Arcade Seat Platform

Jakester

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 14
  • Last login:April 24, 2014, 03:14:02 pm
Re: MAME Driver Patch for Hardware Gear Shift Support
« Reply #1 on: May 11, 2009, 12:28:40 pm »
Does anyone have this patch file?  I was trying to download it and it says the file can't be read...or something like that. it sounds like the source file was removed on the web server.

Thanks!

Jakester

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 14
  • Last login:April 24, 2014, 03:14:02 pm
Re: MAME Driver Patch for Hardware Gear Shift Support
« Reply #2 on: May 11, 2009, 12:32:01 pm »
nevermind I found it on another computer I have.  If anyone wants it posted let me know.

Dmod

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 315
  • Last login:July 12, 2012, 06:50:45 pm
Re: MAME Driver Patch for Hardware Gear Shift Support
« Reply #3 on: May 11, 2009, 01:12:37 pm »
Hope it works for you.  If you have any problems with it, let me know. 
My Projects:
Suspended Animation Scratch-built Cab
Driveshaft Arcade Seat Platform

cmoses

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 718
  • Last login:July 27, 2023, 05:19:00 pm
Re: MAME Driver Patch for Hardware Gear Shift Support
« Reply #4 on: May 11, 2009, 08:20:06 pm »
I am not familar with this function.  Does it show on the screen what position the stick is in?  Any pictures?

Dmod

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 315
  • Last login:July 12, 2012, 06:50:45 pm
Re: MAME Driver Patch for Hardware Gear Shift Support
« Reply #5 on: May 12, 2009, 04:32:38 am »
I am not familar with this function.  Does it show on the screen what position the stick is in?  Any pictures?

No... nothing fancy like that.  All it does is change the driver interface to expect a two-state hardware switch to control the signal for the gear shift instead of a button that toggles the state of the control.

Many MAME drivers come from the MAME team designed to work with a keypress from a keyboard input.  To make life easier, they allow the keyboard to toggle the state of the control signal so that you don't have to hold the key down all the time to remain in high gear (for example).  By removing the PORT_TOGGLE, the control signal can be modified so that it is controlled by the current state of the switch instead of a stored toggle state.  Then the shifter can control the signal directly... in one position the signal is high and in the other it is low.


The patch needs to be applied prior to compiling the MAME source code.
« Last Edit: May 12, 2009, 04:43:10 am by Dmod »
My Projects:
Suspended Animation Scratch-built Cab
Driveshaft Arcade Seat Platform

Minwah

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7662
  • Last login:January 18, 2019, 05:03:20 am
    • MAMEWAH
Re: MAME Driver Patch for Hardware Gear Shift Support
« Reply #6 on: May 12, 2009, 06:26:33 am »
I did something similar but included all driving games whether they needed altering or not. Also fixed a few other inputs and standardised input labels etc. My latest is based on v0.125, although I did a seperate compile for TX1 more recently...

http://mamewah.mameworld.info/downloads.htm

Jakester

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 14
  • Last login:April 24, 2014, 03:14:02 pm
Re: MAME Driver Patch for Hardware Gear Shift Support
« Reply #7 on: May 12, 2009, 12:55:13 pm »
I applied the patch to latest mame release and it worked great!   I had to hand apply some of patches since the code had changed slightly. I think there were 4 or 5 patches that failed...but they are very easy to apply.
I do see a graphic on the lower right hand corner showing the position of the shift which I would expect is part of mame since it not part of the patch. I need to find out where the graphic is generated and reverse it since it is backwards for my gear shift.
I was playing outrun last night....now to get my pedals recognized properly. It seems they are backwards. I press the gas and it stops...perhaps I just need to reverse the ground and power so I don't need to change the configuration in mame.

Thanks dmod for your patch!!

Dmod

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 315
  • Last login:July 12, 2012, 06:50:45 pm
Re: MAME Driver Patch for Hardware Gear Shift Support
« Reply #8 on: May 12, 2009, 01:43:54 pm »
Unless you're running some custom UI, that graphic is probably part of the game and can't be modified.  If you are using a gear shift with a three terminal switch (like the Happ Hi/Lo), then one of the terminals is common and the other two control whether the switch appears "normally open" or "normally closed".

You can reverse the gear shift behavior by moving the wire that is connected to the normally open terminal to the normally closed terminal (or vice versa).
My Projects:
Suspended Animation Scratch-built Cab
Driveshaft Arcade Seat Platform

Ummon

  • Trade Count: (+13)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5244
  • Last login:June 09, 2010, 06:37:18 pm
Re: MAME Driver Patch for Hardware Gear Shift Support
« Reply #9 on: May 12, 2009, 05:19:01 pm »
Aaron added that shifter graphic a few versions back. As for the pedals, I think you can reverse the directions in mame.
Yo. Chocolate.


"Theoretical physics has been the most successful and cost-effective in all of science."

Stephen Hawking


People often confuse expressed observations with complaint, ridicule, or - even worse - self-pity.

sega_mad

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 284
  • Last login:July 09, 2015, 04:03:08 am
Re: MAME Driver Patch for Hardware Gear Shift Support
« Reply #10 on: August 11, 2011, 02:07:17 am »
Dmod,

I know this post is old, but if your still watching it, I just wanted to say a BIG thank you for the diff file. I followed Headkase's compiling instructions.....and it works perfect.

Many many thanks

 :cheers:

Dmod

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 315
  • Last login:July 12, 2012, 06:50:45 pm
Re: MAME Driver Patch for Hardware Gear Shift Support
« Reply #11 on: August 11, 2011, 02:28:11 am »
Dmod,

I know this post is old, but if your still watching it, I just wanted to say a BIG thank you for the diff file. I followed Headkase's compiling instructions.....and it works perfect.

Many many thanks

 :cheers:

Still watching!  Glad it worked for you.  :)
My Projects:
Suspended Animation Scratch-built Cab
Driveshaft Arcade Seat Platform

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9226
  • Last login:March 25, 2024, 08:10:48 pm
  • ...
Re: MAME Driver Patch for Hardware Gear Shift Support
« Reply #12 on: August 11, 2011, 08:45:25 am »
Thanks for bumping!  I had no idea this existed!
(will add to driving cab thread)

sega_mad

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 284
  • Last login:July 09, 2015, 04:03:08 am
Re: MAME Driver Patch for Hardware Gear Shift Support
« Reply #13 on: August 11, 2011, 03:17:30 pm »
Hi Badmouth.

No worries!!

It's outstanding!!. It makes the shift selector behave exactly like the original.

It's nice that I didn't have to ask any questions regarding compiling MAME  ;D

A brilliant little fix.

Thanks again for all your help

Sega_mad
« Last Edit: August 11, 2011, 03:31:26 pm by sega_mad »

Texasmame

  • No, no. He's in charge here.
  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1240
  • Last login:February 18, 2022, 05:28:39 pm
  • Ba, ba, boom!
Re: MAME Driver Patch for Hardware Gear Shift Support
« Reply #14 on: October 17, 2011, 11:46:17 pm »
Could someone do me a small favor?

I'm trying to get this diff file compiled but keep getting error messages.

I need it in MAME .99.

Here's a link to the source code:

http://mamedev.org/downloader.php?file=releases/mame099s.zip

Could someone be so kind as to compile it and link to the complete, compiled binary or email me it?

Thx!

Use:
b1bbet@aol.com  if emailing. . .

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9226
  • Last login:March 25, 2024, 08:10:48 pm
  • ...
Re: MAME Driver Patch for Hardware Gear Shift Support
« Reply #15 on: October 18, 2011, 04:53:11 pm »
I managed to make the change in a later version of MAME by copying and pasting the line from Dmod's diff file into the source code manually.
(I know nothing about diff files or coding & this was my first time compiling)

All you need to do is find the line in the driver source code that corresponds to the line in Dmod's diff file that has a - before it.
Replace it with the line from the diff file that has the + in front of it.
Only one line needs changed for most games. 
Each game may have its own section inside the driver, so you might have to repeat the change for each game.

If you get in there and start tinkering, it isn't hard to figure out.  The individual drivers aren't that big.
It will take a while if you plan to run all the games, but it might be your only option if you want to stick to a specific version.

I only did a few for the sake of testing.  I was waiting for v.144 before trying to do them all, but since recent versions have made some games run slower, I doubt I'll bother.  I'll just fix it for the few 270 degree wheel games that I have on my cab.

Texasmame

  • No, no. He's in charge here.
  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1240
  • Last login:February 18, 2022, 05:28:39 pm
  • Ba, ba, boom!
Re: MAME Driver Patch for Hardware Gear Shift Support
« Reply #16 on: October 18, 2011, 06:32:29 pm »
I managed to make the change in a later version of MAME by copying and pasting the line from Dmod's diff file into the source code manually.
(I know nothing about diff files or coding & this was my first time compiling)

All you need to do is find the line in the driver source code that corresponds to the line in Dmod's diff file that has a - before it.
Replace it with the line from the diff file that has the + in front of it.
Only one line needs changed for most games. 
Each game may have its own section inside the driver, so you might have to repeat the change for each game.

If you get in there and start tinkering, it isn't hard to figure out.  The individual drivers aren't that big.
It will take a while if you plan to run all the games, but it might be your only option if you want to stick to a specific version.

I only did a few for the sake of testing.  I was waiting for v.144 before trying to do them all, but since recent versions have made some games run slower, I doubt I'll bother.  I'll just fix it for the few 270 degree wheel games that I have on my cab.

I'm just doing this for Spy Hunter.  I take it that's the MCR3.c file that I'll have to edit?

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9226
  • Last login:March 25, 2024, 08:10:48 pm
  • ...
Re: MAME Driver Patch for Hardware Gear Shift Support
« Reply #17 on: October 18, 2011, 07:08:10 pm »
I'm just doing this for Spy Hunter.  I take it that's the MCR3.c file that I'll have to edit?

Yep, that's it.  The lines in the diff file above and below the + and - ones are there for reference to make sure you're in the right place.
That driver supports multiple games.

If you can locate the section for Spy Hunter, you probably only need to change the one line in that section.
To play it safe, you could do all 5.
« Last Edit: October 18, 2011, 07:22:54 pm by BadMouth »

Texasmame

  • No, no. He's in charge here.
  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1240
  • Last login:February 18, 2022, 05:28:39 pm
  • Ba, ba, boom!
Re: MAME Driver Patch for Hardware Gear Shift Support
« Reply #18 on: October 19, 2011, 07:53:18 pm »
Okay, thought my rig couldn't handle the newest MAME but it can if I use the command line version and not MAMEUI32, which is what I had been using.

So, gonna try a cut/paste of the necessary driver lines as suggested above, compile and see what happens. . .   :applaud:

EDIT:  HOT DAMN!  It worked!   :laugh:

Just did the cut/paste method then complied.  Using MALA for options setup, etc. as I prefer the GUI as opposed to the command line.

Thanks so much, all!

Attached is the updated MCR3.c file.  I updated the gear shift ONLY for Spy Hunter so now, it is automatically in low unless you press and HOLD the key - which is faithful to the arcade microswitch setup.
« Last Edit: October 19, 2011, 10:06:04 pm by Texasmame »

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9226
  • Last login:March 25, 2024, 08:10:48 pm
  • ...
UPDATED FOR MAME v144
« Reply #19 on: December 12, 2011, 11:02:01 pm »
I don't know how to make a diff patch, but I can copy and paste!  :P

Attached are the drivers for MAME v144 with Dmod's shifter changes made.
I also reversed the PORT_TOGGLE hack that was made more recently on the taito_z driver.

Copy these drivers into the driver folder in the MAME source code (overwrite the ones there), then compile.

I used Mr.Do's guide found here:
http://mrdo.mameworld.info/compile.html

While you're at it, you can apply the hi score/no nag diff to get rid of the "Not Working 100%" boxes on Virtua Racing, Chase Bombers, etc.
JUST DON'T GO REPORTING ISSUES TO MAMETESTERS WHEN THERE SHOULD BE A POPUP BOX TELLING  YOU THE GAME HAS ISSUES!!!!

I checked a few, but not all of the games to make sure the shifter was working correctly.
(pole postion, outrun, chase hq)
If a particular game isn't working properly, let me know and I'll see if I screwed up somewhere.
I'm sticking with v137 on my cab, so I won't be using these myself.
« Last Edit: December 12, 2011, 11:29:39 pm by BadMouth »

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9226
  • Last login:March 25, 2024, 08:10:48 pm
  • ...
Re: MAME Driver Patch for Hardware Gear Shift Support
« Reply #20 on: December 22, 2011, 06:43:26 pm »
Zero downloads of the modified drivers.  :-\

If having to compile was keeping you from trying it, here are already compiled v.144 binaries in both 32 & 64bit varieties:
http://www.megaupload.com/?d=OUGKTCHY
The only changes to these is the shifter fix.  They are otherwise vanilla MAME builds with nag boxes, etc.

Just put it in your mame folder and point your front-end toward it.
Or backup your original mame exe and rename this one mame.

brad808

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 818
  • Last login:May 22, 2023, 08:18:15 pm
Re: MAME Driver Patch for Hardware Gear Shift Support
« Reply #21 on: December 22, 2011, 10:47:41 pm »
Zero downloads of the modified drivers.  :-\

If having to compile was keeping you from trying it, here are already compiled v.144 binaries in both 32 & 64bit varieties:
http://www.megaupload.com/?d=OUGKTCHY
The only changes to these is the shifter fix.  They are otherwise vanilla MAME builds with nag boxes, etc.

Just put it in your mame folder and point your front-end toward it.
Or backup your original mame exe and rename this one mame.

I'm yet to setup mame in my cabinet but I'm sure this will be helpful. If I understand correctly each of the games listed used a single switch in the gear selector and this patch makes the games hold the gears in cases where the gear would normally revert back to either hi or lo when the key is released?

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9226
  • Last login:March 25, 2024, 08:10:48 pm
  • ...
Re: MAME Driver Patch for Hardware Gear Shift Support
« Reply #22 on: December 22, 2011, 11:54:56 pm »
If I understand correctly each of the games listed used a single switch in the gear selector and this patch makes the games hold the gears in cases where the gear would normally revert back to either hi or lo when the key is released?

(it's late.....having trouble conveying a simple explanation, but here's "something")

Not quite.  The original games used a single switch and would revert back to the default gear when that switch was released.
i.e. if the high gear switch wasn't pressed, it was assumed you were in low gear.  No switch needed for low gear=$ saved.

MAME currently has the  gear shift set as a TOGGLE.  Pressing a single button will toggle back and forth between hi and lo.
It makes it a lot easier for people using keyboards and gamepads, as they don't have to hold down a button to stay in high gear.

The problem is that a toggle doesn't work properly for people using real shifters.
People with original hi/lo shifters have to bump hi gear each time they want to toggle the gear...nothing like the way it originally worked.
Most end up adding a second switch to the lo gear side and mapping both switches to the single toggle input in MAME.  
This kinda works, but inevitably through not completing a shift or wrecking and the game restarting, hi and lo end up getting reversed.
It becomes confusing, especially for guests who don't understand what's going on.

Those of us using 4 speeds (or g27, etc) with a switch on every gear are pretty much in the same boat as those with 2 switches.

This patch removes the TOGGLE and lets the game function as it originally did.  It will not hold the gear if the switch is not engaged,
SO YOU MUST HAVE A SHIFTER THAT STAYS IN GEAR.

Basically, you map hi gear to hi on your shifter and that's it.  The game will default to Lo unless the high gear switch is engaged.

I have Hi gear mapped to 2nd on my 4 speed.  I shift to 1st for low gear (even though it's not mapped) and 2nd for high gear.
The shifter works just like the shifter did on the original games.  You shift to lo, it goes to lo.  You shift to hi, it goes to hi.  No confusion.

It's made a big difference in my enjoyment of these games, which is why I want other people with shifters to try it.
I can get a lot farther in Outrun now and have been playing games I overlooked before (like Chase Bombers and WEC Lemans).

EDIT: Just realized that you're using a sequential shifter that returns to center.  I'd forgot about that.
         You're better off sticking to the regular MAME build then and mapping both up and down to the single gear shift toggle input in MAME.

         I hope someone eventually takes enough interest in this issue to code a solution that works for everyone.
         It would be nice if you (and those who have paddle shifters) could have a separate input for hi and lo, and also have the gears latch.
         That way if you mess up and press hi again, it won't mess you up in the game by downshifting the way the current toggle would.
       
« Last Edit: December 23, 2011, 12:23:36 am by BadMouth »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MAME Driver Patch for Hardware Gear Shift Support
« Reply #23 on: December 23, 2011, 06:29:43 am »
I'm interested, and actually know how to do it, it's just a whole time factor thing. 

There never seems to be enough hours in the day.

brad808

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 818
  • Last login:May 22, 2023, 08:18:15 pm
Re: MAME Driver Patch for Hardware Gear Shift Support
« Reply #24 on: December 23, 2011, 04:52:22 pm »
Badmouth, thanks for all the good information as usual. I'm guessing I'll understand it a little better once I start setting up mame and decide from there what I plan on doing with my shifter. I guess it also depends on if Howard is able to come up with something that would work for sequential shifters. @Howard - would a simple pretty please be enough to get the ball rolling?  ;D

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MAME Driver Patch for Hardware Gear Shift Support
« Reply #25 on: December 25, 2011, 04:10:42 am »
Well this project would have to "get in line" unfortuantely. 

I've still got a pending release of mamehooker.... it'll add better support for force feedback wheels.  Then I've got the now ancient outrun drivers I have to modify and submit that'll add output support in mame.  I also got a new monitor for my main mame cab, which means it's overhaul time and a tablet, which spurned a micro project to upgrade the "info" format. 

Lots of stuff.... I'll get to it eventually.  The main problem is it wouldn't be a drop in piece of code, one would have to modify the driver of every single game with a shifter.    Perhaps I could do one or two games as a sample and submit it to mame dev?  And maybe I could get some of the other devs to help out.

I want to do it like they did the driver for 720.  Each shifter game should have a "driver configuration" option in the UI.  Your selections would be "toggle shifter", "dedicated shifter" and "hw original". 

Toggle shifter would toggle through all the gears via  a single input... this is how the hi/low shifters are currently setup, but I would like to expand this functionality to the 4+ gear shifters as well.  It's all coding... there isn't any reason not to. 

Dedicated Shifter would split each gear out to a seperate input, regardless of if the original game supported it.  This would be the best setting for pc shifters and speed paddles.  Again, it's just coding, there isn't anything special to add it in.

HW Original, would output the gearshift with the original hardware switches, so pole position would only remain in high gear if the shifter button is held... ect.  This is the reason I'm HOPING that such additions would be accepted.  MAME is all about preservation and yet the current input method for shifters is NOT arcade accurate.

Xiaou2

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4098
  • Last login:November 12, 2023, 05:41:19 pm
  • NOM NOM NOM
Re: MAME Driver Patch for Hardware Gear Shift Support
« Reply #26 on: December 25, 2011, 12:07:08 pm »
Quote
Toggle shifter would toggle through all the gears via  a single input... this is how the hi/low shifters are currently setup, but I would like to expand this functionality to the 4+ gear shifters as well.  It's all coding... there isn't any reason not to.
 

 I think the problem would be in downshifting.  You would have to always drop from last gear to 1st gear, rather than just one or two gears down.  Many games penalize you drastically if you drop too many gears. I believe Ridge Racer is one of them.

Dedicated Shifter - Im not sure what you mean by this one.  However, something to remember, is that there are several kinds of hardware shifters.  Many have different number of switches, some wired switches together to get states, and even analog shifters as well:


2 Gear Shifter

 1 Switch    :  Held on / Released
 2 Switches :  Separated Inputs
 2 Switches :  Center Sprung (which results in 3 possible states)

4 Position H-Shifter

 4 SW  :Hold down for State. In-Between(nothing pressed) = 5th state of Neutral
 2 SW  :Wired together for X & Y on/off states
 3 SW  :Wired X/Y, but with 3rd switch. (better neutral state ability?)

6 Position Shifter

 - Same as 4way above, but with more switches
 - Some may block off a gear, and use one position as a reverse. (5way)

Analog Shifters

 - The original Race Drivin / Hard Drivin, uses two pots to determine the gear.
The determination is in the game itself, and usually requires in-game calibration.

 The Analog Shifters are also being used by many Sim-Racers, hacking analog force feedback joysticks. The feedback making a simulation of the resistance of gear changes, and any other related forces in gearing.

 A big advantage in pot-based gearing, is superior durability.  Daytona USA microswitch based shifters were always breaking down in my Arcade, from switch failures. Where as the Race Drivin shifters were rock solid for years at a time.

ANALOG SLIDER

 - Not quite a Shifter... Afterburner uses a Center Sprung Throttle.
 - I dont recall any sequential slider gear shifters. However, there might be some, and they Could be made.

========

 Regardless of the many kinds of shifters out there... the biggest and most immediate problem is lack of ability to Hold down a state, due to the keyboard-hack driver situation.

 A simple "Arcade Shifter" switch/function could be used to change that, to switch between the hacked mame driver keyboard-pulse-switching, and the true arcade held-down method, of input.


 In the long haul, I think it would be better to tell mame what kind of controller you have... and the driver adapts to that controller type. Removing or graying out any options which are not needed.  (IE: Mame: I have a Spinner... so you can remove/hide/lock  'auto-centering'  options)

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MAME Driver Patch for Hardware Gear Shift Support
« Reply #27 on: December 25, 2011, 03:26:17 pm »
Analog shifters are indeed a problem, but they are a different animal anyway, the best way to do those is via the software that comes with the shifter.  Most logitec rigs, for example allow you to map a specific analog value to a keystroke. 

By dedicated shifter, I mean each shift position gets a dedicated input.  It has nothing to do with the hardware.

As for the toggle issue you are talking about, obviously on games with more than two gears you would need a toggle up and toggle down switch.  One scrolls through the gears in order, the other in reverse order.

You can hold down a state in mame just fine.  Mame accesses the keyboard at a very low level, so repeat rates are ignored.  I'm not sure what you mean by that.


Xiaou2

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4098
  • Last login:November 12, 2023, 05:41:19 pm
  • NOM NOM NOM
Re: MAME Driver Patch for Hardware Gear Shift Support
« Reply #28 on: December 25, 2011, 06:29:34 pm »
Quote
Analog shifters are indeed a problem, but they are a different animal anyway, the best way to do those is via the software that comes with the shifter.  Most logitec rigs, for example allow you to map a specific analog value to a keystroke.

 As far as I remember, there are programs to Map restrictions to analog sticks, that people have been using on the Ultimarc stick, and maybe others as well.  I think something similar could be done for Shifter mapping on any analog control.

 If for example, you want to use multiple analog controls, its far better to use an all-in-one encoder, such as the U-HID... rather than to hack apart 3 to 6 analog controllers.  As such, you wouldnt have any software to be able to be used for that purpose... unless Andy decided to release some. Same goes for other sticks that might not have all the needed output settings.

 Of course, analog shifters, besides in their natural state in Hard/Race Drivin... and those others that support them, are all I really care about.  Its just a nice option to be able to use that type of shifter on other games as well.  The HD shifter is one of the best made (durable), and greatest feeling shifters ever made.


Quote
By dedicated shifter, I mean each shift position gets a dedicated input.  It has nothing to do with the hardware.

 Ok. I think I get you.  The external nature -vs- the internal nature + the actual driver hackage... all leads up to a lot of confusion as to what things mean.

 To be clear... Do you mean "2 way 2 switch shifters" ?  Or 4 & 6 way shifters?

 If a single switch 2way shifter  operates 2 outputs, then how will things pan out?
As in that case, the case of most of our current problems... its not just the mapping problem.. but lack of a mapped toggle ability.


Quote
As for the toggle issue you are talking about, obviously on games with more than two gears you would need a toggle up and toggle down switch.  One scrolls through the gears in order, the other in reverse order.

 - That would work for paddle shifters, where the switch opens then closes immediately.  However, most 2way shifters use a single switch.  Even IF you had a 2 switch shifter... one switch is Always going to be on.  In that setup, there would be no way to cycle thru multiple gears in both directions.

 FYI, paddle shifters dont work well for many racing games.  The downshifting quickly after a crash is a PITA.  Where as a physical location based gear, is an instant thoughtless and swift single-move action.

Quote
You can hold down a state in mame just fine.  Mame accesses the keyboard at a very low level, so repeat rates are ignored.  I'm not sure what you mean by that.

 Ahh yeah, I meant that the current driver hacks do not allow correct interfacing.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MAME Driver Patch for Hardware Gear Shift Support
« Reply #29 on: December 26, 2011, 05:05:44 am »
I think you are confused.  You don't get a chioce of one of the three methods, all are available as an option. 

And no, you can't use a pole position shifter for any games other than games with a hi/low shifter, but that is a hardware fault, not a software one.  The point of the hw original setting would be if you happen to have a PP cab and you wish to mame it, the shifter would work.  A standard hi/low shifter would NOT be suitable for a generic mame cab. 

If terms of analog controls, I'm not suggesting you hack anything (although you could) I'm suggesting you buy a dedicated analog shifter.  Most of the nicer ones have removable shifting plates for various configurations and like I said, software that outputs keystrokes instead of an analog value.  There is really nothing stopping Andy and the others from writing software to do the same thing though..... It would be a simple firmwave change to have the devices read the analog values as normal but output keystrokes instead.  It might even be possible via pure software, but MAME is touchy about sending fake keystrokes. 

Regardless, it is doubtful that the mame team would accept a submission that supported analog values for digital inputs.  It's just a lot of translating code to add for a dedicated device.  Mame is all about being generic, unfortunately.

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9226
  • Last login:March 25, 2024, 08:10:48 pm
  • ...
Re: MAME Driver Patch for Hardware Gear Shift Support
« Reply #30 on: December 26, 2011, 10:56:29 am »
It has to start somewhere.

A simple fix for games that used Hi/Lo shifters is all most people really need.
Currently these games don't play properly with any type of shifter and that just sucks.

FWIW, I'd consider ditching the TOGGLE option altogether and just having two options:

1. HW Original.

2. Having separate latching inputs to Hi and Lo.  I think this would work better for people using a keyboard or gamepad anyway.
    (if you hit Hi while you're already in Hi, it wouldn't slow you down)
    It would also work perfectly for those using paddle or sequential shifters. 
    If someone wanted to take it farther, they could use these to cycle up and down through the gears on the 4 speed games.

I think if you did a couple drivers people would realize how much better these games play without the toggle and maybe somoene would take an interest in fixing the others.




Xiaou2

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4098
  • Last login:November 12, 2023, 05:41:19 pm
  • NOM NOM NOM
Re: MAME Driver Patch for Hardware Gear Shift Support
« Reply #31 on: December 26, 2011, 02:23:00 pm »
Ok, I understand what you mean now.

Quote
Toggle shifter would toggle through all the gears via  a single input... this is how the hi/low shifters are currently setup, but I would like to expand this functionality to the 4+ gear shifters as well.  It's all coding... there isn't any reason not to.

 Personally, I dont see the point in this mode.  For one, the toggle mode sucks on 2way shift games, and it would be even worse on 4,5 & 6 way games.  Because as stated, most of them will penalize you too much for going from 6 to 1. You will lose every time doing that crap.  And if you did it in a real race car, you would destroy the thing.
 
Quote
Dedicated Shifter would split each gear out to a seperate input, regardless of if the original game supported it.  This would be the best setting for pc shifters and speed paddles.  Again, it's just coding, there isn't anything special to add it in.

 This is what confused me.  When you say separates gears into individual inputs... you think of, for instance, having to press A for 1st, B for 2nd..etc.  When in fact, it seems now that you are talking about a 2 input paddle-shift mode.

 A 2 input paddle mode (cycle up gears, cycle down gears) is far superior to a single input cycle.  Its an Ok addition, for those who dont yet have a hardware shifter.

Quote
HW Original, would output the gearshift with the original hardware switches, so pole position would only remain in high gear if the shifter button is held... ect.  This is the reason I'm HOPING that such additions would be accepted.  MAME is all about preservation and yet the current input method for shifters is NOT arcade accurate.

 Then this mode would have to over-ride the other mode... because they do in fact work differently.

 The thing is... when you select hardware mode in one game... it could be completely different on another game.

 An example would be a game which has a 2way shifter wired up with 2 switches... but You only have a single switch 2way shifter.   There are other such examples, and this would create problems, needing several shifters just top be able to play all the games correctly.

 Its far better, IMO, to allow whatever hardware is available, to be able to utilize and control the game well.  Not just the keyboard players, and not just the originally switches/wired shifter.

 
 And furthermore, I agree with Badmouth, that for those with keyboards or gamepads, would prefer two inputs for 2-way shifting.  For one, It keep you from accidentally pressing shift too many times. For another, the game always starts in the correct gear. (no accidental toggle to switch gear positions on you, from a fresh game boot, or a saved-state boot)


 As for the comments about not wanting a shifter on a non-dedicated driver cabinet.. thats Opinion.  Many people enjoy playing multiple game types on one cab... and do dedicate many various controllers to do so.  For one, not everyone has enough money and space for multiple cabs.

 Admittedly, Id prefer Andy or others to make an advanced software / hardware gearing solution. That way things would work with any game, and not just mame ... should mame get the ability for analog translation patched up.  It might even interest the Sim-Racer crowds as well.

However, Its always nice to interface things without needing $300 in various encoders as well.  One can always start off basic & cheaply, then buy additional enhanced encoders when they have the extra money.


 And FYI - all the currently made off-the-store shelf multi-shifters Suck. They are cheap plastic crap, that will most likely break apart in a few yrs tops.  They simply dont hold a candle to a well made arcade shifter, or a well designed custom built mechanism.  The shelf-companies cut as many corners on quality as they can get away with.  Even besides the durability issues.. the hardware does not 'feel' right.
Which is why many racing Sim players spend oogles of money buying custom built controllers from small 'no-name' custom building companies.
« Last Edit: December 26, 2011, 02:34:56 pm by Xiaou2 »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MAME Driver Patch for Hardware Gear Shift Support
« Reply #32 on: December 29, 2011, 07:52:45 am »
god love you Xiaou2, you are still confused. 

What you are calling a dedicated shifter, I am calling the toggle shifter.... toggle up toggles from 1 to 2 to 3 to ect and back again once it reaches the top gear.  Toggle down toggles from  3 to 2 to 1 ect... again looping if you go to far.  This way if you have no choice you can use a 1 button toggle pushbutton, but you can also use a centered shifter or speed paddles with the same input system... basically I'm killing two birds with one stone.  The reason I call it a toggle shifter is because of the looping effect.  This would replace mame's current shifter method so if you used this setting you could still toggle from low to hi with a single button.  You don't have to, but you can.

Dedicated IS a single input for each gear. As in each gear gets a dedicated input.

Yes hardware original would be different for each game and yes it would be impossible to use this setting on a generic mame cab for all games without a ton of shifters.  This is why you wouldn't use this setting for a generic mame cab, you would use it for a dedicated one.  ;)  Say you have a pole position cab and the board is dead... you can put a pc in it and run mame with this setting and not have to hack up your shifter... that is ALL this setting is good for.  You obviously can't play hard-drivin or crusin usa on said cabinet anyway.  Btw those two games would have different input settings for hw original and if you mame those cabs, the shifters would work without hacking.  That is the point of that setting.


With all of that being said.... some of what badmouth is suggesting IS doable and there would be no reason not to do it that way, the main thing you've got to keep consistant for each setting is the number of inputs, not their usage. 

Toggle mode is always going to utilize two buttons, so on hi/lo game it would be possible to remove the looping function... but what you are forgetting is you also have the dedicated inputs for that function.  So you'll have dedicated hi and low buttons if you select that option. 

You guys are acting like it's set in stone anyway.  I'm jsut throwing ideas at the wall here.  ;)

Regarding the analog shifters... I know they are crap, but there isn't a generic arcade equivelent anyway.  If you want to go hardcore you use the guts of the cheap consumer level shifter and hack em.  ;)

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9226
  • Last login:March 25, 2024, 08:10:48 pm
  • ...
Re: MAME Driver Patch for Hardware Gear Shift Support
« Reply #33 on: December 29, 2011, 09:15:02 am »
Toggle mode is always going to utilize two buttons

Sorry Howard, but that one makes even me  :dizzy:
(I've followed fine up to there)

I associate TOGGLE with a single button that toggles ON/OFF.
That's the way MAME currently utilizes PORT_TOGGLE.

Maybe you could say "step mode" instead of toggle mode.
I'd refer to the shifter itself as a sequential shifter.

I understand that technically each button is a toggle and it may cycle through more than two states, but still.
Looping if going too far would be a horrible thing and partially defeat the purpose IMO.

Don't waste too much of your time on semantics.  ;)


« Last Edit: December 29, 2011, 10:50:50 am by BadMouth »

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9226
  • Last login:March 25, 2024, 08:10:48 pm
  • ...
Re: MAME Driver Patch for Hardware Gear Shift Support
« Reply #34 on: December 29, 2011, 10:50:27 am »
From an end user standpoint, the Hi/Lo shifters could be as simple as this in the menu:

Hi Gear
Lo Gear      
HW Hi Gear (doesn't latch)

It would involve more work to do, but a simpler interface for the end user could be:

Hi Gear
Lo Gear
(defaults to latching)

....and then have an option somewhere else to make the gears not latch.
(which would allow it to work with the original shifter)
This way the majority of users who know nothing about the original shifter won't be confused.

For the 4 speed games (sometime down the road), I'd just add Shift Up and Shift Dn as options.

1st Gear
2nd Gear
3rd Gear
4th Gear
Shift Up
Shift Dn

(all can be assigned and used simultaneously)
Gears would only latch if the Shift Up & Dn buttons are used.

Any more rambling will just be a rehash of previous threads that went nowhere.  :lol


« Last Edit: December 29, 2011, 10:54:41 am by BadMouth »

Xiaou2

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4098
  • Last login:November 12, 2023, 05:41:19 pm
  • NOM NOM NOM
Re: MAME Driver Patch for Hardware Gear Shift Support
« Reply #35 on: December 29, 2011, 11:42:04 pm »
Quote
What you are calling a dedicated shifter, I am calling the toggle shifter

 I think the problem here is that you are trying to use terminology that seems to make sense in the programatical perspective.  Not the end user perspective.

 The thing is.. in Arcade-Speak, 'Dedicated' is a term most often used to describe original or real..   such as a Dedicated Robotron.  Not a conversion, but a real factory made original Robotron.   We also tend to think of it as a term for original controllers.  Like a Dedicated 4way, Star Wars Yoke, Daytona Usa Shifter...etc.
(Not some generic controller or button/software hack)

 A dedicated shifter = real arcade hardware shifter


 As for "Toggle".. again, you are terming things in a way that seems to make sense for your end of things... but, the problem is... a real Arcade shifter toggles.  It goes from on to off.  Even '2-switch 2-ways' toggle (in the users eyes).  

 4,5 or 6 way shifters do not toggle. That more or less described as  "Sequential".
Sequential Shifters.

Quote
.... toggle up toggles from 1 to 2 to 3 to ect and back again once it reaches the top gear.

 You would NEVER want to "Cycle" (toggle isnt the correct term) gears from 1 to 6, then back from 6 to 1...ect.    

 Auto-Reversing and or Looping a Cycle is a horrible idea.  

 The only Auto-Cycle that works in some instances... is the 2 button paddle button shifts.  They cycle either up or down depending on button pressed, and stop at either highest or lowest gear.  Never looping around, nor auto-reversing the cycle.
And even on their best days, are not good as real positional shifters. (they might work fine with real cars.. however, with a real car, you can hear & feel the engine revs, so are very clear as to what gear your in, never getting 'lost')

Quote
if you have no choice you can use a 1 button toggle pushbutton,

Why would you have No Choice?  If we were talking about a person that didnt have a spinner... or a Starwars yoke.. I could understand.  However, we are talking about ONE SINGLE BUTTON.  Geez... are you really saying that people cant handle that?  Almost every modern console since (and even before) PS1, has had games that use at least 2buttons to shift up/down.

 The ONLY exception to this rule would be an impaired person who couldnt operate games well.  If thats the case... add a disability option in there.  But dont mess it up for people who do have fine functionality.  There should never be a Loss of control for the sake of pleasing everyone with a sub-par workaround.  That ruins the entire games intended experience, and designed playability.


Quote
so if you used this setting you could still toggle from low to hi with a single button.  You don't have to, but you can.

 With a centered or paddle shifter, you can already toggle hi to low fine.. because they are press and release.  However, if you are talking single switch 2 position shifters, then No, it WONT work.  


Also, In the electronics world of terminology, a Two position switch thats either On or Off.. and held in place in either position, is called a "Toggle Switch".  

 Something like a push-button switch (micro-switch) is what they call a "Momentary Switch".  It breaks contact once you let it go.


 This is yet another reason why "Toggle" isnt accurate when describing Cycled Gears.

 A Daytona USA sequential shifter has 4 momentary switches in it.  Theres no toggling to be found...  And when a user looks at mame to configure and interface controls.. it should at very least, be in line with electrical terminology.  And should be something that makes sense to a person hooking up controllers.  Not something that makes sense to a programmers programatical logic.


Quote
Yes hardware original would be different for each game and yes it would be impossible to use this setting on a generic mame cab for all games without a ton of shifters.  

 Theres not that many variations, and theres No reason whatsoever that a generic TOGGLE (electrical terminology) function couldnt be used in replace of Mometary inputs, at the users end.

Quote
You obviously can't play hard-drivin or crusin usa on said cabinet anyway.  Btw those two games would have different input settings for hw original and if you mame those cabs, the shifters would work without hacking.  That is the point of that setting.

 If all methods of input are realized, then Yes, you COULD play both games in the same cabinet.   Almost all All "hardware" is relative to each other.   Theres Analog Pots, Switches, and Tracking Optics.

 I Love the idea that for example, one day, if my Sega Turbo died... that I could hook up the real OPTICAL switch Pedal set, and configure it to work correctly with mame.   On the other hand... if I didnt have the pedal.. and couldnt get a Turbo Pedal anymore... Id want the Option to be able to substitute either a digital pedal.. or an analog pot pedal.
 
 FYI - Turbo uses a 4 position Dual Optical-Switches, gas pedal.  It has 4 states:

 1) 0 / 0  = Off (no gas)
 2) 1 / 0  = Speed 1
 3) 1 / 1  = Speed 2
 4) 0 / 1  = Speed 3


 In many games, the hacks already exist, such as in Turbo.. you Can in fact use an analog pedal.  However, some of these hacks should be able to be turned off, of the user does not want their interference.  As some of them actually effect the game negatively, and or make the game less playable with real hardware.


Quote
the main thing you've got to keep consistant for each setting is the number of inputs, not their usage.

 What does it matter how many inputs are able to be used?  Already, many games have a ton of controller options in the menu system.  Nobody has ever complained.

 IMO, there should be some separations however, so that non-original controller inputs & hacks, are placed in their Own menu heading.  That way, anyone can see the true games input methods.. and then decide how they want to interface with it from there.  Without this, a person has to do a lot of research to figure out what the heck controlled the real game.  This information can be very obscure for rare games... and even on well know games.. may one day be forgotten.


Quote
You guys are acting like it's set in stone anyway.  I'm jsut throwing ideas at the wall here.

 Not at all.  Just frusterated at the lack of support for Certain kinds of input hardware...  and hopeful for good support and flexibility that we desire, in the best ways possible.


Quote
Regarding the analog shifters... I know they are crap, but there isn't a generic arcade equivelent anyway.  If you want to go hardcore you use the guts of the cheap consumer level shifter and hack em

 Hard Drivin's Shifter is one of the best shifters ever build actually.  However, its also not very complicated to replicate.  Its a rod attached to a standard door hinge! :)  And some pots with pot levers.   If support for analog shifters was usable on digital games... then its possible that some of the hardware people would take such a product for the mame community... as that simply is one of the best ways to interface with all? of mames shifter games. (with a slight mod for the top plate in 6 and possibly 7 positions)

« Last Edit: December 29, 2011, 11:47:51 pm by Xiaou2 »

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9226
  • Last login:March 25, 2024, 08:10:48 pm
  • ...
The shifter semantics debate thread.
« Reply #36 on: December 30, 2011, 12:22:47 am »
Gotta take issue with this:

  4,5 or 6 way shifters do not toggle. That more or less described as  "Sequential".
Sequential Shifters.
......... A Daytona USA sequential shifter has 4 momentary switches in it.


In modern terminology anyway, a sequential shifter is one that you bump foward to upshift and backwards to downshift.
 (It returns to center) It sequentially progresses through the gears. 

4, 5, or 6 way shifters are refered to as H-pattern shifters, no matter how many gears they have.

We're just slowing Howard down.
(but I can't stop myself either)
sigh.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MAME Driver Patch for Hardware Gear Shift Support
« Reply #37 on: December 30, 2011, 08:19:01 am »
lol shifter nerds. 

Ok guys all of this will be taken into consideration... assuming I ever get the time to work on it.