From 96cbb0596b418a5e97263ec877dfb4e009577f84 Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Fri, 12 Feb 2021 18:00:14 +0100 Subject: atlantis, astrocde, cps1, pcxt, spyhuntertec, tx1, undrfire, vamphalf: initialized some variables which were causing incorrect behaviours in drvnoclear debug builds --- src/mame/drivers/atlantis.cpp | 32 +++++++++++++++----------------- src/mame/drivers/cps1.cpp | 2 +- src/mame/drivers/pcxt.cpp | 12 ++++++++---- src/mame/drivers/spyhuntertec.cpp | 23 ++++++++++------------- src/mame/drivers/tx1.cpp | 3 --- src/mame/drivers/vamphalf.cpp | 7 +++++++ src/mame/includes/tx1.h | 5 +++-- src/mame/includes/undrfire.h | 4 +++- src/mame/machine/tx1.cpp | 10 ++-------- src/mame/video/astrocde.cpp | 3 +++ src/mame/video/undrfire.cpp | 2 ++ 11 files changed, 54 insertions(+), 49 deletions(-) diff --git a/src/mame/drivers/atlantis.cpp b/src/mame/drivers/atlantis.cpp index cf20cafe347..1ebd2e6f12a 100644 --- a/src/mame/drivers/atlantis.cpp +++ b/src/mame/drivers/atlantis.cpp @@ -55,6 +55,9 @@ #include "coreutil.h" #include "emupal.h" + +namespace { + // Reset bits #define RESET_IOASIC 0x01 #define RESET_ROMBUS 0x02 @@ -113,16 +116,18 @@ public: m_ide(*this, PCI_ID_IDE), m_rtc(*this, "rtc"), m_io_analog(*this, "AN.%u", 0) - { } + { + std::fill(std::begin(board_ctrl), std::end(board_ctrl), 0); + } void mwskins(machine_config &config); - void init_mwskins(); - -private: +protected: virtual void machine_start() override; virtual void machine_reset() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + +private: required_device m_maincpu; required_device m_screen; optional_device m_palette; @@ -143,7 +148,7 @@ private: uint32_t m_serial_count; - void asic_fifo_w(uint32_t data); // unused? + [[maybe_unused]] void asic_fifo_w(uint32_t data); uint8_t exprom_r(offs_t offset); void exprom_w(offs_t offset, uint8_t data); @@ -926,15 +931,8 @@ ROM_START( mwskinst ) // another dump with data SHA1 cba09f0240dd797b554ae28b74416472d2327e5b is available, both have latest version 1.15 in the changelog at 0x934687 ROM_END -/************************************* - * - * Driver initialization - * - *************************************/ +} // Anonymous namespace -void atlantis_state::init_mwskins() -{ -} /************************************* * @@ -942,7 +940,7 @@ void atlantis_state::init_mwskins() * *************************************/ -GAME( 2000, mwskins, 0, mwskins, mwskins, atlantis_state, init_mwskins, ROT0, "Midway", "Skins Game (1.06)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 2000, mwskinsa, mwskins, mwskins, mwskins, atlantis_state, init_mwskins, ROT0, "Midway", "Skins Game (1.06, alt)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_SUPPORTS_SAVE) -GAME( 2000, mwskinso, mwskins, mwskins, mwskins, atlantis_state, init_mwskins, ROT0, "Midway", "Skins Game (1.04)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_SUPPORTS_SAVE) -GAME( 2000, mwskinst, mwskins, mwskins, mwskins, atlantis_state, init_mwskins, ROT0, "Midway", "Skins Game Tournament Edition", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_SUPPORTS_SAVE) +GAME( 2000, mwskins, 0, mwskins, mwskins, atlantis_state, empty_init, ROT0, "Midway", "Skins Game (1.06)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 2000, mwskinsa, mwskins, mwskins, mwskins, atlantis_state, empty_init, ROT0, "Midway", "Skins Game (1.06, alt)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_SUPPORTS_SAVE) +GAME( 2000, mwskinso, mwskins, mwskins, mwskins, atlantis_state, empty_init, ROT0, "Midway", "Skins Game (1.04)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_SUPPORTS_SAVE) +GAME( 2000, mwskinst, mwskins, mwskins, mwskins, atlantis_state, empty_init, ROT0, "Midway", "Skins Game Tournament Edition", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_SUPPORTS_SAVE) diff --git a/src/mame/drivers/cps1.cpp b/src/mame/drivers/cps1.cpp index b0ad7f71614..febec6b3d94 100644 --- a/src/mame/drivers/cps1.cpp +++ b/src/mame/drivers/cps1.cpp @@ -11626,7 +11626,7 @@ ROM_START( varthb2 ) // pcb picture shows 4x 42-pin mask roms which suggests 4x 27c800 (4MB) for gfx vs originals 4x 27c400 (2MB) // roms u18,19 might just be duplicates of u68,70 (although markings are different?) or just half empty // games expects sprites to start at 0x8000 so reloading in upper region - ROM_REGION( 0x600000, "gfx", 0 ) + ROM_REGION( 0x600000, "gfx", ROMREGION_ERASE00 ) ROM_LOAD64_WORD( "va-5m.7a", 0x000000, 0x80000, BAD_DUMP CRC(b1fb726e) SHA1(5ac0876b6c49d0a99710dda68653664f4d8c1167) ) ROM_RELOAD( 0x400000, 0x80000) ROM_LOAD64_WORD( "va-7m.9a", 0x000002, 0x80000, BAD_DUMP CRC(4c6588cd) SHA1(d14e8cf051ac934ccc989d8c571c6cc9eed34af5) ) diff --git a/src/mame/drivers/pcxt.cpp b/src/mame/drivers/pcxt.cpp index dd25820e008..d14dc825a86 100644 --- a/src/mame/drivers/pcxt.cpp +++ b/src/mame/drivers/pcxt.cpp @@ -17,7 +17,6 @@ TODO: - 02851: tetriskr: Corrupt game graphics after some time of gameplay, caused by a wrong reading of the i/o $3c8 bit 1. (seems fixed?) - Add a proper FDC device. -- Filetto: Add UM5100 sound chip, might be connected to the prototyping card; - buzzer sound has issues in both games ******************************************************************************************** @@ -79,6 +78,11 @@ public: void tetriskr(machine_config &config); void filetto(machine_config &config); +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + private: int m_lastvalue; uint8_t m_disk_data[2]; @@ -101,9 +105,6 @@ private: void port_b_w(uint8_t data); void voice_start_w(uint8_t data); - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; required_device m_maincpu; required_device m_mb; optional_device m_bank; @@ -524,6 +525,9 @@ void pcxt_state::device_timer(emu_timer &timer, device_timer_id id, int param, v void pcxt_state::machine_start() { m_sample = timer_alloc(); + + m_status = 0; + m_clr_status = 0; } void pcxt_state::machine_reset() diff --git a/src/mame/drivers/spyhuntertec.cpp b/src/mame/drivers/spyhuntertec.cpp index 4fe733748c7..5d17a63d16c 100644 --- a/src/mame/drivers/spyhuntertec.cpp +++ b/src/mame/drivers/spyhuntertec.cpp @@ -171,8 +171,7 @@ uint8_t spyhuntertec_state::ay2_porta_r() void spyhuntertec_state::spyhunt_videoram_w(offs_t offset, uint8_t data) { - uint8_t *videoram = m_videoram; - videoram[offset] = data; + m_videoram[offset] = data; m_bg_tilemap->mark_tile_dirty(offset); } @@ -229,8 +228,7 @@ TILEMAP_MAPPER_MEMBER(spyhuntertec_state::spyhunt_bg_scan) TILE_GET_INFO_MEMBER(spyhuntertec_state::spyhunt_get_bg_tile_info) { - uint8_t *videoram = m_videoram; - int data = videoram[tile_index]; + int data = m_videoram[tile_index]; int code = (data & 0x3f) | ((data >> 1) & 0x40); tileinfo.set(0, code, 0, (data & 0x40) ? TILE_FLIPY : 0); } @@ -257,6 +255,8 @@ void spyhuntertec_state::video_start() save_item(NAME(m_spyhunt_scrollx)); save_item(NAME(m_spyhunt_scrolly)); save_item(NAME(m_spyhunt_scroll_offset)); + + mcr_cocktail_flip = 0; // TODO: this doesn't get set anywhere, code at line 322 is effectively unreachable } @@ -264,18 +264,15 @@ void spyhuntertec_state::video_start() void spyhuntertec_state::mcr3_update_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int color_mask, int code_xor, int dx, int dy, int interlaced) { - uint8_t *spriteram = m_spriteram; - int offs; - m_screen->priority().fill(1, cliprect); /* loop over sprite RAM */ - for (offs = m_spriteram.bytes() - 4; offs >= 0; offs -= 4) + for (int offs = m_spriteram.bytes() - 4; offs >= 0; offs -= 4) { int code, color, flipx, flipy, sx, sy, flags; /* skip if zero */ - if (spriteram[offs] == 0) + if (m_spriteram[offs] == 0) continue; /* @@ -290,13 +287,13 @@ void spyhuntertec_state::mcr3_update_sprites(screen_device &screen, bitmap_ind16 */ /* extract the bits of information */ - flags = spriteram[offs + 1]; - code = spriteram[offs + 2] + 256 * ((flags >> 3) & 0x01); + flags = m_spriteram[offs + 1]; + code = m_spriteram[offs + 2] + 256 * ((flags >> 3) & 0x01); color = ~flags & color_mask; flipx = flags & 0x10; flipy = flags & 0x20; - sx = (spriteram[offs + 3] - 3) * 2; - sy = (241 - spriteram[offs]); + sx = (m_spriteram[offs + 3] - 3) * 2; + sy = (241 - m_spriteram[offs]); if (interlaced == 1) sy *= 2; diff --git a/src/mame/drivers/tx1.cpp b/src/mame/drivers/tx1.cpp index 39fb1313e0f..32118b76d6b 100644 --- a/src/mame/drivers/tx1.cpp +++ b/src/mame/drivers/tx1.cpp @@ -177,7 +177,6 @@ void tx1_state::tx1(machine_config &config) I8086(config, m_mathcpu, CPU_MASTER_CLOCK / 3); m_mathcpu->set_addrmap(AS_PROGRAM, &tx1_state::tx1_math); - MCFG_MACHINE_RESET_OVERRIDE(tx1_state,tx1) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); PALETTE(config, "palette", FUNC(tx1_state::tx1_palette), 256); @@ -222,7 +221,6 @@ void tx1_state::buggyboy(machine_config &config) I8086(config, m_mathcpu, CPU_MASTER_CLOCK / 3); m_mathcpu->set_addrmap(AS_PROGRAM, &tx1_state::buggyboy_math); - MCFG_MACHINE_RESET_OVERRIDE(tx1_state,buggyboy) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); config.set_default_layout(layout_triphsxs); @@ -260,7 +258,6 @@ void tx1_state::buggybjr(machine_config &config) I8086(config, m_mathcpu, CPU_MASTER_CLOCK / 3); m_mathcpu->set_addrmap(AS_PROGRAM, &tx1_state::buggyboy_math); - MCFG_MACHINE_RESET_OVERRIDE(tx1_state,buggyboy) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); SCREEN(config, m_screen, SCREEN_TYPE_RASTER); diff --git a/src/mame/drivers/vamphalf.cpp b/src/mame/drivers/vamphalf.cpp index 979451fe73b..d4dd23fead6 100644 --- a/src/mame/drivers/vamphalf.cpp +++ b/src/mame/drivers/vamphalf.cpp @@ -72,6 +72,8 @@ TODO: #include "speaker.h" +namespace { + class vamphalf_state : public driver_device { public: @@ -737,6 +739,8 @@ Offset+3 void vamphalf_state::video_start() { save_item(NAME(m_flipscreen)); + + m_flipscreen = 0; } void vamphalf_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) @@ -3573,6 +3577,9 @@ void vamphalf_state::init_boonggab() m_flip_bit = 1; } +} // Anonymous namespace + + GAME( 1999, coolmini, 0, coolmini, common, vamphalf_state, init_coolmini, ROT0, "SemiCom", "Cool Minigame Collection", MACHINE_SUPPORTS_SAVE ) GAME( 1999, coolminii, coolmini, coolmini, common, vamphalf_state, init_coolminii, ROT0, "SemiCom", "Cool Minigame Collection (Italy)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/includes/tx1.h b/src/mame/includes/tx1.h index 83bb6594333..50273bca170 100644 --- a/src/mame/includes/tx1.h +++ b/src/mame/includes/tx1.h @@ -65,6 +65,9 @@ public: void buggyboy(machine_config &config); void buggybjr(machine_config &config); +protected: + virtual void machine_reset() override; + private: struct math_t { @@ -197,10 +200,8 @@ private: void resume_math_w(uint16_t data); void halt_math_w(uint16_t data); u16 dipswitches_r(); - DECLARE_MACHINE_RESET(tx1); DECLARE_VIDEO_START(tx1); void tx1_palette(palette_device &palette) const; - DECLARE_MACHINE_RESET(buggyboy); DECLARE_VIDEO_START(buggyboy); void buggyboy_palette(palette_device &palette) const; DECLARE_VIDEO_START(buggybjr); diff --git a/src/mame/includes/undrfire.h b/src/mame/includes/undrfire.h index 9486d22a022..84fbf0a166c 100644 --- a/src/mame/includes/undrfire.h +++ b/src/mame/includes/undrfire.h @@ -68,7 +68,9 @@ private: int m_frame_counter; std::unique_ptr m_spritelist; u16 m_rotate_ctrl[8]; - u8 m_dislayer[6]; +#ifdef MAME_DEBUG + u8 m_dislayer[6] = { 0, 0, 0, 0, 0, 0 }; +#endif required_shared_ptr m_spriteram; required_device m_gfxdecode; required_device m_palette; diff --git a/src/mame/machine/tx1.cpp b/src/mame/machine/tx1.cpp index 52bb4d0561b..bcda21afd20 100644 --- a/src/mame/machine/tx1.cpp +++ b/src/mame/machine/tx1.cpp @@ -1334,18 +1334,12 @@ uint16_t tx1_state::buggyboy_spcs_ram_r(offs_t offset) * *************************************/ -MACHINE_RESET_MEMBER(tx1_state,buggyboy) +void tx1_state::machine_reset() { // TODO: This is connected to the /BUSACK line of the Z80 m_maincpu->set_input_line(INPUT_LINE_TEST, ASSERT_LINE); memset(&m_math, 0, sizeof(m_math)); -} - -MACHINE_RESET_MEMBER(tx1_state,tx1) -{ - // TODO: This is connected to the /BUSACK line of the Z80 - m_maincpu->set_input_line(INPUT_LINE_TEST, ASSERT_LINE); - memset(&m_math, 0, sizeof(m_math)); + m_sn74s516.state = 0; } diff --git a/src/mame/video/astrocde.cpp b/src/mame/video/astrocde.cpp index bce5c0db374..98cff92b8dc 100644 --- a/src/mame/video/astrocde.cpp +++ b/src/mame/video/astrocde.cpp @@ -215,6 +215,9 @@ VIDEO_START_MEMBER(astrocde_state,profpac) save_item(NAME(m_profpac_vw)); std::fill(std::begin(m_profpac_palette), std::end(m_profpac_palette), 0); + + m_pattern_height = 0; + m_pattern_width = 0; } diff --git a/src/mame/video/undrfire.cpp b/src/mame/video/undrfire.cpp index 6a1e451df63..91452d9e28c 100644 --- a/src/mame/video/undrfire.cpp +++ b/src/mame/video/undrfire.cpp @@ -14,6 +14,8 @@ void undrfire_state::video_start() for (int i = 0; i < 16384; i++) /* Fix later - some weird colours in places */ m_palette->set_pen_color(i, rgb_t(0,0,0)); + + m_frame_counter = 0; } /*************************************************************** -- cgit v1.2.3