ymfm_opn: OPNA does not have 4 latches

This commit is contained in:
hap 2025-01-31 13:35:57 +01:00
parent d319a3aec9
commit 078322da16

View File

@ -143,15 +143,13 @@ bool opn_registers_base<IsOpnA>::write(uint16_t index, uint8_t data, uint32_t &c
assert(index < REGISTERS);
// writes in the 0xa0-af/0x1a0-af region are handled as latched pairs
// borrow unused registers 0xb8-bf/0x1b8-bf as temporary holding locations
// borrow unused registers 0xb8-bf as temporary holding locations
if ((index & 0xf0) == 0xa0)
{
if (bitfield(index, 0, 2) == 3)
return false;
uint32_t latchindex = 0xb8 | bitfield(index, 3);
if (IsOpnA)
latchindex |= index & 0x100;
// writes to the upper half just latch (only low 6 bits matter)
if (bitfield(index, 2))