From a4ee697ed11d7de9cad141ce00cbd04829f2dce1 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sat, 12 Aug 2017 12:53:45 -0400 Subject: [PATCH] Quickie: head unload is scheduled only if the head is presently loaded. --- Components/8272/i8272.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Components/8272/i8272.cpp b/Components/8272/i8272.cpp index 39d70d2c9..0b84e6086 100644 --- a/Components/8272/i8272.cpp +++ b/Components/8272/i8272.cpp @@ -174,10 +174,12 @@ void i8272::set_disk(std::shared_ptr disk, int drive) { } #define SCHEDULE_HEAD_UNLOAD() \ - if(drives_[active_drive_].head_unload_delay[active_head_] == 0) { \ - head_timers_running_++; \ - } \ - drives_[active_drive_].head_unload_delay[active_head_] = MS_TO_CYCLES(head_unload_time_); + if(drives_[active_drive_].head_is_loaded[active_head_]) {\ + if(drives_[active_drive_].head_unload_delay[active_head_] == 0) { \ + head_timers_running_++; \ + } \ + drives_[active_drive_].head_unload_delay[active_head_] = MS_TO_CYCLES(head_unload_time_);\ + } void i8272::posit_event(int event_type) { if(!(interesting_event_mask_ & event_type)) return;