Protection against PIC index overflowing when changing cycles.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@684
This commit is contained in:
parent
733c4a51ca
commit
3e9e80ea13
1 changed files with 2 additions and 0 deletions
|
@ -40,12 +40,14 @@ CPU_Decoder * cpudecoder;
|
|||
static void CPU_CycleIncrease(void) {
|
||||
Bitu old_cycles=CPU_CycleMax;
|
||||
CPU_CycleMax=(Bitu)(CPU_CycleMax*1.2);
|
||||
CPU_CycleLeft=0;CPU_Cycles=0;
|
||||
if (CPU_CycleMax==old_cycles) CPU_CycleMax++;
|
||||
LOG_MSG("CPU:%d cycles",CPU_CycleMax);
|
||||
}
|
||||
|
||||
static void CPU_CycleDecrease(void) {
|
||||
CPU_CycleMax=(Bitu)(CPU_CycleMax/1.2);
|
||||
CPU_CycleLeft=0;CPU_Cycles=0;
|
||||
if (!CPU_CycleMax) CPU_CycleMax=1;
|
||||
LOG_MSG("CPU:%d cycles",CPU_CycleMax);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue