mirror of
https://github.com/tildearrow/furnace.git
synced 2025-01-06 23:51:21 +00:00
AY: optimize
This commit is contained in:
parent
b238e9ee6d
commit
51cef18bff
1 changed files with 5 additions and 6 deletions
|
@ -1064,12 +1064,11 @@ void ay8910_device::sound_stream_update(short** outputs, int outLen)
|
|||
tone = &m_tone[chan];
|
||||
const int period = std::max<int>(1, tone->period) * (m_step_mul << 1);
|
||||
tone->count += is_expanded_mode() ? 32 : ((m_feature & PSG_HAS_EXPANDED_MODE) ? 1 : 2);
|
||||
while (tone->count >= period)
|
||||
{
|
||||
tone->duty_cycle = (tone->duty_cycle - 1) & 0x1f;
|
||||
tone->output = is_expanded_mode() ? BIT(duty_cycle[tone_duty(tone)], tone->duty_cycle) : BIT(tone->duty_cycle, 0);
|
||||
tone->count -= period;
|
||||
}
|
||||
if (tone->count>=period) {
|
||||
tone->duty_cycle = (tone->duty_cycle - (tone->count/period)) & 0x1f;
|
||||
tone->output = is_expanded_mode() ? BIT(duty_cycle[tone_duty(tone)], tone->duty_cycle) : BIT(tone->duty_cycle, 0);
|
||||
tone->count = tone->count % period;
|
||||
}
|
||||
}
|
||||
|
||||
const int period_noise = (int)(noise_period()) * m_step_mul;
|
||||
|
|
Loading…
Reference in a new issue