summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Olivier Galibert <galibert@pobox.com>2020-03-16 22:24:07 +0100
committer Olivier Galibert <galibert@pobox.com>2020-03-16 22:24:25 +0100
commit4b0c51c2563d6b048ac37aeed561cf9b25116501 (patch)
tree10befa189e4bde8bcfdde793bf35307ec9cb1193
parentbad13d09e46fa200982c63ed6ed741797c23998f (diff)
ks0164: Z is set on bset/bclr (nw)
-rw-r--r--src/devices/cpu/ks0164/ks0164.cpp13
-rw-r--r--src/devices/sound/ks0164.cpp2
2 files changed, 12 insertions, 3 deletions
diff --git a/src/devices/cpu/ks0164/ks0164.cpp b/src/devices/cpu/ks0164/ks0164.cpp
index 966d037d1a9..d3de46b9267 100644
--- a/src/devices/cpu/ks0164/ks0164.cpp
+++ b/src/devices/cpu/ks0164/ks0164.cpp
@@ -403,7 +403,12 @@ void ks0164_cpu_device::execute_run()
case 2: {
// Bit set in register
// 1110 .rrr bbbb .001
- m_r[(opcode >> 8) & 7] |= 1 << ((opcode >> 4) & 0xf);
+ if(m_r[(opcode >> 8) & 7] & (1 << ((opcode >> 4) & 0xf)))
+ m_r[R_PSW] &= ~F_Z;
+ else {
+ m_r[R_PSW] |= F_Z;
+ m_r[(opcode >> 8) & 7] |= 1 << ((opcode >> 4) & 0xf);
+ }
break;
}
@@ -557,7 +562,11 @@ void ks0164_cpu_device::execute_run()
case 2: {
// Bit clear in register
// 1110 .rrr bbbb .001
- m_r[(opcode >> 8) & 7] &= ~(1 << ((opcode >> 4) & 0xf));
+ if(m_r[(opcode >> 8) & 7] & (1 << ((opcode >> 4) & 0xf))) {
+ m_r[(opcode >> 8) & 7] &= ~(1 << ((opcode >> 4) & 0xf));
+ m_r[R_PSW] &= ~F_Z;
+ } else
+ m_r[R_PSW] |= F_Z;
break;
}
diff --git a/src/devices/sound/ks0164.cpp b/src/devices/sound/ks0164.cpp
index 774081c6acc..6746fba18d2 100644
--- a/src/devices/sound/ks0164.cpp
+++ b/src/devices/sound/ks0164.cpp
@@ -234,7 +234,7 @@ u16 ks0164_device::voice_r(offs_t offset)
void ks0164_device::voice_w(offs_t offset, u16 data, u16 mem_mask)
{
COMBINE_DATA(&m_sregs[m_voice_select & 0x1f][offset]);
- if(m_cpu->pc() < 0x5f94 || m_cpu->pc() > 0x5fc0)
+ if(1 || m_cpu->pc() < 0x5f94 || m_cpu->pc() > 0x5fc0)
logerror("voice %02x.%02x = %04x (%04x)\n", m_voice_select & 0x1f, offset, m_sregs[m_voice_select & 0x1f][offset], m_cpu->pc());
}