A Fix for Some of the Analog Pedal Problems
With this hack you should be able to compile a MAME that handles analog pedals
a little better.
I tested this hack on versions 37b16, 53, 54, and 55. It will work for all
other MAME versions that use the file src/inptport.c written on 5/13/2001, which
starts at either mame 0.37b12 or 13. I don't know about versions before that
date. I'm giving the line numbers of ver 55 (and 54), but the others are only
off by 3 more lines, so you will not have any problems finding the right spots
(just add 3 to the line number given).
How to apply this dirty hack:
- Download mame source.
- Open src/inptport.c and the file included with these instructions in any
text editor. I will start at the end of inptport so the line numbers still
match. Each step in the PedalHacks.txt is labeled
- Cut and paste the function isNegativeSemiAxis() in PedalHacks.txt to the
end of inptport.c
- At line 1211 just before the line with "IPF_REVERSE", insert
the six lines that check for the semi-axis.
- On line 1121 change "is_stick = 0" to "is_stick = 1",
or just cut and paste from the PedalHack.txt file over lines 1120 and 1121.
- Cut and paste the function prototype near the top of the file inptport.c
on its own line. The first line is fine, but not "nice". It's better
to place it just before the first function near line 328. (No need to put
it in the header file because the function is for use in this file only)
- recompile MAME. You'll have to check elsewhere for the info ;)
- enable joystick control in mame.ini, or in command line call, or in your
frontend. Plug in analog controling device and make sure it works on your
computer.
- Start game. Edit input for pedal 1 to one of your pedals in either just
this game or all games. ([TAB])
- enjoy!
Fixes, and not fixed:
Fixes:
- You get one analog pedal per player that reads the data of how far you are
pressing the pedal. this is done by step 6
- Corrects the gas pedal (usually) being on the negative semi-axis. No need
to set reverse input. Pedals and keyboards work together fine. this is fixed
in steps 3, 4 and 6.
- Works with both windows and dos compiles. Should work in other ports, but
I haven't tested.
Not fixed:
- Pedals emulated with the IPT_AD_STICK are not effected.
- Only one analog device works as analog per player: Joystick 1 is analog
only for player 1, J2 only for player 2, ect. This is due to the windows and
msdos methods of handling analog joystick input. Other ports may or might
not have this problem.
- Since Mame assigns only one pedal per player, this hack only gives an analog
read to one pedal in games with two pedals defined as IPT_PEDALs in mame.
This is also due to the windows and msdos methods of handling analog joystick
input because of the hack used to play two pedal games on Mame.
- No analog wheel problems are fixed (if there are any). No game driver problems
fixed. No OS depend problems fixed. This only enables true analog pedal control.