mirror of
https://github.com/libretro/beetle-wswan-libretro.git
synced 2024-12-11 18:26:34 +00:00
Fix analog calculation
Analog read would overflow and become -1 instead of 128 when analog reached maximum value. Signed-off-by: Saggi Mizrahi <ficoos@gmail.com>
This commit is contained in:
parent
03fcaf14d4
commit
eb25ec04ca
@ -84,7 +84,7 @@ void InputDevice_DualAnalog::UpdateInput(const void *data)
|
||||
{
|
||||
int32 tmp;
|
||||
|
||||
tmp = 32768 + MDFN_de32lsb((const uint8 *)data + stick * 16 + axis * 8 + 4) - ((int32)MDFN_de32lsb((const uint8 *)data + stick * 16 + axis * 8 + 8) * 32768 / 32767);
|
||||
tmp = 32768 + MDFN_de32lsb((const uint8 *)data + stick * 16 + axis * 8 + 4) - ((int32)MDFN_de32lsb((const uint8 *)data + stick * 16 + axis * 8 + 8) * 32768 / 32768);
|
||||
tmp >>= 8;
|
||||
|
||||
axes[stick][axis] = tmp;
|
||||
|
Loading…
Reference in New Issue
Block a user