mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-22 12:33:29 +00:00
Switches Jasmin drive selection logic.
This commit is contained in:
parent
aca41ac089
commit
4153442703
@ -43,11 +43,21 @@ void Jasmin::write(int address, uint8_t value) {
|
||||
select_paged_item();
|
||||
break;
|
||||
|
||||
case 0x3fc: case 0x3fd: case 0x3fe: case 0x3ff:
|
||||
get_drive().set_motor_on(false);
|
||||
set_drive(1 << (address - 0x3fc));
|
||||
get_drive().set_motor_on(motor_on_);
|
||||
break;
|
||||
case 0x3fc: case 0x3fd: case 0x3fe: case 0x3ff: {
|
||||
// Updated selected drives mask.
|
||||
const uint8_t mask = uint8_t(1 << (address - 0x3fc));
|
||||
selected_drives_ = (selected_drives_ & ~mask) | (mask * (value & 1));
|
||||
|
||||
// Select drive.
|
||||
set_drive(selected_drives_);
|
||||
|
||||
// Update motor inputs: apply the motor only to selected drives.
|
||||
// Which may or may not be correct.
|
||||
for_all_drives([mask, this] (Storage::Disk::Drive &drive, size_t index) {
|
||||
const uint8_t shift_mask = uint8_t(1 << index);
|
||||
drive.set_motor_on( (mask & shift_mask) ? motor_on_ : false );
|
||||
});
|
||||
} break;
|
||||
|
||||
default:
|
||||
return WD::WD1770::write(address, value);
|
||||
|
@ -26,6 +26,7 @@ class Jasmin: public DiskController {
|
||||
private:
|
||||
void set_motor_on(bool on) final;
|
||||
bool motor_on_ = false;
|
||||
uint8_t selected_drives_ = 0;
|
||||
|
||||
Activity::Observer *observer_ = nullptr;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user