trunk/src/mame/drivers/twinkle.c
| r29220 | r29221 | |
| 854 | 854 | } |
| 855 | 855 | } |
| 856 | 856 | |
| 857 | | static const rtc65271_interface twinkle_rtc = |
| 858 | | { |
| 859 | | DEVCB_NULL |
| 860 | | }; |
| 861 | 857 | |
| 862 | 858 | static MACHINE_CONFIG_START( twinkle, twinkle_state ) |
| 863 | 859 | /* basic machine hardware */ |
| r29220 | r29221 | |
| 883 | 879 | MCFG_ATA_INTERFACE_ADD("ata", ata_devices, "hdd", NULL, true) |
| 884 | 880 | MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE(twinkle_state, ide_interrupt)) |
| 885 | 881 | |
| 886 | | MCFG_RTC65271_ADD("rtc", twinkle_rtc) |
| 882 | MCFG_DEVICE_ADD("rtc", RTC65271, 0) |
| 887 | 883 | |
| 888 | 884 | /* video hardware */ |
| 889 | 885 | MCFG_PSXGPU_ADD( "maincpu", "gpu", CXD8561Q, 0x200000, XTAL_53_693175MHz ) |
trunk/src/mame/drivers/firebeat.c
| r29220 | r29221 | |
| 1723 | 1723 | m_layer = 0; |
| 1724 | 1724 | } |
| 1725 | 1725 | |
| 1726 | | const rtc65271_interface firebeat_rtc = |
| 1727 | | { |
| 1728 | | DEVCB_NULL |
| 1729 | | }; |
| 1730 | | |
| 1731 | 1726 | WRITE_LINE_MEMBER( firebeat_state::ata_interrupt ) |
| 1732 | 1727 | { |
| 1733 | 1728 | m_maincpu->set_input_line(INPUT_LINE_IRQ4, state); |
| r29220 | r29221 | |
| 1749 | 1744 | MCFG_MACHINE_START_OVERRIDE(firebeat_state,firebeat) |
| 1750 | 1745 | MCFG_MACHINE_RESET_OVERRIDE(firebeat_state,firebeat) |
| 1751 | 1746 | |
| 1752 | | MCFG_RTC65271_ADD("rtc", firebeat_rtc) |
| 1747 | MCFG_DEVICE_ADD("rtc", RTC65271, 0) |
| 1753 | 1748 | |
| 1754 | 1749 | MCFG_FUJITSU_29F016A_ADD("flash_main") |
| 1755 | 1750 | MCFG_FUJITSU_29F016A_ADD("flash_snd1") |
| r29220 | r29221 | |
| 1797 | 1792 | MCFG_MACHINE_START_OVERRIDE(firebeat_state,firebeat) |
| 1798 | 1793 | MCFG_MACHINE_RESET_OVERRIDE(firebeat_state,firebeat) |
| 1799 | 1794 | |
| 1800 | | MCFG_RTC65271_ADD("rtc", firebeat_rtc) |
| 1795 | MCFG_DEVICE_ADD("rtc", RTC65271, 0) |
| 1801 | 1796 | |
| 1802 | 1797 | MCFG_FUJITSU_29F016A_ADD("flash_main") |
| 1803 | 1798 | MCFG_FUJITSU_29F016A_ADD("flash_snd1") |
trunk/src/emu/machine/rtc65271.c
| r29220 | r29221 | |
| 449 | 449 | if (m_regs[reg_C] & m_regs[reg_B] & (reg_C_PF | reg_C_AF | reg_C_UF)) |
| 450 | 450 | { |
| 451 | 451 | m_regs[reg_C] |= reg_C_IRQF; |
| 452 | | if (!m_interrupt_func.isnull()) |
| 453 | | m_interrupt_func(1); |
| 452 | if (!m_interrupt_cb.isnull()) |
| 453 | m_interrupt_cb(1); |
| 454 | 454 | } |
| 455 | 455 | else |
| 456 | 456 | { |
| 457 | 457 | m_regs[reg_C] &= ~reg_C_IRQF; |
| 458 | | if (!m_interrupt_func.isnull()) |
| 459 | | m_interrupt_func(0); |
| 458 | if (!m_interrupt_cb.isnull()) |
| 459 | m_interrupt_cb(0); |
| 460 | 460 | } |
| 461 | 461 | } |
| 462 | 462 | |
| r29220 | r29221 | |
| 672 | 672 | |
| 673 | 673 | rtc65271_device::rtc65271_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 674 | 674 | : device_t(mconfig, RTC65271, "RTC65271", tag, owner, clock, "rtc65271", __FILE__), |
| 675 | | device_nvram_interface(mconfig, *this) |
| 675 | device_nvram_interface(mconfig, *this), |
| 676 | m_interrupt_cb(*this) |
| 676 | 677 | { |
| 677 | 678 | } |
| 678 | 679 | |
| 679 | 680 | //------------------------------------------------- |
| 680 | | // device_config_complete - perform any |
| 681 | | // operations now that the configuration is |
| 682 | | // complete |
| 683 | | //------------------------------------------------- |
| 684 | | |
| 685 | | void rtc65271_device::device_config_complete() |
| 686 | | { |
| 687 | | // inherit a copy of the static data |
| 688 | | const rtc65271_interface *intf = reinterpret_cast<const rtc65271_interface *>(static_config()); |
| 689 | | if (intf != NULL) |
| 690 | | *static_cast<rtc65271_interface *>(this) = *intf; |
| 691 | | |
| 692 | | // or initialize to defaults if none provided |
| 693 | | else |
| 694 | | { |
| 695 | | memset(&m_interrupt_cb, 0, sizeof(m_interrupt_cb)); |
| 696 | | } |
| 697 | | } |
| 698 | | |
| 699 | | //------------------------------------------------- |
| 700 | 681 | // device_start - device-specific startup |
| 701 | 682 | //------------------------------------------------- |
| 702 | 683 | void rtc65271_device::device_start() |
| r29220 | r29221 | |
| 704 | 685 | m_update_timer = machine().scheduler().timer_alloc(FUNC(rtc_begin_update_callback), (void *)this); |
| 705 | 686 | m_update_timer->adjust(attotime::from_seconds(1), 0, attotime::from_seconds(1)); |
| 706 | 687 | m_SQW_timer = machine().scheduler().timer_alloc(FUNC(rtc_SQW_callback), (void *)this); |
| 707 | | m_interrupt_func.resolve(m_interrupt_cb, *this); |
| 688 | m_interrupt_cb.resolve(); |
| 708 | 689 | |
| 709 | 690 | save_item(NAME(m_regs)); |
| 710 | 691 | save_item(NAME(m_cur_reg)); |
trunk/src/emu/machine/rtc65271.h
| r29220 | r29221 | |
| 9 | 9 | // INTERFACE CONFIGURATION MACROS |
| 10 | 10 | //************************************************************************** |
| 11 | 11 | |
| 12 | | #define MCFG_RTC65271_ADD(_tag, _config) \ |
| 13 | | MCFG_DEVICE_ADD(_tag, RTC65271, 0) \ |
| 14 | | MCFG_DEVICE_CONFIG(_config) |
| 15 | | // ======================> rtc65271_interface |
| 12 | #define MCFG_RTC65271_INTERRUPT_CB(_devcb) \ |
| 13 | devcb = &rtc65271_device::set_interrupt_callback(*device, DEVCB2_##_devcb); |
| 16 | 14 | |
| 17 | | struct rtc65271_interface |
| 18 | | { |
| 19 | | devcb_write_line m_interrupt_cb; |
| 20 | | }; |
| 21 | 15 | |
| 22 | 16 | // ======================> rtc65271_device |
| 23 | 17 | |
| 24 | 18 | class rtc65271_device : public device_t, |
| 25 | | public device_nvram_interface, |
| 26 | | public rtc65271_interface |
| 19 | public device_nvram_interface |
| 27 | 20 | { |
| 28 | 21 | public: |
| 29 | 22 | // construction/destruction |
| 30 | 23 | rtc65271_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 31 | 24 | protected: |
| 32 | 25 | // device-level overrides |
| 33 | | virtual void device_config_complete(); |
| 34 | 26 | virtual void device_start(); |
| 35 | 27 | // device_nvram_interface overrides |
| 36 | 28 | virtual void nvram_default(); |
| 37 | 29 | virtual void nvram_read(emu_file &file); |
| 38 | 30 | virtual void nvram_write(emu_file &file); |
| 39 | 31 | public: |
| 32 | |
| 33 | template<class _Object> static devcb2_base &set_interrupt_callback(device_t &device, _Object object) { return downcast<rtc65271_device &>(device).m_interrupt_cb.set_callback(object); } |
| 34 | |
| 40 | 35 | DECLARE_READ8_MEMBER( rtc_r ); |
| 41 | 36 | DECLARE_READ8_MEMBER( xram_r ); |
| 42 | 37 | DECLARE_WRITE8_MEMBER( rtc_w ); |
| r29220 | r29221 | |
| 70 | 65 | UINT8 m_SQW_internal_state; |
| 71 | 66 | |
| 72 | 67 | /* callback called when interrupt pin state changes (may be NULL) */ |
| 73 | | devcb_resolved_write_line m_interrupt_func; |
| 68 | devcb2_write_line m_interrupt_cb; |
| 74 | 69 | }; |
| 75 | 70 | |
| 76 | 71 | // device type definition |
trunk/src/emu/bus/ti99_peb/tn_ide.c
| r29220 | r29221 | |
| 5 | 5 | Thierry Nouspikel's IDE card emulation |
| 6 | 6 | |
| 7 | 7 | This card is just a prototype. It has been designed by Thierry Nouspikel, |
| 8 | | and its description was published in 2001. The card have been revised in |
| 8 | and its description was published in 2001. The card has been revised in |
| 9 | 9 | 2004. |
| 10 | 10 | |
| 11 | 11 | The specs have been published in <http://www.nouspikel.com/ti99/ide.html>. |
| r29220 | r29221 | |
| 332 | 332 | m_tms9995_mode = false; // (device->type()==TMS9995); |
| 333 | 333 | } |
| 334 | 334 | |
| 335 | | static const rtc65271_interface ide_rtc_cfg = |
| 336 | | { |
| 337 | | DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, nouspikel_ide_interface_device, clock_interrupt_callback) |
| 338 | | }; |
| 339 | | |
| 340 | 335 | MACHINE_CONFIG_FRAGMENT( tn_ide ) |
| 341 | | MCFG_RTC65271_ADD( "ide_rtc", ide_rtc_cfg ) |
| 336 | MCFG_DEVICE_ADD( "ide_rtc", RTC65271, 0 ) |
| 337 | MCFG_RTC65271_INTERRUPT_CB(WRITELINE(nouspikel_ide_interface_device, clock_interrupt_callback)) |
| 342 | 338 | MCFG_ATA_INTERFACE_ADD( "ata", ata_devices, "hdd", NULL, false) |
| 343 | 339 | MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE(nouspikel_ide_interface_device, ide_interrupt_callback)) |
| 344 | 340 | MACHINE_CONFIG_END |