1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-06 01:28:57 +00:00

Entrusted further status to drives; also adjusted them to report read only if diskless, which I now believe to be correct.

This commit is contained in:
Thomas Harte 2017-08-13 11:50:49 -04:00
parent 6d2e969e7d
commit eec42aa7ae
3 changed files with 4 additions and 5 deletions

View File

@ -532,8 +532,8 @@ void i8272::posit_event(int event_type) {
(command_[1] & 7) | // drive and head number
0x08 | // single sided
(drives_[drive].drive->get_is_track_zero() ? 0x10 : 0x00) |
(drives_[drive].drive->has_disk() ? 0x20 : 0x00) | // ready, approximately (TODO)
0x40 // write protected
(drives_[drive].drive->get_is_ready() ? 0x20 : 0x00) |
(drives_[drive].drive->get_is_read_only() ? 0x40 : 0x00)
);
}
goto post_result;

View File

@ -42,8 +42,7 @@ void Drive::set_head(unsigned int head) {
bool Drive::get_is_read_only() {
if(disk_) return disk_->get_is_read_only();
if(track_) return true;
return false;
return true;
}
bool Drive::get_is_ready() {

View File

@ -51,7 +51,7 @@ class Drive {
void set_head(unsigned int head);
/*!
@returns @c true if the inserted disk is read-only; @c false otherwise.
@returns @c true if the inserted disk is read-only or no disk is inserted; @c false otherwise.
*/
bool get_is_read_only();