Main > Software Forum

MAME CTRLR file for X-Arcade and XBOX 360 Pads

(1/9) > >>

AldousHxlE:
Hey everyone,

Long time visitor, first time poster. :) Anyway, I figured someone may find this useful. I created a customized MAME ctrlr file for use with the X-Arcade, as well as 4 XBOX 360 gamepads (wired or wireless). Here are the details for this configuration.

- The X-Arcade controls P1 and P2.
- The XBOX 360 pads also control P1-P4. Both analog and digital pads are mapped to control movement, as well as analog triggers for some games.
- Specified controls for Neo Geo games, which use the MVS style button layout on the X-Arcade. XBOX360 pads are configured to use the same control layout as the Neo Geo CD gamepads.
- Corrected configs for Mortal Kombat 1-4.
- Modified Street Fighter 1, CPS1, CPS2, CPS3, and Killer Instinct series controls for the XBOX 360 pads. The configs match the default gamepad layout for Street FIghter IV PC and XBOX 360.
- Support for analog devices, such as paddles, dials, flight yokes, steering wheels, and light-guns. These devices are configured for the X-Arcade joysticks, XBOX 360 controller left thumbstick and digital pad, mice/trackballs, and light-guns (when applicable). Enable mouse and light-gun support within mame.ini should these devices be used.
- Support for dual joystick games using the XBOX 360 left and right analog sticks for games such as Smash TV, Robotron, etc...
- Disabled the X-Arcade shortcuts KEYCODE_2+KEYCODE_4 to exit the game, as well as KEYCODE_1+KEYCODE_3 to bring up Options. I did this to prevent accidental exits, etc... during gameplay.
- Player 1 on either X-Arcade or XBOX 360 pad are able to navigate through MAME's ingame menus.

To use, download the TXT attachment below and save it in your MAME CTRLR directory as XArcade+XBOX360x4.cfg

Finally, edit your mame.ini file, located in the INI folder within your MAME directory, and change the CORE INPUT OPTIONS values to:


--- Code: ---# CORE INPUT OPTIONS
#
ctrlr                     XArcade+XBOX360x4
mouse                     0
joystick                  1
lightgun                  0
multikeyboard             0
multimouse                0
steadykey                 0
offscreen_reload          0
joystick_map              auto
joystick_deadzone         0.3
joystick_saturation       0.85
--- End code ---

Thats it! Fire up MAME, and try it out. Enjoy.

*This config is a work in progress. Suggestions are always welcome.

u_rebelscum:
Nice work, and thanks for contributing!  :applaud:  (I'm always happy to see others also using the ctrlr file.)

A couple questions, mostly minor stuff.

You have UI_CANCEL included, but it's mapped to mame's default so it doesn't need to be there.  Is this for user documentation?  Or a left over from removing the (IMO stupid) button combo?  Nothing's wrong with it in there, and saving the <1K disk space by removing it isn't wroth the effort.  Just wondering.

Almost the same with UI_CONFIGURE, but you mapped it to tab only, which is close to mame's default, but not quite the same.  (Mame's default is tab not alt, or "KEYCODE_TAB NOT KEYCODE_LALT NOT KEYCODE_RALT".)  Is this difference intentional?  If you want mame's default, you can remove this entry like above, but like above, it's so minor it might not be worth it. ;)

I like driving games.  It doesn't look like you set up the xbox controllers for them (paddle and pedal inputs).  If you're interested in driving games, you might want to add them (but see below).

And lastly, you seem to map the AD_STICK as if your xbox controller X & Y axes are digital instead of analog.  (Same as mame's defaults, actually.)  Is this intentional?  Is this what you meant by "After Burner style"?  I don't have an xbox controller, but I'm assuming the X & Y axes are the left thumbstick, and the hatswitch is the d-pad, right?  Then I'd map the AD_STICK as follows:

            <port type="P1_AD_STICK_X">
                <newseq type="standard">JOYCODE_1_XAXIS_ABSOLUTE</newseq>
                <newseq type="decrement">KEYCODE_4PAD OR JOYCODE_1_HATSWITCHL</newseq>
                <newseq type="increment">KEYCODE_6PAD OR JOYCODE_1_HATSWITCHR</newseq>
            </port>
And the same for the other player & axes.

By taking out the the joystick X axis switches, mame will correctly treat the input as analog (The analog X axis is already mapped in the "standard" analog newseq with the "JOYCODE_1_XAXIS_ABSOLUTE").

The orange text is optional, as it's basically mame's default for the standard analog (minus the mouse).  Also notice it doesn't have the mask, index, and defvalue, as these are cfg file only and are ignored in the ctrlr file.  Again, this is IMO a change needed for mame's defaults also, for everyone with an analog stick; IMO all absolute analog inputs (AD stick, paddle, pedal, and lightgun) need this remove analog axis from digital map fix.


Otherwise, your ctrlr file looks good and nicely set up for fighter games.  :cheers:

AldousHxlE:
u_rebelscum,

First off, thank you very much for your advice  ;D

UI_CANCEL and UI_CONFIGURE were actually entries I meant to remove a while back, but always forgot about. But you're right, they served no purpose, and have been removed.

I updated the CTRLR file in my first post to reflect a few changes, most notably the AD_STICK controls for the XBox360 pads. I actually never knew the JOYCODE_1_XAXIS_ABSOLUTE option existed, so its nice to learn something new about writing these CTRLR. Thanks :) The only other changes I've made are some cleanup on the file itself, mostly removing the unused button entries for the driver specific controls, shaving off about 4KB.

I do plan on implementing driving controls very soon, as soon as I get a chance. I will update the file with any future changes. Thanks again for the help on this, and please feel free to throw any other suggestions my way.  :applaud:

AldousHxlE:
u_rebelscum

I'm trying to configure driving controls for the CTRLR file, but I think I've hit some road blocks (no pun intended) :D. I'm using Pole Position and Cruisin USA as my test games, and basically I needed some tips/suggestions on the following:

1. I've added the following lines to the SYSTEM NAME=DEFAULT entries:

--- Code: --- <port type="P1_PADDLE">
                <newseq type="standard">JOYCODE_1_XAXIS_ABSOLUTE</newseq>
                <newseq type="decrement">JOYCODE_1_HATSWITCHL OR KEYCODE_4PAD</newseq>
                <newseq type="increment">JOYCODE_1_HATSWITCHR OR KEYCODE_6PAD</newseq>
                </port>
<port type="P1_DIAL">
                <newseq type="standard">JOYCODE_1_XAXIS</newseq>
                <newseq type="decrement">JOYCODE_1_HATSWITCHL OR KEYCODE_4PAD</newseq>
                <newseq type="increment">JOYCODE_1_HATSWITCHR OR KEYCODE_6PAD</newseq>
                </port>
            <port type="P1_PEDAL">
<newseq type="standard">JOYCODE_1_ZAXIS</newseq>
                <newseq type="increment">JOYCODE_1_BUTTON2 OR KEYCODE_LALT</newseq>
                </port>
            <port type="P1_PEDAL2">
                <newseq type="increment">JOYCODE_1_BUTTON1 OR KEYCODE_LCONTROL</newseq>
                    </port>
--- End code ---

Basically what I did was set the XBOX 360 D-Pad and the X-Arcade Joystick 1 to control steering (P1_PADDLE), but also have the XBOX 360 left thumbstick act as an analog steering wheel. This seems to work well with the JOYCODE_1_XAXIS_ABSOLUTE entry within Cruisin USA. For Pole Position, I had to add the P1_DIAL for steering, but the left thumbstick does not seem to work when using the line JOYCODE_1_XAXIS_ABSOLUTE, but does work using JOYCODE_1_XAXIS. Is the left thumbstick still working as an analog device correctly with this entry?

2. Please look at the entry for P1_PEDAL. I originally set the "standard" entry to JOYCODE_1_ZAXIS_ABSOLUTE, then tried JOYCODE_1_ZAXIS, but they seem to work the same when assigning "Gas Pedal" to the left and right analog triggers on the XBOX 360 pad. Again, do both entries mean they are working as analog devices?

3. On the subject of the pedals, I was able to assign gas to XBOX 360 Button 2/X-Arcade Button 2 and brake to XBox 360 Button 1/X-Arcade Button 1, which work well. Now, the XBox 360 analog triggers are also assigned to gas as ZAXIS, but how can I separate ZAXIS to control both gas and brake? I know I could enter their values within "increment" as JOYCODE_1_ZAXIS_NEG_SWITCH and JOYCODE__ZAXIS_POS_SWITCH, but this would make the triggers work as digital buttons, correct?

4. Finally (whew!), I've only been able to test these two games so far. Are there any other entries I need to add to support all driving wheels within MAME besides P1_PADDLE and P1_DIAL? I really want this to be a universal CTRLR that everyone can use without post-configuration necessary.

Again, thank you for your help on this. You seem to be much more knowledgeable when it comes to the ins and outs of the MAME CTRLR file than I certainly am. The analog stuff really throws me off. ???

AldousHxlE:
Ok, I think I'm really starting to understand how the analog devices work now :applaud:. So with that, another update:

- Support for analog devices, such as paddles, dials, flight yokes, steering wheels, and light-guns. These devices are configured for the X-Arcade joysticks, XBOX 360 controller left thumbstick and digital pad, mice/trackballs, and light-guns (when applicable). Enable mouse and light-gun support within mame.ini should these devices be used.

I'm hoping this covers all analog devices within MAME, but please let me know if anything is missing.

Navigation

[0] Message Index

[#] Next page

Go to full version