The NEW Build Your Own Arcade Controls

Main => Software Forum => Topic started by: Minwah on July 02, 2008, 12:10:53 pm

Title: Mame source/compiling question
Post by: Minwah on July 02, 2008, 12:10:53 pm
I would like to add a few 'new' input types to Mame, for example IPT_WHEEL360 and IPT_WHEEL270.  These would be exactly the same as IPT_DIAL and IPT_PADDLE respectively, but would only apply to driving games. In turn I would like the -listxml output to report these types as 'wheel360' and 'wheel270'. Functionally nothing will change, just how the input appears to the user.

I had a bit of a go at this but I seemed to have messed something up  :-\ When I start Mame I can go into the tab menu but after that controls do not work properly (inc. UI controls such as Escape). I think it might be a change I made in \src\emu\inptport.h:

Code: [Select]
/* analog inputs */
#define __ipt_analog_start IPT_PADDLE
#define __ipt_analog_absolute_start IPT_PADDLE
IPT_PADDLE, /* absolute */
IPT_WHEEL270, /* absolute */
IPT_PADDLE_V, /* absolute */
IPT_AD_STICK_X, /* absolute */
IPT_AD_STICK_Y, /* absolute */
IPT_AD_STICK_Z, /* absolute */
IPT_LIGHTGUN_X, /* absolute */
IPT_LIGHTGUN_Y, /* absolute */
IPT_PEDAL, /* absolute */
IPT_PEDAL2, /* absolute */
IPT_PEDAL3, /* absolute */
IPT_POSITIONAL, /* absolute */
IPT_POSITIONAL_V, /* absolute */
#define __ipt_analog_absolute_end IPT_POSITIONAL_V

IPT_DIAL, /* relative */
IPT_WHEEL360, /* relative */
IPT_DIAL_V, /* relative */
IPT_TRACKBALL_X, /* relative */
IPT_TRACKBALL_Y, /* relative */
IPT_MOUSE_X, /* relative */
IPT_MOUSE_Y, /* relative */
#define __ipt_analog_end IPT_MOUSE_Y

Can anyone point out what I might have done wrong? Still very much learning from a bit of trial and error at the moment.


Edit: BTW I want to do this to make filtering games much, much easier.
Title: Re: Mame source/compiling question
Post by: Cakemeister on July 02, 2008, 12:28:23 pm
Try doing a complete clean recompile. Mame may not have the dependencies set up so if you change one .h file it may not automatically recompile any .c which #includes the .h file.
Title: Re: Mame source/compiling question
Post by: Minwah on July 02, 2008, 02:03:04 pm
Try doing a complete clean recompile. Mame may not have the dependencies set up so if you change one .h file it may not automatically recompile any .c which #includes the .h file.

Thanks very much for the tip, that did it! All seems to work fine now:

Code: [Select]
<input players="3" coins="3" service="yes">
<control type="wheel360" minimum="0" maximum="255" sensitivity="25" keydelta="10"/>
<control type="pedal" minimum="0" maximum="63" sensitivity="100" keydelta="4" reverse="yes"/>
</input>

Thanks again!  ;D