fox32: Allow disks to be removed

This commit is contained in:
Ry 2022-04-17 14:28:41 -07:00
parent 7f796dd989
commit 83a5d14775

View File

@ -162,7 +162,7 @@ impl Bus {
_ => panic!("invalid mouse control port"),
}
}
0x80001000..=0x80004003 => { // disk controller port
0x80001000..=0x80005003 => { // disk controller port
let id = port as u8;
let operation = (port & 0x0000F000) >> 8;
@ -198,6 +198,13 @@ impl Bus {
self.disk_controller.set_current_sector(id, word);
self.disk_controller.write_from_memory(id, self.memory.ram());
}
0x50 => {
// we're requesting a disk to be removed from the specified disk id
if id > 3 {
panic!("invalid disk ID");
}
self.disk_controller.remove(id);
}
_ => panic!("invalid disk controller port"),
}
}