diff --git a/Machines/PCCompatible/MDA.hpp b/Machines/PCCompatible/MDA.hpp index 751ad0064..6e40fd5a6 100644 --- a/Machines/PCCompatible/MDA.hpp +++ b/Machines/PCCompatible/MDA.hpp @@ -11,6 +11,7 @@ #include "../../Components/6845/CRTC6845.hpp" #include "../../Outputs/CRT/CRT.hpp" +#include "../../Machines/Utility/ROMCatalogue.hpp" namespace PCCompatible { @@ -18,6 +19,9 @@ class MDA { public: MDA() : crtc_(Motorola::CRTC::Personality::HD6845S, outputter_) {} + static constexpr uint32_t BaseAddress = 0xb'0000; + static constexpr auto FontROM = ROM::Name::PCCompatibleMDAFont; + void set_source(const uint8_t *ram, std::vector font) { outputter_.ram = ram; outputter_.font = font; diff --git a/Machines/PCCompatible/PCCompatible.cpp b/Machines/PCCompatible/PCCompatible.cpp index fe45d4eda..5b046cf8b 100644 --- a/Machines/PCCompatible/PCCompatible.cpp +++ b/Machines/PCCompatible/PCCompatible.cpp @@ -55,7 +55,7 @@ template <> struct Adaptor { using type = MDA; }; template <> struct Adaptor { - using type = MDA; + using type = MDA; // TODO: CGA. }; class FloppyController { @@ -892,7 +892,7 @@ class ConcreteMachine: // Fetch the BIOS. [8088 only, for now] const auto bios = ROM::Name::PCCompatibleGLaBIOS; - const auto font = ROM::Name::PCCompatibleMDAFont; // ... or CGA. + const auto font = Video::FontROM; ROM::Request request = ROM::Request(bios) && ROM::Request(font); auto roms = rom_fetcher(request); @@ -905,7 +905,7 @@ class ConcreteMachine: // Give the video card something to read from. const auto &font_contents = roms.find(font)->second; - video_.set_source(context.memory.at(0xb'0000), font_contents); // TODO: get RAM base address from the card. + video_.set_source(context.memory.at(Video::BaseAddress), font_contents); // ... and insert media. insert_media(target.media);