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