From de81f7fd6794f6df0d55a265b1aefdfd1b2c5cca Mon Sep 17 00:00:00 2001 From: Thomas Jentzsch Date: Wed, 17 Nov 2021 19:43:50 +0100 Subject: [PATCH] fixed #841 (setting of phosphor properties) --- src/emucore/FrameBuffer.cxx | 21 +++++++++++++++++++++ src/emucore/TIASurface.cxx | 16 ---------------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/src/emucore/FrameBuffer.cxx b/src/emucore/FrameBuffer.cxx index 3136316bc..cf0ca7abd 100644 --- a/src/emucore/FrameBuffer.cxx +++ b/src/emucore/FrameBuffer.cxx @@ -313,6 +313,27 @@ FBInitStatus FrameBuffer::createDisplay(const string& title, BufferType type, // Initialize video subsystem string pre_about = myBackend->about(); FBInitStatus status = applyVideoMode(); + + // Only set phosphor once when ROM is started + if(myOSystem.eventHandler().inTIAMode()) + { + // Phosphor mode can be enabled either globally or per-ROM + int p_blend = 0; + bool enable = false; + + if(myOSystem.settings().getString("tv.phosphor") == "always") + { + p_blend = myOSystem.settings().getInt("tv.phosblend"); + enable = true; + } + else + { + p_blend = BSPF::stringToInt(myOSystem.console().properties().get(PropType::Display_PPBlend)); + enable = myOSystem.console().properties().get(PropType::Display_Phosphor) == "YES"; + } + myTIASurface->enablePhosphor(enable, p_blend); + } + if(status != FBInitStatus::Success) return status; diff --git a/src/emucore/TIASurface.cxx b/src/emucore/TIASurface.cxx index 2c0048849..8a49b09c9 100644 --- a/src/emucore/TIASurface.cxx +++ b/src/emucore/TIASurface.cxx @@ -101,22 +101,6 @@ void TIASurface::initialize(const Console& console, myPaletteHandler->setPalette(); - // Phosphor mode can be enabled either globally or per-ROM - int p_blend = 0; - bool enable = false; - - if(myOSystem.settings().getString("tv.phosphor") == "always") - { - p_blend = myOSystem.settings().getInt("tv.phosblend"); - enable = true; - } - else - { - p_blend = BSPF::stringToInt(console.properties().get(PropType::Display_PPBlend)); - enable = console.properties().get(PropType::Display_Phosphor) == "YES"; - } - enablePhosphor(enable, p_blend); - createScanlineSurface(); setNTSC(NTSCFilter::Preset(myOSystem.settings().getInt("tv.filter")), false);