DudeWhoNeedsAGit / pisnes

Automatically exported from code.google.com/p/pisnes
0 stars 0 forks source link

Can't bind N64 controller D-Pad in snes9x.cfg #14

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Use a N64 controller plugged in through the GPIO
2. Attempt to map JA_LR or LEFT_1, etc. to the D-Pad in snes9x.cfg

Hi, I'm using PiSNES as included in RetroPie, and I've managed to set it up and 
it runs fine, apart from one thing that's been bugging me. My Nintendo 64 
controller that I've plugged in to the GPIO works very well in PiSNES and other 
emulators, but I can't seem to find a way to bind the D-Pad (instead of the 
crappy joystick) to anything in PiSNES using snes9x.cfg.

jstest /dev/input/js0 tells me that the left-right axis of the D-pad has the 
code 2 (or Hat0X) and the up-down axis has the code 3 (or Hat0Y), and when 
pressing them the program shows the value 32767, negative for left and up.

I've tried endless variants to bind the D-pad to something, including the lines 
(not at the same time, of course):

JA_LR=2
LEFT_1=2
LEFT_1=-2
LEFT_1=2-
LEFT_1=2(32767)
LEFT_1=2_32767
LEFT_1=232767
LEFT_1=Hat0(32767)

..the list goes on, and none of these options gave any response. I've searched 
everywhere for some way to make this work. 

So my questions are:

1. Is there some line you can write in snes9x.cfg specifically for D-Pad axes 
(like DA_LR instead of JA_LR or something)?
2. Is there a way to specify a single direction of the D-pad rather than an 
axis so that I would be able to use LEFT_1 = xxxxxx?
3. Is there some predefined axis threshold (that could possibly be redefined) 
that explains why JA_LR and JA_UD won't accept the D-pad axes, given that the 
D-Pad gives a flat +/- 32767 as opposed to the values from -~21000 to +~21000 
from the joystick?*
4. Am I missing something obvious here?

*This document (http://code.google.com/p/mupen64plus/wiki/ControllerSetup), 
which is about the most relevant help I could find, mentions such a property, 
AnalogPeak = 32768,32768, alongside  AnalogDeadzone = 4096,4096. PiSNES (or 
SDL, or the 'joystick' package, or _something_) seems to have this integrated, 
since I have to push the joystick with significant force (probably 
corresponding to a value of >4000) in order for the game to register a 
directional move.

Hopefully I've managed to make my situation clear, even though I don't have 
much experience with linux or emulators.

Any help would be greatly appreciated.

Original issue reported on code.google.com by brage.aa...@gmail.com on 7 Oct 2013 at 2:50

GoogleCodeExporter commented 8 years ago
HAT/DPAD support isn't in PiSNES. I recently put it in PiFBA so you could try 
that to see if it works. The same code will eventually go in PiSNES.

Looking at your controller the HAT axis probably will need configuration as 
currently it's fixed for the XBOX360 controller which uses the same axis.

HAT support under SDL Input seems pretty inconsistent.

Original comment by squid...@gmail.com on 8 Oct 2013 at 3:26

GoogleCodeExporter commented 8 years ago
Thanks for the reply! I had a look at PiFBA and tried to copy part of the code 
there (the switch/case block with the SDL_JOYHATMOTION) into unix.cpp in 
pisnes/unix and tried to compile that to unix.o, but being totally new to 
comliling and linux in general, it wouldn't let me. Some .h file or something 
was reported missing when I tried to compile. 

Is this a futile idea, and should I rather wait until you've added it to PiSNES 
yourself, or could I replace the original unix.cpp file and then install PiSNES 
again with the modified unix.cpp? Or is there a simpler way of compiling just 
that file? (as I menitoned, g++ gives me an error)

Original comment by brage.aa...@gmail.com on 10 Oct 2013 at 1:30

GoogleCodeExporter commented 8 years ago
I was thinking more that you could try PiFBA to check how it performs with your 
joystick and feedback.

Original comment by squid...@gmail.com on 10 Oct 2013 at 3:03

GoogleCodeExporter commented 8 years ago
You mentioned the xbox360 pad, does pisnes work with the dpad with this 
controller? I can't seem to get it to work with dpad even by switiching the 
axis to 4 and 5  in the config file. (which should be the dpad for my xbox 
setup). 

Original comment by rkitche...@googlemail.com on 15 Oct 2013 at 8:46

GoogleCodeExporter commented 8 years ago
DPAD support is not working yet.

Original comment by squid...@gmail.com on 25 Oct 2013 at 11:28

GoogleCodeExporter commented 8 years ago
Is there DPAD support yet because I can't seem to get it working :/

Original comment by dashkil...@gmail.com on 8 Jan 2014 at 11:16

joshlasdin commented 8 years ago

Any update on this? Having the same issue with my 8bitdo NESPro 30's