RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    Unable to remap Dualshock v2 controller.

    Scheduled Pinned Locked Moved Help and Support
    r-mame2003controllercfg
    7 Posts 3 Posters 297 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      cambesol01
      last edited by

      Pi Model or other hardware: Pi 4B 2GB
      Power Supply used: Official Raspberry Pi Type-C
      RetroPie Version: 4.5.14 running on Rasbian Buster.
      Built From: Downloaded from GitHub.
      USB Devices connected: None
      Controller used: Dualshock v2
      Error messages received: N/A
      Emulator: lr_mame2003
      ROM: Defender red label.
      How to replicate the problem: Add a custom controller config file in ~/RetroPie/roms/arcade

      The target ROM is defender.zip, the controller configuration file is defender.zip.cfg

      pi@raspberrypi:~/RetroPie/roms/arcade $ ls -1
      defender.zip
      defender.zip.cfg
      
      pi@raspberrypi:~/RetroPie/roms/arcade $ cat defender.zip.cfg
      input_a_btn=1
      input_b_btn=2
      input_x_btn="h0up"
      input_y_btn=5
      input_player1_1_btn=1
      input_player1_a_btn=4
      input_player1_b_btn=5
      input_player1_x_btn=4
      input_player1_y_btn=5
      input_player2_a_btn=1
      input_player2_b_btn=10
      input_player2_x_btn="h0up"
      input_player2_y_btn=5
      

      The es_input.cfg file looks like this:

      pi@raspberrypi:~ $ cat .emulationstation/es_input.cfg
      <?xml version="1.0"?>
      <inputList>
        <inputAction type="onfinish">
          <command>/opt/retropie/supplementary/emulationstation/scripts/inputconfiguration.sh</command>
        </inputAction>
        <inputConfig type="joystick" deviceName="Sony Interactive Entertainment Wireless Controller" deviceGUID="030000004c050000cc09000011810000">
          <input name="a" type="button" id="1" value="1"/>
          <input name="b" type="button" id="0" value="1"/>
          <input name="down" type="hat" id="0" value="4"/>
          <input name="hotkeyenable" type="button" id="7" value="1"/>
          <input name="left" type="hat" id="0" value="8"/>
          <input name="leftanalogdown" type="axis" id="1" value="1"/>
          <input name="leftanalogleft" type="axis" id="0" value="-1"/>
          <input name="leftanalogright" type="axis" id="0" value="1"/>
          <input name="leftanalogup" type="axis" id="1" value="-1"/>
          <input name="leftshoulder" type="button" id="4" value="1"/>
          <input name="leftthumb" type="button" id="11" value="1"/>
          <input name="lefttrigger" type="button" id="6" value="1"/>
          <input name="right" type="hat" id="0" value="2"/>
          <input name="rightanalogdown" type="axis" id="4" value="1"/>
          <input name="rightanalogleft" type="axis" id="3" value="-1"/>
          <input name="rightanalogright" type="axis" id="3" value="1"/>
          <input name="rightanalogup" type="axis" id="4" value="-1"/>
          <input name="rightshoulder" type="button" id="5" value="1"/>
          <input name="rightthumb" type="button" id="12" value="1"/>
          <input name="righttrigger" type="button" id="7" value="1"/>
          <input name="select" type="button" id="9" value="1"/>
          <input name="start" type="button" id="8" value="1"/>
          <input name="up" type="hat" id="0" value="1"/>
          <input name="x" type="button" id="2" value="1"/>
          <input name="y" type="button" id="3" value="1"/>
        </inputConfig>
      </inputList>
      

      I am attempting to remap the controller so that the controls are usable whilst playing Defender.
      The emulator (lr_mame2003) ignores whatever values I put in the defender.zip.cfg file.
      I can see the file contents if I run the menu from the emulator. I only want to change the mappings for this ROM as it is a difficult game and want the best possible combination to aid speed of play.

      The command line used is:

      /opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-mame2003/mame2003_libretro.so --config /opt/retropie/configs/arcade/retroarch.cfg "/home/pi/RetroPie/roms/arcade/defender.zip" --appendconfig /dev/shm/retroarch.cfg'|'"/home/pi/RetroPie/roms/arcade/defender.zip.cfg"
      

      which appears reasonable.

      I have read many documents, forums, post, etc, and spent upwards of 12 hours experimenting but without
      success so I thought I would ask the experts!

      Any clues, hints or tips would be very helpful.

      Thanks in advance,

      Neil.

      1 Reply Last reply Reply Quote 0
      • R
        rejesterd
        last edited by

        I haven't set up a custom controller config for an arcade game yet, but I would remove that extra dot in the cfg file name. Try 'defender.cfg'. Might not change the behavior, but it's better practice in general.

        1 Reply Last reply Reply Quote 0
        • mituM
          mitu Global Moderator
          last edited by

          The syntax is a bit different, see this example from the default RetroArch sources.

          However, I'd advice against manually configuring this - use the Core Input Remapping and save a game over override from the RetroArch's RGUI.

          1 Reply Last reply Reply Quote 0
          • C
            cambesol01
            last edited by

            I took the file naming convention from here:

            https://retropie.org.uk/docs/RetroArch-Configuration/

            Namely the ROM-specific settings.

            "The ROMNAME includes the original file extension before the .cfg, e.g. supermariobros.zip.cfg These configurations are used when starting this specific ROM."

            I tried your suggestion, but the configuration files is not parsed and hence not visible from the runcommand menu option: "Edit custom RetroArch config for this rom."

            Any further suggestions to help debug the problem?

            mituM 1 Reply Last reply Reply Quote 0
            • mituM
              mitu Global Moderator @cambesol01
              last edited by

              @cambesol01 said in Unable to remap Dualshock v2 controller.:

              Any further suggestions to help debug the problem?

              Use the RGUI and remap the inputs from there.

              C 1 Reply Last reply Reply Quote 1
              • C
                cambesol01 @mitu
                last edited by

                @mitu Thank you for your hint. I will investigate the RGUI approach, but I just want to understand something.

                For keyboard input we could use this:

                input_player1_a = "x"

                So input (button) 'a' receives an event when the keyboard key 'x' is pressed.

                For a controller input we could use this:

                input_player1_a = 2

                So input (button) 'a' receives an event when the controller issues an event with an ID of 2?

                I am trying to understand the relationship between the es_input.cfg XML file and the retroarch.cfg syntax.

                Thanks again.

                1 Reply Last reply Reply Quote 0
                • mituM
                  mitu Global Moderator
                  last edited by

                  Yes, that's correct. You have a gamepad, so the syntax would include the btn part, as you've already noticed - I realized after posting the example that the configuration part is covering the default keyboard mapping in RetroArch.

                  Using the RGUI you can also check what values are assigned to each button, just to check if your mapping are considered. Note that you cannot use 1 single gamepad for 2 players - as you've posted, RetroArch doesn't support that (it does support to use 1 keyboard for 2 players though).

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post

                  Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                  Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.