From 0848fc7e03285252ac36ffd8c9c84797f096613c Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Tue, 28 May 2019 16:24:41 -0400 Subject: [PATCH] Ensures the Mac uses auto vectored interrupts. --- Machines/Apple/Macintosh/Macintosh.cpp | 11 ++++++++++- .../68000/Implementation/68000Implementation.hpp | 8 ++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/Machines/Apple/Macintosh/Macintosh.cpp b/Machines/Apple/Macintosh/Macintosh.cpp index 05cc704ef..d62d3bbef 100644 --- a/Machines/Apple/Macintosh/Macintosh.cpp +++ b/Machines/Apple/Macintosh/Macintosh.cpp @@ -176,10 +176,19 @@ class ConcreteMachine: if(!(operation & Microcycle::Read) || word_address >= 0x300000) operation = 0; } - switch(operation & (Microcycle::SelectWord | Microcycle::SelectByte | Microcycle::Read | Microcycle::InterruptAcknowledge)) { + const auto masked_operation = operation & (Microcycle::SelectWord | Microcycle::SelectByte | Microcycle::Read | Microcycle::InterruptAcknowledge); + switch(masked_operation) { default: break; + // Catches the deliberation set of operation to 0 above. + case 0: break; + + case Microcycle::InterruptAcknowledge | Microcycle::SelectByte: + // The Macintosh uses autovectored interrupts. + mc68000_.set_is_peripheral_address(true); + break; + case Microcycle::SelectWord | Microcycle::Read: cycle.value->full = memory_base[word_address]; break; diff --git a/Processors/68000/Implementation/68000Implementation.hpp b/Processors/68000/Implementation/68000Implementation.hpp index f4e48ae13..3bdd685b3 100644 --- a/Processors/68000/Implementation/68000Implementation.hpp +++ b/Processors/68000/Implementation/68000Implementation.hpp @@ -272,7 +272,7 @@ template void Proces } #ifdef LOG_TRACE -// should_log |= ((program_counter_.full - 4) == 0x4058d8); + should_log |= ((program_counter_.full - 4) == 0x4058d8); #endif if(instructions[decoded_instruction_.full].micro_operations) { @@ -1859,6 +1859,9 @@ template void Proces break; case int(MicroOp::Action::PrepareINTVector): + // Let bus error go back to causing exceptions. + is_starting_interrupt_ = false; + // Bus error => spurious interrupt. if(bus_error_) { effective_address_[0].full = 24 << 2; @@ -1873,9 +1876,6 @@ template void Proces // Otherwise, the vector is whatever we were just told it is. effective_address_[0].full = source_bus_data_[0].halves.low.halves.low << 2; - - // Let bus error go back to causing exceptions. - is_starting_interrupt_ = false; break; case int(MicroOp::Action::CopyNextWord):