mirror of
https://github.com/TomHarte/CLK.git
synced 2025-08-08 14:25:05 +00:00
Ensured the head_unload_delay values are properly seeded, and generalised the quick escape.
This commit is contained in:
@@ -128,6 +128,7 @@ void i8272::run_for(Cycles cycles) {
|
|||||||
|
|
||||||
// check for any head unloads
|
// check for any head unloads
|
||||||
if(head_timers_running_) {
|
if(head_timers_running_) {
|
||||||
|
int timers_left = head_timers_running_;
|
||||||
for(int c = 0; c < 4; c++) {
|
for(int c = 0; c < 4; c++) {
|
||||||
for(int h = 0; h < 2; h++) {
|
for(int h = 0; h < 2; h++) {
|
||||||
if(drives_[c].head_unload_delay[c] > 0) {
|
if(drives_[c].head_unload_delay[c] > 0) {
|
||||||
@@ -135,10 +136,11 @@ void i8272::run_for(Cycles cycles) {
|
|||||||
drives_[c].head_unload_delay[c] = 0;
|
drives_[c].head_unload_delay[c] = 0;
|
||||||
drives_[c].head_is_loaded[c] = false;
|
drives_[c].head_is_loaded[c] = false;
|
||||||
head_timers_running_--;
|
head_timers_running_--;
|
||||||
if(!head_timers_running_) return;
|
|
||||||
} else {
|
} else {
|
||||||
drives_[c].head_unload_delay[c] -= cycles.as_int();
|
drives_[c].head_unload_delay[c] -= cycles.as_int();
|
||||||
}
|
}
|
||||||
|
timers_left--;
|
||||||
|
if(!timers_left) return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -102,7 +102,8 @@ class i8272: public Storage::Disk::MFMController {
|
|||||||
Drive() :
|
Drive() :
|
||||||
head_position(0), phase(NotSeeking),
|
head_position(0), phase(NotSeeking),
|
||||||
drive(new Storage::Disk::Drive),
|
drive(new Storage::Disk::Drive),
|
||||||
head_is_loaded{false, false} {};
|
head_is_loaded{false, false},
|
||||||
|
head_unload_delay{0, 0} {};
|
||||||
} drives_[4];
|
} drives_[4];
|
||||||
int drives_seeking_;
|
int drives_seeking_;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user