Skip to content
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

Invalid PAD_DIGITALBUTTON binds somehow bind to A/LB in vehicle #1577

Closed
blattersturm opened this issue Aug 15, 2022 · 2 comments
Closed

Invalid PAD_DIGITALBUTTON binds somehow bind to A/LB in vehicle #1577

blattersturm opened this issue Aug 15, 2022 · 2 comments
Assignees
Labels
bug game-bug Bugs that appear to be related to game code.

Comments

@blattersturm
Copy link
Contributor

blattersturm commented Aug 15, 2022

A bind such as bind pad_digitalbutton up "say Now this is racing!" (which is an invalid index for PAD_DIGITALBUTTON, see the docs) somehow still creates a bind which triggers when pressing A (lower face button) in a vehicle.

When reproducing this, it should be noted that I had 'swap RB/A in vehicle' enabled in gamepad config, if this is needed.

Might be a mixup of different enums containing UP, even.

@blattersturm blattersturm added bug game-bug Bugs that appear to be related to game code. labels Aug 15, 2022
@gottfriedleibniz
Copy link
Contributor

Might be a mixup of different enums containing UP, even.

This seems to be the case. Looking at GetParameterIndex, there is clearly some bit flag action not being referenced or sanitized. IOMS_PAD_DIGITALBUTTON, for instance, does the mapping return i | 0x20000u.

Referencing rage__ioMapperParameter, the pad buttons start at 0x20000u:

L2 = 0x20000,
R2 = 0x20001,
L1 = 0x20002,
...
LUP = 0x2000c,
...
LLEFT = 0x2000f,
TOUCH = 0x20010,

In my case, KEY_UP = 0x26 will map to RDOWN = 0x20006 which seems consistent with UngetParameterIndex's path for IOMS_PAD_DIGITALBUTTON overflowing.

@gottfriedleibniz gottfriedleibniz self-assigned this Feb 11, 2024
@gottfriedleibniz
Copy link
Contributor

Another note to self:

if (!xbr::IsGameBuildOrGreater<2060>())
{
button->SetFromControl((char*)g_control + 0x21A98, field->index); // 1604
}
else
{
button->SetFromControl((char*)g_control + 0x21B78, field->index); // 2198
}

Should be patternized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug game-bug Bugs that appear to be related to game code.
Projects
None yet
Development

No branches or pull requests

2 participants