mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-11 08:30:55 +00:00
Merge pull request #1239 from ryandesign/sense-write-protect
Fix Disk II sense-write-protect clocking preference
This commit is contained in:
commit
790e744bde
@ -149,7 +149,7 @@ void DiskII::decide_clocking_preference() {
|
|||||||
// none, given that drives are not running, the shift register has already emptied or stopped and there's no flux about to be received.
|
// none, given that drives are not running, the shift register has already emptied or stopped and there's no flux about to be received.
|
||||||
if(!(inputs_ & ~input_flux)) {
|
if(!(inputs_ & ~input_flux)) {
|
||||||
const bool is_stuck_at_nop =
|
const bool is_stuck_at_nop =
|
||||||
!flux_duration_ && state_machine_[(state_ & 0xf0) | inputs_ | ((shift_register_&0x80) >> 6)] == state_ && (state_ &0xf) == 0x8;
|
!flux_duration_ && state_machine_[(state_ & 0xf0) | inputs_ | ((shift_register_ & 0x80) >> 6)] == state_ && ((state_ & 0xf) == 0x8 || (state_ & 0xf) == 0xc);
|
||||||
|
|
||||||
clocking_preference_ =
|
clocking_preference_ =
|
||||||
(drive_is_sleeping_[0] && drive_is_sleeping_[1] && (!shift_register_ || is_stuck_at_nop) && (inputs_&input_flux))
|
(drive_is_sleeping_[0] && drive_is_sleeping_[1] && (!shift_register_ || is_stuck_at_nop) && (inputs_&input_flux))
|
||||||
@ -164,7 +164,7 @@ void DiskII::decide_clocking_preference() {
|
|||||||
// If in sense-write-protect mode, clocking is just-in-time if the shift register hasn't yet filled with the value that
|
// If in sense-write-protect mode, clocking is just-in-time if the shift register hasn't yet filled with the value that
|
||||||
// corresponds to the current write protect status. Otherwise it is none.
|
// corresponds to the current write protect status. Otherwise it is none.
|
||||||
if((inputs_ & ~input_flux) == input_command) {
|
if((inputs_ & ~input_flux) == input_command) {
|
||||||
clocking_preference_ = (shift_register_ == (is_write_protected() ? 0xff : 0x00)) ? ClockingHint::Preference::None : ClockingHint::Preference::JustInTime;
|
clocking_preference_ = ((shift_register_ == (is_write_protected() ? 0xff : 0x00)) && ((state_ & 0xf) == 0xa || (state_ & 0xf) == 0xe)) ? ClockingHint::Preference::None : ClockingHint::Preference::JustInTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Announce a change if there was one.
|
// Announce a change if there was one.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user