summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Ivan Vangelista <mesgnet@yahoo.it>2021-02-21 09:03:00 +0100
committer Ivan Vangelista <mesgnet@yahoo.it>2021-02-21 09:03:00 +0100
commit85cb1fc955fe7a49356790330e72bb9f0acd9e09 (patch)
tree1c3fc0a1037c99fdb231bd5a88d0ae245c9aec4f
parenta425bd5d903ada7d738b9935eed299fe18a7f99f (diff)
missile, mpz80, mz700, pockstat, pofo, proteus3, savquest: initialized some variables which were causing incorrect behaviours in drvnoclear debug builds
-rw-r--r--src/mame/drivers/missile.cpp21
-rw-r--r--src/mame/drivers/mpz80.cpp1
-rw-r--r--src/mame/drivers/pockstat.cpp12
-rw-r--r--src/mame/drivers/pofo.cpp7
-rw-r--r--src/mame/drivers/proteus3.cpp12
-rw-r--r--src/mame/drivers/savquest.cpp23
-rw-r--r--src/mame/includes/mpz80.h7
-rw-r--r--src/mame/includes/mz700.h4
-rw-r--r--src/mame/includes/pc1251.h4
-rw-r--r--src/mame/includes/pc1350.h4
-rw-r--r--src/mame/includes/pc1401.h4
-rw-r--r--src/mame/includes/pc1403.h4
-rw-r--r--src/mame/machine/mz700.cpp4
13 files changed, 81 insertions, 26 deletions
diff --git a/src/mame/drivers/missile.cpp b/src/mame/drivers/missile.cpp
index b4c1d9c0823..857f69f810e 100644
--- a/src/mame/drivers/missile.cpp
+++ b/src/mame/drivers/missile.cpp
@@ -359,6 +359,9 @@ Super Missile Attack Board Layout
#include "screen.h"
#include "speaker.h"
+
+namespace {
+
class missile_state : public driver_device
{
public:
@@ -379,6 +382,8 @@ public:
, m_screen(*this, "screen")
, m_palette(*this, "palette")
, m_leds(*this, "led%u", 0U)
+ , m_mainrom(*this, "maincpu")
+ , m_writeprom(*this, "proms")
{ }
void missileb(machine_config &config);
@@ -390,6 +395,10 @@ public:
DECLARE_READ_LINE_MEMBER(vblank_r);
+protected:
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+
private:
void missile_w(address_space &space, offs_t offset, uint8_t data);
uint8_t missile_r(address_space &space, offs_t offset);
@@ -410,9 +419,6 @@ private:
void bootleg_main_map(address_map &map);
void main_map(address_map &map);
- virtual void machine_start() override;
- virtual void machine_reset() override;
-
required_device<m6502_device> m_maincpu;
required_shared_ptr<uint8_t> m_videoram;
required_device<watchdog_timer_device> m_watchdog;
@@ -429,8 +435,8 @@ private:
required_device<palette_device> m_palette;
output_finder<2> m_leds;
- const uint8_t *m_mainrom;
- const uint8_t *m_writeprom;
+ required_region_ptr<uint8_t> m_mainrom;
+ required_region_ptr<uint8_t> m_writeprom;
emu_timer *m_irq_timer;
emu_timer *m_cpu_timer;
uint8_t m_irq_state;
@@ -541,9 +547,8 @@ void missile_state::machine_start()
m_leds.resolve();
/* initialize globals */
- m_mainrom = memregion("maincpu")->base();
- m_writeprom = memregion("proms")->base();
m_flipscreen = 0;
+ m_ctrld = 0;
/* create a timer to speed/slow the CPU */
m_cpu_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(missile_state::adjust_cpu_speed),this));
@@ -1491,6 +1496,8 @@ void missile_state::init_missilem()
}
}
+} // Anonymous namespace
+
/*************************************
*
diff --git a/src/mame/drivers/mpz80.cpp b/src/mame/drivers/mpz80.cpp
index cc90d3b3a71..3b895600c85 100644
--- a/src/mame/drivers/mpz80.cpp
+++ b/src/mame/drivers/mpz80.cpp
@@ -687,6 +687,7 @@ static void mpz80_s100_cards(device_slot_interface &device)
void mpz80_state::machine_start()
{
+ m_task = 0;
}
diff --git a/src/mame/drivers/pockstat.cpp b/src/mame/drivers/pockstat.cpp
index bfa4b348c57..16e4d0833e1 100644
--- a/src/mame/drivers/pockstat.cpp
+++ b/src/mame/drivers/pockstat.cpp
@@ -4,7 +4,7 @@
Sony PocketStation
- PocketStation games were dowloaded from PS1 games into flash RAM after
+ PocketStation games were downloaded from PS1 games into flash RAM after
the unit had been inserted in the memory card slot, and so this should
be emulated alongside the PS1. However, as many flash dumps exist, it
is possible to emulate the PocketStation in the meantime.
@@ -55,6 +55,9 @@
#define VERBOSE (0)
#include "logmacro.h"
+
+namespace {
+
class pockstat_state : public driver_device
{
public:
@@ -69,10 +72,11 @@ public:
DECLARE_INPUT_CHANGED_MEMBER(input_update);
-private:
+protected:
virtual void machine_start() override;
virtual void machine_reset() override;
+private:
void mem_map(address_map &map);
uint32_t screen_update_pockstat(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
@@ -880,6 +884,7 @@ void pockstat_state::machine_start()
{
m_timers[index].timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pockstat_state::timer_tick), this));
m_timers[index].timer->adjust(attotime::never, index);
+ m_timers[index].count = 0;
}
m_rtc_regs.time = 0x01000000;
@@ -1013,6 +1018,9 @@ ROM_START( pockstat )
ROM_LOAD( "kernel.bin", 0x0000, 0x4000, CRC(5fb47dd8) SHA1(6ae880493ddde880827d1e9f08e9cb2c38f9f2ec) )
ROM_END
+} // Anonymous namespace
+
+
/* Driver */
// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS
diff --git a/src/mame/drivers/pofo.cpp b/src/mame/drivers/pofo.cpp
index c62af7e5ba4..32c158e9821 100644
--- a/src/mame/drivers/pofo.cpp
+++ b/src/mame/drivers/pofo.cpp
@@ -49,6 +49,7 @@
#include "speaker.h"
+namespace {
//**************************************************************************
// MACROS / CONSTANTS
@@ -92,10 +93,11 @@ public:
void portfolio(machine_config &config);
-private:
+protected:
virtual void machine_start() override;
virtual void machine_reset() override;
+private:
void portfolio_io(address_map &map);
void portfolio_lcdc(address_map &map);
void portfolio_mem(address_map &map);
@@ -990,6 +992,8 @@ void portfolio_state::machine_start()
save_item(NAME(m_counter));
save_item(NAME(m_keylatch));
save_item(NAME(m_rom_b));
+
+ m_ip = 0;
}
@@ -1086,6 +1090,7 @@ ROM_START( pofo )
ROM_LOAD( "c101783-001a-01.u3", 0x0000, 0x8000, CRC(61fdaff1) SHA1(5eb99e7a19af7b8d77ea8a2f1f554e6e3d382fa2) )
ROM_END
+} // Anonymous namespace
//**************************************************************************
diff --git a/src/mame/drivers/proteus3.cpp b/src/mame/drivers/proteus3.cpp
index 25b11c513ca..846f61ccc9b 100644
--- a/src/mame/drivers/proteus3.cpp
+++ b/src/mame/drivers/proteus3.cpp
@@ -61,6 +61,8 @@
#include "speaker.h"
+namespace {
+
class proteus3_state : public driver_device
{
public:
@@ -78,6 +80,10 @@ public:
void proteus3(machine_config &config);
+protected:
+ virtual void machine_reset() override;
+ virtual void machine_start() override;
+
private:
DECLARE_WRITE_LINE_MEMBER(ca2_w);
void video_w(u8 data);
@@ -106,8 +112,6 @@ private:
void mem_map(address_map &map);
- virtual void machine_reset() override;
- virtual void machine_start() override;
u8 m_video_data;
u8 m_flashcnt;
u16 m_curs_pos;
@@ -385,6 +389,8 @@ void proteus3_state::machine_start()
save_item(NAME(m_cassbit));
save_item(NAME(m_cassold));
save_item(NAME(m_cassinbit));
+
+ m_flashcnt = 0;
}
/******************************************************************************
@@ -492,6 +498,8 @@ ROM_START(proteus3)
ROM_LOAD( "proteus3_pbug.bin", 0x0000, 0x0800, CRC(1118694d) SHA1(2dfc08d405e8f2936f5b0bd1c4007995151abbba) )
ROM_END
+} // Anonymous namespace
+
/******************************************************************************
Drivers
diff --git a/src/mame/drivers/savquest.cpp b/src/mame/drivers/savquest.cpp
index b71f6a57910..674ed351156 100644
--- a/src/mame/drivers/savquest.cpp
+++ b/src/mame/drivers/savquest.cpp
@@ -2,7 +2,7 @@
// copyright-holders:R. Belmont, Peter Ferrie
/***************************************************************************
- savquest.c
+ savquest.cpp
"Savage Quest" (c) 1999 Interactive Light, developed by Angel Studios.
Skeleton by R. Belmont
@@ -59,6 +59,9 @@
#include "machine/ds128x.h"
#include "bus/isa/sblaster.h"
+
+namespace {
+
class savquest_state : public pcat_base_state
{
public:
@@ -67,10 +70,18 @@ public:
m_vga(*this, "vga"),
m_voodoo(*this, "voodoo")
{
+ std::fill(std::begin(m_mtxc_config_reg), std::end(m_mtxc_config_reg), 0);
}
void savquest(machine_config &config);
+protected:
+ // driver_device overrides
+// virtual void video_start();
+
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+
private:
std::unique_ptr<uint32_t[]> m_bios_f0000_ram;
std::unique_ptr<uint32_t[]> m_bios_e0000_ram;
@@ -119,11 +130,6 @@ private:
void savquest_io(address_map &map);
void savquest_map(address_map &map);
- // driver_device overrides
-// virtual void video_start();
-
- virtual void machine_start() override;
- virtual void machine_reset() override;
void intel82439tx_init();
void vid_3dfx_init();
@@ -791,6 +797,9 @@ void savquest_state::machine_start()
intel82439tx_init();
vid_3dfx_init();
+
+ for (int i = 0; i < 8; i++)
+ std::fill(std::begin(m_piix4_config_reg[i]), std::end(m_piix4_config_reg[i]), 0);
}
void savquest_state::machine_reset()
@@ -865,5 +874,7 @@ ROM_START( savquest )
DISK_IMAGE( "savquest", 0, SHA1(b7c8901172b66706a7ab5f5c91e6912855153fa9) )
ROM_END
+} // Anonymous namespace
+
GAME(1999, savquest, 0, savquest, savquest, savquest_state, empty_init, ROT0, "Interactive Light", "Savage Quest", MACHINE_IS_SKELETON)
diff --git a/src/mame/includes/mpz80.h b/src/mame/includes/mpz80.h
index 13b116bb3fc..1391a4501eb 100644
--- a/src/mame/includes/mpz80.h
+++ b/src/mame/includes/mpz80.h
@@ -39,6 +39,10 @@ public:
void mpz80(machine_config &config);
+protected:
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+
private:
required_device<cpu_device> m_maincpu;
required_device<ram_device> m_ram;
@@ -47,9 +51,6 @@ private:
memory_share_creator<uint8_t> m_map_ram;
required_ioport m_16c;
- virtual void machine_start() override;
- virtual void machine_reset() override;
-
inline offs_t get_address(offs_t offset);
inline offs_t get_io_address(offs_t offset);
diff --git a/src/mame/includes/mz700.h b/src/mame/includes/mz700.h
index 8e72a4a6dc1..321c09431fb 100644
--- a/src/mame/includes/mz700.h
+++ b/src/mame/includes/mz700.h
@@ -50,6 +50,9 @@ public:
void init_mz800();
void init_mz700();
+protected:
+ virtual void machine_start() override;
+
private:
uint8_t mz700_e008_r();
void mz700_e008_w(uint8_t data);
@@ -75,7 +78,6 @@ private:
void mz800_cgram_w(offs_t offset, uint8_t data);
DECLARE_MACHINE_RESET(mz700);
DECLARE_MACHINE_RESET(mz800);
- virtual void machine_start() override;
uint32_t screen_update_mz700(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t screen_update_mz800(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(ne556_cursor_callback);
diff --git a/src/mame/includes/pc1251.h b/src/mame/includes/pc1251.h
index 50d01e79643..90e8c926b11 100644
--- a/src/mame/includes/pc1251.h
+++ b/src/mame/includes/pc1251.h
@@ -20,7 +20,9 @@ public:
: pocketc_state(mconfig, type, tag)
, m_keys(*this, "KEY%u", 0U)
, m_mode(*this, "MODE")
- { }
+ {
+ std::fill(std::begin(m_reg), std::end(m_reg), 0);
+ }
void init_pc1251();
diff --git a/src/mame/includes/pc1350.h b/src/mame/includes/pc1350.h
index bf7e8d0e021..68869f8bab9 100644
--- a/src/mame/includes/pc1350.h
+++ b/src/mame/includes/pc1350.h
@@ -21,7 +21,9 @@ public:
: pocketc_state(mconfig, type, tag)
, m_ram(*this, RAM_TAG)
, m_keys(*this, "KEY%u", 0U)
- { }
+ {
+ std::fill(std::begin(m_reg), std::end(m_reg), 0);
+ }
void pc1350(machine_config &config);
diff --git a/src/mame/includes/pc1401.h b/src/mame/includes/pc1401.h
index d3c10f8154a..6bfc9fd342b 100644
--- a/src/mame/includes/pc1401.h
+++ b/src/mame/includes/pc1401.h
@@ -19,7 +19,9 @@ public:
pc1401_state(const machine_config &mconfig, device_type type, const char *tag)
: pocketc_state(mconfig, type, tag)
, m_keys(*this, "KEY%u", 0U)
- { }
+ {
+ std::fill(std::begin(m_reg), std::end(m_reg), 0);
+ }
void init_pc1401();
diff --git a/src/mame/includes/pc1403.h b/src/mame/includes/pc1403.h
index deb5363ce31..f34a00dd688 100644
--- a/src/mame/includes/pc1403.h
+++ b/src/mame/includes/pc1403.h
@@ -19,7 +19,9 @@ public:
pc1403_state(const machine_config &mconfig, device_type type, const char *tag)
: pocketc_state(mconfig, type, tag)
, m_keys(*this, "KEY%u", 0U)
- { }
+ {
+ std::fill(std::begin(m_reg), std::end(m_reg), 0);
+ }
void pc1403(machine_config &config);
void pc1403h(machine_config &config);
diff --git a/src/mame/machine/mz700.cpp b/src/mame/machine/mz700.cpp
index 139e3f4943b..49182df4202 100644
--- a/src/mame/machine/mz700.cpp
+++ b/src/mame/machine/mz700.cpp
@@ -91,6 +91,10 @@ void mz_state::machine_start()
{
/* reset memory map to defaults */
mz700_bank_4_w(0);
+
+ m_cursor_bit = 0;
+ m_speaker_level = 0;
+ m_prev_state = 0;
}
MACHINE_RESET_MEMBER( mz_state, mz700 )