diff --git a/Components/6522/Implementation/6522Implementation.hpp b/Components/6522/Implementation/6522Implementation.hpp index 913ea4ee4..3e23422eb 100644 --- a/Components/6522/Implementation/6522Implementation.hpp +++ b/Components/6522/Implementation/6522Implementation.hpp @@ -120,8 +120,6 @@ template void MOS6522::write(int address, uint8_t value) { registers_.auxiliary_control = value; evaluate_cb2_output(); - printf("Shift mode: %d\n", shift_mode()); - // This is a bit of a guess: reset the timer-based PB7 output to its default high level // any timer that timer-linked PB7 output is disabled. if(!timer1_is_controlling_pb7()) { diff --git a/OSBindings/Mac/Clock Signal/ScanTarget/CSScanTarget.mm b/OSBindings/Mac/Clock Signal/ScanTarget/CSScanTarget.mm index 7076afa80..79d1bc021 100644 --- a/OSBindings/Mac/Clock Signal/ScanTarget/CSScanTarget.mm +++ b/OSBindings/Mac/Clock Signal/ScanTarget/CSScanTarget.mm @@ -278,8 +278,9 @@ using BufferingScanTarget = Outputs::Display::BufferingScanTarget; size_t _chromaKernelSize; std::atomic _isUsingSupersampling; - // The output view. + // The output view and its aspect ratio. __weak MTKView *_view; + CGFloat _viewAspectRatio; // To avoid accessing .bounds away from the main thread. } - (nonnull instancetype)initWithView:(nonnull MTKView *)view { @@ -357,6 +358,7 @@ using BufferingScanTarget = Outputs::Display::BufferingScanTarget; @param size New drawable size in pixels */ - (void)mtkView:(nonnull MTKView *)view drawableSizeWillChange:(CGSize)size { + _viewAspectRatio = size.width / size.height; [self setAspectRatio]; @synchronized(self) { @@ -522,7 +524,6 @@ using BufferingScanTarget = Outputs::Display::BufferingScanTarget; - (void)setAspectRatio { const auto modals = _scanTarget.modals(); - const auto viewAspectRatio = (_view.bounds.size.width / _view.bounds.size.height); simd::float3x3 sourceToDisplay{1.0f}; // The starting coordinate space is [0, 1]. @@ -550,7 +551,7 @@ using BufferingScanTarget = Outputs::Display::BufferingScanTarget; // Determine the correct zoom level. This is a combination of (i) the necessary horizontal stretch to produce a proper // aspect ratio; and (ii) the necessary zoom from there to either fit the visible area width or height as per a decision // on letterboxing or pillarboxing. - const float aspectRatioStretch = float(modals.aspect_ratio / viewAspectRatio); + const float aspectRatioStretch = float(modals.aspect_ratio / _viewAspectRatio); const float fitWidthZoom = 1.0f / (float(modals.visible_area.size.width) * aspectRatioStretch); const float fitHeightZoom = 1.0f / float(modals.visible_area.size.height); const float zoom = std::min(fitWidthZoom, fitHeightZoom);