Compare commits
279 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 595e42c4f3 | |||
| 9288565676 | |||
| 00a1c7278a | |||
| 5ca19eabd5 | |||
| 198c2e9eb8 | |||
| df5b624e45 | |||
| 37a125ddbd | |||
| 3624dac22b | |||
| b8f4aaa6fb | |||
| 8cee5a33d0 | |||
| a9d4e1399a | |||
| 0f3275ec82 | |||
| 45c6e938a5 | |||
| 1ec3de9e8f | |||
| 35ccd63dbc | |||
| 188151fa99 | |||
| 16b05c930f | |||
| f39d82f990 | |||
| bbd91dad92 | |||
| cc1b4c8fd1 | |||
| 3b6afc1d9a | |||
| b30a20c2dc | |||
| 60db25980f | |||
| 8396cc2300 | |||
| 41e036473a | |||
| daa53c8642 | |||
| 99c9c16187 | |||
| 94cd6a6f9e | |||
| 4fa3aaf2b5 | |||
| 34f0e865ac | |||
| cb7c3488ab | |||
| 759ef0f5b0 | |||
| 585305f434 | |||
| cee868560a | |||
| 0fb8091a31 | |||
| bf5056145e | |||
| 34380b1ee7 | |||
| f27315c821 | |||
| 794abe2025 | |||
| e29cd4cc93 | |||
| 0f1735d0df | |||
| 07abde4e8d | |||
| 3f174b2a97 | |||
| 4c20bdcc9f | |||
| f2a17e4898 | |||
| b9bdbfa55b | |||
| 9e7268ed6d | |||
| 7c8b915ba1 | |||
| 9ede04c4b9 | |||
| 8a0eae0ccd | |||
| f6429a1ae8 | |||
| bc93fdf9f4 | |||
| 064c006339 | |||
| 260c986186 | |||
| 3b49420205 | |||
| f5cf818bcc | |||
| 2d7b72a769 | |||
| 2b7bb9ef0a | |||
| e22c83f4ce | |||
| 3585881a6c | |||
| 6bfb33279f | |||
| 89efca9f63 | |||
| bfea622999 | |||
| e075170cc4 | |||
| c7d7f2d03b | |||
| fec2be87f6 | |||
| 6de8861b4e | |||
| 48667d68b2 | |||
| a6b5c7e79f | |||
| a29758de6e | |||
| ff992a67c8 | |||
| aaf84a8445 | |||
| b7b0e06a54 | |||
| 53dcf2ba00 | |||
| 2064bd87e3 | |||
| dc63f2fc1f | |||
| 0faa8945bc | |||
| b30a44c136 | |||
| 8a1b323749 | |||
| 27fe5c6604 | |||
| ed3d2a096c | |||
| 49029c9b98 | |||
| 2f5a66581f | |||
| 3f321c61f3 | |||
| 765e72dcb7 | |||
| d3cd3e9650 | |||
| e29832fa00 | |||
| 6b272ed563 | |||
| 3df370a7e6 | |||
| dd490fc725 | |||
| 1e63088b3e | |||
| 8dfd7e126e | |||
| 66c7dd1381 | |||
| 9290422fea | |||
| 365b2939f6 | |||
| 97bbc2d419 | |||
| 06798ef729 | |||
| c6f5abe59f | |||
| 9f92824721 | |||
| 7f2dec46ca | |||
| 236dc96689 | |||
| 7cfe96a1d1 | |||
| b2469039af | |||
| 8f066541a3 | |||
| 4c234dc744 | |||
| 6a07c3f46d | |||
| 3bb21db71b | |||
| aeaa62a28c | |||
| 93dbdead24 | |||
| 93fd33a19a | |||
| ebf9374ccd | |||
| 43b2ce6577 | |||
| 7a6b34cac3 | |||
| 98aaafe4a4 | |||
| 294050986f | |||
| 3eb8fdaef4 | |||
| 622fe1ce47 | |||
| f1e679d981 | |||
| 8ba48932d3 | |||
| 55aae4dd40 | |||
| ad90f8b44b | |||
| 588cf69dad | |||
| 1c08439907 | |||
| 96cf5c4e63 | |||
| db3d9cd217 | |||
| 3e0cfc651d | |||
| 4df51025e5 | |||
| 97feb4eed4 | |||
| 086ab3cb37 | |||
| b7311bd6db | |||
| b0b0ed7634 | |||
| cafc2aa9d0 | |||
| 8f8032b5a8 | |||
| 0e2584fc9f | |||
| 818b11fd2f | |||
| 0ee3e24b25 | |||
| fb420d5989 | |||
| 9b09fba811 | |||
| 33d79ee2cd | |||
| a907cc838b | |||
| 29cb4f59bd | |||
| 9dfaca4cd8 | |||
| 318385787a | |||
| 11464f0793 | |||
| 11087a973c | |||
| 2e4a187145 | |||
| d854ff03fe | |||
| f883718b23 | |||
| b9f5d85d16 | |||
| 131eee2eed | |||
| 590a0bbcad | |||
| ae8e28282c | |||
| 1e0909c579 | |||
| fbd5bbcfa3 | |||
| 7a12e80666 | |||
| a646a66ead | |||
| b41c2754ce | |||
| 4b07ac4f27 | |||
| f70b5e0c1c | |||
| ef9ff09e17 | |||
| a5f570996f | |||
| aec981935c | |||
| 27ebd182e7 | |||
| 3e49c32c9c | |||
| d91c11deb0 | |||
| 2ef8dce8cf | |||
| 0f85e9123e | |||
| 760c35eec8 | |||
| eaebd3426e | |||
| d7b723cd7c | |||
| 1591b7f5a6 | |||
| 7090f16ff3 | |||
| a0f2f006b1 | |||
| 72851d7d44 | |||
| caaee9b7cc | |||
| d656420cc4 | |||
| df72f4abed | |||
| 960e2a9ed8 | |||
| 57f162c3c4 | |||
| 2d42a4e25b | |||
| 8f8d468774 | |||
| 4a12f70f2c | |||
| ee1886fad9 | |||
| 5fd6d413d7 | |||
| ec7f666c6b | |||
| d5bf11703d | |||
| cf94be2aac | |||
| 100a402cd8 | |||
| 86b559ab52 | |||
| c199a96dac | |||
| f45742df52 | |||
| 578d30d3ae | |||
| a6321caaa2 | |||
| 4842339f9e | |||
| aa220d24e8 | |||
| d9edf98d55 | |||
| cf6aaaa74f | |||
| 25b412a90f | |||
| d584575984 | |||
| 7e9e0f56fb | |||
| 8188c45b9d | |||
| 1f731afbd9 | |||
| 9781690918 | |||
| cd6dfc82a2 | |||
| ae6bdf84f1 | |||
| ad65878c0c | |||
| 50fcee6fe0 | |||
| 4431f6b3d9 | |||
| 84ddcea45a | |||
| 6eeca69c56 | |||
| 484d97caf1 | |||
| b2768bbd61 | |||
| 9faf9a6145 | |||
| 36bce33684 | |||
| f712de0c91 | |||
| a8624682a7 | |||
| 4dc994833d | |||
| 98e64d7821 | |||
| 6bd4f52173 | |||
| 41a5c69db4 | |||
| f2afdee40c | |||
| 19129eddd7 | |||
| be77083a2b | |||
| 49bcc93072 | |||
| a53f2fc7b9 | |||
| f4dffd985b | |||
| 59a1f81e86 | |||
| a2d76aedaa | |||
| 59f9a7c080 | |||
| 714359b544 | |||
| bc1d0b9e65 | |||
| 407cbf9690 | |||
| 4cd75971f0 | |||
| 38daf8d325 | |||
| 095f433f8e | |||
| fa11af1cba | |||
| 48f39acac7 | |||
| 257043529a | |||
| 2533aa02d0 | |||
| 27510f5fa8 | |||
| acdb0ee729 | |||
| 673cc040fa | |||
| eff25ed0aa | |||
| ab45b1bf61 | |||
| 1d2f6404c6 | |||
| d6d7ae35f8 | |||
| 990e002782 | |||
| 6c083d6184 | |||
| ef5a4bf7e4 | |||
| c22d2b51bb | |||
| 72a19a87b6 | |||
| 1bfd1154f5 | |||
| 0bd6aee8c8 | |||
| e3a938fb76 | |||
| db89f55ca1 | |||
| 27033ee0cb | |||
| 90df8baa5f | |||
| 1eb0b2260d | |||
| 9fb7c8f52c | |||
| 9b256d71a9 | |||
| 8f26c01ae5 | |||
| 113679ead8 | |||
| c2b93317ad | |||
| a0e0a6c6a6 | |||
| cc37a40f40 | |||
| aab40bd269 | |||
| 44bd0568e7 | |||
| c83769e79e | |||
| e65755d68d | |||
| 643d1102cc | |||
| ea6bb77d57 | |||
| 050d2d3b2f | |||
| 8d55db334e | |||
| ee06dccdea | |||
| 8d7484df89 | |||
| ae72de3881 | |||
| cfbc416521 | |||
| 05ae739a22 | |||
| f50b9cd5c4 |
@@ -1,121 +0,0 @@
|
||||
#!/bin/sh -ex
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
export HOMEBREW_NO_AUTO_UPDATE=1
|
||||
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
|
||||
export HOMEBREW_NO_ENV_HINTS=1
|
||||
export HOMEBREW_NO_INSTALL_CLEANUP=1
|
||||
|
||||
brew install -f --overwrite --quiet googletest opencv@4 ffmpeg@5 "llvm@$LLVM_COMPILER_VER" sdl3 vulkan-headers vulkan-loader
|
||||
brew unlink --quiet ffmpeg qtbase qtsvg qtdeclarative
|
||||
|
||||
brew link -f --quiet "llvm@$LLVM_COMPILER_VER" ffmpeg@5
|
||||
|
||||
# moltenvk based on commit for 1.4.0 release
|
||||
export HOMEBREW_DEVELOPER=1 # Prevents blocking of local formulae
|
||||
wget https://raw.githubusercontent.com/Homebrew/homebrew-core/ea2bec5f1f4384e188d7fc0702ab21a20a2ced08/Formula/m/molten-vk.rb
|
||||
/opt/homebrew/bin/brew install -f --overwrite --formula --quiet ./molten-vk.rb
|
||||
export HOMEBREW_DEVELOPER=0
|
||||
|
||||
export CXX=clang++
|
||||
export CC=clang
|
||||
|
||||
export BREW_PATH;
|
||||
BREW_PATH="$(brew --prefix)"
|
||||
export BREW_BIN="/opt/homebrew/bin"
|
||||
export BREW_SBIN="/opt/homebrew/sbin"
|
||||
export CMAKE_EXTRA_OPTS='-DLLVM_TARGETS_TO_BUILD=arm64'
|
||||
|
||||
export WORKDIR;
|
||||
WORKDIR="$(pwd)"
|
||||
|
||||
# Setup ccache
|
||||
if [ ! -d "$CCACHE_DIR" ]; then
|
||||
mkdir -p "$CCACHE_DIR"
|
||||
fi
|
||||
|
||||
# Get Qt
|
||||
if [ ! -d "/tmp/Qt/$QT_VER" ]; then
|
||||
mkdir -p "/tmp/Qt"
|
||||
git clone https://github.com/engnr/qt-downloader.git
|
||||
cd qt-downloader
|
||||
git checkout f52efee0f18668c6d6de2dec0234b8c4bc54c597
|
||||
sed -i '' "s/'qt{0}_{0}{1}{2}'.format(major, minor, patch)]))/'qt{0}_{0}{1}{2}'.format(major, minor, patch), 'qt{0}_{0}{1}{2}'.format(major, minor, patch)]))/g" qt-downloader
|
||||
sed -i '' "s/'{}\/{}\/qt{}_{}\/'/'{0}\/{1}\/qt{2}_{3}\/qt{2}_{3}\/'/g" qt-downloader
|
||||
cd "/tmp/Qt"
|
||||
pip3 install py7zr requests semantic_version lxml --no-cache --break-system-packages
|
||||
mkdir -p "$QT_VER/macos" ; ln -s "macos" "$QT_VER/clang_64"
|
||||
sed -i '' 's/args\.version \/ derive_toolchain_dir(args) \/ //g' "$WORKDIR/qt-downloader/qt-downloader"
|
||||
python3 "$WORKDIR/qt-downloader/qt-downloader" macos desktop "$QT_VER" clang_64 --opensource --addons qtmultimedia qtimageformats -o "$QT_VER/clang_64"
|
||||
fi
|
||||
|
||||
cd "$WORKDIR"
|
||||
ditto "/tmp/Qt/$QT_VER" "qt-downloader/$QT_VER"
|
||||
|
||||
export Qt6_DIR="$WORKDIR/qt-downloader/$QT_VER/clang_64/lib/cmake/Qt$QT_VER_MAIN"
|
||||
export SDL3_DIR="$BREW_PATH/opt/sdl3/lib/cmake/SDL3"
|
||||
|
||||
export PATH="$BREW_PATH/opt/llvm@$LLVM_COMPILER_VER/bin:$WORKDIR/qt-downloader/$QT_VER/clang_64/bin:$BREW_BIN:$BREW_SBIN:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Apple/usr/bin:$PATH"
|
||||
export LDFLAGS="-L$BREW_PATH/lib $BREW_PATH/opt/ffmpeg@5/lib/libavcodec.dylib $BREW_PATH/opt/ffmpeg@5/lib/libavformat.dylib $BREW_PATH/opt/ffmpeg@5/lib/libavutil.dylib $BREW_PATH/opt/ffmpeg@5/lib/libswscale.dylib $BREW_PATH/opt/ffmpeg@5/lib/libswresample.dylib $BREW_PATH/opt/llvm@$LLVM_COMPILER_VER/lib/c++/libc++.1.dylib $BREW_PATH/lib/libSDL3.dylib $BREW_PATH/lib/libGLEW.dylib $BREW_PATH/opt/llvm@$LLVM_COMPILER_VER/lib/unwind/libunwind.1.dylib -Wl,-rpath,$BREW_PATH/lib"
|
||||
export CPPFLAGS="-I$BREW_PATH/include -D__MAC_OS_X_VERSION_MIN_REQUIRED=144000"
|
||||
export CFLAGS="-D__MAC_OS_X_VERSION_MIN_REQUIRED=144000"
|
||||
export LIBRARY_PATH="$BREW_PATH/lib"
|
||||
export LD_LIBRARY_PATH="$BREW_PATH/lib"
|
||||
|
||||
export VULKAN_SDK
|
||||
VULKAN_SDK="$BREW_PATH/opt/molten-vk"
|
||||
ln -s "$BREW_PATH/opt/vulkan-loader/lib/libvulkan.dylib" "$VULKAN_SDK/lib/libvulkan.dylib" || true
|
||||
|
||||
export LLVM_DIR
|
||||
LLVM_DIR="$BREW_PATH/opt/llvm@$LLVM_COMPILER_VER"
|
||||
# exclude ffmpeg, LLVM, opencv, and sdl from submodule update
|
||||
# shellcheck disable=SC2046
|
||||
git submodule -q update --init --depth=1 --jobs=8 $(awk '/path/ && !/ffmpeg/ && !/llvm/ && !/opencv/ && !/SDL/ && !/feralinteractive/ { print $3 }' .gitmodules)
|
||||
|
||||
mkdir build && cd build || exit 1
|
||||
|
||||
export MACOSX_DEPLOYMENT_TARGET=14.4
|
||||
|
||||
"$BREW_PATH/bin/cmake" .. \
|
||||
-DBUILD_RPCS3_TESTS="${RUN_UNIT_TESTS}" \
|
||||
-DRUN_RPCS3_TESTS="${RUN_UNIT_TESTS}" \
|
||||
-DUSE_SDL=ON \
|
||||
-DUSE_DISCORD_RPC=ON \
|
||||
-DUSE_VULKAN=ON \
|
||||
-DUSE_ALSA=OFF \
|
||||
-DUSE_PULSE=OFF \
|
||||
-DUSE_AUDIOUNIT=ON \
|
||||
-DUSE_SYSTEM_FFMPEG=ON \
|
||||
-DLLVM_CCACHE_BUILD=OFF \
|
||||
-DLLVM_BUILD_RUNTIME=OFF \
|
||||
-DLLVM_BUILD_TOOLS=OFF \
|
||||
-DLLVM_INCLUDE_DOCS=OFF \
|
||||
-DLLVM_INCLUDE_EXAMPLES=OFF \
|
||||
-DLLVM_INCLUDE_TESTS=OFF \
|
||||
-DLLVM_INCLUDE_TOOLS=OFF \
|
||||
-DLLVM_INCLUDE_UTILS=OFF \
|
||||
-DLLVM_USE_PERF=OFF \
|
||||
-DLLVM_ENABLE_Z3_SOLVER=OFF \
|
||||
-DUSE_NATIVE_INSTRUCTIONS=OFF \
|
||||
-DUSE_SYSTEM_MVK=ON \
|
||||
-DUSE_SYSTEM_FAUDIO=OFF \
|
||||
-DUSE_SYSTEM_SDL=ON \
|
||||
-DUSE_SYSTEM_OPENCV=ON \
|
||||
"$CMAKE_EXTRA_OPTS" \
|
||||
-DLLVM_TARGET_ARCH=arm64 \
|
||||
-DCMAKE_OSX_ARCHITECTURES=arm64 \
|
||||
-DCMAKE_IGNORE_PATH="$BREW_PATH/lib" \
|
||||
-DCMAKE_IGNORE_PREFIX_PATH=/opt/homebrew/opt \
|
||||
-DCMAKE_CXX_FLAGS="-D__MAC_OS_X_VERSION_MIN_REQUIRED=144000" \
|
||||
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
|
||||
-DCMAKE_OSX_SYSROOT="$(xcrun --sdk macosx --show-sdk-path)" \
|
||||
-G Ninja
|
||||
|
||||
"$BREW_PATH/bin/ninja"; build_status=$?;
|
||||
|
||||
cd ..
|
||||
|
||||
# If it compiled succesfully let's deploy.
|
||||
if [ "$build_status" -eq 0 ]; then
|
||||
.ci/deploy-mac-arm64.sh
|
||||
fi
|
||||
+71
-57
@@ -1,36 +1,51 @@
|
||||
#!/bin/sh -ex
|
||||
# Gather explicit version number and number of commits
|
||||
COMM_TAG=$(awk '/version{.*}/ { printf("%d.%d.%d", $5, $6, $7) }' rpcs3/rpcs3_version.cpp)
|
||||
COMM_COUNT=$(git rev-list --count HEAD)
|
||||
COMM_HASH=$(git rev-parse --short=8 HEAD)
|
||||
|
||||
# AVVER is used for GitHub releases, it is the version number. LVER is used for release naming.
|
||||
AVVER="${COMM_TAG}-${COMM_COUNT}"
|
||||
export LVER="${COMM_TAG}-${COMM_COUNT}-${COMM_HASH}"
|
||||
echo "AVVER=$AVVER" >> .ci/ci-vars.env
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
export HOMEBREW_NO_AUTO_UPDATE=1
|
||||
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
|
||||
export HOMEBREW_NO_ENV_HINTS=1
|
||||
export HOMEBREW_NO_INSTALL_CLEANUP=1
|
||||
|
||||
brew install -f --overwrite --quiet ccache "llvm@$LLVM_COMPILER_VER"
|
||||
brew link -f --overwrite --quiet "llvm@$LLVM_COMPILER_VER"
|
||||
# shellcheck disable=SC3009
|
||||
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
||||
arch -x86_64 /usr/local/bin/brew install -f --overwrite --quiet python@3.14 opencv@4 ffmpeg@5 "llvm@$LLVM_COMPILER_VER" sdl3 vulkan-headers vulkan-loader
|
||||
arch -x86_64 /usr/local/bin/brew unlink --quiet ffmpeg qtbase qtsvg qtdeclarative
|
||||
arch -x86_64 /usr/local/bin/brew link -f --overwrite --quiet "llvm@$LLVM_COMPILER_VER" ffmpeg@5
|
||||
if [ "$AARCH64" -eq 1 ]; then
|
||||
brew install -f --overwrite --quiet googletest opencv@4 sdl3 vulkan-headers vulkan-loader molten-vk
|
||||
brew unlink --quiet ffmpeg fmt qtbase qtsvg qtdeclarative protobuf
|
||||
else
|
||||
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
||||
arch -x86_64 /usr/local/bin/brew install -f --overwrite --quiet python@3.14 opencv@4 "llvm@$LLVM_COMPILER_VER" sdl3 vulkan-headers vulkan-loader molten-vk
|
||||
arch -x86_64 /usr/local/bin/brew unlink --quiet ffmpeg qtbase qtsvg qtdeclarative
|
||||
fi
|
||||
|
||||
# moltenvk based on commit for 1.4.0 release
|
||||
export HOMEBREW_DEVELOPER=1 # Prevents blocking of local formulae
|
||||
wget https://raw.githubusercontent.com/Homebrew/homebrew-core/ea2bec5f1f4384e188d7fc0702ab21a20a2ced08/Formula/m/molten-vk.rb
|
||||
arch -x86_64 /usr/local/bin/brew install -f --overwrite --formula --quiet ./molten-vk.rb
|
||||
export HOMEBREW_DEVELOPER=0
|
||||
export CXX=clang++
|
||||
export CC=clang
|
||||
|
||||
export BREW_X64_PATH;
|
||||
BREW_X64_PATH="$("/usr/local/bin/brew" --prefix)"
|
||||
export BREW_BIN="/usr/local/bin"
|
||||
export BREW_SBIN="/usr/local/sbin"
|
||||
export CMAKE_EXTRA_OPTS='-DLLVM_TARGETS_TO_BUILD=X86'
|
||||
export BREW_PATH;
|
||||
if [ "$AARCH64" -eq 1 ]; then
|
||||
BREW_PATH="$(brew --prefix)"
|
||||
export BREW_BIN="/opt/homebrew/bin"
|
||||
export BREW_SBIN="/opt/homebrew/sbin"
|
||||
else
|
||||
BREW_PATH="$("/usr/local/bin/brew" --prefix)"
|
||||
export BREW_BIN="/usr/local/bin"
|
||||
export BREW_SBIN="/usr/local/sbin"
|
||||
fi
|
||||
|
||||
export WORKDIR;
|
||||
WORKDIR="$(pwd)"
|
||||
|
||||
# Setup ccache
|
||||
if [ ! -d "$CCACHE_DIR" ]; then
|
||||
mkdir -p "$CCACHE_DIR"
|
||||
fi
|
||||
|
||||
# Get Qt
|
||||
if [ ! -d "/tmp/Qt/$QT_VER" ]; then
|
||||
mkdir -p "/tmp/Qt"
|
||||
@@ -50,68 +65,67 @@ cd "$WORKDIR"
|
||||
ditto "/tmp/Qt/$QT_VER" "qt-downloader/$QT_VER"
|
||||
|
||||
export Qt6_DIR="$WORKDIR/qt-downloader/$QT_VER/clang_64/lib/cmake/Qt$QT_VER_MAIN"
|
||||
export SDL3_DIR="$BREW_X64_PATH/opt/sdl3/lib/cmake/SDL3"
|
||||
export SDL3_DIR="$BREW_PATH/opt/sdl3/lib/cmake/SDL3"
|
||||
|
||||
export PATH="/opt/homebrew/opt/llvm@$LLVM_COMPILER_VER/bin:$WORKDIR/qt-downloader/$QT_VER/clang_64/bin:$BREW_BIN:$BREW_SBIN:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Apple/usr/bin:$PATH"
|
||||
# shellcheck disable=SC2155
|
||||
export LDFLAGS="-L$BREW_X64_PATH/lib -Wl,-rpath,$BREW_X64_PATH/lib,-L$(brew --prefix llvm)/lib/c++"
|
||||
export CPPFLAGS="-I$BREW_X64_PATH/include -msse -msse2 -mcx16 -D__MAC_OS_X_VERSION_MIN_REQUIRED=144000"
|
||||
export CFLAGS="-D__MAC_OS_X_VERSION_MIN_REQUIRED=144000"
|
||||
export LIBRARY_PATH="$BREW_X64_PATH/opt/llvm@$LLVM_COMPILER_VER/lib:$BREW_X64_PATH/lib"
|
||||
export LD_LIBRARY_PATH="$BREW_X64_PATH/opt/llvm@$LLVM_COMPILER_VER/lib:$BREW_X64_PATH/lib"
|
||||
export PATH="/opt/homebrew/opt/llvm@$LLVM_COMPILER_VER/bin:$PATH"
|
||||
export LDFLAGS="-L$BREW_PATH/opt/llvm@$LLVM_COMPILER_VER/lib/c++ -L$BREW_PATH/opt/llvm@$LLVM_COMPILER_VER/lib/unwind -lunwind"
|
||||
|
||||
export VULKAN_SDK
|
||||
VULKAN_SDK="$BREW_X64_PATH/opt/molten-vk"
|
||||
ln -s "$BREW_X64_PATH/opt/vulkan-loader/lib/libvulkan.dylib" "$VULKAN_SDK/lib/libvulkan.dylib"
|
||||
VULKAN_SDK="$BREW_PATH/opt/molten-vk"
|
||||
ln -s "$BREW_PATH/opt/vulkan-loader/lib/libvulkan.dylib" "$VULKAN_SDK/lib/libvulkan.dylib"
|
||||
|
||||
export LLVM_DIR
|
||||
LLVM_DIR="$BREW_X64_PATH/opt/llvm@$LLVM_COMPILER_VER"
|
||||
# exclude ffmpeg, LLVM, opencv, and sdl from submodule update
|
||||
LLVM_DIR="$BREW_PATH/opt/llvm@$LLVM_COMPILER_VER"
|
||||
# Pull all the submodules except some
|
||||
# shellcheck disable=SC2046
|
||||
git submodule -q update --init --depth=1 --jobs=8 $(awk '/path/ && !/ffmpeg/ && !/llvm/ && !/opencv/ && !/SDL/ && !/feralinteractive/ { print $3 }' .gitmodules)
|
||||
git submodule -q update --init --depth=1 --jobs=8 $(awk '/path/ && !/llvm/ && !/opencv/ && !/SDL/ && !/feralinteractive/ { print $3 }' .gitmodules)
|
||||
|
||||
mkdir build && cd build || exit 1
|
||||
|
||||
export MACOSX_DEPLOYMENT_TARGET=14.4
|
||||
|
||||
"/opt/homebrew/bin/cmake" .. \
|
||||
-DBUILD_RPCS3_TESTS=OFF \
|
||||
-DRUN_RPCS3_TESTS=OFF \
|
||||
if [ "$AARCH64" -eq 1 ]; then
|
||||
cmake .. \
|
||||
-DBUILD_RPCS3_TESTS="${RUN_UNIT_TESTS}" \
|
||||
-DRUN_RPCS3_TESTS="${RUN_UNIT_TESTS}" \
|
||||
-DCMAKE_OSX_DEPLOYMENT_TARGET=14.4 \
|
||||
-DCMAKE_OSX_SYSROOT="$(xcrun --sdk macosx --show-sdk-path)" \
|
||||
-DMACOSX_BUNDLE_SHORT_VERSION_STRING="${COMM_TAG}" \
|
||||
-DMACOSX_BUNDLE_BUNDLE_VERSION="${COMM_COUNT}" \
|
||||
-DSTATIC_LINK_LLVM=ON \
|
||||
-DUSE_SDL=ON \
|
||||
-DUSE_DISCORD_RPC=ON \
|
||||
-DUSE_VULKAN=ON \
|
||||
-DUSE_ALSA=OFF \
|
||||
-DUSE_PULSE=OFF \
|
||||
-DUSE_AUDIOUNIT=ON \
|
||||
-DUSE_SYSTEM_FFMPEG=ON \
|
||||
-DLLVM_CCACHE_BUILD=OFF \
|
||||
-DLLVM_BUILD_RUNTIME=OFF \
|
||||
-DLLVM_BUILD_TOOLS=OFF \
|
||||
-DLLVM_INCLUDE_DOCS=OFF \
|
||||
-DLLVM_INCLUDE_EXAMPLES=OFF \
|
||||
-DLLVM_INCLUDE_TESTS=OFF \
|
||||
-DLLVM_INCLUDE_TOOLS=OFF \
|
||||
-DLLVM_INCLUDE_UTILS=OFF \
|
||||
-DLLVM_USE_PERF=OFF \
|
||||
-DLLVM_ENABLE_Z3_SOLVER=OFF \
|
||||
-DUSE_SYSTEM_FFMPEG=OFF \
|
||||
-DUSE_NATIVE_INSTRUCTIONS=OFF \
|
||||
-DUSE_PRECOMPILED_HEADERS=OFF \
|
||||
-DUSE_SYSTEM_MVK=ON \
|
||||
-DUSE_SYSTEM_FAUDIO=OFF \
|
||||
-DUSE_SYSTEM_SDL=ON \
|
||||
-DUSE_SYSTEM_OPENCV=ON \
|
||||
"$CMAKE_EXTRA_OPTS" \
|
||||
-DLLVM_TARGET_ARCH=X86_64 \
|
||||
-G Ninja
|
||||
else
|
||||
cmake .. \
|
||||
-DBUILD_RPCS3_TESTS=OFF \
|
||||
-DRUN_RPCS3_TESTS=OFF \
|
||||
-DCMAKE_OSX_ARCHITECTURES=x86_64 \
|
||||
-DCMAKE_SYSTEM_PROCESSOR=x86_64 \
|
||||
-DCMAKE_TOOLCHAIN_FILE=buildfiles/cmake/TCDarwinX86_64.cmake \
|
||||
-DCMAKE_IGNORE_PATH="$BREW_X64_PATH/lib" \
|
||||
-DCMAKE_IGNORE_PREFIX_PATH=/usr/local/opt \
|
||||
-DCMAKE_CXX_FLAGS="-D__MAC_OS_X_VERSION_MIN_REQUIRED=144000" \
|
||||
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
|
||||
-DCMAKE_OSX_DEPLOYMENT_TARGET=14.4 \
|
||||
-DCMAKE_OSX_SYSROOT="$(xcrun --sdk macosx --show-sdk-path)" \
|
||||
-DMACOSX_BUNDLE_SHORT_VERSION_STRING="${COMM_TAG}" \
|
||||
-DMACOSX_BUNDLE_BUNDLE_VERSION="${COMM_COUNT}"\
|
||||
-DSTATIC_LINK_LLVM=ON \
|
||||
-DUSE_SDL=ON \
|
||||
-DUSE_DISCORD_RPC=ON \
|
||||
-DUSE_AUDIOUNIT=ON \
|
||||
-DUSE_SYSTEM_FFMPEG=OFF \
|
||||
-DUSE_NATIVE_INSTRUCTIONS=OFF \
|
||||
-DUSE_PRECOMPILED_HEADERS=OFF \
|
||||
-DUSE_SYSTEM_MVK=ON \
|
||||
-DUSE_SYSTEM_SDL=ON \
|
||||
-DUSE_SYSTEM_OPENCV=ON \
|
||||
-G Ninja
|
||||
fi
|
||||
|
||||
"/opt/homebrew/bin/ninja"; build_status=$?;
|
||||
ninja; build_status=$?;
|
||||
|
||||
cd ..
|
||||
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
|
||||
git config --global --add safe.directory '*'
|
||||
|
||||
CPU_ARCH="${1:-x86_64}"
|
||||
MSYS2="${2:-clang64}"
|
||||
|
||||
# Pull all the submodules except some
|
||||
# Note: Tried to use git submodule status, but it takes over 20 seconds
|
||||
# shellcheck disable=SC2046
|
||||
@@ -23,7 +26,7 @@ else
|
||||
fi
|
||||
|
||||
cmake .. \
|
||||
-DCMAKE_PREFIX_PATH=/clang64 \
|
||||
-DCMAKE_PREFIX_PATH=/"${MSYS2}" \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||
-DUSE_NATIVE_INSTRUCTIONS=OFF \
|
||||
-DUSE_PRECOMPILED_HEADERS=OFF \
|
||||
@@ -44,8 +47,8 @@ cmake .. \
|
||||
-DUSE_DISCORD_RPC=ON \
|
||||
-DOpenGL_GL_PREFERENCE=LEGACY \
|
||||
-DWITH_LLVM=ON \
|
||||
-DLLVM_DIR=/clang64/lib/cmake/llvm \
|
||||
-DVulkan_LIBRARY=/clang64/lib/libvulkan-1.dll.a \
|
||||
-DLLVM_DIR=/"${MSYS2}"/lib/cmake/llvm \
|
||||
-DVulkan_LIBRARY=/"${MSYS2}"/lib/libvulkan-1.dll.a \
|
||||
-DSTATIC_LINK_LLVM=ON \
|
||||
-DBUILD_RPCS3_TESTS=OFF \
|
||||
-DRUN_RPCS3_TESTS=OFF \
|
||||
@@ -57,5 +60,5 @@ cd ..
|
||||
|
||||
# If it compiled succesfully let's deploy.
|
||||
if [ "$build_status" -eq 0 ]; then
|
||||
.ci/deploy-windows-clang.sh "x86_64"
|
||||
.ci/deploy-windows-clang.sh "${CPU_ARCH}" "${MSYS2}"
|
||||
fi
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
#!/bin/sh -ex
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
cd build || exit 1
|
||||
|
||||
# Gather explicit version number and number of commits
|
||||
COMM_TAG=$(awk '/version{.*}/ { printf("%d.%d.%d", $5, $6, $7) }' ../rpcs3/rpcs3_version.cpp)
|
||||
COMM_COUNT=$(git rev-list --count HEAD)
|
||||
COMM_HASH=$(git rev-parse --short=8 HEAD)
|
||||
|
||||
AVVER="${COMM_TAG}-${COMM_COUNT}"
|
||||
|
||||
# AVVER is used for GitHub releases, it is the version number.
|
||||
echo "AVVER=$AVVER" >> ../.ci/ci-vars.env
|
||||
|
||||
cd bin
|
||||
mkdir "rpcs3.app/Contents/lib/" || true
|
||||
mkdir -p "rpcs3.app/Contents/Resources/vulkan/icd.d" || true
|
||||
wget https://github.com/KhronosGroup/MoltenVK/releases/download/v1.4.1/MoltenVK-macos-privateapi.tar
|
||||
tar -xvf MoltenVK-macos-privateapi.tar
|
||||
cp "MoltenVK/MoltenVK/dynamic/dylib/macOS/libMoltenVK.dylib" "rpcs3.app/Contents/Frameworks/libMoltenVK.dylib"
|
||||
cp "MoltenVK/MoltenVK/dynamic/dylib/macOS/MoltenVK_icd.json" "rpcs3.app/Contents/Resources/vulkan/icd.d/MoltenVK_icd.json"
|
||||
sed -i '' "s/.\//..\/..\/..\/Frameworks\//g" "rpcs3.app/Contents/Resources/vulkan/icd.d/MoltenVK_icd.json"
|
||||
|
||||
cp "$(realpath /opt/homebrew/opt/llvm@$LLVM_COMPILER_VER/lib/c++/libc++abi.1.0.dylib)" "rpcs3.app/Contents/Frameworks/libc++abi.1.dylib"
|
||||
cp "$(realpath /opt/homebrew/opt/gcc/lib/gcc/current/libgcc_s.1.1.dylib)" "rpcs3.app/Contents/Frameworks/libgcc_s.1.1.dylib"
|
||||
cp "$(realpath /opt/homebrew/lib/libsharpyuv.0.dylib)" "rpcs3.app/Contents/lib/libsharpyuv.0.dylib"
|
||||
cp "$(realpath /opt/homebrew/lib/libintl.8.dylib)" "rpcs3.app/Contents/lib/libintl.8.dylib"
|
||||
|
||||
rm -rf "rpcs3.app/Contents/Frameworks/QtPdf.framework" \
|
||||
"rpcs3.app/Contents/Frameworks/QtQml.framework" \
|
||||
"rpcs3.app/Contents/Frameworks/QtQmlModels.framework" \
|
||||
"rpcs3.app/Contents/Frameworks/QtQuick.framework" \
|
||||
"rpcs3.app/Contents/Frameworks/QtVirtualKeyboard.framework" \
|
||||
"rpcs3.app/Contents/Plugins/platforminputcontexts" \
|
||||
"rpcs3.app/Contents/Plugins/virtualkeyboard" \
|
||||
"rpcs3.app/Contents/Resources/git"
|
||||
|
||||
../../.ci/optimize-mac.sh rpcs3.app
|
||||
|
||||
# Download translations
|
||||
mkdir -p "rpcs3.app/Contents/translations"
|
||||
ZIP_URL=$(curl -fsSL "https://api.github.com/repos/RPCS3/rpcs3_translations/releases/latest" \
|
||||
| grep "browser_download_url" \
|
||||
| grep "RPCS3-languages.zip" \
|
||||
| cut -d '"' -f 4)
|
||||
if [ -z "$ZIP_URL" ]; then
|
||||
echo "Failed to find RPCS3-languages.zip in the latest release. Continuing without translations."
|
||||
else
|
||||
echo "Downloading translations from: $ZIP_URL"
|
||||
curl -L -o translations.zip "$ZIP_URL" || {
|
||||
echo "Failed to download translations.zip. Continuing without translations."
|
||||
exit 0
|
||||
}
|
||||
unzip -o translations.zip -d "rpcs3.app/Contents/translations" >/dev/null 2>&1 || \
|
||||
echo "Failed to extract translations.zip. Continuing without translations."
|
||||
rm -f translations.zip
|
||||
fi
|
||||
|
||||
# Hack
|
||||
install_name_tool -delete_rpath /opt/homebrew/lib RPCS3.app/Contents/MacOS/rpcs3 || echo "Hack for deleting rpath /opt/homebrew/lib not needed"
|
||||
install_name_tool -delete_rpath /opt/homebrew/opt/llvm@$LLVM_COMPILER_VER/lib RPCS3.app/Contents/MacOS/rpcs3 || echo "Hack for deleting rpath /opt/homebrew/opt/llvm@$LLVM_COMPILER_VER/lib not needed"
|
||||
|
||||
# Need to do this rename hack due to case insensitive filesystem
|
||||
mv rpcs3.app RPCS3_.app
|
||||
mv RPCS3_.app RPCS3.app
|
||||
|
||||
# NOTE: "--deep" is deprecated
|
||||
codesign --deep -fs - RPCS3.app
|
||||
|
||||
echo "[InternetShortcut]" > Quickstart.url
|
||||
echo "URL=https://rpcs3.net/quickstart" >> Quickstart.url
|
||||
echo "IconIndex=0" >> Quickstart.url
|
||||
|
||||
ARCHIVE_FILEPATH="$BUILD_ARTIFACTSTAGINGDIRECTORY/rpcs3-v${COMM_TAG}-${COMM_COUNT}-${COMM_HASH}_macos_arm64.7z"
|
||||
"/opt/homebrew/bin/7z" a -mx9 "$ARCHIVE_FILEPATH" RPCS3.app Quickstart.url
|
||||
FILESIZE=$(stat -f %z "$ARCHIVE_FILEPATH")
|
||||
SHA256SUM=$(shasum -a 256 "$ARCHIVE_FILEPATH" | awk '{ print $1 }')
|
||||
|
||||
cd ..
|
||||
echo "${SHA256SUM};${FILESIZE}B" > "$RELEASE_MESSAGE"
|
||||
cd bin
|
||||
+17
-20
@@ -3,18 +3,7 @@
|
||||
# shellcheck disable=SC2086
|
||||
cd build || exit 1
|
||||
|
||||
# Gather explicit version number and number of commits
|
||||
COMM_TAG=$(awk '/version{.*}/ { printf("%d.%d.%d", $5, $6, $7) }' ../rpcs3/rpcs3_version.cpp)
|
||||
COMM_COUNT=$(git rev-list --count HEAD)
|
||||
COMM_HASH=$(git rev-parse --short=8 HEAD)
|
||||
|
||||
AVVER="${COMM_TAG}-${COMM_COUNT}"
|
||||
|
||||
# AVVER is used for GitHub releases, it is the version number.
|
||||
echo "AVVER=$AVVER" >> ../.ci/ci-vars.env
|
||||
|
||||
cd bin
|
||||
mkdir "rpcs3.app/Contents/lib/" || true
|
||||
mkdir -p "rpcs3.app/Contents/Resources/vulkan/icd.d" || true
|
||||
wget https://github.com/KhronosGroup/MoltenVK/releases/download/v1.4.1/MoltenVK-macos-privateapi.tar
|
||||
tar -xvf MoltenVK-macos-privateapi.tar
|
||||
@@ -22,11 +11,8 @@ cp "MoltenVK/MoltenVK/dynamic/dylib/macOS/libMoltenVK.dylib" "rpcs3.app/Contents
|
||||
cp "MoltenVK/MoltenVK/dynamic/dylib/macOS/MoltenVK_icd.json" "rpcs3.app/Contents/Resources/vulkan/icd.d/MoltenVK_icd.json"
|
||||
sed -i '' "s/.\//..\/..\/..\/Frameworks\//g" "rpcs3.app/Contents/Resources/vulkan/icd.d/MoltenVK_icd.json"
|
||||
|
||||
cp "$(realpath /usr/local/opt/llvm@$LLVM_COMPILER_VER/lib/c++/libc++abi.1.0.dylib)" "rpcs3.app/Contents/Frameworks/libc++abi.1.dylib"
|
||||
cp "$(realpath /usr/local/opt/llvm@$LLVM_COMPILER_VER/lib/unwind/libunwind.1.dylib)" "rpcs3.app/Contents/Frameworks/libunwind.1.dylib"
|
||||
cp "$(realpath /usr/local/opt/gcc/lib/gcc/current/libgcc_s.1.1.dylib)" "rpcs3.app/Contents/Frameworks/libgcc_s.1.1.dylib"
|
||||
cp "$(realpath /usr/local/lib/libsharpyuv.0.dylib)" "rpcs3.app/Contents/lib/libsharpyuv.0.dylib"
|
||||
cp "$(realpath /usr/local/lib/libintl.8.dylib)" "rpcs3.app/Contents/lib/libintl.8.dylib"
|
||||
cp "$(realpath $BREW_PATH/opt/llvm@$LLVM_COMPILER_VER/lib/c++/libc++abi.1.0.dylib)" "rpcs3.app/Contents/Frameworks/libc++abi.1.dylib"
|
||||
cp "$(realpath $BREW_PATH/opt/gcc/lib/gcc/current/libgcc_s.1.1.dylib)" "rpcs3.app/Contents/Frameworks/libgcc_s.1.1.dylib"
|
||||
|
||||
rm -rf "rpcs3.app/Contents/Frameworks/QtPdf.framework" \
|
||||
"rpcs3.app/Contents/Frameworks/QtQml.framework" \
|
||||
@@ -58,13 +44,20 @@ else
|
||||
rm -f translations.zip
|
||||
fi
|
||||
|
||||
# Copy Qt translations manually
|
||||
QT_TRANS="$WORKDIR/qt-downloader/$QT_VER/clang_64/translations"
|
||||
cp $QT_TRANS/qt_*.qm rpcs3.app/Contents/translations
|
||||
cp $QT_TRANS/qtbase_*.qm rpcs3.app/Contents/translations
|
||||
cp $QT_TRANS/qtmultimedia_*.qm rpcs3.app/Contents/translations
|
||||
rm -f rpcs3.app/Contents/translations/qt_help_*.qm
|
||||
|
||||
# Need to do this rename hack due to case insensitive filesystem
|
||||
mv rpcs3.app RPCS3_.app
|
||||
mv RPCS3_.app RPCS3.app
|
||||
|
||||
# Hack
|
||||
install_name_tool -delete_rpath /usr/local/lib RPCS3.app/Contents/MacOS/rpcs3
|
||||
#-delete_rpath /usr/local/Cellar/sdl3/3.2.8/lib
|
||||
install_name_tool -delete_rpath /opt/homebrew/lib RPCS3.app/Contents/MacOS/rpcs3 || true
|
||||
install_name_tool -delete_rpath /usr/local/lib RPCS3.app/Contents/MacOS/rpcs3 || true
|
||||
|
||||
# NOTE: "--deep" is deprecated
|
||||
codesign --deep -fs - RPCS3.app
|
||||
@@ -73,8 +66,12 @@ echo "[InternetShortcut]" > Quickstart.url
|
||||
echo "URL=https://rpcs3.net/quickstart" >> Quickstart.url
|
||||
echo "IconIndex=0" >> Quickstart.url
|
||||
|
||||
ARCHIVE_FILEPATH="$BUILD_ARTIFACTSTAGINGDIRECTORY/rpcs3-v${COMM_TAG}-${COMM_COUNT}-${COMM_HASH}_macos.7z"
|
||||
"/opt/homebrew/bin/7z" a -mx9 "$ARCHIVE_FILEPATH" RPCS3.app Quickstart.url
|
||||
if [ "$AARCH64" -eq 1 ]; then
|
||||
ARCHIVE_FILEPATH="$BUILD_ARTIFACTSTAGINGDIRECTORY/rpcs3-v${LVER}_macos_aarch64.7z"
|
||||
else
|
||||
ARCHIVE_FILEPATH="$BUILD_ARTIFACTSTAGINGDIRECTORY/rpcs3-v${LVER}_macos.7z"
|
||||
fi
|
||||
7z a -mx9 "$ARCHIVE_FILEPATH" RPCS3.app Quickstart.url
|
||||
FILESIZE=$(stat -f %z "$ARCHIVE_FILEPATH")
|
||||
SHA256SUM=$(shasum -a 256 "$ARCHIVE_FILEPATH" | awk '{ print $1 }')
|
||||
|
||||
|
||||
@@ -7,12 +7,13 @@
|
||||
cd build || exit 1
|
||||
|
||||
CPU_ARCH="${1:-x86_64}"
|
||||
MSYS2="${2:-clang64}"
|
||||
|
||||
echo "Deploying rpcs3 windows clang $CPU_ARCH"
|
||||
|
||||
# BUILD_blablabla is CI specific, so we wrap it for portability
|
||||
ARTIFACT_DIR=$(cygpath -u "$BUILD_ARTIFACTSTAGINGDIRECTORY")
|
||||
MSYS2_CLANG_BIN=$(cygpath -w /clang64/bin)
|
||||
MSYS2_CLANG_BIN=$(cygpath -w /"${MSYS2}"/bin)
|
||||
MSYS2_USR_BIN=$(cygpath -w /usr/bin)
|
||||
|
||||
echo "Installing dependencies of: ./bin/rpcs3.exe (MSYS2 dir is '$MSYS2_CLANG_BIN', usr dir is '$MSYS2_USR_BIN')"
|
||||
@@ -22,7 +23,7 @@ cmake -DMSYS2_CLANG_BIN="$MSYS2_CLANG_BIN" -DMSYS2_USR_BIN="$MSYS2_USR_BIN" -Dex
|
||||
mkdir ./bin/config
|
||||
mkdir ./bin/config/input_configs
|
||||
curl -fsSL 'https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt' 1> ./bin/config/input_configs/gamecontrollerdb.txt
|
||||
curl -fsSL 'https://rpcs3.net/compatibility?api=v1&export' | iconv -t UTF-8 1> ./bin/GuiConfigs/compat_database.dat
|
||||
curl -fsSL 'https://rpcs3.net/compatibility?api=v1&export' | iconv -f ISO-8859-1 -t UTF-8 1> ./bin/GuiConfigs/compat_database.dat
|
||||
|
||||
# Download translations
|
||||
mkdir -p ./bin/share/qt6/translations
|
||||
@@ -38,7 +39,7 @@ else
|
||||
echo "Failed to download translations.zip. Continuing without translations."
|
||||
exit 0
|
||||
}
|
||||
unzip -o translations.zip -d "./bin/share/qt6/translations" >/dev/null 2>&1 || \
|
||||
7z x translations.zip -o"./bin/share/qt6/translations" >/dev/null 2>&1 || \
|
||||
echo "Failed to extract translations.zip. Continuing without translations."
|
||||
rm -f translations.zip
|
||||
fi
|
||||
@@ -49,7 +50,7 @@ fi
|
||||
# Generate sha256 hashes
|
||||
# Write to file for GitHub releases
|
||||
sha256sum "$BUILD" | awk '{ print $1 }' | tee "$BUILD.sha256"
|
||||
echo "$(cat "$BUILD.sha256");$(stat -c %s "$BUILD")B" > GitHubReleaseMessage.txt
|
||||
echo "$(cat "$BUILD.sha256");$(stat -c %s "$BUILD")B" > "$RELEASE_MESSAGE"
|
||||
|
||||
# Move files to publishing directory
|
||||
mkdir -p "$ARTIFACT_DIR"
|
||||
|
||||
+16
-4
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh -ex
|
||||
|
||||
# Resource/dependency URLs
|
||||
CCACHE_URL="https://github.com/ccache/ccache/releases/download/v4.11.2/ccache-4.11.2-windows-x86_64.zip"
|
||||
CCACHE_URL="https://github.com/ccache/ccache/releases/download/v4.12.3/ccache-4.12.3-windows-x86_64.zip"
|
||||
|
||||
DEP_URLS=" \
|
||||
$CCACHE_URL"
|
||||
@@ -28,11 +28,23 @@ download_and_verify()
|
||||
correctChecksum="$2"
|
||||
algo="$3"
|
||||
fileName="$4"
|
||||
path="$DEPS_CACHE_DIR/$fileName"
|
||||
|
||||
for _ in 1 2 3; do
|
||||
[ -e "$DEPS_CACHE_DIR/$fileName" ] || curl -fLo "$DEPS_CACHE_DIR/$fileName" "$url"
|
||||
fileChecksum=$("${algo}sum" "$DEPS_CACHE_DIR/$fileName" | awk '{ print $1 }')
|
||||
[ "$fileChecksum" = "$correctChecksum" ] && return 0
|
||||
# Check if the file exists and the checksum is correct
|
||||
if [ -e "$path" ]; then
|
||||
fileChecksum=$("${algo}sum" "$path" | awk '{ print $1 }')
|
||||
[ "$fileChecksum" = "$correctChecksum" ] && return 0
|
||||
fi
|
||||
|
||||
# Otherwise download the file
|
||||
curl -fLo "$path" "$url"
|
||||
|
||||
# Check again if the file exists and the checksum is correct
|
||||
if [ -e "$path" ]; then
|
||||
fileChecksum=$("${algo}sum" "$path" | awk '{ print $1 }')
|
||||
[ "$fileChecksum" = "$correctChecksum" ] && return 0
|
||||
fi
|
||||
done
|
||||
|
||||
return 1;
|
||||
|
||||
@@ -13,14 +13,21 @@ COMM_TAG=$(awk '/version{.*}/ { printf("%d.%d.%d", $5, $6, $7) }' ./rpcs3/rpcs3_
|
||||
COMM_COUNT=$(git rev-list --count HEAD)
|
||||
COMM_HASH=$(git rev-parse --short=8 HEAD)
|
||||
|
||||
# Differentiate Windows builds
|
||||
if [ "$COMPILER" = 'clang' ];then
|
||||
BUILD_SUFFIX="win64_${CPU_ARCH}_${COMPILER}"
|
||||
else
|
||||
BUILD_SUFFIX="${CPU_ARCH}_${COMPILER}"
|
||||
fi
|
||||
|
||||
# Format the above into filenames
|
||||
if [ -n "$PR_NUMBER" ]; then
|
||||
AVVER="${COMM_TAG}-${COMM_HASH}"
|
||||
BUILD_RAW="rpcs3-v${AVVER}_${CPU_ARCH}_${COMPILER}"
|
||||
BUILD_RAW="rpcs3-v${AVVER}_${BUILD_SUFFIX}"
|
||||
BUILD="${BUILD_RAW}.7z"
|
||||
else
|
||||
AVVER="${COMM_TAG}-${COMM_COUNT}"
|
||||
BUILD_RAW="rpcs3-v${AVVER}-${COMM_HASH}_${CPU_ARCH}_${COMPILER}"
|
||||
BUILD_RAW="rpcs3-v${AVVER}-${COMM_HASH}_${BUILD_SUFFIX}"
|
||||
BUILD="${BUILD_RAW}.7z"
|
||||
fi
|
||||
|
||||
|
||||
+18
-4
@@ -14,9 +14,10 @@ QT_DECL_URL="${QT_HOST}${QT_PREFIX}${QT_PREFIX_2}qtdeclarative${QT_SUFFIX}"
|
||||
QT_TOOL_URL="${QT_HOST}${QT_PREFIX}${QT_PREFIX_2}qttools${QT_SUFFIX}"
|
||||
QT_MM_URL="${QT_HOST}${QT_PREFIX}addons.qtmultimedia.${QT_PREFIX_2}qtmultimedia${QT_SUFFIX}"
|
||||
QT_SVG_URL="${QT_HOST}${QT_PREFIX}${QT_PREFIX_2}qtsvg${QT_SUFFIX}"
|
||||
QT_TRANSLATIONS_URL="${QT_HOST}${QT_PREFIX}${QT_PREFIX_2}qttranslations${QT_SUFFIX}"
|
||||
LLVMLIBS_URL="https://github.com/RPCS3/llvm-mirror/releases/download/custom-build-win-${LLVM_VER}/llvmlibs_mt.7z"
|
||||
VULKAN_SDK_URL="https://www.dropbox.com/scl/fi/sjjh0fc4ld281pjbl2xzu/VulkanSDK-${VULKAN_VER}-Installer.exe?rlkey=f6wzc0lvms5vwkt2z3qabfv9d&dl=1"
|
||||
CCACHE_URL="https://github.com/ccache/ccache/releases/download/v4.11.2/ccache-4.11.2-windows-x86_64.zip"
|
||||
CCACHE_URL="https://github.com/ccache/ccache/releases/download/v4.12.3/ccache-4.12.3-windows-x86_64.zip"
|
||||
|
||||
DEP_URLS=" \
|
||||
$QT_BASE_URL \
|
||||
@@ -24,6 +25,7 @@ DEP_URLS=" \
|
||||
$QT_TOOL_URL \
|
||||
$QT_MM_URL \
|
||||
$QT_SVG_URL \
|
||||
$QT_TRANSLATIONS_URL \
|
||||
$LLVMLIBS_URL \
|
||||
$VULKAN_SDK_URL\
|
||||
$CCACHE_URL"
|
||||
@@ -51,11 +53,23 @@ download_and_verify()
|
||||
correctChecksum="$2"
|
||||
algo="$3"
|
||||
fileName="$4"
|
||||
path="$DEPS_CACHE_DIR/$fileName"
|
||||
|
||||
for _ in 1 2 3; do
|
||||
[ -e "$DEPS_CACHE_DIR/$fileName" ] || curl -fLo "$DEPS_CACHE_DIR/$fileName" "$url"
|
||||
fileChecksum=$("${algo}sum" "$DEPS_CACHE_DIR/$fileName" | awk '{ print $1 }')
|
||||
[ "$fileChecksum" = "$correctChecksum" ] && return 0
|
||||
# Check if the file exists and the checksum is correct
|
||||
if [ -e "$path" ]; then
|
||||
fileChecksum=$("${algo}sum" "$path" | awk '{ print $1 }')
|
||||
[ "$fileChecksum" = "$correctChecksum" ] && return 0
|
||||
fi
|
||||
|
||||
# Otherwise download the file
|
||||
curl -fLo "$path" "$url"
|
||||
|
||||
# Check again if the file exists and the checksum is correct
|
||||
if [ -e "$path" ]; then
|
||||
fileChecksum=$("${algo}sum" "$path" | awk '{ print $1 }')
|
||||
[ "$fileChecksum" = "$correctChecksum" ] && return 0
|
||||
fi
|
||||
done
|
||||
|
||||
return 1;
|
||||
|
||||
@@ -20,7 +20,7 @@ jobs:
|
||||
runs-on: windows-2025
|
||||
env:
|
||||
COMPILER: msvc
|
||||
CCACHE_SHA: '1f39f3ad5aae3fe915e99ad1302633bc8f6718e58fa7c0de2b0ba7e080f0f08c'
|
||||
CCACHE_SHA: '859141059ac950e1e8cd042c66f842f26b9e3a62a1669a69fe6ba180cb58bbdf'
|
||||
CCACHE_BIN_DIR: 'C:\ccache_bin'
|
||||
CCACHE_DIR: 'C:\ccache'
|
||||
CCACHE_INODECACHE: 'true'
|
||||
|
||||
+68
-35
@@ -30,23 +30,23 @@ jobs:
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-24.04
|
||||
docker_img: "rpcs3/rpcs3-ci-jammy:1.7"
|
||||
docker_img: "rpcs3/rpcs3-ci-jammy:1.9"
|
||||
build_sh: "/rpcs3/.ci/build-linux.sh"
|
||||
compiler: clang
|
||||
UPLOAD_COMMIT_HASH: d812f1254a1157c80fd402f94446310560f54e5f
|
||||
UPLOAD_REPO_FULL_NAME: "rpcs3/rpcs3-binaries-linux"
|
||||
- os: ubuntu-24.04
|
||||
docker_img: "rpcs3/rpcs3-ci-jammy:1.7"
|
||||
docker_img: "rpcs3/rpcs3-ci-jammy:1.9"
|
||||
build_sh: "/rpcs3/.ci/build-linux.sh"
|
||||
compiler: gcc
|
||||
- os: ubuntu-24.04-arm
|
||||
docker_img: "rpcs3/rpcs3-ci-jammy-aarch64:1.7"
|
||||
docker_img: "rpcs3/rpcs3-ci-jammy-aarch64:1.9"
|
||||
build_sh: "/rpcs3/.ci/build-linux-aarch64.sh"
|
||||
compiler: clang
|
||||
UPLOAD_COMMIT_HASH: a1d35836e8d45bfc6f63c26f0a3e5d46ef622fe1
|
||||
UPLOAD_REPO_FULL_NAME: "rpcs3/rpcs3-binaries-linux-arm64"
|
||||
- os: ubuntu-24.04-arm
|
||||
docker_img: "rpcs3/rpcs3-ci-jammy-aarch64:1.7"
|
||||
docker_img: "rpcs3/rpcs3-ci-jammy-aarch64:1.9"
|
||||
build_sh: "/rpcs3/.ci/build-linux-aarch64.sh"
|
||||
compiler: gcc
|
||||
name: RPCS3 Linux ${{ matrix.os }} ${{ matrix.compiler }}
|
||||
@@ -123,23 +123,24 @@ jobs:
|
||||
matrix:
|
||||
include:
|
||||
- name: Intel
|
||||
build_sh: .ci/build-mac.sh
|
||||
AARCH64: 0
|
||||
UPLOAD_COMMIT_HASH: 51ae32f468089a8169aaf1567de355ff4a3e0842
|
||||
UPLOAD_REPO_FULL_NAME: rpcs3/rpcs3-binaries-mac
|
||||
- name: Apple Silicon
|
||||
build_sh: .ci/build-mac-arm64.sh
|
||||
AARCH64: 1
|
||||
UPLOAD_COMMIT_HASH: 8e21bdbc40711a3fccd18fbf17b742348b0f4281
|
||||
UPLOAD_REPO_FULL_NAME: rpcs3/rpcs3-binaries-mac-arm64
|
||||
name: RPCS3 Mac ${{ matrix.name }}
|
||||
runs-on: macos-14
|
||||
env:
|
||||
CCACHE_DIR: /tmp/ccache_dir
|
||||
QT_VER: '6.10.1'
|
||||
QT_VER: '6.10.2'
|
||||
QT_VER_MAIN: '6'
|
||||
LLVM_COMPILER_VER: '21'
|
||||
RELEASE_MESSAGE: ../GitHubReleaseMessage.txt
|
||||
UPLOAD_COMMIT_HASH: ${{ matrix.UPLOAD_COMMIT_HASH }}
|
||||
UPLOAD_REPO_FULL_NAME: ${{ matrix.UPLOAD_REPO_FULL_NAME }}
|
||||
AARCH64: ${{ matrix.AARCH64 }}
|
||||
RUN_UNIT_TESTS: github.event_name == 'pull_request' && 'ON' || 'OFF'
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
@@ -164,7 +165,7 @@ jobs:
|
||||
restore-keys: ${{ runner.os }}-qt-${{ matrix.name }}-${{ env.QT_VER }}
|
||||
|
||||
- name: Build
|
||||
run: ${{ matrix.build_sh }}
|
||||
run: .ci/build-mac.sh
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@main
|
||||
@@ -212,13 +213,13 @@ jobs:
|
||||
env:
|
||||
COMPILER: msvc
|
||||
QT_VER_MAIN: '6'
|
||||
QT_VER: '6.10.1'
|
||||
QT_VER: '6.10.2'
|
||||
QT_VER_MSVC: 'msvc2022'
|
||||
QT_DATE: '202511161843'
|
||||
QT_DATE: '202601261212'
|
||||
LLVM_VER: '19.1.7'
|
||||
VULKAN_VER: '1.3.268.0'
|
||||
VULKAN_SDK_SHA: '8459ef49bd06b697115ddd3d97c9aec729e849cd775f5be70897718a9b3b9db5'
|
||||
CCACHE_SHA: '1f39f3ad5aae3fe915e99ad1302633bc8f6718e58fa7c0de2b0ba7e080f0f08c'
|
||||
CCACHE_SHA: '859141059ac950e1e8cd042c66f842f26b9e3a62a1669a69fe6ba180cb58bbdf'
|
||||
CCACHE_BIN_DIR: 'C:\ccache_bin'
|
||||
CCACHE_DIR: 'C:\ccache'
|
||||
CCACHE_INODECACHE: 'true'
|
||||
@@ -328,16 +329,25 @@ jobs:
|
||||
Windows_Build_Clang:
|
||||
# Only run push event on master branch of main repo, but run all PRs
|
||||
if: github.event_name != 'push' || (github.repository == 'RPCS3/rpcs3' && github.ref_name == 'master')
|
||||
name: RPCS3 Windows Clang
|
||||
runs-on: windows-2025
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- msys2: clang64
|
||||
compiler: clang
|
||||
arch: win64
|
||||
arch: x86_64
|
||||
os: windows-2025
|
||||
name: X64
|
||||
- msys2: clangarm64
|
||||
compiler: clang
|
||||
arch: aarch64
|
||||
os: windows-11-arm
|
||||
name: ARM64
|
||||
env:
|
||||
CCACHE_DIR: 'C:\ccache'
|
||||
RELEASE_MESSAGE: ../GitHubReleaseMessage.txt
|
||||
name: RPCS3 Windows Clang ${{ matrix.arch }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@main
|
||||
@@ -351,23 +361,26 @@ jobs:
|
||||
update: true
|
||||
cache: true
|
||||
install: |
|
||||
mingw-w64-clang-x86_64-clang
|
||||
mingw-w64-clang-x86_64-ccache
|
||||
mingw-w64-clang-x86_64-cmake
|
||||
mingw-w64-clang-x86_64-lld
|
||||
mingw-w64-clang-x86_64-ninja
|
||||
mingw-w64-clang-x86_64-llvm
|
||||
mingw-w64-clang-x86_64-ffmpeg
|
||||
mingw-w64-clang-x86_64-opencv
|
||||
mingw-w64-clang-x86_64-glew
|
||||
mingw-w64-clang-x86_64-vulkan
|
||||
mingw-w64-clang-x86_64-vulkan-headers
|
||||
mingw-w64-clang-x86_64-vulkan-loader
|
||||
mingw-w64-clang-x86_64-gtest
|
||||
mingw-w64-clang-x86_64-qt6-base
|
||||
mingw-w64-clang-x86_64-qt6-declarative
|
||||
mingw-w64-clang-x86_64-qt6-multimedia
|
||||
mingw-w64-clang-x86_64-qt6-svg
|
||||
mingw-w64-clang-${{ matrix.arch }}-clang
|
||||
mingw-w64-clang-${{ matrix.arch }}-ccache
|
||||
mingw-w64-clang-${{ matrix.arch }}-cmake
|
||||
mingw-w64-clang-${{ matrix.arch }}-lld
|
||||
mingw-w64-clang-${{ matrix.arch }}-ninja
|
||||
mingw-w64-clang-${{ matrix.arch }}-llvm
|
||||
mingw-w64-clang-${{ matrix.arch }}-ffmpeg
|
||||
mingw-w64-clang-${{ matrix.arch }}-opencv
|
||||
mingw-w64-clang-${{ matrix.arch }}-iconv
|
||||
mingw-w64-clang-${{ matrix.arch }}-glew
|
||||
mingw-w64-clang-${{ matrix.arch }}-vulkan
|
||||
mingw-w64-clang-${{ matrix.arch }}-vulkan-headers
|
||||
mingw-w64-clang-${{ matrix.arch }}-vulkan-loader
|
||||
mingw-w64-clang-${{ matrix.arch }}-gtest
|
||||
mingw-w64-clang-${{ matrix.arch }}-qt6-base
|
||||
mingw-w64-clang-${{ matrix.arch }}-qt6-declarative
|
||||
mingw-w64-clang-${{ matrix.arch }}-qt6-multimedia
|
||||
mingw-w64-clang-${{ matrix.arch }}-qt6-svg
|
||||
mingw-w64-clang-${{ matrix.arch }}-qt6-tools
|
||||
mingw-w64-clang-${{ matrix.arch }}-qt6-translations
|
||||
base-devel
|
||||
curl
|
||||
git
|
||||
@@ -378,8 +391,8 @@ jobs:
|
||||
id: restore-build-ccache
|
||||
with:
|
||||
path: ${{ env.CCACHE_DIR }}
|
||||
key: ${{ runner.os }}-ccache-${{ matrix.compiler }}-${{ runner.arch }}-${{ github.run_id }}
|
||||
restore-keys: ${{ runner.os }}-ccache-${{ matrix.compiler }}-${{ runner.arch }}-
|
||||
key: ${{ runner.os }}-ccache-${{ matrix.compiler }}-${{ matrix.arch }}-${{ github.run_id }}
|
||||
restore-keys: ${{ runner.os }}-ccache-${{ matrix.compiler }}-${{ matrix.arch }}-
|
||||
|
||||
- name: Build RPCS3
|
||||
shell: msys2 {0}
|
||||
@@ -387,7 +400,25 @@ jobs:
|
||||
export CCACHE_DIR=$(cygpath -u "$CCACHE_DIR")
|
||||
echo "CCACHE_DIR=$CCACHE_DIR"
|
||||
.ci/setup-windows-ci-vars.sh ${{ matrix.arch }} ${{ matrix.compiler }}
|
||||
.ci/build-windows-clang.sh
|
||||
.ci/build-windows-clang.sh ${{ matrix.arch }} ${{ matrix.msys2 }}
|
||||
|
||||
- name: Deploy master build to GitHub Releases (only aarch64)
|
||||
if: |
|
||||
matrix.arch == 'aarch64' &&
|
||||
github.event_name != 'pull_request' &&
|
||||
github.repository == 'RPCS3/rpcs3' &&
|
||||
github.ref == 'refs/heads/master'
|
||||
env:
|
||||
RPCS3_TOKEN: ${{ secrets.RPCS3_TOKEN }}
|
||||
# We specify it here since this upload is specific to arm64
|
||||
UPLOAD_COMMIT_HASH: ee05050fd1d8488148a771b526702656a10dacf0
|
||||
UPLOAD_REPO_FULL_NAME: "RPCS3/rpcs3-binaries-win-arm64"
|
||||
run: |
|
||||
COMM_TAG=$(awk '/version{.*}/ { printf("%d.%d.%d", $5, $6, $7) }' ./rpcs3/rpcs3_version.cpp)
|
||||
COMM_COUNT=$(git rev-list --count HEAD)
|
||||
COMM_HASH=$(git rev-parse --short=8 HEAD)
|
||||
export AVVER="${COMM_TAG}-${COMM_COUNT}"
|
||||
.ci/github-upload.sh
|
||||
|
||||
- name: Save build Ccache
|
||||
if: github.ref == 'refs/heads/master'
|
||||
@@ -399,7 +430,7 @@ jobs:
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@main
|
||||
with:
|
||||
name: RPCS3 for Windows (${{ runner.arch }}, ${{ matrix.compiler }})
|
||||
name: RPCS3 for Windows (${{ matrix.name }}, clang)
|
||||
path: ${{ env.BUILD_ARTIFACTSTAGINGDIRECTORY }}
|
||||
compression-level: 0
|
||||
if-no-files-found: error
|
||||
@@ -438,6 +469,8 @@ jobs:
|
||||
with:
|
||||
envs: 'QT_VER_MAIN LLVM_COMPILER_VER CCACHE_DIR CC CXX LLVM_CONFIG'
|
||||
usesh: true
|
||||
copyback: false
|
||||
release: "14.3"
|
||||
run: .ci/install-freebsd.sh && .ci/build-freebsd.sh
|
||||
|
||||
- name: Save Build Ccache
|
||||
|
||||
+4
-4
@@ -52,10 +52,6 @@
|
||||
path = 3rdparty/wolfssl/wolfssl
|
||||
url = ../../wolfSSL/wolfssl.git
|
||||
ignore = dirty
|
||||
[submodule "3rdparty/flatbuffers"]
|
||||
path = 3rdparty/flatbuffers
|
||||
url = ../../google/flatbuffers.git
|
||||
ignore = dirty
|
||||
[submodule "3rdparty/cubeb/cubeb"]
|
||||
path = 3rdparty/cubeb/cubeb
|
||||
url = ../../mozilla/cubeb.git
|
||||
@@ -112,3 +108,7 @@
|
||||
path = 3rdparty/feralinteractive/feralinteractive
|
||||
url = ../../FeralInteractive/gamemode.git
|
||||
ignore = dirty
|
||||
[submodule "3rdparty/protobuf/protobuf"]
|
||||
path = 3rdparty/protobuf/protobuf
|
||||
url = ../../protocolbuffers/protobuf.git
|
||||
ignore = dirty
|
||||
|
||||
Vendored
+1
-1
Submodule 3rdparty/7zip/7zip updated: 5e96a82794...839151eaaa
Vendored
+3
-13
@@ -25,18 +25,8 @@ add_subdirectory(zstd EXCLUDE_FROM_ALL)
|
||||
# 7zip sdk
|
||||
add_subdirectory(7zip EXCLUDE_FROM_ALL)
|
||||
|
||||
add_library(3rdparty_flatbuffers INTERFACE)
|
||||
if (USE_SYSTEM_FLATBUFFERS)
|
||||
pkg_check_modules(FLATBUFFERS REQUIRED IMPORTED_TARGET flatbuffers>=2.0.0)
|
||||
target_link_libraries(3rdparty_flatbuffers INTERFACE PkgConfig::FLATBUFFERS)
|
||||
set(FBS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../rpcs3/Emu/NP/generated/")
|
||||
execute_process(COMMAND flatc --cpp -o "${FBS_DIR}" "${FBS_DIR}/np2_structs.fbs" RESULT_VARIABLE FBS_CMD_ERROR)
|
||||
if(FBS_CMD_ERROR AND NOT FBS_CMD_ERROR EQUAL 0)
|
||||
message(FATAL_ERROR "flatc failed to regenerate flatbuffers headers.")
|
||||
endif()
|
||||
else()
|
||||
target_include_directories(3rdparty_flatbuffers SYSTEM INTERFACE flatbuffers/include)
|
||||
endif()
|
||||
# Protobuf
|
||||
add_subdirectory(protobuf EXCLUDE_FROM_ALL)
|
||||
|
||||
# libPNG
|
||||
add_subdirectory(libpng EXCLUDE_FROM_ALL)
|
||||
@@ -372,7 +362,7 @@ endif()
|
||||
add_library(3rdparty::zlib ALIAS 3rdparty_zlib)
|
||||
add_library(3rdparty::zstd ALIAS 3rdparty_zstd)
|
||||
add_library(3rdparty::7zip ALIAS 3rdparty_7zip)
|
||||
add_library(3rdparty::flatbuffers ALIAS 3rdparty_flatbuffers)
|
||||
add_library(3rdparty::protobuf ALIAS 3rdparty_protobuf)
|
||||
add_library(3rdparty::pugixml ALIAS pugixml)
|
||||
add_library(3rdparty::glslang ALIAS 3rdparty_glslang)
|
||||
add_library(3rdparty::yaml-cpp ALIAS yaml-cpp)
|
||||
|
||||
Vendored
+1
-1
Submodule 3rdparty/FAudio updated: 4ea8afea6b...e67d761ead
Vendored
+123
-2
@@ -6,7 +6,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright 2013-2020 The Khronos Group Inc.
|
||||
** Copyright 2013-2026 The Khronos Group Inc.
|
||||
** SPDX-License-Identifier: MIT
|
||||
**
|
||||
** This header is generated from the Khronos OpenGL / OpenGL ES XML
|
||||
@@ -32,7 +32,7 @@ extern "C" {
|
||||
#define GLAPI extern
|
||||
#endif
|
||||
|
||||
#define GL_GLEXT_VERSION 20250203
|
||||
#define GL_GLEXT_VERSION 20260126
|
||||
|
||||
#include <KHR/khrplatform.h>
|
||||
|
||||
@@ -7358,6 +7358,47 @@ GLAPI void APIENTRY glFogCoordPointerEXT (GLenum type, GLsizei stride, const voi
|
||||
#endif
|
||||
#endif /* GL_EXT_fog_coord */
|
||||
|
||||
#ifndef GL_EXT_fragment_shading_rate
|
||||
#define GL_EXT_fragment_shading_rate 1
|
||||
#define GL_SHADING_RATE_1X1_PIXELS_EXT 0x96A6
|
||||
#define GL_SHADING_RATE_1X2_PIXELS_EXT 0x96A7
|
||||
#define GL_SHADING_RATE_2X1_PIXELS_EXT 0x96A8
|
||||
#define GL_SHADING_RATE_2X2_PIXELS_EXT 0x96A9
|
||||
#define GL_SHADING_RATE_1X4_PIXELS_EXT 0x96AA
|
||||
#define GL_SHADING_RATE_4X1_PIXELS_EXT 0x96AB
|
||||
#define GL_SHADING_RATE_4X2_PIXELS_EXT 0x96AC
|
||||
#define GL_SHADING_RATE_2X4_PIXELS_EXT 0x96AD
|
||||
#define GL_SHADING_RATE_4X4_PIXELS_EXT 0x96AE
|
||||
#define GL_SHADING_RATE_EXT 0x96D0
|
||||
#define GL_SHADING_RATE_ATTACHMENT_EXT 0x96D1
|
||||
#define GL_FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_EXT 0x96D2
|
||||
#define GL_FRAGMENT_SHADING_RATE_COMBINER_OP_REPLACE_EXT 0x96D3
|
||||
#define GL_FRAGMENT_SHADING_RATE_COMBINER_OP_MIN_EXT 0x96D4
|
||||
#define GL_FRAGMENT_SHADING_RATE_COMBINER_OP_MAX_EXT 0x96D5
|
||||
#define GL_FRAGMENT_SHADING_RATE_COMBINER_OP_MUL_EXT 0x96D6
|
||||
#define GL_MIN_FRAGMENT_SHADING_RATE_ATTACHMENT_TEXEL_WIDTH_EXT 0x96D7
|
||||
#define GL_MAX_FRAGMENT_SHADING_RATE_ATTACHMENT_TEXEL_WIDTH_EXT 0x96D8
|
||||
#define GL_MIN_FRAGMENT_SHADING_RATE_ATTACHMENT_TEXEL_HEIGHT_EXT 0x96D9
|
||||
#define GL_MAX_FRAGMENT_SHADING_RATE_ATTACHMENT_TEXEL_HEIGHT_EXT 0x96DA
|
||||
#define GL_MAX_FRAGMENT_SHADING_RATE_ATTACHMENT_TEXEL_ASPECT_RATIO_EXT 0x96DB
|
||||
#define GL_MAX_FRAGMENT_SHADING_RATE_ATTACHMENT_LAYERS_EXT 0x96DC
|
||||
#define GL_FRAGMENT_SHADING_RATE_WITH_SHADER_DEPTH_STENCIL_WRITES_SUPPORTED_EXT 0x96DD
|
||||
#define GL_FRAGMENT_SHADING_RATE_WITH_SAMPLE_MASK_SUPPORTED_EXT 0x96DE
|
||||
#define GL_FRAGMENT_SHADING_RATE_ATTACHMENT_WITH_DEFAULT_FRAMEBUFFER_SUPPORTED_EXT 0x96DF
|
||||
#define GL_FRAGMENT_SHADING_RATE_NON_TRIVIAL_COMBINERS_SUPPORTED_EXT 0x8F6F
|
||||
#define GL_FRAGMENT_SHADING_RATE_PRIMITIVE_RATE_WITH_MULTI_VIEWPORT_SUPPORTED_EXT 0x9780
|
||||
typedef void (APIENTRYP PFNGLGETFRAGMENTSHADINGRATESEXTPROC) (GLsizei samples, GLsizei maxCount, GLsizei *count, GLenum *shadingRates);
|
||||
typedef void (APIENTRYP PFNGLSHADINGRATEEXTPROC) (GLenum rate);
|
||||
typedef void (APIENTRYP PFNGLSHADINGRATECOMBINEROPSEXTPROC) (GLenum combinerOp0, GLenum combinerOp1);
|
||||
typedef void (APIENTRYP PFNGLFRAMEBUFFERSHADINGRATEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint baseLayer, GLsizei numLayers, GLsizei texelWidth, GLsizei texelHeight);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glGetFragmentShadingRatesEXT (GLsizei samples, GLsizei maxCount, GLsizei *count, GLenum *shadingRates);
|
||||
GLAPI void APIENTRY glShadingRateEXT (GLenum rate);
|
||||
GLAPI void APIENTRY glShadingRateCombinerOpsEXT (GLenum combinerOp0, GLenum combinerOp1);
|
||||
GLAPI void APIENTRY glFramebufferShadingRateEXT (GLenum target, GLenum attachment, GLuint texture, GLint baseLayer, GLsizei numLayers, GLsizei texelWidth, GLsizei texelHeight);
|
||||
#endif
|
||||
#endif /* GL_EXT_fragment_shading_rate */
|
||||
|
||||
#ifndef GL_EXT_framebuffer_blit
|
||||
#define GL_EXT_framebuffer_blit 1
|
||||
#define GL_READ_FRAMEBUFFER_EXT 0x8CA8
|
||||
@@ -7816,6 +7857,86 @@ GLAPI void APIENTRY glImportMemoryWin32NameEXT (GLuint memory, GLuint64 size, GL
|
||||
#endif
|
||||
#endif /* GL_EXT_memory_object_win32 */
|
||||
|
||||
#ifndef GL_EXT_mesh_shader
|
||||
#define GL_EXT_mesh_shader 1
|
||||
#define GL_MESH_SHADER_EXT 0x9559
|
||||
#define GL_TASK_SHADER_EXT 0x955A
|
||||
#define GL_MAX_MESH_UNIFORM_BLOCKS_EXT 0x8E60
|
||||
#define GL_MAX_MESH_TEXTURE_IMAGE_UNITS_EXT 0x8E61
|
||||
#define GL_MAX_MESH_IMAGE_UNIFORMS_EXT 0x8E62
|
||||
#define GL_MAX_MESH_UNIFORM_COMPONENTS_EXT 0x8E63
|
||||
#define GL_MAX_MESH_ATOMIC_COUNTER_BUFFERS_EXT 0x8E64
|
||||
#define GL_MAX_MESH_ATOMIC_COUNTERS_EXT 0x8E65
|
||||
#define GL_MAX_MESH_SHADER_STORAGE_BLOCKS_EXT 0x8E66
|
||||
#define GL_MAX_COMBINED_MESH_UNIFORM_COMPONENTS_EXT 0x8E67
|
||||
#define GL_MAX_TASK_UNIFORM_BLOCKS_EXT 0x8E68
|
||||
#define GL_MAX_TASK_TEXTURE_IMAGE_UNITS_EXT 0x8E69
|
||||
#define GL_MAX_TASK_IMAGE_UNIFORMS_EXT 0x8E6A
|
||||
#define GL_MAX_TASK_UNIFORM_COMPONENTS_EXT 0x8E6B
|
||||
#define GL_MAX_TASK_ATOMIC_COUNTER_BUFFERS_EXT 0x8E6C
|
||||
#define GL_MAX_TASK_ATOMIC_COUNTERS_EXT 0x8E6D
|
||||
#define GL_MAX_TASK_SHADER_STORAGE_BLOCKS_EXT 0x8E6E
|
||||
#define GL_MAX_COMBINED_TASK_UNIFORM_COMPONENTS_EXT 0x8E6F
|
||||
#define GL_MAX_TASK_WORK_GROUP_TOTAL_COUNT_EXT 0x9740
|
||||
#define GL_MAX_MESH_WORK_GROUP_TOTAL_COUNT_EXT 0x9741
|
||||
#define GL_MAX_MESH_WORK_GROUP_INVOCATIONS_EXT 0x9757
|
||||
#define GL_MAX_TASK_WORK_GROUP_INVOCATIONS_EXT 0x9759
|
||||
#define GL_MAX_TASK_PAYLOAD_SIZE_EXT 0x9742
|
||||
#define GL_MAX_TASK_SHARED_MEMORY_SIZE_EXT 0x9743
|
||||
#define GL_MAX_MESH_SHARED_MEMORY_SIZE_EXT 0x9744
|
||||
#define GL_MAX_TASK_PAYLOAD_AND_SHARED_MEMORY_SIZE_EXT 0x9745
|
||||
#define GL_MAX_MESH_PAYLOAD_AND_SHARED_MEMORY_SIZE_EXT 0x9746
|
||||
#define GL_MAX_MESH_OUTPUT_MEMORY_SIZE_EXT 0x9747
|
||||
#define GL_MAX_MESH_PAYLOAD_AND_OUTPUT_MEMORY_SIZE_EXT 0x9748
|
||||
#define GL_MAX_MESH_OUTPUT_VERTICES_EXT 0x9538
|
||||
#define GL_MAX_MESH_OUTPUT_PRIMITIVES_EXT 0x9756
|
||||
#define GL_MAX_MESH_OUTPUT_COMPONENTS_EXT 0x9749
|
||||
#define GL_MAX_MESH_OUTPUT_LAYERS_EXT 0x974A
|
||||
#define GL_MAX_MESH_MULTIVIEW_VIEW_COUNT_EXT 0x9557
|
||||
#define GL_MESH_OUTPUT_PER_VERTEX_GRANULARITY_EXT 0x92DF
|
||||
#define GL_MESH_OUTPUT_PER_PRIMITIVE_GRANULARITY_EXT 0x9543
|
||||
#define GL_MAX_PREFERRED_TASK_WORK_GROUP_INVOCATIONS_EXT 0x974B
|
||||
#define GL_MAX_PREFERRED_MESH_WORK_GROUP_INVOCATIONS_EXT 0x974C
|
||||
#define GL_MESH_PREFERS_LOCAL_INVOCATION_VERTEX_OUTPUT_EXT 0x974D
|
||||
#define GL_MESH_PREFERS_LOCAL_INVOCATION_PRIMITIVE_OUTPUT_EXT 0x974E
|
||||
#define GL_MESH_PREFERS_COMPACT_VERTEX_OUTPUT_EXT 0x974F
|
||||
#define GL_MESH_PREFERS_COMPACT_PRIMITIVE_OUTPUT_EXT 0x9750
|
||||
#define GL_MAX_TASK_WORK_GROUP_COUNT_EXT 0x9751
|
||||
#define GL_MAX_MESH_WORK_GROUP_COUNT_EXT 0x9752
|
||||
#define GL_MAX_MESH_WORK_GROUP_SIZE_EXT 0x9758
|
||||
#define GL_MAX_TASK_WORK_GROUP_SIZE_EXT 0x975A
|
||||
#define GL_MESH_WORK_GROUP_SIZE_EXT 0x953E
|
||||
#define GL_TASK_WORK_GROUP_SIZE_EXT 0x953F
|
||||
#define GL_MESH_VERTICES_OUT_EXT 0x9579
|
||||
#define GL_MESH_PRIMITIVES_OUT_EXT 0x957A
|
||||
#define GL_MESH_OUTPUT_TYPE_EXT 0x957B
|
||||
#define GL_UNIFORM_BLOCK_REFERENCED_BY_MESH_SHADER_EXT 0x959C
|
||||
#define GL_UNIFORM_BLOCK_REFERENCED_BY_TASK_SHADER_EXT 0x959D
|
||||
#define GL_REFERENCED_BY_MESH_SHADER_EXT 0x95A0
|
||||
#define GL_REFERENCED_BY_TASK_SHADER_EXT 0x95A1
|
||||
#define GL_TASK_SHADER_INVOCATIONS_EXT 0x9753
|
||||
#define GL_MESH_SHADER_INVOCATIONS_EXT 0x9754
|
||||
#define GL_MESH_PRIMITIVES_GENERATED_EXT 0x9755
|
||||
#define GL_MESH_SHADER_BIT_EXT 0x00000040
|
||||
#define GL_TASK_SHADER_BIT_EXT 0x00000080
|
||||
#define GL_MESH_SUBROUTINE_EXT 0x957C
|
||||
#define GL_TASK_SUBROUTINE_EXT 0x957D
|
||||
#define GL_MESH_SUBROUTINE_UNIFORM_EXT 0x957E
|
||||
#define GL_TASK_SUBROUTINE_UNIFORM_EXT 0x957F
|
||||
#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_MESH_SHADER_EXT 0x959E
|
||||
#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TASK_SHADER_EXT 0x959F
|
||||
typedef void (APIENTRYP PFNGLDRAWMESHTASKSEXTPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z);
|
||||
typedef void (APIENTRYP PFNGLDRAWMESHTASKSINDIRECTEXTPROC) (GLintptr indirect);
|
||||
typedef void (APIENTRYP PFNGLMULTIDRAWMESHTASKSINDIRECTEXTPROC) (GLintptr indirect, GLsizei drawcount, GLsizei stride);
|
||||
typedef void (APIENTRYP PFNGLMULTIDRAWMESHTASKSINDIRECTCOUNTEXTPROC) (GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glDrawMeshTasksEXT (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z);
|
||||
GLAPI void APIENTRY glDrawMeshTasksIndirectEXT (GLintptr indirect);
|
||||
GLAPI void APIENTRY glMultiDrawMeshTasksIndirectEXT (GLintptr indirect, GLsizei drawcount, GLsizei stride);
|
||||
GLAPI void APIENTRY glMultiDrawMeshTasksIndirectCountEXT (GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride);
|
||||
#endif
|
||||
#endif /* GL_EXT_mesh_shader */
|
||||
|
||||
#ifndef GL_EXT_misc_attribute
|
||||
#define GL_EXT_misc_attribute 1
|
||||
#endif /* GL_EXT_misc_attribute */
|
||||
|
||||
Vendored
+1
-1
Submodule 3rdparty/OpenAL/openal-soft updated: 0e5e98e4ac...c41d64c6a3
Vendored
+1
-1
Submodule 3rdparty/cubeb/cubeb updated: e495bee4cd...484857522c
Vendored
+1
-1
Submodule 3rdparty/ffmpeg updated: ec6367d3ba...ce81114ed9
Vendored
-1
Submodule 3rdparty/flatbuffers deleted from 1872409707
Vendored
+1
-1
Submodule 3rdparty/libpng/libpng updated: 49363adcfa...c3e304954a
Vendored
+1
-1
Submodule 3rdparty/libsdl-org/SDL updated: 7f3ae3d574...683181b47c
Vendored
+29
-7
@@ -23,6 +23,7 @@
|
||||
<ClInclude Include="SDL\include\SDL3\SDL_clipboard.h" />
|
||||
<ClInclude Include="SDL\include\SDL3\SDL_copying.h" />
|
||||
<ClInclude Include="SDL\include\SDL3\SDL_cpuinfo.h" />
|
||||
<ClInclude Include="SDL\include\SDL3\SDL_dlopennote.h" />
|
||||
<ClInclude Include="SDL\include\SDL3\SDL_egl.h" />
|
||||
<ClInclude Include="SDL\include\SDL3\SDL_endian.h" />
|
||||
<ClInclude Include="SDL\include\SDL3\SDL_error.h" />
|
||||
@@ -102,6 +103,7 @@
|
||||
<ClInclude Include="SDL\src\audio\wasapi\SDL_wasapi.h" />
|
||||
<ClInclude Include="SDL\src\camera\SDL_camera_c.h" />
|
||||
<ClInclude Include="SDL\src\camera\SDL_syscamera.h" />
|
||||
<ClInclude Include="SDL\src\core\SDL_core_unsupported.h" />
|
||||
<ClInclude Include="SDL\src\core\windows\SDL_directx.h" />
|
||||
<ClInclude Include="SDL\src\core\windows\SDL_gameinput.h" />
|
||||
<ClInclude Include="SDL\src\core\windows\SDL_hid.h" />
|
||||
@@ -130,6 +132,8 @@
|
||||
<ClInclude Include="SDL\src\filesystem\SDL_sysfilesystem.h" />
|
||||
<ClInclude Include="SDL\src\gpu\SDL_sysgpu.h" />
|
||||
<ClInclude Include="SDL\src\gpu\vulkan\SDL_gpu_vulkan_vkfuncs.h" />
|
||||
<ClInclude Include="SDL\src\haptic\hidapi\SDL_hidapihaptic.h" />
|
||||
<ClInclude Include="SDL\src\haptic\hidapi\SDL_hidapihaptic_c.h" />
|
||||
<ClInclude Include="SDL\src\io\SDL_asyncio_c.h" />
|
||||
<ClInclude Include="SDL\src\io\SDL_sysasyncio.h" />
|
||||
<ClInclude Include="SDL\src\haptic\SDL_haptic_c.h" />
|
||||
@@ -140,7 +144,11 @@
|
||||
<ClInclude Include="SDL\src\hidapi\SDL_hidapi_c.h" />
|
||||
<ClInclude Include="SDL\src\joystick\controller_type.h" />
|
||||
<ClInclude Include="SDL\src\joystick\hidapi\SDL_hidapijoystick_c.h" />
|
||||
<ClInclude Include="SDL\src\joystick\hidapi\SDL_hidapi_flydigi.h" />
|
||||
<ClInclude Include="SDL\src\joystick\hidapi\SDL_hidapi_nintendo.h" />
|
||||
<ClInclude Include="SDL\src\joystick\hidapi\SDL_hidapi_rumble.h" />
|
||||
<ClInclude Include="SDL\src\joystick\hidapi\SDL_hidapi_sinput.h" />
|
||||
<ClInclude Include="SDL\src\joystick\hidapi\SDL_report_descriptor.h" />
|
||||
<ClInclude Include="SDL\src\joystick\SDL_gamepad_c.h" />
|
||||
<ClInclude Include="SDL\src\joystick\SDL_gamepad_db.h" />
|
||||
<ClInclude Include="SDL\src\joystick\SDL_joystick_c.h" />
|
||||
@@ -156,6 +164,7 @@
|
||||
<ClInclude Include="SDL\src\libm\math_private.h" />
|
||||
<ClInclude Include="SDL\src\locale\SDL_syslocale.h" />
|
||||
<ClInclude Include="SDL\src\main\SDL_main_callbacks.h" />
|
||||
<ClInclude Include="SDL\src\misc\SDL_libusb.h" />
|
||||
<ClInclude Include="SDL\src\misc\SDL_sysurl.h" />
|
||||
<ClInclude Include="SDL\src\power\SDL_syspower.h" />
|
||||
<ClInclude Include="SDL\src\render\direct3d11\SDL_shaders_d3d11.h" />
|
||||
@@ -175,7 +184,6 @@
|
||||
<ClInclude Include="SDL\src\render\software\SDL_drawline.h" />
|
||||
<ClInclude Include="SDL\src\render\software\SDL_drawpoint.h" />
|
||||
<ClInclude Include="SDL\src\render\software\SDL_render_sw_c.h" />
|
||||
<ClInclude Include="SDL\src\render\software\SDL_rotate.h" />
|
||||
<ClInclude Include="SDL\src\render\software\SDL_triangle.h" />
|
||||
<ClInclude Include="SDL\src\render\vulkan\SDL_shaders_vulkan.h" />
|
||||
<ClInclude Include="SDL\src\SDL_assert_c.h" />
|
||||
@@ -184,20 +192,35 @@
|
||||
<ClCompile Include="SDL\src\camera\dummy\SDL_camera_dummy.c" />
|
||||
<ClCompile Include="SDL\src\camera\mediafoundation\SDL_camera_mediafoundation.c" />
|
||||
<ClCompile Include="SDL\src\camera\SDL_camera.c" />
|
||||
<ClCompile Include="SDL\src\core\windows\pch_cpp.cpp" />
|
||||
<ClCompile Include="SDL\src\core\windows\SDL_gameinput.cpp" />
|
||||
<ClCompile Include="SDL\src\dialog\SDL_dialog.c" />
|
||||
<ClCompile Include="SDL\src\dialog\SDL_dialog_utils.c" />
|
||||
<ClCompile Include="SDL\src\filesystem\SDL_filesystem.c" />
|
||||
<ClCompile Include="SDL\src\filesystem\windows\SDL_sysfsops.c" />
|
||||
<ClCompile Include="SDL\src\haptic\hidapi\SDL_hidapihaptic.c" />
|
||||
<ClCompile Include="SDL\src\haptic\hidapi\SDL_hidapihaptic_lg4ff.c" />
|
||||
<ClCompile Include="SDL\src\io\windows\SDL_asyncio_windows_ioring.c" />
|
||||
<ClCompile Include="SDL\src\gpu\SDL_gpu.c" />
|
||||
<ClCompile Include="SDL\src\gpu\d3d12\SDL_gpu_d3d12.c" />
|
||||
<ClCompile Include="SDL\src\gpu\vulkan\SDL_gpu_vulkan.c" />
|
||||
<ClCompile Include="SDL\src\io\generic\SDL_asyncio_generic.c" />
|
||||
<ClCompile Include="SDL\src\io\SDL_asyncio.c" />
|
||||
<ClCompile Include="SDL\src\joystick\gdk\SDL_gameinputjoystick.cpp" />
|
||||
<ClCompile Include="SDL\src\joystick\hidapi\SDL_hidapi_8bitdo.c" />
|
||||
<ClCompile Include="SDL\src\joystick\hidapi\SDL_hidapi_flydigi.c" />
|
||||
<ClCompile Include="SDL\src\joystick\hidapi\SDL_hidapi_gip.c" />
|
||||
<ClCompile Include="SDL\src\joystick\hidapi\SDL_hidapi_lg4ff.c" />
|
||||
<ClCompile Include="SDL\src\joystick\hidapi\SDL_hidapi_sinput.c" />
|
||||
<ClCompile Include="SDL\src\joystick\hidapi\SDL_hidapi_steam_triton.c" />
|
||||
<ClCompile Include="SDL\src\joystick\hidapi\SDL_hidapi_switch2.c" />
|
||||
<ClCompile Include="SDL\src\joystick\hidapi\SDL_hidapi_zuiki.c" />
|
||||
<ClCompile Include="SDL\src\joystick\hidapi\SDL_report_descriptor.c" />
|
||||
<ClCompile Include="SDL\src\main\generic\SDL_sysmain_callbacks.c" />
|
||||
<ClCompile Include="SDL\src\main\SDL_main_callbacks.c" />
|
||||
<ClCompile Include="SDL\src\main\SDL_runapp.c" />
|
||||
<ClCompile Include="SDL\src\main\windows\SDL_sysmain_runapp.c" />
|
||||
<ClCompile Include="SDL\src\misc\SDL_libusb.c" />
|
||||
<ClCompile Include="SDL\src\render\vulkan\SDL_render_vulkan.c" />
|
||||
<ClCompile Include="SDL\src\render\vulkan\SDL_shaders_vulkan.c" />
|
||||
<ClCompile Include="SDL\src\SDL_guid.c" />
|
||||
@@ -241,6 +264,7 @@
|
||||
<ClInclude Include="SDL\src\video\khronos\vulkan\vulkan_xcb.h" />
|
||||
<ClInclude Include="SDL\src\video\khronos\vulkan\vulkan_xlib.h" />
|
||||
<ClInclude Include="SDL\src\video\khronos\vulkan\vulkan_xlib_xrandr.h" />
|
||||
<ClInclude Include="SDL\src\video\miniz.h" />
|
||||
<ClInclude Include="SDL\src\video\offscreen\SDL_offscreenevents_c.h" />
|
||||
<ClInclude Include="SDL\src\video\offscreen\SDL_offscreenframebuffer_c.h" />
|
||||
<ClInclude Include="SDL\src\video\offscreen\SDL_offscreenopengles.h" />
|
||||
@@ -256,13 +280,14 @@
|
||||
<ClInclude Include="SDL\src\video\SDL_pixels_c.h" />
|
||||
<ClInclude Include="SDL\src\video\SDL_rect_c.h" />
|
||||
<ClInclude Include="SDL\src\video\SDL_RLEaccel_c.h" />
|
||||
<ClInclude Include="SDL\src\video\SDL_rotate.h" />
|
||||
<ClInclude Include="SDL\src\video\SDL_stb_c.h" />
|
||||
<ClInclude Include="SDL\src\video\SDL_surface_c.h" />
|
||||
<ClInclude Include="SDL\src\video\SDL_sysvideo.h" />
|
||||
<ClInclude Include="SDL\src\video\SDL_video_unsupported.h" />
|
||||
<ClInclude Include="SDL\src\video\SDL_vulkan_internal.h" />
|
||||
<ClInclude Include="SDL\src\video\SDL_yuv_c.h" />
|
||||
<ClInclude Include="SDL\src\video\windows\SDL_msctf.h" />
|
||||
<ClInclude Include="SDL\src\video\windows\SDL_surface_utils.h" />
|
||||
<ClInclude Include="SDL\src\video\windows\SDL_windowsclipboard.h" />
|
||||
<ClInclude Include="SDL\src\video\windows\SDL_windowsevents.h" />
|
||||
<ClInclude Include="SDL\src\video\windows\SDL_windowsframebuffer.h" />
|
||||
@@ -303,7 +328,6 @@
|
||||
<ClCompile Include="SDL\src\audio\SDL_wave.c" />
|
||||
<ClCompile Include="SDL\src\audio\wasapi\SDL_wasapi.c" />
|
||||
<ClCompile Include="SDL\src\core\SDL_core_unsupported.c" />
|
||||
<ClCompile Include="SDL\src\core\windows\SDL_gameinput.c" />
|
||||
<ClCompile Include="SDL\src\core\windows\SDL_hid.c" />
|
||||
<ClCompile Include="SDL\src\core\windows\SDL_immdevice.c" />
|
||||
<ClCompile Include="SDL\src\core\windows\SDL_windows.c" />
|
||||
@@ -333,7 +357,6 @@
|
||||
<ClCompile Include="SDL\src\hidapi\SDL_hidapi.c" />
|
||||
<ClCompile Include="SDL\src\joystick\controller_type.c" />
|
||||
<ClCompile Include="SDL\src\joystick\dummy\SDL_sysjoystick.c" />
|
||||
<ClCompile Include="SDL\src\joystick\gdk\SDL_gameinputjoystick.c" />
|
||||
<ClCompile Include="SDL\src\joystick\hidapi\SDL_hidapijoystick.c" />
|
||||
<ClCompile Include="SDL\src\joystick\hidapi\SDL_hidapi_combined.c" />
|
||||
<ClCompile Include="SDL\src\joystick\hidapi\SDL_hidapi_gamecube.c" />
|
||||
@@ -393,7 +416,6 @@
|
||||
<ClCompile Include="SDL\src\render\software\SDL_drawline.c" />
|
||||
<ClCompile Include="SDL\src\render\software\SDL_drawpoint.c" />
|
||||
<ClCompile Include="SDL\src\render\software\SDL_render_sw.c" />
|
||||
<ClCompile Include="SDL\src\render\software\SDL_rotate.c" />
|
||||
<ClCompile Include="SDL\src\render\software\SDL_triangle.c" />
|
||||
<ClCompile Include="SDL\src\SDL.c" />
|
||||
<ClCompile Include="SDL\src\SDL_assert.c" />
|
||||
@@ -464,6 +486,7 @@
|
||||
<ClCompile Include="SDL\src\video\SDL_pixels.c" />
|
||||
<ClCompile Include="SDL\src\video\SDL_rect.c" />
|
||||
<ClCompile Include="SDL\src\video\SDL_RLEaccel.c" />
|
||||
<ClCompile Include="SDL\src\video\SDL_rotate.c" />
|
||||
<ClCompile Include="SDL\src\video\SDL_stb.c" />
|
||||
<ClCompile Include="SDL\src\video\SDL_stretch.c" />
|
||||
<ClCompile Include="SDL\src\video\SDL_surface.c" />
|
||||
@@ -471,12 +494,11 @@
|
||||
<ClCompile Include="SDL\src\video\SDL_video_unsupported.c" />
|
||||
<ClCompile Include="SDL\src\video\SDL_vulkan_utils.c" />
|
||||
<ClCompile Include="SDL\src\video\SDL_yuv.c" />
|
||||
<ClCompile Include="SDL\src\video\windows\SDL_surface_utils.c" />
|
||||
<ClCompile Include="SDL\src\video\windows\SDL_windowsclipboard.c" />
|
||||
<ClCompile Include="SDL\src\video\windows\SDL_windowsevents.c" />
|
||||
<ClCompile Include="SDL\src\video\windows\SDL_windowsframebuffer.c" />
|
||||
<ClCompile Include="SDL\src\video\windows\SDL_windowsgameinput.cpp" />
|
||||
<ClCompile Include="SDL\src\video\windows\SDL_windowskeyboard.c" />
|
||||
<ClCompile Include="SDL\src\video\windows\SDL_windowsgameinput.c" />
|
||||
<ClCompile Include="SDL\src\video\windows\SDL_windowsmessagebox.c" />
|
||||
<ClCompile Include="SDL\src\video\windows\SDL_windowsmodes.c" />
|
||||
<ClCompile Include="SDL\src\video\windows\SDL_windowsmouse.c" />
|
||||
|
||||
+117
-30
@@ -214,6 +214,9 @@
|
||||
<Filter Include="io\windows">
|
||||
<UniqueIdentifier>{000028b2ea36d7190d13777a4dc70000}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="haptic\hidapi">
|
||||
<UniqueIdentifier>{695ffc61-5497-4227-b415-15e9bdd5b6bf}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="SDL\include\SDL3\SDL_begin_code.h">
|
||||
@@ -699,9 +702,6 @@
|
||||
<ClInclude Include="SDL\src\video\yuv2rgb\yuv_rgb_std_func.h">
|
||||
<Filter>video\yuv2rgb</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="SDL\src\video\windows\SDL_surface_utils.h">
|
||||
<Filter>video\windows</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="SDL\src\video\windows\SDL_windowsclipboard.h">
|
||||
<Filter>video\windows</Filter>
|
||||
</ClInclude>
|
||||
@@ -831,9 +831,6 @@
|
||||
<ClInclude Include="SDL\src\render\software\SDL_render_sw_c.h">
|
||||
<Filter>render\software</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="SDL\src\render\software\SDL_rotate.h">
|
||||
<Filter>render\software</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="SDL\src\render\software\SDL_triangle.h">
|
||||
<Filter>render\software</Filter>
|
||||
</ClInclude>
|
||||
@@ -911,12 +908,6 @@
|
||||
<ClInclude Include="SDL\src\hidapi\SDL_hidapi_c.h" />
|
||||
<ClInclude Include="SDL\src\thread\generic\SDL_sysrwlock_c.h" />
|
||||
<ClInclude Include="SDL\src\thread\generic\SDL_sysrwlock_c.h" />
|
||||
<ClInclude Include="SDL\src\video\yuv2rgb\yuv_rgb_common.h" />
|
||||
<ClInclude Include="SDL\src\video\yuv2rgb\yuv_rgb_internal.h" />
|
||||
<ClInclude Include="SDL\src\video\yuv2rgb\yuv_rgb_lsx.h" />
|
||||
<ClInclude Include="SDL\src\video\yuv2rgb\yuv_rgb_lsx_func.h" />
|
||||
<ClInclude Include="SDL\src\video\yuv2rgb\yuv_rgb_sse.h" />
|
||||
<ClInclude Include="SDL\src\video\yuv2rgb\yuv_rgb_std.h" />
|
||||
<ClInclude Include="SDL\src\render\vulkan\SDL_shaders_vulkan.h">
|
||||
<Filter>render\vulkan</Filter>
|
||||
</ClInclude>
|
||||
@@ -950,6 +941,60 @@
|
||||
<ClInclude Include="SDL\include\SDL3\SDL_storage.h" />
|
||||
<ClInclude Include="SDL\include\SDL3\SDL_time.h" />
|
||||
<ClInclude Include="SDL\src\events\SDL_categories_c.h" />
|
||||
<ClInclude Include="SDL\src\video\yuv2rgb\yuv_rgb_std.h">
|
||||
<Filter>video\yuv2rgb</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="SDL\src\video\yuv2rgb\yuv_rgb_common.h">
|
||||
<Filter>video\yuv2rgb</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="SDL\src\video\yuv2rgb\yuv_rgb_internal.h">
|
||||
<Filter>video\yuv2rgb</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="SDL\src\video\yuv2rgb\yuv_rgb_lsx.h">
|
||||
<Filter>video\yuv2rgb</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="SDL\src\video\yuv2rgb\yuv_rgb_lsx_func.h">
|
||||
<Filter>video\yuv2rgb</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="SDL\src\video\yuv2rgb\yuv_rgb_sse.h">
|
||||
<Filter>video\yuv2rgb</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="SDL\src\video\miniz.h">
|
||||
<Filter>video</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="SDL\src\video\SDL_rotate.h">
|
||||
<Filter>video</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="SDL\src\video\SDL_video_unsupported.h">
|
||||
<Filter>video</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="SDL\src\misc\SDL_libusb.h">
|
||||
<Filter>misc</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="SDL\src\haptic\hidapi\SDL_hidapihaptic.h">
|
||||
<Filter>haptic\hidapi</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="SDL\src\haptic\hidapi\SDL_hidapihaptic_c.h">
|
||||
<Filter>haptic\hidapi</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="SDL\src\core\SDL_core_unsupported.h">
|
||||
<Filter>core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="SDL\src\joystick\hidapi\SDL_hidapi_flydigi.h">
|
||||
<Filter>joystick\hidapi</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="SDL\src\joystick\hidapi\SDL_hidapi_nintendo.h">
|
||||
<Filter>joystick\hidapi</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="SDL\src\joystick\hidapi\SDL_hidapi_sinput.h">
|
||||
<Filter>joystick\hidapi</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="SDL\src\joystick\hidapi\SDL_report_descriptor.h">
|
||||
<Filter>joystick\hidapi</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="SDL\include\SDL3\SDL_dlopennote.h">
|
||||
<Filter>API Headers</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="SDL\src\audio\wasapi\SDL_wasapi.c" />
|
||||
@@ -1037,9 +1082,6 @@
|
||||
<ClCompile Include="SDL\src\core\SDL_core_unsupported.c">
|
||||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SDL\src\core\windows\SDL_gameinput.c">
|
||||
<Filter>core\windows</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SDL\src\core\windows\SDL_hid.c">
|
||||
<Filter>core\windows</Filter>
|
||||
</ClCompile>
|
||||
@@ -1166,9 +1208,6 @@
|
||||
<ClCompile Include="SDL\src\joystick\dummy\SDL_sysjoystick.c">
|
||||
<Filter>joystick\dummy</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SDL\src\joystick\gdk\SDL_gameinputjoystick.c">
|
||||
<Filter>joystick\gdk</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SDL\src\joystick\hidapi\SDL_hidapi_combined.c">
|
||||
<Filter>joystick\hidapi</Filter>
|
||||
</ClCompile>
|
||||
@@ -1328,9 +1367,6 @@
|
||||
<ClCompile Include="SDL\src\video\dummy\SDL_nullvideo.c">
|
||||
<Filter>video\dummy</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SDL\src\video\windows\SDL_surface_utils.c">
|
||||
<Filter>video\windows</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SDL\src\video\windows\SDL_windowsclipboard.c">
|
||||
<Filter>video\windows</Filter>
|
||||
</ClCompile>
|
||||
@@ -1343,9 +1379,6 @@
|
||||
<ClCompile Include="SDL\src\video\windows\SDL_windowskeyboard.c">
|
||||
<Filter>video\windows</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SDL\src\video\windows\SDL_windowsgameinput.c">
|
||||
<Filter>video\windows</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SDL\src\video\windows\SDL_windowsmessagebox.c">
|
||||
<Filter>video\windows</Filter>
|
||||
</ClCompile>
|
||||
@@ -1508,9 +1541,6 @@
|
||||
<ClCompile Include="SDL\src\render\software\SDL_render_sw.c">
|
||||
<Filter>render\software</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SDL\src\render\software\SDL_rotate.c">
|
||||
<Filter>render\software</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SDL\src\render\software\SDL_triangle.c">
|
||||
<Filter>render\software</Filter>
|
||||
</ClCompile>
|
||||
@@ -1535,9 +1565,6 @@
|
||||
</ClCompile>
|
||||
<ClCompile Include="SDL\src\thread\generic\SDL_sysrwlock.c" />
|
||||
<ClCompile Include="SDL\src\thread\generic\SDL_sysrwlock.c" />
|
||||
<ClCompile Include="SDL\src\video\yuv2rgb\yuv_rgb_lsx.c" />
|
||||
<ClCompile Include="SDL\src\video\yuv2rgb\yuv_rgb_sse.c" />
|
||||
<ClCompile Include="SDL\src\video\yuv2rgb\yuv_rgb_std.c" />
|
||||
<ClCompile Include="SDL\src\render\vulkan\SDL_render_vulkan.c">
|
||||
<Filter>render\vulkan</Filter>
|
||||
</ClCompile>
|
||||
@@ -1579,6 +1606,66 @@
|
||||
<ClCompile Include="SDL\src\storage\generic\SDL_genericstorage.c" />
|
||||
<ClCompile Include="SDL\src\storage\steam\SDL_steamstorage.c" />
|
||||
<ClCompile Include="SDL\src\storage\SDL_storage.c" />
|
||||
<ClCompile Include="SDL\src\video\windows\SDL_windowsgameinput.cpp">
|
||||
<Filter>video\windows</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SDL\src\video\yuv2rgb\yuv_rgb_lsx.c">
|
||||
<Filter>video\yuv2rgb</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SDL\src\video\yuv2rgb\yuv_rgb_sse.c">
|
||||
<Filter>video\yuv2rgb</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SDL\src\video\yuv2rgb\yuv_rgb_std.c">
|
||||
<Filter>video\yuv2rgb</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SDL\src\video\SDL_rotate.c">
|
||||
<Filter>video</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SDL\src\misc\SDL_libusb.c">
|
||||
<Filter>misc</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SDL\src\haptic\hidapi\SDL_hidapihaptic.c">
|
||||
<Filter>haptic\hidapi</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SDL\src\haptic\hidapi\SDL_hidapihaptic_lg4ff.c">
|
||||
<Filter>haptic\hidapi</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SDL\src\core\windows\pch_cpp.cpp">
|
||||
<Filter>core\windows</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SDL\src\core\windows\SDL_gameinput.cpp">
|
||||
<Filter>core\windows</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SDL\src\joystick\gdk\SDL_gameinputjoystick.cpp">
|
||||
<Filter>joystick\gdk</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SDL\src\joystick\hidapi\SDL_hidapi_8bitdo.c">
|
||||
<Filter>joystick\hidapi</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SDL\src\joystick\hidapi\SDL_hidapi_flydigi.c">
|
||||
<Filter>joystick\hidapi</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SDL\src\joystick\hidapi\SDL_hidapi_gip.c">
|
||||
<Filter>joystick\hidapi</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SDL\src\joystick\hidapi\SDL_hidapi_lg4ff.c">
|
||||
<Filter>joystick\hidapi</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SDL\src\joystick\hidapi\SDL_hidapi_sinput.c">
|
||||
<Filter>joystick\hidapi</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SDL\src\joystick\hidapi\SDL_hidapi_steam_triton.c">
|
||||
<Filter>joystick\hidapi</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SDL\src\joystick\hidapi\SDL_hidapi_switch2.c">
|
||||
<Filter>joystick\hidapi</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SDL\src\joystick\hidapi\SDL_hidapi_zuiki.c">
|
||||
<Filter>joystick\hidapi</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SDL\src\joystick\hidapi\SDL_report_descriptor.c">
|
||||
<Filter>joystick\hidapi</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="SDL\src\core\windows\version.rc" />
|
||||
|
||||
Vendored
+27
@@ -0,0 +1,27 @@
|
||||
add_library(3rdparty_protobuf INTERFACE)
|
||||
if (USE_SYSTEM_PROTOBUF)
|
||||
pkg_check_modules(PROTOBUF REQUIRED IMPORTED_TARGET protobuf>=33.0.0)
|
||||
target_link_libraries(3rdparty_protobuf INTERFACE PkgConfig::PROTOBUF)
|
||||
set(PROTOBUF_DIR "${CMAKE_SOURCE_DIR}/rpcs3/Emu/NP/generated")
|
||||
execute_process(COMMAND protoc --cpp_out=${PROTOBUF_DIR} --proto_path=${PROTOBUF_DIR} np2_structs.proto RESULT_VARIABLE PROTOBUF_CMD_ERROR)
|
||||
if(PROTOBUF_CMD_ERROR AND NOT PROTOBUF_CMD_ERROR EQUAL 0)
|
||||
message(FATAL_ERROR "protoc failed to regenerate protobuf files.")
|
||||
endif()
|
||||
else()
|
||||
option(protobuf_INSTALL "Install protobuf binaries and files" OFF)
|
||||
option(protobuf_BUILD_TESTS "Build tests" OFF)
|
||||
option(protobuf_BUILD_CONFORMANCE "Build conformance tests" OFF)
|
||||
option(protobuf_BUILD_EXAMPLES "Build examples" OFF)
|
||||
option(protobuf_BUILD_PROTOBUF_BINARIES "Build protobuf libraries and protoc compiler" ON)
|
||||
option(protobuf_BUILD_PROTOC_BINARIES "Build libprotoc and protoc compiler" OFF)
|
||||
option(protobuf_BUILD_LIBPROTOC "Build libprotoc" OFF)
|
||||
option(protobuf_BUILD_LIBUPB "Build libupb" OFF)
|
||||
option(protobuf_ALLOW_CCACHE "Adjust build flags to allow for ccache support." ON)
|
||||
option(protobuf_DISABLE_RTTI "Remove runtime type information in the binaries" OFF)
|
||||
option(protobuf_FORCE_FETCH_DEPENDENCIES "Force all dependencies to be downloaded from GitHub. Local installations will be ignored." OFF)
|
||||
option(protobuf_LOCAL_DEPENDENCIES_ONLY "Prevent downloading any dependencies from GitHub. If this option is set, the dependency must be available locally as an installed package." OFF)
|
||||
|
||||
add_subdirectory(protobuf EXCLUDE_FROM_ALL)
|
||||
target_include_directories(3rdparty_protobuf SYSTEM INTERFACE protobuf/src)
|
||||
target_link_libraries(3rdparty_protobuf INTERFACE libprotobuf)
|
||||
endif()
|
||||
+1
Submodule 3rdparty/protobuf/protobuf added at edaa823d8b
+111
@@ -0,0 +1,111 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{7B3B4C5D-6E7F-8A9B-0C1D-2E3F4A5B6C7D}</ProjectGuid>
|
||||
<Keyword>MakeFileProj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(SolutionDir)\buildfiles\msvc\common_default.props" />
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<Import Project="$(SolutionDir)\buildfiles\msvc\common_default_macros.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Makefile</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Makefile</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<PropertyGroup>
|
||||
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
|
||||
</PropertyGroup>
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros">
|
||||
<CmakeReleaseCLI>call vsdevcmd.bat -arch=amd64
|
||||
if not exist "$(SolutionDir)build\tmp\protobuf_build-$(Configuration)-$(Platform)" mkdir "$(SolutionDir)build\tmp\protobuf_build-$(Configuration)-$(Platform)"
|
||||
cd "$(SolutionDir)build\tmp\protobuf_build-$(Configuration)-$(Platform)"
|
||||
cmake -G Ninja -DCMAKE_CXX_COMPILER="cl.exe" -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_CXX_STANDARD=20 -DCMAKE_BUILD_TYPE="Release" -DCMAKE_INSTALL_PREFIX="$(SolutionDir)build\lib\$(Configuration)-$(Platform)\protobuf_build" -DCMAKE_SYSTEM_VERSION=10.0 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=$(WindowsTargetPlatformVersion) -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -Dprotobuf_INSTALL=ON -Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF -Dprotobuf_BUILD_EXAMPLES=OFF -Dprotobuf_BUILD_PROTOBUF_BINARIES=ON -Dprotobuf_BUILD_PROTOC_BINARIES=OFF -Dprotobuf_BUILD_LIBPROTOC=OFF -Dprotobuf_BUILD_LIBUPB=OFF -Dprotobuf_ALLOW_CCACHE=ON -Dprotobuf_FORCE_FETCH_DEPENDENCIES=ON -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_MSVC_STATIC_RUNTIME=ON "$(SolutionDir)3rdparty\protobuf\protobuf"
|
||||
</CmakeReleaseCLI>
|
||||
<CmakeDebugCLI>call vsdevcmd.bat -arch=amd64
|
||||
if not exist "$(SolutionDir)build\tmp\protobuf_build-$(Configuration)-$(Platform)" mkdir "$(SolutionDir)build\tmp\protobuf_build-$(Configuration)-$(Platform)"
|
||||
cd "$(SolutionDir)build\tmp\protobuf_build-$(Configuration)-$(Platform)"
|
||||
cmake -G Ninja -DCMAKE_CXX_COMPILER="cl.exe" -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_CXX_STANDARD=20 -DCMAKE_BUILD_TYPE="Debug" -DCMAKE_INSTALL_PREFIX="$(SolutionDir)build\lib\$(Configuration)-$(Platform)\protobuf_build" -DCMAKE_SYSTEM_VERSION=10.0 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=$(WindowsTargetPlatformVersion) -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebugDLL -Dprotobuf_INSTALL=ON -Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_BUILD_CONFORMANCE=OFF -Dprotobuf_BUILD_EXAMPLES=OFF -Dprotobuf_BUILD_PROTOBUF_BINARIES=ON -Dprotobuf_BUILD_PROTOC_BINARIES=OFF -Dprotobuf_BUILD_LIBPROTOC=OFF -Dprotobuf_BUILD_LIBUPB=OFF -Dprotobuf_ALLOW_CCACHE=ON -Dprotobuf_FORCE_FETCH_DEPENDENCIES=ON -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_MSVC_STATIC_RUNTIME=OFF "$(SolutionDir)3rdparty\protobuf\protobuf"
|
||||
</CmakeDebugCLI>
|
||||
<CmakeCleanCLI>
|
||||
echo Cleaning..
|
||||
rmdir /s /q "$(SolutionDir)build\lib\$(Configuration)-$(Platform)\protobuf_build"
|
||||
cd "$(SolutionDir)build\tmp\protobuf_build-$(Configuration)-$(Platform)"
|
||||
for /F "delims= eol=|" %%f in ('
|
||||
dir /b ^| findstr /V "[^.]*\build[^.]*\.vcxproj"') do (
|
||||
echo Deleting .\%%f
|
||||
if exist %%f\nul (
|
||||
rmdir .\%%f /s /q
|
||||
) else (
|
||||
del .\%%f /q
|
||||
)
|
||||
)
|
||||
</CmakeCleanCLI>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<NMakePreprocessorDefinitions>
|
||||
</NMakePreprocessorDefinitions>
|
||||
<OutDir>$(SolutionDir)build\lib\$(Configuration)-$(Platform)\</OutDir>
|
||||
<IntDir>$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
|
||||
<NMakeBuildCommandLine>
|
||||
$(CmakeDebugCLI)
|
||||
ninja
|
||||
ninja install
|
||||
</NMakeBuildCommandLine>
|
||||
<NMakeReBuildCommandLine>
|
||||
$(CmakeCleanCLI)
|
||||
$(CmakeDebugCLI)
|
||||
ninja
|
||||
ninja install
|
||||
</NMakeReBuildCommandLine>
|
||||
<NMakeCleanCommandLine>
|
||||
$(CmakeCleanCLI)
|
||||
</NMakeCleanCommandLine>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<NMakePreprocessorDefinitions>
|
||||
</NMakePreprocessorDefinitions>
|
||||
<OutDir>$(SolutionDir)build\lib\$(Configuration)-$(Platform)\</OutDir>
|
||||
<IntDir>$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
|
||||
<NMakeBuildCommandLine>
|
||||
$(CmakeReleaseCLI)
|
||||
ninja
|
||||
ninja install
|
||||
</NMakeBuildCommandLine>
|
||||
<NMakeReBuildCommandLine>
|
||||
$(CmakeCleanCLI)
|
||||
$(CmakeReleaseCLI)
|
||||
ninja
|
||||
ninja install
|
||||
</NMakeReBuildCommandLine>
|
||||
<NMakeCleanCommandLine>
|
||||
$(CmakeCleanCLI)
|
||||
</NMakeCleanCommandLine>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
Vendored
+1
-1
Submodule 3rdparty/yaml-cpp/yaml-cpp updated: 456c68f452...05c44fcd18
Vendored
+1
@@ -76,6 +76,7 @@
|
||||
<ClCompile Include="yaml-cpp\src\exceptions.cpp" />
|
||||
<ClCompile Include="yaml-cpp\src\exp.cpp">
|
||||
</ClCompile>
|
||||
<ClCompile Include="yaml-cpp\src\fptostring.cpp" />
|
||||
<ClCompile Include="yaml-cpp\src\memory.cpp">
|
||||
</ClCompile>
|
||||
<ClCompile Include="yaml-cpp\src\node.cpp">
|
||||
|
||||
+3
@@ -94,5 +94,8 @@
|
||||
<ClCompile Include="yaml-cpp\src\depthguard.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="yaml-cpp\src\fptostring.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
Vendored
+1
-1
Submodule 3rdparty/zlib/zlib updated: 51b7f2abda...da607da739
+7
-7
@@ -20,26 +20,26 @@ The following tools are required to build RPCS3 on Windows 10 or later:
|
||||
with standalone **CMake** tool.
|
||||
|
||||
- [Python 3.6+](https://www.python.org/downloads/) (add to PATH)
|
||||
- [Qt 6.10.1](https://www.qt.io/download-qt-installer) In case you can't download from the official installer, you can use [Another Qt installer](https://github.com/miurahr/aqtinstall) (In that case you will need to manually add the "qtmultimedia" module when installing Qt)
|
||||
- [Qt 6.10.2](https://www.qt.io/download-qt-installer) In case you can't download from the official installer, you can use [Another Qt installer](https://github.com/miurahr/aqtinstall) (In that case you will need to manually add the "qtmultimedia" module when installing Qt)
|
||||
- [Vulkan SDK 1.3.268.0](https://vulkan.lunarg.com/sdk/home) (see "Install the SDK" [here](https://vulkan.lunarg.com/doc/sdk/latest/windows/getting_started.html)) for now future SDKs don't work. You need precisely 1.3.268.0.
|
||||
|
||||
The `sln` solution available only on **Visual Studio** is the preferred building solution. It easily allows to build the **RPCS3** application in `Release` and `Debug` mode.
|
||||
|
||||
In order to build **RPCS3** with the `sln` solution (with **Visual Studio**), **Qt** libs need to be detected. To detect the libs:
|
||||
- add and set the `QTDIR` environment variable, e.g. `<QtInstallFolder>\6.10.1\msvc2022_64\`
|
||||
- add and set the `QTDIR` environment variable, e.g. `<QtInstallFolder>\6.10.2\msvc2022_64\`
|
||||
- or use the [Visual Studio Qt Plugin](https://marketplace.visualstudio.com/items?itemName=TheQtCompany.QtVisualStudioTools2022)
|
||||
|
||||
**NOTE:** If you have issues with the **Visual Studio Qt Plugin**, you may want to uninstall it and install the [Legacy Qt Plugin](https://marketplace.visualstudio.com/items?itemName=TheQtCompany.LEGACYQtVisualStudioTools2022) instead.
|
||||
|
||||
In order to build **RPCS3** with the `CMake` solution (with both **Visual Studio** and standalone **CMake** tool):
|
||||
- add and set the `Qt6_ROOT` environment variable to the **Qt** libs path, e.g. `<QtInstallFolder>\6.10.1\msvc2022_64\`
|
||||
- add and set the `Qt6_ROOT` environment variable to the **Qt** libs path, e.g. `<QtInstallFolder>\6.10.2\msvc2022_64\`
|
||||
|
||||
### Linux
|
||||
|
||||
These are the essentials tools to build RPCS3 on Linux. Some of them can be installed through your favorite package manager:
|
||||
- Clang 17+ or GCC 13+
|
||||
- [CMake 3.28.0+](https://www.cmake.org/download/)
|
||||
- [Qt 6.10.1](https://www.qt.io/download-qt-installer)
|
||||
- [Qt 6.10.2](https://www.qt.io/download-qt-installer)
|
||||
- [Vulkan SDK 1.3.268.0](https://vulkan.lunarg.com/sdk/home) (See "Install the SDK" [here](https://vulkan.lunarg.com/doc/sdk/latest/linux/getting_started.html)) for now future SDKs don't work. You need precisely 1.3.268.0.
|
||||
- [SDL3](https://github.com/libsdl-org/SDL/releases) (for the FAudio backend)
|
||||
|
||||
@@ -51,7 +51,7 @@ These are the essentials tools to build RPCS3 on Linux. Some of them can be inst
|
||||
|
||||
#### Debian & Ubuntu
|
||||
|
||||
sudo apt-get install build-essential ninja-build libasound2-dev libpulse-dev libopenal-dev libglew-dev zlib1g-dev libedit-dev libvulkan-dev libudev-dev git libevdev-dev libsdl3-3.2 libsdl3-dev libjack-dev libsndio-dev
|
||||
sudo apt-get install build-essential ninja-build libasound2-dev libpulse-dev libopenal-dev libglew-dev zlib1g-dev libedit-dev libvulkan-dev libudev-dev git libevdev-dev libsdl3-dev libjack-dev libsndio-dev libcurl4-openssl-dev qt6-base-dev qt6-base-private-dev qt6-multimedia-dev qt6-svg-dev libxkbcommon-dev
|
||||
|
||||
Ubuntu is usually horrendously out of date, and some packages need to be downloaded by hand. This part is for Qt, GCC, Vulkan, and CMake
|
||||
|
||||
@@ -95,7 +95,7 @@ sudo apt-get install cmake
|
||||
|
||||
#### Fedora
|
||||
|
||||
sudo dnf install alsa-lib-devel cmake ninja-build glew glew-devel libatomic libevdev-devel libudev-devel openal-devel qt6-qtbase-devel qt6-qtbase-private-devel vulkan-devel pipewire-jack-audio-connection-kit-devel qt6-qtmultimedia-devel qt6-qtsvg-devel llvm-devel
|
||||
sudo dnf install alsa-lib-devel cmake ninja-build glew glew-devel libatomic libevdev-devel libudev-devel openal-soft-devel qt6-qtbase-devel qt6-qtbase-private-devel vulkan-devel pipewire-jack-audio-connection-kit-devel qt6-qtmultimedia-devel qt6-qtsvg-devel llvm-devel libcurl-devel
|
||||
|
||||
#### OpenSUSE
|
||||
|
||||
@@ -123,7 +123,7 @@ Start **Visual Studio**, click on `Open a project or solution` and select the `r
|
||||
##### Configuring the Qt Plugin (if used)
|
||||
|
||||
1) go to `Extensions->Qt VS Tools->Qt Versions`
|
||||
2) add the path to your Qt installation with compiler e.g. `<QtInstallFolder>\6.10.1\msvc2022_64`, version will fill in automatically
|
||||
2) add the path to your Qt installation with compiler e.g. `<QtInstallFolder>\6.10.2\msvc2022_64`, version will fill in automatically
|
||||
3) go to `Extensions->Qt VS Tools->Options->Legacy Project Format`. (Only available in the **Legacy Qt Plugin**)
|
||||
4) set `Build: Run pre-build setup` to `true`. (Only available in the **Legacy Qt Plugin**)
|
||||
|
||||
|
||||
+5
-5
@@ -13,12 +13,12 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11)
|
||||
message(FATAL_ERROR "RPCS3 requires at least gcc-11.")
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13)
|
||||
message(FATAL_ERROR "RPCS3 requires at least gcc-13.")
|
||||
endif()
|
||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.0)
|
||||
message(FATAL_ERROR "RPCS3 requires at least clang-12.0.")
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0)
|
||||
message(FATAL_ERROR "RPCS3 requires at least clang-19.0.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -42,7 +42,7 @@ option(USE_SYSTEM_CUBEB "Prefer system cubeb instead of the builtin one" OFF)
|
||||
option(USE_SYSTEM_CURL "Prefer system Curl instead of the prebuild one" ON)
|
||||
option(USE_SYSTEM_FAUDIO "Prefer system FAudio instead of the builtin one" OFF)
|
||||
option(USE_SYSTEM_FFMPEG "Prefer system ffmpeg instead of the prebuild one" OFF)
|
||||
option(USE_SYSTEM_FLATBUFFERS "Prefer system flatbuffers instead of the builtin one" OFF)
|
||||
option(USE_SYSTEM_PROTOBUF "Prefer system protobuf instead of the builtin one" OFF)
|
||||
option(USE_SYSTEM_GLSLANG "Prefer system glslang instead of the builtin one" OFF)
|
||||
option(USE_SYSTEM_HIDAPI "Prefer system hidapi instead of the builtin one" OFF)
|
||||
option(USE_SYSTEM_LIBPNG "Prefer system libpng instead of the builtin one" OFF)
|
||||
|
||||
+65
-9
@@ -117,6 +117,7 @@ static fs::error to_error(DWORD e)
|
||||
case ERROR_NEGATIVE_SEEK: return fs::error::inval;
|
||||
case ERROR_DIRECTORY: return fs::error::inval;
|
||||
case ERROR_INVALID_NAME: return fs::error::inval;
|
||||
case ERROR_INVALID_FUNCTION: return fs::error::inval;
|
||||
case ERROR_SHARING_VIOLATION: return fs::error::acces;
|
||||
case ERROR_DIR_NOT_EMPTY: return fs::error::notempty;
|
||||
case ERROR_NOT_READY: return fs::error::noent;
|
||||
@@ -398,12 +399,11 @@ namespace fs
|
||||
class windows_file final : public file_base
|
||||
{
|
||||
HANDLE m_handle;
|
||||
atomic_t<u64> m_pos;
|
||||
atomic_t<u64> m_pos {0};
|
||||
|
||||
public:
|
||||
windows_file(HANDLE handle)
|
||||
: m_handle(handle)
|
||||
, m_pos(0)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -417,10 +417,10 @@ namespace fs
|
||||
|
||||
stat_t get_stat() override
|
||||
{
|
||||
FILE_BASIC_INFO basic_info;
|
||||
FILE_BASIC_INFO basic_info {};
|
||||
ensure(GetFileInformationByHandleEx(m_handle, FileBasicInfo, &basic_info, sizeof(FILE_BASIC_INFO))); // "file::stat"
|
||||
|
||||
stat_t info;
|
||||
stat_t info {};
|
||||
info.is_directory = (basic_info.FileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0;
|
||||
info.is_writable = (basic_info.FileAttributes & FILE_ATTRIBUTE_READONLY) == 0;
|
||||
info.size = this->size();
|
||||
@@ -441,7 +441,7 @@ namespace fs
|
||||
|
||||
bool trunc(u64 length) override
|
||||
{
|
||||
FILE_END_OF_FILE_INFO _eof;
|
||||
FILE_END_OF_FILE_INFO _eof {};
|
||||
_eof.EndOfFile.QuadPart = length;
|
||||
|
||||
if (!SetFileInformationByHandle(m_handle, FileEndOfFileInfo, &_eof, sizeof(_eof)))
|
||||
@@ -563,6 +563,7 @@ namespace fs
|
||||
|
||||
u64 size() override
|
||||
{
|
||||
// NOTE: this can fail if we access a mounted empty drive (e.g. after unmounting an iso).
|
||||
LARGE_INTEGER size;
|
||||
ensure(GetFileSizeEx(m_handle, &size)); // "file::size"
|
||||
|
||||
@@ -579,12 +580,12 @@ namespace fs
|
||||
file_id id{"windows_file"};
|
||||
id.data.resize(sizeof(FILE_ID_INFO));
|
||||
|
||||
FILE_ID_INFO info;
|
||||
FILE_ID_INFO info {};
|
||||
|
||||
if (!GetFileInformationByHandleEx(m_handle, FileIdInfo, &info, sizeof(info)))
|
||||
{
|
||||
// Try GetFileInformationByHandle as a fallback
|
||||
BY_HANDLE_FILE_INFORMATION info2;
|
||||
BY_HANDLE_FILE_INFORMATION info2{};
|
||||
ensure(GetFileInformationByHandle(m_handle, &info2));
|
||||
|
||||
info = {};
|
||||
@@ -625,7 +626,7 @@ namespace fs
|
||||
struct ::stat file_info;
|
||||
ensure(::fstat(m_fd, &file_info) == 0); // "file::stat"
|
||||
|
||||
stat_t info;
|
||||
stat_t info {};
|
||||
info.is_directory = S_ISDIR(file_info.st_mode);
|
||||
info.is_writable = file_info.st_mode & 0200; // HACK: approximation
|
||||
info.size = file_info.st_size;
|
||||
@@ -901,6 +902,22 @@ std::string_view fs::get_parent_dir_view(std::string_view path, u32 parent_level
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string fs::get_path_if_dir(const std::string& path)
|
||||
{
|
||||
if (path.empty() || !fs::is_dir(path))
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
// If delimiters are already present at the end of the string then nothing else to do
|
||||
if (usz sz = path.find_last_of(delim); sz != umax && (sz + 1) == path.size())
|
||||
{
|
||||
return path;
|
||||
}
|
||||
|
||||
return path + '/';
|
||||
}
|
||||
|
||||
bool fs::get_stat(const std::string& path, stat_t& info)
|
||||
{
|
||||
// Ensure consistent information on failure
|
||||
@@ -1640,6 +1657,45 @@ fs::file::file(const std::string& path, bs_t<open_mode> mode)
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if the handle is actually valid.
|
||||
// This can fail on empty mounted drives (e.g. with ERROR_NOT_READY or ERROR_INVALID_FUNCTION).
|
||||
BY_HANDLE_FILE_INFORMATION info{};
|
||||
if (!GetFileInformationByHandle(handle, &info))
|
||||
{
|
||||
const DWORD last_error = GetLastError();
|
||||
CloseHandle(handle);
|
||||
|
||||
if (last_error == ERROR_INVALID_FUNCTION)
|
||||
{
|
||||
g_tls_error = fs::error::isdir;
|
||||
return;
|
||||
}
|
||||
|
||||
g_tls_error = to_error(last_error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
|
||||
{
|
||||
CloseHandle(handle);
|
||||
g_tls_error = fs::error::isdir;
|
||||
return;
|
||||
}
|
||||
|
||||
if (info.dwFileAttributes & FILE_ATTRIBUTE_SYSTEM)
|
||||
{
|
||||
CloseHandle(handle);
|
||||
g_tls_error = fs::error::acces;
|
||||
return;
|
||||
}
|
||||
|
||||
if ((mode & fs::write) && (info.dwFileAttributes & FILE_ATTRIBUTE_READONLY))
|
||||
{
|
||||
CloseHandle(handle);
|
||||
g_tls_error = fs::error::readonly;
|
||||
return;
|
||||
}
|
||||
|
||||
m_file = std::make_unique<windows_file>(handle);
|
||||
#else
|
||||
int flags = O_CLOEXEC; // Ensures all files are closed on execl for auto updater
|
||||
@@ -2579,7 +2635,7 @@ bool fs::pending_file::commit(bool overwrite)
|
||||
while (file_handle != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
// Get file ID (used to check for hardlinks)
|
||||
BY_HANDLE_FILE_INFORMATION file_info;
|
||||
BY_HANDLE_FILE_INFORMATION file_info{};
|
||||
|
||||
if (!GetFileInformationByHandle(file_handle, &file_info) || file_info.nNumberOfLinks == 1)
|
||||
{
|
||||
|
||||
+13
-8
@@ -66,13 +66,13 @@ namespace fs
|
||||
// File attributes (TODO)
|
||||
struct stat_t
|
||||
{
|
||||
bool is_directory;
|
||||
bool is_symlink;
|
||||
bool is_writable;
|
||||
u64 size;
|
||||
s64 atime;
|
||||
s64 mtime;
|
||||
s64 ctime;
|
||||
bool is_directory = false;
|
||||
bool is_symlink = false;
|
||||
bool is_writable = false;
|
||||
u64 size = 0;
|
||||
s64 atime = 0;
|
||||
s64 mtime = 0;
|
||||
s64 ctime = 0;
|
||||
|
||||
using enable_bitcopy = std::true_type;
|
||||
|
||||
@@ -155,7 +155,7 @@ namespace fs
|
||||
// Virtual device
|
||||
struct device_base
|
||||
{
|
||||
const std::string fs_prefix;
|
||||
std::string fs_prefix;
|
||||
|
||||
device_base();
|
||||
virtual ~device_base();
|
||||
@@ -195,6 +195,9 @@ namespace fs
|
||||
return std::string{get_parent_dir_view(path, parent_level)};
|
||||
}
|
||||
|
||||
// Return "path" plus an ending delimiter (if missing) if "path" is an existing directory. Otherwise, an empty string
|
||||
std::string get_path_if_dir(const std::string& path);
|
||||
|
||||
// Get file information
|
||||
bool get_stat(const std::string& path, stat_t& info);
|
||||
|
||||
@@ -254,6 +257,8 @@ namespace fs
|
||||
// Open file with specified mode
|
||||
explicit file(const std::string& path, bs_t<open_mode> mode = ::fs::read);
|
||||
|
||||
file(std::unique_ptr<file_base>&& ptr) : m_file(std::move(ptr)) {}
|
||||
|
||||
static file from_native_handle(native_handle handle);
|
||||
|
||||
// Open memory for read
|
||||
|
||||
@@ -14,6 +14,10 @@
|
||||
#define CAN_OVERCOMMIT
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#include <mutex>
|
||||
#endif
|
||||
|
||||
LOG_CHANNEL(jit_log, "JIT");
|
||||
|
||||
void jit_announce(uptr func, usz size, std::string_view name)
|
||||
|
||||
@@ -688,6 +688,30 @@ jit_compiler::jit_compiler(const std::unordered_map<std::string, u64>& _link, co
|
||||
mem = std::make_unique<MemoryManager1>(std::move(symbols_cement));
|
||||
}
|
||||
|
||||
std::vector<std::string> attributes;
|
||||
|
||||
#if defined(ARCH_ARM64)
|
||||
if (utils::has_sha3())
|
||||
attributes.push_back("+sha3");
|
||||
else
|
||||
attributes.push_back("-sha3");
|
||||
|
||||
if (utils::has_dotprod())
|
||||
attributes.push_back("+dotprod");
|
||||
else
|
||||
attributes.push_back("-dotprod");
|
||||
|
||||
if (utils::has_sve())
|
||||
attributes.push_back("+sve");
|
||||
else
|
||||
attributes.push_back("-sve");
|
||||
|
||||
if (utils::has_sve2())
|
||||
attributes.push_back("+sve2");
|
||||
else
|
||||
attributes.push_back("-sve2");
|
||||
#endif
|
||||
|
||||
{
|
||||
m_engine.reset(llvm::EngineBuilder(std::move(null_mod))
|
||||
.setErrorStr(&result)
|
||||
@@ -699,6 +723,7 @@ jit_compiler::jit_compiler(const std::unordered_map<std::string, u64>& _link, co
|
||||
//.setCodeModel(llvm::CodeModel::Large)
|
||||
#endif
|
||||
.setRelocationModel(llvm::Reloc::Model::PIC_)
|
||||
.setMAttrs(attributes)
|
||||
.setMCPU(m_cpu)
|
||||
.create());
|
||||
}
|
||||
|
||||
+5
-5
@@ -13,13 +13,13 @@ std::string wchar_to_utf8(std::wstring_view src);
|
||||
std::string utf16_to_utf8(std::u16string_view src);
|
||||
std::u16string utf8_to_utf16(std::string_view src);
|
||||
|
||||
// Copy null-terminated string from a std::string or a char array to a char array with truncation
|
||||
template <typename D, typename T>
|
||||
// Copy null-terminated string from a std::basic_string or a char array to a char array with truncation
|
||||
template <typename D, typename T> requires requires (D& d, T& t) { std::declval<decltype(&t[0])&>() = &d[0]; }
|
||||
inline void strcpy_trunc(D&& dst, const T& src)
|
||||
{
|
||||
const usz count = std::size(src) >= std::size(dst) ? std::max<usz>(std::size(dst), 1) - 1 : std::size(src);
|
||||
std::memcpy(std::data(dst), std::data(src), count);
|
||||
std::memset(std::data(dst) + count, 0, std::size(dst) - count);
|
||||
std::copy_n(std::data(src), count, std::data(dst));
|
||||
std::fill_n(std::data(dst) + count, std::size(dst) - count, std::remove_cvref_t<decltype(dst[0])>{});
|
||||
}
|
||||
|
||||
// Convert string to signed integer
|
||||
@@ -188,7 +188,7 @@ namespace fmt
|
||||
result.append(separator);
|
||||
}
|
||||
|
||||
return result.append(source.back());
|
||||
return result.append(*end);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
#include "Emu/RSX/RSXThread.h"
|
||||
#include "Thread.h"
|
||||
#include "Utilities/JIT.h"
|
||||
#include <thread>
|
||||
#include <cfenv>
|
||||
|
||||
#ifdef ARCH_ARM64
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "util/atomic.hpp"
|
||||
#include "util/shared_ptr.hpp"
|
||||
|
||||
#include <thread>
|
||||
#include <string>
|
||||
|
||||
// Hardware core layout
|
||||
|
||||
@@ -329,7 +329,7 @@ bool patch_engine::load(patch_map& patches_map, const std::string& path, std::st
|
||||
is_valid = false;
|
||||
continue;
|
||||
}
|
||||
else if (serial.size() != 9 || !std::all_of(serial.begin(), serial.end(), [](char c) { return std::isalnum(c); }))
|
||||
else if (serial.size() != 9 || !std::all_of(serial.begin(), serial.end(), [](char c) { return std::isalnum(static_cast<unsigned char>(c)); }))
|
||||
{
|
||||
append_log_message(log_messages, fmt::format("Error: Serial '%s' invalid (patch: %s, key: %s, location: %s, file: %s)", serial, description, main_key, get_yaml_node_location(serial_node), path), &patch_log.error);
|
||||
is_valid = false;
|
||||
|
||||
@@ -821,6 +821,14 @@ struct color4_base
|
||||
a *= rhs;
|
||||
}
|
||||
|
||||
void operator += (const color4_base<T>& rhs)
|
||||
{
|
||||
r += rhs.r;
|
||||
g += rhs.g;
|
||||
b += rhs.b;
|
||||
a += rhs.a;
|
||||
}
|
||||
|
||||
constexpr color4_base<T> operator * (const color4_base<T>& rhs) const
|
||||
{
|
||||
return { r * rhs.r, g * rhs.g, b * rhs.b, a * rhs.a };
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<LanguageStandard Condition = "'$(VisualStudioVersion.Substring(0,2))'<'17'">stdcpplatest</LanguageStandard>
|
||||
<LanguageStandard Condition = "'$(VisualStudioVersion.Substring(0,2))'>='17'">stdcpp20</LanguageStandard>
|
||||
<LanguageStandard Condition = "'$(VisualStudioVersion.Substring(0,2))'>='17'">stdcpp23</LanguageStandard>
|
||||
<PreprocessorDefinitions>_SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING=1;_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExceptionHandling>false</ExceptionHandling>
|
||||
<AdditionalOptions>-d2FH4- %(AdditionalOptions)</AdditionalOptions>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<OutDir>$(SolutionDir)build\lib\$(Configuration)-$(Platform)\</OutDir>
|
||||
<LibraryPath>$(SolutionDir)build\lib\$(Configuration)-$(Platform)\;$(UniversalCRT_LibraryPath_x64);$(LibraryPath)</LibraryPath>
|
||||
<IntDir>$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)\</IntDir>
|
||||
<GTestPath>$(SolutionDir)packages\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-static.1.8.1.7\build\native\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-static.targets</GTestPath>
|
||||
<GTestPath>$(SolutionDir)packages\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-static.1.8.1.8\build\native\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-static.targets</GTestPath>
|
||||
<GTestInstalled Condition="Exists('$(GTestPath)')">true</GTestInstalled>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup>
|
||||
@@ -131,6 +131,97 @@
|
||||
LLVMX86Info.lib;
|
||||
LLVMX86TargetMCA.lib;
|
||||
LLVMXRay.lib;
|
||||
absl_log_severity.lib;
|
||||
absl_raw_logging_internal.lib;
|
||||
absl_spinlock_wait.lib;
|
||||
absl_malloc_internal.lib;
|
||||
absl_base.lib;
|
||||
absl_throw_delegate.lib;
|
||||
absl_scoped_set_env.lib;
|
||||
absl_strerror.lib;
|
||||
absl_poison.lib;
|
||||
absl_tracing_internal.lib;
|
||||
absl_hashtablez_sampler.lib;
|
||||
absl_raw_hash_set.lib;
|
||||
absl_crc_cpu_detect.lib;
|
||||
absl_crc_internal.lib;
|
||||
absl_crc32c.lib;
|
||||
absl_crc_cord_state.lib;
|
||||
absl_stacktrace.lib;
|
||||
absl_symbolize.lib;
|
||||
absl_examine_stack.lib;
|
||||
absl_failure_signal_handler.lib;
|
||||
absl_debugging_internal.lib;
|
||||
absl_demangle_internal.lib;
|
||||
absl_decode_rust_punycode.lib;
|
||||
absl_demangle_rust.lib;
|
||||
absl_utf8_for_code_point.lib;
|
||||
absl_leak_check.lib;
|
||||
absl_flags_program_name.lib;
|
||||
absl_flags_config.lib;
|
||||
absl_flags_marshalling.lib;
|
||||
absl_flags_commandlineflag_internal.lib;
|
||||
absl_flags_commandlineflag.lib;
|
||||
absl_flags_private_handle_accessor.lib;
|
||||
absl_flags_reflection.lib;
|
||||
absl_flags_internal.lib;
|
||||
absl_flags_usage_internal.lib;
|
||||
absl_flags_usage.lib;
|
||||
absl_flags_parse.lib;
|
||||
absl_hash.lib;
|
||||
absl_city.lib;
|
||||
absl_low_level_hash.lib;
|
||||
absl_log_internal_check_op.lib;
|
||||
absl_log_internal_conditions.lib;
|
||||
absl_log_internal_format.lib;
|
||||
absl_log_internal_globals.lib;
|
||||
absl_log_internal_proto.lib;
|
||||
absl_log_internal_message.lib;
|
||||
absl_log_internal_log_sink_set.lib;
|
||||
absl_log_internal_nullguard.lib;
|
||||
absl_die_if_null.lib;
|
||||
absl_log_flags.lib;
|
||||
absl_log_globals.lib;
|
||||
absl_log_initialize.lib;
|
||||
absl_log_sink.lib;
|
||||
absl_log_internal_structured_proto.lib;
|
||||
absl_vlog_config_internal.lib;
|
||||
absl_log_internal_fnmatch.lib;
|
||||
absl_int128.lib;
|
||||
absl_exponential_biased.lib;
|
||||
absl_periodic_sampler.lib;
|
||||
absl_random_distributions.lib;
|
||||
absl_random_seed_gen_exception.lib;
|
||||
absl_random_seed_sequences.lib;
|
||||
absl_random_internal_seed_material.lib;
|
||||
absl_random_internal_entropy_pool.lib;
|
||||
absl_random_internal_platform.lib;
|
||||
absl_random_internal_randen.lib;
|
||||
absl_random_internal_randen_slow.lib;
|
||||
absl_random_internal_randen_hwaes.lib;
|
||||
absl_random_internal_randen_hwaes_impl.lib;
|
||||
absl_random_internal_distribution_test_util.lib;
|
||||
absl_status.lib;
|
||||
absl_statusor.lib;
|
||||
absl_string_view.lib;
|
||||
absl_strings.lib;
|
||||
absl_strings_internal.lib;
|
||||
absl_str_format_internal.lib;
|
||||
absl_cord_internal.lib;
|
||||
absl_cordz_functions.lib;
|
||||
absl_cordz_handle.lib;
|
||||
absl_cordz_info.lib;
|
||||
absl_cordz_sample_token.lib;
|
||||
absl_cord.lib;
|
||||
absl_graphcycles_internal.lib;
|
||||
absl_kernel_timeout_internal.lib;
|
||||
absl_synchronization.lib;
|
||||
absl_time.lib;
|
||||
absl_civil_time.lib;
|
||||
absl_time_zone.lib;
|
||||
libutf8_validity.lib;
|
||||
libutf8_range.lib;
|
||||
libprotobuf-lite.lib;
|
||||
</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(SolutionDir)3rdparty\ffmpeg\lib\windows\x86_64</AdditionalLibraryDirectories>
|
||||
<StackReserveSize>8388608</StackReserveSize>
|
||||
|
||||
@@ -9,11 +9,14 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "emucore", "rpcs3\emucore.vc
|
||||
{2C902C67-985C-4BE0-94A3-E0FE2EB929A3} = {2C902C67-985C-4BE0-94A3-E0FE2EB929A3}
|
||||
{3C67A2FF-4710-402A-BE3E-31B0CB0576DF} = {3C67A2FF-4710-402A-BE3E-31B0CB0576DF}
|
||||
{5228F863-E0DD-4DE7-AA7B-5C52B14CD4D0} = {5228F863-E0DD-4DE7-AA7B-5C52B14CD4D0}
|
||||
{7B3B4C5D-6E7F-8A9B-0C1D-2E3F4A5B6C7D} = {7B3B4C5D-6E7F-8A9B-0C1D-2E3F4A5B6C7D}
|
||||
{8846A9AA-5539-4C91-8301-F54260E1A07A} = {8846A9AA-5539-4C91-8301-F54260E1A07A}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm_build", "3rdparty\llvm\llvm_build.vcxproj", "{8BC303AB-25BE-4276-8E57-73F171B2D672}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "protobuf_build", "3rdparty\protobuf\protobuf_build.vcxproj", "{7B3B4C5D-6E7F-8A9B-0C1D-2E3F4A5B6C7D}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GLGSRender", "rpcs3\GLGSRender.vcxproj", "{3384223A-6D97-4799-9862-359F85312892}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "rpcs3.emu", "rpcs3.emu", "{10FBF193-D532-4CCF-B875-4C7091A7F6C2}"
|
||||
@@ -130,6 +133,10 @@ Global
|
||||
{C4A10229-4712-4BD2-B63E-50D93C67A038}.Release|x64.Build.0 = Release|x64
|
||||
{8BC303AB-25BE-4276-8E57-73F171B2D672}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{8BC303AB-25BE-4276-8E57-73F171B2D672}.Release|x64.ActiveCfg = Release|x64
|
||||
{7B3B4C5D-6E7F-8A9B-0C1D-2E3F4A5B6C7D}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{7B3B4C5D-6E7F-8A9B-0C1D-2E3F4A5B6C7D}.Debug|x64.Build.0 = Debug|x64
|
||||
{7B3B4C5D-6E7F-8A9B-0C1D-2E3F4A5B6C7D}.Release|x64.ActiveCfg = Release|x64
|
||||
{7B3B4C5D-6E7F-8A9B-0C1D-2E3F4A5B6C7D}.Release|x64.Build.0 = Release|x64
|
||||
{3384223A-6D97-4799-9862-359F85312892}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{3384223A-6D97-4799-9862-359F85312892}.Debug|x64.Build.0 = Debug|x64
|
||||
{3384223A-6D97-4799-9862-359F85312892}.Release|x64.ActiveCfg = Release|x64
|
||||
@@ -240,6 +247,7 @@ Global
|
||||
{AC40FF01-426E-4838-A317-66354CEFAE88} = {6C3B64A0-8F8A-4DC4-8C0B-D71EBEED7FA8}
|
||||
{C4A10229-4712-4BD2-B63E-50D93C67A038} = {10FBF193-D532-4CCF-B875-4C7091A7F6C2}
|
||||
{8BC303AB-25BE-4276-8E57-73F171B2D672} = {B0AC29FD-7B01-4B5E-9C8D-0A081E4C5668}
|
||||
{7B3B4C5D-6E7F-8A9B-0C1D-2E3F4A5B6C7D} = {6C3B64A0-8F8A-4DC4-8C0B-D71EBEED7FA8}
|
||||
{3384223A-6D97-4799-9862-359F85312892} = {10FBF193-D532-4CCF-B875-4C7091A7F6C2}
|
||||
{78CB2F39-B809-4A06-8329-8C0A19119D3D} = {10FBF193-D532-4CCF-B875-4C7091A7F6C2}
|
||||
{EB33566E-DA7F-4D28-9077-88C0B7C77E35} = {6C3B64A0-8F8A-4DC4-8C0B-D71EBEED7FA8}
|
||||
|
||||
@@ -8,7 +8,7 @@ include(${CMAKE_CURRENT_SOURCE_DIR}/git-version.cmake)
|
||||
include(ConfigureCompiler)
|
||||
include(CheckFunctionExists)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD 23)
|
||||
|
||||
if(UNIX AND NOT APPLE AND NOT ANDROID)
|
||||
add_compile_definitions(DATADIR="${CMAKE_INSTALL_FULL_DATADIR}/rpcs3")
|
||||
@@ -148,8 +148,9 @@ if (NOT ANDROID)
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/bin/GuiConfigs $<TARGET_FILE_DIR:rpcs3>/GuiConfigs
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/bin/test $<TARGET_FILE_DIR:rpcs3>/test
|
||||
COMMAND "${WINDEPLOYQT_EXECUTABLE}" --no-compiler-runtime --no-opengl-sw --no-patchqt
|
||||
--no-translations --no-system-d3d-compiler --no-system-dxc-compiler --no-quick-import
|
||||
--no-system-d3d-compiler --no-system-dxc-compiler --no-quick-import
|
||||
--plugindir "$<IF:$<CXX_COMPILER_ID:MSVC>,$<TARGET_FILE_DIR:rpcs3>/plugins,$<TARGET_FILE_DIR:rpcs3>/share/qt6/plugins>"
|
||||
--translationdir "$<IF:$<CXX_COMPILER_ID:MSVC>,$<TARGET_FILE_DIR:rpcs3>/translations,$<TARGET_FILE_DIR:rpcs3>/share/qt6/translations>"
|
||||
--verbose 0 "$<TARGET_FILE:rpcs3>")
|
||||
endif()
|
||||
|
||||
|
||||
@@ -125,6 +125,7 @@ target_sources(rpcs3_emu PRIVATE
|
||||
../Loader/PSF.cpp
|
||||
../Loader/PUP.cpp
|
||||
../Loader/TAR.cpp
|
||||
../Loader/ISO.cpp
|
||||
../Loader/TROPUSR.cpp
|
||||
../Loader/TRP.cpp
|
||||
)
|
||||
@@ -422,6 +423,7 @@ target_sources(rpcs3_emu PRIVATE
|
||||
Io/TopShotFearmaster.cpp
|
||||
Io/Turntable.cpp
|
||||
Io/usb_device.cpp
|
||||
Io/usb_microphone.cpp
|
||||
Io/usb_vfs.cpp
|
||||
Io/usio.cpp
|
||||
Io/LogitechG27.cpp
|
||||
@@ -430,7 +432,7 @@ target_sources(rpcs3_emu PRIVATE
|
||||
|
||||
# Np
|
||||
target_sources(rpcs3_emu PRIVATE
|
||||
NP/fb_helpers.cpp
|
||||
NP/pb_helpers.cpp
|
||||
NP/np_cache.cpp
|
||||
NP/np_gui_cache.cpp
|
||||
NP/np_contexts.cpp
|
||||
@@ -450,6 +452,7 @@ target_sources(rpcs3_emu PRIVATE
|
||||
NP/upnp_config.cpp
|
||||
NP/upnp_handler.cpp
|
||||
NP/ip_address.cpp
|
||||
NP/generated/np2_structs.pb.cc
|
||||
)
|
||||
|
||||
# Memory
|
||||
@@ -655,7 +658,7 @@ target_link_libraries(rpcs3_emu
|
||||
3rdparty::soundtouch
|
||||
3rdparty::miniupnpc
|
||||
3rdparty::libevdev
|
||||
3rdparty::flatbuffers
|
||||
3rdparty::protobuf
|
||||
3rdparty::pugixml
|
||||
3rdparty::vulkanmemoryallocator
|
||||
Threads::Threads
|
||||
|
||||
@@ -206,11 +206,7 @@ struct cpu_prof
|
||||
// Print only 7 hash characters out of 11 (which covers roughly 48 bits)
|
||||
if (type_id == 2)
|
||||
{
|
||||
fmt::append(results, "\n\t[%s", fmt::base57(be_t<u64>{name}));
|
||||
results.resize(results.size() - 4);
|
||||
|
||||
// Print chunk address from lowest 16 bits
|
||||
fmt::append(results, "...chunk-0x%05x]: %.4f%% (%u)", (name & 0xffff) * 4, _frac * 100., count);
|
||||
fmt::append(results, "\n\t[%s]: %.4f%% (%u)", spu_block_hash{name}, _frac * 100., count);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -201,14 +201,6 @@ void cpu_translator::initialize(llvm::LLVMContext& context, llvm::ExecutionEngin
|
||||
m_use_vnni = true;
|
||||
m_use_gfni = true;
|
||||
}
|
||||
|
||||
// Aarch64 CPUs
|
||||
if (cpu == "cyclone" || cpu.contains("cortex"))
|
||||
{
|
||||
m_use_fma = true;
|
||||
// AVX does not use intrinsics so far
|
||||
m_use_avx = true;
|
||||
}
|
||||
}
|
||||
|
||||
llvm::Value* cpu_translator::bitcast(llvm::Value* val, llvm::Type* type) const
|
||||
|
||||
@@ -3081,13 +3081,22 @@ protected:
|
||||
|
||||
// Allow PSHUFB intrinsic
|
||||
bool m_use_ssse3 = true;
|
||||
#ifdef ARCH_ARM64
|
||||
// all arm CPUS have FMA
|
||||
bool m_use_fma = true;
|
||||
|
||||
// Should be nonsense to set this for ARM,
|
||||
// but this flag is only used in SPU verification
|
||||
// For now, setting this flag will speed up SPU verification
|
||||
// but I will remove this later with explicit parralelism - Whatcookie
|
||||
bool m_use_avx = true;
|
||||
#else
|
||||
// Allow FMA
|
||||
bool m_use_fma = false;
|
||||
|
||||
// Allow AVX
|
||||
bool m_use_avx = false;
|
||||
|
||||
#endif
|
||||
// Allow skylake-x tier AVX-512
|
||||
bool m_use_avx512 = false;
|
||||
|
||||
|
||||
@@ -2228,6 +2228,12 @@ error_code cellFontStatic()
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
error_code cellFontsetUSleep()
|
||||
{
|
||||
cellFont.todo("cellFontsetUSleep()");
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
DECLARE(ppu_module_manager::cellFont)("cellFont", []()
|
||||
{
|
||||
|
||||
@@ -2315,4 +2321,5 @@ DECLARE(ppu_module_manager::cellFont)("cellFont", []()
|
||||
REG_FUNC(cellFont, cellFontGraphicsGetLineRGBA);
|
||||
REG_FUNC(cellFont, cellFontControl);
|
||||
REG_FUNC(cellFont, cellFontStatic);
|
||||
REG_FUNC(cellFont, cellFontsetUSleep);
|
||||
});
|
||||
|
||||
@@ -1034,6 +1034,18 @@ s32 cellFsUnregisterL10nCallbacks()
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellFsGetDirent()
|
||||
{
|
||||
cellFs.todo("cellFsGetDirent()");
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 cellFsGetDirentCount()
|
||||
{
|
||||
cellFs.todo("cellFsGetDirentCount()");
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
DECLARE(ppu_module_manager::cellFs)("sys_fs", []()
|
||||
{
|
||||
REG_FUNC(sys_fs, cellFsAccess);
|
||||
@@ -1065,6 +1077,8 @@ DECLARE(ppu_module_manager::cellFs)("sys_fs", []()
|
||||
REG_FUNC(sys_fs, cellFsGetBlockSize);
|
||||
REG_FUNC(sys_fs, cellFsGetBlockSize2);
|
||||
REG_FUNC(sys_fs, cellFsGetDirectoryEntries);
|
||||
REG_FUNC(sys_fs, cellFsGetDirent);
|
||||
REG_FUNC(sys_fs, cellFsGetDirentCount);
|
||||
REG_FUNC(sys_fs, cellFsGetFreeSize);
|
||||
REG_FUNC(sys_fs, cellFsGetPath);
|
||||
REG_FUNC(sys_fs, cellFsLink);
|
||||
|
||||
@@ -492,8 +492,8 @@ error_code cellHddGameCheck(ppu_thread& ppu, u32 version, vm::cptr<char> dirName
|
||||
strcpy_trunc(get->getParam.titleLang[i], psf::get_string(psf, fmt::format("TITLE_%02d", i)));
|
||||
}
|
||||
|
||||
cellGame.warning("cellHddGameCheck(): Data exists:\nATTRIBUTE: 0x%x, RESOLUTION: 0x%x, RESOLUTION: 0x%x, SOUND_FORMAT: 0x%x, dataVersion: %s"
|
||||
, get->getParam.attribute, get->getParam.resolution, get->getParam.soundFormat, get->getParam.soundFormat, std::span<const u8>(reinterpret_cast<const u8*>(get->getParam.dataVersion), 6));
|
||||
cellGame.warning("cellHddGameCheck(): Data exists:\nATTRIBUTE: 0x%x, RESOLUTION: 0x%x, SOUND_FORMAT: 0x%x, dataVersion: %s"
|
||||
, get->getParam.attribute, get->getParam.resolution, get->getParam.soundFormat, std::span<const u8>(reinterpret_cast<const u8*>(get->getParam.dataVersion), 6));
|
||||
}
|
||||
|
||||
// TODO ?
|
||||
@@ -580,7 +580,7 @@ error_code cellHddGameCheck(ppu_thread& ppu, u32 version, vm::cptr<char> dirName
|
||||
break;
|
||||
|
||||
default:
|
||||
cellGame.error("cellHddGameCheck(): callback returned unknown error (code=0x%x). Error message: %s", result->invalidMsg);
|
||||
cellGame.error("cellHddGameCheck(): callback returned unknown error (code=0x%x). Error message: %s", result->result, result->invalidMsg);
|
||||
error_msg = get_localized_string(localized_string_id::CELL_HDD_GAME_CHECK_INVALID, "%s", result->invalidMsg);
|
||||
break;
|
||||
}
|
||||
@@ -1199,7 +1199,7 @@ error_code cellGameDataCheckCreate2(ppu_thread& ppu, u32 version, vm::cptr<char>
|
||||
break;
|
||||
|
||||
default:
|
||||
cellGame.error("cellGameDataCheckCreate2(): callback returned unknown error (code=0x%x). Error message: %s", cbResult->invalidMsg);
|
||||
cellGame.error("cellGameDataCheckCreate2(): callback returned unknown error (code=0x%x). Error message: %s", cbResult->result, cbResult->invalidMsg);
|
||||
error_msg = get_localized_string(localized_string_id::CELL_GAMEDATA_CHECK_INVALID, "%s", cbResult->invalidMsg);
|
||||
break;
|
||||
}
|
||||
@@ -1747,7 +1747,7 @@ error_code cellGameThemeInstall(vm::cptr<char> usrdirPath, vm::cptr<char> fileNa
|
||||
{
|
||||
u32 magic{};
|
||||
|
||||
if (src_path.ends_with(".p3t") || !theme.read(magic) || magic != "P3TF"_u32)
|
||||
if (!fmt::to_lower(src_path).ends_with(".p3t") || !theme.read(magic) || magic != "P3TF"_u32)
|
||||
{
|
||||
return CELL_GAME_ERROR_INVALID_THEME_FILE;
|
||||
}
|
||||
@@ -1819,7 +1819,7 @@ error_code cellGameThemeInstallFromBuffer(ppu_thread& ppu, u32 fileSize, u32 buf
|
||||
const u32 read_size = std::min(bufSize, fileSize - file_offset);
|
||||
cellGame.notice("cellGameThemeInstallFromBuffer: writing %d bytes at pos %d", read_size, file_offset);
|
||||
|
||||
if (theme.write(reinterpret_cast<u8*>(buf.get_ptr()) + file_offset, read_size) != read_size)
|
||||
if (theme.write(reinterpret_cast<u8*>(buf.get_ptr()), read_size) != read_size)
|
||||
{
|
||||
cellGame.error("cellGameThemeInstallFromBuffer: failed to write to destination file '%s' (error=%s)", dst_path, fs::g_tls_error);
|
||||
|
||||
|
||||
@@ -98,16 +98,26 @@ u32 gcmGetLocalMemorySize(u32 sdk_version)
|
||||
|
||||
error_code gcmMapEaIoAddress(ppu_thread& ppu, u32 ea, u32 io, u32 size, bool is_strict);
|
||||
|
||||
u32 gcmIoOffsetToAddress(u32 ioOffset)
|
||||
u32 gcmIoOffsetToAddress(u32 io_offs)
|
||||
{
|
||||
const u32 upper12Bits = g_fxo->get<gcm_config>().offsetTable.eaAddress[ioOffset >> 20];
|
||||
u32 upper_12bits = 0;
|
||||
|
||||
if (upper12Bits > 0xBFF)
|
||||
if (io_offs < 0x20000000)
|
||||
{
|
||||
return 0;
|
||||
upper_12bits = rsx::get_current_renderer()->iomap_table.ea[io_offs >> 20];
|
||||
|
||||
if (upper_12bits >= rsx::constants::local_mem_base)
|
||||
{
|
||||
upper_12bits = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return (upper12Bits << 20) | (ioOffset & 0xFFFFF);
|
||||
if (!upper_12bits)
|
||||
{
|
||||
cellGcmSys.error("Failed to convert io offset: 0x%x", io_offs);
|
||||
}
|
||||
|
||||
return upper_12bits | (io_offs & 0xFFFFF);
|
||||
}
|
||||
|
||||
void InitOffsetTable()
|
||||
@@ -132,15 +142,15 @@ u32 cellGcmGetLabelAddress(u8 index)
|
||||
return rsx::get_current_renderer()->label_addr + 0x10 * index;
|
||||
}
|
||||
|
||||
vm::ptr<CellGcmReportData> cellGcmGetReportDataAddressLocation(u32 index, u32 location)
|
||||
vm::ptr<CellGcmReportData> cellGcmGetReportDataAddressLocation(ppu_thread& ppu, u32 index, u32 location)
|
||||
{
|
||||
cellGcmSys.warning("cellGcmGetReportDataAddressLocation(index=%d, location=%d)", index, location);
|
||||
cellGcmSys.trace("cellGcmGetReportDataAddressLocation(index=%d, location=%d)", index, location);
|
||||
|
||||
if (location == CELL_GCM_LOCATION_MAIN)
|
||||
{
|
||||
if (index >= 1024 * 1024)
|
||||
{
|
||||
cellGcmSys.error("cellGcmGetReportDataAddressLocation: Wrong main index (%d)", index);
|
||||
cellGcmSys.error("%s: Wrong main index (%d)", ppu.current_function, index);
|
||||
}
|
||||
|
||||
return vm::cast(gcmIoOffsetToAddress(0x0e000000 + index * 0x10));
|
||||
@@ -150,7 +160,7 @@ vm::ptr<CellGcmReportData> cellGcmGetReportDataAddressLocation(u32 index, u32 lo
|
||||
|
||||
if (index >= 2048)
|
||||
{
|
||||
cellGcmSys.error("cellGcmGetReportDataAddressLocation: Wrong local index (%d)", index);
|
||||
cellGcmSys.error("%s: Wrong local index (%d)", ppu.current_function, index);
|
||||
}
|
||||
|
||||
return vm::cast(rsx::get_current_renderer()->label_addr + ::offset32(&RsxReports::report) + index * 0x10);
|
||||
@@ -225,20 +235,22 @@ u32 cellGcmGetReportDataAddress(u32 index)
|
||||
return rsx::get_current_renderer()->label_addr + ::offset32(&RsxReports::report) + index * 0x10;
|
||||
}
|
||||
|
||||
u32 cellGcmGetReportDataLocation(u32 index, u32 location)
|
||||
u32 cellGcmGetReportDataLocation(ppu_thread& ppu, u32 index, u32 location)
|
||||
{
|
||||
cellGcmSys.warning("cellGcmGetReportDataLocation(index=%d, location=%d)", index, location);
|
||||
|
||||
vm::ptr<CellGcmReportData> report = cellGcmGetReportDataAddressLocation(index, location);
|
||||
vm::ptr<CellGcmReportData> report = cellGcmGetReportDataAddressLocation(ppu, index, location);
|
||||
return report->value;
|
||||
}
|
||||
|
||||
u64 cellGcmGetTimeStampLocation(u32 index, u32 location)
|
||||
u64 cellGcmGetTimeStampLocation(ppu_thread& ppu, u32 index, u32 location)
|
||||
{
|
||||
cellGcmSys.warning("cellGcmGetTimeStampLocation(index=%d, location=%d)", index, location);
|
||||
cellGcmSys.trace("cellGcmGetTimeStampLocation(index=%d, location=%d)", index, location);
|
||||
|
||||
// NOTE: No error checkings
|
||||
return cellGcmGetReportDataAddressLocation(index, location)->timer;
|
||||
vm::ptr<CellGcmReportData> report = cellGcmGetReportDataAddressLocation(ppu, index, location);
|
||||
|
||||
// Timestamp reports don't need host GPU access and are much faster to emulate
|
||||
return vm::get_super_ptr<CellGcmReportData>(report.addr())->timer;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
@@ -1508,8 +1520,8 @@ DECLARE(ppu_module_manager::cellGcmSys)("cellGcmSys", []()
|
||||
REG_FUNC(cellGcmSys, cellGcmGetReportDataAddress);
|
||||
REG_FUNC(cellGcmSys, cellGcmGetReportDataAddressLocation);
|
||||
REG_FUNC(cellGcmSys, cellGcmGetReportDataLocation);
|
||||
REG_FUNC(cellGcmSys, cellGcmGetTimeStamp).flag(MFF_FORCED_HLE); // HLE-ing this allows for optimizations around reports
|
||||
REG_FUNC(cellGcmSys, cellGcmGetTimeStampLocation);
|
||||
REG_FUNC(cellGcmSys, cellGcmGetTimeStamp).flag(MFF_FORCED_HLE); // HLE-ing this allows for optimizations around reports
|
||||
REG_FUNC(cellGcmSys, cellGcmGetTimeStampLocation).flag(MFF_FORCED_HLE); // Ditto
|
||||
|
||||
// Command Buffer Control
|
||||
REG_FUNC(cellGcmSys, cellGcmGetControlRegister);
|
||||
|
||||
@@ -1501,8 +1501,15 @@ void gem_config_data::operator()()
|
||||
vc = vc_attribute;
|
||||
}
|
||||
|
||||
if (g_cfg.io.camera != camera_handler::qt)
|
||||
switch (g_cfg.io.camera)
|
||||
{
|
||||
#ifdef HAVE_SDL3
|
||||
case camera_handler::sdl:
|
||||
#endif
|
||||
case camera_handler::qt:
|
||||
break;
|
||||
case camera_handler::fake:
|
||||
case camera_handler::null:
|
||||
video_conversion_in_progress = false;
|
||||
done();
|
||||
continue;
|
||||
|
||||
@@ -634,7 +634,7 @@ u32 microphone_device::capture_audio()
|
||||
if (ALCenum err = alcGetError(micdevice.device); err != ALC_NO_ERROR)
|
||||
{
|
||||
cellMic.error("Error getting number of captured samples of device '%s' (error=%s)", micdevice.name, fmt::alc_error{micdevice.device, err});
|
||||
return CELL_MICIN_ERROR_FATAL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
num_samples = std::min<u32>(num_samples, samples_in);
|
||||
|
||||
@@ -238,7 +238,7 @@ public:
|
||||
if (over_size > Size)
|
||||
{
|
||||
m_tail += (over_size - Size);
|
||||
if (m_tail > Size)
|
||||
if (m_tail >= Size)
|
||||
m_tail -= Size;
|
||||
|
||||
m_used = Size;
|
||||
|
||||
@@ -876,39 +876,42 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v
|
||||
|
||||
// Sort the entries
|
||||
{
|
||||
const u32 order = setList->sortOrder;
|
||||
const u32 type = setList->sortType;
|
||||
|
||||
std::sort(save_entries.begin(), save_entries.end(), [order, type](const SaveDataEntry& entry1, const SaveDataEntry& entry2) -> bool
|
||||
auto comp = [type](const SaveDataEntry& entry1, const SaveDataEntry& entry2) -> bool
|
||||
{
|
||||
const bool mtime_lower = entry1.mtime < entry2.mtime;
|
||||
const bool mtime_equal = entry1.mtime == entry2.mtime;
|
||||
const bool subtitle_lower = entry1.subtitle < entry2.subtitle;
|
||||
const bool subtitle_equal = entry1.subtitle == entry2.subtitle;
|
||||
const bool revert_order = order == CELL_SAVEDATA_SORTORDER_DESCENT;
|
||||
|
||||
if (type == CELL_SAVEDATA_SORTTYPE_MODIFIEDTIME)
|
||||
{
|
||||
if (mtime_equal)
|
||||
{
|
||||
return subtitle_lower != revert_order;
|
||||
return subtitle_lower;
|
||||
}
|
||||
|
||||
return mtime_lower != revert_order;
|
||||
return mtime_lower;
|
||||
}
|
||||
else if (type == CELL_SAVEDATA_SORTTYPE_SUBTITLE)
|
||||
{
|
||||
if (subtitle_equal)
|
||||
{
|
||||
return mtime_lower != revert_order;
|
||||
return mtime_lower;
|
||||
}
|
||||
|
||||
return subtitle_lower != revert_order;
|
||||
return subtitle_lower;
|
||||
}
|
||||
|
||||
ensure(false);
|
||||
return true;
|
||||
});
|
||||
};
|
||||
|
||||
if (setList->sortOrder == CELL_SAVEDATA_SORTORDER_ASCENT)
|
||||
std::sort(save_entries.begin(), save_entries.end(), comp);
|
||||
else
|
||||
std::sort(save_entries.rbegin(), save_entries.rend(), comp);
|
||||
}
|
||||
|
||||
// Fill the listGet->dirList array
|
||||
@@ -2514,6 +2517,18 @@ error_code cellSaveDataUserFixedDelete(ppu_thread& ppu, u32 userId, PSetList set
|
||||
return savedata_op(ppu, SAVEDATA_OP_FIXED_DELETE, 0, vm::null, 1, setList, setBuf, vm::null, funcFixed, vm::null, vm::null, container, 6, userdata, userId, funcDone);
|
||||
}
|
||||
|
||||
error_code cellSaveDataGetEnableOverlay()
|
||||
{
|
||||
cellSaveData.todo("cellSaveDataGetEnableOverlay()");
|
||||
|
||||
// auto& manager = g_fxo->get<savedata_manager>();
|
||||
// manager.enable_overlay;
|
||||
|
||||
// TODO
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
void cellSaveDataEnableOverlay(s32 enable)
|
||||
{
|
||||
cellSaveData.notice("cellSaveDataEnableOverlay(enable=%d)", enable);
|
||||
@@ -2521,7 +2536,6 @@ void cellSaveDataEnableOverlay(s32 enable)
|
||||
manager.enable_overlay = enable != 0;
|
||||
}
|
||||
|
||||
|
||||
// Functions (Extensions)
|
||||
error_code cellSaveDataListDelete(ppu_thread& ppu, PSetList setList, PSetBuf setBuf, PFuncList funcList, PFuncDone funcDone, u32 container, vm::ptr<void> userdata)
|
||||
{
|
||||
@@ -2678,6 +2692,7 @@ void cellSysutil_SaveData_init()
|
||||
REG_VAR(cellSysutil, g_savedata_context).flag(MFF_HIDDEN);
|
||||
|
||||
// libsysutil functions:
|
||||
REG_FUNC(cellSysutil, cellSaveDataGetEnableOverlay);
|
||||
REG_FUNC(cellSysutil, cellSaveDataEnableOverlay);
|
||||
|
||||
REG_FUNC(cellSysutil, cellSaveDataDelete2);
|
||||
|
||||
@@ -1438,6 +1438,13 @@ s32 cellSpursInitializeWithAttribute2(ppu_thread& ppu, vm::ptr<CellSpurs> spurs,
|
||||
attr->swlIsPreem);
|
||||
}
|
||||
|
||||
// Initialise SPURS
|
||||
s32 cellSpursInitializeForSpuSharing()
|
||||
{
|
||||
cellSpurs.todo("cellSpursInitializeForSpuSharing()");
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
/// Initialise SPURS attribute
|
||||
s32 _cellSpursAttributeInitialize(vm::ptr<CellSpursAttribute> attr, u32 revision, u32 sdkVersion, u32 nSpus, s32 spuPriority, s32 ppuPriority, b8 exitIfNoWork)
|
||||
{
|
||||
@@ -5390,6 +5397,7 @@ DECLARE(ppu_module_manager::cellSpurs)("cellSpurs", [](ppu_static_module* _this)
|
||||
REG_FUNC(cellSpurs, cellSpursInitialize);
|
||||
REG_FUNC(cellSpurs, cellSpursInitializeWithAttribute);
|
||||
REG_FUNC(cellSpurs, cellSpursInitializeWithAttribute2);
|
||||
REG_FUNC(cellSpurs, cellSpursInitializeForSpuSharing);
|
||||
REG_FUNC(cellSpurs, cellSpursFinalize);
|
||||
REG_FUNC(cellSpurs, _cellSpursAttributeInitialize);
|
||||
REG_FUNC(cellSpurs, cellSpursAttributeSetMemoryContainerForSpuThread);
|
||||
|
||||
@@ -406,6 +406,30 @@ error_code cellSysmoduleIsLoadedEx()
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
error_code cellSysmoduleLoadModuleFile()
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellSysmodule);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
error_code cellSysmoduleUnloadModuleFile()
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellSysmodule);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
error_code cellSysmoduleSetDebugmode()
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellSysmodule);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
error_code cellSysmoduleSetInternalmode()
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellSysmodule);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
DECLARE(ppu_module_manager::cellSysmodule)("cellSysmodule", []()
|
||||
{
|
||||
REG_FUNC(cellSysmodule, cellSysmoduleInitialize);
|
||||
@@ -421,4 +445,8 @@ DECLARE(ppu_module_manager::cellSysmodule)("cellSysmodule", []()
|
||||
REG_FUNC(cellSysmodule, cellSysmoduleUnloadModuleEx);
|
||||
REG_FUNC(cellSysmodule, cellSysmoduleLoadModuleEx);
|
||||
REG_FUNC(cellSysmodule, cellSysmoduleIsLoadedEx);
|
||||
REG_FUNC(cellSysmodule, cellSysmoduleLoadModuleFile);
|
||||
REG_FUNC(cellSysmodule, cellSysmoduleUnloadModuleFile);
|
||||
REG_FUNC(cellSysmodule, cellSysmoduleSetDebugmode);
|
||||
REG_FUNC(cellSysmodule, cellSysmoduleSetInternalmode);
|
||||
});
|
||||
|
||||
@@ -211,6 +211,7 @@ struct vdec_context final
|
||||
lf_queue<vdec_cmd> in_cmd;
|
||||
|
||||
AVRational log_time_base{}; // Used to reduce log spam
|
||||
AVRational log_framerate{}; // Used to reduce log spam
|
||||
|
||||
vdec_context(s32 type, u32 /*profile*/, u32 addr, u32 size, vm::ptr<CellVdecCbMsg> func, u32 arg)
|
||||
: type(type)
|
||||
@@ -231,6 +232,7 @@ struct vdec_context final
|
||||
codec = avcodec_find_decoder(AV_CODEC_ID_H264);
|
||||
break;
|
||||
}
|
||||
case CELL_VDEC_CODEC_TYPE_MPEG4:
|
||||
case CELL_VDEC_CODEC_TYPE_DIVX:
|
||||
{
|
||||
codec = avcodec_find_decoder(AV_CODEC_ID_MPEG4);
|
||||
@@ -292,6 +294,19 @@ struct vdec_context final
|
||||
sws_freeContext(sws);
|
||||
}
|
||||
|
||||
static u32 freq_to_framerate_code(f64 freq)
|
||||
{
|
||||
if (std::abs(freq - 23.976) < 0.002) return CELL_VDEC_FRC_24000DIV1001;
|
||||
if (std::abs(freq - 24.000) < 0.001) return CELL_VDEC_FRC_24;
|
||||
if (std::abs(freq - 25.000) < 0.001) return CELL_VDEC_FRC_25;
|
||||
if (std::abs(freq - 29.970) < 0.002) return CELL_VDEC_FRC_30000DIV1001;
|
||||
if (std::abs(freq - 30.000) < 0.001) return CELL_VDEC_FRC_30;
|
||||
if (std::abs(freq - 50.000) < 0.001) return CELL_VDEC_FRC_50;
|
||||
if (std::abs(freq - 59.940) < 0.002) return CELL_VDEC_FRC_60000DIV1001;
|
||||
if (std::abs(freq - 60.000) < 0.001) return CELL_VDEC_FRC_60;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void exec(ppu_thread& ppu, u32 vid)
|
||||
{
|
||||
perf_meter<"VDEC"_u32> perf0;
|
||||
@@ -341,6 +356,7 @@ struct vdec_context final
|
||||
|
||||
out_queue.clear(); // Flush image queue
|
||||
log_time_base = {};
|
||||
log_framerate = {};
|
||||
|
||||
frc_set = 0; // TODO: ???
|
||||
next_pts = 0;
|
||||
@@ -471,10 +487,10 @@ struct vdec_context final
|
||||
frame.userdata = au_usrd;
|
||||
frame.attr = attr;
|
||||
|
||||
u64 amend = 0;
|
||||
|
||||
if (frc_set)
|
||||
{
|
||||
u64 amend = 0;
|
||||
|
||||
switch (frc_set)
|
||||
{
|
||||
case CELL_VDEC_FRC_24000DIV1001: amend = 1001 * 90000 / 24000; break;
|
||||
@@ -491,62 +507,45 @@ struct vdec_context final
|
||||
}
|
||||
}
|
||||
|
||||
next_pts += amend;
|
||||
next_dts += amend;
|
||||
frame.frc = frc_set;
|
||||
}
|
||||
else if (ctx->time_base.num == 0)
|
||||
else if (ctx->time_base.den && ctx->time_base.num)
|
||||
{
|
||||
if (log_time_base.den != ctx->time_base.den || log_time_base.num != ctx->time_base.num)
|
||||
const auto freq = 1. * ctx->time_base.den / ctx->time_base.num / ticks_per_frame;
|
||||
|
||||
frame.frc = freq_to_framerate_code(freq);
|
||||
if (frame.frc)
|
||||
{
|
||||
cellVdec.error("time_base.num is 0 (handle=0x%x, seq_id=%d, cmd_id=%d, %d/%d, tpf=%d framerate=%d/%d)", handle, cmd->seq_id, cmd->id, ctx->time_base.num, ctx->time_base.den, ticks_per_frame, ctx->framerate.num, ctx->framerate.den);
|
||||
amend = u64{90000} * ctx->time_base.num * ticks_per_frame / ctx->time_base.den;
|
||||
}
|
||||
}
|
||||
else if (ctx->framerate.den && ctx->framerate.num)
|
||||
{
|
||||
const auto freq = ctx->framerate.num / static_cast<f64>(ctx->framerate.den);
|
||||
|
||||
frame.frc = freq_to_framerate_code(freq);
|
||||
if (frame.frc)
|
||||
{
|
||||
amend = u64{90000} * ctx->framerate.den / ctx->framerate.num;
|
||||
}
|
||||
}
|
||||
|
||||
if (amend == 0 || frame.frc == 0)
|
||||
{
|
||||
if (log_time_base.den != ctx->time_base.den || log_time_base.num != ctx->time_base.num || log_framerate.den != ctx->framerate.den || log_framerate.num != ctx->framerate.num)
|
||||
{
|
||||
cellVdec.error("Invalid frequency (handle=0x%x, seq_id=%d, cmd_id=%d, timebase=%d/%d, tpf=%d framerate=%d/%d)", handle, cmd->seq_id, cmd->id, ctx->time_base.num, ctx->time_base.den, ticks_per_frame, ctx->framerate.num, ctx->framerate.den);
|
||||
log_time_base = ctx->time_base;
|
||||
log_framerate = ctx->framerate;
|
||||
}
|
||||
|
||||
// Hack
|
||||
const u64 amend = u64{90000} / 30;
|
||||
amend = u64{90000} / 30;
|
||||
frame.frc = CELL_VDEC_FRC_30;
|
||||
next_pts += amend;
|
||||
next_dts += amend;
|
||||
}
|
||||
else
|
||||
{
|
||||
u64 amend = u64{90000} * ctx->time_base.num * ticks_per_frame / ctx->time_base.den;
|
||||
const auto freq = 1. * ctx->time_base.den / ctx->time_base.num / ticks_per_frame;
|
||||
|
||||
if (std::abs(freq - 23.976) < 0.002)
|
||||
frame.frc = CELL_VDEC_FRC_24000DIV1001;
|
||||
else if (std::abs(freq - 24.000) < 0.001)
|
||||
frame.frc = CELL_VDEC_FRC_24;
|
||||
else if (std::abs(freq - 25.000) < 0.001)
|
||||
frame.frc = CELL_VDEC_FRC_25;
|
||||
else if (std::abs(freq - 29.970) < 0.002)
|
||||
frame.frc = CELL_VDEC_FRC_30000DIV1001;
|
||||
else if (std::abs(freq - 30.000) < 0.001)
|
||||
frame.frc = CELL_VDEC_FRC_30;
|
||||
else if (std::abs(freq - 50.000) < 0.001)
|
||||
frame.frc = CELL_VDEC_FRC_50;
|
||||
else if (std::abs(freq - 59.940) < 0.002)
|
||||
frame.frc = CELL_VDEC_FRC_60000DIV1001;
|
||||
else if (std::abs(freq - 60.000) < 0.001)
|
||||
frame.frc = CELL_VDEC_FRC_60;
|
||||
else
|
||||
{
|
||||
if (log_time_base.den != ctx->time_base.den || log_time_base.num != ctx->time_base.num)
|
||||
{
|
||||
// 1/1000 usually means that the time stamps are written in 1ms units and that the frame rate may vary.
|
||||
cellVdec.error("Unsupported time_base (handle=0x%x, seq_id=%d, cmd_id=%d, %d/%d, tpf=%d framerate=%d/%d)", handle, cmd->seq_id, cmd->id, ctx->time_base.num, ctx->time_base.den, ticks_per_frame, ctx->framerate.num, ctx->framerate.den);
|
||||
log_time_base = ctx->time_base;
|
||||
}
|
||||
|
||||
// Hack
|
||||
amend = u64{90000} / 30;
|
||||
frame.frc = CELL_VDEC_FRC_30;
|
||||
}
|
||||
|
||||
next_pts += amend;
|
||||
next_dts += amend;
|
||||
}
|
||||
next_pts += amend;
|
||||
next_dts += amend;
|
||||
|
||||
cellVdec.trace("Got picture (handle=0x%x, seq_id=%d, cmd_id=%d, pts=0x%llx[0x%llx], dts=0x%llx[0x%llx])", handle, cmd->seq_id, cmd->id, frame.pts, frame->pts, frame.dts, frame->pkt_dts);
|
||||
|
||||
@@ -680,7 +679,15 @@ static error_code vdecQueryAttr(s32 type, u32 profile, u32 spec_addr /* may be 0
|
||||
{
|
||||
cellVdec.warning("cellVdecQueryAttr: AVC (profile=%d)", profile);
|
||||
|
||||
//const vm::ptr<CellVdecAvcSpecificInfo> sinfo = vm::cast(spec_addr);
|
||||
const vm::ptr<CellVdecAvcSpecificInfo> sinfo = vm::cast(spec_addr);
|
||||
|
||||
if (sinfo)
|
||||
{
|
||||
if (sinfo->thisSize != sizeof(CellVdecAvcSpecificInfo))
|
||||
{
|
||||
return { CELL_VDEC_ERROR_ARG, "Invalid AVC specific info size %d", sinfo->thisSize };
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: sinfo
|
||||
|
||||
@@ -699,7 +706,7 @@ static error_code vdecQueryAttr(s32 type, u32 profile, u32 spec_addr /* may be 0
|
||||
case CELL_VDEC_AVC_LEVEL_4P0: memSize = new_sdk ? 0x33A5FFD : 0x36A527D; break;
|
||||
case CELL_VDEC_AVC_LEVEL_4P1: memSize = new_sdk ? 0x33A5FFD : 0x36A527D; break;
|
||||
case CELL_VDEC_AVC_LEVEL_4P2: memSize = new_sdk ? 0x33A5FFD : 0x36A527D; break;
|
||||
default: return CELL_VDEC_ERROR_ARG;
|
||||
default: return { CELL_VDEC_ERROR_ARG, "Invalid AVC profile level %d", profile };
|
||||
}
|
||||
|
||||
decoderVerLower = 0x11300;
|
||||
@@ -715,12 +722,10 @@ static error_code vdecQueryAttr(s32 type, u32 profile, u32 spec_addr /* may be 0
|
||||
{
|
||||
if (sinfo->thisSize != sizeof(CellVdecMpeg2SpecificInfo))
|
||||
{
|
||||
return CELL_VDEC_ERROR_ARG;
|
||||
return { CELL_VDEC_ERROR_ARG, "Invalid MPEG2 specific info size %d", sinfo->thisSize };
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: sinfo
|
||||
|
||||
const u32 maxDecH = sinfo ? +sinfo->maxDecodedFrameHeight : 0;
|
||||
const u32 maxDecW = sinfo ? +sinfo->maxDecodedFrameWidth : 0;
|
||||
|
||||
@@ -730,7 +735,7 @@ static error_code vdecQueryAttr(s32 type, u32 profile, u32 spec_addr /* may be 0
|
||||
{
|
||||
if (maxDecW > 352 || maxDecH > 288)
|
||||
{
|
||||
return CELL_VDEC_ERROR_ARG;
|
||||
return { CELL_VDEC_ERROR_ARG, "Invalid max decoded frame size %dx%d for profile %d", maxDecH, maxDecW, profile };
|
||||
}
|
||||
|
||||
memSize = new_sdk ? 0x11290B : 0x2A610B;
|
||||
@@ -740,7 +745,7 @@ static error_code vdecQueryAttr(s32 type, u32 profile, u32 spec_addr /* may be 0
|
||||
{
|
||||
if (maxDecW > 720 || maxDecH > 576)
|
||||
{
|
||||
return CELL_VDEC_ERROR_ARG;
|
||||
return { CELL_VDEC_ERROR_ARG, "Invalid max decoded frame size %dx%d for profile %d", maxDecH, maxDecW, profile };
|
||||
}
|
||||
|
||||
memSize = new_sdk ? 0x2DFB8B : 0x47110B;
|
||||
@@ -750,7 +755,7 @@ static error_code vdecQueryAttr(s32 type, u32 profile, u32 spec_addr /* may be 0
|
||||
{
|
||||
if (maxDecW > 1440 || maxDecH > 1152)
|
||||
{
|
||||
return CELL_VDEC_ERROR_ARG;
|
||||
return { CELL_VDEC_ERROR_ARG, "Invalid max decoded frame size %dx%d for profile %d", maxDecH, maxDecW, profile };
|
||||
}
|
||||
|
||||
memSize = new_sdk ? 0xA0270B : 0xB8F90B;
|
||||
@@ -760,18 +765,94 @@ static error_code vdecQueryAttr(s32 type, u32 profile, u32 spec_addr /* may be 0
|
||||
{
|
||||
if (maxDecW > 1920 || maxDecH > 1152)
|
||||
{
|
||||
return CELL_VDEC_ERROR_ARG;
|
||||
return { CELL_VDEC_ERROR_ARG, "Invalid max decoded frame size %dx%d for profile %d", maxDecH, maxDecW, profile };
|
||||
}
|
||||
|
||||
memSize = new_sdk ? 0xD2F40B : 0xEB990B;
|
||||
break;
|
||||
}
|
||||
default: return CELL_VDEC_ERROR_ARG;
|
||||
default: return { CELL_VDEC_ERROR_ARG, "Invalid MPEG2 profile %d", profile };
|
||||
}
|
||||
|
||||
decoderVerLower = 0x1030000;
|
||||
break;
|
||||
}
|
||||
case CELL_VDEC_CODEC_TYPE_MPEG4:
|
||||
{
|
||||
cellVdec.warning("cellVdecQueryAttr: MPEG4 (profile=%d)", profile);
|
||||
|
||||
const vm::ptr<CellVdecMpeg4SpecificInfo> sinfo = vm::cast(spec_addr);
|
||||
|
||||
if (sinfo)
|
||||
{
|
||||
if (sinfo->thisSize != sizeof(CellVdecMpeg4SpecificInfo))
|
||||
{
|
||||
return { CELL_VDEC_ERROR_ARG, "Invalid MPEG4 specific info size %d", sinfo->thisSize };
|
||||
}
|
||||
}
|
||||
|
||||
const u32 maxDecH = sinfo ? +sinfo->maxDecodedFrameHeight : 0;
|
||||
const u32 maxDecW = sinfo ? +sinfo->maxDecodedFrameWidth : 0;
|
||||
|
||||
switch (profile)
|
||||
{
|
||||
case CELL_VDEC_MPEG4_SP_L1:
|
||||
{
|
||||
if (maxDecW > 176 || maxDecH > 144)
|
||||
{
|
||||
return { CELL_VDEC_ERROR_ARG, "Invalid max decoded frame size %dx%d for profile %d", maxDecH, maxDecW, profile };
|
||||
}
|
||||
|
||||
memSize = new_sdk ? 0x8B78B : 0xBB70B;
|
||||
break;
|
||||
}
|
||||
case CELL_VDEC_MPEG4_SP_L2:
|
||||
case CELL_VDEC_MPEG4_SP_L3:
|
||||
{
|
||||
if (maxDecW > 352 || maxDecH > 288)
|
||||
{
|
||||
return { CELL_VDEC_ERROR_ARG, "Invalid max decoded frame size %dx%d for profile %d", maxDecH, maxDecW, profile };
|
||||
}
|
||||
|
||||
memSize = new_sdk ? 0xEFE0B : 0x11FD8B;
|
||||
break;
|
||||
}
|
||||
case CELL_VDEC_MPEG4_SP_D1_NTSC:
|
||||
{
|
||||
if (maxDecW > 720 || maxDecH > 480)
|
||||
{
|
||||
return { CELL_VDEC_ERROR_ARG, "Invalid max decoded frame size %dx%d for profile %d", maxDecH, maxDecW, profile };
|
||||
}
|
||||
|
||||
memSize = new_sdk ? 0x22DB0B : 0x25DA8B;
|
||||
break;
|
||||
}
|
||||
case CELL_VDEC_MPEG4_SP_VGA:
|
||||
{
|
||||
if (maxDecW > 640 || maxDecH > 480)
|
||||
{
|
||||
return { CELL_VDEC_ERROR_ARG, "Invalid max decoded frame size %dx%d for profile %d", maxDecH, maxDecW, profile };
|
||||
}
|
||||
|
||||
memSize = new_sdk ? 0x1FC00B : 0x22BF8B;
|
||||
break;
|
||||
}
|
||||
case CELL_VDEC_MPEG4_SP_D1_PAL:
|
||||
{
|
||||
if (maxDecW > 720 || maxDecH > 576)
|
||||
{
|
||||
return { CELL_VDEC_ERROR_ARG, "Invalid max decoded frame size %dx%d for profile %d", maxDecH, maxDecW, profile };
|
||||
}
|
||||
|
||||
memSize = new_sdk ? 0x28570B : 0x2B568B;
|
||||
break;
|
||||
}
|
||||
default: return { CELL_VDEC_ERROR_ARG, "Invalid MPEG4 profile %d", profile };
|
||||
}
|
||||
|
||||
decoderVerLower = 0x1080000;
|
||||
break;
|
||||
}
|
||||
case CELL_VDEC_CODEC_TYPE_DIVX:
|
||||
{
|
||||
cellVdec.warning("cellVdecQueryAttr: DivX (profile=%d)", profile);
|
||||
@@ -780,9 +861,9 @@ static error_code vdecQueryAttr(s32 type, u32 profile, u32 spec_addr /* may be 0
|
||||
|
||||
if (sinfo)
|
||||
{
|
||||
if (sinfo->thisSize != sizeof(CellVdecDivxSpecificInfo2))
|
||||
if (sinfo->thisSize != sizeof(CellVdecDivxSpecificInfo) && sinfo->thisSize != sizeof(CellVdecDivxSpecificInfo2))
|
||||
{
|
||||
return CELL_VDEC_ERROR_ARG;
|
||||
return { CELL_VDEC_ERROR_ARG, "Invalid DIVX specific info size %d", sinfo->thisSize };
|
||||
}
|
||||
}
|
||||
|
||||
@@ -790,7 +871,7 @@ static error_code vdecQueryAttr(s32 type, u32 profile, u32 spec_addr /* may be 0
|
||||
|
||||
//const u32 maxDecH = sinfo ? +sinfo->maxDecodedFrameHeight : 0;
|
||||
//const u32 maxDecW = sinfo ? +sinfo->maxDecodedFrameWidth : 0;
|
||||
u32 nrOfBuf = sinfo ? +sinfo->numberOfDecodedFrameBuffer : 0;
|
||||
u32 nrOfBuf = sinfo && sinfo->thisSize == sizeof(CellVdecDivxSpecificInfo2) ? +sinfo->numberOfDecodedFrameBuffer : 0;
|
||||
|
||||
if (nrOfBuf == 0)
|
||||
{
|
||||
@@ -800,12 +881,12 @@ static error_code vdecQueryAttr(s32 type, u32 profile, u32 spec_addr /* may be 0
|
||||
{
|
||||
if (profile != CELL_VDEC_DIVX_QMOBILE && profile != CELL_VDEC_DIVX_MOBILE)
|
||||
{
|
||||
return CELL_VDEC_ERROR_ARG;
|
||||
return { CELL_VDEC_ERROR_ARG, "Invalid number of decoded frame buffers %d for DIVX profile %d", nrOfBuf, profile };
|
||||
}
|
||||
}
|
||||
else if (nrOfBuf != 4 && nrOfBuf != 3)
|
||||
{
|
||||
return CELL_VDEC_ERROR_ARG;
|
||||
return { CELL_VDEC_ERROR_ARG, "Invalid number of decoded frame buffers %d for DIVX", nrOfBuf };
|
||||
}
|
||||
|
||||
// TODO: change memSize based on buffercount.
|
||||
@@ -817,13 +898,13 @@ static error_code vdecQueryAttr(s32 type, u32 profile, u32 spec_addr /* may be 0
|
||||
case CELL_VDEC_DIVX_HOME_THEATER: memSize = new_sdk ? 0x386A60 : 0x498060; break;
|
||||
case CELL_VDEC_DIVX_HD_720 : memSize = new_sdk ? 0x692070 : 0x805690; break;
|
||||
case CELL_VDEC_DIVX_HD_1080 : memSize = new_sdk ? 0xD78100 : 0xFC9870; break;
|
||||
default: return CELL_VDEC_ERROR_ARG;
|
||||
default: return { CELL_VDEC_ERROR_ARG, "Invalid DIVX profile %d", profile };
|
||||
}
|
||||
|
||||
decoderVerLower = 0x30806;
|
||||
break;
|
||||
}
|
||||
default: return CELL_VDEC_ERROR_ARG;
|
||||
default: return { CELL_VDEC_ERROR_ARG, "Invalid codec type %d", type };
|
||||
}
|
||||
|
||||
attr->decoderVerLower = decoderVerLower;
|
||||
@@ -839,7 +920,7 @@ error_code cellVdecQueryAttr(vm::cptr<CellVdecType> type, vm::ptr<CellVdecAttr>
|
||||
|
||||
if (!type || !attr)
|
||||
{
|
||||
return CELL_VDEC_ERROR_ARG;
|
||||
return { CELL_VDEC_ERROR_ARG, "type=%d, attr=%d", !!type, !!attr };
|
||||
}
|
||||
|
||||
return vdecQueryAttr(type->codecType, type->profileLevel, 0, attr.get_ptr());
|
||||
@@ -851,7 +932,7 @@ error_code cellVdecQueryAttrEx(vm::cptr<CellVdecTypeEx> type, vm::ptr<CellVdecAt
|
||||
|
||||
if (!type || !attr)
|
||||
{
|
||||
return CELL_VDEC_ERROR_ARG;
|
||||
return { CELL_VDEC_ERROR_ARG, "type=%d, attr=%d", !!type, !!attr };
|
||||
}
|
||||
|
||||
return vdecQueryAttr(type->codecType, type->profileLevel, type->codecSpecificInfo_addr, attr.get_ptr());
|
||||
@@ -862,13 +943,14 @@ static error_code vdecOpen(ppu_thread& ppu, T type, U res, vm::cptr<CellVdecCb>
|
||||
{
|
||||
if (!type || !res || !cb || !handle || !cb->cbFunc)
|
||||
{
|
||||
return CELL_VDEC_ERROR_ARG;
|
||||
return { CELL_VDEC_ERROR_ARG, "type=%d, res=%d, cb=%d, handle=%d, cbFunc=%d", !!type, !!res, !!cb, !!handle, cb && cb->cbFunc };
|
||||
}
|
||||
|
||||
if (!res->memAddr || res->ppuThreadPriority + 0u >= 3072 || res->spuThreadPriority + 0u >= 256 || res->ppuThreadStackSize < 4096
|
||||
|| type->codecType + 0u >= 0xe)
|
||||
{
|
||||
return CELL_VDEC_ERROR_ARG;
|
||||
return { CELL_VDEC_ERROR_ARG, "memAddr=%d, ppuThreadPriority=%d, spuThreadPriority=%d, ppuThreadStackSize=%d, codecType=%d",
|
||||
res->memAddr, res->ppuThreadPriority, res->spuThreadPriority, res->ppuThreadStackSize, type->codecType };
|
||||
}
|
||||
|
||||
u32 spec_addr = 0;
|
||||
@@ -878,11 +960,16 @@ static error_code vdecOpen(ppu_thread& ppu, T type, U res, vm::cptr<CellVdecCb>
|
||||
spec_addr = type->codecSpecificInfo_addr;
|
||||
}
|
||||
|
||||
if (CellVdecAttr attr{};
|
||||
vdecQueryAttr(type->codecType, type->profileLevel, spec_addr, &attr) != CELL_OK ||
|
||||
attr.memSize > res->memSize)
|
||||
CellVdecAttr attr{};
|
||||
const error_code err = vdecQueryAttr(type->codecType, type->profileLevel, spec_addr, &attr);
|
||||
if (err != CELL_OK)
|
||||
{
|
||||
return CELL_VDEC_ERROR_ARG;
|
||||
return err;
|
||||
}
|
||||
|
||||
if (attr.memSize > res->memSize)
|
||||
{
|
||||
return { CELL_VDEC_ERROR_ARG, "attr.memSize=%d, res->memSize=%d", attr.memSize, res->memSize };
|
||||
}
|
||||
|
||||
// Create decoder context
|
||||
@@ -953,7 +1040,7 @@ error_code cellVdecClose(ppu_thread& ppu, u32 handle)
|
||||
|
||||
if (!vdec)
|
||||
{
|
||||
return CELL_VDEC_ERROR_ARG;
|
||||
return { CELL_VDEC_ERROR_ARG, "vdec is nullptr" };
|
||||
}
|
||||
|
||||
{
|
||||
@@ -991,7 +1078,7 @@ error_code cellVdecClose(ppu_thread& ppu, u32 handle)
|
||||
if (!idm::remove_verify<vdec_context>(handle, std::move(vdec)))
|
||||
{
|
||||
// Other thread removed it beforehead
|
||||
return CELL_VDEC_ERROR_ARG;
|
||||
return { CELL_VDEC_ERROR_ARG, "remove_verify failed" };
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
@@ -1007,7 +1094,7 @@ error_code cellVdecStartSeq(ppu_thread& ppu, u32 handle)
|
||||
|
||||
if (!vdec)
|
||||
{
|
||||
return CELL_VDEC_ERROR_ARG;
|
||||
return { CELL_VDEC_ERROR_ARG, "vdec is nullptr" };
|
||||
}
|
||||
|
||||
sequence_state old_state{};
|
||||
@@ -1059,7 +1146,7 @@ error_code cellVdecEndSeq(ppu_thread& ppu, u32 handle)
|
||||
|
||||
if (!vdec)
|
||||
{
|
||||
return CELL_VDEC_ERROR_ARG;
|
||||
return { CELL_VDEC_ERROR_ARG, "vdec is nullptr" };
|
||||
}
|
||||
|
||||
{
|
||||
@@ -1109,8 +1196,7 @@ error_code cellVdecDecodeAu(ppu_thread& ppu, u32 handle, CellVdecDecodeMode mode
|
||||
return { CELL_VDEC_ERROR_ARG, "mode=%d", +mode };
|
||||
}
|
||||
|
||||
// TODO: what does the 3 stand for ?
|
||||
if ((mode == (CELL_VDEC_DEC_MODE_B_SKIP | CELL_VDEC_DEC_MODE_PB_SKIP) && vdec->type != 3) ||
|
||||
if ((mode == (CELL_VDEC_DEC_MODE_B_SKIP | CELL_VDEC_DEC_MODE_PB_SKIP) && vdec->type != CELL_VDEC_CODEC_TYPE_VC1) ||
|
||||
(mode == CELL_VDEC_DEC_MODE_PB_SKIP && vdec->type != CELL_VDEC_CODEC_TYPE_AVC))
|
||||
{
|
||||
return { CELL_VDEC_ERROR_ARG, "mode=%d, type=%d", +mode, vdec->type };
|
||||
@@ -1157,8 +1243,7 @@ error_code cellVdecDecodeAuEx2(ppu_thread& ppu, u32 handle, CellVdecDecodeMode m
|
||||
return { CELL_VDEC_ERROR_ARG, "mode=%d", +mode };
|
||||
}
|
||||
|
||||
// TODO: what does the 3 stand for ?
|
||||
if ((mode == (CELL_VDEC_DEC_MODE_B_SKIP | CELL_VDEC_DEC_MODE_PB_SKIP) && vdec->type != 3) ||
|
||||
if ((mode == (CELL_VDEC_DEC_MODE_B_SKIP | CELL_VDEC_DEC_MODE_PB_SKIP) && vdec->type != CELL_VDEC_CODEC_TYPE_VC1) ||
|
||||
(mode == CELL_VDEC_DEC_MODE_PB_SKIP && vdec->type != CELL_VDEC_CODEC_TYPE_AVC))
|
||||
{
|
||||
return { CELL_VDEC_ERROR_ARG, "mode=%d, type=%d", +mode, vdec->type };
|
||||
@@ -1196,7 +1281,7 @@ error_code cellVdecGetPictureExt(ppu_thread& ppu, u32 handle, vm::cptr<CellVdecP
|
||||
|
||||
if (!vdec || !format)
|
||||
{
|
||||
return CELL_VDEC_ERROR_ARG;
|
||||
return { CELL_VDEC_ERROR_ARG, "vdec=%d, format=%d", !!vdec, !!format };
|
||||
}
|
||||
|
||||
{
|
||||
@@ -1210,12 +1295,12 @@ error_code cellVdecGetPictureExt(ppu_thread& ppu, u32 handle, vm::cptr<CellVdecP
|
||||
|
||||
if (format->formatType > 4 || (format->formatType <= CELL_VDEC_PICFMT_RGBA32_ILV && format->colorMatrixType > CELL_VDEC_COLOR_MATRIX_TYPE_BT709))
|
||||
{
|
||||
return CELL_VDEC_ERROR_ARG;
|
||||
return {CELL_VDEC_ERROR_ARG, "formatType=%d, colorMatrixType=%d", +format->formatType, +format->colorMatrixType};
|
||||
}
|
||||
|
||||
if (arg4 && arg4 != 8 && arg4 != 0xc)
|
||||
{
|
||||
return CELL_VDEC_ERROR_ARG;
|
||||
return { CELL_VDEC_ERROR_ARG, "arg4=0x%x", arg4 };
|
||||
}
|
||||
|
||||
if (arg4 || format->unk0 || format->unk1)
|
||||
@@ -1335,7 +1420,7 @@ error_code cellVdecGetPicture(ppu_thread& ppu, u32 handle, vm::cptr<CellVdecPicF
|
||||
|
||||
if (!format)
|
||||
{
|
||||
return CELL_VDEC_ERROR_ARG;
|
||||
return { CELL_VDEC_ERROR_ARG, "format is nullptr" };
|
||||
}
|
||||
|
||||
vm::var<CellVdecPicFormat2> format2;
|
||||
@@ -1358,7 +1443,7 @@ error_code cellVdecGetPicItem(ppu_thread& ppu, u32 handle, vm::pptr<CellVdecPicI
|
||||
|
||||
if (!vdec || !picItem)
|
||||
{
|
||||
return CELL_VDEC_ERROR_ARG;
|
||||
return { CELL_VDEC_ERROR_ARG, "vdec=%d, picItem=%d", !!vdec, !!picItem };
|
||||
}
|
||||
|
||||
u64 sequence_id{};
|
||||
@@ -1377,7 +1462,12 @@ error_code cellVdecGetPicItem(ppu_thread& ppu, u32 handle, vm::pptr<CellVdecPicI
|
||||
struct all_info_t
|
||||
{
|
||||
CellVdecPicItem picItem;
|
||||
std::aligned_union_t<0, CellVdecAvcInfo, CellVdecDivxInfo, CellVdecMpeg2Info> picInfo;
|
||||
union
|
||||
{
|
||||
CellVdecAvcInfo avcInfo;
|
||||
CellVdecDivxInfo divxInfo;
|
||||
CellVdecMpeg2Info mpeg2Info;
|
||||
} picInfo;
|
||||
};
|
||||
|
||||
AVFrame* frame{};
|
||||
@@ -1510,7 +1600,8 @@ error_code cellVdecGetPicItem(ppu_thread& ppu, u32 handle, vm::pptr<CellVdecPicI
|
||||
avc->reserved[0] = 0;
|
||||
avc->reserved[1] = 0;
|
||||
}
|
||||
else if (vdec->type == CELL_VDEC_CODEC_TYPE_DIVX)
|
||||
// TODO: handle MPEG4 properly
|
||||
else if (vdec->type == CELL_VDEC_CODEC_TYPE_MPEG4 || vdec->type == CELL_VDEC_CODEC_TYPE_DIVX)
|
||||
{
|
||||
const vm::ptr<CellVdecDivxInfo> dvx = picinfo_addr;
|
||||
|
||||
@@ -1601,7 +1692,7 @@ error_code cellVdecSetFrameRate(u32 handle, CellVdecFrameRate frameRateCode)
|
||||
// 0x80 seems like a common prefix
|
||||
if (!vdec || (frameRateCode & 0xf8) != 0x80)
|
||||
{
|
||||
return CELL_VDEC_ERROR_ARG;
|
||||
return { CELL_VDEC_ERROR_ARG, "vdec=%d, frameRateCode=0x%x", !!vdec, +frameRateCode };
|
||||
}
|
||||
|
||||
std::lock_guard lock{vdec->mutex};
|
||||
@@ -1625,7 +1716,7 @@ error_code cellVdecOpenExt(ppu_thread& ppu, vm::cptr<CellVdecType> type, vm::cpt
|
||||
|
||||
if (!res)
|
||||
{
|
||||
return CELL_VDEC_ERROR_ARG;
|
||||
return { CELL_VDEC_ERROR_ARG, "res is nullptr" };
|
||||
}
|
||||
|
||||
vm::var<CellVdecResource> tmp = vm::make_var<CellVdecResource>({});
|
||||
@@ -1678,7 +1769,7 @@ error_code cellVdecSetPts(u32 handle, vm::ptr<void> unk)
|
||||
|
||||
if (!vdec || !unk)
|
||||
{
|
||||
return CELL_VDEC_ERROR_ARG;
|
||||
return { CELL_VDEC_ERROR_ARG, "vdec=%d, unk=%d", !!vdec, !!unk };
|
||||
}
|
||||
|
||||
std::lock_guard lock{vdec->mutex};
|
||||
|
||||
@@ -14,9 +14,15 @@ enum CellVdecError : u32
|
||||
|
||||
enum CellVdecCodecType : s32
|
||||
{
|
||||
CELL_VDEC_CODEC_TYPE_MPEG2 = 0,
|
||||
CELL_VDEC_CODEC_TYPE_AVC = 1,
|
||||
CELL_VDEC_CODEC_TYPE_DIVX = 5,
|
||||
CELL_VDEC_CODEC_TYPE_MPEG2 = 0,
|
||||
CELL_VDEC_CODEC_TYPE_AVC = 1,
|
||||
CELL_VDEC_CODEC_TYPE_MPEG4 = 2,
|
||||
CELL_VDEC_CODEC_TYPE_VC1 = 3,
|
||||
CELL_VDEC_CODEC_TYPE_DIVX = 5,
|
||||
CELL_VDEC_CODEC_TYPE_JVT = 7,
|
||||
CELL_VDEC_CODEC_TYPE_DIVX3_11 = 9,
|
||||
CELL_VDEC_CODEC_TYPE_MVC = 11,
|
||||
CELL_VDEC_CODEC_TYPE_MVC2 = 13, // seems the same as CELL_VDEC_CODEC_TYPE_MVC?
|
||||
CELL_VDEC_CODEC_TYPE_MAX
|
||||
};
|
||||
|
||||
@@ -672,3 +678,20 @@ struct CellVdecMpeg2Info
|
||||
u8 ccData[2][128];
|
||||
be_t<u64> reserved[2];
|
||||
};
|
||||
|
||||
enum MPEG4_level
|
||||
{
|
||||
CELL_VDEC_MPEG4_SP_L1,
|
||||
CELL_VDEC_MPEG4_SP_L2,
|
||||
CELL_VDEC_MPEG4_SP_L3,
|
||||
CELL_VDEC_MPEG4_SP_D1_NTSC,
|
||||
CELL_VDEC_MPEG4_SP_VGA,
|
||||
CELL_VDEC_MPEG4_SP_D1_PAL,
|
||||
};
|
||||
|
||||
struct CellVdecMpeg4SpecificInfo
|
||||
{
|
||||
be_t<u32> thisSize;
|
||||
be_t<u16> maxDecodedFrameWidth;
|
||||
be_t<u16> maxDecodedFrameHeight;
|
||||
};
|
||||
|
||||
@@ -745,7 +745,7 @@ error_code sceNpDrmIsAvailable(ppu_thread& ppu, vm::cptr<u8> k_licensee_addr, vm
|
||||
lv2_obj::sleep(ppu);
|
||||
|
||||
const auto ret = npDrmIsAvailable(k_licensee_addr, drm_path);
|
||||
lv2_sleep(25'000, &ppu);
|
||||
lv2_sleep(5'000, &ppu);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -871,7 +871,7 @@ error_code sceNpDrmGetTimelimit(vm::cptr<char> path, vm::ptr<u64> time_remain)
|
||||
}
|
||||
|
||||
// Convert time to milliseconds
|
||||
s64 msec = *sec * 1000ll + *nsec / 1000ll;
|
||||
s64 msec = *sec * 1000ll + *nsec / 1'000'000ll;
|
||||
|
||||
// Return the remaining time in microseconds
|
||||
if (npd.activate_time != 0 && msec < npd.activate_time)
|
||||
@@ -1118,10 +1118,35 @@ error_code sceNpBasicSetPresenceDetails2(vm::cptr<SceNpBasicPresenceDetails2> pr
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
error_code sceNpBasicSendMessage(vm::cptr<SceNpId> to, vm::cptr<void> data, u32 size)
|
||||
{
|
||||
sceNp.warning("sceNpBasicSendMessage(to=*0x%x, data=*0x%x, size=%d)", to, data, size);
|
||||
u64 sys_time_get_system_time();
|
||||
|
||||
error_code acquire_time_slot(u64* time_array, usz array_size, u64 slot_duration)
|
||||
{
|
||||
static shared_mutex mutex;
|
||||
std::lock_guard lock(mutex);
|
||||
|
||||
const u64 current_time = sys_time_get_system_time();
|
||||
|
||||
for (usz index = 0; index < array_size; index++)
|
||||
{
|
||||
if (time_array[index] == 0)
|
||||
{
|
||||
time_array[index] = current_time;
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
if (current_time > (time_array[index] + slot_duration))
|
||||
{
|
||||
time_array[index] = current_time;
|
||||
return CELL_OK;
|
||||
}
|
||||
}
|
||||
|
||||
return SCE_NP_BASIC_ERROR_BUSY;
|
||||
}
|
||||
|
||||
error_code _sceNpBasicSendMessage(vm::cptr<SceNpId> to, vm::cptr<void> data, u32 size, bool rate_limited)
|
||||
{
|
||||
auto& nph = g_fxo->get<named_thread<np::np_handler>>();
|
||||
|
||||
if (!nph.is_NP_init)
|
||||
@@ -1144,6 +1169,23 @@ error_code sceNpBasicSendMessage(vm::cptr<SceNpId> to, vm::cptr<void> data, u32
|
||||
return SCE_NP_BASIC_ERROR_EXCEEDS_MAX;
|
||||
}
|
||||
|
||||
if (rate_limited)
|
||||
{
|
||||
struct sceNpBasicSendMessage_time_slots
|
||||
{
|
||||
sceNpBasicSendMessage_time_slots() = default;
|
||||
sceNpBasicSendMessage_time_slots(sceNpBasicSendMessage_time_slots&&) = delete;
|
||||
std::array<u64, 20> data{};
|
||||
};
|
||||
|
||||
auto& time_slots = g_fxo->get<sceNpBasicSendMessage_time_slots>();
|
||||
|
||||
if (auto error = acquire_time_slot(time_slots.data.data(), time_slots.data.size(), 60000000); error != CELL_OK)
|
||||
{
|
||||
return error;
|
||||
}
|
||||
}
|
||||
|
||||
if (nph.get_psn_status() != SCE_NP_MANAGER_STATUS_ONLINE)
|
||||
{
|
||||
return not_an_error(SCE_NP_BASIC_ERROR_NOT_CONNECTED);
|
||||
@@ -1157,13 +1199,26 @@ error_code sceNpBasicSendMessage(vm::cptr<SceNpId> to, vm::cptr<void> data, u32
|
||||
.msgFeatures = {},
|
||||
.data = std::vector<u8>(static_cast<const u8*>(data.get_ptr()), static_cast<const u8*>(data.get_ptr()) + size)};
|
||||
std::set<std::string> npids;
|
||||
npids.insert(std::string(to->handle.data));
|
||||
npids.insert(np::npid_to_string(*to));
|
||||
|
||||
nph.send_message(msg_data, npids);
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
error_code sceNpBasicSendMessage(vm::cptr<SceNpId> to, vm::cptr<void> data, u32 size)
|
||||
{
|
||||
sceNp.warning("sceNpBasicSendMessage(to=*0x%x, data=*0x%x, size=%d)", to, data, size);
|
||||
return _sceNpBasicSendMessage(to, data, size, false);
|
||||
}
|
||||
|
||||
// This function is sceNpBasicSendMessage + a rate limiter that will return SCE_NP_BASIC_ERROR_BUSY if it too many messages have been sent
|
||||
error_code sceNpBasicLimited_0xEB42E2E6(vm::cptr<SceNpId> to, vm::cptr<void> data, u32 size)
|
||||
{
|
||||
sceNp.warning("sceNpBasicLimited_0xEB42E2E6(to=*0x%x, data=*0x%x, size=%d)", to, data, size);
|
||||
return _sceNpBasicSendMessage(to, data, size, true);
|
||||
}
|
||||
|
||||
error_code sceNpBasicSendMessageGui(ppu_thread& ppu, vm::cptr<SceNpBasicMessageDetails> msg, sys_memory_container_t containerId)
|
||||
{
|
||||
sceNp.warning("sceNpBasicSendMessageGui(msg=*0x%x, containerId=%d)", msg, containerId);
|
||||
@@ -1173,7 +1228,7 @@ error_code sceNpBasicSendMessageGui(ppu_thread& ppu, vm::cptr<SceNpBasicMessageD
|
||||
sceNp.notice("sceNpBasicSendMessageGui: msgId: %d, mainType: %d, subType: %d, msgFeatures: %d, count: %d, npids: *0x%x", msg->msgId, msg->mainType, msg->subType, msg->msgFeatures, msg->count, msg->npids);
|
||||
for (u32 i = 0; i < msg->count && msg->npids; i++)
|
||||
{
|
||||
sceNp.trace("sceNpBasicSendMessageGui: NpId[%d] = %s", i, static_cast<char*>(&msg->npids[i].handle.data[0]));
|
||||
sceNp.trace("sceNpBasicSendMessageGui: NpId[%d] = %s", i, np::npid_to_string(msg->npids[i]));
|
||||
}
|
||||
sceNp.notice("sceNpBasicSendMessageGui: subject: %s", msg->subject);
|
||||
sceNp.notice("sceNpBasicSendMessageGui: body: %s", msg->body);
|
||||
@@ -1343,7 +1398,7 @@ error_code sceNpBasicSendMessageGui(ppu_thread& ppu, vm::cptr<SceNpBasicMessageD
|
||||
{
|
||||
for (u32 i = 0; i < msg->count; i++)
|
||||
{
|
||||
npids.insert(std::string(msg->npids[i].handle.data));
|
||||
npids.insert(np::npid_to_string(msg->npids[i]));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3433,7 +3488,7 @@ error_code sceNpLookupUserProfile(s32 transId, vm::cptr<SceNpId> npId, vm::ptr<S
|
||||
error_code sceNpLookupUserProfileAsync(s32 transId, vm::cptr<SceNpId> npId, vm::ptr<SceNpUserInfo> userInfo, vm::ptr<SceNpAboutMe> aboutMe, vm::ptr<SceNpMyLanguages> languages,
|
||||
vm::ptr<SceNpCountryCode> countryCode, vm::ptr<SceNpAvatarImage> avatarImage, s32 prio, vm::ptr<void> option)
|
||||
{
|
||||
sceNp.todo("sceNpLookupUserProfile(transId=%d, npId=*0x%x, userInfo=*0x%x, aboutMe=*0x%x, languages=*0x%x, countryCode=*0x%x, avatarImage=*0x%x, prio=%d, option=*0x%x)", transId, npId, userInfo,
|
||||
sceNp.todo("sceNpLookupUserProfileAsync(transId=%d, npId=*0x%x, userInfo=*0x%x, aboutMe=*0x%x, languages=*0x%x, countryCode=*0x%x, avatarImage=*0x%x, prio=%d, option=*0x%x)", transId, npId, userInfo,
|
||||
aboutMe, languages, countryCode, avatarImage, prio, option);
|
||||
|
||||
auto& nph = g_fxo->get<named_thread<np::np_handler>>();
|
||||
@@ -4187,19 +4242,16 @@ error_code sceNpManagerGetTicket(vm::ptr<void> buffer, vm::ptr<u32> bufferSize)
|
||||
}
|
||||
|
||||
const auto& ticket = nph.get_ticket();
|
||||
*bufferSize = static_cast<u32>(ticket.size());
|
||||
|
||||
if (!buffer)
|
||||
{
|
||||
*bufferSize = static_cast<u32>(ticket.size());
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
if (*bufferSize < ticket.size())
|
||||
{
|
||||
return SCE_NP_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
memcpy(buffer.get_ptr(), ticket.data(), ticket.size());
|
||||
const u32 size_read = std::min(::size32(ticket), static_cast<u32>(*bufferSize));
|
||||
std::memcpy(buffer.get_ptr(), ticket.data(), size_read);
|
||||
*bufferSize = size_read;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
@@ -5621,7 +5673,7 @@ error_code scenp_score_record_score(s32 transId, SceNpScoreBoardId boardId, SceN
|
||||
else
|
||||
{
|
||||
data = &gameInfo->nativeData[0];
|
||||
data_size = 64;
|
||||
data_size = sizeof(gameInfo->nativeData);
|
||||
}
|
||||
|
||||
nph.record_score(trans_ctx, boardId, score, scoreComment, data, data_size, tmpRank, async);
|
||||
@@ -7089,7 +7141,7 @@ error_code sceNpUtilCanonicalizeNpIdForPsp(vm::ptr<SceNpId> npId)
|
||||
|
||||
error_code sceNpUtilCmpNpId(vm::ptr<SceNpId> id1, vm::ptr<SceNpId> id2)
|
||||
{
|
||||
sceNp.trace("sceNpUtilCmpNpId(id1=*0x%x(%s), id2=*0x%x(%s))", id1, id1 ? id1->handle.data : "", id2, id2 ? id2->handle.data : "");
|
||||
sceNp.trace("sceNpUtilCmpNpId(id1=*0x%x(%s), id2=*0x%x(%s))", id1, id1 ? np::npid_to_string(*id1) : std::string(), id2, id2 ? np::npid_to_string(*id2) : std::string());
|
||||
|
||||
if (!id1 || !id2)
|
||||
{
|
||||
@@ -7289,6 +7341,11 @@ s32 _Z32_sce_np_sysutil_cxml_prepare_docPN16sysutil_cxmlutil11FixedMemoryERN4cxm
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
DECLARE(ppu_module_manager::sceNpBasicLimited)
|
||||
("sceNpBasicLimited", []() {
|
||||
ppu_module_manager::register_static_function<&sceNpBasicLimited_0xEB42E2E6>("sceNpBasicLimited", ppu_select_name("sceNpBasicLimited", "sceNpBasicLimited_0xEB42E2E6"), BIND_FUNC_WITH_BLR(sceNpBasicLimited_0xEB42E2E6, "sceNpBasicLimited"), 0xEB42E2E6);
|
||||
});
|
||||
|
||||
DECLARE(ppu_module_manager::sceNp)
|
||||
("sceNp", []() {
|
||||
REG_FUNC(sceNp, sceNpInit);
|
||||
|
||||
@@ -1397,9 +1397,9 @@ struct SceNpBasicMessageDetails
|
||||
// Presence details of an user
|
||||
struct SceNpBasicPresenceDetails
|
||||
{
|
||||
s8 title[SCE_NP_BASIC_PRESENCE_TITLE_SIZE_MAX];
|
||||
s8 status[SCE_NP_BASIC_PRESENCE_STATUS_SIZE_MAX];
|
||||
s8 comment[SCE_NP_BASIC_PRESENCE_COMMENT_SIZE_MAX];
|
||||
char title[SCE_NP_BASIC_PRESENCE_TITLE_SIZE_MAX];
|
||||
char status[SCE_NP_BASIC_PRESENCE_STATUS_SIZE_MAX];
|
||||
char comment[SCE_NP_BASIC_PRESENCE_COMMENT_SIZE_MAX];
|
||||
u8 data[SCE_NP_BASIC_MAX_PRESENCE_SIZE];
|
||||
be_t<u32> size;
|
||||
be_t<s32> state;
|
||||
@@ -1410,9 +1410,9 @@ struct SceNpBasicPresenceDetails2
|
||||
{
|
||||
be_t<u32> struct_size;
|
||||
be_t<s32> state;
|
||||
s8 title[SCE_NP_BASIC_PRESENCE_TITLE_SIZE_MAX];
|
||||
s8 status[SCE_NP_BASIC_PRESENCE_EXTENDED_STATUS_SIZE_MAX];
|
||||
s8 comment[SCE_NP_BASIC_PRESENCE_COMMENT_SIZE_MAX];
|
||||
char title[SCE_NP_BASIC_PRESENCE_TITLE_SIZE_MAX];
|
||||
char status[SCE_NP_BASIC_PRESENCE_EXTENDED_STATUS_SIZE_MAX];
|
||||
char comment[SCE_NP_BASIC_PRESENCE_COMMENT_SIZE_MAX];
|
||||
u8 data[SCE_NP_BASIC_MAX_PRESENCE_SIZE];
|
||||
be_t<u32> size;
|
||||
};
|
||||
@@ -1420,9 +1420,9 @@ struct SceNpBasicPresenceDetails2
|
||||
// Country/region code
|
||||
struct SceNpCountryCode
|
||||
{
|
||||
s8 data[2];
|
||||
s8 term;
|
||||
s8 padding[1];
|
||||
char data[2];
|
||||
char term;
|
||||
char padding[1];
|
||||
};
|
||||
|
||||
// Date information
|
||||
@@ -1451,8 +1451,8 @@ struct SceNpScoreGameInfo
|
||||
// Ranking comment structure
|
||||
struct SceNpScoreComment
|
||||
{
|
||||
s8 data[SCE_NP_SCORE_COMMENT_MAXLEN];
|
||||
s8 term[1];
|
||||
char data[SCE_NP_SCORE_COMMENT_MAXLEN];
|
||||
char term[1];
|
||||
};
|
||||
|
||||
// Ranking information structure
|
||||
@@ -1524,15 +1524,15 @@ struct SceNpScoreNpIdPcId
|
||||
// Basic clan information to be used in raking
|
||||
struct SceNpScoreClanBasicInfo
|
||||
{
|
||||
s8 clanName[SCE_NP_CLANS_CLAN_NAME_MAX_LENGTH + 1];
|
||||
s8 clanTag[SCE_NP_CLANS_CLAN_TAG_MAX_LENGTH + 1];
|
||||
char clanName[SCE_NP_CLANS_CLAN_NAME_MAX_LENGTH + 1];
|
||||
char clanTag[SCE_NP_CLANS_CLAN_TAG_MAX_LENGTH + 1];
|
||||
u8 reserved[10];
|
||||
};
|
||||
|
||||
// Clan member information handled in ranking
|
||||
struct SceNpScoreClansMemberDescription
|
||||
{
|
||||
s8 description[SCE_NP_CLANS_CLAN_DESCRIPTION_MAX_LENGTH + 1];
|
||||
char description[SCE_NP_CLANS_CLAN_DESCRIPTION_MAX_LENGTH + 1];
|
||||
};
|
||||
|
||||
// Clan ranking information
|
||||
|
||||
@@ -616,9 +616,9 @@ error_code sceNpMatching2CreateServerContext(
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
error_code sceNpMatching2GetMemoryInfo(vm::ptr<SceNpMatching2MemoryInfo> memInfo) // TODO
|
||||
error_code sceNpMatching2GetMemoryInfo(vm::ptr<SceNpMatching2MemoryInfo> memInfo)
|
||||
{
|
||||
sceNp2.todo("sceNpMatching2GetMemoryInfo(memInfo=*0x%x)", memInfo);
|
||||
sceNp2.warning("sceNpMatching2GetMemoryInfo(memInfo=*0x%x)", memInfo);
|
||||
|
||||
auto& nph = g_fxo->get<named_thread<np::np_handler>>();
|
||||
|
||||
@@ -627,6 +627,14 @@ error_code sceNpMatching2GetMemoryInfo(vm::ptr<SceNpMatching2MemoryInfo> memInfo
|
||||
return SCE_NP_MATCHING2_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
if (!memInfo)
|
||||
{
|
||||
return SCE_NP_MATCHING2_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
SceNpMatching2MemoryInfo mem_info = nph.get_memory_info();
|
||||
*memInfo = mem_info;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@@ -790,7 +798,7 @@ error_code sceNpMatching2JoinLobby(
|
||||
error_code sceNpMatching2GetRoomMemberDataExternalList(SceNpMatching2ContextId ctxId, vm::cptr<SceNpMatching2GetRoomMemberDataExternalListRequest> reqParam,
|
||||
vm::cptr<SceNpMatching2RequestOptParam> optParam, vm::ptr<SceNpMatching2RequestId> assignedReqId)
|
||||
{
|
||||
sceNp2.todo("sceNpMatching2GetRoomMemberDataExternalList(ctxId=%d, reqParam=*0x%x, optParam=*0x%x, assignedReqId=*0x%x)", ctxId, reqParam, optParam, assignedReqId);
|
||||
sceNp2.warning("sceNpMatching2GetRoomMemberDataExternalList(ctxId=%d, reqParam=*0x%x, optParam=*0x%x, assignedReqId=*0x%x)", ctxId, reqParam, optParam, assignedReqId);
|
||||
|
||||
auto& nph = g_fxo->get<named_thread<np::np_handler>>();
|
||||
if (auto res = generic_match2_error_check(nph, ctxId, reqParam); res != CELL_OK)
|
||||
@@ -798,6 +806,13 @@ error_code sceNpMatching2GetRoomMemberDataExternalList(SceNpMatching2ContextId c
|
||||
return res;
|
||||
}
|
||||
|
||||
const u32 request_id = nph.get_room_member_data_external_list(ctxId, optParam, reqParam.get_ptr());
|
||||
|
||||
if (assignedReqId)
|
||||
{
|
||||
*assignedReqId = request_id;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@@ -1056,7 +1071,7 @@ error_code sceNpMatching2GetRoomMemberDataInternalLocal(SceNpMatching2ContextId
|
||||
|
||||
error_code sceNpMatching2GetCbQueueInfo(SceNpMatching2ContextId ctxId, vm::ptr<SceNpMatching2CbQueueInfo> queueInfo)
|
||||
{
|
||||
sceNp2.todo("sceNpMatching2GetCbQueueInfo(ctxId=%d, queueInfo=*0x%x)", ctxId, queueInfo);
|
||||
sceNp2.warning("sceNpMatching2GetCbQueueInfo(ctxId=%d, queueInfo=*0x%x)", ctxId, queueInfo);
|
||||
|
||||
auto& nph = g_fxo->get<named_thread<np::np_handler>>();
|
||||
|
||||
@@ -1065,6 +1080,17 @@ error_code sceNpMatching2GetCbQueueInfo(SceNpMatching2ContextId ctxId, vm::ptr<S
|
||||
return SCE_NP_MATCHING2_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
if (!queueInfo)
|
||||
{
|
||||
return SCE_NP_MATCHING2_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
*queueInfo = {};
|
||||
// TODO: check the values returned on real hardware
|
||||
queueInfo->requestCbQueueLen = 255;
|
||||
queueInfo->sessionEventCbQueueLen = 255;
|
||||
queueInfo->sessionMsgCbQueueLen = 255;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@@ -1109,7 +1135,7 @@ error_code sceNpMatching2ContextStartAsync(SceNpMatching2ContextId ctxId, u32 ti
|
||||
{
|
||||
sysutil_register_cb([=, context_callback = ctx->context_callback, context_callback_param = ctx->context_callback_param](ppu_thread& cb_ppu) -> s32
|
||||
{
|
||||
context_callback(cb_ppu, ctxId, SCE_NP_MATCHING2_CONTEXT_EVENT_Start, SCE_NP_MATCHING2_EVENT_CAUSE_CONTEXT_ACTION, 0, ctx->context_callback_param);
|
||||
context_callback(cb_ppu, ctxId, SCE_NP_MATCHING2_CONTEXT_EVENT_Start, SCE_NP_MATCHING2_EVENT_CAUSE_CONTEXT_ACTION, 0, context_callback_param);
|
||||
return 0;
|
||||
});
|
||||
}
|
||||
@@ -1326,7 +1352,7 @@ error_code sceNpMatching2CreateContext(
|
||||
|
||||
error_code sceNpMatching2GetSignalingOptParamLocal(SceNpMatching2ContextId ctxId, SceNpMatching2RoomId roomId, vm::ptr<SceNpMatching2SignalingOptParam> signalingOptParam)
|
||||
{
|
||||
sceNp2.todo("sceNpMatching2GetSignalingOptParamLocal(ctxId=%d, roomId=%d, signalingOptParam=*0x%x)", ctxId, roomId, signalingOptParam);
|
||||
sceNp2.warning("sceNpMatching2GetSignalingOptParamLocal(ctxId=%d, roomId=%d, signalingOptParam=*0x%x)", ctxId, roomId, signalingOptParam);
|
||||
|
||||
auto& nph = g_fxo->get<named_thread<np::np_handler>>();
|
||||
|
||||
@@ -1335,6 +1361,30 @@ error_code sceNpMatching2GetSignalingOptParamLocal(SceNpMatching2ContextId ctxId
|
||||
return SCE_NP_MATCHING2_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
if (!ctxId)
|
||||
{
|
||||
return SCE_NP_MATCHING2_ERROR_INVALID_CONTEXT_ID;
|
||||
}
|
||||
|
||||
if (!roomId)
|
||||
{
|
||||
return SCE_NP_MATCHING2_ERROR_INVALID_ROOM_ID;
|
||||
}
|
||||
|
||||
if (!check_match2_context(ctxId))
|
||||
{
|
||||
return SCE_NP_MATCHING2_ERROR_CONTEXT_NOT_FOUND;
|
||||
}
|
||||
|
||||
const auto [error, signaling_opt_param] = nph.local_get_signaling_opt_param(roomId);
|
||||
|
||||
if (error)
|
||||
{
|
||||
return error;
|
||||
}
|
||||
|
||||
*signalingOptParam = *signaling_opt_param;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@@ -1710,7 +1760,7 @@ error_code sceNpMatching2ContextStop(SceNpMatching2ContextId ctxId)
|
||||
const auto ctx = get_match2_context(ctxId);
|
||||
|
||||
if (!ctx)
|
||||
return SCE_NP_MATCHING2_ERROR_INVALID_CONTEXT_ID;
|
||||
return SCE_NP_MATCHING2_ERROR_CONTEXT_NOT_FOUND;
|
||||
|
||||
if (!ctx->started.compare_and_swap_test(1, 0))
|
||||
return SCE_NP_MATCHING2_ERROR_CONTEXT_NOT_STARTED;
|
||||
|
||||
@@ -1026,14 +1026,14 @@ error_code sceNpTrophyUnlockTrophy(ppu_thread& ppu, u32 context, u32 handle, s32
|
||||
|
||||
auto& trophy_manager = g_fxo->get<sce_np_trophy_manager>();
|
||||
|
||||
reader_lock lock(trophy_manager.mtx);
|
||||
std::scoped_lock lock(trophy_manager.mtx);
|
||||
|
||||
if (!trophy_manager.is_initialized)
|
||||
{
|
||||
return SCE_NP_TROPHY_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
const auto [ctxt, error] = trophy_manager.get_context_ex(context, handle);
|
||||
const auto [ctxt, error] = trophy_manager.get_context_ex(context, handle, true);
|
||||
|
||||
if (error)
|
||||
{
|
||||
@@ -1184,9 +1184,9 @@ error_code sceNpTrophyGetTrophyUnlockState(u32 context, u32 handle, vm::ptr<SceN
|
||||
for (u32 id = 0; id < count_; id++)
|
||||
{
|
||||
if (tropusr->GetTrophyUnlockState(id))
|
||||
flags->flag_bits[id / 32] |= 1 << (id % 32);
|
||||
flags->flag_bits[id / 32] |= 1u << (id % 32);
|
||||
else
|
||||
flags->flag_bits[id / 32] &= ~(1 << (id % 32));
|
||||
flags->flag_bits[id / 32] &= ~(1u << (id % 32));
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
@@ -1529,6 +1529,11 @@ error_code sceNpTrophyGetTrophyIcon(u32 context, u32 handle, s32 trophyId, vm::p
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
error_code sceNpTrophyNetworkSync()
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(sceNpTrophy);
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
DECLARE(ppu_module_manager::sceNpTrophy)("sceNpTrophy", []()
|
||||
{
|
||||
@@ -1553,4 +1558,5 @@ DECLARE(ppu_module_manager::sceNpTrophy)("sceNpTrophy", []()
|
||||
REG_FUNC(sceNpTrophy, sceNpTrophyGetTrophyDetails);
|
||||
REG_FUNC(sceNpTrophy, sceNpTrophyGetTrophyInfo);
|
||||
REG_FUNC(sceNpTrophy, sceNpTrophyGetGameIcon);
|
||||
REG_FUNC(sceNpTrophy, sceNpTrophyNetworkSync);
|
||||
});
|
||||
|
||||
@@ -65,7 +65,7 @@ struct sce_np_util_manager
|
||||
|
||||
error_code sceNpUtilBandwidthTestInitStart([[maybe_unused]] ppu_thread& ppu, u32 prio, u32 stack)
|
||||
{
|
||||
sceNpUtil.todo("sceNpUtilBandwidthTestInitStart(prio=%d, stack=%d)", prio, stack);
|
||||
sceNpUtil.warning("sceNpUtilBandwidthTestInitStart(prio=%d, stack=%d)", prio, stack);
|
||||
|
||||
auto& util_manager = g_fxo->get<sce_np_util_manager>();
|
||||
std::lock_guard lock(util_manager.mtx);
|
||||
|
||||
@@ -330,7 +330,7 @@ void comment_constant(std::string& last_opcode, u64 value, bool print_float = fa
|
||||
// Comment constant formation
|
||||
fmt::append(last_opcode, " #0x%xh", value);
|
||||
|
||||
if (print_float && ((value >> 31) <= 1u || (value >> 31) == 0x1'ffff'ffffu))
|
||||
if (print_float && ((value >> 31) <= 1u || (value >> 31) == 0x1'ffff'ffffu) && (value > 0x3fffff && (value << 32 >> 32) < 0xffc00000))
|
||||
{
|
||||
const f32 float_val = std::bit_cast<f32>(static_cast<u32>(value));
|
||||
|
||||
|
||||
@@ -314,6 +314,7 @@ static void ppu_initialize_modules(ppu_linkage_info* link, utils::serial* ar = n
|
||||
&ppu_module_manager::libsnd3,
|
||||
&ppu_module_manager::libsynth2,
|
||||
&ppu_module_manager::sceNp,
|
||||
&ppu_module_manager::sceNpBasicLimited,
|
||||
&ppu_module_manager::sceNp2,
|
||||
&ppu_module_manager::sceNpClans,
|
||||
&ppu_module_manager::sceNpCommerce2,
|
||||
|
||||
@@ -283,6 +283,7 @@ public:
|
||||
static const ppu_static_module libsnd3;
|
||||
static const ppu_static_module libsynth2;
|
||||
static const ppu_static_module sceNp;
|
||||
static const ppu_static_module sceNpBasicLimited;
|
||||
static const ppu_static_module sceNp2;
|
||||
static const ppu_static_module sceNpClans;
|
||||
static const ppu_static_module sceNpCommerce2;
|
||||
|
||||
@@ -1327,7 +1327,11 @@ void PPUTranslator::VMADDFP(ppu_opcode_t op)
|
||||
void PPUTranslator::VMAXFP(ppu_opcode_t op)
|
||||
{
|
||||
const auto [a, b] = get_vrs<f32[4]>(op.va, op.vb);
|
||||
#ifdef ARCH_ARM64
|
||||
set_vr(op.vd, vec_handle_result(fmax(a, b)));
|
||||
#else
|
||||
set_vr(op.vd, vec_handle_result(select(fcmp_ord(a < b) | fcmp_uno(b != b), b, a)));
|
||||
#endif
|
||||
}
|
||||
|
||||
void PPUTranslator::VMAXSB(ppu_opcode_t op)
|
||||
@@ -1389,7 +1393,11 @@ void PPUTranslator::VMHRADDSHS(ppu_opcode_t op)
|
||||
void PPUTranslator::VMINFP(ppu_opcode_t op)
|
||||
{
|
||||
const auto [a, b] = get_vrs<f32[4]>(op.va, op.vb);
|
||||
#ifdef ARCH_ARM64
|
||||
set_vr(op.vd, vec_handle_result(fmin(a, b)));
|
||||
#else
|
||||
set_vr(op.vd, vec_handle_result(select(fcmp_ord(a > b) | fcmp_uno(b != b), b, a)));
|
||||
#endif
|
||||
}
|
||||
|
||||
void PPUTranslator::VMINSB(ppu_opcode_t op)
|
||||
|
||||
@@ -51,22 +51,22 @@ struct spu_itype
|
||||
RDCH,
|
||||
RCHCNT,
|
||||
|
||||
BR, // branch_tag first
|
||||
BR, // branch_tag first, zregmod_tag (2) first
|
||||
BRA,
|
||||
BRNZ,
|
||||
BRZ,
|
||||
BRHNZ,
|
||||
BRHZ,
|
||||
BRSL,
|
||||
BRASL,
|
||||
IRET,
|
||||
BI,
|
||||
BISLED,
|
||||
BISL,
|
||||
BIZ,
|
||||
BINZ,
|
||||
BIHZ,
|
||||
BIHNZ, // branch_tag last
|
||||
BIHNZ, // zregmod_tag (2) last
|
||||
BRSL,
|
||||
BRASL,
|
||||
BISL, // branch_tag last
|
||||
|
||||
ILH, // constant_tag_first
|
||||
ILHU,
|
||||
@@ -245,7 +245,7 @@ struct spu_itype
|
||||
// Test for branch instruction
|
||||
friend constexpr bool operator &(type value, branch_tag)
|
||||
{
|
||||
return value >= BR && value <= BIHNZ;
|
||||
return value >= BR && value <= BISL;
|
||||
}
|
||||
|
||||
// Test for floating point instruction
|
||||
@@ -299,7 +299,7 @@ struct spu_itype
|
||||
// Test for non register-modifying instruction
|
||||
friend constexpr bool operator &(type value, zregmod_tag)
|
||||
{
|
||||
return value >= HEQ && value <= STQR;
|
||||
return (value >= HEQ && value <= STQR) || (value >= BR && value <= BIHNZ);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1176,108 +1176,6 @@ void spu_cache::initialize(bool build_existing_cache)
|
||||
if ((g_cfg.core.spu_decoder == spu_decoder_type::asmjit || g_cfg.core.spu_decoder == spu_decoder_type::llvm) && !func_list.empty())
|
||||
{
|
||||
spu_log.success("SPU Runtime: Built %u functions.", func_list.size());
|
||||
|
||||
if (g_cfg.core.spu_debug)
|
||||
{
|
||||
std::string dump;
|
||||
dump.reserve(10'000'000);
|
||||
|
||||
std::map<std::span<u8>, spu_program*, span_less<u8>> sorted;
|
||||
|
||||
for (auto&& f : func_list)
|
||||
{
|
||||
// Interpret as a byte string
|
||||
std::span<u8> data = {reinterpret_cast<u8*>(f.data.data()), f.data.size() * sizeof(u32)};
|
||||
|
||||
sorted[data] = &f;
|
||||
}
|
||||
|
||||
std::unordered_set<u32> depth_n;
|
||||
|
||||
u32 n_max = 0;
|
||||
|
||||
for (auto&& [bytes, f] : sorted)
|
||||
{
|
||||
{
|
||||
sha1_context ctx;
|
||||
u8 output[20];
|
||||
|
||||
sha1_starts(&ctx);
|
||||
sha1_update(&ctx, bytes.data(), bytes.size());
|
||||
sha1_finish(&ctx, output);
|
||||
fmt::append(dump, "\n\t[%s] ", fmt::base57(output));
|
||||
}
|
||||
|
||||
u32 depth_m = 0;
|
||||
|
||||
for (auto&& [data, f2] : sorted)
|
||||
{
|
||||
u32 depth = 0;
|
||||
|
||||
if (f2 == f)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
for (u32 i = 0; i < bytes.size(); i++)
|
||||
{
|
||||
if (i < data.size() && data[i] == bytes[i])
|
||||
{
|
||||
depth++;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
depth_n.emplace(depth);
|
||||
depth_m = std::max(depth, depth_m);
|
||||
}
|
||||
|
||||
fmt::append(dump, "c=%06d,d=%06d ", depth_n.size(), depth_m);
|
||||
|
||||
bool sk = false;
|
||||
|
||||
for (u32 i = 0; i < std::min<usz>(bytes.size(), std::max<usz>(256, depth_m)); i++)
|
||||
{
|
||||
if (depth_m == i)
|
||||
{
|
||||
dump += '|';
|
||||
sk = true;
|
||||
}
|
||||
|
||||
fmt::append(dump, "%02x", bytes[i]);
|
||||
|
||||
if (i % 4 == 3)
|
||||
{
|
||||
if (sk)
|
||||
{
|
||||
sk = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
dump += ' ';
|
||||
}
|
||||
|
||||
dump += ' ';
|
||||
}
|
||||
}
|
||||
|
||||
fmt::append(dump, "\n\t%49s", "");
|
||||
|
||||
for (u32 i = 0; i < std::min<usz>(f->data.size(), std::max<usz>(64, utils::aligned_div<u32>(depth_m, 4))); i++)
|
||||
{
|
||||
fmt::append(dump, "%-10s", g_spu_iname.decode(std::bit_cast<be_t<u32>>(f->data[i])));
|
||||
}
|
||||
|
||||
n_max = std::max(n_max, ::size32(depth_n));
|
||||
|
||||
depth_n.clear();
|
||||
}
|
||||
|
||||
spu_log.notice("SPU Cache Dump (max_c=%d): %s", n_max, dump);
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize global cache instance
|
||||
@@ -3705,6 +3603,11 @@ spu_program spu_recompiler_base::analyse(const be_t<u32>* ls, u32 entry_point, s
|
||||
|
||||
default:
|
||||
{
|
||||
if (type & spu_itype::zregmod)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
// Unconst
|
||||
const u32 op_rt = type & spu_itype::_quadrop ? +op.rt4 : +op.rt;
|
||||
m_regmod[pos / 4] = op_rt;
|
||||
@@ -7488,6 +7391,7 @@ void spu_recompiler_base::dump(const spu_program& result, std::string& out)
|
||||
SPUDisAsm dis_asm(cpu_disasm_mode::dump, reinterpret_cast<const u8*>(result.data.data()), result.lower_bound);
|
||||
|
||||
std::string hash;
|
||||
be_t<u64> hash_start{};
|
||||
|
||||
if (!result.data.empty())
|
||||
{
|
||||
@@ -7498,6 +7402,7 @@ void spu_recompiler_base::dump(const spu_program& result, std::string& out)
|
||||
sha1_update(&ctx, reinterpret_cast<const u8*>(result.data.data()), result.data.size() * 4);
|
||||
sha1_finish(&ctx, output);
|
||||
fmt::append(hash, "%s", fmt::base57(output));
|
||||
std::memcpy(&hash_start, output, sizeof(hash_start));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -7510,7 +7415,7 @@ void spu_recompiler_base::dump(const spu_program& result, std::string& out)
|
||||
{
|
||||
if (m_block_info[bb.first / 4])
|
||||
{
|
||||
fmt::append(out, "A: [0x%05x] %s\n", bb.first, m_entry_info[bb.first / 4] ? (m_ret_info[bb.first / 4] ? "Chunk" : "Entry") : "Block");
|
||||
fmt::append(out, "A: [0x%05x] %s [%s]\n", bb.first, m_entry_info[bb.first / 4] ? (m_ret_info[bb.first / 4] ? "Chunk" : "Entry") : "Block", spu_block_hash{(hash_start & -65536) + bb.first / 4});
|
||||
|
||||
fmt::append(out, "\t F: 0x%05x\n", bb.second.func);
|
||||
|
||||
|
||||
@@ -903,8 +903,14 @@ public:
|
||||
|
||||
if (auto [is_const, value] = try_get_const_equal_value_array<u32>(+op.ra); is_const)
|
||||
{
|
||||
if (value % 0x200 != 0)
|
||||
{
|
||||
// si10 is overwritten - likely an analysis mistake
|
||||
return;
|
||||
}
|
||||
|
||||
// Comment constant formation
|
||||
comment_constant(last_opcode, value | static_cast<u32>(op.si10));
|
||||
comment_constant(last_opcode, value | static_cast<u32>(op.si10), false);
|
||||
}
|
||||
}
|
||||
void ORHI(spu_opcode_t op)
|
||||
@@ -941,8 +947,14 @@ public:
|
||||
|
||||
if (auto [is_const, value] = try_get_const_equal_value_array<u32>(op.ra); is_const)
|
||||
{
|
||||
if (value % 0x200 != 0)
|
||||
{
|
||||
// si10 is overwritten - likely an analysis mistake
|
||||
return;
|
||||
}
|
||||
|
||||
// Comment constant formation
|
||||
comment_constant(last_opcode, value + static_cast<u32>(op.si10));
|
||||
comment_constant(last_opcode, value + static_cast<u32>(op.si10), false);
|
||||
}
|
||||
}
|
||||
void AHI(spu_opcode_t op)
|
||||
@@ -963,8 +975,14 @@ public:
|
||||
|
||||
if (auto [is_const, value] = try_get_const_equal_value_array<u32>(op.ra); is_const)
|
||||
{
|
||||
if (value % 0x200 != 0)
|
||||
{
|
||||
// si10 is overwritten - likely an analysis mistake
|
||||
return;
|
||||
}
|
||||
|
||||
// Comment constant formation
|
||||
comment_constant(last_opcode, value ^ static_cast<u32>(op.si10));
|
||||
comment_constant(last_opcode, value ^ static_cast<u32>(op.si10), false);
|
||||
}
|
||||
}
|
||||
void XORHI(spu_opcode_t op)
|
||||
|
||||
@@ -2160,6 +2160,14 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
if (bb.preds.size() >= 2)
|
||||
{
|
||||
if (g_cfg.core.spu_prof || g_cfg.core.spu_debug)
|
||||
{
|
||||
m_ir->CreateStore(m_ir->getInt64((m_hash_start & -65536) | (baddr >> 2)), spu_ptr(&spu_thread::block_hash));
|
||||
}
|
||||
}
|
||||
|
||||
// State check at the beginning of the chunk
|
||||
if (need_check || (bi == 0 && g_cfg.core.spu_block_size != spu_block_size_type::safe))
|
||||
{
|
||||
@@ -2802,12 +2810,9 @@ public:
|
||||
std::string& llvm_log = function_log;
|
||||
raw_string_ostream out(llvm_log);
|
||||
|
||||
if (g_cfg.core.spu_debug)
|
||||
{
|
||||
fmt::append(llvm_log, "LLVM IR at 0x%x:\n", func.entry_point);
|
||||
out << *_module; // print IR
|
||||
out << "\n\n";
|
||||
}
|
||||
fmt::append(llvm_log, "LLVM IR at 0x%x:\n", func.entry_point);
|
||||
out << *_module; // print IR
|
||||
out << "\n\n";
|
||||
|
||||
if (verifyModule(*_module, &out))
|
||||
{
|
||||
@@ -3274,12 +3279,9 @@ public:
|
||||
std::string llvm_log;
|
||||
raw_string_ostream out(llvm_log);
|
||||
|
||||
if (g_cfg.core.spu_debug)
|
||||
{
|
||||
fmt::append(llvm_log, "LLVM IR (interpreter):\n");
|
||||
out << *_module; // print IR
|
||||
out << "\n\n";
|
||||
}
|
||||
fmt::append(llvm_log, "LLVM IR (interpreter):\n");
|
||||
out << *_module; // print IR
|
||||
out << "\n\n";
|
||||
|
||||
if (verifyModule(*_module, &out))
|
||||
{
|
||||
|
||||
@@ -164,7 +164,7 @@ void fmt_class_string<spu_block_hash>::format(std::string& out, u64 arg)
|
||||
out.resize(out.size() - 4);
|
||||
|
||||
// Print chunk address from lowest 16 bits
|
||||
fmt::append(out, "...chunk-0x%05x", (arg & 0xffff) * 4);
|
||||
fmt::append(out, "-0x%05x", (arg & 0xffff) * 4);
|
||||
}
|
||||
|
||||
enum class spu_block_hash_short : u64{};
|
||||
|
||||
@@ -59,6 +59,7 @@ CellError lv2_cond::on_id_create()
|
||||
if (!mutex)
|
||||
{
|
||||
_mutex = static_cast<shared_ptr<lv2_obj>>(ensure(idm::get_unlocked<lv2_obj, lv2_mutex>(mtx_id)));
|
||||
mutex = static_cast<lv2_mutex*>(_mutex.get());
|
||||
}
|
||||
|
||||
// Defer function
|
||||
|
||||
@@ -174,20 +174,28 @@ bool lv2_config_service_listener::check_service(const lv2_config_service& servic
|
||||
return true;
|
||||
}
|
||||
|
||||
bool lv2_config_service_listener::notify(const shared_ptr<lv2_config_service_event>& event)
|
||||
{
|
||||
service_events.emplace_back(event);
|
||||
return event->notify();
|
||||
}
|
||||
|
||||
bool lv2_config_service_listener::notify(const shared_ptr<lv2_config_service>& service)
|
||||
{
|
||||
if (!check_service(*service))
|
||||
return false;
|
||||
{
|
||||
std::lock_guard lock(mutex_service_events);
|
||||
|
||||
// Create service event and notify queue!
|
||||
const auto event = lv2_config_service_event::create(handle, service, *this);
|
||||
return notify(event);
|
||||
if (!check_service(*service))
|
||||
return false;
|
||||
|
||||
// Create service event and notify queue!
|
||||
const auto event = lv2_config_service_event::create(handle, service, *this);
|
||||
service_events.emplace_back(event);
|
||||
|
||||
if (!event->notify())
|
||||
{
|
||||
// If we fail to deliver the event to the queue just clean the event up or it'll hold the listener alive forever
|
||||
g_fxo->get<lv2_config>().remove_service_event(event->id);
|
||||
service_events.pop_back();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void lv2_config_service_listener::notify_all()
|
||||
@@ -267,7 +275,7 @@ void lv2_config_service_event::write(sys_config_service_event_t *dst) const
|
||||
{
|
||||
const auto registered = service->is_registered();
|
||||
|
||||
dst->service_listener_handle = listener.get_id();
|
||||
dst->service_listener_handle = listener_id;
|
||||
dst->registered = registered;
|
||||
dst->service_id = service->id;
|
||||
dst->user_id = service->user_id;
|
||||
@@ -346,7 +354,7 @@ error_code sys_config_get_service_event(u32 config_hdl, u32 event_id, vm::ptr<sy
|
||||
|
||||
// Find service_event object
|
||||
const auto event = g_fxo->get<lv2_config>().find_event(event_id);
|
||||
if (!event)
|
||||
if (!event || event->handle != cfg)
|
||||
{
|
||||
return CELL_ESRCH;
|
||||
}
|
||||
|
||||
@@ -296,11 +296,10 @@ private:
|
||||
|
||||
// The service listener owns the service events - service events will not be freed as long as their corresponding listener exists
|
||||
// This has been confirmed to be the case in realhw
|
||||
shared_mutex mutex_service_events;
|
||||
std::vector<shared_ptr<lv2_config_service_event>> service_events;
|
||||
shared_ptr<lv2_config_handle> handle;
|
||||
|
||||
bool notify(const shared_ptr<lv2_config_service_event>& event);
|
||||
|
||||
public:
|
||||
const sys_config_service_id service_id;
|
||||
const u64 min_verbosity;
|
||||
@@ -370,14 +369,14 @@ public:
|
||||
// This has been confirmed to be the case in realhw
|
||||
const shared_ptr<lv2_config_handle> handle;
|
||||
const shared_ptr<lv2_config_service> service;
|
||||
const lv2_config_service_listener& listener;
|
||||
const u32 listener_id;
|
||||
|
||||
// Constructors (should not be used directly)
|
||||
lv2_config_service_event(shared_ptr<lv2_config_handle> _handle, shared_ptr<lv2_config_service> _service, const lv2_config_service_listener& _listener) noexcept
|
||||
: id(get_next_id())
|
||||
, handle(std::move(_handle))
|
||||
, service(std::move(_service))
|
||||
, listener(_listener)
|
||||
, listener_id(_listener.get_id())
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ error_code sys_dbg_write_process_memory(s32 pid, u32 address, u32 size, vm::cptr
|
||||
i += op_size;
|
||||
}
|
||||
|
||||
if (!is_exec || i >= end)
|
||||
if ((!is_exec || i >= end) && exec_update_size > 0)
|
||||
{
|
||||
// Commit executable data update
|
||||
// The read memory is also super ptr so memmove can work correctly on all implementations
|
||||
|
||||
@@ -170,8 +170,7 @@ CellError lv2_event_queue::send(lv2_event event, bool* notified_thread, lv2_even
|
||||
{
|
||||
if (auto cpu = get_current_cpu_thread())
|
||||
{
|
||||
cpu->state += cpu_flag::again;
|
||||
cpu->state += cpu_flag::exit;
|
||||
cpu->state += cpu_flag::again + cpu_flag::exit;
|
||||
}
|
||||
|
||||
sys_event.warning("Ignored event!");
|
||||
@@ -309,6 +308,15 @@ error_code sys_event_queue_destroy(ppu_thread& ppu, u32 equeue_id, s32 mode)
|
||||
return CELL_EBUSY;
|
||||
}
|
||||
|
||||
for (auto cpu = head; cpu; cpu = cpu->get_next_cpu())
|
||||
{
|
||||
if (cpu->state & cpu_flag::again)
|
||||
{
|
||||
ppu.state += cpu_flag::again;
|
||||
return CELL_EAGAIN;
|
||||
}
|
||||
}
|
||||
|
||||
if (!queue.events.empty())
|
||||
{
|
||||
// Copy events for logging, does not empty
|
||||
@@ -321,17 +329,6 @@ error_code sys_event_queue_destroy(ppu_thread& ppu, u32 equeue_id, s32 mode)
|
||||
{
|
||||
qlock.unlock();
|
||||
}
|
||||
else
|
||||
{
|
||||
for (auto cpu = head; cpu; cpu = cpu->get_next_cpu())
|
||||
{
|
||||
if (cpu->state & cpu_flag::again)
|
||||
{
|
||||
ppu.state += cpu_flag::again;
|
||||
return CELL_EAGAIN;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return {};
|
||||
});
|
||||
@@ -621,7 +618,7 @@ error_code sys_event_port_create(cpu_thread& cpu, vm::ptr<u32> eport_id, s32 por
|
||||
|
||||
sys_event.warning("sys_event_port_create(eport_id=*0x%x, port_type=%d, name=0x%llx)", eport_id, port_type, name);
|
||||
|
||||
if (port_type != SYS_EVENT_PORT_LOCAL && port_type != 3)
|
||||
if (port_type != SYS_EVENT_PORT_LOCAL && port_type != SYS_EVENT_PORT_IPC)
|
||||
{
|
||||
sys_event.error("sys_event_port_create(): unknown port type (%d)", port_type);
|
||||
return CELL_EINVAL;
|
||||
@@ -675,8 +672,9 @@ error_code sys_event_port_connect_local(cpu_thread& cpu, u32 eport_id, u32 equeu
|
||||
std::lock_guard lock(id_manager::g_mutex);
|
||||
|
||||
const auto port = idm::check_unlocked<lv2_obj, lv2_event_port>(eport_id);
|
||||
auto queue = idm::get_unlocked<lv2_obj, lv2_event_queue>(equeue_id);
|
||||
|
||||
if (!port || !idm::check_unlocked<lv2_obj, lv2_event_queue>(equeue_id))
|
||||
if (!port || !queue)
|
||||
{
|
||||
return CELL_ESRCH;
|
||||
}
|
||||
@@ -691,7 +689,7 @@ error_code sys_event_port_connect_local(cpu_thread& cpu, u32 eport_id, u32 equeu
|
||||
return CELL_EISCONN;
|
||||
}
|
||||
|
||||
port->queue = idm::get_unlocked<lv2_obj, lv2_event_queue>(equeue_id);
|
||||
port->queue = std::move(queue);
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#include <deque>
|
||||
|
||||
class cpu_thread;
|
||||
class spu_thrread;
|
||||
|
||||
// Event Queue Type
|
||||
enum : u32
|
||||
|
||||
@@ -19,6 +19,22 @@ lv2_event_flag::lv2_event_flag(utils::serial& ar)
|
||||
ar(pattern);
|
||||
}
|
||||
|
||||
// Always set result
|
||||
struct sys_event_store_result
|
||||
{
|
||||
vm::ptr<u64> ptr;
|
||||
u64 val = 0;
|
||||
|
||||
~sys_event_store_result() noexcept
|
||||
{
|
||||
if (ptr)
|
||||
{
|
||||
cpu_thread::get_current()->check_state();
|
||||
*ptr = val;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
std::function<void(void*)> lv2_event_flag::load(utils::serial& ar)
|
||||
{
|
||||
return load_func(make_shared<lv2_event_flag>(stx::exact_t<utils::serial&>(ar)));
|
||||
@@ -120,21 +136,7 @@ error_code sys_event_flag_wait(ppu_thread& ppu, u32 id, u64 bitptn, u32 mode, vm
|
||||
ppu.gpr[5] = mode;
|
||||
ppu.gpr[6] = 0;
|
||||
|
||||
// Always set result
|
||||
struct store_result
|
||||
{
|
||||
vm::ptr<u64> ptr;
|
||||
u64 val = 0;
|
||||
|
||||
~store_result() noexcept
|
||||
{
|
||||
if (ptr)
|
||||
{
|
||||
cpu_thread::get_current()->check_state();
|
||||
*ptr = val;
|
||||
}
|
||||
}
|
||||
} store{result};
|
||||
sys_event_store_result store{result};
|
||||
|
||||
if (!lv2_event_flag::check_mode(mode))
|
||||
{
|
||||
@@ -273,21 +275,7 @@ error_code sys_event_flag_trywait(ppu_thread& ppu, u32 id, u64 bitptn, u32 mode,
|
||||
|
||||
sys_event_flag.trace("sys_event_flag_trywait(id=0x%x, bitptn=0x%llx, mode=0x%x, result=*0x%x)", id, bitptn, mode, result);
|
||||
|
||||
// Always set result
|
||||
struct store_result
|
||||
{
|
||||
vm::ptr<u64> ptr;
|
||||
u64 val = 0;
|
||||
|
||||
~store_result() noexcept
|
||||
{
|
||||
if (ptr)
|
||||
{
|
||||
cpu_thread::get_current()->check_state();
|
||||
*ptr = val;
|
||||
}
|
||||
}
|
||||
} store{result};
|
||||
sys_event_store_result store{result};
|
||||
|
||||
if (!lv2_event_flag::check_mode(mode))
|
||||
{
|
||||
@@ -556,8 +544,6 @@ error_code sys_event_flag_get(ppu_thread& ppu, u32 id, vm::ptr<u64> flags)
|
||||
return +flag.pattern;
|
||||
});
|
||||
|
||||
ppu.check_state();
|
||||
|
||||
if (!flag)
|
||||
{
|
||||
if (flags) *flags = 0;
|
||||
@@ -569,6 +555,8 @@ error_code sys_event_flag_get(ppu_thread& ppu, u32 id, vm::ptr<u64> flags)
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
ppu.check_state();
|
||||
|
||||
*flags = flag.ret;
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@@ -382,10 +382,12 @@ lv2_fs_object::lv2_fs_object(utils::serial& ar, bool)
|
||||
|
||||
u64 lv2_file::op_read(const fs::file& file, vm::ptr<void> buf, u64 size, u64 opt_pos)
|
||||
{
|
||||
if (u64 region = buf.addr() >> 28, region_end = (buf.addr() & 0xfff'ffff) + (size & 0xfff'ffff); region == region_end && ((region >> 28) == 0 || region >= 0xC))
|
||||
if (u64 region = buf.addr() >> 28, region_end = (buf.addr() + size) >> 28;
|
||||
size < u32{umax} && region == region_end && (region == 0 || region == 0xD) && vm::check_addr(buf.addr(), vm::page_writable, static_cast<u32>(size)))
|
||||
{
|
||||
// Optimize reads from safe memory
|
||||
return (opt_pos == umax ? file.read(buf.get_ptr(), size) : file.read_at(opt_pos, buf.get_ptr(), size));
|
||||
const auto buf_ptr = vm::get_super_ptr(buf.addr());
|
||||
return (opt_pos == umax ? file.read(buf_ptr, size) : file.read_at(opt_pos, buf_ptr, size));
|
||||
}
|
||||
|
||||
// Copy data from intermediate buffer (avoid passing vm pointer to a native API)
|
||||
@@ -412,6 +414,14 @@ u64 lv2_file::op_read(const fs::file& file, vm::ptr<void> buf, u64 size, u64 opt
|
||||
|
||||
u64 lv2_file::op_write(const fs::file& file, vm::cptr<void> buf, u64 size)
|
||||
{
|
||||
if (u64 region = buf.addr() >> 28, region_end = (buf.addr() + size) >> 28;
|
||||
size < u32{umax} && region == region_end && (region == 0 || region == 0xD) && vm::check_addr(buf.addr(), vm::page_readable, static_cast<u32>(size)))
|
||||
{
|
||||
// Optimize writes from safe memory
|
||||
const auto buf_ptr = vm::get_super_ptr(buf.addr());
|
||||
return file.write(buf_ptr, size);
|
||||
}
|
||||
|
||||
// Copy data to intermediate buffer (avoid passing vm pointer to a native API)
|
||||
std::vector<uchar> local_buf(std::min<u64>(size, 65536));
|
||||
|
||||
@@ -890,7 +900,7 @@ lv2_file::open_raw_result_t lv2_file::open_raw(const std::string& local_path, s3
|
||||
switch (auto error = fs::g_tls_error)
|
||||
{
|
||||
case fs::error::noent: return {CELL_ENOENT};
|
||||
default: sys_fs.error("lv2_file::open(): unknown error %s", error);
|
||||
default: sys_fs.error("lv2_file::open(): unknown error %s", error); break;
|
||||
}
|
||||
|
||||
return {CELL_EIO};
|
||||
@@ -1035,7 +1045,7 @@ lv2_file::open_result_t lv2_file::open(std::string_view vpath, s32 flags, s32 mo
|
||||
|
||||
error_code sys_fs_open(ppu_thread& ppu, vm::cptr<char> path, s32 flags, vm::ptr<u32> fd, s32 mode, vm::cptr<void> arg, u64 size)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
lv2_obj::sleep(ppu);
|
||||
|
||||
sys_fs.warning("sys_fs_open(path=%s, flags=%#o, fd=*0x%x, mode=%#o, arg=*0x%x, size=0x%llx)", path, flags, fd, mode, arg, size);
|
||||
|
||||
@@ -1083,7 +1093,7 @@ error_code sys_fs_open(ppu_thread& ppu, vm::cptr<char> path, s32 flags, vm::ptr<
|
||||
|
||||
error_code sys_fs_read(ppu_thread& ppu, u32 fd, vm::ptr<void> buf, u64 nbytes, vm::ptr<u64> nread)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
lv2_obj::sleep(ppu);
|
||||
|
||||
sys_fs.trace("sys_fs_read(fd=%d, buf=*0x%x, nbytes=0x%llx, nread=*0x%x)", fd, buf, nbytes, nread);
|
||||
|
||||
@@ -1156,7 +1166,7 @@ error_code sys_fs_read(ppu_thread& ppu, u32 fd, vm::ptr<void> buf, u64 nbytes, v
|
||||
|
||||
error_code sys_fs_write(ppu_thread& ppu, u32 fd, vm::cptr<void> buf, u64 nbytes, vm::ptr<u64> nwrite)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
lv2_obj::sleep(ppu);
|
||||
|
||||
sys_fs.trace("sys_fs_write(fd=%d, buf=*0x%x, nbytes=0x%llx, nwrite=*0x%x)", fd, buf, nbytes, nwrite);
|
||||
|
||||
@@ -1238,7 +1248,7 @@ error_code sys_fs_write(ppu_thread& ppu, u32 fd, vm::cptr<void> buf, u64 nbytes,
|
||||
|
||||
error_code sys_fs_close(ppu_thread& ppu, u32 fd)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
lv2_obj::sleep(ppu);
|
||||
|
||||
const auto file = idm::get_unlocked<lv2_fs_object, lv2_file>(fd);
|
||||
|
||||
@@ -1314,7 +1324,7 @@ error_code sys_fs_close(ppu_thread& ppu, u32 fd)
|
||||
|
||||
error_code sys_fs_opendir(ppu_thread& ppu, vm::cptr<char> path, vm::ptr<u32> fd)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
lv2_obj::sleep(ppu);
|
||||
|
||||
sys_fs.warning("sys_fs_opendir(path=%s, fd=*0x%x)", path, fd);
|
||||
|
||||
@@ -1391,7 +1401,8 @@ error_code sys_fs_opendir(ppu_thread& ppu, vm::cptr<char> path, vm::ptr<u32> fd)
|
||||
// Add additional entries for split file candidates (while ends with .66600)
|
||||
while (mp.mp != &g_mp_sys_dev_hdd1 && data.back().name.ends_with(".66600"))
|
||||
{
|
||||
data.emplace_back(data.back()).name.resize(data.back().name.size() - 6);
|
||||
fs::dir_entry copy = data.back();
|
||||
data.emplace_back(copy).name.resize(copy.name.size() - 6);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1433,7 +1444,7 @@ error_code sys_fs_opendir(ppu_thread& ppu, vm::cptr<char> path, vm::ptr<u32> fd)
|
||||
|
||||
error_code sys_fs_readdir(ppu_thread& ppu, u32 fd, vm::ptr<CellFsDirent> dir, vm::ptr<u64> nread)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
lv2_obj::sleep(ppu);
|
||||
|
||||
sys_fs.warning("sys_fs_readdir(fd=%d, dir=*0x%x, nread=*0x%x)", fd, dir, nread);
|
||||
|
||||
@@ -1490,7 +1501,7 @@ error_code sys_fs_readdir(ppu_thread& ppu, u32 fd, vm::ptr<CellFsDirent> dir, vm
|
||||
|
||||
error_code sys_fs_closedir(ppu_thread& ppu, u32 fd)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
lv2_obj::sleep(ppu);
|
||||
|
||||
sys_fs.warning("sys_fs_closedir(fd=%d)", fd);
|
||||
|
||||
@@ -1504,7 +1515,6 @@ error_code sys_fs_closedir(ppu_thread& ppu, u32 fd)
|
||||
|
||||
error_code sys_fs_stat(ppu_thread& ppu, vm::cptr<char> path, vm::ptr<CellFsStat> sb)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
lv2_obj::sleep(ppu);
|
||||
|
||||
sys_fs.warning("sys_fs_stat(path=%s, sb=*0x%x)", path, sb);
|
||||
@@ -1618,7 +1628,7 @@ error_code sys_fs_stat(ppu_thread& ppu, vm::cptr<char> path, vm::ptr<CellFsStat>
|
||||
|
||||
error_code sys_fs_fstat(ppu_thread& ppu, u32 fd, vm::ptr<CellFsStat> sb)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
lv2_obj::sleep(ppu);
|
||||
|
||||
sys_fs.warning("sys_fs_fstat(fd=%d, sb=*0x%x)", fd, sb);
|
||||
|
||||
@@ -1673,7 +1683,7 @@ error_code sys_fs_link(ppu_thread&, vm::cptr<char> from, vm::cptr<char> to)
|
||||
|
||||
error_code sys_fs_mkdir(ppu_thread& ppu, vm::cptr<char> path, s32 mode)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
lv2_obj::sleep(ppu);
|
||||
|
||||
sys_fs.warning("sys_fs_mkdir(path=%s, mode=%#o)", path, mode);
|
||||
|
||||
@@ -1734,7 +1744,7 @@ error_code sys_fs_mkdir(ppu_thread& ppu, vm::cptr<char> path, s32 mode)
|
||||
|
||||
error_code sys_fs_rename(ppu_thread& ppu, vm::cptr<char> from, vm::cptr<char> to)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
lv2_obj::sleep(ppu);
|
||||
|
||||
sys_fs.warning("sys_fs_rename(from=%s, to=%s)", from, to);
|
||||
|
||||
@@ -1799,7 +1809,7 @@ error_code sys_fs_rename(ppu_thread& ppu, vm::cptr<char> from, vm::cptr<char> to
|
||||
|
||||
error_code sys_fs_rmdir(ppu_thread& ppu, vm::cptr<char> path)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
lv2_obj::sleep(ppu);
|
||||
|
||||
sys_fs.warning("sys_fs_rmdir(path=%s)", path);
|
||||
|
||||
@@ -1854,7 +1864,7 @@ error_code sys_fs_rmdir(ppu_thread& ppu, vm::cptr<char> path)
|
||||
|
||||
error_code sys_fs_unlink(ppu_thread& ppu, vm::cptr<char> path)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
lv2_obj::sleep(ppu);
|
||||
|
||||
sys_fs.warning("sys_fs_unlink(path=%s)", path);
|
||||
|
||||
@@ -1919,7 +1929,7 @@ error_code sys_fs_access(ppu_thread&, vm::cptr<char> path, s32 mode)
|
||||
|
||||
error_code sys_fs_fcntl(ppu_thread& ppu, u32 fd, u32 op, vm::ptr<void> _arg, u32 _size)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
lv2_obj::sleep(ppu);
|
||||
|
||||
sys_fs.trace("sys_fs_fcntl(fd=%d, op=0x%x, arg=*0x%x, size=0x%x)", fd, op, _arg, _size);
|
||||
|
||||
@@ -2148,6 +2158,7 @@ error_code sys_fs_fcntl(ppu_thread& ppu, u32 fd, u32 op, vm::ptr<void> _arg, u32
|
||||
sys_fs.notice("sys_fs_fcntl(0xc0000006): %s", vpath);
|
||||
|
||||
// Check only mountpoint
|
||||
vpath = vpath.substr(0, vpath.find_first_of('\0'));
|
||||
vpath = vpath.substr(0, vpath.find_first_of("/", 1));
|
||||
|
||||
// Some mountpoints seem to be handled specially
|
||||
@@ -2591,7 +2602,7 @@ error_code sys_fs_fcntl(ppu_thread& ppu, u32 fd, u32 op, vm::ptr<void> _arg, u32
|
||||
|
||||
error_code sys_fs_lseek(ppu_thread& ppu, u32 fd, s64 offset, s32 whence, vm::ptr<u64> pos)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
lv2_obj::sleep(ppu);
|
||||
|
||||
sys_fs.trace("sys_fs_lseek(fd=%d, offset=0x%llx, whence=0x%x, pos=*0x%x)", fd, offset, whence, pos);
|
||||
|
||||
@@ -2636,8 +2647,6 @@ error_code sys_fs_lseek(ppu_thread& ppu, u32 fd, s64 offset, s32 whence, vm::ptr
|
||||
|
||||
error_code sys_fs_fdatasync(ppu_thread& ppu, u32 fd)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
|
||||
sys_fs.trace("sys_fs_fdadasync(fd=%d)", fd);
|
||||
|
||||
const auto file = idm::get_unlocked<lv2_fs_object, lv2_file>(fd);
|
||||
@@ -2662,8 +2671,6 @@ error_code sys_fs_fdatasync(ppu_thread& ppu, u32 fd)
|
||||
|
||||
error_code sys_fs_fsync(ppu_thread& ppu, u32 fd)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
|
||||
sys_fs.trace("sys_fs_fsync(fd=%d)", fd);
|
||||
|
||||
const auto file = idm::get_unlocked<lv2_fs_object, lv2_file>(fd);
|
||||
@@ -2688,7 +2695,7 @@ error_code sys_fs_fsync(ppu_thread& ppu, u32 fd)
|
||||
|
||||
error_code sys_fs_fget_block_size(ppu_thread& ppu, u32 fd, vm::ptr<u64> sector_size, vm::ptr<u64> block_size, vm::ptr<u64> arg4, vm::ptr<s32> out_flags)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
lv2_obj::sleep(ppu);
|
||||
|
||||
sys_fs.warning("sys_fs_fget_block_size(fd=%d, sector_size=*0x%x, block_size=*0x%x, arg4=*0x%x, out_flags=*0x%x)", fd, sector_size, block_size, arg4, out_flags);
|
||||
|
||||
@@ -2712,7 +2719,7 @@ error_code sys_fs_fget_block_size(ppu_thread& ppu, u32 fd, vm::ptr<u64> sector_s
|
||||
|
||||
error_code sys_fs_get_block_size(ppu_thread& ppu, vm::cptr<char> path, vm::ptr<u64> sector_size, vm::ptr<u64> block_size, vm::ptr<u64> arg4)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
lv2_obj::sleep(ppu);
|
||||
|
||||
sys_fs.warning("sys_fs_get_block_size(path=%s, sector_size=*0x%x, block_size=*0x%x, arg4=*0x%x)", path, sector_size, block_size, arg4);
|
||||
|
||||
@@ -2762,7 +2769,7 @@ error_code sys_fs_get_block_size(ppu_thread& ppu, vm::cptr<char> path, vm::ptr<u
|
||||
|
||||
error_code sys_fs_truncate(ppu_thread& ppu, vm::cptr<char> path, u64 size)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
lv2_obj::sleep(ppu);
|
||||
|
||||
sys_fs.warning("sys_fs_truncate(path=%s, size=0x%llx)", path, size);
|
||||
|
||||
@@ -2813,7 +2820,7 @@ error_code sys_fs_truncate(ppu_thread& ppu, vm::cptr<char> path, u64 size)
|
||||
|
||||
error_code sys_fs_ftruncate(ppu_thread& ppu, u32 fd, u64 size)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
lv2_obj::sleep(ppu);
|
||||
|
||||
sys_fs.warning("sys_fs_ftruncate(fd=%d, size=0x%llx)", fd, size);
|
||||
|
||||
@@ -2904,14 +2911,6 @@ error_code sys_fs_chmod(ppu_thread&, vm::cptr<char> path, s32 mode)
|
||||
{
|
||||
// Try to locate split files
|
||||
|
||||
for (u32 i = 66601; i <= 66699; i++)
|
||||
{
|
||||
if (mp != &g_mp_sys_dev_hdd1 && !fs::get_stat(fmt::format("%s.%u", local_path, i), info) && !info.is_directory)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (fs::get_stat(local_path + ".66600", info) && !info.is_directory)
|
||||
{
|
||||
break;
|
||||
@@ -2939,7 +2938,6 @@ error_code sys_fs_chown(ppu_thread&, vm::cptr<char> path, s32 uid, s32 gid)
|
||||
|
||||
error_code sys_fs_disk_free(ppu_thread& ppu, vm::cptr<char> path, vm::ptr<u64> total_free, vm::ptr<u64> avail_free)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
lv2_obj::sleep(ppu);
|
||||
|
||||
sys_fs.warning("sys_fs_disk_free(path=%s total_free=*0x%x avail_free=*0x%x)", path, total_free, avail_free);
|
||||
@@ -3018,7 +3016,7 @@ error_code sys_fs_disk_free(ppu_thread& ppu, vm::cptr<char> path, vm::ptr<u64> t
|
||||
|
||||
error_code sys_fs_utime(ppu_thread& ppu, vm::cptr<char> path, vm::cptr<CellFsUtimbuf> timep)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
lv2_obj::sleep(ppu);
|
||||
|
||||
sys_fs.warning("sys_fs_utime(path=%s, timep=*0x%x)", path, timep);
|
||||
sys_fs.warning("** actime=%u, modtime=%u", timep->actime, timep->modtime);
|
||||
@@ -3215,7 +3213,7 @@ error_code sys_fs_get_mount_info(ppu_thread&, vm::ptr<CellFsMountInfo> info, u64
|
||||
|
||||
error_code sys_fs_newfs(ppu_thread& ppu, vm::cptr<char> dev_name, vm::cptr<char> file_system, s32 unk1, vm::cptr<char> str1)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
lv2_obj::sleep(ppu);
|
||||
|
||||
sys_fs.warning("sys_fs_newfs(dev_name=%s, file_system=%s, unk1=0x%x, str1=%s)", dev_name, file_system, unk1, str1);
|
||||
|
||||
@@ -3263,7 +3261,7 @@ error_code sys_fs_newfs(ppu_thread& ppu, vm::cptr<char> dev_name, vm::cptr<char>
|
||||
|
||||
error_code sys_fs_mount(ppu_thread& ppu, vm::cptr<char> dev_name, vm::cptr<char> file_system, vm::cptr<char> path, s32 unk1, s32 prot, s32 unk2, vm::cptr<char> str1, u32 str_len)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
lv2_obj::sleep(ppu);
|
||||
|
||||
sys_fs.warning("sys_fs_mount(dev_name=%s, file_system=%s, path=%s, unk1=0x%x, prot=%d, unk3=0x%x, str1=%s, str_len=%d)", dev_name, file_system, path, unk1, prot, unk2, str1, str_len);
|
||||
|
||||
@@ -3366,7 +3364,7 @@ error_code sys_fs_mount(ppu_thread& ppu, vm::cptr<char> dev_name, vm::cptr<char>
|
||||
|
||||
error_code sys_fs_unmount(ppu_thread& ppu, vm::cptr<char> path, s32 unk1, s32 force)
|
||||
{
|
||||
ppu.state += cpu_flag::wait;
|
||||
lv2_obj::sleep(ppu);
|
||||
|
||||
sys_fs.warning("sys_fs_unmount(path=%s, unk1=0x%x, force=%d)", path, unk1, force);
|
||||
|
||||
|
||||
@@ -487,6 +487,8 @@ error_code _sys_lwcond_queue_wait(ppu_thread& ppu, u32 lwcond_id, u32 lwmutex_id
|
||||
{
|
||||
ensure(cond.unqueue(cond.sq, &ppu));
|
||||
ppu.state += cpu_flag::again;
|
||||
cond.lwmutex_waiters--;
|
||||
mutex->lwcond_waiters--;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -333,7 +333,7 @@ error_code sys_mmapper_allocate_shared_memory_ext(ppu_thread& ppu, u64 ipc_key,
|
||||
}
|
||||
}
|
||||
|
||||
if (flags & ~SYS_MEMORY_PAGE_SIZE_MASK)
|
||||
if (flags & ~SYS_MEMORY_GRANULARITY_MASK)
|
||||
{
|
||||
return CELL_EINVAL;
|
||||
}
|
||||
@@ -401,6 +401,11 @@ error_code sys_mmapper_allocate_shared_memory_from_container_ext(ppu_thread& ppu
|
||||
sys_mmapper.todo("sys_mmapper_allocate_shared_memory_from_container_ext(ipc_key=0x%x, size=0x%x, flags=0x%x, cid=0x%x, entries=*0x%x, entry_count=0x%x, mem_id=*0x%x)", ipc_key, size, flags, cid, entries,
|
||||
entry_count, mem_id);
|
||||
|
||||
if (size == 0)
|
||||
{
|
||||
return CELL_EALIGN;
|
||||
}
|
||||
|
||||
switch (flags & SYS_MEMORY_PAGE_SIZE_MASK)
|
||||
{
|
||||
case SYS_MEMORY_PAGE_SIZE_1M:
|
||||
@@ -546,8 +551,7 @@ error_code sys_mmapper_free_address(ppu_thread& ppu, u32 addr)
|
||||
|
||||
// If a memory block is freed, remove it from page notification table.
|
||||
auto& pf_entries = g_fxo->get<page_fault_notification_entries>();
|
||||
std::lock_guard lock(pf_entries.mutex);
|
||||
|
||||
std::unique_lock lock(pf_entries.mutex);
|
||||
auto ind_to_remove = pf_entries.entries.begin();
|
||||
for (; ind_to_remove != pf_entries.entries.end(); ++ind_to_remove)
|
||||
{
|
||||
@@ -558,7 +562,11 @@ error_code sys_mmapper_free_address(ppu_thread& ppu, u32 addr)
|
||||
}
|
||||
if (ind_to_remove != pf_entries.entries.end())
|
||||
{
|
||||
u32 port_id = ind_to_remove->port_id;
|
||||
pf_entries.entries.erase(ind_to_remove);
|
||||
lock.unlock();
|
||||
sys_event_port_disconnect(ppu, port_id);
|
||||
sys_event_port_destroy(ppu, port_id);
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
@@ -826,7 +834,6 @@ error_code sys_mmapper_enable_page_fault_notification(ppu_thread& ppu, u32 start
|
||||
|
||||
vm::var<u32> port_id(0);
|
||||
error_code res = sys_event_port_create(ppu, port_id, SYS_EVENT_PORT_LOCAL, SYS_MEMORY_PAGE_FAULT_EVENT_KEY);
|
||||
sys_event_port_connect_local(ppu, *port_id, event_queue_id);
|
||||
|
||||
if (res + 0u == CELL_EAGAIN)
|
||||
{
|
||||
@@ -834,6 +841,8 @@ error_code sys_mmapper_enable_page_fault_notification(ppu_thread& ppu, u32 start
|
||||
return CELL_EAGAIN;
|
||||
}
|
||||
|
||||
sys_event_port_connect_local(ppu, *port_id, event_queue_id);
|
||||
|
||||
auto& pf_entries = g_fxo->get<page_fault_notification_entries>();
|
||||
std::unique_lock lock(pf_entries.mutex);
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ error_code sys_mutex_create(ppu_thread& ppu, vm::ptr<u32> mutex_id, vm::ptr<sys_
|
||||
sys_mutex.todo("sys_mutex_create(): unexpected adaptive (0x%x)", _attr.adaptive);
|
||||
}
|
||||
|
||||
if (auto error = lv2_obj::create<lv2_mutex>(_attr.pshared, _attr.ipc_key, _attr.flags, [&]()
|
||||
if (auto error = lv2_obj::create<lv2_mutex>(_attr.pshared, ipc_key, _attr.flags, [&]()
|
||||
{
|
||||
return make_shared<lv2_mutex>(
|
||||
_attr.protocol,
|
||||
|
||||
@@ -173,7 +173,11 @@ struct lv2_mutex final : lv2_obj
|
||||
|
||||
if (sq == data.sq)
|
||||
{
|
||||
atomic_storage<u32>::release(control.raw().owner, res->id);
|
||||
if (cpu_flag::again - res->state)
|
||||
{
|
||||
atomic_storage<u32>::release(control.raw().owner, res->id);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -563,37 +563,34 @@ error_code sys_net_bnet_connect(ppu_thread& ppu, s32 s, vm::ptr<sys_net_sockaddr
|
||||
return not_an_error(result);
|
||||
}
|
||||
|
||||
if (!sock.ret)
|
||||
while (auto state = ppu.state.fetch_sub(cpu_flag::signal))
|
||||
{
|
||||
while (auto state = ppu.state.fetch_sub(cpu_flag::signal))
|
||||
if (is_stopped(state))
|
||||
{
|
||||
if (is_stopped(state))
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
if (state & cpu_flag::signal)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
ppu.state.wait(state);
|
||||
return {};
|
||||
}
|
||||
|
||||
if (ppu.gpr[3] == static_cast<u64>(-SYS_NET_EINTR))
|
||||
if (state & cpu_flag::signal)
|
||||
{
|
||||
return -SYS_NET_EINTR;
|
||||
break;
|
||||
}
|
||||
|
||||
if (result)
|
||||
{
|
||||
if (result < 0)
|
||||
{
|
||||
return sys_net_error{result};
|
||||
}
|
||||
ppu.state.wait(state);
|
||||
}
|
||||
|
||||
return not_an_error(result);
|
||||
if (ppu.gpr[3] == static_cast<u64>(-SYS_NET_EINTR))
|
||||
{
|
||||
return -SYS_NET_EINTR;
|
||||
}
|
||||
|
||||
if (result)
|
||||
{
|
||||
if (result < 0)
|
||||
{
|
||||
return sys_net_error{result};
|
||||
}
|
||||
|
||||
return not_an_error(result);
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
@@ -992,7 +989,7 @@ error_code sys_net_bnet_sendto(ppu_thread& ppu, s32 s, vm::cptr<void> buf, u32 l
|
||||
fmt::throw_exception("sys_net_bnet_sendto(s=%d): unknown flags (0x%x)", flags);
|
||||
}
|
||||
|
||||
if (addr && addrlen < 8)
|
||||
if (addr && addrlen < sizeof(sys_net_sockaddr))
|
||||
{
|
||||
sys_net.error("sys_net_bnet_sendto(s=%d): bad addrlen (%u)", s, addrlen);
|
||||
return -SYS_NET_EINVAL;
|
||||
@@ -1295,7 +1292,7 @@ error_code sys_net_bnet_poll(ppu_thread& ppu, vm::ptr<sys_net_pollfd> fds, s32 n
|
||||
|
||||
if (auto sock = idm::check_unlocked<lv2_socket>(fds_buf[i].fd))
|
||||
{
|
||||
signaled += sock->poll(fds_buf[i], _fds[i]);
|
||||
sock->poll(fds_buf[i], _fds[i]);
|
||||
#ifdef _WIN32
|
||||
connecting[i] = sock->is_connecting();
|
||||
#endif
|
||||
@@ -1303,7 +1300,6 @@ error_code sys_net_bnet_poll(ppu_thread& ppu, vm::ptr<sys_net_pollfd> fds, s32 n
|
||||
else
|
||||
{
|
||||
fds_buf[i].revents |= SYS_NET_POLLNVAL;
|
||||
signaled++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1536,9 +1532,9 @@ error_code sys_net_bnet_select(ppu_thread& ppu, s32 nfds, vm::ptr<sys_net_fd_set
|
||||
for (s32 i = 0; i < nfds; i++)
|
||||
{
|
||||
bool sig = false;
|
||||
if (_fds[i].revents & (POLLIN | POLLHUP | POLLERR))
|
||||
if ((_fds[i].revents & (POLLIN | POLLHUP | POLLERR)) && _readfds.bit(i))
|
||||
sig = true, rread.set(i);
|
||||
if (_fds[i].revents & (POLLOUT | POLLERR))
|
||||
if ((_fds[i].revents & (POLLOUT | POLLERR)) && _writefds.bit(i))
|
||||
sig = true, rwrite.set(i);
|
||||
|
||||
if (sig)
|
||||
|
||||
@@ -107,7 +107,7 @@ enum lv2_ip_option : s32
|
||||
SYS_NET_IP_MULTICAST_LOOP = 11,
|
||||
SYS_NET_IP_ADD_MEMBERSHIP = 12,
|
||||
SYS_NET_IP_DROP_MEMBERSHIP = 13,
|
||||
SYS_NET_IP_TTLCHK = 23,
|
||||
SYS_NET_IP_TTLCHK = 23, // This is probably the equivalent of IP_MINTTL on FreeBSD
|
||||
SYS_NET_IP_MAXTTL = 24,
|
||||
SYS_NET_IP_DONTFRAG = 26
|
||||
};
|
||||
|
||||
@@ -104,7 +104,7 @@ public:
|
||||
virtual void close() = 0;
|
||||
virtual s32 shutdown(s32 how) = 0;
|
||||
|
||||
virtual s32 poll(sys_net_pollfd& sn_pfd, pollfd& native_pfd) = 0;
|
||||
virtual void poll(sys_net_pollfd& sn_pfd, pollfd& native_pfd) = 0;
|
||||
virtual std::tuple<bool, bool, bool> select(bs_t<poll_t> selected, pollfd& native_pfd) = 0;
|
||||
|
||||
error_code abort_socket(s32 flags);
|
||||
|
||||
@@ -551,12 +551,14 @@ std::tuple<s32, lv2_socket::sockopt_data, u32> lv2_socket_native::getsockopt(s32
|
||||
}
|
||||
case SYS_NET_IP_TTLCHK:
|
||||
{
|
||||
sys_net.error("sys_net_bnet_getsockopt(IPPROTO_IP, SYS_NET_IP_TTLCHK): stubbed option");
|
||||
out_val._int = min_ttl;
|
||||
out_len = sizeof(s32);
|
||||
return {CELL_OK, out_val, out_len};
|
||||
}
|
||||
case SYS_NET_IP_MAXTTL:
|
||||
{
|
||||
sys_net.error("sys_net_bnet_getsockopt(IPPROTO_IP, SYS_NET_IP_MAXTTL): stubbed option");
|
||||
out_val._int = max_ttl;
|
||||
out_len = sizeof(s32);
|
||||
return {CELL_OK, out_val, out_len};
|
||||
}
|
||||
case SYS_NET_IP_DONTFRAG:
|
||||
@@ -834,13 +836,13 @@ s32 lv2_socket_native::setsockopt(s32 level, s32 optname, const std::vector<u8>&
|
||||
}
|
||||
case SYS_NET_IP_TTLCHK:
|
||||
{
|
||||
sys_net.error("sys_net_bnet_setsockopt(s=%d, IPPROTO_IP): Stubbed option (0x%x) (SYS_NET_IP_TTLCHK)", lv2_id, optname);
|
||||
break;
|
||||
min_ttl = native_int;
|
||||
return {};
|
||||
}
|
||||
case SYS_NET_IP_MAXTTL:
|
||||
{
|
||||
sys_net.error("sys_net_bnet_setsockopt(s=%d, IPPROTO_IP): Stubbed option (0x%x) (SYS_NET_IP_MAXTTL)", lv2_id, optname);
|
||||
break;
|
||||
max_ttl = native_int;
|
||||
return {};
|
||||
}
|
||||
case SYS_NET_IP_DONTFRAG:
|
||||
{
|
||||
@@ -910,7 +912,7 @@ std::optional<std::tuple<s32, std::vector<u8>, sys_net_sockaddr>> lv2_socket_nat
|
||||
{
|
||||
auto& nph = g_fxo->get<named_thread<np::np_handler>>();
|
||||
const auto packet = dnshook.get_dns_packet(lv2_id);
|
||||
ensure(packet.size() < len);
|
||||
ensure(packet.size() <= len);
|
||||
memcpy(res_buf.data(), packet.data(), packet.size());
|
||||
native_addr.ss_family = AF_INET;
|
||||
(reinterpret_cast<::sockaddr_in*>(&native_addr))->sin_port = std::bit_cast<u16, be_t<u16>>(53); // htons(53)
|
||||
@@ -1069,18 +1071,20 @@ std::optional<s32> lv2_socket_native::sendmsg(s32 flags, const sys_net_msghdr& m
|
||||
return {-SYS_NET_ECONNRESET};
|
||||
}
|
||||
|
||||
std::vector<u8> buf_copy;
|
||||
for (int i = 0; i < msg.msg_iovlen; i++)
|
||||
{
|
||||
auto iov_base = msg.msg_iov[i].iov_base;
|
||||
const u32 len = msg.msg_iov[i].iov_len;
|
||||
const std::vector<u8> buf_copy(vm::_ptr<const char>(iov_base.addr()), vm::_ptr<const char>(iov_base.addr()) + len);
|
||||
const auto* src = vm::_ptr<const char>(iov_base.addr());
|
||||
buf_copy.insert(buf_copy.end(), src, src + len);
|
||||
}
|
||||
|
||||
native_result = ::send(native_socket, reinterpret_cast<const char*>(buf_copy.data()), ::narrow<int>(buf_copy.size()), native_flags);
|
||||
native_result = ::send(native_socket, reinterpret_cast<const char*>(buf_copy.data()), ::narrow<int>(buf_copy.size()), native_flags);
|
||||
|
||||
if (native_result >= 0)
|
||||
{
|
||||
return {native_result};
|
||||
}
|
||||
if (native_result >= 0)
|
||||
{
|
||||
return {native_result};
|
||||
}
|
||||
|
||||
result = get_last_error(!so_nbio && (flags & SYS_NET_MSG_DONTWAIT) == 0);
|
||||
@@ -1143,14 +1147,14 @@ s32 lv2_socket_native::shutdown(s32 how)
|
||||
return -get_last_error(false);
|
||||
}
|
||||
|
||||
s32 lv2_socket_native::poll(sys_net_pollfd& sn_pfd, pollfd& native_pfd)
|
||||
void lv2_socket_native::poll(sys_net_pollfd& sn_pfd, pollfd& native_pfd)
|
||||
{
|
||||
// Check for fake packet for dns interceptions
|
||||
auto& dnshook = g_fxo->get<np::dnshook>();
|
||||
if (sn_pfd.events & SYS_NET_POLLIN && dnshook.is_dns(sn_pfd.fd) && dnshook.is_dns_queue(sn_pfd.fd))
|
||||
{
|
||||
sn_pfd.revents |= SYS_NET_POLLIN;
|
||||
return 1;
|
||||
return;
|
||||
}
|
||||
if (sn_pfd.events & ~(SYS_NET_POLLIN | SYS_NET_POLLOUT | SYS_NET_POLLERR))
|
||||
{
|
||||
@@ -1167,8 +1171,6 @@ s32 lv2_socket_native::poll(sys_net_pollfd& sn_pfd, pollfd& native_pfd)
|
||||
{
|
||||
native_pfd.events |= POLLOUT;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::tuple<bool, bool, bool> lv2_socket_native::select(bs_t<lv2_socket::poll_t> selected, pollfd& native_pfd)
|
||||
@@ -1232,16 +1234,16 @@ bool lv2_socket_native::is_socket_connected()
|
||||
return false;
|
||||
}
|
||||
|
||||
fd_set readfds, writefds;
|
||||
struct timeval timeout{0, 0}; // Zero timeout
|
||||
pollfd pfd{};
|
||||
pfd.fd = native_socket;
|
||||
pfd.events = POLLIN | POLLOUT;
|
||||
|
||||
FD_ZERO(&readfds);
|
||||
FD_ZERO(&writefds);
|
||||
FD_SET(native_socket, &readfds);
|
||||
FD_SET(native_socket, &writefds);
|
||||
|
||||
// Use select to check for readability and writability
|
||||
const int result = ::select(1, &readfds, &writefds, NULL, &timeout);
|
||||
// Use poll to check for readability and writability
|
||||
#ifdef _WIN32
|
||||
const int result = WSAPoll(&pfd, 1, 0);
|
||||
#else
|
||||
const int result = ::poll(&pfd, 1, 0);
|
||||
#endif
|
||||
|
||||
if (result < 0)
|
||||
{
|
||||
@@ -1250,5 +1252,5 @@ bool lv2_socket_native::is_socket_connected()
|
||||
}
|
||||
|
||||
// Socket is connected if it's readable or writable
|
||||
return FD_ISSET(native_socket, &readfds) || FD_ISSET(native_socket, &writefds);
|
||||
return (pfd.revents & (POLLIN | POLLOUT)) != 0;
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ public:
|
||||
std::optional<s32> sendto(s32 flags, const std::vector<u8>& buf, std::optional<sys_net_sockaddr> opt_sn_addr, bool is_lock = true) override;
|
||||
std::optional<s32> sendmsg(s32 flags, const sys_net_msghdr& msg, bool is_lock = true) override;
|
||||
|
||||
s32 poll(sys_net_pollfd& sn_pfd, pollfd& native_pfd) override;
|
||||
void poll(sys_net_pollfd& sn_pfd, pollfd& native_pfd) override;
|
||||
std::tuple<bool, bool, bool> select(bs_t<poll_t> selected, pollfd& native_pfd) override;
|
||||
|
||||
bool is_socket_connected();
|
||||
@@ -70,6 +70,10 @@ private:
|
||||
s32 so_reuseaddr = 0;
|
||||
s32 so_reuseport = 0;
|
||||
#endif
|
||||
// Those values come from FreeBSD
|
||||
s32 min_ttl = 1;
|
||||
s32 max_ttl = 64;
|
||||
|
||||
u16 bound_port = 0;
|
||||
bool feign_tcp_conn_failure = false; // Savestate load related
|
||||
};
|
||||
|
||||
@@ -364,7 +364,7 @@ s32 lv2_socket_p2p::shutdown([[maybe_unused]] s32 how)
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 lv2_socket_p2p::poll(sys_net_pollfd& sn_pfd, [[maybe_unused]] pollfd& native_pfd)
|
||||
void lv2_socket_p2p::poll(sys_net_pollfd& sn_pfd, [[maybe_unused]] pollfd& native_pfd)
|
||||
{
|
||||
std::lock_guard lock(mutex);
|
||||
ensure(vport);
|
||||
@@ -381,8 +381,6 @@ s32 lv2_socket_p2p::poll(sys_net_pollfd& sn_pfd, [[maybe_unused]] pollfd& native
|
||||
{
|
||||
sn_pfd.revents |= SYS_NET_POLLOUT;
|
||||
}
|
||||
|
||||
return sn_pfd.revents ? 1 : 0;
|
||||
}
|
||||
|
||||
std::tuple<bool, bool, bool> lv2_socket_p2p::select(bs_t<lv2_socket::poll_t> selected, [[maybe_unused]] pollfd& native_pfd)
|
||||
|
||||
@@ -30,7 +30,7 @@ public:
|
||||
void close() override;
|
||||
s32 shutdown(s32 how) override;
|
||||
|
||||
s32 poll(sys_net_pollfd& sn_pfd, pollfd& native_pfd) override;
|
||||
void poll(sys_net_pollfd& sn_pfd, pollfd& native_pfd) override;
|
||||
std::tuple<bool, bool, bool> select(bs_t<poll_t> selected, pollfd& native_pfd) override;
|
||||
|
||||
void handle_new_data(sys_net_sockaddr_in_p2p p2p_addr, std::vector<u8> p2p_data);
|
||||
|
||||
@@ -112,7 +112,6 @@ public:
|
||||
|
||||
// reply is late, increases rtt
|
||||
auto& msg = it->second;
|
||||
const auto addr = msg.dst_addr.sin_addr.s_addr;
|
||||
rtt_info rtt = rtts[msg.sock_id];
|
||||
// Only increases rtt once per loop(in case a big number of packets are sent at once)
|
||||
if (!rtt_increased.count(msg.sock_id))
|
||||
@@ -120,7 +119,7 @@ public:
|
||||
rtt.num_retries += 1;
|
||||
// Increases current rtt by 10%
|
||||
rtt.rtt_time += (rtt.rtt_time / 10);
|
||||
rtts[addr] = rtt;
|
||||
rtts[msg.sock_id] = rtt;
|
||||
|
||||
rtt_increased.emplace(msg.sock_id);
|
||||
}
|
||||
@@ -625,7 +624,7 @@ std::tuple<bool, s32, shared_ptr<lv2_socket>, sys_net_sockaddr> lv2_socket_p2ps:
|
||||
sys_net_sockaddr ps3_addr{};
|
||||
auto* paddr = reinterpret_cast<sys_net_sockaddr_in_p2p*>(&ps3_addr);
|
||||
|
||||
lv2_socket_p2ps* sock_client = reinterpret_cast<lv2_socket_p2ps*>(idm::check_unlocked<lv2_socket>(p2ps_client));
|
||||
auto sock_client = static_cast<shared_ptr<lv2_socket_p2ps>>(idm::get_unlocked<lv2_socket>(p2ps_client));
|
||||
{
|
||||
std::lock_guard lock(sock_client->mutex);
|
||||
paddr->sin_family = SYS_NET_AF_INET;
|
||||
@@ -986,7 +985,7 @@ s32 lv2_socket_p2ps::shutdown([[maybe_unused]] s32 how)
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 lv2_socket_p2ps::poll(sys_net_pollfd& sn_pfd, [[maybe_unused]] pollfd& native_pfd)
|
||||
void lv2_socket_p2ps::poll(sys_net_pollfd& sn_pfd, [[maybe_unused]] pollfd& native_pfd)
|
||||
{
|
||||
std::lock_guard lock(mutex);
|
||||
sys_net.trace("[P2PS] poll checking for 0x%X", sn_pfd.events);
|
||||
@@ -1003,14 +1002,7 @@ s32 lv2_socket_p2ps::poll(sys_net_pollfd& sn_pfd, [[maybe_unused]] pollfd& nativ
|
||||
{
|
||||
sn_pfd.revents |= SYS_NET_POLLOUT;
|
||||
}
|
||||
|
||||
if (sn_pfd.revents)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::tuple<bool, bool, bool> lv2_socket_p2ps::select(bs_t<lv2_socket::poll_t> selected, [[maybe_unused]] pollfd& native_pfd)
|
||||
|
||||
@@ -89,7 +89,7 @@ public:
|
||||
void close() override;
|
||||
s32 shutdown(s32 how) override;
|
||||
|
||||
s32 poll(sys_net_pollfd& sn_pfd, pollfd& native_pfd) override;
|
||||
void poll(sys_net_pollfd& sn_pfd, pollfd& native_pfd) override;
|
||||
std::tuple<bool, bool, bool> select(bs_t<poll_t> selected, pollfd& native_pfd) override;
|
||||
|
||||
private:
|
||||
|
||||
@@ -134,10 +134,9 @@ s32 lv2_socket_raw::shutdown([[maybe_unused]] s32 how)
|
||||
return {};
|
||||
}
|
||||
|
||||
s32 lv2_socket_raw::poll([[maybe_unused]] sys_net_pollfd& sn_pfd, [[maybe_unused]] pollfd& native_pfd)
|
||||
void lv2_socket_raw::poll([[maybe_unused]] sys_net_pollfd& sn_pfd, [[maybe_unused]] pollfd& native_pfd)
|
||||
{
|
||||
LOG_ONCE(raw_poll, "lv2_socket_raw::poll");
|
||||
return {};
|
||||
}
|
||||
|
||||
std::tuple<bool, bool, bool> lv2_socket_raw::select([[maybe_unused]] bs_t<lv2_socket::poll_t> selected, [[maybe_unused]] pollfd& native_pfd)
|
||||
|
||||
@@ -32,6 +32,6 @@ public:
|
||||
void close() override;
|
||||
s32 shutdown(s32 how) override;
|
||||
|
||||
s32 poll(sys_net_pollfd& sn_pfd, pollfd& native_pfd) override;
|
||||
void poll(sys_net_pollfd& sn_pfd, pollfd& native_pfd) override;
|
||||
std::tuple<bool, bool, bool> select(bs_t<poll_t> selected, pollfd& native_pfd) override;
|
||||
};
|
||||
|
||||
@@ -249,8 +249,9 @@ bool nt_p2p_port::recv_data()
|
||||
|
||||
auto& bound_sockets = ::at32(bound_p2p_vports, dst_vport);
|
||||
|
||||
for (const auto sock_id : bound_sockets)
|
||||
for (auto it = bound_sockets.begin(); it != bound_sockets.end();)
|
||||
{
|
||||
s32 sock_id = *it;
|
||||
const auto sock = idm::check<lv2_socket>(sock_id, [&](lv2_socket& sock)
|
||||
{
|
||||
ensure(sock.get_type() == SYS_NET_SOCK_DGRAM_P2P);
|
||||
@@ -262,12 +263,17 @@ bool nt_p2p_port::recv_data()
|
||||
if (!sock)
|
||||
{
|
||||
sys_net.error("Socket %d found in bound_p2p_vports didn't exist!", sock_id);
|
||||
bound_sockets.erase(sock_id);
|
||||
it = bound_sockets.erase(it);
|
||||
if (bound_sockets.empty())
|
||||
{
|
||||
bound_p2p_vports.erase(dst_vport);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
it++;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user