miawtthias
Posts: 7
Joined: Sun Sep 22, 2013 10:23 am

[WIP] Fighting games oriented RPi

Sun Sep 22, 2013 10:39 am

My goal is to use my RPi for fighting games emulation (mainly arcade games). That way I can go to conventions and tournaments, plug my RPi into any TV and play fighting games.

Most of the games I'm wanting to play are CPS2 and neogeo games, so my plan is to use PiFBA, joysticks drivers and to set that up to auto-boot.

So far, I've installed PiFBA and I've been able to get Garou Motw for the neogeo running (it's slow right now but I'll overclock it later, at least I know that PiFBA is working). I've installed xboxdrv but I'm pretty new to it and I can't figure how to use it. Typing xboxdrv in the terminal give me an error message : "USBController(): libusb_open() failed LIBUSB_ERROR_ACCESS"

I'm using a self-powered USB hub and an official wired xbox 360 controller.

welshy
Posts: 1667
Joined: Mon Oct 29, 2012 2:07 pm

Re: [WIP] Fighting games oriented RPi

Sun Sep 22, 2013 10:56 am

miawtthias
Ok, thats not to difficult to remedy, you need to add the correct script to the rc.local file for the controller

From a Terminal Type -
sudo nano /etc/rc.local (then Enter it will open and display the file)

At the bottom, the line above 'Exit' Type -

xboxdrv --trigger-as-button --id 0 --led 2 --deadzone 4000 --silent &
sleep 1

Then Left Ctrl and x
Type y (to overwrite the file)
Then Enter to exit
Plug your controller in, reboot your RPi (Type - sudo reboot) and it should now inform you 'xbox360 controller now available' (or words to that effect!)

That's it! It should run with PiFBA (and most other emulators) by default (i.e no need to change anything else)

PS Garou: Nice choice!
"The list of things I have heard now contains everything!"

miawtthias
Posts: 7
Joined: Sun Sep 22, 2013 10:23 am

Re: [WIP] Fighting games oriented RPi

Sun Sep 22, 2013 11:54 am

Thanks a lot welshy ! Now it's working with a xbox 360 controller. Next step is to check if it works with my arcades sticks.

welshy
Posts: 1667
Joined: Mon Oct 29, 2012 2:07 pm

Re: [WIP] Fighting games oriented RPi

Sun Sep 22, 2013 12:02 pm

miawtthias
No Probs!
"The list of things I have heard now contains everything!"

miawtthias
Posts: 7
Joined: Sun Sep 22, 2013 10:23 am

Re: [WIP] Fighting games oriented RPi

Sun Sep 22, 2013 9:46 pm

It works with my Qanba Q4RAF (both xbox360 and ps3 mode) and my Mayflash arcade sticks. Now I need to make a config file for each controller because the layout is diferent. The Qanba recognise the directions as D-pad inputs. How do I read the "key id" in terminal ?

welshy
Posts: 1667
Joined: Mon Oct 29, 2012 2:07 pm

Re: [WIP] Fighting games oriented RPi

Mon Sep 23, 2013 9:22 am

miawtthias
jstest is part of the package 'joystick' so install this first
Type - sudo apt-get install joystick

Now to run it
Type - jstest
This will indicate how to use jstest
jstest [<mode>] <device>

I would suggest --normal (one line mode). The device is the line on boot that tells you where the joypad/stick is (In this case /dev/input/js0)

So
Type - jstest --normal /dev/input/js0

Now press the buttons and move the pad/sticks, this will indicate the associated Axis (numbers are shown) Buttons (on/off)
e.g D-Pad Axis are 4: (x Axis) and 5: (y Axis), Button 'X' is 2: then change the pifba2x.cfg file to suit

To add a second joystick (sound like you may want to with the plethora of available devices!) add another line in the rc.local and increment by '1'
i.e. xboxdrv --trigger-as-button --id 1 --led 3 --deadzone 4000 --silent &
sleep 1

Then jstest for the codes if required
jstest --normal /dev/input/js1
Again, change the pifba2x.cfg to suit
"The list of things I have heard now contains everything!"

miawtthias
Posts: 7
Joined: Sun Sep 22, 2013 10:23 am

Re: [WIP] Fighting games oriented RPi

Mon Sep 23, 2013 11:50 am

Buttons configuration is working perfectly but I still have a problem with the D-pad.
As you said, jstest shows that it is associated with the 4 and 5 axes but even after editing fba2x.cfg with this values it still doesn't work. I've tested 2 and 3 axes just in case and it works. I don't understand why it doesn't with 4 and 5 ...

welshy
Posts: 1667
Joined: Mon Oct 29, 2012 2:07 pm

Re: [WIP] Fighting games oriented RPi

Mon Sep 23, 2013 12:00 pm

miawtthias
Probably because the Drivers don't work correctly with the Joystick, that's Linux for you I'm afraid! It sounds like PiFBA isn't interfacing with those Axis for some reason, some Joypads/Joysticks just don't work correctly/at all on Linux. Perhaps its a power issue? Have you plugged the Joystick into the HUB or the RPi USB? (the RPi USB has restricted power output, that's why it wont run a USB Portable HD).
Last edited by welshy on Mon Sep 23, 2013 4:13 pm, edited 1 time in total.
"The list of things I have heard now contains everything!"

miawtthias
Posts: 7
Joined: Sun Sep 22, 2013 10:23 am

Re: [WIP] Fighting games oriented RPi

Mon Sep 23, 2013 3:51 pm

If the drivers didn't work correctly I wouldn't see any input change with jtest, so it doesn't seem to be a driver issue. The controller was plugged via a USB powered hub so not a power issue either.
After checking the google code page for piFBA, I learnt that this problem as already been report and the answer was "The D-pad looks to be a HAT control not a normal joystick axis. There maybe a way to workaround this with the xboxdrv but currently the d-pad on the X360 controller doesn't appear to work nicely with SDL input."
For now I'm going to use ps3 arcade sticks to continue the project in other ways of improvement. I hope that squid/pudding will find a solution soon (most players in my country use xbox 360 arcade sticks).

welshy
Posts: 1667
Joined: Mon Oct 29, 2012 2:07 pm

Re: [WIP] Fighting games oriented RPi

Mon Sep 23, 2013 3:56 pm

miawtthias
As I indicated 'It sounds like PiFBA isn't interfacing with those Axis for some reason' so at least you know its a PiFBA issue and as its been reported pudding may be able to correct it in a further revision. Bummer! (for now).
"The list of things I have heard now contains everything!"

miawtthias
Posts: 7
Joined: Sun Sep 22, 2013 10:23 am

Re: [WIP] Fighting games oriented RPi

Mon Sep 23, 2013 4:16 pm

The problem does'nt only apply to xbox 360 controller. My mayflash arcade stick (ps3) send joysticks inputs as left analog joystick inputs and works fine. The Qanba stick send it as d-pad inputs in xbox 360 mode and as right analog joystick inputs in ps3 mode, but I can't get it to work in either mode. And finally my official xbox 360 wired controller works with the left analog joystick and the right one. Really strange. I'll reply to the pifba topic maybe I can help squid figuring out what the problem is with information from more controllers.

Return to “Gaming”