diff --git a/Machines/PCCompatible/PCCompatible.cpp b/Machines/PCCompatible/PCCompatible.cpp index edd1796c0..9ea218629 100644 --- a/Machines/PCCompatible/PCCompatible.cpp +++ b/Machines/PCCompatible/PCCompatible.cpp @@ -389,10 +389,19 @@ struct Memory { } // Accesses an address based on physical location. + int mda_delay = -1; // HACK. template typename InstructionSet::x86::Accessor::type access(uint32_t address) { + + // TEMPORARY HACK. + if(mda_delay > 0) { + --mda_delay; + if(!mda_delay) { + print_mda(); + } + } if(address >= 0xb'0000 && is_writeable(type)) { - printf("MDA?\n"); + mda_delay = 100; } // Dispense with the single-byte case trivially. @@ -466,6 +475,19 @@ struct Memory { std::copy(data, data + length, memory.begin() + std::vector::difference_type(address)); } + + // TEMPORARY HACK. + void print_mda() { + uint32_t pointer = 0xb'0000; + for(int y = 0; y < 25; y++) { + for(int x = 0; x < 80; x++) { + printf("%c", memory[pointer]); + pointer += 2; // MDA goes [character, attributes]...; skip the attributes. + } + printf("\n"); + } + } + private: std::array memory{0xff}; Registers ®isters_; @@ -708,7 +730,7 @@ class ConcreteMachine: } // TODO: signal interrupt. - printf("TODO: should interrupt\n"); +// printf("TODO: should interrupt\n"); } // Get the next thing to execute.