mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-26 23:52:26 +00:00
Removed formal storage of ST3, as it just seems to be composed live. This may turn out also to be the best way to deal with ST0–2, time will tell. Also took a stab at the error in responding properly to the ROM's intended use of seek might be accepting new commands as replacements for old ones rather than rejecting them. That didn't seem to do the trick.
This commit is contained in:
parent
d63893a437
commit
3853966a1e
@ -29,7 +29,7 @@ i8272::i8272(Cycles clock_rate, int clock_rate_multiplier, int revolutions_per_m
|
|||||||
interesting_event_mask_((int)Event8272::CommandByte),
|
interesting_event_mask_((int)Event8272::CommandByte),
|
||||||
resume_point_(0),
|
resume_point_(0),
|
||||||
delay_time_(0),
|
delay_time_(0),
|
||||||
status_{0, 0, 0, 0} {
|
status_{0, 0, 0} {
|
||||||
posit_event((int)Event8272::CommandByte);
|
posit_event((int)Event8272::CommandByte);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -91,7 +91,7 @@ uint8_t i8272::get_register(int address) {
|
|||||||
|
|
||||||
return result;
|
return result;
|
||||||
} else {
|
} else {
|
||||||
// printf("8272 get main status\n");
|
// printf("Main status: %02x\n", main_status_);
|
||||||
return main_status_;
|
return main_status_;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -150,6 +150,7 @@ void i8272::posit_event(int event_type) {
|
|||||||
wait_for_complete_command_sequence:
|
wait_for_complete_command_sequence:
|
||||||
main_status_ |= StatusRQM;
|
main_status_ |= StatusRQM;
|
||||||
WAIT_FOR_EVENT(Event8272::CommandByte)
|
WAIT_FOR_EVENT(Event8272::CommandByte)
|
||||||
|
// printf(".");
|
||||||
main_status_ |= StatusCB;
|
main_status_ |= StatusCB;
|
||||||
main_status_ &= ~StatusRQM;
|
main_status_ &= ~StatusRQM;
|
||||||
|
|
||||||
@ -325,12 +326,14 @@ void i8272::posit_event(int event_type) {
|
|||||||
recalibrate:
|
recalibrate:
|
||||||
seek:
|
seek:
|
||||||
printf((command_.size() > 2) ? "Seek\n" : "Recalibrate\n");
|
printf((command_.size() > 2) ? "Seek\n" : "Recalibrate\n");
|
||||||
|
if(drives_[command_[1]&3].phase != Drive::Seeking) {
|
||||||
status_[0] = status_[1] = status_[2] = 0;
|
status_[0] = status_[1] = status_[2] = 0;
|
||||||
drives_[command_[1]&3].phase = Drive::Seeking;
|
drives_[command_[1]&3].phase = Drive::Seeking;
|
||||||
drives_[command_[1]&3].steps_taken = 0;
|
drives_[command_[1]&3].steps_taken = 0;
|
||||||
drives_[command_[1]&3].target_head_position = (command_.size() > 2) ? command_[2] : -1;
|
drives_[command_[1]&3].target_head_position = (command_.size() > 2) ? command_[2] : -1;
|
||||||
drives_[command_[1]&3].step_rate_counter = 0;
|
drives_[command_[1]&3].step_rate_counter = 0;
|
||||||
main_status_ |= 1 << (command_[1]&3);
|
main_status_ |= 1 << (command_[1]&3);
|
||||||
|
}
|
||||||
goto wait_for_command;
|
goto wait_for_command;
|
||||||
|
|
||||||
sense_interrupt_status:
|
sense_interrupt_status:
|
||||||
@ -367,8 +370,8 @@ void i8272::posit_event(int event_type) {
|
|||||||
goto wait_for_command;
|
goto wait_for_command;
|
||||||
|
|
||||||
sense_drive_status:
|
sense_drive_status:
|
||||||
printf("Sense drive status\n");
|
printf("Sense drive status unimplemented!!\n");
|
||||||
result_stack_.push_back(status_[3]);
|
// result_stack_.push_back(status_[3]);
|
||||||
goto post_result;
|
goto post_result;
|
||||||
|
|
||||||
invalid:
|
invalid:
|
||||||
|
@ -31,7 +31,7 @@ class i8272: public Storage::Disk::MFMController {
|
|||||||
private:
|
private:
|
||||||
void posit_event(int type);
|
void posit_event(int type);
|
||||||
uint8_t main_status_;
|
uint8_t main_status_;
|
||||||
uint8_t status_[4];
|
uint8_t status_[3];
|
||||||
|
|
||||||
std::vector<uint8_t> command_;
|
std::vector<uint8_t> command_;
|
||||||
std::vector<uint8_t> result_stack_;
|
std::vector<uint8_t> result_stack_;
|
||||||
|
Loading…
Reference in New Issue
Block a user