From b6ff76b36212bc22951696470042860b2732f3fc Mon Sep 17 00:00:00 2001 From: Sven Schnelle <41547105+svenschnelle@users.noreply.github.com> Date: Wed, 28 Oct 2020 02:44:15 +0100 Subject: [PATCH] Uninitialized variable fixes (#7406) * hp98265a: initialize members * hp98543: initialize members * hp98544: initialize members * hp98550: initialize members * hp98620: initialize members * hp98644: initialize members * hp_dio: initialize members * human_interface: initialize members * hlebase: initialize members * hlemouse: initialize members * hp_hil: initialize members * 8291a: initialize members * ins8250: initialize members * tms9914: initialize members * catseye: initialize members --- src/devices/bus/hp_dio/hp98265a.cpp | 5 +- src/devices/bus/hp_dio/hp98543.cpp | 6 +- src/devices/bus/hp_dio/hp98544.cpp | 4 +- src/devices/bus/hp_dio/hp98550.cpp | 4 +- src/devices/bus/hp_dio/hp98620.cpp | 19 +++-- src/devices/bus/hp_dio/hp98620.h | 2 +- src/devices/bus/hp_dio/hp98644.cpp | 10 ++- src/devices/bus/hp_dio/hp_dio.cpp | 3 + src/devices/bus/hp_dio/human_interface.cpp | 25 +++++-- src/devices/bus/hp_hil/hlebase.cpp | 2 + src/devices/bus/hp_hil/hlemouse.cpp | 5 +- src/devices/bus/hp_hil/hp_hil.cpp | 19 +++-- src/devices/machine/i8291a.cpp | 58 +++++++++++++++- src/devices/machine/ins8250.cpp | 1 + src/devices/machine/tms9914.cpp | 80 +++++++++++++++++++++- src/devices/video/catseye.cpp | 47 +++++++++++-- 16 files changed, 258 insertions(+), 32 deletions(-) diff --git a/src/devices/bus/hp_dio/hp98265a.cpp b/src/devices/bus/hp_dio/hp98265a.cpp index 3bfeb992e9c..f02a4b9fcb2 100644 --- a/src/devices/bus/hp_dio/hp98265a.cpp +++ b/src/devices/bus/hp_dio/hp98265a.cpp @@ -66,7 +66,10 @@ dio16_98265a_device::dio16_98265a_device(const machine_config &mconfig, device_t m_spc(*this, "scsibus:7:mb87030"), m_sw1(*this, "SW1"), m_sw2(*this, "SW2"), - m_irq_state(false) + m_installed_io(false), + m_control(0), + m_irq_state(false), + m_dmar0(false) { } diff --git a/src/devices/bus/hp_dio/hp98543.cpp b/src/devices/bus/hp_dio/hp98543.cpp index eb73c56c6f4..d219dbd77c8 100644 --- a/src/devices/bus/hp_dio/hp98543.cpp +++ b/src/devices/bus/hp_dio/hp98543.cpp @@ -90,8 +90,8 @@ dio16_98543_device::dio16_98543_device(const machine_config &mconfig, device_typ m_nereid(*this, "nereid"), m_space_config("vram", ENDIANNESS_BIG, 8, 19, 0, address_map_constructor(FUNC(dio16_98543_device::map), this)), m_rom(*this, HP98543_ROM_REGION), - m_vram(*this, "vram") - + m_vram(*this, "vram"), + m_intreg(0) { } @@ -99,7 +99,6 @@ void dio16_98543_device::device_start() { save_item(NAME(m_intreg)); save_item(NAME(m_ints)); - m_intreg = 0; dio().install_memory( 0x200000, 0x27ffff, @@ -122,6 +121,7 @@ void dio16_98543_device::device_start() void dio16_98543_device::device_reset() { + m_intreg = 0; } uint16_t dio16_98543_device::rom_r(offs_t offset) diff --git a/src/devices/bus/hp_dio/hp98544.cpp b/src/devices/bus/hp_dio/hp98544.cpp index e5aced877d8..4c211e8778d 100644 --- a/src/devices/bus/hp_dio/hp98544.cpp +++ b/src/devices/bus/hp_dio/hp98544.cpp @@ -78,7 +78,8 @@ dio16_98544_device::dio16_98544_device(const machine_config &mconfig, device_typ m_topcat(*this, "topcat"), m_space_config("vram", ENDIANNESS_BIG, 8, 20, 0, address_map_constructor(FUNC(dio16_98544_device::map), this)), m_rom(*this, HP98544_ROM_REGION), - m_vram(*this, "vram") + m_vram(*this, "vram"), + m_intreg(0) { } @@ -119,6 +120,7 @@ void dio16_98544_device::device_start() void dio16_98544_device::device_reset() { + m_intreg = 0; } uint16_t dio16_98544_device::rom_r(offs_t offset) diff --git a/src/devices/bus/hp_dio/hp98550.cpp b/src/devices/bus/hp_dio/hp98550.cpp index 38f70d2d670..878c5193a37 100644 --- a/src/devices/bus/hp_dio/hp98550.cpp +++ b/src/devices/bus/hp_dio/hp98550.cpp @@ -76,7 +76,9 @@ dio32_98550_device::dio32_98550_device(const machine_config &mconfig, device_typ m_catseye(*this, "catseye%d", 0), m_space_config("vram", ENDIANNESS_BIG, 8, 23, 0, address_map_constructor(FUNC(dio32_98550_device::map), this)), m_rom(*this, "hp98550a_rom"), - m_vram(*this, { "vram_video", "vram_overlay"}) + m_vram(*this, { "vram_video", "vram_overlay"}), + m_intreg(0), + m_ints(0) { } diff --git a/src/devices/bus/hp_dio/hp98620.cpp b/src/devices/bus/hp_dio/hp98620.cpp index 98fab0aa2b8..6560a7cddff 100644 --- a/src/devices/bus/hp_dio/hp98620.cpp +++ b/src/devices/bus/hp_dio/hp98620.cpp @@ -24,9 +24,14 @@ dio16_98620_device::dio16_98620_device(const machine_config &mconfig, const char } dio16_98620_device::dio16_98620_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : - device_t(mconfig, type, tag, owner, clock), - device_dio32_card_interface(mconfig, *this), - m_irq_state(false) + device_t{mconfig, type, tag, owner, clock}, + device_dio32_card_interface{mconfig, *this}, + m_installed_io{false}, + m_control{0}, + m_data{0}, + m_irq_state{false}, + m_regs {0}, + m_dmar {false} { } @@ -52,7 +57,7 @@ void dio16_98620_device::device_start() save_item(NAME(m_control)); save_item(NAME(m_data)); save_item(NAME(m_irq_state)); - save_item(NAME(dmar)); + save_item(NAME(m_dmar)); } void dio16_98620_device::device_reset() @@ -213,7 +218,7 @@ void dio16_98620_device::update_ctrl(const int channel, const uint16_t data, con m_regs[channel].subcount = m_regs[channel].tsz-1; m_regs[channel].armed = true; m_regs[channel].irq = false; - if (dmar[channel]) + if (m_dmar[channel]) dma_transfer(channel); } @@ -354,7 +359,7 @@ void dio16_98620_device::dma_transfer(int channel) WRITE_LINE_MEMBER(dio16_98620_device::dmar0_in) { LOG("%s: %d\n", __FUNCTION__, state); - dmar[0] = state; + m_dmar[0] = state; if (!state) return; @@ -364,7 +369,7 @@ WRITE_LINE_MEMBER(dio16_98620_device::dmar0_in) WRITE_LINE_MEMBER(dio16_98620_device::dmar1_in) { LOG("%s: %d\n", __FUNCTION__, state); - dmar[1] = state; + m_dmar[1] = state; if (!state) return; diff --git a/src/devices/bus/hp_dio/hp98620.h b/src/devices/bus/hp_dio/hp98620.h index c6c93c67306..07d21e0a70f 100644 --- a/src/devices/bus/hp_dio/hp98620.h +++ b/src/devices/bus/hp_dio/hp98620.h @@ -122,7 +122,7 @@ private: bool word; } m_regs[2]; - bool dmar[2]; + bool m_dmar[2]; }; } } // namespace bus::hp_dio diff --git a/src/devices/bus/hp_dio/hp98644.cpp b/src/devices/bus/hp_dio/hp98644.cpp index 7c1f99a6c9d..7badd2d2f15 100644 --- a/src/devices/bus/hp_dio/hp98644.cpp +++ b/src/devices/bus/hp_dio/hp98644.cpp @@ -58,8 +58,12 @@ dio16_98644_device::dio16_98644_device(const machine_config &mconfig, const char dio16_98644_device::dio16_98644_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, type, tag, owner, clock), device_dio16_card_interface(mconfig, *this), - m_uart(*this, INS8250_TAG), - m_switches{*this, "switches"} + m_uart{*this, INS8250_TAG}, + m_switches{*this, "switches"}, + m_installed_io{false}, + m_control{0}, + m_loopback{false}, + m_data{0} { } @@ -165,6 +169,8 @@ void dio16_98644_device::device_reset() write16sm_delegate(*this, FUNC(dio16_98644_device::io_w))); m_installed_io = true; } + m_data = 0; + m_control = 0; } uint16_t dio16_98644_device::io_r(offs_t offset) diff --git a/src/devices/bus/hp_dio/hp_dio.cpp b/src/devices/bus/hp_dio/hp_dio.cpp index 7ad5398c637..aa777e3e5dd 100644 --- a/src/devices/bus/hp_dio/hp_dio.cpp +++ b/src/devices/bus/hp_dio/hp_dio.cpp @@ -105,6 +105,9 @@ dio16_device::dio16_device(const machine_config &mconfig, const char *tag, devic dio16_device::dio16_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, type, tag, owner, clock), m_prgspace(*this, finder_base::DUMMY_TAG, -1), + m_bus_index{0}, + m_irq{0}, + m_dmar{0}, m_irq1_out_cb(*this), m_irq2_out_cb(*this), m_irq3_out_cb(*this), diff --git a/src/devices/bus/hp_dio/human_interface.cpp b/src/devices/bus/hp_dio/human_interface.cpp index ee6758e767c..9f160380a51 100644 --- a/src/devices/bus/hp_dio/human_interface.cpp +++ b/src/devices/bus/hp_dio/human_interface.cpp @@ -108,7 +108,18 @@ human_interface_device::human_interface_device(const machine_config &mconfig, de m_sound(*this, "sn76494"), m_tms9914(*this, "tms9914"), m_rtc(*this, "rtc"), - m_ieee488(*this, IEEE488_TAG) + m_ieee488(*this, IEEE488_TAG), + m_hil_read(false), + m_kbd_nmi(false), + m_gpib_irq_line(false), + m_gpib_dma_line(false), + m_old_latch_enable(false), + m_gpib_dma_enable(false), + m_hil_data(0), + m_latch_data(0), + m_rtc_data(0), + m_ppoll_sc(0), + m_ppoll_mask(0) { } @@ -137,11 +148,17 @@ void human_interface_device::device_start() void human_interface_device::device_reset() { - m_ppoll_sc = 0; - m_gpib_irq_line = false; + m_hil_read = false; m_kbd_nmi = false; - m_old_latch_enable = true; + m_gpib_irq_line = false; + m_gpib_dma_line = false; m_gpib_dma_enable = false; + m_old_latch_enable = true; + m_ppoll_sc = 0; + m_hil_data = 0; + m_latch_data = 0; + m_rtc_data = 0; + m_ppoll_mask = 0; m_rtc->cs1_w(ASSERT_LINE); m_rtc->cs2_w(CLEAR_LINE); m_rtc->write_w(CLEAR_LINE); diff --git a/src/devices/bus/hp_hil/hlebase.cpp b/src/devices/bus/hp_hil/hlebase.cpp index dc849d9f65b..f122919dc1c 100644 --- a/src/devices/bus/hp_hil/hlebase.cpp +++ b/src/devices/bus/hp_hil/hlebase.cpp @@ -21,6 +21,8 @@ namespace bus { hle_device_base::hle_device_base(machine_config const &mconfig, device_type type, char const *tag, device_t *owner, uint32_t clock) : device_t(mconfig, type, tag, owner, clock) , device_hp_hil_interface(mconfig, *this) + , m_powerup(true) + , m_passthru(false) { } diff --git a/src/devices/bus/hp_hil/hlemouse.cpp b/src/devices/bus/hp_hil/hlemouse.cpp index a54ef33a0e7..fe4fd311733 100644 --- a/src/devices/bus/hp_hil/hlemouse.cpp +++ b/src/devices/bus/hp_hil/hlemouse.cpp @@ -35,7 +35,10 @@ INPUT_PORTS_END } // anonymous namespace hle_hp_46060b_device::hle_hp_46060b_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock) - : hle_device_base(mconfig, HP_46060B_MOUSE, tag, owner, clock) + : hle_device_base(mconfig, HP_46060B_MOUSE, tag, owner, clock), + mouse_x_delta{0}, + mouse_y_delta{0}, + mouse_buttons{0} { } void hle_hp_46060b_device::device_reset() diff --git a/src/devices/bus/hp_hil/hp_hil.cpp b/src/devices/bus/hp_hil/hp_hil.cpp index 872101a806f..e86b9b24a9c 100644 --- a/src/devices/bus/hp_hil/hp_hil.cpp +++ b/src/devices/bus/hp_hil/hp_hil.cpp @@ -56,10 +56,15 @@ DEFINE_DEVICE_TYPE(HP_HIL_MLC, hp_hil_mlc_device, "hp_hil_mlc", "HP-HIL Master L // hp_hil_mlc_device - constructor //------------------------------------------------- hp_hil_mlc_device::hp_hil_mlc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, HP_HIL_MLC, tag, owner, clock) - , m_loop(1) - , int_cb(*this) - , nmi_cb(*this) + : device_t{mconfig, HP_HIL_MLC, tag, owner, clock} + , m_r2{0} + , m_r3{0} + , m_w1{0} + , m_w2{0} + , m_w3{0} + , m_loop{1} + , int_cb{*this} + , nmi_cb{*this} { } @@ -96,6 +101,10 @@ void hp_hil_mlc_device::device_reset() m_r2 = 0; m_r3 = 0; // HPMLC_R3_NMI; + m_w1 = 0; + m_w2 = 0; + m_w3 = 0; + m_loop = 1; } @@ -244,6 +253,8 @@ WRITE_LINE_MEMBER(hp_hil_mlc_device::ap_w) device_hp_hil_interface::device_hp_hil_interface(const machine_config &mconfig, device_t &device) : device_interface(device, "hphil") , m_hp_hil_mlc(nullptr) + , m_device_id(0) + , m_device_id16(0) , m_next(nullptr) { } diff --git a/src/devices/machine/i8291a.cpp b/src/devices/machine/i8291a.cpp index 7c9c0296a05..ca73f500df8 100644 --- a/src/devices/machine/i8291a.cpp +++ b/src/devices/machine/i8291a.cpp @@ -48,7 +48,63 @@ i8291a_device::i8291a_device(const machine_config &mconfig, const char *tag, m_ndac_write_func{*this}, m_srq_write_func{*this}, m_dio_write_func{*this}, - m_dio_read_func{*this} + m_dio_read_func{*this}, + m_din{0}, + m_dout{0}, + m_ints1{0}, + m_ints2{0}, + m_ie1{0}, + m_ie2{0}, + m_address0{0}, + m_address1{0}, + m_eos{0}, + m_spoll_mode{0}, + m_address_mode{0}, + m_address_status{0}, + m_cpt{0}, + m_auxa{0}, + m_auxb{0}, + m_atn{false}, + m_ren{false}, + m_nrfd{false}, + m_ndac{false}, + m_dav{false}, + m_srq{false}, + m_ifc{false}, + m_eoi{false}, + m_dio{0}, + m_nrfd_out{false}, + m_ndac_out{false}, + m_dav_out{false}, + m_srq_out{false}, + m_eoi_out{false}, + m_pon{false}, + m_rdy{false}, + m_lpe{false}, + m_ist{false}, + m_rtl{false}, + m_apt_flag{false}, + m_cpt_flag{false}, + m_din_flag{false}, + m_nba{false}, + m_pp_sense{false}, + m_pp_line{0}, + m_send_eoi{false}, + m_sh_state{source_handshake_state::SIDS}, + m_ah_state{acceptor_handshake_state::AIDS}, + m_t_state{talker_state::TIDS}, + m_tp_state{talker_primary_state::TPIS}, + m_tsp_state{talker_serial_poll_state::SPIS}, + m_l_state{listener_state::LIDS}, + m_lp_state{listener_primary_state::LPIS}, + m_rl_state{remote_local_state::LOCS}, + m_pp_state{parallel_poll_state::PPIS}, + m_dc_state{device_clear_state::DCIS}, + m_dt_state{device_trigger_state::DTIS}, + m_state_changed(false), + m_ignore_ext_signals(false), + m_intr_out(false), + m_dreq_out(false) { } diff --git a/src/devices/machine/ins8250.cpp b/src/devices/machine/ins8250.cpp index 4dff4f85964..3a4dabf688a 100644 --- a/src/devices/machine/ins8250.cpp +++ b/src/devices/machine/ins8250.cpp @@ -111,6 +111,7 @@ ins8250_uart_device::ins8250_uart_device(const machine_config &mconfig, device_t : device_t(mconfig, type, tag, owner, clock) , device_serial_interface(mconfig, *this) , m_device_type(device_type) + , m_regs{0} , m_out_tx_cb(*this) , m_out_dtr_cb(*this) , m_out_rts_cb(*this) diff --git a/src/devices/machine/tms9914.cpp b/src/devices/machine/tms9914.cpp index ac6a1122e26..b8d7b05e4a4 100644 --- a/src/devices/machine/tms9914.cpp +++ b/src/devices/machine/tms9914.cpp @@ -178,7 +178,58 @@ tms9914_device::tms9914_device(const machine_config &mconfig, const char *tag, d m_dio_write_func(*this), m_signal_wr_fns(*this), m_int_write_func(*this), - m_accrq_write_func(*this) + m_accrq_write_func(*this), + m_int_line{false}, + m_accrq_line{false}, + m_dio{0}, + m_signals{false}, + m_ext_signals{false}, + m_no_reflection{false}, + m_ext_state_change{false}, + m_reg_int0_status{0}, + m_reg_int0_mask{0}, + m_reg_int1_status{0}, + m_reg_int1_mask{0}, + m_reg_address{0}, + m_reg_serial_p{0}, + m_reg_2nd_serial_p{0}, + m_reg_parallel_p{0}, + m_reg_2nd_parallel_p{0}, + m_reg_di{0}, + m_reg_do{0}, + m_reg_ulpa{false}, + m_swrst{false}, + m_hdfa{false}, + m_hdfe{false}, + m_rtl{false}, + m_gts{false}, + m_rpp{false}, + m_sic{false}, + m_sre{false}, + m_dai{false}, + m_pts{false}, + m_stdl{false}, + m_shdw{false}, + m_vstdl{false}, + m_rsvd2{false}, + m_ah_state{FSM_AH_AIDS}, + m_ah_adhs{false}, + m_ah_anhs{false}, + m_ah_aehs{false}, + m_sh_state{FSM_SH_SIDS}, + m_sh_shfs{false}, + m_sh_vsts{false}, + m_t_state{FSM_T_TIDS}, + m_t_tpas{false}, + m_t_spms{false}, + m_t_eoi_state{FSM_T_ENIS}, + m_l_state{FSM_L_LIDS}, + m_l_lpas{false}, + m_sr_state{FSM_SR_NPRS}, + m_rl_state{FSM_RL_LOCS}, + m_pp_ppas{false}, + m_c_state{FSM_C_CIDS}, + m_next_eoi{false} { // Silence compiler complaints about unused variables (void)REG_INT1_IFC_BIT; @@ -500,15 +551,40 @@ void tms9914_device::device_reset() m_stdl = false; m_shdw = false; m_vstdl = false; + m_int_line = false; m_accrq_line = true; // Ensure change is propagated + m_dio = 0; + m_reg_int0_status = 0; + m_reg_int0_mask = 0; + m_reg_int1_status = 0; + m_reg_int1_mask = 0; + m_reg_address = 0; m_reg_serial_p = 0; m_reg_2nd_serial_p = 0; m_reg_parallel_p = 0; m_reg_2nd_parallel_p = 0; - + m_reg_di = 0; + m_reg_do = 0; m_reg_ulpa = false; + m_swrst = false; + m_hdfa = false; + m_hdfe = false; + m_rtl = false; + m_gts = false; + m_rpp = false; + m_sic = false; + m_sre = false; + m_dai = false; + m_pts = false; + m_stdl = false; + m_shdw = false; + m_vstdl = false; + m_rsvd2 = false; + + std::fill(std::begin(m_ext_signals), std::end(m_ext_signals), false); + std::fill(std::begin(m_signals), std::end(m_signals), false); do_swrst(); update_fsm(); diff --git a/src/devices/video/catseye.cpp b/src/devices/video/catseye.cpp index ef242b38969..8dcc8d909d9 100644 --- a/src/devices/video/catseye.cpp +++ b/src/devices/video/catseye.cpp @@ -14,10 +14,49 @@ DEFINE_DEVICE_TYPE(CATSEYE, catseye_device, "catseye", "HP Catseye ASIC") catseye_device::catseye_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : - device_t(mconfig, type, tag, owner, clock), - m_vram(*this, { "^vram_video", "^vram_overlay"}), - m_int_write_func(*this), - m_blink_timer(nullptr) + device_t{mconfig, type, tag, owner, clock}, + m_vram{*this, { "^vram_video", "^vram_overlay"}}, + m_int_write_func{*this}, + m_blink_timer{nullptr}, + m_changed{false}, + m_blink_state{false}, + m_plane_mask_l{0}, + m_plane_mask_h{0}, + m_write_enable{0}, + m_read_enable{0}, + m_fb_enable{0}, + m_display_enable{0}, + m_blink_enable{0}, + m_in_vblank{0}, + m_wm_int_pending{0}, + m_vblank_int_pending{0}, + m_wm_int_enable{0}, + m_vblank_int_enable{0}, + m_rugsc{0}, + m_misc{0}, + m_wmx{0}, + m_wmwidth{0}, + m_wmheight{0}, + m_wmsourcex{0}, + m_wmsourcey{0}, + m_wmdestx{0}, + m_wmdesty{0}, + m_wmclipleft{0}, + m_wmclipright{0}, + m_wmcliptop{0}, + m_wmclipbottom{0}, + m_patterns{0}, + m_linepath{0}, + m_linetype{0}, + m_prr{0}, + m_wrr{0}, + m_trr{0}, + m_trrctl{0}, + m_color{0}, + m_vb{0}, + m_acntrl{0}, + m_planemode{0}, + m_status{0} { }