diff --git a/Machines/PCCompatible/PCCompatible.cpp b/Machines/PCCompatible/PCCompatible.cpp index fb51daf42..ef0aa6a8c 100644 --- a/Machines/PCCompatible/PCCompatible.cpp +++ b/Machines/PCCompatible/PCCompatible.cpp @@ -49,15 +49,12 @@ namespace PCCompatible { -using VideoAdaptor = Analyser::Static::PCCompatible::Target::VideoAdaptor; +using Target = Analyser::Static::PCCompatible::Target; -template struct Adaptor; -template <> struct Adaptor { - using type = MDA; -}; -template <> struct Adaptor { - using type = CGA; -}; +// Map from members of the VideoAdaptor enum to concrete class types. +template struct Adaptor; +template <> struct Adaptor { using type = MDA; }; +template <> struct Adaptor { using type = CGA; }; class FloppyController { public: @@ -500,7 +497,7 @@ using PIT = i8253; class i8255PortHandler : public Intel::i8255::PortHandler { public: - i8255PortHandler(PCSpeaker &speaker, KeyboardController &keyboard, VideoAdaptor adaptor, int drive_count) : + i8255PortHandler(PCSpeaker &speaker, KeyboardController &keyboard, Target::VideoAdaptor adaptor, int drive_count) : speaker_(speaker), keyboard_(keyboard) { // High switches: // @@ -508,8 +505,8 @@ class i8255PortHandler : public Intel::i8255::PortHandler { // b1, b0: video mode (00 = ROM; 01 = CGA40; 10 = CGA80; 11 = MDA) switch(adaptor) { default: break; - case VideoAdaptor::MDA: high_switches_ |= 0b11; break; - case VideoAdaptor::CGA: high_switches_ |= 0b10; break; // Assume 80 columns. + case Target::VideoAdaptor::MDA: high_switches_ |= 0b11; break; + case Target::VideoAdaptor::CGA: high_switches_ |= 0b10; break; // Assume 80 columns. } high_switches_ |= uint8_t(drive_count << 2); @@ -593,7 +590,7 @@ class i8255PortHandler : public Intel::i8255::PortHandler { }; using PPI = Intel::i8255::i8255; -template +template class IO { public: IO(PIT &pit, DMA &dma, PPI &ppi, PIC &pic, typename Adaptor