1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-06-26 10:29:31 +00:00

Forced users of the 6845 to be explicit about which type. So far with no effect.

This commit is contained in:
Thomas Harte 2017-08-10 12:28:57 -04:00
parent 02d792c003
commit 6a6e5ae79c
2 changed files with 12 additions and 2 deletions

View File

@ -31,9 +31,18 @@ class BusHandler {
void perform_bus_cycle(const BusState &) {}
};
enum Personality {
HD6845S, //
UM6845R, //
MC6845, //
AMS40226 //
};
template <class T> 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 T> class CRTC6845 {
}
private:
Personality personality_;
T &bus_handler_;
BusState bus_state_;

View File

@ -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_),