From 726f7958ca25af6e4a3edb5663e30278c419cdbd Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 10 Jan 2016 11:15:10 +0100 Subject: [PATCH] move things around (nw) --- src/emu/driver.cpp | 17 +++++++++++++++++ src/emu/machine/generic.cpp | 34 ---------------------------------- src/emu/machine/generic.h | 5 ----- src/emu/output.cpp | 14 ++++++++++++++ src/emu/output.h | 2 ++ 5 files changed, 33 insertions(+), 39 deletions(-) diff --git a/src/emu/driver.cpp b/src/emu/driver.cpp index ee4ec8bebdb..a6858140464 100644 --- a/src/emu/driver.cpp +++ b/src/emu/driver.cpp @@ -565,6 +565,23 @@ void driver_device::flip_screen_y_set(UINT32 on) } +/*************************************************************************** +PORT READING HELPERS +***************************************************************************/ + +/*------------------------------------------------- +custom_port_read - act like input_port_read +but it is a custom port, it is useful for +e.g. input ports which expect the same port +repeated both in the upper and lower half +-------------------------------------------------*/ + +CUSTOM_INPUT_MEMBER(driver_device::custom_port_read) +{ + const char *tag = (const char *)param; + return ioport(tag)->read(); +} + //************************************************************************** // MISC READ/WRITE HANDLERS diff --git a/src/emu/machine/generic.cpp b/src/emu/machine/generic.cpp index 910ffda4b77..2de58502c7c 100644 --- a/src/emu/machine/generic.cpp +++ b/src/emu/machine/generic.cpp @@ -253,37 +253,3 @@ void coin_lockout_global_w(running_machine &machine, int on) for (i = 0; i < ARRAY_LENGTH(state->coinlockedout); i++) coin_lockout_w(machine, i, on); } - - -/*************************************************************************** - LED CODE -***************************************************************************/ - -/*------------------------------------------------- - set_led_status - set the state of a given LED --------------------------------------------------*/ - -void set_led_status(running_machine &machine, int num, int on) -{ - output_set_led_value(num, on); -} - - - - -/*************************************************************************** - PORT READING HELPERS -***************************************************************************/ - -/*------------------------------------------------- - custom_port_read - act like input_port_read - but it is a custom port, it is useful for - e.g. input ports which expect the same port - repeated both in the upper and lower half --------------------------------------------------*/ - -CUSTOM_INPUT_MEMBER( driver_device::custom_port_read ) -{ - const char *tag = (const char *)param; - return ioport(tag)->read(); -} diff --git a/src/emu/machine/generic.h b/src/emu/machine/generic.h index b724a598a9d..38660d9a386 100644 --- a/src/emu/machine/generic.h +++ b/src/emu/machine/generic.h @@ -61,9 +61,4 @@ int coin_lockout_get_state(running_machine &machine, int num); /* enable/disable global coin lockout */ void coin_lockout_global_w(running_machine &machine, int on); -/* ----- miscellaneous bits & pieces ----- */ - -/* set the status of an LED */ -void set_led_status(running_machine &machine, int num, int value); - #endif /* __MACHINE_GENERIC_H__ */ diff --git a/src/emu/output.cpp b/src/emu/output.cpp index 3977c0e809b..6e399cb4c97 100644 --- a/src/emu/output.cpp +++ b/src/emu/output.cpp @@ -368,3 +368,17 @@ const char *output_id_to_name(UINT32 id) /* nothing found, return NULL */ return nullptr; } + +/*************************************************************************** +LED CODE +***************************************************************************/ + +/*------------------------------------------------- +set_led_status - set the state of a given LED +-------------------------------------------------*/ + +void set_led_status(running_machine &machine, int num, int on) +{ + output_set_led_value(num, on); +} + diff --git a/src/emu/output.h b/src/emu/output.h index 95f8e40d821..d4a442f6636 100644 --- a/src/emu/output.h +++ b/src/emu/output.h @@ -56,6 +56,8 @@ UINT32 output_name_to_id(const char *outname); /* map a unique ID back to a name */ const char *output_id_to_name(UINT32 id); +/* set the status of an LED */ +void set_led_status(running_machine &machine, int num, int value); /***************************************************************************