diff --git a/src/emucore/Console.cxx b/src/emucore/Console.cxx index 8d23f152a..093e5650f 100644 --- a/src/emucore/Console.cxx +++ b/src/emucore/Console.cxx @@ -511,6 +511,7 @@ void Console::changeHeight(int direction) if(direction == +1) // increase Height { height++; + if (height < 210) height = 210; if(height > 256 || height > dheight) { myOSystem.frameBuffer().showMessage("Height at maximum"); @@ -520,11 +521,7 @@ void Console::changeHeight(int direction) else if(direction == -1) // decrease Height { height--; - if(height < 210) - { - myOSystem.frameBuffer().showMessage("Height at minimum"); - return; - } + if(height < 210) height = 0; } else return; @@ -546,7 +543,7 @@ void Console::setTIAProperties() uInt32 ystart = atoi(myProperties.get(Display_YStart).c_str()); if(ystart > 64) ystart = 64; uInt32 height = atoi(myProperties.get(Display_Height).c_str()); - if(height < 210) height = 210; + if(height < 210 && height != 0) height = 210; else if(height > 256) height = 256; if(myDisplayFormat == "NTSC" || myDisplayFormat == "PAL60" || @@ -563,18 +560,9 @@ void Console::setTIAProperties() myConsoleInfo.InitialFrameRate = "50"; // PAL ROMs normally need at least 250 lines - height = std::max(height, 250u); + if (height != 0) height = std::max(height, 250u); } - // Make sure these values fit within the bounds of the desktop - // If not, attempt to center vertically - uInt32 dheight = myOSystem.frameBuffer().desktopSize().h; - if(height > dheight) - { - ystart += height - dheight; - ystart = std::min(ystart, 64u); - height = dheight; - } myTIA->setYStart(ystart); myTIA->setHeight(height); } diff --git a/src/emucore/Props.cxx b/src/emucore/Props.cxx index b97292219..fbcabf89d 100644 --- a/src/emucore/Props.cxx +++ b/src/emucore/Props.cxx @@ -322,7 +322,7 @@ const char* Properties::ourDefaultProperties[LastPropType] = { "AUTO", // Controller.MouseAxis "AUTO", // Display.Format "0", // Display.YStart - "210", // Display.Height + "0", // Display.Height "NO", // Display.Phosphor "77" // Display.PPBlend }; diff --git a/src/emucore/tia/FrameManager.cxx b/src/emucore/tia/FrameManager.cxx index 69599bcbf..dc8304702 100644 --- a/src/emucore/tia/FrameManager.cxx +++ b/src/emucore/tia/FrameManager.cxx @@ -45,6 +45,7 @@ static constexpr uInt32 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - FrameManager::FrameManager() : myMode(TvMode::pal), + myFixedHeight(0), myVblankMode(VblankMode::floating), myYstart(0) { @@ -100,9 +101,8 @@ void FrameManager::nextLine() break; case State::frame: - if (myLineInState >= myKernelLines + Metrics::visibleOverscan) { + if (myLineInState >= (myFixedHeight > 0 ? myFixedHeight : (myKernelLines + Metrics::visibleOverscan))) finalizeFrame(); - } break; default: @@ -234,7 +234,15 @@ TvMode FrameManager::tvMode() const // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - uInt32 FrameManager::height() const { - return myKernelLines + Metrics::visibleOverscan; + return myFixedHeight > 0 ? myFixedHeight : (myKernelLines + Metrics::visibleOverscan); +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void FrameManager::setFixedHeight(uInt32 height) +{ + myFixedHeight = height; + + (cout << myFixedHeight << "\n").flush(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/emucore/tia/FrameManager.hxx b/src/emucore/tia/FrameManager.hxx index f71bfbb7d..b78a191df 100644 --- a/src/emucore/tia/FrameManager.hxx +++ b/src/emucore/tia/FrameManager.hxx @@ -55,6 +55,8 @@ class FrameManager : public Serializable uInt32 height() const; + void setFixedHeight(uInt32 height); + uInt32 currentLine() const; uInt32 scanlines() const; @@ -129,6 +131,7 @@ class FrameManager : public Serializable uInt32 myKernelLines; uInt32 myOverscanLines; uInt32 myFrameLines; + uInt32 myFixedHeight; VblankMode myVblankMode; uInt32 myLastVblankLines; diff --git a/src/emucore/tia/TIA.cxx b/src/emucore/tia/TIA.cxx index 7365efc5e..93223c86d 100644 --- a/src/emucore/tia/TIA.cxx +++ b/src/emucore/tia/TIA.cxx @@ -614,27 +614,24 @@ void TIA::update() } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -// TODO: stub uInt32 TIA::height() const { return myFrameManager.height(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -// TODO: stub uInt32 TIA::ystart() const { return myFrameManager.ystart(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -// TODO: stub void TIA::setHeight(uInt32 height) { + myFrameManager.setFixedHeight(height); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -// TODO: stub void TIA::setYStart(uInt32 ystart) { myFrameManager.setYstart(ystart);