summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices
diff options
context:
space:
mode:
author Michael Zapf <Michael.Zapf@mizapf.de>2016-04-20 00:23:28 +0200
committer Michael Zapf <Michael.Zapf@mizapf.de>2016-04-20 00:23:28 +0200
commit9eb11bdec72bbb9175a4358f46c174a7c832b1ba (patch)
tree37ba17dfcad1f00143cccd7517c099d2676cfcb9 /src/devices
parentc7aeff7d6d35e1478e015148b1d5dcc248e897be (diff)
Added general read/write methods to 9928a, allowing address lines to select functions
Diffstat (limited to 'src/devices')
-rw-r--r--src/devices/bus/ti99x/datamux.cpp24
-rw-r--r--src/devices/video/tms9928a.cpp19
-rw-r--r--src/devices/video/tms9928a.h3
3 files changed, 24 insertions, 22 deletions
diff --git a/src/devices/bus/ti99x/datamux.cpp b/src/devices/bus/ti99x/datamux.cpp
index 6cb44af8f53..996096a1a49 100644
--- a/src/devices/bus/ti99x/datamux.cpp
+++ b/src/devices/bus/ti99x/datamux.cpp
@@ -125,17 +125,7 @@ void ti99_datamux_device::read_all(address_space& space, UINT16 addr, UINT8 *val
if ((addr & 0xf801)==0x8800)
{
// Forward to VDP unless we have an EVPC
- if (m_video != nullptr)
- {
- if ((addr & 2) != 0)
- { // read VDP status
- *value = m_video->register_read(space, 0);
- }
- else
- { // read VDP RAM
- *value = m_video->vram_read(space, 0);
- }
- }
+ if (m_video != nullptr) *value = m_video->read(space, addr>>1); // A14 determines data or register read
}
}
@@ -174,17 +164,7 @@ void ti99_datamux_device::write_all(address_space& space, UINT16 addr, UINT8 val
if ((addr & 0xf801)==0x8800)
{
// Forward to VDP unless we have an EVPC
- if (m_video != nullptr)
- {
- if ((addr & 2) != 0)
- { // write VDP address/register
- m_video->register_write(space, 0, value);
- }
- else
- { // write VDP data
- m_video->vram_write(space, 0, value);
- }
- }
+ if (m_video != nullptr) m_video->write(space, addr>>1, value); // A14 determines data or register write
}
// PEB gets all accesses
diff --git a/src/devices/video/tms9928a.cpp b/src/devices/video/tms9928a.cpp
index fb8828e2cc1..5f4fcec92ec 100644
--- a/src/devices/video/tms9928a.cpp
+++ b/src/devices/video/tms9928a.cpp
@@ -112,6 +112,25 @@ tms9929a_device::tms9929a_device(const machine_config &mconfig, const char *tag,
: tms9928a_device( mconfig, TMS9929A, "TMS9929A", tag, owner, clock, true, true, true, "tms9929a", __FILE__)
{ }
+READ8_MEMBER( tms9928a_device::read )
+{
+ UINT8 value = 0;
+
+ if ((offset & 1) == 0)
+ value = vram_read(space, 0);
+ else
+ value = register_read(space, 0);
+
+ return value;
+}
+
+WRITE8_MEMBER( tms9928a_device::write )
+{
+ if ((offset & 1) == 0)
+ vram_write(space, 0, data);
+ else
+ register_write(space, 0, data);
+}
READ8_MEMBER( tms9928a_device::vram_read )
{
diff --git a/src/devices/video/tms9928a.h b/src/devices/video/tms9928a.h
index 21e7c9bf606..d05a2d936c4 100644
--- a/src/devices/video/tms9928a.h
+++ b/src/devices/video/tms9928a.h
@@ -92,6 +92,9 @@ public:
template<class _Object> static devcb_base &set_out_int_line_callback(device_t &device, _Object object) { return downcast<tms9928a_device &>(device).m_out_int_line_cb.set_callback(object); }
template<class _Object> static devcb_base &set_out_gromclk_callback(device_t &device, _Object object) { return downcast<tms9928a_device &>(device).m_out_gromclk_cb.set_callback(object); }
+ DECLARE_READ8_MEMBER( read );
+ DECLARE_WRITE8_MEMBER( write );
+
DECLARE_READ8_MEMBER( vram_read );
DECLARE_WRITE8_MEMBER( vram_write );
DECLARE_READ8_MEMBER( register_read );