From 5351ac560fce0ffa4eb6fd4ea5cbdebd560ade63 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 28 Jun 2021 21:40:12 -0400 Subject: [PATCH] Ensure the motor goes off for unselected drives. --- Machines/Enterprise/EXDos.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Machines/Enterprise/EXDos.cpp b/Machines/Enterprise/EXDos.cpp index 015626e2a..1bc80ef41 100644 --- a/Machines/Enterprise/EXDos.cpp +++ b/Machines/Enterprise/EXDos.cpp @@ -48,8 +48,13 @@ void EXDos::set_control_register(uint8_t control) { get_drive(c).set_head(head); } - // Select drive. + // Select drive, ensuring handover of the motor-on state. + const bool motor_state = get_drive().get_motor_on(); + for_all_drives([] (Storage::Disk::Drive &drive, size_t) { + drive.set_motor_on(false); + }); set_drive(control & 0xf); + get_drive().set_motor_on(motor_state); } uint8_t EXDos::get_control_register() {