From 3853966a1e7eccc55f7a19b2dc52e293aec07370 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sun, 6 Aug 2017 22:10:12 -0400 Subject: [PATCH] =?UTF-8?q?Removed=20formal=20storage=20of=20ST3,=20as=20i?= =?UTF-8?q?t=20just=20seems=20to=20be=20composed=20live.=20This=20may=20tu?= =?UTF-8?q?rn=20out=20also=20to=20be=20the=20best=20way=20to=20deal=20with?= =?UTF-8?q?=20ST0=E2=80=932,=20time=20will=20tell.=20Also=20took=20a=20sta?= =?UTF-8?q?b=20at=20the=20error=20in=20responding=20properly=20to=20the=20?= =?UTF-8?q?ROM's=20intended=20use=20of=20seek=20might=20be=20accepting=20n?= =?UTF-8?q?ew=20commands=20as=20replacements=20for=20old=20ones=20rather?= =?UTF-8?q?=20than=20rejecting=20them.=20That=20didn't=20seem=20to=20do=20?= =?UTF-8?q?the=20trick.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Components/8272/i8272.cpp | 23 +++++++++++++---------- Components/8272/i8272.hpp | 2 +- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/Components/8272/i8272.cpp b/Components/8272/i8272.cpp index 6ccbd9cdf..1fe7d34f7 100644 --- a/Components/8272/i8272.cpp +++ b/Components/8272/i8272.cpp @@ -29,7 +29,7 @@ i8272::i8272(Cycles clock_rate, int clock_rate_multiplier, int revolutions_per_m interesting_event_mask_((int)Event8272::CommandByte), resume_point_(0), delay_time_(0), - status_{0, 0, 0, 0} { + status_{0, 0, 0} { posit_event((int)Event8272::CommandByte); } @@ -91,7 +91,7 @@ uint8_t i8272::get_register(int address) { return result; } else { -// printf("8272 get main status\n"); +// printf("Main status: %02x\n", main_status_); return main_status_; } } @@ -150,6 +150,7 @@ void i8272::posit_event(int event_type) { wait_for_complete_command_sequence: main_status_ |= StatusRQM; WAIT_FOR_EVENT(Event8272::CommandByte) +// printf("."); main_status_ |= StatusCB; main_status_ &= ~StatusRQM; @@ -325,12 +326,14 @@ void i8272::posit_event(int event_type) { recalibrate: seek: printf((command_.size() > 2) ? "Seek\n" : "Recalibrate\n"); - status_[0] = status_[1] = status_[2] = 0; - drives_[command_[1]&3].phase = Drive::Seeking; - drives_[command_[1]&3].steps_taken = 0; - drives_[command_[1]&3].target_head_position = (command_.size() > 2) ? command_[2] : -1; - drives_[command_[1]&3].step_rate_counter = 0; - main_status_ |= 1 << (command_[1]&3); + if(drives_[command_[1]&3].phase != Drive::Seeking) { + status_[0] = status_[1] = status_[2] = 0; + drives_[command_[1]&3].phase = Drive::Seeking; + drives_[command_[1]&3].steps_taken = 0; + drives_[command_[1]&3].target_head_position = (command_.size() > 2) ? command_[2] : -1; + drives_[command_[1]&3].step_rate_counter = 0; + main_status_ |= 1 << (command_[1]&3); + } goto wait_for_command; sense_interrupt_status: @@ -367,8 +370,8 @@ void i8272::posit_event(int event_type) { goto wait_for_command; sense_drive_status: - printf("Sense drive status\n"); - result_stack_.push_back(status_[3]); + printf("Sense drive status unimplemented!!\n"); +// result_stack_.push_back(status_[3]); goto post_result; invalid: diff --git a/Components/8272/i8272.hpp b/Components/8272/i8272.hpp index f441431a0..3027e8c96 100644 --- a/Components/8272/i8272.hpp +++ b/Components/8272/i8272.hpp @@ -31,7 +31,7 @@ class i8272: public Storage::Disk::MFMController { private: void posit_event(int type); uint8_t main_status_; - uint8_t status_[4]; + uint8_t status_[3]; std::vector command_; std::vector result_stack_;