From: Toni Wilen Date: Mon, 22 Jan 2024 16:50:43 +0000 (+0200) Subject: Increase AUDxPER if it is really low after sample has looped. X-Git-Tag: 5200~50 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=cf3eb4bfe4bac0372a0e0cbc6af2056c775ede6e;p=francis%2Fwinuae.git Increase AUDxPER if it is really low after sample has looped. --- diff --git a/audio.cpp b/audio.cpp index fd22650a..a03a4df5 100644 --- a/audio.cpp +++ b/audio.cpp @@ -56,6 +56,7 @@ #define PERIOD_MIN 1 #define PERIOD_MIN_NONCE 60 +#define PERIOD_MIN_LOOP 16 #define PERIOD_LOW 124 @@ -2469,6 +2470,10 @@ void event_audxdat_func(uae_u32 v) #endif if (cdp->wlen == 1) { cdp->wlen = cdp->len; + // if very low period sample repeats, set higher period value to not cause huge performance drop + if (cdp->per < PERIOD_MIN_LOOP * CYCLE_UNIT) { + cdp->per = PERIOD_MIN_LOOP * CYCLE_UNIT; + } cdp->intreq2 = true; if (sampleripper_enabled) do_samplerip(cdp);