From d07f3216ab89e20a37f4ffd5cb40afe3ce36aaee Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 7 Aug 2017 12:12:59 -0400 Subject: [PATCH] Added a broad phase on whether seeking is ongoing. --- Components/8272/i8272.cpp | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/Components/8272/i8272.cpp b/Components/8272/i8272.cpp index 194cccdb6..38eb0f46e 100644 --- a/Components/8272/i8272.cpp +++ b/Components/8272/i8272.cpp @@ -47,22 +47,24 @@ void i8272::run_for(Cycles cycles) { } // update seek status of any drives presently seeking - for(int c = 0; c < 4; c++) { - if(drives_[c].phase == Drive::Seeking) { - drives_[c].step_rate_counter += cycles.as_int(); - int steps = drives_[c].step_rate_counter / (8000 * step_rate_time_); - drives_[c].step_rate_counter %= (8000 * step_rate_time_); - while(steps--) { - // Perform a step. - int direction = (drives_[c].target_head_position < drives_[c].head_position) ? -1 : 1; - drives_[c].drive->step(direction); - drives_[c].head_position += direction; + if(main_status_ & 0xf) { + for(int c = 0; c < 4; c++) { + if(drives_[c].phase == Drive::Seeking) { + drives_[c].step_rate_counter += cycles.as_int(); + int steps = drives_[c].step_rate_counter / (8000 * step_rate_time_); + drives_[c].step_rate_counter %= (8000 * step_rate_time_); + while(steps--) { + // Perform a step. + int direction = (drives_[c].target_head_position < drives_[c].head_position) ? -1 : 1; + drives_[c].drive->step(direction); + drives_[c].head_position += direction; - // Check for completion. - if(seek_is_satisfied(c)) { - drives_[c].phase = Drive::CompletedSeeking; - if(drives_[c].target_head_position == -1) drives_[c].head_position = 0; - break; + // Check for completion. + if(seek_is_satisfied(c)) { + drives_[c].phase = Drive::CompletedSeeking; + if(drives_[c].target_head_position == -1) drives_[c].head_position = 0; + break; + } } } }