Skip to content

Conversation

@avahe-kellenberger
Copy link

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.

avahe-kellenberger and others added 30 commits February 2, 2023 21:16
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.
* 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
@ribbanya
Copy link
Contributor

@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.

@ribbanya
Copy link
Contributor

By the way, if you use a two-dot comparison then the problem mentioned in the OP should resolve, like this.

Comment on lines -43 to +47
_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;
Copy link
Author

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.

@avahe-kellenberger
Copy link
Author

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.
I've also made minor changes to DInput and XInput which fixed some small issues, I'll leave some comments on the code.

Comment on lines +36 to +49
// 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);
Copy link
Author

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.

Comment on lines -55 to +60
_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);
Copy link
Author

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.

Comment on lines +120 to +125
// 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;
Copy link
Author

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.

Comment on lines +135 to +141
// 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;
Copy link
Author

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.

Copy link
Contributor

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) {
Copy link
Author

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.

Comment on lines +51 to 52
// TODO: Should I make this switch to UltimateR4?
set_mode(backend, new Ultimate(socd::SOCD_2IP));
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decision to be made

@avahe-kellenberger avahe-kellenberger changed the title [WIP]: R4 profile, XInput backend improvements, etc. R4 profile, XInput backend improvements, etc. Dec 20, 2023
@ribbanya
Copy link
Contributor

That all makes sense! Thanks for taking the time to explain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants