From 83a5d147759e229d6e71aec5883f5ad07c986b74 Mon Sep 17 00:00:00 2001 From: Ry Date: Sun, 17 Apr 2022 14:28:41 -0700 Subject: [PATCH] fox32: Allow disks to be removed --- src/bus.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/bus.rs b/src/bus.rs index a5fb63c..8928672 100644 --- a/src/bus.rs +++ b/src/bus.rs @@ -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,10 +198,17 @@ 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"), } } _ => return, } } -} \ No newline at end of file +}