From 61aacfef75a2be26a04716bb19bddd1d04a773c2 Mon Sep 17 00:00:00 2001 From: Michael Zapf Date: Sat, 7 May 2022 00:04:28 +0200 Subject: tms9995: Byte write to the decrementer fills the other byte with the same value. --- src/devices/cpu/tms9900/tms9995.cpp | 6 ++++-- 1 file 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; -- cgit v1.2.3