diff options
Diffstat (limited to 'src/devices/bus/wswan/rom.h')
-rw-r--r-- | src/devices/bus/wswan/rom.h | 47 |
1 files changed, 25 insertions, 22 deletions
diff --git a/src/devices/bus/wswan/rom.h b/src/devices/bus/wswan/rom.h index 9197cf98911..ae420667c8f 100644 --- a/src/devices/bus/wswan/rom.h +++ b/src/devices/bus/wswan/rom.h @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Wilbert Pol -#ifndef __WS_ROM_H -#define __WS_ROM_H +#ifndef MAME_BUS_WSWAN_ROM_H +#define MAME_BUS_WSWAN_ROM_H #include "slot.h" @@ -13,14 +13,8 @@ class ws_rom_device : public device_t, { public: // construction/destruction - ws_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source); ws_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // 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; - // reading and writing virtual DECLARE_READ8_MEMBER(read_rom20) override; virtual DECLARE_READ8_MEMBER(read_rom30) override; @@ -29,6 +23,15 @@ public: virtual DECLARE_WRITE8_MEMBER(write_io) override; protected: + static constexpr device_timer_id TIMER_RTC = 0; + + ws_rom_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + + // 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; + uint8_t m_io_regs[0x10]; uint32_t m_base20, m_base30, m_base40; @@ -43,7 +46,6 @@ protected: uint8_t m_rtc_second; /* Second */ uint8_t m_rtc_index; /* index for reading/writing of current of alarm time */ - static const device_timer_id TIMER_RTC = 0; emu_timer *rtc_timer; }; @@ -56,15 +58,16 @@ public: // construction/destruction ws_rom_sram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // device-level overrides - virtual void device_start() override; - virtual void device_reset() override; - // reading and writing virtual DECLARE_READ8_MEMBER(read_ram) override; virtual DECLARE_WRITE8_MEMBER(write_ram) override; virtual DECLARE_WRITE8_MEMBER(write_io) override; +protected: + // device-level overrides + virtual void device_start() override; + virtual void device_reset() override; + private: uint32_t m_nvram_base; }; @@ -78,14 +81,15 @@ public: // construction/destruction ws_rom_eeprom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // device-level overrides - virtual void device_start() override; - virtual void device_reset() override; - // reading and writing virtual DECLARE_READ8_MEMBER(read_io) override; virtual DECLARE_WRITE8_MEMBER(write_io) override; +protected: + // device-level overrides + virtual void device_start() override; + virtual void device_reset() override; + private: uint8_t m_eeprom_mode; /* eeprom mode */ uint16_t m_eeprom_address; /* Read/write address */ @@ -97,9 +101,8 @@ private: // device type definition -extern const device_type WS_ROM_STD; -extern const device_type WS_ROM_SRAM; -extern const device_type WS_ROM_EEPROM; - +DECLARE_DEVICE_TYPE(WS_ROM_STD, ws_rom_device) +DECLARE_DEVICE_TYPE(WS_ROM_SRAM, ws_rom_sram_device) +DECLARE_DEVICE_TYPE(WS_ROM_EEPROM, ws_rom_eeprom_device) -#endif +#endif // MAME_BUS_WSWAN_ROM_H |