Ported the CPU fixes from PCem.

This commit is contained in:
OBattler
2020-11-20 01:28:36 +01:00
parent 1fc3ef5502
commit c10fc05ea6
2 changed files with 18 additions and 18 deletions

View File

@@ -281,11 +281,6 @@ exec386(int cycs)
}
}
ins_cycles -= cycles;
tsc += ins_cycles;
cycdiff = oldcyc - cycles;
if (smi_line)
enter_smm_check(0);
else if (trap) {
@@ -336,6 +331,11 @@ exec386(int cycs)
cpu_end_block_after_ins = 0;
ins_cycles -= cycles;
tsc += ins_cycles;
cycdiff = oldcyc - cycles;
if (timetolive) {
timetolive--;
if (!timetolive)

View File

@@ -756,19 +756,6 @@ exec386_dynarec(int cycs)
exec386_dynarec_dyn();
}
cycdiff = oldcyc - cycles;
delta = tsc - oldtsc;
if (delta > 0) {
/* TSC has changed, this means interim timer processing has happened,
see how much we still need to add. */
cycdiff -= delta;
if (cycdiff > 0)
tsc += cycdiff;
} else {
/* TSC has not changed. */
tsc += cycdiff;
}
if (cpu_state.abrt) {
flags_rebuild();
tempi = cpu_state.abrt & ABRT_MASK;
@@ -819,6 +806,19 @@ exec386_dynarec(int cycs)
}
}
cycdiff = oldcyc - cycles;
delta = tsc - oldtsc;
if (delta > 0) {
/* TSC has changed, this means interim timer processing has happened,
see how much we still need to add. */
cycdiff -= delta;
if (cycdiff > 0)
tsc += cycdiff;
} else {
/* TSC has not changed. */
tsc += cycdiff;
}
if (cycdiff > 0) {
if (TIMER_VAL_LESS_THAN_VAL(timer_target, (uint32_t) tsc))
timer_process_inline();