summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/ds1994.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/machine/ds1994.h')
-rw-r--r--src/devices/machine/ds1994.h33
1 files changed, 15 insertions, 18 deletions
diff --git a/src/devices/machine/ds1994.h b/src/devices/machine/ds1994.h
index a65f1b7d688..248fc6e8e90 100644
--- a/src/devices/machine/ds1994.h
+++ b/src/devices/machine/ds1994.h
@@ -30,19 +30,18 @@ class ds1994_device : public device_t, public device_nvram_interface
void ref_month(uint8_t month) { m_ref_month = month; }
void ref_day(uint8_t day) { m_ref_day = day; }
- DECLARE_WRITE_LINE_MEMBER(write);
- DECLARE_READ_LINE_MEMBER(read);
+ void write(int state);
+ int read();
protected:
// device-level overrides
virtual void device_start() override;
virtual void device_reset() override;
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) 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;
private:
enum {
@@ -65,12 +64,6 @@ class ds1994_device : public device_t, public device_nvram_interface
};
enum {
- TIMER_MAIN,
- TIMER_RESET,
- TIMER_CLOCK
- };
-
- enum {
STATE_IDLE,
STATE_RESET,
STATE_RESET1,
@@ -93,14 +86,20 @@ class ds1994_device : public device_t, public device_nvram_interface
STATE_COPY_SCRATCHPAD
};
- void ds1994_rom_cmd(void);
- void ds1994_cmd(void);
+ void handle_rom_cmd(void);
+ void handle_cmd(void);
bool one_wire_tx_bit(uint8_t value);
bool one_wire_rx_bit(void);
- uint8_t ds1994_readmem();
- void ds1994_writemem(uint8_t value);
+ uint8_t readmem();
+ void writemem(uint8_t value);
- emu_timer *m_timer_main, *m_timer_reset, *m_timer_clock;
+ TIMER_CALLBACK_MEMBER(main_tick);
+ TIMER_CALLBACK_MEMBER(reset_tick);
+ TIMER_CALLBACK_MEMBER(clock_tick);
+
+ emu_timer *m_timer_main;
+ emu_timer *m_timer_reset;
+ emu_timer *m_timer_clock;
uint32_t m_ref_year;
uint8_t m_ref_month;
@@ -124,8 +123,6 @@ class ds1994_device : public device_t, public device_nvram_interface
bool m_offs_ro;
attotime t_samp, t_rdv, t_rstl, t_pdh, t_pdl;
-
- inline void verboselog(int n_level, const char *s_fmt, ...) ATTR_PRINTF(3, 4);
};
// device type definition