mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-11 01:00:20 +02:00
When I implemented TSC scaling originally, I chose a scale factor of 128 because it basically covered the range of devices we cared about without going too high. I also only tested devices that had a TSC scale factor from 19.2Mhz to 34Mhz. Turns out there is hardware that also has a 48Mhz cycle counter, which cause them to effectively have a 6.1Ghz cycle counter, which is kind of absurd. Instead of a fixed scale, just calculate the amount of scaling we need to get >= the minimum threshold of 1Ghz. This will change the shift from 7 to 5 or 6 for the faster cycle counter devices. Of course if someone wants to know the scale factor they can still use cpuid function 15h to know it. Fixes #4026