-
-
Notifications
You must be signed in to change notification settings - Fork 304
R4 profile, XInput backend improvements, etc. #58
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
R4 profile, XInput backend improvements, etc. #58
Conversation
Deleted all \r characters from Ultimate.cpp
- Can crouch on platforms with modX and modY - Can shield tilt with modY - ModX is now fastest walking speed
- Cleaned up DInputBackend buttons to more closely resemble SDL buttons.
- Fixed issue with ftilts while using mod_x.
- Gamecube not working (directly connect) - Unable to test N64?
- Hold R + Y (wavedash) to disable, on plugin.
- Fixed left trigger output.
- Press the top right button
ModY + Diagonal + Cstick Left was a duplicate of ModY + Diagonal + Cstick Down. Fixed so that it provides the correct angle.
…tack#51) Co-authored-by: Eric Iniguez <eric@iniguez.dev>
* build: add devcontainer.json * build: add clang-format * build: use debian base image for dev container * build: switch to Ubuntu 22.04 as base image * build: move clang-format stuff from settings.json to devcontainer.json in case people running it locally don't have clang-format installed * style: replace tabs with spaces
* feat: SOCD cleaning rework socd_type is no longer a required parameter of InputMode. Instead, a SocdType is included as part of each SocdPair, allowing SOCD resolution method to be defined per-axis without the need to override HandleSocd(). New SOCD resolution methods SOCD_DIR1_PRIORITY and SOCD_DIR2_PRIORITY have been added, which was made possible by the above change. These would previously not have been useful, without the ability to define SocdType per SocdPair. The constructor of FgcMode now accepts two parameters, horizontal_socd and vertical_socd, which can be used to set the SOCD resolution method for the horizontal and vertical axes separately. The default vertical SOCD resolution for FgcMode is now neutral, due to this being a requirement in some rulesets. This can easily be changed by passing socd::SOCD_DIR2_PRIORITY as the second argument to the constructor in mode_selection.hpp. * fix: correct function names
- Can crouch on platforms with modX and modY - Can shield tilt with modY - ModX is now fastest walking speed
Rebase master into my fork
- Fixed XInput issue with triggers
Rebase from master repo
|
@avahe-kellenberger Could you summarize any changes in this PR (or other findings you've come across) that would pertain to #26? I'd like to get that merged at some point. |
|
By the way, if you use a two-dot comparison then the problem mentioned in the OP should resolve, like this. |
| _report.lb = _outputs.buttonL; | ||
| _report.rb = _outputs.buttonR; | ||
| _report.lt = _outputs.triggerLDigital ? 255 : _outputs.triggerLAnalog; | ||
| _report.rt = _outputs.triggerRDigital ? 255 : _outputs.triggerRAnalog; | ||
|
|
||
| _report.lb = _outputs.triggerLDigital; | ||
| _report.rb = _outputs.triggerRDigital; | ||
| _report.lt = _outputs.buttonL ? 255 : _outputs.triggerLAnalog; | ||
| _report.rt = _outputs.buttonR ? 255 : _outputs.triggerRAnalog; |
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.
These seemed to not be working until flipped (lt <-> lb, rt <-> rb).
255 is the max value for when the digital press is registered.
If there are any concerns or issues, let me know. I was testing these settings from yuzu and some steam games.
|
The problem showing randomly changed files was fixed, which is nice. The primary changes of the PR are adding an Ultimate mode for the R4 B0xx. It works well. |
| // See https://wiki.libsdl.org/SDL2/SDL_GameControllerButton | ||
| _gamepad->setButton(0, _outputs.a); | ||
| _gamepad->setButton(1, _outputs.b); | ||
| _gamepad->setButton(2, _outputs.x); | ||
| _gamepad->setButton(3, _outputs.y); | ||
| _gamepad->setButton(4, _outputs.select); | ||
| _gamepad->setButton(5, _outputs.home); | ||
| _gamepad->setButton(6, _outputs.start); | ||
| _gamepad->setButton(7, _outputs.leftStickClick); | ||
| _gamepad->setButton(8, _outputs.rightStickClick); | ||
| _gamepad->setButton(9, _outputs.buttonL); | ||
| _gamepad->setButton(10, _outputs.buttonR); | ||
| _gamepad->setButton(11, _outputs.triggerLDigital); | ||
| _gamepad->setButton(12, _outputs.triggerRDigital); |
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.
Unnecessary, but helped when using DInput in my game engine. Doesn't really affect anything.
| _gamepad->triggerLAnalog(_outputs.triggerLAnalog + 1); | ||
| _gamepad->triggerRAnalog(_outputs.triggerRAnalog + 1); | ||
|
|
||
| // NOTE: This is wrong! ...But works for my needs. | ||
| // Not sure why L and R aren't working in yuzu with triggerLAnalog and triggerRAnalog. | ||
| _gamepad->triggerLAnalog(_outputs.triggerLDigital + 1); | ||
| _gamepad->triggerRAnalog(_outputs.triggerRDigital + 1); |
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.
Can revert if needed, reasoning in the comments.
| // TODO: This flips R1/R2 and L1/L2 but the game actually sees b0xx L and R as the triggers. | ||
| // Maybe the pinout needs to change? Unsure. | ||
| _report.l = _outputs.triggerLDigital; | ||
| _report.r = _outputs.triggerRDigital; | ||
| _report.zl = _outputs.buttonL; | ||
| _report.zr = _outputs.buttonR; |
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.
This seems consistent with 3rd party "Pro Controllers", these are always flipped.
Not sure if we could actually fix this in a better way, but I expect not.
Doing this allows for us to reset training mode.
| // Left Stick outputs || Scaling || || Offset || | ||
| _report.lx = ((_outputs.leftStickX - 128) * 1.266 + 128) + 0.49; // Rightwards | ||
| _report.ly = (255 - ((_outputs.leftStickY - 128) * 1.256 + 128)) + 1.48; // Downwards | ||
|
|
||
| // Right Stick outputs | ||
| _report.rx = ((_outputs.rightStickX - 128) * 1.266 + 128) + 0.49; | ||
| _report.ry = (255 - ((_outputs.rightStickY - 128) * 1.256 + 128)) + 1.48; |
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 believe these scaling values were taken from a PR written by @ribbanya but I'm not seeing them looking back.
Maybe ribbanya can comment on this, seems to be working alright but it's not absolutely perfect atm.
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 honestly don't remember? I just remember the creation of Ultimate2 a while ago but that wasn't me.
|
|
||
| /* Select communication backend. */ | ||
| CommunicationBackend *primary_backend; | ||
| if (console == ConnectedConsole::NONE) { |
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.
If we want to change buttons holds to fit some uniform standard, that's fine by me.
I do enjoy requiring no button holds for Smash Ultimate on the Switch, though.
| // TODO: Should I make this switch to UltimateR4? | ||
| set_mode(backend, new Ultimate(socd::SOCD_2IP)); |
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.
Decision to be made
|
That all makes sense! Thanks for taking the time to explain. |
- TODO: Check if the "255 - ..." section is needed It seems to be working fine, needs more testing
Github is currently showing many changes in files which actually have no difference between the master branch and my fork. I'm partially opening this PR to see if it fixes the comparison.