From 1c1d2891c77023cb6cc05e586d204892925a7175 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Fri, 15 Mar 2024 21:59:38 -0400 Subject: [PATCH] Adjust IRQ/FIQ return addresses. --- InstructionSets/ARM/Registers.hpp | 5 ++--- Machines/Acorn/Archimedes/Archimedes.cpp | 8 +++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/InstructionSets/ARM/Registers.hpp b/InstructionSets/ARM/Registers.hpp index 8d579601c..793100783 100644 --- a/InstructionSets/ARM/Registers.hpp +++ b/InstructionSets/ARM/Registers.hpp @@ -149,12 +149,12 @@ struct Registers { void exception() { switch(type) { case Exception::IRQ: { - const auto r14 = pc_status(8); + const auto r14 = pc_status(0); set_mode(Mode::IRQ); active_[14] = r14; } break; case Exception::FIQ: { - const auto r14 = pc_status(8); + const auto r14 = pc_status(0); set_mode(Mode::FIQ); active_[14] = r14; } break; @@ -169,7 +169,6 @@ struct Registers { if constexpr (type == Exception::Reset || type == Exception::FIQ) { interrupt_flags_ |= ConditionCode::FIQDisable; } - set_pc(uint32_t(type)); } diff --git a/Machines/Acorn/Archimedes/Archimedes.cpp b/Machines/Acorn/Archimedes/Archimedes.cpp index e4bc5d613..4c683f61e 100644 --- a/Machines/Acorn/Archimedes/Archimedes.cpp +++ b/Machines/Acorn/Archimedes/Archimedes.cpp @@ -160,7 +160,13 @@ struct Keyboard { serial_.output(KeyboardParty, input); break; - default: break; + case RQID: + serial_.output(KeyboardParty, 0x81); // TODO: what keyboard type? + break; + + default: + printf("Keyboard declines to respond to %02x\n", input); + break; } } }