summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine
diff options
context:
space:
mode:
author Olivier Galibert <galibert@pobox.com>2020-02-24 22:27:45 +0100
committer Olivier Galibert <galibert@pobox.com>2020-02-24 22:28:01 +0100
commit91c2cf74d945e6408218edde9d98fbe4ab17526b (patch)
tree54e1b5898d2e4cd7747f04820e95360ced51334e /src/devices/machine
parent16ec14f580f1f7f1bfb1b53a7dd6d833652001e2 (diff)
Possibly controversial i2cmem change, please lemme know if something breaks (nw)
Diffstat (limited to 'src/devices/machine')
-rw-r--r--src/devices/machine/i2cmem.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/devices/machine/i2cmem.cpp b/src/devices/machine/i2cmem.cpp
index f7ab143d5b9..c32bd578ff3 100644
--- a/src/devices/machine/i2cmem.cpp
+++ b/src/devices/machine/i2cmem.cpp
@@ -344,7 +344,13 @@ WRITE_LINE_MEMBER( i2cmem_device::write_scl )
switch( m_state )
{
case STATE_DEVSEL:
- m_devsel = m_shift;
+ if( m_shift & 1 )
+ {
+ verboselog( this, 1, "switching to read\n");
+ m_devsel &= 0x0e;
+ m_devsel |= (m_shift & 0xf1);
+ }
+ else m_devsel = m_shift;
if( !select_device() )
{
@@ -507,6 +513,13 @@ int i2cmem_device::select_device()
int device = ( m_slave_address & 0xf0 ) | ( m_e2 << 3 ) | ( m_e1 << 2 ) | ( m_e0 << 1 );
int mask = DEVSEL_ADDRESS & ~( address_mask() >> 7 );
+ if( m_devsel == 0 )
+ {
+ verboselog( this, 2, "acknowledging global call\n");
+ m_sdar = 0;
+ return 1;
+ }
+
if( ( m_devsel & mask ) == ( device & mask ) )
{
return 1;