-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Xinput vibration CWCheat (PPSSPP specific 0xA code type) #12816
Conversation
78b9f3d
to
9321fc5
Compare
Sorry, I'll clean it later on:3, for now I'm wondering why the vibration doesn't change despite values being changed, unless I exit settings screen that somehow triggers it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do like the idea of exposing vibration (and perhaps explicit touch position support) via cheats or game patches.
-[Unknown]
I have a problem with using dll instead of xinput.lib, PPSSPP_XInputSetState, vibration.wLeftMotorSpeed seems to be rising by 1 every time I press anything on gamepad and vibration.wRightMotorSpeed is always 0. It's as if it was using XINPUT_STATE, but I made sure to change that to XINPUT_VIBRATION as well, unless I'm blind heh. Edit: |
ae15e14
to
ab13b71
Compare
f2c0404
to
e7f1bf0
Compare
That last push is just an unnecessary newline inside one of the functions that would bug me if I left it;3. If the code is fine now I guess this is complete:). As for now I have no ideas about implementing Dinput Rumble or Haptic feedback, maybe someday. |
I discovered some bug trying to make an actual game cheat for better presentation, no idea why, but unthrottle can cause vibration to never end even if the cheat will be disabled as if the value was never reduced. Guess the __CtrlVblank is a bad place to reduce it from?:c Another related issue - unthrottle can cause vibration stop in menu to never trigger? I made a check that sets vibration to 0 outside INGAME, but with unthrottle GetUIState() doesn't work? Or maybe it all works, but there's something bad happening with Xinput itself or my check to update vibration only on change fails somehow with unthrottle:c. Derp everything appears to be working, I have a feeling that XInputSetState can't be called too often as it also breaks without the check to update only on change. Will try to work around that with some timer following real time maybe. |
Yep with a timer it all works even if I get 2000% speed in game, this also explains my initial issue where it wasn't working at all before I added a check to update only on change. |
a49463f
to
fbf73fa
Compare
0xA0 vibration cheat(Xinput) Syntax is: 0xA0NNLLLL 0x00MMRRRR where NN/MM is time vibration lasts LLLL/RRRR is the vibration power 0xA1 read value for the vibration(Xinput) from game memory Syntax is: 0xA1000000 0xNNNNNNNN where NNNNNNNN is the address that stores following values at offset: 0xNNNNNNNN + 0x0 Left Vibration power, 0xNNNNNNNN + 0x2 Right Vibration Power 0xNNNNNNNN + 0x4 Left Vibration time 0xNNNNNNNN + 0x6 Right Vibration time Left some room for other PPSSPP specific cheats(0xA2-0xAF)
fbf73fa
to
e999444
Compare
Just something I was fooling around with, this basically adds a new PPSSPP specific code type(0xA) which can set left and right vibration(separately) for Xinput gamepads.
Test CWCheat which applies various force and length on left/right(dpad/face buttons), button activated will work in any game, but ultimately with some test cheats this could be used to for example vibrate on character being hit or whatever.
Syntax of the new cheat is:
When activated it constantly sets vibration and it's lenght, so it's use should be combined with test codes like 0xD/0xE to activate vibration on specific events or key presses.
With read from memory version we can for example rise vibration together with car speed or something alike althrough we still have to do the math in our own script injected to memory and hooked to game code that would provide the data in such format.
This currently works by sending cheat activated vibration and vibration lenght(dropout) to sceCtrl from where Xinput(potentially dinput and other vibration stuff in the future) can grab it.