From 181040bf3bd1964e5919198dca5f960bc9bdbac6 Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Wed, 17 Feb 2021 13:03:22 +0100 Subject: apexc, apf, aussiebyte, avt, chaos, cops, corona, dec0, dms86, eprom, esq5505, eurocom2, jonos, jupiter: initialized some variables which were causing incorrect behaviours in drvnoclear debug builds --- src/mame/audio/jaguar.cpp | 2 ++ src/mame/drivers/apexc.cpp | 2 ++ src/mame/drivers/apf.cpp | 13 ++++++++-- src/mame/drivers/aussiebyte.cpp | 2 ++ src/mame/drivers/avt.cpp | 10 ++++++++ src/mame/drivers/chaos.cpp | 13 ++++++++-- src/mame/drivers/cops.cpp | 49 ++++++++++++++++++++++-------------- src/mame/drivers/corona.cpp | 8 +++++- src/mame/drivers/dms86.cpp | 11 ++++++++- src/mame/drivers/eprom.cpp | 6 ----- src/mame/drivers/esq5505.cpp | 55 +++++++++++++++++++++-------------------- src/mame/drivers/eurocom2.cpp | 12 +++++++-- src/mame/drivers/jonos.cpp | 12 +++++++-- src/mame/drivers/jupiter.cpp | 16 ++++++++++-- src/mame/includes/aussiebyte.h | 6 +++-- src/mame/includes/dec0.h | 1 + src/mame/includes/eprom.h | 36 +++++++++++++-------------- src/mame/video/dec0.cpp | 4 +++ src/mame/video/eprom.cpp | 13 +++------- 19 files changed, 178 insertions(+), 93 deletions(-) diff --git a/src/mame/audio/jaguar.cpp b/src/mame/audio/jaguar.cpp index 560f1ed2eb2..670ce4f2a5d 100644 --- a/src/mame/audio/jaguar.cpp +++ b/src/mame/audio/jaguar.cpp @@ -201,6 +201,8 @@ void jaguar_state::sound_start() { m_serial_timer = timer_alloc(TID_SERIAL); + m_gpu_irq_state = 0; + #if ENABLE_SPEEDUP_HACKS if (m_hacks_enabled) m_dsp->space(AS_PROGRAM).install_write_handler(0xf1a100, 0xf1a103, write32_delegate(*this, FUNC(jaguar_state::dsp_flags_w))); diff --git a/src/mame/drivers/apexc.cpp b/src/mame/drivers/apexc.cpp index 36b6ddcb4e7..04d0004e750 100644 --- a/src/mame/drivers/apexc.cpp +++ b/src/mame/drivers/apexc.cpp @@ -19,6 +19,8 @@ void apexc_state::machine_start() m_input_timer = timer_alloc(TIMER_POLL_INPUTS); m_input_timer->adjust(attotime::from_hz(60), 0, attotime::from_hz(60)); + + m_panel_data_reg = 0; } /* diff --git a/src/mame/drivers/apf.cpp b/src/mame/drivers/apf.cpp index 66fcf6af6b8..5f3a4ef1663 100644 --- a/src/mame/drivers/apf.cpp +++ b/src/mame/drivers/apf.cpp @@ -98,6 +98,8 @@ ToDo: #include "speaker.h" +namespace { + class apf_state : public driver_device { public: @@ -123,6 +125,10 @@ public: void apfm1000(machine_config &config); void apfimag(machine_config &config); +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + private: uint8_t videoram_r(offs_t offset); uint8_t pia0_porta_r(); @@ -144,8 +150,6 @@ private: uint8_t m_portb; bool m_ca2; bool m_has_cart_ram; - virtual void machine_start() override; - virtual void machine_reset() override; required_device m_maincpu; optional_device m_ram; required_device m_crtc; @@ -280,6 +284,8 @@ void apf_state::machine_start() save_item(NAME(m_portb)); save_item(NAME(m_ca2)); save_item(NAME(m_has_cart_ram)); + + m_latch = 0; } @@ -622,6 +628,9 @@ ROM_END // old rom, has a bad byte at 0087. //ROMX_LOAD("apf_4000.rom", 0x0000, 0x0800, CRC(2a331a33) SHA1(387b90882cd0b66c192d9cbaa3bec250f897e4f1), ROM_BIOS(0) ) +} // Anonymous namespace + + /*************************************************************************** Game driver(s) diff --git a/src/mame/drivers/aussiebyte.cpp b/src/mame/drivers/aussiebyte.cpp index e40b7cef423..0ba28b5a522 100644 --- a/src/mame/drivers/aussiebyte.cpp +++ b/src/mame/drivers/aussiebyte.cpp @@ -492,6 +492,8 @@ void aussiebyte_state::machine_start() m_bank1->configure_entries(0, 16, m_p_mram, 0x4000); m_bank2->configure_entries(0, 16, m_p_mram, 0x4000); m_bankr0->configure_entry(16, memregion("roms")->base()); + + m_cnt = 0; } diff --git a/src/mame/drivers/avt.cpp b/src/mame/drivers/avt.cpp index 6af0e540daf..3aad541999b 100644 --- a/src/mame/drivers/avt.cpp +++ b/src/mame/drivers/avt.cpp @@ -430,6 +430,8 @@ #include "tilemap.h" +namespace { + #define MASTER_CLOCK XTAL(16'000'000) /* unknown */ #define CPU_CLOCK MASTER_CLOCK/4 /* guess... seems accurate */ #define CRTC_CLOCK MASTER_CLOCK/24 /* it gives 63.371293 Hz. with current settings */ @@ -538,6 +540,12 @@ TILE_GET_INFO_MEMBER(avt_state::get_bg_tile_info) void avt_state::video_start() { m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(avt_state::get_bg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 28, 32); + + m_crtc_index = 0; + std::fill(std::begin(m_crtc_vreg), std::end(m_crtc_vreg), 0); + + save_item(NAME(m_crtc_index)); + save_item(NAME(m_crtc_vreg)); } @@ -1090,6 +1098,8 @@ ROM_START( avtnfl ) ROM_LOAD( "avtnfl", 0x0000, 0x0200, CRC(ac975c82) SHA1(9d124115cd7905482bc197462b65d3b5afdab99b) ) ROM_END +} // Anonymous namespace + /********************************************* * Game Drivers * diff --git a/src/mame/drivers/chaos.cpp b/src/mame/drivers/chaos.cpp index 4ac4f1ae6e9..4b8f58c1752 100644 --- a/src/mame/drivers/chaos.cpp +++ b/src/mame/drivers/chaos.cpp @@ -35,6 +35,8 @@ #include "machine/terminal.h" +namespace { + class chaos_state : public driver_device { public: @@ -47,6 +49,10 @@ public: void chaos(machine_config &config); +protected: + virtual void machine_reset() override; + virtual void machine_start() override; + private: u8 port1e_r(); void port1f_w(u8 data); @@ -57,8 +63,6 @@ private: void io_map(address_map &map); void mem_map(address_map &map); u8 m_term_data; - void machine_reset() override; - void machine_start() override; required_device m_terminal; required_shared_ptr m_p_ram; required_device m_maincpu; @@ -144,6 +148,8 @@ void chaos_state::kbd_put(u8 data) void chaos_state::machine_start() { save_item(NAME(m_term_data)); + + m_term_data = 0; } void chaos_state::machine_reset() @@ -176,6 +182,9 @@ ROM_START( chaos ) ROM_LOAD( "chaos.004", 0x3000, 0x1000, CRC(5d6839d6) SHA1(237f52f0780ac2e29d57bf06d0f7a982eb523084)) ROM_END +} // Anonymous namespace + + /* Driver */ // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS diff --git a/src/mame/drivers/cops.cpp b/src/mame/drivers/cops.cpp index f9167cd1f5a..52d4d37d927 100644 --- a/src/mame/drivers/cops.cpp +++ b/src/mame/drivers/cops.cpp @@ -41,6 +41,9 @@ #include "cops.lh" + +namespace { + #define LOG_CDROM 1 #define LOG_DACIA 1 @@ -60,19 +63,14 @@ public: , m_irq(0) { } - // devices - required_device m_maincpu; - required_device m_sn; - required_device m_ld; - - // screen updates - uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void revlatns(machine_config &config); void base(machine_config &config); void cops(machine_config &config); void cops_map(address_map &map); void revlatns_map(address_map &map); + + void init_cops(); + protected: // driver_device overrides virtual void machine_start() override; @@ -80,14 +78,22 @@ protected: virtual void video_start() override; -public: +private: + // devices + required_device m_maincpu; + required_device m_sn; + required_device m_ld; + + // screen updates + [[maybe_unused]] uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void io1_w(offs_t offset, uint8_t data); uint8_t io1_r(offs_t offset); uint8_t io1_lm_r(offs_t offset); void io2_w(offs_t offset, uint8_t data); uint8_t io2_r(offs_t offset); DECLARE_WRITE_LINE_MEMBER(dacia_irq); - DECLARE_WRITE_LINE_MEMBER(ld_w); + [[maybe_unused]] DECLARE_WRITE_LINE_MEMBER(ld_w); DECLARE_WRITE_LINE_MEMBER(via1_irq); DECLARE_WRITE_LINE_MEMBER(via2_irq); void dacia_receive(uint8_t data); @@ -99,7 +105,6 @@ public: void cdrom_data_w(uint8_t data); void cdrom_ctrl_w(uint8_t data); uint8_t cdrom_data_r(); - void init_cops(); int m_irq; uint8_t m_lcd_addr_l, m_lcd_addr_h; @@ -158,8 +163,8 @@ public: uint8_t m_ld_command_to_send[8]; uint8_t m_ld_command_current_byte; - uint8_t ldcount=0; - uint8_t lddata; + uint8_t m_ldcount=0; + uint8_t m_lddata; uint8_t generate_isr(); uint8_t generate_isr2(); // void laserdisc_w(uint8_t data); @@ -246,15 +251,15 @@ TIMER_CALLBACK_MEMBER(cops_state::ld_timer_callback) WRITE_LINE_MEMBER(cops_state::ld_w) { - lddata <<= 1; + m_lddata <<= 1; - if ( state ) lddata |= 1; + if ( state ) m_lddata |= 1; - if ( ++ldcount >= 8 ) + if ( ++m_ldcount >= 8 ) { - ldcount = 0; - lddata = 0; - printf("LDBYTE %d",lddata); + m_ldcount = 0; + m_lddata = 0; + printf("LDBYTE %d", m_lddata); } printf("LDBIT %d",state); @@ -874,6 +879,10 @@ void cops_state::machine_start() m_ld_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(cops_state::ld_timer_callback),this)); m_ld_timer->adjust(attotime::from_hz(167*5), 0, attotime::from_hz(167*5)); + + m_dacia_cmpval1 = m_dacia_cmpval2 = 0; + m_ld_command_current_byte = 0; + std::fill(std::begin(m_ld_command_to_send), std::end(m_ld_command_to_send), 0); } void cops_state::machine_reset() @@ -996,6 +1005,8 @@ ROM_START( revlatns ) DISK_IMAGE_READONLY( "revlatns", 0, NO_DUMP ) ROM_END +} // Anonymous namespace + GAMEL( 1994, cops, 0, cops, cops, cops_state, init_cops, ROT0, "Atari Games", "Cops (USA)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND, layout_cops ) GAMEL( 1994, copsuk, cops, cops, cops, cops_state, init_cops, ROT0, "Nova Productions / Deith Leisure", "Cops (UK)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND, layout_cops ) diff --git a/src/mame/drivers/corona.cpp b/src/mame/drivers/corona.cpp index 90c58278ed9..39daace8722 100644 --- a/src/mame/drivers/corona.cpp +++ b/src/mame/drivers/corona.cpp @@ -313,6 +313,8 @@ #include "luckyrlt.lh" +namespace { + #define WC81_MAIN_XTAL XTAL(24'000'000) /* Main crystal for Winners Circle 28*28 pins PCB's */ #define WC82_MAIN_XTAL XTAL(18'432'000) /* Main crystal for Winners Circle 18*22 pins PCB's */ #define RE_MAIN_XTAL XTAL(16'000'000) /* Main for roulette boards */ @@ -385,7 +387,7 @@ private: std::unique_ptr m_videobuf; uint8_t m_lamp; uint8_t m_lamp_old; - int m_input_selector; + uint8_t m_input_selector; required_device m_maincpu; required_device m_soundcpu; required_device m_screen; @@ -495,6 +497,8 @@ void corona_state::blitter_trig_wdht_w(uint8_t data) void corona_state::video_start() { m_videobuf = make_unique_clear(VIDEOBUF_SIZE); + + m_lamp_old = 0; } uint32_t corona_state::screen_update_winner(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) @@ -1742,6 +1746,8 @@ ROM_START(luckyrlt) ROM_LOAD( "promrulxx.123", 0x0000, 0x0020, CRC(051e5edc) SHA1(2305c056fa1fc21432189af12afb7d54c6569484) ) ROM_END +} // Anonymous namespace + /****************************************** * Game Drivers * diff --git a/src/mame/drivers/dms86.cpp b/src/mame/drivers/dms86.cpp index 6fa3d516384..a4f16b0c797 100644 --- a/src/mame/drivers/dms86.cpp +++ b/src/mame/drivers/dms86.cpp @@ -38,6 +38,8 @@ the monitor and goes straight to "Joining HiNet". #include "machine/terminal.h" +namespace { + class dms86_state : public driver_device { public: @@ -52,6 +54,9 @@ public: void dms86(machine_config &config); DECLARE_WRITE_LINE_MEMBER(nmi_w); +protected: + virtual void machine_start() override; + private: void m1_ack_w(u8 data); @@ -63,7 +68,6 @@ private: void mem_map(address_map &map); u8 m_term_data; - void machine_start() override; required_device m_maincpu; required_device m_terminal; required_device_array m_sio; @@ -131,6 +135,8 @@ INPUT_PORTS_END void dms86_state::machine_start() { save_item(NAME(m_term_data)); + + m_term_data = 0; } void dms86_state::kbd_put(u8 data) @@ -178,6 +184,9 @@ ROM_START( dms86 ) ROM_LOAD16_BYTE( "hns-86_54-8677.bin", 0x0001, 0x1000, CRC(78fad756) SHA1(ddcbff1569ec6975b8489935cdcfa80eba413502)) ROM_END +} // Anonymous namespace + + /* Driver */ /* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ diff --git a/src/mame/drivers/eprom.cpp b/src/mame/drivers/eprom.cpp index fd2336f9837..f391cf38b49 100644 --- a/src/mame/drivers/eprom.cpp +++ b/src/mame/drivers/eprom.cpp @@ -405,8 +405,6 @@ void eprom_state::eprom(machine_config &config) m_screen->screen_vblank().set_inputline(m_maincpu, M68K_IRQ_4, ASSERT_LINE); m_screen->screen_vblank().append_inputline(m_extra, M68K_IRQ_4, ASSERT_LINE); - MCFG_VIDEO_START_OVERRIDE(eprom_state,eprom) - /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -451,8 +449,6 @@ void eprom_state::klaxp(machine_config &config) m_screen->set_palette(m_palette); m_screen->screen_vblank().set_inputline(m_maincpu, M68K_IRQ_4, ASSERT_LINE); - MCFG_VIDEO_START_OVERRIDE(eprom_state,eprom) - /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -502,8 +498,6 @@ void eprom_state::guts(machine_config &config) m_screen->set_palette(m_palette); m_screen->screen_vblank().set_inputline(m_maincpu, M68K_IRQ_4, ASSERT_LINE); - MCFG_VIDEO_START_OVERRIDE(eprom_state,guts) - /* sound hardware */ SPEAKER(config, "mono").front_center(); diff --git a/src/mame/drivers/esq5505.cpp b/src/mame/drivers/esq5505.cpp index 211a082c5bc..7aa3b432a3b 100644 --- a/src/mame/drivers/esq5505.cpp +++ b/src/mame/drivers/esq5505.cpp @@ -181,6 +181,8 @@ #include +namespace { + #define GENERIC (0) #define EPS (1) #define SQ1 (2) @@ -215,6 +217,8 @@ public: , m_panel(*this, "panel") , m_dmac(*this, "mc68450") , m_mdout(*this, "mdout") + , m_rom(*this, "osrom") + , m_ram(*this, "osram") { } void sq1(machine_config &config); @@ -231,6 +235,10 @@ public: DECLARE_WRITE_LINE_MEMBER(esq5505_otis_irq); +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + private: required_device m_maincpu; required_device m_duart; @@ -241,9 +249,8 @@ private: required_device m_panel; optional_device m_dmac; required_device m_mdout; - - virtual void machine_start() override; - virtual void machine_reset() override; + required_region_ptr m_rom; + required_shared_ptr m_ram; uint16_t lower_r(offs_t offset); void lower_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); @@ -260,9 +267,9 @@ private: int m_system_type; uint8_t m_duart_io; - uint8_t otis_irq_state; - uint8_t dmac_irq_state; - uint8_t duart_irq_state; + uint8_t m_otis_irq_state; + uint8_t m_dmac_irq_state; + uint8_t m_duart_irq_state; void update_irq_to_maincpu(); @@ -276,7 +283,6 @@ private: void cpu_space_map(address_map &map); void eps_cpu_space_map(address_map &map); - uint16_t *m_rom, *m_ram; uint16_t m_analog_values[8]; //dmac @@ -301,10 +307,9 @@ void esq5505_state::eps_cpu_space_map(address_map &map) void esq5505_state::machine_start() { - driver_device::machine_start(); - - m_rom = (uint16_t *)(void *)memregion("osrom")->base(); - m_ram = (uint16_t *)(void *)memshare("osram")->ptr(); + m_otis_irq_state = 0; + m_dmac_irq_state = 0; + m_duart_irq_state = 0; } void esq5505_state::machine_reset() @@ -345,20 +350,20 @@ void esq5505_state::machine_reset() void esq5505_state::update_irq_to_maincpu() { - // printf("updating IRQ state: have OTIS=%d, DMAC=%d, DUART=%d\n", otis_irq_state, dmac_irq_state, duart_irq_state); - if (duart_irq_state) + // printf("updating IRQ state: have OTIS=%d, DMAC=%d, DUART=%d\n", m_otis_irq_state, m_dmac_irq_state, m_duart_irq_state); + if (m_duart_irq_state) { m_maincpu->set_input_line(M68K_IRQ_2, CLEAR_LINE); m_maincpu->set_input_line(M68K_IRQ_1, CLEAR_LINE); m_maincpu->set_input_line(M68K_IRQ_3, ASSERT_LINE); } - else if (dmac_irq_state) + else if (m_dmac_irq_state) { m_maincpu->set_input_line(M68K_IRQ_3, CLEAR_LINE); m_maincpu->set_input_line(M68K_IRQ_1, CLEAR_LINE); m_maincpu->set_input_line(M68K_IRQ_2, ASSERT_LINE); } - else if (otis_irq_state) + else if (m_otis_irq_state) { m_maincpu->set_input_line(M68K_IRQ_3, CLEAR_LINE); m_maincpu->set_input_line(M68K_IRQ_2, CLEAR_LINE); @@ -376,13 +381,6 @@ uint16_t esq5505_state::lower_r(offs_t offset) { offset &= 0x7fff; - // get pointers when 68k resets - if (!m_rom) - { - m_rom = (uint16_t *)(void *)memregion("osrom")->base(); - m_ram = (uint16_t *)(void *)memshare("osram")->ptr(); - } - if (!machine().side_effects_disabled() && m_maincpu->get_fc() == 0x6) // supervisor mode = ROM { return m_rom[offset]; @@ -461,7 +459,7 @@ void esq5505_state::sq1_map(address_map &map) WRITE_LINE_MEMBER(esq5505_state::esq5505_otis_irq) { - otis_irq_state = (state != 0); + m_otis_irq_state = (state != 0); update_irq_to_maincpu(); } @@ -486,11 +484,11 @@ WRITE_LINE_MEMBER(esq5505_state::duart_irq_handler) // printf("\nDUART IRQ: state %d vector %d\n", state, vector); if (state == ASSERT_LINE) { - duart_irq_state = 1; + m_duart_irq_state = 1; } else { - duart_irq_state = 0; + m_duart_irq_state = 0; } update_irq_to_maincpu(); } @@ -566,11 +564,11 @@ WRITE_LINE_MEMBER(esq5505_state::dma_irq) if (state != CLEAR_LINE) { logerror("DMAC error, vector = %x\n", m_dmac->iack()); - dmac_irq_state = 1; + m_dmac_irq_state = 1; } else { - dmac_irq_state = 0; + m_dmac_irq_state = 0; } update_irq_to_maincpu(); @@ -1061,6 +1059,9 @@ void esq5505_state::init_denib() } } +} // Anonymous namespace + + CONS( 1988, eps, 0, 0, eps, vfx, esq5505_state, init_eps, "Ensoniq", "EPS", MACHINE_NOT_WORKING ) // custom VFD: one alphanumeric 22-char row, one graphics-capable row (alpha row can also do bar graphs) CONS( 1989, vfx, 0, 0, vfx, vfx, esq5505_state, init_denib, "Ensoniq", "VFX", MACHINE_NOT_WORKING ) // 2x40 VFD CONS( 1989, vfxsd, 0, 0, vfxsd, vfx, esq5505_state, init_denib, "Ensoniq", "VFX-SD", MACHINE_NOT_WORKING ) // 2x40 VFD diff --git a/src/mame/drivers/eurocom2.cpp b/src/mame/drivers/eurocom2.cpp index a62c695a9e5..9c60276fad1 100644 --- a/src/mame/drivers/eurocom2.cpp +++ b/src/mame/drivers/eurocom2.cpp @@ -63,6 +63,8 @@ #define LOGDBG(...) LOGMASKED(LOG_DEBUG, __VA_ARGS__) +namespace { + class eurocom2_state : public driver_device { public: @@ -80,6 +82,7 @@ public: void eurocom2(machine_config &config); void microtrol(machine_config &config); + protected: uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); @@ -131,6 +134,9 @@ public: , m_ptm(*this, "ptm") { } + void waveterm(machine_config &config); + +private: uint8_t waveterm_kb_r(); void waveterm_kb_w(uint8_t data); DECLARE_WRITE_LINE_MEMBER(waveterm_kbh_w); @@ -143,9 +149,8 @@ public: uint8_t waveterm_adc(); void waveterm_dac(uint8_t data); // declared but not defined, commented in memory map - void waveterm(machine_config &config); void waveterm_map(address_map &map); -protected: + bool m_driveh; uint8_t m_drive; @@ -415,6 +420,7 @@ void eurocom2_state::machine_start() { m_sst = timer_alloc(0); m_tmpbmp.allocate(VC_DISP_HORZ, VC_DISP_VERT); + m_kbd_data = 0; } @@ -530,6 +536,8 @@ ROM_START(microtrol) ROM_LOAD("mon2.bin", 0x0800, 0x0800, CRC(577a2b4c) SHA1(e7097a96417fa249a62c967039f039e637079cb6)) ROM_END +} // Anonymous namespace + // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS COMP( 1981, eurocom2, 0, 0, eurocom2, eurocom2, eurocom2_state, empty_init, "Eltec", "Eurocom II V7", MACHINE_IS_SKELETON ) diff --git a/src/mame/drivers/jonos.cpp b/src/mame/drivers/jonos.cpp index ea499a758d3..be919ab90b5 100644 --- a/src/mame/drivers/jonos.cpp +++ b/src/mame/drivers/jonos.cpp @@ -23,6 +23,8 @@ There are interrupt handlers at 5.5 (0x002c) and 6.5 (0x0034). #include "screen.h" +namespace { + class jonos_state : public driver_device { public: @@ -35,6 +37,10 @@ public: void jonos(machine_config &config); +protected: + virtual void machine_reset() override; + virtual void machine_start() override; + private: u8 keyboard_r(offs_t offset); void cursor_w(offs_t offset, u8 data); @@ -47,8 +53,6 @@ private: u8 m_term_data; u8 m_curs_ctrl; u16 m_curs_pos; - void machine_reset() override; - void machine_start() override; required_device m_maincpu; required_shared_ptr m_p_videoram; required_region_ptr m_p_chargen; @@ -119,6 +123,7 @@ void jonos_state::machine_reset() m_curs_ctrl = 0; m_curs_pos = 0; m_term_data = 0; + m_framecnt = 0; } uint32_t jonos_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) @@ -219,6 +224,9 @@ ROM_START( jonos ) ROM_LOAD( "jochset0.rom", 0x0000, 0x0800, CRC(1d8e9640) SHA1(74f3604acc71f9bc1e1f9479f6438feda79293a2) ) ROM_END +} // Anonymous namespace + + /* Driver */ // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS diff --git a/src/mame/drivers/jupiter.cpp b/src/mame/drivers/jupiter.cpp index 79ca7743019..22e807ac462 100644 --- a/src/mame/drivers/jupiter.cpp +++ b/src/mame/drivers/jupiter.cpp @@ -37,6 +37,9 @@ ToDo: (both) #include "emupal.h" #include "screen.h" + +namespace { + #define MCM6571AP_TAG "vid125_6c" #define S6820_TAG "vid125_4a" #define Z80_TAG "cpu126_4c" @@ -59,10 +62,12 @@ public: void init_jupiter2(); +protected: + virtual void machine_start() override; + private: void jupiter2_mem(address_map &map); - virtual void machine_start() override; required_device m_maincpu; required_device m_acia0; required_device m_acia1; @@ -83,6 +88,9 @@ public: void init_jupiter3(); +protected: + virtual void machine_reset() override; + private: uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void kbd_put(u8 data); @@ -93,7 +101,6 @@ private: void jupiter3_io(address_map &map); void jupiter3_mem(address_map &map); - virtual void machine_reset() override; uint8_t m_term_data; required_device m_maincpu; required_shared_ptr m_p_videoram; @@ -270,6 +277,8 @@ void jupiter3_state::machine_reset() uint8_t* ROM = memregion(Z80_TAG)->base(); memcpy(m_p_ram, ROM, 0x1000); m_maincpu->set_pc(0xe000); + + m_term_data = 0; } @@ -433,6 +442,9 @@ void jupiter3_state::init_jupiter3() } } +} // Anonymous namespace + + //************************************************************************** // SYSTEM DRIVERS //************************************************************************** diff --git a/src/mame/includes/aussiebyte.h b/src/mame/includes/aussiebyte.h index 1e02f5c0971..c5f6053d2f1 100644 --- a/src/mame/includes/aussiebyte.h +++ b/src/mame/includes/aussiebyte.h @@ -74,6 +74,10 @@ public: DECLARE_QUICKLOAD_LOAD_MEMBER(quickload_cb); +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + private: u8 memory_read_byte(offs_t offset); void memory_write_byte(offs_t offset, u8 data); @@ -108,8 +112,6 @@ private: MC6845_UPDATE_ROW(crtc_update_row); MC6845_ON_UPDATE_ADDR_CHANGED(crtc_update_addr); - virtual void machine_start() override; - virtual void machine_reset() override; void io_map(address_map &map); void mem_map(address_map &map); diff --git a/src/mame/includes/dec0.h b/src/mame/includes/dec0.h index 5c88125cfee..a9b51c26750 100644 --- a/src/mame/includes/dec0.h +++ b/src/mame/includes/dec0.h @@ -184,6 +184,7 @@ public: m_adpcm_select(*this, "adpcm_select%u", 1U), m_soundbank(*this, "soundbank") { + std::fill(std::begin(m_automat_scroll_regs), std::end(m_automat_scroll_regs), 0); } void secretab(machine_config &config); diff --git a/src/mame/includes/eprom.h b/src/mame/includes/eprom.h index d17085ab57c..bb28cf411f1 100644 --- a/src/mame/includes/eprom.h +++ b/src/mame/includes/eprom.h @@ -44,22 +44,7 @@ public: protected: virtual void machine_start() override; virtual void machine_reset() override; - void video_int_ack_w(uint16_t data); - TIMER_DEVICE_CALLBACK_MEMBER(scanline_update); - uint8_t adc_r(offs_t offset); - void eprom_latch_w(uint8_t data); - template void sync_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - TILE_GET_INFO_MEMBER(get_alpha_tile_info); - TILE_GET_INFO_MEMBER(get_playfield_tile_info); - TILE_GET_INFO_MEMBER(guts_get_playfield_tile_info); - DECLARE_VIDEO_START(eprom); - DECLARE_VIDEO_START(guts); - uint32_t screen_update_eprom(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - uint32_t screen_update_guts(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void update_palette(); - void extra_map(address_map &map); - void guts_map(address_map &map); - void main_map(address_map &map); + virtual void video_start() override; private: required_device m_maincpu; @@ -70,14 +55,29 @@ private: required_device m_mob; required_device m_jsa; required_shared_ptr m_share1; - int m_screen_intensity; - int m_video_disable; + uint8_t m_screen_intensity; + uint8_t m_video_disable; optional_device m_adc; optional_device m_extra; required_device m_palette; optional_shared_ptr m_paletteram; static const atari_motion_objects_config s_mob_config; static const atari_motion_objects_config s_guts_mob_config; + + void video_int_ack_w(uint16_t data); + TIMER_DEVICE_CALLBACK_MEMBER(scanline_update); + uint8_t adc_r(offs_t offset); + void eprom_latch_w(uint8_t data); + template void sync_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + TILE_GET_INFO_MEMBER(get_alpha_tile_info); + TILE_GET_INFO_MEMBER(get_playfield_tile_info); + TILE_GET_INFO_MEMBER(guts_get_playfield_tile_info); + uint32_t screen_update_eprom(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_guts(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void update_palette(); + void extra_map(address_map &map); + void guts_map(address_map &map); + void main_map(address_map &map); }; #endif // MAME_INCLUDES_EPROM_H diff --git a/src/mame/video/dec0.cpp b/src/mame/video/dec0.cpp index 00771e46c62..d0eb0bcf99b 100644 --- a/src/mame/video/dec0.cpp +++ b/src/mame/video/dec0.cpp @@ -279,6 +279,8 @@ VIDEO_START_MEMBER(dec0_state,dec0_nodma) save_item(NAME(m_pri)); m_buffered_spriteram = m_spriteram->live(); save_pointer(NAME(m_buffered_spriteram), 0x800/2); + + m_pri = 0; } VIDEO_START_MEMBER(dec0_state,dec0) @@ -286,6 +288,8 @@ VIDEO_START_MEMBER(dec0_state,dec0) save_item(NAME(m_pri)); m_buffered_spriteram = m_spriteram->buffer(); save_pointer(NAME(m_buffered_spriteram), 0x800/2); + + m_pri = 0; } VIDEO_START_MEMBER(dec0_state,baddudes) diff --git a/src/mame/video/eprom.cpp b/src/mame/video/eprom.cpp index 2150f9c37ff..ff1f6f92e4b 100644 --- a/src/mame/video/eprom.cpp +++ b/src/mame/video/eprom.cpp @@ -122,11 +122,14 @@ const atari_motion_objects_config eprom_state::s_mob_config = 0 /* resulting value to indicate "special" */ }; -VIDEO_START_MEMBER(eprom_state,eprom) +void eprom_state::video_start() { /* save states */ save_item(NAME(m_screen_intensity)); save_item(NAME(m_video_disable)); + + m_screen_intensity = 0; + m_video_disable = 0; } @@ -164,14 +167,6 @@ const atari_motion_objects_config eprom_state::s_guts_mob_config = 0 /* resulting value to indicate "special" */ }; -VIDEO_START_MEMBER(eprom_state,guts) -{ - /* save states */ - save_item(NAME(m_screen_intensity)); - save_item(NAME(m_video_disable)); -} - - /************************************* * -- cgit v1.2.3