15 November 2016

Using and configuring Joysticks with M.A.M.E./QMC2 (Update May 2017)

When it comes to Joysticks, I am very pragmatic. A Logitech F310 Gamepad is enough for me. Switched on the backside to Direct Input, it runs out of the box in QMC2. No drivers under MacOSX required.

Update November 2016: Since the X Input mode emulates XBox controllers, I gave this XBox driver from Github a try - and it works! The immediate advantage is that all things are configurable in the MacOS System Settings, and RetroArch automatically assigns the joypad to XBox configuration, which is nice. Further insights will follow, but that's a good thing. It is fully compatible with MacOS Sierra.





As a second joypad, I went for a PS4 controller, and this thing rocks, both on USB and Bluetooth. No additional drivers required. Build quality is superb, full recommendation.






MAME Joystick Settings (Update May 2017): In MAME configuration of the settings are a bit tricky. You must get accustomed to the interface in MAME and can reconfigure Control settings. These were the really important things to do:
Input General/Other Controls/Coin 1 - assign a joystick button so that you can insert coins with it
Input General/Other Controls/1 Player Start - start game with one player
Input General/Other Controls/2 Player Start - start game with two players
Input General/User Interface/UI Cancel - exit the UI and the game
This is how I get bets results: Launch any game and enter the MAME Menu with TAB. Then head for the general Input Configuration and head for the above mentioned options.
- Press RETURN to adjust a control -> go for the joypad control
- Press RETURN for a second time -> add the keyboard control
- Exit the Control section and enter the game again by pressing TAB
As a result you have both joypad and keyboard control in place.

Important: If everything went smoothly, your MAME Joystick Settings are from now on stored in /cfg/default.cfg in a readable XML version. As soon as you migrate these settings, you should enjoy these settings in the next MAME version as well! For my PS4 controller, default.cfg reads as follows:

<?xml version="1.0"?>
<!-- This file is autogenerated; comments and unknown tags will be stripped -->
<mameconfig version="10">
    <system name="default">
        <input>
            <port type="P1_START">
                <newseq type="standard">
                    JOYCODE_1_BUTTON10 OR KEYCODE_1
                </newseq>
            </port>
            <port type="P1_SELECT">
                <newseq type="standard">
                    JOYCODE_1_BUTTON9 OR KEYCODE_5
                </newseq>
            </port>
            <port type="START1">
                <newseq type="standard">
                    JOYCODE_1_BUTTON10 OR KEYCODE_1
                </newseq>
            </port>
            <port type="COIN1">
                <newseq type="standard">
                    JOYCODE_1_BUTTON9 OR KEYCODE_5
                </newseq>
            </port>
            <port type="UI_CANCEL">
                <newseq type="standard">
                    JOYCODE_1_BUTTON13 JOYCODE_1_BUTTON10 OR KEYCODE_ESC
                </newseq>
            </port>
        </input>
    </system>

</mameconfig>

Result: Player 1 Start, Player 1 Select, Start1, Coin1 and UI Cancel are both assigned to the joypad and the keyboard. Migration to the next MAME version works.

----

QMC2 Basic Settings: Tools/Options/Frontend/Joystick/Enable Joystick Control set to on
After pressing Rescan joysticks, the F310 is immediately recognized and configured as Logitech Dual Action. That's all to do for a successful start.

By pressing the Mode button, you can switch between the Left Analogue Control and the 4-Switch D-Pad. I like the Analogue Control a lot, in particular when it comes to playing Gyruss.

QMC2 Extended Joystick Settings: There are some very nice things in QMC2 that make your joystick even more valuable - go again to Tools/Options/Frontend/Joystick - Map

Joypad Calibration can be important: Prior to assigning keys to the QMC2 frontend, please be sure that you calibrate your joypad. In my case I had to define Deadzones for the analogue controls so that they would not interfere with the digital pad, which I user for Cursor up and Cursor down. See this screenshot:

Without such deadzones, joypad control in QMC2 proved unreliable and useless. Until now, I  did not experience any impact on the gameplay, but it's a trial-and-error thing -> the blue lines should be completely steady after Deadzones.

Cursor up and Cursor down - allows you to move through your games list with your joystick
Play (independent) - for starting a game with your joystick


2 comments:

  1. I don't suppose you have any issues or tips on getting the mouse analog input working for a game like Arkanoid?

    ReplyDelete
    Replies
    1. There are some issues with mice on OS X and sdlmame.

      Are you running sdlmame directly or using QMC2?

      If using QMC2, you have to enable mouse in "Input Options" and also map "panel device" to mouse in "automatic device selection"
      (These are all in config window)

      If using sdlmame directly, you have to use "-mouse" and "-paddle_device mouse" options.

      Delete

Any comments are welcome!