diff --git a/Machines/AmstradCPC/AmstradCPC.cpp b/Machines/AmstradCPC/AmstradCPC.cpp index 38e1b1b06..48261663f 100644 --- a/Machines/AmstradCPC/AmstradCPC.cpp +++ b/Machines/AmstradCPC/AmstradCPC.cpp @@ -602,9 +602,9 @@ class i8255PortHandler : public Intel::i8255::PortHandler { const Motorola::CRTC::CRTC6845 &crtc, AYDeferrer &ay, Storage::Tape::BinaryTapePlayer &tape_player) : - key_state_(key_state), - crtc_(crtc), ay_(ay), + crtc_(crtc), + key_state_(key_state), tape_player_(tape_player) {} /// The i8255 will call this to set a new output value of @c value for @c port. @@ -658,8 +658,8 @@ class i8255PortHandler : public Intel::i8255::PortHandler { private: AYDeferrer &ay_; - KeyboardState &key_state_; const Motorola::CRTC::CRTC6845 &crtc_; + KeyboardState &key_state_; Storage::Tape::BinaryTapePlayer &tape_player_; }; @@ -674,11 +674,11 @@ class ConcreteMachine: public: ConcreteMachine() : z80_(*this), - crtc_counter_(HalfCycles(4)), // This starts the CRTC exactly out of phase with the CPU's memory accesses - crtc_(Motorola::CRTC::HD6845S, crtc_bus_handler_), crtc_bus_handler_(ram_, interrupt_timer_), - i8255_(i8255_port_handler_), + crtc_(Motorola::CRTC::HD6845S, crtc_bus_handler_), i8255_port_handler_(key_state_, crtc_, ay_, tape_player_), + i8255_(i8255_port_handler_), + crtc_counter_(HalfCycles(4)), // This starts the CRTC exactly out of phase with the CPU's memory accesses tape_player_(8000000) { // primary clock is 4Mhz set_clock_rate(4000000); diff --git a/Machines/Commodore/Vic-20/Vic20.cpp b/Machines/Commodore/Vic-20/Vic20.cpp index 27ea0335a..6a4a11458 100644 --- a/Machines/Commodore/Vic-20/Vic20.cpp +++ b/Machines/Commodore/Vic-20/Vic20.cpp @@ -267,15 +267,13 @@ class ConcreteMachine: public: ConcreteMachine() : m6502_(*this), - rom_(nullptr), - is_running_at_zero_cost_(false), - tape_(new Storage::Tape::BinaryTapePlayer(1022727)), user_port_via_port_handler_(new UserPortVIA), keyboard_via_port_handler_(new KeyboardVIA), serial_port_(new SerialPort), serial_bus_(new ::Commodore::Serial::Bus), user_port_via_(*user_port_via_port_handler_), - keyboard_via_(*keyboard_via_port_handler_) { + keyboard_via_(*keyboard_via_port_handler_), + tape_(new Storage::Tape::BinaryTapePlayer(1022727)) { // communicate the tape to the user-port VIA user_port_via_port_handler_->set_tape(tape_); @@ -648,7 +646,7 @@ class ConcreteMachine: std::vector kernel_rom_; uint8_t expansion_ram_[0x8000]; - uint8_t *rom_; + uint8_t *rom_ = nullptr; uint16_t rom_address_, rom_length_; uint8_t user_basic_memory_[0x0400]; @@ -688,7 +686,7 @@ class ConcreteMachine: // Tape std::shared_ptr tape_; bool use_fast_tape_hack_; - bool is_running_at_zero_cost_; + bool is_running_at_zero_cost_ = false; // Disk std::shared_ptr<::Commodore::C1540::Machine> c1540_; diff --git a/Machines/Oric/Oric.cpp b/Machines/Oric/Oric.cpp index c2b53c71f..dce38c4c4 100644 --- a/Machines/Oric/Oric.cpp +++ b/Machines/Oric/Oric.cpp @@ -182,9 +182,9 @@ class ConcreteMachine: public: ConcreteMachine() : m6502_(*this), - paged_rom_(rom_), + via_port_handler_(tape_player_, keyboard_), via_(via_port_handler_), - via_port_handler_(tape_player_, keyboard_) { + paged_rom_(rom_) { set_clock_rate(1000000); via_port_handler_.set_interrupt_delegate(this); tape_player_.set_delegate(this); diff --git a/StaticAnalyser/Commodore/File.hpp b/StaticAnalyser/Commodore/File.hpp index 6a4eda72d..a6bab1e0e 100644 --- a/StaticAnalyser/Commodore/File.hpp +++ b/StaticAnalyser/Commodore/File.hpp @@ -16,14 +16,12 @@ namespace StaticAnalyser { namespace Commodore { struct File { - File() : is_closed(false), is_locked(false) {} - std::wstring name; std::vector raw_name; uint16_t starting_address; uint16_t ending_address; - bool is_locked; - bool is_closed; + bool is_locked = false; + bool is_closed = false; enum { RelocatableProgram, NonRelocatableProgram, diff --git a/Storage/Disk/Controller/MFMDiskController.cpp b/Storage/Disk/Controller/MFMDiskController.cpp index 55e57c4b7..c0b625c6d 100644 --- a/Storage/Disk/Controller/MFMDiskController.cpp +++ b/Storage/Disk/Controller/MFMDiskController.cpp @@ -14,9 +14,8 @@ using namespace Storage::Disk; MFMController::MFMController(Cycles clock_rate) : Storage::Disk::Controller(clock_rate), - crc_generator_(0x1021, 0xffff), - data_mode_(DataMode::Scanning), - shifter_(&crc_generator_) { + shifter_(&crc_generator_), + crc_generator_(0x1021, 0xffff) { } void MFMController::process_index_hole() { diff --git a/Storage/Disk/Controller/MFMDiskController.hpp b/Storage/Disk/Controller/MFMDiskController.hpp index 372f04a93..60c152e35 100644 --- a/Storage/Disk/Controller/MFMDiskController.hpp +++ b/Storage/Disk/Controller/MFMDiskController.hpp @@ -157,7 +157,7 @@ class MFMController: public Controller { // input configuration bool is_double_density_; - DataMode data_mode_; + DataMode data_mode_ = DataMode::Scanning; // writing int last_bit_; diff --git a/Storage/Tape/Formats/TapeUEF.cpp b/Storage/Tape/Formats/TapeUEF.cpp index cb59703fc..b43d7ac36 100644 --- a/Storage/Tape/Formats/TapeUEF.cpp +++ b/Storage/Tape/Formats/TapeUEF.cpp @@ -68,10 +68,7 @@ static int gzget32(gzFile file) { using namespace Storage::Tape; -UEF::UEF(const char *file_name) : - time_base_(1200), - is_300_baud_(false), - platform_type_(TargetPlatform::Acorn) { +UEF::UEF(const char *file_name) { file_ = gzopen(file_name, "rb"); char identifier[10]; diff --git a/Storage/Tape/Formats/TapeUEF.hpp b/Storage/Tape/Formats/TapeUEF.hpp index 41ba07c6a..989846261 100644 --- a/Storage/Tape/Formats/TapeUEF.hpp +++ b/Storage/Tape/Formats/TapeUEF.hpp @@ -41,11 +41,11 @@ class UEF : public PulseQueuedTape, public TargetPlatform::TypeDistinguisher { void set_platform_type(); TargetPlatform::Type target_platform_type(); - TargetPlatform::Type platform_type_; + TargetPlatform::Type platform_type_ = TargetPlatform::Acorn; gzFile file_; - unsigned int time_base_; - bool is_300_baud_; + unsigned int time_base_ = 1200; + bool is_300_baud_ = false; struct Chunk { uint16_t id; diff --git a/Storage/Tape/Parsers/Commodore.cpp b/Storage/Tape/Parsers/Commodore.cpp index f133552e4..257ce5fb6 100644 --- a/Storage/Tape/Parsers/Commodore.cpp +++ b/Storage/Tape/Parsers/Commodore.cpp @@ -14,10 +14,7 @@ using namespace Storage::Tape::Commodore; Parser::Parser() : - Storage::Tape::PulseClassificationParser(), - wave_period_(0.0f), - previous_was_high_(false), - parity_byte_(0) {} + Storage::Tape::PulseClassificationParser() {} /*! Advances to the next block on the tape, treating it as a header, then consumes, parses, and returns it. diff --git a/Storage/Tape/Parsers/Commodore.hpp b/Storage/Tape/Parsers/Commodore.hpp index 9c7c0bbf4..991168595 100644 --- a/Storage/Tape/Parsers/Commodore.hpp +++ b/Storage/Tape/Parsers/Commodore.hpp @@ -99,7 +99,7 @@ class Parser: public Storage::Tape::PulseClassificationParser &tape, uint8_t value); - uint8_t parity_byte_; + uint8_t parity_byte_ = 0; void reset_parity_byte(); uint8_t get_parity_byte(); void add_parity_byte(uint8_t byte); @@ -127,8 +127,8 @@ class Parser: public Storage::Tape::PulseClassificationParser