diff --git a/Machines/Sinclair/ZX8081/ZX8081.hpp b/Machines/Sinclair/ZX8081/ZX8081.hpp index d16960dca..d7ca68734 100644 --- a/Machines/Sinclair/ZX8081/ZX8081.hpp +++ b/Machines/Sinclair/ZX8081/ZX8081.hpp @@ -32,7 +32,7 @@ class Machine { class Options: public Reflection::StructImpl, public Configurable::QuickloadOption { friend Configurable::QuickloadOption; public: - bool automatic_tape_motor_control; + bool automatic_tape_motor_control = true; Options(Configurable::OptionsType type): Configurable::QuickloadOption(type == Configurable::OptionsType::UserFriendly), diff --git a/Machines/Sinclair/ZXSpectrum/ZXSpectrum.cpp b/Machines/Sinclair/ZXSpectrum/ZXSpectrum.cpp index 4727f903b..cc7e28cac 100644 --- a/Machines/Sinclair/ZXSpectrum/ZXSpectrum.cpp +++ b/Machines/Sinclair/ZXSpectrum/ZXSpectrum.cpp @@ -224,6 +224,17 @@ template class ConcreteMachine: } } else { switch(cycle.operation) { + case CPU::Z80::PartialMachineCycle::Input: + case CPU::Z80::PartialMachineCycle::Output: + case CPU::Z80::PartialMachineCycle::Read: + case CPU::Z80::PartialMachineCycle::Write: + case CPU::Z80::PartialMachineCycle::ReadOpcode: + case CPU::Z80::PartialMachineCycle::Interrupt: + // For these, carry on into the actual handler, below. + break; + + // For anything else that isn't listed below, just advance + // time and conclude here. default: advance(cycle.length); return HalfCycles(0); @@ -250,7 +261,7 @@ template class ConcreteMachine: advance(cycle.length + delay); return delay; - } + } break; case PartialMachineCycle::ReadOpcodeStart: case PartialMachineCycle::ReadStart: @@ -263,7 +274,7 @@ template class ConcreteMachine: advance(cycle.length + delay); return delay; } - } + } break; case PartialMachineCycle::Internal: { // Whatever's on the address bus will remain there, without IOREQ or @@ -284,15 +295,7 @@ template class ConcreteMachine: advance(cycle.length + delay); return delay; } - } - - case CPU::Z80::PartialMachineCycle::Input: - case CPU::Z80::PartialMachineCycle::Output: - case CPU::Z80::PartialMachineCycle::Read: - case CPU::Z80::PartialMachineCycle::Write: - case CPU::Z80::PartialMachineCycle::ReadOpcode: - // For these, carry on into the actual handler, below. - break; + } break; } } @@ -496,6 +499,13 @@ template class ConcreteMachine: } } } break; + + case PartialMachineCycle::Interrupt: + // At least one piece of Spectrum software, Escape from M.O.N.J.A.S. explicitly + // assumes that a 0xff value will be on the bus during an interrupt acknowledgment. + // I wasn't otherwise aware that this value is reliable. + *cycle.value = 0xff; + break; } return HalfCycles(0); diff --git a/Machines/Sinclair/ZXSpectrum/ZXSpectrum.hpp b/Machines/Sinclair/ZXSpectrum/ZXSpectrum.hpp index 693cc3164..7190c46ef 100644 --- a/Machines/Sinclair/ZXSpectrum/ZXSpectrum.hpp +++ b/Machines/Sinclair/ZXSpectrum/ZXSpectrum.hpp @@ -31,7 +31,7 @@ class Machine { friend Configurable::DisplayOption; friend Configurable::QuickloadOption; public: - bool automatic_tape_motor_control; + bool automatic_tape_motor_control = true; Options(Configurable::OptionsType type) : Configurable::DisplayOption(type == Configurable::OptionsType::UserFriendly ? Configurable::Display::RGB : Configurable::Display::CompositeColour), diff --git a/Machines/Utility/MachineForTarget.cpp b/Machines/Utility/MachineForTarget.cpp index 9632f0a84..0a576e867 100644 --- a/Machines/Utility/MachineForTarget.cpp +++ b/Machines/Utility/MachineForTarget.cpp @@ -182,6 +182,7 @@ std::vector Machine::AllMachines(Type type, bool long_names) { AddName(Oric); AddName(Vic20); AddName(ZX8081); + AddName(ZXSpectrum); } #undef AddName