tms9995: Byte write to the decrementer fills the other byte with the same value.

This commit is contained in:
Michael Zapf 2022-05-07 00:04:28 +02:00
parent 6c4f4c2d45
commit 61aacfef75

View File

@ -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;