diff options
author | 2025-01-30 14:49:27 +0100 | |
---|---|---|
committer | 2025-01-30 14:49:27 +0100 | |
commit | 802bce33ebeb98d71a483112f9f7841ff1738f9b (patch) | |
tree | 43ee0717da4c016bb0c2788596cc4360bddd3172 /3rdparty | |
parent | a56c5f8afa8a356516c69eca2f856ddb6c8e68aa (diff) |
ymfm_opn: apparently there is no internal flag when latch was written
Diffstat (limited to '3rdparty')
-rw-r--r-- | 3rdparty/ymfm/src/ymfm_opn.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/3rdparty/ymfm/src/ymfm_opn.cpp b/3rdparty/ymfm/src/ymfm_opn.cpp index 16ca3416c69..60469e1c0d7 100644 --- a/3rdparty/ymfm/src/ymfm_opn.cpp +++ b/3rdparty/ymfm/src/ymfm_opn.cpp @@ -155,14 +155,13 @@ bool opn_registers_base<IsOpnA>::write(uint16_t index, uint8_t data, uint32_t &c // writes to the upper half just latch (only low 6 bits matter) if (bitfield(index, 2)) - m_regdata[latchindex] = data | 0x80; + m_regdata[latchindex] = data & 0x3f; - // writes to the lower half only commit if the latch is there - else if (bitfield(m_regdata[latchindex], 7)) + // writes to the lower half also apply said latch + else { m_regdata[index] = data; - m_regdata[index | 4] = m_regdata[latchindex] & 0x3f; - m_regdata[latchindex] = 0; + m_regdata[index | 4] = m_regdata[latchindex]; } return false; } |