mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-13 22:32:03 +00:00
Okay, it's becoming more apparent where the (very mild) complexity will be here. But started moving towards retaining rotation between tracks.
This commit is contained in:
parent
21f1fa37a4
commit
a3a3486f54
@ -49,11 +49,28 @@ bool DiskDrive::get_is_track_zero()
|
||||
void DiskDrive::step(int direction)
|
||||
{
|
||||
_head_position = std::max(_head_position + direction, 0);
|
||||
|
||||
// TODO: add fractional part to _time_into_track
|
||||
|
||||
// TODO: probably a better implementation of the empty track?
|
||||
// Time offset;
|
||||
// if(_track)
|
||||
// {
|
||||
// Time time_found = _track->seek_to(_time_into_track);
|
||||
// offset = _time_into_track - time_found;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// offset = _time_into_track;
|
||||
// }
|
||||
|
||||
// TODO: apply offset
|
||||
set_track();
|
||||
}
|
||||
|
||||
void DiskDrive::set_track()
|
||||
{
|
||||
// TODO: accept and apply offset
|
||||
_track = _disk->get_track_at_position((unsigned int)_head_position);
|
||||
reset_timer();
|
||||
get_next_event();
|
||||
|
@ -53,6 +53,14 @@ struct Time {
|
||||
return result;
|
||||
}
|
||||
|
||||
inline Time operator-(Time &other)
|
||||
{
|
||||
Time result;
|
||||
result.clock_rate = NumberTheory::least_common_multiple(clock_rate, other.clock_rate);
|
||||
result.length = length * (result.clock_rate / clock_rate) - other.length * (result.clock_rate / other.clock_rate);
|
||||
return result;
|
||||
}
|
||||
|
||||
inline void set_zero()
|
||||
{
|
||||
length = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user