1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-27 16:31:31 +00:00

Added enough stuff that SSDs attached to a 1770 will now reach the entry point for writing.

This commit is contained in:
Thomas Harte 2016-12-25 09:46:12 -05:00
parent e56beb3e9c
commit 901f19f89c
5 changed files with 14 additions and 1 deletions

View File

@ -498,7 +498,7 @@ void WD1770::posit_event(Event new_event_type)
WAIT_FOR_TIME(30);
test_type2_write_protection:
if(command_&0x20) // TODO:: && is_write_protected
if(command_&0x20 && get_drive_is_read_only())
{
update_status([] (Status &status) {
status.write_protect = true;

View File

@ -181,6 +181,12 @@ bool Controller::get_drive_is_ready()
return drive_->has_disk();
}
bool Controller::get_drive_is_read_only()
{
if(!drive_) return false;
return drive_->get_is_read_only();
}
void Controller::step(int direction)
{
if(drive_) drive_->step(direction);

View File

@ -99,6 +99,7 @@ class Controller: public DigitalPhaseLockedLoop::Delegate, public TimedEventLoop
bool get_is_track_zero();
void step(int direction);
virtual bool get_drive_is_ready();
bool get_drive_is_read_only();
private:
Time bit_length_;

View File

@ -40,6 +40,11 @@ unsigned int SSD::get_head_count()
return head_count_;
}
bool SSD::get_is_read_only()
{
return false;
}
std::shared_ptr<Track> SSD::get_uncached_track_at_position(unsigned int head, unsigned int position)
{
std::shared_ptr<Track> track;

View File

@ -35,6 +35,7 @@ class SSD: public Disk, public Storage::FileHolder {
// implemented to satisfy @c Disk
unsigned int get_head_position_count();
unsigned int get_head_count();
bool get_is_read_only();
private:
std::shared_ptr<Track> get_uncached_track_at_position(unsigned int head, unsigned int position);