summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame
diff options
context:
space:
mode:
author Fabio Priuli <etabeta78@users.noreply.github.com>2009-11-29 01:57:36 +0000
committer Fabio Priuli <etabeta78@users.noreply.github.com>2009-11-29 01:57:36 +0000
commit6446f7ffa5a547e629da4868f0c3dfa2aa52c6c9 (patch)
treefe0a8ef860b7246cbe35f5070e5db8dd4ddf615a /src/mame
parent1a309ff78bdcee422f903153b0d35a3db4d8a27c (diff)
same as 7449 (less cputag calls during emulation and no generic sizes for struct elements) for a few remaining drivers
both changes are not really worth mention in the whatsnew, imho
Diffstat (limited to 'src/mame')
-rw-r--r--src/mame/drivers/astrof.c18
-rw-r--r--src/mame/drivers/beaminv.c7
-rw-r--r--src/mame/drivers/brkthru.c40
-rw-r--r--src/mame/drivers/btime.c18
-rw-r--r--src/mame/drivers/bublbobl.c14
-rw-r--r--src/mame/drivers/bwing.c32
-rw-r--r--src/mame/drivers/missb2.c2
-rw-r--r--src/mame/includes/astrof.h1
-rw-r--r--src/mame/includes/brkthru.h8
-rw-r--r--src/mame/includes/btime.h4
-rw-r--r--src/mame/includes/bublbobl.h6
-rw-r--r--src/mame/includes/bwing.h5
-rw-r--r--src/mame/machine/bublbobl.c22
-rw-r--r--src/mame/video/brkthru.c6
-rw-r--r--src/mame/video/btime.c2
15 files changed, 122 insertions, 63 deletions
diff --git a/src/mame/drivers/astrof.c b/src/mame/drivers/astrof.c
index 2e1cf7ea673..d6bbc38c9d7 100644
--- a/src/mame/drivers/astrof.c
+++ b/src/mame/drivers/astrof.c
@@ -71,7 +71,8 @@
static READ8_HANDLER( irq_clear_r )
{
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ astrof_state *state = (astrof_state *)space->machine->driver_data;
+ cpu_set_input_line(state->maincpu, 0, CLEAR_LINE);
return 0;
}
@@ -79,7 +80,8 @@ static READ8_HANDLER( irq_clear_r )
static TIMER_DEVICE_CALLBACK( irq_callback )
{
- cputag_set_input_line(timer->machine, "maincpu", 0, ASSERT_LINE);
+ astrof_state *state = (astrof_state *)timer->machine->driver_data;
+ cpu_set_input_line(state->maincpu, 0, ASSERT_LINE);
}
@@ -92,16 +94,20 @@ static TIMER_DEVICE_CALLBACK( irq_callback )
static INPUT_CHANGED( coin_inserted )
{
+ astrof_state *state = (astrof_state *)field->port->machine->driver_data;
+
/* coin insertion causes an NMI */
- cputag_set_input_line(field->port->machine, "maincpu", INPUT_LINE_NMI, newval ? ASSERT_LINE : CLEAR_LINE);
+ cpu_set_input_line(state->maincpu, INPUT_LINE_NMI, newval ? ASSERT_LINE : CLEAR_LINE);
coin_counter_w(field->port->machine, 0, newval);
}
static INPUT_CHANGED( service_coin_inserted )
{
+ astrof_state *state = (astrof_state *)field->port->machine->driver_data;
+
/* service coin insertion causes an NMI */
- cputag_set_input_line(field->port->machine, "maincpu", INPUT_LINE_NMI, newval ? ASSERT_LINE : CLEAR_LINE);
+ cpu_set_input_line(state->maincpu, INPUT_LINE_NMI, newval ? ASSERT_LINE : CLEAR_LINE);
}
@@ -436,6 +442,7 @@ static MACHINE_START( astrof )
/* the 74175 outputs all HI's if not otherwise set */
astrof_set_video_control_2(machine, 0xff);
+ state->maincpu = devtag_get_device(machine, "maincpu");
state->samples = devtag_get_device(machine, "samples");
/* register for state saving */
@@ -469,6 +476,8 @@ static MACHINE_START( spfghmk2 )
/* the 74175 outputs all HI's if not otherwise set */
spfghmk2_set_video_control_2(machine, 0xff);
+ state->maincpu = devtag_get_device(machine, "maincpu");
+
/* the red background circuit is disabled */
state->red_on = FALSE;
@@ -486,6 +495,7 @@ static MACHINE_START( tomahawk )
/* the 74175 outputs all HI's if not otherwise set */
tomahawk_set_video_control_2(machine, 0xff);
+ state->maincpu = devtag_get_device(machine, "maincpu");
state->sn = devtag_get_device(machine, "snsnd");
/* register for state saving */
diff --git a/src/mame/drivers/beaminv.c b/src/mame/drivers/beaminv.c
index bfcea82b78d..9957bf0c2da 100644
--- a/src/mame/drivers/beaminv.c
+++ b/src/mame/drivers/beaminv.c
@@ -67,6 +67,9 @@ struct _beaminv_state
/* input-related */
UINT8 controller_select;
+
+ /* devices */
+ const device_config *maincpu;
};
@@ -91,7 +94,7 @@ static TIMER_CALLBACK( interrupt_callback )
int next_interrupt_number;
int next_vpos;
- cputag_set_input_line(machine, "maincpu", 0, HOLD_LINE);
+ cpu_set_input_line(state->maincpu, 0, HOLD_LINE);
/* set up for next interrupt */
next_interrupt_number = (interrupt_number + 1) % INTERRUPTS_PER_FRAME;
@@ -128,6 +131,8 @@ static MACHINE_START( beaminv )
beaminv_state *state = (beaminv_state *)machine->driver_data;
create_interrupt_timer(machine);
+ state->maincpu = devtag_get_device(machine, "maincpu");
+
/* setup for save states */
state_save_register_global(machine, state->controller_select);
}
diff --git a/src/mame/drivers/brkthru.c b/src/mame/drivers/brkthru.c
index b01cb024d87..fc07446671b 100644
--- a/src/mame/drivers/brkthru.c
+++ b/src/mame/drivers/brkthru.c
@@ -67,30 +67,34 @@
static WRITE8_HANDLER( brkthru_1803_w )
{
+ brkthru_state *state = (brkthru_state *)space->machine->driver_data;
/* bit 0 = NMI enable */
- cpu_interrupt_enable(cputag_get_cpu(space->machine, "maincpu"), ~data & 1);
+ cpu_interrupt_enable(state->maincpu, ~data & 1);
/* bit 1 = ? maybe IRQ acknowledge */
}
static WRITE8_HANDLER( darwin_0803_w )
{
+ brkthru_state *state = (brkthru_state *)space->machine->driver_data;
/* bit 0 = NMI enable */
- /*cpu_interrupt_enable(cputag_get_cpu(space->machine, "audiocpu"), ~data & 1);*/
+ /*cpu_interrupt_enable(state->audiocpu, ~data & 1);*/
logerror("0803 %02X\n",data);
- cpu_interrupt_enable(cputag_get_cpu(space->machine, "maincpu"), data & 1);
+ cpu_interrupt_enable(state->maincpu, data & 1);
/* bit 1 = ? maybe IRQ acknowledge */
}
static WRITE8_HANDLER( brkthru_soundlatch_w )
{
+ brkthru_state *state = (brkthru_state *)space->machine->driver_data;
soundlatch_w(space, offset, data);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
}
static INPUT_CHANGED( coin_inserted )
{
+ brkthru_state *state = (brkthru_state *)field->port->machine->driver_data;
/* coin insertion causes an IRQ */
- cputag_set_input_line(field->port->machine, "maincpu", 0, newval ? CLEAR_LINE : ASSERT_LINE);
+ cpu_set_input_line(state->maincpu, 0, newval ? CLEAR_LINE : ASSERT_LINE);
}
@@ -103,8 +107,8 @@ static INPUT_CHANGED( coin_inserted )
static ADDRESS_MAP_START( brkthru_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x03ff) AM_RAM_WRITE(brkthru_fgram_w) AM_BASE_SIZE_MEMBER(brkthru_state, fg_videoram, fg_videoram_size)
AM_RANGE(0x0400, 0x0bff) AM_RAM
- AM_RANGE(0x0c00, 0x0fff) AM_RAM_WRITE(brkthru_bgram_w) AM_BASE_MEMBER(brkthru_state, videoram) AM_SIZE_GENERIC(videoram)
- AM_RANGE(0x1000, 0x10ff) AM_RAM AM_BASE_MEMBER(brkthru_state, spriteram) AM_SIZE_GENERIC(spriteram)
+ AM_RANGE(0x0c00, 0x0fff) AM_RAM_WRITE(brkthru_bgram_w) AM_BASE_MEMBER(brkthru_state, videoram) AM_SIZE_MEMBER(brkthru_state, videoram_size)
+ AM_RANGE(0x1000, 0x10ff) AM_RAM AM_BASE_MEMBER(brkthru_state, spriteram) AM_SIZE_MEMBER(brkthru_state, spriteram_size)
AM_RANGE(0x1100, 0x17ff) AM_RAM
AM_RANGE(0x1800, 0x1800) AM_READ_PORT("P1")
AM_RANGE(0x1801, 0x1801) AM_READ_PORT("P2")
@@ -121,8 +125,8 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( darwin_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(brkthru_fgram_w) AM_BASE_SIZE_MEMBER(brkthru_state, fg_videoram, fg_videoram_size)
AM_RANGE(0x1400, 0x1bff) AM_RAM
- AM_RANGE(0x1c00, 0x1fff) AM_RAM_WRITE(brkthru_bgram_w) AM_BASE_MEMBER(brkthru_state, videoram) AM_SIZE_GENERIC(videoram)
- AM_RANGE(0x0000, 0x00ff) AM_RAM AM_BASE_MEMBER(brkthru_state, spriteram) AM_SIZE_GENERIC(spriteram)
+ AM_RANGE(0x1c00, 0x1fff) AM_RAM_WRITE(brkthru_bgram_w) AM_BASE_MEMBER(brkthru_state, videoram) AM_SIZE_MEMBER(brkthru_state, videoram_size)
+ AM_RANGE(0x0000, 0x00ff) AM_RAM AM_BASE_MEMBER(brkthru_state, spriteram) AM_SIZE_MEMBER(brkthru_state, spriteram_size)
AM_RANGE(0x0100, 0x01ff) AM_WRITENOP /*tidyup, nothing realy here?*/
AM_RANGE(0x0800, 0x0800) AM_READ_PORT("P1")
AM_RANGE(0x0801, 0x0801) AM_READ_PORT("P2")
@@ -340,9 +344,10 @@ GFXDECODE_END
*************************************/
/* handler called by the 3812 emulator when the internal timers cause an IRQ */
-static void irqhandler(const device_config *device, int linestate)
+static void irqhandler( const device_config *device, int linestate )
{
- cputag_set_input_line(device->machine, "audiocpu", M6809_IRQ_LINE, linestate);
+ brkthru_state *state = (brkthru_state *)device->machine->driver_data;
+ cpu_set_input_line(state->audiocpu, M6809_IRQ_LINE, linestate);
}
static const ym3526_interface ym3526_config =
@@ -358,6 +363,18 @@ static const ym3526_interface ym3526_config =
*
*************************************/
+static MACHINE_START( brkthru )
+{
+ brkthru_state *state = (brkthru_state *)machine->driver_data;
+
+ state->maincpu = devtag_get_device(machine, "maincpu");
+ state->audiocpu = devtag_get_device(machine, "audiocpu");
+
+ state_save_register_global(machine, state->bgscroll);
+ state_save_register_global(machine, state->bgbasecolor);
+ state_save_register_global(machine, state->flipscreen);
+}
+
static MACHINE_RESET( brkthru )
{
brkthru_state *state = (brkthru_state *)machine->driver_data;
@@ -380,6 +397,7 @@ static MACHINE_DRIVER_START( brkthru )
MDRV_CPU_ADD("audiocpu", M6809, MASTER_CLOCK/8) /* 1.5 MHz ? */
MDRV_CPU_PROGRAM_MAP(sound_map)
+ MDRV_MACHINE_START(brkthru)
MDRV_MACHINE_RESET(brkthru)
/* video hardware */
diff --git a/src/mame/drivers/btime.c b/src/mame/drivers/btime.c
index 625cb98dd3c..42ba85a730d 100644
--- a/src/mame/drivers/btime.c
+++ b/src/mame/drivers/btime.c
@@ -360,7 +360,7 @@ static ADDRESS_MAP_START( btime_map, ADDRESS_SPACE_PROGRAM, 8 )
/* support ROM decryption */
AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE_MEMBER(btime_state, rambase)
AM_RANGE(0x0c00, 0x0c0f) AM_WRITE(btime_paletteram_w) AM_BASE_GENERIC(paletteram)
- AM_RANGE(0x1000, 0x13ff) AM_RAM AM_BASE_MEMBER(btime_state, videoram) AM_SIZE_GENERIC(videoram)
+ AM_RANGE(0x1000, 0x13ff) AM_RAM AM_BASE_MEMBER(btime_state, videoram) AM_SIZE_MEMBER(btime_state, videoram_size)
AM_RANGE(0x1400, 0x17ff) AM_RAM AM_BASE_MEMBER(btime_state, colorram)
AM_RANGE(0x1800, 0x1bff) AM_READWRITE(btime_mirrorvideoram_r, btime_mirrorvideoram_w)
AM_RANGE(0x1c00, 0x1fff) AM_READWRITE(btime_mirrorcolorram_r, btime_mirrorcolorram_w)
@@ -375,7 +375,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( cookrace_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x03ff) AM_RAM AM_BASE_MEMBER(btime_state, rambase)
AM_RANGE(0x0500, 0x3fff) AM_ROM
- AM_RANGE(0xc000, 0xc3ff) AM_RAM AM_BASE_MEMBER(btime_state, videoram) AM_SIZE_GENERIC(videoram)
+ AM_RANGE(0xc000, 0xc3ff) AM_RAM AM_BASE_MEMBER(btime_state, videoram) AM_SIZE_MEMBER(btime_state, videoram_size)
AM_RANGE(0xc400, 0xc7ff) AM_RAM AM_BASE_MEMBER(btime_state, colorram)
AM_RANGE(0xc800, 0xcbff) AM_READWRITE(btime_mirrorvideoram_r, btime_mirrorvideoram_w)
AM_RANGE(0xcc00, 0xcfff) AM_READWRITE(btime_mirrorcolorram_r, btime_mirrorcolorram_w)
@@ -397,7 +397,7 @@ static ADDRESS_MAP_START( tisland_map, ADDRESS_SPACE_PROGRAM, 8 )
/* support ROM decryption */
AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE_MEMBER(btime_state, rambase)
AM_RANGE(0x0c00, 0x0c0f) AM_WRITE(btime_paletteram_w) AM_BASE_GENERIC(paletteram)
- AM_RANGE(0x1000, 0x13ff) AM_RAM AM_BASE_MEMBER(btime_state, videoram) AM_SIZE_GENERIC(videoram)
+ AM_RANGE(0x1000, 0x13ff) AM_RAM AM_BASE_MEMBER(btime_state, videoram) AM_SIZE_MEMBER(btime_state, videoram_size)
AM_RANGE(0x1400, 0x17ff) AM_RAM AM_BASE_MEMBER(btime_state, colorram)
AM_RANGE(0x1800, 0x1bff) AM_READWRITE(btime_mirrorvideoram_r, btime_mirrorvideoram_w)
AM_RANGE(0x1c00, 0x1fff) AM_READWRITE(btime_mirrorcolorram_r, btime_mirrorcolorram_w)
@@ -414,7 +414,7 @@ static ADDRESS_MAP_START( zoar_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0xffff) AM_WRITE(zoar_w) /* override the following entries to */
/* support ROM decryption */
AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE_MEMBER(btime_state, rambase)
- AM_RANGE(0x8000, 0x83ff) AM_WRITEONLY AM_BASE_MEMBER(btime_state, videoram) AM_SIZE_GENERIC(videoram)
+ AM_RANGE(0x8000, 0x83ff) AM_WRITEONLY AM_BASE_MEMBER(btime_state, videoram) AM_SIZE_MEMBER(btime_state, videoram_size)
AM_RANGE(0x8400, 0x87ff) AM_WRITEONLY AM_BASE_MEMBER(btime_state, colorram)
AM_RANGE(0x8800, 0x8bff) AM_WRITE(btime_mirrorvideoram_w)
AM_RANGE(0x8c00, 0x8fff) AM_WRITE(btime_mirrorcolorram_w)
@@ -434,7 +434,7 @@ static ADDRESS_MAP_START( lnc_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0xffff) AM_WRITE(lnc_w) /* override the following entries to */
/* support ROM decryption */
AM_RANGE(0x0000, 0x3bff) AM_RAM AM_BASE_MEMBER(btime_state, rambase)
- AM_RANGE(0x3c00, 0x3fff) AM_RAM_WRITE(lnc_videoram_w) AM_BASE_MEMBER(btime_state, videoram) AM_SIZE_GENERIC(videoram)
+ AM_RANGE(0x3c00, 0x3fff) AM_RAM_WRITE(lnc_videoram_w) AM_BASE_MEMBER(btime_state, videoram) AM_SIZE_MEMBER(btime_state, videoram_size)
AM_RANGE(0x7800, 0x7bff) AM_WRITEONLY AM_BASE_MEMBER(btime_state, colorram) /* this is just here to initialize the pointer */
AM_RANGE(0x7c00, 0x7fff) AM_READWRITE(btime_mirrorvideoram_r, lnc_mirrorvideoram_w)
AM_RANGE(0x8000, 0x8000) AM_READ_PORT("DSW1") AM_WRITENOP /* ??? */
@@ -451,7 +451,7 @@ static ADDRESS_MAP_START( mmonkey_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0xffff) AM_WRITE(mmonkey_w) /* override the following entries to */
/* support ROM decryption */
AM_RANGE(0x0000, 0x3bff) AM_RAM AM_BASE_MEMBER(btime_state, rambase)
- AM_RANGE(0x3c00, 0x3fff) AM_RAM_WRITE(lnc_videoram_w) AM_BASE_MEMBER(btime_state, videoram) AM_SIZE_GENERIC(videoram)
+ AM_RANGE(0x3c00, 0x3fff) AM_RAM_WRITE(lnc_videoram_w) AM_BASE_MEMBER(btime_state, videoram) AM_SIZE_MEMBER(btime_state, videoram_size)
AM_RANGE(0x7800, 0x7bff) AM_WRITEONLY AM_BASE_MEMBER(btime_state, colorram) /* this is just here to initialize the pointer */
AM_RANGE(0x7c00, 0x7fff) AM_READWRITE(btime_mirrorvideoram_r, lnc_mirrorvideoram_w)
AM_RANGE(0x8000, 0x8000) AM_READ_PORT("DSW1")
@@ -471,7 +471,7 @@ static ADDRESS_MAP_START( bnj_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x1002, 0x1002) AM_READ_PORT("P1") AM_WRITE(audio_command_w)
AM_RANGE(0x1003, 0x1003) AM_READ_PORT("P2")
AM_RANGE(0x1004, 0x1004) AM_READ_PORT("SYSTEM")
- AM_RANGE(0x4000, 0x43ff) AM_RAM AM_BASE_MEMBER(btime_state, videoram) AM_SIZE_GENERIC(videoram)
+ AM_RANGE(0x4000, 0x43ff) AM_RAM AM_BASE_MEMBER(btime_state, videoram) AM_SIZE_MEMBER(btime_state, videoram_size)
AM_RANGE(0x4400, 0x47ff) AM_RAM AM_BASE_MEMBER(btime_state, colorram)
AM_RANGE(0x4800, 0x4bff) AM_READWRITE(btime_mirrorvideoram_r, btime_mirrorvideoram_w)
AM_RANGE(0x4c00, 0x4fff) AM_READWRITE(btime_mirrorcolorram_r, btime_mirrorcolorram_w)
@@ -487,9 +487,9 @@ static ADDRESS_MAP_START( disco_map, ADDRESS_SPACE_PROGRAM, 8 )
/* support ROM decryption */
AM_RANGE(0x0000, 0x04ff) AM_RAM AM_BASE_MEMBER(btime_state, rambase)
AM_RANGE(0x2000, 0x7fff) AM_RAM_WRITE(deco_charram_w) AM_BASE_MEMBER(btime_state, deco_charram)
- AM_RANGE(0x8000, 0x83ff) AM_RAM AM_BASE_MEMBER(btime_state, videoram) AM_SIZE_GENERIC(videoram)
+ AM_RANGE(0x8000, 0x83ff) AM_RAM AM_BASE_MEMBER(btime_state, videoram) AM_SIZE_MEMBER(btime_state, videoram_size)
AM_RANGE(0x8400, 0x87ff) AM_RAM AM_BASE_MEMBER(btime_state, colorram)
- AM_RANGE(0x8800, 0x881f) AM_RAM AM_BASE_MEMBER(btime_state, spriteram) AM_SIZE_GENERIC(spriteram)
+ AM_RANGE(0x8800, 0x881f) AM_RAM AM_BASE_MEMBER(btime_state, spriteram) AM_SIZE_MEMBER(btime_state, spriteram_size)
AM_RANGE(0x9000, 0x9000) AM_READ_PORT("SYSTEM")
AM_RANGE(0x9200, 0x9200) AM_READ_PORT("P1")
AM_RANGE(0x9400, 0x9400) AM_READ_PORT("P2")
diff --git a/src/mame/drivers/bublbobl.c b/src/mame/drivers/bublbobl.c
index f1ad75760ae..ea50c3d4771 100644
--- a/src/mame/drivers/bublbobl.c
+++ b/src/mame/drivers/bublbobl.c
@@ -288,7 +288,7 @@ TODO:
static ADDRESS_MAP_START( master_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0xbfff) AM_ROMBANK(1)
- AM_RANGE(0xc000, 0xdcff) AM_RAM AM_BASE_MEMBER(bublbobl_state, videoram) AM_SIZE_GENERIC(videoram)
+ AM_RANGE(0xc000, 0xdcff) AM_RAM AM_BASE_MEMBER(bublbobl_state, videoram) AM_SIZE_MEMBER(bublbobl_state, videoram_size)
AM_RANGE(0xdd00, 0xdfff) AM_RAM AM_BASE_SIZE_MEMBER(bublbobl_state, objectram, objectram_size)
AM_RANGE(0xe000, 0xf7ff) AM_RAM AM_SHARE(1)
AM_RANGE(0xf800, 0xf9ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_be_w) AM_BASE_GENERIC(paletteram)
@@ -344,7 +344,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( bootleg_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0xbfff) AM_ROMBANK(1)
- AM_RANGE(0xc000, 0xdcff) AM_RAM AM_BASE_MEMBER(bublbobl_state, videoram) AM_SIZE_GENERIC(videoram)
+ AM_RANGE(0xc000, 0xdcff) AM_RAM AM_BASE_MEMBER(bublbobl_state, videoram) AM_SIZE_MEMBER(bublbobl_state, videoram_size)
AM_RANGE(0xdd00, 0xdfff) AM_RAM AM_BASE_SIZE_MEMBER(bublbobl_state, objectram, objectram_size)
AM_RANGE(0xe000, 0xf7ff) AM_RAM AM_SHARE(1)
AM_RANGE(0xf800, 0xf9ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_be_w) AM_BASE_GENERIC(paletteram)
@@ -368,7 +368,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( tokio_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0xbfff) AM_ROMBANK(1)
- AM_RANGE(0xc000, 0xdcff) AM_RAM AM_BASE_MEMBER(bublbobl_state, videoram) AM_SIZE_GENERIC(videoram)
+ AM_RANGE(0xc000, 0xdcff) AM_RAM AM_BASE_MEMBER(bublbobl_state, videoram) AM_SIZE_MEMBER(bublbobl_state, videoram_size)
AM_RANGE(0xdd00, 0xdfff) AM_RAM AM_BASE_SIZE_MEMBER(bublbobl_state, objectram, objectram_size)
AM_RANGE(0xe000, 0xf7ff) AM_RAM AM_SHARE(1)
AM_RANGE(0xf800, 0xf9ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_be_w) AM_BASE_GENERIC(paletteram)
@@ -699,7 +699,8 @@ GFXDECODE_END
// handler called by the 2203 emulator when the internal timers cause an IRQ
static void irqhandler(const device_config *device, int irq)
{
- cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
+ bublbobl_state *state = (bublbobl_state *)device->machine->driver_data;
+ cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
static const ym2203_interface ym2203_config =
@@ -724,7 +725,10 @@ static MACHINE_START( common )
{
bublbobl_state *state = (bublbobl_state *)machine->driver_data;
- state->mcu = cputag_get_cpu(machine, "mcu");
+ state->maincpu = devtag_get_device(machine, "maincpu");
+ state->mcu = devtag_get_device(machine, "mcu");
+ state->audiocpu = devtag_get_device(machine, "audiocpu");
+ state->slave = devtag_get_device(machine, "slave");
state_save_register_global(machine, state->sound_nmi_enable);
state_save_register_global(machine, state->pending_nmi);
diff --git a/src/mame/drivers/bwing.c b/src/mame/drivers/bwing.c
index 069e9dfe00a..3c717df874c 100644
--- a/src/mame/drivers/bwing.c
+++ b/src/mame/drivers/bwing.c
@@ -48,7 +48,7 @@ static INTERRUPT_GEN ( bwp1_interrupt )
latch_data = state->sound_fifo[state->fftail];
state->fftail = (state->fftail + 1) & (MAX_SOUNDS - 1);
soundlatch_w(cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM), 0, latch_data);
- cputag_set_input_line(device->machine, "audiocpu", DECO16_IRQ_LINE, HOLD_LINE); // SNDREQ
+ cpu_set_input_line(state->audiocpu, DECO16_IRQ_LINE, HOLD_LINE); // SNDREQ
}
break;
@@ -102,7 +102,11 @@ static WRITE8_HANDLER( bwp3_nmimask_w )
state->bwp3_nmimask = data & 0x80;
}
-static WRITE8_HANDLER( bwp3_nmiack_w ) { cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, CLEAR_LINE); }
+static WRITE8_HANDLER( bwp3_nmiack_w )
+{
+ bwing_state *state = (bwing_state *)space->machine->driver_data;
+ cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, CLEAR_LINE);
+}
static READ8_HANDLER( bwp1_io_r )
@@ -126,16 +130,16 @@ static WRITE8_HANDLER( bwp1_ctrl_w )
switch (offset)
{
// MSSTB
- case 0: cputag_set_input_line(space->machine, "sub", M6809_IRQ_LINE, ASSERT_LINE); break;
+ case 0: cpu_set_input_line(state->subcpu, M6809_IRQ_LINE, ASSERT_LINE); break;
// IRQACK
- case 1: cputag_set_input_line(space->machine, "maincpu", M6809_IRQ_LINE, CLEAR_LINE); break;
+ case 1: cpu_set_input_line(state->maincpu, M6809_IRQ_LINE, CLEAR_LINE); break;
// FIRQACK
- case 2: cputag_set_input_line(space->machine, "maincpu", M6809_FIRQ_LINE, CLEAR_LINE); break;
+ case 2: cpu_set_input_line(state->maincpu, M6809_FIRQ_LINE, CLEAR_LINE); break;
// NMIACK
- case 3: cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_NMI, CLEAR_LINE); break;
+ case 3: cpu_set_input_line(state->maincpu, INPUT_LINE_NMI, CLEAR_LINE); break;
// SWAP(bank-swaps sprite RAM between 1800 & 1900; ignored bc. they're treated as a single chunk.)
case 4: break;
@@ -143,7 +147,7 @@ static WRITE8_HANDLER( bwp1_ctrl_w )
// SNDREQ
case 5:
if (data == 0x80) // protection trick to screw CPU1 & 3
- cputag_set_input_line(space->machine, "sub", INPUT_LINE_NMI, ASSERT_LINE); // SNMI
+ cpu_set_input_line(state->subcpu, INPUT_LINE_NMI, ASSERT_LINE); // SNMI
else if (state->ffcount < MAX_SOUNDS)
{
state->ffcount++;
@@ -167,20 +171,20 @@ static WRITE8_HANDLER( bwp1_ctrl_w )
static WRITE8_HANDLER( bwp2_ctrl_w )
{
+ bwing_state *state = (bwing_state *)space->machine->driver_data;
switch (offset)
{
- case 0: cputag_set_input_line(space->machine, "maincpu", M6809_IRQ_LINE, ASSERT_LINE); break; // SMSTB
+ case 0: cpu_set_input_line(state->maincpu, M6809_IRQ_LINE, ASSERT_LINE); break; // SMSTB
- case 1: cputag_set_input_line(space->machine, "sub", M6809_FIRQ_LINE, CLEAR_LINE); break;
+ case 1: cpu_set_input_line(state->subcpu, M6809_FIRQ_LINE, CLEAR_LINE); break;
- case 2: cputag_set_input_line(space->machine, "sub", M6809_IRQ_LINE, CLEAR_LINE); break;
+ case 2: cpu_set_input_line(state->subcpu, M6809_IRQ_LINE, CLEAR_LINE); break;
- case 3: cputag_set_input_line(space->machine, "sub", INPUT_LINE_NMI, CLEAR_LINE); break;
+ case 3: cpu_set_input_line(state->subcpu, INPUT_LINE_NMI, CLEAR_LINE); break;
}
#if BW_DEBUG
{
- bwing_state *state = (bwing_state *)space->machine->driver_data;
(state->bwp123_membase[1])[0x1800 + offset] = data;
}
#endif
@@ -372,6 +376,10 @@ static MACHINE_START( bwing )
{
bwing_state *state = (bwing_state *)machine->driver_data;
+ state->maincpu = devtag_get_device(machine, "maincpu");
+ state->subcpu = devtag_get_device(machine, "sub");
+ state->audiocpu = devtag_get_device(machine, "audiocpu");
+
state_save_register_global(machine, state->coin);
state_save_register_global(machine, state->palatch);
state_save_register_global(machine, state->srbank);
diff --git a/src/mame/drivers/missb2.c b/src/mame/drivers/missb2.c
index cb0f2116bcb..5b8d34eaa42 100644
--- a/src/mame/drivers/missb2.c
+++ b/src/mame/drivers/missb2.c
@@ -146,7 +146,7 @@ static WRITE8_HANDLER( missb2_bg_bank_w )
static ADDRESS_MAP_START( master_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0xbfff) AM_ROMBANK(1)
- AM_RANGE(0xc000, 0xdcff) AM_RAM AM_BASE_MEMBER(bublbobl_state, videoram) AM_SIZE_GENERIC(videoram)
+ AM_RANGE(0xc000, 0xdcff) AM_RAM AM_BASE_MEMBER(bublbobl_state, videoram) AM_SIZE_MEMBER(bublbobl_state, videoram_size)
AM_RANGE(0xdd00, 0xdfff) AM_RAM AM_BASE_SIZE_MEMBER(bublbobl_state, objectram, objectram_size)
AM_RANGE(0xe000, 0xf7ff) AM_RAM AM_SHARE(1)
AM_RANGE(0xf800, 0xf9ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_be_w) AM_BASE_GENERIC(paletteram)
diff --git a/src/mame/includes/astrof.h b/src/mame/includes/astrof.h
index aab4809bb2a..7991f211c9d 100644
--- a/src/mame/includes/astrof.h
+++ b/src/mame/includes/astrof.h
@@ -29,6 +29,7 @@ struct _astrof_state
UINT8 astrof_bosskill_playing;
/* devices */
+ const device_config *maincpu;
const device_config *samples; // astrof & abattle
const device_config *sn; // tomahawk
};
diff --git a/src/mame/includes/brkthru.h b/src/mame/includes/brkthru.h
index 311bf47b745..d304a41db37 100644
--- a/src/mame/includes/brkthru.h
+++ b/src/mame/includes/brkthru.h
@@ -11,6 +11,8 @@ struct _brkthru_state
UINT8 * videoram;
UINT8 * spriteram;
UINT8 * fg_videoram;
+ size_t videoram_size;
+ size_t spriteram_size;
size_t fg_videoram_size;
/* video-related */
@@ -19,9 +21,11 @@ struct _brkthru_state
int bgbasecolor;
int flipscreen;
//UINT8 *brkthru_nmi_enable; /* needs to be tracked down */
-};
-
+ /* devices */
+ const device_config *maincpu;
+ const device_config *audiocpu;
+};
/*----------- defined in video/brkthru.c -----------*/
diff --git a/src/mame/includes/btime.h b/src/mame/includes/btime.h
index ab6dbae8719..91cc4a7864b 100644
--- a/src/mame/includes/btime.h
+++ b/src/mame/includes/btime.h
@@ -11,10 +11,12 @@ struct _btime_state
UINT8 * zoar_scrollram;
UINT8 * deco_charram;
UINT8 * spriteram; // used by disco
- size_t bnj_backgroundram_size;
// UINT8 * decrypted;
UINT8 * rambase;
UINT8 * audio_rambase;
+ size_t videoram_size;
+ size_t spriteram_size;
+ size_t bnj_backgroundram_size;
/* video-related */
bitmap_t *background_bitmap;
diff --git a/src/mame/includes/bublbobl.h b/src/mame/includes/bublbobl.h
index 7829f0dfa76..d48e5ffcbc8 100644
--- a/src/mame/includes/bublbobl.h
+++ b/src/mame/includes/bublbobl.h
@@ -6,8 +6,9 @@ struct _bublbobl_state
UINT8 * mcu_sharedram;
UINT8 * videoram;
UINT8 * objectram;
- size_t objectram_size;
// UINT8 * paletteram; // currently this uses generic palette handling
+ size_t videoram_size;
+ size_t objectram_size;
/* missb2.c also needs the following */
UINT8 * bgvram;
@@ -34,7 +35,10 @@ struct _bublbobl_state
int ic43_a, ic43_b;
/* devices */
+ const device_config *maincpu;
const device_config *mcu;
+ const device_config *audiocpu;
+ const device_config *slave;
};
diff --git a/src/mame/includes/bwing.h b/src/mame/includes/bwing.h
index c98aebf3868..370d282d94c 100644
--- a/src/mame/includes/bwing.h
+++ b/src/mame/includes/bwing.h
@@ -32,6 +32,11 @@ struct _bwing_state
/* misc */
UINT8 *bwp123_membase[3];
int coin;
+
+ /* device */
+ const device_config *maincpu;
+ const device_config *subcpu;
+ const device_config *audiocpu;
};
diff --git a/src/mame/machine/bublbobl.c b/src/mame/machine/bublbobl.c
index 12549808616..3439bb61fd4 100644
--- a/src/mame/machine/bublbobl.c
+++ b/src/mame/machine/bublbobl.c
@@ -23,11 +23,11 @@ WRITE8_HANDLER( bublbobl_bankswitch_w )
/* bit 3 n.c. */
/* bit 4 resets second Z80 */
- cputag_set_input_line(space->machine, "slave", INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
+ cpu_set_input_line(state->slave, INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
/* bit 5 resets mcu */
if (state->mcu != NULL) // only if we have a MCU
- cputag_set_input_line(space->machine, "mcu", INPUT_LINE_RESET, (data & 0x20) ? CLEAR_LINE : ASSERT_LINE);
+ cpu_set_input_line(state->mcu, INPUT_LINE_RESET, (data & 0x20) ? CLEAR_LINE : ASSERT_LINE);
/* bit 6 enables display */
state->video_enable = data & 0x40;
@@ -54,7 +54,8 @@ WRITE8_HANDLER( tokio_videoctrl_w )
WRITE8_HANDLER( bublbobl_nmitrigger_w )
{
- cputag_set_input_line(space->machine, "slave", INPUT_LINE_NMI, PULSE_LINE);
+ bublbobl_state *state = (bublbobl_state *)space->machine->driver_data;
+ cpu_set_input_line(state->slave, INPUT_LINE_NMI, PULSE_LINE);
}
@@ -94,7 +95,7 @@ static TIMER_CALLBACK( nmi_callback )
bublbobl_state *state = (bublbobl_state *)machine->driver_data;
if (state->sound_nmi_enable)
- cputag_set_input_line(machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
else
state->pending_nmi = 1;
}
@@ -118,14 +119,15 @@ WRITE8_HANDLER( bublbobl_sh_nmi_enable_w )
state->sound_nmi_enable = 1;
if (state->pending_nmi)
{
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
state->pending_nmi = 0;
}
}
WRITE8_HANDLER( bublbobl_soundcpu_reset_w )
{
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, data ? ASSERT_LINE : CLEAR_LINE);
+ bublbobl_state *state = (bublbobl_state *)space->machine->driver_data;
+ cpu_set_input_line(state->audiocpu, INPUT_LINE_RESET, data ? ASSERT_LINE : CLEAR_LINE);
}
READ8_HANDLER( bublbobl_sound_status_r )
@@ -220,8 +222,8 @@ WRITE8_HANDLER( bublbobl_mcu_port1_w )
if ((state->port1_out & 0x40) && (~data & 0x40))
{
// logerror("triggering IRQ on main CPU\n");
- cpu_set_input_line_vector(cputag_get_cpu(space->machine, "maincpu"), 0, state->mcu_sharedram[0]);
- cputag_set_input_line(space->machine, "maincpu", 0, HOLD_LINE);
+ cpu_set_input_line_vector(state->maincpu, 0, state->mcu_sharedram[0]);
+ cpu_set_input_line(state->maincpu, 0, HOLD_LINE);
}
// bit 7: select read or write shared RAM
@@ -505,8 +507,8 @@ WRITE8_HANDLER( bublbobl_68705_port_b_w )
/* hack to get random EXTEND letters (who is supposed to do this? 68705? PAL?) */
state->mcu_sharedram[0x7c] = mame_rand(space->machine) % 6;
- cpu_set_input_line_vector(cputag_get_cpu(space->machine, "maincpu"), 0, state->mcu_sharedram[0]);
- cputag_set_input_line(space->machine, "maincpu", 0, HOLD_LINE);
+ cpu_set_input_line_vector(state->maincpu, 0, state->mcu_sharedram[0]);
+ cpu_set_input_line(state->maincpu, 0, HOLD_LINE);
}
if ((state->ddr_b & 0x40) && (~data & 0x40) && (state->port_b_out & 0x40))
{
diff --git a/src/mame/video/brkthru.c b/src/mame/video/brkthru.c
index 37f2e76503b..9a0d8a5e1ae 100644
--- a/src/mame/video/brkthru.c
+++ b/src/mame/video/brkthru.c
@@ -119,10 +119,6 @@ VIDEO_START( brkthru )
tilemap_set_transparent_pen(state->fg_tilemap, 0);
tilemap_set_transparent_pen(state->bg_tilemap, 0);
-
- state_save_register_global(machine, state->bgscroll);
- state_save_register_global(machine, state->bgbasecolor);
- state_save_register_global(machine, state->flipscreen);
}
@@ -189,7 +185,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
---- ---- ---- ---- ---- ---- xxxx xxxx = X position
*/
- for (offs = 0;offs < machine->generic.spriteram_size; offs += 4)
+ for (offs = 0;offs < state->spriteram_size; offs += 4)
{
if ((state->spriteram[offs] & 0x09) == prio) /* Enable && Low Priority */
{
diff --git a/src/mame/video/btime.c b/src/mame/video/btime.c
index 7dfe3fb0fe9..ffd2b9926a4 100644
--- a/src/mame/video/btime.c
+++ b/src/mame/video/btime.c
@@ -304,7 +304,7 @@ static void draw_chars( running_machine *machine, bitmap_t *bitmap, const rectan
btime_state *state = (btime_state *)machine->driver_data;
offs_t offs;
- for (offs = 0; offs < machine->generic.videoram_size; offs++)
+ for (offs = 0; offs < state->videoram_size; offs++)
{
UINT8 x = 31 - (offs / 32);
UINT8 y = offs % 32;