From e4c65de6ed4ec7b257cfe97b6734fdb73f45b95d Mon Sep 17 00:00:00 2001 From: Robbbert Date: Sun, 10 Apr 2022 19:08:20 +1000 Subject: init vars for broken apples --- src/mame/drivers/apple2gs.cpp | 138 +++++++++++++++++++++--------------------- src/mame/drivers/mac128.cpp | 38 ++++++------ src/mame/includes/mac.h | 48 +++++++-------- 3 files changed, 112 insertions(+), 112 deletions(-) diff --git a/src/mame/drivers/apple2gs.cpp b/src/mame/drivers/apple2gs.cpp index 4e40652ca44..2907177cc8c 100644 --- a/src/mame/drivers/apple2gs.cpp +++ b/src/mame/drivers/apple2gs.cpp @@ -315,9 +315,9 @@ private: ADBSTATE_INRESPONSE }; - bool m_adb_line; + bool m_adb_line = false; - address_space *m_maincpu_space; + address_space *m_maincpu_space = nullptr; TIMER_DEVICE_CALLBACK_MEMBER(apple2_interrupt); TIMER_DEVICE_CALLBACK_MEMBER(accel_timer); @@ -335,9 +335,9 @@ private: void devsel_w(uint8_t devsel); void hdsel_w(int hdsel); - floppy_image_device *m_cur_floppy; - int m_devsel; - u8 m_diskreg; + floppy_image_device *m_cur_floppy = nullptr; + int m_devsel = 0; + u8 m_diskreg = 0; u8 ram0000_r(offs_t offset); void ram0000_w(offs_t offset, u8 data); @@ -435,91 +435,91 @@ private: offs_t dasm_trampoline(std::ostream &stream, offs_t pc, const util::disasm_interface::data_buffer &opcodes, const util::disasm_interface::data_buffer ¶ms); void wdm_trampoline(offs_t offset, u8 data) { }; //m_a2host->wdm_w(space, offset, data); } - bool m_is_rom3; - int m_speaker_state; + bool m_is_rom3 = false; + int m_speaker_state = 0; - double m_joystick_x1_time, m_joystick_y1_time, m_joystick_x2_time, m_joystick_y2_time; + double m_joystick_x1_time = 0, m_joystick_y1_time = 0, m_joystick_x2_time = 0, m_joystick_y2_time = 0; - int m_inh_slot, m_cnxx_slot; - int m_motoroff_time; + int m_inh_slot = 0, m_cnxx_slot = 0; + int m_motoroff_time = 0; - bool m_romswitch; + bool m_romswitch = false; - bool m_page2; - bool m_an0, m_an1, m_an2, m_an3; + bool m_page2 = false; + bool m_an0 = false, m_an1 = false, m_an2 = false, m_an3 = false; - bool m_vbl; + bool m_vbl = false; - int m_irqmask; + int m_irqmask = 0; - bool m_intcxrom; - bool m_80store; - bool m_slotc3rom; - bool m_altzp; - bool m_ramrd, m_ramwrt; - bool m_lcram, m_lcram2, m_lcprewrite, m_lcwriteenable; - bool m_ioudis; - bool m_rombank; + bool m_intcxrom = false; + bool m_80store = false; + bool m_slotc3rom = false; + bool m_altzp = false; + bool m_ramrd = false, m_ramwrt = false; + bool m_lcram = false, m_lcram2 = false, m_lcprewrite = false, m_lcwriteenable = false; + bool m_ioudis = false; + bool m_rombank = false; - u8 m_shadow, m_speed, m_textcol; - u8 m_motors_active, m_slotromsel, m_intflag, m_vgcint, m_inten, m_newvideo; + u8 m_shadow = 0, m_speed = 0, m_textcol = 0; + u8 m_motors_active = 0, m_slotromsel = 0, m_intflag = 0, m_vgcint = 0, m_inten = 0, m_newvideo = 0; - bool m_last_speed; + bool m_last_speed = false; // Sound GLU variables - u8 m_sndglu_ctrl; - int m_sndglu_addr; - int m_sndglu_dummy_read; + u8 m_sndglu_ctrl = 0; + int m_sndglu_addr = 0; + int m_sndglu_dummy_read = 0; // Key GLU variables - u8 m_glu_regs[12], m_glu_bus; - bool m_glu_mcu_read_kgs, m_glu_816_read_dstat, m_glu_mouse_read_stat; - int m_glu_kbd_y; + u8 m_glu_regs[12]{}, m_glu_bus = 0; + bool m_glu_mcu_read_kgs = false, m_glu_816_read_dstat = false, m_glu_mouse_read_stat = false; + int m_glu_kbd_y = 0; - u8 *m_ram_ptr; - int m_ram_size; - u8 m_megaii_ram[0x20000]; // 128K of "slow RAM" at $E0/0000 + u8 *m_ram_ptr = nullptr; + int m_ram_size = 0; + u8 m_megaii_ram[0x20000]{}; // 128K of "slow RAM" at $E0/0000 - int m_inh_bank; + int m_inh_bank = 0; - bool m_slot_irq; + bool m_slot_irq = false; - double m_x_calibration, m_y_calibration; + double m_x_calibration = 0, m_y_calibration = 0; - device_a2bus_card_interface *m_slotdevice[8]; + device_a2bus_card_interface *m_slotdevice[8]{}; - u32 m_slow_counter; + u32 m_slow_counter = 0; // clock/BRAM - u8 m_clkdata, m_clock_control, m_clock_read, m_clock_reg1; + u8 m_clkdata = 0, m_clock_control = 0, m_clock_read = 0, m_clock_reg1 = 0; apple2gs_clock_mode m_clock_mode; u32 m_clock_curtime; seconds_t m_clock_curtime_interval; - u8 m_clock_bram[256]; - int m_clock_frame; + u8 m_clock_bram[256]{}; + int m_clock_frame = 0; // ADB simulation #if !RUN_ADB_MICRO adbstate_t m_adb_state; - u8 m_adb_command; - u8 m_adb_mode; - u8 m_adb_kmstatus; - u8 m_adb_pending_status; - u8 m_adb_latent_result; - s32 m_adb_command_length; - s32 m_adb_command_pos; - u8 m_adb_response_length; - s32 m_adb_response_pos; - u8 m_adb_command_bytes[8]; - u8 m_adb_response_bytes[8]; - u8 m_adb_memory[0x100]; - int m_adb_address_keyboard; - int m_adb_address_mouse; - - u16 m_lastchar, m_strobe; - u8 m_transchar; - bool m_anykeydown; - int m_repeatdelay; + u8 m_adb_command = 0; + u8 m_adb_mode = 0; + u8 m_adb_kmstatus = 0; + u8 m_adb_pending_status = 0; + u8 m_adb_latent_result = 0; + s32 m_adb_command_length = 0; + s32 m_adb_command_pos = 0; + u8 m_adb_response_length = 0; + s32 m_adb_response_pos = 0; + u8 m_adb_command_bytes[8]{}; + u8 m_adb_response_bytes[8]{}; + u8 m_adb_memory[0x100]{}; + int m_adb_address_keyboard = 0; + int m_adb_address_mouse = 0; + + u16 m_lastchar = 0, m_strobe = 0; + u8 m_transchar = 0; + bool m_anykeydown = false; + int m_repeatdelay = 0; u8 adb_read_datareg(); u8 adb_read_kmstatus(); @@ -559,13 +559,13 @@ private: void process_clock(); // ZipGS stuff - bool m_accel_unlocked; - bool m_accel_fast; - bool m_accel_present; - bool m_accel_temp_slowdown; - int m_accel_stage; - u32 m_accel_speed; - u8 m_accel_slotspk, m_accel_gsxsettings, m_accel_percent; + bool m_accel_unlocked = false; + bool m_accel_fast = false; + bool m_accel_present = false; + bool m_accel_temp_slowdown = false; + int m_accel_stage = 0; + u32 m_accel_speed = 0; + u8 m_accel_slotspk = 0, m_accel_gsxsettings = 0, m_accel_percent = 0; void accel_full_speed() { diff --git a/src/mame/drivers/mac128.cpp b/src/mame/drivers/mac128.cpp index 2c8cda97cef..91fb3a530fd 100644 --- a/src/mame/drivers/mac128.cpp +++ b/src/mame/drivers/mac128.cpp @@ -240,8 +240,8 @@ private: floppy_image_device *m_cur_floppy; int m_hdsel, m_devsel; - int m_pwm_count_total, m_pwm_count_1; - float m_pwm_current_rpm[2]; + int m_pwm_count_total = 0, m_pwm_count_1 = 0; + float m_pwm_current_rpm[2]{}; void phases_w(uint8_t phases); void devsel_w(uint8_t devsel); @@ -249,30 +249,30 @@ private: void snd_push(uint8_t data); void pwm_push(uint8_t data); - uint32_t m_overlay; + uint32_t m_overlay = 0; - int m_irq_count, m_ca2_data; - uint8_t m_mouse_bit[2], m_mouse_last[2]; - int16_t m_mouse_last_m[2], m_mouse_count[2]; - int m_screen_buffer; - emu_timer *m_scan_timer; - emu_timer *m_hblank_timer; + int m_irq_count = 0, m_ca2_data = 0; + uint8_t m_mouse_bit[2]{}, m_mouse_last[2]{}; + int16_t m_mouse_last_m[2]{}, m_mouse_count[2]{}; + int m_screen_buffer = 0; + emu_timer *m_scan_timer = nullptr; + emu_timer *m_hblank_timer = nullptr; // interrupts - int m_scc_interrupt, m_via_interrupt, m_scsi_interrupt, m_last_taken_interrupt; + int m_scc_interrupt = 0, m_via_interrupt = 0, m_scsi_interrupt = 0, m_last_taken_interrupt = 0; // DRQ - int m_scsi_drq; + int m_scsi_drq = 0; // wait states for accessing the VIA - bool m_snd_enable; - bool m_main_buffer; - int m_snd_vol; - int m_adb_irq_pending; - int m_drive_select; - int m_scsiirq_enable; - u16 *m_ram_ptr, *m_rom_ptr; - u32 m_ram_mask, m_ram_size; + bool m_snd_enable = false; + bool m_main_buffer = false; + int m_snd_vol = 0; + int m_adb_irq_pending = 0; + int m_drive_select = 0; + int m_scsiirq_enable = 0; + u16 *m_ram_ptr = nullptr, *m_rom_ptr = nullptr; + u32 m_ram_mask = 0, m_ram_size = 0; }; void mac128_state::machine_start() diff --git a/src/mame/includes/mac.h b/src/mame/includes/mac.h index ddacee4be80..d34a14c85d7 100644 --- a/src/mame/includes/mac.h +++ b/src/mame/includes/mac.h @@ -221,36 +221,36 @@ private: }; - uint32_t m_overlay; + uint32_t m_overlay = 0; - uint32_t m_via2_vbl; - uint32_t m_se30_vbl_enable; - uint8_t m_nubus_irq_state; + uint32_t m_via2_vbl = 0; + uint32_t m_se30_vbl_enable = 0; + uint8_t m_nubus_irq_state = 0; - emu_timer *m_overlay_timeout; + emu_timer *m_overlay_timeout = nullptr; TIMER_CALLBACK_MEMBER(overlay_timeout_func); uint32_t rom_switch_r(offs_t offset); - bool m_main_buffer; - int m_adb_irq_pending; - int m_screen_buffer; + bool m_main_buffer = false; + int m_adb_irq_pending = 0; + int m_screen_buffer = 0; int irq_count, ca1_data, ca2_data; // 60.15 Hz timer for RBV/V8/Sonora/Eagle/VASP/etc. - emu_timer *m_6015_timer; + emu_timer *m_6015_timer = nullptr; // ADB refresh timer, independent of anything else going on - emu_timer *m_adbupdate_timer; + emu_timer *m_adbupdate_timer = nullptr; WRITE_LINE_MEMBER(adb_irq_w) { m_adb_irq_pending = state; } // RBV and friends (V8, etc) - uint8_t m_rbv_regs[256], m_rbv_ier, m_rbv_ifr, m_rbv_type, m_rbv_montype, m_rbv_vbltime; - uint32_t m_rbv_colors[3], m_rbv_count, m_rbv_clutoffs, m_rbv_immed10wr; - uint32_t m_rbv_palette[256]; - uint8_t m_sonora_vctl[8]; - emu_timer *m_vbl_timer, *m_cursor_timer; - uint16_t m_cursor_line; + uint8_t m_rbv_regs[256]{}, m_rbv_ier = 0, m_rbv_ifr = 0, m_rbv_type = 0, m_rbv_montype = 0, m_rbv_vbltime = 0; + uint32_t m_rbv_colors[3]{}, m_rbv_count = 0, m_rbv_clutoffs = 0, m_rbv_immed10wr = 0; + uint32_t m_rbv_palette[256]{}; + uint8_t m_sonora_vctl[8]{}; + emu_timer *m_vbl_timer = nullptr, *m_cursor_timer = nullptr; + uint16_t m_cursor_line = 0; // this is shared among all video setups with vram optional_shared_ptr m_vram; @@ -258,7 +258,7 @@ private: optional_shared_ptr m_vram64; // interrupts - int m_scc_interrupt, m_via_interrupt, m_via2_interrupt, m_scsi_interrupt, m_last_taken_interrupt; + int m_scc_interrupt = false, m_via_interrupt = false, m_via2_interrupt = false, m_scsi_interrupt = false, m_last_taken_interrupt = false; // defined in machine/mac.c void v8_resize(); @@ -334,20 +334,20 @@ private: void macse30_map(address_map &map); void pwrmac_map(address_map &map); - uint8_t m_oss_regs[0x400]; + uint8_t m_oss_regs[0x400]{}; - int m_via2_ca1_hack; + int m_via2_ca1_hack = 0; optional_device m_screen; optional_device m_palette; - uint32_t m_rom_size; - uint32_t *m_rom_ptr; + uint32_t m_rom_size = 0; + uint32_t *m_rom_ptr = nullptr; - emu_timer *m_scanline_timer; + emu_timer *m_scanline_timer = nullptr; - floppy_image_device *m_cur_floppy; + floppy_image_device *m_cur_floppy = nullptr; - uint8_t m_pm_req, m_pm_state, m_pm_dptr, m_pm_cmd; + uint8_t m_pm_req = 0, m_pm_state = 0, m_pm_dptr = 0, m_pm_cmd = 0; void phases_w(uint8_t phases); void sel35_w(int sel35); -- cgit v1.2.3