..:: PCSX2 Forums ::..

Full Version: DS4 To XInput Wrapper
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Just tried the new version with bluetooth and it seems to connect and disconnect nicely. A great function i've been hoping for.

Problem is, now all of the buttons don't work! Touchpad works, and i can even disable and enable it using the shortcuts, but when checking controller properties in windows it just won't register any inputs. The gyroscope bars in the options menu do move when i move the controller. So i'm guessing the inputs aren't being properly pipelined to windows.

When i click hide DS4 controller it disconnects. So.. any ideas? I did just uninstall my motioninjoy drivers. going to restart now and see if that fixes anything.

*edit*
Problem solved.
A reboot did it. Xbox360 controller popped up again in the windows devices/printers window.



I'm wondering if it would be possible to use the ds4 controller in directinput mode and use the gyroscope and touchpad as with their own axis? Some games are highly programmable and i often use xpadder with my controller. It would be cool to be able to reprogram the touchpad like that.
(03-01-2014, 01:36 PM)electrobrains Wrote: [ -> ]* Account for connecting USB while Bluetooth is plugged in for more than just the first controller. There was a simple logic error.
* Remove latency that crept in. If you had any custom mappings, there would be memory allocation for every sensor reading the DualShock 4 gave you. Now we flip between several DS4 sensor state buffers.

Thanks, for finding that forgot to wrap break; under the if only.
I am not sure if you understand how structs works though, its not a pointers, its always a passed by value not by reference performing deep copy therefore having idle state adds more overhead instead of just resetting two buttons used for disconnect to false (my solution)
(03-01-2014, 03:16 PM)InhexSTER Wrote: [ -> ]Thanks, for finding that forgot to wrap break; under the if only.
I am not sure if you understand how structs works though, its not a pointers, its always a passed by value not by reference performing deep copy
Ah, really? So then we need to use "ref" to pass them around to make it writeable, which I guess acts similarly to "&" prefix operator in C. Stack allocations are very fast so we shouldn't really need to concern ourselves as much as when we are using the new operator which is essentially malloc()+initialize. You're right, I need to learn C# better. I can't say for sure whether passing a pointer or by value will be faster. Let me fix that now and replace it. Do you have a decent reference for C#, just a simple guide for people that already know many computer languages?

Edit: Corrected misuse of struct on the Google Code repository. It should just be a matter of adding the ref operators that turn stack passes of structs into stack passes of pointers to structs.

Optimizing the disconnect path is not necessary. It's best to just return to a full idle to give programs a moment to get used to a controller going away, undoing any "stuck keys" automatically in DS4 Tool. If we want to do micro-optimizations first we need to set up profiling... something that doesn't come with VS2013 Express, but I don't know what else is out there. I can't afford VS.

Attaching a corrected version that should do mapping as before (the only mapping I actually used was the trigger midpoint remapping.)
(03-01-2014, 03:22 PM)electrobrains Wrote: [ -> ]Ah, really? So then we need to use "ref" to pass them around to make it writeable
Yes ref could do but in few cases we want a deep copy.

Like code here would just create a strict on the stack called state and perform deep copy 3 times on each line

DS4State state = Mapping.mapButtons(cState, PrevState, mouse);
PrevState = cState;
State = state;

I am replacing this to be a class in DS4Library to have a Clone() returns new object and cState.Copy(pState) will do deep copy but not creating new one.
(03-01-2014, 03:35 PM)InhexSTER Wrote: [ -> ]Yes ref could do but in few cases we want a deep copy.

Like code here would just create a strict on the stack called state and perform deep copy 3 times on each line

DS4State state = Mapping.mapButtons(cState, PrevState, mouse);
PrevState = cState;
State = state;

I am replacing this to be a class in DS4Library to have a Clone() returns new object and cState.Copy(pState) will do deep copy but not creating new one.

Cool, I think we should just avoid the "struct" shortcuts entirely and probably use classes exclusively so that we can get the exact semantics we want. Do you have any way to do profiling?
I think I finally got it this time. I've done some basic testing of mappings and there seems to be no dual-presses or anything, but I definitely discovered using a key as Shift doesn't work right. It never manages to release.
Once headphone support gets added in this, it'll be perfect. Until then, keep up the excellent work InhexSTER!
Hi there.

I'm having some issues with DMC. Here is the config :

Connection type: BT
Windows Version : 7
DS4 Tool Version : 1.1 final and 1.2
Shared mode

When I launch the game, everything works fine. But after opening a menu ingame (option, inventory...), there is 20 secondes of lag for every action. When I close the game (Alt+F4), my computer freeze. I tried with USB, it works with DMC. I tried another game (Dust : an Elisian tale) and it works with BT and USB.

Any idea where i should look ?

Apart from that, thanks for the wrapper. I've been using it since a few day and it's realy great to have a DS4 on my computer.

Edit : forgot to say what my BT dongle is : Asus BT-211.
I will post an 1.2.3 with minor fixes soon, and i have started working on version 2.0
hi! have some problems when i'm trying to connect DS4 to PC via bluetooth or cable

windows7 x64, administrator rights
USB cable
asus BT400
DS4 x1
all installed soft you can see at first image-link

a) cable:
PC has found a controller (an icon in printers and devices is ok), but "ScpServer" started without any activity.
http://s30.postimg.org/r7x454idt/DS4_1.png

b) bluetooth
at the beginning PC has found DS4, but after a pop-up window "Bluetooth-services adjustment" an icon of DS4 dissapeared in devices and printers
http://s11.postimg.org/vgyd032wj/DS4_2.png

any thoughts?

thanx for help!