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