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

    Using xboxdrv for 4-way restrictor on complete rertropie setup already using dragonrise usb controller setup?

    Scheduled Pinned Locked Moved Help and Support
    xboxdrvjoystickrestrictor
    31 Posts 5 Posters 6.3k 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
      spud11 @TMNTturtlguy
      last edited by

      @tmntturtlguy I am also quite keen on finding out whether you can use xboxdrv via runcommand-onstart.sh for individual roms. I tried multiple ways some months ago, but just couldn't get it to work. There are no guidelines for $3 or $4.

      However, you probably don't need a configuration that applies to individual roms anyway. With the code I've set out in my earlier post for lr-mame2003, you could adapt it:

      1. You would define $RestrictedArcadeGames as the 12 roms/games (instead of the 200 roms I've got);
      2. Unlike my 4 joystick setup, your joycommand for $RestrictedArcadeGames would refer to only the 1 joystick that you want to use it for and the 4 way restricted configuration would apply; and
      3. The * applies to all other roms not defined as $RestrictedArcadeGames, and the joycommand would again refer to the 1 joystick only but would refer to the unrestricted configuration, instead of the 4 way restricted configuration.

      You wouldn't need to worry about which folder the roms appear in. Whenever you activate lr-mame2003 for a particular rom, the code would kick in - either the rom will trigger the 4 way restricted configuration or it will trigger the unrestricted configuration.

      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

      TMNTturtlguyT 1 Reply Last reply Reply Quote 0
      • TMNTturtlguyT
        TMNTturtlguy @spud11
        last edited by

        @spud11 Thanks, but wouldn't i then need to configure all the roms that use lr-mame2003 to use the xboxdrv as the controller configuration? I apologize as I am a little confused here. the way i read your instructions is that the restricted games would be 4-way and all others would be 8-way, but they would all still be using xboxdrv as the controller input?

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

          @tmntturtlguy That is right. All of the lr-mame2003 roms would be using xboxdrv. Are you concerned that you might have to set up xboxdrv for every single game individually? If so, don't be. You only need to do to set it up once "in game".

          What you do is in 1 game only (any game), press TAB, go to input (general) and set up Player 1 to use keys (eg left arrow is left, right arrow is right etc) and do all your buttons.

          Then xboxdrv is used to emulate the keys - push left on the joystick = left arrow; press button A on my arcade table = left control (basically "fire" in Mame).

          Example of my joystick setup is below. I've previously followed @mediamogul 's guide so I know what each button on my arcade table does.

          You can see from the last lines that my arcade buttons (about 12 of them) correspond to various keys . I've set those keys in Mame using TAB, input "general".

          Player1_4Way_Mame2003="sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv > /dev/null 2>&1 \
          --silent \
          --detach-kernel-driver \
          --deadzone=4000 \
          --deadzone-trigger 15% \
          --force-feedback \
          --mimic-xpad \
          --trigger-as-button \
          --ui-buttonmap tl=void,tr=void,guide=void \
          --evdev /dev/input/by-path/platform-3f980000.usb-usb-0:1.3.3:1.0-event-joystick \
          --device-name "Player_1" \
          --evdev-absmap ABS_X=y1,ABS_Y=x1 \
          --four-way-restrictor \
          --evdev-keymap BTN_THUMB2=a,BTN_PINKIE=b,BTN_TRIGGER=x,BTN_THUMB=y,BTN_TOP2=lb,BTN_TOP=rb,BTN_BASE3=back,BTN_BASE6=start,BTN_BASE2=lt,BTN_BASE5=rt \
          --ui-axismap X1=KEY_LEFT:KEY_RIGHT,Y1=KEY_UP:KEY_DOWN \
          --ui-buttonmap a=KEY_LEFTCTRL,b=KEY_LEFTALT,x=KEY_SPACE,y=KEY_LEFTSHIFT,lb=KEY_UNKNOWN,rb=KEY_UNKNOWN,back=KEY_UNKNOWN,start=KEY_UNKNOWN,back+lt=KEY_SPACE+KEY_ESC,lt=KEY_5+KEY_1,rt=KEY_6+KEY_2"
          

          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

          TMNTturtlguyT 1 Reply Last reply Reply Quote 0
          • TMNTturtlguyT
            TMNTturtlguy @spud11
            last edited by

            @spud11 thank you, but this is exactly what I want to avoid. I want to/need to keep my retroarch setup for all of my games, and I do not use the same exact button configuration of all of my games either.

            I have 4 joysticks set up for my 4 players. They all have 6 buttons plus start, select, and a coin button. I then have 2 USB ports where I can plug in controllers, I have 2 PS4 controllers and 2 SNES style generic USB controllers. I can plug them in and use those on each game as well instead of the joysticks. This would be very difficult to manage for all the roms, all the controllers and then other systems if I don't use the retroarch controls.

            Lastly, I run several different game core options depending on game type. Several games just use a fire button , so those are set to button one, or my 'b' button. Others use 2 buttons for bomb and fire, while others use 2 buttons for "jump" and "attack". When in games that are shooters I want my 1 button or "b" button to be the fire button and my 2 button "a" to be bomb. In the other 2 button games I want my buttons to be opposite to match an nes controller. Therefore the buttons swap. Some games are 3 button games, so I use the bottom 3 buttons which are 1, 2, and 3 or "b" "a" "r". While other games are 4 button in which case I use two setups depending on what the buttons do, either buttons 1,2,3 and 4 which use all 3 bottom rows and 1 top row, or I use two bottom and 2 top buttons, "b" "a" and "y" and "x". Lastly my fighters are 6 game buttons and they are set up so all kick buttons are the bottom 3 buttons and all punch buttons are the top 3 buttons. These are all coordinated with a PS4 or SNES controller so they would also work as expected.

            So....it is not just as easy as setting up one game with the tab button at this point.

            Thanks

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

              @tmntturtlguy Aah. That makes sense. You're using multiple kinds of controllers; I'm not. I've included @MadHorse in here because my recollection is that he set up the original runcommand-onstart.sh case statement. Perhaps he might have an idea how to setup individual rom statements using $3 or $4?

              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

              TMNTturtlguyT 1 Reply Last reply Reply Quote 1
              • TMNTturtlguyT
                TMNTturtlguy @spud11
                last edited by

                @spud11 great! Thanks! My other thought was to try to set up a second "copy" of lr-mame2003 and put my 4 way games into a "classic arcade" system and run the duplicated lr-mame2003, but have it use its own runcommand and core so that I could keep my existing name setup and then setup the second version exactly as you have. I started a different thread about trying to run 2 separate installs of the same emlator, but have not had much success on that front either! I have a way to complicated setup, but it sure is cool and works really well.....except those darn 4 way games!

                S robertvb83R 2 Replies Last reply Reply Quote 0
                • S
                  spud11 @TMNTturtlguy
                  last edited by

                  @tmntturtlguy You could probably achieve a second setup of lr-mame2003 using Attract Mode. Not sure whether Emulationstation allows you to do this.

                  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
                  • robertvb83R
                    robertvb83 @TMNTturtlguy
                    last edited by

                    @tmntturtlguy did you get any further in your investigation of how to enable 4-way restriction rom-specific...

                    I have the exact same setup like you, with 2 zero delay usb controllers for 2 players

                    My full size arcade cabinet Robotron vs. Octolyzer

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

                      @robertvb83 @TMNTturtlguy The best way is to follow the xboxdrv guide at https://github.com/RetroPie/RetroPie-Setup/wiki/Universal-Controller-Calibration-&-Mapping-Using-xboxdrv

                      I've got 4 dragonrise joysticks working very well with xboxdrv with individualised configurations for 4 way games and the same for 8 way games.

                      Also @mediamogul recently discovered a way to swap between 4-way and 8-way joystick configurations "on the fly" with xboxdrv.

                      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

                      robertvb83R 1 Reply Last reply Reply Quote 0
                      • robertvb83R
                        robertvb83 @spud11
                        last edited by

                        @spud11 OK, for now i don't have time to deal with this crazy complexity of xboxdrv...

                        In general what does this make differently... i mean in the end it has to guess the direction you intend to use depending on your inputs... This is also done by default in Retropie by means of ignoring the unchanged direction between two movements.

                        meaning moving from up to up/right ignores up as it has not changed leading to a right control input. Is this generally done differently with xboxdrv?

                        My full size arcade cabinet Robotron vs. Octolyzer

                        mediamogulM 1 Reply Last reply Reply Quote 0
                        • mediamogulM
                          mediamogul Global Moderator @robertvb83
                          last edited by mediamogul

                          @robertvb83 said in Using xboxdrv for 4-way restrictor on complete rertropie setup already using dragonrise usb controller setup?:

                          moving from up to up/right ignores up as it has not changed leading to a right control input. Is this generally done differently with xboxdrv?

                          Using four-way restriction would ignore up/right altogether. A large number of games can't read those inputs, leading to deadly stall-outs in control. It's most easily seen in any of the 'Pac-Man' games. When turning a corner. If the game reads a mixed input, you're Pac-character will just hang there until a decisive up, down, left or right input is read. Another good example is 'Donkey Kong' or 'Burger Time'. Using ladders should be easy, but with mixed inputs, many times you character just stalls-out.

                          RetroPie v4.5 • RPi3 Model B • 5.1V 2.5A PSU • 16GB SanDisk microSD • 512GB External Drive

                          robertvb83R 1 Reply Last reply Reply Quote 0
                          • robertvb83R
                            robertvb83 @mediamogul
                            last edited by

                            @mediamogul as far as i understand from mame changelog (do not find where i read that) basically mame knows if it is a 4-way or 8-way game. so in case of a 4-way game it decides to translate up/right into right in case you switch from up. i am just curios how xboxdrv deals with it, as it has to come up with a prediction method also

                            My full size arcade cabinet Robotron vs. Octolyzer

                            mediamogulM 1 Reply Last reply Reply Quote 0
                            • mediamogulM
                              mediamogul Global Moderator @robertvb83
                              last edited by mediamogul

                              @robertvb83 said in Using xboxdrv for 4-way restrictor on complete rertropie setup already using dragonrise usb controller setup?:

                              as far as i understand from mame changelog (do not find where i read that) basically mame knows if it is a 4-way or 8-way game.

                              Nice! I use AdvanceMame on RetroPie, which makes use of the 0.106 code base and that feature wasn't added by that point. Any idea when it was introduced? As far as xboxdrv goes, I have a list of games that benefit from four-way restriction and I use it to launch the proper map from the runcommand-onstart script. As @spud11 mentioned above, I also found a way to switch between the two as the situation calls for it, but I haven't impleented it in my setup yet.

                              RetroPie v4.5 • RPi3 Model B • 5.1V 2.5A PSU • 16GB SanDisk microSD • 512GB External Drive

                              robertvb83R 1 Reply Last reply Reply Quote 0
                              • robertvb83R
                                robertvb83 @mediamogul
                                last edited by

                                @mediamogul my information is from

                                this post
                                http://www.mameworld.info/ubbthreads/showthreaded.php?Cat=&Number=358647&page=0&view=expanded&sb=5&o=&vc=1

                                in this thread
                                http://www.mameworld.info/ubbthreads/showflat.php?Cat=&Number=358620&page=0&view=expanded&sb=5&o=&vc=1

                                My full size arcade cabinet Robotron vs. Octolyzer

                                mediamogulM 1 Reply Last reply Reply Quote 0
                                • mediamogulM
                                  mediamogul Global Moderator @robertvb83
                                  last edited by

                                  @robertvb83

                                  Very interesting. I've never run into the feature in practice. It looks as though it's been tweaked and gutted quite a few times. Perhaps the MAME team just decided to leave it out at some point.

                                  RetroPie v4.5 • RPi3 Model B • 5.1V 2.5A PSU • 16GB SanDisk microSD • 512GB External Drive

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

                                    @mediamogul Holy moly. That is interesting. I'm doubtful the 8 way/4 way MAME dichotomy works in the RetroPie versions of MAME. At least when I've tried playing Ms Pacman with an 8 way non-restricted xboxdrv configuration, Ms Pacman's head basically spins around. When I've used the 4 way restriction, there's no problem. Mind you I'm not using MAME 0.37B as referenced in the thread. Perhaps 4 way games would work properly with MAME 0.37B in Retropie?

                                    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

                                    robertvb83R 1 Reply Last reply Reply Quote 0
                                    • robertvb83R
                                      robertvb83 @spud11
                                      last edited by

                                      @spud11 hmm I don't know. I understood that statements like it was implemented around 2002 and kept since for future versions...

                                      here is a nother discussion with part of the code...
                                      http://forum.arcadecontrols.com/index.php/topic,123175.msg1309881.html#msg1309881

                                      Its really hard to figure such things out for me, because I do not really know where and what exactly to search. If I only had the time to test all this :-)

                                      My full size arcade cabinet Robotron vs. Octolyzer

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

                                        @robertvb83 You've certainly discovered (rediscovered) something of real interest.

                                        All I know is xboxdrv works very well indeed with 4 way games.

                                        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

                                        robertvb83R 1 Reply Last reply Reply Quote 0
                                        • robertvb83R
                                          robertvb83 @spud11
                                          last edited by

                                          @spud11 @mediamogul i created an issue for mame2003-plus https://github.com/libretro/mame2003-plus-libretro/issues/380#issuecomment-425712224
                                          The discussiin is about how the xboxdrv driver internally manages the task of 4way conversion for 8way joystick inputs. Can you help clarifying? E.g. what does the software exactly do with the 4way option flag?

                                          My full size arcade cabinet Robotron vs. Octolyzer

                                          mediamogulM 1 Reply Last reply Reply Quote 0
                                          • mediamogulM
                                            mediamogul Global Moderator @robertvb83
                                            last edited by

                                            @robertvb83

                                            I'm really not sure, but I've always assumed that it takes the diagonal space, divides it in two and assigns the closest allowed direction whenever a joystick goes past the divide. However, that theory wouldn't seem to hold water for digital 8-way directional joysticks, so I'm either wrong, or the technique only works with analog joysticks. I've tested on an 8-way before and I seem to remember it working, but it's been close to two years and I didn't spend a lot of time with it, so it's possible I'm misremembering. Of course, the guy you'd really want to ask is Grumbel, the developer of xboxdrv. He moved development to Gitlab shortly after Microsoft bought Github, so you can currently find him there.

                                            RetroPie v4.5 • RPi3 Model B • 5.1V 2.5A PSU • 16GB SanDisk microSD • 512GB External Drive

                                            1 Reply Last reply Reply Quote 1
                                            • 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.