mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-28 12:05:06 +00:00
Merge main into fix/progress-history-bad-ref
This commit is contained in:
commit
586bea7f4e
2794 files changed
+176631
-23109
No files matched your search
@@ -6,7 +6,7 @@ body:
|
||||
One thread per title, for every platform: search this category for the title ID first. If a thread exists, reply there, also when your OS or GPU differs from the one it reports.
|
||||
Name the discussion `Game name (title ID)`, for example `DOOM Shareware (PPSA99666)`, without the platform.
|
||||
Bug reports and implementation work belong in issues and pull requests; link them here as the blocker.
|
||||
Per-game progress is also tracked on the [blocker map](https://alxcbtw.github.io/anyps5-roadmap/), built from public GitHub data. Only share material you have the right to distribute.
|
||||
Only share material you have the right to distribute.
|
||||
- type: checkboxes
|
||||
id: searched
|
||||
attributes:
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
name: Bug report
|
||||
description: A title, homebrew or test stops, crashes or renders wrongly.
|
||||
labels: [bug]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Search open and closed issues and pull requests for the error text first, and comment there if it is already reported.
|
||||
Game bring-up progress belongs in [Discussions](https://github.com/boykopovar/AnyPS5/discussions/categories/game-bring-up), one thread per title.
|
||||
A slow scene or a change in speed goes into the [Performance report](https://github.com/boykopovar/AnyPS5/issues/new?template=performance.yml) form, which asks for a [performance trace](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/BUILD.md#performance-trace) and its `tools/trace_digest.py` digest.
|
||||
- type: input
|
||||
id: summary
|
||||
attributes:
|
||||
label: What happens
|
||||
description: One sentence, with the exact error text if there is one.
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: title
|
||||
attributes:
|
||||
label: Title, test or build step
|
||||
description: Title ID and content version (for example PPSAxxxxx 01.000.000), a homebrew with its source, the ctest name, or the build step that fails.
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: commit
|
||||
attributes:
|
||||
label: AnyPS5 commit
|
||||
description: The `main` commit that was built, or the release that was used, and any pull requests merged on top.
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: system
|
||||
attributes:
|
||||
label: System
|
||||
description: OS, GPU and driver version, and the compiler if you built it yourself.
|
||||
placeholder: Arch Linux, GCC 16.2.1, RTX 5080 (NVIDIA 615.78.08)
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: steps
|
||||
attributes:
|
||||
label: Steps to reproduce
|
||||
description: The commands that were run, environment variables included, and how long it takes to stop.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: log
|
||||
attributes:
|
||||
label: Log
|
||||
description: The lines around the stop.
|
||||
render: text
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: notes
|
||||
attributes:
|
||||
label: What was checked
|
||||
description: Other devices or commits tried, and whether it is the same every run. Attach the full log and screenshots here.
|
||||
@@ -0,0 +1,8 @@
|
||||
blank_issues_enabled: true
|
||||
contact_links:
|
||||
- name: Game bring-up
|
||||
url: https://github.com/boykopovar/AnyPS5/discussions/categories/game-bring-up
|
||||
about: Progress of one title, one thread per title ID
|
||||
- name: Question
|
||||
url: https://github.com/boykopovar/AnyPS5/discussions/categories/q-a
|
||||
about: Building, converting and running
|
||||
@@ -33,7 +33,7 @@ permissions:
|
||||
|
||||
concurrency:
|
||||
group: build-${{ github.event_name }}-${{ github.event.pull_request.number || inputs.pr || github.ref }}
|
||||
cancel-in-progress: true
|
||||
cancel-in-progress: ${{ github.event_name != 'push' }}
|
||||
|
||||
env:
|
||||
CONFIGURE: >-
|
||||
@@ -641,7 +641,7 @@ jobs:
|
||||
uses: actions/cache/restore@v6
|
||||
with:
|
||||
path: configure-seed.cmake
|
||||
key: configure-seed-${{ env.WINLIBS_ZIP }}-${{ steps.submodules.outputs.key }}-${{ hashFiles('CMakeLists.txt', 'cmake/**', 'core/libs/CMakeLists.txt', '.github/workflows/build.yml') }}
|
||||
key: configure-seed-${{ env.WINLIBS_ZIP }}-${{ steps.submodules.outputs.key }}-${{ hashFiles('CMakeLists.txt', 'cmake/**', 'core/libs/CMakeLists.txt', 'tools/configure_seed.py', '.github/workflows/build.yml') }}
|
||||
- shell: cmd
|
||||
run: if exist configure-seed.cmake (cmake -C configure-seed.cmake -S . -B build %CONFIGURE% "-DANYPS5_AGC_EXECUTION_TESTS=F16ToF32Unpack;F64FmaSubnormals;RegistrationPrepareShutdown") else (cmake -S . -B build %CONFIGURE% "-DANYPS5_AGC_EXECUTION_TESTS=F16ToF32Unpack;F64FmaSubnormals;RegistrationPrepareShutdown")
|
||||
- if: steps.seed-cache.outputs.cache-hit != 'true'
|
||||
|
||||
@@ -18,15 +18,14 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.base.sha }}
|
||||
ref: ${{ github.event.pull_request.base.ref }}
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
- name: Fetch pull request objects without checking out its code
|
||||
env:
|
||||
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
|
||||
run: git fetch --no-tags origin "$HEAD_SHA"
|
||||
- name: Check conventions with the trusted base script
|
||||
- name: Check conventions with the current base branch script
|
||||
env:
|
||||
BASE_SHA: ${{ github.event.pull_request.base.sha }}
|
||||
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
|
||||
run: python3 -I tools/check_conventions.py --base "$BASE_SHA" --head "$HEAD_SHA"
|
||||
run: python3 -I tools/check_conventions.py --base HEAD --head "$HEAD_SHA"
|
||||
@@ -0,0 +1,117 @@
|
||||
name: Windows MSYS2
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '23 8 * * *'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: windows-msys2-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
CONFIGURE: >-
|
||||
-G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON
|
||||
-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++
|
||||
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
|
||||
|
||||
jobs:
|
||||
windows-msys2:
|
||||
runs-on: windows-latest
|
||||
timeout-minutes: 45
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
with:
|
||||
ref: ${{ github.sha }}
|
||||
persist-credentials: false
|
||||
- id: submodules
|
||||
name: Key the submodules on their commits
|
||||
run: |
|
||||
echo "key=$(git ls-files -s | awk '$1 == "160000" { print $2, $4 }' | cat - .gitmodules | sha256sum | cut -c1-16)" >> "$GITHUB_OUTPUT"
|
||||
echo "ffmpeg=$(git rev-parse HEAD:3rdparty/ffmpeg-core)" >> "$GITHUB_OUTPUT"
|
||||
- id: submodule-cache
|
||||
uses: actions/cache/restore@v6
|
||||
with:
|
||||
path: ${{ runner.temp }}/submodule-gitdirs.tar
|
||||
key: submodule-gitdirs-${{ runner.os }}-${{ steps.submodules.outputs.key }}
|
||||
- name: Check out the submodules
|
||||
run: |
|
||||
if [ -f "$RUNNER_TEMP/submodule-gitdirs.tar" ]; then tar --force-local -xf "$RUNNER_TEMP/submodule-gitdirs.tar"; fi
|
||||
git submodule update --init --recursive --depth 1 --jobs 8
|
||||
- if: steps.submodule-cache.outputs.cache-hit != 'true'
|
||||
run: tar --force-local -cf "$RUNNER_TEMP/submodule-gitdirs.tar" .git/modules
|
||||
- if: steps.submodule-cache.outputs.cache-hit != 'true'
|
||||
uses: actions/cache/save@v6
|
||||
continue-on-error: true
|
||||
with:
|
||||
path: ${{ runner.temp }}/submodule-gitdirs.tar
|
||||
key: submodule-gitdirs-${{ runner.os }}-${{ steps.submodules.outputs.key }}
|
||||
- name: Use the CA bundle of Git for Windows
|
||||
run: |
|
||||
for prefix in ucrt64 mingw64; do
|
||||
bundle="C:/Program Files/Git/$prefix/etc/ssl/certs/ca-bundle.crt"
|
||||
if [ -f "$bundle" ]; then echo "SSL_CERT_FILE=$bundle" >> "$GITHUB_ENV"; exit 0; fi
|
||||
done
|
||||
echo "::error::No CA bundle found in Git for Windows"; exit 1
|
||||
- id: msys2
|
||||
uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
msystem: UCRT64
|
||||
update: true
|
||||
install: >-
|
||||
mingw-w64-ucrt-x86_64-gcc
|
||||
mingw-w64-ucrt-x86_64-cmake
|
||||
mingw-w64-ucrt-x86_64-ninja
|
||||
- shell: pwsh
|
||||
env:
|
||||
MSYS2_LOCATION: ${{ steps.msys2.outputs.msys2-location }}
|
||||
run: Add-Content -LiteralPath $env:GITHUB_PATH -Value "$env:MSYS2_LOCATION\ucrt64\bin"
|
||||
- uses: hendrikmuhs/[email protected]
|
||||
with:
|
||||
key: windows-msys2
|
||||
save: ${{ github.ref == 'refs/heads/main' }}
|
||||
evict-old-files: job
|
||||
- id: ffmpeg-cache
|
||||
uses: actions/cache/restore@v6
|
||||
with:
|
||||
path: build/externals
|
||||
key: ffmpeg-${{ runner.os }}-${{ steps.submodules.outputs.ffmpeg }}
|
||||
- shell: cmd
|
||||
run: cmake -S . -B build %CONFIGURE% "-DANYPS5_AGC_EXECUTION_TESTS=F16ToF32Unpack;F64FmaSubnormals;RegistrationPrepareShutdown"
|
||||
- if: steps.ffmpeg-cache.outputs.cache-hit != 'true'
|
||||
uses: actions/cache/save@v6
|
||||
continue-on-error: true
|
||||
with:
|
||||
path: build/externals
|
||||
key: ${{ steps.ffmpeg-cache.outputs.cache-primary-key }}
|
||||
- name: Check that every test executable is registered with ctest
|
||||
shell: cmd
|
||||
run: python tools/check_test_registration.py build
|
||||
- shell: cmd
|
||||
run: cmake --build build
|
||||
- shell: cmd
|
||||
run: cmake --build build --target libs
|
||||
- shell: cmd
|
||||
working-directory: build
|
||||
run: ctest --output-on-failure --timeout 120 --parallel 4 --output-log ctest.log --output-junit ctest.xml
|
||||
- run: python tools/check_skips.py build/ctest.xml --job windows
|
||||
- name: Report tests slower than 30 s
|
||||
if: ${{ !cancelled() }}
|
||||
run: |
|
||||
[ -f build/ctest.log ] || exit 0
|
||||
awk '/Test +#[0-9]+: / && $NF == "sec" { for (i = 1; i <= NF; i++) if ($i ~ /^#[0-9]+:$/) name = $(i + 1); t = $(NF - 1) + 0; if (t > max[name]) max[name] = t }
|
||||
END { for (name in max) if (max[name] > 30) printf "::warning title=Slow test::%s took %.1f s on %s; tests must finish in 30 s (CONTRIBUTING.md)\n", name, max[name], ENVIRON["RUNNER_OS"] }' build/ctest.log
|
||||
- uses: actions/upload-artifact@v7
|
||||
if: ${{ !cancelled() }}
|
||||
with:
|
||||
name: windows-msys2-tests
|
||||
path: |
|
||||
build/ctest.log
|
||||
build/ctest.xml
|
||||
if-no-files-found: ignore
|
||||
+12
@@ -22,6 +22,9 @@
|
||||
[submodule "3rdparty/ffmpeg-core"]
|
||||
path = 3rdparty/ffmpeg-core
|
||||
url = https://github.com/KytyPS5/ext-ffmpeg-core.git
|
||||
[submodule "3rdparty/opus"]
|
||||
path = 3rdparty/opus
|
||||
url = https://github.com/xiph/opus.git
|
||||
[submodule "3rdparty/freetype"]
|
||||
path = 3rdparty/freetype
|
||||
url = https://github.com/freetype/freetype.git
|
||||
@@ -49,3 +52,12 @@
|
||||
[submodule "3rdparty/ZArchive"]
|
||||
path = 3rdparty/ZArchive
|
||||
url = https://github.com/Exzap/ZArchive.git
|
||||
[submodule "3rdparty/vgmstream"]
|
||||
path = 3rdparty/vgmstream
|
||||
url = https://github.com/vgmstream/vgmstream.git
|
||||
[submodule "3rdparty/ogg"]
|
||||
path = 3rdparty/ogg
|
||||
url = https://github.com/xiph/ogg.git
|
||||
[submodule "3rdparty/vorbis"]
|
||||
path = 3rdparty/vorbis
|
||||
url = https://github.com/xiph/vorbis.git
|
||||
+1
Submodule 3rdparty/ogg added at be05b13e98.
+1
Submodule 3rdparty/opus added at 22244de5a7.
+1
Submodule 3rdparty/vgmstream added at 7c520e8f9b.
+1
Submodule 3rdparty/vorbis added at 0657aee69d.
+17
-6
@@ -6,13 +6,12 @@ endif()
|
||||
project(Relinker CXX)
|
||||
|
||||
set(ANYPS5_TEST_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/tests")
|
||||
set(ANYPS5_WINDOWS_TEST_EXIT "${CMAKE_CURRENT_SOURCE_DIR}/cmake/WindowsTestExit.cpp")
|
||||
|
||||
function(add_test_executable target)
|
||||
add_executable(${target} ${ARGN})
|
||||
set_target_properties(${target} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "$<1:${ANYPS5_TEST_OUTPUT_DIRECTORY}>")
|
||||
if(MINGW)
|
||||
target_sources(${target} PRIVATE "${ANYPS5_WINDOWS_TEST_EXIT}")
|
||||
target_sources(${target} PRIVATE $<TARGET_OBJECTS:anyps5_windows_test_exit>)
|
||||
target_link_options(${target} PRIVATE LINKER:--wrap=main)
|
||||
endif()
|
||||
endfunction()
|
||||
@@ -96,6 +95,10 @@ if(APPLE AND NOT ANYPS5_RELINKER_ONLY)
|
||||
add_link_options(-fexperimental-library)
|
||||
endif()
|
||||
|
||||
if(MINGW)
|
||||
add_library(anyps5_windows_test_exit OBJECT cmake/WindowsTestExit.cpp)
|
||||
endif()
|
||||
|
||||
if(BUILD_TESTING)
|
||||
add_test_executable(shader_cache_file_read_tests
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/core/shader/recompiler/tests/CacheFileReadTests.cpp)
|
||||
@@ -107,6 +110,7 @@ if(BUILD_TESTING)
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/core/shader/recompiler/tests/RequestSerializerTests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp)
|
||||
target_include_directories(request_serializer_tests PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/core/libs
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/core/shader/recompiler
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/core/shader/recompiler/ControlFlow/include)
|
||||
add_test(NAME request_serializer COMMAND request_serializer_tests)
|
||||
@@ -168,7 +172,7 @@ if(BUILD_TESTING)
|
||||
endif()
|
||||
add_test(NAME ${conventions_test_name} COMMAND ${Python3_EXECUTABLE}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/tools/tests/test_check_conventions_comments.py --shard ${shard}/12)
|
||||
set_tests_properties(${conventions_test_name} PROPERTIES TIMEOUT 30)
|
||||
set_tests_properties(${conventions_test_name} PROPERTIES TIMEOUT 120)
|
||||
endforeach()
|
||||
add_test(NAME conventions_wrapped_declarations COMMAND ${Python3_EXECUTABLE}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/tools/tests/test_check_conventions_wrapped_declarations.py)
|
||||
@@ -245,9 +249,15 @@ if(BUILD_TESTING)
|
||||
add_test(NAME env_reference COMMAND ${Python3_EXECUTABLE}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/tools/tests/test_env_reference.py)
|
||||
set_tests_properties(env_reference PROPERTIES TIMEOUT 20)
|
||||
add_test(NAME conventions_env_reference COMMAND ${Python3_EXECUTABLE}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/tools/tests/test_check_conventions_env_reference.py)
|
||||
set_tests_properties(conventions_env_reference PROPERTIES TIMEOUT 60)
|
||||
set(env_reference_test_source "${CMAKE_CURRENT_SOURCE_DIR}/tools/tests/test_check_conventions_env_reference.py")
|
||||
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${env_reference_test_source}")
|
||||
file(STRINGS "${env_reference_test_source}" env_reference_cases REGEX "^ def test_")
|
||||
foreach(test_case IN LISTS env_reference_cases)
|
||||
string(REGEX REPLACE "^ def (test_[A-Za-z0-9_]+).*" "\\1" test_case "${test_case}")
|
||||
add_test(NAME conventions_env_reference_${test_case} COMMAND ${Python3_EXECUTABLE}
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/tools/tests/test_check_conventions_env_reference.py" "EnvReferenceDiffTests.${test_case}")
|
||||
set_tests_properties(conventions_env_reference_${test_case} PROPERTIES TIMEOUT 30)
|
||||
endforeach()
|
||||
add_test(NAME conventions_body_bom COMMAND ${Python3_EXECUTABLE}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/tools/tests/test_check_conventions_body_bom.py)
|
||||
add_test(NAME conventions_blob_reads COMMAND ${Python3_EXECUTABLE}
|
||||
@@ -347,6 +357,7 @@ add_subdirectory(3rdparty/libusb-cmake EXCLUDE_FROM_ALL)
|
||||
set_target_properties(usb-1.0 PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
include(cmake/ZArchive.cmake)
|
||||
include(cmake/Opus.cmake)
|
||||
if(WIN32)
|
||||
set(MI_BUILD_SHARED ON CACHE BOOL "" FORCE)
|
||||
set(MI_BUILD_STATIC OFF CACHE BOOL "" FORCE)
|
||||
|
||||
+3
-1
@@ -3,8 +3,10 @@
|
||||
## Code
|
||||
|
||||
- Follow the [coding conventions](docs/dev/CONVENTIONS.md): naming, no comments except [technical debt](docs/dev/TechnicalDebt.md), Conventional Commits.
|
||||
- **Every exported PS5 function with `APS5_VABI` must have exactly one declaration in a header reachable through the library's `<library>.hpp`. Duplicate declarations in headers, `.cpp` files and tests are forbidden. This is checked by the Python test [`public_headers`](core/libs/tests/test_public_headers.py).**
|
||||
- Every function either does exactly what it is supposed to or throws. Unimplemented exports call `NotImplemented_nid_no_patch(__func__)` (see [libSceAudioIn](core/libs/prx/libSceAudioIn/Export.cpp)).
|
||||
- Pull requests that add or change shader instruction semantics say where they come from: measured on hardware (which GPU and what was checked, e.g. with the [hardware oracle](docs/dev/HW_ORACLE.md)) or the exact source (ISA section, LLVM, ACO or Mesa file). Reviewers check the semantics on hardware. Cases the source doesn't settle throw, and behaviour not verified on hardware is recorded in [technical debt](docs/dev/TechnicalDebt.md).
|
||||
- An export's signature or behaviour taken from a title's call sites or from a library's disassembly follows [reading titles and libraries](docs/dev/REVERSE_ENGINEERING.md): a call site settles the arguments, not what the library does.
|
||||
- A silent stub is allowed only when it unblocks a title and only affects the UI; add it under Silent stubs in its library's [technical debt](docs/dev/debt/) file.
|
||||
- Missing imports fail at startup with a clear error; don't replace them with fallbacks that keep running.
|
||||
- Implement the general behaviour of a function, not what one title happens to need.
|
||||
@@ -41,7 +43,7 @@ This manual run also builds and tests the relinker on Linux, Windows and macOS w
|
||||
|
||||
With `--field full=false`, the manual run skips the full builds and runs only the relinker matrix on Linux, Windows and macOS, if the pull request changes a file the relinker-only build uses, such as the Python tools and their tests in `tools/`.
|
||||
|
||||
The Conventions check runs automatically for every contributor, including first-time contributors. It uses the base branch checker and reads pull request Git objects without executing pull request code. The Conventions check runs on every pull request and fails when a rule on this page is broken. It accepts code comments only when the pull request also changes [technical debt](docs/dev/TechnicalDebt.md), the index or a file in `docs/dev/debt/`, and only UTF-8 text files. Run it locally before pushing:
|
||||
The Conventions check runs automatically for every contributor, including first-time contributors. It uses the checker from the current tip of the base branch, so rules added after a pull request was opened apply to its next run, and reads pull request Git objects without executing pull request code. The Conventions check runs on every pull request and fails when a rule on this page is broken. It accepts code comments only when the pull request also changes [technical debt](docs/dev/TechnicalDebt.md), the index or a file in `docs/dev/debt/`, and only UTF-8 text files. Run it locally before pushing:
|
||||
|
||||
```
|
||||
python3 tools/check_conventions.py --base origin/main
|
||||
|
||||
@@ -28,7 +28,7 @@ The [shader recompiler](core/shader/recompiler/Recompiler.cpp) successfully prod
|
||||
|
||||
## Compatibility
|
||||
|
||||
Per-game progress (stage reached, open blockers, libraries and GPU coverage) is tracked on the [blocker map](https://alxcbtw.github.io/anyps5-roadmap/), a community project built from public GitHub data ([source](https://github.com/AlxcBTW/anyps5-roadmap)). Test reports go in the [Game bring-up](https://github.com/boykopovar/AnyPS5/discussions/categories/game-bring-up) discussions, one thread per title.
|
||||
Per-game status and test reports live in the [Game bring-up](https://github.com/boykopovar/AnyPS5/discussions/categories/game-bring-up) discussions, one thread per title.
|
||||
|
||||
## Input mapping
|
||||
|
||||
@@ -38,6 +38,8 @@ SDL-mapped game controllers are supported, including analog sticks and triggers.
|
||||
|
||||
This project is intended for interoperability, research, preservation, and compatibility purposes. It does not include, distribute, or require copyrighted software, firmware, cryptographic keys, or proprietary libraries. Users are responsible for ensuring that any binaries used with this project are obtained and used in accordance with applicable laws and their respective license terms.
|
||||
|
||||
AnyPS5 is an independent project and is not affiliated with, authorized or endorsed by Sony Interactive Entertainment. "PlayStation" and "PS5" are trademarks of Sony Interactive Entertainment Inc.
|
||||
|
||||
## License
|
||||
|
||||
This project is licensed under the GNU General Public License version 2 only.
|
||||
@@ -0,0 +1,19 @@
|
||||
function(add_bundled_opus)
|
||||
set(BUILD_SHARED_LIBS OFF)
|
||||
set(BUILD_TESTING OFF)
|
||||
set(OPUS_BUILD_SHARED_LIBRARY OFF)
|
||||
set(OPUS_BUILD_TESTING OFF)
|
||||
set(OPUS_BUILD_PROGRAMS OFF)
|
||||
set(OPUS_INSTALL_PKG_CONFIG_MODULE OFF)
|
||||
set(OPUS_INSTALL_CMAKE_CONFIG_MODULE OFF)
|
||||
set(OPUS_STACK_PROTECTOR OFF)
|
||||
set(OPUS_FORTIFY_SOURCE OFF)
|
||||
add_subdirectory(3rdparty/opus EXCLUDE_FROM_ALL)
|
||||
set_target_properties(opus PROPERTIES POSITION_INDEPENDENT_CODE ON C_VISIBILITY_PRESET hidden)
|
||||
target_compile_definitions(opus PRIVATE OPUS_EXPORT=)
|
||||
if(MINGW OR CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
target_link_options(opus INTERFACE LINKER:--exclude-libs,libopus.a)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
add_bundled_opus()
|
||||
@@ -19,6 +19,10 @@ struct Header {
|
||||
std::uint32_t width;
|
||||
std::uint32_t height;
|
||||
std::uint32_t channels;
|
||||
std::uint8_t componentIds[4]{};
|
||||
std::uint8_t samplingFactors[4]{};
|
||||
bool progressive = false;
|
||||
bool app0BeforeFrame = false;
|
||||
};
|
||||
|
||||
enum class Sampling {
|
||||
|
||||
@@ -126,7 +126,33 @@ std::optional<Header> ParseHeader(std::span<const std::uint8_t> jpeg) {
|
||||
int channels = 0;
|
||||
if (!stbi_info_from_memory(jpeg.data(), static_cast<int>(jpeg.size()), &width, &height, &channels)) return std::nullopt;
|
||||
if (width <= 0 || height <= 0 || channels <= 0) return std::nullopt;
|
||||
return Header{static_cast<std::uint32_t>(width), static_cast<std::uint32_t>(height), static_cast<std::uint32_t>(channels)};
|
||||
Header header{static_cast<std::uint32_t>(width), static_cast<std::uint32_t>(height), static_cast<std::uint32_t>(channels)};
|
||||
std::size_t offset = 2;
|
||||
while (offset < jpeg.size()) {
|
||||
if (jpeg[offset++] != 0xFF) return std::nullopt;
|
||||
while (offset < jpeg.size() && jpeg[offset] == 0xFF) ++offset;
|
||||
if (offset == jpeg.size()) return std::nullopt;
|
||||
const std::uint8_t marker = jpeg[offset++];
|
||||
if (marker == 0xD9 || marker == 0xDA) return std::nullopt;
|
||||
if (marker == 0x01 || (marker >= 0xD0 && marker <= 0xD8)) continue;
|
||||
if (jpeg.size() - offset < 2) return std::nullopt;
|
||||
const std::size_t length = (static_cast<std::size_t>(jpeg[offset]) << 8) | jpeg[offset + 1];
|
||||
if (length < 2 || length > jpeg.size() - offset) return std::nullopt;
|
||||
if (marker == 0xE0) header.app0BeforeFrame = true;
|
||||
if (marker == 0xC0 || marker == 0xC1 || marker == 0xC2) {
|
||||
if (length < 8) return std::nullopt;
|
||||
header.channels = jpeg[offset + 7];
|
||||
if (header.channels == 0 || header.channels > 4 || length != 8 + 3 * header.channels) return std::nullopt;
|
||||
header.progressive = marker == 0xC2;
|
||||
for (std::uint32_t i = 0; i < header.channels; ++i) {
|
||||
header.componentIds[i] = jpeg[offset + 8 + 3 * i];
|
||||
header.samplingFactors[i] = jpeg[offset + 9 + 3 * i];
|
||||
}
|
||||
return header;
|
||||
}
|
||||
offset += length;
|
||||
}
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
std::optional<Image> Decode(std::span<const std::uint8_t> jpeg) {
|
||||
|
||||
@@ -48,6 +48,37 @@ bool isChunkType(const std::uint8_t* bytes, const char* type) {
|
||||
return std::equal(bytes, bytes + 4, type);
|
||||
}
|
||||
|
||||
std::optional<std::uint16_t> readGrayscaleTransparencyKey(std::span<const std::uint8_t> png) {
|
||||
std::size_t offset = SIGNATURE.size();
|
||||
if (png.size() < offset || !std::equal(SIGNATURE.begin(), SIGNATURE.end(), png.begin())) return std::nullopt;
|
||||
std::optional<std::uint16_t> key;
|
||||
while (png.size() - offset >= CHUNK_OVERHEAD) {
|
||||
const std::uint32_t length = readBigEndian32(&png[offset]);
|
||||
const std::uint8_t* type = &png[offset + 4];
|
||||
if (length > png.size() - offset - CHUNK_OVERHEAD) return std::nullopt;
|
||||
if (isChunkType(type, "tRNS")) {
|
||||
if (length != 2) return std::nullopt;
|
||||
key = static_cast<std::uint16_t>(png[offset + 8] << 8 | png[offset + 9]);
|
||||
}
|
||||
if (isChunkType(type, "IDAT") || isChunkType(type, "IEND")) return key;
|
||||
offset += CHUNK_OVERHEAD + length;
|
||||
}
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
void repairGrayscaleTransparency(const Header& header, std::span<const std::uint8_t> png, Image& image) {
|
||||
if (header.colorType != ColorType::Grayscale || !header.hasTransparency) return;
|
||||
if (header.bitDepth != 1 && header.bitDepth != 2 && header.bitDepth != 4) return;
|
||||
const std::optional<std::uint16_t> key = readGrayscaleTransparencyKey(png);
|
||||
if (!key.has_value()) return;
|
||||
const std::uint16_t mask = static_cast<std::uint16_t>((1u << header.bitDepth) - 1);
|
||||
if ((*key & 0xFF) == (*key & mask)) return;
|
||||
const std::uint8_t transparent = static_cast<std::uint8_t>((*key & mask) * (255u / mask));
|
||||
for (std::size_t offset = 3; offset < image.pixels.size(); offset += 4) {
|
||||
image.pixels[offset] = static_cast<std::uint8_t>(image.pixels[offset - 3] == transparent ? 0 : 255);
|
||||
}
|
||||
}
|
||||
|
||||
bool isValidFormat(std::uint8_t bitDepth, std::uint8_t colorType) {
|
||||
switch (colorType) {
|
||||
case 0:
|
||||
@@ -158,6 +189,8 @@ std::optional<Image> Decode(std::span<const std::uint8_t> png) {
|
||||
|
||||
Image image{static_cast<std::uint32_t>(width), static_cast<std::uint32_t>(height), {}};
|
||||
image.pixels.assign(decoded.get(), decoded.get() + static_cast<std::size_t>(image.width) * image.height * 4);
|
||||
const std::optional<Header> header = ParseHeader(png);
|
||||
if (header.has_value()) repairGrayscaleTransparency(*header, png, image);
|
||||
return image;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <algorithm>
|
||||
#include <cstdint>
|
||||
#include <cstdlib>
|
||||
#include <optional>
|
||||
#include <stdexcept>
|
||||
#include <vector>
|
||||
|
||||
@@ -50,6 +51,17 @@ static const std::uint8_t GRAY1[] = {
|
||||
0x42, 0x60, 0x82,
|
||||
};
|
||||
|
||||
static const std::uint8_t GRAY1_TRNS[] = {
|
||||
0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00, 0x00, 0x0D, 0x49, 0x48, 0x44, 0x52,
|
||||
0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0xDC, 0x59, 0x42,
|
||||
0x27, 0x00, 0x00, 0x00, 0x02, 0x74, 0x52, 0x4E, 0x53, 0x00, 0x02, 0x98, 0x9D, 0xAC, 0x14, 0x00,
|
||||
0x00, 0x00, 0x0A, 0x49, 0x44, 0x41, 0x54, 0x78, 0xDA, 0x63, 0x70, 0x00, 0x00, 0x00, 0x42, 0x00,
|
||||
0x41, 0x84, 0xBF, 0x8E, 0x62, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4E, 0x44, 0xAE, 0x42, 0x60,
|
||||
0x82,
|
||||
};
|
||||
|
||||
static const std::uint8_t PNG_SIGNATURE[] = {0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A};
|
||||
|
||||
static void AppendBigEndian32(std::vector<std::uint8_t>& bytes, std::uint32_t value) {
|
||||
for (int shift = 24; shift >= 0; shift -= 8) bytes.push_back(static_cast<std::uint8_t>(value >> shift));
|
||||
}
|
||||
@@ -64,6 +76,130 @@ static std::vector<std::uint8_t> HeaderOnly(std::uint32_t width, std::uint32_t h
|
||||
return bytes;
|
||||
}
|
||||
|
||||
static std::uint32_t Crc32(std::span<const std::uint8_t> bytes) {
|
||||
std::uint32_t crc = 0xFFFFFFFFu;
|
||||
for (const std::uint8_t byte : bytes) {
|
||||
crc ^= byte;
|
||||
for (int bit = 0; bit < 8; ++bit) crc = (crc >> 1) ^ ((crc & 1) != 0 ? 0xEDB88320u : 0u);
|
||||
}
|
||||
return ~crc;
|
||||
}
|
||||
|
||||
static std::uint32_t Adler32(std::span<const std::uint8_t> bytes) {
|
||||
std::uint32_t low = 1;
|
||||
std::uint32_t high = 0;
|
||||
for (const std::uint8_t byte : bytes) {
|
||||
low = (low + byte) % 65521;
|
||||
high = (high + low) % 65521;
|
||||
}
|
||||
return high << 16 | low;
|
||||
}
|
||||
|
||||
static void AppendTestChunk(std::vector<std::uint8_t>& png, const char* type, std::span<const std::uint8_t> data) {
|
||||
AppendBigEndian32(png, static_cast<std::uint32_t>(data.size()));
|
||||
const std::size_t start = png.size();
|
||||
png.insert(png.end(), type, type + 4);
|
||||
png.insert(png.end(), data.begin(), data.end());
|
||||
AppendBigEndian32(png, Crc32(std::span<const std::uint8_t>(png.data() + start, png.size() - start)));
|
||||
}
|
||||
|
||||
static std::vector<std::uint8_t> ZlibStore(std::span<const std::uint8_t> bytes) {
|
||||
Require(bytes.size() <= 0xFFFF);
|
||||
const std::uint16_t length = static_cast<std::uint16_t>(bytes.size());
|
||||
const std::uint16_t inverse = static_cast<std::uint16_t>(~length);
|
||||
std::vector<std::uint8_t> output{0x78, 0x01, 0x01, static_cast<std::uint8_t>(length), static_cast<std::uint8_t>(length >> 8),
|
||||
static_cast<std::uint8_t>(inverse), static_cast<std::uint8_t>(inverse >> 8)};
|
||||
output.insert(output.end(), bytes.begin(), bytes.end());
|
||||
AppendBigEndian32(output, Adler32(bytes));
|
||||
return output;
|
||||
}
|
||||
|
||||
static std::vector<std::uint8_t> GrayLowBitPng(std::uint8_t bitDepth, std::span<const std::uint8_t> samples,
|
||||
std::optional<std::uint16_t> transparency,
|
||||
std::optional<std::uint16_t> precedingTransparency = std::nullopt) {
|
||||
Require(bitDepth == 1 || bitDepth == 2 || bitDepth == 4);
|
||||
std::vector<std::uint8_t> rows(1 + (samples.size() * bitDepth + 7) / 8, 0);
|
||||
std::size_t bit = 0;
|
||||
for (const std::uint8_t sample : samples) {
|
||||
Require(sample < (1u << bitDepth));
|
||||
rows[1 + bit / 8] |= static_cast<std::uint8_t>(sample << (8 - bitDepth - bit % 8));
|
||||
bit += bitDepth;
|
||||
}
|
||||
|
||||
std::vector<std::uint8_t> ihdr;
|
||||
AppendBigEndian32(ihdr, static_cast<std::uint32_t>(samples.size()));
|
||||
AppendBigEndian32(ihdr, 1);
|
||||
ihdr.insert(ihdr.end(), {bitDepth, 0, 0, 0, 0});
|
||||
|
||||
std::vector<std::uint8_t> png(PNG_SIGNATURE, PNG_SIGNATURE + sizeof(PNG_SIGNATURE));
|
||||
AppendTestChunk(png, "IHDR", ihdr);
|
||||
if (precedingTransparency.has_value()) {
|
||||
const std::uint8_t key[2] = {static_cast<std::uint8_t>(*precedingTransparency >> 8), static_cast<std::uint8_t>(*precedingTransparency)};
|
||||
AppendTestChunk(png, "tRNS", key);
|
||||
}
|
||||
if (transparency.has_value()) {
|
||||
const std::uint8_t key[2] = {static_cast<std::uint8_t>(*transparency >> 8), static_cast<std::uint8_t>(*transparency)};
|
||||
AppendTestChunk(png, "tRNS", key);
|
||||
}
|
||||
AppendTestChunk(png, "IDAT", ZlibStore(rows));
|
||||
AppendTestChunk(png, "IEND", std::span<const std::uint8_t>());
|
||||
return png;
|
||||
}
|
||||
|
||||
static std::uint8_t GrayScale(std::uint8_t bitDepth) {
|
||||
if (bitDepth == 1) return 255;
|
||||
if (bitDepth == 2) return 85;
|
||||
return 17;
|
||||
}
|
||||
|
||||
static void RequireGrayTransparency(std::uint8_t bitDepth, std::span<const std::uint8_t> samples, std::uint16_t key,
|
||||
std::uint8_t transparentSample, std::optional<std::uint16_t> precedingKey = std::nullopt) {
|
||||
const std::vector<std::uint8_t> png = GrayLowBitPng(bitDepth, samples, key, precedingKey);
|
||||
const std::vector<std::uint8_t> original = png;
|
||||
const auto header = Decoder::Png::ParseHeader(png);
|
||||
Require(header.has_value());
|
||||
Require(header->width == static_cast<std::uint32_t>(samples.size()) && header->height == 1 && header->bitDepth == bitDepth);
|
||||
Require(header->colorType == Decoder::Png::ColorType::Grayscale && header->hasTransparency);
|
||||
|
||||
const auto image = Decoder::Png::Decode(png);
|
||||
Require(image.has_value() && image->pixels.size() == samples.size() * 4);
|
||||
const std::uint8_t scale = GrayScale(bitDepth);
|
||||
for (std::size_t i = 0; i < samples.size(); ++i) {
|
||||
const std::uint8_t gray = static_cast<std::uint8_t>(samples[i] * scale);
|
||||
Require(image->pixels[i * 4] == gray && image->pixels[i * 4 + 1] == gray && image->pixels[i * 4 + 2] == gray);
|
||||
Require(image->pixels[i * 4 + 3] == (samples[i] == transparentSample ? 0 : 255));
|
||||
}
|
||||
Require(png == original);
|
||||
}
|
||||
|
||||
static void RequireGrayOpaque(std::uint8_t bitDepth, std::span<const std::uint8_t> samples) {
|
||||
const std::vector<std::uint8_t> png = GrayLowBitPng(bitDepth, samples, std::nullopt);
|
||||
const std::vector<std::uint8_t> original = png;
|
||||
const auto header = Decoder::Png::ParseHeader(png);
|
||||
Require(header.has_value() && !header->hasTransparency);
|
||||
const auto image = Decoder::Png::Decode(png);
|
||||
Require(image.has_value() && image->pixels.size() == samples.size() * 4);
|
||||
const std::uint8_t scale = GrayScale(bitDepth);
|
||||
for (std::size_t i = 0; i < samples.size(); ++i) {
|
||||
const std::uint8_t gray = static_cast<std::uint8_t>(samples[i] * scale);
|
||||
Require(image->pixels[i * 4] == gray && image->pixels[i * 4 + 1] == gray && image->pixels[i * 4 + 2] == gray);
|
||||
Require(image->pixels[i * 4 + 3] == 255);
|
||||
}
|
||||
Require(png == original);
|
||||
}
|
||||
|
||||
static void RequireTruncatedTransparency() {
|
||||
const std::uint8_t samples[] = {0, 1};
|
||||
const std::vector<std::uint8_t> png = GrayLowBitPng(1, samples, 0x0002);
|
||||
const std::size_t transparencyOffset = sizeof(PNG_SIGNATURE) + 25;
|
||||
const std::vector<std::uint8_t> truncated(png.begin(), png.begin() + transparencyOffset + 9);
|
||||
const std::vector<std::uint8_t> original = truncated;
|
||||
const auto header = Decoder::Png::ParseHeader(truncated);
|
||||
Require(header.has_value() && !header->hasTransparency);
|
||||
(void)Decoder::Png::Decode(truncated);
|
||||
Require(truncated == original);
|
||||
}
|
||||
|
||||
static void RequireRoundTrip(std::uint32_t channels, Decoder::Png::ColorType colorType) {
|
||||
constexpr std::uint32_t width = 20;
|
||||
constexpr std::uint32_t height = 10;
|
||||
@@ -176,6 +312,42 @@ int main() {
|
||||
const std::uint8_t levels[8] = {0, 255, 0, 255, 255, 0, 0, 255};
|
||||
for (int i = 0; i < 8; ++i) Require(gray1->pixels[i * 4] == levels[i] && gray1->pixels[i * 4 + 3] == 255);
|
||||
|
||||
const auto gray1TrnsHeader = Decoder::Png::ParseHeader(GRAY1_TRNS);
|
||||
Require(gray1TrnsHeader.has_value());
|
||||
Require(gray1TrnsHeader->width == 2 && gray1TrnsHeader->height == 1 && gray1TrnsHeader->bitDepth == 1);
|
||||
Require(gray1TrnsHeader->colorType == Decoder::Png::ColorType::Grayscale && gray1TrnsHeader->hasTransparency);
|
||||
const auto gray1Trns = Decoder::Png::Decode(GRAY1_TRNS);
|
||||
Require(gray1Trns.has_value());
|
||||
Require(gray1Trns->pixels == std::vector<std::uint8_t>({0, 0, 0, 0, 255, 255, 255, 255}));
|
||||
|
||||
const std::uint8_t gray1Samples[] = {0, 1, 0, 1, 1, 0, 0, 1};
|
||||
RequireGrayTransparency(1, gray1Samples, 0x0000, 0);
|
||||
RequireGrayTransparency(1, gray1Samples, 0x0002, 0);
|
||||
RequireGrayTransparency(1, gray1Samples, 0x0100, 0);
|
||||
RequireGrayTransparency(1, gray1Samples, 0xFF02, 0);
|
||||
RequireGrayTransparency(1, gray1Samples, 0xFFFF, 1);
|
||||
RequireGrayTransparency(1, gray1Samples, 0x0001, 1, 0x0002);
|
||||
RequireGrayOpaque(1, gray1Samples);
|
||||
|
||||
const std::uint8_t gray2Samples[] = {0, 1, 2, 3};
|
||||
RequireGrayTransparency(2, gray2Samples, 0x0001, 1);
|
||||
RequireGrayTransparency(2, gray2Samples, 0x0005, 1);
|
||||
RequireGrayTransparency(2, gray2Samples, 0x0100, 0);
|
||||
RequireGrayTransparency(2, gray2Samples, 0x0101, 1);
|
||||
RequireGrayTransparency(2, gray2Samples, 0xFF05, 1);
|
||||
RequireGrayTransparency(2, gray2Samples, 0xFFFF, 3);
|
||||
RequireGrayOpaque(2, gray2Samples);
|
||||
|
||||
const std::uint8_t gray4Samples[] = {0, 3, 10, 15, 1};
|
||||
RequireGrayTransparency(4, gray4Samples, 0x0003, 3);
|
||||
RequireGrayTransparency(4, gray4Samples, 0x0013, 3);
|
||||
RequireGrayTransparency(4, gray4Samples, 0x0100, 0);
|
||||
RequireGrayTransparency(4, gray4Samples, 0x0103, 3);
|
||||
RequireGrayTransparency(4, gray4Samples, 0xFF13, 3);
|
||||
RequireGrayTransparency(4, gray4Samples, 0xFFFF, 15);
|
||||
RequireGrayOpaque(4, gray4Samples);
|
||||
RequireTruncatedTransparency();
|
||||
|
||||
const auto interlaced = Decoder::Png::ParseHeader(HeaderOnly(3, 4, 8, 6, 1));
|
||||
Require(interlaced.has_value() && interlaced->interlaced && !interlaced->hasTransparency);
|
||||
Require(!Decoder::Png::ParseHeader(HeaderOnly(0, 4, 8, 6, 0)).has_value());
|
||||
|
||||
+266
-8
@@ -39,9 +39,16 @@ if(MINGW)
|
||||
check_cxx_source_compiles("#ifdef __USING_SJLJ_EXCEPTIONS__\n#error\n#endif\nint main() { return 0; }" ANYPS5_MINGW_DWARF_EXCEPTIONS)
|
||||
unset(CMAKE_REQUIRED_FLAGS)
|
||||
if(NOT ANYPS5_MINGW_DWARF_EXCEPTIONS)
|
||||
message(FATAL_ERROR "${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION} selects SjLj exceptions with -fno-asynchronous-unwind-tables; the libraries need DWARF unwinding. Use the MinGW-w64 toolchain listed in docs/dev/BUILD.md.")
|
||||
check_cxx_source_compiles("#if !defined(__SEH__) || defined(__USING_SJLJ_EXCEPTIONS__)\n#error\n#endif\n[[gnu::sysv_abi, gnu::noinline]] void Throw() { throw 1; }\n[[gnu::sysv_abi, gnu::noinline]] int Catch() { try { Throw(); } catch (int value) { return value; } return 0; }\nint main() { return Catch() != 1; }" ANYPS5_MINGW_SYSV_SEH_EXCEPTIONS)
|
||||
if(NOT ANYPS5_MINGW_SYSV_SEH_EXCEPTIONS)
|
||||
message(FATAL_ERROR "The Windows libraries require DWARF exceptions or GCC with System V ABI SEH support. Use the toolchains listed in docs/dev/BUILD.md.")
|
||||
endif()
|
||||
add_library(windows_seh_personalities OBJECT ${CMAKE_CURRENT_SOURCE_DIR}/prx/libc/src/specifics/windows/SehPersonalities.cpp)
|
||||
target_link_options(windows_seh_personalities INTERFACE LINKER:--undefined=LibcSehPersonalities_nid_no_patch)
|
||||
link_libraries(windows_seh_personalities)
|
||||
else()
|
||||
add_compile_options(-fno-asynchronous-unwind-tables)
|
||||
endif()
|
||||
add_compile_options(-fno-asynchronous-unwind-tables)
|
||||
endif()
|
||||
|
||||
function(configure_windows_unwind target)
|
||||
@@ -50,7 +57,7 @@ function(configure_windows_unwind target)
|
||||
message(FATAL_ERROR "Windows DWARF unwinding requires objcopy")
|
||||
endif()
|
||||
add_custom_command(TARGET ${target} POST_BUILD
|
||||
COMMAND "${CMAKE_OBJCOPY}" --rename-section .eh_frame=.ehfram "$<TARGET_FILE:${target}>"
|
||||
COMMAND "${CMAKE_OBJCOPY}" --rename-section .eh_frame=.ehfram --rename-section .eh_fram=.ehfram "$<TARGET_FILE:${target}>"
|
||||
VERBATIM
|
||||
)
|
||||
endif()
|
||||
@@ -61,6 +68,18 @@ if(MINGW)
|
||||
string(REPLACE "${runtimeLinkFlag}" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
|
||||
endforeach()
|
||||
|
||||
if(NOT EXISTS "${CMAKE_RANLIB}")
|
||||
if(EXISTS "${CMAKE_CXX_COMPILER_RANLIB}")
|
||||
set(CMAKE_RANLIB "${CMAKE_CXX_COMPILER_RANLIB}")
|
||||
else()
|
||||
get_filename_component(_compiler_dir "${CMAKE_CXX_COMPILER}" DIRECTORY)
|
||||
if(EXISTS "${_compiler_dir}/gcc-ranlib${CMAKE_EXECUTABLE_SUFFIX}")
|
||||
set(CMAKE_RANLIB "${_compiler_dir}/gcc-ranlib${CMAKE_EXECUTABLE_SUFFIX}")
|
||||
elseif(EXISTS "${_compiler_dir}/ranlib${CMAKE_EXECUTABLE_SUFFIX}")
|
||||
set(CMAKE_RANLIB "${_compiler_dir}/ranlib${CMAKE_EXECUTABLE_SUFFIX}")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
if(NOT EXISTS "${CMAKE_RANLIB}")
|
||||
message(FATAL_ERROR "Stable import libraries require ranlib")
|
||||
endif()
|
||||
@@ -186,6 +205,8 @@ foreach(LIB_DIR ${LIBS_DIRS})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
target_link_libraries(libSceUsbStorageDialog PRIVATE libSceUserService)
|
||||
|
||||
if(APS5_ENABLE_TRACY)
|
||||
set_target_properties(TracyClient PROPERTIES
|
||||
RUNTIME_OUTPUT_DIRECTORY ${UNPATCHED_DIR}
|
||||
@@ -209,7 +230,7 @@ if(TARGET mimalloc)
|
||||
target_compile_features(pe_import_first PRIVATE cxx_std_20)
|
||||
if(MINGW)
|
||||
target_compile_options(pe_import_first PRIVATE -fasynchronous-unwind-tables)
|
||||
target_link_options(pe_import_first PRIVATE -static -static-libgcc -static-libstdc++)
|
||||
target_link_options(pe_import_first PRIVATE -municode -static -static-libgcc -static-libstdc++)
|
||||
endif()
|
||||
add_custom_command(
|
||||
OUTPUT ${PATCHED_DIR}/mimalloc.dll
|
||||
@@ -239,6 +260,15 @@ if(BUILD_TESTING)
|
||||
set_tests_properties(guest_posix_scalar_io PROPERTIES ENVIRONMENT_MODIFICATION
|
||||
"PATH=path_list_prepend:$<TARGET_FILE_DIR:libkernel>")
|
||||
endif()
|
||||
add_test_executable(guest_kernel_sys_sdk_version_tests tests/GuestKernelSysSdkVersion.cpp)
|
||||
target_include_directories(guest_kernel_sys_sdk_version_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_link_libraries(guest_kernel_sys_sdk_version_tests PRIVATE libkernel_sys libkernel libc)
|
||||
configure_windows_unwind(guest_kernel_sys_sdk_version_tests)
|
||||
add_test(NAME guest_kernel_sys_sdk_version COMMAND guest_kernel_sys_sdk_version_tests)
|
||||
if(WIN32)
|
||||
set_tests_properties(guest_kernel_sys_sdk_version PROPERTIES ENVIRONMENT_MODIFICATION
|
||||
"PATH=path_list_prepend:$<TARGET_FILE_DIR:libkernel_sys>")
|
||||
endif()
|
||||
add_test_executable(nid_buffer_validation_tests nid/tests/BufferValidation.cpp)
|
||||
target_include_directories(nid_buffer_validation_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/nid/include)
|
||||
target_compile_features(nid_buffer_validation_tests PRIVATE cxx_std_20)
|
||||
@@ -259,6 +289,25 @@ if(BUILD_TESTING)
|
||||
|
||||
find_package(Python3 QUIET COMPONENTS Interpreter)
|
||||
if(Python3_Interpreter_FOUND)
|
||||
set(public_header_compiler_args)
|
||||
if(APPLE)
|
||||
foreach(architecture IN LISTS CMAKE_OSX_ARCHITECTURES)
|
||||
list(APPEND public_header_compiler_args --compiler-arg=-arch "--compiler-arg=${architecture}")
|
||||
endforeach()
|
||||
if(CMAKE_OSX_SYSROOT)
|
||||
list(APPEND public_header_compiler_args --compiler-arg=-isysroot "--compiler-arg=${CMAKE_OSX_SYSROOT}")
|
||||
endif()
|
||||
endif()
|
||||
set(public_header_manifest "${CMAKE_CURRENT_BINARY_DIR}/public_headers.json")
|
||||
add_test(NAME public_headers COMMAND ${Python3_EXECUTABLE}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/tests/test_public_headers.py --audit-only --manifest "${public_header_manifest}")
|
||||
set_tests_properties(public_headers PROPERTIES TIMEOUT 30 RUN_SERIAL TRUE FIXTURES_SETUP public_headers_manifest)
|
||||
foreach(batch RANGE 0 63)
|
||||
add_test(NAME public_headers_compile_${batch} COMMAND ${Python3_EXECUTABLE}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/tests/test_public_headers.py --compiler ${CMAKE_CXX_COMPILER} ${public_header_compiler_args}
|
||||
--manifest "${public_header_manifest}" --batch-index ${batch} --batch-count 64)
|
||||
set_tests_properties(public_headers_compile_${batch} PROPERTIES TIMEOUT 30 FIXTURES_REQUIRED public_headers_manifest)
|
||||
endforeach()
|
||||
add_test(NAME nid_gnu_hash COMMAND ${Python3_EXECUTABLE}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/nid/tests/test_gnu_hash.py $<TARGET_FILE:nid_patcher>)
|
||||
add_test(NAME nid_elf_duplicates COMMAND ${Python3_EXECUTABLE}
|
||||
@@ -300,22 +349,59 @@ if(BUILD_TESTING)
|
||||
target_link_libraries(guest_kernel_sys_tests PRIVATE libkernel_sys libkernel libc)
|
||||
configure_windows_unwind(guest_kernel_sys_tests)
|
||||
add_test(NAME guest_kernel_sys COMMAND guest_kernel_sys_tests)
|
||||
add_test_executable(guest_kernel_sys_thread_defaults_tests tests/GuestKernelSysThreadDefaults.cpp)
|
||||
target_include_directories(guest_kernel_sys_thread_defaults_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_link_libraries(guest_kernel_sys_thread_defaults_tests PRIVATE libkernel_sys libkernel libc)
|
||||
configure_windows_unwind(guest_kernel_sys_thread_defaults_tests)
|
||||
add_test(NAME guest_kernel_sys_thread_defaults COMMAND guest_kernel_sys_thread_defaults_tests)
|
||||
set_tests_properties(guest_kernel_sys_thread_defaults PROPERTIES TIMEOUT 20)
|
||||
add_test_executable(guest_kernel_sys_barrier_tests tests/GuestKernelSysBarrier.cpp)
|
||||
target_include_directories(guest_kernel_sys_barrier_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_link_libraries(guest_kernel_sys_barrier_tests PRIVATE libkernel_sys libkernel libc)
|
||||
configure_windows_unwind(guest_kernel_sys_barrier_tests)
|
||||
add_test(NAME guest_kernel_sys_barrier COMMAND guest_kernel_sys_barrier_tests)
|
||||
set_tests_properties(guest_kernel_sys_barrier PROPERTIES TIMEOUT 20)
|
||||
add_test_executable(guest_kernel_sys_pthread_tests tests/GuestKernelSysPthread.cpp)
|
||||
target_include_directories(guest_kernel_sys_pthread_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_link_libraries(guest_kernel_sys_pthread_tests PRIVATE libkernel_sys libkernel libc)
|
||||
configure_windows_unwind(guest_kernel_sys_pthread_tests)
|
||||
add_test(NAME guest_kernel_sys_pthread COMMAND guest_kernel_sys_pthread_tests)
|
||||
if(Python3_Interpreter_FOUND)
|
||||
add_test(NAME nid_verneed COMMAND ${Python3_EXECUTABLE}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/nid/tests/test_verneed.py $<TARGET_FILE:nid_patcher>)
|
||||
endif()
|
||||
if(WIN32)
|
||||
set_tests_properties(guest_kernel_sys PROPERTIES ENVIRONMENT_MODIFICATION
|
||||
set_tests_properties(guest_kernel_sys guest_kernel_sys_thread_defaults guest_kernel_sys_barrier guest_kernel_sys_pthread PROPERTIES ENVIRONMENT_MODIFICATION
|
||||
"PATH=path_list_prepend:$<TARGET_FILE_DIR:libkernel_sys>")
|
||||
endif()
|
||||
|
||||
add_test_executable(guest_gnm_neo_packets_tests tests/GuestGnmNeoPackets.cpp)
|
||||
target_include_directories(guest_gnm_neo_packets_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_link_libraries(guest_gnm_neo_packets_tests PRIVATE libSceGnmDriverForNeoMode libc)
|
||||
configure_windows_unwind(guest_gnm_neo_packets_tests)
|
||||
add_test(NAME guest_gnm_neo_packets COMMAND guest_gnm_neo_packets_tests)
|
||||
if(WIN32)
|
||||
set_tests_properties(guest_gnm_neo_packets PROPERTIES ENVIRONMENT_MODIFICATION
|
||||
"PATH=path_list_prepend:$<TARGET_FILE_DIR:libSceGnmDriverForNeoMode>")
|
||||
endif()
|
||||
if(APPLE)
|
||||
add_subdirectory(tests/write_watch)
|
||||
add_subdirectory(tests/guest_arena)
|
||||
endif()
|
||||
add_test_executable(guest_kernel_sys_module_internal_tests tests/GuestKernelSysModuleInternal.cpp)
|
||||
target_include_directories(guest_kernel_sys_module_internal_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_link_libraries(guest_kernel_sys_module_internal_tests PRIVATE libkernel_sys libkernel libc)
|
||||
configure_windows_unwind(guest_kernel_sys_module_internal_tests)
|
||||
add_test(NAME guest_kernel_sys_module_internal COMMAND guest_kernel_sys_module_internal_tests)
|
||||
set_tests_properties(guest_kernel_sys_module_internal PROPERTIES TIMEOUT 20)
|
||||
if(WIN32)
|
||||
set_tests_properties(guest_kernel_sys_module_internal PROPERTIES ENVIRONMENT_MODIFICATION
|
||||
"PATH=path_list_prepend:$<TARGET_FILE_DIR:libkernel_sys>")
|
||||
endif()
|
||||
if(WIN32)
|
||||
add_test_executable(windows_write_watch_tests tests/WindowsWriteWatch.cpp)
|
||||
target_include_directories(windows_write_watch_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_compile_definitions(windows_write_watch_tests PRIVATE _WIN32_WINNT=0x0A00)
|
||||
target_compile_definitions(windows_write_watch_tests PRIVATE _WIN32_WINNT=0x0A00 APS5_COUNT_MAPPING_QUERIES=1)
|
||||
if(MINGW)
|
||||
target_compile_options(windows_write_watch_tests PRIVATE -fasynchronous-unwind-tables)
|
||||
endif()
|
||||
@@ -325,6 +411,9 @@ if(BUILD_TESTING)
|
||||
|
||||
if(WIN32)
|
||||
add_test_executable(undeliverable_host_exception_tests tests/UndeliverableHostException.cpp)
|
||||
if(MINGW)
|
||||
target_compile_options(undeliverable_host_exception_tests PRIVATE -fno-asynchronous-unwind-tables -fno-exceptions)
|
||||
endif()
|
||||
add_dependencies(undeliverable_host_exception_tests libc)
|
||||
add_test(NAME undeliverable_host_exception COMMAND undeliverable_host_exception_tests $<TARGET_FILE:libc>)
|
||||
set_tests_properties(undeliverable_host_exception PROPERTIES
|
||||
@@ -337,6 +426,16 @@ if(BUILD_TESTING)
|
||||
target_compile_options(crash_text_tests PRIVATE -fasynchronous-unwind-tables)
|
||||
endif()
|
||||
add_test(NAME crash_text COMMAND crash_text_tests)
|
||||
add_test_executable(guest_kernel_sys_pselect_tests tests/GuestKernelSysPselect.cpp)
|
||||
target_include_directories(guest_kernel_sys_pselect_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_link_libraries(guest_kernel_sys_pselect_tests PRIVATE libkernel_sys libkernel libc)
|
||||
configure_windows_unwind(guest_kernel_sys_pselect_tests)
|
||||
add_test(NAME guest_kernel_sys_pselect COMMAND guest_kernel_sys_pselect_tests)
|
||||
set_tests_properties(guest_kernel_sys_pselect PROPERTIES TIMEOUT 20)
|
||||
if(WIN32)
|
||||
set_tests_properties(guest_kernel_sys_pselect PROPERTIES ENVIRONMENT_MODIFICATION
|
||||
"PATH=path_list_prepend:$<TARGET_FILE_DIR:libkernel_sys>")
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
add_test_executable(windows_crash_text_tests tests/WindowsCrashText.cpp)
|
||||
@@ -360,6 +459,26 @@ if(BUILD_TESTING)
|
||||
"PATH=path_list_prepend:$<TARGET_FILE_DIR:libSceVoice>")
|
||||
endif()
|
||||
|
||||
add_test_executable(guest_gnm_neo_retail_tests tests/GuestGnmNeoRetail.cpp)
|
||||
target_include_directories(guest_gnm_neo_retail_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_link_libraries(guest_gnm_neo_retail_tests PRIVATE libSceGnmDriverForNeoMode libc)
|
||||
configure_windows_unwind(guest_gnm_neo_retail_tests)
|
||||
add_test(NAME guest_gnm_neo_retail COMMAND guest_gnm_neo_retail_tests)
|
||||
if(WIN32)
|
||||
set_tests_properties(guest_gnm_neo_retail PROPERTIES ENVIRONMENT_MODIFICATION
|
||||
"PATH=path_list_prepend:$<TARGET_FILE_DIR:libSceGnmDriverForNeoMode>")
|
||||
endif()
|
||||
|
||||
add_test_executable(guest_vr_tracker_devices_tests tests/GuestVrTrackerDevices.cpp)
|
||||
target_include_directories(guest_vr_tracker_devices_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_link_libraries(guest_vr_tracker_devices_tests PRIVATE libSceVrTracker libc)
|
||||
configure_windows_unwind(guest_vr_tracker_devices_tests)
|
||||
add_test(NAME guest_vr_tracker_devices COMMAND guest_vr_tracker_devices_tests)
|
||||
if(WIN32)
|
||||
set_tests_properties(guest_vr_tracker_devices PROPERTIES ENVIRONMENT_MODIFICATION
|
||||
"PATH=path_list_prepend:$<TARGET_FILE_DIR:libSceVrTracker>")
|
||||
endif()
|
||||
|
||||
add_test_executable(guest_move_tests tests/GuestMove.cpp)
|
||||
target_include_directories(guest_move_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_link_libraries(guest_move_tests PRIVATE libSceMove libc)
|
||||
@@ -370,9 +489,53 @@ if(BUILD_TESTING)
|
||||
"PATH=path_list_prepend:$<TARGET_FILE_DIR:libSceMove>")
|
||||
endif()
|
||||
|
||||
add_test_executable(guest_np_party_tests tests/GuestNpParty.cpp)
|
||||
target_include_directories(guest_np_party_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_link_libraries(guest_np_party_tests PRIVATE libSceNpParty libc)
|
||||
configure_windows_unwind(guest_np_party_tests)
|
||||
add_test(NAME guest_np_party COMMAND guest_np_party_tests)
|
||||
if(WIN32)
|
||||
set_tests_properties(guest_np_party PROPERTIES ENVIRONMENT_MODIFICATION
|
||||
"PATH=path_list_prepend:$<TARGET_FILE_DIR:libSceNpParty>")
|
||||
endif()
|
||||
|
||||
add_test_executable(guest_np_ps4_imports_tests tests/GuestNpPs4Imports.cpp)
|
||||
target_include_directories(guest_np_ps4_imports_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_link_libraries(guest_np_ps4_imports_tests PRIVATE libSceNpMatching2 libSceNpSignaling libSceNpTrophy libc)
|
||||
configure_windows_unwind(guest_np_ps4_imports_tests)
|
||||
add_test(NAME guest_np_ps4_imports COMMAND guest_np_ps4_imports_tests)
|
||||
if(WIN32)
|
||||
set_tests_properties(guest_np_ps4_imports PROPERTIES ENVIRONMENT_MODIFICATION
|
||||
"PATH=path_list_prepend:$<TARGET_FILE_DIR:libSceNpMatching2>")
|
||||
endif()
|
||||
|
||||
add_test_executable(guest_np_common_tests tests/GuestNpCommon.cpp)
|
||||
target_include_directories(guest_np_common_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_link_libraries(guest_np_common_tests PRIVATE libSceNpCommon libkernel libc)
|
||||
configure_windows_unwind(guest_np_common_tests)
|
||||
foreach(testCase IN ITEMS ids sync clock)
|
||||
add_test(NAME guest_np_common_${testCase} COMMAND guest_np_common_tests ${testCase})
|
||||
set_tests_properties(guest_np_common_${testCase} PROPERTIES TIMEOUT 20)
|
||||
if(WIN32)
|
||||
set_tests_properties(guest_np_common_${testCase} PROPERTIES ENVIRONMENT_MODIFICATION
|
||||
"PATH=path_list_prepend:$<TARGET_FILE_DIR:libSceNpCommon>")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
add_test_executable(guest_np_common_runtime_tests tests/GuestNpCommonRuntime.cpp)
|
||||
target_include_directories(guest_np_common_runtime_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_link_libraries(guest_np_common_runtime_tests PRIVATE libSceNpCommon libkernel libc)
|
||||
configure_windows_unwind(guest_np_common_runtime_tests)
|
||||
add_test(NAME guest_np_common_runtime COMMAND guest_np_common_runtime_tests)
|
||||
set_tests_properties(guest_np_common_runtime PROPERTIES TIMEOUT 20)
|
||||
if(WIN32)
|
||||
set_tests_properties(guest_np_common_runtime PROPERTIES ENVIRONMENT_MODIFICATION
|
||||
"PATH=path_list_prepend:$<TARGET_FILE_DIR:libSceNpCommon>")
|
||||
endif()
|
||||
|
||||
add_test_executable(guest_offline_imports_tests tests/GuestOfflineImports.cpp)
|
||||
target_include_directories(guest_offline_imports_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_link_libraries(guest_offline_imports_tests PRIVATE libSceHttp libSceNpEntitlementAccess libSceRudp libc)
|
||||
target_link_libraries(guest_offline_imports_tests PRIVATE libSceHttp libSceNpEntitlementAccess libSceRudp libSceVideoRecordingP libc)
|
||||
configure_windows_unwind(guest_offline_imports_tests)
|
||||
add_test(NAME guest_offline_imports COMMAND guest_offline_imports_tests)
|
||||
if(Python3_Interpreter_FOUND)
|
||||
@@ -384,6 +547,17 @@ if(BUILD_TESTING)
|
||||
"PATH=path_list_prepend:$<TARGET_FILE_DIR:libSceHttp>")
|
||||
endif()
|
||||
|
||||
add_test_executable(guest_entitlements_tests tests/GuestEntitlements.cpp)
|
||||
target_include_directories(guest_entitlements_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_link_libraries(guest_entitlements_tests PRIVATE libSceNpEntitlementAccess libc)
|
||||
configure_windows_unwind(guest_entitlements_tests)
|
||||
add_test(NAME guest_entitlements COMMAND guest_entitlements_tests)
|
||||
add_test(NAME guest_entitlements_missing COMMAND guest_entitlements_tests missing)
|
||||
if(WIN32)
|
||||
set_tests_properties(guest_entitlements guest_entitlements_missing PROPERTIES ENVIRONMENT_MODIFICATION
|
||||
"PATH=path_list_prepend:$<TARGET_FILE_DIR:libSceNpEntitlementAccess>")
|
||||
endif()
|
||||
|
||||
add_test_executable(guest_signin_dialog_tests tests/GuestSigninDialog.cpp)
|
||||
target_include_directories(guest_signin_dialog_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_link_libraries(guest_signin_dialog_tests PRIVATE libSceSigninDialog libc)
|
||||
@@ -396,7 +570,7 @@ if(BUILD_TESTING)
|
||||
|
||||
add_test_executable(guest_usb_storage_dialog_tests tests/GuestUsbStorageDialog.cpp)
|
||||
target_include_directories(guest_usb_storage_dialog_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_link_libraries(guest_usb_storage_dialog_tests PRIVATE libSceUsbStorageDialog libc)
|
||||
target_link_libraries(guest_usb_storage_dialog_tests PRIVATE libSceUsbStorageDialog libSceUserService libc)
|
||||
configure_windows_unwind(guest_usb_storage_dialog_tests)
|
||||
add_test(NAME guest_usb_storage_dialog COMMAND guest_usb_storage_dialog_tests)
|
||||
if(WIN32)
|
||||
@@ -583,6 +757,26 @@ if(BUILD_TESTING)
|
||||
"PATH=path_list_prepend:$<TARGET_FILE_DIR:libSceNpCppWebApi>")
|
||||
endif()
|
||||
|
||||
add_test_executable(guest_np_cpp_web_api_signed_out_tests tests/GuestNpCppWebApiSignedOut.cpp)
|
||||
target_include_directories(guest_np_cpp_web_api_signed_out_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_link_libraries(guest_np_cpp_web_api_signed_out_tests PRIVATE libSceNpCppWebApi libc)
|
||||
configure_windows_unwind(guest_np_cpp_web_api_signed_out_tests)
|
||||
add_test(NAME guest_np_cpp_web_api_signed_out COMMAND guest_np_cpp_web_api_signed_out_tests)
|
||||
if(WIN32)
|
||||
set_tests_properties(guest_np_cpp_web_api_signed_out PROPERTIES ENVIRONMENT_MODIFICATION
|
||||
"PATH=path_list_prepend:$<TARGET_FILE_DIR:libSceNpCppWebApi>")
|
||||
endif()
|
||||
|
||||
add_test_executable(guest_np_cpp_web_api_offline_tests tests/GuestNpCppWebApiOffline.cpp)
|
||||
target_include_directories(guest_np_cpp_web_api_offline_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_link_libraries(guest_np_cpp_web_api_offline_tests PRIVATE libSceNpCppWebApi libc)
|
||||
configure_windows_unwind(guest_np_cpp_web_api_offline_tests)
|
||||
add_test(NAME guest_np_cpp_web_api_offline COMMAND guest_np_cpp_web_api_offline_tests)
|
||||
if(WIN32)
|
||||
set_tests_properties(guest_np_cpp_web_api_offline PROPERTIES ENVIRONMENT_MODIFICATION
|
||||
"PATH=path_list_prepend:$<TARGET_FILE_DIR:libSceNpCppWebApi>")
|
||||
endif()
|
||||
|
||||
add_test_executable(savedata_core_write_replacement_tests tests/SaveDataWriteReplacement.cpp)
|
||||
target_include_directories(savedata_core_write_replacement_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_link_libraries(savedata_core_write_replacement_tests PRIVATE libSceSaveData)
|
||||
@@ -601,6 +795,17 @@ if(BUILD_TESTING)
|
||||
configure_windows_unwind(savedata_replace_file_failure_tests)
|
||||
add_test(NAME savedata_replace_file_failure COMMAND savedata_replace_file_failure_tests)
|
||||
|
||||
add_test_executable(guest_kernel_sys_ktimer_tests tests/GuestKernelSysKtimer.cpp)
|
||||
target_include_directories(guest_kernel_sys_ktimer_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_link_libraries(guest_kernel_sys_ktimer_tests PRIVATE libkernel_sys libkernel libc)
|
||||
configure_windows_unwind(guest_kernel_sys_ktimer_tests)
|
||||
add_test(NAME guest_kernel_sys_ktimer COMMAND guest_kernel_sys_ktimer_tests)
|
||||
set_tests_properties(guest_kernel_sys_ktimer PROPERTIES TIMEOUT 20)
|
||||
if(WIN32)
|
||||
set_tests_properties(guest_kernel_sys_ktimer PROPERTIES ENVIRONMENT_MODIFICATION
|
||||
"PATH=path_list_prepend:$<TARGET_FILE_DIR:libkernel_sys>")
|
||||
endif()
|
||||
|
||||
add_test_executable(guest_crt_tests tests/GuestCrt.cpp)
|
||||
target_include_directories(guest_crt_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_link_libraries(guest_crt_tests PRIVATE libSceAmpr libc)
|
||||
@@ -623,6 +828,17 @@ if(BUILD_TESTING)
|
||||
"PATH=path_list_prepend:$<TARGET_FILE_DIR:libSceSaveData.native>")
|
||||
endif()
|
||||
|
||||
add_test_executable(guest_kernel_sys_aio_tests tests/GuestKernelSysAio.cpp)
|
||||
target_include_directories(guest_kernel_sys_aio_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_link_libraries(guest_kernel_sys_aio_tests PRIVATE libkernel_sys libkernel libc)
|
||||
configure_windows_unwind(guest_kernel_sys_aio_tests)
|
||||
add_test(NAME guest_kernel_sys_aio COMMAND guest_kernel_sys_aio_tests)
|
||||
set_tests_properties(guest_kernel_sys_aio PROPERTIES TIMEOUT 20)
|
||||
if(WIN32)
|
||||
set_tests_properties(guest_kernel_sys_aio PROPERTIES ENVIRONMENT_MODIFICATION
|
||||
"PATH=path_list_prepend:$<TARGET_FILE_DIR:libkernel_sys>")
|
||||
endif()
|
||||
|
||||
add_test_executable(guest_posix_random_tests tests/GuestPosixRandom.cpp)
|
||||
target_include_directories(guest_posix_random_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_link_libraries(guest_posix_random_tests PRIVATE libScePosixForWebKit)
|
||||
@@ -663,6 +879,16 @@ if(BUILD_TESTING)
|
||||
"PATH=path_list_prepend:$<TARGET_FILE_DIR:libSceVoiceChat>")
|
||||
endif()
|
||||
|
||||
add_test_executable(guest_gnm_neo_embedded_tests tests/GuestGnmNeoEmbedded.cpp)
|
||||
target_include_directories(guest_gnm_neo_embedded_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_link_libraries(guest_gnm_neo_embedded_tests PRIVATE libSceGnmDriverForNeoMode libc)
|
||||
configure_windows_unwind(guest_gnm_neo_embedded_tests)
|
||||
add_test(NAME guest_gnm_neo_embedded COMMAND guest_gnm_neo_embedded_tests)
|
||||
if(WIN32)
|
||||
set_tests_properties(guest_gnm_neo_embedded PROPERTIES ENVIRONMENT_MODIFICATION
|
||||
"PATH=path_list_prepend:$<TARGET_FILE_DIR:libSceGnmDriverForNeoMode>")
|
||||
endif()
|
||||
|
||||
add_test_executable(guest_np_game_intent_tests tests/GuestNpGameIntent.cpp)
|
||||
target_include_directories(guest_np_game_intent_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_link_libraries(guest_np_game_intent_tests PRIVATE libSceNpGameIntent libc)
|
||||
@@ -672,4 +898,36 @@ if(BUILD_TESTING)
|
||||
set_tests_properties(guest_np_game_intent PROPERTIES ENVIRONMENT_MODIFICATION
|
||||
"PATH=path_list_prepend:$<TARGET_FILE_DIR:libSceNpGameIntent>")
|
||||
endif()
|
||||
|
||||
add_test_executable(guest_gnm_neo_shaders_tests tests/GuestGnmNeoShaders.cpp)
|
||||
target_include_directories(guest_gnm_neo_shaders_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_link_libraries(guest_gnm_neo_shaders_tests PRIVATE libSceGnmDriverForNeoMode libc)
|
||||
configure_windows_unwind(guest_gnm_neo_shaders_tests)
|
||||
add_test(NAME guest_gnm_neo_shaders COMMAND guest_gnm_neo_shaders_tests)
|
||||
if(WIN32)
|
||||
set_tests_properties(guest_gnm_neo_shaders PROPERTIES ENVIRONMENT_MODIFICATION
|
||||
"PATH=path_list_prepend:$<TARGET_FILE_DIR:libSceGnmDriverForNeoMode>")
|
||||
endif()
|
||||
|
||||
add_test_executable(guest_vorbis_dec_tests tests/GuestVorbisDec.cpp)
|
||||
target_include_directories(guest_vorbis_dec_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_compile_definitions(guest_vorbis_dec_tests PRIVATE OV_EXCLUDE_STATIC_CALLBACKS)
|
||||
target_link_libraries(guest_vorbis_dec_tests PRIVATE libSceVorbisDec vorbisenc vorbisfile vorbis ogg libc)
|
||||
configure_windows_unwind(guest_vorbis_dec_tests)
|
||||
add_test(NAME guest_vorbis_dec COMMAND guest_vorbis_dec_tests)
|
||||
set_tests_properties(guest_vorbis_dec PROPERTIES TIMEOUT 30)
|
||||
if(WIN32)
|
||||
set_tests_properties(guest_vorbis_dec PROPERTIES ENVIRONMENT_MODIFICATION
|
||||
"PATH=path_list_prepend:$<TARGET_FILE_DIR:libSceVorbisDec>")
|
||||
endif()
|
||||
|
||||
add_test_executable(guest_gnm_neo_default_state_tests tests/GuestGnmNeoDefaultState.cpp)
|
||||
target_include_directories(guest_gnm_neo_default_state_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_link_libraries(guest_gnm_neo_default_state_tests PRIVATE libSceGnmDriverForNeoMode libc)
|
||||
configure_windows_unwind(guest_gnm_neo_default_state_tests)
|
||||
add_test(NAME guest_gnm_neo_default_state COMMAND guest_gnm_neo_default_state_tests)
|
||||
if(WIN32)
|
||||
set_tests_properties(guest_gnm_neo_default_state PROPERTIES ENVIRONMENT_MODIFICATION
|
||||
"PATH=path_list_prepend:$<TARGET_FILE_DIR:libSceGnmDriverForNeoMode>")
|
||||
endif()
|
||||
endif()
|
||||
+228
-21
@@ -333,7 +333,7 @@ struct VaList {
|
||||
};
|
||||
#pragma pack(pop)
|
||||
|
||||
using FiberEntry = void* (*)(std::uint64_t, void*);
|
||||
using FiberEntry = void (APS5_VABI*)(std::uint64_t argOnInitialize, std::uint64_t argOnRun);
|
||||
|
||||
struct FiberOptParam {
|
||||
std::uint32_t magic;
|
||||
@@ -432,6 +432,48 @@ struct AcmBatchError {
|
||||
std::uint32_t reserved[8];
|
||||
};
|
||||
|
||||
struct AcmReverbBuffer {
|
||||
void* samples;
|
||||
const void* blockMetadata;
|
||||
};
|
||||
|
||||
struct AcmReverbInput {
|
||||
std::uint32_t blockSize;
|
||||
std::uint32_t blockCount;
|
||||
std::uint32_t channelCount;
|
||||
std::uint32_t sampleFormat;
|
||||
std::uint32_t currentBlock;
|
||||
std::uint32_t availableBlocks;
|
||||
const AcmReverbBuffer* const* history;
|
||||
const void* const* inputChannels;
|
||||
std::uint32_t pendingBlocks;
|
||||
};
|
||||
|
||||
struct AcmReverbFilter {
|
||||
std::uint32_t blockSize;
|
||||
std::uint32_t blockCount;
|
||||
std::uint32_t channelCount;
|
||||
std::uint32_t sampleFormat;
|
||||
const void* blockMetadata;
|
||||
const AcmReverbBuffer* const* channels;
|
||||
};
|
||||
|
||||
struct AcmReverbOutput {
|
||||
std::uint32_t blockSize;
|
||||
std::uint32_t channelCount;
|
||||
void* const* samples;
|
||||
void* const* workspace;
|
||||
float gain;
|
||||
float previousGain;
|
||||
void* const* previousSamples;
|
||||
};
|
||||
|
||||
static_assert(sizeof(AcmReverbBuffer) == 16);
|
||||
static_assert(offsetof(AcmReverbInput, history) == 24);
|
||||
static_assert(offsetof(AcmReverbInput, pendingBlocks) == 40);
|
||||
static_assert(sizeof(AcmReverbFilter) == 32);
|
||||
static_assert(offsetof(AcmReverbOutput, previousSamples) == 32);
|
||||
|
||||
struct AcmBatchInfo {
|
||||
void* buffer;
|
||||
std::size_t offset;
|
||||
@@ -613,6 +655,13 @@ struct AudioOutPortState {
|
||||
std::uint64_t activeState;
|
||||
};
|
||||
|
||||
struct AudioOutSystemState {
|
||||
float loudness;
|
||||
std::uint8_t reserved8[4];
|
||||
std::uint64_t reserved[3];
|
||||
};
|
||||
static_assert(sizeof(AudioOutSystemState) == 32);
|
||||
|
||||
struct Audio3dOpenParameters {
|
||||
std::uint64_t size_this;
|
||||
std::uint32_t granularity;
|
||||
@@ -933,13 +982,60 @@ struct AudiodecM4aacInfo {
|
||||
std::int32_t i_result;
|
||||
};
|
||||
|
||||
struct VoiceEvent {
|
||||
std::int32_t type;
|
||||
std::uint32_t reserved;
|
||||
void* userData;
|
||||
union {
|
||||
struct {
|
||||
std::uint16_t count;
|
||||
std::uint16_t ports[7];
|
||||
} dataReady;
|
||||
struct {
|
||||
std::uint16_t port;
|
||||
std::uint8_t state;
|
||||
std::uint8_t reserved[13];
|
||||
} deviceState;
|
||||
};
|
||||
};
|
||||
|
||||
using VoiceEventHandler = void (APS5_VABI*)(const VoiceEvent* event);
|
||||
|
||||
struct VoiceThreadsParams {
|
||||
std::uint32_t mode;
|
||||
std::int32_t firstPriority;
|
||||
std::uint64_t firstAffinity;
|
||||
std::int32_t secondPriority;
|
||||
std::uint32_t reserved20;
|
||||
std::uint64_t secondAffinity;
|
||||
std::int32_t thirdPriority;
|
||||
std::uint32_t reserved36;
|
||||
std::uint64_t thirdAffinity;
|
||||
};
|
||||
|
||||
static_assert(sizeof(VoiceEvent) == 32);
|
||||
static_assert(offsetof(VoiceEvent, userData) == 8);
|
||||
static_assert(offsetof(VoiceEvent, dataReady) == 16);
|
||||
static_assert(offsetof(VoiceEvent, deviceState) == 16);
|
||||
static_assert(sizeof(VoiceThreadsParams) == 48);
|
||||
static_assert(offsetof(VoiceThreadsParams, firstAffinity) == 8);
|
||||
static_assert(offsetof(VoiceThreadsParams, secondPriority) == 16);
|
||||
static_assert(offsetof(VoiceThreadsParams, secondAffinity) == 24);
|
||||
static_assert(offsetof(VoiceThreadsParams, thirdPriority) == 32);
|
||||
static_assert(offsetof(VoiceThreadsParams, thirdAffinity) == 40);
|
||||
|
||||
struct VoiceInitParam {
|
||||
std::int32_t app_type;
|
||||
std::uint64_t on_event;
|
||||
VoiceEventHandler on_event;
|
||||
void* user_data;
|
||||
std::uint8_t reserved[32 - sizeof(std::int32_t) - sizeof(std::uint64_t) - sizeof(void*)];
|
||||
std::uint8_t reserved[16];
|
||||
};
|
||||
|
||||
static_assert(sizeof(VoiceInitParam) == 40);
|
||||
static_assert(offsetof(VoiceInitParam, on_event) == 8);
|
||||
static_assert(offsetof(VoiceInitParam, user_data) == 16);
|
||||
static_assert(offsetof(VoiceInitParam, reserved) == 24);
|
||||
|
||||
struct VoicePortParam {
|
||||
std::int32_t port_type;
|
||||
std::uint16_t threshold;
|
||||
@@ -962,14 +1058,30 @@ struct VoicePortInfo {
|
||||
std::uint16_t reserved;
|
||||
};
|
||||
|
||||
struct VoiceResourceInfo {
|
||||
std::uint16_t max_voice_input_ports;
|
||||
std::uint16_t max_voice_output_ports;
|
||||
std::uint16_t max_device_input_ports;
|
||||
std::uint16_t max_device_output_ports;
|
||||
std::uint16_t max_ports;
|
||||
struct NpAuthClientId;
|
||||
|
||||
struct NpAuthAuthorizedAppCodeParameter {
|
||||
std::uint64_t size;
|
||||
std::int32_t userId;
|
||||
const NpAuthClientId* clientId;
|
||||
const char* scope;
|
||||
std::uint32_t option;
|
||||
};
|
||||
|
||||
static_assert(sizeof(NpAuthAuthorizedAppCodeParameter) == 40);
|
||||
static_assert(offsetof(NpAuthAuthorizedAppCodeParameter, clientId) == 16);
|
||||
static_assert(offsetof(NpAuthAuthorizedAppCodeParameter, scope) == 24);
|
||||
static_assert(offsetof(NpAuthAuthorizedAppCodeParameter, option) == 32);
|
||||
|
||||
struct VoiceResourceInfo {
|
||||
std::uint16_t maxVoiceInputPorts;
|
||||
std::uint16_t maxVoiceOutputPorts;
|
||||
std::uint16_t maxDeviceInputPorts;
|
||||
std::uint16_t maxDeviceOutputPorts;
|
||||
};
|
||||
|
||||
static_assert(sizeof(VoiceResourceInfo) == 8);
|
||||
|
||||
struct VoiceStartParam {
|
||||
void* container;
|
||||
std::uint32_t mem_size;
|
||||
@@ -1155,8 +1267,8 @@ struct ImeKeycode {
|
||||
std::uint64_t timestamp;
|
||||
};
|
||||
|
||||
using ImeTextFilter = std::int32_t (APS5_VABI *)(char16_t* out_text, std::uint32_t* out_text_length, const char16_t* source_text, std::uint32_t source_text_length);
|
||||
using ImeExtKeyboardFilter = int (APS5_VABI *)(const ImeKeycode* source_keycode, std::uint16_t* out_keycode, std::uint32_t* out_status, void* reserved);
|
||||
using ImeTextFilter = std::int32_t (APS5_VABI*)(char16_t* outText, std::uint32_t* outTextLength, const char16_t* sourceText, std::uint32_t sourceTextLength);
|
||||
using ImeExtKeyboardFilter = int (APS5_VABI*)(const ImeKeycode* sourceKeycode, std::uint16_t* outKeycode, std::uint32_t* outStatus, void* reserved);
|
||||
|
||||
struct ImeExtendedParam {
|
||||
std::uint32_t option;
|
||||
@@ -1318,7 +1430,12 @@ struct NetEpollEvent {
|
||||
NetEpollData data;
|
||||
};
|
||||
|
||||
struct NetCtlNatInfo { std::uint8_t opaque[128]; };
|
||||
struct NetCtlNatInfo {
|
||||
std::uint32_t size;
|
||||
std::uint8_t opaque[12];
|
||||
};
|
||||
|
||||
static_assert(sizeof(NetCtlNatInfo) == 16);
|
||||
|
||||
union NetCtlInfo { std::uint8_t opaque[256]; };
|
||||
|
||||
@@ -1333,10 +1450,10 @@ using NetCtlCallback = void (APS5_VABI *)(int, void*);
|
||||
|
||||
struct HttpEpoll;
|
||||
using HttpEpollHandle = HttpEpoll*;
|
||||
using HttpsCallback = int (*)(int, unsigned int, void* const*, int, void*);
|
||||
using HttpRedirectCallback = int (*)(int, std::int32_t, std::int32_t*, const char*, void*);
|
||||
using HttpCookieRecvCallback = int (*)(int, const char*, const char*, std::uint64_t, void*);
|
||||
using HttpAuthInfoCallback = int (*)(int, int, const char*, char*, char*, int, std::uint8_t**, std::uint64_t*, int*, void*);
|
||||
using HttpsCallback = int (APS5_VABI*)(int, unsigned int, void* const*, int, void*);
|
||||
using HttpRedirectCallback = int (APS5_VABI*)(int, std::int32_t, std::int32_t*, const char*, void*);
|
||||
using HttpCookieRecvCallback = int (APS5_VABI*)(int, const char*, const char*, std::uint64_t, void*);
|
||||
using HttpAuthInfoCallback = int (APS5_VABI*)(int, int, const char*, char*, char*, int, std::uint8_t**, std::uint64_t*, int*, void*);
|
||||
|
||||
struct HttpNBEvent { std::uint8_t opaque[64]; };
|
||||
|
||||
@@ -1395,6 +1512,24 @@ struct NpUnifiedEntitlementLabel {
|
||||
char padding[3];
|
||||
};
|
||||
|
||||
struct NpServiceEntitlementLabel {
|
||||
char data[7];
|
||||
std::uint8_t reserved[13];
|
||||
};
|
||||
|
||||
struct NpEntitlementAccessTransactionId {
|
||||
char data[65];
|
||||
std::uint8_t reserved[7];
|
||||
};
|
||||
|
||||
struct NpEntitlementAccessListParameter;
|
||||
struct NpEntitlementAccessUnifiedInfo;
|
||||
struct NpEntitlementAccessServiceInfo;
|
||||
|
||||
static_assert(sizeof(NpUnifiedEntitlementLabel) == 20);
|
||||
static_assert(sizeof(NpServiceEntitlementLabel) == 20);
|
||||
static_assert(sizeof(NpEntitlementAccessTransactionId) == 72);
|
||||
|
||||
struct NpEntitlementAccessInitParam { char reserved[32]; };
|
||||
struct NpEntitlementAccessBootParam { char reserved[32]; };
|
||||
|
||||
@@ -1460,6 +1595,26 @@ struct NpWebApi2ResponseInformationOption {
|
||||
std::size_t response_data_size;
|
||||
};
|
||||
|
||||
struct NpWebApi2IntInitializeArgs {
|
||||
std::int32_t lib_http_ctx_id;
|
||||
std::int32_t reserved;
|
||||
std::uint64_t pool_size;
|
||||
const char* name;
|
||||
std::uint64_t struct_size;
|
||||
};
|
||||
static_assert(sizeof(NpWebApi2IntInitializeArgs) == 32);
|
||||
|
||||
struct NpWebApi2IntInitialize2Args {
|
||||
std::int32_t lib_http_ctx_id;
|
||||
std::int32_t reserved;
|
||||
std::uint64_t pool_size;
|
||||
const char* name;
|
||||
std::uint32_t push_config_group;
|
||||
std::int32_t reserved2;
|
||||
std::uint64_t struct_size;
|
||||
};
|
||||
static_assert(sizeof(NpWebApi2IntInitialize2Args) == 40);
|
||||
|
||||
struct GameUpdateCheckParam {
|
||||
std::size_t size;
|
||||
std::uint32_t option;
|
||||
@@ -1670,6 +1825,34 @@ struct AppContentBootParam {
|
||||
|
||||
struct AppContentMountPoint { char data[16]; };
|
||||
|
||||
using ContentExportMallocCallback = void* (APS5_VABI *)(std::size_t size, void* userData);
|
||||
using ContentExportFreeCallback = void (APS5_VABI *)(void* memory, void* userData);
|
||||
using ContentExportDataCallback = std::int32_t (APS5_VABI *)(const void** data, std::size_t* size, void* userData);
|
||||
|
||||
struct ContentExportInitParam {
|
||||
ContentExportMallocCallback mallocFunc;
|
||||
ContentExportFreeCallback freeFunc;
|
||||
void* userData;
|
||||
};
|
||||
|
||||
static_assert(sizeof(ContentExportInitParam) == 24);
|
||||
static_assert(offsetof(ContentExportInitParam, freeFunc) == 8);
|
||||
static_assert(offsetof(ContentExportInitParam, userData) == 16);
|
||||
|
||||
struct ContentExportSfParam {
|
||||
std::size_t size;
|
||||
const char* metadata;
|
||||
const std::int64_t* contentIds;
|
||||
std::uint32_t contentCount;
|
||||
std::uint32_t option;
|
||||
};
|
||||
|
||||
static_assert(sizeof(ContentExportSfParam) == 32);
|
||||
static_assert(offsetof(ContentExportSfParam, metadata) == 8);
|
||||
static_assert(offsetof(ContentExportSfParam, contentIds) == 16);
|
||||
static_assert(offsetof(ContentExportSfParam, contentCount) == 24);
|
||||
static_assert(offsetof(ContentExportSfParam, option) == 28);
|
||||
|
||||
struct ContentExportInitParam2 {
|
||||
void* malloc_func;
|
||||
void* free_func;
|
||||
@@ -1877,11 +2060,22 @@ union PlayGoOptionalChunk {
|
||||
};
|
||||
|
||||
struct PlayGoDialogResult {
|
||||
std::int32_t errorCode;
|
||||
std::int32_t result;
|
||||
std::int32_t reserved[9];
|
||||
std::uint8_t reserved[32];
|
||||
};
|
||||
|
||||
using RudpEventHandler = void (*)(int ctx_id, int event_id, int error_code, void* arg);
|
||||
struct RudpPollEvent {
|
||||
std::int32_t contextId;
|
||||
std::uint16_t events;
|
||||
std::uint16_t returnedEvents;
|
||||
};
|
||||
|
||||
static_assert(sizeof(RudpPollEvent) == 8);
|
||||
static_assert(offsetof(RudpPollEvent, events) == 4);
|
||||
static_assert(offsetof(RudpPollEvent, returnedEvents) == 6);
|
||||
|
||||
using RudpEventHandler = void (APS5_VABI*)(int ctxId, int eventId, int errorCode, void* arg);
|
||||
|
||||
struct SystemServiceStatus {
|
||||
std::int32_t event_num = 0;
|
||||
@@ -1901,6 +2095,15 @@ struct SystemServiceDisplaySafeAreaInfo {
|
||||
std::uint8_t reserved[128];
|
||||
};
|
||||
|
||||
struct SystemServicePlayerDialogParam {
|
||||
std::uint64_t size;
|
||||
std::int32_t mode;
|
||||
std::int32_t user_id;
|
||||
std::uint64_t target_account_id;
|
||||
std::uint8_t reserved[40];
|
||||
};
|
||||
static_assert(sizeof(SystemServicePlayerDialogParam) == 0x40);
|
||||
|
||||
struct SystemServiceHdrToneMapLuminance {
|
||||
float max_full_frame_tone_map_luminance;
|
||||
float max_tone_map_luminance;
|
||||
@@ -1969,12 +2172,16 @@ struct UserServiceGamePresets {
|
||||
std::uint32_t audio_language;
|
||||
};
|
||||
|
||||
struct UltMutexOptParam {
|
||||
std::uint32_t reserved_header[2];
|
||||
struct alignas(8) UltMutexOptParam {
|
||||
std::uint32_t header[3];
|
||||
std::uint32_t buildVersion;
|
||||
std::uint32_t attribute;
|
||||
std::uint32_t reserved0;
|
||||
std::uint32_t reserved[27];
|
||||
};
|
||||
|
||||
static_assert(sizeof(UltMutexOptParam) == 128);
|
||||
static_assert(offsetof(UltMutexOptParam, attribute) == 16);
|
||||
|
||||
struct UltUlthreadRuntimeOptParam { std::uint8_t bytes[128]; };
|
||||
|
||||
using UltUlthreadEntry = std::int32_t (APS5_VABI *)(std::uint64_t);
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <cctype>
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
#include <iterator>
|
||||
#include <stdexcept>
|
||||
@@ -78,16 +79,16 @@ void MoveImportFirst(std::vector<unsigned char>& bytes, const std::string& dll)
|
||||
for (std::size_t index = 0; index < descriptors.size(); ++index) std::memcpy(bytes.data() + directory + index * DescriptorBytes, descriptors[index].data(), DescriptorBytes);
|
||||
}
|
||||
|
||||
void MoveImportFirstInFile(const std::string& path, const std::string& dll) {
|
||||
void MoveImportFirstInFile(const std::filesystem::path& path, const std::string& dll) {
|
||||
std::vector<unsigned char> bytes;
|
||||
{
|
||||
std::ifstream input(path, std::ios::binary);
|
||||
if (!input) throw std::runtime_error("cannot open " + path);
|
||||
if (!input) throw std::runtime_error("cannot open " + path.string());
|
||||
bytes.assign(std::istreambuf_iterator<char>(input), std::istreambuf_iterator<char>());
|
||||
}
|
||||
MoveImportFirst(bytes, dll);
|
||||
std::ofstream output(path, std::ios::binary | std::ios::trunc);
|
||||
if (!output || !output.write(reinterpret_cast<const char*>(bytes.data()), static_cast<std::streamsize>(bytes.size()))) throw std::runtime_error("cannot write " + path);
|
||||
if (!output || !output.write(reinterpret_cast<const char*>(bytes.data()), static_cast<std::streamsize>(bytes.size()))) throw std::runtime_error("cannot write " + path.string());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,13 +1,14 @@
|
||||
#ifndef CORE_LIBS_ALLOCATOR_PEIMPORTFIRST_HPP
|
||||
#define CORE_LIBS_ALLOCATOR_PEIMPORTFIRST_HPP
|
||||
|
||||
#include <filesystem>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace Allocator {
|
||||
|
||||
void MoveImportFirst(std::vector<unsigned char>& image, const std::string& dll);
|
||||
void MoveImportFirstInFile(const std::string& path, const std::string& dll);
|
||||
void MoveImportFirstInFile(const std::filesystem::path& path, const std::string& dll);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -2,17 +2,37 @@
|
||||
|
||||
#include <cstdio>
|
||||
#include <exception>
|
||||
#include <filesystem>
|
||||
#include <string>
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
if (argc != 3) {
|
||||
std::fprintf(stderr, "usage: pe_import_first <file> <dll>\n");
|
||||
return 2;
|
||||
}
|
||||
namespace {
|
||||
|
||||
int Usage() {
|
||||
std::fprintf(stderr, "usage: pe_import_first <file> <dll>\n");
|
||||
return 2;
|
||||
}
|
||||
|
||||
int Run(const std::filesystem::path& file, const std::string& dll) {
|
||||
try {
|
||||
Allocator::MoveImportFirstInFile(argv[1], argv[2]);
|
||||
Allocator::MoveImportFirstInFile(file, dll);
|
||||
} catch (const std::exception& error) {
|
||||
std::fprintf(stderr, "pe_import_first: %s: %s\n", argv[1], error.what());
|
||||
std::fprintf(stderr, "pe_import_first: %s: %s\n", file.string().c_str(), error.what());
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
int wmain(int argc, wchar_t** argv) {
|
||||
if (argc != 3) return Usage();
|
||||
const auto dll = std::filesystem::path(argv[2]).u8string();
|
||||
return Run(argv[1], std::string(dll.begin(), dll.end()));
|
||||
}
|
||||
#else
|
||||
int main(int argc, char** argv) {
|
||||
if (argc != 3) return Usage();
|
||||
return Run(argv[1], argv[2]);
|
||||
}
|
||||
#endif
|
||||
@@ -113,7 +113,7 @@ void movesTheNamedImportFirst() {
|
||||
void movesTheImportInAFile(const std::filesystem::path& directory) {
|
||||
const auto path = directory / "moved.dll";
|
||||
writeFile(path, image({"kernel32.dll", "mimalloc-redirect.dll"}));
|
||||
Allocator::MoveImportFirstInFile(path.string(), "mimalloc-redirect.dll");
|
||||
Allocator::MoveImportFirstInFile(path, "mimalloc-redirect.dll");
|
||||
const auto moved = readFile(path);
|
||||
require(importName(moved, 0) == "mimalloc-redirect.dll" && importName(moved, 1) == "kernel32.dll", "the file's import did not move first");
|
||||
}
|
||||
@@ -122,7 +122,7 @@ void failsWithoutTouchingTheFile(const std::filesystem::path& directory, const s
|
||||
const auto path = directory / (what + ".dll");
|
||||
writeFile(path, bytes);
|
||||
try {
|
||||
Allocator::MoveImportFirstInFile(path.string(), "mimalloc-redirect.dll");
|
||||
Allocator::MoveImportFirstInFile(path, "mimalloc-redirect.dll");
|
||||
} catch (const std::exception& error) {
|
||||
require(std::string(error.what()).find(expected) != std::string::npos, what + ": failed with another error: " + error.what());
|
||||
require(readFile(path) == bytes, what + ": the file changed although the move failed");
|
||||
@@ -134,7 +134,8 @@ void failsWithoutTouchingTheFile(const std::filesystem::path& directory, const s
|
||||
}
|
||||
|
||||
int main() {
|
||||
const auto directory = std::filesystem::temp_directory_path() / ("aps5-pe-import-first-" + std::to_string(std::random_device{}()));
|
||||
auto directory = std::filesystem::temp_directory_path() / std::filesystem::path(u8"aps5-pe-import-first-a\u00e7\u00e3o-\u65e5\u672c-");
|
||||
directory += std::to_string(std::random_device{}());
|
||||
try {
|
||||
std::filesystem::create_directories(directory);
|
||||
movesTheNamedImportFirst();
|
||||
|
||||
@@ -175,7 +175,7 @@ std::unordered_set<std::string> ReadExportExclusions(const std::string& path) {
|
||||
}
|
||||
|
||||
std::unordered_set<std::string> ReadExportList(const std::string& path) {
|
||||
std::ifstream input(path, std::ios::binary);
|
||||
std::ifstream input(Internal::NativePath(path), std::ios::binary);
|
||||
if (!input) throw std::runtime_error("cannot open export list: " + path);
|
||||
const auto text = ReadText(path, input);
|
||||
if (text.empty() || text.back() != '\n') throw std::runtime_error("malformed export list: " + path);
|
||||
@@ -192,8 +192,8 @@ std::unordered_set<std::string> ReadExportList(const std::string& path) {
|
||||
|
||||
bool WriteExportList(const std::string& referencePath, const std::string& path) {
|
||||
const auto text = FormatExportList(ReadExportExclusions(referencePath));
|
||||
if (std::ifstream existing(path, std::ios::binary); existing && ReadText(path, existing) == text) return false;
|
||||
std::ofstream output(path, std::ios::binary | std::ios::trunc);
|
||||
if (std::ifstream existing(Internal::NativePath(path), std::ios::binary); existing && ReadText(path, existing) == text) return false;
|
||||
std::ofstream output(Internal::NativePath(path), std::ios::binary | std::ios::trunc);
|
||||
if (!output) throw std::runtime_error("cannot write export list: " + path);
|
||||
output.write(text.data(), static_cast<std::streamsize>(text.size()));
|
||||
output.close();
|
||||
|
||||
@@ -271,7 +271,7 @@ def check_refusals(patcher, directory):
|
||||
|
||||
def main():
|
||||
patcher = Path(sys.argv[1]).resolve()
|
||||
with tempfile.TemporaryDirectory(prefix="anyps5-macho-nid-") as directory:
|
||||
with tempfile.TemporaryDirectory(prefix="anyps5-macho-nid-a\u00e7\u00e3o-\u65e5\u672c-") as directory:
|
||||
check_shrinking(patcher, directory)
|
||||
check_growing(patcher, directory)
|
||||
check_preserved(patcher, directory)
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
#pragma once
|
||||
@@ -0,0 +1 @@
|
||||
#pragma once
|
||||
@@ -0,0 +1 @@
|
||||
#pragma once
|
||||
@@ -0,0 +1 @@
|
||||
#pragma once
|
||||
@@ -0,0 +1 @@
|
||||
#pragma once
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "prx/libSceAc3Enc/include/Api.hpp"
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include "SceTypes.hpp"
|
||||
@@ -5,6 +6,39 @@
|
||||
|
||||
extern "C" {
|
||||
|
||||
APS5_DUMMY_FUN
|
||||
int APS5_VABI sceAc3EncCreateEncoder() {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAc3EncDeleteEncoder() {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAc3EncEncode() {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAc3EncEncodeAsync() {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAc3EncFlush() {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAc3EncIsEncoding() {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAc3EncWaitEncode() {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
#include "SceTypes.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
int APS5_VABI sceAc3EncCreateEncoder();
|
||||
int APS5_VABI sceAc3EncDeleteEncoder();
|
||||
int APS5_VABI sceAc3EncEncode();
|
||||
int APS5_VABI sceAc3EncEncodeAsync();
|
||||
int APS5_VABI sceAc3EncFlush();
|
||||
int APS5_VABI sceAc3EncIsEncoding();
|
||||
int APS5_VABI sceAc3EncWaitEncode();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
#pragma once
|
||||
|
||||
#include "prx/libSceAc3Enc/include/Api.hpp"
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "prx/libSceAcm/include/Api.hpp"
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include <cstring>
|
||||
@@ -79,19 +80,130 @@ int APS5_VABI sceAcmContextDestroy(AcmContextId context) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAcm_ConvReverb_SharedInput(void) {
|
||||
int APS5_VABI sceAcm_ConvReverb_SharedInput(AcmBatchInfo* batch, std::uint32_t mode, AcmReverbInput* input, std::uint32_t outputCount, const AcmReverbFilter* const* filters, const float* gains, const AcmReverbOutput* const* outputs) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAcm_FFT(void) {
|
||||
int APS5_VABI sceAcm_FFT(AcmBatchInfo* batch, std::int32_t transformSize, std::uint32_t transformCount, std::int32_t inputFormat, const void* const* inputs, std::int32_t outputFormat, void* const* outputs, std::int32_t flags) {
|
||||
if (!batch || transformCount == 0 || transformCount > 0x7FFFFFFF || !inputs || !outputs || (flags & 3) == 3 || inputFormat < 0 || inputFormat > 1 || outputFormat < 0 || outputFormat > 1) return SCE_ACM_ERROR_BAD_POINTER;
|
||||
if (transformSize != 512 && transformSize != 1024 && transformSize != 2048) return SCE_ACM_ERROR_BAD_POINTER;
|
||||
const bool realInput = (flags & 1) != 0;
|
||||
if (transformSize == 2048 && !realInput) return SCE_ACM_ERROR_BAD_POINTER;
|
||||
const std::uint32_t inputBytes = transformSize * (inputFormat == 1 ? 2 : 4);
|
||||
const std::uint32_t outputBytes = transformSize * (outputFormat == 1 ? 2 : 4);
|
||||
const std::uint32_t inputBlocks = (inputBytes >> 9) >> (realInput ? 1 : 0);
|
||||
const std::uint32_t outputBlocks = outputBytes >> 9;
|
||||
std::uint32_t transformCommand;
|
||||
std::uint32_t inputCommand;
|
||||
std::uint32_t outputCommand;
|
||||
std::uint32_t setupCommand;
|
||||
std::uint32_t sizeCode;
|
||||
if (transformSize == 512) {
|
||||
sizeCode = 4;
|
||||
transformCommand = realInput ? 7 : 11;
|
||||
inputCommand = realInput ? 2 * inputFormat : 9 + inputFormat;
|
||||
outputCommand = 4 | outputFormat;
|
||||
setupCommand = realInput ? 6 : 12;
|
||||
} else if (transformSize == 1024) {
|
||||
sizeCode = 5;
|
||||
transformCommand = realInput ? 8 : 13;
|
||||
inputCommand = realInput ? 2 * inputFormat : 14 | inputFormat;
|
||||
outputCommand = 5 | (2 * outputFormat);
|
||||
setupCommand = realInput ? 10 : 12;
|
||||
} else {
|
||||
sizeCode = 6;
|
||||
transformCommand = 6;
|
||||
inputCommand = 2 * inputFormat;
|
||||
outputCommand = 4 | outputFormat;
|
||||
setupCommand = 8;
|
||||
}
|
||||
auto* buffer = static_cast<std::byte*>(batch->buffer);
|
||||
auto offset = batch->offset;
|
||||
const auto capacity = batch->buffer_size;
|
||||
const auto appendWord = [&](std::uint64_t value) {
|
||||
if (offset > capacity || capacity - offset < sizeof(value)) return false;
|
||||
std::memcpy(buffer + offset, &value, sizeof(value));
|
||||
offset += sizeof(value);
|
||||
return true;
|
||||
};
|
||||
std::uint64_t header = static_cast<std::uint64_t>(sizeCode) << 8;
|
||||
if (!(flags & 8)) {
|
||||
const auto encodedCount = transformCount < 64000 ? transformCount : 64000;
|
||||
header |= (std::uint64_t{1} << 16) | (static_cast<std::uint64_t>(transformSize) << 8) | (static_cast<std::uint64_t>(flags & 6) << 19) | (static_cast<std::uint64_t>(flags & 1) << 23) | (std::uint64_t{1} << (inputFormat == 1 ? 24 : 26)) | (std::uint64_t{1} << (outputFormat == 1 ? 25 : 27)) | (static_cast<std::uint64_t>(encodedCount) << 28);
|
||||
}
|
||||
constexpr int noSpace = static_cast<int>(0x81940009);
|
||||
constexpr int badAlignment = static_cast<int>(0x8194000A);
|
||||
if (!appendWord(header) || !appendWord(10 | (setupCommand << 8))) return noSpace;
|
||||
for (std::uint32_t index = 0; index < transformCount; ++index) {
|
||||
const auto inputIndex = static_cast<std::size_t>(index) * ((flags & 2) ? 2 : 1);
|
||||
const auto input = reinterpret_cast<std::uintptr_t>(inputs[inputIndex]);
|
||||
const auto secondInput = (flags & 2) ? reinterpret_cast<std::uintptr_t>(inputs[inputIndex + 1]) : 0;
|
||||
if (!(flags & 2) && !input) return SCE_ACM_ERROR_BAD_POINTER;
|
||||
if ((input | secondInput) & 127) return badAlignment;
|
||||
const auto inputRecordSize = (flags & 2) ? 24u : 16u;
|
||||
if (offset > capacity || capacity - offset < inputRecordSize) return noSpace;
|
||||
appendWord(((flags & 2) ? 7 : 6) | (static_cast<std::uint64_t>(inputBlocks) << 32) | ((flags & 2) ? static_cast<std::uint64_t>(inputBytes / 2) << 48 : 0));
|
||||
appendWord(input);
|
||||
if (flags & 2) appendWord(secondInput);
|
||||
if (!appendWord(10 | (inputCommand << 8)) || !appendWord(10 | (transformCommand << 8)) || !appendWord(10 | (outputCommand << 8))) return noSpace;
|
||||
const auto outputIndex = static_cast<std::size_t>(index) * ((flags & 4) ? 2 : 1);
|
||||
const auto output = reinterpret_cast<std::uintptr_t>(outputs[outputIndex]);
|
||||
const auto secondOutput = (flags & 4) ? reinterpret_cast<std::uintptr_t>(outputs[outputIndex + 1]) : 0;
|
||||
if ((output | secondOutput) & 127) return badAlignment;
|
||||
const auto outputRecordSize = (flags & 4) ? 24u : 16u;
|
||||
if (offset > capacity || capacity - offset < outputRecordSize) return noSpace;
|
||||
appendWord(((flags & 4) ? 9 : 8) | (static_cast<std::uint64_t>(outputBlocks) << 32) | ((flags & 4) ? static_cast<std::uint64_t>(outputBytes / 2) << 48 : 0));
|
||||
appendWord(output);
|
||||
if (flags & 4) appendWord(secondOutput);
|
||||
}
|
||||
batch->offset = offset;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAcm_Panner(void) {
|
||||
int APS5_VABI sceAcm_Panner(AcmBatchInfo* batch, std::uint32_t sourceCount, const void* const* sources, std::uint32_t sourceMode, std::uint32_t outputMode, std::uint32_t channelCount, const void* const* sourceParameters, const void* const* sourceMatrices, const void* const* inputChannels, void* const* outputChannels) {
|
||||
if (!batch || sourceCount == 0 || sourceCount > 65535 || sourceMode > 2 || outputMode > 1 || channelCount == 0 || channelCount > 36 || !sources || !sourceParameters || !sourceMatrices || !outputChannels) return SCE_ACM_ERROR_BAD_POINTER;
|
||||
std::uintptr_t alignment = reinterpret_cast<std::uintptr_t>(sources) | reinterpret_cast<std::uintptr_t>(sourceParameters) | reinterpret_cast<std::uintptr_t>(sourceMatrices) | reinterpret_cast<std::uintptr_t>(inputChannels) | reinterpret_cast<std::uintptr_t>(outputChannels);
|
||||
for (std::uint32_t index = 0; index < sourceCount; ++index) {
|
||||
if (!sources[index] || !sourceParameters[index] || !sourceMatrices[index]) return SCE_ACM_ERROR_BAD_POINTER;
|
||||
std::uint32_t parameterMode;
|
||||
std::memcpy(¶meterMode, sourceParameters[index], sizeof(parameterMode));
|
||||
if (parameterMode > 1) return SCE_ACM_ERROR_BAD_POINTER;
|
||||
alignment |= reinterpret_cast<std::uintptr_t>(sources[index]) | reinterpret_cast<std::uintptr_t>(sourceParameters[index]) | reinterpret_cast<std::uintptr_t>(sourceMatrices[index]);
|
||||
}
|
||||
for (std::uint32_t index = 0; index < channelCount; ++index) {
|
||||
if (!outputChannels[index]) return SCE_ACM_ERROR_BAD_POINTER;
|
||||
alignment |= reinterpret_cast<std::uintptr_t>(outputChannels[index]);
|
||||
if (inputChannels) alignment |= reinterpret_cast<std::uintptr_t>(inputChannels[index]);
|
||||
}
|
||||
if (alignment & 127) return static_cast<int>(0x8194000A);
|
||||
const auto offset = batch->offset;
|
||||
const auto capacity = batch->buffer_size;
|
||||
if (offset > capacity || capacity - offset < 8) return static_cast<int>(0x81940009);
|
||||
auto* buffer = static_cast<std::byte*>(batch->buffer);
|
||||
const auto writeWord = [buffer](std::size_t position, std::uint64_t value) { std::memcpy(buffer + position, &value, sizeof(value)); };
|
||||
const auto encodedCount = sourceCount < 255 ? sourceCount : 255;
|
||||
writeWord(offset, (static_cast<std::uint64_t>(channelCount) << 24) | (static_cast<std::uint64_t>(encodedCount) << 16) | (std::uint64_t{1} << (sourceMode + 32)) | (std::uint64_t{1} << (outputMode + 35)) | 0x300);
|
||||
if (capacity < 128 || capacity - offset < 152) return static_cast<int>(0x81940009);
|
||||
const auto descriptorOffset = capacity - 128;
|
||||
std::memset(buffer + descriptorOffset, 0, 128);
|
||||
writeWord(descriptorOffset, sourceCount);
|
||||
writeWord(descriptorOffset + 8, reinterpret_cast<std::uintptr_t>(inputChannels));
|
||||
writeWord(descriptorOffset + 16, reinterpret_cast<std::uintptr_t>(outputChannels));
|
||||
writeWord(descriptorOffset + 24, reinterpret_cast<std::uintptr_t>(sources));
|
||||
writeWord(descriptorOffset + 32, sourceMode | (static_cast<std::uint64_t>(outputMode) << 32));
|
||||
writeWord(descriptorOffset + 40, channelCount);
|
||||
writeWord(descriptorOffset + 48, reinterpret_cast<std::uintptr_t>(sourceParameters));
|
||||
writeWord(descriptorOffset + 56, reinterpret_cast<std::uintptr_t>(sourceMatrices));
|
||||
writeWord(offset + 8, 0x8000000000000D);
|
||||
writeWord(offset + 16, reinterpret_cast<std::uintptr_t>(buffer + descriptorOffset));
|
||||
if (capacity - offset < 160) return static_cast<int>(0x81940009);
|
||||
writeWord(offset + 24, 10);
|
||||
batch->offset = offset + 32;
|
||||
batch->buffer_size = descriptorOffset;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAcmBatchJobPriority(void) {
|
||||
int APS5_VABI sceAcmBatchJobPriority(AcmBatchInfo* batch, std::uint32_t priority) {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
@@ -106,4 +218,9 @@ int APS5_VABI sceAcm_IFFT() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAcmBatchJobNotification() {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
|
||||
#include "SceTypes.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
int APS5_VABI sceAcmBatchStartBuffer(AcmContextId context, const void* batchCommands, size_t batchSize, AcmBatchError* batchError, AcmBatchId* batch);
|
||||
int APS5_VABI sceAcmBatchStartBuffers(AcmContextId context, uint32_t batchInfoCount, const AcmBatchInfo* const batch_info[], AcmBatchError* batchError, AcmBatchId* batch);
|
||||
int APS5_VABI sceAcmBatchWait(AcmContextId context, AcmBatchId batch, uint32_t timeout);
|
||||
int APS5_VABI sceAcmContextCreate(AcmContextId* context);
|
||||
int APS5_VABI sceAcmContextDestroy(AcmContextId context);
|
||||
int APS5_VABI sceAcm_ConvReverb_SharedInput(AcmBatchInfo* batch, std::uint32_t mode, AcmReverbInput* input, std::uint32_t outputCount, const AcmReverbFilter* const* filters, const float* gains, const AcmReverbOutput* const* outputs);
|
||||
int APS5_VABI sceAcm_FFT(AcmBatchInfo* batch, std::int32_t transformSize, std::uint32_t transformCount, std::int32_t inputFormat, const void* const* inputs, std::int32_t outputFormat, void* const* outputs, std::int32_t flags);
|
||||
int APS5_VABI sceAcm_Panner(AcmBatchInfo* batch, std::uint32_t sourceCount, const void* const* sources, std::uint32_t sourceMode, std::uint32_t outputMode, std::uint32_t channelCount, const void* const* sourceParameters, const void* const* sourceMatrices, const void* const* inputChannels, void* const* outputChannels);
|
||||
int APS5_VABI sceAcmBatchJobPriority(AcmBatchInfo* batch, std::uint32_t priority);
|
||||
int APS5_VABI sceAcm_ConvReverb_SharedIr();
|
||||
int APS5_VABI sceAcm_IFFT();
|
||||
int APS5_VABI sceAcmBatchJobNotification();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
#pragma once
|
||||
|
||||
#include "prx/libSceAcm/include/Api.hpp"
|
||||
@@ -1,4 +1,26 @@
|
||||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_ACB_INCLUDE_CONTROL_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_ACB_INCLUDE_CONTROL_HPP
|
||||
|
||||
#include "SceTypes.hpp"
|
||||
#include "SceShaders.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcAcbAtomicGds_0900(CommandBuffer* buf, std::uint32_t control, std::uint32_t mode, std::uint32_t gdsOp, std::uint32_t src, std::uint16_t offset, std::uint16_t index, std::uint32_t mask, std::uint32_t data, std::uint64_t compareData, std::uint64_t extraData);
|
||||
std::uint32_t* APS5_VABI sceAgcAcbJump(CommandBuffer* buf, std::uint8_t cachePolicy, const std::uint32_t* target, std::uint32_t sizeInDwords);
|
||||
uint32_t APS5_VABI sceAgcAcbJumpGetSize(void);
|
||||
uint32_t* APS5_VABI sceAgcAcbResetQueue(CommandBuffer* buf, uint32_t op, uint32_t value);
|
||||
std::uint32_t* APS5_VABI sceAgcAcbRewind(CommandBuffer* buf, std::uint32_t initialState);
|
||||
std::uint32_t APS5_VABI sceAgcAcbRewindGetSize();
|
||||
std::uint32_t* APS5_VABI sceAgcAcbWaitUntilSafeForRendering(CommandBuffer* buf, std::uint32_t videoOutHandle, std::uint32_t displayBufferIndex);
|
||||
std::uint32_t* APS5_VABI sceAgcAcbSetFlip(CommandBuffer* buf, std::uint32_t videoOutHandle, std::int32_t displayBufferIndex, std::uint32_t flipMode, std::int64_t flipArg);
|
||||
std::uint32_t* APS5_VABI sceAgcAcbSetWorkloadsActive(CommandBuffer* buf, std::uint32_t streamId, const std::uint32_t* workloadIds, std::uint32_t workloadCount);
|
||||
std::uint32_t* APS5_VABI sceAgcAcbSetWorkloadComplete(CommandBuffer* buf, std::uint32_t streamId, std::uint32_t workloadId);
|
||||
std::uint32_t* APS5_VABI sceAgcAcbSetWorkloadStreamInactive(CommandBuffer* buf, std::uint32_t streamId);
|
||||
uint32_t* APS5_VABI sceAgcAcbPushMarker(CommandBuffer* buf, const char* str, uint32_t color);
|
||||
uint32_t* APS5_VABI sceAgcAcbPopMarker(CommandBuffer* buf);
|
||||
uint32_t* APS5_VABI sceAgcAcbSetMarker(CommandBuffer* buf, const char* str, uint32_t color);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,4 +1,14 @@
|
||||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_ACB_INCLUDE_DISPATCH_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_ACB_INCLUDE_DISPATCH_HPP
|
||||
|
||||
#include "SceTypes.hpp"
|
||||
#include "SceShaders.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
uint32_t* APS5_VABI sceAgcAcbDispatchIndirect(CommandBuffer* buf, const volatile void* indirectArgs, uint32_t modifier);
|
||||
std::uint32_t APS5_VABI sceAgcAcbDispatchIndirectGetSize();
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,4 +1,24 @@
|
||||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_ACB_INCLUDE_MEMORY_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_ACB_INCLUDE_MEMORY_HPP
|
||||
|
||||
#include "SceTypes.hpp"
|
||||
#include "SceShaders.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcAcbAcquireMem(CommandBuffer* buf, std::uint32_t gcrControl, const volatile void* base, std::uint64_t sizeBytes, std::uint32_t pollCycles);
|
||||
uint32_t APS5_VABI sceAgcAcbAcquireMemGetSize(void);
|
||||
uint32_t* APS5_VABI sceAgcAcbCopyData(CommandBuffer* buf, uint8_t dst, uint8_t dstCachePolicy, uint64_t dstAddress, uint8_t src, uint8_t srcCachePolicy, uint64_t srcAddressOrImmediate, uint8_t itemSize, uint8_t writeConfirm);
|
||||
std::uint64_t APS5_VABI sceAgcAcbCopyDataGetSize();
|
||||
std::uint32_t* APS5_VABI sceAgcAcbDmaData(CommandBuffer* buf, std::uint8_t dst, std::uint8_t dstCachePolicy, std::uint64_t dstAddress, std::uint8_t src, std::uint8_t srcCachePolicy, std::uint64_t srcAddress, std::uint32_t numBytes, std::uint8_t waitForPrevious, std::uint8_t writeConfirm);
|
||||
std::uint32_t APS5_VABI sceAgcAcbDmaDataGetSize();
|
||||
std::uint32_t* APS5_VABI sceAgcAcbAtomicMem(CommandBuffer* buf, std::uint8_t atomicOp, std::uint8_t command, std::uint8_t cachePolicy, const volatile void* address, std::uint64_t srcData, std::uint64_t compareData, std::uint16_t loopInterval);
|
||||
std::uint32_t APS5_VABI sceAgcAcbAtomicMemGetSize();
|
||||
std::uint32_t APS5_VABI sceAgcAcbAtomicGdsGetSize();
|
||||
std::uint32_t* APS5_VABI sceAgcAcbPrimeUtcl2(CommandBuffer* buf, const volatile void* address, std::uint32_t sizeInBytes);
|
||||
std::uint32_t APS5_VABI sceAgcAcbPrimeUtcl2GetSize();
|
||||
std::uint32_t* APS5_VABI sceAgcAcbWriteData(CommandBuffer* buf, std::uint8_t dst, std::uint8_t cachePolicy, std::uint64_t address, const void* data, std::uint32_t numDwords, std::uint8_t increment, std::uint8_t writeConfirm);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,4 +1,20 @@
|
||||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_ACB_INCLUDE_SYNC_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_ACB_INCLUDE_SYNC_HPP
|
||||
|
||||
#include "SceTypes.hpp"
|
||||
#include "SceShaders.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
uint32_t* APS5_VABI sceAgcAcbCondExec(CommandBuffer* buf, const volatile uint32_t* address, uint32_t numDwords);
|
||||
uint32_t APS5_VABI sceAgcAcbCondExecGetSize(void);
|
||||
std::uint32_t* APS5_VABI sceAgcAcbWaitRegMem(CommandBuffer* buf, std::uint8_t size, std::uint8_t compareFunction, std::uint8_t cachePolicy, const volatile void* address, std::uint64_t reference, std::uint64_t mask, std::uint32_t pollCycles);
|
||||
std::uint64_t APS5_VABI sceAgcAcbWaitOnAddressGetSize(std::uint8_t size);
|
||||
std::uint32_t* APS5_VABI sceAgcAcbEventWrite(CommandBuffer* buf, std::uint8_t eventType, const volatile void* address);
|
||||
std::uint64_t APS5_VABI sceAgcAcbEventWriteGetSize(std::uint8_t eventType);
|
||||
std::uint32_t APS5_VABI sceAgcAcbQueueEndOfShaderActionGetSize();
|
||||
std::uint32_t* APS5_VABI sceAgcAcbMemSemaphore(CommandBuffer* buf, const volatile void* address, std::uint8_t waitForMailbox, std::uint8_t signalType, std::uint8_t operation);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -102,6 +102,18 @@ uint32_t* APS5_VABI sceAgcAcbPushMarker(CommandBuffer* buf, const char* str, uin
|
||||
return Agc::Marker::Push(buf, str, __func__);
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcAcbPushMarkerSpan(CommandBuffer* buf, const char* str, uint32_t length, uint32_t color) {
|
||||
(void)color;
|
||||
return Agc::Marker::PushSpan(buf, str, length, __func__);
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcAcbSetMarkerSpan(CommandBuffer* buf, const char* str, uint32_t length, uint32_t color) {
|
||||
(void)color;
|
||||
auto* packet = Agc::Marker::PushSpan(buf, str, length, __func__);
|
||||
Agc::Marker::Pop(buf, __func__);
|
||||
return packet;
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcAcbPopMarker(CommandBuffer* buf) {
|
||||
return Agc::Marker::Pop(buf, __func__);
|
||||
}
|
||||
|
||||
@@ -44,10 +44,7 @@ std::uint32_t APS5_VABI sceAgcAcbQueueEndOfShaderActionGetSize() {
|
||||
return 32;
|
||||
}
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcAcbMemSemaphore(CommandBuffer* buf, std::uint8_t action, std::uint8_t clientCode, const volatile void* address) {
|
||||
const std::uint8_t operation = action != 0 ? 7u : 6u;
|
||||
const std::uint8_t signalType = clientCode & 1u;
|
||||
const std::uint8_t waitForMailbox = (clientCode >> 1u) & 1u;
|
||||
std::uint32_t* APS5_VABI sceAgcAcbMemSemaphore(CommandBuffer* buf, const volatile void* address, std::uint8_t waitForMailbox, std::uint8_t signalType, std::uint8_t operation) {
|
||||
return Agc::Command::WriteMemSemaphore(buf, address, waitForMailbox, signalType, operation, __func__);
|
||||
}
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ add_library(libSceAgc SHARED EXCLUDE_FROM_ALL
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Misc/src/RegisterDefaults.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Misc/src/Semaphore.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Misc/src/ShaderFusion.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Misc/src/StaticBuffer.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Misc/src/Suspend.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Patch/src/CondExec.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Patch/src/Dma.cpp
|
||||
@@ -96,6 +97,19 @@ if(BUILD_TESTING)
|
||||
endif()
|
||||
configure_windows_unwind(libSceAgc)
|
||||
|
||||
add_test_executable(agc_static_buffer_tests EXCLUDE_FROM_ALL tests/StaticBuffer.cpp)
|
||||
target_include_directories(agc_static_buffer_tests PRIVATE ${LIBS_INCLUDE_DIR})
|
||||
target_link_libraries(agc_static_buffer_tests PRIVATE libSceAgc libSceAgcDriver libc)
|
||||
configure_windows_unwind(agc_static_buffer_tests)
|
||||
if(BUILD_TESTING)
|
||||
set_target_properties(agc_static_buffer_tests PROPERTIES EXCLUDE_FROM_ALL OFF)
|
||||
add_test(NAME agc_static_buffer COMMAND agc_static_buffer_tests)
|
||||
if(WIN32)
|
||||
set_tests_properties(agc_static_buffer PROPERTIES ENVIRONMENT_MODIFICATION
|
||||
"PATH=path_list_prepend:$<TARGET_FILE_DIR:libc>")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_test_executable(agc_platform_tests EXCLUDE_FROM_ALL tests/Platform.cpp)
|
||||
target_include_directories(agc_platform_tests PRIVATE ${LIBS_INCLUDE_DIR})
|
||||
target_link_libraries(agc_platform_tests PRIVATE libSceAgc libc)
|
||||
@@ -143,7 +157,7 @@ add_test_executable(agc_register_command_tests EXCLUDE_FROM_ALL
|
||||
Patch/src/IndirectRegisters.cpp
|
||||
)
|
||||
target_include_directories(agc_register_command_tests PRIVATE ${LIBS_INCLUDE_DIR})
|
||||
target_link_libraries(agc_register_command_tests PRIVATE libc)
|
||||
target_link_libraries(agc_register_command_tests PRIVATE libSceAgcDriver libc)
|
||||
configure_windows_unwind(agc_register_command_tests)
|
||||
if(BUILD_TESTING)
|
||||
set_target_properties(agc_register_command_tests PROPERTIES EXCLUDE_FROM_ALL FALSE)
|
||||
@@ -162,7 +176,7 @@ add_test_executable(agc_cb_cond_write_tests EXCLUDE_FROM_ALL
|
||||
Cb/src/Branch.cpp
|
||||
)
|
||||
target_include_directories(agc_cb_cond_write_tests PRIVATE ${LIBS_INCLUDE_DIR})
|
||||
target_link_libraries(agc_cb_cond_write_tests PRIVATE libc)
|
||||
target_link_libraries(agc_cb_cond_write_tests PRIVATE libSceAgcDriver libc)
|
||||
configure_windows_unwind(agc_cb_cond_write_tests)
|
||||
if(BUILD_TESTING)
|
||||
set_target_properties(agc_cb_cond_write_tests PROPERTIES EXCLUDE_FROM_ALL FALSE)
|
||||
@@ -206,7 +220,7 @@ add_test_executable(agc_branch_patch_tests EXCLUDE_FROM_ALL
|
||||
Patch/src/Branch.cpp
|
||||
)
|
||||
target_include_directories(agc_branch_patch_tests PRIVATE ${LIBS_INCLUDE_DIR})
|
||||
target_link_libraries(agc_branch_patch_tests PRIVATE libc)
|
||||
target_link_libraries(agc_branch_patch_tests PRIVATE libSceAgcDriver libc)
|
||||
configure_windows_unwind(agc_branch_patch_tests)
|
||||
if(BUILD_TESTING)
|
||||
set_target_properties(agc_branch_patch_tests PROPERTIES EXCLUDE_FROM_ALL FALSE)
|
||||
@@ -226,7 +240,7 @@ add_test_executable(agc_predication_tests EXCLUDE_FROM_ALL
|
||||
Predication/src/Predication.cpp
|
||||
)
|
||||
target_include_directories(agc_predication_tests PRIVATE ${LIBS_INCLUDE_DIR})
|
||||
target_link_libraries(agc_predication_tests PRIVATE libc)
|
||||
target_link_libraries(agc_predication_tests PRIVATE libSceAgcDriver libc)
|
||||
configure_windows_unwind(agc_predication_tests)
|
||||
if(BUILD_TESTING)
|
||||
set_target_properties(agc_predication_tests PROPERTIES EXCLUDE_FROM_ALL FALSE)
|
||||
@@ -253,6 +267,19 @@ if(BUILD_TESTING)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_test_executable(agc_instrumentation_query_size_tests EXCLUDE_FROM_ALL tests/InstrumentationQuerySize.cpp)
|
||||
target_include_directories(agc_instrumentation_query_size_tests PRIVATE ${LIBS_INCLUDE_DIR})
|
||||
target_link_libraries(agc_instrumentation_query_size_tests PRIVATE libSceAgc libc)
|
||||
configure_windows_unwind(agc_instrumentation_query_size_tests)
|
||||
if(BUILD_TESTING)
|
||||
set_target_properties(agc_instrumentation_query_size_tests PROPERTIES EXCLUDE_FROM_ALL FALSE)
|
||||
add_test(NAME agc_instrumentation_query_size_tests COMMAND agc_instrumentation_query_size_tests)
|
||||
if(WIN32)
|
||||
set_tests_properties(agc_instrumentation_query_size_tests PROPERTIES ENVIRONMENT_MODIFICATION
|
||||
"PATH=path_list_prepend:$<TARGET_FILE_DIR:libc>")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_test_executable(agc_context_state_size_tests EXCLUDE_FROM_ALL tests/ContextStateSize.cpp)
|
||||
target_include_directories(agc_context_state_size_tests PRIVATE ${LIBS_INCLUDE_DIR})
|
||||
target_link_libraries(agc_context_state_size_tests PRIVATE libSceAgc libc)
|
||||
@@ -343,7 +370,7 @@ add_test_executable(agc_dma_data_tests EXCLUDE_FROM_ALL
|
||||
DcbFlow/src/Memory.cpp
|
||||
)
|
||||
target_include_directories(agc_dma_data_tests PRIVATE ${LIBS_INCLUDE_DIR})
|
||||
target_link_libraries(agc_dma_data_tests PRIVATE libc)
|
||||
target_link_libraries(agc_dma_data_tests PRIVATE libSceAgcDriver libc)
|
||||
configure_windows_unwind(agc_dma_data_tests)
|
||||
if(BUILD_TESTING)
|
||||
set_target_properties(agc_dma_data_tests PROPERTIES EXCLUDE_FROM_ALL FALSE)
|
||||
@@ -363,7 +390,7 @@ add_test_executable(agc_write_data_patch_tests EXCLUDE_FROM_ALL
|
||||
Patch/src/WaitRegMem.cpp
|
||||
)
|
||||
target_include_directories(agc_write_data_patch_tests PRIVATE ${LIBS_INCLUDE_DIR})
|
||||
target_link_libraries(agc_write_data_patch_tests PRIVATE libc)
|
||||
target_link_libraries(agc_write_data_patch_tests PRIVATE libSceAgcDriver libc)
|
||||
configure_windows_unwind(agc_write_data_patch_tests)
|
||||
if(BUILD_TESTING)
|
||||
set_target_properties(agc_write_data_patch_tests PROPERTIES EXCLUDE_FROM_ALL FALSE)
|
||||
@@ -383,7 +410,7 @@ add_test_executable(agc_prime_utcl2_tests EXCLUDE_FROM_ALL
|
||||
DcbState/src/Display.cpp
|
||||
)
|
||||
target_include_directories(agc_prime_utcl2_tests PRIVATE ${LIBS_INCLUDE_DIR})
|
||||
target_link_libraries(agc_prime_utcl2_tests PRIVATE libc)
|
||||
target_link_libraries(agc_prime_utcl2_tests PRIVATE libSceAgcDriver libc)
|
||||
configure_windows_unwind(agc_prime_utcl2_tests)
|
||||
if(BUILD_TESTING)
|
||||
set_target_properties(agc_prime_utcl2_tests PROPERTIES EXCLUDE_FROM_ALL FALSE)
|
||||
@@ -404,7 +431,7 @@ add_test_executable(agc_cond_exec_patch_tests EXCLUDE_FROM_ALL
|
||||
Patch/src/CondExec.cpp
|
||||
)
|
||||
target_include_directories(agc_cond_exec_patch_tests PRIVATE ${LIBS_INCLUDE_DIR})
|
||||
target_link_libraries(agc_cond_exec_patch_tests PRIVATE libc)
|
||||
target_link_libraries(agc_cond_exec_patch_tests PRIVATE libSceAgcDriver libc)
|
||||
configure_windows_unwind(agc_cond_exec_patch_tests)
|
||||
if(BUILD_TESTING)
|
||||
set_target_properties(agc_cond_exec_patch_tests PROPERTIES EXCLUDE_FROM_ALL FALSE)
|
||||
|
||||
@@ -1,4 +1,16 @@
|
||||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_CB_INCLUDE_BRANCH_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_CB_INCLUDE_BRANCH_HPP
|
||||
|
||||
#include "SceTypes.hpp"
|
||||
#include "SceShaders.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcCbBranch(CommandBuffer* buf, std::uint8_t mode, std::uint8_t compareFunction, const volatile std::uint64_t* compareAddress, std::uint64_t mask, std::uint64_t reference, std::uint8_t cachePolicy1, const volatile std::uint32_t* buffer1, std::uint32_t sizeInDwords1, std::uint8_t cachePolicy2, const volatile std::uint32_t* buffer2, std::uint32_t sizeInDwords2);
|
||||
std::uint32_t APS5_VABI sceAgcCbBranchGetSize();
|
||||
std::uint32_t* APS5_VABI sceAgcCbCondWrite(CommandBuffer* buf, std::uint32_t compareFunction, std::uint32_t writeSpace, const volatile void* writeAddress, std::uint32_t writeData, const volatile void* pollAddress, std::uint32_t reference, std::uint32_t mask);
|
||||
std::uint32_t APS5_VABI sceAgcCbCondWriteGetSize();
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,4 +1,14 @@
|
||||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_CB_INCLUDE_DISPATCH_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_CB_INCLUDE_DISPATCH_HPP
|
||||
|
||||
#include "SceTypes.hpp"
|
||||
#include "SceShaders.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcCbDispatch(CommandBuffer* buf, std::uint32_t threadGroupX, std::uint32_t threadGroupY, std::uint32_t threadGroupZ, std::uint32_t modifier);
|
||||
uint32_t APS5_VABI sceAgcCbDispatchGetSize(void);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,4 +1,20 @@
|
||||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_CB_INCLUDE_REGISTERS_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_CB_INCLUDE_REGISTERS_HPP
|
||||
|
||||
#include "SceTypes.hpp"
|
||||
#include "SceShaders.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcCbSetUcRegisterRangeDirect(CommandBuffer* buf, std::uint32_t offset, const std::uint32_t* values, std::uint32_t numValues);
|
||||
std::uint32_t* APS5_VABI sceAgcCbSetShRegisterRangeDirect(CommandBuffer* buf, std::uint32_t offset, const std::uint32_t* values, std::uint32_t numValues);
|
||||
uint32_t APS5_VABI sceAgcCbSetShRegisterRangeDirectGetSize(uint32_t numValues);
|
||||
std::uint32_t APS5_VABI sceAgcCbSetUcRegisterRangeDirectGetSize(std::uint32_t numValues);
|
||||
std::uint32_t* APS5_VABI sceAgcCbSetShRegistersDirect(CommandBuffer* buf, const volatile ShaderRegister* regs, std::uint32_t numRegs);
|
||||
std::uint32_t APS5_VABI sceAgcCbSetShRegistersDirectGetSize(std::uint32_t numRegs);
|
||||
std::uint32_t* APS5_VABI sceAgcCbSetUcRegistersDirect(CommandBuffer* buf, const volatile ShaderRegister* regs, std::uint32_t numRegs);
|
||||
std::uint32_t APS5_VABI sceAgcCbSetUcRegistersDirectGetSize(std::uint32_t numRegs);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -4,10 +4,19 @@
|
||||
#include "SceTypes.hpp"
|
||||
#include <cstdint>
|
||||
|
||||
struct CommandBuffer;
|
||||
|
||||
extern "C" {
|
||||
std::uint32_t* APS5_VABI sceAgcCbMemSemaphore(CommandBuffer* buf, const volatile void* address, std::uint32_t operation, std::uint32_t modifier, std::uint32_t value);
|
||||
}
|
||||
|
||||
#include "SceShaders.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcCbNop_nid_postfix(CommandBuffer* buf, std::uint32_t sizeInDwords);
|
||||
uint32_t APS5_VABI sceAgcCbNopGetSize(uint32_t sizeInDwords);
|
||||
std::uint32_t APS5_VABI sceAgcCbQueueEndOfPipeActionGetSize();
|
||||
std::uint32_t* APS5_VABI sceAgcCbReleaseMem(CommandBuffer* buf, std::uint8_t action, std::uint16_t gcrControl, std::uint8_t dst, std::uint8_t cachePolicy, const volatile Label* address, std::uint8_t dataSelect, std::uint64_t data, std::uint16_t gdsOffset, std::uint16_t gdsSize, std::uint8_t interrupt, std::uint32_t interruptContextId);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "prx/libSceAgcDriver/Execution/include/Driver.hpp"
|
||||
#include "prx/libSceAgc/Command/include/Packet.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
@@ -67,6 +68,7 @@ void Reserve(CommandBuffer* buffer, std::uint32_t count, const char* function) {
|
||||
std::uint32_t* Allocate(CommandBuffer* buffer, std::uint32_t count, const char* function) {
|
||||
Reserve(buffer, count, function);
|
||||
auto* result = buffer->cursor_up;
|
||||
AgcDriverPrepareCommandWrite_nid_no_patch(reinterpret_cast<std::uint64_t>(result), static_cast<std::size_t>(count) * sizeof(std::uint32_t));
|
||||
buffer->cursor_up += count;
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,24 @@
|
||||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_DCBDRAW_INCLUDE_DRAWINDEXED_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_DCBDRAW_INCLUDE_DRAWINDEXED_HPP
|
||||
|
||||
#include "SceTypes.hpp"
|
||||
#include "SceShaders.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcDcbDrawIndex(CommandBuffer* buf, std::uint32_t indexCount, const volatile void* indexAddress, std::uint64_t modifier);
|
||||
std::uint32_t APS5_VABI sceAgcDcbDrawIndexGetSize();
|
||||
std::uint32_t* APS5_VABI sceAgcDcbDrawIndexAuto(CommandBuffer* buf, std::uint32_t indexCount, std::uint64_t modifier);
|
||||
std::uint32_t APS5_VABI sceAgcDcbDrawIndexAutoGetSize();
|
||||
std::uint32_t* APS5_VABI sceAgcDcbDrawIndexOffset(CommandBuffer* buf, std::uint32_t indexOffset, std::uint32_t indexCount, std::uint64_t modifier);
|
||||
uint32_t APS5_VABI sceAgcDcbDrawIndexOffsetGetSize(void);
|
||||
uint32_t* APS5_VABI sceAgcDcbDrawIndexIndirect(CommandBuffer* buf, uint32_t dataOffsetInBytes, uint64_t modifier);
|
||||
std::uint32_t APS5_VABI sceAgcDcbDrawIndexIndirectGetSize();
|
||||
uint32_t* APS5_VABI sceAgcDcbDrawIndexIndirectMulti(CommandBuffer* buf, uint32_t dataOffsetInBytes, uint32_t countIndirect, uint32_t maxCountOrCount, const volatile void* countAddr, uint32_t strideInBytes, uint64_t modifier);
|
||||
std::uint32_t APS5_VABI sceAgcDcbDrawIndexIndirectMultiGetSize();
|
||||
uint32_t* APS5_VABI sceAgcDcbDrawIndexMultiInstanced(CommandBuffer* buf, uint32_t indexCount, const volatile void* indexAddr, const volatile void* objectIds, uint32_t instanceCount, uint64_t modifier);
|
||||
uint32_t APS5_VABI sceAgcDcbDrawIndexMultiInstancedGetSize(void);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,4 +1,16 @@
|
||||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_DCBDRAW_INCLUDE_DRAWNONINDEXED_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_DCBDRAW_INCLUDE_DRAWNONINDEXED_HPP
|
||||
|
||||
#include "SceTypes.hpp"
|
||||
#include "SceShaders.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcDcbDrawIndirect(CommandBuffer* buf, std::uint32_t dataOffsetInBytes, std::uint64_t modifier);
|
||||
std::uint32_t APS5_VABI sceAgcDcbDrawIndirectGetSize();
|
||||
std::uint32_t* APS5_VABI sceAgcDcbDrawIndirectMulti(CommandBuffer* buf, std::uint32_t dataOffsetInBytes, std::uint32_t countIndirect, std::uint32_t maxCountOrCount, const volatile void* countAddress, std::uint32_t strideInBytes, std::uint64_t modifier);
|
||||
std::uint32_t APS5_VABI sceAgcDcbDrawIndirectMultiGetSize();
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,4 +1,21 @@
|
||||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_DCBDRAW_INCLUDE_INDEXBUFFER_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_DCBDRAW_INCLUDE_INDEXBUFFER_HPP
|
||||
|
||||
#include "SceTypes.hpp"
|
||||
#include "SceShaders.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcDcbSetIndexBuffer(CommandBuffer* buf, std::uint64_t indexAddress);
|
||||
std::uint32_t APS5_VABI sceAgcDcbSetIndexBufferGetSize();
|
||||
std::uint32_t* APS5_VABI sceAgcDcbSetIndexCount(CommandBuffer* buf, std::uint32_t indexCount);
|
||||
std::uint32_t APS5_VABI sceAgcDcbSetIndexCountGetSize();
|
||||
std::uint32_t* APS5_VABI sceAgcDcbSetIndexSize(CommandBuffer* buf, std::uint8_t indexSize, std::uint8_t cachePolicy);
|
||||
std::uint32_t APS5_VABI sceAgcDcbSetIndexSizeGetSize();
|
||||
std::uint32_t* APS5_VABI sceAgcDcbSetIndexSize_0600(CommandBuffer* buf, std::uint8_t indexSize, std::uint8_t cachePolicy, std::uint8_t perInstanceObjectId);
|
||||
std::uint32_t* APS5_VABI sceAgcDcbSetIndexIndirectArgs(CommandBuffer* buf, std::uint64_t attributeAddress, std::uint32_t attributeIndex);
|
||||
std::uint32_t APS5_VABI sceAgcDcbSetIndexIndirectArgsGetSize();
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,4 +1,15 @@
|
||||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_DCBDRAW_INCLUDE_INSTANCING_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_DCBDRAW_INCLUDE_INSTANCING_HPP
|
||||
|
||||
#include "SceTypes.hpp"
|
||||
#include "SceShaders.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcDcbSetNumInstances(CommandBuffer* buf, std::uint32_t numInstances);
|
||||
std::uint32_t APS5_VABI sceAgcDcbSetNumInstancesGetSize();
|
||||
uint32_t* APS5_VABI sceAgcDcbSetBaseIndirectArgs(CommandBuffer* buf, uint32_t shaderType, const volatile void* indirectBaseAddr);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,4 +1,15 @@
|
||||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_DCBDRAW_INCLUDE_STATS_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_DCBDRAW_INCLUDE_STATS_HPP
|
||||
|
||||
#include "SceTypes.hpp"
|
||||
#include "SceShaders.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcDcbGetLodStats(CommandBuffer* buf, std::uint8_t cachePolicy, const volatile void* buffer, std::uint32_t bufferSizeInBytes, std::uint32_t resetCount, std::uint8_t forceReset, std::uint8_t reportAndReset, std::uint32_t reportingIntervalIn100kClocks);
|
||||
std::uint32_t APS5_VABI sceAgcDcbBeginOcclusionQueryGetSize(std::int32_t queryType);
|
||||
std::uint32_t APS5_VABI sceAgcDcbEndOcclusionQueryGetSize();
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -42,16 +42,14 @@ std::uint32_t* APS5_VABI sceAgcDcbSetIndexSize_0600(CommandBuffer* buf, std::uin
|
||||
return packet;
|
||||
}
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcDcbSetIndexIndirectArgs(CommandBuffer* buf, std::uint32_t dataOffsetInBytes) {
|
||||
(void)buf;
|
||||
(void)dataOffsetInBytes;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return nullptr;
|
||||
std::uint32_t* APS5_VABI sceAgcDcbSetIndexIndirectArgs(CommandBuffer* buf, std::uint64_t attributeAddress, std::uint32_t attributeIndex) {
|
||||
if (attributeAddress != 0) Agc::Command::CheckAddress(attributeAddress, 16, __func__);
|
||||
Agc::Command::CheckBits(attributeIndex, 0xffffu, __func__);
|
||||
return Agc::Command::Emit(buf, 0x91u, {static_cast<std::uint32_t>(attributeAddress), static_cast<std::uint32_t>(attributeAddress >> 32u), attributeIndex}, __func__);
|
||||
}
|
||||
|
||||
std::uint32_t APS5_VABI sceAgcDcbSetIndexIndirectArgsGetSize() {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
return 16;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -21,14 +21,13 @@ std::uint32_t* APS5_VABI sceAgcDcbGetLodStats(CommandBuffer* buf, std::uint8_t c
|
||||
return Agc::Command::Emit(buf, 0x10u, {bufferSizeInBytes, static_cast<std::uint32_t>(address), static_cast<std::uint32_t>(address >> 32u), control}, __func__);
|
||||
}
|
||||
|
||||
std::uint32_t APS5_VABI sceAgcDcbBeginOcclusionQueryGetSize() {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
std::uint32_t APS5_VABI sceAgcDcbBeginOcclusionQueryGetSize(std::int32_t queryType) {
|
||||
if (queryType == 1) return 0x120u;
|
||||
return queryType == 0 ? 0x10u : 0u;
|
||||
}
|
||||
|
||||
std::uint32_t APS5_VABI sceAgcDcbEndOcclusionQueryGetSize() {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
return 0x10u;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -9,4 +9,18 @@ std::uint32_t* APS5_VABI sceAgcDcbAtomicGds(CommandBuffer* buf, std::uint32_t co
|
||||
std::uint32_t* APS5_VABI sceAgcDcbAtomicGds_0900(CommandBuffer* buf, std::uint32_t control, std::uint32_t mode, std::uint32_t gdsOp, std::uint32_t src, std::uint16_t offset, std::uint16_t index, std::uint32_t mask, std::uint32_t data, std::uint64_t compareData, std::uint64_t extraData);
|
||||
}
|
||||
|
||||
#include "SceShaders.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbJump(CommandBuffer* buf, uint8_t mode, uint8_t cachePolicy, const uint32_t* target, uint32_t sizeInDwords);
|
||||
std::uint32_t APS5_VABI sceAgcDcbJumpGetSize();
|
||||
std::uint32_t* APS5_VABI sceAgcDcbResetQueue(CommandBuffer* buf, std::uint32_t op, std::uint32_t state);
|
||||
std::uint32_t* APS5_VABI sceAgcDcbClearState(CommandBuffer* buf, std::uint32_t command);
|
||||
uint32_t* APS5_VABI sceAgcDcbRewind(CommandBuffer* buf, uint32_t initialState);
|
||||
uint32_t APS5_VABI sceAgcDcbRewindGetSize(void);
|
||||
uint32_t* APS5_VABI sceAgcDcbWaitUntilSafeForRendering(CommandBuffer* buf, uint32_t videoOutHandle, uint32_t displayBufferIndex);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,4 +1,14 @@
|
||||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_DCBFLOW_INCLUDE_DISPATCH_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_DCBFLOW_INCLUDE_DISPATCH_HPP
|
||||
|
||||
#include "SceTypes.hpp"
|
||||
#include "SceShaders.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbDispatchIndirect(CommandBuffer* buf, uint32_t dataOffsetInBytes, uint32_t flags);
|
||||
std::uint32_t APS5_VABI sceAgcDcbDispatchIndirectGetSize();
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -9,4 +9,20 @@ std::uint32_t* APS5_VABI sceAgcDcbAcquireMem(CommandBuffer* buf, std::uint8_t en
|
||||
std::uint32_t APS5_VABI sceAgcDcbAtomicGdsGetSize();
|
||||
}
|
||||
|
||||
#include "SceShaders.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
uint32_t APS5_VABI sceAgcDcbAcquireMemGetSize(void);
|
||||
uint32_t* APS5_VABI sceAgcDcbCopyData(CommandBuffer* buf, uint8_t dst, uint8_t dstCachePolicy, uint64_t dstAddress, uint8_t src, uint8_t srcCachePolicy, uint64_t srcAddressOrImmediate, uint8_t itemSize, uint8_t writeConfirm);
|
||||
std::uint64_t APS5_VABI sceAgcDcbCopyDataGetSize();
|
||||
std::uint32_t* APS5_VABI sceAgcDcbDmaData(CommandBuffer* buf, std::uint8_t engine, std::uint8_t dst, std::uint8_t dstCachePolicy, std::uint64_t dstAddress, std::uint8_t src, std::uint8_t srcCachePolicy, std::uint64_t srcAddress, std::uint32_t numBytes, std::uint8_t waitForPrevious, std::uint8_t writeConfirm, std::uint8_t blockEngine);
|
||||
std::uint32_t APS5_VABI sceAgcDcbDmaDataGetSize();
|
||||
std::uint32_t* APS5_VABI sceAgcDcbAtomicMem(CommandBuffer* buf, std::uint8_t atomicOp, std::uint8_t command, std::uint8_t cachePolicy, const volatile void* address, std::uint64_t srcData, std::uint64_t compareData, std::uint16_t loopInterval);
|
||||
std::uint32_t APS5_VABI sceAgcDcbAtomicMemGetSize();
|
||||
std::uint32_t* APS5_VABI sceAgcDcbWriteData(CommandBuffer* buf, std::uint8_t dst, std::uint8_t cachePolicy, std::uint64_t address, const void* data, std::uint32_t numDwords, std::uint8_t increment, std::uint8_t writeConfirm);
|
||||
uint32_t APS5_VABI sceAgcDcbWriteDataGetSize(uint32_t numDwords);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,5 +1,21 @@
|
||||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_DCBFLOW_INCLUDE_SYNC_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_DCBFLOW_INCLUDE_SYNC_HPP
|
||||
|
||||
#include "SceTypes.hpp"
|
||||
#include "SceShaders.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbCondExec(CommandBuffer* buf, const volatile uint32_t* address, uint32_t numDwords);
|
||||
uint32_t APS5_VABI sceAgcDcbCondExecGetSize(void);
|
||||
std::uint32_t* APS5_VABI sceAgcDcbWaitRegMem(CommandBuffer* buf, std::uint8_t size, std::uint8_t compareFunction, std::uint8_t operation, std::uint8_t cachePolicy, const volatile void* address, std::uint64_t reference, std::uint64_t mask, std::uint32_t pollCycles);
|
||||
uint32_t APS5_VABI sceAgcDcbWaitOnAddressGetSize(uint32_t size);
|
||||
std::uint32_t* APS5_VABI sceAgcDcbEventWrite(CommandBuffer* buf, std::uint8_t eventType, const volatile void* address);
|
||||
std::uint64_t APS5_VABI sceAgcDcbEventWriteGetSize(std::uint8_t eventType);
|
||||
std::uint32_t* APS5_VABI sceAgcDcbStallCommandBufferParser(CommandBuffer* buf);
|
||||
std::uint32_t APS5_VABI sceAgcDcbStallCommandBufferParserGetSize();
|
||||
std::uint32_t* APS5_VABI sceAgcDcbMemSemaphore(CommandBuffer* buf, const volatile void* address, std::uint8_t waitForMailbox, std::uint8_t signalType, std::uint8_t operation);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -52,10 +52,7 @@ std::uint32_t APS5_VABI sceAgcDcbStallCommandBufferParserGetSize() {
|
||||
return 8;
|
||||
}
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcDcbMemSemaphore(CommandBuffer* buf, std::uint8_t action, std::uint8_t clientCode, const volatile void* address) {
|
||||
const std::uint8_t operation = action != 0 ? 7u : 6u;
|
||||
const std::uint8_t signalType = clientCode & 1u;
|
||||
const std::uint8_t waitForMailbox = (clientCode >> 1u) & 1u;
|
||||
std::uint32_t* APS5_VABI sceAgcDcbMemSemaphore(CommandBuffer* buf, const volatile void* address, std::uint8_t waitForMailbox, std::uint8_t signalType, std::uint8_t operation) {
|
||||
return Agc::Command::WriteMemSemaphore(buf, address, waitForMailbox, signalType, operation, __func__);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
#include "SceTypes.hpp"
|
||||
#include <cstdint>
|
||||
|
||||
struct CommandBuffer;
|
||||
|
||||
extern "C" {
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbContextStateOp(CommandBuffer* buf, uint32_t operation);
|
||||
@@ -14,4 +12,15 @@ uint64_t APS5_VABI sceAgcDcbContextStateOpGetSize(uint32_t operation);
|
||||
|
||||
}
|
||||
|
||||
#include "SceShaders.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
std::uint32_t APS5_VABI sceAgcDcbSetBaseDispatchIndirectArgsGetSize();
|
||||
std::uint32_t APS5_VABI sceAgcDcbSetBaseDrawIndirectArgsGetSize();
|
||||
std::uint32_t APS5_VABI sceAgcDcbQueueEndOfShaderActionGetSize();
|
||||
std::uint32_t APS5_VABI sceAgcDcbGetLodStatsGetSize();
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,4 +1,15 @@
|
||||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_DCBSTATE_INCLUDE_DISPLAY_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_DCBSTATE_INCLUDE_DISPLAY_HPP
|
||||
|
||||
#include "SceTypes.hpp"
|
||||
#include "SceShaders.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbSetFlip(CommandBuffer* buf, uint32_t videoOutHandle, int32_t displayBufferIndex, uint32_t flipMode, int64_t flipArg);
|
||||
uint32_t* APS5_VABI sceAgcDcbPrimeUtcl2(CommandBuffer* buf, const volatile void* address, uint32_t sizeInBytes);
|
||||
std::uint32_t APS5_VABI sceAgcDcbPrimeUtcl2GetSize();
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,4 +1,14 @@
|
||||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_DCBSTATE_INCLUDE_INIT_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_DCBSTATE_INCLUDE_INIT_HPP
|
||||
|
||||
#include "SceTypes.hpp"
|
||||
#include "SceShaders.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
int APS5_VABI sceAgcInit(std::uint32_t version);
|
||||
int APS5_VABI sceAgcInit_0090(std::uint32_t* state, std::uint32_t version);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -7,8 +7,19 @@
|
||||
namespace Agc::Marker {
|
||||
|
||||
std::uint32_t* Push(CommandBuffer* buf, const char* str, const char* function);
|
||||
std::uint32_t* PushSpan(CommandBuffer* buf, const char* str, std::uint32_t length, const char* function);
|
||||
std::uint32_t* Pop(CommandBuffer* buf, const char* function);
|
||||
|
||||
}
|
||||
|
||||
#include "SceShaders.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbSetMarker(CommandBuffer* buf, const char* str, uint32_t color);
|
||||
uint32_t* APS5_VABI sceAgcDcbPopMarker(CommandBuffer* buf);
|
||||
uint32_t* APS5_VABI sceAgcDcbPushMarker(CommandBuffer* buf, const char* str, uint32_t color);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,4 +1,16 @@
|
||||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_DCBSTATE_INCLUDE_PREDICATION_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_DCBSTATE_INCLUDE_PREDICATION_HPP
|
||||
|
||||
#include "SceTypes.hpp"
|
||||
#include "SceShaders.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbSetPredication(CommandBuffer* buf, uint8_t condition, uint8_t op, uint8_t waitOp, const volatile void* address, uint32_t countInDwords);
|
||||
std::uint32_t APS5_VABI sceAgcDcbSetZPassPredicationEnableGetSize();
|
||||
std::uint32_t APS5_VABI sceAgcDcbSetPredicationDisableGetSize();
|
||||
std::uint32_t APS5_VABI sceAgcDcbSetBoolPredicationEnableGetSize();
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,4 +1,26 @@
|
||||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_DCBSTATE_INCLUDE_REGISTERS_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_DCBSTATE_INCLUDE_REGISTERS_HPP
|
||||
|
||||
#include "SceTypes.hpp"
|
||||
#include "SceShaders.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcDcbSetCfRegisterDirect(CommandBuffer* buf, ShaderRegister reg);
|
||||
std::uint32_t* APS5_VABI sceAgcDcbSetCfRegisterRangeDirect(CommandBuffer* buf, std::uint32_t offset, const std::uint32_t* values, std::uint32_t numValues);
|
||||
uint32_t* APS5_VABI sceAgcDcbSetCxRegisterDirect(CommandBuffer* buf, ShaderRegister reg);
|
||||
uint32_t APS5_VABI sceAgcDcbSetCxRegisterDirectGetSize(void);
|
||||
std::uint32_t* APS5_VABI sceAgcDcbSetCxRegistersIndirect(CommandBuffer* buf, const volatile ShaderRegister* regs, std::uint32_t numRegs);
|
||||
std::uint32_t APS5_VABI sceAgcDcbSetCxRegistersIndirectGetSize(std::uint32_t numRegs);
|
||||
uint32_t* APS5_VABI sceAgcDcbSetShRegisterDirect(CommandBuffer* buf, ShaderRegister reg);
|
||||
std::uint32_t APS5_VABI sceAgcDcbSetShRegisterDirectGetSize();
|
||||
std::uint32_t* APS5_VABI sceAgcDcbSetShRegistersIndirect(CommandBuffer* buf, const volatile ShaderRegister* regs, std::uint32_t numRegs);
|
||||
std::uint32_t APS5_VABI sceAgcDcbSetShRegistersIndirectGetSize(std::uint32_t numRegs);
|
||||
uint32_t* APS5_VABI sceAgcDcbSetUcRegisterDirect(CommandBuffer* buf, ShaderRegister reg);
|
||||
std::uint32_t APS5_VABI sceAgcDcbSetUcRegisterDirectGetSize();
|
||||
std::uint32_t* APS5_VABI sceAgcDcbSetUcRegistersIndirect(CommandBuffer* buf, const volatile ShaderRegister* regs, std::uint32_t numRegs);
|
||||
std::uint32_t APS5_VABI sceAgcDcbSetUcRegistersIndirectGetSize(std::uint32_t numRegs);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,4 +1,15 @@
|
||||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_DCBSTATE_INCLUDE_WORKLOAD_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_DCBSTATE_INCLUDE_WORKLOAD_HPP
|
||||
|
||||
#include "SceTypes.hpp"
|
||||
#include "SceShaders.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbSetWorkloadComplete(CommandBuffer* buf, uint32_t streamId, uint32_t workloadId);
|
||||
uint32_t* APS5_VABI sceAgcDcbSetWorkloadsActive(CommandBuffer* buf, uint32_t streamId, const uint32_t* workloadIds, uint32_t workloadCount);
|
||||
uint32_t* APS5_VABI sceAgcDcbSetWorkloadStreamInactive(CommandBuffer* buf, uint32_t streamId);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -22,13 +22,21 @@ namespace Agc::Marker {
|
||||
std::uint32_t* Push(CommandBuffer* buf, const char* str, const char* function) {
|
||||
Agc::Command::Require(buf != nullptr, function, "null command buffer");
|
||||
const char* text = str ? str : "";
|
||||
const std::size_t bytes = std::strlen(text) + 1;
|
||||
const std::size_t length = std::strlen(text);
|
||||
Agc::Command::Require(length < 0x10000u, function, "marker text too long");
|
||||
return PushSpan(buf, text, static_cast<std::uint32_t>(length), function);
|
||||
}
|
||||
|
||||
std::uint32_t* PushSpan(CommandBuffer* buf, const char* str, std::uint32_t length, const char* function) {
|
||||
Agc::Command::Require(buf != nullptr, function, "null command buffer");
|
||||
Agc::Command::Require(str != nullptr || length == 0, function, "null marker text");
|
||||
const std::size_t bytes = std::size_t{length} + 1;
|
||||
const auto payload = static_cast<std::uint32_t>((bytes + 3) / 4);
|
||||
Agc::Command::Require(payload <= 0x4000u, function, "marker text too long");
|
||||
auto* packet = Agc::Command::Allocate(buf, payload + 1, function);
|
||||
packet[0] = Agc::Command::Header(OpcodeNop, payload + 1, CustomPushMarker << 2);
|
||||
std::memset(packet + 1, 0, payload * sizeof(std::uint32_t));
|
||||
std::memcpy(packet + 1, text, bytes);
|
||||
if (length != 0) std::memcpy(packet + 1, str, length);
|
||||
return packet;
|
||||
}
|
||||
|
||||
@@ -60,4 +68,16 @@ uint32_t* APS5_VABI sceAgcDcbPushMarker(CommandBuffer* buf, const char* str, uin
|
||||
return Agc::Marker::Push(buf, str, __func__);
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbPushMarkerSpan(CommandBuffer* buf, const char* str, uint32_t length, uint32_t color) {
|
||||
(void)color;
|
||||
return Agc::Marker::PushSpan(buf, str, length, __func__);
|
||||
}
|
||||
|
||||
uint32_t* APS5_VABI sceAgcDcbSetMarkerSpan(CommandBuffer* buf, const char* str, uint32_t length, uint32_t color) {
|
||||
(void)color;
|
||||
auto* packet = Agc::Marker::PushSpan(buf, str, length, __func__);
|
||||
Agc::Marker::Pop(buf, __func__);
|
||||
return packet;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
#include "prx/libSceAgc/include/Agc.hpp"
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include "SceTypes.hpp"
|
||||
#include "prx/libc/include/General.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
int APS5_VABI sceAgcSuspendPointAndCheckStatus(void) {
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,4 +1,15 @@
|
||||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_MISC_INCLUDE_DEBUG_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_MISC_INCLUDE_DEBUG_HPP
|
||||
|
||||
#include "SceTypes.hpp"
|
||||
#include "SceShaders.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
int APS5_VABI sceAgcDebugRaiseException(std::uint32_t exceptionId);
|
||||
int APS5_VABI sceAgcSetShaderInstrumentation(std::uint32_t flags);
|
||||
std::uint32_t APS5_VABI sceAgcGetShaderInstrumentation();
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -14,4 +14,14 @@ int APS5_VABI sceAgcGetDataPacketPayloadAddress(uint32_t** addr, uint32_t* cmd,
|
||||
int APS5_VABI sceAgcGetDataPacketPayloadAddress_0090(uint32_t** addr, uint32_t* cmd, int type);
|
||||
}
|
||||
|
||||
#include "SceShaders.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
uint32_t APS5_VABI sceAgcGetPacketSize(uint32_t* packet);
|
||||
int APS5_VABI sceAgcGetDataPacketPayloadRange(SceAgcMemoryRange* range, uint32_t* cmd, int type);
|
||||
int APS5_VABI sceAgcDcbGetSystemSoftwareVersion(uint32_t* destination, const uint32_t* packet);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,4 +1,13 @@
|
||||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_MISC_INCLUDE_PLATFORM_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_MISC_INCLUDE_PLATFORM_HPP
|
||||
|
||||
#include "SceTypes.hpp"
|
||||
#include "SceShaders.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
int APS5_VABI sceAgcGetIsTrinityMode(bool* isTrinityMode);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -4,6 +4,18 @@
|
||||
#include <cstdint>
|
||||
|
||||
extern "C" {
|
||||
int APS5_VABI sceAgcGetDefaultCxStateFlat(void* out_state, std::uint32_t size);
|
||||
int APS5_VABI sceAgcGetDefaultCxStateFlat(void* outState, std::uint32_t size);
|
||||
}
|
||||
|
||||
#include "SceShaders.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
void* APS5_VABI sceAgcGetRegisterDefaults();
|
||||
void* APS5_VABI sceAgcGetRegisterDefaultsInternal();
|
||||
void* APS5_VABI sceAgcGetRegisterDefaults2(std::uint32_t version);
|
||||
void* APS5_VABI sceAgcGetRegisterDefaults2Internal(std::uint32_t version);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,4 +1,14 @@
|
||||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_MISC_INCLUDE_SEMAPHORE_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_MISC_INCLUDE_SEMAPHORE_HPP
|
||||
|
||||
#include "SceTypes.hpp"
|
||||
#include "SceShaders.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
int APS5_VABI sceAgcSetAmmSemaphoreMemory(void* memory, std::uint64_t sizeInBytes);
|
||||
int APS5_VABI sceAgcGetSemaphoreLabel(std::uint32_t index, void** label);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -10,7 +10,16 @@ struct SizeAlign {
|
||||
std::size_t m_align;
|
||||
};
|
||||
|
||||
extern "C" int APS5_VABI sceAgcFuseShaderHalves_0200(Shader* fused_result, const Shader* front, const Shader* back, void* scratch_mem);
|
||||
extern "C" int APS5_VABI sceAgcFuseShaderHalves_0200(Shader* fusedResult, const Shader* front, const Shader* back, void* scratchMem);
|
||||
extern "C" int APS5_VABI sceAgcGetFusedShaderSize_0080(SizeAlign* dst, const Shader* front, const Shader* back);
|
||||
|
||||
#include "SceShaders.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
int APS5_VABI sceAgcFuseShaderHalves_nid_postfix(Shader* fusedResult, const Shader* front, const Shader* back, void* scratchMem);
|
||||
int APS5_VABI sceAgcUpdateInterpolantMapping_0100(ShaderRegister* regs, const Shader* vs, const Shader* ps);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,14 @@
|
||||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_MISC_INCLUDE_STATICBUFFER_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_MISC_INCLUDE_STATICBUFFER_HPP
|
||||
|
||||
#include <cstdint>
|
||||
#include "SceTypes.hpp"
|
||||
|
||||
extern "C" {
|
||||
int APS5_VABI sceAgcSetStaticBuffer(std::uint32_t index, const void* buffer);
|
||||
int APS5_VABI sceAgcGetStaticBuffer(std::uint32_t index, void* buffer);
|
||||
int APS5_VABI sceAgcSetStaticQword(std::uint32_t index, std::uint64_t value);
|
||||
int APS5_VABI sceAgcGetStaticQword(std::uint32_t index, std::uint64_t* value);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,4 +1,14 @@
|
||||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_MISC_INCLUDE_SUSPEND_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_MISC_INCLUDE_SUSPEND_HPP
|
||||
|
||||
#include "SceTypes.hpp"
|
||||
#include "SceShaders.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
int APS5_VABI sceAgcSuspendPoint(void);
|
||||
int APS5_VABI sceAgcSetSubmitMode(std::uint32_t mode);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,9 +1,16 @@
|
||||
#include "prx/libSceAgc/Misc/include/Debug.hpp"
|
||||
|
||||
#include <atomic>
|
||||
#include <cstdint>
|
||||
#include "SceTypes.hpp"
|
||||
#include "prx/libc/include/General.hpp"
|
||||
|
||||
namespace {
|
||||
|
||||
std::atomic<std::uint32_t> shaderInstrumentation{0};
|
||||
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
|
||||
int APS5_VABI sceAgcDebugRaiseException(std::uint32_t exceptionId) {
|
||||
@@ -11,4 +18,13 @@ int APS5_VABI sceAgcDebugRaiseException(std::uint32_t exceptionId) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAgcSetShaderInstrumentation(std::uint32_t flags) {
|
||||
shaderInstrumentation.store(flags, std::memory_order_relaxed);
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::uint32_t APS5_VABI sceAgcGetShaderInstrumentation() {
|
||||
return shaderInstrumentation.load(std::memory_order_relaxed);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -11,21 +11,37 @@
|
||||
|
||||
namespace {
|
||||
|
||||
constexpr int GRAPHICS5_ERROR_INVALID_ALIGNMENT = static_cast<int>(0x8a6c0002u);
|
||||
constexpr int GRAPHICS5_ERROR_OUT_OF_RANGE = static_cast<int>(0x8a6c000bu);
|
||||
constexpr int GRAPHICS5_ERROR_SEMAPHORE_MEMORY_REGISTERED = static_cast<int>(0x8a6c0048u);
|
||||
constexpr int GRAPHICS5_ERROR_SEMAPHORE_MEMORY_UNREGISTERED = static_cast<int>(0x8a6c0049u);
|
||||
constexpr std::uint64_t semaphoreMemoryAlignment = 0x4000u;
|
||||
constexpr std::uint64_t semaphoreMemoryLimit = 0x40000000u;
|
||||
constexpr std::uint64_t semaphoreLabelBytes = 32u;
|
||||
constexpr std::uint64_t semaphoreCounterBytes = 8u;
|
||||
|
||||
std::mutex semaphoreMutex;
|
||||
std::uint8_t* semaphoreMemory = nullptr;
|
||||
std::uint64_t semaphoreBytes = 0;
|
||||
|
||||
bool hasOnlyZeroLabelTails(const std::uint8_t* memory, std::uint64_t sizeInBytes) {
|
||||
for (std::uint64_t label = 0; label < sizeInBytes; label += semaphoreLabelBytes) {
|
||||
for (std::uint64_t byte = semaphoreCounterBytes; byte < semaphoreLabelBytes; ++byte) {
|
||||
if (memory[label + byte] != 0) return false;
|
||||
}
|
||||
bool aligned(std::uint64_t value) {
|
||||
return (value & (semaphoreMemoryAlignment - 1u)) == 0;
|
||||
}
|
||||
|
||||
int registerSemaphoreMemory(void* memory, std::uint64_t sizeInBytes, bool limited, const char* name) {
|
||||
const auto address = reinterpret_cast<std::uintptr_t>(memory);
|
||||
std::lock_guard lock(semaphoreMutex);
|
||||
if (semaphoreBytes != 0) return GRAPHICS5_ERROR_SEMAPHORE_MEMORY_REGISTERED;
|
||||
if (!aligned(sizeInBytes)) return GRAPHICS5_ERROR_INVALID_ALIGNMENT;
|
||||
if (limited && sizeInBytes > semaphoreMemoryLimit) return GRAPHICS5_ERROR_OUT_OF_RANGE;
|
||||
if (!aligned(address)) return GRAPHICS5_ERROR_INVALID_ALIGNMENT;
|
||||
if (sizeInBytes != 0) {
|
||||
Agc::Command::Require(memory != nullptr, name, "null semaphore memory with a non-zero size");
|
||||
Agc::Command::Require(sizeInBytes - 1u <= std::numeric_limits<std::uintptr_t>::max() - address, name, "semaphore memory wraps the address space");
|
||||
std::memset(memory, 0, sizeInBytes);
|
||||
}
|
||||
return true;
|
||||
semaphoreMemory = static_cast<std::uint8_t*>(memory);
|
||||
semaphoreBytes = sizeInBytes;
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -33,27 +49,18 @@ bool hasOnlyZeroLabelTails(const std::uint8_t* memory, std::uint64_t sizeInBytes
|
||||
extern "C" {
|
||||
|
||||
int APS5_VABI sceAgcSetAmmSemaphoreMemory(void* memory, std::uint64_t sizeInBytes) {
|
||||
const auto address = reinterpret_cast<std::uintptr_t>(memory);
|
||||
std::lock_guard lock(semaphoreMutex);
|
||||
Agc::Command::Require(semaphoreMemory == nullptr, __func__, "the AMM semaphore memory is already registered; the console's error is unknown");
|
||||
Agc::Command::Require(memory != nullptr && sizeInBytes != 0, __func__, "null or empty AMM semaphore memory; the console's error is unknown");
|
||||
Agc::Command::Require(((address | sizeInBytes) & (semaphoreMemoryAlignment - 1u)) == 0, __func__, "AMM semaphore memory or size is not 16 KiB aligned; the console's error is unknown");
|
||||
Agc::Command::Require(sizeInBytes - 1u <= std::numeric_limits<std::uintptr_t>::max() - address, __func__, "AMM semaphore memory wraps the address space");
|
||||
auto* labels = static_cast<std::uint8_t*>(memory);
|
||||
Agc::Command::Require(hasOnlyZeroLabelTails(labels, sizeInBytes), __func__, "AMM semaphore labels hold data past their first 8 bytes; whether registration clears it is unknown");
|
||||
for (std::uint64_t label = 0; label < sizeInBytes; label += semaphoreLabelBytes) {
|
||||
std::memset(labels + label, 0, semaphoreCounterBytes);
|
||||
}
|
||||
semaphoreMemory = labels;
|
||||
semaphoreBytes = sizeInBytes;
|
||||
return 0;
|
||||
return registerSemaphoreMemory(memory, sizeInBytes, false, __func__);
|
||||
}
|
||||
|
||||
int APS5_VABI sceAgcSetSemaphoreMemory(void* memory, std::uint64_t sizeInBytes) {
|
||||
return registerSemaphoreMemory(memory, sizeInBytes, true, __func__);
|
||||
}
|
||||
|
||||
int APS5_VABI sceAgcGetSemaphoreLabel(std::uint32_t index, void** label) {
|
||||
std::lock_guard lock(semaphoreMutex);
|
||||
Agc::Command::Require(semaphoreMemory != nullptr, __func__, "no AMM semaphore memory is registered; the console's error is unknown");
|
||||
Agc::Command::Require(index < semaphoreBytes / semaphoreLabelBytes, __func__, "the semaphore label lies outside the AMM semaphore memory; the console's error is unknown");
|
||||
Agc::Command::Require(label != nullptr, __func__, "null semaphore label output; the console's error is unknown");
|
||||
if (semaphoreBytes == 0) return GRAPHICS5_ERROR_SEMAPHORE_MEMORY_UNREGISTERED;
|
||||
if (index >= semaphoreBytes / semaphoreLabelBytes) return GRAPHICS5_ERROR_OUT_OF_RANGE;
|
||||
Agc::Command::Require(label != nullptr, __func__, "null semaphore label output");
|
||||
*label = semaphoreMemory + static_cast<std::uint64_t>(index) * semaphoreLabelBytes;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -35,7 +35,6 @@ constexpr std::size_t FusedCodeAlignment = 256;
|
||||
constexpr char TrailerMagic[8] = {'b', 'a', 'r', 'e', 'f', 'o', 'o', 't'};
|
||||
constexpr std::size_t TrailerCodeBytesOffset = sizeof(TrailerMagic) + 3 * sizeof(std::uint32_t);
|
||||
constexpr std::uint32_t Rsrc1VgprMask = 0x3fu;
|
||||
constexpr std::uint32_t Rsrc1SgprMask = 0xfu << 6u;
|
||||
constexpr std::uint32_t Rsrc2OffchipLdsEnable = 1u << 18u;
|
||||
constexpr std::uint32_t Rsrc2UserSgprMask = (0x1fu << 1u) | (1u << 27u);
|
||||
|
||||
@@ -121,15 +120,19 @@ std::uint32_t FrontProgramBytes(const char* function, const Shader* front) {
|
||||
return static_cast<std::uint32_t>((end - 1) * 4);
|
||||
}
|
||||
|
||||
std::uint32_t MergeRsrc1(std::uint32_t back, std::uint32_t front) {
|
||||
const auto vgprs = std::max(back & Rsrc1VgprMask, front & Rsrc1VgprMask);
|
||||
const auto sgprs = std::max(back & Rsrc1SgprMask, front & Rsrc1SgprMask);
|
||||
return (back & ~(Rsrc1VgprMask | Rsrc1SgprMask)) | vgprs | sgprs;
|
||||
}
|
||||
|
||||
std::uint32_t MergeRsrc2(const char* function, std::uint32_t back, std::uint32_t front) {
|
||||
if ((front & ~(Rsrc2UserSgprMask | Rsrc2OffchipLdsEnable) & ~back) != 0) Fail(function, "front half requires hardware state the back half does not enable");
|
||||
return (back & ~Rsrc2UserSgprMask) | (front & (Rsrc2UserSgprMask | Rsrc2OffchipLdsEnable));
|
||||
std::array<std::uint32_t, 2> mergeGeometryResources(std::uint32_t frontRsrc1, std::uint32_t frontRsrc2, std::uint32_t backRsrc1, std::uint32_t backRsrc2) {
|
||||
const auto frontVgprs = ((frontRsrc1 & Rsrc1VgprMask) + 1u) * 4u;
|
||||
const auto backVgprs = ((backRsrc1 & Rsrc1VgprMask) + 1u) * 4u;
|
||||
const auto frontTotal = frontVgprs + (frontRsrc2 >> 28u) * 8u;
|
||||
const auto backTotal = backVgprs + (backRsrc2 >> 28u) * 8u;
|
||||
const auto maxTotal = std::max(frontTotal, backTotal);
|
||||
const auto shared = std::max(frontVgprs, backVgprs) >= maxTotal ? 0u : (maxTotal - std::min(frontTotal, backTotal) + 7u) / 64u;
|
||||
const auto vgprs = std::max(frontRsrc1 & Rsrc1VgprMask, backRsrc1 & Rsrc1VgprMask);
|
||||
const auto rsrc1Field = std::max((frontRsrc1 >> 29u) & 3u, (backRsrc1 >> 29u) & 3u);
|
||||
const auto rsrc2Field = std::max((frontRsrc2 >> 16u) & 3u, (backRsrc2 >> 16u) & 3u);
|
||||
const auto rsrc1 = (backRsrc1 & ~(Rsrc1VgprMask | (3u << 29u))) | vgprs | (rsrc1Field << 29u);
|
||||
const auto rsrc2 = (backRsrc2 & ~(0xf0000000u | (3u << 16u) | Rsrc2UserSgprMask | Rsrc2OffchipLdsEnable)) | ((shared & 15u) << 28u) | (rsrc2Field << 16u) | (frontRsrc2 & (Rsrc2UserSgprMask | Rsrc2OffchipLdsEnable));
|
||||
return {rsrc1, rsrc2};
|
||||
}
|
||||
|
||||
const ShaderRegister* FindHalfRegister(const Shader* shader, std::uint32_t offset) {
|
||||
@@ -149,10 +152,14 @@ GeometryLayout ComputeGeometryLayout(const char* function, const Shader* front,
|
||||
const auto* frontRsrc1 = FindHalfRegister(front, SPI_SHADER_PGM_RSRC1_GS);
|
||||
const auto* frontRsrc2 = FindHalfRegister(front, SPI_SHADER_PGM_RSRC2_GS);
|
||||
if (frontRsrc1 == nullptr || frontRsrc2 == nullptr) Fail(function, "front half has no GS resource registers");
|
||||
const auto* backRsrc1 = FindHalfRegister(back, SPI_SHADER_PGM_RSRC1_GS);
|
||||
const auto* backRsrc2 = FindHalfRegister(back, SPI_SHADER_PGM_RSRC2_GS);
|
||||
if (backRsrc1 == nullptr || backRsrc2 == nullptr) Fail(function, "back half has no GS resource registers");
|
||||
const auto resources = mergeGeometryResources(frontRsrc1->value, frontRsrc2->value, backRsrc1->value, backRsrc2->value);
|
||||
layout.sh.assign(back->sh_registers, back->sh_registers + back->num_sh_registers);
|
||||
for (auto& reg : layout.sh) {
|
||||
if (reg.offset == SPI_SHADER_PGM_RSRC1_GS) reg.value = MergeRsrc1(reg.value, frontRsrc1->value);
|
||||
else if (reg.offset == SPI_SHADER_PGM_RSRC2_GS) reg.value = MergeRsrc2(function, reg.value, frontRsrc2->value);
|
||||
if (reg.offset == SPI_SHADER_PGM_RSRC1_GS) reg.value = resources[0];
|
||||
else if (reg.offset == SPI_SHADER_PGM_RSRC2_GS) reg.value = resources[1];
|
||||
}
|
||||
for (std::uint32_t i = 0; i < front->num_sh_registers; ++i) {
|
||||
const auto& reg = front->sh_registers[i];
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
#include "prx/libSceAgc/Misc/include/StaticBuffer.hpp"
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include "SceTypes.hpp"
|
||||
#include "prx/libSceAgcDriver/Execution/include/Driver.hpp"
|
||||
|
||||
namespace {
|
||||
|
||||
constexpr int GRAPHICS5_ERROR_INVALID_STATIC_BUFFER = static_cast<int>(0x8a6c000bu);
|
||||
constexpr std::uint32_t StaticBufferCount = 6;
|
||||
constexpr std::size_t StaticBufferBytes = 16;
|
||||
constexpr std::size_t StaticQwordOffset = 16;
|
||||
|
||||
std::uint8_t* StaticTable() {
|
||||
return static_cast<std::uint8_t*>(AgcDriverStaticTable_nid_postfix());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
|
||||
int APS5_VABI sceAgcSetStaticBuffer(std::uint32_t index, const void* buffer) {
|
||||
if (index >= StaticBufferCount) return GRAPHICS5_ERROR_INVALID_STATIC_BUFFER;
|
||||
std::memcpy(StaticTable() + std::size_t{index} * StaticBufferBytes, buffer, StaticBufferBytes);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAgcGetStaticBuffer(std::uint32_t index, void* buffer) {
|
||||
if (index >= StaticBufferCount) return GRAPHICS5_ERROR_INVALID_STATIC_BUFFER;
|
||||
std::memcpy(buffer, StaticTable() + std::size_t{index} * StaticBufferBytes, StaticBufferBytes);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAgcSetStaticQword(std::uint32_t index, std::uint64_t value) {
|
||||
std::memcpy(StaticTable() + StaticQwordOffset + std::size_t{index} * sizeof(value), &value, sizeof(value));
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAgcGetStaticQword(std::uint32_t index, std::uint64_t* value) {
|
||||
std::memcpy(value, StaticTable() + StaticQwordOffset + std::size_t{index} * sizeof(*value), sizeof(*value));
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,4 +1,17 @@
|
||||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_PATCH_INCLUDE_BRANCH_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_PATCH_INCLUDE_BRANCH_HPP
|
||||
|
||||
#include "SceTypes.hpp"
|
||||
#include "SceShaders.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
int APS5_VABI sceAgcBranchPatchSetCompareAddress(std::uint32_t* cmd, const volatile std::uint64_t* compareAddress);
|
||||
int APS5_VABI sceAgcBranchPatchSetThenTarget(std::uint32_t* cmd, const volatile std::uint32_t* target, std::uint32_t sizeInDwords);
|
||||
int APS5_VABI sceAgcBranchPatchSetElseTarget(std::uint32_t* cmd, const volatile std::uint32_t* target, std::uint32_t sizeInDwords);
|
||||
int APS5_VABI sceAgcBranchPatchSetThenTarget_0300(std::uint32_t* cmd, std::uint8_t cachePolicy, const volatile std::uint32_t* target, std::uint32_t sizeInDwords);
|
||||
int APS5_VABI sceAgcBranchPatchSetElseTarget_0300(std::uint32_t* cmd, std::uint8_t cachePolicy, const volatile std::uint32_t* target, std::uint32_t sizeInDwords);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,4 +1,16 @@
|
||||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_PATCH_INCLUDE_CONDEXEC_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_PATCH_INCLUDE_CONDEXEC_HPP
|
||||
|
||||
#include "SceTypes.hpp"
|
||||
#include "SceShaders.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
int APS5_VABI sceAgcCondExecPatchSetCommandAddress(uint32_t* cmd, const volatile uint32_t* command);
|
||||
int APS5_VABI sceAgcCondExecPatchSetEnd(uint32_t* cmd, const volatile uint32_t* buffer);
|
||||
int APS5_VABI sceAgcAsyncCondExecPatchSetCommandAddress(std::uint32_t* cmd, const volatile std::uint32_t* command);
|
||||
int APS5_VABI sceAgcAsyncCondExecPatchSetEnd(std::uint32_t* cmd, const volatile std::uint32_t* buffer);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,4 +1,14 @@
|
||||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_PATCH_INCLUDE_DMA_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_PATCH_INCLUDE_DMA_HPP
|
||||
|
||||
#include "SceTypes.hpp"
|
||||
#include "SceShaders.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
int APS5_VABI sceAgcDmaDataPatchSetDstAddressOrOffset(std::uint32_t* cmd, std::uint64_t address);
|
||||
int APS5_VABI sceAgcDmaDataPatchSetSrcAddressOrOffsetOrImmediate(std::uint32_t* cmd, std::uint64_t address);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,4 +1,21 @@
|
||||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_PATCH_INCLUDE_INDIRECTREGISTERS_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_PATCH_INCLUDE_INDIRECTREGISTERS_HPP
|
||||
|
||||
#include "SceTypes.hpp"
|
||||
#include "SceShaders.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
int APS5_VABI sceAgcSetCxRegIndirectPatchAddRegisters(std::uint32_t* cmd, std::uint32_t numRegs);
|
||||
int APS5_VABI sceAgcSetCxRegIndirectPatchSetAddress(std::uint32_t* cmd, const volatile ShaderRegister* regs);
|
||||
int APS5_VABI sceAgcSetCxRegIndirectPatchSetNumRegisters(std::uint32_t* cmd, std::uint32_t numRegs);
|
||||
int APS5_VABI sceAgcSetShRegIndirectPatchAddRegisters(std::uint32_t* cmd, std::uint32_t numRegs);
|
||||
int APS5_VABI sceAgcSetShRegIndirectPatchSetAddress(std::uint32_t* cmd, const volatile ShaderRegister* regs);
|
||||
int APS5_VABI sceAgcSetShRegIndirectPatchSetNumRegisters(std::uint32_t* cmd, std::uint32_t numRegs);
|
||||
int APS5_VABI sceAgcSetUcRegIndirectPatchAddRegisters(std::uint32_t* cmd, std::uint32_t numRegs);
|
||||
int APS5_VABI sceAgcSetUcRegIndirectPatchSetAddress(std::uint32_t* cmd, const volatile ShaderRegister* regs);
|
||||
int APS5_VABI sceAgcSetUcRegIndirectPatchSetNumRegisters(std::uint32_t* cmd, std::uint32_t numRegs);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,4 +1,14 @@
|
||||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_PATCH_INCLUDE_JUMP_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_PATCH_INCLUDE_JUMP_HPP
|
||||
|
||||
#include "SceTypes.hpp"
|
||||
#include "SceShaders.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
int APS5_VABI sceAgcJumpPatchSetTarget(uint32_t* cmd, const volatile uint32_t* target, uint32_t sizeInDwords);
|
||||
int APS5_VABI sceAgcJumpPatchSetTarget_0300(uint32_t* cmd, uint64_t cachePolicy, const volatile uint32_t* target, uint32_t sizeInDwords);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,4 +1,13 @@
|
||||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_PATCH_INCLUDE_NOP_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_PATCH_INCLUDE_NOP_HPP
|
||||
|
||||
#include "SceTypes.hpp"
|
||||
#include "SceShaders.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
std::uint32_t* APS5_VABI sceAgcSetNop(CommandBuffer* buf, std::uint32_t sizeDw);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,4 +1,16 @@
|
||||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_PATCH_INCLUDE_QUEUEENDOFPIPEACTION_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_PATCH_INCLUDE_QUEUEENDOFPIPEACTION_HPP
|
||||
|
||||
#include "SceTypes.hpp"
|
||||
#include "SceShaders.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
int APS5_VABI sceAgcQueueEndOfPipeActionPatchAddress(std::uint32_t* cmd, const volatile Label* address);
|
||||
int APS5_VABI sceAgcQueueEndOfPipeActionPatchData(uint32_t* cmd, uint64_t data);
|
||||
int APS5_VABI sceAgcQueueEndOfPipeActionPatchGcrCntl(std::uint32_t* cmd, std::uint16_t gcrControl);
|
||||
int APS5_VABI sceAgcQueueEndOfPipeActionPatchType(std::uint32_t* cmd, std::uint8_t action);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,4 +1,14 @@
|
||||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_PATCH_INCLUDE_REWIND_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_PATCH_INCLUDE_REWIND_HPP
|
||||
|
||||
#include "SceTypes.hpp"
|
||||
#include "SceShaders.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
int APS5_VABI sceAgcRewindPatchSetRewindState(uint32_t* cmd, uint8_t state);
|
||||
int APS5_VABI sceAgcAsyncRewindPatchSetRewindState(std::uint32_t* cmd, std::uint8_t state);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,4 +1,22 @@
|
||||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_PATCH_INCLUDE_WAITREGMEM_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_PATCH_INCLUDE_WAITREGMEM_HPP
|
||||
|
||||
#include "SceTypes.hpp"
|
||||
#include "SceShaders.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
int APS5_VABI sceAgcWaitRegMemPatchAddress(std::uint32_t* cmd, const volatile void* address);
|
||||
int APS5_VABI sceAgcWaitRegMemPatchReference(std::uint32_t* cmd, std::uint32_t reference);
|
||||
int APS5_VABI sceAgcWaitRegMemPatchMask(std::uint32_t* cmd, std::uint32_t mask);
|
||||
int APS5_VABI sceAgcWaitRegMemPatchCompareFunction(std::uint32_t* cmd, std::uint8_t compareFunction);
|
||||
int APS5_VABI sceAgcWriteDataPatchSetAddressOrOffset(std::uint32_t* cmd, std::uint64_t address);
|
||||
int APS5_VABI sceAgcAsyncWriteDataPatchSetAddressOrOffset(std::uint32_t* cmd, std::uint64_t address);
|
||||
int APS5_VABI sceAgcWriteDataPatchSetDst(std::uint32_t* cmd, std::uint8_t dst);
|
||||
int APS5_VABI sceAgcAsyncWriteDataPatchSetDst(std::uint32_t* cmd, std::uint8_t dst);
|
||||
int APS5_VABI sceAgcWriteDataPatchSetCachePolicy(std::uint32_t* cmd, std::uint8_t cachePolicy);
|
||||
int APS5_VABI sceAgcAsyncWriteDataPatchSetCachePolicy(std::uint32_t* cmd, std::uint8_t cachePolicy);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -45,34 +45,29 @@ extern "C" {
|
||||
int APS5_VABI sceAgcWaitRegMemPatchAddress(std::uint32_t* cmd, const volatile void* address) {
|
||||
auto* wait = Agc::Command::ValidateWait(cmd, __func__);
|
||||
const auto guestAddress = reinterpret_cast<std::uintptr_t>(address);
|
||||
const auto alignment = ((wait[0] >> 8u) & 0xffu) == 0x3cu ? 4u : 8u;
|
||||
Agc::Command::CheckAddress(guestAddress, alignment, __func__);
|
||||
Agc::Command::CheckBits(guestAddress, 0xffffffffffffull, __func__);
|
||||
cmd[2] = (cmd[2] & 0xffff0000u) | static_cast<std::uint32_t>(guestAddress >> 32u);
|
||||
const auto lowMask = ((wait[0] >> 8u) & 0xffu) == 0x3cu ? 3u : 7u;
|
||||
cmd[2] = (cmd[2] & 0xffff0000u) | (static_cast<std::uint32_t>(guestAddress >> 32u) & 0xffffu);
|
||||
cmd[3] = static_cast<std::uint32_t>(guestAddress);
|
||||
wait[2] = static_cast<std::uint32_t>(guestAddress);
|
||||
wait[3] = static_cast<std::uint32_t>(guestAddress >> 32u);
|
||||
wait[2] = (static_cast<std::uint32_t>(guestAddress) & ~lowMask) | (wait[2] & lowMask);
|
||||
wait[3] = (static_cast<std::uint32_t>(guestAddress >> 32u) & 0x3ffffu) | (wait[3] & 0xfffc0000u);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAgcWaitRegMemPatchReference(std::uint32_t* cmd, std::uint64_t reference) {
|
||||
int APS5_VABI sceAgcWaitRegMemPatchReference(std::uint32_t* cmd, std::uint32_t reference) {
|
||||
auto* wait = Agc::Command::ValidateWait(cmd, __func__);
|
||||
Agc::Command::CheckBits(reference, 0xffffffffu, __func__);
|
||||
wait[4] = static_cast<std::uint32_t>(reference);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAgcWaitRegMemPatchMask(std::uint32_t* cmd, std::uint64_t mask) {
|
||||
int APS5_VABI sceAgcWaitRegMemPatchMask(std::uint32_t* cmd, std::uint32_t mask) {
|
||||
auto* wait = Agc::Command::ValidateWait(cmd, __func__);
|
||||
Agc::Command::CheckBits(mask, 0xffffffffu, __func__);
|
||||
wait[((wait[0] >> 8u) & 0xffu) == 0x3cu ? 5 : 6] = static_cast<std::uint32_t>(mask);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceAgcWaitRegMemPatchCompareFunction(std::uint32_t* cmd, std::uint8_t compareFunction) {
|
||||
auto* wait = Agc::Command::ValidateWait(cmd, __func__);
|
||||
Agc::Command::Require(compareFunction <= 6, __func__, "invalid wait comparison");
|
||||
wait[1] = (wait[1] & ~7u) | compareFunction;
|
||||
wait[1] = (wait[1] & ~7u) | (compareFunction & 7u);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,14 @@
|
||||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_PREDICATION_INCLUDE_PREDICATION_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_PREDICATION_INCLUDE_PREDICATION_HPP
|
||||
|
||||
#include "SceTypes.hpp"
|
||||
#include "SceShaders.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
int APS5_VABI sceAgcSetPacketPredication(uint32_t* packet, uint32_t predication);
|
||||
int APS5_VABI sceAgcSetRangePredication(uint32_t* start, const volatile uint32_t* end, uint32_t predication);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,4 +1,13 @@
|
||||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_SHADER_INCLUDE_CREATESHADER_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_SHADER_INCLUDE_CREATESHADER_HPP
|
||||
|
||||
#include "SceTypes.hpp"
|
||||
#include "SceShaders.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
int APS5_VABI sceAgcCreateShader(Shader** dst, void* header, const volatile void* code);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include "SceTypes.hpp"
|
||||
#include "SceShaders.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
int APS5_VABI sceAgcGetGsOversubscription(ShaderRegister* regs, const Shader* gs, std::uint32_t budget, float factor);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include "SceTypes.hpp"
|
||||
#include "SceShaders.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
int APS5_VABI sceAgcGetGsPrimPayload(std::uint32_t* payload, const Shader* gs);
|
||||
|
||||
}
|
||||
@@ -1,4 +1,17 @@
|
||||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_SHADER_INCLUDE_INTERPOLANTMAPPING_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_SHADER_INCLUDE_INTERPOLANTMAPPING_HPP
|
||||
|
||||
#include "SceTypes.hpp"
|
||||
#include "SceShaders.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
int APS5_VABI sceAgcCreateInterpolantMapping_0100(ShaderRegister* regs, const Shader* gs, const Shader* ps);
|
||||
int APS5_VABI sceAgcCreateInterpolantMapping_10000(ShaderRegister* regs, const Shader* gs, const Shader* ps);
|
||||
int APS5_VABI sceAgcUpdateInterpolantMapping_10000(ShaderRegister* regs, const Shader* gs, const Shader* ps);
|
||||
int APS5_VABI sceAgcCreateInterpolantMapping_nid_postfix(ShaderRegister* regs, const Shader* gs, const Shader* ps);
|
||||
int APS5_VABI sceAgcUpdateInterpolantMapping_nid_postfix(ShaderRegister* regs, const Shader* gs, const Shader* ps);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include "SceTypes.hpp"
|
||||
#include "SceShaders.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
int APS5_VABI sceAgcLinkShaders(ShaderRegister* context, ShaderRegister* primitive, const void* reserved, const Shader* vertex, const Shader* pixel, std::uint32_t primitiveType);
|
||||
|
||||
}
|
||||
@@ -1,4 +1,14 @@
|
||||
#ifndef CORE_LIBS_PRX_LIBSCEAGC_SHADER_INCLUDE_PRIMSTATE_HPP
|
||||
#define CORE_LIBS_PRX_LIBSCEAGC_SHADER_INCLUDE_PRIMSTATE_HPP
|
||||
|
||||
#include "SceTypes.hpp"
|
||||
#include "SceShaders.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
int APS5_VABI sceAgcCreatePrimState(ShaderRegister* cxRegs, ShaderRegister* ucRegs, const Shader* hs, const Shader* gs, std::uint32_t primType);
|
||||
int APS5_VABI sceAgcUpdatePrimState(ShaderRegister* cxRegs, ShaderRegister* ucRegs, std::uint32_t primType);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
Loaded 100 of 2794 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user