From a9861c04f23665c1f69806eb0298479fcdf1cfe8 Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Thu, 18 Sep 2025 15:10:33 +0600 Subject: [PATCH] Actually fix OPL4 ID readbacks --- src/sound/ymfm/ymfm_opl.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/sound/ymfm/ymfm_opl.cpp b/src/sound/ymfm/ymfm_opl.cpp index b70102b65..99cddd05e 100644 --- a/src/sound/ymfm/ymfm_opl.cpp +++ b/src/sound/ymfm/ymfm_opl.cpp @@ -1716,8 +1716,14 @@ uint8_t ymf278b::read_status() uint8_t ymf278b::read_data_pcm() { // read from PCM - if (bitfield(m_address, 9) != 0) - return m_pcm.read(m_address & 0xff); + if (bitfield(m_address, 9) != 0) { + auto ret = m_pcm.read(m_address & 0xff); + if (m_address == 0x202) { + ret &= ~0xe0; + ret |= 0x20; + } + return ret; + } return 0; }