Merge branch 'master' into vsh_fix

This commit is contained in:
Elad 2025-02-13 11:25:11 +02:00 committed by GitHub
commit e20a3c7f26
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
494 changed files with 10287 additions and 6314 deletions

View file

@ -7,9 +7,9 @@ git submodule -q update --init --depth 1 $(awk '/path/ && !/llvm/ && !/opencv/ {
# Prefer newer Clang than in base system (see also .ci/install-freebsd.sh)
# libc++ isn't in llvm* packages, so download manually
fetch https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.1/llvm-project-16.0.1.src.tar.xz
fetch https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.7/llvm-project-19.1.7.src.tar.xz
tar xf llvm*.tar.xz
export CC=clang16 CXX=clang++16
export CC=clang19 CXX=clang++19
cmake -B libcxx_build -G Ninja -S llvm*/libcxx \
-DLLVM_CCACHE_BUILD=ON \
-DLIBCXX_INCLUDE_BENCHMARKS=OFF \

View file

@ -14,6 +14,9 @@ mkdir build && cd build || exit 1
export CC="${CLANG_BINARY}"
export CXX="${CLANGXX_BINARY}"
export LINKER="${LLD_BINARY}"
export CFLAGS="$CFLAGS -fuse-ld=${LINKER}"
export CXXFLAGS="$CXXFLAGS -fuse-ld=${LINKER}"
cmake .. \
-DCMAKE_INSTALL_PREFIX=/usr \

View file

@ -47,6 +47,7 @@ ln -s /usr/local/opt/curl/bin/curl /opt/homebrew1/opt/curl/bin/curl
brew_arm64_install_packages 0mq aom aribb24 ca-certificates cjson dav1d ffmpeg@5 fontconfig freetype freetype2 gettext glew gmp gnutls lame libbluray libidn2 libnettle libogg libpng librist libsodium libsoxr libtasn libtasn1 libunistring libvmaf libvorbis libvpx libx11 libxau libxcb libxdmcp llvm@$LLVM_COMPILER_VER mbedtls molten-vk nettle opencore-amr openjpeg openssl opus p11-kit pkg-config pkgconfig pzstd rav1e sdl2 snappy speex srt svt-av1 theora vulkan-headers webp x264 x265 xz z3 zeromq zmq zstd
"$BREW_ARM64_PATH/bin/brew" link -f ffmpeg@5
ln -s /opt/homebrew1/opt/llvm@19/lib/unwind/libunwind.1.dylib /opt/homebrew1/opt/llvm@19/lib/libunwind.1.dylib
# moltenvk based on commit for 1.2.11 release
wget https://raw.githubusercontent.com/Homebrew/homebrew-core/6bfc8950c696d1f952425e8af2a6248603dc0df9/Formula/m/molten-vk.rb

View file

@ -1,4 +1,4 @@
#!/bin/sh -ex
curl -fLo "./llvm.lock" "https://github.com/RPCS3/llvm-mirror/releases/download/custom-build-win-16.0.1/llvmlibs_mt.7z.sha256"
curl -fLo "./llvm.lock" "https://github.com/RPCS3/llvm-mirror/releases/download/custom-build-win-19.1.7/llvmlibs_mt.7z.sha256"
curl -fLo "./glslang.lock" "https://github.com/RPCS3/glslang/releases/download/custom-build-win/glslanglibs_mt.7z.sha256"

View file

@ -9,7 +9,7 @@ export ASSUME_ALWAYS_YES=true
pkg info # debug
# Prefer newer Clang than in base system (see also .ci/build-freebsd.sh)
pkg install llvm16
pkg install llvm19
# Mandatory dependencies (qt6-base is pulled via qt6-multimedia)
pkg install git ccache cmake ninja qt6-multimedia qt6-svg glew openal-soft ffmpeg

View file

@ -19,7 +19,7 @@ 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}"
LLVMLIBS_URL='https://github.com/RPCS3/llvm-mirror/releases/download/custom-build-win-16.0.1/llvmlibs_mt.7z'
LLVMLIBS_URL='https://github.com/RPCS3/llvm-mirror/releases/download/custom-build-win-19.1.7/llvmlibs_mt.7z'
GLSLANG_URL='https://github.com/RPCS3/glslang/releases/latest/download/glslanglibs_mt.7z'
VULKAN_SDK_URL="https://www.dropbox.com/scl/fi/sjjh0fc4ld281pjbl2xzu/VulkanSDK-1.3.268.0-Installer.exe?rlkey=f6wzc0lvms5vwkt2z3qabfv9d&dl=1"

View file

@ -56,7 +56,7 @@ env:
# linux_task:
# container:
# image: rpcs3/rpcs3-ci-focal:1.9
# image: rpcs3/rpcs3-ci-jammy:1.0
# cpu: 4
# memory: 16G
# env:
@ -132,7 +132,7 @@ linux_aarch64_task:
matrix:
- name: Cirrus Linux AArch64 Clang
arm_container:
image: 'docker.io/rpcs3/rpcs3-ci-focal-aarch64:1.0'
image: 'docker.io/rpcs3/rpcs3-ci-jammy-aarch64:1.0'
cpu: 8
memory: 8G
clang_script:

2
3rdparty/FAudio vendored

@ -1 +1 @@
Subproject commit 707114aef2907793644d4067a6e7b09b51502ca9
Subproject commit af74e661c1bd8b105840d14485cc01d9c782b513

View file

@ -49,11 +49,11 @@
<PropertyGroup Label="UserMacros">
<CmakeReleaseCLI>call vsdevcmd.bat -arch=amd64
cd "$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)"
cmake -G Ninja -DCMAKE_CXX_COMPILER="cl.exe" -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_INSTALL_PREFIX="./Release" -DCMAKE_SYSTEM_VERSION=6.1 -DLIBTYPE=STATIC -DFORCE_STATIC_VCRT=true -DALSOFT_UTILS=false -DALSOFT_EXAMPLES=false -DALSOFT_INSTALL=false -DALSOFT_INSTALL_CONFIG=false -DALSOFT_INSTALL_HRTF_DATA=false -DALSOFT_INSTALL_AMBDEC_PRESETS=false -DALSOFT_INSTALL_EXAMPLES=false -DALSOFT_INSTALL_UTILS=false "$(SolutionDir)3rdparty\OpenAL\openal-soft"
cmake -G Ninja -DCMAKE_CXX_COMPILER="cl.exe" -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_INSTALL_PREFIX="./Release" -DCMAKE_SYSTEM_VERSION=10.0 -DLIBTYPE=STATIC -DFORCE_STATIC_VCRT=true -DALSOFT_UTILS=false -DALSOFT_EXAMPLES=false -DALSOFT_INSTALL=false -DALSOFT_INSTALL_CONFIG=false -DALSOFT_INSTALL_HRTF_DATA=false -DALSOFT_INSTALL_AMBDEC_PRESETS=false -DALSOFT_INSTALL_EXAMPLES=false -DALSOFT_INSTALL_UTILS=false "$(SolutionDir)3rdparty\OpenAL\openal-soft"
</CmakeReleaseCLI>
<CmakeDebugCLI>call vsdevcmd.bat -arch=amd64
cd "$(SolutionDir)build\tmp\$(ProjectName)-$(Configuration)-$(Platform)"
cmake -G Ninja -DCMAKE_CXX_COMPILER="cl.exe" -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_BUILD_TYPE="Debug" -DCMAKE_INSTALL_PREFIX="./Debug" -DCMAKE_SYSTEM_VERSION=6.1 -DLIBTYPE=STATIC -DALSOFT_UTILS=false -DALSOFT_EXAMPLES=false -DALSOFT_INSTALL=false -DALSOFT_INSTALL_CONFIG=false -DALSOFT_INSTALL_HRTF_DATA=false -DALSOFT_INSTALL_AMBDEC_PRESETS=false -DALSOFT_INSTALL_EXAMPLES=false -DALSOFT_INSTALL_UTILS=false "$(SolutionDir)3rdparty\OpenAL\openal-soft"
cmake -G Ninja -DCMAKE_CXX_COMPILER="cl.exe" -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_BUILD_TYPE="Debug" -DCMAKE_INSTALL_PREFIX="./Debug" -DCMAKE_SYSTEM_VERSION=10.0 -DLIBTYPE=STATIC -DALSOFT_UTILS=false -DALSOFT_EXAMPLES=false -DALSOFT_INSTALL=false -DALSOFT_INSTALL_CONFIG=false -DALSOFT_INSTALL_HRTF_DATA=false -DALSOFT_INSTALL_AMBDEC_PRESETS=false -DALSOFT_INSTALL_EXAMPLES=false -DALSOFT_INSTALL_UTILS=false "$(SolutionDir)3rdparty\OpenAL\openal-soft"
</CmakeDebugCLI>
<CmakeCopyCLI>
echo Copying..

2
3rdparty/curl/curl vendored

@ -1 +1 @@
Subproject commit 75a2079d5c28debb2eaa848ca9430f1fe0d7844c
Subproject commit 34cf9d54a46598c44938aa7598820484d7af7133

View file

@ -66,7 +66,6 @@
<ClCompile Include="curl\lib\base64.c" />
<ClCompile Include="curl\lib\bufq.c" />
<ClCompile Include="curl\lib\bufref.c" />
<ClCompile Include="curl\lib\c-hyper.c" />
<ClCompile Include="curl\lib\cf-h1-proxy.c" />
<ClCompile Include="curl\lib\cf-h2-proxy.c" />
<ClCompile Include="curl\lib\cf-haproxy.c" />
@ -124,6 +123,7 @@
<ClCompile Include="curl\lib\http.c" />
<ClCompile Include="curl\lib\http1.c" />
<ClCompile Include="curl\lib\http2.c" />
<ClCompile Include="curl\lib\httpsrr.c" />
<ClCompile Include="curl\lib\http_aws_sigv4.c" />
<ClCompile Include="curl\lib\http_chunks.c" />
<ClCompile Include="curl\lib\http_digest.c" />
@ -175,6 +175,7 @@
<ClCompile Include="curl\lib\strcase.c" />
<ClCompile Include="curl\lib\strdup.c" />
<ClCompile Include="curl\lib\strerror.c" />
<ClCompile Include="curl\lib\strparse.c" />
<ClCompile Include="curl\lib\strtok.c" />
<ClCompile Include="curl\lib\strtoofft.c" />
<ClCompile Include="curl\lib\system_win32.c" />
@ -191,8 +192,11 @@
<ClCompile Include="curl\lib\vquic\curl_msh3.c" />
<ClCompile Include="curl\lib\vquic\curl_ngtcp2.c" />
<ClCompile Include="curl\lib\vquic\curl_quiche.c" />
<ClCompile Include="curl\lib\vtls\cipher_suite.c" />
<ClCompile Include="curl\lib\vtls\hostcheck.c" />
<ClCompile Include="curl\lib\vtls\rustls.c" />
<ClCompile Include="curl\lib\vtls\vtls_scache.c" />
<ClCompile Include="curl\lib\vtls\vtls_spack.c" />
<ClCompile Include="curl\lib\vtls\x509asn1.c" />
<ClCompile Include="curl\lib\warnless.c" />
<ClCompile Include="curl\lib\vauth\cleartext.c" />
@ -241,21 +245,17 @@
<ClInclude Include="curl\lib\asyn.h" />
<ClInclude Include="curl\lib\bufq.h" />
<ClInclude Include="curl\lib\bufref.h" />
<ClInclude Include="curl\lib\c-hyper.h" />
<ClInclude Include="curl\lib\cf-h1-proxy.h" />
<ClInclude Include="curl\lib\cf-h2-proxy.h" />
<ClInclude Include="curl\lib\cf-haproxy.h" />
<ClInclude Include="curl\lib\cf-https-connect.h" />
<ClInclude Include="curl\lib\cf-socket.h" />
<ClInclude Include="curl\lib\cfilters.h" />
<ClInclude Include="curl\lib\config-amigaos.h" />
<ClInclude Include="curl\lib\config-dos.h" />
<ClInclude Include="curl\lib\config-mac.h" />
<ClInclude Include="curl\lib\config-os400.h" />
<ClInclude Include="curl\lib\config-plan9.h" />
<ClInclude Include="curl\lib\config-riscos.h" />
<ClInclude Include="curl\lib\config-win32.h" />
<ClInclude Include="curl\lib\config-win32ce.h" />
<ClInclude Include="curl\lib\conncache.h" />
<ClInclude Include="curl\lib\connect.h" />
<ClInclude Include="curl\lib\content_encoding.h" />
@ -315,6 +315,7 @@
<ClInclude Include="curl\lib\http.h" />
<ClInclude Include="curl\lib\http1.h" />
<ClInclude Include="curl\lib\http2.h" />
<ClInclude Include="curl\lib\httpsrr.h" />
<ClInclude Include="curl\lib\http_aws_sigv4.h" />
<ClInclude Include="curl\lib\http_chunks.h" />
<ClInclude Include="curl\lib\http_digest.h" />
@ -363,6 +364,7 @@
<ClInclude Include="curl\lib\strcase.h" />
<ClInclude Include="curl\lib\strdup.h" />
<ClInclude Include="curl\lib\strerror.h" />
<ClInclude Include="curl\lib\strparse.h" />
<ClInclude Include="curl\lib\strtok.h" />
<ClInclude Include="curl\lib\strtoofft.h" />
<ClInclude Include="curl\lib\system_win32.h" />
@ -379,8 +381,13 @@
<ClInclude Include="curl\lib\vquic\curl_ngtcp2.h" />
<ClInclude Include="curl\lib\vquic\curl_quiche.h" />
<ClInclude Include="curl\lib\vquic\vquic_int.h" />
<ClInclude Include="curl\lib\vtls\cipher_suite.h" />
<ClInclude Include="curl\lib\vtls\hostcheck.h" />
<ClInclude Include="curl\lib\vtls\rustls.h" />
<ClInclude Include="curl\lib\vtls\schannel_int.h" />
<ClInclude Include="curl\lib\vtls\vtls_int.h" />
<ClInclude Include="curl\lib\vtls\vtls_scache.h" />
<ClInclude Include="curl\lib\vtls\vtls_spack.h" />
<ClInclude Include="curl\lib\vtls\x509asn1.h" />
<ClInclude Include="curl\lib\warnless.h" />
<ClInclude Include="curl\lib\vauth\digest.h" />

View file

@ -417,9 +417,6 @@
<ClCompile Include="curl\lib\vtls\keylog.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\c-hyper.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\easygetopt.c">
<Filter>Source Files</Filter>
</ClCompile>
@ -510,6 +507,21 @@
<ClCompile Include="curl\lib\curl_sha512_256.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\httpsrr.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\strparse.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\vtls\cipher_suite.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\vtls\vtls_scache.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="curl\lib\vtls\vtls_spack.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="curl\include\curl\curl.h">
@ -554,12 +566,6 @@
<ClInclude Include="curl\lib\bufref.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\config-amigaos.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\config-dos.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\config-mac.h">
<Filter>Header Files</Filter>
</ClInclude>
@ -575,9 +581,6 @@
<ClInclude Include="curl\lib\config-win32.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\config-win32ce.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\conncache.h">
<Filter>Header Files</Filter>
</ClInclude>
@ -935,9 +938,6 @@
<ClInclude Include="curl\lib\vtls\keylog.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\c-hyper.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\curl_krb5.h">
<Filter>Header Files</Filter>
</ClInclude>
@ -1034,6 +1034,27 @@
<ClInclude Include="curl\lib\curl_sha512_256.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\httpsrr.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\strparse.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\vtls\cipher_suite.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\vtls\schannel_int.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\vtls\vtls_int.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\vtls\vtls_scache.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="curl\lib\vtls\vtls_spack.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="curl\lib\libcurl.rc">

@ -1 +1 @@
Subproject commit fecf2f0af3bd23cbba553ceedc2bc6c1cd410fc1
Subproject commit 066d4a63b2c714b20b0a8073a01fda7c5c6763f6

@ -1 +1 @@
Subproject commit 8b43a97a9330f8b0035439ce9e255e4be202deca
Subproject commit 6bfdcf7368169efe1b745cd4468d45cda05ef8de

@ -1 +1 @@
Subproject commit 51f5bd68b9b806d2c92b4318164d28b49357da31
Subproject commit 0024abd279d3a06435c0309a3f4172eed7c7a19a

@ -1 +1 @@
Subproject commit fa24d868ac2f8fd558e4e914c9863411245db8fd
Subproject commit 8236e01a9f758d15927624925c6043f84d8a261f

View file

@ -41,7 +41,7 @@ if(WITH_LLVM)
set(STATIC_LINK_LLVM ON CACHE BOOL "Link against LLVM statically. This will get set to ON if you build LLVM from the submodule." FORCE)
find_package(LLVM 16.0 CONFIG)
find_package(LLVM 19.1 CONFIG)
if(NOT LLVM_FOUND)
message(FATAL_ERROR "Couldn't build LLVM from the submodule. You might need to run `git submodule update --init`")
endif()
@ -59,8 +59,8 @@ if(WITH_LLVM)
message(FATAL_ERROR "Can't find LLVM libraries from the CMAKE_PREFIX_PATH path or LLVM_DIR. \
Enable BUILD_LLVM option to build LLVM from included as a git submodule.")
endif()
if (LLVM_VERSION VERSION_LESS 16)
message(FATAL_ERROR "Found LLVM version ${LLVM_VERSION}. Required version 16 or above. \
if (LLVM_VERSION VERSION_LESS 18)
message(FATAL_ERROR "Found LLVM version ${LLVM_VERSION}. Required version 18 or above. \
Enable BUILD_LLVM option to build LLVM from included as a git submodule.")
endif()
endif()
@ -68,7 +68,7 @@ if(WITH_LLVM)
if (STATIC_LINK_LLVM)
if (NOT DEFINED LLVM_TARGETS_TO_BUILD)
if(COMPILER_ARM)
set(LLVM_TARGETS_TO_BUILD "AArch64;X86" CACHE STRING "Semicolon-separated list of targets to build, or \"all\".")
set(LLVM_TARGETS_TO_BUILD "AArch64" CACHE STRING "Semicolon-separated list of targets to build, or \"all\".")
else()
set(LLVM_TARGETS_TO_BUILD "X86" CACHE STRING "Semicolon-separated list of targets to build, or \"all\".")
endif()

2
3rdparty/llvm/llvm vendored

@ -1 +1 @@
Subproject commit cd89023f797900e4492da58b7bed36f702120011
Subproject commit cd708029e0b2869e80abe31ddb175f7c35361f90

View file

@ -40,11 +40,11 @@
<PropertyGroup Label="UserMacros">
<CmakeReleaseCLI>call vsdevcmd.bat -arch=amd64
cd "$(SolutionDir)build\tmp\llvm_build-$(Configuration)-$(Platform)"
cmake -G Ninja -DCMAKE_CXX_COMPILER="cl.exe" -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_INSTALL_PREFIX="$(SolutionDir)build\lib\$(Configuration)-$(Platform)\llvm_build" -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_DEFAULT_TARGET_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_HOST_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_BENCHMARKS=OFF -DLLVM_INCLUDE_UTILS=OFF -DCMAKE_SYSTEM_VERSION=6.1 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=$(WindowsTargetPlatformVersion) -DLLVM_USE_CRT_DEBUG=MDd -DLLVM_USE_CRT_RELEASE=MT -DLLVM_USE_INTEL_JITEVENTS=ON "$(SolutionDir)3rdparty\llvm\llvm\llvm"
cmake -G Ninja -DCMAKE_CXX_COMPILER="cl.exe" -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_INSTALL_PREFIX="$(SolutionDir)build\lib\$(Configuration)-$(Platform)\llvm_build" -DCMAKE_SYSTEM_VERSION=10.0 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=$(WindowsTargetPlatformVersion) -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_DEFAULT_TARGET_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_HOST_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF -DLLVM_BUILD_BENCHMARKS=OFF -DLLVM_BUILD_DOCS=OFF -DLLVM_BUILD_EXAMPLES=OFF -DLLVM_BUILD_TESTS=OFF\ -DLLVM_INCLUDE_TOOLS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_BENCHMARKS=OFF -DLLVM_INCLUDE_UTILS=OFF -DLLVM_INSTALL_UTILS=OFF -DLLVM_ENABLE_DIA_SDK=OFF -DLLVM_ENABLE_PDB=OFF -DLLVM_USE_INTEL_JITEVENTS=ON "$(SolutionDir)3rdparty\llvm\llvm\llvm"
</CmakeReleaseCLI>
<CmakeDebugCLI>call vsdevcmd.bat -arch=amd64
cd "$(SolutionDir)build\tmp\llvm_build-$(Configuration)-$(Platform)"
cmake -G Ninja -DCMAKE_CXX_COMPILER="cl.exe" -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_BUILD_TYPE="Debug" -DCMAKE_INSTALL_PREFIX="$(SolutionDir)build\lib\$(Configuration)-$(Platform)\llvm_build" -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_DEFAULT_TARGET_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_HOST_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_BENCHMARKS=OFF -DLLVM_INCLUDE_UTILS=OFF -DCMAKE_SYSTEM_VERSION=6.1 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=$(WindowsTargetPlatformVersion) -DLLVM_USE_CRT_DEBUG=MDd -DLLVM_USE_CRT_RELEASE=MT -DLLVM_USE_INTEL_JITEVENTS=ON "$(SolutionDir)3rdparty\llvm\llvm\llvm"
cmake -G Ninja -DCMAKE_CXX_COMPILER="cl.exe" -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_BUILD_TYPE="Debug" -DCMAKE_INSTALL_PREFIX="$(SolutionDir)build\lib\$(Configuration)-$(Platform)\llvm_build" -DCMAKE_SYSTEM_VERSION=10.0 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=$(WindowsTargetPlatformVersion) -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebugDLL -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_DEFAULT_TARGET_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_HOST_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF -DLLVM_BUILD_BENCHMARKS=OFF -DLLVM_BUILD_DOCS=OFF -DLLVM_BUILD_EXAMPLES=OFF -DLLVM_BUILD_TESTS=OFF\ -DLLVM_INCLUDE_TOOLS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_BENCHMARKS=OFF -DLLVM_INCLUDE_UTILS=OFF -DLLVM_INSTALL_UTILS=OFF -DLLVM_ENABLE_DIA_SDK=OFF -DLLVM_ENABLE_PDB=OFF -DLLVM_USE_INTEL_JITEVENTS=ON "$(SolutionDir)3rdparty\llvm\llvm\llvm"
</CmakeDebugCLI>
<CmakeCleanCLI>
echo Cleaning..

View file

@ -40,11 +40,11 @@
<PropertyGroup Label="UserMacros">
<CmakeReleaseCLI>call vsdevcmd.bat -arch=amd64
cd "$(SolutionDir)build\tmp\llvm_build-$(Configuration)-$(Platform)"
cmake -G Ninja -DCMAKE_CXX_COMPILER="clang-cl.exe" -DCMAKE_C_COMPILER="clang-cl.exe" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_INSTALL_PREFIX="$(SolutionDir)build\lib\$(Configuration)-$(Platform)\llvm_build" -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_DEFAULT_TARGET_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_HOST_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_BENCHMARKS=OFF -DLLVM_INCLUDE_UTILS=OFF -DCMAKE_SYSTEM_VERSION=6.1 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=$(WindowsTargetPlatformVersion) -DLLVM_USE_CRT_DEBUG=MDd -DLLVM_USE_CRT_RELEASE=MT -DLLVM_USE_INTEL_JITEVENTS=ON "$(SolutionDir)3rdparty\llvm\llvm\llvm"
cmake -G Ninja -DCMAKE_CXX_COMPILER="clang-cl.exe" -DCMAKE_C_COMPILER="clang-cl.exe" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_INSTALL_PREFIX="$(SolutionDir)build\lib\$(Configuration)-$(Platform)\llvm_build" -DCMAKE_SYSTEM_VERSION=10.0 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=$(WindowsTargetPlatformVersion) -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_DEFAULT_TARGET_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_HOST_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF -DLLVM_BUILD_BENCHMARKS=OFF -DLLVM_BUILD_DOCS=OFF -DLLVM_BUILD_EXAMPLES=OFF -DLLVM_BUILD_TESTS=OFF\ -DLLVM_INCLUDE_TOOLS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_BENCHMARKS=OFF -DLLVM_INCLUDE_UTILS=OFF -DLLVM_INSTALL_UTILS=OFF -DLLVM_ENABLE_DIA_SDK=OFF -DLLVM_ENABLE_PDB=OFF -DLLVM_USE_INTEL_JITEVENTS=ON "$(SolutionDir)3rdparty\llvm\llvm\llvm"
</CmakeReleaseCLI>
<CmakeDebugCLI>call vsdevcmd.bat -arch=amd64
cd "$(SolutionDir)build\tmp\llvm_build-$(Configuration)-$(Platform)"
cmake -G Ninja -DCMAKE_CXX_COMPILER="clang-cl.exe" -DCMAKE_C_COMPILER="clang-cl.exe" -DCMAKE_BUILD_TYPE="Debug" -DCMAKE_INSTALL_PREFIX="$(SolutionDir)build\lib\$(Configuration)-$(Platform)\llvm_build" -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_DEFAULT_TARGET_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_HOST_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_BENCHMARKS=OFF -DLLVM_INCLUDE_UTILS=OFF -DCMAKE_SYSTEM_VERSION=6.1 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=$(WindowsTargetPlatformVersion) -DLLVM_USE_CRT_DEBUG=MDd -DLLVM_USE_CRT_RELEASE=MT -DLLVM_USE_INTEL_JITEVENTS=ON "$(SolutionDir)3rdparty\llvm\llvm\llvm"
cmake -G Ninja -DCMAKE_CXX_COMPILER="clang-cl.exe" -DCMAKE_C_COMPILER="clang-cl.exe" -DCMAKE_BUILD_TYPE="Debug" -DCMAKE_INSTALL_PREFIX="$(SolutionDir)build\lib\$(Configuration)-$(Platform)\llvm_build" -DCMAKE_SYSTEM_VERSION=10.0 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=$(WindowsTargetPlatformVersion) -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebugDLL -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_DEFAULT_TARGET_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_HOST_TRIPLE:STRING=x86_64-pc-windows-msvc -DLLVM_BUILD_RUNTIME=OFF -DLLVM_BUILD_TOOLS=OFF -DLLVM_BUILD_BENCHMARKS=OFF -DLLVM_BUILD_DOCS=OFF -DLLVM_BUILD_EXAMPLES=OFF -DLLVM_BUILD_TESTS=OFF\ -DLLVM_INCLUDE_TOOLS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_BENCHMARKS=OFF -DLLVM_INCLUDE_UTILS=OFF -DLLVM_INSTALL_UTILS=OFF -DLLVM_ENABLE_DIA_SDK=OFF -DLLVM_ENABLE_PDB=OFF -DLLVM_USE_INTEL_JITEVENTS=ON "$(SolutionDir)3rdparty\llvm\llvm\llvm"
</CmakeDebugCLI>
<CmakeCleanCLI>
echo Cleaning..

View file

@ -128,7 +128,7 @@ Start **Visual Studio**, click on `Open a project or solution` and select the `r
**NOTE:** The recommended build configuration is `Release`. (On older revisions: `Release - LLVM`)
To speed up the compilation time, you may want to download and extract to `<rpcs3_root>\build\lib_ext\<$(Configuration)>-x64` (e.g. `c:\rpcs3\build\lib_ext\Release-x64`; the path needs to be created) some of the following precompiled libs:
- [LLVM libs](https://github.com/RPCS3/llvm-mirror/releases/download/custom-build-win-16.0.1/llvmlibs_mt.7z)
- [LLVM libs](https://github.com/RPCS3/llvm-mirror/releases/download/custom-build-win-19.1.7/llvmlibs_mt.7z)
- [additional libs](https://github.com/RPCS3/glslang/releases/latest/download/glslanglibs_mt.7z)
**NOTES:**

View file

@ -1,8 +1,6 @@
#include "File.h"
#include "mutex.h"
#include "StrFmt.h"
#include "StrUtil.h"
#include "Crypto/sha1.h"
#include <span>
#include <unordered_map>
@ -18,6 +16,8 @@ using namespace std::literals::string_literals;
#ifdef _WIN32
#include "Utilities/StrUtil.h"
#include <cwchar>
#include <Windows.h>

View file

@ -77,7 +77,7 @@ struct jit_runtime_base
jit_runtime_base& operator=(const jit_runtime_base&) = delete;
const asmjit::Environment& environment() const noexcept;
void* _add(asmjit::CodeHolder* code) noexcept;
void* _add(asmjit::CodeHolder* code, usz align = 64) noexcept;
virtual uchar* _alloc(usz size, usz align) noexcept = 0;
};
@ -93,6 +93,10 @@ struct jit_runtime final : jit_runtime_base
// Allocate memory
static u8* alloc(usz size, usz align, bool exec = true) noexcept;
// Allocate 0 bytes, observe memory location
// Same as alloc(0, 1, exec)
static u8* peek(bool exec = true) noexcept;
// Should be called at least once after global initialization
static void initialize();
@ -432,7 +436,7 @@ namespace asmjit
// Build runtime function with asmjit::X86Assembler
template <typename FT, typename Asm = native_asm, typename F>
inline FT build_function_asm(std::string_view name, F&& builder, ::jit_runtime* custom_runtime = nullptr)
inline FT build_function_asm(std::string_view name, F&& builder, ::jit_runtime* custom_runtime = nullptr, bool reduced_size = false)
{
#ifdef __APPLE__
pthread_jit_write_protect_np(false);
@ -467,6 +471,7 @@ inline FT build_function_asm(std::string_view name, F&& builder, ::jit_runtime*
Asm compiler(&code);
compiler.addEncodingOptions(EncodingOptions::kOptimizedAlign);
compiler.addEncodingOptions(EncodingOptions::kOptimizeForSize);
if constexpr (std::is_invocable_r_v<bool, F, Asm&, native_args&>)
{
if (!builder(compiler, args))
@ -483,7 +488,7 @@ inline FT build_function_asm(std::string_view name, F&& builder, ::jit_runtime*
compiler();
}
const auto result = rt._add(&code);
const auto result = rt._add(&code, reduced_size ? 16 : 64);
jit_announce(result, code.codeSize(), name);
return reinterpret_cast<FT>(uptr(result));
}
@ -498,6 +503,8 @@ namespace llvm
class StringRef;
}
enum class thread_state : u32;
// Temporary compiler interface
class jit_compiler final
{
@ -514,8 +521,9 @@ class jit_compiler final
atomic_t<usz> m_disk_space = umax;
public:
jit_compiler(const std::unordered_map<std::string, u64>& _link, const std::string& _cpu, u32 flags = 0);
~jit_compiler();
jit_compiler(const std::unordered_map<std::string, u64>& _link, const std::string& _cpu, u32 flags = 0, std::function<u64(const std::string&)> symbols_cement = {}) noexcept;
jit_compiler& operator=(thread_state) noexcept;
~jit_compiler() noexcept;
// Get LLVM context
auto& get_context()

View file

@ -147,6 +147,12 @@ static u8* add_jit_memory(usz size, usz align)
return pointer;
}
if (!size && align == 1)
{
// Return memory top address
return pointer + (Ctr.load() & 0xffff'ffff);
}
u64 olda, newa;
// Simple allocation by incrementing pointer to the next free data
@ -211,7 +217,7 @@ const asmjit::Environment& jit_runtime_base::environment() const noexcept
return g_env;
}
void* jit_runtime_base::_add(asmjit::CodeHolder* code) noexcept
void* jit_runtime_base::_add(asmjit::CodeHolder* code, usz align) noexcept
{
ensure(!code->flatten());
ensure(!code->resolveUnresolvedLinks());
@ -219,7 +225,7 @@ void* jit_runtime_base::_add(asmjit::CodeHolder* code) noexcept
if (!codeSize)
return nullptr;
auto p = ensure(this->_alloc(codeSize, 64));
auto p = ensure(this->_alloc(codeSize, align));
ensure(!code->relocateToBase(uptr(p)));
{
@ -231,6 +237,11 @@ void* jit_runtime_base::_add(asmjit::CodeHolder* code) noexcept
for (asmjit::Section* section : code->_sections)
{
if (section->offset() + section->bufferSize() > utils::align<usz>(codeSize, align))
{
fmt::throw_exception("CodeHolder section exceeds range: Section->offset: 0x%x, Section->bufferSize: 0x%x, alloted-memory=0x%x", section->offset(), section->bufferSize(), utils::align<usz>(codeSize, align));
}
std::memcpy(p + section->offset(), section->data(), section->bufferSize());
}
}
@ -268,6 +279,18 @@ u8* jit_runtime::alloc(usz size, usz align, bool exec) noexcept
}
}
u8* jit_runtime::peek(bool exec) noexcept
{
if (exec)
{
return add_jit_memory<s_code_pos, 0x0, utils::protection::wx>(0, 1);
}
else
{
return add_jit_memory<s_data_pos, 0x40000000, utils::protection::rw>(0, 1);
}
}
void jit_runtime::initialize()
{
if (!s_code_init.empty() || !s_data_init.empty())

View file

@ -1,5 +1,6 @@
#include "util/types.hpp"
#include "util/sysinfo.hpp"
#include "Utilities/Thread.h"
#include "JIT.h"
#include "StrFmt.h"
#include "File.h"
@ -77,8 +78,7 @@ static u64 make_null_function(const std::string& name)
if (res.ec == std::errc() && res.ptr == name.c_str() + name.size() && addr < 0x8000'0000)
{
// Point the garbage to reserved, non-executable memory
return reinterpret_cast<u64>(vm::g_sudo_addr + addr);
fmt::throw_exception("Unhandled symbols cementing! (name='%s'", name);
}
}
@ -174,18 +174,34 @@ struct JITAnnouncer : llvm::JITEventListener
struct MemoryManager1 : llvm::RTDyldMemoryManager
{
// 256 MiB for code or data
static constexpr u64 c_max_size = 0x20000000 / 2;
static constexpr u64 c_max_size = 0x1000'0000;
// Allocation unit (2M)
static constexpr u64 c_page_size = 2 * 1024 * 1024;
// Reserve 512 MiB
u8* const ptr = static_cast<u8*>(utils::memory_reserve(c_max_size * 2));
// Reserve 256 MiB blocks
void* m_code_mems = nullptr;
void* m_data_ro_mems = nullptr;
void* m_data_rw_mems = nullptr;
u64 code_ptr = 0;
u64 data_ptr = c_max_size;
u64 data_ro_ptr = 0;
u64 data_rw_ptr = 0;
MemoryManager1() = default;
// First fallback for non-existing symbols
// May be a memory container internally
std::function<u64(const std::string&)> m_symbols_cement;
MemoryManager1(std::function<u64(const std::string&)> symbols_cement = {}) noexcept
: m_symbols_cement(std::move(symbols_cement))
{
auto ptr = reinterpret_cast<u8*>(utils::memory_reserve(c_max_size * 3));
m_code_mems = ptr;
// ptr += c_max_size;
// m_data_ro_mems = ptr;
ptr += c_max_size;
m_data_rw_mems = ptr;
}
MemoryManager1(const MemoryManager1&) = delete;
@ -194,13 +210,22 @@ struct MemoryManager1 : llvm::RTDyldMemoryManager
~MemoryManager1() override
{
// Hack: don't release to prevent reuse of address space, see jit_announce
utils::memory_decommit(ptr, c_max_size * 2);
// constexpr auto how_much = [](u64 pos) { return utils::align(pos, pos < c_page_size ? c_page_size / 4 : c_page_size); };
// utils::memory_decommit(m_code_mems, how_much(code_ptr));
// utils::memory_decommit(m_data_ro_mems, how_much(data_ro_ptr));
// utils::memory_decommit(m_data_rw_mems, how_much(data_rw_ptr));
utils::memory_decommit(m_code_mems, c_max_size * 3);
}
llvm::JITSymbol findSymbol(const std::string& name) override
{
u64 addr = RTDyldMemoryManager::getSymbolAddress(name);
if (!addr && m_symbols_cement)
{
addr = m_symbols_cement(name);
}
if (!addr)
{
addr = make_null_function(name);
@ -214,45 +239,79 @@ struct MemoryManager1 : llvm::RTDyldMemoryManager
return {addr, llvm::JITSymbolFlags::Exported};
}
u8* allocate(u64& oldp, uptr size, uint align, utils::protection prot)
u8* allocate(u64& alloc_pos, void* block, uptr size, u64 align, utils::protection prot)
{
if (align > c_page_size)
align = align ? align : 16;
const u64 sizea = utils::align(size, align);
if (!size || align > c_page_size || sizea > c_max_size || sizea < size)
{
jit_log.fatal("Unsupported alignment (size=0x%x, align=0x%x)", size, align);
jit_log.fatal("Unsupported size/alignment (size=0x%x, align=0x%x)", size, align);
return nullptr;
}
const u64 olda = utils::align(oldp, align);
const u64 newp = utils::align(olda + size, align);
u64 oldp = alloc_pos;
if ((newp - 1) / c_max_size != oldp / c_max_size)
u64 olda = utils::align(oldp, align);
ensure(olda >= oldp);
ensure(olda < ~sizea);
u64 newp = olda + sizea;
if ((newp - 1) / c_max_size != (oldp - 1) / c_max_size)
{
jit_log.fatal("Out of memory (size=0x%x, align=0x%x)", size, align);
return nullptr;
constexpr usz num_of_allocations = 1;
if ((newp - 1) / c_max_size > num_of_allocations)
{
// Allocating more than one region does not work for relocations, needs more robust solution
fmt::throw_exception("Out of memory (size=0x%x, align=0x%x)", size, align);
}
}
if ((oldp - 1) / c_page_size != (newp - 1) / c_page_size)
// Update allocation counter
alloc_pos = newp;
constexpr usz page_quarter = c_page_size / 4;
// Optimization: split the first allocation to 512 KiB for single-module compilers
if (oldp < c_page_size && align < page_quarter && (std::min(newp, c_page_size) - 1) / page_quarter != (oldp - 1) / page_quarter)
{
const u64 pagea = utils::align(oldp, page_quarter);
const u64 psize = utils::align(std::min(newp, c_page_size) - pagea, page_quarter);
utils::memory_commit(reinterpret_cast<u8*>(block) + (pagea % c_max_size), psize, prot);
// Advance
oldp = pagea + psize;
}
if ((newp - 1) / c_page_size != (oldp - 1) / c_page_size)
{
// Allocate pages on demand
const u64 pagea = utils::align(oldp, c_page_size);
const u64 psize = utils::align(newp - pagea, c_page_size);
utils::memory_commit(this->ptr + pagea, psize, prot);
utils::memory_commit(reinterpret_cast<u8*>(block) + (pagea % c_max_size), psize, prot);
}
// Update allocation counter
oldp = newp;
return this->ptr + olda;
return reinterpret_cast<u8*>(block) + (olda % c_max_size);
}
u8* allocateCodeSection(uptr size, uint align, uint /*sec_id*/, llvm::StringRef /*sec_name*/) override
{
return allocate(code_ptr, size, align, utils::protection::wx);
return allocate(code_ptr, m_code_mems, size, align, utils::protection::wx);
}
u8* allocateDataSection(uptr size, uint align, uint /*sec_id*/, llvm::StringRef /*sec_name*/, bool /*is_ro*/) override
u8* allocateDataSection(uptr size, uint align, uint /*sec_id*/, llvm::StringRef /*sec_name*/, bool is_ro) override
{
return allocate(data_ptr, size, align, utils::protection::rw);
if (is_ro)
{
// Disabled
//return allocate(data_ro_ptr, m_data_ro_mems, size, align, utils::protection::rw);
}
return allocate(data_rw_ptr, m_data_rw_mems, size, align, utils::protection::rw);
}
bool finalizeMemory(std::string* = nullptr) override
@ -272,7 +331,14 @@ struct MemoryManager1 : llvm::RTDyldMemoryManager
// Simple memory manager
struct MemoryManager2 : llvm::RTDyldMemoryManager
{
MemoryManager2() = default;
// First fallback for non-existing symbols
// May be a memory container internally
std::function<u64(const std::string&)> m_symbols_cement;
MemoryManager2(std::function<u64(const std::string&)> symbols_cement = {}) noexcept
: m_symbols_cement(std::move(symbols_cement))
{
}
~MemoryManager2() override
{
@ -282,6 +348,11 @@ struct MemoryManager2 : llvm::RTDyldMemoryManager
{
u64 addr = RTDyldMemoryManager::getSymbolAddress(name);
if (!addr && m_symbols_cement)
{
addr = m_symbols_cement(name);
}
if (!addr)
{
addr = make_null_function(name);
@ -561,10 +632,22 @@ bool jit_compiler::add_sub_disk_space(ssz space)
}).second;
}
jit_compiler::jit_compiler(const std::unordered_map<std::string, u64>& _link, const std::string& _cpu, u32 flags)
jit_compiler::jit_compiler(const std::unordered_map<std::string, u64>& _link, const std::string& _cpu, u32 flags, std::function<u64(const std::string&)> symbols_cement) noexcept
: m_context(new llvm::LLVMContext)
, m_cpu(cpu(_cpu))
{
[[maybe_unused]] static const bool s_install_llvm_error_handler = []()
{
llvm::remove_fatal_error_handler();
llvm::install_fatal_error_handler([](void*, const char* msg, bool)
{
const std::string_view out = msg ? msg : "";
fmt::throw_exception("LLVM Emergency Exit Invoked: '%s'", out);
}, nullptr);
return true;
}();
std::string result;
auto null_mod = std::make_unique<llvm::Module> ("null_", *m_context);
@ -577,17 +660,17 @@ jit_compiler::jit_compiler(const std::unordered_map<std::string, u64>& _link, co
// Auxiliary JIT (does not use custom memory manager, only writes the objects)
if (flags & 0x1)
{
mem = std::make_unique<MemoryManager1>();
mem = std::make_unique<MemoryManager1>(std::move(symbols_cement));
}
else
{
mem = std::make_unique<MemoryManager2>();
mem = std::make_unique<MemoryManager2>(std::move(symbols_cement));
null_mod->setTargetTriple(jit_compiler::triple2());
}
}
else
{
mem = std::make_unique<MemoryManager1>();
mem = std::make_unique<MemoryManager1>(std::move(symbols_cement));
}
{
@ -595,11 +678,7 @@ jit_compiler::jit_compiler(const std::unordered_map<std::string, u64>& _link, co
.setErrorStr(&result)
.setEngineKind(llvm::EngineKind::JIT)
.setMCJITMemoryManager(std::move(mem))
#if LLVM_VERSION_MAJOR < 18
.setOptLevel(llvm::CodeGenOpt::Aggressive)
#else
.setOptLevel(llvm::CodeGenOptLevel::Aggressive)
#endif
.setCodeModel(flags & 0x2 ? llvm::CodeModel::Large : llvm::CodeModel::Small)
#ifdef __APPLE__
//.setCodeModel(llvm::CodeModel::Large)
@ -636,7 +715,19 @@ jit_compiler::jit_compiler(const std::unordered_map<std::string, u64>& _link, co
}
}
jit_compiler::~jit_compiler()
jit_compiler& jit_compiler::operator=(thread_state s) noexcept
{
if (s == thread_state::destroying_context)
{
// Release resources explicitly
m_engine.reset();
m_context.reset();
}
return *this;
}
jit_compiler::~jit_compiler() noexcept
{
}

View file

@ -2,7 +2,6 @@
#include "StrUtil.h"
#include "cfmt.h"
#include "util/endian.hpp"
#include "util/logs.hpp"
#include "util/v128.hpp"
#include <locale>

View file

@ -1703,23 +1703,58 @@ bool handle_access_violation(u32 addr, bool is_writing, ucontext_t* context) noe
cpu->state += cpu_flag::wait;
}
Emu.Pause(true);
if (!g_tls_access_violation_recovered)
{
vm_log.notice("\n%s", dump_useful_thread_info());
}
// Note: a thread may access violate more than once after hack_alloc recovery
// Do not log any further access violations in this case.
if (!g_tls_access_violation_recovered)
{
vm_log.notice("\n%s", dump_useful_thread_info());
vm_log.fatal("Access violation %s location 0x%x (%s)", is_writing ? "writing" : (cpu && cpu->get_class() == thread_class::ppu && cpu->get_pc() == addr ? "executing" : "reading"), addr, (is_writing && vm::check_addr(addr)) ? "read-only memory" : "unmapped memory");
}
while (Emu.IsPausedOrReady())
{
if (cpu)
{
auto state = +cpu->state;
if (::is_paused(state) && !::is_stopped(state))
{
thread_ctrl::wait_on(cpu->state, state);
}
else
{
// Temporary until Emulator updates state
std::this_thread::yield();
}
}
else
{
thread_ctrl::wait_for(1000);
}
}
Emu.Pause(true);
while (Emu.IsPaused())
{
thread_ctrl::wait();
if (cpu)
{
auto state = +cpu->state;
if (::is_paused(state) && !::is_stopped(state))
{
thread_ctrl::wait_on(cpu->state, state);
}
else
{
// Temporary until Emulator updates state
std::this_thread::yield();
}
}
else
{
thread_ctrl::wait_for(1000);
}
}
if (Emu.IsStopped() && !hack_alloc())
@ -1818,6 +1853,11 @@ static LONG exception_filter(PEXCEPTION_POINTERS pExp) noexcept
pExp->ExceptionRecord->ExceptionInformation[0] == 1 ? "writing" : "reading";
fmt::append(msg, "Segfault %s location %p at %p.\n", cause, pExp->ExceptionRecord->ExceptionInformation[1], pExp->ExceptionRecord->ExceptionAddress);
if (vm::try_get_addr(reinterpret_cast<u8*>(pExp->ExceptionRecord->ExceptionInformation[1])).second)
{
fmt::append(msg, "Sudo Addr: %p, VM Addr: %p\n", vm::g_sudo_addr, vm::g_base_addr);
}
}
else
{
@ -1999,6 +2039,11 @@ static void signal_handler(int /*sig*/, siginfo_t* info, void* uct) noexcept
std::string msg = fmt::format("Segfault %s location %p at %p.\n", cause, info->si_addr, RIP(context));
if (vm::try_get_addr(info->si_addr).second)
{
fmt::append(msg, "Sudo Addr: %p, VM Addr: %p\n", vm::g_sudo_addr, vm::g_base_addr);
}
append_thread_name(msg);
sys_log.fatal("\n%s", msg);

View file

@ -5,10 +5,6 @@
#include "util/shared_ptr.hpp"
#include <string>
#include <concepts>
#include "mutex.h"
#include "lockless.h"
// Hardware core layout
enum class native_core_arrangement : u32
@ -769,7 +765,7 @@ public:
}
// Move the context (if movable)
new (static_cast<void*>(m_threads + m_count - 1)) Thread(std::string(name) + std::to_string(m_count - 1), std::forward<Context>(f));
new (static_cast<void*>(m_threads + m_count - 1)) Thread(std::string(name) + std::to_string(m_count), std::forward<Context>(f));
}
// Constructor with a function performed before adding more threads

View file

@ -2,7 +2,6 @@
#include "util/types.hpp"
#include <string>
#include <vector>
#include <algorithm>
#include "util/asm.hpp"

View file

@ -1,6 +1,5 @@
#include "stdafx.h"
#include "cheat_info.h"
#include "Config.h"
#include "StrUtil.h"
LOG_CHANNEL(log_cheat, "Cheat");

View file

@ -1,5 +1,4 @@
#include "cond.h"
#include "sync.h"
// use constants, increase signal space

View file

@ -2,7 +2,6 @@
#include <util/types.hpp>
#include <unordered_set>
#include <vector>
#include <string>
// Patch utilities specific to PPU code

View file

@ -12,18 +12,12 @@
#include <Windows.h>
#include <ctime>
#elif __linux__
#include <errno.h>
#include <sys/syscall.h>
#include <linux/futex.h>
#include <sys/time.h>
#include <unistd.h>
#include <fcntl.h>
#endif
#include <algorithm>
#include <chrono>
#include <mutex>
#include <condition_variable>
#include <unordered_map>
#ifdef _WIN32
DYNAMIC_IMPORT("ntdll.dll", NtWaitForKeyedEvent, NTSTATUS(HANDLE, PVOID Key, BOOLEAN Alertable, PLARGE_INTEGER Timeout));
@ -60,6 +54,9 @@ struct futex_waitv
};
#endif
#else
#include <condition_variable>
enum
{
FUTEX_PRIVATE_FLAG = 0,

View file

@ -1,6 +1,7 @@
#include "util/types.hpp"
#include <vector>
#include <mutex>
#include "Emu/Cell/timers.hpp"
// Thread-safe object pool with garbage collection
class universal_pool

View file

@ -38,13 +38,13 @@ jobs:
displayName: ccache
- bash: |
docker pull --quiet rpcs3/rpcs3-ci-focal:1.9
docker pull --quiet rpcs3/rpcs3-ci-jammy:1.0
docker run \
-v $(pwd):/rpcs3 \
--env-file .ci/docker.env \
-v $CCACHE_DIR:/root/.ccache \
-v $BUILD_ARTIFACTSTAGINGDIRECTORY:/root/artifacts \
rpcs3/rpcs3-ci-focal:1.9 \
rpcs3/rpcs3-ci-jammy:1.0 \
/rpcs3/.ci/build-linux.sh
displayName: Docker setup and build
@ -134,7 +134,7 @@ jobs:
ARTDIR: $(Build.ArtifactStagingDirectory)
QT_VER: '6.7.3'
QT_VER_MAIN: '6'
LLVM_COMPILER_VER: '16'
LLVM_COMPILER_VER: '19'
pool:
vmImage: "macOS-13"
@ -195,7 +195,7 @@ jobs:
ARTDIR: $(Build.ArtifactStagingDirectory)
QT_VER: '6.7.3'
QT_VER_MAIN: '6'
LLVM_COMPILER_VER: '16'
LLVM_COMPILER_VER: '19'
pool:
vmImage: "macOS-13"

View file

@ -14,7 +14,7 @@
<PreprocessorDefinitions>LLVM_AVAILABLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<AdditionalLibraryDirectories Condition="'$(Configuration)'=='Debug'">%(AdditionalLibraryDirectories);$(SolutionDir)build\lib\$(Configuration)-$(Platform)\llvm_build\lib;$(SolutionDir)build\lib_ext\$(Configuration)-$(Platform)\llvm_build\$(Configuration)\lib</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories Condition="'$(Configuration)'=='Debug'">%(AdditionalLibraryDirectories);$(SolutionDir)build\lib\$(Configuration)-$(Platform)\llvm_build\lib;$(SolutionDir)build\lib_ext\$(Configuration)-$(Platform)\llvm_build\$(Configuration)\lib;$(SolutionDir)build\lib_ext\$(Configuration)-$(Platform)\llvm_build\lib</AdditionalLibraryDirectories>
<AdditionalDependencies>%(AdditionalDependencies);
LLVMAggressiveInstCombine.lib;
LLVMAnalysis.lib;
@ -25,11 +25,13 @@
LLVMBitstreamReader.lib;
LLVMBitWriter.lib;
LLVMCFGuard.lib;
LLVMCFIVerify.lib;
LLVMCodeGen.lib;
LLVMCodeGenData.lib;
LLVMCodeGenTypes.lib;
LLVMCore.lib;
LLVMCoroutines.lib;
LLVMCoverage.lib;
LLVMDebugInfoBTF.lib;
LLVMDebugInfoCodeView.lib;
LLVMDebuginfod.lib;
LLVMDebugInfoDWARF.lib;
@ -38,25 +40,27 @@
LLVMDebugInfoMSF.lib;
LLVMDebugInfoPDB.lib;
LLVMDemangle.lib;
LLVMDiff.lib;
LLVMDlltoolDriver.lib;
LLVMDWARFLinker.lib;
LLVMDWARFLinkerClassic.lib;
LLVMDWARFLinkerParallel.lib;
LLVMDWP.lib;
LLVMExecutionEngine.lib;
LLVMExegesis.lib;
LLVMExegesisX86.lib;
LLVMExtensions.lib;
LLVMFileCheck.lib;
LLVMFrontendDriver.lib;
LLVMFrontendHLSL.lib;
LLVMFrontendOffloading.lib;
LLVMFrontendOpenACC.lib;
LLVMFrontendOpenMP.lib;
LLVMFuzzerCLI.lib;
LLVMFuzzMutate.lib;
LLVMGlobalISel.lib;
LLVMHipStdPar.lib;
LLVMInstCombine.lib;
LLVMInstrumentation.lib;
LLVMIntelJITEvents.lib;
LLVMIntelJITProfiling.lib;
LLVMInterfaceStub.lib;
LLVMInterpreter.lib;
LLVMipo.lib;
@ -67,10 +71,10 @@
LLVMLineEditor.lib;
LLVMLinker.lib;
LLVMLTO.lib;
LLVMMC.lib;
LLVMMCA.lib;
LLVMMCDisassembler.lib;
LLVMMCJIT.lib;
LLVMMC.lib;
LLVMMCParser.lib;
LLVMMIRParser.lib;
LLVMObjCARCOpts.lib;
@ -78,6 +82,7 @@
LLVMObject.lib;
LLVMObjectYAML.lib;
LLVMOption.lib;
LLVMOrcDebugging.lib;
LLVMOrcJIT.lib;
LLVMOrcShared.lib;
LLVMOrcTargetProcess.lib;
@ -85,15 +90,18 @@
LLVMProfileData.lib;
LLVMRemarks.lib;
LLVMRuntimeDyld.lib;
LLVMSandboxIR.lib;
LLVMScalarOpts.lib;
LLVMSelectionDAG.lib;
LLVMSupport.lib;
LLVMSymbolize.lib;
LLVMTableGenGlobalISel.lib;
LLVMTableGen.lib;
LLVMTableGenBasic.lib;
LLVMTableGenCommon.lib;
LLVMTarget.lib;
LLVMTargetParser.lib;
LLVMTextAPI.lib;
LLVMTextAPIBinaryReader.lib;
LLVMTransformUtils.lib;
LLVMVectorize.lib;
LLVMWindowsDriver.lib;

View file

@ -15,7 +15,7 @@
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalLibraryDirectories Condition="'$(Configuration)'=='Release'">%(AdditionalLibraryDirectories);$(SolutionDir)build\lib\$(Configuration)-$(Platform)\llvm_build\lib;$(SolutionDir)build\lib_ext\$(Configuration)-$(Platform)\llvm_build\$(Configuration)\lib</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories Condition="'$(Configuration)'=='Release'">%(AdditionalLibraryDirectories);$(SolutionDir)build\lib\$(Configuration)-$(Platform)\llvm_build\lib;$(SolutionDir)build\lib_ext\$(Configuration)-$(Platform)\llvm_build\$(Configuration)\lib;$(SolutionDir)build\lib_ext\$(Configuration)-$(Platform)\llvm_build\lib</AdditionalLibraryDirectories>
<AdditionalDependencies>%(AdditionalDependencies);
LLVMAggressiveInstCombine.lib;
LLVMAnalysis.lib;
@ -26,11 +26,13 @@
LLVMBitstreamReader.lib;
LLVMBitWriter.lib;
LLVMCFGuard.lib;
LLVMCFIVerify.lib;
LLVMCodeGen.lib;
LLVMCodeGenData.lib;
LLVMCodeGenTypes.lib;
LLVMCore.lib;
LLVMCoroutines.lib;
LLVMCoverage.lib;
LLVMDebugInfoBTF.lib;
LLVMDebugInfoCodeView.lib;
LLVMDebuginfod.lib;
LLVMDebugInfoDWARF.lib;
@ -39,25 +41,27 @@
LLVMDebugInfoMSF.lib;
LLVMDebugInfoPDB.lib;
LLVMDemangle.lib;
LLVMDiff.lib;
LLVMDlltoolDriver.lib;
LLVMDWARFLinker.lib;
LLVMDWARFLinkerClassic.lib;
LLVMDWARFLinkerParallel.lib;
LLVMDWP.lib;
LLVMExecutionEngine.lib;
LLVMExegesis.lib;
LLVMExegesisX86.lib;
LLVMExtensions.lib;
LLVMFileCheck.lib;
LLVMFrontendDriver.lib;
LLVMFrontendHLSL.lib;
LLVMFrontendOffloading.lib;
LLVMFrontendOpenACC.lib;
LLVMFrontendOpenMP.lib;
LLVMFuzzerCLI.lib;
LLVMFuzzMutate.lib;
LLVMGlobalISel.lib;
LLVMHipStdPar.lib;
LLVMInstCombine.lib;
LLVMInstrumentation.lib;
LLVMIntelJITEvents.lib;
LLVMIntelJITProfiling.lib;
LLVMInterfaceStub.lib;
LLVMInterpreter.lib;
LLVMipo.lib;
@ -68,10 +72,10 @@
LLVMLineEditor.lib;
LLVMLinker.lib;
LLVMLTO.lib;
LLVMMC.lib;
LLVMMCA.lib;
LLVMMCDisassembler.lib;
LLVMMCJIT.lib;
LLVMMC.lib;
LLVMMCParser.lib;
LLVMMIRParser.lib;
LLVMObjCARCOpts.lib;
@ -79,6 +83,7 @@
LLVMObject.lib;
LLVMObjectYAML.lib;
LLVMOption.lib;
LLVMOrcDebugging.lib;
LLVMOrcJIT.lib;
LLVMOrcShared.lib;
LLVMOrcTargetProcess.lib;
@ -86,15 +91,18 @@
LLVMProfileData.lib;
LLVMRemarks.lib;
LLVMRuntimeDyld.lib;
LLVMSandboxIR.lib;
LLVMScalarOpts.lib;
LLVMSelectionDAG.lib;
LLVMSupport.lib;
LLVMSymbolize.lib;
LLVMTableGenGlobalISel.lib;
LLVMTableGen.lib;
LLVMTableGenBasic.lib;
LLVMTableGenCommon.lib;
LLVMTarget.lib;
LLVMTargetParser.lib;
LLVMTextAPI.lib;
LLVMTextAPIBinaryReader.lib;
LLVMTransformUtils.lib;
LLVMVectorize.lib;
LLVMWindowsDriver.lib;

View file

@ -114,6 +114,8 @@ target_link_libraries(rpcs3
3rdparty::fusion
${ADDITIONAL_LIBS})
set_target_properties(rpcs3_emu PROPERTIES INTERPROCEDURAL_OPTIMIZATION TRUE)
# Unix display manager
if(X11_FOUND)
target_link_libraries(rpcs3 PRIVATE X11::X11)

View file

@ -598,7 +598,10 @@ int aes_setkey_dec( aes_context *ctx, const unsigned char *key, unsigned int key
*RK++ = *SK++;
*RK++ = *SK++;
#if defined(__SSE2__) || defined(_M_X64)
done:
#endif
// Wipe the stack buffer clean
std::fill_n(reinterpret_cast<volatile char*>(&cty), sizeof(cty), 0);

View file

@ -2,7 +2,7 @@
// Licensed under the terms of the GNU GPL, version 2
// http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
#include "utils.h"
#include "util/types.hpp"
#include <cstring>
static inline int bn_compare(u8* a, u8* b, u32 n)

View file

@ -2,6 +2,7 @@
// Licensed under the terms of the GNU GPL, version 2.0 or later versions.
// http://www.gnu.org/licenses/gpl-2.0.txt
#include <string.h>
#include "lz.h"
void decode_range(unsigned int *range, unsigned int *code, unsigned char **src)

View file

@ -6,8 +6,6 @@
// Reverse-engineered custom LempelZivMarkov based compression.
#include <string.h>
void decode_range(unsigned int *range, unsigned int *code, unsigned char **src);
int decode_bit(unsigned int *range, unsigned int *code, int *index, unsigned char **src, unsigned char *c);
int decode_number(unsigned char *ptr, int index, int *bit_flag, unsigned int *range, unsigned int *code, unsigned char **src);

View file

@ -4,6 +4,7 @@
#include "sha1.h"
#include "lz.h"
#include "ec.h"
#include "utils.h"
#include "Emu/system_utils.hpp"

View file

@ -1,9 +1,6 @@
#pragma once
#include <array>
#include "utils.h"
#include "Utilities/File.h"
constexpr u32 SDAT_FLAG = 0x01000000;

View file

@ -5,7 +5,6 @@
#include "util/logs.hpp"
#include "Utilities/StrUtil.h"
#include "Utilities/Thread.h"
#include "Utilities/mutex.h"
#include "Emu/System.h"
#include "Emu/system_utils.hpp"
#include "Emu/VFS.h"

View file

@ -1,14 +1,11 @@
#include "stdafx.h"
#include "aes.h"
#include "utils.h"
#include "unself.h"
#include "Emu/VFS.h"
#include "util/asm.hpp"
#include "Emu/System.h"
#include "Emu/system_utils.hpp"
#include "Crypto/unzip.h"
#include <algorithm>
inline u8 Read8(const fs::file& f)
{
u8 ret;

View file

@ -5,7 +5,6 @@
// http://www.gnu.org/licenses/gpl-2.0.txt
#include "util/types.hpp"
#include "util/asm.hpp"
#include <stdlib.h>

View file

@ -1,6 +1,5 @@
#include "stdafx.h"
#include "AudioBackend.h"
#include "Emu/system_config.h"
#include "Emu/IdManager.h"
#include "Emu//Cell/Modules/cellAudioOut.h"

View file

@ -1,7 +1,5 @@
#pragma once
#include <memory>
#include "Utilities/mutex.h"
#include "util/atomic.hpp"
#include "Emu/Audio/AudioBackend.h"

View file

@ -4,7 +4,6 @@
#include "stdafx.h"
#include "FAudioBackend.h"
#include "Emu/system_config.h"
#include "Emu/System.h"
#include "Emu/Audio/audio_device_enumerator.h"
#include "Utilities/StrUtil.h"

View file

@ -4,8 +4,6 @@
#error "FAudio support disabled but still being built."
#endif
#include <memory>
#include "Utilities/mutex.h"
#include "Emu/Audio/AudioBackend.h"
#include "FAudio.h"

View file

@ -3,7 +3,6 @@
#endif
#include "Emu/Audio/FAudio/faudio_enumerator.h"
#include <array>
#include <algorithm>
#include "Utilities/StrUtil.h"
#include "util/logs.hpp"

View file

@ -4,8 +4,6 @@
#error "XAudio2 can only be built on Windows."
#endif
#include <memory>
#include "Utilities/mutex.h"
#include "Emu/Audio/AudioBackend.h"
#include <initguid.h>

View file

@ -462,6 +462,7 @@ target_sources(rpcs3_emu PRIVATE
NP/rpcn_countries.cpp
NP/upnp_config.cpp
NP/upnp_handler.cpp
NP/ip_address.cpp
)
# Memory
@ -478,6 +479,7 @@ target_sources(rpcs3_emu PRIVATE
RSX/Common/TextureUtils.cpp
RSX/Common/texture_cache.cpp
RSX/Core/RSXContext.cpp
RSX/Core/RSXDisplay.cpp
RSX/Core/RSXDrawCommands.cpp
RSX/gcm_enums.cpp
RSX/gcm_printing.cpp
@ -492,6 +494,7 @@ target_sources(rpcs3_emu PRIVATE
RSX/GL/GLPipelineCompiler.cpp
RSX/GL/GLPresent.cpp
RSX/GL/GLRenderTargets.cpp
RSX/GL/GLResolveHelper.cpp
RSX/GL/GLShaderInterpreter.cpp
RSX/GL/GLTexture.cpp
RSX/GL/GLTextureCache.cpp

View file

@ -3,7 +3,6 @@
#include "CPUTranslator.h"
#include "util/v128.hpp"
#include "util/simd.hpp"
#include "util/logs.hpp"
LOG_CHANNEL(llvm_log, "LLVM");

View file

@ -21,7 +21,6 @@
#include "llvm/IR/Module.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Support/KnownBits.h"
#include "llvm/Support/ModRef.h"
#include "llvm/Analysis/ConstantFolding.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/IR/IntrinsicsX86.h"
@ -37,7 +36,6 @@
#include "util/types.hpp"
#include "util/sysinfo.hpp"
#include "Utilities/StrFmt.h"
#include "Utilities/BitField.h"
#include "Utilities/JIT.h"
#include "util/v128.hpp"

View file

@ -4,7 +4,6 @@
#include "Utilities/Thread.h"
#include "Emu/Cell/lv2/sys_spu.h"
#include "Emu/Cell/lv2/sys_sync.h"
#include <thread>

View file

@ -3,9 +3,9 @@
#include "Emu/system_config.h"
#include "Emu/Audio/audio_utils.h"
#include "Emu/Cell/PPUModule.h"
#include "Emu/Cell/timers.hpp"
#include "Emu/Cell/lv2/sys_process.h"
#include "Emu/Cell/lv2/sys_event.h"
#include "Emu/Cell/Modules/cellAudioOut.h"
#include "cellAudio.h"
#include "util/video_provider.h"
@ -704,7 +704,7 @@ void cell_audio_thread::operator()()
thread_ctrl::scoped_priority high_prio(+1);
while (Emu.IsPaused())
while (Emu.IsPausedOrReady())
{
thread_ctrl::wait_for(5000);
}

View file

@ -1,7 +1,6 @@
#pragma once
#include "util/types.hpp"
#include "util/endian.hpp"
// Error codes
enum CellAudioInError : u32

View file

@ -6,6 +6,7 @@
#include "Emu/Cell/PPUModule.h"
#include "Emu/Cell/lv2/sys_event.h"
#include "Emu/IdManager.h"
#include "Emu/Cell/timers.hpp"
#include <cmath>
@ -1640,14 +1641,14 @@ void camera_context::operator()()
while (thread_ctrl::state() != thread_state::aborting && !Emu.IsStopped())
{
// send ATTACH event
if (init && is_attached_dirty && !Emu.IsPaused())
if (init && is_attached_dirty && !Emu.IsPausedOrReady())
{
send_attach_state(is_attached);
}
const s32 fps = info.framerate;
if (!init || !fps || Emu.IsPaused() || g_cfg.io.camera == camera_handler::null)
if (!init || !fps || Emu.IsPausedOrReady() || g_cfg.io.camera == camera_handler::null)
{
thread_ctrl::wait_for(1000); // hack
continue;

View file

@ -1,9 +1,9 @@
#pragma once
#include "Utilities/Timer.h"
#include "Emu/Cell/lv2/sys_memory.h"
#include "Utilities/Thread.h"
#include "Emu/Io/camera_handler_base.h"
#include "Emu/Memory/vm_ptr.h"
#include "Utilities/mutex.h"
#include <map>

View file

@ -9,6 +9,8 @@
#include "util/asm.hpp"
#include <thread>
LOG_CHANNEL(cellDmux);
template <>

View file

@ -1,6 +1,7 @@
#pragma once
#include "Emu/Memory/vm_ptr.h"
#include "cellPamf.h"
// Error Codes
enum CellDmuxError :u32

View file

@ -2,7 +2,6 @@
#include "Emu/Cell/PPUModule.h"
#include "Emu/IdManager.h"
#include "cellPamf.h"
#include "cellDmux.h"
#include "cellDmuxPamf.h"

View file

@ -6,6 +6,7 @@
#include "Emu/IdManager.h"
#include "Emu/Cell/ErrorCodes.h"
#include "Emu/Cell/PPUModule.h"
#include "Emu/Cell/timers.hpp"
#include "Emu/Cell/lv2/sys_fs.h"
#include "Emu/Cell/lv2/sys_sync.h"

View file

@ -3,6 +3,7 @@
#include "cellCamera.h"
#include "Emu/Cell/lv2/sys_event.h"
#include "Emu/Cell/lv2/sys_memory.h"
#include "Emu/Cell/PPUModule.h"
#include "Emu/Cell/timers.hpp"
#include "Emu/Io/MouseHandler.h"
@ -247,7 +248,7 @@ public:
u32 hue = 0; // Tracking hue of the motion controller
f32 distance_mm{3000.0f}; // Distance from the camera in mm
f32 radius{5.0f}; // Radius of the sphere in camera pixels
bool radius_valid = true; // If the radius and distance of the sphere was computed.
bool radius_valid = false; // If the radius and distance of the sphere was computed. Also used for visibility.
bool is_calibrating{false}; // Whether or not we are currently calibrating
u64 calibration_start_us{0}; // The start timestamp of the calibration in microseconds
@ -321,13 +322,28 @@ public:
void update_connections()
{
connected_controllers = 0;
const auto update_connection = [this](u32 i, bool connected)
{
if (connected)
{
connected_controllers++;
controllers[i].status = CELL_GEM_STATUS_READY;
controllers[i].port = port_num(i);
}
else
{
controllers[i].status = CELL_GEM_STATUS_DISCONNECTED;
controllers[i].port = 0;
}
};
switch (g_cfg.io.move)
{
case move_handler::real:
case move_handler::fake:
{
connected_controllers = 0;
std::lock_guard lock(pad::g_pad_mutex);
const auto handler = pad::get_pad_thread(true);
if (!handler) break;
@ -335,51 +351,41 @@ public:
for (u32 i = 0; i < CELL_GEM_MAX_NUM; i++)
{
const auto& pad = ::at32(handler->GetPads(), pad_num(i));
const bool connected = (pad && (pad->m_port_status & CELL_PAD_STATUS_CONNECTED) && i < attribute.max_connect);
const bool connected = pad && (pad->m_port_status & CELL_PAD_STATUS_CONNECTED) && i < attribute.max_connect;
const bool is_real_move = g_cfg.io.move != move_handler::real || pad->m_pad_handler == pad_handler::move;
if (connected && is_real_move)
{
connected_controllers++;
controllers[i].status = CELL_GEM_STATUS_READY;
controllers[i].port = port_num(i);
}
else
{
controllers[i].status = CELL_GEM_STATUS_DISCONNECTED;
controllers[i].port = 0;
}
update_connection(i, connected && is_real_move);
}
break;
}
case move_handler::mouse:
case move_handler::raw_mouse:
{
connected_controllers = 0;
auto& handler = g_fxo->get<MouseHandlerBase>();
std::lock_guard mouse_lock(handler.mutex);
const MouseInfo& info = handler.GetInfo();
for (u32 i = 0; i < CELL_GEM_MAX_NUM; i++)
{
const bool connected = i < attribute.max_connect && info.status[i] == CELL_MOUSE_STATUS_CONNECTED;
if (connected)
{
connected_controllers++;
controllers[i].status = CELL_GEM_STATUS_READY;
controllers[i].port = port_num(i);
}
else
{
controllers[i].status = CELL_GEM_STATUS_DISCONNECTED;
controllers[i].port = 0;
}
update_connection(i, i < attribute.max_connect && info.status[i] == CELL_MOUSE_STATUS_CONNECTED);
}
break;
}
default:
#ifdef HAVE_LIBEVDEV
case move_handler::gun:
{
gun_thread& gun = g_fxo->get<gun_thread>();
std::scoped_lock lock(gun.handler.mutex);
gun.num_devices = gun.handler.init() ? gun.handler.get_num_guns() : 0;
for (u32 i = 0; i < CELL_GEM_MAX_NUM; i++)
{
update_connection(i, i < attribute.max_connect && i < gun.num_devices);
}
break;
}
#endif
case move_handler::null:
{
break;
}
@ -1598,13 +1604,17 @@ static inline void draw_overlay_cursor(u32 gem_num, const gem_config::gem_contro
rsx::overlays::set_cursor(rsx::overlays::cursor_offset::cell_gem + gem_num, x, y, color, 2'000'000, false);
}
static inline void pos_to_gem_image_state(u32 gem_num, const gem_config::gem_controller& controller, vm::ptr<CellGemImageState>& gem_image_state, s32 x_pos, s32 y_pos, s32 x_max, s32 y_max)
static inline void pos_to_gem_image_state(u32 gem_num, gem_config::gem_controller& controller, vm::ptr<CellGemImageState>& gem_image_state, s32 x_pos, s32 y_pos, s32 x_max, s32 y_max)
{
const auto& shared_data = g_fxo->get<gem_camera_shared>();
if (x_max <= 0) x_max = shared_data.width;
if (y_max <= 0) y_max = shared_data.height;
// Move the cursor out of the screen if we're at the screen border (Time Crisis 4 needs this)
if (x_pos <= 0) x_pos -= x_max / 10; else if (x_pos >= x_max) x_pos += x_max / 10;
if (y_pos <= 0) y_pos -= y_max / 10; else if (y_pos >= y_max) y_pos += y_max / 10;
const f32 scaling_width = x_max / static_cast<f32>(shared_data.width);
const f32 scaling_height = y_max / static_cast<f32>(shared_data.height);
const f32 mmPerPixel = CELL_GEM_SPHERE_RADIUS_MM / controller.radius;
@ -1629,6 +1639,13 @@ static inline void pos_to_gem_image_state(u32 gem_num, const gem_config::gem_con
gem_image_state->projectionx = camera_x / controller.distance_mm;
gem_image_state->projectiony = camera_y / controller.distance_mm;
// Update visibility for fake handlers
if (g_cfg.io.move != move_handler::real)
{
// Let's say the sphere is not visible if the position is at the edge of the screen
controller.radius_valid = x_pos > 0 && x_pos < x_max && y_pos > 0 && y_pos < y_max;
}
if (g_cfg.io.show_move_cursor)
{
draw_overlay_cursor(gem_num, controller, x_pos, y_pos, x_max, y_max);
@ -1647,6 +1664,10 @@ static inline void pos_to_gem_state(u32 gem_num, gem_config::gem_controller& con
if (x_max <= 0) x_max = shared_data.width;
if (y_max <= 0) y_max = shared_data.height;
// Move the cursor out of the screen if we're at the screen border (Time Crisis 4 needs this)
if (x_pos <= 0) x_pos -= x_max / 10; else if (x_pos >= x_max) x_pos += x_max / 10;
if (y_pos <= 0) y_pos -= y_max / 10; else if (y_pos >= y_max) y_pos += y_max / 10;
const f32 scaling_width = x_max / static_cast<f32>(shared_data.width);
const f32 scaling_height = y_max / static_cast<f32>(shared_data.height);
const f32 mmPerPixel = CELL_GEM_SPHERE_RADIUS_MM / controller.radius;
@ -1712,6 +1733,13 @@ static inline void pos_to_gem_state(u32 gem_num, gem_config::gem_controller& con
gem_state->quat[3] = q_w;
}
// Update visibility for fake handlers
if (g_cfg.io.move != move_handler::real)
{
// Let's say the sphere is not visible if the position is at the edge of the screen
controller.radius_valid = x_pos > 0 && x_pos < x_max && y_pos > 0 && y_pos < y_max;
}
if (g_cfg.io.show_move_cursor)
{
draw_overlay_cursor(gem_num, controller, x_pos, y_pos, x_max, y_max);
@ -1730,7 +1758,7 @@ extern bool is_input_allowed();
* Unavoidably buttons conflict with DS3 mappings, which is problematic for some games.
* \param gem_num gem index to use
* \param digital_buttons Bitmask filled with CELL_GEM_CTRL_* values
* \param analog_t Analog value of Move's Trigger. Currently mapped to R2.
* \param analog_t Analog value of Move's Trigger.
* \return true on success, false if controller is disconnected
*/
static void ds3_input_to_pad(const u32 gem_num, be_t<u16>& digital_buttons, be_t<u16>& analog_t)
@ -1810,22 +1838,17 @@ static inline void ds3_get_stick_values(u32 gem_num, const std::shared_ptr<Pad>&
const auto& cfg = ::at32(g_cfg_gem_fake.players, gem_num);
cfg->handle_input(pad, true, [&](gem_btn btn, pad_button /*pad_btn*/, u16 value, bool pressed, bool& /*abort*/)
{
if (!pressed)
return;
{
if (!pressed)
return;
switch (btn)
{
case gem_btn::x_axis:
x_pos = value;
break;
case gem_btn::y_axis:
y_pos = value;
break;
default:
break;
}
});
switch (btn)
{
case gem_btn::x_axis: x_pos = value; break;
case gem_btn::y_axis: y_pos = value; break;
default: break;
}
});
}
template <typename T>
@ -2095,7 +2118,7 @@ static bool mouse_input_to_pad(u32 mouse_no, be_t<u16>& digital_buttons, be_t<u1
}
});
analog_t = (digital_buttons & CELL_GEM_CTRL_T) ? 0xFFFF : 0;
analog_t = (digital_buttons & CELL_GEM_CTRL_T) ? 255 : 0;
return true;
}
@ -2168,7 +2191,7 @@ static bool gun_input_to_pad(u32 gem_no, be_t<u16>& digital_buttons, be_t<u16>&
if (gun.handler.get_button(gem_no, gun_button::btn_6) == 1)
digital_buttons |= CELL_GEM_CTRL_SQUARE;
analog_t = gun.handler.get_button(gem_no, gun_button::btn_left) ? 0xFFFF : 0;
analog_t = gun.handler.get_button(gem_no, gun_button::btn_left) ? 255 : 0;
return true;
}
@ -2657,6 +2680,7 @@ error_code cellGemGetImageState(u32 gem_num, vm::ptr<CellGemImageState> gem_imag
cellGem.warning("cellGemGetImageState(gem_num=%d, image_state=&0x%x)", gem_num, gem_image_state);
auto& gem = g_fxo->get<gem_config>();
std::scoped_lock lock(gem.mtx);
if (!gem.state)
{
@ -2677,10 +2701,6 @@ error_code cellGemGetImageState(u32 gem_num, vm::ptr<CellGemImageState> gem_imag
gem_image_state->frame_timestamp = shared_data.frame_timestamp_us.load();
gem_image_state->timestamp = gem_image_state->frame_timestamp + 10;
gem_image_state->r = controller.radius; // Radius in camera pixels
gem_image_state->distance = controller.distance_mm;
gem_image_state->visible = gem.is_controller_ready(gem_num);
gem_image_state->r_valid = controller.radius_valid;
switch (g_cfg.io.move)
{
@ -2702,6 +2722,11 @@ error_code cellGemGetImageState(u32 gem_num, vm::ptr<CellGemImageState> gem_imag
case move_handler::null:
fmt::throw_exception("Unreachable");
}
gem_image_state->r = controller.radius; // Radius in camera pixels
gem_image_state->distance = controller.distance_mm;
gem_image_state->visible = controller.radius_valid && gem.is_controller_ready(gem_num);
gem_image_state->r_valid = controller.radius_valid;
}
return CELL_OK;
@ -3234,7 +3259,35 @@ error_code cellGemPrepareCamera(s32 max_exposure, f32 image_quality)
max_exposure = std::clamp(max_exposure, static_cast<s32>(CELL_GEM_MIN_CAMERA_EXPOSURE), static_cast<s32>(CELL_GEM_MAX_CAMERA_EXPOSURE));
image_quality = std::clamp(image_quality, 0.0f, 1.0f);
// TODO: prepare camera
// TODO: prepare camera properly
extern error_code cellCameraGetAttribute(s32 dev_num, s32 attrib, vm::ptr<u32> arg1, vm::ptr<u32> arg2);
extern error_code cellCameraSetAttribute(s32 dev_num, s32 attrib, u32 arg1, u32 arg2);
extern error_code cellCameraGetBufferInfoEx(s32 dev_num, vm::ptr<CellCameraInfoEx> info);
vm::var<CellCameraInfoEx> info = vm::make_var<CellCameraInfoEx>({});
vm::var<u32> arg1 = vm::make_var<u32>({});
vm::var<u32> arg2 = vm::make_var<u32>({});
cellCameraGetAttribute(0, 0x3e6, arg1, arg2);
cellCameraSetAttribute(0, 0x3e6, 0x3e, *arg2 | 0x80);
cellCameraGetBufferInfoEx(0, info);
if (info->width == 640)
{
// Disable some features
cellCameraSetAttribute(0, CELL_CAMERA_AGC, 0, 0);
cellCameraSetAttribute(0, CELL_CAMERA_AWB, 0, 0);
cellCameraSetAttribute(0, CELL_CAMERA_AEC, 0, 0);
cellCameraSetAttribute(0, CELL_CAMERA_GAMMA, 0, 0);
cellCameraSetAttribute(0, CELL_CAMERA_PIXELOUTLIERFILTER, 0, 0);
// Set new values for others
cellCameraSetAttribute(0, CELL_CAMERA_GREENGAIN, 96, 0);
cellCameraSetAttribute(0, CELL_CAMERA_REDBLUEGAIN, 64, 96);
cellCameraSetAttribute(0, CELL_CAMERA_GAIN, 0, 0); // TODO
cellCameraSetAttribute(0, CELL_CAMERA_EXPOSURE, 0, 0); // TODO
}
return CELL_OK;
}

View file

@ -9,8 +9,6 @@
#include "Emu/Cell/lv2/sys_fs.h"
#include "cellGifDec.h"
#include "util/asm.hpp"
LOG_CHANNEL(cellGifDec);
// Temporarily

View file

@ -9,8 +9,6 @@
#include "Emu/Cell/lv2/sys_fs.h"
#include "cellJpgDec.h"
#include "util/asm.hpp"
LOG_CHANNEL(cellJpgDec);
// Temporarily

View file

@ -1,6 +1,6 @@
#include "stdafx.h"
#include "Emu/Cell/PPUModule.h"
#include "cellKb.h"
#include "Emu/Io/Keyboard.h"
LOG_CHANNEL(cellKey2char);

File diff suppressed because it is too large Load diff

View file

@ -52,25 +52,25 @@ enum
L10N_CODEPAGE_863,
L10N_CODEPAGE_866,
L10N_CODEPAGE_932,
L10N_SHIFT_JIS,
L10N_SHIFT_JIS = L10N_CODEPAGE_932,
L10N_CODEPAGE_936,
L10N_GBK,
L10N_GBK = L10N_CODEPAGE_936,
L10N_CODEPAGE_949,
L10N_UHC,
L10N_UHC = L10N_CODEPAGE_949,
L10N_CODEPAGE_950,
L10N_BIG5,
L10N_BIG5 = L10N_CODEPAGE_950,
L10N_CODEPAGE_1251,
L10N_CODEPAGE_1252,
L10N_EUC_CN,
L10N_EUC_JP,
L10N_EUC_KR,
L10N_ISO_2022_JP,
L10N_JIS,
L10N_JIS = L10N_ISO_2022_JP,
L10N_ARIB,
L10N_HZ,
L10N_GB18030,
L10N_RIS_506,
L10N_MUSIC_SHIFT_JIS,
L10N_MUSIC_SHIFT_JIS = L10N_RIS_506,
//FW 3.10 and below
L10N_CODEPAGE_852,
L10N_CODEPAGE_1250,
@ -88,3 +88,12 @@ enum
L10N_CODEPAGE_869,
_L10N_CODE_
};
enum
{
UTF16_SURROGATES_MASK1 = 0xf800,
UTF16_SURROGATES_MASK2 = 0xfc00,
UTF16_SURROGATES = 0xd800,
UTF16_HIGH_SURROGATES = 0xd800,
UTF16_LOW_SURROGATES = 0xdc00,
};

View file

@ -1,5 +1,4 @@
#include "stdafx.h"
#include "Emu/System.h"
#include "Emu/system_config.h"
#include "Emu/Cell/PPUModule.h"
#include "Utilities/StrUtil.h"
@ -10,6 +9,8 @@
#include <numeric>
#include "3rdparty/OpenAL/openal-soft/include/AL/alext.h"
LOG_CHANNEL(cellMic);
template<>

View file

@ -1,9 +1,8 @@
#pragma once
#include "Utilities/Thread.h"
#include "Emu/Cell/timers.hpp"
#include "3rdparty/OpenAL/openal-soft/include/AL/alext.h"
#include "3rdparty/OpenAL/openal-soft/include/AL/alc.h"
#include "Utilities/mutex.h"
// Error Codes
enum CellMicInError : u32

View file

@ -1,6 +1,5 @@
#include "stdafx.h"
#include "Emu/IdManager.h"
#include "Emu/System.h"
#include "Emu/Cell/PPUModule.h"
#include "Emu/Io/MouseHandler.h"

View file

@ -213,19 +213,29 @@ error_code cell_music_select_contents()
error_code error = rsx::overlays::show_media_list_dialog(rsx::overlays::media_list_dialog::media_type::audio, vfs_dir_path, title,
[&music](s32 status, utils::media_info info)
{
sysutil_register_cb([&music, info, status](ppu_thread& ppu) -> s32
sysutil_register_cb([&music, info = std::move(info), status](ppu_thread& ppu) -> s32
{
std::lock_guard lock(music.mtx);
const u32 result = status >= 0 ? u32{CELL_OK} : u32{CELL_MUSIC_CANCELED};
if (result == CELL_OK)
{
// Let's always choose the whole directory for now
std::string track;
std::string dir = info.path;
if (fs::is_file(info.path))
{
track = std::move(dir);
dir = fs::get_parent_dir(track);
}
music_selection_context context{};
context.set_playlist(info.path);
context.set_playlist(dir);
context.set_track(track);
// TODO: context.repeat_mode = CELL_SEARCH_REPEATMODE_NONE;
// TODO: context.context_option = CELL_SEARCH_CONTEXTOPTION_NONE;
music.current_selection_context = context;
music.current_selection_context = std::move(context);
music.current_selection_context.create_playlist(music_selection_context::get_next_hash());
cellMusic.success("Media list dialog: selected entry '%s'", context.playlist.front());
cellMusic.success("Media list dialog: selected entry '%s'", music.current_selection_context.playlist.front());
}
else
{
@ -556,7 +566,7 @@ error_code cellMusicSetPlaybackCommand2(s32 command, vm::ptr<void> param)
auto& music = g_fxo->get<music_state>();
if (!music.func)
return CELL_MUSIC2_ERROR_GENERIC;
return { CELL_MUSIC2_ERROR_GENERIC, "Not initialized" };
error_code result = CELL_OK;
@ -585,7 +595,7 @@ error_code cellMusicSetPlaybackCommand(s32 command, vm::ptr<void> param)
auto& music = g_fxo->get<music_state>();
if (!music.func)
return CELL_MUSIC_ERROR_GENERIC;
return { CELL_MUSIC_ERROR_GENERIC, "Not initialized" };
error_code result = CELL_OK;

View file

@ -166,6 +166,7 @@ struct music_selection_context
void set_playlist(const std::string& path);
void create_playlist(const std::string& new_hash);
bool load_playlist();
void set_track(std::string_view track);
u32 step_track(bool next);
operator bool() const

View file

@ -12,9 +12,6 @@
#include "cellSysutil.h"
#include "util/media_utils.h"
#include <deque>
LOG_CHANNEL(cellMusicDecode);
template<>
@ -140,19 +137,29 @@ error_code cell_music_decode_select_contents()
error_code error = rsx::overlays::show_media_list_dialog(rsx::overlays::media_list_dialog::media_type::audio, vfs_dir_path, title,
[&dec](s32 status, utils::media_info info)
{
sysutil_register_cb([&dec, info, status](ppu_thread& ppu) -> s32
sysutil_register_cb([&dec, info = std::move(info), status](ppu_thread& ppu) -> s32
{
std::lock_guard lock(dec.mutex);
const u32 result = status >= 0 ? u32{CELL_OK} : u32{CELL_MUSIC_DECODE_CANCELED};
if (result == CELL_OK)
{
// Let's always choose the whole directory for now
std::string track;
std::string dir = info.path;
if (fs::is_file(info.path))
{
track = std::move(dir);
dir = fs::get_parent_dir(track);
}
music_selection_context context{};
context.set_playlist(info.path);
context.set_playlist(dir);
context.set_track(track);
// TODO: context.repeat_mode = CELL_SEARCH_REPEATMODE_NONE;
// TODO: context.context_option = CELL_SEARCH_CONTEXTOPTION_NONE;
dec.current_selection_context = context;
dec.current_selection_context = std::move(context);
dec.current_selection_context.create_playlist(music_selection_context::get_next_hash());
cellMusicDecode.success("Media list dialog: selected entry '%s'", context.playlist.front());
cellMusicDecode.success("Media list dialog: selected entry '%s'", dec.current_selection_context.playlist.front());
}
else
{

View file

@ -2,7 +2,6 @@
#include "Emu/Cell/PPUModule.h"
#include "Emu/IdManager.h"
#include "Emu/VFS.h"
#include "Utilities/StrUtil.h"
#include "cellSysutil.h"
LOG_CHANNEL(cellMusicExport);

View file

@ -109,6 +109,8 @@ void music_selection_context::set_playlist(const std::string& path)
content_type = CELL_SEARCH_CONTENTTYPE_MUSIC;
playlist.push_back(dir_path + path.substr(vfs_dir_path.length()));
}
valid = true;
}
void music_selection_context::create_playlist(const std::string& new_hash)
@ -246,6 +248,29 @@ bool music_selection_context::load_playlist()
return true;
}
void music_selection_context::set_track(std::string_view track)
{
if (track.empty()) return;
if (playlist.empty())
{
cellMusicSelectionContext.error("No tracks to play... (requested path='%s')", track);
return;
}
for (usz i = 0; i < playlist.size(); i++)
{
cellMusicSelectionContext.error("Comparing track '%s' vs '%s'", track, playlist[i]);
if (track.ends_with(playlist[i]))
{
first_track = current_track = static_cast<u32>(i);
return;
}
}
cellMusicSelectionContext.error("Track '%s' not found...", track);
}
u32 music_selection_context::step_track(bool next)
{
if (playlist.empty())

View file

@ -2,7 +2,6 @@
#include "Emu/system_config.h"
#include "Emu/Cell/PPUModule.h"
#include "Emu/IdManager.h"
#include "Emu/Cell/lv2/sys_sync.h"
#include "cellGame.h"
#include "cellSysutil.h"

View file

@ -1,6 +1,5 @@
#include "stdafx.h"
#include "Emu/System.h"
#include "Emu/system_config.h"
#include "Emu/Cell/PPUModule.h"
#include "Emu/Io/interception.h"
#include "Emu/Io/Keyboard.h"

View file

@ -3,7 +3,6 @@
#include "Emu/system_config.h"
#include "Emu/Cell/PPUModule.h"
#include "Emu/Cell/lv2/sys_process.h"
#include "Emu/Cell/lv2/sys_sync.h"
#include "Emu/Io/pad_types.h"
#include "Emu/RSX/Overlays/overlay_debug_overlay.h"
#include "Input/pad_thread.h"

View file

@ -1,6 +1,5 @@
#include "stdafx.h"
#include "Emu/Cell/PPUModule.h"
#include "Emu/IdManager.h"
#include "Emu/VFS.h"
#include "Emu/System.h"
#include "cellSysutil.h"

View file

@ -2,7 +2,6 @@
#include "Emu/Cell/PPUModule.h"
#include "Emu/IdManager.h"
#include "Emu/VFS.h"
#include "Utilities/StrUtil.h"
#include "cellSysutil.h"
LOG_CHANNEL(cellPhotoExport);

View file

@ -1,5 +1,6 @@
#include "stdafx.h"
#include "Emu/Cell/PPUModule.h"
#include "Emu/IdManager.h"
#include "Emu/Cell/lv2/sys_fs.h"
#include "Emu/RSX/Overlays/overlay_media_list_dialog.h"
#include "Emu/VFS.h"

View file

@ -2,7 +2,6 @@
#include "Emu/Cell/PPUModule.h"
#include "Emu/IdManager.h"
#include "cellPngEnc.h"
#include "png.h"
LOG_CHANNEL(cellPngEnc);

View file

@ -3,6 +3,7 @@
#include "Emu/Cell/PPUModule.h"
#include "Emu/RSX/GCM.h"
#include "Emu/RSX/gcm_enums.h"
#include "cellResc.h"
#include "cellVideoOut.h"

View file

@ -78,7 +78,7 @@ error_code cellRtcGetCurrentTick(ppu_thread& ppu, vm::ptr<CellRtcTick> pTick)
error_code cellRtcGetCurrentClock(ppu_thread& ppu, vm::ptr<CellRtcDateTime> pClock, s32 iTimeZone)
{
cellRtc.notice("cellRtcGetCurrentClock(pClock=*0x%x, iTimeZone=%d)", pClock, iTimeZone);
cellRtc.trace("cellRtcGetCurrentClock(pClock=*0x%x, iTimeZone=%d)", pClock, iTimeZone);
const vm::var<sys_page_attr_t> page_attr;
@ -1505,7 +1505,7 @@ error_code cellRtcGetSystemTime(ppu_thread& ppu, vm::cptr<CellRtcDateTime> pDate
error_code cellRtcGetTime_t(ppu_thread& ppu, vm::cptr<CellRtcDateTime> pDateTime, vm::ptr<s64> piTime)
{
cellRtc.notice("cellRtcGetTime_t(pDateTime=*0x%x, piTime=*0x%x)", pDateTime, piTime);
cellRtc.trace("cellRtcGetTime_t(pDateTime=*0x%x, piTime=*0x%x)", pDateTime, piTime);
const vm::var<sys_page_attr_t> page_attr;

View file

@ -2,8 +2,6 @@
#include "cellVpost.h"
#include "Emu/Memory/vm_ptr.h"
// Error Codes
enum CellSailError : u32
{

View file

@ -1,6 +1,5 @@
#include "stdafx.h"
#include "Emu/Cell/PPUModule.h"
#include "cellSail.h"
LOG_CHANNEL(cellSailRec);

View file

@ -8,6 +8,7 @@
#include "Emu/Cell/lv2/sys_sync.h"
#include "Emu/Cell/lv2/sys_process.h"
#include "Emu/Cell/PPUModule.h"
#include "Emu/Cell/timers.hpp"
#include "Emu/Cell/Modules/cellSysutil.h"
#include "Emu/Cell/Modules/cellUserInfo.h"
#include "Emu/RSX/Overlays/overlay_message.h"
@ -19,6 +20,7 @@
#include "Loader/PSF.h"
#include "Utilities/StrUtil.h"
#include "Utilities/date_time.h"
#include "Utilities/sema.h"
#include <mutex>
#include <algorithm>

View file

@ -1,7 +1,6 @@
#pragma once
#include "util/types.hpp"
#include "util/endian.hpp"
#include "Emu/Memory/vm_ptr.h"
#include <string>
#include <vector>

View file

@ -1,7 +1,6 @@
#include "stdafx.h"
#include "Emu/System.h"
#include "Emu/system_config.h"
#include "Emu/IdManager.h"
#include "Emu/Memory/vm_reservation.h"
#include "Emu/Cell/PPUModule.h"
#include "Emu/Cell/SPUThread.h"

View file

@ -4,6 +4,10 @@
#include "util/v128.hpp"
#include "Emu/Cell/lv2/sys_lwmutex.h"
#include "Emu/Cell/lv2/sys_lwcond.h"
#include "Emu/Cell/lv2/sys_spu.h"
struct CellSpurs;
struct CellSpursTaskset;

View file

@ -1,9 +1,6 @@
#include "stdafx.h"
#include "Emu/Cell/PPUModule.h"
#include "Emu/Cell/lv2/sys_spu.h"
#include "cellSpursJq.h"
LOG_CHANNEL(cellSpursJq);
error_code cellSpursJobQueueAttributeInitialize()

View file

@ -4,9 +4,6 @@
#include "Emu/Memory/vm_reservation.h"
#include "Emu/Cell/SPUThread.h"
#include "Emu/Cell/SPURecompiler.h"
#include "Emu/Cell/lv2/sys_lwmutex.h"
#include "Emu/Cell/lv2/sys_lwcond.h"
#include "Emu/Cell/lv2/sys_spu.h"
#include "cellSpurs.h"
#include "util/asm.hpp"

View file

@ -1619,10 +1619,25 @@ error_code cellVdecSetFrameRate(u32 handle, CellVdecFrameRate frameRateCode)
return CELL_OK;
}
error_code cellVdecOpenExt()
error_code cellVdecOpenExt(ppu_thread& ppu, vm::cptr<CellVdecType> type, vm::cptr<CellVdecResourceExt> res, vm::cptr<CellVdecCb> cb, vm::ptr<u32> handle)
{
UNIMPLEMENTED_FUNC(cellVdec);
return CELL_OK;
cellVdec.warning("cellVdecOpenExt(type=*0x%x, res=*0x%x, cb=*0x%x, handle=*0x%x)", type, res, cb, handle);
if (!res)
{
return CELL_VDEC_ERROR_ARG;
}
vm::var<CellVdecResource> tmp = vm::make_var<CellVdecResource>({});
tmp->memAddr = res->memAddr;
tmp->memSize = res->memSize;
tmp->ppuThreadPriority = res->ppuThreadPriority;
tmp->ppuThreadStackSize = res->ppuThreadStackSize;
tmp->spuThreadPriority = 0;
tmp->numOfSpus = res->numOfSpus;
const vm::ptr<CellVdecResource> ptr = vm::cast(tmp.addr());
return vdecOpen(ppu, type, ptr, cb, handle);
}
error_code cellVdecStartSeqExt()

View file

@ -133,6 +133,16 @@ struct CellVdecResourceEx
be_t<u32> spursResource_addr;
};
struct CellVdecResourceExt // speculative
{
be_t<u32> memAddr;
be_t<u32> memSize;
be_t<s32> ppuThreadPriority;
be_t<u32> ppuThreadStackSize;
u8 unk[12];
be_t<u32> numOfSpus;
};
// Access Unit Information
struct CellVdecAuInfo
{

View file

@ -2,7 +2,6 @@
#include "Emu/Cell/PPUModule.h"
#include "Emu/IdManager.h"
#include "Emu/VFS.h"
#include "Utilities/StrUtil.h"
#include "cellSysutil.h"
LOG_CHANNEL(cellVideoExport);

View file

@ -1,8 +1,5 @@
#pragma once
#include <unordered_map>
#include <deque>
// libvoice = 0x80310801 - 0x803108ff
// libvoice version 100

Some files were not shown because too many files have changed in this diff Show more