From d0932e991a497ea3064ddf289824472b19c1a8a4 Mon Sep 17 00:00:00 2001 From: Robbbert Date: Fri, 25 Mar 2022 14:12:01 +1100 Subject: init vars for coverity (drivers/d) --- src/mame/drivers/dacholer.cpp | 20 ++++++++++---------- src/mame/drivers/dambustr.cpp | 6 +++--- src/mame/drivers/datacast.cpp | 2 +- src/mame/drivers/dblcrown.cpp | 8 ++++---- src/mame/drivers/ddayjlc.cpp | 18 +++++++++--------- src/mame/drivers/ddealer.cpp | 2 +- src/mame/drivers/ddenlovr.cpp | 10 +++++----- src/mame/drivers/deco_ld.cpp | 2 +- src/mame/drivers/dectalk.cpp | 40 ++++++++++++++++++++-------------------- src/mame/drivers/decwritr.cpp | 6 +++--- src/mame/drivers/didact.cpp | 6 +++--- src/mame/drivers/digilog320.cpp | 6 +++--- src/mame/drivers/discoboy.cpp | 6 +++--- src/mame/drivers/dlair.cpp | 4 ++-- src/mame/drivers/dmndrby.cpp | 8 ++++---- src/mame/drivers/dorachan.cpp | 4 ++-- src/mame/drivers/drdmania.cpp | 2 +- src/mame/drivers/drtomy.cpp | 6 +++--- src/mame/drivers/dvk_kcgd.cpp | 10 +++++----- src/mame/drivers/dynadice.cpp | 6 +++--- 20 files changed, 86 insertions(+), 86 deletions(-) diff --git a/src/mame/drivers/dacholer.cpp b/src/mame/drivers/dacholer.cpp index 47e3dbbdde4..0ca73468e70 100644 --- a/src/mame/drivers/dacholer.cpp +++ b/src/mame/drivers/dacholer.cpp @@ -112,18 +112,18 @@ private: output_finder<2> m_leds; /* video-related */ - tilemap_t *m_bg_tilemap; - tilemap_t *m_fg_tilemap; - int m_bg_bank; - uint8_t m_scroll_x; - uint8_t m_scroll_y; + tilemap_t *m_bg_tilemap = nullptr; + tilemap_t *m_fg_tilemap = nullptr; + int m_bg_bank = 0; + uint8_t m_scroll_x = 0; + uint8_t m_scroll_y = 0; /* sound-related */ - int m_msm_data; - int m_msm_toggle; - uint8_t m_snd_interrupt_enable; - uint8_t m_music_interrupt_enable; - uint8_t m_snd_ack; + int m_msm_data = 0; + int m_msm_toggle = 0; + uint8_t m_snd_interrupt_enable = 0; + uint8_t m_music_interrupt_enable = 0; + uint8_t m_snd_ack = 0; }; diff --git a/src/mame/drivers/dambustr.cpp b/src/mame/drivers/dambustr.cpp index b766a246bae..f0d48403fa7 100644 --- a/src/mame/drivers/dambustr.cpp +++ b/src/mame/drivers/dambustr.cpp @@ -24,9 +24,9 @@ Stephh's notes (based on the games Z80 code and some tests) : "lives" if you touch the background : you can still be hit by enemies' bullets and be stalled if speed is too low. - There is a setting which is only available in the "test mode", it's the - maximum game time. If you don't set it, the game considers it's illimited + maximum game time. If you don't set it, the game considers it as unlimited time (full doesn't decrease). But once you set it to a value, it is not - possible to turn the value back to 0 even by reseting the game. + possible to turn the value back to 0 even by resetting the game. - If you go too far without dying, background becomes complete garbage, but it then appears again correctly. Is there a bad dumped ROM or is emulation bugged somewhere ? Verification against real PCB is needed ! @@ -74,7 +74,7 @@ public: private: required_device m_custom; - int m_noise_data; + int m_noise_data = 0; void dambustr_noise_enable_w(uint8_t data); void dambustr_map(address_map &map); }; diff --git a/src/mame/drivers/datacast.cpp b/src/mame/drivers/datacast.cpp index a233f8a2e15..46a2d991dc6 100644 --- a/src/mame/drivers/datacast.cpp +++ b/src/mame/drivers/datacast.cpp @@ -93,7 +93,7 @@ private: required_device_array m_usart; required_device m_dbrg; - uint8_t m_key_col; + uint8_t m_key_col = 0; }; diff --git a/src/mame/drivers/dblcrown.cpp b/src/mame/drivers/dblcrown.cpp index f49f80958df..1324361f58a 100644 --- a/src/mame/drivers/dblcrown.cpp +++ b/src/mame/drivers/dblcrown.cpp @@ -113,12 +113,12 @@ private: required_ioport_array<4> m_inputs; output_finder<8> m_lamps; - uint8_t m_bank; - uint8_t m_irq_src; + uint8_t m_bank = 0; + uint8_t m_irq_src = 0; std::unique_ptr m_pal_ram; std::unique_ptr m_vram; - uint8_t m_vram_bank[2]; - uint8_t m_mux_data; + uint8_t m_vram_bank[2]{}; + uint8_t m_mux_data = 0; }; void dblcrown_state::video_start() diff --git a/src/mame/drivers/ddayjlc.cpp b/src/mame/drivers/ddayjlc.cpp index c3073009f8f..3ce75d1a280 100644 --- a/src/mame/drivers/ddayjlc.cpp +++ b/src/mame/drivers/ddayjlc.cpp @@ -125,17 +125,17 @@ private: required_shared_ptr m_bgvram; /* video-related */ - tilemap_t *m_bg_tilemap; - tilemap_t *m_fg_tilemap; - int32_t m_char_bank; - int32_t m_bgadr; + tilemap_t *m_bg_tilemap = nullptr; + tilemap_t *m_fg_tilemap = nullptr; + int32_t m_char_bank = 0; + int32_t m_bgadr = 0; /* misc */ - bool m_sound_nmi_enable; - bool m_main_nmi_enable; - int32_t m_e00x_l[4]; - int32_t m_e00x_d[4][2]; - uint8_t m_prot_addr; + bool m_sound_nmi_enable = false; + bool m_main_nmi_enable = false; + int32_t m_e00x_l[4]{}; + int32_t m_e00x_d[4][2]{}; + uint8_t m_prot_addr = 0; /* devices */ required_device m_maincpu; diff --git a/src/mame/drivers/ddealer.cpp b/src/mame/drivers/ddealer.cpp index c83554a1ff6..f92e09baf6a 100644 --- a/src/mame/drivers/ddealer.cpp +++ b/src/mame/drivers/ddealer.cpp @@ -373,7 +373,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(ddealer_state::mcu_sim) if (m_coin_input & 0x10)//start 2 { - if((m_input_pressed & 0x10) == 0 && (~(m_work_ram[0x100 / 2] & 2))) + if(((m_input_pressed & 0x10) == 0) && (~m_work_ram[0x100 / 2] & 2)) m_mcu_shared_ram[0x000 / 2]--; m_input_pressed = (m_input_pressed & 0xef) | 0x10; } diff --git a/src/mame/drivers/ddenlovr.cpp b/src/mame/drivers/ddenlovr.cpp index cdfe5c52d9a..0ffade11900 100644 --- a/src/mame/drivers/ddenlovr.cpp +++ b/src/mame/drivers/ddenlovr.cpp @@ -547,8 +547,8 @@ private: required_device m_soundlatch; output_finder<2> m_leds; - uint16_t m_mmpanic_leds; /* A led for each of the 9 buttons */ - uint8_t m_funkyfig_lockout; + uint16_t m_mmpanic_leds = 0; /* A led for each of the 9 buttons */ + uint8_t m_funkyfig_lockout = 0; }; class hanakanz_state : public ddenlovr_state @@ -628,9 +628,9 @@ private: output_finder<> m_led; - uint8_t m_romdata[2]; - int m_palette_index; - uint8_t m_daimyojn_palette_sel; + uint8_t m_romdata[2]{}; + int m_palette_index = 0; + uint8_t m_daimyojn_palette_sel = 0; }; VIDEO_START_MEMBER(ddenlovr_state,ddenlovr) diff --git a/src/mame/drivers/deco_ld.cpp b/src/mame/drivers/deco_ld.cpp index df3e8fe79b1..d1218f82ffb 100644 --- a/src/mame/drivers/deco_ld.cpp +++ b/src/mame/drivers/deco_ld.cpp @@ -162,7 +162,7 @@ private: required_shared_ptr m_vram1; required_shared_ptr m_attr1; - int m_nmimask; + int m_nmimask = 0; uint8_t acia_status_hack_r(); uint8_t sound_status_r(); diff --git a/src/mame/drivers/dectalk.cpp b/src/mame/drivers/dectalk.cpp index 3b36be8ab96..0f4991f3a26 100644 --- a/src/mame/drivers/dectalk.cpp +++ b/src/mame/drivers/dectalk.cpp @@ -270,26 +270,26 @@ private: }; // input fifo, between m68k and tms32010 - uint16_t m_infifo[32]; // technically eight 74LS224 4bit*16stage FIFO chips, arranged as a 32 stage, 16-bit wide fifo - uint8_t m_infifo_count; - uint8_t m_infifo_tail_ptr; - uint8_t m_infifo_head_ptr; + uint16_t m_infifo[32]{}; // technically eight 74LS224 4bit*16stage FIFO chips, arranged as a 32 stage, 16-bit wide fifo + uint8_t m_infifo_count = 0; + uint8_t m_infifo_tail_ptr = 0; + uint8_t m_infifo_head_ptr = 0; // output fifo, between tms32010 and 10khz sample latch for dac - uint16_t m_outfifo[16]; // technically three 74LS224 4bit*16stage FIFO chips, arranged as a 16 stage, 12-bit wide fifo - uint8_t m_outfifo_count; - uint8_t m_outfifo_tail_ptr; - uint8_t m_outfifo_head_ptr; - bool m_infifo_semaphore; // latch for status of output fifo, d-latch 74ls74 @ E64 'lower half' - bool m_spc_error_latch; // latch for error status of speech dsp, d-latch 74ls74 @ E64 'upper half' - uint8_t m_m68k_spcflags_latch; // latch for initializing the speech dsp, d-latch 74ls74 @ E29 'lower half', AND latch for spc irq enable, d-latch 74ls74 @ E29 'upper half'; these are stored in bits 0 and 6 respectively, the rest of the bits stored here MUST be zeroed! // TODO: Split this into two separate booleans! - uint8_t m_m68k_tlcflags_latch; // latch for telephone interface stuff, d-latches 74ls74 @ E93 'upper half' and @ 103 'upper and lower halves' // TODO: Split this into three separate booleans! - bool m_simulate_outfifo_error; // simulate an error on the outfifo, which does something unusual to the dsp latches - bool m_tlc_tonedetect; - bool m_tlc_ringdetect; - uint8_t m_tlc_dtmf; // dtmf holding reg - uint8_t m_duart_inport; // low 4 bits of duart input - uint8_t m_duart_outport; // most recent duart output - bool m_hack_self_test_is_second_read; // temp variable for hack below + uint16_t m_outfifo[16]{}; // technically three 74LS224 4bit*16stage FIFO chips, arranged as a 16 stage, 12-bit wide fifo + uint8_t m_outfifo_count = 0; + uint8_t m_outfifo_tail_ptr = 0; + uint8_t m_outfifo_head_ptr = 0; + bool m_infifo_semaphore = false; // latch for status of output fifo, d-latch 74ls74 @ E64 'lower half' + bool m_spc_error_latch = false; // latch for error status of speech dsp, d-latch 74ls74 @ E64 'upper half' + uint8_t m_m68k_spcflags_latch = 0; // latch for initializing the speech dsp, d-latch 74ls74 @ E29 'lower half', AND latch for spc irq enable, d-latch 74ls74 @ E29 'upper half'; these are stored in bits 0 and 6 respectively, the rest of the bits stored here MUST be zeroed! // TODO: Split this into two separate booleans! + uint8_t m_m68k_tlcflags_latch = 0; // latch for telephone interface stuff, d-latches 74ls74 @ E93 'upper half' and @ 103 'upper and lower halves' // TODO: Split this into three separate booleans! + bool m_simulate_outfifo_error = 0; // simulate an error on the outfifo, which does something unusual to the dsp latches + bool m_tlc_tonedetect = false; + bool m_tlc_ringdetect = false; + uint8_t m_tlc_dtmf = 0; // dtmf holding reg + uint8_t m_duart_inport = 0; // low 4 bits of duart input + uint8_t m_duart_outport = 0; // most recent duart output + bool m_hack_self_test_is_second_read = false; // temp variable for hack below required_device m_maincpu; required_device m_dsp; @@ -315,7 +315,7 @@ private: virtual void machine_reset() override; virtual void machine_start() override; TIMER_CALLBACK_MEMBER(outfifo_read_cb); - emu_timer *m_outfifo_read_timer; + emu_timer *m_outfifo_read_timer = nullptr; void outfifo_check(); void clear_all_fifos(); void dsp_semaphore_w(bool state); diff --git a/src/mame/drivers/decwritr.cpp b/src/mame/drivers/decwritr.cpp index 84133c2e05c..1723a61bfbb 100644 --- a/src/mame/drivers/decwritr.cpp +++ b/src/mame/drivers/decwritr.cpp @@ -76,9 +76,9 @@ private: required_device m_ledlatch; required_device m_prtlsi; - ioport_port* m_col_array[16]; - uint8_t m_led_7seg_counter; - uint8_t m_led_7seg[4]; + ioport_port* m_col_array[16]{}; + uint8_t m_led_7seg_counter = 0; + uint8_t m_led_7seg[4]{}; }; IRQ_CALLBACK_MEMBER( decwriter_state::inta_cb ) diff --git a/src/mame/drivers/didact.cpp b/src/mame/drivers/didact.cpp index 4358d02e43e..8873be65f47 100644 --- a/src/mame/drivers/didact.cpp +++ b/src/mame/drivers/didact.cpp @@ -109,9 +109,9 @@ protected: optional_device m_cass; required_ioport_array<5> m_io_lines; - uint8_t m_lines[4]; - uint8_t m_reset; - uint8_t m_shift; + uint8_t m_lines[4]{}; + uint8_t m_reset = 0; + uint8_t m_shift = 0; optional_device m_rs232; output_finder<> m_led; }; diff --git a/src/mame/drivers/digilog320.cpp b/src/mame/drivers/digilog320.cpp index 7bf868e826f..f23eeaad144 100644 --- a/src/mame/drivers/digilog320.cpp +++ b/src/mame/drivers/digilog320.cpp @@ -131,9 +131,9 @@ private: void subcpu_to_maincpu_w(uint8_t data); uint8_t maincpu_status_r(); - uint8_t m_subcpu_to_maincpu; - uint8_t m_maincpu_to_subcpu; - uint8_t m_maincpu_status; + uint8_t m_subcpu_to_maincpu = 0; + uint8_t m_maincpu_to_subcpu = 0; + uint8_t m_maincpu_status = 0; }; diff --git a/src/mame/drivers/discoboy.cpp b/src/mame/drivers/discoboy.cpp index 31504cef755..d05be663349 100644 --- a/src/mame/drivers/discoboy.cpp +++ b/src/mame/drivers/discoboy.cpp @@ -76,10 +76,10 @@ public: private: /* video-related */ - uint8_t m_gfxbank; - uint8_t m_port_00; + uint8_t m_gfxbank = 0; + uint8_t m_port_00 = 0; - bool m_toggle; + bool m_toggle = false; /* devices */ required_device m_maincpu; diff --git a/src/mame/drivers/dlair.cpp b/src/mame/drivers/dlair.cpp index 496ad516322..4753cf6092b 100644 --- a/src/mame/drivers/dlair.cpp +++ b/src/mame/drivers/dlair.cpp @@ -144,8 +144,8 @@ private: optional_shared_ptr m_videoram; output_finder<16> m_digits; - uint8_t m_last_misc; - uint8_t m_laserdisc_data; + uint8_t m_last_misc = 0; + uint8_t m_laserdisc_data = 0; }; diff --git a/src/mame/drivers/dmndrby.cpp b/src/mame/drivers/dmndrby.cpp index 5b177e520f4..364f77caf2d 100644 --- a/src/mame/drivers/dmndrby.cpp +++ b/src/mame/drivers/dmndrby.cpp @@ -89,10 +89,10 @@ private: required_shared_ptr m_sprite_ram; required_shared_ptr m_dderby_vidchars; required_shared_ptr m_dderby_vidattribs; - uint8_t *m_racetrack_tilemap_rom; - tilemap_t *m_racetrack_tilemap; - uint8_t m_io_port[8]; - int m_bg; + uint8_t *m_racetrack_tilemap_rom = nullptr; + tilemap_t *m_racetrack_tilemap = nullptr; + uint8_t m_io_port[8]{}; + int m_bg = 0; required_device m_maincpu; required_device m_audiocpu; diff --git a/src/mame/drivers/dorachan.cpp b/src/mame/drivers/dorachan.cpp index 54820630f8c..fca600c29e4 100644 --- a/src/mame/drivers/dorachan.cpp +++ b/src/mame/drivers/dorachan.cpp @@ -47,8 +47,8 @@ private: void dorachan_map(address_map &map); // internal state - uint8_t m_flip_screen; - uint16_t m_prot_value; + uint8_t m_flip_screen = 0; + uint16_t m_prot_value = 0; virtual void machine_start() override; virtual void machine_reset() override; diff --git a/src/mame/drivers/drdmania.cpp b/src/mame/drivers/drdmania.cpp index 95e66fd299e..2c96b1e1b06 100644 --- a/src/mame/drivers/drdmania.cpp +++ b/src/mame/drivers/drdmania.cpp @@ -89,7 +89,7 @@ private: required_device m_gfxdecode; required_shared_ptr m_fgram; - tilemap_t *m_fg_tilemap; + tilemap_t *m_fg_tilemap = nullptr; uint8_t unk_port00_r(); diff --git a/src/mame/drivers/drtomy.cpp b/src/mame/drivers/drtomy.cpp index b615c03ecf6..0325512d85b 100644 --- a/src/mame/drivers/drtomy.cpp +++ b/src/mame/drivers/drtomy.cpp @@ -40,11 +40,11 @@ private: required_shared_ptr m_spriteram; /* video-related */ - tilemap_t *m_tilemap_bg; - tilemap_t *m_tilemap_fg; + tilemap_t *m_tilemap_bg = nullptr; + tilemap_t *m_tilemap_fg = nullptr; /* misc */ - int m_oki_bank; + int m_oki_bank = 0; void drtomy_vram_fg_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); void drtomy_vram_bg_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); void drtomy_okibank_w(uint16_t data); diff --git a/src/mame/drivers/dvk_kcgd.cpp b/src/mame/drivers/dvk_kcgd.cpp index f5721346792..e1362e4a281 100644 --- a/src/mame/drivers/dvk_kcgd.cpp +++ b/src/mame/drivers/dvk_kcgd.cpp @@ -124,7 +124,7 @@ private: void palette_data_w(uint8_t data); //emu_timer *m_vsync_on_timer; - emu_timer *m_500hz_timer; + emu_timer *m_500hz_timer = nullptr; void kcgd_mem(address_map &map); @@ -134,10 +134,10 @@ private: struct { - uint16_t status; // 167770 - uint8_t control; // 167772 - int palette_index, vram_addr; - uint8_t palette[16]; + uint16_t status = 0; // 167770 + uint8_t control = 0; // 167772 + int palette_index = 0, vram_addr = 0; + uint8_t palette[16]{}; } m_video; std::unique_ptr m_videoram; diff --git a/src/mame/drivers/dynadice.cpp b/src/mame/drivers/dynadice.cpp index c33fbc5372e..58679e20fa8 100644 --- a/src/mame/drivers/dynadice.cpp +++ b/src/mame/drivers/dynadice.cpp @@ -75,11 +75,11 @@ private: required_device m_ay8910; /* video-related */ - tilemap_t *m_bg_tilemap; - tilemap_t *m_top_tilemap; + tilemap_t *m_bg_tilemap = nullptr; + tilemap_t *m_top_tilemap = nullptr; /* misc */ - int m_ay_data; + int m_ay_data = 0; void videoram_w(offs_t offset, uint8_t data); void sound_data_w(uint8_t data); -- cgit v1.2.3