From bc27e3998d70fa13acfcf99ac82f6a73bf331400 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Thu, 14 Mar 2024 21:09:51 -0400 Subject: [PATCH] Fix downward block data transfers. --- InstructionSets/ARM/Executor.hpp | 6 +++++- Machines/Acorn/Archimedes/Archimedes.cpp | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/InstructionSets/ARM/Executor.hpp b/InstructionSets/ARM/Executor.hpp index eb5159d30..95d713ee6 100644 --- a/InstructionSets/ARM/Executor.hpp +++ b/InstructionSets/ARM/Executor.hpp @@ -380,7 +380,11 @@ struct Executor { uint32_t final_address; if constexpr (!flags.add_offset()) { - final_address = address + total * 4; + // Decrementing mode; final_address is the value the base register should + // have after this operation if writeback is enabled, so it's below + // the original address. But also writes always occur from lowest address + // to highest, so push the current address to the bottom. + final_address = address - total * 4; address = final_address; } else { final_address = address + total * 4; diff --git a/Machines/Acorn/Archimedes/Archimedes.cpp b/Machines/Acorn/Archimedes/Archimedes.cpp index cd183a5c0..63dbd764d 100644 --- a/Machines/Acorn/Archimedes/Archimedes.cpp +++ b/Machines/Acorn/Archimedes/Archimedes.cpp @@ -261,7 +261,7 @@ struct Interrupts { // IRQ A. case 0x3200010 & AddressMask: value = irq_a_.status; - logger.error().append("IRQ A status is %02x", value); +// logger.error().append("IRQ A status is %02x", value); return true; case 0x3200014 & AddressMask: value = irq_a_.request(); @@ -275,7 +275,7 @@ struct Interrupts { // IRQ B. case 0x3200020 & AddressMask: value = irq_b_.status; - logger.error().append("IRQ B status is %02x", value); +// logger.error().append("IRQ B status is %02x", value); return true; case 0x3200024 & AddressMask: value = irq_b_.request(); @@ -905,7 +905,7 @@ class ConcreteMachine: static bool log = false; -// if(executor_.pc() == 0x0380214c) { +// if(executor_.pc() == 0x03810398) { // printf(""); // } // log |= (executor_.pc() > 0x02000000 && executor_.pc() < 0x02000078);