1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-01-13 07:30:21 +00:00

Forces 6502 consumers to declare which model — the original, 65C02 or 65SC02.

All present machines use a regular 6502.
This commit is contained in:
Thomas Harte 2018-08-06 20:06:07 -04:00
parent c1d1c451ef
commit 76a73c835c
7 changed files with 13 additions and 7 deletions

View File

@ -298,7 +298,7 @@ template <bool is_iie> class ConcreteMachine:
public:
ConcreteMachine(const Analyser::Static::AppleII::Target &target, const ROMMachine::ROMFetcher &rom_fetcher):
m6502_(*this),
m6502_(CPU::MOS6502::Personality::P6502, *this),
video_bus_handler_(ram_, aux_ram_),
audio_toggle_(audio_queue_),
speaker_(audio_toggle_) {

View File

@ -32,7 +32,7 @@ template<class T> class Cartridge:
public:
Cartridge(const std::vector<uint8_t> &rom) :
m6502_(*this),
m6502_(CPU::MOS6502::Personality::P6502, *this),
rom_(rom),
bus_extender_(rom_.data(), rom.size()) {
// The above works because bus_extender_ is declared after rom_ in the instance storage list;

View File

@ -18,7 +18,7 @@ using namespace Commodore::C1540;
MachineBase::MachineBase(Personality personality, const ROMMachine::ROMFetcher &rom_fetcher) :
Storage::Disk::Controller(1000000),
m6502_(*this),
m6502_(CPU::MOS6502::Personality::P6502, *this),
drive_(new Storage::Disk::Drive(1000000, 300, 2)),
serial_port_VIA_port_handler_(new SerialPortVIA(serial_port_VIA_)),
serial_port_(new SerialPort),

View File

@ -293,7 +293,7 @@ class ConcreteMachine:
public Activity::Source {
public:
ConcreteMachine(const Analyser::Static::Commodore::Target &target, const ROMMachine::ROMFetcher &rom_fetcher) :
m6502_(*this),
m6502_(CPU::MOS6502::Personality::P6502, *this),
user_port_via_port_handler_(new UserPortVIA),
keyboard_via_port_handler_(new KeyboardVIA),
serial_port_(new SerialPort),

View File

@ -50,7 +50,7 @@ class ConcreteMachine:
public Activity::Source {
public:
ConcreteMachine(const Analyser::Static::Acorn::Target &target, const ROMMachine::ROMFetcher &rom_fetcher) :
m6502_(*this),
m6502_(CPU::MOS6502::Personality::P6502, *this),
sound_generator_(audio_queue_),
speaker_(sound_generator_) {
memset(key_states_, 0, sizeof(key_states_));

View File

@ -207,7 +207,7 @@ template <Analyser::Static::Oric::Target::DiskInterface disk_interface> class Co
public:
ConcreteMachine(const Analyser::Static::Oric::Target &target, const ROMMachine::ROMFetcher &rom_fetcher) :
m6502_(*this),
m6502_(CPU::MOS6502::Personality::P6502, *this),
ay8910_(audio_queue_),
speaker_(ay8910_),
via_port_handler_(audio_queue_, ay8910_, speaker_, tape_player_, keyboard_),

View File

@ -180,6 +180,12 @@ class ProcessorBase: public ProcessorStorage {
bool is_jammed();
};
enum Personality {
P6502, // the original 6502, replete with various undocumented instructions
P65C02, // the 65C02; an extended 6502 with a few extra instructions and addressing modes for existing instructions
P65SC02, // like the 65C02, but lacking bit instructions
};
/*!
@abstact Template providing emulation of a 6502 processor.
@ -193,7 +199,7 @@ template <typename T, bool uses_ready_line> class Processor: public ProcessorBas
/*!
Constructs an instance of the 6502 that will use @c bus_handler for all bus communications.
*/
Processor(T &bus_handler) : bus_handler_(bus_handler) {}
Processor(Personality personality, T &bus_handler) : bus_handler_(bus_handler) {}
/*!
Runs the 6502 for a supplied number of cycles.