diff options
Diffstat (limited to 'src/devices/machine/ds128x.cpp')
-rw-r--r-- | src/devices/machine/ds128x.cpp | 58 |
1 files changed, 57 insertions, 1 deletions
diff --git a/src/devices/machine/ds128x.cpp b/src/devices/machine/ds128x.cpp index 7a397aab303..91e022e07e7 100644 --- a/src/devices/machine/ds128x.cpp +++ b/src/devices/machine/ds128x.cpp @@ -10,7 +10,12 @@ DEFINE_DEVICE_TYPE(DS12885, ds12885_device, "ds12885", "DS12885 RTC/NVRAM") //------------------------------------------------- ds12885_device::ds12885_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : mc146818_device(mconfig, DS12885, tag, owner, clock) + : ds12885_device(mconfig, DS12885, tag, owner, clock) +{ +} + +ds12885_device::ds12885_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) + : mc146818_device(mconfig, type, tag, owner, clock) { } @@ -23,3 +28,54 @@ int ds12885_device::get_timer_bypass() return 22; // No tick } + +DEFINE_DEVICE_TYPE(DS12885EXT, ds12885ext_device, "ds12885ext", "DS12885 RTC/NVRAM size 256 bytes") + +//------------------------------------------------- +// ds12885ext_device - constructor +//------------------------------------------------- + +ds12885ext_device::ds12885ext_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : ds12885_device(mconfig, DS12885EXT, tag, owner, clock) +{ +} + +//------------------------------------------------- +// ds12885ext_device - handlers that allow acces to extended memory size +//------------------------------------------------- + +uint8_t ds12885ext_device::read_extended(offs_t offset) +{ + switch (offset) + { + case 0: + case 1: + return read(offset); + break; + case 2: + case 3: + return read(offset - 2); + break; + default: + return 0xff; + } +} + +void ds12885ext_device::write_extended(offs_t offset, uint8_t data) +{ + switch (offset) + { + case 0: + write(offset, data & 127); + break; + case 1: + write(offset, data); + break; + case 2: + write(offset - 2, data); + break; + case 3: + write(offset - 2, data); + break; + } +} |