From d25b48878c95967886c73611e2c7ac197c07d17f Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sun, 22 Dec 2019 17:58:33 -0500 Subject: [PATCH] Cleans up READ_ID macro, inter alia. --- Components/1770/1770.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Components/1770/1770.cpp b/Components/1770/1770.cpp index 081cf3956..9b320645e 100644 --- a/Components/1770/1770.cpp +++ b/Components/1770/1770.cpp @@ -91,6 +91,7 @@ uint8_t WD1770::get_register(int address) { if(status_.type == Status::One) status |= (status_.spin_up ? Flag::SpinUp : 0); } +// LOG("Returned status " << PADHEX(2) << int(status) << " of type " << 1+int(status_.type)); return status; } case 1: return track_; @@ -124,11 +125,13 @@ void WD1770::run_for(const Cycles cycles) { #define END_SECTION() (void)0; } #define READ_ID() \ - if(new_event_type == static_cast(Event::Token)) { \ - if(!distance_into_section_ && get_latest_token().type == Token::ID) {set_data_mode(DataMode::Reading); distance_into_section_++; } \ - else if(distance_into_section_ && distance_into_section_ < 7 && get_latest_token().type == Token::Byte) { \ + if(new_event_type == int(Event::Token)) { \ + if(!distance_into_section_ && get_latest_token().type == Token::ID) {\ + set_data_mode(DataMode::Reading); \ + ++distance_into_section_; \ + } else if(distance_into_section_ && distance_into_section_ < 7 && get_latest_token().type == Token::Byte) { \ header_[distance_into_section_ - 1] = get_latest_token().byte_value; \ - distance_into_section_++; \ + ++distance_into_section_; \ } \ }