More buildfixes

This commit is contained in:
Henrik Rydgård 2024-07-26 15:22:35 +02:00
parent 9fb97add3f
commit 5c368cb965
3 changed files with 7 additions and 1 deletions

View file

@ -42,7 +42,7 @@ static double frequencyMult;
static LARGE_INTEGER startTime;
HANDLE Timer;
int SchedulerPeriodMs;
int SchedulerPeriodMs = 10;
INT64 QpcPerSecond;
void TimeInit() {
@ -52,10 +52,12 @@ void TimeInit() {
frequencyMult = 1.0 / static_cast<double>(frequency.QuadPart);
Timer = CreateWaitableTimerExW(NULL, NULL, CREATE_WAITABLE_TIMER_HIGH_RESOLUTION, TIMER_ALL_ACCESS);
#if !PPSSPP_PLATFORM(UWP)
TIMECAPS caps;
timeGetDevCaps(&caps, sizeof caps);
timeBeginPeriod(caps.wPeriodMin);
SchedulerPeriodMs = (int)caps.wPeriodMin;
#endif
}
double time_now_d() {
@ -269,6 +271,7 @@ void sleep_precise(double seconds) {
LARGE_INTEGER qpc;
QueryPerformanceCounter(&qpc);
INT64 targetQpc = (INT64)(qpc.QuadPart + seconds * QpcPerSecond);
if (Timer) { // Try using a high resolution timer first.
const double TOLERANCE = 0.001'02;
INT64 maxTicks = (INT64)SchedulerPeriodMs * 9'500;

View file

@ -41,6 +41,7 @@
#include <atomic>
#include <mutex>
#include <thread>
#include <climits>
#include "Common/Net/Resolve.h"
#include "Common/Serialize/Serializer.h"

View file

@ -65,6 +65,8 @@ PPSSPP_UWPMain::PPSSPP_UWPMain(App ^app, const std::shared_ptr<DX::DeviceResourc
app_(app),
m_deviceResources(deviceResources)
{
TimeInit();
// Register to be notified if the Device is lost or recreated
m_deviceResources->RegisterDeviceNotify(this);