Previous 199869 Revisions Next

r29507 Thursday 10th April, 2014 at 07:32:12 UTC by Fabio Priuli
huc6261: converted to use inline config. nw.
[src/emu/video]huc6261.c huc6261.h
[src/mess/drivers]pcfx.c

trunk/src/emu/video/huc6261.c
r29506r29507
2323const device_type HUC6261 = &device_creator<huc6261_device>;
2424
2525
26void huc6261_device::device_config_complete()
27{
28   const huc6261_interface *intf = reinterpret_cast<const huc6261_interface *>(static_config());
29
30   if ( intf != NULL )
31   {
32      *static_cast<huc6261_interface *>(this) = *intf;
33   }
34   else
35   {
36   }
37}
38
39
4026huc6261_device::huc6261_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
4127   :   device_t(mconfig, HUC6261, "HuC6261", tag, owner, clock, "huc6261", __FILE__),
4228      device_video_interface(mconfig, *this)
r29506r29507
407393   assert( huc6270_b_tag != NULL );
408394
409395   m_timer = timer_alloc();
410   m_huc6270_a = machine().device<huc6270_device>( huc6270_a_tag );
411   m_huc6270_b = machine().device<huc6270_device>( huc6270_b_tag );
396   m_huc6270_a = machine().device<huc6270_device>(m_huc6270_a_tag);
397   m_huc6270_b = machine().device<huc6270_device>(m_huc6270_b_tag);
412398
413399   m_bmp = auto_bitmap_rgb32_alloc( machine(), HUC6261_WPF, HUC6261_LPF );
414400
trunk/src/emu/video/huc6261.h
r29506r29507
1717#define HUC6261_LPF         263     /* max number of lines in a single frame */
1818
1919
20#define MCFG_HUC6261_ADD( _tag, clock, _intrf ) \
21   MCFG_DEVICE_ADD( _tag, HUC6261, clock )     \
22   MCFG_DEVICE_CONFIG( _intrf )
20#define MCFG_HUC6261_VDC1(_tag) \
21   huc6261_device::set_vdc1_tag(*device, _tag);
2322
23#define MCFG_HUC6261_VDC2(_tag) \
24   huc6261_device::set_vdc2_tag(*device, _tag);
2425
25struct huc6261_interface
26{
27   /* Tags for the 2 HuC6270 devices */
28   const char *huc6270_a_tag;
29   const char *huc6270_b_tag;
30};
3126
32
3327class huc6261_device :  public device_t,
34                  public device_video_interface,
35                  public huc6261_interface
28                  public device_video_interface
3629{
3730public:
3831   // construction/destruction
3932   huc6261_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
4033
34   static void set_vdc1_tag(device_t &device, const char *tag) { downcast<huc6261_device &>(device).m_huc6270_a_tag = tag; }
35   static void set_vdc2_tag(device_t &device, const char *tag) { downcast<huc6261_device &>(device).m_huc6270_b_tag = tag; }
36
4137   void video_update(bitmap_rgb32 &bitmap, const rectangle &cliprect);
4238   DECLARE_READ16_MEMBER( read );
4339   DECLARE_WRITE16_MEMBER( write );
r29506r29507
4642
4743protected:
4844   // device-level overrides
49   virtual void device_config_complete();
5045   virtual void device_start();
5146   virtual void device_reset();
5247   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
5348
5449private:
50   const char *m_huc6270_a_tag;
51   const char *m_huc6270_b_tag;
52
5553   huc6270_device *m_huc6270_a;
5654   huc6270_device *m_huc6270_b;
5755   int     m_last_h;
trunk/src/mess/drivers/pcfx.c
r29506r29507
457457}
458458
459459
460static const huc6261_interface pcfx_huc6261_config =
461{
462   "huc6270_a",
463   "huc6270_b"
464};
465
466
467460void pcfx_state::machine_reset()
468461{
469462   membank( "bank1" )->set_base( memregion("user1")->base() );
r29506r29507
492485   MCFG_DEVICE_ADD( "huc6270_a", HUC6270, 0 )
493486   MCFG_HUC6270_VRAM_SIZE(0x20000)
494487   MCFG_HUC6270_IRQ_CHANGED_CB(WRITELINE(pcfx_state, irq12_w))
488
495489   MCFG_DEVICE_ADD( "huc6270_b", HUC6270, 0 )
496490   MCFG_HUC6270_VRAM_SIZE(0x20000)
497491   MCFG_HUC6270_IRQ_CHANGED_CB(WRITELINE(pcfx_state, irq14_w))
498   MCFG_HUC6261_ADD( "huc6261", XTAL_21_4772MHz, pcfx_huc6261_config )
499   MCFG_HUC6272_ADD( "huc6272", XTAL_21_4772MHz )
500492
493   MCFG_DEVICE_ADD("huc6261", HUC6261, XTAL_21_4772MHz)
494   MCFG_HUC6261_VDC1("huc6270_a")
495   MCFG_HUC6261_VDC2("huc6270_b")
496
497   MCFG_HUC6272_ADD( "huc6272", XTAL_21_4772MHz )
501498MACHINE_CONFIG_END
502499
503500

Previous 199869 Revisions Next


© 1997-2024 The MAME Team