mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-26 02:11:36 -04:00
21e57a82cc
beetle_libretro.cpp targets the C++ beetle-psx tree; upstream master has been converted to plain C and no longer compiles against it. Documented the working recipe: pin beetle-psx at 5759277b (the wtrace patch's base, located via the patch's own blob hash), apply beetle_wtrace_hook.patch, and apply the new beetle_sio_trace_hook.patch — FrontIO::SetSIOTraceCallback (fires once per completed SIO byte exchange), a hook beetle_libretro.cpp required that was missing from the committed patch set. Verified on Linux/Xvfb: psx-beetle boots Kula World to demo gameplay and serves ping/screenshot over the shared TCP debug protocol, alongside kula-runtime — the two-process oracle setup from CLAUDE.md §16 now works in this environment. Runtime-created per-game .mcr files are gitignored. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BdjxoRB1f9VQsNzZayCgGS
1.6 KiB
1.6 KiB
Building psx-beetle on Linux
The psx-beetle oracle builds and runs on Linux with the same wire protocol as on Windows. Verified 2026-07-02 (Kula World boots to demo gameplay; ping/screenshot served over the TCP debug protocol).
beetle-psx checkout
runtime/src/beetle_libretro.cpp targets the C++ beetle-psx tree. Upstream
master has since been converted to plain C (libretro.cpp -> libretro.c,
PS_CPU class dropped), which no longer compiles against our integration.
Pin the checkout to the last compatible commit — the same base
docs/beetle_wtrace_hook.patch was generated from:
git clone https://github.com/libretro/beetle-psx-libretro.git beetle-psx
cd beetle-psx
git checkout 5759277b # "audit pass" — last C++-tree base we target
patch -p1 < ../docs/beetle_wtrace_hook.patch
patch -p1 < ../docs/beetle_sio_trace_hook.patch
beetle_sio_trace_hook.patch adds FrontIO::SetSIOTraceCallback (fires per
completed SIO byte exchange) — an integration hook beetle_libretro.cpp needs
that predated the committed wtrace patch.
Build
# Static lib. On unix the artifact is named mednafen_psx_libretro.so but is
# an ar archive (STATIC_LINKING=1); stage it under the name cmake expects.
make platform=unix STATIC_LINKING=1 HAVE_LIGHTREC=0 -j"$(nproc)"
cp mednafen_psx_libretro.so libmednafen_psx.a
cd ../runtime
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DPSX_LAUNCHER=OFF -DPSX_DEBUG_TOOLS=ON
ninja -C build psx-beetle
# Headless run (picks the next free port from 4380 if taken; watch stderr)
xvfb-run -a ./runtime/build/psx-beetle ../bios/SCPH1001.BIN --disc <game.cue>