fixes d8778aa23
This commit is contained in:
YoshiRulz 2024-10-09 14:30:48 +10:00
parent d8778aa232
commit 57e60453f6
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
1 changed files with 2 additions and 2 deletions

View File

@ -305,9 +305,9 @@ namespace BizHawk.Emulation.Cores.Waterbox
// so these thunks are called after the frame has advanced
_rumblers.Add((c, b) =>
{
const double S32_MAX_AS_F64 = int.MaxValue;
const double SCALE_FACTOR = (double) int.MaxValue / (double) byte.MaxValue;
static int Scale(byte b)
=> (b * S32_MAX_AS_F64).RoundToInt();
=> (b * SCALE_FACTOR).RoundToInt();
//TODO double-check order
c.SetHapticChannelStrength(nameRight, Scale(b[byteStart]));
c.SetHapticChannelStrength(nameLeft, Scale(b[byteStart + 1]));