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

Fixed: the issue was failing to propagate motor control.

Also it seems to be incorrect to have the Jasmin paged at initial boot.
This commit is contained in:
Thomas Harte 2020-01-05 21:35:20 -05:00
parent 533729638c
commit 7361e7ec34
3 changed files with 14 additions and 5 deletions

View File

@ -55,8 +55,7 @@ void Jasmin::write(int address, uint8_t value) {
if(drives_[selected_drive_]) drives_[selected_drive_]->set_motor_on(false);
selected_drive_ = new_selected_drive;
set_drive(drives_[selected_drive_]);
// TODO: establish motor status for new drive.
if(drives_[selected_drive_]) drives_[selected_drive_]->set_motor_on(motor_on_);
}
} break;
@ -64,3 +63,8 @@ void Jasmin::write(int address, uint8_t value) {
return WD::WD1770::write(address, value);
}
}
void Jasmin::set_motor_on(bool on) {
motor_on_ = on;
if(drives_[selected_drive_]) drives_[selected_drive_]->set_motor_on(motor_on_);
}

View File

@ -41,7 +41,7 @@ class Jasmin: public WD::WD1770 {
private:
std::array<std::shared_ptr<Storage::Disk::Drive>, 4> drives_;
size_t selected_drive_;
int paging_flags_ = BASICDisable;
int paging_flags_ = 0;
Delegate *delegate_ = nullptr;
void posit_paging_flags(int new_flags) {
@ -50,6 +50,9 @@ class Jasmin: public WD::WD1770 {
if(delegate_) delegate_->jasmin_did_change_paging_flags(this);
}
}
void set_motor_on(bool on) final;
bool motor_on_ = false;
};
};

View File

@ -477,7 +477,8 @@ template <Analyser::Static::Oric::Target::DiskInterface disk_interface> class Co
jasmin_.run_for(Cycles(8));
// Jasmin autostart hack: wait for a period, then trigger a reset, having forced
// the Jasmin to page its ROM in first.
// the Jasmin to page its ROM in first. I assume the latter being what the Jasmin's
// hardware boot button did.
if(jasmin_reset_counter_) {
--jasmin_reset_counter_;
if(!jasmin_reset_counter_) {
@ -680,7 +681,8 @@ template <Analyser::Static::Oric::Target::DiskInterface disk_interface> class Co
// the Jasmin, if in use.
Jasmin jasmin_;
int jasmin_reset_counter_ = 6000000; // i.e. 8 seconds.
int jasmin_reset_counter_ = 3000000; // i.e. 3 seconds; empirically long enough for the Oric to boot normally,
// before the Jasmin intercedes.
// the Pravetz/Disk II, if in use.
Apple::DiskII diskii_;