mirror of
https://github.com/TomHarte/CLK.git
synced 2026-04-19 19:16:34 +00:00
Attempted to reduce track invalidations.
This commit is contained in:
@@ -535,10 +535,12 @@ void WD1770::posit_event(Event new_event_type)
|
||||
}
|
||||
if(distance_into_section_ == 7)
|
||||
{
|
||||
printf("Considering %d/%d\n", header_[0], header_[2]);
|
||||
is_reading_data_ = false;
|
||||
if(header_[0] == track_ && header_[2] == sector_ &&
|
||||
(has_motor_on_line() || !(command_&0x02) || ((command_&0x08) >> 3) == header_[1]))
|
||||
{
|
||||
printf("Found %d/%d\n", header_[0], header_[2]);
|
||||
// TODO: test CRC
|
||||
goto type2_read_or_write_data;
|
||||
}
|
||||
|
||||
@@ -235,8 +235,11 @@ bool Controller::get_motor_on()
|
||||
|
||||
void Controller::set_drive(std::shared_ptr<Drive> drive)
|
||||
{
|
||||
invalidate_track();
|
||||
drive_ = drive;
|
||||
if(drive_ != drive)
|
||||
{
|
||||
invalidate_track();
|
||||
drive_ = drive;
|
||||
}
|
||||
}
|
||||
|
||||
void Controller::invalidate_track()
|
||||
|
||||
Reference in New Issue
Block a user