Add plain video mode.

This commit is contained in:
Christian Speckner 2020-10-04 21:55:47 +02:00
parent c7e66fff0a
commit e2d8d7e23e
4 changed files with 37 additions and 10 deletions

View File

@ -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;

View File

@ -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 <standard| Use the specified color palette\n"
<< " z26|user|\n"
<< " custom>\n"
<< " -plain-video <1|0> Disable all scaling and postprocessing\n"
<< " -pal.phase_ntsc <number> Phase shift for NTSC 'custom' palette\n"
<< " -pal.phase_pal <number> Phase shift for PAL 'custom' palette\n"
<< " -pal.hue <-1.0 - 1.0> Adjust hue for current palette\n"

View File

@ -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");
}

View File

@ -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<FBSurface> 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<FBSurface> myTiaSurface, mySLineSurface, myBaseTiaSurface;
// NTSC object to use in TIA rendering mode
NTSCFilter myNTSCFilter;