summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2008-07-24 05:34:45 +0000
committer Aaron Giles <aaron@aarongiles.com>2008-07-24 05:34:45 +0000
commit61971ae92ebb5b1fccb6aef196aa3906a4a07981 (patch)
tree49a1625a25b0d00123f1f15c5c0d70e81e663da1
parent688829379196674491faeaa6bb52a8fec823df2a (diff)
Made input_port_read_indexed() private to machine/generic.c.
Eventually it will probably disappear altogether. Fixed the two remaining instances.
-rw-r--r--src/emu/inptport.c14
-rw-r--r--src/emu/inptport.h3
-rw-r--r--src/emu/machine/generic.c12
-rw-r--r--src/mame/drivers/model2.c9
-rw-r--r--src/mame/drivers/tourtabl.c8
5 files changed, 22 insertions, 24 deletions
diff --git a/src/emu/inptport.c b/src/emu/inptport.c
index ada4b219309..25784501dc5 100644
--- a/src/emu/inptport.c
+++ b/src/emu/inptport.c
@@ -1290,7 +1290,7 @@ input_port_value input_port_read(running_machine *machine, const char *tag)
/*-------------------------------------------------
- input_port_read_indexed - return the value of
+ input_port_read_safe - return the value of
an input port specified by tag, or a default
value if the port does not exist
-------------------------------------------------*/
@@ -1303,18 +1303,6 @@ input_port_value input_port_read_safe(running_machine *machine, const char *tag,
/*-------------------------------------------------
- input_port_read_indexed - return the value of
- an input port specified by index
--------------------------------------------------*/
-
-input_port_value input_port_read_indexed(running_machine *machine, int portnum)
-{
- const input_port_config *port = input_port_by_index(machine->portconfig, portnum);
- return (port == NULL) ? 0 : input_port_read_direct(port);
-}
-
-
-/*-------------------------------------------------
input_port_read_crosshair - return the
extracted crosshair values for the given
player
diff --git a/src/emu/inptport.h b/src/emu/inptport.h
index 987b52550c2..0ee7703ae90 100644
--- a/src/emu/inptport.h
+++ b/src/emu/inptport.h
@@ -1016,9 +1016,6 @@ input_port_value input_port_read(running_machine *machine, const char *tag);
/* return the value of an input port specified by tag, or a default value if the port does not exist */
input_port_value input_port_read_safe(running_machine *machine, const char *tag, input_port_value defvalue);
-/* return the value of an input port specified by index */
-input_port_value input_port_read_indexed(running_machine *machine, int portnum);
-
/* return the extracted crosshair values for the given player */
int input_port_get_crosshair_position(running_machine *machine, int player, float *x, float *y);
diff --git a/src/emu/machine/generic.c b/src/emu/machine/generic.c
index 7dc82f938b7..2a670d806af 100644
--- a/src/emu/machine/generic.c
+++ b/src/emu/machine/generic.c
@@ -694,6 +694,18 @@ READ32_HANDLER( watchdog_reset32_r ) { watchdog_reset(machine); return 0xfffffff
***************************************************************************/
/*-------------------------------------------------
+ input_port_read_indexed - return the value of
+ an input port specified by index
+-------------------------------------------------*/
+
+static input_port_value input_port_read_indexed(running_machine *machine, int portnum)
+{
+ const input_port_config *port = input_port_by_index(machine->portconfig, portnum);
+ return (port == NULL) ? 0 : input_port_read_direct(port);
+}
+
+
+/*-------------------------------------------------
8-bit read handlers
-------------------------------------------------*/
diff --git a/src/mame/drivers/model2.c b/src/mame/drivers/model2.c
index c3fedc8e443..4579f751967 100644
--- a/src/mame/drivers/model2.c
+++ b/src/mame/drivers/model2.c
@@ -477,7 +477,8 @@ static READ32_HANDLER(analog_2b_r)
UINT32 iptval=0x00ff;
if(analog_channel<4)
{
- iptval=input_port_read_indexed(machine, 3+analog_channel);
+ static const char *ports[] = { "ANA0", "ANA1", "ANA2", "ANA3" };
+ iptval=input_port_read_safe(machine, ports[analog_channel], 0);
++analog_channel;
}
return (iptval<<16)|0x0000001a;
@@ -1527,13 +1528,13 @@ static INPUT_PORTS_START( srallyc)
PORT_START_TAG("IN2")
PORT_BIT(0xFF, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START_TAG("STEER") // steer
+ PORT_START_TAG("ANA0") // steer
PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_SENSITIVITY(30) PORT_KEYDELTA(10) PORT_PLAYER(1)
- PORT_START_TAG("ACCEL") // accel
+ PORT_START_TAG("ANA1") // accel
PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(30) PORT_KEYDELTA(10) PORT_PLAYER(1)
- PORT_START_TAG("BREAK") // brake
+ PORT_START_TAG("ANA2") // brake
PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_SENSITIVITY(30) PORT_KEYDELTA(10) PORT_PLAYER(1)
INPUT_PORTS_END
diff --git a/src/mame/drivers/tourtabl.c b/src/mame/drivers/tourtabl.c
index 44943ad3adb..5b1fe8357c9 100644
--- a/src/mame/drivers/tourtabl.c
+++ b/src/mame/drivers/tourtabl.c
@@ -53,22 +53,22 @@ ADDRESS_MAP_END
static UINT8 port6_r(const device_config *device, UINT8 olddata)
{
- return input_port_read_indexed(device->machine, 6);
+ return input_port_read(device->machine, "RIOT0_SWA");
}
static UINT8 port7_r(const device_config *device, UINT8 olddata)
{
- return input_port_read_indexed(device->machine, 7);
+ return input_port_read(device->machine, "RIOT0_SWB");
}
static UINT8 port8_r(const device_config *device, UINT8 olddata)
{
- return input_port_read_indexed(device->machine, 8);
+ return input_port_read(device->machine, "RIOT1_SWA");
}
static UINT8 port9_r(const device_config *device, UINT8 olddata)
{
- return input_port_read_indexed(device->machine, 9);
+ return input_port_read(device->machine, "RIOT1_SWB");
}
static void watchdog_w(const device_config *device, UINT8 newdata, UINT8 olddata)