From 18035bcaed91658a44fe495a72095178e040478f Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Tue, 26 May 2026 15:10:11 -0400 Subject: [PATCH 1/3] Add `const`s. --- Processors/68000/68000.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Processors/68000/68000.hpp b/Processors/68000/68000.hpp index b0f5f8231..72c284b46 100644 --- a/Processors/68000/68000.hpp +++ b/Processors/68000/68000.hpp @@ -463,22 +463,22 @@ public: // TODO: bus ack/grant, halt, /// Sets the DTack line — @c true for active, @c false for inactive. - inline void set_dtack(bool dtack) { + inline void set_dtack(const bool dtack) { dtack_ = dtack; } /// Sets the VPA (valid peripheral address) line — @c true for active, @c false for inactive. - inline void set_is_peripheral_address(bool is_peripheral_address) { + inline void set_is_peripheral_address(const bool is_peripheral_address) { vpa_ = is_peripheral_address; } /// Sets the bus error line — @c true for active, @c false for inactive. - inline void set_bus_error(bool bus_error) { + inline void set_bus_error(const bool bus_error) { berr_ = bus_error; } /// Sets the interrupt lines, IPL0, IPL1 and IPL2. - inline void set_interrupt_level(int interrupt_level) { + inline void set_interrupt_level(const int interrupt_level) { bus_interrupt_level_ = interrupt_level; } @@ -488,7 +488,7 @@ public: /// /// This is guaranteed to be 0 at initial 68000 construction. It is not guaranteed /// to return the correct result if called during a bus transaction. - HalfCycles get_e_clock_phase() { + HalfCycles get_e_clock_phase() const { return e_clock_phase_; } From 26365249b3cdf1c674ed06c96f4e512fe810fb73 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Tue, 26 May 2026 15:10:36 -0400 Subject: [PATCH 2/3] Add soft reset as IRQ 7. --- Machines/Apple/Macintosh/Macintosh.cpp | 36 +++++++++++++++++++------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/Machines/Apple/Macintosh/Macintosh.cpp b/Machines/Apple/Macintosh/Macintosh.cpp index 300bbb8ff..8b1bb600b 100644 --- a/Machines/Apple/Macintosh/Macintosh.cpp +++ b/Machines/Apple/Macintosh/Macintosh.cpp @@ -66,19 +66,22 @@ namespace Apple { namespace Macintosh { template class ConcreteMachine: + public Activity::Source, + public ClockingHint::Observer, + public Configurable::Device, + public CPU::MC68000::BusHandler, + public DriveSpeedAccumulator::Delegate, public Machine, - public MachineTypes::TimedMachine, - public MachineTypes::ScanProducer, public MachineTypes::AudioProducer, +// public MachineTypes::HardResettable, // TODO: my 68000 doesn't actually implement the reset line yet. + public MachineTypes::MappedKeyboardMachine, public MachineTypes::MediaTarget, public MachineTypes::MouseMachine, - public MachineTypes::MappedKeyboardMachine, - public CPU::MC68000::BusHandler, - public Zilog::SCC::z8530::Delegate, - public Activity::Source, - public Configurable::Device, - public DriveSpeedAccumulator::Delegate, - public ClockingHint::Observer { + public MachineTypes::ScanProducer, + public MachineTypes::SoftResettable, + public MachineTypes::TimedMachine, + public Zilog::SCC::z8530::Delegate +{ public: using Target = Analyser::Static::Macintosh::Target; @@ -189,6 +192,16 @@ public: void run_for(const Cycles cycles) final { mc68000_.run_for(cycles); + + if(soft_reset_) { + soft_reset_ = false; + update_interrupt_input(); + } + } + + void soft_reset() final { + soft_reset_ = true; + update_interrupt_input(); } template HalfCycles perform_bus_operation(const Microcycle &cycle, int) { @@ -485,7 +498,9 @@ public: void update_interrupt_input() { // Update interrupt input. // TODO: does this really cascade like this? - if(scc_.get_interrupt_line()) { + if(soft_reset_) { + mc68000_.set_interrupt_level(7); + } else if(scc_.get_interrupt_line()) { mc68000_.set_interrupt_level(2); } else if(via_.get_interrupt_line()) { mc68000_.set_interrupt_level(1); @@ -770,6 +785,7 @@ private: NCR::NCR5380::NCR5380 scsi_; SCSI::Target::Target hard_drive_; bool scsi_bus_is_clocked_ = false; + bool soft_reset_ = false; HalfCycles via_clock_; HalfCycles real_time_clock_; From 284297a1b86aa2e52a0a26963dbd4a8e524f91a7 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Tue, 26 May 2026 21:35:58 -0400 Subject: [PATCH 3/3] Add hard reset. --- Machines/Apple/Macintosh/Macintosh.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Machines/Apple/Macintosh/Macintosh.cpp b/Machines/Apple/Macintosh/Macintosh.cpp index 8b1bb600b..e5791c8af 100644 --- a/Machines/Apple/Macintosh/Macintosh.cpp +++ b/Machines/Apple/Macintosh/Macintosh.cpp @@ -73,7 +73,7 @@ template class ConcreteMachin public DriveSpeedAccumulator::Delegate, public Machine, public MachineTypes::AudioProducer, -// public MachineTypes::HardResettable, // TODO: my 68000 doesn't actually implement the reset line yet. + public MachineTypes::HardResettable, public MachineTypes::MappedKeyboardMachine, public MachineTypes::MediaTarget, public MachineTypes::MouseMachine, @@ -204,6 +204,11 @@ public: update_interrupt_input(); } + void hard_reset() final { + setup_memory_map(); + mc68000_.reset(); + } + template HalfCycles perform_bus_operation(const Microcycle &cycle, int) { // Advance time. advance_time(cycle.length); @@ -396,7 +401,7 @@ public: iwm_.flush(); } - void set_rom_is_overlay(bool rom_is_overlay) { + void set_rom_is_overlay(const bool rom_is_overlay) { ROM_is_overlay_ = rom_is_overlay; using Model = Analyser::Static::Macintosh::Target::Model; @@ -678,10 +683,10 @@ private: b3: 0 = use alternate sound buffer, 1 = use ordinary sound buffer b2–b0: audio output volume */ - iwm_->set_select(!!(value & 0x20)); + iwm_->set_select(value & 0x20); machine_.set_use_alternate_buffers(!(value & 0x40), !(value&0x08)); - machine_.set_rom_is_overlay(!!(value & 0x10)); + machine_.set_rom_is_overlay(value & 0x10); audio_.flush(); audio_.audio.set_volume(value & 7); @@ -700,7 +705,7 @@ private: b0: clock's serial data line */ if(value & 0x4) clock_.abort(); - else clock_.set_input(!!(value & 0x2), !!(value & 0x1)); + else clock_.set_input(value & 0x2, value & 0x1); audio_.flush(); audio_.audio.set_enabled(!(value & 0x80));