From 02dab0460f2b965b5023622127c55e674560ce82 Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Mon, 5 Apr 2021 00:15:01 -0700 Subject: Revert "ymfm: Latch the multi-frequency state at key on. Fixes sor2 punch sound on megadriv." This reverts commit 90d6b1b29e591fe81d8d29ef45a46918478dbba3. --- src/devices/sound/ymfm.cpp | 21 ++++----------------- src/devices/sound/ymfm.h | 3 +-- 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/src/devices/sound/ymfm.cpp b/src/devices/sound/ymfm.cpp index 9f84ef0dd75..7c32b1a2eab 100644 --- a/src/devices/sound/ymfm.cpp +++ b/src/devices/sound/ymfm.cpp @@ -1054,8 +1054,7 @@ void ymopm_registers::log_keyon(u32 choffs, u32 opoffs) template ymopn_registers_base::ymopn_registers_base() : m_lfo_counter(0), - m_lfo_am(0), - m_multi_freq(0) + m_lfo_am(0) { // create the waveforms for (int index = 0; index < WAVEFORM_LENGTH; index++) @@ -1074,7 +1073,6 @@ void ymopn_registers_base::save(device_t &device) { device.save_item(YMFM_NAME(m_lfo_counter)); device.save_item(YMFM_NAME(m_lfo_am)); - device.save_item(YMFM_NAME(m_multi_freq)); } device.save_item(YMFM_NAME(m_regdata)); } @@ -1179,22 +1177,11 @@ bool ymopn_registers_base::write(u16 index, u8 data, u32 &channel, u32 & // handle writes to the key on index if (index == 0x28) { - // channel in low 2 bits; channel 3 is not valid channel = BIT(data, 0, 2); if (channel == 3) return false; - - // upper channels for OPNA if (IsOpnA) channel += BIT(data, 2, 1) * 3; - - // when channel 2 key on hits, latch the multifrequency state - // megadriv sor2 flips the multi_freq bit on and off during playback - // of its sounds, specifically the punch sound - if (channel == 2) - m_multi_freq = multi_freq(); - - // operator mask is the top 4 bits opmask = BIT(data, 4, 4); return true; } @@ -1289,7 +1276,7 @@ void ymopn_registers_base::cache_operator_data(u32 choffs, u32 opoffs, y // if multi-frequency mode is enabled and this is channel 2, // fetch one of the special frequencies - if (m_multi_freq && choffs == 2) + if (multi_freq() && choffs == 2) { if (opoffs == 2) block_freq = cache.block_freq = multi_block_freq(1); @@ -1401,7 +1388,7 @@ void ymopn_registers_base::log_keyon(u32 choffs, u32 opoffs) u32 opnum = (opoffs & 15) - ((opoffs & 15) / 4) + 12 * BIT(opoffs, 8); u32 block_freq = ch_block_freq(choffs); - if (m_multi_freq && choffs == 2) + if (multi_freq() && choffs == 2) { if (opoffs == 2) block_freq = multi_block_freq(1); @@ -1440,7 +1427,7 @@ void ymopn_registers_base::log_keyon(u32 choffs, u32 opoffs) LOG(" pm=%d", ch_lfo_pm_sens(choffs)); if (am || pm) LOG(" lfo=%02X", lfo_rate()); - if (m_multi_freq && choffs == 2) + if (multi_freq() && choffs == 2) LOG(" multi=1"); } diff --git a/src/devices/sound/ymfm.h b/src/devices/sound/ymfm.h index 6fe1ff96eb3..8ab0ddc9d03 100644 --- a/src/devices/sound/ymfm.h +++ b/src/devices/sound/ymfm.h @@ -577,7 +577,7 @@ public: u32 lfo_rate() const { return IsOpnA ? byte(0x22, 0, 3) : 0; } u32 timer_a_value() const { return word(0x24, 0, 8, 0x25, 0, 2); } u32 timer_b_value() const { return byte(0x26, 0, 8); } - u32 csm() const { return byte(0x27, 7, 1); } + u32 csm() const { return (byte(0x27, 6, 2) == 2); } u32 multi_freq() const { return (byte(0x27, 6, 2) != 0); } u32 reset_timer_b() const { return byte(0x27, 5, 1); } u32 reset_timer_a() const { return byte(0x27, 4, 1); } @@ -629,7 +629,6 @@ protected: // internal state u32 m_lfo_counter; // LFO counter u8 m_lfo_am; // current LFO AM value - u8 m_multi_freq; // channel 2 is currently multi-frequency u8 m_regdata[REGISTERS]; // register data u16 m_waveform[WAVEFORMS][WAVEFORM_LENGTH]; // waveforms }; -- cgit v1.2.3