From 6bc02301ae90b01babbbb416757428bda8557db9 Mon Sep 17 00:00:00 2001 From: Robbbert Date: Wed, 13 Apr 2022 16:00:34 +1000 Subject: init a few more vars in includes --- src/mame/drivers/cmi.cpp | 66 +++++++++---------- src/mame/includes/alesis.h | 6 +- src/mame/includes/amiga.h | 74 ++++++++++----------- src/mame/includes/beathead.h | 2 +- src/mame/includes/cave.h | 6 +- src/mame/includes/esripsys.h | 10 +-- src/mame/includes/galaxian.h | 40 +++++------ src/mame/includes/gottlieb.h | 2 +- src/mame/includes/hng64.h | 68 +++++++++---------- src/mame/includes/hp48.h | 2 +- src/mame/includes/kaneko16.h | 2 +- src/mame/includes/m92.h | 22 +++---- src/mame/includes/pc6001.h | 60 ++++++++--------- src/mame/includes/pc8001.h | 14 ++-- src/mame/includes/playch10.h | 56 ++++++++-------- src/mame/includes/thomson.h | 154 +++++++++++++++++++++---------------------- src/mame/includes/xbox_usb.h | 132 ++++++++++++++++++------------------- 17 files changed, 358 insertions(+), 358 deletions(-) diff --git a/src/mame/drivers/cmi.cpp b/src/mame/drivers/cmi.cpp index d1e253e27fc..3bdb97c515d 100644 --- a/src/mame/drivers/cmi.cpp +++ b/src/mame/drivers/cmi.cpp @@ -403,8 +403,8 @@ protected: required_device m_cpu1_periphs; required_device m_cpu2_periphs; - address_space *m_cpu1space; - address_space *m_cpu2space; + address_space *m_cpu1space = nullptr; + address_space *m_cpu2space = nullptr; private: emu_timer *m_map_switch_timer = nullptr; @@ -427,52 +427,52 @@ private: void fdc_dma_transfer(); // Q133 CPU Card - uint8_t *m_q133_rom; + uint8_t *m_q133_rom = nullptr; - uint16_t m_int_state[2]; - uint8_t m_lp_int; - uint8_t m_hp_int; + uint16_t m_int_state[2]{}; + uint8_t m_lp_int = 0; + uint8_t m_hp_int = 0; std::unique_ptr m_shared_ram; std::unique_ptr m_scratch_ram[2]; /* Memory management */ - uint8_t m_map_sel[16]; + uint8_t m_map_sel[16]{}; std::unique_ptr m_map_ram[2]; std::unique_ptr m_q256_ram[2]; - uint8_t m_map_ram_latch; - int m_cpu_active_space[2]; - int m_cpu_map_switch[2]; - uint8_t m_curr_mapinfo[2]; - uint8_t m_irq_address[2][2]; - int m_m6809_bs_hack_cnt[2]; + uint8_t m_map_ram_latch = 0; + int m_cpu_active_space[2]{}; + int m_cpu_map_switch[2]{}; + uint8_t m_curr_mapinfo[2]{}; + uint8_t m_irq_address[2][2]{}; + int m_m6809_bs_hack_cnt[2]{}; /* Q219 lightpen/graphics card */ std::unique_ptr m_video_ram; - uint16_t m_x_pos; - uint8_t m_y_pos; - uint16_t m_lp_x; - uint8_t m_lp_y; - uint8_t m_q219_b_touch; + uint16_t m_x_pos = 0; + uint8_t m_y_pos = 0; + uint16_t m_lp_x = 0; + uint8_t m_lp_y = 0; + uint8_t m_q219_b_touch = 0; /* QFC9 floppy disk controller card */ - uint8_t * m_qfc9_region_ptr; - int m_fdc_drq; - uint8_t m_fdc_addr; - uint8_t m_fdc_ctrl; - uint8_t m_fdc_status; - PAIR m_fdc_dma_addr; - PAIR m_fdc_dma_cnt; + uint8_t * m_qfc9_region_ptr = 0; + int m_fdc_drq = 0; + uint8_t m_fdc_addr = 0; + uint8_t m_fdc_ctrl = 0; + uint8_t m_fdc_status = 0; + PAIR m_fdc_dma_addr{}; + PAIR m_fdc_dma_cnt{}; /* CMI-07 */ - uint8_t m_cmi07_ctrl; - bool m_cmi07_base_enable[2]; - uint16_t m_cmi07_base_addr; + uint8_t m_cmi07_ctrl = 0; + bool m_cmi07_base_enable[2]{}; + uint16_t m_cmi07_base_addr = 0; - uint8_t m_msm5832_addr; + uint8_t m_msm5832_addr = 0; // Master card (CMI-02) - int m_cmi02_ptm_irq; - uint8_t m_cmi02_pia_chsel; + int m_cmi02_ptm_irq = 0; + uint8_t m_cmi02_pia_chsel = 0; }; /************************************** @@ -1356,7 +1356,7 @@ void cmi_state::dma_fdc_rom() /* Active low */ m_fdc_status &= ~FDC_STATUS_DRIVER_LOAD; - int i; + int i = 0; for (i = 0; i < NUM_Q256_CARDS; ++i) { p_info = m_map_ram[i][(map << PAGE_SHIFT) | page]; @@ -1452,7 +1452,7 @@ void cmi_state::fdc_dma_transfer() int cpu_page = (m_fdc_dma_addr.w.l & ~PAGE_MASK) / PAGE_SIZE; int phys_page = 0; - int i; + int i = 0; for (i = 0; i < NUM_Q256_CARDS; ++i) { phys_page = m_map_ram[i][(map << PAGE_SHIFT) | cpu_page]; diff --git a/src/mame/includes/alesis.h b/src/mame/includes/alesis.h index 44f3395d76a..d2978699fd2 100644 --- a/src/mame/includes/alesis.h +++ b/src/mame/includes/alesis.h @@ -156,9 +156,9 @@ protected: void sr16_mem(address_map &map); private: - uint8_t m_kb_matrix; - uint8_t m_leds; - uint8_t m_lcd_digits[5]; + uint8_t m_kb_matrix = 0; + uint8_t m_leds = 0; + uint8_t m_lcd_digits[5]{}; required_device m_lcdc; optional_device m_cassette; diff --git a/src/mame/includes/amiga.h b/src/mame/includes/amiga.h index 3234200de83..3261d856d4a 100644 --- a/src/mame/includes/amiga.h +++ b/src/mame/includes/amiga.h @@ -389,43 +389,43 @@ public: } /* sprite states */ - uint8_t m_sprite_comparitor_enable_mask; - uint8_t m_sprite_dma_reload_mask; - uint8_t m_sprite_dma_live_mask; - uint8_t m_sprite_ctl_written; - uint32_t m_sprite_shiftreg[8]; - uint8_t m_sprite_remain[8]; + uint8_t m_sprite_comparitor_enable_mask = 0; + uint8_t m_sprite_dma_reload_mask = 0; + uint8_t m_sprite_dma_live_mask = 0; + uint8_t m_sprite_ctl_written = 0; + uint32_t m_sprite_shiftreg[8]{}; + uint8_t m_sprite_remain[8]{}; /* copper states */ - uint32_t m_copper_pc; - uint8_t m_copper_waiting; - uint8_t m_copper_waitblit; - uint16_t m_copper_waitval; - uint16_t m_copper_waitmask; - uint16_t m_copper_pending_offset; - uint16_t m_copper_pending_data; - int m_wait_offset; + uint32_t m_copper_pc = 0; + uint8_t m_copper_waiting = 0; + uint8_t m_copper_waitblit = 0; + uint16_t m_copper_waitval = 0; + uint16_t m_copper_waitmask = 0; + uint16_t m_copper_pending_offset = 0; + uint16_t m_copper_pending_data = 0; + int m_wait_offset = 0; /* playfield states */ - int m_last_scanline; + int m_last_scanline = 0; rgb_t m_ham_color; /* misc states */ - uint16_t m_genlock_color; + uint16_t m_genlock_color = 0; /* separate 6 in-order bitplanes into 2 x 3-bit bitplanes in two nibbles */ // FIXME: we instantiate 256 entries so that it pleases AGA uint8_t m_separate_bitplanes[2][256]; /* aga */ - int m_aga_diwhigh_written; - rgb_t m_aga_palette[256]; - rgb_t m_aga_ehb_palette[32 + 32]; - uint64_t m_aga_bpldat[8]; - uint16_t m_aga_sprdata[8][4]; - uint16_t m_aga_sprdatb[8][4]; - int m_aga_sprite_fetched_words; - int m_aga_sprite_dma_used_words[8]; + int m_aga_diwhigh_written = 0; + rgb_t m_aga_palette[256]{}; + rgb_t m_aga_ehb_palette[32 + 32]{}; + uint64_t m_aga_bpldat[8]{}; + uint16_t m_aga_sprdata[8][4]{}; + uint16_t m_aga_sprdatb[8][4]{}; + int m_aga_sprite_fetched_words = 0; + int m_aga_sprite_dma_used_words[8]{}; DECLARE_VIDEO_START( amiga ); DECLARE_VIDEO_START( amiga_aga ); @@ -499,10 +499,10 @@ public: HBLANK = 186 }; - emu_timer *m_blitter_timer; + emu_timer *m_blitter_timer = nullptr; - uint16_t m_agnus_id; - uint16_t m_denise_id; + uint16_t m_agnus_id = 0; + uint16_t m_denise_id = 0; void blitter_setup(); @@ -610,10 +610,10 @@ protected: memory_array m_chip_ram; uint32_t m_chip_ram_mask; - int m_cia_0_irq; - int m_cia_1_irq; + int m_cia_0_irq = 0; + int m_cia_1_irq = 0; - uint16_t m_custom_regs[256]; + uint16_t m_custom_regs[256]{}; static const char *const s_custom_reg_names[0x100]; void ocs_map(address_map &map); @@ -705,9 +705,9 @@ private: int m_centronics_perror; int m_centronics_select; - emu_timer *m_irq_timer; - emu_timer *m_serial_timer; - emu_timer *m_scanline_timer; + emu_timer *m_irq_timer = nullptr; + emu_timer *m_serial_timer = nullptr; + emu_timer *m_scanline_timer = nullptr; bool m_gayle_reset; @@ -725,10 +725,10 @@ private: int m_tx_state; int m_rx_previous; - int m_rs232_dcd; - int m_rs232_dsr; - int m_rs232_ri; - int m_rs232_cts; + int m_rs232_dcd = 0; + int m_rs232_dsr = 0; + int m_rs232_ri = 0; + int m_rs232_cts = 0; void serial_adjust(); void serial_shift(); diff --git a/src/mame/includes/beathead.h b/src/mame/includes/beathead.h index f523151aa64..3c8c471631f 100644 --- a/src/mame/includes/beathead.h +++ b/src/mame/includes/beathead.h @@ -82,7 +82,7 @@ private: required_shared_ptr m_ram_base; required_region_ptr m_rom_base; - attotime m_hblank_offset{}; + attotime m_hblank_offset; uint8_t m_irq_line_state = 0U; uint8_t m_irq_enable[3]{}; diff --git a/src/mame/includes/cave.h b/src/mame/includes/cave.h index 29d57f8e454..46d9f015797 100644 --- a/src/mame/includes/cave.h +++ b/src/mame/includes/cave.h @@ -235,13 +235,13 @@ private: int line_offset_zbuf = 0; } m_blit; - std::unique_ptr m_sprite[4]{}; + std::unique_ptr m_sprite[4]; sprite_cave *m_sprite_table[4][MAX_PRIORITY][MAX_SPRITE_NUM + 1]{}; - bitmap_ind16 m_sprite_zbuf[4]{}; + bitmap_ind16 m_sprite_zbuf[4]; u16 m_sprite_zbuf_baseval = 0U; - std::unique_ptr m_sprite_gfx[4]{}; + std::unique_ptr m_sprite_gfx[4]; offs_t m_sprite_gfx_mask[4]{}; int m_num_sprites[4]{}; diff --git a/src/mame/includes/esripsys.h b/src/mame/includes/esripsys.h index ececa7ae38a..844bd2ec229 100644 --- a/src/mame/includes/esripsys.h +++ b/src/mame/includes/esripsys.h @@ -69,7 +69,7 @@ private: int m_io_firq_status = 0; uint8_t m_cmos_ram_a2_0 = 0U; uint8_t m_cmos_ram_a10_3 = 0U; - std::unique_ptr m_cmos_ram{}; + std::unique_ptr m_cmos_ram; uint8_t m_u56a = 0U; uint8_t m_u56b = 0U; uint8_t m_g_to_s_latch1 = 0U; @@ -78,8 +78,8 @@ private: uint8_t m_s_to_g_latch2 = 0U; uint8_t m_dac_msb = 0U; uint8_t m_tms_data = 0U; - std::unique_ptr m_fdt_a{}; - std::unique_ptr m_fdt_b{}; + std::unique_ptr m_fdt_a; + std::unique_ptr m_fdt_b; struct line_buffer_t { @@ -98,8 +98,8 @@ private: int m_video_firq_en = 0; emu_timer *m_hblank_end_timer = nullptr; emu_timer *m_hblank_start_timer = nullptr; - std::unique_ptr m_fig_scale_table{}; - std::unique_ptr m_scale_table{}; + std::unique_ptr m_fig_scale_table; + std::unique_ptr m_scale_table; int m_video_firq = 0; uint8_t m_bg_intensity = 0; void uart_w(offs_t offset, uint8_t data); diff --git a/src/mame/includes/galaxian.h b/src/mame/includes/galaxian.h index e986578c226..26292f4eb8f 100644 --- a/src/mame/includes/galaxian.h +++ b/src/mame/includes/galaxian.h @@ -414,10 +414,10 @@ protected: int m_bullets_base = 0x60; int m_sprites_base = 0x40; int m_numspritegens = 1; - uint16_t m_protection_state; - uint8_t m_protection_result; - uint8_t m_konami_sound_control; - uint8_t m_irq_enabled; + uint16_t m_protection_state = 0; + uint8_t m_protection_result = 0; + uint8_t m_konami_sound_control = 0; + uint8_t m_irq_enabled = 0; int m_irq_line = INPUT_LINE_NMI; bool m_frogger_adjust = false; uint8_t m_x_scale = GALAXIAN_XSCALE; @@ -429,21 +429,21 @@ protected: draw_bullet_delegate m_draw_bullet_ptr; draw_background_delegate m_draw_background_ptr; - tilemap_t *m_bg_tilemap; - uint8_t m_flipscreen_x; - uint8_t m_flipscreen_y; - uint8_t m_background_enable; - uint8_t m_background_red; - uint8_t m_background_green; - uint8_t m_background_blue; - uint32_t m_star_rng_origin; - uint32_t m_star_rng_origin_frame; + tilemap_t *m_bg_tilemap = nullptr; + uint8_t m_flipscreen_x = 0; + uint8_t m_flipscreen_y = 0; + uint8_t m_background_enable = 0; + uint8_t m_background_red = 0; + uint8_t m_background_green = 0; + uint8_t m_background_blue = 0; + uint32_t m_star_rng_origin = 0; + uint32_t m_star_rng_origin_frame = 0; rgb_t m_star_color[64]; std::unique_ptr m_stars; - uint8_t m_stars_enabled; - uint8_t m_stars_blink_state; + uint8_t m_stars_enabled = 0; + uint8_t m_stars_blink_state = 0; rgb_t m_bullet_color[8]; - uint8_t m_gfxbank[5]; + uint8_t m_gfxbank[5]{}; uint8_t m_leftspriteclip = 16; }; @@ -610,8 +610,8 @@ private: required_device m_dac; required_ioport m_mux_port; - uint8_t m_speech_dip; - uint8_t m_sound; + uint8_t m_speech_dip = 0; + uint8_t m_sound = 0; }; @@ -672,7 +672,7 @@ private: required_ioport_array<10> m_game_dsw; required_memory_bank m_mainbank; - uint8_t m_current_game; + uint8_t m_current_game = 0; }; @@ -904,7 +904,7 @@ private: required_device m_sp0250; required_memory_bank m_soundbank; - uint8_t m_p2; + uint8_t m_p2 = 0; }; diff --git a/src/mame/includes/gottlieb.h b/src/mame/includes/gottlieb.h index 576f6e4b360..dc4c7122361 100644 --- a/src/mame/includes/gottlieb.h +++ b/src/mame/includes/gottlieb.h @@ -157,7 +157,7 @@ private: u8 m_laserdisc_select = 0U; u8 m_laserdisc_status = 0U; uint16_t m_laserdisc_philips_code = 0U; - std::unique_ptr m_laserdisc_audio_buffer{}; + std::unique_ptr m_laserdisc_audio_buffer; uint16_t m_laserdisc_audio_address = 0U; int16_t m_laserdisc_last_samples[2]{}; attotime m_laserdisc_last_time; diff --git a/src/mame/includes/hng64.h b/src/mame/includes/hng64.h index a67fa56c3f1..1a4be231e91 100644 --- a/src/mame/includes/hng64.h +++ b/src/mame/includes/hng64.h @@ -25,37 +25,37 @@ struct polyVert { - float worldCoords[4]; // World space coordinates (X Y Z 1.0) + float worldCoords[4]{}; // World space coordinates (X Y Z 1.0) - float texCoords[4]; // Texture coordinates (U V 0 1.0) -> OpenGL style... + float texCoords[4]{}; // Texture coordinates (U V 0 1.0) -> OpenGL style... - float normal[4]; // Normal (X Y Z 1.0) - float clipCoords[4]; // Homogeneous screen space coordinates (X Y Z W) + float normal[4]{}; // Normal (X Y Z 1.0) + float clipCoords[4]{}; // Homogeneous screen space coordinates (X Y Z W) - float light[3]; // The intensity of the illumination at this point + float light[3]{}; // The intensity of the illumination at this point - uint16_t colorIndex; // Flat shaded polygons, no texture, no lighting + uint16_t colorIndex = 0; // Flat shaded polygons, no texture, no lighting }; struct polygon { - int n; // Number of sides - polyVert vert[10]; // Vertices (maximum number per polygon is 10 -> 3+6) + int n = 0; // Number of sides + polyVert vert[10]{}; // Vertices (maximum number per polygon is 10 -> 3+6) - float faceNormal[4]; // Normal of the face overall - for calculating visibility and flat-shading... - bool visible; // Polygon visibility in scene - bool flatShade; // Flat shaded polygon, no texture, no lighting + float faceNormal[4]{}; // Normal of the face overall - for calculating visibility and flat-shading... + bool visible = false; // Polygon visibility in scene + bool flatShade = false; // Flat shaded polygon, no texture, no lighting - uint8_t texIndex; // Which texture to draw from (0x00-0x0f) - uint8_t texType; // How to index into the texture - uint8_t texPageSmall; // Does this polygon use 'small' texture pages? - uint8_t texPageHorizOffset; // If it does use small texture pages, how far is this page horizontally offset? - uint8_t texPageVertOffset; // If it does use small texture pages, how far is this page vertically offset? + uint8_t texIndex = 0; // Which texture to draw from (0x00-0x0f) + uint8_t texType = 0; // How to index into the texture + uint8_t texPageSmall = 0; // Does this polygon use 'small' texture pages? + uint8_t texPageHorizOffset = 0; // If it does use small texture pages, how far is this page horizontally offset? + uint8_t texPageVertOffset = 0; // If it does use small texture pages, how far is this page vertically offset? - uint32_t palOffset; // The base offset where this object's palette starts. - uint32_t palPageSize; // The size of the palette page that is being pointed to. + uint32_t palOffset = 0; // The base offset where this object's palette starts. + uint32_t palPageSize = 0; // The size of the palette page that is being pointed to. - uint32_t debugColor; // Will go away someday. Used to explicitly color polygons for debugging. + uint32_t debugColor = 0; // Will go away someday. Used to explicitly color polygons for debugging. }; @@ -82,14 +82,14 @@ typedef frustum_clip_vertex hng64_clip_vertex; struct hng64_poly_data { - uint8_t texType; - uint8_t texIndex; - uint8_t texPageSmall; - uint8_t texPageHorizOffset; - uint8_t texPageVertOffset; - int palOffset; - int palPageSize; - int debugColor; + uint8_t texType = 0; + uint8_t texIndex = 0; + uint8_t texPageSmall = 0; + uint8_t texPageHorizOffset = 0; + uint8_t texPageVertOffset = 0; + int palOffset = 0; + int palPageSize = 0; + int debugColor = 0; }; class hng64_state; @@ -209,12 +209,12 @@ private: struct blit_parameters { - bitmap_rgb32 * bitmap; + bitmap_rgb32 * bitmap = nullptr; rectangle cliprect; - uint32_t tilemap_priority_code; - uint8_t mask; - uint8_t value; - uint8_t alpha; + uint32_t tilemap_priority_code = 0; + uint8_t mask = 0; + uint8_t value = 0; + uint8_t alpha = 0; hng64trans_t drawformat; }; @@ -498,8 +498,8 @@ private: void main_sound_comms_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); uint16_t sound_comms_r(offs_t offset); void sound_comms_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - uint16_t main_latch[2]; - uint16_t sound_latch[2]; + uint16_t main_latch[2]{}; + uint16_t sound_latch[2]{}; void hng64_audio(machine_config &config); void hng64_network(machine_config &config); void hng_comm_io_map(address_map &map); diff --git a/src/mame/includes/hp48.h b/src/mame/includes/hp48.h index 309991e1680..b30694c1b2a 100644 --- a/src/mame/includes/hp48.h +++ b/src/mame/includes/hp48.h @@ -142,7 +142,7 @@ private: uint8_t *m_videoram = nullptr; uint8_t m_io[64]{}; - hp48_models m_model{}; + hp48_models m_model; /* OUT register from SATURN (actually 12-bit) */ uint16_t m_out = 0U; diff --git a/src/mame/includes/kaneko16.h b/src/mame/includes/kaneko16.h index a107e3c3182..e977e790245 100644 --- a/src/mame/includes/kaneko16.h +++ b/src/mame/includes/kaneko16.h @@ -201,7 +201,7 @@ private: optional_shared_ptr m_bg15_scroll; required_device m_bgpalette; - bitmap_ind16 m_bg15_bitmap[32]{}; + bitmap_ind16 m_bg15_bitmap[32]; u8 bg15_select_r(); void bg15_select_w(u8 data); diff --git a/src/mame/includes/m92.h b/src/mame/includes/m92.h index 93c1fa89d95..aaa13052a60 100644 --- a/src/mame/includes/m92.h +++ b/src/mame/includes/m92.h @@ -21,10 +21,10 @@ struct M92_pf_layer_info { - tilemap_t * tmap; - tilemap_t * wide_tmap; - uint16_t vram_base; - uint16_t control[4]; + tilemap_t * tmap = nullptr; + tilemap_t * wide_tmap = nullptr; + uint16_t vram_base = 0; + uint16_t control[4]{}; }; class m92_state : public driver_device @@ -89,14 +89,14 @@ private: optional_memory_bank m_mainbank; required_ioport m_dsw; - emu_timer *m_spritebuffer_timer; - uint32_t m_raster_irq_position; - uint16_t m_videocontrol; - uint8_t m_sprite_buffer_busy; + emu_timer *m_spritebuffer_timer = nullptr; + uint32_t m_raster_irq_position = 0; + uint16_t m_videocontrol = 0; + uint8_t m_sprite_buffer_busy = 0; M92_pf_layer_info m_pf_layer[3]; - uint16_t m_pf_master_control[4]; - int32_t m_sprite_list; - uint8_t m_palette_bank; + uint16_t m_pf_master_control[4]{}; + int32_t m_sprite_list = 0; + uint8_t m_palette_bank = 0; std::vector m_paletteram; void coincounter_w(uint8_t data); diff --git a/src/mame/includes/pc6001.h b/src/mame/includes/pc6001.h index cad9989c6c3..d2c67a80768 100644 --- a/src/mame/includes/pc6001.h +++ b/src/mame/includes/pc6001.h @@ -98,9 +98,9 @@ protected: optional_memory_bank m_bank1; required_device m_palette; - memory_region *m_cart_rom; - uint8_t m_timer_irq_vector; - uint16_t m_timer_hz_div; + memory_region *m_cart_rom = nullptr; + uint8_t m_timer_irq_vector = 0; + uint16_t m_timer_hz_div = 0; virtual void machine_start() override; virtual void machine_reset() override; @@ -131,26 +131,26 @@ protected: void draw_border(bitmap_ind16 &bitmap,const rectangle &cliprect,int attr,int has_mc6847); void pc6001_screen_draw(bitmap_ind16 &bitmap,const rectangle &cliprect, int has_mc6847); - emu_timer *m_timer_irq_timer; - uint8_t *m_video_base; + emu_timer *m_timer_irq_timer = nullptr; + uint8_t *m_video_base = nullptr; std::unique_ptr m_video_ram; - uint8_t m_cas_switch; - uint8_t m_sys_latch; - uint32_t m_cas_offset; - uint32_t m_cas_maxsize; - uint8_t m_bank_opt; - bool m_timer_enable; - bool m_timer_irq_mask; - uint8_t m_port_c_8255; - uint8_t m_cur_keycode; + uint8_t m_cas_switch = 0; + uint8_t m_sys_latch = 0; + uint32_t m_cas_offset = 0; + uint32_t m_cas_maxsize = 0; + uint8_t m_bank_opt = 0; + bool m_timer_enable = false; + bool m_timer_irq_mask = false; + uint8_t m_port_c_8255 = 0; + uint8_t m_cur_keycode = 0; private: - uint32_t m_old_key1; - uint32_t m_old_key2; - uint32_t m_old_key3; + uint32_t m_old_key1 = 0; + uint32_t m_old_key2 = 0; + uint32_t m_old_key3 = 0; u8 m_old_key_fn; - emu_timer *m_sub_trig_timer; + emu_timer *m_sub_trig_timer = nullptr; // IRQ model protected: @@ -177,8 +177,8 @@ protected: virtual u8 get_timer_base_divider(); private: - u8 m_irq_pending; - u8 m_sub_vector; + u8 m_irq_pending = 0; + u8 m_sub_vector = 0; }; @@ -228,8 +228,8 @@ protected: void pc6001mk2_map(address_map &map); void pc6001mk2_io(address_map &map); - uint8_t m_bgcol_bank; - uint8_t m_gfx_bank_on; + uint8_t m_bgcol_bank = 0; + uint8_t m_gfx_bank_on = 0; optional_memory_bank m_bank2; optional_memory_bank m_bank3; optional_memory_bank m_bank4; @@ -245,14 +245,14 @@ protected: virtual u8 vrtc_ack() override; private: - uint8_t m_bank_r0; - uint8_t m_bank_r1; - uint8_t m_bank_w; - uint8_t m_ex_vram_bank; - uint8_t m_exgfx_text_mode; - uint32_t m_cgrom_bank_addr; - uint8_t m_exgfx_bitmap_mode; - uint8_t m_exgfx_2bpp_mode; + uint8_t m_bank_r0 = 0; + uint8_t m_bank_r1 = 0; + uint8_t m_bank_w = 0; + uint8_t m_ex_vram_bank = 0; + uint8_t m_exgfx_text_mode = 0; + uint32_t m_cgrom_bank_addr = 0; + uint8_t m_exgfx_bitmap_mode = 0; + uint8_t m_exgfx_2bpp_mode = 0; void vram_bank_change(uint8_t vram_bank); }; diff --git a/src/mame/includes/pc8001.h b/src/mame/includes/pc8001.h index cd5aa3f0adb..943204c8648 100644 --- a/src/mame/includes/pc8001.h +++ b/src/mame/includes/pc8001.h @@ -62,12 +62,12 @@ protected: uint8_t dma_mem_r(offs_t offset); private: - bool m_screen_reverse; - bool m_screen_is_24KHz; + bool m_screen_reverse = false; + bool m_screen_is_24KHz = false; /* video state */ - int m_width80; - int m_color; + int m_width80 = 0; + int m_color = 0; }; class pc8001_state : public pc8001_base_state @@ -110,8 +110,8 @@ private: uint8_t port40_r(); void port40_w(uint8_t data); - int m_centronics_busy; - int m_centronics_ack; + int m_centronics_busy = 0; + int m_centronics_ack = 0; DECLARE_WRITE_LINE_MEMBER(write_centronics_busy); DECLARE_WRITE_LINE_MEMBER(write_centronics_ack); @@ -159,7 +159,7 @@ private: u8 port71_r(); void port71_w(u8 data); - u8 m_n80sr_bank; + u8 m_n80sr_bank = 0; }; #endif diff --git a/src/mame/includes/playch10.h b/src/mame/includes/playch10.h index c5cda00572a..58fc37bba6f 100644 --- a/src/mame/includes/playch10.h +++ b/src/mame/includes/playch10.h @@ -121,8 +121,8 @@ private: struct chr_bank { - int writable; // 1 for RAM, 0 for ROM - uint8_t* chr; // direct access to the memory + int writable = 0; // 1 for RAM, 0 for ROM + uint8_t* chr = nullptr; // direct access to the memory }; void playch10_palette(palette_device &palette) const; @@ -159,39 +159,39 @@ private: void prg8(int slot, int bank); memory_bank_array_creator<4> m_prg_banks; memory_view m_prg_view; - int m_prg_chunks; + int m_prg_chunks = 0; optional_memory_region m_vrom_region; output_finder<4> m_timedigits; - int m_up_8w; - int m_pc10_nmi_enable; - int m_pc10_dog_di; - int m_pc10_sdcs; - int m_pc10_dispmask; - int m_pc10_int_detect; - int m_pc10_game_mode; - int m_pc10_dispmask_old; - int m_pc10_gun_controller; - int m_cart_sel; - int m_cntrl_mask; - int m_input_latch[2]; - int m_mirroring; - int m_MMC2_bank[4]; - int m_MMC2_bank_latch[2]; - uint8_t* m_vrom; + int m_up_8w = 0; + int m_pc10_nmi_enable = 0; + int m_pc10_dog_di = 0; + int m_pc10_sdcs = 0; + int m_pc10_dispmask = 0; + int m_pc10_int_detect = 0; + int m_pc10_game_mode = 0; + int m_pc10_dispmask_old = 0; + int m_pc10_gun_controller = 0; + int m_cart_sel = 0; + int m_cntrl_mask = 0; + int m_input_latch[2]{}; + int m_mirroring = 0; + int m_MMC2_bank[4]{}; + int m_MMC2_bank_latch[2]{}; + uint8_t* m_vrom = nullptr; std::unique_ptr m_vram; chr_bank m_chr_page[8]; - int m_mmc1_shiftreg; - int m_mmc1_shiftcount; - int m_gboard_banks[2]; - int m_gboard_command; - int m_IRQ_count; - uint8_t m_IRQ_count_latch; - int m_IRQ_enable; - int m_pc10_bios; - tilemap_t *m_bg_tilemap; + int m_mmc1_shiftreg = 0; + int m_mmc1_shiftcount = 0; + int m_gboard_banks[2]{}; + int m_gboard_command = 0; + int m_IRQ_count = 0; + uint8_t m_IRQ_count_latch = 0; + int m_IRQ_enable = 0; + int m_pc10_bios = 0; + tilemap_t *m_bg_tilemap = nullptr; }; #endif // MAME_INCLUDES_PLAYCH10_H diff --git a/src/mame/includes/thomson.h b/src/mame/includes/thomson.h index 150de02dadb..a949ada1547 100644 --- a/src/mame/includes/thomson.h +++ b/src/mame/includes/thomson.h @@ -178,8 +178,8 @@ public: void mode80_to9_scandraw_8( uint8_t* vram, uint16_t* dst, uint16_t* pal, int org, int len ); protected: - emu_timer* m_mo5_periodic_timer; - uint8_t m_mo5_reg_cart; /* 0xa7cb bank switch */ + emu_timer* m_mo5_periodic_timer = nullptr; + uint8_t m_mo5_reg_cart = 0; /* 0xa7cb bank switch */ virtual void video_start() override; @@ -242,7 +242,7 @@ protected: void thom_palette(palette_device &palette); int m_centronics_busy = 0; - int m_centronics_perror; + int m_centronics_perror = 0; void to7_map(address_map &map); void to770_map(address_map &map); @@ -284,75 +284,75 @@ protected: output_finder<> m_caps_led; /* bank logging and optimisations */ - int m_old_cart_bank; - int m_old_cart_bank_was_read_only; - int m_old_ram_bank; + int m_old_cart_bank = 0; + int m_old_cart_bank_was_read_only = 0; + int m_old_ram_bank = 0; /* buffer storing demodulated bits, only for k7 and with speed hack */ - uint32_t m_to7_k7_bitsize; - uint8_t* m_to7_k7_bits; + uint32_t m_to7_k7_bitsize = 0; + uint8_t* m_to7_k7_bits = 0; /* ------------ cartridge ------------ */ - uint8_t m_thom_cart_nb_banks; /* number of 16 KB banks (up to 4) */ - uint8_t m_thom_cart_bank; /* current bank */ - uint8_t m_to7_lightpen_step; - uint8_t m_to7_lightpen; - uint8_t m_to7_modem_tx; + uint8_t m_thom_cart_nb_banks = 0; /* number of 16 KB banks (up to 4) */ + uint8_t m_thom_cart_bank = 0; /* current bank */ + uint8_t m_to7_lightpen_step = 0; + uint8_t m_to7_lightpen = 0; + uint8_t m_to7_modem_tx = 0; /* calls to7_game_update_cb periodically */ - emu_timer* m_to7_game_timer; - uint8_t m_to7_game_sound; - uint8_t m_to7_game_mute; + emu_timer* m_to7_game_timer = nullptr; + uint8_t m_to7_game_sound = 0; + uint8_t m_to7_game_mute = 0; /* We allow choosing dynamically: - the border size - whether we use 640 pixels or 320 pixels in an active row (now this is automatically chosen by default for each frame) */ - uint16_t m_thom_bwidth; - uint16_t m_thom_bheight; + uint16_t m_thom_bwidth = 0; + uint16_t m_thom_bheight = 0; /* border size */ - uint8_t m_thom_hires; + uint8_t m_thom_hires = 0; /* 0 = low res: 320x200 active area (faster) 1 = hi res: 640x200 active area (can represent all video modes) */ - uint8_t m_thom_hires_better; + uint8_t m_thom_hires_better = 0; /* 1 = a 640 mode was used in the last frame */ /* we use our own video timing to precisely cope with VBLANK and HBLANK */ - emu_timer* m_thom_video_timer; /* time elapsed from beginning of frame */ + emu_timer* m_thom_video_timer = nullptr; /* time elapsed from beginning of frame */ /* number of lightpen call-backs per frame */ - int m_thom_lightpen_nb; + int m_thom_lightpen_nb = 0; /* called thom_lightpen_nb times */ - emu_timer *m_thom_lightpen_timer; + emu_timer *m_thom_lightpen_timer = nullptr; /* lightpen callback function to call from timer */ std::function m_thom_lightpen_cb; - uint8_t* m_thom_vram; /* pointer to video memory */ - emu_timer* m_thom_scanline_timer; /* scan-line update */ - uint16_t m_thom_last_pal[16]; /* palette at last scanline start */ - uint16_t m_thom_pal[16]; /* current palette */ - bool m_thom_pal_changed; /* whether pal != old_pal */ - uint8_t m_thom_border_index; /* current border color index */ + uint8_t* m_thom_vram = nullptr; /* pointer to video memory */ + emu_timer* m_thom_scanline_timer = nullptr; /* scan-line update */ + uint16_t m_thom_last_pal[16]{}; /* palette at last scanline start */ + uint16_t m_thom_pal[16]{}; /* current palette */ + bool m_thom_pal_changed = false; /* whether pal != old_pal */ + uint8_t m_thom_border_index = 0; /* current border color index */ /* the left and right border color for each row (including top and bottom border rows); -1 means unchanged wrt last scanline */ - int16_t m_thom_border_l[THOM_TOTAL_HEIGHT+1]; - int16_t m_thom_border_r[THOM_TOTAL_HEIGHT+1]; + int16_t m_thom_border_l[THOM_TOTAL_HEIGHT+1]{}; + int16_t m_thom_border_r[THOM_TOTAL_HEIGHT+1]{}; /* active area, updated one scan-line at a time every 64us, then blitted in screen_update */ - uint16_t m_thom_vbody[640*200]; - uint8_t m_thom_vmode; /* current vide mode */ - uint8_t m_thom_vpage; /* current video page */ + uint16_t m_thom_vbody[640*200]{}; + uint8_t m_thom_vmode = 0; /* current vide mode */ + uint8_t m_thom_vpage = 0; /* current video page */ /* this stores the video mode & page at each GPL in the current line (-1 means unchanged) */ - int16_t m_thom_vmodepage[41]; - uint8_t m_thom_vmodepage_changed; + int16_t m_thom_vmodepage[41]{}; + uint8_t m_thom_vmodepage_changed = 0; /* one dirty flag for each video memory line */ - bool m_thom_vmem_dirty[205]; + bool m_thom_vmem_dirty[205]{}; /* set to 1 if undirty scanlines need to be redrawn due to other video state changes */ - bool m_thom_vstate_dirty; - bool m_thom_vstate_last_dirty; - uint32_t m_thom_mode_point; - emu_timer *m_thom_init_timer; + bool m_thom_vstate_dirty = false; + bool m_thom_vstate_last_dirty = false; + uint32_t m_thom_mode_point = 0; + emu_timer *m_thom_init_timer = nullptr; void (thomson_state::*m_thom_init_cb)( int init ); int to7_get_cassette(); @@ -452,24 +452,24 @@ protected: optional_memory_bank m_datahibank; optional_memory_bank m_biosbank; - uint8_t m_to8_kbd_ack; /* 1 = cpu inits / accepts transfers */ - uint16_t m_to8_kbd_data; /* data to transmit */ - uint16_t m_to8_kbd_step; /* transmission automaton state */ - uint8_t m_to8_kbd_last_key; /* last key (for repetition) */ - uint32_t m_to8_kbd_key_count; /* keypress time (for repetition) */ - uint8_t m_to8_kbd_caps; /* caps lock */ - emu_timer* m_to8_kbd_timer; /* bit-send */ - emu_timer* m_to8_kbd_signal; /* signal from CPU */ - uint8_t m_to8_data_vpage; - uint8_t m_to8_cart_vpage; - uint8_t m_to8_reg_ram; - uint8_t m_to8_reg_cart; - uint8_t m_to8_reg_sys1; - uint8_t m_to8_reg_sys2; - uint8_t m_to8_lightpen_intr; - uint8_t m_to8_soft_select; - uint8_t m_to8_soft_bank; - uint8_t m_to8_bios_bank; + uint8_t m_to8_kbd_ack = 0; /* 1 = cpu inits / accepts transfers */ + uint16_t m_to8_kbd_data = 0; /* data to transmit */ + uint16_t m_to8_kbd_step = 0; /* transmission automaton state */ + uint8_t m_to8_kbd_last_key = 0; /* last key (for repetition) */ + uint32_t m_to8_kbd_key_count = 0; /* keypress time (for repetition) */ + uint8_t m_to8_kbd_caps = 0; /* caps lock */ + emu_timer* m_to8_kbd_timer = nullptr; /* bit-send */ + emu_timer* m_to8_kbd_signal = nullptr; /* signal from CPU */ + uint8_t m_to8_data_vpage = 0; + uint8_t m_to8_cart_vpage = 0; + uint8_t m_to8_reg_ram = 0; + uint8_t m_to8_reg_cart = 0; + uint8_t m_to8_reg_sys1 = 0; + uint8_t m_to8_reg_sys2 = 0; + uint8_t m_to8_lightpen_intr = 0; + uint8_t m_to8_soft_select = 0; + uint8_t m_to8_soft_bank = 0; + uint8_t m_to8_bios_bank = 0; TIMER_CALLBACK_MEMBER( to8_kbd_timer_cb ); void to8_update_ram_bank_postload(); @@ -534,23 +534,23 @@ protected: void to9_map(address_map &map); void to9p_map(address_map &map); - uint8_t m_to9_palette_data[32]; - uint8_t m_to9_palette_idx; - uint8_t m_to9_soft_bank; - uint8_t m_to9_kbd_parity; /* 0=even, 1=odd, 2=no parity */ - uint8_t m_to9_kbd_intr; /* interrupt mode */ - uint8_t m_to9_kbd_in; /* data from keyboard */ - uint8_t m_to9_kbd_status; /* status */ - uint8_t m_to9_kbd_overrun; /* character lost */ - uint8_t m_to9_kbd_periph; /* peripheral mode */ - uint8_t m_to9_kbd_byte_count; /* byte-count in peripheral mode */ - uint16_t m_to9_mouse_x; - uint16_t m_to9_mouse_y; - uint8_t m_to9_kbd_last_key; /* for key repetition */ - uint16_t m_to9_kbd_key_count; - uint8_t m_to9_kbd_caps; /* caps-lock */ - uint8_t m_to9_kbd_pad; /* keypad outputs special codes */ - emu_timer* m_to9_kbd_timer; + uint8_t m_to9_palette_data[32]{}; + uint8_t m_to9_palette_idx = 0; + uint8_t m_to9_soft_bank = 0; + uint8_t m_to9_kbd_parity = 0; /* 0=even, 1=odd, 2=no parity */ + uint8_t m_to9_kbd_intr = 0; /* interrupt mode */ + uint8_t m_to9_kbd_in = 0; /* data from keyboard */ + uint8_t m_to9_kbd_status = 0; /* status */ + uint8_t m_to9_kbd_overrun = 0; /* character lost */ + uint8_t m_to9_kbd_periph = 0; /* peripheral mode */ + uint8_t m_to9_kbd_byte_count = 0; /* byte-count in peripheral mode */ + uint16_t m_to9_mouse_x = 0; + uint16_t m_to9_mouse_y = 0; + uint8_t m_to9_kbd_last_key = 0; /* for key repetition */ + uint16_t m_to9_kbd_key_count = 0; + uint8_t m_to9_kbd_caps = 0; /* caps-lock */ + uint8_t m_to9_kbd_pad = 0; /* keypad outputs special codes */ + emu_timer* m_to9_kbd_timer = nullptr; void to9_set_video_mode( uint8_t data, int style ); void to9_palette_init(); @@ -709,7 +709,7 @@ protected: private: required_device m_pia_io; required_device m_rs232; - int m_last_low; + int m_last_low = 0; int m_centronics_busy = 0; int m_rxd = 0; int m_cts = 0; diff --git a/src/mame/includes/xbox_usb.h b/src/mame/includes/xbox_usb.h index 27b6c4262c5..bcf44703cbc 100644 --- a/src/mame/includes/xbox_usb.h +++ b/src/mame/includes/xbox_usb.h @@ -11,45 +11,45 @@ struct OHCIEndpointDescriptor { - int mps; // MaximumPacketSize - int f; // Format - int k; // sKip - int s; // Speed - int d; // Direction - int en; // EndpointNumber - int fa; // FunctionAddress - uint32_t tailp; // TDQueueTailPointer - uint32_t headp; // TDQueueHeadPointer - uint32_t nexted; // NextED - int c; // toggleCarry - int h; // Halted - uint32_t word0; + int mps = 0; // MaximumPacketSize + int f = 0; // Format + int k = 0; // sKip + int s = 0; // Speed + int d = 0; // Direction + int en = 0; // EndpointNumber + int fa = 0; // FunctionAddress + uint32_t tailp = 0; // TDQueueTailPointer + uint32_t headp = 0; // TDQueueHeadPointer + uint32_t nexted = 0; // NextED + int c = 0; // toggleCarry + int h = 0; // Halted + uint32_t word0 = 0; }; struct OHCITransferDescriptor { - int cc; // ConditionCode - int ec; // ErrorCount - int t; // DataToggle - int di; // DelayInterrupt - int dp; // Direction/PID - int r; // bufferRounding - uint32_t cbp; // CurrentBufferPointer - uint32_t nexttd; // NextTD - uint32_t be; // BufferEnd - uint32_t word0; + int cc = 0; // ConditionCode + int ec = 0; // ErrorCount + int t = 0; // DataToggle + int di = 0; // DelayInterrupt + int dp = 0; // Direction/PID + int r = 0; // bufferRounding + uint32_t cbp = 0; // CurrentBufferPointer + uint32_t nexttd = 0; // NextTD + uint32_t be = 0; // BufferEnd + uint32_t word0 = 0; }; struct OHCIIsochronousTransferDescriptor { - int cc; // ConditionCode - int fc; // FrameCount - int di; // DelayInterrupt - int sf; // StartingFrame - uint32_t bp0; // BufferPage0 - uint32_t nexttd; // NextTD - uint32_t be; // BufferEnd - uint32_t offset[8]; // Offset/PacketStatusWord - uint32_t word0; - uint32_t word1; + int cc = 0; // ConditionCode + int fc = 0; // FrameCount + int di = 0; // DelayInterrupt + int sf = 0; // StartingFrame + uint32_t bp0 = 0; // BufferPage0 + uint32_t nexttd = 0; // NextTD + uint32_t be = 0; // BufferEnd + uint32_t offset[8]{}; // Offset/PacketStatusWord + uint32_t word0 = 0; + uint32_t word1 = 0; }; enum OHCIRegisters { @@ -192,11 +192,11 @@ enum OHCICompletionCode { }; struct USBSetupPacket { - uint8_t bmRequestType; - uint8_t bRequest; - uint16_t wValue; - uint16_t wIndex; - uint16_t wLength; + uint8_t bmRequestType = 0; + uint8_t bRequest = 0; + uint16_t wValue = 0; + uint16_t wIndex = 0; + uint16_t wLength = 0; }; struct USBStandardDeviceDescriptor { @@ -315,22 +315,22 @@ enum USBEndpointType struct usb_device_string { - uint8_t *position; - int size; + uint8_t *position = nullptr; + int size = 0; }; struct usb_device_interfac_alternate { - uint8_t *position; - int size; + uint8_t *position = nullptr; + int size = 0; USBStandardInterfaceDescriptor interface_descriptor; std::forward_list endpoint_descriptors; }; struct usb_device_interfac { - uint8_t *position; - int size; + uint8_t *position = nullptr; + int size = 0; std::forward_list alternate_settings; int selected_alternate; }; @@ -338,8 +338,8 @@ struct usb_device_interfac struct usb_device_configuration { USBStandardConfigurationDescriptor configuration_descriptor; - uint8_t *position; - int size; + uint8_t *position = nullptr; + int size = 0; std::forward_list interfaces; }; @@ -376,28 +376,28 @@ private: void usb_ohci_read_isochronous_transfer_descriptor(uint32_t address); void usb_ohci_writeback_isochronous_transfer_descriptor(uint32_t address); std::function irq_callback; - cpu_device *m_maincpu; + cpu_device *m_maincpu = nullptr; struct { - uint32_t hc_regs[256]; + uint32_t hc_regs[256]{}; struct { - device_usb_ohci_function_interface *function; - int address; - int delay; + device_usb_ohci_function_interface *function = nullptr; + int address = 0; + int delay = 0; } ports[4 + 1]; struct { - device_usb_ohci_function_interface *function; - int port; + device_usb_ohci_function_interface *function = nullptr; + int port = 0; } address[256]; - emu_timer *timer; - int state; - uint32_t framenumber; - uint32_t nextinterupted; - uint32_t nextbulked; - int interruptbulkratio; - int writebackdonehadcounter; - address_space *space; - uint8_t buffer[1024]; + emu_timer *timer = nullptr; + int state = 0; + uint32_t framenumber = 0; + uint32_t nextinterupted = 0; + uint32_t nextbulked = 0; + int interruptbulkratio = 0; + int writebackdonehadcounter = 0; + address_space *space = nullptr; + uint8_t buffer[1024]{}; OHCIEndpointDescriptor endpoint_descriptor; OHCITransferDescriptor transfer_descriptor; OHCIIsochronousTransferDescriptor isochronous_transfer_descriptor; @@ -442,10 +442,10 @@ protected: uint8_t *position_string_descriptor(int index, int &size); ohci_usb_controller *busmanager = nullptr; struct { - int type; - int controldirection; - int controltype; - int controlrecipient; + int type = 0; + int controldirection = 0; + int controltype = 0; + int controlrecipient = 0; int remain = 0; uint8_t *position = nullptr; uint8_t buffer[128]{}; -- cgit v1.2.3