Skip to content

Commit 802bce3

Browse files
committed
ymfm_opn: apparently there is no internal flag when latch was written
1 parent a56c5f8 commit 802bce3

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

3rdparty/ymfm/src/ymfm_opn.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,14 +155,13 @@ bool opn_registers_base<IsOpnA>::write(uint16_t index, uint8_t data, uint32_t &c
155155

156156
// writes to the upper half just latch (only low 6 bits matter)
157157
if (bitfield(index, 2))
158-
m_regdata[latchindex] = data | 0x80;
158+
m_regdata[latchindex] = data & 0x3f;
159159

160-
// writes to the lower half only commit if the latch is there
161-
else if (bitfield(m_regdata[latchindex], 7))
160+
// writes to the lower half also apply said latch
161+
else
162162
{
163163
m_regdata[index] = data;
164-
m_regdata[index | 4] = m_regdata[latchindex] & 0x3f;
165-
m_regdata[latchindex] = 0;
164+
m_regdata[index | 4] = m_regdata[latchindex];
166165
}
167166
return false;
168167
}

0 commit comments

Comments
 (0)