diff --git a/Analyser/Static/Oric/Target.hpp b/Analyser/Static/Oric/Target.hpp index 66aead3dd..74e686dff 100644 --- a/Analyser/Static/Oric/Target.hpp +++ b/Analyser/Static/Oric/Target.hpp @@ -33,8 +33,14 @@ struct Target: public Analyser::Static::Target, public Reflection::StructImpl; using Speaker = Outputs::Speaker::LowpassSpeaker; @@ -205,7 +206,7 @@ class VIAPortHandler: public MOS::MOS6522::IRQDelegatePortHandler { Keyboard &keyboard_; }; -template class ConcreteMachine: +template class ConcreteMachine: public MachineTypes::TimedMachine, public MachineTypes::ScanProducer, public MachineTypes::AudioProducer, @@ -656,7 +657,7 @@ template class Co const uint16_t basic_invisible_ram_top_ = 0xffff; const uint16_t basic_visible_ram_top_ = 0xbfff; - CPU::MOS6502::Processor m6502_; + CPU::MOS6502Esque::Processor m6502_; // RAM and ROM std::vector rom_, disk_rom_; @@ -759,13 +760,23 @@ using namespace Oric; Machine *Machine::Oric(const Analyser::Static::Target *target_hint, const ROMMachine::ROMFetcher &rom_fetcher) { auto *const oric_target = dynamic_cast(target_hint); - switch(oric_target->disk_interface) { - default: return new ConcreteMachine(*oric_target, rom_fetcher); - case DiskInterface::Microdisc: return new ConcreteMachine(*oric_target, rom_fetcher); - case DiskInterface::Pravetz: return new ConcreteMachine(*oric_target, rom_fetcher); - case DiskInterface::Jasmin: return new ConcreteMachine(*oric_target, rom_fetcher); - case DiskInterface::BD500: return new ConcreteMachine(*oric_target, rom_fetcher); + +#define DiskInterfaceSwitch(processor) \ + switch(oric_target->disk_interface) { \ + default: return new ConcreteMachine(*oric_target, rom_fetcher); \ + case DiskInterface::Microdisc: return new ConcreteMachine(*oric_target, rom_fetcher); \ + case DiskInterface::Pravetz: return new ConcreteMachine(*oric_target, rom_fetcher); \ + case DiskInterface::Jasmin: return new ConcreteMachine(*oric_target, rom_fetcher); \ + case DiskInterface::BD500: return new ConcreteMachine(*oric_target, rom_fetcher); \ } + + switch(oric_target->processor) { + case Processor::WDC65816: DiskInterfaceSwitch(CPU::MOS6502Esque::Type::TWDC65816); + case Processor::MOS6502: DiskInterfaceSwitch(CPU::MOS6502Esque::Type::T6502); + } + +#undef DiskInterfaceSwitch + } Machine::~Machine() {}