devkitPro / SDL

Simple Directmedia Layer
https://libsdl.org
zlib License
11 stars 12 forks source link

ogc: fix wrong values reported on GameCube controller triggers #35

Closed mardy closed 5 months ago

mardy commented 6 months ago

These two axes values are unsigned, and all 8 bits can be used; therefore, in order to reach SHRT_MAX we only need to shift them by 7 bits, not 8. This avoids having the value wrap down to zero midway.

WinterMute commented 6 months ago

I honestly think we should just consolidate these files rather than repeating the code like this.

mardy commented 6 months ago

I will try to consolidate the two files for SDL2 (there will be quite a few ifdefs...), then we can see if it's worth to do the same for SDL1.2.

But in any case, this is the code we have right now, and it's wrong :-)