Add friendly macros to initialize an ioport_array_finder with an array of port names. Update namcona1.c, segaorun.c and segaybd.c to use them. Remove runtime ioport tag lookups from a few other drivers (nw)

This commit is contained in:
Alex W. Jackson 2014-09-24 05:17:48 +00:00
parent 12d3afe3a3
commit 3a15dad69a
15 changed files with 145 additions and 135 deletions

View File

@ -19,6 +19,16 @@
#define FINDER_DUMMY_TAG "finder_dummy_tag"
//**************************************************************************
// IOPORT ARRAY MACROS
//**************************************************************************
// these macros can be used to initialize an ioport_array with
// individual port names, instead of a base name + numeric suffix
#define IOPORT_ARRAY_MEMBER(name) const char * const name[] =
#define DECLARE_IOPORT_ARRAY(name) static const char * const name[]
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************

View File

@ -50,8 +50,6 @@ TIMER_DEVICE_CALLBACK_MEMBER(bladestl_state::bladestl_scanline)
* Memory handlers
*
*************************************/
const char * const bladestl_state::trackball_tags[] =
{ "TRACKBALL_P1_1", "TRACKBALL_P1_2", "TRACKBALL_P2_1", "TRACKBALL_P2_2" };
READ8_MEMBER(bladestl_state::trackball_r)
{
@ -205,16 +203,16 @@ static INPUT_PORTS_START( bladestl )
PORT_START("P2")
KONAMI8_B123_UNK(2)
PORT_START("TRACKBALL_P1_1")
PORT_START("TRACKBALL.0")
PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(63) PORT_REVERSE PORT_PLAYER(1)
PORT_START("TRACKBALL_P1_2")
PORT_START("TRACKBALL.1")
PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(63) PORT_PLAYER(1)
PORT_START("TRACKBALL_P2_1")
PORT_START("TRACKBALL.2")
PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(63) PORT_REVERSE PORT_PLAYER(2)
PORT_START("TRACKBALL_P2_2")
PORT_START("TRACKBALL.3")
PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(63) PORT_PLAYER(2)
INPUT_PORTS_END
@ -228,10 +226,10 @@ static INPUT_PORTS_START( bladestle )
PORT_MODIFY("P1")
PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW3:4" ) /* Listed as "Unused" */
PORT_MODIFY("TRACKBALL_P2_1")
PORT_MODIFY("TRACKBALL.2")
PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(63) PORT_PLAYER(2)
PORT_MODIFY("TRACKBALL_P2_2")
PORT_MODIFY("TRACKBALL.3")
PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(63) PORT_PLAYER(2)
INPUT_PORTS_END

View File

@ -660,12 +660,12 @@ WRITE8_MEMBER(namcona1_state::port6_w)
m_mcu_port6 = data;
}
const char * const namcona1_state::ioport_tags[] = { "P4", "DSW", "P1", "P2" };
IOPORT_ARRAY_MEMBER(namcona1_state::muxed_inputs) { "P4", "DSW", "P1", "P2" };
READ8_MEMBER(namcona1_state::port7_r)
{
if ((m_mcu_port6 & 0x80) == 0)
return m_ioport[m_mcu_port6 >> 5]->read();
return m_muxed_inputs[m_mcu_port6 >> 5]->read();
else
return 0xff;
}

View File

@ -679,6 +679,8 @@ TIMER_DEVICE_CALLBACK_MEMBER(segaorun_state::bankmotor_update)
// for Out Run
//-------------------------------------------------
IOPORT_ARRAY_MEMBER( segaorun_state::digital_ports ) { "SERVICE", "UNKNOWN", "COINAGE", "DSW" };
READ16_MEMBER( segaorun_state::outrun_custom_io_r )
{
offset &= 0x7f/2;
@ -689,14 +691,12 @@ READ16_MEMBER( segaorun_state::outrun_custom_io_r )
case 0x10/2:
{
static const char *const sysports[] = { "SERVICE", "UNKNOWN", "COINAGE", "DSW" };
return ioport(sysports[offset & 3])->read();
return m_digital_ports[offset & 3]->read();
}
case 0x30/2:
{
static const char *const ports[] = { "ADC0", "ADC1", "ADC2", "ADC3", "ADC4", "ADC5", "ADC6", "ADC7" };
return ioport(ports[m_adc_select])->read_safe(0x0010);
return m_adc_ports[m_adc_select]->read_safe(0x0010);
}
case 0x60/2:
@ -777,14 +777,12 @@ READ16_MEMBER( segaorun_state::shangon_custom_io_r )
case 0x1004/2:
case 0x1006/2:
{
static const char *const sysports[] = { "SERVICE", "UNKNOWN", "COINAGE", "DSW" };
return ioport(sysports[offset & 3])->read();
return m_digital_ports[offset & 3]->read();
}
case 0x3020/2:
{
static const char *const ports[] = { "ADC0", "ADC1", "ADC2", "ADC3" };
return ioport(ports[m_adc_select])->read_safe(0x0010);
return m_adc_ports[m_adc_select]->read_safe(0x0010);
}
default:
@ -981,16 +979,16 @@ static INPUT_PORTS_START( outrun_generic )
PORT_DIPSETTING( 0x40, DEF_STR( Hard ) )
PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) )
PORT_START("ADC0") // steering
PORT_START("ADC.0") // steering
PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x20,0xe0) PORT_SENSITIVITY(100) PORT_KEYDELTA(4)
PORT_START("ADC1") // gas pedal
PORT_START("ADC.1") // gas pedal
PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(20)
PORT_START("ADC2") // brake
PORT_START("ADC.2") // brake
PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_SENSITIVITY(100) PORT_KEYDELTA(40)
PORT_START("ADC3")
PORT_START("ADC.3")
PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, segaorun_state, bankmotor_pos_r, NULL)
INPUT_PORTS_END
@ -1121,10 +1119,10 @@ static INPUT_PORTS_START( shangon )
PORT_DIPUNUSED_DIPLOC( 0x40, IP_ACTIVE_LOW, "SWB:7" )
PORT_DIPUNUSED_DIPLOC( 0x80, IP_ACTIVE_LOW, "SWB:8" )
PORT_MODIFY("ADC0") // steering
PORT_MODIFY("ADC.0") // steering
PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x20,0xe0) PORT_SENSITIVITY(100) PORT_KEYDELTA(4) PORT_REVERSE
PORT_MODIFY("ADC3")
PORT_MODIFY("ADC.3")
PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
INPUT_PORTS_END

View File

@ -108,9 +108,8 @@ READ16_MEMBER( segaybd_state::analog_r )
WRITE16_MEMBER( segaybd_state::analog_w )
{
static const char *const ports[] = { "ADC0", "ADC1", "ADC2", "ADC3", "ADC4", "ADC5", "ADC6" };
int selected = ((offset & 3) == 3) ? (3 + (m_misc_io_data[0x08/2] & 3)) : (offset & 3);
m_analog_data[offset & 3] = ioport(ports[selected])->read_safe(0xff);
m_analog_data[offset & 3] = m_adc_ports[selected]->read_safe(0xff);
}
@ -118,9 +117,11 @@ WRITE16_MEMBER( segaybd_state::analog_w )
// io_chip_r - handle reads from the I/O chip
//-------------------------------------------------
IOPORT_ARRAY_MEMBER( segaybd_state::digital_ports )
{ "P1", "GENERAL", "PORTC", "PORTD", "PORTE", "DSW", "COINAGE", "PORTH" };
READ16_MEMBER( segaybd_state::io_chip_r )
{
static const char *const portnames[] = { "P1", "GENERAL", "PORTC", "PORTD", "PORTE", "DSW", "COINAGE", "PORTH" };
offset &= 0x1f/2;
switch (offset)
@ -139,7 +140,7 @@ READ16_MEMBER( segaybd_state::io_chip_r )
return m_misc_io_data[offset];
// otherwise, return an input port
return ioport(portnames[offset])->read();
return m_digital_ports[offset]->read();
// 'SEGA' protection
case 0x10/2:
@ -893,13 +894,13 @@ static INPUT_PORTS_START( gforce2 )
PORT_DIPSETTING( 0x40, DEF_STR( Upright ) )
PORT_DIPSETTING( 0x00, "City" )
PORT_START("ADC0") // stick X
PORT_START("ADC.0") // stick X
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_MINMAX(0x01,0xff) PORT_SENSITIVITY(100) PORT_KEYDELTA(4)
PORT_START("ADC1") // stick Y
PORT_START("ADC.1") // stick Y
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_MINMAX(0x01,0xff) PORT_SENSITIVITY(100) PORT_KEYDELTA(4) PORT_REVERSE
PORT_START("ADC2") // throttle
PORT_START("ADC.2") // throttle
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Z ) PORT_MINMAX(0x01,0xff) PORT_SENSITIVITY(100) PORT_KEYDELTA(79)
INPUT_PORTS_END
@ -935,13 +936,13 @@ static INPUT_PORTS_START( gloc )
PORT_DIPSETTING( 0x80, "3 to Start, 2 to Continue" )
PORT_DIPSETTING( 0x00, "4 to Start, 3 to Continue" )
PORT_START("ADC3") // stick Y
PORT_START("ADC.3") // stick Y
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_MINMAX(0x40,0xc0) PORT_SENSITIVITY(100) PORT_KEYDELTA(4) PORT_REVERSE
PORT_START("ADC4") // throttle
PORT_START("ADC.4") // throttle
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Z ) PORT_SENSITIVITY(100) PORT_KEYDELTA(79)
PORT_START("ADC5") // stick X
PORT_START("ADC.5") // stick X
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_MINMAX(0x20,0xe0) PORT_SENSITIVITY(100) PORT_KEYDELTA(4)
INPUT_PORTS_END
@ -1020,16 +1021,16 @@ static INPUT_PORTS_START( glocr360 )
PORT_DIPSETTING( 0x80, DEF_STR( 1C_8C ) )
PORT_DIPSETTING( 0x00, "Free Play (if Coin A too) or 1/1" )
PORT_START("ADC0") // moving pitch
PORT_START("ADC.0") // moving pitch
PORT_BIT( 0xff, 0x7f, IPT_AD_STICK_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(4) PORT_PLAYER(2)
PORT_START("ADC2") // moving roll
PORT_START("ADC.2") // moving roll
PORT_BIT( 0xff, 0x7f, IPT_AD_STICK_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(4) PORT_PLAYER(3)
PORT_START("ADC3") // stick Y
PORT_START("ADC.3") // stick Y
PORT_BIT( 0xff, 0x7f, IPT_AD_STICK_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(4) PORT_REVERSE
PORT_START("ADC5") // stick X
PORT_START("ADC.5") // stick X
PORT_BIT( 0xff, 0x7f, IPT_AD_STICK_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(4)
INPUT_PORTS_END
@ -1063,13 +1064,13 @@ static INPUT_PORTS_START( pdrift )
PORT_DIPSETTING( 0x40, DEF_STR( Hard ) )
PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) )
PORT_START("ADC3") // brake
PORT_START("ADC.3") // brake
PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_SENSITIVITY(100) PORT_KEYDELTA(40)
PORT_START("ADC4") // gas pedal
PORT_START("ADC.4") // gas pedal
PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(20)
PORT_START("ADC5") // steering
PORT_START("ADC.5") // steering
PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x20,0xe0) PORT_SENSITIVITY(100) PORT_KEYDELTA(4)
INPUT_PORTS_END
@ -1268,16 +1269,16 @@ static INPUT_PORTS_START( rchase )
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_START("ADC0")
PORT_START("ADC.0")
PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_SENSITIVITY(50) PORT_KEYDELTA(5)
PORT_START("ADC1")
PORT_START("ADC.1")
PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_SENSITIVITY(50) PORT_KEYDELTA(5)
PORT_START("ADC2")
PORT_START("ADC.2")
PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_SENSITIVITY(50) PORT_KEYDELTA(5) PORT_PLAYER(2)
PORT_START("ADC3")
PORT_START("ADC.3")
PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_SENSITIVITY(50) PORT_KEYDELTA(5) PORT_PLAYER(2)
INPUT_PORTS_END

View File

@ -180,18 +180,6 @@ WRITE16_MEMBER(tatsumi_state::bigfight_a60000_w)
COMBINE_DATA(&m_bigfight_a60000[offset]);
}
READ16_MEMBER(tatsumi_state::cyclwarr_input_r)
{
static const char *const port[] = { "SERVICE", "P1", "P2", "DSW3" };
return ioport(port[offset])->read();
}
READ16_MEMBER(tatsumi_state::cyclwarr_input2_r)
{
static const char *const port2[] = { "DSW1", "DSW2", "P3", "P4" };
return ioport(port2[offset])->read();
}
WRITE16_MEMBER(tatsumi_state::cyclwarr_sound_w)
{
soundlatch_byte_w(space, 0, data >> 8);
@ -297,8 +285,14 @@ static ADDRESS_MAP_START( cyclwarr_68000a_map, AS_PROGRAM, 16, tatsumi_state )
AM_RANGE(0x0a6000, 0x0a6001) AM_WRITE(bigfight_a60000_w)
AM_RANGE(0x0b8000, 0x0b8001) AM_WRITE(cyclwarr_sound_w)
AM_RANGE(0x0b9002, 0x0b9009) AM_READ(cyclwarr_input_r) /* Coins, P1 input, P2 input, dip 3 */
AM_RANGE(0x0ba000, 0x0ba007) AM_READ(cyclwarr_input2_r) /* Dip 1, Dip 2, P3 input, P4 input */
AM_RANGE(0x0b9002, 0x0b9003) AM_READ_PORT("SERVICE")
AM_RANGE(0x0b9004, 0x0b9005) AM_READ_PORT("P1")
AM_RANGE(0x0b9006, 0x0b9007) AM_READ_PORT("P2")
AM_RANGE(0x0b9008, 0x0b9009) AM_READ_PORT("DSW3")
AM_RANGE(0x0ba000, 0x0ba001) AM_READ_PORT("DSW1")
AM_RANGE(0x0ba002, 0x0ba003) AM_READ_PORT("DSW2")
AM_RANGE(0x0ba004, 0x0ba005) AM_READ_PORT("P3")
AM_RANGE(0x0ba006, 0x0ba007) AM_READ_PORT("P4")
AM_RANGE(0x0ba008, 0x0ba009) AM_READWRITE(cyclwarr_control_r, cyclwarr_control_w)
AM_RANGE(0x0c0000, 0x0c3fff) AM_READWRITE(cyclwarr_sprite_r, cyclwarr_sprite_w) AM_SHARE("spriteram")
AM_RANGE(0x0ca000, 0x0ca1ff) AM_WRITE(tatsumi_sprite_control_w) AM_SHARE("sprite_ctlram")
@ -317,10 +311,15 @@ static ADDRESS_MAP_START( cyclwarr_68000b_map, AS_PROGRAM, 16, tatsumi_state )
AM_RANGE(0x0a4000, 0x0a4001) AM_WRITE(bigfight_a40000_w)
AM_RANGE(0x0a6000, 0x0a6001) AM_WRITE(bigfight_a60000_w)
AM_RANGE(0x0b9002, 0x0b9009) AM_READ(cyclwarr_input_r) /* Coins, P1 input, P2 input, dip 3 */
AM_RANGE(0x0ba000, 0x0ba007) AM_READ(cyclwarr_input2_r) /* Dip 1, Dip 2, P3 input, P4 input */
AM_RANGE(0x0b9002, 0x0b9003) AM_READ_PORT("SERVICE")
AM_RANGE(0x0b9004, 0x0b9005) AM_READ_PORT("P1")
AM_RANGE(0x0b9006, 0x0b9007) AM_READ_PORT("P2")
AM_RANGE(0x0b9008, 0x0b9009) AM_READ_PORT("DSW3")
AM_RANGE(0x0ba000, 0x0ba001) AM_READ_PORT("DSW1")
AM_RANGE(0x0ba002, 0x0ba003) AM_READ_PORT("DSW2")
AM_RANGE(0x0ba004, 0x0ba005) AM_READ_PORT("P3")
AM_RANGE(0x0ba006, 0x0ba007) AM_READ_PORT("P4")
AM_RANGE(0x0ba008, 0x0ba009) AM_READ(cyclwarr_control_r)
AM_RANGE(0x0c0000, 0x0c3fff) AM_READWRITE(cyclwarr_sprite_r, cyclwarr_sprite_w)
AM_RANGE(0x0ca000, 0x0ca1ff) AM_WRITE(tatsumi_sprite_control_w)
AM_RANGE(0x0d0000, 0x0d3fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
@ -353,8 +352,14 @@ static ADDRESS_MAP_START( bigfight_68000a_map, AS_PROGRAM, 16, tatsumi_state )
AM_RANGE(0x0a6000, 0x0a6001) AM_WRITE(bigfight_a60000_w)
AM_RANGE(0x0b8000, 0x0b8001) AM_WRITE(cyclwarr_sound_w)
AM_RANGE(0x0b9002, 0x0b9009) AM_READ(cyclwarr_input_r) /* Coins, P1 input, P2 input, dip 3 */
AM_RANGE(0x0ba000, 0x0ba007) AM_READ(cyclwarr_input2_r) /* Dip 1, Dip 2, P3 input, P4 input */
AM_RANGE(0x0b9002, 0x0b9003) AM_READ_PORT("SERVICE")
AM_RANGE(0x0b9004, 0x0b9005) AM_READ_PORT("P1")
AM_RANGE(0x0b9006, 0x0b9007) AM_READ_PORT("P2")
AM_RANGE(0x0b9008, 0x0b9009) AM_READ_PORT("DSW3")
AM_RANGE(0x0ba000, 0x0ba001) AM_READ_PORT("DSW1")
AM_RANGE(0x0ba002, 0x0ba003) AM_READ_PORT("DSW2")
AM_RANGE(0x0ba004, 0x0ba005) AM_READ_PORT("P3")
AM_RANGE(0x0ba006, 0x0ba007) AM_READ_PORT("P4")
AM_RANGE(0x0ba008, 0x0ba009) AM_READWRITE(cyclwarr_control_r, cyclwarr_control_w)
AM_RANGE(0x0c0000, 0x0c3fff) AM_READWRITE(cyclwarr_sprite_r, cyclwarr_sprite_w) AM_SHARE("spriteram")
AM_RANGE(0x0ca000, 0x0ca1ff) AM_WRITE(tatsumi_sprite_control_w) AM_SHARE("sprite_ctlram")
@ -371,10 +376,15 @@ static ADDRESS_MAP_START( bigfight_68000b_map, AS_PROGRAM, 16, tatsumi_state )
AM_RANGE(0x0a4000, 0x0a4001) AM_WRITE(bigfight_a40000_w)
AM_RANGE(0x0a6000, 0x0a6001) AM_WRITE(bigfight_a60000_w)
AM_RANGE(0x0b9002, 0x0b9009) AM_READ(cyclwarr_input_r) /* Coins, P1 input, P2 input, dip 3 */
AM_RANGE(0x0ba000, 0x0ba007) AM_READ(cyclwarr_input2_r) /* Dip 1, Dip 2, P3 input, P4 input */
AM_RANGE(0x0b9002, 0x0b9003) AM_READ_PORT("SERVICE")
AM_RANGE(0x0b9004, 0x0b9005) AM_READ_PORT("P1")
AM_RANGE(0x0b9006, 0x0b9007) AM_READ_PORT("P2")
AM_RANGE(0x0b9008, 0x0b9009) AM_READ_PORT("DSW3")
AM_RANGE(0x0ba000, 0x0ba001) AM_READ_PORT("DSW1")
AM_RANGE(0x0ba002, 0x0ba003) AM_READ_PORT("DSW2")
AM_RANGE(0x0ba004, 0x0ba005) AM_READ_PORT("P3")
AM_RANGE(0x0ba006, 0x0ba007) AM_READ_PORT("P4")
AM_RANGE(0x0ba008, 0x0ba009) AM_READ(cyclwarr_control_r)
AM_RANGE(0x0c0000, 0x0c3fff) AM_READWRITE(cyclwarr_sprite_r, cyclwarr_sprite_w)
AM_RANGE(0x0ca000, 0x0ca1ff) AM_WRITE(tatsumi_sprite_control_w)
AM_RANGE(0x0d0000, 0x0d3fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
@ -791,26 +801,15 @@ INPUT_PORTS_END
/******************************************************************************/
static const gfx_layout roundup5_charlayout =
static const gfx_layout spritelayout =
{
8,8, /* 16*16 sprites */
RGN_FRAC(1,1), /* 4096 sprites */
4, /* 4 bits per pixel */
8,8,
RGN_FRAC(1,1),
4,
{ 0, 1, 2, 3 },
{ 8,12,0,4, 24,28, 16,20},
{ 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32},
32*8 /* every sprite takes 32 consecutive bytes */
};
static const gfx_layout cyclwarr_charlayout =
{
8,8,
RGN_FRAC(1,3),
3,
{ RGN_FRAC(2,3), RGN_FRAC(1,3), RGN_FRAC(0,3)},
{ 0, 1, 2, 3, 4, 5, 6, 7},
{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8},
8*8
32*8
};
static const gfx_layout roundup5_vramlayout =
@ -825,18 +824,18 @@ static const gfx_layout roundup5_vramlayout =
};
static GFXDECODE_START( apache3 )
GFXDECODE_ENTRY( "gfx1", 0, roundup5_charlayout, 1024, 128)
GFXDECODE_ENTRY( "gfx4", 0, cyclwarr_charlayout, 768, 16)
GFXDECODE_ENTRY( "gfx1", 0, spritelayout, 1024, 128)
GFXDECODE_ENTRY( "gfx4", 0, gfx_8x8x3_planar, 768, 16)
GFXDECODE_END
static GFXDECODE_START( roundup5 )
GFXDECODE_ENTRY( "gfx1", 0, roundup5_charlayout, 1024, 256)
GFXDECODE_ENTRY( "gfx1", 0, spritelayout, 1024, 256)
GFXDECODE_ENTRY( NULL, 0, roundup5_vramlayout, 0, 16)
GFXDECODE_END
static GFXDECODE_START( cyclwarr )
GFXDECODE_ENTRY( "gfx1", 0, roundup5_charlayout, 8192, 512)
GFXDECODE_ENTRY( "gfx5", 0, cyclwarr_charlayout, 0, 512)
GFXDECODE_ENTRY( "gfx1", 0, spritelayout, 8192, 512)
GFXDECODE_ENTRY( "gfx5", 0, gfx_8x8x3_planar, 0, 512)
GFXDECODE_END
/******************************************************************************/

View File

@ -53,15 +53,15 @@ WRITE8_MEMBER(zaccaria_state::zaccaria_dsw_sel_w)
switch (data & 0xf0)
{
case 0xe0:
m_dsw = 0;
m_dsw_sel = 0;
break;
case 0xd0:
m_dsw = 1;
m_dsw_sel = 1;
break;
case 0xb0:
m_dsw = 2;
m_dsw_sel = 2;
break;
default:
@ -72,9 +72,7 @@ WRITE8_MEMBER(zaccaria_state::zaccaria_dsw_sel_w)
READ8_MEMBER(zaccaria_state::zaccaria_dsw_r)
{
static const char *const dswnames[] = { "IN0", "DSW0", "DSW1" };
return ioport(dswnames[m_dsw])->read();
return m_dsw_port[m_dsw_sel]->read();
}
@ -336,7 +334,7 @@ CUSTOM_INPUT_MEMBER(zaccaria_state::acs_r)
}
static INPUT_PORTS_START( monymony )
PORT_START("IN0")
PORT_START("DSW.0")
PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW 5I:1,2")
PORT_DIPSETTING( 0x00, "2" )
PORT_DIPSETTING( 0x01, "3" )
@ -361,7 +359,7 @@ static INPUT_PORTS_START( monymony )
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_START("DSW0")
PORT_START("DSW.1")
PORT_DIPNAME( 0x03, 0x01, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW 4I:1,2")
PORT_DIPSETTING( 0x01, "200000" )
PORT_DIPSETTING( 0x02, "300000" )
@ -384,7 +382,7 @@ static INPUT_PORTS_START( monymony )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_SERVICE( 0x80, IP_ACTIVE_HIGH ) PORT_DIPLOCATION("SW 4I:8")
PORT_START("DSW1")
PORT_START("DSW.2")
PORT_DIPNAME( 0x03, 0x02, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW 3I:1,2")
PORT_DIPSETTING( 0x03, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x02, DEF_STR( 1C_1C ) )
@ -447,12 +445,12 @@ INPUT_PORTS_END
static INPUT_PORTS_START( jackrabt )
PORT_INCLUDE( monymony )
PORT_MODIFY("IN0")
PORT_MODIFY("DSW.0")
PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW 5I:4")
PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_MODIFY("DSW0")
PORT_MODIFY("DSW.1")
PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW 4I:1")
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
@ -477,18 +475,6 @@ static INPUT_PORTS_START( jackrabt )
INPUT_PORTS_END
static const gfx_layout charlayout =
{
8,8,
RGN_FRAC(1,3),
3,
{ RGN_FRAC(2,3), RGN_FRAC(1,3), RGN_FRAC(0,3) },
{ 0, 1, 2, 3, 4, 5, 6, 7 },
{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
8*8
};
static const gfx_layout spritelayout =
{
16,16,
@ -503,7 +489,7 @@ static const gfx_layout spritelayout =
};
static GFXDECODE_START( zaccaria )
GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 32 )
GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x3_planar, 0, 32 )
GFXDECODE_ENTRY( "gfx1", 0, spritelayout, 32*8, 32 )
GFXDECODE_END

View File

@ -347,11 +347,10 @@ READ8_MEMBER(zaxxon_state::razmataz_counter_r)
CUSTOM_INPUT_MEMBER(zaxxon_state::razmataz_dial_r)
{
static const char *const dialname[2] = { "DIAL0", "DIAL1" };
int num = (FPTR)param;
int delta, res;
int res;
delta = ioport(dialname[num])->read();
int delta = m_dials[num]->read();
if (delta < 0x80)
{
@ -689,7 +688,7 @@ static INPUT_PORTS_START( razmataz )
PORT_START("SW00")
PORT_BIT( 0xff, 0x00, IPT_SPECIAL) PORT_CUSTOM_MEMBER(DEVICE_SELF, zaxxon_state,razmataz_dial_r, (void *)0)
PORT_START("DIAL0")
PORT_START("DIAL.0")
PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(30) PORT_KEYDELTA(15) PORT_RESET PORT_PLAYER(1)
PORT_START("SW01")
@ -704,7 +703,7 @@ static INPUT_PORTS_START( razmataz )
PORT_START("SW08")
PORT_BIT( 0xff, 0x00, IPT_SPECIAL) PORT_CUSTOM_MEMBER(DEVICE_SELF, zaxxon_state,razmataz_dial_r, (void *)1)
PORT_START("DIAL1")
PORT_START("DIAL.1")
PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(30) PORT_KEYDELTA(15) PORT_RESET PORT_PLAYER(2)
PORT_START("SW0C")
@ -782,7 +781,7 @@ static INPUT_PORTS_START( ixion )
PORT_MODIFY("SW00")
PORT_BIT( 0xff, 0x00, IPT_SPECIAL) PORT_CUSTOM_MEMBER(DEVICE_SELF, zaxxon_state,razmataz_dial_r, (void *)0)
PORT_START("DIAL0")
PORT_START("DIAL.0")
PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(30) PORT_KEYDELTA(15) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X) PORT_RESET
PORT_MODIFY("SW01")

View File

@ -11,7 +11,6 @@
class bladestl_state : public driver_device
{
static const char * const trackball_tags[];
public:
bladestl_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
@ -25,7 +24,7 @@ public:
m_filter2(*this, "filter2"),
m_filter3(*this, "filter3"),
m_gfxdecode(*this, "gfxdecode"),
m_trackball(*this, trackball_tags),
m_trackball(*this, "TRACKBALL"),
m_rombank(*this, "rombank") { }
required_device<cpu_device> m_maincpu;

View File

@ -25,7 +25,6 @@ enum
class namcona1_state : public driver_device
{
static const char * const ioport_tags[];
public:
namcona1_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
@ -35,7 +34,7 @@ public:
m_screen(*this, "screen"),
m_palette(*this, "palette"),
m_c140(*this, "c140"),
m_ioport(*this, ioport_tags),
m_muxed_inputs(*this, muxed_inputs),
m_io_p3(*this, "P3"),
m_workram(*this,"workram"),
m_vreg(*this,"vreg"),
@ -52,8 +51,11 @@ public:
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
required_device<c140_device> m_c140;
required_ioport_array<4> m_ioport;
DECLARE_IOPORT_ARRAY(muxed_inputs);
required_ioport_array<4> m_muxed_inputs;
required_ioport m_io_p3;
required_shared_ptr<UINT16> m_workram;
required_shared_ptr<UINT16> m_vreg;
required_shared_ptr<UINT16> m_paletteram;

View File

@ -34,6 +34,8 @@ public:
m_segaic16vid(*this, "segaic16vid"),
m_segaic16road(*this, "segaic16road"),
m_bankmotor_timer(*this, "bankmotor"),
m_digital_ports(*this, digital_ports),
m_adc_ports(*this, "ADC"),
m_workram(*this, "workram"),
m_custom_map(NULL),
m_shangon_video(false),
@ -122,6 +124,11 @@ protected:
required_device<segaic16_road_device> m_segaic16road;
optional_device<timer_device> m_bankmotor_timer;
// input ports
DECLARE_IOPORT_ARRAY(digital_ports);
required_ioport_array<4> m_digital_ports;
optional_ioport_array<8> m_adc_ports;
// memory
required_shared_ptr<UINT16> m_workram;

View File

@ -29,6 +29,8 @@ public:
m_bsprites(*this, "bsprites"),
m_ysprites(*this, "ysprites"),
m_segaic16vid(*this, "segaic16vid"),
m_digital_ports(*this, digital_ports),
m_adc_ports(*this, "ADC"),
m_pdrift_bank(0),
m_scanline_timer(NULL),
m_irq2_scanline(0),
@ -110,6 +112,11 @@ protected:
required_device<sega_yboard_sprite_device> m_ysprites;
required_device<segaic16_video_device> m_segaic16vid;
// input ports
DECLARE_IOPORT_ARRAY(digital_ports);
required_ioport_array<8> m_digital_ports;
optional_ioport_array<6> m_adc_ports;
// configuration
output_delegate m_output_cb1;
output_delegate m_output_cb2;

View File

@ -81,8 +81,6 @@ public:
DECLARE_WRITE16_MEMBER(bigfight_a20000_w);
DECLARE_WRITE16_MEMBER(bigfight_a40000_w);
DECLARE_WRITE16_MEMBER(bigfight_a60000_w);
DECLARE_READ16_MEMBER(cyclwarr_input_r);
DECLARE_READ16_MEMBER(cyclwarr_input2_r);
DECLARE_WRITE16_MEMBER(cyclwarr_sound_w);
DECLARE_READ16_MEMBER(apache3_bank_r);
DECLARE_WRITE16_MEMBER(apache3_bank_w);

View File

@ -14,9 +14,10 @@ public:
m_audio2(*this, "audio2"),
m_dac2(*this, "dac2"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette") { }
m_palette(*this, "palette"),
m_dsw_port(*this, "DSW") { }
int m_dsw;
int m_dsw_sel;
int m_active_8910;
int m_port0a;
int m_acs;
@ -62,4 +63,5 @@ public:
required_device<dac_device> m_dac2;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
required_ioport_array<3> m_dsw_port;
};

View File

@ -10,13 +10,21 @@ class zaxxon_state : public driver_device
public:
zaxxon_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_videoram(*this, "videoram"),
m_spriteram(*this, "spriteram"),
m_colorram(*this, "colorram"),
m_maincpu(*this, "maincpu"),
m_samples(*this, "samples"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette") { }
m_palette(*this, "palette"),
m_dials(*this, "DIAL"),
m_videoram(*this, "videoram"),
m_spriteram(*this, "spriteram"),
m_colorram(*this, "colorram") { }
required_device<cpu_device> m_maincpu;
optional_device<samples_device> m_samples;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
optional_ioport_array<2> m_dials;
required_shared_ptr<UINT8> m_videoram;
optional_shared_ptr<UINT8> m_spriteram;
@ -89,10 +97,6 @@ public:
inline int find_minimum_x(UINT8 value, int flip);
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16 flipxmask, UINT16 flipymask);
void zaxxonj_decode(const char *cputag);
required_device<cpu_device> m_maincpu;
optional_device<samples_device> m_samples;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
};