From 9be90ad5871565f62bc769d6e77642d3acb9428f Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Sat, 2 Sep 2017 10:23:38 +0000 Subject: [PATCH] When downscaling multiple times in a raw, ensure a minimum amount of strength Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4041 --- src/dosbox.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/dosbox.cpp b/src/dosbox.cpp index 82b2d1fa..2415f850 100644 --- a/src/dosbox.cpp +++ b/src/dosbox.cpp @@ -245,6 +245,10 @@ void increaseticks() { //Make it return ticksRemain and set it in the function a if (ticksScheduled >= 250 && ticksDone < 10 && ratio > 5120 && CPU_CycleMax > 50000) ratio = 5120; + // When downscaling multiple times in a row, ensure a minimum amount of downscaling + if (ticksAdded > 15 && ticksScheduled >= 5 && ticksScheduled <= 20 && ratio > 800) + ratio = 800; + if (ratio <= 1024) { double r = 2.0 /(1.0 + 1024.0/(static_cast(ratio))); new_cmax = 1 + static_cast(CPU_CycleMax * r);