mirror of
https://github.com/TomHarte/CLK.git
synced 2025-02-16 18:30:32 +00:00
As well as a bunch of logging, reinstated rotation position preservation across tracks.
This commit is contained in:
parent
93c573bfa9
commit
81ee834530
@ -506,6 +506,7 @@ void WD1770::posit_event(Event new_event_type)
|
|||||||
|
|
||||||
if(index_hole_count_ == 5)
|
if(index_hole_count_ == 5)
|
||||||
{
|
{
|
||||||
|
printf("Failed to find sector %d\n", sector_);
|
||||||
update_status([] (Status &status) {
|
update_status([] (Status &status) {
|
||||||
status.record_not_found = true;
|
status.record_not_found = true;
|
||||||
});
|
});
|
||||||
|
@ -11,6 +11,10 @@
|
|||||||
using namespace Oric;
|
using namespace Oric;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
// The number below, in cycles against an 8Mhz clock, was arrived at fairly unscientifically,
|
||||||
|
// by comparing the amount of time this emulator took to show a directory versus a video of
|
||||||
|
// a real Oric. It therefore assumes all other timing measurements were correct on the day
|
||||||
|
// of the test. More work to do, I think.
|
||||||
const int head_load_request_counter_target = 7653333;
|
const int head_load_request_counter_target = 7653333;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,6 +38,16 @@ void Microdisc::set_disk(std::shared_ptr<Storage::Disk::Disk> disk, int drive)
|
|||||||
|
|
||||||
void Microdisc::set_control_register(uint8_t control)
|
void Microdisc::set_control_register(uint8_t control)
|
||||||
{
|
{
|
||||||
|
printf("control: %d%d%d%d%d%d%d%d\n",
|
||||||
|
(control >> 7)&1,
|
||||||
|
(control >> 6)&1,
|
||||||
|
(control >> 5)&1,
|
||||||
|
(control >> 4)&1,
|
||||||
|
(control >> 3)&1,
|
||||||
|
(control >> 2)&1,
|
||||||
|
(control >> 1)&1,
|
||||||
|
(control >> 0)&1);
|
||||||
|
|
||||||
// b2: data separator clock rate select (1 = double) [TODO]
|
// b2: data separator clock rate select (1 = double) [TODO]
|
||||||
|
|
||||||
// b65: drive select
|
// b65: drive select
|
||||||
@ -41,9 +55,10 @@ void Microdisc::set_control_register(uint8_t control)
|
|||||||
set_drive(drives_[selected_drive_]);
|
set_drive(drives_[selected_drive_]);
|
||||||
|
|
||||||
// b4: side select
|
// b4: side select
|
||||||
|
unsigned int head = (control & 0x10) ? 1 : 0;
|
||||||
for(int c = 0; c < 4; c++)
|
for(int c = 0; c < 4; c++)
|
||||||
{
|
{
|
||||||
if(drives_[c]) drives_[c]->set_head((control & 0x10) ? 1 : 0);
|
if(drives_[c]) drives_[c]->set_head(head);
|
||||||
}
|
}
|
||||||
|
|
||||||
// b3: double density select (0 = double)
|
// b3: double density select (0 = double)
|
||||||
|
@ -25,13 +25,11 @@ Controller::Controller(unsigned int clock_rate, unsigned int clock_rate_multipli
|
|||||||
set_expected_bit_length(one);
|
set_expected_bit_length(one);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Controller::setup_track() // Time initial_offset
|
void Controller::setup_track()
|
||||||
{
|
{
|
||||||
_track = _drive->get_track();
|
_track = _drive->get_track();
|
||||||
// _track = _disk->get_track_at_position(0, (unsigned int)_head_position);
|
|
||||||
|
|
||||||
// TODO: probably a better implementation of the empty track?
|
Time offset;
|
||||||
/* Time offset;
|
|
||||||
if(_track && _time_into_track.length > 0)
|
if(_track && _time_into_track.length > 0)
|
||||||
{
|
{
|
||||||
Time time_found = _track->seek_to(_time_into_track).simplify();
|
Time time_found = _track->seek_to(_time_into_track).simplify();
|
||||||
@ -42,11 +40,10 @@ void Controller::setup_track() // Time initial_offset
|
|||||||
{
|
{
|
||||||
offset = _time_into_track;
|
offset = _time_into_track;
|
||||||
_time_into_track.set_zero();
|
_time_into_track.set_zero();
|
||||||
}*/
|
}
|
||||||
|
|
||||||
reset_timer();
|
reset_timer_to_offset(offset * _rotational_multiplier);
|
||||||
get_next_event();
|
get_next_event();
|
||||||
// reset_timer_to_offset(offset * _rotational_multiplier);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Controller::run_for_cycles(int number_of_cycles)
|
void Controller::run_for_cycles(int number_of_cycles)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user