From bef699950a516c3b1f00947f5b3c4ac3dee9e4cb Mon Sep 17 00:00:00 2001 From: Fabio Priuli Date: Sat, 12 Apr 2014 20:18:48 +0000 Subject: k033906: converted to use inline configs. nw. k056230: converted to use inline configs. nw. --- src/emu/machine/k033906.h | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) (limited to 'src/emu/machine/k033906.h') diff --git a/src/emu/machine/k033906.h b/src/emu/machine/k033906.h index dce11e2bcbd..e50fb2cc2b4 100644 --- a/src/emu/machine/k033906.h +++ b/src/emu/machine/k033906.h @@ -17,41 +17,30 @@ DEVICE CONFIGURATION MACROS ***************************************************************************/ -#define MCFG_K033906_ADD(_tag, _config) \ - MCFG_DEVICE_ADD(_tag, K033906, 0) \ - MCFG_DEVICE_CONFIG(_config) - +#define MCFG_K033906_VOODOO(_tag) \ + k033906_device::set_voodoo_tag(*device, _tag); /*************************************************************************** TYPE DEFINITIONS ***************************************************************************/ -// ======================> k033906_interface - -struct k033906_interface -{ - const char *m_voodoo_tag; -}; - - - // ======================> k033906_device -class k033906_device : public device_t, - public k033906_interface +class k033906_device : public device_t { public: // construction/destruction k033906_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - DECLARE_READ32_MEMBER( k033906_r ); - DECLARE_WRITE32_MEMBER( k033906_w ); - DECLARE_WRITE_LINE_MEMBER( k033906_set_reg ); + static void set_voodoo_tag(device_t &device, const char *tag) { downcast(device).m_voodoo_tag = tag; } + + DECLARE_READ32_MEMBER( read ); + DECLARE_WRITE32_MEMBER( write ); + DECLARE_WRITE_LINE_MEMBER( set_reg ); protected: // device-level overrides - virtual void device_config_complete(); virtual void device_start(); virtual void device_reset() { } virtual void device_post_load() { } @@ -59,14 +48,15 @@ protected: private: - UINT32 k033906_reg_r(int reg); - void k033906_reg_w(int reg, UINT32 data); + UINT32 reg_r(int reg); + void reg_w(int reg, UINT32 data); /* i/o lines */ int m_reg_set; // 1 = access reg / 0 = access ram - device_t *m_voodoo; + const char *m_voodoo_tag; + device_t *m_voodoo; UINT32 m_reg[256]; UINT32 m_ram[32768]; -- cgit v1.2.3-70-g09d2