adapt debugger UI to new display heights

This commit is contained in:
thrust26 2020-01-25 13:56:46 +01:00
parent d6fdb8de79
commit 7e90323d4b
5 changed files with 29 additions and 19 deletions

View File

@ -46,6 +46,7 @@
#include "StellaMediumFont.hxx" #include "StellaMediumFont.hxx"
#include "OptionsDialog.hxx" #include "OptionsDialog.hxx"
#include "StateManager.hxx" #include "StateManager.hxx"
#include "FrameManager.hxx"
#include "DebuggerDialog.hxx" #include "DebuggerDialog.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -659,7 +660,7 @@ void DebuggerDialog::addRomArea()
Common::Rect DebuggerDialog::getTiaBounds() const Common::Rect DebuggerDialog::getTiaBounds() const
{ {
// The area showing the TIA image (NTSC and PAL supported, up to 274 lines without scaling) // 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)));
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -31,6 +31,7 @@
#include "TIASurface.hxx" #include "TIASurface.hxx"
#include "TIA.hxx" #include "TIA.hxx"
#include "TimerManager.hxx" #include "TimerManager.hxx"
#include "FrameManager.hxx"
#include "TiaOutputWidget.hxx" #include "TiaOutputWidget.hxx"
@ -161,8 +162,11 @@ void TiaOutputWidget::handleCommand(CommandSender* sender, int cmd, int data, in
void TiaOutputWidget::drawWidget(bool hilite) void TiaOutputWidget::drawWidget(bool hilite)
{ {
//cerr << "TiaOutputWidget::drawWidget\n"; //cerr << "TiaOutputWidget::drawWidget\n";
const uInt32 width = instance().console().tia().width(), const uInt32 width = instance().console().tia().width();
height = instance().console().tia().height(); 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(); FBSurface& s = dialog().surface();
s.vLine(_x + _w + 1, _y, height, kColor); s.vLine(_x + _w + 1, _y, height, kColor);
@ -177,7 +181,7 @@ void TiaOutputWidget::drawWidget(bool hilite)
uInt8* tiaOutputBuffer = instance().console().tia().outputBuffer(); uInt8* tiaOutputBuffer = instance().console().tia().outputBuffer();
TIASurface& tiaSurface(instance().frameBuffer().tiaSurface()); 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(); uInt32* line_ptr = myLineBuffer.data();
for(uInt32 x = 0; x < width; ++x, ++i) for(uInt32 x = 0; x < width; ++x, ++i)

View File

@ -27,6 +27,7 @@
#include "Widget.hxx" #include "Widget.hxx"
#include "GuiObject.hxx" #include "GuiObject.hxx"
#include "ContextMenu.hxx" #include "ContextMenu.hxx"
#include "FrameManager.hxx"
#include "TiaZoomWidget.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 // Use all available space, up to the maximum bounds of the TIA image
_w = std::min(w, 320); _w = std::min(w, 320);
_h = std::min(h, 274); _h = std::min(h, int(FrameManager::Metrics::maxHeight));
addFocusWidget(this); addFocusWidget(this);

View File

@ -22,20 +22,6 @@
#include "FrameManager.hxx" #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() FrameManager::FrameManager()
{ {

View File

@ -24,6 +24,24 @@
#include "JitterEmulation.hxx" #include "JitterEmulation.hxx"
class FrameManager: public AbstractFrameManager { 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: public:
FrameManager(); FrameManager();