1
0
mirror of https://github.com/TomHarte/CLK.git synced 2026-04-21 17:16:44 +00:00

Numerous IWM fixes: the machine now seems to be trying to measure the tachometer.

This commit is contained in:
Thomas Harte
2019-06-06 18:32:11 -04:00
parent 08671ed69c
commit 7591906777
6 changed files with 72 additions and 33 deletions
+9
View File
@@ -112,6 +112,15 @@ int Drive::get_head_count() {
return available_heads_;
}
bool Drive::get_tachometer() {
// First guess: the tachometer ticks once per rotation.
return get_rotation() > 0.5f;
}
float Drive::get_rotation() {
return get_time_into_track().get<float>();
}
Storage::Time Drive::get_time_into_track() {
// `result` will initially be amount of time since the index hole was seen as a
// proportion of a second; convert it into proportion of a rotation, simplify and return.