Skip to content

Commit 4c62505

Browse files
authored
shadps4: init at 0.3.0-unstable-2024-10-13 (#340215)
2 parents 2b62add + 7a30e57 commit 4c62505

File tree

4 files changed

+213
-0
lines changed

4 files changed

+213
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
From 266a090882133e30df20899bbf8a5b66b28e02cd Mon Sep 17 00:00:00 2001
2+
From: OPNA2608 <[email protected]>
3+
Date: Mon, 14 Oct 2024 00:31:01 +0200
4+
Subject: [PATCH] Disable update checking
5+
6+
Downloading an AppImage and trying to run it just won't work.
7+
---
8+
src/qt_gui/check_update.cpp | 6 ++++++
9+
1 file changed, 6 insertions(+)
10+
11+
diff --git a/src/qt_gui/check_update.cpp b/src/qt_gui/check_update.cpp
12+
index ca6009ca..e3b14d5d 100644
13+
--- a/src/qt_gui/check_update.cpp
14+
+++ b/src/qt_gui/check_update.cpp
15+
@@ -201,6 +201,12 @@ void CheckUpdate::setupUI(const QString& downloadUrl, const QString& latestDate,
16+
noButton->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred);
17+
bottomLayout->addWidget(autoUpdateCheckBox);
18+
19+
+ yesButton->setVisible(false);
20+
+ yesButton->setEnabled(false);
21+
+ QString updateDisabledText = QStringLiteral("[Nix] Auto-updating has been disabled in this package.");
22+
+ QLabel* updateDisabledLabel = new QLabel(updateDisabledText, this);
23+
+ layout->addWidget(updateDisabledLabel);
24+
+
25+
QSpacerItem* spacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
26+
bottomLayout->addItem(spacer);
27+
28+
--
29+
2.44.1
30+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
--- a/src/core/libraries/kernel/thread_management.cpp
2+
+++ b/src/core/libraries/kernel/thread_management.cpp
3+
@@ -1065,7 +1065,16 @@ ScePthread PThreadPool::Create() {
4+
}
5+
}
6+
7+
+#ifdef _WIN64
8+
auto* ret = new PthreadInternal{};
9+
+#else
10+
+ // TODO: Linux specific hack
11+
+ static u8* hint_address = reinterpret_cast<u8*>(0x7FFFFC000ULL);
12+
+ auto* ret = reinterpret_cast<PthreadInternal*>(
13+
+ mmap(hint_address, sizeof(PthreadInternal), PROT_READ | PROT_WRITE,
14+
+ MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, -1, 0));
15+
+ hint_address += Common::AlignUp(sizeof(PthreadInternal), 4_KB);
16+
+#endif
17+
ret->is_free = false;
18+
ret->is_detached = false;
19+
ret->is_almost_done = false;
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
diff --git a/src/sdl_window.cpp b/src/sdl_window.cpp
2+
index bd2cc39d..13438149 100644
3+
--- a/src/sdl_window.cpp
4+
+++ b/src/sdl_window.cpp
5+
@@ -127,19 +127,12 @@ void WindowSDL::onResize() {
6+
void WindowSDL::onKeyPress(const SDL_Event* event) {
7+
using Libraries::Pad::OrbisPadButtonDataOffset;
8+
9+
-#ifdef __APPLE__
10+
// Use keys that are more friendly for keyboards without a keypad.
11+
// Once there are key binding options this won't be necessary.
12+
constexpr SDL_Keycode CrossKey = SDLK_N;
13+
constexpr SDL_Keycode CircleKey = SDLK_B;
14+
constexpr SDL_Keycode SquareKey = SDLK_V;
15+
constexpr SDL_Keycode TriangleKey = SDLK_C;
16+
-#else
17+
- constexpr SDL_Keycode CrossKey = SDLK_KP_2;
18+
- constexpr SDL_Keycode CircleKey = SDLK_KP_6;
19+
- constexpr SDL_Keycode SquareKey = SDLK_KP_4;
20+
- constexpr SDL_Keycode TriangleKey = SDLK_KP_8;
21+
-#endif
22+
23+
u32 button = 0;
24+
Input::Axis axis = Input::Axis::AxisMax;

pkgs/by-name/sh/shadps4/package.nix

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
{
2+
lib,
3+
stdenv,
4+
fetchFromGitHub,
5+
fetchpatch,
6+
alsa-lib,
7+
boost184,
8+
cmake,
9+
cryptopp,
10+
glslang,
11+
ffmpeg,
12+
fmt,
13+
jack2,
14+
libdecor,
15+
libpulseaudio,
16+
libunwind,
17+
libusb1,
18+
magic-enum,
19+
mesa,
20+
pkg-config,
21+
pugixml,
22+
qt6,
23+
rapidjson,
24+
renderdoc,
25+
sndio,
26+
toml11,
27+
vulkan-headers,
28+
vulkan-loader,
29+
vulkan-memory-allocator,
30+
xorg,
31+
xxHash,
32+
zlib-ng,
33+
unstableGitUpdater,
34+
}:
35+
36+
stdenv.mkDerivation {
37+
pname = "shadps4";
38+
version = "0.3.0-unstable-2024-10-13";
39+
40+
src = fetchFromGitHub {
41+
owner = "shadps4-emu";
42+
repo = "shadPS4";
43+
rev = "bd9f82df94847b4a5f3d2676ae938f064505c992";
44+
hash = "sha256-Z4+hHq2VI4wA1D72dBI7Lt++Rm3q0svjF6AialXxM0k=";
45+
fetchSubmodules = true;
46+
};
47+
48+
patches = [
49+
# https://github.com/shadps4-emu/shadPS4/issues/758
50+
./bloodborne.patch
51+
# Fix controls without a numpad
52+
./laptop-controls.patch
53+
54+
# Disable auto-updating, as
55+
# downloading an AppImage and trying to run it just won't work.
56+
# https://github.com/shadps4-emu/shadPS4/issues/1368
57+
./0001-Disable-update-checking.patch
58+
];
59+
60+
buildInputs = [
61+
alsa-lib
62+
boost184
63+
cryptopp
64+
glslang
65+
ffmpeg
66+
fmt
67+
jack2
68+
libdecor
69+
libpulseaudio
70+
libunwind
71+
libusb1
72+
xorg.libX11
73+
xorg.libXext
74+
magic-enum
75+
mesa
76+
pugixml
77+
qt6.qtbase
78+
qt6.qtdeclarative
79+
qt6.qtmultimedia
80+
qt6.qttools
81+
qt6.qtwayland
82+
rapidjson
83+
renderdoc
84+
sndio
85+
toml11
86+
vulkan-headers
87+
vulkan-loader
88+
vulkan-memory-allocator
89+
xxHash
90+
zlib-ng
91+
];
92+
93+
nativeBuildInputs = [
94+
cmake
95+
pkg-config
96+
qt6.wrapQtAppsHook
97+
];
98+
99+
cmakeFlags = [
100+
(lib.cmakeBool "ENABLE_QT_GUI" true)
101+
];
102+
103+
# Still in development, help with debugging
104+
cmakeBuildType = "RelWithDebugInfo";
105+
dontStrip = true;
106+
107+
installPhase = ''
108+
runHook preInstall
109+
110+
install -D -t $out/bin shadps4
111+
install -Dm644 -t $out/share/icons/hicolor/512x512/apps $src/.github/shadps4.png
112+
install -Dm644 -t $out/share/applications $src/.github/shadps4.desktop
113+
114+
runHook postInstall
115+
'';
116+
117+
fixupPhase = ''
118+
patchelf --add-rpath ${
119+
lib.makeLibraryPath [
120+
vulkan-loader
121+
xorg.libXi
122+
]
123+
} \
124+
$out/bin/shadps4
125+
'';
126+
127+
passthru.updateScript = unstableGitUpdater {
128+
tagFormat = "v.*";
129+
tagPrefix = "v.";
130+
};
131+
132+
meta = {
133+
description = "Early in development PS4 emulator";
134+
homepage = "https://github.com/shadps4-emu/shadPS4";
135+
license = lib.licenses.gpl2Plus;
136+
maintainers = with lib.maintainers; [ ryand56 ];
137+
mainProgram = "shadps4";
138+
platforms = lib.intersectLists lib.platforms.linux lib.platforms.x86_64;
139+
};
140+
}

0 commit comments

Comments
 (0)