summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--psg.c2
-rw-r--r--ym2612.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/psg.c b/psg.c
index 86c612d..48d220b 100644
--- a/psg.c
+++ b/psg.c
@@ -135,7 +135,7 @@ void psg_run(psg_context * context, uint32_t cycles)
context->accum = tmp >> 16;
context->buffer_fraction += context->buffer_inc;
- if (context->buffer_fraction >= BUFFER_INC_RES) {
+ while (context->buffer_fraction >= BUFFER_INC_RES) {
context->buffer_fraction -= BUFFER_INC_RES;
int32_t tmp = context->last_sample * ((context->buffer_fraction << 16) / context->buffer_inc);
tmp += context->accum * (0x10000 - ((context->buffer_fraction << 16) / context->buffer_inc));
diff --git a/ym2612.c b/ym2612.c
index 634d1e5..7049740 100644
--- a/ym2612.c
+++ b/ym2612.c
@@ -635,7 +635,7 @@ void ym_run(ym2612_context * context, uint32_t to_cycle)
left = tmp >> 16;
tmp = right * context->lowpass_alpha + context->last_right * (0x10000 - context->lowpass_alpha);
right = tmp >> 16;
- if (context->buffer_fraction > BUFFER_INC_RES) {
+ while (context->buffer_fraction > BUFFER_INC_RES) {
context->buffer_fraction -= BUFFER_INC_RES;
int64_t tmp = context->last_left * ((context->buffer_fraction << 16) / context->buffer_inc);