huc6261: converted to use inline config. nw.

This commit is contained in:
Fabio Priuli 2014-04-10 07:32:12 +00:00
parent 9586210cdb
commit dfe6539917
3 changed files with 19 additions and 38 deletions

View File

@ -23,20 +23,6 @@
const device_type HUC6261 = &device_creator<huc6261_device>;
void huc6261_device::device_config_complete()
{
const huc6261_interface *intf = reinterpret_cast<const huc6261_interface *>(static_config());
if ( intf != NULL )
{
*static_cast<huc6261_interface *>(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_device>( huc6270_a_tag );
m_huc6270_b = machine().device<huc6270_device>( huc6270_b_tag );
m_huc6270_a = machine().device<huc6270_device>(m_huc6270_a_tag);
m_huc6270_b = machine().device<huc6270_device>(m_huc6270_b_tag);
m_bmp = auto_bitmap_rgb32_alloc( machine(), HUC6261_WPF, HUC6261_LPF );

View File

@ -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<huc6261_device &>(device).m_huc6270_a_tag = tag; }
static void set_vdc2_tag(device_t &device, const char *tag) { downcast<huc6261_device &>(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;

View File

@ -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