summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/rtc65271.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/machine/rtc65271.h')
-rw-r--r--src/devices/machine/rtc65271.h22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/devices/machine/rtc65271.h b/src/devices/machine/rtc65271.h
index 151344d6e7c..430af624c73 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
@@ -29,15 +32,21 @@ public:
uint8_t read(int xramsel, offs_t offset);
void write(int xramsel, offs_t offset, uint8_t data);
- DECLARE_READ_LINE_MEMBER(intrq_r);
+ int intrq_r();
protected:
// device-level overrides
virtual void device_start() override;
+
// 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:
void field_interrupts();
@@ -55,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;
@@ -63,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