From 88248d7062ead8b378fd589bfe9550e13cf30510 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Fri, 6 Sep 2024 20:55:26 -0400 Subject: [PATCH] Fix base address, delays. --- Machines/Acorn/Electron/Video.cpp | 12 ++++++------ Machines/Acorn/Electron/Video.hpp | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Machines/Acorn/Electron/Video.cpp b/Machines/Acorn/Electron/Video.cpp index 56289d878..d840cdacc 100644 --- a/Machines/Acorn/Electron/Video.cpp +++ b/Machines/Acorn/Electron/Video.cpp @@ -310,7 +310,7 @@ uint8_t VideoOutput::run_for(const Cycles cycles) { output_ = stage; if(stage == OutputStage::Pixels) { - initial_output_target_ = current_output_target_ = crt_.begin_data(mode_40 ? 320 : 640); + initial_output_target_ = current_output_target_ = crt_.begin_data(640);//crt_.begin_data(mode_40 ? 320 : 640); } } ++output_length_; @@ -352,15 +352,15 @@ uint8_t VideoOutput::run_for(const Cycles cycles) { void VideoOutput::write(int address, uint8_t value) { switch(address & 0xf) { case 0x02: - screen_base = - (screen_base & 0b0111'1110'0000'0000) | - ((value << 1) & 0b0000'0001'1100'0000); - break; - case 0x03: screen_base = (screen_base & 0b0111'1110'0000'0000) | ((value << 1) & 0b0000'0001'1100'0000); break; + case 0x03: + screen_base = + ((value << 9) & 0b0111'1110'0000'0000) | + (screen_base & 0b0000'0001'1100'0000); + break; case 0x07: { uint8_t mode = (value >> 3)&7; mode_40 = mode >= 4; diff --git a/Machines/Acorn/Electron/Video.hpp b/Machines/Acorn/Electron/Video.hpp index caf717e09..f908b25ea 100644 --- a/Machines/Acorn/Electron/Video.hpp +++ b/Machines/Acorn/Electron/Video.hpp @@ -59,7 +59,7 @@ class VideoOutput { /// RAM access that is first signalled in the upcoming cycle. Cycles ram_delay() { if(!mode_40 && !in_blank()) { - return 2 + h_active - h_count; + return 2 + ((h_active - h_count) >> 3); } return io_delay(); }