summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/ds1386.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/machine/ds1386.h')
-rw-r--r--src/devices/machine/ds1386.h52
1 files changed, 33 insertions, 19 deletions
diff --git a/src/devices/machine/ds1386.h b/src/devices/machine/ds1386.h
index 17e01b9f458..f39b1b1f909 100644
--- a/src/devices/machine/ds1386.h
+++ b/src/devices/machine/ds1386.h
@@ -85,12 +85,12 @@ public:
auto intb() { return m_intb_cb.bind(); }
auto sqw() { return m_sqw_cb.bind(); }
- DECLARE_WRITE8_MEMBER( data_w );
- DECLARE_READ8_MEMBER( data_r );
+ void data_w(offs_t offset, uint8_t data);
+ uint8_t data_r(offs_t offset);
- DECLARE_WRITE_LINE_MEMBER( ce_w );
- DECLARE_WRITE_LINE_MEMBER( oe_w );
- DECLARE_WRITE_LINE_MEMBER( we_w );
+ void ce_w(int state);
+ void oe_w(int state);
+ void we_w(int state);
protected:
enum
@@ -124,38 +124,52 @@ protected:
ds1386_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, size_t size);
// device-level overrides
- virtual void device_start() override;
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) 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;
- static constexpr device_timer_id CLOCK_TIMER = 0;
- static constexpr device_timer_id SQUAREWAVE_TIMER = 1;
- static constexpr device_timer_id WATCHDOG_TIMER = 2;
- static constexpr device_timer_id INTA_TIMER = 3;
- static constexpr device_timer_id INTB_TIMER = 4;
-
protected:
+ enum
+ {
+ DISABLE_OSC = 0x80,
+ DISABLE_SQW = 0x40,
+
+ COMMAND_TE = 0x80,
+ COMMAND_IPSW = 0x40,
+ COMMAND_IBH_LO = 0x20,
+ COMMAND_PU_LVL = 0x10,
+ COMMAND_WAM = 0x08,
+ COMMAND_TDM = 0x04,
+ COMMAND_WAF = 0x02,
+ COMMAND_TDF = 0x01,
+
+ HOURS_12_24 = 0x40,
+ HOURS_AM_PM = 0x20
+ };
+
+
+ TIMER_CALLBACK_MEMBER(advance_hundredths);
+ TIMER_CALLBACK_MEMBER(square_tick);
+ TIMER_CALLBACK_MEMBER(watchdog_tick);
+ TIMER_CALLBACK_MEMBER(inta_timer_elapsed);
+ TIMER_CALLBACK_MEMBER(intb_timer_elapsed);
+
void safe_inta_cb(int state);
void safe_intb_cb(int state);
void safe_sqw_cb(int state);
- void set_current_time();
-
void check_tod_alarm();
void time_of_day_alarm();
void watchdog_alarm();
- void advance_hundredths();
-
void copy_ram_to_registers();
void copy_registers_to_ram();