diff --git a/src/emu/video/huc6261.c b/src/emu/video/huc6261.c index cb8b7fd8c07..482f15cb665 100644 --- a/src/emu/video/huc6261.c +++ b/src/emu/video/huc6261.c @@ -23,20 +23,6 @@ const device_type HUC6261 = &device_creator; -void huc6261_device::device_config_complete() -{ - const huc6261_interface *intf = reinterpret_cast(static_config()); - - if ( intf != NULL ) - { - *static_cast(this) = *intf; - } - else - { - } -} - - huc6261_device::huc6261_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, HUC6261, "HuC6261", tag, owner, clock, "huc6261", __FILE__), device_video_interface(mconfig, *this) @@ -407,8 +393,8 @@ void huc6261_device::device_start() assert( huc6270_b_tag != NULL ); m_timer = timer_alloc(); - m_huc6270_a = machine().device( huc6270_a_tag ); - m_huc6270_b = machine().device( huc6270_b_tag ); + m_huc6270_a = machine().device(m_huc6270_a_tag); + m_huc6270_b = machine().device(m_huc6270_b_tag); m_bmp = auto_bitmap_rgb32_alloc( machine(), HUC6261_WPF, HUC6261_LPF ); diff --git a/src/emu/video/huc6261.h b/src/emu/video/huc6261.h index f0452cbaff1..3c7487a738d 100644 --- a/src/emu/video/huc6261.h +++ b/src/emu/video/huc6261.h @@ -17,27 +17,23 @@ #define HUC6261_LPF 263 /* max number of lines in a single frame */ -#define MCFG_HUC6261_ADD( _tag, clock, _intrf ) \ - MCFG_DEVICE_ADD( _tag, HUC6261, clock ) \ - MCFG_DEVICE_CONFIG( _intrf ) +#define MCFG_HUC6261_VDC1(_tag) \ + huc6261_device::set_vdc1_tag(*device, _tag); - -struct huc6261_interface -{ - /* Tags for the 2 HuC6270 devices */ - const char *huc6270_a_tag; - const char *huc6270_b_tag; -}; +#define MCFG_HUC6261_VDC2(_tag) \ + huc6261_device::set_vdc2_tag(*device, _tag); class huc6261_device : public device_t, - public device_video_interface, - public huc6261_interface + public device_video_interface { public: // construction/destruction huc6261_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + static void set_vdc1_tag(device_t &device, const char *tag) { downcast(device).m_huc6270_a_tag = tag; } + static void set_vdc2_tag(device_t &device, const char *tag) { downcast(device).m_huc6270_b_tag = tag; } + void video_update(bitmap_rgb32 &bitmap, const rectangle &cliprect); DECLARE_READ16_MEMBER( read ); DECLARE_WRITE16_MEMBER( write ); @@ -46,12 +42,14 @@ public: protected: // device-level overrides - virtual void device_config_complete(); virtual void device_start(); virtual void device_reset(); virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); private: + const char *m_huc6270_a_tag; + const char *m_huc6270_b_tag; + huc6270_device *m_huc6270_a; huc6270_device *m_huc6270_b; int m_last_h; diff --git a/src/mess/drivers/pcfx.c b/src/mess/drivers/pcfx.c index 79b4c28072e..3853db4bb2a 100644 --- a/src/mess/drivers/pcfx.c +++ b/src/mess/drivers/pcfx.c @@ -457,13 +457,6 @@ WRITE_LINE_MEMBER( pcfx_state::irq15_w ) } -static const huc6261_interface pcfx_huc6261_config = -{ - "huc6270_a", - "huc6270_b" -}; - - void pcfx_state::machine_reset() { membank( "bank1" )->set_base( memregion("user1")->base() ); @@ -492,12 +485,16 @@ static MACHINE_CONFIG_START( pcfx, pcfx_state ) MCFG_DEVICE_ADD( "huc6270_a", HUC6270, 0 ) MCFG_HUC6270_VRAM_SIZE(0x20000) MCFG_HUC6270_IRQ_CHANGED_CB(WRITELINE(pcfx_state, irq12_w)) + MCFG_DEVICE_ADD( "huc6270_b", HUC6270, 0 ) MCFG_HUC6270_VRAM_SIZE(0x20000) MCFG_HUC6270_IRQ_CHANGED_CB(WRITELINE(pcfx_state, irq14_w)) - MCFG_HUC6261_ADD( "huc6261", XTAL_21_4772MHz, pcfx_huc6261_config ) - MCFG_HUC6272_ADD( "huc6272", XTAL_21_4772MHz ) + MCFG_DEVICE_ADD("huc6261", HUC6261, XTAL_21_4772MHz) + MCFG_HUC6261_VDC1("huc6270_a") + MCFG_HUC6261_VDC2("huc6270_b") + + MCFG_HUC6272_ADD( "huc6272", XTAL_21_4772MHz ) MACHINE_CONFIG_END