cdp1862: devcb2 cleanup. (nw)

This commit is contained in:
Curt Coder 2014-03-21 13:19:13 +00:00
parent c108297188
commit a554cc79ed
3 changed files with 22 additions and 21 deletions

View File

@ -56,9 +56,13 @@ READ_LINE_MEMBER( vp590_device::gd_r )
//-------------------------------------------------
static MACHINE_CONFIG_FRAGMENT( vp590 )
MCFG_CDP1862_ADD(CDP1862_TAG, SCREEN_TAG, CPD1862_CLOCK, DEVREADLINE(DEVICE_SELF, vp590_device, rd_r), DEVREADLINE(DEVICE_SELF, vp590_device, bd_r), DEVREADLINE(DEVICE_SELF, vp590_device, gd_r))
MCFG_DEVICE_ADD(CDP1862_TAG, CDP1862, CPD1862_CLOCK)
MCFG_CDP1861_RD_CALLBACK(DEVREADLINE(DEVICE_SELF, vp590_device, rd_r))
MCFG_CDP1861_BD_CALLBACK(DEVREADLINE(DEVICE_SELF, vp590_device, bd_r))
MCFG_CDP1861_GD_CALLBACK(DEVREADLINE(DEVICE_SELF, vp590_device, gd_r))
MCFG_CDP1862_LUMINANCE(RES_R(510), RES_R(360), RES_K(1), RES_K(1.5)) // R3, R4, R5, R6
MCFG_CDP1862_CHROMINANCE(RES_K(3.9), RES_K(10), RES_K(2), RES_K(3.3)) // R7, R8, R9, R10
MCFG_VIDEO_SET_SCREEN(SCREEN_TAG)
MACHINE_CONFIG_END

View File

@ -67,13 +67,6 @@
// INTERFACE CONFIGURATION MACROS
//**************************************************************************
#define MCFG_CDP1861_ADD(_tag, _screen_tag, _clock, _irq, _dma_out, _efx) \
MCFG_DEVICE_ADD(_tag, CDP1861, _clock) \
MCFG_VIDEO_SET_SCREEN(_screen_tag) \
downcast<cdp1861_device *>(device)->set_irq_callback(DEVCB2_##_irq); \
downcast<cdp1861_device *>(device)->set_dma_out_callback(DEVCB2_##_dma_out); \
downcast<cdp1861_device *>(device)->set_efx_callback(DEVCB2_##_efx);
#define MCFG_CDP1861_IRQ_CALLBACK(_write) \
devcb = &cdp1861_device::set_irq_wr_callback(*device, DEVCB2_##_write);
@ -83,6 +76,7 @@
#define MCFG_CDP1861_EFX_CALLBACK(_write) \
devcb = &cdp1861_device::set_efx_wr_callback(*device, DEVCB2_##_write);
#define MCFG_CDP1861_SCREEN_ADD(_cdptag, _tag, _clock) \
MCFG_VIDEO_SET_SCREEN(_tag) \
MCFG_SCREEN_ADD(_tag, RASTER) \

View File

@ -45,18 +45,20 @@
// INTERFACE CONFIGURATION MACROS
//**************************************************************************
#define MCFG_CDP1862_ADD(_tag, _screen_tag, _clock, _rd, _bd, _gd) \
MCFG_DEVICE_ADD(_tag, CDP1862, _clock) \
MCFG_VIDEO_SET_SCREEN(_screen_tag) \
downcast<cdp1862_device *>(device)->set_rd_callback(DEVCB2_##_rd); \
downcast<cdp1862_device *>(device)->set_bd_callback(DEVCB2_##_bd); \
downcast<cdp1862_device *>(device)->set_gd_callback(DEVCB2_##_gd);
#define MCFG_CDP1861_RD_CALLBACK(_read) \
devcb = &cdp1862_device::set_rd_rd_callback(*device, DEVCB2_##_read);
#define MCFG_CDP1861_BD_CALLBACK(_read) \
devcb = &cdp1862_device::set_bd_rd_callback(*device, DEVCB2_##_read);
#define MCFG_CDP1861_GD_CALLBACK(_read) \
devcb = &cdp1862_device::set_gd_rd_callback(*device, DEVCB2_##_read);
#define MCFG_CDP1862_LUMINANCE(_r, _b, _g, _bkg) \
downcast<cdp1862_device *>(device)->set_luminance_resistors(_r, _b, _g, _bkg);
cdp1862_device::static_set_luminance(*device, _r, _b, _g, _bkg);
#define MCFG_CDP1862_CHROMINANCE(_r, _b, _g, _bkg) \
downcast<cdp1862_device *>(device)->set_chrominance_resistors(_r, _b, _g, _bkg);
cdp1862_device::static_set_chrominance(*device, _r, _b, _g, _bkg);
@ -73,11 +75,12 @@ public:
// construction/destruction
cdp1862_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
template<class _rd> void set_rd_callback(_rd rd) { m_read_rd.set_callback(rd); }
template<class _bd> void set_bd_callback(_bd bd) { m_read_bd.set_callback(bd); }
template<class _gd> void set_gd_callback(_gd gd) { m_read_gd.set_callback(gd); }
void set_luminance_resistors(double r, double b, double g, double bkg) { m_lum_r = r; m_lum_b = b; m_lum_g = g; m_lum_bkg = bkg; }
void set_chrominance_resistors(double r, double b, double g, double bkg) { m_chr_r = r; m_chr_b = b; m_chr_g = g; m_chr_bkg = bkg; }
template<class _Object> static devcb2_base &set_rd_rd_callback(device_t &device, _Object object) { return downcast<cdp1862_device &>(device).m_read_rd.set_callback(object); }
template<class _Object> static devcb2_base &set_bd_rd_callback(device_t &device, _Object object) { return downcast<cdp1862_device &>(device).m_read_bd.set_callback(object); }
template<class _Object> static devcb2_base &set_gd_rd_callback(device_t &device, _Object object) { return downcast<cdp1862_device &>(device).m_read_gd.set_callback(object); }
static void static_set_luminance(device_t &device, double r, double b, double g, double bkg) { downcast<cdp1862_device &>(device).m_lum_r = r; downcast<cdp1862_device &>(device).m_lum_b = b; downcast<cdp1862_device &>(device).m_lum_g = g; downcast<cdp1862_device &>(device).m_lum_bkg = bkg; }
static void static_set_chrominance(device_t &device, double r, double b, double g, double bkg) { downcast<cdp1862_device &>(device).m_chr_r = r; downcast<cdp1862_device &>(device).m_chr_b = b; downcast<cdp1862_device &>(device).m_chr_g = g; downcast<cdp1862_device &>(device).m_chr_bkg = bkg; }
DECLARE_WRITE8_MEMBER( dma_w );
DECLARE_WRITE_LINE_MEMBER( bkg_w );