From c97d6bcfe0d62efdcbcc43332a9f6d9d7c8d7048 Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Sat, 4 Sep 2010 17:30:45 +0000 Subject: [PATCH] Fix most reported regressions. A few more still to come. --- src/mame/drivers/1945kiii.c | 8 ++++---- src/mame/drivers/attckufo.c | 8 ++++---- src/mame/drivers/mirage.c | 16 ++++++++-------- src/mame/drivers/splash.c | 4 ++-- src/mame/includes/balsente.h | 22 +++++++++++++--------- src/mame/includes/cninja.h | 4 ++-- src/mame/includes/metro.h | 4 ++-- src/mame/includes/mitchell.h | 2 +- src/mame/includes/segas16.h | 2 +- src/mame/includes/taito_f2.h | 2 +- src/mame/machine/balsente.c | 7 +++++++ 11 files changed, 45 insertions(+), 34 deletions(-) diff --git a/src/mame/drivers/1945kiii.c b/src/mame/drivers/1945kiii.c index 91e30847351..ed195024696 100644 --- a/src/mame/drivers/1945kiii.c +++ b/src/mame/drivers/1945kiii.c @@ -52,8 +52,8 @@ class k3_state : public driver_device public: k3_state(running_machine &machine, const driver_device_config_base &config) : driver_device(machine, config), - oki1(machine.device("oki1")), - oki2(machine.device("oki2")) { } + oki1(*this, "oki1"), + oki2(*this, "oki2") { } /* memory pointers */ UINT16 * spriteram_1; @@ -65,8 +65,8 @@ public: tilemap_t *bg_tilemap; /* devices */ - okim6295_device *oki1; - okim6295_device *oki2; + required_device oki1; + required_device oki2; }; diff --git a/src/mame/drivers/attckufo.c b/src/mame/drivers/attckufo.c index 9ed929267ae..a662c29316f 100644 --- a/src/mame/drivers/attckufo.c +++ b/src/mame/drivers/attckufo.c @@ -51,16 +51,16 @@ class attckufo_state : public driver_device public: attckufo_state(running_machine &machine, const driver_device_config_base &config) : driver_device(machine, config), - maincpu(machine.device("maincpu")), - mos6560(machine.device("mos6560")) { } + maincpu(*this, "maincpu"), + mos6560(*this, "mos6560") { } /* memory pointers */ UINT8 * mainram; UINT8 * tileram; /* devices */ - cpu_device *maincpu; - running_device *mos6560; + required_device maincpu; + required_device mos6560; }; diff --git a/src/mame/drivers/mirage.c b/src/mame/drivers/mirage.c index d1a786cf620..5b68bf1efd9 100644 --- a/src/mame/drivers/mirage.c +++ b/src/mame/drivers/mirage.c @@ -44,10 +44,10 @@ class mirage_state : public driver_device public: mirage_state(running_machine &machine, const driver_device_config_base &config) : driver_device(machine, config), - maincpu(machine.device("maincpu")), - deco16ic(machine.device("deco_custom")), - oki_sfx(machine.device("oki_sfx")), - oki_bgm(machine.device("oki_bgm")) { } + maincpu(*this, "maincpu"), + deco16ic(*this, "deco_custom"), + oki_sfx(*this, "oki_sfx"), + oki_bgm(*this, "oki_bgm") { } /* memory pointers */ UINT16 * pf1_rowscroll; @@ -60,10 +60,10 @@ public: UINT32 mux_data; /* devices */ - cpu_device *maincpu; - deco16ic_device *deco16ic; - okim6295_device *oki_sfx; - okim6295_device *oki_bgm; + required_device maincpu; + required_device deco16ic; + required_device oki_sfx; + required_device oki_bgm; }; diff --git a/src/mame/drivers/splash.c b/src/mame/drivers/splash.c index 2d6faa4c957..760b0e9ab29 100644 --- a/src/mame/drivers/splash.c +++ b/src/mame/drivers/splash.c @@ -435,7 +435,7 @@ static const ym2203_interface ym2203_config = ym_irq }; -static MACHINE_CONFIG_START( roldfrog, driver_device ) +static MACHINE_CONFIG_START( roldfrog, splash_state ) /* basic machine hardware */ MDRV_CPU_ADD("maincpu", M68000,24000000/2) /* 12 MHz - verified */ @@ -475,7 +475,7 @@ static MACHINE_CONFIG_START( roldfrog, driver_device ) MACHINE_CONFIG_END -static MACHINE_CONFIG_START( funystrp, driver_device ) +static MACHINE_CONFIG_START( funystrp, splash_state ) /* basic machine hardware */ MDRV_CPU_ADD("maincpu", M68000,24000000/2) /* 12 MHz (24/2) */ diff --git a/src/mame/includes/balsente.h b/src/mame/includes/balsente.h index 38aabcecfa8..6ee763bc67e 100644 --- a/src/mame/includes/balsente.h +++ b/src/mame/includes/balsente.h @@ -32,15 +32,13 @@ public: balsente_state(running_machine &machine, const driver_device_config_base &config) : driver_device(machine, config), scanline_timer(*this, "scan_timer"), - counter_0_timer(*this, "8253_0_timer") - { - astring temp; - for (int i = 0; i < ARRAY_LENGTH(cem_device); i++) - { - cem_device[i] = machine.device(temp.format("cem%d", i+1)); - assert(cem_device[i] != NULL); - } - } + counter_0_timer(*this, "8253_0_timer"), + m_cem1(*this, "cem1"), + m_cem2(*this, "cem2"), + m_cem3(*this, "cem3"), + m_cem4(*this, "cem4"), + m_cem5(*this, "cem5"), + m_cem6(*this, "cem6") { } /* global data */ UINT8 shooter; @@ -100,6 +98,12 @@ public: /* noise generator states */ UINT32 noise_position[6]; + required_device m_cem1; + required_device m_cem2; + required_device m_cem3; + required_device m_cem4; + required_device m_cem5; + required_device m_cem6; cem3394_device *cem_device[6]; /* game-specific states */ diff --git a/src/mame/includes/cninja.h b/src/mame/includes/cninja.h index b85111d1521..7c80cb24179 100644 --- a/src/mame/includes/cninja.h +++ b/src/mame/includes/cninja.h @@ -32,8 +32,8 @@ public: required_device maincpu; required_device audiocpu; required_device deco16ic; - required_device raster_irq_timer; - required_device oki2; + optional_device raster_irq_timer; + optional_device oki2; }; /*----------- defined in video/cninja.c -----------*/ diff --git a/src/mame/includes/metro.h b/src/mame/includes/metro.h index 7a0ae41829d..fbea40970ff 100644 --- a/src/mame/includes/metro.h +++ b/src/mame/includes/metro.h @@ -82,9 +82,9 @@ public: /* devices */ required_device maincpu; required_device audiocpu; - required_device oki; + optional_device oki; required_device ymsnd; - required_device k053936; + optional_device k053936; }; diff --git a/src/mame/includes/mitchell.h b/src/mame/includes/mitchell.h index 0bcac7ad868..b77efcc8931 100644 --- a/src/mame/includes/mitchell.h +++ b/src/mame/includes/mitchell.h @@ -37,7 +37,7 @@ public: int keymatrix; /* devices */ - required_device audiocpu; + optional_device audiocpu; required_device oki; }; diff --git a/src/mame/includes/segas16.h b/src/mame/includes/segas16.h index cfcb7305a05..327ade6faba 100644 --- a/src/mame/includes/segas16.h +++ b/src/mame/includes/segas16.h @@ -92,7 +92,7 @@ public: running_device *n7751; running_device *ppi8255_1; running_device *ppi8255_2; - required_device interrupt_timer; + optional_device interrupt_timer; running_device *_315_5248_1; running_device *_315_5250_1; running_device *_315_5250_2; diff --git a/src/mame/includes/taito_f2.h b/src/mame/includes/taito_f2.h index bcd12dbe02d..25c2ebdce63 100644 --- a/src/mame/includes/taito_f2.h +++ b/src/mame/includes/taito_f2.h @@ -68,7 +68,7 @@ public: /* devices */ running_device *maincpu; running_device *audiocpu; - required_device oki; + optional_device oki; running_device *tc0100scn; running_device *tc0100scn_1; running_device *tc0100scn_2; diff --git a/src/mame/machine/balsente.c b/src/mame/machine/balsente.c index d5a076073df..71e62c652e4 100644 --- a/src/mame/machine/balsente.c +++ b/src/mame/machine/balsente.c @@ -80,6 +80,13 @@ MACHINE_START( balsente ) { balsente_state *state = machine->driver_data(); int i; + + state->cem_device[0] = state->m_cem1; + state->cem_device[1] = state->m_cem2; + state->cem_device[2] = state->m_cem3; + state->cem_device[3] = state->m_cem4; + state->cem_device[4] = state->m_cem5; + state->cem_device[5] = state->m_cem6; /* create the polynomial tables */ poly17_init(machine);