Change scope of ratioremoved for logging. Introduce a hardcoded limit of 2000000, if no limit was specified in the options file. Thanks for all the help with loggging: leileilol, James-F, sndwv, BBP and P4R4D0X.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4043
This commit is contained in:
parent
a2d1450246
commit
da7ecfd83a
1 changed files with 6 additions and 4 deletions
|
@ -229,10 +229,11 @@ void increaseticks() { //Make it return ticksRemain and set it in the function a
|
|||
Bit32s ratio = (ticksScheduled * (CPU_CyclePercUsed*90*1024/100/100)) / ticksDone;
|
||||
Bit32s new_cmax = CPU_CycleMax;
|
||||
Bit64s cproc = (Bit64s)CPU_CycleMax * (Bit64s)ticksScheduled;
|
||||
double ratioremoved = 0.0; //increase scope for logging
|
||||
if (cproc > 0) {
|
||||
/* ignore the cycles added due to the IO delay code in order
|
||||
to have smoother auto cycle adjustments */
|
||||
double ratioremoved = (double) CPU_IODelayRemoved / (double) cproc;
|
||||
ratioremoved = (double) CPU_IODelayRemoved / (double) cproc;
|
||||
if (ratioremoved < 1.0) {
|
||||
double ratio_not_removed = 1 - ratioremoved;
|
||||
ratio = (Bit32s)((double)ratio * ratio_not_removed);
|
||||
|
@ -265,13 +266,14 @@ void increaseticks() { //Make it return ticksRemain and set it in the function a
|
|||
if (new_cmax < CPU_CYCLES_LOWER_LIMIT)
|
||||
new_cmax = CPU_CYCLES_LOWER_LIMIT;
|
||||
/*
|
||||
LOG(LOG_MISC,LOG_ERROR)("cyclelog: current %06d cmax %06d ratio %05d done %03d sched %03d Add %d",
|
||||
LOG(LOG_MISC,LOG_ERROR)("cyclelog: current %06d cmax %06d ratio %05d done %03d sched %03d Add %d rr %4.2f",
|
||||
CPU_CycleMax,
|
||||
new_cmax,
|
||||
ratio,
|
||||
ticksDone,
|
||||
ticksScheduled,
|
||||
ticksAdded);
|
||||
ticksAdded,
|
||||
ratioremoved);
|
||||
*/
|
||||
|
||||
/* ratios below 1% are considered to be dropouts due to
|
||||
|
@ -284,7 +286,7 @@ void increaseticks() { //Make it return ticksRemain and set it in the function a
|
|||
CPU_CycleMax = new_cmax;
|
||||
if (CPU_CycleLimit > 0) {
|
||||
if (CPU_CycleMax > CPU_CycleLimit) CPU_CycleMax = CPU_CycleLimit;
|
||||
}
|
||||
} else if (CPU_CycleMax > 2000000) CPU_CycleMax = 2000000; //Hardcoded limit, if no limit was specified.
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue