diff options
Diffstat (limited to 'patches/dosbox-pure/0001-add-auto-cycle-limit.patch')
-rw-r--r-- | patches/dosbox-pure/0001-add-auto-cycle-limit.patch | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/patches/dosbox-pure/0001-add-auto-cycle-limit.patch b/patches/dosbox-pure/0001-add-auto-cycle-limit.patch new file mode 100644 index 0000000..69baeb9 --- /dev/null +++ b/patches/dosbox-pure/0001-add-auto-cycle-limit.patch @@ -0,0 +1,35 @@ +diff --git a/dosbox_pure_libretro.cpp b/dosbox_pure_libretro.cpp +index 6a03631..dc4f70d 100644 +--- a/dosbox_pure_libretro.cpp ++++ b/dosbox_pure_libretro.cpp +@@ -451,15 +451,30 @@ void DBP_SetRealModeCycles() + (year > 1993 ? 60000 : // Pentium 90 MHz + Cycles1981to1993[year - 1981]))); // Matching speed for year + ++#ifdef CYCLE_LIMIT ++ if (CPU_CycleMax > CYCLE_LIMIT) ++ { ++ CPU_CycleMax = CYCLE_LIMIT; ++ CPU_AutoDetermineMode &= ~(CPU_AUTODETERMINE_CYCLES|(CPU_AUTODETERMINE_CYCLES<<CPU_AUTODETERMINE_SHIFT)); ++ CPU_CycleAutoAdjust = true; ++ // Switch to dynamic core ++ if (CPU_AutoDetermineMode & CPU_AUTODETERMINE_CORE) ++ { ++#else ++ + // Switch to dynamic core for newer real mode games + if (CPU_CycleMax >= 8192 && (CPU_AutoDetermineMode & CPU_AUTODETERMINE_CORE)) + { ++#endif + #if (C_DYNAMIC_X86) + if (cpudecoder != CPU_Core_Dyn_X86_Run) { void CPU_Core_Dyn_X86_Cache_Init(bool); CPU_Core_Dyn_X86_Cache_Init(true); cpudecoder = CPU_Core_Dyn_X86_Run; } + #elif (C_DYNREC) + if (cpudecoder != CPU_Core_Dynrec_Run) { void CPU_Core_Dynrec_Cache_Init(bool); CPU_Core_Dynrec_Cache_Init(true); cpudecoder = CPU_Core_Dynrec_Run; } + #endif + } ++#ifdef CYCLE_LIMIT ++ } ++#endif + } + + static void DBP_UnlockSpeed(bool unlock, int start_frame_skip = 0, bool skip_once = false) |