From 0d639fc65a54418e5acecdd063a27f1726094114 Mon Sep 17 00:00:00 2001 From: folkert van heusden Date: Fri, 24 Mar 2023 13:56:53 +0100 Subject: [PATCH] PIR register --- bus.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/bus.cpp b/bus.cpp index 23f7bc0..8ad3be3 100644 --- a/bus.cpp +++ b/bus.cpp @@ -788,7 +788,17 @@ void bus::write(const uint16_t a, const bool word_mode, uint16_t value, const bo if (a == ADDR_PIR) { // PIR DOLOG(debug, true, "write set PIR: %o", value); - PIR = value; // TODO + + value &= 0177000; + + int bits = value >> 9; + + while(bits) { + value += 042; // bit 1...3 and 5...7 + bits >>= 1; + } + + PIR = value; return; }