skmp / reicast-emulator

Reicast was a multiplatform Sega Dreamcast emulator
https://reicast.emudev.org
Other
1.1k stars 344 forks source link

PS3 Controller not being properly identified #314

Closed AbandonedCart closed 6 years ago

AbandonedCart commented 10 years ago

We get the right stick values for controllers that have one. The code to go from motion to button and button to motion is there now.

Should it be an optional replacement for the left stick, substitute for the dpad, a useless appendage on the controller? Thoughts? Anyone?

Elwood89 commented 10 years ago

Maybe set it by default to substitute the dpad, and let users map it to whatever they feel as an option?

wurz311 commented 10 years ago

Yeah. I have mine mapped to dpad cause a lot of games use it to make up for less button on dreamcast. Msr uses it for camera controls. Rush 2049 uses it for reset and camera. But it would be better if dpad could be mapped to both dpad and right analog to save switching. Ppsspp has an option to map multiple controller buttons to same mapping. So if you have seen that you will know what I mean.

ppsspp213 commented 10 years ago

Could map A and B to Up & Down on the analog stick for driving games Accelerate/Brake. Is Jump Pack, Puru Puru Pack, Vibration Pack going to be an future option? I like use a dualshock3 with it, I saw sixaxis controller in the play store mentions experimental vibration feedback, mupen64ae has rumble pak support but I don't feel a thing yet.

AbandonedCart commented 10 years ago

I used vibration support. All it did was redirect standard android vibration to the controller. More or less just an annoyance.

A and B sounds like the best use with a toggle for L and R in-game. It's been a while so I forget if games adopted the trigger gas and break back then.

I'll have to play with it when I finish the full rebuild. I have a NativeActivity that supports the Play touchpad inline with player numbers. Most of the emulators and games are either Play or not. This treats it like the Shield controller and allows mapping it to any port. It's been a real ***\ playing who answers the call.

wurz311 commented 10 years ago

A lot of racing games use triggers for gas and brake. But whether its analog reading or just digital steps dumped on triggers i dont know.

AbandonedCart commented 10 years ago

They register as analog as far as how they are sent so it would just be redirecting the keycode for that.

AbandonedCart commented 10 years ago

For now, it register as holding the button down for a and b when it's more than half up or down and releases when it isn't. For l and r it acts exactly as they do normally just as up or down instead of individual keys. The hard part is making the toggle icons.

ppsspp213 commented 10 years ago

Is the dualshock/sixaxis supported yet?, I can only get it to register circle which brings up the debug menu, acting as a back button, GT Racing 2 recognises it as a moga controller.

AbandonedCart commented 10 years ago

I know we have maps and detection for PS3 controllers so maybe some are reading differently. If you get a chance, connect it, load a game, but just wait until the game starts before pressing anything. That should print all the devices to the log. What is needed is the name for that one.

ppsspp213 commented 10 years ago

I'm not given any log txt file anymore after pressing submit error log. But I was able to get the following info in terminal emulator, lsusb wouldn't work as I'm not rooted.

127|u0_a108@flo:/ $ cat sys/bus/usb/devices/*/product PLAYSTATION(R)3 Controller Qualcomm On-Chip EHCI Host Controller

u0_a108@flo:/ $ cat sys/kernel/debug/usb/devices T: Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=480 MxCh= 1 B: Alloc= 4/800 us ( 1%), #Int= 1, #Iso= 0 D: Ver= 2.00 Cls=09(hub ) Sub=00 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=1d6b ProdID=0002 Rev= 3.04 S: Manufacturer=Linux 3.4.0-gac9222c ehci_hcd S: Product=Qualcomm On-Chip EHCI Host Controller S: SerialNumber=msm_hsusb_host C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr= 0mA I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub E: Ad=81(I) Atr=03(Int.) MxPS= 4 Ivl=256ms

T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 4 Spd=12 MxCh= 0 D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=054c ProdID=0268 Rev= 1.00 S: Manufacturer=Sony S: Product=PLAYSTATION(R)3 Controller C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=500mA I:* If#= 0 Alt= 0 #EPs= 2 Cls=03(HID ) Sub=00 Prot=00 Driver=usbhid E: Ad=02(O) Atr=03(Int.) MxPS= 64 Ivl=1ms E: Ad=81(I) Atr=03(Int.) MxPS= 64 Ivl=1ms u0_a108@flo:/ $ u0_a108@flo:/ $ cat proc/bus/input/devices I: Bus=0000 Vendor=0000 Product=0000 Version=0000 N: Name="elan-touchscreen" P: Phys= S: Sysfs=/devices/virtual/input/input0 U: Uniq= H: Handlers=event0 cpufreq B: PROP=2 B: EV=b B: KEY=0 B: ABS=6618000 0

I: Bus=0000 Vendor=0000 Product=0000 Version=0000 N: Name="lid_input" P: Phys=/dev/input/lid_indev S: Sysfs=/devices/virtual/input/input1 U: Uniq= H: Handlers=event1 cpufreq B: PROP=0 B: EV=21 B: SW=1

I: Bus=0000 Vendor=0000 Product=0000 Version=0000 N: Name="apq8064-tabla-snd-card Button Jack" P: Phys=ALSA S: Sysfs=/devices/platform/soc-audio.0/sound/card0/input2 U: Uniq= H: Handlers=event2 cpufreq B: PROP=0 B: EV=3 B: KEY=ff 0 0 0 0 0 0 0 0

I: Bus=0000 Vendor=0000 Product=0000 Version=0000 N: Name="apq8064-tabla-snd-card Headset Jack" P: Phys=ALSA S: Sysfs=/devices/platform/soc-audio.0/sound/card0/input3 U: Uniq= H: Handlers=event3 cpufreq B: PROP=0 B: EV=21 B: SW=1c054

I: Bus=0000 Vendor=0000 Product=0000 Version=0000 N: Name="h2w button" P: Phys= S: Sysfs=/devices/virtual/input/input4 U: Uniq= H: Handlers=kbd event4 cpufreq B: PROP=0 B: EV=3 B: KEY=4 0 0 0 0 0 0 0

I: Bus=0019 Vendor=0001 Product=0001 Version=0100 N: Name="gpio-keys" P: Phys=gpio-keys/input0 S: Sysfs=/devices/platform/gpio-keys.0/input/input5 U: Uniq= H: Handlers=kbd event5 keychord cpufreq B: PROP=0 B: EV=3 B: KEY=1c0000 0 0 0

I: Bus=0003 Vendor=054c Product=0268 Version=0111 N: Name="Sony PLAYSTATION(R)3 Controller" P: Phys=usb-msm_hsusb_host-1/input0 S: Sysfs=/devices/platform/msm_hsusb_host/usb1/1-1/1-1:1.0/input/input11 U: Uniq= H: Handlers=event6 cpufreq B: PROP=0 B: EV=1b B: KEY=70000 0 0 0 0 0 0 0 0 0 0 0 0 ffff 0 0 0 0 0 0 0 0 0 B: ABS=7fffff00 27 B: MSC=10

u0_a108@flo:/ $

AbandonedCart commented 10 years ago

The name matches. I'll have to dig one up and see what's going wrong.

The log should still save to the card but that may be a context issue when it got moved for the submissions

ppsspp213 commented 10 years ago

http://i.imgur.com/qd9KX1B.png from Mupen64AE

AbandonedCart commented 10 years ago

if (InputDevice.getDevice(joy).getName().equals("Sony PLAYSTATION(R)3 Controller")) {...}

Android should really add a buffer between the title underline and message by default. There is no situation where writing right up at the bar makes things easier to read.

AbandonedCart commented 10 years ago

When you go to Input in reicast and do the select controller, do you get the same descriptor?

stodag commented 10 years ago

Just wondered, is there a performance boost with onscreen controller disabled? I maybe purchasin a moga pro controller.. thx.

Sry for postin here.. didn't wanna create a new thread.

ppsspp213 commented 10 years ago

Yes, pressing my controller key I'm able to use it to set it controller A, selecting custom results in it saying no controller selected.

AbandonedCart commented 10 years ago

The custom button is a little misleading. That was meant if you were hitting buttons and it wasn't being detected to try an alternate method where you force identifying it as controller X without a real registration. I updated the label to be more fitting.

There is no real performance boost using a controller over the screen. Actually the only boost is not using both at once. Playing with native detection, I killed the onscreen and it's the same speed as it was when it worked and no controller was present.

stodag commented 10 years ago

Thx man, I wasn't sure as with some emus without onscreen controlls especially animated ones there is a boost.. ie:- Tiger arcade (mame), (Large speed boost if animation disabled) wait reicast doesn't have animated controlls?!? haha answered my own question as I was askin it :)

stodag commented 10 years ago

I really need to take more notice of things like this before askin stupid questions lol... anyways.

ppsspp213 commented 10 years ago

Further inspection of controller revealed it to be a high quality fake clone, it has five screws instead of 6 unlike the over fakes. I don't think it's a gasia fake, be careful guys I got ripped off.

The PS button goes all the way down and becomes stuck. Inside of the controller it has the battery wrapped in a blue covering, instead of a battery sitting on top of white plastic mounting clips. sofeware typo on back packaging. Controller region CECHZC2U on packaging doesn't match CECHZC2E on the actual controller sticker label. The pcb also contains the following strange information non of it official from Sony

http://zhanggingdz.cn.1688.com Email: 79063966@gg.com ZQDZ-P3-BT-Button SN: 8613802702287 94HB 1.4MM ZQD2 Electronic Technology P3-BT-3D-A FR4 T=1.2MM "

AbandonedCart commented 10 years ago

There are a lot of those floating around. Makes a little more sense why it was giving you trouble, though. I wonder if it is sending out different codes then, too.

ppsspp213 commented 10 years ago

It works fine via usb but it won't pair / sync properly via bluetooth it instantly loses it's connection after staying on the number 1 led for 3 seconds then it goes out. It writes the CSR dongle mac address to the controller with USB/BT Joystick Gold and PS3Pairing though, I checked it manualy in SixaxisPairTool and MotionInJoy.

skmp commented 6 years ago

@ppsspp213 Is this still an issue with current master?

wurz311 commented 6 years ago

No idea, no longer have PS3 controller to test.

On Wed, 11 Apr 2018, 13:57 Stefanos Kornilios Mitsis Poiitidis, < notifications@github.com> wrote:

@ppsspp213 https://github.com/ppsspp213 Is this still an issue with current master?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/reicast/reicast-emulator/issues/314#issuecomment-380442041, or mute the thread https://github.com/notifications/unsubscribe-auth/AGa3o2S_ArwvSQSJGCtDsQt-Su02qqCOks5tnf2jgaJpZM4BkClM .

skmp commented 6 years ago

Alright, let's close this and make a new issue if it appears again