From 3b62a2fe7aa1992c6087e1ec05bf6a34fd7fdda7 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 1 Apr 2024 21:39:10 -0400 Subject: [PATCH] Restrict video buffer to first 512kb. --- Machines/Acorn/Archimedes/Video.hpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Machines/Acorn/Archimedes/Video.hpp b/Machines/Acorn/Archimedes/Video.hpp index e0ca639da..e5215ae5d 100644 --- a/Machines/Acorn/Archimedes/Video.hpp +++ b/Machines/Acorn/Archimedes/Video.hpp @@ -124,6 +124,7 @@ struct Video { if(vertical_state_.position == vertical_timing_.period) { vertical_state_.position = 0; address_ = frame_start_; + if(address_ == buffer_end_) address_ = buffer_start_; entered_sync_ = true; interrupt_observer_.update_interrupts(); @@ -281,10 +282,10 @@ struct Video { return interrupt; } - void set_frame_start(uint32_t address) { frame_start_ = address; } - void set_buffer_start(uint32_t address) { buffer_start_ = address; } - void set_buffer_end(uint32_t address) { buffer_end_ = address; } - void set_cursor_start(uint32_t address) { cursor_start_ = address; } + void set_frame_start(uint32_t address) { frame_start_ = address & 0x7'ffff; } + void set_buffer_start(uint32_t address) { buffer_start_ = address & 0x7'ffff; } + void set_buffer_end(uint32_t address) { buffer_end_ = address & 0x7'ffff; } + void set_cursor_start(uint32_t address) { cursor_start_ = address & 0x7'ffff; } Outputs::CRT::CRT &crt() { return crt_; } const Outputs::CRT::CRT &crt() const { return crt_; }