summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/blockout.c
diff options
context:
space:
mode:
author Fabio Priuli <etabeta78@users.noreply.github.com>2009-11-29 01:49:13 +0000
committer Fabio Priuli <etabeta78@users.noreply.github.com>2009-11-29 01:49:13 +0000
commit1a309ff78bdcee422f903153b0d35a3db4d8a27c (patch)
treee10f8c554d22662e2dfe2f018214d0a488c81770 /src/mame/drivers/blockout.c
parent796b597e06269b9c62c39e06310621a6d4e1af65 (diff)
Cleaned up many driver data structs to obtain two results:
* drop almost completely the use of generic sizes with struct members * reduce as much as possible accesses to cputag calls during emulation (they are now mainly concentrated at MACHINE_START & DRIVER_INIT) unfortunately I had been away for half a day and I have found only now rev 7446 (which could have been used in many of these cases). too late to use the new macro, sorry (almost 3AM here)
Diffstat (limited to 'src/mame/drivers/blockout.c')
-rw-r--r--src/mame/drivers/blockout.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/mame/drivers/blockout.c b/src/mame/drivers/blockout.c
index 4bf8f69a07f..f84ed7745e6 100644
--- a/src/mame/drivers/blockout.c
+++ b/src/mame/drivers/blockout.c
@@ -83,10 +83,12 @@ static INTERRUPT_GEN( blockout_interrupt )
static WRITE16_HANDLER( blockout_sound_command_w )
{
+ blockout_state *state = (blockout_state *)space->machine->driver_data;
+
if (ACCESSING_BITS_0_7)
{
- soundlatch_w(space,offset,data & 0xff);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ soundlatch_w(space, offset, data & 0xff);
+ cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
}
}
@@ -112,7 +114,7 @@ static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 )
AM_RANGE(0x200000, 0x207fff) AM_RAM AM_BASE_MEMBER(blockout_state, frontvideoram)
AM_RANGE(0x208000, 0x21ffff) AM_RAM /* ??? */
AM_RANGE(0x280002, 0x280003) AM_WRITE(blockout_frontcolor_w)
- AM_RANGE(0x280200, 0x2805ff) AM_RAM_WRITE(blockout_paletteram_w) AM_BASE_MEMBER(blockout_state, paletteram16)
+ AM_RANGE(0x280200, 0x2805ff) AM_RAM_WRITE(blockout_paletteram_w) AM_BASE_MEMBER(blockout_state, paletteram)
ADDRESS_MAP_END
static ADDRESS_MAP_START( audio_map, ADDRESS_SPACE_PROGRAM, 8 )
@@ -235,7 +237,8 @@ INPUT_PORTS_END
/* handler called by the 2151 emulator when the internal timers cause an IRQ */
static void blockout_irq_handler(const device_config *device, int irq)
{
- cputag_set_input_line_and_vector(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE, 0xff);
+ blockout_state *state = (blockout_state *)device->machine->driver_data;
+ cpu_set_input_line_and_vector(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE, 0xff);
}
static const ym2151_interface ym2151_config =
@@ -250,6 +253,15 @@ static const ym2151_interface ym2151_config =
*
*************************************/
+static MACHINE_START( blockout )
+{
+ blockout_state *state = (blockout_state *)machine->driver_data;
+
+ state->audiocpu = devtag_get_device(machine, "audiocpu");
+
+ state_save_register_global(machine, state->color);
+}
+
static MACHINE_RESET( blockout )
{
blockout_state *state = (blockout_state *)machine->driver_data;
@@ -270,6 +282,7 @@ static MACHINE_DRIVER_START( blockout )
MDRV_CPU_ADD("audiocpu", Z80, 3579545) /* 3.579545 MHz */
MDRV_CPU_PROGRAM_MAP(audio_map)
+ MDRV_MACHINE_START(blockout)
MDRV_MACHINE_RESET(blockout)
/* video hardware */