mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-02-12 17:48:43 +00:00
Merge pull request #13513 from hrydgard/clean-old-gunk
Delete the old Timer.cpp/h. Move some stuff to where it belongs.
This commit is contained in:
commit
9cf2c3e0f1
@ -439,7 +439,10 @@ add_library(Common STATIC
|
||||
Common/Crypto/sha256.cpp
|
||||
Common/Crypto/sha256.h
|
||||
Common/Data/Collections/ConstMap.h
|
||||
Common/Data/Collections/FixedSizeQueue.h
|
||||
Common/Data/Collections/Hashmaps.h
|
||||
Common/Data/Collections/TinySet.h
|
||||
Common/Data/Collections/ThreadSafeList.h
|
||||
Common/Data/Color/RGBAUtil.cpp
|
||||
Common/Data/Color/RGBAUtil.h
|
||||
Common/Data/Convert/SmallDataConvert.cpp
|
||||
@ -611,10 +614,8 @@ add_library(Common STATIC
|
||||
Common/ConsoleListener.h
|
||||
Common/DbgNew.h
|
||||
Common/FakeEmitter.h
|
||||
Common/FixedSizeQueue.h
|
||||
Common/ExceptionHandlerSetup.cpp
|
||||
Common/ExceptionHandlerSetup.h
|
||||
Common/Hashmaps.h
|
||||
Common/Log.h
|
||||
Common/Log.cpp
|
||||
Common/LogManager.cpp
|
||||
@ -633,11 +634,6 @@ add_library(Common STATIC
|
||||
Common/StringUtils.h
|
||||
Common/SysError.h
|
||||
Common/SysError.cpp
|
||||
Common/ThreadPools.cpp
|
||||
Common/ThreadPools.h
|
||||
Common/ThreadSafeList.h
|
||||
Common/Timer.cpp
|
||||
Common/Timer.h
|
||||
Common/TimeUtil.cpp
|
||||
Common/TimeUtil.h
|
||||
)
|
||||
@ -1775,6 +1771,8 @@ add_library(${CoreLibName} ${CoreLinkType}
|
||||
Core/System.h
|
||||
Core/TextureReplacer.cpp
|
||||
Core/TextureReplacer.h
|
||||
Core/ThreadPools.cpp
|
||||
Core/ThreadPools.h
|
||||
Core/Util/AudioFormat.cpp
|
||||
Core/Util/AudioFormat.h
|
||||
Core/Util/AudioFormatNEON.cpp
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include <cstring>
|
||||
|
||||
#include "Common/Arm64Emitter.h"
|
||||
#include "Common/MathUtil.h"
|
||||
#include "Common/Math/math_util.h"
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Common/CommonWindows.h"
|
||||
#include "Common/CPUDetect.h"
|
||||
|
@ -384,6 +384,9 @@
|
||||
<ClInclude Include="BitSet.h" />
|
||||
<ClInclude Include="Buffer.h" />
|
||||
<ClInclude Include="Data\Collections\ConstMap.h" />
|
||||
<ClInclude Include="Data\Collections\FixedSizeQueue.h" />
|
||||
<ClInclude Include="Data\Collections\Hashmaps.h" />
|
||||
<ClInclude Include="Data\Collections\ThreadSafeList.h" />
|
||||
<ClInclude Include="Data\Collections\TinySet.h" />
|
||||
<ClInclude Include="Data\Color\RGBAUtil.h" />
|
||||
<ClInclude Include="Data\Convert\SmallDataConvert.h" />
|
||||
@ -479,7 +482,6 @@
|
||||
<ClInclude Include="Crypto\sha256.h" />
|
||||
<ClInclude Include="DbgNew.h" />
|
||||
<ClInclude Include="ExceptionHandlerSetup.h" />
|
||||
<ClInclude Include="FixedSizeQueue.h" />
|
||||
<ClInclude Include="GL\GLInterfaceBase.h" />
|
||||
<ClInclude Include="GL\GLInterface\EGL.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
@ -502,12 +504,10 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">true</ExcludedFromBuild>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GraphicsContext.h" />
|
||||
<ClInclude Include="Hashmaps.h" />
|
||||
<ClInclude Include="Log.h" />
|
||||
<ClInclude Include="LogManager.h" />
|
||||
<ClInclude Include="MakeUnique.h" />
|
||||
<ClInclude Include="MachineContext.h" />
|
||||
<ClInclude Include="MathUtil.h" />
|
||||
<ClInclude Include="MemArena.h" />
|
||||
<ClInclude Include="MemoryUtil.h" />
|
||||
<ClInclude Include="MipsEmitter.h" />
|
||||
@ -519,14 +519,11 @@
|
||||
<ClInclude Include="System\Display.h" />
|
||||
<ClInclude Include="System\NativeApp.h" />
|
||||
<ClInclude Include="System\System.h" />
|
||||
<ClInclude Include="ThreadPools.h" />
|
||||
<ClInclude Include="ThreadSafeList.h" />
|
||||
<ClInclude Include="Thread\Executor.h" />
|
||||
<ClInclude Include="Thread\PrioritizedWorkQueue.h" />
|
||||
<ClInclude Include="Thread\ThreadPool.h" />
|
||||
<ClInclude Include="Thread\ThreadUtil.h" />
|
||||
<ClInclude Include="Thunk.h" />
|
||||
<ClInclude Include="Timer.h" />
|
||||
<ClInclude Include="TimeUtil.h" />
|
||||
<ClInclude Include="UI\Context.h" />
|
||||
<ClInclude Include="UI\Root.h" />
|
||||
@ -836,13 +833,11 @@
|
||||
<ClCompile Include="OSVersion.cpp" />
|
||||
<ClCompile Include="StringUtils.cpp" />
|
||||
<ClCompile Include="System\Display.cpp" />
|
||||
<ClCompile Include="ThreadPools.cpp" />
|
||||
<ClCompile Include="Thread\Executor.cpp" />
|
||||
<ClCompile Include="Thread\PrioritizedWorkQueue.cpp" />
|
||||
<ClCompile Include="Thread\ThreadPool.cpp" />
|
||||
<ClCompile Include="Thread\ThreadUtil.cpp" />
|
||||
<ClCompile Include="Thunk.cpp" />
|
||||
<ClCompile Include="Timer.cpp" />
|
||||
<ClCompile Include="TimeUtil.cpp" />
|
||||
<ClCompile Include="UI\Context.cpp" />
|
||||
<ClCompile Include="UI\Root.cpp" />
|
||||
|
@ -7,18 +7,15 @@
|
||||
<ClInclude Include="CommonTypes.h" />
|
||||
<ClInclude Include="ConsoleListener.h" />
|
||||
<ClInclude Include="CPUDetect.h" />
|
||||
<ClInclude Include="FixedSizeQueue.h" />
|
||||
<ClInclude Include="Log.h" />
|
||||
<ClInclude Include="LogManager.h" />
|
||||
<ClInclude Include="MemArena.h" />
|
||||
<ClInclude Include="MemoryUtil.h" />
|
||||
<ClInclude Include="StringUtils.h" />
|
||||
<ClInclude Include="Thunk.h" />
|
||||
<ClInclude Include="Timer.h" />
|
||||
<ClInclude Include="x64Analyzer.h" />
|
||||
<ClInclude Include="x64Emitter.h" />
|
||||
<ClInclude Include="ArmEmitter.h" />
|
||||
<ClInclude Include="ThreadPools.h" />
|
||||
<ClInclude Include="Crypto\md5.h">
|
||||
<Filter>Crypto</Filter>
|
||||
</ClInclude>
|
||||
@ -33,12 +30,10 @@
|
||||
<ClInclude Include="MipsEmitter.h" />
|
||||
<ClInclude Include="Arm64Emitter.h" />
|
||||
<ClInclude Include="ArmCommon.h" />
|
||||
<ClInclude Include="MathUtil.h" />
|
||||
<ClInclude Include="BitSet.h" />
|
||||
<ClInclude Include="CodeBlock.h" />
|
||||
<ClInclude Include="ColorConv.h" />
|
||||
<ClInclude Include="ColorConvNEON.h" />
|
||||
<ClInclude Include="ThreadSafeList.h" />
|
||||
<ClInclude Include="GL\GLInterface\EGL.h">
|
||||
<Filter>GL\GLInterface</Filter>
|
||||
</ClInclude>
|
||||
@ -51,7 +46,6 @@
|
||||
<ClInclude Include="GraphicsContext.h" />
|
||||
<ClInclude Include="DbgNew.h" />
|
||||
<ClInclude Include="OSVersion.h" />
|
||||
<ClInclude Include="Hashmaps.h" />
|
||||
<ClInclude Include="BitScan.h" />
|
||||
<ClInclude Include="MakeUnique.h" />
|
||||
<ClInclude Include="ExceptionHandlerSetup.h" />
|
||||
@ -372,6 +366,15 @@
|
||||
<ClInclude Include="Render\Text\draw_text_win.h">
|
||||
<Filter>Render\Text</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Data\Collections\FixedSizeQueue.h">
|
||||
<Filter>Data\Collections</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Data\Collections\Hashmaps.h">
|
||||
<Filter>Data\Collections</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Data\Collections\ThreadSafeList.h">
|
||||
<Filter>Data\Collections</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="ABI.cpp" />
|
||||
@ -381,12 +384,10 @@
|
||||
<ClCompile Include="MemoryUtil.cpp" />
|
||||
<ClCompile Include="StringUtils.cpp" />
|
||||
<ClCompile Include="Thunk.cpp" />
|
||||
<ClCompile Include="Timer.cpp" />
|
||||
<ClCompile Include="x64Analyzer.cpp" />
|
||||
<ClCompile Include="x64Emitter.cpp" />
|
||||
<ClCompile Include="ArmEmitter.cpp" />
|
||||
<ClCompile Include="ArmCPUDetect.cpp" />
|
||||
<ClCompile Include="ThreadPools.cpp" />
|
||||
<ClCompile Include="Crypto\md5.cpp">
|
||||
<Filter>Crypto</Filter>
|
||||
</ClCompile>
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#include "Common/Hashmaps.h"
|
||||
#include "Common/Data/Collections/Hashmaps.h"
|
||||
#include "Common/GPU/Vulkan/VulkanContext.h"
|
||||
#include "Common/Data/Convert/SmallDataConvert.h"
|
||||
#include "Common/Data/Collections/TinySet.h"
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
#include "Common/LogManager.h"
|
||||
#include "Common/ConsoleListener.h"
|
||||
#include "Common/Timer.h"
|
||||
#include "Common/TimeUtil.h"
|
||||
#include "Common/File/FileUtil.h"
|
||||
#include "Common/StringUtils.h"
|
||||
|
||||
@ -220,7 +220,7 @@ void LogManager::Log(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type, const
|
||||
}
|
||||
|
||||
std::lock_guard<std::mutex> lk(log_lock_);
|
||||
Common::Timer::GetTimeFormatted(message.timestamp);
|
||||
GetTimeFormatted(message.timestamp);
|
||||
|
||||
if (hleCurrentThreadName) {
|
||||
snprintf(message.header, sizeof(message.header), "%-12.12s %c[%s]: %s:%d",
|
||||
|
@ -62,6 +62,26 @@ inline T clamp_value(T val, T floor, T cap) {
|
||||
return val;
|
||||
}
|
||||
|
||||
#define ROUND_UP(x, a) (((x) + (a) - 1) & ~((a) - 1))
|
||||
#define ROUND_DOWN(x, a) ((x) & ~((a) - 1))
|
||||
|
||||
template<class T>
|
||||
inline void Clamp(T* val, const T& min, const T& max)
|
||||
{
|
||||
if (*val < min)
|
||||
*val = min;
|
||||
else if (*val > max)
|
||||
*val = max;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline T Clamp(const T val, const T& min, const T& max)
|
||||
{
|
||||
T ret = val;
|
||||
Clamp(&ret, min, max);
|
||||
return ret;
|
||||
}
|
||||
|
||||
union FP32 {
|
||||
uint32_t u;
|
||||
float f;
|
||||
|
@ -1,30 +0,0 @@
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace MathUtil
|
||||
{
|
||||
|
||||
#define ROUND_UP(x, a) (((x) + (a) - 1) & ~((a) - 1))
|
||||
#define ROUND_DOWN(x, a) ((x) & ~((a) - 1))
|
||||
|
||||
template<class T>
|
||||
inline void Clamp(T* val, const T& min, const T& max)
|
||||
{
|
||||
if (*val < min)
|
||||
*val = min;
|
||||
else if (*val > max)
|
||||
*val = max;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline T Clamp(const T val, const T& min, const T& max)
|
||||
{
|
||||
T ret = val;
|
||||
Clamp(&ret, min, max);
|
||||
return ret;
|
||||
}
|
||||
|
||||
}
|
@ -1,20 +1,23 @@
|
||||
#include <cstdio>
|
||||
#include <cstdint>
|
||||
#include <ctime>
|
||||
|
||||
#include "ppsspp_config.h"
|
||||
|
||||
#include "Common/TimeUtil.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#else
|
||||
#include <sys/time.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LIBNX
|
||||
#include <switch.h>
|
||||
#endif // HAVE_LIBNX
|
||||
|
||||
#include "Common/Log.h"
|
||||
#ifdef _WIN32
|
||||
#include "CommonWindows.h"
|
||||
#include <mmsystem.h>
|
||||
#include <sys/timeb.h>
|
||||
#else
|
||||
#include <sys/time.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
static double curtime = 0;
|
||||
|
||||
@ -64,3 +67,27 @@ void sleep_ms(int ms) {
|
||||
usleep(ms * 1000);
|
||||
#endif
|
||||
}
|
||||
|
||||
// Return the current time formatted as Minutes:Seconds:Milliseconds
|
||||
// in the form 00:00:000.
|
||||
void GetTimeFormatted(char formattedTime[13]) {
|
||||
time_t sysTime;
|
||||
struct tm * gmTime;
|
||||
char tmp[13];
|
||||
|
||||
time(&sysTime);
|
||||
gmTime = localtime(&sysTime);
|
||||
|
||||
strftime(tmp, 6, "%M:%S", gmTime);
|
||||
|
||||
// Now tack on the milliseconds
|
||||
#ifdef _WIN32
|
||||
struct timeb tp;
|
||||
(void)::ftime(&tp);
|
||||
snprintf(formattedTime, 13, "%s:%03i", tmp, tp.millitm);
|
||||
#else
|
||||
struct timeval t;
|
||||
(void)gettimeofday(&t, NULL);
|
||||
snprintf(formattedTime, 13, "%s:%03d", tmp, (int)(t.tv_usec / 1000));
|
||||
#endif
|
||||
}
|
||||
|
@ -5,3 +5,5 @@ double time_now_d();
|
||||
|
||||
// Sleep. Does not necessarily have millisecond granularity, especially on Windows.
|
||||
void sleep_ms(int ms);
|
||||
|
||||
void GetTimeFormatted(char formattedTime[13]);
|
||||
|
252
Common/Timer.cpp
252
Common/Timer.cpp
@ -1,252 +0,0 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0 or later versions.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#include <time.h>
|
||||
|
||||
#include "ppsspp_config.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "CommonWindows.h"
|
||||
#include <mmsystem.h>
|
||||
#include <sys/timeb.h>
|
||||
#else
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#include "Timer.h"
|
||||
#include "StringUtils.h"
|
||||
|
||||
namespace Common
|
||||
{
|
||||
|
||||
u32 Timer::GetTimeMs()
|
||||
{
|
||||
#if defined(_WIN32)
|
||||
#if PPSSPP_PLATFORM(UWP)
|
||||
return (u32)GetTickCount64();
|
||||
#else
|
||||
return timeGetTime();
|
||||
#endif
|
||||
#else
|
||||
// REALTIME is probably not a good idea for measuring updates.
|
||||
struct timeval t;
|
||||
(void)gettimeofday(&t, NULL);
|
||||
return ((u32)(t.tv_sec * 1000 + t.tv_usec / 1000));
|
||||
#endif
|
||||
}
|
||||
|
||||
// --------------------------------------------
|
||||
// Initiate, Start, Stop, and Update the time
|
||||
// --------------------------------------------
|
||||
|
||||
// Set initial values for the class
|
||||
Timer::Timer()
|
||||
: m_LastTime(0), m_StartTime(0), m_Running(false)
|
||||
{
|
||||
Update();
|
||||
|
||||
#ifdef _WIN32
|
||||
QueryPerformanceFrequency((LARGE_INTEGER*)&m_frequency);
|
||||
#endif
|
||||
}
|
||||
|
||||
// Write the starting time
|
||||
void Timer::Start()
|
||||
{
|
||||
m_StartTime = GetTimeMs();
|
||||
m_Running = true;
|
||||
}
|
||||
|
||||
// Stop the timer
|
||||
void Timer::Stop()
|
||||
{
|
||||
// Write the final time
|
||||
m_LastTime = GetTimeMs();
|
||||
m_Running = false;
|
||||
}
|
||||
|
||||
// Update the last time variable
|
||||
void Timer::Update()
|
||||
{
|
||||
m_LastTime = GetTimeMs();
|
||||
//TODO(ector) - QPF
|
||||
}
|
||||
|
||||
// -------------------------------------
|
||||
// Get time difference and elapsed time
|
||||
// -------------------------------------
|
||||
|
||||
// Get the number of milliseconds since the last Update()
|
||||
u64 Timer::GetTimeDifference() const
|
||||
{
|
||||
return GetTimeMs() - m_LastTime;
|
||||
}
|
||||
|
||||
// Add the time difference since the last Update() to the starting time.
|
||||
// This is used to compensate for a paused game.
|
||||
void Timer::AddTimeDifference()
|
||||
{
|
||||
m_StartTime += GetTimeDifference();
|
||||
}
|
||||
|
||||
// Wind back the starting time to a custom time
|
||||
void Timer::WindBackStartingTime(u64 WindBack)
|
||||
{
|
||||
m_StartTime += WindBack;
|
||||
}
|
||||
|
||||
// Get the time elapsed since the Start()
|
||||
u64 Timer::GetTimeElapsed() const
|
||||
{
|
||||
// If we have not started yet, return 1 (because then I don't
|
||||
// have to change the FPS calculation in CoreRerecording.cpp .
|
||||
if (m_StartTime == 0) return 1;
|
||||
|
||||
// Return the final timer time if the timer is stopped
|
||||
if (!m_Running) return (m_LastTime - m_StartTime);
|
||||
|
||||
return (GetTimeMs() - m_StartTime);
|
||||
}
|
||||
|
||||
// Get the formatted time elapsed since the Start()
|
||||
std::string Timer::GetTimeElapsedFormatted() const
|
||||
{
|
||||
// If we have not started yet, return zero
|
||||
if (m_StartTime == 0)
|
||||
return "00:00:00:000";
|
||||
|
||||
// The number of milliseconds since the start.
|
||||
// Use a different value if the timer is stopped.
|
||||
u64 Milliseconds;
|
||||
if (m_Running)
|
||||
Milliseconds = GetTimeMs() - m_StartTime;
|
||||
else
|
||||
Milliseconds = m_LastTime - m_StartTime;
|
||||
// Seconds
|
||||
u32 Seconds = (u32)(Milliseconds / 1000);
|
||||
// Minutes
|
||||
u32 Minutes = Seconds / 60;
|
||||
// Hours
|
||||
u32 Hours = Minutes / 60;
|
||||
|
||||
std::string TmpStr = StringFromFormat("%02d:%02d:%02d:%03d",
|
||||
Hours, Minutes % 60, Seconds % 60, Milliseconds % 1000);
|
||||
return TmpStr;
|
||||
}
|
||||
|
||||
// Get current time
|
||||
void Timer::IncreaseResolution()
|
||||
{
|
||||
#if defined(USING_WIN_UI)
|
||||
timeBeginPeriod(1);
|
||||
#endif
|
||||
}
|
||||
|
||||
void Timer::RestoreResolution()
|
||||
{
|
||||
#if defined(USING_WIN_UI)
|
||||
timeEndPeriod(1);
|
||||
#endif
|
||||
}
|
||||
|
||||
// Get the number of seconds since January 1 1970
|
||||
u64 Timer::GetTimeSinceJan1970()
|
||||
{
|
||||
time_t ltime;
|
||||
time(<ime);
|
||||
return((u64)ltime);
|
||||
}
|
||||
|
||||
u64 Timer::GetLocalTimeSinceJan1970()
|
||||
{
|
||||
time_t sysTime, tzDiff, tzDST;
|
||||
struct tm * gmTime;
|
||||
|
||||
time(&sysTime);
|
||||
|
||||
// Account for DST where needed
|
||||
gmTime = localtime(&sysTime);
|
||||
if(gmTime->tm_isdst == 1)
|
||||
tzDST = 3600;
|
||||
else
|
||||
tzDST = 0;
|
||||
|
||||
// Lazy way to get local time in sec
|
||||
gmTime = gmtime(&sysTime);
|
||||
tzDiff = sysTime - mktime(gmTime);
|
||||
|
||||
return (u64)(sysTime + tzDiff + tzDST);
|
||||
}
|
||||
|
||||
// Return the current time formatted as Minutes:Seconds:Milliseconds
|
||||
// in the form 00:00:000.
|
||||
void Timer::GetTimeFormatted(char formattedTime[13])
|
||||
{
|
||||
time_t sysTime;
|
||||
struct tm * gmTime;
|
||||
char tmp[13];
|
||||
|
||||
time(&sysTime);
|
||||
gmTime = localtime(&sysTime);
|
||||
|
||||
strftime(tmp, 6, "%M:%S", gmTime);
|
||||
|
||||
// Now tack on the milliseconds
|
||||
#ifdef _WIN32
|
||||
struct timeb tp;
|
||||
(void)::ftime(&tp);
|
||||
snprintf(formattedTime, 13, "%s:%03i", tmp, tp.millitm);
|
||||
#else
|
||||
struct timeval t;
|
||||
(void)gettimeofday(&t, NULL);
|
||||
snprintf(formattedTime, 13, "%s:%03d", tmp, (int)(t.tv_usec / 1000));
|
||||
#endif
|
||||
}
|
||||
|
||||
// Returns a timestamp with decimals for precise time comparisons
|
||||
// ----------------
|
||||
double Timer::GetDoubleTime()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
struct timeb tp;
|
||||
(void)::ftime(&tp);
|
||||
#else
|
||||
struct timeval t;
|
||||
(void)gettimeofday(&t, NULL);
|
||||
#endif
|
||||
// Get continuous timestamp
|
||||
u64 TmpSeconds = Common::Timer::GetTimeSinceJan1970();
|
||||
|
||||
// Remove a few years. We only really want enough seconds to make
|
||||
// sure that we are detecting actual actions, perhaps 60 seconds is
|
||||
// enough really, but I leave a year of seconds anyway, in case the
|
||||
// user's clock is incorrect or something like that.
|
||||
TmpSeconds = TmpSeconds - (38 * 365 * 24 * 60 * 60);
|
||||
|
||||
// Make a smaller integer that fits in the double
|
||||
u32 Seconds = (u32)TmpSeconds;
|
||||
#ifdef _WIN32
|
||||
double ms = tp.millitm / 1000.0 / 1000.0;
|
||||
#else
|
||||
double ms = t.tv_usec / 1000000.0;
|
||||
#endif
|
||||
double TmpTime = Seconds + ms;
|
||||
|
||||
return TmpTime;
|
||||
}
|
||||
|
||||
} // Namespace Common
|
@ -1,60 +0,0 @@
|
||||
// Copyright (C) 2003 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0 or later versions.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Common.h"
|
||||
#include <string>
|
||||
|
||||
namespace Common
|
||||
{
|
||||
class Timer
|
||||
{
|
||||
public:
|
||||
Timer();
|
||||
|
||||
void Start();
|
||||
void Stop();
|
||||
void Update();
|
||||
|
||||
// The time difference is always returned in milliseconds, regardless of alternative internal representation
|
||||
u64 GetTimeDifference() const;
|
||||
void AddTimeDifference();
|
||||
void WindBackStartingTime(u64 WindBack);
|
||||
|
||||
static void IncreaseResolution();
|
||||
static void RestoreResolution();
|
||||
static u64 GetTimeSinceJan1970();
|
||||
static u64 GetLocalTimeSinceJan1970();
|
||||
static double GetDoubleTime();
|
||||
|
||||
static void GetTimeFormatted(char formattedTime[13]);
|
||||
std::string GetTimeElapsedFormatted() const;
|
||||
u64 GetTimeElapsed() const;
|
||||
|
||||
static u32 GetTimeMs();
|
||||
|
||||
private:
|
||||
u64 m_LastTime;
|
||||
u64 m_StartTime;
|
||||
#ifdef _WIN32
|
||||
u64 m_frequency;
|
||||
#endif
|
||||
bool m_Running;
|
||||
};
|
||||
|
||||
} // Namespace Common
|
@ -396,7 +396,9 @@ std::string CreateRandMAC() {
|
||||
}
|
||||
|
||||
static int DefaultNumWorkers() {
|
||||
return cpu_info.num_cores;
|
||||
// Let's cap the global thread pool at 16 threads. Nothing we do really should have much
|
||||
// use for more...
|
||||
return std::min(16, cpu_info.num_cores);
|
||||
}
|
||||
|
||||
static int DefaultCpuCore() {
|
||||
|
@ -898,6 +898,7 @@
|
||||
<ClCompile Include="MIPS\MIPSStackWalk.cpp" />
|
||||
<ClCompile Include="Screenshot.cpp" />
|
||||
<ClCompile Include="System.cpp" />
|
||||
<ClCompile Include="ThreadPools.cpp" />
|
||||
<ClCompile Include="Util\AudioFormat.cpp" />
|
||||
<ClCompile Include="Util\AudioFormatNEON.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
@ -1245,6 +1246,7 @@
|
||||
<ClInclude Include="Screenshot.h" />
|
||||
<ClInclude Include="System.h" />
|
||||
<ClInclude Include="ThreadEventQueue.h" />
|
||||
<ClInclude Include="ThreadPools.h" />
|
||||
<ClInclude Include="Util\AudioFormat.h" />
|
||||
<ClInclude Include="Util\AudioFormatNEON.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
@ -1298,4 +1300,4 @@
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
</Project>
|
@ -962,6 +962,9 @@
|
||||
<ClCompile Include="KeyMap.cpp">
|
||||
<Filter>Core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ThreadPools.cpp">
|
||||
<Filter>Core</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="ELF\ElfReader.h">
|
||||
@ -1643,6 +1646,9 @@
|
||||
<ClInclude Include="KeyMap.h">
|
||||
<Filter>Core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="ThreadPools.h">
|
||||
<Filter>Core</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="CMakeLists.txt" />
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Common/Serialize/Serializer.h"
|
||||
#include "Common/Serialize/SerializeFuncs.h"
|
||||
#include "Common/FixedSizeQueue.h"
|
||||
#include "Common/Data/Collections/FixedSizeQueue.h"
|
||||
|
||||
#ifdef _M_SSE
|
||||
#include <emmintrin.h>
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
#include "Common/Serialize/Serializer.h"
|
||||
#include "Common/Serialize/SerializeFuncs.h"
|
||||
#include "Common/FixedSizeQueue.h"
|
||||
#include "Common/Data/Collections/FixedSizeQueue.h"
|
||||
#include "Core/MIPS/MIPS.h"
|
||||
#include "Core/Host.h"
|
||||
#include "Core/CoreTiming.h"
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include "Common/Serialize/SerializeFuncs.h"
|
||||
#include "Common/Serialize/SerializeList.h"
|
||||
#include "Common/Serialize/SerializeMap.h"
|
||||
#include "Common/ThreadSafeList.h"
|
||||
#include "Common/Data/Collections/ThreadSafeList.h"
|
||||
#include "Core/HLE/HLE.h"
|
||||
#include "Core/HLE/FunctionWrappers.h"
|
||||
#include "Core/MIPS/MIPS.h"
|
||||
|
@ -36,7 +36,7 @@
|
||||
#include <atomic>
|
||||
|
||||
#include "Common/System/System.h"
|
||||
#include "Common/MathUtil.h"
|
||||
#include "Common/Math/math_util.h"
|
||||
#include "Common/Serialize/Serializer.h"
|
||||
#include "Common/Log.h"
|
||||
#include "Common/TimeUtil.h"
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Common/Hashmaps.h"
|
||||
#include "Common/Data/Collections/Hashmaps.h"
|
||||
|
||||
#include "GPU/GPUState.h"
|
||||
#include "GPU/Common/GPUDebugInterface.h"
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include "Common/Common.h"
|
||||
#include "Common/Log.h"
|
||||
#include "Common/CommonFuncs.h"
|
||||
#include "Common/ThreadPools.h"
|
||||
#include "Core/ThreadPools.h"
|
||||
#include "Common/CPUDetect.h"
|
||||
#include "ext/xbrz/xbrz.h"
|
||||
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include "ppsspp_config.h"
|
||||
|
||||
#include "Common/Common.h"
|
||||
#include "Common/Hashmaps.h"
|
||||
#include "Common/Data/Collections/Hashmaps.h"
|
||||
#include "Common/Log.h"
|
||||
#include "Core/Reporting.h"
|
||||
#include "GPU/ge_constants.h"
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include <d3d11.h>
|
||||
#include <d3d11_1.h>
|
||||
|
||||
#include "Common/Hashmaps.h"
|
||||
#include "Common/Data/Collections/Hashmaps.h"
|
||||
#include "GPU/GPUState.h"
|
||||
#include "GPU/Common/GPUDebugInterface.h"
|
||||
#include "GPU/Common/IndexGenerator.h"
|
||||
|
@ -19,13 +19,13 @@
|
||||
#include <d3d11.h>
|
||||
#include <D3Dcompiler.h>
|
||||
|
||||
#include "Common/Common.h"
|
||||
#include "Common/System/Display.h"
|
||||
#include "Common/Math/lin/matrix4x4.h"
|
||||
#include "Common/Math/math_util.h"
|
||||
#include "Common/GPU/thin3d.h"
|
||||
|
||||
#include "Common/Common.h"
|
||||
#include "Common/ColorConv.h"
|
||||
#include "Common/MathUtil.h"
|
||||
|
||||
#include "Core/MemMap.h"
|
||||
#include "Core/Config.h"
|
||||
#include "Core/ConfigValues.h"
|
||||
@ -34,7 +34,6 @@
|
||||
#include "GPU/ge_constants.h"
|
||||
#include "GPU/GPUState.h"
|
||||
#include "GPU/Debugger/Stepping.h"
|
||||
|
||||
#include "GPU/Common/FramebufferManagerCommon.h"
|
||||
#include "GPU/Common/PresentationCommon.h"
|
||||
#include "GPU/Common/ShaderTranslation.h"
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
#include <d3d11.h>
|
||||
#include "Common/ColorConv.h"
|
||||
#include "Common/ThreadPools.h"
|
||||
#include "Core/ThreadPools.h"
|
||||
#include "GPU/Common/TextureScalerCommon.h"
|
||||
#include "GPU/D3D11/TextureScalerD3D11.h"
|
||||
#include "GPU/D3D11/GPU_D3D11.h"
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
#include <d3d9.h>
|
||||
|
||||
#include "Common/Hashmaps.h"
|
||||
#include "Common/Data/Collections/Hashmaps.h"
|
||||
#include "GPU/GPUState.h"
|
||||
#include "GPU/Common/GPUDebugInterface.h"
|
||||
#include "GPU/Common/IndexGenerator.h"
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
#include "Common/Common.h"
|
||||
#include "Common/ColorConv.h"
|
||||
#include "Common/ThreadPools.h"
|
||||
#include "Core/ThreadPools.h"
|
||||
#include "GPU/Common/TextureScalerCommon.h"
|
||||
#include "GPU/Directx9/TextureScalerDX9.h"
|
||||
#include "GPU/Directx9/GPU_DX9.h"
|
||||
|
@ -17,8 +17,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <Common/Hashmaps.h>
|
||||
#include <unordered_map>
|
||||
#include "Common/Data/Collections/Hashmaps.h"
|
||||
#include "Common/GPU/OpenGL/GLCommon.h"
|
||||
#include "Common/GPU/OpenGL/GLRenderManager.h"
|
||||
|
||||
#include "GPU/GPUState.h"
|
||||
#include "GPU/Common/GPUDebugInterface.h"
|
||||
@ -27,8 +28,6 @@
|
||||
#include "GPU/Common/DrawEngineCommon.h"
|
||||
#include "GPU/Common/GPUStateUtils.h"
|
||||
#include "GPU/GLES/FragmentShaderGeneratorGLES.h"
|
||||
#include "Common/GPU/OpenGL/GLCommon.h"
|
||||
#include "Common/GPU/OpenGL/GLRenderManager.h"
|
||||
|
||||
class LinkedShader;
|
||||
class ShaderManagerGLES;
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "Common/Hashmaps.h"
|
||||
#include "Common/Data/Collections/Hashmaps.h"
|
||||
#include "Common/GPU/OpenGL/GLRenderManager.h"
|
||||
#include "GPU/Common/ShaderCommon.h"
|
||||
#include "GPU/Common/ShaderId.h"
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include "GPU/GLES/TextureScalerGLES.h"
|
||||
#include "Common/ColorConv.h"
|
||||
#include "Common/Log.h"
|
||||
#include "Common/ThreadPools.h"
|
||||
#include "Core/ThreadPools.h"
|
||||
#include "Common/GPU/DataFormat.h"
|
||||
|
||||
int TextureScalerGLES::BytesPerPixel(u32 format) {
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
#include "Common/Profiler/Profiler.h"
|
||||
|
||||
#include "Common/ThreadPools.h"
|
||||
#include "Core/ThreadPools.h"
|
||||
#include "Common/ColorConv.h"
|
||||
#include "Core/Config.h"
|
||||
#include "Core/MemMap.h"
|
||||
|
@ -31,7 +31,7 @@
|
||||
// The format of the various uniform buffers may vary though - vertex shaders that don't skin
|
||||
// won't get any bone data, etc.
|
||||
|
||||
#include "Common/Hashmaps.h"
|
||||
#include "Common/Data/Collections/Hashmaps.h"
|
||||
|
||||
#include "GPU/Vulkan/VulkanUtil.h"
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstring>
|
||||
#include "Common/Hashmaps.h"
|
||||
#include "Common/Data/Collections/Hashmaps.h"
|
||||
|
||||
#include "GPU/Common/VertexDecoderCommon.h"
|
||||
#include "GPU/Common/ShaderId.h"
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include <cstdio>
|
||||
#include <cstdint>
|
||||
|
||||
#include "Common/Hashmaps.h"
|
||||
#include "Common/Data/Collections/Hashmaps.h"
|
||||
#include "Common/GPU/Vulkan/VulkanMemory.h"
|
||||
#include "GPU/Common/ShaderCommon.h"
|
||||
#include "GPU/Common/ShaderId.h"
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "Common/Hashmaps.h"
|
||||
#include "Common/Data/Collections/Hashmaps.h"
|
||||
#include "GPU/GPUInterface.h"
|
||||
#include "GPU/GPUState.h"
|
||||
#include "Common/GPU/Vulkan/VulkanContext.h"
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include "Common/GPU/Vulkan/VulkanContext.h"
|
||||
#include "Common/ColorConv.h"
|
||||
#include "Common/Log.h"
|
||||
#include "Common/ThreadPools.h"
|
||||
#include "Core/ThreadPools.h"
|
||||
#include "GPU/Common/TextureScalerCommon.h"
|
||||
#include "GPU/Vulkan/TextureScalerVulkan.h"
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include <tuple>
|
||||
#include <map>
|
||||
|
||||
#include "Common/Hashmaps.h"
|
||||
#include "Common/Data/Collections/Hashmaps.h"
|
||||
#include "Common/GPU/Vulkan/VulkanContext.h"
|
||||
#include "Common/GPU/Vulkan/VulkanLoader.h"
|
||||
#include "Common/GPU/Vulkan/VulkanImage.h"
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include "Common/Log.h"
|
||||
#include "Common/Serialize/SerializeFuncs.h"
|
||||
#include "Common/TimeUtil.h"
|
||||
#include "Common/FixedSizeQueue.h"
|
||||
#include "Common/Data/Collections/FixedSizeQueue.h"
|
||||
#include "Core/HW/SimpleAudioDec.h"
|
||||
#include "Core/HLE/__sceAudio.h"
|
||||
#include "GameInfoCache.h"
|
||||
|
@ -204,7 +204,7 @@
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
|
||||
<AdditionalIncludeDirectories>../..;../../ext/native;../../ext/snappy;../../ext/glslang;../../ext/zlib;../../ext/libpng17;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>NOMINMAX;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NOMINMAX;_CRT_SECURE_NO_WARNINGS;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
@ -218,7 +218,7 @@
|
||||
<CompileAsWinRT>false</CompileAsWinRT>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>../..;../../ext/native;../../ext/snappy;../../ext/glslang;../../ext/zlib;../../ext/libpng17;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>NOMINMAX;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NOMINMAX;_CRT_SECURE_NO_WARNINGS;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
@ -233,7 +233,7 @@
|
||||
<CompileAsWinRT>false</CompileAsWinRT>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>../..;../../ext/native;../../ext/snappy;../../ext/glslang;../../ext/zlib;../../ext/libpng17;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>NOMINMAX;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NOMINMAX;_CRT_SECURE_NO_WARNINGS;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
@ -249,7 +249,7 @@
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
|
||||
<AdditionalIncludeDirectories>../..;../../ext/native;../../ext/snappy;../../ext/glslang;../../ext/zlib;../../ext/libpng17;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>NOMINMAX;_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1;%(ClCompile.PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NOMINMAX;_CRT_SECURE_NO_WARNINGS;_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1;%(ClCompile.PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
@ -264,7 +264,7 @@
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
|
||||
<AdditionalIncludeDirectories>../..;../../ext/native;../../ext/snappy;../../ext/glslang;../../ext/zlib;../../ext/libpng17;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>NOMINMAX;_ARM64_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1;%(ClCompile.PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NOMINMAX;_CRT_SECURE_NO_WARNINGS;_ARM64_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1;%(ClCompile.PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
@ -278,7 +278,7 @@
|
||||
<CompileAsWinRT>false</CompileAsWinRT>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>../..;../../ext/native;../../ext/snappy;../../ext/glslang;../../ext/zlib;../../ext/libpng17;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>NOMINMAX;_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1;%(ClCompile.PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NOMINMAX;_CRT_SECURE_NO_WARNINGS;_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1;%(ClCompile.PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
@ -293,7 +293,7 @@
|
||||
<CompileAsWinRT>false</CompileAsWinRT>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>../..;../../ext/native;../../ext/snappy;../../ext/glslang;../../ext/zlib;../../ext/libpng17;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>NOMINMAX;_ARM64_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1;%(ClCompile.PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NOMINMAX;_CRT_SECURE_NO_WARNINGS;_ARM64_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1;%(ClCompile.PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
@ -308,7 +308,7 @@
|
||||
<CompileAsWinRT>false</CompileAsWinRT>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>../..;../../ext/native;../../ext/snappy;../../ext/glslang;../../ext/zlib;../../ext/libpng17;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>NOMINMAX;_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1;%(ClCompile.PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NOMINMAX;_CRT_SECURE_NO_WARNINGS;_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1;%(ClCompile.PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
@ -323,7 +323,7 @@
|
||||
<CompileAsWinRT>false</CompileAsWinRT>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>../..;../../ext/native;../../ext/snappy;../../ext/glslang;../../ext/zlib;../../ext/libpng17;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>NOMINMAX;_ARM64_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1;%(ClCompile.PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NOMINMAX;_CRT_SECURE_NO_WARNINGS;_ARM64_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1;%(ClCompile.PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
@ -339,7 +339,7 @@
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
|
||||
<AdditionalIncludeDirectories>../..;../../ext/native;../../ext/snappy;../../ext/glslang;../../ext/zlib;../../ext/libpng17;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>NOMINMAX;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NOMINMAX;_CRT_SECURE_NO_WARNINGS;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
@ -353,7 +353,7 @@
|
||||
<CompileAsWinRT>false</CompileAsWinRT>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>../..;../../ext/native;../../ext/snappy;../../ext/glslang;../../ext/zlib;../../ext/libpng17;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>NOMINMAX;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NOMINMAX;_CRT_SECURE_NO_WARNINGS;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
@ -368,7 +368,7 @@
|
||||
<CompileAsWinRT>false</CompileAsWinRT>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>../..;../../ext/native;../../ext/snappy;../../ext/glslang;../../ext/zlib;../../ext/libpng17;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>NOMINMAX;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NOMINMAX;_CRT_SECURE_NO_WARNINGS;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
@ -387,6 +387,9 @@
|
||||
<ClInclude Include="..\..\Common\BitSet.h" />
|
||||
<ClInclude Include="..\..\Common\Buffer.h" />
|
||||
<ClInclude Include="..\..\Common\Data\Collections\ConstMap.h" />
|
||||
<ClInclude Include="..\..\Common\Data\Collections\FixedSizeQueue.h" />
|
||||
<ClInclude Include="..\..\Common\Data\Collections\Hashmaps.h" />
|
||||
<ClInclude Include="..\..\Common\Data\Collections\ThreadSafeList.h" />
|
||||
<ClInclude Include="..\..\Common\Data\Collections\TinySet.h" />
|
||||
<ClInclude Include="..\..\Common\Data\Color\RGBAUtil.h" />
|
||||
<ClInclude Include="..\..\Common\Data\Convert\SmallDataConvert.h" />
|
||||
@ -464,11 +467,9 @@
|
||||
<ClInclude Include="..\..\Common\Crypto\sha256.h" />
|
||||
<ClInclude Include="..\..\Common\DbgNew.h" />
|
||||
<ClInclude Include="..\..\Common\ExceptionHandlerSetup.h" />
|
||||
<ClInclude Include="..\..\Common\FixedSizeQueue.h" />
|
||||
<ClInclude Include="..\..\Common\GraphicsContext.h" />
|
||||
<ClInclude Include="..\..\Common\Log.h" />
|
||||
<ClInclude Include="..\..\Common\LogManager.h" />
|
||||
<ClInclude Include="..\..\Common\MathUtil.h" />
|
||||
<ClInclude Include="..\..\Common\MemArena.h" />
|
||||
<ClInclude Include="..\..\Common\MemoryUtil.h" />
|
||||
<ClInclude Include="..\..\Common\MipsEmitter.h" />
|
||||
@ -479,14 +480,11 @@
|
||||
<ClInclude Include="..\..\Common\System\Display.h" />
|
||||
<ClInclude Include="..\..\Common\System\NativeApp.h" />
|
||||
<ClInclude Include="..\..\Common\System\System.h" />
|
||||
<ClInclude Include="..\..\Common\ThreadPools.h" />
|
||||
<ClInclude Include="..\..\Common\ThreadSafeList.h" />
|
||||
<ClInclude Include="..\..\Common\Thread\Executor.h" />
|
||||
<ClInclude Include="..\..\Common\Thread\PrioritizedWorkQueue.h" />
|
||||
<ClInclude Include="..\..\Common\Thread\ThreadPool.h" />
|
||||
<ClInclude Include="..\..\Common\Thread\ThreadUtil.h" />
|
||||
<ClInclude Include="..\..\Common\Thunk.h" />
|
||||
<ClInclude Include="..\..\Common\Timer.h" />
|
||||
<ClInclude Include="..\..\Common\TimeUtil.h" />
|
||||
<ClInclude Include="..\..\Common\UI\Context.h" />
|
||||
<ClInclude Include="..\..\Common\UI\Root.h" />
|
||||
@ -586,13 +584,11 @@
|
||||
<ClCompile Include="..\..\Common\OSVersion.cpp" />
|
||||
<ClCompile Include="..\..\Common\StringUtils.cpp" />
|
||||
<ClCompile Include="..\..\Common\System\Display.cpp" />
|
||||
<ClCompile Include="..\..\Common\ThreadPools.cpp" />
|
||||
<ClCompile Include="..\..\Common\Thread\Executor.cpp" />
|
||||
<ClCompile Include="..\..\Common\Thread\PrioritizedWorkQueue.cpp" />
|
||||
<ClCompile Include="..\..\Common\Thread\ThreadPool.cpp" />
|
||||
<ClCompile Include="..\..\Common\Thread\ThreadUtil.cpp" />
|
||||
<ClCompile Include="..\..\Common\Thunk.cpp" />
|
||||
<ClCompile Include="..\..\Common\Timer.cpp" />
|
||||
<ClCompile Include="..\..\Common\TimeUtil.cpp" />
|
||||
<ClCompile Include="..\..\Common\UI\Context.cpp" />
|
||||
<ClCompile Include="..\..\Common\UI\Root.cpp" />
|
||||
|
@ -109,9 +109,7 @@
|
||||
<ClCompile Include="..\..\Common\SysError.cpp" />
|
||||
<ClCompile Include="..\..\Common\OSVersion.cpp" />
|
||||
<ClCompile Include="..\..\Common\StringUtils.cpp" />
|
||||
<ClCompile Include="..\..\Common\ThreadPools.cpp" />
|
||||
<ClCompile Include="..\..\Common\Thunk.cpp" />
|
||||
<ClCompile Include="..\..\Common\Timer.cpp" />
|
||||
<ClCompile Include="..\..\Common\TimeUtil.cpp" />
|
||||
<ClCompile Include="..\..\Common\x64Analyzer.cpp" />
|
||||
<ClCompile Include="..\..\Common\x64Emitter.cpp" />
|
||||
@ -386,11 +384,9 @@
|
||||
<ClInclude Include="..\..\Common\CPUDetect.h" />
|
||||
<ClInclude Include="..\..\Common\DbgNew.h" />
|
||||
<ClInclude Include="..\..\Common\ExceptionHandlerSetup.h" />
|
||||
<ClInclude Include="..\..\Common\FixedSizeQueue.h" />
|
||||
<ClInclude Include="..\..\Common\GraphicsContext.h" />
|
||||
<ClInclude Include="..\..\Common\Log.h" />
|
||||
<ClInclude Include="..\..\Common\LogManager.h" />
|
||||
<ClInclude Include="..\..\Common\MathUtil.h" />
|
||||
<ClInclude Include="..\..\Common\MemArena.h" />
|
||||
<ClInclude Include="..\..\Common\MemoryUtil.h" />
|
||||
<ClInclude Include="..\..\Common\MipsEmitter.h" />
|
||||
@ -398,10 +394,7 @@
|
||||
<ClInclude Include="..\..\Common\StringUtils.h" />
|
||||
<ClInclude Include="..\..\Common\Swap.h" />
|
||||
<ClInclude Include="..\..\Common\SysError.h" />
|
||||
<ClInclude Include="..\..\Common\ThreadPools.h" />
|
||||
<ClInclude Include="..\..\Common\ThreadSafeList.h" />
|
||||
<ClInclude Include="..\..\Common\Thunk.h" />
|
||||
<ClInclude Include="..\..\Common\Timer.h" />
|
||||
<ClInclude Include="..\..\Common\TimeUtil.h" />
|
||||
<ClInclude Include="..\..\Common\x64Analyzer.h" />
|
||||
<ClInclude Include="..\..\Common\x64Emitter.h" />
|
||||
@ -660,6 +653,15 @@
|
||||
<ClInclude Include="..\..\Common\Render\Text\draw_text_win.h">
|
||||
<Filter>Render\Text</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\Common\Data\Collections\FixedSizeQueue.h">
|
||||
<Filter>Data\Collections</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\Common\Data\Collections\Hashmaps.h">
|
||||
<Filter>Data\Collections</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\Common\Data\Collections\ThreadSafeList.h">
|
||||
<Filter>Data\Collections</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Text Include="..\..\ext\libpng17\CMakeLists.txt">
|
||||
|
@ -568,6 +568,7 @@
|
||||
<ClInclude Include="..\..\Core\System.h" />
|
||||
<ClInclude Include="..\..\Core\TextureReplacer.h" />
|
||||
<ClInclude Include="..\..\Core\ThreadEventQueue.h" />
|
||||
<ClInclude Include="..\..\Core\ThreadPools.h" />
|
||||
<ClInclude Include="..\..\Core\Util\PortManager.h" />
|
||||
<ClInclude Include="..\..\Core\WebServer.h" />
|
||||
<ClInclude Include="..\..\Core\Util\AudioFormat.h" />
|
||||
@ -820,6 +821,7 @@
|
||||
<ClCompile Include="..\..\Core\Screenshot.cpp" />
|
||||
<ClCompile Include="..\..\Core\System.cpp" />
|
||||
<ClCompile Include="..\..\Core\TextureReplacer.cpp" />
|
||||
<ClCompile Include="..\..\Core\ThreadPools.cpp" />
|
||||
<ClCompile Include="..\..\Core\Util\PortManager.cpp" />
|
||||
<ClCompile Include="..\..\Core\WebServer.cpp" />
|
||||
<ClCompile Include="..\..\Core\Util\AudioFormat.cpp" />
|
||||
|
@ -911,6 +911,7 @@
|
||||
<Filter>Ext\libzip</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\Core\KeyMap.cpp" />
|
||||
<ClCompile Include="..\..\Core\ThreadPools.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="pch.h" />
|
||||
@ -1542,6 +1543,7 @@
|
||||
<Filter>Ext\libzip</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\Core\KeyMap.h" />
|
||||
<ClInclude Include="..\..\Core\ThreadPools.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\..\ext\gason\LICENSE">
|
||||
|
@ -7,15 +7,15 @@
|
||||
#include "Core/Config.h"
|
||||
#include "Common/CommonWindows.h"
|
||||
#include "Common/Log.h"
|
||||
#include "Common/TimeUtil.h"
|
||||
#include "Common/Input/InputState.h"
|
||||
#include "Common/Input/KeyCodes.h"
|
||||
#include "XinputDevice.h"
|
||||
#include "Core/Core.h"
|
||||
#include "Core/KeyMap.h"
|
||||
#include "Core/HLE/sceCtrl.h"
|
||||
#include "Common/Timer.h"
|
||||
|
||||
static int newVibrationTime = 0;
|
||||
static double newVibrationTime = 0.0;
|
||||
|
||||
// Utilities to dynamically load XInput. Adapted from SDL.
|
||||
|
||||
@ -24,8 +24,8 @@ static int newVibrationTime = 0;
|
||||
typedef DWORD (WINAPI *XInputGetState_t) (DWORD dwUserIndex, XINPUT_STATE* pState);
|
||||
typedef DWORD (WINAPI *XInputSetState_t) (DWORD dwUserIndex, XINPUT_VIBRATION* pVibration);
|
||||
|
||||
static XInputGetState_t PPSSPP_XInputGetState = NULL;
|
||||
static XInputSetState_t PPSSPP_XInputSetState = NULL;
|
||||
static XInputGetState_t PPSSPP_XInputGetState = nullptr;
|
||||
static XInputSetState_t PPSSPP_XInputSetState = nullptr;
|
||||
static DWORD PPSSPP_XInputVersion = 0;
|
||||
static HMODULE s_pXInputDLL = 0;
|
||||
static int s_XInputDLLRefCount = 0;
|
||||
@ -364,11 +364,11 @@ void XinputDevice::ApplyButtons(int pad, const XINPUT_STATE &state) {
|
||||
|
||||
void XinputDevice::ApplyVibration(int pad, XINPUT_VIBRATION &vibration) {
|
||||
if (PSP_IsInited()) {
|
||||
newVibrationTime = Common::Timer::GetTimeMs() >> 6;
|
||||
newVibrationTime = time_now_d();
|
||||
// We have to run PPSSPP_XInputSetState at time intervals
|
||||
// since it bugs otherwise with very high unthrottle speeds
|
||||
// and freezes at constant vibration or no vibration at all.
|
||||
if (abs(newVibrationTime - prevVibrationTime) >= 1) {
|
||||
if (newVibrationTime - prevVibrationTime >= 1.0 / 64.0) {
|
||||
if (GetUIState() == UISTATE_INGAME) {
|
||||
vibration.wLeftMotorSpeed = sceCtrlGetLeftVibration(); // use any value between 0-65535 here
|
||||
vibration.wRightMotorSpeed = sceCtrlGetRightVibration(); // use any value between 0-65535 here
|
||||
@ -377,7 +377,7 @@ void XinputDevice::ApplyVibration(int pad, XINPUT_VIBRATION &vibration) {
|
||||
vibration.wRightMotorSpeed = 0;
|
||||
}
|
||||
|
||||
if ((prevVibration[pad].wLeftMotorSpeed != vibration.wLeftMotorSpeed || prevVibration[pad].wRightMotorSpeed != vibration.wRightMotorSpeed)) {
|
||||
if (prevVibration[pad].wLeftMotorSpeed != vibration.wLeftMotorSpeed || prevVibration[pad].wRightMotorSpeed != vibration.wRightMotorSpeed) {
|
||||
PPSSPP_XInputSetState(pad, &vibration);
|
||||
prevVibration[pad] = vibration;
|
||||
}
|
||||
|
@ -300,8 +300,6 @@ EXEC_AND_LIB_FILES := \
|
||||
$(SRC)/Common/MemoryUtil.cpp \
|
||||
$(SRC)/Common/StringUtils.cpp \
|
||||
$(SRC)/Common/SysError.cpp \
|
||||
$(SRC)/Common/ThreadPools.cpp \
|
||||
$(SRC)/Common/Timer.cpp \
|
||||
$(SRC)/Common/TimeUtil.cpp \
|
||||
$(SRC)/GPU/Math3D.cpp \
|
||||
$(SRC)/GPU/GPU.cpp \
|
||||
@ -395,6 +393,7 @@ EXEC_AND_LIB_FILES := \
|
||||
$(SRC)/Core/Screenshot.cpp \
|
||||
$(SRC)/Core/System.cpp \
|
||||
$(SRC)/Core/TextureReplacer.cpp \
|
||||
$(SRC)/Core/ThreadPools.cpp \
|
||||
$(SRC)/Core/WebServer.cpp \
|
||||
$(SRC)/Core/Debugger/Breakpoints.cpp \
|
||||
$(SRC)/Core/Debugger/DisassemblyManager.cpp \
|
||||
|
@ -221,9 +221,7 @@ SOURCES_CXX += \
|
||||
$(COMMONDIR)/MemoryUtil.cpp \
|
||||
$(COMMONDIR)/SysError.cpp \
|
||||
$(COMMONDIR)/StringUtils.cpp \
|
||||
$(COMMONDIR)/Timer.cpp \
|
||||
$(COMMONDIR)/TimeUtil.cpp \
|
||||
$(COMMONDIR)/ThreadPools.cpp
|
||||
$(COMMONDIR)/TimeUtil.cpp
|
||||
|
||||
|
||||
SOURCES_CXX += \
|
||||
@ -501,6 +499,7 @@ SOURCES_CXX += \
|
||||
$(COREDIR)/SaveState.cpp \
|
||||
$(COREDIR)/Screenshot.cpp \
|
||||
$(COREDIR)/System.cpp \
|
||||
$(COREDIR)/ThreadPools.cpp \
|
||||
$(COREDIR)/Util/BlockAllocator.cpp \
|
||||
$(COREDIR)/Util/PPGeDraw.cpp \
|
||||
$(COREDIR)/Util/AudioFormat.cpp \
|
||||
|
Loading…
x
Reference in New Issue
Block a user