diff --git a/src/emucore/Console.hxx b/src/emucore/Console.hxx index 872725979..ee13cea41 100644 --- a/src/emucore/Console.hxx +++ b/src/emucore/Console.hxx @@ -311,6 +311,12 @@ class Console : public Serializable, public ConsoleIO */ void updateVcenter(Int32 vcenter); + /** + Set up various properties of the TIA (vcenter, Height, etc) based on + the current display format. + */ + void setTIAProperties(); + private: /** * Dry-run the emulation and detect the frame layout (PAL / NTSC). @@ -322,12 +328,6 @@ class Console : public Serializable, public ConsoleIO */ void redetectFrameLayout(); - /** - Sets various properties of the TIA (vcenter, Height, etc) based on - the current display format. - */ - void setTIAProperties(); - /** Create the audio queue */ diff --git a/src/emucore/tia/frame-manager/FrameManager.cxx b/src/emucore/tia/frame-manager/FrameManager.cxx index 053c3c665..3514b93f7 100644 --- a/src/emucore/tia/frame-manager/FrameManager.cxx +++ b/src/emucore/tia/frame-manager/FrameManager.cxx @@ -220,8 +220,8 @@ bool FrameManager::onLoad(Serializer& in) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void FrameManager::recalculateMetrics() { - uInt32 ystartBase; - uInt32 baseHeight; + Int32 ystartBase; + Int32 baseHeight; switch (layout()) { @@ -244,7 +244,7 @@ void FrameManager::recalculateMetrics() { } myHeight = baseHeight + myAdjustScanlines * 2; - myYStart = ystartBase + baseHeight - myHeight + myVcenter; + myYStart = std::max(0, ystartBase + (baseHeight - static_cast(myHeight)) / 2 + myVcenter); myJitterEmulation.setYStart(myYStart); } diff --git a/src/gui/VideoDialog.cxx b/src/gui/VideoDialog.cxx index 7da3b6a66..493c1a39a 100644 --- a/src/gui/VideoDialog.cxx +++ b/src/gui/VideoDialog.cxx @@ -487,6 +487,8 @@ void VideoDialog::saveConfig() // TV scanline intensity instance().settings().setValue("tv.scanlines", myTVScanIntense->getValueLabel()); + instance().console().setTIAProperties(); + // Finally, issue a complete framebuffer re-initialization... instance().createFrameBuffer();