diff --git a/.ci/clang-format.sh b/.ci/clang-format.sh deleted file mode 100755 index 15868550f..000000000 --- a/.ci/clang-format.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash -ex - -# SPDX-FileCopyrightText: 2023 Citra Emulator Project -# SPDX-License-Identifier: GPL-2.0-or-later - -if grep -nrI '\s$' src *.yml *.txt *.md Doxyfile .gitignore .gitmodules .ci* dist/*.desktop \ - dist/*.svg dist/*.xml; then - echo Trailing whitespace found, aborting - exit 1 -fi - -# Default clang-format points to default 3.5 version one -CLANG_FORMAT=clang-format-19 -$CLANG_FORMAT --version - -if [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then - # Get list of every file modified in this pull request - files_to_lint="$(git diff --name-only --diff-filter=ACMRTUXB $COMMIT_RANGE | grep '^src/[^.]*[.]\(cpp\|h\)$' || true)" -else - # Check everything for branch pushes - files_to_lint="$(find src/ -name '*.cpp' -or -name '*.h')" -fi - -# Turn off tracing for this because it's too verbose -set +x - -for f in $files_to_lint; do - d=$(diff -u "$f" <($CLANG_FORMAT "$f") || true) - if ! [ -z "$d" ]; then - echo "!!! $f not compliant to coding style, here is the fix:" - echo "$d" - fail=1 - fi -done - -set -x - -if [ "$fail" = 1 ]; then - exit 1 -fi diff --git a/.github/shadBloodborne.png b/.github/shadBloodborne.png new file mode 100644 index 000000000..119463080 Binary files /dev/null and b/.github/shadBloodborne.png differ diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 96f5e33d7..c4daec6eb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2024 shadPS4 Emulator Project +# SPDX-FileCopyrightText: 2026 shadBloodborne Emulator Project # SPDX-License-Identifier: GPL-2.0-or-later name: Build and Release @@ -31,24 +31,6 @@ jobs: - uses: actions/checkout@v6 - uses: fsfe/reuse-action@v6 - clang-format: - runs-on: ubuntu-24.04 - continue-on-error: true - steps: - - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - name: Install - run: | - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - - sudo add-apt-repository 'deb http://apt.llvm.org/noble/ llvm-toolchain-noble-19 main' - sudo apt update - sudo apt install clang-format-19 - - name: Build - env: - COMMIT_RANGE: ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} - run: ./.ci/clang-format.sh - get-info: runs-on: ubuntu-24.04 outputs: @@ -179,7 +161,7 @@ jobs: uses: actions/upload-artifact@v7 with: name: shadps4-win64-sdl-${{ needs.get-info.outputs.date }}-${{ needs.get-info.outputs.shorthash }} - path: ${{github.workspace}}/build/shadPS4.exe + path: ${{github.workspace}}/build/shadBloodborne.exe macos-sdl: runs-on: macos-15 @@ -224,7 +206,7 @@ jobs: - name: Package and Upload macOS SDL artifact run: | mkdir upload - mv ${{github.workspace}}/build/shadps4 upload + mv ${{github.workspace}}/build/shadBloodborne upload mv ${{github.workspace}}/build/MoltenVK_icd.json upload mv ${{github.workspace}}/build/libMoltenVK.dylib upload - uses: actions/upload-artifact@v7 @@ -275,12 +257,12 @@ jobs: - name: Package and Upload Linux(ubuntu64) SDL artifact run: | - ls -la ${{ github.workspace }}/build/shadps4 + ls -la ${{ github.workspace }}/build/shadBloodborne - uses: actions/upload-artifact@v7 with: name: shadps4-ubuntu64-${{ needs.get-info.outputs.date }}-${{ needs.get-info.outputs.shorthash }} - path: ${{ github.workspace }}/build/shadps4 + path: ${{ github.workspace }}/build/shadBloodborne - name: Run AppImage packaging script run: ./.github/linux-appimage-sdl.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index 147903a7e..10490e07c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +# SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project # SPDX-License-Identifier: GPL-2.0-or-later # Version 3.24 needed for FetchContent OVERRIDE_FIND_PACKAGE @@ -17,7 +17,7 @@ if (NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release) endif() -project(shadPS4 CXX C ASM ${ADDITIONAL_LANGUAGES}) +project(shadBloodborne CXX C ASM ${ADDITIONAL_LANGUAGES}) # Forcing PIE makes sure that the base address is high enough so that it doesn't clash with the PS4 memory. if(UNIX AND NOT APPLE) @@ -206,7 +206,7 @@ set(EMULATOR_VERSION_MAJOR "0") set(EMULATOR_VERSION_MINOR "15") set(EMULATOR_VERSION_PATCH "1") -set_source_files_properties(src/shadps4.rc PROPERTIES COMPILE_DEFINITIONS "EMULATOR_VERSION_MAJOR=${EMULATOR_VERSION_MAJOR};EMULATOR_VERSION_MINOR=${EMULATOR_VERSION_MINOR};EMULATOR_VERSION_PATCH=${EMULATOR_VERSION_PATCH}") +set_source_files_properties(src/shadBloodborne.rc PROPERTIES COMPILE_DEFINITIONS "EMULATOR_VERSION_MAJOR=${EMULATOR_VERSION_MAJOR};EMULATOR_VERSION_MINOR=${EMULATOR_VERSION_MINOR};EMULATOR_VERSION_PATCH=${EMULATOR_VERSION_PATCH}") set(APP_VERSION "${EMULATOR_VERSION_MAJOR}.${EMULATOR_VERSION_MINOR}.${EMULATOR_VERSION_PATCH} WIP") set(APP_IS_RELEASE false) @@ -298,13 +298,6 @@ set(AUDIO_LIB src/core/libraries/audio/audioin.cpp src/core/libraries/audio/sdl_audio_out.cpp src/core/libraries/audio/openal_audio_out.cpp src/core/libraries/audio/openal_manager.h - src/core/libraries/ngs2/ngs2.cpp - src/core/libraries/ngs2/ngs2.h - src/core/libraries/audio3d/audio3d.cpp - src/core/libraries/audio3d/audio3d_openal.cpp - src/core/libraries/audio3d/audio3d_openal.h - src/core/libraries/audio3d/audio3d.h - src/core/libraries/audio3d/audio3d_error.h ) set(GNM_LIB src/core/libraries/gnmdriver/gnmdriver.cpp @@ -440,55 +433,7 @@ set(SYSTEM_LIBS src/core/libraries/system/commondialog.cpp src/core/libraries/rtc/rtc.cpp src/core/libraries/rtc/rtc.h src/core/libraries/rtc/rtc_error.h - src/core/libraries/rudp/rudp.cpp - src/core/libraries/rudp/rudp.h - src/core/libraries/disc_map/disc_map.cpp - src/core/libraries/disc_map/disc_map.h - src/core/libraries/disc_map/disc_map_codes.h - src/core/libraries/ngs2/ngs2.cpp - src/core/libraries/ngs2/ngs2.h - src/core/libraries/ngs2/ngs2_error.h - src/core/libraries/ngs2/ngs2_impl.cpp - src/core/libraries/ngs2/ngs2_impl.h - src/core/libraries/ngs2/ngs2_custom.cpp - src/core/libraries/ngs2/ngs2_custom.h - src/core/libraries/ngs2/ngs2_reverb.cpp - src/core/libraries/ngs2/ngs2_reverb.h - src/core/libraries/ngs2/ngs2_geom.cpp - src/core/libraries/ngs2/ngs2_geom.h - src/core/libraries/ngs2/ngs2_pan.cpp - src/core/libraries/ngs2/ngs2_pan.h - src/core/libraries/ngs2/ngs2_report.cpp - src/core/libraries/ngs2/ngs2_report.h - src/core/libraries/ngs2/ngs2_eq.cpp - src/core/libraries/ngs2/ngs2_eq.h - src/core/libraries/ngs2/ngs2_mastering.cpp - src/core/libraries/ngs2/ngs2_mastering.h - src/core/libraries/ngs2/ngs2_sampler.cpp - src/core/libraries/ngs2/ngs2_sampler.h - src/core/libraries/ngs2/ngs2_submixer.cpp - src/core/libraries/ngs2/ngs2_submixer.h src/core/libraries/ajm/ajm_error.h - src/core/libraries/audio3d/audio3d.cpp - src/core/libraries/audio3d/audio3d.h - src/core/libraries/audio3d/audio3d_error.h - src/core/libraries/game_live_streaming/gamelivestreaming.cpp - src/core/libraries/game_live_streaming/gamelivestreaming.h - src/core/libraries/remote_play/remoteplay.cpp - src/core/libraries/remote_play/remoteplay.h - src/core/libraries/share_play/shareplay.cpp - src/core/libraries/share_play/shareplay.h - src/core/libraries/razor_cpu/razor_cpu.cpp - src/core/libraries/razor_cpu/razor_cpu.h - src/core/libraries/mouse/mouse.cpp - src/core/libraries/mouse/mouse.h - src/core/libraries/web_browser_dialog/webbrowserdialog.cpp - src/core/libraries/web_browser_dialog/webbrowserdialog.h - src/core/libraries/font/font.cpp - src/core/libraries/font/font.h - src/core/libraries/font/fontft.cpp - src/core/libraries/font/fontft.h - src/core/libraries/font/font_error.h ) @@ -500,21 +445,6 @@ set(VIDEOOUT_LIB src/core/libraries/videoout/buffer.h src/core/libraries/videoout/videoout_error.h ) -set(HLE_LIBC_INTERNAL_LIB src/core/libraries/libc_internal/libc_internal.cpp - src/core/libraries/libc_internal/libc_internal.h - src/core/libraries/libc_internal/libc_internal_io.cpp - src/core/libraries/libc_internal/libc_internal_io.h - src/core/libraries/libc_internal/libc_internal_memory.cpp - src/core/libraries/libc_internal/libc_internal_memory.h - src/core/libraries/libc_internal/libc_internal_str.cpp - src/core/libraries/libc_internal/libc_internal_str.h - src/core/libraries/libc_internal/libc_internal_math.cpp - src/core/libraries/libc_internal/libc_internal_math.h - src/core/libraries/libc_internal/libc_internal_threads.cpp - src/core/libraries/libc_internal/libc_internal_threads.h - src/core/libraries/libc_internal/printf.h -) - set(IME_LIB src/core/libraries/ime/error_dialog.cpp src/core/libraries/ime/error_dialog.h src/core/libraries/ime/ime_common.h @@ -539,19 +469,6 @@ set(SYSTEM_GESTURE_LIB src/core/libraries/system_gesture/system_gesture.h ) -set(PNG_LIB src/core/libraries/libpng/pngdec.cpp - src/core/libraries/libpng/pngdec.h - src/core/libraries/libpng/pngdec_error.h - src/core/libraries/libpng/pngenc.cpp - src/core/libraries/libpng/pngenc.h - src/core/libraries/libpng/pngenc_error.h -) - -set(JPEG_LIB src/core/libraries/jpeg/jpeg_error.h - src/core/libraries/jpeg/jpegenc.cpp - src/core/libraries/jpeg/jpegenc.h -) - set(PLAYGO_LIB src/core/libraries/playgo/playgo.cpp src/core/libraries/playgo/playgo.h src/core/libraries/playgo/playgo_dialog.cpp @@ -559,42 +476,8 @@ set(PLAYGO_LIB src/core/libraries/playgo/playgo.cpp src/core/libraries/playgo/playgo_types.h ) -set(RANDOM_LIB src/core/libraries/random/random.cpp - src/core/libraries/random/random.h - src/core/libraries/random/random_error.h -) - -set(USBD_LIB src/core/libraries/usbd/usbd.cpp - src/core/libraries/usbd/usbd.h - src/core/libraries/usbd/usb_backend.h - src/core/libraries/usbd/emulated/dimensions.cpp - src/core/libraries/usbd/emulated/dimensions.h - src/core/libraries/usbd/emulated/infinity.cpp - src/core/libraries/usbd/emulated/infinity.h - src/core/libraries/usbd/emulated/skylander.cpp - src/core/libraries/usbd/emulated/skylander.h -) - -set(FIBER_LIB src/core/libraries/fiber/fiber_context.s - src/core/libraries/fiber/fiber.cpp - src/core/libraries/fiber/fiber.h - src/core/libraries/fiber/fiber_error.h -) - set_source_files_properties(src/core/libraries/fiber/fiber_context.s PROPERTIES COMPILE_OPTIONS -Wno-unused-command-line-argument) -set(VDEC_LIB src/core/libraries/videodec/videodec2_impl.cpp - src/core/libraries/videodec/videodec2_impl.h - src/core/libraries/videodec/videodec2.cpp - src/core/libraries/videodec/videodec2.h - src/core/libraries/videodec/videodec2_avc.h - src/core/libraries/videodec/videodec.cpp - src/core/libraries/videodec/videodec.h - src/core/libraries/videodec/videodec_error.h - src/core/libraries/videodec/videodec_impl.cpp - src/core/libraries/videodec/videodec_impl.h -) - set(NP_LIBS src/core/libraries/np/np_error.h src/core/libraries/np/np_common.cpp src/core/libraries/np/np_common.h @@ -632,43 +515,10 @@ set(NP_LIBS src/core/libraries/np/np_error.h src/core/libraries/np/object_manager.h ) -set(ZLIB_LIB src/core/libraries/zlib/zlib.cpp - src/core/libraries/zlib/zlib_sce.h - src/core/libraries/zlib/zlib_error.h -) - -set(VR_LIBS src/core/libraries/hmd/hmd.cpp - src/core/libraries/hmd/hmd_reprojection.cpp - src/core/libraries/hmd/hmd_distortion.cpp - src/core/libraries/hmd/hmd.h - src/core/libraries/hmd/hmd_setup_dialog.cpp - src/core/libraries/hmd/hmd_setup_dialog.h - src/core/libraries/vr_tracker/vr_tracker.cpp - src/core/libraries/vr_tracker/vr_tracker.h -) - set(MISC_LIBS src/core/libraries/screenshot/screenshot.cpp src/core/libraries/screenshot/screenshot.h - src/core/libraries/move/move.cpp - src/core/libraries/move/move.h - src/core/libraries/move/move_error.h - src/core/libraries/ulobjmgr/ulobjmgr.cpp - src/core/libraries/ulobjmgr/ulobjmgr.h - src/core/libraries/signin_dialog/signindialog.cpp - src/core/libraries/signin_dialog/signindialog.h ) -set(CAMERA_LIBS src/core/libraries/camera/camera.cpp - src/core/libraries/camera/camera.h - src/core/libraries/camera/camera_error.h -) - -set(COMPANION_LIBS src/core/libraries/companion/companion_httpd.cpp - src/core/libraries/companion/companion_httpd.h - src/core/libraries/companion/companion_util.cpp - src/core/libraries/companion/companion_util.h - src/core/libraries/companion/companion_error.h -) set(DEV_TOOLS src/core/devtools/layer.cpp src/core/devtools/layer.h src/core/devtools/layer_extra.cpp @@ -846,19 +696,10 @@ set(CORE src/core/aerolib/stubs.cpp ${SYSTEM_GESTURE_LIB} ${VIDEOOUT_LIB} ${NP_LIBS} - ${PNG_LIB} - ${JPEG_LIB} ${PLAYGO_LIB} ${RANDOM_LIB} - ${USBD_LIB} - ${ZLIB_LIB} ${MISC_LIBS} ${IME_LIB} - ${FIBER_LIB} - ${VDEC_LIB} - ${VR_LIBS} - ${CAMERA_LIBS} - ${COMPANION_LIBS} ${DEV_TOOLS} src/core/debug_state.cpp src/core/debug_state.h @@ -1119,7 +960,7 @@ set(EMULATOR src/emulator.cpp if(NOT ENABLE_TESTS) -add_executable(shadps4 +add_executable(shadBloodborne ${AUDIO_CORE} ${IMGUI} ${INPUT} @@ -1135,38 +976,38 @@ add_executable(shadps4 src/sdl_window.cpp ) -create_target_directory_groups(shadps4) +create_target_directory_groups(shadBloodborne) -target_link_libraries(shadps4 PRIVATE magic_enum::magic_enum fmt::fmt toml11::toml11 tsl::robin_map xbyak::xbyak Tracy::TracyClient RenderDoc::API FFmpeg::ffmpeg Dear_ImGui gcn half::half ZLIB::ZLIB PNG::PNG) -target_link_libraries(shadps4 PRIVATE Boost::headers GPUOpen::VulkanMemoryAllocator LibAtrac9 sirit Vulkan::Headers xxHash::xxhash Zydis::Zydis glslang::glslang SDL3::SDL3 SDL3_mixer::SDL3_mixer pugixml::pugixml) -target_link_libraries(shadps4 PRIVATE stb::headers lfreist-hwinfo::hwinfo nlohmann_json::nlohmann_json miniz::miniz fdk-aac CLI11::CLI11 OpenAL::OpenAL Cpp_Httplib) +target_link_libraries(shadBloodborne PRIVATE magic_enum::magic_enum fmt::fmt toml11::toml11 tsl::robin_map xbyak::xbyak Tracy::TracyClient RenderDoc::API FFmpeg::ffmpeg Dear_ImGui gcn half::half ZLIB::ZLIB PNG::PNG) +target_link_libraries(shadBloodborne PRIVATE Boost::headers GPUOpen::VulkanMemoryAllocator LibAtrac9 sirit Vulkan::Headers xxHash::xxhash Zydis::Zydis glslang::glslang SDL3::SDL3 SDL3_mixer::SDL3_mixer pugixml::pugixml) +target_link_libraries(shadBloodborne PRIVATE stb::headers lfreist-hwinfo::hwinfo nlohmann_json::nlohmann_json miniz::miniz fdk-aac CLI11::CLI11 OpenAL::OpenAL Cpp_Httplib) if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD") - target_link_libraries(shadps4 PRIVATE "/usr/lib/libusb.so") - target_link_libraries(shadps4 PRIVATE "/usr/local/lib/libuuid.so") + target_link_libraries(shadBloodborne PRIVATE "/usr/lib/libusb.so") + target_link_libraries(shadBloodborne PRIVATE "/usr/local/lib/libuuid.so") else() - target_link_libraries(shadps4 PRIVATE libusb::usb) + target_link_libraries(shadBloodborne PRIVATE libusb::usb) endif() -target_compile_definitions(shadps4 PRIVATE IMGUI_USER_CONFIG="imgui/imgui_config.h") +target_compile_definitions(shadBloodborne PRIVATE IMGUI_USER_CONFIG="imgui/imgui_config.h") target_compile_definitions(Dear_ImGui PRIVATE IMGUI_USER_CONFIG="${PROJECT_SOURCE_DIR}/src/imgui/imgui_config.h") if (ENABLE_DISCORD_RPC) - target_compile_definitions(shadps4 PRIVATE ENABLE_DISCORD_RPC) + target_compile_definitions(shadBloodborne PRIVATE ENABLE_DISCORD_RPC) endif() if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") - # Optional due to https://github.com/shadps4-emu/shadPS4/issues/1704 + # Optional due to https://github.com/shadBloodborne-emu/shadBloodborne/issues/1704 if (ENABLE_USERFAULTFD) - target_compile_definitions(shadps4 PRIVATE ENABLE_USERFAULTFD) + target_compile_definitions(shadBloodborne PRIVATE ENABLE_USERFAULTFD) endif() - target_link_libraries(shadps4 PRIVATE uuid) + target_link_libraries(shadBloodborne PRIVATE uuid) endif() if (APPLE) # Include MoltenVK, along with an ICD file so it can be found by the system Vulkan loader if used for loading layers. - set_property(TARGET shadps4 APPEND PROPERTY BUILD_RPATH "@executable_path") + set_property(TARGET shadBloodborne APPEND PROPERTY BUILD_RPATH "@executable_path") set(MVK_DST ${CMAKE_CURRENT_BINARY_DIR}) set(MVK_DYLIB_SRC ${CMAKE_CURRENT_BINARY_DIR}/externals/MoltenVK/MoltenVK/libMoltenVK.dylib) set(MVK_DYLIB_DST ${MVK_DST}/libMoltenVK.dylib) @@ -1183,21 +1024,21 @@ if (APPLE) COMMAND ${CMAKE_COMMAND} -E copy ${MVK_DYLIB_SRC} ${MVK_DYLIB_DST}) add_custom_target(CopyMoltenVK DEPENDS ${MVK_ICD_DST} ${MVK_DYLIB_DST}) add_dependencies(CopyMoltenVK MoltenVK) - add_dependencies(shadps4 CopyMoltenVK) + add_dependencies(shadBloodborne CopyMoltenVK) if (ARCHITECTURE STREQUAL "x86_64") # Reserve system-managed memory space. - target_link_options(shadps4 PRIVATE -Wl,-ld_classic,-no_pie,-no_fixup_chains,-no_huge,-pagezero_size,0x4000,-segaddr,TCB_SPACE,0x4000,-segaddr,SYSTEM_MANAGED,0x400000,-segaddr,SYSTEM_RESERVED,0x7FFFFC000,-segaddr,USER_AREA,0x7000000000,-image_base,0x700000000000) + target_link_options(shadBloodborne PRIVATE -Wl,-ld_classic,-no_pie,-no_fixup_chains,-no_huge,-pagezero_size,0x4000,-segaddr,TCB_SPACE,0x4000,-segaddr,SYSTEM_MANAGED,0x400000,-segaddr,SYSTEM_RESERVED,0x7FFFFC000,-segaddr,USER_AREA,0x7000000000,-image_base,0x700000000000) endif() # Replacement for std::chrono::time_zone - target_link_libraries(shadps4 PRIVATE date::date-tz epoll-shim) + target_link_libraries(shadBloodborne PRIVATE date::date-tz epoll-shim) elseif (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD") - target_link_libraries(shadps4 PRIVATE date::date-tz epoll-shim) + target_link_libraries(shadBloodborne PRIVATE date::date-tz epoll-shim) endif() if (WIN32) - target_link_libraries(shadps4 PRIVATE mincore wepoll wbemuuid) + target_link_libraries(shadBloodborne PRIVATE mincore wepoll wbemuuid) if (MSVC) # MSVC likes putting opinions on what people can use, disable: @@ -1215,45 +1056,45 @@ if (WIN32) add_compile_definitions(NTDDI_VERSION=0x0A000006 _WIN32_WINNT=0x0A00 WINVER=0x0A00) if (MSVC) - target_link_libraries(shadps4 PRIVATE clang_rt.builtins-x86_64.lib) + target_link_libraries(shadBloodborne PRIVATE clang_rt.builtins-x86_64.lib) endif() # Disable ASLR so we can reserve the user area if (MSVC) - target_link_options(shadps4 PRIVATE /DYNAMICBASE:NO) + target_link_options(shadBloodborne PRIVATE /DYNAMICBASE:NO) else() - target_link_options(shadps4 PRIVATE -Wl,--disable-dynamicbase) + target_link_options(shadBloodborne PRIVATE -Wl,--disable-dynamicbase) endif() # Increase stack commit area (Needed, otherwise there are crashes) if (MSVC) - target_link_options(shadps4 PRIVATE /STACK:0x200000,0x200000) + target_link_options(shadBloodborne PRIVATE /STACK:0x200000,0x200000) else() - target_link_options(shadps4 PRIVATE -Wl,--stack,2097152) + target_link_options(shadBloodborne PRIVATE -Wl,--stack,2097152) endif() # Change base image address if (MSVC) - target_link_options(shadps4 PRIVATE /BASE:0x700000000000) + target_link_options(shadBloodborne PRIVATE /BASE:0x700000000000) else() - target_link_options(shadps4 PRIVATE -Wl,--image-base=0x700000000000) + target_link_options(shadBloodborne PRIVATE -Wl,--image-base=0x700000000000) endif() endif() if (WIN32) - target_sources(shadps4 PRIVATE src/shadps4.rc) + target_sources(shadBloodborne PRIVATE src/shadBloodborne.rc) endif() add_compile_definitions(BOOST_ASIO_STANDALONE) -target_include_directories(shadps4 PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories(shadBloodborne PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) # Shaders sources set(HOST_SHADERS_INCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/src/video_core/host_shaders) add_subdirectory(${HOST_SHADERS_INCLUDE}) -add_dependencies(shadps4 host_shaders) -target_include_directories(shadps4 PRIVATE ${HOST_SHADERS_INCLUDE}) +add_dependencies(shadBloodborne host_shaders) +target_include_directories(shadBloodborne PRIVATE ${HOST_SHADERS_INCLUDE}) # embed resources @@ -1266,21 +1107,21 @@ cmrc_add_resource_library(embedded-resources src/images/gold.png src/images/platinum.png src/images/silver.png) -target_link_libraries(shadps4 PRIVATE res::embedded) +target_link_libraries(shadBloodborne PRIVATE res::embedded) # ImGui resources add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/imgui/renderer) -add_dependencies(shadps4 ImGui_Resources) -target_include_directories(shadps4 PRIVATE ${IMGUI_RESOURCES_INCLUDE}) +add_dependencies(shadBloodborne ImGui_Resources) +target_include_directories(shadBloodborne PRIVATE ${IMGUI_RESOURCES_INCLUDE}) # Discord RPC if (ENABLE_DISCORD_RPC) - target_link_libraries(shadps4 PRIVATE discord-rpc) + target_link_libraries(shadBloodborne PRIVATE discord-rpc) endif() # Install rules -install(TARGETS shadps4 BUNDLE DESTINATION .) +install(TARGETS shadBloodborne BUNDLE DESTINATION .) else() enable_testing() diff --git a/README.md b/README.md index 0fb5c26ed..61f00ae35 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,9 @@ SPDX-License-Identifier: GPL-2.0-or-later


- +
- shadPS4 + shadBloodborne

@@ -24,43 +24,43 @@ SPDX-License-Identifier: GPL-2.0-or-later -| Bloodborne by From Software | Hatsune Miku Project DIVA Future Tone by SEGA | +| Bloodborne by From Software | Bloodborne by From Software | | :-----------------------------------------------------------: | :--------------------------------------------------------------------------------------------: | -| ![Bloodborne screenshot](./documents/Screenshots/1.png) | ![Project DIVA screenshot](./documents/Screenshots/2.png) | +| ![Bloodborne screenshot](./documents/Screenshots/1.png) | ![Bloodborne screenshot](./documents/Screenshots/2.png) | -| Yakuza 0 by SEGA | DRIVECLUBâ„¢ by Evolution Studios | +| Bloodborne by From Software | Bloodborne by From Software | | :------------------------------------------------------------------------: | :------------------------------------------------------------------: | -| ![Yakuza screenshot](./documents/Screenshots/3.png) | ![DRIVECLUB screenshot](./documents/Screenshots/4.png) | +| ![Bloodborne screenshot](./documents/Screenshots/3.png) | ![Bloodborne screenshot](./documents/Screenshots/4.png) | # General information -**shadPS4** is an early **PlayStation 4** emulator for **Windows**, **Linux** and **macOS** written in C++. +**shadBloodborne** is an early **Bloodborne** emulator for **Windows**, **Linux**, **macOS** and **FreeBSD** written in C++. > [!IMPORTANT] > This is the emulator core, which does not include a GUI. If you just want to use the emulator as an end user, download the [**QtLauncher**](https://github.com/shadps4-emu/shadps4-qtlauncher/releases) instead. If you encounter problems or have doubts, do not hesitate to look at the [**Quickstart**](https://github.com/shadps4-emu/shadPS4/wiki/I.-Quick-start-%5BUsers%5D).\ -To verify that a game works, you can look at [**shadPS4 Game Compatibility**](https://github.com/shadps4-compatibility/shadps4-game-compatibility).\ -To discuss shadPS4 development, suggest ideas or to ask for help, join our [**Discord server**](https://discord.gg/bFJxfftGW6).\ +To verify that Bloodborne works, you can look at [**bloodbornePS4 Compatibility Status**](https://github.com/shadps4-compatibility/shadps4-game-compatibility/issues?q=is%3Aissue%20state%3Aopen%20in%3Atitle%20%22bloodborne%22).\ +To discuss shadBloodborne development, suggest ideas or to ask for help, join our [**Discord server**](https://discord.gg/bFJxfftGW6).\ To get the latest news, go to our [**X (Twitter)**](https://x.com/shadps4) or our [**website**](https://shadps4.net/).\ You can donate to the project via our [**Kofi page**](https://ko-fi.com/shadps4). # Status > [!IMPORTANT] -> shadPS4 is early in development, don't expect a flawless experience. +> shadBloodborne is early in development, don't expect a flawless experience. -Currently, the emulator can successfully run games like [**Bloodborne**](https://www.youtube.com/watch?v=5sZgWyVflFM), [**Dark Souls Remastered**](https://www.youtube.com/watch?v=-3PA-Xwszts), [**Red Dead Redemption**](https://www.youtube.com/watch?v=Al7yz_5nLag), and many other games. +Currently, the emulator can successfully run [**Bloodborne**](https://www.youtube.com/watch?v=5sZgWyVflFM), but not every feature is fully emulated. # Why -This project began for fun. Given our limited free time, it may take some time before shadPS4 can run more complex games, but we're committed to making small, regular updates. +This project began for fun. Given our limited free time, it may take some time before shadBloodborne can do Bloodborne multiplayer, but we're committed to making small, regular updates. # Building ## Docker -For building shadPS4 in a containerized environment using Docker and VSCode, check the instructions here: +For building shadBloodborne in a containerized environment using Docker and VSCode, check the instructions here: [**Docker Build Instructions**](https://github.com/shadps4-emu/shadPS4/blob/main/documents/building-docker.md) ## Windows @@ -76,7 +76,7 @@ Check the build instructions for [**Linux**](https://github.com/shadps4-emu/shad Check the build instructions for [**macOS**](https://github.com/shadps4-emu/shadPS4/blob/main/documents/building-macos.md). > [!IMPORTANT] -> macOS users need at least macOS 15.4 to run shadPS4. Due to GPU issues there are currently heavy bugs on Intel Macs. +> macOS users need at least macOS 15.4 to run shadBloodborne. Due to GPU issues there are currently heavy bugs on Intel Macs. # Usage examples @@ -87,11 +87,11 @@ To get the list of all available commands and also a more detailed description o Below is a list of commonly used command patterns: ```sh -shadPS4 CUSA00001 # Searches for a game folder called CUSA00001 in the list of game install folders, and boots it. -shadPS4 --fullscreen true --config-clean CUSA00001 # the game argument is always the last one, -shadPS4 -g CUSA00001 --fullscreen true --config-clean # ...unless manually specified otherwise. -shadPS4 /path/to/game.elf # Boots a PS4 ELF file directly. Useful if you want to boot an executable that is not named eboot.bin. -shadPS4 CUSA00001 -- -flag1 -flag2 # Passes '-flag1' and '-flag2' to the game executable in argv. +shadBloodborne CUSA00900 # Searches for a game folder called CUSA00900 in the list of game install folders, and boots it. +shadBloodborne --fullscreen true --config-clean CUSA00900 # the game argument is always the last one, +shadBloodborne -g CUSA00900 --fullscreen true --config-clean # ...unless manually specified otherwise. +shadBloodborne /path/to/game.elf # Boots a PS4 ELF file directly. Useful if you want to boot an executable that is not named eboot.bin. +shadBloodborne CUSA00900 -- -flag1 -flag2 # Passes '-flag1' and '-flag2' to the game executable in argv. ``` # Debugging and reporting issues @@ -145,36 +145,26 @@ Keyboard and mouse inputs can be customized in the settings menu by clicking the # Firmware files -shadPS4 can load some PlayStation 4 firmware files. -The following firmware modules are supported and must be placed in shadPS4's `sys_modules` folder. +shadBloodborne can load some PlayStation 4 firmware files. +The following firmware modules are supported and must be placed in shadBloodborne's `sys_modules` folder.
-| Modules | Modules | Modules | Modules | -|-------------------------|-------------------------|-------------------------|-------------------------| -| libSceCesCs.sprx | libSceFont.sprx | libSceFontFt.sprx | libSceFreeTypeOt.sprx | -| libSceJpegDec.sprx | libSceJpegEnc.sprx | libSceJson.sprx | libSceJson2.sprx | -| libSceLibcInternal.sprx | libSceNgs2.sprx | libScePngEnc.sprx | libSceRtc.sprx | -| libSceUlt.sprx | libSceAudiodec.sprx | | | +| Modules | Modules | +|-------------------------|-------------------------| +| libSceLibcInternal.sprx | libSceRtc.sprx |
> [!Caution] -> The above modules are required to run the games properly and must be dumped from your legally owned PlayStation 4 console. +> The above modules are required to run the game properly and must be dumped from your legally owned PlayStation 4 console. # Main team -- [**georgemoralis**](https://github.com/georgemoralis) -- [**psucien**](https://github.com/psucien) -- [**viniciuslrangel**](https://github.com/viniciuslrangel) -- [**roamic**](https://github.com/roamic) -- [**squidbus**](https://github.com/squidbus) -- [**frodo**](https://github.com/baggins183) -- [**Stephen Miller**](https://github.com/StevenMiller123) - [**kalaposfos13**](https://github.com/kalaposfos13) -Logo is done by [**Xphalnos**](https://github.com/Xphalnos) +Logo is done by [**Tlarok**](https://github.com/tlarok) # Contributing diff --git a/REUSE.toml b/REUSE.toml index e8997f007..ec248da2e 100644 --- a/REUSE.toml +++ b/REUSE.toml @@ -10,6 +10,7 @@ path = [ "CMakeWindowsPresets.json", "CMakePresets.json", ".github/FUNDING.yml", + ".github/shadBloodborne.png", ".github/shadps4.png", ".gitmodules", "dist/MacOSBundleInfo.plist.in", @@ -61,6 +62,7 @@ path = [ "src/images/utils_icon.png", "src/images/shadPS4.icns", "src/images/shadps4.ico", + "src/images/shadBloodborne.png", "src/images/shadps4.png", "src/images/net.shadps4.shadPS4.svg", "src/images/themes_icon.png", diff --git a/documents/Screenshots/2.png b/documents/Screenshots/2.png index 7f701916a..0b03747f8 100644 Binary files a/documents/Screenshots/2.png and b/documents/Screenshots/2.png differ diff --git a/documents/Screenshots/3.png b/documents/Screenshots/3.png index e6e83bf9d..150a7bb27 100644 Binary files a/documents/Screenshots/3.png and b/documents/Screenshots/3.png differ diff --git a/documents/Screenshots/4.png b/documents/Screenshots/4.png index 1268795a9..5bbc069c1 100644 Binary files a/documents/Screenshots/4.png and b/documents/Screenshots/4.png differ diff --git a/src/common/adaptive_mutex.h b/src/common/adaptive_mutex.h index 247d4c1ec..78a609294 100644 --- a/src/common/adaptive_mutex.h +++ b/src/common/adaptive_mutex.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/common/arch.h b/src/common/arch.h index b22366cb7..4cd6a9452 100644 --- a/src/common/arch.h +++ b/src/common/arch.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/common/bit_array.h b/src/common/bit_array.h index 0ab464390..f82225b4f 100644 --- a/src/common/bit_array.h +++ b/src/common/bit_array.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/common/config.cpp b/src/common/config.cpp index 79d3f799f..7631fc79a 100644 --- a/src/common/config.cpp +++ b/src/common/config.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include @@ -142,7 +142,7 @@ static ConfigEntry trophyNotificationDuration(6.0); static ConfigEntry logFilter(""); static ConfigEntry logType("sync"); static ConfigEntry isIdenticalLogGrouped(true); -static ConfigEntry userName("shadPS4"); +static ConfigEntry userName("shadBloodborne"); static ConfigEntry isShowSplash(false); static ConfigEntry isSideTrophy("right"); static ConfigEntry isConnectedToNetwork(false); @@ -1236,7 +1236,7 @@ void setDefaultValues(bool is_game_specific) { logFilter.set("", is_game_specific); logType.set("sync", is_game_specific); isIdenticalLogGrouped.set("isIdenticalLogGrouped", is_game_specific); - userName.set("shadPS4", is_game_specific); + userName.set("shadBloodborne", is_game_specific); isShowSplash.set(false, is_game_specific); isSideTrophy.set("right", is_game_specific); diff --git a/src/common/config.h b/src/common/config.h index b341030e0..4ec551674 100644 --- a/src/common/config.h +++ b/src/common/config.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/common/cstring.h b/src/common/cstring.h index 45c291c14..9316419af 100644 --- a/src/common/cstring.h +++ b/src/common/cstring.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/common/debug.h b/src/common/debug.h index 92bf72550..55acf7e2b 100644 --- a/src/common/debug.h +++ b/src/common/debug.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/common/decoder.cpp b/src/common/decoder.cpp index aeaba3ca6..2474e8087 100644 --- a/src/common/decoder.cpp +++ b/src/common/decoder.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/common/decoder.h b/src/common/decoder.h index a5dadbf19..e274e49ef 100644 --- a/src/common/decoder.h +++ b/src/common/decoder.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/common/discord_rpc_handler.cpp b/src/common/discord_rpc_handler.cpp index 448cb4a7f..2a5a32566 100644 --- a/src/common/discord_rpc_handler.cpp +++ b/src/common/discord_rpc_handler.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include @@ -18,7 +18,7 @@ void RPC::init() { void RPC::setStatusIdling() { DiscordRichPresence rpc{}; rpc.largeImageKey = "https://cdn.jsdelivr.net/gh/shadps4-emu/shadPS4@main/.github/shadps4.png"; - rpc.largeImageText = "shadPS4 is a PS4 emulator"; + rpc.largeImageText = "shadBloodborne is a Bloodborne emulator"; rpc.startTimestamp = startTimestamp; rpc.details = "Idle"; diff --git a/src/common/discord_rpc_handler.h b/src/common/discord_rpc_handler.h index 1e451e181..dd8b39e2d 100644 --- a/src/common/discord_rpc_handler.h +++ b/src/common/discord_rpc_handler.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/common/elf_info.h b/src/common/elf_info.h index 8f79c9e69..16d804464 100644 --- a/src/common/elf_info.h +++ b/src/common/elf_info.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/common/endian.h b/src/common/endian.h index 4b0b70cdd..afe6e2c39 100644 --- a/src/common/endian.h +++ b/src/common/endian.h @@ -1,10 +1,10 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later /** * (c) 2014-2016 Alexandro Sanchez Bach. All rights reserved. * Released under GPL v2 license. Read LICENSE for more details. - * Some modifications for using with shadps4 by georgemoralis + * Some modifications for using with shadBloodborne by georgemoralis */ #pragma once diff --git a/src/common/enum.h b/src/common/enum.h index a2f08772c..c3123b2fe 100644 --- a/src/common/enum.h +++ b/src/common/enum.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/common/fixed_value.h b/src/common/fixed_value.h index e32a795f2..4c08365c7 100644 --- a/src/common/fixed_value.h +++ b/src/common/fixed_value.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/common/func_traits.h b/src/common/func_traits.h index 407b2dbe6..4aa7dc633 100644 --- a/src/common/func_traits.h +++ b/src/common/func_traits.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/common/hash.h b/src/common/hash.h index d5cacedd7..afd4e253e 100644 --- a/src/common/hash.h +++ b/src/common/hash.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp index 5de4f64a0..574767358 100644 --- a/src/common/logging/backend.cpp +++ b/src/common/logging/backend.cpp @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: Copyright 2014 Citra Emulator Project -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include @@ -275,7 +275,7 @@ private: void StartBackendThread() { backend_thread = std::jthread([this](std::stop_token stop_token) { - Common::SetCurrentThreadName("shadPS4:Log"); + Common::SetCurrentThreadName("sB:Log"); Entry entry; const auto write_logs = [this, &entry]() { ForEachBackend([&entry](auto& backend) { backend.Write(entry); }); diff --git a/src/common/logging/filter.cpp b/src/common/logging/filter.cpp index fd48faf72..ce3b67be8 100644 --- a/src/common/logging/filter.cpp +++ b/src/common/logging/filter.cpp @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: Copyright 2014 Citra Emulator Project -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/common/logging/text_formatter.cpp b/src/common/logging/text_formatter.cpp index e8c5f4979..5df259da4 100644 --- a/src/common/logging/text_formatter.cpp +++ b/src/common/logging/text_formatter.cpp @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: Copyright 2014 Citra Emulator Project -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/common/logging/types.h b/src/common/logging/types.h index 2c6edef3b..d911c087f 100644 --- a/src/common/logging/types.h +++ b/src/common/logging/types.h @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: Copyright 2023 Citra Emulator Project -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/common/memory_patcher.cpp b/src/common/memory_patcher.cpp index 2517e3f22..019b2d3cd 100644 --- a/src/common/memory_patcher.cpp +++ b/src/common/memory_patcher.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/common/memory_patcher.h b/src/common/memory_patcher.h index 5a67beec5..822f7c0b1 100644 --- a/src/common/memory_patcher.h +++ b/src/common/memory_patcher.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/common/ntapi.cpp b/src/common/ntapi.cpp index 46ec57e0a..4fd521b55 100644 --- a/src/common/ntapi.cpp +++ b/src/common/ntapi.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #ifdef _WIN32 diff --git a/src/common/ntapi.h b/src/common/ntapi.h index c876af58f..3892dc921 100644 --- a/src/common/ntapi.h +++ b/src/common/ntapi.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/common/number_utils.cpp b/src/common/number_utils.cpp index 121437a23..4a2394689 100644 --- a/src/common/number_utils.cpp +++ b/src/common/number_utils.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/common/number_utils.h b/src/common/number_utils.h index 05c62a1cb..87bc27474 100644 --- a/src/common/number_utils.h +++ b/src/common/number_utils.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/common/object_pool.h b/src/common/object_pool.h index 9e25e0c4c..c012fbfb1 100644 --- a/src/common/object_pool.h +++ b/src/common/object_pool.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/common/path_util.cpp b/src/common/path_util.cpp index 103f17d29..f690bca83 100644 --- a/src/common/path_util.cpp +++ b/src/common/path_util.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include @@ -91,18 +91,18 @@ static auto UserPaths = [] { // NOTE: On Windows we currently just create the portable directory instead. #ifdef __APPLE__ user_dir = - std::filesystem::path(getenv("HOME")) / "Library" / "Application Support" / "shadPS4"; + std::filesystem::path(getenv("HOME")) / "Library" / "Application Support" / "shadBloodborne"; #elif defined(__linux__) const char* xdg_data_home = getenv("XDG_DATA_HOME"); if (xdg_data_home != nullptr && strlen(xdg_data_home) > 0) { - user_dir = std::filesystem::path(xdg_data_home) / "shadPS4"; + user_dir = std::filesystem::path(xdg_data_home) / "shadBloodborne"; } else { - user_dir = std::filesystem::path(getenv("HOME")) / ".local" / "share" / "shadPS4"; + user_dir = std::filesystem::path(getenv("HOME")) / ".local" / "share" / "shadBloodborne"; } #elif _WIN32 TCHAR appdata[MAX_PATH] = {0}; SHGetFolderPath(NULL, CSIDL_APPDATA, NULL, 0, appdata); - user_dir = std::filesystem::path(appdata) / "shadPS4"; + user_dir = std::filesystem::path(appdata) / "shadBloodborne"; #endif } diff --git a/src/common/path_util.h b/src/common/path_util.h index 485c72270..714379c5c 100644 --- a/src/common/path_util.h +++ b/src/common/path_util.h @@ -10,7 +10,7 @@ namespace Common::FS { enum class PathType { - UserDir, // Where shadPS4 stores its data. + UserDir, // Where shadBloodborne stores its data. LogDir, // Where log files are stored. ScreenshotsDir, // Where screenshots are stored. ShaderDir, // Where shaders are stored. diff --git a/src/common/range_lock.h b/src/common/range_lock.h index efe6eb549..4f24fed6e 100644 --- a/src/common/range_lock.h +++ b/src/common/range_lock.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/common/recursive_lock.cpp b/src/common/recursive_lock.cpp index 2471a2ee0..00f9987ee 100644 --- a/src/common/recursive_lock.cpp +++ b/src/common/recursive_lock.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/common/recursive_lock.h b/src/common/recursive_lock.h index 5a5fc6658..8855b20c1 100644 --- a/src/common/recursive_lock.h +++ b/src/common/recursive_lock.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/common/scm_rev.cpp.in b/src/common/scm_rev.cpp.in index 0b113eb31..85e21160c 100644 --- a/src/common/scm_rev.cpp.in +++ b/src/common/scm_rev.cpp.in @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/common/scm_rev.h b/src/common/scm_rev.h index 2f6d770bb..5e8420cd9 100644 --- a/src/common/scm_rev.h +++ b/src/common/scm_rev.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/common/serdes.h b/src/common/serdes.h index f91a0ace8..f034dfde1 100644 --- a/src/common/serdes.h +++ b/src/common/serdes.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/common/shared_first_mutex.h b/src/common/shared_first_mutex.h index fcf9d0c4f..b507bf85b 100644 --- a/src/common/shared_first_mutex.h +++ b/src/common/shared_first_mutex.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/common/signal_context.cpp b/src/common/signal_context.cpp index b1ac8d96f..32b012b1b 100644 --- a/src/common/signal_context.cpp +++ b/src/common/signal_context.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/arch.h" diff --git a/src/common/signal_context.h b/src/common/signal_context.h index b09da64f2..23ff611ed 100644 --- a/src/common/signal_context.h +++ b/src/common/signal_context.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/common/singleton.h b/src/common/singleton.h index 0838980b5..9fb6f2046 100644 --- a/src/common/singleton.h +++ b/src/common/singleton.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/common/slab_heap.h b/src/common/slab_heap.h index 7648ebea3..7bddf9f79 100644 --- a/src/common/slab_heap.h +++ b/src/common/slab_heap.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/common/slot_array.h b/src/common/slot_array.h index 3a57899c2..1edd0ea33 100644 --- a/src/common/slot_array.h +++ b/src/common/slot_array.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later // #include diff --git a/src/common/stb.cpp b/src/common/stb.cpp index 0cd916185..125c3d62f 100644 --- a/src/common/stb.cpp +++ b/src/common/stb.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #define STB_IMAGE_IMPLEMENTATION diff --git a/src/common/stb.h b/src/common/stb.h index 6f4d34483..1f74a251e 100644 --- a/src/common/stb.h +++ b/src/common/stb.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/common/string_literal.h b/src/common/string_literal.h index 9f64f62bd..1644d67df 100644 --- a/src/common/string_literal.h +++ b/src/common/string_literal.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/common/support/avdec.h b/src/common/support/avdec.h index fa3483dc4..51e05e395 100644 --- a/src/common/support/avdec.h +++ b/src/common/support/avdec.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/common/thread.cpp b/src/common/thread.cpp index e56953fb6..d08bb4eb9 100644 --- a/src/common/thread.cpp +++ b/src/common/thread.cpp @@ -1,6 +1,6 @@ // SPDX-FileCopyrightText: 2013 Dolphin Emulator Project // SPDX-FileCopyrightText: 2014 Citra Emulator Project -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/common/thread.h b/src/common/thread.h index a300d10c3..b50d55068 100644 --- a/src/common/thread.h +++ b/src/common/thread.h @@ -1,6 +1,6 @@ // SPDX-FileCopyrightText: 2013 Dolphin Emulator Project // SPDX-FileCopyrightText: 2014 Citra Emulator Project -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/common/types.h b/src/common/types.h index c2b7bd35e..b59b16217 100644 --- a/src/common/types.h +++ b/src/common/types.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/common/va_ctx.h b/src/common/va_ctx.h index cffe468ff..c21582a29 100644 --- a/src/common/va_ctx.h +++ b/src/common/va_ctx.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/address_space.cpp b/src/core/address_space.cpp index 4830f65a5..406742f1a 100644 --- a/src/core/address_space.cpp +++ b/src/core/address_space.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include @@ -43,7 +43,7 @@ constexpr VAddr SYSTEM_RESERVED_MAX = 0xFFFFFFFFFULL; constexpr VAddr USER_MIN = 0x1000000000ULL; #endif #if defined(__linux__) -// Linux maps the shadPS4 executable around here, so limit the user maximum +// Linux maps the shadBloodborne executable around here, so limit the user maximum constexpr VAddr USER_MAX = 0x54FFFFFFFFFFULL; #else constexpr VAddr USER_MAX = 0x5FFFFFFFFFFFULL; diff --git a/src/core/address_space.h b/src/core/address_space.h index b71f66f28..cec584bb9 100644 --- a/src/core/address_space.h +++ b/src/core/address_space.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/aerolib/aerolib.cpp b/src/core/aerolib/aerolib.cpp index b9e014315..25d43baa1 100644 --- a/src/core/aerolib/aerolib.cpp +++ b/src/core/aerolib/aerolib.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/aerolib/aerolib.h b/src/core/aerolib/aerolib.h index c3dcf6482..182fa61e2 100644 --- a/src/core/aerolib/aerolib.h +++ b/src/core/aerolib/aerolib.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/aerolib/aerolib.inl b/src/core/aerolib/aerolib.inl index 64ee32ea2..ef17aaa91 100644 --- a/src/core/aerolib/aerolib.inl +++ b/src/core/aerolib/aerolib.inl @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later // generated using ps4_names2stubs.py diff --git a/src/core/aerolib/stubs.cpp b/src/core/aerolib/stubs.cpp index 7023144d7..2fcbb833e 100644 --- a/src/core/aerolib/stubs.cpp +++ b/src/core/aerolib/stubs.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/logging/log.h" diff --git a/src/core/aerolib/stubs.h b/src/core/aerolib/stubs.h index 70cc9b644..68c5cd6bc 100644 --- a/src/core/aerolib/stubs.h +++ b/src/core/aerolib/stubs.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/cpu_patches.cpp b/src/core/cpu_patches.cpp index f6a4f7620..32ca75241 100644 --- a/src/core/cpu_patches.cpp +++ b/src/core/cpu_patches.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/cpu_patches.h b/src/core/cpu_patches.h index 7a0546046..48217da66 100644 --- a/src/core/cpu_patches.h +++ b/src/core/cpu_patches.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/debug_state.cpp b/src/core/debug_state.cpp index 3cc6010b5..561ce150f 100644 --- a/src/core/debug_state.cpp +++ b/src/core/debug_state.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/debug_state.h b/src/core/debug_state.h index dbdc08c9c..00af12c52 100644 --- a/src/core/debug_state.h +++ b/src/core/debug_state.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/debugger.cpp b/src/core/debugger.cpp index b396a3ba5..320e71516 100644 --- a/src/core/debugger.cpp +++ b/src/core/debugger.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "debugger.h" diff --git a/src/core/debugger.h b/src/core/debugger.h index 21be1826a..734d70949 100644 --- a/src/core/debugger.h +++ b/src/core/debugger.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/devtools/gcn/gcn_context_regs.cpp b/src/core/devtools/gcn/gcn_context_regs.cpp index 5a591111e..57070e358 100644 --- a/src/core/devtools/gcn/gcn_context_regs.cpp +++ b/src/core/devtools/gcn/gcn_context_regs.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later // Credits to https://github.com/psucien/tlg-emu-tools/ diff --git a/src/core/devtools/gcn/gcn_op_names.cpp b/src/core/devtools/gcn/gcn_op_names.cpp index 6684b660e..3e8a4aab1 100644 --- a/src/core/devtools/gcn/gcn_op_names.cpp +++ b/src/core/devtools/gcn/gcn_op_names.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later // Credits to https://github.com/psucien/tlg-emu-tools/ diff --git a/src/core/devtools/gcn/gcn_shader_regs.cpp b/src/core/devtools/gcn/gcn_shader_regs.cpp index 16778dd07..70241fc50 100644 --- a/src/core/devtools/gcn/gcn_shader_regs.cpp +++ b/src/core/devtools/gcn/gcn_shader_regs.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later // Credits to https://github.com/psucien/tlg-emu-tools/ diff --git a/src/core/devtools/help.txt b/src/core/devtools/help.txt index 9670c5cea..ae2d84261 100644 --- a/src/core/devtools/help.txt +++ b/src/core/devtools/help.txt @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later R"( * If you hold shift, you can move the window without docking it. diff --git a/src/core/devtools/layer.cpp b/src/core/devtools/layer.cpp index 10e5f911c..6ccb22121 100644 --- a/src/core/devtools/layer.cpp +++ b/src/core/devtools/layer.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "layer.h" diff --git a/src/core/devtools/layer.h b/src/core/devtools/layer.h index 761135baf..9fd5781af 100644 --- a/src/core/devtools/layer.h +++ b/src/core/devtools/layer.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/devtools/layer_extra.cpp b/src/core/devtools/layer_extra.cpp index d5e55302d..ff239fafe 100644 --- a/src/core/devtools/layer_extra.cpp +++ b/src/core/devtools/layer_extra.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "layer.h" diff --git a/src/core/devtools/options.cpp b/src/core/devtools/options.cpp index b4915f28a..53e37cb8a 100644 --- a/src/core/devtools/options.cpp +++ b/src/core/devtools/options.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "options.h" diff --git a/src/core/devtools/options.h b/src/core/devtools/options.h index a859a2eec..905d14333 100644 --- a/src/core/devtools/options.h +++ b/src/core/devtools/options.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/devtools/widget/cmd_list.cpp b/src/core/devtools/widget/cmd_list.cpp index 3f83394b6..3fbe05062 100644 --- a/src/core/devtools/widget/cmd_list.cpp +++ b/src/core/devtools/widget/cmd_list.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later // Credits to https://github.com/psucien/tlg-emu-tools/ diff --git a/src/core/devtools/widget/cmd_list.h b/src/core/devtools/widget/cmd_list.h index d6344afb9..c5db41bbb 100644 --- a/src/core/devtools/widget/cmd_list.h +++ b/src/core/devtools/widget/cmd_list.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later // Credits to https://github.com/psucien/tlg-emu-tools/ diff --git a/src/core/devtools/widget/common.h b/src/core/devtools/widget/common.h index 1c79ffcac..df1bb226a 100644 --- a/src/core/devtools/widget/common.h +++ b/src/core/devtools/widget/common.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once @@ -140,7 +140,7 @@ inline std::string RunDisassembler(const std::string& disassembler_cli, const T& *success = false; } } else { - auto bin_path = std::filesystem::temp_directory_path() / "shadps4_tmp_shader.bin"; + auto bin_path = std::filesystem::temp_directory_path() / "shadBloodborne_tmp_shader.bin"; constexpr std::string_view src_arg = "{src}"; std::string cli = disassembler_cli + " 2>&1"; diff --git a/src/core/devtools/widget/frame_dump.cpp b/src/core/devtools/widget/frame_dump.cpp index 06b65b0ba..c8dfd03e3 100644 --- a/src/core/devtools/widget/frame_dump.cpp +++ b/src/core/devtools/widget/frame_dump.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/devtools/widget/frame_dump.h b/src/core/devtools/widget/frame_dump.h index 94075112b..ab442ec15 100644 --- a/src/core/devtools/widget/frame_dump.h +++ b/src/core/devtools/widget/frame_dump.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/devtools/widget/frame_graph.cpp b/src/core/devtools/widget/frame_graph.cpp index 6d4452074..4119ad8fe 100644 --- a/src/core/devtools/widget/frame_graph.cpp +++ b/src/core/devtools/widget/frame_graph.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "frame_graph.h" diff --git a/src/core/devtools/widget/frame_graph.h b/src/core/devtools/widget/frame_graph.h index aef3c0747..af26ea0f4 100644 --- a/src/core/devtools/widget/frame_graph.h +++ b/src/core/devtools/widget/frame_graph.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/devtools/widget/memory_map.cpp b/src/core/devtools/widget/memory_map.cpp index d1d1eb410..de6512bba 100644 --- a/src/core/devtools/widget/memory_map.cpp +++ b/src/core/devtools/widget/memory_map.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/devtools/widget/memory_map.h b/src/core/devtools/widget/memory_map.h index 3bbec4643..1ff664104 100644 --- a/src/core/devtools/widget/memory_map.h +++ b/src/core/devtools/widget/memory_map.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/devtools/widget/module_list.cpp b/src/core/devtools/widget/module_list.cpp index 73afe3462..2c6c48695 100644 --- a/src/core/devtools/widget/module_list.cpp +++ b/src/core/devtools/widget/module_list.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "module_list.h" diff --git a/src/core/devtools/widget/module_list.h b/src/core/devtools/widget/module_list.h index 4eed5444d..eb8c20825 100644 --- a/src/core/devtools/widget/module_list.h +++ b/src/core/devtools/widget/module_list.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/devtools/widget/reg_popup.cpp b/src/core/devtools/widget/reg_popup.cpp index 95385c7a0..93766e6c4 100644 --- a/src/core/devtools/widget/reg_popup.cpp +++ b/src/core/devtools/widget/reg_popup.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "reg_popup.h" diff --git a/src/core/devtools/widget/reg_popup.h b/src/core/devtools/widget/reg_popup.h index cade7c0d2..3f7ff5886 100644 --- a/src/core/devtools/widget/reg_popup.h +++ b/src/core/devtools/widget/reg_popup.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/devtools/widget/reg_view.cpp b/src/core/devtools/widget/reg_view.cpp index b8f534cd9..c93b72e2a 100644 --- a/src/core/devtools/widget/reg_view.cpp +++ b/src/core/devtools/widget/reg_view.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/devtools/widget/reg_view.h b/src/core/devtools/widget/reg_view.h index 7f20c4d3e..320141408 100644 --- a/src/core/devtools/widget/reg_view.h +++ b/src/core/devtools/widget/reg_view.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/devtools/widget/shader_list.cpp b/src/core/devtools/widget/shader_list.cpp index 243e2355f..59fec620e 100644 --- a/src/core/devtools/widget/shader_list.cpp +++ b/src/core/devtools/widget/shader_list.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/devtools/widget/shader_list.h b/src/core/devtools/widget/shader_list.h index c882b0964..d86c7e8fe 100644 --- a/src/core/devtools/widget/shader_list.h +++ b/src/core/devtools/widget/shader_list.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/emulator_settings.cpp b/src/core/emulator_settings.cpp index 066c23af8..833b6f088 100644 --- a/src/core/emulator_settings.cpp +++ b/src/core/emulator_settings.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include @@ -373,7 +373,7 @@ bool EmulatorSettingsImpl::Load(const std::string& serial) { 0, nullptr, "Config Migration", - "The shadPS4 config backend has been updated, and you only have " + "The shadBloodborne config backend has been updated, and you only have " "the old version of the config. Do you wish to update it " "automatically, or continue with the default config?", 2, diff --git a/src/core/emulator_settings.h b/src/core/emulator_settings.h index 370fb0ab0..1dcd394b8 100644 --- a/src/core/emulator_settings.h +++ b/src/core/emulator_settings.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/file_format/pfs.h b/src/core/file_format/pfs.h index a79c3674a..48e0f52b0 100644 --- a/src/core/file_format/pfs.h +++ b/src/core/file_format/pfs.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/file_format/playgo_chunk.cpp b/src/core/file_format/playgo_chunk.cpp index 4e2faea45..66d78d87c 100644 --- a/src/core/file_format/playgo_chunk.cpp +++ b/src/core/file_format/playgo_chunk.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "playgo_chunk.h" diff --git a/src/core/file_format/playgo_chunk.h b/src/core/file_format/playgo_chunk.h index 12d8f022e..57640851c 100644 --- a/src/core/file_format/playgo_chunk.h +++ b/src/core/file_format/playgo_chunk.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/file_format/psf.cpp b/src/core/file_format/psf.cpp index c5be7410a..71f8723f0 100644 --- a/src/core/file_format/psf.cpp +++ b/src/core/file_format/psf.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/file_format/psf.h b/src/core/file_format/psf.h index 0f6621315..ae68d5b4f 100644 --- a/src/core/file_format/psf.h +++ b/src/core/file_format/psf.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/file_format/trp.cpp b/src/core/file_format/trp.cpp index 6269fc6c7..34125f35d 100644 --- a/src/core/file_format/trp.cpp +++ b/src/core/file_format/trp.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/aes.h" diff --git a/src/core/file_format/trp.h b/src/core/file_format/trp.h index df0ea6eaf..05355948d 100644 --- a/src/core/file_format/trp.h +++ b/src/core/file_format/trp.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/file_sys/devices/base_device.cpp b/src/core/file_sys/devices/base_device.cpp index bcb5bf008..7411249ad 100644 --- a/src/core/file_sys/devices/base_device.cpp +++ b/src/core/file_sys/devices/base_device.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "core/file_sys/devices/base_device.h" diff --git a/src/core/file_sys/devices/base_device.h b/src/core/file_sys/devices/base_device.h index 27baab4ba..b6ffff73b 100644 --- a/src/core/file_sys/devices/base_device.h +++ b/src/core/file_sys/devices/base_device.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/file_sys/devices/console_device.cpp b/src/core/file_sys/devices/console_device.cpp index 2fc922d55..37c75e4b6 100644 --- a/src/core/file_sys/devices/console_device.cpp +++ b/src/core/file_sys/devices/console_device.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/logging/log.h" diff --git a/src/core/file_sys/devices/console_device.h b/src/core/file_sys/devices/console_device.h index 6828379c3..dd4d6e181 100644 --- a/src/core/file_sys/devices/console_device.h +++ b/src/core/file_sys/devices/console_device.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/file_sys/devices/deci_tty6_device.cpp b/src/core/file_sys/devices/deci_tty6_device.cpp index fa6b74868..75df6fa92 100644 --- a/src/core/file_sys/devices/deci_tty6_device.cpp +++ b/src/core/file_sys/devices/deci_tty6_device.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/logging/log.h" diff --git a/src/core/file_sys/devices/deci_tty6_device.h b/src/core/file_sys/devices/deci_tty6_device.h index 298b623e0..73e8d7190 100644 --- a/src/core/file_sys/devices/deci_tty6_device.h +++ b/src/core/file_sys/devices/deci_tty6_device.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/file_sys/devices/ioccom.h b/src/core/file_sys/devices/ioccom.h index 639d84319..d61c1e744 100644 --- a/src/core/file_sys/devices/ioccom.h +++ b/src/core/file_sys/devices/ioccom.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/file_sys/devices/logger.cpp b/src/core/file_sys/devices/logger.cpp index ae9edc0ef..22c729ca5 100644 --- a/src/core/file_sys/devices/logger.cpp +++ b/src/core/file_sys/devices/logger.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/logging/log.h" diff --git a/src/core/file_sys/devices/logger.h b/src/core/file_sys/devices/logger.h index d7088784c..00f5bf320 100644 --- a/src/core/file_sys/devices/logger.h +++ b/src/core/file_sys/devices/logger.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/file_sys/devices/nop_device.h b/src/core/file_sys/devices/nop_device.h index 3f0216cb8..2dbfc2407 100644 --- a/src/core/file_sys/devices/nop_device.h +++ b/src/core/file_sys/devices/nop_device.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/file_sys/devices/random_device.cpp b/src/core/file_sys/devices/random_device.cpp index 0e5c16151..71748a739 100644 --- a/src/core/file_sys/devices/random_device.cpp +++ b/src/core/file_sys/devices/random_device.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/file_sys/devices/random_device.h b/src/core/file_sys/devices/random_device.h index 6f813748e..c18685cc4 100644 --- a/src/core/file_sys/devices/random_device.h +++ b/src/core/file_sys/devices/random_device.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/file_sys/devices/rng_device.cpp b/src/core/file_sys/devices/rng_device.cpp index 0cbdf17d6..f475d23a7 100644 --- a/src/core/file_sys/devices/rng_device.cpp +++ b/src/core/file_sys/devices/rng_device.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/file_sys/devices/rng_device.h b/src/core/file_sys/devices/rng_device.h index a6c21aeed..4f91effd9 100644 --- a/src/core/file_sys/devices/rng_device.h +++ b/src/core/file_sys/devices/rng_device.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/file_sys/devices/srandom_device.cpp b/src/core/file_sys/devices/srandom_device.cpp index 0668cc581..94427a5b8 100644 --- a/src/core/file_sys/devices/srandom_device.cpp +++ b/src/core/file_sys/devices/srandom_device.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/file_sys/devices/srandom_device.h b/src/core/file_sys/devices/srandom_device.h index 3d41fb7fc..cbd355b93 100644 --- a/src/core/file_sys/devices/srandom_device.h +++ b/src/core/file_sys/devices/srandom_device.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/file_sys/devices/urandom_device.cpp b/src/core/file_sys/devices/urandom_device.cpp index 55a6194da..72c573c1d 100644 --- a/src/core/file_sys/devices/urandom_device.cpp +++ b/src/core/file_sys/devices/urandom_device.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/file_sys/devices/urandom_device.h b/src/core/file_sys/devices/urandom_device.h index b71df65b1..492af8df5 100644 --- a/src/core/file_sys/devices/urandom_device.h +++ b/src/core/file_sys/devices/urandom_device.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/file_sys/directories/base_directory.cpp b/src/core/file_sys/directories/base_directory.cpp index 75f67577c..7cc1f1d1d 100644 --- a/src/core/file_sys/directories/base_directory.cpp +++ b/src/core/file_sys/directories/base_directory.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/logging/log.h" diff --git a/src/core/file_sys/directories/base_directory.h b/src/core/file_sys/directories/base_directory.h index 832b8ac40..f7408345b 100644 --- a/src/core/file_sys/directories/base_directory.h +++ b/src/core/file_sys/directories/base_directory.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/file_sys/directories/normal_directory.cpp b/src/core/file_sys/directories/normal_directory.cpp index 3ed7c9492..209154dcc 100644 --- a/src/core/file_sys/directories/normal_directory.cpp +++ b/src/core/file_sys/directories/normal_directory.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/alignment.h" diff --git a/src/core/file_sys/directories/normal_directory.h b/src/core/file_sys/directories/normal_directory.h index 4fc84cd2a..f80421c4d 100644 --- a/src/core/file_sys/directories/normal_directory.h +++ b/src/core/file_sys/directories/normal_directory.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/file_sys/directories/pfs_directory.cpp b/src/core/file_sys/directories/pfs_directory.cpp index 38ceaf345..ab6630794 100644 --- a/src/core/file_sys/directories/pfs_directory.cpp +++ b/src/core/file_sys/directories/pfs_directory.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/alignment.h" diff --git a/src/core/file_sys/directories/pfs_directory.h b/src/core/file_sys/directories/pfs_directory.h index 23b7e1eb0..7866bc519 100644 --- a/src/core/file_sys/directories/pfs_directory.h +++ b/src/core/file_sys/directories/pfs_directory.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/file_sys/file.cpp b/src/core/file_sys/file.cpp index 637cbfb52..ad3018d26 100644 --- a/src/core/file_sys/file.cpp +++ b/src/core/file_sys/file.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/assert.h" diff --git a/src/core/file_sys/fs.cpp b/src/core/file_sys/fs.cpp index aa474d20a..61ffaa794 100644 --- a/src/core/file_sys/fs.cpp +++ b/src/core/file_sys/fs.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/file_sys/fs.h b/src/core/file_sys/fs.h index 0522c3d8a..138617782 100644 --- a/src/core/file_sys/fs.h +++ b/src/core/file_sys/fs.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/ipc/ipc.cpp b/src/core/ipc/ipc.cpp index 70180d3bf..62fa7b8c6 100644 --- a/src/core/ipc/ipc.cpp +++ b/src/core/ipc/ipc.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "ipc.h" @@ -18,7 +18,6 @@ #include "core/libraries/audio/audioout.h" #include "input/input_handler.h" #include "sdl_window.h" -#include "src/core/libraries/usbd/usbd.h" #include "video_core/renderer_vulkan/vk_presenter.h" extern std::unique_ptr presenter; @@ -171,43 +170,6 @@ void IPC::InputLoop() { presenter->GetFsrSettingsRef().rcas_attenuation = static_cast(value / 1000.0f); } - } else if (cmd == "USB_LOAD_FIGURE") { - const auto ref = Libraries::Usbd::usb_backend->GetImplRef(); - if (ref) { - std::string file_name = next_str(); - const u8 pad = next_u64(); - const u8 slot = next_u64(); - ref->LoadFigure(file_name, pad, slot); - } - } else if (cmd == "USB_REMOVE_FIGURE") { - const auto ref = Libraries::Usbd::usb_backend->GetImplRef(); - if (ref) { - const u8 pad = next_u64(); - const u8 slot = next_u64(); - bool full_remove = next_u64() != 0; - ref->RemoveFigure(pad, slot, full_remove); - } - } else if (cmd == "USB_MOVE_FIGURE") { - const auto ref = Libraries::Usbd::usb_backend->GetImplRef(); - if (ref) { - const u8 new_pad = next_u64(); - const u8 new_index = next_u64(); - const u8 old_pad = next_u64(); - const u8 old_index = next_u64(); - ref->MoveFigure(new_pad, new_index, old_pad, old_index); - } - } else if (cmd == "USB_TEMP_REMOVE_FIGURE") { - const auto ref = Libraries::Usbd::usb_backend->GetImplRef(); - if (ref) { - const u8 index = next_u64(); - ref->TempRemoveFigure(index); - } - } else if (cmd == "USB_CANCEL_REMOVE_FIGURE") { - const auto ref = Libraries::Usbd::usb_backend->GetImplRef(); - if (ref) { - const u8 index = next_u64(); - ref->CancelRemoveFigure(index); - } } else if (cmd == "RELOAD_INPUTS") { std::string config = next_str(); Input::ParseInputConfig(config); diff --git a/src/core/ipc/ipc.h b/src/core/ipc/ipc.h index 933afa897..92b30c45f 100644 --- a/src/core/ipc/ipc.h +++ b/src/core/ipc/ipc.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/ajm/ajm.cpp b/src/core/libraries/ajm/ajm.cpp index 2bec1bf0f..fa8d4a153 100644 --- a/src/core/libraries/ajm/ajm.cpp +++ b/src/core/libraries/ajm/ajm.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/logging/log.h" diff --git a/src/core/libraries/ajm/ajm.h b/src/core/libraries/ajm/ajm.h index 1bfd88351..9994b0d78 100644 --- a/src/core/libraries/ajm/ajm.h +++ b/src/core/libraries/ajm/ajm.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/ajm/ajm_aac.cpp b/src/core/libraries/ajm/ajm_aac.cpp index 061b77890..b2c8045bb 100644 --- a/src/core/libraries/ajm/ajm_aac.cpp +++ b/src/core/libraries/ajm/ajm_aac.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "ajm.h" diff --git a/src/core/libraries/ajm/ajm_aac.h b/src/core/libraries/ajm/ajm_aac.h index 4ff55d843..31eb74df3 100644 --- a/src/core/libraries/ajm/ajm_aac.h +++ b/src/core/libraries/ajm/ajm_aac.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/ajm/ajm_at9.cpp b/src/core/libraries/ajm/ajm_at9.cpp index 4452d032d..c0d36273c 100644 --- a/src/core/libraries/ajm/ajm_at9.cpp +++ b/src/core/libraries/ajm/ajm_at9.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "ajm_result.h" diff --git a/src/core/libraries/ajm/ajm_at9.h b/src/core/libraries/ajm/ajm_at9.h index 8eb6166e2..8455bc17d 100644 --- a/src/core/libraries/ajm/ajm_at9.h +++ b/src/core/libraries/ajm/ajm_at9.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/ajm/ajm_batch.cpp b/src/core/libraries/ajm/ajm_batch.cpp index 3ab2ed4ab..41ae59b42 100644 --- a/src/core/libraries/ajm/ajm_batch.cpp +++ b/src/core/libraries/ajm/ajm_batch.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/alignment.h" diff --git a/src/core/libraries/ajm/ajm_batch.h b/src/core/libraries/ajm/ajm_batch.h index c18e9efbf..d42a45d5b 100644 --- a/src/core/libraries/ajm/ajm_batch.h +++ b/src/core/libraries/ajm/ajm_batch.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/ajm/ajm_context.cpp b/src/core/libraries/ajm/ajm_context.cpp index 8ce8f3434..53f3b731c 100644 --- a/src/core/libraries/ajm/ajm_context.cpp +++ b/src/core/libraries/ajm/ajm_context.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/assert.h" @@ -61,7 +61,7 @@ s32 AjmContext::ModuleRegister(AjmCodecType type) { } void AjmContext::WorkerThread(std::stop_token stop) { - Common::SetCurrentThreadName("shadPS4:AjmWorker"); + Common::SetCurrentThreadName("sB:AjmWorker"); while (!stop.stop_requested()) { auto batch = batch_queue.PopWait(stop); if (batch != nullptr && !batch->canceled) { diff --git a/src/core/libraries/ajm/ajm_context.h b/src/core/libraries/ajm/ajm_context.h index e51ea4fcf..4820c9dba 100644 --- a/src/core/libraries/ajm/ajm_context.h +++ b/src/core/libraries/ajm/ajm_context.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/ajm/ajm_error.h b/src/core/libraries/ajm/ajm_error.h index 64129554f..020580e34 100644 --- a/src/core/libraries/ajm/ajm_error.h +++ b/src/core/libraries/ajm/ajm_error.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/ajm/ajm_instance.cpp b/src/core/libraries/ajm/ajm_instance.cpp index d25517c81..375464cfd 100644 --- a/src/core/libraries/ajm/ajm_instance.cpp +++ b/src/core/libraries/ajm/ajm_instance.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "ajm_aac.h" diff --git a/src/core/libraries/ajm/ajm_instance.h b/src/core/libraries/ajm/ajm_instance.h index db53add4d..35aead939 100644 --- a/src/core/libraries/ajm/ajm_instance.h +++ b/src/core/libraries/ajm/ajm_instance.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/ajm/ajm_instance_statistics.cpp b/src/core/libraries/ajm/ajm_instance_statistics.cpp index 2e4a65914..d31849df1 100644 --- a/src/core/libraries/ajm/ajm_instance_statistics.cpp +++ b/src/core/libraries/ajm/ajm_instance_statistics.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "core/libraries/ajm/ajm.h" diff --git a/src/core/libraries/ajm/ajm_instance_statistics.h b/src/core/libraries/ajm/ajm_instance_statistics.h index 0ec79aeac..6120907ab 100644 --- a/src/core/libraries/ajm/ajm_instance_statistics.h +++ b/src/core/libraries/ajm/ajm_instance_statistics.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/ajm/ajm_mp3.cpp b/src/core/libraries/ajm/ajm_mp3.cpp index d1c9374cc..f92694130 100644 --- a/src/core/libraries/ajm/ajm_mp3.cpp +++ b/src/core/libraries/ajm/ajm_mp3.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "ajm_error.h" diff --git a/src/core/libraries/ajm/ajm_mp3.h b/src/core/libraries/ajm/ajm_mp3.h index 1113e222a..756ca13e2 100644 --- a/src/core/libraries/ajm/ajm_mp3.h +++ b/src/core/libraries/ajm/ajm_mp3.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/ajm/ajm_result.h b/src/core/libraries/ajm/ajm_result.h index d4e6d1147..c36ed9d23 100644 --- a/src/core/libraries/ajm/ajm_result.h +++ b/src/core/libraries/ajm/ajm_result.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/app_content/app_content.cpp b/src/core/libraries/app_content/app_content.cpp index bf2b72b07..b0563a4cb 100644 --- a/src/core/libraries/app_content/app_content.cpp +++ b/src/core/libraries/app_content/app_content.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/libraries/app_content/app_content.h b/src/core/libraries/app_content/app_content.h index dd8455dcc..592ecbacf 100644 --- a/src/core/libraries/app_content/app_content.h +++ b/src/core/libraries/app_content/app_content.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/app_content/app_content_error.h b/src/core/libraries/app_content/app_content_error.h index 3a582b998..a7f7a12ad 100644 --- a/src/core/libraries/app_content/app_content_error.h +++ b/src/core/libraries/app_content/app_content_error.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/audio/audioin.cpp b/src/core/libraries/audio/audioin.cpp index 55c2891b2..9e456838d 100644 --- a/src/core/libraries/audio/audioin.cpp +++ b/src/core/libraries/audio/audioin.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/libraries/audio/audioin.h b/src/core/libraries/audio/audioin.h index be43315e0..9a46b674f 100644 --- a/src/core/libraries/audio/audioin.h +++ b/src/core/libraries/audio/audioin.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/audio/audioin_backend.h b/src/core/libraries/audio/audioin_backend.h index dc06bb27c..4ec269e26 100644 --- a/src/core/libraries/audio/audioin_backend.h +++ b/src/core/libraries/audio/audioin_backend.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/audio/audioin_error.h b/src/core/libraries/audio/audioin_error.h index c392e8194..652318b1c 100644 --- a/src/core/libraries/audio/audioin_error.h +++ b/src/core/libraries/audio/audioin_error.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/audio/audioout.cpp b/src/core/libraries/audio/audioout.cpp index e009f1f39..e910f7779 100644 --- a/src/core/libraries/audio/audioout.cpp +++ b/src/core/libraries/audio/audioout.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include @@ -160,7 +160,7 @@ void AdjustVol() { static void AudioOutputThread(std::shared_ptr port, const std::stop_token& stop) { { - const auto thread_name = fmt::format("shadPS4:AudioOutputThread:{}", fmt::ptr(port.get())); + const auto thread_name = fmt::format("sB:AudioOutputThread:{}", fmt::ptr(port.get())); Common::SetCurrentThreadName(thread_name.c_str()); } diff --git a/src/core/libraries/audio/audioout.h b/src/core/libraries/audio/audioout.h index ffc1f9eb1..0483466c0 100644 --- a/src/core/libraries/audio/audioout.h +++ b/src/core/libraries/audio/audioout.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/audio/audioout_backend.h b/src/core/libraries/audio/audioout_backend.h index e71abfefb..e2ad795f5 100644 --- a/src/core/libraries/audio/audioout_backend.h +++ b/src/core/libraries/audio/audioout_backend.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/audio/audioout_error.h b/src/core/libraries/audio/audioout_error.h index 7642e87e7..0b9a4c5ed 100644 --- a/src/core/libraries/audio/audioout_error.h +++ b/src/core/libraries/audio/audioout_error.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/audio/openal_audio_out.cpp b/src/core/libraries/audio/openal_audio_out.cpp index d40f01588..f9dd01dcf 100644 --- a/src/core/libraries/audio/openal_audio_out.cpp +++ b/src/core/libraries/audio/openal_audio_out.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/libraries/audio/openal_manager.h b/src/core/libraries/audio/openal_manager.h index 4a6ef7920..c2c9c35c4 100644 --- a/src/core/libraries/audio/openal_manager.h +++ b/src/core/libraries/audio/openal_manager.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once #include diff --git a/src/core/libraries/audio/sdl_audio_in.cpp b/src/core/libraries/audio/sdl_audio_in.cpp index 6e7a7bdbd..b7bb460d3 100644 --- a/src/core/libraries/audio/sdl_audio_in.cpp +++ b/src/core/libraries/audio/sdl_audio_in.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/libraries/audio/sdl_audio_out.cpp b/src/core/libraries/audio/sdl_audio_out.cpp index b6706eff7..98307e054 100644 --- a/src/core/libraries/audio/sdl_audio_out.cpp +++ b/src/core/libraries/audio/sdl_audio_out.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/libraries/audio3d/audio3d.cpp b/src/core/libraries/audio3d/audio3d.cpp deleted file mode 100644 index 989679107..000000000 --- a/src/core/libraries/audio3d/audio3d.cpp +++ /dev/null @@ -1,997 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2025-2026 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include -#include -#include - -#include "common/assert.h" -#include "common/logging/log.h" -#include "core/libraries/audio/audioout.h" -#include "core/libraries/audio/audioout_error.h" -#include "core/libraries/audio3d/audio3d.h" -#include "core/libraries/audio3d/audio3d_error.h" -#include "core/libraries/error_codes.h" -#include "core/libraries/libs.h" - -namespace Libraries::Audio3d { - -static constexpr u32 AUDIO3D_SAMPLE_RATE = 48000; - -static constexpr AudioOut::OrbisAudioOutParamFormat AUDIO3D_OUTPUT_FORMAT = - AudioOut::OrbisAudioOutParamFormat::S16Stereo; -static constexpr u32 AUDIO3D_OUTPUT_NUM_CHANNELS = 2; - -static std::unique_ptr state; - -s32 PS4_SYSV_ABI sceAudio3dAudioOutClose(const s32 handle) { - LOG_INFO(Lib_Audio3d, "called, handle = {}", handle); - - // Remove from any port that was tracking this handle. - if (state) { - for (auto& [port_id, port] : state->ports) { - std::scoped_lock lock{port.mutex}; - auto& handles = port.audioout_handles; - handles.erase(std::remove(handles.begin(), handles.end(), handle), handles.end()); - } - } - - return AudioOut::sceAudioOutClose(handle); -} - -s32 PS4_SYSV_ABI sceAudio3dAudioOutOpen( - const OrbisAudio3dPortId port_id, const Libraries::UserService::OrbisUserServiceUserId user_id, - s32 type, const s32 index, const u32 len, const u32 freq, - const AudioOut::OrbisAudioOutParamExtendedInformation param) { - LOG_INFO(Lib_Audio3d, - "called, port_id = {}, user_id = {}, type = {}, index = {}, len = {}, freq = {}", - port_id, user_id, type, index, len, freq); - - if (!state->ports.contains(port_id)) { - LOG_ERROR(Lib_Audio3d, "!state->ports.contains(port_id)"); - return ORBIS_AUDIO3D_ERROR_INVALID_PORT; - } - - std::scoped_lock lock{state->ports[port_id].mutex}; - if (len != state->ports[port_id].parameters.granularity) { - LOG_ERROR(Lib_Audio3d, "len != state->ports[port_id].parameters.granularity"); - return ORBIS_AUDIO3D_ERROR_INVALID_PARAMETER; - } - - const s32 handle = sceAudioOutOpen(user_id, static_cast(type), - index, len, freq, param); - if (handle < 0) { - return handle; - } - - // Track this handle in the port so sceAudio3dPortFlush can use it for sync. - state->ports[port_id].audioout_handles.push_back(handle); - return handle; -} - -s32 PS4_SYSV_ABI sceAudio3dAudioOutOutput(const s32 handle, void* ptr) { - LOG_DEBUG(Lib_Audio3d, "called, handle = {}, ptr = {}", handle, ptr); - - if (!ptr) { - LOG_ERROR(Lib_Audio3d, "!ptr"); - return ORBIS_AUDIO3D_ERROR_INVALID_PARAMETER; - } - - if (handle < 0 || (handle & 0xFFFF) > 25) { - LOG_ERROR(Lib_Audio3d, "handle < 0 || (handle & 0xFFFF) > 25"); - return ORBIS_AUDIO3D_ERROR_INVALID_PORT; - } - - return AudioOut::sceAudioOutOutput(handle, ptr); -} - -s32 PS4_SYSV_ABI sceAudio3dAudioOutOutputs(AudioOut::OrbisAudioOutOutputParam* param, - const u32 num) { - LOG_DEBUG(Lib_Audio3d, "called, param = {}, num = {}", static_cast(param), num); - - if (!param || !num) { - LOG_ERROR(Lib_Audio3d, "!param || !num"); - return ORBIS_AUDIO3D_ERROR_INVALID_PARAMETER; - } - - return AudioOut::sceAudioOutOutputs(param, num); -} - -static s32 ConvertAndEnqueue(std::deque& queue, const OrbisAudio3dPcm& pcm, - const u32 num_channels, const u32 granularity) { - if (!pcm.sample_buffer || !pcm.num_samples) { - return ORBIS_AUDIO3D_ERROR_INVALID_PARAMETER; - } - - const u32 bytes_per_sample = - (pcm.format == OrbisAudio3dFormat::ORBIS_AUDIO3D_FORMAT_S16) ? sizeof(s16) : sizeof(float); - - // Always allocate exactly granularity samples (zeroed = silence for padding). - const u32 dst_bytes = granularity * num_channels * bytes_per_sample; - u8* copy = static_cast(std::calloc(1, dst_bytes)); - if (!copy) { - return ORBIS_AUDIO3D_ERROR_OUT_OF_MEMORY; - } - - // Copy min(provided, granularity) samples — extra are dropped, shortage stays zero. - const u32 samples_to_copy = std::min(pcm.num_samples, granularity); - std::memcpy(copy, pcm.sample_buffer, samples_to_copy * num_channels * bytes_per_sample); - - queue.emplace_back(AudioData{ - .sample_buffer = copy, - .num_samples = granularity, - .num_channels = num_channels, - .format = pcm.format, - }); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dBedWrite(const OrbisAudio3dPortId port_id, const u32 num_channels, - const OrbisAudio3dFormat format, void* buffer, - const u32 num_samples) { - return sceAudio3dBedWrite2(port_id, num_channels, format, buffer, num_samples, - OrbisAudio3dOutputRoute::ORBIS_AUDIO3D_OUTPUT_BOTH, false); -} - -s32 PS4_SYSV_ABI sceAudio3dBedWrite2(const OrbisAudio3dPortId port_id, const u32 num_channels, - const OrbisAudio3dFormat format, void* buffer, - const u32 num_samples, - const OrbisAudio3dOutputRoute output_route, - const bool restricted) { - LOG_DEBUG( - Lib_Audio3d, - "called, port_id = {}, num_channels = {}, format = {}, num_samples = {}, output_route " - "= {}, restricted = {}", - port_id, num_channels, magic_enum::enum_name(format), num_samples, - magic_enum::enum_name(output_route), restricted); - - if (!state->ports.contains(port_id)) { - LOG_ERROR(Lib_Audio3d, "!state->ports.contains(port_id)"); - return ORBIS_AUDIO3D_ERROR_INVALID_PORT; - } - - if (output_route > OrbisAudio3dOutputRoute::ORBIS_AUDIO3D_OUTPUT_BOTH) { - LOG_ERROR(Lib_Audio3d, "output_route > ORBIS_AUDIO3D_OUTPUT_BOTH"); - return ORBIS_AUDIO3D_ERROR_INVALID_PARAMETER; - } - - if (format > OrbisAudio3dFormat::ORBIS_AUDIO3D_FORMAT_FLOAT) { - LOG_ERROR(Lib_Audio3d, "format > ORBIS_AUDIO3D_FORMAT_FLOAT"); - return ORBIS_AUDIO3D_ERROR_INVALID_PARAMETER; - } - - if (num_channels != 2 && num_channels != 6 && num_channels != 8) { - LOG_ERROR(Lib_Audio3d, "num_channels must be 2, 6, or 8"); - return ORBIS_AUDIO3D_ERROR_INVALID_PARAMETER; - } - - if (!buffer || !num_samples) { - LOG_ERROR(Lib_Audio3d, "!buffer || !num_samples"); - return ORBIS_AUDIO3D_ERROR_INVALID_PARAMETER; - } - - if (format == OrbisAudio3dFormat::ORBIS_AUDIO3D_FORMAT_FLOAT) { - if ((reinterpret_cast(buffer) & 3) != 0) { - LOG_ERROR(Lib_Audio3d, "buffer & 3 != 0"); - return ORBIS_AUDIO3D_ERROR_INVALID_PARAMETER; - } - } else if (format == OrbisAudio3dFormat::ORBIS_AUDIO3D_FORMAT_S16) { - if ((reinterpret_cast(buffer) & 1) != 0) { - LOG_ERROR(Lib_Audio3d, "buffer & 1 != 0"); - return ORBIS_AUDIO3D_ERROR_INVALID_PARAMETER; - } - } - - std::scoped_lock lock{state->ports[port_id].mutex}; - return ConvertAndEnqueue(state->ports[port_id].bed_queue, - OrbisAudio3dPcm{ - .format = format, - .sample_buffer = buffer, - .num_samples = num_samples, - }, - num_channels, state->ports[port_id].parameters.granularity); -} - -s32 PS4_SYSV_ABI sceAudio3dCreateSpeakerArray() { - LOG_ERROR(Lib_Audio3d, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dDeleteSpeakerArray() { - LOG_ERROR(Lib_Audio3d, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dGetDefaultOpenParameters(OrbisAudio3dOpenParameters* params) { - LOG_DEBUG(Lib_Audio3d, "called"); - if (params) { - auto default_params = OrbisAudio3dOpenParameters{ - .size_this = 0x20, - .granularity = 0x100, - .rate = OrbisAudio3dRate::ORBIS_AUDIO3D_RATE_48000, - .max_objects = 512, - .queue_depth = 2, - .buffer_mode = OrbisAudio3dBufferMode::ORBIS_AUDIO3D_BUFFER_ADVANCE_AND_PUSH, - }; - memcpy(params, &default_params, 0x20); - } - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dGetSpeakerArrayMemorySize() { - LOG_ERROR(Lib_Audio3d, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dGetSpeakerArrayMixCoefficients() { - LOG_ERROR(Lib_Audio3d, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dGetSpeakerArrayMixCoefficients2() { - LOG_ERROR(Lib_Audio3d, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dInitialize(const s64 reserved) { - LOG_INFO(Lib_Audio3d, "called, reserved = {}", reserved); - - if (reserved != 0) { - LOG_ERROR(Lib_Audio3d, "reserved != 0"); - return ORBIS_AUDIO3D_ERROR_INVALID_PARAMETER; - } - - if (state) { - LOG_ERROR(Lib_Audio3d, "already initialized"); - return ORBIS_AUDIO3D_ERROR_NOT_READY; - } - - state = std::make_unique(); - - if (const auto init_ret = AudioOut::sceAudioOutInit(); - init_ret < 0 && init_ret != ORBIS_AUDIO_OUT_ERROR_ALREADY_INIT) { - return init_ret; - } - - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dObjectReserve(const OrbisAudio3dPortId port_id, - OrbisAudio3dObjectId* object_id) { - LOG_INFO(Lib_Audio3d, "called, port_id = {}, object_id = {}", port_id, - static_cast(object_id)); - - if (!object_id) { - LOG_ERROR(Lib_Audio3d, "!object_id"); - return ORBIS_AUDIO3D_ERROR_INVALID_PARAMETER; - } - - *object_id = ORBIS_AUDIO3D_OBJECT_INVALID; - - if (!state->ports.contains(port_id)) { - LOG_ERROR(Lib_Audio3d, "!state->ports.contains(port_id)"); - return ORBIS_AUDIO3D_ERROR_INVALID_PORT; - } - - auto& port = state->ports[port_id]; - std::scoped_lock lock{port.mutex}; - - // Enforce the max_objects limit set at PortOpen time. - if (port.objects.size() >= port.parameters.max_objects) { - LOG_ERROR(Lib_Audio3d, "port has no available objects (max_objects = {})", - port.parameters.max_objects); - return ORBIS_AUDIO3D_ERROR_OUT_OF_RESOURCES; - } - - // counter lives in the Port so it resets when the port is closed and reopened, - do { - ++port.next_object_id; - } while (port.next_object_id == 0 || port.next_object_id == ORBIS_AUDIO3D_OBJECT_INVALID || - port.objects.contains(port.next_object_id)); - - *object_id = port.next_object_id; - port.objects.emplace(*object_id, ObjectState{}); - LOG_INFO(Lib_Audio3d, "reserved object_id = {}", *object_id); - - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dObjectSetAttribute(const OrbisAudio3dPortId port_id, - const OrbisAudio3dObjectId object_id, - const OrbisAudio3dAttributeId attribute_id, - const void* attribute, const u64 attribute_size) { - LOG_DEBUG(Lib_Audio3d, "called, port_id = {}, object_id = {}, attribute_id = {:#x}, size = {}", - port_id, object_id, static_cast(attribute_id), attribute_size); - - if (!state->ports.contains(port_id)) { - LOG_ERROR(Lib_Audio3d, "!state->ports.contains(port_id)"); - return ORBIS_AUDIO3D_ERROR_INVALID_PORT; - } - - auto& port = state->ports[port_id]; - std::scoped_lock lock{port.mutex}; - if (!port.objects.contains(object_id)) { - LOG_DEBUG(Lib_Audio3d, "object_id {} not reserved (race with Unreserve?), no-op", - object_id); - return ORBIS_OK; - } - - if (!attribute_size && - attribute_id != OrbisAudio3dAttributeId::ORBIS_AUDIO3D_ATTRIBUTE_RESET_STATE) { - LOG_ERROR(Lib_Audio3d, "!attribute_size for non-reset attribute"); - return ORBIS_AUDIO3D_ERROR_INVALID_PARAMETER; - } - - auto& obj = port.objects[object_id]; - - // RESET_STATE clears all attributes and queued PCM; it takes no value. - if (attribute_id == OrbisAudio3dAttributeId::ORBIS_AUDIO3D_ATTRIBUTE_RESET_STATE) { - for (auto& data : obj.pcm_queue) { - std::free(data.sample_buffer); - } - obj.pcm_queue.clear(); - obj.persistent_attributes.clear(); - LOG_DEBUG(Lib_Audio3d, "RESET_STATE for object {}", object_id); - return ORBIS_OK; - } - - // we don't handle any attributes yet, but store them in the ObjectState so they're available - // when we do - const auto* src = static_cast(attribute); - obj.persistent_attributes[static_cast(attribute_id)].assign(src, src + attribute_size); - - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dObjectSetAttributes(const OrbisAudio3dPortId port_id, - OrbisAudio3dObjectId object_id, - const u64 num_attributes, - const OrbisAudio3dAttribute* attribute_array) { - LOG_DEBUG(Lib_Audio3d, - "called, port_id = {}, object_id = {}, num_attributes = {}, attribute_array = {}", - port_id, object_id, num_attributes, fmt::ptr(attribute_array)); - - if (!state->ports.contains(port_id)) { - LOG_ERROR(Lib_Audio3d, "!state->ports.contains(port_id)"); - return ORBIS_AUDIO3D_ERROR_INVALID_PORT; - } - - if (!num_attributes || !attribute_array) { - LOG_ERROR(Lib_Audio3d, "!num_attributes || !attribute_array"); - return ORBIS_AUDIO3D_ERROR_INVALID_PARAMETER; - } - - auto& port = state->ports[port_id]; - std::scoped_lock lock{port.mutex}; - if (!port.objects.contains(object_id)) { - LOG_DEBUG(Lib_Audio3d, "object_id {} not reserved", object_id); - return ORBIS_OK; - } - - auto& obj = port.objects[object_id]; - - for (u64 i = 0; i < num_attributes; i++) { - if (attribute_array[i].attribute_id == - OrbisAudio3dAttributeId::ORBIS_AUDIO3D_ATTRIBUTE_RESET_STATE) { - for (auto& data : obj.pcm_queue) { - std::free(data.sample_buffer); - } - obj.pcm_queue.clear(); - obj.persistent_attributes.clear(); - LOG_DEBUG(Lib_Audio3d, "RESET_STATE for object {}", object_id); - break; // Only one reset is needed even if listed multiple times. - } - } - - // apply all other attributes. - for (u64 i = 0; i < num_attributes; i++) { - const auto& attribute = attribute_array[i]; - - switch (attribute.attribute_id) { - case OrbisAudio3dAttributeId::ORBIS_AUDIO3D_ATTRIBUTE_RESET_STATE: - break; // Already applied in first pass above. - case OrbisAudio3dAttributeId::ORBIS_AUDIO3D_ATTRIBUTE_PCM: { - if (attribute.value_size < sizeof(OrbisAudio3dPcm)) { - LOG_ERROR(Lib_Audio3d, "PCM attribute value_size too small"); - continue; - } - const auto pcm = static_cast(attribute.value); - // Object audio is always mono (1 channel). - if (const auto ret = - ConvertAndEnqueue(obj.pcm_queue, *pcm, 1, port.parameters.granularity); - ret != ORBIS_OK) { - return ret; - } - break; - } - default: { - // store the other attributes in the ObjectState so they're available when we implement - // them - if (attribute.value && attribute.value_size > 0) { - const auto* src = static_cast(attribute.value); - obj.persistent_attributes[static_cast(attribute.attribute_id)].assign( - src, src + attribute.value_size); - } - LOG_DEBUG(Lib_Audio3d, "Stored attribute {:#x} for object {}", - static_cast(attribute.attribute_id), object_id); - break; - } - } - } - - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dObjectUnreserve(const OrbisAudio3dPortId port_id, - const OrbisAudio3dObjectId object_id) { - LOG_DEBUG(Lib_Audio3d, "called, port_id = {}, object_id = {}", port_id, object_id); - - if (!state->ports.contains(port_id)) { - LOG_ERROR(Lib_Audio3d, "!state->ports.contains(port_id)"); - return ORBIS_AUDIO3D_ERROR_INVALID_PORT; - } - - auto& port = state->ports[port_id]; - std::scoped_lock lock{port.mutex}; - - if (!port.objects.contains(object_id)) { - LOG_ERROR(Lib_Audio3d, "object_id not reserved"); - return ORBIS_AUDIO3D_ERROR_INVALID_OBJECT; - } - - // Free any queued PCM audio for this object. - for (auto& data : port.objects[object_id].pcm_queue) { - std::free(data.sample_buffer); - } - - port.objects.erase(object_id); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dPortAdvance(const OrbisAudio3dPortId port_id) { - LOG_DEBUG(Lib_Audio3d, "called, port_id = {}", port_id); - - if (!state->ports.contains(port_id)) { - LOG_ERROR(Lib_Audio3d, "!state->ports.contains(port_id)"); - return ORBIS_AUDIO3D_ERROR_INVALID_PORT; - } - - auto& port = state->ports[port_id]; - - if (port.parameters.buffer_mode == OrbisAudio3dBufferMode::ORBIS_AUDIO3D_BUFFER_NO_ADVANCE) { - LOG_ERROR(Lib_Audio3d, "port doesn't have advance capability"); - return ORBIS_AUDIO3D_ERROR_NOT_SUPPORTED; - } - - if (port.mixed_queue.size() >= port.parameters.queue_depth) { - LOG_WARNING(Lib_Audio3d, "mixed queue full (depth={}), dropping advance", - port.parameters.queue_depth); - return ORBIS_AUDIO3D_ERROR_NOT_READY; - } - - const u32 granularity = port.parameters.granularity; - const u32 out_samples = granularity * AUDIO3D_OUTPUT_NUM_CHANNELS; - - // ---- FLOAT MIX BUFFER ---- - float* mix_float = static_cast(std::calloc(out_samples, sizeof(float))); - - if (!mix_float) - return ORBIS_AUDIO3D_ERROR_OUT_OF_MEMORY; - - auto mix_in = [&](std::deque& queue, const float gain) { - if (queue.empty()) - return; - - // default gain is 0.0 — objects with no GAIN set are silent. - if (gain == 0.0f) { - AudioData data = queue.front(); - queue.pop_front(); - std::free(data.sample_buffer); - return; - } - - AudioData data = queue.front(); - queue.pop_front(); - - const u32 frames = std::min(granularity, data.num_samples); - const u32 channels = data.num_channels; - - if (data.format == OrbisAudio3dFormat::ORBIS_AUDIO3D_FORMAT_S16) { - const s16* src = reinterpret_cast(data.sample_buffer); - - for (u32 i = 0; i < frames; i++) { - float left = 0.0f; - float right = 0.0f; - - if (channels == 1) { - float v = src[i] / 32768.0f; - left = v; - right = v; - } else { - left = src[i * channels + 0] / 32768.0f; - right = src[i * channels + 1] / 32768.0f; - } - - mix_float[i * 2 + 0] += left * gain; - mix_float[i * 2 + 1] += right * gain; - } - } else { // FLOAT input - const float* src = reinterpret_cast(data.sample_buffer); - - for (u32 i = 0; i < frames; i++) { - float left = 0.0f; - float right = 0.0f; - - if (channels == 1) { - left = src[i]; - right = src[i]; - } else { - left = src[i * channels + 0]; - right = src[i * channels + 1]; - } - - mix_float[i * 2 + 0] += left * gain; - mix_float[i * 2 + 1] += right * gain; - } - } - - std::free(data.sample_buffer); - }; - - // Bed is mixed at full gain (1.0) - mix_in(port.bed_queue, 1.0f); - - // Mix all object PCM queues, applying each object's GAIN persistent attribute. - for (auto& [obj_id, obj] : port.objects) { - float gain = 0.0f; - const auto gain_key = - static_cast(OrbisAudio3dAttributeId::ORBIS_AUDIO3D_ATTRIBUTE_GAIN); - if (obj.persistent_attributes.contains(gain_key)) { - const auto& blob = obj.persistent_attributes.at(gain_key); - if (blob.size() >= sizeof(float)) { - std::memcpy(&gain, blob.data(), sizeof(float)); - } - } - mix_in(obj.pcm_queue, gain); - } - - s16* mix_s16 = static_cast(std::malloc(out_samples * sizeof(s16))); - - if (!mix_s16) { - std::free(mix_float); - return ORBIS_AUDIO3D_ERROR_OUT_OF_MEMORY; - } - - for (u32 i = 0; i < out_samples; i++) { - float v = std::clamp(mix_float[i], -1.0f, 1.0f); - mix_s16[i] = static_cast(v * 32767.0f); - } - - std::free(mix_float); - - port.mixed_queue.push_back(AudioData{.sample_buffer = reinterpret_cast(mix_s16), - .num_samples = granularity, - .num_channels = AUDIO3D_OUTPUT_NUM_CHANNELS, - .format = OrbisAudio3dFormat::ORBIS_AUDIO3D_FORMAT_S16}); - - return ORBIS_OK; -} -s32 PS4_SYSV_ABI sceAudio3dPortClose(const OrbisAudio3dPortId port_id) { - LOG_INFO(Lib_Audio3d, "called, port_id = {}", port_id); - - if (!state->ports.contains(port_id)) { - LOG_ERROR(Lib_Audio3d, "!state->ports.contains(port_id)"); - return ORBIS_AUDIO3D_ERROR_INVALID_PORT; - } - - auto& port = state->ports[port_id]; - { - std::scoped_lock lock{port.mutex}; - - if (port.audio_out_handle >= 0) { - AudioOut::sceAudioOutClose(port.audio_out_handle); - port.audio_out_handle = -1; - } - - for (const s32 handle : port.audioout_handles) { - AudioOut::sceAudioOutClose(handle); - } - port.audioout_handles.clear(); - - for (auto& data : port.mixed_queue) { - std::free(data.sample_buffer); - } - - for (auto& data : port.bed_queue) { - std::free(data.sample_buffer); - } - - for (auto& [obj_id, obj] : port.objects) { - for (auto& data : obj.pcm_queue) { - std::free(data.sample_buffer); - } - } - } - - state->ports.erase(port_id); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dPortCreate() { - LOG_ERROR(Lib_Audio3d, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dPortDestroy() { - LOG_ERROR(Lib_Audio3d, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dPortFlush(const OrbisAudio3dPortId port_id) { - LOG_DEBUG(Lib_Audio3d, "called, port_id = {}", port_id); - - if (!state->ports.contains(port_id)) { - LOG_ERROR(Lib_Audio3d, "!state->ports.contains(port_id)"); - return ORBIS_AUDIO3D_ERROR_INVALID_PORT; - } - - auto& port = state->ports[port_id]; - std::scoped_lock lock{port.mutex}; - - if (!port.audioout_handles.empty()) { - for (const s32 handle : port.audioout_handles) { - const s32 ret = AudioOut::sceAudioOutOutput(handle, nullptr); - if (ret < 0) { - return ret; - } - } - return ORBIS_OK; - } - - if (port.mixed_queue.empty()) { - // Only mix if there's actually something to mix. - if (!port.bed_queue.empty() || - std::any_of(port.objects.begin(), port.objects.end(), - [](const auto& kv) { return !kv.second.pcm_queue.empty(); })) { - const s32 ret = sceAudio3dPortAdvance(port_id); - if (ret != ORBIS_OK && ret != ORBIS_AUDIO3D_ERROR_NOT_READY) { - return ret; - } - } - } - - if (port.mixed_queue.empty()) { - return ORBIS_OK; - } - - if (port.audio_out_handle < 0) { - AudioOut::OrbisAudioOutParamExtendedInformation ext_info{}; - ext_info.data_format.Assign(AUDIO3D_OUTPUT_FORMAT); - port.audio_out_handle = - AudioOut::sceAudioOutOpen(0xFF, AudioOut::OrbisAudioOutPort::Audio3d, 0, - port.parameters.granularity, AUDIO3D_SAMPLE_RATE, ext_info); - if (port.audio_out_handle < 0) { - return port.audio_out_handle; - } - } - - // Drain all queued mixed frames, blocking on each until consumed. - while (!port.mixed_queue.empty()) { - AudioData frame = port.mixed_queue.front(); - port.mixed_queue.pop_front(); - const s32 ret = AudioOut::sceAudioOutOutput(port.audio_out_handle, frame.sample_buffer); - std::free(frame.sample_buffer); - if (ret < 0) { - return ret; - } - } - - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dPortFreeState() { - LOG_ERROR(Lib_Audio3d, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dPortGetAttributesSupported() { - LOG_ERROR(Lib_Audio3d, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dPortGetList() { - LOG_ERROR(Lib_Audio3d, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dPortGetParameters() { - LOG_ERROR(Lib_Audio3d, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dPortGetQueueLevel(const OrbisAudio3dPortId port_id, u32* queue_level, - u32* queue_available) { - LOG_DEBUG(Lib_Audio3d, "called, port_id = {}, queue_level = {}, queue_available = {}", port_id, - static_cast(queue_level), static_cast(queue_available)); - - if (!state->ports.contains(port_id)) { - LOG_ERROR(Lib_Audio3d, "!state->ports.contains(port_id)"); - return ORBIS_AUDIO3D_ERROR_INVALID_PORT; - } - - if (!queue_level && !queue_available) { - return ORBIS_AUDIO3D_ERROR_INVALID_PARAMETER; - } - - const auto& port = state->ports[port_id]; - std::scoped_lock lock{port.mutex}; - const size_t size = port.mixed_queue.size(); - - if (queue_level) { - *queue_level = static_cast(size); - } - - if (queue_available) { - const u32 depth = port.parameters.queue_depth; - *queue_available = (size < depth) ? static_cast(depth - size) : 0u; - } - - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dPortGetState() { - LOG_ERROR(Lib_Audio3d, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dPortGetStatus() { - LOG_ERROR(Lib_Audio3d, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dPortOpen(const Libraries::UserService::OrbisUserServiceUserId user_id, - const OrbisAudio3dOpenParameters* parameters, - OrbisAudio3dPortId* port_id) { - LOG_INFO(Lib_Audio3d, "called, user_id = {}, parameters = {}, id = {}", user_id, - static_cast(parameters), static_cast(port_id)); - - if (!state) { - LOG_ERROR(Lib_Audio3d, "!initialized"); - return ORBIS_AUDIO3D_ERROR_NOT_READY; - } - - if (!parameters || !port_id) { - LOG_ERROR(Lib_Audio3d, "!parameters || !id"); - return ORBIS_AUDIO3D_ERROR_INVALID_PARAMETER; - } - - const int id = static_cast(state->ports.size()) + 1; - - if (id > 3) { - LOG_ERROR(Lib_Audio3d, "id > 3"); - return ORBIS_AUDIO3D_ERROR_OUT_OF_RESOURCES; - } - - *port_id = id; - auto& port = state->ports[id]; - std::memcpy( - &port.parameters, parameters, - std::min(parameters->size_this, static_cast(sizeof(OrbisAudio3dOpenParameters)))); - - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dPortPush(const OrbisAudio3dPortId port_id, - const OrbisAudio3dBlocking blocking) { - LOG_DEBUG(Lib_Audio3d, "called, port_id = {}, blocking = {}", port_id, - magic_enum::enum_name(blocking)); - - if (!state->ports.contains(port_id)) { - LOG_ERROR(Lib_Audio3d, "!state->ports.contains(port_id)"); - return ORBIS_AUDIO3D_ERROR_INVALID_PORT; - } - - auto& port = state->ports[port_id]; - - if (port.parameters.buffer_mode != - OrbisAudio3dBufferMode::ORBIS_AUDIO3D_BUFFER_ADVANCE_AND_PUSH) { - LOG_ERROR(Lib_Audio3d, "port doesn't have push capability"); - return ORBIS_AUDIO3D_ERROR_NOT_SUPPORTED; - } - - const u32 depth = port.parameters.queue_depth; - - if (port.audio_out_handle < 0) { - AudioOut::OrbisAudioOutParamExtendedInformation ext_info{}; - ext_info.data_format.Assign(AUDIO3D_OUTPUT_FORMAT); - - port.audio_out_handle = - AudioOut::sceAudioOutOpen(0xFF, AudioOut::OrbisAudioOutPort::Audio3d, 0, - port.parameters.granularity, AUDIO3D_SAMPLE_RATE, ext_info); - - if (port.audio_out_handle < 0) - return port.audio_out_handle; - } - - // Function that submits exactly one frame (if available) - auto submit_one_frame = [&](bool& submitted) -> s32 { - AudioData frame; - { - std::scoped_lock lock{port.mutex}; - - if (port.mixed_queue.empty()) { - submitted = false; - return ORBIS_OK; - } - - frame = port.mixed_queue.front(); - port.mixed_queue.pop_front(); - } - - const s32 ret = AudioOut::sceAudioOutOutput(port.audio_out_handle, frame.sample_buffer); - - std::free(frame.sample_buffer); - - if (ret < 0) - return ret; - - submitted = true; - return ORBIS_OK; - }; - - // if not full, return immediately - { - std::scoped_lock lock{port.mutex}; - if (port.mixed_queue.size() < depth) { - return ORBIS_OK; - } - } - - // Submit one frame to free space - bool submitted = false; - s32 ret = submit_one_frame(submitted); - if (ret < 0) - return ret; - - if (!submitted) - return ORBIS_OK; - - // ASYNC: free exactly one slot and return - if (blocking == OrbisAudio3dBlocking::ORBIS_AUDIO3D_BLOCKING_ASYNC) { - return ORBIS_OK; - } - - // SYNC: ensure at least one slot is free - // (drain until size < depth) - while (true) { - { - std::scoped_lock lock{port.mutex}; - if (port.mixed_queue.size() < depth) - break; - } - - bool drained = false; - ret = submit_one_frame(drained); - if (ret < 0) - return ret; - - if (!drained) - break; - } - - return ORBIS_OK; -} -s32 PS4_SYSV_ABI sceAudio3dPortQueryDebug() { - LOG_ERROR(Lib_Audio3d, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dPortSetAttribute(const OrbisAudio3dPortId port_id, - const OrbisAudio3dAttributeId attribute_id, - void* attribute, const u64 attribute_size) { - LOG_INFO(Lib_Audio3d, - "called, port_id = {}, attribute_id = {}, attribute = {}, attribute_size = {}", - port_id, static_cast(attribute_id), attribute, attribute_size); - - if (!state->ports.contains(port_id)) { - LOG_ERROR(Lib_Audio3d, "!state->ports.contains(port_id)"); - return ORBIS_AUDIO3D_ERROR_INVALID_PORT; - } - - if (!attribute) { - LOG_ERROR(Lib_Audio3d, "!attribute"); - return ORBIS_AUDIO3D_ERROR_INVALID_PARAMETER; - } - - // TODO - - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dReportRegisterHandler() { - LOG_ERROR(Lib_Audio3d, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dReportUnregisterHandler() { - LOG_ERROR(Lib_Audio3d, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dSetGpuRenderer() { - LOG_ERROR(Lib_Audio3d, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dStrError() { - LOG_ERROR(Lib_Audio3d, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dTerminate() { - LOG_INFO(Lib_Audio3d, "called"); - if (!state) { - return ORBIS_AUDIO3D_ERROR_NOT_READY; - } - - std::vector port_ids; - for (const auto& [id, _] : state->ports) { - port_ids.push_back(id); - } - for (const auto id : port_ids) { - sceAudio3dPortClose(id); - } - - state.reset(); - return ORBIS_OK; -} - -void RegisterLib(Core::Loader::SymbolsResolver* sym) { - LIB_FUNCTION("pZlOm1aF3aA", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dAudioOutClose); - LIB_FUNCTION("ucEsi62soTo", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dAudioOutOpen); - LIB_FUNCTION("7NYEzJ9SJbM", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dAudioOutOutput); - LIB_FUNCTION("HbxYY27lK6E", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dAudioOutOutputs); - LIB_FUNCTION("9tEwE0GV0qo", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dBedWrite); - LIB_FUNCTION("xH4Q9UILL3o", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dBedWrite2); - LIB_FUNCTION("lvWMW6vEqFU", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dCreateSpeakerArray); - LIB_FUNCTION("8hm6YdoQgwg", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dDeleteSpeakerArray); - LIB_FUNCTION("Im+jOoa5WAI", "libSceAudio3d", 1, "libSceAudio3d", - sceAudio3dGetDefaultOpenParameters); - LIB_FUNCTION("kEqqyDkmgdI", "libSceAudio3d", 1, "libSceAudio3d", - sceAudio3dGetSpeakerArrayMemorySize); - LIB_FUNCTION("-R1DukFq7Dk", "libSceAudio3d", 1, "libSceAudio3d", - sceAudio3dGetSpeakerArrayMixCoefficients); - LIB_FUNCTION("-Re+pCWvwjQ", "libSceAudio3d", 1, "libSceAudio3d", - sceAudio3dGetSpeakerArrayMixCoefficients2); - LIB_FUNCTION("UmCvjSmuZIw", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dInitialize); - LIB_FUNCTION("jO2tec4dJ2M", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dObjectReserve); - LIB_FUNCTION("V1FBFpNIAzk", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dObjectSetAttribute); - LIB_FUNCTION("4uyHN9q4ZeU", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dObjectSetAttributes); - LIB_FUNCTION("1HXxo-+1qCw", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dObjectUnreserve); - LIB_FUNCTION("lw0qrdSjZt8", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dPortAdvance); - LIB_FUNCTION("OyVqOeVNtSk", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dPortClose); - LIB_FUNCTION("UHFOgVNz0kk", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dPortCreate); - LIB_FUNCTION("Mw9mRQtWepY", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dPortDestroy); - LIB_FUNCTION("ZOGrxWLgQzE", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dPortFlush); - LIB_FUNCTION("uJ0VhGcxCTQ", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dPortFreeState); - LIB_FUNCTION("9ZA23Ia46Po", "libSceAudio3d", 1, "libSceAudio3d", - sceAudio3dPortGetAttributesSupported); - LIB_FUNCTION("SEggctIeTcI", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dPortGetList); - LIB_FUNCTION("flPcUaXVXcw", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dPortGetParameters); - LIB_FUNCTION("YaaDbDwKpFM", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dPortGetQueueLevel); - LIB_FUNCTION("CKHlRW2E9dA", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dPortGetState); - LIB_FUNCTION("iRX6GJs9tvE", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dPortGetStatus); - LIB_FUNCTION("XeDDK0xJWQA", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dPortOpen); - LIB_FUNCTION("VEVhZ9qd4ZY", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dPortPush); - LIB_FUNCTION("-pzYDZozm+M", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dPortQueryDebug); - LIB_FUNCTION("Yq9bfUQ0uJg", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dPortSetAttribute); - LIB_FUNCTION("QfNXBrKZeI0", "libSceAudio3d", 1, "libSceAudio3d", - sceAudio3dReportRegisterHandler); - LIB_FUNCTION("psv2gbihC1A", "libSceAudio3d", 1, "libSceAudio3d", - sceAudio3dReportUnregisterHandler); - LIB_FUNCTION("yEYXcbAGK14", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dSetGpuRenderer); - LIB_FUNCTION("Aacl5qkRU6U", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dStrError); - LIB_FUNCTION("WW1TS2iz5yc", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dTerminate); -}; - -} // namespace Libraries::Audio3d diff --git a/src/core/libraries/audio3d/audio3d.h b/src/core/libraries/audio3d/audio3d.h deleted file mode 100644 index 0db7fa83b..000000000 --- a/src/core/libraries/audio3d/audio3d.h +++ /dev/null @@ -1,183 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2025-2026 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include -#include -#include -#include -#include - -#include "common/types.h" -#include "core/libraries/audio/audioout.h" - -namespace Core::Loader { -class SymbolsResolver; -} - -namespace Libraries::Audio3d { - -constexpr int ORBIS_AUDIO3D_OBJECT_INVALID = 0xFFFFFFFF; - -enum class OrbisAudio3dRate : u32 { - ORBIS_AUDIO3D_RATE_48000 = 0, -}; - -enum class OrbisAudio3dBufferMode : u32 { - ORBIS_AUDIO3D_BUFFER_NO_ADVANCE = 0, - ORBIS_AUDIO3D_BUFFER_ADVANCE_NO_PUSH = 1, - ORBIS_AUDIO3D_BUFFER_ADVANCE_AND_PUSH = 2, -}; - -struct OrbisAudio3dOpenParameters { - u64 size_this; - u32 granularity; - OrbisAudio3dRate rate; - u32 max_objects; - u32 queue_depth; - OrbisAudio3dBufferMode buffer_mode; - int : 32; - u32 num_beds; -}; - -enum class OrbisAudio3dFormat : u32 { - ORBIS_AUDIO3D_FORMAT_S16 = 0, - ORBIS_AUDIO3D_FORMAT_FLOAT = 1, -}; - -enum class OrbisAudio3dOutputRoute : u32 { - ORBIS_AUDIO3D_OUTPUT_BOTH = 0, - ORBIS_AUDIO3D_OUTPUT_HMU_ONLY = 1, - ORBIS_AUDIO3D_OUTPUT_TV_ONLY = 2, -}; - -enum class OrbisAudio3dBlocking : u32 { - ORBIS_AUDIO3D_BLOCKING_ASYNC = 0, - ORBIS_AUDIO3D_BLOCKING_SYNC = 1, -}; - -struct OrbisAudio3dPcm { - OrbisAudio3dFormat format; - void* sample_buffer; - u32 num_samples; -}; - -enum class OrbisAudio3dAttributeId : u32 { - ORBIS_AUDIO3D_ATTRIBUTE_PCM = 1, - ORBIS_AUDIO3D_ATTRIBUTE_POSITION = 2, - ORBIS_AUDIO3D_ATTRIBUTE_GAIN = 3, - ORBIS_AUDIO3D_ATTRIBUTE_SPREAD = 4, - ORBIS_AUDIO3D_ATTRIBUTE_PRIORITY = 5, - ORBIS_AUDIO3D_ATTRIBUTE_PASSTHROUGH = 6, - ORBIS_AUDIO3D_ATTRIBUTE_AMBISONICS = 7, - ORBIS_AUDIO3D_ATTRIBUTE_APPLICATION_SPECIFIC = 8, - ORBIS_AUDIO3D_ATTRIBUTE_RESET_STATE = 9, - ORBIS_AUDIO3D_ATTRIBUTE_RESTRICTED = 10, - ORBIS_AUDIO3D_ATTRIBUTE_OUTPUT_ROUTE = 11, -}; - -using OrbisAudio3dPortId = u32; -using OrbisAudio3dObjectId = u32; -using OrbisAudio3dAmbisonics = u32; - -struct OrbisAudio3dAttribute { - OrbisAudio3dAttributeId attribute_id; - int : 32; - void* value; - u64 value_size; -}; - -struct AudioData { - u8* sample_buffer; - u32 num_samples; - u32 num_channels{1}; // channels in sample_buffer - OrbisAudio3dFormat format{ - OrbisAudio3dFormat::ORBIS_AUDIO3D_FORMAT_S16}; // format of sample_buffer -}; - -struct ObjectState { - std::deque pcm_queue; - std::unordered_map> persistent_attributes; -}; - -struct Port { - mutable std::recursive_mutex mutex; - OrbisAudio3dOpenParameters parameters{}; - // Opened lazily on the first sceAudio3dPortPush call. - s32 audio_out_handle{-1}; - // Handles explicitly opened by the game via sceAudio3dAudioOutOpen. - std::vector audioout_handles; - // Reserved objects and their state. - std::unordered_map objects; - // increasing counter for generating unique object IDs within this port. - OrbisAudio3dObjectId next_object_id{0}; - // Bed audio queue - std::deque bed_queue; - // Mixed stereo frames ready to be consumed by sceAudio3dPortPush. - std::deque mixed_queue; -}; - -struct Audio3dState { - std::unordered_map ports; -}; - -s32 PS4_SYSV_ABI sceAudio3dAudioOutClose(s32 handle); -s32 PS4_SYSV_ABI sceAudio3dAudioOutOpen(OrbisAudio3dPortId port_id, - Libraries::UserService::OrbisUserServiceUserId user_id, - s32 type, s32 index, u32 len, u32 freq, - AudioOut::OrbisAudioOutParamExtendedInformation param); -s32 PS4_SYSV_ABI sceAudio3dAudioOutOutput(s32 handle, void* ptr); -s32 PS4_SYSV_ABI sceAudio3dAudioOutOutputs(AudioOut::OrbisAudioOutOutputParam* param, u32 num); -s32 PS4_SYSV_ABI sceAudio3dBedWrite(OrbisAudio3dPortId port_id, u32 num_channels, - OrbisAudio3dFormat format, void* buffer, u32 num_samples); -s32 PS4_SYSV_ABI sceAudio3dBedWrite2(OrbisAudio3dPortId port_id, u32 num_channels, - OrbisAudio3dFormat format, void* buffer, u32 num_samples, - OrbisAudio3dOutputRoute output_route, bool restricted); -s32 PS4_SYSV_ABI sceAudio3dCreateSpeakerArray(); -s32 PS4_SYSV_ABI sceAudio3dDeleteSpeakerArray(); -s32 PS4_SYSV_ABI sceAudio3dGetDefaultOpenParameters(OrbisAudio3dOpenParameters* params); -s32 PS4_SYSV_ABI sceAudio3dGetSpeakerArrayMemorySize(); -s32 PS4_SYSV_ABI sceAudio3dGetSpeakerArrayMixCoefficients(); -s32 PS4_SYSV_ABI sceAudio3dGetSpeakerArrayMixCoefficients2(); -s32 PS4_SYSV_ABI sceAudio3dInitialize(s64 reserved); -s32 PS4_SYSV_ABI sceAudio3dObjectReserve(OrbisAudio3dPortId port_id, - OrbisAudio3dObjectId* object_id); -s32 PS4_SYSV_ABI sceAudio3dObjectSetAttribute(OrbisAudio3dPortId port_id, - OrbisAudio3dObjectId object_id, - OrbisAudio3dAttributeId attribute_id, - const void* attribute, u64 attribute_size); -s32 PS4_SYSV_ABI sceAudio3dObjectSetAttributes(OrbisAudio3dPortId port_id, - OrbisAudio3dObjectId object_id, u64 num_attributes, - const OrbisAudio3dAttribute* attribute_array); -s32 PS4_SYSV_ABI sceAudio3dObjectUnreserve(OrbisAudio3dPortId port_id, - OrbisAudio3dObjectId object_id); -s32 PS4_SYSV_ABI sceAudio3dPortAdvance(OrbisAudio3dPortId port_id); -s32 PS4_SYSV_ABI sceAudio3dPortClose(OrbisAudio3dPortId port_id); -s32 PS4_SYSV_ABI sceAudio3dPortCreate(); -s32 PS4_SYSV_ABI sceAudio3dPortDestroy(); -s32 PS4_SYSV_ABI sceAudio3dPortFlush(OrbisAudio3dPortId port_id); -s32 PS4_SYSV_ABI sceAudio3dPortFreeState(); -s32 PS4_SYSV_ABI sceAudio3dPortGetAttributesSupported(); -s32 PS4_SYSV_ABI sceAudio3dPortGetList(); -s32 PS4_SYSV_ABI sceAudio3dPortGetParameters(); -s32 PS4_SYSV_ABI sceAudio3dPortGetQueueLevel(OrbisAudio3dPortId port_id, u32* queue_level, - u32* queue_available); -s32 PS4_SYSV_ABI sceAudio3dPortGetState(); -s32 PS4_SYSV_ABI sceAudio3dPortGetStatus(); -s32 PS4_SYSV_ABI sceAudio3dPortOpen(Libraries::UserService::OrbisUserServiceUserId user_id, - const OrbisAudio3dOpenParameters* parameters, - OrbisAudio3dPortId* port_id); -s32 PS4_SYSV_ABI sceAudio3dPortPush(OrbisAudio3dPortId port_id, OrbisAudio3dBlocking blocking); -s32 PS4_SYSV_ABI sceAudio3dPortQueryDebug(); -s32 PS4_SYSV_ABI sceAudio3dPortSetAttribute(OrbisAudio3dPortId port_id, - OrbisAudio3dAttributeId attribute_id, void* attribute, - u64 attribute_size); -s32 PS4_SYSV_ABI sceAudio3dReportRegisterHandler(); -s32 PS4_SYSV_ABI sceAudio3dReportUnregisterHandler(); -s32 PS4_SYSV_ABI sceAudio3dSetGpuRenderer(); -s32 PS4_SYSV_ABI sceAudio3dStrError(); -s32 PS4_SYSV_ABI sceAudio3dTerminate(); - -void RegisterLib(Core::Loader::SymbolsResolver* sym); -} // namespace Libraries::Audio3d diff --git a/src/core/libraries/audio3d/audio3d_error.h b/src/core/libraries/audio3d/audio3d_error.h deleted file mode 100644 index ff9d9749c..000000000 --- a/src/core/libraries/audio3d/audio3d_error.h +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -constexpr int ORBIS_AUDIO3D_ERROR_UNKNOWN = 0x80EA0001; -constexpr int ORBIS_AUDIO3D_ERROR_INVALID_PORT = 0x80EA0002; -constexpr int ORBIS_AUDIO3D_ERROR_INVALID_OBJECT = 0x80EA0003; -constexpr int ORBIS_AUDIO3D_ERROR_INVALID_PARAMETER = 0x80EA0004; -constexpr int ORBIS_AUDIO3D_ERROR_OUT_OF_MEMORY = 0x80EA0005; -constexpr int ORBIS_AUDIO3D_ERROR_OUT_OF_RESOURCES = 0x80EA0006; -constexpr int ORBIS_AUDIO3D_ERROR_NOT_READY = 0x80EA0007; -constexpr int ORBIS_AUDIO3D_ERROR_NOT_SUPPORTED = 0x80EA0008; diff --git a/src/core/libraries/audio3d/audio3d_openal.cpp b/src/core/libraries/audio3d/audio3d_openal.cpp deleted file mode 100644 index 53bbb8b24..000000000 --- a/src/core/libraries/audio3d/audio3d_openal.cpp +++ /dev/null @@ -1,997 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2025-2026 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include -#include -#include - -#include "common/assert.h" -#include "common/logging/log.h" -#include "core/libraries/audio/audioout.h" -#include "core/libraries/audio/audioout_error.h" -#include "core/libraries/audio3d/audio3d_error.h" -#include "core/libraries/audio3d/audio3d_openal.h" -#include "core/libraries/error_codes.h" -#include "core/libraries/libs.h" - -namespace Libraries::Audio3dOpenAL { - -static constexpr u32 AUDIO3D_SAMPLE_RATE = 48000; - -static constexpr AudioOut::OrbisAudioOutParamFormat AUDIO3D_OUTPUT_FORMAT = - AudioOut::OrbisAudioOutParamFormat::S16Stereo; -static constexpr u32 AUDIO3D_OUTPUT_NUM_CHANNELS = 2; - -static std::unique_ptr state; - -s32 PS4_SYSV_ABI sceAudio3dAudioOutClose(const s32 handle) { - LOG_INFO(Lib_Audio3d, "called, handle = {}", handle); - - // Remove from any port that was tracking this handle. - if (state) { - for (auto& [port_id, port] : state->ports) { - std::scoped_lock lock{port.mutex}; - auto& handles = port.audioout_handles; - handles.erase(std::remove(handles.begin(), handles.end(), handle), handles.end()); - } - } - - return AudioOut::sceAudioOutClose(handle); -} - -s32 PS4_SYSV_ABI sceAudio3dAudioOutOpen( - const OrbisAudio3dPortId port_id, const Libraries::UserService::OrbisUserServiceUserId user_id, - s32 type, const s32 index, const u32 len, const u32 freq, - const AudioOut::OrbisAudioOutParamExtendedInformation param) { - LOG_INFO(Lib_Audio3d, - "called, port_id = {}, user_id = {}, type = {}, index = {}, len = {}, freq = {}", - port_id, user_id, type, index, len, freq); - - if (!state->ports.contains(port_id)) { - LOG_ERROR(Lib_Audio3d, "!state->ports.contains(port_id)"); - return ORBIS_AUDIO3D_ERROR_INVALID_PORT; - } - - std::scoped_lock lock{state->ports[port_id].mutex}; - if (len != state->ports[port_id].parameters.granularity) { - LOG_ERROR(Lib_Audio3d, "len != state->ports[port_id].parameters.granularity"); - return ORBIS_AUDIO3D_ERROR_INVALID_PARAMETER; - } - - const s32 handle = sceAudioOutOpen(user_id, static_cast(type), - index, len, freq, param); - if (handle < 0) { - return handle; - } - - // Track this handle in the port so sceAudio3dPortFlush can use it for sync. - state->ports[port_id].audioout_handles.push_back(handle); - return handle; -} - -s32 PS4_SYSV_ABI sceAudio3dAudioOutOutput(const s32 handle, void* ptr) { - LOG_DEBUG(Lib_Audio3d, "called, handle = {}, ptr = {}", handle, ptr); - - if (!ptr) { - LOG_ERROR(Lib_Audio3d, "!ptr"); - return ORBIS_AUDIO3D_ERROR_INVALID_PARAMETER; - } - - if (handle < 0 || (handle & 0xFFFF) > 25) { - LOG_ERROR(Lib_Audio3d, "handle < 0 || (handle & 0xFFFF) > 25"); - return ORBIS_AUDIO3D_ERROR_INVALID_PORT; - } - - return AudioOut::sceAudioOutOutput(handle, ptr); -} - -s32 PS4_SYSV_ABI sceAudio3dAudioOutOutputs(AudioOut::OrbisAudioOutOutputParam* param, - const u32 num) { - LOG_DEBUG(Lib_Audio3d, "called, param = {}, num = {}", static_cast(param), num); - - if (!param || !num) { - LOG_ERROR(Lib_Audio3d, "!param || !num"); - return ORBIS_AUDIO3D_ERROR_INVALID_PARAMETER; - } - - return AudioOut::sceAudioOutOutputs(param, num); -} - -static s32 ConvertAndEnqueue(std::deque& queue, const OrbisAudio3dPcm& pcm, - const u32 num_channels, const u32 granularity) { - if (!pcm.sample_buffer || !pcm.num_samples) { - return ORBIS_AUDIO3D_ERROR_INVALID_PARAMETER; - } - - const u32 bytes_per_sample = - (pcm.format == OrbisAudio3dFormat::ORBIS_AUDIO3D_FORMAT_S16) ? sizeof(s16) : sizeof(float); - - // Always allocate exactly granularity samples (zeroed = silence for padding). - const u32 dst_bytes = granularity * num_channels * bytes_per_sample; - u8* copy = static_cast(std::calloc(1, dst_bytes)); - if (!copy) { - return ORBIS_AUDIO3D_ERROR_OUT_OF_MEMORY; - } - - // Copy min(provided, granularity) samples — extra are dropped, shortage stays zero. - const u32 samples_to_copy = std::min(pcm.num_samples, granularity); - std::memcpy(copy, pcm.sample_buffer, samples_to_copy * num_channels * bytes_per_sample); - - queue.emplace_back(AudioData{ - .sample_buffer = copy, - .num_samples = granularity, - .num_channels = num_channels, - .format = pcm.format, - }); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dBedWrite(const OrbisAudio3dPortId port_id, const u32 num_channels, - const OrbisAudio3dFormat format, void* buffer, - const u32 num_samples) { - return sceAudio3dBedWrite2(port_id, num_channels, format, buffer, num_samples, - OrbisAudio3dOutputRoute::ORBIS_AUDIO3D_OUTPUT_BOTH, false); -} - -s32 PS4_SYSV_ABI sceAudio3dBedWrite2(const OrbisAudio3dPortId port_id, const u32 num_channels, - const OrbisAudio3dFormat format, void* buffer, - const u32 num_samples, - const OrbisAudio3dOutputRoute output_route, - const bool restricted) { - LOG_DEBUG( - Lib_Audio3d, - "called, port_id = {}, num_channels = {}, format = {}, num_samples = {}, output_route " - "= {}, restricted = {}", - port_id, num_channels, magic_enum::enum_name(format), num_samples, - magic_enum::enum_name(output_route), restricted); - - if (!state->ports.contains(port_id)) { - LOG_ERROR(Lib_Audio3d, "!state->ports.contains(port_id)"); - return ORBIS_AUDIO3D_ERROR_INVALID_PORT; - } - - if (output_route > OrbisAudio3dOutputRoute::ORBIS_AUDIO3D_OUTPUT_BOTH) { - LOG_ERROR(Lib_Audio3d, "output_route > ORBIS_AUDIO3D_OUTPUT_BOTH"); - return ORBIS_AUDIO3D_ERROR_INVALID_PARAMETER; - } - - if (format > OrbisAudio3dFormat::ORBIS_AUDIO3D_FORMAT_FLOAT) { - LOG_ERROR(Lib_Audio3d, "format > ORBIS_AUDIO3D_FORMAT_FLOAT"); - return ORBIS_AUDIO3D_ERROR_INVALID_PARAMETER; - } - - if (num_channels != 2 && num_channels != 6 && num_channels != 8) { - LOG_ERROR(Lib_Audio3d, "num_channels must be 2, 6, or 8"); - return ORBIS_AUDIO3D_ERROR_INVALID_PARAMETER; - } - - if (!buffer || !num_samples) { - LOG_ERROR(Lib_Audio3d, "!buffer || !num_samples"); - return ORBIS_AUDIO3D_ERROR_INVALID_PARAMETER; - } - - if (format == OrbisAudio3dFormat::ORBIS_AUDIO3D_FORMAT_FLOAT) { - if ((reinterpret_cast(buffer) & 3) != 0) { - LOG_ERROR(Lib_Audio3d, "buffer & 3 != 0"); - return ORBIS_AUDIO3D_ERROR_INVALID_PARAMETER; - } - } else if (format == OrbisAudio3dFormat::ORBIS_AUDIO3D_FORMAT_S16) { - if ((reinterpret_cast(buffer) & 1) != 0) { - LOG_ERROR(Lib_Audio3d, "buffer & 1 != 0"); - return ORBIS_AUDIO3D_ERROR_INVALID_PARAMETER; - } - } - - std::scoped_lock lock{state->ports[port_id].mutex}; - return ConvertAndEnqueue(state->ports[port_id].bed_queue, - OrbisAudio3dPcm{ - .format = format, - .sample_buffer = buffer, - .num_samples = num_samples, - }, - num_channels, state->ports[port_id].parameters.granularity); -} - -s32 PS4_SYSV_ABI sceAudio3dCreateSpeakerArray() { - LOG_ERROR(Lib_Audio3d, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dDeleteSpeakerArray() { - LOG_ERROR(Lib_Audio3d, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dGetDefaultOpenParameters(OrbisAudio3dOpenParameters* params) { - LOG_DEBUG(Lib_Audio3d, "called"); - if (params) { - auto default_params = OrbisAudio3dOpenParameters{ - .size_this = 0x20, - .granularity = 0x100, - .rate = OrbisAudio3dRate::ORBIS_AUDIO3D_RATE_48000, - .max_objects = 512, - .queue_depth = 2, - .buffer_mode = OrbisAudio3dBufferMode::ORBIS_AUDIO3D_BUFFER_ADVANCE_AND_PUSH, - }; - memcpy(params, &default_params, 0x20); - } - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dGetSpeakerArrayMemorySize() { - LOG_ERROR(Lib_Audio3d, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dGetSpeakerArrayMixCoefficients() { - LOG_ERROR(Lib_Audio3d, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dGetSpeakerArrayMixCoefficients2() { - LOG_ERROR(Lib_Audio3d, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dInitialize(const s64 reserved) { - LOG_INFO(Lib_Audio3d, "called, reserved = {}", reserved); - - if (reserved != 0) { - LOG_ERROR(Lib_Audio3d, "reserved != 0"); - return ORBIS_AUDIO3D_ERROR_INVALID_PARAMETER; - } - - if (state) { - LOG_ERROR(Lib_Audio3d, "already initialized"); - return ORBIS_AUDIO3D_ERROR_NOT_READY; - } - - state = std::make_unique(); - - if (const auto init_ret = AudioOut::sceAudioOutInit(); - init_ret < 0 && init_ret != ORBIS_AUDIO_OUT_ERROR_ALREADY_INIT) { - return init_ret; - } - - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dObjectReserve(const OrbisAudio3dPortId port_id, - OrbisAudio3dObjectId* object_id) { - LOG_INFO(Lib_Audio3d, "called, port_id = {}, object_id = {}", port_id, - static_cast(object_id)); - - if (!object_id) { - LOG_ERROR(Lib_Audio3d, "!object_id"); - return ORBIS_AUDIO3D_ERROR_INVALID_PARAMETER; - } - - *object_id = ORBIS_AUDIO3D_OBJECT_INVALID; - - if (!state->ports.contains(port_id)) { - LOG_ERROR(Lib_Audio3d, "!state->ports.contains(port_id)"); - return ORBIS_AUDIO3D_ERROR_INVALID_PORT; - } - - auto& port = state->ports[port_id]; - std::scoped_lock lock{port.mutex}; - - // Enforce the max_objects limit set at PortOpen time. - if (port.objects.size() >= port.parameters.max_objects) { - LOG_ERROR(Lib_Audio3d, "port has no available objects (max_objects = {})", - port.parameters.max_objects); - return ORBIS_AUDIO3D_ERROR_OUT_OF_RESOURCES; - } - - // Counter lives in the Port so it resets when the port is closed and reopened. - do { - ++port.next_object_id; - } while (port.next_object_id == 0 || - port.next_object_id == static_cast(ORBIS_AUDIO3D_OBJECT_INVALID) || - port.objects.contains(port.next_object_id)); - - *object_id = port.next_object_id; - port.objects.emplace(*object_id, ObjectState{}); - LOG_INFO(Lib_Audio3d, "reserved object_id = {}", *object_id); - - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dObjectSetAttribute(const OrbisAudio3dPortId port_id, - const OrbisAudio3dObjectId object_id, - const OrbisAudio3dAttributeId attribute_id, - const void* attribute, const u64 attribute_size) { - LOG_DEBUG(Lib_Audio3d, "called, port_id = {}, object_id = {}, attribute_id = {:#x}, size = {}", - port_id, object_id, static_cast(attribute_id), attribute_size); - - if (!state->ports.contains(port_id)) { - LOG_ERROR(Lib_Audio3d, "!state->ports.contains(port_id)"); - return ORBIS_AUDIO3D_ERROR_INVALID_PORT; - } - - auto& port = state->ports[port_id]; - std::scoped_lock lock{port.mutex}; - if (!port.objects.contains(object_id)) { - LOG_DEBUG(Lib_Audio3d, "object_id {} not reserved (race with Unreserve?), no-op", - object_id); - return ORBIS_OK; - } - - if (!attribute_size && - attribute_id != OrbisAudio3dAttributeId::ORBIS_AUDIO3D_ATTRIBUTE_RESET_STATE) { - LOG_ERROR(Lib_Audio3d, "!attribute_size for non-reset attribute"); - return ORBIS_AUDIO3D_ERROR_INVALID_PARAMETER; - } - - auto& obj = port.objects[object_id]; - - // RESET_STATE clears all attributes and queued PCM; it takes no value. - if (attribute_id == OrbisAudio3dAttributeId::ORBIS_AUDIO3D_ATTRIBUTE_RESET_STATE) { - for (auto& data : obj.pcm_queue) { - std::free(data.sample_buffer); - } - obj.pcm_queue.clear(); - obj.persistent_attributes.clear(); - LOG_DEBUG(Lib_Audio3d, "RESET_STATE for object {}", object_id); - return ORBIS_OK; - } - - // Store the attribute so it's available when we implement it. - const auto* src = static_cast(attribute); - obj.persistent_attributes[static_cast(attribute_id)].assign(src, src + attribute_size); - - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dObjectSetAttributes(const OrbisAudio3dPortId port_id, - OrbisAudio3dObjectId object_id, - const u64 num_attributes, - const OrbisAudio3dAttribute* attribute_array) { - LOG_DEBUG(Lib_Audio3d, - "called, port_id = {}, object_id = {}, num_attributes = {}, attribute_array = {}", - port_id, object_id, num_attributes, fmt::ptr(attribute_array)); - - if (!state->ports.contains(port_id)) { - LOG_ERROR(Lib_Audio3d, "!state->ports.contains(port_id)"); - return ORBIS_AUDIO3D_ERROR_INVALID_PORT; - } - - if (!num_attributes || !attribute_array) { - LOG_ERROR(Lib_Audio3d, "!num_attributes || !attribute_array"); - return ORBIS_AUDIO3D_ERROR_INVALID_PARAMETER; - } - - auto& port = state->ports[port_id]; - std::scoped_lock lock{port.mutex}; - if (!port.objects.contains(object_id)) { - LOG_DEBUG(Lib_Audio3d, "object_id {} not reserved", object_id); - return ORBIS_OK; - } - - auto& obj = port.objects[object_id]; - - // First pass: handle RESET_STATE. - for (u64 i = 0; i < num_attributes; i++) { - if (attribute_array[i].attribute_id == - OrbisAudio3dAttributeId::ORBIS_AUDIO3D_ATTRIBUTE_RESET_STATE) { - for (auto& data : obj.pcm_queue) { - std::free(data.sample_buffer); - } - obj.pcm_queue.clear(); - obj.persistent_attributes.clear(); - LOG_DEBUG(Lib_Audio3d, "RESET_STATE for object {}", object_id); - break; // Only one reset is needed even if listed multiple times. - } - } - - // Second pass: apply all other attributes. - for (u64 i = 0; i < num_attributes; i++) { - const auto& attr = attribute_array[i]; - - switch (attr.attribute_id) { - case OrbisAudio3dAttributeId::ORBIS_AUDIO3D_ATTRIBUTE_RESET_STATE: - break; // Already applied in first pass above. - case OrbisAudio3dAttributeId::ORBIS_AUDIO3D_ATTRIBUTE_PCM: { - if (attr.value_size < sizeof(OrbisAudio3dPcm)) { - LOG_ERROR(Lib_Audio3d, "PCM attribute value_size too small"); - continue; - } - const auto pcm = static_cast(attr.value); - // Object audio is always mono (1 channel). - if (const auto ret = - ConvertAndEnqueue(obj.pcm_queue, *pcm, 1, port.parameters.granularity); - ret != ORBIS_OK) { - return ret; - } - break; - } - default: { - // Store the other attributes in the ObjectState so they're available when we - // implement them. - if (attr.value && attr.value_size > 0) { - const auto* src = static_cast(attr.value); - obj.persistent_attributes[static_cast(attr.attribute_id)].assign( - src, src + attr.value_size); - } - LOG_DEBUG(Lib_Audio3d, "Stored attribute {:#x} for object {}", - static_cast(attr.attribute_id), object_id); - break; - } - } - } - - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dObjectUnreserve(const OrbisAudio3dPortId port_id, - const OrbisAudio3dObjectId object_id) { - LOG_DEBUG(Lib_Audio3d, "called, port_id = {}, object_id = {}", port_id, object_id); - - if (!state->ports.contains(port_id)) { - LOG_ERROR(Lib_Audio3d, "!state->ports.contains(port_id)"); - return ORBIS_AUDIO3D_ERROR_INVALID_PORT; - } - - auto& port = state->ports[port_id]; - std::scoped_lock lock{port.mutex}; - - if (!port.objects.contains(object_id)) { - LOG_ERROR(Lib_Audio3d, "object_id not reserved"); - return ORBIS_AUDIO3D_ERROR_INVALID_OBJECT; - } - - // Free any queued PCM audio for this object. - for (auto& data : port.objects[object_id].pcm_queue) { - std::free(data.sample_buffer); - } - - port.objects.erase(object_id); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dPortAdvance(const OrbisAudio3dPortId port_id) { - LOG_DEBUG(Lib_Audio3d, "called, port_id = {}", port_id); - - if (!state->ports.contains(port_id)) { - LOG_ERROR(Lib_Audio3d, "!state->ports.contains(port_id)"); - return ORBIS_AUDIO3D_ERROR_INVALID_PORT; - } - - auto& port = state->ports[port_id]; - - if (port.parameters.buffer_mode == OrbisAudio3dBufferMode::ORBIS_AUDIO3D_BUFFER_NO_ADVANCE) { - LOG_ERROR(Lib_Audio3d, "port doesn't have advance capability"); - return ORBIS_AUDIO3D_ERROR_NOT_SUPPORTED; - } - - if (port.mixed_queue.size() >= port.parameters.queue_depth) { - LOG_WARNING(Lib_Audio3d, "mixed queue full (depth={}), dropping advance", - port.parameters.queue_depth); - return ORBIS_AUDIO3D_ERROR_NOT_READY; - } - - const u32 granularity = port.parameters.granularity; - const u32 out_samples = granularity * AUDIO3D_OUTPUT_NUM_CHANNELS; - - // ---- FLOAT MIX BUFFER ---- - float* mix_float = static_cast(std::calloc(out_samples, sizeof(float))); - if (!mix_float) - return ORBIS_AUDIO3D_ERROR_OUT_OF_MEMORY; - - auto mix_in = [&](std::deque& queue, const float gain) { - if (queue.empty()) - return; - - // default gain is 0.0 — objects with no GAIN set are silent. - if (gain == 0.0f) { - AudioData data = queue.front(); - queue.pop_front(); - std::free(data.sample_buffer); - return; - } - - AudioData data = queue.front(); - queue.pop_front(); - - const u32 frames = std::min(granularity, data.num_samples); - const u32 channels = data.num_channels; - - if (data.format == OrbisAudio3dFormat::ORBIS_AUDIO3D_FORMAT_S16) { - const s16* src = reinterpret_cast(data.sample_buffer); - - for (u32 i = 0; i < frames; i++) { - float left = 0.0f; - float right = 0.0f; - - if (channels == 1) { - float v = src[i] / 32768.0f; - left = v; - right = v; - } else { - left = src[i * channels + 0] / 32768.0f; - right = src[i * channels + 1] / 32768.0f; - } - - mix_float[i * 2 + 0] += left * gain; - mix_float[i * 2 + 1] += right * gain; - } - } else { // FLOAT input - const float* src = reinterpret_cast(data.sample_buffer); - - for (u32 i = 0; i < frames; i++) { - float left = 0.0f; - float right = 0.0f; - - if (channels == 1) { - left = src[i]; - right = src[i]; - } else { - left = src[i * channels + 0]; - right = src[i * channels + 1]; - } - - mix_float[i * 2 + 0] += left * gain; - mix_float[i * 2 + 1] += right * gain; - } - } - - std::free(data.sample_buffer); - }; - - // Bed is mixed at full gain (1.0). - mix_in(port.bed_queue, 1.0f); - - // Mix all object PCM queues, applying each object's GAIN persistent attribute. - for (auto& [obj_id, obj] : port.objects) { - float gain = 0.0f; - const auto gain_key = - static_cast(OrbisAudio3dAttributeId::ORBIS_AUDIO3D_ATTRIBUTE_GAIN); - if (obj.persistent_attributes.contains(gain_key)) { - const auto& blob = obj.persistent_attributes.at(gain_key); - if (blob.size() >= sizeof(float)) { - std::memcpy(&gain, blob.data(), sizeof(float)); - } - } - mix_in(obj.pcm_queue, gain); - } - - s16* mix_s16 = static_cast(std::malloc(out_samples * sizeof(s16))); - if (!mix_s16) { - std::free(mix_float); - return ORBIS_AUDIO3D_ERROR_OUT_OF_MEMORY; - } - - for (u32 i = 0; i < out_samples; i++) { - float v = std::clamp(mix_float[i], -1.0f, 1.0f); - mix_s16[i] = static_cast(v * 32767.0f); - } - - std::free(mix_float); - - port.mixed_queue.push_back(AudioData{.sample_buffer = reinterpret_cast(mix_s16), - .num_samples = granularity, - .num_channels = AUDIO3D_OUTPUT_NUM_CHANNELS, - .format = OrbisAudio3dFormat::ORBIS_AUDIO3D_FORMAT_S16}); - - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dPortClose(const OrbisAudio3dPortId port_id) { - LOG_INFO(Lib_Audio3d, "called, port_id = {}", port_id); - - if (!state->ports.contains(port_id)) { - LOG_ERROR(Lib_Audio3d, "!state->ports.contains(port_id)"); - return ORBIS_AUDIO3D_ERROR_INVALID_PORT; - } - - auto& port = state->ports[port_id]; - { - std::scoped_lock lock{port.mutex}; - - if (port.audio_out_handle >= 0) { - AudioOut::sceAudioOutClose(port.audio_out_handle); - port.audio_out_handle = -1; - } - - for (const s32 handle : port.audioout_handles) { - AudioOut::sceAudioOutClose(handle); - } - port.audioout_handles.clear(); - - for (auto& data : port.mixed_queue) { - std::free(data.sample_buffer); - } - - for (auto& data : port.bed_queue) { - std::free(data.sample_buffer); - } - - for (auto& [obj_id, obj] : port.objects) { - for (auto& data : obj.pcm_queue) { - std::free(data.sample_buffer); - } - } - } - - state->ports.erase(port_id); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dPortCreate() { - LOG_ERROR(Lib_Audio3d, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dPortDestroy() { - LOG_ERROR(Lib_Audio3d, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dPortFlush(const OrbisAudio3dPortId port_id) { - LOG_DEBUG(Lib_Audio3d, "called, port_id = {}", port_id); - - if (!state->ports.contains(port_id)) { - LOG_ERROR(Lib_Audio3d, "!state->ports.contains(port_id)"); - return ORBIS_AUDIO3D_ERROR_INVALID_PORT; - } - - auto& port = state->ports[port_id]; - std::scoped_lock lock{port.mutex}; - - if (!port.audioout_handles.empty()) { - for (const s32 handle : port.audioout_handles) { - const s32 ret = AudioOut::sceAudioOutOutput(handle, nullptr); - if (ret < 0) { - return ret; - } - } - return ORBIS_OK; - } - - if (port.mixed_queue.empty()) { - // Only mix if there's actually something to mix. - if (!port.bed_queue.empty() || - std::any_of(port.objects.begin(), port.objects.end(), - [](const auto& kv) { return !kv.second.pcm_queue.empty(); })) { - const s32 ret = sceAudio3dPortAdvance(port_id); - if (ret != ORBIS_OK && ret != ORBIS_AUDIO3D_ERROR_NOT_READY) { - return ret; - } - } - } - - if (port.mixed_queue.empty()) { - return ORBIS_OK; - } - - if (port.audio_out_handle < 0) { - AudioOut::OrbisAudioOutParamExtendedInformation ext_info{}; - ext_info.data_format.Assign(AUDIO3D_OUTPUT_FORMAT); - port.audio_out_handle = - AudioOut::sceAudioOutOpen(0xFF, AudioOut::OrbisAudioOutPort::Audio3d, 0, - port.parameters.granularity, AUDIO3D_SAMPLE_RATE, ext_info); - if (port.audio_out_handle < 0) { - return port.audio_out_handle; - } - } - - // Drain all queued mixed frames, blocking on each until consumed. - while (!port.mixed_queue.empty()) { - AudioData frame = port.mixed_queue.front(); - port.mixed_queue.pop_front(); - const s32 ret = AudioOut::sceAudioOutOutput(port.audio_out_handle, frame.sample_buffer); - std::free(frame.sample_buffer); - if (ret < 0) { - return ret; - } - } - - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dPortFreeState() { - LOG_ERROR(Lib_Audio3d, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dPortGetAttributesSupported() { - LOG_ERROR(Lib_Audio3d, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dPortGetList() { - LOG_ERROR(Lib_Audio3d, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dPortGetParameters() { - LOG_ERROR(Lib_Audio3d, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dPortGetQueueLevel(const OrbisAudio3dPortId port_id, u32* queue_level, - u32* queue_available) { - LOG_DEBUG(Lib_Audio3d, "called, port_id = {}, queue_level = {}, queue_available = {}", port_id, - static_cast(queue_level), static_cast(queue_available)); - - if (!state->ports.contains(port_id)) { - LOG_ERROR(Lib_Audio3d, "!state->ports.contains(port_id)"); - return ORBIS_AUDIO3D_ERROR_INVALID_PORT; - } - - if (!queue_level && !queue_available) { - return ORBIS_AUDIO3D_ERROR_INVALID_PARAMETER; - } - - const auto& port = state->ports[port_id]; - std::scoped_lock lock{port.mutex}; - const size_t size = port.mixed_queue.size(); - - if (queue_level) { - *queue_level = static_cast(size); - } - - if (queue_available) { - const u32 depth = port.parameters.queue_depth; - *queue_available = (size < depth) ? static_cast(depth - size) : 0u; - } - - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dPortGetState() { - LOG_ERROR(Lib_Audio3d, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dPortGetStatus() { - LOG_ERROR(Lib_Audio3d, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dPortOpen(const Libraries::UserService::OrbisUserServiceUserId user_id, - const OrbisAudio3dOpenParameters* parameters, - OrbisAudio3dPortId* port_id) { - LOG_INFO(Lib_Audio3d, "called, user_id = {}, parameters = {}, id = {}", user_id, - static_cast(parameters), static_cast(port_id)); - - if (!state) { - LOG_ERROR(Lib_Audio3d, "!initialized"); - return ORBIS_AUDIO3D_ERROR_NOT_READY; - } - - if (!parameters || !port_id) { - LOG_ERROR(Lib_Audio3d, "!parameters || !id"); - return ORBIS_AUDIO3D_ERROR_INVALID_PARAMETER; - } - - const int id = static_cast(state->ports.size()) + 1; - - if (id > 3) { - LOG_ERROR(Lib_Audio3d, "id > 3"); - return ORBIS_AUDIO3D_ERROR_OUT_OF_RESOURCES; - } - - *port_id = id; - auto& port = state->ports[id]; - std::memcpy( - &port.parameters, parameters, - std::min(parameters->size_this, static_cast(sizeof(OrbisAudio3dOpenParameters)))); - - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dPortPush(const OrbisAudio3dPortId port_id, - const OrbisAudio3dBlocking blocking) { - LOG_DEBUG(Lib_Audio3d, "called, port_id = {}, blocking = {}", port_id, - magic_enum::enum_name(blocking)); - - if (!state->ports.contains(port_id)) { - LOG_ERROR(Lib_Audio3d, "!state->ports.contains(port_id)"); - return ORBIS_AUDIO3D_ERROR_INVALID_PORT; - } - - auto& port = state->ports[port_id]; - - if (port.parameters.buffer_mode != - OrbisAudio3dBufferMode::ORBIS_AUDIO3D_BUFFER_ADVANCE_AND_PUSH) { - LOG_ERROR(Lib_Audio3d, "port doesn't have push capability"); - return ORBIS_AUDIO3D_ERROR_NOT_SUPPORTED; - } - - const u32 depth = port.parameters.queue_depth; - - if (port.audio_out_handle < 0) { - AudioOut::OrbisAudioOutParamExtendedInformation ext_info{}; - ext_info.data_format.Assign(AUDIO3D_OUTPUT_FORMAT); - - port.audio_out_handle = - AudioOut::sceAudioOutOpen(0xFF, AudioOut::OrbisAudioOutPort::Audio3d, 0, - port.parameters.granularity, AUDIO3D_SAMPLE_RATE, ext_info); - - if (port.audio_out_handle < 0) - return port.audio_out_handle; - } - - // Function that submits exactly one frame (if available). - auto submit_one_frame = [&](bool& submitted) -> s32 { - AudioData frame; - { - std::scoped_lock lock{port.mutex}; - - if (port.mixed_queue.empty()) { - submitted = false; - return ORBIS_OK; - } - - frame = port.mixed_queue.front(); - port.mixed_queue.pop_front(); - } - - const s32 ret = AudioOut::sceAudioOutOutput(port.audio_out_handle, frame.sample_buffer); - std::free(frame.sample_buffer); - - if (ret < 0) - return ret; - - submitted = true; - return ORBIS_OK; - }; - - // If not full, return immediately. - { - std::scoped_lock lock{port.mutex}; - if (port.mixed_queue.size() < depth) { - return ORBIS_OK; - } - } - - // Submit one frame to free space. - bool submitted = false; - s32 ret = submit_one_frame(submitted); - if (ret < 0) - return ret; - - if (!submitted) - return ORBIS_OK; - - // ASYNC: free exactly one slot and return. - if (blocking == OrbisAudio3dBlocking::ORBIS_AUDIO3D_BLOCKING_ASYNC) { - return ORBIS_OK; - } - - // SYNC: ensure at least one slot is free (drain until size < depth). - while (true) { - { - std::scoped_lock lock{port.mutex}; - if (port.mixed_queue.size() < depth) - break; - } - - bool drained = false; - ret = submit_one_frame(drained); - if (ret < 0) - return ret; - - if (!drained) - break; - } - - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dPortQueryDebug() { - LOG_ERROR(Lib_Audio3d, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dPortSetAttribute(const OrbisAudio3dPortId port_id, - const OrbisAudio3dAttributeId attribute_id, - void* attribute, const u64 attribute_size) { - LOG_INFO(Lib_Audio3d, - "called, port_id = {}, attribute_id = {}, attribute = {}, attribute_size = {}", - port_id, static_cast(attribute_id), attribute, attribute_size); - - if (!state->ports.contains(port_id)) { - LOG_ERROR(Lib_Audio3d, "!state->ports.contains(port_id)"); - return ORBIS_AUDIO3D_ERROR_INVALID_PORT; - } - - if (!attribute) { - LOG_ERROR(Lib_Audio3d, "!attribute"); - return ORBIS_AUDIO3D_ERROR_INVALID_PARAMETER; - } - - // TODO - - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dReportRegisterHandler() { - LOG_ERROR(Lib_Audio3d, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dReportUnregisterHandler() { - LOG_ERROR(Lib_Audio3d, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dSetGpuRenderer() { - LOG_ERROR(Lib_Audio3d, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dStrError() { - LOG_ERROR(Lib_Audio3d, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceAudio3dTerminate() { - LOG_INFO(Lib_Audio3d, "called"); - - if (!state) { - return ORBIS_AUDIO3D_ERROR_NOT_READY; - } - - std::vector port_ids; - for (const auto& [id, _] : state->ports) { - port_ids.push_back(id); - } - for (const auto id : port_ids) { - sceAudio3dPortClose(id); - } - - state.reset(); - return ORBIS_OK; -} - -void RegisterLib(Core::Loader::SymbolsResolver* sym) { - LIB_FUNCTION("pZlOm1aF3aA", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dAudioOutClose); - LIB_FUNCTION("ucEsi62soTo", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dAudioOutOpen); - LIB_FUNCTION("7NYEzJ9SJbM", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dAudioOutOutput); - LIB_FUNCTION("HbxYY27lK6E", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dAudioOutOutputs); - LIB_FUNCTION("9tEwE0GV0qo", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dBedWrite); - LIB_FUNCTION("xH4Q9UILL3o", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dBedWrite2); - LIB_FUNCTION("lvWMW6vEqFU", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dCreateSpeakerArray); - LIB_FUNCTION("8hm6YdoQgwg", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dDeleteSpeakerArray); - LIB_FUNCTION("Im+jOoa5WAI", "libSceAudio3d", 1, "libSceAudio3d", - sceAudio3dGetDefaultOpenParameters); - LIB_FUNCTION("kEqqyDkmgdI", "libSceAudio3d", 1, "libSceAudio3d", - sceAudio3dGetSpeakerArrayMemorySize); - LIB_FUNCTION("-R1DukFq7Dk", "libSceAudio3d", 1, "libSceAudio3d", - sceAudio3dGetSpeakerArrayMixCoefficients); - LIB_FUNCTION("-Re+pCWvwjQ", "libSceAudio3d", 1, "libSceAudio3d", - sceAudio3dGetSpeakerArrayMixCoefficients2); - LIB_FUNCTION("UmCvjSmuZIw", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dInitialize); - LIB_FUNCTION("jO2tec4dJ2M", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dObjectReserve); - LIB_FUNCTION("V1FBFpNIAzk", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dObjectSetAttribute); - LIB_FUNCTION("4uyHN9q4ZeU", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dObjectSetAttributes); - LIB_FUNCTION("1HXxo-+1qCw", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dObjectUnreserve); - LIB_FUNCTION("lw0qrdSjZt8", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dPortAdvance); - LIB_FUNCTION("OyVqOeVNtSk", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dPortClose); - LIB_FUNCTION("UHFOgVNz0kk", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dPortCreate); - LIB_FUNCTION("Mw9mRQtWepY", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dPortDestroy); - LIB_FUNCTION("ZOGrxWLgQzE", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dPortFlush); - LIB_FUNCTION("uJ0VhGcxCTQ", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dPortFreeState); - LIB_FUNCTION("9ZA23Ia46Po", "libSceAudio3d", 1, "libSceAudio3d", - sceAudio3dPortGetAttributesSupported); - LIB_FUNCTION("SEggctIeTcI", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dPortGetList); - LIB_FUNCTION("flPcUaXVXcw", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dPortGetParameters); - LIB_FUNCTION("YaaDbDwKpFM", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dPortGetQueueLevel); - LIB_FUNCTION("CKHlRW2E9dA", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dPortGetState); - LIB_FUNCTION("iRX6GJs9tvE", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dPortGetStatus); - LIB_FUNCTION("XeDDK0xJWQA", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dPortOpen); - LIB_FUNCTION("VEVhZ9qd4ZY", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dPortPush); - LIB_FUNCTION("-pzYDZozm+M", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dPortQueryDebug); - LIB_FUNCTION("Yq9bfUQ0uJg", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dPortSetAttribute); - LIB_FUNCTION("QfNXBrKZeI0", "libSceAudio3d", 1, "libSceAudio3d", - sceAudio3dReportRegisterHandler); - LIB_FUNCTION("psv2gbihC1A", "libSceAudio3d", 1, "libSceAudio3d", - sceAudio3dReportUnregisterHandler); - LIB_FUNCTION("yEYXcbAGK14", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dSetGpuRenderer); - LIB_FUNCTION("Aacl5qkRU6U", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dStrError); - LIB_FUNCTION("WW1TS2iz5yc", "libSceAudio3d", 1, "libSceAudio3d", sceAudio3dTerminate); -} - -} // namespace Libraries::Audio3dOpenAL diff --git a/src/core/libraries/audio3d/audio3d_openal.h b/src/core/libraries/audio3d/audio3d_openal.h deleted file mode 100644 index 75be72066..000000000 --- a/src/core/libraries/audio3d/audio3d_openal.h +++ /dev/null @@ -1,181 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include -#include -#include -#include - -#include "common/types.h" -#include "core/libraries/audio/audioout.h" - -namespace Core::Loader { -class SymbolsResolver; -} - -namespace Libraries::Audio3dOpenAL { - -constexpr int ORBIS_AUDIO3D_OBJECT_INVALID = 0xFFFFFFFF; - -enum class OrbisAudio3dRate : u32 { - ORBIS_AUDIO3D_RATE_48000 = 0, -}; - -enum class OrbisAudio3dBufferMode : u32 { - ORBIS_AUDIO3D_BUFFER_NO_ADVANCE = 0, - ORBIS_AUDIO3D_BUFFER_ADVANCE_NO_PUSH = 1, - ORBIS_AUDIO3D_BUFFER_ADVANCE_AND_PUSH = 2, -}; - -struct OrbisAudio3dOpenParameters { - u64 size_this; - u32 granularity; - OrbisAudio3dRate rate; - u32 max_objects; - u32 queue_depth; - OrbisAudio3dBufferMode buffer_mode; - int : 32; - u32 num_beds; -}; - -enum class OrbisAudio3dFormat : u32 { - ORBIS_AUDIO3D_FORMAT_S16 = 0, - ORBIS_AUDIO3D_FORMAT_FLOAT = 1, -}; - -enum class OrbisAudio3dOutputRoute : u32 { - ORBIS_AUDIO3D_OUTPUT_BOTH = 0, - ORBIS_AUDIO3D_OUTPUT_HMU_ONLY = 1, - ORBIS_AUDIO3D_OUTPUT_TV_ONLY = 2, -}; - -enum class OrbisAudio3dBlocking : u32 { - ORBIS_AUDIO3D_BLOCKING_ASYNC = 0, - ORBIS_AUDIO3D_BLOCKING_SYNC = 1, -}; - -struct OrbisAudio3dPcm { - OrbisAudio3dFormat format; - void* sample_buffer; - u32 num_samples; -}; - -enum class OrbisAudio3dAttributeId : u32 { - ORBIS_AUDIO3D_ATTRIBUTE_PCM = 1, - ORBIS_AUDIO3D_ATTRIBUTE_POSITION = 2, - ORBIS_AUDIO3D_ATTRIBUTE_GAIN = 3, - ORBIS_AUDIO3D_ATTRIBUTE_SPREAD = 4, - ORBIS_AUDIO3D_ATTRIBUTE_PRIORITY = 5, - ORBIS_AUDIO3D_ATTRIBUTE_PASSTHROUGH = 6, - ORBIS_AUDIO3D_ATTRIBUTE_AMBISONICS = 7, - ORBIS_AUDIO3D_ATTRIBUTE_APPLICATION_SPECIFIC = 8, - ORBIS_AUDIO3D_ATTRIBUTE_RESET_STATE = 9, - ORBIS_AUDIO3D_ATTRIBUTE_RESTRICTED = 10, - ORBIS_AUDIO3D_ATTRIBUTE_OUTPUT_ROUTE = 11, -}; - -using OrbisAudio3dPortId = u32; -using OrbisAudio3dObjectId = u32; -using OrbisAudio3dAmbisonics = u32; - -struct OrbisAudio3dAttribute { - OrbisAudio3dAttributeId attribute_id; - int : 32; - void* value; - u64 value_size; -}; - -struct AudioData { - u8* sample_buffer; - u32 num_samples; - u32 num_channels{1}; - OrbisAudio3dFormat format{OrbisAudio3dFormat::ORBIS_AUDIO3D_FORMAT_S16}; -}; - -struct ObjectState { - std::deque pcm_queue; - std::unordered_map> persistent_attributes; -}; - -struct Port { - mutable std::recursive_mutex mutex; - OrbisAudio3dOpenParameters parameters{}; - // Opened lazily on the first sceAudio3dPortPush call. - s32 audio_out_handle{-1}; - // Handles explicitly opened by the game via sceAudio3dAudioOutOpen. - std::vector audioout_handles; - // Reserved objects and their state. - std::unordered_map objects; - // Increasing counter for generating unique object IDs within this port. - OrbisAudio3dObjectId next_object_id{0}; - // Bed audio queue. - std::deque bed_queue; - // Mixed stereo frames ready to be consumed by sceAudio3dPortPush. - std::deque mixed_queue; -}; - -struct Audio3dState { - std::unordered_map ports; -}; - -s32 PS4_SYSV_ABI sceAudio3dAudioOutClose(s32 handle); -s32 PS4_SYSV_ABI sceAudio3dAudioOutOpen(OrbisAudio3dPortId port_id, - Libraries::UserService::OrbisUserServiceUserId user_id, - s32 type, s32 index, u32 len, u32 freq, - AudioOut::OrbisAudioOutParamExtendedInformation param); -s32 PS4_SYSV_ABI sceAudio3dAudioOutOutput(s32 handle, void* ptr); -s32 PS4_SYSV_ABI sceAudio3dAudioOutOutputs(AudioOut::OrbisAudioOutOutputParam* param, u32 num); -s32 PS4_SYSV_ABI sceAudio3dBedWrite(OrbisAudio3dPortId port_id, u32 num_channels, - OrbisAudio3dFormat format, void* buffer, u32 num_samples); -s32 PS4_SYSV_ABI sceAudio3dBedWrite2(OrbisAudio3dPortId port_id, u32 num_channels, - OrbisAudio3dFormat format, void* buffer, u32 num_samples, - OrbisAudio3dOutputRoute output_route, bool restricted); -s32 PS4_SYSV_ABI sceAudio3dCreateSpeakerArray(); -s32 PS4_SYSV_ABI sceAudio3dDeleteSpeakerArray(); -s32 PS4_SYSV_ABI sceAudio3dGetDefaultOpenParameters(OrbisAudio3dOpenParameters* params); -s32 PS4_SYSV_ABI sceAudio3dGetSpeakerArrayMemorySize(); -s32 PS4_SYSV_ABI sceAudio3dGetSpeakerArrayMixCoefficients(); -s32 PS4_SYSV_ABI sceAudio3dGetSpeakerArrayMixCoefficients2(); -s32 PS4_SYSV_ABI sceAudio3dInitialize(s64 reserved); -s32 PS4_SYSV_ABI sceAudio3dObjectReserve(OrbisAudio3dPortId port_id, - OrbisAudio3dObjectId* object_id); -s32 PS4_SYSV_ABI sceAudio3dObjectSetAttribute(OrbisAudio3dPortId port_id, - OrbisAudio3dObjectId object_id, - OrbisAudio3dAttributeId attribute_id, - const void* attribute, u64 attribute_size); -s32 PS4_SYSV_ABI sceAudio3dObjectSetAttributes(OrbisAudio3dPortId port_id, - OrbisAudio3dObjectId object_id, u64 num_attributes, - const OrbisAudio3dAttribute* attribute_array); -s32 PS4_SYSV_ABI sceAudio3dObjectUnreserve(OrbisAudio3dPortId port_id, - OrbisAudio3dObjectId object_id); -s32 PS4_SYSV_ABI sceAudio3dPortAdvance(OrbisAudio3dPortId port_id); -s32 PS4_SYSV_ABI sceAudio3dPortClose(OrbisAudio3dPortId port_id); -s32 PS4_SYSV_ABI sceAudio3dPortCreate(); -s32 PS4_SYSV_ABI sceAudio3dPortDestroy(); -s32 PS4_SYSV_ABI sceAudio3dPortFlush(OrbisAudio3dPortId port_id); -s32 PS4_SYSV_ABI sceAudio3dPortFreeState(); -s32 PS4_SYSV_ABI sceAudio3dPortGetAttributesSupported(); -s32 PS4_SYSV_ABI sceAudio3dPortGetList(); -s32 PS4_SYSV_ABI sceAudio3dPortGetParameters(); -s32 PS4_SYSV_ABI sceAudio3dPortGetQueueLevel(OrbisAudio3dPortId port_id, u32* queue_level, - u32* queue_available); -s32 PS4_SYSV_ABI sceAudio3dPortGetState(); -s32 PS4_SYSV_ABI sceAudio3dPortGetStatus(); -s32 PS4_SYSV_ABI sceAudio3dPortOpen(Libraries::UserService::OrbisUserServiceUserId user_id, - const OrbisAudio3dOpenParameters* parameters, - OrbisAudio3dPortId* port_id); -s32 PS4_SYSV_ABI sceAudio3dPortPush(OrbisAudio3dPortId port_id, OrbisAudio3dBlocking blocking); -s32 PS4_SYSV_ABI sceAudio3dPortQueryDebug(); -s32 PS4_SYSV_ABI sceAudio3dPortSetAttribute(OrbisAudio3dPortId port_id, - OrbisAudio3dAttributeId attribute_id, void* attribute, - u64 attribute_size); -s32 PS4_SYSV_ABI sceAudio3dReportRegisterHandler(); -s32 PS4_SYSV_ABI sceAudio3dReportUnregisterHandler(); -s32 PS4_SYSV_ABI sceAudio3dSetGpuRenderer(); -s32 PS4_SYSV_ABI sceAudio3dStrError(); -s32 PS4_SYSV_ABI sceAudio3dTerminate(); - -void RegisterLib(Core::Loader::SymbolsResolver* sym); -} // namespace Libraries::Audio3dOpenAL diff --git a/src/core/libraries/avplayer/avplayer.cpp b/src/core/libraries/avplayer/avplayer.cpp index e4d30af21..d2198198b 100644 --- a/src/core/libraries/avplayer/avplayer.cpp +++ b/src/core/libraries/avplayer/avplayer.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/logging/log.h" diff --git a/src/core/libraries/avplayer/avplayer.h b/src/core/libraries/avplayer/avplayer.h index eebce8965..3143f9794 100644 --- a/src/core/libraries/avplayer/avplayer.h +++ b/src/core/libraries/avplayer/avplayer.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/avplayer/avplayer_common.cpp b/src/core/libraries/avplayer/avplayer_common.cpp index 4b42fc8c2..49bee7c92 100644 --- a/src/core/libraries/avplayer/avplayer_common.cpp +++ b/src/core/libraries/avplayer/avplayer_common.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include // std::equal diff --git a/src/core/libraries/avplayer/avplayer_common.h b/src/core/libraries/avplayer/avplayer_common.h index 1e5715009..21fdef534 100644 --- a/src/core/libraries/avplayer/avplayer_common.h +++ b/src/core/libraries/avplayer/avplayer_common.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/avplayer/avplayer_data_streamer.h b/src/core/libraries/avplayer/avplayer_data_streamer.h index 34c2167ca..0f1e98f41 100644 --- a/src/core/libraries/avplayer/avplayer_data_streamer.h +++ b/src/core/libraries/avplayer/avplayer_data_streamer.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/avplayer/avplayer_error.h b/src/core/libraries/avplayer/avplayer_error.h index ebe4d0dd3..efd32c7f9 100644 --- a/src/core/libraries/avplayer/avplayer_error.h +++ b/src/core/libraries/avplayer/avplayer_error.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/avplayer/avplayer_file_streamer.cpp b/src/core/libraries/avplayer/avplayer_file_streamer.cpp index 0b44ee75c..d162fe840 100644 --- a/src/core/libraries/avplayer/avplayer_file_streamer.cpp +++ b/src/core/libraries/avplayer/avplayer_file_streamer.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include // std::max, std::min diff --git a/src/core/libraries/avplayer/avplayer_file_streamer.h b/src/core/libraries/avplayer/avplayer_file_streamer.h index 8e9b6bf43..eb47d9fa9 100644 --- a/src/core/libraries/avplayer/avplayer_file_streamer.h +++ b/src/core/libraries/avplayer/avplayer_file_streamer.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/avplayer/avplayer_impl.cpp b/src/core/libraries/avplayer/avplayer_impl.cpp index db32862ad..9027291e7 100644 --- a/src/core/libraries/avplayer/avplayer_impl.cpp +++ b/src/core/libraries/avplayer/avplayer_impl.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "core/libraries/avplayer/avplayer_common.h" diff --git a/src/core/libraries/avplayer/avplayer_impl.h b/src/core/libraries/avplayer/avplayer_impl.h index 0514b1b16..e8057c098 100644 --- a/src/core/libraries/avplayer/avplayer_impl.h +++ b/src/core/libraries/avplayer/avplayer_impl.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/avplayer/avplayer_source.cpp b/src/core/libraries/avplayer/avplayer_source.cpp index 7a4686a6c..c7f196a15 100644 --- a/src/core/libraries/avplayer/avplayer_source.cpp +++ b/src/core/libraries/avplayer/avplayer_source.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/alignment.h" @@ -443,7 +443,7 @@ void AvPlayerSource::ReleaseAVFormatContext(AVFormatContext* context) { void AvPlayerSource::DemuxerThread(std::stop_token stop) { using namespace std::chrono; - Common::SetCurrentThreadName("shadPS4:AvDemuxer"); + Common::SetCurrentThreadName("sB:AvDemuxer"); if (!m_audio_stream_index.has_value() && !m_video_stream_index.has_value()) { LOG_WARNING(Lib_AvPlayer, "Could not start DEMUXER thread. No streams enabled."); @@ -616,7 +616,7 @@ Frame AvPlayerSource::PrepareVideoFrame(GuestBuffer buffer, const AVFrame& frame void AvPlayerSource::VideoDecoderThread(std::stop_token stop) { using namespace std::chrono; - Common::SetCurrentThreadName("shadPS4:AvVideoDecoder"); + Common::SetCurrentThreadName("sB:AvVideoDecoder"); LOG_INFO(Lib_AvPlayer, "Video Decoder Thread started"); while ((!m_is_eof || m_video_packets.Size() != 0) && !stop.stop_requested()) { @@ -738,7 +738,7 @@ Frame AvPlayerSource::PrepareAudioFrame(GuestBuffer buffer, const AVFrame& frame void AvPlayerSource::AudioDecoderThread(std::stop_token stop) { using namespace std::chrono; - Common::SetCurrentThreadName("shadPS4:AvAudioDecoder"); + Common::SetCurrentThreadName("sB:AvAudioDecoder"); LOG_INFO(Lib_AvPlayer, "Audio Decoder Thread started"); while ((!m_is_eof || m_audio_packets.Size() != 0) && !stop.stop_requested()) { diff --git a/src/core/libraries/avplayer/avplayer_source.h b/src/core/libraries/avplayer/avplayer_source.h index 37a72a446..6ede30e10 100644 --- a/src/core/libraries/avplayer/avplayer_source.h +++ b/src/core/libraries/avplayer/avplayer_source.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/avplayer/avplayer_state.cpp b/src/core/libraries/avplayer/avplayer_state.cpp index dbaa36d18..fab8703fa 100644 --- a/src/core/libraries/avplayer/avplayer_state.cpp +++ b/src/core/libraries/avplayer/avplayer_state.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/logging/log.h" @@ -230,7 +230,7 @@ void AvPlayerState::SetAvSyncMode(AvPlayerAvSyncMode sync_mode) { void AvPlayerState::AvControllerThread(std::stop_token stop) { using std::chrono::milliseconds; - Common::SetCurrentThreadName("shadPS4:AvController"); + Common::SetCurrentThreadName("sB:AvController"); while (!stop.stop_requested()) { if (m_event_queue.Size() != 0) { diff --git a/src/core/libraries/avplayer/avplayer_state.h b/src/core/libraries/avplayer/avplayer_state.h index c67855c89..05c25177d 100644 --- a/src/core/libraries/avplayer/avplayer_state.h +++ b/src/core/libraries/avplayer/avplayer_state.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/camera/camera.cpp b/src/core/libraries/camera/camera.cpp deleted file mode 100644 index 14aad8e84..000000000 --- a/src/core/libraries/camera/camera.cpp +++ /dev/null @@ -1,1216 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "common/elf_info.h" -#include "common/logging/log.h" -#include "core/emulator_settings.h" -#include "core/libraries/camera/camera.h" -#include "core/libraries/camera/camera_error.h" -#include "core/libraries/error_codes.h" -#include "core/libraries/kernel/process.h" -#include "core/libraries/libs.h" - -#include - -#include -#include "SDL3/SDL_camera.h" - -namespace Libraries::Camera { - -static bool g_library_opened = false; -static s32 g_firmware_version = 0; -static s32 g_handles = 0; -static constexpr s32 c_width = 1280, c_height = 800; - -SDL_Camera* sdl_camera = nullptr; -OrbisCameraConfigExtention output_config0, output_config1; - -s32 PS4_SYSV_ABI sceCameraAccGetData() { - LOG_ERROR(Lib_Camera, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCameraAudioClose() { - LOG_DEBUG(Lib_Camera, "called"); - // Returns ORBIS_OK while internally failing - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCameraAudioGetData(void* data) { - LOG_DEBUG(Lib_Camera, "called"); - if (data == nullptr) { - return ORBIS_CAMERA_ERROR_PARAM; - } - // Returns ORBIS_OK while internally failing - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCameraAudioGetData2(void* data) { - LOG_DEBUG(Lib_Camera, "called"); - if (data == nullptr) { - return ORBIS_CAMERA_ERROR_PARAM; - } - // Returns ORBIS_OK while internally failing - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCameraAudioOpen() { - LOG_DEBUG(Lib_Camera, "called"); - // Returns error fatal as a side effect of not having a camera attached. - return ORBIS_CAMERA_ERROR_FATAL; -} - -s32 PS4_SYSV_ABI sceCameraAudioReset() { - LOG_DEBUG(Lib_Camera, "called"); - // Returns ORBIS_OK while internally failing - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCameraChangeAppModuleState() { - LOG_ERROR(Lib_Camera, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCameraClose(s32 handle) { - LOG_DEBUG(Lib_Camera, "called"); - if (handle < 1) { - return ORBIS_CAMERA_ERROR_PARAM; - } - if (!g_library_opened) { - return ORBIS_CAMERA_ERROR_NOT_OPEN; - } - - // Decrement handles on close. - // If no handles remain, then the library itself is considered closed. - if (--g_handles == 0) { - g_library_opened = false; - } - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCameraCloseByHandle(s32 handle) { - LOG_DEBUG(Lib_Camera, "called"); - if (handle < 1) { - return ORBIS_CAMERA_ERROR_PARAM; - } - if (!g_library_opened) { - return ORBIS_CAMERA_ERROR_NOT_OPEN; - } - - // Decrement handles on close. - // If no handles remain, then the library itself is considered closed. - if (--g_handles == 0) { - g_library_opened = false; - } - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCameraDeviceOpen() { - // Stubbed on real hardware - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCameraGetAttribute(s32 handle, OrbisCameraAttribute* attribute) { - LOG_DEBUG(Lib_Camera, "called"); - if (handle < 1 || attribute == nullptr || attribute->sizeThis != sizeof(OrbisCameraAttribute) || - attribute->channel >= OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_BOTH || - attribute->channel < OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_0) { - return ORBIS_CAMERA_ERROR_PARAM; - } - if (!g_library_opened) { - return ORBIS_CAMERA_ERROR_NOT_OPEN; - } - - auto channel = attribute->channel; - - // Set default attributes - memset(attribute, 0, sizeof(OrbisCameraAttribute)); - attribute->sizeThis = sizeof(OrbisCameraAttribute); - attribute->channel = channel; - attribute->exposureGain.exposure = 83; - attribute->exposureGain.gain = 100; - attribute->whiteBalance.gainRed = 768; - attribute->whiteBalance.gainBlue = 768; - attribute->whiteBalance.gainGreen = 512; - attribute->gamma.value = 4; - attribute->saturation = 64; - attribute->contrast = 32; - attribute->sharpness = 1; - attribute->hue = 1; - - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCameraGetAutoExposureGain(s32 handle, OrbisCameraChannel channel, u32* enable, - OrbisCameraAutoExposureGainTarget* option) { - LOG_DEBUG(Lib_Camera, "called"); - if (handle < 1 || channel >= OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_BOTH || - channel < OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_0 || enable == nullptr) { - return ORBIS_CAMERA_ERROR_PARAM; - } - if (option != nullptr && (g_firmware_version < Common::ElfInfo::FW_30 || - option->sizeThis != sizeof(OrbisCameraAutoExposureGainTarget))) { - return ORBIS_CAMERA_ERROR_PARAM; - } - if (!g_library_opened) { - return ORBIS_CAMERA_ERROR_NOT_OPEN; - } - - *enable = 0; - if (option != nullptr) { - option->sizeThis = 0; - option->target = OrbisCameraAecAgcTarget::ORBIS_CAMERA_ATTRIBUTE_AECAGC_TARGET_DEF; - } - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCameraGetAutoWhiteBalance(s32 handle, OrbisCameraChannel channel, u32* enable, - void* option) { - LOG_DEBUG(Lib_Camera, "called"); - if (handle < 1 || channel >= OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_BOTH || - channel < OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_0 || enable == nullptr || - option != nullptr) { - return ORBIS_CAMERA_ERROR_PARAM; - } - if (!g_library_opened) { - return ORBIS_CAMERA_ERROR_NOT_OPEN; - } - - *enable = 0; - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCameraGetCalibData() { - LOG_ERROR(Lib_Camera, "(STUBBED) called"); - return ORBIS_CAMERA_ERROR_NOT_CONNECTED; -} - -s32 PS4_SYSV_ABI sceCameraGetCalibDataFromDevice() { - LOG_ERROR(Lib_Camera, "(STUBBED) called"); - return ORBIS_CAMERA_ERROR_NOT_CONNECTED; -} - -s32 PS4_SYSV_ABI sceCameraGetCalibrationData(const OrbisCameraGetCalibrationDataParameter* param, - OrbisCameraCalibrationData* calibration_data) { - LOG_DEBUG(Lib_Camera, "called"); - if (param == nullptr || calibration_data == nullptr || - param->size != sizeof(OrbisCameraGetCalibrationDataParameter) || param->format_type != 0 || - param->function_type < - OrbisCameraCalibrationDataFunctionType:: - ORBIS_CAMERA_CALIBRATION_DATA_FUNCTION_TYPE_IMAGE_RECTIFICATION || - param->function_type > - OrbisCameraCalibrationDataFunctionType:: - ORBIS_CAMERA_CALIBRATION_DATA_FUNCTION_TYPE_IMAGE_INVERSE_RECTIFICATION) { - return ORBIS_CAMERA_ERROR_PARAM; - } - return ORBIS_CAMERA_ERROR_NOT_CONNECTED; -} - -s32 PS4_SYSV_ABI sceCameraGetConfig(s32 handle, OrbisCameraConfig* config) { - LOG_DEBUG(Lib_Camera, "called"); - if (handle < 1 || config == nullptr || config->sizeThis != sizeof(OrbisCameraConfig)) { - return ORBIS_CAMERA_ERROR_PARAM; - } - if (!g_library_opened) { - return ORBIS_CAMERA_ERROR_NOT_OPEN; - } - - // Set default config - config->configType = ORBIS_CAMERA_CONFIG_TYPE1; - config->sizeThis = 0; - - OrbisCameraConfigExtention default_extension; - default_extension.format.formatLevel0 = ORBIS_CAMERA_FORMAT_YUV422; - default_extension.format.formatLevel1 = ORBIS_CAMERA_SCALE_FORMAT_Y8; - default_extension.format.formatLevel2 = ORBIS_CAMERA_SCALE_FORMAT_Y8; - default_extension.format.formatLevel3 = ORBIS_CAMERA_SCALE_FORMAT_Y8; - default_extension.resolution = ORBIS_CAMERA_RESOLUTION_1280X800; - default_extension.framerate = ORBIS_CAMERA_FRAMERATE_60; - default_extension.width = 0; - default_extension.height = 0; - default_extension.reserved1 = 0; - - memcpy(&config->configExtention[0], &default_extension, sizeof(OrbisCameraConfigExtention)); - memcpy(&config->configExtention[1], &default_extension, sizeof(OrbisCameraConfigExtention)); - - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCameraGetContrast(s32 handle, OrbisCameraChannel channel, u32* contrast, - void* option) { - LOG_DEBUG(Lib_Camera, "called"); - if (handle < 1 || channel >= OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_BOTH || - channel < OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_0 || contrast == nullptr || - option != nullptr) { - return ORBIS_CAMERA_ERROR_PARAM; - } - if (!g_library_opened) { - return ORBIS_CAMERA_ERROR_NOT_OPEN; - } - - *contrast = 32; - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCameraGetDefectivePixelCancellation(s32 handle, OrbisCameraChannel channel, - u32* enable, void* option) { - LOG_DEBUG(Lib_Camera, "called"); - if (handle < 1 || channel >= OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_BOTH || - channel < OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_0 || enable == nullptr || - option != nullptr) { - return ORBIS_CAMERA_ERROR_PARAM; - } - if (!g_library_opened) { - return ORBIS_CAMERA_ERROR_NOT_OPEN; - } - - *enable = 0; - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCameraGetDeviceConfig(s32 handle, OrbisCameraConfig* config) { - if (handle < 1 || config == nullptr || config->sizeThis != sizeof(OrbisCameraConfig)) { - return ORBIS_CAMERA_ERROR_PARAM; - } - if (!g_library_opened) { - return ORBIS_CAMERA_ERROR_NOT_OPEN; - } - - memset(config, 0, sizeof(OrbisCameraConfig)); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCameraGetDeviceConfigWithoutHandle(OrbisCameraConfig* config) { - if (config == nullptr || config->sizeThis != sizeof(OrbisCameraConfig)) { - return ORBIS_CAMERA_ERROR_PARAM; - } - if (!g_library_opened) { - return ORBIS_CAMERA_ERROR_NOT_OPEN; - } - - memset(config, 0, sizeof(OrbisCameraConfig)); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCameraGetDeviceID() { - LOG_ERROR(Lib_Camera, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCameraGetDeviceIDWithoutOpen() { - LOG_ERROR(Lib_Camera, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCameraGetDeviceInfo(s32 reserved, OrbisCameraDeviceInfo* device_info) { - LOG_DEBUG(Lib_Camera, "called"); - if (reserved != 0 || device_info == nullptr || - device_info->sizeThis != sizeof(OrbisCameraDeviceInfo) || device_info->infoRevision != 1) { - return ORBIS_CAMERA_ERROR_PARAM; - } - if (!g_library_opened) { - return ORBIS_CAMERA_ERROR_NOT_INIT; - } - - return ORBIS_CAMERA_ERROR_NOT_CONNECTED; -} - -s32 PS4_SYSV_ABI sceCameraGetExposureGain(s32 handle, OrbisCameraChannel channel, - OrbisCameraExposureGain* exposure_gain, void* option) { - LOG_DEBUG(Lib_Camera, "called"); - if (handle < 1 || channel >= OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_BOTH || - channel < OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_0 || exposure_gain == nullptr || - option != nullptr) { - return ORBIS_CAMERA_ERROR_PARAM; - } - if (!g_library_opened) { - return ORBIS_CAMERA_ERROR_NOT_OPEN; - } - - // Return default parameters - exposure_gain->exposureControl = 0; - exposure_gain->exposure = 83; - exposure_gain->gain = 100; - exposure_gain->mode = 0; - return ORBIS_OK; -} - -static std::vector raw16_buffer1, raw16_buffer2; -static std::vector raw8_buffer1, raw8_buffer2; - -static void ConvertRGBA8888ToRAW16(const u8* src, u16* dst, int width, int height) { - for (int y = 0; y < height; ++y) { - const u8* row = src + y * width * 4; - u16* outRow = dst + y * width; - - for (int x = 0; x < width; ++x) { - const u8* px = row + x * 4; - - u16 b = u16(px[1]) << 4; - u16 g = u16(px[2]) << 4; - u16 r = u16(px[3]) << 4; - - // BGGR Bayer layout - // B G - // G R - bool evenRow = (y & 1) == 0; - bool evenCol = (x & 1) == 0; - - if (evenRow && evenCol) { - outRow[x] = b; - } else if (evenRow && !evenCol) { - outRow[x] = g; - } else if (!evenRow && evenCol) { - outRow[x] = g; - } else { - outRow[x] = r; - } - } - } -} - -static void ConvertRGBA8888ToRAW8(const u8* src, u8* dst, int width, int height) { - for (int y = 0; y < height; ++y) { - const u8* row = src + y * width * 4; - u8* outRow = dst + y * width; - - for (int x = 0; x < width; ++x) { - const u8* px = row + x * 4; - - u8 b = px[1]; - u8 g = px[2]; - u8 r = px[3]; - - // BGGR Bayer layout - // B G - // G R - bool evenRow = (y & 1) == 0; - bool evenCol = (x & 1) == 0; - - if (evenRow && evenCol) { - outRow[x] = b; - } else if (evenRow && !evenCol) { - outRow[x] = g; - } else if (!evenRow && evenCol) { - outRow[x] = g; - } else { - outRow[x] = r; - } - } - } -} - -s32 PS4_SYSV_ABI sceCameraGetFrameData(s32 handle, OrbisCameraFrameData* frame_data) { - LOG_DEBUG(Lib_Camera, "called"); - if (handle < 1 || frame_data == nullptr || frame_data->sizeThis > 584) { - return ORBIS_CAMERA_ERROR_PARAM; - } - if (!g_library_opened || !sdl_camera) { - return ORBIS_CAMERA_ERROR_NOT_OPEN; - } - if (EmulatorSettings.GetCameraId() == -1) { - return ORBIS_CAMERA_ERROR_NOT_CONNECTED; - } - Uint64 timestampNS = 0; - static SDL_Surface* frame = nullptr; - if (frame) { // release previous frame, if it exists - SDL_ReleaseCameraFrame(sdl_camera, frame); - } - frame = SDL_AcquireCameraFrame(sdl_camera, ×tampNS); - - if (!frame) { - return ORBIS_CAMERA_ERROR_BUSY; - } - - switch (output_config0.format.formatLevel0) { - case ORBIS_CAMERA_FORMAT_YUV422: - frame_data->pFramePointerList[0][0] = frame->pixels; - break; - case ORBIS_CAMERA_FORMAT_RAW16: - ConvertRGBA8888ToRAW16((u8*)frame->pixels, raw16_buffer1.data(), c_width, c_height); - frame_data->pFramePointerList[0][0] = raw16_buffer1.data(); - break; - case ORBIS_CAMERA_FORMAT_RAW8: - ConvertRGBA8888ToRAW8((u8*)frame->pixels, raw8_buffer1.data(), c_width, c_height); - frame_data->pFramePointerList[0][0] = raw8_buffer1.data(); - break; - default: - UNREACHABLE(); - } - switch (output_config1.format.formatLevel0) { - case ORBIS_CAMERA_FORMAT_YUV422: - frame_data->pFramePointerList[1][0] = frame->pixels; - break; - case ORBIS_CAMERA_FORMAT_RAW16: - ConvertRGBA8888ToRAW16((u8*)frame->pixels, raw16_buffer2.data(), c_width, c_height); - frame_data->pFramePointerList[1][0] = raw16_buffer2.data(); - break; - case ORBIS_CAMERA_FORMAT_RAW8: - ConvertRGBA8888ToRAW8((u8*)frame->pixels, raw8_buffer2.data(), c_width, c_height); - frame_data->pFramePointerList[1][0] = raw8_buffer2.data(); - break; - default: - UNREACHABLE(); - } - frame_data->meta.format[0][0] = output_config0.format.formatLevel0; - frame_data->meta.format[1][0] = output_config1.format.formatLevel0; - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCameraGetGamma(s32 handle, OrbisCameraChannel channel, OrbisCameraGamma* gamma, - void* option) { - LOG_DEBUG(Lib_Camera, "called"); - if (handle < 1 || channel >= OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_BOTH || - channel < OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_0 || gamma == nullptr || - option != nullptr) { - return ORBIS_CAMERA_ERROR_PARAM; - } - if (!g_library_opened) { - return ORBIS_CAMERA_ERROR_NOT_OPEN; - } - - // Return default parameters - memset(gamma, 0, sizeof(OrbisCameraGamma)); - gamma->value = 4; - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCameraGetHue(s32 handle, OrbisCameraChannel channel, s32* hue, void* option) { - LOG_DEBUG(Lib_Camera, "called"); - if (handle < 1 || channel >= OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_BOTH || - channel < OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_0 || hue == nullptr || - option != nullptr) { - return ORBIS_CAMERA_ERROR_PARAM; - } - if (!g_library_opened) { - return ORBIS_CAMERA_ERROR_NOT_OPEN; - } - - *hue = 1; - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCameraGetLensCorrection(s32 handle, OrbisCameraChannel channel, u32* enable, - void* option) { - LOG_DEBUG(Lib_Camera, "called"); - if (handle < 1 || channel >= OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_BOTH || - channel < OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_0 || enable == nullptr || - option != nullptr) { - return ORBIS_CAMERA_ERROR_PARAM; - } - if (!g_library_opened) { - return ORBIS_CAMERA_ERROR_NOT_OPEN; - } - - *enable = 0; - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCameraGetMmapConnectedCount(u32* count) { - LOG_ERROR(Lib_Camera, "(STUBBED) called"); - if (!g_library_opened) { - return ORBIS_CAMERA_ERROR_NOT_OPEN; - } - if (count == nullptr) { - return ORBIS_CAMERA_ERROR_PARAM; - } - - *count = 0; - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCameraGetProductInfo(void* product_info) { - LOG_DEBUG(Lib_Camera, "(STUBBED) called"); - if (product_info == nullptr) { - return ORBIS_CAMERA_ERROR_PARAM; - } - if (!g_library_opened) { - return ORBIS_CAMERA_ERROR_NOT_INIT; - } - - return ORBIS_CAMERA_ERROR_NOT_CONNECTED; -} - -s32 PS4_SYSV_ABI sceCameraGetRegister() { - LOG_ERROR(Lib_Camera, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCameraGetRegistryInfo(void* registry_info) { - LOG_DEBUG(Lib_Camera, "(STUBBED) called"); - if (registry_info == nullptr) { - return ORBIS_CAMERA_ERROR_PARAM; - } - if (!g_library_opened) { - return ORBIS_CAMERA_ERROR_NOT_INIT; - } - - return ORBIS_CAMERA_ERROR_NOT_CONNECTED; -} - -s32 PS4_SYSV_ABI sceCameraGetSaturation(s32 handle, OrbisCameraChannel channel, u32* saturation, - void* option) { - LOG_DEBUG(Lib_Camera, "called"); - if (handle < 1 || channel >= OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_BOTH || - channel < OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_0 || saturation == nullptr || - option != nullptr) { - return ORBIS_CAMERA_ERROR_PARAM; - } - if (!g_library_opened) { - return ORBIS_CAMERA_ERROR_NOT_OPEN; - } - - *saturation = 64; - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCameraGetSharpness(s32 handle, OrbisCameraChannel channel, u32* sharpness, - void* option) { - LOG_DEBUG(Lib_Camera, "called"); - if (handle < 1 || channel >= OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_BOTH || - channel < OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_0 || sharpness == nullptr || - option != nullptr) { - return ORBIS_CAMERA_ERROR_PARAM; - } - if (!g_library_opened) { - return ORBIS_CAMERA_ERROR_NOT_OPEN; - } - - *sharpness = 1; - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCameraGetVrCaptureInfo() { - LOG_ERROR(Lib_Camera, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCameraGetWhiteBalance(s32 handle, OrbisCameraChannel channel, - OrbisCameraWhiteBalance* white_balance, void* option) { - LOG_DEBUG(Lib_Camera, "called"); - if (handle < 1 || channel >= OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_BOTH || - channel < OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_0 || white_balance == nullptr || - option != nullptr) { - return ORBIS_CAMERA_ERROR_PARAM; - } - if (!g_library_opened) { - return ORBIS_CAMERA_ERROR_NOT_OPEN; - } - - // Set default parameters - white_balance->whiteBalanceControl = 0; - white_balance->gainRed = 768; - white_balance->gainBlue = 768; - white_balance->gainGreen = 512; - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCameraInitializeRegistryCalibData() { - LOG_ERROR(Lib_Camera, "(STUBBED) called"); - if (!g_library_opened) { - return ORBIS_CAMERA_ERROR_NOT_INIT; - } - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCameraIsAttached(s32 index) { - LOG_INFO(Lib_Camera, "called"); - if (index != 0) { - return ORBIS_CAMERA_ERROR_PARAM; - } - // 0 = disconnected, 1 = connected - return EmulatorSettings.GetCameraId() == -1 ? 0 : 1; -} - -s32 PS4_SYSV_ABI sceCameraIsConfigChangeDone() { - LOG_ERROR(Lib_Camera, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCameraIsValidFrameData(s32 handle, OrbisCameraFrameData* frame_data) { - LOG_DEBUG(Lib_Camera, "called"); - if (handle < 1 || frame_data == nullptr || frame_data->sizeThis > 584) { - return ORBIS_CAMERA_ERROR_PARAM; - } - if (!g_library_opened) { - return ORBIS_CAMERA_ERROR_NOT_OPEN; - } - - return 1; // valid -} - -s32 PS4_SYSV_ABI sceCameraOpen(Libraries::UserService::OrbisUserServiceUserId user_id, s32 type, - s32 index, OrbisCameraOpenParameter* param) { - LOG_INFO(Lib_Camera, "called"); - if (user_id != Libraries::UserService::ORBIS_USER_SERVICE_USER_ID_SYSTEM || type != 0 || - index != 0) { - return ORBIS_CAMERA_ERROR_PARAM; - } - - g_library_opened = true; - return ++g_handles; -} - -s32 PS4_SYSV_ABI sceCameraOpenByModuleId() { - LOG_ERROR(Lib_Camera, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCameraRemoveAppModuleFocus() { - LOG_ERROR(Lib_Camera, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCameraSetAppModuleFocus() { - LOG_ERROR(Lib_Camera, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCameraSetAttribute(s32 handle, OrbisCameraAttribute* attribute) { - LOG_DEBUG(Lib_Camera, "called"); - if (handle < 1 || attribute == nullptr || attribute->sizeThis != sizeof(OrbisCameraAttribute) || - attribute->channel > OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_BOTH || - attribute->channel < OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_0) { - return ORBIS_CAMERA_ERROR_PARAM; - } - if (!g_library_opened) { - return ORBIS_CAMERA_ERROR_NOT_OPEN; - } - - return ORBIS_CAMERA_ERROR_NOT_CONNECTED; -} - -s32 PS4_SYSV_ABI sceCameraSetAttributeInternal() { - // Stubbed on real hardware - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCameraSetAutoExposureGain(s32 handle, OrbisCameraChannel channel, u32 enable, - OrbisCameraAutoExposureGainTarget* option) { - LOG_DEBUG(Lib_Camera, "called"); - if (handle < 1 || channel > OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_BOTH || - channel < OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_0) { - return ORBIS_CAMERA_ERROR_PARAM; - } - if (option != nullptr) { - if (g_firmware_version < Common::ElfInfo::FW_30 || - option->sizeThis != sizeof(OrbisCameraAutoExposureGainTarget)) { - return ORBIS_CAMERA_ERROR_PARAM; - } - if (option->target % 2 == 1 || option->target < ORBIS_CAMERA_ATTRIBUTE_AECAGC_TARGET_DEF || - option->target > ORBIS_CAMERA_ATTRIBUTE_AECAGC_TARGET_2_0) { - return ORBIS_CAMERA_ERROR_PARAM; - } - } - if (!g_library_opened) { - return ORBIS_CAMERA_ERROR_NOT_OPEN; - } - - return ORBIS_CAMERA_ERROR_NOT_CONNECTED; -} - -s32 PS4_SYSV_ABI sceCameraSetAutoWhiteBalance(s32 handle, OrbisCameraChannel channel, u32 enable, - void* option) { - LOG_DEBUG(Lib_Camera, "called"); - if (handle < 1 || channel > OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_BOTH || - channel < OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_0 || option != nullptr) { - return ORBIS_CAMERA_ERROR_PARAM; - } - if (!g_library_opened) { - return ORBIS_CAMERA_ERROR_NOT_OPEN; - } - - return ORBIS_CAMERA_ERROR_NOT_CONNECTED; -} - -s32 PS4_SYSV_ABI sceCameraSetCalibData() { - LOG_ERROR(Lib_Camera, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCameraSetConfig(s32 handle, OrbisCameraConfig* config) { - LOG_INFO(Lib_Camera, "called"); - if (handle < 1 || config == nullptr || config->sizeThis != sizeof(OrbisCameraConfig)) { - return ORBIS_CAMERA_ERROR_PARAM; - } - if (!g_library_opened) { - return ORBIS_CAMERA_ERROR_NOT_OPEN; - } - if (EmulatorSettings.GetCameraId() == -1) { - return ORBIS_CAMERA_ERROR_NOT_CONNECTED; - } - - switch (config->configType) { - case ORBIS_CAMERA_CONFIG_TYPE1: - case ORBIS_CAMERA_CONFIG_TYPE2: - case ORBIS_CAMERA_CONFIG_TYPE3: - case ORBIS_CAMERA_CONFIG_TYPE4: - output_config0 = camera_config_types[config->configType - 1][0]; - output_config1 = camera_config_types[config->configType - 1][1]; - break; - case ORBIS_CAMERA_CONFIG_TYPE5: - int sdk_ver; - Libraries::Kernel::sceKernelGetCompiledSdkVersion(&sdk_ver); - if (sdk_ver < Common::ElfInfo::FW_45) { - return ORBIS_CAMERA_ERROR_UNKNOWN_CONFIG; - } - output_config0 = camera_config_types[config->configType - 1][0]; - output_config1 = camera_config_types[config->configType - 1][1]; - break; - case ORBIS_CAMERA_CONFIG_EXTENTION: - output_config0 = config->configExtention[0]; - output_config1 = config->configExtention[1]; - break; - default: - LOG_ERROR(Lib_Camera, "Invalid config type {}", std::to_underlying(config->configType)); - return ORBIS_CAMERA_ERROR_PARAM; - } - - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCameraSetConfigInternal(s32 handle, OrbisCameraConfig* config) { - LOG_DEBUG(Lib_Camera, "called"); - if (handle < 1 || config == nullptr || config->sizeThis != sizeof(OrbisCameraConfig)) { - return ORBIS_CAMERA_ERROR_PARAM; - } - if (!g_library_opened) { - return ORBIS_CAMERA_ERROR_NOT_OPEN; - } - - return ORBIS_CAMERA_ERROR_NOT_CONNECTED; -} - -s32 PS4_SYSV_ABI sceCameraSetContrast(s32 handle, OrbisCameraChannel channel, u32 contrast, - void* option) { - LOG_DEBUG(Lib_Camera, "called"); - if (handle < 1 || channel > OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_BOTH || - channel < OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_0 || option != nullptr) { - return ORBIS_CAMERA_ERROR_PARAM; - } - if (!g_library_opened) { - return ORBIS_CAMERA_ERROR_NOT_OPEN; - } - - return ORBIS_CAMERA_ERROR_NOT_CONNECTED; -} - -s32 PS4_SYSV_ABI sceCameraSetDebugStop(u32 debug_stop_enable) { - LOG_ERROR(Lib_Camera, "(STUBBED) called"); - if (debug_stop_enable > 1) { - return ORBIS_CAMERA_ERROR_PARAM; - } - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCameraSetDefectivePixelCancellation(s32 handle, OrbisCameraChannel channel, - u32 enable, void* option) { - LOG_DEBUG(Lib_Camera, "called"); - if (handle < 1 || channel > OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_BOTH || - channel < OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_0 || enable > 1 || option != nullptr) { - return ORBIS_CAMERA_ERROR_PARAM; - } - if (!g_library_opened) { - return ORBIS_CAMERA_ERROR_NOT_OPEN; - } - - return ORBIS_CAMERA_ERROR_NOT_CONNECTED; -} - -s32 PS4_SYSV_ABI sceCameraSetDefectivePixelCancellationInternal(s32 handle, - OrbisCameraChannel channel, - u32 enable, void* option) { - LOG_DEBUG(Lib_Camera, "called"); - if (handle < 1 || channel > OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_BOTH || - channel < OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_0 || enable > 2 || option != nullptr) { - return ORBIS_CAMERA_ERROR_PARAM; - } - if (!g_library_opened) { - return ORBIS_CAMERA_ERROR_NOT_OPEN; - } - - return ORBIS_CAMERA_ERROR_NOT_CONNECTED; -} - -s32 PS4_SYSV_ABI sceCameraSetExposureGain(s32 handle, OrbisCameraChannel channel, - OrbisCameraExposureGain* exposure_gain, void* option) { - LOG_DEBUG(Lib_Camera, "called"); - if (handle < 1 || channel > OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_BOTH || - channel < OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_0 || exposure_gain != nullptr || - option != nullptr) { - return ORBIS_CAMERA_ERROR_PARAM; - } - if (!g_library_opened) { - return ORBIS_CAMERA_ERROR_NOT_OPEN; - } - - return ORBIS_CAMERA_ERROR_NOT_CONNECTED; -} - -s32 PS4_SYSV_ABI sceCameraSetForceActivate() { - LOG_ERROR(Lib_Camera, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCameraSetGamma(s32 handle, OrbisCameraChannel channel, OrbisCameraGamma* gamma, - void* option) { - LOG_DEBUG(Lib_Camera, "called"); - if (handle < 1 || channel > OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_BOTH || - channel < OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_0 || gamma != nullptr || - option != nullptr) { - return ORBIS_CAMERA_ERROR_PARAM; - } - if (!g_library_opened) { - return ORBIS_CAMERA_ERROR_NOT_OPEN; - } - - return ORBIS_CAMERA_ERROR_NOT_CONNECTED; -} - -s32 PS4_SYSV_ABI sceCameraSetHue(s32 handle, OrbisCameraChannel channel, s32 hue, void* option) { - LOG_DEBUG(Lib_Camera, "called"); - if (handle < 1 || channel > OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_BOTH || - channel < OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_0 || option != nullptr) { - return ORBIS_CAMERA_ERROR_PARAM; - } - if (!g_library_opened) { - return ORBIS_CAMERA_ERROR_NOT_OPEN; - } - - return ORBIS_CAMERA_ERROR_NOT_CONNECTED; -} - -s32 PS4_SYSV_ABI sceCameraSetLensCorrection(s32 handle, OrbisCameraChannel channel, u32 enable, - void* option) { - LOG_DEBUG(Lib_Camera, "called"); - if (handle < 1 || channel > OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_BOTH || - channel < OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_0 || enable > 1 || option != nullptr) { - return ORBIS_CAMERA_ERROR_PARAM; - } - if (!g_library_opened) { - return ORBIS_CAMERA_ERROR_NOT_OPEN; - } - - return ORBIS_CAMERA_ERROR_NOT_CONNECTED; -} - -s32 PS4_SYSV_ABI sceCameraSetLensCorrectionInternal(s32 handle, OrbisCameraChannel channel, - u32 enable, void* option) { - LOG_DEBUG(Lib_Camera, "called"); - if (handle < 1 || channel > OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_BOTH || - channel < OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_0 || enable > 2 || option != nullptr) { - return ORBIS_CAMERA_ERROR_PARAM; - } - if (!g_library_opened) { - return ORBIS_CAMERA_ERROR_NOT_OPEN; - } - - return ORBIS_CAMERA_ERROR_NOT_CONNECTED; -} - -s32 PS4_SYSV_ABI sceCameraSetProcessFocus() { - LOG_ERROR(Lib_Camera, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCameraSetProcessFocusByHandle() { - LOG_ERROR(Lib_Camera, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCameraSetRegister() { - LOG_ERROR(Lib_Camera, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCameraSetSaturation(s32 handle, OrbisCameraChannel channel, u32 saturation, - void* option) { - LOG_DEBUG(Lib_Camera, "called"); - if (handle < 1 || channel > OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_BOTH || - channel < OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_0 || option != nullptr) { - return ORBIS_CAMERA_ERROR_PARAM; - } - if (!g_library_opened) { - return ORBIS_CAMERA_ERROR_NOT_OPEN; - } - - return ORBIS_CAMERA_ERROR_NOT_CONNECTED; -} - -s32 PS4_SYSV_ABI sceCameraSetSharpness(s32 handle, OrbisCameraChannel channel, u32 sharpness, - void* option) { - LOG_DEBUG(Lib_Camera, "called"); - if (handle < 1 || channel > OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_BOTH || - channel < OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_0 || option != nullptr) { - return ORBIS_CAMERA_ERROR_PARAM; - } - if (g_firmware_version >= Common::ElfInfo::FW_35 && sharpness > 10) { - return ORBIS_CAMERA_ERROR_PARAM; - } - if (!g_library_opened) { - return ORBIS_CAMERA_ERROR_NOT_OPEN; - } - - return ORBIS_CAMERA_ERROR_NOT_CONNECTED; -} - -s32 PS4_SYSV_ABI sceCameraSetTrackerMode() { - LOG_ERROR(Lib_Camera, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCameraSetUacModeInternal() { - LOG_ERROR(Lib_Camera, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCameraSetVideoSync(s32 handle, OrbisCameraVideoSyncParameter* video_sync) { - LOG_ERROR(Lib_Camera, "(STUBBED) called"); - if (handle < 1 || video_sync == nullptr || - video_sync->sizeThis != sizeof(OrbisCameraVideoSyncParameter) || - video_sync->videoSyncMode > 1 || video_sync->pModeOption != nullptr) { - return ORBIS_CAMERA_ERROR_PARAM; - } - if (!g_library_opened) { - return ORBIS_CAMERA_ERROR_NOT_OPEN; - } - - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCameraSetVideoSyncInternal(s32 handle, - OrbisCameraVideoSyncParameter* video_sync) { - LOG_ERROR(Lib_Camera, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCameraSetWhiteBalance(s32 handle, OrbisCameraChannel channel, - OrbisCameraWhiteBalance* white_balance, void* option) { - LOG_DEBUG(Lib_Camera, "called"); - if (handle < 1 || channel > OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_BOTH || - channel < OrbisCameraChannel::ORBIS_CAMERA_CHANNEL_0 || white_balance == nullptr || - option != nullptr) { - return ORBIS_CAMERA_ERROR_PARAM; - } - if (!g_library_opened) { - return ORBIS_CAMERA_ERROR_NOT_OPEN; - } - - return ORBIS_CAMERA_ERROR_NOT_CONNECTED; -} - -s32 PS4_SYSV_ABI sceCameraStart(s32 handle, OrbisCameraStartParameter* param) { - LOG_INFO(Lib_Camera, "called"); - if (handle < 1 || param == nullptr || param->sizeThis != sizeof(OrbisCameraStartParameter)) { - return ORBIS_CAMERA_ERROR_PARAM; - } - if (!g_library_opened) { - return ORBIS_CAMERA_ERROR_NOT_OPEN; - } - if (g_firmware_version >= Common::ElfInfo::FW_25 && - (param->formatLevel[0] >= 0xf || param->formatLevel[1] >= 0xf || - (param->formatLevel[0] | param->formatLevel[1]) == 0)) { - return ORBIS_CAMERA_ERROR_FORMAT_UNKNOWN; - } - - if (param->formatLevel[0] > 1 || param->formatLevel[1] > 1) { - LOG_ERROR(Lib_Camera, "Downscaled image retrieval isn't supported yet!"); - } - - SDL_CameraID* devices = NULL; - int devcount = 0; - devices = SDL_GetCameras(&devcount); - if (devices == NULL) { - LOG_ERROR(Lib_Camera, "Couldn't enumerate camera devices: {}", SDL_GetError()); - return ORBIS_CAMERA_ERROR_FATAL; - } else if (devcount == 0) { - LOG_INFO(Lib_Camera, "No camera devices connected"); - return ORBIS_CAMERA_ERROR_NOT_CONNECTED; - } - raw8_buffer1.resize(c_width * c_height); - raw16_buffer1.resize(c_width * c_height); - raw8_buffer2.resize(c_width * c_height); - raw16_buffer2.resize(c_width * c_height); - SDL_CameraSpec cam_spec{}; - switch (output_config0.format.formatLevel0) { - case ORBIS_CAMERA_FORMAT_YUV422: - cam_spec.format = SDL_PIXELFORMAT_YUY2; - break; - case ORBIS_CAMERA_FORMAT_RAW8: - cam_spec.format = SDL_PIXELFORMAT_RGBA8888; // to be swizzled - break; - case ORBIS_CAMERA_FORMAT_RAW16: - cam_spec.format = SDL_PIXELFORMAT_RGBA8888; // to be swizzled - break; - - default: - LOG_ERROR(Lib_Camera, "Invalid format {}", - std::to_underlying(output_config0.format.formatLevel0)); - break; - } - cam_spec.height = c_height; - cam_spec.width = c_width; - cam_spec.framerate_numerator = 60; - cam_spec.framerate_denominator = 1; - sdl_camera = SDL_OpenCamera(devices[EmulatorSettings.GetCameraId()], &cam_spec); - LOG_INFO(Lib_Camera, "SDL backend in use: {}", SDL_GetCurrentCameraDriver()); - char const* camera_name = SDL_GetCameraName(devices[EmulatorSettings.GetCameraId()]); - if (camera_name) - LOG_INFO(Lib_Camera, "SDL camera name: {}", camera_name); - SDL_CameraSpec spec; - SDL_GetCameraFormat(sdl_camera, &spec); - LOG_INFO(Lib_Camera, "SDL camera format: {:#x}", std::to_underlying(spec.format)); - LOG_INFO(Lib_Camera, "SDL camera framerate: {}", - (float)spec.framerate_numerator / (float)spec.framerate_denominator); - LOG_INFO(Lib_Camera, "SDL camera dimensions: {}x{}", spec.width, spec.height); - - SDL_free(devices); - - // "warm up" the device, as recommended by SDL - u64 timestamp; - SDL_Surface* frame = nullptr; - frame = SDL_AcquireCameraFrame(sdl_camera, ×tamp); - if (!frame) { - for (int i = 0; i < 1000; i++) { - frame = SDL_AcquireCameraFrame(sdl_camera, ×tamp); - if (frame) { - SDL_ReleaseCameraFrame(sdl_camera, frame); - break; - } - std::this_thread::sleep_for(std::chrono::nanoseconds(10)); - } - } - - if (!sdl_camera) { - LOG_ERROR(Lib_Camera, "Failed to open camera: {}", SDL_GetError()); - return ORBIS_CAMERA_ERROR_FATAL; - } - - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCameraStartByHandle(s32 handle, OrbisCameraStartParameter* param) { - LOG_DEBUG(Lib_Camera, "called"); - if (handle < 1 || param == nullptr || param->sizeThis != sizeof(OrbisCameraStartParameter)) { - return ORBIS_CAMERA_ERROR_PARAM; - } - if (!g_library_opened) { - return ORBIS_CAMERA_ERROR_NOT_OPEN; - } - - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCameraStop(s32 handle) { - LOG_DEBUG(Lib_Camera, "called"); - if (handle < 1) { - return ORBIS_CAMERA_ERROR_PARAM; - } - if (!g_library_opened) { - return ORBIS_CAMERA_ERROR_NOT_OPEN; - } - - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCameraStopByHandle(s32 handle) { - LOG_DEBUG(Lib_Camera, "called"); - if (handle < 1) { - return ORBIS_CAMERA_ERROR_PARAM; - } - if (!g_library_opened) { - return ORBIS_CAMERA_ERROR_NOT_OPEN; - } - - return ORBIS_OK; -} - -void RegisterLib(Core::Loader::SymbolsResolver* sym) { - Libraries::Kernel::sceKernelGetCompiledSdkVersion(&g_firmware_version); - - LIB_FUNCTION("QhjrPkRPUZQ", "libSceCamera", 1, "libSceCamera", sceCameraAccGetData); - LIB_FUNCTION("UFonL7xopFM", "libSceCamera", 1, "libSceCamera", sceCameraAudioClose); - LIB_FUNCTION("fkZE7Hup2ro", "libSceCamera", 1, "libSceCamera", sceCameraAudioGetData); - LIB_FUNCTION("hftC5A1C8OQ", "libSceCamera", 1, "libSceCamera", sceCameraAudioGetData2); - LIB_FUNCTION("DhqqFiBU+6g", "libSceCamera", 1, "libSceCamera", sceCameraAudioOpen); - LIB_FUNCTION("wyU98EXAYxU", "libSceCamera", 1, "libSceCamera", sceCameraAudioReset); - LIB_FUNCTION("Y0pCDajzkVQ", "libSceCamera", 1, "libSceCamera", sceCameraChangeAppModuleState); - LIB_FUNCTION("OMS9LlcrvBo", "libSceCamera", 1, "libSceCamera", sceCameraClose); - LIB_FUNCTION("ztqH5qNTpTk", "libSceCamera", 1, "libSceCamera", sceCameraCloseByHandle); - LIB_FUNCTION("nBH6i2s4Glc", "libSceCamera", 1, "libSceCamera", sceCameraDeviceOpen); - LIB_FUNCTION("0btIPD5hg5A", "libSceCamera", 1, "libSceCamera", sceCameraGetAttribute); - LIB_FUNCTION("oEi6vM-3E2c", "libSceCamera", 1, "libSceCamera", sceCameraGetAutoExposureGain); - LIB_FUNCTION("qTPRMh4eY60", "libSceCamera", 1, "libSceCamera", sceCameraGetAutoWhiteBalance); - LIB_FUNCTION("hHA1frlMxYE", "libSceCamera", 1, "libSceCamera", sceCameraGetCalibData); - LIB_FUNCTION("5Oie5RArfWs", "libSceCamera", 1, "libSceCamera", sceCameraGetCalibDataFromDevice); - LIB_FUNCTION("RHYJ7GKOSMg", "libSceCamera", 1, "libSceCamera", sceCameraGetCalibrationData); - LIB_FUNCTION("ZaqmGEtYuL0", "libSceCamera", 1, "libSceCamera", sceCameraGetConfig); - LIB_FUNCTION("a5xFueMZIMs", "libSceCamera", 1, "libSceCamera", sceCameraGetContrast); - LIB_FUNCTION("tslCukqFE+E", "libSceCamera", 1, "libSceCamera", - sceCameraGetDefectivePixelCancellation); - LIB_FUNCTION("DSOLCrc3Kh8", "libSceCamera", 1, "libSceCamera", sceCameraGetDeviceConfig); - LIB_FUNCTION("n+rFeP1XXyM", "libSceCamera", 1, "libSceCamera", - sceCameraGetDeviceConfigWithoutHandle); - LIB_FUNCTION("jTJCdyv9GLU", "libSceCamera", 1, "libSceCamera", sceCameraGetDeviceID); - LIB_FUNCTION("-H3UwGQvNZI", "libSceCamera", 1, "libSceCamera", sceCameraGetDeviceIDWithoutOpen); - LIB_FUNCTION("WZpxnSAM-ds", "libSceCamera", 1, "libSceCamera", sceCameraGetDeviceInfo); - LIB_FUNCTION("ObIste7hqdk", "libSceCamera", 1, "libSceCamera", sceCameraGetExposureGain); - LIB_FUNCTION("mxgMmR+1Kr0", "libSceCamera", 1, "libSceCamera", sceCameraGetFrameData); - LIB_FUNCTION("WVox2rwGuSc", "libSceCamera", 1, "libSceCamera", sceCameraGetGamma); - LIB_FUNCTION("zrIUDKZx0iE", "libSceCamera", 1, "libSceCamera", sceCameraGetHue); - LIB_FUNCTION("XqYRHc4aw3w", "libSceCamera", 1, "libSceCamera", sceCameraGetLensCorrection); - LIB_FUNCTION("B260o9pSzM8", "libSceCamera", 1, "libSceCamera", sceCameraGetMmapConnectedCount); - LIB_FUNCTION("ULxbwqiYYuU", "libSceCamera", 1, "libSceCamera", sceCameraGetProductInfo); - LIB_FUNCTION("olojYZKYiYs", "libSceCamera", 1, "libSceCamera", sceCameraGetRegister); - LIB_FUNCTION("hawKak+Auw4", "libSceCamera", 1, "libSceCamera", sceCameraGetRegistryInfo); - LIB_FUNCTION("RTDOsWWqdME", "libSceCamera", 1, "libSceCamera", sceCameraGetSaturation); - LIB_FUNCTION("c6Fp9M1EXXc", "libSceCamera", 1, "libSceCamera", sceCameraGetSharpness); - LIB_FUNCTION("IAz2HgZQWzE", "libSceCamera", 1, "libSceCamera", sceCameraGetVrCaptureInfo); - LIB_FUNCTION("HX5524E5tMY", "libSceCamera", 1, "libSceCamera", sceCameraGetWhiteBalance); - LIB_FUNCTION("0wnf2a60FqI", "libSceCamera", 1, "libSceCamera", - sceCameraInitializeRegistryCalibData); - LIB_FUNCTION("p6n3Npi3YY4", "libSceCamera", 1, "libSceCamera", sceCameraIsAttached); - LIB_FUNCTION("wQfd7kfRZvo", "libSceCamera", 1, "libSceCamera", sceCameraIsConfigChangeDone); - LIB_FUNCTION("U3BVwQl2R5Q", "libSceCamera", 1, "libSceCamera", sceCameraIsValidFrameData); - LIB_FUNCTION("BHn83xrF92E", "libSceCamera", 1, "libSceCamera", sceCameraOpen); - LIB_FUNCTION("eTywOSWsEiI", "libSceCamera", 1, "libSceCamera", sceCameraOpenByModuleId); - LIB_FUNCTION("py8p6kZcHmA", "libSceCamera", 1, "libSceCamera", sceCameraRemoveAppModuleFocus); - LIB_FUNCTION("j5isFVIlZLk", "libSceCamera", 1, "libSceCamera", sceCameraSetAppModuleFocus); - LIB_FUNCTION("doPlf33ab-U", "libSceCamera", 1, "libSceCamera", sceCameraSetAttribute); - LIB_FUNCTION("96F7zp1Xo+k", "libSceCamera", 1, "libSceCamera", sceCameraSetAttributeInternal); - LIB_FUNCTION("yfSdswDaElo", "libSceCamera", 1, "libSceCamera", sceCameraSetAutoExposureGain); - LIB_FUNCTION("zIKL4kZleuc", "libSceCamera", 1, "libSceCamera", sceCameraSetAutoWhiteBalance); - LIB_FUNCTION("LEMk5cTHKEA", "libSceCamera", 1, "libSceCamera", sceCameraSetCalibData); - LIB_FUNCTION("VQ+5kAqsE2Q", "libSceCamera", 1, "libSceCamera", sceCameraSetConfig); - LIB_FUNCTION("9+SNhbctk64", "libSceCamera", 1, "libSceCamera", sceCameraSetConfigInternal); - LIB_FUNCTION("3i5MEzrC1pg", "libSceCamera", 1, "libSceCamera", sceCameraSetContrast); - LIB_FUNCTION("vejouEusC7g", "libSceCamera", 1, "libSceCamera", sceCameraSetDebugStop); - LIB_FUNCTION("jMv40y2A23g", "libSceCamera", 1, "libSceCamera", - sceCameraSetDefectivePixelCancellation); - LIB_FUNCTION("vER3cIMBHqI", "libSceCamera", 1, "libSceCamera", - sceCameraSetDefectivePixelCancellationInternal); - LIB_FUNCTION("wgBMXJJA6K4", "libSceCamera", 1, "libSceCamera", sceCameraSetExposureGain); - LIB_FUNCTION("jeTpU0MqKU0", "libSceCamera", 1, "libSceCamera", sceCameraSetForceActivate); - LIB_FUNCTION("lhEIsHzB8r4", "libSceCamera", 1, "libSceCamera", sceCameraSetGamma); - LIB_FUNCTION("QI8GVJUy2ZY", "libSceCamera", 1, "libSceCamera", sceCameraSetHue); - LIB_FUNCTION("K7W7H4ZRwbc", "libSceCamera", 1, "libSceCamera", sceCameraSetLensCorrection); - LIB_FUNCTION("eHa3vhGu2rQ", "libSceCamera", 1, "libSceCamera", - sceCameraSetLensCorrectionInternal); - LIB_FUNCTION("lS0tM6n+Q5E", "libSceCamera", 1, "libSceCamera", sceCameraSetProcessFocus); - LIB_FUNCTION("NVITuK83Z7o", "libSceCamera", 1, "libSceCamera", - sceCameraSetProcessFocusByHandle); - LIB_FUNCTION("8MjO05qk5hA", "libSceCamera", 1, "libSceCamera", sceCameraSetRegister); - LIB_FUNCTION("bSKEi2PzzXI", "libSceCamera", 1, "libSceCamera", sceCameraSetSaturation); - LIB_FUNCTION("P-7MVfzvpsM", "libSceCamera", 1, "libSceCamera", sceCameraSetSharpness); - LIB_FUNCTION("3VJOpzKoIeM", "libSceCamera", 1, "libSceCamera", sceCameraSetTrackerMode); - LIB_FUNCTION("nnR7KAIDPv8", "libSceCamera", 1, "libSceCamera", sceCameraSetUacModeInternal); - LIB_FUNCTION("wpeyFwJ+UEI", "libSceCamera", 1, "libSceCamera", sceCameraSetVideoSync); - LIB_FUNCTION("8WtmqmE4edw", "libSceCamera", 1, "libSceCamera", sceCameraSetVideoSyncInternal); - LIB_FUNCTION("k3zPIcgFNv0", "libSceCamera", 1, "libSceCamera", sceCameraSetWhiteBalance); - LIB_FUNCTION("9EpRYMy7rHU", "libSceCamera", 1, "libSceCamera", sceCameraStart); - LIB_FUNCTION("cLxF1QtHch0", "libSceCamera", 1, "libSceCamera", sceCameraStartByHandle); - LIB_FUNCTION("2G2C0nmd++M", "libSceCamera", 1, "libSceCamera", sceCameraStop); - LIB_FUNCTION("+X1Kgnn3bzg", "libSceCamera", 1, "libSceCamera", sceCameraStopByHandle); -}; - -} // namespace Libraries::Camera \ No newline at end of file diff --git a/src/core/libraries/camera/camera.h b/src/core/libraries/camera/camera.h deleted file mode 100644 index eba7f4720..000000000 --- a/src/core/libraries/camera/camera.h +++ /dev/null @@ -1,459 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include -#include "common/types.h" - -namespace Core::Loader { -class SymbolsResolver; -} - -namespace Libraries::Camera { - -constexpr s32 ORBIS_CAMERA_MAX_DEVICE_NUM = 2; -constexpr s32 ORBIS_CAMERA_MAX_FORMAT_LEVEL_NUM = 4; -constexpr s32 ORBIS_CAMERA_CALIBRATION_DATA_MESH_NUMBER_OF_TOTAL_VERTICIES = 1276; - -enum OrbisCameraChannel { - ORBIS_CAMERA_CHANNEL_0 = 1, - ORBIS_CAMERA_CHANNEL_1 = 2, - ORBIS_CAMERA_CHANNEL_BOTH = 3, -}; - -struct OrbisCameraOpenParameter { - u32 sizeThis; - u32 reserved1; - u32 reserved2; - u32 reserved3; -}; - -enum OrbisCameraConfigType { - ORBIS_CAMERA_CONFIG_TYPE1 = 0x01, - ORBIS_CAMERA_CONFIG_TYPE2 = 0x02, - ORBIS_CAMERA_CONFIG_TYPE3 = 0x03, - ORBIS_CAMERA_CONFIG_TYPE4 = 0x04, - ORBIS_CAMERA_CONFIG_TYPE5 = 0x05, - ORBIS_CAMERA_CONFIG_EXTENTION = 0x10, -}; - -enum OrbisCameraResolution { - ORBIS_CAMERA_RESOLUTION_1280X800 = 0x0, - ORBIS_CAMERA_RESOLUTION_640X400 = 0x1, - ORBIS_CAMERA_RESOLUTION_320X200 = 0x2, - ORBIS_CAMERA_RESOLUTION_160X100 = 0x3, - ORBIS_CAMERA_RESOLUTION_320X192 = 0x4, - ORBIS_CAMERA_RESOLUTION_SPECIFIED_WIDTH_HEIGHT, - ORBIS_CAMERA_RESOLUTION_UNKNOWN = 0xFF, -}; - -enum OrbisCameraFramerate { - ORBIS_CAMERA_FRAMERATE_UNKNOWN = 0, - ORBIS_CAMERA_FRAMERATE_7_5 = 7, - ORBIS_CAMERA_FRAMERATE_15 = 15, - ORBIS_CAMERA_FRAMERATE_30 = 30, - ORBIS_CAMERA_FRAMERATE_60 = 60, - ORBIS_CAMERA_FRAMERATE_120 = 120, - ORBIS_CAMERA_FRAMERATE_240 = 240, -}; - -enum OrbisCameraBaseFormat { - ORBIS_CAMERA_FORMAT_YUV422 = 0x0, - ORBIS_CAMERA_FORMAT_RAW16, - ORBIS_CAMERA_FORMAT_RAW8, - ORBIS_CAMERA_FORMAT_NO_USE = 0x10, - ORBIS_CAMERA_FORMAT_UNKNOWN = 0xFF, -}; - -enum OrbisCameraScaleFormat { - ORBIS_CAMERA_SCALE_FORMAT_YUV422 = 0x0, - ORBIS_CAMERA_SCALE_FORMAT_Y16 = 0x3, - ORBIS_CAMERA_SCALE_FORMAT_Y8, - ORBIS_CAMERA_SCALE_FORMAT_NO_USE = 0x10, - ORBIS_CAMERA_SCALE_FORMAT_UNKNOWN = 0xFF, -}; - -enum OrbisCameraCalibrationDataFunctionType { - ORBIS_CAMERA_CALIBRATION_DATA_FUNCTION_TYPE_IMAGE_RECTIFICATION = 0, - ORBIS_CAMERA_CALIBRATION_DATA_FUNCTION_TYPE_IMAGE_INVERSE_RECTIFICATION = 1, -}; - -struct OrbisCameraFormat { - OrbisCameraBaseFormat formatLevel0; - OrbisCameraScaleFormat formatLevel1; - OrbisCameraScaleFormat formatLevel2; - OrbisCameraScaleFormat formatLevel3; -}; - -struct OrbisCameraConfigExtention { - OrbisCameraFormat format; - OrbisCameraResolution resolution; - OrbisCameraFramerate framerate; - u32 width; - u32 height; - u32 reserved1; - void* pBaseOption; -}; - -struct OrbisCameraConfig { - u32 sizeThis; - OrbisCameraConfigType configType; - OrbisCameraConfigExtention configExtention[ORBIS_CAMERA_MAX_DEVICE_NUM]; -}; - -constexpr OrbisCameraConfigExtention camera_config_types[5][ORBIS_CAMERA_MAX_DEVICE_NUM]{ - { - // type 1 - { - .format = - { - .formatLevel0 = ORBIS_CAMERA_FORMAT_YUV422, - .formatLevel1 = ORBIS_CAMERA_SCALE_FORMAT_Y8, - .formatLevel2 = ORBIS_CAMERA_SCALE_FORMAT_Y8, - .formatLevel3 = ORBIS_CAMERA_SCALE_FORMAT_Y8, - }, - .framerate = ORBIS_CAMERA_FRAMERATE_60, - }, - { - .format = - { - .formatLevel0 = ORBIS_CAMERA_FORMAT_RAW16, - .formatLevel1 = ORBIS_CAMERA_SCALE_FORMAT_Y8, - .formatLevel2 = ORBIS_CAMERA_SCALE_FORMAT_Y8, - .formatLevel3 = ORBIS_CAMERA_SCALE_FORMAT_Y8, - }, - .framerate = ORBIS_CAMERA_FRAMERATE_60, - }, - }, - { - // type 2 - { - .format = - { - .formatLevel0 = ORBIS_CAMERA_FORMAT_YUV422, - .formatLevel1 = ORBIS_CAMERA_SCALE_FORMAT_YUV422, - .formatLevel2 = ORBIS_CAMERA_SCALE_FORMAT_YUV422, - .formatLevel3 = ORBIS_CAMERA_SCALE_FORMAT_YUV422, - }, - .framerate = ORBIS_CAMERA_FRAMERATE_60, - }, - { - .format = - { - .formatLevel0 = ORBIS_CAMERA_FORMAT_YUV422, - .formatLevel1 = ORBIS_CAMERA_SCALE_FORMAT_YUV422, - .formatLevel2 = ORBIS_CAMERA_SCALE_FORMAT_YUV422, - .formatLevel3 = ORBIS_CAMERA_SCALE_FORMAT_YUV422, - }, - .framerate = ORBIS_CAMERA_FRAMERATE_60, - }, - }, - { - // type 3 - { - .format = - { - .formatLevel0 = ORBIS_CAMERA_FORMAT_YUV422, - .formatLevel1 = ORBIS_CAMERA_SCALE_FORMAT_Y8, - .formatLevel2 = ORBIS_CAMERA_SCALE_FORMAT_Y8, - .formatLevel3 = ORBIS_CAMERA_SCALE_FORMAT_Y8, - }, - .framerate = ORBIS_CAMERA_FRAMERATE_60, - }, - { - .format = - { - .formatLevel0 = ORBIS_CAMERA_FORMAT_YUV422, - .formatLevel1 = ORBIS_CAMERA_SCALE_FORMAT_Y8, - .formatLevel2 = ORBIS_CAMERA_SCALE_FORMAT_Y8, - .formatLevel3 = ORBIS_CAMERA_SCALE_FORMAT_Y8, - }, - .framerate = ORBIS_CAMERA_FRAMERATE_60, - }, - }, - { - // type 4 - { - .format = - { - .formatLevel0 = ORBIS_CAMERA_FORMAT_RAW16, - .formatLevel1 = ORBIS_CAMERA_SCALE_FORMAT_YUV422, - .formatLevel2 = ORBIS_CAMERA_SCALE_FORMAT_YUV422, - .formatLevel3 = ORBIS_CAMERA_SCALE_FORMAT_YUV422, - }, - .framerate = ORBIS_CAMERA_FRAMERATE_60, - }, - { - .format = - { - .formatLevel0 = ORBIS_CAMERA_FORMAT_RAW16, - .formatLevel1 = ORBIS_CAMERA_SCALE_FORMAT_YUV422, - .formatLevel2 = ORBIS_CAMERA_SCALE_FORMAT_YUV422, - .formatLevel3 = ORBIS_CAMERA_SCALE_FORMAT_YUV422, - }, - .framerate = ORBIS_CAMERA_FRAMERATE_60, - }, - }, - { - // type 5 - { - .format = - { - .formatLevel0 = ORBIS_CAMERA_FORMAT_YUV422, - .formatLevel1 = ORBIS_CAMERA_SCALE_FORMAT_YUV422, - .formatLevel2 = ORBIS_CAMERA_SCALE_FORMAT_YUV422, - .formatLevel3 = ORBIS_CAMERA_SCALE_FORMAT_YUV422, - }, - .framerate = ORBIS_CAMERA_FRAMERATE_60, - }, - { - .format = - { - .formatLevel0 = ORBIS_CAMERA_FORMAT_RAW16, - .formatLevel1 = ORBIS_CAMERA_SCALE_FORMAT_YUV422, - .formatLevel2 = ORBIS_CAMERA_SCALE_FORMAT_YUV422, - .formatLevel3 = ORBIS_CAMERA_SCALE_FORMAT_YUV422, - }, - .framerate = ORBIS_CAMERA_FRAMERATE_60, - }, - }}; - -enum OrbisCameraAecAgcTarget { - ORBIS_CAMERA_ATTRIBUTE_AECAGC_TARGET_DEF = 0x00, - ORBIS_CAMERA_ATTRIBUTE_AECAGC_TARGET_2_0 = 0x20, - ORBIS_CAMERA_ATTRIBUTE_AECAGC_TARGET_1_6 = 0x16, - ORBIS_CAMERA_ATTRIBUTE_AECAGC_TARGET_1_4 = 0x14, - ORBIS_CAMERA_ATTRIBUTE_AECAGC_TARGET_1_2 = 0x12, - ORBIS_CAMERA_ATTRIBUTE_AECAGC_TARGET_1_0 = 0x10, - ORBIS_CAMERA_ATTRIBUTE_AECAGC_TARGET_0_8 = 0x08, - ORBIS_CAMERA_ATTRIBUTE_AECAGC_TARGET_0_6 = 0x06, - ORBIS_CAMERA_ATTRIBUTE_AECAGC_TARGET_0_4 = 0x04, - ORBIS_CAMERA_ATTRIBUTE_AECAGC_TARGET_0_2 = 0x02, -}; - -struct OrbisCameraDeviceInfo { - u32 sizeThis; - u32 infoRevision; - u32 deviceRevision; - u32 padding; -}; - -struct OrbisCameraStartParameter { - u32 sizeThis; - u32 formatLevel[ORBIS_CAMERA_MAX_DEVICE_NUM]; - void* pStartOption; -}; - -struct OrbisCameraVideoSyncParameter { - u32 sizeThis; - u32 videoSyncMode; - void* pModeOption; -}; - -struct OrbisCameraFramePosition { - u32 x; - u32 y; - u32 xSize; - u32 ySize; -}; - -struct OrbisCameraAutoExposureGainTarget { - u32 sizeThis; - OrbisCameraAecAgcTarget target; -}; - -struct OrbisCameraExposureGain { - u32 exposureControl; - u32 exposure; - u32 gain; - u32 mode; -}; - -struct OrbisCameraWhiteBalance { - u32 whiteBalanceControl; - u32 gainRed; - u32 gainBlue; - u32 gainGreen; -}; - -struct OrbisCameraGamma { - u32 gammaControl; - u32 value; - u8 reserved[16]; -}; - -struct OrbisCameraMeta { - u32 metaMode; - u32 format[ORBIS_CAMERA_MAX_DEVICE_NUM][ORBIS_CAMERA_MAX_FORMAT_LEVEL_NUM]; - u64 frame[ORBIS_CAMERA_MAX_DEVICE_NUM]; - u64 timestamp[ORBIS_CAMERA_MAX_DEVICE_NUM]; - u32 deviceTimestamp[ORBIS_CAMERA_MAX_DEVICE_NUM]; - OrbisCameraExposureGain exposureGain[ORBIS_CAMERA_MAX_DEVICE_NUM]; - OrbisCameraWhiteBalance whiteBalance[ORBIS_CAMERA_MAX_DEVICE_NUM]; - OrbisCameraGamma gamma[ORBIS_CAMERA_MAX_DEVICE_NUM]; - u32 luminance[ORBIS_CAMERA_MAX_DEVICE_NUM]; - float acceleration_x; - float acceleration_y; - float acceleration_z; - u64 vcounter; - u32 reserved[14]; -}; - -struct OrbisCameraFrameData { - u32 sizeThis; - u32 readMode; - OrbisCameraFramePosition framePosition[ORBIS_CAMERA_MAX_DEVICE_NUM] - [ORBIS_CAMERA_MAX_FORMAT_LEVEL_NUM]; - void* pFramePointerList[ORBIS_CAMERA_MAX_DEVICE_NUM][ORBIS_CAMERA_MAX_FORMAT_LEVEL_NUM]; - u32 frameSize[ORBIS_CAMERA_MAX_DEVICE_NUM][ORBIS_CAMERA_MAX_FORMAT_LEVEL_NUM]; - u32 status[ORBIS_CAMERA_MAX_DEVICE_NUM]; - OrbisCameraMeta meta; - void* pFramePointerListGarlic[ORBIS_CAMERA_MAX_DEVICE_NUM][ORBIS_CAMERA_MAX_FORMAT_LEVEL_NUM]; -}; - -struct OrbisCameraAttribute { - u32 sizeThis; - OrbisCameraChannel channel; - OrbisCameraFramePosition framePosition; - OrbisCameraExposureGain exposureGain; - OrbisCameraWhiteBalance whiteBalance; - OrbisCameraGamma gamma; - u32 saturation; - u32 contrast; - u32 sharpness; - s32 hue; - u32 reserved1; - u32 reserved2; - u32 reserved3; - u32 reserved4; -}; - -struct OrbisCameraGetCalibrationDataParameter { - u32 size; - u32 format_type; - OrbisCameraCalibrationDataFunctionType function_type; -}; - -struct OrbisCameraCalibrationDataElement { - u32 total_horizontal_verticies; - u32 total_vertical_verticies; - u32 left_margin; - u32 right_margin; - u32 top_margin; - u32 bottom_margin; - float x_table[ORBIS_CAMERA_CALIBRATION_DATA_MESH_NUMBER_OF_TOTAL_VERTICIES]; - float y_table[ORBIS_CAMERA_CALIBRATION_DATA_MESH_NUMBER_OF_TOTAL_VERTICIES]; -}; - -struct OrbisCameraCalibrationData { - u32 format_type; - OrbisCameraCalibrationDataFunctionType function_type; - OrbisCameraCalibrationDataElement data[2]; -}; - -s32 PS4_SYSV_ABI sceCameraAccGetData(); -s32 PS4_SYSV_ABI sceCameraAudioClose(); -s32 PS4_SYSV_ABI sceCameraAudioGetData(void* data); -s32 PS4_SYSV_ABI sceCameraAudioGetData2(void* data); -s32 PS4_SYSV_ABI sceCameraAudioOpen(); -s32 PS4_SYSV_ABI sceCameraAudioReset(); -s32 PS4_SYSV_ABI sceCameraChangeAppModuleState(); -s32 PS4_SYSV_ABI sceCameraClose(s32 handle); -s32 PS4_SYSV_ABI sceCameraCloseByHandle(s32 handle); -s32 PS4_SYSV_ABI sceCameraDeviceOpen(); -s32 PS4_SYSV_ABI sceCameraGetAttribute(s32 handle, OrbisCameraAttribute* attribute); -s32 PS4_SYSV_ABI sceCameraGetAutoExposureGain(s32 handle, OrbisCameraChannel channel, u32* enable, - OrbisCameraAutoExposureGainTarget* option); -s32 PS4_SYSV_ABI sceCameraGetAutoWhiteBalance(s32 handle, OrbisCameraChannel channel, u32* enable, - void* option); -s32 PS4_SYSV_ABI sceCameraGetCalibData(); -s32 PS4_SYSV_ABI sceCameraGetCalibDataFromDevice(); -s32 PS4_SYSV_ABI sceCameraGetCalibrationData(const OrbisCameraGetCalibrationDataParameter* param, - OrbisCameraCalibrationData* calibration_data); -s32 PS4_SYSV_ABI sceCameraGetConfig(s32 handle, OrbisCameraConfig* config); -s32 PS4_SYSV_ABI sceCameraGetContrast(s32 handle, OrbisCameraChannel channel, u32* contrast, - void* option); -s32 PS4_SYSV_ABI sceCameraGetDefectivePixelCancellation(s32 handle, OrbisCameraChannel channel, - u32* enable, void* option); -s32 PS4_SYSV_ABI sceCameraGetDeviceConfig(s32 handle, OrbisCameraConfig* config); -s32 PS4_SYSV_ABI sceCameraGetDeviceConfigWithoutHandle(OrbisCameraConfig* config); -s32 PS4_SYSV_ABI sceCameraGetDeviceID(); -s32 PS4_SYSV_ABI sceCameraGetDeviceIDWithoutOpen(); -s32 PS4_SYSV_ABI sceCameraGetDeviceInfo(s32 reserved, OrbisCameraDeviceInfo* device_info); -s32 PS4_SYSV_ABI sceCameraGetExposureGain(s32 handle, OrbisCameraChannel channel, - OrbisCameraExposureGain* exposure_gain, void* option); -s32 PS4_SYSV_ABI sceCameraGetFrameData(s32 handle, OrbisCameraFrameData* frame_data); -s32 PS4_SYSV_ABI sceCameraGetGamma(s32 handle, OrbisCameraChannel channel, OrbisCameraGamma* gamma, - void* option); -s32 PS4_SYSV_ABI sceCameraGetHue(s32 handle, OrbisCameraChannel channel, s32* hue, void* option); -s32 PS4_SYSV_ABI sceCameraGetLensCorrection(s32 handle, OrbisCameraChannel channel, u32* enable, - void* option); -s32 PS4_SYSV_ABI sceCameraGetMmapConnectedCount(u32* count); -s32 PS4_SYSV_ABI sceCameraGetProductInfo(void* product_info); -s32 PS4_SYSV_ABI sceCameraGetRegister(); -s32 PS4_SYSV_ABI sceCameraGetRegistryInfo(void* registry_info); -s32 PS4_SYSV_ABI sceCameraGetSaturation(s32 handle, OrbisCameraChannel channel, u32* saturation, - void* option); -s32 PS4_SYSV_ABI sceCameraGetSharpness(s32 handle, OrbisCameraChannel channel, u32* sharpness, - void* option); -s32 PS4_SYSV_ABI sceCameraGetVrCaptureInfo(); -s32 PS4_SYSV_ABI sceCameraGetWhiteBalance(s32 handle, OrbisCameraChannel channel, - OrbisCameraWhiteBalance* white_balance, void* option); -s32 PS4_SYSV_ABI sceCameraInitializeRegistryCalibData(); -s32 PS4_SYSV_ABI sceCameraIsAttached(s32 index); -s32 PS4_SYSV_ABI sceCameraIsConfigChangeDone(); -s32 PS4_SYSV_ABI sceCameraIsValidFrameData(s32 handle, OrbisCameraFrameData* frame_data); -s32 PS4_SYSV_ABI sceCameraOpen(Libraries::UserService::OrbisUserServiceUserId user_id, s32 type, - s32 index, OrbisCameraOpenParameter* param); -s32 PS4_SYSV_ABI sceCameraOpenByModuleId(); -s32 PS4_SYSV_ABI sceCameraRemoveAppModuleFocus(); -s32 PS4_SYSV_ABI sceCameraSetAppModuleFocus(); -s32 PS4_SYSV_ABI sceCameraSetAttribute(s32 handle, OrbisCameraAttribute* attribute); -s32 PS4_SYSV_ABI sceCameraSetAttributeInternal(); -s32 PS4_SYSV_ABI sceCameraSetAutoExposureGain(s32 handle, OrbisCameraChannel channel, u32 enable, - OrbisCameraAutoExposureGainTarget* option); -s32 PS4_SYSV_ABI sceCameraSetAutoWhiteBalance(s32 handle, OrbisCameraChannel channel, u32 enable, - void* option); -s32 PS4_SYSV_ABI sceCameraSetCalibData(); -s32 PS4_SYSV_ABI sceCameraSetConfig(s32 handle, OrbisCameraConfig* config); -s32 PS4_SYSV_ABI sceCameraSetConfigInternal(s32 handle, OrbisCameraConfig* config); -s32 PS4_SYSV_ABI sceCameraSetContrast(s32 handle, OrbisCameraChannel channel, u32 contrast, - void* option); -s32 PS4_SYSV_ABI sceCameraSetDebugStop(u32 debug_stop_enable); -s32 PS4_SYSV_ABI sceCameraSetDefectivePixelCancellation(s32 handle, OrbisCameraChannel channel, - u32 enable, void* option); -s32 PS4_SYSV_ABI sceCameraSetDefectivePixelCancellationInternal(s32 handle, - OrbisCameraChannel channel, - u32 enable, void* option); -s32 PS4_SYSV_ABI sceCameraSetExposureGain(s32 handle, OrbisCameraChannel channel, - OrbisCameraExposureGain* exposure_gain, void* option); -s32 PS4_SYSV_ABI sceCameraSetForceActivate(); -s32 PS4_SYSV_ABI sceCameraSetGamma(s32 handle, OrbisCameraChannel channel, OrbisCameraGamma* gamma, - void* option); -s32 PS4_SYSV_ABI sceCameraSetHue(s32 handle, OrbisCameraChannel channel, s32 hue, void* option); -s32 PS4_SYSV_ABI sceCameraSetLensCorrection(s32 handle, OrbisCameraChannel channel, u32 enable, - void* option); -s32 PS4_SYSV_ABI sceCameraSetLensCorrectionInternal(s32 handle, OrbisCameraChannel channel, - u32 enable, void* option); -s32 PS4_SYSV_ABI sceCameraSetProcessFocus(); -s32 PS4_SYSV_ABI sceCameraSetProcessFocusByHandle(); -s32 PS4_SYSV_ABI sceCameraSetRegister(); -s32 PS4_SYSV_ABI sceCameraSetSaturation(s32 handle, OrbisCameraChannel channel, u32 saturation, - void* option); -s32 PS4_SYSV_ABI sceCameraSetSharpness(s32 handle, OrbisCameraChannel channel, u32 sharpness, - void* option); -s32 PS4_SYSV_ABI sceCameraSetTrackerMode(); -s32 PS4_SYSV_ABI sceCameraSetUacModeInternal(); -s32 PS4_SYSV_ABI sceCameraSetVideoSync(s32 handle, OrbisCameraVideoSyncParameter* video_sync); -s32 PS4_SYSV_ABI sceCameraSetVideoSyncInternal(s32 handle, - OrbisCameraVideoSyncParameter* video_sync); -s32 PS4_SYSV_ABI sceCameraSetWhiteBalance(s32 handle, OrbisCameraChannel channel, - OrbisCameraWhiteBalance* white_balance, void* option); -s32 PS4_SYSV_ABI sceCameraStart(s32 handle, OrbisCameraStartParameter* param); -s32 PS4_SYSV_ABI sceCameraStartByHandle(s32 handle, OrbisCameraStartParameter* param); -s32 PS4_SYSV_ABI sceCameraStop(s32 handle); -s32 PS4_SYSV_ABI sceCameraStopByHandle(s32 handle); - -void RegisterLib(Core::Loader::SymbolsResolver* sym); -} // namespace Libraries::Camera \ No newline at end of file diff --git a/src/core/libraries/camera/camera_error.h b/src/core/libraries/camera/camera_error.h deleted file mode 100644 index acb04dd02..000000000 --- a/src/core/libraries/camera/camera_error.h +++ /dev/null @@ -1,29 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -constexpr int ORBIS_CAMERA_ERROR_PARAM = 0x802E0000; -constexpr int ORBIS_CAMERA_ERROR_ALREADY_INIT = 0x802E0001; -constexpr int ORBIS_CAMERA_ERROR_NOT_INIT = 0x802E0002; -constexpr int ORBIS_CAMERA_ERROR_ALREADY_OPEN = 0x802E0003; -constexpr int ORBIS_CAMERA_ERROR_NOT_OPEN = 0x802E0004; -constexpr int ORBIS_CAMERA_ERROR_ALREADY_START = 0x802E0005; -constexpr int ORBIS_CAMERA_ERROR_NOT_START = 0x802E0006; -constexpr int ORBIS_CAMERA_ERROR_FORMAT_UNKNOWN = 0x802E0007; -constexpr int ORBIS_CAMERA_ERROR_RESOLUTION_UNKNOWN = 0x802E0008; -constexpr int ORBIS_CAMERA_ERROR_BAD_FRAMERATE = 0x802E0009; -constexpr int ORBIS_CAMERA_ERROR_TIMEOUT = 0x802E000A; -constexpr int ORBIS_CAMERA_ERROR_ATTRIBUTE_UNKNOWN = 0x802E000B; -constexpr int ORBIS_CAMERA_ERROR_BUSY = 0x802E000C; -constexpr int ORBIS_CAMERA_ERROR_UNKNOWN_CONFIG = 0x802E000D; -constexpr int ORBIS_CAMERA_ERROR_ALREADY_READ = 0x802E000F; -constexpr int ORBIS_CAMERA_ERROR_NOT_CONNECTED = 0x802E0010; -constexpr int ORBIS_CAMERA_ERROR_NOT_SUPPORTED = 0x802E0011; -constexpr int ORBIS_CAMERA_ERROR_INVALID_CONFIG = 0x802E0013; -constexpr int ORBIS_CAMERA_ERROR_MAX_HANDLE = 0x802E0014; -constexpr int ORBIS_CAMERA_ERROR_MAX_PROCESS = 0x802E00FB; -constexpr int ORBIS_CAMERA_ERROR_COPYOUT_FAILED = 0x802E00FC; -constexpr int ORBIS_CAMERA_ERROR_COPYIN_FAILED = 0x802E00FD; -constexpr int ORBIS_CAMERA_ERROR_KPROC_CREATE = 0x802E00FE; -constexpr int ORBIS_CAMERA_ERROR_FATAL = 0x802E00FF; \ No newline at end of file diff --git a/src/core/libraries/companion/companion_error.h b/src/core/libraries/companion/companion_error.h deleted file mode 100644 index 0459c33f8..000000000 --- a/src/core/libraries/companion/companion_error.h +++ /dev/null @@ -1,27 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "common/types.h" - -// companion_httpd error codes -constexpr int ORBIS_COMPANION_HTTPD_ERROR_UNKNOWN = 0x80E40001; -constexpr int ORBIS_COMPANION_HTTPD_ERROR_FATAL = 0x80E40002; -constexpr int ORBIS_COMPANION_HTTPD_ERROR_NOMEM = 0x80E40003; -constexpr int ORBIS_COMPANION_HTTPD_ERROR_INVALID_PARAM = 0x80E40004; -constexpr int ORBIS_COMPANION_HTTPD_ERROR_INVALID_OPERATION = 0x80E40005; -constexpr int ORBIS_COMPANION_HTTPD_ERROR_NOT_INITIALIZED = 0x80E40006; -constexpr int ORBIS_COMPANION_HTTPD_ERROR_ALREADY_INITIALIZED = 0x80E40007; -constexpr int ORBIS_COMPANION_HTTPD_ERROR_NO_EVENT = 0x80E40008; -constexpr int ORBIS_COMPANION_HTTPD_ERROR_NOT_GENERATE_RESPONSE = 0x80E40009; -constexpr int ORBIS_COMPANION_HTTPD_ERROR_ALREADY_STARTED = 0x80E4000A; -constexpr int ORBIS_COMPANION_HTTPD_ERROR_NOT_STARTED = 0x80E4000B; -constexpr int ORBIS_COMPANION_HTTPD_ERROR_ALREADY_REGISTERED = 0x80E4000; -constexpr int ORBIS_COMPANION_HTTPD_ERROR_NOT_CONNECTED = 0x80E4000D; -constexpr int ORBIS_COMPANION_HTTPD_ERROR_USER_NOT_FOUND = 0x80E4000E; - -// companion_util error codes -constexpr u32 ORBIS_COMPANION_UTIL_INVALID_ARGUMENT = 0x80AD0004; -constexpr u32 ORBIS_COMPANION_UTIL_INVALID_POINTER = 0x80AD0006; -constexpr u32 ORBIS_COMPANION_UTIL_NO_EVENT = 0x80AD0008; \ No newline at end of file diff --git a/src/core/libraries/companion/companion_httpd.cpp b/src/core/libraries/companion/companion_httpd.cpp deleted file mode 100644 index 6ffc8c052..000000000 --- a/src/core/libraries/companion/companion_httpd.cpp +++ /dev/null @@ -1,142 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "common/logging/log.h" -#include "companion_error.h" -#include "core/libraries/companion/companion_httpd.h" -#include "core/libraries/error_codes.h" -#include "core/libraries/libs.h" - -namespace Libraries::CompanionHttpd { - -s32 PS4_SYSV_ABI sceCompanionHttpdAddHeader(const char* key, const char* value, - OrbisCompanionHttpdResponse* response) { - LOG_ERROR(Lib_CompanionHttpd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI -sceCompanionHttpdGet2ndScreenStatus(Libraries::UserService::OrbisUserServiceUserId userId) { - LOG_ERROR(Lib_CompanionHttpd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCompanionHttpdGetEvent(OrbisCompanionHttpdEvent* pEvent) { - pEvent->event = ORBIS_COMPANION_HTTPD_EVENT_DISCONNECT; // disconnected - LOG_DEBUG(Lib_CompanionHttpd, "device disconnected"); - return ORBIS_COMPANION_HTTPD_ERROR_NO_EVENT; // No events to obtain -} - -s32 PS4_SYSV_ABI -sceCompanionHttpdGetUserId(u32 addr, Libraries::UserService::OrbisUserServiceUserId* userId) { - LOG_ERROR(Lib_CompanionHttpd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCompanionHttpdInitialize() { - LOG_ERROR(Lib_CompanionHttpd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCompanionHttpdInitialize2() { - LOG_ERROR(Lib_CompanionHttpd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCompanionHttpdOptParamInitialize() { - LOG_ERROR(Lib_CompanionHttpd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCompanionHttpdRegisterRequestBodyReceptionCallback( - OrbisCompanionHttpdRequestBodyReceptionCallback function, void* param) { - LOG_ERROR(Lib_CompanionHttpd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI -sceCompanionHttpdRegisterRequestCallback(OrbisCompanionHttpdRequestCallback function, void* param) { - LOG_ERROR(Lib_CompanionHttpd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCompanionHttpdRegisterRequestCallback2( - OrbisCompanionHttpdRequestCallback function, void* param) { - LOG_ERROR(Lib_CompanionHttpd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCompanionHttpdSetBody(const char* body, u64 bodySize, - OrbisCompanionHttpdResponse* response) { - LOG_ERROR(Lib_CompanionHttpd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCompanionHttpdSetStatus(s32 status, OrbisCompanionHttpdResponse* response) { - LOG_ERROR(Lib_CompanionHttpd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCompanionHttpdStart() { - LOG_ERROR(Lib_CompanionHttpd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCompanionHttpdStop() { - LOG_ERROR(Lib_CompanionHttpd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCompanionHttpdTerminate() { - LOG_ERROR(Lib_CompanionHttpd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCompanionHttpdUnregisterRequestBodyReceptionCallback() { - LOG_ERROR(Lib_CompanionHttpd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCompanionHttpdUnregisterRequestCallback() { - LOG_ERROR(Lib_CompanionHttpd, "(STUBBED) called"); - return ORBIS_OK; -} - -void RegisterLib(Core::Loader::SymbolsResolver* sym) { - LIB_FUNCTION("8pWltDG7h6A", "libSceCompanionHttpd", 1, "libSceCompanionHttpd", - sceCompanionHttpdAddHeader); - LIB_FUNCTION("B-QBMeFdNgY", "libSceCompanionHttpd", 1, "libSceCompanionHttpd", - sceCompanionHttpdGet2ndScreenStatus); - LIB_FUNCTION("Vku4big+IYM", "libSceCompanionHttpd", 1, "libSceCompanionHttpd", - sceCompanionHttpdGetEvent); - LIB_FUNCTION("0SySxcuVNG0", "libSceCompanionHttpd", 1, "libSceCompanionHttpd", - sceCompanionHttpdGetUserId); - LIB_FUNCTION("ykNpWs3ktLY", "libSceCompanionHttpd", 1, "libSceCompanionHttpd", - sceCompanionHttpdInitialize); - LIB_FUNCTION("OA6FbORefbo", "libSceCompanionHttpd", 1, "libSceCompanionHttpd", - sceCompanionHttpdInitialize2); - LIB_FUNCTION("r-2-a0c7Kfc", "libSceCompanionHttpd", 1, "libSceCompanionHttpd", - sceCompanionHttpdOptParamInitialize); - LIB_FUNCTION("fHNmij7kAUM", "libSceCompanionHttpd", 1, "libSceCompanionHttpd", - sceCompanionHttpdRegisterRequestBodyReceptionCallback); - LIB_FUNCTION("OaWw+IVEdbI", "libSceCompanionHttpd", 1, "libSceCompanionHttpd", - sceCompanionHttpdRegisterRequestCallback); - LIB_FUNCTION("-0c9TCTwnGs", "libSceCompanionHttpd", 1, "libSceCompanionHttpd", - sceCompanionHttpdRegisterRequestCallback2); - LIB_FUNCTION("h3OvVxzX4qM", "libSceCompanionHttpd", 1, "libSceCompanionHttpd", - sceCompanionHttpdSetBody); - LIB_FUNCTION("w7oz0AWHpT4", "libSceCompanionHttpd", 1, "libSceCompanionHttpd", - sceCompanionHttpdSetStatus); - LIB_FUNCTION("k7F0FcDM-Xc", "libSceCompanionHttpd", 1, "libSceCompanionHttpd", - sceCompanionHttpdStart); - LIB_FUNCTION("0SCgzfVQHpo", "libSceCompanionHttpd", 1, "libSceCompanionHttpd", - sceCompanionHttpdStop); - LIB_FUNCTION("+-du9tWgE9s", "libSceCompanionHttpd", 1, "libSceCompanionHttpd", - sceCompanionHttpdTerminate); - LIB_FUNCTION("ZSHiUfYK+QI", "libSceCompanionHttpd", 1, "libSceCompanionHttpd", - sceCompanionHttpdUnregisterRequestBodyReceptionCallback); - LIB_FUNCTION("xweOi2QT-BE", "libSceCompanionHttpd", 1, "libSceCompanionHttpd", - sceCompanionHttpdUnregisterRequestCallback); -}; - -} // namespace Libraries::CompanionHttpd \ No newline at end of file diff --git a/src/core/libraries/companion/companion_httpd.h b/src/core/libraries/companion/companion_httpd.h deleted file mode 100644 index bc6807fbc..000000000 --- a/src/core/libraries/companion/companion_httpd.h +++ /dev/null @@ -1,91 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "common/types.h" -#include "core/libraries/network/net.h" -#include "core/libraries/system/userservice.h" - -namespace Core::Loader { -class SymbolsResolver; -} - -namespace Libraries::CompanionHttpd { - -// OrbisCompanionHttpdEvent event codes -constexpr int ORBIS_COMPANION_HTTPD_EVENT_CONNECT = 0x10000001; -constexpr int ORBIS_COMPANION_HTTPD_EVENT_DISCONNECT = 0x10000002; - -struct OrbisCompanionHttpdHeader { - char* key; - char* value; - struct OrbisCompanionHttpdHeader* header; -}; - -struct OrbisCompanionHttpdRequest { - s32 method; - char* url; - OrbisCompanionHttpdHeader* header; - char* body; - u64 bodySize; -}; - -struct OrbisCompanionHttpdResponse { - s32 status; - OrbisCompanionHttpdHeader* header; - char* body; - u64 bodySize; -}; - -using OrbisCompanionHttpdRequestBodyReceptionCallback = - PS4_SYSV_ABI s32 (*)(s32 event, Libraries::UserService::OrbisUserServiceUserId userId, - const OrbisCompanionHttpdRequest* httpRequest, void* param); - -using OrbisCompanionHttpdRequestCallback = - PS4_SYSV_ABI s32 (*)(Libraries::UserService::OrbisUserServiceUserId userId, - const OrbisCompanionHttpdRequest* httpRequest, - OrbisCompanionHttpdResponse* httpResponse, void* param); - -struct OrbisCompanionUtilDeviceInfo { - Libraries::UserService::OrbisUserServiceUserId userId; - Libraries::Net::OrbisNetSockaddrIn addr; - char reserved[236]; -}; - -struct OrbisCompanionHttpdEvent { - s32 event; - union { - OrbisCompanionUtilDeviceInfo deviceInfo; - Libraries::UserService::OrbisUserServiceUserId userId; - char reserved[256]; - } data; -}; - -s32 PS4_SYSV_ABI sceCompanionHttpdAddHeader(const char* key, const char* value, - OrbisCompanionHttpdResponse* response); -s32 PS4_SYSV_ABI -sceCompanionHttpdGet2ndScreenStatus(Libraries::UserService::OrbisUserServiceUserId userId); -s32 PS4_SYSV_ABI sceCompanionHttpdGetEvent(OrbisCompanionHttpdEvent* pEvent); -s32 PS4_SYSV_ABI sceCompanionHttpdGetUserId(u32 addr, - Libraries::UserService::OrbisUserServiceUserId* userId); -s32 PS4_SYSV_ABI sceCompanionHttpdInitialize(); -s32 PS4_SYSV_ABI sceCompanionHttpdInitialize2(); -s32 PS4_SYSV_ABI sceCompanionHttpdOptParamInitialize(); -s32 PS4_SYSV_ABI sceCompanionHttpdRegisterRequestBodyReceptionCallback( - OrbisCompanionHttpdRequestBodyReceptionCallback function, void* param); -s32 PS4_SYSV_ABI -sceCompanionHttpdRegisterRequestCallback(OrbisCompanionHttpdRequestCallback function, void* param); -s32 PS4_SYSV_ABI -sceCompanionHttpdRegisterRequestCallback2(OrbisCompanionHttpdRequestCallback function, void* param); -s32 PS4_SYSV_ABI sceCompanionHttpdSetBody(const char* body, u64 bodySize, - OrbisCompanionHttpdResponse* response); -s32 PS4_SYSV_ABI sceCompanionHttpdSetStatus(s32 status, OrbisCompanionHttpdResponse* response); -s32 PS4_SYSV_ABI sceCompanionHttpdStart(); -s32 PS4_SYSV_ABI sceCompanionHttpdStop(); -s32 PS4_SYSV_ABI sceCompanionHttpdTerminate(); -s32 PS4_SYSV_ABI sceCompanionHttpdUnregisterRequestBodyReceptionCallback(); -s32 PS4_SYSV_ABI sceCompanionHttpdUnregisterRequestCallback(); - -void RegisterLib(Core::Loader::SymbolsResolver* sym); -} // namespace Libraries::CompanionHttpd \ No newline at end of file diff --git a/src/core/libraries/companion/companion_util.cpp b/src/core/libraries/companion/companion_util.cpp deleted file mode 100644 index 2794c49af..000000000 --- a/src/core/libraries/companion/companion_util.cpp +++ /dev/null @@ -1,71 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "common/logging/log.h" -#include "companion_error.h" -#include "core/libraries/companion/companion_util.h" -#include "core/libraries/error_codes.h" -#include "core/libraries/libs.h" - -namespace Libraries::CompanionUtil { - -u32 PS4_SYSV_ABI getEvent(sceCompanionUtilContext* ctx, sceCompanionUtilEvent* outEvent, - s32 param_3) { - if (outEvent == 0) { - return ORBIS_COMPANION_UTIL_INVALID_ARGUMENT; - } - - if (ctx == nullptr) { - return ORBIS_COMPANION_UTIL_INVALID_POINTER; - } - - uint8_t* base = ctx->blob; - int flag = *reinterpret_cast(base + 0x178); - if (flag == 0) { - return ORBIS_COMPANION_UTIL_NO_EVENT; - } - - return ORBIS_COMPANION_UTIL_OK; -} - -s32 PS4_SYSV_ABI sceCompanionUtilGetEvent(sceCompanionUtilEvent* outEvent) { - u32 ret = ORBIS_COMPANION_UTIL_NO_EVENT; - - LOG_DEBUG(Lib_CompanionUtil, "(STUBBED) called ret: {:#x}", ret); - return ret; -} - -s32 PS4_SYSV_ABI sceCompanionUtilGetRemoteOskEvent() { - LOG_ERROR(Lib_CompanionUtil, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCompanionUtilInitialize() { - LOG_ERROR(Lib_CompanionUtil, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCompanionUtilOptParamInitialize() { - LOG_ERROR(Lib_CompanionUtil, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceCompanionUtilTerminate() { - LOG_ERROR(Lib_CompanionUtil, "(STUBBED) called"); - return ORBIS_OK; -} - -void RegisterLib(Core::Loader::SymbolsResolver* sym) { - LIB_FUNCTION("cE5Msy11WhU", "libSceCompanionUtil", 1, "libSceCompanionUtil", - sceCompanionUtilGetEvent); - LIB_FUNCTION("MaVrz79mT5o", "libSceCompanionUtil", 1, "libSceCompanionUtil", - sceCompanionUtilGetRemoteOskEvent); - LIB_FUNCTION("xb1xlIhf0QY", "libSceCompanionUtil", 1, "libSceCompanionUtil", - sceCompanionUtilInitialize); - LIB_FUNCTION("IPN-FRSrafk", "libSceCompanionUtil", 1, "libSceCompanionUtil", - sceCompanionUtilOptParamInitialize); - LIB_FUNCTION("H1fYQd5lFAI", "libSceCompanionUtil", 1, "libSceCompanionUtil", - sceCompanionUtilTerminate); -}; - -} // namespace Libraries::CompanionUtil \ No newline at end of file diff --git a/src/core/libraries/companion/companion_util.h b/src/core/libraries/companion/companion_util.h deleted file mode 100644 index e44b095ee..000000000 --- a/src/core/libraries/companion/companion_util.h +++ /dev/null @@ -1,33 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "common/types.h" - -namespace Core::Loader { -class SymbolsResolver; -} - -namespace Libraries::CompanionUtil { - -constexpr u32 ORBIS_COMPANION_UTIL_OK = 0; - -struct sceCompanionUtilEvent { - std::uint8_t blob[0x104]{}; /// 0x104 bytes of data, dont know what it is exactly -}; - -struct sceCompanionUtilContext { - std::uint8_t blob[0x27B]{}; /// 0x27B bytes of data, dont know what it is exactly -}; - -u32 PS4_SYSV_ABI getEvent(sceCompanionUtilContext* ctx, sceCompanionUtilEvent* outEvent, - s32 param_3); -s32 PS4_SYSV_ABI sceCompanionUtilGetEvent(sceCompanionUtilEvent* outEvent); -s32 PS4_SYSV_ABI sceCompanionUtilGetRemoteOskEvent(); -s32 PS4_SYSV_ABI sceCompanionUtilInitialize(); -s32 PS4_SYSV_ABI sceCompanionUtilOptParamInitialize(); -s32 PS4_SYSV_ABI sceCompanionUtilTerminate(); - -void RegisterLib(Core::Loader::SymbolsResolver* sym); -} // namespace Libraries::CompanionUtil \ No newline at end of file diff --git a/src/core/libraries/disc_map/disc_map.cpp b/src/core/libraries/disc_map/disc_map.cpp deleted file mode 100644 index 27295fda2..000000000 --- a/src/core/libraries/disc_map/disc_map.cpp +++ /dev/null @@ -1,45 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "common/logging/log.h" -#include "core/libraries/error_codes.h" -#include "core/libraries/libs.h" -#include "disc_map.h" -#include "disc_map_codes.h" - -namespace Libraries::DiscMap { - -int PS4_SYSV_ABI sceDiscMapGetPackageSize(s64 fflags, int* ret1, int* ret2) { - return ORBIS_DISC_MAP_ERROR_NO_BITMAP_INFO; -} - -int PS4_SYSV_ABI sceDiscMapIsRequestOnHDD(char* path, s64 offset, s64 nbytes, int* ret) { - return ORBIS_DISC_MAP_ERROR_NO_BITMAP_INFO; -} - -int PS4_SYSV_ABI Func_7C980FFB0AA27E7A(char* path, s64 offset, s64 nbytes, int* flags, int* ret1, - int* ret2) { - *flags = 0; - *ret1 = 0; - *ret2 = 0; - return ORBIS_OK; -} - -int PS4_SYSV_ABI Func_8A828CAEE7EDD5E9(char* path, s64 offset, s64 nbytes, int* flags, int* ret1, - int* ret2) { - return ORBIS_DISC_MAP_ERROR_NO_BITMAP_INFO; -} - -int PS4_SYSV_ABI Func_E7EBCE96E92F91F8() { - return ORBIS_DISC_MAP_ERROR_NO_BITMAP_INFO; -} - -void RegisterLib(Core::Loader::SymbolsResolver* sym) { - LIB_FUNCTION("fl1eoDnwQ4s", "libSceDiscMap", 1, "libSceDiscMap", sceDiscMapGetPackageSize); - LIB_FUNCTION("lbQKqsERhtE", "libSceDiscMap", 1, "libSceDiscMap", sceDiscMapIsRequestOnHDD); - LIB_FUNCTION("fJgP+wqifno", "libSceDiscMap", 1, "libSceDiscMap", Func_7C980FFB0AA27E7A); - LIB_FUNCTION("ioKMruft1ek", "libSceDiscMap", 1, "libSceDiscMap", Func_8A828CAEE7EDD5E9); - LIB_FUNCTION("5+vOlukvkfg", "libSceDiscMap", 1, "libSceDiscMap", Func_E7EBCE96E92F91F8); -}; - -} // namespace Libraries::DiscMap diff --git a/src/core/libraries/disc_map/disc_map.h b/src/core/libraries/disc_map/disc_map.h deleted file mode 100644 index df6c25aa0..000000000 --- a/src/core/libraries/disc_map/disc_map.h +++ /dev/null @@ -1,22 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "common/types.h" - -namespace Core::Loader { -class SymbolsResolver; -} -namespace Libraries::DiscMap { - -int PS4_SYSV_ABI sceDiscMapGetPackageSize(s64 fflags, int* ret1, int* ret2); -int PS4_SYSV_ABI sceDiscMapIsRequestOnHDD(char* path, s64 offset, s64 nbytes, int* ret); -int PS4_SYSV_ABI Func_7C980FFB0AA27E7A(char* path, s64 offset, s64 nbytes, int* flags, int* ret1, - int* ret2); -int PS4_SYSV_ABI Func_8A828CAEE7EDD5E9(char* path, s64 offset, s64 nbytes, int* flags, int* ret1, - int* ret2); -int PS4_SYSV_ABI Func_E7EBCE96E92F91F8(); - -void RegisterLib(Core::Loader::SymbolsResolver* sym); -} // namespace Libraries::DiscMap \ No newline at end of file diff --git a/src/core/libraries/disc_map/disc_map_codes.h b/src/core/libraries/disc_map/disc_map_codes.h deleted file mode 100644 index 841f0a9aa..000000000 --- a/src/core/libraries/disc_map/disc_map_codes.h +++ /dev/null @@ -1,10 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -constexpr int ORBIS_DISC_MAP_ERROR_INVALID_ARGUMENT = 0x81100001; -constexpr int ORBIS_DISC_MAP_ERROR_LOCATION_NOT_MAPPED = 0x81100002; -constexpr int ORBIS_DISC_MAP_ERROR_FILE_NOT_FOUND = 0x81100003; -constexpr int ORBIS_DISC_MAP_ERROR_NO_BITMAP_INFO = 0x81100004; -constexpr int ORBIS_DISC_MAP_ERROR_FATAL = 0x811000FF; diff --git a/src/core/libraries/error_codes.h b/src/core/libraries/error_codes.h index e1902b61c..423333a6a 100644 --- a/src/core/libraries/error_codes.h +++ b/src/core/libraries/error_codes.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/fiber/fiber.cpp b/src/core/libraries/fiber/fiber.cpp deleted file mode 100644 index 2ebfbd244..000000000 --- a/src/core/libraries/fiber/fiber.cpp +++ /dev/null @@ -1,574 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "fiber.h" - -#include "common/elf_info.h" -#include "common/logging/log.h" -#include "core/libraries/fiber/fiber_error.h" -#include "core/libraries/libs.h" -#include "core/tls.h" - -namespace Libraries::Fiber { - -static constexpr u32 kFiberSignature0 = 0xdef1649c; -static constexpr u32 kFiberSignature1 = 0xb37592a0; -static constexpr u32 kFiberOptSignature = 0xbb40e64d; -static constexpr u64 kFiberStackSignature = 0x7149f2ca7149f2ca; -static constexpr u64 kFiberStackSizeCheck = 0xdeadbeefdeadbeef; - -static std::atomic context_size_check = false; - -OrbisFiberContext* GetFiberContext() { - return Core::GetTcbBase()->tcb_fiber; -} - -extern "C" s32 PS4_SYSV_ABI _sceFiberSetJmp(OrbisFiberContext* ctx) asm("_sceFiberSetJmp"); -extern "C" s32 PS4_SYSV_ABI _sceFiberLongJmp(OrbisFiberContext* ctx) asm("_sceFiberLongJmp"); -extern "C" void PS4_SYSV_ABI _sceFiberSwitchEntry(OrbisFiberData* data, - bool set_fpu) asm("_sceFiberSwitchEntry"); -extern "C" void PS4_SYSV_ABI _sceFiberForceQuit(u64 ret) asm("_sceFiberForceQuit"); - -extern "C" void PS4_SYSV_ABI _sceFiberForceQuit(u64 ret) { - OrbisFiberContext* g_ctx = GetFiberContext(); - g_ctx->return_val = ret; - _sceFiberLongJmp(g_ctx); -} - -void PS4_SYSV_ABI _sceFiberCheckStackOverflow(OrbisFiberContext* ctx) { - u64* stack_base = reinterpret_cast(ctx->current_fiber->addr_context); - u64 stack_size = ctx->current_fiber->size_context; - if (stack_base && *stack_base != kFiberStackSignature) { - UNREACHABLE_MSG("Stack overflow detected in fiber with size = 0x{:x}", stack_size); - } -} - -s32 PS4_SYSV_ABI _sceFiberAttachContext(OrbisFiber* fiber, void* addr_context, u64 size_context) { - if (size_context && size_context < ORBIS_FIBER_CONTEXT_MINIMUM_SIZE) { - return ORBIS_FIBER_ERROR_RANGE; - } - if (size_context & 15) { - return ORBIS_FIBER_ERROR_INVALID; - } - if (!addr_context || !size_context) { - return ORBIS_FIBER_ERROR_INVALID; - } - if (fiber->addr_context) { - return ORBIS_FIBER_ERROR_INVALID; - } - - fiber->addr_context = addr_context; - fiber->size_context = size_context; - fiber->context_start = addr_context; - fiber->context_end = reinterpret_cast(addr_context) + size_context; - - /* Apply signature to start of stack */ - *(u64*)addr_context = kFiberStackSignature; - - if (fiber->flags & FiberFlags::ContextSizeCheck) { - u64* stack_start = reinterpret_cast(fiber->context_start); - u64* stack_end = reinterpret_cast(fiber->context_end); - - u64* stack_ptr = stack_start + 1; - while (stack_ptr < stack_end) { - *stack_ptr++ = kFiberStackSizeCheck; - } - } - - return ORBIS_OK; -} - -void PS4_SYSV_ABI _sceFiberSwitchToFiber(OrbisFiber* fiber, u64 arg_on_run_to, - OrbisFiberContext* ctx) { - OrbisFiberContext* fiber_ctx = fiber->context; - if (fiber_ctx) { - ctx->arg_on_run_to = arg_on_run_to; - _sceFiberLongJmp(fiber_ctx); - __builtin_trap(); - } - - OrbisFiberData data{}; - if (ctx->prev_fiber) { - OrbisFiber* prev_fiber = ctx->prev_fiber; - ctx->prev_fiber = nullptr; - data.state = reinterpret_cast(&prev_fiber->state); - } else { - data.state = nullptr; - } - - data.entry = fiber->entry; - data.arg_on_initialize = fiber->arg_on_initialize; - data.arg_on_run_to = arg_on_run_to; - data.stack_addr = reinterpret_cast(fiber->addr_context) + fiber->size_context; - if (fiber->flags & FiberFlags::SetFpuRegs) { - data.fpucw = 0x037f; - data.mxcsr = 0x9fc0; - _sceFiberSwitchEntry(&data, true); - } else { - _sceFiberSwitchEntry(&data, false); - } - - __builtin_trap(); -} - -void PS4_SYSV_ABI _sceFiberSwitch(OrbisFiber* cur_fiber, OrbisFiber* fiber, u64 arg_on_run_to, - OrbisFiberContext* ctx) { - ctx->prev_fiber = cur_fiber; - ctx->current_fiber = fiber; - - if (fiber->addr_context == nullptr) { - ctx->prev_fiber = nullptr; - - OrbisFiberData data{}; - data.entry = fiber->entry; - data.arg_on_initialize = fiber->arg_on_initialize; - data.arg_on_run_to = arg_on_run_to; - data.stack_addr = reinterpret_cast(ctx->rsp & ~15); - data.state = reinterpret_cast(&cur_fiber->state); - - if (fiber->flags & FiberFlags::SetFpuRegs) { - data.fpucw = 0x037f; - data.mxcsr = 0x9fc0; - _sceFiberSwitchEntry(&data, true); - } else { - _sceFiberSwitchEntry(&data, false); - } - - __builtin_trap(); - } - - _sceFiberSwitchToFiber(fiber, arg_on_run_to, ctx); - __builtin_trap(); -} - -void PS4_SYSV_ABI _sceFiberTerminate(OrbisFiber* fiber, u64 arg_on_return, OrbisFiberContext* ctx) { - ctx->arg_on_return = arg_on_return; - _sceFiberLongJmp(ctx); - __builtin_trap(); -} - -s32 PS4_SYSV_ABI sceFiberInitializeImpl(OrbisFiber* fiber, const char* name, OrbisFiberEntry entry, - u64 arg_on_initialize, void* addr_context, u64 size_context, - const OrbisFiberOptParam* opt_param, u32 flags, - u32 build_ver) { - if (!fiber || !name || !entry) { - return ORBIS_FIBER_ERROR_NULL; - } - if ((u64)fiber & 7 || (u64)addr_context & 15) { - return ORBIS_FIBER_ERROR_ALIGNMENT; - } - if (opt_param && (u64)opt_param & 7) { - return ORBIS_FIBER_ERROR_ALIGNMENT; - } - if (size_context && size_context < ORBIS_FIBER_CONTEXT_MINIMUM_SIZE) { - return ORBIS_FIBER_ERROR_RANGE; - } - if (size_context & 15) { - return ORBIS_FIBER_ERROR_INVALID; - } - if (!addr_context && size_context) { - return ORBIS_FIBER_ERROR_INVALID; - } - if (addr_context && !size_context) { - return ORBIS_FIBER_ERROR_INVALID; - } - if (opt_param && opt_param->magic != kFiberOptSignature) { - return ORBIS_FIBER_ERROR_INVALID; - } - - u32 user_flags = flags; - if (build_ver >= Common::ElfInfo::FW_35) { - user_flags |= FiberFlags::SetFpuRegs; - } - if (context_size_check) { - user_flags |= FiberFlags::ContextSizeCheck; - } - - strncpy(fiber->name, name, ORBIS_FIBER_MAX_NAME_LENGTH); - - fiber->entry = entry; - fiber->arg_on_initialize = arg_on_initialize; - fiber->addr_context = addr_context; - fiber->size_context = size_context; - fiber->context = nullptr; - fiber->flags = user_flags; - - /* - A low stack area is problematic, as we can easily - cause a stack overflow with our HLE. - */ - if (size_context && size_context <= 4096) { - LOG_WARNING(Lib_Fiber, "Fiber initialized with small stack area."); - } - - fiber->magic_start = kFiberSignature0; - fiber->magic_end = kFiberSignature1; - - if (addr_context != nullptr) { - fiber->context_start = addr_context; - fiber->context_end = reinterpret_cast(addr_context) + size_context; - - /* Apply signature to start of stack */ - *(u64*)addr_context = kFiberStackSignature; - - if (flags & FiberFlags::ContextSizeCheck) { - u64* stack_start = reinterpret_cast(fiber->context_start); - u64* stack_end = reinterpret_cast(fiber->context_end); - - u64* stack_ptr = stack_start + 1; - while (stack_ptr < stack_end) { - *stack_ptr++ = kFiberStackSizeCheck; - } - } - } - - fiber->state = FiberState::Idle; - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFiberOptParamInitialize(OrbisFiberOptParam* opt_param) { - if (!opt_param) { - return ORBIS_FIBER_ERROR_NULL; - } - if ((u64)opt_param & 7) { - return ORBIS_FIBER_ERROR_ALIGNMENT; - } - - opt_param->magic = kFiberOptSignature; - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFiberFinalize(OrbisFiber* fiber) { - if (!fiber) { - return ORBIS_FIBER_ERROR_NULL; - } - if ((u64)fiber & 7) { - return ORBIS_FIBER_ERROR_ALIGNMENT; - } - if (fiber->magic_start != kFiberSignature0 || fiber->magic_end != kFiberSignature1) { - return ORBIS_FIBER_ERROR_INVALID; - } - - FiberState expected = FiberState::Idle; - if (!fiber->state.compare_exchange_strong(expected, FiberState::Terminated)) { - return ORBIS_FIBER_ERROR_STATE; - } - - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFiberRunImpl(OrbisFiber* fiber, void* addr_context, u64 size_context, - u64 arg_on_run_to, u64* arg_on_return) { - if (!fiber) { - return ORBIS_FIBER_ERROR_NULL; - } - if ((u64)fiber & 7 || (u64)addr_context & 15) { - return ORBIS_FIBER_ERROR_ALIGNMENT; - } - if (fiber->magic_start != kFiberSignature0 || fiber->magic_end != kFiberSignature1) { - return ORBIS_FIBER_ERROR_INVALID; - } - - Core::Tcb* tcb = Core::GetTcbBase(); - if (tcb->tcb_fiber) { - return ORBIS_FIBER_ERROR_PERMISSION; - } - - /* Caller wants to attach context and run. */ - if (addr_context != nullptr || size_context != 0) { - s32 res = _sceFiberAttachContext(fiber, addr_context, size_context); - if (res < 0) { - return res; - } - } - - FiberState expected = FiberState::Idle; - if (!fiber->state.compare_exchange_strong(expected, FiberState::Run)) { - return ORBIS_FIBER_ERROR_STATE; - } - - OrbisFiberContext ctx{}; - ctx.current_fiber = fiber; - ctx.prev_fiber = nullptr; - ctx.return_val = 0; - - tcb->tcb_fiber = &ctx; - - s32 jmp = _sceFiberSetJmp(&ctx); - if (!jmp) { - if (fiber->addr_context) { - _sceFiberSwitchToFiber(fiber, arg_on_run_to, &ctx); - __builtin_trap(); - } - - OrbisFiberData data{}; - data.entry = fiber->entry; - data.arg_on_initialize = fiber->arg_on_initialize; - data.arg_on_run_to = arg_on_run_to; - data.stack_addr = reinterpret_cast(ctx.rsp & ~15); - data.state = nullptr; - if (fiber->flags & FiberFlags::SetFpuRegs) { - data.fpucw = 0x037f; - data.mxcsr = 0x9fc0; - _sceFiberSwitchEntry(&data, true); - } else { - _sceFiberSwitchEntry(&data, false); - } - } - - OrbisFiber* cur_fiber = ctx.current_fiber; - ctx.current_fiber = nullptr; - cur_fiber->state = FiberState::Idle; - - if (ctx.return_val != 0) { - /* Fiber entry returned! This should never happen. */ - UNREACHABLE_MSG("Fiber entry function returned."); - } - - if (arg_on_return) { - *arg_on_return = ctx.arg_on_return; - } - - tcb->tcb_fiber = nullptr; - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFiberSwitchImpl(OrbisFiber* fiber, void* addr_context, u64 size_context, - u64 arg_on_run_to, u64* arg_on_run) { - if (!fiber) { - return ORBIS_FIBER_ERROR_NULL; - } - if ((u64)fiber & 7 || (u64)addr_context & 15) { - return ORBIS_FIBER_ERROR_ALIGNMENT; - } - if (fiber->magic_start != kFiberSignature0 || fiber->magic_end != kFiberSignature1) { - return ORBIS_FIBER_ERROR_INVALID; - } - - OrbisFiberContext* g_ctx = GetFiberContext(); - if (!g_ctx) { - return ORBIS_FIBER_ERROR_PERMISSION; - } - - /* Caller wants to attach context and switch. */ - if (addr_context != nullptr || size_context != 0) { - s32 res = _sceFiberAttachContext(fiber, addr_context, size_context); - if (res < 0) { - return res; - } - } - - FiberState expected = FiberState::Idle; - if (!fiber->state.compare_exchange_strong(expected, FiberState::Run)) { - return ORBIS_FIBER_ERROR_STATE; - } - - OrbisFiber* cur_fiber = g_ctx->current_fiber; - if (cur_fiber->addr_context == nullptr) { - _sceFiberSwitch(cur_fiber, fiber, arg_on_run_to, g_ctx); - __builtin_trap(); - } - - OrbisFiberContext ctx{}; - s32 jmp = _sceFiberSetJmp(&ctx); - if (!jmp) { - cur_fiber->context = &ctx; - _sceFiberCheckStackOverflow(g_ctx); - _sceFiberSwitch(cur_fiber, fiber, arg_on_run_to, g_ctx); - __builtin_trap(); - } - - g_ctx = GetFiberContext(); - if (g_ctx->prev_fiber) { - g_ctx->prev_fiber->state = FiberState::Idle; - g_ctx->prev_fiber = nullptr; - } - - if (arg_on_run) { - *arg_on_run = g_ctx->arg_on_run_to; - } - - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFiberGetSelf(OrbisFiber** fiber) { - if (!fiber) { - return ORBIS_FIBER_ERROR_NULL; - } - - OrbisFiberContext* g_ctx = GetFiberContext(); - if (!g_ctx) { - return ORBIS_FIBER_ERROR_PERMISSION; - } - - *fiber = g_ctx->current_fiber; - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFiberReturnToThread(u64 arg_on_return, u64* arg_on_run) { - OrbisFiberContext* g_ctx = GetFiberContext(); - if (!g_ctx) { - return ORBIS_FIBER_ERROR_PERMISSION; - } - - OrbisFiber* cur_fiber = g_ctx->current_fiber; - if (cur_fiber->addr_context) { - OrbisFiberContext ctx{}; - s32 jmp = _sceFiberSetJmp(&ctx); - if (jmp) { - g_ctx = GetFiberContext(); - if (g_ctx->prev_fiber) { - g_ctx->prev_fiber->state = FiberState::Idle; - g_ctx->prev_fiber = nullptr; - } - if (arg_on_run) { - *arg_on_run = g_ctx->arg_on_run_to; - } - return ORBIS_OK; - } - - cur_fiber->context = &ctx; - _sceFiberCheckStackOverflow(g_ctx); - } - - _sceFiberTerminate(cur_fiber, arg_on_return, g_ctx); - __builtin_trap(); -} - -s32 PS4_SYSV_ABI sceFiberGetInfo(OrbisFiber* fiber, OrbisFiberInfo* fiber_info) { - if (!fiber || !fiber_info) { - return ORBIS_FIBER_ERROR_NULL; - } - if ((u64)fiber & 7 || (u64)fiber_info & 7) { - return ORBIS_FIBER_ERROR_ALIGNMENT; - } - if (fiber_info->size != sizeof(OrbisFiberInfo)) { - return ORBIS_FIBER_ERROR_INVALID; - } - if (fiber->magic_start != kFiberSignature0 || fiber->magic_end != kFiberSignature1) { - return ORBIS_FIBER_ERROR_INVALID; - } - - fiber_info->entry = fiber->entry; - fiber_info->arg_on_initialize = fiber->arg_on_initialize; - fiber_info->addr_context = fiber->addr_context; - fiber_info->size_context = fiber->size_context; - strncpy(fiber_info->name, fiber->name, ORBIS_FIBER_MAX_NAME_LENGTH); - - fiber_info->size_context_margin = -1; - if (fiber->flags & FiberFlags::ContextSizeCheck && fiber->addr_context != nullptr) { - u64 stack_margin = 0; - u64* stack_start = reinterpret_cast(fiber->context_start); - u64* stack_end = reinterpret_cast(fiber->context_end); - - if (*stack_start == kFiberStackSignature) { - u64* stack_ptr = stack_start + 1; - while (stack_ptr < stack_end) { - if (*stack_ptr == kFiberStackSizeCheck) { - stack_ptr++; - } - } - - stack_margin = - reinterpret_cast(stack_ptr) - reinterpret_cast(stack_start + 1); - } - - fiber_info->size_context_margin = stack_margin; - } - - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFiberStartContextSizeCheck(u32 flags) { - if (flags != 0) { - return ORBIS_FIBER_ERROR_INVALID; - } - - u32 expected = 0; - if (!context_size_check.compare_exchange_strong(expected, 1u)) { - return ORBIS_FIBER_ERROR_STATE; - } - - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFiberStopContextSizeCheck() { - u32 expected = 1; - if (!context_size_check.compare_exchange_strong(expected, 0u)) { - return ORBIS_FIBER_ERROR_STATE; - } - - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFiberRename(OrbisFiber* fiber, const char* name) { - if (!fiber || !name) { - return ORBIS_FIBER_ERROR_NULL; - } - if ((u64)fiber & 7) { - return ORBIS_FIBER_ERROR_ALIGNMENT; - } - if (fiber->magic_start != kFiberSignature0 || fiber->magic_end != kFiberSignature1) { - return ORBIS_FIBER_ERROR_INVALID; - } - - strncpy(fiber->name, name, ORBIS_FIBER_MAX_NAME_LENGTH); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFiberGetThreadFramePointerAddress(u64* addr_frame_pointer) { - if (!addr_frame_pointer) { - return ORBIS_FIBER_ERROR_NULL; - } - - OrbisFiberContext* g_ctx = GetFiberContext(); - if (!g_ctx) { - return ORBIS_FIBER_ERROR_PERMISSION; - } - - *addr_frame_pointer = g_ctx->rbp; - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFiberInitialize(OrbisFiber* fiber, const char* name, OrbisFiberEntry entry, - u64 arg_on_initialize, void* addr_context, u64 size_context, - const OrbisFiberOptParam* opt_param, u32 build_ver) { - return sceFiberInitializeImpl(fiber, name, entry, arg_on_initialize, addr_context, size_context, - opt_param, 0, build_ver); -} - -s32 PS4_SYSV_ABI sceFiberRun(OrbisFiber* fiber, u64 arg_on_run_to, u64* arg_on_return) { - return sceFiberRunImpl(fiber, nullptr, 0, arg_on_run_to, arg_on_return); -} - -s32 PS4_SYSV_ABI sceFiberSwitch(OrbisFiber* fiber, u64 arg_on_run_to, u64* arg_on_run) { - return sceFiberSwitchImpl(fiber, nullptr, 0, arg_on_run_to, arg_on_run); -} - -void RegisterLib(Core::Loader::SymbolsResolver* sym) { - LIB_FUNCTION("hVYD7Ou2pCQ", "libSceFiber", 1, "libSceFiber", sceFiberInitialize); - LIB_FUNCTION("7+OJIpko9RY", "libSceFiber", 1, "libSceFiber", - sceFiberInitializeImpl); // _sceFiberInitializeWithInternalOptionImpl - LIB_FUNCTION("asjUJJ+aa8s", "libSceFiber", 1, "libSceFiber", sceFiberOptParamInitialize); - LIB_FUNCTION("JeNX5F-NzQU", "libSceFiber", 1, "libSceFiber", sceFiberFinalize); - - LIB_FUNCTION("a0LLrZWac0M", "libSceFiber", 1, "libSceFiber", sceFiberRun); - LIB_FUNCTION("PFT2S-tJ7Uk", "libSceFiber", 1, "libSceFiber", sceFiberSwitch); - LIB_FUNCTION("p+zLIOg27zU", "libSceFiber", 1, "libSceFiber", sceFiberGetSelf); - LIB_FUNCTION("B0ZX2hx9DMw", "libSceFiber", 1, "libSceFiber", sceFiberReturnToThread); - - LIB_FUNCTION("avfGJ94g36Q", "libSceFiber", 1, "libSceFiber", - sceFiberRunImpl); // _sceFiberAttachContextAndRun - LIB_FUNCTION("ZqhZFuzKT6U", "libSceFiber", 1, "libSceFiber", - sceFiberSwitchImpl); // _sceFiberAttachContextAndSwitch - - LIB_FUNCTION("uq2Y5BFz0PE", "libSceFiber", 1, "libSceFiber", sceFiberGetInfo); - LIB_FUNCTION("Lcqty+QNWFc", "libSceFiber", 1, "libSceFiber", sceFiberStartContextSizeCheck); - LIB_FUNCTION("Kj4nXMpnM8Y", "libSceFiber", 1, "libSceFiber", sceFiberStopContextSizeCheck); - LIB_FUNCTION("JzyT91ucGDc", "libSceFiber", 1, "libSceFiber", sceFiberRename); - - LIB_FUNCTION("0dy4JtMUcMQ", "libSceFiber", 1, "libSceFiber", - sceFiberGetThreadFramePointerAddress); -} - -} // namespace Libraries::Fiber diff --git a/src/core/libraries/fiber/fiber.h b/src/core/libraries/fiber/fiber.h deleted file mode 100644 index f52a751b1..000000000 --- a/src/core/libraries/fiber/fiber.h +++ /dev/null @@ -1,120 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "common/assert.h" -#include "common/types.h" - -#include - -namespace Core::Loader { -class SymbolsResolver; -} -namespace Libraries::Fiber { - -#define ORBIS_FIBER_MAX_NAME_LENGTH (31) -#define ORBIS_FIBER_CONTEXT_MINIMUM_SIZE (512) - -typedef void PS4_SYSV_ABI (*OrbisFiberEntry)(u64 arg_on_initialize, u64 arg_on_run); - -enum FiberState : u32 { - Run = 1u, - Idle = 2u, - Terminated = 3u, -}; - -enum FiberFlags : u32 { - None = 0x0, - NoUlobjmgr = 0x1, - ContextSizeCheck = 0x10, - SetFpuRegs = 0x100, -}; - -struct OrbisFiber; - -struct OrbisFiberContext { - struct { - u64 rax, rcx, rdx, rbx, rsp, rbp, r8, r9, r10, r11, r12, r13, r14, r15; - u16 fpucw; - u32 mxcsr; - }; - OrbisFiber* current_fiber; - OrbisFiber* prev_fiber; - u64 arg_on_run_to; - u64 arg_on_return; - u64 return_val; -}; - -struct OrbisFiberData { - OrbisFiberEntry entry; - u64 arg_on_initialize; - u64 arg_on_run_to; - void* stack_addr; - u32* state; - u16 fpucw; - s8 pad[2]; - u32 mxcsr; -}; - -struct OrbisFiber { - u32 magic_start; - std::atomic state; - OrbisFiberEntry entry; - u64 arg_on_initialize; - void* addr_context; - u64 size_context; - char name[ORBIS_FIBER_MAX_NAME_LENGTH + 1]; - OrbisFiberContext* context; - u32 flags; - void* context_start; - void* context_end; - u32 magic_end; -}; -static_assert(sizeof(OrbisFiber) <= 256); - -struct OrbisFiberInfo { - u64 size; - OrbisFiberEntry entry; - u64 arg_on_initialize; - void* addr_context; - u64 size_context; - char name[ORBIS_FIBER_MAX_NAME_LENGTH + 1]; - u64 size_context_margin; - u8 pad[48]; -}; -static_assert(sizeof(OrbisFiberInfo) == 128); - -struct OrbisFiberOptParam { - u32 magic; -}; -static_assert(sizeof(OrbisFiberOptParam) <= 128); - -s32 PS4_SYSV_ABI sceFiberInitialize(OrbisFiber* fiber, const char* name, OrbisFiberEntry entry, - u64 arg_on_initialize, void* addr_context, u64 size_context, - const OrbisFiberOptParam* opt_param, u32 build_version); - -s32 PS4_SYSV_ABI sceFiberOptParamInitialize(OrbisFiberOptParam* opt_param); - -s32 PS4_SYSV_ABI sceFiberFinalize(OrbisFiber* fiber); - -s32 PS4_SYSV_ABI sceFiberRun(OrbisFiber* fiber, u64 arg_on_run_to, u64* arg_on_return); - -s32 PS4_SYSV_ABI sceFiberSwitch(OrbisFiber* fiber, u64 arg_on_run_to, u64* arg_on_run); - -s32 PS4_SYSV_ABI sceFiberGetSelf(OrbisFiber** fiber); - -s32 PS4_SYSV_ABI sceFiberReturnToThread(u64 arg_on_return, u64* arg_on_run); - -s32 PS4_SYSV_ABI sceFiberGetInfo(OrbisFiber* fiber, OrbisFiberInfo* fiber_info); - -s32 PS4_SYSV_ABI sceFiberStartContextSizeCheck(u32 flags); - -s32 PS4_SYSV_ABI sceFiberStopContextSizeCheck(void); - -s32 PS4_SYSV_ABI sceFiberRename(OrbisFiber* fiber, const char* name); - -s32 PS4_SYSV_ABI sceFiberGetThreadFramePointerAddress(u64* addr_frame_pointer); - -void RegisterLib(Core::Loader::SymbolsResolver* sym); -} // namespace Libraries::Fiber \ No newline at end of file diff --git a/src/core/libraries/fiber/fiber_context.s b/src/core/libraries/fiber/fiber_context.s deleted file mode 100644 index 4c8f20f71..000000000 --- a/src/core/libraries/fiber/fiber_context.s +++ /dev/null @@ -1,121 +0,0 @@ -# SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -# SPDX-License-Identifier: GPL-2.0-or-later - -.global _sceFiberSetJmp -_sceFiberSetJmp: - movq %rax, 0x0(%rdi) - - movq (%rsp), %rdx - movq %rdx, 0x10(%rdi) - - movq %rcx, 0x08(%rdi) - movq %rbx, 0x18(%rdi) - movq %rsp, 0x20(%rdi) - movq %rbp, 0x28(%rdi) - - movq %r8, 0x30(%rdi) - movq %r9, 0x38(%rdi) - movq %r10, 0x40(%rdi) - movq %r11, 0x48(%rdi) - movq %r12, 0x50(%rdi) - movq %r13, 0x58(%rdi) - movq %r14, 0x60(%rdi) - movq %r15, 0x68(%rdi) - - fnstcw 0x70(%rdi) - stmxcsr 0x72(%rdi) - - xor %eax, %eax - ret - -.global _sceFiberLongJmp -_sceFiberLongJmp: - # MXCSR = (MXCSR & 0x3f) ^ (ctx->mxcsr & ~0x3f) - stmxcsr -0x4(%rsp) - movl 0x72(%rdi), %eax - andl $0xffffffc0, %eax - movl -0x4(%rsp), %ecx - andl $0x3f, %ecx - xorl %eax, %ecx - movl %ecx, -0x4(%rsp) - ldmxcsr -0x4(%rsp) - - movq 0x00(%rdi), %rax - movq 0x08(%rdi), %rcx - movq 0x10(%rdi), %rdx - movq 0x18(%rdi), %rbx - movq 0x20(%rdi), %rsp - movq 0x28(%rdi), %rbp - - movq 0x30(%rdi), %r8 - movq 0x38(%rdi), %r9 - movq 0x40(%rdi), %r10 - movq 0x48(%rdi), %r11 - movq 0x50(%rdi), %r12 - movq 0x58(%rdi), %r13 - movq 0x60(%rdi), %r14 - movq 0x68(%rdi), %r15 - - fldcw 0x70(%rdi) - - # Make the jump and return 1 - movq %rdx, 0x00(%rsp) - movl $0x1, %eax - ret - -.global _sceFiberSwitchEntry -_sceFiberSwitchEntry: - mov %rdi, %r11 - - # Set stack address to provided stack - movq 0x18(%r11), %rsp - xorl %ebp, %ebp - - movq 0x20(%r11), %r10 # data->state - - # Set previous fiber state to Idle - test %r10, %r10 - jz .clear_regs - movl $2, (%r10) - -.clear_regs: - test %esi, %esi - jz .skip_fpu_regs - - ldmxcsr 0x2c(%r11) - fldcw 0x28(%r11) - -.skip_fpu_regs: - movq 0x08(%r11), %rdi # data->arg_on_initialize - movq 0x10(%r11), %rsi # data->arg_on_run_to - movq 0x00(%r11), %r11 # data->entry - - xorl %eax, %eax - xorl %ebx, %ebx - xorl %ecx, %ecx - xorl %edx, %edx - xorq %r8, %r8 - xorq %r9, %r9 - xorq %r10, %r10 - xorq %r12, %r12 - xorq %r13, %r13 - xorq %r14, %r14 - xorq %r15, %r15 - pxor %mm0, %mm0 - pxor %mm1, %mm1 - pxor %mm2, %mm2 - pxor %mm3, %mm3 - pxor %mm4, %mm4 - pxor %mm5, %mm5 - pxor %mm6, %mm6 - pxor %mm7, %mm7 - emms - vzeroall - - # Call the fiber's entry function: entry(arg_on_initialize, arg_on_run_to) - call *%r11 - - # Fiber returned, not good - movl $1, %edi - call _sceFiberForceQuit - ret diff --git a/src/core/libraries/fiber/fiber_error.h b/src/core/libraries/fiber/fiber_error.h deleted file mode 100644 index c89fe30b1..000000000 --- a/src/core/libraries/fiber/fiber_error.h +++ /dev/null @@ -1,14 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "core/libraries/error_codes.h" - -// Fiber library -constexpr int ORBIS_FIBER_ERROR_NULL = 0x80590001; -constexpr int ORBIS_FIBER_ERROR_ALIGNMENT = 0x80590002; -constexpr int ORBIS_FIBER_ERROR_RANGE = 0x80590003; -constexpr int ORBIS_FIBER_ERROR_INVALID = 0x80590004; -constexpr int ORBIS_FIBER_ERROR_PERMISSION = 0x80590005; -constexpr int ORBIS_FIBER_ERROR_STATE = 0x80590006; diff --git a/src/core/libraries/font/font.cpp b/src/core/libraries/font/font.cpp deleted file mode 100644 index 1454004aa..000000000 --- a/src/core/libraries/font/font.cpp +++ /dev/null @@ -1,1611 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "common/logging/log.h" -#include "core/libraries/error_codes.h" -#include "core/libraries/font/font.h" -#include "core/libraries/libs.h" -#include "font_error.h" - -namespace Libraries::Font { - -s32 PS4_SYSV_ABI sceFontAttachDeviceCacheBuffer() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontBindRenderer() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontCharacterGetBidiLevel(OrbisFontTextCharacter* textCharacter, - int* bidiLevel) { - if (!textCharacter || !bidiLevel) { - LOG_DEBUG(Lib_Font, "Invalid parameter"); - return ORBIS_FONT_ERROR_INVALID_PARAMETER; - } - - *bidiLevel = textCharacter->bidiLevel; - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontCharacterGetSyllableStringState() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontCharacterGetTextFontCode() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontCharacterGetTextOrder(OrbisFontTextCharacter* textCharacter, - void** pTextOrder) { - if (!pTextOrder) { - LOG_DEBUG(Lib_Font, "Invalid parameter"); - return ORBIS_FONT_ERROR_INVALID_PARAMETER; - } - - if (!textCharacter) { - LOG_DEBUG(Lib_Font, "Invalid parameter"); - *pTextOrder = NULL; - return ORBIS_FONT_ERROR_INVALID_PARAMETER; - } - - // Retrieve text order - *pTextOrder = textCharacter->textOrder; - return ORBIS_OK; -} - -u32 PS4_SYSV_ABI sceFontCharacterLooksFormatCharacters(OrbisFontTextCharacter* textCharacter) { - if (!textCharacter) { - return 0; - } - - // Check if the format flag (bit 2) is set - return (textCharacter->formatFlags & 0x04) ? textCharacter->characterCode : 0; -} - -u32 PS4_SYSV_ABI sceFontCharacterLooksWhiteSpace(OrbisFontTextCharacter* textCharacter) { - if (!textCharacter) { - return 0; - } - - return (textCharacter->charType == 0x0E) ? textCharacter->characterCode : 0; -} - -OrbisFontTextCharacter* PS4_SYSV_ABI -sceFontCharacterRefersTextBack(OrbisFontTextCharacter* textCharacter) { - if (!textCharacter) - return NULL; // Check if input is NULL - - OrbisFontTextCharacter* current = textCharacter->prev; // Move backward instead of forward - while (current) { - if (current->unkn_0x31 == 0 && current->unkn_0x33 == 0) { - return current; // Return the first matching node - } - current = current->prev; // Move to the previous node - } - - return NULL; // No valid node found -} - -OrbisFontTextCharacter* PS4_SYSV_ABI -sceFontCharacterRefersTextNext(OrbisFontTextCharacter* textCharacter) { - if (!textCharacter) - return NULL; // Null check - - OrbisFontTextCharacter* current = textCharacter->next; - while (current) { - if (current->unkn_0x31 == 0 && current->unkn_0x33 == 0) { - return current; // Found a match - } - current = current->next; // Move to the next node - } - - return NULL; // No matching node found -} - -s32 PS4_SYSV_ABI sceFontCharactersRefersTextCodes() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontClearDeviceCache() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontCloseFont() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontControl() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontCreateGraphicsDevice() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontCreateGraphicsService() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontCreateGraphicsServiceWithEdition() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontCreateLibrary() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontCreateLibraryWithEdition() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontCreateRenderer() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontCreateRendererWithEdition() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontCreateString() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontCreateWords() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontCreateWritingLine() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontDefineAttribute() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontDeleteGlyph() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontDestroyGraphicsDevice() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontDestroyGraphicsService() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontDestroyLibrary() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontDestroyRenderer() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontDestroyString() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontDestroyWords() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontDestroyWritingLine() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontDettachDeviceCacheBuffer() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGenerateCharGlyph() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGetAttribute() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGetCharGlyphCode() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGetCharGlyphMetrics() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGetEffectSlant() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGetEffectWeight() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGetFontGlyphsCount() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGetFontGlyphsOutlineProfile() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGetFontMetrics() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGetFontResolution() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGetFontStyleInformation() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGetGlyphExpandBufferState() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGetHorizontalLayout() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGetKerning() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGetLibrary() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGetPixelResolution() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGetRenderCharGlyphMetrics() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGetRenderEffectSlant() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGetRenderEffectWeight() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGetRenderScaledKerning() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGetRenderScalePixel() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGetRenderScalePoint() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGetResolutionDpi() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGetScalePixel() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGetScalePoint() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGetScriptLanguage() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGetTypographicDesign() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGetVerticalLayout() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGlyphDefineAttribute() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGlyphGetAttribute() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGlyphGetGlyphForm() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGlyphGetMetricsForm() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGlyphGetScalePixel() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGlyphRefersMetrics() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGlyphRefersMetricsHorizontal() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGlyphRefersMetricsHorizontalAdvance() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGlyphRefersMetricsHorizontalX() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGlyphRefersOutline() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGlyphRenderImage() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGlyphRenderImageHorizontal() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGlyphRenderImageVertical() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsBeginFrame() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsDrawingCancel() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsDrawingFinish() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsEndFrame() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsExchangeResource() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsFillMethodInit() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsFillPlotInit() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsFillPlotSetLayout() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsFillPlotSetMapping() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsFillRatesInit() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsFillRatesSetFillEffect() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsFillRatesSetLayout() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsFillRatesSetMapping() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsGetDeviceUsage() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsRegionInit() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsRegionInitCircular() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsRegionInitRoundish() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsRelease() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsRenderResource() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsSetFramePolicy() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsSetupClipping() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsSetupColorRates() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsSetupFillMethod() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsSetupFillRates() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsSetupGlyphFill() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsSetupGlyphFillPlot() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsSetupHandleDefault() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsSetupLocation() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsSetupPositioning() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsSetupRotation() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsSetupScaling() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsSetupShapeFill() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsSetupShapeFillPlot() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsStructureCanvas() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsStructureCanvasSequence() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsStructureDesign() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsStructureDesignResource() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsStructureSurfaceTexture() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsUpdateClipping() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsUpdateColorRates() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsUpdateFillMethod() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsUpdateFillRates() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsUpdateGlyphFill() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsUpdateGlyphFillPlot() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsUpdateLocation() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsUpdatePositioning() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsUpdateRotation() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsUpdateScaling() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsUpdateShapeFill() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontGraphicsUpdateShapeFillPlot() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontMemoryInit() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontMemoryTerm() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontOpenFontFile() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontOpenFontInstance() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontOpenFontMemory() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontOpenFontSet() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontRebindRenderer() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontRenderCharGlyphImage() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontRenderCharGlyphImageHorizontal() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontRenderCharGlyphImageVertical() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontRendererGetOutlineBufferSize() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontRendererResetOutlineBuffer() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontRendererSetOutlineBufferPolicy() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -void PS4_SYSV_ABI sceFontRenderSurfaceInit(OrbisFontRenderSurface* renderSurface, void* buffer, - int bufWidthByte, int pixelSizeByte, int widthPixel, - int heightPixel) { - if (renderSurface) { // Ensure surface is not NULL before modifying it - renderSurface->buffer = buffer; - renderSurface->widthByte = bufWidthByte; - renderSurface->pixelSizeByte = pixelSizeByte; - - // Initialize unknown fields (likely reserved or flags) - renderSurface->unkn_0xd = 0; - renderSurface->styleFlag = 0; - renderSurface->unkn_0xf = 0; - - // Ensure width and height are non-negative - renderSurface->width = (widthPixel < 0) ? 0 : widthPixel; - renderSurface->height = (heightPixel < 0) ? 0 : heightPixel; - - // Set the clipping/scaling rectangle - renderSurface->sc_x0 = 0; - renderSurface->sc_y0 = 0; - renderSurface->sc_x1 = renderSurface->width; - renderSurface->sc_y1 = renderSurface->height; - } -} - -void PS4_SYSV_ABI sceFontRenderSurfaceSetScissor(OrbisFontRenderSurface* renderSurface, int x0, - int y0, int w, int h) { - if (!renderSurface) - return; // Null check - - // Handle horizontal clipping - int surfaceWidth = renderSurface->width; - int clip_x0, clip_x1; - - if (surfaceWidth != 0) { - if (x0 < 0) { // Adjust for negative x0 - clip_x0 = 0; - clip_x1 = (w + x0 > surfaceWidth) ? surfaceWidth : w + x0; - if (w <= -x0) - clip_x1 = 0; // Entire width is clipped - } else { - clip_x0 = (x0 > surfaceWidth) ? surfaceWidth : x0; - clip_x1 = (w + x0 > surfaceWidth) ? surfaceWidth : w + x0; - } - renderSurface->sc_x0 = clip_x0; - renderSurface->sc_x1 = clip_x1; - } - - // Handle vertical clipping - int surfaceHeight = renderSurface->height; - int clip_y0, clip_y1; - - if (surfaceHeight != 0) { - if (y0 < 0) { // Adjust for negative y0 - clip_y0 = 0; - clip_y1 = (h + y0 > surfaceHeight) ? surfaceHeight : h + y0; - if (h <= -y0) - clip_y1 = 0; // Entire height is clipped - } else { - clip_y0 = (y0 > surfaceHeight) ? surfaceHeight : y0; - clip_y1 = (h + y0 > surfaceHeight) ? surfaceHeight : h + y0; - } - renderSurface->sc_y0 = clip_y0; - renderSurface->sc_y1 = clip_y1; - } -} - -s32 PS4_SYSV_ABI sceFontRenderSurfaceSetStyleFrame(OrbisFontRenderSurface* renderSurface, - OrbisFontStyleFrame* styleFrame) { - if (!renderSurface) { - LOG_ERROR(Lib_Font, "Invalid Parameter"); - return ORBIS_FONT_ERROR_INVALID_PARAMETER; - } - - if (!styleFrame) { - renderSurface->styleFlag &= 0xFE; // Clear style flag - } else { - // Validate magic number - if (styleFrame->magic != 0xF09) { - LOG_ERROR(Lib_Font, "Invalid magic"); - return ORBIS_FONT_ERROR_INVALID_PARAMETER; - } - - renderSurface->styleFlag |= 1; // Set style flag - } - - // Assign style frame pointer - renderSurface->unkn_28[0] = styleFrame; - *(uint32_t*)(renderSurface->unkn_28 + 1) = 0; // Reset related field - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontSetEffectSlant() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontSetEffectWeight() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontSetFontsOpenMode() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontSetResolutionDpi() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontSetScalePixel() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontSetScalePoint() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontSetScriptLanguage() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontSetTypographicDesign() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontSetupRenderEffectSlant() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontSetupRenderEffectWeight() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontSetupRenderScalePixel() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontSetupRenderScalePoint() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontStringGetTerminateCode() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontStringGetTerminateOrder() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontStringGetWritingForm() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontStringRefersRenderCharacters() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontStringRefersTextCharacters() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontStyleFrameGetEffectSlant(OrbisFontStyleFrame* styleFrame, - float* slantRatio) { - if (!styleFrame) { - LOG_ERROR(Lib_Font, "Invalid Parameter"); - return ORBIS_FONT_ERROR_INVALID_PARAMETER; - } - - // Validate the magic number - if (styleFrame->magic != 0xF09) { - LOG_ERROR(Lib_Font, "Invalid Magic"); - return ORBIS_FONT_ERROR_INVALID_PARAMETER; - } - - // Check if the slant effect is enabled (bit 1 in flags) - if (!(styleFrame->flags & 0x02)) { - LOG_ERROR(Lib_Font, "Flag not set"); - return ORBIS_FONT_ERROR_UNSET_PARAMETER; - } - - if (!slantRatio) { - LOG_ERROR(Lib_Font, "Invalid Parameter"); - return ORBIS_FONT_ERROR_INVALID_PARAMETER; - } - - // Retrieve slant ratio - *slantRatio = styleFrame->slantRatio; - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontStyleFrameGetEffectWeight(OrbisFontStyleFrame* fontStyleFrame, - float* weightXScale, float* weightYScale, - uint32_t* mode) { - if (!fontStyleFrame) { - LOG_ERROR(Lib_Font, "Invalid Parameter"); - return ORBIS_FONT_ERROR_INVALID_PARAMETER; - } - - // Validate the magic number - if (fontStyleFrame->magic != 0xF09) { - LOG_ERROR(Lib_Font, "Magic not set"); - return ORBIS_FONT_ERROR_INVALID_PARAMETER; - } - - // Check if the weight effect is enabled (bit 2 in flags) - if (!(fontStyleFrame->flags & 0x04)) { - LOG_ERROR(Lib_Font, "Flag not set"); - return ORBIS_FONT_ERROR_UNSET_PARAMETER; - } - - // Retrieve weight scales (default is +1.0 to maintain normal weight) - if (weightXScale) { - *weightXScale = fontStyleFrame->weightXScale + 1.0f; - } - if (weightYScale) { - *weightYScale = fontStyleFrame->weightYScale + 1.0f; - } - - // Reset mode if provided - if (mode) { - *mode = 0; - } - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontStyleFrameGetResolutionDpi() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontStyleFrameGetScalePixel(OrbisFontStyleFrame* styleFrame, float* w, - float* h) { - if (!styleFrame) { - LOG_ERROR(Lib_Font, "Invalid Parameter"); - return ORBIS_FONT_ERROR_INVALID_PARAMETER; - } - - if (styleFrame->magic != 0xF09) { - LOG_ERROR(Lib_Font, "Invalid magic"); - return ORBIS_FONT_ERROR_INVALID_PARAMETER; - } - - if (!(styleFrame->flags & 0x01)) { - LOG_ERROR(Lib_Font, "Scaling effect parameter not set"); - return ORBIS_FONT_ERROR_UNSET_PARAMETER; - } - - // Check if scaling is allowed - int isScalingEnabled = styleFrame->scalingFlag; - if (w) { - *w = styleFrame->scaleWidth; - if (isScalingEnabled && styleFrame->dpiX) { - *w *= ((float)styleFrame->dpiX / 72.0f); - } - } - - if (h) { - *h = styleFrame->scaleHeight; - if (isScalingEnabled && styleFrame->dpiY) { - *h *= ((float)styleFrame->dpiY / 72.0f); - } - } - - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontStyleFrameGetScalePoint() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontStyleFrameInit() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontStyleFrameSetEffectSlant() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontStyleFrameSetEffectWeight() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontStyleFrameSetResolutionDpi() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontStyleFrameSetScalePixel() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontStyleFrameSetScalePoint() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontStyleFrameUnsetEffectSlant() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontStyleFrameUnsetEffectWeight() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontStyleFrameUnsetScale() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontSupportExternalFonts() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontSupportGlyphs() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontSupportSystemFonts() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontTextCodesStepBack() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontTextCodesStepNext() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontTextSourceInit() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontTextSourceRewind() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontTextSourceSetDefaultFont() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontTextSourceSetWritingForm() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontUnbindRenderer() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontWordsFindWordCharacters() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontWritingGetRenderMetrics() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontWritingInit() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontWritingLineClear() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontWritingLineGetOrderingSpace() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontWritingLineGetRenderMetrics() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontWritingLineRefersRenderStep() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontWritingLineWritesOrder() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontWritingRefersRenderStep() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontWritingRefersRenderStepCharacter() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontWritingSetMaskInvisible() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_00F4D778F1C88CB3() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_03C650025FBB0DE7() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_07EAB8A163B27E1A() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_09408E88E4F97CE3() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_09F92905ED82A814() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_0D142CEE1AB21ABE() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_14BD2E9E119C16F2() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_1AC53C9EDEAE8D75() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_1D401185D5E24C3D() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_1E83CD20C2CC996F() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_314B1F765B9FE78A() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_350E6725FEDE29E1() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_3DB773F0A604BF39() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_4FF49DD21E311B1C() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_526287664A493981() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_55CA718DBC84A6E9() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_563FC5F0706A8B4D() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_569E2ECD34290F45() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_5A04775B6BE47685() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_5FD93BCAB6F79750() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_62B5398F864BD3B4() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_6F9010294D822367() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_7757E947423A7A67() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_7E06BA52077F54FA() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_93B36DEA021311D6() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_94B0891E7111598A() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_9785C9128C2FE7CD() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_97DFBC9B65FBC0E1() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_ACD9717405D7D3CA() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_B19A8AEC3FD4F16F() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_C10F488AD7CF103D() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_D0C8B5FF4A6826C7() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_E48D3CD01C342A33() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_EAC96B2186B71E14() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_FE4788A96EF46256() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_FE7E5AE95D3058F5() { - LOG_ERROR(Lib_Font, "(STUBBED) called"); - return ORBIS_OK; -} - -void RegisterlibSceFont(Core::Loader::SymbolsResolver* sym) { - LIB_FUNCTION("CUKn5pX-NVY", "libSceFont", 1, "libSceFont", sceFontAttachDeviceCacheBuffer); - LIB_FUNCTION("3OdRkSjOcog", "libSceFont", 1, "libSceFont", sceFontBindRenderer); - LIB_FUNCTION("6DFUkCwQLa8", "libSceFont", 1, "libSceFont", sceFontCharacterGetBidiLevel); - LIB_FUNCTION("coCrV6IWplE", "libSceFont", 1, "libSceFont", - sceFontCharacterGetSyllableStringState); - LIB_FUNCTION("zN3+nuA0SFQ", "libSceFont", 1, "libSceFont", sceFontCharacterGetTextFontCode); - LIB_FUNCTION("mxgmMj-Mq-o", "libSceFont", 1, "libSceFont", sceFontCharacterGetTextOrder); - LIB_FUNCTION("-P6X35Rq2-E", "libSceFont", 1, "libSceFont", - sceFontCharacterLooksFormatCharacters); - LIB_FUNCTION("SaRlqtqaCew", "libSceFont", 1, "libSceFont", sceFontCharacterLooksWhiteSpace); - LIB_FUNCTION("6Gqlv5KdTbU", "libSceFont", 1, "libSceFont", sceFontCharacterRefersTextBack); - LIB_FUNCTION("BkjBP+YC19w", "libSceFont", 1, "libSceFont", sceFontCharacterRefersTextNext); - LIB_FUNCTION("lVSR5ftvNag", "libSceFont", 1, "libSceFont", sceFontCharactersRefersTextCodes); - LIB_FUNCTION("I9R5VC6eZWo", "libSceFont", 1, "libSceFont", sceFontClearDeviceCache); - LIB_FUNCTION("vzHs3C8lWJk", "libSceFont", 1, "libSceFont", sceFontCloseFont); - LIB_FUNCTION("MpKSBaYKluo", "libSceFont", 1, "libSceFont", sceFontControl); - LIB_FUNCTION("WBNBaj9XiJU", "libSceFont", 1, "libSceFont", sceFontCreateGraphicsDevice); - LIB_FUNCTION("4So0MC3oBIM", "libSceFont", 1, "libSceFont", sceFontCreateGraphicsService); - LIB_FUNCTION("NlO5Qlhjkng", "libSceFont", 1, "libSceFont", - sceFontCreateGraphicsServiceWithEdition); - LIB_FUNCTION("nWrfPI4Okmg", "libSceFont", 1, "libSceFont", sceFontCreateLibrary); - LIB_FUNCTION("n590hj5Oe-k", "libSceFont", 1, "libSceFont", sceFontCreateLibraryWithEdition); - LIB_FUNCTION("u5fZd3KZcs0", "libSceFont", 1, "libSceFont", sceFontCreateRenderer); - LIB_FUNCTION("WaSFJoRWXaI", "libSceFont", 1, "libSceFont", sceFontCreateRendererWithEdition); - LIB_FUNCTION("MO24vDhmS4E", "libSceFont", 1, "libSceFont", sceFontCreateString); - LIB_FUNCTION("cYrMGk1wrMA", "libSceFont", 1, "libSceFont", sceFontCreateWords); - LIB_FUNCTION("7rogx92EEyc", "libSceFont", 1, "libSceFont", sceFontCreateWritingLine); - LIB_FUNCTION("8h-SOB-asgk", "libSceFont", 1, "libSceFont", sceFontDefineAttribute); - LIB_FUNCTION("LHDoRWVFGqk", "libSceFont", 1, "libSceFont", sceFontDeleteGlyph); - LIB_FUNCTION("5QG71IjgOpQ", "libSceFont", 1, "libSceFont", sceFontDestroyGraphicsDevice); - LIB_FUNCTION("zZQD3EwJo3c", "libSceFont", 1, "libSceFont", sceFontDestroyGraphicsService); - LIB_FUNCTION("FXP359ygujs", "libSceFont", 1, "libSceFont", sceFontDestroyLibrary); - LIB_FUNCTION("exAxkyVLt0s", "libSceFont", 1, "libSceFont", sceFontDestroyRenderer); - LIB_FUNCTION("SSCaczu2aMQ", "libSceFont", 1, "libSceFont", sceFontDestroyString); - LIB_FUNCTION("hWE4AwNixqY", "libSceFont", 1, "libSceFont", sceFontDestroyWords); - LIB_FUNCTION("PEjv7CVDRYs", "libSceFont", 1, "libSceFont", sceFontDestroyWritingLine); - LIB_FUNCTION("UuY-OJF+f0k", "libSceFont", 1, "libSceFont", sceFontDettachDeviceCacheBuffer); - LIB_FUNCTION("C-4Qw5Srlyw", "libSceFont", 1, "libSceFont", sceFontGenerateCharGlyph); - LIB_FUNCTION("5kx49CAlO-M", "libSceFont", 1, "libSceFont", sceFontGetAttribute); - LIB_FUNCTION("OINC0X9HGBY", "libSceFont", 1, "libSceFont", sceFontGetCharGlyphCode); - LIB_FUNCTION("L97d+3OgMlE", "libSceFont", 1, "libSceFont", sceFontGetCharGlyphMetrics); - LIB_FUNCTION("ynSqYL8VpoA", "libSceFont", 1, "libSceFont", sceFontGetEffectSlant); - LIB_FUNCTION("d7dDgRY+Bzw", "libSceFont", 1, "libSceFont", sceFontGetEffectWeight); - LIB_FUNCTION("ZB8xRemRRG8", "libSceFont", 1, "libSceFont", sceFontGetFontGlyphsCount); - LIB_FUNCTION("4X14YSK4Ldk", "libSceFont", 1, "libSceFont", sceFontGetFontGlyphsOutlineProfile); - LIB_FUNCTION("eb9S3zNlV5o", "libSceFont", 1, "libSceFont", sceFontGetFontMetrics); - LIB_FUNCTION("tiIlroGki+g", "libSceFont", 1, "libSceFont", sceFontGetFontResolution); - LIB_FUNCTION("3hVv3SNoL6E", "libSceFont", 1, "libSceFont", sceFontGetFontStyleInformation); - LIB_FUNCTION("gVQpMBuB7fE", "libSceFont", 1, "libSceFont", sceFontGetGlyphExpandBufferState); - LIB_FUNCTION("imxVx8lm+KM", "libSceFont", 1, "libSceFont", sceFontGetHorizontalLayout); - LIB_FUNCTION("sDuhHGNhHvE", "libSceFont", 1, "libSceFont", sceFontGetKerning); - LIB_FUNCTION("LzmHDnlcwfQ", "libSceFont", 1, "libSceFont", sceFontGetLibrary); - LIB_FUNCTION("BozJej5T6fs", "libSceFont", 1, "libSceFont", sceFontGetPixelResolution); - LIB_FUNCTION("IQtleGLL5pQ", "libSceFont", 1, "libSceFont", sceFontGetRenderCharGlyphMetrics); - LIB_FUNCTION("Gqa5Pp7y4MU", "libSceFont", 1, "libSceFont", sceFontGetRenderEffectSlant); - LIB_FUNCTION("woOjHrkjIYg", "libSceFont", 1, "libSceFont", sceFontGetRenderEffectWeight); - LIB_FUNCTION("ryPlnDDI3rU", "libSceFont", 1, "libSceFont", sceFontGetRenderScaledKerning); - LIB_FUNCTION("EY38A01lq2k", "libSceFont", 1, "libSceFont", sceFontGetRenderScalePixel); - LIB_FUNCTION("FEafYUcxEGo", "libSceFont", 1, "libSceFont", sceFontGetRenderScalePoint); - LIB_FUNCTION("8REoLjNGCpM", "libSceFont", 1, "libSceFont", sceFontGetResolutionDpi); - LIB_FUNCTION("CkVmLoCNN-8", "libSceFont", 1, "libSceFont", sceFontGetScalePixel); - LIB_FUNCTION("GoF2bhB7LYk", "libSceFont", 1, "libSceFont", sceFontGetScalePoint); - LIB_FUNCTION("IrXeG0Lc6nA", "libSceFont", 1, "libSceFont", sceFontGetScriptLanguage); - LIB_FUNCTION("7-miUT6pNQw", "libSceFont", 1, "libSceFont", sceFontGetTypographicDesign); - LIB_FUNCTION("3BrWWFU+4ts", "libSceFont", 1, "libSceFont", sceFontGetVerticalLayout); - LIB_FUNCTION("8-zmgsxkBek", "libSceFont", 1, "libSceFont", sceFontGlyphDefineAttribute); - LIB_FUNCTION("oO33Uex4Ui0", "libSceFont", 1, "libSceFont", sceFontGlyphGetAttribute); - LIB_FUNCTION("PXlA0M8ax40", "libSceFont", 1, "libSceFont", sceFontGlyphGetGlyphForm); - LIB_FUNCTION("XUfSWpLhrUw", "libSceFont", 1, "libSceFont", sceFontGlyphGetMetricsForm); - LIB_FUNCTION("lNnUqa1zA-M", "libSceFont", 1, "libSceFont", sceFontGlyphGetScalePixel); - LIB_FUNCTION("ntrc3bEWlvQ", "libSceFont", 1, "libSceFont", sceFontGlyphRefersMetrics); - LIB_FUNCTION("9kTbF59TjLs", "libSceFont", 1, "libSceFont", sceFontGlyphRefersMetricsHorizontal); - LIB_FUNCTION("nJavPEdMDvM", "libSceFont", 1, "libSceFont", - sceFontGlyphRefersMetricsHorizontalAdvance); - LIB_FUNCTION("JCnVgZgcucs", "libSceFont", 1, "libSceFont", - sceFontGlyphRefersMetricsHorizontalX); - LIB_FUNCTION("R1T4i+DOhNY", "libSceFont", 1, "libSceFont", sceFontGlyphRefersOutline); - LIB_FUNCTION("RmkXfBcZnrM", "libSceFont", 1, "libSceFont", sceFontGlyphRenderImage); - LIB_FUNCTION("r4KEihtwxGs", "libSceFont", 1, "libSceFont", sceFontGlyphRenderImageHorizontal); - LIB_FUNCTION("n22d-HIdmMg", "libSceFont", 1, "libSceFont", sceFontGlyphRenderImageVertical); - LIB_FUNCTION("RL2cAQgyXR8", "libSceFont", 1, "libSceFont", sceFontGraphicsBeginFrame); - LIB_FUNCTION("dUmIK6QjT7E", "libSceFont", 1, "libSceFont", sceFontGraphicsDrawingCancel); - LIB_FUNCTION("X2Vl3yU19Zw", "libSceFont", 1, "libSceFont", sceFontGraphicsDrawingFinish); - LIB_FUNCTION("DOmdOwV3Aqw", "libSceFont", 1, "libSceFont", sceFontGraphicsEndFrame); - LIB_FUNCTION("zdYdKRQC3rw", "libSceFont", 1, "libSceFont", sceFontGraphicsExchangeResource); - LIB_FUNCTION("UkMUIoj-e9s", "libSceFont", 1, "libSceFont", sceFontGraphicsFillMethodInit); - LIB_FUNCTION("DJURdcnVUqo", "libSceFont", 1, "libSceFont", sceFontGraphicsFillPlotInit); - LIB_FUNCTION("eQac6ftmBQQ", "libSceFont", 1, "libSceFont", sceFontGraphicsFillPlotSetLayout); - LIB_FUNCTION("PEYQJa+MWnk", "libSceFont", 1, "libSceFont", sceFontGraphicsFillPlotSetMapping); - LIB_FUNCTION("21g4m4kYF6g", "libSceFont", 1, "libSceFont", sceFontGraphicsFillRatesInit); - LIB_FUNCTION("pJzji5FvdxU", "libSceFont", 1, "libSceFont", - sceFontGraphicsFillRatesSetFillEffect); - LIB_FUNCTION("scaro-xEuUM", "libSceFont", 1, "libSceFont", sceFontGraphicsFillRatesSetLayout); - LIB_FUNCTION("W66Kqtt0xU0", "libSceFont", 1, "libSceFont", sceFontGraphicsFillRatesSetMapping); - LIB_FUNCTION("FzpLsBQEegQ", "libSceFont", 1, "libSceFont", sceFontGraphicsGetDeviceUsage); - LIB_FUNCTION("W80hs0g5d+E", "libSceFont", 1, "libSceFont", sceFontGraphicsRegionInit); - LIB_FUNCTION("S48+njg9p-o", "libSceFont", 1, "libSceFont", sceFontGraphicsRegionInitCircular); - LIB_FUNCTION("wcOQ8Fz73+M", "libSceFont", 1, "libSceFont", sceFontGraphicsRegionInitRoundish); - LIB_FUNCTION("YBaw2Yyfd5E", "libSceFont", 1, "libSceFont", sceFontGraphicsRelease); - LIB_FUNCTION("qkySrQ4FGe0", "libSceFont", 1, "libSceFont", sceFontGraphicsRenderResource); - LIB_FUNCTION("qzNjJYKVli0", "libSceFont", 1, "libSceFont", sceFontGraphicsSetFramePolicy); - LIB_FUNCTION("9iRbHCtcx-o", "libSceFont", 1, "libSceFont", sceFontGraphicsSetupClipping); - LIB_FUNCTION("KZ3qPyz5Opc", "libSceFont", 1, "libSceFont", sceFontGraphicsSetupColorRates); - LIB_FUNCTION("LqclbpVzRvM", "libSceFont", 1, "libSceFont", sceFontGraphicsSetupFillMethod); - LIB_FUNCTION("Wl4FiI4qKY0", "libSceFont", 1, "libSceFont", sceFontGraphicsSetupFillRates); - LIB_FUNCTION("WC7s95TccVo", "libSceFont", 1, "libSceFont", sceFontGraphicsSetupGlyphFill); - LIB_FUNCTION("zC6I4ty37NA", "libSceFont", 1, "libSceFont", sceFontGraphicsSetupGlyphFillPlot); - LIB_FUNCTION("drZUF0XKTEI", "libSceFont", 1, "libSceFont", sceFontGraphicsSetupHandleDefault); - LIB_FUNCTION("MEAmHMynQXE", "libSceFont", 1, "libSceFont", sceFontGraphicsSetupLocation); - LIB_FUNCTION("XRUOmQhnYO4", "libSceFont", 1, "libSceFont", sceFontGraphicsSetupPositioning); - LIB_FUNCTION("98XGr2Bkklg", "libSceFont", 1, "libSceFont", sceFontGraphicsSetupRotation); - LIB_FUNCTION("Nj-ZUVOVAvc", "libSceFont", 1, "libSceFont", sceFontGraphicsSetupScaling); - LIB_FUNCTION("p0avT2ggev0", "libSceFont", 1, "libSceFont", sceFontGraphicsSetupShapeFill); - LIB_FUNCTION("0C5aKg9KghY", "libSceFont", 1, "libSceFont", sceFontGraphicsSetupShapeFillPlot); - LIB_FUNCTION("4pA3qqAcYco", "libSceFont", 1, "libSceFont", sceFontGraphicsStructureCanvas); - LIB_FUNCTION("cpjgdlMYdOM", "libSceFont", 1, "libSceFont", - sceFontGraphicsStructureCanvasSequence); - LIB_FUNCTION("774Mee21wKk", "libSceFont", 1, "libSceFont", sceFontGraphicsStructureDesign); - LIB_FUNCTION("Hp3NIFhUXvQ", "libSceFont", 1, "libSceFont", - sceFontGraphicsStructureDesignResource); - LIB_FUNCTION("bhmZlml6NBs", "libSceFont", 1, "libSceFont", - sceFontGraphicsStructureSurfaceTexture); - LIB_FUNCTION("5sAWgysOBfE", "libSceFont", 1, "libSceFont", sceFontGraphicsUpdateClipping); - LIB_FUNCTION("W4e8obm+w6o", "libSceFont", 1, "libSceFont", sceFontGraphicsUpdateColorRates); - LIB_FUNCTION("EgIn3QBajPs", "libSceFont", 1, "libSceFont", sceFontGraphicsUpdateFillMethod); - LIB_FUNCTION("MnUYAs2jVuU", "libSceFont", 1, "libSceFont", sceFontGraphicsUpdateFillRates); - LIB_FUNCTION("R-oVDMusYbc", "libSceFont", 1, "libSceFont", sceFontGraphicsUpdateGlyphFill); - LIB_FUNCTION("b9R+HQuHSMI", "libSceFont", 1, "libSceFont", sceFontGraphicsUpdateGlyphFillPlot); - LIB_FUNCTION("IN4P5pJADQY", "libSceFont", 1, "libSceFont", sceFontGraphicsUpdateLocation); - LIB_FUNCTION("U+LLXdr2DxM", "libSceFont", 1, "libSceFont", sceFontGraphicsUpdatePositioning); - LIB_FUNCTION("yStTYSeb4NM", "libSceFont", 1, "libSceFont", sceFontGraphicsUpdateRotation); - LIB_FUNCTION("eDxmMoxE5xU", "libSceFont", 1, "libSceFont", sceFontGraphicsUpdateScaling); - LIB_FUNCTION("Ax6LQJJq6HQ", "libSceFont", 1, "libSceFont", sceFontGraphicsUpdateShapeFill); - LIB_FUNCTION("I5Rf2rXvBKQ", "libSceFont", 1, "libSceFont", sceFontGraphicsUpdateShapeFillPlot); - LIB_FUNCTION("whrS4oksXc4", "libSceFont", 1, "libSceFont", sceFontMemoryInit); - LIB_FUNCTION("h6hIgxXEiEc", "libSceFont", 1, "libSceFont", sceFontMemoryTerm); - LIB_FUNCTION("RvXyHMUiLhE", "libSceFont", 1, "libSceFont", sceFontOpenFontFile); - LIB_FUNCTION("JzCH3SCFnAU", "libSceFont", 1, "libSceFont", sceFontOpenFontInstance); - LIB_FUNCTION("KXUpebrFk1U", "libSceFont", 1, "libSceFont", sceFontOpenFontMemory); - LIB_FUNCTION("cKYtVmeSTcw", "libSceFont", 1, "libSceFont", sceFontOpenFontSet); - LIB_FUNCTION("Z2cdsqJH+5k", "libSceFont", 1, "libSceFont", sceFontRebindRenderer); - LIB_FUNCTION("3G4zhgKuxE8", "libSceFont", 1, "libSceFont", sceFontRenderCharGlyphImage); - LIB_FUNCTION("kAenWy1Zw5o", "libSceFont", 1, "libSceFont", - sceFontRenderCharGlyphImageHorizontal); - LIB_FUNCTION("i6UNdSig1uE", "libSceFont", 1, "libSceFont", sceFontRenderCharGlyphImageVertical); - LIB_FUNCTION("amcmrY62BD4", "libSceFont", 1, "libSceFont", sceFontRendererGetOutlineBufferSize); - LIB_FUNCTION("ai6AfGrBs4o", "libSceFont", 1, "libSceFont", sceFontRendererResetOutlineBuffer); - LIB_FUNCTION("ydF+WuH0fAk", "libSceFont", 1, "libSceFont", - sceFontRendererSetOutlineBufferPolicy); - LIB_FUNCTION("gdUCnU0gHdI", "libSceFont", 1, "libSceFont", sceFontRenderSurfaceInit); - LIB_FUNCTION("vRxf4d0ulPs", "libSceFont", 1, "libSceFont", sceFontRenderSurfaceSetScissor); - LIB_FUNCTION("0hr-w30SjiI", "libSceFont", 1, "libSceFont", sceFontRenderSurfaceSetStyleFrame); - LIB_FUNCTION("TMtqoFQjjbA", "libSceFont", 1, "libSceFont", sceFontSetEffectSlant); - LIB_FUNCTION("v0phZwa4R5o", "libSceFont", 1, "libSceFont", sceFontSetEffectWeight); - LIB_FUNCTION("kihFGYJee7o", "libSceFont", 1, "libSceFont", sceFontSetFontsOpenMode); - LIB_FUNCTION("I1acwR7Qp8E", "libSceFont", 1, "libSceFont", sceFontSetResolutionDpi); - LIB_FUNCTION("N1EBMeGhf7E", "libSceFont", 1, "libSceFont", sceFontSetScalePixel); - LIB_FUNCTION("sw65+7wXCKE", "libSceFont", 1, "libSceFont", sceFontSetScalePoint); - LIB_FUNCTION("PxSR9UfJ+SQ", "libSceFont", 1, "libSceFont", sceFontSetScriptLanguage); - LIB_FUNCTION("SnsZua35ngs", "libSceFont", 1, "libSceFont", sceFontSetTypographicDesign); - LIB_FUNCTION("lz9y9UFO2UU", "libSceFont", 1, "libSceFont", sceFontSetupRenderEffectSlant); - LIB_FUNCTION("XIGorvLusDQ", "libSceFont", 1, "libSceFont", sceFontSetupRenderEffectWeight); - LIB_FUNCTION("6vGCkkQJOcI", "libSceFont", 1, "libSceFont", sceFontSetupRenderScalePixel); - LIB_FUNCTION("nMZid4oDfi4", "libSceFont", 1, "libSceFont", sceFontSetupRenderScalePoint); - LIB_FUNCTION("ObkDGDBsVtw", "libSceFont", 1, "libSceFont", sceFontStringGetTerminateCode); - LIB_FUNCTION("+B-xlbiWDJ4", "libSceFont", 1, "libSceFont", sceFontStringGetTerminateOrder); - LIB_FUNCTION("o1vIEHeb6tw", "libSceFont", 1, "libSceFont", sceFontStringGetWritingForm); - LIB_FUNCTION("hq5LffQjz-s", "libSceFont", 1, "libSceFont", sceFontStringRefersRenderCharacters); - LIB_FUNCTION("Avv7OApgCJk", "libSceFont", 1, "libSceFont", sceFontStringRefersTextCharacters); - LIB_FUNCTION("lOfduYnjgbo", "libSceFont", 1, "libSceFont", sceFontStyleFrameGetEffectSlant); - LIB_FUNCTION("HIUdjR-+Wl8", "libSceFont", 1, "libSceFont", sceFontStyleFrameGetEffectWeight); - LIB_FUNCTION("VSw18Aqzl0U", "libSceFont", 1, "libSceFont", sceFontStyleFrameGetResolutionDpi); - LIB_FUNCTION("2QfqfeLblbg", "libSceFont", 1, "libSceFont", sceFontStyleFrameGetScalePixel); - LIB_FUNCTION("7x2xKiiB7MA", "libSceFont", 1, "libSceFont", sceFontStyleFrameGetScalePoint); - LIB_FUNCTION("la2AOWnHEAc", "libSceFont", 1, "libSceFont", sceFontStyleFrameInit); - LIB_FUNCTION("394sckksiCU", "libSceFont", 1, "libSceFont", sceFontStyleFrameSetEffectSlant); - LIB_FUNCTION("faw77-pEBmU", "libSceFont", 1, "libSceFont", sceFontStyleFrameSetEffectWeight); - LIB_FUNCTION("dB4-3Wdwls8", "libSceFont", 1, "libSceFont", sceFontStyleFrameSetResolutionDpi); - LIB_FUNCTION("da4rQ4-+p-4", "libSceFont", 1, "libSceFont", sceFontStyleFrameSetScalePixel); - LIB_FUNCTION("O997laxY-Ys", "libSceFont", 1, "libSceFont", sceFontStyleFrameSetScalePoint); - LIB_FUNCTION("dUmABkAnVgk", "libSceFont", 1, "libSceFont", sceFontStyleFrameUnsetEffectSlant); - LIB_FUNCTION("hwsuXgmKdaw", "libSceFont", 1, "libSceFont", sceFontStyleFrameUnsetEffectWeight); - LIB_FUNCTION("bePC0L0vQWY", "libSceFont", 1, "libSceFont", sceFontStyleFrameUnsetScale); - LIB_FUNCTION("mz2iTY0MK4A", "libSceFont", 1, "libSceFont", sceFontSupportExternalFonts); - LIB_FUNCTION("71w5DzObuZI", "libSceFont", 1, "libSceFont", sceFontSupportGlyphs); - LIB_FUNCTION("SsRbbCiWoGw", "libSceFont", 1, "libSceFont", sceFontSupportSystemFonts); - LIB_FUNCTION("IPoYwwlMx-g", "libSceFont", 1, "libSceFont", sceFontTextCodesStepBack); - LIB_FUNCTION("olSmXY+XP1E", "libSceFont", 1, "libSceFont", sceFontTextCodesStepNext); - LIB_FUNCTION("oaJ1BpN2FQk", "libSceFont", 1, "libSceFont", sceFontTextSourceInit); - LIB_FUNCTION("VRFd3diReec", "libSceFont", 1, "libSceFont", sceFontTextSourceRewind); - LIB_FUNCTION("eCRMCSk96NU", "libSceFont", 1, "libSceFont", sceFontTextSourceSetDefaultFont); - LIB_FUNCTION("OqQKX0h5COw", "libSceFont", 1, "libSceFont", sceFontTextSourceSetWritingForm); - LIB_FUNCTION("1QjhKxrsOB8", "libSceFont", 1, "libSceFont", sceFontUnbindRenderer); - LIB_FUNCTION("H-FNq8isKE0", "libSceFont", 1, "libSceFont", sceFontWordsFindWordCharacters); - LIB_FUNCTION("fljdejMcG1c", "libSceFont", 1, "libSceFont", sceFontWritingGetRenderMetrics); - LIB_FUNCTION("fD5rqhEXKYQ", "libSceFont", 1, "libSceFont", sceFontWritingInit); - LIB_FUNCTION("1+DgKL0haWQ", "libSceFont", 1, "libSceFont", sceFontWritingLineClear); - LIB_FUNCTION("JQKWIsS9joE", "libSceFont", 1, "libSceFont", sceFontWritingLineGetOrderingSpace); - LIB_FUNCTION("nlU2VnfpqTM", "libSceFont", 1, "libSceFont", sceFontWritingLineGetRenderMetrics); - LIB_FUNCTION("+FYcYefsVX0", "libSceFont", 1, "libSceFont", sceFontWritingLineRefersRenderStep); - LIB_FUNCTION("wyKFUOWdu3Q", "libSceFont", 1, "libSceFont", sceFontWritingLineWritesOrder); - LIB_FUNCTION("W-2WOXEHGck", "libSceFont", 1, "libSceFont", sceFontWritingRefersRenderStep); - LIB_FUNCTION("f4Onl7efPEY", "libSceFont", 1, "libSceFont", - sceFontWritingRefersRenderStepCharacter); - LIB_FUNCTION("BbCZjJizU4A", "libSceFont", 1, "libSceFont", sceFontWritingSetMaskInvisible); - LIB_FUNCTION("APTXePHIjLM", "libSceFont", 1, "libSceFont", Func_00F4D778F1C88CB3); - LIB_FUNCTION("A8ZQAl+7Dec", "libSceFont", 1, "libSceFont", Func_03C650025FBB0DE7); - LIB_FUNCTION("B+q4oWOyfho", "libSceFont", 1, "libSceFont", Func_07EAB8A163B27E1A); - LIB_FUNCTION("CUCOiOT5fOM", "libSceFont", 1, "libSceFont", Func_09408E88E4F97CE3); - LIB_FUNCTION("CfkpBe2CqBQ", "libSceFont", 1, "libSceFont", Func_09F92905ED82A814); - LIB_FUNCTION("DRQs7hqyGr4", "libSceFont", 1, "libSceFont", Func_0D142CEE1AB21ABE); - LIB_FUNCTION("FL0unhGcFvI", "libSceFont", 1, "libSceFont", Func_14BD2E9E119C16F2); - LIB_FUNCTION("GsU8nt6ujXU", "libSceFont", 1, "libSceFont", Func_1AC53C9EDEAE8D75); - LIB_FUNCTION("HUARhdXiTD0", "libSceFont", 1, "libSceFont", Func_1D401185D5E24C3D); - LIB_FUNCTION("HoPNIMLMmW8", "libSceFont", 1, "libSceFont", Func_1E83CD20C2CC996F); - LIB_FUNCTION("MUsfdluf54o", "libSceFont", 1, "libSceFont", Func_314B1F765B9FE78A); - LIB_FUNCTION("NQ5nJf7eKeE", "libSceFont", 1, "libSceFont", Func_350E6725FEDE29E1); - LIB_FUNCTION("Pbdz8KYEvzk", "libSceFont", 1, "libSceFont", Func_3DB773F0A604BF39); - LIB_FUNCTION("T-Sd0h4xGxw", "libSceFont", 1, "libSceFont", Func_4FF49DD21E311B1C); - LIB_FUNCTION("UmKHZkpJOYE", "libSceFont", 1, "libSceFont", Func_526287664A493981); - LIB_FUNCTION("VcpxjbyEpuk", "libSceFont", 1, "libSceFont", Func_55CA718DBC84A6E9); - LIB_FUNCTION("Vj-F8HBqi00", "libSceFont", 1, "libSceFont", Func_563FC5F0706A8B4D); - LIB_FUNCTION("Vp4uzTQpD0U", "libSceFont", 1, "libSceFont", Func_569E2ECD34290F45); - LIB_FUNCTION("WgR3W2vkdoU", "libSceFont", 1, "libSceFont", Func_5A04775B6BE47685); - LIB_FUNCTION("X9k7yrb3l1A", "libSceFont", 1, "libSceFont", Func_5FD93BCAB6F79750); - LIB_FUNCTION("YrU5j4ZL07Q", "libSceFont", 1, "libSceFont", Func_62B5398F864BD3B4); - LIB_FUNCTION("b5AQKU2CI2c", "libSceFont", 1, "libSceFont", Func_6F9010294D822367); - LIB_FUNCTION("d1fpR0I6emc", "libSceFont", 1, "libSceFont", Func_7757E947423A7A67); - LIB_FUNCTION("fga6Ugd-VPo", "libSceFont", 1, "libSceFont", Func_7E06BA52077F54FA); - LIB_FUNCTION("k7Nt6gITEdY", "libSceFont", 1, "libSceFont", Func_93B36DEA021311D6); - LIB_FUNCTION("lLCJHnERWYo", "libSceFont", 1, "libSceFont", Func_94B0891E7111598A); - LIB_FUNCTION("l4XJEowv580", "libSceFont", 1, "libSceFont", Func_9785C9128C2FE7CD); - LIB_FUNCTION("l9+8m2X7wOE", "libSceFont", 1, "libSceFont", Func_97DFBC9B65FBC0E1); - LIB_FUNCTION("rNlxdAXX08o", "libSceFont", 1, "libSceFont", Func_ACD9717405D7D3CA); - LIB_FUNCTION("sZqK7D-U8W8", "libSceFont", 1, "libSceFont", Func_B19A8AEC3FD4F16F); - LIB_FUNCTION("wQ9IitfPED0", "libSceFont", 1, "libSceFont", Func_C10F488AD7CF103D); - LIB_FUNCTION("0Mi1-0poJsc", "libSceFont", 1, "libSceFont", Func_D0C8B5FF4A6826C7); - LIB_FUNCTION("5I080Bw0KjM", "libSceFont", 1, "libSceFont", Func_E48D3CD01C342A33); - LIB_FUNCTION("6slrIYa3HhQ", "libSceFont", 1, "libSceFont", Func_EAC96B2186B71E14); - LIB_FUNCTION("-keIqW70YlY", "libSceFont", 1, "libSceFont", Func_FE4788A96EF46256); - LIB_FUNCTION("-n5a6V0wWPU", "libSceFont", 1, "libSceFont", Func_FE7E5AE95D3058F5); -}; - -} // namespace Libraries::Font \ No newline at end of file diff --git a/src/core/libraries/font/font.h b/src/core/libraries/font/font.h deleted file mode 100644 index a8e239126..000000000 --- a/src/core/libraries/font/font.h +++ /dev/null @@ -1,299 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "common/types.h" - -namespace Core::Loader { -class SymbolsResolver; -} - -namespace Libraries::Font { - -struct OrbisFontTextCharacter { - // Other fields... - struct OrbisFontTextCharacter* next; // Pointer to the next node 0x00 - struct OrbisFontTextCharacter* prev; // Pointer to the next node 0x08 - void* textOrder; // Field at offset 0x10 (pointer to text order info) - u32 characterCode; // Field assumed at offset 0x28 - u8 unkn_0x31; // Offset 0x31 - u8 unkn_0x33; // Offset 0x33 - u8 charType; // Field assumed at offset 0x39 - u8 bidiLevel; // Field assumed at offset 0x3B stores the Bidi level - u8 formatFlags; // Field at offset 0x3D (stores format-related flags) -}; - -struct OrbisFontRenderSurface { - void* buffer; - s32 widthByte; - s8 pixelSizeByte; - u8 unkn_0xd; - u8 styleFlag; - u8 unkn_0xf; - s32 width, height; - u32 sc_x0; - u32 sc_y0; - u32 sc_x1; - u32 sc_y1; - void* unkn_28[3]; -}; - -struct OrbisFontStyleFrame { - /*0x00*/ u16 magic; // Expected to be 0xF09 - /*0x02*/ u16 flags; - /*0x04*/ s32 dpiX; // DPI scaling factor for width - /*0x08*/ s32 dpiY; // DPI scaling factor for height - /*0x0c*/ s32 scalingFlag; // Indicates whether scaling is enabled - /*0x10*/ - /*0x14*/ float scaleWidth; // Width scaling factor - /*0x18*/ float scaleHeight; // Height scaling factor - /*0x1c*/ float weightXScale; - /*0x20*/ float weightYScale; - /*0x24*/ float slantRatio; -}; - -s32 PS4_SYSV_ABI sceFontAttachDeviceCacheBuffer(); -s32 PS4_SYSV_ABI sceFontBindRenderer(); -s32 PS4_SYSV_ABI sceFontCharacterGetBidiLevel(OrbisFontTextCharacter* textCharacter, - int* bidiLevel); -s32 PS4_SYSV_ABI sceFontCharacterGetSyllableStringState(); -s32 PS4_SYSV_ABI sceFontCharacterGetTextFontCode(); -s32 PS4_SYSV_ABI sceFontCharacterGetTextOrder(OrbisFontTextCharacter* textCharacter, - void** pTextOrder); -u32 PS4_SYSV_ABI sceFontCharacterLooksFormatCharacters(OrbisFontTextCharacter* textCharacter); -u32 PS4_SYSV_ABI sceFontCharacterLooksWhiteSpace(OrbisFontTextCharacter* textCharacter); -OrbisFontTextCharacter* PS4_SYSV_ABI -sceFontCharacterRefersTextBack(OrbisFontTextCharacter* textCharacter); -OrbisFontTextCharacter* PS4_SYSV_ABI -sceFontCharacterRefersTextNext(OrbisFontTextCharacter* textCharacter); -s32 PS4_SYSV_ABI sceFontCharactersRefersTextCodes(); -s32 PS4_SYSV_ABI sceFontClearDeviceCache(); -s32 PS4_SYSV_ABI sceFontCloseFont(); -s32 PS4_SYSV_ABI sceFontControl(); -s32 PS4_SYSV_ABI sceFontCreateGraphicsDevice(); -s32 PS4_SYSV_ABI sceFontCreateGraphicsService(); -s32 PS4_SYSV_ABI sceFontCreateGraphicsServiceWithEdition(); -s32 PS4_SYSV_ABI sceFontCreateLibrary(); -s32 PS4_SYSV_ABI sceFontCreateLibraryWithEdition(); -s32 PS4_SYSV_ABI sceFontCreateRenderer(); -s32 PS4_SYSV_ABI sceFontCreateRendererWithEdition(); -s32 PS4_SYSV_ABI sceFontCreateString(); -s32 PS4_SYSV_ABI sceFontCreateWords(); -s32 PS4_SYSV_ABI sceFontCreateWritingLine(); -s32 PS4_SYSV_ABI sceFontDefineAttribute(); -s32 PS4_SYSV_ABI sceFontDeleteGlyph(); -s32 PS4_SYSV_ABI sceFontDestroyGraphicsDevice(); -s32 PS4_SYSV_ABI sceFontDestroyGraphicsService(); -s32 PS4_SYSV_ABI sceFontDestroyLibrary(); -s32 PS4_SYSV_ABI sceFontDestroyRenderer(); -s32 PS4_SYSV_ABI sceFontDestroyString(); -s32 PS4_SYSV_ABI sceFontDestroyWords(); -s32 PS4_SYSV_ABI sceFontDestroyWritingLine(); -s32 PS4_SYSV_ABI sceFontDettachDeviceCacheBuffer(); -s32 PS4_SYSV_ABI sceFontGenerateCharGlyph(); -s32 PS4_SYSV_ABI sceFontGetAttribute(); -s32 PS4_SYSV_ABI sceFontGetCharGlyphCode(); -s32 PS4_SYSV_ABI sceFontGetCharGlyphMetrics(); -s32 PS4_SYSV_ABI sceFontGetEffectSlant(); -s32 PS4_SYSV_ABI sceFontGetEffectWeight(); -s32 PS4_SYSV_ABI sceFontGetFontGlyphsCount(); -s32 PS4_SYSV_ABI sceFontGetFontGlyphsOutlineProfile(); -s32 PS4_SYSV_ABI sceFontGetFontMetrics(); -s32 PS4_SYSV_ABI sceFontGetFontResolution(); -s32 PS4_SYSV_ABI sceFontGetFontStyleInformation(); -s32 PS4_SYSV_ABI sceFontGetGlyphExpandBufferState(); -s32 PS4_SYSV_ABI sceFontGetHorizontalLayout(); -s32 PS4_SYSV_ABI sceFontGetKerning(); -s32 PS4_SYSV_ABI sceFontGetLibrary(); -s32 PS4_SYSV_ABI sceFontGetPixelResolution(); -s32 PS4_SYSV_ABI sceFontGetRenderCharGlyphMetrics(); -s32 PS4_SYSV_ABI sceFontGetRenderEffectSlant(); -s32 PS4_SYSV_ABI sceFontGetRenderEffectWeight(); -s32 PS4_SYSV_ABI sceFontGetRenderScaledKerning(); -s32 PS4_SYSV_ABI sceFontGetRenderScalePixel(); -s32 PS4_SYSV_ABI sceFontGetRenderScalePoint(); -s32 PS4_SYSV_ABI sceFontGetResolutionDpi(); -s32 PS4_SYSV_ABI sceFontGetScalePixel(); -s32 PS4_SYSV_ABI sceFontGetScalePoint(); -s32 PS4_SYSV_ABI sceFontGetScriptLanguage(); -s32 PS4_SYSV_ABI sceFontGetTypographicDesign(); -s32 PS4_SYSV_ABI sceFontGetVerticalLayout(); -s32 PS4_SYSV_ABI sceFontGlyphDefineAttribute(); -s32 PS4_SYSV_ABI sceFontGlyphGetAttribute(); -s32 PS4_SYSV_ABI sceFontGlyphGetGlyphForm(); -s32 PS4_SYSV_ABI sceFontGlyphGetMetricsForm(); -s32 PS4_SYSV_ABI sceFontGlyphGetScalePixel(); -s32 PS4_SYSV_ABI sceFontGlyphRefersMetrics(); -s32 PS4_SYSV_ABI sceFontGlyphRefersMetricsHorizontal(); -s32 PS4_SYSV_ABI sceFontGlyphRefersMetricsHorizontalAdvance(); -s32 PS4_SYSV_ABI sceFontGlyphRefersMetricsHorizontalX(); -s32 PS4_SYSV_ABI sceFontGlyphRefersOutline(); -s32 PS4_SYSV_ABI sceFontGlyphRenderImage(); -s32 PS4_SYSV_ABI sceFontGlyphRenderImageHorizontal(); -s32 PS4_SYSV_ABI sceFontGlyphRenderImageVertical(); -s32 PS4_SYSV_ABI sceFontGraphicsBeginFrame(); -s32 PS4_SYSV_ABI sceFontGraphicsDrawingCancel(); -s32 PS4_SYSV_ABI sceFontGraphicsDrawingFinish(); -s32 PS4_SYSV_ABI sceFontGraphicsEndFrame(); -s32 PS4_SYSV_ABI sceFontGraphicsExchangeResource(); -s32 PS4_SYSV_ABI sceFontGraphicsFillMethodInit(); -s32 PS4_SYSV_ABI sceFontGraphicsFillPlotInit(); -s32 PS4_SYSV_ABI sceFontGraphicsFillPlotSetLayout(); -s32 PS4_SYSV_ABI sceFontGraphicsFillPlotSetMapping(); -s32 PS4_SYSV_ABI sceFontGraphicsFillRatesInit(); -s32 PS4_SYSV_ABI sceFontGraphicsFillRatesSetFillEffect(); -s32 PS4_SYSV_ABI sceFontGraphicsFillRatesSetLayout(); -s32 PS4_SYSV_ABI sceFontGraphicsFillRatesSetMapping(); -s32 PS4_SYSV_ABI sceFontGraphicsGetDeviceUsage(); -s32 PS4_SYSV_ABI sceFontGraphicsRegionInit(); -s32 PS4_SYSV_ABI sceFontGraphicsRegionInitCircular(); -s32 PS4_SYSV_ABI sceFontGraphicsRegionInitRoundish(); -s32 PS4_SYSV_ABI sceFontGraphicsRelease(); -s32 PS4_SYSV_ABI sceFontGraphicsRenderResource(); -s32 PS4_SYSV_ABI sceFontGraphicsSetFramePolicy(); -s32 PS4_SYSV_ABI sceFontGraphicsSetupClipping(); -s32 PS4_SYSV_ABI sceFontGraphicsSetupColorRates(); -s32 PS4_SYSV_ABI sceFontGraphicsSetupFillMethod(); -s32 PS4_SYSV_ABI sceFontGraphicsSetupFillRates(); -s32 PS4_SYSV_ABI sceFontGraphicsSetupGlyphFill(); -s32 PS4_SYSV_ABI sceFontGraphicsSetupGlyphFillPlot(); -s32 PS4_SYSV_ABI sceFontGraphicsSetupHandleDefault(); -s32 PS4_SYSV_ABI sceFontGraphicsSetupLocation(); -s32 PS4_SYSV_ABI sceFontGraphicsSetupPositioning(); -s32 PS4_SYSV_ABI sceFontGraphicsSetupRotation(); -s32 PS4_SYSV_ABI sceFontGraphicsSetupScaling(); -s32 PS4_SYSV_ABI sceFontGraphicsSetupShapeFill(); -s32 PS4_SYSV_ABI sceFontGraphicsSetupShapeFillPlot(); -s32 PS4_SYSV_ABI sceFontGraphicsStructureCanvas(); -s32 PS4_SYSV_ABI sceFontGraphicsStructureCanvasSequence(); -s32 PS4_SYSV_ABI sceFontGraphicsStructureDesign(); -s32 PS4_SYSV_ABI sceFontGraphicsStructureDesignResource(); -s32 PS4_SYSV_ABI sceFontGraphicsStructureSurfaceTexture(); -s32 PS4_SYSV_ABI sceFontGraphicsUpdateClipping(); -s32 PS4_SYSV_ABI sceFontGraphicsUpdateColorRates(); -s32 PS4_SYSV_ABI sceFontGraphicsUpdateFillMethod(); -s32 PS4_SYSV_ABI sceFontGraphicsUpdateFillRates(); -s32 PS4_SYSV_ABI sceFontGraphicsUpdateGlyphFill(); -s32 PS4_SYSV_ABI sceFontGraphicsUpdateGlyphFillPlot(); -s32 PS4_SYSV_ABI sceFontGraphicsUpdateLocation(); -s32 PS4_SYSV_ABI sceFontGraphicsUpdatePositioning(); -s32 PS4_SYSV_ABI sceFontGraphicsUpdateRotation(); -s32 PS4_SYSV_ABI sceFontGraphicsUpdateScaling(); -s32 PS4_SYSV_ABI sceFontGraphicsUpdateShapeFill(); -s32 PS4_SYSV_ABI sceFontGraphicsUpdateShapeFillPlot(); -s32 PS4_SYSV_ABI sceFontMemoryInit(); -s32 PS4_SYSV_ABI sceFontMemoryTerm(); -s32 PS4_SYSV_ABI sceFontOpenFontFile(); -s32 PS4_SYSV_ABI sceFontOpenFontInstance(); -s32 PS4_SYSV_ABI sceFontOpenFontMemory(); -s32 PS4_SYSV_ABI sceFontOpenFontSet(); -s32 PS4_SYSV_ABI sceFontRebindRenderer(); -s32 PS4_SYSV_ABI sceFontRenderCharGlyphImage(); -s32 PS4_SYSV_ABI sceFontRenderCharGlyphImageHorizontal(); -s32 PS4_SYSV_ABI sceFontRenderCharGlyphImageVertical(); -s32 PS4_SYSV_ABI sceFontRendererGetOutlineBufferSize(); -s32 PS4_SYSV_ABI sceFontRendererResetOutlineBuffer(); -s32 PS4_SYSV_ABI sceFontRendererSetOutlineBufferPolicy(); -void PS4_SYSV_ABI sceFontRenderSurfaceInit(OrbisFontRenderSurface* renderSurface, void* buffer, - int bufWidthByte, int pixelSizeByte, int widthPixel, - int heightPixel); -void PS4_SYSV_ABI sceFontRenderSurfaceSetScissor(OrbisFontRenderSurface* renderSurface, int x0, - int y0, int w, int h); -s32 PS4_SYSV_ABI sceFontRenderSurfaceSetStyleFrame(OrbisFontRenderSurface* renderSurface, - OrbisFontStyleFrame* styleFrame); -s32 PS4_SYSV_ABI sceFontSetEffectSlant(); -s32 PS4_SYSV_ABI sceFontSetEffectWeight(); -s32 PS4_SYSV_ABI sceFontSetFontsOpenMode(); -s32 PS4_SYSV_ABI sceFontSetResolutionDpi(); -s32 PS4_SYSV_ABI sceFontSetScalePixel(); -s32 PS4_SYSV_ABI sceFontSetScalePoint(); -s32 PS4_SYSV_ABI sceFontSetScriptLanguage(); -s32 PS4_SYSV_ABI sceFontSetTypographicDesign(); -s32 PS4_SYSV_ABI sceFontSetupRenderEffectSlant(); -s32 PS4_SYSV_ABI sceFontSetupRenderEffectWeight(); -s32 PS4_SYSV_ABI sceFontSetupRenderScalePixel(); -s32 PS4_SYSV_ABI sceFontSetupRenderScalePoint(); -s32 PS4_SYSV_ABI sceFontStringGetTerminateCode(); -s32 PS4_SYSV_ABI sceFontStringGetTerminateOrder(); -s32 PS4_SYSV_ABI sceFontStringGetWritingForm(); -s32 PS4_SYSV_ABI sceFontStringRefersRenderCharacters(); -s32 PS4_SYSV_ABI sceFontStringRefersTextCharacters(); -s32 PS4_SYSV_ABI sceFontStyleFrameGetEffectSlant(OrbisFontStyleFrame* styleFrame, - float* slantRatio); -s32 PS4_SYSV_ABI sceFontStyleFrameGetEffectWeight(OrbisFontStyleFrame* fontStyleFrame, - float* weightXScale, float* weightYScale, - uint32_t* mode); -s32 PS4_SYSV_ABI sceFontStyleFrameGetResolutionDpi(); -s32 PS4_SYSV_ABI sceFontStyleFrameGetScalePixel(OrbisFontStyleFrame* styleFrame, float* w, - float* h); -s32 PS4_SYSV_ABI sceFontStyleFrameGetScalePoint(); -s32 PS4_SYSV_ABI sceFontStyleFrameInit(); -s32 PS4_SYSV_ABI sceFontStyleFrameSetEffectSlant(); -s32 PS4_SYSV_ABI sceFontStyleFrameSetEffectWeight(); -s32 PS4_SYSV_ABI sceFontStyleFrameSetResolutionDpi(); -s32 PS4_SYSV_ABI sceFontStyleFrameSetScalePixel(); -s32 PS4_SYSV_ABI sceFontStyleFrameSetScalePoint(); -s32 PS4_SYSV_ABI sceFontStyleFrameUnsetEffectSlant(); -s32 PS4_SYSV_ABI sceFontStyleFrameUnsetEffectWeight(); -s32 PS4_SYSV_ABI sceFontStyleFrameUnsetScale(); -s32 PS4_SYSV_ABI sceFontSupportExternalFonts(); -s32 PS4_SYSV_ABI sceFontSupportGlyphs(); -s32 PS4_SYSV_ABI sceFontSupportSystemFonts(); -s32 PS4_SYSV_ABI sceFontTextCodesStepBack(); -s32 PS4_SYSV_ABI sceFontTextCodesStepNext(); -s32 PS4_SYSV_ABI sceFontTextSourceInit(); -s32 PS4_SYSV_ABI sceFontTextSourceRewind(); -s32 PS4_SYSV_ABI sceFontTextSourceSetDefaultFont(); -s32 PS4_SYSV_ABI sceFontTextSourceSetWritingForm(); -s32 PS4_SYSV_ABI sceFontUnbindRenderer(); -s32 PS4_SYSV_ABI sceFontWordsFindWordCharacters(); -s32 PS4_SYSV_ABI sceFontWritingGetRenderMetrics(); -s32 PS4_SYSV_ABI sceFontWritingInit(); -s32 PS4_SYSV_ABI sceFontWritingLineClear(); -s32 PS4_SYSV_ABI sceFontWritingLineGetOrderingSpace(); -s32 PS4_SYSV_ABI sceFontWritingLineGetRenderMetrics(); -s32 PS4_SYSV_ABI sceFontWritingLineRefersRenderStep(); -s32 PS4_SYSV_ABI sceFontWritingLineWritesOrder(); -s32 PS4_SYSV_ABI sceFontWritingRefersRenderStep(); -s32 PS4_SYSV_ABI sceFontWritingRefersRenderStepCharacter(); -s32 PS4_SYSV_ABI sceFontWritingSetMaskInvisible(); -s32 PS4_SYSV_ABI Func_00F4D778F1C88CB3(); -s32 PS4_SYSV_ABI Func_03C650025FBB0DE7(); -s32 PS4_SYSV_ABI Func_07EAB8A163B27E1A(); -s32 PS4_SYSV_ABI Func_09408E88E4F97CE3(); -s32 PS4_SYSV_ABI Func_09F92905ED82A814(); -s32 PS4_SYSV_ABI Func_0D142CEE1AB21ABE(); -s32 PS4_SYSV_ABI Func_14BD2E9E119C16F2(); -s32 PS4_SYSV_ABI Func_1AC53C9EDEAE8D75(); -s32 PS4_SYSV_ABI Func_1D401185D5E24C3D(); -s32 PS4_SYSV_ABI Func_1E83CD20C2CC996F(); -s32 PS4_SYSV_ABI Func_314B1F765B9FE78A(); -s32 PS4_SYSV_ABI Func_350E6725FEDE29E1(); -s32 PS4_SYSV_ABI Func_3DB773F0A604BF39(); -s32 PS4_SYSV_ABI Func_4FF49DD21E311B1C(); -s32 PS4_SYSV_ABI Func_526287664A493981(); -s32 PS4_SYSV_ABI Func_55CA718DBC84A6E9(); -s32 PS4_SYSV_ABI Func_563FC5F0706A8B4D(); -s32 PS4_SYSV_ABI Func_569E2ECD34290F45(); -s32 PS4_SYSV_ABI Func_5A04775B6BE47685(); -s32 PS4_SYSV_ABI Func_5FD93BCAB6F79750(); -s32 PS4_SYSV_ABI Func_62B5398F864BD3B4(); -s32 PS4_SYSV_ABI Func_6F9010294D822367(); -s32 PS4_SYSV_ABI Func_7757E947423A7A67(); -s32 PS4_SYSV_ABI Func_7E06BA52077F54FA(); -s32 PS4_SYSV_ABI Func_93B36DEA021311D6(); -s32 PS4_SYSV_ABI Func_94B0891E7111598A(); -s32 PS4_SYSV_ABI Func_9785C9128C2FE7CD(); -s32 PS4_SYSV_ABI Func_97DFBC9B65FBC0E1(); -s32 PS4_SYSV_ABI Func_ACD9717405D7D3CA(); -s32 PS4_SYSV_ABI Func_B19A8AEC3FD4F16F(); -s32 PS4_SYSV_ABI Func_C10F488AD7CF103D(); -s32 PS4_SYSV_ABI Func_D0C8B5FF4A6826C7(); -s32 PS4_SYSV_ABI Func_E48D3CD01C342A33(); -s32 PS4_SYSV_ABI Func_EAC96B2186B71E14(); -s32 PS4_SYSV_ABI Func_FE4788A96EF46256(); -s32 PS4_SYSV_ABI Func_FE7E5AE95D3058F5(); - -void RegisterlibSceFont(Core::Loader::SymbolsResolver* sym); -} // namespace Libraries::Font \ No newline at end of file diff --git a/src/core/libraries/font/font_error.h b/src/core/libraries/font/font_error.h deleted file mode 100644 index 64e8fc6a7..000000000 --- a/src/core/libraries/font/font_error.h +++ /dev/null @@ -1,44 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "core/libraries/error_codes.h" - -constexpr int ORBIS_FONT_ERROR_FATAL = 0x80460001; -constexpr int ORBIS_FONT_ERROR_INVALID_PARAMETER = 0x80460002; -constexpr int ORBIS_FONT_ERROR_INVALID_MEMORY = 0x80460003; -constexpr int ORBIS_FONT_ERROR_INVALID_LIBRARY = 0x80460004; -constexpr int ORBIS_FONT_ERROR_INVALID_FONT_HANDLE = 0x80460005; -constexpr int ORBIS_FONT_ERROR_INVALID_GLYPH = 0x80460006; -constexpr int ORBIS_FONT_ERROR_INVALID_RENDERER = 0x80460007; -constexpr int ORBIS_FONT_ERROR_INVALID_TEXT_SOURCE = 0x80460008; -constexpr int ORBIS_FONT_ERROR_INVALID_STRING = 0x80460009; -constexpr int ORBIS_FONT_ERROR_INVALID_WRITING = 0x8046000A; -constexpr int ORBIS_FONT_ERROR_INVALID_WORDS = 0x8046000B; -constexpr int ORBIS_FONT_ERROR_ALLOCATION_FAILED = 0x80460010; -constexpr int ORBIS_FONT_ERROR_FS_OPEN_FAILED = 0x80460011; -constexpr int ORBIS_FONT_ERROR_NO_SUPPORT_LIBRARY = 0x80460018; -constexpr int ORBIS_FONT_ERROR_NO_SUPPORT_FORMAT = 0x80460019; -constexpr int ORBIS_FONT_ERROR_NO_SUPPORT_FUNCTION = 0x80460020; -constexpr int ORBIS_FONT_ERROR_ALREADY_SPECIFIED = 0x80460021; -constexpr int ORBIS_FONT_ERROR_ALREADY_ATTACHED = 0x80460022; -constexpr int ORBIS_FONT_ERROR_ALREADY_OPENED = 0x80460023; -constexpr int ORBIS_FONT_ERROR_NOT_ATTACHED_CACHE_BUFFER = 0x80460025; -constexpr int ORBIS_FONT_ERROR_NO_SUPPORT_FONTSET = 0x80460031; -constexpr int ORBIS_FONT_ERROR_FONT_OPEN_MAX = 0x80460033; -constexpr int ORBIS_FONT_ERROR_FONT_OPEN_FAILED = 0x80460036; -constexpr int ORBIS_FONT_ERROR_FONT_CLOSE_FAILED = 0x80460037; -constexpr int ORBIS_FONT_ERROR_NO_SUPPORT_TYPOGRAPHY = 0x80460040; -constexpr int ORBIS_FONT_ERROR_NO_SUPPORT_CODE = 0x80460041; -constexpr int ORBIS_FONT_ERROR_NO_SUPPORT_GLYPH = 0x80460042; -constexpr int ORBIS_FONT_ERROR_NO_SUPPORT_SCRIPT = 0x80460043; -constexpr int ORBIS_FONT_ERROR_NO_SUPPORT_LANGUAGE = 0x80460044; -constexpr int ORBIS_FONT_ERROR_NO_SUPPORT_SURFACE = 0x80460050; -constexpr int ORBIS_FONT_ERROR_UNSET_PARAMETER = 0x80460058; -constexpr int ORBIS_FONT_ERROR_FUNCTIONAL_LIMIT = 0x8046005C; -constexpr int ORBIS_FONT_ERROR_ALREADY_BOUND_RENDERER = 0x80460060; -constexpr int ORBIS_FONT_ERROR_NOT_BOUND_RENDERER = 0x80460061; -constexpr int ORBIS_FONT_ERROR_RENDERER_ALLOCATION_FAILED = 0x80460063; -constexpr int ORBIS_FONT_ERROR_RENDERER_ALLOCATION_LIMITED = 0x80460064; -constexpr int ORBIS_FONT_ERROR_RENDERER_RENDER_FAILED = 0x80460065; diff --git a/src/core/libraries/font/fontft.cpp b/src/core/libraries/font/fontft.cpp deleted file mode 100644 index 4a1dbb989..000000000 --- a/src/core/libraries/font/fontft.cpp +++ /dev/null @@ -1,140 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "common/logging/log.h" -#include "core/libraries/error_codes.h" -#include "core/libraries/font/fontft.h" -#include "core/libraries/libs.h" - -namespace Libraries::FontFt { - -s32 PS4_SYSV_ABI sceFontFtInitAliases() { - LOG_ERROR(Lib_FontFt, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontFtSetAliasFont() { - LOG_ERROR(Lib_FontFt, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontFtSetAliasPath() { - LOG_ERROR(Lib_FontFt, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontFtSupportBdf() { - LOG_ERROR(Lib_FontFt, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontFtSupportCid() { - LOG_ERROR(Lib_FontFt, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontFtSupportFontFormats() { - LOG_ERROR(Lib_FontFt, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontFtSupportOpenType() { - LOG_ERROR(Lib_FontFt, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontFtSupportOpenTypeOtf() { - LOG_ERROR(Lib_FontFt, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontFtSupportOpenTypeTtf() { - LOG_ERROR(Lib_FontFt, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontFtSupportPcf() { - LOG_ERROR(Lib_FontFt, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontFtSupportPfr() { - LOG_ERROR(Lib_FontFt, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontFtSupportSystemFonts() { - LOG_ERROR(Lib_FontFt, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontFtSupportTrueType() { - LOG_ERROR(Lib_FontFt, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontFtSupportTrueTypeGx() { - LOG_ERROR(Lib_FontFt, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontFtSupportType1() { - LOG_ERROR(Lib_FontFt, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontFtSupportType42() { - LOG_ERROR(Lib_FontFt, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontFtSupportWinFonts() { - LOG_ERROR(Lib_FontFt, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontFtTermAliases() { - LOG_ERROR(Lib_FontFt, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontSelectGlyphsFt() { - LOG_ERROR(Lib_FontFt, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontSelectLibraryFt() { - LOG_ERROR(Lib_FontFt, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceFontSelectRendererFt() { - LOG_ERROR(Lib_FontFt, "(STUBBED) called"); - return ORBIS_OK; -} - -void RegisterlibSceFontFt(Core::Loader::SymbolsResolver* sym) { - LIB_FUNCTION("e60aorDdpB8", "libSceFontFt", 1, "libSceFontFt", sceFontFtInitAliases); - LIB_FUNCTION("BxcmiMc3UaA", "libSceFontFt", 1, "libSceFontFt", sceFontFtSetAliasFont); - LIB_FUNCTION("MEWjebIzDEI", "libSceFontFt", 1, "libSceFontFt", sceFontFtSetAliasPath); - LIB_FUNCTION("ZcQL0iSjvFw", "libSceFontFt", 1, "libSceFontFt", sceFontFtSupportBdf); - LIB_FUNCTION("LADHEyFTxRQ", "libSceFontFt", 1, "libSceFontFt", sceFontFtSupportCid); - LIB_FUNCTION("+jqQjsancTs", "libSceFontFt", 1, "libSceFontFt", sceFontFtSupportFontFormats); - LIB_FUNCTION("oakL15-mBtc", "libSceFontFt", 1, "libSceFontFt", sceFontFtSupportOpenType); - LIB_FUNCTION("dcQeaDr8UJc", "libSceFontFt", 1, "libSceFontFt", sceFontFtSupportOpenTypeOtf); - LIB_FUNCTION("2KXS-HkZT3c", "libSceFontFt", 1, "libSceFontFt", sceFontFtSupportOpenTypeTtf); - LIB_FUNCTION("H0mJnhKwV-s", "libSceFontFt", 1, "libSceFontFt", sceFontFtSupportPcf); - LIB_FUNCTION("S2mw3sYplAI", "libSceFontFt", 1, "libSceFontFt", sceFontFtSupportPfr); - LIB_FUNCTION("+ehNXJPUyhk", "libSceFontFt", 1, "libSceFontFt", sceFontFtSupportSystemFonts); - LIB_FUNCTION("4BAhDLdrzUI", "libSceFontFt", 1, "libSceFontFt", sceFontFtSupportTrueType); - LIB_FUNCTION("Utlzbdf+g9o", "libSceFontFt", 1, "libSceFontFt", sceFontFtSupportTrueTypeGx); - LIB_FUNCTION("nAfQ6qaL1fU", "libSceFontFt", 1, "libSceFontFt", sceFontFtSupportType1); - LIB_FUNCTION("X9+pzrGtBus", "libSceFontFt", 1, "libSceFontFt", sceFontFtSupportType42); - LIB_FUNCTION("w0hI3xsK-hc", "libSceFontFt", 1, "libSceFontFt", sceFontFtSupportWinFonts); - LIB_FUNCTION("w5sfH9r8ZJ4", "libSceFontFt", 1, "libSceFontFt", sceFontFtTermAliases); - LIB_FUNCTION("ojW+VKl4Ehs", "libSceFontFt", 1, "libSceFontFt", sceFontSelectGlyphsFt); - LIB_FUNCTION("oM+XCzVG3oM", "libSceFontFt", 1, "libSceFontFt", sceFontSelectLibraryFt); - LIB_FUNCTION("Xx974EW-QFY", "libSceFontFt", 1, "libSceFontFt", sceFontSelectRendererFt); -}; - -} // namespace Libraries::FontFt \ No newline at end of file diff --git a/src/core/libraries/font/fontft.h b/src/core/libraries/font/fontft.h deleted file mode 100644 index cec6d7872..000000000 --- a/src/core/libraries/font/fontft.h +++ /dev/null @@ -1,37 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "common/types.h" - -namespace Core::Loader { -class SymbolsResolver; -} - -namespace Libraries::FontFt { - -s32 PS4_SYSV_ABI sceFontFtInitAliases(); -s32 PS4_SYSV_ABI sceFontFtSetAliasFont(); -s32 PS4_SYSV_ABI sceFontFtSetAliasPath(); -s32 PS4_SYSV_ABI sceFontFtSupportBdf(); -s32 PS4_SYSV_ABI sceFontFtSupportCid(); -s32 PS4_SYSV_ABI sceFontFtSupportFontFormats(); -s32 PS4_SYSV_ABI sceFontFtSupportOpenType(); -s32 PS4_SYSV_ABI sceFontFtSupportOpenTypeOtf(); -s32 PS4_SYSV_ABI sceFontFtSupportOpenTypeTtf(); -s32 PS4_SYSV_ABI sceFontFtSupportPcf(); -s32 PS4_SYSV_ABI sceFontFtSupportPfr(); -s32 PS4_SYSV_ABI sceFontFtSupportSystemFonts(); -s32 PS4_SYSV_ABI sceFontFtSupportTrueType(); -s32 PS4_SYSV_ABI sceFontFtSupportTrueTypeGx(); -s32 PS4_SYSV_ABI sceFontFtSupportType1(); -s32 PS4_SYSV_ABI sceFontFtSupportType42(); -s32 PS4_SYSV_ABI sceFontFtSupportWinFonts(); -s32 PS4_SYSV_ABI sceFontFtTermAliases(); -s32 PS4_SYSV_ABI sceFontSelectGlyphsFt(); -s32 PS4_SYSV_ABI sceFontSelectLibraryFt(); -s32 PS4_SYSV_ABI sceFontSelectRendererFt(); - -void RegisterlibSceFontFt(Core::Loader::SymbolsResolver* sym); -} // namespace Libraries::FontFt \ No newline at end of file diff --git a/src/core/libraries/game_live_streaming/gamelivestreaming.cpp b/src/core/libraries/game_live_streaming/gamelivestreaming.cpp deleted file mode 100644 index 374eb4c9d..000000000 --- a/src/core/libraries/game_live_streaming/gamelivestreaming.cpp +++ /dev/null @@ -1,354 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "gamelivestreaming.h" - -#include "common/logging/log.h" -#include "core/libraries/error_codes.h" -#include "core/libraries/libs.h" - -namespace Libraries::GameLiveStreaming { - -int PS4_SYSV_ABI sceGameLiveStreamingStartDebugBroadcast() { - LOG_ERROR(Lib_GameLiveStreaming, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceGameLiveStreamingStopDebugBroadcast() { - LOG_ERROR(Lib_GameLiveStreaming, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceGameLiveStreamingApplySocialFeedbackMessageFilter() { - LOG_ERROR(Lib_GameLiveStreaming, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceGameLiveStreamingCheckCallback() { - LOG_ERROR(Lib_GameLiveStreaming, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceGameLiveStreamingClearPresetSocialFeedbackCommands() { - LOG_ERROR(Lib_GameLiveStreaming, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceGameLiveStreamingClearSocialFeedbackMessages() { - LOG_ERROR(Lib_GameLiveStreaming, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceGameLiveStreamingClearSpoilerTag() { - LOG_ERROR(Lib_GameLiveStreaming, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceGameLiveStreamingEnableLiveStreaming() { - LOG_ERROR(Lib_GameLiveStreaming, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceGameLiveStreamingEnableSocialFeedback() { - LOG_ERROR(Lib_GameLiveStreaming, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceGameLiveStreamingGetCurrentBroadcastScreenLayout() { - LOG_ERROR(Lib_GameLiveStreaming, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceGameLiveStreamingGetCurrentStatus(OrbisGameLiveStreamingStatus* status) { - memset(status, 0, sizeof(*status)); - status->isOnAir = false; - LOG_DEBUG(Lib_GameLiveStreaming, "(STUBBED) called userid = {}", status->userId); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceGameLiveStreamingGetCurrentStatus2() { - LOG_ERROR(Lib_GameLiveStreaming, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceGameLiveStreamingGetProgramInfo() { - LOG_ERROR(Lib_GameLiveStreaming, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceGameLiveStreamingGetSocialFeedbackMessages() { - LOG_ERROR(Lib_GameLiveStreaming, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceGameLiveStreamingGetSocialFeedbackMessagesCount() { - LOG_ERROR(Lib_GameLiveStreaming, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceGameLiveStreamingInitialize() { - LOG_ERROR(Lib_GameLiveStreaming, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceGameLiveStreamingLaunchLiveViewer() { - LOG_ERROR(Lib_GameLiveStreaming, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceGameLiveStreamingLaunchLiveViewerA() { - LOG_ERROR(Lib_GameLiveStreaming, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceGameLiveStreamingPermitLiveStreaming() { - LOG_ERROR(Lib_GameLiveStreaming, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceGameLiveStreamingPermitServerSideRecording() { - LOG_ERROR(Lib_GameLiveStreaming, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceGameLiveStreamingPostSocialMessage() { - LOG_ERROR(Lib_GameLiveStreaming, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceGameLiveStreamingRegisterCallback() { - LOG_ERROR(Lib_GameLiveStreaming, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceGameLiveStreamingScreenCloseSeparateMode() { - LOG_ERROR(Lib_GameLiveStreaming, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceGameLiveStreamingScreenConfigureSeparateMode() { - LOG_ERROR(Lib_GameLiveStreaming, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceGameLiveStreamingScreenInitialize() { - LOG_ERROR(Lib_GameLiveStreaming, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceGameLiveStreamingScreenInitializeSeparateModeParameter() { - LOG_ERROR(Lib_GameLiveStreaming, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceGameLiveStreamingScreenOpenSeparateMode() { - LOG_ERROR(Lib_GameLiveStreaming, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceGameLiveStreamingScreenSetMode() { - LOG_ERROR(Lib_GameLiveStreaming, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceGameLiveStreamingScreenTerminate() { - LOG_ERROR(Lib_GameLiveStreaming, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceGameLiveStreamingSetCameraFrameSetting() { - LOG_ERROR(Lib_GameLiveStreaming, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceGameLiveStreamingSetDefaultServiceProviderPermission() { - LOG_ERROR(Lib_GameLiveStreaming, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceGameLiveStreamingSetGuardAreas() { - LOG_ERROR(Lib_GameLiveStreaming, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceGameLiveStreamingSetInvitationSessionId() { - LOG_ERROR(Lib_GameLiveStreaming, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceGameLiveStreamingSetLinkCommentPreset() { - LOG_ERROR(Lib_GameLiveStreaming, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceGameLiveStreamingSetMaxBitrate() { - LOG_ERROR(Lib_GameLiveStreaming, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceGameLiveStreamingSetMetadata() { - LOG_ERROR(Lib_GameLiveStreaming, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceGameLiveStreamingSetPresetSocialFeedbackCommands() { - LOG_ERROR(Lib_GameLiveStreaming, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceGameLiveStreamingSetPresetSocialFeedbackCommandsDescription() { - LOG_ERROR(Lib_GameLiveStreaming, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceGameLiveStreamingSetServiceProviderPermission() { - LOG_ERROR(Lib_GameLiveStreaming, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceGameLiveStreamingSetSpoilerTag() { - LOG_ERROR(Lib_GameLiveStreaming, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceGameLiveStreamingSetStandbyScreenResource() { - LOG_ERROR(Lib_GameLiveStreaming, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceGameLiveStreamingStartGenerateStandbyScreenResource() { - LOG_ERROR(Lib_GameLiveStreaming, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceGameLiveStreamingStartSocialFeedbackMessageFiltering() { - LOG_ERROR(Lib_GameLiveStreaming, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceGameLiveStreamingStopGenerateStandbyScreenResource() { - LOG_ERROR(Lib_GameLiveStreaming, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceGameLiveStreamingStopSocialFeedbackMessageFiltering() { - LOG_ERROR(Lib_GameLiveStreaming, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceGameLiveStreamingTerminate() { - LOG_ERROR(Lib_GameLiveStreaming, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceGameLiveStreamingUnregisterCallback() { - LOG_ERROR(Lib_GameLiveStreaming, "(STUBBED) called"); - return ORBIS_OK; -} - -void RegisterLib(Core::Loader::SymbolsResolver* sym) { - LIB_FUNCTION("caqgDl+V9qA", "libSceGameLiveStreaming_debug", 1, "libSceGameLiveStreaming", - sceGameLiveStreamingStartDebugBroadcast); - LIB_FUNCTION("0i8Lrllxwow", "libSceGameLiveStreaming_debug", 1, "libSceGameLiveStreaming", - sceGameLiveStreamingStopDebugBroadcast); - LIB_FUNCTION("NqkTzemliC0", "libSceGameLiveStreaming", 1, "libSceGameLiveStreaming", - sceGameLiveStreamingApplySocialFeedbackMessageFilter); - LIB_FUNCTION("PC4jq87+YQI", "libSceGameLiveStreaming", 1, "libSceGameLiveStreaming", - sceGameLiveStreamingCheckCallback); - LIB_FUNCTION("FcHBfHjFXkA", "libSceGameLiveStreaming", 1, "libSceGameLiveStreaming", - sceGameLiveStreamingClearPresetSocialFeedbackCommands); - LIB_FUNCTION("lZ2Sd0uEvpo", "libSceGameLiveStreaming", 1, "libSceGameLiveStreaming", - sceGameLiveStreamingClearSocialFeedbackMessages); - LIB_FUNCTION("6c2zGtThFww", "libSceGameLiveStreaming", 1, "libSceGameLiveStreaming", - sceGameLiveStreamingClearSpoilerTag); - LIB_FUNCTION("dWM80AX39o4", "libSceGameLiveStreaming", 1, "libSceGameLiveStreaming", - sceGameLiveStreamingEnableLiveStreaming); - LIB_FUNCTION("wBOQWjbWMfU", "libSceGameLiveStreaming", 1, "libSceGameLiveStreaming", - sceGameLiveStreamingEnableSocialFeedback); - LIB_FUNCTION("aRSQNqbats4", "libSceGameLiveStreaming", 1, "libSceGameLiveStreaming", - sceGameLiveStreamingGetCurrentBroadcastScreenLayout); - LIB_FUNCTION("CoPMx369EqM", "libSceGameLiveStreaming", 1, "libSceGameLiveStreaming", - sceGameLiveStreamingGetCurrentStatus); - LIB_FUNCTION("lK8dLBNp9OE", "libSceGameLiveStreaming", 1, "libSceGameLiveStreaming", - sceGameLiveStreamingGetCurrentStatus2); - LIB_FUNCTION("OIIm19xu+NM", "libSceGameLiveStreaming", 1, "libSceGameLiveStreaming", - sceGameLiveStreamingGetProgramInfo); - LIB_FUNCTION("PMx7N4WqNdo", "libSceGameLiveStreaming", 1, "libSceGameLiveStreaming", - sceGameLiveStreamingGetSocialFeedbackMessages); - LIB_FUNCTION("yeQKjHETi40", "libSceGameLiveStreaming", 1, "libSceGameLiveStreaming", - sceGameLiveStreamingGetSocialFeedbackMessagesCount); - LIB_FUNCTION("kvYEw2lBndk", "libSceGameLiveStreaming", 1, "libSceGameLiveStreaming", - sceGameLiveStreamingInitialize); - LIB_FUNCTION("ysWfX5PPbfc", "libSceGameLiveStreaming", 1, "libSceGameLiveStreaming", - sceGameLiveStreamingLaunchLiveViewer); - LIB_FUNCTION("cvRCb7DTAig", "libSceGameLiveStreaming", 1, "libSceGameLiveStreaming", - sceGameLiveStreamingLaunchLiveViewerA); - LIB_FUNCTION("K0QxEbD7q+c", "libSceGameLiveStreaming", 1, "libSceGameLiveStreaming", - sceGameLiveStreamingPermitLiveStreaming); - LIB_FUNCTION("-EHnU68gExU", "libSceGameLiveStreaming", 1, "libSceGameLiveStreaming", - sceGameLiveStreamingPermitServerSideRecording); - LIB_FUNCTION("hggKhPySVgI", "libSceGameLiveStreaming", 1, "libSceGameLiveStreaming", - sceGameLiveStreamingPostSocialMessage); - LIB_FUNCTION("nFP8qT9YXbo", "libSceGameLiveStreaming", 1, "libSceGameLiveStreaming", - sceGameLiveStreamingRegisterCallback); - LIB_FUNCTION("b5RaMD2J0So", "libSceGameLiveStreaming", 1, "libSceGameLiveStreaming", - sceGameLiveStreamingScreenCloseSeparateMode); - LIB_FUNCTION("hBdd8n6kuvE", "libSceGameLiveStreaming", 1, "libSceGameLiveStreaming", - sceGameLiveStreamingScreenConfigureSeparateMode); - LIB_FUNCTION("uhCmn81s-mU", "libSceGameLiveStreaming", 1, "libSceGameLiveStreaming", - sceGameLiveStreamingScreenInitialize); - LIB_FUNCTION("fo5B8RUaBxQ", "libSceGameLiveStreaming", 1, "libSceGameLiveStreaming", - sceGameLiveStreamingScreenInitializeSeparateModeParameter); - LIB_FUNCTION("iorzW0pKOiA", "libSceGameLiveStreaming", 1, "libSceGameLiveStreaming", - sceGameLiveStreamingScreenOpenSeparateMode); - LIB_FUNCTION("gDSvt78H3Oo", "libSceGameLiveStreaming", 1, "libSceGameLiveStreaming", - sceGameLiveStreamingScreenSetMode); - LIB_FUNCTION("HE93dr-5rx4", "libSceGameLiveStreaming", 1, "libSceGameLiveStreaming", - sceGameLiveStreamingScreenTerminate); - LIB_FUNCTION("3PSiwAzFISE", "libSceGameLiveStreaming", 1, "libSceGameLiveStreaming", - sceGameLiveStreamingSetCameraFrameSetting); - LIB_FUNCTION("TwuUzTKKeek", "libSceGameLiveStreaming", 1, "libSceGameLiveStreaming", - sceGameLiveStreamingSetDefaultServiceProviderPermission); - LIB_FUNCTION("Gw6S4oqlY7E", "libSceGameLiveStreaming", 1, "libSceGameLiveStreaming", - sceGameLiveStreamingSetGuardAreas); - LIB_FUNCTION("QmQYwQ7OTJI", "libSceGameLiveStreaming", 1, "libSceGameLiveStreaming", - sceGameLiveStreamingSetInvitationSessionId); - LIB_FUNCTION("Sb5bAXyUt5c", "libSceGameLiveStreaming", 1, "libSceGameLiveStreaming", - sceGameLiveStreamingSetLinkCommentPreset); - LIB_FUNCTION("q-kxuaF7URU", "libSceGameLiveStreaming", 1, "libSceGameLiveStreaming", - sceGameLiveStreamingSetMaxBitrate); - LIB_FUNCTION("hUY-mSOyGL0", "libSceGameLiveStreaming", 1, "libSceGameLiveStreaming", - sceGameLiveStreamingSetMetadata); - LIB_FUNCTION("ycodiP2I0xo", "libSceGameLiveStreaming", 1, "libSceGameLiveStreaming", - sceGameLiveStreamingSetPresetSocialFeedbackCommands); - LIB_FUNCTION("x6deXUpQbBo", "libSceGameLiveStreaming", 1, "libSceGameLiveStreaming", - sceGameLiveStreamingSetPresetSocialFeedbackCommandsDescription); - LIB_FUNCTION("mCoz3k3zPmA", "libSceGameLiveStreaming", 1, "libSceGameLiveStreaming", - sceGameLiveStreamingSetServiceProviderPermission); - LIB_FUNCTION("ZuX+zzz2DkA", "libSceGameLiveStreaming", 1, "libSceGameLiveStreaming", - sceGameLiveStreamingSetSpoilerTag); - LIB_FUNCTION("MLvYI86FFAo", "libSceGameLiveStreaming", 1, "libSceGameLiveStreaming", - sceGameLiveStreamingSetStandbyScreenResource); - LIB_FUNCTION("y0KkAydy9xE", "libSceGameLiveStreaming", 1, "libSceGameLiveStreaming", - sceGameLiveStreamingStartGenerateStandbyScreenResource); - LIB_FUNCTION("Y1WxX7dPMCw", "libSceGameLiveStreaming", 1, "libSceGameLiveStreaming", - sceGameLiveStreamingStartSocialFeedbackMessageFiltering); - LIB_FUNCTION("D7dg5QJ4FlE", "libSceGameLiveStreaming", 1, "libSceGameLiveStreaming", - sceGameLiveStreamingStopGenerateStandbyScreenResource); - LIB_FUNCTION("bYuGUBuIsaY", "libSceGameLiveStreaming", 1, "libSceGameLiveStreaming", - sceGameLiveStreamingStopSocialFeedbackMessageFiltering); - LIB_FUNCTION("9yK6Fk8mKOQ", "libSceGameLiveStreaming", 1, "libSceGameLiveStreaming", - sceGameLiveStreamingTerminate); - LIB_FUNCTION("5XHaH3kL+bA", "libSceGameLiveStreaming", 1, "libSceGameLiveStreaming", - sceGameLiveStreamingUnregisterCallback); - LIB_FUNCTION("caqgDl+V9qA", "libSceGameLiveStreaming_direct_streaming", 1, - "libSceGameLiveStreaming", sceGameLiveStreamingStartDebugBroadcast); - LIB_FUNCTION("0i8Lrllxwow", "libSceGameLiveStreaming_direct_streaming", 1, - "libSceGameLiveStreaming", sceGameLiveStreamingStopDebugBroadcast); - LIB_FUNCTION("CoPMx369EqM", "libSceGameLiveStreamingCompat", 1, "libSceGameLiveStreaming", - sceGameLiveStreamingGetCurrentStatus); - LIB_FUNCTION("ysWfX5PPbfc", "libSceGameLiveStreamingCompat", 1, "libSceGameLiveStreaming", - sceGameLiveStreamingLaunchLiveViewer); -}; - -} // namespace Libraries::GameLiveStreaming \ No newline at end of file diff --git a/src/core/libraries/game_live_streaming/gamelivestreaming.h b/src/core/libraries/game_live_streaming/gamelivestreaming.h deleted file mode 100644 index 5ceee8ff5..000000000 --- a/src/core/libraries/game_live_streaming/gamelivestreaming.h +++ /dev/null @@ -1,82 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "common/types.h" -#include "core/libraries/system/userservice.h" - -namespace Core::Loader { -class SymbolsResolver; -} - -namespace Libraries::GameLiveStreaming { - -struct OrbisGameLiveStreamingStatus { - bool isOnAir; - u8 align[3]; - u32 spectatorCounts; - Libraries::UserService::OrbisUserServiceUserId userId; - u8 reserved[60]; -}; -struct OrbisGameLiveStreamingStatus2 { - Libraries::UserService::OrbisUserServiceUserId userId; - bool isOnAir; - u8 align[3]; - u32 spectatorCounts; - u32 textMessageCounts; - u32 commandMessageCounts; - u32 broadcastVideoResolution; - u8 reserved[48]; -}; - -int PS4_SYSV_ABI sceGameLiveStreamingStartDebugBroadcast(); -int PS4_SYSV_ABI sceGameLiveStreamingStopDebugBroadcast(); -int PS4_SYSV_ABI sceGameLiveStreamingApplySocialFeedbackMessageFilter(); -int PS4_SYSV_ABI sceGameLiveStreamingCheckCallback(); -int PS4_SYSV_ABI sceGameLiveStreamingClearPresetSocialFeedbackCommands(); -int PS4_SYSV_ABI sceGameLiveStreamingClearSocialFeedbackMessages(); -int PS4_SYSV_ABI sceGameLiveStreamingClearSpoilerTag(); -int PS4_SYSV_ABI sceGameLiveStreamingEnableLiveStreaming(); -int PS4_SYSV_ABI sceGameLiveStreamingEnableSocialFeedback(); -int PS4_SYSV_ABI sceGameLiveStreamingGetCurrentBroadcastScreenLayout(); -int PS4_SYSV_ABI sceGameLiveStreamingGetCurrentStatus(OrbisGameLiveStreamingStatus* status); -int PS4_SYSV_ABI sceGameLiveStreamingGetCurrentStatus2(); -int PS4_SYSV_ABI sceGameLiveStreamingGetProgramInfo(); -int PS4_SYSV_ABI sceGameLiveStreamingGetSocialFeedbackMessages(); -int PS4_SYSV_ABI sceGameLiveStreamingGetSocialFeedbackMessagesCount(); -int PS4_SYSV_ABI sceGameLiveStreamingInitialize(); -int PS4_SYSV_ABI sceGameLiveStreamingLaunchLiveViewer(); -int PS4_SYSV_ABI sceGameLiveStreamingLaunchLiveViewerA(); -int PS4_SYSV_ABI sceGameLiveStreamingPermitLiveStreaming(); -int PS4_SYSV_ABI sceGameLiveStreamingPermitServerSideRecording(); -int PS4_SYSV_ABI sceGameLiveStreamingPostSocialMessage(); -int PS4_SYSV_ABI sceGameLiveStreamingRegisterCallback(); -int PS4_SYSV_ABI sceGameLiveStreamingScreenCloseSeparateMode(); -int PS4_SYSV_ABI sceGameLiveStreamingScreenConfigureSeparateMode(); -int PS4_SYSV_ABI sceGameLiveStreamingScreenInitialize(); -int PS4_SYSV_ABI sceGameLiveStreamingScreenInitializeSeparateModeParameter(); -int PS4_SYSV_ABI sceGameLiveStreamingScreenOpenSeparateMode(); -int PS4_SYSV_ABI sceGameLiveStreamingScreenSetMode(); -int PS4_SYSV_ABI sceGameLiveStreamingScreenTerminate(); -int PS4_SYSV_ABI sceGameLiveStreamingSetCameraFrameSetting(); -int PS4_SYSV_ABI sceGameLiveStreamingSetDefaultServiceProviderPermission(); -int PS4_SYSV_ABI sceGameLiveStreamingSetGuardAreas(); -int PS4_SYSV_ABI sceGameLiveStreamingSetInvitationSessionId(); -int PS4_SYSV_ABI sceGameLiveStreamingSetLinkCommentPreset(); -int PS4_SYSV_ABI sceGameLiveStreamingSetMaxBitrate(); -int PS4_SYSV_ABI sceGameLiveStreamingSetMetadata(); -int PS4_SYSV_ABI sceGameLiveStreamingSetPresetSocialFeedbackCommands(); -int PS4_SYSV_ABI sceGameLiveStreamingSetPresetSocialFeedbackCommandsDescription(); -int PS4_SYSV_ABI sceGameLiveStreamingSetServiceProviderPermission(); -int PS4_SYSV_ABI sceGameLiveStreamingSetSpoilerTag(); -int PS4_SYSV_ABI sceGameLiveStreamingSetStandbyScreenResource(); -int PS4_SYSV_ABI sceGameLiveStreamingStartGenerateStandbyScreenResource(); -int PS4_SYSV_ABI sceGameLiveStreamingStartSocialFeedbackMessageFiltering(); -int PS4_SYSV_ABI sceGameLiveStreamingStopGenerateStandbyScreenResource(); -int PS4_SYSV_ABI sceGameLiveStreamingStopSocialFeedbackMessageFiltering(); -int PS4_SYSV_ABI sceGameLiveStreamingTerminate(); -int PS4_SYSV_ABI sceGameLiveStreamingUnregisterCallback(); - -void RegisterLib(Core::Loader::SymbolsResolver* sym); -} // namespace Libraries::GameLiveStreaming \ No newline at end of file diff --git a/src/core/libraries/gnmdriver/gnm_error.h b/src/core/libraries/gnmdriver/gnm_error.h index b8e57f6f5..323e3ea44 100644 --- a/src/core/libraries/gnmdriver/gnm_error.h +++ b/src/core/libraries/gnmdriver/gnm_error.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/gnmdriver/gnmdriver.cpp b/src/core/libraries/gnmdriver/gnmdriver.cpp index f8886e3ff..a2c22f242 100644 --- a/src/core/libraries/gnmdriver/gnmdriver.cpp +++ b/src/core/libraries/gnmdriver/gnmdriver.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "gnm_error.h" diff --git a/src/core/libraries/gnmdriver/gnmdriver.h b/src/core/libraries/gnmdriver/gnmdriver.h index 2208ca05d..92c1956c1 100644 --- a/src/core/libraries/gnmdriver/gnmdriver.h +++ b/src/core/libraries/gnmdriver/gnmdriver.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/gnmdriver/gnmdriver_init.h b/src/core/libraries/gnmdriver/gnmdriver_init.h index da6d65f32..356808f82 100644 --- a/src/core/libraries/gnmdriver/gnmdriver_init.h +++ b/src/core/libraries/gnmdriver/gnmdriver_init.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/hmd/hmd.cpp b/src/core/libraries/hmd/hmd.cpp deleted file mode 100644 index cddfc2ecc..000000000 --- a/src/core/libraries/hmd/hmd.cpp +++ /dev/null @@ -1,1029 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "common/elf_info.h" -#include "common/logging/log.h" -#include "core/libraries/error_codes.h" -#include "core/libraries/hmd/hmd.h" -#include "core/libraries/hmd/hmd_error.h" -#include "core/libraries/kernel/process.h" -#include "core/libraries/libs.h" - -namespace Libraries::Hmd { - -static bool g_library_initialized = false; -static s32 g_firmware_version = 0; -static s32 g_internal_handle = 0; -static Libraries::UserService::OrbisUserServiceUserId g_user_id = -1; - -s32 PS4_SYSV_ABI sceHmdInitialize(const OrbisHmdInitializeParam* param) { - if (g_library_initialized) { - return ORBIS_HMD_ERROR_ALREADY_INITIALIZED; - } - if (param == nullptr) { - return ORBIS_HMD_ERROR_PARAMETER_NULL; - } - LOG_WARNING(Lib_Hmd, "PSVR headsets are not supported yet"); - if (param->reserved0 != nullptr) { - sceHmdDistortionInitialize(param->reserved0); - } - g_library_initialized = true; - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInitialize315(const OrbisHmdInitializeParam* param) { - if (g_library_initialized) { - return ORBIS_HMD_ERROR_ALREADY_INITIALIZED; - } - if (param == nullptr) { - return ORBIS_HMD_ERROR_PARAMETER_NULL; - } - LOG_WARNING(Lib_Hmd, "PSVR headsets are not supported yet"); - g_library_initialized = true; - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdOpen(Libraries::UserService::OrbisUserServiceUserId user_id, s32 type, - s32 index, OrbisHmdOpenParam* param) { - LOG_DEBUG(Lib_Hmd, "called"); - if (!g_library_initialized) { - return ORBIS_HMD_ERROR_NOT_INITIALIZED; - } - if (type != 0 || index != 0 || param != nullptr) { - return ORBIS_HMD_ERROR_PARAMETER_INVALID; - } - if (g_internal_handle != 0) { - return ORBIS_HMD_ERROR_ALREADY_OPENED; - } - if (user_id == Libraries::UserService::ORBIS_USER_SERVICE_USER_ID_INVALID || - user_id == Libraries::UserService::ORBIS_USER_SERVICE_USER_ID_SYSTEM) { - return ORBIS_HMD_ERROR_PARAMETER_INVALID; - } - - // Return positive value representing handle. - // Internal libSceVrTracker logic requires this handle to be different from other devices. - g_user_id = user_id; - g_internal_handle = 0xf000000; - return g_internal_handle; -} - -s32 PS4_SYSV_ABI sceHmdGet2DEyeOffset(s32 handle, OrbisHmdEyeOffset* left_offset, - OrbisHmdEyeOffset* right_offset) { - LOG_DEBUG(Lib_Hmd, "called"); - if (!g_library_initialized) { - return ORBIS_HMD_ERROR_NOT_INITIALIZED; - } - if (handle != g_internal_handle) { - return ORBIS_HMD_ERROR_HANDLE_INVALID; - } - if (g_firmware_version >= Common::ElfInfo::FW_45) { - // Due to some faulty in-library checks, a missing headset results in this error - // instead of the expected ORBIS_HMD_ERROR_DEVICE_DISCONNECTED error. - return ORBIS_HMD_ERROR_HANDLE_INVALID; - } - if (left_offset == nullptr || right_offset == nullptr) { - return ORBIS_HMD_ERROR_PARAMETER_NULL; - } - - // Return default values - left_offset->offset_x = -0.0315; - left_offset->offset_y = 0; - left_offset->offset_z = 0; - right_offset->offset_x = 0.0315; - right_offset->offset_y = 0; - right_offset->offset_z = 0; - - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdGetAssyError(void* data) { - LOG_DEBUG(Lib_Hmd, "called"); - if (data == nullptr) { - return ORBIS_HMD_ERROR_PARAMETER_NULL; - } - if (!g_library_initialized) { - return ORBIS_HMD_ERROR_NOT_INITIALIZED; - } - - return ORBIS_HMD_ERROR_DEVICE_DISCONNECTED; -} - -s32 PS4_SYSV_ABI sceHmdGetDeviceInformation(OrbisHmdDeviceInformation* info) { - LOG_DEBUG(Lib_Hmd, "called"); - if (info == nullptr) { - return ORBIS_HMD_ERROR_PARAMETER_NULL; - } - if (!g_library_initialized) { - return ORBIS_HMD_ERROR_NOT_INITIALIZED; - } - - memset(info, 0, sizeof(OrbisHmdDeviceInformation)); - info->status = OrbisHmdDeviceStatus::ORBIS_HMD_DEVICE_STATUS_NOT_DETECTED; - info->user_id = g_user_id; - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdGetDeviceInformationByHandle(s32 handle, OrbisHmdDeviceInformation* info) { - LOG_DEBUG(Lib_Hmd, "called"); - if (handle != g_internal_handle) { - return ORBIS_HMD_ERROR_HANDLE_INVALID; - } - if (g_firmware_version >= Common::ElfInfo::FW_45) { - // Due to some faulty in-library checks, a missing headset results in this error - // instead of the expected ORBIS_HMD_ERROR_DEVICE_DISCONNECTED error. - return ORBIS_HMD_ERROR_HANDLE_INVALID; - } - if (info == nullptr) { - return ORBIS_HMD_ERROR_PARAMETER_NULL; - } - if (!g_library_initialized) { - return ORBIS_HMD_ERROR_NOT_INITIALIZED; - } - - memset(info, 0, sizeof(OrbisHmdDeviceInformation)); - info->status = OrbisHmdDeviceStatus::ORBIS_HMD_DEVICE_STATUS_NOT_DETECTED; - info->user_id = g_user_id; - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdGetFieldOfView(s32 handle, OrbisHmdFieldOfView* field_of_view) { - LOG_DEBUG(Lib_Hmd, "called"); - if (field_of_view == nullptr) { - return ORBIS_HMD_ERROR_PARAMETER_NULL; - } - if (handle != g_internal_handle) { - return ORBIS_HMD_ERROR_HANDLE_INVALID; - } - if (g_firmware_version >= Common::ElfInfo::FW_45) { - // Due to some faulty in-library checks, a missing headset results in this error - // instead of the expected ORBIS_HMD_ERROR_DEVICE_DISCONNECTED error. - return ORBIS_HMD_ERROR_HANDLE_INVALID; - } - if (!g_library_initialized) { - return ORBIS_HMD_ERROR_NOT_INITIALIZED; - } - - // These values are a hardcoded return when a headset is connected. - // Leaving this here for future developers. - // field_of_view->tan_out = 1.20743; - // field_of_view->tan_in = 1.181346; - // field_of_view->tan_top = 1.262872; - // field_of_view->tan_bottom = 1.262872; - - // Fails internally due to some internal library checks that break without a connected headset. - return ORBIS_HMD_ERROR_HANDLE_INVALID; -} - -s32 PS4_SYSV_ABI sceHmdGetInertialSensorData(s32 handle, void* data, s32 unk) { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - if (!g_library_initialized) { - return ORBIS_HMD_ERROR_NOT_INITIALIZED; - } - if (handle != g_internal_handle) { - return ORBIS_HMD_ERROR_HANDLE_INVALID; - } - if (g_firmware_version >= Common::ElfInfo::FW_45) { - // Due to some faulty in-library checks, a missing headset results in this error - // instead of the expected ORBIS_HMD_ERROR_DEVICE_DISCONNECTED error. - return ORBIS_HMD_ERROR_HANDLE_INVALID; - } - - return ORBIS_HMD_ERROR_DEVICE_DISCONNECTED; -} - -s32 PS4_SYSV_ABI sceHmdClose(s32 handle) { - LOG_DEBUG(Lib_Hmd, "called"); - if (!g_library_initialized) { - return ORBIS_HMD_ERROR_NOT_INITIALIZED; - } - if (handle != g_internal_handle) { - return ORBIS_HMD_ERROR_HANDLE_INVALID; - } - - g_internal_handle = 0; - g_user_id = -1; - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdTerminate() { - LOG_DEBUG(Lib_Hmd, "called"); - if (!g_library_initialized) { - return ORBIS_HMD_ERROR_NOT_INITIALIZED; - } - sceHmdDistortionTerminate(); - g_library_initialized = false; - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternal3dAudioClose() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternal3dAudioOpen() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternal3dAudioSendData() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalAnotherScreenClose() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalAnotherScreenGetAudioStatus() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalAnotherScreenGetFadeState() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalAnotherScreenGetVideoStatus() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalAnotherScreenOpen() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalAnotherScreenSendAudio() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalAnotherScreenSendVideo() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalAnotherScreenSetFadeAndSwitch() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalBindDeviceWithUserId() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalCheckDeviceModelMk3() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalCheckS3dPassModeAvailable() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalCrashReportCancel() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalCrashReportClose() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalCrashReportOpen() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalCrashReportReadData() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalCrashReportReadDataSize() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalCreateSharedMemory() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalDfuCheckAfterPvt() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalDfuCheckPartialUpdateAvailable() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalDfuClose() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalDfuGetStatus() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalDfuOpen() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalDfuReset() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalDfuSend() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalDfuSendSize() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalDfuSetMode() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalDfuStart() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalEventInitialize() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalGetBrightness() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalGetCrashDumpInfo() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalGetDebugMode() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalGetDebugSocialScreenMode() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalGetDebugTextMode() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalGetDefaultLedData() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalGetDemoMode() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalGetDeviceInformation() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalGetDeviceInformationByHandle() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalGetDeviceStatus(OrbisHmdDeviceStatus* status) { - LOG_DEBUG(Lib_Hmd, "called"); - if (status == nullptr) { - return ORBIS_HMD_ERROR_PARAMETER_NULL; - } - // Internal function fails with error DEVICE_DISCONNECTED - *status = OrbisHmdDeviceStatus::ORBIS_HMD_DEVICE_STATUS_NOT_DETECTED; - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalGetEyeStatus() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalGetHmuOpticalParam() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalGetHmuPowerStatusForDebug() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalGetHmuSerialNumber() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalGetIPD() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalGetIpdSettingEnableForSystemService() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalGetPuBuildNumber() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalGetPuPositionParam() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalGetPuRevision() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalGetPUSerialNumber() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalGetPUVersion() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalGetRequiredPUPVersion() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalGetStatusReport() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalGetTv4kCapability() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalGetVirtualDisplayDepth() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalGetVirtualDisplayHeight() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalGetVirtualDisplaySize() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalGetVr2dData() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalIsCommonDlgMiniAppVr2d() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalIsCommonDlgVr2d() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalIsGameVr2d() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalIsMiniAppVr2d() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalMapSharedMemory() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalMirroringModeSetAspect() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalMirroringModeSetAspectDebug() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalMmapGetCount() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalMmapGetModeId() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalMmapGetSensorCalibrationData() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalMmapIsConnect() { - LOG_DEBUG(Lib_Hmd, "called"); - // Returns 0 when device is disconnected. - return 0; -} - -s32 PS4_SYSV_ABI sceHmdInternalPushVr2dData() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalRegisterEventCallback() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalResetInertialSensor() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalResetLedForVrTracker() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalResetLedForVsh() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalSeparateModeClose() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalSeparateModeGetAudioStatus() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalSeparateModeGetVideoStatus() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalSeparateModeOpen() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalSeparateModeSendAudio() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalSeparateModeSendVideo() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalSetBrightness() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalSetCrashReportCommand() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalSetDebugGpo() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalSetDebugMode() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalSetDebugSocialScreenMode() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalSetDebugTextMode() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalSetDefaultLedData() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalSetDemoMode() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalSetDeviceConnection() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalSetForcedCrash() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalSetHmuPowerControl() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalSetHmuPowerControlForDebug() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalSetIPD() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalSetIpdSettingEnableForSystemService() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalSetLedOn() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalSetM2LedBrightness() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalSetM2LedOn() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalSetPortConnection() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalSetPortStatus() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalSetS3dPassMode() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalSetSidetone() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalSetUserType() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalSetVirtualDisplayDepth() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalSetVirtualDisplayHeight() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalSetVirtualDisplaySize() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalSetVRMode() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalSocialScreenGetFadeState() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalSocialScreenSetFadeAndSwitch() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdInternalSocialScreenSetOutput() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_202D0D1A687FCD2F() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_358DBF818A3D8A12() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_5CCBADA76FE8F40E() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_63D403167DC08CF0() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_69383B2B4E3AEABF(s32 handle, void* data, s32 unk) { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - if (!g_library_initialized) { - return ORBIS_HMD_ERROR_NOT_INITIALIZED; - } - if (handle != g_internal_handle) { - return ORBIS_HMD_ERROR_HANDLE_INVALID; - } - if (g_firmware_version >= Common::ElfInfo::FW_45) { - // Due to some faulty in-library checks, a missing headset results in this error - // instead of the expected ORBIS_HMD_ERROR_DEVICE_DISCONNECTED error. - return ORBIS_HMD_ERROR_HANDLE_INVALID; - } - - return ORBIS_HMD_ERROR_DEVICE_DISCONNECTED; -} - -s32 PS4_SYSV_ABI Func_791560C32F4F6D68() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_7C955961EA85B6D3() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_9952277839236BA7() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_9A276E739E54EEAF() { - // Stubbed on real hardware. - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_9E501994E289CBE7() { - // Stubbed on real hardware. - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_A31F4DA8B3BD2E12() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_A92D7C23AC364993() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_ADCCC25CB876FDBE() { - // Stubbed on real hardware. - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_B16652641FE69F0E() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_FC193BD653F2AF2E() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_FF2E0E53015FE231() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -void RegisterLib(Core::Loader::SymbolsResolver* sym) { - Libraries::Kernel::sceKernelGetCompiledSdkVersion(&g_firmware_version); - LIB_FUNCTION("6biw1XHTSqQ", "libSceHmd", 1, "libSceHmd", sceHmdClose); - LIB_FUNCTION("BWY-qKM5hxE", "libSceHmd", 1, "libSceHmd", sceHmdGet2DEyeOffset); - LIB_FUNCTION("Yx+CuF11D3Q", "libSceHmd", 1, "libSceHmd", sceHmdGetAssyError); - LIB_FUNCTION("thDt9upZlp8", "libSceHmd", 1, "libSceHmd", sceHmdGetDeviceInformation); - LIB_FUNCTION("1pxQfif1rkE", "libSceHmd", 1, "libSceHmd", sceHmdGetDeviceInformationByHandle); - LIB_FUNCTION("NPQwYFqi0bs", "libSceHmd", 1, "libSceHmd", sceHmdGetFieldOfView); - LIB_FUNCTION("rU3HK9Q0r8o", "libSceHmd", 1, "libSceHmd", sceHmdGetInertialSensorData); - LIB_FUNCTION("K4KnH0QkT2c", "libSceHmd", 1, "libSceHmd", sceHmdInitialize); - LIB_FUNCTION("s-J66ar9g50", "libSceHmd", 1, "libSceHmd", sceHmdInitialize315); - LIB_FUNCTION("riPQfAdebHk", "libSceHmd", 1, "libSceHmd", sceHmdInternal3dAudioClose); - LIB_FUNCTION("wHnZU1qtiqw", "libSceHmd", 1, "libSceHmd", sceHmdInternal3dAudioOpen); - LIB_FUNCTION("NuEjeN8WCBA", "libSceHmd", 1, "libSceHmd", sceHmdInternal3dAudioSendData); - LIB_FUNCTION("QasPTUPWVZE", "libSceHmd", 1, "libSceHmd", sceHmdInternalAnotherScreenClose); - LIB_FUNCTION("Wr5KVtyVDG0", "libSceHmd", 1, "libSceHmd", - sceHmdInternalAnotherScreenGetAudioStatus); - LIB_FUNCTION("whRxl6Hhrzg", "libSceHmd", 1, "libSceHmd", - sceHmdInternalAnotherScreenGetFadeState); - LIB_FUNCTION("w8BEUsIYn8w", "libSceHmd", 1, "libSceHmd", - sceHmdInternalAnotherScreenGetVideoStatus); - LIB_FUNCTION("0cQDAbkOt2A", "libSceHmd", 1, "libSceHmd", sceHmdInternalAnotherScreenOpen); - LIB_FUNCTION("Asczi8gw1NM", "libSceHmd", 1, "libSceHmd", sceHmdInternalAnotherScreenSendAudio); - LIB_FUNCTION("6+v7m1vwE+0", "libSceHmd", 1, "libSceHmd", sceHmdInternalAnotherScreenSendVideo); - LIB_FUNCTION("E0BLvy57IiQ", "libSceHmd", 1, "libSceHmd", - sceHmdInternalAnotherScreenSetFadeAndSwitch); - LIB_FUNCTION("UTqrWB+1+SU", "libSceHmd", 1, "libSceHmd", sceHmdInternalBindDeviceWithUserId); - LIB_FUNCTION("ego1YdqNGpI", "libSceHmd", 1, "libSceHmd", sceHmdInternalCheckDeviceModelMk3); - LIB_FUNCTION("WR7XsLdjcqQ", "libSceHmd", 1, "libSceHmd", - sceHmdInternalCheckS3dPassModeAvailable); - LIB_FUNCTION("eMI1Hq+NEwY", "libSceHmd", 1, "libSceHmd", sceHmdInternalCrashReportCancel); - LIB_FUNCTION("dI3StPLQlMM", "libSceHmd", 1, "libSceHmd", sceHmdInternalCrashReportClose); - LIB_FUNCTION("lqPT-Bf1s4I", "libSceHmd", 1, "libSceHmd", sceHmdInternalCrashReportOpen); - LIB_FUNCTION("QxhJs6zHUmU", "libSceHmd", 1, "libSceHmd", sceHmdInternalCrashReportReadData); - LIB_FUNCTION("A2jWOLPzHHE", "libSceHmd", 1, "libSceHmd", sceHmdInternalCrashReportReadDataSize); - LIB_FUNCTION("E9scVxt0DNg", "libSceHmd", 1, "libSceHmd", sceHmdInternalCreateSharedMemory); - LIB_FUNCTION("6RclvsKxr3I", "libSceHmd", 1, "libSceHmd", sceHmdInternalDfuCheckAfterPvt); - LIB_FUNCTION("cE99PJR6b8w", "libSceHmd", 1, "libSceHmd", - sceHmdInternalDfuCheckPartialUpdateAvailable); - LIB_FUNCTION("SuE90Qscg0s", "libSceHmd", 1, "libSceHmd", sceHmdInternalDfuClose); - LIB_FUNCTION("5f-6lp7L5cY", "libSceHmd", 1, "libSceHmd", sceHmdInternalDfuGetStatus); - LIB_FUNCTION("dv2RqD7ZBd4", "libSceHmd", 1, "libSceHmd", sceHmdInternalDfuOpen); - LIB_FUNCTION("pN0HjRU86Jo", "libSceHmd", 1, "libSceHmd", sceHmdInternalDfuReset); - LIB_FUNCTION("mdc++HCXSsQ", "libSceHmd", 1, "libSceHmd", sceHmdInternalDfuSend); - LIB_FUNCTION("gjyqnphjGZE", "libSceHmd", 1, "libSceHmd", sceHmdInternalDfuSendSize); - LIB_FUNCTION("bl4MkWNLxKs", "libSceHmd", 1, "libSceHmd", sceHmdInternalDfuSetMode); - LIB_FUNCTION("a1LmvXhZ6TM", "libSceHmd", 1, "libSceHmd", sceHmdInternalDfuStart); - LIB_FUNCTION("+UzzSnc0z9A", "libSceHmd", 1, "libSceHmd", sceHmdInternalEventInitialize); - LIB_FUNCTION("uQc9P8Hrr6U", "libSceHmd", 1, "libSceHmd", sceHmdInternalGetBrightness); - LIB_FUNCTION("nK1g+MwMV10", "libSceHmd", 1, "libSceHmd", sceHmdInternalGetCrashDumpInfo); - LIB_FUNCTION("L5WZgOTw41Y", "libSceHmd", 1, "libSceHmd", sceHmdInternalGetDebugMode); - LIB_FUNCTION("3w8SkMfCHY0", "libSceHmd", 1, "libSceHmd", - sceHmdInternalGetDebugSocialScreenMode); - LIB_FUNCTION("1Xmb76MHXug", "libSceHmd", 1, "libSceHmd", sceHmdInternalGetDebugTextMode); - LIB_FUNCTION("S0ITgPRkfUg", "libSceHmd", 1, "libSceHmd", sceHmdInternalGetDefaultLedData); - LIB_FUNCTION("mxjolbeBa78", "libSceHmd", 1, "libSceHmd", sceHmdInternalGetDemoMode); - LIB_FUNCTION("RFIi20Wp9j0", "libSceHmd", 1, "libSceHmd", sceHmdInternalGetDeviceInformation); - LIB_FUNCTION("P04LQJQZ43Y", "libSceHmd", 1, "libSceHmd", - sceHmdInternalGetDeviceInformationByHandle); - LIB_FUNCTION("PPCqsD8B5uM", "libSceHmd", 1, "libSceHmd", sceHmdInternalGetDeviceStatus); - LIB_FUNCTION("-u82z1UhOq4", "libSceHmd", 1, "libSceHmd", sceHmdInternalGetEyeStatus); - LIB_FUNCTION("iINSFzCIaB8", "libSceHmd", 1, "libSceHmd", sceHmdInternalGetHmuOpticalParam); - LIB_FUNCTION("Csuvq2MMXHU", "libSceHmd", 1, "libSceHmd", - sceHmdInternalGetHmuPowerStatusForDebug); - LIB_FUNCTION("UhFPniZvm8U", "libSceHmd", 1, "libSceHmd", sceHmdInternalGetHmuSerialNumber); - LIB_FUNCTION("aTg7K0466r8", "libSceHmd", 1, "libSceHmd", Func_69383B2B4E3AEABF); - LIB_FUNCTION("9exeDpk7JU8", "libSceHmd", 1, "libSceHmd", sceHmdInternalGetIPD); - LIB_FUNCTION("yNtYRsxZ6-A", "libSceHmd", 1, "libSceHmd", - sceHmdInternalGetIpdSettingEnableForSystemService); - LIB_FUNCTION("EKn+IFVsz0M", "libSceHmd", 1, "libSceHmd", sceHmdInternalGetPuBuildNumber); - LIB_FUNCTION("AxQ6HtktYfQ", "libSceHmd", 1, "libSceHmd", sceHmdInternalGetPuPositionParam); - LIB_FUNCTION("ynKv9QCSbto", "libSceHmd", 1, "libSceHmd", sceHmdInternalGetPuRevision); - LIB_FUNCTION("3jcyx7XOm7A", "libSceHmd", 1, "libSceHmd", sceHmdInternalGetPUSerialNumber); - LIB_FUNCTION("+PDyXnclP5w", "libSceHmd", 1, "libSceHmd", sceHmdInternalGetPUVersion); - LIB_FUNCTION("67q17ERGBuw", "libSceHmd", 1, "libSceHmd", sceHmdInternalGetRequiredPUPVersion); - LIB_FUNCTION("uGyN1CkvwYU", "libSceHmd", 1, "libSceHmd", sceHmdInternalGetStatusReport); - LIB_FUNCTION("p9lSvZujLuo", "libSceHmd", 1, "libSceHmd", sceHmdInternalGetTv4kCapability); - LIB_FUNCTION("-Z+-9u98m9o", "libSceHmd", 1, "libSceHmd", sceHmdInternalGetVirtualDisplayDepth); - LIB_FUNCTION("df+b0FQnnVQ", "libSceHmd", 1, "libSceHmd", sceHmdInternalGetVirtualDisplayHeight); - LIB_FUNCTION("i6yROd9ygJs", "libSceHmd", 1, "libSceHmd", sceHmdInternalGetVirtualDisplaySize); - LIB_FUNCTION("Aajiktl6JXU", "libSceHmd", 1, "libSceHmd", sceHmdInternalGetVr2dData); - LIB_FUNCTION("GwFVF2KkIT4", "libSceHmd", 1, "libSceHmd", sceHmdInternalIsCommonDlgMiniAppVr2d); - LIB_FUNCTION("LWQpWHOSUvk", "libSceHmd", 1, "libSceHmd", sceHmdInternalIsCommonDlgVr2d); - LIB_FUNCTION("YiIVBPLxmfE", "libSceHmd", 1, "libSceHmd", sceHmdInternalIsGameVr2d); - LIB_FUNCTION("LMlWs+oKHTg", "libSceHmd", 1, "libSceHmd", sceHmdInternalIsMiniAppVr2d); - LIB_FUNCTION("nBv4CKUGX0Y", "libSceHmd", 1, "libSceHmd", sceHmdInternalMapSharedMemory); - LIB_FUNCTION("4hTD8I3CyAk", "libSceHmd", 1, "libSceHmd", sceHmdInternalMirroringModeSetAspect); - LIB_FUNCTION("EJwPtSSZykY", "libSceHmd", 1, "libSceHmd", - sceHmdInternalMirroringModeSetAspectDebug); - LIB_FUNCTION("r7f7M5q3snU", "libSceHmd", 1, "libSceHmd", sceHmdInternalMmapGetCount); - LIB_FUNCTION("gCjTEtEsOOw", "libSceHmd", 1, "libSceHmd", sceHmdInternalMmapGetModeId); - LIB_FUNCTION("HAr740Mt9Hs", "libSceHmd", 1, "libSceHmd", - sceHmdInternalMmapGetSensorCalibrationData); - LIB_FUNCTION("1PNiQR-7L6k", "libSceHmd", 1, "libSceHmd", sceHmdInternalMmapIsConnect); - LIB_FUNCTION("9-jaAXUNG-A", "libSceHmd", 1, "libSceHmd", sceHmdInternalPushVr2dData); - LIB_FUNCTION("1gkbLH5+kxU", "libSceHmd", 1, "libSceHmd", sceHmdInternalRegisterEventCallback); - LIB_FUNCTION("6kHBllapJas", "libSceHmd", 1, "libSceHmd", sceHmdInternalResetInertialSensor); - LIB_FUNCTION("k1W6RPkd0mc", "libSceHmd", 1, "libSceHmd", sceHmdInternalResetLedForVrTracker); - LIB_FUNCTION("dp1wu22jSGc", "libSceHmd", 1, "libSceHmd", sceHmdInternalResetLedForVsh); - LIB_FUNCTION("d2TeoKeqM5U", "libSceHmd", 1, "libSceHmd", sceHmdInternalSeparateModeClose); - LIB_FUNCTION("WxsnAsjPF7Q", "libSceHmd", 1, "libSceHmd", - sceHmdInternalSeparateModeGetAudioStatus); - LIB_FUNCTION("eOOeG9SpEuc", "libSceHmd", 1, "libSceHmd", - sceHmdInternalSeparateModeGetVideoStatus); - LIB_FUNCTION("gA4Xnn+NSGk", "libSceHmd", 1, "libSceHmd", sceHmdInternalSeparateModeOpen); - LIB_FUNCTION("stQ7AsondmE", "libSceHmd", 1, "libSceHmd", sceHmdInternalSeparateModeSendAudio); - LIB_FUNCTION("jfnS-OoDayM", "libSceHmd", 1, "libSceHmd", sceHmdInternalSeparateModeSendVideo); - LIB_FUNCTION("roHN4ml+tB8", "libSceHmd", 1, "libSceHmd", sceHmdInternalSetBrightness); - LIB_FUNCTION("0z2qLqedQH0", "libSceHmd", 1, "libSceHmd", sceHmdInternalSetCrashReportCommand); - LIB_FUNCTION("xhx5rVZEpnw", "libSceHmd", 1, "libSceHmd", sceHmdInternalSetDebugGpo); - LIB_FUNCTION("e7laRxRGCHc", "libSceHmd", 1, "libSceHmd", sceHmdInternalSetDebugMode); - LIB_FUNCTION("CRyJ7Q-ap3g", "libSceHmd", 1, "libSceHmd", - sceHmdInternalSetDebugSocialScreenMode); - LIB_FUNCTION("dG4XPW4juU4", "libSceHmd", 1, "libSceHmd", sceHmdInternalSetDebugTextMode); - LIB_FUNCTION("rAXmGoO-VmE", "libSceHmd", 1, "libSceHmd", sceHmdInternalSetDefaultLedData); - LIB_FUNCTION("lu9I7jnUvWQ", "libSceHmd", 1, "libSceHmd", sceHmdInternalSetDemoMode); - LIB_FUNCTION("hyATMTuQSoQ", "libSceHmd", 1, "libSceHmd", sceHmdInternalSetDeviceConnection); - LIB_FUNCTION("c4mSi64bXUw", "libSceHmd", 1, "libSceHmd", sceHmdInternalSetForcedCrash); - LIB_FUNCTION("U9kPT4g1mFE", "libSceHmd", 1, "libSceHmd", sceHmdInternalSetHmuPowerControl); - LIB_FUNCTION("dX-MVpXIPwQ", "libSceHmd", 1, "libSceHmd", - sceHmdInternalSetHmuPowerControlForDebug); - LIB_FUNCTION("4KIjvAf8PCA", "libSceHmd", 1, "libSceHmd", sceHmdInternalSetIPD); - LIB_FUNCTION("NbxTfUKO184", "libSceHmd", 1, "libSceHmd", - sceHmdInternalSetIpdSettingEnableForSystemService); - LIB_FUNCTION("NnRKjf+hxW4", "libSceHmd", 1, "libSceHmd", sceHmdInternalSetLedOn); - LIB_FUNCTION("4AP0X9qGhqw", "libSceHmd", 1, "libSceHmd", sceHmdInternalSetM2LedBrightness); - LIB_FUNCTION("Mzzz2HPWM+8", "libSceHmd", 1, "libSceHmd", sceHmdInternalSetM2LedOn); - LIB_FUNCTION("LkBkse9Pit0", "libSceHmd", 1, "libSceHmd", sceHmdInternalSetPortConnection); - LIB_FUNCTION("v243mvYg0Y0", "libSceHmd", 1, "libSceHmd", sceHmdInternalSetPortStatus); - LIB_FUNCTION("EwXvkZpo9Go", "libSceHmd", 1, "libSceHmd", sceHmdInternalSetS3dPassMode); - LIB_FUNCTION("g3DKNOy1tYw", "libSceHmd", 1, "libSceHmd", sceHmdInternalSetSidetone); - LIB_FUNCTION("mjMsl838XM8", "libSceHmd", 1, "libSceHmd", sceHmdInternalSetUserType); - LIB_FUNCTION("8IS0KLkDNQY", "libSceHmd", 1, "libSceHmd", sceHmdInternalSetVirtualDisplayDepth); - LIB_FUNCTION("afhK5KcJOJY", "libSceHmd", 1, "libSceHmd", sceHmdInternalSetVirtualDisplayHeight); - LIB_FUNCTION("+zPvzIiB+BU", "libSceHmd", 1, "libSceHmd", sceHmdInternalSetVirtualDisplaySize); - LIB_FUNCTION("9z8Lc64NF1c", "libSceHmd", 1, "libSceHmd", sceHmdInternalSetVRMode); - LIB_FUNCTION("s5EqYh5kbwM", "libSceHmd", 1, "libSceHmd", - sceHmdInternalSocialScreenGetFadeState); - LIB_FUNCTION("a1LMFZtK9b0", "libSceHmd", 1, "libSceHmd", - sceHmdInternalSocialScreenSetFadeAndSwitch); - LIB_FUNCTION("-6FjKlMA+Yc", "libSceHmd", 1, "libSceHmd", sceHmdInternalSocialScreenSetOutput); - LIB_FUNCTION("d2g5Ij7EUzo", "libSceHmd", 1, "libSceHmd", sceHmdOpen); - LIB_FUNCTION("z-RMILqP6tE", "libSceHmd", 1, "libSceHmd", sceHmdTerminate); - LIB_FUNCTION("IC0NGmh-zS8", "libSceHmd", 1, "libSceHmd", Func_202D0D1A687FCD2F); - LIB_FUNCTION("NY2-gYo9ihI", "libSceHmd", 1, "libSceHmd", Func_358DBF818A3D8A12); - LIB_FUNCTION("XMutp2-o9A4", "libSceHmd", 1, "libSceHmd", Func_5CCBADA76FE8F40E); - LIB_FUNCTION("Y9QDFn3AjPA", "libSceHmd", 1, "libSceHmd", Func_63D403167DC08CF0); - LIB_FUNCTION("eRVgwy9PbWg", "libSceHmd", 1, "libSceHmd", Func_791560C32F4F6D68); - LIB_FUNCTION("fJVZYeqFttM", "libSceHmd", 1, "libSceHmd", Func_7C955961EA85B6D3); - LIB_FUNCTION("mVIneDkja6c", "libSceHmd", 1, "libSceHmd", Func_9952277839236BA7); - LIB_FUNCTION("miduc55U7q8", "libSceHmd", 1, "libSceHmd", Func_9A276E739E54EEAF); - LIB_FUNCTION("nlAZlOKJy+c", "libSceHmd", 1, "libSceHmd", Func_9E501994E289CBE7); - LIB_FUNCTION("ox9NqLO9LhI", "libSceHmd", 1, "libSceHmd", Func_A31F4DA8B3BD2E12); - LIB_FUNCTION("qS18I6w2SZM", "libSceHmd", 1, "libSceHmd", Func_A92D7C23AC364993); - LIB_FUNCTION("rczCXLh2-b4", "libSceHmd", 1, "libSceHmd", Func_ADCCC25CB876FDBE); - LIB_FUNCTION("sWZSZB-mnw4", "libSceHmd", 1, "libSceHmd", Func_B16652641FE69F0E); - LIB_FUNCTION("-Bk71lPyry4", "libSceHmd", 1, "libSceHmd", Func_FC193BD653F2AF2E); - LIB_FUNCTION("-y4OUwFf4jE", "libSceHmd", 1, "libSceHmd", Func_FF2E0E53015FE231); - - RegisterDistortion(sym); - RegisterReprojection(sym); -}; - -} // namespace Libraries::Hmd \ No newline at end of file diff --git a/src/core/libraries/hmd/hmd.h b/src/core/libraries/hmd/hmd.h deleted file mode 100644 index 67ee6c1d8..000000000 --- a/src/core/libraries/hmd/hmd.h +++ /dev/null @@ -1,267 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "common/types.h" -#include "core/libraries/system/userservice.h" - -namespace Core::Loader { -class SymbolsResolver; -} - -namespace Libraries::Hmd { - -enum OrbisHmdDeviceStatus : u32 { - ORBIS_HMD_DEVICE_STATUS_READY, - ORBIS_HMD_DEVICE_STATUS_NOT_READY, - ORBIS_HMD_DEVICE_STATUS_NOT_DETECTED, - ORBIS_HMD_DEVICE_STATUS_NOT_READY_HMU_DISCONNECT, -}; - -struct OrbisHmdInitializeParam { - void* reserved0; - u8 reserved[8]; -}; - -struct OrbisHmdOpenParam { - u8 reserve[32]; -}; - -struct OrbisHmdFieldOfView { - float tan_out; - float tan_in; - float tan_top; - float tan_bottom; -}; - -struct OrbisHmdPanelResolution { - u32 width; - u32 height; -}; - -struct OrbisHmdFlipToDisplayLatency { - u16 refresh_rate_90hz; - u16 refresh_rate_120hz; -}; - -struct OrbisHmdDeviceInfo { - OrbisHmdPanelResolution panel_resolution; - OrbisHmdFlipToDisplayLatency flip_to_display_latency; -}; - -struct OrbisHmdDeviceInformation { - OrbisHmdDeviceStatus status; - Libraries::UserService::OrbisUserServiceUserId user_id; - u8 reserve0[4]; - OrbisHmdDeviceInfo device_info; - u8 hmu_mount; - u8 reserve1[7]; -}; - -struct OrbisHmdEyeOffset { - float offset_x; - float offset_y; - float offset_z; - u8 reserve[20]; -}; - -// Reprojection -s32 PS4_SYSV_ABI sceHmdReprojectionStartMultilayer(); -s32 PS4_SYSV_ABI sceHmdReprojectionAddDisplayBuffer(); -s32 PS4_SYSV_ABI sceHmdReprojectionClearUserEventEnd(); -s32 PS4_SYSV_ABI sceHmdReprojectionClearUserEventStart(); -s32 PS4_SYSV_ABI sceHmdReprojectionDebugGetLastInfo(); -s32 PS4_SYSV_ABI sceHmdReprojectionDebugGetLastInfoMultilayer(); -s32 PS4_SYSV_ABI sceHmdReprojectionFinalize(); -s32 PS4_SYSV_ABI sceHmdReprojectionFinalizeCapture(); -s32 PS4_SYSV_ABI sceHmdReprojectionInitialize(); -s32 PS4_SYSV_ABI sceHmdReprojectionInitializeCapture(); -s32 PS4_SYSV_ABI sceHmdReprojectionQueryGarlicBuffAlign(); -s32 PS4_SYSV_ABI sceHmdReprojectionQueryGarlicBuffSize(); -s32 PS4_SYSV_ABI sceHmdReprojectionQueryOnionBuffAlign(); -s32 PS4_SYSV_ABI sceHmdReprojectionQueryOnionBuffSize(); -s32 PS4_SYSV_ABI sceHmdReprojectionSetCallback(); -s32 PS4_SYSV_ABI sceHmdReprojectionSetDisplayBuffers(); -s32 PS4_SYSV_ABI sceHmdReprojectionSetOutputMinColor(); -s32 PS4_SYSV_ABI sceHmdReprojectionSetUserEventEnd(); -s32 PS4_SYSV_ABI sceHmdReprojectionSetUserEventStart(); -s32 PS4_SYSV_ABI sceHmdReprojectionStart(); -s32 PS4_SYSV_ABI sceHmdReprojectionStart2dVr(); -s32 PS4_SYSV_ABI sceHmdReprojectionStartCapture(); -s32 PS4_SYSV_ABI sceHmdReprojectionStartLiveCapture(); -s32 PS4_SYSV_ABI sceHmdReprojectionStartMultilayer2(); -s32 PS4_SYSV_ABI sceHmdReprojectionStartWideNear(); -s32 PS4_SYSV_ABI sceHmdReprojectionStartWideNearWithOverlay(); -s32 PS4_SYSV_ABI sceHmdReprojectionStartWithOverlay(); -s32 PS4_SYSV_ABI sceHmdReprojectionStop(); -s32 PS4_SYSV_ABI sceHmdReprojectionStopCapture(); -s32 PS4_SYSV_ABI sceHmdReprojectionStopLiveCapture(); -s32 PS4_SYSV_ABI sceHmdReprojectionUnsetCallback(); -s32 PS4_SYSV_ABI sceHmdReprojectionUnsetDisplayBuffers(); - -// Distortion -s32 PS4_SYSV_ABI sceHmdDistortionGet2dVrCommand(); -s32 PS4_SYSV_ABI sceHmdDistortionGetCompoundEyeCorrectionCommand(); -s32 PS4_SYSV_ABI sceHmdDistortionGetCorrectionCommand(); -s32 PS4_SYSV_ABI sceHmdDistortionGetWideNearCorrectionCommand(); -s32 PS4_SYSV_ABI sceHmdDistortionGetWorkMemoryAlign(); -s32 PS4_SYSV_ABI sceHmdDistortionGetWorkMemorySize(); -s32 PS4_SYSV_ABI sceHmdDistortionInitialize(void* reserved); -s32 PS4_SYSV_ABI sceHmdDistortionSetOutputMinColor(); -s32 PS4_SYSV_ABI sceHmdDistortionTerminate(); -s32 PS4_SYSV_ABI sceHmdGetDistortionParams(); -s32 PS4_SYSV_ABI Func_B26430EA74FC3DC0(); -s32 PS4_SYSV_ABI Func_B614F290B67FB59B(); - -// libSceHmd -s32 PS4_SYSV_ABI sceHmdClose(s32 handle); -s32 PS4_SYSV_ABI sceHmdGet2DEyeOffset(s32 handle, OrbisHmdEyeOffset* left_offset, - OrbisHmdEyeOffset* right_offset); -s32 PS4_SYSV_ABI sceHmdGetAssyError(void* data); -s32 PS4_SYSV_ABI sceHmdGetDeviceInformation(OrbisHmdDeviceInformation* info); -s32 PS4_SYSV_ABI sceHmdGetDeviceInformationByHandle(s32 handle, OrbisHmdDeviceInformation* info); - -s32 PS4_SYSV_ABI sceHmdGetFieldOfView(s32 handle, OrbisHmdFieldOfView* field_of_view); -s32 PS4_SYSV_ABI sceHmdGetInertialSensorData(s32 handle, void* data, s32 unk); -s32 PS4_SYSV_ABI sceHmdInitialize(const OrbisHmdInitializeParam* param); -s32 PS4_SYSV_ABI sceHmdInitialize315(const OrbisHmdInitializeParam* param); -s32 PS4_SYSV_ABI sceHmdOpen(Libraries::UserService::OrbisUserServiceUserId user_id, s32 type, - s32 index, OrbisHmdOpenParam* param); -s32 PS4_SYSV_ABI sceHmdTerminate(); - -// Internal -s32 PS4_SYSV_ABI sceHmdInternal3dAudioClose(); -s32 PS4_SYSV_ABI sceHmdInternal3dAudioOpen(); -s32 PS4_SYSV_ABI sceHmdInternal3dAudioSendData(); -s32 PS4_SYSV_ABI sceHmdInternalAnotherScreenClose(); -s32 PS4_SYSV_ABI sceHmdInternalAnotherScreenGetAudioStatus(); -s32 PS4_SYSV_ABI sceHmdInternalAnotherScreenGetFadeState(); -s32 PS4_SYSV_ABI sceHmdInternalAnotherScreenGetVideoStatus(); -s32 PS4_SYSV_ABI sceHmdInternalAnotherScreenOpen(); -s32 PS4_SYSV_ABI sceHmdInternalAnotherScreenSendAudio(); -s32 PS4_SYSV_ABI sceHmdInternalAnotherScreenSendVideo(); -s32 PS4_SYSV_ABI sceHmdInternalAnotherScreenSetFadeAndSwitch(); -s32 PS4_SYSV_ABI sceHmdInternalBindDeviceWithUserId(); -s32 PS4_SYSV_ABI sceHmdInternalCheckDeviceModelMk3(); -s32 PS4_SYSV_ABI sceHmdInternalCheckS3dPassModeAvailable(); -s32 PS4_SYSV_ABI sceHmdInternalCrashReportCancel(); -s32 PS4_SYSV_ABI sceHmdInternalCrashReportClose(); -s32 PS4_SYSV_ABI sceHmdInternalCrashReportOpen(); -s32 PS4_SYSV_ABI sceHmdInternalCrashReportReadData(); -s32 PS4_SYSV_ABI sceHmdInternalCrashReportReadDataSize(); -s32 PS4_SYSV_ABI sceHmdInternalCreateSharedMemory(); -s32 PS4_SYSV_ABI sceHmdInternalDfuCheckAfterPvt(); -s32 PS4_SYSV_ABI sceHmdInternalDfuCheckPartialUpdateAvailable(); -s32 PS4_SYSV_ABI sceHmdInternalDfuClose(); -s32 PS4_SYSV_ABI sceHmdInternalDfuGetStatus(); -s32 PS4_SYSV_ABI sceHmdInternalDfuOpen(); -s32 PS4_SYSV_ABI sceHmdInternalDfuReset(); -s32 PS4_SYSV_ABI sceHmdInternalDfuSend(); -s32 PS4_SYSV_ABI sceHmdInternalDfuSendSize(); -s32 PS4_SYSV_ABI sceHmdInternalDfuSetMode(); -s32 PS4_SYSV_ABI sceHmdInternalDfuStart(); -s32 PS4_SYSV_ABI sceHmdInternalEventInitialize(); -s32 PS4_SYSV_ABI sceHmdInternalGetBrightness(); -s32 PS4_SYSV_ABI sceHmdInternalGetCrashDumpInfo(); -s32 PS4_SYSV_ABI sceHmdInternalGetDebugMode(); -s32 PS4_SYSV_ABI sceHmdInternalGetDebugSocialScreenMode(); -s32 PS4_SYSV_ABI sceHmdInternalGetDebugTextMode(); -s32 PS4_SYSV_ABI sceHmdInternalGetDefaultLedData(); -s32 PS4_SYSV_ABI sceHmdInternalGetDemoMode(); -s32 PS4_SYSV_ABI sceHmdInternalGetDeviceInformation(); -s32 PS4_SYSV_ABI sceHmdInternalGetDeviceInformationByHandle(); -s32 PS4_SYSV_ABI sceHmdInternalGetDeviceStatus(OrbisHmdDeviceStatus* status); -s32 PS4_SYSV_ABI sceHmdInternalGetEyeStatus(); -s32 PS4_SYSV_ABI sceHmdInternalGetHmuOpticalParam(); -s32 PS4_SYSV_ABI sceHmdInternalGetHmuPowerStatusForDebug(); -s32 PS4_SYSV_ABI sceHmdInternalGetHmuSerialNumber(); -s32 PS4_SYSV_ABI sceHmdInternalGetIPD(); -s32 PS4_SYSV_ABI sceHmdInternalGetIpdSettingEnableForSystemService(); -s32 PS4_SYSV_ABI sceHmdInternalGetPuBuildNumber(); -s32 PS4_SYSV_ABI sceHmdInternalGetPuPositionParam(); -s32 PS4_SYSV_ABI sceHmdInternalGetPuRevision(); -s32 PS4_SYSV_ABI sceHmdInternalGetPUSerialNumber(); -s32 PS4_SYSV_ABI sceHmdInternalGetPUVersion(); -s32 PS4_SYSV_ABI sceHmdInternalGetRequiredPUPVersion(); -s32 PS4_SYSV_ABI sceHmdInternalGetStatusReport(); -s32 PS4_SYSV_ABI sceHmdInternalGetTv4kCapability(); -s32 PS4_SYSV_ABI sceHmdInternalGetVirtualDisplayDepth(); -s32 PS4_SYSV_ABI sceHmdInternalGetVirtualDisplayHeight(); -s32 PS4_SYSV_ABI sceHmdInternalGetVirtualDisplaySize(); -s32 PS4_SYSV_ABI sceHmdInternalGetVr2dData(); -s32 PS4_SYSV_ABI sceHmdInternalIsCommonDlgMiniAppVr2d(); -s32 PS4_SYSV_ABI sceHmdInternalIsCommonDlgVr2d(); -s32 PS4_SYSV_ABI sceHmdInternalIsGameVr2d(); -s32 PS4_SYSV_ABI sceHmdInternalIsMiniAppVr2d(); -s32 PS4_SYSV_ABI sceHmdInternalMapSharedMemory(); -s32 PS4_SYSV_ABI sceHmdInternalMirroringModeSetAspect(); -s32 PS4_SYSV_ABI sceHmdInternalMirroringModeSetAspectDebug(); -s32 PS4_SYSV_ABI sceHmdInternalMmapGetCount(); -s32 PS4_SYSV_ABI sceHmdInternalMmapGetModeId(); -s32 PS4_SYSV_ABI sceHmdInternalMmapGetSensorCalibrationData(); -s32 PS4_SYSV_ABI sceHmdInternalMmapIsConnect(); -s32 PS4_SYSV_ABI sceHmdInternalPushVr2dData(); -s32 PS4_SYSV_ABI sceHmdInternalRegisterEventCallback(); -s32 PS4_SYSV_ABI sceHmdInternalResetInertialSensor(); -s32 PS4_SYSV_ABI sceHmdInternalResetLedForVrTracker(); -s32 PS4_SYSV_ABI sceHmdInternalResetLedForVsh(); -s32 PS4_SYSV_ABI sceHmdInternalSeparateModeClose(); -s32 PS4_SYSV_ABI sceHmdInternalSeparateModeGetAudioStatus(); -s32 PS4_SYSV_ABI sceHmdInternalSeparateModeGetVideoStatus(); -s32 PS4_SYSV_ABI sceHmdInternalSeparateModeOpen(); -s32 PS4_SYSV_ABI sceHmdInternalSeparateModeSendAudio(); -s32 PS4_SYSV_ABI sceHmdInternalSeparateModeSendVideo(); -s32 PS4_SYSV_ABI sceHmdInternalSetBrightness(); -s32 PS4_SYSV_ABI sceHmdInternalSetCrashReportCommand(); -s32 PS4_SYSV_ABI sceHmdInternalSetDebugGpo(); -s32 PS4_SYSV_ABI sceHmdInternalSetDebugMode(); -s32 PS4_SYSV_ABI sceHmdInternalSetDebugSocialScreenMode(); -s32 PS4_SYSV_ABI sceHmdInternalSetDebugTextMode(); -s32 PS4_SYSV_ABI sceHmdInternalSetDefaultLedData(); -s32 PS4_SYSV_ABI sceHmdInternalSetDemoMode(); -s32 PS4_SYSV_ABI sceHmdInternalSetDeviceConnection(); -s32 PS4_SYSV_ABI sceHmdInternalSetForcedCrash(); -s32 PS4_SYSV_ABI sceHmdInternalSetHmuPowerControl(); -s32 PS4_SYSV_ABI sceHmdInternalSetHmuPowerControlForDebug(); -s32 PS4_SYSV_ABI sceHmdInternalSetIPD(); -s32 PS4_SYSV_ABI sceHmdInternalSetIpdSettingEnableForSystemService(); -s32 PS4_SYSV_ABI sceHmdInternalSetLedOn(); -s32 PS4_SYSV_ABI sceHmdInternalSetM2LedBrightness(); -s32 PS4_SYSV_ABI sceHmdInternalSetM2LedOn(); -s32 PS4_SYSV_ABI sceHmdInternalSetPortConnection(); -s32 PS4_SYSV_ABI sceHmdInternalSetPortStatus(); -s32 PS4_SYSV_ABI sceHmdInternalSetS3dPassMode(); -s32 PS4_SYSV_ABI sceHmdInternalSetSidetone(); -s32 PS4_SYSV_ABI sceHmdInternalSetUserType(); -s32 PS4_SYSV_ABI sceHmdInternalSetVirtualDisplayDepth(); -s32 PS4_SYSV_ABI sceHmdInternalSetVirtualDisplayHeight(); -s32 PS4_SYSV_ABI sceHmdInternalSetVirtualDisplaySize(); -s32 PS4_SYSV_ABI sceHmdInternalSetVRMode(); -s32 PS4_SYSV_ABI sceHmdInternalSocialScreenGetFadeState(); -s32 PS4_SYSV_ABI sceHmdInternalSocialScreenSetFadeAndSwitch(); -s32 PS4_SYSV_ABI sceHmdInternalSocialScreenSetOutput(); - -s32 PS4_SYSV_ABI Func_202D0D1A687FCD2F(); -s32 PS4_SYSV_ABI Func_358DBF818A3D8A12(); -s32 PS4_SYSV_ABI Func_5CCBADA76FE8F40E(); -s32 PS4_SYSV_ABI Func_63D403167DC08CF0(); -s32 PS4_SYSV_ABI Func_69383B2B4E3AEABF(s32 handle, void* data, s32 unk); -s32 PS4_SYSV_ABI Func_791560C32F4F6D68(); -s32 PS4_SYSV_ABI Func_7C955961EA85B6D3(); -s32 PS4_SYSV_ABI Func_9952277839236BA7(); -s32 PS4_SYSV_ABI Func_9A276E739E54EEAF(); -s32 PS4_SYSV_ABI Func_9E501994E289CBE7(); -s32 PS4_SYSV_ABI Func_A31A0320D80EAD99(); -s32 PS4_SYSV_ABI Func_A31F4DA8B3BD2E12(); -s32 PS4_SYSV_ABI Func_A92D7C23AC364993(); -s32 PS4_SYSV_ABI Func_ADCCC25CB876FDBE(); -s32 PS4_SYSV_ABI Func_B16652641FE69F0E(); -s32 PS4_SYSV_ABI Func_B9A6FA0735EC7E49(); -s32 PS4_SYSV_ABI Func_FC193BD653F2AF2E(); -s32 PS4_SYSV_ABI Func_FF2E0E53015FE231(); - -void RegisterDistortion(Core::Loader::SymbolsResolver* sym); -void RegisterReprojection(Core::Loader::SymbolsResolver* sym); -void RegisterLib(Core::Loader::SymbolsResolver* sym); -} // namespace Libraries::Hmd \ No newline at end of file diff --git a/src/core/libraries/hmd/hmd_distortion.cpp b/src/core/libraries/hmd/hmd_distortion.cpp deleted file mode 100644 index 3f454f7d2..000000000 --- a/src/core/libraries/hmd/hmd_distortion.cpp +++ /dev/null @@ -1,103 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "common/logging/log.h" -#include "core/libraries/error_codes.h" -#include "core/libraries/hmd/hmd.h" -#include "core/libraries/hmd/hmd_error.h" -#include "core/libraries/libs.h" - -namespace Libraries::Hmd { - -static bool g_library_initialized = false; - -s32 PS4_SYSV_ABI sceHmdDistortionInitialize(void* reserved) { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - g_library_initialized = true; - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdDistortionGet2dVrCommand() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdDistortionGetCompoundEyeCorrectionCommand() { - // Stubbed on real hardware. - return ORBIS_HMD_ERROR_PARAMETER_INVALID; -} - -s32 PS4_SYSV_ABI sceHmdDistortionGetCorrectionCommand() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdDistortionGetWideNearCorrectionCommand() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdDistortionGetWorkMemoryAlign() { - return 0x400; -} - -s32 PS4_SYSV_ABI sceHmdDistortionGetWorkMemorySize() { - return 0x20000; -} - -s32 PS4_SYSV_ABI sceHmdDistortionSetOutputMinColor() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_B26430EA74FC3DC0() { - // Stubbed on real hardware. - return ORBIS_HMD_ERROR_PARAMETER_INVALID; -} - -s32 PS4_SYSV_ABI sceHmdGetDistortionParams() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdDistortionTerminate() { - // Internal (non-exported) library function for terminating the distortion sub-library. - if (!g_library_initialized) { - return ORBIS_HMD_ERROR_NOT_INITIALIZED; - } - g_library_initialized = false; - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_B614F290B67FB59B() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -void RegisterDistortion(Core::Loader::SymbolsResolver* sym) { - LIB_FUNCTION("gEokC+OGI8g", "libSceHmdDistortion", 1, "libSceHmd", - sceHmdDistortionGet2dVrCommand); - LIB_FUNCTION("za4xJfzCBcM", "libSceHmd", 1, "libSceHmd", sceHmdDistortionGet2dVrCommand); - LIB_FUNCTION("ER2ar8yUmbk", "libSceHmdDistortion", 1, "libSceHmd", - sceHmdDistortionGetCompoundEyeCorrectionCommand); - LIB_FUNCTION("HT8qWOTOGmo", "libSceHmdDistortion", 1, "libSceHmd", - sceHmdDistortionGetCorrectionCommand); - LIB_FUNCTION("grCYks4m8Jw", "libSceHmd", 1, "libSceHmd", sceHmdDistortionGetCorrectionCommand); - LIB_FUNCTION("Vkkhy8RFIuk", "libSceHmdDistortion", 1, "libSceHmd", - sceHmdDistortionGetWideNearCorrectionCommand); - LIB_FUNCTION("goi5ASvH-V8", "libSceHmd", 1, "libSceHmd", - sceHmdDistortionGetWideNearCorrectionCommand); - LIB_FUNCTION("1cS7W5J-v3k", "libSceHmdDistortion", 1, "libSceHmd", - sceHmdDistortionGetWorkMemoryAlign); - LIB_FUNCTION("8Ick-e6cDVY", "libSceHmd", 1, "libSceHmd", sceHmdDistortionGetWorkMemoryAlign); - LIB_FUNCTION("36xDKk+Hw7o", "libSceHmdDistortion", 1, "libSceHmd", - sceHmdDistortionGetWorkMemorySize); - LIB_FUNCTION("D5JfdpJKvXk", "libSceHmd", 1, "libSceHmd", sceHmdDistortionGetWorkMemorySize); - LIB_FUNCTION("ao8NZ+FRYJE", "libSceHmdDistortion", 1, "libSceHmd", sceHmdDistortionInitialize); - LIB_FUNCTION("8A4T5ahi790", "libSceHmdDistortion", 1, "libSceHmd", - sceHmdDistortionSetOutputMinColor); - LIB_FUNCTION("mP2ZcYmDg-o", "libSceHmd", 1, "libSceHmd", sceHmdGetDistortionParams); - LIB_FUNCTION("smQw6nT8PcA", "libSceHmdDistortion", 1, "libSceHmd", Func_B26430EA74FC3DC0); - LIB_FUNCTION("thTykLZ-tZs", "libSceHmd", 1, "libSceHmd", Func_B614F290B67FB59B); -} -} // namespace Libraries::Hmd \ No newline at end of file diff --git a/src/core/libraries/hmd/hmd_error.h b/src/core/libraries/hmd/hmd_error.h deleted file mode 100644 index 8e6a7f753..000000000 --- a/src/core/libraries/hmd/hmd_error.h +++ /dev/null @@ -1,27 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -constexpr int ORBIS_HMD_ERROR_ALREADY_INITIALIZED = 0x81110001; -constexpr int ORBIS_HMD_ERROR_NOT_INITIALIZED = 0x81110002; -constexpr int ORBIS_HMD_ERROR_HANDLE_INVALID = 0x81110003; -constexpr int ORBIS_HMD_ERROR_DEVICE_DISCONNECTED = 0x81110004; -constexpr int ORBIS_HMD_ERROR_WRONG_ID = 0x81110005; -constexpr int ORBIS_HMD_ERROR_ALREADY_OPENED = 0x81110006; -constexpr int ORBIS_HMD_ERROR_INSUFFICIENT_RESOURCE = 0x81110007; -constexpr int ORBIS_HMD_ERROR_PARAMETER_NULL = 0x81110008; -constexpr int ORBIS_HMD_ERROR_PARAMETER_INVALID = 0x81110009; -constexpr int ORBIS_HMD_ERROR_NO_2D_DISTORTION_MAP_MEMORY = 0x8111000A; -constexpr int ORBIS_HMD_ERROR_2D_DISTORTION_MAP_INITIALIZATION_ERROR = 0x8111000B; -constexpr int ORBIS_HMD_ERROR_REPROJECTION_NOT_INITIALIZED = 0x8111000C; -constexpr int ORBIS_HMD_ERROR_REPROJECTION_ALREADY_INITIALIZED = 0x8111000D; -constexpr int ORBIS_HMD_ERROR_REPROJECTION_HMD_NOT_READY = 0x8111000E; -constexpr int ORBIS_HMD_ERROR_REPROJECTION_NO_DISPLAY_BUFFER = 0x8111000F; -constexpr int ORBIS_HMD_ERROR_REPROJECTION_WRONG_DISPLAY_BUFFER = 0x81110010; -constexpr int ORBIS_HMD_ERROR_REPROJECTION_DISPLAY_BUFFER_BUSY = 0x81110011; -constexpr int ORBIS_HMD_ERROR_REPROJECTION_RESOURCE_ALREADY_SET = 0x81110012; -constexpr int ORBIS_HMD_ERROR_REPROJECTION_RESOURCE_NOT_SET = 0x81110013; -constexpr int ORBIS_HMD_ERROR_REPROJECTION_THREAD_NOT_WORKING = 0x81110014; -constexpr int ORBIS_HMD_ERROR_REPROJECTION_NEVER_PROCESSED = 0x81110015; -constexpr int ORBIS_HMD_ERROR_UNSUPPORTED_FEATURE = 0x81110016; \ No newline at end of file diff --git a/src/core/libraries/hmd/hmd_reprojection.cpp b/src/core/libraries/hmd/hmd_reprojection.cpp deleted file mode 100644 index b94f72c89..000000000 --- a/src/core/libraries/hmd/hmd_reprojection.cpp +++ /dev/null @@ -1,219 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "common/logging/log.h" -#include "core/libraries/error_codes.h" -#include "core/libraries/hmd/hmd.h" -#include "core/libraries/hmd/hmd_error.h" -#include "core/libraries/libs.h" - -namespace Libraries::Hmd { - -s32 PS4_SYSV_ABI sceHmdReprojectionStartMultilayer() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdReprojectionAddDisplayBuffer() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdReprojectionClearUserEventEnd() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdReprojectionClearUserEventStart() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdReprojectionDebugGetLastInfo() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdReprojectionDebugGetLastInfoMultilayer() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdReprojectionFinalize() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdReprojectionFinalizeCapture() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdReprojectionInitialize() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdReprojectionInitializeCapture() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdReprojectionQueryGarlicBuffAlign() { - return 0x100; -} - -s32 PS4_SYSV_ABI sceHmdReprojectionQueryGarlicBuffSize() { - return 0x100000; -} - -s32 PS4_SYSV_ABI sceHmdReprojectionQueryOnionBuffAlign() { - return 0x100; -} - -s32 PS4_SYSV_ABI sceHmdReprojectionQueryOnionBuffSize() { - return 0x810; -} - -s32 PS4_SYSV_ABI sceHmdReprojectionSetCallback() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdReprojectionSetDisplayBuffers() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdReprojectionSetOutputMinColor() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdReprojectionSetUserEventEnd() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdReprojectionSetUserEventStart() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdReprojectionStart() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdReprojectionStart2dVr() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdReprojectionStartCapture() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdReprojectionStartLiveCapture() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdReprojectionStartMultilayer2() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdReprojectionStartWideNear() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdReprojectionStartWideNearWithOverlay() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdReprojectionStartWithOverlay() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdReprojectionStop() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdReprojectionStopCapture() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdReprojectionStopLiveCapture() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdReprojectionUnsetCallback() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdReprojectionUnsetDisplayBuffers() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_A31A0320D80EAD99() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_B9A6FA0735EC7E49() { - LOG_ERROR(Lib_Hmd, "(STUBBED) called"); - return ORBIS_OK; -} - -void RegisterReprojection(Core::Loader::SymbolsResolver* sym) { - LIB_FUNCTION("8gH1aLgty5I", "libsceHmdReprojectionMultilayer", 1, "libSceHmd", - sceHmdReprojectionStartMultilayer); - LIB_FUNCTION("NTIbBpSH9ik", "libSceHmd", 1, "libSceHmd", sceHmdReprojectionAddDisplayBuffer); - LIB_FUNCTION("94+Ggm38KCg", "libSceHmd", 1, "libSceHmd", sceHmdReprojectionClearUserEventEnd); - LIB_FUNCTION("mdyFbaJj66M", "libSceHmd", 1, "libSceHmd", sceHmdReprojectionClearUserEventStart); - LIB_FUNCTION("MdV0akauNow", "libSceHmd", 1, "libSceHmd", sceHmdReprojectionDebugGetLastInfo); - LIB_FUNCTION("ymiwVjPB5+k", "libSceHmd", 1, "libSceHmd", - sceHmdReprojectionDebugGetLastInfoMultilayer); - LIB_FUNCTION("ZrV5YIqD09I", "libSceHmd", 1, "libSceHmd", sceHmdReprojectionFinalize); - LIB_FUNCTION("utHD2Ab-Ixo", "libSceHmd", 1, "libSceHmd", sceHmdReprojectionFinalizeCapture); - LIB_FUNCTION("OuygGEWkins", "libSceHmd", 1, "libSceHmd", sceHmdReprojectionInitialize); - LIB_FUNCTION("BTrQnC6fcAk", "libSceHmd", 1, "libSceHmd", sceHmdReprojectionInitializeCapture); - LIB_FUNCTION("TkcANcGM0s8", "libSceHmd", 1, "libSceHmd", - sceHmdReprojectionQueryGarlicBuffAlign); - LIB_FUNCTION("z0KtN1vqF2E", "libSceHmd", 1, "libSceHmd", sceHmdReprojectionQueryGarlicBuffSize); - LIB_FUNCTION("IWybWbR-xvA", "libSceHmd", 1, "libSceHmd", sceHmdReprojectionQueryOnionBuffAlign); - LIB_FUNCTION("kLUAkN6a1e8", "libSceHmd", 1, "libSceHmd", sceHmdReprojectionQueryOnionBuffSize); - LIB_FUNCTION("6CRWGc-evO4", "libSceHmd", 1, "libSceHmd", sceHmdReprojectionSetCallback); - LIB_FUNCTION("E+dPfjeQLHI", "libSceHmd", 1, "libSceHmd", sceHmdReprojectionSetDisplayBuffers); - LIB_FUNCTION("LjdLRysHU6Y", "libSceHmd", 1, "libSceHmd", sceHmdReprojectionSetOutputMinColor); - LIB_FUNCTION("knyIhlkpLgE", "libSceHmd", 1, "libSceHmd", sceHmdReprojectionSetUserEventEnd); - LIB_FUNCTION("7as0CjXW1B8", "libSceHmd", 1, "libSceHmd", sceHmdReprojectionSetUserEventStart); - LIB_FUNCTION("dntZTJ7meIU", "libSceHmd", 1, "libSceHmd", sceHmdReprojectionStart); - LIB_FUNCTION("q3e8+nEguyE", "libSceHmd", 1, "libSceHmd", sceHmdReprojectionStart2dVr); - LIB_FUNCTION("RrvyU1pjb9A", "libSceHmd", 1, "libSceHmd", sceHmdReprojectionStartCapture); - LIB_FUNCTION("XZ5QUzb4ae0", "libSceHmd", 1, "libSceHmd", sceHmdReprojectionStartLiveCapture); - LIB_FUNCTION("8gH1aLgty5I", "libSceHmd", 1, "libSceHmd", sceHmdReprojectionStartMultilayer); - LIB_FUNCTION("gqAG7JYeE7A", "libSceHmd", 1, "libSceHmd", sceHmdReprojectionStartMultilayer2); - LIB_FUNCTION("3JyuejcNhC0", "libSceHmd", 1, "libSceHmd", sceHmdReprojectionStartWideNear); - LIB_FUNCTION("mKa8scOc4-k", "libSceHmd", 1, "libSceHmd", - sceHmdReprojectionStartWideNearWithOverlay); - LIB_FUNCTION("kcldQ7zLYQQ", "libSceHmd", 1, "libSceHmd", sceHmdReprojectionStartWithOverlay); - LIB_FUNCTION("vzMEkwBQciM", "libSceHmd", 1, "libSceHmd", sceHmdReprojectionStop); - LIB_FUNCTION("F7Sndm5teWw", "libSceHmd", 1, "libSceHmd", sceHmdReprojectionStopCapture); - LIB_FUNCTION("PAa6cUL5bR4", "libSceHmd", 1, "libSceHmd", sceHmdReprojectionStopLiveCapture); - LIB_FUNCTION("0wnZViigP9o", "libSceHmd", 1, "libSceHmd", sceHmdReprojectionUnsetCallback); - LIB_FUNCTION("iGNNpDDjcwo", "libSceHmd", 1, "libSceHmd", sceHmdReprojectionUnsetDisplayBuffers); - LIB_FUNCTION("oxoDINgOrZk", "libSceHmd", 1, "libSceHmd", Func_A31A0320D80EAD99); - LIB_FUNCTION("uab6BzXsfkk", "libSceHmd", 1, "libSceHmd", Func_B9A6FA0735EC7E49); -} -} // namespace Libraries::Hmd \ No newline at end of file diff --git a/src/core/libraries/hmd/hmd_setup_dialog.cpp b/src/core/libraries/hmd/hmd_setup_dialog.cpp deleted file mode 100644 index 6af312624..000000000 --- a/src/core/libraries/hmd/hmd_setup_dialog.cpp +++ /dev/null @@ -1,68 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "common/assert.h" -#include "common/logging/log.h" -#include "core/libraries/error_codes.h" -#include "core/libraries/hmd/hmd_setup_dialog.h" -#include "core/libraries/libs.h" - -namespace Libraries::HmdSetupDialog { - -s32 PS4_SYSV_ABI sceHmdSetupDialogInitialize() { - LOG_ERROR(Lib_HmdSetupDialog, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdSetupDialogClose() { - LOG_ERROR(Lib_HmdSetupDialog, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdSetupDialogOpen(const OrbisHmdSetupDialogParam* param) { - LOG_ERROR(Lib_HmdSetupDialog, "(STUBBED) called"); - // On real hardware, a dialog would show up telling the user to connect a PSVR headset. - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceHmdSetupDialogGetResult(OrbisHmdSetupDialogResult* result) { - LOG_ERROR(Lib_HmdSetupDialog, "(STUBBED) called"); - // Simulates behavior of user pressing circle to cancel the dialog. - // Result::OK would mean a headset was connected. - result->result = Libraries::CommonDialog::Result::USER_CANCELED; - return ORBIS_OK; -} - -Libraries::CommonDialog::Status PS4_SYSV_ABI sceHmdSetupDialogUpdateStatus() { - LOG_ERROR(Lib_HmdSetupDialog, "(STUBBED) called"); - return Libraries::CommonDialog::Status::FINISHED; -} - -Libraries::CommonDialog::Status PS4_SYSV_ABI sceHmdSetupDialogGetStatus() { - LOG_ERROR(Lib_HmdSetupDialog, "(STUBBED) called"); - return Libraries::CommonDialog::Status::FINISHED; -} - -s32 PS4_SYSV_ABI sceHmdSetupDialogTerminate() { - LOG_ERROR(Lib_HmdSetupDialog, "(STUBBED) called"); - return ORBIS_OK; -} - -void RegisterLib(Core::Loader::SymbolsResolver* sym) { - LIB_FUNCTION("nmHzU4Gh0xs", "libSceHmdSetupDialog", 1, "libSceHmdSetupDialog", - sceHmdSetupDialogClose); - LIB_FUNCTION("6lVRHMV5LY0", "libSceHmdSetupDialog", 1, "libSceHmdSetupDialog", - sceHmdSetupDialogGetResult); - LIB_FUNCTION("J9eBpW1udl4", "libSceHmdSetupDialog", 1, "libSceHmdSetupDialog", - sceHmdSetupDialogGetStatus); - LIB_FUNCTION("NB1Y2kA2jCY", "libSceHmdSetupDialog", 1, "libSceHmdSetupDialog", - sceHmdSetupDialogInitialize); - LIB_FUNCTION("NNgiV4T+akU", "libSceHmdSetupDialog", 1, "libSceHmdSetupDialog", - sceHmdSetupDialogOpen); - LIB_FUNCTION("+z4OJmFreZc", "libSceHmdSetupDialog", 1, "libSceHmdSetupDialog", - sceHmdSetupDialogTerminate); - LIB_FUNCTION("Ud7j3+RDIBg", "libSceHmdSetupDialog", 1, "libSceHmdSetupDialog", - sceHmdSetupDialogUpdateStatus); -}; - -} // namespace Libraries::HmdSetupDialog \ No newline at end of file diff --git a/src/core/libraries/hmd/hmd_setup_dialog.h b/src/core/libraries/hmd/hmd_setup_dialog.h deleted file mode 100644 index b5de52531..000000000 --- a/src/core/libraries/hmd/hmd_setup_dialog.h +++ /dev/null @@ -1,38 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "common/types.h" -#include "core/libraries/system/commondialog.h" -#include "core/libraries/system/userservice.h" - -namespace Core::Loader { -class SymbolsResolver; -} - -namespace Libraries::HmdSetupDialog { - -struct OrbisHmdSetupDialogParam { - Libraries::CommonDialog::BaseParam base_param; - u64 size; - Libraries::UserService::OrbisUserServiceUserId user_id; - bool disable_handover_screen; - u8 reserved[40]; -}; - -struct OrbisHmdSetupDialogResult { - Libraries::CommonDialog::Result result; - u8 reserved[32]; -}; - -s32 PS4_SYSV_ABI sceHmdSetupDialogClose(); -s32 PS4_SYSV_ABI sceHmdSetupDialogGetResult(OrbisHmdSetupDialogResult* result); -Libraries::CommonDialog::Status PS4_SYSV_ABI sceHmdSetupDialogGetStatus(); -s32 PS4_SYSV_ABI sceHmdSetupDialogInitialize(); -s32 PS4_SYSV_ABI sceHmdSetupDialogOpen(const OrbisHmdSetupDialogParam* param); -s32 PS4_SYSV_ABI sceHmdSetupDialogTerminate(); -Libraries::CommonDialog::Status PS4_SYSV_ABI sceHmdSetupDialogUpdateStatus(); - -void RegisterLib(Core::Loader::SymbolsResolver* sym); -} // namespace Libraries::HmdSetupDialog \ No newline at end of file diff --git a/src/core/libraries/ime/error_dialog.cpp b/src/core/libraries/ime/error_dialog.cpp index 09a192534..4931f123e 100644 --- a/src/core/libraries/ime/error_dialog.cpp +++ b/src/core/libraries/ime/error_dialog.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/libraries/ime/error_dialog.h b/src/core/libraries/ime/error_dialog.h index 75643b1db..e4e399ab3 100644 --- a/src/core/libraries/ime/error_dialog.h +++ b/src/core/libraries/ime/error_dialog.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/ime/ime.cpp b/src/core/libraries/ime/ime.cpp index 96ae446fa..d7ebb4730 100644 --- a/src/core/libraries/ime/ime.cpp +++ b/src/core/libraries/ime/ime.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/libraries/ime/ime.h b/src/core/libraries/ime/ime.h index b2b4a51ad..5071b835b 100644 --- a/src/core/libraries/ime/ime.h +++ b/src/core/libraries/ime/ime.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/ime/ime_common.h b/src/core/libraries/ime/ime_common.h index eafb2ce9d..5c1f45226 100644 --- a/src/core/libraries/ime/ime_common.h +++ b/src/core/libraries/ime/ime_common.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/ime/ime_dialog.cpp b/src/core/libraries/ime/ime_dialog.cpp index 226570bd6..21e01ae66 100644 --- a/src/core/libraries/ime/ime_dialog.cpp +++ b/src/core/libraries/ime/ime_dialog.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/libraries/ime/ime_dialog.h b/src/core/libraries/ime/ime_dialog.h index 532762ccc..646fb9eaf 100644 --- a/src/core/libraries/ime/ime_dialog.h +++ b/src/core/libraries/ime/ime_dialog.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/ime/ime_dialog_ui.cpp b/src/core/libraries/ime/ime_dialog_ui.cpp index 9611e7c49..d511fd764 100644 --- a/src/core/libraries/ime/ime_dialog_ui.cpp +++ b/src/core/libraries/ime/ime_dialog_ui.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/libraries/ime/ime_dialog_ui.h b/src/core/libraries/ime/ime_dialog_ui.h index a0e03a523..62eb55a29 100644 --- a/src/core/libraries/ime/ime_dialog_ui.h +++ b/src/core/libraries/ime/ime_dialog_ui.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/ime/ime_error.h b/src/core/libraries/ime/ime_error.h index 77eeada39..5d87b871e 100644 --- a/src/core/libraries/ime/ime_error.h +++ b/src/core/libraries/ime/ime_error.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/ime/ime_ui.cpp b/src/core/libraries/ime/ime_ui.cpp index 19b9e2e8b..5847e5832 100644 --- a/src/core/libraries/ime/ime_ui.cpp +++ b/src/core/libraries/ime/ime_ui.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/libraries/ime/ime_ui.h b/src/core/libraries/ime/ime_ui.h index 5eb371bd9..b9e3517c2 100644 --- a/src/core/libraries/ime/ime_ui.h +++ b/src/core/libraries/ime/ime_ui.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/jpeg/jpeg_error.h b/src/core/libraries/jpeg/jpeg_error.h deleted file mode 100644 index b9aa7483c..000000000 --- a/src/core/libraries/jpeg/jpeg_error.h +++ /dev/null @@ -1,9 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -constexpr int ORBIS_JPEG_ENC_ERROR_INVALID_ADDR = 0x80650101; -constexpr int ORBIS_JPEG_ENC_ERROR_INVALID_SIZE = 0x80650102; -constexpr int ORBIS_JPEG_ENC_ERROR_INVALID_PARAM = 0x80650103; -constexpr int ORBIS_JPEG_ENC_ERROR_INVALID_HANDLE = 0x80650104; diff --git a/src/core/libraries/jpeg/jpegenc.cpp b/src/core/libraries/jpeg/jpegenc.cpp deleted file mode 100644 index 1d22d7e85..000000000 --- a/src/core/libraries/jpeg/jpegenc.cpp +++ /dev/null @@ -1,207 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include - -#include "common/alignment.h" -#include "common/assert.h" -#include "common/logging/log.h" -#include "core/libraries/error_codes.h" -#include "core/libraries/libs.h" -#include "jpeg_error.h" -#include "jpegenc.h" - -namespace Libraries::JpegEnc { - -constexpr s32 ORBIS_JPEG_ENC_MINIMUM_MEMORY_SIZE = 0x800; -constexpr u32 ORBIS_JPEG_ENC_MAX_IMAGE_DIMENSION = 0xFFFF; -constexpr u32 ORBIS_JPEG_ENC_MAX_IMAGE_PITCH = 0xFFFFFFF; -constexpr u32 ORBIS_JPEG_ENC_MAX_IMAGE_SIZE = 0x7FFFFFFF; - -static s32 ValidateJpegEncCreateParam(const OrbisJpegEncCreateParam* param) { - if (!param) { - return ORBIS_JPEG_ENC_ERROR_INVALID_ADDR; - } - if (param->size != sizeof(OrbisJpegEncCreateParam)) { - return ORBIS_JPEG_ENC_ERROR_INVALID_SIZE; - } - if (param->attr != ORBIS_JPEG_ENC_ATTRIBUTE_NONE) { - return ORBIS_JPEG_ENC_ERROR_INVALID_PARAM; - } - return ORBIS_OK; -} - -static s32 ValidateJpegEncMemory(const void* memory, const u32 memory_size) { - if (!memory) { - return ORBIS_JPEG_ENC_ERROR_INVALID_ADDR; - } - if (memory_size < ORBIS_JPEG_ENC_MINIMUM_MEMORY_SIZE) { - return ORBIS_JPEG_ENC_ERROR_INVALID_SIZE; - } - return ORBIS_OK; -} - -static s32 ValidateJpegEncEncodeParam(const OrbisJpegEncEncodeParam* param) { - - // Validate addresses - if (!param) { - return ORBIS_JPEG_ENC_ERROR_INVALID_ADDR; - } - if (!param->image || (param->pixel_format != ORBIS_JPEG_ENC_PIXEL_FORMAT_Y8 && - !Common::IsAligned(reinterpret_cast(param->image), 4))) { - return ORBIS_JPEG_ENC_ERROR_INVALID_ADDR; - } - if (!param->jpeg) { - return ORBIS_JPEG_ENC_ERROR_INVALID_ADDR; - } - - // Validate sizes - if (param->image_size == 0 || param->jpeg_size == 0) { - return ORBIS_JPEG_ENC_ERROR_INVALID_SIZE; - } - - // Validate parameters - if (param->image_width > ORBIS_JPEG_ENC_MAX_IMAGE_DIMENSION || - param->image_height > ORBIS_JPEG_ENC_MAX_IMAGE_DIMENSION) { - return ORBIS_JPEG_ENC_ERROR_INVALID_PARAM; - } - if (param->image_pitch == 0 || param->image_pitch > ORBIS_JPEG_ENC_MAX_IMAGE_PITCH || - (param->pixel_format != ORBIS_JPEG_ENC_PIXEL_FORMAT_Y8 && - !Common::IsAligned(param->image_pitch, 4))) { - return ORBIS_JPEG_ENC_ERROR_INVALID_PARAM; - } - const auto calculated_size = param->image_height * param->image_pitch; - if (calculated_size > ORBIS_JPEG_ENC_MAX_IMAGE_SIZE || calculated_size > param->image_size) { - return ORBIS_JPEG_ENC_ERROR_INVALID_PARAM; - } - if (param->encode_mode != ORBIS_JPEG_ENC_ENCODE_MODE_NORMAL && - param->encode_mode != ORBIS_JPEG_ENC_ENCODE_MODE_MJPEG) { - return ORBIS_JPEG_ENC_ERROR_INVALID_PARAM; - } - if (param->color_space != ORBIS_JPEG_ENC_COLOR_SPACE_YCC && - param->color_space != ORBIS_JPEG_ENC_COLOR_SPACE_GRAYSCALE) { - return ORBIS_JPEG_ENC_ERROR_INVALID_PARAM; - } - if (param->sampling_type != ORBIS_JPEG_ENC_SAMPLING_TYPE_FULL && - param->sampling_type != ORBIS_JPEG_ENC_SAMPLING_TYPE_422 && - param->sampling_type != ORBIS_JPEG_ENC_SAMPLING_TYPE_420) { - return ORBIS_JPEG_ENC_ERROR_INVALID_PARAM; - } - if (param->restart_interval > ORBIS_JPEG_ENC_MAX_IMAGE_DIMENSION) { - return ORBIS_JPEG_ENC_ERROR_INVALID_PARAM; - } - switch (param->pixel_format) { - case ORBIS_JPEG_ENC_PIXEL_FORMAT_R8G8B8A8: - case ORBIS_JPEG_ENC_PIXEL_FORMAT_B8G8R8A8: - if (param->image_pitch >> 2 < param->image_width || - param->color_space != ORBIS_JPEG_ENC_COLOR_SPACE_YCC || - param->sampling_type == ORBIS_JPEG_ENC_SAMPLING_TYPE_FULL) { - return ORBIS_JPEG_ENC_ERROR_INVALID_PARAM; - } - break; - case ORBIS_JPEG_ENC_PIXEL_FORMAT_Y8U8Y8V8: - if (param->image_pitch >> 1 < Common::AlignUp(param->image_width, 2) || - param->color_space != ORBIS_JPEG_ENC_COLOR_SPACE_YCC || - param->sampling_type == ORBIS_JPEG_ENC_SAMPLING_TYPE_FULL) { - return ORBIS_JPEG_ENC_ERROR_INVALID_PARAM; - } - break; - case ORBIS_JPEG_ENC_PIXEL_FORMAT_Y8: - if (param->image_pitch < param->image_width || - param->color_space != ORBIS_JPEG_ENC_COLOR_SPACE_GRAYSCALE || - param->sampling_type != ORBIS_JPEG_ENC_SAMPLING_TYPE_FULL) { - return ORBIS_JPEG_ENC_ERROR_INVALID_PARAM; - } - break; - default: - return ORBIS_JPEG_ENC_ERROR_INVALID_PARAM; - } - - return ORBIS_OK; -} - -static s32 ValidateJpecEngHandle(OrbisJpegEncHandle handle) { - if (!handle || !Common::IsAligned(reinterpret_cast(handle), 0x20) || - handle->handle != handle) { - return ORBIS_JPEG_ENC_ERROR_INVALID_HANDLE; - } - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceJpegEncCreate(const OrbisJpegEncCreateParam* param, void* memory, - const u32 memory_size, OrbisJpegEncHandle* handle) { - if (auto param_ret = ValidateJpegEncCreateParam(param); param_ret != ORBIS_OK) { - LOG_ERROR(Lib_Jpeg, "Invalid create param"); - return param_ret; - } - if (auto memory_ret = ValidateJpegEncMemory(memory, memory_size); memory_ret != ORBIS_OK) { - LOG_ERROR(Lib_Jpeg, "Invalid memory"); - return memory_ret; - } - if (!handle) { - LOG_ERROR(Lib_Jpeg, "Invalid handle output"); - return ORBIS_JPEG_ENC_ERROR_INVALID_ADDR; - } - - auto* handle_internal = reinterpret_cast( - Common::AlignUp(reinterpret_cast(memory), 0x20)); - handle_internal->handle = handle_internal; - handle_internal->handle_size = sizeof(OrbisJpegEncHandleInternal*); - *handle = handle_internal; - - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceJpegEncDelete(OrbisJpegEncHandle handle) { - if (auto handle_ret = ValidateJpecEngHandle(handle); handle_ret != ORBIS_OK) { - LOG_ERROR(Lib_Jpeg, "Invalid handle"); - return handle_ret; - } - handle->handle = nullptr; - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceJpegEncEncode(OrbisJpegEncHandle handle, const OrbisJpegEncEncodeParam* param, - OrbisJpegEncOutputInfo* output_info) { - if (auto handle_ret = ValidateJpecEngHandle(handle); handle_ret != ORBIS_OK) { - LOG_ERROR(Lib_Jpeg, "Invalid handle"); - return handle_ret; - } - if (auto param_ret = ValidateJpegEncEncodeParam(param); param_ret != ORBIS_OK) { - LOG_ERROR(Lib_Jpeg, "Invalid encode param"); - return param_ret; - } - - LOG_ERROR(Lib_Jpeg, - "(STUBBED) image_size = {} , jpeg_size = {} , image_width = {} , image_height = {} , " - "image_pitch = {} , pixel_format = {} , encode_mode = {} , color_space = {} , " - "sampling_type = {} , compression_ratio = {} , restart_interval = {}", - param->image_size, param->jpeg_size, param->image_width, param->image_height, - param->image_pitch, magic_enum::enum_name(param->pixel_format), - magic_enum::enum_name(param->encode_mode), magic_enum::enum_name(param->color_space), - magic_enum::enum_name(param->sampling_type), param->compression_ratio, - param->restart_interval); - - if (output_info) { - output_info->size = param->jpeg_size; - output_info->height = param->image_height; - } - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceJpegEncQueryMemorySize(const OrbisJpegEncCreateParam* param) { - if (auto param_ret = ValidateJpegEncCreateParam(param); param_ret != ORBIS_OK) { - LOG_ERROR(Lib_Jpeg, "Invalid create param"); - return param_ret; - } - return ORBIS_JPEG_ENC_MINIMUM_MEMORY_SIZE; -} - -void RegisterLib(Core::Loader::SymbolsResolver* sym) { - LIB_FUNCTION("K+rocojkr-I", "libSceJpegEnc", 1, "libSceJpegEnc", sceJpegEncCreate); - LIB_FUNCTION("j1LyMdaM+C0", "libSceJpegEnc", 1, "libSceJpegEnc", sceJpegEncDelete); - LIB_FUNCTION("QbrU0cUghEM", "libSceJpegEnc", 1, "libSceJpegEnc", sceJpegEncEncode); - LIB_FUNCTION("o6ZgXfFdWXQ", "libSceJpegEnc", 1, "libSceJpegEnc", sceJpegEncQueryMemorySize); -}; - -} // namespace Libraries::JpegEnc diff --git a/src/core/libraries/jpeg/jpegenc.h b/src/core/libraries/jpeg/jpegenc.h deleted file mode 100644 index e0c39c58d..000000000 --- a/src/core/libraries/jpeg/jpegenc.h +++ /dev/null @@ -1,84 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "common/types.h" - -namespace Core::Loader { -class SymbolsResolver; -} - -namespace Libraries::JpegEnc { - -enum OrbisJpegEncCreateParamAttributes : u32 { ORBIS_JPEG_ENC_ATTRIBUTE_NONE = 0 }; - -enum OrbisJpegEncEncodeParamPixelFormat : u16 { - ORBIS_JPEG_ENC_PIXEL_FORMAT_R8G8B8A8 = 0, - ORBIS_JPEG_ENC_PIXEL_FORMAT_B8G8R8A8 = 1, - ORBIS_JPEG_ENC_PIXEL_FORMAT_Y8U8Y8V8 = 10, - ORBIS_JPEG_ENC_PIXEL_FORMAT_Y8 = 11 -}; - -enum OrbisJpengEncEncodeParamEncodeMode : u16 { - ORBIS_JPEG_ENC_ENCODE_MODE_NORMAL = 0, - ORBIS_JPEG_ENC_ENCODE_MODE_MJPEG = 1 -}; - -enum OrbisJpengEncEncodeParamColorSpace : u16 { - ORBIS_JPEG_ENC_COLOR_SPACE_YCC = 1, - ORBIS_JPEG_ENC_COLOR_SPACE_GRAYSCALE = 2 -}; - -enum OrbisJpengEncEncodeParamSamplingType : u8 { - ORBIS_JPEG_ENC_SAMPLING_TYPE_FULL = 0, - ORBIS_JPEG_ENC_SAMPLING_TYPE_422 = 1, - ORBIS_JPEG_ENC_SAMPLING_TYPE_420 = 2 -}; - -struct OrbisJpegEncHandleInternal { - OrbisJpegEncHandleInternal* handle; - u32 handle_size; -}; -static_assert(sizeof(OrbisJpegEncHandleInternal) == 0x10); - -typedef OrbisJpegEncHandleInternal* OrbisJpegEncHandle; - -struct OrbisJpegEncCreateParam { - u32 size; - OrbisJpegEncCreateParamAttributes attr; -}; -static_assert(sizeof(OrbisJpegEncCreateParam) == 0x8); - -struct OrbisJpegEncEncodeParam { - void* image; - void* jpeg; - u32 image_size; - u32 jpeg_size; - u32 image_width; - u32 image_height; - u32 image_pitch; - OrbisJpegEncEncodeParamPixelFormat pixel_format; - OrbisJpengEncEncodeParamEncodeMode encode_mode; - OrbisJpengEncEncodeParamColorSpace color_space; - OrbisJpengEncEncodeParamSamplingType sampling_type; - u8 compression_ratio; - s32 restart_interval; -}; -static_assert(sizeof(OrbisJpegEncEncodeParam) == 0x30); - -struct OrbisJpegEncOutputInfo { - u32 size; - u32 height; -}; -static_assert(sizeof(OrbisJpegEncOutputInfo) == 0x8); - -s32 PS4_SYSV_ABI sceJpegEncCreate(const OrbisJpegEncCreateParam* param, void* memory, - u32 memory_size, OrbisJpegEncHandle* handle); -s32 PS4_SYSV_ABI sceJpegEncDelete(OrbisJpegEncHandle handle); -s32 PS4_SYSV_ABI sceJpegEncEncode(OrbisJpegEncHandle handle, const OrbisJpegEncEncodeParam* param, - OrbisJpegEncOutputInfo* output_info); -s32 PS4_SYSV_ABI sceJpegEncQueryMemorySize(const OrbisJpegEncCreateParam* param); - -void RegisterLib(Core::Loader::SymbolsResolver* sym); -} // namespace Libraries::JpegEnc diff --git a/src/core/libraries/kernel/aio.cpp b/src/core/libraries/kernel/aio.cpp index ee518030e..0bb2d6f5e 100644 --- a/src/core/libraries/kernel/aio.cpp +++ b/src/core/libraries/kernel/aio.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/libraries/kernel/aio.h b/src/core/libraries/kernel/aio.h index 0ad21e938..c81cc99fb 100644 --- a/src/core/libraries/kernel/aio.h +++ b/src/core/libraries/kernel/aio.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/kernel/debug.cpp b/src/core/libraries/kernel/debug.cpp index 5e3b98b7c..1376c15b3 100644 --- a/src/core/libraries/kernel/debug.cpp +++ b/src/core/libraries/kernel/debug.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/assert.h" diff --git a/src/core/libraries/kernel/debug.h b/src/core/libraries/kernel/debug.h index 177046862..b5af260cb 100644 --- a/src/core/libraries/kernel/debug.h +++ b/src/core/libraries/kernel/debug.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/kernel/equeue.cpp b/src/core/libraries/kernel/equeue.cpp index 68a6dae24..f0760e50e 100644 --- a/src/core/libraries/kernel/equeue.cpp +++ b/src/core/libraries/kernel/equeue.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/libraries/kernel/equeue.h b/src/core/libraries/kernel/equeue.h index 9b3c73c19..95501f6be 100644 --- a/src/core/libraries/kernel/equeue.h +++ b/src/core/libraries/kernel/equeue.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/kernel/file_system.cpp b/src/core/libraries/kernel/file_system.cpp index 085e18b9f..de54befff 100644 --- a/src/core/libraries/kernel/file_system.cpp +++ b/src/core/libraries/kernel/file_system.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/libraries/kernel/file_system.h b/src/core/libraries/kernel/file_system.h index d8989828a..318f12482 100644 --- a/src/core/libraries/kernel/file_system.h +++ b/src/core/libraries/kernel/file_system.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/kernel/kernel.cpp b/src/core/libraries/kernel/kernel.cpp index 4d74e731b..c8dcaad72 100644 --- a/src/core/libraries/kernel/kernel.cpp +++ b/src/core/libraries/kernel/kernel.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include @@ -58,7 +58,7 @@ void KernelSignalRequest() { } static void KernelServiceThread(std::stop_token stoken) { - Common::SetCurrentThreadName("shadPS4:KernelServiceThread"); + Common::SetCurrentThreadName("sB:KernelServiceThread"); while (!stoken.stop_requested()) { HLE_TRACE; diff --git a/src/core/libraries/kernel/kernel.h b/src/core/libraries/kernel/kernel.h index ab5729f3b..e6da0113c 100644 --- a/src/core/libraries/kernel/kernel.h +++ b/src/core/libraries/kernel/kernel.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/kernel/memory.cpp b/src/core/libraries/kernel/memory.cpp index 378064e44..d397a5852 100644 --- a/src/core/libraries/kernel/memory.cpp +++ b/src/core/libraries/kernel/memory.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/libraries/kernel/memory.h b/src/core/libraries/kernel/memory.h index 9f78eb84f..f9c741898 100644 --- a/src/core/libraries/kernel/memory.h +++ b/src/core/libraries/kernel/memory.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/kernel/orbis_error.h b/src/core/libraries/kernel/orbis_error.h index 6ebff0ba3..22e6dad10 100644 --- a/src/core/libraries/kernel/orbis_error.h +++ b/src/core/libraries/kernel/orbis_error.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/kernel/posix_error.h b/src/core/libraries/kernel/posix_error.h index 0f7cf3e50..ddde2a9ee 100644 --- a/src/core/libraries/kernel/posix_error.h +++ b/src/core/libraries/kernel/posix_error.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/kernel/process.cpp b/src/core/libraries/kernel/process.cpp index 2af5aa1bf..94c188340 100644 --- a/src/core/libraries/kernel/process.cpp +++ b/src/core/libraries/kernel/process.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/elf_info.h" diff --git a/src/core/libraries/kernel/process.h b/src/core/libraries/kernel/process.h index 6296fe404..f9797757f 100644 --- a/src/core/libraries/kernel/process.h +++ b/src/core/libraries/kernel/process.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/kernel/sync/mutex.cpp b/src/core/libraries/kernel/sync/mutex.cpp index b9bb33036..fb13c12a4 100644 --- a/src/core/libraries/kernel/sync/mutex.cpp +++ b/src/core/libraries/kernel/sync/mutex.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "mutex.h" diff --git a/src/core/libraries/kernel/sync/mutex.h b/src/core/libraries/kernel/sync/mutex.h index d26c984ef..62a3e1448 100644 --- a/src/core/libraries/kernel/sync/mutex.h +++ b/src/core/libraries/kernel/sync/mutex.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/kernel/sync/semaphore.h b/src/core/libraries/kernel/sync/semaphore.h index 71926210f..723a666cd 100644 --- a/src/core/libraries/kernel/sync/semaphore.h +++ b/src/core/libraries/kernel/sync/semaphore.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/kernel/threads.cpp b/src/core/libraries/kernel/threads.cpp index 083dc8ee1..d8648dabd 100644 --- a/src/core/libraries/kernel/threads.cpp +++ b/src/core/libraries/kernel/threads.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "core/libraries/kernel/kernel.h" diff --git a/src/core/libraries/kernel/threads.h b/src/core/libraries/kernel/threads.h index 81535352c..7ff3b5e41 100644 --- a/src/core/libraries/kernel/threads.h +++ b/src/core/libraries/kernel/threads.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/kernel/threads/condvar.cpp b/src/core/libraries/kernel/threads/condvar.cpp index 9d429ed7d..e83c483c8 100644 --- a/src/core/libraries/kernel/threads/condvar.cpp +++ b/src/core/libraries/kernel/threads/condvar.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/libraries/kernel/threads/event_flag.cpp b/src/core/libraries/kernel/threads/event_flag.cpp index 7f2fdb163..091353798 100644 --- a/src/core/libraries/kernel/threads/event_flag.cpp +++ b/src/core/libraries/kernel/threads/event_flag.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/libraries/kernel/threads/exception.cpp b/src/core/libraries/kernel/threads/exception.cpp index f9a062da7..31ac000de 100644 --- a/src/core/libraries/kernel/threads/exception.cpp +++ b/src/core/libraries/kernel/threads/exception.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/assert.h" diff --git a/src/core/libraries/kernel/threads/exception.h b/src/core/libraries/kernel/threads/exception.h index f9655404a..4468936de 100644 --- a/src/core/libraries/kernel/threads/exception.h +++ b/src/core/libraries/kernel/threads/exception.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/kernel/threads/mutex.cpp b/src/core/libraries/kernel/threads/mutex.cpp index 51d2d3bcd..3f4b9e02d 100644 --- a/src/core/libraries/kernel/threads/mutex.cpp +++ b/src/core/libraries/kernel/threads/mutex.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/libraries/kernel/threads/pthread.cpp b/src/core/libraries/kernel/threads/pthread.cpp index 3742db5cf..7653ffbbc 100644 --- a/src/core/libraries/kernel/threads/pthread.cpp +++ b/src/core/libraries/kernel/threads/pthread.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/assert.h" diff --git a/src/core/libraries/kernel/threads/pthread.h b/src/core/libraries/kernel/threads/pthread.h index fed3b96fe..cc24f3242 100644 --- a/src/core/libraries/kernel/threads/pthread.h +++ b/src/core/libraries/kernel/threads/pthread.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/kernel/threads/pthread_attr.cpp b/src/core/libraries/kernel/threads/pthread_attr.cpp index 2f3f26049..143da52c9 100644 --- a/src/core/libraries/kernel/threads/pthread_attr.cpp +++ b/src/core/libraries/kernel/threads/pthread_attr.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "core/libraries/kernel/kernel.h" diff --git a/src/core/libraries/kernel/threads/pthread_clean.cpp b/src/core/libraries/kernel/threads/pthread_clean.cpp index 45a134b70..66021bfbe 100644 --- a/src/core/libraries/kernel/threads/pthread_clean.cpp +++ b/src/core/libraries/kernel/threads/pthread_clean.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "core/libraries/kernel/threads/pthread.h" diff --git a/src/core/libraries/kernel/threads/pthread_spec.cpp b/src/core/libraries/kernel/threads/pthread_spec.cpp index 38032f174..ea76f9772 100644 --- a/src/core/libraries/kernel/threads/pthread_spec.cpp +++ b/src/core/libraries/kernel/threads/pthread_spec.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "core/libraries/kernel/kernel.h" diff --git a/src/core/libraries/kernel/threads/rwlock.cpp b/src/core/libraries/kernel/threads/rwlock.cpp index 52109b58d..0bc731a63 100644 --- a/src/core/libraries/kernel/threads/rwlock.cpp +++ b/src/core/libraries/kernel/threads/rwlock.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "core/libraries/kernel/kernel.h" diff --git a/src/core/libraries/kernel/threads/semaphore.cpp b/src/core/libraries/kernel/threads/semaphore.cpp index 721b2c21a..b8e6d7e5b 100644 --- a/src/core/libraries/kernel/threads/semaphore.cpp +++ b/src/core/libraries/kernel/threads/semaphore.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/libraries/kernel/threads/sleepq.cpp b/src/core/libraries/kernel/threads/sleepq.cpp index cebbf3f01..21258ada3 100644 --- a/src/core/libraries/kernel/threads/sleepq.cpp +++ b/src/core/libraries/kernel/threads/sleepq.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/libraries/kernel/threads/sleepq.h b/src/core/libraries/kernel/threads/sleepq.h index a85aeca51..574fd92f1 100644 --- a/src/core/libraries/kernel/threads/sleepq.h +++ b/src/core/libraries/kernel/threads/sleepq.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/libraries/kernel/threads/stack.cpp b/src/core/libraries/kernel/threads/stack.cpp index 0f3a4d59d..126e556d3 100644 --- a/src/core/libraries/kernel/threads/stack.cpp +++ b/src/core/libraries/kernel/threads/stack.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/assert.h" diff --git a/src/core/libraries/kernel/threads/tcb.cpp b/src/core/libraries/kernel/threads/tcb.cpp index 043d11e4e..8c1a78ddb 100644 --- a/src/core/libraries/kernel/threads/tcb.cpp +++ b/src/core/libraries/kernel/threads/tcb.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/assert.h" diff --git a/src/core/libraries/kernel/threads/thread_state.cpp b/src/core/libraries/kernel/threads/thread_state.cpp index a8ad0e322..df2c7e493 100644 --- a/src/core/libraries/kernel/threads/thread_state.cpp +++ b/src/core/libraries/kernel/threads/thread_state.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/libraries/kernel/threads/thread_state.h b/src/core/libraries/kernel/threads/thread_state.h index c98f2083e..2a8e41b45 100644 --- a/src/core/libraries/kernel/threads/thread_state.h +++ b/src/core/libraries/kernel/threads/thread_state.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/kernel/time.cpp b/src/core/libraries/kernel/time.cpp index 2967dd4bf..b07a8ad08 100644 --- a/src/core/libraries/kernel/time.cpp +++ b/src/core/libraries/kernel/time.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/libraries/kernel/time.h b/src/core/libraries/kernel/time.h index 583d138b8..fad2981bf 100644 --- a/src/core/libraries/kernel/time.h +++ b/src/core/libraries/kernel/time.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/libc_internal/libc_internal.cpp b/src/core/libraries/libc_internal/libc_internal.cpp deleted file mode 100644 index 6a92d2317..000000000 --- a/src/core/libraries/libc_internal/libc_internal.cpp +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include -#include "common/assert.h" -#include "common/logging/log.h" -#include "core/libraries/error_codes.h" -#include "core/libraries/libs.h" -#include "libc_internal.h" -#include "libc_internal_io.h" -#include "libc_internal_math.h" -#include "libc_internal_memory.h" -#include "libc_internal_str.h" -#include "libc_internal_threads.h" -#include "printf.h" - -namespace Libraries::LibcInternal { - -void RegisterLib(Core::Loader::SymbolsResolver* sym) { - RegisterlibSceLibcInternalMath(sym); - RegisterlibSceLibcInternalStr(sym); - RegisterlibSceLibcInternalMemory(sym); - RegisterlibSceLibcInternalIo(sym); - RegisterlibSceLibcInternalThreads(sym); -} - -void ForceRegisterLib(Core::Loader::SymbolsResolver* sym) { - // Used to forcibly enable HLEs for broken LLE functions. - ForceRegisterlibSceLibcInternalIo(sym); -} -} // namespace Libraries::LibcInternal \ No newline at end of file diff --git a/src/core/libraries/libc_internal/libc_internal.h b/src/core/libraries/libc_internal/libc_internal.h deleted file mode 100644 index 1494a2ab2..000000000 --- a/src/core/libraries/libc_internal/libc_internal.h +++ /dev/null @@ -1,19 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "common/types.h" - -namespace Core::Loader { -class SymbolsResolver; -} - -namespace Libraries::LibcInternal { - -// I won't manage definitons of 3000+ functions, and they don't need to be accessed externally, -// so everything is just in the .cpp file - -void RegisterLib(Core::Loader::SymbolsResolver* sym); -void ForceRegisterLib(Core::Loader::SymbolsResolver* sym); -} // namespace Libraries::LibcInternal \ No newline at end of file diff --git a/src/core/libraries/libc_internal/libc_internal_io.cpp b/src/core/libraries/libc_internal/libc_internal_io.cpp deleted file mode 100644 index 0bb23eb78..000000000 --- a/src/core/libraries/libc_internal/libc_internal_io.cpp +++ /dev/null @@ -1,490 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include -#include -#include - -#include -#include "common/alignment.h" -#include "common/assert.h" -#include "common/logging/log.h" -#include "core/libraries/error_codes.h" -#include "core/libraries/kernel/file_system.h" -#include "core/libraries/kernel/kernel.h" -#include "core/libraries/kernel/posix_error.h" -#include "core/libraries/libc_internal/libc_internal_io.h" -#include "core/libraries/libc_internal/libc_internal_threads.h" -#include "core/libraries/libs.h" -#include "printf.h" - -namespace Libraries::LibcInternal { - -s32 PS4_SYSV_ABI internal_snprintf(char* s, u64 n, VA_ARGS) { - VA_CTX(ctx); - return snprintf_ctx(s, n, &ctx); -} - -std::map g_files{}; -// Constants for tracking accurate file indexes. -// Since the file struct is exposed to the application, accuracy is important. -static constexpr s32 g_initial_files = 5; -static constexpr s32 g_max_files = 0x100; - -OrbisFILE* PS4_SYSV_ABI internal__Fofind() { - u64 index = g_initial_files; - while (index != g_max_files) { - OrbisFILE* file = g_files[index]; - // If file doesn't exist, create it. - if (file == nullptr) { - file = new OrbisFILE(); - if (file == nullptr) { - return nullptr; - } - // Store new file in the array, initialize default values, and return it. - g_files[index] = file; - file->_Mode = 0x80; - file->_Idx = index; - return file; - } - // Special case, files with mode 0 are returned? - if (file->_Mode == 0) { - file->_Mode = 0xff7f; - return file; - } - index++; - } - return nullptr; -} - -void PS4_SYSV_ABI internal__Lockfilelock(OrbisFILE* file) { - if (file != nullptr && file->_Mutex != nullptr) { - internal__Mtxlock(&file->_Mutex); - } -} - -void PS4_SYSV_ABI internal__Unlockfilelock(OrbisFILE* file) { - if (file != nullptr && file->_Mutex != nullptr) { - internal__Mtxunlock(&file->_Mutex); - } -} - -OrbisFILE* PS4_SYSV_ABI internal__Foprep(const char* path, const char* mode, OrbisFILE* file, - s32 fd, s32 s_mode, s32 flag) { - if (file == nullptr) { - *Kernel::__Error() = POSIX_ENOMEM; - } - - // Preserve mode and index - Libraries::Kernel::PthreadMutexT mtx = file->_Mutex; - Libraries::Kernel::PthreadMutexT* mtx_ptr = &file->_Mutex; - u8 file_index = file->_Idx; - u16 file_mode = file->_Mode & 0x80; - - // Real library does a memcpy using a static global FILE object. - // This stored file is just zeros, with the only exception being a handle of -1. - memset(file, 0, sizeof(OrbisFILE)); - file->_Handle = -1; - - // Not sure what this magic is for, but I'll replicate it. - u8* ptr = &file->_Cbuf; - // Note: this field is supposed to be a pthread mutex. - // Since we don't export pthread HLEs for other functions, I'll avoid handling this for now. - file->_Mutex = nullptr; - file->_Idx = file_index; - file->_Buf = ptr; - file->_Bend = &file->unk2; - file->_Next = ptr; - file->_Rend = ptr; - file->_WRend = ptr; - file->_Wend = ptr; - file->_WWend = ptr; - file->_Rback = ptr; - file->_WRback = &file->unk1; - - // Parse inputted mode string - const char* mode_str = mode; - u16 calc_mode = 0; - u16 access_mode = 0; - if (mode_str[0] == 'r') { - calc_mode = 1 | file_mode; - } else if (mode_str[0] == 'w') { - calc_mode = 0x1a | file_mode; - } else if (mode_str[0] == 'a') { - calc_mode = 0x16 | file_mode; - } else { - // Closes the file and returns EINVAL. - file->_Mode = file_mode; - if (flag == 0) { - internal__Mtxinit(mtx_ptr, nullptr); - } else { - file->_Mutex = mtx; - internal__Unlockfilelock(file); - } - internal_fclose(file); - *Kernel::__Error() = POSIX_EINVAL; - return nullptr; - } - file->_Mode = calc_mode; - - do { - // This is all basically straight from decomp, need to cleanup at some point. - if (mode_str[1] == '+') { - file_mode = 3; - if ((~calc_mode & 3) == 0) { - break; - } - } else if (mode_str[1] != 'b') { - file_mode = 0x20; - if ((calc_mode & 0x20) != 0) { - break; - } - } - mode_str++; - calc_mode = file_mode | calc_mode; - file->_Mode = calc_mode; - } while (true); - - if (path == nullptr && fd >= 0) { - // I guess this is for some internal behavior? - file->_Handle = fd; - } else { - fd = internal__Fopen(path, calc_mode, s_mode == 0x55); - file->_Handle = fd; - } - - // Error case - if (fd < 0) { - // Closes the file, but ensures errno is unchanged. - if (flag == 0) { - internal__Mtxinit(mtx_ptr, nullptr); - } else { - file->_Mutex = mtx; - internal__Unlockfilelock(file); - } - s32 old_errno = *Kernel::__Error(); - internal_fclose(file); - *Kernel::__Error() = old_errno; - return nullptr; - } - - if (flag == 0) { - char mtx_name[0x20]; - std::snprintf(mtx_name, 0x20, "FileFD:0x%08X", fd); - internal__Mtxinit(mtx_ptr, mtx_name); - } else { - file->_Mutex = mtx; - } - return file; -} - -s32 PS4_SYSV_ABI internal__Fopen(const char* path, u16 mode, bool flag) { - u32 large_mode = mode; - u16 open_mode = 0600; - if (!flag) { - open_mode = 0666; - } - // Straight from decomp, should probably get cleaned up at some point. - s32 creat_flag = large_mode << 5 & 0x200; - s32 excl_flag = large_mode << 5 & 0x800; - s32 misc_flags = (large_mode & 8) * 0x80 + (large_mode & 4) * 2; - // Real library has an array for this, where large_mode & 3 is used as an index. - // That array has values [0, 0, 1, 2], so this call should match the result. - s32 access_flag = std::max((large_mode & 3) - 1, 0); - s32 open_flags = creat_flag | misc_flags | excl_flag | access_flag; - return Libraries::Kernel::posix_open(path, open_flags, open_mode); -} - -OrbisFILE* PS4_SYSV_ABI internal_fopen(const char* path, const char* mode) { - std::scoped_lock lk{g_file_mtx}; - LOG_INFO(Lib_LibcInternal, "called, path {}, mode {}", path, mode); - OrbisFILE* file = internal__Fofind(); - OrbisFILE* ret_file = internal__Foprep(path, mode, file, -1, 0, 0); - if (ret_file == nullptr) { - LOG_ERROR(Lib_LibcInternal, "failed to open file {}", path); - } - return ret_file; -} - -s32 PS4_SYSV_ABI internal_fflush(OrbisFILE* file) { - if (file == nullptr) { - std::scoped_lock lk{g_file_mtx}; - s32 fflush_result = 0; - for (auto& file : g_files) { - s32 res = internal_fflush(file.second); - if (res < 0) { - fflush_result = -1; - } - } - return fflush_result; - } - if ((file->_Mode & 0x2000) != 0) { - internal__Lockfilelock(file); - u16 file_mode = file->_Mode; - u8* file_buf_start = file->_Buf; - u8* file_buf_end = file->_Next; - while (file_buf_start < file_buf_end) { - u64 size_to_write = static_cast(file_buf_end - file_buf_start); - s32 write_bytes = - Libraries::Kernel::sceKernelWrite(file->_Handle, file_buf_start, size_to_write); - if (write_bytes < 1) { - file_buf_start = file->_Buf; - file->_Next = file_buf_start; - file->_Wend = file_buf_start; - file->_WWend = file_buf_start; - u8* off_mode = reinterpret_cast(&file->_Mode) + 1; - *off_mode = *off_mode | 2; - internal__Unlockfilelock(file); - return -1; - } - file_buf_end = file->_Next; - file_buf_start += write_bytes; - } - file->_Next = file_buf_start; - file->_Wend = file_buf_start; - file->_WWend = file_buf_start; - file->_Mode = file_mode & 0xdfff; - internal__Unlockfilelock(file); - } - return 0; -} - -s64 PS4_SYSV_ABI internal__Nnl(OrbisFILE* file, u8* val1, u8* val2) { - if (val1 < val2) { - return val2 - val1; - } - return 0; -} - -s32 PS4_SYSV_ABI internal__Fspos(OrbisFILE* file, Orbisfpos_t* file_pos, s64 offset, s32 whence) { - if ((file->_Mode & 3) == 0) { - return -1; - } - if (internal_fflush(file) != 0) { - return -1; - } - if (whence >= 3) { - *Libraries::Kernel::__Error() = POSIX_EINVAL; - return -1; - } - if (file_pos != nullptr) { - offset = offset + file_pos->_Off; - } - if (whence == 1 && (file->_Mode & 0x1000) != 0) { - s64 val1 = internal__Nnl(file, file->_Rback, &file->_Cbuf); - u8* rsave_ptr = file->_Rsave; - if (rsave_ptr == nullptr) { - rsave_ptr = file->_Rend; - } - s64 val2 = internal__Nnl(file, file->_Next, rsave_ptr); - s64 val3 = internal__Nnl(file, file->_Next, file->_WRend); - offset = offset - (val1 + val2 + val3); - } - s64 result = 0; - if (whence == 2 || (whence == 1 && offset != 0) || (whence == 0 && offset != -1)) { - result = Libraries::Kernel::posix_lseek(file->_Handle, offset, whence); - } - if (result == -1) { - return -1; - } - - u16 file_mode = file->_Mode; - if ((file_mode & 0x3000) != 0) { - u8* file_buf = file->_Buf; - file->_Next = file_buf; - file->_Rend = file_buf; - file->_WRend = file_buf; - file->_Wend = file_buf; - file->_WWend = file_buf; - file->_Rback = &file->_Cbuf; - file->_WRback = &file->unk1; - file->_Rsave = nullptr; - } - if (file_pos != nullptr) { - std::memcpy(&file->_Wstate, &file_pos->_Wstate, sizeof(Orbis_Mbstatet)); - } - file->_Mode = file_mode & 0xceff; - return 0; -} - -s32 PS4_SYSV_ABI internal_fseek(OrbisFILE* file, s64 offset, s32 whence) { - internal__Lockfilelock(file); - LOG_TRACE(Lib_LibcInternal, "called, file handle {:#x}, offset {:#x}, whence {:#x}", - file->_Handle, offset, whence); - s32 result = internal__Fspos(file, nullptr, offset, whence); - internal__Unlockfilelock(file); - return result; -} - -s32 PS4_SYSV_ABI internal__Frprep(OrbisFILE* file) { - if (file->_Rend > file->_Next) { - return 1; - } - if ((file->_Mode & 0x100) != 0) { - return 0; - } - u16 mode = file->_Mode; - if ((mode & 0xa001) != 1) { - // Lot of magic here, might be valuable to figure out what this does. - file->_Mode = (((mode ^ 0x8000) >> 0xf) << 0xe) | mode | 0x200; - return -1; - } - - u8* file_buf = file->_Buf; - if ((mode & 0x800) == 0 && file_buf == &file->_Cbuf) { - // Allocate a new file buffer, for now, we'll use host malloc to create it. - // When we have an HLE for malloc, that should be used instead. - u8* new_buffer = std::bit_cast(std::malloc(0x10000)); - if (new_buffer == nullptr) { - file->_Buf = file_buf; - file->_Bend = file_buf + 1; - } else { - file->_Mode = file->_Mode | 0x40; - file->_Buf = new_buffer; - file->_Bend = new_buffer + 0x10000; - file->_WRend = new_buffer; - file->_WWend = new_buffer; - file_buf = new_buffer; - } - } - file->_Next = file_buf; - file->_Rend = file_buf; - file->_Wend = file_buf; - // Intentional shrinking here, library treats value as 32-bit. - s32 read_result = - Libraries::Kernel::sceKernelRead(file->_Handle, file_buf, file->_Bend - file_buf); - if (read_result < 0) { - u8* off_mode = reinterpret_cast(&file->_Mode) + 1; - *off_mode = *off_mode | 0x42; - return -1; - } else if (read_result != 0) { - file->_Mode = file->_Mode | 0x5000; - file->_Rend = file->_Rend + read_result; - return 1; - } - file->_Mode = (file->_Mode & 0xaeff) | 0x4100; - return 0; -} - -u64 PS4_SYSV_ABI internal_fread(char* ptr, u64 size, u64 nmemb, OrbisFILE* file) { - if (size == 0 || nmemb == 0) { - return 0; - } - internal__Lockfilelock(file); - LOG_TRACE(Lib_LibcInternal, "called, file handle {:#x}, size {:#x}, nmemb {:#x}", file->_Handle, - size, nmemb); - s64 total_size = size * nmemb; - s64 remaining_size = total_size; - if ((file->_Mode & 0x4000) != 0) { - while (remaining_size != 0) { - u8* rback_ptr = file->_Rback; - if (&file->_Cbuf <= rback_ptr) { - break; - } - file->_Rback = rback_ptr + 1; - *ptr = *rback_ptr; - ptr++; - remaining_size--; - } - } - - while (remaining_size != 0) { - u8* file_ptr = file->_Rsave; - if (file_ptr == nullptr) { - file_ptr = file->_Rend; - } else { - file->_Rend = file_ptr; - file->_Rsave = nullptr; - } - u8* src = file->_Next; - if (file_ptr <= src) { - s32 res = internal__Frprep(file); - if (res < 1) { - internal__Unlockfilelock(file); - return (total_size - remaining_size) / size; - } - src = file->_Next; - file_ptr = file->_Rend; - } - u64 copy_bytes = std::min(file_ptr - src, remaining_size); - std::memcpy(ptr, src, copy_bytes); - file->_Next += copy_bytes; - ptr += copy_bytes; - remaining_size -= copy_bytes; - } - internal__Unlockfilelock(file); - return (total_size - remaining_size) / size; -} - -void PS4_SYSV_ABI internal__Fofree(OrbisFILE* file) { - u8* cbuf_ptr = &file->_Cbuf; - s8 trunc_mode = static_cast(file->_Mode); - - file->_Mode = 0; - file->_Handle = -1; - file->_Buf = cbuf_ptr; - file->_Next = cbuf_ptr; - file->_Rend = cbuf_ptr; - file->_WRend = cbuf_ptr; - file->_Wend = cbuf_ptr; - file->_WWend = cbuf_ptr; - file->_Rback = cbuf_ptr; - file->_WRback = &file->unk1; - if (trunc_mode < 0) { - // Remove file from vector - g_files.erase(file->_Idx); - internal__Mtxdst(&file->_Mutex); - free(file); - } -} - -s32 PS4_SYSV_ABI internal_fclose(OrbisFILE* file) { - if (file == nullptr) { - return -1; - } - - LOG_INFO(Lib_LibcInternal, "called, file handle {:#x}", file->_Handle); - if ((file->_Mode & 3) == 0 || file->_Handle < 0) { - std::scoped_lock lk{g_file_mtx}; - internal__Fofree(file); - *Libraries::Kernel::__Error() = POSIX_EBADF; - } else { - s32 fflush_result = internal_fflush(file); - std::scoped_lock lk{g_file_mtx}; - if ((file->_Mode & 0x40) != 0) { - std::free(file->_Buf); - } - file->_Buf = nullptr; - s32 close_result = Libraries::Kernel::posix_close(file->_Handle); - internal__Fofree(file); - // Need to figure out what exactly this means. - return ~-(close_result == 0) | fflush_result; - } - return 0; -} - -void RegisterlibSceLibcInternalIo(Core::Loader::SymbolsResolver* sym) { - LIB_FUNCTION("eLdDw6l0-bU", "libSceLibcInternal", 1, "libSceLibcInternal", internal_snprintf); - LIB_FUNCTION("MUjC4lbHrK4", "libSceLibcInternal", 1, "libSceLibcInternal", internal_fflush); - LIB_FUNCTION("xGT4Mc55ViQ", "libSceLibcInternal", 1, "libSceLibcInternal", internal__Fofind); - LIB_FUNCTION("dREVnZkAKRE", "libSceLibcInternal", 1, "libSceLibcInternal", internal__Foprep); - LIB_FUNCTION("sQL8D-jio7U", "libSceLibcInternal", 1, "libSceLibcInternal", internal__Fopen); - LIB_FUNCTION("A+Y3xfrWLLo", "libSceLibcInternal", 1, "libSceLibcInternal", internal__Fspos); - LIB_FUNCTION("Ss3108pBuZY", "libSceLibcInternal", 1, "libSceLibcInternal", internal__Nnl); - LIB_FUNCTION("9s3P+LCvWP8", "libSceLibcInternal", 1, "libSceLibcInternal", internal__Frprep); - LIB_FUNCTION("jVDuvE3s5Bs", "libSceLibcInternal", 1, "libSceLibcInternal", internal__Fofree); - LIB_FUNCTION("vZkmJmvqueY", "libSceLibcInternal", 1, "libSceLibcInternal", - internal__Lockfilelock); - LIB_FUNCTION("0x7rx8TKy2Y", "libSceLibcInternal", 1, "libSceLibcInternal", - internal__Unlockfilelock); -} - -void ForceRegisterlibSceLibcInternalIo(Core::Loader::SymbolsResolver* sym) { - // Goal is to be minimally intrusive here to allow LLE for printf/stdout writes. - LIB_FUNCTION("xeYO4u7uyJ0", "libSceLibcInternal", 1, "libSceLibcInternal", internal_fopen); - LIB_FUNCTION("rQFVBXp-Cxg", "libSceLibcInternal", 1, "libSceLibcInternal", internal_fseek); - LIB_FUNCTION("lbB+UlZqVG0", "libSceLibcInternal", 1, "libSceLibcInternal", internal_fread); - LIB_FUNCTION("uodLYyUip20", "libSceLibcInternal", 1, "libSceLibcInternal", internal_fclose); -} - -} // namespace Libraries::LibcInternal \ No newline at end of file diff --git a/src/core/libraries/libc_internal/libc_internal_io.h b/src/core/libraries/libc_internal/libc_internal_io.h deleted file mode 100644 index 27915d8fa..000000000 --- a/src/core/libraries/libc_internal/libc_internal_io.h +++ /dev/null @@ -1,98 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include -#include "common/types.h" -#include "core/libraries/kernel/threads.h" - -namespace Core::Loader { -class SymbolsResolver; -} - -namespace Libraries::LibcInternal { - -static std::recursive_mutex g_file_mtx{}; - -union Orbis__mbstate_t { - u8 __mbstate8[128]; - s64 _mbstateL; -}; - -struct Orbis_Mbstatet { - u64 _Wchar; - u16 _Byte, _State; - s32 : 32; -}; - -struct Orbisfpos_t { - s64 _Off; - Orbis_Mbstatet _Wstate; -}; - -struct Orbis__sbuf { - u8* _base; - s32 _size; -}; - -struct OrbisFILE { - u16 _Mode; - u8 _Idx; - s32 _Handle; - u8 *_Buf, *_Bend, *_Next; - u8 *_Rend, *_Wend, *_Rback; - u16 *_WRback, _WBack[2]; - u16 unk1; - u8 *_Rsave, *_WRend, *_WWend; - Orbis_Mbstatet _Wstate; - u8* _Tmpnam; - u8 _Back[6], _Cbuf; - u8 unk2; - Libraries::Kernel::PthreadMutexT _Mutex; - u8* _p; - s32 _r; - s32 _w; - s16 _flags; - s16 _file; - Orbis__sbuf _bf; - s32 _lbfsize; - void* _cookie; - s32 PS4_SYSV_ABI (*_close)(void*); - s32 PS4_SYSV_ABI (*_read)(void*, char*, s32); - Orbisfpos_t PS4_SYSV_ABI (*_seek)(void*, Orbisfpos_t, s32); - s32 (*_write)(void*, const char*, s32); - Orbis__sbuf _ub; - u8* _up; - s32 _ur; - u8 _ubuf[3]; - u8 _nbuf[1]; - Orbis__sbuf _lb; - s32 _blksize; - Orbisfpos_t _offset; - void* _fl_mutex; - void* _fl_owner; - s32 _fl_count; - s32 _orientation; - Orbis__mbstate_t _mbstate; -}; - -s32 PS4_SYSV_ABI internal_snprintf(char* s, u64 n, VA_ARGS); -void PS4_SYSV_ABI internal__Lockfilelock(OrbisFILE* file); -void PS4_SYSV_ABI internal__Unlockfilelock(OrbisFILE* file); -OrbisFILE* PS4_SYSV_ABI internal__Fofind(); -OrbisFILE* PS4_SYSV_ABI internal__Foprep(const char* path, const char* mode, OrbisFILE* file, - s32 fd, s32 flag1, s32 flag2); -s32 PS4_SYSV_ABI internal__Fopen(const char* path, u16 mode, bool flag); -OrbisFILE* PS4_SYSV_ABI internal_fopen(const char* path, const char* mode); -s64 PS4_SYSV_ABI internal__Nnl(OrbisFILE* file, u8* val1, u8* val2); -s32 PS4_SYSV_ABI internal__Fspos(OrbisFILE* file, Orbisfpos_t* file_pos, s64 offset, s32 whence); -s32 PS4_SYSV_ABI internal_fflush(OrbisFILE* file); -s32 PS4_SYSV_ABI internal_fseek(OrbisFILE* file, s64 offset, s32 whence); -s32 PS4_SYSV_ABI internal__Frprep(OrbisFILE* file); -u64 PS4_SYSV_ABI internal_fread(char* ptr, u64 size, u64 nmemb, OrbisFILE* file); -s32 PS4_SYSV_ABI internal_fclose(OrbisFILE* file); - -void RegisterlibSceLibcInternalIo(Core::Loader::SymbolsResolver* sym); -void ForceRegisterlibSceLibcInternalIo(Core::Loader::SymbolsResolver* sym); -} // namespace Libraries::LibcInternal \ No newline at end of file diff --git a/src/core/libraries/libc_internal/libc_internal_math.cpp b/src/core/libraries/libc_internal/libc_internal_math.cpp deleted file mode 100644 index baeefdf27..000000000 --- a/src/core/libraries/libc_internal/libc_internal_math.cpp +++ /dev/null @@ -1,146 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "common/assert.h" -#include "common/logging/log.h" -#include "core/libraries/error_codes.h" -#include "core/libraries/libs.h" - -namespace Libraries::LibcInternal { - -double PS4_SYSV_ABI internal_sin(double x) { - return std::sin(x); -} - -float PS4_SYSV_ABI internal_sinf(float x) { - return sinf(x); -} - -double PS4_SYSV_ABI internal_cos(double x) { - return std::cos(x); -} - -float PS4_SYSV_ABI internal_cosf(float x) { - return cosf(x); -} - -void PS4_SYSV_ABI internal_sincos(double x, double* sinp, double* cosp) { - *sinp = std::sin(x); - *cosp = std::cos(x); -} - -void PS4_SYSV_ABI internal_sincosf(float x, float* sinp, float* cosp) { - *sinp = sinf(x); - *cosp = cosf(x); -} - -double PS4_SYSV_ABI internal_tan(double x) { - return std::tan(x); -} - -float PS4_SYSV_ABI internal_tanf(float x) { - return tanf(x); -} - -double PS4_SYSV_ABI internal_asin(double x) { - return std::asin(x); -} - -float PS4_SYSV_ABI internal_asinf(float x) { - return asinf(x); -} - -double PS4_SYSV_ABI internal_acos(double x) { - return std::acos(x); -} - -float PS4_SYSV_ABI internal_acosf(float x) { - return acosf(x); -} - -double PS4_SYSV_ABI internal_atan(double x) { - return std::atan(x); -} - -float PS4_SYSV_ABI internal_atanf(float x) { - return atanf(x); -} - -double PS4_SYSV_ABI internal_atan2(double y, double x) { - return std::atan2(y, x); -} - -float PS4_SYSV_ABI internal_atan2f(float y, float x) { - return atan2f(y, x); -} - -double PS4_SYSV_ABI internal_exp(double x) { - return std::exp(x); -} - -float PS4_SYSV_ABI internal_expf(float x) { - return expf(x); -} - -double PS4_SYSV_ABI internal_exp2(double x) { - return std::exp2(x); -} - -float PS4_SYSV_ABI internal_exp2f(float x) { - return std::exp2f(x); -} - -double PS4_SYSV_ABI internal_pow(double x, double y) { - return std::pow(x, y); -} - -float PS4_SYSV_ABI internal_powf(float x, float y) { - return powf(x, y); -} - -double PS4_SYSV_ABI internal_log(double x) { - return std::log(x); -} - -float PS4_SYSV_ABI internal_logf(float x) { - return logf(x); -} - -double PS4_SYSV_ABI internal_log10(double x) { - return std::log10(x); -} - -float PS4_SYSV_ABI internal_log10f(float x) { - return log10f(x); -} - -void RegisterlibSceLibcInternalMath(Core::Loader::SymbolsResolver* sym) { - LIB_FUNCTION("H8ya2H00jbI", "libSceLibcInternal", 1, "libSceLibcInternal", internal_sin); - LIB_FUNCTION("Q4rRL34CEeE", "libSceLibcInternal", 1, "libSceLibcInternal", internal_sinf); - LIB_FUNCTION("2WE3BTYVwKM", "libSceLibcInternal", 1, "libSceLibcInternal", internal_cos); - LIB_FUNCTION("-P6FNMzk2Kc", "libSceLibcInternal", 1, "libSceLibcInternal", internal_cosf); - LIB_FUNCTION("jMB7EFyu30Y", "libSceLibcInternal", 1, "libSceLibcInternal", internal_sincos); - LIB_FUNCTION("pztV4AF18iI", "libSceLibcInternal", 1, "libSceLibcInternal", internal_sincosf); - LIB_FUNCTION("T7uyNqP7vQA", "libSceLibcInternal", 1, "libSceLibcInternal", internal_tan); - LIB_FUNCTION("ZE6RNL+eLbk", "libSceLibcInternal", 1, "libSceLibcInternal", internal_tanf); - LIB_FUNCTION("7Ly52zaL44Q", "libSceLibcInternal", 1, "libSceLibcInternal", internal_asin); - LIB_FUNCTION("GZWjF-YIFFk", "libSceLibcInternal", 1, "libSceLibcInternal", internal_asinf); - LIB_FUNCTION("JBcgYuW8lPU", "libSceLibcInternal", 1, "libSceLibcInternal", internal_acos); - LIB_FUNCTION("QI-x0SL8jhw", "libSceLibcInternal", 1, "libSceLibcInternal", internal_acosf); - LIB_FUNCTION("OXmauLdQ8kY", "libSceLibcInternal", 1, "libSceLibcInternal", internal_atan); - LIB_FUNCTION("weDug8QD-lE", "libSceLibcInternal", 1, "libSceLibcInternal", internal_atanf); - LIB_FUNCTION("HUbZmOnT-Dg", "libSceLibcInternal", 1, "libSceLibcInternal", internal_atan2); - LIB_FUNCTION("EH-x713A99c", "libSceLibcInternal", 1, "libSceLibcInternal", internal_atan2f); - LIB_FUNCTION("NVadfnzQhHQ", "libSceLibcInternal", 1, "libSceLibcInternal", internal_exp); - LIB_FUNCTION("8zsu04XNsZ4", "libSceLibcInternal", 1, "libSceLibcInternal", internal_expf); - LIB_FUNCTION("dnaeGXbjP6E", "libSceLibcInternal", 1, "libSceLibcInternal", internal_exp2); - LIB_FUNCTION("wuAQt-j+p4o", "libSceLibcInternal", 1, "libSceLibcInternal", internal_exp2f); - LIB_FUNCTION("9LCjpWyQ5Zc", "libSceLibcInternal", 1, "libSceLibcInternal", internal_pow); - LIB_FUNCTION("1D0H2KNjshE", "libSceLibcInternal", 1, "libSceLibcInternal", internal_powf); - LIB_FUNCTION("rtV7-jWC6Yg", "libSceLibcInternal", 1, "libSceLibcInternal", internal_log); - LIB_FUNCTION("RQXLbdT2lc4", "libSceLibcInternal", 1, "libSceLibcInternal", internal_logf); - LIB_FUNCTION("WuMbPBKN1TU", "libSceLibcInternal", 1, "libSceLibcInternal", internal_log10); - LIB_FUNCTION("lhpd6Wk6ccs", "libSceLibcInternal", 1, "libSceLibcInternal", internal_log10f); -} - -} // namespace Libraries::LibcInternal diff --git a/src/core/libraries/libc_internal/libc_internal_math.h b/src/core/libraries/libc_internal/libc_internal_math.h deleted file mode 100644 index 89b765205..000000000 --- a/src/core/libraries/libc_internal/libc_internal_math.h +++ /dev/null @@ -1,14 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "common/types.h" - -namespace Core::Loader { -class SymbolsResolver; -} - -namespace Libraries::LibcInternal { -void RegisterlibSceLibcInternalMath(Core::Loader::SymbolsResolver* sym); -} // namespace Libraries::LibcInternal \ No newline at end of file diff --git a/src/core/libraries/libc_internal/libc_internal_memory.cpp b/src/core/libraries/libc_internal/libc_internal_memory.cpp deleted file mode 100644 index b7535cde5..000000000 --- a/src/core/libraries/libc_internal/libc_internal_memory.cpp +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "common/assert.h" -#include "common/logging/log.h" -#include "core/libraries/error_codes.h" -#include "core/libraries/libs.h" -#include "libc_internal_memory.h" - -namespace Libraries::LibcInternal { - -void* PS4_SYSV_ABI internal_memset(void* s, int c, size_t n) { - return std::memset(s, c, n); -} - -void* PS4_SYSV_ABI internal_memcpy(void* dest, const void* src, size_t n) { - return std::memcpy(dest, src, n); -} - -s32 PS4_SYSV_ABI internal_memcpy_s(void* dest, size_t destsz, const void* src, size_t count) { -#ifdef _WIN64 - return memcpy_s(dest, destsz, src, count); -#else - std::memcpy(dest, src, count); - return 0; // ALL OK -#endif -} - -s32 PS4_SYSV_ABI internal_memcmp(const void* s1, const void* s2, size_t n) { - return std::memcmp(s1, s2, n); -} - -void RegisterlibSceLibcInternalMemory(Core::Loader::SymbolsResolver* sym) { - - LIB_FUNCTION("NFLs+dRJGNg", "libSceLibcInternal", 1, "libSceLibcInternal", internal_memcpy_s); - LIB_FUNCTION("Q3VBxCXhUHs", "libSceLibcInternal", 1, "libSceLibcInternal", internal_memcpy); - LIB_FUNCTION("8zTFvBIAIN8", "libSceLibcInternal", 1, "libSceLibcInternal", internal_memset); - LIB_FUNCTION("DfivPArhucg", "libSceLibcInternal", 1, "libSceLibcInternal", internal_memcmp); -} - -} // namespace Libraries::LibcInternal diff --git a/src/core/libraries/libc_internal/libc_internal_memory.h b/src/core/libraries/libc_internal/libc_internal_memory.h deleted file mode 100644 index 995de935b..000000000 --- a/src/core/libraries/libc_internal/libc_internal_memory.h +++ /dev/null @@ -1,14 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "common/types.h" - -namespace Core::Loader { -class SymbolsResolver; -} - -namespace Libraries::LibcInternal { -void RegisterlibSceLibcInternalMemory(Core::Loader::SymbolsResolver* sym); -} // namespace Libraries::LibcInternal \ No newline at end of file diff --git a/src/core/libraries/libc_internal/libc_internal_str.cpp b/src/core/libraries/libc_internal/libc_internal_str.cpp deleted file mode 100644 index a7997a193..000000000 --- a/src/core/libraries/libc_internal/libc_internal_str.cpp +++ /dev/null @@ -1,75 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "common/assert.h" -#include "common/logging/log.h" -#include "core/libraries/error_codes.h" -#include "core/libraries/libs.h" -#include "libc_internal_str.h" - -namespace Libraries::LibcInternal { - -s32 PS4_SYSV_ABI internal_strcpy_s(char* dest, size_t dest_size, const char* src) { -#ifdef _WIN64 - return strcpy_s(dest, dest_size, src); -#else - std::strcpy(dest, src); - return 0; // ALL OK -#endif -} - -s32 PS4_SYSV_ABI internal_strcat_s(char* dest, size_t dest_size, const char* src) { -#ifdef _WIN64 - return strcat_s(dest, dest_size, src); -#else - std::strcat(dest, src); - return 0; // ALL OK -#endif -} - -s32 PS4_SYSV_ABI internal_strcmp(const char* str1, const char* str2) { - return std::strcmp(str1, str2); -} - -s32 PS4_SYSV_ABI internal_strncmp(const char* str1, const char* str2, size_t num) { - return std::strncmp(str1, str2, num); -} - -size_t PS4_SYSV_ABI internal_strlen(const char* str) { - return std::strlen(str); -} - -char* PS4_SYSV_ABI internal_strncpy(char* dest, const char* src, std::size_t count) { - return std::strncpy(dest, src, count); -} - -s32 PS4_SYSV_ABI internal_strncpy_s(char* dest, size_t destsz, const char* src, size_t count) { -#ifdef _WIN64 - return strncpy_s(dest, destsz, src, count); -#else - std::strcpy(dest, src); - return 0; -#endif -} - -char* PS4_SYSV_ABI internal_strcat(char* dest, const char* src) { - return std::strcat(dest, src); -} - -const char* PS4_SYSV_ABI internal_strchr(const char* str, int c) { - return std::strchr(str, c); -} - -void RegisterlibSceLibcInternalStr(Core::Loader::SymbolsResolver* sym) { - LIB_FUNCTION("5Xa2ACNECdo", "libSceLibcInternal", 1, "libSceLibcInternal", internal_strcpy_s); - LIB_FUNCTION("K+gcnFFJKVc", "libSceLibcInternal", 1, "libSceLibcInternal", internal_strcat_s); - LIB_FUNCTION("aesyjrHVWy4", "libSceLibcInternal", 1, "libSceLibcInternal", internal_strcmp); - LIB_FUNCTION("Ovb2dSJOAuE", "libSceLibcInternal", 1, "libSceLibcInternal", internal_strncmp); - LIB_FUNCTION("j4ViWNHEgww", "libSceLibcInternal", 1, "libSceLibcInternal", internal_strlen); - LIB_FUNCTION("6sJWiWSRuqk", "libSceLibcInternal", 1, "libSceLibcInternal", internal_strncpy); - LIB_FUNCTION("YNzNkJzYqEg", "libSceLibcInternal", 1, "libSceLibcInternal", internal_strncpy_s); - LIB_FUNCTION("Ls4tzzhimqQ", "libSceLibcInternal", 1, "libSceLibcInternal", internal_strcat); - LIB_FUNCTION("ob5xAW4ln-0", "libSceLibcInternal", 1, "libSceLibcInternal", internal_strchr); -} - -} // namespace Libraries::LibcInternal diff --git a/src/core/libraries/libc_internal/libc_internal_str.h b/src/core/libraries/libc_internal/libc_internal_str.h deleted file mode 100644 index 26023c40e..000000000 --- a/src/core/libraries/libc_internal/libc_internal_str.h +++ /dev/null @@ -1,14 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "common/types.h" - -namespace Core::Loader { -class SymbolsResolver; -} - -namespace Libraries::LibcInternal { -void RegisterlibSceLibcInternalStr(Core::Loader::SymbolsResolver* sym); -} // namespace Libraries::LibcInternal \ No newline at end of file diff --git a/src/core/libraries/libc_internal/libc_internal_threads.cpp b/src/core/libraries/libc_internal/libc_internal_threads.cpp deleted file mode 100644 index 2d8ddaccb..000000000 --- a/src/core/libraries/libc_internal/libc_internal_threads.cpp +++ /dev/null @@ -1,65 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "core/libraries/kernel/threads.h" -#include "core/libraries/libc_internal/libc_internal_threads.h" -#include "core/libraries/libs.h" - -namespace Libraries::LibcInternal { - -void getMutexName(char* buf, u64 size, const char* name) { - if (name != nullptr) { - std::snprintf(buf, size, "SceLibcI_%s", name); - } else { - std::snprintf(buf, size, "SceLibcI"); - } -} - -s32 PS4_SYSV_ABI internal__Mtxinit(Libraries::Kernel::PthreadMutexT* mtx, const char* name) { - char mtx_name[0x20]; - getMutexName(mtx_name, sizeof(mtx_name), name); - - Libraries::Kernel::PthreadMutexAttrT attr{}; - s32 result = Libraries::Kernel::posix_pthread_mutexattr_init(&attr); - if (result != 0) { - return 1; - } - - result = Libraries::Kernel::posix_pthread_mutexattr_settype( - &attr, Libraries::Kernel::PthreadMutexType::Recursive); - if (result == 0) { - s32 mtx_init_result = Libraries::Kernel::scePthreadMutexInit(mtx, &attr, mtx_name); - result = Libraries::Kernel::posix_pthread_mutexattr_destroy(&attr); - if (mtx_init_result == 0 && result == 0) { - return 0; - } - } else { - Libraries::Kernel::posix_pthread_mutexattr_destroy(&attr); - } - - return 1; -} - -s32 PS4_SYSV_ABI internal__Mtxlock(Libraries::Kernel::PthreadMutexT* mtx) { - s32 result = Libraries::Kernel::posix_pthread_mutex_lock(mtx); - return result != 0; -} - -s32 PS4_SYSV_ABI internal__Mtxunlock(Libraries::Kernel::PthreadMutexT* mtx) { - s32 result = Libraries::Kernel::posix_pthread_mutex_unlock(mtx); - return result != 0; -} - -s32 PS4_SYSV_ABI internal__Mtxdst(Libraries::Kernel::PthreadMutexT* mtx) { - s32 result = Libraries::Kernel::posix_pthread_mutex_destroy(mtx); - return result != 0; -} - -void RegisterlibSceLibcInternalThreads(Core::Loader::SymbolsResolver* sym) { - LIB_FUNCTION("z7STeF6abuU", "libSceLibcInternal", 1, "libSceLibcInternal", internal__Mtxinit); - LIB_FUNCTION("pE4Ot3CffW0", "libSceLibcInternal", 1, "libSceLibcInternal", internal__Mtxlock); - LIB_FUNCTION("cMwgSSmpE5o", "libSceLibcInternal", 1, "libSceLibcInternal", internal__Mtxunlock); - LIB_FUNCTION("LaPaA6mYA38", "libSceLibcInternal", 1, "libSceLibcInternal", internal__Mtxdst); -} - -} // namespace Libraries::LibcInternal \ No newline at end of file diff --git a/src/core/libraries/libc_internal/libc_internal_threads.h b/src/core/libraries/libc_internal/libc_internal_threads.h deleted file mode 100644 index 74e6d41b1..000000000 --- a/src/core/libraries/libc_internal/libc_internal_threads.h +++ /dev/null @@ -1,22 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include -#include "common/types.h" -#include "core/libraries/kernel/threads.h" - -namespace Core::Loader { -class SymbolsResolver; -} - -namespace Libraries::LibcInternal { - -s32 PS4_SYSV_ABI internal__Mtxinit(Libraries::Kernel::PthreadMutexT* mtx, const char* name); -s32 PS4_SYSV_ABI internal__Mtxlock(Libraries::Kernel::PthreadMutexT* mtx); -s32 PS4_SYSV_ABI internal__Mtxunlock(Libraries::Kernel::PthreadMutexT* mtx); -s32 PS4_SYSV_ABI internal__Mtxdst(Libraries::Kernel::PthreadMutexT* mtx); - -void RegisterlibSceLibcInternalThreads(Core::Loader::SymbolsResolver* sym); -} // namespace Libraries::LibcInternal \ No newline at end of file diff --git a/src/core/libraries/libc_internal/printf.h b/src/core/libraries/libc_internal/printf.h deleted file mode 100644 index c44110d0f..000000000 --- a/src/core/libraries/libc_internal/printf.h +++ /dev/null @@ -1,763 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2014-2018 Marco Paland (info@paland.com) -// SPDX-License-Identifier: MIT - -/////////////////////////////////////////////////////////////////////////////// -// \author (c) Marco Paland (info@paland.com) -// 2014-2018, PALANDesign Hannover, Germany -// -// \license The MIT License (MIT) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// -// \brief Tiny printf, sprintf and snprintf implementation, optimized for speed on -// embedded systems with a very limited resources. -// Use this instead of bloated standard/newlib printf. -// These routines are thread safe and reentrant! -// -/////////////////////////////////////////////////////////////////////////////// -// Vita3K emulator project -// Copyright (C) 2023 Vita3K team -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License along -// with this program; if not, write to the Free Software Foundation, Inc., -// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -// copied from Vita3k project at 6/10/2023 (latest update 30/06/2023) -// modifications for adapting va_args parameters - -#pragma once - -#include - -#include -#include -#include -#include -#include -#include - -#include "common/va_ctx.h" - -namespace Libraries::LibcInternal { -// ntoa conversion buffer size, this must be big enough to hold -// one converted numeric number including padded zeros (dynamically created on stack) -// 32 byte is a good default -#define PRINTF_NTOA_BUFFER_SIZE 32U - -// ftoa conversion buffer size, this must be big enough to hold -// one converted float number including padded zeros (dynamically created on stack) -// 32 byte is a good default -#define PRINTF_FTOA_BUFFER_SIZE 32U - -// define this to support floating point (%f) -#define PRINTF_SUPPORT_FLOAT - -// define this to support long long types (%llu or %p) -#define PRINTF_SUPPORT_LONG_LONG - -// define this to support the ptrdiff_t type (%t) -// ptrdiff_t is normally defined in as long or long long type -#define PRINTF_SUPPORT_PTRDIFF_T - -/////////////////////////////////////////////////////////////////////////////// - -// internal flag definitions -#define FLAGS_ZEROPAD (1U << 0U) -#define FLAGS_LEFT (1U << 1U) -#define FLAGS_PLUS (1U << 2U) -#define FLAGS_SPACE (1U << 3U) -#define FLAGS_HASH (1U << 4U) -#define FLAGS_UPPERCASE (1U << 5U) -#define FLAGS_CHAR (1U << 6U) -#define FLAGS_SHORT (1U << 7U) -#define FLAGS_LONG (1U << 8U) -#define FLAGS_LONG_LONG (1U << 9U) -#define FLAGS_PRECISION (1U << 10U) -#define FLAGS_WIDTH (1U << 11U) - -// output function type -typedef void (*out_fct_type)(char character, void* buffer, size_t idx, size_t maxlen); - -// wrapper (used as buffer) for output function type -typedef struct { - void (*fct)(char character, void* arg); - void* arg; -} out_fct_wrap_type; - -// internal buffer output -static inline void _out_buffer(char character, void* buffer, size_t idx, size_t maxlen) { - if (idx < maxlen) { - ((char*)buffer)[idx] = character; - } -} - -// internal null output -static inline void _out_null(char character, void* buffer, size_t idx, size_t maxlen) { - (void)character; - (void)buffer; - (void)idx; - (void)maxlen; -} - -// internal output function wrapper -static inline void _out_fct(char character, void* buffer, size_t idx, size_t maxlen) { - (void)idx; - (void)maxlen; - // buffer is the output fct pointer - ((out_fct_wrap_type*)buffer)->fct(character, ((out_fct_wrap_type*)buffer)->arg); -} - -// internal strlen -// \return The length of the string (excluding the terminating 0) -static inline unsigned int _strlen(const char* str) { - const char* s; - for (s = str; *s; ++s) - ; - return (unsigned int)(s - str); -} - -// internal test if char is a digit (0-9) -// \return true if char is a digit -static inline bool _is_digit(char ch) { - return (ch >= '0') && (ch <= '9'); -} - -// internal ASCII string to unsigned int conversion -static inline unsigned int _atoi(const char** str) { - unsigned int i = 0U; - while (_is_digit(**str)) { - i = i * 10U + (unsigned int)(*((*str)++) - '0'); - } - return i; -} - -// internal itoa format -static inline size_t _ntoa_format(out_fct_type out, char* buffer, size_t idx, size_t maxlen, - char* buf, size_t len, bool negative, unsigned int base, - unsigned int prec, unsigned int width, unsigned int flags) { - const size_t start_idx = idx; - - // pad leading zeros - while (!(flags & FLAGS_LEFT) && (len < prec) && (len < PRINTF_NTOA_BUFFER_SIZE)) { - buf[len++] = '0'; - } - while (!(flags & FLAGS_LEFT) && (flags & FLAGS_ZEROPAD) && (len < width) && - (len < PRINTF_NTOA_BUFFER_SIZE)) { - buf[len++] = '0'; - } - - // handle hash - if (flags & FLAGS_HASH) { - if (((len == prec) || (len == width)) && (len > 0U)) { - len--; - if ((base == 16U) && (len > 0U)) { - len--; - } - } - if ((base == 16U) && !(flags & FLAGS_UPPERCASE) && (len < PRINTF_NTOA_BUFFER_SIZE)) { - buf[len++] = 'x'; - } - if ((base == 16U) && (flags & FLAGS_UPPERCASE) && (len < PRINTF_NTOA_BUFFER_SIZE)) { - buf[len++] = 'X'; - } - if (len < PRINTF_NTOA_BUFFER_SIZE) { - buf[len++] = '0'; - } - } - - // handle sign - if ((len == width) && (negative || (flags & FLAGS_PLUS) || (flags & FLAGS_SPACE))) { - len--; - } - if (len < PRINTF_NTOA_BUFFER_SIZE) { - if (negative) { - buf[len++] = '-'; - } else if (flags & FLAGS_PLUS) { - buf[len++] = '+'; // ignore the space if the '+' exists - } else if (flags & FLAGS_SPACE) { - buf[len++] = ' '; - } - } - - // pad spaces up to given width - if (!(flags & FLAGS_LEFT) && !(flags & FLAGS_ZEROPAD)) { - for (size_t i = len; i < width; i++) { - out(' ', buffer, idx++, maxlen); - } - } - - // reverse string - for (size_t i = 0U; i < len; i++) { - out(buf[len - i - 1U], buffer, idx++, maxlen); - } - - // append pad spaces up to given width - if (flags & FLAGS_LEFT) { - while (idx - start_idx < width) { - out(' ', buffer, idx++, maxlen); - } - } - - return idx; -} - -// internal itoa for 'long' type -static inline size_t _ntoa_long(out_fct_type out, char* buffer, size_t idx, size_t maxlen, - unsigned long value, bool negative, unsigned long base, - unsigned int prec, unsigned int width, unsigned int flags) { - char buf[PRINTF_NTOA_BUFFER_SIZE]; - size_t len = 0U; - - // write if precision != 0 and value is != 0 - if (!(flags & FLAGS_PRECISION) || value) { - do { - const char digit = (char)(value % base); - buf[len++] = - digit < 10 ? '0' + digit : (flags & FLAGS_UPPERCASE ? 'A' : 'a') + digit - 10; - value /= base; - } while (value && (len < PRINTF_NTOA_BUFFER_SIZE)); - } - - return _ntoa_format(out, buffer, idx, maxlen, buf, len, negative, (unsigned int)base, prec, - width, flags); -} - -// internal itoa for 'long long' type -#if defined(PRINTF_SUPPORT_LONG_LONG) -static inline size_t _ntoa_long_long(out_fct_type out, char* buffer, size_t idx, size_t maxlen, - unsigned long long value, bool negative, - unsigned long long base, unsigned int prec, unsigned int width, - unsigned int flags) { - char buf[PRINTF_NTOA_BUFFER_SIZE]; - size_t len = 0U; - - // write if precision != 0 and value is != 0 - if (!(flags & FLAGS_PRECISION) || value) { - do { - const char digit = (char)(value % base); - buf[len++] = - digit < 10 ? '0' + digit : (flags & FLAGS_UPPERCASE ? 'A' : 'a') + digit - 10; - value /= base; - } while (value && (len < PRINTF_NTOA_BUFFER_SIZE)); - } - - return _ntoa_format(out, buffer, idx, maxlen, buf, len, negative, (unsigned int)base, prec, - width, flags); -} -#endif // PRINTF_SUPPORT_LONG_LONG - -#if defined(PRINTF_SUPPORT_FLOAT) -static inline size_t _ftoa(out_fct_type out, char* buffer, size_t idx, size_t maxlen, double value, - unsigned int prec, unsigned int width, unsigned int flags) { - char buf[PRINTF_FTOA_BUFFER_SIZE]; - size_t len = 0U; - double diff = 0.0; - - // if input is larger than thres_max, revert to exponential - const double thres_max = (double)0x7FFFFFFF; - - // powers of 10 - static const double pow10[] = {1, 10, 100, 1000, 10000, - 100000, 1000000, 10000000, 100000000, 1000000000}; - - // test for negative - bool negative = false; - if (value < 0) { - negative = true; - value = 0 - value; - } - - // set default precision to 6, if not set explicitly - if (!(flags & FLAGS_PRECISION)) { - prec = 6U; - } - // limit precision to 9, cause a prec >= 10 can lead to overflow errors - while ((len < PRINTF_FTOA_BUFFER_SIZE) && (prec > 9U)) { - buf[len++] = '0'; - prec--; - } - - int whole = (int)value; - double tmp = (value - whole) * pow10[prec]; - unsigned long frac = (unsigned long)tmp; - diff = tmp - frac; - - if (diff > 0.5) { - ++frac; - // handle rollover, e.g. case 0.99 with prec 1 is 1.0 - if (frac >= pow10[prec]) { - frac = 0; - ++whole; - } - } else if ((diff == 0.5) && ((frac == 0U) || (frac & 1U))) { - // if halfway, round up if odd, OR if last digit is 0 - ++frac; - } - - // TBD: for very large numbers switch back to native sprintf for exponentials. Anyone want to - // write code to replace this? Normal printf behavior is to print EVERY whole number digit which - // can be 100s of characters overflowing your buffers == bad - if (value > thres_max) { - return 0U; - } - - if (prec == 0U) { - diff = value - (double)whole; - if (diff > 0.5) { - // greater than 0.5, round up, e.g. 1.6 -> 2 - ++whole; - } else if ((diff == 0.5) && (whole & 1)) { - // exactly 0.5 and ODD, then round up - // 1.5 -> 2, but 2.5 -> 2 - ++whole; - } - } else { - unsigned int count = prec; - // now do fractional part, as an unsigned number - while (len < PRINTF_FTOA_BUFFER_SIZE) { - --count; - buf[len++] = (char)(48U + (frac % 10U)); - if (!(frac /= 10U)) { - break; - } - } - // add extra 0s - while ((len < PRINTF_FTOA_BUFFER_SIZE) && (count-- > 0U)) { - buf[len++] = '0'; - } - if (len < PRINTF_FTOA_BUFFER_SIZE) { - // add decimal - buf[len++] = '.'; - } - } - - // do whole part, number is reversed - while (len < PRINTF_FTOA_BUFFER_SIZE) { - buf[len++] = (char)(48 + (whole % 10)); - if (!(whole /= 10)) { - break; - } - } - - // pad leading zeros - while (!(flags & FLAGS_LEFT) && (flags & FLAGS_ZEROPAD) && (len < width) && - (len < PRINTF_FTOA_BUFFER_SIZE)) { - buf[len++] = '0'; - } - - // handle sign - if ((len == width) && (negative || (flags & FLAGS_PLUS) || (flags & FLAGS_SPACE))) { - len--; - } - if (len < PRINTF_FTOA_BUFFER_SIZE) { - if (negative) { - buf[len++] = '-'; - } else if (flags & FLAGS_PLUS) { - buf[len++] = '+'; // ignore the space if the '+' exists - } else if (flags & FLAGS_SPACE) { - buf[len++] = ' '; - } - } - - // pad spaces up to given width - if (!(flags & FLAGS_LEFT) && !(flags & FLAGS_ZEROPAD)) { - for (size_t i = len; i < width; i++) { - out(' ', buffer, idx++, maxlen); - } - } - - // reverse string - for (size_t i = 0U; i < len; i++) { - out(buf[len - i - 1U], buffer, idx++, maxlen); - } - - // append pad spaces up to given width - if (flags & FLAGS_LEFT) { - while (idx < width) { - out(' ', buffer, idx++, maxlen); - } - } - - return idx; -} -#endif // PRINTF_SUPPORT_FLOAT - -// internal vsnprintf -static inline int _vsnprintf(out_fct_type out, char* buffer, const char* format, - Common::VaList* va_list) { - unsigned int flags, width, precision, n; - size_t idx = 0U; - auto maxlen = static_cast(-1); - - if (!buffer) { - // use null output function - out = _out_null; - } - - while (*format) { - // format specifier? %[flags][width][.precision][length] - if (*format != '%') { - // no - out(*format, buffer, idx++, maxlen); - format++; - continue; - } else { - // yes, evaluate it - format++; - } - - // evaluate flags - flags = 0U; - do { - switch (*format) { - case '0': - flags |= FLAGS_ZEROPAD; - format++; - n = 1U; - break; - case '-': - flags |= FLAGS_LEFT; - format++; - n = 1U; - break; - case '+': - flags |= FLAGS_PLUS; - format++; - n = 1U; - break; - case ' ': - flags |= FLAGS_SPACE; - format++; - n = 1U; - break; - case '#': - flags |= FLAGS_HASH; - format++; - n = 1U; - break; - default: - n = 0U; - break; - } - } while (n); - - // evaluate width field - width = 0U; - if (_is_digit(*format)) { - width = _atoi(&format); - } else if (*format == '*') { - const int w = vaArgInteger(va_list); // const int w = va.next(cpu, mem); - - if (w < 0) { - flags |= FLAGS_LEFT; // reverse padding - width = (unsigned int)-w; - } else { - width = (unsigned int)w; - } - format++; - } - - // evaluate precision field - precision = 0U; - if (*format == '.') { - flags |= FLAGS_PRECISION; - format++; - if (_is_digit(*format)) { - precision = _atoi(&format); - } else if (*format == '*') { - precision = - vaArgInteger(va_list); // precision = (unsigned int)va.next(cpu, mem); - format++; - } - } - - // evaluate length field - switch (*format) { - case 'l': - flags |= FLAGS_LONG; - format++; - if (*format == 'l') { - flags |= FLAGS_LONG_LONG; - format++; - } - break; - case 'h': - flags |= FLAGS_SHORT; - format++; - if (*format == 'h') { - flags |= FLAGS_CHAR; - format++; - } - break; -#if defined(PRINTF_SUPPORT_PTRDIFF_T) - case 't': - flags |= (sizeof(ptrdiff_t) == sizeof(long) ? FLAGS_LONG : FLAGS_LONG_LONG); - format++; - break; -#endif - case 'j': - flags |= (sizeof(intmax_t) == sizeof(long) ? FLAGS_LONG : FLAGS_LONG_LONG); - format++; - break; - case 'z': - flags |= (sizeof(size_t) == sizeof(long) ? FLAGS_LONG : FLAGS_LONG_LONG); - format++; - break; - default: - break; - } - - // evaluate specifier - switch (*format) { - case 'd': - case 'i': - case 'u': - case 'x': - case 'X': - case 'o': - case 'b': { - // set the base - unsigned int base; - if (*format == 'x' || *format == 'X') { - base = 16U; - } else if (*format == 'o') { - base = 8U; - } else if (*format == 'b') { - base = 2U; - flags &= ~FLAGS_HASH; // no hash for bin format - } else { - base = 10U; - flags &= ~FLAGS_HASH; // no hash for dec format - } - // uppercase - if (*format == 'X') { - flags |= FLAGS_UPPERCASE; - } - - // no plus or space flag for u, x, X, o, b - if ((*format != 'i') && (*format != 'd')) { - flags &= ~(FLAGS_PLUS | FLAGS_SPACE); - } - - // convert the integer - if ((*format == 'i') || (*format == 'd')) { - // signed - if (flags & FLAGS_LONG_LONG) { -#if defined(PRINTF_SUPPORT_LONG_LONG) - auto value = vaArgLongLong( - va_list); // const long long value = va.next(cpu, mem); - idx = _ntoa_long_long(out, buffer, idx, maxlen, - (unsigned long long)(value > 0 ? value : 0 - value), - value < 0, base, precision, width, flags); -#endif - } else if (flags & FLAGS_LONG) { - auto value = vaArgLong(va_list); // const long value = va.next(cpu, mem); - idx = _ntoa_long(out, buffer, idx, maxlen, - (unsigned long)(value > 0 ? value : 0 - value), value < 0, - base, precision, width, flags); - } else { - // const int value = (flags & FLAGS_CHAR) ? (char)va.next(cpu, mem) : - // (flags & FLAGS_SHORT) ? (short int)va.next(cpu, mem): va.next(cpu, - // mem); - const int value = - (flags & FLAGS_CHAR) ? static_cast(vaArgInteger(va_list)) - : (flags & FLAGS_SHORT) ? static_cast(vaArgInteger(va_list)) - : vaArgInteger(va_list); - idx = _ntoa_long(out, buffer, idx, maxlen, - (unsigned int)(value > 0 ? value : 0 - value), value < 0, base, - precision, width, flags); - } - } else { - // unsigned - if (flags & FLAGS_LONG_LONG) { -#if defined(PRINTF_SUPPORT_LONG_LONG) - // idx = _ntoa_long_long(out, buffer, idx, maxlen, va.next(cpu, mem), false, base, precision, width, flags); - idx = _ntoa_long_long(out, buffer, idx, maxlen, - static_cast(vaArgLongLong(va_list)), false, base, - precision, width, flags); -#endif - } else if (flags & FLAGS_LONG) { - // idx = _ntoa_long(out, buffer, idx, maxlen, va.next(cpu, mem), - // false, base, precision, width, flags); - idx = _ntoa_long(out, buffer, idx, maxlen, static_cast(vaArgLong(va_list)), - false, base, precision, width, flags); - } else { - // const unsigned int value = (flags & FLAGS_CHAR) ? (unsigned - // char)va.next(cpu, mem) : (flags & FLAGS_SHORT) ? - // (unsigned short int)va.next(cpu, mem) : va.next(cpu, mem); - const unsigned int value = - (flags & FLAGS_CHAR) ? static_cast(vaArgInteger(va_list)) - : (flags & FLAGS_SHORT) ? static_cast(vaArgInteger(va_list)) - : static_cast(vaArgInteger(va_list)); - idx = _ntoa_long(out, buffer, idx, maxlen, value, false, base, precision, width, - flags); - } - } - format++; - break; - } -#if defined(PRINTF_SUPPORT_FLOAT) - case 'f': - case 'F': - // idx = _ftoa(out, buffer, idx, maxlen, va.next(cpu, mem), precision, width, - // flags); - idx = _ftoa(out, buffer, idx, maxlen, vaArgDouble(va_list), precision, width, flags); - format++; - break; -#endif // PRINTF_SUPPORT_FLOAT - case 'c': { - unsigned int l = 1U; - // pre padding - if (!(flags & FLAGS_LEFT)) { - while (l++ < width) { - out(' ', buffer, idx++, maxlen); - } - } - // char output - // out((char)va.next(cpu, mem), buffer, idx++, maxlen); - out(static_cast(vaArgInteger(va_list)), buffer, idx++, maxlen); - // post padding - if (flags & FLAGS_LEFT) { - while (l++ < width) { - out(' ', buffer, idx++, maxlen); - } - } - format++; - break; - } - - case 's': { - const char* p = vaArgPtr( - va_list); // const char *p = va.next>(cpu, mem).get(mem); - p = p != nullptr ? p : "(null)"; - unsigned int l = _strlen(p); - // pre padding - if (flags & FLAGS_PRECISION) { - l = (l < precision ? l : precision); - } - if (!(flags & FLAGS_LEFT)) { - while (l++ < width) { - out(' ', buffer, idx++, maxlen); - } - } - // string output - while ((*p != 0) && (!(flags & FLAGS_PRECISION) || precision--)) { - out(*(p++), buffer, idx++, maxlen); - } - // post padding - if (flags & FLAGS_LEFT) { - while (l++ < width) { - out(' ', buffer, idx++, maxlen); - } - } - format++; - break; - } - - case 'p': { - width = sizeof(void*) * 2U; - flags |= FLAGS_ZEROPAD | FLAGS_UPPERCASE; -#if defined(PRINTF_SUPPORT_LONG_LONG) - const bool is_ll = sizeof(uintptr_t) == sizeof(long long); - if (is_ll) { - // idx = _ntoa_long_long(out, buffer, idx, maxlen, - // (uintptr_t)va.next>(cpu, mem).address(), false, 16U, precision, width, - // flags); - idx = _ntoa_long_long(out, buffer, idx, maxlen, - reinterpret_cast(vaArgPtr(va_list)), false, - 16U, precision, width, flags); - } else { -#endif - // idx = _ntoa_long(out, buffer, idx, maxlen, (unsigned - // long)((uintptr_t)va.next>(cpu, mem).address()), false, 16U, precision, - // width, flags); - idx = _ntoa_long( - out, buffer, idx, maxlen, - static_cast(reinterpret_cast(vaArgPtr(va_list))), - false, 16U, precision, width, flags); -#if defined(PRINTF_SUPPORT_LONG_LONG) - } -#endif - format++; - break; - } - - case '%': - out('%', buffer, idx++, maxlen); - format++; - break; - - default: - out(*format, buffer, idx++, maxlen); - format++; - break; - } - } - - // termination - out((char)0, buffer, idx < maxlen ? idx : maxlen - 1U, maxlen); - - // return written chars without terminating \0 - return (int)idx; -} - -static int printf_ctx(Common::VaCtx* ctx) { - const char* format = vaArgPtr(&ctx->va_list); - char buffer[256]; - int result = _vsnprintf(_out_buffer, buffer, format, &ctx->va_list); - printf("%s", buffer); - return result; -} - -static int fprintf_ctx(Common::VaCtx* ctx, char* buf) { - const char* format = vaArgPtr(&ctx->va_list); - char buffer[256]; - int result = _vsnprintf(_out_buffer, buffer, format, &ctx->va_list); - std::strcpy(buf, buffer); - return result; -} - -static int vsnprintf_ctx(char* s, size_t n, const char* format, Common::VaList* arg) { - std::vector buffer(n); - int result = _vsnprintf(_out_buffer, buffer.data(), format, arg); - std::strcpy(s, buffer.data()); - return result; -} - -static int snprintf_ctx(char* s, size_t n, Common::VaCtx* ctx) { - const char* format = vaArgPtr(&ctx->va_list); - std::vector buffer(n); - int result = _vsnprintf(_out_buffer, buffer.data(), format, &ctx->va_list); - std::strcpy(s, buffer.data()); - return result; -} - -} // namespace Libraries::LibcInternal \ No newline at end of file diff --git a/src/core/libraries/libpng/pngdec.cpp b/src/core/libraries/libpng/pngdec.cpp deleted file mode 100644 index 9c978df2a..000000000 --- a/src/core/libraries/libpng/pngdec.cpp +++ /dev/null @@ -1,275 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include -#include "common/assert.h" -#include "common/logging/log.h" -#include "core/libraries/libpng/pngdec.h" -#include "core/libraries/libpng/pngdec_error.h" -#include "core/libraries/libs.h" - -namespace Libraries::PngDec { - -struct PngHandler { - png_structp png_ptr; - png_infop info_ptr; -}; - -struct PngStruct { - const u8* data; - size_t size; - u64 offset; -}; - -static inline OrbisPngDecColorSpace MapPngColor(int color) { - switch (color) { - case PNG_COLOR_TYPE_GRAY: - return OrbisPngDecColorSpace::Grayscale; - case PNG_COLOR_TYPE_GRAY_ALPHA: - return OrbisPngDecColorSpace::GrayscaleAlpha; - case PNG_COLOR_TYPE_PALETTE: - return OrbisPngDecColorSpace::Clut; - case PNG_COLOR_TYPE_RGB: - return OrbisPngDecColorSpace::Rgb; - case PNG_COLOR_TYPE_RGB_ALPHA: - return OrbisPngDecColorSpace::Rgba; - } - UNREACHABLE_MSG("unknown png color type"); -} - -void PngDecError(png_structp png_ptr, png_const_charp error_message) { - LOG_ERROR(Lib_Png, "PNG error {}", error_message); -} - -void PngDecWarning(png_structp png_ptr, png_const_charp error_message) { - LOG_ERROR(Lib_Png, "PNG warning {}", error_message); -} - -s32 PS4_SYSV_ABI scePngDecCreate(const OrbisPngDecCreateParam* param, void* memoryAddress, - u32 memorySize, OrbisPngDecHandle* handle) { - if (param == nullptr || param->attribute > 1) { - LOG_ERROR(Lib_Png, "Invalid param!"); - return ORBIS_PNG_DEC_ERROR_INVALID_PARAM; - } - if (memoryAddress == nullptr) { - LOG_ERROR(Lib_Png, "Invalid memory address!"); - return ORBIS_PNG_DEC_ERROR_INVALID_ADDR; - } - if (param->max_image_width - 1 > 1000000) { - LOG_ERROR(Lib_Png, "Invalid size! width = {}", param->max_image_width); - return ORBIS_PNG_DEC_ERROR_INVALID_SIZE; - } - auto pngh = (PngHandler*)memoryAddress; - - pngh->png_ptr = - png_create_read_struct(PNG_LIBPNG_VER_STRING, nullptr, PngDecError, PngDecWarning); - - if (pngh->png_ptr == nullptr) - return ORBIS_PNG_DEC_ERROR_FATAL; - - pngh->info_ptr = png_create_info_struct(pngh->png_ptr); - if (pngh->info_ptr == nullptr) { - png_destroy_read_struct(&pngh->png_ptr, nullptr, nullptr); - return false; - } - - *handle = pngh; - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI scePngDecDecode(OrbisPngDecHandle handle, const OrbisPngDecDecodeParam* param, - OrbisPngDecImageInfo* imageInfo) { - if (handle == nullptr) { - LOG_ERROR(Lib_Png, "invalid handle!"); - return ORBIS_PNG_DEC_ERROR_INVALID_HANDLE; - } - if (param == nullptr) { - LOG_ERROR(Lib_Png, "Invalid param!"); - return ORBIS_PNG_DEC_ERROR_INVALID_PARAM; - } - if (param->png_mem_addr == nullptr || param->image_mem_addr == nullptr) { - LOG_ERROR(Lib_Png, "invalid image address!"); - return ORBIS_PNG_DEC_ERROR_INVALID_ADDR; - } - LOG_TRACE(Lib_Png, - "pngMemSize = {} , imageMemSize = {} , pixelFormat = {} , alphaValue = {} , " - "imagePitch = {}", - param->png_mem_size, param->image_mem_size, int(param->pixel_format), - param->alpha_value, param->image_pitch); - - auto pngh = (PngHandler*)handle; - - const auto pngdata = PngStruct{ - .data = param->png_mem_addr, - .size = param->png_mem_size, - .offset = 0, - }; - png_set_read_fn(pngh->png_ptr, (void*)&pngdata, - [](png_structp ps, png_bytep data, png_size_t len) { - if (len == 0) - return; - auto pngdata = (PngStruct*)png_get_io_ptr(ps); - ::memcpy(data, pngdata->data + pngdata->offset, len); - pngdata->offset += len; - }); - - png_read_info(pngh->png_ptr, pngh->info_ptr); - const u32 width = png_get_image_width(pngh->png_ptr, pngh->info_ptr); - const u32 height = png_get_image_height(pngh->png_ptr, pngh->info_ptr); - const auto color_type = MapPngColor(png_get_color_type(pngh->png_ptr, pngh->info_ptr)); - const auto bit_depth = png_get_bit_depth(pngh->png_ptr, pngh->info_ptr); - - if (imageInfo != nullptr) { - imageInfo->bit_depth = bit_depth; - imageInfo->image_width = width; - imageInfo->image_height = height; - imageInfo->color_space = color_type; - imageInfo->image_flag = OrbisPngDecImageFlag::None; - if (png_get_interlace_type(pngh->png_ptr, pngh->info_ptr) == 1) { - imageInfo->image_flag |= OrbisPngDecImageFlag::Adam7Interlace; - } - if (png_get_valid(pngh->png_ptr, pngh->info_ptr, PNG_INFO_tRNS)) { - imageInfo->image_flag |= OrbisPngDecImageFlag::TrnsChunkExist; - } - } - - if (bit_depth == 16) { - png_set_strip_16(pngh->png_ptr); - } - if (color_type == OrbisPngDecColorSpace::Clut) { - png_set_palette_to_rgb(pngh->png_ptr); - } - if (color_type == OrbisPngDecColorSpace::Grayscale && bit_depth < 8) { - png_set_expand_gray_1_2_4_to_8(pngh->png_ptr); - } - if (png_get_valid(pngh->png_ptr, pngh->info_ptr, PNG_INFO_tRNS)) { - png_set_tRNS_to_alpha(pngh->png_ptr); - } - if (color_type == OrbisPngDecColorSpace::Grayscale || - color_type == OrbisPngDecColorSpace::GrayscaleAlpha) { - png_set_gray_to_rgb(pngh->png_ptr); - } - if (param->pixel_format == OrbisPngDecPixelFormat::B8G8R8A8) { - png_set_bgr(pngh->png_ptr); - } - if (color_type == OrbisPngDecColorSpace::Rgb || - color_type == OrbisPngDecColorSpace::Grayscale || - color_type == OrbisPngDecColorSpace::Clut) { - png_set_add_alpha(pngh->png_ptr, param->alpha_value, PNG_FILLER_AFTER); - } - - const s32 pass = png_set_interlace_handling(pngh->png_ptr); - png_read_update_info(pngh->png_ptr, pngh->info_ptr); - - const s32 num_channels = png_get_channels(pngh->png_ptr, pngh->info_ptr); - const s32 horizontal_bytes = num_channels * width; - const s32 stride = param->image_pitch > 0 ? param->image_pitch : horizontal_bytes; - - for (int j = 0; j < pass; j++) { - auto ptr = reinterpret_cast(param->image_mem_addr); - for (int y = 0; y < height; y++) { - png_read_row(pngh->png_ptr, ptr, nullptr); - ptr += stride; - } - } - - return (width > 32767 || height > 32767) ? 0 : (width << 16) | height; -} - -s32 PS4_SYSV_ABI scePngDecDecodeWithInputControl() { - LOG_ERROR(Lib_Png, "(STUBBED)called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI scePngDecDelete(OrbisPngDecHandle handle) { - auto pngh = *(PngHandler**)handle; - png_destroy_read_struct(&pngh->png_ptr, &pngh->info_ptr, nullptr); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI scePngDecParseHeader(const OrbisPngDecParseParam* param, - OrbisPngDecImageInfo* imageInfo) { - if (param == nullptr) { - LOG_ERROR(Lib_Png, "Invalid param!"); - return ORBIS_PNG_DEC_ERROR_INVALID_PARAM; - } - - u8 header[8]; - memcpy(header, param->png_mem_addr, 8); - // Check if the header indicates a valid PNG file - if (png_sig_cmp(header, 0, 8)) { - LOG_ERROR(Lib_Png, "Memory doesn't contain a valid png file"); - return ORBIS_PNG_DEC_ERROR_INVALID_DATA; - } - // Create a libpng structure, also pass our custom error/warning functions - auto png_ptr = - png_create_read_struct(PNG_LIBPNG_VER_STRING, nullptr, PngDecError, PngDecWarning); - - // Create a libpng info structure - auto info_ptr = png_create_info_struct(png_ptr); - - const auto pngdata = PngStruct{ - .data = param->png_mem_addr, - .size = param->png_mem_size, - .offset = 0, - }; - - png_set_read_fn(png_ptr, (void*)&pngdata, [](png_structp ps, png_bytep data, png_size_t len) { - auto pngdata = (PngStruct*)png_get_io_ptr(ps); - ::memcpy(data, pngdata->data + pngdata->offset, len); - pngdata->offset += len; - }); - - // Now call png_read_info with our pngPtr as image handle, and infoPtr to receive the file - // info. - png_read_info(png_ptr, info_ptr); - - imageInfo->image_width = png_get_image_width(png_ptr, info_ptr); - imageInfo->image_height = png_get_image_height(png_ptr, info_ptr); - imageInfo->color_space = MapPngColor(png_get_color_type(png_ptr, info_ptr)); - imageInfo->bit_depth = png_get_bit_depth(png_ptr, info_ptr); - imageInfo->image_flag = OrbisPngDecImageFlag::None; - if (png_get_interlace_type(png_ptr, info_ptr) == 1) { - imageInfo->image_flag |= OrbisPngDecImageFlag::Adam7Interlace; - } - if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) { - imageInfo->image_flag |= OrbisPngDecImageFlag::TrnsChunkExist; - } - - png_destroy_read_struct(&png_ptr, &info_ptr, nullptr); - LOG_TRACE( - Lib_Png, - "imageWidth = {} , imageHeight = {} , colorSpace = {} , bitDepth = {} , imageFlag = {}", - imageInfo->image_width, imageInfo->image_height, int(imageInfo->color_space), - imageInfo->bit_depth, int(imageInfo->image_flag)); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI scePngDecQueryMemorySize(const OrbisPngDecCreateParam* param) { - if (param == nullptr) { - LOG_ERROR(Lib_Png, "Invalid param!"); - return ORBIS_PNG_DEC_ERROR_INVALID_PARAM; - } - if (param->attribute > 1) { - LOG_ERROR(Lib_Png, "Invalid attribute! attribute = {}", param->attribute); - return ORBIS_PNG_DEC_ERROR_INVALID_ADDR; - } - if (param->max_image_width - 1 > 1000000) { - LOG_ERROR(Lib_Png, "Invalid size! width = {}", param->max_image_width); - return ORBIS_PNG_DEC_ERROR_INVALID_SIZE; - } - return sizeof(PngHandler); -} - -void RegisterLib(Core::Loader::SymbolsResolver* sym) { - LIB_FUNCTION("m0uW+8pFyaw", "libScePngDec", 1, "libScePngDec", scePngDecCreate); - LIB_FUNCTION("WC216DD3El4", "libScePngDec", 1, "libScePngDec", scePngDecDecode); - LIB_FUNCTION("cJ--1xAbj-I", "libScePngDec", 1, "libScePngDec", scePngDecDecodeWithInputControl); - LIB_FUNCTION("QbD+eENEwo8", "libScePngDec", 1, "libScePngDec", scePngDecDelete); - LIB_FUNCTION("U6h4e5JRPaQ", "libScePngDec", 1, "libScePngDec", scePngDecParseHeader); - LIB_FUNCTION("-6srIGbLTIU", "libScePngDec", 1, "libScePngDec", scePngDecQueryMemorySize); - LIB_FUNCTION("cJ--1xAbj-I", "libScePngDec_jvm", 1, "libScePngDec", - scePngDecDecodeWithInputControl); -}; - -} // namespace Libraries::PngDec diff --git a/src/core/libraries/libpng/pngdec.h b/src/core/libraries/libpng/pngdec.h deleted file mode 100644 index b306d6100..000000000 --- a/src/core/libraries/libpng/pngdec.h +++ /dev/null @@ -1,83 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "common/enum.h" -#include "common/types.h" - -namespace Core::Loader { -class SymbolsResolver; -} - -namespace Libraries::PngDec { - -enum class OrbisPngDecColorSpace : u16 { - Grayscale = 2, - Rgb, - Clut, - GrayscaleAlpha = 18, - Rgba, -}; - -enum class OrbisPngDecImageFlag : u32 { - None = 0, - Adam7Interlace = 1, - TrnsChunkExist = 2, -}; -DECLARE_ENUM_FLAG_OPERATORS(OrbisPngDecImageFlag) - -enum class OrbisPngDecPixelFormat : u16 { - R8G8B8A8 = 0, - B8G8R8A8, -}; - -enum class OrbisPngDecAttribute { - None = 0, - BitDepth16, -}; - -struct OrbisPngDecParseParam { - const u8* png_mem_addr; - u32 png_mem_size; - u32 reserved; -}; - -struct OrbisPngDecImageInfo { - u32 image_width; - u32 image_height; - OrbisPngDecColorSpace color_space; - u16 bit_depth; - OrbisPngDecImageFlag image_flag; -}; - -struct OrbisPngDecCreateParam { - u32 this_size; - u32 attribute; - u32 max_image_width; -}; - -using OrbisPngDecHandle = void*; - -struct OrbisPngDecDecodeParam { - const u8* png_mem_addr; - u8* image_mem_addr; - u32 png_mem_size; - u32 image_mem_size; - OrbisPngDecPixelFormat pixel_format; - u16 alpha_value; - u32 image_pitch; -}; - -s32 PS4_SYSV_ABI scePngDecCreate(const OrbisPngDecCreateParam* param, void* memoryAddress, - u32 memorySize, OrbisPngDecHandle* handle); -s32 PS4_SYSV_ABI scePngDecDecode(OrbisPngDecHandle handle, const OrbisPngDecDecodeParam* param, - OrbisPngDecImageInfo* imageInfo); -s32 PS4_SYSV_ABI scePngDecDecodeWithInputControl(); -s32 PS4_SYSV_ABI scePngDecDelete(OrbisPngDecHandle handle); -s32 PS4_SYSV_ABI scePngDecParseHeader(const OrbisPngDecParseParam* param, - OrbisPngDecImageInfo* imageInfo); -s32 PS4_SYSV_ABI scePngDecQueryMemorySize(const OrbisPngDecCreateParam* param); - -void RegisterLib(Core::Loader::SymbolsResolver* sym); -} // namespace Libraries::PngDec diff --git a/src/core/libraries/libpng/pngdec_error.h b/src/core/libraries/libpng/pngdec_error.h deleted file mode 100644 index 9745ed5d1..000000000 --- a/src/core/libraries/libpng/pngdec_error.h +++ /dev/null @@ -1,17 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "core/libraries/error_codes.h" - -// PngDec library -constexpr int ORBIS_PNG_DEC_ERROR_INVALID_ADDR = 0x80690001; -constexpr int ORBIS_PNG_DEC_ERROR_INVALID_SIZE = 0x80690002; -constexpr int ORBIS_PNG_DEC_ERROR_INVALID_PARAM = 0x80690003; -constexpr int ORBIS_PNG_DEC_ERROR_INVALID_HANDLE = 0x80690004; -constexpr int ORBIS_PNG_DEC_ERROR_INVALID_WORK_MEMORY = 0x80690005; -constexpr int ORBIS_PNG_DEC_ERROR_INVALID_DATA = 0x80690010; -constexpr int ORBIS_PNG_DEC_ERROR_UNSUPPORT_DATA = 0x80690011; -constexpr int ORBIS_PNG_DEC_ERROR_DECODE_ERROR = 0x80690012; -constexpr int ORBIS_PNG_DEC_ERROR_FATAL = 0x80690020; diff --git a/src/core/libraries/libpng/pngenc.cpp b/src/core/libraries/libpng/pngenc.cpp deleted file mode 100644 index a17adbf71..000000000 --- a/src/core/libraries/libpng/pngenc.cpp +++ /dev/null @@ -1,266 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include -#include "common/logging/log.h" -#include "core/libraries/error_codes.h" -#include "core/libraries/libpng/pngenc.h" -#include "core/libraries/libs.h" - -#include "pngenc_error.h" - -namespace Libraries::PngEnc { - -struct PngHandler { - png_structp png_ptr; - png_infop info_ptr; -}; - -struct PngWriter { - u8* cursor; - u8* start; - size_t capacity; - bool cancel_write; -}; - -static inline int MapPngFilter(u16 filter) { - if (filter == (u16)OrbisPngEncFilterType::All) { - return PNG_ALL_FILTERS; - } - - int f = 0; - - if (filter & (u16)OrbisPngEncFilterType::None) - f |= PNG_FILTER_NONE; - if (filter & (u16)OrbisPngEncFilterType::Sub) - f |= PNG_FILTER_SUB; - if (filter & (u16)OrbisPngEncFilterType::Up) - f |= PNG_FILTER_UP; - if (filter & (u16)OrbisPngEncFilterType::Average) - f |= PNG_FILTER_AVG; - if (filter & (u16)OrbisPngEncFilterType::Paeth) - f |= PNG_FILTER_PAETH; - - return f; -} - -void PngWriteFn(png_structp png_ptr, png_bytep data, size_t length) { - PngWriter* ctx = (PngWriter*)png_get_io_ptr(png_ptr); - - if ((size_t)(ctx->cursor - ctx->start) + length > ctx->capacity) { - LOG_ERROR(Lib_Png, "PNG output buffer too small"); - ctx->cancel_write = true; - return; - } - - memcpy(ctx->cursor, data, length); - ctx->cursor += length; -} - -void PngFlushFn(png_structp png_ptr) {} - -void PngEncError(png_structp png_ptr, png_const_charp error_message) { - LOG_ERROR(Lib_Png, "PNG error {}", error_message); -} - -void PngEncWarning(png_structp png_ptr, png_const_charp error_message) { - LOG_ERROR(Lib_Png, "PNG warning {}", error_message); -} - -s32 PS4_SYSV_ABI scePngEncCreate(const OrbisPngEncCreateParam* param, void* memoryAddress, - u32 memorySize, OrbisPngEncHandle* handle) { - if (param == nullptr || param->attribute != 0) { - LOG_ERROR(Lib_Png, "Invalid param"); - return ORBIS_PNG_ENC_ERROR_INVALID_ADDR; - } - - if (memoryAddress == nullptr) { - LOG_ERROR(Lib_Png, "Invalid memory address"); - return ORBIS_PNG_ENC_ERROR_INVALID_ADDR; - } - - if (param->max_image_width - 1 > 1000000) { - LOG_ERROR(Lib_Png, "Invalid Size, width = {}", param->max_image_width); - return ORBIS_PNG_ENC_ERROR_INVALID_SIZE; - } - - auto pngh = (PngHandler*)memoryAddress; - - pngh->png_ptr = - png_create_write_struct(PNG_LIBPNG_VER_STRING, nullptr, PngEncError, PngEncWarning); - - if (pngh->png_ptr == nullptr) - return ORBIS_PNG_ENC_ERROR_FATAL; - - pngh->info_ptr = png_create_info_struct(pngh->png_ptr); - if (pngh->info_ptr == nullptr) { - png_destroy_write_struct(&pngh->png_ptr, nullptr); - return false; - } - - *handle = pngh; - - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI scePngEncDelete(OrbisPngEncHandle handle) { - auto pngh = (PngHandler*)handle; - png_destroy_write_struct(&pngh->png_ptr, &pngh->info_ptr); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI scePngEncEncode(OrbisPngEncHandle handle, const OrbisPngEncEncodeParam* param, - OrbisPngEncOutputInfo* outputInfo) { - LOG_TRACE(Lib_Png, "called png addr = {}, image addr = {}, image size = {}", - (void*)param->png_mem_addr, (void*)param->image_mem_addr, param->image_mem_size); - - if (handle == nullptr) { - LOG_ERROR(Lib_Png, "Invalid handle"); - return ORBIS_PNG_ENC_ERROR_INVALID_HANDLE; - } - - if (param == nullptr) { - LOG_ERROR(Lib_Png, "Invalid param"); - return ORBIS_PNG_ENC_ERROR_INVALID_PARAM; - } - - if (param->image_mem_addr == nullptr || param->png_mem_addr == nullptr) { - LOG_ERROR(Lib_Png, "Invalid input or output address"); - return ORBIS_PNG_ENC_ERROR_INVALID_ADDR; - } - - if (param->png_mem_size == 0 || param->image_mem_size == 0 || param->image_height == 0 || - param->image_width == 0) { - LOG_ERROR(Lib_Png, "Invalid Size"); - return ORBIS_PNG_ENC_ERROR_INVALID_SIZE; - } - - auto pngh = (PngHandler*)handle; - - if (setjmp(png_jmpbuf(pngh->png_ptr))) { - LOG_ERROR(Lib_Png, "LibPNG aborted encode"); - return ORBIS_PNG_ENC_ERROR_FATAL; - } - - int png_color_type = PNG_COLOR_TYPE_RGB; - - if (param->color_space == OrbisPngEncColorSpace::RGBA) { - png_color_type |= PNG_COLOR_MASK_ALPHA; - } - - int png_interlace_type = PNG_INTERLACE_NONE; - int png_compression_type = PNG_COMPRESSION_TYPE_DEFAULT; - int png_filter_method = PNG_FILTER_TYPE_DEFAULT; - - PngWriter writer{}; - writer.cursor = param->png_mem_addr; - writer.start = param->png_mem_addr; - writer.capacity = param->png_mem_size; - - png_set_write_fn(pngh->png_ptr, &writer, PngWriteFn, PngFlushFn); - - png_set_IHDR(pngh->png_ptr, pngh->info_ptr, param->image_width, param->image_height, - param->bit_depth, png_color_type, png_interlace_type, png_compression_type, - png_filter_method); - - if (param->pixel_format == OrbisPngEncPixelFormat::B8G8R8A8) { - png_set_bgr(pngh->png_ptr); - } - - png_set_compression_level(pngh->png_ptr, std::clamp(param->compression_level, 0, 9)); - png_set_filter(pngh->png_ptr, 0, MapPngFilter(param->filter_type)); - - png_write_info(pngh->png_ptr, pngh->info_ptr); - - int channels = 4; - size_t row_stride = param->image_width * channels; - - uint32_t processed_height = 0; - - if (param->color_space == OrbisPngEncColorSpace::RGBA) { - for (; processed_height < param->image_height; ++processed_height) { - png_bytep row = (png_bytep)param->image_mem_addr + processed_height * row_stride; - png_write_row(pngh->png_ptr, row); - - if (outputInfo != nullptr) { - outputInfo->processed_height = processed_height; - } - - if (writer.cancel_write) { - LOG_ERROR(Lib_Png, "Ran out of room to write PNG"); - return ORBIS_PNG_ENC_ERROR_DATA_OVERFLOW; - } - } - } else { - // our input data is always rgba but when outputting without an alpha channel, libpng - // expects the input to not have alpha either, i couldn't find a way around this easily? - // png_strip_alpha is for reading and set_background wasn't working, this seems fine...? - std::vector rgb_row(param->image_width * 3); - - for (; processed_height < param->image_height; ++processed_height) { - const unsigned char* src = - param->image_mem_addr + processed_height * param->image_pitch; - - uint8_t* dst = rgb_row.data(); - - for (uint32_t x = 0; x < param->image_width; ++x) { - dst[0] = src[0]; - dst[1] = src[1]; - dst[2] = src[2]; - src += 4; // skip reading alpha channel - dst += 3; - } - - png_write_row(pngh->png_ptr, rgb_row.data()); - - if (outputInfo != nullptr) { - outputInfo->processed_height = processed_height; - } - - if (writer.cancel_write) { - LOG_ERROR(Lib_Png, "Ran out of room to write PNG"); - return ORBIS_PNG_ENC_ERROR_DATA_OVERFLOW; - } - } - } - - png_write_flush(pngh->png_ptr); - - png_write_end(pngh->png_ptr, pngh->info_ptr); - - if (outputInfo != nullptr) { - outputInfo->data_size = writer.cursor - writer.start; - outputInfo->processed_height = processed_height; - } - - return writer.cursor - writer.start; -} - -s32 PS4_SYSV_ABI scePngEncQueryMemorySize(const OrbisPngEncCreateParam* param) { - if (param == nullptr) { - LOG_ERROR(Lib_Png, "Invalid Address"); - return ORBIS_PNG_ENC_ERROR_INVALID_ADDR; - } - - if (param->attribute != 0 || param->max_filter_number > 5) { - LOG_ERROR(Lib_Png, "Invalid Param, attribute = {}, max_filter_number = {}", - param->attribute, param->max_filter_number); - return ORBIS_PNG_ENC_ERROR_INVALID_PARAM; - } - - if (param->max_image_width - 1 > 1000000) { - LOG_ERROR(Lib_Png, "Invalid Size, width = {}", param->max_image_width); - return ORBIS_PNG_ENC_ERROR_INVALID_SIZE; - } - - return sizeof(PngHandler); -} - -void RegisterLib(Core::Loader::SymbolsResolver* sym) { - LIB_FUNCTION("7aGTPfrqT9s", "libScePngEnc", 1, "libScePngEnc", scePngEncCreate); - LIB_FUNCTION("RUrWdwTWZy8", "libScePngEnc", 1, "libScePngEnc", scePngEncDelete); - LIB_FUNCTION("xgDjJKpcyHo", "libScePngEnc", 1, "libScePngEnc", scePngEncEncode); - LIB_FUNCTION("9030RnBDoh4", "libScePngEnc", 1, "libScePngEnc", scePngEncQueryMemorySize); -}; - -} // namespace Libraries::PngEnc \ No newline at end of file diff --git a/src/core/libraries/libpng/pngenc.h b/src/core/libraries/libpng/pngenc.h deleted file mode 100644 index 1e6549340..000000000 --- a/src/core/libraries/libpng/pngenc.h +++ /dev/null @@ -1,67 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "common/types.h" - -namespace Core::Loader { -class SymbolsResolver; -} - -namespace Libraries::PngEnc { - -enum class OrbisPngEncAttribute { None = 0 }; - -enum class OrbisPngEncColorSpace : u16 { RGB = 3, RGBA = 19 }; - -enum class OrbisPngEncPixelFormat : u16 { R8G8B8A8 = 0, B8G8R8A8 }; - -enum class OrbisPngEncFilterType : u16 { - None = 0, - Sub = 1, - Up = 2, - Average = 4, - Paeth = 8, - All = 15 -}; - -struct OrbisPngEncCreateParam { - u32 this_size; - u32 attribute; - u32 max_image_width; - u32 max_filter_number; -}; - -struct OrbisPngEncEncodeParam { - const u8* image_mem_addr; - u8* png_mem_addr; - u32 image_mem_size; - u32 png_mem_size; - u32 image_width; - u32 image_height; - u32 image_pitch; - OrbisPngEncPixelFormat pixel_format; - OrbisPngEncColorSpace color_space; - u16 bit_depth; - u16 clut_number; - u16 filter_type; - u16 compression_level; -}; - -struct OrbisPngEncOutputInfo { - u32 data_size; - u32 processed_height; -}; - -using OrbisPngEncHandle = void*; - -s32 PS4_SYSV_ABI scePngEncCreate(const OrbisPngEncCreateParam* param, void* memoryAddress, - u32 memorySize, OrbisPngEncHandle* handle); -s32 PS4_SYSV_ABI scePngEncDelete(OrbisPngEncHandle handle); -s32 PS4_SYSV_ABI scePngEncEncode(OrbisPngEncHandle, const OrbisPngEncEncodeParam* param, - OrbisPngEncOutputInfo* outputInfo); -s32 PS4_SYSV_ABI scePngEncQueryMemorySize(const OrbisPngEncCreateParam* param); - -void RegisterLib(Core::Loader::SymbolsResolver* sym); -} // namespace Libraries::PngEnc \ No newline at end of file diff --git a/src/core/libraries/libpng/pngenc_error.h b/src/core/libraries/libpng/pngenc_error.h deleted file mode 100644 index a07b1317f..000000000 --- a/src/core/libraries/libpng/pngenc_error.h +++ /dev/null @@ -1,14 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "core/libraries/error_codes.h" - -// PngEnc library -constexpr int ORBIS_PNG_ENC_ERROR_INVALID_ADDR = 0x80690101; -constexpr int ORBIS_PNG_ENC_ERROR_INVALID_SIZE = 0x80690102; -constexpr int ORBIS_PNG_ENC_ERROR_INVALID_PARAM = 0x80690103; -constexpr int ORBIS_PNG_ENC_ERROR_INVALID_HANDLE = 0x80690104; -constexpr int ORBIS_PNG_ENC_ERROR_DATA_OVERFLOW = 0x80690110; -constexpr int ORBIS_PNG_ENC_ERROR_FATAL = 0x80690120; \ No newline at end of file diff --git a/src/core/libraries/libs.cpp b/src/core/libraries/libs.cpp index 6db1ba18d..bfd1413a2 100644 --- a/src/core/libraries/libs.cpp +++ b/src/core/libraries/libs.cpp @@ -1,30 +1,17 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "core/libraries/ajm/ajm.h" #include "core/libraries/app_content/app_content.h" #include "core/libraries/audio/audioin.h" #include "core/libraries/audio/audioout.h" -#include "core/libraries/audio3d/audio3d.h" -#include "core/libraries/audio3d/audio3d_openal.h" #include "core/libraries/avplayer/avplayer.h" -#include "core/libraries/camera/camera.h" -#include "core/libraries/companion/companion_httpd.h" -#include "core/libraries/companion/companion_util.h" -#include "core/libraries/disc_map/disc_map.h" -#include "core/libraries/game_live_streaming/gamelivestreaming.h" #include "core/libraries/gnmdriver/gnmdriver.h" -#include "core/libraries/hmd/hmd.h" -#include "core/libraries/hmd/hmd_setup_dialog.h" #include "core/libraries/ime/error_dialog.h" #include "core/libraries/ime/ime.h" #include "core/libraries/ime/ime_dialog.h" #include "core/libraries/kernel/kernel.h" -#include "core/libraries/libc_internal/libc_internal.h" -#include "core/libraries/libpng/pngdec.h" #include "core/libraries/libs.h" -#include "core/libraries/mouse/mouse.h" -#include "core/libraries/move/move.h" #include "core/libraries/network/http.h" #include "core/libraries/network/http2.h" #include "core/libraries/network/net.h" @@ -48,15 +35,9 @@ #include "core/libraries/pad/pad.h" #include "core/libraries/playgo/playgo.h" #include "core/libraries/playgo/playgo_dialog.h" -#include "core/libraries/random/random.h" -#include "core/libraries/razor_cpu/razor_cpu.h" -#include "core/libraries/remote_play/remoteplay.h" -#include "core/libraries/rudp/rudp.h" #include "core/libraries/save_data/dialog/savedatadialog.h" #include "core/libraries/save_data/savedata.h" #include "core/libraries/screenshot/screenshot.h" -#include "core/libraries/share_play/shareplay.h" -#include "core/libraries/signin_dialog/signindialog.h" #include "core/libraries/sysmodule/sysmodule.h" #include "core/libraries/system/commondialog.h" #include "core/libraries/system/msgdialog.h" @@ -64,23 +45,14 @@ #include "core/libraries/system/systemservice.h" #include "core/libraries/system/userservice.h" #include "core/libraries/system_gesture/system_gesture.h" -#include "core/libraries/ulobjmgr/ulobjmgr.h" -#include "core/libraries/usbd/usbd.h" -#include "core/libraries/videodec/videodec.h" -#include "core/libraries/videodec/videodec2.h" #include "core/libraries/videoout/video_out.h" #include "core/libraries/voice/voice.h" -#include "core/libraries/vr_tracker/vr_tracker.h" -#include "core/libraries/web_browser_dialog/webbrowserdialog.h" -#include "core/libraries/zlib/zlib_sce.h" -#include "fiber/fiber.h" namespace Libraries { void InitHLELibs(Core::Loader::SymbolsResolver* sym) { LOG_INFO(Lib_Kernel, "Initializing HLE libraries"); Libraries::Kernel::RegisterLib(sym); - Libraries::LibcInternal::ForceRegisterLib(sym); Libraries::GnmDriver::RegisterLib(sym); Libraries::VideoOut::RegisterLib(sym); Libraries::UserService::RegisterLib(sym); @@ -114,45 +86,16 @@ void InitHLELibs(Core::Loader::SymbolsResolver* sym) { Libraries::Np::NpTus::RegisterLib(sym); Libraries::ScreenShot::RegisterLib(sym); Libraries::AppContent::RegisterLib(sym); - Libraries::PngDec::RegisterLib(sym); Libraries::PlayGo::RegisterLib(sym); Libraries::PlayGo::Dialog::RegisterLib(sym); - Libraries::Random::RegisterLib(sym); - Libraries::Usbd::RegisterLib(sym); Libraries::Pad::RegisterLib(sym); Libraries::SystemGesture::RegisterLib(sym); Libraries::Ajm::RegisterLib(sym); Libraries::ErrorDialog::RegisterLib(sym); Libraries::ImeDialog::RegisterLib(sym); Libraries::AvPlayer::RegisterLib(sym); - Libraries::Videodec::RegisterLib(sym); - Libraries::Videodec2::RegisterLib(sym); - if (EmulatorSettings.GetAudioBackend() == AudioBackend::OpenAL) { - Libraries::Audio3dOpenAL::RegisterLib(sym); - } else { - Libraries::Audio3d::RegisterLib(sym); - } Libraries::Ime::RegisterLib(sym); - Libraries::GameLiveStreaming::RegisterLib(sym); - Libraries::SharePlay::RegisterLib(sym); - Libraries::Remoteplay::RegisterLib(sym); - Libraries::RazorCpu::RegisterLib(sym); - Libraries::Move::RegisterLib(sym); - Libraries::Fiber::RegisterLib(sym); - Libraries::Mouse::RegisterLib(sym); - Libraries::WebBrowserDialog::RegisterLib(sym); - Libraries::Zlib::RegisterLib(sym); - Libraries::Hmd::RegisterLib(sym); - Libraries::HmdSetupDialog::RegisterLib(sym); - Libraries::DiscMap::RegisterLib(sym); - Libraries::Ulobjmgr::RegisterLib(sym); - Libraries::SigninDialog::RegisterLib(sym); - Libraries::Camera::RegisterLib(sym); - Libraries::CompanionHttpd::RegisterLib(sym); - Libraries::CompanionUtil::RegisterLib(sym); Libraries::Voice::RegisterLib(sym); - Libraries::Rudp::RegisterLib(sym); - Libraries::VrTracker::RegisterLib(sym); // Loading libSceSsl is locked behind a title workaround that currently applies to nothing. // Libraries::Ssl::RegisterLib(sym); diff --git a/src/core/libraries/libs.h b/src/core/libraries/libs.h index 1229e6411..4f258f913 100644 --- a/src/core/libraries/libs.h +++ b/src/core/libraries/libs.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/mouse/mouse.cpp b/src/core/libraries/mouse/mouse.cpp deleted file mode 100644 index b2799107b..000000000 --- a/src/core/libraries/mouse/mouse.cpp +++ /dev/null @@ -1,99 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -// Generated By moduleGenerator -#include "common/logging/log.h" -#include "core/libraries/error_codes.h" -#include "core/libraries/libs.h" -#include "mouse.h" - -namespace Libraries::Mouse { - -int PS4_SYSV_ABI sceMouseClose() { - LOG_ERROR(Lib_Mouse, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceMouseConnectPort() { - LOG_ERROR(Lib_Mouse, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceMouseDebugGetDeviceId() { - LOG_ERROR(Lib_Mouse, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceMouseDeviceOpen() { - LOG_ERROR(Lib_Mouse, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceMouseDisconnectDevice() { - LOG_ERROR(Lib_Mouse, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceMouseDisconnectPort() { - LOG_ERROR(Lib_Mouse, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceMouseGetDeviceInfo() { - LOG_ERROR(Lib_Mouse, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceMouseInit() { - LOG_ERROR(Lib_Mouse, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceMouseMbusInit() { - LOG_ERROR(Lib_Mouse, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceMouseOpen() { - LOG_ERROR(Lib_Mouse, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceMouseRead() { - LOG_DEBUG(Lib_Mouse, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceMouseSetHandType() { - LOG_ERROR(Lib_Mouse, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceMouseSetPointerSpeed() { - LOG_ERROR(Lib_Mouse, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceMouseSetProcessPrivilege() { - LOG_ERROR(Lib_Mouse, "(STUBBED) called"); - return ORBIS_OK; -} - -void RegisterLib(Core::Loader::SymbolsResolver* sym) { - LIB_FUNCTION("cAnT0Rw-IwU", "libSceMouse", 1, "libSceMouse", sceMouseClose); - LIB_FUNCTION("Ymyy1HSSJLQ", "libSceMouse", 1, "libSceMouse", sceMouseConnectPort); - LIB_FUNCTION("BRXOoXQtb+k", "libSceMouse", 1, "libSceMouse", sceMouseDebugGetDeviceId); - LIB_FUNCTION("WiGKINCZWkc", "libSceMouse", 1, "libSceMouse", sceMouseDeviceOpen); - LIB_FUNCTION("eDQTFHbgeTU", "libSceMouse", 1, "libSceMouse", sceMouseDisconnectDevice); - LIB_FUNCTION("jJP1vYMEPd4", "libSceMouse", 1, "libSceMouse", sceMouseDisconnectPort); - LIB_FUNCTION("QA9Qupz3Zjw", "libSceMouse", 1, "libSceMouse", sceMouseGetDeviceInfo); - LIB_FUNCTION("Qs0wWulgl7U", "libSceMouse", 1, "libSceMouse", sceMouseInit); - LIB_FUNCTION("1FeceR5YhAo", "libSceMouse", 1, "libSceMouse", sceMouseMbusInit); - LIB_FUNCTION("RaqxZIf6DvE", "libSceMouse", 1, "libSceMouse", sceMouseOpen); - LIB_FUNCTION("x8qnXqh-tiM", "libSceMouse", 1, "libSceMouse", sceMouseRead); - LIB_FUNCTION("crkFfp-cmFo", "libSceMouse", 1, "libSceMouse", sceMouseSetHandType); - LIB_FUNCTION("ghLUU2Z5Lcg", "libSceMouse", 1, "libSceMouse", sceMouseSetPointerSpeed); - LIB_FUNCTION("6aANndpS0Wo", "libSceMouse", 1, "libSceMouse", sceMouseSetProcessPrivilege); -}; - -} // namespace Libraries::Mouse \ No newline at end of file diff --git a/src/core/libraries/mouse/mouse.h b/src/core/libraries/mouse/mouse.h deleted file mode 100644 index 192343434..000000000 --- a/src/core/libraries/mouse/mouse.h +++ /dev/null @@ -1,29 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once -#include "common/types.h" - -namespace Core::Loader { -class SymbolsResolver; -} - -namespace Libraries::Mouse { - -int PS4_SYSV_ABI sceMouseClose(); -int PS4_SYSV_ABI sceMouseConnectPort(); -int PS4_SYSV_ABI sceMouseDebugGetDeviceId(); -int PS4_SYSV_ABI sceMouseDeviceOpen(); -int PS4_SYSV_ABI sceMouseDisconnectDevice(); -int PS4_SYSV_ABI sceMouseDisconnectPort(); -int PS4_SYSV_ABI sceMouseGetDeviceInfo(); -int PS4_SYSV_ABI sceMouseInit(); -int PS4_SYSV_ABI sceMouseMbusInit(); -int PS4_SYSV_ABI sceMouseOpen(); -int PS4_SYSV_ABI sceMouseRead(); -int PS4_SYSV_ABI sceMouseSetHandType(); -int PS4_SYSV_ABI sceMouseSetPointerSpeed(); -int PS4_SYSV_ABI sceMouseSetProcessPrivilege(); - -void RegisterLib(Core::Loader::SymbolsResolver* sym); -} // namespace Libraries::Mouse \ No newline at end of file diff --git a/src/core/libraries/move/move.cpp b/src/core/libraries/move/move.cpp deleted file mode 100644 index b7e86a2d7..000000000 --- a/src/core/libraries/move/move.cpp +++ /dev/null @@ -1,137 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "common/logging/log.h" -#include "core/libraries/error_codes.h" -#include "core/libraries/libs.h" -#include "core/libraries/move/move.h" -#include "core/libraries/move/move_error.h" -#include "move.h" - -namespace Libraries::Move { - -static bool g_library_initialized = false; - -s32 PS4_SYSV_ABI sceMoveInit() { - if (g_library_initialized) { - return ORBIS_MOVE_ERROR_ALREADY_INIT; - } - LOG_WARNING(Lib_Move, "Move controllers are not supported yet"); - g_library_initialized = true; - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceMoveOpen(Libraries::UserService::OrbisUserServiceUserId user_id, s32 type, - s32 index) { - LOG_DEBUG(Lib_Move, "called"); - if (!g_library_initialized) { - return ORBIS_MOVE_ERROR_NOT_INIT; - } - // Even when no controllers are connected, this returns a proper handle. - // Internal libSceVrTracker logic requires this handle to be different from other devices. - static s32 handle = 0x30b0000; - return handle += 0x100; -} - -s32 PS4_SYSV_ABI sceMoveGetDeviceInfo(s32 handle, OrbisMoveDeviceInfo* info) { - LOG_TRACE(Lib_Move, "called"); - if (!g_library_initialized) { - return ORBIS_MOVE_ERROR_NOT_INIT; - } - if (info == nullptr) { - return ORBIS_MOVE_ERROR_INVALID_ARG; - } - return ORBIS_MOVE_ERROR_NO_CONTROLLER_CONNECTED; -} - -s32 PS4_SYSV_ABI sceMoveReadStateLatest(s32 handle, OrbisMoveData* data) { - LOG_TRACE(Lib_Move, "(called"); - if (!g_library_initialized) { - return ORBIS_MOVE_ERROR_NOT_INIT; - } - if (data == nullptr) { - return ORBIS_MOVE_ERROR_INVALID_ARG; - } - return ORBIS_MOVE_ERROR_NO_CONTROLLER_CONNECTED; -} - -s32 PS4_SYSV_ABI sceMoveReadStateRecent(s32 handle, s64 timestamp, OrbisMoveData* data, - s32* out_count) { - LOG_TRACE(Lib_Move, "called"); - if (!g_library_initialized) { - return ORBIS_MOVE_ERROR_NOT_INIT; - } - if (timestamp < 0 || data == nullptr || out_count == nullptr) { - return ORBIS_MOVE_ERROR_INVALID_ARG; - } - return ORBIS_MOVE_ERROR_NO_CONTROLLER_CONNECTED; -} - -s32 PS4_SYSV_ABI sceMoveGetExtensionPortInfo(s32 handle, void* data) { - LOG_TRACE(Lib_Move, "called"); - if (!g_library_initialized) { - return ORBIS_MOVE_ERROR_NOT_INIT; - } - if (data == nullptr) { - return ORBIS_MOVE_ERROR_INVALID_ARG; - } - return ORBIS_MOVE_ERROR_NO_CONTROLLER_CONNECTED; -} - -s32 PS4_SYSV_ABI sceMoveSetVibration(s32 handle, u8 intensity) { - LOG_TRACE(Lib_Move, "called"); - if (!g_library_initialized) { - return ORBIS_MOVE_ERROR_NOT_INIT; - } - return ORBIS_MOVE_ERROR_NO_CONTROLLER_CONNECTED; -} - -s32 PS4_SYSV_ABI sceMoveSetLightSphere(s32 handle, u8 red, u8 green, u8 blue) { - LOG_TRACE(Lib_Move, "called"); - if (!g_library_initialized) { - return ORBIS_MOVE_ERROR_NOT_INIT; - } - return ORBIS_MOVE_ERROR_NO_CONTROLLER_CONNECTED; -} - -s32 PS4_SYSV_ABI sceMoveResetLightSphere(s32 handle) { - LOG_TRACE(Lib_Move, "called"); - if (!g_library_initialized) { - return ORBIS_MOVE_ERROR_NOT_INIT; - } - // Returns success, even if no controllers are connected. - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceMoveClose(s32 handle) { - LOG_DEBUG(Lib_Move, "called"); - if (!g_library_initialized) { - return ORBIS_MOVE_ERROR_NOT_INIT; - } - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceMoveTerm() { - LOG_DEBUG(Lib_Move, "called"); - if (!g_library_initialized) { - return ORBIS_MOVE_ERROR_NOT_INIT; - } - g_library_initialized = false; - return ORBIS_OK; -} - -void RegisterLib(Core::Loader::SymbolsResolver* sym) { - LIB_FUNCTION("j1ITE-EoJmE", "libSceMove", 1, "libSceMove", sceMoveInit); - LIB_FUNCTION("HzC60MfjJxU", "libSceMove", 1, "libSceMove", sceMoveOpen); - LIB_FUNCTION("GWXTyxs4QbE", "libSceMove", 1, "libSceMove", sceMoveGetDeviceInfo); - LIB_FUNCTION("ttU+JOhShl4", "libSceMove", 1, "libSceMove", sceMoveReadStateLatest); - LIB_FUNCTION("f2bcpK6kJfg", "libSceMove", 1, "libSceMove", sceMoveReadStateRecent); - LIB_FUNCTION("y5h7f8H1Jnk", "libSceMove", 1, "libSceMove", sceMoveGetExtensionPortInfo); - LIB_FUNCTION("IFQwtT2CeY0", "libSceMove", 1, "libSceMove", sceMoveSetVibration); - LIB_FUNCTION("T8KYHPs1JE8", "libSceMove", 1, "libSceMove", sceMoveSetLightSphere); - LIB_FUNCTION("zuxWAg3HAac", "libSceMove", 1, "libSceMove", sceMoveResetLightSphere); - LIB_FUNCTION("XX6wlxpHyeo", "libSceMove", 1, "libSceMove", sceMoveClose); - LIB_FUNCTION("tsZi60H4ypY", "libSceMove", 1, "libSceMove", sceMoveTerm); -}; - -} // namespace Libraries::Move \ No newline at end of file diff --git a/src/core/libraries/move/move.h b/src/core/libraries/move/move.h deleted file mode 100644 index 7300226e3..000000000 --- a/src/core/libraries/move/move.h +++ /dev/null @@ -1,47 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "common/types.h" -#include "core/libraries/system/userservice.h" - -namespace Core::Loader { -class SymbolsResolver; -} - -namespace Libraries::Move { - -struct OrbisMoveDeviceInfo { - float sphere_radius; - float accelerometer_offset[3]; -}; - -struct OrbisMoveButtonData { - u16 button_data; - u16 trigger_data; -}; - -struct OrbisMoveExtensionPortData { - u16 status; - u16 digital0; - u16 digital1; - u16 analog_right_x; - u16 analog_right_y; - u16 analog_left_x; - u16 analog_left_y; - unsigned char custom[5]; -}; - -struct OrbisMoveData { - float accelerometer[3]; - float gyro[3]; - OrbisMoveButtonData button_data; - OrbisMoveExtensionPortData extension_data; - s64 timestamp; - s32 count; - float temperature; -}; - -void RegisterLib(Core::Loader::SymbolsResolver* sym); -} // namespace Libraries::Move \ No newline at end of file diff --git a/src/core/libraries/move/move_error.h b/src/core/libraries/move/move_error.h deleted file mode 100644 index 2ba4285d7..000000000 --- a/src/core/libraries/move/move_error.h +++ /dev/null @@ -1,17 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "common/types.h" - -constexpr s32 ORBIS_MOVE_ERROR_NO_CONTROLLER_CONNECTED = 1; - -constexpr s32 ORBIS_MOVE_ERROR_NOT_INIT = 0x80EE0001; -constexpr s32 ORBIS_MOVE_ERROR_ALREADY_INIT = 0x80EE0002; -constexpr s32 ORBIS_MOVE_ERROR_INVALID_ARG = 0x80EE0003; -constexpr s32 ORBIS_MOVE_ERROR_INVALID_HANDLE = 0x80EE0004; -constexpr s32 ORBIS_MOVE_ERROR_MAX_CONTROLLERS_EXCEEDED = 0x80EE0005; -constexpr s32 ORBIS_MOVE_ERROR_INVALID_PORT = 0x80EE0006; -constexpr s32 ORBIS_MOVE_ERROR_ALREADY_OPENED = 0x80EE0007; -constexpr s32 ORBIS_MOVE_ERROR_FATAL = 0x80EE00FF; \ No newline at end of file diff --git a/src/core/libraries/network/http.cpp b/src/core/libraries/network/http.cpp index 4d6886908..a063cfacd 100644 --- a/src/core/libraries/network/http.cpp +++ b/src/core/libraries/network/http.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/logging/log.h" diff --git a/src/core/libraries/network/http.h b/src/core/libraries/network/http.h index d373fd290..623678082 100644 --- a/src/core/libraries/network/http.h +++ b/src/core/libraries/network/http.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/network/http2.cpp b/src/core/libraries/network/http2.cpp index d71c04aed..100bb5cd0 100644 --- a/src/core/libraries/network/http2.cpp +++ b/src/core/libraries/network/http2.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/logging/log.h" diff --git a/src/core/libraries/network/http2.h b/src/core/libraries/network/http2.h index 99359518a..fc0ee6ebd 100644 --- a/src/core/libraries/network/http2.h +++ b/src/core/libraries/network/http2.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/network/http_error.h b/src/core/libraries/network/http_error.h index 49cc89766..6cf86c109 100644 --- a/src/core/libraries/network/http_error.h +++ b/src/core/libraries/network/http_error.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/network/net.cpp b/src/core/libraries/network/net.cpp index baf45b64f..fa4d556c6 100644 --- a/src/core/libraries/network/net.cpp +++ b/src/core/libraries/network/net.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #ifdef WIN32 diff --git a/src/core/libraries/network/net.h b/src/core/libraries/network/net.h index 4cb7afdda..01d99d009 100644 --- a/src/core/libraries/network/net.h +++ b/src/core/libraries/network/net.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/network/net_ctl_codes.h b/src/core/libraries/network/net_ctl_codes.h index 0dac4201e..132ed792a 100644 --- a/src/core/libraries/network/net_ctl_codes.h +++ b/src/core/libraries/network/net_ctl_codes.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/network/net_ctl_obj.cpp b/src/core/libraries/network/net_ctl_obj.cpp index 5eb6403c2..e6ad42647 100644 --- a/src/core/libraries/network/net_ctl_obj.cpp +++ b/src/core/libraries/network/net_ctl_obj.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/libraries/network/net_ctl_obj.h b/src/core/libraries/network/net_ctl_obj.h index cbbb33a4e..fe80939ee 100644 --- a/src/core/libraries/network/net_ctl_obj.h +++ b/src/core/libraries/network/net_ctl_obj.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/network/net_epoll.cpp b/src/core/libraries/network/net_epoll.cpp index 4f1b521ce..e37f4cbae 100644 --- a/src/core/libraries/network/net_epoll.cpp +++ b/src/core/libraries/network/net_epoll.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/assert.h" diff --git a/src/core/libraries/network/net_epoll.h b/src/core/libraries/network/net_epoll.h index 17716b36e..757ef5644 100644 --- a/src/core/libraries/network/net_epoll.h +++ b/src/core/libraries/network/net_epoll.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/network/net_error.h b/src/core/libraries/network/net_error.h index d6eb61627..04cc30f50 100644 --- a/src/core/libraries/network/net_error.h +++ b/src/core/libraries/network/net_error.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/network/net_resolver.cpp b/src/core/libraries/network/net_resolver.cpp index a66f1519b..1d83de9e0 100644 --- a/src/core/libraries/network/net_resolver.cpp +++ b/src/core/libraries/network/net_resolver.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/assert.h" diff --git a/src/core/libraries/network/net_resolver.h b/src/core/libraries/network/net_resolver.h index 4c5c2ece8..46e9a9600 100644 --- a/src/core/libraries/network/net_resolver.h +++ b/src/core/libraries/network/net_resolver.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/network/net_util.cpp b/src/core/libraries/network/net_util.cpp index fd0ed877b..2fb821302 100644 --- a/src/core/libraries/network/net_util.cpp +++ b/src/core/libraries/network/net_util.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #ifdef _WIN32 diff --git a/src/core/libraries/network/net_util.h b/src/core/libraries/network/net_util.h index d8c6870f9..9b51e1667 100644 --- a/src/core/libraries/network/net_util.h +++ b/src/core/libraries/network/net_util.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/network/netctl.cpp b/src/core/libraries/network/netctl.cpp index 136d63810..219fee01a 100644 --- a/src/core/libraries/network/netctl.cpp +++ b/src/core/libraries/network/netctl.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #ifdef WIN32 diff --git a/src/core/libraries/network/netctl.h b/src/core/libraries/network/netctl.h index 7f139e8c3..7790b46da 100644 --- a/src/core/libraries/network/netctl.h +++ b/src/core/libraries/network/netctl.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/network/p2p_sockets.cpp b/src/core/libraries/network/p2p_sockets.cpp index cfdd1bda7..1db2b50bb 100644 --- a/src/core/libraries/network/p2p_sockets.cpp +++ b/src/core/libraries/network/p2p_sockets.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/libraries/network/posix_sockets.cpp b/src/core/libraries/network/posix_sockets.cpp index 164d85896..62c647b98 100644 --- a/src/core/libraries/network/posix_sockets.cpp +++ b/src/core/libraries/network/posix_sockets.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/libraries/network/sockets.h b/src/core/libraries/network/sockets.h index 86661c71c..818792ae4 100644 --- a/src/core/libraries/network/sockets.h +++ b/src/core/libraries/network/sockets.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/network/ssl.cpp b/src/core/libraries/network/ssl.cpp index c3720d788..f0faf6dd2 100644 --- a/src/core/libraries/network/ssl.cpp +++ b/src/core/libraries/network/ssl.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/logging/log.h" diff --git a/src/core/libraries/network/ssl.h b/src/core/libraries/network/ssl.h index fd55f528e..5f4a1319b 100644 --- a/src/core/libraries/network/ssl.h +++ b/src/core/libraries/network/ssl.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/network/ssl2.cpp b/src/core/libraries/network/ssl2.cpp index 3a7fd71e5..55dca0437 100644 --- a/src/core/libraries/network/ssl2.cpp +++ b/src/core/libraries/network/ssl2.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/logging/log.h" diff --git a/src/core/libraries/network/ssl2.h b/src/core/libraries/network/ssl2.h index 18fb205d3..865ea2b9d 100644 --- a/src/core/libraries/network/ssl2.h +++ b/src/core/libraries/network/ssl2.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/network/ssl2_error.h b/src/core/libraries/network/ssl2_error.h index 03bf94256..bfd5554fc 100644 --- a/src/core/libraries/network/ssl2_error.h +++ b/src/core/libraries/network/ssl2_error.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/network/sys_net.cpp b/src/core/libraries/network/sys_net.cpp index a0fae3a58..6d534040a 100644 --- a/src/core/libraries/network/sys_net.cpp +++ b/src/core/libraries/network/sys_net.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/libraries/network/sys_net.h b/src/core/libraries/network/sys_net.h index 5749803b5..c82096d30 100644 --- a/src/core/libraries/network/sys_net.h +++ b/src/core/libraries/network/sys_net.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/network/unix_sockets.cpp b/src/core/libraries/network/unix_sockets.cpp index 29bbc5f16..fbed460a9 100644 --- a/src/core/libraries/network/unix_sockets.cpp +++ b/src/core/libraries/network/unix_sockets.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/libraries/ngs2/ngs2.cpp b/src/core/libraries/ngs2/ngs2.cpp deleted file mode 100644 index 97d19c352..000000000 --- a/src/core/libraries/ngs2/ngs2.cpp +++ /dev/null @@ -1,591 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "common/logging/log.h" -#include "core/libraries/error_codes.h" -#include "core/libraries/libs.h" -#include "core/libraries/ngs2/ngs2.h" -#include "core/libraries/ngs2/ngs2_custom.h" -#include "core/libraries/ngs2/ngs2_error.h" -#include "core/libraries/ngs2/ngs2_geom.h" -#include "core/libraries/ngs2/ngs2_impl.h" -#include "core/libraries/ngs2/ngs2_pan.h" -#include "core/libraries/ngs2/ngs2_report.h" - -namespace Libraries::Ngs2 { - -// Ngs2 - -s32 PS4_SYSV_ABI sceNgs2CalcWaveformBlock(const OrbisNgs2WaveformFormat* format, u32 samplePos, - u32 numSamples, OrbisNgs2WaveformBlock* outBlock) { - LOG_ERROR(Lib_Ngs2, "samplePos = {}, numSamples = {}", samplePos, numSamples); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceNgs2GetWaveformFrameInfo(const OrbisNgs2WaveformFormat* format, - u32* outFrameSize, u32* outNumFrameSamples, - u32* outUnitsPerFrame, u32* outNumDelaySamples) { - LOG_ERROR(Lib_Ngs2, "called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceNgs2ParseWaveformData(const void* data, size_t dataSize, - OrbisNgs2WaveformInfo* outInfo) { - LOG_ERROR(Lib_Ngs2, "dataSize = {}", dataSize); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceNgs2ParseWaveformFile(const char* path, u64 offset, - OrbisNgs2WaveformInfo* outInfo) { - LOG_ERROR(Lib_Ngs2, "path = {}, offset = {}", path, offset); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceNgs2ParseWaveformUser(OrbisNgs2ParseReadHandler handler, uintptr_t userData, - OrbisNgs2WaveformInfo* outInfo) { - LOG_ERROR(Lib_Ngs2, "userData = {}", userData); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceNgs2RackCreate(OrbisNgs2Handle systemHandle, u32 rackId, - const OrbisNgs2RackOption* option, - const OrbisNgs2ContextBufferInfo* bufferInfo, - OrbisNgs2Handle* outHandle) { - LOG_ERROR(Lib_Ngs2, "rackId = {}", rackId); - if (!systemHandle) { - LOG_ERROR(Lib_Ngs2, "systemHandle is nullptr"); - return ORBIS_NGS2_ERROR_INVALID_SYSTEM_HANDLE; - } - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceNgs2RackCreateWithAllocator(OrbisNgs2Handle systemHandle, u32 rackId, - const OrbisNgs2RackOption* option, - const OrbisNgs2BufferAllocator* allocator, - OrbisNgs2Handle* outHandle) { - LOG_ERROR(Lib_Ngs2, "rackId = {}", rackId); - if (!systemHandle) { - LOG_ERROR(Lib_Ngs2, "systemHandle is nullptr"); - return ORBIS_NGS2_ERROR_INVALID_SYSTEM_HANDLE; - } - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceNgs2RackDestroy(OrbisNgs2Handle rackHandle, - OrbisNgs2ContextBufferInfo* outBufferInfo) { - LOG_ERROR(Lib_Ngs2, "called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceNgs2RackGetInfo(OrbisNgs2Handle rackHandle, OrbisNgs2RackInfo* outInfo, - size_t infoSize) { - LOG_ERROR(Lib_Ngs2, "infoSize = {}", infoSize); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceNgs2RackGetUserData(OrbisNgs2Handle rackHandle, uintptr_t* outUserData) { - LOG_ERROR(Lib_Ngs2, "called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceNgs2RackGetVoiceHandle(OrbisNgs2Handle rackHandle, u32 voiceIndex, - OrbisNgs2Handle* outHandle) { - LOG_DEBUG(Lib_Ngs2, "(STUBBED) voiceIndex = {}", voiceIndex); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceNgs2RackLock(OrbisNgs2Handle rackHandle) { - LOG_ERROR(Lib_Ngs2, "called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceNgs2RackQueryBufferSize(u32 rackId, const OrbisNgs2RackOption* option, - OrbisNgs2ContextBufferInfo* outBufferInfo) { - LOG_ERROR(Lib_Ngs2, "rackId = {}", rackId); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceNgs2RackSetUserData(OrbisNgs2Handle rackHandle, uintptr_t userData) { - LOG_ERROR(Lib_Ngs2, "userData = {}", userData); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceNgs2RackUnlock(OrbisNgs2Handle rackHandle) { - LOG_ERROR(Lib_Ngs2, "called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceNgs2SystemCreate(const OrbisNgs2SystemOption* option, - const OrbisNgs2ContextBufferInfo* bufferInfo, - OrbisNgs2Handle* outHandle) { - s32 result; - OrbisNgs2ContextBufferInfo localInfo; - if (!bufferInfo || !outHandle) { - if (!bufferInfo) { - result = ORBIS_NGS2_ERROR_INVALID_BUFFER_INFO; - LOG_ERROR(Lib_Ngs2, "Invalid system buffer info {}", (void*)bufferInfo); - } else { - result = ORBIS_NGS2_ERROR_INVALID_OUT_ADDRESS; - LOG_ERROR(Lib_Ngs2, "Invalid system handle address {}", (void*)outHandle); - } - - // TODO: Report errors? - } else { - // Make bufferInfo copy - localInfo.hostBuffer = bufferInfo->hostBuffer; - localInfo.hostBufferSize = bufferInfo->hostBufferSize; - for (int i = 0; i < 5; i++) { - localInfo.reserved[i] = bufferInfo->reserved[i]; - } - localInfo.userData = bufferInfo->userData; - - result = SystemSetup(option, &localInfo, 0, outHandle); - } - - // TODO: API reporting? - - LOG_INFO(Lib_Ngs2, "called"); - return result; -} - -s32 PS4_SYSV_ABI sceNgs2SystemCreateWithAllocator(const OrbisNgs2SystemOption* option, - const OrbisNgs2BufferAllocator* allocator, - OrbisNgs2Handle* outHandle) { - s32 result; - if (allocator && allocator->allocHandler != 0) { - OrbisNgs2BufferAllocHandler hostAlloc = allocator->allocHandler; - if (outHandle) { - OrbisNgs2BufferFreeHandler hostFree = allocator->freeHandler; - OrbisNgs2ContextBufferInfo bufferInfo; - result = SystemSetup(option, &bufferInfo, 0, 0); - if (result >= 0) { - uintptr_t sysUserData = allocator->userData; - result = hostAlloc(&bufferInfo); - if (result >= 0) { - OrbisNgs2Handle* handleCopy = outHandle; - result = SystemSetup(option, &bufferInfo, hostFree, handleCopy); - if (result < 0) { - if (hostFree) { - hostFree(&bufferInfo); - } - } - } - } - } else { - result = ORBIS_NGS2_ERROR_INVALID_OUT_ADDRESS; - LOG_ERROR(Lib_Ngs2, "Invalid system handle address {}", (void*)outHandle); - } - } else { - result = ORBIS_NGS2_ERROR_INVALID_BUFFER_ALLOCATOR; - LOG_ERROR(Lib_Ngs2, "Invalid system buffer allocator {}", (void*)allocator); - } - LOG_INFO(Lib_Ngs2, "called"); - return result; -} - -s32 PS4_SYSV_ABI sceNgs2SystemDestroy(OrbisNgs2Handle systemHandle, - OrbisNgs2ContextBufferInfo* outBufferInfo) { - if (!systemHandle) { - LOG_ERROR(Lib_Ngs2, "systemHandle is nullptr"); - return ORBIS_NGS2_ERROR_INVALID_SYSTEM_HANDLE; - } - LOG_INFO(Lib_Ngs2, "called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceNgs2SystemEnumHandles(OrbisNgs2Handle* aOutHandle, u32 maxHandles) { - LOG_ERROR(Lib_Ngs2, "maxHandles = {}", maxHandles); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceNgs2SystemEnumRackHandles(OrbisNgs2Handle systemHandle, - OrbisNgs2Handle* aOutHandle, u32 maxHandles) { - LOG_ERROR(Lib_Ngs2, "maxHandles = {}", maxHandles); - if (!systemHandle) { - LOG_ERROR(Lib_Ngs2, "systemHandle is nullptr"); - return ORBIS_NGS2_ERROR_INVALID_SYSTEM_HANDLE; - } - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceNgs2SystemGetInfo(OrbisNgs2Handle rackHandle, OrbisNgs2SystemInfo* outInfo, - size_t infoSize) { - LOG_ERROR(Lib_Ngs2, "infoSize = {}", infoSize); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceNgs2SystemGetUserData(OrbisNgs2Handle systemHandle, uintptr_t* outUserData) { - if (!systemHandle) { - LOG_ERROR(Lib_Ngs2, "systemHandle is nullptr"); - return ORBIS_NGS2_ERROR_INVALID_SYSTEM_HANDLE; - } - LOG_ERROR(Lib_Ngs2, "called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceNgs2SystemLock(OrbisNgs2Handle systemHandle) { - if (!systemHandle) { - LOG_ERROR(Lib_Ngs2, "systemHandle is nullptr"); - return ORBIS_NGS2_ERROR_INVALID_SYSTEM_HANDLE; - } - LOG_ERROR(Lib_Ngs2, "called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceNgs2SystemQueryBufferSize(const OrbisNgs2SystemOption* option, - OrbisNgs2ContextBufferInfo* outBufferInfo) { - s32 result; - if (outBufferInfo) { - result = SystemSetup(option, outBufferInfo, 0, 0); - LOG_INFO(Lib_Ngs2, "called"); - } else { - result = ORBIS_NGS2_ERROR_INVALID_OUT_ADDRESS; - LOG_ERROR(Lib_Ngs2, "Invalid system buffer info {}", (void*)outBufferInfo); - } - - return result; -} - -s32 PS4_SYSV_ABI sceNgs2SystemRender(OrbisNgs2Handle systemHandle, - const OrbisNgs2RenderBufferInfo* aBufferInfo, - u32 numBufferInfo) { - LOG_DEBUG(Lib_Ngs2, "(STUBBED) numBufferInfo = {}", numBufferInfo); - if (!systemHandle) { - LOG_ERROR(Lib_Ngs2, "systemHandle is nullptr"); - return ORBIS_NGS2_ERROR_INVALID_SYSTEM_HANDLE; - } - return ORBIS_OK; -} - -static s32 PS4_SYSV_ABI sceNgs2SystemResetOption(OrbisNgs2SystemOption* outOption) { - static const OrbisNgs2SystemOption option = { - sizeof(OrbisNgs2SystemOption), "", 0, 512, 256, 48000, {0}}; - - if (!outOption) { - LOG_ERROR(Lib_Ngs2, "Invalid system option address {}", (void*)outOption); - return ORBIS_NGS2_ERROR_INVALID_OPTION_ADDRESS; - } - *outOption = option; - - LOG_INFO(Lib_Ngs2, "called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceNgs2SystemSetGrainSamples(OrbisNgs2Handle systemHandle, u32 numSamples) { - LOG_ERROR(Lib_Ngs2, "numSamples = {}", numSamples); - if (!systemHandle) { - LOG_ERROR(Lib_Ngs2, "systemHandle is nullptr"); - return ORBIS_NGS2_ERROR_INVALID_SYSTEM_HANDLE; - } - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceNgs2SystemSetSampleRate(OrbisNgs2Handle systemHandle, u32 sampleRate) { - LOG_ERROR(Lib_Ngs2, "sampleRate = {}", sampleRate); - if (!systemHandle) { - LOG_ERROR(Lib_Ngs2, "systemHandle is nullptr"); - return ORBIS_NGS2_ERROR_INVALID_SYSTEM_HANDLE; - } - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceNgs2SystemSetUserData(OrbisNgs2Handle systemHandle, uintptr_t userData) { - LOG_ERROR(Lib_Ngs2, "userData = {}", userData); - if (!systemHandle) { - LOG_ERROR(Lib_Ngs2, "systemHandle is nullptr"); - return ORBIS_NGS2_ERROR_INVALID_SYSTEM_HANDLE; - } - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceNgs2SystemUnlock(OrbisNgs2Handle systemHandle) { - if (!systemHandle) { - LOG_ERROR(Lib_Ngs2, "systemHandle is nullptr"); - return ORBIS_NGS2_ERROR_INVALID_SYSTEM_HANDLE; - } - LOG_ERROR(Lib_Ngs2, "called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceNgs2VoiceControl(OrbisNgs2Handle voiceHandle, - const OrbisNgs2VoiceParamHeader* paramList) { - LOG_ERROR(Lib_Ngs2, "called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceNgs2VoiceGetMatrixInfo(OrbisNgs2Handle voiceHandle, u32 matrixId, - OrbisNgs2VoiceMatrixInfo* outInfo, size_t outInfoSize) { - LOG_ERROR(Lib_Ngs2, "matrixId = {}, outInfoSize = {}", matrixId, outInfoSize); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceNgs2VoiceGetOwner(OrbisNgs2Handle voiceHandle, OrbisNgs2Handle* outRackHandle, - u32* outVoiceId) { - LOG_ERROR(Lib_Ngs2, "called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceNgs2VoiceGetPortInfo(OrbisNgs2Handle voiceHandle, u32 port, - OrbisNgs2VoicePortInfo* outInfo, size_t outInfoSize) { - LOG_ERROR(Lib_Ngs2, "port = {}, outInfoSize = {}", port, outInfoSize); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceNgs2VoiceGetState(OrbisNgs2Handle voiceHandle, OrbisNgs2VoiceState* outState, - size_t stateSize) { - LOG_ERROR(Lib_Ngs2, "stateSize = {}", stateSize); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceNgs2VoiceGetStateFlags(OrbisNgs2Handle voiceHandle, u32* outStateFlags) { - LOG_ERROR(Lib_Ngs2, "called"); - return ORBIS_OK; -} - -// Ngs2Custom - -s32 PS4_SYSV_ABI sceNgs2CustomRackGetModuleInfo(OrbisNgs2Handle rackHandle, u32 moduleIndex, - OrbisNgs2CustomModuleInfo* outInfo, - size_t infoSize) { - LOG_ERROR(Lib_Ngs2, "moduleIndex = {}, infoSize = {}", moduleIndex, infoSize); - return ORBIS_OK; -} - -// Ngs2Geom - -s32 PS4_SYSV_ABI sceNgs2GeomResetListenerParam(OrbisNgs2GeomListenerParam* outListenerParam) { - LOG_ERROR(Lib_Ngs2, "called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceNgs2GeomResetSourceParam(OrbisNgs2GeomSourceParam* outSourceParam) { - LOG_ERROR(Lib_Ngs2, "called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceNgs2GeomCalcListener(const OrbisNgs2GeomListenerParam* param, - OrbisNgs2GeomListenerWork* outWork, u32 flags) { - LOG_ERROR(Lib_Ngs2, "flags = {}", flags); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceNgs2GeomApply(const OrbisNgs2GeomListenerWork* listener, - const OrbisNgs2GeomSourceParam* source, - OrbisNgs2GeomAttribute* outAttrib, u32 flags) { - LOG_ERROR(Lib_Ngs2, "flags = {}", flags); - return ORBIS_OK; -} - -// Ngs2Pan - -s32 PS4_SYSV_ABI sceNgs2PanInit(OrbisNgs2PanWork* work, const float* aSpeakerAngle, float unitAngle, - u32 numSpeakers) { - LOG_ERROR(Lib_Ngs2, "unitAngle = {}, numSpeakers = {}", unitAngle, numSpeakers); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceNgs2PanGetVolumeMatrix(OrbisNgs2PanWork* work, const OrbisNgs2PanParam* aParam, - u32 numParams, u32 matrixFormat, - float* outVolumeMatrix) { - LOG_ERROR(Lib_Ngs2, "numParams = {}, matrixFormat = {}", numParams, matrixFormat); - return ORBIS_OK; -} - -// Ngs2Report - -s32 PS4_SYSV_ABI sceNgs2ReportRegisterHandler(u32 reportType, OrbisNgs2ReportHandler handler, - uintptr_t userData, OrbisNgs2Handle* outHandle) { - LOG_INFO(Lib_Ngs2, "reportType = {}, userData = {}", reportType, userData); - if (!handler) { - LOG_ERROR(Lib_Ngs2, "handler is nullptr"); - return ORBIS_NGS2_ERROR_INVALID_REPORT_HANDLE; - } - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceNgs2ReportUnregisterHandler(OrbisNgs2Handle reportHandle) { - if (!reportHandle) { - LOG_ERROR(Lib_Ngs2, "reportHandle is nullptr"); - return ORBIS_NGS2_ERROR_INVALID_REPORT_HANDLE; - } - LOG_INFO(Lib_Ngs2, "called"); - return ORBIS_OK; -} - -// Unknown - -int PS4_SYSV_ABI sceNgs2FftInit() { - LOG_ERROR(Lib_Ngs2, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceNgs2FftProcess() { - LOG_ERROR(Lib_Ngs2, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceNgs2FftQuerySize() { - LOG_ERROR(Lib_Ngs2, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceNgs2JobSchedulerResetOption() { - LOG_ERROR(Lib_Ngs2, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceNgs2ModuleArrayEnumItems() { - LOG_ERROR(Lib_Ngs2, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceNgs2ModuleEnumConfigs() { - LOG_ERROR(Lib_Ngs2, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceNgs2ModuleQueueEnumItems() { - LOG_ERROR(Lib_Ngs2, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceNgs2RackQueryInfo() { - LOG_ERROR(Lib_Ngs2, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceNgs2RackRunCommands() { - LOG_ERROR(Lib_Ngs2, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceNgs2SystemQueryInfo() { - LOG_ERROR(Lib_Ngs2, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceNgs2SystemRunCommands() { - LOG_ERROR(Lib_Ngs2, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceNgs2SystemSetLoudThreshold() { - LOG_ERROR(Lib_Ngs2, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceNgs2StreamCreate() { - LOG_ERROR(Lib_Ngs2, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceNgs2StreamCreateWithAllocator() { - LOG_ERROR(Lib_Ngs2, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceNgs2StreamDestroy() { - LOG_ERROR(Lib_Ngs2, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceNgs2StreamQueryBufferSize() { - LOG_ERROR(Lib_Ngs2, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceNgs2StreamQueryInfo() { - LOG_ERROR(Lib_Ngs2, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceNgs2StreamResetOption() { - LOG_ERROR(Lib_Ngs2, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceNgs2StreamRunCommands() { - LOG_ERROR(Lib_Ngs2, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceNgs2VoiceQueryInfo() { - LOG_ERROR(Lib_Ngs2, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceNgs2VoiceRunCommands() { - LOG_ERROR(Lib_Ngs2, "(STUBBED) called"); - return ORBIS_OK; -} - -void RegisterLib(Core::Loader::SymbolsResolver* sym) { - LIB_FUNCTION("3pCNbVM11UA", "libSceNgs2", 1, "libSceNgs2", sceNgs2CalcWaveformBlock); - LIB_FUNCTION("6qN1zaEZuN0", "libSceNgs2", 1, "libSceNgs2", sceNgs2CustomRackGetModuleInfo); - LIB_FUNCTION("Kg1MA5j7KFk", "libSceNgs2", 1, "libSceNgs2", sceNgs2FftInit); - LIB_FUNCTION("D8eCqBxSojA", "libSceNgs2", 1, "libSceNgs2", sceNgs2FftProcess); - LIB_FUNCTION("-YNfTO6KOMY", "libSceNgs2", 1, "libSceNgs2", sceNgs2FftQuerySize); - LIB_FUNCTION("eF8yRCC6W64", "libSceNgs2", 1, "libSceNgs2", sceNgs2GeomApply); - LIB_FUNCTION("1WsleK-MTkE", "libSceNgs2", 1, "libSceNgs2", sceNgs2GeomCalcListener); - LIB_FUNCTION("7Lcfo8SmpsU", "libSceNgs2", 1, "libSceNgs2", sceNgs2GeomResetListenerParam); - LIB_FUNCTION("0lbbayqDNoE", "libSceNgs2", 1, "libSceNgs2", sceNgs2GeomResetSourceParam); - LIB_FUNCTION("ekGJmmoc8j4", "libSceNgs2", 1, "libSceNgs2", sceNgs2GetWaveformFrameInfo); - LIB_FUNCTION("BcoPfWfpvVI", "libSceNgs2", 1, "libSceNgs2", sceNgs2JobSchedulerResetOption); - LIB_FUNCTION("EEemGEQCjO8", "libSceNgs2", 1, "libSceNgs2", sceNgs2ModuleArrayEnumItems); - LIB_FUNCTION("TaoNtmMKkXQ", "libSceNgs2", 1, "libSceNgs2", sceNgs2ModuleEnumConfigs); - LIB_FUNCTION("ve6bZi+1sYQ", "libSceNgs2", 1, "libSceNgs2", sceNgs2ModuleQueueEnumItems); - LIB_FUNCTION("gbMKV+8Enuo", "libSceNgs2", 1, "libSceNgs2", sceNgs2PanGetVolumeMatrix); - LIB_FUNCTION("xa8oL9dmXkM", "libSceNgs2", 1, "libSceNgs2", sceNgs2PanInit); - LIB_FUNCTION("hyVLT2VlOYk", "libSceNgs2", 1, "libSceNgs2", sceNgs2ParseWaveformData); - LIB_FUNCTION("iprCTXPVWMI", "libSceNgs2", 1, "libSceNgs2", sceNgs2ParseWaveformFile); - LIB_FUNCTION("t9T0QM17Kvo", "libSceNgs2", 1, "libSceNgs2", sceNgs2ParseWaveformUser); - LIB_FUNCTION("cLV4aiT9JpA", "libSceNgs2", 1, "libSceNgs2", sceNgs2RackCreate); - LIB_FUNCTION("U546k6orxQo", "libSceNgs2", 1, "libSceNgs2", sceNgs2RackCreateWithAllocator); - LIB_FUNCTION("lCqD7oycmIM", "libSceNgs2", 1, "libSceNgs2", sceNgs2RackDestroy); - LIB_FUNCTION("M4LYATRhRUE", "libSceNgs2", 1, "libSceNgs2", sceNgs2RackGetInfo); - LIB_FUNCTION("Mn4XNDg03XY", "libSceNgs2", 1, "libSceNgs2", sceNgs2RackGetUserData); - LIB_FUNCTION("MwmHz8pAdAo", "libSceNgs2", 1, "libSceNgs2", sceNgs2RackGetVoiceHandle); - LIB_FUNCTION("MzTa7VLjogY", "libSceNgs2", 1, "libSceNgs2", sceNgs2RackLock); - LIB_FUNCTION("0eFLVCfWVds", "libSceNgs2", 1, "libSceNgs2", sceNgs2RackQueryBufferSize); - LIB_FUNCTION("TZqb8E-j3dY", "libSceNgs2", 1, "libSceNgs2", sceNgs2RackQueryInfo); - LIB_FUNCTION("MI2VmBx2RbM", "libSceNgs2", 1, "libSceNgs2", sceNgs2RackRunCommands); - LIB_FUNCTION("JNTMIaBIbV4", "libSceNgs2", 1, "libSceNgs2", sceNgs2RackSetUserData); - LIB_FUNCTION("++YZ7P9e87U", "libSceNgs2", 1, "libSceNgs2", sceNgs2RackUnlock); - LIB_FUNCTION("uBIN24Tv2MI", "libSceNgs2", 1, "libSceNgs2", sceNgs2ReportRegisterHandler); - LIB_FUNCTION("nPzb7Ly-VjE", "libSceNgs2", 1, "libSceNgs2", sceNgs2ReportUnregisterHandler); - LIB_FUNCTION("koBbCMvOKWw", "libSceNgs2", 1, "libSceNgs2", sceNgs2SystemCreate); - LIB_FUNCTION("mPYgU4oYpuY", "libSceNgs2", 1, "libSceNgs2", sceNgs2SystemCreateWithAllocator); - LIB_FUNCTION("u-WrYDaJA3k", "libSceNgs2", 1, "libSceNgs2", sceNgs2SystemDestroy); - LIB_FUNCTION("vubFP0T6MP0", "libSceNgs2", 1, "libSceNgs2", sceNgs2SystemEnumHandles); - LIB_FUNCTION("U-+7HsswcIs", "libSceNgs2", 1, "libSceNgs2", sceNgs2SystemEnumRackHandles); - LIB_FUNCTION("vU7TQ62pItw", "libSceNgs2", 1, "libSceNgs2", sceNgs2SystemGetInfo); - LIB_FUNCTION("4lFaRxd-aLs", "libSceNgs2", 1, "libSceNgs2", sceNgs2SystemGetUserData); - LIB_FUNCTION("gThZqM5PYlQ", "libSceNgs2", 1, "libSceNgs2", sceNgs2SystemLock); - LIB_FUNCTION("pgFAiLR5qT4", "libSceNgs2", 1, "libSceNgs2", sceNgs2SystemQueryBufferSize); - LIB_FUNCTION("3oIK7y7O4k0", "libSceNgs2", 1, "libSceNgs2", sceNgs2SystemQueryInfo) - LIB_FUNCTION("i0VnXM-C9fc", "libSceNgs2", 1, "libSceNgs2", sceNgs2SystemRender); - LIB_FUNCTION("AQkj7C0f3PY", "libSceNgs2", 1, "libSceNgs2", sceNgs2SystemResetOption); - LIB_FUNCTION("gXiormHoZZ4", "libSceNgs2", 1, "libSceNgs2", sceNgs2SystemRunCommands); - LIB_FUNCTION("l4Q2dWEH6UM", "libSceNgs2", 1, "libSceNgs2", sceNgs2SystemSetGrainSamples); - LIB_FUNCTION("Wdlx0ZFTV9s", "libSceNgs2", 1, "libSceNgs2", sceNgs2SystemSetLoudThreshold); - LIB_FUNCTION("-tbc2SxQD60", "libSceNgs2", 1, "libSceNgs2", sceNgs2SystemSetSampleRate); - LIB_FUNCTION("GZB2v0XnG0k", "libSceNgs2", 1, "libSceNgs2", sceNgs2SystemSetUserData); - LIB_FUNCTION("JXRC5n0RQls", "libSceNgs2", 1, "libSceNgs2", sceNgs2SystemUnlock); - LIB_FUNCTION("sU2St3agdjg", "libSceNgs2", 1, "libSceNgs2", sceNgs2StreamCreate); - LIB_FUNCTION("I+RLwaauggA", "libSceNgs2", 1, "libSceNgs2", sceNgs2StreamCreateWithAllocator); - LIB_FUNCTION("bfoMXnTRtwE", "libSceNgs2", 1, "libSceNgs2", sceNgs2StreamDestroy); - LIB_FUNCTION("dxulc33msHM", "libSceNgs2", 1, "libSceNgs2", sceNgs2StreamQueryBufferSize); - LIB_FUNCTION("rfw6ufRsmow", "libSceNgs2", 1, "libSceNgs2", sceNgs2StreamQueryInfo); - LIB_FUNCTION("q+2W8YdK0F8", "libSceNgs2", 1, "libSceNgs2", sceNgs2StreamResetOption); - LIB_FUNCTION("qQHCi9pjDps", "libSceNgs2", 1, "libSceNgs2", sceNgs2StreamRunCommands); - LIB_FUNCTION("uu94irFOGpA", "libSceNgs2", 1, "libSceNgs2", sceNgs2VoiceControl); - LIB_FUNCTION("jjBVvPN9964", "libSceNgs2", 1, "libSceNgs2", sceNgs2VoiceGetMatrixInfo); - LIB_FUNCTION("W-Z8wWMBnhk", "libSceNgs2", 1, "libSceNgs2", sceNgs2VoiceGetOwner); - LIB_FUNCTION("WCayTgob7-o", "libSceNgs2", 1, "libSceNgs2", sceNgs2VoiceGetPortInfo); - LIB_FUNCTION("-TOuuAQ-buE", "libSceNgs2", 1, "libSceNgs2", sceNgs2VoiceGetState); - LIB_FUNCTION("rEh728kXk3w", "libSceNgs2", 1, "libSceNgs2", sceNgs2VoiceGetStateFlags); - LIB_FUNCTION("9eic4AmjGVI", "libSceNgs2", 1, "libSceNgs2", sceNgs2VoiceQueryInfo); - LIB_FUNCTION("AbYvTOZ8Pts", "libSceNgs2", 1, "libSceNgs2", sceNgs2VoiceRunCommands); -}; - -} // namespace Libraries::Ngs2 diff --git a/src/core/libraries/ngs2/ngs2.h b/src/core/libraries/ngs2/ngs2.h deleted file mode 100644 index 4a5724d0f..000000000 --- a/src/core/libraries/ngs2/ngs2.h +++ /dev/null @@ -1,274 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "core/libraries/ngs2/ngs2_impl.h" - -#include -#include -#include -#include "common/types.h" - -namespace Core::Loader { -class SymbolsResolver; -} - -namespace Libraries::Ngs2 { - -using OrbisNgs2ParseReadHandler = s32 PS4_SYSV_ABI (*)(uintptr_t user_data, u32 offset, void* data, - size_t size); - -enum class OrbisNgs2HandleType : u32 { - Invalid = 0, - System = 1, - Rack = 2, - Voice = 3, - VoiceControl = 6 -}; - -static const int ORBIS_NGS2_MAX_VOICE_CHANNELS = 8; -static const int ORBIS_NGS2_WAVEFORM_INFO_MAX_BLOCKS = 4; -static const int ORBIS_NGS2_MAX_MATRIX_LEVELS = - (ORBIS_NGS2_MAX_VOICE_CHANNELS * ORBIS_NGS2_MAX_VOICE_CHANNELS); - -struct OrbisNgs2WaveformFormat { - u32 waveformType; - u32 numChannels; - u32 sampleRate; - u32 configData; - u32 frameOffset; - u32 frameMargin; -}; - -struct OrbisNgs2WaveformBlock { - u32 dataOffset; - u32 dataSize; - u32 numRepeats; - u32 numSkipSamples; - u32 numSamples; - u32 reserved; - uintptr_t userData; -}; - -struct OrbisNgs2WaveformInfo { - OrbisNgs2WaveformFormat format; - - u32 dataOffset; - u32 dataSize; - - u32 loopBeginPosition; - u32 loopEndPosition; - u32 numSamples; - - u32 audioUnitSize; - u32 numAudioUnitSamples; - u32 numAudioUnitPerFrame; - - u32 audioFrameSize; - u32 numAudioFrameSamples; - - u32 numDelaySamples; - - u32 numBlocks; - OrbisNgs2WaveformBlock aBlock[ORBIS_NGS2_WAVEFORM_INFO_MAX_BLOCKS]; -}; - -struct OrbisNgs2EnvelopePoint { - u32 curve; - u32 duration; - float height; -}; - -struct OrbisNgs2UserFxProcessContext { - float** aChannelData; - uintptr_t userData0; - uintptr_t userData1; - uintptr_t userData2; - u32 flags; - u32 numChannels; - u32 numGrainSamples; - u32 sampleRate; -}; - -using OrbisNgs2UserFxProcessHandler = s32 PS4_SYSV_ABI (*)(OrbisNgs2UserFxProcessContext* context); - -struct OrbisNgs2UserFx2SetupContext { - void* common; - void* param; - void* work; - uintptr_t userData; - u32 maxVoices; - u32 voiceIndex; - u64 reserved[4]; -}; - -using OrbisNgs2UserFx2SetupHandler = s32 PS4_SYSV_ABI (*)(OrbisNgs2UserFx2SetupContext* context); - -struct OrbisNgs2UserFx2CleanupContext { - void* common; - void* param; - void* work; - uintptr_t userData; - u32 maxVoices; - u32 voiceIndex; - u64 reserved[4]; -}; - -using OrbisNgs2UserFx2CleanupHandler = - s32 PS4_SYSV_ABI (*)(OrbisNgs2UserFx2CleanupContext* context); - -struct OrbisNgs2UserFx2ControlContext { - const void* data; - size_t dataSize; - void* common; - void* param; - uintptr_t userData; - u64 reserved[4]; -}; - -using OrbisNgs2UserFx2ControlHandler = - s32 PS4_SYSV_ABI (*)(OrbisNgs2UserFx2ControlContext* context); - -struct OrbisNgs2UserFx2ProcessContext { - float** aChannelData; - void* common; - const void* param; - void* work; - void* state; - uintptr_t userData; - u32 flags; - u32 numInputChannels; - u32 numOutputChannels; - u32 numGrainSamples; - u32 sampleRate; - u32 reserved; - u64 reserved2[4]; -}; - -using OrbisNgs2UserFx2ProcessHandler = - s32 PS4_SYSV_ABI (*)(OrbisNgs2UserFx2ProcessContext* context); - -struct OrbisNgs2BufferAllocator { - OrbisNgs2BufferAllocHandler allocHandler; - OrbisNgs2BufferFreeHandler freeHandler; - uintptr_t userData; -}; - -struct OrbisNgs2RenderBufferInfo { - void* buffer; - size_t bufferSize; - u32 waveformType; - u32 numChannels; -}; - -struct OrbisNgs2RackOption { - size_t size; - char name[ORBIS_NGS2_RACK_NAME_LENGTH]; - - u32 flags; - u32 maxGrainSamples; - u32 maxVoices; - u32 maxInputDelayBlocks; - u32 maxMatrices; - u32 maxPorts; - u32 aReserved[20]; -}; - -struct OrbisNgs2VoiceParamHeader { - u16 size; - s16 next; - u32 id; -}; - -struct OrbisNgs2VoiceMatrixLevelsParam { - OrbisNgs2VoiceParamHeader header; - - u32 matrixId; - u32 numLevels; - const float* aLevel; -}; - -struct OrbisNgs2VoicePortMatrixParam { - OrbisNgs2VoiceParamHeader header; - - u32 port; - s32 matrixId; -}; - -struct OrbisNgs2VoicePortVolumeParam { - OrbisNgs2VoiceParamHeader header; - - u32 port; - float level; -}; - -struct OrbisNgs2VoicePortDelayParam { - OrbisNgs2VoiceParamHeader header; - - u32 port; - u32 numSamples; -}; - -struct OrbisNgs2VoicePatchParam { - OrbisNgs2VoiceParamHeader header; - - u32 port; - u32 destInputId; - OrbisNgs2Handle destHandle; -}; - -struct OrbisNgs2VoiceEventParam { - OrbisNgs2VoiceParamHeader header; - - u32 eventId; -}; - -struct OrbisNgs2VoiceCallbackInfo { - uintptr_t callbackData; - OrbisNgs2Handle voiceHandle; - u32 flag; - u32 reserved; - union { - struct { - uintptr_t userData; - const void* data; - u32 dataSize; - u32 repeatedCount; - u32 attributeFlags; - u32 reserved2; - } waveformBlock; - } param; -}; - -using OrbisNgs2VoiceCallbackHandler = void PS4_SYSV_ABI (*)(const OrbisNgs2VoiceCallbackInfo* info); - -struct OrbisNgs2VoiceCallbackParam { - OrbisNgs2VoiceParamHeader header; - OrbisNgs2VoiceCallbackHandler callbackHandler; - - uintptr_t callbackData; - u32 flags; - u32 reserved; -}; - -struct OrbisNgs2VoicePortInfo { - s32 matrixId; - float volume; - u32 numDelaySamples; - u32 destInputId; - OrbisNgs2Handle destHandle; -}; - -struct OrbisNgs2VoiceMatrixInfo { - u32 numLevels; - float aLevel[ORBIS_NGS2_MAX_MATRIX_LEVELS]; -}; - -struct OrbisNgs2VoiceState { - u32 stateFlags; -}; - -void RegisterLib(Core::Loader::SymbolsResolver* sym); - -} // namespace Libraries::Ngs2 diff --git a/src/core/libraries/ngs2/ngs2_custom.cpp b/src/core/libraries/ngs2/ngs2_custom.cpp deleted file mode 100644 index 8c82e4e49..000000000 --- a/src/core/libraries/ngs2/ngs2_custom.cpp +++ /dev/null @@ -1,12 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "ngs2_error.h" -#include "ngs2_impl.h" - -#include "common/logging/log.h" -#include "core/libraries/error_codes.h" - -using namespace Libraries::Kernel; - -namespace Libraries::Ngs2 {} // namespace Libraries::Ngs2 diff --git a/src/core/libraries/ngs2/ngs2_custom.h b/src/core/libraries/ngs2/ngs2_custom.h deleted file mode 100644 index 0c45a5d81..000000000 --- a/src/core/libraries/ngs2/ngs2_custom.h +++ /dev/null @@ -1,444 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "ngs2.h" -#include "ngs2_reverb.h" - -namespace Libraries::Ngs2 { - -class Ngs2Custom; - -static const int ORBIS_NGS2_CUSTOM_MAX_MODULES = 24; -static const int ORBIS_NGS2_CUSTOM_MAX_PORTS = 16; -static const int ORBIS_NGS2_CUSTOM_DELAY_MAX_TAPS = 8; - -struct OrbisNgs2CustomModuleOption { - u32 size; -}; - -struct OrbisNgs2CustomEnvelopeModuleOption { - OrbisNgs2CustomModuleOption customModuleOption; - - u32 maxPoints; - u32 reserved; -}; - -struct OrbisNgs2CustomReverbModuleOption { - OrbisNgs2CustomModuleOption customModuleOption; - - u32 reverbSize; - u32 reserved; -}; - -struct OrbisNgs2CustomChorusModuleOption { - OrbisNgs2CustomModuleOption customModuleOption; - - u32 maxPhases; - u32 reserved; -} OrbisNgs2CustomChorusModuleOption; - -struct OrbisNgs2CustomPeakMeterModuleOption { - OrbisNgs2CustomModuleOption customModuleOption; - u32 numBlocks; - u32 reserved; -}; - -struct OrbisNgs2CustomDelayModuleOption { - OrbisNgs2CustomModuleOption customModuleOption; - - u32 type; - u32 maxTaps; - float maxLength; - u32 reserved; -}; - -struct OrbisNgs2CustomPitchShiftModuleOption { - OrbisNgs2CustomModuleOption customModuleOption; - - u32 quality; -}; - -struct OrbisNgs2CustomUserFx2ModuleOption { - OrbisNgs2CustomModuleOption customModuleOption; - - OrbisNgs2UserFx2SetupHandler setupHandler; - OrbisNgs2UserFx2CleanupHandler cleanupHandler; - OrbisNgs2UserFx2ControlHandler controlHandler; - OrbisNgs2UserFx2ProcessHandler processHandler; - - size_t commonSize; - size_t paramSize; - size_t workSize; - uintptr_t userData; -}; - -struct OrbisNgs2CustomRackModuleInfo { - const OrbisNgs2CustomModuleOption* option; - - u32 moduleId; - u32 sourceBufferId; - u32 extraBufferId; - u32 destBufferId; - u32 stateOffset; - u32 stateSize; - u32 reserved; - u32 reserved2; -}; - -struct OrbisNgs2CustomRackPortInfo { - u32 sourceBufferId; - u32 reserved; -}; - -struct OrbisNgs2CustomRackOption { - OrbisNgs2RackOption rackOption; - u32 stateSize; - u32 numBuffers; - u32 numModules; - u32 reserved; - OrbisNgs2CustomRackModuleInfo aModule[ORBIS_NGS2_CUSTOM_MAX_MODULES]; - OrbisNgs2CustomRackPortInfo aPort[ORBIS_NGS2_CUSTOM_MAX_PORTS]; -}; - -struct OrbisNgs2CustomSamplerRackOption { - OrbisNgs2CustomRackOption customRackOption; - - u32 maxChannelWorks; - u32 maxWaveformBlocks; - u32 maxAtrac9Decoders; - u32 maxAtrac9ChannelWorks; - u32 maxAjmAtrac9Decoders; - u32 maxCodecCaches; -}; - -struct OrbisNgs2CustomSubmixerRackOption { - OrbisNgs2CustomRackOption customRackOption; - - u32 maxChannels; - u32 maxInputs; -}; - -struct OrbisNgs2CustomMasteringRackOption { - OrbisNgs2CustomRackOption customRackOption; - - u32 maxChannels; - u32 maxInputs; -}; - -struct OrbisNgs2CustomSamplerVoiceSetupParam { - OrbisNgs2VoiceParamHeader header; - OrbisNgs2WaveformFormat format; - u32 flags; - u32 reserved; -}; - -struct OrbisNgs2CustomSamplerVoiceWaveformBlocksParam { - OrbisNgs2VoiceParamHeader header; - const void* data; - u32 flags; - u32 numBlocks; - const OrbisNgs2WaveformBlock* aBlock; -}; - -struct OrbisNgs2CustomSamplerVoiceWaveformAddressParam { - OrbisNgs2VoiceParamHeader header; - const void* from; - const void* to; -}; - -struct OrbisNgs2CustomSamplerVoiceWaveformFrameOffsetParam { - OrbisNgs2VoiceParamHeader header; - u32 frameOffset; - u32 reserved; -}; - -struct OrbisNgs2CustomSamplerVoiceExitLoopParam { - OrbisNgs2VoiceParamHeader header; -}; - -struct OrbisNgs2CustomSamplerVoicePitchParam { - OrbisNgs2VoiceParamHeader header; - float ratio; - u32 reserved; -}; - -struct OrbisNgs2CustomSamplerVoiceState { - OrbisNgs2VoiceState voiceState; - char padding[32]; - const void* waveformData; - u64 numDecodedSamples; - u64 decodedDataSize; - u64 userData; - u32 reserved; - u32 reserved2; -}; - -struct OrbisNgs2CustomSubmixerVoiceSetupParam { - OrbisNgs2VoiceParamHeader header; - u32 numInputChannels; - u32 numOutputChannels; - u32 flags; - u32 reserved; -}; - -struct OrbisNgs2CustomSubmixerVoiceState { - OrbisNgs2VoiceState voiceState; // Voice state - u32 reserved; - u32 reserved2; -}; - -struct OrbisNgs2CustomMasteringVoiceSetupParam { - OrbisNgs2VoiceParamHeader header; - u32 numInputChannels; - u32 flags; -}; - -struct OrbisNgs2CustomMasteringVoiceOutputParam { - OrbisNgs2VoiceParamHeader header; - u32 outputId; - u32 reserved; -}; - -struct OrbisNgs2CustomMasteringVoiceState { - OrbisNgs2VoiceState voiceState; - u32 reserved; - u32 reserved2; -}; - -struct OrbisNgs2CustomVoiceEnvelopeParam { - OrbisNgs2VoiceParamHeader header; - u32 numForwardPoints; - u32 numReleasePoints; - const OrbisNgs2EnvelopePoint* aPoint; -}; - -struct OrbisNgs2CustomVoiceDistortionParam { - OrbisNgs2VoiceParamHeader header; - u32 flags; - float a; - float b; - float clip; - float gate; - float wetLevel; - float dryLevel; - u32 reserved; -}; - -struct OrbisNgs2CustomVoiceCompressorParam { - OrbisNgs2VoiceParamHeader header; - u32 flags; - float threshold; - float ratio; - float knee; - float attackTime; - float releaseTime; - float level; - u32 reserved; -}; - -struct OrbisNgs2CustomVoiceFilterParam { - OrbisNgs2VoiceParamHeader header; - u32 type; - u32 channelMask; - union { - struct { - float i0; - float i1; - float i2; - float o1; - float o2; - } direct; - struct { - float fc; - float q; - float level; - u32 reserved; - u32 reserved2; - } fcq; - } param; - u32 reserved3; -}; - -struct OrbisNgs2CustomVoiceLfeFilterParam { - OrbisNgs2VoiceParamHeader header; - u32 enableFlag; - u32 fc; -}; - -struct OrbisNgs2CustomVoiceGainParam { - OrbisNgs2VoiceParamHeader header; - float aLevel[ORBIS_NGS2_MAX_VOICE_CHANNELS]; -}; - -struct OrbisNgs2CustomVoiceMixerParam { - OrbisNgs2VoiceParamHeader header; - float aSourceLevel[ORBIS_NGS2_MAX_VOICE_CHANNELS]; - float aDestLevel[ORBIS_NGS2_MAX_VOICE_CHANNELS]; -}; - -struct OrbisNgs2CustomVoiceChannelMixerParam { - OrbisNgs2VoiceParamHeader header; - float aLevel[ORBIS_NGS2_MAX_VOICE_CHANNELS][ORBIS_NGS2_MAX_VOICE_CHANNELS]; -}; - -struct OrbisNgs2CustomVoiceUserFxParam { - OrbisNgs2VoiceParamHeader header; - OrbisNgs2UserFxProcessHandler handler; - - uintptr_t userData0; - uintptr_t userData1; - uintptr_t userData2; -}; - -struct OrbisNgs2CustomVoiceUserFx2Param { - OrbisNgs2VoiceParamHeader header; - const void* data; - size_t dataSize; -}; - -struct OrbisNgs2CustomVoiceOutputParam { - OrbisNgs2VoiceParamHeader header; - u32 outputId; - u32 reserved; -}; - -struct OrbisNgs2CustomVoicePeakMeterParam { - OrbisNgs2VoiceParamHeader header; - u32 enableFlag; - u32 reserved; -} OrbisNgs2CustomVoicePeakMeterParam; - -struct OrbisNgs2CustomVoiceReverbParam { - OrbisNgs2VoiceParamHeader header; - OrbisNgs2ReverbI3DL2Param i3dl2; -}; - -struct OrbisNgs2CustomVoiceChorusParam { - OrbisNgs2VoiceParamHeader header; - u32 flags; - u32 numPhases; - u32 channelMask; - float inputLevel; - float delayTime; - float modulationRatio; - float modulationDepth; - float feedbackLevel; - float wetLevel; - float dryLevel; -}; - -struct OrbisNgs2DelayTapInfo { - float tapLevel; - float delayTime; -}; - -struct OrbisNgs2CustomVoiceDelayParam { - OrbisNgs2VoiceParamHeader header; - float dryLevel; - float wetLevel; - float inputLevel; - float feedbackLevel; - float lowpassFc; - u32 numTaps; - OrbisNgs2DelayTapInfo aTap[ORBIS_NGS2_CUSTOM_DELAY_MAX_TAPS]; - float aInputMixLevel[ORBIS_NGS2_MAX_VOICE_CHANNELS]; - u32 channelMask; - u32 flags; -}; - -struct OrbisNgs2CustomVoiceNoiseGateParam { - OrbisNgs2VoiceParamHeader header; - u32 flags; - float threshold; - float attackTime; - float releaseTime; -}; - -struct OrbisNgs2CustomVoicePitchShiftParam { - OrbisNgs2VoiceParamHeader header; - s32 cent; -}; - -struct OrbisNgs2CustomEnvelopeModuleState { - float height; - u32 reserved; -}; - -struct OrbisNgs2CustomCompressorModuleState { - float peakHeight; - float compressorHeight; -}; - -struct OrbisNgs2CustomPeakMeterModuleState { - float peak; - float aChannelPeak[ORBIS_NGS2_MAX_VOICE_CHANNELS]; - u32 reserved; -}; - -struct OrbisNgs2CustomNoiseGateModuleState { - float gateHeight; -}; - -struct OrbisNgs2CustomRackInfo { - OrbisNgs2RackInfo rackInfo; - u32 stateSize; - u32 numBuffers; - u32 numModules; - u32 reserved; - OrbisNgs2CustomRackModuleInfo aModule[ORBIS_NGS2_CUSTOM_MAX_MODULES]; - OrbisNgs2CustomRackPortInfo aPort[ORBIS_NGS2_CUSTOM_MAX_PORTS]; -}; - -struct OrbisNgs2CustomSamplerRackInfo { - OrbisNgs2CustomRackInfo customRackInfo; - - u32 maxChannelWorks; - u32 maxWaveformBlocks; - u32 maxAtrac9Decoders; - u32 maxAtrac9ChannelWorks; - u32 maxAjmAtrac9Decoders; - u32 maxCodecCaches; -}; - -struct OrbisNgs2CustomSubmixerRackInfo { - OrbisNgs2CustomRackInfo customRackInfo; - - u32 maxChannels; - u32 maxInputs; -}; - -struct OrbisNgs2CustomMasteringRackInfo { - OrbisNgs2CustomRackInfo customRackInfo; - - u32 maxChannels; - u32 maxInputs; -}; - -struct OrbisNgs2CustomModuleInfo { - u32 moduleId; - u32 sourceBufferId; - u32 extraBufferId; - u32 destBufferId; - u32 stateOffset; - u32 stateSize; - u32 reserved; - u32 reserved2; -}; - -struct OrbisNgs2CustomEnvelopeModuleInfo { - OrbisNgs2CustomModuleInfo moduleInfo; - - u32 maxPoints; - u32 reserved; -}; - -struct OrbisNgs2CustomReverbModuleInfo { - OrbisNgs2CustomModuleInfo moduleInfo; - - u32 reverbSize; - u32 reserved; -}; - -} // namespace Libraries::Ngs2 diff --git a/src/core/libraries/ngs2/ngs2_eq.cpp b/src/core/libraries/ngs2/ngs2_eq.cpp deleted file mode 100644 index 8c82e4e49..000000000 --- a/src/core/libraries/ngs2/ngs2_eq.cpp +++ /dev/null @@ -1,12 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "ngs2_error.h" -#include "ngs2_impl.h" - -#include "common/logging/log.h" -#include "core/libraries/error_codes.h" - -using namespace Libraries::Kernel; - -namespace Libraries::Ngs2 {} // namespace Libraries::Ngs2 diff --git a/src/core/libraries/ngs2/ngs2_eq.h b/src/core/libraries/ngs2/ngs2_eq.h deleted file mode 100644 index 99688f24e..000000000 --- a/src/core/libraries/ngs2/ngs2_eq.h +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "ngs2.h" - -namespace Libraries::Ngs2 { - -class Ngs2Eq; - -struct OrbisNgs2EqVoiceSetupParam { - u32 numChannels; -}; - -struct OrbisNgs2EqVoiceFilterParam { - u32 type; - u32 channelMask; - union { - struct { - float i0; - float i1; - float i2; - float o1; - float o2; - } direct; - struct { - float fc; - float q; - float level; - u32 reserved; - u32 reserved2; - } fcq; - } param; -}; - -struct OrbisNgs2EqVoiceState { - u32 stateFlags; -}; - -} // namespace Libraries::Ngs2 diff --git a/src/core/libraries/ngs2/ngs2_error.h b/src/core/libraries/ngs2/ngs2_error.h deleted file mode 100644 index 2773168e2..000000000 --- a/src/core/libraries/ngs2/ngs2_error.h +++ /dev/null @@ -1,118 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -constexpr int ORBIS_NGS2_ERROR_FAIL = 0x804A0001; -constexpr int ORBIS_NGS2_ERROR_INVALID_MAX_GRAIN_SAMPLES = 0x804A0050; -constexpr int ORBIS_NGS2_ERROR_INVALID_NUM_GRAIN_SAMPLES = 0x804A0051; -constexpr int ORBIS_NGS2_ERROR_INVALID_NUM_CHANNELS = 0x804A0052; -constexpr int ORBIS_NGS2_ERROR_INVALID_OUT_ADDRESS = 0x804A0053; -constexpr int ORBIS_NGS2_ERROR_INVALID_OUT_SIZE = 0x804A0054; -constexpr int ORBIS_NGS2_ERROR_INVALID_OPTION_ADDRESS = 0x804A0080; -constexpr int ORBIS_NGS2_ERROR_INVALID_OPTION_SIZE = 0x804A0081; -constexpr int ORBIS_NGS2_ERROR_INVALID_OPTION_FLAG = 0x804A0082; -constexpr int ORBIS_NGS2_ERROR_INVALID_MAX_MATRICES = 0x804A0100; -constexpr int ORBIS_NGS2_ERROR_INVALID_MAX_PORTS = 0x804A0101; -constexpr int ORBIS_NGS2_ERROR_INVALID_MAX_INPUT_DELAY_BLOCKS = 0x804A0102; -constexpr int ORBIS_NGS2_ERROR_INVALID_MAX_VOICES = 0x804A0103; -constexpr int ORBIS_NGS2_ERROR_INVALID_MAX_CHANNELS = 0x804A0104; -constexpr int ORBIS_NGS2_ERROR_INVALID_MAX_CHANNEL_WORKS = 0x804A0105; -constexpr int ORBIS_NGS2_ERROR_INVALID_MAX_WAVEFORM_BLOCKS = 0x804A0106; -constexpr int ORBIS_NGS2_ERROR_INVALID_MAX_ENVELOPE_POINTS = 0x804A0107; -constexpr int ORBIS_NGS2_ERROR_INVALID_MAX_FILTERS = 0x804A0108; -constexpr int ORBIS_NGS2_ERROR_INVALID_MAX_CODEC_CACHES = 0x804A0109; -constexpr int ORBIS_NGS2_ERROR_INVALID_MAX_ATRAC9_DECODERS = 0x804A010A; -constexpr int ORBIS_NGS2_ERROR_INVALID_MAX_ATRAC9_CHANNEL_WORKS = 0x804A010B; -constexpr int ORBIS_NGS2_ERROR_INVALID_MAX_INPUTS = 0x804A010C; -constexpr int ORBIS_NGS2_ERROR_INVALID_NUM_MATRIX_LEVELS = 0x804A0150; -constexpr int ORBIS_NGS2_ERROR_INVALID_NUM_WAVEFORM_BLOCKS = 0x804A0151; -constexpr int ORBIS_NGS2_ERROR_INVALID_NUM_ENVELOPE_POINTS = 0x804A0152; -constexpr int ORBIS_NGS2_ERROR_INVALID_MATRIX_LEVEL_ADDRESS = 0x804A0153; -constexpr int ORBIS_NGS2_ERROR_INVALID_WAVEFORM_BLOCK_ADDRESS = 0x804A0154; -constexpr int ORBIS_NGS2_ERROR_INVALID_ENVELOPE_POINT_ADDRESS = 0x804A0155; -constexpr int ORBIS_NGS2_ERROR_INVALID_NUM_PEAKMETER_BLOCKS = 0x804A0156; -constexpr int ORBIS_NGS2_ERROR_INVALID_HANDLE = 0x804A0200; -constexpr int ORBIS_NGS2_ERROR_INVALID_SAMPLE_RATE = 0x804A0201; -constexpr int ORBIS_NGS2_ERROR_INVALID_REPORT_TYPE = 0x804A0202; -constexpr int ORBIS_NGS2_ERROR_INVALID_REPORT_HANDLER = 0x804A0203; -constexpr int ORBIS_NGS2_ERROR_INVALID_REPORT_HANDLE = 0x804A0204; -constexpr int ORBIS_NGS2_ERROR_EMPTY_REPORT_HANDLE = 0x804A0205; -constexpr int ORBIS_NGS2_ERROR_INVALID_BUFFER_INFO = 0x804A0206; -constexpr int ORBIS_NGS2_ERROR_INVALID_BUFFER_ADDRESS = 0x804A0207; -constexpr int ORBIS_NGS2_ERROR_INVALID_BUFFER_ALIGN = 0x804A0208; -constexpr int ORBIS_NGS2_ERROR_INVALID_BUFFER_SIZE = 0x804A0209; -constexpr int ORBIS_NGS2_ERROR_INVALID_BUFFER_ALLOCATOR = 0x804A020A; -constexpr int ORBIS_NGS2_ERROR_BUFFER_BROKEN = 0x804A020B; -constexpr int ORBIS_NGS2_ERROR_EMPTY_BUFFER = 0x804A020C; -constexpr int ORBIS_NGS2_ERROR_INVALID_SYSTEM_HANDLE = 0x804A0230; -constexpr int ORBIS_NGS2_ERROR_INVALID_RACK_ID = 0x804A0260; -constexpr int ORBIS_NGS2_ERROR_INVALID_RACK_HANDLE = 0x804A0261; -constexpr int ORBIS_NGS2_ERROR_INVALID_VOICE_HANDLE = 0x804A0300; -constexpr int ORBIS_NGS2_ERROR_UNINIT_VOICE = 0x804A0301; -constexpr int ORBIS_NGS2_ERROR_INVALID_VOICE_INDEX = 0x804A0302; -constexpr int ORBIS_NGS2_ERROR_INVALID_EVENT_TYPE = 0x804A0303; -constexpr int ORBIS_NGS2_ERROR_INVALID_PORT_INDEX = 0x804A0304; -constexpr int ORBIS_NGS2_ERROR_INVALID_PATCH = 0x804A0305; -constexpr int ORBIS_NGS2_ERROR_EMPTY_CHANNEL_WORK = 0x804A0306; -constexpr int ORBIS_NGS2_ERROR_EMPTY_CODEC_DECODER = 0x804A0307; -constexpr int ORBIS_NGS2_ERROR_INVALID_VOICE_CONTROL_ID = 0x804A0308; -constexpr int ORBIS_NGS2_ERROR_INVALID_VOICE_CONTROL_ADDRESS = 0x804A0309; -constexpr int ORBIS_NGS2_ERROR_INVALID_VOICE_CONTROL_SIZE = 0x804A030A; -constexpr int ORBIS_NGS2_ERROR_DETECTED_CIRCULAR_VOICE_CONTROL = 0x804A030B; -constexpr int ORBIS_NGS2_ERROR_UNABLE_CALLBACK = 0x804A030C; -constexpr int ORBIS_NGS2_ERROR_INVALID_CALLBACK_FLAG = 0x804A030D; -constexpr int ORBIS_NGS2_ERROR_INVALID_CALLBACK_HANDLER = 0x804A030E; -constexpr int ORBIS_NGS2_ERROR_INVALID_OPERATION = 0x804A030F; -constexpr int ORBIS_NGS2_ERROR_INVALID_WAVEFORM_FORMAT = 0x804A0400; -constexpr int ORBIS_NGS2_ERROR_UNKNOWN_WAVEFORM_FORMAT = 0x804A0401; -constexpr int ORBIS_NGS2_ERROR_INVALID_WAVEFORM_TYPE = 0x804A0402; -constexpr int ORBIS_NGS2_ERROR_INVALID_WAVEFORM_CONFIG = 0x804A0403; -constexpr int ORBIS_NGS2_ERROR_INVALID_WAVEFORM_SAMPLE_RATE = 0x804A0404; -constexpr int ORBIS_NGS2_ERROR_INVALID_WAVEFORM_FRAME = 0x804A0405; -constexpr int ORBIS_NGS2_ERROR_INVALID_WAVEFORM_ADDRESS = 0x804A0406; -constexpr int ORBIS_NGS2_ERROR_INVALID_WAVEFORM_SIZE = 0x804A0407; -constexpr int ORBIS_NGS2_ERROR_INVALID_WAVEFORM_DATA = 0x804A0408; -constexpr int ORBIS_NGS2_ERROR_INVALID_WAVEFORM_BLOCK_NUM_REPEATS = 0x804A0409; -constexpr int ORBIS_NGS2_ERROR_INVALID_ENVELOPE_CURVE = 0x804A0500; -constexpr int ORBIS_NGS2_ERROR_INVALID_PEAKMETER_FLAG = 0x804A0510; -constexpr int ORBIS_NGS2_ERROR_INVALID_MAX_CHORUS_PHASES = 0x804A0520; -constexpr int ORBIS_NGS2_ERROR_INVALID_NUM_CHORUS_PHASES = 0x804A0521; -constexpr int ORBIS_NGS2_ERROR_INVALID_MAX_DELAY_LENGTH = 0x804A0530; -constexpr int ORBIS_NGS2_ERROR_INVALID_MAX_DELAY_TAPS = 0x804A0531; -constexpr int ORBIS_NGS2_ERROR_INVALID_DELAY_TYPE = 0x804A0532; -constexpr int ORBIS_NGS2_ERROR_INVALID_NUM_DELAY_TAPS = 0x804A0533; -constexpr int ORBIS_NGS2_ERROR_INVALID_DELAY_TAP_INFO = 0x804A0534; -constexpr int ORBIS_NGS2_ERROR_INVALID_PITCH_SHIFT_QUALITY = 0x804A0540; -constexpr int ORBIS_NGS2_ERROR_INVALID_FILTER_INDEX = 0x804A0600; -constexpr int ORBIS_NGS2_ERROR_INVALID_FILTER_TYPE = 0x804A0601; -constexpr int ORBIS_NGS2_ERROR_INVALID_FILTER_LOCATION = 0x804A0602; -constexpr int ORBIS_NGS2_ERROR_INVALID_LFE_FC = 0x804A0603; -constexpr int ORBIS_NGS2_ERROR_INVALID_USER_FX_PARAM_SIZE = 0x804A0650; -constexpr int ORBIS_NGS2_ERROR_INVALID_MATRIX_INDEX = 0x804A0700; -constexpr int ORBIS_NGS2_ERROR_CODEC_UNKNOWN_WAVEFORM = 0x804A0800; -constexpr int ORBIS_NGS2_ERROR_CODEC_EMPTY_INSTANCE = 0x804A0801; -constexpr int ORBIS_NGS2_ERROR_CODEC_EMPTY_CHANNEL = 0x804A0802; -constexpr int ORBIS_NGS2_ERROR_CODEC_SETUP_FAIL = 0x804A0803; -constexpr int ORBIS_NGS2_ERROR_CODEC_RESET_FAIL = 0x804A0804; -constexpr int ORBIS_NGS2_ERROR_CODEC_DECODE_FAIL = 0x804A0805; -constexpr int ORBIS_NGS2_ERROR_INVALID_REVERB_SIZE = 0x804A0900; -constexpr int ORBIS_NGS2_ERROR_INVALID_PAN_UNIT_ANGLE = 0x804A0910; -constexpr int ORBIS_NGS2_ERROR_INVALID_PAN_SPEAKER = 0x804A0911; -constexpr int ORBIS_NGS2_ERROR_INVALID_PAN_MATRIX_FORMAT = 0x804A0912; -constexpr int ORBIS_NGS2_ERROR_INVALID_PAN_WORK = 0x804A0913; -constexpr int ORBIS_NGS2_ERROR_INVALID_PAN_PARAM = 0x804A0914; -constexpr int ORBIS_NGS2_ERROR_INVALID_GEOM_DISTANCE = 0x804A0920; -constexpr int ORBIS_NGS2_ERROR_INVALID_GEOM_LISTENER_ADDRESS = 0x804A0921; -constexpr int ORBIS_NGS2_ERROR_INVALID_GEOM_SOURCE_ADDRESS = 0x804A0922; -constexpr int ORBIS_NGS2_ERROR_INVALID_GEOM_FLAG = 0x804A0923; -constexpr int ORBIS_NGS2_ERROR_INVALID_GEOM_CONE = 0x804A0924; -constexpr int ORBIS_NGS2_ERROR_INVALID_MODULE_ID = 0x804A0A00; -constexpr int ORBIS_NGS2_ERROR_INVALID_NUM_MODULES = 0x804A0A01; -constexpr int ORBIS_NGS2_ERROR_INVALID_NUM_MODULE_BUFFERS = 0x804A0A02; -constexpr int ORBIS_NGS2_ERROR_INVALID_MODULE_BUFFER_ID = 0x804A0A03; -constexpr int ORBIS_NGS2_ERROR_INVALID_MODULE_STATE_OFFSET = 0x804A0A04; -constexpr int ORBIS_NGS2_ERROR_INVALID_MODULE_STATE_SIZE = 0x804A0A05; -constexpr int ORBIS_NGS2_ERROR_INVALID_VOICE_STATE_SIZE = 0x804A0A06; -constexpr int ORBIS_NGS2_ERROR_INVALID_MODULE_INDEX = 0x804A0B00; -constexpr int ORBIS_NGS2_ERROR_INVALID_MODULE_INFO_SIZE = 0x804A0B01; \ No newline at end of file diff --git a/src/core/libraries/ngs2/ngs2_geom.cpp b/src/core/libraries/ngs2/ngs2_geom.cpp deleted file mode 100644 index 8c82e4e49..000000000 --- a/src/core/libraries/ngs2/ngs2_geom.cpp +++ /dev/null @@ -1,12 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "ngs2_error.h" -#include "ngs2_impl.h" - -#include "common/logging/log.h" -#include "core/libraries/error_codes.h" - -using namespace Libraries::Kernel; - -namespace Libraries::Ngs2 {} // namespace Libraries::Ngs2 diff --git a/src/core/libraries/ngs2/ngs2_geom.h b/src/core/libraries/ngs2/ngs2_geom.h deleted file mode 100644 index 93af99d8d..000000000 --- a/src/core/libraries/ngs2/ngs2_geom.h +++ /dev/null @@ -1,80 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "ngs2.h" - -namespace Libraries::Ngs2 { - -class Ngs2Geom; - -struct OrbisNgs2GeomVector { - float x; - float y; - float z; -}; - -struct OrbisNgs2GeomCone { - float innerLevel; - float innerAngle; - float outerLevel; - float outerAngle; -}; - -struct OrbisNgs2GeomRolloff { - u32 model; - float maxDistance; - float rolloffFactor; - float referenceDistance; -}; - -struct OrbisNgs2GeomListenerParam { - OrbisNgs2GeomVector position; - OrbisNgs2GeomVector orientFront; - OrbisNgs2GeomVector orientUp; - OrbisNgs2GeomVector velocity; - float soundSpeed; - u32 reserved[2]; -}; - -struct OrbisNgs2GeomListenerWork { - float matrix[4][4]; - OrbisNgs2GeomVector velocity; - float soundSpeed; - u32 coordinate; - u32 reserved[3]; -}; - -struct OrbisNgs2GeomSourceParam { - OrbisNgs2GeomVector position; - OrbisNgs2GeomVector velocity; - OrbisNgs2GeomVector direction; - OrbisNgs2GeomCone cone; - OrbisNgs2GeomRolloff rolloff; - float dopplerFactor; - float fbwLevel; - float lfeLevel; - float maxLevel; - float minLevel; - float radius; - u32 numSpeakers; - u32 matrixFormat; - u32 reserved[2]; -}; - -struct OrbisNgs2GeomA3dAttribute { - OrbisNgs2GeomVector position; - float volume; - u32 reserved[4]; -}; - -struct OrbisNgs2GeomAttribute { - float pitchRatio; - float aLevel[ORBIS_NGS2_MAX_VOICE_CHANNELS * ORBIS_NGS2_MAX_VOICE_CHANNELS]; - - OrbisNgs2GeomA3dAttribute a3dAttrib; - u32 reserved[4]; -}; - -} // namespace Libraries::Ngs2 diff --git a/src/core/libraries/ngs2/ngs2_impl.cpp b/src/core/libraries/ngs2/ngs2_impl.cpp deleted file mode 100644 index 141ac41ba..000000000 --- a/src/core/libraries/ngs2/ngs2_impl.cpp +++ /dev/null @@ -1,187 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "ngs2_error.h" -#include "ngs2_impl.h" - -#include "common/logging/log.h" -#include "core/libraries/error_codes.h" -#include "core/libraries/kernel/kernel.h" - -using namespace Libraries::Kernel; - -namespace Libraries::Ngs2 { - -s32 HandleReportInvalid(OrbisNgs2Handle handle, u32 handleType) { - switch (handleType) { - case 1: - LOG_ERROR(Lib_Ngs2, "Invalid system handle {}", handle); - return ORBIS_NGS2_ERROR_INVALID_SYSTEM_HANDLE; - case 2: - LOG_ERROR(Lib_Ngs2, "Invalid rack handle {}", handle); - return ORBIS_NGS2_ERROR_INVALID_RACK_HANDLE; - case 4: - LOG_ERROR(Lib_Ngs2, "Invalid voice handle {}", handle); - return ORBIS_NGS2_ERROR_INVALID_VOICE_HANDLE; - case 8: - LOG_ERROR(Lib_Ngs2, "Invalid report handle {}", handle); - return ORBIS_NGS2_ERROR_INVALID_REPORT_HANDLE; - default: - LOG_ERROR(Lib_Ngs2, "Invalid handle {}", handle); - return ORBIS_NGS2_ERROR_INVALID_HANDLE; - } -} - -void* MemoryClear(void* buffer, size_t size) { - return memset(buffer, 0, size); -} - -s32 StackBufferClose(StackBuffer* stackBuffer, size_t* outTotalSize) { - if (outTotalSize) { - *outTotalSize = stackBuffer->usedSize + stackBuffer->alignment; - } - return ORBIS_OK; -} - -s32 StackBufferOpen(StackBuffer* stackBuffer, void* bufferStart, size_t bufferSize, - void** outBuffer, u8 flags) { - stackBuffer->top = outBuffer; - stackBuffer->base = bufferStart; - stackBuffer->size = (size_t)bufferStart; - stackBuffer->currentOffset = (size_t)bufferStart; - stackBuffer->usedSize = 0; - stackBuffer->totalSize = bufferSize; - stackBuffer->alignment = 8; // this is a fixed value - stackBuffer->flags = flags; - - if (outBuffer != NULL) { - *outBuffer = NULL; - } - - return ORBIS_OK; -} - -s32 SystemCleanup(OrbisNgs2Handle systemHandle, OrbisNgs2ContextBufferInfo* outInfo) { - if (!systemHandle) { - return ORBIS_NGS2_ERROR_INVALID_HANDLE; - } - - // TODO - - return ORBIS_OK; -} - -s32 SystemSetupCore(StackBuffer* stackBuffer, const OrbisNgs2SystemOption* option, - SystemInternal* outSystem) { - u32 maxGrainSamples = 512; - u32 numGrainSamples = 256; - u32 sampleRate = 48000; - - if (option) { - sampleRate = option->sampleRate; - maxGrainSamples = option->maxGrainSamples; - numGrainSamples = option->numGrainSamples; - } - - if (maxGrainSamples < 64 || maxGrainSamples > 1024 || (maxGrainSamples & 63) != 0) { - LOG_ERROR(Lib_Ngs2, "Invalid system option (maxGrainSamples={},x64)", maxGrainSamples); - return ORBIS_NGS2_ERROR_INVALID_MAX_GRAIN_SAMPLES; - } - - if (numGrainSamples < 64 || numGrainSamples > 1024 || (numGrainSamples & 63) != 0) { - LOG_ERROR(Lib_Ngs2, "Invalid system option (numGrainSamples={},x64)", numGrainSamples); - return ORBIS_NGS2_ERROR_INVALID_NUM_GRAIN_SAMPLES; - } - - if (sampleRate != 11025 && sampleRate != 12000 && sampleRate != 22050 && sampleRate != 24000 && - sampleRate != 44100 && sampleRate != 48000 && sampleRate != 88200 && sampleRate != 96000 && - sampleRate != 176400 && sampleRate != 192000) { - LOG_ERROR(Lib_Ngs2, "Invalid system option(sampleRate={}:44.1/48kHz series)", sampleRate); - return ORBIS_NGS2_ERROR_INVALID_SAMPLE_RATE; - } - - if (outSystem) { - // dummy handle - outSystem->systemHandle = 1; - } - - return ORBIS_OK; -} - -s32 SystemSetup(const OrbisNgs2SystemOption* option, OrbisNgs2ContextBufferInfo* hostBufferInfo, - OrbisNgs2BufferFreeHandler hostFree, OrbisNgs2Handle* outHandle) { - u8 optionFlags = 0; - StackBuffer stackBuffer; - SystemInternal setupResult; - void* systemList = NULL; - size_t requiredBufferSize = 0; - u32 result = ORBIS_NGS2_ERROR_INVALID_BUFFER_SIZE; - - if (option) { - if (option->size != 64) { - LOG_ERROR(Lib_Ngs2, "Invalid system option size ({})", option->size); - return ORBIS_NGS2_ERROR_INVALID_OPTION_SIZE; - } - optionFlags = option->flags >> 31; - } - - // Init - StackBufferOpen(&stackBuffer, NULL, 0, NULL, optionFlags); - result = SystemSetupCore(&stackBuffer, option, 0); - - if (result < 0) { - return result; - } - - StackBufferClose(&stackBuffer, &requiredBufferSize); - - // outHandle unprovided - if (!outHandle) { - hostBufferInfo->hostBuffer = NULL; - hostBufferInfo->hostBufferSize = requiredBufferSize; - MemoryClear(&hostBufferInfo->reserved, sizeof(hostBufferInfo->reserved)); - return ORBIS_OK; - } - - if (!hostBufferInfo->hostBuffer) { - LOG_ERROR(Lib_Ngs2, "Invalid system buffer address ({})", hostBufferInfo->hostBuffer); - return ORBIS_NGS2_ERROR_INVALID_BUFFER_ADDRESS; - } - - if (hostBufferInfo->hostBufferSize < requiredBufferSize) { - LOG_ERROR(Lib_Ngs2, "Invalid system buffer size ({}<{}[byte])", - hostBufferInfo->hostBufferSize, requiredBufferSize); - return ORBIS_NGS2_ERROR_INVALID_BUFFER_SIZE; - } - - // Setup - StackBufferOpen(&stackBuffer, hostBufferInfo->hostBuffer, hostBufferInfo->hostBufferSize, - &systemList, optionFlags); - result = SystemSetupCore(&stackBuffer, option, &setupResult); - - if (result < 0) { - return result; - } - - StackBufferClose(&stackBuffer, &requiredBufferSize); - - // Copy buffer results - setupResult.bufferInfo = *hostBufferInfo; - setupResult.hostFree = hostFree; - // TODO - // setupResult.systemList = systemList; - - OrbisNgs2Handle systemHandle = setupResult.systemHandle; - if (hostBufferInfo->hostBufferSize >= requiredBufferSize) { - *outHandle = systemHandle; - return ORBIS_OK; - } - - SystemCleanup(systemHandle, 0); - - LOG_ERROR(Lib_Ngs2, "Invalid system buffer size ({}<{}[byte])", hostBufferInfo->hostBufferSize, - requiredBufferSize); - return ORBIS_NGS2_ERROR_INVALID_BUFFER_SIZE; -} - -} // namespace Libraries::Ngs2 diff --git a/src/core/libraries/ngs2/ngs2_impl.h b/src/core/libraries/ngs2/ngs2_impl.h deleted file mode 100644 index a433e84fd..000000000 --- a/src/core/libraries/ngs2/ngs2_impl.h +++ /dev/null @@ -1,179 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "core/libraries/kernel/threads/pthread.h" - -namespace Libraries::Ngs2 { - -static const int ORBIS_NGS2_SYSTEM_NAME_LENGTH = 16; -static const int ORBIS_NGS2_RACK_NAME_LENGTH = 16; - -typedef uintptr_t OrbisNgs2Handle; - -struct OrbisNgs2ContextBufferInfo { - void* hostBuffer; - size_t hostBufferSize; - uintptr_t reserved[5]; - uintptr_t userData; -}; - -struct OrbisNgs2SystemOption { - size_t size; - char name[ORBIS_NGS2_SYSTEM_NAME_LENGTH]; - - u32 flags; - u32 maxGrainSamples; - u32 numGrainSamples; - u32 sampleRate; - u32 aReserved[6]; -}; - -using OrbisNgs2BufferAllocHandler = - s32 PS4_SYSV_ABI (*)(OrbisNgs2ContextBufferInfo* io_buffer_info); -using OrbisNgs2BufferFreeHandler = s32 PS4_SYSV_ABI (*)(OrbisNgs2ContextBufferInfo* io_buffer_info); - -struct OrbisNgs2SystemInfo { - char name[ORBIS_NGS2_SYSTEM_NAME_LENGTH]; // 0 - - OrbisNgs2Handle systemHandle; // 16 - OrbisNgs2ContextBufferInfo bufferInfo; // 24 - - u32 uid; // 88 - u32 minGrainSamples; // 92 - u32 maxGrainSamples; // 96 - - u32 stateFlags; // 100 - u32 rackCount; // 104 - float lastRenderRatio; // 108 - s64 lastRenderTick; // 112 - s64 renderCount; // 120 - u32 sampleRate; // 128 - u32 numGrainSamples; // 132 -}; - -struct OrbisNgs2RackInfo { - char name[ORBIS_NGS2_RACK_NAME_LENGTH]; // 0 - - OrbisNgs2Handle rackHandle; // 16 - OrbisNgs2ContextBufferInfo bufferInfo; // 24 - - OrbisNgs2Handle ownerSystemHandle; // 88 - - u32 type; // 96 - u32 rackId; // 100 - u32 uid; // 104 - u32 minGrainSamples; // 108 - u32 maxGrainSamples; // 112 - u32 maxVoices; // 116 - u32 maxChannelWorks; // 120 - u32 maxInputs; // 124 - u32 maxMatrices; // 128 - u32 maxPorts; // 132 - - u32 stateFlags; // 136 - float lastProcessRatio; // 140 - u64 lastProcessTick; // 144 - u64 renderCount; // 152 - u32 activeVoiceCount; // 160 - u32 activeChannelWorkCount; // 164 -}; - -struct StackBuffer { - void** top; - void* base; - size_t size; - size_t currentOffset; - size_t usedSize; - size_t totalSize; - size_t alignment; - u8 flags; - char padding[7]; -}; - -struct SystemInternal { - // setup init - char name[ORBIS_NGS2_SYSTEM_NAME_LENGTH]; // 0 - OrbisNgs2ContextBufferInfo bufferInfo; // 16 - OrbisNgs2BufferFreeHandler hostFree; // 80 - OrbisNgs2Handle systemHandle; // 88 - void* unknown1; // 96 - void* unknown2; // 104 - OrbisNgs2Handle rackHandle; // 112 - uintptr_t* userData; // 120 - SystemInternal* systemList; // 128 - StackBuffer* stackBuffer; // 136 - OrbisNgs2SystemInfo ownerSystemInfo; // 144 - - struct rackList { - void* prev; - void* next; - void* unknown; - }; - - rackList rackListPreset; // 152 - rackList rackListNormal; // 176 - rackList rackListMaster; // 200 - - void* unknown3; // 208 - void* systemListPrev; // 216 - void* unknown4; // 224 - void* systemListNext; // 232 - void* rackFunction; // 240 - - Kernel::PthreadMutex processLock; // 248 - u32 hasProcessMutex; // 256 - u32 unknown5; // 260 - Kernel::PthreadMutex flushLock; // 264 - u32 hasFlushMutex; // 272 - u32 unknown6; // 276 - - // info - u64 lastRenderTick; // 280 - u64 renderCount; // 288 - u32 isActive; // 296 - std::atomic lockCount; // 300 - u32 uid; // 304 - u32 systemType; // 308 - - struct { - u8 isBufferValid : 1; - u8 isRendering : 1; - u8 isSorted : 1; - u8 isFlushReady : 1; - } flags; // 312 - - u16 currentMaxGrainSamples; // 316 - u16 minGrainSamples; // 318 - u16 maxGrainSamples; // 320 - u16 numGrainSamples; // 322 - u32 currentNumGrainSamples; // 324 - u32 sampleRate; // 328 - u32 currentSampleRate; // 332 - u32 rackCount; // 336 - float lastRenderRatio; // 340 - float cpuLoad; // 344 -}; - -struct HandleInternal { - HandleInternal* selfPtr; // 0 - SystemInternal* systemData; // 8 - std::atomic refCount; // 16 - u32 handleType; // 24 - u32 handleID; // 28 -}; - -s32 StackBufferClose(StackBuffer* stackBuffer, size_t* outTotalSize); -s32 StackBufferOpen(StackBuffer* stackBuffer, void* buffer, size_t bufferSize, void** outBuffer, - u8 flags); -s32 SystemSetupCore(StackBuffer* stackBuffer, const OrbisNgs2SystemOption* option, - SystemInternal* outSystem); - -s32 HandleReportInvalid(OrbisNgs2Handle handle, u32 handleType); -void* MemoryClear(void* buffer, size_t size); -s32 SystemCleanup(OrbisNgs2Handle systemHandle, OrbisNgs2ContextBufferInfo* outInfo); -s32 SystemSetup(const OrbisNgs2SystemOption* option, OrbisNgs2ContextBufferInfo* hostBufferInfo, - OrbisNgs2BufferFreeHandler hostFree, OrbisNgs2Handle* outHandle); - -} // namespace Libraries::Ngs2 diff --git a/src/core/libraries/ngs2/ngs2_mastering.cpp b/src/core/libraries/ngs2/ngs2_mastering.cpp deleted file mode 100644 index 8c82e4e49..000000000 --- a/src/core/libraries/ngs2/ngs2_mastering.cpp +++ /dev/null @@ -1,12 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "ngs2_error.h" -#include "ngs2_impl.h" - -#include "common/logging/log.h" -#include "core/libraries/error_codes.h" - -using namespace Libraries::Kernel; - -namespace Libraries::Ngs2 {} // namespace Libraries::Ngs2 diff --git a/src/core/libraries/ngs2/ngs2_mastering.h b/src/core/libraries/ngs2/ngs2_mastering.h deleted file mode 100644 index e0ba478c3..000000000 --- a/src/core/libraries/ngs2/ngs2_mastering.h +++ /dev/null @@ -1,81 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "ngs2.h" - -namespace Libraries::Ngs2 { - -class Ngs2Mastering; - -struct OrbisNgs2MasteringRackOption { - OrbisNgs2RackOption rackOption; - u32 maxChannels; - u32 numPeakMeterBlocks; -}; - -struct OrbisNgs2MasteringVoiceSetupParam { - OrbisNgs2VoiceParamHeader header; - - u32 numInputChannels; - u32 flags; -}; - -struct OrbisNgs2MasteringVoiceMatrixParam { - OrbisNgs2VoiceParamHeader header; - - u32 type; - u32 numLevels; - const float* aLevel; -}; - -struct OrbisNgs2MasteringVoiceLfeParam { - OrbisNgs2VoiceParamHeader header; - - u32 enableFlag; - u32 fc; -}; - -struct OrbisNgs2MasteringVoiceLimiterParam { - OrbisNgs2VoiceParamHeader header; - - u32 enableFlag; - float threshold; -}; - -struct OrbisNgs2MasteringVoiceGainParam { - OrbisNgs2VoiceParamHeader header; - - float fbwLevel; - float lfeLevel; -}; - -struct OrbisNgs2MasteringVoiceOutputParam { - OrbisNgs2VoiceParamHeader header; - - u32 outputId; - u32 reserved; -}; - -struct OrbisNgs2MasteringVoicePeakMeterParam { - OrbisNgs2VoiceParamHeader header; - u32 enableFlag; - u32 reserved; -}; - -struct OrbisNgs2MasteringVoiceState { - OrbisNgs2VoiceState voiceState; - float limiterPeakLevel; - float limiterPressLevel; - float aInputPeakHeight[ORBIS_NGS2_MAX_VOICE_CHANNELS]; - float aOutputPeakHeight[ORBIS_NGS2_MAX_VOICE_CHANNELS]; -}; - -struct OrbisNgs2MasteringRackInfo { - OrbisNgs2RackInfo rackInfo; - u32 maxChannels; - u32 reserved; -}; - -} // namespace Libraries::Ngs2 diff --git a/src/core/libraries/ngs2/ngs2_pan.cpp b/src/core/libraries/ngs2/ngs2_pan.cpp deleted file mode 100644 index 8c82e4e49..000000000 --- a/src/core/libraries/ngs2/ngs2_pan.cpp +++ /dev/null @@ -1,12 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "ngs2_error.h" -#include "ngs2_impl.h" - -#include "common/logging/log.h" -#include "core/libraries/error_codes.h" - -using namespace Libraries::Kernel; - -namespace Libraries::Ngs2 {} // namespace Libraries::Ngs2 diff --git a/src/core/libraries/ngs2/ngs2_pan.h b/src/core/libraries/ngs2/ngs2_pan.h deleted file mode 100644 index d39ec67cd..000000000 --- a/src/core/libraries/ngs2/ngs2_pan.h +++ /dev/null @@ -1,25 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "ngs2.h" - -namespace Libraries::Ngs2 { - -class Ngs2Pan; - -struct OrbisNgs2PanParam { - float angle; - float distance; - float fbwLevel; - float lfeLevel; -}; - -struct OrbisNgs2PanWork { - float aSpeakerAngle[ORBIS_NGS2_MAX_VOICE_CHANNELS]; - float unitAngle; - u32 numSpeakers; -}; - -} // namespace Libraries::Ngs2 diff --git a/src/core/libraries/ngs2/ngs2_report.cpp b/src/core/libraries/ngs2/ngs2_report.cpp deleted file mode 100644 index 8c82e4e49..000000000 --- a/src/core/libraries/ngs2/ngs2_report.cpp +++ /dev/null @@ -1,12 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "ngs2_error.h" -#include "ngs2_impl.h" - -#include "common/logging/log.h" -#include "core/libraries/error_codes.h" - -using namespace Libraries::Kernel; - -namespace Libraries::Ngs2 {} // namespace Libraries::Ngs2 diff --git a/src/core/libraries/ngs2/ngs2_report.h b/src/core/libraries/ngs2/ngs2_report.h deleted file mode 100644 index 0f46f5081..000000000 --- a/src/core/libraries/ngs2/ngs2_report.h +++ /dev/null @@ -1,79 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "ngs2.h" - -#include // va_list - -namespace Libraries::Ngs2 { - -class Ngs2Report; - -struct OrbisNgs2ReportDataHeader { - size_t size; - OrbisNgs2Handle handle; - u32 type; - s32 result; -}; - -using OrbisNgs2ReportHandler = void PS4_SYSV_ABI (*)(const OrbisNgs2ReportDataHeader* data, - uintptr_t user_data); - -struct OrbisNgs2ReportMessageData { - OrbisNgs2ReportDataHeader header; - const char* message; -}; - -struct OrbisNgs2ReportApiData { - OrbisNgs2ReportDataHeader header; - const char* functionName; - const char* format; - va_list argument; -}; - -struct OrbisNgs2ReportControlData { - OrbisNgs2ReportDataHeader header; - const OrbisNgs2VoiceParamHeader* param; -}; - -struct OrbisNgs2ReportOutputData { - OrbisNgs2ReportDataHeader header; - const OrbisNgs2RenderBufferInfo* bufferInfo; - - u32 bufferIndex; - u32 sampleRate; - u32 numGrainSamples; - u32 reserved; -}; - -struct OrbisNgs2ReportCpuLoadData { - OrbisNgs2ReportDataHeader header; - float totalRatio; - float flushRatio; - float processRatio; - float feedbackRatio; -}; - -struct OrbisNgs2ReportRenderStateData { - OrbisNgs2ReportDataHeader header; - u32 state; - u32 reserved; -}; - -struct OrbisNgs2ReportVoiceWaveformData { - OrbisNgs2ReportDataHeader header; - u32 location; - u32 waveformType; - u32 numChannels; - u32 sampleRate; - u32 numGrainSamples; - u32 reserved; - void* const* aData; -}; - -s32 PS4_SYSV_ABI sceNgs2ReportRegisterHandler(u32 reportType, OrbisNgs2ReportHandler handler, - uintptr_t userData, OrbisNgs2Handle* outHandle); - -} // namespace Libraries::Ngs2 diff --git a/src/core/libraries/ngs2/ngs2_reverb.cpp b/src/core/libraries/ngs2/ngs2_reverb.cpp deleted file mode 100644 index 8c82e4e49..000000000 --- a/src/core/libraries/ngs2/ngs2_reverb.cpp +++ /dev/null @@ -1,12 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "ngs2_error.h" -#include "ngs2_impl.h" - -#include "common/logging/log.h" -#include "core/libraries/error_codes.h" - -using namespace Libraries::Kernel; - -namespace Libraries::Ngs2 {} // namespace Libraries::Ngs2 diff --git a/src/core/libraries/ngs2/ngs2_reverb.h b/src/core/libraries/ngs2/ngs2_reverb.h deleted file mode 100644 index 715d7480a..000000000 --- a/src/core/libraries/ngs2/ngs2_reverb.h +++ /dev/null @@ -1,61 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "ngs2.h" - -namespace Libraries::Ngs2 { - -class Ngs2Reverb; - -struct OrbisNgs2ReverbRackOption { - OrbisNgs2RackOption rackOption; - u32 maxChannels; - u32 reverbSize; -}; - -struct OrbisNgs2ReverbI3DL2Param { - float wet; - float dry; - s32 room; - s32 roomHF; - u32 reflectionPattern; - float decayTime; - float decayHFRatio; - s32 reflections; - float reflectionsDelay; - s32 reverb; - float reverbDelay; - float diffusion; - float density; - float HFReference; - u32 reserve[8]; -}; - -struct OrbisNgs2ReverbVoiceSetupParam { - OrbisNgs2VoiceParamHeader header; - - u32 numInputChannels; - u32 numOutputChannels; - u32 flags; - u32 reserved; -}; - -struct OrbisNgs2ReverbVoiceI3DL2Param { - OrbisNgs2VoiceParamHeader header; - - OrbisNgs2ReverbI3DL2Param i3dl2; -}; - -struct OrbisNgs2ReverbVoiceState { - OrbisNgs2VoiceState voiceState; -}; - -struct OrbisNgs2ReverbRackInfo { - OrbisNgs2RackInfo rackInfo; - u32 maxChannels; - u32 reverbSize; -}; - -} // namespace Libraries::Ngs2 diff --git a/src/core/libraries/ngs2/ngs2_sampler.cpp b/src/core/libraries/ngs2/ngs2_sampler.cpp deleted file mode 100644 index 8c82e4e49..000000000 --- a/src/core/libraries/ngs2/ngs2_sampler.cpp +++ /dev/null @@ -1,12 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "ngs2_error.h" -#include "ngs2_impl.h" - -#include "common/logging/log.h" -#include "core/libraries/error_codes.h" - -using namespace Libraries::Kernel; - -namespace Libraries::Ngs2 {} // namespace Libraries::Ngs2 diff --git a/src/core/libraries/ngs2/ngs2_sampler.h b/src/core/libraries/ngs2/ngs2_sampler.h deleted file mode 100644 index 0842b9cb2..000000000 --- a/src/core/libraries/ngs2/ngs2_sampler.h +++ /dev/null @@ -1,162 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "ngs2.h" - -namespace Libraries::Ngs2 { - -class Ngs2Sampler; - -struct OrbisNgs2SamplerRackOption { - OrbisNgs2RackOption rackOption; - u32 maxChannelWorks; - u32 maxCodecCaches; - u32 maxWaveformBlocks; - u32 maxEnvelopePoints; - u32 maxFilters; - u32 maxAtrac9Decoders; - u32 maxAtrac9ChannelWorks; - u32 maxAjmAtrac9Decoders; - u32 numPeakMeterBlocks; -}; - -struct OrbisNgs2SamplerVoiceSetupParam { - OrbisNgs2VoiceParamHeader header; - - OrbisNgs2WaveformFormat format; - u32 flags; - u32 reserved; -}; - -struct OrbisNgs2SamplerVoiceWaveformBlocksParam { - OrbisNgs2VoiceParamHeader header; - - const void* data; - u32 flags; - u32 numBlocks; - const OrbisNgs2WaveformBlock* aBlock; - // Blocks -}; - -struct OrbisNgs2SamplerVoiceWaveformAddressParam { - OrbisNgs2VoiceParamHeader header; - - const void* from; - const void* to; -}; - -struct OrbisNgs2SamplerVoiceWaveformFrameOffsetParam { - OrbisNgs2VoiceParamHeader header; - - u32 frameOffset; - u32 reserved; -}; - -struct OrbisNgs2SamplerVoiceExitLoopParam { - OrbisNgs2VoiceParamHeader header; -}; - -struct OrbisNgs2SamplerVoicePitchParam { - OrbisNgs2VoiceParamHeader header; - - float ratio; - u32 reserved; -}; - -struct OrbisNgs2SamplerVoiceEnvelopeParam { - OrbisNgs2VoiceParamHeader header; - - u32 numForwardPoints; - u32 numReleasePoints; - const OrbisNgs2EnvelopePoint* aPoint; -}; - -struct OrbisNgs2SamplerVoiceDistortionParam { - OrbisNgs2VoiceParamHeader header; - - u32 flags; - float a; - float b; - float clip; - float gate; - float wetLevel; - float dryLevel; - u32 reserved; -}; - -struct OrbisNgs2SamplerVoiceUserFxParam { - OrbisNgs2VoiceParamHeader header; - - OrbisNgs2UserFxProcessHandler handler; - - uintptr_t userData0; - uintptr_t userData1; - uintptr_t userData2; -}; - -struct OrbisNgs2SamplerVoicePeakMeterParam { - OrbisNgs2VoiceParamHeader header; - - u32 enableFlag; - u32 reserved; -}; - -struct OrbisNgs2SamplerVoiceFilterParam { - OrbisNgs2VoiceParamHeader header; - - u32 index; - u32 location; - u32 type; - u32 channelMask; - union { - struct { - float i0; - float i1; - float i2; - float o1; - float o2; - } direct; - struct { - float fc; - float q; - float level; - u32 reserved; - u32 reserved2; - } fcq; - } param; - u32 reserved3; -}; - -struct OrbisNgs2SamplerVoiceNumFilters { - OrbisNgs2VoiceParamHeader header; - - u32 numFilters; - u32 reserved; -}; - -struct OrbisNgs2SamplerVoiceState { - OrbisNgs2VoiceState voiceState; - float envelopeHeight; - float peakHeight; - u32 reserved; - u64 numDecodedSamples; - u64 decodedDataSize; - u64 userData; - const void* waveformData; -}; - -struct OrbisNgs2SamplerRackInfo { - OrbisNgs2RackInfo rackInfo; - u32 maxChannelWorks; - u32 maxCodecCaches; - u32 maxWaveformBlocks; - u32 maxEnvelopePoints; - u32 maxFilters; - u32 maxAtrac9Decoders; - u32 maxAtrac9ChannelWorks; - u32 maxAjmAtrac9Decoders; -}; - -} // namespace Libraries::Ngs2 diff --git a/src/core/libraries/ngs2/ngs2_submixer.cpp b/src/core/libraries/ngs2/ngs2_submixer.cpp deleted file mode 100644 index 8c82e4e49..000000000 --- a/src/core/libraries/ngs2/ngs2_submixer.cpp +++ /dev/null @@ -1,12 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "ngs2_error.h" -#include "ngs2_impl.h" - -#include "common/logging/log.h" -#include "core/libraries/error_codes.h" - -using namespace Libraries::Kernel; - -namespace Libraries::Ngs2 {} // namespace Libraries::Ngs2 diff --git a/src/core/libraries/ngs2/ngs2_submixer.h b/src/core/libraries/ngs2/ngs2_submixer.h deleted file mode 100644 index df2d8a835..000000000 --- a/src/core/libraries/ngs2/ngs2_submixer.h +++ /dev/null @@ -1,126 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "ngs2.h" - -namespace Libraries::Ngs2 { - -class Ngs2Submixer; - -struct OrbisNgs2SubmixerRackOption { - OrbisNgs2RackOption rackOption; - u32 maxChannels; - u32 maxEnvelopePoints; - u32 maxFilters; - u32 maxInputs; - u32 numPeakMeterBlocks; -}; - -struct OrbisNgs2SubmixerVoiceSetupParam { - OrbisNgs2VoiceParamHeader header; - u32 numIoChannels; - u32 flags; -}; - -struct OrbisNgs2SubmixerVoiceEnvelopeParam { - OrbisNgs2VoiceParamHeader header; - - u32 numForwardPoints; - u32 numReleasePoints; - const OrbisNgs2EnvelopePoint* aPoint; -}; - -struct OrbisNgs2SubmixerVoiceCompressorParam { - OrbisNgs2VoiceParamHeader header; - - u32 flags; - float threshold; - float ratio; - float knee; - float attackTime; - float releaseTime; - float level; - u32 reserved; -}; - -struct OrbisNgs2SubmixerVoiceDistortionParam { - OrbisNgs2VoiceParamHeader header; - - u32 flags; - float a; - float b; - float clip; - float gate; - float wetLevel; - float dryLevel; - u32 reserved; -}; - -struct OrbisNgs2SubmixerVoiceUserFxParam { - OrbisNgs2VoiceParamHeader header; - - OrbisNgs2UserFxProcessHandler handler; - - uintptr_t userData0; - uintptr_t userData1; - uintptr_t userData2; -}; - -struct OrbisNgs2SubmixerVoicePeakMeterParam { - OrbisNgs2VoiceParamHeader header; - - u32 enableFlag; - u32 reserved; -}; - -struct OrbisNgs2SubmixerVoiceFilterParam { - OrbisNgs2VoiceParamHeader header; - - u32 index; - u32 location; - u32 type; - u32 channelMask; - union { - struct { - float i0; - float i1; - float i2; - float o1; - float o2; - } direct; - struct { - float fc; - float q; - float level; - u32 reserved; - u32 reserved2; - } fcq; - } param; - u32 reserved3; -}; - -struct OrbisNgs2SubmixerVoiceNumFilters { - OrbisNgs2VoiceParamHeader header; - - u32 numFilters; - u32 reserved; -}; - -struct OrbisNgs2SubmixerVoiceState { - OrbisNgs2VoiceState voiceState; - float envelopeHeight; - float peakHeight; - float compressorHeight; -}; - -struct OrbisNgs2SubmixerRackInfo { - OrbisNgs2RackInfo rackInfo; - u32 maxChannels; - u32 maxEnvelopePoints; - u32 maxFilters; - u32 maxInputs; -}; - -} // namespace Libraries::Ngs2 diff --git a/src/core/libraries/np/np_auth.cpp b/src/core/libraries/np/np_auth.cpp index a9c2181b9..1eb68e6a7 100644 --- a/src/core/libraries/np/np_auth.cpp +++ b/src/core/libraries/np/np_auth.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/libraries/np/np_auth.h b/src/core/libraries/np/np_auth.h index 0894bd85d..dc532c376 100644 --- a/src/core/libraries/np/np_auth.h +++ b/src/core/libraries/np/np_auth.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/np/np_auth_error.h b/src/core/libraries/np/np_auth_error.h index bc08bffe6..7f33da376 100644 --- a/src/core/libraries/np/np_auth_error.h +++ b/src/core/libraries/np/np_auth_error.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/np/np_commerce.cpp b/src/core/libraries/np/np_commerce.cpp index 99b03384a..cfb5f653b 100644 --- a/src/core/libraries/np/np_commerce.cpp +++ b/src/core/libraries/np/np_commerce.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/logging/log.h" diff --git a/src/core/libraries/np/np_commerce.h b/src/core/libraries/np/np_commerce.h index 003e85a58..c132ad7d5 100644 --- a/src/core/libraries/np/np_commerce.h +++ b/src/core/libraries/np/np_commerce.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/np/np_common.cpp b/src/core/libraries/np/np_common.cpp index ce0c3799a..db345a680 100644 --- a/src/core/libraries/np/np_common.cpp +++ b/src/core/libraries/np/np_common.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/logging/log.h" diff --git a/src/core/libraries/np/np_common.h b/src/core/libraries/np/np_common.h index a130f9c1d..3291b29f0 100644 --- a/src/core/libraries/np/np_common.h +++ b/src/core/libraries/np/np_common.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/np/np_common_error.h b/src/core/libraries/np/np_common_error.h index 1fcef1ece..5e4f24775 100644 --- a/src/core/libraries/np/np_common_error.h +++ b/src/core/libraries/np/np_common_error.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/np/np_error.h b/src/core/libraries/np/np_error.h index 518344ba3..fc66f3ef4 100644 --- a/src/core/libraries/np/np_error.h +++ b/src/core/libraries/np/np_error.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/np/np_manager.cpp b/src/core/libraries/np/np_manager.cpp index 0ffbb682a..53a8ab32f 100644 --- a/src/core/libraries/np/np_manager.cpp +++ b/src/core/libraries/np/np_manager.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/libraries/np/np_manager.h b/src/core/libraries/np/np_manager.h index 49250db03..8cf6b541a 100644 --- a/src/core/libraries/np/np_manager.h +++ b/src/core/libraries/np/np_manager.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/np/np_matching2.cpp b/src/core/libraries/np/np_matching2.cpp index dcd2a9c23..e7331b6b4 100644 --- a/src/core/libraries/np/np_matching2.cpp +++ b/src/core/libraries/np/np_matching2.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/libraries/np/np_matching2.h b/src/core/libraries/np/np_matching2.h index 6f7fca900..23ddb9b97 100644 --- a/src/core/libraries/np/np_matching2.h +++ b/src/core/libraries/np/np_matching2.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/np/np_partner.cpp b/src/core/libraries/np/np_partner.cpp index 447144344..b24c47b79 100644 --- a/src/core/libraries/np/np_partner.cpp +++ b/src/core/libraries/np/np_partner.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/libraries/np/np_partner.h b/src/core/libraries/np/np_partner.h index 4cb2a6f5f..702ec1c86 100644 --- a/src/core/libraries/np/np_partner.h +++ b/src/core/libraries/np/np_partner.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/np/np_partner_error.h b/src/core/libraries/np/np_partner_error.h index be1c7c594..4796258be 100644 --- a/src/core/libraries/np/np_partner_error.h +++ b/src/core/libraries/np/np_partner_error.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/np/np_party.cpp b/src/core/libraries/np/np_party.cpp index 076677607..cd68c35e9 100644 --- a/src/core/libraries/np/np_party.cpp +++ b/src/core/libraries/np/np_party.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/logging/log.h" diff --git a/src/core/libraries/np/np_party.h b/src/core/libraries/np/np_party.h index 9cf633217..459eac01e 100644 --- a/src/core/libraries/np/np_party.h +++ b/src/core/libraries/np/np_party.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/np/np_party_error.h b/src/core/libraries/np/np_party_error.h index 7f132e442..b81b4d052 100644 --- a/src/core/libraries/np/np_party_error.h +++ b/src/core/libraries/np/np_party_error.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/np/np_profile_dialog.cpp b/src/core/libraries/np/np_profile_dialog.cpp index 6ae1ed26c..aeebbba8f 100644 --- a/src/core/libraries/np/np_profile_dialog.cpp +++ b/src/core/libraries/np/np_profile_dialog.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/logging/log.h" diff --git a/src/core/libraries/np/np_profile_dialog.h b/src/core/libraries/np/np_profile_dialog.h index ca1126d57..8ca007847 100644 --- a/src/core/libraries/np/np_profile_dialog.h +++ b/src/core/libraries/np/np_profile_dialog.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/np/np_score.cpp b/src/core/libraries/np/np_score.cpp index 49bb956b2..7c407aff2 100644 --- a/src/core/libraries/np/np_score.cpp +++ b/src/core/libraries/np/np_score.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/logging/log.h" diff --git a/src/core/libraries/np/np_score.h b/src/core/libraries/np/np_score.h index 01cc25f2f..9fbe94466 100644 --- a/src/core/libraries/np/np_score.h +++ b/src/core/libraries/np/np_score.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/np/np_sns_facebook_dialog.cpp b/src/core/libraries/np/np_sns_facebook_dialog.cpp index d0e058e24..5c369bcd8 100644 --- a/src/core/libraries/np/np_sns_facebook_dialog.cpp +++ b/src/core/libraries/np/np_sns_facebook_dialog.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/logging/log.h" diff --git a/src/core/libraries/np/np_sns_facebook_dialog.h b/src/core/libraries/np/np_sns_facebook_dialog.h index 96d8ac25d..f57268a76 100644 --- a/src/core/libraries/np/np_sns_facebook_dialog.h +++ b/src/core/libraries/np/np_sns_facebook_dialog.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/np/np_trophy.cpp b/src/core/libraries/np/np_trophy.cpp index 449ee775a..34b131ea7 100644 --- a/src/core/libraries/np/np_trophy.cpp +++ b/src/core/libraries/np/np_trophy.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/libraries/np/np_trophy.h b/src/core/libraries/np/np_trophy.h index 590e58c0d..37fefb049 100644 --- a/src/core/libraries/np/np_trophy.h +++ b/src/core/libraries/np/np_trophy.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/np/np_trophy_error.h b/src/core/libraries/np/np_trophy_error.h index 173d7dd59..f42378c4a 100644 --- a/src/core/libraries/np/np_trophy_error.h +++ b/src/core/libraries/np/np_trophy_error.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/np/np_tus.cpp b/src/core/libraries/np/np_tus.cpp index d18cf4ec0..b253ccde8 100644 --- a/src/core/libraries/np/np_tus.cpp +++ b/src/core/libraries/np/np_tus.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/libraries/np/np_tus.h b/src/core/libraries/np/np_tus.h index ef4554ec3..ed90e36c5 100644 --- a/src/core/libraries/np/np_tus.h +++ b/src/core/libraries/np/np_tus.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/np/np_types.h b/src/core/libraries/np/np_types.h index 58c119bec..447641033 100644 --- a/src/core/libraries/np/np_types.h +++ b/src/core/libraries/np/np_types.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/np/np_web_api.cpp b/src/core/libraries/np/np_web_api.cpp index 0c633e0d1..020ee23bf 100644 --- a/src/core/libraries/np/np_web_api.cpp +++ b/src/core/libraries/np/np_web_api.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/elf_info.h" diff --git a/src/core/libraries/np/np_web_api.h b/src/core/libraries/np/np_web_api.h index 8dd9441e0..2a21e7181 100644 --- a/src/core/libraries/np/np_web_api.h +++ b/src/core/libraries/np/np_web_api.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/np/np_web_api2.cpp b/src/core/libraries/np/np_web_api2.cpp index a7c7ee3f3..4e381b638 100644 --- a/src/core/libraries/np/np_web_api2.cpp +++ b/src/core/libraries/np/np_web_api2.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/logging/log.h" diff --git a/src/core/libraries/np/np_web_api2.h b/src/core/libraries/np/np_web_api2.h index 1e970d08e..9942eb392 100644 --- a/src/core/libraries/np/np_web_api2.h +++ b/src/core/libraries/np/np_web_api2.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/np/np_web_api2_error.h b/src/core/libraries/np/np_web_api2_error.h index 6ab4fdb31..79287ddbd 100644 --- a/src/core/libraries/np/np_web_api2_error.h +++ b/src/core/libraries/np/np_web_api2_error.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/np/np_web_api_error.h b/src/core/libraries/np/np_web_api_error.h index c7f08224f..8d3cfbf47 100644 --- a/src/core/libraries/np/np_web_api_error.h +++ b/src/core/libraries/np/np_web_api_error.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/np/np_web_api_internal.cpp b/src/core/libraries/np/np_web_api_internal.cpp index 66a09b493..cbe321a3e 100644 --- a/src/core/libraries/np/np_web_api_internal.cpp +++ b/src/core/libraries/np/np_web_api_internal.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/elf_info.h" diff --git a/src/core/libraries/np/np_web_api_internal.h b/src/core/libraries/np/np_web_api_internal.h index 571df0ab9..20f07e4ec 100644 --- a/src/core/libraries/np/np_web_api_internal.h +++ b/src/core/libraries/np/np_web_api_internal.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/np/object_manager.h b/src/core/libraries/np/object_manager.h index 5f6ed9663..d0e89bdc9 100644 --- a/src/core/libraries/np/object_manager.h +++ b/src/core/libraries/np/object_manager.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/libraries/np/trophy_ui.cpp b/src/core/libraries/np/trophy_ui.cpp index a4fd21a33..1a6fc4ffa 100644 --- a/src/core/libraries/np/trophy_ui.cpp +++ b/src/core/libraries/np/trophy_ui.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/libraries/np/trophy_ui.h b/src/core/libraries/np/trophy_ui.h index 2734471b3..a58cf3827 100644 --- a/src/core/libraries/np/trophy_ui.h +++ b/src/core/libraries/np/trophy_ui.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/pad/pad.cpp b/src/core/libraries/pad/pad.cpp index f38621191..c3e23e5d8 100644 --- a/src/core/libraries/pad/pad.cpp +++ b/src/core/libraries/pad/pad.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/logging/log.h" diff --git a/src/core/libraries/pad/pad.h b/src/core/libraries/pad/pad.h index 2f4cbcc6a..c3ce6b176 100644 --- a/src/core/libraries/pad/pad.h +++ b/src/core/libraries/pad/pad.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/pad/pad_errors.h b/src/core/libraries/pad/pad_errors.h index bb2a2e9ac..f2c643006 100644 --- a/src/core/libraries/pad/pad_errors.h +++ b/src/core/libraries/pad/pad_errors.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/playgo/playgo.cpp b/src/core/libraries/playgo/playgo.cpp index 24f8d6761..9a5f22f69 100644 --- a/src/core/libraries/playgo/playgo.cpp +++ b/src/core/libraries/playgo/playgo.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/logging/log.h" diff --git a/src/core/libraries/playgo/playgo.h b/src/core/libraries/playgo/playgo.h index 68a5f1e84..b39c8ef2f 100644 --- a/src/core/libraries/playgo/playgo.h +++ b/src/core/libraries/playgo/playgo.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/playgo/playgo_dialog.cpp b/src/core/libraries/playgo/playgo_dialog.cpp index de77d5b56..cc1d05509 100644 --- a/src/core/libraries/playgo/playgo_dialog.cpp +++ b/src/core/libraries/playgo/playgo_dialog.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/assert.h" diff --git a/src/core/libraries/playgo/playgo_dialog.h b/src/core/libraries/playgo/playgo_dialog.h index d9b991f48..ccd2ec23e 100644 --- a/src/core/libraries/playgo/playgo_dialog.h +++ b/src/core/libraries/playgo/playgo_dialog.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/playgo/playgo_types.h b/src/core/libraries/playgo/playgo_types.h index 885eee035..94963c4a1 100644 --- a/src/core/libraries/playgo/playgo_types.h +++ b/src/core/libraries/playgo/playgo_types.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/random/random.cpp b/src/core/libraries/random/random.cpp deleted file mode 100644 index 8549a9b05..000000000 --- a/src/core/libraries/random/random.cpp +++ /dev/null @@ -1,29 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "random.h" -#include "random_error.h" - -#include "common/logging/log.h" -#include "core/libraries/error_codes.h" -#include "core/libraries/libs.h" - -namespace Libraries::Random { - -s32 PS4_SYSV_ABI sceRandomGetRandomNumber(u8* buf, std::size_t size) { - LOG_TRACE(Lib_Random, "called"); - if (size > SCE_RANDOM_MAX_SIZE) { - return SCE_RANDOM_ERROR_INVALID; - } - - for (auto i = 0; i < size; ++i) { - buf[i] = std::rand() & 0xFF; - } - return ORBIS_OK; -} - -void RegisterLib(Core::Loader::SymbolsResolver* sym) { - LIB_FUNCTION("PI7jIZj4pcE", "libSceRandom", 1, "libSceRandom", sceRandomGetRandomNumber); -}; - -} // namespace Libraries::Random diff --git a/src/core/libraries/random/random.h b/src/core/libraries/random/random.h deleted file mode 100644 index 9f86a900f..000000000 --- a/src/core/libraries/random/random.h +++ /dev/null @@ -1,20 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "common/types.h" - -namespace Core::Loader { -class SymbolsResolver; -} - -namespace Libraries::Random { - -constexpr s32 SCE_RANDOM_MAX_SIZE = 64; - -s32 PS4_SYSV_ABI sceRandomGetRandomNumber(u8* buf, std::size_t size); - -void RegisterLib(Core::Loader::SymbolsResolver* sym); - -} // namespace Libraries::Random diff --git a/src/core/libraries/random/random_error.h b/src/core/libraries/random/random_error.h deleted file mode 100644 index 772316ae5..000000000 --- a/src/core/libraries/random/random_error.h +++ /dev/null @@ -1,8 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -constexpr int SCE_RANDOM_ERROR_INVALID = 0x817C0016; -constexpr int SCE_RANDOM_ERROR_OUT_OF_RESOURCES = 0x817C001C; -constexpr int SCE_RANDOM_ERROR_FATAL = 0x817C00FF; \ No newline at end of file diff --git a/src/core/libraries/razor_cpu/razor_cpu.cpp b/src/core/libraries/razor_cpu/razor_cpu.cpp deleted file mode 100644 index 7405473d9..000000000 --- a/src/core/libraries/razor_cpu/razor_cpu.cpp +++ /dev/null @@ -1,236 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "razor_cpu.h" - -#include "common/logging/log.h" -#include "core/libraries/error_codes.h" -#include "core/libraries/libs.h" - -namespace Libraries::RazorCpu { - -s32 PS4_SYSV_ABI sceRazorCpuBeginLogicalFileAccess() { - LOG_DEBUG(Lib_RazorCpu, "(STUBBED) called"); - return ORBIS_OK; -} - -void PS4_SYSV_ABI sceRazorCpuDisableFiberUserMarkers() { - LOG_DEBUG(Lib_RazorCpu, "(STUBBED) called"); -} - -s32 PS4_SYSV_ABI sceRazorCpuEndLogicalFileAccess() { - LOG_DEBUG(Lib_RazorCpu, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRazorCpuFiberLogNameChange() { - LOG_DEBUG(Lib_RazorCpu, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRazorCpuFiberSwitch() { - LOG_DEBUG(Lib_RazorCpu, "(STUBBED) called"); - return ORBIS_OK; -} - -bool PS4_SYSV_ABI sceRazorCpuFlushOccurred() { - LOG_DEBUG(Lib_RazorCpu, "(STUBBED) called"); - return false; -} - -s32 PS4_SYSV_ABI sceRazorCpuGetDataTagStorageSize() { - LOG_DEBUG(Lib_RazorCpu, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRazorCpuGpuMarkerSync() { - LOG_DEBUG(Lib_RazorCpu, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRazorCpuInitDataTags() { - LOG_DEBUG(Lib_RazorCpu, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRazorCpuInitializeGpuMarkerContext() { - LOG_DEBUG(Lib_RazorCpu, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRazorCpuInitializeInternal() { - LOG_DEBUG(Lib_RazorCpu, "(STUBBED) called"); - return ORBIS_OK; -} - -bool PS4_SYSV_ABI sceRazorCpuIsCapturing() { - LOG_DEBUG(Lib_RazorCpu, "(STUBBED) called"); - return false; -} - -s32 PS4_SYSV_ABI sceRazorCpuJobManagerDispatch() { - LOG_DEBUG(Lib_RazorCpu, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRazorCpuJobManagerJob() { - LOG_DEBUG(Lib_RazorCpu, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRazorCpuJobManagerSequence() { - LOG_DEBUG(Lib_RazorCpu, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRazorCpuNamedSync() { - LOG_DEBUG(Lib_RazorCpu, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRazorCpuPlotValue() { - LOG_DEBUG(Lib_RazorCpu, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRazorCpuPopMarker() { - LOG_DEBUG(Lib_RazorCpu, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRazorCpuPushMarker() { - LOG_DEBUG(Lib_RazorCpu, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRazorCpuPushMarkerStatic() { - LOG_DEBUG(Lib_RazorCpu, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRazorCpuResizeTaggedBuffer() { - LOG_DEBUG(Lib_RazorCpu, "(STUBBED) called"); - return ORBIS_OK; -} - -void PS4_SYSV_ABI sceRazorCpuSetPopMarkerCallback() { - LOG_DEBUG(Lib_RazorCpu, "(STUBBED) called"); -} - -void PS4_SYSV_ABI sceRazorCpuSetPushMarkerCallback() { - LOG_DEBUG(Lib_RazorCpu, "(STUBBED) called"); -} - -void PS4_SYSV_ABI sceRazorCpuSetPushMarkerStaticCallback() { - LOG_DEBUG(Lib_RazorCpu, "(STUBBED) called"); -} - -s32 PS4_SYSV_ABI sceRazorCpuShutdownDataTags() { - LOG_DEBUG(Lib_RazorCpu, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRazorCpuStartCaptureInternal() { - LOG_DEBUG(Lib_RazorCpu, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRazorCpuStopCaptureInternal() { - LOG_DEBUG(Lib_RazorCpu, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRazorCpuSync() { - LOG_DEBUG(Lib_RazorCpu, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRazorCpuTagArray() { - LOG_DEBUG(Lib_RazorCpu, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRazorCpuTagBuffer() { - LOG_DEBUG(Lib_RazorCpu, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRazorCpuUnTagBuffer() { - LOG_DEBUG(Lib_RazorCpu, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRazorCpuWorkloadRunBegin() { - LOG_DEBUG(Lib_RazorCpu, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRazorCpuWorkloadRunEnd() { - LOG_DEBUG(Lib_RazorCpu, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRazorCpuWorkloadSubmit() { - LOG_DEBUG(Lib_RazorCpu, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRazorCpuWriteBookmark() { - LOG_DEBUG(Lib_RazorCpu, "(STUBBED) called"); - return ORBIS_OK; -} - -void RegisterLib(Core::Loader::SymbolsResolver* sym) { - LIB_FUNCTION("JFzLJBlYIJE", "libSceRazorCpu", 1, "libSceRazorCpu", - sceRazorCpuBeginLogicalFileAccess); - LIB_FUNCTION("SfRTRZ1Sh+U", "libSceRazorCpu", 1, "libSceRazorCpu", - sceRazorCpuDisableFiberUserMarkers); - LIB_FUNCTION("gVioM9cbiDs", "libSceRazorCpu", 1, "libSceRazorCpu", - sceRazorCpuEndLogicalFileAccess); - LIB_FUNCTION("G90IIOtgFQ0", "libSceRazorCpu", 1, "libSceRazorCpu", - sceRazorCpuFiberLogNameChange); - LIB_FUNCTION("PAytDtFGpqY", "libSceRazorCpu", 1, "libSceRazorCpu", sceRazorCpuFiberSwitch); - LIB_FUNCTION("sPhrQD31ClM", "libSceRazorCpu", 1, "libSceRazorCpu", sceRazorCpuFlushOccurred); - LIB_FUNCTION("B782NptkGUc", "libSceRazorCpu", 1, "libSceRazorCpu", - sceRazorCpuGetDataTagStorageSize); - LIB_FUNCTION("EH9Au2RlSrE", "libSceRazorCpu", 1, "libSceRazorCpu", sceRazorCpuGpuMarkerSync); - LIB_FUNCTION("A7oRMdaOJP8", "libSceRazorCpu", 1, "libSceRazorCpu", sceRazorCpuInitDataTags); - LIB_FUNCTION("NFwh-J-BrI0", "libSceRazorCpu", 1, "libSceRazorCpu", - sceRazorCpuInitializeGpuMarkerContext); - LIB_FUNCTION("ElNyedXaa4o", "libSceRazorCpu", 1, "libSceRazorCpu", - sceRazorCpuInitializeInternal); - LIB_FUNCTION("EboejOQvLL4", "libSceRazorCpu", 1, "libSceRazorCpu", sceRazorCpuIsCapturing); - LIB_FUNCTION("dnEdyY4+klQ", "libSceRazorCpu", 1, "libSceRazorCpu", - sceRazorCpuJobManagerDispatch); - LIB_FUNCTION("KP+TBWGHlgs", "libSceRazorCpu", 1, "libSceRazorCpu", sceRazorCpuJobManagerJob); - LIB_FUNCTION("9FowWFMEIM8", "libSceRazorCpu", 1, "libSceRazorCpu", - sceRazorCpuJobManagerSequence); - LIB_FUNCTION("XCuZoBSVFG8", "libSceRazorCpu", 1, "libSceRazorCpu", sceRazorCpuNamedSync); - LIB_FUNCTION("njGikRrxkC0", "libSceRazorCpu", 1, "libSceRazorCpu", sceRazorCpuPlotValue); - LIB_FUNCTION("YpkGsMXP3ew", "libSceRazorCpu", 1, "libSceRazorCpu", sceRazorCpuPopMarker); - LIB_FUNCTION("zw+celG7zSI", "libSceRazorCpu", 1, "libSceRazorCpu", sceRazorCpuPushMarker); - LIB_FUNCTION("uZrOwuNJX-M", "libSceRazorCpu", 1, "libSceRazorCpu", sceRazorCpuPushMarkerStatic); - LIB_FUNCTION("D0yUjM33QqU", "libSceRazorCpu", 1, "libSceRazorCpu", - sceRazorCpuResizeTaggedBuffer); - LIB_FUNCTION("jqYWaTfgZs0", "libSceRazorCpu", 1, "libSceRazorCpu", - sceRazorCpuSetPopMarkerCallback); - LIB_FUNCTION("DJsHcEb94n0", "libSceRazorCpu", 1, "libSceRazorCpu", - sceRazorCpuSetPushMarkerCallback); - LIB_FUNCTION("EZtqozPTS4M", "libSceRazorCpu", 1, "libSceRazorCpu", - sceRazorCpuSetPushMarkerStaticCallback); - LIB_FUNCTION("emklx7RK-LY", "libSceRazorCpu", 1, "libSceRazorCpu", sceRazorCpuShutdownDataTags); - LIB_FUNCTION("TIytAjYeaik", "libSceRazorCpu", 1, "libSceRazorCpu", - sceRazorCpuStartCaptureInternal); - LIB_FUNCTION("jWpkVWdMrsM", "libSceRazorCpu", 1, "libSceRazorCpu", - sceRazorCpuStopCaptureInternal); - LIB_FUNCTION("Ax7NjOzctIM", "libSceRazorCpu", 1, "libSceRazorCpu", sceRazorCpuSync); - LIB_FUNCTION("we3oTKSPSTw", "libSceRazorCpu", 1, "libSceRazorCpu", sceRazorCpuTagArray); - LIB_FUNCTION("vyjdThnQfQQ", "libSceRazorCpu", 1, "libSceRazorCpu", sceRazorCpuTagBuffer); - LIB_FUNCTION("0yNHPIkVTmw", "libSceRazorCpu", 1, "libSceRazorCpu", sceRazorCpuUnTagBuffer); - LIB_FUNCTION("Crha9LvwvJM", "libSceRazorCpu", 1, "libSceRazorCpu", sceRazorCpuWorkloadRunBegin); - LIB_FUNCTION("q1GxBfGHO0s", "libSceRazorCpu", 1, "libSceRazorCpu", sceRazorCpuWorkloadRunEnd); - LIB_FUNCTION("6rUvx-6QmYc", "libSceRazorCpu", 1, "libSceRazorCpu", sceRazorCpuWorkloadSubmit); - LIB_FUNCTION("G3brhegfyNg", "libSceRazorCpu", 1, "libSceRazorCpu", sceRazorCpuWriteBookmark); -} - -} // namespace Libraries::RazorCpu \ No newline at end of file diff --git a/src/core/libraries/razor_cpu/razor_cpu.h b/src/core/libraries/razor_cpu/razor_cpu.h deleted file mode 100644 index c8ed3c942..000000000 --- a/src/core/libraries/razor_cpu/razor_cpu.h +++ /dev/null @@ -1,17 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "common/types.h" - -#include -#include - -namespace Core::Loader { -class SymbolsResolver; -} - -namespace Libraries::RazorCpu { -void RegisterLib(Core::Loader::SymbolsResolver* sym); -} // namespace Libraries::RazorCpu \ No newline at end of file diff --git a/src/core/libraries/remote_play/remoteplay.cpp b/src/core/libraries/remote_play/remoteplay.cpp deleted file mode 100644 index 775450d26..000000000 --- a/src/core/libraries/remote_play/remoteplay.cpp +++ /dev/null @@ -1,295 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "remoteplay.h" - -#include "common/logging/log.h" -#include "core/libraries/error_codes.h" -#include "core/libraries/libs.h" - -namespace Libraries::Remoteplay { - -int PS4_SYSV_ABI sceRemoteplayApprove() { - LOG_ERROR(Lib_Remoteplay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceRemoteplayChangeEnterKey() { - LOG_ERROR(Lib_Remoteplay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceRemoteplayClearAllRegistData() { - LOG_ERROR(Lib_Remoteplay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceRemoteplayClearConnectHistory() { - LOG_ERROR(Lib_Remoteplay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceRemoteplayConfirmDeviceRegist() { - LOG_ERROR(Lib_Remoteplay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceRemoteplayDisconnect() { - LOG_ERROR(Lib_Remoteplay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceRemoteplayGeneratePinCode() { - LOG_ERROR(Lib_Remoteplay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceRemoteplayGetApMode() { - LOG_ERROR(Lib_Remoteplay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceRemoteplayGetConnectHistory() { - LOG_ERROR(Lib_Remoteplay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceRemoteplayGetConnectionStatus( - Libraries::UserService::OrbisUserServiceUserId userId, int* pStatus) { - *pStatus = ORBIS_REMOTEPLAY_CONNECTION_STATUS_DISCONNECT; - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceRemoteplayGetConnectUserId() { - LOG_ERROR(Lib_Remoteplay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceRemoteplayGetMbusDeviceInfo() { - LOG_ERROR(Lib_Remoteplay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceRemoteplayGetOperationStatus() { - LOG_ERROR(Lib_Remoteplay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceRemoteplayGetRemoteplayStatus() { - LOG_ERROR(Lib_Remoteplay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceRemoteplayGetRpMode() { - LOG_ERROR(Lib_Remoteplay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceRemoteplayImeClose() { - LOG_ERROR(Lib_Remoteplay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceRemoteplayImeFilterResult() { - LOG_ERROR(Lib_Remoteplay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceRemoteplayImeGetEvent() { - LOG_ERROR(Lib_Remoteplay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceRemoteplayImeNotify() { - LOG_ERROR(Lib_Remoteplay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceRemoteplayImeNotifyEventResult() { - LOG_ERROR(Lib_Remoteplay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceRemoteplayImeOpen() { - LOG_ERROR(Lib_Remoteplay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceRemoteplayImeSetCaret() { - LOG_ERROR(Lib_Remoteplay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceRemoteplayImeSetText() { - LOG_ERROR(Lib_Remoteplay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceRemoteplayInitialize() { - LOG_ERROR(Lib_Remoteplay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceRemoteplayIsRemoteOskReady() { - LOG_ERROR(Lib_Remoteplay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceRemoteplayIsRemotePlaying() { - LOG_ERROR(Lib_Remoteplay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceRemoteplayNotifyMbusDeviceRegistComplete() { - LOG_ERROR(Lib_Remoteplay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceRemoteplayNotifyNpPushWakeup() { - LOG_ERROR(Lib_Remoteplay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceRemoteplayNotifyPinCodeError() { - LOG_ERROR(Lib_Remoteplay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceRemoteplayNotifyUserDelete() { - LOG_ERROR(Lib_Remoteplay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceRemoteplayPrintAllRegistData() { - LOG_ERROR(Lib_Remoteplay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceRemoteplayProhibit() { - LOG_ERROR(Lib_Remoteplay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceRemoteplayProhibitStreaming() { - LOG_ERROR(Lib_Remoteplay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceRemoteplayServerLock() { - LOG_ERROR(Lib_Remoteplay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceRemoteplayServerUnLock() { - LOG_ERROR(Lib_Remoteplay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceRemoteplaySetApMode() { - LOG_ERROR(Lib_Remoteplay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceRemoteplaySetLogLevel() { - LOG_ERROR(Lib_Remoteplay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceRemoteplaySetProhibition() { - LOG_ERROR(Lib_Remoteplay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceRemoteplaySetProhibitionForVsh() { - LOG_ERROR(Lib_Remoteplay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceRemoteplaySetRpMode() { - LOG_ERROR(Lib_Remoteplay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceRemoteplayTerminate() { - LOG_ERROR(Lib_Remoteplay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI Func_1D5EE365ED5FADB3() { - LOG_ERROR(Lib_Remoteplay, "(STUBBED) called"); - return ORBIS_OK; -} - -void RegisterLib(Core::Loader::SymbolsResolver* sym) { - LIB_FUNCTION("xQeIryTX7dY", "libSceRemoteplay", 1, "libSceRemoteplay", sceRemoteplayApprove); - LIB_FUNCTION("IYZ+Mu+8tPo", "libSceRemoteplay", 1, "libSceRemoteplay", - sceRemoteplayChangeEnterKey); - LIB_FUNCTION("ZYUsJtcAnqA", "libSceRemoteplay", 1, "libSceRemoteplay", - sceRemoteplayClearAllRegistData); - LIB_FUNCTION("cCheyCbF7qw", "libSceRemoteplay", 1, "libSceRemoteplay", - sceRemoteplayClearConnectHistory); - LIB_FUNCTION("tPYT-kGbZh8", "libSceRemoteplay", 1, "libSceRemoteplay", - sceRemoteplayConfirmDeviceRegist); - LIB_FUNCTION("6Lg4BNleJWc", "libSceRemoteplay", 1, "libSceRemoteplay", sceRemoteplayDisconnect); - LIB_FUNCTION("j98LdSGy4eY", "libSceRemoteplay", 1, "libSceRemoteplay", - sceRemoteplayGeneratePinCode); - LIB_FUNCTION("L+cL-M-DP3w", "libSceRemoteplay", 1, "libSceRemoteplay", sceRemoteplayGetApMode); - LIB_FUNCTION("g4K51cY+PEw", "libSceRemoteplay", 1, "libSceRemoteplay", - sceRemoteplayGetConnectHistory); - LIB_FUNCTION("g3PNjYKWqnQ", "libSceRemoteplay", 1, "libSceRemoteplay", - sceRemoteplayGetConnectionStatus); - LIB_FUNCTION("3eBNV9A0BUM", "libSceRemoteplay", 1, "libSceRemoteplay", - sceRemoteplayGetConnectUserId); - LIB_FUNCTION("ufesWMVX6iU", "libSceRemoteplay", 1, "libSceRemoteplay", - sceRemoteplayGetMbusDeviceInfo); - LIB_FUNCTION("DxU4JGh4S2k", "libSceRemoteplay", 1, "libSceRemoteplay", - sceRemoteplayGetOperationStatus); - LIB_FUNCTION("n5OxFJEvPlc", "libSceRemoteplay", 1, "libSceRemoteplay", - sceRemoteplayGetRemoteplayStatus); - LIB_FUNCTION("Cekhs6LSHC0", "libSceRemoteplay", 1, "libSceRemoteplay", sceRemoteplayGetRpMode); - LIB_FUNCTION("ig1ocbR7Ptw", "libSceRemoteplay", 1, "libSceRemoteplay", sceRemoteplayImeClose); - LIB_FUNCTION("gV9-8cJPM3I", "libSceRemoteplay", 1, "libSceRemoteplay", - sceRemoteplayImeFilterResult); - LIB_FUNCTION("cMk57DZXe6c", "libSceRemoteplay", 1, "libSceRemoteplay", - sceRemoteplayImeGetEvent); - LIB_FUNCTION("-gwkQpOCl68", "libSceRemoteplay", 1, "libSceRemoteplay", sceRemoteplayImeNotify); - LIB_FUNCTION("58v9tSlRxc8", "libSceRemoteplay", 1, "libSceRemoteplay", - sceRemoteplayImeNotifyEventResult); - LIB_FUNCTION("C3r2zT5ebMg", "libSceRemoteplay", 1, "libSceRemoteplay", sceRemoteplayImeOpen); - LIB_FUNCTION("oB730zwoz0s", "libSceRemoteplay", 1, "libSceRemoteplay", - sceRemoteplayImeSetCaret); - LIB_FUNCTION("rOTg1Nljp8w", "libSceRemoteplay", 1, "libSceRemoteplay", sceRemoteplayImeSetText); - LIB_FUNCTION("k1SwgkMSOM8", "libSceRemoteplay", 1, "libSceRemoteplay", sceRemoteplayInitialize); - LIB_FUNCTION("R8RZC1ZIkzU", "libSceRemoteplay", 1, "libSceRemoteplay", - sceRemoteplayIsRemoteOskReady); - LIB_FUNCTION("uYhiELUtLgA", "libSceRemoteplay", 1, "libSceRemoteplay", - sceRemoteplayIsRemotePlaying); - LIB_FUNCTION("d-BBSEq1nfc", "libSceRemoteplay", 1, "libSceRemoteplay", - sceRemoteplayNotifyMbusDeviceRegistComplete); - LIB_FUNCTION("Yytq7NE38R8", "libSceRemoteplay", 1, "libSceRemoteplay", - sceRemoteplayNotifyNpPushWakeup); - LIB_FUNCTION("Wg-w8xjMZA4", "libSceRemoteplay", 1, "libSceRemoteplay", - sceRemoteplayNotifyPinCodeError); - LIB_FUNCTION("yheulqylKwI", "libSceRemoteplay", 1, "libSceRemoteplay", - sceRemoteplayNotifyUserDelete); - LIB_FUNCTION("t5ZvUiZ1hpE", "libSceRemoteplay", 1, "libSceRemoteplay", - sceRemoteplayPrintAllRegistData); - LIB_FUNCTION("mrNh78tBpmg", "libSceRemoteplay", 1, "libSceRemoteplay", sceRemoteplayProhibit); - LIB_FUNCTION("7QLrixwVHcU", "libSceRemoteplay", 1, "libSceRemoteplay", - sceRemoteplayProhibitStreaming); - LIB_FUNCTION("-ThIlThsN80", "libSceRemoteplay", 1, "libSceRemoteplay", sceRemoteplayServerLock); - LIB_FUNCTION("0Z-Pm5rZJOI", "libSceRemoteplay", 1, "libSceRemoteplay", - sceRemoteplayServerUnLock); - LIB_FUNCTION("xSrhtSLIjOc", "libSceRemoteplay", 1, "libSceRemoteplay", sceRemoteplaySetApMode); - LIB_FUNCTION("5-2agAeaE+c", "libSceRemoteplay", 1, "libSceRemoteplay", - sceRemoteplaySetLogLevel); - LIB_FUNCTION("Rf0XMVR7xPw", "libSceRemoteplay", 1, "libSceRemoteplay", - sceRemoteplaySetProhibition); - LIB_FUNCTION("n4l3FTZtNQM", "libSceRemoteplay", 1, "libSceRemoteplay", - sceRemoteplaySetProhibitionForVsh); - LIB_FUNCTION("-BPcEQ1w8xc", "libSceRemoteplay", 1, "libSceRemoteplay", sceRemoteplaySetRpMode); - LIB_FUNCTION("BOwybKVa3Do", "libSceRemoteplay", 1, "libSceRemoteplay", sceRemoteplayTerminate); - LIB_FUNCTION("HV7jZe1frbM", "libSceRemoteplay", 1, "libSceRemoteplay", Func_1D5EE365ED5FADB3); -}; - -} // namespace Libraries::Remoteplay \ No newline at end of file diff --git a/src/core/libraries/remote_play/remoteplay.h b/src/core/libraries/remote_play/remoteplay.h deleted file mode 100644 index b4614dca0..000000000 --- a/src/core/libraries/remote_play/remoteplay.h +++ /dev/null @@ -1,64 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include -#include "common/types.h" - -namespace Core::Loader { -class SymbolsResolver; -} - -// returning codes in sceRemoteplayGetConnectionStatus pstatus -constexpr int ORBIS_REMOTEPLAY_CONNECTION_STATUS_DISCONNECT = 0; -constexpr int ORBIS_REMOTEPLAY_CONNECTION_STATUS_CONNECT = 1; - -namespace Libraries::Remoteplay { - -int PS4_SYSV_ABI sceRemoteplayApprove(); -int PS4_SYSV_ABI sceRemoteplayChangeEnterKey(); -int PS4_SYSV_ABI sceRemoteplayClearAllRegistData(); -int PS4_SYSV_ABI sceRemoteplayClearConnectHistory(); -int PS4_SYSV_ABI sceRemoteplayConfirmDeviceRegist(); -int PS4_SYSV_ABI sceRemoteplayDisconnect(); -int PS4_SYSV_ABI sceRemoteplayGeneratePinCode(); -int PS4_SYSV_ABI sceRemoteplayGetApMode(); -int PS4_SYSV_ABI sceRemoteplayGetConnectHistory(); -int PS4_SYSV_ABI sceRemoteplayGetConnectionStatus( - Libraries::UserService::OrbisUserServiceUserId userId, int* pStatus); -int PS4_SYSV_ABI sceRemoteplayGetConnectUserId(); -int PS4_SYSV_ABI sceRemoteplayGetMbusDeviceInfo(); -int PS4_SYSV_ABI sceRemoteplayGetOperationStatus(); -int PS4_SYSV_ABI sceRemoteplayGetRemoteplayStatus(); -int PS4_SYSV_ABI sceRemoteplayGetRpMode(); -int PS4_SYSV_ABI sceRemoteplayImeClose(); -int PS4_SYSV_ABI sceRemoteplayImeFilterResult(); -int PS4_SYSV_ABI sceRemoteplayImeGetEvent(); -int PS4_SYSV_ABI sceRemoteplayImeNotify(); -int PS4_SYSV_ABI sceRemoteplayImeNotifyEventResult(); -int PS4_SYSV_ABI sceRemoteplayImeOpen(); -int PS4_SYSV_ABI sceRemoteplayImeSetCaret(); -int PS4_SYSV_ABI sceRemoteplayImeSetText(); -int PS4_SYSV_ABI sceRemoteplayInitialize(); -int PS4_SYSV_ABI sceRemoteplayIsRemoteOskReady(); -int PS4_SYSV_ABI sceRemoteplayIsRemotePlaying(); -int PS4_SYSV_ABI sceRemoteplayNotifyMbusDeviceRegistComplete(); -int PS4_SYSV_ABI sceRemoteplayNotifyNpPushWakeup(); -int PS4_SYSV_ABI sceRemoteplayNotifyPinCodeError(); -int PS4_SYSV_ABI sceRemoteplayNotifyUserDelete(); -int PS4_SYSV_ABI sceRemoteplayPrintAllRegistData(); -int PS4_SYSV_ABI sceRemoteplayProhibit(); -int PS4_SYSV_ABI sceRemoteplayProhibitStreaming(); -int PS4_SYSV_ABI sceRemoteplayServerLock(); -int PS4_SYSV_ABI sceRemoteplayServerUnLock(); -int PS4_SYSV_ABI sceRemoteplaySetApMode(); -int PS4_SYSV_ABI sceRemoteplaySetLogLevel(); -int PS4_SYSV_ABI sceRemoteplaySetProhibition(); -int PS4_SYSV_ABI sceRemoteplaySetProhibitionForVsh(); -int PS4_SYSV_ABI sceRemoteplaySetRpMode(); -int PS4_SYSV_ABI sceRemoteplayTerminate(); -int PS4_SYSV_ABI Func_1D5EE365ED5FADB3(); - -void RegisterLib(Core::Loader::SymbolsResolver* sym); -} // namespace Libraries::Remoteplay \ No newline at end of file diff --git a/src/core/libraries/rtc/rtc.cpp b/src/core/libraries/rtc/rtc.cpp index ca63d2f4d..a9272bcc7 100644 --- a/src/core/libraries/rtc/rtc.cpp +++ b/src/core/libraries/rtc/rtc.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/libraries/rtc/rtc.h b/src/core/libraries/rtc/rtc.h index 8ca55a03a..f97794e08 100644 --- a/src/core/libraries/rtc/rtc.h +++ b/src/core/libraries/rtc/rtc.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/rtc/rtc_error.h b/src/core/libraries/rtc/rtc_error.h index 406c6fb56..f46aac5e6 100644 --- a/src/core/libraries/rtc/rtc_error.h +++ b/src/core/libraries/rtc/rtc_error.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/rudp/rudp.cpp b/src/core/libraries/rudp/rudp.cpp deleted file mode 100644 index 2dfb66f64..000000000 --- a/src/core/libraries/rudp/rudp.cpp +++ /dev/null @@ -1,218 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "common/logging/log.h" -#include "core/libraries/error_codes.h" -#include "core/libraries/libs.h" -#include "core/libraries/rudp/rudp.h" - -namespace Libraries::Rudp { - -s32 PS4_SYSV_ABI sceRudpAccept() { - LOG_ERROR(Lib_Rudp, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRudpActivate() { - LOG_ERROR(Lib_Rudp, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRudpBind() { - LOG_ERROR(Lib_Rudp, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRudpCreateContext() { - LOG_ERROR(Lib_Rudp, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRudpEnableInternalIOThread() { - LOG_ERROR(Lib_Rudp, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRudpEnableInternalIOThread2() { - LOG_ERROR(Lib_Rudp, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRudpEnd() { - LOG_ERROR(Lib_Rudp, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRudpFlush() { - LOG_ERROR(Lib_Rudp, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRudpGetContextStatus() { - LOG_ERROR(Lib_Rudp, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRudpGetLocalInfo() { - LOG_ERROR(Lib_Rudp, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRudpGetMaxSegmentSize() { - LOG_ERROR(Lib_Rudp, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRudpGetNumberOfPacketsToRead() { - LOG_ERROR(Lib_Rudp, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRudpGetOption() { - LOG_ERROR(Lib_Rudp, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRudpGetRemoteInfo() { - LOG_ERROR(Lib_Rudp, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRudpGetSizeReadable() { - LOG_ERROR(Lib_Rudp, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRudpGetSizeWritable() { - LOG_ERROR(Lib_Rudp, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRudpGetStatus() { - LOG_ERROR(Lib_Rudp, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRudpInit() { - LOG_ERROR(Lib_Rudp, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRudpInitiate() { - LOG_ERROR(Lib_Rudp, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRudpListen() { - LOG_ERROR(Lib_Rudp, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRudpNetFlush() { - LOG_ERROR(Lib_Rudp, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRudpNetReceived() { - LOG_ERROR(Lib_Rudp, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRudpPollCancel() { - LOG_ERROR(Lib_Rudp, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRudpPollControl() { - LOG_ERROR(Lib_Rudp, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRudpPollCreate() { - LOG_ERROR(Lib_Rudp, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRudpPollDestroy() { - LOG_ERROR(Lib_Rudp, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRudpPollWait() { - LOG_ERROR(Lib_Rudp, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRudpProcessEvents() { - LOG_ERROR(Lib_Rudp, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRudpRead() { - LOG_ERROR(Lib_Rudp, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRudpSetEventHandler() { - LOG_ERROR(Lib_Rudp, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRudpSetMaxSegmentSize() { - LOG_ERROR(Lib_Rudp, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRudpSetOption() { - LOG_ERROR(Lib_Rudp, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRudpTerminate() { - LOG_ERROR(Lib_Rudp, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceRudpWrite() { - LOG_ERROR(Lib_Rudp, "(STUBBED) called"); - return ORBIS_OK; -} - -void RegisterLib(Core::Loader::SymbolsResolver* sym) { - LIB_FUNCTION("uQiK7fjU6y8", "libSceRudp", 1, "libSceRudp", sceRudpAccept); - LIB_FUNCTION("J-6d0WTjzMc", "libSceRudp", 1, "libSceRudp", sceRudpActivate); - LIB_FUNCTION("l4SLBpKUDK4", "libSceRudp", 1, "libSceRudp", sceRudpBind); - LIB_FUNCTION("CAbbX6BuQZ0", "libSceRudp", 1, "libSceRudp", sceRudpCreateContext); - LIB_FUNCTION("6PBNpsgyaxw", "libSceRudp", 1, "libSceRudp", sceRudpEnableInternalIOThread); - LIB_FUNCTION("fJ51weR1WAI", "libSceRudp", 1, "libSceRudp", sceRudpEnableInternalIOThread2); - LIB_FUNCTION("3hBvwqEwqj8", "libSceRudp", 1, "libSceRudp", sceRudpEnd); - LIB_FUNCTION("Ms0cLK8sTtE", "libSceRudp", 1, "libSceRudp", sceRudpFlush); - LIB_FUNCTION("wIJsiqY+BMk", "libSceRudp", 1, "libSceRudp", sceRudpGetContextStatus); - LIB_FUNCTION("2G7-vVz9SIg", "libSceRudp", 1, "libSceRudp", sceRudpGetLocalInfo); - LIB_FUNCTION("vfrL8gPlm2Y", "libSceRudp", 1, "libSceRudp", sceRudpGetMaxSegmentSize); - LIB_FUNCTION("Px0miD2LuW0", "libSceRudp", 1, "libSceRudp", sceRudpGetNumberOfPacketsToRead); - LIB_FUNCTION("mCQIhSmCP6o", "libSceRudp", 1, "libSceRudp", sceRudpGetOption); - LIB_FUNCTION("Qignjmfgha0", "libSceRudp", 1, "libSceRudp", sceRudpGetRemoteInfo); - LIB_FUNCTION("sAZqO2+5Qqo", "libSceRudp", 1, "libSceRudp", sceRudpGetSizeReadable); - LIB_FUNCTION("fRc1ahQppR4", "libSceRudp", 1, "libSceRudp", sceRudpGetSizeWritable); - LIB_FUNCTION("i3STzxuwPx0", "libSceRudp", 1, "libSceRudp", sceRudpGetStatus); - LIB_FUNCTION("amuBfI-AQc4", "libSceRudp", 1, "libSceRudp", sceRudpInit); - LIB_FUNCTION("szEVu+edXV4", "libSceRudp", 1, "libSceRudp", sceRudpInitiate); - LIB_FUNCTION("tYVWcWDnctE", "libSceRudp", 1, "libSceRudp", sceRudpListen); - LIB_FUNCTION("+BJ9svDmjYs", "libSceRudp", 1, "libSceRudp", sceRudpNetFlush); - LIB_FUNCTION("vPzJldDSxXc", "libSceRudp", 1, "libSceRudp", sceRudpNetReceived); - LIB_FUNCTION("yzeXuww-UWg", "libSceRudp", 1, "libSceRudp", sceRudpPollCancel); - LIB_FUNCTION("haMpc7TFx0A", "libSceRudp", 1, "libSceRudp", sceRudpPollControl); - LIB_FUNCTION("MVbmLASjn5M", "libSceRudp", 1, "libSceRudp", sceRudpPollCreate); - LIB_FUNCTION("LjwbHpEeW0A", "libSceRudp", 1, "libSceRudp", sceRudpPollDestroy); - LIB_FUNCTION("M6ggviwXpLs", "libSceRudp", 1, "libSceRudp", sceRudpPollWait); - LIB_FUNCTION("9U9m1YH0ScQ", "libSceRudp", 1, "libSceRudp", sceRudpProcessEvents); - LIB_FUNCTION("rZqWV3eXgOA", "libSceRudp", 1, "libSceRudp", sceRudpRead); - LIB_FUNCTION("SUEVes8gvmw", "libSceRudp", 1, "libSceRudp", sceRudpSetEventHandler); - LIB_FUNCTION("beAsSTVWVPQ", "libSceRudp", 1, "libSceRudp", sceRudpSetMaxSegmentSize); - LIB_FUNCTION("0yzYdZf0IwE", "libSceRudp", 1, "libSceRudp", sceRudpSetOption); - LIB_FUNCTION("OMYRTU0uc4w", "libSceRudp", 1, "libSceRudp", sceRudpTerminate); - LIB_FUNCTION("KaPL3fbTLCA", "libSceRudp", 1, "libSceRudp", sceRudpWrite); -}; - -} // namespace Libraries::Rudp \ No newline at end of file diff --git a/src/core/libraries/rudp/rudp.h b/src/core/libraries/rudp/rudp.h deleted file mode 100644 index 22d2576a2..000000000 --- a/src/core/libraries/rudp/rudp.h +++ /dev/null @@ -1,50 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "common/types.h" - -namespace Core::Loader { -class SymbolsResolver; -} - -namespace Libraries::Rudp { - -s32 PS4_SYSV_ABI sceRudpAccept(); -s32 PS4_SYSV_ABI sceRudpActivate(); -s32 PS4_SYSV_ABI sceRudpBind(); -s32 PS4_SYSV_ABI sceRudpCreateContext(); -s32 PS4_SYSV_ABI sceRudpEnableInternalIOThread(); -s32 PS4_SYSV_ABI sceRudpEnableInternalIOThread2(); -s32 PS4_SYSV_ABI sceRudpEnd(); -s32 PS4_SYSV_ABI sceRudpFlush(); -s32 PS4_SYSV_ABI sceRudpGetContextStatus(); -s32 PS4_SYSV_ABI sceRudpGetLocalInfo(); -s32 PS4_SYSV_ABI sceRudpGetMaxSegmentSize(); -s32 PS4_SYSV_ABI sceRudpGetNumberOfPacketsToRead(); -s32 PS4_SYSV_ABI sceRudpGetOption(); -s32 PS4_SYSV_ABI sceRudpGetRemoteInfo(); -s32 PS4_SYSV_ABI sceRudpGetSizeReadable(); -s32 PS4_SYSV_ABI sceRudpGetSizeWritable(); -s32 PS4_SYSV_ABI sceRudpGetStatus(); -s32 PS4_SYSV_ABI sceRudpInit(); -s32 PS4_SYSV_ABI sceRudpInitiate(); -s32 PS4_SYSV_ABI sceRudpListen(); -s32 PS4_SYSV_ABI sceRudpNetFlush(); -s32 PS4_SYSV_ABI sceRudpNetReceived(); -s32 PS4_SYSV_ABI sceRudpPollCancel(); -s32 PS4_SYSV_ABI sceRudpPollControl(); -s32 PS4_SYSV_ABI sceRudpPollCreate(); -s32 PS4_SYSV_ABI sceRudpPollDestroy(); -s32 PS4_SYSV_ABI sceRudpPollWait(); -s32 PS4_SYSV_ABI sceRudpProcessEvents(); -s32 PS4_SYSV_ABI sceRudpRead(); -s32 PS4_SYSV_ABI sceRudpSetEventHandler(); -s32 PS4_SYSV_ABI sceRudpSetMaxSegmentSize(); -s32 PS4_SYSV_ABI sceRudpSetOption(); -s32 PS4_SYSV_ABI sceRudpTerminate(); -s32 PS4_SYSV_ABI sceRudpWrite(); - -void RegisterLib(Core::Loader::SymbolsResolver* sym); -} // namespace Libraries::Rudp \ No newline at end of file diff --git a/src/core/libraries/save_data/dialog/savedatadialog.cpp b/src/core/libraries/save_data/dialog/savedatadialog.cpp index f70800dfd..884ef9dca 100644 --- a/src/core/libraries/save_data/dialog/savedatadialog.cpp +++ b/src/core/libraries/save_data/dialog/savedatadialog.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/libraries/save_data/dialog/savedatadialog.h b/src/core/libraries/save_data/dialog/savedatadialog.h index 39450b36b..d0917cbf2 100644 --- a/src/core/libraries/save_data/dialog/savedatadialog.h +++ b/src/core/libraries/save_data/dialog/savedatadialog.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/save_data/dialog/savedatadialog_ui.cpp b/src/core/libraries/save_data/dialog/savedatadialog_ui.cpp index cb71af70d..5041ad644 100644 --- a/src/core/libraries/save_data/dialog/savedatadialog_ui.cpp +++ b/src/core/libraries/save_data/dialog/savedatadialog_ui.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/libraries/save_data/dialog/savedatadialog_ui.h b/src/core/libraries/save_data/dialog/savedatadialog_ui.h index dc97268f4..1ae3fcdc2 100644 --- a/src/core/libraries/save_data/dialog/savedatadialog_ui.h +++ b/src/core/libraries/save_data/dialog/savedatadialog_ui.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/save_data/save_backup.cpp b/src/core/libraries/save_data/save_backup.cpp index c5f66d883..bada69497 100644 --- a/src/core/libraries/save_data/save_backup.cpp +++ b/src/core/libraries/save_data/save_backup.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include @@ -79,7 +79,7 @@ static void backup(const std::filesystem::path& dir_name) { } static void BackupThreadBody() { - Common::SetCurrentThreadName("shadPS4:SaveData:BackupThread"); + Common::SetCurrentThreadName("sB:SaveData:BackupThread"); while (g_backup_status != WorkerStatus::Stopping) { g_backup_status = WorkerStatus::Waiting; diff --git a/src/core/libraries/save_data/save_backup.h b/src/core/libraries/save_data/save_backup.h index 2a5e54d49..c113220af 100644 --- a/src/core/libraries/save_data/save_backup.h +++ b/src/core/libraries/save_data/save_backup.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/save_data/save_instance.cpp b/src/core/libraries/save_data/save_instance.cpp index 463baa50b..6f18f2ff6 100644 --- a/src/core/libraries/save_data/save_instance.cpp +++ b/src/core/libraries/save_data/save_instance.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/libraries/save_data/save_instance.h b/src/core/libraries/save_data/save_instance.h index b758649b2..c7d7e6c3f 100644 --- a/src/core/libraries/save_data/save_instance.h +++ b/src/core/libraries/save_data/save_instance.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/save_data/save_memory.cpp b/src/core/libraries/save_data/save_memory.cpp index 0a16d4756..3c5f3e405 100644 --- a/src/core/libraries/save_data/save_memory.cpp +++ b/src/core/libraries/save_data/save_memory.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "save_memory.h" diff --git a/src/core/libraries/save_data/save_memory.h b/src/core/libraries/save_data/save_memory.h index b524de8bc..fb30acde2 100644 --- a/src/core/libraries/save_data/save_memory.h +++ b/src/core/libraries/save_data/save_memory.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/save_data/savedata.cpp b/src/core/libraries/save_data/savedata.cpp index 70c66e4cd..aa9b4cf90 100644 --- a/src/core/libraries/save_data/savedata.cpp +++ b/src/core/libraries/save_data/savedata.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/libraries/save_data/savedata.h b/src/core/libraries/save_data/savedata.h index 37a21dbc7..f6aad4ba4 100644 --- a/src/core/libraries/save_data/savedata.h +++ b/src/core/libraries/save_data/savedata.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/save_data/savedata_error.h b/src/core/libraries/save_data/savedata_error.h index ef347e855..eb9f4b566 100644 --- a/src/core/libraries/save_data/savedata_error.h +++ b/src/core/libraries/save_data/savedata_error.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/screenshot/screenshot.cpp b/src/core/libraries/screenshot/screenshot.cpp index 8ae14abc4..7bb24f7a2 100644 --- a/src/core/libraries/screenshot/screenshot.cpp +++ b/src/core/libraries/screenshot/screenshot.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/logging/log.h" diff --git a/src/core/libraries/screenshot/screenshot.h b/src/core/libraries/screenshot/screenshot.h index 0aee54173..ccd8751d2 100644 --- a/src/core/libraries/screenshot/screenshot.h +++ b/src/core/libraries/screenshot/screenshot.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/share_play/shareplay.cpp b/src/core/libraries/share_play/shareplay.cpp deleted file mode 100644 index f6865ba70..000000000 --- a/src/core/libraries/share_play/shareplay.cpp +++ /dev/null @@ -1,173 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "shareplay.h" - -#include "common/logging/log.h" -#include "core/libraries/error_codes.h" -#include "core/libraries/libs.h" - -namespace Libraries::SharePlay { - -int PS4_SYSV_ABI sceSharePlayCrashDaemon() { - LOG_ERROR(Lib_SharePlay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceSharePlayGetCurrentConnectionInfo(OrbisSharePlayConnectionInfo* pInfo) { - memset(pInfo, 0, sizeof(*pInfo)); - pInfo->status = ORBIS_SHARE_PLAY_CONNECTION_STATUS_DORMANT; - LOG_DEBUG(Lib_SharePlay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceSharePlayGetCurrentConnectionInfoA() { - LOG_ERROR(Lib_SharePlay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceSharePlayGetCurrentInfo() { - LOG_ERROR(Lib_SharePlay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceSharePlayGetEvent() { - LOG_ERROR(Lib_SharePlay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceSharePlayInitialize() { - LOG_ERROR(Lib_SharePlay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceSharePlayNotifyDialogOpen() { - LOG_ERROR(Lib_SharePlay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceSharePlayNotifyForceCloseForCdlg() { - LOG_ERROR(Lib_SharePlay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceSharePlayNotifyOpenQuickMenu() { - LOG_ERROR(Lib_SharePlay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceSharePlayResumeScreenForCdlg() { - LOG_ERROR(Lib_SharePlay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceSharePlayServerLock() { - LOG_ERROR(Lib_SharePlay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceSharePlayServerUnLock() { - LOG_ERROR(Lib_SharePlay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceSharePlaySetMode() { - LOG_ERROR(Lib_SharePlay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceSharePlaySetProhibition() { - LOG_ERROR(Lib_SharePlay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceSharePlaySetProhibitionModeWithAppId() { - LOG_ERROR(Lib_SharePlay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceSharePlayStartStandby() { - LOG_ERROR(Lib_SharePlay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceSharePlayStartStreaming() { - LOG_ERROR(Lib_SharePlay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceSharePlayStopStandby() { - LOG_ERROR(Lib_SharePlay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceSharePlayStopStreaming() { - LOG_ERROR(Lib_SharePlay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceSharePlayTerminate() { - LOG_ERROR(Lib_SharePlay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI Func_2E93C0EA6A6B67C4() { - LOG_ERROR(Lib_SharePlay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI Func_C1C236728D88E177() { - LOG_ERROR(Lib_SharePlay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI Func_E9E80C474781F115() { - LOG_ERROR(Lib_SharePlay, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI Func_F3DD6199DA15ED44() { - LOG_ERROR(Lib_SharePlay, "(STUBBED) called"); - return ORBIS_OK; -} - -void RegisterLib(Core::Loader::SymbolsResolver* sym) { - LIB_FUNCTION("ggnCfalLU-8", "libSceSharePlay", 1, "libSceSharePlay", sceSharePlayCrashDaemon); - LIB_FUNCTION("OOrLKB0bSDs", "libSceSharePlay", 1, "libSceSharePlay", - sceSharePlayGetCurrentConnectionInfo); - LIB_FUNCTION("+MCXJlWdi+s", "libSceSharePlay", 1, "libSceSharePlay", - sceSharePlayGetCurrentConnectionInfoA); - LIB_FUNCTION("vUMkWXQff3w", "libSceSharePlay", 1, "libSceSharePlay", - sceSharePlayGetCurrentInfo); - LIB_FUNCTION("Md7Mdkr8LBc", "libSceSharePlay", 1, "libSceSharePlay", sceSharePlayGetEvent); - LIB_FUNCTION("isruqthpYcw", "libSceSharePlay", 1, "libSceSharePlay", sceSharePlayInitialize); - LIB_FUNCTION("9zwJpai7jGc", "libSceSharePlay", 1, "libSceSharePlay", - sceSharePlayNotifyDialogOpen); - LIB_FUNCTION("VUW2V9cUTP4", "libSceSharePlay", 1, "libSceSharePlay", - sceSharePlayNotifyForceCloseForCdlg); - LIB_FUNCTION("XL0WwUJoQPg", "libSceSharePlay", 1, "libSceSharePlay", - sceSharePlayNotifyOpenQuickMenu); - LIB_FUNCTION("6-1fKaa5HlY", "libSceSharePlay", 1, "libSceSharePlay", - sceSharePlayResumeScreenForCdlg); - LIB_FUNCTION("U28jAuLHj6c", "libSceSharePlay", 1, "libSceSharePlay", sceSharePlayServerLock); - LIB_FUNCTION("3Oaux9ITEtY", "libSceSharePlay", 1, "libSceSharePlay", sceSharePlayServerUnLock); - LIB_FUNCTION("QZy+KmyqKPU", "libSceSharePlay", 1, "libSceSharePlay", sceSharePlaySetMode); - LIB_FUNCTION("co2NCj--pnc", "libSceSharePlay", 1, "libSceSharePlay", - sceSharePlaySetProhibition); - LIB_FUNCTION("KADsbjNCgPo", "libSceSharePlay", 1, "libSceSharePlay", - sceSharePlaySetProhibitionModeWithAppId); - LIB_FUNCTION("-F6NddfUsa4", "libSceSharePlay", 1, "libSceSharePlay", sceSharePlayStartStandby); - LIB_FUNCTION("rWVNHNnEx6g", "libSceSharePlay", 1, "libSceSharePlay", - sceSharePlayStartStreaming); - LIB_FUNCTION("zEDkUWLVwFI", "libSceSharePlay", 1, "libSceSharePlay", sceSharePlayStopStandby); - LIB_FUNCTION("aGlema+JxUU", "libSceSharePlay", 1, "libSceSharePlay", sceSharePlayStopStreaming); - LIB_FUNCTION("UaLjloJinow", "libSceSharePlay", 1, "libSceSharePlay", sceSharePlayTerminate); - LIB_FUNCTION("LpPA6mprZ8Q", "libSceSharePlay", 1, "libSceSharePlay", Func_2E93C0EA6A6B67C4); - LIB_FUNCTION("wcI2co2I4Xc", "libSceSharePlay", 1, "libSceSharePlay", Func_C1C236728D88E177); - LIB_FUNCTION("6egMR0eB8RU", "libSceSharePlay", 1, "libSceSharePlay", Func_E9E80C474781F115); - LIB_FUNCTION("891hmdoV7UQ", "libSceSharePlay", 1, "libSceSharePlay", Func_F3DD6199DA15ED44); - LIB_FUNCTION("OOrLKB0bSDs", "libSceSharePlayCompat", 1, "libSceSharePlay", - sceSharePlayGetCurrentConnectionInfo); -}; - -} // namespace Libraries::SharePlay \ No newline at end of file diff --git a/src/core/libraries/share_play/shareplay.h b/src/core/libraries/share_play/shareplay.h deleted file mode 100644 index b67b01e93..000000000 --- a/src/core/libraries/share_play/shareplay.h +++ /dev/null @@ -1,55 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include -#include "common/types.h" -#include "core/libraries/np/np_types.h" - -namespace Core::Loader { -class SymbolsResolver; -} - -namespace Libraries::SharePlay { - -constexpr int ORBIS_SHARE_PLAY_CONNECTION_STATUS_DORMANT = 0x00; -constexpr int ORBIS_SHARE_PLAY_CONNECTION_STATUS_READY = 0x01; -constexpr int ORBIS_SHARE_PLAY_CONNECTION_STATUS_CONNECTED = 0x02; - -struct OrbisSharePlayConnectionInfo { - int status; - int mode; - Libraries::Np::OrbisNpOnlineId hostOnlineId; - Libraries::Np::OrbisNpOnlineId visitorOnlineId; - Libraries::UserService::OrbisUserServiceUserId hostUserId; - Libraries::UserService::OrbisUserServiceUserId visitorUserId; -}; - -int PS4_SYSV_ABI sceSharePlayCrashDaemon(); -int PS4_SYSV_ABI sceSharePlayGetCurrentConnectionInfo(OrbisSharePlayConnectionInfo* pInfo); -int PS4_SYSV_ABI sceSharePlayGetCurrentConnectionInfoA(); -int PS4_SYSV_ABI sceSharePlayGetCurrentInfo(); -int PS4_SYSV_ABI sceSharePlayGetEvent(); -int PS4_SYSV_ABI sceSharePlayInitialize(); -int PS4_SYSV_ABI sceSharePlayNotifyDialogOpen(); -int PS4_SYSV_ABI sceSharePlayNotifyForceCloseForCdlg(); -int PS4_SYSV_ABI sceSharePlayNotifyOpenQuickMenu(); -int PS4_SYSV_ABI sceSharePlayResumeScreenForCdlg(); -int PS4_SYSV_ABI sceSharePlayServerLock(); -int PS4_SYSV_ABI sceSharePlayServerUnLock(); -int PS4_SYSV_ABI sceSharePlaySetMode(); -int PS4_SYSV_ABI sceSharePlaySetProhibition(); -int PS4_SYSV_ABI sceSharePlaySetProhibitionModeWithAppId(); -int PS4_SYSV_ABI sceSharePlayStartStandby(); -int PS4_SYSV_ABI sceSharePlayStartStreaming(); -int PS4_SYSV_ABI sceSharePlayStopStandby(); -int PS4_SYSV_ABI sceSharePlayStopStreaming(); -int PS4_SYSV_ABI sceSharePlayTerminate(); -int PS4_SYSV_ABI Func_2E93C0EA6A6B67C4(); -int PS4_SYSV_ABI Func_C1C236728D88E177(); -int PS4_SYSV_ABI Func_E9E80C474781F115(); -int PS4_SYSV_ABI Func_F3DD6199DA15ED44(); - -void RegisterLib(Core::Loader::SymbolsResolver* sym); -} // namespace Libraries::SharePlay \ No newline at end of file diff --git a/src/core/libraries/signin_dialog/signindialog.cpp b/src/core/libraries/signin_dialog/signindialog.cpp deleted file mode 100644 index 9391d8197..000000000 --- a/src/core/libraries/signin_dialog/signindialog.cpp +++ /dev/null @@ -1,63 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -// Generated By moduleGenerator -#include "common/logging/log.h" -#include "core/libraries/error_codes.h" -#include "core/libraries/libs.h" -#include "signindialog.h" - -namespace Libraries::SigninDialog { - -s32 PS4_SYSV_ABI sceSigninDialogInitialize() { - LOG_ERROR(Lib_SigninDialog, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceSigninDialogOpen() { - LOG_ERROR(Lib_SigninDialog, "(STUBBED) called"); - return ORBIS_OK; -} - -Status PS4_SYSV_ABI sceSigninDialogGetStatus() { - LOG_ERROR(Lib_SigninDialog, "(STUBBED) called, return 'finished' status"); - return Status::FINISHED; -} - -Status PS4_SYSV_ABI sceSigninDialogUpdateStatus() { - LOG_ERROR(Lib_SigninDialog, "(STUBBED) called, return 'finished' status"); - return Status::FINISHED; -} - -s32 PS4_SYSV_ABI sceSigninDialogGetResult() { - LOG_ERROR(Lib_SigninDialog, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceSigninDialogClose() { - LOG_ERROR(Lib_SigninDialog, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceSigninDialogTerminate() { - LOG_ERROR(Lib_SigninDialog, "(STUBBED) called"); - return ORBIS_OK; -} - -void RegisterLib(Core::Loader::SymbolsResolver* sym) { - LIB_FUNCTION("mlYGfmqE3fQ", "libSceSigninDialog", 1, "libSceSigninDialog", - sceSigninDialogInitialize); - LIB_FUNCTION("JlpJVoRWv7U", "libSceSigninDialog", 1, "libSceSigninDialog", sceSigninDialogOpen); - LIB_FUNCTION("2m077aeC+PA", "libSceSigninDialog", 1, "libSceSigninDialog", - sceSigninDialogGetStatus); - LIB_FUNCTION("Bw31liTFT3A", "libSceSigninDialog", 1, "libSceSigninDialog", - sceSigninDialogUpdateStatus); - LIB_FUNCTION("nqG7rqnYw1U", "libSceSigninDialog", 1, "libSceSigninDialog", - sceSigninDialogGetResult); - LIB_FUNCTION("M3OkENHcyiU", "libSceSigninDialog", 1, "libSceSigninDialog", - sceSigninDialogClose); - LIB_FUNCTION("LXlmS6PvJdU", "libSceSigninDialog", 1, "libSceSigninDialog", - sceSigninDialogTerminate); -}; - -} // namespace Libraries::SigninDialog diff --git a/src/core/libraries/signin_dialog/signindialog.h b/src/core/libraries/signin_dialog/signindialog.h deleted file mode 100644 index 35740efff..000000000 --- a/src/core/libraries/signin_dialog/signindialog.h +++ /dev/null @@ -1,29 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once -#include "common/types.h" - -namespace Core::Loader { -class SymbolsResolver; -} - -enum class Status : u32 { - NONE = 0, - INITIALIZED = 1, - RUNNING = 2, - FINISHED = 3, -}; - -namespace Libraries::SigninDialog { - -s32 PS4_SYSV_ABI sceSigninDialogInitialize(); -s32 PS4_SYSV_ABI sceSigninDialogOpen(); -Status PS4_SYSV_ABI sceSigninDialogGetStatus(); -Status PS4_SYSV_ABI sceSigninDialogUpdateStatus(); -s32 PS4_SYSV_ABI sceSigninDialogGetResult(); -s32 PS4_SYSV_ABI sceSigninDialogClose(); -s32 PS4_SYSV_ABI sceSigninDialogTerminate(); - -void RegisterLib(Core::Loader::SymbolsResolver* sym); -} // namespace Libraries::SigninDialog diff --git a/src/core/libraries/sysmodule/sysmodule.cpp b/src/core/libraries/sysmodule/sysmodule.cpp index 1ad9075e7..1bb7504ca 100644 --- a/src/core/libraries/sysmodule/sysmodule.cpp +++ b/src/core/libraries/sysmodule/sysmodule.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/libraries/sysmodule/sysmodule.h b/src/core/libraries/sysmodule/sysmodule.h index 17ac3188f..8659dbe1a 100644 --- a/src/core/libraries/sysmodule/sysmodule.h +++ b/src/core/libraries/sysmodule/sysmodule.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/sysmodule/sysmodule_error.h b/src/core/libraries/sysmodule/sysmodule_error.h index aee14b9df..c53b7fe8a 100644 --- a/src/core/libraries/sysmodule/sysmodule_error.h +++ b/src/core/libraries/sysmodule/sysmodule_error.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/sysmodule/sysmodule_internal.cpp b/src/core/libraries/sysmodule/sysmodule_internal.cpp index 56e130289..7213e3ae1 100644 --- a/src/core/libraries/sysmodule/sysmodule_internal.cpp +++ b/src/core/libraries/sysmodule/sysmodule_internal.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/assert.h" @@ -6,16 +6,9 @@ #include "common/logging/log.h" #include "core/emulator_settings.h" #include "core/file_sys/fs.h" -#include "core/libraries/disc_map/disc_map.h" -#include "core/libraries/font/font.h" -#include "core/libraries/font/fontft.h" -#include "core/libraries/jpeg/jpegenc.h" #include "core/libraries/kernel/kernel.h" #include "core/libraries/kernel/orbis_error.h" -#include "core/libraries/libc_internal/libc_internal.h" -#include "core/libraries/libpng/pngenc.h" #include "core/libraries/libs.h" -#include "core/libraries/ngs2/ngs2.h" #include "core/libraries/rtc/rtc.h" #include "core/libraries/sysmodule/sysmodule_error.h" #include "core/libraries/sysmodule/sysmodule_internal.h" @@ -209,21 +202,10 @@ s32 loadModuleInternal(s32 index, s32 argc, const void* argv, s32* res_out) { // We need to check a few things here. // First, check if this is a module we allow LLE for. static s32 stub_handle = 100; - constexpr auto ModulesToLoad = std::to_array( - {{"libSceNgs2.sprx", &Libraries::Ngs2::RegisterLib}, - {"libSceUlt.sprx", nullptr}, - {"libSceRtc.sprx", &Libraries::Rtc::RegisterLib}, - {"libSceJpegDec.sprx", nullptr}, - {"libSceJpegEnc.sprx", &Libraries::JpegEnc::RegisterLib}, - {"libScePngEnc.sprx", &Libraries::PngEnc::RegisterLib}, - {"libSceJson.sprx", nullptr}, - {"libSceJson2.sprx", nullptr}, - {"libSceLibcInternal.sprx", &Libraries::LibcInternal::RegisterLib}, - {"libSceCesCs.sprx", nullptr}, - {"libSceAudiodec.sprx", nullptr}, - {"libSceFont.sprx", &Libraries::Font::RegisterlibSceFont}, - {"libSceFontFt.sprx", &Libraries::FontFt::RegisterlibSceFontFt}, - {"libSceFreeTypeOt.sprx", nullptr}}); + constexpr auto ModulesToLoad = std::to_array({ + {"libSceRtc.sprx", &Libraries::Rtc::RegisterLib}, + {"libSceLibcInternal.sprx", nullptr}, + }); // Iterate through the allowed array const auto it = std::ranges::find_if( diff --git a/src/core/libraries/sysmodule/sysmodule_internal.h b/src/core/libraries/sysmodule/sysmodule_internal.h index 8f88f85ea..c35e62334 100644 --- a/src/core/libraries/sysmodule/sysmodule_internal.h +++ b/src/core/libraries/sysmodule/sysmodule_internal.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/sysmodule/sysmodule_table.h b/src/core/libraries/sysmodule/sysmodule_table.h index bd27a8aae..533a73a17 100644 --- a/src/core/libraries/sysmodule/sysmodule_table.h +++ b/src/core/libraries/sysmodule/sysmodule_table.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/system/commondialog.cpp b/src/core/libraries/system/commondialog.cpp index 13df2d2f4..429f4d5af 100644 --- a/src/core/libraries/system/commondialog.cpp +++ b/src/core/libraries/system/commondialog.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/logging/log.h" diff --git a/src/core/libraries/system/commondialog.h b/src/core/libraries/system/commondialog.h index cee783e32..bb47afce2 100644 --- a/src/core/libraries/system/commondialog.h +++ b/src/core/libraries/system/commondialog.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/system/msgdialog.cpp b/src/core/libraries/system/msgdialog.cpp index d6ed62fb7..86f8b6c7e 100644 --- a/src/core/libraries/system/msgdialog.cpp +++ b/src/core/libraries/system/msgdialog.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/libraries/system/msgdialog.h b/src/core/libraries/system/msgdialog.h index 9f8c065c3..915be4dd6 100644 --- a/src/core/libraries/system/msgdialog.h +++ b/src/core/libraries/system/msgdialog.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/system/msgdialog_ui.cpp b/src/core/libraries/system/msgdialog_ui.cpp index 862f5a569..d75b24536 100644 --- a/src/core/libraries/system/msgdialog_ui.cpp +++ b/src/core/libraries/system/msgdialog_ui.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/libraries/system/msgdialog_ui.h b/src/core/libraries/system/msgdialog_ui.h index d24ec067c..a0907ec1a 100644 --- a/src/core/libraries/system/msgdialog_ui.h +++ b/src/core/libraries/system/msgdialog_ui.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/system/posix.cpp b/src/core/libraries/system/posix.cpp index d09366ca0..8f07722d0 100644 --- a/src/core/libraries/system/posix.cpp +++ b/src/core/libraries/system/posix.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "core/libraries/system/posix.h" diff --git a/src/core/libraries/system/posix.h b/src/core/libraries/system/posix.h index 4d08a2785..43183236c 100644 --- a/src/core/libraries/system/posix.h +++ b/src/core/libraries/system/posix.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/system/systemservice.cpp b/src/core/libraries/system/systemservice.cpp index 0e40c723f..8950bbc04 100644 --- a/src/core/libraries/system/systemservice.cpp +++ b/src/core/libraries/system/systemservice.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/libraries/system/systemservice.h b/src/core/libraries/system/systemservice.h index e3eeb21dc..58062b1e9 100644 --- a/src/core/libraries/system/systemservice.h +++ b/src/core/libraries/system/systemservice.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later // reference // https://github.com/OpenOrbis/OpenOrbis-PS4-Toolchain/blob/master/include/orbis/_types/sys_service.h diff --git a/src/core/libraries/system/systemservice_error.h b/src/core/libraries/system/systemservice_error.h index ca59fab65..f585c3243 100644 --- a/src/core/libraries/system/systemservice_error.h +++ b/src/core/libraries/system/systemservice_error.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/system/userservice.cpp b/src/core/libraries/system/userservice.cpp index 029868eb4..da70ebd77 100644 --- a/src/core/libraries/system/userservice.cpp +++ b/src/core/libraries/system/userservice.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include @@ -1096,7 +1096,7 @@ s32 PS4_SYSV_ABI sceUserServiceGetUserName(int user_id, char* user_name, std::si LOG_ERROR(Lib_UserService, "user_name is null"); return ORBIS_USER_SERVICE_ERROR_INVALID_ARGUMENT; } - std::string name = "shadPS4"; + std::string name = "shadBloodborne"; auto const* u = UserManagement.GetUserByID(user_id); if (u != nullptr) { name = u->user_name; diff --git a/src/core/libraries/system/userservice.h b/src/core/libraries/system/userservice.h index 799bf89ba..ce30f2a0a 100644 --- a/src/core/libraries/system/userservice.h +++ b/src/core/libraries/system/userservice.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later // reference : // https://github.com/OpenOrbis/OpenOrbis-PS4-Toolchain/blob/master/include/orbis/_types/user.h diff --git a/src/core/libraries/system/userservice_error.h b/src/core/libraries/system/userservice_error.h index 40921df9f..e609fe614 100644 --- a/src/core/libraries/system/userservice_error.h +++ b/src/core/libraries/system/userservice_error.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/system_gesture/system_gesture.cpp b/src/core/libraries/system_gesture/system_gesture.cpp index a6455e05e..c2e27bff6 100644 --- a/src/core/libraries/system_gesture/system_gesture.cpp +++ b/src/core/libraries/system_gesture/system_gesture.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/logging/log.h" diff --git a/src/core/libraries/system_gesture/system_gesture.h b/src/core/libraries/system_gesture/system_gesture.h index 8150d08c3..d780f3af1 100644 --- a/src/core/libraries/system_gesture/system_gesture.h +++ b/src/core/libraries/system_gesture/system_gesture.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/ulobjmgr/ulobjmgr.cpp b/src/core/libraries/ulobjmgr/ulobjmgr.cpp deleted file mode 100644 index ff729b3ec..000000000 --- a/src/core/libraries/ulobjmgr/ulobjmgr.cpp +++ /dev/null @@ -1,45 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "common/logging/log.h" -#include "core/libraries/error_codes.h" -#include "core/libraries/kernel/posix_error.h" -#include "core/libraries/libs.h" -#include "core/libraries/ulobjmgr/ulobjmgr.h" - -namespace Libraries::Ulobjmgr { - -s32 PS4_SYSV_ABI Func_046DBA8411A2365C(u64 arg0, s32 arg1, u32* arg2) { - if (arg0 == 0 || arg1 == 0 || arg2 == nullptr) { - return POSIX_EINVAL; - } - *arg2 = 0; - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_1D9F50D9CFB8054E() { - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_4A67FE7D435B94F7(u32 arg0) { - if (arg0 >= 0x4000) { - return POSIX_EINVAL; - } - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_4B07893BBB77A649(u64 arg0) { - if (arg0 == 0) { - return POSIX_EINVAL; - } - return ORBIS_OK; -} - -void RegisterLib(Core::Loader::SymbolsResolver* sym) { - LIB_FUNCTION("BG26hBGiNlw", "ulobjmgr", 1, "ulobjmgr", Func_046DBA8411A2365C); - LIB_FUNCTION("HZ9Q2c+4BU4", "ulobjmgr", 1, "ulobjmgr", Func_1D9F50D9CFB8054E); - LIB_FUNCTION("Smf+fUNblPc", "ulobjmgr", 1, "ulobjmgr", Func_4A67FE7D435B94F7); - LIB_FUNCTION("SweJO7t3pkk", "ulobjmgr", 1, "ulobjmgr", Func_4B07893BBB77A649); -}; - -} // namespace Libraries::Ulobjmgr diff --git a/src/core/libraries/ulobjmgr/ulobjmgr.h b/src/core/libraries/ulobjmgr/ulobjmgr.h deleted file mode 100644 index baf90719c..000000000 --- a/src/core/libraries/ulobjmgr/ulobjmgr.h +++ /dev/null @@ -1,14 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "common/types.h" - -namespace Core::Loader { -class SymbolsResolver; -} - -namespace Libraries::Ulobjmgr { -void RegisterLib(Core::Loader::SymbolsResolver* sym); -} // namespace Libraries::Ulobjmgr \ No newline at end of file diff --git a/src/core/libraries/usbd/emulated/dimensions.cpp b/src/core/libraries/usbd/emulated/dimensions.cpp deleted file mode 100644 index 452968840..000000000 --- a/src/core/libraries/usbd/emulated/dimensions.cpp +++ /dev/null @@ -1,678 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "dimensions.h" - -#include "core/libraries/kernel/threads.h" -#include "core/tls.h" - -#include -#include - -namespace Libraries::Usbd { - -static constexpr std::array COMMAND_KEY = {0x55, 0xFE, 0xF6, 0xB0, 0x62, 0xBF, 0x0B, 0x41, - 0xC9, 0xB3, 0x7C, 0xB4, 0x97, 0x3E, 0x29, 0x7B}; - -static constexpr std::array CHAR_CONSTANT = {0xB7, 0xD5, 0xD7, 0xE6, 0xE7, 0xBA, - 0x3C, 0xA8, 0xD8, 0x75, 0x47, 0x68, - 0xCF, 0x23, 0xE9, 0xFE, 0xAA}; - -static constexpr std::array PWD_CONSTANT = { - 0x28, 0x63, 0x29, 0x20, 0x43, 0x6F, 0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, - 0x20, 0x4C, 0x45, 0x47, 0x4F, 0x20, 0x32, 0x30, 0x31, 0x34, 0xAA, 0xAA}; - -DimensionsToypad::DimensionsToypad() {} - -void DimensionsToypad::LoadFigure(std::string file_name, u8 pad, u8 index) { - Common::FS::IOFile file(file_name, Common::FS::FileAccessMode::ReadWrite); - std::array data; - ASSERT(file.Read(data) == data.size()); - LoadDimensionsFigure(data, std::move(file), pad, index); -} - -u32 DimensionsToypad::LoadDimensionsFigure(const std::array& buf, - Common::FS::IOFile file, u8 pad, u8 index) { - std::lock_guard lock(m_dimensions_mutex); - - const u32 id = GetFigureId(buf); - - DimensionsFigure& figure = GetFigureByIndex(index); - figure.dimFile = std::move(file); - figure.id = id; - figure.pad = pad; - figure.index = index + 1; - figure.data = buf; - // When a figure is added to the toypad, respond to the game with the pad they were added to, - // their index, the direction (0x00 in byte 6 for added) and their UID - std::array figureChangeResponse = {0x56, 0x0b, figure.pad, 0x00, figure.index, - 0x00, buf[0], buf[1], buf[2], buf[4], - buf[5], buf[6], buf[7]}; - figureChangeResponse[13] = GenerateChecksum(figureChangeResponse, 13); - m_figure_added_removed_responses.push(figureChangeResponse); - - return id; -} - -void DimensionsToypad::RemoveFigure(u8 pad, u8 index, bool fullRemove) { - std::lock_guard lock(m_dimensions_mutex); - - DimensionsFigure& figure = GetFigureByIndex(index); - if (figure.index == 255) - return; - - // When a figure is removed from the toypad, respond to the game with the pad they were removed - // from, their index, the direction (0x01 in byte 6 for removed) and their UID - if (fullRemove) { - std::array figureChangeResponse = { - 0x56, 0x0b, figure.pad, 0x00, figure.index, - 0x01, figure.data[0], figure.data[1], figure.data[2], figure.data[4], - figure.data[5], figure.data[6], figure.data[7]}; - figureChangeResponse[13] = GenerateChecksum(figureChangeResponse, 13); - m_figure_added_removed_responses.push(figureChangeResponse); - figure.Save(); - figure.dimFile.Close(); - } - - figure.index = 255; - figure.pad = 255; - figure.id = 0; -} - -void DimensionsToypad::MoveFigure(u8 new_pad, u8 new_index, u8 old_pad, u8 old_index) { - if (old_index == new_index) { - // Don't bother removing and loading again, just send response to the game - CancelRemoveFigure(new_index); - return; - } - - // When moving figures between spaces on the toypad, remove any figure from the space they are - // moving to, then remove them from their current space, then load them to the space they are - // moving to - RemoveFigure(new_pad, new_index, true); - - DimensionsFigure& figure = GetFigureByIndex(old_index); - const std::array data = figure.data; - Common::FS::IOFile inFile = std::move(figure.dimFile); - - RemoveFigure(old_pad, old_index, false); - - LoadDimensionsFigure(data, std::move(inFile), new_pad, new_index); -} - -void DimensionsToypad::TempRemoveFigure(u8 index) { - std::lock_guard lock(m_dimensions_mutex); - - DimensionsFigure& figure = GetFigureByIndex(index); - if (figure.index == 255) - return; - - // Send a response to the game that the figure has been "Picked up" from existing slot, - // until either the movement is cancelled, or user chooses a space to move to - std::array figureChangeResponse = { - 0x56, 0x0b, figure.pad, 0x00, figure.index, - 0x01, figure.data[0], figure.data[1], figure.data[2], figure.data[4], - figure.data[5], figure.data[6], figure.data[7]}; - - figureChangeResponse[13] = GenerateChecksum(figureChangeResponse, 13); - m_figure_added_removed_responses.push(figureChangeResponse); -} - -void DimensionsToypad::CancelRemoveFigure(u8 index) { - std::lock_guard lock(m_dimensions_mutex); - - DimensionsFigure& figure = GetFigureByIndex(index); - if (figure.index == 255) - return; - - // Cancel the previous movement of the figure - std::array figureChangeResponse = { - 0x56, 0x0b, figure.pad, 0x00, figure.index, - 0x00, figure.data[0], figure.data[1], figure.data[2], figure.data[4], - figure.data[5], figure.data[6], figure.data[7]}; - - figureChangeResponse[13] = GenerateChecksum(figureChangeResponse, 13); - m_figure_added_removed_responses.push(figureChangeResponse); -} - -u8 DimensionsToypad::GenerateChecksum(const std::array& data, u32 num_of_bytes) { - int checksum = 0; - ASSERT(num_of_bytes <= data.size()); - for (u8 i = 0; i < num_of_bytes; i++) { - checksum += data[i]; - } - return (checksum & 0xFF); -} - -void DimensionsToypad::GetBlankResponse(u8 type, u8 sequence, std::array& reply_buf) { - reply_buf[0] = 0x55; - reply_buf[1] = type; - reply_buf[2] = sequence; - reply_buf[3] = GenerateChecksum(reply_buf, 3); -} - -void DimensionsToypad::GenerateRandomNumber(const u8* buf, u8 sequence, - std::array& reply_buf) { - // Decrypt payload into an 8 byte array - const std::array value = Decrypt(buf, std::nullopt); - // Seed is the first 4 bytes (little endian) of the decrypted payload - const u32 seed = (u32&)value[0]; - // Confirmation is the second 4 bytes (big endian) of the decrypted payload - // const u32 conf = (u32be&)value[4]; - // Initialize rng using the seed from decrypted payload - InitializeRNG(seed); - // Encrypt 8 bytes, first 4 bytes is the decrypted confirmation from payload, 2nd 4 bytes are - // blank - std::array value_to_encrypt = {value[4], value[5], value[6], value[7], 0, 0, 0, 0}; - const std::array encrypted = Encrypt(value_to_encrypt.data(), std::nullopt); - reply_buf[0] = 0x55; - reply_buf[1] = 0x09; - reply_buf[2] = sequence; - // Copy encrypted value to response data - std::memcpy(&reply_buf[3], encrypted.data(), encrypted.size()); - reply_buf[11] = GenerateChecksum(reply_buf, 11); -} - -void DimensionsToypad::InitializeRNG(u32 seed) { - m_random_a = 0xF1EA5EED; - m_random_b = seed; - m_random_c = seed; - m_random_d = seed; - - for (int i = 0; i < 42; i++) { - GetNext(); - } -} - -u32 DimensionsToypad::GetNext() { - const u32 e = m_random_a - std::rotl(m_random_b, 21); - m_random_a = m_random_b ^ std::rotl(m_random_c, 19); - m_random_b = m_random_c + std::rotl(m_random_d, 6); - m_random_c = m_random_d + e; - m_random_d = e + m_random_a; - return m_random_d; -} - -std::array DimensionsToypad::Decrypt(const u8* buf, std::optional> key) { - // Value to decrypt is separated in to two little endian 32 bit unsigned integers - u32 data_one = u32(buf[0]) | (u32(buf[1]) << 8) | (u32(buf[2]) << 16) | (u32(buf[3]) << 24); - u32 data_two = u32(buf[4]) | (u32(buf[5]) << 8) | (u32(buf[6]) << 16) | (u32(buf[7]) << 24); - - // Use the key as 4 32 bit little endian unsigned integers - u32 key_one; - u32 key_two; - u32 key_three; - u32 key_four; - - if (key) { - key_one = u32(key.value()[0]) | (u32(key.value()[1]) << 8) | (u32(key.value()[2]) << 16) | - (u32(key.value()[3]) << 24); - key_two = u32(key.value()[4]) | (u32(key.value()[5]) << 8) | (u32(key.value()[6]) << 16) | - (u32(key.value()[7]) << 24); - key_three = u32(key.value()[8]) | (u32(key.value()[9]) << 8) | - (u32(key.value()[10]) << 16) | (u32(key.value()[11]) << 24); - key_four = u32(key.value()[12]) | (u32(key.value()[13]) << 8) | - (u32(key.value()[14]) << 16) | (u32(key.value()[15]) << 24); - } else { - key_one = u32(COMMAND_KEY[0]) | (u32(COMMAND_KEY[1]) << 8) | (u32(COMMAND_KEY[2]) << 16) | - (u32(COMMAND_KEY[3]) << 24); - key_two = u32(COMMAND_KEY[4]) | (u32(COMMAND_KEY[5]) << 8) | (u32(COMMAND_KEY[6]) << 16) | - (u32(COMMAND_KEY[7]) << 24); - key_three = u32(COMMAND_KEY[8]) | (u32(COMMAND_KEY[9]) << 8) | - (u32(COMMAND_KEY[10]) << 16) | (u32(COMMAND_KEY[11]) << 24); - key_four = u32(COMMAND_KEY[12]) | (u32(COMMAND_KEY[13]) << 8) | - (u32(COMMAND_KEY[14]) << 16) | (u32(COMMAND_KEY[15]) << 24); - } - - u32 sum = 0xC6EF3720; - constexpr u32 delta = 0x9E3779B9; - - for (int i = 0; i < 32; i++) { - data_two -= - (((data_one << 4) + key_three) ^ (data_one + sum) ^ ((data_one >> 5) + key_four)); - data_one -= (((data_two << 4) + key_one) ^ (data_two + sum) ^ ((data_two >> 5) + key_two)); - sum -= delta; - } - - ASSERT_MSG(sum == 0, "Decryption failed, sum inequal to 0"); - - std::array decrypted = {u8(data_one & 0xFF), u8((data_one >> 8) & 0xFF), - u8((data_one >> 16) & 0xFF), u8((data_one >> 24) & 0xFF), - u8(data_two & 0xFF), u8((data_two >> 8) & 0xFF), - u8((data_two >> 16) & 0xFF), u8((data_two >> 24) & 0xFF)}; - return decrypted; -} - -std::array DimensionsToypad::Encrypt(const u8* buf, std::optional> key) { - // Value to encrypt is separated in to two little endian 32 bit unsigned integers - u32 data_one = u32(buf[0]) | (u32(buf[1]) << 8) | (u32(buf[2]) << 16) | (u32(buf[3]) << 24); - u32 data_two = u32(buf[4]) | (u32(buf[5]) << 8) | (u32(buf[6]) << 16) | (u32(buf[7]) << 24); - - // Use the key as 4 32 bit little endian unsigned integers - u32 key_one; - u32 key_two; - u32 key_three; - u32 key_four; - - if (key) { - key_one = u32(key.value()[0]) | (u32(key.value()[1]) << 8) | (u32(key.value()[2]) << 16) | - (u32(key.value()[3]) << 24); - key_two = u32(key.value()[4]) | (u32(key.value()[5]) << 8) | (u32(key.value()[6]) << 16) | - (u32(key.value()[7]) << 24); - key_three = u32(key.value()[8]) | (u32(key.value()[9]) << 8) | - (u32(key.value()[10]) << 16) | (u32(key.value()[11]) << 24); - key_four = u32(key.value()[12]) | (u32(key.value()[13]) << 8) | - (u32(key.value()[14]) << 16) | (u32(key.value()[15]) << 24); - } else { - key_one = u32(COMMAND_KEY[0]) | (u32(COMMAND_KEY[1]) << 8) | (u32(COMMAND_KEY[2]) << 16) | - (u32(COMMAND_KEY[3]) << 24); - key_two = u32(COMMAND_KEY[4]) | (u32(COMMAND_KEY[5]) << 8) | (u32(COMMAND_KEY[6]) << 16) | - (u32(COMMAND_KEY[7]) << 24); - key_three = u32(COMMAND_KEY[8]) | (u32(COMMAND_KEY[9]) << 8) | - (u32(COMMAND_KEY[10]) << 16) | (u32(COMMAND_KEY[11]) << 24); - key_four = u32(COMMAND_KEY[12]) | (u32(COMMAND_KEY[13]) << 8) | - (u32(COMMAND_KEY[14]) << 16) | (u32(COMMAND_KEY[15]) << 24); - } - - u32 sum = 0; - u32 delta = 0x9E3779B9; - - for (int i = 0; i < 32; i++) { - sum += delta; - data_one += (((data_two << 4) + key_one) ^ (data_two + sum) ^ ((data_two >> 5) + key_two)); - data_two += - (((data_one << 4) + key_three) ^ (data_one + sum) ^ ((data_one >> 5) + key_four)); - } - - std::array encrypted = {u8(data_one & 0xFF), u8((data_one >> 8) & 0xFF), - u8((data_one >> 16) & 0xFF), u8((data_one >> 24) & 0xFF), - u8(data_two & 0xFF), u8((data_two >> 8) & 0xFF), - u8((data_two >> 16) & 0xFF), u8((data_two >> 24) & 0xFF)}; - return encrypted; -} - -std::array DimensionsToypad::GenerateFigureKey(const std::array& buf) { - std::array uid = {buf[0], buf[1], buf[2], buf[4], buf[5], buf[6], buf[7]}; - - u32 scrambleA = Scramble(uid, 3); - u32 scrambleB = Scramble(uid, 4); - u32 scrambleC = Scramble(uid, 5); - u32 scrambleD = Scramble(uid, 6); - - return { - u8((scrambleA >> 24) & 0xFF), u8((scrambleA >> 16) & 0xFF), u8((scrambleA >> 8) & 0xFF), - u8(scrambleA & 0xFF), u8((scrambleB >> 24) & 0xFF), u8((scrambleB >> 16) & 0xFF), - u8((scrambleB >> 8) & 0xFF), u8(scrambleB & 0xFF), u8((scrambleC >> 24) & 0xFF), - u8((scrambleC >> 16) & 0xFF), u8((scrambleC >> 8) & 0xFF), u8(scrambleC & 0xFF), - u8((scrambleD >> 24) & 0xFF), u8((scrambleD >> 16) & 0xFF), u8((scrambleD >> 8) & 0xFF), - u8(scrambleD & 0xFF)}; -} - -u32 DimensionsToypad::Scramble(const std::array& uid, u8 count) { - std::vector to_scramble; - to_scramble.reserve(uid.size() + CHAR_CONSTANT.size()); - for (u8 x : uid) { - to_scramble.push_back(x); - } - for (u8 c : CHAR_CONSTANT) { - to_scramble.push_back(c); - } - to_scramble[(count * 4) - 1] = 0xaa; - - std::array randomized = DimensionsRandomize(to_scramble, count); - - return (u32(randomized[0]) << 24) | (u32(randomized[1]) << 16) | (u32(randomized[2]) << 8) | - u32(randomized[3]); -} - -std::array DimensionsToypad::PWDGenerate(const std::array& uid) { - std::vector pwdCalc = {PWD_CONSTANT.begin(), PWD_CONSTANT.end() - 1}; - for (u8 i = 0; i < uid.size(); i++) { - pwdCalc.insert(pwdCalc.begin() + i, uid[i]); - } - - return DimensionsRandomize(pwdCalc, 8); -} - -std::array DimensionsToypad::DimensionsRandomize(const std::vector& key, u8 count) { - u32 scrambled = 0; - for (u8 i = 0; i < count; i++) { - const u32 v4 = std::rotr(scrambled, 25); - const u32 v5 = std::rotr(scrambled, 10); - const u32 b = u32(key[i * 4]) | (u32(key[(i * 4) + 1]) << 8) | - (u32(key[(i * 4) + 2]) << 16) | (u32(key[(i * 4) + 3]) << 24); - scrambled = b + v4 + v5 - scrambled; - } - return {u8(scrambled & 0xFF), u8(scrambled >> 8 & 0xFF), u8(scrambled >> 16 & 0xFF), - u8(scrambled >> 24 & 0xFF)}; -} - -u32 DimensionsToypad::GetFigureId(const std::array& buf) { - const std::array figure_key = GenerateFigureKey(buf); - - const std::array decrypted = Decrypt(&buf[36 * 4], figure_key); - - const u32 fig_num = u32(decrypted[0]) | (u32(decrypted[1]) << 8) | (u32(decrypted[2]) << 16) | - (u32(decrypted[3]) << 24); - // Characters have their model number encrypted in page 36 - if (fig_num < 1000) { - return fig_num; - } - // Vehicles/Gadgets have their model number written as little endian in page 36 - return u32(buf[36 * 4]) | (u32(buf[(36 * 4) + 1]) << 8) | (u32(buf[(36 * 4) + 2]) << 16) | - (u32(buf[(36 * 4) + 3]) << 24); -} - -DimensionsFigure& DimensionsToypad::GetFigureByIndex(u8 index) { - return m_figures[index]; -} - -void DimensionsToypad::RandomUID(u8* uid_buffer) { - uid_buffer[0] = 0x04; - uid_buffer[7] = 0x80; - - for (u8 i = 1; i < 7; i++) { - u8 random = rand() % 255; - uid_buffer[i] = random; - } -} - -void DimensionsToypad::GetChallengeResponse(const u8* buf, u8 sequence, - std::array& reply_buf) { - // Decrypt payload into an 8 byte array - const std::array value = Decrypt(buf, std::nullopt); - // Confirmation is the first 4 bytes of the decrypted payload - // const u32 conf = read_from_ptr>(value); - // Generate next random number based on RNG - const u32 next_random = GetNext(); - // Encrypt an 8 byte array, first 4 bytes are the next random number (little endian) - // followed by the confirmation from the decrypted payload - std::array value_to_encrypt = {u8(next_random & 0xFF), - u8((next_random >> 8) & 0xFF), - u8((next_random >> 16) & 0xFF), - u8((next_random >> 24) & 0xFF), - value[0], - value[1], - value[2], - value[3]}; - const std::array encrypted = Encrypt(value_to_encrypt.data(), std::nullopt); - reply_buf[0] = 0x55; - reply_buf[1] = 0x09; - reply_buf[2] = sequence; - // Copy encrypted value to response data - std::memcpy(&reply_buf[3], encrypted.data(), encrypted.size()); - reply_buf[11] = GenerateChecksum(reply_buf, 11); -} - -void DimensionsToypad::QueryBlock(u8 index, u8 page, std::array& reply_buf, u8 sequence) { - std::lock_guard lock(m_dimensions_mutex); - - reply_buf[0] = 0x55; - reply_buf[1] = 0x12; - reply_buf[2] = sequence; - reply_buf[3] = 0x00; - - // Index from game begins at 1 rather than 0, so minus 1 here - if (const u8 figure_index = index - 1; figure_index < MAX_DIMENSIONS_FIGURES) { - const DimensionsFigure& figure = GetFigureByIndex(figure_index); - - // Query 4 pages of 4 bytes from the figure, copy this to the response - if (figure.index != 255 && (4 * page) < ((0x2D * 4) - 16)) { - std::memcpy(&reply_buf[4], figure.data.data() + (4 * page), 16); - } - } - reply_buf[20] = GenerateChecksum(reply_buf, 20); -} - -void DimensionsToypad::WriteBlock(u8 index, u8 page, const u8* to_write_buf, - std::array& reply_buf, u8 sequence) { - std::lock_guard lock(m_dimensions_mutex); - - reply_buf[0] = 0x55; - reply_buf[1] = 0x02; - reply_buf[2] = sequence; - reply_buf[3] = 0x00; - - // Index from game begins at 1 rather than 0, so minus 1 here - if (const u8 figure_index = index - 1; figure_index < MAX_DIMENSIONS_FIGURES) { - DimensionsFigure& figure = GetFigureByIndex(figure_index); - - // Copy 4 bytes to the page on the figure requested by the game - if (figure.index != 255 && page < 0x2D) { - // Id is written to page 36 - if (page == 36) { - figure.id = u32(to_write_buf[0]) | (u32(to_write_buf[1]) << 8) | - (u32(to_write_buf[2]) << 16) | (u32(to_write_buf[3]) << 24); - } - std::memcpy(figure.data.data() + (page * 4), to_write_buf, 4); - figure.Save(); - } - } - reply_buf[4] = GenerateChecksum(reply_buf, 4); -} - -void DimensionsToypad::GetModel(const u8* buf, u8 sequence, std::array& reply_buf) { - // Decrypt payload to 8 byte array, byte 1 is the index, 4-7 are the confirmation - const std::array value = Decrypt(buf, std::nullopt); - const u8 index = value[0]; - // const u32 conf = read_from_ptr>(value, 4); - std::array value_to_encrypt = {}; - // Response is the figure's id (little endian) followed by the confirmation from payload - // Index from game begins at 1 rather than 0, so minus 1 here - if (const u8 figure_index = index - 1; figure_index < MAX_DIMENSIONS_FIGURES) { - const DimensionsFigure& figure = GetFigureByIndex(figure_index); - value_to_encrypt = {u8(figure.id & 0xFF), - u8((figure.id >> 8) & 0xFF), - u8((figure.id >> 16) & 0xFF), - u8((figure.id >> 24) & 0xFF), - value[4], - value[5], - value[6], - value[7]}; - } - const std::array encrypted = Encrypt(value_to_encrypt.data(), std::nullopt); - reply_buf[0] = 0x55; - reply_buf[1] = 0x0a; - reply_buf[2] = sequence; - reply_buf[3] = 0x00; - // Copy encrypted message to response - std::memcpy(&reply_buf[4], encrypted.data(), encrypted.size()); - reply_buf[12] = GenerateChecksum(reply_buf, 12); -} - -std::optional> DimensionsToypad::PopAddedRemovedResponse() { - std::lock_guard lock(m_dimensions_mutex); - - if (m_figure_added_removed_responses.empty()) { - return std::nullopt; - } - - std::array response = m_figure_added_removed_responses.front(); - m_figure_added_removed_responses.pop(); - return response; -} - -libusb_endpoint_descriptor* DimensionsBackend::FillEndpointDescriptorPair() { - return m_endpoint_descriptors.data(); -} - -libusb_interface_descriptor* DimensionsBackend::FillInterfaceDescriptor( - libusb_endpoint_descriptor* descs) { - m_interface_descriptors[0].endpoint = descs; - return m_interface_descriptors.data(); -} - -libusb_config_descriptor* DimensionsBackend::FillConfigDescriptor(libusb_interface* inter) { - m_config_descriptors[0].interface = inter; - return m_config_descriptors.data(); -} - -libusb_device_descriptor* DimensionsBackend::FillDeviceDescriptor() { - return m_device_descriptors.data(); -} - -libusb_transfer_status DimensionsBackend::HandleAsyncTransfer(libusb_transfer* transfer) { - ASSERT(transfer->length == 32); - - switch (transfer->endpoint) { - case 0x81: { - // Read Endpoint, wait to respond with either an added/removed figure response, or a queued - // response from a previous write - bool responded = false; - while (!responded) { - std::lock_guard lock(m_query_mutex); - std::optional> response = - m_dimensions_toypad->PopAddedRemovedResponse(); - if (response) { - std::memcpy(transfer->buffer, response.value().data(), 0x20); - transfer->length = 32; - responded = true; - } else if (!m_queries.empty()) { - std::memcpy(transfer->buffer, m_queries.front().data(), 0x20); - transfer->length = 32; - m_queries.pop(); - responded = true; - } - } - break; - } - case 0x01: { - // Write endpoint, similar structure of request to the Infinity Base with a command for byte - // 3, sequence for byte 4, the payload after that, then a checksum for the final byte. - - const u8 command = transfer->buffer[2]; - const u8 sequence = transfer->buffer[3]; - - std::array q_result{}; - - switch (command) { - case 0xB0: // Wake - { - // Consistent device response to the wake command - q_result = {0x55, 0x0e, 0x01, 0x28, 0x63, 0x29, 0x20, 0x4c, 0x45, - 0x47, 0x4f, 0x20, 0x32, 0x30, 0x31, 0x34, 0x46}; - break; - } - case 0xB1: // Seed - { - // Initialise a random number generator using the seed provided - m_dimensions_toypad->GenerateRandomNumber(&transfer->buffer[4], sequence, q_result); - break; - } - case 0xB3: // Challenge - { - // Get the next number in the sequence based on the RNG from 0xB1 command - m_dimensions_toypad->GetChallengeResponse(&transfer->buffer[4], sequence, q_result); - break; - } - case 0xC0: // Color - case 0xC1: // Get Pad Color - case 0xC2: // Fade - case 0xC3: // Flash - case 0xC4: // Fade Random - case 0xC6: // Fade All - case 0xC7: // Flash All - case 0xC8: // Color All - { - // Send a blank response to acknowledge color has been sent to toypad - m_dimensions_toypad->GetBlankResponse(0x01, sequence, q_result); - break; - } - case 0xD2: // Read - { - // Read 4 pages from the figure at index (buf[4]), starting with page buf[5] - m_dimensions_toypad->QueryBlock(transfer->buffer[4], transfer->buffer[5], q_result, - sequence); - break; - } - case 0xD3: // Write - { - // Write 4 bytes to page buf[5] to the figure at index buf[4] - m_dimensions_toypad->WriteBlock(transfer->buffer[4], transfer->buffer[5], - &transfer->buffer[6], q_result, sequence); - break; - } - case 0xD4: // Model - { - // Get the model id of the figure at index buf[4] - m_dimensions_toypad->GetModel(&transfer->buffer[4], sequence, q_result); - break; - } - case 0xD0: // Tag List - case 0xE1: // PWD - case 0xE5: // Active - case 0xFF: // LEDS Query - { - // Further investigation required - LOG_ERROR(Lib_Usbd, "Unimplemented LD Function: {:x}", command); - break; - } - default: { - LOG_ERROR(Lib_Usbd, "Unknown LD Function: {:x}", command); - break; - } - } - std::lock_guard lock(m_query_mutex); - m_queries.push(q_result); - break; - } - default: - break; - } - return LIBUSB_TRANSFER_COMPLETED; -} - -struct WriteThreadArgs { - DimensionsBackend* self; - libusb_transfer* transfer; -}; - -void* PS4_SYSV_ABI DimensionsBackend::WriteThread(void* arg) { - auto* args = reinterpret_cast(arg); - - auto* self = args->self; - auto* transfer = args->transfer; - - self->HandleAsyncTransfer(transfer); - - const u8 flags = transfer->flags; - transfer->status = LIBUSB_TRANSFER_COMPLETED; - transfer->actual_length = transfer->length; - if (transfer->callback) { - transfer->callback(transfer); - } - if (flags & LIBUSB_TRANSFER_FREE_TRANSFER) { - libusb_free_transfer(transfer); - } - delete args; - return nullptr; -} - -s32 DimensionsBackend::SubmitTransfer(libusb_transfer* transfer) { - if (transfer->endpoint == 0x01) { - using namespace Libraries::Kernel; - - PthreadAttrT attr{}; - posix_pthread_attr_init(&attr); - PthreadT thread{}; - auto* args = new WriteThreadArgs(); - args->self = this; - args->transfer = transfer; - posix_pthread_create(&thread, &attr, HOST_CALL(DimensionsBackend::WriteThread), args); - posix_pthread_attr_destroy(&attr); - posix_pthread_detach(thread); - - return LIBUSB_SUCCESS; - } - - return UsbEmulatedBackend::SubmitTransfer(transfer); -} - -void DimensionsFigure::Save() { - if (!dimFile.IsOpen()) - return; - - dimFile.Seek(0); - dimFile.Write(data); -} -} // namespace Libraries::Usbd \ No newline at end of file diff --git a/src/core/libraries/usbd/emulated/dimensions.h b/src/core/libraries/usbd/emulated/dimensions.h deleted file mode 100644 index bc409f7c3..000000000 --- a/src/core/libraries/usbd/emulated/dimensions.h +++ /dev/null @@ -1,120 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include -#include -#include -#include -#include -#include - -#include "common/io_file.h" -#include "core/libraries/usbd/usb_backend.h" - -namespace Libraries::Usbd { - -constexpr u8 DIMEMSIONS_BLOCK_COUNT = 0x2D; -constexpr u8 DIMENSIONS_BLOCK_SIZE = 0x04; -constexpr u8 DIMENSIONS_FIGURE_SIZE = DIMEMSIONS_BLOCK_COUNT * DIMENSIONS_BLOCK_SIZE; -constexpr u8 MAX_DIMENSIONS_FIGURES = 7; - -struct DimensionsFigure final { - Common::FS::IOFile dimFile; - std::array data{}; - u8 index = 255; - u8 pad = 255; - u32 id = 0; - void Save(); -}; - -class DimensionsToypad final : public UsbEmulatedImpl { -public: - DimensionsToypad(); - ~DimensionsToypad() override = default; - - static void GetBlankResponse(u8 type, u8 sequence, std::array& reply_buf); - void GenerateRandomNumber(const u8* buf, u8 sequence, std::array& reply_buf); - void InitializeRNG(u32 seed); - void GetChallengeResponse(const u8* buf, u8 sequence, std::array& reply_buf); - void QueryBlock(u8 index, u8 page, std::array& reply_buf, u8 sequence); - void WriteBlock(u8 index, u8 page, const u8* to_write_buf, std::array& reply_buf, - u8 sequence); - void GetModel(const u8* buf, u8 sequence, std::array& reply_buf); - std::optional> PopAddedRemovedResponse(); - - void LoadFigure(std::string file_name, u8 pad, u8 slot) override; - void RemoveFigure(u8 pad, u8 slot, bool full_remove) override; - void MoveFigure(u8 new_pad, u8 new_index, u8 old_pad, u8 old_index) override; - void TempRemoveFigure(u8 index) override; - void CancelRemoveFigure(u8 index) override; - - u32 LoadDimensionsFigure(const std::array& buf, Common::FS::IOFile file, - u8 pad, u8 index); - -protected: - std::mutex m_dimensions_mutex; - std::array m_figures{}; - -private: - static void RandomUID(u8* uid_buffer); - static u8 GenerateChecksum(const std::array& data, u32 num_of_bytes); - static std::array Decrypt(const u8* buf, std::optional> key); - static std::array Encrypt(const u8* buf, std::optional> key); - static std::array GenerateFigureKey(const std::array& buf); - static u32 Scramble(const std::array& uid, u8 count); - static std::array PWDGenerate(const std::array& uid); - static std::array DimensionsRandomize(const std::vector& key, u8 count); - static u32 GetFigureId(const std::array& buf); - u32 GetNext(); - DimensionsFigure& GetFigureByIndex(u8 index); - - u32 m_random_a{}; - u32 m_random_b{}; - u32 m_random_c{}; - u32 m_random_d{}; - - u8 m_figure_order = 0; - std::queue> m_figure_added_removed_responses; -}; - -class DimensionsBackend final : public UsbEmulatedBackend { -protected: - libusb_endpoint_descriptor* FillEndpointDescriptorPair() override; - libusb_interface_descriptor* FillInterfaceDescriptor( - libusb_endpoint_descriptor* descs) override; - libusb_config_descriptor* FillConfigDescriptor(libusb_interface* inter) override; - libusb_device_descriptor* FillDeviceDescriptor() override; - - s32 GetMaxPacketSize(libusb_device* dev, u8 endpoint) override { - return 32; - } - - s32 SubmitTransfer(libusb_transfer* transfer) override; - - libusb_transfer_status HandleAsyncTransfer(libusb_transfer* transfer) override; - - std::shared_ptr GetImplRef() override { - return m_dimensions_toypad; - } - - std::mutex m_query_mutex; - std::queue> m_queries; - -private: - static void* PS4_SYSV_ABI WriteThread(void* arg); - - std::shared_ptr m_dimensions_toypad = std::make_shared(); - - std::array m_endpoint_out_extra = {0x09, 0x21, 0x11, 0x01, 0x00, 0x01, 0x22, 0x1d, 0x00}; - std::vector m_endpoint_descriptors = { - {0x7, 0x5, 0x81, 0x3, 0x20, 0x1, 0x0, 0x0}, {0x7, 0x5, 0x1, 0x3, 0x20, 0x1, 0x0, 0x0}}; - std::vector m_interface_descriptors = { - {0x9, 0x4, 0x0, 0x0, 0x2, 0x3, 0x0, 0x0, 0x0}}; - std::vector m_config_descriptors = { - {0x9, 0x2, 0x29, 0x1, 0x1, 0x0, 0x80, 0xFA}}; - std::vector m_device_descriptors = { - {0x12, 0x1, 0x200, 0x0, 0x0, 0x0, 0x20, 0x0E6F, 0x0241, 0x200, 0x1, 0x2, 0x0, 0x1}}; -}; -} // namespace Libraries::Usbd \ No newline at end of file diff --git a/src/core/libraries/usbd/emulated/infinity.cpp b/src/core/libraries/usbd/emulated/infinity.cpp deleted file mode 100644 index af8e13dcc..000000000 --- a/src/core/libraries/usbd/emulated/infinity.cpp +++ /dev/null @@ -1,392 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "infinity.h" - -#include - -namespace Libraries::Usbd { - -InfinityBase::InfinityBase() {} - -void InfinityBase::LoadFigure(std::string file_name, u8 pad, u8 slot) { - Common::FS::IOFile file(file_name, Common::FS::FileAccessMode::ReadWrite); - std::array data; - ASSERT(file.Read(data) == data.size()); - LoadInfinityFigure(data, std::move(file), slot); -} - -void InfinityBase::RemoveFigure(u8 pad, u8 slot, bool full_remove) { - std::lock_guard lock(infinity_mutex); - InfinityFigure& figure = infinity_figures[slot]; - - if (!figure.present) { - return; - } - - slot = DeriveFigurePosition(slot); - if (slot == 0) { - return; - } - - figure.present = false; - - std::array figure_change_response = {0xab, 0x04, slot, 0x09, figure.order_added, 0x01}; - figure_change_response[6] = GenerateChecksum(figure_change_response, 6); - m_figure_added_removed_responses.push(figure_change_response); - - figure.Save(); - figure.infFile.Close(); -} - -void InfinityBase::LoadInfinityFigure(const std::array& buf, - Common::FS::IOFile file, u8 position) { - std::lock_guard lock(infinity_mutex); - u8 order_added; - - InfinityFigure& figure = infinity_figures[position]; - - figure.infFile = std::move(file); - memcpy(figure.data.data(), buf.data(), figure.data.size()); - figure.present = true; - if (figure.order_added == 255) { - figure.order_added = m_figure_order; - m_figure_order++; - } - order_added = figure.order_added; - - position = DeriveFigurePosition(position); - if (position == 0) { - return; - } - - std::array figure_change_response = {0xab, 0x04, position, 0x09, order_added, 0x00}; - figure_change_response[6] = GenerateChecksum(figure_change_response, 6); - m_figure_added_removed_responses.push(figure_change_response); -} - -void InfinityBase::GetBlankResponse(u8 sequence, std::array& reply_buf) { - reply_buf[0] = 0xaa; - reply_buf[1] = 0x01; - reply_buf[2] = sequence; - reply_buf[3] = GenerateChecksum(reply_buf, 3); -} - -void InfinityBase::DescrambleAndSeed(u8* buf, u8 sequence, std::array& reply_buf) { - u64 value = u64(buf[4]) << 56 | u64(buf[5]) << 48 | u64(buf[6]) << 40 | u64(buf[7]) << 32 | - u64(buf[8]) << 24 | u64(buf[9]) << 16 | u64(buf[10]) << 8 | u64(buf[11]); - u32 seed = Descramble(value); - GenerateSeed(seed); - GetBlankResponse(sequence, reply_buf); -} - -void InfinityBase::GetNextAndScramble(u8 sequence, std::array& reply_buf) { - const u32 next_random = GetNext(); - const u64 scrambled_next_random = Scramble(next_random, 0); - reply_buf = {0xAA, 0x09, sequence}; - reply_buf[3] = u8((scrambled_next_random >> 56) & 0xFF); - reply_buf[4] = u8((scrambled_next_random >> 48) & 0xFF); - reply_buf[5] = u8((scrambled_next_random >> 40) & 0xFF); - reply_buf[6] = u8((scrambled_next_random >> 32) & 0xFF); - reply_buf[7] = u8((scrambled_next_random >> 24) & 0xFF); - reply_buf[8] = u8((scrambled_next_random >> 16) & 0xFF); - reply_buf[9] = u8((scrambled_next_random >> 8) & 0xFF); - reply_buf[10] = u8(scrambled_next_random & 0xFF); - reply_buf[11] = GenerateChecksum(reply_buf, 11); -} - -void InfinityBase::GetPresentFigures(u8 sequence, std::array& reply_buf) { - int x = 3; - for (u8 i = 0; i < infinity_figures.size(); i++) { - u8 slot = i == 0 ? 0x10 : (i < 4) ? 0x20 : 0x30; - if (infinity_figures[i].present) { - reply_buf[x] = slot + infinity_figures[i].order_added; - reply_buf[x + 1] = 0x09; - x += 2; - } - } - reply_buf[0] = 0xaa; - reply_buf[1] = x - 2; - reply_buf[2] = sequence; - reply_buf[x] = GenerateChecksum(reply_buf, x); -} - -void InfinityBase::QueryBlock(u8 fig_num, u8 block, std::array& reply_buf, u8 sequence) { - std::lock_guard lock(infinity_mutex); - - InfinityFigure& figure = GetFigureByOrder(fig_num); - - reply_buf[0] = 0xaa; - reply_buf[1] = 0x12; - reply_buf[2] = sequence; - reply_buf[3] = 0x00; - const u8 file_block = (block == 0) ? 1 : (block * 4); - if (figure.present && file_block < 20) { - memcpy(&reply_buf[4], figure.data.data() + (16 * file_block), 16); - } - reply_buf[20] = GenerateChecksum(reply_buf, 20); -} - -void InfinityBase::WriteBlock(u8 fig_num, u8 block, const u8* to_write_buf, - std::array& reply_buf, u8 sequence) { - std::lock_guard lock(infinity_mutex); - - InfinityFigure& figure = GetFigureByOrder(fig_num); - - reply_buf[0] = 0xaa; - reply_buf[1] = 0x02; - reply_buf[2] = sequence; - reply_buf[3] = 0x00; - const u8 file_block = (block == 0) ? 1 : (block * 4); - if (figure.present && file_block < 20) { - memcpy(figure.data.data() + (file_block * 16), to_write_buf, 16); - figure.Save(); - } - reply_buf[4] = GenerateChecksum(reply_buf, 4); -} - -void InfinityBase::GetFigureIdentifier(u8 fig_num, u8 sequence, std::array& reply_buf) { - std::lock_guard lock(infinity_mutex); - - InfinityFigure& figure = GetFigureByOrder(fig_num); - - reply_buf[0] = 0xaa; - reply_buf[1] = 0x09; - reply_buf[2] = sequence; - reply_buf[3] = 0x00; - - if (figure.present) { - memcpy(&reply_buf[4], figure.data.data(), 7); - } - reply_buf[11] = GenerateChecksum(reply_buf, 11); -} - -std::optional> InfinityBase::PopAddedRemovedResponse() { - if (m_figure_added_removed_responses.empty()) - return std::nullopt; - - std::array response = m_figure_added_removed_responses.front(); - m_figure_added_removed_responses.pop(); - return response; -} - -u8 InfinityBase::GenerateChecksum(const std::array& data, int num_of_bytes) const { - int checksum = 0; - for (int i = 0; i < num_of_bytes; i++) { - checksum += data[i]; - } - return (checksum & 0xFF); -} - -u32 InfinityBase::Descramble(u64 num_to_descramble) { - u64 mask = 0x8E55AA1B3999E8AA; - u32 ret = 0; - - for (int i = 0; i < 64; i++) { - if (mask & 0x8000000000000000) { - ret = (ret << 1) | (num_to_descramble & 0x01); - } - - num_to_descramble >>= 1; - mask <<= 1; - } - - return ret; -} - -u64 InfinityBase::Scramble(u32 num_to_scramble, u32 garbage) { - u64 mask = 0x8E55AA1B3999E8AA; - u64 ret = 0; - - for (int i = 0; i < 64; i++) { - ret <<= 1; - - if ((mask & 1) != 0) { - ret |= (num_to_scramble & 1); - num_to_scramble >>= 1; - } else { - ret |= (garbage & 1); - garbage >>= 1; - } - - mask >>= 1; - } - - return ret; -} - -void InfinityBase::GenerateSeed(u32 seed) { - random_a = 0xF1EA5EED; - random_b = seed; - random_c = seed; - random_d = seed; - - for (int i = 0; i < 23; i++) { - GetNext(); - } -} - -u32 InfinityBase::GetNext() { - u32 a = random_a; - u32 b = random_b; - u32 c = random_c; - u32 ret = std::rotl(random_b, 27); - - const u32 temp = (a + ((ret ^ 0xFFFFFFFF) + 1)); - b ^= std::rotl(c, 17); - a = random_d; - c += a; - ret = b + temp; - a += temp; - - random_c = a; - random_a = b; - random_b = c; - random_d = ret; - - return ret; -} - -InfinityFigure& InfinityBase::GetFigureByOrder(u8 order_added) { - for (u8 i = 0; i < infinity_figures.size(); i++) { - if (infinity_figures[i].order_added == order_added) { - return infinity_figures[i]; - } - } - return infinity_figures[0]; -} - -u8 InfinityBase::DeriveFigurePosition(u8 position) { - switch (position) { - case 0: - case 1: - case 2: - return 1; - case 3: - case 4: - case 5: - return 2; - case 6: - case 7: - case 8: - return 3; - - default: - return 0; - } -} - -libusb_endpoint_descriptor* InfinityBackend::FillEndpointDescriptorPair() { - return m_endpoint_descriptors.data(); -} - -libusb_interface_descriptor* InfinityBackend::FillInterfaceDescriptor( - libusb_endpoint_descriptor* descs) { - m_interface_descriptors[0].endpoint = descs; - return m_interface_descriptors.data(); -} - -libusb_config_descriptor* InfinityBackend::FillConfigDescriptor(libusb_interface* inter) { - m_config_descriptors[0].interface = inter; - return m_config_descriptors.data(); -} - -libusb_device_descriptor* InfinityBackend::FillDeviceDescriptor() { - return m_device_descriptors.data(); -} - -libusb_transfer_status InfinityBackend::HandleAsyncTransfer(libusb_transfer* transfer) { - switch (transfer->endpoint) { - case 0x81: { - // Respond after FF command - std::optional> response = m_infinity_base->PopAddedRemovedResponse(); - if (response) { - memcpy(transfer->buffer, response.value().data(), 0x20); - } else if (!m_queries.empty()) { - memcpy(transfer->buffer, m_queries.front().data(), 0x20); - m_queries.pop(); - } - break; - } - case 0x01: { - const u8 command = transfer->buffer[2]; - const u8 sequence = transfer->buffer[3]; - LOG_INFO(Lib_Usbd, "Infinity Backend Transfer command: {:x}", command); - - std::array q_result{}; - - switch (command) { - case 0x80: { - q_result = {0xaa, 0x15, 0x00, 0x00, 0x0f, 0x01, 0x00, 0x03, 0x02, 0x09, 0x09, 0x43, - 0x20, 0x32, 0x62, 0x36, 0x36, 0x4b, 0x34, 0x99, 0x67, 0x31, 0x93, 0x8c}; - break; - } - case 0x81: { - // Initiate Challenge - m_infinity_base->DescrambleAndSeed(transfer->buffer, sequence, q_result); - break; - } - case 0x83: { - // Challenge Response - m_infinity_base->GetNextAndScramble(sequence, q_result); - break; - } - case 0x90: - case 0x92: - case 0x93: - case 0x95: - case 0x96: { - // Color commands - m_infinity_base->GetBlankResponse(sequence, q_result); - break; - } - case 0xA1: { - // Get Present Figures - m_infinity_base->GetPresentFigures(sequence, q_result); - break; - } - case 0xA2: { - // Read Block from Figure - m_infinity_base->QueryBlock(transfer->buffer[4], transfer->buffer[5], q_result, - sequence); - break; - } - case 0xA3: { - // Write block to figure - m_infinity_base->WriteBlock(transfer->buffer[4], transfer->buffer[5], - &transfer->buffer[7], q_result, sequence); - break; - } - case 0xB4: { - // Get figure ID - m_infinity_base->GetFigureIdentifier(transfer->buffer[4], sequence, q_result); - break; - } - case 0xB5: { - // Get status? - m_infinity_base->GetBlankResponse(sequence, q_result); - break; - } - default: - LOG_ERROR(Lib_Usbd, "Unhandled Infinity Query: {}", command); - break; - } - - m_queries.push(q_result); - break; - } - default: - LOG_ERROR(Lib_Usbd, "Unhandled Infinity Endpoint: {}", transfer->endpoint); - break; - } - return LIBUSB_TRANSFER_COMPLETED; -} - -void InfinityFigure::Save() { - if (!infFile.IsOpen()) - return; - - infFile.Seek(0); - infFile.Write(data); -} -} // namespace Libraries::Usbd \ No newline at end of file diff --git a/src/core/libraries/usbd/emulated/infinity.h b/src/core/libraries/usbd/emulated/infinity.h deleted file mode 100644 index 4c8a5305f..000000000 --- a/src/core/libraries/usbd/emulated/infinity.h +++ /dev/null @@ -1,112 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include -#include -#include -#include -#include -#include - -#include "common/io_file.h" -#include "core/libraries/usbd/usb_backend.h" - -namespace Libraries::Usbd { - -constexpr u16 INFINITY_BLOCK_COUNT = 0x14; -constexpr u16 INFINITY_BLOCK_SIZE = 0x10; -constexpr u16 INFINITY_FIGURE_SIZE = INFINITY_BLOCK_COUNT * INFINITY_BLOCK_SIZE; -constexpr u8 MAX_INFINITY_FIGURES = 9; - -struct InfinityFigure final { - Common::FS::IOFile infFile; - std::array data{}; - bool present = false; - u8 order_added = 255; - void Save(); -}; - -class InfinityBase final : public UsbEmulatedImpl { -public: - InfinityBase(); - ~InfinityBase() override = default; - - void GetBlankResponse(u8 sequence, std::array& reply_buf); - void DescrambleAndSeed(u8* buf, u8 sequence, std::array& reply_buf); - void GetNextAndScramble(u8 sequence, std::array& reply_buf); - void GetPresentFigures(u8 sequence, std::array& reply_buf); - void QueryBlock(u8 fig_num, u8 block, std::array& reply_buf, u8 sequence); - void WriteBlock(u8 fig_num, u8 block, const u8* to_write_buf, std::array& reply_buf, - u8 sequence); - void GetFigureIdentifier(u8 fig_num, u8 sequence, std::array& reply_buf); - std::optional> PopAddedRemovedResponse(); - - void LoadFigure(std::string file_name, u8 pad, u8 slot) override; - void RemoveFigure(u8 pad, u8 slot, bool full_remove) override; - void MoveFigure(u8 new_pad, u8 new_index, u8 old_pad, u8 old_index) override {} - void TempRemoveFigure(u8 index) override {} - void CancelRemoveFigure(u8 index) override {} - - void LoadInfinityFigure(const std::array& buf, Common::FS::IOFile file, - u8 position); - -protected: - std::mutex infinity_mutex; - std::array infinity_figures; - -private: - u8 GenerateChecksum(const std::array& data, int num_of_bytes) const; - u32 Descramble(u64 num_to_descramble); - u64 Scramble(u32 num_to_scramble, u32 garbage); - void GenerateSeed(u32 seed); - u32 GetNext(); - InfinityFigure& GetFigureByOrder(u8 order_added); - u8 DeriveFigurePosition(u8 position); - - u32 random_a = 0; - u32 random_b = 0; - u32 random_c = 0; - u32 random_d = 0; - - u8 m_figure_order = 0; - std::queue> m_figure_added_removed_responses; -}; - -class InfinityBackend final : public UsbEmulatedBackend { -protected: - libusb_endpoint_descriptor* FillEndpointDescriptorPair() override; - libusb_interface_descriptor* FillInterfaceDescriptor( - libusb_endpoint_descriptor* descs) override; - libusb_config_descriptor* FillConfigDescriptor(libusb_interface* inter) override; - libusb_device_descriptor* FillDeviceDescriptor() override; - - s32 ControlTransfer(libusb_device_handle* dev_handle, u8 bmRequestType, u8 bRequest, u16 wValue, - u16 wIndex, u8* data, u16 wLength, u32 timeout) override { - return LIBUSB_SUCCESS; - } - - libusb_transfer_status HandleAsyncTransfer(libusb_transfer* transfer) override; - - std::shared_ptr GetImplRef() override { - return m_infinity_base; - } - -private: - std::shared_ptr m_infinity_base = std::make_shared(); - - std::array m_endpoint_out_extra = {0x09, 0x21, 0x11, 0x01, 0x00, 0x01, 0x22, 0x1d, 0x00}; - std::vector m_endpoint_descriptors = { - {0x7, 0x5, 0x81, 0x3, 0x20, 0x1, 0x0, 0x0}, - {0x7, 0x5, 0x1, 0x3, 0x20, 0x1, 0x0, 0x0, m_endpoint_out_extra.data(), 9}}; - std::vector m_interface_descriptors = { - {0x9, 0x4, 0x0, 0x0, 0x2, 0x3, 0x0, 0x0, 0x0}}; - std::vector m_config_descriptors = { - {0x9, 0x2, 0x29, 0x1, 0x1, 0x0, 0x80, 0xFA}}; - std::vector m_device_descriptors = { - {0x12, 0x1, 0x200, 0x0, 0x0, 0x0, 0x20, 0x0E6F, 0x0129, 0x200, 0x1, 0x2, 0x3, 0x1}}; - - std::queue> m_queries; -}; -} // namespace Libraries::Usbd \ No newline at end of file diff --git a/src/core/libraries/usbd/emulated/skylander.cpp b/src/core/libraries/usbd/emulated/skylander.cpp deleted file mode 100644 index 6a24be970..000000000 --- a/src/core/libraries/usbd/emulated/skylander.cpp +++ /dev/null @@ -1,503 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "skylander.h" - -#include - -namespace Libraries::Usbd { - -SkylanderPortal::SkylanderPortal() {} - -void SkylanderPortal::LoadFigure(std::string file_name, u8 pad, u8 slot) { - Common::FS::IOFile file(file_name, Common::FS::FileAccessMode::ReadWrite); - std::array data; - ASSERT(file.Read(data) == data.size()); - ui_skylanders[slot] = LoadSkylander(data.data(), std::move(file)); -} - -void SkylanderPortal::RemoveFigure(u8 pad, u8 slot, bool full_remove) { - std::lock_guard lock(sky_mutex); - auto& thesky = skylanders[ui_skylanders[slot]]; - - if (thesky.status & 1) { - thesky.status = 2; - thesky.queued_status.push(Skylander::REMOVING); - thesky.queued_status.push(Skylander::REMOVED); - thesky.Save(); - thesky.skyFile.Close(); - } -} - -u8 SkylanderPortal::LoadSkylander(u8* buf, Common::FS::IOFile file) { - std::lock_guard lock(sky_mutex); - - u32 skySerial = 0; - for (int i = 3; i > -1; i--) { - skySerial <<= 8; - skySerial |= buf[i]; - } - u8 foundSlot = 0xFF; - - // mimics spot retaining on the portal - for (auto i = 0; i < MAX_SKYLANDERS; i++) { - if ((skylanders[i].status & 1) == 0) { - if (skylanders[i].last_id == skySerial) { - foundSlot = i; - break; - } - - if (i < foundSlot) { - foundSlot = i; - } - } - } - - if (foundSlot != 0xFF) { - auto& skylander = skylanders[foundSlot]; - memcpy(skylander.data.data(), buf, skylander.data.size()); - skylander.skyFile = std::move(file); - skylander.status = Skylander::ADDED; - skylander.queued_status.push(Skylander::ADDED); - skylander.queued_status.push(Skylander::READY); - skylander.last_id = skySerial; - } - return foundSlot; -} - -void SkylanderPortal::Activate() { - const std::lock_guard lock(sky_mutex); - if (m_activated) { - // If the portal was already active no change is needed - return; - } - - // If not we need to advertise change to all the figures present on the portal - for (auto& s : skylanders) { - if (s.status & 1) { - s.queued_status.push(Skylander::ADDED); - s.queued_status.push(Skylander::READY); - } - } - - m_activated = true; -} - -void SkylanderPortal::Deactivate() { - const std::lock_guard lock(sky_mutex); - - for (auto& s : skylanders) { - // check if at the end of the updates there would be a figure on the portal - if (!s.queued_status.empty()) { - s.status = s.queued_status.back(); - s.queued_status = std::queue(); - } - - s.status &= 1; - } - - m_activated = false; -} - -// Side: -// 0x00 = right -// 0x01 = left and right -// 0x02 = left -// 0x03 = trap -void SkylanderPortal::SetLEDs(u8 side, u8 red, u8 green, u8 blue) { - const std::lock_guard lock(sky_mutex); - if (side == 0x00) { - m_color_right.red = red; - m_color_right.green = green; - m_color_right.blue = blue; - } else if (side == 0x01) { - m_color_right.red = red; - m_color_right.green = green; - m_color_right.blue = blue; - - m_color_left.red = red; - m_color_left.green = green; - m_color_left.blue = blue; - } else if (side == 0x02) { - m_color_left.red = red; - m_color_left.green = green; - m_color_left.blue = blue; - } else if (side == 0x03) { - m_color_trap.red = red; - m_color_trap.green = green; - m_color_trap.blue = blue; - } -} - -std::array SkylanderPortal::GetStatus() { - const std::lock_guard lock(sky_mutex); - - u32 status = 0; - u8 active = 0x00; - - if (m_activated) { - active = 0x01; - } - - for (int i = MAX_SKYLANDERS - 1; i >= 0; i--) { - auto& s = skylanders[i]; - - if (!s.queued_status.empty()) { - s.status = s.queued_status.front(); - s.queued_status.pop(); - } - status <<= 2; - status |= s.status; - } - - std::array interrupt_response = {0x53, 0x00, 0x00, 0x00, 0x00, m_interrupt_counter++, - active, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00}; - memcpy(&interrupt_response[1], &status, sizeof(status)); - return interrupt_response; -} - -void SkylanderPortal::QueryBlock(u8 sky_num, u8 block, u8* reply_buf) { - if (!IsSkylanderNumberValid(sky_num) || !IsBlockNumberValid(block)) - return; - - std::lock_guard lock(sky_mutex); - - const auto& skylander = skylanders[sky_num]; - - reply_buf[0] = 'Q'; - reply_buf[2] = block; - if (skylander.status & Skylander::READY) { - reply_buf[1] = (0x10 | sky_num); - memcpy(reply_buf + 3, skylander.data.data() + (16 * block), 16); - } else { - reply_buf[1] = 0x01; - } -} - -void SkylanderPortal::WriteBlock(u8 sky_num, u8 block, const u8* to_write_buf, u8* reply_buf) { - if (!IsSkylanderNumberValid(sky_num) || !IsBlockNumberValid(block)) - return; - - std::lock_guard lock(sky_mutex); - - auto& skylander = skylanders[sky_num]; - - reply_buf[0] = 'W'; - reply_buf[2] = block; - - if (skylander.status & 1) { - reply_buf[1] = (0x10 | sky_num); - memcpy(skylander.data.data() + (block * 16), to_write_buf, 16); - skylander.Save(); - } else { - reply_buf[1] = 0x01; - } -} - -bool SkylanderPortal::IsSkylanderNumberValid(u8 sky_num) { - return sky_num < MAX_SKYLANDERS; -} - -bool SkylanderPortal::IsBlockNumberValid(u8 block) { - return block < 64; -} - -libusb_endpoint_descriptor* SkylanderBackend::FillEndpointDescriptorPair() { - return m_endpoint_descriptors.data(); -} - -libusb_interface_descriptor* SkylanderBackend::FillInterfaceDescriptor( - libusb_endpoint_descriptor* descs) { - m_interface_descriptors[0].endpoint = descs; - return m_interface_descriptors.data(); -} - -libusb_config_descriptor* SkylanderBackend::FillConfigDescriptor(libusb_interface* inter) { - m_config_descriptors[0].interface = inter; - return m_config_descriptors.data(); -} - -libusb_device_descriptor* SkylanderBackend::FillDeviceDescriptor() { - return m_device_descriptors.data(); -} - -s32 SkylanderBackend::ControlTransfer(libusb_device_handle* dev_handle, u8 bmRequestType, - u8 bRequest, u16 wValue, u16 wIndex, u8* data, u16 wLength, - u32 timeout) { - if (bmRequestType != 0x21) { - return LIBUSB_ERROR_PIPE; - } - if (bRequest != 0x09) { - return 8; - } - // Data to be sent back via the control transfer immediately - std::array control_response = {}; - s32 expected_count = 0; - // Data to be queued to be sent back via the Interrupt Transfer (if needed) - std::array interrupt_response = {}; - switch (data[0]) { - case 'A': { - // Activation - // Command { 'A', (00 | 01), 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, - // 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00 } - // Response { 'A', (00 | 01), - // ff, 77, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, - // 00, 00, 00, 00, 00, 00, 00, 00 } - // The 2nd byte of the command is whether to activate (0x01) or deactivate (0x00) the - // portal. The response echos back the activation byte as the 2nd byte of the response. The - // 3rd and 4th bytes of the response appear to vary from wired to wireless. On wired - // portals, the bytes appear to always be ff 77. On wireless portals, during activation the - // 3rd byte appears to count down from ff (possibly a battery power indication) and during - // deactivation ed and eb responses have been observed. The 4th byte appears to always be 00 - // for wireless portals. - - // Wii U Wireless: 41 01 f4 00 41 00 ed 00 41 01 f4 00 41 00 eb 00 41 01 f3 00 41 00 ed 00 - if (wLength == 2) { - control_response = {data[0], data[1]}; - interrupt_response = {0x41, data[1], 0xFF, 0x77, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - m_queries.push(interrupt_response); - expected_count = 10; - m_skylander_portal->Activate(); - } - break; - } - case 'C': { - // Color - // Command { 'C', 12, 34, 56, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, - // 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00 } - // Response { 'C', 12, 34, 56, 00, 00, - // 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, - // 00, 00, 00, 00 } - // The 3 bytes {12, 34, 56} are RGB values. - - // This command should set the color of the LED in the portal, however this appears - // deprecated in most of the recent portals. On portals that do not have LEDs, this command - // is silently ignored and do not require a response. - if (wLength == 4) { - m_skylander_portal->SetLEDs(0x01, data[1], data[2], data[3]); - control_response = {0x43, data[1], data[2], data[3]}; - expected_count = 12; - } - break; - } - case 'J': { - // Sided color - // The 2nd byte is the side - // 0x00: right - // 0x02: left - - // The 3rd, 4th and 5th bytes are red, green and blue - - // The 6th and 7th bytes form a little-endian short for how long the fade duration should be - // in milliseconds. - // For example, 500 milliseconds becomes 0xF4, 0x01 - if (wLength == 7) { - control_response = {data[0], data[1], data[2], data[3], data[4], data[5], data[6]}; - expected_count = 15; - interrupt_response = {data[0]}; - m_queries.push(interrupt_response); - m_skylander_portal->SetLEDs(data[1], data[2], data[3], data[4]); - } - break; - } - case 'L': { - // Light - // This command is used while playing audio through the portal - - // The 2nd bytes is the position - // 0x00: right - // 0x01: trap led - // 0x02: left - - // The 3rd, 4th and 5th bytes are red, green and blue - // the trap led is white-only - // increasing or decreasing the values results in a brighter or dimmer light - if (wLength == 5) { - control_response = {data[0], data[1], data[2], data[3], data[4]}; - expected_count = 13; - - u8 side = data[1]; - if (side == 0x02) { - side = 0x04; - } - m_skylander_portal->SetLEDs(side, data[2], data[3], data[4]); - } - break; - } - case 'M': { - // Audio Firmware version - // Respond with version obtained from Trap Team wired portal - if (wLength == 2) { - control_response = {data[0], data[1]}; - expected_count = 10; - interrupt_response = {data[0], data[1], 0x00, 0x19}; - m_queries.push(interrupt_response); - } - break; - } - // Query - // Command { 'Q', 10, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, - // 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00 } - // Response { 'Q', 10, 00, 00, 00, 00, - // 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, - // 00, 00, 00, 00 } - // In the command the 2nd byte indicates which Skylander to query data - // from. Index starts at 0x10 for the 1st Skylander (as reported in the Status command.) The - // 16th Skylander indexed would be 0x20. The 3rd byte indicate which block to read from. - - // A response with the 2nd byte of 0x01 indicates an error in the read. Otherwise, the - // response indicates the Skylander's index in the 2nd byte, the block read in the 3rd byte, - // data (16 bytes) is contained in bytes 4-19. - - // A Skylander has 64 blocks of data indexed from 0x00 to 0x3f. SwapForce characters have 2 - // character indexes, these may not be sequential. - case 'Q': { - if (wLength == 3) { - const u8 sky_num = data[1] & 0xF; - const u8 block = data[2]; - m_skylander_portal->QueryBlock(sky_num, block, interrupt_response.data()); - m_queries.push(interrupt_response); - control_response = {data[0], data[1], data[2]}; - expected_count = 11; - } - break; - } - case 'R': { - // Ready - // Command { 'R', 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, - // 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00 } - // Response { 'R', 02, 0a, 03, 02, 00, - // 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, - // 00, 00, 00, 00 } - // The 4 byte sequence after the R (0x52) is unknown, but appears consistent based on device - // type. - if (wLength == 2) { - control_response = {0x52, 0x00}; - interrupt_response = {0x52, 0x02, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - m_queries.push(interrupt_response); - expected_count = 10; - } - break; - } - // Status - // Command { 'S', 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, - // 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00 } - // Response { 'S', 55, 00, 00, 55, 3e, - // (00|01), 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, - // 00, 00, 00, 00, 00 } - // Status is the default command. If you open the HID device and - // activate the portal, you will get status outputs. - - // The 4 bytes {55, 00, 00, 55} are the status of characters on the portal. The 4 bytes are - // treated as a 32-bit binary array. Each unique Skylander placed on a board is represented - // by 2 bits starting with the first Skylander in the least significant bit. This bit is - // present whenever the Skylander is added or present on the portal. When the Skylander is - // added to the board, both bits are set in the next status message as a one-time signal. - // When a Skylander is removed from the board, only the most significant bit of the 2 bits - // is set. - - // Different portals can track a different number of RFID tags. The Wii Wireless portal - // tracks 4, the Wired portal can track 8. The maximum number of unique Skylanders tracked - // at any time is 16, after which new Skylanders appear to cycle unused bits. - - // Certain Skylanders, e.g. SwapForce Skylanders, are represented as 2 ID in the bit array. - // This may be due to the presence of 2 RFIDs, one for each half of the Skylander. - - // The 6th byte {3e} is a counter and increments by one. It will roll over when reaching - // {ff}. - - // The purpose of the (00\|01) byte at the 7th position appear to indicate if the portal has - // been activated: {01} when active and {00} when deactivated. - case 'S': { - if (wLength == 1) { - // The Status interrupt responses are automatically handled via the GetStatus method - control_response = {data[0]}; - expected_count = 9; - } - break; - } - case 'V': { - if (wLength == 4) { - control_response = {data[0], data[1], data[2], data[3]}; - expected_count = 12; - } - break; - } - // Write - // Command { 'W', 10, 00, 01, 02, 03, 04, 05, 06, 07, 08, 09, 0a, 0b, 0c, 0d, 0e, 0f, 00, - // 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00 } - // Response { 'W', 00, 00, 00, 00, 00, - // 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, - // 00, 00, 00, 00 } - // In the command the 2nd byte indicates which Skylander to query data from. Index starts at - // 0x10 for the 1st Skylander (as reported in the Status command.) The 16th Skylander - // indexed would be 0x20. - - // 3rd byte is the block to write to. - - // Bytes 4 - 19 ({ 01, 02, 03, 04, 05, 06, 07, 08, 09, 0a, 0b, 0c, 0d, 0e, 0f }) are the - // data to write. - - // The response does not appear to return the id of the Skylander being written, the 2nd - // byte is 0x00; however, the 3rd byte echos the block that was written (0x00 in example - // above.) - - case 'W': { - if (wLength == 19) { - const u8 sky_num = data[1] & 0xF; - const u8 block = data[2]; - m_skylander_portal->WriteBlock(sky_num, block, &data[3], interrupt_response.data()); - m_queries.push(interrupt_response); - control_response = {data[0], data[1], data[2], data[3], data[4], - data[5], data[6], data[7], data[8], data[9], - data[10], data[11], data[12], data[13], data[14], - data[15], data[16], data[17], data[18]}; - expected_count = 27; - } - break; - } - default: - LOG_ERROR(Lib_Usbd, "Unhandled Skylander Portal Query: {}", data[0]); - break; - } - return expected_count; -} - -libusb_transfer_status SkylanderBackend::HandleAsyncTransfer(libusb_transfer* transfer) { - switch (transfer->endpoint) { - case 0x81: - if (m_queries.empty()) { - memcpy(transfer->buffer, m_skylander_portal->GetStatus().data(), 32); - } else { - memcpy(transfer->buffer, m_queries.front().data(), 32); - m_queries.pop(); - } - transfer->length = 32; - break; - case 0x02: - LOG_INFO(Lib_Usbd, "OUT ENDPOINT"); - break; - - default: - break; - } - return LIBUSB_TRANSFER_COMPLETED; -} - -void Skylander::Save() { - if (!skyFile.IsOpen()) - return; - - skyFile.Seek(0); - skyFile.Write(data); -} -} // namespace Libraries::Usbd \ No newline at end of file diff --git a/src/core/libraries/usbd/emulated/skylander.h b/src/core/libraries/usbd/emulated/skylander.h deleted file mode 100644 index 8a54d2737..000000000 --- a/src/core/libraries/usbd/emulated/skylander.h +++ /dev/null @@ -1,111 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include -#include -#include -#include -#include - -#include "common/io_file.h" -#include "core/libraries/usbd/usb_backend.h" - -namespace Libraries::Usbd { - -constexpr u16 SKY_BLOCK_COUNT = 0x40; -constexpr u16 SKY_BLOCK_SIZE = 0x10; -constexpr u16 SKY_FIGURE_SIZE = SKY_BLOCK_COUNT * SKY_BLOCK_SIZE; -constexpr u8 MAX_SKYLANDERS = 16; - -struct Skylander final { - Common::FS::IOFile skyFile; - u8 status = 0; - std::queue queued_status; - std::array data{}; - u32 last_id = 0; - void Save(); - - enum : u8 { REMOVED = 0, READY = 1, REMOVING = 2, ADDED = 3 }; -}; - -struct SkylanderLEDColor final { - u8 red = 0; - u8 green = 0; - u8 blue = 0; -}; - -class SkylanderPortal final : public UsbEmulatedImpl { -public: - SkylanderPortal(); - ~SkylanderPortal() override = default; - - void Activate(); - void Deactivate(); - void SetLEDs(u8 side, u8 r, u8 g, u8 b); - - std::array GetStatus(); - void QueryBlock(u8 sky_num, u8 block, u8* reply_buf); - void WriteBlock(u8 sky_num, u8 block, const u8* to_write_buf, u8* reply_buf); - - void LoadFigure(std::string file_name, u8 pad, u8 slot) override; - void RemoveFigure(u8 pad, u8 slot, bool full_remove) override; - void MoveFigure(u8 new_pad, u8 new_index, u8 old_pad, u8 old_index) override {} - void TempRemoveFigure(u8 index) override {} - void CancelRemoveFigure(u8 index) override {} - - u8 LoadSkylander(u8* buf, Common::FS::IOFile file); - -protected: - std::mutex sky_mutex; - -private: - static bool IsSkylanderNumberValid(u8 sky_num); - static bool IsBlockNumberValid(u8 block); - - bool m_activated = true; - bool m_status_updated = false; - u8 m_interrupt_counter = 0; - SkylanderLEDColor m_color_right = {}; - SkylanderLEDColor m_color_left = {}; - SkylanderLEDColor m_color_trap = {}; - - std::array skylanders; - std::array ui_skylanders; -}; - -class SkylanderBackend final : public UsbEmulatedBackend { -protected: - libusb_endpoint_descriptor* FillEndpointDescriptorPair() override; - libusb_interface_descriptor* FillInterfaceDescriptor( - libusb_endpoint_descriptor* descs) override; - libusb_config_descriptor* FillConfigDescriptor(libusb_interface* inter) override; - libusb_device_descriptor* FillDeviceDescriptor() override; - - s32 ControlTransfer(libusb_device_handle* dev_handle, u8 bmRequestType, u8 bRequest, u16 wValue, - u16 wIndex, u8* data, u16 wLength, u32 timeout) override; - - libusb_transfer_status HandleAsyncTransfer(libusb_transfer* transfer) override; - - std::shared_ptr GetImplRef() override { - return m_skylander_portal; - } - -private: - std::shared_ptr m_skylander_portal = std::make_shared(); - - std::array m_endpoint_out_extra = {0x09, 0x21, 0x11, 0x01, 0x00, 0x01, 0x22, 0x1d, 0x00}; - std::vector m_endpoint_descriptors = { - {0x7, 0x5, 0x81, 0x3, 0x40, 0x1, 0x0, 0x0}, - {0x7, 0x5, 0x2, 0x3, 0x40, 0x1, 0x0, 0x0, m_endpoint_out_extra.data(), 9}}; - std::vector m_interface_descriptors = { - {0x9, 0x4, 0x0, 0x0, 0x2, 0x3, 0x0, 0x0, 0x0}}; - std::vector m_config_descriptors = { - {0x9, 0x2, 0x29, 0x1, 0x1, 0x0, 0x80, 0xFA}}; - std::vector m_device_descriptors = { - {0x12, 0x1, 0x200, 0x0, 0x0, 0x0, 0x40, 0x1430, 0x150, 0x100, 0x1, 0x2, 0x0, 0x1}}; - - std::queue> m_queries; -}; -} // namespace Libraries::Usbd \ No newline at end of file diff --git a/src/core/libraries/usbd/usb_backend.h b/src/core/libraries/usbd/usb_backend.h deleted file mode 100644 index e668d5509..000000000 --- a/src/core/libraries/usbd/usb_backend.h +++ /dev/null @@ -1,477 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include - -#include - -#include "common/assert.h" -#include "common/types.h" - -namespace Libraries::Usbd { - -#if defined(_WIN32) -typedef CRITICAL_SECTION usbi_mutex_t; -#else -typedef pthread_mutex_t usbi_mutex_t; -#endif - -struct list_head { - struct list_head *prev, *next; -}; - -// Forward declared libusb structs -struct UsbDeviceHandle { - usbi_mutex_t lock; - unsigned long claimed_interfaces; - struct list_head list; - struct libusb_device* dev; - int auto_detach_kernel_driver; -}; - -struct UsbDevice { - volatile long refcnt; - - struct libusb_context* ctx; - struct libusb_device* parent_dev; - - u8 bus_number; - u8 port_number; - u8 device_address; - enum libusb_speed speed; - - struct list_head list; - unsigned long session_data; - - struct libusb_device_descriptor device_descriptor; - volatile long attached; -}; - -class UsbEmulatedImpl { -public: - UsbEmulatedImpl() = default; - - virtual void LoadFigure(std::string file_name, u8 pad, u8 slot) = 0; - virtual void RemoveFigure(u8 pad, u8 slot, bool full_remove) = 0; - virtual void MoveFigure(u8 new_pad, u8 new_index, u8 old_pad, u8 old_index) = 0; - virtual void TempRemoveFigure(u8 index) = 0; - virtual void CancelRemoveFigure(u8 index) = 0; - -protected: - virtual ~UsbEmulatedImpl() = default; -}; - -class UsbBackend { -public: - UsbBackend() = default; - - virtual s32 Init() = 0; - virtual void Exit() = 0; - - virtual s64 GetDeviceList(libusb_device*** list) = 0; - virtual void FreeDeviceList(libusb_device** list, s32 unref_devices) = 0; - - virtual s32 GetConfiguration(libusb_device_handle* dev, s32* config) = 0; - virtual s32 GetDeviceDescriptor(libusb_device* dev, libusb_device_descriptor* desc) = 0; - virtual s32 GetActiveConfigDescriptor(libusb_device* dev, - libusb_config_descriptor** config) = 0; - virtual s32 GetConfigDescriptor(libusb_device* dev, u8 config_index, - libusb_config_descriptor** config) = 0; - virtual void FreeConfigDescriptor(libusb_config_descriptor* config) = 0; - - virtual u8 GetBusNumber(libusb_device* dev) = 0; - virtual u8 GetDeviceAddress(libusb_device* dev) = 0; - virtual s32 GetMaxPacketSize(libusb_device* dev, u8 endpoint) = 0; - - virtual s32 OpenDevice(libusb_device* dev, libusb_device_handle** dev_handle) = 0; - virtual void CloseDevice(libusb_device_handle* dev_handle) = 0; - virtual libusb_device* GetDevice(libusb_device_handle* dev_handle) = 0; - - virtual s32 SetConfiguration(libusb_device_handle* dev_handle, s32 configuration) = 0; - virtual s32 ClaimInterface(libusb_device_handle* dev_handle, s32 interface_number) = 0; - virtual libusb_device_handle* OpenDeviceWithVidPid(u16 vendor_id, u16 product_id) = 0; - virtual s32 ResetDevice(libusb_device_handle* dev_handle) = 0; - - virtual s32 KernelDriverActive(libusb_device_handle* dev_handle, s32 interface_number) = 0; - virtual s32 DetachKernelDriver(libusb_device_handle* dev_handle, s32 interface_number) = 0; - virtual s32 AttachKernelDriver(libusb_device_handle* dev_handle, s32 interface_number) = 0; - - virtual s32 ControlTransfer(libusb_device_handle* dev_handle, u8 bmRequestType, u8 bRequest, - u16 wValue, u16 wIndex, u8* data, u16 wLength, u32 timeout) = 0; - virtual s32 SubmitTransfer(libusb_transfer* transfer) = 0; - - virtual s32 TryLockEvents() = 0; - virtual void LockEvents() = 0; - virtual void UnlockEvents() = 0; - virtual s32 EventHandlingOk() = 0; - virtual s32 EventHandlerActive() = 0; - virtual void LockEventWaiters() = 0; - virtual void UnlockEventWaiters() = 0; - virtual s32 WaitForEvent(timeval* tv) = 0; - - virtual s32 HandleEventsTimeout(timeval* tv) = 0; - virtual s32 HandleEvents() = 0; - virtual s32 HandleEventsLocked(timeval* tv) = 0; - - virtual s32 CheckConnected(libusb_device_handle* dev) = 0; - virtual std::shared_ptr GetImplRef() = 0; - -protected: - virtual ~UsbBackend() = default; -}; - -class UsbRealBackend : public UsbBackend { -public: - s32 Init() override { - return libusb_init(&g_libusb_context); - } - void Exit() override { - libusb_exit(g_libusb_context); - } - - s64 GetDeviceList(libusb_device*** list) override { - return libusb_get_device_list(g_libusb_context, list); - } - void FreeDeviceList(libusb_device** list, s32 unref_devices) override { - libusb_free_device_list(list, unref_devices); - } - - s32 GetConfiguration(libusb_device_handle* dev, s32* config) override { - return libusb_get_configuration(dev, config); - } - s32 GetDeviceDescriptor(libusb_device* dev, libusb_device_descriptor* desc) override { - return libusb_get_device_descriptor(dev, desc); - } - s32 GetActiveConfigDescriptor(libusb_device* dev, libusb_config_descriptor** config) override { - return libusb_get_active_config_descriptor(dev, config); - } - s32 GetConfigDescriptor(libusb_device* dev, u8 config_index, - libusb_config_descriptor** config) override { - return libusb_get_config_descriptor(dev, config_index, config); - } - void FreeConfigDescriptor(libusb_config_descriptor* config) override { - libusb_free_config_descriptor(config); - } - - u8 GetBusNumber(libusb_device* dev) override { - return libusb_get_bus_number(dev); - } - u8 GetDeviceAddress(libusb_device* dev) override { - return libusb_get_device_address(dev); - } - s32 GetMaxPacketSize(libusb_device* dev, u8 endpoint) override { - return libusb_get_max_packet_size(dev, endpoint); - } - - s32 OpenDevice(libusb_device* dev, libusb_device_handle** dev_handle) override { - return libusb_open(dev, dev_handle); - } - void CloseDevice(libusb_device_handle* dev_handle) override { - libusb_close(dev_handle); - } - libusb_device* GetDevice(libusb_device_handle* dev_handle) override { - return libusb_get_device(dev_handle); - } - - s32 SetConfiguration(libusb_device_handle* dev_handle, s32 configuration) override { - return libusb_set_configuration(dev_handle, configuration); - } - s32 ClaimInterface(libusb_device_handle* dev_handle, s32 interface_number) override { - return libusb_claim_interface(dev_handle, interface_number); - } - libusb_device_handle* OpenDeviceWithVidPid(u16 vendor_id, u16 product_id) override { - return libusb_open_device_with_vid_pid(g_libusb_context, vendor_id, product_id); - } - s32 ResetDevice(libusb_device_handle* dev_handle) override { - return libusb_reset_device(dev_handle); - } - - s32 KernelDriverActive(libusb_device_handle* dev_handle, s32 interface_number) override { -#if defined(_WIN32) || defined(__APPLE__) - return s_has_removed_driver ? 0 : 1; -#else - return libusb_kernel_driver_active(dev_handle, interface_number); -#endif - } - s32 DetachKernelDriver(libusb_device_handle* dev_handle, s32 interface_number) override { -#if defined(_WIN32) || defined(__APPLE__) - s_has_removed_driver = true; - return LIBUSB_SUCCESS; -#else - return libusb_detach_kernel_driver(dev_handle, interface_number); -#endif - } - s32 AttachKernelDriver(libusb_device_handle* dev_handle, s32 interface_number) override { -#if defined(_WIN32) || defined(__APPLE__) - s_has_removed_driver = false; - return LIBUSB_SUCCESS; -#else - return libusb_attach_kernel_driver(dev_handle, interface_number); -#endif - } - - s32 ControlTransfer(libusb_device_handle* dev_handle, u8 bmRequestType, u8 bRequest, u16 wValue, - u16 wIndex, u8* data, u16 wLength, u32 timeout) override { - return libusb_control_transfer(dev_handle, bmRequestType, bRequest, wValue, wIndex, data, - wLength, timeout); - } - s32 SubmitTransfer(libusb_transfer* transfer) override { - return libusb_submit_transfer(transfer); - } - - s32 TryLockEvents() override { - return libusb_try_lock_events(g_libusb_context); - } - void LockEvents() override { - return libusb_lock_events(g_libusb_context); - } - void UnlockEvents() override { - return libusb_unlock_events(g_libusb_context); - } - s32 EventHandlingOk() override { - return libusb_event_handling_ok(g_libusb_context); - } - s32 EventHandlerActive() override { - return libusb_event_handler_active(g_libusb_context); - } - void LockEventWaiters() override { - return libusb_lock_event_waiters(g_libusb_context); - } - void UnlockEventWaiters() override { - return libusb_unlock_event_waiters(g_libusb_context); - } - s32 WaitForEvent(timeval* tv) override { - return libusb_wait_for_event(g_libusb_context, tv); - } - - s32 HandleEventsTimeout(timeval* tv) override { - return libusb_handle_events_timeout(g_libusb_context, tv); - } - s32 HandleEvents() override { - return libusb_handle_events(g_libusb_context); - } - s32 HandleEventsLocked(timeval* tv) override { - return libusb_handle_events_locked(g_libusb_context, tv); - } - - s32 CheckConnected(libusb_device_handle* dev) override { - // There's no libusb version of this function. - // Simulate by querying data. - - int config; - return libusb_get_configuration(dev, &config); - } - - std::shared_ptr GetImplRef() override { - return nullptr; - } - -protected: - libusb_context* g_libusb_context = nullptr; - bool s_has_removed_driver = false; -}; - -class UsbEmulatedBackend : public UsbRealBackend { -public: - s64 GetDeviceList(libusb_device*** list) override { - auto** fake = static_cast(calloc(2, sizeof(libusb_device*))); - fake[0] = GetDevice(nullptr); - fake[1] = nullptr; - *list = fake; - - return 1; - } - void FreeDeviceList(libusb_device** list, s32 unref_devices) override { - if (!list) { - return; - } - - if (unref_devices) { - int i = 0; - libusb_device* dev; - - while ((dev = list[i++]) != nullptr) { - free(dev); - } - } - free(list); - } - - s32 GetConfiguration(libusb_device_handle* dev, s32* config) override { - config = nullptr; - return LIBUSB_SUCCESS; - } - - s32 GetDeviceDescriptor(libusb_device* dev, libusb_device_descriptor* desc) override { - std::memcpy(desc, FillDeviceDescriptor(), sizeof(libusb_device_descriptor)); - return LIBUSB_SUCCESS; - } - s32 GetActiveConfigDescriptor(libusb_device* dev, libusb_config_descriptor** config) override { - const auto endpoint_descs = FillEndpointDescriptorPair(); - const auto interface_desc = FillInterfaceDescriptor(endpoint_descs); - - const auto interface = static_cast(calloc(1, sizeof(libusb_interface))); - interface->altsetting = interface_desc; - interface->num_altsetting = 1; - - const auto new_config = FillConfigDescriptor(interface); - - ASSERT(endpoint_descs && interface_desc && new_config); - *config = new_config; - return LIBUSB_SUCCESS; - } - s32 GetConfigDescriptor(libusb_device* dev, u8 config_index, - libusb_config_descriptor** config) override { - if (config_index >= 1) { - return LIBUSB_ERROR_NOT_FOUND; - } - return GetActiveConfigDescriptor(dev, config); - } - void FreeConfigDescriptor(libusb_config_descriptor* config) override { - // Member variable reference, don't free - } - - u8 GetBusNumber(libusb_device* dev) override { - return 0; - } - u8 GetDeviceAddress(libusb_device* dev) override { - return 0; - } - s32 GetMaxPacketSize(libusb_device* dev, u8 endpoint) override { - libusb_device_descriptor* desc = nullptr; - - int r = GetDeviceDescriptor(dev, desc); - if (r < LIBUSB_SUCCESS) { - return LIBUSB_ERROR_OTHER; - } - return desc->bMaxPacketSize0; - } - - s32 OpenDevice(libusb_device* dev, libusb_device_handle** dev_handle) override { - auto* _dev_handle = static_cast(calloc(1, sizeof(libusb_device_handle*))); - if (!_dev_handle) { - return LIBUSB_ERROR_NO_MEM; - } - _dev_handle->dev = dev; - *dev_handle = reinterpret_cast(_dev_handle); - return LIBUSB_SUCCESS; - } - void CloseDevice(libusb_device_handle* dev_handle) override { - LOG_WARNING(Lib_Usbd, "Guest decided to close device, might be an implementation issue"); - free(dev_handle); - } - libusb_device* GetDevice(libusb_device_handle* dev_handle) override { - const auto desc = FillDeviceDescriptor(); - ASSERT(desc); - - const auto fake = static_cast(calloc(1, sizeof(UsbDevice))); - fake->bus_number = 0; - fake->port_number = 0; - fake->device_address = 0; - fake->device_descriptor = *desc; - fake->ctx = g_libusb_context; - return reinterpret_cast(fake); - } - - s32 SetConfiguration(libusb_device_handle* dev_handle, s32 configuration) override { - return LIBUSB_SUCCESS; - } - s32 ClaimInterface(libusb_device_handle* dev_handle, s32 interface_number) override { - return LIBUSB_SUCCESS; - } - libusb_device_handle* OpenDeviceWithVidPid(u16 vendor_id, u16 product_id) override { - libusb_device_handle* dev_handle = nullptr; - OpenDevice(GetDevice(nullptr), &dev_handle); - return dev_handle; - } - s32 ResetDevice(libusb_device_handle* dev_handle) override { - LOG_WARNING(Lib_Usbd, "Guest decided to reset device, might be an implementation issue"); - return LIBUSB_SUCCESS; - } - - s32 KernelDriverActive(libusb_device_handle* dev_handle, s32 interface_number) override { - return s_has_removed_driver ? 0 : 1; - } - s32 DetachKernelDriver(libusb_device_handle* dev_handle, s32 interface_number) override { - s_has_removed_driver = true; - return LIBUSB_SUCCESS; - } - s32 AttachKernelDriver(libusb_device_handle* dev_handle, s32 interface_number) override { - s_has_removed_driver = false; - return LIBUSB_SUCCESS; - } - - s32 ControlTransfer(libusb_device_handle* dev_handle, u8 bmRequestType, u8 bRequest, u16 wValue, - u16 wIndex, u8* data, u16 wLength, u32 timeout) override { - LOG_WARNING(Lib_Usbd, "Backend has not handled control transfers"); - return LIBUSB_ERROR_PIPE; - } - s32 SubmitTransfer(libusb_transfer* transfer) override { - ASSERT(transfer->type == LIBUSB_TRANSFER_TYPE_INTERRUPT); - - // if we have no other flying transfers, start the list with this one - if (flight_list.empty()) { - flight_list.push_front(transfer); - return LIBUSB_SUCCESS; - } - - // if we have infinite timeout, append to end of list - if (transfer->timeout == 0) { - flight_list.push_back(transfer); - return LIBUSB_SUCCESS; - } - - // otherwise, find appropriate place in list - for (auto it = flight_list.begin(); it != flight_list.end(); ++it) { - if ((*it)->timeout > transfer->timeout) { - flight_list.insert(it, transfer); - return LIBUSB_SUCCESS; - } - } - - // otherwise we need to be inserted at the end - flight_list.push_back(transfer); - return LIBUSB_SUCCESS; - } - - s32 HandleEventsTimeout(timeval* tv) override { - return HandleEvents(); - } - s32 HandleEvents() override { - if (!flight_list.empty()) { - const auto transfer = flight_list.front(); - - const u8 flags = transfer->flags; - transfer->status = HandleAsyncTransfer(transfer); - transfer->actual_length = transfer->length; - if (transfer->callback) { - transfer->callback(transfer); - } - if (flags & LIBUSB_TRANSFER_FREE_TRANSFER) { - libusb_free_transfer(transfer); - } - flight_list.pop_front(); - } - - return LIBUSB_SUCCESS; - } - - s32 CheckConnected(libusb_device_handle* dev) override { - return LIBUSB_SUCCESS; - } - -protected: - virtual libusb_endpoint_descriptor* FillEndpointDescriptorPair() = 0; - virtual libusb_interface_descriptor* FillInterfaceDescriptor( - libusb_endpoint_descriptor* descs) = 0; - virtual libusb_config_descriptor* FillConfigDescriptor(libusb_interface* inter) = 0; - virtual libusb_device_descriptor* FillDeviceDescriptor() = 0; - - virtual libusb_transfer_status HandleAsyncTransfer(libusb_transfer* transfer) = 0; - - std::list flight_list; -}; - -} // namespace Libraries::Usbd diff --git a/src/core/libraries/usbd/usbd.cpp b/src/core/libraries/usbd/usbd.cpp deleted file mode 100644 index 52d6aec66..000000000 --- a/src/core/libraries/usbd/usbd.cpp +++ /dev/null @@ -1,542 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "common/logging/log.h" -#include "core/libraries/error_codes.h" -#include "core/libraries/libs.h" -#include "usbd.h" - -#include -#include - -#include "core/emulator_settings.h" - -namespace Libraries::Usbd { - -s32 libusb_to_orbis_error(int retVal) { - if (retVal == LIBUSB_ERROR_OTHER) - return 0x802400FF; - if (retVal < 0) { - LOG_ERROR(Lib_Usbd, "libusb returned: {}", libusb_error_name(retVal)); - return 0x80240000 - retVal; - } - - return retVal; -} - -std::shared_ptr usb_backend; - -#if defined(_WIN32) -bool s_has_removed_driver = false; -#endif - -s32 PS4_SYSV_ABI sceUsbdInit() { - LOG_DEBUG(Lib_Usbd, "called"); - - return libusb_to_orbis_error(usb_backend->Init()); -} - -void PS4_SYSV_ABI sceUsbdExit() { - LOG_DEBUG(Lib_Usbd, "called"); - - usb_backend->Exit(); -} - -s64 PS4_SYSV_ABI sceUsbdGetDeviceList(SceUsbdDevice*** list) { - LOG_DEBUG(Lib_Usbd, "called"); - - return libusb_to_orbis_error(usb_backend->GetDeviceList(list)); -} - -void PS4_SYSV_ABI sceUsbdFreeDeviceList(SceUsbdDevice** list, s32 unref_devices) { - LOG_DEBUG(Lib_Usbd, "called"); - - usb_backend->FreeDeviceList(list, unref_devices); -} - -SceUsbdDevice* PS4_SYSV_ABI sceUsbdRefDevice(SceUsbdDevice* device) { - LOG_DEBUG(Lib_Usbd, "called"); - - return libusb_ref_device(device); -} - -void PS4_SYSV_ABI sceUsbdUnrefDevice(SceUsbdDevice* device) { - LOG_DEBUG(Lib_Usbd, "called"); - - libusb_unref_device(device); -} - -s32 PS4_SYSV_ABI sceUsbdGetConfiguration(SceUsbdDeviceHandle* dev_handle, s32* config) { - LOG_DEBUG(Lib_Usbd, "called"); - - return libusb_to_orbis_error(usb_backend->GetConfiguration(dev_handle, config)); -} - -s32 PS4_SYSV_ABI sceUsbdGetDeviceDescriptor(SceUsbdDevice* device, SceUsbdDeviceDescriptor* desc) { - LOG_DEBUG(Lib_Usbd, "called"); - - return libusb_to_orbis_error(usb_backend->GetDeviceDescriptor(device, desc)); -} - -s32 PS4_SYSV_ABI sceUsbdGetActiveConfigDescriptor(SceUsbdDevice* device, - SceUsbdConfigDescriptor** config) { - LOG_DEBUG(Lib_Usbd, "called"); - - return libusb_to_orbis_error(usb_backend->GetActiveConfigDescriptor(device, config)); -} - -s32 PS4_SYSV_ABI sceUsbdGetConfigDescriptor(SceUsbdDevice* device, u8 config_index, - SceUsbdConfigDescriptor** config) { - LOG_DEBUG(Lib_Usbd, "called"); - - return libusb_to_orbis_error(usb_backend->GetConfigDescriptor(device, config_index, config)); -} - -s32 PS4_SYSV_ABI sceUsbdGetConfigDescriptorByValue(SceUsbdDevice* device, u8 bConfigurationValue, - SceUsbdConfigDescriptor** config) { - LOG_DEBUG(Lib_Usbd, "called"); - - return libusb_to_orbis_error( - libusb_get_config_descriptor_by_value(device, bConfigurationValue, config)); -} - -void PS4_SYSV_ABI sceUsbdFreeConfigDescriptor(SceUsbdConfigDescriptor* config) { - LOG_DEBUG(Lib_Usbd, "called"); - - usb_backend->FreeConfigDescriptor(config); -} - -u8 PS4_SYSV_ABI sceUsbdGetBusNumber(SceUsbdDevice* device) { - LOG_DEBUG(Lib_Usbd, "called"); - - return usb_backend->GetBusNumber(device); -} - -u8 PS4_SYSV_ABI sceUsbdGetDeviceAddress(SceUsbdDevice* device) { - LOG_DEBUG(Lib_Usbd, "called"); - - return usb_backend->GetDeviceAddress(device); -} - -SceUsbdSpeed PS4_SYSV_ABI sceUsbdGetDeviceSpeed(SceUsbdDevice* device) { - LOG_DEBUG(Lib_Usbd, "called"); - - return static_cast(libusb_get_device_speed(device)); -} - -s32 PS4_SYSV_ABI sceUsbdGetMaxPacketSize(SceUsbdDevice* device, u8 endpoint) { - LOG_DEBUG(Lib_Usbd, "called"); - - return libusb_to_orbis_error(usb_backend->GetMaxPacketSize(device, endpoint)); -} - -s32 PS4_SYSV_ABI sceUsbdGetMaxIsoPacketSize(SceUsbdDevice* device, u8 endpoint) { - LOG_DEBUG(Lib_Usbd, "called"); - - return libusb_to_orbis_error(libusb_get_max_iso_packet_size(device, endpoint)); -} - -s32 PS4_SYSV_ABI sceUsbdOpen(SceUsbdDevice* device, SceUsbdDeviceHandle** dev_handle) { - LOG_DEBUG(Lib_Usbd, "called"); - - return libusb_to_orbis_error(usb_backend->OpenDevice(device, dev_handle)); -} - -void PS4_SYSV_ABI sceUsbdClose(SceUsbdDeviceHandle* dev_handle) { - LOG_DEBUG(Lib_Usbd, "called"); - - usb_backend->CloseDevice(dev_handle); -} - -SceUsbdDevice* PS4_SYSV_ABI sceUsbdGetDevice(SceUsbdDeviceHandle* dev_handle) { - LOG_DEBUG(Lib_Usbd, "called"); - - return usb_backend->GetDevice(dev_handle); -} - -s32 PS4_SYSV_ABI sceUsbdSetConfiguration(SceUsbdDeviceHandle* dev_handle, s32 config) { - LOG_DEBUG(Lib_Usbd, "called"); - - return libusb_to_orbis_error(usb_backend->SetConfiguration(dev_handle, config)); -} - -s32 PS4_SYSV_ABI sceUsbdClaimInterface(SceUsbdDeviceHandle* dev_handle, s32 interface_number) { - LOG_DEBUG(Lib_Usbd, "called"); - - if (sceUsbdKernelDriverActive(dev_handle, interface_number)) { - sceUsbdDetachKernelDriver(dev_handle, interface_number); - } - - return libusb_to_orbis_error(usb_backend->ClaimInterface(dev_handle, interface_number)); -} - -s32 PS4_SYSV_ABI sceUsbdReleaseInterface(SceUsbdDeviceHandle* dev_handle, s32 interface_number) { - LOG_DEBUG(Lib_Usbd, "called"); - - return libusb_to_orbis_error(libusb_release_interface(dev_handle, interface_number)); -} - -SceUsbdDeviceHandle* PS4_SYSV_ABI sceUsbdOpenDeviceWithVidPid(u16 vendor_id, u16 product_id) { - LOG_DEBUG(Lib_Usbd, "called"); - - return usb_backend->OpenDeviceWithVidPid(vendor_id, product_id); -} - -s32 PS4_SYSV_ABI sceUsbdSetInterfaceAltSetting(SceUsbdDeviceHandle* dev_handle, - int interface_number, int alternate_setting) { - LOG_DEBUG(Lib_Usbd, "called"); - - return libusb_to_orbis_error( - libusb_set_interface_alt_setting(dev_handle, interface_number, alternate_setting)); -} - -s32 PS4_SYSV_ABI sceUsbdClearHalt(SceUsbdDeviceHandle* dev_handle, uint8_t endpoint) { - LOG_DEBUG(Lib_Usbd, "called"); - - return libusb_to_orbis_error(libusb_clear_halt(dev_handle, endpoint)); -} - -s32 PS4_SYSV_ABI sceUsbdResetDevice(SceUsbdDeviceHandle* dev_handle) { - LOG_DEBUG(Lib_Usbd, "called"); - - return libusb_to_orbis_error(usb_backend->ResetDevice(dev_handle)); -} - -s32 PS4_SYSV_ABI sceUsbdKernelDriverActive(SceUsbdDeviceHandle* dev_handle, int interface_number) { - LOG_DEBUG(Lib_Usbd, "called"); - - return libusb_to_orbis_error(usb_backend->KernelDriverActive(dev_handle, interface_number)); -} - -s32 PS4_SYSV_ABI sceUsbdDetachKernelDriver(SceUsbdDeviceHandle* dev_handle, int interface_number) { - LOG_DEBUG(Lib_Usbd, "called"); - - return libusb_to_orbis_error(usb_backend->DetachKernelDriver(dev_handle, interface_number)); -} - -s32 PS4_SYSV_ABI sceUsbdAttachKernelDriver(SceUsbdDeviceHandle* dev_handle, int interface_number) { - LOG_DEBUG(Lib_Usbd, "called"); - - return libusb_to_orbis_error(usb_backend->AttachKernelDriver(dev_handle, interface_number)); -} - -u8* PS4_SYSV_ABI sceUsbdControlTransferGetData(SceUsbdTransfer* transfer) { - LOG_DEBUG(Lib_Usbd, "called"); - - return libusb_control_transfer_get_data(transfer); -} - -SceUsbdControlSetup* PS4_SYSV_ABI sceUsbdControlTransferGetSetup(SceUsbdTransfer* transfer) { - LOG_DEBUG(Lib_Usbd, "called"); - - return libusb_control_transfer_get_setup(transfer); -} - -void PS4_SYSV_ABI sceUsbdFillControlSetup(u8* buf, u8 bmRequestType, u8 bRequest, u16 wValue, - u16 wIndex, u16 wLength) { - LOG_DEBUG(Lib_Usbd, "called"); - - return libusb_fill_control_setup(buf, bmRequestType, bRequest, wValue, wIndex, wLength); -} - -SceUsbdTransfer* PS4_SYSV_ABI sceUsbdAllocTransfer(int iso_packets) { - LOG_DEBUG(Lib_Usbd, "called"); - - return libusb_alloc_transfer(iso_packets); -} - -s32 PS4_SYSV_ABI sceUsbdSubmitTransfer(SceUsbdTransfer* transfer) { - LOG_DEBUG(Lib_Usbd, "called"); - - return libusb_to_orbis_error(usb_backend->SubmitTransfer(transfer)); -} - -s32 PS4_SYSV_ABI sceUsbdCancelTransfer(SceUsbdTransfer* transfer) { - LOG_DEBUG(Lib_Usbd, "called"); - - return libusb_to_orbis_error(libusb_cancel_transfer(transfer)); -} - -void PS4_SYSV_ABI sceUsbdFreeTransfer(SceUsbdTransfer* transfer) { - LOG_DEBUG(Lib_Usbd, "called"); - - libusb_free_transfer(transfer); -} - -void PS4_SYSV_ABI sceUsbdFillControlTransfer(SceUsbdTransfer* transfer, - SceUsbdDeviceHandle* dev_handle, u8* buffer, - SceUsbdTransferCallback callback, void* user_data, - u32 timeout) { - LOG_DEBUG(Lib_Usbd, "called"); - - libusb_fill_control_transfer(transfer, dev_handle, buffer, callback, user_data, timeout); -} - -void PS4_SYSV_ABI sceUsbdFillBulkTransfer(SceUsbdTransfer* transfer, - SceUsbdDeviceHandle* dev_handle, uint8_t endpoint, - u8* buffer, s32 length, SceUsbdTransferCallback callback, - void* user_data, u32 timeout) { - LOG_DEBUG(Lib_Usbd, "called"); - - libusb_fill_bulk_transfer(transfer, dev_handle, endpoint, buffer, length, callback, user_data, - timeout); -} - -void PS4_SYSV_ABI sceUsbdFillInterruptTransfer(SceUsbdTransfer* transfer, - SceUsbdDeviceHandle* dev_handle, uint8_t endpoint, - u8* buffer, s32 length, - SceUsbdTransferCallback callback, void* user_data, - u32 timeout) { - LOG_DEBUG(Lib_Usbd, "called"); - - libusb_fill_interrupt_transfer(transfer, dev_handle, endpoint, buffer, length, callback, - user_data, timeout); -} - -void PS4_SYSV_ABI sceUsbdFillIsoTransfer(SceUsbdTransfer* transfer, SceUsbdDeviceHandle* dev_handle, - uint8_t endpoint, u8* buffer, s32 length, - s32 num_iso_packets, SceUsbdTransferCallback callback, - void* user_data, u32 timeout) { - LOG_DEBUG(Lib_Usbd, "called"); - - libusb_fill_iso_transfer(transfer, dev_handle, endpoint, buffer, length, num_iso_packets, - callback, user_data, timeout); -} - -void PS4_SYSV_ABI sceUsbdSetIsoPacketLengths(SceUsbdTransfer* transfer, u32 length) { - LOG_DEBUG(Lib_Usbd, "called"); - - libusb_set_iso_packet_lengths(transfer, length); -} - -u8* PS4_SYSV_ABI sceUsbdGetIsoPacketBuffer(SceUsbdTransfer* transfer, u32 packet) { - LOG_DEBUG(Lib_Usbd, "called"); - - return libusb_get_iso_packet_buffer(transfer, packet); -} - -s32 PS4_SYSV_ABI sceUsbdControlTransfer(SceUsbdDeviceHandle* dev_handle, u8 request_type, - u8 bRequest, u16 wValue, u16 wIndex, u8* data, s32 wLength, - u32 timeout) { - LOG_DEBUG(Lib_Usbd, "called"); - - return libusb_to_orbis_error(usb_backend->ControlTransfer( - dev_handle, request_type, bRequest, wValue, wIndex, data, wLength, timeout)); -} - -s32 PS4_SYSV_ABI sceUsbdBulkTransfer(SceUsbdDeviceHandle* dev_handle, u8 endpoint, u8* data, - s32 length, s32* actual_length, u32 timeout) { - LOG_DEBUG(Lib_Usbd, "called"); - - return libusb_to_orbis_error( - libusb_bulk_transfer(dev_handle, endpoint, data, length, actual_length, timeout)); -} - -s32 PS4_SYSV_ABI sceUsbdInterruptTransfer(SceUsbdDeviceHandle* dev_handle, u8 endpoint, u8* data, - s32 length, s32* actual_length, u32 timeout) { - LOG_DEBUG(Lib_Usbd, "called"); - - return libusb_to_orbis_error( - libusb_interrupt_transfer(dev_handle, endpoint, data, length, actual_length, timeout)); -} - -s32 PS4_SYSV_ABI sceUsbdGetDescriptor(SceUsbdDeviceHandle* dev_handle, u8 descType, u8 descIndex, - u8* data, s32 length) { - LOG_DEBUG(Lib_Usbd, "called"); - - return libusb_to_orbis_error( - libusb_get_descriptor(dev_handle, descType, descIndex, data, length)); -} - -s32 PS4_SYSV_ABI sceUsbdGetStringDescriptor(SceUsbdDeviceHandle* dev_handle, u8 desc_index, - u16 langid, u8* data, s32 length) { - LOG_DEBUG(Lib_Usbd, "called"); - - return libusb_to_orbis_error( - libusb_get_string_descriptor(dev_handle, desc_index, langid, data, length)); -} - -s32 PS4_SYSV_ABI sceUsbdGetStringDescriptorAscii(SceUsbdDeviceHandle* dev_handle, u8 desc_index, - u8* data, s32 length) { - LOG_DEBUG(Lib_Usbd, "called"); - - return libusb_to_orbis_error( - libusb_get_string_descriptor_ascii(dev_handle, desc_index, data, length)); -} - -s32 PS4_SYSV_ABI sceUsbdTryLockEvents() { - LOG_DEBUG(Lib_Usbd, "called"); - - return usb_backend->TryLockEvents(); -} - -void PS4_SYSV_ABI sceUsbdLockEvents() { - LOG_DEBUG(Lib_Usbd, "called"); - - usb_backend->LockEvents(); -} - -void PS4_SYSV_ABI sceUsbdUnlockEvents() { - LOG_DEBUG(Lib_Usbd, "called"); - - usb_backend->UnlockEvents(); -} - -s32 PS4_SYSV_ABI sceUsbdEventHandlingOk() { - LOG_DEBUG(Lib_Usbd, "called"); - - return usb_backend->EventHandlingOk(); -} - -s32 PS4_SYSV_ABI sceUsbdEventHandlerActive() { - LOG_DEBUG(Lib_Usbd, "called"); - - return usb_backend->EventHandlerActive(); -} - -void PS4_SYSV_ABI sceUsbdLockEventWaiters() { - LOG_DEBUG(Lib_Usbd, "called"); - - usb_backend->LockEventWaiters(); -} - -void PS4_SYSV_ABI sceUsbdUnlockEventWaiters() { - LOG_DEBUG(Lib_Usbd, "called"); - - usb_backend->UnlockEventWaiters(); -} - -s32 PS4_SYSV_ABI sceUsbdWaitForEvent(timeval* tv) { - LOG_DEBUG(Lib_Usbd, "called"); - - return libusb_to_orbis_error(usb_backend->WaitForEvent(tv)); -} - -s32 PS4_SYSV_ABI sceUsbdHandleEventsTimeout(timeval* tv) { - LOG_DEBUG(Lib_Usbd, "called"); - - return libusb_to_orbis_error(usb_backend->HandleEventsTimeout(tv)); -} - -s32 PS4_SYSV_ABI sceUsbdHandleEvents() { - LOG_DEBUG(Lib_Usbd, "called"); - - return libusb_to_orbis_error(usb_backend->HandleEvents()); -} - -s32 PS4_SYSV_ABI sceUsbdHandleEventsLocked(timeval* tv) { - LOG_DEBUG(Lib_Usbd, "called"); - - return libusb_to_orbis_error(usb_backend->HandleEventsTimeout(tv)); -} - -s32 PS4_SYSV_ABI sceUsbdCheckConnected(SceUsbdDeviceHandle* dev_handle) { - LOG_DEBUG(Lib_Usbd, "called"); - - return libusb_to_orbis_error(usb_backend->CheckConnected(dev_handle)); -} - -int PS4_SYSV_ABI Func_65F6EF33E38FFF50() { - LOG_ERROR(Lib_Usbd, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI Func_97F056BAD90AADE7() { - LOG_ERROR(Lib_Usbd, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI Func_C55104A33B35B264() { - LOG_ERROR(Lib_Usbd, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI Func_D56B43060720B1E0() { - LOG_ERROR(Lib_Usbd, "(STUBBED) called"); - return ORBIS_OK; -} - -void RegisterLib(Core::Loader::SymbolsResolver* sym) { - switch (EmulatorSettings.GetUsbDeviceBackend()) { - case UsbBackendType::SkylandersPortal: - usb_backend = std::make_shared(); - break; - case UsbBackendType::InfinityBase: - usb_backend = std::make_shared(); - break; - case UsbBackendType::DimensionsToypad: - usb_backend = std::make_shared(); - break; - default: - usb_backend = std::make_shared(); - break; - } - - LIB_FUNCTION("0ktE1PhzGFU", "libSceUsbd", 1, "libSceUsbd", sceUsbdAllocTransfer); - LIB_FUNCTION("BKMEGvfCPyU", "libSceUsbd", 1, "libSceUsbd", sceUsbdAttachKernelDriver); - LIB_FUNCTION("fotb7DzeHYw", "libSceUsbd", 1, "libSceUsbd", sceUsbdBulkTransfer); - LIB_FUNCTION("-KNh1VFIzlM", "libSceUsbd", 1, "libSceUsbd", sceUsbdCancelTransfer); - LIB_FUNCTION("MlW6deWfPp0", "libSceUsbd", 1, "libSceUsbd", sceUsbdCheckConnected); - LIB_FUNCTION("AE+mHBHneyk", "libSceUsbd", 1, "libSceUsbd", sceUsbdClaimInterface); - LIB_FUNCTION("3tPPMo4QRdY", "libSceUsbd", 1, "libSceUsbd", sceUsbdClearHalt); - LIB_FUNCTION("HarYYlaFGJY", "libSceUsbd", 1, "libSceUsbd", sceUsbdClose); - LIB_FUNCTION("RRKFcKQ1Ka4", "libSceUsbd", 1, "libSceUsbd", sceUsbdControlTransfer); - LIB_FUNCTION("XUWtxI31YEY", "libSceUsbd", 1, "libSceUsbd", sceUsbdControlTransferGetData); - LIB_FUNCTION("SEdQo8CFmus", "libSceUsbd", 1, "libSceUsbd", sceUsbdControlTransferGetSetup); - LIB_FUNCTION("Y5go+ha6eDs", "libSceUsbd", 1, "libSceUsbd", sceUsbdDetachKernelDriver); - LIB_FUNCTION("Vw8Hg1CN028", "libSceUsbd", 1, "libSceUsbd", sceUsbdEventHandlerActive); - LIB_FUNCTION("e7gp1xhu6RI", "libSceUsbd", 1, "libSceUsbd", sceUsbdEventHandlingOk); - LIB_FUNCTION("Fq6+0Fm55xU", "libSceUsbd", 1, "libSceUsbd", sceUsbdExit); - LIB_FUNCTION("oHCade-0qQ0", "libSceUsbd", 1, "libSceUsbd", sceUsbdFillBulkTransfer); - LIB_FUNCTION("8KrqbaaPkE0", "libSceUsbd", 1, "libSceUsbd", sceUsbdFillControlSetup); - LIB_FUNCTION("7VGfMerK6m0", "libSceUsbd", 1, "libSceUsbd", sceUsbdFillControlTransfer); - LIB_FUNCTION("t3J5pXxhJlI", "libSceUsbd", 1, "libSceUsbd", sceUsbdFillInterruptTransfer); - LIB_FUNCTION("xqmkjHCEOSY", "libSceUsbd", 1, "libSceUsbd", sceUsbdFillIsoTransfer); - LIB_FUNCTION("Hvd3S--n25w", "libSceUsbd", 1, "libSceUsbd", sceUsbdFreeConfigDescriptor); - LIB_FUNCTION("EQ6SCLMqzkM", "libSceUsbd", 1, "libSceUsbd", sceUsbdFreeDeviceList); - LIB_FUNCTION("-sgi7EeLSO8", "libSceUsbd", 1, "libSceUsbd", sceUsbdFreeTransfer); - LIB_FUNCTION("S1o1C6yOt5g", "libSceUsbd", 1, "libSceUsbd", sceUsbdGetActiveConfigDescriptor); - LIB_FUNCTION("t7WE9mb1TB8", "libSceUsbd", 1, "libSceUsbd", sceUsbdGetBusNumber); - LIB_FUNCTION("Dkm5qe8j3XE", "libSceUsbd", 1, "libSceUsbd", sceUsbdGetConfigDescriptor); - LIB_FUNCTION("GQsAVJuy8gM", "libSceUsbd", 1, "libSceUsbd", sceUsbdGetConfigDescriptorByValue); - LIB_FUNCTION("L7FoTZp3bZs", "libSceUsbd", 1, "libSceUsbd", sceUsbdGetConfiguration); - LIB_FUNCTION("-JBoEtvTxvA", "libSceUsbd", 1, "libSceUsbd", sceUsbdGetDescriptor); - LIB_FUNCTION("rsl9KQ-agyA", "libSceUsbd", 1, "libSceUsbd", sceUsbdGetDevice); - LIB_FUNCTION("GjlCrU4GcIY", "libSceUsbd", 1, "libSceUsbd", sceUsbdGetDeviceAddress); - LIB_FUNCTION("bhomgbiQgeo", "libSceUsbd", 1, "libSceUsbd", sceUsbdGetDeviceDescriptor); - LIB_FUNCTION("8qB9Ar4P5nc", "libSceUsbd", 1, "libSceUsbd", sceUsbdGetDeviceList); - LIB_FUNCTION("e1UWb8cWPJM", "libSceUsbd", 1, "libSceUsbd", sceUsbdGetDeviceSpeed); - LIB_FUNCTION("vokkJ0aDf54", "libSceUsbd", 1, "libSceUsbd", sceUsbdGetIsoPacketBuffer); - LIB_FUNCTION("nuIRlpbxauM", "libSceUsbd", 1, "libSceUsbd", sceUsbdGetMaxIsoPacketSize); - LIB_FUNCTION("YJ0cMAlLuxQ", "libSceUsbd", 1, "libSceUsbd", sceUsbdGetMaxPacketSize); - LIB_FUNCTION("g2oYm1DitDg", "libSceUsbd", 1, "libSceUsbd", sceUsbdGetStringDescriptor); - LIB_FUNCTION("t4gUfGsjk+g", "libSceUsbd", 1, "libSceUsbd", sceUsbdGetStringDescriptorAscii); - LIB_FUNCTION("EkqGLxWC-S0", "libSceUsbd", 1, "libSceUsbd", sceUsbdHandleEvents); - LIB_FUNCTION("rt-WeUGibfg", "libSceUsbd", 1, "libSceUsbd", sceUsbdHandleEventsLocked); - LIB_FUNCTION("+wU6CGuZcWk", "libSceUsbd", 1, "libSceUsbd", sceUsbdHandleEventsTimeout); - LIB_FUNCTION("TOhg7P6kTH4", "libSceUsbd", 1, "libSceUsbd", sceUsbdInit); - LIB_FUNCTION("rxi1nCOKWc8", "libSceUsbd", 1, "libSceUsbd", sceUsbdInterruptTransfer); - LIB_FUNCTION("RLf56F-WjKQ", "libSceUsbd", 1, "libSceUsbd", sceUsbdKernelDriverActive); - LIB_FUNCTION("u9yKks02-rA", "libSceUsbd", 1, "libSceUsbd", sceUsbdLockEvents); - LIB_FUNCTION("AeGaY8JrAV4", "libSceUsbd", 1, "libSceUsbd", sceUsbdLockEventWaiters); - LIB_FUNCTION("VJ6oMq-Di2U", "libSceUsbd", 1, "libSceUsbd", sceUsbdOpen); - LIB_FUNCTION("vrQXYRo1Gwk", "libSceUsbd", 1, "libSceUsbd", sceUsbdOpenDeviceWithVidPid); - LIB_FUNCTION("U1t1SoJvV-A", "libSceUsbd", 1, "libSceUsbd", sceUsbdRefDevice); - LIB_FUNCTION("REfUTmTchMw", "libSceUsbd", 1, "libSceUsbd", sceUsbdReleaseInterface); - LIB_FUNCTION("hvMn0QJXj5g", "libSceUsbd", 1, "libSceUsbd", sceUsbdResetDevice); - LIB_FUNCTION("FhU9oYrbXoA", "libSceUsbd", 1, "libSceUsbd", sceUsbdSetConfiguration); - LIB_FUNCTION("DVCQW9o+ki0", "libSceUsbd", 1, "libSceUsbd", sceUsbdSetInterfaceAltSetting); - LIB_FUNCTION("dJxro8Nzcjk", "libSceUsbd", 1, "libSceUsbd", sceUsbdSetIsoPacketLengths); - LIB_FUNCTION("L0EHgZZNVas", "libSceUsbd", 1, "libSceUsbd", sceUsbdSubmitTransfer); - LIB_FUNCTION("TcXVGc-LPbQ", "libSceUsbd", 1, "libSceUsbd", sceUsbdTryLockEvents); - LIB_FUNCTION("RA2D9rFH-Uw", "libSceUsbd", 1, "libSceUsbd", sceUsbdUnlockEvents); - LIB_FUNCTION("1DkGvUQYFKI", "libSceUsbd", 1, "libSceUsbd", sceUsbdUnlockEventWaiters); - LIB_FUNCTION("OULgIo1zAsA", "libSceUsbd", 1, "libSceUsbd", sceUsbdUnrefDevice); - LIB_FUNCTION("ys2e9VRBPrY", "libSceUsbd", 1, "libSceUsbd", sceUsbdWaitForEvent); - LIB_FUNCTION("ZfbvM+OP-1A", "libSceUsbd", 1, "libSceUsbd", Func_65F6EF33E38FFF50); - LIB_FUNCTION("l-BWutkKrec", "libSceUsbd", 1, "libSceUsbd", Func_97F056BAD90AADE7); - LIB_FUNCTION("xVEEozs1smQ", "libSceUsbd", 1, "libSceUsbd", Func_C55104A33B35B264); - LIB_FUNCTION("1WtDBgcgseA", "libSceUsbd", 1, "libSceUsbd", Func_D56B43060720B1E0); -}; - -} // namespace Libraries::Usbd \ No newline at end of file diff --git a/src/core/libraries/usbd/usbd.h b/src/core/libraries/usbd/usbd.h deleted file mode 100644 index fef9d6871..000000000 --- a/src/core/libraries/usbd/usbd.h +++ /dev/null @@ -1,164 +0,0 @@ -// SPDX - FileCopyrightText : Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "common/types.h" -#include "emulated/dimensions.h" -#include "emulated/infinity.h" -#include "emulated/skylander.h" -#include "usb_backend.h" - -extern "C" { -struct libusb_device; -struct libusb_device_handle; -struct libusb_device_descriptor; -struct libusb_config_descriptor; -struct libusb_transfer; -struct libusb_control_setup; -struct timeval; -} - -namespace Core::Loader { -class SymbolsResolver; -} - -namespace Libraries::Usbd { - -extern std::shared_ptr usb_backend; - -using SceUsbdDevice = libusb_device; -using SceUsbdDeviceHandle = libusb_device_handle; -using SceUsbdDeviceDescriptor = libusb_device_descriptor; -using SceUsbdConfigDescriptor = libusb_config_descriptor; -using SceUsbdTransfer = libusb_transfer; -using SceUsbdControlSetup = libusb_control_setup; -using SceUsbdTransferCallback = void PS4_SYSV_ABI (*)(SceUsbdTransfer* transfer); - -using SkylandersPortalBackend = SkylanderBackend; -using InfinityBaseBackend = InfinityBackend; -using DimensionsToypadBackend = DimensionsBackend; - -enum class SceUsbdSpeed : u32 { - UNKNOWN = 0, - LOW = 1, - FULL = 2, - HIGH = 3, - SUPER = 4, - SUPER_PLUS = 5 -}; - -s32 PS4_SYSV_ABI sceUsbdInit(); -void PS4_SYSV_ABI sceUsbdExit(); - -s64 PS4_SYSV_ABI sceUsbdGetDeviceList(SceUsbdDevice*** list); -void PS4_SYSV_ABI sceUsbdFreeDeviceList(SceUsbdDevice** list, s32 unref_devices); - -SceUsbdDevice* PS4_SYSV_ABI sceUsbdRefDevice(SceUsbdDevice* device); -void PS4_SYSV_ABI sceUsbdUnrefDevice(SceUsbdDevice* device); - -s32 PS4_SYSV_ABI sceUsbdGetConfiguration(SceUsbdDeviceHandle* dev_handle, s32* config); -s32 PS4_SYSV_ABI sceUsbdGetDeviceDescriptor(SceUsbdDevice* device, SceUsbdDeviceDescriptor* desc); -s32 PS4_SYSV_ABI sceUsbdGetActiveConfigDescriptor(SceUsbdDevice* device, - SceUsbdConfigDescriptor** config); -s32 PS4_SYSV_ABI sceUsbdGetConfigDescriptor(SceUsbdDevice* device, u8 config_index, - SceUsbdConfigDescriptor** config); -s32 PS4_SYSV_ABI sceUsbdGetConfigDescriptorByValue(SceUsbdDevice* device, u8 bConfigurationValue, - SceUsbdConfigDescriptor** config); -void PS4_SYSV_ABI sceUsbdFreeConfigDescriptor(SceUsbdConfigDescriptor* config); - -u8 PS4_SYSV_ABI sceUsbdGetBusNumber(SceUsbdDevice* device); -u8 PS4_SYSV_ABI sceUsbdGetDeviceAddress(SceUsbdDevice* device); - -SceUsbdSpeed PS4_SYSV_ABI sceUsbdGetDeviceSpeed(SceUsbdDevice* device); -s32 PS4_SYSV_ABI sceUsbdGetMaxPacketSize(SceUsbdDevice* device, u8 endpoint); -s32 PS4_SYSV_ABI sceUsbdGetMaxIsoPacketSize(SceUsbdDevice* device, u8 endpoint); - -s32 PS4_SYSV_ABI sceUsbdOpen(SceUsbdDevice* device, SceUsbdDeviceHandle** dev_handle); -void PS4_SYSV_ABI sceUsbdClose(SceUsbdDeviceHandle* dev_handle); -SceUsbdDevice* PS4_SYSV_ABI sceUsbdGetDevice(SceUsbdDeviceHandle* dev_handle); - -s32 PS4_SYSV_ABI sceUsbdSetConfiguration(SceUsbdDeviceHandle* dev_handle, s32 config); -s32 PS4_SYSV_ABI sceUsbdClaimInterface(SceUsbdDeviceHandle* dev_handle, s32 interface_number); -s32 PS4_SYSV_ABI sceUsbdReleaseInterface(SceUsbdDeviceHandle* dev_handle, s32 interface_number); - -SceUsbdDeviceHandle* PS4_SYSV_ABI sceUsbdOpenDeviceWithVidPid(u16 vendor_id, u16 product_id); - -s32 PS4_SYSV_ABI sceUsbdSetInterfaceAltSetting(SceUsbdDeviceHandle* dev_handle, - int interface_number, int alternate_setting); -s32 PS4_SYSV_ABI sceUsbdClearHalt(SceUsbdDeviceHandle* dev_handle, u8 endpoint); -s32 PS4_SYSV_ABI sceUsbdResetDevice(SceUsbdDeviceHandle* dev_handle); - -s32 PS4_SYSV_ABI sceUsbdKernelDriverActive(SceUsbdDeviceHandle* dev_handle, int interface_number); -s32 PS4_SYSV_ABI sceUsbdDetachKernelDriver(SceUsbdDeviceHandle* dev_handle, int interface_number); -s32 PS4_SYSV_ABI sceUsbdAttachKernelDriver(SceUsbdDeviceHandle* dev_handle, int interface_number); - -u8* PS4_SYSV_ABI sceUsbdControlTransferGetData(SceUsbdTransfer* transfer); -SceUsbdControlSetup* PS4_SYSV_ABI sceUsbdControlTransferGetSetup(SceUsbdTransfer* transfer); - -void PS4_SYSV_ABI sceUsbdFillControlSetup(u8* buf, u8 bmRequestType, u8 bRequest, u16 wValue, - u16 wIndex, u16 wLength); - -SceUsbdTransfer* PS4_SYSV_ABI sceUsbdAllocTransfer(int iso_packets); -s32 PS4_SYSV_ABI sceUsbdSubmitTransfer(SceUsbdTransfer* transfer); -s32 PS4_SYSV_ABI sceUsbdCancelTransfer(SceUsbdTransfer* transfer); -void PS4_SYSV_ABI sceUsbdFreeTransfer(SceUsbdTransfer* transfer); - -void PS4_SYSV_ABI sceUsbdFillControlTransfer(SceUsbdTransfer* transfer, - SceUsbdDeviceHandle* dev_handle, u8* buffer, - SceUsbdTransferCallback callback, void* user_data, - u32 timeout); -void PS4_SYSV_ABI sceUsbdFillBulkTransfer(SceUsbdTransfer* transfer, - SceUsbdDeviceHandle* dev_handle, u8 endpoint, u8* buffer, - s32 length, SceUsbdTransferCallback callback, - void* user_data, u32 timeout); -void PS4_SYSV_ABI sceUsbdFillInterruptTransfer(SceUsbdTransfer* transfer, - SceUsbdDeviceHandle* dev_handle, u8 endpoint, - u8* buffer, s32 length, - SceUsbdTransferCallback callback, void* user_data, - u32 timeout); -void PS4_SYSV_ABI sceUsbdFillIsoTransfer(SceUsbdTransfer* transfer, SceUsbdDeviceHandle* dev_handle, - u8 endpoint, u8* buffer, s32 length, s32 num_iso_packets, - SceUsbdTransferCallback callback, void* userData, - u32 timeout); - -void PS4_SYSV_ABI sceUsbdSetIsoPacketLengths(SceUsbdTransfer* transfer, u32 length); -u8* PS4_SYSV_ABI sceUsbdGetIsoPacketBuffer(SceUsbdTransfer* transfer, u32 packet); - -s32 PS4_SYSV_ABI sceUsbdControlTransfer(SceUsbdDeviceHandle* dev_handle, u8 request_type, - u8 bRequest, u16 wValue, u16 wIndex, u8* data, s32 wLength, - u32 timeout); -s32 PS4_SYSV_ABI sceUsbdBulkTransfer(SceUsbdDeviceHandle* dev_handle, u8 endpoint, u8* data, - s32 length, s32* actual_length, u32 timeout); -s32 PS4_SYSV_ABI sceUsbdInterruptTransfer(SceUsbdDeviceHandle* dev_handle, u8 endpoint, u8* data, - s32 length, s32* actual_length, u32 timeout); - -s32 PS4_SYSV_ABI sceUsbdGetDescriptor(SceUsbdDeviceHandle* dev_handle, u8 descType, u8 descIndex, - u8* data, s32 length); -s32 PS4_SYSV_ABI sceUsbdGetStringDescriptor(SceUsbdDeviceHandle* dev_handle, u8 desc_index, - u16 langid, u8* data, s32 length); -s32 PS4_SYSV_ABI sceUsbdGetStringDescriptorAscii(SceUsbdDeviceHandle* dev_handle, u8 desc_index, - u8* data, s32 length); - -s32 PS4_SYSV_ABI sceUsbdTryLockEvents(); -void PS4_SYSV_ABI sceUsbdLockEvents(); -void PS4_SYSV_ABI sceUsbdUnlockEvents(); -s32 PS4_SYSV_ABI sceUsbdEventHandlingOk(); -s32 PS4_SYSV_ABI sceUsbdEventHandlerActive(); -void PS4_SYSV_ABI sceUsbdLockEventWaiters(); -void PS4_SYSV_ABI sceUsbdUnlockEventWaiters(); -s32 PS4_SYSV_ABI sceUsbdWaitForEvent(timeval* tv); - -s32 PS4_SYSV_ABI sceUsbdHandleEventsTimeout(timeval* tv); -s32 PS4_SYSV_ABI sceUsbdHandleEvents(); -s32 PS4_SYSV_ABI sceUsbdHandleEventsLocked(timeval* tv); - -s32 PS4_SYSV_ABI sceUsbdCheckConnected(SceUsbdDeviceHandle* dev_handle); - -int PS4_SYSV_ABI Func_65F6EF33E38FFF50(); -int PS4_SYSV_ABI Func_97F056BAD90AADE7(); -int PS4_SYSV_ABI Func_C55104A33B35B264(); -int PS4_SYSV_ABI Func_D56B43060720B1E0(); - -void RegisterLib(Core::Loader::SymbolsResolver* sym); -} // namespace Libraries::Usbd \ No newline at end of file diff --git a/src/core/libraries/videodec/videodec.cpp b/src/core/libraries/videodec/videodec.cpp deleted file mode 100644 index 80fe7df99..000000000 --- a/src/core/libraries/videodec/videodec.cpp +++ /dev/null @@ -1,145 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "common/logging/log.h" -#include "core/libraries/libs.h" -#include "core/libraries/videodec/videodec.h" -#include "core/libraries/videodec/videodec_error.h" -#include "core/libraries/videodec/videodec_impl.h" - -namespace Libraries::Videodec { - -static constexpr u64 kMinimumMemorySize = 16_MB; ///> Fake minimum memory size for querying - -int PS4_SYSV_ABI sceVideodecCreateDecoder(const OrbisVideodecConfigInfo* pCfgInfoIn, - const OrbisVideodecResourceInfo* pRsrcInfoIn, - OrbisVideodecCtrl* pCtrlOut) { - LOG_INFO(Lib_Videodec, "called"); - - if (!pCfgInfoIn || !pRsrcInfoIn || !pCtrlOut) { - LOG_ERROR(Lib_Videodec, "Invalid arguments"); - return ORBIS_VIDEODEC_ERROR_ARGUMENT_POINTER; - } - if (pCfgInfoIn->thisSize != sizeof(OrbisVideodecConfigInfo) || - pRsrcInfoIn->thisSize != sizeof(OrbisVideodecResourceInfo)) { - LOG_ERROR(Lib_Videodec, "Invalid struct size"); - return ORBIS_VIDEODEC_ERROR_STRUCT_SIZE; - } - - VdecDecoder* decoder = new VdecDecoder(*pCfgInfoIn, *pRsrcInfoIn); - pCtrlOut->thisSize = sizeof(OrbisVideodecCtrl); - pCtrlOut->handle = decoder; - pCtrlOut->version = 1; //??? - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceVideodecDecode(OrbisVideodecCtrl* pCtrlIn, - const OrbisVideodecInputData* pInputDataIn, - OrbisVideodecFrameBuffer* pFrameBufferInOut, - OrbisVideodecPictureInfo* pPictureInfoOut) { - LOG_TRACE(Lib_Videodec, "called"); - if (!pCtrlIn || !pInputDataIn || !pPictureInfoOut) { - LOG_ERROR(Lib_Videodec, "Invalid arguments"); - return ORBIS_VIDEODEC_ERROR_ARGUMENT_POINTER; - } - if (pCtrlIn->thisSize != sizeof(OrbisVideodecCtrl) || - pFrameBufferInOut->thisSize != sizeof(OrbisVideodecFrameBuffer)) { - LOG_ERROR(Lib_Videodec, "Invalid struct size"); - return ORBIS_VIDEODEC_ERROR_STRUCT_SIZE; - } - - VdecDecoder* decoder = (VdecDecoder*)pCtrlIn->handle; - if (!decoder) { - LOG_ERROR(Lib_Videodec, "Invalid decoder handle"); - return ORBIS_VIDEODEC_ERROR_HANDLE; - } - return decoder->Decode(*pInputDataIn, *pFrameBufferInOut, *pPictureInfoOut); -} - -int PS4_SYSV_ABI sceVideodecDeleteDecoder(OrbisVideodecCtrl* pCtrlIn) { - LOG_INFO(Lib_Videodec, "(STUBBED) called"); - - VdecDecoder* decoder = (VdecDecoder*)pCtrlIn->handle; - if (!decoder) { - LOG_ERROR(Lib_Videodec, "Invalid decoder handle"); - return ORBIS_VIDEODEC_ERROR_HANDLE; - } - delete decoder; - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceVideodecFlush(OrbisVideodecCtrl* pCtrlIn, - OrbisVideodecFrameBuffer* pFrameBufferInOut, - OrbisVideodecPictureInfo* pPictureInfoOut) { - LOG_INFO(Lib_Videodec, "called"); - - if (!pFrameBufferInOut || !pPictureInfoOut) { - LOG_ERROR(Lib_Videodec, "Invalid arguments"); - return ORBIS_VIDEODEC_ERROR_ARGUMENT_POINTER; - } - if (pFrameBufferInOut->thisSize != sizeof(OrbisVideodecFrameBuffer) || - pPictureInfoOut->thisSize != sizeof(OrbisVideodecPictureInfo)) { - LOG_ERROR(Lib_Videodec, "Invalid struct size"); - return ORBIS_VIDEODEC_ERROR_STRUCT_SIZE; - } - - VdecDecoder* decoder = (VdecDecoder*)pCtrlIn->handle; - if (!decoder) { - LOG_ERROR(Lib_Videodec, "Invalid decoder handle"); - return ORBIS_VIDEODEC_ERROR_HANDLE; - } - return decoder->Flush(*pFrameBufferInOut, *pPictureInfoOut); -} - -int PS4_SYSV_ABI sceVideodecMapMemory() { - LOG_ERROR(Lib_Videodec, "(STUBBED) called"); - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceVideodecQueryResourceInfo(const OrbisVideodecConfigInfo* pCfgInfoIn, - OrbisVideodecResourceInfo* pRsrcInfoOut) { - LOG_INFO(Lib_Videodec, "called"); - - if (!pCfgInfoIn || !pRsrcInfoOut) { - LOG_ERROR(Lib_Videodec, "Invalid arguments"); - return ORBIS_VIDEODEC_ERROR_ARGUMENT_POINTER; - } - if (pCfgInfoIn->thisSize != sizeof(OrbisVideodecConfigInfo) || - pRsrcInfoOut->thisSize != sizeof(OrbisVideodecResourceInfo)) { - LOG_ERROR(Lib_Videodec, "Invalid struct size"); - return ORBIS_VIDEODEC_ERROR_STRUCT_SIZE; - } - - pRsrcInfoOut->thisSize = sizeof(OrbisVideodecResourceInfo); - pRsrcInfoOut->pCpuMemory = nullptr; - pRsrcInfoOut->pCpuGpuMemory = nullptr; - - pRsrcInfoOut->cpuGpuMemorySize = kMinimumMemorySize; - pRsrcInfoOut->cpuMemorySize = kMinimumMemorySize; - - pRsrcInfoOut->maxFrameBufferSize = kMinimumMemorySize; - pRsrcInfoOut->frameBufferAlignment = 0x100; - - return ORBIS_OK; -} - -int PS4_SYSV_ABI sceVideodecReset(OrbisVideodecCtrl* pCtrlIn) { - LOG_INFO(Lib_Videodec, "(STUBBED) called"); - - VdecDecoder* decoder = (VdecDecoder*)pCtrlIn->handle; - decoder->Reset(); - return ORBIS_OK; -} - -void RegisterLib(Core::Loader::SymbolsResolver* sym) { - LIB_FUNCTION("qkgRiwHyheU", "libSceVideodec", 1, "libSceVideodec", sceVideodecCreateDecoder); - LIB_FUNCTION("q0W5GJMovMs", "libSceVideodec", 1, "libSceVideodec", sceVideodecDecode); - LIB_FUNCTION("U0kpGF1cl90", "libSceVideodec", 1, "libSceVideodec", sceVideodecDeleteDecoder); - LIB_FUNCTION("jeigLlKdp5I", "libSceVideodec", 1, "libSceVideodec", sceVideodecFlush); - LIB_FUNCTION("kg+lH0V61hM", "libSceVideodec", 1, "libSceVideodec", sceVideodecMapMemory); - LIB_FUNCTION("leCAscipfFY", "libSceVideodec", 1, "libSceVideodec", - sceVideodecQueryResourceInfo); - LIB_FUNCTION("f8AgDv-1X8A", "libSceVideodec", 1, "libSceVideodec", sceVideodecReset); -}; - -} // namespace Libraries::Videodec diff --git a/src/core/libraries/videodec/videodec.h b/src/core/libraries/videodec/videodec.h deleted file mode 100644 index ab4bd9531..000000000 --- a/src/core/libraries/videodec/videodec.h +++ /dev/null @@ -1,108 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "common/types.h" - -namespace Core::Loader { -class SymbolsResolver; -} - -namespace Libraries::Videodec { - -struct OrbisVideodecConfigInfo { - u64 thisSize; - u32 codecType; - u32 profile; - u32 maxLevel; - s32 maxFrameWidth; - s32 maxFrameHeight; - s32 maxDpbFrameCount; - u64 videodecFlags; -}; - -struct OrbisVideodecResourceInfo { - u64 thisSize; - u64 cpuMemorySize; - void* pCpuMemory; - u64 cpuGpuMemorySize; - void* pCpuGpuMemory; - u64 maxFrameBufferSize; - u32 frameBufferAlignment; -}; - -struct OrbisVideodecCtrl { - u64 thisSize; - void* handle; - u64 version; -}; - -struct OrbisVideodecFrameBuffer { - u64 thisSize; - void* pFrameBuffer; - u64 frameBufferSize; -}; - -struct OrbisVideodecAvcInfo { - u32 numUnitsInTick; - u32 timeScale; - u8 fixedFrameRateFlag; - u8 aspectRatioIdc; - u16 sarWidth; - u16 sarHeight; - u8 colourPrimaries; - u8 transferCharacteristics; - u8 matrixCoefficients; - u8 videoFullRangeFlag; - u32 frameCropLeftOffset; - u32 frameCropRightOffset; - u32 frameCropTopOffset; - u32 frameCropBottomOffset; -}; - -union OrbisVideodecCodecInfo { - u8 reserved[64]; - OrbisVideodecAvcInfo avc; -}; - -struct OrbisVideodecPictureInfo { - u64 thisSize; - u32 isValid; - u32 codecType; - u32 frameWidth; - u32 framePitch; - u32 frameHeight; - u32 isErrorPic; - u64 ptsData; - u64 attachedData; - OrbisVideodecCodecInfo codec; -}; - -struct OrbisVideodecInputData { - u64 thisSize; - void* pAuData; - u64 auSize; - u64 ptsData; - u64 dtsData; - u64 attachedData; -}; - -int PS4_SYSV_ABI sceVideodecCreateDecoder(const OrbisVideodecConfigInfo* pCfgInfoIn, - const OrbisVideodecResourceInfo* pRsrcInfoIn, - OrbisVideodecCtrl* pCtrlOut); -int PS4_SYSV_ABI sceVideodecDecode(OrbisVideodecCtrl* pCtrlIn, - const OrbisVideodecInputData* pInputDataIn, - OrbisVideodecFrameBuffer* pFrameBufferInOut, - OrbisVideodecPictureInfo* pPictureInfoOut); -int PS4_SYSV_ABI sceVideodecDeleteDecoder(OrbisVideodecCtrl* pCtrlIn); -int PS4_SYSV_ABI sceVideodecFlush(OrbisVideodecCtrl* pCtrlIn, - OrbisVideodecFrameBuffer* pFrameBufferInOut, - OrbisVideodecPictureInfo* pPictureInfoOut); -int PS4_SYSV_ABI sceVideodecMapMemory(); -int PS4_SYSV_ABI sceVideodecQueryResourceInfo(const OrbisVideodecConfigInfo* pCfgInfoIn, - OrbisVideodecResourceInfo* pRsrcInfoOut); -int PS4_SYSV_ABI sceVideodecReset(OrbisVideodecCtrl* pCtrlIn); - -void RegisterLib(Core::Loader::SymbolsResolver* sym); -} // namespace Libraries::Videodec \ No newline at end of file diff --git a/src/core/libraries/videodec/videodec2.cpp b/src/core/libraries/videodec/videodec2.cpp deleted file mode 100644 index 121818f39..000000000 --- a/src/core/libraries/videodec/videodec2.cpp +++ /dev/null @@ -1,264 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "common/assert.h" -#include "common/logging/log.h" -#include "core/libraries/libs.h" -#include "core/libraries/videodec/videodec2.h" -#include "core/libraries/videodec/videodec2_impl.h" -#include "core/libraries/videodec/videodec_error.h" - -namespace Libraries::Videodec2 { - -static constexpr u64 kMinimumMemorySize = 16_MB; ///> Fake minimum memory size for querying - -s32 PS4_SYSV_ABI -sceVideodec2QueryComputeMemoryInfo(OrbisVideodec2ComputeMemoryInfo* computeMemInfo) { - LOG_INFO(Lib_Vdec2, "called"); - - if (!computeMemInfo) { - LOG_ERROR(Lib_Vdec2, "Invalid arguments"); - return ORBIS_VIDEODEC2_ERROR_ARGUMENT_POINTER; - } - if (computeMemInfo->thisSize != sizeof(OrbisVideodec2ComputeMemoryInfo)) { - LOG_ERROR(Lib_Vdec2, "Invalid struct size"); - return ORBIS_VIDEODEC2_ERROR_STRUCT_SIZE; - } - - computeMemInfo->cpuGpuMemory = nullptr; - computeMemInfo->cpuGpuMemorySize = kMinimumMemorySize; - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI -sceVideodec2AllocateComputeQueue(const OrbisVideodec2ComputeConfigInfo* computeCfgInfo, - const OrbisVideodec2ComputeMemoryInfo* computeMemInfo, - OrbisVideodec2ComputeQueue* computeQueue) { - LOG_WARNING(Lib_Vdec2, "called"); - if (!computeCfgInfo || !computeMemInfo || !computeQueue) { - LOG_ERROR(Lib_Vdec2, "Invalid arguments"); - return ORBIS_VIDEODEC2_ERROR_ARGUMENT_POINTER; - } - if (computeCfgInfo->thisSize != sizeof(OrbisVideodec2ComputeConfigInfo) || - computeMemInfo->thisSize != sizeof(OrbisVideodec2ComputeMemoryInfo)) { - LOG_ERROR(Lib_Vdec2, "Invalid struct size"); - return ORBIS_VIDEODEC2_ERROR_STRUCT_SIZE; - } - if (computeCfgInfo->reserved0 != 0 || computeCfgInfo->reserved1 != 0) { - LOG_ERROR(Lib_Vdec2, "Invalid compute config"); - return ORBIS_VIDEODEC2_ERROR_CONFIG_INFO; - } - if (computeCfgInfo->computePipeId > 4) { - LOG_ERROR(Lib_Vdec2, "Invalid compute pipe id"); - return ORBIS_VIDEODEC2_ERROR_COMPUTE_PIPE_ID; - } - if (computeCfgInfo->computeQueueId > 7) { - LOG_ERROR(Lib_Vdec2, "Invalid compute queue id"); - return ORBIS_VIDEODEC2_ERROR_COMPUTE_QUEUE_ID; - } - if (!computeMemInfo->cpuGpuMemory) { - LOG_ERROR(Lib_Vdec2, "Invalid memory pointer"); - return ORBIS_VIDEODEC2_ERROR_MEMORY_POINTER; - } - - // The real library returns a pointer to memory inside cpuGpuMemory - *computeQueue = computeMemInfo->cpuGpuMemory; - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceVideodec2ReleaseComputeQueue(OrbisVideodec2ComputeQueue computeQueue) { - LOG_INFO(Lib_Vdec2, "called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI -sceVideodec2QueryDecoderMemoryInfo(const OrbisVideodec2DecoderConfigInfo* decoderCfgInfo, - OrbisVideodec2DecoderMemoryInfo* decoderMemInfo) { - LOG_INFO(Lib_Vdec2, "called"); - - if (!decoderCfgInfo || !decoderMemInfo) { - LOG_ERROR(Lib_Vdec2, "Invalid arguments"); - return ORBIS_VIDEODEC2_ERROR_ARGUMENT_POINTER; - } - if (decoderCfgInfo->thisSize != sizeof(OrbisVideodec2DecoderConfigInfo) || - decoderMemInfo->thisSize != sizeof(OrbisVideodec2DecoderMemoryInfo)) { - LOG_ERROR(Lib_Vdec2, "Invalid struct size"); - return ORBIS_VIDEODEC2_ERROR_STRUCT_SIZE; - } - - decoderMemInfo->cpuMemory = nullptr; - decoderMemInfo->gpuMemory = nullptr; - decoderMemInfo->cpuGpuMemory = nullptr; - - decoderMemInfo->cpuGpuMemorySize = kMinimumMemorySize; - decoderMemInfo->cpuMemorySize = kMinimumMemorySize; - decoderMemInfo->gpuMemorySize = kMinimumMemorySize; - - decoderMemInfo->maxFrameBufferSize = kMinimumMemorySize; - decoderMemInfo->frameBufferAlignment = 0x100; - - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceVideodec2CreateDecoder(const OrbisVideodec2DecoderConfigInfo* decoderCfgInfo, - const OrbisVideodec2DecoderMemoryInfo* decoderMemInfo, - OrbisVideodec2Decoder* decoder) { - LOG_INFO(Lib_Vdec2, "called"); - - if (!decoderCfgInfo || !decoderMemInfo || !decoder) { - LOG_ERROR(Lib_Vdec2, "Invalid arguments"); - return ORBIS_VIDEODEC2_ERROR_ARGUMENT_POINTER; - } - if (decoderCfgInfo->thisSize != sizeof(OrbisVideodec2DecoderConfigInfo) || - decoderMemInfo->thisSize != sizeof(OrbisVideodec2DecoderMemoryInfo)) { - LOG_ERROR(Lib_Vdec2, "Invalid struct size"); - return ORBIS_VIDEODEC2_ERROR_STRUCT_SIZE; - } - - *decoder = new VdecDecoder(*decoderCfgInfo, *decoderMemInfo); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceVideodec2DeleteDecoder(OrbisVideodec2Decoder decoder) { - LOG_INFO(Lib_Vdec2, "called"); - - if (!decoder) { - LOG_ERROR(Lib_Vdec2, "Invalid arguments"); - return ORBIS_VIDEODEC2_ERROR_DECODER_INSTANCE; - } - - delete decoder; - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceVideodec2Decode(OrbisVideodec2Decoder decoder, - const OrbisVideodec2InputData* inputData, - OrbisVideodec2FrameBuffer* frameBuffer, - OrbisVideodec2OutputInfo* outputInfo) { - LOG_TRACE(Lib_Vdec2, "called"); - - if (!decoder) { - LOG_ERROR(Lib_Vdec2, "Invalid decoder instance"); - return ORBIS_VIDEODEC2_ERROR_DECODER_INSTANCE; - } - if (!inputData || !frameBuffer || !outputInfo) { - LOG_ERROR(Lib_Vdec2, "Invalid arguments"); - return ORBIS_VIDEODEC2_ERROR_ARGUMENT_POINTER; - } - if (inputData->thisSize != sizeof(OrbisVideodec2InputData) || - frameBuffer->thisSize != sizeof(OrbisVideodec2FrameBuffer)) { - LOG_ERROR(Lib_Vdec2, "Invalid struct size"); - return ORBIS_VIDEODEC2_ERROR_STRUCT_SIZE; - } - - return decoder->Decode(*inputData, *frameBuffer, *outputInfo); -} - -s32 PS4_SYSV_ABI sceVideodec2Flush(OrbisVideodec2Decoder decoder, - OrbisVideodec2FrameBuffer* frameBuffer, - OrbisVideodec2OutputInfo* outputInfo) { - LOG_INFO(Lib_Vdec2, "called"); - - if (!decoder) { - LOG_ERROR(Lib_Vdec2, "Invalid decoder instance"); - return ORBIS_VIDEODEC2_ERROR_DECODER_INSTANCE; - } - if (!frameBuffer || !outputInfo) { - LOG_ERROR(Lib_Vdec2, "Invalid arguments"); - return ORBIS_VIDEODEC2_ERROR_ARGUMENT_POINTER; - } - if (frameBuffer->thisSize != sizeof(OrbisVideodec2FrameBuffer) || - (outputInfo->thisSize | 8) != sizeof(OrbisVideodec2OutputInfo)) { - LOG_ERROR(Lib_Vdec2, "Invalid struct size"); - return ORBIS_VIDEODEC2_ERROR_STRUCT_SIZE; - } - - return decoder->Flush(*frameBuffer, *outputInfo); -} - -s32 PS4_SYSV_ABI sceVideodec2Reset(OrbisVideodec2Decoder decoder) { - LOG_INFO(Lib_Vdec2, "called"); - - if (!decoder) { - LOG_ERROR(Lib_Vdec2, "Invalid decoder instance"); - return ORBIS_VIDEODEC2_ERROR_DECODER_INSTANCE; - } - - return decoder->Reset(); -} - -s32 PS4_SYSV_ABI sceVideodec2GetPictureInfo(const OrbisVideodec2OutputInfo* outputInfo, - void* p1stPictureInfoOut, void* p2ndPictureInfoOut) { - LOG_TRACE(Lib_Vdec2, "called"); - - if (!outputInfo) { - LOG_ERROR(Lib_Vdec2, "Invalid arguments"); - return ORBIS_VIDEODEC2_ERROR_ARGUMENT_POINTER; - } - if ((outputInfo->thisSize | 8) != sizeof(OrbisVideodec2OutputInfo)) { - LOG_ERROR(Lib_Vdec2, "Invalid struct size"); - return ORBIS_VIDEODEC2_ERROR_STRUCT_SIZE; - } - if (outputInfo->pictureCount == 0) { - LOG_ERROR(Lib_Vdec2, "No picture info available"); - return ORBIS_OK; - } - - // If the game uses the older Videodec2 structs, we need to accomodate that. - if (outputInfo->thisSize != sizeof(OrbisVideodec2OutputInfo)) { - if (gLegacyPictureInfos.empty()) { - LOG_ERROR(Lib_Vdec2, "No picture info available"); - return ORBIS_OK; - } - if (p1stPictureInfoOut) { - OrbisVideodec2LegacyAvcPictureInfo* picInfo = - static_cast(p1stPictureInfoOut); - if (picInfo->thisSize != sizeof(OrbisVideodec2LegacyAvcPictureInfo)) { - LOG_ERROR(Lib_Vdec2, "Invalid struct size"); - return ORBIS_VIDEODEC2_ERROR_STRUCT_SIZE; - } - *picInfo = gLegacyPictureInfos.back(); - } - } else { - if (gPictureInfos.empty()) { - LOG_ERROR(Lib_Vdec2, "No picture info available"); - return ORBIS_OK; - } - if (p1stPictureInfoOut) { - OrbisVideodec2AvcPictureInfo* picInfo = - static_cast(p1stPictureInfoOut); - if (picInfo->thisSize != sizeof(OrbisVideodec2AvcPictureInfo)) { - LOG_ERROR(Lib_Vdec2, "Invalid struct size"); - return ORBIS_VIDEODEC2_ERROR_STRUCT_SIZE; - } - *picInfo = gPictureInfos.back(); - } - } - - if (outputInfo->pictureCount > 1) { - UNREACHABLE(); - } - - return ORBIS_OK; -} - -void RegisterLib(Core::Loader::SymbolsResolver* sym) { - LIB_FUNCTION("RnDibcGCPKw", "libSceVideodec2", 1, "libSceVideodec2", - sceVideodec2QueryComputeMemoryInfo); - LIB_FUNCTION("eD+X2SmxUt4", "libSceVideodec2", 1, "libSceVideodec2", - sceVideodec2AllocateComputeQueue); - LIB_FUNCTION("UvtA3FAiF4Y", "libSceVideodec2", 1, "libSceVideodec2", - sceVideodec2ReleaseComputeQueue); - - LIB_FUNCTION("qqMCwlULR+E", "libSceVideodec2", 1, "libSceVideodec2", - sceVideodec2QueryDecoderMemoryInfo); - LIB_FUNCTION("CNNRoRYd8XI", "libSceVideodec2", 1, "libSceVideodec2", sceVideodec2CreateDecoder); - LIB_FUNCTION("jwImxXRGSKA", "libSceVideodec2", 1, "libSceVideodec2", sceVideodec2DeleteDecoder); - LIB_FUNCTION("852F5+q6+iM", "libSceVideodec2", 1, "libSceVideodec2", sceVideodec2Decode); - LIB_FUNCTION("l1hXwscLuCY", "libSceVideodec2", 1, "libSceVideodec2", sceVideodec2Flush); - LIB_FUNCTION("wJXikG6QFN8", "libSceVideodec2", 1, "libSceVideodec2", sceVideodec2Reset); - LIB_FUNCTION("NtXRa3dRzU0", "libSceVideodec2", 1, "libSceVideodec2", - sceVideodec2GetPictureInfo); -} - -} // namespace Libraries::Videodec2 diff --git a/src/core/libraries/videodec/videodec2.h b/src/core/libraries/videodec/videodec2.h deleted file mode 100644 index 0311e4d27..000000000 --- a/src/core/libraries/videodec/videodec2.h +++ /dev/null @@ -1,141 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "common/types.h" - -#include "videodec2_avc.h" - -namespace Core::Loader { -class SymbolsResolver; -} -namespace Libraries::Videodec2 { - -class VdecDecoder; - -using OrbisVideodec2Decoder = VdecDecoder*; -using OrbisVideodec2ComputeQueue = void*; - -struct OrbisVideodec2DecoderConfigInfo { - u64 thisSize; - u32 resourceType; - u32 codecType; - u32 profile; - u32 maxLevel; - s32 maxFrameWidth; - s32 maxFrameHeight; - s32 maxDpbFrameCount; - u32 decodePipelineDepth; - OrbisVideodec2ComputeQueue computeQueue; - u64 cpuAffinityMask; - s32 cpuThreadPriority; - bool optimizeProgressiveVideo; - bool checkMemoryType; - u8 reserved0; - u8 reserved1; - void* extraConfigInfo; -}; -static_assert(sizeof(OrbisVideodec2DecoderConfigInfo) == 0x48); - -struct OrbisVideodec2DecoderMemoryInfo { - u64 thisSize; - u64 cpuMemorySize; - void* cpuMemory; - u64 gpuMemorySize; - void* gpuMemory; - u64 cpuGpuMemorySize; - void* cpuGpuMemory; - u64 maxFrameBufferSize; - u32 frameBufferAlignment; - u32 reserved0; -}; -static_assert(sizeof(OrbisVideodec2DecoderMemoryInfo) == 0x48); - -struct OrbisVideodec2InputData { - u64 thisSize; - void* auData; - u64 auSize; - u64 ptsData; - u64 dtsData; - u64 attachedData; -}; -static_assert(sizeof(OrbisVideodec2InputData) == 0x30); - -struct OrbisVideodec2OutputInfo { - u64 thisSize; - bool isValid; - bool isErrorFrame; - u8 pictureCount; - u32 codecType; - u32 frameWidth; - u32 framePitch; - u32 frameHeight; - void* frameBuffer; - u64 frameBufferSize; - u32 frameFormat; - u32 framePitchInBytes; -}; -static_assert(sizeof(OrbisVideodec2OutputInfo) == 0x38); - -struct OrbisVideodec2FrameBuffer { - u64 thisSize; - void* frameBuffer; - u64 frameBufferSize; - bool isAccepted; -}; -static_assert(sizeof(OrbisVideodec2FrameBuffer) == 0x20); - -struct OrbisVideodec2ComputeMemoryInfo { - u64 thisSize; - u64 cpuGpuMemorySize; - void* cpuGpuMemory; -}; -static_assert(sizeof(OrbisVideodec2ComputeMemoryInfo) == 0x18); - -struct OrbisVideodec2ComputeConfigInfo { - u64 thisSize; - u16 computePipeId; - u16 computeQueueId; - bool checkMemoryType; - u8 reserved0; - u16 reserved1; -}; -static_assert(sizeof(OrbisVideodec2ComputeConfigInfo) == 0x10); - -s32 PS4_SYSV_ABI -sceVideodec2QueryComputeMemoryInfo(OrbisVideodec2ComputeMemoryInfo* computeMemInfo); - -s32 PS4_SYSV_ABI -sceVideodec2AllocateComputeQueue(const OrbisVideodec2ComputeConfigInfo* computeCfgInfo, - const OrbisVideodec2ComputeMemoryInfo* computeMemInfo, - OrbisVideodec2ComputeQueue* computeQueue); - -s32 PS4_SYSV_ABI sceVideodec2ReleaseComputeQueue(OrbisVideodec2ComputeQueue computeQueue); - -s32 PS4_SYSV_ABI -sceVideodec2QueryDecoderMemoryInfo(const OrbisVideodec2DecoderConfigInfo* decoderCfgInfo, - OrbisVideodec2DecoderMemoryInfo* decoderMemInfo); - -s32 PS4_SYSV_ABI sceVideodec2CreateDecoder(const OrbisVideodec2DecoderConfigInfo* decoderCfgInfo, - const OrbisVideodec2DecoderMemoryInfo* decoderMemInfo, - OrbisVideodec2Decoder* decoder); - -s32 PS4_SYSV_ABI sceVideodec2DeleteDecoder(OrbisVideodec2Decoder decoder); - -s32 PS4_SYSV_ABI sceVideodec2Decode(OrbisVideodec2Decoder decoder, - const OrbisVideodec2InputData* inputData, - OrbisVideodec2FrameBuffer* frameBuffer, - OrbisVideodec2OutputInfo* outputInfo); - -s32 PS4_SYSV_ABI sceVideodec2Flush(OrbisVideodec2Decoder decoder, - OrbisVideodec2FrameBuffer* frameBuffer, - OrbisVideodec2OutputInfo* outputInfo); - -s32 PS4_SYSV_ABI sceVideodec2Reset(OrbisVideodec2Decoder decoder); - -s32 PS4_SYSV_ABI sceVideodec2GetPictureInfo(const OrbisVideodec2OutputInfo* outputInfo, - void* p1stPictureInfo, void* p2ndPictureInfo); - -void RegisterLib(Core::Loader::SymbolsResolver* sym); -} // namespace Libraries::Videodec2 \ No newline at end of file diff --git a/src/core/libraries/videodec/videodec2_avc.h b/src/core/libraries/videodec/videodec2_avc.h deleted file mode 100644 index dcf6ae007..000000000 --- a/src/core/libraries/videodec/videodec2_avc.h +++ /dev/null @@ -1,130 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "common/types.h" - -namespace Libraries::Videodec2 { - -struct OrbisVideodec2AvcPictureInfo { - u64 thisSize; - - bool isValid; - - u64 ptsData; - u64 dtsData; - u64 attachedData; - - u8 idrPictureflag; - - u8 profile_idc; - u8 level_idc; - u32 pic_width_in_mbs_minus1; - u32 pic_height_in_map_units_minus1; - u8 frame_mbs_only_flag; - - u8 frame_cropping_flag; - u32 frameCropLeftOffset; - u32 frameCropRightOffset; - u32 frameCropTopOffset; - u32 frameCropBottomOffset; - - u8 aspect_ratio_info_present_flag; - u8 aspect_ratio_idc; - u16 sar_width; - u16 sar_height; - - u8 video_signal_type_present_flag; - u8 video_format; - u8 video_full_range_flag; - u8 colour_description_present_flag; - u8 colour_primaries; - u8 transfer_characteristics; - u8 matrix_coefficients; - - u8 timing_info_present_flag; - u32 num_units_in_tick; - u32 time_scale; - u8 fixed_frame_rate_flag; - - u8 bitstream_restriction_flag; - u8 max_dec_frame_buffering; - - u8 pic_struct_present_flag; - u8 pic_struct; - u8 field_pic_flag; - u8 bottom_field_flag; - - u8 sequenceParameterSetPresentFlag; - u8 pictureParameterSetPresentFlag; - u8 auDelimiterPresentFlag; - u8 endOfSequencePresentFlag; - u8 endOfStreamPresentFlag; - u8 fillerDataPresentFlag; - u8 pictureTimingSeiPresentFlag; - u8 bufferingPeriodSeiPresentFlag; - - u8 constraint_set0_flag; - u8 constraint_set1_flag; - u8 constraint_set2_flag; - u8 constraint_set3_flag; - u8 constraint_set4_flag; - u8 constraint_set5_flag; -}; -static_assert(sizeof(OrbisVideodec2AvcPictureInfo) == 0x78); - -// An older version of the OrbisVideodec2AvcPictureInfo struct -// Keeping this is needed for compatiblity with older games. -struct OrbisVideodec2LegacyAvcPictureInfo { - u64 thisSize; - - bool isValid; - - u64 ptsData; - u64 dtsData; - u64 attachedData; - - u8 idrPictureflag; - - u8 profile_idc; - u8 level_idc; - u32 pic_width_in_mbs_minus1; - u32 pic_height_in_map_units_minus1; - u8 frame_mbs_only_flag; - - u8 frame_cropping_flag; - u32 frameCropLeftOffset; - u32 frameCropRightOffset; - u32 frameCropTopOffset; - u32 frameCropBottomOffset; - - u8 aspect_ratio_info_present_flag; - u8 aspect_ratio_idc; - u16 sar_width; - u16 sar_height; - - u8 video_signal_type_present_flag; - u8 video_format; - u8 video_full_range_flag; - u8 colour_description_present_flag; - u8 colour_primaries; - u8 transfer_characteristics; - u8 matrix_coefficients; - - u8 timing_info_present_flag; - u32 num_units_in_tick; - u32 time_scale; - u8 fixed_frame_rate_flag; - - u8 bitstream_restriction_flag; - u8 max_dec_frame_buffering; - - u8 pic_struct_present_flag; - u8 pic_struct; - u8 field_pic_flag; - u8 bottom_field_flag; -}; -static_assert(sizeof(OrbisVideodec2LegacyAvcPictureInfo) == 0x68); - -} // namespace Libraries::Videodec2 \ No newline at end of file diff --git a/src/core/libraries/videodec/videodec2_impl.cpp b/src/core/libraries/videodec/videodec2_impl.cpp deleted file mode 100644 index 08a7f8f00..000000000 --- a/src/core/libraries/videodec/videodec2_impl.cpp +++ /dev/null @@ -1,281 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "videodec2_impl.h" - -#include "common/assert.h" -#include "common/logging/log.h" -#include "core/libraries/videodec/videodec_error.h" - -#include "common/support/avdec.h" - -namespace Libraries::Videodec2 { - -std::vector gPictureInfos; -std::vector gLegacyPictureInfos; - -static inline void CopyNV12Data(u8* dst, const AVFrame& src) { - if (src.width == src.linesize[0]) { - std::memcpy(dst, src.data[0], src.width * src.height); - std::memcpy(dst + (src.width * src.height), src.data[1], (src.width * src.height) / 2); - return; - } - - for (u16 row = 0; row < src.height; row++) { - u64 dst_offset = row * src.width; - std::memcpy(dst + dst_offset, src.data[0] + (row * src.linesize[0]), src.width); - } - - u64 dst_base = src.width * src.height; - for (u16 row = 0; row < src.height / 2; row++) { - u64 dst_offset = row * src.width; - std::memcpy(dst + dst_base + dst_offset, src.data[1] + (row * src.linesize[1]), src.width); - } -} - -VdecDecoder::VdecDecoder(const OrbisVideodec2DecoderConfigInfo& configInfo, - const OrbisVideodec2DecoderMemoryInfo& memoryInfo) { - ASSERT(configInfo.codecType == 1); /* AVC */ - - const AVCodec* codec = avcodec_find_decoder(AV_CODEC_ID_H264); - ASSERT(codec); - - mCodecContext = avcodec_alloc_context3(codec); - ASSERT(mCodecContext); - mCodecContext->width = configInfo.maxFrameWidth; - mCodecContext->height = configInfo.maxFrameHeight; - - avcodec_open2(mCodecContext, codec, nullptr); -} - -VdecDecoder::~VdecDecoder() { - avcodec_free_context(&mCodecContext); - sws_freeContext(mSwsContext); - - gPictureInfos.clear(); -} - -s32 VdecDecoder::Decode(const OrbisVideodec2InputData& inputData, - OrbisVideodec2FrameBuffer& frameBuffer, - OrbisVideodec2OutputInfo& outputInfo) { - frameBuffer.isAccepted = false; - outputInfo.isValid = false; - outputInfo.isErrorFrame = true; - outputInfo.pictureCount = 0; - - // Only set frameFormat if the game uses the newer struct version. - if (outputInfo.thisSize == sizeof(OrbisVideodec2OutputInfo)) { - outputInfo.frameFormat = 0; - } - - if (!inputData.auData) { - return ORBIS_VIDEODEC2_ERROR_ACCESS_UNIT_POINTER; - } - if (inputData.auSize == 0) { - return ORBIS_VIDEODEC2_ERROR_ACCESS_UNIT_SIZE; - } - - AVPacket* packet = av_packet_alloc(); - if (!packet) { - LOG_ERROR(Lib_Vdec2, "Failed to allocate packet"); - return ORBIS_VIDEODEC2_ERROR_API_FAIL; - } - - packet->data = (u8*)inputData.auData; - packet->size = inputData.auSize; - packet->pts = inputData.ptsData; - packet->dts = inputData.dtsData; - - int ret = avcodec_send_packet(mCodecContext, packet); - if (ret < 0) { - LOG_ERROR(Lib_Vdec2, "Error sending packet to decoder: {}", ret); - av_packet_free(&packet); - return ORBIS_VIDEODEC2_ERROR_API_FAIL; - } - - AVFrame* frame = av_frame_alloc(); - if (frame == nullptr) { - LOG_ERROR(Lib_Vdec2, "Failed to allocate frame"); - av_packet_free(&packet); - return ORBIS_VIDEODEC2_ERROR_API_FAIL; - } - - while (true) { - ret = avcodec_receive_frame(mCodecContext, frame); - if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) { - break; - } else if (ret < 0) { - LOG_ERROR(Lib_Vdec2, "Error receiving frame from decoder: {}", ret); - av_packet_free(&packet); - av_frame_free(&frame); - return ORBIS_VIDEODEC2_ERROR_API_FAIL; - } - - if (frame->format != AV_PIX_FMT_NV12) { - AVFrame* nv12_frame = ConvertNV12Frame(*frame); - ASSERT(nv12_frame); - av_frame_free(&frame); - frame = nv12_frame; - } - - CopyNV12Data((u8*)frameBuffer.frameBuffer, *frame); - frameBuffer.isAccepted = true; - - outputInfo.codecType = 1; // FIXME: Hardcoded to AVC - outputInfo.frameWidth = frame->width; - outputInfo.frameHeight = frame->height; - outputInfo.framePitch = frame->width; - outputInfo.frameBufferSize = frameBuffer.frameBufferSize; - outputInfo.frameBuffer = frameBuffer.frameBuffer; - - outputInfo.isValid = true; - outputInfo.isErrorFrame = false; - outputInfo.pictureCount = 1; // TODO: 2 pictures for interlaced video - - // For proper compatibility with older games, check the inputted OutputInfo struct size. - if (outputInfo.thisSize == sizeof(OrbisVideodec2OutputInfo)) { - // framePitchInBytes only exists in the newer struct. - outputInfo.framePitchInBytes = frame->width; - if (outputInfo.isValid) { - OrbisVideodec2AvcPictureInfo pictureInfo = {}; - - pictureInfo.thisSize = sizeof(OrbisVideodec2AvcPictureInfo); - pictureInfo.isValid = true; - - pictureInfo.ptsData = inputData.ptsData; - pictureInfo.dtsData = inputData.dtsData; - pictureInfo.attachedData = inputData.attachedData; - - pictureInfo.frameCropLeftOffset = frame->crop_left; - pictureInfo.frameCropRightOffset = frame->crop_right; - pictureInfo.frameCropTopOffset = frame->crop_top; - pictureInfo.frameCropBottomOffset = frame->crop_bottom; - - gPictureInfos.push_back(pictureInfo); - } - } else { - if (outputInfo.isValid) { - // If the game uses the older struct versions, we need to use it too. - OrbisVideodec2LegacyAvcPictureInfo pictureInfo = {}; - - pictureInfo.thisSize = sizeof(OrbisVideodec2LegacyAvcPictureInfo); - pictureInfo.isValid = true; - - pictureInfo.ptsData = inputData.ptsData; - pictureInfo.dtsData = inputData.dtsData; - pictureInfo.attachedData = inputData.attachedData; - - pictureInfo.frameCropLeftOffset = frame->crop_left; - pictureInfo.frameCropRightOffset = frame->crop_right; - pictureInfo.frameCropTopOffset = frame->crop_top; - pictureInfo.frameCropBottomOffset = frame->crop_bottom; - - gLegacyPictureInfos.push_back(pictureInfo); - } - } - } - - av_packet_free(&packet); - av_frame_free(&frame); - return ORBIS_OK; -} - -s32 VdecDecoder::Flush(OrbisVideodec2FrameBuffer& frameBuffer, - OrbisVideodec2OutputInfo& outputInfo) { - frameBuffer.isAccepted = false; - outputInfo.isValid = false; - outputInfo.isErrorFrame = true; - outputInfo.pictureCount = 0; - - // Only set frameFormat if the game uses the newer struct version. - if (outputInfo.thisSize == sizeof(OrbisVideodec2OutputInfo)) { - outputInfo.frameFormat = 0; - } - - AVFrame* frame = av_frame_alloc(); - if (!frame) { - LOG_ERROR(Lib_Vdec2, "Failed to allocate frame"); - return ORBIS_VIDEODEC2_ERROR_API_FAIL; - } - - while (true) { - int ret = avcodec_receive_frame(mCodecContext, frame); - if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) { - break; - } else if (ret < 0) { - LOG_ERROR(Lib_Vdec2, "Error receiving frame from decoder: {}", ret); - av_frame_free(&frame); - return ORBIS_VIDEODEC2_ERROR_API_FAIL; - } - - if (frame->format != AV_PIX_FMT_NV12) { - AVFrame* nv12_frame = ConvertNV12Frame(*frame); - ASSERT(nv12_frame); - av_frame_free(&frame); - frame = nv12_frame; - } - - CopyNV12Data((u8*)frameBuffer.frameBuffer, *frame); - frameBuffer.isAccepted = true; - - outputInfo.codecType = 1; // FIXME: Hardcoded to AVC - outputInfo.frameWidth = frame->width; - outputInfo.frameHeight = frame->height; - outputInfo.framePitch = frame->linesize[0]; - outputInfo.frameBufferSize = frameBuffer.frameBufferSize; - outputInfo.frameBuffer = frameBuffer.frameBuffer; - - outputInfo.isValid = true; - outputInfo.isErrorFrame = false; - outputInfo.pictureCount = 1; // TODO: 2 pictures for interlaced video - - // Only set framePitchInBytes if the game uses the newer struct version. - if (outputInfo.thisSize == sizeof(OrbisVideodec2OutputInfo)) { - outputInfo.framePitchInBytes = frame->linesize[0]; - } - - // FIXME: Should we add picture info here too? - } - - av_frame_free(&frame); - return ORBIS_OK; -} - -s32 VdecDecoder::Reset() { - avcodec_flush_buffers(mCodecContext); - gPictureInfos.clear(); - return ORBIS_OK; -} - -AVFrame* VdecDecoder::ConvertNV12Frame(AVFrame& frame) { - AVFrame* nv12_frame = av_frame_alloc(); - nv12_frame->pts = frame.pts; - nv12_frame->pkt_dts = frame.pkt_dts < 0 ? 0 : frame.pkt_dts; - nv12_frame->format = AV_PIX_FMT_NV12; - nv12_frame->width = frame.width; - nv12_frame->height = frame.height; - nv12_frame->sample_aspect_ratio = frame.sample_aspect_ratio; - nv12_frame->crop_top = frame.crop_top; - nv12_frame->crop_bottom = frame.crop_bottom; - nv12_frame->crop_left = frame.crop_left; - nv12_frame->crop_right = frame.crop_right; - - av_frame_get_buffer(nv12_frame, 0); - - if (mSwsContext == nullptr) { - mSwsContext = sws_getContext(frame.width, frame.height, AVPixelFormat(frame.format), - nv12_frame->width, nv12_frame->height, AV_PIX_FMT_NV12, - SWS_FAST_BILINEAR, nullptr, nullptr, nullptr); - } - - const auto res = sws_scale(mSwsContext, frame.data, frame.linesize, 0, frame.height, - nv12_frame->data, nv12_frame->linesize); - if (res < 0) { - LOG_ERROR(Lib_Vdec2, "Could not convert to NV12: {}", av_err2str(res)); - return nullptr; - } - - return nv12_frame; -} - -} // namespace Libraries::Videodec2 diff --git a/src/core/libraries/videodec/videodec2_impl.h b/src/core/libraries/videodec/videodec2_impl.h deleted file mode 100644 index da16b3baa..000000000 --- a/src/core/libraries/videodec/videodec2_impl.h +++ /dev/null @@ -1,40 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include - -#include "videodec2.h" - -extern "C" { -#include -#include -#include -} - -namespace Libraries::Videodec2 { - -extern std::vector gPictureInfos; -extern std::vector gLegacyPictureInfos; - -class VdecDecoder { -public: - VdecDecoder(const OrbisVideodec2DecoderConfigInfo& configInfo, - const OrbisVideodec2DecoderMemoryInfo& memoryInfo); - ~VdecDecoder(); - - s32 Decode(const OrbisVideodec2InputData& inputData, OrbisVideodec2FrameBuffer& frameBuffer, - OrbisVideodec2OutputInfo& outputInfo); - s32 Flush(OrbisVideodec2FrameBuffer& frameBuffer, OrbisVideodec2OutputInfo& outputInfo); - s32 Reset(); - -private: - AVFrame* ConvertNV12Frame(AVFrame& frame); - -private: - AVCodecContext* mCodecContext = nullptr; - SwsContext* mSwsContext = nullptr; -}; - -} // namespace Libraries::Videodec2 \ No newline at end of file diff --git a/src/core/libraries/videodec/videodec_error.h b/src/core/libraries/videodec/videodec_error.h deleted file mode 100644 index 4e0066e5e..000000000 --- a/src/core/libraries/videodec/videodec_error.h +++ /dev/null @@ -1,68 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "core/libraries/error_codes.h" - -// Videodec library -constexpr int ORBIS_VIDEODEC_ERROR_API_FAIL = 0x80C10000; -constexpr int ORBIS_VIDEODEC_ERROR_CODEC_TYPE = 0x80C10001; -constexpr int ORBIS_VIDEODEC_ERROR_STRUCT_SIZE = 0x80C10002; -constexpr int ORBIS_VIDEODEC_ERROR_HANDLE = 0x80C10003; -constexpr int ORBIS_VIDEODEC_ERROR_CPU_MEMORY_SIZE = 0x80C10004; -constexpr int ORBIS_VIDEODEC_ERROR_CPU_MEMORY_POINTER = 0x80C10005; -constexpr int ORBIS_VIDEODEC_ERROR_CPU_GPU_MEMORY_SIZE = 0x80C10006; -constexpr int ORBIS_VIDEODEC_ERROR_CPU_GPU_MEMORY_POINTER = 0x80C10007; -constexpr int ORBIS_VIDEODEC_ERROR_SHADER_CONTEXT_POINTER = 0x80C10008; -constexpr int ORBIS_VIDEODEC_ERROR_AU_SIZE = 0x80C10009; -constexpr int ORBIS_VIDEODEC_ERROR_AU_POINTER = 0x80C1000A; -constexpr int ORBIS_VIDEODEC_ERROR_FRAME_BUFFER_SIZE = 0x80C1000B; -constexpr int ORBIS_VIDEODEC_ERROR_FRAME_BUFFER_POINTER = 0x80C1000C; -constexpr int ORBIS_VIDEODEC_ERROR_FRAME_BUFFER_ALIGNMENT = 0x80C1000D; -constexpr int ORBIS_VIDEODEC_ERROR_CONFIG_INFO = 0x80C1000E; -constexpr int ORBIS_VIDEODEC_ERROR_ARGUMENT_POINTER = 0x80C1000F; -constexpr int ORBIS_VIDEODEC_ERROR_NEW_SEQUENCE = 0x80C10010; -constexpr int ORBIS_VIDEODEC_ERROR_DECODE_AU = 0x80C10011; -constexpr int ORBIS_VIDEODEC_ERROR_MISMATCH_SPEC = 0x80C10012; -constexpr int ORBIS_VIDEODEC_ERROR_INVALID_SEQUENCE = 0x80C10013; -constexpr int ORBIS_VIDEODEC_ERROR_FATAL_STREAM = 0x80C10014; -constexpr int ORBIS_VIDEODEC_ERROR_FATAL_STATE = 0x80C10015; - -// Videodec2 library -constexpr int ORBIS_VIDEODEC2_ERROR_API_FAIL = 0x811D0100; -constexpr int ORBIS_VIDEODEC2_ERROR_STRUCT_SIZE = 0x811D0101; -constexpr int ORBIS_VIDEODEC2_ERROR_ARGUMENT_POINTER = 0x811D0102; -constexpr int ORBIS_VIDEODEC2_ERROR_DECODER_INSTANCE = 0x811D0103; -constexpr int ORBIS_VIDEODEC2_ERROR_MEMORY_SIZE = 0x811D0104; -constexpr int ORBIS_VIDEODEC2_ERROR_MEMORY_POINTER = 0x811D0105; -constexpr int ORBIS_VIDEODEC2_ERROR_FRAME_BUFFER_SIZE = 0x811D0106; -constexpr int ORBIS_VIDEODEC2_ERROR_FRAME_BUFFER_POINTER = 0x811D0107; -constexpr int ORBIS_VIDEODEC2_ERROR_FRAME_BUFFER_ALIGNMENT = 0x811D0108; -constexpr int ORBIS_VIDEODEC2_ERROR_NOT_ONION_MEMORY = 0x811D0109; -constexpr int ORBIS_VIDEODEC2_ERROR_NOT_GARLIC_MEMORY = 0x811D010A; -constexpr int ORBIS_VIDEODEC2_ERROR_NOT_DIRECT_MEMORY = 0x811D010B; -constexpr int ORBIS_VIDEODEC2_ERROR_MEMORY_INFO = 0x811D010C; -constexpr int ORBIS_VIDEODEC2_ERROR_ACCESS_UNIT_SIZE = 0x811D010D; -constexpr int ORBIS_VIDEODEC2_ERROR_ACCESS_UNIT_POINTER = 0x811D010E; -constexpr int ORBIS_VIDEODEC2_ERROR_OUTPUT_INFO = 0x811D010F; -constexpr int ORBIS_VIDEODEC2_ERROR_COMPUTE_QUEUE = 0x811D0110; -constexpr int ORBIS_VIDEODEC2_ERROR_FATAL_STATE = 0x811D0111; -constexpr int ORBIS_VIDEODEC2_ERROR_PRESET_VALUE = 0x811D0112; -constexpr int ORBIS_VIDEODEC2_ERROR_CONFIG_INFO = 0x811D0200; -constexpr int ORBIS_VIDEODEC2_ERROR_COMPUTE_PIPE_ID = 0x811D0201; -constexpr int ORBIS_VIDEODEC2_ERROR_COMPUTE_QUEUE_ID = 0x811D0202; -constexpr int ORBIS_VIDEODEC2_ERROR_RESOURCE_TYPE = 0x811D0203; -constexpr int ORBIS_VIDEODEC2_ERROR_CODEC_TYPE = 0x811D0204; -constexpr int ORBIS_VIDEODEC2_ERROR_PROFILE_LEVEL = 0x811D0205; -constexpr int ORBIS_VIDEODEC2_ERROR_PIPELINE_DEPTH = 0x811D0206; -constexpr int ORBIS_VIDEODEC2_ERROR_AFFINITY_MASK = 0x811D0207; -constexpr int ORBIS_VIDEODEC2_ERROR_THREAD_PRIORITY = 0x811D0208; -constexpr int ORBIS_VIDEODEC2_ERROR_DPB_FRAME_COUNT = 0x811D0209; -constexpr int ORBIS_VIDEODEC2_ERROR_FRAME_WIDTH_HEIGHT = 0x811D020A; -constexpr int ORBIS_VIDEODEC2_ERROR_EXTRA_CONFIG_INFO = 0x811D020B; -constexpr int ORBIS_VIDEODEC2_ERROR_NEW_SEQUENCE = 0x811D0300; -constexpr int ORBIS_VIDEODEC2_ERROR_ACCESS_UNIT = 0x811D0301; -constexpr int ORBIS_VIDEODEC2_ERROR_OVERSIZE_DECODE = 0x811D0302; -constexpr int ORBIS_VIDEODEC2_ERROR_INVALID_SEQUENCE = 0x811D0303; -constexpr int ORBIS_VIDEODEC2_ERROR_FATAL_STREAM = 0x811D0304; diff --git a/src/core/libraries/videodec/videodec_impl.cpp b/src/core/libraries/videodec/videodec_impl.cpp deleted file mode 100644 index b5f72e9ce..000000000 --- a/src/core/libraries/videodec/videodec_impl.cpp +++ /dev/null @@ -1,213 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "videodec_impl.h" - -#include "common/alignment.h" -#include "common/assert.h" -#include "common/logging/log.h" -#include "core/libraries/videodec/videodec_error.h" - -#include "common/support/avdec.h" - -namespace Libraries::Videodec { - -static inline void CopyNV12Data(u8* dst, const AVFrame& src) { - u32 width = Common::AlignUp((u32)src.width, 16); - u32 height = Common::AlignUp((u32)src.height, 16); - std::memcpy(dst, src.data[0], src.width * src.height); - std::memcpy(dst + src.width * height, src.data[1], (src.width * src.height) / 2); -} - -VdecDecoder::VdecDecoder(const OrbisVideodecConfigInfo& pCfgInfoIn, - const OrbisVideodecResourceInfo& pRsrcInfoIn) { - - const AVCodec* codec = avcodec_find_decoder(AV_CODEC_ID_H264); - ASSERT(codec); - - mCodecContext = avcodec_alloc_context3(codec); - ASSERT(mCodecContext); - mCodecContext->width = pCfgInfoIn.maxFrameWidth; - mCodecContext->height = pCfgInfoIn.maxFrameHeight; - - avcodec_open2(mCodecContext, codec, nullptr); -} - -VdecDecoder::~VdecDecoder() { - avcodec_free_context(&mCodecContext); - sws_freeContext(mSwsContext); -} - -s32 VdecDecoder::Decode(const OrbisVideodecInputData& pInputDataIn, - OrbisVideodecFrameBuffer& pFrameBufferInOut, - OrbisVideodecPictureInfo& pPictureInfoOut) { - pPictureInfoOut.thisSize = sizeof(OrbisVideodecPictureInfo); - pPictureInfoOut.isValid = false; - pPictureInfoOut.isErrorPic = true; - - if (!pInputDataIn.pAuData) { - return ORBIS_VIDEODEC_ERROR_AU_POINTER; - } - if (pInputDataIn.auSize == 0) { - return ORBIS_VIDEODEC_ERROR_AU_SIZE; - } - - AVPacket* packet = av_packet_alloc(); - if (!packet) { - LOG_ERROR(Lib_Videodec, "Failed to allocate packet"); - return ORBIS_VIDEODEC_ERROR_API_FAIL; - } - - packet->data = (u8*)pInputDataIn.pAuData; - packet->size = pInputDataIn.auSize; - packet->pts = pInputDataIn.ptsData; - packet->dts = pInputDataIn.dtsData; - - int ret = avcodec_send_packet(mCodecContext, packet); - if (ret < 0) { - LOG_ERROR(Lib_Videodec, "Error sending packet to decoder: {}", ret); - av_packet_free(&packet); - return ORBIS_VIDEODEC_ERROR_API_FAIL; - } - - AVFrame* frame = av_frame_alloc(); - if (frame == nullptr) { - LOG_ERROR(Lib_Videodec, "Failed to allocate frame"); - av_packet_free(&packet); - return ORBIS_VIDEODEC_ERROR_API_FAIL; - } - int frameCount = 0; - while (true) { - ret = avcodec_receive_frame(mCodecContext, frame); - if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) { - break; - } else if (ret < 0) { - LOG_ERROR(Lib_Videodec, "Error receiving frame from decoder: {}", ret); - av_packet_free(&packet); - av_frame_free(&frame); - return ORBIS_VIDEODEC_ERROR_API_FAIL; - } - - if (frame->format != AV_PIX_FMT_NV12) { - AVFrame* nv12_frame = ConvertNV12Frame(*frame); - ASSERT(nv12_frame); - av_frame_free(&frame); - frame = nv12_frame; - } - - CopyNV12Data((u8*)pFrameBufferInOut.pFrameBuffer, *frame); - - pPictureInfoOut.codecType = 0; - pPictureInfoOut.frameWidth = Common::AlignUp((u32)frame->width, 16); - pPictureInfoOut.frameHeight = Common::AlignUp((u32)frame->height, 16); - pPictureInfoOut.framePitch = frame->linesize[0]; - - pPictureInfoOut.isValid = true; - pPictureInfoOut.isErrorPic = false; - frameCount++; - if (frameCount > 1) { - LOG_WARNING(Lib_Videodec, "We have more than 1 frame"); - } - } - - av_packet_free(&packet); - av_frame_free(&frame); - return ORBIS_OK; -} - -s32 VdecDecoder::Flush(OrbisVideodecFrameBuffer& pFrameBufferInOut, - OrbisVideodecPictureInfo& pPictureInfoOut) { - pPictureInfoOut.thisSize = sizeof(pPictureInfoOut); - pPictureInfoOut.isValid = false; - pPictureInfoOut.isErrorPic = true; - - AVFrame* frame = av_frame_alloc(); - if (!frame) { - LOG_ERROR(Lib_Videodec, "Failed to allocate frame"); - return ORBIS_VIDEODEC_ERROR_API_FAIL; - } - - int frameCount = 0; - while (true) { - int ret = avcodec_receive_frame(mCodecContext, frame); - if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) { - break; - } else if (ret < 0) { - LOG_ERROR(Lib_Videodec, "Error receiving frame from decoder: {}", ret); - av_frame_free(&frame); - return ORBIS_VIDEODEC_ERROR_API_FAIL; - } - - if (frame->format != AV_PIX_FMT_NV12) { - AVFrame* nv12_frame = ConvertNV12Frame(*frame); - ASSERT(nv12_frame); - av_frame_free(&frame); - frame = nv12_frame; - } - - CopyNV12Data((u8*)pFrameBufferInOut.pFrameBuffer, *frame); - - pPictureInfoOut.codecType = 0; - pPictureInfoOut.frameWidth = Common::AlignUp((u32)frame->width, 16); - pPictureInfoOut.frameHeight = Common::AlignUp((u32)frame->height, 16); - pPictureInfoOut.framePitch = frame->linesize[0]; - - pPictureInfoOut.isValid = true; - pPictureInfoOut.isErrorPic = false; - - u32 width = Common::AlignUp((u32)frame->width, 16); - u32 height = Common::AlignUp((u32)frame->height, 16); - pPictureInfoOut.codec.avc.frameCropLeftOffset = u32(frame->crop_left); - pPictureInfoOut.codec.avc.frameCropRightOffset = - u32(frame->crop_right + (width - frame->width)); - pPictureInfoOut.codec.avc.frameCropTopOffset = u32(frame->crop_top); - pPictureInfoOut.codec.avc.frameCropBottomOffset = - u32(frame->crop_bottom + (height - frame->height)); - // TODO maybe more avc? - - if (frameCount > 1) { - LOG_WARNING(Lib_Videodec, "We have more than 1 frame"); - } - } - - av_frame_free(&frame); - return ORBIS_OK; -} - -s32 VdecDecoder::Reset() { - avcodec_flush_buffers(mCodecContext); - return ORBIS_OK; -} - -AVFrame* VdecDecoder::ConvertNV12Frame(AVFrame& frame) { - AVFrame* nv12_frame = av_frame_alloc(); - nv12_frame->pts = frame.pts; - nv12_frame->pkt_dts = frame.pkt_dts < 0 ? 0 : frame.pkt_dts; - nv12_frame->format = AV_PIX_FMT_NV12; - nv12_frame->width = frame.width; - nv12_frame->height = frame.height; - nv12_frame->sample_aspect_ratio = frame.sample_aspect_ratio; - nv12_frame->crop_top = frame.crop_top; - nv12_frame->crop_bottom = frame.crop_bottom; - nv12_frame->crop_left = frame.crop_left; - nv12_frame->crop_right = frame.crop_right; - - av_frame_get_buffer(nv12_frame, 0); - - if (mSwsContext == nullptr) { - mSwsContext = sws_getContext(frame.width, frame.height, AVPixelFormat(frame.format), - nv12_frame->width, nv12_frame->height, AV_PIX_FMT_NV12, - SWS_FAST_BILINEAR, nullptr, nullptr, nullptr); - } - - const auto res = sws_scale(mSwsContext, frame.data, frame.linesize, 0, frame.height, - nv12_frame->data, nv12_frame->linesize); - if (res < 0) { - LOG_ERROR(Lib_Videodec, "Could not convert to NV12: {}", av_err2str(res)); - return nullptr; - } - - return nv12_frame; -} - -} // namespace Libraries::Videodec diff --git a/src/core/libraries/videodec/videodec_impl.h b/src/core/libraries/videodec/videodec_impl.h deleted file mode 100644 index 3d48db608..000000000 --- a/src/core/libraries/videodec/videodec_impl.h +++ /dev/null @@ -1,38 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include - -#include "videodec.h" - -extern "C" { -#include -#include -#include -} - -namespace Libraries::Videodec { - -class VdecDecoder { -public: - VdecDecoder(const OrbisVideodecConfigInfo& pCfgInfoIn, - const OrbisVideodecResourceInfo& pRsrcInfoIn); - ~VdecDecoder(); - s32 Decode(const OrbisVideodecInputData& pInputDataIn, - OrbisVideodecFrameBuffer& pFrameBufferInOut, - OrbisVideodecPictureInfo& pPictureInfoOut); - s32 Flush(OrbisVideodecFrameBuffer& pFrameBufferInOut, - OrbisVideodecPictureInfo& pPictureInfoOut); - s32 Reset(); - -private: - AVFrame* ConvertNV12Frame(AVFrame& frame); - -private: - AVCodecContext* mCodecContext = nullptr; - SwsContext* mSwsContext = nullptr; -}; - -} // namespace Libraries::Videodec \ No newline at end of file diff --git a/src/core/libraries/videoout/buffer.h b/src/core/libraries/videoout/buffer.h index 08552bddb..aa46f74b1 100644 --- a/src/core/libraries/videoout/buffer.h +++ b/src/core/libraries/videoout/buffer.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/videoout/driver.cpp b/src/core/libraries/videoout/driver.cpp index 9db70569b..b2a3351be 100644 --- a/src/core/libraries/videoout/driver.cpp +++ b/src/core/libraries/videoout/driver.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/assert.h" @@ -271,7 +271,7 @@ void VideoOutDriver::PresentThread(std::stop_token token) { const std::chrono::nanoseconds vblank_period(1000000000 / EmulatorSettings.GetVblankFrequency()); - Common::SetCurrentThreadName("shadPS4:PresentThread"); + Common::SetCurrentThreadName("sB:PresentThread"); Common::SetCurrentThreadRealtime(vblank_period); Common::AccurateTimer timer{vblank_period}; diff --git a/src/core/libraries/videoout/driver.h b/src/core/libraries/videoout/driver.h index 96bd58500..935e07db4 100644 --- a/src/core/libraries/videoout/driver.h +++ b/src/core/libraries/videoout/driver.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/videoout/video_out.cpp b/src/core/libraries/videoout/video_out.cpp index 7714eb2b5..660251630 100644 --- a/src/core/libraries/videoout/video_out.cpp +++ b/src/core/libraries/videoout/video_out.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/assert.h" diff --git a/src/core/libraries/videoout/video_out.h b/src/core/libraries/videoout/video_out.h index 09b79e85d..04f7cd637 100644 --- a/src/core/libraries/videoout/video_out.h +++ b/src/core/libraries/videoout/video_out.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/videoout/videoout_error.h b/src/core/libraries/videoout/videoout_error.h index b1ed18c92..eaf9a9f23 100644 --- a/src/core/libraries/videoout/videoout_error.h +++ b/src/core/libraries/videoout/videoout_error.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/voice/voice.cpp b/src/core/libraries/voice/voice.cpp index 9379cadc5..f9c4876fd 100644 --- a/src/core/libraries/voice/voice.cpp +++ b/src/core/libraries/voice/voice.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/logging/log.h" diff --git a/src/core/libraries/voice/voice.h b/src/core/libraries/voice/voice.h index 89467c83c..a144a19dc 100644 --- a/src/core/libraries/voice/voice.h +++ b/src/core/libraries/voice/voice.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/libraries/vr_tracker/vr_tracker.cpp b/src/core/libraries/vr_tracker/vr_tracker.cpp deleted file mode 100644 index 41989aaa1..000000000 --- a/src/core/libraries/vr_tracker/vr_tracker.cpp +++ /dev/null @@ -1,545 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "common/logging/log.h" -#include "core/libraries/error_codes.h" -#include "core/libraries/kernel/time.h" -#include "core/libraries/libs.h" -#include "core/libraries/vr_tracker/vr_tracker.h" -#include "core/libraries/vr_tracker/vr_tracker_error.h" -#include "core/memory.h" -#include "video_core/amdgpu/liverpool.h" - -namespace Libraries::VrTracker { - -static bool g_library_initialized = false; - -// Internal memory -static void* g_garlic_memory_pointer = nullptr; -static u32 g_garlic_size = 0; -static void* g_onion_memory_pointer = nullptr; -static u32 g_onion_size = 0; -static void* g_work_memory_pointer = nullptr; -static u32 g_work_size = 0; - -// Registered handles -static s32 g_pad_handle = -1; -static s32 g_move_handle = -1; -static s32 g_gun_handle = -1; -static s32 g_hmd_handle = -1; - -s32 PS4_SYSV_ABI sceVrTrackerQueryMemory(const OrbisVrTrackerQueryMemoryParam* param, - OrbisVrTrackerQueryMemoryResult* result) { - LOG_DEBUG(Lib_VrTracker, "called"); - if (param == nullptr || result == nullptr || - param->size != sizeof(OrbisVrTrackerQueryMemoryParam) || - (param->profile != OrbisVrTrackerProfile::ORBIS_VR_TRACKER_PROFILE_000 && - param->profile != OrbisVrTrackerProfile::ORBIS_VR_TRACKER_PROFILE_100) || - param->calibration_settings.pad_position > - OrbisVrTrackerCalibrationMode::ORBIS_VR_TRACKER_CALIBRATION_AUTO || - // Hmd doesn't support auto calibration - param->calibration_settings.hmd_position > - OrbisVrTrackerCalibrationMode::ORBIS_VR_TRACKER_CALIBRATION_MANUAL || - param->calibration_settings.move_position > - OrbisVrTrackerCalibrationMode::ORBIS_VR_TRACKER_CALIBRATION_AUTO || - param->calibration_settings.gun_position > - OrbisVrTrackerCalibrationMode::ORBIS_VR_TRACKER_CALIBRATION_AUTO) { - return ORBIS_VR_TRACKER_ERROR_ARGUMENT_INVALID; - } - - // Setting move_position to ORBIS_VR_TRACKER_CALIBRATION_AUTO doubles required onion memory. - u32 required_onion_size = ORBIS_VR_TRACKER_BASE_ONION_SIZE; - if (param->calibration_settings.move_position == - OrbisVrTrackerCalibrationMode::ORBIS_VR_TRACKER_CALIBRATION_AUTO) { - required_onion_size *= 2; - } - - result->direct_memory_onion_size = required_onion_size; - result->direct_memory_onion_alignment = ORBIS_VR_TRACKER_MEMORY_ALIGNMENT; - result->direct_memory_garlic_size = ORBIS_VR_TRACKER_GARLIC_SIZE; - result->direct_memory_garlic_alignment = ORBIS_VR_TRACKER_MEMORY_ALIGNMENT; - result->work_memory_size = ORBIS_VR_TRACKER_WORK_SIZE; - result->work_memory_alignment = ORBIS_VR_TRACKER_MEMORY_ALIGNMENT; - - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceVrTrackerInit(const OrbisVrTrackerInitParam* param) { - if (g_library_initialized) { - return ORBIS_VR_TRACKER_ERROR_ALREADY_INITIALIZED; - } - - // Calculate correct onion size for parameter checks - u32 required_onion_size = ORBIS_VR_TRACKER_BASE_ONION_SIZE; - if (param->calibration_settings.move_position == ORBIS_VR_TRACKER_CALIBRATION_AUTO) { - required_onion_size *= 2; - } - - // Parameter checks are fairly thorough here. - if (param->size != sizeof(OrbisVrTrackerInitParam) || - // Check garlic memory parameters - param->direct_memory_garlic == nullptr || - param->direct_memory_garlic_alignment != ORBIS_VR_TRACKER_MEMORY_ALIGNMENT || - param->direct_memory_garlic_size != ORBIS_VR_TRACKER_GARLIC_SIZE || - // Check onion memory parameters - param->direct_memory_onion == nullptr || - param->direct_memory_onion_alignment != ORBIS_VR_TRACKER_MEMORY_ALIGNMENT || - param->direct_memory_onion_size != required_onion_size || - // Check work memory parameters - param->work_memory == nullptr || - param->work_memory_alignment != ORBIS_VR_TRACKER_MEMORY_ALIGNMENT || - param->work_memory_size != ORBIS_VR_TRACKER_WORK_SIZE || - // Check compute queue parameters - param->gpu_pipe_id >= AmdGpu::Liverpool::NumComputePipes || - param->gpu_queue_id >= AmdGpu::Liverpool::NumQueuesPerPipe || - // Check calibration settings - param->calibration_settings.pad_position > - OrbisVrTrackerCalibrationMode::ORBIS_VR_TRACKER_CALIBRATION_AUTO || - param->calibration_settings.hmd_position > - OrbisVrTrackerCalibrationMode::ORBIS_VR_TRACKER_CALIBRATION_MANUAL || - param->calibration_settings.move_position > - OrbisVrTrackerCalibrationMode::ORBIS_VR_TRACKER_CALIBRATION_AUTO || - param->calibration_settings.gun_position > - OrbisVrTrackerCalibrationMode::ORBIS_VR_TRACKER_CALIBRATION_AUTO) { - return ORBIS_VR_TRACKER_ERROR_ARGUMENT_INVALID; - } - - // Real hardware will segfault if any of the supplied mappings aren't long enough, - // Validate each of them to ensure nothing weird can occur when this library is implemented. - auto* memory = Core::Memory::Instance(); - Libraries::Kernel::OrbisVirtualQueryInfo info; - // The memory type for the whole range should be the same here, - // so the memory should be contained in one VMA. - VAddr addr_to_check = std::bit_cast(param->direct_memory_garlic); - s32 result = memory->VirtualQuery(addr_to_check, 0, &info); - ASSERT_MSG(result == 0 && info.end - addr_to_check >= param->direct_memory_garlic_size, - "Insufficient garlic memory provided"); - - g_garlic_memory_pointer = param->direct_memory_garlic; - g_garlic_size = param->direct_memory_garlic_size; - - addr_to_check = std::bit_cast(param->direct_memory_onion); - result = memory->VirtualQuery(addr_to_check, 0, &info); - ASSERT_MSG(result == 0 && info.end - addr_to_check >= param->direct_memory_onion_size, - "Insufficient onion memory provided"); - - g_onion_memory_pointer = param->direct_memory_onion; - g_onion_size = param->direct_memory_onion_size; - - addr_to_check = std::bit_cast(param->work_memory); - result = memory->VirtualQuery(addr_to_check, 0, &info); - ASSERT_MSG(result == 0 && info.end - addr_to_check >= param->work_memory_size, - "Insufficient work memory provided"); - - g_work_memory_pointer = param->work_memory; - g_work_size = param->work_memory_size; - - // All initialization checks passed. - LOG_WARNING(Lib_VrTracker, "PSVR headsets are not supported yet"); - g_library_initialized = true; - - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceVrTrackerRegisterDevice(const OrbisVrTrackerDeviceType device_type, - const s32 handle) { - LOG_TRACE(Lib_VrTracker, "redirected to sceVrTrackerRegisterDeviceInternal"); - return sceVrTrackerRegisterDeviceInternal(device_type, handle, -1, 0); -} - -s32 PS4_SYSV_ABI sceVrTrackerRegisterDevice2(const OrbisVrTrackerDeviceType device_type, - const s32 handle) { - LOG_TRACE(Lib_VrTracker, "redirected to sceVrTrackerRegisterDeviceInternal"); - return sceVrTrackerRegisterDeviceInternal(device_type, handle, -1, 1); -} - -s32 PS4_SYSV_ABI sceVrTrackerRegisterDeviceInternal(const OrbisVrTrackerDeviceType device_type, - const s32 handle, s32 unk0, s32 unk1) { - LOG_WARNING(Lib_VrTracker, "(STUBBED) called, device_type = {}, handle = {}", - static_cast(device_type), handle); - if (!g_library_initialized) { - return ORBIS_VR_TRACKER_ERROR_NOT_INIT; - } - if (device_type > OrbisVrTrackerDeviceType::ORBIS_VR_TRACKER_DEVICE_GUN || unk0 > 4) { - return ORBIS_VR_TRACKER_ERROR_ARGUMENT_INVALID; - } - - // Ignore handle handle validation for now, since most of that logic isn't really handled. - switch (device_type) { - case OrbisVrTrackerDeviceType::ORBIS_VR_TRACKER_DEVICE_HMD: { - if (g_hmd_handle != -1) { - return ORBIS_VR_TRACKER_ERROR_DEVICE_ALREADY_REGISTERED; - } - g_hmd_handle = handle; - break; - } - case OrbisVrTrackerDeviceType::ORBIS_VR_TRACKER_DEVICE_DUALSHOCK4: { - if (g_pad_handle != -1) { - return ORBIS_VR_TRACKER_ERROR_DEVICE_ALREADY_REGISTERED; - } - g_pad_handle = handle; - break; - } - case OrbisVrTrackerDeviceType::ORBIS_VR_TRACKER_DEVICE_MOVE: { - if (g_move_handle != -1) { - return ORBIS_VR_TRACKER_ERROR_DEVICE_ALREADY_REGISTERED; - } - g_move_handle = handle; - break; - } - case OrbisVrTrackerDeviceType::ORBIS_VR_TRACKER_DEVICE_GUN: { - if (g_gun_handle != -1) { - return ORBIS_VR_TRACKER_ERROR_DEVICE_ALREADY_REGISTERED; - } - g_gun_handle = handle; - break; - } - default: { - // Shouldn't be possible to hit this. - UNREACHABLE(); - } - } - - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceVrTrackerCpuProcess(const OrbisVrTrackerCpuProcessParam* param) { - LOG_ERROR(Lib_VrTracker, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceVrTrackerGetPlayAreaWarningInfo(OrbisVrTrackerPlayAreaWarningInfo* info) { - LOG_ERROR(Lib_VrTracker, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceVrTrackerGetResult(const OrbisVrTrackerGetResultParam* param, - OrbisVrTrackerResultData* result) { - LOG_ERROR(Lib_VrTracker, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceVrTrackerGetTime(u64* time) { - LOG_TRACE(Lib_VrTracker, "called"); - if (!g_library_initialized) { - return ORBIS_VR_TRACKER_ERROR_NOT_INIT; - } - if (time == nullptr) { - return ORBIS_VR_TRACKER_ERROR_ARGUMENT_INVALID; - } - *time = Libraries::Kernel::sceKernelGetProcessTime(); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceVrTrackerGpuSubmit(const OrbisVrTrackerGpuSubmitParam* param) { - LOG_ERROR(Lib_VrTracker, "(STUBBED) called"); - if (!g_library_initialized) { - return ORBIS_VR_TRACKER_ERROR_NOT_INIT; - } - - // Impossible to submit valid data here since sceCameraGetFrameData returns an error. - return ORBIS_VR_TRACKER_ERROR_ARGUMENT_INVALID; -} - -s32 PS4_SYSV_ABI sceVrTrackerGpuWait(const OrbisVrTrackerGpuWaitParam* param) { - LOG_ERROR(Lib_VrTracker, "(STUBBED) called"); - if (!g_library_initialized) { - return ORBIS_VR_TRACKER_ERROR_NOT_INIT; - } - if (param == nullptr || param->size != sizeof(OrbisVrTrackerGpuWaitParam)) { - return ORBIS_VR_TRACKER_ERROR_ARGUMENT_INVALID; - } - - // Impossible to perform GPU submits - return ORBIS_VR_TRACKER_ERROR_NOT_EXECUTE_GPU_SUBMIT; -} - -s32 PS4_SYSV_ABI sceVrTrackerGpuWaitAndCpuProcess() { - LOG_ERROR(Lib_VrTracker, "(STUBBED) called"); - if (!g_library_initialized) { - return ORBIS_VR_TRACKER_ERROR_NOT_INIT; - } - - // Impossible to perform GPU submits - return ORBIS_VR_TRACKER_ERROR_NOT_EXECUTE_GPU_SUBMIT; -} - -s32 PS4_SYSV_ABI -sceVrTrackerNotifyEndOfCpuProcess(const OrbisVrTrackerNotifyEndOfCpuProcessParam* param) { - LOG_ERROR(Lib_VrTracker, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceVrTrackerRecalibrate(const OrbisVrTrackerRecalibrateParam* param) { - LOG_ERROR(Lib_VrTracker, "(STUBBED) called"); - if (!g_library_initialized) { - return ORBIS_VR_TRACKER_ERROR_NOT_INIT; - } - if (param == nullptr || param->size != sizeof(OrbisVrTrackerRecalibrateParam) || - param->device_type > OrbisVrTrackerDeviceType::ORBIS_VR_TRACKER_DEVICE_GUN) { - return ORBIS_VR_TRACKER_ERROR_ARGUMENT_INVALID; - } - - OrbisVrTrackerDeviceType device_type = param->device_type; - switch (device_type) { - case OrbisVrTrackerDeviceType::ORBIS_VR_TRACKER_DEVICE_HMD: { - // Seems like the lack of a connected hmd results in this? - return ORBIS_VR_TRACKER_ERROR_DEVICE_NOT_REGISTERED; - break; - } - case OrbisVrTrackerDeviceType::ORBIS_VR_TRACKER_DEVICE_DUALSHOCK4: { - if (g_pad_handle == -1) { - return ORBIS_VR_TRACKER_ERROR_DEVICE_NOT_REGISTERED; - } - break; - } - case OrbisVrTrackerDeviceType::ORBIS_VR_TRACKER_DEVICE_MOVE: { - if (g_move_handle == -1) { - return ORBIS_VR_TRACKER_ERROR_DEVICE_NOT_REGISTERED; - } - break; - } - case OrbisVrTrackerDeviceType::ORBIS_VR_TRACKER_DEVICE_GUN: { - if (g_gun_handle == -1) { - return ORBIS_VR_TRACKER_ERROR_DEVICE_NOT_REGISTERED; - } - break; - } - default: { - // Shouldn't be possible to hit this. - UNREACHABLE(); - } - } - - // TODO: handle internal recalibration behaviors. - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceVrTrackerResetAll() { - LOG_ERROR(Lib_VrTracker, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceVrTrackerResetOrientationRelative(const OrbisVrTrackerDeviceType device_type, - const s32 handle) { - LOG_ERROR(Lib_VrTracker, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceVrTrackerSaveInternalBuffers() { - LOG_ERROR(Lib_VrTracker, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceVrTrackerSetDurationUntilStatusNotTracking( - const OrbisVrTrackerDeviceType device_type, const u32 duration_camera_frames) { - LOG_ERROR(Lib_VrTracker, "(STUBBED) called"); - if (!g_library_initialized) { - return ORBIS_VR_TRACKER_ERROR_NOT_INIT; - } - if (device_type > OrbisVrTrackerDeviceType::ORBIS_VR_TRACKER_DEVICE_GUN) { - return ORBIS_VR_TRACKER_ERROR_ARGUMENT_INVALID; - } - - // Seems to unconditionally return 0 when parameters are valid. - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceVrTrackerSetExtendedMode() { - LOG_ERROR(Lib_VrTracker, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceVrTrackerSetLEDBrightness() { - LOG_ERROR(Lib_VrTracker, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceVrTrackerSetRestingMode() { - LOG_ERROR(Lib_VrTracker, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI -sceVrTrackerUpdateMotionSensorData(const OrbisVrTrackerUpdateMotionSensorDataParam* param) { - LOG_ERROR(Lib_VrTracker, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_0FA4C949F8D3024E() { - LOG_ERROR(Lib_VrTracker, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_285C6AFC09C42F7E() { - LOG_ERROR(Lib_VrTracker, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_9A6CDB2103664F8A() { - LOG_ERROR(Lib_VrTracker, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_B4D26B7D8B18DF06() { - LOG_ERROR(Lib_VrTracker, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceVrTrackerSetDeviceRejection() { - LOG_ERROR(Lib_VrTracker, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_1119B0BE399F37E7() { - LOG_ERROR(Lib_VrTracker, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_4928B43816BC440D() { - LOG_ERROR(Lib_VrTracker, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_863EF32EFCB0FA9C() { - LOG_ERROR(Lib_VrTracker, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_E6E726CBC85C48F9() { - LOG_ERROR(Lib_VrTracker, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI Func_F6407E46C66DF383() { - LOG_ERROR(Lib_VrTracker, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceVrTrackerCpuPopMarker() { - LOG_ERROR(Lib_VrTracker, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceVrTrackerCpuPushMarker() { - LOG_ERROR(Lib_VrTracker, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceVrTrackerGetLiveCaptureId() { - LOG_ERROR(Lib_VrTracker, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceVrTrackerStartLiveCapture() { - LOG_ERROR(Lib_VrTracker, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceVrTrackerStopLiveCapture() { - LOG_ERROR(Lib_VrTracker, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceVrTrackerUnregisterDevice(const s32 handle) { - LOG_DEBUG(Lib_VrTracker, "called"); - if (!g_library_initialized) { - return ORBIS_VR_TRACKER_ERROR_NOT_INIT; - } - if (handle < 0) { - return ORBIS_VR_TRACKER_ERROR_ARGUMENT_INVALID; - } - // Since this function only takes a handle, compare the handle to registered handles. - if (handle == g_hmd_handle) { - g_hmd_handle = -1; - } else if (handle == g_pad_handle) { - g_pad_handle = -1; - } else if (handle == g_move_handle) { - g_move_handle = -1; - } else if (handle == g_gun_handle) { - g_gun_handle = -1; - } else { - // If none of the handles match up, then return an error. - return ORBIS_VR_TRACKER_ERROR_ARGUMENT_INVALID; - } - - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceVrTrackerTerm() { - LOG_DEBUG(Lib_VrTracker, "called"); - if (!g_library_initialized) { - return ORBIS_VR_TRACKER_ERROR_NOT_INIT; - } - g_library_initialized = false; - return ORBIS_OK; -} - -void RegisterLib(Core::Loader::SymbolsResolver* sym) { - LIB_FUNCTION("24kDA+A0Ox0", "libSceVrTrackerFourDeviceAllowed", 1, "libSceVrTracker", - sceVrTrackerRegisterDevice2); - LIB_FUNCTION("5IFOAYv-62g", "libSceVrTracker", 1, "libSceVrTracker", sceVrTrackerCpuProcess); - LIB_FUNCTION("zvyKP0Z3UvU", "libSceVrTracker", 1, "libSceVrTracker", - sceVrTrackerGetPlayAreaWarningInfo); - LIB_FUNCTION("76OBvrrQXUc", "libSceVrTracker", 1, "libSceVrTracker", sceVrTrackerGetResult); - LIB_FUNCTION("XoeWzXlrnMw", "libSceVrTracker", 1, "libSceVrTracker", sceVrTrackerGetTime); - LIB_FUNCTION("TVegDMLaBB8", "libSceVrTracker", 1, "libSceVrTracker", sceVrTrackerGpuSubmit); - LIB_FUNCTION("gkGuO9dd57M", "libSceVrTracker", 1, "libSceVrTracker", sceVrTrackerGpuWait); - LIB_FUNCTION("ARhgpXvwoR0", "libSceVrTracker", 1, "libSceVrTracker", - sceVrTrackerGpuWaitAndCpuProcess); - LIB_FUNCTION("QkRl7pART9M", "libSceVrTracker", 1, "libSceVrTracker", sceVrTrackerInit); - LIB_FUNCTION("VItTwN8DmS8", "libSceVrTracker", 1, "libSceVrTracker", - sceVrTrackerNotifyEndOfCpuProcess); - LIB_FUNCTION("K7yhYrsIBPc", "libSceVrTracker", 1, "libSceVrTracker", sceVrTrackerQueryMemory); - LIB_FUNCTION("EUCaQtXXYNI", "libSceVrTracker", 1, "libSceVrTracker", sceVrTrackerRecalibrate); - LIB_FUNCTION("sIh8GwcevaQ", "libSceVrTracker", 1, "libSceVrTracker", - sceVrTrackerRegisterDevice); - LIB_FUNCTION("ufexf4aNiwg", "libSceVrTracker", 1, "libSceVrTracker", - sceVrTrackerRegisterDeviceInternal); - LIB_FUNCTION("CtWUbFgmq+I", "libSceVrTracker", 1, "libSceVrTracker", sceVrTrackerResetAll); - LIB_FUNCTION("E0P0sN-wy+4", "libSceVrTracker", 1, "libSceVrTracker", - sceVrTrackerResetOrientationRelative); - LIB_FUNCTION("bDGZVTwwZ1A", "libSceVrTracker", 1, "libSceVrTracker", - sceVrTrackerSaveInternalBuffers); - LIB_FUNCTION("qBjnR0HtMYI", "libSceVrTracker", 1, "libSceVrTracker", - sceVrTrackerSetDurationUntilStatusNotTracking); - LIB_FUNCTION("NhPkY3V8E+8", "libSceVrTracker", 1, "libSceVrTracker", - sceVrTrackerSetExtendedMode); - LIB_FUNCTION("vpsLLotiSUg", "libSceVrTracker", 1, "libSceVrTracker", - sceVrTrackerSetLEDBrightness); - LIB_FUNCTION("lgWSHQ8p4i4", "libSceVrTracker", 1, "libSceVrTracker", - sceVrTrackerSetRestingMode); - LIB_FUNCTION("IBv4P3q1pQ0", "libSceVrTracker", 1, "libSceVrTracker", sceVrTrackerTerm); - LIB_FUNCTION("Q8skQqEwn5c", "libSceVrTracker", 1, "libSceVrTracker", - sceVrTrackerUnregisterDevice); - LIB_FUNCTION("9fvHMUbsom4", "libSceVrTracker", 1, "libSceVrTracker", - sceVrTrackerUpdateMotionSensorData); - LIB_FUNCTION("D6TJSfjTAk4", "libSceVrTracker", 1, "libSceVrTracker", Func_0FA4C949F8D3024E); - LIB_FUNCTION("KFxq-AnEL34", "libSceVrTracker", 1, "libSceVrTracker", Func_285C6AFC09C42F7E); - LIB_FUNCTION("mmzbIQNmT4o", "libSceVrTracker", 1, "libSceVrTracker", Func_9A6CDB2103664F8A); - LIB_FUNCTION("tNJrfYsY3wY", "libSceVrTracker", 1, "libSceVrTracker", Func_B4D26B7D8B18DF06); - LIB_FUNCTION("jGqEkPy0iLU", "libSceVrTrackerDeviceRejection", 1, "libSceVrTracker", - sceVrTrackerSetDeviceRejection); - LIB_FUNCTION("ERmwvjmfN+c", "libSceVrTrackerGpuTest", 1, "libSceVrTracker", - Func_1119B0BE399F37E7); - LIB_FUNCTION("SSi0OBa8RA0", "libSceVrTrackerGpuTest", 1, "libSceVrTracker", - Func_4928B43816BC440D); - LIB_FUNCTION("hj7zLvyw+pw", "libSceVrTrackerGpuTest", 1, "libSceVrTracker", - Func_863EF32EFCB0FA9C); - LIB_FUNCTION("5ucmy8hcSPk", "libSceVrTrackerGpuTest", 1, "libSceVrTracker", - Func_E6E726CBC85C48F9); - LIB_FUNCTION("9kB+RsZt84M", "libSceVrTrackerGpuTest", 1, "libSceVrTracker", - Func_F6407E46C66DF383); - LIB_FUNCTION("sBkAqyF5Gns", "libSceVrTrackerLiveCapture", 1, "libSceVrTracker", - sceVrTrackerCpuPopMarker); - LIB_FUNCTION("rvCywCbc7Pk", "libSceVrTrackerLiveCapture", 1, "libSceVrTracker", - sceVrTrackerCpuPushMarker); - LIB_FUNCTION("lm6T1Ur6JRk", "libSceVrTrackerLiveCapture", 1, "libSceVrTracker", - sceVrTrackerGetLiveCaptureId); - LIB_FUNCTION("qa1+CeXKDPc", "libSceVrTrackerLiveCapture", 1, "libSceVrTracker", - sceVrTrackerStartLiveCapture); - LIB_FUNCTION("3YCwwpHkHIg", "libSceVrTrackerLiveCapture", 1, "libSceVrTracker", - sceVrTrackerStopLiveCapture); -}; - -} // namespace Libraries::VrTracker \ No newline at end of file diff --git a/src/core/libraries/vr_tracker/vr_tracker.h b/src/core/libraries/vr_tracker/vr_tracker.h deleted file mode 100644 index 6a052c5fb..000000000 --- a/src/core/libraries/vr_tracker/vr_tracker.h +++ /dev/null @@ -1,407 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "common/types.h" -#include "core/libraries/camera/camera.h" - -namespace Core::Loader { -class SymbolsResolver; -} - -namespace Libraries::VrTracker { - -static constexpr s32 ORBIS_VR_TRACKER_MAX_LED_NUM = 16; -static constexpr u32 ORBIS_VR_TRACKER_MEMORY_ALIGNMENT = 0x10000; -static constexpr u32 ORBIS_VR_TRACKER_BASE_ONION_SIZE = 0x400000; -static constexpr u32 ORBIS_VR_TRACKER_GARLIC_SIZE = 0x3000000; -static constexpr u32 ORBIS_VR_TRACKER_WORK_SIZE = 0x1000000; - -enum OrbisVrTrackerProfile { - ORBIS_VR_TRACKER_PROFILE_000 = 0, - ORBIS_VR_TRACKER_PROFILE_100 = 100, -}; - -enum OrbisVrTrackerCalibrationMode { - ORBIS_VR_TRACKER_CALIBRATION_MANUAL = 0, - ORBIS_VR_TRACKER_CALIBRATION_AUTO = 1, -}; - -enum OrbisVrTrackerExecutionMode { - ORBIS_VR_TRACKER_EXECUTION_MODE_SERIAL = 0, - ORBIS_VR_TRACKER_EXECUTION_MODE_PARALLEL = 1, -}; - -enum OrbisVrTrackerDeviceType { - ORBIS_VR_TRACKER_DEVICE_HMD = 0, - ORBIS_VR_TRACKER_DEVICE_DUALSHOCK4 = 1, - ORBIS_VR_TRACKER_DEVICE_MOVE = 2, - ORBIS_VR_TRACKER_DEVICE_GUN = 3, -}; - -enum OrbisVrTrackerCalibrationType { - ORBIS_VR_TRACKER_CALIBRATION_POSITION = 0, - ORBIS_VR_TRACKER_CALIBRATION_ALL = 2, -}; - -enum OrbisVrTrackerPreferenceType { - ORBIS_VR_TRACKER_PREFERENCE_FAR_POSITION = 0, - ORBIS_VR_TRACKER_PREFERENCE_STABLE_POSITION = 1, -}; - -enum OrbisVrTrackerCameraMetaCheckMode { - ORBIS_VR_TRACKER_CAMERA_META_CHECK_ENABLE = 0, - ORBIS_VR_TRACKER_CAMERA_META_CHECK_DISABLE = 1, -}; - -enum OrbisVrTrackerDevicePermitType { - ORBIS_VR_TRACKER_DEVICE_PERMIT_ALL = 0, - ORBIS_VR_TRACKER_DEVICE_PERMIT_HMD_ONLY = 1, -}; - -enum OrbisVrTrackerRobustnessLevel { - ORBIS_VR_TRACKER_ROBUSTNESS_LEVEL_HIGH = 0, - ORBIS_VR_TRACKER_ROBUSTNESS_LEVEL_LOW = 3, - ORBIS_VR_TRACKER_ROBUSTNESS_LEVEL_MEDIUM = 6, - ORBIS_VR_TRACKER_ROBUSTNESS_LEVEL_LEGACY = 99, -}; - -enum OrbisVrTrackerCpuProcessOperationMode { - ORBIS_VR_TRACKER_CPU_PROCESS_OPERATION_MODE_WHOLE = 0, - ORBIS_VR_TRACKER_CPU_PROCESS_OPERATION_MODE_HANDLE = 1, -}; - -enum OrbisVrTrackerUpdateMotionSensorDataOperationMode { - ORBIS_VR_TRACKER_UPDATE_MOTION_SENSORDATA_OPERATION_MODE_DEVICE_TYPE = 0, - ORBIS_VR_TRACKER_UPDATE_MOTION_SENSORDATA_OPERATION_MODE_HANDLE = 1, -}; - -enum OrbisVrTrackerResultType { - ORBIS_VR_TRACKER_RESULT_PREDICTED = 0, - ORBIS_VR_TRACKER_RESULT_RAW = 1, -}; - -enum OrbisVrTrackerOrientationType { - ORBIS_VR_TRACKER_ORIENTATION_ABSOLUTE = 0, - ORBIS_VR_TRACKER_ORIENTATION_RELATIVE = 1, -}; - -enum OrbisVrTrackerUsageType { - ORBIS_VR_TRACKER_USAGE_DEFAULT = 0, - ORBIS_VR_TRACKER_USAGE_OPTIMIZED_FOR_HMD_USER = 1, -}; - -enum OrbisVrTrackerDebugMarkerType { - ORBIS_VR_TRACKER_DEBUG_MARKER_UNSPECIFIED = 0, - ORBIS_VR_TRACKER_DEBUG_MARKER_DEFAULT_UPDATE = 1, - ORBIS_VR_TRACKER_DEBUG_MARKER_FINAL_UPDATE = 2, - ORBIS_VR_TRACKER_DEBUG_MARKER_OTHER = 3, -}; - -enum OrbisVrTrackerRecalibrateNecessityType { - ORBIS_VR_TRACKER_RECALIBRATE_NECESSITY_NOTHING = 0, - ORBIS_VR_TRACKER_RECALIBRATE_NECESSITY_POSITION = 4, -}; - -enum OrbisVrTrackerPlayareaBrightnessRiskType { - ORBIS_VR_TRACKER_PLAYAREA_BRIGHTNESS_RISK_LOW = 0, - ORBIS_VR_TRACKER_PLAYAREA_BRIGHTNESS_RISK_HIGH = 5, - ORBIS_VR_TRACKER_PLAYAREA_BRIGHTNESS_RISK_MAX = 10, -}; - -enum OrbisVrTrackerLedColor { - ORBIS_VR_TRACKER_LED_COLOR_BLUE = 0, - ORBIS_VR_TRACKER_LED_COLOR_RED = 1, - ORBIS_VR_TRACKER_LED_COLOR_CYAN = 2, - ORBIS_VR_TRACKER_LED_COLOR_MAGENTA = 3, - ORBIS_VR_TRACKER_LED_COLOR_YELLOW = 4, - ORBIS_VR_TRACKER_LED_COLOR_GREEN = 2 -}; - -enum OrbisVrTrackerStatus { - ORBIS_VR_TRACKER_STATUS_NOT_STARTED = 0, - ORBIS_VR_TRACKER_STATUS_TRACKING = 1, - ORBIS_VR_TRACKER_STATUS_NOT_TRACKING = 2, - ORBIS_VR_TRACKER_STATUS_CALIBRATING = 3, -}; - -enum OrbisVrTrackerQuality { - ORBIS_VR_TRACKER_QUALITY_NONE = 0, - ORBIS_VR_TRACKER_QUALITY_NOT_VISIBLE = 3, - ORBIS_VR_TRACKER_QUALITY_PARTIAL = 6, - ORBIS_VR_TRACKER_QUALITY_FULL = 9, -}; - -enum OrbisVrTrackerLedAdjustmentStatus { - ORBIS_VR_TRACKER_LED_ADJUSTMENT_NOT_USED = 0, - ORBIS_VR_TRACKER_LED_ADJUSTMENT_USED = 1, -}; - -enum OrbisVrTrackerHmdRearTrackingStatus { - ORBIS_VR_TRACKER_REAR_TRACKING_NOT_READY = 0, - ORBIS_VR_TRACKER_REAR_TRACKING_READY = 1, -}; - -struct OrbisVrTrackerCalibrationSettings { - OrbisVrTrackerCalibrationMode hmd_position; - OrbisVrTrackerCalibrationMode pad_position; - OrbisVrTrackerCalibrationMode move_position; - OrbisVrTrackerCalibrationMode gun_position; - u32 reserved[4]; -}; - -struct OrbisVrTrackerQueryMemoryParam { - u32 size; - OrbisVrTrackerProfile profile; - u32 reserved[6]; - OrbisVrTrackerCalibrationSettings calibration_settings; -}; - -struct OrbisVrTrackerQueryMemoryResult { - u32 size; - u32 direct_memory_onion_size; - u32 direct_memory_onion_alignment; - u32 direct_memory_garlic_size; - u32 direct_memory_garlic_alignment; - u32 work_memory_size; - u32 work_memory_alignment; - u32 reserved[9]; -}; - -struct OrbisVrTrackerInitParam { - u32 size; - OrbisVrTrackerProfile profile; - OrbisVrTrackerExecutionMode execution_mode; - s32 hmd_thread_priority; - s32 pad_thread_priority; - s32 move_thread_priority; - s32 gun_thread_priority; - s32 reserved; - u64 cpu_mask; - OrbisVrTrackerCalibrationSettings calibration_settings; - void* direct_memory_onion; - u32 direct_memory_onion_size; - u32 direct_memory_onion_alignment; - void* direct_memory_garlic; - u32 direct_memory_garlic_size; - u32 direct_memory_garlic_alignment; - void* work_memory; - u32 work_memory_size; - u32 work_memory_alignment; - s32 gpu_pipe_id; - s32 gpu_queue_id; -}; - -struct OrbisVrTrackerRecalibrateParam { - u32 size; - OrbisVrTrackerDeviceType device_type; - OrbisVrTrackerCalibrationType calibration_type; - u32 reserved[5]; -}; - -struct OrbisVrTrackerGpuSubmitParam { - u32 size; - OrbisVrTrackerPreferenceType pad_tracking_preference; - OrbisVrTrackerCameraMetaCheckMode camera_meta_check_mode; - OrbisVrTrackerDevicePermitType tracking_device_permit_type; - OrbisVrTrackerRobustnessLevel robustness_level; - u32 reserved0[10]; - u32 reserved1; - Libraries::Camera::OrbisCameraFrameData camera_frame_data; -}; - -struct OrbisVrTrackerGpuWaitParam { - u32 size; - u32 reserved[7]; -}; - -struct OrbisVrTrackerCpuProcessParam { - u32 size; - OrbisVrTrackerCpuProcessOperationMode operation_mode; - s32 handle; - u32 reserved[5]; -}; - -struct OrbisVrTrackerNotifyEndOfCpuProcessParam { - u32 size; - u32 reserved[7]; -}; - -struct OrbisVrTrackerUpdateMotionSensorDataParam { - u32 size; - OrbisVrTrackerDeviceType device_type; - OrbisVrTrackerUpdateMotionSensorDataOperationMode operation_mode; - s32 handle; - s32 reserved[4]; -}; - -struct OrbisVrTrackerGetResultParam { - u32 size; - s32 handle; - OrbisVrTrackerResultType result_type; - u32 reserved0; - u64 prediction_time; - OrbisVrTrackerOrientationType orientation_type; - u32 reserved1; - OrbisVrTrackerUsageType usage_type; - u32 user_frame_number; - OrbisVrTrackerDebugMarkerType debug_marker_type; - u32 reserved2[2]; -}; - -struct OrbisVrTrackerPoseData { - float position_x; - float position_y; - float position_z; - u32 reserved0[1]; - float orientation_x; - float orientation_y; - float orientation_z; - float orientation_w; - u32 reserved1[8]; -}; - -struct OrbisVrTrackerHmdInfo { - OrbisVrTrackerPoseData device_pose; - OrbisVrTrackerPoseData left_eye_pose; - OrbisVrTrackerPoseData right_eye_pose; - OrbisVrTrackerPoseData head_pose; - OrbisVrTrackerHmdRearTrackingStatus rear_tracking_status; - u32 reserved0[3]; - u64 sensor_read_system_timestamp; - u32 reserved1[10]; -}; - -struct OrbisVrTrackerPadInfo { - OrbisVrTrackerPoseData device_pose; - u32 reserved[64]; -}; - -struct OrbisVrTrackerMoveInfo { - OrbisVrTrackerPoseData device_pose; - u32 reserved[64]; -}; - -struct OrbisVrTrackerGunInfo { - OrbisVrTrackerPoseData device_pose; - u32 reserved[64]; -}; - -struct OrbisVrTrackerLedResult { - float x; - float y; - float rx; - float ry; - u32 reserved[4]; -}; - -struct OrbisVrTrackerResultData { - s32 handle; - u32 connected; - u32 reserved0[2]; - u64 timestamp; - u64 device_timestamp; - OrbisVrTrackerRecalibrateNecessityType recalibrate_necessity; - OrbisVrTrackerPlayareaBrightnessRiskType playarea_brightness_risk; - u32 reserved1[2]; - OrbisVrTrackerLedColor led_color; - OrbisVrTrackerStatus status; - OrbisVrTrackerQuality position_quality; - OrbisVrTrackerQuality orientation_quality; - float velocity_x; - float velocity_y; - float velocity_z; - float acceleration_x; - float acceleration_y; - float acceleration_z; - float angular_velocity_x; - float angular_velocity_y; - float angular_velocity_z; - float angular_acceleration_x; - float angular_acceleration_y; - float angular_acceleration_z; - float camera_orientation_x; - float camera_orientation_y; - float camera_orientation_z; - float camera_orientation_w; - union { - OrbisVrTrackerHmdInfo hmd_info; - OrbisVrTrackerPadInfo pad_info; - OrbisVrTrackerMoveInfo move_info; - OrbisVrTrackerGunInfo gun_info; - }; - u32 user_frame_number; - OrbisVrTrackerLedAdjustmentStatus led_adjustment_status; - u64 timestamp_of_led_result; - u32 reserved2[2]; - s32 number_of_led_result[Libraries::Camera::ORBIS_CAMERA_MAX_DEVICE_NUM]; - u32 reserved3[4]; - OrbisVrTrackerLedResult led[Libraries::Camera::ORBIS_CAMERA_MAX_DEVICE_NUM] - [ORBIS_VR_TRACKER_MAX_LED_NUM]; -}; - -struct OrbisVrTrackerPlayAreaWarningInfo { - u32 size; - u32 reserved0[3]; - bool is_out_of_play_area; - u8 reserved1[3]; - u32 reserved2[3]; - bool is_distance_data_valid; - u8 reserved3[3]; - float distance_from_vertical_boundary; - float distance_from_horizontal_boundary; - u32 reserved4[5]; -}; - -s32 PS4_SYSV_ABI sceVrTrackerQueryMemory(const OrbisVrTrackerQueryMemoryParam* param, - OrbisVrTrackerQueryMemoryResult* result); -s32 PS4_SYSV_ABI sceVrTrackerInit(const OrbisVrTrackerInitParam* param); -s32 PS4_SYSV_ABI sceVrTrackerRegisterDevice(const OrbisVrTrackerDeviceType device_type, - const s32 handle); -s32 PS4_SYSV_ABI sceVrTrackerRegisterDevice2(const OrbisVrTrackerDeviceType device_type, - const s32 handle); -s32 PS4_SYSV_ABI sceVrTrackerRegisterDeviceInternal(const OrbisVrTrackerDeviceType device_type, - const s32 handle, s32 unk0, s32 unk1); -s32 PS4_SYSV_ABI sceVrTrackerCpuProcess(const OrbisVrTrackerCpuProcessParam* param); -s32 PS4_SYSV_ABI sceVrTrackerGetPlayAreaWarningInfo(OrbisVrTrackerPlayAreaWarningInfo* info); -s32 PS4_SYSV_ABI sceVrTrackerGetResult(const OrbisVrTrackerGetResultParam* param, - OrbisVrTrackerResultData* result); -s32 PS4_SYSV_ABI sceVrTrackerGetTime(u64* time); -s32 PS4_SYSV_ABI sceVrTrackerGpuSubmit(const OrbisVrTrackerGpuSubmitParam* param); -s32 PS4_SYSV_ABI sceVrTrackerGpuWait(const OrbisVrTrackerGpuWaitParam* param); -s32 PS4_SYSV_ABI sceVrTrackerGpuWaitAndCpuProcess(); -s32 PS4_SYSV_ABI -sceVrTrackerNotifyEndOfCpuProcess(const OrbisVrTrackerNotifyEndOfCpuProcessParam* param); -s32 PS4_SYSV_ABI sceVrTrackerRecalibrate(const OrbisVrTrackerRecalibrateParam* param); -s32 PS4_SYSV_ABI sceVrTrackerResetAll(); -s32 PS4_SYSV_ABI sceVrTrackerResetOrientationRelative(const OrbisVrTrackerDeviceType device_type, - const s32 handle); -s32 PS4_SYSV_ABI sceVrTrackerSaveInternalBuffers(); -s32 PS4_SYSV_ABI sceVrTrackerSetDurationUntilStatusNotTracking( - const OrbisVrTrackerDeviceType device_type, const u32 duration_camera_frames); -s32 PS4_SYSV_ABI sceVrTrackerSetExtendedMode(); -s32 PS4_SYSV_ABI sceVrTrackerSetLEDBrightness(); -s32 PS4_SYSV_ABI sceVrTrackerSetRestingMode(); -s32 PS4_SYSV_ABI -sceVrTrackerUpdateMotionSensorData(const OrbisVrTrackerUpdateMotionSensorDataParam* param); -s32 PS4_SYSV_ABI Func_0FA4C949F8D3024E(); -s32 PS4_SYSV_ABI Func_285C6AFC09C42F7E(); -s32 PS4_SYSV_ABI Func_9A6CDB2103664F8A(); -s32 PS4_SYSV_ABI Func_B4D26B7D8B18DF06(); -s32 PS4_SYSV_ABI sceVrTrackerSetDeviceRejection(); -s32 PS4_SYSV_ABI Func_1119B0BE399F37E7(); -s32 PS4_SYSV_ABI Func_4928B43816BC440D(); -s32 PS4_SYSV_ABI Func_863EF32EFCB0FA9C(); -s32 PS4_SYSV_ABI Func_E6E726CBC85C48F9(); -s32 PS4_SYSV_ABI Func_F6407E46C66DF383(); -s32 PS4_SYSV_ABI sceVrTrackerCpuPopMarker(); -s32 PS4_SYSV_ABI sceVrTrackerCpuPushMarker(); -s32 PS4_SYSV_ABI sceVrTrackerGetLiveCaptureId(); -s32 PS4_SYSV_ABI sceVrTrackerStartLiveCapture(); -s32 PS4_SYSV_ABI sceVrTrackerStopLiveCapture(); -s32 PS4_SYSV_ABI sceVrTrackerUnregisterDevice(const s32 handle); -s32 PS4_SYSV_ABI sceVrTrackerTerm(); - -void RegisterLib(Core::Loader::SymbolsResolver* sym); -} // namespace Libraries::VrTracker \ No newline at end of file diff --git a/src/core/libraries/vr_tracker/vr_tracker_error.h b/src/core/libraries/vr_tracker/vr_tracker_error.h deleted file mode 100644 index a096229cf..000000000 --- a/src/core/libraries/vr_tracker/vr_tracker_error.h +++ /dev/null @@ -1,36 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -constexpr int ORBIS_VR_TRACKER_ERROR_NOT_INIT = 0x81260801; -constexpr int ORBIS_VR_TRACKER_ERROR_ALREADY_INITIALIZED = 0x81260802; -constexpr int ORBIS_VR_TRACKER_ERROR_DEVICE_NOT_REGISTERED = 0x81260803; -constexpr int ORBIS_VR_TRACKER_ERROR_DEVICE_ALREADY_REGISTERED = 0x81260804; -constexpr int ORBIS_VR_TRACKER_ERROR_DEVICE_LIMIT = 0x81260805; -constexpr int ORBIS_VR_TRACKER_ERROR_ARGUMENT_INVALID = 0x81260806; -constexpr int ORBIS_VR_TRACKER_ERROR_INVALID_DEVICE_HANDLE = 0x81260807; -constexpr int ORBIS_VR_TRACKER_ERROR_BUSY = 0x81260808; -constexpr int ORBIS_VR_TRACKER_ERROR_INTERNAL_ERROR = 0x81260809; -constexpr int ORBIS_VR_TRACKER_ERROR_NO_MOTION_SENSOR_DATA = 0x8126080A; -constexpr int ORBIS_VR_TRACKER_ERROR_DEVICE_NOT_ORIENTED = 0x8126080B; -constexpr int ORBIS_VR_TRACKER_ERROR_TIMESTAMP_OUT_OF_RANGE = 0x8126080C; -constexpr int ORBIS_VR_TRACKER_ERROR_CAMERA_ACCELEROMETER_INVALID_DATA = 0x8126080D; -constexpr int ORBIS_VR_TRACKER_ERROR_NOT_EXECUTE_GPU_PROCESS = 0x8126080E; -constexpr int ORBIS_VR_TRACKER_ERROR_NOT_ENOUGH_SENSOR_HISTORY = 0x8126080F; -constexpr int ORBIS_VR_TRACKER_ERROR_NOT_YET_DETECTING_FRONT_LID = 0x81260810; -constexpr int ORBIS_VR_TRACKER_ERROR_ALREADY_PROCESSING_CAMERA_FRAME = 0x81260811; -constexpr int ORBIS_VR_TRACKER_ERROR_INVALID_CAMERA_CONFIGURATION = 0x81260812; -constexpr int ORBIS_VR_TRACKER_ERROR_INVALID_STATUS_OF_CAMERA_FRAME = 0x81260813; -constexpr int ORBIS_VR_TRACKER_ERROR_PLAYSTATION_CAMERA_NOT_CONNECTED = 0x81260814; -constexpr int ORBIS_VR_TRACKER_ERROR_NOT_EXECUTE_GPU_SUBMIT = 0x81260815; -constexpr int ORBIS_VR_TRACKER_ERROR_NOT_EXECUTE_GPU_WAIT = 0x81260816; -constexpr int ORBIS_VR_TRACKER_ERROR_UPDATE_HMD_MOTION_SENSOR_DATA = 0x81260817; -constexpr int ORBIS_VR_TRACKER_ERROR_UPDATE_DS4_MOTION_SENSOR_DATA = 0x81260818; -constexpr int ORBIS_VR_TRACKER_ERROR_UPDATE_MOVE_MOTION_SENSOR_DATA = 0x81260819; -constexpr int ORBIS_VR_TRACKER_ERROR_CAMERA_ADJUSTMENT_IS_NECESSARY = 0x8126081A; -constexpr int ORBIS_VR_TRACKER_ERROR_NOT_EXECUTE_CPU_PROCESS = 0x8126081B; -constexpr int ORBIS_VR_TRACKER_ERROR_NOT_STARTED = 0x8126081C; -constexpr int ORBIS_VR_TRACKER_ERROR_INVALID_CPU_MODE = 0x8126081D; -constexpr int ORBIS_VR_TRACKER_ERROR_NOT_SUPPORTED = 0x8126081E; -constexpr int ORBIS_VR_TRACKER_ERROR_FATAL = 0x812608FF; \ No newline at end of file diff --git a/src/core/libraries/web_browser_dialog/webbrowserdialog.cpp b/src/core/libraries/web_browser_dialog/webbrowserdialog.cpp deleted file mode 100644 index 5844affa2..000000000 --- a/src/core/libraries/web_browser_dialog/webbrowserdialog.cpp +++ /dev/null @@ -1,128 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "common/logging/log.h" -#include "core/libraries/error_codes.h" -#include "core/libraries/libs.h" -#include "core/libraries/web_browser_dialog/webbrowserdialog.h" -#include "magic_enum/magic_enum.hpp" - -namespace Libraries::WebBrowserDialog { - -static auto g_status = Libraries::CommonDialog::Status::NONE; - -s32 PS4_SYSV_ABI sceWebBrowserDialogClose() { - LOG_ERROR(Lib_WebBrowserDialog, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceWebBrowserDialogGetEvent() { - LOG_ERROR(Lib_WebBrowserDialog, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceWebBrowserDialogGetResult() { - LOG_ERROR(Lib_WebBrowserDialog, "(STUBBED) called"); - return ORBIS_OK; -} - -Libraries::CommonDialog::Status PS4_SYSV_ABI sceWebBrowserDialogGetStatus() { - LOG_TRACE(Lib_MsgDlg, "called status={}", magic_enum::enum_name(g_status)); - return g_status; -} - -Libraries::CommonDialog::Error PS4_SYSV_ABI sceWebBrowserDialogInitialize() { - if (CommonDialog::g_isInitialized) { - LOG_INFO(Lib_WebBrowserDialog, "already initialized"); - return Libraries::CommonDialog::Error::ALREADY_SYSTEM_INITIALIZED; - } - LOG_DEBUG(Lib_WebBrowserDialog, "initialized"); - CommonDialog::g_isInitialized = true; - return Libraries::CommonDialog::Error::OK; -} - -s32 PS4_SYSV_ABI sceWebBrowserDialogNavigate() { - LOG_ERROR(Lib_WebBrowserDialog, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceWebBrowserDialogOpen() { - LOG_ERROR(Lib_WebBrowserDialog, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceWebBrowserDialogOpenForPredeterminedContent() { - LOG_ERROR(Lib_WebBrowserDialog, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceWebBrowserDialogResetCookie() { - LOG_ERROR(Lib_WebBrowserDialog, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceWebBrowserDialogSetCookie() { - LOG_ERROR(Lib_WebBrowserDialog, "(STUBBED) called"); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceWebBrowserDialogSetZoom() { - LOG_ERROR(Lib_WebBrowserDialog, "(STUBBED) called"); - return ORBIS_OK; -} - -Libraries::CommonDialog::Error PS4_SYSV_ABI sceWebBrowserDialogTerminate() { - if (g_status == Libraries::CommonDialog::Status::RUNNING) { - LOG_ERROR(Lib_WebBrowserDialog, - "CloseWebBrowser Dialog unimplemented"); // sceWebBrowserDialogClose(); - } - if (g_status == Libraries::CommonDialog::Status::NONE) { - return Libraries::CommonDialog::Error::NOT_INITIALIZED; - } - g_status = Libraries::CommonDialog::Status::NONE; - CommonDialog::g_isUsed = false; - return Libraries::CommonDialog::Error::OK; -} - -Libraries::CommonDialog::Status PS4_SYSV_ABI sceWebBrowserDialogUpdateStatus() { - LOG_TRACE(Lib_MsgDlg, "called status={}", magic_enum::enum_name(g_status)); - return g_status; -} - -s32 PS4_SYSV_ABI Func_F2BE042771625F8C() { - LOG_ERROR(Lib_WebBrowserDialog, "(STUBBED) called"); - return ORBIS_OK; -} - -void RegisterLib(Core::Loader::SymbolsResolver* sym) { - LIB_FUNCTION("PSK+Eik919Q", "libSceWebBrowserDialog", 1, "libSceWebBrowserDialog", - sceWebBrowserDialogClose); - LIB_FUNCTION("Wit4LjeoeX4", "libSceWebBrowserDialog", 1, "libSceWebBrowserDialog", - sceWebBrowserDialogGetEvent); - LIB_FUNCTION("vCaW0fgVQmc", "libSceWebBrowserDialog", 1, "libSceWebBrowserDialog", - sceWebBrowserDialogGetResult); - LIB_FUNCTION("CFTG6a8TjOU", "libSceWebBrowserDialog", 1, "libSceWebBrowserDialog", - sceWebBrowserDialogGetStatus); - LIB_FUNCTION("jqb7HntFQFc", "libSceWebBrowserDialog", 1, "libSceWebBrowserDialog", - sceWebBrowserDialogInitialize); - LIB_FUNCTION("uYELOMVnmNQ", "libSceWebBrowserDialog", 1, "libSceWebBrowserDialog", - sceWebBrowserDialogNavigate); - LIB_FUNCTION("FraP7debcdg", "libSceWebBrowserDialog", 1, "libSceWebBrowserDialog", - sceWebBrowserDialogOpen); - LIB_FUNCTION("O7dIZQrwVFY", "libSceWebBrowserDialog", 1, "libSceWebBrowserDialog", - sceWebBrowserDialogOpenForPredeterminedContent); - LIB_FUNCTION("Cya+jvTtPqg", "libSceWebBrowserDialog", 1, "libSceWebBrowserDialog", - sceWebBrowserDialogResetCookie); - LIB_FUNCTION("TZnDVkP91Rg", "libSceWebBrowserDialog", 1, "libSceWebBrowserDialog", - sceWebBrowserDialogSetCookie); - LIB_FUNCTION("RLhKBOoNyXY", "libSceWebBrowserDialog", 1, "libSceWebBrowserDialog", - sceWebBrowserDialogSetZoom); - LIB_FUNCTION("ocHtyBwHfys", "libSceWebBrowserDialog", 1, "libSceWebBrowserDialog", - sceWebBrowserDialogTerminate); - LIB_FUNCTION("h1dR-t5ISgg", "libSceWebBrowserDialog", 1, "libSceWebBrowserDialog", - sceWebBrowserDialogUpdateStatus); - LIB_FUNCTION("8r4EJ3FiX4w", "libSceWebBrowserDialogLimited", 1, "libSceWebBrowserDialog", - Func_F2BE042771625F8C); -}; - -} // namespace Libraries::WebBrowserDialog \ No newline at end of file diff --git a/src/core/libraries/web_browser_dialog/webbrowserdialog.h b/src/core/libraries/web_browser_dialog/webbrowserdialog.h deleted file mode 100644 index 3dad7e1e9..000000000 --- a/src/core/libraries/web_browser_dialog/webbrowserdialog.h +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include -#include "common/types.h" - -namespace Core::Loader { -class SymbolsResolver; -} - -namespace Libraries::WebBrowserDialog { - -s32 PS4_SYSV_ABI sceWebBrowserDialogClose(); -s32 PS4_SYSV_ABI sceWebBrowserDialogGetEvent(); -s32 PS4_SYSV_ABI sceWebBrowserDialogGetResult(); -Libraries::CommonDialog::Status PS4_SYSV_ABI sceWebBrowserDialogGetStatus(); -Libraries::CommonDialog::Error PS4_SYSV_ABI sceWebBrowserDialogInitialize(); -s32 PS4_SYSV_ABI sceWebBrowserDialogNavigate(); -s32 PS4_SYSV_ABI sceWebBrowserDialogOpen(); -s32 PS4_SYSV_ABI sceWebBrowserDialogOpenForPredeterminedContent(); -s32 PS4_SYSV_ABI sceWebBrowserDialogResetCookie(); -s32 PS4_SYSV_ABI sceWebBrowserDialogSetCookie(); -s32 PS4_SYSV_ABI sceWebBrowserDialogSetZoom(); -Libraries::CommonDialog::Error PS4_SYSV_ABI sceWebBrowserDialogTerminate(); -Libraries::CommonDialog::Status PS4_SYSV_ABI sceWebBrowserDialogUpdateStatus(); -s32 PS4_SYSV_ABI Func_F2BE042771625F8C(); - -void RegisterLib(Core::Loader::SymbolsResolver* sym); -} // namespace Libraries::WebBrowserDialog \ No newline at end of file diff --git a/src/core/libraries/zlib/zlib.cpp b/src/core/libraries/zlib/zlib.cpp deleted file mode 100644 index 57b67460f..000000000 --- a/src/core/libraries/zlib/zlib.cpp +++ /dev/null @@ -1,183 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include -#include -#include -#include -#include -#include - -#include "common/logging/log.h" -#include "common/thread.h" -#include "core/libraries/kernel/threads.h" -#include "core/libraries/libs.h" -#include "core/libraries/zlib/zlib_error.h" -#include "core/libraries/zlib/zlib_sce.h" - -namespace Libraries::Zlib { - -struct InflateTask { - u64 request_id; - const void* src; - u32 src_length; - void* dst; - u32 dst_length; -}; - -struct InflateResult { - u32 length; - s32 status; -}; - -static Kernel::Thread task_thread; - -static std::mutex mutex; -static std::queue task_queue; -static std::condition_variable_any task_queue_cv; -static std::queue done_queue; -static std::condition_variable_any done_queue_cv; -static std::unordered_map results; -static u64 next_request_id; - -void ZlibTaskThread(const std::stop_token& stop) { - Common::SetCurrentThreadName("shadPS4:ZlibTaskThread"); - - while (!stop.stop_requested()) { - InflateTask task; - { - // Lock and pop from the task queue, unless stop has been requested. - std::unique_lock lock(mutex); - if (!task_queue_cv.wait(lock, stop, [&] { return !task_queue.empty(); })) { - break; - } - task = task_queue.front(); - task_queue.pop(); - } - - uLongf decompressed_length = task.dst_length; - const auto ret = uncompress(static_cast(task.dst), &decompressed_length, - static_cast(task.src), task.src_length); - - { - // Lock, insert the new result, and push the finished request ID to the done queue. - std::unique_lock lock(mutex); - results[task.request_id] = InflateResult{ - .length = static_cast(decompressed_length), - .status = ret == Z_BUF_ERROR ? ORBIS_ZLIB_ERROR_NOSPACE - : ret == Z_OK ? ORBIS_OK - : ORBIS_ZLIB_ERROR_FATAL, - }; - done_queue.push(task.request_id); - } - done_queue_cv.notify_one(); - } -} - -s32 PS4_SYSV_ABI sceZlibInitialize(const void* buffer, u32 length) { - LOG_INFO(Lib_Zlib, "called"); - if (task_thread.Joinable()) { - return ORBIS_ZLIB_ERROR_ALREADY_INITIALIZED; - } - - // Initialize with empty task data - task_queue = std::queue(); - done_queue = std::queue(); - results.clear(); - next_request_id = 1; - - task_thread.Run([](const std::stop_token& stop) { ZlibTaskThread(stop); }); - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceZlibInflate(const void* src, u32 src_len, void* dst, u32 dst_len, - u64* request_id) { - LOG_DEBUG(Lib_Zlib, "(STUBBED) called"); - if (!task_thread.Joinable()) { - return ORBIS_ZLIB_ERROR_NOT_INITIALIZED; - } - if (!src || !src_len || !dst || !dst_len || !request_id || dst_len > 64_KB || - dst_len % 2_KB != 0) { - return ORBIS_ZLIB_ERROR_INVALID; - } - - { - std::unique_lock lock(mutex); - *request_id = next_request_id++; - task_queue.emplace(InflateTask{ - .request_id = *request_id, - .src = src, - .src_length = src_len, - .dst = dst, - .dst_length = dst_len, - }); - task_queue_cv.notify_one(); - } - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceZlibWaitForDone(u64* request_id, const u32* timeout) { - LOG_DEBUG(Lib_Zlib, "(STUBBED) called"); - if (!task_thread.Joinable()) { - return ORBIS_ZLIB_ERROR_NOT_INITIALIZED; - } - if (!request_id) { - return ORBIS_ZLIB_ERROR_INVALID; - } - - { - // Pop from the done queue, unless the timeout is reached. - std::unique_lock lock(mutex); - const auto pred = [] { return !done_queue.empty(); }; - if (timeout) { - if (!done_queue_cv.wait_for(lock, std::chrono::milliseconds(*timeout), pred)) { - return ORBIS_ZLIB_ERROR_TIMEDOUT; - } - } else { - done_queue_cv.wait(lock, pred); - } - *request_id = done_queue.front(); - done_queue.pop(); - } - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceZlibGetResult(const u64 request_id, u32* dst_length, s32* status) { - LOG_DEBUG(Lib_Zlib, "(STUBBED) called"); - if (!task_thread.Joinable()) { - return ORBIS_ZLIB_ERROR_NOT_INITIALIZED; - } - if (!dst_length || !status) { - return ORBIS_ZLIB_ERROR_INVALID; - } - - { - std::unique_lock lock(mutex); - if (!results.contains(request_id)) { - return ORBIS_ZLIB_ERROR_NOT_FOUND; - } - const auto result = results[request_id]; - *dst_length = result.length; - *status = result.status; - } - return ORBIS_OK; -} - -s32 PS4_SYSV_ABI sceZlibFinalize() { - LOG_INFO(Lib_Zlib, "called"); - if (!task_thread.Joinable()) { - return ORBIS_ZLIB_ERROR_NOT_INITIALIZED; - } - task_thread.Stop(); - return ORBIS_OK; -} - -void RegisterLib(Core::Loader::SymbolsResolver* sym) { - LIB_FUNCTION("m1YErdIXCp4", "libSceZlib", 1, "libSceZlib", sceZlibInitialize); - LIB_FUNCTION("6na+Sa-B83w", "libSceZlib", 1, "libSceZlib", sceZlibFinalize); - LIB_FUNCTION("TLar1HULv1Q", "libSceZlib", 1, "libSceZlib", sceZlibInflate); - LIB_FUNCTION("uB8VlDD4e0s", "libSceZlib", 1, "libSceZlib", sceZlibWaitForDone); - LIB_FUNCTION("2eDcGHC0YaM", "libSceZlib", 1, "libSceZlib", sceZlibGetResult); -}; - -} // namespace Libraries::Zlib diff --git a/src/core/libraries/zlib/zlib_error.h b/src/core/libraries/zlib/zlib_error.h deleted file mode 100644 index 59574f0b2..000000000 --- a/src/core/libraries/zlib/zlib_error.h +++ /dev/null @@ -1,18 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "core/libraries/error_codes.h" - -// Zlib library -constexpr int ORBIS_ZLIB_ERROR_NOT_FOUND = 0x81120002; -constexpr int ORBIS_ZLIB_ERROR_BUSY = 0x8112000B; -constexpr int ORBIS_ZLIB_ERROR_FAULT = 0x8112000E; -constexpr int ORBIS_ZLIB_ERROR_INVALID = 0x81120016; -constexpr int ORBIS_ZLIB_ERROR_NOSPACE = 0x8112001C; -constexpr int ORBIS_ZLIB_ERROR_NOT_SUPPORTED = 0x81120025; -constexpr int ORBIS_ZLIB_ERROR_TIMEDOUT = 0x81120027; -constexpr int ORBIS_ZLIB_ERROR_NOT_INITIALIZED = 0x81120032; -constexpr int ORBIS_ZLIB_ERROR_ALREADY_INITIALIZED = 0x81120033; -constexpr int ORBIS_ZLIB_ERROR_FATAL = 0x811200FF; diff --git a/src/core/libraries/zlib/zlib_sce.h b/src/core/libraries/zlib/zlib_sce.h deleted file mode 100644 index 32d738f48..000000000 --- a/src/core/libraries/zlib/zlib_sce.h +++ /dev/null @@ -1,21 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include "common/types.h" - -namespace Core::Loader { -class SymbolsResolver; -} -namespace Libraries::Zlib { - -s32 PS4_SYSV_ABI sceZlibInitialize(const void* buffer, u32 length); -s32 PS4_SYSV_ABI sceZlibInflate(const void* src, u32 src_len, void* dst, u32 dst_len, - u64* request_id); -s32 PS4_SYSV_ABI sceZlibWaitForDone(u64* request_id, const u32* timeout); -s32 PS4_SYSV_ABI sceZlibGetResult(u64 request_id, u32* dst_length, s32* status); -s32 PS4_SYSV_ABI sceZlibFinalize(); - -void RegisterLib(Core::Loader::SymbolsResolver* sym); -} // namespace Libraries::Zlib \ No newline at end of file diff --git a/src/core/linker.cpp b/src/core/linker.cpp index 889f3a298..71e6e00a6 100644 --- a/src/core/linker.cpp +++ b/src/core/linker.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/alignment.h" diff --git a/src/core/linker.h b/src/core/linker.h index 895901f08..3c32dde82 100644 --- a/src/core/linker.h +++ b/src/core/linker.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/loader/elf.cpp b/src/core/loader/elf.cpp index ed3f43c1c..099e1ab32 100644 --- a/src/core/loader/elf.cpp +++ b/src/core/loader/elf.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/loader/elf.h b/src/core/loader/elf.h index 1dc0c60a1..9191a984b 100644 --- a/src/core/loader/elf.h +++ b/src/core/loader/elf.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/loader/symbols_resolver.cpp b/src/core/loader/symbols_resolver.cpp index 9fef1a2a2..faa42cf9d 100644 --- a/src/core/loader/symbols_resolver.cpp +++ b/src/core/loader/symbols_resolver.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/loader/symbols_resolver.h b/src/core/loader/symbols_resolver.h index 666dc2332..22ed7f481 100644 --- a/src/core/loader/symbols_resolver.h +++ b/src/core/loader/symbols_resolver.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/memory.cpp b/src/core/memory.cpp index a340c3643..4e318b85c 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/alignment.h" diff --git a/src/core/memory.h b/src/core/memory.h index f9ae64942..a9448fc3b 100644 --- a/src/core/memory.h +++ b/src/core/memory.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/module.cpp b/src/core/module.cpp index 7e9d74a09..74f60a3de 100644 --- a/src/core/module.cpp +++ b/src/core/module.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/alignment.h" diff --git a/src/core/module.h b/src/core/module.h index 8dde0f467..989ba71b6 100644 --- a/src/core/module.h +++ b/src/core/module.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/platform.h b/src/core/platform.h index bdb50701b..bf22bbb87 100644 --- a/src/core/platform.h +++ b/src/core/platform.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/signals.cpp b/src/core/signals.cpp index f9b45bab7..380856497 100644 --- a/src/core/signals.cpp +++ b/src/core/signals.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/arch.h" diff --git a/src/core/signals.h b/src/core/signals.h index 011383693..93fb9c064 100644 --- a/src/core/signals.h +++ b/src/core/signals.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/thread.cpp b/src/core/thread.cpp index 0015f40b9..686cceb88 100644 --- a/src/core/thread.cpp +++ b/src/core/thread.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/alignment.h" diff --git a/src/core/thread.h b/src/core/thread.h index 6ea7dfad4..e5d3e2c0d 100644 --- a/src/core/thread.h +++ b/src/core/thread.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/tls.cpp b/src/core/tls.cpp index f87248114..d5dbac87b 100644 --- a/src/core/tls.cpp +++ b/src/core/tls.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/tls.h b/src/core/tls.h index 2d94488f7..b5506a755 100644 --- a/src/core/tls.h +++ b/src/core/tls.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/user_manager.cpp b/src/core/user_manager.cpp index 73e881e8e..24fa100c9 100644 --- a/src/core/user_manager.cpp +++ b/src/core/user_manager.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include @@ -90,25 +90,25 @@ Users UserManager::CreateDefaultUsers() { default_users.user = { { .user_id = 1000, - .user_name = "shadPS4", + .user_name = "shadBloodborne", .user_color = 1, .player_index = 1, }, { .user_id = 1001, - .user_name = "shadPS4-2", + .user_name = "shadBloodborne-2", .user_color = 2, .player_index = 2, }, { .user_id = 1002, - .user_name = "shadPS4-3", + .user_name = "shadBloodborne-3", .user_color = 3, .player_index = 3, }, { .user_id = 1003, - .user_name = "shadPS4-4", + .user_name = "shadBloodborne-4", .user_color = 4, .player_index = 4, }, diff --git a/src/core/user_manager.h b/src/core/user_manager.h index 9273ef0cb..7c08ce0dd 100644 --- a/src/core/user_manager.h +++ b/src/core/user_manager.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/core/user_settings.cpp b/src/core/user_settings.cpp index cf569a68a..b96b344b8 100644 --- a/src/core/user_settings.cpp +++ b/src/core/user_settings.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/core/user_settings.h b/src/core/user_settings.h index 45cfa91dd..5372c0860 100644 --- a/src/core/user_settings.h +++ b/src/core/user_settings.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/emulator.cpp b/src/emulator.cpp index 616a21ed1..e70af4e2e 100644 --- a/src/emulator.cpp +++ b/src/emulator.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include @@ -94,7 +94,7 @@ s32 ReadCompiledSdkVersion(const std::filesystem::path& file) { void Emulator::Run(std::filesystem::path file, std::vector args, std::optional p_game_folder) { - Common::SetCurrentThreadName("shadPS4:Main"); + Common::SetCurrentThreadName("sB:Main"); if (waitForDebuggerBeforeRun) { Debugger::WaitForDebuggerAttach(); } @@ -227,7 +227,10 @@ void Emulator::Run(std::filesystem::path file, std::vector args, std::quick_exit(0); } - LOG_INFO(Loader, "Starting shadps4 emulator v{} ", Common::g_version); + ASSERT(id == "CUSA00207" || id == "CUSA00208" || id == "CUSA00299" || id == "CUSA00900" || + id == "CUSA01363" || id == "CUSA03023" || id == "CUSA03173"); + + LOG_INFO(Loader, "Starting shadBloodborne emulator v{} ", Common::g_version); LOG_INFO(Loader, "Revision {}", Common::g_scm_rev); LOG_INFO(Loader, "Branch {}", Common::g_scm_branch); LOG_INFO(Loader, "Description {}", Common::g_scm_desc); @@ -339,18 +342,19 @@ void Emulator::Run(std::filesystem::path file, std::vector args, std::string remote_host = Common::GetRemoteNameFromLink(); if (Common::g_is_release) { if (remote_host == "shadps4-emu" || remote_url.length() == 0) { - window_title = fmt::format("shadPS4 v{} | {}", Common::g_version, game_title); + window_title = fmt::format("shadBloodborne v{} | {}", Common::g_version, game_title); } else { - window_title = - fmt::format("shadPS4 {}/v{} | {}", remote_host, Common::g_version, game_title); + window_title = fmt::format("shadBloodborne {}/v{} | {}", remote_host, Common::g_version, + game_title); } } else { if (remote_host == "shadps4-emu" || remote_url.length() == 0) { - window_title = fmt::format("shadPS4 v{} {} {} | {}", Common::g_version, + window_title = fmt::format("shadBloodborne v{} {} {} | {}", Common::g_version, Common::g_scm_branch, Common::g_scm_desc, game_title); } else { - window_title = fmt::format("shadPS4 v{} {}/{} {} | {}", Common::g_version, remote_host, - Common::g_scm_branch, Common::g_scm_desc, game_title); + window_title = + fmt::format("shadBloodborne v{} {}/{} {} | {}", Common::g_version, remote_host, + Common::g_scm_branch, Common::g_scm_desc, game_title); } } window = std::make_unique(EmulatorSettings.GetWindowWidth(), diff --git a/src/emulator.h b/src/emulator.h index d350ce16c..f492984eb 100644 --- a/src/emulator.h +++ b/src/emulator.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/imgui/imgui_config.h b/src/imgui/imgui_config.h index 7b03a4bab..a518cbf18 100644 --- a/src/imgui/imgui_config.h +++ b/src/imgui/imgui_config.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/imgui/imgui_layer.h b/src/imgui/imgui_layer.h index a6c7e2a4a..b51de626e 100644 --- a/src/imgui/imgui_layer.h +++ b/src/imgui/imgui_layer.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/imgui/imgui_std.h b/src/imgui/imgui_std.h index 821ef1568..fa9b06435 100644 --- a/src/imgui/imgui_std.h +++ b/src/imgui/imgui_std.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/imgui/imgui_texture.h b/src/imgui/imgui_texture.h index d84eda6b7..8d32e829a 100644 --- a/src/imgui/imgui_texture.h +++ b/src/imgui/imgui_texture.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/imgui/imgui_translations.cpp b/src/imgui/imgui_translations.cpp index 608f980c3..134e3766b 100644 --- a/src/imgui/imgui_translations.cpp +++ b/src/imgui/imgui_translations.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "core/emulator_settings.h" diff --git a/src/imgui/imgui_translations.h b/src/imgui/imgui_translations.h index d6844b759..56c009947 100644 --- a/src/imgui/imgui_translations.h +++ b/src/imgui/imgui_translations.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/imgui/renderer/CMakeLists.txt b/src/imgui/renderer/CMakeLists.txt index 5d74632f9..b32721682 100644 --- a/src/imgui/renderer/CMakeLists.txt +++ b/src/imgui/renderer/CMakeLists.txt @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +# SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project # SPDX-License-Identifier: GPL-2.0-or-later project(ImGui_Resources) diff --git a/src/imgui/renderer/imgui_core.cpp b/src/imgui/renderer/imgui_core.cpp index b52a68d22..35628e5c2 100644 --- a/src/imgui/renderer/imgui_core.cpp +++ b/src/imgui/renderer/imgui_core.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/imgui/renderer/imgui_core.h b/src/imgui/renderer/imgui_core.h index 36ccff138..7e8bb40c2 100644 --- a/src/imgui/renderer/imgui_core.h +++ b/src/imgui/renderer/imgui_core.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/imgui/renderer/imgui_impl_sdl3.cpp b/src/imgui/renderer/imgui_impl_sdl3.cpp index 679aeb8c0..9cffdfaa6 100644 --- a/src/imgui/renderer/imgui_impl_sdl3.cpp +++ b/src/imgui/renderer/imgui_impl_sdl3.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later // Based on imgui_impl_sdl3.cpp from Dear ImGui repository @@ -531,7 +531,7 @@ bool Init(SDL_Window* window) { // Setup backend capabilities flags SdlData* bd = IM_NEW(SdlData)(); io.BackendPlatformUserData = (void*)bd; - io.BackendPlatformName = "imgui_impl_sdl3_shadps4"; + io.BackendPlatformName = "imgui_impl_sdl3_shadBloodborne"; io.BackendFlags |= ImGuiBackendFlags_HasMouseCursors; // We can honor GetMouseCursor() values io.BackendFlags |= ImGuiBackendFlags_HasSetMousePos; // We can honor io.WantSetMousePos requests // (optional, rarely used) diff --git a/src/imgui/renderer/imgui_impl_sdl3.h b/src/imgui/renderer/imgui_impl_sdl3.h index fe626a962..b2993353a 100644 --- a/src/imgui/renderer/imgui_impl_sdl3.h +++ b/src/imgui/renderer/imgui_impl_sdl3.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later // Based on imgui_impl_sdl3.h from Dear ImGui repository diff --git a/src/imgui/renderer/imgui_impl_vulkan.cpp b/src/imgui/renderer/imgui_impl_vulkan.cpp index 97f44c318..afc388afd 100644 --- a/src/imgui/renderer/imgui_impl_vulkan.cpp +++ b/src/imgui/renderer/imgui_impl_vulkan.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later // Based on imgui_impl_vulkan.cpp from Dear ImGui repository @@ -1243,7 +1243,7 @@ bool Init(InitInfo info) { // Setup backend capabilities flags auto* bd = IM_NEW(VkData)(info); io.BackendRendererUserData = (void*)bd; - io.BackendRendererName = "imgui_impl_vulkan_shadps4"; + io.BackendRendererName = "imgui_impl_vulkan_shadBloodborne"; // We can honor the ImDrawCmd::VtxOffset field, allowing for large meshes. io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset; diff --git a/src/imgui/renderer/imgui_impl_vulkan.h b/src/imgui/renderer/imgui_impl_vulkan.h index 3e77627dd..c675bfa7f 100644 --- a/src/imgui/renderer/imgui_impl_vulkan.h +++ b/src/imgui/renderer/imgui_impl_vulkan.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later // Based on imgui_impl_vulkan.h from Dear ImGui repository diff --git a/src/imgui/renderer/texture_manager.cpp b/src/imgui/renderer/texture_manager.cpp index f8ac04352..ec654f997 100644 --- a/src/imgui/renderer/texture_manager.cpp +++ b/src/imgui/renderer/texture_manager.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include @@ -134,7 +134,7 @@ Inner::~Inner() { } void WorkerLoop() { - Common::SetCurrentThreadName("shadPS4:ImGuiTextureManager"); + Common::SetCurrentThreadName("sB:ImGuiTextureManager"); std::mutex mtx; while (g_is_worker_running) { std::unique_lock lk{mtx}; diff --git a/src/imgui/renderer/texture_manager.h b/src/imgui/renderer/texture_manager.h index 4fa7b9924..274ca8522 100644 --- a/src/imgui/renderer/texture_manager.h +++ b/src/imgui/renderer/texture_manager.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/input/controller.cpp b/src/input/controller.cpp index c1ba584e3..2d28e405b 100644 --- a/src/input/controller.cpp +++ b/src/input/controller.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/input/controller.h b/src/input/controller.h index 1c711c488..0be9eae58 100644 --- a/src/input/controller.h +++ b/src/input/controller.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/input/input_handler.cpp b/src/input/input_handler.cpp index cf258235d..ec96dd316 100644 --- a/src/input/input_handler.cpp +++ b/src/input/input_handler.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "input_handler.h" diff --git a/src/input/input_handler.h b/src/input/input_handler.h index ee286aea9..d190aea95 100644 --- a/src/input/input_handler.h +++ b/src/input/input_handler.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/input/input_mouse.cpp b/src/input/input_mouse.cpp index f90c20484..5cc8f5c6d 100644 --- a/src/input/input_mouse.cpp +++ b/src/input/input_mouse.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/input/input_mouse.h b/src/input/input_mouse.h index da1d874ec..4c04650b8 100644 --- a/src/input/input_mouse.h +++ b/src/input/input_mouse.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/main.cpp b/src/main.cpp index fb9ff3078..cd677aacf 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include @@ -58,7 +58,7 @@ int main(int argc, char* argv[]) { EmulatorSettingsImpl::SetInstance(emu_settings); emu_settings->Load(); - CLI::App app{"shadPS4 Emulator CLI"}; + CLI::App app{"shadBloodborne Emulator CLI"}; // ---- CLI state ---- std::optional gamePath; @@ -111,7 +111,7 @@ int main(int argc, char* argv[]) { // ---- No-args behavior ---- if (argc == 1) { - SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_INFORMATION, "shadPS4", + SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_INFORMATION, "shadBloodborne", "This is a CLI application. Please use the QTLauncher for a GUI:\n" "https://github.com/shadps4-emu/shadps4-qtlauncher/releases", nullptr); diff --git a/src/sdl_window.cpp b/src/sdl_window.cpp index 060197533..b9e1f537a 100644 --- a/src/sdl_window.cpp +++ b/src/sdl_window.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "SDL3/SDL_events.h" @@ -89,7 +89,7 @@ static Uint32 SDLCALL PollControllerLightColour(void* userdata, SDL_TimerID time WindowSDL::WindowSDL(s32 width_, s32 height_, Input::GameControllers* controllers_, std::string_view window_title) : width{width_}, height{height_}, controllers{*controllers_} { - if (!SDL_SetHint(SDL_HINT_APP_NAME, "shadPS4")) { + if (!SDL_SetHint(SDL_HINT_APP_NAME, "shadBloodborne")) { UNREACHABLE_MSG("Failed to set SDL window hint: {}", SDL_GetError()); } if (!SDL_Init(SDL_INIT_VIDEO)) { diff --git a/src/sdl_window.h b/src/sdl_window.h index 4fc750bbc..60ca618f8 100644 --- a/src/sdl_window.h +++ b/src/sdl_window.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/shadps4.rc b/src/shadBloodborne.rc similarity index 71% rename from src/shadps4.rc rename to src/shadBloodborne.rc index 9edccfbfd..17dbf223c 100644 --- a/src/shadps4.rc +++ b/src/shadBloodborne.rc @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "winresrc.h" @@ -27,12 +27,12 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "CompanyName", "\0" - VALUE "FileDescription", "shadPS4 - PlayStation 4 Emulator\0" + VALUE "FileDescription", "shadBloodborne - Bloodborne Emulator\0" VALUE "FileVersion", xstr(EMULATOR_VERSION_MAJOR) "." xstr(EMULATOR_VERSION_MINOR) "." xstr(EMULATOR_VERSION_PATCH) ".0\0" - VALUE "InternalName", "shadPS4\0" - VALUE "LegalCopyright", "Copyright 2025 shadPS4 Team\0" - VALUE "OriginalFilename", "shadPS4.exe\0" - VALUE "ProductName", "shadPS4\0" + VALUE "InternalName", "shadBloodborne\0" + VALUE "LegalCopyright", "Copyright 2025 shadBloodborne Team\0" + VALUE "OriginalFilename", "shadBloodborne.exe\0" + VALUE "ProductName", "shadBloodborne\0" VALUE "ProductVersion", xstr(EMULATOR_VERSION_MAJOR) "." xstr(EMULATOR_VERSION_MINOR) "." xstr(EMULATOR_VERSION_PATCH) ".0\0" END END diff --git a/src/shader_recompiler/backend/bindings.h b/src/shader_recompiler/backend/bindings.h index 510b0c0ec..518d92bd7 100644 --- a/src/shader_recompiler/backend/bindings.h +++ b/src/shader_recompiler/backend/bindings.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/shader_recompiler/backend/spirv/emit_spirv.cpp b/src/shader_recompiler/backend/spirv/emit_spirv.cpp index 804c1d076..7ada78ae9 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/shader_recompiler/backend/spirv/emit_spirv.h b/src/shader_recompiler/backend/spirv/emit_spirv.h index 5b8da4496..4d857ce05 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv.h +++ b/src/shader_recompiler/backend/spirv/emit_spirv.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_bitwise_conversion.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_bitwise_conversion.cpp index 43655ba3f..f7923da06 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_bitwise_conversion.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_bitwise_conversion.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "shader_recompiler/backend/spirv/emit_spirv_instructions.h" diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_bounds.h b/src/shader_recompiler/backend/spirv/emit_spirv_bounds.h index e66467c6b..d5b80f128 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_bounds.h +++ b/src/shader_recompiler/backend/spirv/emit_spirv_bounds.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_composite.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_composite.cpp index 03016726c..de42bcbc9 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_composite.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_composite.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "shader_recompiler/backend/spirv/emit_spirv_instructions.h" diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp index 81f8d08d7..25bf04998 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/assert.h" diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_convert.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_convert.cpp index 8da66e8a4..86a66a95b 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_convert.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_convert.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "shader_recompiler/backend/spirv/emit_spirv_instructions.h" diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_floating_point.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_floating_point.cpp index 66d400c7d..bf68dee09 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_floating_point.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_floating_point.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "shader_recompiler/backend/spirv/emit_spirv_instructions.h" diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp index 0b05dcef4..b9ee7c578 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_instructions.h b/src/shader_recompiler/backend/spirv/emit_spirv_instructions.h index da84e253c..8a75ac619 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_instructions.h +++ b/src/shader_recompiler/backend/spirv/emit_spirv_instructions.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_integer.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_integer.cpp index 01652c1cf..e561a6c9c 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_integer.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_integer.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "shader_recompiler/backend/spirv/emit_spirv_instructions.h" diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_logical.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_logical.cpp index a80f1d619..85c496d9c 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_logical.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_logical.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "shader_recompiler/backend/spirv/emit_spirv_instructions.h" diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_quad_rect.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_quad_rect.cpp index 48aa9f870..a323a5890 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_quad_rect.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_quad_rect.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_quad_rect.h b/src/shader_recompiler/backend/spirv/emit_spirv_quad_rect.h index c6c970ec3..4233983f7 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_quad_rect.h +++ b/src/shader_recompiler/backend/spirv/emit_spirv_quad_rect.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_select.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_select.cpp index 1bfe4ea3c..e84b0907e 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_select.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_select.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "shader_recompiler/backend/spirv/emit_spirv_instructions.h" diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_special.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_special.cpp index d574b440c..6d8fe1e2b 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_special.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_special.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "shader_recompiler/backend/spirv/emit_spirv_instructions.h" diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_undefined.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_undefined.cpp index 9c013dfea..6c1ac007e 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_undefined.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_undefined.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "shader_recompiler/backend/spirv/emit_spirv_instructions.h" diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_warp.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_warp.cpp index cd28ee5c5..10e14e6af 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_warp.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_warp.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "shader_recompiler/backend/spirv/emit_spirv_instructions.h" diff --git a/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp b/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp index c0e469964..62c75887f 100644 --- a/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp +++ b/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/assert.h" diff --git a/src/shader_recompiler/backend/spirv/spirv_emit_context.h b/src/shader_recompiler/backend/spirv/spirv_emit_context.h index a9c6f0968..3fc9b44fe 100644 --- a/src/shader_recompiler/backend/spirv/spirv_emit_context.h +++ b/src/shader_recompiler/backend/spirv/spirv_emit_context.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/shader_recompiler/frontend/control_flow_graph.cpp b/src/shader_recompiler/frontend/control_flow_graph.cpp index fe082cb8c..db431562b 100644 --- a/src/shader_recompiler/frontend/control_flow_graph.cpp +++ b/src/shader_recompiler/frontend/control_flow_graph.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/shader_recompiler/frontend/control_flow_graph.h b/src/shader_recompiler/frontend/control_flow_graph.h index 909bea6e4..3fc462b5b 100644 --- a/src/shader_recompiler/frontend/control_flow_graph.h +++ b/src/shader_recompiler/frontend/control_flow_graph.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/shader_recompiler/frontend/copy_shader.cpp b/src/shader_recompiler/frontend/copy_shader.cpp index 795003e43..8849e59fb 100644 --- a/src/shader_recompiler/frontend/copy_shader.cpp +++ b/src/shader_recompiler/frontend/copy_shader.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "shader_recompiler/frontend/copy_shader.h" diff --git a/src/shader_recompiler/frontend/copy_shader.h b/src/shader_recompiler/frontend/copy_shader.h index 24c7060ed..2e254769c 100644 --- a/src/shader_recompiler/frontend/copy_shader.h +++ b/src/shader_recompiler/frontend/copy_shader.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/shader_recompiler/frontend/decode.cpp b/src/shader_recompiler/frontend/decode.cpp index 37e8a0973..28ff6d4e4 100644 --- a/src/shader_recompiler/frontend/decode.cpp +++ b/src/shader_recompiler/frontend/decode.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/shader_recompiler/frontend/decode.h b/src/shader_recompiler/frontend/decode.h index 8125ce7fb..d0cb945cd 100644 --- a/src/shader_recompiler/frontend/decode.h +++ b/src/shader_recompiler/frontend/decode.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/shader_recompiler/frontend/fetch_shader.cpp b/src/shader_recompiler/frontend/fetch_shader.cpp index ba0635546..c3ea452b8 100644 --- a/src/shader_recompiler/frontend/fetch_shader.cpp +++ b/src/shader_recompiler/frontend/fetch_shader.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/assert.h" diff --git a/src/shader_recompiler/frontend/fetch_shader.h b/src/shader_recompiler/frontend/fetch_shader.h index a57bbb0c6..f46370333 100644 --- a/src/shader_recompiler/frontend/fetch_shader.h +++ b/src/shader_recompiler/frontend/fetch_shader.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/shader_recompiler/frontend/format.cpp b/src/shader_recompiler/frontend/format.cpp index 4a90fe358..08b7d4864 100644 --- a/src/shader_recompiler/frontend/format.cpp +++ b/src/shader_recompiler/frontend/format.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/assert.h" diff --git a/src/shader_recompiler/frontend/instruction.cpp b/src/shader_recompiler/frontend/instruction.cpp index 246c2b85a..eb0b590de 100644 --- a/src/shader_recompiler/frontend/instruction.cpp +++ b/src/shader_recompiler/frontend/instruction.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/assert.h" diff --git a/src/shader_recompiler/frontend/instruction.h b/src/shader_recompiler/frontend/instruction.h index f4e7bc9f2..94bb7e363 100644 --- a/src/shader_recompiler/frontend/instruction.h +++ b/src/shader_recompiler/frontend/instruction.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/shader_recompiler/frontend/opcodes.h b/src/shader_recompiler/frontend/opcodes.h index 7390a3940..7d40fdb82 100644 --- a/src/shader_recompiler/frontend/opcodes.h +++ b/src/shader_recompiler/frontend/opcodes.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/shader_recompiler/frontend/tessellation.h b/src/shader_recompiler/frontend/tessellation.h index bfcaa4fdc..237c9a297 100644 --- a/src/shader_recompiler/frontend/tessellation.h +++ b/src/shader_recompiler/frontend/tessellation.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/shader_recompiler/frontend/translate/data_share.cpp b/src/shader_recompiler/frontend/translate/data_share.cpp index b1aca83d3..5abc647b3 100644 --- a/src/shader_recompiler/frontend/translate/data_share.cpp +++ b/src/shader_recompiler/frontend/translate/data_share.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "shader_recompiler/frontend/translate/translate.h" diff --git a/src/shader_recompiler/frontend/translate/export.cpp b/src/shader_recompiler/frontend/translate/export.cpp index cadef5157..8ecf7faa5 100644 --- a/src/shader_recompiler/frontend/translate/export.cpp +++ b/src/shader_recompiler/frontend/translate/export.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "shader_recompiler/frontend/translate/translate.h" diff --git a/src/shader_recompiler/frontend/translate/scalar_alu.cpp b/src/shader_recompiler/frontend/translate/scalar_alu.cpp index 8931e8dde..13019738b 100644 --- a/src/shader_recompiler/frontend/translate/scalar_alu.cpp +++ b/src/shader_recompiler/frontend/translate/scalar_alu.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/shader_recompiler/frontend/translate/scalar_flow.cpp b/src/shader_recompiler/frontend/translate/scalar_flow.cpp index 8e12adf6e..cb5b273a4 100644 --- a/src/shader_recompiler/frontend/translate/scalar_flow.cpp +++ b/src/shader_recompiler/frontend/translate/scalar_flow.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "shader_recompiler/frontend/opcodes.h" diff --git a/src/shader_recompiler/frontend/translate/scalar_memory.cpp b/src/shader_recompiler/frontend/translate/scalar_memory.cpp index 3c6fd3968..c32a49edf 100644 --- a/src/shader_recompiler/frontend/translate/scalar_memory.cpp +++ b/src/shader_recompiler/frontend/translate/scalar_memory.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "shader_recompiler/frontend/translate/translate.h" diff --git a/src/shader_recompiler/frontend/translate/translate.cpp b/src/shader_recompiler/frontend/translate/translate.cpp index de3822296..6cffd683c 100644 --- a/src/shader_recompiler/frontend/translate/translate.cpp +++ b/src/shader_recompiler/frontend/translate/translate.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/io_file.h" diff --git a/src/shader_recompiler/frontend/translate/translate.h b/src/shader_recompiler/frontend/translate/translate.h index 5ee75e336..68d21686a 100644 --- a/src/shader_recompiler/frontend/translate/translate.h +++ b/src/shader_recompiler/frontend/translate/translate.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/shader_recompiler/frontend/translate/vector_alu.cpp b/src/shader_recompiler/frontend/translate/vector_alu.cpp index 23236b702..c6fc67f93 100644 --- a/src/shader_recompiler/frontend/translate/vector_alu.cpp +++ b/src/shader_recompiler/frontend/translate/vector_alu.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "shader_recompiler/frontend/opcodes.h" diff --git a/src/shader_recompiler/frontend/translate/vector_interpolation.cpp b/src/shader_recompiler/frontend/translate/vector_interpolation.cpp index f3da22845..b6ac1a1c7 100644 --- a/src/shader_recompiler/frontend/translate/vector_interpolation.cpp +++ b/src/shader_recompiler/frontend/translate/vector_interpolation.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "shader_recompiler/frontend/translate/translate.h" diff --git a/src/shader_recompiler/frontend/translate/vector_memory.cpp b/src/shader_recompiler/frontend/translate/vector_memory.cpp index 85ce2311a..8fc7266fa 100644 --- a/src/shader_recompiler/frontend/translate/vector_memory.cpp +++ b/src/shader_recompiler/frontend/translate/vector_memory.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "shader_recompiler/frontend/translate/translate.h" diff --git a/src/shader_recompiler/info.h b/src/shader_recompiler/info.h index 8d89537cb..72cd236cc 100644 --- a/src/shader_recompiler/info.h +++ b/src/shader_recompiler/info.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/shader_recompiler/ir/abstract_syntax_list.cpp b/src/shader_recompiler/ir/abstract_syntax_list.cpp index 0d967ac11..efbec61da 100644 --- a/src/shader_recompiler/ir/abstract_syntax_list.cpp +++ b/src/shader_recompiler/ir/abstract_syntax_list.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "abstract_syntax_list.h" diff --git a/src/shader_recompiler/ir/abstract_syntax_list.h b/src/shader_recompiler/ir/abstract_syntax_list.h index a620baccb..f6037ae91 100644 --- a/src/shader_recompiler/ir/abstract_syntax_list.h +++ b/src/shader_recompiler/ir/abstract_syntax_list.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/shader_recompiler/ir/attribute.cpp b/src/shader_recompiler/ir/attribute.cpp index e74b62817..90d09408a 100644 --- a/src/shader_recompiler/ir/attribute.cpp +++ b/src/shader_recompiler/ir/attribute.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/shader_recompiler/ir/attribute.h b/src/shader_recompiler/ir/attribute.h index c8a6e6b20..516ba641c 100644 --- a/src/shader_recompiler/ir/attribute.h +++ b/src/shader_recompiler/ir/attribute.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/shader_recompiler/ir/basic_block.cpp b/src/shader_recompiler/ir/basic_block.cpp index 745c5f956..485ffde9f 100644 --- a/src/shader_recompiler/ir/basic_block.cpp +++ b/src/shader_recompiler/ir/basic_block.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/shader_recompiler/ir/basic_block.h b/src/shader_recompiler/ir/basic_block.h index ad76ae17a..46b2119bf 100644 --- a/src/shader_recompiler/ir/basic_block.h +++ b/src/shader_recompiler/ir/basic_block.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/shader_recompiler/ir/debug_print.h b/src/shader_recompiler/ir/debug_print.h index 1ab1575de..a0355a393 100644 --- a/src/shader_recompiler/ir/debug_print.h +++ b/src/shader_recompiler/ir/debug_print.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/bit_field.h" diff --git a/src/shader_recompiler/ir/ir_emitter.cpp b/src/shader_recompiler/ir/ir_emitter.cpp index 922f01b1f..e9dd1b585 100644 --- a/src/shader_recompiler/ir/ir_emitter.cpp +++ b/src/shader_recompiler/ir/ir_emitter.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/shader_recompiler/ir/ir_emitter.h b/src/shader_recompiler/ir/ir_emitter.h index ec0edfed4..ce80fed62 100644 --- a/src/shader_recompiler/ir/ir_emitter.h +++ b/src/shader_recompiler/ir/ir_emitter.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/shader_recompiler/ir/microinstruction.cpp b/src/shader_recompiler/ir/microinstruction.cpp index 837b9601e..c554923e2 100644 --- a/src/shader_recompiler/ir/microinstruction.cpp +++ b/src/shader_recompiler/ir/microinstruction.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/shader_recompiler/ir/opcodes.cpp b/src/shader_recompiler/ir/opcodes.cpp index 18f82cb8c..3bb990521 100644 --- a/src/shader_recompiler/ir/opcodes.cpp +++ b/src/shader_recompiler/ir/opcodes.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "shader_recompiler/ir/opcodes.h" diff --git a/src/shader_recompiler/ir/opcodes.h b/src/shader_recompiler/ir/opcodes.h index f3d16da4a..d76ec673e 100644 --- a/src/shader_recompiler/ir/opcodes.h +++ b/src/shader_recompiler/ir/opcodes.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/shader_recompiler/ir/opcodes.inc b/src/shader_recompiler/ir/opcodes.inc index ebbc702b7..1e186258b 100644 --- a/src/shader_recompiler/ir/opcodes.inc +++ b/src/shader_recompiler/ir/opcodes.inc @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later // opcode name, return type, arg1 type, arg2 type, arg3 type, arg4 type, arg4 type, ... diff --git a/src/shader_recompiler/ir/operand_helper.h b/src/shader_recompiler/ir/operand_helper.h index cce2f081d..c78698bb3 100644 --- a/src/shader_recompiler/ir/operand_helper.h +++ b/src/shader_recompiler/ir/operand_helper.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later // Some helpers to get operand indices of instructions by name to make it a bit safer. diff --git a/src/shader_recompiler/ir/passes/constant_propogation.h b/src/shader_recompiler/ir/passes/constant_propogation.h index 313a3cc6a..4cbf587e6 100644 --- a/src/shader_recompiler/ir/passes/constant_propogation.h +++ b/src/shader_recompiler/ir/passes/constant_propogation.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once \ No newline at end of file diff --git a/src/shader_recompiler/ir/passes/dead_code_elimination_pass.cpp b/src/shader_recompiler/ir/passes/dead_code_elimination_pass.cpp index 324797307..90d348208 100644 --- a/src/shader_recompiler/ir/passes/dead_code_elimination_pass.cpp +++ b/src/shader_recompiler/ir/passes/dead_code_elimination_pass.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "shader_recompiler/ir/program.h" diff --git a/src/shader_recompiler/ir/passes/flatten_extended_userdata_pass.cpp b/src/shader_recompiler/ir/passes/flatten_extended_userdata_pass.cpp index a23ee2319..21857a8cf 100644 --- a/src/shader_recompiler/ir/passes/flatten_extended_userdata_pass.cpp +++ b/src/shader_recompiler/ir/passes/flatten_extended_userdata_pass.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/shader_recompiler/ir/passes/hull_shader_transform.cpp b/src/shader_recompiler/ir/passes/hull_shader_transform.cpp index d975c47ea..c390db1bf 100644 --- a/src/shader_recompiler/ir/passes/hull_shader_transform.cpp +++ b/src/shader_recompiler/ir/passes/hull_shader_transform.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/shader_recompiler/ir/passes/identity_removal_pass.cpp b/src/shader_recompiler/ir/passes/identity_removal_pass.cpp index b7014a960..fcea519de 100644 --- a/src/shader_recompiler/ir/passes/identity_removal_pass.cpp +++ b/src/shader_recompiler/ir/passes/identity_removal_pass.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/shader_recompiler/ir/passes/inject_clip_distance_attributes.cpp b/src/shader_recompiler/ir/passes/inject_clip_distance_attributes.cpp index cf93142a1..9db77b66b 100644 --- a/src/shader_recompiler/ir/passes/inject_clip_distance_attributes.cpp +++ b/src/shader_recompiler/ir/passes/inject_clip_distance_attributes.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "shader_recompiler/info.h" diff --git a/src/shader_recompiler/ir/passes/ir_passes.h b/src/shader_recompiler/ir/passes/ir_passes.h index 1b14a1c6b..e95458bef 100644 --- a/src/shader_recompiler/ir/passes/ir_passes.h +++ b/src/shader_recompiler/ir/passes/ir_passes.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/shader_recompiler/ir/passes/lower_buffer_format_to_raw.cpp b/src/shader_recompiler/ir/passes/lower_buffer_format_to_raw.cpp index bb36e2748..b8fa46d6a 100644 --- a/src/shader_recompiler/ir/passes/lower_buffer_format_to_raw.cpp +++ b/src/shader_recompiler/ir/passes/lower_buffer_format_to_raw.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "shader_recompiler/info.h" diff --git a/src/shader_recompiler/ir/passes/readlane_elimination_pass.cpp b/src/shader_recompiler/ir/passes/readlane_elimination_pass.cpp index 103060536..117cf2a6b 100644 --- a/src/shader_recompiler/ir/passes/readlane_elimination_pass.cpp +++ b/src/shader_recompiler/ir/passes/readlane_elimination_pass.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/shader_recompiler/ir/passes/resource_tracking_pass.cpp b/src/shader_recompiler/ir/passes/resource_tracking_pass.cpp index 0b256a349..d594d58f8 100644 --- a/src/shader_recompiler/ir/passes/resource_tracking_pass.cpp +++ b/src/shader_recompiler/ir/passes/resource_tracking_pass.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "shader_recompiler/frontend/control_flow_graph.h" diff --git a/src/shader_recompiler/ir/passes/ring_access_elimination.cpp b/src/shader_recompiler/ir/passes/ring_access_elimination.cpp index f8818b622..021e3fa9e 100644 --- a/src/shader_recompiler/ir/passes/ring_access_elimination.cpp +++ b/src/shader_recompiler/ir/passes/ring_access_elimination.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/assert.h" diff --git a/src/shader_recompiler/ir/passes/shader_info_collection_pass.cpp b/src/shader_recompiler/ir/passes/shader_info_collection_pass.cpp index e26d3f078..265c304c1 100644 --- a/src/shader_recompiler/ir/passes/shader_info_collection_pass.cpp +++ b/src/shader_recompiler/ir/passes/shader_info_collection_pass.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "core/emulator_settings.h" diff --git a/src/shader_recompiler/ir/passes/shared_memory_barrier_pass.cpp b/src/shader_recompiler/ir/passes/shared_memory_barrier_pass.cpp index 11713d099..34147b2b2 100644 --- a/src/shader_recompiler/ir/passes/shared_memory_barrier_pass.cpp +++ b/src/shader_recompiler/ir/passes/shared_memory_barrier_pass.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/shader_recompiler/ir/passes/shared_memory_simplify_pass.cpp b/src/shader_recompiler/ir/passes/shared_memory_simplify_pass.cpp index 555fd505b..9ed1b73bc 100644 --- a/src/shader_recompiler/ir/passes/shared_memory_simplify_pass.cpp +++ b/src/shader_recompiler/ir/passes/shared_memory_simplify_pass.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "shader_recompiler/ir/ir_emitter.h" diff --git a/src/shader_recompiler/ir/passes/shared_memory_to_storage_pass.cpp b/src/shader_recompiler/ir/passes/shared_memory_to_storage_pass.cpp index b84011acc..bf38a9f27 100644 --- a/src/shader_recompiler/ir/passes/shared_memory_to_storage_pass.cpp +++ b/src/shader_recompiler/ir/passes/shared_memory_to_storage_pass.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "shader_recompiler/ir/ir_emitter.h" diff --git a/src/shader_recompiler/ir/passes/srt.h b/src/shader_recompiler/ir/passes/srt.h index 918b832e0..e6a6990a2 100644 --- a/src/shader_recompiler/ir/passes/srt.h +++ b/src/shader_recompiler/ir/passes/srt.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/shader_recompiler/ir/patch.cpp b/src/shader_recompiler/ir/patch.cpp index 2485bc5b4..27984e850 100644 --- a/src/shader_recompiler/ir/patch.cpp +++ b/src/shader_recompiler/ir/patch.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "shader_recompiler/ir/patch.h" diff --git a/src/shader_recompiler/ir/patch.h b/src/shader_recompiler/ir/patch.h index 65d2192e6..39488b432 100644 --- a/src/shader_recompiler/ir/patch.h +++ b/src/shader_recompiler/ir/patch.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/shader_recompiler/ir/pattern_matching.h b/src/shader_recompiler/ir/pattern_matching.h index de5b1cd8a..1918480e3 100644 --- a/src/shader_recompiler/ir/pattern_matching.h +++ b/src/shader_recompiler/ir/pattern_matching.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "shader_recompiler/ir/attribute.h" diff --git a/src/shader_recompiler/ir/position.h b/src/shader_recompiler/ir/position.h index 00da0a68a..e016d17d9 100644 --- a/src/shader_recompiler/ir/position.h +++ b/src/shader_recompiler/ir/position.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/shader_recompiler/ir/program.cpp b/src/shader_recompiler/ir/program.cpp index 926f8f29d..a1191834b 100644 --- a/src/shader_recompiler/ir/program.cpp +++ b/src/shader_recompiler/ir/program.cpp @@ -1,5 +1,5 @@ // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/shader_recompiler/ir/program.h b/src/shader_recompiler/ir/program.h index 3ffd4dc96..d5950e50b 100644 --- a/src/shader_recompiler/ir/program.h +++ b/src/shader_recompiler/ir/program.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/shader_recompiler/ir/reg.h b/src/shader_recompiler/ir/reg.h index ee71cfc4e..e7062aa45 100644 --- a/src/shader_recompiler/ir/reg.h +++ b/src/shader_recompiler/ir/reg.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/shader_recompiler/ir/reinterpret.h b/src/shader_recompiler/ir/reinterpret.h index 349ce448f..cbec1581c 100644 --- a/src/shader_recompiler/ir/reinterpret.h +++ b/src/shader_recompiler/ir/reinterpret.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/shader_recompiler/ir/srt_gvn_table.h b/src/shader_recompiler/ir/srt_gvn_table.h index 3baa1c7da..697f7afe3 100644 --- a/src/shader_recompiler/ir/srt_gvn_table.h +++ b/src/shader_recompiler/ir/srt_gvn_table.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/shader_recompiler/ir/type.cpp b/src/shader_recompiler/ir/type.cpp index 74c56740c..415ee354c 100644 --- a/src/shader_recompiler/ir/type.cpp +++ b/src/shader_recompiler/ir/type.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/shader_recompiler/ir/type.h b/src/shader_recompiler/ir/type.h index 0f043fb64..be72589c6 100644 --- a/src/shader_recompiler/ir/type.h +++ b/src/shader_recompiler/ir/type.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/shader_recompiler/ir/value.cpp b/src/shader_recompiler/ir/value.cpp index 8826b80f2..e0c81fb3c 100644 --- a/src/shader_recompiler/ir/value.cpp +++ b/src/shader_recompiler/ir/value.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/shader_recompiler/ir/value.h b/src/shader_recompiler/ir/value.h index bca44125b..6ca04ad43 100644 --- a/src/shader_recompiler/ir/value.h +++ b/src/shader_recompiler/ir/value.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/shader_recompiler/params.h b/src/shader_recompiler/params.h index 0dce9a0f3..e916386cd 100644 --- a/src/shader_recompiler/params.h +++ b/src/shader_recompiler/params.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/shader_recompiler/profile.h b/src/shader_recompiler/profile.h index 038a80733..527072960 100644 --- a/src/shader_recompiler/profile.h +++ b/src/shader_recompiler/profile.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/shader_recompiler/recompiler.cpp b/src/shader_recompiler/recompiler.cpp index d6efa2890..3db3df244 100644 --- a/src/shader_recompiler/recompiler.cpp +++ b/src/shader_recompiler/recompiler.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "shader_recompiler/frontend/control_flow_graph.h" diff --git a/src/shader_recompiler/recompiler.h b/src/shader_recompiler/recompiler.h index 80c63447a..d8519b10c 100644 --- a/src/shader_recompiler/recompiler.h +++ b/src/shader_recompiler/recompiler.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/shader_recompiler/resource.h b/src/shader_recompiler/resource.h index 82a861e2a..6181b753f 100644 --- a/src/shader_recompiler/resource.h +++ b/src/shader_recompiler/resource.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/shader_recompiler/runtime_info.h b/src/shader_recompiler/runtime_info.h index 04e176765..d4b22943e 100644 --- a/src/shader_recompiler/runtime_info.h +++ b/src/shader_recompiler/runtime_info.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/shader_recompiler/specialization.h b/src/shader_recompiler/specialization.h index fa14583af..dd8e2f5e3 100644 --- a/src/shader_recompiler/specialization.h +++ b/src/shader_recompiler/specialization.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/amdgpu/cb_db_extent.h b/src/video_core/amdgpu/cb_db_extent.h index 623c72b59..819714802 100644 --- a/src/video_core/amdgpu/cb_db_extent.h +++ b/src/video_core/amdgpu/cb_db_extent.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/amdgpu/liverpool.cpp b/src/video_core/amdgpu/liverpool.cpp index 0648df922..2492377a1 100644 --- a/src/video_core/amdgpu/liverpool.cpp +++ b/src/video_core/amdgpu/liverpool.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include @@ -90,7 +90,7 @@ void Liverpool::ProcessCommands() { } void Liverpool::Process(std::stop_token stoken) { - Common::SetCurrentThreadName("shadPS4:GpuCommandProcessor"); + Common::SetCurrentThreadName("sB:GpuCommandProcessor"); gpu_id = std::this_thread::get_id(); while (!stoken.stop_requested()) { diff --git a/src/video_core/amdgpu/liverpool.h b/src/video_core/amdgpu/liverpool.h index 249ea2ba6..48fdc8c50 100644 --- a/src/video_core/amdgpu/liverpool.h +++ b/src/video_core/amdgpu/liverpool.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/amdgpu/pixel_format.cpp b/src/video_core/amdgpu/pixel_format.cpp index d88b05f41..74672737d 100644 --- a/src/video_core/amdgpu/pixel_format.cpp +++ b/src/video_core/amdgpu/pixel_format.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/video_core/amdgpu/pixel_format.h b/src/video_core/amdgpu/pixel_format.h index 69e082edb..aca5812c4 100644 --- a/src/video_core/amdgpu/pixel_format.h +++ b/src/video_core/amdgpu/pixel_format.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/amdgpu/pm4_cmds.h b/src/video_core/amdgpu/pm4_cmds.h index abf58ad89..2e147cb2f 100644 --- a/src/video_core/amdgpu/pm4_cmds.h +++ b/src/video_core/amdgpu/pm4_cmds.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/amdgpu/pm4_opcodes.h b/src/video_core/amdgpu/pm4_opcodes.h index 4a5f2be4e..77b04fa4b 100644 --- a/src/video_core/amdgpu/pm4_opcodes.h +++ b/src/video_core/amdgpu/pm4_opcodes.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/amdgpu/regs.cpp b/src/video_core/amdgpu/regs.cpp index 17fd80312..88e34038a 100644 --- a/src/video_core/amdgpu/regs.cpp +++ b/src/video_core/amdgpu/regs.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "video_core/amdgpu/regs.h" diff --git a/src/video_core/amdgpu/regs.h b/src/video_core/amdgpu/regs.h index a740c38c2..2b54704df 100644 --- a/src/video_core/amdgpu/regs.h +++ b/src/video_core/amdgpu/regs.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/amdgpu/regs_color.h b/src/video_core/amdgpu/regs_color.h index 94b3a51b0..116970243 100644 --- a/src/video_core/amdgpu/regs_color.h +++ b/src/video_core/amdgpu/regs_color.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/amdgpu/regs_depth.h b/src/video_core/amdgpu/regs_depth.h index 5cab35cda..e281e73c1 100644 --- a/src/video_core/amdgpu/regs_depth.h +++ b/src/video_core/amdgpu/regs_depth.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/amdgpu/regs_primitive.h b/src/video_core/amdgpu/regs_primitive.h index 562ae656c..b71cd13f9 100644 --- a/src/video_core/amdgpu/regs_primitive.h +++ b/src/video_core/amdgpu/regs_primitive.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/amdgpu/regs_shader.h b/src/video_core/amdgpu/regs_shader.h index bc20c9a71..9e99fa909 100644 --- a/src/video_core/amdgpu/regs_shader.h +++ b/src/video_core/amdgpu/regs_shader.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/amdgpu/regs_texture.h b/src/video_core/amdgpu/regs_texture.h index 503cecf60..b5104fd2b 100644 --- a/src/video_core/amdgpu/regs_texture.h +++ b/src/video_core/amdgpu/regs_texture.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/amdgpu/regs_vertex.h b/src/video_core/amdgpu/regs_vertex.h index 5422b92c1..598da327c 100644 --- a/src/video_core/amdgpu/regs_vertex.h +++ b/src/video_core/amdgpu/regs_vertex.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/amdgpu/resource.h b/src/video_core/amdgpu/resource.h index 7c5c2df12..479465f42 100644 --- a/src/video_core/amdgpu/resource.h +++ b/src/video_core/amdgpu/resource.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/amdgpu/tiling.cpp b/src/video_core/amdgpu/tiling.cpp index fa3476b0c..dd810e261 100644 --- a/src/video_core/amdgpu/tiling.cpp +++ b/src/video_core/amdgpu/tiling.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/assert.h" diff --git a/src/video_core/amdgpu/tiling.h b/src/video_core/amdgpu/tiling.h index 35d01d111..0647aa7c6 100644 --- a/src/video_core/amdgpu/tiling.h +++ b/src/video_core/amdgpu/tiling.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/buffer_cache/buffer.cpp b/src/video_core/buffer_cache/buffer.cpp index 5ff80facd..26145f757 100644 --- a/src/video_core/buffer_cache/buffer.cpp +++ b/src/video_core/buffer_cache/buffer.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/alignment.h" diff --git a/src/video_core/buffer_cache/buffer.h b/src/video_core/buffer_cache/buffer.h index 1f661ba13..452610017 100644 --- a/src/video_core/buffer_cache/buffer.h +++ b/src/video_core/buffer_cache/buffer.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/buffer_cache/buffer_cache.cpp b/src/video_core/buffer_cache/buffer_cache.cpp index 7347e99a2..a5c1c83de 100644 --- a/src/video_core/buffer_cache/buffer_cache.cpp +++ b/src/video_core/buffer_cache/buffer_cache.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h index 73d70704e..326a91048 100644 --- a/src/video_core/buffer_cache/buffer_cache.h +++ b/src/video_core/buffer_cache/buffer_cache.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/buffer_cache/fault_manager.cpp b/src/video_core/buffer_cache/fault_manager.cpp index e967ffd0e..6b638aa71 100644 --- a/src/video_core/buffer_cache/fault_manager.cpp +++ b/src/video_core/buffer_cache/fault_manager.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/div_ceil.h" diff --git a/src/video_core/buffer_cache/fault_manager.h b/src/video_core/buffer_cache/fault_manager.h index 4fd545433..0359ed317 100644 --- a/src/video_core/buffer_cache/fault_manager.h +++ b/src/video_core/buffer_cache/fault_manager.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/buffer_cache/memory_tracker.h b/src/video_core/buffer_cache/memory_tracker.h index a093be8dd..6756bdbe4 100644 --- a/src/video_core/buffer_cache/memory_tracker.h +++ b/src/video_core/buffer_cache/memory_tracker.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/buffer_cache/range_set.h b/src/video_core/buffer_cache/range_set.h index 5c8e78c7c..28a65744d 100644 --- a/src/video_core/buffer_cache/range_set.h +++ b/src/video_core/buffer_cache/range_set.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/buffer_cache/region_definitions.h b/src/video_core/buffer_cache/region_definitions.h index 260047d40..6d442bbca 100644 --- a/src/video_core/buffer_cache/region_definitions.h +++ b/src/video_core/buffer_cache/region_definitions.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/buffer_cache/region_manager.h b/src/video_core/buffer_cache/region_manager.h index 742268753..326874038 100644 --- a/src/video_core/buffer_cache/region_manager.h +++ b/src/video_core/buffer_cache/region_manager.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/cache_storage.cpp b/src/video_core/cache_storage.cpp index 8d6abf9b5..8b9125dc3 100644 --- a/src/video_core/cache_storage.cpp +++ b/src/video_core/cache_storage.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/elf_info.h" @@ -35,7 +35,7 @@ bool ar_is_read_only{true}; namespace Storage { void ProcessIO(const std::stop_token& stoken) { - Common::SetCurrentThreadName("shadPS4:PipelineCacheIO"); + Common::SetCurrentThreadName("sB:PipelineCacheIO"); while (!stoken.stop_requested()) { { diff --git a/src/video_core/cache_storage.h b/src/video_core/cache_storage.h index 91f2136e9..5952f886e 100644 --- a/src/video_core/cache_storage.h +++ b/src/video_core/cache_storage.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/host_shaders/color_to_ms_depth.frag b/src/video_core/host_shaders/color_to_ms_depth.frag index e477fc942..5184c927d 100644 --- a/src/video_core/host_shaders/color_to_ms_depth.frag +++ b/src/video_core/host_shaders/color_to_ms_depth.frag @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #version 450 core diff --git a/src/video_core/host_shaders/detilers/display_micro_64bpp.comp b/src/video_core/host_shaders/detilers/display_micro_64bpp.comp index 3e0485682..23ed9ab3f 100644 --- a/src/video_core/host_shaders/detilers/display_micro_64bpp.comp +++ b/src/video_core/host_shaders/detilers/display_micro_64bpp.comp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #version 450 diff --git a/src/video_core/host_shaders/detilers/macro_32bpp.comp b/src/video_core/host_shaders/detilers/macro_32bpp.comp index ecac47d1c..1a9488f70 100644 --- a/src/video_core/host_shaders/detilers/macro_32bpp.comp +++ b/src/video_core/host_shaders/detilers/macro_32bpp.comp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #version 450 diff --git a/src/video_core/host_shaders/detilers/macro_64bpp.comp b/src/video_core/host_shaders/detilers/macro_64bpp.comp index 986acc963..2a5aebc5a 100644 --- a/src/video_core/host_shaders/detilers/macro_64bpp.comp +++ b/src/video_core/host_shaders/detilers/macro_64bpp.comp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #version 450 diff --git a/src/video_core/host_shaders/detilers/macro_8bpp.comp b/src/video_core/host_shaders/detilers/macro_8bpp.comp index cddc8af5b..d7799c393 100644 --- a/src/video_core/host_shaders/detilers/macro_8bpp.comp +++ b/src/video_core/host_shaders/detilers/macro_8bpp.comp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #version 450 diff --git a/src/video_core/host_shaders/detilers/micro_128bpp.comp b/src/video_core/host_shaders/detilers/micro_128bpp.comp index a43073a8b..187be0d92 100644 --- a/src/video_core/host_shaders/detilers/micro_128bpp.comp +++ b/src/video_core/host_shaders/detilers/micro_128bpp.comp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #version 450 diff --git a/src/video_core/host_shaders/detilers/micro_16bpp.comp b/src/video_core/host_shaders/detilers/micro_16bpp.comp index 5f1240d64..1a5de5605 100644 --- a/src/video_core/host_shaders/detilers/micro_16bpp.comp +++ b/src/video_core/host_shaders/detilers/micro_16bpp.comp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #version 450 diff --git a/src/video_core/host_shaders/detilers/micro_32bpp.comp b/src/video_core/host_shaders/detilers/micro_32bpp.comp index 605523e4d..a4e82ec0c 100644 --- a/src/video_core/host_shaders/detilers/micro_32bpp.comp +++ b/src/video_core/host_shaders/detilers/micro_32bpp.comp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #version 450 diff --git a/src/video_core/host_shaders/detilers/micro_64bpp.comp b/src/video_core/host_shaders/detilers/micro_64bpp.comp index 1bca44067..0da14823a 100644 --- a/src/video_core/host_shaders/detilers/micro_64bpp.comp +++ b/src/video_core/host_shaders/detilers/micro_64bpp.comp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #version 450 diff --git a/src/video_core/host_shaders/detilers/micro_8bpp.comp b/src/video_core/host_shaders/detilers/micro_8bpp.comp index 1d9b48daa..d48b21ea5 100644 --- a/src/video_core/host_shaders/detilers/micro_8bpp.comp +++ b/src/video_core/host_shaders/detilers/micro_8bpp.comp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #version 450 diff --git a/src/video_core/host_shaders/fault_buffer_process.comp b/src/video_core/host_shaders/fault_buffer_process.comp index 04a86bad3..6b342d41e 100644 --- a/src/video_core/host_shaders/fault_buffer_process.comp +++ b/src/video_core/host_shaders/fault_buffer_process.comp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #version 450 diff --git a/src/video_core/host_shaders/fs_tri.vert b/src/video_core/host_shaders/fs_tri.vert index d6ea55ad2..63a7f540b 100644 --- a/src/video_core/host_shaders/fs_tri.vert +++ b/src/video_core/host_shaders/fs_tri.vert @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #version 450 diff --git a/src/video_core/host_shaders/ms_image_blit.frag b/src/video_core/host_shaders/ms_image_blit.frag index 44811dcf1..3f1ebf1c5 100644 --- a/src/video_core/host_shaders/ms_image_blit.frag +++ b/src/video_core/host_shaders/ms_image_blit.frag @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #version 450 core diff --git a/src/video_core/host_shaders/post_process.frag b/src/video_core/host_shaders/post_process.frag index fb0917528..0772e8dee 100644 --- a/src/video_core/host_shaders/post_process.frag +++ b/src/video_core/host_shaders/post_process.frag @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #version 450 diff --git a/src/video_core/host_shaders/tiling.comp b/src/video_core/host_shaders/tiling.comp index 14bb21547..2b8be3012 100644 --- a/src/video_core/host_shaders/tiling.comp +++ b/src/video_core/host_shaders/tiling.comp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #version 450 core diff --git a/src/video_core/multi_level_page_table.h b/src/video_core/multi_level_page_table.h index 7f3205e1a..8b13f3901 100644 --- a/src/video_core/multi_level_page_table.h +++ b/src/video_core/multi_level_page_table.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/page_manager.cpp b/src/video_core/page_manager.cpp index 6a4bcbd7d..892456305 100644 --- a/src/video_core/page_manager.cpp +++ b/src/video_core/page_manager.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/video_core/page_manager.h b/src/video_core/page_manager.h index fb53f7c98..247f3d9bd 100644 --- a/src/video_core/page_manager.h +++ b/src/video_core/page_manager.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/renderdoc.cpp b/src/video_core/renderdoc.cpp index b02752212..25d6a67c3 100644 --- a/src/video_core/renderdoc.cpp +++ b/src/video_core/renderdoc.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/assert.h" diff --git a/src/video_core/renderdoc.h b/src/video_core/renderdoc.h index 91e242d04..95314b5a7 100644 --- a/src/video_core/renderdoc.h +++ b/src/video_core/renderdoc.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/renderer_vulkan/host_passes/fsr_pass.cpp b/src/video_core/renderer_vulkan/host_passes/fsr_pass.cpp index a4ebc859d..88adbef58 100644 --- a/src/video_core/renderer_vulkan/host_passes/fsr_pass.cpp +++ b/src/video_core/renderer_vulkan/host_passes/fsr_pass.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/assert.h" diff --git a/src/video_core/renderer_vulkan/host_passes/fsr_pass.h b/src/video_core/renderer_vulkan/host_passes/fsr_pass.h index 3d48d85be..75e612b1e 100644 --- a/src/video_core/renderer_vulkan/host_passes/fsr_pass.h +++ b/src/video_core/renderer_vulkan/host_passes/fsr_pass.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/renderer_vulkan/host_passes/pp_pass.cpp b/src/video_core/renderer_vulkan/host_passes/pp_pass.cpp index 4b073c5fe..51de952ec 100644 --- a/src/video_core/renderer_vulkan/host_passes/pp_pass.cpp +++ b/src/video_core/renderer_vulkan/host_passes/pp_pass.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "video_core/renderer_vulkan/host_passes/pp_pass.h" diff --git a/src/video_core/renderer_vulkan/host_passes/pp_pass.h b/src/video_core/renderer_vulkan/host_passes/pp_pass.h index f95c02e8d..2c707e2e6 100644 --- a/src/video_core/renderer_vulkan/host_passes/pp_pass.h +++ b/src/video_core/renderer_vulkan/host_passes/pp_pass.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/renderer_vulkan/liverpool_to_vk.cpp b/src/video_core/renderer_vulkan/liverpool_to_vk.cpp index 9a631b9a7..fe18053b5 100644 --- a/src/video_core/renderer_vulkan/liverpool_to_vk.cpp +++ b/src/video_core/renderer_vulkan/liverpool_to_vk.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/assert.h" diff --git a/src/video_core/renderer_vulkan/liverpool_to_vk.h b/src/video_core/renderer_vulkan/liverpool_to_vk.h index 2ca737ac2..37c1a459c 100644 --- a/src/video_core/renderer_vulkan/liverpool_to_vk.h +++ b/src/video_core/renderer_vulkan/liverpool_to_vk.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/renderer_vulkan/vk_common.cpp b/src/video_core/renderer_vulkan/vk_common.cpp index b19567808..c585cc364 100644 --- a/src/video_core/renderer_vulkan/vk_common.cpp +++ b/src/video_core/renderer_vulkan/vk_common.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "video_core/renderer_vulkan/vk_common.h" diff --git a/src/video_core/renderer_vulkan/vk_common.h b/src/video_core/renderer_vulkan/vk_common.h index 5fe199e0e..21fab0f4c 100644 --- a/src/video_core/renderer_vulkan/vk_common.h +++ b/src/video_core/renderer_vulkan/vk_common.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp b/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp index ba0a3afa2..0f8f773eb 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/video_core/renderer_vulkan/vk_compute_pipeline.h b/src/video_core/renderer_vulkan/vk_compute_pipeline.h index 1cac7204c..e9c6e1a34 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pipeline.h +++ b/src/video_core/renderer_vulkan/vk_compute_pipeline.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp index bc9ef571b..e1dd29e3f 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.h b/src/video_core/renderer_vulkan/vk_graphics_pipeline.h index 0dea92864..f20cc2146 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.h +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/renderer_vulkan/vk_instance.cpp b/src/video_core/renderer_vulkan/vk_instance.cpp index 6898df97a..d4f2cd775 100644 --- a/src/video_core/renderer_vulkan/vk_instance.cpp +++ b/src/video_core/renderer_vulkan/vk_instance.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/video_core/renderer_vulkan/vk_instance.h b/src/video_core/renderer_vulkan/vk_instance.h index 7a8a906d5..e7bc04173 100644 --- a/src/video_core/renderer_vulkan/vk_instance.h +++ b/src/video_core/renderer_vulkan/vk_instance.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp index 2666f05d3..3987a5c5c 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.h b/src/video_core/renderer_vulkan/vk_pipeline_cache.h index 754397214..efea5d0ef 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.h +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/renderer_vulkan/vk_pipeline_common.cpp b/src/video_core/renderer_vulkan/vk_pipeline_common.cpp index ef1623a54..074a0a3c5 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_common.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_common.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/video_core/renderer_vulkan/vk_pipeline_common.h b/src/video_core/renderer_vulkan/vk_pipeline_common.h index eb4e64c80..1aadc3b95 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_common.h +++ b/src/video_core/renderer_vulkan/vk_pipeline_common.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/renderer_vulkan/vk_pipeline_serialization.cpp b/src/video_core/renderer_vulkan/vk_pipeline_serialization.cpp index eb31d4994..8201b8244 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_serialization.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_serialization.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/serdes.h" diff --git a/src/video_core/renderer_vulkan/vk_pipeline_serialization.h b/src/video_core/renderer_vulkan/vk_pipeline_serialization.h index 31ea4e357..1dc21c05c 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_serialization.h +++ b/src/video_core/renderer_vulkan/vk_pipeline_serialization.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/renderer_vulkan/vk_platform.cpp b/src/video_core/renderer_vulkan/vk_platform.cpp index c77c80223..a131ace47 100644 --- a/src/video_core/renderer_vulkan/vk_platform.cpp +++ b/src/video_core/renderer_vulkan/vk_platform.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later // Include the vulkan platform specific header @@ -293,9 +293,9 @@ vk::UniqueInstance CreateInstance(Frontend::WindowSystemType window_type, bool e const auto extensions = GetLayerExtensions(GetInstanceExtensions(window_type, true), layers); const vk::ApplicationInfo application_info = { - .pApplicationName = "shadPS4", + .pApplicationName = "shadBloodborne", .applicationVersion = VK_MAKE_VERSION(1, 0, 0), - .pEngineName = "shadPS4 Vulkan", + .pEngineName = "shadBloodborne Vulkan", .engineVersion = VK_MAKE_VERSION(1, 0, 0), .apiVersion = available_version, }; diff --git a/src/video_core/renderer_vulkan/vk_platform.h b/src/video_core/renderer_vulkan/vk_platform.h index b8f5f9f11..c28fbe17a 100644 --- a/src/video_core/renderer_vulkan/vk_platform.h +++ b/src/video_core/renderer_vulkan/vk_platform.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/renderer_vulkan/vk_presenter.cpp b/src/video_core/renderer_vulkan/vk_presenter.cpp index c2a2a6621..38f38005d 100644 --- a/src/video_core/renderer_vulkan/vk_presenter.cpp +++ b/src/video_core/renderer_vulkan/vk_presenter.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/debug.h" diff --git a/src/video_core/renderer_vulkan/vk_presenter.h b/src/video_core/renderer_vulkan/vk_presenter.h index c1748e9dd..2b368f09d 100644 --- a/src/video_core/renderer_vulkan/vk_presenter.h +++ b/src/video_core/renderer_vulkan/vk_presenter.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 800941fe3..cb364f1e3 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/debug.h" diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.h b/src/video_core/renderer_vulkan/vk_rasterizer.h index c73626f3f..1f9eed59f 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.h +++ b/src/video_core/renderer_vulkan/vk_rasterizer.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/renderer_vulkan/vk_resource_pool.cpp b/src/video_core/renderer_vulkan/vk_resource_pool.cpp index 5bd8025aa..cf26723cb 100644 --- a/src/video_core/renderer_vulkan/vk_resource_pool.cpp +++ b/src/video_core/renderer_vulkan/vk_resource_pool.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/video_core/renderer_vulkan/vk_resource_pool.h b/src/video_core/renderer_vulkan/vk_resource_pool.h index 98c2ddb8c..647abb82b 100644 --- a/src/video_core/renderer_vulkan/vk_resource_pool.h +++ b/src/video_core/renderer_vulkan/vk_resource_pool.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/renderer_vulkan/vk_scheduler.cpp b/src/video_core/renderer_vulkan/vk_scheduler.cpp index fee0b408e..40fdc33a0 100644 --- a/src/video_core/renderer_vulkan/vk_scheduler.cpp +++ b/src/video_core/renderer_vulkan/vk_scheduler.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/assert.h" @@ -171,7 +171,7 @@ void Scheduler::SubmitExecution(SubmitInfo& info) { } void Scheduler::PriorityPendingOpsThread(std::stop_token stoken) { - Common::SetCurrentThreadName("shadPS4:GpuSchedPriorityPendingOpsRunner"); + Common::SetCurrentThreadName("sB:GpuSchedPriorityPendingOpsRunner"); while (!stoken.stop_requested()) { PendingOp op; diff --git a/src/video_core/renderer_vulkan/vk_scheduler.h b/src/video_core/renderer_vulkan/vk_scheduler.h index aff299e54..4388a9785 100644 --- a/src/video_core/renderer_vulkan/vk_scheduler.h +++ b/src/video_core/renderer_vulkan/vk_scheduler.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/renderer_vulkan/vk_shader_hle.cpp b/src/video_core/renderer_vulkan/vk_shader_hle.cpp index 61941892d..531b6ea40 100644 --- a/src/video_core/renderer_vulkan/vk_shader_hle.cpp +++ b/src/video_core/renderer_vulkan/vk_shader_hle.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "shader_recompiler/info.h" diff --git a/src/video_core/renderer_vulkan/vk_shader_hle.h b/src/video_core/renderer_vulkan/vk_shader_hle.h index 393ef29cc..1c0cc2ec8 100644 --- a/src/video_core/renderer_vulkan/vk_shader_hle.h +++ b/src/video_core/renderer_vulkan/vk_shader_hle.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/renderer_vulkan/vk_shader_util.cpp b/src/video_core/renderer_vulkan/vk_shader_util.cpp index 1eb9b27c6..5b17d9750 100644 --- a/src/video_core/renderer_vulkan/vk_shader_util.cpp +++ b/src/video_core/renderer_vulkan/vk_shader_util.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/video_core/renderer_vulkan/vk_shader_util.h b/src/video_core/renderer_vulkan/vk_shader_util.h index 14b929782..7c36f4306 100644 --- a/src/video_core/renderer_vulkan/vk_shader_util.h +++ b/src/video_core/renderer_vulkan/vk_shader_util.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/renderer_vulkan/vk_swapchain.cpp b/src/video_core/renderer_vulkan/vk_swapchain.cpp index 04f9d8504..2e54cb15c 100644 --- a/src/video_core/renderer_vulkan/vk_swapchain.cpp +++ b/src/video_core/renderer_vulkan/vk_swapchain.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/video_core/renderer_vulkan/vk_swapchain.h b/src/video_core/renderer_vulkan/vk_swapchain.h index 826705d40..c8593b879 100644 --- a/src/video_core/renderer_vulkan/vk_swapchain.h +++ b/src/video_core/renderer_vulkan/vk_swapchain.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/texture_cache/blit_helper.cpp b/src/video_core/texture_cache/blit_helper.cpp index f1b79e925..e0d8b2a7b 100644 --- a/src/video_core/texture_cache/blit_helper.cpp +++ b/src/video_core/texture_cache/blit_helper.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "video_core/renderer_vulkan/vk_instance.h" diff --git a/src/video_core/texture_cache/blit_helper.h b/src/video_core/texture_cache/blit_helper.h index 58d4553ff..a52c181e7 100644 --- a/src/video_core/texture_cache/blit_helper.h +++ b/src/video_core/texture_cache/blit_helper.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/texture_cache/image.cpp b/src/video_core/texture_cache/image.cpp index 44ddd55c6..646e59255 100644 --- a/src/video_core/texture_cache/image.cpp +++ b/src/video_core/texture_cache/image.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/video_core/texture_cache/image.h b/src/video_core/texture_cache/image.h index 0bf471dce..54a3a73d1 100644 --- a/src/video_core/texture_cache/image.h +++ b/src/video_core/texture_cache/image.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/texture_cache/image_info.cpp b/src/video_core/texture_cache/image_info.cpp index b0b272e2f..11daf703f 100644 --- a/src/video_core/texture_cache/image_info.cpp +++ b/src/video_core/texture_cache/image_info.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/assert.h" diff --git a/src/video_core/texture_cache/image_info.h b/src/video_core/texture_cache/image_info.h index 543e144d2..643211faf 100644 --- a/src/video_core/texture_cache/image_info.h +++ b/src/video_core/texture_cache/image_info.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/texture_cache/image_view.cpp b/src/video_core/texture_cache/image_view.cpp index 4dd9ddf60..db597dc2c 100644 --- a/src/video_core/texture_cache/image_view.cpp +++ b/src/video_core/texture_cache/image_view.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "common/logging/log.h" diff --git a/src/video_core/texture_cache/image_view.h b/src/video_core/texture_cache/image_view.h index 34326b759..9662a4850 100644 --- a/src/video_core/texture_cache/image_view.h +++ b/src/video_core/texture_cache/image_view.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/texture_cache/sampler.cpp b/src/video_core/texture_cache/sampler.cpp index 3d74793f8..e6dae54e1 100644 --- a/src/video_core/texture_cache/sampler.cpp +++ b/src/video_core/texture_cache/sampler.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/video_core/texture_cache/sampler.h b/src/video_core/texture_cache/sampler.h index 459cc9db5..f5468d438 100644 --- a/src/video_core/texture_cache/sampler.h +++ b/src/video_core/texture_cache/sampler.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/texture_cache/texture_cache.cpp b/src/video_core/texture_cache/texture_cache.cpp index 163712756..a1ddea980 100644 --- a/src/video_core/texture_cache/texture_cache.cpp +++ b/src/video_core/texture_cache/texture_cache.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index 141ac938f..88387bf41 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/texture_cache/tile.h b/src/video_core/texture_cache/tile.h index 68c9428fe..e46c1ce46 100644 --- a/src/video_core/texture_cache/tile.h +++ b/src/video_core/texture_cache/tile.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/texture_cache/tile_manager.cpp b/src/video_core/texture_cache/tile_manager.cpp index d80d2db18..d19b50eed 100644 --- a/src/video_core/texture_cache/tile_manager.cpp +++ b/src/video_core/texture_cache/tile_manager.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "video_core/buffer_cache/buffer.h" diff --git a/src/video_core/texture_cache/tile_manager.h b/src/video_core/texture_cache/tile_manager.h index 6508fd252..2d592c847 100644 --- a/src/video_core/texture_cache/tile_manager.h +++ b/src/video_core/texture_cache/tile_manager.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once diff --git a/src/video_core/texture_cache/types.h b/src/video_core/texture_cache/types.h index 097fdcb96..be4a4e30c 100644 --- a/src/video_core/texture_cache/types.h +++ b/src/video_core/texture_cache/types.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 shadBloodborne Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once