From 37a55c3a771cf8a47518a9ae3ec920f909625f88 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Wed, 28 Jul 2021 19:26:02 -0400 Subject: [PATCH] Corrects 6526 interrupt control write. This seems to imply that the 6526 should be interrupting too. --- Components/6526/Implementation/6526Implementation.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Components/6526/Implementation/6526Implementation.hpp b/Components/6526/Implementation/6526Implementation.hpp index b88e7351a..11b2e0a04 100644 --- a/Components/6526/Implementation/6526Implementation.hpp +++ b/Components/6526/Implementation/6526Implementation.hpp @@ -126,7 +126,7 @@ void MOS6526::write(int address, uint8_t value) { // Interrupt control. case 13: { - if(interrupt_control_ & 0x80) { + if(value & 0x80) { interrupt_control_ |= value & 0x7f; } else { interrupt_control_ &= ~(value & 0x7f); @@ -233,6 +233,7 @@ template void MOS6526::run_for(const HalfCycles half_cycles) { half_divider_ += half_cycles; const int sub = half_divider_.divide_cycles().template as(); + if(!sub) return; // Is counter A running and linked to the clock input? int counter_a_underflows = 0;