1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-02-20 14:29:11 +00:00

Code to GlaBIOS expectations.

This commit is contained in:
Thomas Harte 2023-11-28 23:18:22 -05:00
parent 301442a0b1
commit 3827a084ad
3 changed files with 7 additions and 21 deletions

View File

@ -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) {

View File

@ -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]};

View File

@ -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 {