diff options
Diffstat (limited to 'src/emu/machine/upd7201.c')
-rw-r--r-- | src/emu/machine/upd7201.c | 69 |
1 files changed, 27 insertions, 42 deletions
diff --git a/src/emu/machine/upd7201.c b/src/emu/machine/upd7201.c index dc74e5bdb08..9063765b403 100644 --- a/src/emu/machine/upd7201.c +++ b/src/emu/machine/upd7201.c @@ -21,6 +21,9 @@ #include "machine/devhelpr.h" +// device type definition +const device_type UPD7201 = &device_creator<upd7201_device>; + //************************************************************************** // MACROS / CONSTANTS @@ -38,44 +41,6 @@ enum //************************************************************************** -// GLOBAL VARIABLES -//************************************************************************** - -// devices -const device_type UPD7201 = upd7201_device_config::static_alloc_device_config; - - - -//************************************************************************** -// DEVICE CONFIGURATION -//************************************************************************** - -GENERIC_DEVICE_CONFIG_SETUP(upd7201, "UPD7201") - - -//------------------------------------------------- -// device_config_complete - perform any -// operations now that the configuration is -// complete -//------------------------------------------------- - -void upd7201_device_config::device_config_complete() -{ - // inherit a copy of the static data - const upd7201_interface *intf = reinterpret_cast<const upd7201_interface *>(static_config()); - if (intf != NULL) - *static_cast<upd7201_interface *>(this) = *intf; - - // or initialize to defaults if none provided - else - { - memset(&m_out_int_func, 0, sizeof(m_out_int_func)); - } -} - - - -//************************************************************************** // INLINE HELPERS //************************************************************************** @@ -106,21 +71,41 @@ inline void upd7201_device::transmit(int channel) // upd7201_device - constructor //------------------------------------------------- -upd7201_device::upd7201_device(running_machine &_machine, const upd7201_device_config &config) - : device_t(_machine, config), - m_config(config) +upd7201_device::upd7201_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : device_t(mconfig, UPD7201, "UPD7201", tag, owner, clock) { } //------------------------------------------------- +// device_config_complete - perform any +// operations now that the configuration is +// complete +//------------------------------------------------- + +void upd7201_device::device_config_complete() +{ + // inherit a copy of the static data + const upd7201_interface *intf = reinterpret_cast<const upd7201_interface *>(static_config()); + if (intf != NULL) + *static_cast<upd7201_interface *>(this) = *intf; + + // or initialize to defaults if none provided + else + { + memset(&m_out_int_cb, 0, sizeof(m_out_int_cb)); + } +} + + +//------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- void upd7201_device::device_start() { // resolve callbacks - devcb_resolve_write_line(&m_out_int_func, &m_config.m_out_int_func, this); + devcb_resolve_write_line(&m_out_int_func, &m_out_int_cb, this); } |