diff --git a/src/emucore/Console.cxx b/src/emucore/Console.cxx index 9cf1b57d2..04040c597 100644 --- a/src/emucore/Console.cxx +++ b/src/emucore/Console.cxx @@ -622,11 +622,20 @@ FBInitStatus Console::initializeVideo(bool full) if(full) { + uInt32 width, height; + if (myOSystem.settings().getBool("plain-video")) { + width = 2 * myTIA->width(); + height = myTIA->height(); + } else { + width = TIAConstants::viewableWidth; + height = TIAConstants::viewableHeight; + } + bool devSettings = myOSystem.settings().getBool("dev.settings"); const string& title = string("Stella ") + STELLA_VERSION + ": \"" + myProperties.get(PropType::Cart_Name) + "\""; fbstatus = myOSystem.frameBuffer().createDisplay(title, FrameBuffer::BufferType::Emulator, - TIAConstants::viewableWidth, TIAConstants::viewableHeight, false); + width, height, false); if(fbstatus != FBInitStatus::Success) return fbstatus; diff --git a/src/emucore/Settings.cxx b/src/emucore/Settings.cxx index e9d0de8c8..595ab35ec 100644 --- a/src/emucore/Settings.cxx +++ b/src/emucore/Settings.cxx @@ -48,6 +48,7 @@ Settings::Settings() setPermanent("windowedpos", Common::Point(50, 50)); setPermanent("display", 0); setPermanent("uimessages", "true"); + setTemporary("plain-video", "false"); // TIA specific options setPermanent("tia.inter", "false"); setPermanent("tia.zoom", "3"); @@ -417,6 +418,7 @@ void Settings::usage() const << " -palette \n" + << " -plain-video <1|0> Disable all scaling and postprocessing\n" << " -pal.phase_ntsc Phase shift for NTSC 'custom' palette\n" << " -pal.phase_pal Phase shift for PAL 'custom' palette\n" << " -pal.hue <-1.0 - 1.0> Adjust hue for current palette\n" diff --git a/src/emucore/TIASurface.cxx b/src/emucore/TIASurface.cxx index 781ca203a..a6f11c956 100644 --- a/src/emucore/TIASurface.cxx +++ b/src/emucore/TIASurface.cxx @@ -56,7 +56,9 @@ TIASurface::TIASurface(OSystem& system) myTiaSurface = myFB.allocateSurface( AtariNTSC::outWidth(TIAConstants::frameBufferWidth), TIAConstants::frameBufferHeight, - interpolationModeFromSettings(myOSystem.settings()) + plainVideoEnabled() + ? FrameBuffer::ScalingInterpolation::none + : interpolationModeFromSettings(myOSystem.settings()) ); // Generate scanline data, and a pre-defined scanline surface @@ -276,6 +278,8 @@ uInt32 TIASurface::enableScanlines(int change) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void TIASurface::enablePhosphor(bool enable, int blend) { + enable = enable && !plainVideoEnabled(); + if(myPhosphorHandler.initialize(enable, blend)) { myFilter = Filter(enable ? uInt8(myFilter) | 0x01 : uInt8(myFilter) & 0x10); @@ -286,6 +290,8 @@ void TIASurface::enablePhosphor(bool enable, int blend) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void TIASurface::enableNTSC(bool enable) { + enable = enable && !plainVideoEnabled(); + myFilter = Filter(enable ? uInt8(myFilter) | 0x10 : uInt8(myFilter) & 0x01); uInt32 surfaceWidth = enable ? @@ -299,7 +305,7 @@ void TIASurface::enableNTSC(bool enable) mySLineSurface->setSrcSize(1, 2 * myTIA->height()); - myScanlinesEnabled = myOSystem.settings().getInt("tv.scanlines") > 0; + myScanlinesEnabled = !plainVideoEnabled() && myOSystem.settings().getInt("tv.scanlines") > 0; FBSurface::Attributes& sl_attr = mySLineSurface->attributes(); sl_attr.blending = myScanlinesEnabled; sl_attr.blendalpha = myOSystem.settings().getInt("tv.scanlines"); @@ -311,8 +317,9 @@ void TIASurface::enableNTSC(bool enable) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - string TIASurface::effectsInfo() const { - const FBSurface::Attributes& attr = mySLineSurface->attributes(); + if (plainVideoEnabled()) return "plain video mode"; + const FBSurface::Attributes& attr = mySLineSurface->attributes(); ostringstream buf; switch(myFilter) { @@ -515,3 +522,8 @@ void TIASurface::updateSurfaceSettings() interpolationModeFromSettings(myOSystem.settings()) ); } + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +bool TIASurface::plainVideoEnabled() const { + return myOSystem.settings().getBool("plain-video"); +} diff --git a/src/emucore/TIASurface.hxx b/src/emucore/TIASurface.hxx index 2b6213785..a8c17bda4 100644 --- a/src/emucore/TIASurface.hxx +++ b/src/emucore/TIASurface.hxx @@ -183,13 +183,10 @@ class TIASurface */ uInt32 averageBuffers(uInt32 bufOfs); + // Is plain video mode enabled? + bool plainVideoEnabled() const; + private: - OSystem& myOSystem; - FrameBuffer& myFB; - TIA* myTIA{nullptr}; - - shared_ptr myTiaSurface, mySLineSurface, myBaseTiaSurface; - // Enumeration created such that phosphor off/on is in LSB, // and Blargg off/on is in MSB enum class Filter: uInt8 { @@ -200,6 +197,13 @@ class TIASurface }; Filter myFilter{Filter::Normal}; + private: + OSystem& myOSystem; + FrameBuffer& myFB; + TIA* myTIA{nullptr}; + + shared_ptr myTiaSurface, mySLineSurface, myBaseTiaSurface; + // NTSC object to use in TIA rendering mode NTSCFilter myNTSCFilter;