From 9ab3d52eb2188df5186dc0ffe33b0d8636ba9f2a Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sat, 4 Apr 2026 11:05:01 -0400 Subject: [PATCH] Force drive selection; verify that the index hole is going by. --- Machines/Thomson/MO5/CD90-640.cpp | 3 ++- Machines/Thomson/MO5/CD90-640.hpp | 15 +++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Machines/Thomson/MO5/CD90-640.cpp b/Machines/Thomson/MO5/CD90-640.cpp index c24e21fbf..bc8fcdf98 100644 --- a/Machines/Thomson/MO5/CD90-640.cpp +++ b/Machines/Thomson/MO5/CD90-640.cpp @@ -36,8 +36,9 @@ void CD90_640::set_activity_observer(Activity::Observer *const observer) { void CD90_640::set_disk(std::shared_ptr disk, const size_t drive) { get_drive(drive).set_disk(disk); - // TODO: what is really in charge of motor control? + // TODO: what is really in charge of motor control and drive selection? get_drive(drive).set_motor_on(true); + set_drive(1 << drive); } const Storage::Disk::Disk *CD90_640::disk(const std::string &name) { diff --git a/Machines/Thomson/MO5/CD90-640.hpp b/Machines/Thomson/MO5/CD90-640.hpp index b9701ae96..4af1f4b5e 100644 --- a/Machines/Thomson/MO5/CD90-640.hpp +++ b/Machines/Thomson/MO5/CD90-640.hpp @@ -25,12 +25,15 @@ public: template uint8_t read() { - Logger::info().append("Read %04x", address); - if(address & 8) { - return control(); - } else { - return WD::WD1770::read(address); - } + const uint8_t result = [&] { + if(address & 8) { + return control(); + } else { + return WD::WD1770::read(address); + } + } (); + Logger::info().append("Read %02x <- %04x", result, address); + return result; } template