Skip to content

Commit 5a187f2

Browse files
committed
lr-ppsspp: fix libretro runtime missing symbol
Core on v1.13.2 fails to run on Pi4 with the error: ... [ERROR] Failed to open libretro core: "/opt/retropie/libretrocores/lr-ppsspp/ppsspp_libretro.so" Error(s): /opt/retropie/libretrocores/lr-ppsspp/ppsspp_libretro.so: undefined symbol: hostAttemptBlockSize This was fixed upstream with commits 1cd34f9d2bef6c92ed457c6aa85bf4d9b5111e90 and 7c5d36eca76c905a122c1, which are combined in the .diff file in this commit.
1 parent 8c8d685 commit 5a187f2

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

scriptmodules/emulators/ppsspp.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ function sources_ppsspp() {
5858
applyPatch "$md_data/gles2_fix.diff"
5959
fi
6060

61+
# fix missing exported symbol for libretro on v1.13.2
62+
if [[ "$md_id" == "lr-ppsspp" && "$(_get_release_ppsspp)" == "v1.13.2" ]]; then
63+
applyPatch "$md_data/v13-libretro_fix.diff"
64+
fi
65+
6166
if hasPackage cmake 3.6 lt; then
6267
cd ..
6368
mkdir -p cmake
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
diff --git a/Core/HLE/__sceAudio.cpp b/Core/HLE/__sceAudio.cpp
2+
index 3176d26..f05ad9d 100644
3+
--- a/Core/HLE/__sceAudio.cpp
4+
+++ b/Core/HLE/__sceAudio.cpp
5+
@@ -82,6 +82,11 @@ static bool m_logAudio;
6+
static int chanQueueMaxSizeFactor;
7+
static int chanQueueMinSizeFactor;
8+
9+
+// Accessor for libretro
10+
+int __AudioGetHostAttemptBlockSize() {
11+
+ return hostAttemptBlockSize;
12+
+}
13+
+
14+
static void hleAudioUpdate(u64 userdata, int cyclesLate) {
15+
// Schedule the next cycle first. __AudioUpdate() may consume cycles.
16+
CoreTiming::ScheduleEvent(audioIntervalCycles - cyclesLate, eventAudioUpdate, 0);
17+
diff --git a/Core/HLE/__sceAudio.h b/Core/HLE/__sceAudio.h
18+
index ae9ca35..f26ae0d 100644
19+
--- a/Core/HLE/__sceAudio.h
20+
+++ b/Core/HLE/__sceAudio.h
21+
@@ -50,6 +50,8 @@ int __AudioMix(short *outstereo, int numSamples, int sampleRate);
22+
void __AudioGetDebugStats(char *buf, size_t bufSize);
23+
void __PushExternalAudio(const s32 *audio, int numSamples); // Should not be used in-game, only at the menu!
24+
25+
+int __AudioGetHostAttemptBlockSize();
26+
+
27+
// Audio Dumping stuff
28+
void __StartLogAudio(const Path &filename);
29+
void __StopLogAudio();
30+
diff --git a/libretro/libretro.cpp b/libretro/libretro.cpp
31+
index eacbca2..26f2cf6 100644
32+
--- a/libretro/libretro.cpp
33+
+++ b/libretro/libretro.cpp
34+
@@ -379,7 +379,7 @@ class LibretroHost : public Host
35+
void InitSound() override {}
36+
void UpdateSound() override
37+
{
38+
- extern int hostAttemptBlockSize;
39+
+ int hostAttemptBlockSize = __AudioGetHostAttemptBlockSize();
40+
const int blockSizeMax = 512;
41+
static int16_t audio[blockSizeMax * 2];
42+
assert(hostAttemptBlockSize <= blockSizeMax);

0 commit comments

Comments
 (0)