diff options
Diffstat (limited to 'src/devices/machine/rtc65271.h')
-rw-r--r-- | src/devices/machine/rtc65271.h | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/src/devices/machine/rtc65271.h b/src/devices/machine/rtc65271.h index 1a69b518839..1166eefc267 100644 --- a/src/devices/machine/rtc65271.h +++ b/src/devices/machine/rtc65271.h @@ -9,11 +9,14 @@ #pragma once +#include "dirtc.h" + // ======================> rtc65271_device class rtc65271_device : public device_t, - public device_nvram_interface + public device_nvram_interface, + public device_rtc_interface { public: // construction/destruction @@ -26,17 +29,26 @@ public: void rtc_w(offs_t offset, uint8_t data); void xram_w(offs_t offset, uint8_t data); + uint8_t read(int xramsel, offs_t offset); + void write(int xramsel, offs_t offset, uint8_t data); + + int intrq_r(); + protected: // device-level overrides - virtual void device_start() override; + virtual void device_start() override ATTR_COLD; + // device_nvram_interface overrides virtual void nvram_default() override; - virtual void nvram_read(emu_file &file) override; - virtual void nvram_write(emu_file &file) override; + virtual bool nvram_read(util::read_stream &file) override; + virtual bool nvram_write(util::write_stream &file) override; + + // device_rtc_interface overrides + virtual bool rtc_feature_y2k() const override { return false; } + virtual bool rtc_feature_leap_year() const override { return true; } + virtual void rtc_clock_updated(int year, int month, int day, int day_of_week, int hour, int minute, int second) override; private: - uint8_t read(int xramsel, offs_t offset); - void write(int xramsel, offs_t offset, uint8_t data); void field_interrupts(); TIMER_CALLBACK_MEMBER(rtc_SQW_cb); @@ -52,7 +64,8 @@ private: uint8_t m_cur_xram_page; /* update timer: called every second */ - emu_timer *m_update_timer; + emu_timer *m_begin_update_timer = nullptr; + emu_timer *m_end_update_timer = nullptr; /* SQW timer: called every periodic clock half-period */ emu_timer *m_SQW_timer; @@ -60,6 +73,8 @@ private: /* callback called when interrupt pin state changes (may be nullptr) */ devcb_write_line m_interrupt_cb; + + optional_region_ptr<u8> m_default_data; }; // device type definition |