summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/ds128x.cpp
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2019-03-26 11:13:37 +1100
committer Vas Crabb <vas@vastheman.com>2019-03-26 11:13:37 +1100
commit97b67170277437131adf6ed4d60139c172529e4f (patch)
tree7a5cbf608f191075f1612b1af15832c206a3fe2d /src/devices/machine/ds128x.cpp
parentb380514764cf857469bae61c11143a19f79a74c5 (diff)
(nw) Clean up the mess on master
This effectively reverts b380514764cf857469bae61c11143a19f79a74c5 and c24473ddff715ecec2e258a6eb38960cf8c8e98e, restoring the state at 598cd5227223c3b04ca31f0dbc1981256d9ea3ff. Before pushing, please check that what you're about to push is sane. Check your local commit log and ensure there isn't anything out-of-place before pushing to mainline. When things like this happen, it wastes everyone's time. I really don't need this in a week when real work™ is busting my balls and I'm behind where I want to be with preparing for MAME release.
Diffstat (limited to 'src/devices/machine/ds128x.cpp')
-rw-r--r--src/devices/machine/ds128x.cpp58
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;
+ }
+}