init vars for coverity (drivers/i)

This commit is contained in:
Robbbert 2022-03-25 23:38:20 +11:00
parent 30be818cf7
commit 2c2b8dccc8
19 changed files with 113 additions and 113 deletions

View File

@ -83,8 +83,8 @@ private:
required_ioport_array<8> m_kbd;
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint8_t m_row;
tilemap_t *m_bg_tilemap;
uint8_t m_row = 0;
tilemap_t *m_bg_tilemap = nullptr;
TILE_GET_INFO_MEMBER(get_bg_tile_info);
MC6845_ON_UPDATE_ADDR_CHANGED(crtc_addr);

View File

@ -263,24 +263,24 @@ private:
void mcu_io(address_map &map);
void mcu_mem(address_map &map);
uint16_t m_gate;
uint8_t m_dma0pg;
uint8_t m_p40, m_p4a, m_p50;
uint8_t m_kb_data, m_ppi_c, m_led_state;
bool m_e000;
bool m_kb_data_bit, m_kb_strobe, m_kb_clock;
uint16_t m_gate = 0;
uint8_t m_dma0pg = 0;
uint8_t m_p40 = 0, m_p4a = 0, m_p50 = 0;
uint8_t m_kb_data = 0, m_ppi_c = 0, m_led_state = 0;
bool m_e000 = false;
bool m_kb_data_bit = false, m_kb_strobe = false, m_kb_clock = false;
uint8_t m_mcu_p1, m_mcu_p2;
uint8_t m_mcuppi_a, m_mcuppi_b, m_mcuppi_c;
uint8_t m_mcu_p1 = 0, m_mcu_p2 = 0;
uint8_t m_mcuppi_a = 0, m_mcuppi_b = 0, m_mcuppi_c = 0;
void mcu_io_w(offs_t offset, uint8_t data);
uint8_t mcu_io_r(offs_t offset);
void mcuppi_c_w(uint8_t data);
bool m_floppy_intrq, m_floppy_idle;
uint8_t m_floppy_mcu_wrap;
struct { floppy_image_device *image; bool hdl; } m_floppy[2];
bool m_floppy_intrq = false, m_floppy_idle = false;
uint8_t m_floppy_mcu_wrap = 0;
struct { floppy_image_device *image = nullptr; bool hdl = false; } m_floppy[2];
required_shared_ptr<uint16_t> m_p_videoram;
required_device<ram_device> m_ram;

View File

@ -82,27 +82,27 @@ private:
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart2_load) { return load_cart(image, m_cart2); }
void pc_speaker_set_spkrdata(uint8_t data);
uint8_t m_pc_spkrdata;
uint8_t m_pit_out2;
uint8_t m_pcjr_dor;
uint8_t m_pcjx_1ff_count;
uint8_t m_pcjx_1ff_val;
uint8_t m_pcjx_1ff_bankval;
uint8_t m_pcjx_1ff_bank[20][2];
int m_ppi_portc_switch_high;
uint8_t m_ppi_portb;
uint8_t m_pc_spkrdata = 0;
uint8_t m_pit_out2 = 0;
uint8_t m_pcjr_dor = 0;
uint8_t m_pcjx_1ff_count = 0;
uint8_t m_pcjx_1ff_val = 0;
uint8_t m_pcjx_1ff_bankval = 0;
uint8_t m_pcjx_1ff_bank[20][2]{};
int m_ppi_portc_switch_high = 0;
uint8_t m_ppi_portb = 0;
uint8_t m_pc_keyb_data;
uint8_t m_transferring;
uint8_t m_latch;
uint32_t m_raw_keyb_data;
int m_signal_count;
uint8_t m_nmi_enabled;
uint8_t m_pc_keyb_data = 0;
uint8_t m_transferring = 0;
uint8_t m_latch = 0;
uint32_t m_raw_keyb_data = 0;
int m_signal_count = 0;
uint8_t m_nmi_enabled = 0;
virtual void device_timer(emu_timer &timer, device_timer_id id, int param) override;
emu_timer *m_pc_int_delay_timer;
emu_timer *m_pcjr_watchdog;
emu_timer *m_keyb_signal_timer;
emu_timer *m_pc_int_delay_timer = nullptr;
emu_timer *m_pcjr_watchdog = nullptr;
emu_timer *m_keyb_signal_timer = nullptr;
enum
{

View File

@ -84,17 +84,17 @@ private:
output_finder<> m_tilt_output;
output_finder<> m_start_output;
uint8_t m_digit; // scanlines from i8279
uint8_t m_sound_latch; // sound bus latch
uint8_t m_ay_ctrl; // ay controls line
uint8_t m_motors_ctrl; // motors control
int m_sint; // SINT line
int m_motenbl; // /MOTENBL line
int m_ball_gate_sw; // ball gate switch
uint8_t m_digit = 0; // scanlines from i8279
uint8_t m_sound_latch = 0; // sound bus latch
uint8_t m_ay_ctrl = 0; // ay controls line
uint8_t m_motors_ctrl = 0; // motors control
int m_sint = 0; // SINT line
int m_motenbl = 0; // /MOTENBL line
int m_ball_gate_sw = 0; // ball gate switch
// motors positions
int m_rmotor; // right motor position (0-100)
int m_lmotor; // left motor position (0-100)
int m_rmotor = 0; // right motor position (0-100)
int m_lmotor = 0; // left motor position (0-100)
TIMER_DEVICE_CALLBACK_MEMBER(icecold_sint_timer);
TIMER_DEVICE_CALLBACK_MEMBER(icecold_motors_timer);
void icecold_map(address_map &map);

View File

@ -107,13 +107,13 @@ private:
required_shared_ptr<uint8_t> m_fg_color_ram;
output_finder<7> m_leds;
tilemap_t *m_reel_tilemap[4];
tilemap_t *m_fg_tilemap;
int m_video_enable;
int m_nmi_enable;
int m_hopper;
uint8_t m_out[3];
uint8_t m_igs_magic[2];
tilemap_t *m_reel_tilemap[4]{};
tilemap_t *m_fg_tilemap = nullptr;
int m_video_enable = 0;
int m_nmi_enable = 0;
int m_hopper = 0;
uint8_t m_out[3]{};
uint8_t m_igs_magic[2]{};
};

View File

@ -410,7 +410,7 @@ protected:
virtual void device_reset() override;
private:
u8 m_val;
u8 m_val = 0;
};
void igs_incdec_device::reset_w(u8 data)

View File

@ -169,13 +169,13 @@ private:
required_device<palette_device> m_palette;
output_finder<> m_led;
output_finder<6> m_lamps;
int m_nmi_enable;
int m_bg_enable;
int m_hopper;
tilemap_t *m_fg_tilemap;
tilemap_t *m_bg_tilemap;
uint8_t m_out[3];
uint8_t m_protection_res;
int m_nmi_enable = 0;
int m_bg_enable = 0;
int m_hopper = 0;
tilemap_t *m_fg_tilemap = nullptr;
tilemap_t *m_bg_tilemap = nullptr;
uint8_t m_out[3]{};
uint8_t m_protection_res = 0;
};

View File

@ -60,7 +60,7 @@ protected:
required_device<eeprom_serial_93cxx_device> m_eeprom;
std::unique_ptr<uint32_t[]> m_dsp_ram;
required_device<light_video_device> m_light;
address_space *m_space;
address_space *m_space = nullptr;
};
class indigo3k_state : public indigo_state

View File

@ -151,8 +151,8 @@ protected:
optional_device<gio64_slot_device> m_gio64_exp0;
optional_device<gio64_slot_device> m_gio64_exp1;
uint8_t m_volume_l;
uint8_t m_volume_r;
uint8_t m_volume_l = 0;
uint8_t m_volume_r = 0;
};
class ip22_state : public ip24_state

View File

@ -49,8 +49,8 @@ private:
void sub_io(address_map &map);
void sub_map(address_map &map);
u8 m_port01;
bool m_clock_en;
u8 m_port01 = 0;
bool m_clock_en = false;
virtual void machine_start() override;
virtual void machine_reset() override;
required_device<cpu_device> m_maincpu;

View File

@ -358,11 +358,11 @@ protected:
virtual void machine_reset() override;
output_finder<> m_diag_led;
emu_timer *m_reset_timer;
emu_timer *m_reset_timer = nullptr;
u16 m_error;
u16 m_status;
u16 m_led;
u16 m_error = 0;
u16 m_status = 0;
u16 m_led = 0;
};
class emerald_state : public interpro_state
@ -427,8 +427,8 @@ protected:
virtual void machine_reset() override;
private:
u16 m_ctrl1;
u16 m_ctrl2;
u16 m_ctrl1 = 0;
u16 m_ctrl2 = 0;
};
class turquoise_state : public interpro_state
@ -497,8 +497,8 @@ protected:
virtual void machine_reset() override;
private:
u16 m_ctrl1;
u16 m_ctrl2;
u16 m_ctrl1 = 0;
u16 m_ctrl2 = 0;
};
class sapphire_state : public interpro_state
@ -562,8 +562,8 @@ protected:
virtual void machine_reset() override;
private:
u16 m_ctrl1;
u16 m_ctrl2;
u16 m_ctrl1 = 0;
u16 m_ctrl2 = 0;
};
class cbus_sapphire_state : public sapphire_state

View File

@ -163,7 +163,7 @@ private:
// driver_device overrides
virtual void video_start() override;
uint16_t m_vctl; // 0000 for normal, 0001 for flip, 0100 when going to change (blank?)
uint16_t m_vctl = 0; // 0000 for normal, 0001 for flip, 0100 when going to change (blank?)
};

View File

@ -42,9 +42,9 @@ private:
devcb_write_line m_out_irq_func;
u8 cmd, tx_data;
u32 ctrl;
u16 status;
u8 m_cmd = 0, m_tx_data = 0;
u32 m_ctrl = 0;
u16 m_status = 0;
};
DECLARE_DEVICE_TYPE(IPHONE2G_SPI, iphone2g_spi_device)
@ -56,20 +56,20 @@ void iphone2g_spi_device::device_timer(emu_timer &timer, device_timer_id id, int
void iphone2g_spi_device::map(address_map &map)
{
map(0x00,0x03).lrw32(NAME([this](offs_t offset){ return ctrl; }), NAME([this](offs_t offset, u32 data){
map(0x00,0x03).lrw32(NAME([this](offs_t offset){ return m_ctrl; }), NAME([this](offs_t offset, u32 data){
if(data & 1)
{
status |= 0xfff2;
cmd = tx_data;
m_status |= 0xfff2;
m_cmd = m_tx_data;
timer_set(attotime::from_hz(1'000), TIMER_SEND_IRQ);
}
ctrl = data;
m_ctrl = data;
}));
map(0x08, 0x09).lr16([this](offs_t offset){ return status; }, "status").umask32(0x0000ffff);
map(0x10, 0x10).lrw8(NAME([this](offs_t offset){ return tx_data; }), NAME([this](offs_t offset, u8 data){ tx_data = data; })).umask32(0x000000ff);
map(0x08, 0x09).lr16([this](offs_t offset){ return m_status; }, "status").umask32(0x0000ffff);
map(0x10, 0x10).lrw8(NAME([this](offs_t offset){ return m_tx_data; }), NAME([this](offs_t offset, u8 data){ m_tx_data = data; })).umask32(0x000000ff);
map(0x20, 0x20).lr8([this](offs_t offset){
// FIXME: make this less hacky
switch(cmd)
switch(m_cmd)
{
case 0x95: return 0x01;
case 0xda: return 0x71;
@ -95,15 +95,15 @@ void iphone2g_spi_device::device_resolve_objects()
void iphone2g_spi_device::device_start()
{
save_item(NAME(cmd));
save_item(NAME(ctrl));
save_item(NAME(tx_data));
save_item(NAME(status));
save_item(NAME(m_cmd));
save_item(NAME(m_ctrl));
save_item(NAME(m_tx_data));
save_item(NAME(m_status));
}
void iphone2g_spi_device::device_reset()
{
cmd = ctrl= status = tx_data = 0;
m_cmd = m_ctrl= m_status = m_tx_data = 0;
}
DEFINE_DEVICE_TYPE(IPHONE2G_SPI, iphone2g_spi_device, "iphone2g_spi", "iPhone 2G SPI controller")
@ -151,12 +151,12 @@ private:
struct timer
{
u16 config;
u8 state;
u32 count_buffer[2], count;
u16 config = 0;
u8 state = 0;
u32 count_buffer[2]{}, count = 0;
} timers[7];
u64 ticks;
//u64 m_ticks = 0; not used
};
DECLARE_DEVICE_TYPE(IPHONE2G_TIMER, iphone2g_timer_device)

View File

@ -63,12 +63,12 @@ private:
void io_map(address_map &map);
void mem_map(address_map &map);
bool m_sg1_line;
bool m_keypressed;
uint8_t m_keyboard_cnt;
uint8_t m_ppi_porta;
uint8_t m_ppi_portc;
emu_timer *m_key_timer;
bool m_sg1_line = false;
bool m_keypressed = false;
uint8_t m_keyboard_cnt = 0;
uint8_t m_ppi_porta = 0;
uint8_t m_ppi_portc = 0;
emu_timer *m_key_timer = nullptr;
void update_speaker();
void machine_start() override;
void machine_reset() override;

View File

@ -192,16 +192,16 @@ private:
required_device<istrebiteli_sound_device> m_sound_dev;
TILE_GET_INFO_MEMBER(get_tile_info);
tilemap_t *m_tilemap;
tilemap_t *m_tilemap = nullptr;
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t moto_screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint8_t coin_count;
uint8_t m_spr_ctrl[2];
uint8_t m_spr_collision[2];
uint8_t m_spr_xy[8];
uint8_t m_tileram[16];
uint8_t m_road_scroll;
uint8_t coin_count = 0;
uint8_t m_spr_ctrl[2]{};
uint8_t m_spr_collision[2]{};
uint8_t m_spr_xy[8]{};
uint8_t m_tileram[16]{};
uint8_t m_road_scroll = 0;
void io_map(address_map &map);
void mem_map(address_map &map);

View File

@ -82,9 +82,9 @@ protected:
private:
required_device<cpu_device> m_maincpu;
required_device<palette_device> m_palette;
int m_test_x;
int m_test_y;
int m_start_offs;
int m_test_x = 0;
int m_test_y = 0;
int m_start_offs = 0;
void itgambl2_palette(palette_device &palette) const;
uint32_t screen_update_itgambl2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);

View File

@ -66,9 +66,9 @@ protected:
virtual void video_start() override;
private:
int m_test_x;
int m_test_y;
int m_start_offs;
int m_test_x = 0;
int m_test_y = 0;
int m_start_offs = 0;
required_device<cpu_device> m_maincpu;
required_device<palette_device> m_palette;

View File

@ -282,11 +282,11 @@ private:
// shared pointers
required_shared_ptr<uint8_t> m_vram;
uint8_t m_kbdclk, m_kbdread, m_kbdport2;
uint8_t m_kbdclk = 0, m_kbdread = 0, m_kbdport2 = 0;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
floppy_image_device *m_curfloppy;
bool m_fdc_irq, m_fdc_drq, m_fdc_hld;
floppy_image_device *m_curfloppy = nullptr;
bool m_fdc_irq = false, m_fdc_drq = false, m_fdc_hld = false;
};
//**************************************************************************

View File

@ -38,7 +38,7 @@ private:
required_region_ptr<u8> m_chargen;
std::unique_ptr<u8[]> m_mainram;
bool m_rom_enabled;
bool m_rom_enabled = true;
};
void itt9216_state::machine_start()