mirror of
https://github.com/holub/mame
synced 2025-07-05 01:48:29 +03:00
ay8910.cpp: Fix noise rate regression (#7283)
This commit is contained in:
parent
210d93e33f
commit
cfa4fa4ae4
@ -1125,8 +1125,9 @@ void ay8910_device::sound_stream_update(sound_stream &stream, std::vector<read_s
|
||||
* channels.
|
||||
*/
|
||||
m_count_noise = 0;
|
||||
m_prescale_noise ^= 1;
|
||||
|
||||
if (!m_prescale_noise)
|
||||
if (!m_prescale_noise || is_expanded_mode()) // AY8930 noise generator rate is twice compares as compatibility mode
|
||||
{
|
||||
/* The Random Number Generator of the 8910 is a 17-bit shift */
|
||||
/* register. The input to the shift register is bit0 XOR bit3 */
|
||||
@ -1135,9 +1136,7 @@ void ay8910_device::sound_stream_update(sound_stream &stream, std::vector<read_s
|
||||
// TODO : get actually algorithm for AY8930
|
||||
m_rng ^= (((m_rng & 1) ^ ((m_rng >> 3) & 1)) << 17);
|
||||
m_rng >>= 1;
|
||||
m_prescale_noise = 1;
|
||||
}
|
||||
m_prescale_noise--;
|
||||
}
|
||||
|
||||
for (int chan = 0; chan < NUM_CHANNELS; chan++)
|
||||
|
@ -268,7 +268,7 @@ private:
|
||||
inline u8 get_envelope_chan(int chan) { return is_expanded_mode() ? chan : 0; }
|
||||
|
||||
inline bool noise_enable(int chan) { return BIT(m_regs[AY_ENABLE], 3 + chan); }
|
||||
inline u8 noise_period() { return is_expanded_mode() ? m_regs[AY_NOISEPER] & 0xff : (m_regs[AY_NOISEPER] & 0x1f) << 1; }
|
||||
inline u8 noise_period() { return is_expanded_mode() ? m_regs[AY_NOISEPER] & 0xff : m_regs[AY_NOISEPER] & 0x1f; }
|
||||
inline u8 noise_output() { return m_rng & 1; }
|
||||
|
||||
inline bool is_expanded_mode() { return ((m_feature & PSG_HAS_EXPANDED_MODE) && ((m_mode & 0xe) == 0xa)); }
|
||||
|
Loading…
Reference in New Issue
Block a user