1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-26 08:49:37 +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;
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);
}

View File

@ -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];

View File

@ -14,7 +14,7 @@
namespace CPU6502 {
enum class Register {
enum Register {
LastOperationAddress,
ProgramCounter,
StackPointer,
@ -381,16 +381,16 @@ template <class T> 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[] = {

View File

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