1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-25 18:30:21 +00:00

Eliminate a macro.

This commit is contained in:
Thomas Harte 2024-02-13 10:54:53 -05:00
parent 6dcc13921f
commit e06a66644c

View File

@ -111,20 +111,19 @@ void AY38910SampleSource<is_stereo>::set_output_mixing(float a_left, float b_lef
template <bool is_stereo>
void AY38910SampleSource<is_stereo>::advance() {
#define step_channel(c) \
if(tone_counters_[c]) tone_counters_[c]--;\
else {\
tone_outputs_[c] ^= 1;\
tone_counters_[c] = tone_periods_[c] << 1;\
}
const auto step_channel = [&](int c) {
if(tone_counters_[c]) --tone_counters_[c];
else {
tone_outputs_[c] ^= 1;
tone_counters_[c] = tone_periods_[c] << 1;
}
};
// Update the tone channels.
step_channel(0);
step_channel(1);
step_channel(2);
#undef step_channel
// Update the noise generator. This recomputes the new bit repeatedly but harmlessly, only shifting
// it into the official 17 upon divider underflow.
if(noise_counter_) noise_counter_--;