1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-02-18 01:30:56 +00:00

Very, _very_ minor: switched to normal C++ constructor syntax for simple variable initialisation.

This commit is contained in:
Thomas Harte 2015-12-06 16:53:37 -05:00
parent 5feef2110f
commit 675070c5dd
4 changed files with 23 additions and 28 deletions

View File

@ -13,21 +13,19 @@
using namespace Atari2600; using namespace Atari2600;
static const int horizontalTimerReload = 227; static const int horizontalTimerReload = 227;
Machine::Machine() Machine::Machine() :
_timestamp(0),
_horizontalTimer(0),
_lastOutputStateDuration(0),
_lastOutputState(OutputState::Sync),
_piaTimerStatus(0xff),
_rom(nullptr),
_hMoveWillCount(false),
_piaDataValue{0xff, 0xff},
_tiaInputValue{0xff, 0xff}
{ {
_timestamp = 0;
_horizontalTimer = 0;
_lastOutputStateDuration = 0;
_lastOutputState = OutputState::Sync;
_crt = new Outputs::CRT(228, 262, 1, 2); _crt = new Outputs::CRT(228, 262, 1, 2);
_piaTimerStatus = 0xff;
memset(_collisions, 0xff, sizeof(_collisions)); memset(_collisions, 0xff, sizeof(_collisions));
_rom = nullptr;
_hMoveWillCount = false;
_piaDataValue[0] = _piaDataValue[1] = 0xff;
_tiaInputValue[0] = _tiaInputValue[1] = 0xff;
setup6502(); setup6502();
set_reset_line(true); set_reset_line(true);
} }

View File

@ -14,9 +14,7 @@ const uint8_t CSTestMachineJamOpcode = CPU6502::JamOpcode;
class MachineJamHandler: public CPU6502::AllRAMProcessor::JamHandler { class MachineJamHandler: public CPU6502::AllRAMProcessor::JamHandler {
public: public:
MachineJamHandler(CSTestMachine *targetMachine) { MachineJamHandler(CSTestMachine *targetMachine) : _targetMachine(targetMachine) {}
_targetMachine = targetMachine;
}
void processor_did_jam(CPU6502::AllRAMProcessor::Processor *processor, uint16_t address) override { void processor_did_jam(CPU6502::AllRAMProcessor::Processor *processor, uint16_t address) override {
[_targetMachine.jamHandler testMachine:_targetMachine didJamAtAddress:address]; [_targetMachine.jamHandler testMachine:_targetMachine didJamAtAddress:address];

View File

@ -14,7 +14,7 @@
namespace CPU6502 { namespace CPU6502 {
enum class Register { enum Register {
LastOperationAddress, LastOperationAddress,
ProgramCounter, ProgramCounter,
StackPointer, StackPointer,
@ -381,16 +381,16 @@ template <class T> class Processor {
bool _ready_is_active; bool _ready_is_active;
public: public:
Processor() Processor() :
{ _scheduleProgramsReadPointer(0),
_scheduleProgramsWritePointer = _scheduleProgramsReadPointer = 0; _scheduleProgramsWritePointer(0),
_scheduledPrograms[0] = _scheduledPrograms[1] = _scheduledPrograms[2] = _scheduledPrograms[3] = nullptr; _is_jammed(false),
_is_jammed = false; _jam_handler(nullptr),
_jam_handler = nullptr; _cycles_left_to_run(0),
_cycles_left_to_run = 0; _ready_line_is_enabled(false),
_ready_line_is_enabled = false; _ready_is_active(false),
_ready_is_active = false; _scheduledPrograms{nullptr, nullptr, nullptr, nullptr}
} {}
const MicroOp *get_reset_program() { const MicroOp *get_reset_program() {
static const MicroOp reset[] = { static const MicroOp reset[] = {

View File

@ -12,9 +12,8 @@
using namespace CPU6502; using namespace CPU6502;
AllRAMProcessor::AllRAMProcessor() AllRAMProcessor::AllRAMProcessor() : _timestamp(0)
{ {
_timestamp = 0;
setup6502(); setup6502();
} }