diff options
Diffstat (limited to 'src/devices/machine/s3520cf.h')
-rw-r--r-- | src/devices/machine/s3520cf.h | 44 |
1 files changed, 29 insertions, 15 deletions
diff --git a/src/devices/machine/s3520cf.h b/src/devices/machine/s3520cf.h index e05e76ec85a..1b850df0688 100644 --- a/src/devices/machine/s3520cf.h +++ b/src/devices/machine/s3520cf.h @@ -18,11 +18,12 @@ Seiko/Epson S-3520CF // ======================> s3520cf_device -class s3520cf_device : public device_t +class s3520cf_device : public device_t, + public device_nvram_interface { public: // construction/destruction - s3520cf_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 32'768); + s3520cf_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 32'768); // I/O operations DECLARE_READ_LINE_MEMBER( read_bit ); @@ -33,41 +34,54 @@ public: TIMER_CALLBACK_MEMBER(timer_callback); protected: - enum state_t - { - RTC_SET_ADDRESS = 0, - RTC_SET_DATA - }; + s3520cf_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); struct rtc_regs_t { - uint8_t sec, min, hour, day, wday, month, year; + u8 sec, min, hour, day, wday, month, year; }; // device-level overrides virtual void device_validity_check(validity_checker &valid) const override; virtual void device_start() override; virtual void device_reset() override; - inline uint8_t rtc_read(uint8_t offset); - inline void rtc_write(uint8_t offset,uint8_t data); + + // 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; + + inline u8 rtc_read(u8 offset); + inline void rtc_write(u8 offset, u8 data); + void check_overflow(); int m_dir; int m_latch; int m_reset_line; int m_read_latch; - uint8_t m_current_cmd; - uint8_t m_cmd_stream_pos; - uint8_t m_rtc_addr; - uint8_t m_mode, m_sysr; + u8 m_bitstream, m_stream_pos; + u8 m_mode, m_sysr, m_cntrl1, m_cntrl2; - state_t m_rtc_state; rtc_regs_t m_rtc; + u8 m_nvdata[15]; emu_timer *m_timer; }; +/*************************************************************************** + +Epson RTC-4553 + +***************************************************************************/ + +class rtc4553_device : public s3520cf_device +{ +public: + rtc4553_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 32'768); +}; // device type definition DECLARE_DEVICE_TYPE(S3520CF, s3520cf_device) +DECLARE_DEVICE_TYPE(RTC4553, rtc4553_device) #endif // MAME_MACHINE_S3520CF_H |