1
0
mirror of https://github.com/TomHarte/CLK.git synced 2026-04-20 10:17:05 +00:00

Implemented missing status bits (other than the index hole), and a head loading delay for the Microdisc.

This commit is contained in:
Thomas Harte
2016-12-01 21:13:16 -05:00
parent 0a0775c3bd
commit 93c573bfa9
6 changed files with 49 additions and 8 deletions
+6 -5
View File
@@ -108,8 +108,9 @@ uint8_t WD1770::get_register(int address)
if(!has_motor_on_line())
{
// TODO: sample ready line for bit 7
// TODO: report head loaded if reporting a Type 1 status
status |= get_drive_is_ready() ? 0 : Flag::NotReady;
if(status_.type == Status::One)
status |= (head_is_loaded_ ? Flag::HeadLoaded : 0);
}
else
{
@@ -365,7 +366,7 @@ void WD1770::posit_event(Event new_event_type)
}
set_head_load_request(true);
if(head_is_loaded_) goto test_type1_type;
WAIT_FOR_EVENT(Event::HeadLoaded);
WAIT_FOR_EVENT(Event::HeadLoad);
goto test_type1_type;
begin_type1_spin_up:
@@ -477,7 +478,7 @@ void WD1770::posit_event(Event new_event_type)
begin_type2_load_head:
set_head_load_request(true);
if(head_is_loaded_) goto test_type2_delay;
WAIT_FOR_EVENT(Event::HeadLoaded);
WAIT_FOR_EVENT(Event::HeadLoad);
goto test_type2_delay;
begin_type2_spin_up:
@@ -609,5 +610,5 @@ void WD1770::set_head_load_request(bool head_load) {}
void WD1770::set_head_loaded(bool head_loaded)
{
head_is_loaded_ = head_loaded;
if(head_loaded) posit_event(Event::HeadLoaded);
if(head_loaded) posit_event(Event::HeadLoad);
}
+3 -1
View File
@@ -30,10 +30,12 @@ class WD1770: public Storage::Disk::Controller {
void run_for_cycles(unsigned int number_of_cycles);
enum Flag: uint8_t {
NotReady = 0x80,
MotorOn = 0x80,
WriteProtect = 0x40,
RecordType = 0x20,
SpinUp = 0x20,
HeadLoaded = 0x20,
RecordNotFound = 0x10,
SeekError = 0x10,
CRCError = 0x08,
@@ -106,7 +108,7 @@ class WD1770: public Storage::Disk::Controller {
Command = (1 << 0), // Indicates receipt of a new command.
Token = (1 << 1), // Indicates recognition of a new token in the flux stream. Interrogate latest_token_ for details.
IndexHole = (1 << 2), // Indicates the passing of a physical index hole.
HeadLoaded = (1 << 3), // Indicates the head has been loaded (1973 only).
HeadLoad = (1 << 3), // Indicates the head has been loaded (1973 only).
Timer = (1 << 4), // Indicates that the delay_time_-powered timer has timed out.
IndexHoleTarget = (1 << 5) // Indicates that index_hole_count_ has reached index_hole_count_target_.