diff --git a/Machines/AmstradCPC/AmstradCPC.cpp b/Machines/AmstradCPC/AmstradCPC.cpp index 48261663f..b35582948 100644 --- a/Machines/AmstradCPC/AmstradCPC.cpp +++ b/Machines/AmstradCPC/AmstradCPC.cpp @@ -678,8 +678,9 @@ class ConcreteMachine: 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) { + tape_player_(8000000), + crtc_counter_(HalfCycles(4)) // This starts the CRTC exactly out of phase with the CPU's memory accesses + { // primary clock is 4Mhz set_clock_rate(4000000); diff --git a/Outputs/CRT/Internals/TextureBuilder.cpp b/Outputs/CRT/Internals/TextureBuilder.cpp index 471521028..6538789ed 100644 --- a/Outputs/CRT/Internals/TextureBuilder.cpp +++ b/Outputs/CRT/Internals/TextureBuilder.cpp @@ -51,12 +51,7 @@ struct DefaultBookender: public TextureBuilder::Bookender { } TextureBuilder::TextureBuilder(size_t bytes_per_pixel, GLenum texture_unit) : - bytes_per_pixel_(bytes_per_pixel), - write_areas_start_x_(0), - write_areas_start_y_(0), - first_unsubmitted_y_(0), - is_full_(false), - number_of_write_areas_(0) { + bytes_per_pixel_(bytes_per_pixel) { image_.resize(bytes_per_pixel * InputBufferBuilderWidth * InputBufferBuilderHeight); glGenTextures(1, &texture_name_); diff --git a/Outputs/CRT/Internals/TextureBuilder.hpp b/Outputs/CRT/Internals/TextureBuilder.hpp index 5e094f596..25191420f 100644 --- a/Outputs/CRT/Internals/TextureBuilder.hpp +++ b/Outputs/CRT/Internals/TextureBuilder.hpp @@ -127,15 +127,15 @@ class TextureBuilder { // the list of write areas that have ascended to the flush queue std::vector write_areas_; - size_t number_of_write_areas_; - bool is_full_, was_full_; - uint16_t first_unsubmitted_y_; + size_t number_of_write_areas_ = 0; + bool is_full_ = false, was_full_ = false; + uint16_t first_unsubmitted_y_ = 0; inline uint8_t *pointer_to_location(uint16_t x, uint16_t y); // Usually: the start position for the current batch of write areas. // Caveat: reset to the origin upon a submit. So used in comparison by flush to // determine whether the current batch of write areas needs to be relocated. - uint16_t write_areas_start_x_, write_areas_start_y_; + uint16_t write_areas_start_x_ = 0, write_areas_start_y_ = 0; std::unique_ptr bookender_; }; diff --git a/Outputs/CRT/Internals/TextureTarget.cpp b/Outputs/CRT/Internals/TextureTarget.cpp index b7778fe77..dbb907b73 100644 --- a/Outputs/CRT/Internals/TextureTarget.cpp +++ b/Outputs/CRT/Internals/TextureTarget.cpp @@ -15,11 +15,8 @@ using namespace OpenGL; TextureTarget::TextureTarget(GLsizei width, GLsizei height, GLenum texture_unit, GLint mag_filter) : _width(width), _height(height), - _pixel_shader(nullptr), - _drawing_vertex_array(0), - _drawing_array_buffer(0), - _set_aspect_ratio(0.0f), - _texture_unit(texture_unit) { + _texture_unit(texture_unit), + _set_aspect_ratio(0.0f) { glGenFramebuffers(1, &_framebuffer); glBindFramebuffer(GL_FRAMEBUFFER, _framebuffer); diff --git a/Outputs/CRT/Internals/TextureTarget.hpp b/Outputs/CRT/Internals/TextureTarget.hpp index 122d12572..c7e8d5151 100644 --- a/Outputs/CRT/Internals/TextureTarget.hpp +++ b/Outputs/CRT/Internals/TextureTarget.hpp @@ -73,7 +73,7 @@ class TextureTarget { GLenum _texture_unit; std::unique_ptr _pixel_shader; - GLuint _drawing_vertex_array, _drawing_array_buffer; + GLuint _drawing_vertex_array = 0, _drawing_array_buffer = 0; float _set_aspect_ratio; }; diff --git a/Processors/Z80/Implementation/Z80Storage.cpp b/Processors/Z80/Implementation/Z80Storage.cpp index 3e0a63457..8b606312c 100644 --- a/Processors/Z80/Implementation/Z80Storage.cpp +++ b/Processors/Z80/Implementation/Z80Storage.cpp @@ -11,17 +11,7 @@ using namespace CPU::Z80; -ProcessorStorage::ProcessorStorage() : - halt_mask_(0xff), - interrupt_mode_(0), - wait_line_(false), - request_status_(Interrupt::PowerOn), - last_request_status_(Interrupt::PowerOn), - irq_line_(false), - nmi_line_(false), - bus_request_line_(false), - pc_increment_(1), - scheduled_program_counter_(nullptr) { +ProcessorStorage::ProcessorStorage() { set_flags(0xff); } diff --git a/Processors/Z80/Implementation/Z80Storage.hpp b/Processors/Z80/Implementation/Z80Storage.hpp index 04b39e33f..b45cead2e 100644 --- a/Processors/Z80/Implementation/Z80Storage.hpp +++ b/Processors/Z80/Implementation/Z80Storage.hpp @@ -121,8 +121,8 @@ class ProcessorStorage { RegisterPair ix_, iy_, pc_, sp_; RegisterPair ir_, refresh_addr_; bool iff1_, iff2_; - int interrupt_mode_; - uint16_t pc_increment_; + int interrupt_mode_ = 0; + uint16_t pc_increment_ = 1; uint8_t sign_result_; // the sign flag is set if the value in sign_result_ is negative uint8_t zero_result_; // the zero flag is set if the value in zero_result_ is zero uint8_t half_carry_result_; // the half-carry flag is set if bit 4 of half_carry_result_ is set @@ -130,7 +130,7 @@ class ProcessorStorage { uint8_t parity_overflow_result_; // the parity/overflow flag is set if the corresponding bit of parity_overflow_result_ is set uint8_t subtract_flag_; // contains a copy of the subtract flag in isolation uint8_t carry_result_; // the carry flag is set if bit 0 of carry_result_ is set - uint8_t halt_mask_; + uint8_t halt_mask_ = 0xff; HalfCycles number_of_cycles_; @@ -140,17 +140,17 @@ class ProcessorStorage { Reset = 0x04, PowerOn = 0x08 }; - uint8_t request_status_; - uint8_t last_request_status_; - bool irq_line_, nmi_line_; - bool bus_request_line_; - bool wait_line_; + uint8_t request_status_ = Interrupt::PowerOn; + uint8_t last_request_status_ = Interrupt::PowerOn; + bool irq_line_ = false, nmi_line_ = false; + bool bus_request_line_ = false; + bool wait_line_ = false; uint8_t operation_; RegisterPair temp16_, memptr_; uint8_t temp8_; - const MicroOp *scheduled_program_counter_; + const MicroOp *scheduled_program_counter_ = nullptr; std::vector conditional_call_untaken_program_; std::vector reset_program_; diff --git a/Storage/Disk/Encodings/MFM/Parser.cpp b/Storage/Disk/Encodings/MFM/Parser.cpp index 5bdda087b..171f00784 100644 --- a/Storage/Disk/Encodings/MFM/Parser.cpp +++ b/Storage/Disk/Encodings/MFM/Parser.cpp @@ -15,7 +15,7 @@ using namespace Storage::Encodings::MFM; Parser::Parser(bool is_mfm, const std::shared_ptr &disk) : - is_mfm_(is_mfm), disk_(disk) {} + disk_(disk), is_mfm_(is_mfm) {} void Parser::install_sectors_from_track(const Storage::Disk::Track::Address &address) { if(sectors_by_address_by_track_.find(address) != sectors_by_address_by_track_.end()) { diff --git a/Storage/Tape/Tape.cpp b/Storage/Tape/Tape.cpp index dcbbea3de..d551247ec 100644 --- a/Storage/Tape/Tape.cpp +++ b/Storage/Tape/Tape.cpp @@ -117,7 +117,7 @@ void TapePlayer::process_next_event() { #pragma mark - Binary Player BinaryTapePlayer::BinaryTapePlayer(unsigned int input_clock_rate) : - TapePlayer(input_clock_rate), motor_is_running_(false), input_level_(false), delegate_(nullptr) + TapePlayer(input_clock_rate) {} bool BinaryTapePlayer::is_sleeping() { diff --git a/Storage/Tape/Tape.hpp b/Storage/Tape/Tape.hpp index d0e7b27ee..1cc2aa435 100644 --- a/Storage/Tape/Tape.hpp +++ b/Storage/Tape/Tape.hpp @@ -146,10 +146,10 @@ class BinaryTapePlayer: public TapePlayer { bool is_sleeping(); protected: - Delegate *delegate_; + Delegate *delegate_ = nullptr; virtual void process_input_pulse(const Storage::Tape::Tape::Pulse &pulse); - bool input_level_; - bool motor_is_running_; + bool input_level_ = false; + bool motor_is_running_ = false; }; }