Fix some tiny float imprecisions in `PlatformFrameRates`

This commit is contained in:
YoshiRulz 2025-01-24 05:02:44 +10:00
parent 5516281381
commit 685a5cd119
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
1 changed files with 11 additions and 13 deletions

View File

@ -25,8 +25,8 @@ namespace BizHawk.Client.Common
["SGB"] = 21477272.0 / (4 * 341 * 262 - 2), // 60.0988118623
["SGB_PAL"] = 21281370.0 / (4 * 341 * 312), // 50.0069789082
["BSX"] = 21477272.0 / (4 * 341 * 262 - 2), // 60.0988118623
["PCE"] = 7159090.90909090 / 455 / 263, // 59.8261054535
["PCECD"] = 7159090.90909090 / 455 / 263, // 59.8261054535
["PCE"] = 2250000.0 / 37609.0, // = 78750000 / 11 / 455 / 263 ≈ 59.8261054535
["PCECD"] = 2250000.0 / 37609.0, // = 78750000 / 11 / 455 / 263 ≈ 59.8261054535
["SMS"] = 3579545 / 262.0 / 228.0, // 59.9227434043
["SMS_PAL"] = 3546893 / 313.0 / 228.0, // 49.7014320946
["GG"] = 3579545 / 262.0 / 228.0, // 59.9227434043
@ -51,13 +51,11 @@ namespace BizHawk.Client.Common
// while the number of scanlines per frame is software controlled and variable, we
// enforce exactly 262 (NTSC) 312 (PAL) per reference time frame
["A26"] = 315000000.0 / 88.0 / 262.0 / 228.0, // 59.922751013550531429197560173856
["A26"] = 1640625.0 / 27379.0, // = 315000000 / 88 / 262 / 228 ≈ 59.922751013550531429197560173856
["A78"] = 1640625.0 / 27379.0, // ditto
["Coleco"] = 1640625.0 / 27379.0, // ditto
// this pal clock ref is exact
["A26_PAL"] = 3546895.0 / 312.0 / 228.0, // 49.860759671614934772829509671615
["A78"] = 59.9227510135505,
["Coleco"] = 59.9227510135505,
["A26_PAL"] = 3546895.0 / 71136.0, // = 3546895 / 312 / 228 ≈ 49.860759671614934772829509671615
#if true // according to https://github.com/TASEmulators/mednafen/blob/740d63996fc7cebffd39ee253a29ee434965db21/src/psx/gpu.cpp [failed verification—there are several expressions but none of them match these]
["PSX"] = 502813668.0 / 8388608.0, // 59.940060138702392578125
@ -68,8 +66,8 @@ namespace BizHawk.Client.Common
#endif
// according to https://github.com/TASEmulators/mednafen/blob/382ff1b8d293c9a862497706808cbb79b2cecbfb/src/ss/vdp2.cpp#L904-L907
["SAT"] = 8734090909.0 / 145852525, // = 1746818181.8 / 61 / 4 / 455 / ((263 + 262.5) / 2.0) ≈ 59.8830284837
["SAT_PAL"] = 62500.0 / 1251, // = 1734687500.0 / 61 / 4 / 455 / ((313 + 312.5) / 2.0) ≈ 49.9600319744
["SAT"] = 8734090909.0 / 145852525, // = 1746818181.8 / 61 / 4 / 455 / ((263 + 262.5) / 2.0) ≈ 59.883028483737256
["SAT_PAL"] = 62500.0 / 1251, // = 1734687500.0 / 61 / 4 / 455 / ((313 + 312.5) / 2.0) ≈ 49.960031974420467
["Doom"] = 35.0,
@ -81,10 +79,10 @@ namespace BizHawk.Client.Common
["C64_NTSC"] = NTSCCarrier * 2 / 7 / 263 / 65,
["C64_NTSC_OLD"] = NTSCCarrier * 2 / 7 / 262 / 64,
["C64_DREAN"] = PALNCarrier * 2 / 7 / 312 / 65,
["INTV"] = 59.92,
["INTV"] = 1498.0 / 25.0, // = 59.92
["ZXSpectrum_PAL"] = 50.080128205,
["AmstradCPC_PAL"] = 50.08012820512821, // = 1 / ((1024 * 312) / 16,000,000)
["ZXSpectrum_PAL"] = 15625.0 / 312.0, // = 3500000 / 224 / 312 ≈ 50.0801282051282051
["AmstradCPC_PAL"] = 15625.0 / 312.0, // ditto (progressive mode)
["UZE"] = 1125000.0 / 18733.0, // = 8 * 315000000 / 88 / 1820 / 262 ≈ 60.05444936742646666
["VEC"] = 50,