diff --git a/bus.cpp b/bus.cpp index 3e57e89..f8d53db 100644 --- a/bus.cpp +++ b/bus.cpp @@ -182,9 +182,13 @@ uint16_t bus::read(const uint16_t a, const bool word_mode, const bool use_prev, return 128; } - if (a == ADDR_PIR) { // PIR + if (a == ADDR_PIR || a == ADDR_PIR + 1) { // PIR if (!peek_only) DOLOG(debug, false, "read PIR"); - return PIR; + + if (word_mode == false) + return PIR; + + return a == ADDR_PIR ? PIR & 255 : PIR >> 8; } if (a == ADDR_SYSTEM_ID) {