mirror of
https://github.com/holub/mame
synced 2025-10-06 09:00:04 +03:00
Attach gamedrv's input ports to the driver_device, so that there's
no longer anything special about how they are processed. Removed logic that handled the game inputs as a special case.
This commit is contained in:
parent
5951529d11
commit
ff1db593b7
@ -248,7 +248,6 @@ void info_xml_creator::output_one()
|
||||
// allocate input ports
|
||||
machine_config &config = m_drivlist.config();
|
||||
ioport_list portlist;
|
||||
input_port_list_init(portlist, driver.ipt, NULL, 0, FALSE, NULL);
|
||||
for (device_t *device = config.devicelist().first(); device != NULL; device = device->next())
|
||||
if (device->input_ports() != NULL)
|
||||
input_port_list_init(portlist, device->input_ports(), NULL, 0, FALSE, device);
|
||||
|
@ -973,7 +973,7 @@ static WRITE_LINE_DEVICE_HANDLER( changed_write_line_device )
|
||||
system
|
||||
-------------------------------------------------*/
|
||||
|
||||
time_t input_port_init(running_machine &machine, const input_port_token *tokens, const device_list &devicelist)
|
||||
time_t input_port_init(running_machine &machine, const device_list &devicelist)
|
||||
{
|
||||
//input_port_private *portdata;
|
||||
char errorbuf[1024];
|
||||
@ -991,22 +991,13 @@ time_t input_port_init(running_machine &machine, const input_port_token *tokens,
|
||||
init_port_types(machine);
|
||||
|
||||
/* if we have a token list, proceed */
|
||||
if (tokens != NULL)
|
||||
{
|
||||
input_port_list_init(machine.m_portlist, tokens, errorbuf, sizeof(errorbuf), TRUE, NULL);
|
||||
if (errorbuf[0] != 0)
|
||||
mame_printf_error("Input port errors:\n%s", errorbuf);
|
||||
}
|
||||
|
||||
for (device_t *device = devicelist.first(); device != NULL; device = device->next())
|
||||
{
|
||||
if (device->input_ports() != NULL)
|
||||
{
|
||||
input_port_list_init(machine.m_portlist, device->input_ports(), errorbuf, sizeof(errorbuf), TRUE, device);
|
||||
if (errorbuf[0] != 0)
|
||||
mame_printf_error("Input port errors:\n%s", errorbuf);
|
||||
}
|
||||
}
|
||||
|
||||
init_port_state(machine);
|
||||
/* register callbacks for when we load configurations */
|
||||
|
@ -1085,7 +1085,7 @@ struct _inp_header
|
||||
/* ----- core system management ----- */
|
||||
|
||||
/* initialize the input ports, processing the given token list */
|
||||
time_t input_port_init(running_machine &machine, const input_port_token *tokens, const device_list &devicelist);
|
||||
time_t input_port_init(running_machine &machine, const device_list &devicelist);
|
||||
|
||||
|
||||
|
||||
|
@ -279,7 +279,7 @@ void running_machine::start()
|
||||
// initialize the input system and input ports for the game
|
||||
// this must be done before memory_init in order to allow specifying
|
||||
// callbacks based on input port tags
|
||||
time_t newbase = input_port_init(*this, m_system.ipt, devicelist());
|
||||
time_t newbase = input_port_init(*this, devicelist());
|
||||
if (newbase != 0)
|
||||
m_base_time = newbase;
|
||||
|
||||
@ -1140,6 +1140,17 @@ const rom_entry *driver_device::device_rom_region() const
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_input_ports - return a pointer to the
|
||||
// game's input ports
|
||||
//-------------------------------------------------
|
||||
|
||||
const input_port_token *driver_device::device_input_ports() const
|
||||
{
|
||||
return m_system->ipt;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device override which calls
|
||||
// the various helpers
|
||||
|
@ -576,6 +576,7 @@ protected:
|
||||
|
||||
// device-level overrides
|
||||
virtual const rom_entry *device_rom_region() const;
|
||||
virtual const input_port_token *device_input_ports() const;
|
||||
virtual void device_start();
|
||||
virtual void device_reset();
|
||||
|
||||
|
@ -957,14 +957,7 @@ static bool validate_inputs(driver_enumerator &drivlist, int_map &defstr_map, io
|
||||
return FALSE;
|
||||
|
||||
/* allocate the input ports */
|
||||
input_port_list_init(portlist, driver.ipt, errorbuf, sizeof(errorbuf), FALSE, NULL);
|
||||
if (errorbuf[0] != 0)
|
||||
{
|
||||
mame_printf_error("%s: %s has input port errors:\n%s\n", driver.source_file, driver.name, errorbuf);
|
||||
error = true;
|
||||
}
|
||||
for (device_t *cfg = config.devicelist().first(); cfg != NULL; cfg = cfg->next())
|
||||
{
|
||||
if (cfg->input_ports() != NULL)
|
||||
{
|
||||
input_port_list_init(portlist, cfg->input_ports(), errorbuf, sizeof(errorbuf), FALSE, cfg);
|
||||
@ -974,7 +967,6 @@ static bool validate_inputs(driver_enumerator &drivlist, int_map &defstr_map, io
|
||||
error = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* check for duplicate tags */
|
||||
for (port = portlist.first(); port != NULL; port = port->next())
|
||||
|
Loading…
Reference in New Issue
Block a user