Skip to content

Commit

Permalink
Merge pull request #17896 from hrydgard/frame-timing-struct
Browse files Browse the repository at this point in the history
Frame timing struct
  • Loading branch information
hrydgard committed Aug 13, 2023
2 parents b84091f + a84cb35 commit f7b8075
Show file tree
Hide file tree
Showing 13 changed files with 39 additions and 11 deletions.
10 changes: 1 addition & 9 deletions Common/File/PathBrowser.cpp
Expand Up @@ -210,7 +210,7 @@ std::string PathBrowser::GetFriendlyPath() const {
bool PathBrowser::GetListing(std::vector<File::FileInfo> &fileInfo, const char *filter, bool *cancel) {
std::unique_lock<std::mutex> guard(pendingLock_);
while (!IsListingReady() && (!cancel || !*cancel)) {
// In case cancel changes, just sleep.
// In case cancel changes, just sleep. TODO: Replace with condition variable.
guard.unlock();
sleep_ms(50);
guard.lock();
Expand All @@ -221,14 +221,6 @@ bool PathBrowser::GetListing(std::vector<File::FileInfo> &fileInfo, const char *
}

bool PathBrowser::CanNavigateUp() {
/* Leaving this commented out, not sure if there's a use in UWP for navigating up from the user data folder.
#if PPSSPP_PLATFORM(UWP)
// Can't navigate up from memstick folder :(
if (path_ == GetSysDirectory(DIRECTORY_MEMSTICK_ROOT)) {
return false;
}
#endif
*/
return path_.CanNavigateUp();
}

Expand Down
2 changes: 2 additions & 0 deletions Core/Core.vcxproj
Expand Up @@ -565,6 +565,7 @@
<ClCompile Include="Debugger\WebSocket\SteppingSubscriber.cpp" />
<ClCompile Include="Debugger\WebSocket\WebSocketUtils.cpp" />
<ClCompile Include="FileSystems\BlobFileSystem.cpp" />
<ClCompile Include="FrameTiming.cpp" />
<ClCompile Include="HLE\KUBridge.cpp" />
<ClCompile Include="HLE\Plugins.cpp" />
<ClCompile Include="HLE\sceKernelHeap.cpp" />
Expand Down Expand Up @@ -1151,6 +1152,7 @@
<ClInclude Include="Debugger\WebSocket\LogBroadcaster.h" />
<ClInclude Include="Debugger\WebSocket\SteppingBroadcaster.h" />
<ClInclude Include="FileSystems\BlobFileSystem.h" />
<ClInclude Include="FrameTiming.h" />
<ClInclude Include="HLE\KernelThreadDebugInterface.h" />
<ClInclude Include="HLE\KUBridge.h" />
<ClInclude Include="HLE\Plugins.h" />
Expand Down
6 changes: 6 additions & 0 deletions Core/Core.vcxproj.filters
Expand Up @@ -1243,6 +1243,9 @@
<ClCompile Include="MIPS\IR\IRNativeCommon.cpp">
<Filter>MIPS\IR</Filter>
</ClCompile>
<ClCompile Include="FrameTiming.cpp">
<Filter>Core</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="ELF\ElfReader.h">
Expand Down Expand Up @@ -2004,6 +2007,9 @@
<ClInclude Include="MIPS\IR\IRNativeCommon.h">
<Filter>MIPS\IR</Filter>
</ClInclude>
<ClInclude Include="FrameTiming.h">
<Filter>Core</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\LICENSE.TXT" />
Expand Down
1 change: 1 addition & 0 deletions Core/CoreParameter.h
Expand Up @@ -19,6 +19,7 @@

#include <string>

#include "Common/File/Path.h"
#include "Core/Compatibility.h"

enum GPUCore {
Expand Down
12 changes: 12 additions & 0 deletions Core/FrameTiming.cpp
@@ -0,0 +1,12 @@
#include "Common/Profiler/Profiler.h"
#include "Common/Log.h"
#include "Common/TimeUtil.h"

#include "Core/RetroAchievements.h"
#include "Core/CoreParameter.h"
#include "Core/Core.h"
#include "Core/Config.h"
#include "Core/HW/Display.h"
#include "Core/FrameTiming.h"

FrameTiming g_frameTiming;
7 changes: 7 additions & 0 deletions Core/FrameTiming.h
@@ -0,0 +1,7 @@
#pragma once

struct FrameTiming {

};

extern FrameTiming g_frameTiming;
1 change: 1 addition & 0 deletions Core/HLE/sceDisplay.cpp
Expand Up @@ -38,6 +38,7 @@
#include "Core/Config.h"
#include "Core/CoreTiming.h"
#include "Core/CoreParameter.h"
#include "Core/FrameTiming.h"
#include "Core/Reporting.h"
#include "Core/Core.h"
#include "Core/System.h"
Expand Down
1 change: 1 addition & 0 deletions UI/NativeApp.cpp
Expand Up @@ -90,6 +90,7 @@
#include "Core/ConfigValues.h"
#include "Core/Core.h"
#include "Core/FileLoaders/DiskCachingFileLoader.h"
#include "Core/FrameTiming.h"
#include "Core/KeyMap.h"
#include "Core/Reporting.h"
#include "Core/RetroAchievements.h"
Expand Down
2 changes: 2 additions & 0 deletions UWP/CoreUWP/CoreUWP.vcxproj
Expand Up @@ -196,6 +196,7 @@
<ClInclude Include="..\..\Core\FileSystems\MetaFileSystem.h" />
<ClInclude Include="..\..\Core\FileSystems\VirtualDiscFileSystem.h" />
<ClInclude Include="..\..\Core\Font\PGF.h" />
<ClInclude Include="..\..\Core\FrameTiming.h" />
<ClInclude Include="..\..\Core\HDRemaster.h" />
<ClInclude Include="..\..\Core\HLE\sceNp2.h" />
<ClInclude Include="..\..\Core\Instance.h" />
Expand Down Expand Up @@ -439,6 +440,7 @@
<ClCompile Include="..\..\Core\FileSystems\tlzrc.cpp" />
<ClCompile Include="..\..\Core\FileSystems\VirtualDiscFileSystem.cpp" />
<ClCompile Include="..\..\Core\Font\PGF.cpp" />
<ClCompile Include="..\..\Core\FrameTiming.cpp" />
<ClCompile Include="..\..\Core\HDRemaster.cpp" />
<ClCompile Include="..\..\Core\HLE\sceNp2.cpp" />
<ClCompile Include="..\..\Core\Instance.cpp" />
Expand Down
2 changes: 2 additions & 0 deletions UWP/CoreUWP/CoreUWP.vcxproj.filters
Expand Up @@ -1137,6 +1137,7 @@
</ClCompile>
<ClCompile Include="..\..\Core\ConfigSettings.cpp" />
<ClCompile Include="..\..\Core\RetroAchievements.cpp" />
<ClCompile Include="..\..\Core\FrameTiming.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="pch.h" />
Expand Down Expand Up @@ -1800,6 +1801,7 @@
<ClInclude Include="..\..\Core\ConfigSettings.h" />
<ClInclude Include="..\..\Core\Debugger\WebSocket\ClientConfigSubscriber.h" />
<ClInclude Include="..\..\Core\RetroAchievements.h" />
<ClInclude Include="..\..\Core\FrameTiming.h" />
</ItemGroup>
<ItemGroup>
<None Include="..\..\ext\gason\LICENSE">
Expand Down
1 change: 1 addition & 0 deletions android/jni/Android.mk
Expand Up @@ -479,6 +479,7 @@ EXEC_AND_LIB_FILES := \
$(SRC)/Core/ConfigSettings.cpp \
$(SRC)/Core/CoreTiming.cpp \
$(SRC)/Core/CwCheat.cpp \
$(SRC)/Core/FrameTiming.cpp \
$(SRC)/Core/HDRemaster.cpp \
$(SRC)/Core/Instance.cpp \
$(SRC)/Core/KeyMap.cpp \
Expand Down
4 changes: 2 additions & 2 deletions android/jni/app-android.cpp
Expand Up @@ -311,7 +311,7 @@ static void EmuThreadFunc() {
// Wait for render loop to get started.
INFO_LOG(SYSTEM, "Runloop: Waiting for displayInit...");
while (!graphicsContext || graphicsContext->GetState() == GraphicsContextState::PENDING) {
sleep_ms(20);
sleep_ms(5);
}

// Check the state of the graphics context before we try to feed it into NativeInitGraphics.
Expand Down Expand Up @@ -1311,7 +1311,7 @@ extern "C" void JNICALL Java_org_ppsspp_ppsspp_NativeActivity_requestExitVulkanR
}
exitRenderLoop = true;
while (renderLoopRunning) {
sleep_ms(10);
sleep_ms(5);
}
}

Expand Down
1 change: 1 addition & 0 deletions libretro/Makefile.common
Expand Up @@ -667,6 +667,7 @@ SOURCES_CXX += \
$(COREDIR)/HW/SasReverb.cpp \
$(COREDIR)/HW/StereoResampler.cpp \
$(COREDIR)/Compatibility.cpp \
$(COREDIR)/FrameTiming.cpp \
$(COREDIR)/Loaders.cpp \
$(COREDIR)/MIPS/JitCommon/JitCommon.cpp \
$(COREDIR)/MIPS/JitCommon/JitState.cpp \
Expand Down

0 comments on commit f7b8075

Please sign in to comment.