summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Couriersud <couriersud@users.noreply.github.com>2008-06-02 20:00:25 +0000
committer Couriersud <couriersud@users.noreply.github.com>2008-06-02 20:00:25 +0000
commit9aacf830fb686fce0fbdec7fb4815b06e9f7a13b (patch)
tree323cdd0fede9b5877dd1477aa99094056c4ff36b
parente290212a9d8e084b1b3a560b20a08d2e07947f30 (diff)
Credit Fabio Priuli: Remove port_input_read_indexed in favor of the use of proper tags in a number of drivers
* Checked sprintf calls for sufficient buffer space [couriersud]
-rw-r--r--src/emu/romload.c2
-rw-r--r--src/emu/video.c2
-rw-r--r--src/mame/drivers/8080bw.c2
-rw-r--r--src/mame/drivers/acommand.c8
-rw-r--r--src/mame/drivers/actfancr.c10
-rw-r--r--src/mame/drivers/alpha68k.c2
-rw-r--r--src/mame/drivers/amspdwy.c10
-rw-r--r--src/mame/drivers/angelkds.c24
-rw-r--r--src/mame/drivers/aquarium.c2
-rw-r--r--src/mame/drivers/arabian.c4
-rw-r--r--src/mame/drivers/artmagic.c4
-rw-r--r--src/mame/drivers/asterix.c2
-rw-r--r--src/mame/drivers/astinvad.c4
-rw-r--r--src/mame/drivers/atarig1.c37
-rw-r--r--src/mame/drivers/atarig42.c27
-rw-r--r--src/mame/drivers/atarigx2.c58
-rw-r--r--src/mame/drivers/atarisy1.c86
-rw-r--r--src/mame/drivers/atarisy2.c22
-rw-r--r--src/mame/drivers/attckufo.c8
-rw-r--r--src/mame/drivers/aztarac.c4
-rw-r--r--src/mame/drivers/gbusters.c6
-rw-r--r--src/mame/drivers/neogeo.c2
-rw-r--r--src/mame/drivers/sspeedr.c2
-rw-r--r--src/mame/machine/ajax.c17
-rw-r--r--src/mame/machine/arkanoid.c6
-rw-r--r--src/mame/machine/asteroid.c18
-rw-r--r--src/mame/machine/atarifb.c30
-rw-r--r--src/mame/machine/namcos1.c2
-rw-r--r--src/mame/machine/pckeybrd.c2
-rw-r--r--src/mame/video/aeroboto.c5
-rw-r--r--src/mame/video/fuukifg2.c2
-rw-r--r--src/mame/video/fuukifg3.c2
-rw-r--r--src/mame/video/mitchell.c4
-rw-r--r--src/mame/video/ssv.c2
-rw-r--r--src/mame/video/taitojc.c4
35 files changed, 231 insertions, 191 deletions
diff --git a/src/emu/romload.c b/src/emu/romload.c
index c1a87e5f435..72adb7b3151 100644
--- a/src/emu/romload.c
+++ b/src/emu/romload.c
@@ -198,7 +198,7 @@ static int determine_bios_rom(rom_load_data *romdata, const rom_entry *romp)
{
const char *biosname = ROM_GETHASHDATA(rom);
int bios_flags = ROM_GETBIOSFLAGS(rom);
- char bios_number[3];
+ char bios_number[20];
/* Allow '-bios n' to still be used */
sprintf(bios_number, "%d", bios_flags - 1);
diff --git a/src/emu/video.c b/src/emu/video.c
index 64141e2d248..5beb54bb571 100644
--- a/src/emu/video.c
+++ b/src/emu/video.c
@@ -574,7 +574,6 @@ static void allocate_graphics(running_machine *machine, const gfx_decode_entry *
static void decode_graphics(running_machine *machine, const gfx_decode_entry *gfxdecodeinfo)
{
int totalgfx = 0, curgfx = 0;
- char buffer[200];
int i;
/* count total graphics elements */
@@ -596,6 +595,7 @@ static void decode_graphics(running_machine *machine, const gfx_decode_entry *gf
/* now decode the actual graphics */
for (j = 0; j < gfx->total_elements; j += 1024)
{
+ char buffer[200];
int num_to_decode = (j + 1024 < gfx->total_elements) ? 1024 : (gfx->total_elements - j);
decodegfx(gfx, region_base + gfxdecodeinfo[i].start, j, num_to_decode);
curgfx += num_to_decode;
diff --git a/src/mame/drivers/8080bw.c b/src/mame/drivers/8080bw.c
index a60a0e0dab0..f1faa0c500d 100644
--- a/src/mame/drivers/8080bw.c
+++ b/src/mame/drivers/8080bw.c
@@ -893,7 +893,7 @@ static int sfl_int=0;
static READ8_HANDLER( sfl_input_r )
{
sfl_int^=0x80;//vblank flag ?
- return sfl_int|input_port_read_indexed(machine, 1);
+ return sfl_int|input_port_read(machine, "DSW0");
}
static ADDRESS_MAP_START( sflush_map, ADDRESS_SPACE_PROGRAM, 8 )
diff --git a/src/mame/drivers/acommand.c b/src/mame/drivers/acommand.c
index 67ec7c4b417..33ab3f5f452 100644
--- a/src/mame/drivers/acommand.c
+++ b/src/mame/drivers/acommand.c
@@ -281,7 +281,7 @@ static READ16_HANDLER(ac_devices_r)
---- ---- ---- --x- (Activate Test)
---- ---- ---- ---x (Advance Thru Tests)
*/
- return input_port_read_indexed(machine,0);
+ return input_port_read(machine, "IN0");
case 0x0014/2:
/*
write 0x40,read (~0x08)
@@ -315,7 +315,7 @@ static READ16_HANDLER(ac_devices_r)
xxxx xxxx ---- ---- DIPSW4
---- ---- xxxx xxxx DIPSW3
*/
- return input_port_read_indexed(machine,1);
+ return input_port_read(machine, "IN1");
}
return ac_devram[offset];
}
@@ -375,7 +375,7 @@ static ADDRESS_MAP_START( acommand, ADDRESS_SPACE_PROGRAM, 16 )
ADDRESS_MAP_END
static INPUT_PORTS_START( acommand )
- PORT_START
+ PORT_START_TAG("IN0")
PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x0001, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
@@ -425,7 +425,7 @@ static INPUT_PORTS_START( acommand )
PORT_DIPSETTING( 0x8000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
- PORT_START
+ PORT_START_TAG("IN1")
PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x0001, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
diff --git a/src/mame/drivers/actfancr.c b/src/mame/drivers/actfancr.c
index ae8853d00d6..758c6aafe58 100644
--- a/src/mame/drivers/actfancr.c
+++ b/src/mame/drivers/actfancr.c
@@ -47,16 +47,16 @@ static UINT8 *actfancr_ram;
static READ8_HANDLER( actfan_control_0_r )
{
- return input_port_read_indexed(machine, 2); /* VBL */
+ return input_port_read(machine, "IN2"); /* VBL */
}
static READ8_HANDLER( actfan_control_1_r )
{
switch (offset) {
- case 0: return input_port_read_indexed(machine, 0); /* Player 1 */
- case 1: return input_port_read_indexed(machine, 1); /* Player 2 */
- case 2: return input_port_read_indexed(machine, 3); /* Dip 1 */
- case 3: return input_port_read_indexed(machine, 4); /* Dip 2 */
+ case 0: return input_port_read(machine, "IN0"); /* Player 1 */
+ case 1: return input_port_read(machine, "IN1"); /* Player 2 */
+ case 2: return input_port_read(machine, "DSW1"); /* Dip 1 */
+ case 3: return input_port_read(machine, "DSW2"); /* Dip 2 */
}
return 0xff;
}
diff --git a/src/mame/drivers/alpha68k.c b/src/mame/drivers/alpha68k.c
index 9e1d56a169a..1179175140d 100644
--- a/src/mame/drivers/alpha68k.c
+++ b/src/mame/drivers/alpha68k.c
@@ -273,7 +273,7 @@ static READ16_HANDLER( control_1_r )
if (invert_controls)
return ~(input_port_read(machine, "IN0") + (input_port_read(machine, "IN1") << 8));
- return (input_port_read_indexed(machine, 0) + (input_port_read_indexed(machine, 1) << 8));
+ return (input_port_read(machine, "IN0") + (input_port_read(machine, "IN1") << 8));
}
static READ16_HANDLER( control_2_r )
diff --git a/src/mame/drivers/amspdwy.c b/src/mame/drivers/amspdwy.c
index 83d15e09ad1..32495e6822d 100644
--- a/src/mame/drivers/amspdwy.c
+++ b/src/mame/drivers/amspdwy.c
@@ -46,7 +46,10 @@ VIDEO_UPDATE( amspdwy );
static READ8_HANDLER( amspdwy_wheel_##_n_##_r ) \
{ \
static UINT8 wheel_old, ret; \
- UINT8 wheel = input_port_read_indexed(machine, 5 + _n_); \
+ char port1[4], port2[4]; \
+ UINT8 wheel; \
+ sprintf(port1, "IN%d", 5 + _n_); \
+ wheel = input_port_read(machine, port1); \
if (wheel != wheel_old) \
{ \
wheel = (wheel & 0x7fff) - (wheel & 0x8000); \
@@ -54,7 +57,8 @@ static READ8_HANDLER( amspdwy_wheel_##_n_##_r ) \
else ret = ((-wheel) & 0xf) | 0x10; \
wheel_old = wheel; \
} \
- return ret | input_port_read_indexed(machine, 2 + _n_); \
+ sprintf(port2, "IN%d", 2 + _n_); \
+ return ret | input_port_read(machine, port2); \
}
AMSPDWY_WHEEL_R( 0 )
AMSPDWY_WHEEL_R( 1 )
@@ -62,7 +66,7 @@ AMSPDWY_WHEEL_R( 1 )
static READ8_HANDLER( amspdwy_sound_r )
{
- return (YM2151_status_port_0_r(machine,0) & ~ 0x30) | input_port_read_indexed(machine, 4);
+ return (YM2151_status_port_0_r(machine,0) & ~ 0x30) | input_port_read(machine, "IN4");
}
static WRITE8_HANDLER( amspdwy_sound_w )
diff --git a/src/mame/drivers/angelkds.c b/src/mame/drivers/angelkds.c
index 0af561271fd..f71b370af73 100644
--- a/src/mame/drivers/angelkds.c
+++ b/src/mame/drivers/angelkds.c
@@ -180,16 +180,24 @@ these make the game a bit easier for testing purposes
static READ8_HANDLER( angelkds_input_r )
{
- int fake = input_port_read_indexed(machine, 6+offset);
-
- return ((fake & 0x01) ? fake : input_port_read_indexed(machine, 4+offset));
+ int fake;
+ char port1[4], port2[6];
+
+ sprintf(port1, "I8%d", 1 + offset);
+ sprintf(port2, "FAKE%d", 1 + offset);
+ fake = input_port_read(machine, port2);
+
+ return ((fake & 0x01) ? fake : input_port_read(machine, port1));
}
#else
static READ8_HANDLER( angelkds_input_r )
{
- return input_port_read_indexed(machine, 4+offset);
+ char port[4];
+
+ sprintf(port, "I8%d", 1 + offset);
+ return input_port_read(machine, port);
}
#endif
@@ -235,10 +243,10 @@ static ADDRESS_MAP_START( main_portmap, ADDRESS_SPACE_IO, 8 )
AM_RANGE(0x00, 0x00) AM_WRITE(SMH_NOP) // 00 on start-up, not again
AM_RANGE(0x42, 0x42) AM_WRITE(angelkds_cpu_bank_write)
AM_RANGE(0x43, 0x43) AM_WRITE(SMH_NOP) // 9a on start-up, not again
- AM_RANGE(0x40, 0x40) AM_READ(input_port_0_r) /* "Coinage" Dip Switches */
- AM_RANGE(0x41, 0x41) AM_READ(input_port_1_r) /* Other Dip Switches */
- AM_RANGE(0x42, 0x42) AM_READ(input_port_2_r) /* Players inputs (not needed ?) */
- AM_RANGE(0x80, 0x80) AM_READ(input_port_3_r) /* System inputs */
+ AM_RANGE(0x40, 0x40) AM_READ_PORT("I40") /* "Coinage" Dip Switches */
+ AM_RANGE(0x41, 0x41) AM_READ_PORT("I41") /* Other Dip Switches */
+ AM_RANGE(0x42, 0x42) AM_READ_PORT("I42") /* Players inputs (not needed ?) */
+ AM_RANGE(0x80, 0x80) AM_READ_PORT("I80") /* System inputs */
AM_RANGE(0x81, 0x82) AM_READ(angelkds_input_r) /* Players inputs */
AM_RANGE(0x83, 0x83) AM_WRITE(SMH_NOP) // 9b on start-up, not again
AM_RANGE(0xc0, 0xc3) AM_READWRITE(angelkds_main_sound_r, angelkds_main_sound_w) // 02 various points
diff --git a/src/mame/drivers/aquarium.c b/src/mame/drivers/aquarium.c
index 3eb70cb325a..511faa3a481 100644
--- a/src/mame/drivers/aquarium.c
+++ b/src/mame/drivers/aquarium.c
@@ -86,7 +86,7 @@ static MACHINE_RESET( aquarium )
static READ16_HANDLER( aquarium_coins_r )
{
int data;
- data = (input_port_read_indexed(machine,2) & 0x7fff); /* IN1 */
+ data = (input_port_read(machine, "IN1") & 0x7fff);
data |= aquarium_snd_ack;
aquarium_snd_ack = 0;
return data;
diff --git a/src/mame/drivers/arabian.c b/src/mame/drivers/arabian.c
index 71f4556cef5..f7e1bd2393c 100644
--- a/src/mame/drivers/arabian.c
+++ b/src/mame/drivers/arabian.c
@@ -133,6 +133,7 @@ static READ8_HANDLER( custom_cpu_r )
/* alternate CPU's RAM space while the CPU is running. If the CPU is not */
/* running (i.e., the /SRES line is low), it needs to look like RAM to pass */
/* the self-tests */
+ char port[5];
/* if the CPU reset line is being held down, just return RAM */
if (custom_cpu_reset)
@@ -148,7 +149,8 @@ static READ8_HANDLER( custom_cpu_r )
case 3:
case 4:
case 5:
- return input_port_read_indexed(machine, 2 + offset);
+ sprintf(port, "COM%d", offset);
+ return input_port_read(machine, port);
/* busy flag; this is polled to check the custom CPU's readiness */
/* we just toggle it on and off until the main CPU gets the result */
diff --git a/src/mame/drivers/artmagic.c b/src/mame/drivers/artmagic.c
index ac0899192f7..b168a97897e 100644
--- a/src/mame/drivers/artmagic.c
+++ b/src/mame/drivers/artmagic.c
@@ -148,7 +148,7 @@ static READ16_HANDLER( ultennis_hack_r )
hack_irq = 0;
update_irq_state(machine);
}
- return input_port_read_indexed(machine, 0);
+ return input_port_read(machine, "300000");
}
@@ -378,7 +378,7 @@ static void stonebal_protection(running_machine *machine)
static READ16_HANDLER( special_port5_r )
{
- return input_port_read_indexed(machine, 5) | prot_output_bit;
+ return input_port_read(machine, "300008") | prot_output_bit;
}
diff --git a/src/mame/drivers/asterix.c b/src/mame/drivers/asterix.c
index baa47cffe05..291c160f5df 100644
--- a/src/mame/drivers/asterix.c
+++ b/src/mame/drivers/asterix.c
@@ -67,7 +67,7 @@ static READ16_HANDLER( control1_r )
/* bit 8 is EEPROM data */
/* bit 9 is EEPROM ready */
/* bit 10 is service button */
- res = (eeprom_read_bit()<<8) | input_port_read_indexed(machine,1);
+ res = (eeprom_read_bit()<<8) | input_port_read(machine, "IN1");
if (init_eeprom_count)
{
diff --git a/src/mame/drivers/astinvad.c b/src/mame/drivers/astinvad.c
index 6d7cedad01d..1b6f7717e40 100644
--- a/src/mame/drivers/astinvad.c
+++ b/src/mame/drivers/astinvad.c
@@ -280,7 +280,7 @@ static WRITE8_HANDLER( astinvad_sound2_w )
if (bits_gone_hi & 0x08) sample_start(5, SND_FLEET4, 0);
if (bits_gone_hi & 0x10) sample_start(4, SND_UFOHIT, 0);
- screen_flip = (input_port_read_indexed(machine, 3) & data & 0x20) ? 0xff : 0x00;
+ screen_flip = (input_port_read(machine, "IN3") & data & 0x20) ? 0xff : 0x00;
}
@@ -311,7 +311,7 @@ static WRITE8_HANDLER( spaceint_sound2_w )
if (bits_gone_hi & 0x04) sample_start(3, SND_INVADERHIT, 0);
- screen_flip = (input_port_read_indexed(machine, 3) & data & 0x80) ? 0xff : 0x00;
+ screen_flip = (input_port_read(machine, "IN3") & data & 0x80) ? 0xff : 0x00;
}
diff --git a/src/mame/drivers/atarig1.c b/src/mame/drivers/atarig1.c
index 86e2c99507b..af10d08535a 100644
--- a/src/mame/drivers/atarig1.c
+++ b/src/mame/drivers/atarig1.c
@@ -110,7 +110,7 @@ static WRITE16_HANDLER( mo_command_w )
static READ16_HANDLER( special_port0_r )
{
- int temp = input_port_read_indexed(machine, 0);
+ int temp = input_port_read(machine, "IN0");
if (atarigen_cpu_to_sound_ready) temp ^= 0x1000;
temp ^= 0x2000; /* A2DOK always high for now */
return temp;
@@ -125,14 +125,19 @@ static WRITE16_HANDLER( a2d_select_w )
static READ16_HANDLER( a2d_data_r )
{
+ char port[5];
+
/* Pit Fighter has no A2D, just another input port */
if (atarig1_pitfight)
- return input_port_read_indexed(machine, 1);
+ return input_port_read(machine, "ADC0");
/* otherwise, assume it's hydra */
if (which_input < 3)
- return input_port_read_indexed(machine, 1 + which_input) << 8;
-
+ {
+ sprintf(port, "ADC%d", which_input);
+ return input_port_read(machine, port) << 8;
+ }
+
return 0;
}
@@ -250,7 +255,7 @@ ADDRESS_MAP_END
*************************************/
static INPUT_PORTS_START( hydra )
- PORT_START /* fc0000 */
+ PORT_START_TAG("IN0") /* fc0000 */
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON5 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON2 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON6 )
@@ -262,15 +267,15 @@ static INPUT_PORTS_START( hydra )
PORT_SERVICE( 0x4000, IP_ACTIVE_LOW )
PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_VBLANK )
- PORT_START /* ADC 0 @ fc8000 */
+ PORT_START_TAG("ADC0") /* ADC 0 @ fc8000 */
PORT_BIT( 0x00ff, 0x0080, IPT_AD_STICK_X ) PORT_SENSITIVITY(50) PORT_KEYDELTA(10)
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START /* ADC 1 @ fc8000 */
+ PORT_START_TAG("ADC1") /* ADC 1 @ fc8000 */
PORT_BIT( 0x00ff, 0x0080, IPT_AD_STICK_Y ) PORT_SENSITIVITY(70) PORT_KEYDELTA(10)
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START /* ADC 2 @ fc8000 */
+ PORT_START_TAG("ADC2") /* ADC 2 @ fc8000 */
PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(16)
JSA_II_PORT /* audio board port */
@@ -280,7 +285,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( pitfight )
- PORT_START /* fc0000 */
+ PORT_START_TAG("IN0") /* fc0000 */
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
@@ -295,7 +300,7 @@ static INPUT_PORTS_START( pitfight )
PORT_SERVICE( 0x4000, IP_ACTIVE_LOW )
PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_VBLANK )
- PORT_START /* fc8000 */
+ PORT_START_TAG("ADC0") /* fc8000 */
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3)
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(3)
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3)
@@ -315,10 +320,10 @@ static INPUT_PORTS_START( pitfight )
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START /* not used */
+ PORT_START_TAG("ADC1") /* not used */
PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START /* not used */
+ PORT_START_TAG("ADC2") /* not used */
PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNUSED )
JSA_II_PORT /* audio board port */
@@ -328,7 +333,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( pitfighj )
- PORT_START /* fc0000 */
+ PORT_START_TAG("IN0") /* fc0000 */
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
@@ -343,7 +348,7 @@ static INPUT_PORTS_START( pitfighj )
PORT_SERVICE( 0x4000, IP_ACTIVE_LOW )
PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_VBLANK )
- PORT_START /* fc8000 */
+ PORT_START_TAG("ADC0") /* fc8000 */
PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
@@ -355,10 +360,10 @@ static INPUT_PORTS_START( pitfighj )
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START /* not used */
+ PORT_START_TAG("ADC1") /* not used */
PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START /* not used */
+ PORT_START_TAG("ADC2") /* not used */
PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNUSED )
JSA_II_PORT /* audio board port */
diff --git a/src/mame/drivers/atarig42.c b/src/mame/drivers/atarig42.c
index 87bdd990399..54f1c85f580 100644
--- a/src/mame/drivers/atarig42.c
+++ b/src/mame/drivers/atarig42.c
@@ -83,7 +83,7 @@ static MACHINE_RESET( atarig42 )
static READ16_HANDLER( special_port2_r )
{
- int temp = input_port_read_indexed(machine, 2);
+ int temp = input_port_read(machine, "IN2");
if (atarigen_cpu_to_sound_ready) temp ^= 0x0020;
if (atarigen_sound_to_cpu_ready) temp ^= 0x0010;
temp ^= 0x0008; /* A2D.EOC always high for now */
@@ -93,7 +93,10 @@ static READ16_HANDLER( special_port2_r )
static WRITE16_HANDLER( a2d_select_w )
{
- analog_data = input_port_read_indexed(machine, 4 + (offset != 0));
+ char port[5];
+
+ sprintf(port, "A2D%d", (offset != 0));
+ analog_data = input_port_read(machine, port);
}
@@ -381,17 +384,17 @@ ADDRESS_MAP_END
*************************************/
static INPUT_PORTS_START( roadriot )
- PORT_START /* e00000 */
+ PORT_START_TAG("IN0") /* e00000 */
PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
PORT_BIT( 0xf800, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START /* e00002 */
+ PORT_START_TAG("IN1") /* e00002 */
PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START /* e00010 */
+ PORT_START_TAG("IN2") /* e00010 */
PORT_BIT( 0x003f, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_VBLANK )
@@ -399,16 +402,16 @@ static INPUT_PORTS_START( roadriot )
JSA_III_PORT /* audio board port */
- PORT_START /* analog 0 */
+ PORT_START_TAG("A2D0") /* analog 0 */
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(50) PORT_KEYDELTA(10)
- PORT_START /* analog 1 */
+ PORT_START_TAG("A2D1") /* analog 1 */
PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(16)
INPUT_PORTS_END
static INPUT_PORTS_START( guardian )
- PORT_START /* e00000 */
+ PORT_START_TAG("IN0") /* e00000 */
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(3)
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
@@ -426,7 +429,7 @@ static INPUT_PORTS_START( guardian )
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
- PORT_START /* e00002 */
+ PORT_START_TAG("IN1") /* e00002 */
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
@@ -442,7 +445,7 @@ static INPUT_PORTS_START( guardian )
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
- PORT_START /* e00010 */
+ PORT_START_TAG("IN2") /* e00010 */
PORT_BIT( 0x003f, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_VBLANK )
@@ -450,10 +453,10 @@ static INPUT_PORTS_START( guardian )
JSA_III_PORT /* audio board port */
- PORT_START /* analog 0 */
+ PORT_START_TAG("A2D0") /* analog 0 */
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START /* analog 1 */
+ PORT_START_TAG("A2D1") /* analog 1 */
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
INPUT_PORTS_END
diff --git a/src/mame/drivers/atarigx2.c b/src/mame/drivers/atarigx2.c
index 62cb675f5f8..dc3f5d5e6d2 100644
--- a/src/mame/drivers/atarigx2.c
+++ b/src/mame/drivers/atarigx2.c
@@ -81,7 +81,7 @@ static MACHINE_RESET( atarigx2 )
static READ32_HANDLER( special_port2_r )
{
- int temp = input_port_read_indexed(machine, 2);
+ int temp = input_port_read(machine, "IN2");
if (atarigen_cpu_to_sound_ready) temp ^= 0x0020;
if (atarigen_sound_to_cpu_ready) temp ^= 0x0010;
temp ^= 0x0008; /* A2D.EOC always high for now */
@@ -91,7 +91,7 @@ static READ32_HANDLER( special_port2_r )
static READ32_HANDLER( special_port3_r )
{
- int temp = input_port_read_indexed(machine, 3);
+ int temp = input_port_read(machine, "IN3");
return (temp << 16) | temp;
}
@@ -111,9 +111,9 @@ static READ32_HANDLER( a2d_data_r )
switch (offset)
{
case 0:
- return (input_port_read_indexed(machine, 5) << 24) | (input_port_read_indexed(machine, 6) << 8);
+ return (input_port_read(machine, "A2D0") << 24) | (input_port_read(machine, "A2D1") << 8);
case 1:
- return (input_port_read_indexed(machine, 7) << 24) | (input_port_read_indexed(machine, 8) << 8);
+ return (input_port_read(machine, "A2D2") << 24) | (input_port_read(machine, "A2D3") << 8);
}
return 0;
@@ -1169,7 +1169,7 @@ static READ32_HANDLER( atarigx2_protection_r )
static READ32_HANDLER( inputs_01_r )
{
- return (input_port_read_indexed(machine, 0) << 16) | input_port_read_indexed(machine, 1);
+ return (input_port_read(machine, "IN0") << 16) | input_port_read(machine, "IN1");
}
@@ -1215,7 +1215,7 @@ ADDRESS_MAP_END
*************************************/
static INPUT_PORTS_START( spclords )
- PORT_START /* 68.SW (A1=0) */
+ PORT_START_TAG("IN0") /* 68.SW (A1=0) */
PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 ) /* BLUE button */
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) /* Left thumb */
@@ -1226,7 +1226,7 @@ static INPUT_PORTS_START( spclords )
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) /* Throttle button */
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
- PORT_START /* 68.SW (A1=1) */
+ PORT_START_TAG("IN1") /* 68.SW (A1=1) */
PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START2 ) /* RED button */
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) /* Right thumb */
@@ -1237,7 +1237,7 @@ static INPUT_PORTS_START( spclords )
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
- PORT_START /* 68.STATUS (A2=0) */
+ PORT_START_TAG("IN2") /* 68.STATUS (A2=0) */
PORT_BIT( 0x0007, IP_ACTIVE_LOW, IPT_SPECIAL ) /* +5V */
PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* A2D.EOC */
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SPECIAL ) /* /AUDIRQ */
@@ -1246,7 +1246,7 @@ static INPUT_PORTS_START( spclords )
PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_VBLANK )
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START /* 68.STATUS (A2=1) */
+ PORT_START_TAG("IN3") /* 68.STATUS (A2=1) */
PORT_BIT( 0x0003, IP_ACTIVE_LOW, IPT_SPECIAL ) /* +5V */
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SPECIAL ) /* /XIRQ */
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_SPECIAL ) /* /XFULL */
@@ -1257,26 +1257,26 @@ static INPUT_PORTS_START( spclords )
JSA_III_PORT /* audio board port */
- PORT_START /* A2D @ 0xD00000 */
+ PORT_START_TAG("A2D0") /* A2D @ 0xD00000 */
PORT_BIT ( 0x00ff, 0x0080, IPT_AD_STICK_X ) PORT_MINMAX(0x10,0xf0) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_PLAYER(1)
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START /* A2D @ 0xD00002 */
+ PORT_START_TAG("A2D1") /* A2D @ 0xD00002 */
PORT_BIT ( 0x00ff, 0x0080, IPT_AD_STICK_Y ) PORT_MINMAX(0x10,0xf0) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_PLAYER(1)
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START /* A2D @ 0xD00004 */
+ PORT_START_TAG("A2D2") /* A2D @ 0xD00004 */
PORT_BIT ( 0x00ff, 0x0080, IPT_AD_STICK_X ) PORT_MINMAX(0x10,0xf0) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_PLAYER(2)
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START /* A2D @ 0xD00006 */
+ PORT_START_TAG("A2D3") /* A2D @ 0xD00006 */
PORT_BIT ( 0x00ff, 0x0080, IPT_AD_STICK_Y ) PORT_MINMAX(0x10,0xf0) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_PLAYER(2)
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
INPUT_PORTS_END
static INPUT_PORTS_START( motofren )
- PORT_START /* 68.SW (A1=0) */
+ PORT_START_TAG("IN0") /* 68.SW (A1=0) */
PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 ) /* Start/fire */
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) /* AUX3 */
@@ -1284,10 +1284,10 @@ static INPUT_PORTS_START( motofren )
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) /* AUX1 */
PORT_BIT( 0xf000, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START /* 68.SW (A1=1) */
+ PORT_START_TAG("IN1") /* 68.SW (A1=1) */
PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START /* 68.STATUS (A2=0) */
+ PORT_START_TAG("IN2") /* 68.STATUS (A2=0) */
PORT_BIT( 0x0007, IP_ACTIVE_LOW, IPT_UNUSED ) /* +5V */
PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* A2D.EOC */
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SPECIAL ) /* /AUDIRQ */
@@ -1296,7 +1296,7 @@ static INPUT_PORTS_START( motofren )
PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_VBLANK )
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START /* 68.STATUS (A2=1) */
+ PORT_START_TAG("IN3") /* 68.STATUS (A2=1) */
PORT_BIT( 0x0003, IP_ACTIVE_LOW, IPT_SPECIAL ) /* +5V */
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SPECIAL ) /* /XIRQ */
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_SPECIAL ) /* /XFULL */
@@ -1307,22 +1307,22 @@ static INPUT_PORTS_START( motofren )
JSA_III_PORT /* audio board port */
- PORT_START /* A2D @ 0xD00000 */
+ PORT_START_TAG("A2D0") /* A2D @ 0xD00000 */
PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(16)
- PORT_START /* A2D @ 0xD00002 */
+ PORT_START_TAG("A2D1") /* A2D @ 0xD00002 */
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START /* A2D @ 0xD00004 */
+ PORT_START_TAG("A2D2") /* A2D @ 0xD00004 */
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(50) PORT_KEYDELTA(10)
- PORT_START /* A2D @ 0xD00006 */
+ PORT_START_TAG("A2D3") /* A2D @ 0xD00006 */
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
INPUT_PORTS_END
static INPUT_PORTS_START( rrreveng )
- PORT_START /* 68.SW (A1=0) */
+ PORT_START_TAG("IN0") /* 68.SW (A1=0) */
PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
@@ -1332,12 +1332,12 @@ static INPUT_PORTS_START( rrreveng )
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START /* 68.SW (A1=1) */
+ PORT_START_TAG("IN1") /* 68.SW (A1=1) */
PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0xfe00, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START /* 68.STATUS (A2=0) */
+ PORT_START_TAG("IN2") /* 68.STATUS (A2=0) */
PORT_BIT( 0x0007, IP_ACTIVE_LOW, IPT_SPECIAL ) /* +5V */
PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* A2D.EOC */
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SPECIAL ) /* /AUDIRQ */
@@ -1346,7 +1346,7 @@ static INPUT_PORTS_START( rrreveng )
PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_VBLANK )
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START /* 68.STATUS (A2=1) */
+ PORT_START_TAG("IN3") /* 68.STATUS (A2=1) */
PORT_BIT( 0x0003, IP_ACTIVE_LOW, IPT_SPECIAL ) /* +5V */
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SPECIAL ) /* /XIRQ */
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_SPECIAL ) /* /XFULL */
@@ -1357,18 +1357,18 @@ static INPUT_PORTS_START( rrreveng )
JSA_III_PORT /* audio board port */
- PORT_START /* A2D @ 0xD00000 */
+ PORT_START_TAG("A2D0") /* A2D @ 0xD00000 */
PORT_BIT ( 0x00ff, 0x0010, IPT_PEDAL ) PORT_MINMAX(0x10,0xf0) PORT_SENSITIVITY(100) PORT_KEYDELTA(10)
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START /* A2D @ 0xD00002 */
+ PORT_START_TAG("A2D1") /* A2D @ 0xD00002 */
PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START /* A2D @ 0xD00004 */
+ PORT_START_TAG("A2D2") /* A2D @ 0xD00004 */
PORT_BIT ( 0x00ff, 0x0080, IPT_PADDLE ) PORT_MINMAX(0x10,0xf0) PORT_SENSITIVITY(100) PORT_KEYDELTA(10)
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START /* A2D @ 0xD00006 */
+ PORT_START_TAG("A2D3") /* A2D @ 0xD00006 */
PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNUSED )
INPUT_PORTS_END
diff --git a/src/mame/drivers/atarisy1.c b/src/mame/drivers/atarisy1.c
index c3ea54444a2..661aba96a6d 100644
--- a/src/mame/drivers/atarisy1.c
+++ b/src/mame/drivers/atarisy1.c
@@ -211,18 +211,22 @@ static TIMER_CALLBACK( delayed_joystick_int )
static READ16_HANDLER( joystick_r )
{
int newval = 0xff;
+ char port[4];
/* digital joystick type */
if (joystick_type == 1)
- newval = (input_port_read_indexed(machine, 0) & (0x80 >> offset)) ? 0xf0 : 0x00;
+ newval = (input_port_read(machine, "IN0") & (0x80 >> offset)) ? 0xf0 : 0x00;
/* Hall-effect analog joystick */
else if (joystick_type == 2)
- newval = input_port_read_indexed(machine, offset & 1);
+ {
+ sprintf(port, "IN%d", offset & 1);
+ newval = input_port_read(machine, port);
+ }
/* Road Blasters gas pedal */
else if (joystick_type == 3)
- newval = input_port_read_indexed(machine, 1);
+ newval = input_port_read(machine, "IN1");
/* the A4 bit enables/disables joystick IRQs */
joystick_int_enable = ((offset >> 3) & 1) ^ 1;
@@ -268,13 +272,13 @@ static READ16_HANDLER( trakball_r )
if (player == 0)
{
- posx = (INT8)input_port_read_indexed(machine, 0);
- posy = (INT8)input_port_read_indexed(machine, 1);
+ posx = (INT8)input_port_read(machine, "IN0");
+ posy = (INT8)input_port_read(machine, "IN1");
}
else
{
- posx = (INT8)input_port_read_indexed(machine, 2);
- posy = (INT8)input_port_read_indexed(machine, 3);
+ posx = (INT8)input_port_read(machine, "IN2");
+ posy = (INT8)input_port_read(machine, "IN3");
}
cur[player][0] = posx + posy;
@@ -286,7 +290,7 @@ static READ16_HANDLER( trakball_r )
/* Road Blasters steering wheel */
else if (trackball_type == 2)
- result = input_port_read_indexed(machine, 0);
+ result = input_port_read(machine, "IN0");
return result;
}
@@ -301,7 +305,7 @@ static READ16_HANDLER( trakball_r )
static READ16_HANDLER( port4_r )
{
- int temp = input_port_read_indexed(machine, 4);
+ int temp = input_port_read(machine, "F60000");
if (atarigen_cpu_to_sound_ready) temp ^= 0x0080;
return temp;
}
@@ -316,11 +320,11 @@ static READ16_HANDLER( port4_r )
static READ8_HANDLER( switch_6502_r )
{
- int temp = input_port_read_indexed(machine, 5);
+ int temp = input_port_read(machine, "1820");
if (atarigen_cpu_to_sound_ready) temp ^= 0x08;
if (atarigen_sound_to_cpu_ready) temp ^= 0x10;
- if (!(input_port_read_indexed(machine, 4) & 0x0040)) temp ^= 0x80;
+ if (!(input_port_read(machine, "F60000") & 0x0040)) temp ^= 0x80;
return temp;
}
@@ -470,19 +474,19 @@ ADDRESS_MAP_END
*************************************/
static INPUT_PORTS_START( marble )
- PORT_START /* F20000 */
+ PORT_START_TAG("IN0") /* F20000 */
PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(30) PORT_KEYDELTA(30) PORT_REVERSE PORT_PLAYER(1)
- PORT_START /* F20002 */
+ PORT_START_TAG("IN1") /* F20002 */
PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(30) PORT_KEYDELTA(30) PORT_PLAYER(1)
- PORT_START /* F20004 */
+ PORT_START_TAG("IN2") /* F20004 */
PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(30) PORT_KEYDELTA(30) PORT_REVERSE PORT_PLAYER(2)
- PORT_START /* F20006 */
+ PORT_START_TAG("IN3") /* F20006 */
PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(30) PORT_KEYDELTA(30) PORT_PLAYER(2)
- PORT_START /* F60000 */
+ PORT_START_TAG("F60000") /* F60000 */
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -493,7 +497,7 @@ static INPUT_PORTS_START( marble )
PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL )
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START /* 1820 (sound) */
+ PORT_START_TAG("1820") /* 1820 (sound) */
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
@@ -505,23 +509,23 @@ INPUT_PORTS_END
static INPUT_PORTS_START( peterpak )
- PORT_START /* F40000 */
+ PORT_START_TAG("IN0") /* F40000 */
PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
- PORT_START /* n/a */
+ PORT_START_TAG("IN1") /* n/a */
PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
- PORT_START /* n/a */
+ PORT_START_TAG("IN2") /* n/a */
PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
- PORT_START /* n/a */
+ PORT_START_TAG("IN3") /* n/a */
PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
- PORT_START /* F60000 */
+ PORT_START_TAG("F60000") /* F60000 */
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 )
@@ -533,7 +537,7 @@ static INPUT_PORTS_START( peterpak )
PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL )
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START /* 1820 (sound) */
+ PORT_START_TAG("1820") /* 1820 (sound) */
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
@@ -545,23 +549,23 @@ INPUT_PORTS_END
static INPUT_PORTS_START( indytemp )
- PORT_START /* F40000 */
+ PORT_START_TAG("IN0") /* F40000 */
PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
- PORT_START /* n/a */
+ PORT_START_TAG("IN1") /* n/a */
PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
- PORT_START /* n/a */
+ PORT_START_TAG("IN2") /* n/a */
PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
- PORT_START /* n/a */
+ PORT_START_TAG("IN3") /* n/a */
PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
- PORT_START /* F60000 */
+ PORT_START_TAG("F60000") /* F60000 */
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 )
@@ -573,7 +577,7 @@ static INPUT_PORTS_START( indytemp )
PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL )
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START /* 1820 (sound) */
+ PORT_START_TAG("1820") /* 1820 (sound) */
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
@@ -585,19 +589,19 @@ INPUT_PORTS_END
static INPUT_PORTS_START( roadrunn )
- PORT_START /* F40000 */
+ PORT_START_TAG("IN0") /* F40000 */
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_MINMAX(0x10,0xf0) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_PLAYER(1)
- PORT_START /* F40002 */
+ PORT_START_TAG("IN1") /* F40002 */
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_MINMAX(0x10,0xf0) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_REVERSE PORT_PLAYER(1)
- PORT_START /* n/a */
+ PORT_START_TAG("IN2") /* n/a */
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START /* n/a */
+ PORT_START_TAG("IN3") /* n/a */
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START /* F60000 */
+ PORT_START_TAG("F60000") /* F60000 */
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 )
@@ -609,7 +613,7 @@ static INPUT_PORTS_START( roadrunn )
PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL )
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START /* 1820 (sound) */
+ PORT_START_TAG("1820") /* 1820 (sound) */
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
@@ -621,19 +625,19 @@ INPUT_PORTS_END
static INPUT_PORTS_START( roadblst )
- PORT_START /* F20000 */
+ PORT_START_TAG("IN0") /* F20000 */
PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_REVERSE
- PORT_START /* F40000 */
+ PORT_START_TAG("IN1") /* F40000 */
PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(64)
- PORT_START /* n/a */
+ PORT_START_TAG("IN2") /* n/a */
PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
- PORT_START /* n/a */
+ PORT_START_TAG("IN3") /* n/a */
PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
- PORT_START /* F60000 */
+ PORT_START_TAG("F60000") /* F60000 */
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON3 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON2 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -644,7 +648,7 @@ static INPUT_PORTS_START( roadblst )
PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL )
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START /* 1820 (sound) */
+ PORT_START_TAG("1820") /* 1820 (sound) */
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
diff --git a/src/mame/drivers/atarisy2.c b/src/mame/drivers/atarisy2.c
index 8ad3e459079..1d74d506bdc 100644
--- a/src/mame/drivers/atarisy2.c
+++ b/src/mame/drivers/atarisy2.c
@@ -374,7 +374,7 @@ static STATE_POSTLOAD( bankselect_postload )
static READ16_HANDLER( switch_r )
{
- int result = input_port_read_indexed(machine, 1) | (input_port_read_indexed(machine, 2) << 8);
+ int result = input_port_read(machine, "1800") | (input_port_read(machine, "1801") << 8);
if (atarigen_cpu_to_sound_ready) result ^= 0x20;
if (atarigen_sound_to_cpu_ready) result ^= 0x10;
@@ -385,12 +385,12 @@ static READ16_HANDLER( switch_r )
static READ8_HANDLER( switch_6502_r )
{
- int result = input_port_read_indexed(machine, 0);
+ int result = input_port_read(machine, "1840");
if (atarigen_cpu_to_sound_ready) result ^= 0x01;
if (atarigen_sound_to_cpu_ready) result ^= 0x02;
if (!has_tms5220 || tms5220_ready_r()) result ^= 0x04;
- if (!(input_port_read_indexed(machine, 2) & 0x80)) result ^= 0x10;
+ if (!(input_port_read(machine, "1801") & 0x80)) result ^= 0x10;
return result;
}
@@ -423,15 +423,20 @@ static WRITE16_HANDLER( adc_strobe_w )
static READ16_HANDLER( adc_r )
{
+ char port[5];
+
+ sprintf(port, "ADC%d", which_adc);
if (which_adc < pedal_count)
- return ~input_port_read_indexed(machine, 3 + which_adc);
+ return ~input_port_read(machine, port);
- return input_port_read_indexed(machine, 3 + which_adc) | 0xff00;
+ return input_port_read(machine, port) | 0xff00;
}
static READ8_HANDLER( leta_r )
{
+ char port[6];
+
if (pedal_count == -1) /* 720 */
{
/* special thanks to MAME Analog+ for the mapping code */
@@ -443,8 +448,8 @@ static READ8_HANDLER( leta_r )
static double last_angle;
static int rotations;
- int analogx = input_port_read_indexed(machine, 7) - 128;
- int analogy = input_port_read_indexed(machine, 8) - 128;
+ int analogx = input_port_read(machine, "LETA0") - 128;
+ int analogy = input_port_read(machine, "LETA1") - 128;
double angle;
/* if the joystick is centered, leave the rest of this alone */
@@ -480,7 +485,8 @@ static READ8_HANDLER( leta_r )
}
}
- return input_port_read_indexed(machine, 7 + (offset & 3));
+ sprintf(port, "LETA%d", (offset & 3));
+ return input_port_read(machine, port);
}
diff --git a/src/mame/drivers/attckufo.c b/src/mame/drivers/attckufo.c
index e243d5dd2cd..6ab5d98802a 100644
--- a/src/mame/drivers/attckufo.c
+++ b/src/mame/drivers/attckufo.c
@@ -64,8 +64,8 @@ static READ8_HANDLER(attckufo_io_r)
{
switch(offset)
{
- case 0: return input_port_read_indexed(machine, 0);
- case 2: return input_port_read_indexed(machine, 1);
+ case 0: return input_port_read(machine, "DSW");
+ case 2: return input_port_read(machine, "INPUT");
}
return 0xff;
}
@@ -92,7 +92,7 @@ static ADDRESS_MAP_START( cpu_map, ADDRESS_SPACE_PROGRAM, 8 )
ADDRESS_MAP_END
static INPUT_PORTS_START( attckufo )
- PORT_START
+ PORT_START_TAG("DSW")
PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )
PORT_DIPSETTING( 0x00, "3" )
PORT_DIPSETTING( 0x01, "4" )
@@ -115,7 +115,7 @@ static INPUT_PORTS_START( attckufo )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
- PORT_START
+ PORT_START_TAG("INPUT")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(1)
diff --git a/src/mame/drivers/aztarac.c b/src/mame/drivers/aztarac.c
index 4388a70618f..8e97e8301f4 100644
--- a/src/mame/drivers/aztarac.c
+++ b/src/mame/drivers/aztarac.c
@@ -60,8 +60,8 @@ static READ16_HANDLER( nvram_r )
static READ16_HANDLER( joystick_r )
{
- return (((input_port_read_indexed(machine, 0) - 0xf) << 8) |
- ((input_port_read_indexed(machine, 1) - 0xf) & 0xff));
+ return (((input_port_read(machine, "IN0") - 0xf) << 8) |
+ ((input_port_read(machine, "IN1") - 0xf) & 0xff));
}
diff --git a/src/mame/drivers/gbusters.c b/src/mame/drivers/gbusters.c
index 4e7cf59c14d..4870ef1b8de 100644
--- a/src/mame/drivers/gbusters.c
+++ b/src/mame/drivers/gbusters.c
@@ -80,10 +80,12 @@ static WRITE8_HANDLER( gbusters_coin_counter_w )
/* other bits unused/unknown */
if (data & 0xf8)
{
+#if 0
char baf[40];
- logerror("%04x: (ccount) write %02x\n",activecpu_get_pc(), data);
sprintf(baf,"ccnt = %02x", data);
-// popmessage(baf);
+ popmessage(baf);
+#endif
+ logerror("%04x: (ccount) write %02x\n",activecpu_get_pc(), data);
}
}
diff --git a/src/mame/drivers/neogeo.c b/src/mame/drivers/neogeo.c
index 052c2ffcdca..726256402e6 100644
--- a/src/mame/drivers/neogeo.c
+++ b/src/mame/drivers/neogeo.c
@@ -328,7 +328,7 @@ static void select_controller(UINT8 data)
static CUSTOM_INPUT( multiplexed_controller_r )
{
- char tag[6];
+ char tag[40];
sprintf(tag, "IN%s-%d", (const char *)param, controller_select & 0x01);
diff --git a/src/mame/drivers/sspeedr.c b/src/mame/drivers/sspeedr.c
index 39255f6c5e7..16dbbe166df 100644
--- a/src/mame/drivers/sspeedr.c
+++ b/src/mame/drivers/sspeedr.c
@@ -81,7 +81,7 @@ static WRITE8_HANDLER( sspeedr_time_w )
static WRITE8_HANDLER( sspeedr_score_w )
{
- char buf[10];
+ char buf[20];
sprintf(buf, "LED%02d", offset);
data = ~data & 15;
output_set_digit_value(offset, ls48_map[data]);
diff --git a/src/mame/machine/ajax.c b/src/mame/machine/ajax.c
index fe18d66527b..cab7347aa8e 100644
--- a/src/mame/machine/ajax.c
+++ b/src/mame/machine/ajax.c
@@ -108,23 +108,24 @@ static WRITE8_HANDLER( ajax_lamps_w )
READ8_HANDLER( ajax_ls138_f10_r )
{
- int data = 0;
+ int data = 0, index;
+ char port[5];
- switch ((offset & 0x01c0) >> 6){
+ switch ((offset & 0x01c0) >> 6)
+ {
case 0x00: /* ??? */
data = mame_rand(machine);
break;
case 0x04: /* 2P inputs */
- data = input_port_read_indexed(machine, 5);
+ data = input_port_read(machine, "IN2");
break;
case 0x06: /* 1P inputs + DIPSW #1 & #2 */
- if (offset & 0x02)
- data = input_port_read_indexed(machine, offset & 0x01);
- else
- data = input_port_read_indexed(machine, 3 + (offset & 0x01));
+ index = offset & 0x01;
+ sprintf(port, "%s%d", (offset & 0x02) ? "DSW" : "IN", (offset & 0x02) ? index+1 : index);
+ data = input_port_read(machine, port);
break;
case 0x07: /* DIPSW #3 */
- data = input_port_read_indexed(machine, 2);
+ data = input_port_read(machine, "DSW3");
break;
default:
diff --git a/src/mame/machine/arkanoid.c b/src/mame/machine/arkanoid.c
index de9f4c3b0e4..85f316a364a 100644
--- a/src/mame/machine/arkanoid.c
+++ b/src/mame/machine/arkanoid.c
@@ -121,7 +121,7 @@ WRITE8_HANDLER( arkanoid_68705_ddrC_w )
READ8_HANDLER( arkanoid_68705_input_0_r )
{
- int res = input_port_read_indexed(machine,0) & 0x3f;
+ int res = input_port_read(machine, "IN0") & 0x3f;
/* bit 0x40 comes from the sticky bit */
if (!z80write) res |= 0x40;
@@ -136,11 +136,11 @@ READ8_HANDLER( arkanoid_input_2_r )
{
if (arkanoid_paddle_select)
{
- arkanoid_paddle_value = input_port_read_indexed(machine,3);
+ arkanoid_paddle_value = input_port_read(machine, "IN3");
}
else
{
- arkanoid_paddle_value = input_port_read_indexed(machine,2);
+ arkanoid_paddle_value = input_port_read(machine, "IN2");
}
return arkanoid_paddle_value;
diff --git a/src/mame/machine/asteroid.c b/src/mame/machine/asteroid.c
index f316f0e8a6a..2dc4c7995e1 100644
--- a/src/mame/machine/asteroid.c
+++ b/src/mame/machine/asteroid.c
@@ -17,21 +17,21 @@ UINT8 *asteroid_ram1, *asteroid_ram2;
INTERRUPT_GEN( asteroid_interrupt )
{
/* Turn off interrupts if self-test is enabled */
- if (!(input_port_read_indexed(machine, 0) & 0x80))
+ if (!(input_port_read(machine, "IN0") & 0x80))
cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
}
INTERRUPT_GEN( asterock_interrupt )
{
/* Turn off interrupts if self-test is enabled */
- if ((input_port_read_indexed(machine, 0) & 0x80))
+ if ((input_port_read(machine, "IN0") & 0x80))
cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
}
INTERRUPT_GEN( llander_interrupt )
{
/* Turn off interrupts if self-test is enabled */
- if (input_port_read_indexed(machine, 0) & 0x02)
+ if (input_port_read(machine, "IN0") & 0x02)
cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
}
@@ -42,7 +42,7 @@ READ8_HANDLER( asteroid_IN0_r )
int res;
int bitmask;
- res=input_port_read_indexed(machine, 0);
+ res=input_port_read(machine, "IN0");
bitmask = (1 << offset);
@@ -64,7 +64,7 @@ READ8_HANDLER( asteroib_IN0_r )
{
int res;
- res=input_port_read_indexed(machine, 0);
+ res=input_port_read(machine, "IN0");
// if (activecpu_gettotalcycles() & 0x100)
// res |= 0x02;
@@ -79,7 +79,7 @@ READ8_HANDLER( asterock_IN0_r )
int res;
int bitmask;
- res=input_port_read_indexed(machine, 0);
+ res=input_port_read(machine, "IN0");
bitmask = (1 << offset);
@@ -106,7 +106,7 @@ READ8_HANDLER( asteroid_IN1_r )
int res;
int bitmask;
- res=input_port_read_indexed(machine, 1);
+ res=input_port_read(machine, "IN1");
bitmask = (1 << (offset & 0x7));
if (res & bitmask)
@@ -122,7 +122,7 @@ READ8_HANDLER( asteroid_DSW1_r )
int res;
int res1;
- res1 = input_port_read_indexed(machine, 2);
+ res1 = input_port_read(machine, "DSW");
res = 0xfc | ((res1 >> (2 * (3 - (offset & 0x3)))) & 0x3);
return res;
@@ -182,7 +182,7 @@ READ8_HANDLER( llander_IN0_r )
{
int res;
- res = input_port_read_indexed(machine, 0);
+ res = input_port_read(machine, "IN0");
if (avgdvg_done())
res |= 0x01;
diff --git a/src/mame/machine/atarifb.c b/src/mame/machine/atarifb.c
index 5e2947f22c1..787ff7bd122 100644
--- a/src/mame/machine/atarifb.c
+++ b/src/mame/machine/atarifb.c
@@ -152,7 +152,7 @@ READ8_HANDLER( atarifb_in0_r )
(sign_x_2 >> 6) |
(sign_y_1 >> 5) |
(sign_x_1 >> 4) |
- input_port_read_indexed(machine,0);
+ input_port_read(machine, "IN0");
return val;
}
else
@@ -161,14 +161,14 @@ READ8_HANDLER( atarifb_in0_r )
int new_x,new_y;
/* Read player 1 trackball */
- new_x = input_port_read_indexed(machine, 3);
+ new_x = input_port_read(machine, "IN3");
if (new_x != counter_x)
{
sign_x_1 = (new_x - counter_x) & 0x80;
counter_x = new_x;
}
- new_y = input_port_read_indexed(machine, 2);
+ new_y = input_port_read(machine, "IN2");
if (new_y != counter_y)
{
sign_y_1 = (new_y - counter_y) & 0x80;
@@ -184,7 +184,7 @@ READ8_HANDLER( atarifb_in2_r )
{
if ((CTRLD & 0x20)==0x00)
{
- return input_port_read_indexed(machine,1);
+ return input_port_read(machine, "IN1");
}
else
{
@@ -192,14 +192,14 @@ READ8_HANDLER( atarifb_in2_r )
int new_x,new_y;
/* Read player 2 trackball */
- new_x = input_port_read_indexed(machine, 5);
+ new_x = input_port_read(machine, "IN5");
if (new_x != counter_x)
{
sign_x_2 = (new_x - counter_x) & 0x80;
counter_x = new_x;
}
- new_y = input_port_read_indexed(machine, 4);
+ new_y = input_port_read(machine, "IN4");
if (new_y != counter_y)
{
sign_y_2 = (new_y - counter_y) & 0x80;
@@ -234,14 +234,14 @@ READ8_HANDLER( atarifb4_in0_r )
int new_x,new_y;
/* Read player 1 trackball */
- new_x = input_port_read_indexed(machine, 4);
+ new_x = input_port_read(machine, "IN4");
if (new_x != counter_x)
{
sign_x_1 = (new_x - counter_x) & 0x80;
counter_x = new_x;
}
- new_y = input_port_read_indexed(machine, 3);
+ new_y = input_port_read(machine, "IN3");
if (new_y != counter_y)
{
sign_y_1 = (new_y - counter_y) & 0x80;
@@ -257,14 +257,14 @@ READ8_HANDLER( atarifb4_in0_r )
int new_x,new_y;
/* Read player 2 trackball */
- new_x = input_port_read_indexed(machine, 6);
+ new_x = input_port_read(machine, "IN6");
if (new_x != counter_x)
{
sign_x_2 = (new_x - counter_x) & 0x80;
counter_x = new_x;
}
- new_y = input_port_read_indexed(machine, 5);
+ new_y = input_port_read(machine, "IN5");
if (new_y != counter_y)
{
sign_y_2 = (new_y - counter_y) & 0x80;
@@ -282,7 +282,7 @@ READ8_HANDLER( atarifb4_in2_r )
{
if ((CTRLD & 0x40)==0x00)
{
- return input_port_read_indexed(machine,2);
+ return input_port_read(machine, "IN2");
}
else if ((CTRLD & 0x60) == 0x60)
/* LD1 and LD2 both high, return Team 2 right player (player 3) */
@@ -291,14 +291,14 @@ READ8_HANDLER( atarifb4_in2_r )
int new_x,new_y;
/* Read player 3 trackball */
- new_x = input_port_read_indexed(machine, 8);
+ new_x = input_port_read(machine, "IN8");
if (new_x != counter_x)
{
sign_x_3 = (new_x - counter_x) & 0x80;
counter_x = new_x;
}
- new_y = input_port_read_indexed(machine, 7);
+ new_y = input_port_read(machine, "IN7");
if (new_y != counter_y)
{
sign_y_3 = (new_y - counter_y) & 0x80;
@@ -314,14 +314,14 @@ READ8_HANDLER( atarifb4_in2_r )
int new_x,new_y;
/* Read player 4 trackball */
- new_x = input_port_read_indexed(machine, 10);
+ new_x = input_port_read(machine, "IN10");
if (new_x != counter_x)
{
sign_x_4 = (new_x - counter_x) & 0x80;
counter_x = new_x;
}
- new_y = input_port_read_indexed(machine, 9);
+ new_y = input_port_read(machine, "IN9");
if (new_y != counter_y)
{
sign_y_4 = (new_y - counter_y) & 0x80;
diff --git a/src/mame/machine/namcos1.c b/src/mame/machine/namcos1.c
index 8ae7768d133..158afbdc527 100644
--- a/src/mame/machine/namcos1.c
+++ b/src/mame/machine/namcos1.c
@@ -1330,7 +1330,7 @@ static READ8_HANDLER( berabohm_buttons_r )
if (inp == 4) res = input_port_read(machine, "CONTROL0");
else
{
- char portname[4];
+ char portname[40];
#ifdef PRESSURE_SENSITIVE
static int counter[4];
diff --git a/src/mame/machine/pckeybrd.c b/src/mame/machine/pckeybrd.c
index b92de25a402..6c51e3c3dcd 100644
--- a/src/mame/machine/pckeybrd.c
+++ b/src/mame/machine/pckeybrd.c
@@ -321,7 +321,6 @@ static int at_keyboard_charqueue_empty(void);
void at_keyboard_init(AT_KEYBOARD_TYPE type)
{
int i;
- char buf[32];
memset(&keyboard, 0, sizeof(keyboard));
keyboard.type = type;
@@ -342,6 +341,7 @@ void at_keyboard_init(AT_KEYBOARD_TYPE type)
/* locate the keyboard ports */
for (i = 0; i < sizeof(keyboard.ports) / sizeof(keyboard.ports[0]); i++)
{
+ char buf[40];
sprintf(buf, "pc_keyboard_%d", i);
keyboard.ports[i] = input_port_by_tag(Machine->portconfig, buf);
}
diff --git a/src/mame/video/aeroboto.c b/src/mame/video/aeroboto.c
index 843b40180c3..02c0a52c537 100644
--- a/src/mame/video/aeroboto.c
+++ b/src/mame/video/aeroboto.c
@@ -75,7 +75,10 @@ VIDEO_START( aeroboto )
READ8_HANDLER( aeroboto_in0_r )
{
- return input_port_read_indexed(machine, flip_screen_get() ? 1 : 0);
+ char port[4];
+
+ sprintf(port, "IN%d", flip_screen_get() ? 1 : 0);
+ return input_port_read(machine, port);
}
WRITE8_HANDLER( aeroboto_3000_w )
diff --git a/src/mame/video/fuukifg2.c b/src/mame/video/fuukifg2.c
index b947c1220e6..660c766327e 100644
--- a/src/mame/video/fuukifg2.c
+++ b/src/mame/video/fuukifg2.c
@@ -225,7 +225,7 @@ static void draw_sprites(const device_config *screen, bitmap_t *bitmap, const re
#if 0
if (input_code_pressed(KEYCODE_X))
{ /* Display some info on each sprite */
- char buf[10];
+ char buf[40];
sprintf(buf, "%Xx%X %X",xnum,ynum,(attr>>6)&3);
ui_draw_text(buf, sx, sy);
}
diff --git a/src/mame/video/fuukifg3.c b/src/mame/video/fuukifg3.c
index b2886bc6850..8cf37815020 100644
--- a/src/mame/video/fuukifg3.c
+++ b/src/mame/video/fuukifg3.c
@@ -257,7 +257,7 @@ static void draw_sprites(const device_config *screen, bitmap_t *bitmap, const re
#if 0
if (input_code_pressed(KEYCODE_X))
{ /* Display some info on each sprite */
- char buf[10];
+ char buf[40];
sprintf(buf, "%Xx%X %X",xnum,ynum,(attr>>6)&3);
ui_draw_text(buf, sx, sy);
}
diff --git a/src/mame/video/mitchell.c b/src/mame/video/mitchell.c
index c357b632143..b9edb9c2bb9 100644
--- a/src/mame/video/mitchell.c
+++ b/src/mame/video/mitchell.c
@@ -154,9 +154,11 @@ WRITE8_HANDLER( pang_gfxctrl_w )
{
logerror("PC %04x: pang_gfxctrl_w %02x\n",activecpu_get_pc(),data);
{
+#if 0
char baf[40];
sprintf(baf,"%02x",data);
-// popmessage(baf);
+ popmessage(baf);
+#endif
}
/* bit 0 is unknown (used, maybe back color enable?) */
diff --git a/src/mame/video/ssv.c b/src/mame/video/ssv.c
index ad3661ef923..4163a308e91 100644
--- a/src/mame/video/ssv.c
+++ b/src/mame/video/ssv.c
@@ -893,7 +893,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
#ifdef MAME_DEBUG
if (input_code_pressed(KEYCODE_Z)) /* Display some info on each sprite */
- { char buf[10];
+ { char buf[30];
sprintf(buf, "%02X",/*(s2[2] & ~0x3ff)>>8*/mode>>8);
ui_draw_text(buf, sx, sy);
}
diff --git a/src/mame/video/taitojc.c b/src/mame/video/taitojc.c
index b4c41c6ca5d..555a9c9f0d3 100644
--- a/src/mame/video/taitojc.c
+++ b/src/mame/video/taitojc.c
@@ -282,7 +282,7 @@ VIDEO_UPDATE( taitojc )
taitojc_tile_update(screen->machine);
tilemap_draw(bitmap, cliprect, taitojc_tilemap, 0,0);
- /*
+#if 0
if (debug_tex_pal > 0)
{
int j;
@@ -309,7 +309,7 @@ VIDEO_UPDATE( taitojc )
popmessage("%s", string);
}
}
- */
+#endif
return 0;
}