1
0
Fork 0

Use a fixed cycle rate in auto cycles mode when calculating RDTSC. Improves Tie break Tennis 98

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3748
This commit is contained in:
Peter Veenstra 2011-08-30 13:15:36 +00:00
parent 173fb5510e
commit ee982d5754
2 changed files with 3 additions and 2 deletions

View file

@ -502,7 +502,7 @@ l_M_Ed:
continue;
case D_RDTSC: {
if (CPU_ArchitectureType<CPU_ARCHTYPE_PENTIUMSLOW) goto illegalopcode;
Bit64s tsc=(Bit64s)(PIC_FullIndex()*(double)CPU_CycleMax);
Bit64s tsc=(Bit64s)(PIC_FullIndex()*(double)(CPU_CycleAutoAdjust?70000:CPU_CycleMax));
reg_edx=(Bit32u)(tsc>>32);
reg_eax=(Bit32u)(tsc&0xffffffff);
break;

View file

@ -228,7 +228,8 @@
CASE_0F_B(0x31) /* RDTSC */
{
if (CPU_ArchitectureType<CPU_ARCHTYPE_PENTIUMSLOW) goto illegal_opcode;
Bit64s tsc=(Bit64s)(PIC_FullIndex()*(double)CPU_CycleMax);
/* Use a fixed number when in auto cycles mode as else the reported value changes constantly */
Bit64s tsc=(Bit64s)(PIC_FullIndex()*(double) (CPU_CycleAutoAdjust?70000:CPU_CycleMax));
reg_edx=(Bit32u)(tsc>>32);
reg_eax=(Bit32u)(tsc&0xffffffff);
}