summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/vicdual.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/vicdual.c')
-rw-r--r--src/mame/drivers/vicdual.c293
1 files changed, 145 insertions, 148 deletions
diff --git a/src/mame/drivers/vicdual.c b/src/mame/drivers/vicdual.c
index 57f2b9b381a..b0d34728f93 100644
--- a/src/mame/drivers/vicdual.c
+++ b/src/mame/drivers/vicdual.c
@@ -191,19 +191,17 @@ int vicdual_is_cabinet_color(running_machine &machine)
*************************************/
-static WRITE8_HANDLER( vicdual_videoram_w )
+WRITE8_MEMBER(vicdual_state::vicdual_videoram_w)
{
- vicdual_state *state = space->machine().driver_data<vicdual_state>();
- space->machine().primary_screen->update_now();
- state->m_videoram[offset] = data;
+ machine().primary_screen->update_now();
+ m_videoram[offset] = data;
}
-static WRITE8_HANDLER( vicdual_characterram_w )
+WRITE8_MEMBER(vicdual_state::vicdual_characterram_w)
{
- vicdual_state *state = space->machine().driver_data<vicdual_state>();
- space->machine().primary_screen->update_now();
- state->m_characterram[offset] = data;
+ machine().primary_screen->update_now();
+ m_characterram[offset] = data;
}
@@ -232,29 +230,29 @@ MACHINE_CONFIG_END
*
*************************************/
-static READ8_HANDLER( depthch_io_r )
+READ8_MEMBER(vicdual_state::depthch_io_r)
{
UINT8 ret = 0;
- if (offset & 0x01) ret = input_port_read(space->machine(), "IN0");
- if (offset & 0x08) ret = input_port_read(space->machine(), "IN1");
+ if (offset & 0x01) ret = input_port_read(machine(), "IN0");
+ if (offset & 0x08) ret = input_port_read(machine(), "IN1");
return ret;
}
-static WRITE8_HANDLER( depthch_io_w )
+WRITE8_MEMBER(vicdual_state::depthch_io_w)
{
- if (offset & 0x01) assert_coin_status(space->machine());
- if (offset & 0x04) depthch_audio_w(space, 0, data);
+ if (offset & 0x01) assert_coin_status(machine());
+ if (offset & 0x04) depthch_audio_w(&space, 0, data);
}
static ADDRESS_MAP_START( depthch_map, AS_PROGRAM, 8, vicdual_state )
AM_RANGE(0x0000, 0x3fff) AM_MIRROR(0x4000) AM_ROM
- AM_RANGE(0x8000, 0x83ff) AM_MIRROR(0x7000) AM_RAM_WRITE_LEGACY(vicdual_videoram_w) AM_BASE(m_videoram)
+ AM_RANGE(0x8000, 0x83ff) AM_MIRROR(0x7000) AM_RAM_WRITE(vicdual_videoram_w) AM_BASE(m_videoram)
AM_RANGE(0x8400, 0x87ff) AM_MIRROR(0x7000) AM_RAM
- AM_RANGE(0x8800, 0x8fff) AM_MIRROR(0x7000) AM_RAM_WRITE_LEGACY(vicdual_characterram_w) AM_BASE(m_characterram)
+ AM_RANGE(0x8800, 0x8fff) AM_MIRROR(0x7000) AM_RAM_WRITE(vicdual_characterram_w) AM_BASE(m_characterram)
ADDRESS_MAP_END
@@ -263,7 +261,7 @@ static ADDRESS_MAP_START( depthch_io_map, AS_IO, 8, vicdual_state )
/* no decoder, just logic gates, so in theory the
game can read/write from multiple locations at once */
- AM_RANGE(0x00, 0x0f) AM_READWRITE_LEGACY(depthch_io_r, depthch_io_w)
+ AM_RANGE(0x00, 0x0f) AM_READWRITE(depthch_io_r, depthch_io_w)
ADDRESS_MAP_END
@@ -314,20 +312,20 @@ MACHINE_CONFIG_END
*
*************************************/
-static READ8_HANDLER( safari_io_r )
+READ8_MEMBER(vicdual_state::safari_io_r)
{
UINT8 ret = 0;
- if (offset & 0x01) ret = input_port_read(space->machine(), "IN0");
- if (offset & 0x08) ret = input_port_read(space->machine(), "IN1");
+ if (offset & 0x01) ret = input_port_read(machine(), "IN0");
+ if (offset & 0x08) ret = input_port_read(machine(), "IN1");
return ret;
}
-static WRITE8_HANDLER( safari_io_w )
+WRITE8_MEMBER(vicdual_state::safari_io_w)
{
- if (offset & 0x01) assert_coin_status(space->machine());
+ if (offset & 0x01) assert_coin_status(machine());
if (offset & 0x02) { /* safari_audio_w(0, data) */ }
}
@@ -336,9 +334,9 @@ static ADDRESS_MAP_START( safari_map, AS_PROGRAM, 8, vicdual_state )
AM_RANGE(0x0000, 0x3fff) AM_ROM
AM_RANGE(0x4000, 0x7fff) AM_NOP /* unused */
AM_RANGE(0x8000, 0x8fff) AM_MIRROR(0x3000) AM_RAM
- AM_RANGE(0xc000, 0xc3ff) AM_MIRROR(0x3000) AM_RAM_WRITE_LEGACY(vicdual_videoram_w) AM_BASE(m_videoram)
+ AM_RANGE(0xc000, 0xc3ff) AM_MIRROR(0x3000) AM_RAM_WRITE(vicdual_videoram_w) AM_BASE(m_videoram)
AM_RANGE(0xc400, 0xc7ff) AM_MIRROR(0x3000) AM_RAM
- AM_RANGE(0xc800, 0xcfff) AM_MIRROR(0x3000) AM_RAM_WRITE_LEGACY(vicdual_characterram_w) AM_BASE(m_characterram)
+ AM_RANGE(0xc800, 0xcfff) AM_MIRROR(0x3000) AM_RAM_WRITE(vicdual_characterram_w) AM_BASE(m_characterram)
ADDRESS_MAP_END
@@ -347,7 +345,7 @@ static ADDRESS_MAP_START( safari_io_map, AS_IO, 8, vicdual_state )
/* no decoder, just logic gates, so in theory the
game can read/write from multiple locations at once */
- AM_RANGE(0x00, 0x0f) AM_READWRITE_LEGACY(safari_io_r, safari_io_w)
+ AM_RANGE(0x00, 0x0f) AM_READWRITE(safari_io_r, safari_io_w)
ADDRESS_MAP_END
@@ -398,29 +396,29 @@ MACHINE_CONFIG_END
*
*************************************/
-static READ8_HANDLER( frogs_io_r )
+READ8_MEMBER(vicdual_state::frogs_io_r)
{
UINT8 ret = 0;
- if (offset & 0x01) ret = input_port_read(space->machine(), "IN0");
- if (offset & 0x08) ret = input_port_read(space->machine(), "IN1");
+ if (offset & 0x01) ret = input_port_read(machine(), "IN0");
+ if (offset & 0x08) ret = input_port_read(machine(), "IN1");
return ret;
}
-static WRITE8_HANDLER( frogs_io_w )
+WRITE8_MEMBER(vicdual_state::frogs_io_w)
{
- if (offset & 0x01) assert_coin_status(space->machine());
- if (offset & 0x02) frogs_audio_w(space, 0, data);
+ if (offset & 0x01) assert_coin_status(machine());
+ if (offset & 0x02) frogs_audio_w(&space, 0, data);
}
static ADDRESS_MAP_START( frogs_map, AS_PROGRAM, 8, vicdual_state )
AM_RANGE(0x0000, 0x3fff) AM_MIRROR(0x4000) AM_ROM
- AM_RANGE(0x8000, 0x83ff) AM_MIRROR(0x7000) AM_RAM_WRITE_LEGACY(vicdual_videoram_w) AM_BASE(m_videoram)
+ AM_RANGE(0x8000, 0x83ff) AM_MIRROR(0x7000) AM_RAM_WRITE(vicdual_videoram_w) AM_BASE(m_videoram)
AM_RANGE(0x8400, 0x87ff) AM_MIRROR(0x7000) AM_RAM
- AM_RANGE(0x8800, 0x8fff) AM_MIRROR(0x7000) AM_RAM_WRITE_LEGACY(vicdual_characterram_w) AM_BASE(m_characterram)
+ AM_RANGE(0x8800, 0x8fff) AM_MIRROR(0x7000) AM_RAM_WRITE(vicdual_characterram_w) AM_BASE(m_characterram)
ADDRESS_MAP_END
@@ -429,7 +427,7 @@ static ADDRESS_MAP_START( frogs_io_map, AS_IO, 8, vicdual_state )
/* no decoder, just logic gates, so in theory the
game can read/write from multiple locations at once */
- AM_RANGE(0x00, 0x0f) AM_READWRITE_LEGACY(frogs_io_r, frogs_io_w)
+ AM_RANGE(0x00, 0x0f) AM_READWRITE(frogs_io_r, frogs_io_w)
ADDRESS_MAP_END
@@ -506,33 +504,33 @@ MACHINE_CONFIG_END
*
*************************************/
-static READ8_HANDLER( headon_io_r )
+READ8_MEMBER(vicdual_state::headon_io_r)
{
UINT8 ret = 0;
- if (offset & 0x01) ret = input_port_read(space->machine(), "IN0");
- if (offset & 0x08) ret = input_port_read(space->machine(), "IN1");
+ if (offset & 0x01) ret = input_port_read(machine(), "IN0");
+ if (offset & 0x08) ret = input_port_read(machine(), "IN1");
return ret;
}
-static READ8_HANDLER( sspaceat_io_r )
+READ8_MEMBER(vicdual_state::sspaceat_io_r)
{
UINT8 ret = 0;
- if (offset & 0x01) ret = input_port_read(space->machine(), "IN0");
- if (offset & 0x04) ret = input_port_read(space->machine(), "IN1");
- if (offset & 0x08) ret = input_port_read(space->machine(), "IN2");
+ if (offset & 0x01) ret = input_port_read(machine(), "IN0");
+ if (offset & 0x04) ret = input_port_read(machine(), "IN1");
+ if (offset & 0x08) ret = input_port_read(machine(), "IN2");
return ret;
}
-static WRITE8_HANDLER( headon_io_w )
+WRITE8_MEMBER(vicdual_state::headon_io_w)
{
- if (offset & 0x01) assert_coin_status(space->machine());
- if (offset & 0x02) headon_audio_w(space, 0, data);
+ if (offset & 0x01) assert_coin_status(machine());
+ if (offset & 0x02) headon_audio_w(&space, 0, data);
if (offset & 0x04) { /* vicdual_palette_bank_w(0, data) */ } /* not written to */
}
@@ -540,9 +538,9 @@ static WRITE8_HANDLER( headon_io_w )
static ADDRESS_MAP_START( headon_map, AS_PROGRAM, 8, vicdual_state )
AM_RANGE(0x0000, 0x1fff) AM_MIRROR(0x6000) AM_ROM
AM_RANGE(0x8000, 0xbfff) AM_NOP /* unused */
- AM_RANGE(0xc000, 0xc3ff) AM_MIRROR(0x3000) AM_RAM_WRITE_LEGACY(vicdual_videoram_w) AM_BASE(m_videoram)
+ AM_RANGE(0xc000, 0xc3ff) AM_MIRROR(0x3000) AM_RAM_WRITE(vicdual_videoram_w) AM_BASE(m_videoram)
AM_RANGE(0xc400, 0xc7ff) AM_MIRROR(0x3000) AM_RAM
- AM_RANGE(0xc800, 0xcfff) AM_MIRROR(0x3000) AM_RAM_WRITE_LEGACY(vicdual_characterram_w) AM_BASE(m_characterram)
+ AM_RANGE(0xc800, 0xcfff) AM_MIRROR(0x3000) AM_RAM_WRITE(vicdual_characterram_w) AM_BASE(m_characterram)
ADDRESS_MAP_END
@@ -551,7 +549,7 @@ static ADDRESS_MAP_START( headon_io_map, AS_IO, 8, vicdual_state )
/* no decoder, just logic gates, so in theory the
game can read/write from multiple locations at once */
- AM_RANGE(0x00, 0x0f) AM_READWRITE_LEGACY(headon_io_r, headon_io_w)
+ AM_RANGE(0x00, 0x0f) AM_READWRITE(headon_io_r, headon_io_w)
ADDRESS_MAP_END
@@ -560,7 +558,7 @@ static ADDRESS_MAP_START( sspaceat_io_map, AS_IO, 8, vicdual_state )
/* no decoder, just logic gates, so in theory the
game can read/write from multiple locations at once */
- AM_RANGE(0x00, 0x0f) AM_READWRITE_LEGACY(sspaceat_io_r, headon_io_w)
+ AM_RANGE(0x00, 0x0f) AM_READWRITE(sspaceat_io_r, headon_io_w)
ADDRESS_MAP_END
@@ -716,38 +714,38 @@ MACHINE_CONFIG_END
*
*************************************/
-static READ8_HANDLER( headon2_io_r )
+READ8_MEMBER(vicdual_state::headon2_io_r)
{
UINT8 ret = 0;
- if (offset & 0x01) ret = input_port_read(space->machine(), "IN0");
+ if (offset & 0x01) ret = input_port_read(machine(), "IN0");
if (offset & 0x02) /* schematics show this as in input port, but never read from */
- if (offset & 0x04) ret = input_port_read(space->machine(), "IN1");
- if (offset & 0x08) ret = input_port_read(space->machine(), "IN2");
+ if (offset & 0x04) ret = input_port_read(machine(), "IN1");
+ if (offset & 0x08) ret = input_port_read(machine(), "IN2");
if (offset & 0x12) logerror("********* Read from port %x\n", offset);
return ret;
}
-static WRITE8_HANDLER( headon2_io_w )
+WRITE8_MEMBER(vicdual_state::headon2_io_w)
{
- if (offset & 0x01) assert_coin_status(space->machine());
- if (offset & 0x02) headon_audio_w(space, 0, data);
- if (offset & 0x04) vicdual_palette_bank_w(space, 0, data);
+ if (offset & 0x01) assert_coin_status(machine());
+ if (offset & 0x02) headon_audio_w(&space, 0, data);
+ if (offset & 0x04) vicdual_palette_bank_w(&space, 0, data);
if (offset & 0x08) { /* schematics show this as going into a shifer circuit, but never written to */ }
if (offset & 0x10) { /* schematics show this as going to an edge connector, but never written to */ }
if (offset & 0x18) logerror("********* Write to port %x\n", offset);
}
-static WRITE8_HANDLER( digger_io_w )
+WRITE8_MEMBER(vicdual_state::digger_io_w)
{
- if (offset & 0x01) assert_coin_status(space->machine());
+ if (offset & 0x01) assert_coin_status(machine());
if (offset & 0x02) { /* digger_audio_1_w(0, data) */ }
if (offset & 0x04)
{
- vicdual_palette_bank_w(space, 0, data & 0x03);
+ vicdual_palette_bank_w(&space, 0, data & 0x03);
/* digger_audio_2_w(0, data & 0xfc); */
}
@@ -760,9 +758,9 @@ static WRITE8_HANDLER( digger_io_w )
static ADDRESS_MAP_START( headon2_map, AS_PROGRAM, 8, vicdual_state )
AM_RANGE(0x0000, 0x1fff) AM_MIRROR(0x6000) AM_ROM
/* AM_RANGE(0x8000, 0x80ff) AM_MIRROR(0x3f00) */ /* schematics show this as battery backed RAM, but doesn't appear to be used */
- AM_RANGE(0xc000, 0xc3ff) AM_MIRROR(0x3000) AM_RAM_WRITE_LEGACY(vicdual_videoram_w) AM_BASE(m_videoram)
+ AM_RANGE(0xc000, 0xc3ff) AM_MIRROR(0x3000) AM_RAM_WRITE(vicdual_videoram_w) AM_BASE(m_videoram)
AM_RANGE(0xc400, 0xc7ff) AM_MIRROR(0x3000) AM_RAM
- AM_RANGE(0xc800, 0xcfff) AM_MIRROR(0x3000) AM_RAM_WRITE_LEGACY(vicdual_characterram_w) AM_BASE(m_characterram)
+ AM_RANGE(0xc800, 0xcfff) AM_MIRROR(0x3000) AM_RAM_WRITE(vicdual_characterram_w) AM_BASE(m_characterram)
ADDRESS_MAP_END
@@ -771,7 +769,7 @@ static ADDRESS_MAP_START( headon2_io_map, AS_IO, 8, vicdual_state )
/* no decoder, just logic gates, so in theory the
game can read/write from multiple locations at once */
- AM_RANGE(0x00, 0x1f) AM_READWRITE_LEGACY(headon2_io_r, headon2_io_w)
+ AM_RANGE(0x00, 0x1f) AM_READWRITE(headon2_io_r, headon2_io_w)
ADDRESS_MAP_END
@@ -780,7 +778,7 @@ static ADDRESS_MAP_START( digger_io_map, AS_IO, 8, vicdual_state )
/* no decoder, just logic gates, so in theory the
game can read/write from multiple locations at once */
- AM_RANGE(0x00, 0x1f) AM_READWRITE_LEGACY(headon2_io_r, digger_io_w)
+ AM_RANGE(0x00, 0x1f) AM_READWRITE(headon2_io_r, digger_io_w)
ADDRESS_MAP_END
@@ -944,104 +942,104 @@ MACHINE_CONFIG_END
*
*************************************/
-static WRITE8_HANDLER( invho2_io_w )
+WRITE8_MEMBER(vicdual_state::invho2_io_w)
{
- if (offset & 0x01) invho2_audio_w(space, 0, data);
- if (offset & 0x02) invinco_audio_w(space, 0, data);
- if (offset & 0x08) assert_coin_status(space->machine());
- if (offset & 0x40) vicdual_palette_bank_w(space, 0, data);
+ if (offset & 0x01) invho2_audio_w(&space, 0, data);
+ if (offset & 0x02) invinco_audio_w(&space, 0, data);
+ if (offset & 0x08) assert_coin_status(machine());
+ if (offset & 0x40) vicdual_palette_bank_w(&space, 0, data);
}
-static WRITE8_HANDLER( invds_io_w )
+WRITE8_MEMBER(vicdual_state::invds_io_w)
{
- if (offset & 0x01) invinco_audio_w(space, 0, data);
+ if (offset & 0x01) invinco_audio_w(&space, 0, data);
if (offset & 0x02) { /* deepscan_audio_w(0, data) */ }
- if (offset & 0x08) assert_coin_status(space->machine());
- if (offset & 0x40) vicdual_palette_bank_w(space, 0, data);
+ if (offset & 0x08) assert_coin_status(machine());
+ if (offset & 0x40) vicdual_palette_bank_w(&space, 0, data);
}
-static WRITE8_HANDLER( sspacaho_io_w )
+WRITE8_MEMBER(vicdual_state::sspacaho_io_w)
{
- if (offset & 0x01) invho2_audio_w(space, 0, data);
- if (offset & 0x02) { /* sspaceatt_audio_w(space, 0, data) */ }
- if (offset & 0x08) assert_coin_status(space->machine());
- if (offset & 0x40) vicdual_palette_bank_w(space, 0, data);
+ if (offset & 0x01) invho2_audio_w(&space, 0, data);
+ if (offset & 0x02) { /* s&spaceatt_audio_w(&space, 0, data) */ }
+ if (offset & 0x08) assert_coin_status(machine());
+ if (offset & 0x40) vicdual_palette_bank_w(&space, 0, data);
}
-static WRITE8_HANDLER( tranqgun_io_w )
+WRITE8_MEMBER(vicdual_state::tranqgun_io_w)
{
- if (offset & 0x01) { /* tranqgun_audio_w(space, 0, data) */ }
- if (offset & 0x02) vicdual_palette_bank_w(space, 0, data);
- if (offset & 0x08) assert_coin_status(space->machine());
+ if (offset & 0x01) { /* tranqgun_audio_w(&space, 0, data) */ }
+ if (offset & 0x02) vicdual_palette_bank_w(&space, 0, data);
+ if (offset & 0x08) assert_coin_status(machine());
}
-static WRITE8_HANDLER( spacetrk_io_w )
+WRITE8_MEMBER(vicdual_state::spacetrk_io_w)
{
- if (offset & 0x01) { /* spacetrk_audio_w(space, 0, data) */ }
- if (offset & 0x02) { /* spacetrk_audio_w(space, 0, data) */ }
- if (offset & 0x08) assert_coin_status(space->machine());
- if (offset & 0x40) vicdual_palette_bank_w(space, 0, data);
+ if (offset & 0x01) { /* &spacetrk_audio_w(&space, 0, data) */ }
+ if (offset & 0x02) { /* &spacetrk_audio_w(&space, 0, data) */ }
+ if (offset & 0x08) assert_coin_status(machine());
+ if (offset & 0x40) vicdual_palette_bank_w(&space, 0, data);
}
-static WRITE8_HANDLER( carnival_io_w )
+WRITE8_MEMBER(vicdual_state::carnival_io_w)
{
- if (offset & 0x01) carnival_audio_1_w(space, 0, data);
- if (offset & 0x02) carnival_audio_2_w(space, 0, data);
- if (offset & 0x08) assert_coin_status(space->machine());
- if (offset & 0x40) vicdual_palette_bank_w(space, 0, data);
+ if (offset & 0x01) carnival_audio_1_w(&space, 0, data);
+ if (offset & 0x02) carnival_audio_2_w(&space, 0, data);
+ if (offset & 0x08) assert_coin_status(machine());
+ if (offset & 0x40) vicdual_palette_bank_w(&space, 0, data);
}
-static WRITE8_HANDLER( brdrline_io_w )
+WRITE8_MEMBER(vicdual_state::brdrline_io_w)
{
- if (offset & 0x01) { /* brdrline_audio_w(space, 0, data) */ }
- if (offset & 0x02) vicdual_palette_bank_w(space, 0, data);
- if (offset & 0x08) assert_coin_status(space->machine());
+ if (offset & 0x01) { /* brdrline_audio_w(&space, 0, data) */ }
+ if (offset & 0x02) vicdual_palette_bank_w(&space, 0, data);
+ if (offset & 0x08) assert_coin_status(machine());
}
-static WRITE8_HANDLER( pulsar_io_w )
+WRITE8_MEMBER(vicdual_state::pulsar_io_w)
{
- if (offset & 0x01) pulsar_audio_1_w(space, 0, data);
- if (offset & 0x02) pulsar_audio_2_w(space, 0, data);
- if (offset & 0x08) assert_coin_status(space->machine());
- if (offset & 0x40) vicdual_palette_bank_w(space, 0, data);
+ if (offset & 0x01) pulsar_audio_1_w(&space, 0, data);
+ if (offset & 0x02) pulsar_audio_2_w(&space, 0, data);
+ if (offset & 0x08) assert_coin_status(machine());
+ if (offset & 0x40) vicdual_palette_bank_w(&space, 0, data);
}
-static WRITE8_HANDLER( heiankyo_io_w )
+WRITE8_MEMBER(vicdual_state::heiankyo_io_w)
{
if (offset & 0x01) { /* heiankyo_audio_1_w(0, data) */ }
if (offset & 0x02)
{
- vicdual_palette_bank_w(space, 0, data >> 6);
+ vicdual_palette_bank_w(&space, 0, data >> 6);
/* heiankyo_audio_2_w(0, data & 0x3f); */
}
- if (offset & 0x08) assert_coin_status(space->machine());
+ if (offset & 0x08) assert_coin_status(machine());
}
-static WRITE8_HANDLER( alphaho_io_w )
+WRITE8_MEMBER(vicdual_state::alphaho_io_w)
{
if (offset & 0x01) { /* headon_audio_w(0, data) */ }
if (offset & 0x02) { /* alphaf_audio_w(0, data) */ }
- if (offset & 0x08) assert_coin_status(space->machine());
- if (offset & 0x40) vicdual_palette_bank_w(space, 0, data);
+ if (offset & 0x08) assert_coin_status(machine());
+ if (offset & 0x40) vicdual_palette_bank_w(&space, 0, data);
}
static ADDRESS_MAP_START( vicdual_dualgame_map, AS_PROGRAM, 8, vicdual_state )
AM_RANGE(0x0000, 0x3fff) AM_MIRROR(0x4000) AM_ROM
- AM_RANGE(0x8000, 0x83ff) AM_MIRROR(0x7000) AM_RAM_WRITE_LEGACY(vicdual_videoram_w) AM_BASE(m_videoram)
+ AM_RANGE(0x8000, 0x83ff) AM_MIRROR(0x7000) AM_RAM_WRITE(vicdual_videoram_w) AM_BASE(m_videoram)
AM_RANGE(0x8400, 0x87ff) AM_MIRROR(0x7000) AM_RAM
- AM_RANGE(0x8800, 0x8fff) AM_MIRROR(0x7000) AM_RAM_WRITE_LEGACY(vicdual_characterram_w) AM_BASE(m_characterram)
+ AM_RANGE(0x8800, 0x8fff) AM_MIRROR(0x7000) AM_RAM_WRITE(vicdual_characterram_w) AM_BASE(m_characterram)
ADDRESS_MAP_END
@@ -1055,7 +1053,7 @@ static ADDRESS_MAP_START( invho2_io_map, AS_IO, 8, vicdual_state )
/* no decoder, just logic gates, so in theory the
game can write to multiple locations at once */
- AM_RANGE(0x00, 0x7f) AM_WRITE_LEGACY(invho2_io_w)
+ AM_RANGE(0x00, 0x7f) AM_WRITE(invho2_io_w)
ADDRESS_MAP_END
@@ -1069,7 +1067,7 @@ static ADDRESS_MAP_START( invds_io_map, AS_IO, 8, vicdual_state )
/* no decoder, just logic gates, so in theory the
game can write to multiple locations at once */
- AM_RANGE(0x00, 0x7f) AM_WRITE_LEGACY(invds_io_w)
+ AM_RANGE(0x00, 0x7f) AM_WRITE(invds_io_w)
ADDRESS_MAP_END
@@ -1083,7 +1081,7 @@ static ADDRESS_MAP_START( sspacaho_io_map, AS_IO, 8, vicdual_state )
/* no decoder, just logic gates, so in theory the
game can write to multiple locations at once */
- AM_RANGE(0x00, 0x7f) AM_WRITE_LEGACY(sspacaho_io_w)
+ AM_RANGE(0x00, 0x7f) AM_WRITE(sspacaho_io_w)
ADDRESS_MAP_END
@@ -1097,7 +1095,7 @@ static ADDRESS_MAP_START( tranqgun_io_map, AS_IO, 8, vicdual_state )
/* no decoder, just logic gates, so in theory the
game can write to multiple locations at once */
- AM_RANGE(0x00, 0x0f) AM_WRITE_LEGACY(tranqgun_io_w)
+ AM_RANGE(0x00, 0x0f) AM_WRITE(tranqgun_io_w)
ADDRESS_MAP_END
@@ -1111,7 +1109,7 @@ static ADDRESS_MAP_START( spacetrk_io_map, AS_IO, 8, vicdual_state )
/* no decoder, just logic gates, so in theory the
game can write to multiple locations at once */
- AM_RANGE(0x00, 0x7f) AM_WRITE_LEGACY(spacetrk_io_w)
+ AM_RANGE(0x00, 0x7f) AM_WRITE(spacetrk_io_w)
ADDRESS_MAP_END
@@ -1125,7 +1123,7 @@ static ADDRESS_MAP_START( carnival_io_map, AS_IO, 8, vicdual_state )
/* no decoder, just logic gates, so in theory the
game can write to multiple locations at once */
- AM_RANGE(0x00, 0x7f) AM_WRITE_LEGACY(carnival_io_w)
+ AM_RANGE(0x00, 0x7f) AM_WRITE(carnival_io_w)
ADDRESS_MAP_END
@@ -1139,7 +1137,7 @@ static ADDRESS_MAP_START( brdrline_io_map, AS_IO, 8, vicdual_state )
/* no decoder, just logic gates, so in theory the
game can write to multiple locations at once */
- AM_RANGE(0x00, 0x0f) AM_WRITE_LEGACY(brdrline_io_w)
+ AM_RANGE(0x00, 0x0f) AM_WRITE(brdrline_io_w)
ADDRESS_MAP_END
@@ -1153,7 +1151,7 @@ static ADDRESS_MAP_START( pulsar_io_map, AS_IO, 8, vicdual_state )
/* no decoder, just logic gates, so in theory the
game can write to multiple locations at once */
- AM_RANGE(0x00, 0x7f) AM_WRITE_LEGACY(pulsar_io_w)
+ AM_RANGE(0x00, 0x7f) AM_WRITE(pulsar_io_w)
ADDRESS_MAP_END
@@ -1167,7 +1165,7 @@ static ADDRESS_MAP_START( heiankyo_io_map, AS_IO, 8, vicdual_state )
/* no decoder, just logic gates, so in theory the
game can write to multiple locations at once */
- AM_RANGE(0x00, 0x0f) AM_WRITE_LEGACY(heiankyo_io_w)
+ AM_RANGE(0x00, 0x0f) AM_WRITE(heiankyo_io_w)
ADDRESS_MAP_END
@@ -1181,7 +1179,7 @@ static ADDRESS_MAP_START( alphaho_io_map, AS_IO, 8, vicdual_state )
/* no decoder, just logic gates, so in theory the
game can write to multiple locations at once */
- AM_RANGE(0x00, 0x7f) AM_WRITE_LEGACY(alphaho_io_w)
+ AM_RANGE(0x00, 0x7f) AM_WRITE(alphaho_io_w)
ADDRESS_MAP_END
@@ -2043,10 +2041,9 @@ MACHINE_CONFIG_END
*************************************/
-static WRITE8_HANDLER( samurai_protection_w )
+WRITE8_MEMBER(vicdual_state::samurai_protection_w)
{
- vicdual_state *state = space->machine().driver_data<vicdual_state>();
- state->m_samurai_protection_data = data;
+ m_samurai_protection_data = data;
}
@@ -2065,20 +2062,20 @@ static CUSTOM_INPUT( samurai_protection_r )
}
-static WRITE8_HANDLER( samurai_io_w )
+WRITE8_MEMBER(vicdual_state::samurai_io_w)
{
if (offset & 0x02) { /* samurai_audio_w(0, data) */ }
- if (offset & 0x08) assert_coin_status(space->machine());
- if (offset & 0x40) vicdual_palette_bank_w(space, 0, data);
+ if (offset & 0x08) assert_coin_status(machine());
+ if (offset & 0x40) vicdual_palette_bank_w(&space, 0, data);
}
/* dual game hardware */
static ADDRESS_MAP_START( samurai_map, AS_PROGRAM, 8, vicdual_state )
- AM_RANGE(0x0000, 0x3fff) AM_MIRROR(0x4000) AM_ROM AM_WRITE_LEGACY(samurai_protection_w)
- AM_RANGE(0x8000, 0x83ff) AM_MIRROR(0x7000) AM_RAM_WRITE_LEGACY(vicdual_videoram_w) AM_BASE(m_videoram)
+ AM_RANGE(0x0000, 0x3fff) AM_MIRROR(0x4000) AM_ROM AM_WRITE(samurai_protection_w)
+ AM_RANGE(0x8000, 0x83ff) AM_MIRROR(0x7000) AM_RAM_WRITE(vicdual_videoram_w) AM_BASE(m_videoram)
AM_RANGE(0x8400, 0x87ff) AM_MIRROR(0x7000) AM_RAM
- AM_RANGE(0x8800, 0x8fff) AM_MIRROR(0x7000) AM_RAM_WRITE_LEGACY(vicdual_characterram_w) AM_BASE(m_characterram)
+ AM_RANGE(0x8800, 0x8fff) AM_MIRROR(0x7000) AM_RAM_WRITE(vicdual_characterram_w) AM_BASE(m_characterram)
ADDRESS_MAP_END
@@ -2092,7 +2089,7 @@ static ADDRESS_MAP_START( samurai_io_map, AS_IO, 8, vicdual_state )
/* no decoder, just logic gates, so in theory the
game can write to multiple locations at once */
- AM_RANGE(0x00, 0x7f) AM_WRITE_LEGACY(samurai_io_w)
+ AM_RANGE(0x00, 0x7f) AM_WRITE(samurai_io_w)
ADDRESS_MAP_END
@@ -2168,31 +2165,31 @@ MACHINE_CONFIG_END
*
*************************************/
-static READ8_HANDLER( nsub_io_r )
+READ8_MEMBER(vicdual_state::nsub_io_r)
{
UINT8 ret = 0;
- if (offset & 0x01) ret = input_port_read(space->machine(), "IN0");
- if (offset & 0x08) ret = input_port_read(space->machine(), "IN1");
+ if (offset & 0x01) ret = input_port_read(machine(), "IN0");
+ if (offset & 0x08) ret = input_port_read(machine(), "IN1");
return ret;
}
-static WRITE8_HANDLER( nsub_io_w )
+WRITE8_MEMBER(vicdual_state::nsub_io_w)
{
- if (offset & 0x01) assert_coin_status(space->machine());
+ if (offset & 0x01) assert_coin_status(machine());
if (offset & 0x02) { /* nsub_audio_w(0, data) */ }
- if (offset & 0x04) vicdual_palette_bank_w(space, 0, data);
+ if (offset & 0x04) vicdual_palette_bank_w(&space, 0, data);
}
static ADDRESS_MAP_START( nsub_map, AS_PROGRAM, 8, vicdual_state )
AM_RANGE(0x0000, 0x3fff) AM_MIRROR(0x4000) AM_ROM
AM_RANGE(0x8000, 0xbfff) AM_NOP /* unused */
- AM_RANGE(0xc000, 0xc3ff) AM_MIRROR(0x3000) AM_RAM_WRITE_LEGACY(vicdual_videoram_w) AM_BASE(m_videoram)
+ AM_RANGE(0xc000, 0xc3ff) AM_MIRROR(0x3000) AM_RAM_WRITE(vicdual_videoram_w) AM_BASE(m_videoram)
AM_RANGE(0xc400, 0xc7ff) AM_MIRROR(0x3000) AM_RAM
- AM_RANGE(0xc800, 0xcfff) AM_MIRROR(0x3000) AM_RAM_WRITE_LEGACY(vicdual_characterram_w) AM_BASE(m_characterram)
+ AM_RANGE(0xc800, 0xcfff) AM_MIRROR(0x3000) AM_RAM_WRITE(vicdual_characterram_w) AM_BASE(m_characterram)
ADDRESS_MAP_END
@@ -2201,7 +2198,7 @@ static ADDRESS_MAP_START( nsub_io_map, AS_IO, 8, vicdual_state )
/* no decoder, just logic gates, so in theory the
game can read/write from multiple locations at once */
- AM_RANGE(0x00, 0x1f) AM_READWRITE_LEGACY(nsub_io_r, nsub_io_w)
+ AM_RANGE(0x00, 0x1f) AM_READWRITE(nsub_io_r, nsub_io_w)
ADDRESS_MAP_END
@@ -2263,32 +2260,32 @@ MACHINE_CONFIG_END
*
*************************************/
-static READ8_HANDLER( invinco_io_r )
+READ8_MEMBER(vicdual_state::invinco_io_r)
{
UINT8 ret = 0;
- if (offset & 0x01) ret = input_port_read(space->machine(), "IN0");
- if (offset & 0x02) ret = input_port_read(space->machine(), "IN1");
- if (offset & 0x08) ret = input_port_read(space->machine(), "IN2");
+ if (offset & 0x01) ret = input_port_read(machine(), "IN0");
+ if (offset & 0x02) ret = input_port_read(machine(), "IN1");
+ if (offset & 0x08) ret = input_port_read(machine(), "IN2");
return ret;
}
-static WRITE8_HANDLER( invinco_io_w )
+WRITE8_MEMBER(vicdual_state::invinco_io_w)
{
- if (offset & 0x01) assert_coin_status(space->machine());
- if (offset & 0x02) invinco_audio_w(space, 0, data);
- if (offset & 0x04) vicdual_palette_bank_w(space, 0, data);
+ if (offset & 0x01) assert_coin_status(machine());
+ if (offset & 0x02) invinco_audio_w(&space, 0, data);
+ if (offset & 0x04) vicdual_palette_bank_w(&space, 0, data);
}
static ADDRESS_MAP_START( invinco_map, AS_PROGRAM, 8, vicdual_state )
AM_RANGE(0x0000, 0x3fff) AM_MIRROR(0x4000) AM_ROM
AM_RANGE(0x8000, 0xbfff) AM_NOP /* unused */
- AM_RANGE(0xc000, 0xc3ff) AM_MIRROR(0x3000) AM_RAM_WRITE_LEGACY(vicdual_videoram_w) AM_BASE(m_videoram)
+ AM_RANGE(0xc000, 0xc3ff) AM_MIRROR(0x3000) AM_RAM_WRITE(vicdual_videoram_w) AM_BASE(m_videoram)
AM_RANGE(0xc400, 0xc7ff) AM_MIRROR(0x3000) AM_RAM
- AM_RANGE(0xc800, 0xcfff) AM_MIRROR(0x3000) AM_RAM_WRITE_LEGACY(vicdual_characterram_w) AM_BASE(m_characterram)
+ AM_RANGE(0xc800, 0xcfff) AM_MIRROR(0x3000) AM_RAM_WRITE(vicdual_characterram_w) AM_BASE(m_characterram)
ADDRESS_MAP_END
@@ -2297,7 +2294,7 @@ static ADDRESS_MAP_START( invinco_io_map, AS_IO, 8, vicdual_state )
/* no decoder, just logic gates, so in theory the
game can read/write from multiple locations at once */
- AM_RANGE(0x00, 0x1f) AM_READWRITE_LEGACY(invinco_io_r, invinco_io_w)
+ AM_RANGE(0x00, 0x1f) AM_READWRITE(invinco_io_r, invinco_io_w)
ADDRESS_MAP_END