mirror of
https://github.com/holub/mame
synced 2025-05-22 13:48:55 +03:00
Added overloaded input_port_read() for reading device owned input ports. [Curt Coder]
This commit is contained in:
parent
130a45928e
commit
a6876a9980
@ -1582,6 +1582,21 @@ input_port_value input_port_read(running_machine *machine, const char *tag)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*-------------------------------------------------
|
||||||
|
input_port_read - return the value of
|
||||||
|
an device input port specified by tag
|
||||||
|
-------------------------------------------------*/
|
||||||
|
|
||||||
|
input_port_value input_port_read(running_machine *machine, device_t *device, const char *tag)
|
||||||
|
{
|
||||||
|
astring tempstring;
|
||||||
|
const input_port_config *port = machine->port(device->baseconfig().subtag(tempstring, tag));
|
||||||
|
if (port == NULL)
|
||||||
|
fatalerror("Unable to locate input port '%s'", tag);
|
||||||
|
return input_port_read_direct(port);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*-------------------------------------------------
|
/*-------------------------------------------------
|
||||||
input_port_read_safe - return the value of
|
input_port_read_safe - return the value of
|
||||||
an input port specified by tag, or a default
|
an input port specified by tag, or a default
|
||||||
|
@ -1137,6 +1137,9 @@ input_port_value input_port_read_direct(const input_port_config *port);
|
|||||||
/* return the value of an input port specified by tag */
|
/* return the value of an input port specified by tag */
|
||||||
input_port_value input_port_read(running_machine *machine, const char *tag);
|
input_port_value input_port_read(running_machine *machine, const char *tag);
|
||||||
|
|
||||||
|
/* return the value of an input port specified by tag */
|
||||||
|
input_port_value input_port_read(running_machine *machine, device_t *device, const char *tag);
|
||||||
|
|
||||||
/* return the value of an input port specified by tag, or a default value if the port does not exist */
|
/* 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);
|
input_port_value input_port_read_safe(running_machine *machine, const char *tag, input_port_value defvalue);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user