From 778b9ef6838e6abb14b6422dc5d4494cb9805713 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 7 Jun 2021 20:41:02 -0400 Subject: [PATCH] Ensures set_square_pixels is exposed, works around OpenGL aspect ratio bug. --- Machines/Apple/AppleII/AppleII.hpp | 5 +---- Machines/Apple/AppleII/Video.cpp | 14 ++++++++++++-- .../xcschemes/Clock Signal Kiosk.xcscheme | 16 ++++++++++++---- 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/Machines/Apple/AppleII/AppleII.hpp b/Machines/Apple/AppleII/AppleII.hpp index 94aa43289..97d348578 100644 --- a/Machines/Apple/AppleII/AppleII.hpp +++ b/Machines/Apple/AppleII/AppleII.hpp @@ -34,12 +34,9 @@ class Machine { Options(Configurable::OptionsType) : Configurable::DisplayOption(Configurable::Display::CompositeColour) { if(needs_declare()) { + DeclareField(use_square_pixels); declare_display_option(); limit_enum(&output, Configurable::Display::CompositeMonochrome, Configurable::Display::CompositeColour, -1); - - if(needs_declare()) { - DeclareField(use_square_pixels); - } } } }; diff --git a/Machines/Apple/AppleII/Video.cpp b/Machines/Apple/AppleII/Video.cpp index 6a07308b2..ae358c0ab 100644 --- a/Machines/Apple/AppleII/Video.cpp +++ b/Machines/Apple/AppleII/Video.cpp @@ -15,9 +15,8 @@ VideoBase::VideoBase(bool is_iie, std::function &&target) : crt_(910, 1, Outputs::Display::Type::NTSC60, Outputs::Display::InputDataType::Luminance1), is_iie_(is_iie) { - // Show only the centre 75% of the TV frame. crt_.set_display_type(Outputs::Display::DisplayType::CompositeColour); - crt_.set_visible_area(Outputs::Display::Rect(0.118f, 0.122f, 0.77f, 0.77f)); + set_use_square_pixels(use_square_pixels_); // TODO: there seems to be some sort of bug whereby switching modes can cause // a signal discontinuity that knocks phase out of whack. So it isn't safe to @@ -29,6 +28,17 @@ VideoBase::VideoBase(bool is_iie, std::function &&target) : void VideoBase::set_use_square_pixels(bool use_square_pixels) { use_square_pixels_ = use_square_pixels; + // HYPER-UGLY HACK. See correlated hack in the Macintosh. +#ifdef __APPLE__ + crt_.set_visible_area(Outputs::Display::Rect(0.128f, 0.122f, 0.75f, 0.77f)); +#else + if(use_square_pixels) { + crt_.set_visible_area(Outputs::Display::Rect(0.128f, 0.112f, 0.75f, 0.73f)); + } else { + crt_.set_visible_area(Outputs::Display::Rect(0.128f, 0.12f, 0.75f, 0.77f)); + } +#endif + if(use_square_pixels) { // From what I can make out, many contemporary Apple II monitors were // calibrated slightly to stretch the Apple II's display slightly wider diff --git a/OSBindings/Mac/Clock Signal.xcodeproj/xcshareddata/xcschemes/Clock Signal Kiosk.xcscheme b/OSBindings/Mac/Clock Signal.xcodeproj/xcshareddata/xcschemes/Clock Signal Kiosk.xcscheme index 131430afb..263537208 100644 --- a/OSBindings/Mac/Clock Signal.xcodeproj/xcshareddata/xcschemes/Clock Signal Kiosk.xcscheme +++ b/OSBindings/Mac/Clock Signal.xcodeproj/xcshareddata/xcschemes/Clock Signal Kiosk.xcscheme @@ -56,13 +56,17 @@ argument = "/Users/thomasharte/Downloads/test-dsk-for-rw-and-50-60-hz/TEST-RW-60Hz.DSK" isEnabled = "NO"> + + + isEnabled = "NO"> + isEnabled = "YES"> + isEnabled = "YES"> + +