1
0
Fork 0

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
This commit is contained in:
Peter Veenstra 2017-09-02 10:23:38 +00:00
parent cfe3bd2ebc
commit 9be90ad587

View file

@ -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<double>(ratio)));
new_cmax = 1 + static_cast<Bit32s>(CPU_CycleMax * r);