1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-19 08:31:11 +00:00

Performed some minor tidying.

This commit is contained in:
Thomas Harte 2017-05-08 21:05:35 -04:00
parent 58488c93be
commit cb66c7e2dc

View File

@ -18,12 +18,12 @@ using namespace Commodore::Vic20;
Machine::Machine() :
rom_(nullptr),
is_running_at_zero_cost_(false),
tape_(new Storage::Tape::BinaryTapePlayer(1022727)) {
// create 6522s, serial port and bus
user_port_via_.reset(new UserPortVIA);
keyboard_via_.reset(new KeyboardVIA);
serial_port_.reset(new SerialPort);
serial_bus_.reset(new ::Commodore::Serial::Bus);
tape_(new Storage::Tape::BinaryTapePlayer(1022727)),
user_port_via_(new UserPortVIA),
keyboard_via_(new KeyboardVIA),
serial_port_(new SerialPort),
serial_bus_(new ::Commodore::Serial::Bus) {
// communicate the tape to the user-port VIA
user_port_via_->set_tape(tape_);
// wire up the serial bus and serial port
@ -98,17 +98,6 @@ Machine::~Machine() {
}
unsigned int Machine::perform_bus_operation(CPU6502::BusOperation operation, uint16_t address, uint8_t *value) {
// static int logCount = 0;
// if(operation == CPU6502::BusOperation::ReadOpcode && address == 0xf957) logCount = 500;
// if(operation == CPU6502::BusOperation::ReadOpcode && logCount) {
// logCount--;
// printf("%04x\n", address);
// }
// if(operation == CPU6502::BusOperation::Write && (address >= 0x033C && address < 0x033C + 192)) {
// printf("\n[%04x] <- %02x\n", address, *value);
// }
// run the phase-1 part of this cycle, in which the VIC accesses memory
if(!is_running_at_zero_cost_) mos6560_->run_for_cycles(1);
@ -266,22 +255,6 @@ void Machine::set_rom(ROMSlot slot, size_t length, const uint8_t *data) {
}
}
//void Machine::set_prg(const char *file_name, size_t length, const uint8_t *data) {
// if(length > 2) {
// _rom_address = (uint16_t)(data[0] | (data[1] << 8));
// _rom_length = (uint16_t)(length - 2);
//
// // install in the ROM area if this looks like a ROM; otherwise put on tape and throw into that mechanism
// if(_rom_address == 0xa000) {
// _rom = new uint8_t[0x2000];
// memcpy(_rom, &data[2], length - 2);
// write_to_map(processor_read_memory_map_, _rom, _rom_address, 0x2000);
// } else {
// set_tape(std::shared_ptr<Storage::Tape::Tape>(new Storage::Tape::PRG(file_name)));
// }
// }
//}
#pragma mar - Tape
void Machine::configure_as_target(const StaticAnalyser::Target &target) {