diff --git a/CMakeLists.txt b/CMakeLists.txt
index c323f8885b..29d2a45cc6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -433,6 +433,19 @@ add_library(Common STATIC
Common/Crypto/sha1.h
Common/Crypto/sha256.cpp
Common/Crypto/sha256.h
+ Common/Input/GestureDetector.cpp
+ Common/Input/GestureDetector.h
+ Common/Input/KeyCodes.h
+ Common/Input/InputState.cpp
+ Common/Input/InputState.h
+ Common/Thread/Executor.cpp
+ Common/Thread/Executor.h
+ Common/Thread/PrioritizedWorkQueue.cpp
+ Common/Thread/PrioritizedWorkQueue.h
+ Common/Thread/ThreadUtil.cpp
+ Common/Thread/ThreadUtil.h
+ Common/Thread/ThreadPool.cpp
+ Common/Thread/ThreadPool.h
Common/BitScan.h
Common/BitSet.h
Common/Buffer.h
@@ -1000,11 +1013,6 @@ add_library(native STATIC
ext/native/image/zim_load.h
ext/native/image/zim_save.cpp
ext/native/image/zim_save.h
- ext/native/input/gesture_detector.cpp
- ext/native/input/gesture_detector.h
- ext/native/input/keycodes.h
- ext/native/input/input_state.h
- ext/native/input/input_state.cpp
ext/native/json/json_reader.h
ext/native/json/json_reader.cpp
ext/native/json/json_writer.h
@@ -1045,14 +1053,6 @@ add_library(native STATIC
ext/native/thin3d/thin3d.h
ext/native/thin3d/thin3d_create.h
${THIN3D_PLATFORMS}
- ext/native/thread/executor.cpp
- ext/native/thread/executor.h
- ext/native/thread/prioritizedworkqueue.cpp
- ext/native/thread/prioritizedworkqueue.h
- ext/native/thread/threadutil.cpp
- ext/native/thread/threadutil.h
- ext/native/thread/threadpool.cpp
- ext/native/thread/threadpool.h
ext/native/ui/root.cpp
ext/native/ui/root.h
ext/native/ui/screen.cpp
diff --git a/Common/Common.vcxproj b/Common/Common.vcxproj
index aceea2b7fc..8f64506e1f 100644
--- a/Common/Common.vcxproj
+++ b/Common/Common.vcxproj
@@ -360,6 +360,9 @@
+
+
+
@@ -420,6 +423,10 @@
+
+
+
+
@@ -607,6 +614,8 @@
false
false
+
+
@@ -659,6 +668,10 @@
+
+
+
+
@@ -681,4 +694,4 @@
-
+
\ No newline at end of file
diff --git a/Common/Common.vcxproj.filters b/Common/Common.vcxproj.filters
index 1322c5858d..b32b1da778 100644
--- a/Common/Common.vcxproj.filters
+++ b/Common/Common.vcxproj.filters
@@ -116,6 +116,27 @@
ext\libpng17
+
+ Thread
+
+
+ Thread
+
+
+ Thread
+
+
+ Thread
+
+
+ Input
+
+
+ Input
+
+
+ Input
+
@@ -231,6 +252,24 @@
ext\libpng17
+
+ Thread
+
+
+ Thread
+
+
+ Thread
+
+
+ Thread
+
+
+ Input
+
+
+ Input
+
@@ -254,10 +293,16 @@
{1d04f87f-73a2-4027-a6ff-e998e92e7d3c}
+
+ {41bcd391-8641-432c-ae4a-ab03812df762}
+
+
+ {fd0bac4f-e3e2-4201-8902-2d19b50d5bf7}
+
ext\libpng17
-
+
\ No newline at end of file
diff --git a/Common/ConsoleListener.cpp b/Common/ConsoleListener.cpp
index da44073795..ce3cc1f1b7 100644
--- a/Common/ConsoleListener.cpp
+++ b/Common/ConsoleListener.cpp
@@ -32,7 +32,7 @@
#endif
#include "ppsspp_config.h"
-#include "thread/threadutil.h"
+#include "Common/Thread/ThreadUtil.h"
#include "util/text/utf8.h"
#include "Common/Common.h"
#include "Common/ConsoleListener.h"
diff --git a/Common/ExceptionHandlerSetup.cpp b/Common/ExceptionHandlerSetup.cpp
index 0b8f8ac7f0..8232b4ba9e 100644
--- a/Common/ExceptionHandlerSetup.cpp
+++ b/Common/ExceptionHandlerSetup.cpp
@@ -6,7 +6,6 @@
#include "ppsspp_config.h"
-#include "Common/ExceptionHandlerSetup.h"
#include
#include
#include
@@ -16,9 +15,9 @@
#include "Common/CommonFuncs.h"
#include "Common/CommonTypes.h"
#include "Common/Log.h"
-#include "ext/native/thread/threadutil.h"
-
+#include "Common/Thread/ThreadUtil.h"
#include "Common/MachineContext.h"
+#include "Common/ExceptionHandlerSetup.h"
static BadAccessHandler g_badAccessHandler;
static void *altStack = nullptr;
diff --git a/ext/native/input/gesture_detector.cpp b/Common/Input/GestureDetector.cpp
similarity index 98%
rename from ext/native/input/gesture_detector.cpp
rename to Common/Input/GestureDetector.cpp
index d73f4f9090..cab29e1b1a 100644
--- a/ext/native/input/gesture_detector.cpp
+++ b/Common/Input/GestureDetector.cpp
@@ -3,7 +3,7 @@
// Zoom gesture a la http://www.zdnet.com/blog/burnette/how-to-use-multi-touch-in-android-2-part-6-implementing-the-pinch-zoom-gesture/1847
#include "Common/TimeUtil.h"
-#include "input/gesture_detector.h"
+#include "Common/Input/GestureDetector.h"
const float estimatedInertiaDamping = 0.75f;
diff --git a/ext/native/input/gesture_detector.h b/Common/Input/GestureDetector.h
similarity index 96%
rename from ext/native/input/gesture_detector.h
rename to Common/Input/GestureDetector.h
index 783843cee3..908f960769 100644
--- a/ext/native/input/gesture_detector.h
+++ b/Common/Input/GestureDetector.h
@@ -1,4 +1,4 @@
-#include "input/input_state.h"
+#include "Common/Input/InputState.h"
#include "math/geom2d.h"
// Mainly for detecting (multi-)touch gestures but also useable for left button mouse dragging etc.
diff --git a/ext/native/input/input_state.cpp b/Common/Input/InputState.cpp
similarity index 96%
rename from ext/native/input/input_state.cpp
rename to Common/Input/InputState.cpp
index 8c28473f1d..90fc9b6a1a 100644
--- a/ext/native/input/input_state.cpp
+++ b/Common/Input/InputState.cpp
@@ -1,5 +1,5 @@
-#include "input/input_state.h"
-#include "input/keycodes.h"
+#include "Common/Input/InputState.h"
+#include "Common/Input/KeyCodes.h"
#include
const char *GetDeviceName(int deviceId) {
diff --git a/ext/native/input/input_state.h b/Common/Input/InputState.h
similarity index 99%
rename from ext/native/input/input_state.h
rename to Common/Input/InputState.h
index 2ce502f860..175d6786df 100644
--- a/ext/native/input/input_state.h
+++ b/Common/Input/InputState.h
@@ -8,7 +8,7 @@
#include
#include "math/lin/vec3.h"
-#include "input/keycodes.h"
+#include "Common/Input/KeyCodes.h"
// Default device IDs
diff --git a/ext/native/input/keycodes.h b/Common/Input/KeyCodes.h
similarity index 100%
rename from ext/native/input/keycodes.h
rename to Common/Input/KeyCodes.h
diff --git a/Common/KeyMap.cpp b/Common/KeyMap.cpp
index 99d3bf4f05..2a3fb0bb81 100644
--- a/Common/KeyMap.cpp
+++ b/Common/KeyMap.cpp
@@ -26,7 +26,7 @@
#include "base/NativeApp.h"
#include "file/ini_file.h"
-#include "input/input_state.h"
+#include "Common/Input/InputState.h"
#include "ppsspp_config.h"
#include "Common/Log.h"
diff --git a/Common/KeyMap.h b/Common/KeyMap.h
index 86883a9e98..a0afd74797 100644
--- a/Common/KeyMap.h
+++ b/Common/KeyMap.h
@@ -21,8 +21,8 @@
#include