diff --git a/Components/6845/CRTC6845.hpp b/Components/6845/CRTC6845.hpp index 1181c6cb1..5a87c649c 100644 --- a/Components/6845/CRTC6845.hpp +++ b/Components/6845/CRTC6845.hpp @@ -31,9 +31,18 @@ class BusHandler { void perform_bus_cycle(const BusState &) {} }; +enum Personality { + HD6845S, // + UM6845R, // + MC6845, // + AMS40226 // +}; + template class CRTC6845 { public: - CRTC6845(T &bus_handler) : bus_handler_(bus_handler) {} + + CRTC6845(Personality p, T &bus_handler) : + personality_(p), bus_handler_(bus_handler) {} void run_for(Cycles cycles) { int cyles_remaining = cycles.as_int(); @@ -160,6 +169,7 @@ template class CRTC6845 { } private: + Personality personality_; T &bus_handler_; BusState bus_state_; diff --git a/Machines/AmstradCPC/AmstradCPC.cpp b/Machines/AmstradCPC/AmstradCPC.cpp index 7b7e8b0c4..43fa74d95 100644 --- a/Machines/AmstradCPC/AmstradCPC.cpp +++ b/Machines/AmstradCPC/AmstradCPC.cpp @@ -528,7 +528,7 @@ class ConcreteMachine: ConcreteMachine() : z80_(*this), crtc_counter_(HalfCycles(4)), // This starts the CRTC exactly out of phase with the memory accesses - crtc_(crtc_bus_handler_), + crtc_(Motorola::CRTC::HD6845S, crtc_bus_handler_), crtc_bus_handler_(ram_, interrupt_timer_), i8255_(i8255_port_handler_), i8255_port_handler_(key_state_, crtc_bus_handler_, ay_, tape_player_),