diff --git a/src/emucore/Console.cxx b/src/emucore/Console.cxx index c794690f7..106f31197 100644 --- a/src/emucore/Console.cxx +++ b/src/emucore/Console.cxx @@ -420,8 +420,7 @@ void Console::setFormat(uInt32 format) { setPalette(myOSystem.settings().getString("palette")); setTIAProperties(); - myTIA->frameReset(); - initializeVideo(); // takes care of refreshing the screen + initializeVideo(); // takes care of refreshing the screen initializeAudio(); // ensure that audio synthesis is set up to match emulation speed myOSystem.resetFps(); // Reset FPS measurement } diff --git a/src/emucore/tia/TIA.cxx b/src/emucore/tia/TIA.cxx index 1ded2ef27..757baca7b 100644 --- a/src/emucore/tia/TIA.cxx +++ b/src/emucore/tia/TIA.cxx @@ -178,7 +178,7 @@ void TIA::reset() if (myFrameManager) { myFrameManager->reset(); - frameReset(); // Recalculate the size of the display + enableColorLoss(mySettings.getBool(mySettings.getBool("dev.settings") ? "dev.colorloss" : "plr.colorloss")); } myFrontBufferScanlines = myFrameBufferScanlines = 0; @@ -189,18 +189,14 @@ void TIA::reset() enableFixedColors(mySettings.getBool(mySettings.getBool("dev.settings") ? "dev.debugcolors" : "plr.debugcolors")); setFixedColorPalette(mySettings.getString("tia.dbgcolors")); -#ifdef DEBUGGER_SUPPORT - createAccessBase(); -#endif // DEBUGGER_SUPPORT -} - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void TIA::frameReset() -{ + // Blank the various framebuffers; they may contain graphical garbage memset(myBackBuffer, 0, 160 * TIAConstants::frameBufferHeight); memset(myFrontBuffer, 0, 160 * TIAConstants::frameBufferHeight); memset(myFramebuffer, 0, 160 * TIAConstants::frameBufferHeight); - enableColorLoss(mySettings.getBool(mySettings.getBool("dev.settings") ? "dev.colorloss" : "plr.colorloss")); + +#ifdef DEBUGGER_SUPPORT + createAccessBase(); +#endif // DEBUGGER_SUPPORT } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/emucore/tia/TIA.hxx b/src/emucore/tia/TIA.hxx index c7ecac78b..1687331d4 100644 --- a/src/emucore/tia/TIA.hxx +++ b/src/emucore/tia/TIA.hxx @@ -136,11 +136,6 @@ class TIA : public Device */ void reset() override; - /** - Reset frame to current YStart/Height properties. - */ - void frameReset(); - /** Install TIA in the specified system. Invoked by the system when the TIA is attached to it. @@ -254,7 +249,7 @@ class TIA : public Device /** Changes the current Height/YStart properties. Note that calls to these method(s) must be eventually followed by - ::frameReset() for the changes to take effect. + ::reset() for the changes to take effect. */ void setHeight(uInt32 height) { myFrameManager->setFixedHeight(height); } void setYStart(uInt32 ystart) { myFrameManager->setYstart(ystart); } diff --git a/src/gui/GameInfoDialog.cxx b/src/gui/GameInfoDialog.cxx index d14661ca5..b9cfc9552 100644 --- a/src/gui/GameInfoDialog.cxx +++ b/src/gui/GameInfoDialog.cxx @@ -568,7 +568,11 @@ void GameInfoDialog::saveConfig() } instance().frameBuffer().tiaSurface().enablePhosphor(myPhosphor->getState(), myPPBlend->getValue()); if (reset) - instance().console().tia().frameReset(); + instance().console().tia().reset(); + + // Certain calls above may blank the TIA image (notably, setFormat) + // So we make sure we have a valid image when the dialog exits + instance().console().tia().renderToFrameBuffer(); } else {