1
0
mirror of https://github.com/TomHarte/CLK.git synced 2026-04-21 17:16:44 +00:00

Start formalising/extracting 8272 status.

This commit is contained in:
Thomas Harte
2023-11-25 18:10:49 -05:00
parent 8c70317d31
commit 0bb048e24b
4 changed files with 71 additions and 5 deletions
+45
View File
@@ -0,0 +1,45 @@
//
// Status.hpp
// Clock Signal
//
// Created by Thomas Harte on 25/11/2023.
// Copyright © 2023 Thomas Harte. All rights reserved.
//
#ifndef Status_hpp
#define Status_hpp
namespace Intel::i8272 {
class Status {
public:
uint8_t main() const {
return main_status_;
}
void reset() {
main_status_ = DataReady;
status_[0] = status_[1] = status_[2] = 0;
}
private:
uint8_t main_status_;
uint8_t status_[3];
enum MainStatus: uint8_t {
FDD0Seeking = 0x01,
FDD1Seeking = 0x02,
FDD2Seeking = 0x04,
FDD3Seeking = 0x08,
ReadOrWriteOngoing = 0x10,
InNonDMAExecution = 0x20,
DataIsToProcessor = 0x40,
DataReady = 0x80,
};
};
}
#endif /* Status_hpp */
+1 -1
View File
@@ -276,7 +276,7 @@ void i8272::posit_event(int event_type) {
if(!command_.has_command()) {
goto wait_for_complete_command_sequence;
}
if(command_.has_geometry() == 9) {
if(command_.has_geometry()) {
cylinder_ = command_.geometry().cylinder;
head_ = command_.geometry().head;
sector_ = command_.geometry().sector;