summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/tms9900
diff options
context:
space:
mode:
author Michael Zapf <github@mizapf.de>2022-05-07 00:04:28 +0200
committer Michael Zapf <github@mizapf.de>2022-05-07 00:06:24 +0200
commit61aacfef75a2be26a04716bb19bddd1d04a773c2 (patch)
treea98b8c8bf303275159baffa7817ecd76eea97774 /src/devices/cpu/tms9900
parent6c4f4c2d45b9780ec6d3c066b1aa1f3824e9ff47 (diff)
tms9995: Byte write to the decrementer fills the other byte with the same value.
Diffstat (limited to 'src/devices/cpu/tms9900')
-rw-r--r--src/devices/cpu/tms9900/tms9995.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/devices/cpu/tms9900/tms9995.cpp b/src/devices/cpu/tms9900/tms9995.cpp
index e291cf238d6..4f7cc3db071 100644
--- a/src/devices/cpu/tms9900/tms9995.cpp
+++ b/src/devices/cpu/tms9900/tms9995.cpp
@@ -1954,8 +1954,10 @@ void tms9995_device::mem_write()
// will result in the data byte being written into the byte specifically addressed
// and random bits being written into the other byte of the decrementer."
- // So we just don't care about the low byte.
- if (m_address == 0xfffb) m_current_value >>= 8;
+ // Tests on a real 9995 show that both bytes have the same value
+ // after a byte operation
+ u16 decbyte = m_current_value & 0xff00;
+ m_current_value = decbyte | (decbyte >> 8);
// dito: "This also loads the Decrementing Register with the same count."
m_starting_count_storage_register = m_decrementer_value = m_current_value;