mirror of
https://github.com/red-prig/fpPS4.git
synced 2024-11-23 06:19:57 +00:00
SetTimerResolution
This commit is contained in:
parent
9fd50a1618
commit
3dbab47637
@ -421,5 +421,16 @@ begin
|
||||
Result:=0;
|
||||
end;
|
||||
|
||||
Procedure Init;
|
||||
var
|
||||
min,max,cur:ULONG;
|
||||
begin
|
||||
NtQueryTimerResolution(@min,@max,@cur);
|
||||
NtSetTimerResolution(max,True,@cur);
|
||||
end;
|
||||
|
||||
initialization
|
||||
Init;
|
||||
|
||||
end.
|
||||
|
||||
|
@ -995,6 +995,8 @@ var
|
||||
|
||||
elap:QWORD;
|
||||
time:DWORD;
|
||||
|
||||
//t1,t2:QWORD;
|
||||
begin
|
||||
bufferIndex:=node^.u.bufferIndex;
|
||||
flipMode :=node^.u.flipMode ;
|
||||
@ -1094,16 +1096,22 @@ begin
|
||||
time:=0;
|
||||
end;
|
||||
|
||||
//SwSaveTime(t1);
|
||||
|
||||
ps4_usleep(time);
|
||||
//Sleep(_usec2msec(time));
|
||||
|
||||
//t2:=SwTimePassedUnits(t1);
|
||||
//t2:=(t2+9) div 10;
|
||||
//Writeln('elap=',elap,' time=',time,' usleep=',t2);
|
||||
|
||||
if (FGpuFlip<>nil) then
|
||||
begin
|
||||
//FGpuFlip.IsComplite(FcurrentBuffer);
|
||||
While (not FGpuFlip.IsComplite(FcurrentBuffer)) do
|
||||
begin
|
||||
ps4_usleep(150);
|
||||
end;
|
||||
FGpuFlip.IsComplite(FcurrentBuffer);
|
||||
//While (not FGpuFlip.IsComplite(FcurrentBuffer)) do
|
||||
//begin
|
||||
// ps4_usleep(150);
|
||||
//end;
|
||||
end;
|
||||
|
||||
end;
|
||||
|
@ -81,6 +81,18 @@ function NtQueryPerformanceCounter(
|
||||
Frequency:PLARGE_INTEGER
|
||||
):DWORD; stdcall; external 'ntdll';
|
||||
|
||||
function NtQueryTimerResolution(
|
||||
MinimumResolution:PULONG;
|
||||
MaximumResolution:PULONG;
|
||||
CurrentResolution:PULONG
|
||||
):DWORD; stdcall; external 'ntdll';
|
||||
|
||||
function NtSetTimerResolution(
|
||||
DesiredResolution:ULONG;
|
||||
SetResolution:BOOL;
|
||||
CurrentResolution:PULONG
|
||||
):DWORD; stdcall; external 'ntdll';
|
||||
|
||||
implementation
|
||||
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user