Using xboxdrv for 4-way restrictor on complete rertropie setup already using dragonrise usb controller setup?
-
@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?
-
@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"
-
@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
-
@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
? -
@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!
-
@tmntturtlguy You could probably achieve a second setup of
lr-mame2003
using Attract Mode. Not sure whether Emulationstation allows you to do this. -
@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
-
@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.
-
@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?
-
@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.
-
@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
-
@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.
-
-
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.
-
@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?
-
@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#msg1309881Its 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 :-)
-
@robertvb83 You've certainly discovered (rediscovered) something of real interest.
All I know is xboxdrv works very well indeed with 4 way games.
-
@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? -
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.
-
well ive applied change to mame2003 plus it works well on a sanwa 8 way for kung fu master. I tried to mimic in code what a 4 way does in a very simple way. i do agree looking at the code briefly it looks like its getting the closest to direction point via analog. Dragon rise is set to analog by default so it probably just ignores and diagonals which is what i done in my code change. Any feedback on this would be good as i only have a 360 controller my ps3 one broke and xbox one is the old wireless type
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.