GBhawk: fine tune tilt range some more and fix savestate

This commit is contained in:
alyosha-tas 2020-07-05 18:39:06 -04:00
parent ae763f2eef
commit 694b3d88d3
1 changed files with 3 additions and 2 deletions

View File

@ -181,7 +181,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
// since rotations about X have less of a moment arm compared to by, we take 1/5 of the effect as a baseline // since rotations about X have less of a moment arm compared to by, we take 1/5 of the effect as a baseline
float temp2 = (float)((phi - phi_prev) / 0.5 * 25); float temp2 = (float)((phi - phi_prev) / 0.5 * 25);
return (ushort)(0x8370 - Math.Floor(temp * 220) - temp2); return (ushort)(0x8370 - Math.Floor(temp * 216) - temp2);
} }
// acc y is just the sine of the angle // acc y is just the sine of the angle
@ -195,7 +195,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
// further it will be assumed that the resulting acceleration is roughly eqvuivalent to gravity // further it will be assumed that the resulting acceleration is roughly eqvuivalent to gravity
float temp2 = (float)((theta - theta_prev)/0.5 * 125); float temp2 = (float)((theta - theta_prev)/0.5 * 125);
return (ushort)(0x8370 - Math.Floor(temp * 220) + temp2); return (ushort)(0x8370 - Math.Floor(temp * 216) + temp2);
} }
private static readonly string[] BaseDefinition = private static readonly string[] BaseDefinition =
@ -207,6 +207,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
{ {
// since we need rate of change of angle, need to savestate them // since we need rate of change of angle, need to savestate them
ser.Sync(nameof(theta), ref theta); ser.Sync(nameof(theta), ref theta);
ser.Sync(nameof(phi), ref phi);
} }
} }
} }