mirror of
https://github.com/TomHarte/CLK.git
synced 2025-08-16 05:27:43 +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:
@@ -49,11 +49,28 @@ bool DiskDrive::get_is_track_zero()
|
|||||||
void DiskDrive::step(int direction)
|
void DiskDrive::step(int direction)
|
||||||
{
|
{
|
||||||
_head_position = std::max(_head_position + direction, 0);
|
_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();
|
set_track();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DiskDrive::set_track()
|
void DiskDrive::set_track()
|
||||||
{
|
{
|
||||||
|
// TODO: accept and apply offset
|
||||||
_track = _disk->get_track_at_position((unsigned int)_head_position);
|
_track = _disk->get_track_at_position((unsigned int)_head_position);
|
||||||
reset_timer();
|
reset_timer();
|
||||||
get_next_event();
|
get_next_event();
|
||||||
|
@@ -53,6 +53,14 @@ struct Time {
|
|||||||
return result;
|
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()
|
inline void set_zero()
|
||||||
{
|
{
|
||||||
length = 0;
|
length = 0;
|
||||||
|
Reference in New Issue
Block a user