diff --git a/.gitignore b/.gitignore index b11f589..01c350a 100644 --- a/.gitignore +++ b/.gitignore @@ -55,3 +55,9 @@ config.h # Published release notes are part of the versioned release. !releases/*.md + +# RPCS3 is discontinued (owner, 2026-10): its build scripts and toolchain stay on +# the development machine only. +tools/build-rpcs3.sh +tools/build-llvm.sh +tooling/rpcs3/ diff --git a/config/LEGAL.txt b/config/LEGAL.txt index 0c47db1..18b5df3 100644 --- a/config/LEGAL.txt +++ b/config/LEGAL.txt @@ -8,15 +8,6 @@ discs, cartridges or digital purchases, and BIOS or firmware files dumped from hardware you own. Downloading or sharing games, BIOS files, firmware or keys you do not own is piracy: do not do it, and do not ask for help with it. -PLAYSTATION 3 (RPCS3) IS NOT IN ANY RELEASE. RPCS3 is licensed -GPL-2.0-only; this port's code is GPL-3.0-or-later, and the two cannot be -distributed together as one program. RPCS3's source is public -(https://github.com/mihawk-99/PS5_RPCS3) and this project's build scripts -build it: if you want it, you must compile the title from source yourself, -for your own console (README.md, "Build from source"). Do not share the -binaries you build. RPCS3 also needs your own PS3 system software -(PS3UPDAT.PUP), your own games and their licence files, under the same rules. - Licences: every part of this title, its licence and its source are listed in licenses/README.txt. Snes9x, FinalBurn Neo and Genesis Plus GX may not be sold or used commercially. diff --git a/releases/v0.6.7-alpha.6.md b/releases/v0.6.7-alpha.6.md new file mode 100644 index 0000000..a9c40e1 --- /dev/null +++ b/releases/v0.6.7-alpha.6.md @@ -0,0 +1,117 @@ +# Pick your frontend. Play it all in RetroArch. + +**PS5 RetroArch v0.6.7-alpha.6** opens on a pre-screen that starts RetroArch or EmulationStation, adds up to four controllers, installs verified updates from the WebUI and fixes the Manual Scan crash. + +[Download the title ZIP](https://github.com/mihawk-99/PS5_RetroArch/releases/download/v0.6.7-alpha.6/PS5_RetroArch-v0.6.7-alpha.6.zip) · [Installation guide](https://github.com/mihawk-99/PS5_RetroArch/tree/v0.6.7-alpha.6#get-started) · [Screenshot catalog](https://github.com/mihawk-99/PS5_RetroArch/tree/v0.6.7-alpha.6/assets/releases/v0.6.7-alpha.6) + +![The pre-screen: choose RetroArch or EmulationStation](https://raw.githubusercontent.com/mihawk-99/PS5_RetroArch/v0.6.7-alpha.6/assets/readme/pre-screen.png) + +

Choose a frontend · RetroArch’s XMB or EmulationStation, both playing every game through RetroArch.
Captured on the console. Both use the same cores, saves, shaders and settings.

+ +## At a glance + +| What’s new | Where to start | +| --- | --- | +| **Pre-screen** · RetroArch or EmulationStation, with your choice remembered if you like | Open the title | +| **EmulationStation** · ES-DE 3.5.0 with Alekfull NX, sound and your RetroArch library | Its card on the pre-screen | +| **Up to four controllers** · one per signed-in PS5 user, each with its own rumble | Sign in on another controller | +| **WebUI** · verified updates from the console, BIOS alerts and **Start with** | `http://:6769` | +| **Display sizes** · 3840×2160, 2560×1440 and 1920×1080 | `video_fullscreen_x`, `video_fullscreen_y` | +| **Fixes** · Manual Scan, the menu’s search and logs you can send | Nothing to set | + +## Two frontends, one RetroArch + +- **A pre-screen when the title starts.** Move with the D-pad, start a frontend with Cross, close the title with Circle. Each card shows the frontend it starts, captured on the console. +- **Remember your choice.** Press Square to switch Remember on, and the title starts that frontend straight away from then on. Hold L1 while the title starts to come back to the pre-screen. The WebUI’s new **Start with** setting changes it from your phone or computer: *Ask every time*, *RetroArch* or *EmulationStation*. +- **Quitting goes where you expect.** Quitting RetroArch or EmulationStation returns to the pre-screen. With a frontend remembered, it closes the title, as RetroArch alone always did. +- **Each frontend runs on its own.** Switching restarts the title as the frontend you chose, in about a second, so each one has the console’s full memory and nothing of the other stays behind. + +## EmulationStation on PS5 + +ES-DE 3.5.0, built for the console. + +- **Alekfull NX by default**, with ES-DE’s own Linear theme also included. +- **Smooth browsing at 58–60 fps**, after an OpenGL driver fix that removed a full-screen cache flush from every frame. +- **Sound.** ES-DE’s navigation sounds play through the PS5’s audio output. +- **Your library, not a second one.** Its systems and game lists come from RetroArch’s playlists every time it starts. A game you add or remove in RetroArch appears or goes in EmulationStation; nothing is scanned twice. +- **Every game starts in RetroArch**, with RetroArch’s cores, saves, states, shaders, overlays, remaps and settings. Close the content and you are back in EmulationStation, on the same game, with its play count and time recorded. +- **Favorites and Last Played.** RetroArch’s favourites, history and play time fill EmulationStation’s Favorites and Last Played collections, and a favourite set in either frontend shows here. + +![EmulationStation’s carousel with the Favorites and Last Played collections](https://raw.githubusercontent.com/mihawk-99/PS5_RetroArch/v0.6.7-alpha.6/assets/releases/v0.6.7-alpha.6/es-de-collections-ps5.png) + +

Favorites and Last Played · the heart and the clock, beside your systems.
Captured on the console.

+ +## Up to four controllers + +- **One controller per signed-in PS5 user.** Player 1 is whoever started the title; each other signed-in user’s controller becomes the next player. +- **Players follow the signed-in users.** A user who signs in during a session takes the first free player within about a second; one who signs out is let go. +- **Per-controller rumble and DualSense haptics.** + +To add a player, turn on another controller and sign in as another user or a guest. + +## The WebUI + +- **Verified updates from the console.** Download a published release and check it; choosing Install closes RetroArch, installs it and closes the title. Open it again to run the new version. Your configuration, saves, states and content are kept. +- **BIOS alerts** tell you when a core’s BIOS file is missing. +- **Start with** chooses the frontend the title opens on. + +## Display + +The Vulkan driver now offers **3840×2160, 2560×1440 and 1920×1080**, not 4K alone. RetroArch still starts at the largest; set `video_fullscreen_x` and `video_fullscreen_y` to choose a smaller one. Each size was checked filling the TV. + +## Fixes + +- **Manual Scan no longer crashes** when you open Content Directory again after creating a playlist. The same fault affected the menu’s search, Explore filtering and Load Content’s return to the last folder; all of them are fixed, and the build now refuses the kind of missing function that caused it. +- **Logs you can send with a bug report.** Each launch keeps its own `trace.txt` (the previous one is `trace.1.txt`), and a game started from EmulationStation logs to `retroarch-game.log`, so it no longer overwrites RetroArch’s own `retroarch.log`. + +## PlayStation 3 + +> I’ve decided to discontinue my RPCS3 port for PS5 due to unresolved licensing compatibility concerns and legal uncertainty around the integration. Resolving those issues would require more time and resources than I’m prepared to commit, so I’m focusing on my other projects. + +No build of this title includes RPCS3 any more. + +## Tested scope and alpha limits + +**Verified on a base PS5, firmware 13.40** + +- The pre-screen, both frontends and every handover between them: choosing, quitting, Remember, **Start with**, and a launch straight into a remembered frontend. +- A game started from EmulationStation in RetroArch, closed through the Quick Menu’s **Close Content**, returning to EmulationStation with its play recorded. +- Two controllers as players 1 and 2 in a racing game. +- RetroArch’s favourites and play time in EmulationStation’s collections. +- EmulationStation’s sound output, checked through its audio device status. +- The display sizes above, each filling the TV. + +**Not yet verified** + +- EmulationStation with more than one controller, and a controller joining or leaving during a RetroArch session. +- Holding L1 on a real pad at launch; the pad read itself works. +- An update installed from the WebUI that closes the title instead of starting the pre-screen (covered by tests). +- EmulationStation’s scraper and other online features, and sound in video previews. +- The PS5 Pro, for the frontends. + +This is an alpha release: compatibility varies by core, game and workload. + +## Install or upgrade + +1. **Back up** your existing title folder. +2. **Merge** the complete `PPSA99169` folder into your launcher’s installation location. It adds two folders, `es-de/` and `picker/`. Preserve your `config`, saves, states, system files and content; do not replace your configuration with a fresh default. +3. **Open the title.** It now opens on the pre-screen. To start RetroArch directly as before, choose it with Remember on, or set **Start with** to RetroArch in the WebUI. + +No games, BIOS files or firmware are included. + +## Licences + +EmulationStation (MIT) and the libraries it uses are listed with their licence texts in the package’s `licenses/`: SDL2, PS5 OpenGL with Mesa, FFmpeg (LGPL-2.1-or-later), curl, Mbed TLS, FreeType, HarfBuzz, ICU, pugixml, libwebp and stb. + +Snes9x, FinalBurn Neo, Genesis Plus GX and the **Alekfull NX** theme (CC BY-NC-SA 2.0) are under non-commercial terms: this release may not be sold, and it carries no donation link. + +## Source and credits + +Built from the commit tagged **v0.6.7-alpha.6**. Corresponding source archives, licence notices and checksums accompany this release, including EmulationStation’s source and the sources of every library it links. See the package’s `licenses/` for exact revisions. + +Thanks to: + +- the ES-DE team (Northwestern Software AB, Leon Styhre and contributors); +- fagnerpc and anthonycaccese for Alekfull NX; +- BlackBearReloaded for PS5 OpenGL and the UI kit the pre-screen is drawn with; +- the ProsperoEden project, whose controller handling the multiplayer support follows. diff --git a/tooling/rpcs3/clang-scan-deps b/tooling/rpcs3/clang-scan-deps deleted file mode 100755 index 0b20ffd..0000000 --- a/tooling/rpcs3/clang-scan-deps +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env bash -# PS5 RetroArch - C++20 module scanning for the cross build. -# Copyright (C) 2026 Mihawk -# SPDX-License-Identifier: GPL-3.0-or-later -# -# clang-scan-deps reads the compile command after "--" without running it, so -# the target, sysroot and library headers the SDK's prospero-clang wrappers add -# must be spelled out here, or the scan finds the host's view of the headers. -set -euo pipefail -sdk=${PS5_PAYLOAD_SDK:?} -flags=(--start-no-unused-arguments -target x86_64-sie-ps5 - -fvisibility-nodllstorageclass=default -isysroot "$sdk" --sysroot "$sdk" - -stdlib++-isystem "$sdk/target/include/c++/v1" -fno-stack-protector -fno-plt - -femulated-tls -fdenormal-fp-math=ieee -frtti -fexceptions - --end-no-unused-arguments) -args=() state=0 -for arg in "$@"; do - args+=("$arg") - case $state in - 0) [[ $arg == -- ]] && state=1 ;; - 1) args+=("${flags[@]}"); state=2 ;; # after the compiler's path - esac -done -exec "${PS5_CLANG_SCAN_DEPS:-clang-scan-deps}" "${args[@]}" diff --git a/tooling/rpcs3/ps5-toolchain.cmake b/tooling/rpcs3/ps5-toolchain.cmake deleted file mode 100644 index b5e5e4b..0000000 --- a/tooling/rpcs3/ps5-toolchain.cmake +++ /dev/null @@ -1,39 +0,0 @@ -# PS5 RetroArch - cross-compile RPCS3's libretro core and its static -# dependencies (LLVM, FFmpeg's CMake users) with this repository's SDK; never -# search host headers or libraries. -# Copyright (C) 2026 Mihawk -# SPDX-License-Identifier: GPL-3.0-or-later -# -# The console's CPU is Zen 2 (AVX2, FMA, BMI2), so code is built for it rather -# than for RPCS3's -march=native. The core's link, as every native core's: -# tools/build-rpcs3.sh passes PS5_CORE_LINK_INPUTS (the core-local destructor -# registry) and PS5_EMPTY_LIBS (empty libm, librt, libpthread, libdl and libutil -# archives, whose functions are the console's own). -set(CMAKE_SYSTEM_NAME FreeBSD) -set(CMAKE_SYSTEM_VERSION 14) -set(CMAKE_SYSTEM_PROCESSOR x86_64) -set(CMAKE_C_COMPILER "$ENV{PS5_PAYLOAD_SDK}/bin/prospero-clang") -set(CMAKE_CXX_COMPILER "$ENV{PS5_PAYLOAD_SDK}/bin/prospero-clang++") -set(CMAKE_AR "$ENV{PS5_PAYLOAD_SDK}/bin/prospero-ar") -set(CMAKE_RANLIB "$ENV{PS5_PAYLOAD_SDK}/bin/prospero-ranlib") -set(CMAKE_FIND_ROOT_PATH "$ENV{PS5_PAYLOAD_SDK}") -set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) -set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) -set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) -set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) -set(CMAKE_POSITION_INDEPENDENT_CODE ON) -# pkg-config answers with no package: the host's would add its /usr/include, -# which shadows the SDK's headers (OpenAL Soft found the host's D-Bus that way). -set(ENV{PKG_CONFIG_LIBDIR} "/nonexistent-pkg-config-for-ps5") -set(ENV{PKG_CONFIG_PATH} "") -set(CMAKE_C_FLAGS_INIT "-march=znver2") -set(CMAKE_CXX_FLAGS_INIT "-march=znver2") -# Configure-time test programs link like an executable against the console's -# libraries; the core itself is a shared object the title's loader binds. -# The empty archives answer configure checks that link -lm and the like. -set(CMAKE_EXE_LINKER_FLAGS_INIT - "-L${PS5_EMPTY_LIBS} -nostdlib -nostartfiles -nodefaultlibs -Wl,-e,0 -lkernel_web -lSceLibcInternal -lScePosixForWebKit") -set(CMAKE_SHARED_LINKER_FLAGS_INIT - "-nostdlib -nodefaultlibs -Wl,-z,undefs -Wl,--build-id=sha1 -Wl,-T,${CMAKE_CURRENT_LIST_DIR}/../native/ps5-core.ld ${PS5_CORE_LINK_INPUTS} -L${PS5_EMPTY_LIBS} -lkernel_web -lSceLibcInternal -lScePosixForWebKit") -# OpenAL Soft is C++20 modules; its dependency scan needs the SDK's view. -set(CMAKE_CXX_COMPILER_CLANG_SCAN_DEPS "${CMAKE_CURRENT_LIST_DIR}/clang-scan-deps") diff --git a/tooling/rpcs3/rpcs3_libretro.info b/tooling/rpcs3/rpcs3_libretro.info deleted file mode 100644 index 98a7edf..0000000 --- a/tooling/rpcs3/rpcs3_libretro.info +++ /dev/null @@ -1,35 +0,0 @@ -# RPCS3's libretro core as this title builds it (tools/build-rpcs3.sh). -# libretro-core-info has no file for RPCS3, so this one is kept here. - -# Software Information -display_name = "Sony - PlayStation 3 (RPCS3)" -authors = "RPCS3 Team" -supported_extensions = "pkg|iso|bin|elf|self|sfo" -corename = "RPCS3" -categories = "Emulator" -license = "GPLv2" -permissions = "" -display_version = "0.0.1" - -# Hardware Information -manufacturer = "Sony" -systemname = "PlayStation 3" -systemid = "playstation3" - -# Libretro Features -database = "Sony - PlayStation 3" -supports_no_game = "false" -savestate = "true" -savestate_features = "basic" -hw_render = "true" -required_hw_api = "Vulkan >= 1.2" -needs_fullpath = "true" - -# BIOS/Firmware -firmware_count = 1 -firmware0_desc = "PS3UPDAT.PUP (PlayStation 3 system software)" -firmware0_path = "RPCS3/PS3UPDAT.PUP" -firmware0_opt = "false" - -notes = "(!) PS3UPDAT.PUP goes in system/RPCS3/ and installs on first start.|A PSN package (.pkg) installs with its .rap licence from the same folder, then boots.|A game boots from its EBOOT.BIN, its folder, or an ISO.|(!) A save state is an RPCS3 savestate: the game resumes from it after it is made, and RPCS3 refuses one while a video decoder or a game save runs." -description = "RPCS3, the PlayStation 3 emulator, as a libretro core: its PPU and SPU LLVM recompilers and its Vulkan renderer, with asynchronous shader compilation." diff --git a/tools/build-llvm.sh b/tools/build-llvm.sh deleted file mode 100755 index 9a1aafa..0000000 --- a/tools/build-llvm.sh +++ /dev/null @@ -1,90 +0,0 @@ -#!/usr/bin/env bash -# Build LLVM for the PS5 as static archives, for RPCS3's PPU and SPU -# recompilers (docs/RPCS3_PORT.md). -# -# The source is my fork of llvm-project, PS5_LLVM (github.com/mihawk-99/PS5_LLVM), -# whose main is llvmorg-22.1.8 -- the revision RPCS3 pins as its -# 3rdparty/llvm/llvm submodule -- plus the changes the console's ABI needs -# (SmallVector's alignment). It is fetched sparsely and built once, outside -# RPCS3's tree, so a change to RPCS3 never rebuilds LLVM: -# X86 only, no tools, tests, docs or examples, no zlib, zstd, libxml2 or -# network, no crash-signal handlers of LLVM's own (the title reports crashes), -# with ccache. The code generators LLVM's build runs (llvm-tblgen and -# llvm-min-tblgen) are built for the host first, from the same tree, so the -# console build defines no tablegen programs of its own. -# -# Output: .deps/native/llvm-ps5 (lib/*.a, include/, lib/cmake/llvm), with the -# revision in .deps/native/llvm-ps5/.revision. -set -euo pipefail -root=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd) -cd "$root" - -revision=98b45cc22e98844b7d49bbedefdfee04a740650a # PS5_LLVM main: llvmorg-22.1.8 and the port -prefix="$root/.deps/native/llvm-ps5" -[[ -f $prefix/.revision && $(<"$prefix/.revision") == "$revision" ]] && { - echo "==> [llvm] $revision already built in $prefix"; exit 0; } - -sdk="$root/.deps/native/ps5-payload-sdk" -[[ -x $sdk/bin/prospero-clang ]] || { echo "error: bootstrap this project's SDK first" >&2; exit 2; } -export PS5_PAYLOAD_SDK="$sdk" PS5_CLANG=${PS5_CLANG:-/usr/bin/clang} - -launcher=() -command -v ccache >/dev/null && launcher=(-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache) -source_dir="$root/.deps/llvm-project" -if [[ ! -d $source_dir/.git ]]; then - echo "==> [llvm] fetching $revision (sparse: llvm, cmake, third-party)" - rm -rf -- "$source_dir" - git init --quiet "$source_dir" - git -C "$source_dir" remote add origin https://github.com/mihawk-99/PS5_LLVM.git - git -C "$source_dir" config remote.origin.promisor true - git -C "$source_dir" config remote.origin.partialclonefilter blob:none - git -C "$source_dir" sparse-checkout set --no-cone /llvm/ /cmake/ /third-party/ -fi -# The sibling ../PS5_LLVM is itself a sparse partial clone, so the fetch is from -# the published fork; a change there is pushed before it is built here. -git -C "$source_dir" remote set-url origin https://github.com/mihawk-99/PS5_LLVM.git -git -C "$source_dir" cat-file -e "$revision^{commit}" 2>/dev/null || - git -C "$source_dir" fetch --quiet --depth 1 --filter=blob:none origin "$revision" -git -C "$source_dir" checkout --force --quiet "$revision" - -# The host's tablegen programs, with the host's compilers. -host_build="$root/build/llvm-host-tblgen" -echo "==> [llvm] host tablegen" -cmake -S "$source_dir/llvm" -B "$host_build" -G Ninja "${launcher[@]}" \ - -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=cc -DCMAKE_CXX_COMPILER=c++ \ - -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF \ - -DLLVM_INCLUDE_BENCHMARKS=OFF -DLLVM_ENABLE_ZLIB=OFF -DLLVM_ENABLE_ZSTD=OFF \ - > "$host_build.configure.log" 2>&1 || { tail -30 "$host_build.configure.log" >&2; exit 1; } -ninja -C "$host_build" -j "${JOBS:-16}" llvm-tblgen llvm-min-tblgen > "$host_build.log" - -build="$root/build/llvm-ps5" -# Empty libm, librt, libpthread, libdl and libutil: configure's checks link -# them, and their functions are the console's own libc and libkernel. -empty_libs="$build-empty-libs" -mkdir -p "$empty_libs" -for lib in m rt pthread dl util; do - [[ -f $empty_libs/lib$lib.a ]] || "$sdk/bin/prospero-ar" rc "$empty_libs/lib$lib.a" -done -echo "==> [llvm] configuring" -cmake -S "$source_dir/llvm" -B "$build" -G Ninja "${launcher[@]}" \ - -DCMAKE_TOOLCHAIN_FILE="$root/tooling/rpcs3/ps5-toolchain.cmake" -DPS5_EMPTY_LIBS="$empty_libs" \ - -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$prefix" \ - -DLLVM_TARGETS_TO_BUILD=X86 \ - -DLLVM_HOST_TRIPLE=x86_64-unknown-freebsd14 -DLLVM_DEFAULT_TARGET_TRIPLE=x86_64-unknown-freebsd14 \ - -DBUILD_SHARED_LIBS=OFF -DLLVM_BUILD_LLVM_DYLIB=OFF -DLLVM_ENABLE_PIC=ON \ - -DLLVM_BUILD_TOOLS=OFF -DLLVM_INCLUDE_TOOLS=OFF -DLLVM_BUILD_UTILS=OFF -DLLVM_INCLUDE_TESTS=OFF \ - -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_BENCHMARKS=OFF -DLLVM_INCLUDE_DOCS=OFF \ - -DLLVM_ENABLE_ZLIB=OFF -DLLVM_ENABLE_ZSTD=OFF -DLLVM_ENABLE_LIBXML2=OFF \ - -DLLVM_ENABLE_LIBEDIT=OFF -DLLVM_ENABLE_LIBPFM=OFF -DLLVM_ENABLE_CURL=OFF \ - -DLLVM_ENABLE_HTTPLIB=OFF -DLLVM_ENABLE_BACKTRACES=OFF -DLLVM_ENABLE_CRASH_OVERRIDES=OFF \ - -DLLVM_ENABLE_THREADS=ON -DLLVM_ENABLE_WARNINGS=OFF \ - -DLLVM_NATIVE_TOOL_DIR="$host_build/bin" \ - > "$build.configure.log" 2>&1 || { tail -40 "$build.configure.log" >&2; exit 1; } -# The libraries only: the tablegen programs stay defined for the console too, -# and would link as console programs with a C++ runtime the core never links. -echo "==> [llvm] building the libraries" -mapfile -t libraries < <(ninja -C "$build" -t targets all | sed -n 's/^\(lib\/libLLVM[^:]*\.a\): .*/\1/p') -ninja -C "$build" -j "${JOBS:-16}" "${libraries[@]}" -cmake --install "$build" > "$build.install.log" -printf '%s\n' "$revision" > "$prefix/.revision" -printf '==> [llvm] %s: %s of archives in %s\n' "$revision" "$(du -sh "$prefix/lib" | cut -f1)" "$prefix" diff --git a/tools/build-rpcs3.sh b/tools/build-rpcs3.sh deleted file mode 100755 index 784d5df..0000000 --- a/tools/build-rpcs3.sh +++ /dev/null @@ -1,144 +0,0 @@ -#!/usr/bin/env bash -# Cross-build RPCS3's libretro core (PlayStation 3), from my fork ../PS5_RPCS3 -# (github.com/mihawk-99/PS5_RPCS3) at its pinned revision (tools/core-fork.sh), -# with the fork's BUILD_LIBRETRO configuration (docs/RPCS3_PORT.md). -# -# Output: build/cores/stage/{cores,info}/rpcs3_libretro.{so,info}; build-title.sh -# stages those in /app0. It links the static LLVM (tools/build-llvm.sh), FFmpeg -# (tools/build-ffmpeg.sh) and libiconv (tools/build-libiconv.sh) this repository -# builds, and loads Vulkan through volk from the frontend's device, so it links -# no Vulkan loader. -set -euo pipefail -root=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd) -cd "$root" -core_name=rpcs3 -source "$root/tools/core-stamp.sh" -source "$root/tools/core-fork.sh" -bash "$root/tools/build-llvm.sh" -bash "$root/tools/build-ffmpeg.sh" -bash "$root/tools/build-libiconv.sh" -core_stamp_skip rpcs3 \ - "$root/build/cores/stage/cores/rpcs3_libretro.so" \ - "$root/build/cores/stage/info/rpcs3_libretro.info" \ - "$root/build/cores/stage/system/RPCS3/fonts" \ - "$root/build/cores/stage/system/RPCS3/Icons" \ - "$root/build/cores/stage/system/RPCS3/patches/patch.yml" \ - "$root/build/cores/stage/system/RPCS3/game_configs/config_database.json" \ - -- "$root/tools/build-rpcs3.sh" "$root/tools/core-fork.sh" "$root/tooling/rpcs3" \ - "$root/.deps/native/llvm-ps5/.revision" "$root/.deps/native/ffmpeg-ps5/.stamp" \ - "$root/.deps/native/libiconv-ps5/.stamp" -[[ $# == 0 ]] || { echo "usage: ${0##*/}" >&2; exit 2; } - -revision=2ada8e453c592d8764d2801a667f3da415794918 # ../PS5_RPCS3 main -core_fork_setup -core_fork_checkout PS5_RPCS3 "$revision" -core_info="$root/tooling/rpcs3/rpcs3_libretro.info" - -# The submodules the libretro configuration builds, and only those: LLVM and -# FFmpeg are this repository's own builds, and Qt, SDL, OpenAL, cubeb, hidapi -# and the rest are left out. RPCS3 names them relative to its GitHub home. -submodules=( - 3rdparty/asmjit/asmjit 3rdparty/glslang/glslang 3rdparty/zlib/zlib - 3rdparty/zstd/zstd 3rdparty/libpng/libpng 3rdparty/yaml-cpp/yaml-cpp - 3rdparty/pugixml 3rdparty/SoundTouch/soundtouch 3rdparty/fusion/fusion - 3rdparty/GPUOpen/VulkanMemoryAllocator 3rdparty/stblib/stb - 3rdparty/wolfssl/wolfssl 3rdparty/curl/curl 3rdparty/protobuf/protobuf - 3rdparty/miniupnp/miniupnp 3rdparty/rtmidi/rtmidi 3rdparty/libusb/libusb - 3rdparty/7zip/7zip 3rdparty/discord-rpc/discord-rpc 3rdparty/OpenAL/openal-soft - 3rdparty/feralinteractive/feralinteractive -) -for path in "${submodules[@]}"; do - name=$(git -C "$source_dir" config -f .gitmodules --get-regexp '^submodule\..*\.path$' | - awk -v p="$path" '$2 == p {sub(/^submodule\./, "", $1); sub(/\.path$/, "", $1); print $1}') - url=$(git -C "$source_dir" config -f .gitmodules "submodule.$name.url") - [[ $url == ../../* ]] && url="https://github.com/${url#../../}" - git -C "$source_dir" config "submodule.$name.url" "$url" -done -git -C "$source_dir" submodule update --init --depth 1 --quiet -- "${submodules[@]}" - -# Vulkan's headers at the version the console's driver was built with, and volk. -fetch_pinned() { # name url digest -> the extracted directory in $core_work - local name=$1 url=$2 digest=$3 archive="$root/.deps/downloads/$1.tar.gz" - [[ -f $archive ]] || curl --fail --location --retry 3 "$url" -o "$archive" - printf '%s %s\n' "$digest" "$archive" | sha256sum --check --status || { - echo "error: $name archive digest mismatch" >&2; exit 1; } - rm -rf -- "$core_work/$name" - mkdir -p "$core_work/$name" - tar -xzf "$archive" -C "$core_work/$name" --strip-components=1 -} -fetch_pinned vulkan-headers-1.4.354 \ - https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/v1.4.354.tar.gz \ - 4ca3606e57728febf8aef097c9d7ba6c52385955bb4a6dc06fcf9fc3d76541de -fetch_pinned volk-1.4.350.1 \ - https://github.com/zeux/volk/archive/refs/tags/vulkan-sdk-1.4.350.1.tar.gz \ - 078a9411298e4e0f60f5f5398c890783427c25a414619294ca8e69587bbd5eae - -llvm="$root/.deps/native/llvm-ps5" -ffmpeg="$root/.deps/native/ffmpeg-ps5/lib" -build="$core_work/build" -cmake -S "$source_dir" -B "$build" -G Ninja \ - ${core_ccache:+-DCMAKE_C_COMPILER_LAUNCHER=$core_ccache -DCMAKE_CXX_COMPILER_LAUNCHER=$core_ccache} \ - -DCMAKE_TOOLCHAIN_FILE="$root/tooling/rpcs3/ps5-toolchain.cmake" \ - -DPS5_CORE_LINK_INPUTS="$core_work/core_cxx_runtime.o" -DPS5_EMPTY_LIBS="$core_work/empty-libs" \ - -DCMAKE_BUILD_TYPE=Release -DBUILD_LIBRETRO=ON \ - `# zstd's trace hooks are weak imports nothing on the console defines.` \ - -DCMAKE_C_FLAGS="-march=znver2 -DZSTD_TRACE=0" -DCMAKE_CXX_FLAGS="-march=znver2 -DZSTD_TRACE=0" \ - -DUSE_NATIVE_INSTRUCTIONS=OFF -DUSE_LTO=OFF -DUSE_PRECOMPILED_HEADERS=OFF \ - -DWITH_LLVM=ON -DBUILD_LLVM=OFF -DSTATIC_LINK_LLVM=ON -DLLVM_DIR="$llvm/lib/cmake/llvm" \ - -DUSE_FAUDIO=OFF -DUSE_SDL=OFF -DUSE_LIBEVDEV=OFF -DUSE_DISCORD_RPC=OFF -DUSE_GAMEMODE=OFF \ - `# zlib: the pinned build this repository makes for the frontend (libpng's` \ - `# generated configuration cannot see the submodule's headers).` \ - -DUSE_SYSTEM_ZLIB=ON -DZLIB_INCLUDE_DIR="$root/.deps/native/zlib/root/usr/include" \ - -DZLIB_LIBRARY="$root/.deps/native/zlib/root/usr/lib/libz.a" \ - -DUSE_VULKAN=ON -DUSE_SYSTEM_CURL=OFF -DUSE_SYSTEM_OPENCV=OFF -DUSE_SYSTEM_OPENAL=OFF \ - -DUSE_SYSTEM_SDL=OFF -DUSE_SYSTEM_FFMPEG=ON \ - -DFFMPEG_INCLUDE_DIR="$root/.deps/native/ffmpeg-ps5/include" \ - -DFFMPEG_LIBRARIES="$ffmpeg/libavformat.a;$ffmpeg/libavcodec.a;$ffmpeg/libswscale.a;$ffmpeg/libswresample.a;$ffmpeg/libavutil.a" \ - `# cellL10n's character sets: the console's libc has no iconv.` \ - -DIconv_INCLUDE_DIR="$root/.deps/native/libiconv-ps5/include" \ - -DIconv_LIBRARY="$root/.deps/native/libiconv-ps5/lib/libiconv.a" -DIconv_IS_BUILT_IN=OFF \ - -DRPCS3_VULKAN_HEADERS_DIR="$core_work/vulkan-headers-1.4.354" \ - -DRPCS3_VOLK_DIR="$core_work/volk-1.4.350.1" \ - > "$core_work/configure.log" 2>&1 || { tail -40 "$core_work/configure.log" >&2; exit 1; } -cmake --build "$build" --target rpcs3_libretro --parallel "${JOBS:-16}" -built=$(find "$build" -name rpcs3_libretro.so -print -quit) -[[ -n $built ]] || { echo "error: no rpcs3_libretro.so was produced" >&2; exit 2; } -# The typeface of the core's loading screen (rpcs3/libretro/libretro_loader.cpp), -# Inter 4.1 under the SIL Open Font License, with its licence, in -# /RPCS3/fonts. The firmware's own fonts are its fallback. -inter="$root/.deps/downloads/Inter-4.1.zip" -[[ -f $inter ]] || curl --fail --location --retry 3 \ - https://github.com/rsms/inter/releases/download/v4.1/Inter-4.1.zip -o "$inter" -printf '%s %s\n' 9883fdd4a49d4fb66bd8177ba6625ef9a64aa45899767dde3d36aa425756b11e "$inter" | - sha256sum --check --status || { echo "error: Inter archive digest mismatch" >&2; exit 1; } -fonts="$root/build/cores/stage/system/RPCS3/fonts" -rm -rf -- "$fonts" -mkdir -p "$fonts" -unzip -q -j -o "$inter" extras/ttf/Inter-Regular.ttf extras/ttf/Inter-SemiBold.ttf LICENSE.txt -d "$fonts" -mv -- "$fonts/LICENSE.txt" "$fonts/Inter-LICENSE.txt" - -# RPCS3's own overlay images (bin/Icons/ui: the pad glyphs, the save and -# loading icons its native dialogs draw), where it looks for them: its folder. -icons="$root/build/cores/stage/system/RPCS3/Icons" -rm -rf -- "$icons" -mkdir -p "$icons" -cp -a -- "$source_dir/bin/Icons/ui" "$icons/ui" - -# RPCS3's game patch database and the fork's patches for games it lacks (the -# fork's bin/patches: their sources in SOURCE), where RPCS3 reads them: its -# config folder's patches/. The core turns each game's frame-rate patch on when -# content loads (a core option). -patches="$root/build/cores/stage/system/RPCS3/patches" -rm -rf -- "$patches" -mkdir -p "$patches" -cp -- "$source_dir"/bin/patches/*.yml "$patches/" - -# RPCS3's per-game configuration database (the fork's bin/game_configs: its -# source in SOURCE), which the core answers RPCS3's boot with (a core option). -game_configs="$root/build/cores/stage/system/RPCS3/game_configs" -rm -rf -- "$game_configs" -mkdir -p "$game_configs" -cp -- "$source_dir/bin/game_configs/config_database.json" "$game_configs/" - -core_fork_stage "$built" "$core_info" "$revision" tools/build-rpcs3.sh \ - tooling/rpcs3/ps5-toolchain.cmake tooling/rpcs3/rpcs3_libretro.info