1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-27 01:31:42 +00:00

Reaching the end of the usable part of my day, decided to tidy up a little before bed with indentation that reflects a distinction between top-level entry points and mere loops.

This commit is contained in:
Thomas Harte 2017-08-06 22:14:18 -04:00
parent 3853966a1e
commit 73f8488150

View File

@ -150,7 +150,6 @@ void i8272::posit_event(int event_type) {
wait_for_complete_command_sequence:
main_status_ |= StatusRQM;
WAIT_FOR_EVENT(Event8272::CommandByte)
// printf(".");
main_status_ |= StatusCB;
main_status_ &= ~StatusRQM;
@ -231,10 +230,8 @@ void i8272::posit_event(int event_type) {
FIND_HEADER();
if(!index_hole_limit_) goto read_data_not_found;
READ_HEADER();
// printf("Comparing with %02x\n", header_[2]);
if(header_[0] != cylinder_ || header_[1] != head_ || header_[2] != sector_ || header_[3] != size_) goto find_next_sector;
FIND_DATA();
distance_into_section_ = 0;
set_data_mode(Reading);
@ -249,14 +246,14 @@ void i8272::posit_event(int event_type) {
if(distance_into_section_ < (128 << size_)) goto get_byte;
set_data_mode(Scanning);
goto return_st012chrn;
goto post_st012chrn;
read_data_not_found:
printf("Not found\n");
status_[1] |= 0x4;
status_[0] = 0x40; // (status_[0] & ~0xc0) |
goto return_st012chrn;
goto post_st012chrn;
read_deleted_data:
printf("Read deleted data unimplemented!!\n");
@ -289,23 +286,13 @@ void i8272::posit_event(int event_type) {
sector_ = header_[2];
size_ = header_[3];
goto return_st012chrn;
goto post_st012chrn;
read_id_not_found:
status_[1] |= 0x4;
status_[0] = 0x40; // (status_[0] & ~0xc0) |
status_[0] = 0x40;
return_st012chrn:
result_stack_.push_back(size_);
result_stack_.push_back(sector_);
result_stack_.push_back(head_);
result_stack_.push_back(cylinder_);
result_stack_.push_back(status_[2]);
result_stack_.push_back(status_[1]);
result_stack_.push_back(status_[0]);
goto post_result;
goto post_st012chrn;
format_track:
printf("Fromat track unimplemented!!\n");
@ -362,7 +349,6 @@ void i8272::posit_event(int event_type) {
goto post_result;
specify:
printf("Specify\n");
step_rate_time_ = command_[1] &0xf0; // i.e. 16 to 240m
head_unload_time_ = command_[1] & 0x0f; // i.e. 1 to 16ms
head_load_time_ = command_[2] & ~1; // i.e. 2 to 254 ms in increments of 2ms
@ -371,13 +357,24 @@ void i8272::posit_event(int event_type) {
sense_drive_status:
printf("Sense drive status unimplemented!!\n");
// result_stack_.push_back(status_[3]);
goto post_result;
goto wait_for_command;
invalid:
// A no-op, causing the FDC to go back into standby mode.
goto wait_for_command;
post_st012chrn:
result_stack_.push_back(size_);
result_stack_.push_back(sector_);
result_stack_.push_back(head_);
result_stack_.push_back(cylinder_);
result_stack_.push_back(status_[2]);
result_stack_.push_back(status_[1]);
result_stack_.push_back(status_[0]);
goto post_result;
post_result:
// Set ready to send data to the processor, no longer in non-DMA execution phase.
main_status_ |= StatusRQM | StatusDIO;