Skurdt / SK.Libretro

Libretro wrapper written in C# with support for the Unity game engine
MIT License
28 stars 13 forks source link

fix issue with clearing bit while analog stick is moving in a circle #16

Closed XenuIsWatching closed 10 months ago

XenuIsWatching commented 1 year ago

with AnalogToDigital enabled, if a user used their stick and went to the upper left. The joybutton for up and left would be set. If the user then when to the bottom right, the down and right would be set, but the up and left would not be cleared as the SetBitIf function can only set bits. It will not clear them if the condition is false.

The left and right checks were also swapped.

XenuIsWatching commented 10 months ago

@Skurdt any plan on reviewing this?

Skurdt commented 10 months ago

I did read the issue and the changes. The left and right swap I'm obviously ok with.

I'll merge this for now.

The registration to the .canceled callback was originally meant to clear if the condition is false. The issue comes from when using a joystick, it is only triggered when it's released (or probably also when centered).