diff --git a/Machines/Atari2600.cpp b/Machines/Atari2600.cpp index fcdca1bff..5d9a5784b 100644 --- a/Machines/Atari2600.cpp +++ b/Machines/Atari2600.cpp @@ -13,21 +13,19 @@ using namespace Atari2600; 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); - _piaTimerStatus = 0xff; memset(_collisions, 0xff, sizeof(_collisions)); - _rom = nullptr; - _hMoveWillCount = false; - - _piaDataValue[0] = _piaDataValue[1] = 0xff; - _tiaInputValue[0] = _tiaInputValue[1] = 0xff; - setup6502(); set_reset_line(true); } diff --git a/OSBindings/Mac/Clock SignalTests/TestMachine.mm b/OSBindings/Mac/Clock SignalTests/TestMachine.mm index 84b8e4a49..0995be556 100644 --- a/OSBindings/Mac/Clock SignalTests/TestMachine.mm +++ b/OSBindings/Mac/Clock SignalTests/TestMachine.mm @@ -14,9 +14,7 @@ const uint8_t CSTestMachineJamOpcode = CPU6502::JamOpcode; class MachineJamHandler: public CPU6502::AllRAMProcessor::JamHandler { public: - MachineJamHandler(CSTestMachine *targetMachine) { - _targetMachine = targetMachine; - } + MachineJamHandler(CSTestMachine *targetMachine) : _targetMachine(targetMachine) {} void processor_did_jam(CPU6502::AllRAMProcessor::Processor *processor, uint16_t address) override { [_targetMachine.jamHandler testMachine:_targetMachine didJamAtAddress:address]; diff --git a/Processors/6502/CPU6502.hpp b/Processors/6502/CPU6502.hpp index 103e4753d..3c420e0a0 100644 --- a/Processors/6502/CPU6502.hpp +++ b/Processors/6502/CPU6502.hpp @@ -14,7 +14,7 @@ namespace CPU6502 { -enum class Register { +enum Register { LastOperationAddress, ProgramCounter, StackPointer, @@ -381,16 +381,16 @@ template class Processor { bool _ready_is_active; public: - Processor() - { - _scheduleProgramsWritePointer = _scheduleProgramsReadPointer = 0; - _scheduledPrograms[0] = _scheduledPrograms[1] = _scheduledPrograms[2] = _scheduledPrograms[3] = nullptr; - _is_jammed = false; - _jam_handler = nullptr; - _cycles_left_to_run = 0; - _ready_line_is_enabled = false; - _ready_is_active = false; - } + Processor() : + _scheduleProgramsReadPointer(0), + _scheduleProgramsWritePointer(0), + _is_jammed(false), + _jam_handler(nullptr), + _cycles_left_to_run(0), + _ready_line_is_enabled(false), + _ready_is_active(false), + _scheduledPrograms{nullptr, nullptr, nullptr, nullptr} + {} const MicroOp *get_reset_program() { static const MicroOp reset[] = { diff --git a/Processors/6502/CPU6502AllRAM.cpp b/Processors/6502/CPU6502AllRAM.cpp index ba327d9da..e4144744c 100644 --- a/Processors/6502/CPU6502AllRAM.cpp +++ b/Processors/6502/CPU6502AllRAM.cpp @@ -12,9 +12,8 @@ using namespace CPU6502; -AllRAMProcessor::AllRAMProcessor() +AllRAMProcessor::AllRAMProcessor() : _timestamp(0) { - _timestamp = 0; setup6502(); }