diff options
author | Aaron Giles <aaron@aarongiles.com> | 2021-07-24 00:53:38 -0700 |
---|---|---|
committer | Aaron Giles <aaron@aarongiles.com> | 2021-07-24 00:53:38 -0700 |
commit | 3d450c480dc2528d5dd0e20c9bba673be32b10e0 (patch) | |
tree | caec03e523a9a70f6af5e45b1fc5fe0516feb724 | |
parent | 3e2915660f606e64d03921d7aad3bcb9de1dd55b (diff) |
ymf278b: Allow PCM writes if new2flag is set, even if newflag is not. Fixes MT08033.
-rw-r--r-- | 3rdparty/ymfm/src/ymfm_opl.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/3rdparty/ymfm/src/ymfm_opl.cpp b/3rdparty/ymfm/src/ymfm_opl.cpp index b1b5db9efc4..d037df7509b 100644 --- a/3rdparty/ymfm/src/ymfm_opl.cpp +++ b/3rdparty/ymfm/src/ymfm_opl.cpp @@ -1804,11 +1804,6 @@ void ymf278b::write_address_pcm(uint8_t data) { // just set the address m_address = data | 0x200; - - // YMF262, in compatibility mode, treats the upper bit as masked - // except for register 0x105; assuming YMF278B works the same way? - if (m_fm.regs().newflag() == 0 && m_address != 0x105) - m_address &= 0xff; } @@ -1819,14 +1814,21 @@ void ymf278b::write_address_pcm(uint8_t data) void ymf278b::write_data_pcm(uint8_t data) { + // ignore data writes if new2 is not yet set + if (m_fm.regs().new2flag() == 0) + return; + // write to FM if (bitfield(m_address, 9) != 0) - m_pcm.write(m_address & 0xff, data); + { + uint8_t addr = m_address & 0xff; + m_pcm.write(addr, data); - // writes to the waveform number cause loads to happen for "about 300usec" - // which is ~13 samples at the nominal output frequency of 44.1kHz - if (m_address >= 0x08 && m_address <= 0x1f) - m_load_remaining = 13; + // writes to the waveform number cause loads to happen for "about 300usec" + // which is ~13 samples at the nominal output frequency of 44.1kHz + if (addr >= 0x08 && addr <= 0x1f) + m_load_remaining = 13; + } // BUSY goes for 88 clocks on PCM writes m_fm.intf().ymfm_set_busy_end(88); |