mirror of https://github.com/stella-emu/stella.git
fixed underflow in FrameLayoutDetector
This commit is contained in:
parent
1c2dceab2b
commit
5c0856c7a4
|
@ -244,8 +244,9 @@ void FrameLayoutDetector::finalizeFrame()
|
|||
// 1.0 (>=312) and added to PAL and (inverted) NTSC sums.
|
||||
constexpr double ODD_PENALTY = 0.5; // guessed value :)
|
||||
const double palFrame = BSPF::clamp(((myCurrentFrameFinalLines % 2) ? ODD_PENALTY : 1.0)
|
||||
* static_cast<double>(myCurrentFrameFinalLines - frameLinesNTSC)
|
||||
* (static_cast<double>(myCurrentFrameFinalLines) - static_cast<double>(frameLinesNTSC))
|
||||
/ static_cast<double>(frameLinesPAL - frameLinesNTSC), 0.0, 1.0);
|
||||
|
||||
myPalFrameSum += palFrame;
|
||||
myNtscFrameSum += 1.0 - palFrame;
|
||||
//cerr << myCurrentFrameFinalLines << ", " << palFrame << ", " << myPalFrameSum << ", " << myNtscFrameSum << '\n';
|
||||
|
|
Loading…
Reference in New Issue