diff --git a/src/debugger/gui/DebuggerDialog.cxx b/src/debugger/gui/DebuggerDialog.cxx index 23c04f9b9..084f81a17 100644 --- a/src/debugger/gui/DebuggerDialog.cxx +++ b/src/debugger/gui/DebuggerDialog.cxx @@ -46,6 +46,7 @@ #include "StellaMediumFont.hxx" #include "OptionsDialog.hxx" #include "StateManager.hxx" +#include "FrameManager.hxx" #include "DebuggerDialog.hxx" // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -659,7 +660,7 @@ void DebuggerDialog::addRomArea() Common::Rect DebuggerDialog::getTiaBounds() const { // The area showing the TIA image (NTSC and PAL supported, up to 274 lines without scaling) - return Common::Rect(0, 0, 320, std::max(274, int(_h * 0.35))); + return Common::Rect(0, 0, 320, std::max(int(FrameManager::Metrics::baseHeightPAL), int(_h * 0.35))); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/debugger/gui/TiaOutputWidget.cxx b/src/debugger/gui/TiaOutputWidget.cxx index bfe482584..5277647dc 100644 --- a/src/debugger/gui/TiaOutputWidget.cxx +++ b/src/debugger/gui/TiaOutputWidget.cxx @@ -31,6 +31,7 @@ #include "TIASurface.hxx" #include "TIA.hxx" #include "TimerManager.hxx" +#include "FrameManager.hxx" #include "TiaOutputWidget.hxx" @@ -161,8 +162,11 @@ void TiaOutputWidget::handleCommand(CommandSender* sender, int cmd, int data, in void TiaOutputWidget::drawWidget(bool hilite) { //cerr << "TiaOutputWidget::drawWidget\n"; - const uInt32 width = instance().console().tia().width(), - height = instance().console().tia().height(); + const uInt32 width = instance().console().tia().width(); + uInt32 height = instance().console().tia().height(); + // limit to 274 lines (PAL default without scaling) + uInt32 yStart = height <= FrameManager::Metrics::baseHeightPAL ? 0 : (height - FrameManager::Metrics::baseHeightPAL) / 2; + height = std::min(height, uInt32(FrameManager::Metrics::baseHeightPAL)); FBSurface& s = dialog().surface(); s.vLine(_x + _w + 1, _y, height, kColor); @@ -177,7 +181,7 @@ void TiaOutputWidget::drawWidget(bool hilite) uInt8* tiaOutputBuffer = instance().console().tia().outputBuffer(); TIASurface& tiaSurface(instance().frameBuffer().tiaSurface()); - for(uInt32 y = 0, i = 0; y < height; ++y) + for(uInt32 y = 0, i = yStart * width; y < height; ++y) { uInt32* line_ptr = myLineBuffer.data(); for(uInt32 x = 0; x < width; ++x, ++i) diff --git a/src/debugger/gui/TiaZoomWidget.cxx b/src/debugger/gui/TiaZoomWidget.cxx index 8bf1debcf..e4553f361 100644 --- a/src/debugger/gui/TiaZoomWidget.cxx +++ b/src/debugger/gui/TiaZoomWidget.cxx @@ -27,6 +27,7 @@ #include "Widget.hxx" #include "GuiObject.hxx" #include "ContextMenu.hxx" +#include "FrameManager.hxx" #include "TiaZoomWidget.hxx" // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -41,7 +42,7 @@ TiaZoomWidget::TiaZoomWidget(GuiObject* boss, const GUI::Font& font, // Use all available space, up to the maximum bounds of the TIA image _w = std::min(w, 320); - _h = std::min(h, 274); + _h = std::min(h, int(FrameManager::Metrics::maxHeight)); addFocusWidget(this); diff --git a/src/emucore/tia/frame-manager/FrameManager.cxx b/src/emucore/tia/frame-manager/FrameManager.cxx index ebe03e8cf..81d8d75d7 100644 --- a/src/emucore/tia/frame-manager/FrameManager.cxx +++ b/src/emucore/tia/frame-manager/FrameManager.cxx @@ -22,20 +22,6 @@ #include "FrameManager.hxx" -enum Metrics: uInt32 { - vblankNTSC = 37, - vblankPAL = 45, - vsync = 3, - frameSizeNTSC = 262, - frameSizePAL = 312, - baseHeightNTSC = 228, // 217..239 - baseHeightPAL = 274, // 260..288 - maxLinesVsync = 50, - initialGarbageFrames = TIAConstants::initialGarbageFrames, - ystartNTSC = 23, - ystartPAL = 32 -}; - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - FrameManager::FrameManager() { diff --git a/src/emucore/tia/frame-manager/FrameManager.hxx b/src/emucore/tia/frame-manager/FrameManager.hxx index 33c837d10..830a892d1 100644 --- a/src/emucore/tia/frame-manager/FrameManager.hxx +++ b/src/emucore/tia/frame-manager/FrameManager.hxx @@ -24,6 +24,24 @@ #include "JitterEmulation.hxx" class FrameManager: public AbstractFrameManager { + public: + + enum Metrics : uInt32 { + vblankNTSC = 37, + vblankPAL = 45, + vsync = 3, + frameSizeNTSC = 262, + frameSizePAL = 312, + baseHeightNTSC = 228, // 217..239 + baseHeightPAL = 274, // 260..288 + maxHeight = uInt32(baseHeightPAL * 1.05 + 0.5), // 288 + maxLinesVsync = 50, + initialGarbageFrames = TIAConstants::initialGarbageFrames, + ystartNTSC = 23, + ystartPAL = 32 + }; + + public: FrameManager();