mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-05-21 11:46:59 +02:00
196 lines
6.5 KiB
Diff
196 lines
6.5 KiB
Diff
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|
index 8872895..b0eeca8 100644
|
|
--- a/CMakeLists.txt
|
|
+++ b/CMakeLists.txt
|
|
@@ -1770,7 +1770,6 @@ elseif(EMSCRIPTEN)
|
|
|
|
CheckPTHREAD()
|
|
CheckLibUnwind()
|
|
-
|
|
elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
|
|
|
|
set(SDL_DISABLE_DLOPEN_NOTES TRUE)
|
|
@@ -3647,10 +3646,30 @@ if(NOT HAVE_CAMERA)
|
|
)
|
|
endif()
|
|
|
|
+# Always on?
|
|
+if (PLATFORM_PS4)
|
|
+ sdl_sources(
|
|
+ "${SDL3_SOURCE_DIR}/src/thread/pthread/SDL_systhread.c"
|
|
+ "${SDL3_SOURCE_DIR}/src/thread/pthread/SDL_sysmutex.c" # Can be faked, if necessary
|
|
+ "${SDL3_SOURCE_DIR}/src/thread/pthread/SDL_syscond.c" # Can be faked, if necessary
|
|
+ "${SDL3_SOURCE_DIR}/src/thread/pthread/SDL_sysrwlock.c" # Can be faked, if necessary
|
|
+ "${SDL3_SOURCE_DIR}/src/thread/pthread/SDL_systls.c"
|
|
+ "${SDL3_SOURCE_DIR}/src/thread/generic/SDL_syssem.c"
|
|
+ )
|
|
+ sdl_glob_sources("${SDL3_SOURCE_DIR}/src/time/unix/*.c")
|
|
+ sdl_glob_sources("${SDL3_SOURCE_DIR}/src/timer/unix/*.c")
|
|
+ set(HAVE_SDL_THREADS TRUE)
|
|
+ set(HAVE_SDL_TIMERS TRUE)
|
|
+ set(HAVE_SDL_TIME TRUE)
|
|
+ set(SDL_TIME_UNIX 1)
|
|
+ set(SDL_TIMER_UNIX 1)
|
|
+ set(SDL_THREAD_PTHREAD 1)
|
|
+endif ()
|
|
+
|
|
# We always need to have threads and timers around
|
|
if(NOT HAVE_SDL_THREADS)
|
|
# The Emscripten and N-Gage platform has been carefully vetted to work without threads
|
|
- if(EMSCRIPTEN OR NGAGE)
|
|
+ if(EMSCRIPTEN OR NGAGE OR PLATFORM_PS4)
|
|
set(SDL_THREADS_DISABLED 1)
|
|
sdl_glob_sources(
|
|
"${SDL3_SOURCE_DIR}/src/thread/generic/*.c"
|
|
diff --git a/build-scripts/rename_macros.py b/build-scripts/rename_macros.py
|
|
index 978120c..b6063dd 100755
|
|
--- a/build-scripts/rename_macros.py
|
|
+++ b/build-scripts/rename_macros.py
|
|
@@ -124,6 +124,7 @@ RENAMED_MACROS = {
|
|
"__RISCOS__": "SDL_PLATFORM_RISCOS",
|
|
"__SOLARIS__": "SDL_PLATFORM_SOLARIS",
|
|
"__PSP__": "SDL_PLATFORM_PSP",
|
|
+ "__PS4__": "SDL_PLATFORM_PS4",
|
|
"__PS2__": "SDL_PLATFORM_PS2",
|
|
"__VITA__": "SDL_PLATFORM_VITA",
|
|
"__3DS__": "SDL_PLATFORM_3DS",
|
|
diff --git a/include/SDL3/SDL_platform_defines.h b/include/SDL3/SDL_platform_defines.h
|
|
index 7963149..6c0dd5d 100644
|
|
--- a/include/SDL3/SDL_platform_defines.h
|
|
+++ b/include/SDL3/SDL_platform_defines.h
|
|
@@ -442,6 +442,16 @@
|
|
#define SDL_PLATFORM_PSP 1
|
|
#endif
|
|
|
|
+#if defined(__PS4__) || defined(__OPENORBIS__)
|
|
+
|
|
+/**
|
|
+ * A preprocessor macro that is only defined if compiling for Sony PSP.
|
|
+ *
|
|
+ * \since This macro is available since SDL 3.2.0.
|
|
+ */
|
|
+#define SDL_PLATFORM_PS4 1
|
|
+#endif
|
|
+
|
|
#if defined(__PS2__) || defined(PS2)
|
|
|
|
/**
|
|
diff --git a/src/SDL.c b/src/SDL.c
|
|
index b1a1a56..0a3fec6 100644
|
|
--- a/src/SDL.c
|
|
+++ b/src/SDL.c
|
|
@@ -714,7 +714,7 @@ void SDL_Quit(void)
|
|
SDL_DBus_Quit();
|
|
#endif
|
|
|
|
-#if defined(SDL_PLATFORM_UNIX) && !defined(SDL_PLATFORM_ANDROID) && !defined(SDL_PLATFORM_EMSCRIPTEN) && !defined(SDL_PLATFORM_PRIVATE)
|
|
+#if defined(SDL_PLATFORM_UNIX) && !defined(SDL_PLATFORM_ANDROID) && !defined(SDL_PLATFORM_EMSCRIPTEN) && !defined(SDL_PLATFORM_PRIVATE) && !defined(SDL_PLATFORM_PS4)
|
|
SDL_Gtk_Quit();
|
|
#endif
|
|
|
|
@@ -813,6 +813,8 @@ const char *SDL_GetPlatform(void)
|
|
return "tvOS";
|
|
#elif defined(SDL_PLATFORM_PS2)
|
|
return "PlayStation 2";
|
|
+#elif defined(SDL_PLATFORM_PS4)
|
|
+ return "PlayStation 4";
|
|
#elif defined(SDL_PLATFORM_PSP)
|
|
return "PlayStation Portable";
|
|
#elif defined(SDL_PLATFORM_VITA)
|
|
diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c
|
|
index c1e4241..65b1e6d 100644
|
|
--- a/src/audio/SDL_audio.c
|
|
+++ b/src/audio/SDL_audio.c
|
|
@@ -80,6 +80,9 @@ static const AudioBootStrap *const bootstrap[] = {
|
|
#ifdef SDL_AUDIO_DRIVER_NGAGE
|
|
&NGAGEAUDIO_bootstrap,
|
|
#endif
|
|
+#ifdef SDL_AUDIO_DRIVER_PS4
|
|
+ &PS4AUDIO_bootstrap,
|
|
+#endif
|
|
#ifdef SDL_AUDIO_DRIVER_EMSCRIPTEN
|
|
&EMSCRIPTENAUDIO_bootstrap,
|
|
#endif
|
|
diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c
|
|
index 60c9743..2d12c3a 100644
|
|
--- a/src/joystick/SDL_joystick.c
|
|
+++ b/src/joystick/SDL_joystick.c
|
|
@@ -106,6 +106,9 @@ static SDL_JoystickDriver *SDL_joystick_drivers[] = {
|
|
#ifdef SDL_JOYSTICK_N3DS
|
|
&SDL_N3DS_JoystickDriver,
|
|
#endif
|
|
+#ifdef SDL_JOYSTICK_PS4
|
|
+ &SDL_PS4_JoystickDriver,
|
|
+#endif
|
|
#if defined(SDL_JOYSTICK_DUMMY) || defined(SDL_JOYSTICK_DISABLED)
|
|
&SDL_DUMMY_JoystickDriver
|
|
#endif
|
|
diff --git a/src/joystick/SDL_sysjoystick.h b/src/joystick/SDL_sysjoystick.h
|
|
index 47ce42c..42ab9de 100644
|
|
--- a/src/joystick/SDL_sysjoystick.h
|
|
+++ b/src/joystick/SDL_sysjoystick.h
|
|
@@ -253,6 +253,7 @@ extern SDL_JoystickDriver SDL_HAIKU_JoystickDriver;
|
|
extern SDL_JoystickDriver SDL_HIDAPI_JoystickDriver;
|
|
extern SDL_JoystickDriver SDL_RAWINPUT_JoystickDriver;
|
|
extern SDL_JoystickDriver SDL_IOS_JoystickDriver;
|
|
+extern SDL_JoystickDriver SDL_PS4_JoystickDriver;
|
|
extern SDL_JoystickDriver SDL_LINUX_JoystickDriver;
|
|
extern SDL_JoystickDriver SDL_VIRTUAL_JoystickDriver;
|
|
extern SDL_JoystickDriver SDL_WGI_JoystickDriver;
|
|
diff --git a/src/render/SDL_sysrender.h b/src/render/SDL_sysrender.h
|
|
index a1bb44a..51843c4 100644
|
|
--- a/src/render/SDL_sysrender.h
|
|
+++ b/src/render/SDL_sysrender.h
|
|
@@ -381,6 +381,7 @@ extern SDL_RenderDriver NGAGE_RenderDriver;
|
|
extern SDL_RenderDriver VULKAN_RenderDriver;
|
|
extern SDL_RenderDriver PS2_RenderDriver;
|
|
extern SDL_RenderDriver PSP_RenderDriver;
|
|
+extern SDL_RenderDriver PS4_RenderDriver;
|
|
extern SDL_RenderDriver SW_RenderDriver;
|
|
extern SDL_RenderDriver VITA_GXM_RenderDriver;
|
|
extern SDL_RenderDriver GPU_RenderDriver;
|
|
diff --git a/src/stdlib/SDL_string.c b/src/stdlib/SDL_string.c
|
|
index 4a870f6..69ca1db 100644
|
|
--- a/src/stdlib/SDL_string.c
|
|
+++ b/src/stdlib/SDL_string.c
|
|
@@ -32,7 +32,9 @@
|
|
|
|
#include "SDL_casefolding.h"
|
|
|
|
-#if defined(__SIZEOF_WCHAR_T__)
|
|
+#if defined(SDL_PLATFORM_PS4)
|
|
+#define SDL_SIZEOF_WCHAR_T 2
|
|
+#elif defined(__SIZEOF_WCHAR_T__)
|
|
#define SDL_SIZEOF_WCHAR_T __SIZEOF_WCHAR_T__
|
|
#elif defined(SDL_PLATFORM_NGAGE)
|
|
#define SDL_SIZEOF_WCHAR_T 2
|
|
@@ -43,7 +45,6 @@
|
|
#endif
|
|
SDL_COMPILE_TIME_ASSERT(sizeof_wchar_t, sizeof(wchar_t) == SDL_SIZEOF_WCHAR_T);
|
|
|
|
-
|
|
char *SDL_UCS4ToUTF8(Uint32 codepoint, char *dst)
|
|
{
|
|
if (!dst) {
|
|
diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c
|
|
index f650f27..e23424f 100644
|
|
--- a/src/video/SDL_video.c
|
|
+++ b/src/video/SDL_video.c
|
|
@@ -131,6 +131,9 @@ static VideoBootStrap *bootstrap[] = {
|
|
#ifdef SDL_VIDEO_DRIVER_NGAGE
|
|
&NGAGE_bootstrap,
|
|
#endif
|
|
+#ifdef SDL_VIDEO_DRIVER_PS4
|
|
+ &PS4_bootstrap,
|
|
+#endif
|
|
#ifdef SDL_VIDEO_DRIVER_KMSDRM
|
|
&KMSDRM_bootstrap,
|
|
#endif
|
|
@@ -314,6 +317,7 @@ static bool SDL_CreateWindowTexture(SDL_VideoDevice *_this, SDL_Window *window,
|
|
SDL_GetWindowSizeInPixels(window, &w, &h);
|
|
|
|
if (!data) {
|
|
+
|
|
SDL_Renderer *renderer = NULL;
|
|
const char *render_driver = NULL;
|
|
|