1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-05 10:28:58 +00:00

Trust the HRM on step bit, but catch rising edge.

This commit is contained in:
Thomas Harte 2021-10-11 07:42:42 -07:00
parent 7733fef3bd
commit 39b8285ba5

View File

@ -1130,7 +1130,7 @@ void Chipset::DiskController::set_mtr_sel_side_dir_step(uint8_t value) {
// b0: /STEP
// Select active drive.
set_drive(((value >> 3) & 0xf) ^ 0xf);
set_drive(((value >> 3) & 0x0f) ^ 0x0f);
// "[The MTR] signal is nonstandard on the Amiga system.
// Each drive will latch the motor signal at the time its
@ -1141,9 +1141,9 @@ void Chipset::DiskController::set_mtr_sel_side_dir_step(uint8_t value) {
// Check for changes in the SEL line per drive.
const bool motor_on = !(value & 0x80);
const int side = (value & 0x04) ? 0 : 1;
const bool did_step = (difference & 0x1) && !(value & 0x1);
const bool did_step = difference & value & 0x01;
const auto direction = Storage::Disk::HeadPosition(
(value & 0x02) ? 1 : -1
(value & 0x02) ? -1 : 1
);
for(int c = 0; c < 4; c++) {
@ -1181,7 +1181,7 @@ void Chipset::DiskController::set_mtr_sel_side_dir_step(uint8_t value) {
// Possibly step.
if(did_step && is_selected) {
LOG("Stepped drive " << +c << " by " << direction.as_int());
LOG("Stepped drive " << +c << " by " << +direction.as_int());
drive.step(direction);
}
}