mirror of
				https://git.suyu.dev/suyu/suyu
				synced 2025-10-31 07:59:02 -05:00 
			
		
		
		
	X64 Clock: Reduce accuracy to be less or equal to guest accuracy.
This commit is contained in:
		| @@ -62,7 +62,8 @@ u64 NativeClock::GetRTSC() { | ||||
|     } | ||||
|     accumulated_ticks += diff; | ||||
|     rtsc_serialize.unlock(); | ||||
|     return accumulated_ticks; | ||||
|     /// The clock cannot be more precise than the guest timer, remove the lower bits | ||||
|     return accumulated_ticks & inaccuracy_mask; | ||||
| } | ||||
|  | ||||
| void NativeClock::Pause(bool is_paused) { | ||||
|   | ||||
| @@ -31,6 +31,11 @@ public: | ||||
| private: | ||||
|     u64 GetRTSC(); | ||||
|  | ||||
|     /// value used to reduce the native clocks accuracy as some apss rely on | ||||
|     /// undefined behavior where the level of accuracy in the clock shouldn't | ||||
|     /// be higher. | ||||
|     static constexpr u64 inaccuracy_mask = ~(0x100 - 1); | ||||
|  | ||||
|     SpinLock rtsc_serialize{}; | ||||
|     u64 last_measure{}; | ||||
|     u64 accumulated_ticks{}; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Fernando Sahmkow
					Fernando Sahmkow