From 3827a084ad85911b9609f95263ab0aa49c10d692 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Tue, 28 Nov 2023 23:18:22 -0500 Subject: [PATCH] Code to GlaBIOS expectations. --- Components/8272/Status.hpp | 5 ----- Components/8272/i8272.cpp | 2 +- Machines/PCCompatible/PCCompatible.cpp | 21 ++++++--------------- 3 files changed, 7 insertions(+), 21 deletions(-) diff --git a/Components/8272/Status.hpp b/Components/8272/Status.hpp index cc2f249b0..0a42d95ad 100644 --- a/Components/8272/Status.hpp +++ b/Components/8272/Status.hpp @@ -114,11 +114,6 @@ class Status { } } - void end_sense_interrupt_status(int drive, int head) { - status_[0] = uint8_t(drive | (head << 2)); - main_status_ &= ~(1 << drive); - } - private: void set(uint8_t flag, bool value, uint8_t &target) { if(value) { diff --git a/Components/8272/i8272.cpp b/Components/8272/i8272.cpp index 97963fa37..638034e75 100644 --- a/Components/8272/i8272.cpp +++ b/Components/8272/i8272.cpp @@ -708,7 +708,7 @@ void i8272::posit_event(int event_type) { // If a drive was found, return its results. Otherwise return a single 0x80. if(found_drive != -1) { drives_[found_drive].phase = Drive::NotSeeking; - status_.end_sense_interrupt_status(found_drive, 0); +// status_.end_sense_interrupt_status(found_drive, 0); status_.set(Status0::SeekEnded); result_stack_ = { drives_[found_drive].head_position, status_[0]}; diff --git a/Machines/PCCompatible/PCCompatible.cpp b/Machines/PCCompatible/PCCompatible.cpp index e35357479..fec083f72 100644 --- a/Machines/PCCompatible/PCCompatible.cpp +++ b/Machines/PCCompatible/PCCompatible.cpp @@ -92,19 +92,7 @@ class FloppyController { case Command::SenseInterruptStatus: printf("FDC: SenseInterruptStatus\n"); pic_.apply_edge<6>(false); - - if(interrupting_drives_) { - int drive = 3; - while(!(interrupting_drives_ & (1 << drive))) { - --drive; - } - interrupting_drives_ &= ~(1 << drive); - - status_.end_sense_interrupt_status(drive, 0); - results_.serialise(status_, 10); - } else { - results_.serialise_none(); - } + results_.serialise(status_, 0); // TODO: get track of relevant drive. break; } @@ -146,7 +134,11 @@ class FloppyController { decoder_.clear(); status_.reset(); pic_.apply_edge<6>(true); - interrupting_drives_ = 0xf; + + // Necessary to pass GlaBIOS [if this is called after reset?], but Why? + // + // Cf. INT_13_0_2 and the CMP AL, 11000000B following a CALL FDC_WAIT_SENSE. + status_.set(Intel::i8272::Status0::BecameNotReady); using MainStatus = Intel::i8272::MainStatus; status_.set(MainStatus::DataReady, true); @@ -162,7 +154,6 @@ class FloppyController { Intel::i8272::CommandDecoder decoder_; Intel::i8272::Status status_; Intel::i8272::Results results_; - int interrupting_drives_ = 0; }; class KeyboardController {