mirror of
https://github.com/86Box/86Box.git
synced 2026-02-21 09:05:32 -07:00
Fixed second drive motor keeps running when first drive is only accessed.
This commit is contained in:
@@ -854,11 +854,16 @@ fdc_write(uint16_t addr, uint8_t val, void *priv)
|
||||
fdc_soft_reset(fdc);
|
||||
/* We can now simplify this since each motor now spins separately. */
|
||||
for (int i = 0; i < FDD_NUM; i++) {
|
||||
drive_num = real_drive(fdc, i);
|
||||
if ((!fdd_get_flags(drive_num)) || (drive_num >= FDD_NUM))
|
||||
val &= ~(0x10 << drive_num);
|
||||
else
|
||||
fdd_set_motor_enable(i, (val & (0x10 << drive_num)));
|
||||
int phys = real_drive(fdc, i);
|
||||
if (phys >= FDD_NUM || !fdd_get_flags(phys)) {
|
||||
/* Clear the logical motor bit for a non‑present drive */
|
||||
val &= ~(0x10 << i);
|
||||
fdd_set_motor_enable(phys, 0);
|
||||
continue;
|
||||
}
|
||||
/* Motor bit positions are tied to logical index i (bits 4..7) */
|
||||
int on = (val & (0x10 << i)) ? 1 : 0;
|
||||
fdd_set_motor_enable(phys, on);
|
||||
}
|
||||
drive_num = real_drive(fdc, val & 0x03);
|
||||
current_drive = drive_num;
|
||||
|
||||
Reference in New Issue
Block a user