]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Increase AUDxPER if it is really low after sample has looped.
authorToni Wilen <twilen@winuae.net>
Mon, 22 Jan 2024 16:50:43 +0000 (18:50 +0200)
committerToni Wilen <twilen@winuae.net>
Mon, 22 Jan 2024 16:50:43 +0000 (18:50 +0200)
audio.cpp

index fd22650afa47f5e0dfe1fe42e876eceb651a299b..a03a4df56d939d2469931b3bf3734b9e343f6565 100644 (file)
--- 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);