summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author MetalliC <0vetal0@gmail.com>2017-05-22 18:51:49 +0300
committer MetalliC <0vetal0@gmail.com>2017-05-22 18:51:49 +0300
commit55c4a1252e946c113e97a035b8f2a75bc48aa805 (patch)
tree5c6170397fe8bb32c4cd1e2f3e30b84daaef4953
parent02a73b8048af41bc7bfa127b3070db97dd4f320e (diff)
minor STV ioga (nw)
-rw-r--r--src/mame/drivers/stv.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mame/drivers/stv.cpp b/src/mame/drivers/stv.cpp
index dd7349e47fc..f2ca4a3c1f5 100644
--- a/src/mame/drivers/stv.cpp
+++ b/src/mame/drivers/stv.cpp
@@ -116,8 +116,11 @@ READ8_MEMBER(stv_state::stv_ioga_r)
case 0x09: res = ioport("PORTE")->read(); break; // P3
case 0x0b: res = ioport("PORTF")->read(); break; // P4
case 0x0d:
- if (m_ioga_mode & 0x80)
- res = (ioport(portg[(m_ioga_portg >> 1) & 3])->read()) >> (((m_ioga_portg & 1) ^ 1) * 8); // PORT-G counter mode
+ if (m_ioga_mode & 0x80) // PORT-G in counter mode
+ {
+ res = (ioport(portg[(m_ioga_portg >> 1) & 3])->read()) >> (((m_ioga_portg & 1) ^ 1) * 8);
+ m_ioga_portg = (m_ioga_portg & 0xf8) | ((m_ioga_portg + 1) & 7); // counter# is auto-incremented then read
+ }
else
res = ioport("PORTG")->read();
break;
@@ -148,6 +151,7 @@ WRITE8_MEMBER(stv_state::stv_ioga_w)
machine().bookkeeping().coin_lockout_w(1,~data & 0x08);
break;
case 0x0d:
+ // then bit 7==0 - reset counters, currently this is unhandled, instead counters reset after each read (PORT_RESET used)
m_ioga_portg = data;
break;
case 0x1d: