trunk/src/emu/video/huc6261.c
| r29506 | r29507 | |
| 23 | 23 | const device_type HUC6261 = &device_creator<huc6261_device>; |
| 24 | 24 | |
| 25 | 25 | |
| 26 | | void 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 | | |
| 40 | 26 | huc6261_device::huc6261_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 41 | 27 | : device_t(mconfig, HUC6261, "HuC6261", tag, owner, clock, "huc6261", __FILE__), |
| 42 | 28 | device_video_interface(mconfig, *this) |
| r29506 | r29507 | |
| 407 | 393 | assert( huc6270_b_tag != NULL ); |
| 408 | 394 | |
| 409 | 395 | 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); |
| 412 | 398 | |
| 413 | 399 | m_bmp = auto_bitmap_rgb32_alloc( machine(), HUC6261_WPF, HUC6261_LPF ); |
| 414 | 400 | |
trunk/src/emu/video/huc6261.h
| r29506 | r29507 | |
| 17 | 17 | #define HUC6261_LPF 263 /* max number of lines in a single frame */ |
| 18 | 18 | |
| 19 | 19 | |
| 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); |
| 23 | 22 | |
| 23 | #define MCFG_HUC6261_VDC2(_tag) \ |
| 24 | huc6261_device::set_vdc2_tag(*device, _tag); |
| 24 | 25 | |
| 25 | | struct huc6261_interface |
| 26 | | { |
| 27 | | /* Tags for the 2 HuC6270 devices */ |
| 28 | | const char *huc6270_a_tag; |
| 29 | | const char *huc6270_b_tag; |
| 30 | | }; |
| 31 | 26 | |
| 32 | | |
| 33 | 27 | class huc6261_device : public device_t, |
| 34 | | public device_video_interface, |
| 35 | | public huc6261_interface |
| 28 | public device_video_interface |
| 36 | 29 | { |
| 37 | 30 | public: |
| 38 | 31 | // construction/destruction |
| 39 | 32 | huc6261_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 40 | 33 | |
| 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 | |
| 41 | 37 | void video_update(bitmap_rgb32 &bitmap, const rectangle &cliprect); |
| 42 | 38 | DECLARE_READ16_MEMBER( read ); |
| 43 | 39 | DECLARE_WRITE16_MEMBER( write ); |
| r29506 | r29507 | |
| 46 | 42 | |
| 47 | 43 | protected: |
| 48 | 44 | // device-level overrides |
| 49 | | virtual void device_config_complete(); |
| 50 | 45 | virtual void device_start(); |
| 51 | 46 | virtual void device_reset(); |
| 52 | 47 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); |
| 53 | 48 | |
| 54 | 49 | private: |
| 50 | const char *m_huc6270_a_tag; |
| 51 | const char *m_huc6270_b_tag; |
| 52 | |
| 55 | 53 | huc6270_device *m_huc6270_a; |
| 56 | 54 | huc6270_device *m_huc6270_b; |
| 57 | 55 | int m_last_h; |
trunk/src/mess/drivers/pcfx.c
| r29506 | r29507 | |
| 457 | 457 | } |
| 458 | 458 | |
| 459 | 459 | |
| 460 | | static const huc6261_interface pcfx_huc6261_config = |
| 461 | | { |
| 462 | | "huc6270_a", |
| 463 | | "huc6270_b" |
| 464 | | }; |
| 465 | | |
| 466 | | |
| 467 | 460 | void pcfx_state::machine_reset() |
| 468 | 461 | { |
| 469 | 462 | membank( "bank1" )->set_base( memregion("user1")->base() ); |
| r29506 | r29507 | |
| 492 | 485 | MCFG_DEVICE_ADD( "huc6270_a", HUC6270, 0 ) |
| 493 | 486 | MCFG_HUC6270_VRAM_SIZE(0x20000) |
| 494 | 487 | MCFG_HUC6270_IRQ_CHANGED_CB(WRITELINE(pcfx_state, irq12_w)) |
| 488 | |
| 495 | 489 | MCFG_DEVICE_ADD( "huc6270_b", HUC6270, 0 ) |
| 496 | 490 | MCFG_HUC6270_VRAM_SIZE(0x20000) |
| 497 | 491 | 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 ) |
| 500 | 492 | |
| 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 ) |
| 501 | 498 | MACHINE_CONFIG_END |
| 502 | 499 | |
| 503 | 500 | |