djdefiant / mame4all-pi

Automatically exported from code.google.com/p/mame4all-pi
0 stars 0 forks source link

Player 2 joystick and buttons doesn't work #17

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What is the expected output? What do you see instead?
In configuration Player 2 joystick and buttons are not recognized.

What version of the product are you using? On what operating system?
I'm using a XIN-mo dual arcade USB Interface on raspbian (2013-05-25). 

Please provide any additional information below.

I connect 2 joysticks and Player 1 works perfectly, but player 2 doesn't work 
(joystick is not configurable in settings). 

With jstest (js0) I see that:

- Axes 0 and 1, and buttons 0-9 are for Player 1.
- Axes 2 and 3, and buttons 10-20 are for Player 2.

Original issue reported on code.google.com by joacl...@gmail.com on 10 Jul 2013 at 8:43

GoogleCodeExporter commented 9 years ago
The "Hori Fighting Stick Mini 3 PS3" uses axis 4 and 5 and has the same problem.

Tried to remap axis with "jscal" tool but it did not have any effect.

Original comment by topg...@gmail.com on 10 Jul 2013 at 9:07

GoogleCodeExporter commented 9 years ago
Hi,

Same problem with Mayflash USB Fighting Stick

The stick is not reconized but the buttons works properly

Original comment by luisfern...@gmail.com on 12 Jul 2013 at 1:33

GoogleCodeExporter commented 9 years ago
Could you all please show the jstest output as joacliba did?

Original comment by squid...@gmail.com on 12 Jul 2013 at 2:35

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
** Header:
Driver version is 2.1.0.
Joystick (HORI CO.,LTD. STICK A) has 6 axes (X, Y, Z, Rz, Hat0X, Hat0Y)
and 13 buttons (BtnX, BtnY, BtnZ, BtnTL, BtnTR, BtnTL2, BtnTR2, BtnSelect, 
BtnStart, BtnMode, BtnThumbL, BtnThumbR, ?).

** Up and clockwise rotation of stick:
Axes:  0:-32767  1:-32767  2:-32767  3:-32767  4:     0  5:     0 Buttons:  
0:off  1:off  2:off  3:off  4:off  5:off  6:off  7:off  8:off  9:off 
Axes:  0:-32767  1:-32767  2:-32767  3:-32767  4:     0  5:-32767 Buttons:  
0:off  1:off  2:off  3:off  4:off  5:off  6:off  7:off  8:off  9:off 10
Axes:  0:-32767  1:-32767  2:-32767  3:-32767  4: 32767  5:-32767 Buttons:  
0:off  1:off  2:off  3:off  4:off  5:off  6:off  7:off  8:off  9:off 10
Axes:  0:-32767  1:-32767  2:-32767  3:-32767  4: 32767  5:     0 Buttons:  
0:off  1:off  2:off  3:off  4:off  5:off  6:off  7:off  8:off  9:off 10
Axes:  0:-32767  1:-32767  2:-32767  3:-32767  4: 32767  5: 32767 Buttons:  
0:off  1:off  2:off  3:off  4:off  5:off  6:off  7:off  8:off  9:off 10
Axes:  0:-32767  1:-32767  2:-32767  3:-32767  4:     0  5: 32767 Buttons:  
0:off  1:off  2:off  3:off  4:off  5:off  6:off  7:off  8:off  9:off 10
Axes:  0:-32767  1:-32767  2:-32767  3:-32767  4:-32767  5: 32767 Buttons:  
0:off  1:off  2:off  3:off  4:off  5:off  6:off  7:off  8:off  9:off 10
Axes:  0:-32767  1:-32767  2:-32767  3:-32767  4:-32767  5:     0 Buttons:  
0:off  1:off  2:off  3:off  4:off  5:off  6:off  7:off  8:off  9:off 10
Axes:  0:-32767  1:-32767  2:-32767  3:-32767  4:-32767  5:-32767 Buttons:  
0:off  1:off  2:off  3:off  4:off  5:off  6:off  7:off  8:off  9:off 10
Axes:  0:-32767  1:-32767  2:-32767  3:-32767  4:     0  5:-32767 Buttons:  
0:off  1:off  2:off  3:off  4:off  5:off  6:off  7:off  8:off  9:off 10
Axes:  0:-32767  1:-32767  2:-32767  3:-32767  4:     0  5:     0 Buttons:  
0:off  1:off  2:off  3:off  4:off  5:off  6:off  7:off  8:off  9:off 10:off 
11:off 12:off 

** Buttons 1-8:
Axes:  0:-32767  1:-32767  2:-32767  3:-32767  4:     0  5:     0 Buttons:  
0:off  1:on   2:off  3:off  4:off  5:off  6:off  7:off  8:off  9:off 10
Axes:  0:-32767  1:-32767  2:-32767  3:-32767  4:     0  5:     0 Buttons:  
0:off  1:off  2:off  3:off  4:off  5:off  6:off  7:off  8:off  9:off 10
Axes:  0:-32767  1:-32767  2:-32767  3:-32767  4:     0  5:     0 Buttons:  
0:on   1:off  2:off  3:off  4:off  5:off  6:off  7:off  8:off  9:off 10
Axes:  0:-32767  1:-32767  2:-32767  3:-32767  4:     0  5:     0 Buttons:  
0:off  1:off  2:off  3:off  4:off  5:off  6:off  7:off  8:off  9:off 10
Axes:  0:-32767  1:-32767  2:-32767  3:-32767  4:     0  5:     0 Buttons:  
0:off  1:off  2:on   3:off  4:off  5:off  6:off  7:off  8:off  9:off 10
Axes:  0:-32767  1:-32767  2:-32767  3:-32767  4:     0  5:     0 Buttons:  
0:off  1:off  2:off  3:off  4:off  5:off  6:off  7:off  8:off  9:off 10
Axes:  0:-32767  1:-32767  2:-32767  3:-32767  4:     0  5:     0 Buttons:  
0:off  1:off  2:off  3:on   4:off  5:off  6:off  7:off  8:off  9:off 10
Axes:  0:-32767  1:-32767  2:-32767  3:-32767  4:     0  5:     0 Buttons:  
0:off  1:off  2:off  3:off  4:off  5:off  6:off  7:off  8:off  9:off 10
Axes:  0:-32767  1:-32767  2:-32767  3:-32767  4:     0  5:     0 Buttons:  
0:off  1:off  2:off  3:off  4:off  5:off  6:off  7:on   8:off  9:off 10
Axes:  0:-32767  1:-32767  2:-32767  3:-32767  4:     0  5:     0 Buttons:  
0:off  1:off  2:off  3:off  4:off  5:off  6:off  7:off  8:off  9:off 10
Axes:  0:-32767  1:-32767  2:-32767  3:-32767  4:     0  5:     0 Buttons:  
0:off  1:off  2:off  3:off  4:off  5:on   6:off  7:off  8:off  9:off 10
Axes:  0:-32767  1:-32767  2:-32767  3:-32767  4:     0  5:     0 Buttons:  
0:off  1:off  2:off  3:off  4:off  5:off  6:off  7:off  8:off  9:off 10
Axes:  0:-32767  1:-32767  2:-32767  3:-32767  4:     0  5:     0 Buttons:  
0:off  1:off  2:off  3:off  4:off  5:off  6:on   7:off  8:off  9:off 10
Axes:  0:-32767  1:-32767  2:-32767  3:-32767  4:     0  5:     0 Buttons:  
0:off  1:off  2:off  3:off  4:off  5:off  6:off  7:off  8:off  9:off 10
Axes:  0:-32767  1:-32767  2:-32767  3:-32767  4:     0  5:     0 Buttons:  
0:off  1:off  2:off  3:off  4:on   5:off  6:off  7:off  8:off  9:off 10
Axes:  0:-32767  1:-32767  2:-32767  3:-32767  4:     0  5:     0 Buttons:  
0:off  1:off  2:off  3:off  4:off  5:off  6:off  7:off  8:off  9:off 10

Original comment by topg...@gmail.com on 12 Jul 2013 at 7:59

GoogleCodeExporter commented 9 years ago
pi@raspberrypi ~ $ jstest /dev/input/js0 Driver version is 2.1.0.
Joystick (MY-POWER CO.,LTD. Mayflash Arcade Stick) has 4 axes (X, Y, Hat0X, 
Hat0Y)
and 12 buttons (Trigger, ThumbBtn, ThumbBtn2, TopBtn, TopBtn2, PinkieBtn, 
BaseBtn, BaseBtn2, BaseBtn3, BaseBtn4, BaseBtn5, BaseBtn6).
Testing ... (interrupt to exit)
Axes:  0:     0  1:     0  2:     0  3:     0 Buttons:  0:off  1:off  2:off  
3:oAxes:  0:     0  1:     0  2:     0  3:     0 Buttons:  0:off  1:off  2:off  
3:oAxes:  0:     0  1:     0  2:     0  3:     0 Buttons:  0:off  1:off  2:off  
3:oAxes:  0:     0  1:     0  2:     0  3:     0 Buttons:  0:off  1:off  2:off  
3:oAxes:  0:     0  1:     0  2:     0  3:     0 Buttons:  0:off  1:off  2:off  
3:oAxes:  0:     0  1:     0  2:     0  3:     0 Buttons:  0:off  1:off  2:off  
3:oAxes:  0:     0  1:     0  2:     0  3:     0 Buttons:  0:off  1:off  2:off  
3:oAxes:  0:     0  1:     0  2:     0  3:     0 Buttons:  0:off  1:off  2:off  
3:oAxes:  0:     0  1:     0  2:     0  3:     0 Buttons:  0:off  1:off  2:off  
3:oAxes:  0:     0  1:     0  2:     0  3:     0 Buttons:  0:off  1:off  2:off  
3:oAxes:  0:     0  1:     0  2:     0  3:     0 Buttons:  0:off  1:off  2:off  
3:oAxes:  0:     0  1:     0  2:     0  3:     0 Buttons:  0:off  1:off  2:off  
3:oAxes:  0:     0  1:     0  2:     0  3:     0 Buttons:  0:off  1:off  2:off  
3:oAxes:  0:     0  1:     0  2:     0  3:     0 Buttons:  0:off  1:off  2:off  
3:oAxes:  0:     0  1:     0  2:     0  3:     0 Buttons:  0:off  1:off  2:off  
3:oAxes:  0:     0  1:     0  2:     0  3:     0 Buttons:  0:off  1:off  2:off  
3:off  4:off  5:off  6:off  7:off  8:off  9:off 10:off 11:off 

** Up and clockwise rotation of stick:
Axes:  0:     0  1:     0  2:     0  3:-32767 Buttons:  0:off  1:off  2:off  
3:oAxes:  0:     0  1:     0  2: 32767  3:-32767 Buttons:  0:off  1:off  2:off  
3:oAxes:  0:     0  1:     0  2: 32767  3:     0 Buttons:  0:off  1:off  2:off  
3:oAxes:  0:     0  1:     0  2: 32767  3: 32767 Buttons:  0:off  1:off  2:off  
3:oAxes:  0:     0  1:     0  2:     0  3: 32767 Buttons:  0:off  1:off  2:off  
3:oAxes:  0:     0  1:     0  2:-32767  3: 32767 Buttons:  0:off  1:off  2:off  
3:oAxes:  0:     0  1:     0  2:-32767  3:     0 Buttons:  0:off  1:off  2:off  
3:oAxes:  0:     0  1:     0  2:-32767  3:-32767 Buttons:  0:off  1:off  2:off  
3:oAxes:  0:     0  1:     0  2:     0  3:-32767 Buttons:  0:off  1:off  2:off  
3:oAxes:  0:     0  1:     0  2:     0  3:     0 Buttons:  0:off  1:off  2:off  
3:off  4:off  5:off  6:off  7:off  8:off  9:off 10:off 11:off 

** Buttons 1-10:
Axes:  0:     0  1:     0  2:     0  3:     0 Buttons:  0:on   1:off  2:off  
3:oAxes:  0:     0  1:     0  2:     0  3:     0 Buttons:  0:off  1:off  2:off  
3:oAxes:  0:     0  1:     0  2:     0  3:     0 Buttons:  0:off  1:on   2:off  
3:oAxes:  0:     0  1:     0  2:     0  3:     0 Buttons:  0:off  1:off  2:off  
3:oAxes:  0:     0  1:     0  2:     0  3:     0 Buttons:  0:off  1:off  2:on   
3:oAxes:  0:     0  1:     0  2:     0  3:     0 Buttons:  0:off  1:off  2:off  
3:oAxes:  0:     0  1:     0  2:     0  3:     0 Buttons:  0:off  1:off  2:off  
3:oAxes:  0:     0  1:     0  2:     0  3:     0 Buttons:  0:off  1:off  2:off  
3:oAxes:  0:     0  1:     0  2:     0  3:     0 Buttons:  0:off  1:off  2:off  
3:oAxes:  0:     0  1:     0  2:     0  3:     0 Buttons:  0:off  1:off  2:off  
3:oAxes:  0:     0  1:     0  2:     0  3:     0 Buttons:  0:off  1:off  2:off  
3:oAxes:  0:     0  1:     0  2:     0  3:     0 Buttons:  0:off  1:off  2:off  
3:oAxes:  0:     0  1:     0  2:     0  3:     0 Buttons:  0:off  1:off  2:off  
3:oAxes:  0:     0  1:     0  2:     0  3:     0 Buttons:  0:off  1:off  2:off  
3:oAxes:  0:     0  1:     0  2:     0  3:     0 Buttons:  0:off  1:off  2:off  
3:oAxes:  0:     0  1:     0  2:     0  3:     0 Buttons:  0:off  1:off  2:off  
3:oAxes:  0:     0  1:     0  2:     0  3:     0 Buttons:  0:off  1:off  2:off  
3:oAxes:  0:     0  1:     0  2:     0  3:     0 Buttons:  0:off  1:off  2:off  
3:oAxes:  0:     0  1:     0  2:     0  3:     0 Buttons:  0:off  1:off  2:off  
3:oAxes:  0:     0  1:     0  2:     0  3:     0 Buttons:  0:off  1:off  2:off  
3:off  4:off  5:off  6:off  7:off  8:off  9:off 10:off 11:off 

Original comment by luisfern...@gmail.com on 13 Jul 2013 at 12:50

GoogleCodeExporter commented 9 years ago
Can you try the file http://mame4all-pi.googlecode.com/git/mametest.zip

It should allow the stick axis to be configured in MAME itself (tab config). 

Original comment by squid...@gmail.com on 16 Jul 2013 at 6:44

GoogleCodeExporter commented 9 years ago
Can't say that it had any effect on my system. Here is what I did.
Made a new mametest directory, unzipped the contents of mametest.zip into it.
Copied some roms to the roms directory and started it with "./mame".

Started a random game. waited until it finnished rom-checks and stuff and 
pressed tab and chose input config for mame. Went down to "UI UP", pressed 
enter and pushed my joystick up, no reaction. Tried the stick in all directions 
but no response.
I did get a reaction from buttons 0-9 but that was also working before.

Is there a possibility to enable some debug-logging to console or file ?

Original comment by topg...@gmail.com on 16 Jul 2013 at 11:05

GoogleCodeExporter commented 9 years ago
Can you try the attached file to see if SDL is detecting your joystick 
properly? Send the output.

Original comment by squid...@gmail.com on 17 Jul 2013 at 8:31

Attachments:

GoogleCodeExporter commented 9 years ago
Also try changing the player up/down etc controls instead of the UI controls.

Original comment by squid...@gmail.com on 17 Jul 2013 at 8:33

GoogleCodeExporter commented 9 years ago
pi@raspberrypi ~ $ ./sdljoystick 
1 joysticks found
4 numaxes
0 numballs
1 numhats
13 numbuttons

I'm not at home so I cant move the joystick. But I'm pretty sure my joystick is 
the one "numhats". My 4 & 5 axix in jstest is called "Hat0X, Hat0Y" after all.

Original comment by topg...@gmail.com on 17 Jul 2013 at 11:50

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Sorry, I couldn't try before. 

My joysticks now are working perfectly, they're called JoyAxis 0+-. JoyAxis 
1+-, JoyAxis 2+- and JoyAxis 3+- :D I can configure all axis in the tab menu 
(as a player, ui controll, and other options)

The problem now are the buttons (I think you only changed axis code), it only 
detects P1 buttons, not the P2 (I think the limit is 10 for joystick).

The result of sdljoystick is:
1 joystick found
4 numaxes
0 numballs
0 numhats
22 numbuttons

Thank you!

Original comment by joacl...@gmail.com on 17 Jul 2013 at 1:59

GoogleCodeExporter commented 9 years ago
Hi,

Mame test does not detect the stick but sdl joystick it does. The output is

1 joysticks found
2 numaxes
0 numballs
1 numhat
12 numbuttons

Original comment by luisfern...@gmail.com on 17 Jul 2013 at 3:58

GoogleCodeExporter commented 9 years ago
In sdljoystick you'd need to move the joystick to see what axis it detects.

I've added 6 more buttons to the detection. Try downloading the 
http://mame4all-pi.googlecode.com/git/mametest.zip file again. Didn't want to 
go too high as adding 6 means 24 (6x 4 joysticks) more button scans are being 
performed and anymore may affect performance.

I need to add configuration to mame.cfg so that the frontend and the analogue 
joystick in MAME will read the correct axis.

Original comment by squid...@gmail.com on 17 Jul 2013 at 5:22

GoogleCodeExporter commented 9 years ago
I tested it and buttons > 9 still doesn't work. I tried to assign button 10 and 
nothing happened. 

Is there a way to assign buttons > 9 to a second joystick? I don't need 22 
buttons for one player but my usb interface has 22 buttons in only one 
joystick, so I can't configure all buttons and player 2 is unplayable.

Or, is there a way to configure that "joystick 1" can manage 22 buttons but the 
other joysticks only 10 as for now?

Total buttons with 16 buttons x joystick = 16 * 4 = 64 posibilities.
Total buttons with P1 with 22 and others with 10 = 22 + 30 = 52 posibilities.

With this solution the scans are reduced and the usb interfaces that has 2 
players in one are fully functional.

Original comment by joacl...@gmail.com on 17 Jul 2013 at 6:34

GoogleCodeExporter commented 9 years ago
The joystick (Hat) axis on my Hori stick are not detected by "sdljoystick".
So I guess you are not listening for SDL_JoyHatEvent.
Buttons 0-12 seems Ok though.

Original comment by topg...@gmail.com on 17 Jul 2013 at 7:06

GoogleCodeExporter commented 9 years ago
OK, download the mametest.zip again. Hopefully extra buttons should now work, 
I'm working blind here as my joystick doesn't have so many.

Buttons are per joystick, i.e. 16 per joystick, they can't have a different 
number of buttons.

Original comment by squid...@gmail.com on 17 Jul 2013 at 7:11

GoogleCodeExporter commented 9 years ago
The buttons still don't work. Button 10+ are not configurable on the tab menu. 
Can I give you more information? Any file or log?

Original comment by joacl...@gmail.com on 17 Jul 2013 at 11:56

GoogleCodeExporter commented 9 years ago
Please download mametest.zip again for the 16 buttons.

Original comment by squid...@gmail.com on 18 Jul 2013 at 7:25

GoogleCodeExporter commented 9 years ago
Everything is working now.thank you!

Original comment by joacl...@gmail.com on 18 Jul 2013 at 11:03

GoogleCodeExporter commented 9 years ago
I've made a small hack for joystick hat controls which I and luisfern have on 
our arcade sticks.

You can find the patch here: http://paste.debian.net/17164/

It maps the hat input to keyboard input. It only supports 1 hat per joystick 
(so far) but four joysticks. The first joystick is mapped to arrow keys, the 
second to num-pad (8,2,4,6) , the third to "WSAD" and the fourth to "TGFH".

Not the cleanest solution but it works very well for me.

Original comment by topg...@gmail.com on 19 Jul 2013 at 9:37

GoogleCodeExporter commented 9 years ago
Hi #22 the patch is unaviable now... can you repost it again?

Original comment by luisfern...@gmail.com on 6 Aug 2013 at 7:01

GoogleCodeExporter commented 9 years ago
Here it is again.

Original comment by topg...@gmail.com on 6 Aug 2013 at 7:54

Attachments:

GoogleCodeExporter commented 9 years ago
Hi

Just for information

The patch from #24 works properly with my stick

Original comment by luisfern...@gmail.com on 11 Aug 2013 at 2:56

GoogleCodeExporter commented 9 years ago
I have download the patch.txt from #24..
but how do I apply it??

Original comment by gnima...@gmail.com on 1 Sep 2013 at 2:39

GoogleCodeExporter commented 9 years ago
with sdljoystick, I get no reading from joystick up and left
how can I fix this?

Original comment by gnima...@gmail.com on 1 Sep 2013 at 2:56

GoogleCodeExporter commented 9 years ago
#26 I believe "patch -up0 < patch.txt" will do the trick from the checkout 
directory. You can test with "--dry-run" option.

Original comment by topg...@gmail.com on 1 Sep 2013 at 9:21

GoogleCodeExporter commented 9 years ago
Changes were applied in the latest version. Hat support wasn't added though due 
to the complications with SDL input support for it.

Original comment by squid...@gmail.com on 4 Sep 2013 at 8:42

GoogleCodeExporter commented 9 years ago
Hi! I am trying to configure in mame4all-pi more than 16 buttons and it doesn't 
work. I used jstest /dev/input/js0 and detect button 16 and 17, but in mame 
menu (tab) doesn't work this buttons.

Any idea?

Regards

Original comment by efraimsa...@gmail.com on 17 Mar 2014 at 6:39

Attachments:

GoogleCodeExporter commented 9 years ago
Has the issue with Mayflash USB Fighting Stick been resolved in the latest 
releases or does the patch still need to be applied? Buttons work but no stick 
response in retropie mame even though jstest shows stick working fine on axis 2 
and 3. Thanks

Original comment by cepop...@gmail.com on 28 Jul 2014 at 3:34

GoogleCodeExporter commented 9 years ago
same problem here Mayflash USB Fighting Stick: Buttons work but no stick 
response in retropie mame 
Thanks!

Original comment by angelope...@gmail.com on 26 Aug 2014 at 3:13

GoogleCodeExporter commented 9 years ago
Hi, i tried to apply the patch.txt in Mame4all-pi folder but i get an error 
"can't find file to patch at input line 5".
can anyone help?
Thanks!

Original comment by angelope...@gmail.com on 29 Aug 2014 at 10:47

GoogleCodeExporter commented 9 years ago
The patch is over a year old so files might have been renamed or moved, it 
might also be that your are not standing in the correct directory when running 
the patch command.

Original comment by topg...@gmail.com on 30 Aug 2014 at 3:30

GoogleCodeExporter commented 9 years ago
Hi, I've tried to use my usb Joystick on my Retropie, in ones, atari and 
anothers emulators it's OK. But in Mame, when I tried to configure input in 
MameUI, my hat buttons is not detected, My Joybuttons are OK. I'm using a 
Microntek usb Joystick adapted to a arcade controller. 

Original comment by ruan.ra...@gmail.com on 7 Nov 2014 at 4:12

Attachments:

GoogleCodeExporter commented 9 years ago
Hello everyone,

I am using Hori stick wireless with Mame4all on my rpi.
When trying to change inputs in the Tab Menu, every buttons are correctly 
detected except the joy (Up, Down, Left, Right). 
Jstest is showing that it is 4 & 5 that are changing when moving the stick.

I understood that I need to apply the patch, but do I need to launch Make 
afterwards in order to recompile ? Even if I did a binary install of retropie, 
can I do that ?

Thanks Squid and very good job !

Original comment by pouill...@gmail.com on 24 Nov 2014 at 11:54

GoogleCodeExporter commented 9 years ago
Hi, can someone post a "noob" guide for patching those file for using a Hori 
mini 3 joystick
thx

Original comment by scorpius...@gmail.com on 22 Dec 2014 at 1:01

GoogleCodeExporter commented 9 years ago
I need hat support as well! This is a decent inexpensive usb arcade stick, and 
without hat support it's useless in mame :(

Original comment by dro...@gmail.com on 24 Mar 2015 at 4:50