SIXAXIS/Gyro rebinding
Started by luphoria




1 posts in this topic
luphoria
Member


0
2 posts 1 threads Joined: Jun 2024
06-28-2024, 03:04 AM -
#1
Hi, hopefully this is the right subforum. 

I'm curious if there is any way to rebind sixaxis input to some other button input, or if there is any plan for this to become possible? 

I have these third-party PowerA PS3 controllers which emulate SIXAXIS (I don't think every axis) on the left joystick. It's not a perfect solution, but it was perfect for a game that I played frequently, specifically TOY HOME [NPUA80104] - a driving game with only gyro input, no joystick input. I've recently wanted to start playing the game again with friends, but this PowerA sixaxis emulation didn't translate over to RPCS3 unfortunately. I don't have any genuine DS3 controllers anymore so I can't even use multiplayer with tilt controls. So what I want to be able to do in RPCS3 is simply rebind the gyro to the joystick. 

This is an open issue already on the GitHub repository: https://github.com/RPCS3/rpcs3/issues/13883 
In my searching for answers, I also came across this repo: https://github.com/ZeptoBST/DualShock4-emulator/ -- which appears able to emulate SIXAXIS from xbox and keyboard controller inputs, very much like what I want. I don't know if the tool actually features rebindable keys for this or a joystick option, though, because/and it's Windows-only, and I'm on Linux. If there is some kind of solution for this that's cross-platform and works on generally any gamepad, that would suit my needs. 

It seems like under the hood there is already SIXAXIS emulation to some degree, because I was able to get gyro working from my Switch Pro controller without any hiccups. This implies that there is likely some way I can plug in other inputs wherever the sdl gyro is being translated to ds3 sixaxis. If it's possible for me to implement this feature myself, I would love to be able to contribute upstream as well. But I don't really know how to get started in the rpcs3 repository. 

If anyone has help, info, pointers, related, especially to how to dive into RPCS3 input handling, especially related to gyro... I would appreciate it so much! 

Thanks. 

luphoria
luphoria
Member


0
2 posts 1 threads Joined: Jun 2024
06-29-2024, 03:50 AM -
#2

I've got the basic idea functioning. On my wired Xbox One controller (evdev) I have mapped the left stick X to sixaxis X and Y to sixaxis Y!
But I am not exactly a mathematician, and I also don't have "control" values (ie I don't know what "usual" SIXAXIS values look like) and so my math is clearly very jank. 
As for where I am right now, I added the following lines to rpcs3/Input/evdev_joystick_handler.cpp after L1221:

pad->m_sensors[0].m_value = Clamp0To1023(512 + (lx - 127.5f) * 4.016f);
pad->m_sensors[1].m_value = Clamp0To1023(512 + (ly - 127.5f) * 4.016f);

If anyone has any tips as to how I can properly do this math, I would really appreciate it. 
If people are interested in this rebindability being an actual feature instead of a hacked-in thing, I would be happy to try implementing it!


Forum Jump:


Users browsing this thread: 3 Guest(s)