From 07ff5138b7083607152a0ea32467972365b1444b Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sat, 24 Sep 2016 22:35:34 -0400 Subject: [PATCH] The catalogue now loads. --- Components/1770/1770.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Components/1770/1770.cpp b/Components/1770/1770.cpp index 618f71317..d54e45fa6 100644 --- a/Components/1770/1770.cpp +++ b/Components/1770/1770.cpp @@ -531,6 +531,18 @@ void WD1770::posit_event(Event new_event_type) status_ |= Flag::DataRequest; distance_into_section_++; if(distance_into_section_ == 128 << header[3]) + { + distance_into_section_ = 0; + goto type2_check_crc; + } + goto type2_read_byte; + + type2_check_crc: + WAIT_FOR_EVENT(Event::Token); + if(latest_token_.type != Token::Byte) goto type2_read_byte; + header[distance_into_section_] = latest_token_.byte_value; + distance_into_section_++; + if(distance_into_section_ == 2) { // TODO: check CRC if(command_ & 0x10) @@ -541,7 +553,8 @@ void WD1770::posit_event(Event new_event_type) set_interrupt_request(true); goto wait_for_command; } - goto type2_read_byte; + goto type2_check_crc; + type2_write_data: printf("!!!TODO: data portion of sector!!!\n");