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

    snes9x-rpi controls broken? Retroflag Gpi

    Scheduled Pinned Locked Moved Help and Support
    snes9x-rpisnes9xcontrollerkeyboardsource code
    48 Posts 4 Posters 3.9k 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.
    • S
      SinisterSpatula @spud11
      last edited by

      @spud11 I got it!!! Yay! :D This works perfectly:

      #Duke Nukem
      if [ "$2" = "eduke32" ]
      then
          sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \
          --evdev /dev/input/by-id/usb-RetroFlag_GPi_Case_RetroFlag_01-event-joystick \
          --detach-kernel-driver \
          --silent \
          --force-feedback \
          --deadzone-trigger 15% \
          --deadzone 4000 \
          --mimic-xpad \
          --dpad-as-button \
          --no-extra-events \
          --evdev-absmap ABS_X=x1,ABS_Y=y1,ABS_RX=x2,ABS_RY=y2,ABS_Z=lt,ABS_RZ=rt \
          --evdev-keymap BTN_SOUTH=a,BTN_EAST=b,BTN_NORTH=x,BTN_WEST=y,BTN_TL=lb,BTN_TR=rb,BTN_THUMBL=tl,BTN_THUMBR=tr,BTN_MODE=guide,BTN_SELECT=back,BTN_START=start,BTN_TRIGGER_HAPPY3=du,BTN_TRIGGER_HAPPY4=dd,BTN_TRIGGER_HAPPY1=dl,BTN_TRIGGER_HAPPY2=dr \
          --evdev-absmap ABS_X=dpad_x,ABS_Y=dpad_y \
          --ui-buttonmap x=KEY_RIGHTCTRL,a=KEY_E,b=KEY_SPACE,y=KEY_LEFTSHIFT,lb=KEY_A,rb=KEY_D,a+lb=KEY_SEMICOLON,a+rb=KEY_APOSTROPHE,lb+rb=KEY_LEFTCTRL,rb+lb=KEY_LEFTCTRL \
          --ui-buttonmap start=KEY_ENTER+KEY_M,back=KEY_ESC,back+start=KEY_F10 \
          --ui-buttonmap start+y=KEY_J,start+b=KEY_N,start+x=KEY_H,start+a=KEY_TAB \
          --ui-buttonmap du=KEY_UP+KEY_W,du+a=rel:REL_Y:-5:5,a+du=rel:REL_Y:-5:5,dd=KEY_DOWN+KEY_S,dd+a=rel:REL_Y:5:5,a+dd=rel:REL_Y:5:5,dl=KEY_LEFT,dr=KEY_RIGHT \
      &
      fi
      
      S 1 Reply Last reply Reply Quote 0
      • S
        SinisterSpatula @SinisterSpatula
        last edited by

        Now I'm wondering if it's better to do an axismap or if I should stick with this method (no axismap). I'm leaning toward no axismap because buttonmap seems to be more flexible, or allows more complexity. (or so it seems, I could be wrong)

        S 1 Reply Last reply Reply Quote 0
        • S
          SinisterSpatula
          last edited by

          It turns out all I had to change was just one line. All of my mappings just needed this:

          --evdev-absmap ABS_HAT0X=dpad_x,ABS_HAT0Y=dpad_y \
          

          Changed to

          --evdev-absmap ABS_X=dpad_x,ABS_Y=dpad_y \
          

          Literally the only change needed.

          S 1 Reply Last reply Reply Quote 0
          • S
            spud11 @SinisterSpatula
            last edited by

            @SinisterSpatula Very well done.

            Is it possible to combine the two? eg --dpad-as-button \ and --trigger-as-button \ plus, for example, --ui-axismap X1=KEY_A:KEY_D,Y1=KEY_S:KEY_W \ and --evdev-absmap ABS_HAT0X=dpad_x,ABS_HAT0Y=dpad_y \ etc?

            If not, my recollection is that mediamogul had figured out a way of having 2 separate configurations which can be switched via button press.

            RetroPie v4.4.1 • RPi3 Model B • 5.1V 2.5A PSU • 32GB SanDisk Extreme microSD • 2TB Toshiba Canvio Basics Portable USB 3.0 hard drive • 4 x DragonRise USB Arcade joysticks • 2 x TurboTwist spinners • 1 x USB trackball • 1 x PS4 wireless • 1 x 8BitDo Zero

            1 Reply Last reply Reply Quote 0
            • S
              spud11 @SinisterSpatula
              last edited by

              @SinisterSpatula Excellent. My last message crossed with your's.

              RetroPie v4.4.1 • RPi3 Model B • 5.1V 2.5A PSU • 32GB SanDisk Extreme microSD • 2TB Toshiba Canvio Basics Portable USB 3.0 hard drive • 4 x DragonRise USB Arcade joysticks • 2 x TurboTwist spinners • 1 x USB trackball • 1 x PS4 wireless • 1 x 8BitDo Zero

              1 Reply Last reply Reply Quote 0
              • S
                SinisterSpatula
                last edited by

                Hmmm, yes that is something to experiment with for sure. Like, if we wanted to try and support whatever mode the dpad button happened to be? I'm not too sure about that. I'm thinking while that would be cool, how much use would it really be. We don't want people constantly switching their d-pad mode. They really should "set it and forget it". So all my maps are going to be consistent and based on a certain mode. I guess, if it's just that one line that changes, it could be stored as a variable at the top of the file, and used in place of the line, depending on which mode they want it to be.

                S 1 Reply Last reply Reply Quote 0
                • S
                  spud11 @SinisterSpatula
                  last edited by

                  @SinisterSpatula You've probably tried this already, but could you have both --evdev-absmap ABS_HAT0X=dpad_x,ABS_HAT0Y=dpad_y \ and --evdev-absmap ABS_X=dpad_x,ABS_Y=dpad_y \ in the one configuration? Does it conflict?

                  RetroPie v4.4.1 • RPi3 Model B • 5.1V 2.5A PSU • 32GB SanDisk Extreme microSD • 2TB Toshiba Canvio Basics Portable USB 3.0 hard drive • 4 x DragonRise USB Arcade joysticks • 2 x TurboTwist spinners • 1 x USB trackball • 1 x PS4 wireless • 1 x 8BitDo Zero

                  1 Reply Last reply Reply Quote 0
                  • S
                    SinisterSpatula
                    last edited by

                    @spud11 said in snes9x-rpi controls broken? Retroflag Gpi:

                    --evdev-absmap ABS_HAT0X=dpad_x,ABS_HAT0Y=dpad_y \

                    OMG! THAT WORKS. I did not try that, I didn't think that would work but it TOTALLY DOES! I can be in game, and switch my D-pad mode and it does not miss a beat. Holy cow. That's lifechanging lol

                    S 1 Reply Last reply Reply Quote 0
                    • S
                      spud11 @SinisterSpatula
                      last edited by

                      @SinisterSpatula Terrific! Your work here is done!!! xboxdrv really is an amazing piece of software.

                      RetroPie v4.4.1 • RPi3 Model B • 5.1V 2.5A PSU • 32GB SanDisk Extreme microSD • 2TB Toshiba Canvio Basics Portable USB 3.0 hard drive • 4 x DragonRise USB Arcade joysticks • 2 x TurboTwist spinners • 1 x USB trackball • 1 x PS4 wireless • 1 x 8BitDo Zero

                      1 Reply Last reply Reply Quote 0
                      • S
                        SinisterSpatula
                        last edited by

                        Hey @spud11 I got my mappings converted into that advanced fancy style (the one from the advanced xboxdrv controls author). It makes me dizzy to look at it, but it works! :) Thank you so much for your ideas, and input, truly epic advancements today :D I will see about including your vice config and seeing if I can (maybe) improve upon it. I also have openbor on my todo list (there's just a basic mapping to work with the menu's right now for that one).

                        S 1 Reply Last reply Reply Quote 0
                        • S
                          spud11 @SinisterSpatula
                          last edited by

                          @SinisterSpatula That's great indeed and I'm glad I could help. I can't wait to see the next iteration you produce.

                          The advanced mapping method with case statement really works well if you have a lot of code. My arcade machine's runcommand-onstart.sh has about 4,300 lines of code for 4 arcade joysticks, a PS4 wireless controller and an 8BitDo Zero covering about 60 systems. I also use it for all of the libretro cores too now. It doesn't miss a beat, so I reckon you're going down the right path.

                          Going back to my GPi vice code, with a bit more testing I'm finding that it's definitely not working for every game, so I reckon your newly produced code will be more successful than mine in "universalising" the controls for the c64. Please feel free to experiment with my code of course and make any changes you think are best.

                          RetroPie v4.4.1 • RPi3 Model B • 5.1V 2.5A PSU • 32GB SanDisk Extreme microSD • 2TB Toshiba Canvio Basics Portable USB 3.0 hard drive • 4 x DragonRise USB Arcade joysticks • 2 x TurboTwist spinners • 1 x USB trackball • 1 x PS4 wireless • 1 x 8BitDo Zero

                          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.