diff --git a/.github/linux-appimage-qt.sh b/.github/linux-appimage-qt.sh index 870172457..203d214e3 100755 --- a/.github/linux-appimage-qt.sh +++ b/.github/linux-appimage-qt.sh @@ -19,8 +19,12 @@ chmod a+x linuxdeploy-x86_64.AppImage chmod a+x linuxdeploy-plugin-qt-x86_64.AppImage chmod a+x linuxdeploy-plugin-checkrt-x86_64.sh + # Build AppImage ./linuxdeploy-x86_64.AppImage --appdir AppDir ./linuxdeploy-plugin-checkrt-x86_64.sh --appdir AppDir + +cp -a "$GITHUB_WORKSPACE/build/translations" AppDir/usr/bin + ./linuxdeploy-x86_64.AppImage --appdir AppDir -d "$GITHUB_WORKSPACE"/.github/shadps4.desktop -e "$GITHUB_WORKSPACE"/build/shadps4 -i "$GITHUB_WORKSPACE"/.github/shadps4.png --plugin qt --output appimage mv Shadps4-x86_64.AppImage Shadps4-qt.AppImage diff --git a/.github/workflows/linux-qt.yml b/.github/workflows/linux-qt.yml index 5611ae50f..26b80d683 100644 --- a/.github/workflows/linux-qt.yml +++ b/.github/workflows/linux-qt.yml @@ -23,7 +23,7 @@ jobs: - name: Install misc packages run: > - sudo apt-get update && sudo apt install libx11-dev libxext-dev libwayland-dev libfuse2 clang build-essential qt6-base-dev + sudo apt-get update && sudo apt install libx11-dev libxext-dev libwayland-dev libfuse2 clang build-essential qt6-base-dev qt6-tools-dev - name: Configure CMake run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DENABLE_QT_GUI=ON diff --git a/.github/workflows/macos-qt.yml b/.github/workflows/macos-qt.yml index 4b3672dff..def98ea34 100644 --- a/.github/workflows/macos-qt.yml +++ b/.github/workflows/macos-qt.yml @@ -38,7 +38,7 @@ jobs: host: mac target: desktop arch: clang_64 - archives: qtbase + archives: qtbase qttools - name: Configure CMake run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_OSX_ARCHITECTURES=x86_64 -DENABLE_QT_GUI=ON @@ -50,6 +50,7 @@ jobs: run: | mkdir upload mv ${{github.workspace}}/build/shadps4.app upload + mv ${{github.workspace}}/build/translations upload macdeployqt upload/shadps4.app tar cf shadps4-macos-qt.tar.gz -C upload . diff --git a/.github/workflows/windows-qt.yml b/.github/workflows/windows-qt.yml index 06a16eb5b..70c33ebe9 100644 --- a/.github/workflows/windows-qt.yml +++ b/.github/workflows/windows-qt.yml @@ -28,7 +28,7 @@ jobs: host: windows target: desktop arch: win64_msvc2019_64 - archives: qtbase + archives: qtbase qttools - name: Configure CMake run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -T ClangCL -DENABLE_QT_GUI=ON @@ -40,6 +40,7 @@ jobs: run: | mkdir upload move build/Release/shadPS4.exe upload + move build/translations upload windeployqt --dir upload upload/shadPS4.exe - name: Upload executable diff --git a/CMakeLists.txt b/CMakeLists.txt index 0ff00d6f5..dfc6528df 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -95,10 +95,6 @@ check_symbol_exists(pthread_mutex_timedlock "pthread.h" HAVE_PTHREAD_MUTEX_TIMED if(HAVE_PTHREAD_MUTEX_TIMEDLOCK OR WIN32) add_compile_options(-DHAVE_PTHREAD_MUTEX_TIMEDLOCK) endif() -check_symbol_exists(sem_timedwait "semaphore.h" HAVE_SEM_TIMEDWAIT) -if(HAVE_SEM_TIMEDWAIT OR WIN32) - add_compile_options(-DHAVE_SEM_TIMEDWAIT) -endif() if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") # libc++ requires -fexperimental-library to enable std::jthread and std::stop_token support. @@ -113,11 +109,27 @@ add_subdirectory(externals) include_directories(src) if(ENABLE_QT_GUI) - find_package(Qt6 REQUIRED COMPONENTS Widgets Concurrent) + find_package(Qt6 REQUIRED COMPONENTS Widgets Concurrent LinguistTools Network) qt_standard_project_setup() set(CMAKE_AUTORCC ON) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOUIC ON) + + set(QT_TRANSLATIONS "${PROJECT_SOURCE_DIR}/src/qt_gui/translations") + file(GLOB_RECURSE TRANSLATIONS_TS ${QT_TRANSLATIONS}/*.ts) + + set_source_files_properties(${TRANSLATIONS_TS} PROPERTIES OUTPUT_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/translations") + qt_add_translation(TRANSLATIONS_QM ${TRANSLATIONS_TS}) + + set(TRANSLATIONS_QRC ${CMAKE_CURRENT_BINARY_DIR}/translations/translations.qrc) + file(WRITE ${TRANSLATIONS_QRC} "\n") + foreach (QM ${TRANSLATIONS_QM}) + get_filename_component(QM_FILE ${QM} NAME) + file(APPEND ${TRANSLATIONS_QRC} "${QM_FILE}\n") + endforeach (QM) + file(APPEND ${TRANSLATIONS_QRC} "") + + qt_add_resources(TRANSLATIONS ${TRANSLATIONS_QRC}) endif() set(AUDIO_CORE src/audio_core/sdl_audio.cpp @@ -136,6 +148,7 @@ set(AUDIO_LIB src/core/libraries/audio/audioin.cpp set(GNM_LIB src/core/libraries/gnmdriver/gnmdriver.cpp src/core/libraries/gnmdriver/gnmdriver.h + src/core/libraries/gnmdriver/gnm_error.h ) set(KERNEL_LIB @@ -217,6 +230,7 @@ set(SYSTEM_LIBS src/core/libraries/system/commondialog.cpp src/core/libraries/ngs2/ngs2_error.h src/core/libraries/ngs2/ngs2_impl.cpp src/core/libraries/ngs2/ngs2_impl.h + src/core/libraries/ajm/ajm_error.h ) set(VIDEOOUT_LIB src/core/libraries/videoout/buffer.h @@ -252,6 +266,7 @@ set(PLAYGO_LIB src/core/libraries/playgo/playgo.cpp 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 @@ -434,7 +449,7 @@ set(SHADER_RECOMPILER src/shader_recompiler/exception.h src/shader_recompiler/frontend/opcodes.h src/shader_recompiler/frontend/structured_control_flow.cpp src/shader_recompiler/frontend/structured_control_flow.h - src/shader_recompiler/ir/passes/constant_propogation_pass.cpp + src/shader_recompiler/ir/passes/constant_propagation_pass.cpp src/shader_recompiler/ir/passes/dead_code_elimination_pass.cpp src/shader_recompiler/ir/passes/identity_removal_pass.cpp src/shader_recompiler/ir/passes/ir_passes.h @@ -472,6 +487,7 @@ set(VIDEO_CORE src/video_core/amdgpu/liverpool.cpp src/video_core/amdgpu/pm4_cmds.h src/video_core/amdgpu/pm4_opcodes.h src/video_core/amdgpu/resource.h + src/video_core/amdgpu/default_context.cpp src/video_core/buffer_cache/buffer.cpp src/video_core/buffer_cache/buffer.h src/video_core/buffer_cache/buffer_cache.cpp @@ -547,6 +563,10 @@ qt_add_resources(RESOURCE_FILES src/shadps4.qrc) set(QT_GUI src/qt_gui/about_dialog.cpp src/qt_gui/about_dialog.h src/qt_gui/about_dialog.ui + src/qt_gui/cheats_patches.cpp + src/qt_gui/cheats_patches.h + src/qt_gui/memory_patcher.cpp + src/qt_gui/memory_patcher.h src/qt_gui/main_window_ui.h src/qt_gui/main_window.cpp src/qt_gui/main_window.h @@ -574,6 +594,7 @@ set(QT_GUI src/qt_gui/about_dialog.cpp src/qt_gui/main.cpp ${EMULATOR} ${RESOURCE_FILES} + ${TRANSLATIONS} ) endif() @@ -634,7 +655,8 @@ else() endif() if (ENABLE_QT_GUI) - target_link_libraries(shadps4 PRIVATE Qt6::Widgets Qt6::Concurrent) + target_link_libraries(shadps4 PRIVATE Qt6::Widgets Qt6::Concurrent Qt6::Network) + add_definitions(-DENABLE_QT_GUI) endif() if (WIN32) diff --git a/README.md b/README.md index 542acca9e..c99142c78 100644 --- a/README.md +++ b/README.md @@ -32,27 +32,30 @@ SPDX-License-Identifier: GPL-2.0-or-later

-# shadPS4 +# General information -shadPS4 is an early **PlayStation 4** emulator for **Windows**, **Linux** and **macOS** written in C++ +shadPS4 is an early **PlayStation 4** emulator for **Windows**, **Linux** and **macOS** written in C++. If you encounter problems or have doubts, do not hesitate to look at the [**Quickstart**](https://github.com/shadps4-emu/shadPS4/blob/main/documents/Quickstart/Quickstart.md). To verify that a game works, you can look at [**shadPS4 Game Compatibility**](https://github.com/shadps4-emu/shadps4-game-compatibility). -To discuss shadPS4 development or suggest ideas, join the [**Discord server**](https://discord.gg/MyZRaBngxA). +To discuss shadPS4 development, suggest ideas or to ask for help, join our [**Discord server**](https://discord.gg/MyZRaBngxA). -To get the latest news, go to our [**X (twitter)**](https://x.com/shadps4) or our [**website**](https://shadps4.net/). +To get the latest news, go to our [**X (Twitter)**](https://x.com/shadps4) or our [**website**](https://shadps4.net/). # Status -In development, small games are working like [**Sonic Mania**](https://www.youtube.com/watch?v=AAHoNzhHyCU), [**Undertale**](https://youtu.be/5zIvdy65Ro4), [**Dysmantle**](https://youtu.be/b9xzhLBdESE) and others... +> [!IMPORTANT] +> shadPS4 is early in developement, don't expect a flawless experience. + +Currently, the emulator successfully runs small games like [**Sonic Mania**](https://www.youtube.com/watch?v=AAHoNzhHyCU), [**Undertale**](https://youtu.be/5zIvdy65Ro4) and it can even *somewhat* run [**Bloodborne**](https://www.youtube.com/watch?v=wC6s0avpQRE). # Why -The project started as a fun project. Due to limited free time, it will probably take a while before shadPS4 is able to run anything decent, but we're trying to make small, regular commits. +This project began as a fun project. 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. -# Build +# Building ## Windows @@ -62,7 +65,7 @@ Check the build instructions for [**Windows**](https://github.com/shadps4-emu/sh Check the build instructions for [**Linux**](https://github.com/shadps4-emu/shadPS4/blob/main/documents/building-linux.md). -## Build status +## Building status
Windows @@ -95,9 +98,12 @@ Check the build instructions for [**Linux**](https://github.com/shadps4-emu/shad For more information on how to test, debug and report issues with the emulator or games, read the [Debugging documentation](https://github.com/shadps4-emu/shadPS4/blob/main/documents/Debugging/Debugging.md). -# Keyboard Mapping +# Keyboard mapping -| Controller button | Keyboard | +> [!NOTE] +> Xbox and DualShock controllers work out of the box. + +| Controller button | Keyboard equivelant | |-------------|-------------| LEFT AXIS UP | W | LEFT AXIS DOWN | S | @@ -154,4 +160,4 @@ Open a PR and we'll check it :) # License -- [**GPL-2.0 license**](https://github.com/shadps4-emu/shadPS4/blob/main/LICENSE) \ No newline at end of file +- [**GPL-2.0 license**](https://github.com/shadps4-emu/shadPS4/blob/main/LICENSE) diff --git a/documents/building-windows.md b/documents/building-windows.md index 684e5fe95..21fd87154 100644 --- a/documents/building-windows.md +++ b/documents/building-windows.md @@ -17,34 +17,53 @@ Note: **ARM64 is not supported!** As of writing, it will not build nor run. The Once you are within the installer: 1. Select `Desktop development with C++` 2. Go to "Individual Components" tab -3. Make sure `C++ Clang Compiler for Windows`, `MSBuild support for LLVM` and `C++ CMake Tools for Windows` are selected +3. Search and select `C++ Clang Compiler for Windows` and `MSBuild support for LLVM` 4. Continue the installation ### (Prerequisite) Download [**Qt**](https://doc.qt.io/qt-6/get-and-install-qt.html) Beware, this requires you to create a Qt account. If you do not want to do this, please follow the MSYS2/MinGW compilation method instead. -1. Select Qt for Visual Studio plugin -2. Select `msvc2019_64` option or similar. If you are on Windows on ARM / Qualcomm Snapdragon Elite X, select `msvc2019_arm64` +1. Under the current, non beta version of Qt (at the time of writing 6.7.2), select the option `MSVC 2019 64-bit` or similar. + If you are on Windows on ARM / Qualcomm Snapdragon Elite X, select `MSVC 2019 ARM64` instead. -Go through the installation normally. If you do not know what components to select, just select the newest Qt version it gives you. -If you know what you are doing, you may unselect individual components that eat up too much disk space. + Go through the installation normally. If you know what you are doing, you may unselect individual components that eat up too much disk space. +2. Download and install [Qt Visual Studio Tools](https://marketplace.visualstudio.com/items?itemName=TheQtCompany.QtVisualStudioTools2022) + Once you are finished, you will have to configure Qt within Visual Studio: 1. Tools -> Options -> Qt -> Versions -2. Add a new Qt version and navigate it to the correct folder. Should look like so: `C:\Qt\6.7.1\msvc2019_64` +2. Add a new Qt version and navigate it to the correct folder. Should look like so: `C:\Qt\6.7.2\msvc2019_64` 3. Enable the default checkmark on the new version you just created. ### (Prerequisite) Download [**Git for Windows**](https://git-scm.com/download/win) Go through the Git for Windows installation as normal -### Compiling with Visual Studio GUI +### Cloning the source code 1. Open Git for Windows, navigate to a place where you want to store the shadPS4 source code folder -2. Run `git clone --depth 1 --recursive https://github.com/shadps4-emu/shadPS4` -3. Open up Visual Studio, select `Open a local folder` and select the folder with the shadPS4 source code. The folder should contain `CMakeLists.txt` -4. Build -> Build All +2. Clone the repository by running + `git clone --depth 1 --recursive https://github.com/shadps4-emu/shadPS4` + +### Compiling with Visual Studio GUI + +1. Open up Visual Studio, select `Open a local folder` and select the folder with the shadPS4 source code. The folder should contain `CMakeLists.txt` +2. Change x64-Clang-Debug to x64-Clang-Release if you want a regular, non-debug build. +3. If you want to build shadPS4 with the Qt Gui: + 1. Click x64-Clang-Release and select "Manage Configurations" + 2. Look for "CMake command arguments" and add to the text field + `-DENABLE_QT_GUI=ON -DCMAKE_PREFIX_PATH=C:\Qt\6.7.2\msvc2019_64` + (Change Qt path if you've installed it to non-default path) + 3. Press CTRL+S to save and wait a moment for CMake generation +4. Change the project to build to shadps4.exe +5. Build -> Build All + +Your shadps4.exe will be in `c:\path\to\source\Build\x64-Clang-Release\` + +To automatically populate the necessary files to run shadPS4.exe, run in a command prompt or terminal: +`C:\Qt\6.7.2\msvc2019_64\bin\windeployqt.exe c:\path\to\shadps4.exe` +(Change Qt path if you've installed it to non-default path) ## Option 2: MSYS2/MinGW diff --git a/scripts/aerolib.inl b/scripts/aerolib.inl index a87c3cc4e..64ee32ea2 100644 --- a/scripts/aerolib.inl +++ b/scripts/aerolib.inl @@ -114108,7 +114108,7 @@ STUB( _ZN3sce2Np9CppWebApi6Common12IntrusivePtrINS1_7Matches2V124RequestCompetitiveResultEE7add_refEv) STUB("efPahl2FufA", _ZN3sce2Np9CppWebApi30CommunicationRestrictionStatus2V35Error8fromJsonERKNS_4Json5ValueE) -STUB("efX3lrPwdKA", sceAppContentAddcontMountByEntitlemetId) +STUB("efX3lrPwdKA", sceAppContentAddcontMountByEntitlementId) STUB("efXnxYFN5oE", _ZNSt11range_errorD0Ev) STUB("efcwuDLsAM0", _ZThn120_NK7WebCore16HTMLMediaElement5mutedEv) STUB("efhGArzWdxE", _ZN7bmalloc6IsoTLS15s_didInitializeE) @@ -129493,7 +129493,7 @@ STUB( STUB("kJlYH5uMAWI", sceNetResolverDestroy) STUB("kJmdxo4uM+8", _ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE5_InitERKSt8_Locinfo) -STUB("kJmjt81mXKQ", sceAppContentAddcontEnqueueDownloadByEntitlemetId) +STUB("kJmjt81mXKQ", sceAppContentAddcontEnqueueDownloadByEntitlementId) STUB( "kJoY9lMIFzY", _ZN3sce2Np9CppWebApi6Common8IteratorINS2_12IntrusivePtrINS1_21AdvancedPlayerProfile2V138MatchCompletionRateDisconnectedMetricsEEEEmmEi) diff --git a/scripts/ps4_names.txt b/scripts/ps4_names.txt index caad2b4df..6f95cc734 100644 --- a/scripts/ps4_names.txt +++ b/scripts/ps4_names.txt @@ -80897,10 +80897,10 @@ sceAppCheckerExecute sceAppCheckerExecuteEx sceAppContentAddcontDelete sceAppContentAddcontEnqueueDownload -sceAppContentAddcontEnqueueDownloadByEntitlemetId +sceAppContentAddcontEnqueueDownloadByEntitlementId sceAppContentAddcontEnqueueDownloadSp sceAppContentAddcontMount -sceAppContentAddcontMountByEntitlemetId +sceAppContentAddcontMountByEntitlementId sceAppContentAddcontShrink sceAppContentAddcontUnmount sceAppContentAppParamGetInt diff --git a/src/common/config.cpp b/src/common/config.cpp index ddd1d3257..8d87ed3c3 100644 --- a/src/common/config.cpp +++ b/src/common/config.cpp @@ -17,9 +17,12 @@ static s32 gpuId = -1; // Vulkan physical device index. Set to negative for auto static std::string logFilter; static std::string logType = "async"; static std::string userName = "shadPS4"; +static bool useSpecialPad = false; +static int specialPadClass = 1; static bool isDebugDump = false; static bool isShowSplash = false; static bool isNullGpu = false; +static bool shouldCopyGPUBuffers = false; static bool shouldDumpShaders = false; static bool shouldDumpPM4 = false; static u32 vblankDivider = 1; @@ -45,6 +48,7 @@ u32 m_window_size_H = 720; std::vector m_pkg_viewer; std::vector m_elf_viewer; std::vector m_recent_files; +std::string emulator_language = "en"; // Settings u32 m_language = 1; // english @@ -80,6 +84,14 @@ std::string getUserName() { return userName; } +bool getUseSpecialPad() { + return useSpecialPad; +} + +int getSpecialPadClass() { + return specialPadClass; +} + bool debugDump() { return isDebugDump; } @@ -92,6 +104,10 @@ bool nullGpu() { return isNullGpu; } +bool copyGPUCmdBuffers() { + return shouldCopyGPUBuffers; +} + bool dumpShaders() { return shouldDumpShaders; } @@ -148,6 +164,10 @@ void setNullGpu(bool enable) { isNullGpu = enable; } +void setCopyGPUCmdBuffers(bool enable) { + shouldCopyGPUBuffers = enable; +} + void setDumpShaders(bool enable) { shouldDumpShaders = enable; } @@ -196,6 +216,14 @@ void setUserName(const std::string& type) { userName = type; } +void setUseSpecialPad(bool use) { + useSpecialPad = use; +} + +void setSpecialPadClass(int type) { + specialPadClass = type; +} + void setMainWindowGeometry(u32 x, u32 y, u32 w, u32 h) { main_window_geometry_x = x; main_window_geometry_y = y; @@ -214,10 +242,10 @@ void setIconSize(u32 size) { void setIconSizeGrid(u32 size) { m_icon_size_grid = size; } -void setSliderPositon(u32 pos) { +void setSliderPosition(u32 pos) { m_slider_pos = pos; } -void setSliderPositonGrid(u32 pos) { +void setSliderPositionGrid(u32 pos) { m_slider_pos_grid = pos; } void setTableMode(u32 mode) { @@ -242,6 +270,10 @@ void setRecentFiles(const std::vector& recentFiles) { m_recent_files = recentFiles; } +void setEmulatorLanguage(std::string language) { + emulator_language = language; +} + u32 getMainWindowGeometryX() { return main_window_geometry_x; } @@ -266,10 +298,10 @@ u32 getIconSize() { u32 getIconSizeGrid() { return m_icon_size_grid; } -u32 getSliderPositon() { +u32 getSliderPosition() { return m_slider_pos; } -u32 getSliderPositonGrid() { +u32 getSliderPositionGrid() { return m_slider_pos_grid; } u32 getTableMode() { @@ -291,6 +323,10 @@ std::vector getRecentFiles() { return m_recent_files; } +std::string getEmulatorLanguage() { + return emulator_language; +} + u32 GetLanguage() { return m_language; } @@ -321,12 +357,20 @@ void load(const std::filesystem::path& path) { isShowSplash = toml::find_or(general, "showSplash", true); } + if (data.contains("Input")) { + const toml::value& input = data.at("Input"); + + useSpecialPad = toml::find_or(input, "useSpecialPad", false); + specialPadClass = toml::find_or(input, "specialPadClass", 1); + } + if (data.contains("GPU")) { const toml::value& gpu = data.at("GPU"); screenWidth = toml::find_or(gpu, "screenWidth", screenWidth); screenHeight = toml::find_or(gpu, "screenHeight", screenHeight); isNullGpu = toml::find_or(gpu, "nullGpu", false); + shouldCopyGPUBuffers = toml::find_or(gpu, "copyGPUBuffers", false); shouldDumpShaders = toml::find_or(gpu, "dumpShaders", false); shouldDumpPM4 = toml::find_or(gpu, "dumpPM4", false); vblankDivider = toml::find_or(gpu, "vblankDivider", 1); @@ -368,6 +412,7 @@ void load(const std::filesystem::path& path) { m_elf_viewer = toml::find_or>(gui, "elfDirs", {}); m_recent_files = toml::find_or>(gui, "recentFiles", {}); m_table_mode = toml::find_or(gui, "gameTableMode", 0); + emulator_language = toml::find_or(gui, "emulatorLanguage", "en"); } if (data.contains("Settings")) { @@ -401,9 +446,12 @@ void save(const std::filesystem::path& path) { data["General"]["logType"] = logType; data["General"]["userName"] = userName; data["General"]["showSplash"] = isShowSplash; + data["Input"]["useSpecialPad"] = useSpecialPad; + data["Input"]["specialPadClass"] = specialPadClass; data["GPU"]["screenWidth"] = screenWidth; data["GPU"]["screenHeight"] = screenHeight; data["GPU"]["nullGpu"] = isNullGpu; + data["GPU"]["copyGPUBuffers"] = shouldCopyGPUBuffers; data["GPU"]["dumpShaders"] = shouldDumpShaders; data["GPU"]["dumpPM4"] = shouldDumpPM4; data["GPU"]["vblankDivider"] = vblankDivider; @@ -430,6 +478,7 @@ void save(const std::filesystem::path& path) { data["GUI"]["pkgDirs"] = m_pkg_viewer; data["GUI"]["elfDirs"] = m_elf_viewer; data["GUI"]["recentFiles"] = m_recent_files; + data["GUI"]["emulatorLanguage"] = emulator_language; data["Settings"]["consoleLanguage"] = m_language; @@ -446,6 +495,8 @@ void setDefaultValues() { logFilter = ""; logType = "async"; userName = "shadPS4"; + useSpecialPad = false; + specialPadClass = 1; isDebugDump = false; isShowSplash = false; isNullGpu = false; @@ -454,6 +505,7 @@ void setDefaultValues() { vblankDivider = 1; vkValidation = false; rdocEnable = false; + emulator_language = "en"; m_language = 1; gpuId = -1; } diff --git a/src/common/config.h b/src/common/config.h index 9bf91e692..11e7d8827 100644 --- a/src/common/config.h +++ b/src/common/config.h @@ -17,6 +17,9 @@ std::string getLogFilter(); std::string getLogType(); std::string getUserName(); +bool getUseSpecialPad(); +int getSpecialPadClass(); + u32 getScreenWidth(); u32 getScreenHeight(); s32 getGpuId(); @@ -24,6 +27,7 @@ s32 getGpuId(); bool debugDump(); bool showSplash(); bool nullGpu(); +bool copyGPUCmdBuffers(); bool dumpShaders(); bool dumpPM4(); bool isRdocEnabled(); @@ -33,6 +37,7 @@ u32 vblankDiv(); void setDebugDump(bool enable); void setShowSplash(bool enable); void setNullGpu(bool enable); +void setCopyGPUCmdBuffers(bool enable); void setDumpShaders(bool enable); void setDumpPM4(bool enable); void setVblankDiv(u32 value); @@ -44,6 +49,9 @@ void setLanguage(u32 language); void setNeoMode(bool enable); void setUserName(const std::string& type); +void setUseSpecialPad(bool use); +void setSpecialPadClass(int type); + void setLogType(const std::string& type); void setLogFilter(const std::string& type); @@ -61,14 +69,15 @@ void setGameInstallDir(const std::string& dir); void setMainWindowTheme(u32 theme); void setIconSize(u32 size); void setIconSizeGrid(u32 size); -void setSliderPositon(u32 pos); -void setSliderPositonGrid(u32 pos); +void setSliderPosition(u32 pos); +void setSliderPositionGrid(u32 pos); void setTableMode(u32 mode); void setMainWindowWidth(u32 width); void setMainWindowHeight(u32 height); void setPkgViewer(const std::vector& pkgList); void setElfViewer(const std::vector& elfList); void setRecentFiles(const std::vector& recentFiles); +void setEmulatorLanguage(std::string language); u32 getMainWindowGeometryX(); u32 getMainWindowGeometryY(); @@ -78,14 +87,15 @@ std::string getGameInstallDir(); u32 getMainWindowTheme(); u32 getIconSize(); u32 getIconSizeGrid(); -u32 getSliderPositon(); -u32 getSliderPositonGrid(); +u32 getSliderPosition(); +u32 getSliderPositionGrid(); u32 getTableMode(); u32 getMainWindowWidth(); u32 getMainWindowHeight(); std::vector getPkgViewer(); std::vector getElfViewer(); std::vector getRecentFiles(); +std::string getEmulatorLanguage(); void setDefaultValues(); diff --git a/src/common/debug.h b/src/common/debug.h index 50022a156..596ad7b84 100644 --- a/src/common/debug.h +++ b/src/common/debug.h @@ -29,7 +29,7 @@ static inline bool IsProfilerConnected() { #define TRACK_ALLOC(ptr, size, pool) TracyAllocN(std::bit_cast(ptr), (size), (pool)) #define TRACK_FREE(ptr, pool) TracyFreeN(std::bit_cast(ptr), (pool)) -enum MarkersPallete : int { +enum MarkersPalette : int { EmulatorMarkerColor = 0x264653, RendererMarkerColor = 0x2a9d8f, HleMarkerColor = 0xe9c46a, diff --git a/src/common/native_clock.cpp b/src/common/native_clock.cpp index 20d0737a6..c3fa637aa 100644 --- a/src/common/native_clock.cpp +++ b/src/common/native_clock.cpp @@ -18,16 +18,16 @@ NativeClock::NativeClock() us_rdtsc_factor{GetFixedPoint64Factor(std::micro::den, rdtsc_frequency)}, ms_rdtsc_factor{GetFixedPoint64Factor(std::milli::den, rdtsc_frequency)} {} -u64 NativeClock::GetTimeNS() const { - return MultiplyHigh(GetUptime(), ns_rdtsc_factor); +u64 NativeClock::GetTimeNS(u64 base_ptc /*= 0*/) const { + return MultiplyHigh(GetUptime() - base_ptc, ns_rdtsc_factor); } -u64 NativeClock::GetTimeUS() const { - return MultiplyHigh(GetUptime(), us_rdtsc_factor); +u64 NativeClock::GetTimeUS(u64 base_ptc /*= 0*/) const { + return MultiplyHigh(GetUptime() - base_ptc, us_rdtsc_factor); } -u64 NativeClock::GetTimeMS() const { - return MultiplyHigh(GetUptime(), ms_rdtsc_factor); +u64 NativeClock::GetTimeMS(u64 base_ptc /*= 0*/) const { + return MultiplyHigh(GetUptime() - base_ptc, ms_rdtsc_factor); } u64 NativeClock::GetUptime() const { diff --git a/src/common/native_clock.h b/src/common/native_clock.h index 227c8d1ae..b5e389452 100644 --- a/src/common/native_clock.h +++ b/src/common/native_clock.h @@ -16,9 +16,9 @@ public: return rdtsc_frequency; } - u64 GetTimeNS() const; - u64 GetTimeUS() const; - u64 GetTimeMS() const; + u64 GetTimeNS(u64 base_ptc = 0) const; + u64 GetTimeUS(u64 base_ptc = 0) const; + u64 GetTimeMS(u64 base_ptc = 0) const; u64 GetUptime() const; u64 GetProcessTimeUS() const; diff --git a/src/common/path_util.cpp b/src/common/path_util.cpp index d69f72163..5d5c9ebad 100644 --- a/src/common/path_util.cpp +++ b/src/common/path_util.cpp @@ -104,6 +104,8 @@ static auto UserPaths = [] { create_path(PathType::SysModuleDir, user_dir / SYSMODULES_DIR); create_path(PathType::DownloadDir, user_dir / DOWNLOAD_DIR); create_path(PathType::CapturesDir, user_dir / CAPTURES_DIR); + create_path(PathType::CheatsDir, user_dir / CHEATS_DIR); + create_path(PathType::PatchesDir, user_dir / PATCHES_DIR); return paths; }(); diff --git a/src/common/path_util.h b/src/common/path_util.h index 263edd46e..8922de9f1 100644 --- a/src/common/path_util.h +++ b/src/common/path_util.h @@ -20,6 +20,8 @@ enum class PathType { SysModuleDir, // Where system modules are stored. DownloadDir, // Where downloads/temp files are stored. CapturesDir, // Where rdoc captures are stored. + CheatsDir, // Where cheats are stored. + PatchesDir, // Where patches are stored. }; constexpr auto PORTABLE_DIR = "user"; @@ -35,6 +37,8 @@ constexpr auto TEMPDATA_DIR = "temp"; constexpr auto SYSMODULES_DIR = "sys_modules"; constexpr auto DOWNLOAD_DIR = "download"; constexpr auto CAPTURES_DIR = "captures"; +constexpr auto CHEATS_DIR = "cheats"; +constexpr auto PATCHES_DIR = "patches"; // Filenames constexpr auto LOG_FILE = "shad_log.txt"; diff --git a/src/core/aerolib/aerolib.inl b/src/core/aerolib/aerolib.inl index a87c3cc4e..64ee32ea2 100644 --- a/src/core/aerolib/aerolib.inl +++ b/src/core/aerolib/aerolib.inl @@ -114108,7 +114108,7 @@ STUB( _ZN3sce2Np9CppWebApi6Common12IntrusivePtrINS1_7Matches2V124RequestCompetitiveResultEE7add_refEv) STUB("efPahl2FufA", _ZN3sce2Np9CppWebApi30CommunicationRestrictionStatus2V35Error8fromJsonERKNS_4Json5ValueE) -STUB("efX3lrPwdKA", sceAppContentAddcontMountByEntitlemetId) +STUB("efX3lrPwdKA", sceAppContentAddcontMountByEntitlementId) STUB("efXnxYFN5oE", _ZNSt11range_errorD0Ev) STUB("efcwuDLsAM0", _ZThn120_NK7WebCore16HTMLMediaElement5mutedEv) STUB("efhGArzWdxE", _ZN7bmalloc6IsoTLS15s_didInitializeE) @@ -129493,7 +129493,7 @@ STUB( STUB("kJlYH5uMAWI", sceNetResolverDestroy) STUB("kJmdxo4uM+8", _ZNSt9money_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE5_InitERKSt8_Locinfo) -STUB("kJmjt81mXKQ", sceAppContentAddcontEnqueueDownloadByEntitlemetId) +STUB("kJmjt81mXKQ", sceAppContentAddcontEnqueueDownloadByEntitlementId) STUB( "kJoY9lMIFzY", _ZN3sce2Np9CppWebApi6Common8IteratorINS2_12IntrusivePtrINS1_21AdvancedPlayerProfile2V138MatchCompletionRateDisconnectedMetricsEEEEmmEi) diff --git a/src/core/aerolib/stubs.cpp b/src/core/aerolib/stubs.cpp index 5e2d55cdc..2634fc46a 100644 --- a/src/core/aerolib/stubs.cpp +++ b/src/core/aerolib/stubs.cpp @@ -13,7 +13,7 @@ namespace Core::AeroLib { // on lookup, setting up the nid_entry they are matched with // // If it runs out of stubs with name information, it will return -// a default implemetnation without function name details +// a default implementation without function name details // Up to 512, larger values lead to more resolve stub slots // and to longer compile / CI times diff --git a/src/core/crypto/crypto.cpp b/src/core/crypto/crypto.cpp index fc64edc2d..aa1c96724 100644 --- a/src/core/crypto/crypto.cpp +++ b/src/core/crypto/crypto.cpp @@ -6,18 +6,18 @@ CryptoPP::RSA::PrivateKey Crypto::key_pkg_derived_key3_keyset_init() { CryptoPP::InvertibleRSAFunction params; - params.SetPrime1(CryptoPP::Integer(pkg_derived_key3_keyset.Prime1, 0x80)); - params.SetPrime2(CryptoPP::Integer(pkg_derived_key3_keyset.Prime2, 0x80)); + params.SetPrime1(CryptoPP::Integer(PkgDerivedKey3Keyset::Prime1, 0x80)); + params.SetPrime2(CryptoPP::Integer(PkgDerivedKey3Keyset::Prime2, 0x80)); - params.SetPublicExponent(CryptoPP::Integer(pkg_derived_key3_keyset.PublicExponent, 4)); - params.SetPrivateExponent(CryptoPP::Integer(pkg_derived_key3_keyset.PrivateExponent, 0x100)); + params.SetPublicExponent(CryptoPP::Integer(PkgDerivedKey3Keyset::PublicExponent, 4)); + params.SetPrivateExponent(CryptoPP::Integer(PkgDerivedKey3Keyset::PrivateExponent, 0x100)); - params.SetModPrime1PrivateExponent(CryptoPP::Integer(pkg_derived_key3_keyset.Exponent1, 0x80)); - params.SetModPrime2PrivateExponent(CryptoPP::Integer(pkg_derived_key3_keyset.Exponent2, 0x80)); + params.SetModPrime1PrivateExponent(CryptoPP::Integer(PkgDerivedKey3Keyset::Exponent1, 0x80)); + params.SetModPrime2PrivateExponent(CryptoPP::Integer(PkgDerivedKey3Keyset::Exponent2, 0x80)); - params.SetModulus(CryptoPP::Integer(pkg_derived_key3_keyset.Modulus, 0x100)); + params.SetModulus(CryptoPP::Integer(PkgDerivedKey3Keyset::Modulus, 0x100)); params.SetMultiplicativeInverseOfPrime2ModPrime1( - CryptoPP::Integer(pkg_derived_key3_keyset.Coefficient, 0x80)); + CryptoPP::Integer(PkgDerivedKey3Keyset::Coefficient, 0x80)); CryptoPP::RSA::PrivateKey privateKey(params); @@ -26,18 +26,18 @@ CryptoPP::RSA::PrivateKey Crypto::key_pkg_derived_key3_keyset_init() { CryptoPP::RSA::PrivateKey Crypto::FakeKeyset_keyset_init() { CryptoPP::InvertibleRSAFunction params; - params.SetPrime1(CryptoPP::Integer(FakeKeyset_keyset.Prime1, 0x80)); - params.SetPrime2(CryptoPP::Integer(FakeKeyset_keyset.Prime2, 0x80)); + params.SetPrime1(CryptoPP::Integer(FakeKeyset::Prime1, 0x80)); + params.SetPrime2(CryptoPP::Integer(FakeKeyset::Prime2, 0x80)); - params.SetPublicExponent(CryptoPP::Integer(FakeKeyset_keyset.PublicExponent, 4)); - params.SetPrivateExponent(CryptoPP::Integer(FakeKeyset_keyset.PrivateExponent, 0x100)); + params.SetPublicExponent(CryptoPP::Integer(FakeKeyset::PublicExponent, 4)); + params.SetPrivateExponent(CryptoPP::Integer(FakeKeyset::PrivateExponent, 0x100)); - params.SetModPrime1PrivateExponent(CryptoPP::Integer(FakeKeyset_keyset.Exponent1, 0x80)); - params.SetModPrime2PrivateExponent(CryptoPP::Integer(FakeKeyset_keyset.Exponent2, 0x80)); + params.SetModPrime1PrivateExponent(CryptoPP::Integer(FakeKeyset::Exponent1, 0x80)); + params.SetModPrime2PrivateExponent(CryptoPP::Integer(FakeKeyset::Exponent2, 0x80)); - params.SetModulus(CryptoPP::Integer(FakeKeyset_keyset.Modulus, 0x100)); + params.SetModulus(CryptoPP::Integer(FakeKeyset::Modulus, 0x100)); params.SetMultiplicativeInverseOfPrime2ModPrime1( - CryptoPP::Integer(FakeKeyset_keyset.Coefficient, 0x80)); + CryptoPP::Integer(FakeKeyset::Coefficient, 0x80)); CryptoPP::RSA::PrivateKey privateKey(params); @@ -46,25 +46,22 @@ CryptoPP::RSA::PrivateKey Crypto::FakeKeyset_keyset_init() { CryptoPP::RSA::PrivateKey Crypto::DebugRifKeyset_init() { CryptoPP::InvertibleRSAFunction params; - params.SetPrime1( - CryptoPP::Integer(DebugRifKeyset_keyset.Prime1, sizeof(DebugRifKeyset_keyset.Prime1))); - params.SetPrime2( - CryptoPP::Integer(DebugRifKeyset_keyset.Prime2, sizeof(DebugRifKeyset_keyset.Prime2))); + params.SetPrime1(CryptoPP::Integer(DebugRifKeyset::Prime1, sizeof(DebugRifKeyset::Prime1))); + params.SetPrime2(CryptoPP::Integer(DebugRifKeyset::Prime2, sizeof(DebugRifKeyset::Prime2))); - params.SetPublicExponent(CryptoPP::Integer(DebugRifKeyset_keyset.PublicExponent, - sizeof(DebugRifKeyset_keyset.PublicExponent))); - params.SetPrivateExponent(CryptoPP::Integer(DebugRifKeyset_keyset.PrivateExponent, - sizeof(DebugRifKeyset_keyset.PrivateExponent))); + params.SetPublicExponent( + CryptoPP::Integer(DebugRifKeyset::PublicExponent, sizeof(DebugRifKeyset::PublicExponent))); + params.SetPrivateExponent(CryptoPP::Integer(DebugRifKeyset::PrivateExponent, + sizeof(DebugRifKeyset::PrivateExponent))); - params.SetModPrime1PrivateExponent(CryptoPP::Integer(DebugRifKeyset_keyset.Exponent1, - sizeof(DebugRifKeyset_keyset.Exponent1))); - params.SetModPrime2PrivateExponent(CryptoPP::Integer(DebugRifKeyset_keyset.Exponent2, - sizeof(DebugRifKeyset_keyset.Exponent2))); + params.SetModPrime1PrivateExponent( + CryptoPP::Integer(DebugRifKeyset::Exponent1, sizeof(DebugRifKeyset::Exponent1))); + params.SetModPrime2PrivateExponent( + CryptoPP::Integer(DebugRifKeyset::Exponent2, sizeof(DebugRifKeyset::Exponent2))); - params.SetModulus( - CryptoPP::Integer(DebugRifKeyset_keyset.Modulus, sizeof(DebugRifKeyset_keyset.Modulus))); - params.SetMultiplicativeInverseOfPrime2ModPrime1(CryptoPP::Integer( - DebugRifKeyset_keyset.Coefficient, sizeof(DebugRifKeyset_keyset.Coefficient))); + params.SetModulus(CryptoPP::Integer(DebugRifKeyset::Modulus, sizeof(DebugRifKeyset::Modulus))); + params.SetMultiplicativeInverseOfPrime2ModPrime1( + CryptoPP::Integer(DebugRifKeyset::Coefficient, sizeof(DebugRifKeyset::Coefficient))); CryptoPP::RSA::PrivateKey privateKey(params); diff --git a/src/core/crypto/crypto.h b/src/core/crypto/crypto.h index 0c5bc9955..83249bd7d 100644 --- a/src/core/crypto/crypto.h +++ b/src/core/crypto/crypto.h @@ -17,10 +17,6 @@ class Crypto { public: - PkgDerivedKey3Keyset pkg_derived_key3_keyset; - FakeKeyset FakeKeyset_keyset; - DebugRifKeyset DebugRifKeyset_keyset; - CryptoPP::RSA::PrivateKey key_pkg_derived_key3_keyset_init(); CryptoPP::RSA::PrivateKey FakeKeyset_keyset_init(); CryptoPP::RSA::PrivateKey DebugRifKeyset_init(); diff --git a/src/core/crypto/keys.h b/src/core/crypto/keys.h index 37b66bd09..441082481 100644 --- a/src/core/crypto/keys.h +++ b/src/core/crypto/keys.h @@ -7,384 +7,299 @@ class FakeKeyset { public: // Constructor - const CryptoPP::byte* Exponent1; + static constexpr CryptoPP::byte Exponent1[] = { + 0x6D, 0x48, 0xE0, 0x54, 0x40, 0x25, 0xC8, 0x41, 0x29, 0x52, 0x42, 0x27, 0xEB, 0xD2, 0xC7, + 0xAB, 0x6B, 0x9C, 0x27, 0x0A, 0xB4, 0x1F, 0x94, 0x4E, 0xFA, 0x42, 0x1D, 0xB7, 0xBC, 0xB9, + 0xAE, 0xBC, 0x04, 0x6F, 0x75, 0x8F, 0x10, 0x5F, 0x89, 0xAC, 0xAB, 0x9C, 0xD2, 0xFA, 0xE6, + 0xA4, 0x13, 0x83, 0x68, 0xD4, 0x56, 0x38, 0xFE, 0xE5, 0x2B, 0x78, 0x44, 0x9C, 0x34, 0xE6, + 0x5A, 0xA0, 0xBE, 0x05, 0x70, 0xAD, 0x15, 0xC3, 0x2D, 0x31, 0xAC, 0x97, 0x5D, 0x88, 0xFC, + 0xC1, 0x62, 0x3D, 0xE2, 0xED, 0x11, 0xDB, 0xB6, 0x9E, 0xFC, 0x5A, 0x5A, 0x03, 0xF6, 0xCF, + 0x08, 0xD4, 0x5D, 0x90, 0xC9, 0x2A, 0xB9, 0x9B, 0xCF, 0xC8, 0x1A, 0x65, 0xF3, 0x5B, 0xE8, + 0x7F, 0xCF, 0xA5, 0xA6, 0x4C, 0x5C, 0x2A, 0x12, 0x0F, 0x92, 0xA5, 0xE3, 0xF0, 0x17, 0x1E, + 0x9A, 0x97, 0x45, 0x86, 0xFD, 0xDB, 0x54, 0x25}; // exponent2 = d mod (q - 1) - const CryptoPP::byte* Exponent2; + static constexpr CryptoPP::byte Exponent2[] = { + 0x2A, 0x51, 0xCE, 0x02, 0x44, 0x28, 0x50, 0xE8, 0x30, 0x20, 0x7C, 0x9C, 0x55, 0xBF, 0x60, + 0x39, 0xBC, 0xD1, 0xF0, 0xE7, 0x68, 0xF8, 0x08, 0x5B, 0x61, 0x1F, 0xA7, 0xBF, 0xD0, 0xE8, + 0x8B, 0xB5, 0xB1, 0xD5, 0xD9, 0x16, 0xAC, 0x75, 0x0C, 0x6D, 0xF2, 0xE0, 0xB5, 0x97, 0x75, + 0xD2, 0x68, 0x16, 0x1F, 0x00, 0x7D, 0x8B, 0x17, 0xE8, 0x78, 0x48, 0x41, 0x71, 0x2B, 0x18, + 0x96, 0x80, 0x11, 0xDB, 0x68, 0x39, 0x9C, 0xD6, 0xE0, 0x72, 0x42, 0x86, 0xF0, 0x1B, 0x16, + 0x0D, 0x3E, 0x12, 0x94, 0x3D, 0x25, 0xA8, 0xA9, 0x30, 0x9E, 0x54, 0x5A, 0xD6, 0x36, 0x6C, + 0xD6, 0x8C, 0x20, 0x62, 0x8F, 0xA1, 0x6B, 0x1F, 0x7C, 0x6D, 0xB2, 0xB1, 0xC1, 0x2E, 0xAD, + 0x36, 0x02, 0x9C, 0x3A, 0xCA, 0x2F, 0x09, 0xD2, 0x45, 0x9E, 0xEB, 0xF2, 0xBC, 0x6C, 0xAA, + 0x3B, 0x3E, 0x90, 0xBC, 0x38, 0x67, 0x35, 0x4D}; // e - const CryptoPP::byte* PublicExponent; + static constexpr CryptoPP::byte PublicExponent[] = {0, 1, 0, 1}; // (InverseQ)(q) = 1 mod p - const CryptoPP::byte* Coefficient; + static constexpr CryptoPP::byte Coefficient[] = { + 0x0B, 0x67, 0x1C, 0x0D, 0x6C, 0x57, 0xD3, 0xE7, 0x05, 0x65, 0x94, 0x31, 0x56, 0x55, 0xFD, + 0x28, 0x08, 0xFA, 0x05, 0x8A, 0xCC, 0x55, 0x39, 0x61, 0x97, 0x63, 0xA0, 0x16, 0x27, 0x3D, + 0xED, 0xC1, 0x16, 0x40, 0x2A, 0x12, 0xEA, 0x6F, 0xD9, 0xD8, 0x58, 0x56, 0xA8, 0x56, 0x8B, + 0x0D, 0x38, 0x5E, 0x1E, 0x80, 0x3B, 0x5F, 0x40, 0x80, 0x6F, 0x62, 0x4F, 0x28, 0xA2, 0x69, + 0xF3, 0xD3, 0xF7, 0xFD, 0xB2, 0xC3, 0x52, 0x43, 0x20, 0x92, 0x9D, 0x97, 0x8D, 0xA0, 0x15, + 0x07, 0x15, 0x6E, 0xA4, 0x0D, 0x56, 0xD3, 0x37, 0x1A, 0xC4, 0x9E, 0xDF, 0x02, 0x49, 0xB8, + 0x0A, 0x84, 0x62, 0xF5, 0xFA, 0xB9, 0x3F, 0xA4, 0x09, 0x76, 0xCC, 0xAA, 0xB9, 0x9B, 0xA6, + 0x4F, 0xC1, 0x6A, 0x64, 0xCE, 0xD8, 0x77, 0xAB, 0x4B, 0xF9, 0xA0, 0xAE, 0xDA, 0xF1, 0x67, + 0x87, 0x7C, 0x98, 0x5C, 0x7E, 0xB8, 0x73, 0xF5}; // n = p * q - const CryptoPP::byte* Modulus; + static constexpr CryptoPP::byte Modulus[] = { + 0xC6, 0xCF, 0x71, 0xE7, 0xE5, 0x9A, 0xF0, 0xD1, 0x2A, 0x2C, 0x45, 0x8B, 0xF9, 0x2A, 0x0E, + 0xC1, 0x43, 0x05, 0x8B, 0xC3, 0x71, 0x17, 0x80, 0x1D, 0xCD, 0x49, 0x7D, 0xDE, 0x35, 0x9D, + 0x25, 0x9B, 0xA0, 0xD7, 0xA0, 0xF2, 0x7D, 0x6C, 0x08, 0x7E, 0xAA, 0x55, 0x02, 0x68, 0x2B, + 0x23, 0xC6, 0x44, 0xB8, 0x44, 0x18, 0xEB, 0x56, 0xCF, 0x16, 0xA2, 0x48, 0x03, 0xC9, 0xE7, + 0x4F, 0x87, 0xEB, 0x3D, 0x30, 0xC3, 0x15, 0x88, 0xBF, 0x20, 0xE7, 0x9D, 0xFF, 0x77, 0x0C, + 0xDE, 0x1D, 0x24, 0x1E, 0x63, 0xA9, 0x4F, 0x8A, 0xBF, 0x5B, 0xBE, 0x60, 0x19, 0x68, 0x33, + 0x3B, 0xFC, 0xED, 0x9F, 0x47, 0x4E, 0x5F, 0xF8, 0xEA, 0xCB, 0x3D, 0x00, 0xBD, 0x67, 0x01, + 0xF9, 0x2C, 0x6D, 0xC6, 0xAC, 0x13, 0x64, 0xE7, 0x67, 0x14, 0xF3, 0xDC, 0x52, 0x69, 0x6A, + 0xB9, 0x83, 0x2C, 0x42, 0x30, 0x13, 0x1B, 0xB2, 0xD8, 0xA5, 0x02, 0x0D, 0x79, 0xED, 0x96, + 0xB1, 0x0D, 0xF8, 0xCC, 0x0C, 0xDF, 0x81, 0x95, 0x4F, 0x03, 0x58, 0x09, 0x57, 0x0E, 0x80, + 0x69, 0x2E, 0xFE, 0xFF, 0x52, 0x77, 0xEA, 0x75, 0x28, 0xA8, 0xFB, 0xC9, 0xBE, 0xBF, 0x9F, + 0xBB, 0xB7, 0x79, 0x8E, 0x18, 0x05, 0xE1, 0x80, 0xBD, 0x50, 0x34, 0x94, 0x81, 0xD3, 0x53, + 0xC2, 0x69, 0xA2, 0xD2, 0x4C, 0xCF, 0x6C, 0xF4, 0x57, 0x2C, 0x10, 0x4A, 0x3F, 0xFB, 0x22, + 0xFD, 0x8B, 0x97, 0xE2, 0xC9, 0x5B, 0xA6, 0x2B, 0xCD, 0xD6, 0x1B, 0x6B, 0xDB, 0x68, 0x7F, + 0x4B, 0xC2, 0xA0, 0x50, 0x34, 0xC0, 0x05, 0xE5, 0x8D, 0xEF, 0x24, 0x67, 0xFF, 0x93, 0x40, + 0xCF, 0x2D, 0x62, 0xA2, 0xA0, 0x50, 0xB1, 0xF1, 0x3A, 0xA8, 0x3D, 0xFD, 0x80, 0xD1, 0xF9, + 0xB8, 0x05, 0x22, 0xAF, 0xC8, 0x35, 0x45, 0x90, 0x58, 0x8E, 0xE3, 0x3A, 0x7C, 0xBD, 0x3E, + 0x27}; // p - const CryptoPP::byte* Prime1; + static constexpr CryptoPP::byte Prime1[] = { + 0xFE, 0xF6, 0xBF, 0x1D, 0x69, 0xAB, 0x16, 0x25, 0x08, 0x47, 0x55, 0x6B, 0x86, 0xE4, 0x35, + 0x88, 0x72, 0x2A, 0xB1, 0x3D, 0xF8, 0xB6, 0x44, 0xCA, 0xB3, 0xAB, 0x19, 0xD1, 0x04, 0x24, + 0x28, 0x0A, 0x74, 0x55, 0xB8, 0x15, 0x45, 0x09, 0xCC, 0x13, 0x1C, 0xF2, 0xBA, 0x37, 0xA9, + 0x03, 0x90, 0x8F, 0x02, 0x10, 0xFF, 0x25, 0x79, 0x86, 0xCC, 0x18, 0x50, 0x9A, 0x10, 0x5F, + 0x5B, 0x4C, 0x1C, 0x4E, 0xB0, 0xA7, 0xE3, 0x59, 0xB1, 0x2D, 0xA0, 0xC6, 0xB0, 0x20, 0x2C, + 0x21, 0x33, 0x12, 0xB3, 0xAF, 0x72, 0x34, 0x83, 0xCD, 0x52, 0x2F, 0xAF, 0x0F, 0x20, 0x5A, + 0x1B, 0xC0, 0xE2, 0xA3, 0x76, 0x34, 0x0F, 0xD7, 0xFC, 0xC1, 0x41, 0xC9, 0xF9, 0x79, 0x40, + 0x17, 0x42, 0x21, 0x3E, 0x9D, 0xFD, 0xC7, 0xC1, 0x50, 0xDE, 0x44, 0x5A, 0xC9, 0x31, 0x89, + 0x6A, 0x78, 0x05, 0xBE, 0x65, 0xB4, 0xE8, 0x2D}; // q - const CryptoPP::byte* Prime2; - const CryptoPP::byte* PrivateExponent; - - // Constructor - FakeKeyset() { - // Initialize PrivateExponent - PrivateExponent = new CryptoPP::byte[0x100]{ - 0x7F, 0x76, 0xCD, 0x0E, 0xE2, 0xD4, 0xDE, 0x05, 0x1C, 0xC6, 0xD9, 0xA8, 0x0E, 0x8D, - 0xFA, 0x7B, 0xCA, 0x1E, 0xAA, 0x27, 0x1A, 0x40, 0xF8, 0xF1, 0x22, 0x87, 0x35, 0xDD, - 0xDB, 0xFD, 0xEE, 0xF8, 0xC2, 0xBC, 0xBD, 0x01, 0xFB, 0x8B, 0xE2, 0x3E, 0x63, 0xB2, - 0xB1, 0x22, 0x5C, 0x56, 0x49, 0x6E, 0x11, 0xBE, 0x07, 0x44, 0x0B, 0x9A, 0x26, 0x66, - 0xD1, 0x49, 0x2C, 0x8F, 0xD3, 0x1B, 0xCF, 0xA4, 0xA1, 0xB8, 0xD1, 0xFB, 0xA4, 0x9E, - 0xD2, 0x21, 0x28, 0x83, 0x09, 0x8A, 0xF6, 0xA0, 0x0B, 0xA3, 0xD6, 0x0F, 0x9B, 0x63, - 0x68, 0xCC, 0xBC, 0x0C, 0x4E, 0x14, 0x5B, 0x27, 0xA4, 0xA9, 0xF4, 0x2B, 0xB9, 0xB8, - 0x7B, 0xC0, 0xE6, 0x51, 0xAD, 0x1D, 0x77, 0xD4, 0x6B, 0xB9, 0xCE, 0x20, 0xD1, 0x26, - 0x66, 0x7E, 0x5E, 0x9E, 0xA2, 0xE9, 0x6B, 0x90, 0xF3, 0x73, 0xB8, 0x52, 0x8F, 0x44, - 0x11, 0x03, 0x0C, 0x13, 0x97, 0x39, 0x3D, 0x13, 0x22, 0x58, 0xD5, 0x43, 0x82, 0x49, - 0xDA, 0x6E, 0x7C, 0xA1, 0xC5, 0x8C, 0xA5, 0xB0, 0x09, 0xE0, 0xCE, 0x3D, 0xDF, 0xF4, - 0x9D, 0x3C, 0x97, 0x15, 0xE2, 0x6A, 0xC7, 0x2B, 0x3C, 0x50, 0x93, 0x23, 0xDB, 0xBA, - 0x4A, 0x22, 0x66, 0x44, 0xAC, 0x78, 0xBB, 0x0E, 0x1A, 0x27, 0x43, 0xB5, 0x71, 0x67, - 0xAF, 0xF4, 0xAB, 0x48, 0x46, 0x93, 0x73, 0xD0, 0x42, 0xAB, 0x93, 0x63, 0xE5, 0x6C, - 0x9A, 0xDE, 0x50, 0x24, 0xC0, 0x23, 0x7D, 0x99, 0x79, 0x3F, 0x22, 0x07, 0xE0, 0xC1, - 0x48, 0x56, 0x1B, 0xDF, 0x83, 0x09, 0x12, 0xB4, 0x2D, 0x45, 0x6B, 0xC9, 0xC0, 0x68, - 0x85, 0x99, 0x90, 0x79, 0x96, 0x1A, 0xD7, 0xF5, 0x4D, 0x1F, 0x37, 0x83, 0x40, 0x4A, - 0xEC, 0x39, 0x37, 0xA6, 0x80, 0x92, 0x7D, 0xC5, 0x80, 0xC7, 0xD6, 0x6F, 0xFE, 0x8A, - 0x79, 0x89, 0xC6, 0xB1}; - - // Initialize Exponent1 - Exponent1 = new CryptoPP::byte[0x80]{ - 0x6D, 0x48, 0xE0, 0x54, 0x40, 0x25, 0xC8, 0x41, 0x29, 0x52, 0x42, 0x27, 0xEB, - 0xD2, 0xC7, 0xAB, 0x6B, 0x9C, 0x27, 0x0A, 0xB4, 0x1F, 0x94, 0x4E, 0xFA, 0x42, - 0x1D, 0xB7, 0xBC, 0xB9, 0xAE, 0xBC, 0x04, 0x6F, 0x75, 0x8F, 0x10, 0x5F, 0x89, - 0xAC, 0xAB, 0x9C, 0xD2, 0xFA, 0xE6, 0xA4, 0x13, 0x83, 0x68, 0xD4, 0x56, 0x38, - 0xFE, 0xE5, 0x2B, 0x78, 0x44, 0x9C, 0x34, 0xE6, 0x5A, 0xA0, 0xBE, 0x05, 0x70, - 0xAD, 0x15, 0xC3, 0x2D, 0x31, 0xAC, 0x97, 0x5D, 0x88, 0xFC, 0xC1, 0x62, 0x3D, - 0xE2, 0xED, 0x11, 0xDB, 0xB6, 0x9E, 0xFC, 0x5A, 0x5A, 0x03, 0xF6, 0xCF, 0x08, - 0xD4, 0x5D, 0x90, 0xC9, 0x2A, 0xB9, 0x9B, 0xCF, 0xC8, 0x1A, 0x65, 0xF3, 0x5B, - 0xE8, 0x7F, 0xCF, 0xA5, 0xA6, 0x4C, 0x5C, 0x2A, 0x12, 0x0F, 0x92, 0xA5, 0xE3, - 0xF0, 0x17, 0x1E, 0x9A, 0x97, 0x45, 0x86, 0xFD, 0xDB, 0x54, 0x25 - - }; - - Exponent2 = new CryptoPP::byte[0x80]{ - 0x2A, 0x51, 0xCE, 0x02, 0x44, 0x28, 0x50, 0xE8, 0x30, 0x20, 0x7C, 0x9C, 0x55, - 0xBF, 0x60, 0x39, 0xBC, 0xD1, 0xF0, 0xE7, 0x68, 0xF8, 0x08, 0x5B, 0x61, 0x1F, - 0xA7, 0xBF, 0xD0, 0xE8, 0x8B, 0xB5, 0xB1, 0xD5, 0xD9, 0x16, 0xAC, 0x75, 0x0C, - 0x6D, 0xF2, 0xE0, 0xB5, 0x97, 0x75, 0xD2, 0x68, 0x16, 0x1F, 0x00, 0x7D, 0x8B, - 0x17, 0xE8, 0x78, 0x48, 0x41, 0x71, 0x2B, 0x18, 0x96, 0x80, 0x11, 0xDB, 0x68, - 0x39, 0x9C, 0xD6, 0xE0, 0x72, 0x42, 0x86, 0xF0, 0x1B, 0x16, 0x0D, 0x3E, 0x12, - 0x94, 0x3D, 0x25, 0xA8, 0xA9, 0x30, 0x9E, 0x54, 0x5A, 0xD6, 0x36, 0x6C, 0xD6, - 0x8C, 0x20, 0x62, 0x8F, 0xA1, 0x6B, 0x1F, 0x7C, 0x6D, 0xB2, 0xB1, 0xC1, 0x2E, - 0xAD, 0x36, 0x02, 0x9C, 0x3A, 0xCA, 0x2F, 0x09, 0xD2, 0x45, 0x9E, 0xEB, 0xF2, - 0xBC, 0x6C, 0xAA, 0x3B, 0x3E, 0x90, 0xBC, 0x38, 0x67, 0x35, 0x4D}; - - PublicExponent = new CryptoPP::byte[4]{0, 1, 0, 1}; - - Coefficient = new CryptoPP::byte[0x80]{ - 0x0B, 0x67, 0x1C, 0x0D, 0x6C, 0x57, 0xD3, 0xE7, 0x05, 0x65, 0x94, 0x31, 0x56, - 0x55, 0xFD, 0x28, 0x08, 0xFA, 0x05, 0x8A, 0xCC, 0x55, 0x39, 0x61, 0x97, 0x63, - 0xA0, 0x16, 0x27, 0x3D, 0xED, 0xC1, 0x16, 0x40, 0x2A, 0x12, 0xEA, 0x6F, 0xD9, - 0xD8, 0x58, 0x56, 0xA8, 0x56, 0x8B, 0x0D, 0x38, 0x5E, 0x1E, 0x80, 0x3B, 0x5F, - 0x40, 0x80, 0x6F, 0x62, 0x4F, 0x28, 0xA2, 0x69, 0xF3, 0xD3, 0xF7, 0xFD, 0xB2, - 0xC3, 0x52, 0x43, 0x20, 0x92, 0x9D, 0x97, 0x8D, 0xA0, 0x15, 0x07, 0x15, 0x6E, - 0xA4, 0x0D, 0x56, 0xD3, 0x37, 0x1A, 0xC4, 0x9E, 0xDF, 0x02, 0x49, 0xB8, 0x0A, - 0x84, 0x62, 0xF5, 0xFA, 0xB9, 0x3F, 0xA4, 0x09, 0x76, 0xCC, 0xAA, 0xB9, 0x9B, - 0xA6, 0x4F, 0xC1, 0x6A, 0x64, 0xCE, 0xD8, 0x77, 0xAB, 0x4B, 0xF9, 0xA0, 0xAE, - 0xDA, 0xF1, 0x67, 0x87, 0x7C, 0x98, 0x5C, 0x7E, 0xB8, 0x73, 0xF5}; - - Modulus = new CryptoPP::byte[0x100]{ - 0xC6, 0xCF, 0x71, 0xE7, 0xE5, 0x9A, 0xF0, 0xD1, 0x2A, 0x2C, 0x45, 0x8B, 0xF9, 0x2A, - 0x0E, 0xC1, 0x43, 0x05, 0x8B, 0xC3, 0x71, 0x17, 0x80, 0x1D, 0xCD, 0x49, 0x7D, 0xDE, - 0x35, 0x9D, 0x25, 0x9B, 0xA0, 0xD7, 0xA0, 0xF2, 0x7D, 0x6C, 0x08, 0x7E, 0xAA, 0x55, - 0x02, 0x68, 0x2B, 0x23, 0xC6, 0x44, 0xB8, 0x44, 0x18, 0xEB, 0x56, 0xCF, 0x16, 0xA2, - 0x48, 0x03, 0xC9, 0xE7, 0x4F, 0x87, 0xEB, 0x3D, 0x30, 0xC3, 0x15, 0x88, 0xBF, 0x20, - 0xE7, 0x9D, 0xFF, 0x77, 0x0C, 0xDE, 0x1D, 0x24, 0x1E, 0x63, 0xA9, 0x4F, 0x8A, 0xBF, - 0x5B, 0xBE, 0x60, 0x19, 0x68, 0x33, 0x3B, 0xFC, 0xED, 0x9F, 0x47, 0x4E, 0x5F, 0xF8, - 0xEA, 0xCB, 0x3D, 0x00, 0xBD, 0x67, 0x01, 0xF9, 0x2C, 0x6D, 0xC6, 0xAC, 0x13, 0x64, - 0xE7, 0x67, 0x14, 0xF3, 0xDC, 0x52, 0x69, 0x6A, 0xB9, 0x83, 0x2C, 0x42, 0x30, 0x13, - 0x1B, 0xB2, 0xD8, 0xA5, 0x02, 0x0D, 0x79, 0xED, 0x96, 0xB1, 0x0D, 0xF8, 0xCC, 0x0C, - 0xDF, 0x81, 0x95, 0x4F, 0x03, 0x58, 0x09, 0x57, 0x0E, 0x80, 0x69, 0x2E, 0xFE, 0xFF, - 0x52, 0x77, 0xEA, 0x75, 0x28, 0xA8, 0xFB, 0xC9, 0xBE, 0xBF, 0x9F, 0xBB, 0xB7, 0x79, - 0x8E, 0x18, 0x05, 0xE1, 0x80, 0xBD, 0x50, 0x34, 0x94, 0x81, 0xD3, 0x53, 0xC2, 0x69, - 0xA2, 0xD2, 0x4C, 0xCF, 0x6C, 0xF4, 0x57, 0x2C, 0x10, 0x4A, 0x3F, 0xFB, 0x22, 0xFD, - 0x8B, 0x97, 0xE2, 0xC9, 0x5B, 0xA6, 0x2B, 0xCD, 0xD6, 0x1B, 0x6B, 0xDB, 0x68, 0x7F, - 0x4B, 0xC2, 0xA0, 0x50, 0x34, 0xC0, 0x05, 0xE5, 0x8D, 0xEF, 0x24, 0x67, 0xFF, 0x93, - 0x40, 0xCF, 0x2D, 0x62, 0xA2, 0xA0, 0x50, 0xB1, 0xF1, 0x3A, 0xA8, 0x3D, 0xFD, 0x80, - 0xD1, 0xF9, 0xB8, 0x05, 0x22, 0xAF, 0xC8, 0x35, 0x45, 0x90, 0x58, 0x8E, 0xE3, 0x3A, - 0x7C, 0xBD, 0x3E, 0x27}; - - Prime1 = new CryptoPP::byte[0x80]{ - 0xFE, 0xF6, 0xBF, 0x1D, 0x69, 0xAB, 0x16, 0x25, 0x08, 0x47, 0x55, 0x6B, 0x86, - 0xE4, 0x35, 0x88, 0x72, 0x2A, 0xB1, 0x3D, 0xF8, 0xB6, 0x44, 0xCA, 0xB3, 0xAB, - 0x19, 0xD1, 0x04, 0x24, 0x28, 0x0A, 0x74, 0x55, 0xB8, 0x15, 0x45, 0x09, 0xCC, - 0x13, 0x1C, 0xF2, 0xBA, 0x37, 0xA9, 0x03, 0x90, 0x8F, 0x02, 0x10, 0xFF, 0x25, - 0x79, 0x86, 0xCC, 0x18, 0x50, 0x9A, 0x10, 0x5F, 0x5B, 0x4C, 0x1C, 0x4E, 0xB0, - 0xA7, 0xE3, 0x59, 0xB1, 0x2D, 0xA0, 0xC6, 0xB0, 0x20, 0x2C, 0x21, 0x33, 0x12, - 0xB3, 0xAF, 0x72, 0x34, 0x83, 0xCD, 0x52, 0x2F, 0xAF, 0x0F, 0x20, 0x5A, 0x1B, - 0xC0, 0xE2, 0xA3, 0x76, 0x34, 0x0F, 0xD7, 0xFC, 0xC1, 0x41, 0xC9, 0xF9, 0x79, - 0x40, 0x17, 0x42, 0x21, 0x3E, 0x9D, 0xFD, 0xC7, 0xC1, 0x50, 0xDE, 0x44, 0x5A, - 0xC9, 0x31, 0x89, 0x6A, 0x78, 0x05, 0xBE, 0x65, 0xB4, 0xE8, 0x2D}; - - Prime2 = new CryptoPP::byte[0x80]{ - 0xC7, 0x9E, 0x47, 0x58, 0x00, 0x7D, 0x62, 0x82, 0xB0, 0xD2, 0x22, 0x81, 0xD4, - 0xA8, 0x97, 0x1B, 0x79, 0x0C, 0x3A, 0xB0, 0xD7, 0xC9, 0x30, 0xE3, 0xC3, 0x53, - 0x8E, 0x57, 0xEF, 0xF0, 0x9B, 0x9F, 0xB3, 0x90, 0x52, 0xC6, 0x94, 0x22, 0x36, - 0xAA, 0xE6, 0x4A, 0x5F, 0x72, 0x1D, 0x70, 0xE8, 0x76, 0x58, 0xC8, 0xB2, 0x91, - 0xCE, 0x9C, 0xC3, 0xE9, 0x09, 0x7F, 0x2E, 0x47, 0x97, 0xCC, 0x90, 0x39, 0x15, - 0x35, 0x31, 0xDE, 0x1F, 0x0C, 0x8C, 0x0D, 0xC1, 0xC2, 0x92, 0xBE, 0x97, 0xBF, - 0x2F, 0x91, 0xA1, 0x8C, 0x7D, 0x50, 0xA8, 0x21, 0x2F, 0xD7, 0xA2, 0x9A, 0x7E, - 0xB5, 0xA7, 0x2A, 0x90, 0x02, 0xD9, 0xF3, 0x3D, 0xD1, 0xEB, 0xB8, 0xE0, 0x5A, - 0x79, 0x9E, 0x7D, 0x8D, 0xCA, 0x18, 0x6D, 0xBD, 0x9E, 0xA1, 0x80, 0x28, 0x6B, - 0x2A, 0xFE, 0x51, 0x24, 0x9B, 0x6F, 0x4D, 0x84, 0x77, 0x80, 0x23}; - }; + static constexpr CryptoPP::byte Prime2[] = { + 0xC7, 0x9E, 0x47, 0x58, 0x00, 0x7D, 0x62, 0x82, 0xB0, 0xD2, 0x22, 0x81, 0xD4, 0xA8, 0x97, + 0x1B, 0x79, 0x0C, 0x3A, 0xB0, 0xD7, 0xC9, 0x30, 0xE3, 0xC3, 0x53, 0x8E, 0x57, 0xEF, 0xF0, + 0x9B, 0x9F, 0xB3, 0x90, 0x52, 0xC6, 0x94, 0x22, 0x36, 0xAA, 0xE6, 0x4A, 0x5F, 0x72, 0x1D, + 0x70, 0xE8, 0x76, 0x58, 0xC8, 0xB2, 0x91, 0xCE, 0x9C, 0xC3, 0xE9, 0x09, 0x7F, 0x2E, 0x47, + 0x97, 0xCC, 0x90, 0x39, 0x15, 0x35, 0x31, 0xDE, 0x1F, 0x0C, 0x8C, 0x0D, 0xC1, 0xC2, 0x92, + 0xBE, 0x97, 0xBF, 0x2F, 0x91, 0xA1, 0x8C, 0x7D, 0x50, 0xA8, 0x21, 0x2F, 0xD7, 0xA2, 0x9A, + 0x7E, 0xB5, 0xA7, 0x2A, 0x90, 0x02, 0xD9, 0xF3, 0x3D, 0xD1, 0xEB, 0xB8, 0xE0, 0x5A, 0x79, + 0x9E, 0x7D, 0x8D, 0xCA, 0x18, 0x6D, 0xBD, 0x9E, 0xA1, 0x80, 0x28, 0x6B, 0x2A, 0xFE, 0x51, + 0x24, 0x9B, 0x6F, 0x4D, 0x84, 0x77, 0x80, 0x23}; + static constexpr CryptoPP::byte PrivateExponent[] = { + 0x7F, 0x76, 0xCD, 0x0E, 0xE2, 0xD4, 0xDE, 0x05, 0x1C, 0xC6, 0xD9, 0xA8, 0x0E, 0x8D, 0xFA, + 0x7B, 0xCA, 0x1E, 0xAA, 0x27, 0x1A, 0x40, 0xF8, 0xF1, 0x22, 0x87, 0x35, 0xDD, 0xDB, 0xFD, + 0xEE, 0xF8, 0xC2, 0xBC, 0xBD, 0x01, 0xFB, 0x8B, 0xE2, 0x3E, 0x63, 0xB2, 0xB1, 0x22, 0x5C, + 0x56, 0x49, 0x6E, 0x11, 0xBE, 0x07, 0x44, 0x0B, 0x9A, 0x26, 0x66, 0xD1, 0x49, 0x2C, 0x8F, + 0xD3, 0x1B, 0xCF, 0xA4, 0xA1, 0xB8, 0xD1, 0xFB, 0xA4, 0x9E, 0xD2, 0x21, 0x28, 0x83, 0x09, + 0x8A, 0xF6, 0xA0, 0x0B, 0xA3, 0xD6, 0x0F, 0x9B, 0x63, 0x68, 0xCC, 0xBC, 0x0C, 0x4E, 0x14, + 0x5B, 0x27, 0xA4, 0xA9, 0xF4, 0x2B, 0xB9, 0xB8, 0x7B, 0xC0, 0xE6, 0x51, 0xAD, 0x1D, 0x77, + 0xD4, 0x6B, 0xB9, 0xCE, 0x20, 0xD1, 0x26, 0x66, 0x7E, 0x5E, 0x9E, 0xA2, 0xE9, 0x6B, 0x90, + 0xF3, 0x73, 0xB8, 0x52, 0x8F, 0x44, 0x11, 0x03, 0x0C, 0x13, 0x97, 0x39, 0x3D, 0x13, 0x22, + 0x58, 0xD5, 0x43, 0x82, 0x49, 0xDA, 0x6E, 0x7C, 0xA1, 0xC5, 0x8C, 0xA5, 0xB0, 0x09, 0xE0, + 0xCE, 0x3D, 0xDF, 0xF4, 0x9D, 0x3C, 0x97, 0x15, 0xE2, 0x6A, 0xC7, 0x2B, 0x3C, 0x50, 0x93, + 0x23, 0xDB, 0xBA, 0x4A, 0x22, 0x66, 0x44, 0xAC, 0x78, 0xBB, 0x0E, 0x1A, 0x27, 0x43, 0xB5, + 0x71, 0x67, 0xAF, 0xF4, 0xAB, 0x48, 0x46, 0x93, 0x73, 0xD0, 0x42, 0xAB, 0x93, 0x63, 0xE5, + 0x6C, 0x9A, 0xDE, 0x50, 0x24, 0xC0, 0x23, 0x7D, 0x99, 0x79, 0x3F, 0x22, 0x07, 0xE0, 0xC1, + 0x48, 0x56, 0x1B, 0xDF, 0x83, 0x09, 0x12, 0xB4, 0x2D, 0x45, 0x6B, 0xC9, 0xC0, 0x68, 0x85, + 0x99, 0x90, 0x79, 0x96, 0x1A, 0xD7, 0xF5, 0x4D, 0x1F, 0x37, 0x83, 0x40, 0x4A, 0xEC, 0x39, + 0x37, 0xA6, 0x80, 0x92, 0x7D, 0xC5, 0x80, 0xC7, 0xD6, 0x6F, 0xFE, 0x8A, 0x79, 0x89, 0xC6, + 0xB1}; }; class DebugRifKeyset { public: - // Constructor // std::uint8_t* PrivateExponent; - const CryptoPP::byte* Exponent1; + static constexpr CryptoPP::byte Exponent1[] = { + 0xCD, 0x9A, 0x61, 0xB0, 0xB8, 0xD5, 0xB4, 0xE4, 0xE4, 0xF6, 0xAB, 0xF7, 0x27, 0xB7, 0x56, + 0x59, 0x6B, 0xB9, 0x11, 0xE7, 0xF4, 0x83, 0xAF, 0xB9, 0x73, 0x99, 0x7F, 0x49, 0xA2, 0x9C, + 0xF0, 0xB5, 0x6D, 0x37, 0x82, 0x14, 0x15, 0xF1, 0x04, 0x8A, 0xD4, 0x8E, 0xEB, 0x2E, 0x1F, + 0xE2, 0x81, 0xA9, 0x62, 0x6E, 0xB1, 0x68, 0x75, 0x62, 0xF3, 0x0F, 0xFE, 0xD4, 0x91, 0x87, + 0x98, 0x78, 0xBF, 0x26, 0xB5, 0x07, 0x58, 0xD0, 0xEE, 0x3F, 0x21, 0xE8, 0xC8, 0x0F, 0x5F, + 0xFA, 0x1C, 0x64, 0x74, 0x49, 0x52, 0xEB, 0xE7, 0xEE, 0xDE, 0xBA, 0x23, 0x26, 0x4A, 0xF6, + 0x9C, 0x1A, 0x09, 0x3F, 0xB9, 0x0B, 0x36, 0x26, 0x1A, 0xBE, 0xA9, 0x76, 0xE6, 0xF2, 0x69, + 0xDE, 0xFF, 0xAF, 0xCC, 0x0C, 0x9A, 0x66, 0x03, 0x86, 0x0A, 0x1F, 0x49, 0xA4, 0x10, 0xB6, + 0xBC, 0xC3, 0x7C, 0x88, 0xE8, 0xCE, 0x4B, 0xD9}; // exponent2 = d mod (q - 1) - const CryptoPP::byte* Exponent2; + static constexpr CryptoPP::byte Exponent2[] = { + 0xB3, 0x73, 0xA3, 0x59, 0xE6, 0x97, 0xC0, 0xAB, 0x3B, 0x68, 0xFC, 0x39, 0xAC, 0xDB, 0x44, + 0xB1, 0xB4, 0x9E, 0x35, 0x4D, 0xBE, 0xC5, 0x36, 0x69, 0x6C, 0x3D, 0xC5, 0xFC, 0xFE, 0x4B, + 0x2F, 0xDC, 0x86, 0x80, 0x46, 0x96, 0x40, 0x1A, 0x0D, 0x6E, 0xFA, 0x8C, 0xE0, 0x47, 0x91, + 0xAC, 0xAD, 0x95, 0x2B, 0x8E, 0x1F, 0xF2, 0x0A, 0x45, 0xF8, 0x29, 0x95, 0x70, 0xC6, 0x88, + 0x5F, 0x71, 0x03, 0x99, 0x79, 0xBC, 0x84, 0x71, 0xBD, 0xE8, 0x84, 0x8C, 0x0E, 0xD4, 0x7B, + 0x30, 0x74, 0x57, 0x1A, 0x95, 0xE7, 0x90, 0x19, 0x8D, 0xAD, 0x8B, 0x4C, 0x4E, 0xC3, 0xE7, + 0x6B, 0x23, 0x86, 0x01, 0xEE, 0x9B, 0xE0, 0x2F, 0x15, 0xA2, 0x2C, 0x4C, 0x39, 0xD3, 0xDF, + 0x9C, 0x39, 0x01, 0xF1, 0x8C, 0x44, 0x4A, 0x15, 0x44, 0xDC, 0x51, 0xF7, 0x22, 0xD7, 0x7F, + 0x41, 0x7F, 0x68, 0xFA, 0xEE, 0x56, 0xE8, 0x05}; // e - const CryptoPP::byte* PublicExponent; + static constexpr CryptoPP::byte PublicExponent[] = {0x00, 0x01, 0x00, 0x01}; // (InverseQ)(q) = 1 mod p - const CryptoPP::byte* Coefficient; + static constexpr CryptoPP::byte Coefficient[] = { + 0xC0, 0x32, 0x43, 0xD3, 0x8C, 0x3D, 0xB4, 0xD2, 0x48, 0x8C, 0x42, 0x41, 0x24, 0x94, 0x6C, + 0x80, 0xC9, 0xC1, 0x79, 0x36, 0x7F, 0xAC, 0xC3, 0xFF, 0x6A, 0x25, 0xEB, 0x2C, 0xFB, 0xD4, + 0x2B, 0xA0, 0xEB, 0xFE, 0x25, 0xE9, 0xC6, 0x77, 0xCE, 0xFE, 0x2D, 0x23, 0xFE, 0xD0, 0xF4, + 0x0F, 0xD9, 0x7E, 0xD5, 0xA5, 0x7D, 0x1F, 0xC0, 0xE8, 0xE8, 0xEC, 0x80, 0x5B, 0xC7, 0xFD, + 0xE2, 0xBD, 0x94, 0xA6, 0x2B, 0xDD, 0x6A, 0x60, 0x45, 0x54, 0xAB, 0xCA, 0x42, 0x9C, 0x6A, + 0x6C, 0xBF, 0x3C, 0x84, 0xF9, 0xA5, 0x0E, 0x63, 0x0C, 0x51, 0x58, 0x62, 0x6D, 0x5A, 0xB7, + 0x3C, 0x3F, 0x49, 0x1A, 0xD0, 0x93, 0xB8, 0x4F, 0x1A, 0x6C, 0x5F, 0xC5, 0xE5, 0xA9, 0x75, + 0xD4, 0x86, 0x9E, 0xDF, 0x87, 0x0F, 0x27, 0xB0, 0x26, 0x78, 0x4E, 0xFB, 0xC1, 0x8A, 0x4A, + 0x24, 0x3F, 0x7F, 0x8F, 0x9A, 0x12, 0x51, 0xCB}; // n = p * q - const CryptoPP::byte* Modulus; + static constexpr CryptoPP::byte Modulus[] = { + 0xC2, 0xD2, 0x44, 0xBC, 0xDD, 0x84, 0x3F, 0xD9, 0xC5, 0x22, 0xAF, 0xF7, 0xFC, 0x88, 0x8A, + 0x33, 0x80, 0xED, 0x8E, 0xE2, 0xCC, 0x81, 0xF7, 0xEC, 0xF8, 0x1C, 0x79, 0xBF, 0x02, 0xBB, + 0x12, 0x8E, 0x61, 0x68, 0x29, 0x1B, 0x15, 0xB6, 0x5E, 0xC6, 0xF8, 0xBF, 0x5A, 0xE0, 0x3B, + 0x6A, 0x6C, 0xD9, 0xD6, 0xF5, 0x75, 0xAB, 0xA0, 0x6F, 0x34, 0x81, 0x34, 0x9A, 0x5B, 0xAD, + 0xED, 0x31, 0xE3, 0xC6, 0xEA, 0x1A, 0xD1, 0x13, 0x22, 0xBB, 0xB3, 0xDA, 0xB3, 0xB2, 0x53, + 0xBD, 0x45, 0x79, 0x87, 0xAD, 0x0A, 0x01, 0x72, 0x18, 0x10, 0x29, 0x49, 0xF4, 0x41, 0x7F, + 0xD6, 0x47, 0x0C, 0x72, 0x92, 0x9E, 0xE9, 0xBB, 0x95, 0xA9, 0x5D, 0x79, 0xEB, 0xE4, 0x30, + 0x76, 0x90, 0x45, 0x4B, 0x9D, 0x9C, 0xCF, 0x92, 0x03, 0x60, 0x8C, 0x4B, 0x6C, 0xB3, 0x7A, + 0x3A, 0x05, 0x39, 0xA0, 0x66, 0xA9, 0x35, 0xCF, 0xB9, 0xFA, 0xAD, 0x9C, 0xAB, 0xEB, 0xE4, + 0x6A, 0x8C, 0xE9, 0x3B, 0xCC, 0x72, 0x12, 0x62, 0x63, 0xBD, 0x80, 0xC4, 0xEE, 0x37, 0x2B, + 0x32, 0x03, 0xA3, 0x09, 0xF7, 0xA0, 0x61, 0x57, 0xAD, 0x0D, 0xCF, 0x15, 0x98, 0x9E, 0x4E, + 0x49, 0xF8, 0xB5, 0xA3, 0x5C, 0x27, 0xEE, 0x45, 0x04, 0xEA, 0xE4, 0x4B, 0xBC, 0x8F, 0x87, + 0xED, 0x19, 0x1E, 0x46, 0x75, 0x63, 0xC4, 0x5B, 0xD5, 0xBC, 0x09, 0x2F, 0x02, 0x73, 0x19, + 0x3C, 0x58, 0x55, 0x49, 0x66, 0x4C, 0x11, 0xEC, 0x0F, 0x09, 0xFA, 0xA5, 0x56, 0x0A, 0x5A, + 0x63, 0x56, 0xAD, 0xA0, 0x0D, 0x86, 0x08, 0xC1, 0xE6, 0xB6, 0x13, 0x22, 0x49, 0x2F, 0x7C, + 0xDB, 0x4C, 0x56, 0x97, 0x0E, 0xC2, 0xD9, 0x2E, 0x87, 0xBC, 0x0E, 0x67, 0xC0, 0x1B, 0x58, + 0xBC, 0x64, 0x2B, 0xC2, 0x6E, 0xE2, 0x93, 0x2E, 0xB5, 0x6B, 0x70, 0xA4, 0x42, 0x9F, 0x64, + 0xC1}; // p - const CryptoPP::byte* Prime1; + static constexpr CryptoPP::byte Prime1[] = { + 0xE5, 0x62, 0xE1, 0x7F, 0x9F, 0x86, 0x08, 0xE2, 0x61, 0xD3, 0xD0, 0x42, 0xE2, 0xC4, 0xB6, + 0xA8, 0x51, 0x09, 0x19, 0x14, 0xA4, 0x3A, 0x11, 0x4C, 0x33, 0xA5, 0x9C, 0x01, 0x5E, 0x34, + 0xB6, 0x3F, 0x02, 0x1A, 0xCA, 0x47, 0xF1, 0x4F, 0x3B, 0x35, 0x2A, 0x07, 0x20, 0xEC, 0xD8, + 0xC1, 0x15, 0xD9, 0xCA, 0x03, 0x4F, 0xB8, 0xE8, 0x09, 0x73, 0x3F, 0x85, 0xB7, 0x41, 0xD5, + 0x51, 0x3E, 0x7B, 0xE3, 0x53, 0x2B, 0x48, 0x8B, 0x8E, 0xCB, 0xBA, 0xF7, 0xE0, 0x60, 0xF5, + 0x35, 0x0E, 0x6F, 0xB0, 0xD9, 0x2A, 0x99, 0xD0, 0xFF, 0x60, 0x14, 0xED, 0x40, 0xEA, 0xF8, + 0xD7, 0x0B, 0xC3, 0x8D, 0x8C, 0xE8, 0x81, 0xB3, 0x75, 0x93, 0x15, 0xB3, 0x7D, 0xF6, 0x39, + 0x60, 0x1A, 0x00, 0xE7, 0xC3, 0x27, 0xAD, 0xA4, 0x33, 0xD5, 0x3E, 0xA4, 0x35, 0x48, 0x6F, + 0x22, 0xEF, 0x5D, 0xDD, 0x7D, 0x7B, 0x61, 0x05}; // q - const CryptoPP::byte* Prime2; - const CryptoPP::byte* PrivateExponent; - - // Constructor - DebugRifKeyset() { - // Initialize PrivateExponent - PrivateExponent = new CryptoPP::byte[0x100]{ - 0x01, 0x61, 0xAD, 0xD8, 0x9C, 0x06, 0x89, 0xD0, 0x60, 0xC8, 0x41, 0xF0, 0xB3, 0x83, - 0x01, 0x5D, 0xE3, 0xA2, 0x6B, 0xA2, 0xBA, 0x9A, 0x0A, 0x58, 0xCD, 0x1A, 0xA0, 0x97, - 0x64, 0xEC, 0xD0, 0x31, 0x1F, 0xCA, 0x36, 0x0E, 0x69, 0xDD, 0x40, 0xF7, 0x4E, 0xC0, - 0xC6, 0xA3, 0x73, 0xF0, 0x69, 0x84, 0xB2, 0xF4, 0x4B, 0x29, 0x14, 0x2A, 0x6D, 0xB8, - 0x23, 0xD8, 0x1B, 0x61, 0xD4, 0x9E, 0x87, 0xB3, 0xBB, 0xA9, 0xC4, 0x85, 0x4A, 0xF8, - 0x03, 0x4A, 0xBF, 0xFE, 0xF9, 0xFE, 0x8B, 0xDD, 0x54, 0x83, 0xBA, 0xE0, 0x2F, 0x3F, - 0xB1, 0xEF, 0xA5, 0x05, 0x5D, 0x28, 0x8B, 0xAB, 0xB5, 0xD0, 0x23, 0x2F, 0x8A, 0xCF, - 0x48, 0x7C, 0xAA, 0xBB, 0xC8, 0x5B, 0x36, 0x27, 0xC5, 0x16, 0xA4, 0xB6, 0x61, 0xAC, - 0x0C, 0x28, 0x47, 0x79, 0x3F, 0x38, 0xAE, 0x5E, 0x25, 0xC6, 0xAF, 0x35, 0xAE, 0xBC, - 0xB0, 0xF3, 0xBC, 0xBD, 0xFD, 0xA4, 0x87, 0x0D, 0x14, 0x3D, 0x90, 0xE4, 0xDE, 0x5D, - 0x1D, 0x46, 0x81, 0xF1, 0x28, 0x6D, 0x2F, 0x2C, 0x5E, 0x97, 0x2D, 0x89, 0x2A, 0x51, - 0x72, 0x3C, 0x20, 0x02, 0x59, 0xB1, 0x98, 0x93, 0x05, 0x1E, 0x3F, 0xA1, 0x8A, 0x69, - 0x30, 0x0E, 0x70, 0x84, 0x8B, 0xAE, 0x97, 0xA1, 0x08, 0x95, 0x63, 0x4C, 0xC7, 0xE8, - 0x5D, 0x59, 0xCA, 0x78, 0x2A, 0x23, 0x87, 0xAC, 0x6F, 0x04, 0x33, 0xB1, 0x61, 0xB9, - 0xF0, 0x95, 0xDA, 0x33, 0xCC, 0xE0, 0x4C, 0x82, 0x68, 0x82, 0x14, 0x51, 0xBE, 0x49, - 0x1C, 0x58, 0xA2, 0x8B, 0x05, 0x4E, 0x98, 0x37, 0xEB, 0x94, 0x0B, 0x01, 0x22, 0xDC, - 0xB3, 0x19, 0xCA, 0x77, 0xA6, 0x6E, 0x97, 0xFF, 0x8A, 0x53, 0x5A, 0xC5, 0x24, 0xE4, - 0xAF, 0x6E, 0xA8, 0x2B, 0x53, 0xA4, 0xBE, 0x96, 0xA5, 0x7B, 0xCE, 0x22, 0x56, 0xA3, - 0xF1, 0xCF, 0x14, 0xA5}; - - // Initialize Exponent1 - Exponent1 = new CryptoPP::byte[0x80]{ - 0xCD, 0x9A, 0x61, 0xB0, 0xB8, 0xD5, 0xB4, 0xE4, 0xE4, 0xF6, 0xAB, 0xF7, 0x27, - 0xB7, 0x56, 0x59, 0x6B, 0xB9, 0x11, 0xE7, 0xF4, 0x83, 0xAF, 0xB9, 0x73, 0x99, - 0x7F, 0x49, 0xA2, 0x9C, 0xF0, 0xB5, 0x6D, 0x37, 0x82, 0x14, 0x15, 0xF1, 0x04, - 0x8A, 0xD4, 0x8E, 0xEB, 0x2E, 0x1F, 0xE2, 0x81, 0xA9, 0x62, 0x6E, 0xB1, 0x68, - 0x75, 0x62, 0xF3, 0x0F, 0xFE, 0xD4, 0x91, 0x87, 0x98, 0x78, 0xBF, 0x26, 0xB5, - 0x07, 0x58, 0xD0, 0xEE, 0x3F, 0x21, 0xE8, 0xC8, 0x0F, 0x5F, 0xFA, 0x1C, 0x64, - 0x74, 0x49, 0x52, 0xEB, 0xE7, 0xEE, 0xDE, 0xBA, 0x23, 0x26, 0x4A, 0xF6, 0x9C, - 0x1A, 0x09, 0x3F, 0xB9, 0x0B, 0x36, 0x26, 0x1A, 0xBE, 0xA9, 0x76, 0xE6, 0xF2, - 0x69, 0xDE, 0xFF, 0xAF, 0xCC, 0x0C, 0x9A, 0x66, 0x03, 0x86, 0x0A, 0x1F, 0x49, - 0xA4, 0x10, 0xB6, 0xBC, 0xC3, 0x7C, 0x88, 0xE8, 0xCE, 0x4B, 0xD9 - - }; - - Exponent2 = new CryptoPP::byte[0x80]{ - 0xB3, 0x73, 0xA3, 0x59, 0xE6, 0x97, 0xC0, 0xAB, 0x3B, 0x68, 0xFC, 0x39, 0xAC, - 0xDB, 0x44, 0xB1, 0xB4, 0x9E, 0x35, 0x4D, 0xBE, 0xC5, 0x36, 0x69, 0x6C, 0x3D, - 0xC5, 0xFC, 0xFE, 0x4B, 0x2F, 0xDC, 0x86, 0x80, 0x46, 0x96, 0x40, 0x1A, 0x0D, - 0x6E, 0xFA, 0x8C, 0xE0, 0x47, 0x91, 0xAC, 0xAD, 0x95, 0x2B, 0x8E, 0x1F, 0xF2, - 0x0A, 0x45, 0xF8, 0x29, 0x95, 0x70, 0xC6, 0x88, 0x5F, 0x71, 0x03, 0x99, 0x79, - 0xBC, 0x84, 0x71, 0xBD, 0xE8, 0x84, 0x8C, 0x0E, 0xD4, 0x7B, 0x30, 0x74, 0x57, - 0x1A, 0x95, 0xE7, 0x90, 0x19, 0x8D, 0xAD, 0x8B, 0x4C, 0x4E, 0xC3, 0xE7, 0x6B, - 0x23, 0x86, 0x01, 0xEE, 0x9B, 0xE0, 0x2F, 0x15, 0xA2, 0x2C, 0x4C, 0x39, 0xD3, - 0xDF, 0x9C, 0x39, 0x01, 0xF1, 0x8C, 0x44, 0x4A, 0x15, 0x44, 0xDC, 0x51, 0xF7, - 0x22, 0xD7, 0x7F, 0x41, 0x7F, 0x68, 0xFA, 0xEE, 0x56, 0xE8, 0x05}; - - PublicExponent = new CryptoPP::byte[4]{0x00, 0x01, 0x00, 0x01}; - - Coefficient = new CryptoPP::byte[0x80]{ - 0xC0, 0x32, 0x43, 0xD3, 0x8C, 0x3D, 0xB4, 0xD2, 0x48, 0x8C, 0x42, 0x41, 0x24, - 0x94, 0x6C, 0x80, 0xC9, 0xC1, 0x79, 0x36, 0x7F, 0xAC, 0xC3, 0xFF, 0x6A, 0x25, - 0xEB, 0x2C, 0xFB, 0xD4, 0x2B, 0xA0, 0xEB, 0xFE, 0x25, 0xE9, 0xC6, 0x77, 0xCE, - 0xFE, 0x2D, 0x23, 0xFE, 0xD0, 0xF4, 0x0F, 0xD9, 0x7E, 0xD5, 0xA5, 0x7D, 0x1F, - 0xC0, 0xE8, 0xE8, 0xEC, 0x80, 0x5B, 0xC7, 0xFD, 0xE2, 0xBD, 0x94, 0xA6, 0x2B, - 0xDD, 0x6A, 0x60, 0x45, 0x54, 0xAB, 0xCA, 0x42, 0x9C, 0x6A, 0x6C, 0xBF, 0x3C, - 0x84, 0xF9, 0xA5, 0x0E, 0x63, 0x0C, 0x51, 0x58, 0x62, 0x6D, 0x5A, 0xB7, 0x3C, - 0x3F, 0x49, 0x1A, 0xD0, 0x93, 0xB8, 0x4F, 0x1A, 0x6C, 0x5F, 0xC5, 0xE5, 0xA9, - 0x75, 0xD4, 0x86, 0x9E, 0xDF, 0x87, 0x0F, 0x27, 0xB0, 0x26, 0x78, 0x4E, 0xFB, - 0xC1, 0x8A, 0x4A, 0x24, 0x3F, 0x7F, 0x8F, 0x9A, 0x12, 0x51, 0xCB}; - - Modulus = new CryptoPP::byte[0x100]{ - 0xC2, 0xD2, 0x44, 0xBC, 0xDD, 0x84, 0x3F, 0xD9, 0xC5, 0x22, 0xAF, 0xF7, 0xFC, 0x88, - 0x8A, 0x33, 0x80, 0xED, 0x8E, 0xE2, 0xCC, 0x81, 0xF7, 0xEC, 0xF8, 0x1C, 0x79, 0xBF, - 0x02, 0xBB, 0x12, 0x8E, 0x61, 0x68, 0x29, 0x1B, 0x15, 0xB6, 0x5E, 0xC6, 0xF8, 0xBF, - 0x5A, 0xE0, 0x3B, 0x6A, 0x6C, 0xD9, 0xD6, 0xF5, 0x75, 0xAB, 0xA0, 0x6F, 0x34, 0x81, - 0x34, 0x9A, 0x5B, 0xAD, 0xED, 0x31, 0xE3, 0xC6, 0xEA, 0x1A, 0xD1, 0x13, 0x22, 0xBB, - 0xB3, 0xDA, 0xB3, 0xB2, 0x53, 0xBD, 0x45, 0x79, 0x87, 0xAD, 0x0A, 0x01, 0x72, 0x18, - 0x10, 0x29, 0x49, 0xF4, 0x41, 0x7F, 0xD6, 0x47, 0x0C, 0x72, 0x92, 0x9E, 0xE9, 0xBB, - 0x95, 0xA9, 0x5D, 0x79, 0xEB, 0xE4, 0x30, 0x76, 0x90, 0x45, 0x4B, 0x9D, 0x9C, 0xCF, - 0x92, 0x03, 0x60, 0x8C, 0x4B, 0x6C, 0xB3, 0x7A, 0x3A, 0x05, 0x39, 0xA0, 0x66, 0xA9, - 0x35, 0xCF, 0xB9, 0xFA, 0xAD, 0x9C, 0xAB, 0xEB, 0xE4, 0x6A, 0x8C, 0xE9, 0x3B, 0xCC, - 0x72, 0x12, 0x62, 0x63, 0xBD, 0x80, 0xC4, 0xEE, 0x37, 0x2B, 0x32, 0x03, 0xA3, 0x09, - 0xF7, 0xA0, 0x61, 0x57, 0xAD, 0x0D, 0xCF, 0x15, 0x98, 0x9E, 0x4E, 0x49, 0xF8, 0xB5, - 0xA3, 0x5C, 0x27, 0xEE, 0x45, 0x04, 0xEA, 0xE4, 0x4B, 0xBC, 0x8F, 0x87, 0xED, 0x19, - 0x1E, 0x46, 0x75, 0x63, 0xC4, 0x5B, 0xD5, 0xBC, 0x09, 0x2F, 0x02, 0x73, 0x19, 0x3C, - 0x58, 0x55, 0x49, 0x66, 0x4C, 0x11, 0xEC, 0x0F, 0x09, 0xFA, 0xA5, 0x56, 0x0A, 0x5A, - 0x63, 0x56, 0xAD, 0xA0, 0x0D, 0x86, 0x08, 0xC1, 0xE6, 0xB6, 0x13, 0x22, 0x49, 0x2F, - 0x7C, 0xDB, 0x4C, 0x56, 0x97, 0x0E, 0xC2, 0xD9, 0x2E, 0x87, 0xBC, 0x0E, 0x67, 0xC0, - 0x1B, 0x58, 0xBC, 0x64, 0x2B, 0xC2, 0x6E, 0xE2, 0x93, 0x2E, 0xB5, 0x6B, 0x70, 0xA4, - 0x42, 0x9F, 0x64, 0xC1}; - - Prime1 = new CryptoPP::byte[0x80]{ - 0xE5, 0x62, 0xE1, 0x7F, 0x9F, 0x86, 0x08, 0xE2, 0x61, 0xD3, 0xD0, 0x42, 0xE2, - 0xC4, 0xB6, 0xA8, 0x51, 0x09, 0x19, 0x14, 0xA4, 0x3A, 0x11, 0x4C, 0x33, 0xA5, - 0x9C, 0x01, 0x5E, 0x34, 0xB6, 0x3F, 0x02, 0x1A, 0xCA, 0x47, 0xF1, 0x4F, 0x3B, - 0x35, 0x2A, 0x07, 0x20, 0xEC, 0xD8, 0xC1, 0x15, 0xD9, 0xCA, 0x03, 0x4F, 0xB8, - 0xE8, 0x09, 0x73, 0x3F, 0x85, 0xB7, 0x41, 0xD5, 0x51, 0x3E, 0x7B, 0xE3, 0x53, - 0x2B, 0x48, 0x8B, 0x8E, 0xCB, 0xBA, 0xF7, 0xE0, 0x60, 0xF5, 0x35, 0x0E, 0x6F, - 0xB0, 0xD9, 0x2A, 0x99, 0xD0, 0xFF, 0x60, 0x14, 0xED, 0x40, 0xEA, 0xF8, 0xD7, - 0x0B, 0xC3, 0x8D, 0x8C, 0xE8, 0x81, 0xB3, 0x75, 0x93, 0x15, 0xB3, 0x7D, 0xF6, - 0x39, 0x60, 0x1A, 0x00, 0xE7, 0xC3, 0x27, 0xAD, 0xA4, 0x33, 0xD5, 0x3E, 0xA4, - 0x35, 0x48, 0x6F, 0x22, 0xEF, 0x5D, 0xDD, 0x7D, 0x7B, 0x61, 0x05}; - - Prime2 = new CryptoPP::byte[0x80]{ - 0xD9, 0x6C, 0xC2, 0x0C, 0xF7, 0xAE, 0xD1, 0xF3, 0x3B, 0x3B, 0x49, 0x1E, 0x9F, - 0x12, 0x9C, 0xA1, 0x78, 0x1F, 0x35, 0x1D, 0x98, 0x26, 0x13, 0x71, 0xF9, 0x09, - 0xFD, 0xF0, 0xAD, 0x38, 0x55, 0xB7, 0xEE, 0x61, 0x04, 0x72, 0x51, 0x87, 0x2E, - 0x05, 0x84, 0xB1, 0x1D, 0x0C, 0x0D, 0xDB, 0xD4, 0x25, 0x3E, 0x26, 0xED, 0xEA, - 0xB8, 0xF7, 0x49, 0xFE, 0xA2, 0x94, 0xE6, 0xF2, 0x08, 0x92, 0xA7, 0x85, 0xF5, - 0x30, 0xB9, 0x84, 0x22, 0xBF, 0xCA, 0xF0, 0x5F, 0xCB, 0x31, 0x20, 0x34, 0x49, - 0x16, 0x76, 0x34, 0xCC, 0x7A, 0xCB, 0x96, 0xFE, 0x78, 0x7A, 0x41, 0xFE, 0x9A, - 0xA2, 0x23, 0xF7, 0x68, 0x80, 0xD6, 0xCE, 0x4A, 0x78, 0xA5, 0xB7, 0x05, 0x77, - 0x81, 0x1F, 0xDE, 0x5E, 0xA8, 0x6E, 0x3E, 0x87, 0xEC, 0x44, 0xD2, 0x69, 0xC6, - 0x54, 0x91, 0x6B, 0x5E, 0x13, 0x8A, 0x03, 0x87, 0x05, 0x31, 0x8D}; - }; + static constexpr CryptoPP::byte Prime2[] = { + 0xD9, 0x6C, 0xC2, 0x0C, 0xF7, 0xAE, 0xD1, 0xF3, 0x3B, 0x3B, 0x49, 0x1E, 0x9F, 0x12, 0x9C, + 0xA1, 0x78, 0x1F, 0x35, 0x1D, 0x98, 0x26, 0x13, 0x71, 0xF9, 0x09, 0xFD, 0xF0, 0xAD, 0x38, + 0x55, 0xB7, 0xEE, 0x61, 0x04, 0x72, 0x51, 0x87, 0x2E, 0x05, 0x84, 0xB1, 0x1D, 0x0C, 0x0D, + 0xDB, 0xD4, 0x25, 0x3E, 0x26, 0xED, 0xEA, 0xB8, 0xF7, 0x49, 0xFE, 0xA2, 0x94, 0xE6, 0xF2, + 0x08, 0x92, 0xA7, 0x85, 0xF5, 0x30, 0xB9, 0x84, 0x22, 0xBF, 0xCA, 0xF0, 0x5F, 0xCB, 0x31, + 0x20, 0x34, 0x49, 0x16, 0x76, 0x34, 0xCC, 0x7A, 0xCB, 0x96, 0xFE, 0x78, 0x7A, 0x41, 0xFE, + 0x9A, 0xA2, 0x23, 0xF7, 0x68, 0x80, 0xD6, 0xCE, 0x4A, 0x78, 0xA5, 0xB7, 0x05, 0x77, 0x81, + 0x1F, 0xDE, 0x5E, 0xA8, 0x6E, 0x3E, 0x87, 0xEC, 0x44, 0xD2, 0x69, 0xC6, 0x54, 0x91, 0x6B, + 0x5E, 0x13, 0x8A, 0x03, 0x87, 0x05, 0x31, 0x8D}; + static constexpr CryptoPP::byte PrivateExponent[] = { + 0x01, 0x61, 0xAD, 0xD8, 0x9C, 0x06, 0x89, 0xD0, 0x60, 0xC8, 0x41, 0xF0, 0xB3, 0x83, 0x01, + 0x5D, 0xE3, 0xA2, 0x6B, 0xA2, 0xBA, 0x9A, 0x0A, 0x58, 0xCD, 0x1A, 0xA0, 0x97, 0x64, 0xEC, + 0xD0, 0x31, 0x1F, 0xCA, 0x36, 0x0E, 0x69, 0xDD, 0x40, 0xF7, 0x4E, 0xC0, 0xC6, 0xA3, 0x73, + 0xF0, 0x69, 0x84, 0xB2, 0xF4, 0x4B, 0x29, 0x14, 0x2A, 0x6D, 0xB8, 0x23, 0xD8, 0x1B, 0x61, + 0xD4, 0x9E, 0x87, 0xB3, 0xBB, 0xA9, 0xC4, 0x85, 0x4A, 0xF8, 0x03, 0x4A, 0xBF, 0xFE, 0xF9, + 0xFE, 0x8B, 0xDD, 0x54, 0x83, 0xBA, 0xE0, 0x2F, 0x3F, 0xB1, 0xEF, 0xA5, 0x05, 0x5D, 0x28, + 0x8B, 0xAB, 0xB5, 0xD0, 0x23, 0x2F, 0x8A, 0xCF, 0x48, 0x7C, 0xAA, 0xBB, 0xC8, 0x5B, 0x36, + 0x27, 0xC5, 0x16, 0xA4, 0xB6, 0x61, 0xAC, 0x0C, 0x28, 0x47, 0x79, 0x3F, 0x38, 0xAE, 0x5E, + 0x25, 0xC6, 0xAF, 0x35, 0xAE, 0xBC, 0xB0, 0xF3, 0xBC, 0xBD, 0xFD, 0xA4, 0x87, 0x0D, 0x14, + 0x3D, 0x90, 0xE4, 0xDE, 0x5D, 0x1D, 0x46, 0x81, 0xF1, 0x28, 0x6D, 0x2F, 0x2C, 0x5E, 0x97, + 0x2D, 0x89, 0x2A, 0x51, 0x72, 0x3C, 0x20, 0x02, 0x59, 0xB1, 0x98, 0x93, 0x05, 0x1E, 0x3F, + 0xA1, 0x8A, 0x69, 0x30, 0x0E, 0x70, 0x84, 0x8B, 0xAE, 0x97, 0xA1, 0x08, 0x95, 0x63, 0x4C, + 0xC7, 0xE8, 0x5D, 0x59, 0xCA, 0x78, 0x2A, 0x23, 0x87, 0xAC, 0x6F, 0x04, 0x33, 0xB1, 0x61, + 0xB9, 0xF0, 0x95, 0xDA, 0x33, 0xCC, 0xE0, 0x4C, 0x82, 0x68, 0x82, 0x14, 0x51, 0xBE, 0x49, + 0x1C, 0x58, 0xA2, 0x8B, 0x05, 0x4E, 0x98, 0x37, 0xEB, 0x94, 0x0B, 0x01, 0x22, 0xDC, 0xB3, + 0x19, 0xCA, 0x77, 0xA6, 0x6E, 0x97, 0xFF, 0x8A, 0x53, 0x5A, 0xC5, 0x24, 0xE4, 0xAF, 0x6E, + 0xA8, 0x2B, 0x53, 0xA4, 0xBE, 0x96, 0xA5, 0x7B, 0xCE, 0x22, 0x56, 0xA3, 0xF1, 0xCF, 0x14, + 0xA5}; }; class PkgDerivedKey3Keyset { public: - // PkgDerivedKey3Keyset(); - //~PkgDerivedKey3Keyset(); - - // Constructor // std::uint8_t* PrivateExponent; - const CryptoPP::byte* Exponent1; + static constexpr CryptoPP::byte Exponent1[] = { + 0x52, 0xCC, 0x2D, 0xA0, 0x9C, 0x9E, 0x75, 0xE7, 0x28, 0xEE, 0x3D, 0xDE, 0xE3, 0x45, 0xD1, + 0x4F, 0x94, 0x1C, 0xCC, 0xC8, 0x87, 0x29, 0x45, 0x3B, 0x8D, 0x6E, 0xAB, 0x6E, 0x2A, 0xA7, + 0xC7, 0x15, 0x43, 0xA3, 0x04, 0x8F, 0x90, 0x5F, 0xEB, 0xF3, 0x38, 0x4A, 0x77, 0xFA, 0x36, + 0xB7, 0x15, 0x76, 0xB6, 0x01, 0x1A, 0x8E, 0x25, 0x87, 0x82, 0xF1, 0x55, 0xD8, 0xC6, 0x43, + 0x2A, 0xC0, 0xE5, 0x98, 0xC9, 0x32, 0xD1, 0x94, 0x6F, 0xD9, 0x01, 0xBA, 0x06, 0x81, 0xE0, + 0x6D, 0x88, 0xF2, 0x24, 0x2A, 0x25, 0x01, 0x64, 0x5C, 0xBF, 0xF2, 0xD9, 0x99, 0x67, 0x3E, + 0xF6, 0x72, 0xEE, 0xE4, 0xE2, 0x33, 0x5C, 0xF8, 0x00, 0x40, 0xE3, 0x2A, 0x9A, 0xF4, 0x3D, + 0x22, 0x86, 0x44, 0x3C, 0xFB, 0x0A, 0xA5, 0x7C, 0x3F, 0xCC, 0xF5, 0xF1, 0x16, 0xC4, 0xAC, + 0x88, 0xB4, 0xDE, 0x62, 0x94, 0x92, 0x6A, 0x13}; // exponent2 = d mod (q - 1) - const CryptoPP::byte* Exponent2; + static constexpr CryptoPP::byte Exponent2[] = { + 0x7C, 0x9D, 0xAD, 0x39, 0xE0, 0xD5, 0x60, 0x14, 0x94, 0x48, 0x19, 0x7F, 0x88, 0x95, 0xD5, + 0x8B, 0x80, 0xAD, 0x85, 0x8A, 0x4B, 0x77, 0x37, 0x85, 0xD0, 0x77, 0xBB, 0xBF, 0x89, 0x71, + 0x4A, 0x72, 0xCB, 0x72, 0x68, 0x38, 0xEC, 0x02, 0xC6, 0x7D, 0xC6, 0x44, 0x06, 0x33, 0x51, + 0x1C, 0xC0, 0xFF, 0x95, 0x8F, 0x0D, 0x75, 0xDC, 0x25, 0xBB, 0x0B, 0x73, 0x91, 0xA9, 0x6D, + 0x42, 0xD8, 0x03, 0xB7, 0x68, 0xD4, 0x1E, 0x75, 0x62, 0xA3, 0x70, 0x35, 0x79, 0x78, 0x00, + 0xC8, 0xF5, 0xEF, 0x15, 0xB9, 0xFC, 0x4E, 0x47, 0x5A, 0xC8, 0x70, 0x70, 0x5B, 0x52, 0x98, + 0xC0, 0xC2, 0x58, 0x4A, 0x70, 0x96, 0xCC, 0xB8, 0x10, 0xE1, 0x2F, 0x78, 0x8B, 0x2B, 0xA1, + 0x7F, 0xF9, 0xAC, 0xDE, 0xF0, 0xBB, 0x2B, 0xE2, 0x66, 0xE3, 0x22, 0x92, 0x31, 0x21, 0x57, + 0x92, 0xC4, 0xB8, 0xF2, 0x3E, 0x76, 0x20, 0x37}; // e - const CryptoPP::byte* PublicExponent; + static constexpr CryptoPP::byte PublicExponent[] = {0, 1, 0, 1}; // (InverseQ)(q) = 1 mod p - const CryptoPP::byte* Coefficient; + static constexpr CryptoPP::byte Coefficient[] = { + 0x45, 0x97, 0x55, 0xD4, 0x22, 0x08, 0x5E, 0xF3, 0x5C, 0xB4, 0x05, 0x7A, 0xFD, 0xAA, 0x42, + 0x42, 0xAD, 0x9A, 0x8C, 0xA0, 0x6C, 0xBB, 0x1D, 0x68, 0x54, 0x54, 0x6E, 0x3E, 0x32, 0xE3, + 0x53, 0x73, 0x76, 0xF1, 0x3E, 0x01, 0xEA, 0xD3, 0xCF, 0xEB, 0xEB, 0x23, 0x3E, 0xC0, 0xBE, + 0xCE, 0xEC, 0x2C, 0x89, 0x5F, 0xA8, 0x27, 0x3A, 0x4C, 0xB7, 0xE6, 0x74, 0xBC, 0x45, 0x4C, + 0x26, 0xC8, 0x25, 0xFF, 0x34, 0x63, 0x25, 0x37, 0xE1, 0x48, 0x10, 0xC1, 0x93, 0xA6, 0xAF, + 0xEB, 0xBA, 0xE3, 0xA2, 0xF1, 0x3D, 0xEF, 0x63, 0xD8, 0xF4, 0xFD, 0xD3, 0xEE, 0xE2, 0x5D, + 0xE9, 0x33, 0xCC, 0xAD, 0xBA, 0x75, 0x5C, 0x85, 0xAF, 0xCE, 0xA9, 0x3D, 0xD1, 0xA2, 0x17, + 0xF3, 0xF6, 0x98, 0xB3, 0x50, 0x8E, 0x5E, 0xF6, 0xEB, 0x02, 0x8E, 0xA1, 0x62, 0xA7, 0xD6, + 0x2C, 0xEC, 0x91, 0xFF, 0x15, 0x40, 0xD2, 0xE3}; // n = p * q - const CryptoPP::byte* Modulus; + static constexpr CryptoPP::byte Modulus[] = { + 0xd2, 0x12, 0xfc, 0x33, 0x5f, 0x6d, 0xdb, 0x83, 0x16, 0x09, 0x62, 0x8b, 0x03, 0x56, 0x27, + 0x37, 0x82, 0xd4, 0x77, 0x85, 0x35, 0x29, 0x39, 0x2d, 0x52, 0x6b, 0x8c, 0x4c, 0x8c, 0xfb, + 0x06, 0xc1, 0x84, 0x5b, 0xe7, 0xd4, 0xf7, 0xbc, 0xd2, 0x4e, 0x62, 0x45, 0xcd, 0x2a, 0xbb, + 0xd7, 0x77, 0x76, 0x45, 0x36, 0x55, 0x27, 0x3f, 0xb3, 0xf5, 0xf9, 0x8e, 0xda, 0x4b, 0xef, + 0xaa, 0x59, 0xae, 0xb3, 0x9b, 0xea, 0x54, 0x98, 0xd2, 0x06, 0x32, 0x6a, 0x58, 0x31, 0x2a, + 0xe0, 0xd4, 0x4f, 0x90, 0xb5, 0x0a, 0x7d, 0xec, 0xf4, 0x3a, 0x9c, 0x52, 0x67, 0x2d, 0x99, + 0x31, 0x8e, 0x0c, 0x43, 0xe6, 0x82, 0xfe, 0x07, 0x46, 0xe1, 0x2e, 0x50, 0xd4, 0x1f, 0x2d, + 0x2f, 0x7e, 0xd9, 0x08, 0xba, 0x06, 0xb3, 0xbf, 0x2e, 0x20, 0x3f, 0x4e, 0x3f, 0xfe, 0x44, + 0xff, 0xaa, 0x50, 0x43, 0x57, 0x91, 0x69, 0x94, 0x49, 0x15, 0x82, 0x82, 0xe4, 0x0f, 0x4c, + 0x8d, 0x9d, 0x2c, 0xc9, 0x5b, 0x1d, 0x64, 0xbf, 0x88, 0x8b, 0xd4, 0xc5, 0x94, 0xe7, 0x65, + 0x47, 0x84, 0x1e, 0xe5, 0x79, 0x10, 0xfb, 0x98, 0x93, 0x47, 0xb9, 0x7d, 0x85, 0x12, 0xa6, + 0x40, 0x98, 0x2c, 0xf7, 0x92, 0xbc, 0x95, 0x19, 0x32, 0xed, 0xe8, 0x90, 0x56, 0x0d, 0x65, + 0xc1, 0xaa, 0x78, 0xc6, 0x2e, 0x54, 0xfd, 0x5f, 0x54, 0xa1, 0xf6, 0x7e, 0xe5, 0xe0, 0x5f, + 0x61, 0xc1, 0x20, 0xb4, 0xb9, 0xb4, 0x33, 0x08, 0x70, 0xe4, 0xdf, 0x89, 0x56, 0xed, 0x01, + 0x29, 0x46, 0x77, 0x5f, 0x8c, 0xb8, 0xa9, 0xf5, 0x1e, 0x2e, 0xb3, 0xb9, 0xbf, 0xe0, 0x09, + 0xb7, 0x8d, 0x28, 0xd4, 0xa6, 0xc3, 0xb8, 0x1e, 0x1f, 0x07, 0xeb, 0xb4, 0x12, 0x0b, 0x95, + 0xb8, 0x85, 0x30, 0xfd, 0xdc, 0x39, 0x13, 0xd0, 0x7c, 0xdc, 0x8f, 0xed, 0xf9, 0xc9, 0xa3, + 0xc1}; // p - const CryptoPP::byte* Prime1; + static constexpr CryptoPP::byte Prime1[] = { + 0xF9, 0x67, 0xAD, 0x99, 0x12, 0x31, 0x0C, 0x56, 0xA2, 0x2E, 0x16, 0x1C, 0x46, 0xB3, 0x4D, + 0x5B, 0x43, 0xBE, 0x42, 0xA2, 0xF6, 0x86, 0x96, 0x80, 0x42, 0xC3, 0xC7, 0x3F, 0xC3, 0x42, + 0xF5, 0x87, 0x49, 0x33, 0x9F, 0x07, 0x5D, 0x6E, 0x2C, 0x04, 0xFD, 0xE3, 0xE1, 0xB2, 0xAE, + 0x0A, 0x0C, 0xF0, 0xC7, 0xA6, 0x1C, 0xA1, 0x63, 0x50, 0xC8, 0x09, 0x9C, 0x51, 0x24, 0x52, + 0x6C, 0x5E, 0x5E, 0xBD, 0x1E, 0x27, 0x06, 0xBB, 0xBC, 0x9E, 0x94, 0xE1, 0x35, 0xD4, 0x6D, + 0xB3, 0xCB, 0x3C, 0x68, 0xDD, 0x68, 0xB3, 0xFE, 0x6C, 0xCB, 0x8D, 0x82, 0x20, 0x76, 0x23, + 0x63, 0xB7, 0xE9, 0x68, 0x10, 0x01, 0x4E, 0xDC, 0xBA, 0x27, 0x5D, 0x01, 0xC1, 0x2D, 0x80, + 0x5E, 0x2B, 0xAF, 0x82, 0x6B, 0xD8, 0x84, 0xB6, 0x10, 0x52, 0x86, 0xA7, 0x89, 0x8E, 0xAE, + 0x9A, 0xE2, 0x89, 0xC6, 0xF7, 0xD5, 0x87, 0xFB}; // q - const CryptoPP::byte* Prime2; - const CryptoPP::byte* PrivateExponent; - - PkgDerivedKey3Keyset() { - - Prime1 = new CryptoPP::byte[0x80]{ - 0xF9, 0x67, 0xAD, 0x99, 0x12, 0x31, 0x0C, 0x56, 0xA2, 0x2E, 0x16, 0x1C, 0x46, - 0xB3, 0x4D, 0x5B, 0x43, 0xBE, 0x42, 0xA2, 0xF6, 0x86, 0x96, 0x80, 0x42, 0xC3, - 0xC7, 0x3F, 0xC3, 0x42, 0xF5, 0x87, 0x49, 0x33, 0x9F, 0x07, 0x5D, 0x6E, 0x2C, - 0x04, 0xFD, 0xE3, 0xE1, 0xB2, 0xAE, 0x0A, 0x0C, 0xF0, 0xC7, 0xA6, 0x1C, 0xA1, - 0x63, 0x50, 0xC8, 0x09, 0x9C, 0x51, 0x24, 0x52, 0x6C, 0x5E, 0x5E, 0xBD, 0x1E, - 0x27, 0x06, 0xBB, 0xBC, 0x9E, 0x94, 0xE1, 0x35, 0xD4, 0x6D, 0xB3, 0xCB, 0x3C, - 0x68, 0xDD, 0x68, 0xB3, 0xFE, 0x6C, 0xCB, 0x8D, 0x82, 0x20, 0x76, 0x23, 0x63, - 0xB7, 0xE9, 0x68, 0x10, 0x01, 0x4E, 0xDC, 0xBA, 0x27, 0x5D, 0x01, 0xC1, 0x2D, - 0x80, 0x5E, 0x2B, 0xAF, 0x82, 0x6B, 0xD8, 0x84, 0xB6, 0x10, 0x52, 0x86, 0xA7, - 0x89, 0x8E, 0xAE, 0x9A, 0xE2, 0x89, 0xC6, 0xF7, 0xD5, 0x87, 0xFB}; - - Prime2 = new CryptoPP::byte[0x80]{ - 0xD7, 0xA1, 0x0F, 0x9A, 0x8B, 0xF2, 0xC9, 0x11, 0x95, 0x32, 0x9A, 0x8C, 0xF0, - 0xD9, 0x40, 0x47, 0xF5, 0x68, 0xA0, 0x0D, 0xBD, 0xC1, 0xFC, 0x43, 0x2F, 0x65, - 0xF9, 0xC3, 0x61, 0x0F, 0x25, 0x77, 0x54, 0xAD, 0xD7, 0x58, 0xAC, 0x84, 0x40, - 0x60, 0x8D, 0x3F, 0xF3, 0x65, 0x89, 0x75, 0xB5, 0xC6, 0x2C, 0x51, 0x1A, 0x2F, - 0x1F, 0x22, 0xE4, 0x43, 0x11, 0x54, 0xBE, 0xC9, 0xB4, 0xC7, 0xB5, 0x1B, 0x05, - 0x0B, 0xBC, 0x56, 0x9A, 0xCD, 0x4A, 0xD9, 0x73, 0x68, 0x5E, 0x5C, 0xFB, 0x92, - 0xB7, 0x8B, 0x0D, 0xFF, 0xF5, 0x07, 0xCA, 0xB4, 0xC8, 0x9B, 0x96, 0x3C, 0x07, - 0x9E, 0x3E, 0x6B, 0x2A, 0x11, 0xF2, 0x8A, 0xB1, 0x8A, 0xD7, 0x2E, 0x1B, 0xA5, - 0x53, 0x24, 0x06, 0xED, 0x50, 0xB8, 0x90, 0x67, 0xB1, 0xE2, 0x41, 0xC6, 0x92, - 0x01, 0xEE, 0x10, 0xF0, 0x61, 0xBB, 0xFB, 0xB2, 0x7D, 0x4A, 0x73}; - PrivateExponent = new CryptoPP::byte[0x100]{ - 0x32, 0xD9, 0x03, 0x90, 0x8F, 0xBD, 0xB0, 0x8F, 0x57, 0x2B, 0x28, 0x5E, 0x0B, 0x8D, - 0xB3, 0xEA, 0x5C, 0xD1, 0x7E, 0xA8, 0x90, 0x88, 0x8C, 0xDD, 0x6A, 0x80, 0xBB, 0xB1, - 0xDF, 0xC1, 0xF7, 0x0D, 0xAA, 0x32, 0xF0, 0xB7, 0x7C, 0xCB, 0x88, 0x80, 0x0E, 0x8B, - 0x64, 0xB0, 0xBE, 0x4C, 0xD6, 0x0E, 0x9B, 0x8C, 0x1E, 0x2A, 0x64, 0xE1, 0xF3, 0x5C, - 0xD7, 0x76, 0x01, 0x41, 0x5E, 0x93, 0x5C, 0x94, 0xFE, 0xDD, 0x46, 0x62, 0xC3, 0x1B, - 0x5A, 0xE2, 0xA0, 0xBC, 0x2D, 0xEB, 0xC3, 0x98, 0x0A, 0xA7, 0xB7, 0x85, 0x69, 0x70, - 0x68, 0x2B, 0x64, 0x4A, 0xB3, 0x1F, 0xCC, 0x7D, 0xDC, 0x7C, 0x26, 0xF4, 0x77, 0xF6, - 0x5C, 0xF2, 0xAE, 0x5A, 0x44, 0x2D, 0xD3, 0xAB, 0x16, 0x62, 0x04, 0x19, 0xBA, 0xFB, - 0x90, 0xFF, 0xE2, 0x30, 0x50, 0x89, 0x6E, 0xCB, 0x56, 0xB2, 0xEB, 0xC0, 0x91, 0x16, - 0x92, 0x5E, 0x30, 0x8E, 0xAE, 0xC7, 0x94, 0x5D, 0xFD, 0x35, 0xE1, 0x20, 0xF8, 0xAD, - 0x3E, 0xBC, 0x08, 0xBF, 0xC0, 0x36, 0x74, 0x9F, 0xD5, 0xBB, 0x52, 0x08, 0xFD, 0x06, - 0x66, 0xF3, 0x7A, 0xB3, 0x04, 0xF4, 0x75, 0x29, 0x5D, 0xE9, 0x5F, 0xAA, 0x10, 0x30, - 0xB2, 0x0F, 0x5A, 0x1A, 0xC1, 0x2A, 0xB3, 0xFE, 0xCB, 0x21, 0xAD, 0x80, 0xEC, 0x8F, - 0x20, 0x09, 0x1C, 0xDB, 0xC5, 0x58, 0x94, 0xC2, 0x9C, 0xC6, 0xCE, 0x82, 0x65, 0x3E, - 0x57, 0x90, 0xBC, 0xA9, 0x8B, 0x06, 0xB4, 0xF0, 0x72, 0xF6, 0x77, 0xDF, 0x98, 0x64, - 0xF1, 0xEC, 0xFE, 0x37, 0x2D, 0xBC, 0xAE, 0x8C, 0x08, 0x81, 0x1F, 0xC3, 0xC9, 0x89, - 0x1A, 0xC7, 0x42, 0x82, 0x4B, 0x2E, 0xDC, 0x8E, 0x8D, 0x73, 0xCE, 0xB1, 0xCC, 0x01, - 0xD9, 0x08, 0x70, 0x87, 0x3C, 0x44, 0x08, 0xEC, 0x49, 0x8F, 0x81, 0x5A, 0xE2, 0x40, - 0xFF, 0x77, 0xFC, 0x0D}; - Exponent1 = new CryptoPP::byte[0x80]{ - 0x52, 0xCC, 0x2D, 0xA0, 0x9C, 0x9E, 0x75, 0xE7, 0x28, 0xEE, 0x3D, 0xDE, 0xE3, - 0x45, 0xD1, 0x4F, 0x94, 0x1C, 0xCC, 0xC8, 0x87, 0x29, 0x45, 0x3B, 0x8D, 0x6E, - 0xAB, 0x6E, 0x2A, 0xA7, 0xC7, 0x15, 0x43, 0xA3, 0x04, 0x8F, 0x90, 0x5F, 0xEB, - 0xF3, 0x38, 0x4A, 0x77, 0xFA, 0x36, 0xB7, 0x15, 0x76, 0xB6, 0x01, 0x1A, 0x8E, - 0x25, 0x87, 0x82, 0xF1, 0x55, 0xD8, 0xC6, 0x43, 0x2A, 0xC0, 0xE5, 0x98, 0xC9, - 0x32, 0xD1, 0x94, 0x6F, 0xD9, 0x01, 0xBA, 0x06, 0x81, 0xE0, 0x6D, 0x88, 0xF2, - 0x24, 0x2A, 0x25, 0x01, 0x64, 0x5C, 0xBF, 0xF2, 0xD9, 0x99, 0x67, 0x3E, 0xF6, - 0x72, 0xEE, 0xE4, 0xE2, 0x33, 0x5C, 0xF8, 0x00, 0x40, 0xE3, 0x2A, 0x9A, 0xF4, - 0x3D, 0x22, 0x86, 0x44, 0x3C, 0xFB, 0x0A, 0xA5, 0x7C, 0x3F, 0xCC, 0xF5, 0xF1, - 0x16, 0xC4, 0xAC, 0x88, 0xB4, 0xDE, 0x62, 0x94, 0x92, 0x6A, 0x13}; - Exponent2 = new CryptoPP::byte[0x80]{ - 0x7C, 0x9D, 0xAD, 0x39, 0xE0, 0xD5, 0x60, 0x14, 0x94, 0x48, 0x19, 0x7F, 0x88, - 0x95, 0xD5, 0x8B, 0x80, 0xAD, 0x85, 0x8A, 0x4B, 0x77, 0x37, 0x85, 0xD0, 0x77, - 0xBB, 0xBF, 0x89, 0x71, 0x4A, 0x72, 0xCB, 0x72, 0x68, 0x38, 0xEC, 0x02, 0xC6, - 0x7D, 0xC6, 0x44, 0x06, 0x33, 0x51, 0x1C, 0xC0, 0xFF, 0x95, 0x8F, 0x0D, 0x75, - 0xDC, 0x25, 0xBB, 0x0B, 0x73, 0x91, 0xA9, 0x6D, 0x42, 0xD8, 0x03, 0xB7, 0x68, - 0xD4, 0x1E, 0x75, 0x62, 0xA3, 0x70, 0x35, 0x79, 0x78, 0x00, 0xC8, 0xF5, 0xEF, - 0x15, 0xB9, 0xFC, 0x4E, 0x47, 0x5A, 0xC8, 0x70, 0x70, 0x5B, 0x52, 0x98, 0xC0, - 0xC2, 0x58, 0x4A, 0x70, 0x96, 0xCC, 0xB8, 0x10, 0xE1, 0x2F, 0x78, 0x8B, 0x2B, - 0xA1, 0x7F, 0xF9, 0xAC, 0xDE, 0xF0, 0xBB, 0x2B, 0xE2, 0x66, 0xE3, 0x22, 0x92, - 0x31, 0x21, 0x57, 0x92, 0xC4, 0xB8, 0xF2, 0x3E, 0x76, 0x20, 0x37}; - Coefficient = new CryptoPP::byte[0x80]{ - 0x45, 0x97, 0x55, 0xD4, 0x22, 0x08, 0x5E, 0xF3, 0x5C, 0xB4, 0x05, 0x7A, 0xFD, - 0xAA, 0x42, 0x42, 0xAD, 0x9A, 0x8C, 0xA0, 0x6C, 0xBB, 0x1D, 0x68, 0x54, 0x54, - 0x6E, 0x3E, 0x32, 0xE3, 0x53, 0x73, 0x76, 0xF1, 0x3E, 0x01, 0xEA, 0xD3, 0xCF, - 0xEB, 0xEB, 0x23, 0x3E, 0xC0, 0xBE, 0xCE, 0xEC, 0x2C, 0x89, 0x5F, 0xA8, 0x27, - 0x3A, 0x4C, 0xB7, 0xE6, 0x74, 0xBC, 0x45, 0x4C, 0x26, 0xC8, 0x25, 0xFF, 0x34, - 0x63, 0x25, 0x37, 0xE1, 0x48, 0x10, 0xC1, 0x93, 0xA6, 0xAF, 0xEB, 0xBA, 0xE3, - 0xA2, 0xF1, 0x3D, 0xEF, 0x63, 0xD8, 0xF4, 0xFD, 0xD3, 0xEE, 0xE2, 0x5D, 0xE9, - 0x33, 0xCC, 0xAD, 0xBA, 0x75, 0x5C, 0x85, 0xAF, 0xCE, 0xA9, 0x3D, 0xD1, 0xA2, - 0x17, 0xF3, 0xF6, 0x98, 0xB3, 0x50, 0x8E, 0x5E, 0xF6, 0xEB, 0x02, 0x8E, 0xA1, - 0x62, 0xA7, 0xD6, 0x2C, 0xEC, 0x91, 0xFF, 0x15, 0x40, 0xD2, 0xE3}; - Modulus = new CryptoPP::byte[0x100]{ - 0xd2, 0x12, 0xfc, 0x33, 0x5f, 0x6d, 0xdb, 0x83, 0x16, 0x09, 0x62, 0x8b, 0x03, 0x56, - 0x27, 0x37, 0x82, 0xd4, 0x77, 0x85, 0x35, 0x29, 0x39, 0x2d, 0x52, 0x6b, 0x8c, 0x4c, - 0x8c, 0xfb, 0x06, 0xc1, 0x84, 0x5b, 0xe7, 0xd4, 0xf7, 0xbc, 0xd2, 0x4e, 0x62, 0x45, - 0xcd, 0x2a, 0xbb, 0xd7, 0x77, 0x76, 0x45, 0x36, 0x55, 0x27, 0x3f, 0xb3, 0xf5, 0xf9, - 0x8e, 0xda, 0x4b, 0xef, 0xaa, 0x59, 0xae, 0xb3, 0x9b, 0xea, 0x54, 0x98, 0xd2, 0x06, - 0x32, 0x6a, 0x58, 0x31, 0x2a, 0xe0, 0xd4, 0x4f, 0x90, 0xb5, 0x0a, 0x7d, 0xec, 0xf4, - 0x3a, 0x9c, 0x52, 0x67, 0x2d, 0x99, 0x31, 0x8e, 0x0c, 0x43, 0xe6, 0x82, 0xfe, 0x07, - 0x46, 0xe1, 0x2e, 0x50, 0xd4, 0x1f, 0x2d, 0x2f, 0x7e, 0xd9, 0x08, 0xba, 0x06, 0xb3, - 0xbf, 0x2e, 0x20, 0x3f, 0x4e, 0x3f, 0xfe, 0x44, 0xff, 0xaa, 0x50, 0x43, 0x57, 0x91, - 0x69, 0x94, 0x49, 0x15, 0x82, 0x82, 0xe4, 0x0f, 0x4c, 0x8d, 0x9d, 0x2c, 0xc9, 0x5b, - 0x1d, 0x64, 0xbf, 0x88, 0x8b, 0xd4, 0xc5, 0x94, 0xe7, 0x65, 0x47, 0x84, 0x1e, 0xe5, - 0x79, 0x10, 0xfb, 0x98, 0x93, 0x47, 0xb9, 0x7d, 0x85, 0x12, 0xa6, 0x40, 0x98, 0x2c, - 0xf7, 0x92, 0xbc, 0x95, 0x19, 0x32, 0xed, 0xe8, 0x90, 0x56, 0x0d, 0x65, 0xc1, 0xaa, - 0x78, 0xc6, 0x2e, 0x54, 0xfd, 0x5f, 0x54, 0xa1, 0xf6, 0x7e, 0xe5, 0xe0, 0x5f, 0x61, - 0xc1, 0x20, 0xb4, 0xb9, 0xb4, 0x33, 0x08, 0x70, 0xe4, 0xdf, 0x89, 0x56, 0xed, 0x01, - 0x29, 0x46, 0x77, 0x5f, 0x8c, 0xb8, 0xa9, 0xf5, 0x1e, 0x2e, 0xb3, 0xb9, 0xbf, 0xe0, - 0x09, 0xb7, 0x8d, 0x28, 0xd4, 0xa6, 0xc3, 0xb8, 0x1e, 0x1f, 0x07, 0xeb, 0xb4, 0x12, - 0x0b, 0x95, 0xb8, 0x85, 0x30, 0xfd, 0xdc, 0x39, 0x13, 0xd0, 0x7c, 0xdc, 0x8f, 0xed, - 0xf9, 0xc9, 0xa3, 0xc1}; - PublicExponent = new CryptoPP::byte[4]{0, 1, 0, 1}; - }; + static constexpr CryptoPP::byte Prime2[] = { + 0xD7, 0xA1, 0x0F, 0x9A, 0x8B, 0xF2, 0xC9, 0x11, 0x95, 0x32, 0x9A, 0x8C, 0xF0, 0xD9, 0x40, + 0x47, 0xF5, 0x68, 0xA0, 0x0D, 0xBD, 0xC1, 0xFC, 0x43, 0x2F, 0x65, 0xF9, 0xC3, 0x61, 0x0F, + 0x25, 0x77, 0x54, 0xAD, 0xD7, 0x58, 0xAC, 0x84, 0x40, 0x60, 0x8D, 0x3F, 0xF3, 0x65, 0x89, + 0x75, 0xB5, 0xC6, 0x2C, 0x51, 0x1A, 0x2F, 0x1F, 0x22, 0xE4, 0x43, 0x11, 0x54, 0xBE, 0xC9, + 0xB4, 0xC7, 0xB5, 0x1B, 0x05, 0x0B, 0xBC, 0x56, 0x9A, 0xCD, 0x4A, 0xD9, 0x73, 0x68, 0x5E, + 0x5C, 0xFB, 0x92, 0xB7, 0x8B, 0x0D, 0xFF, 0xF5, 0x07, 0xCA, 0xB4, 0xC8, 0x9B, 0x96, 0x3C, + 0x07, 0x9E, 0x3E, 0x6B, 0x2A, 0x11, 0xF2, 0x8A, 0xB1, 0x8A, 0xD7, 0x2E, 0x1B, 0xA5, 0x53, + 0x24, 0x06, 0xED, 0x50, 0xB8, 0x90, 0x67, 0xB1, 0xE2, 0x41, 0xC6, 0x92, 0x01, 0xEE, 0x10, + 0xF0, 0x61, 0xBB, 0xFB, 0xB2, 0x7D, 0x4A, 0x73}; + static constexpr CryptoPP::byte PrivateExponent[] = { + 0x32, 0xD9, 0x03, 0x90, 0x8F, 0xBD, 0xB0, 0x8F, 0x57, 0x2B, 0x28, 0x5E, 0x0B, 0x8D, 0xB3, + 0xEA, 0x5C, 0xD1, 0x7E, 0xA8, 0x90, 0x88, 0x8C, 0xDD, 0x6A, 0x80, 0xBB, 0xB1, 0xDF, 0xC1, + 0xF7, 0x0D, 0xAA, 0x32, 0xF0, 0xB7, 0x7C, 0xCB, 0x88, 0x80, 0x0E, 0x8B, 0x64, 0xB0, 0xBE, + 0x4C, 0xD6, 0x0E, 0x9B, 0x8C, 0x1E, 0x2A, 0x64, 0xE1, 0xF3, 0x5C, 0xD7, 0x76, 0x01, 0x41, + 0x5E, 0x93, 0x5C, 0x94, 0xFE, 0xDD, 0x46, 0x62, 0xC3, 0x1B, 0x5A, 0xE2, 0xA0, 0xBC, 0x2D, + 0xEB, 0xC3, 0x98, 0x0A, 0xA7, 0xB7, 0x85, 0x69, 0x70, 0x68, 0x2B, 0x64, 0x4A, 0xB3, 0x1F, + 0xCC, 0x7D, 0xDC, 0x7C, 0x26, 0xF4, 0x77, 0xF6, 0x5C, 0xF2, 0xAE, 0x5A, 0x44, 0x2D, 0xD3, + 0xAB, 0x16, 0x62, 0x04, 0x19, 0xBA, 0xFB, 0x90, 0xFF, 0xE2, 0x30, 0x50, 0x89, 0x6E, 0xCB, + 0x56, 0xB2, 0xEB, 0xC0, 0x91, 0x16, 0x92, 0x5E, 0x30, 0x8E, 0xAE, 0xC7, 0x94, 0x5D, 0xFD, + 0x35, 0xE1, 0x20, 0xF8, 0xAD, 0x3E, 0xBC, 0x08, 0xBF, 0xC0, 0x36, 0x74, 0x9F, 0xD5, 0xBB, + 0x52, 0x08, 0xFD, 0x06, 0x66, 0xF3, 0x7A, 0xB3, 0x04, 0xF4, 0x75, 0x29, 0x5D, 0xE9, 0x5F, + 0xAA, 0x10, 0x30, 0xB2, 0x0F, 0x5A, 0x1A, 0xC1, 0x2A, 0xB3, 0xFE, 0xCB, 0x21, 0xAD, 0x80, + 0xEC, 0x8F, 0x20, 0x09, 0x1C, 0xDB, 0xC5, 0x58, 0x94, 0xC2, 0x9C, 0xC6, 0xCE, 0x82, 0x65, + 0x3E, 0x57, 0x90, 0xBC, 0xA9, 0x8B, 0x06, 0xB4, 0xF0, 0x72, 0xF6, 0x77, 0xDF, 0x98, 0x64, + 0xF1, 0xEC, 0xFE, 0x37, 0x2D, 0xBC, 0xAE, 0x8C, 0x08, 0x81, 0x1F, 0xC3, 0xC9, 0x89, 0x1A, + 0xC7, 0x42, 0x82, 0x4B, 0x2E, 0xDC, 0x8E, 0x8D, 0x73, 0xCE, 0xB1, 0xCC, 0x01, 0xD9, 0x08, + 0x70, 0x87, 0x3C, 0x44, 0x08, 0xEC, 0x49, 0x8F, 0x81, 0x5A, 0xE2, 0x40, 0xFF, 0x77, 0xFC, + 0x0D}; }; \ No newline at end of file diff --git a/src/core/file_format/pkg.cpp b/src/core/file_format/pkg.cpp index 336d81019..fe3c34547 100644 --- a/src/core/file_format/pkg.cpp +++ b/src/core/file_format/pkg.cpp @@ -279,8 +279,8 @@ bool PKG::Extract(const std::filesystem::path& filepath, const std::filesystem:: } } - // let's deal with the root/uroot enteries here. - // Sometimes it's more than 2 enteries (Tomb Raider Remastered) + // let's deal with the root/uroot entries here. + // Sometimes it's more than 2 entries (Tomb Raider Remastered) const std::string_view flat_path_table(&decompressedData[0x10], 15); if (flat_path_table == "flat_path_table") { uroot_reached = true; diff --git a/src/core/file_sys/fs.cpp b/src/core/file_sys/fs.cpp index 40d8212bb..199e42a04 100644 --- a/src/core/file_sys/fs.cpp +++ b/src/core/file_sys/fs.cpp @@ -48,7 +48,7 @@ std::filesystem::path MntPoints::GetHostPath(std::string_view guest_directory) { pos = mount->mount.size() + 1; const auto rel_path = std::string_view(corrected_path).substr(pos); const auto host_path = mount->host_path / rel_path; - if (!NeedsCaseInsensiveSearch) { + if (!NeedsCaseInsensitiveSearch) { return host_path; } diff --git a/src/core/file_sys/fs.h b/src/core/file_sys/fs.h index b0fb63242..2c55b0513 100644 --- a/src/core/file_sys/fs.h +++ b/src/core/file_sys/fs.h @@ -14,9 +14,9 @@ namespace Core::FileSys { class MntPoints { #ifdef _WIN64 - static constexpr bool NeedsCaseInsensiveSearch = false; + static constexpr bool NeedsCaseInsensitiveSearch = false; #else - static constexpr bool NeedsCaseInsensiveSearch = true; + static constexpr bool NeedsCaseInsensitiveSearch = true; #endif public: struct MntPair { diff --git a/src/core/libraries/ajm/ajm.cpp b/src/core/libraries/ajm/ajm.cpp index d8d8304ab..441a07f63 100644 --- a/src/core/libraries/ajm/ajm.cpp +++ b/src/core/libraries/ajm/ajm.cpp @@ -1,9 +1,10 @@ // SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later -// Generated By moduleGenerator +#include "ajm.h" +#include "ajm_error.h" + #include "common/logging/log.h" -#include "core/libraries/ajm/ajm.h" #include "core/libraries/error_codes.h" #include "core/libraries/libs.h" diff --git a/src/core/libraries/ajm/ajm_error.h b/src/core/libraries/ajm/ajm_error.h new file mode 100644 index 000000000..64129554f --- /dev/null +++ b/src/core/libraries/ajm/ajm_error.h @@ -0,0 +1,28 @@ +// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +constexpr int ORBIS_AJM_ERROR_UNKNOWN = 0x80930001; +constexpr int ORBIS_AJM_ERROR_INVALID_CONTEXT = 0x80930002; +constexpr int ORBIS_AJM_ERROR_INVALID_INSTANCE = 0x80930003; +constexpr int ORBIS_AJM_ERROR_INVALID_BATCH = 0x80930004; +constexpr int ORBIS_AJM_ERROR_INVALID_PARAMETER = 0x80930005; +constexpr int ORBIS_AJM_ERROR_OUT_OF_MEMORY = 0x80930006; +constexpr int ORBIS_AJM_ERROR_OUT_OF_RESOURCES = 0x80930007; +constexpr int ORBIS_AJM_ERROR_CODEC_NOT_SUPPORTED = 0x80930008; +constexpr int ORBIS_AJM_ERROR_CODEC_ALREADY_REGISTERED = 0x80930009; +constexpr int ORBIS_AJM_ERROR_CODEC_NOT_REGISTERED = 0x8093000A; +constexpr int ORBIS_AJM_ERROR_WRONG_REVISION_FLAG = 0x8093000B; +constexpr int ORBIS_AJM_ERROR_FLAG_NOT_SUPPORTED = 0x8093000C; +constexpr int ORBIS_AJM_ERROR_BUSY = 0x8093000D; +constexpr int ORBIS_AJM_ERROR_BAD_PRIORITY = 0x8093000E; +constexpr int ORBIS_AJM_ERROR_IN_PROGRESS = 0x8093000F; +constexpr int ORBIS_AJM_ERROR_RETRY = 0x80930010; +constexpr int ORBIS_AJM_ERROR_MALFORMED_BATCH = 0x80930011; +constexpr int ORBIS_AJM_ERROR_JOB_CREATION = 0x80930012; +constexpr int ORBIS_AJM_ERROR_INVALID_OPCODE = 0x80930013; +constexpr int ORBIS_AJM_ERROR_PRIORITY_VIOLATION = 0x80930014; +constexpr int ORBIS_AJM_ERROR_BUFFER_TOO_BIG = 0x80930015; +constexpr int ORBIS_AJM_ERROR_INVALID_ADDRESS = 0x80930016; +constexpr int ORBIS_AJM_ERROR_CANCELLED = 0x80930017; diff --git a/src/core/libraries/app_content/app_content.cpp b/src/core/libraries/app_content/app_content.cpp index 882f99e49..ab3c901aa 100644 --- a/src/core/libraries/app_content/app_content.cpp +++ b/src/core/libraries/app_content/app_content.cpp @@ -221,12 +221,12 @@ int PS4_SYSV_ABI Func_C59A36FF8D7C59DA() { return ORBIS_OK; } -int PS4_SYSV_ABI sceAppContentAddcontEnqueueDownloadByEntitlemetId() { +int PS4_SYSV_ABI sceAppContentAddcontEnqueueDownloadByEntitlementId() { LOG_ERROR(Lib_AppContent, "(STUBBED) called"); return ORBIS_OK; } -int PS4_SYSV_ABI sceAppContentAddcontMountByEntitlemetId() { +int PS4_SYSV_ABI sceAppContentAddcontMountByEntitlementId() { LOG_ERROR(Lib_AppContent, "(STUBBED) called"); return ORBIS_OK; } @@ -313,9 +313,9 @@ void RegisterlibSceAppContent(Core::Loader::SymbolsResolver* sym) { LIB_FUNCTION("xZo2-418Wdo", "libSceAppContentBundle", 1, "libSceAppContent", 1, 1, Func_C59A36FF8D7C59DA); LIB_FUNCTION("kJmjt81mXKQ", "libSceAppContentIro", 1, "libSceAppContent", 1, 1, - sceAppContentAddcontEnqueueDownloadByEntitlemetId); + sceAppContentAddcontEnqueueDownloadByEntitlementId); LIB_FUNCTION("efX3lrPwdKA", "libSceAppContentIro", 1, "libSceAppContent", 1, 1, - sceAppContentAddcontMountByEntitlemetId); + sceAppContentAddcontMountByEntitlementId); LIB_FUNCTION("z9hgjLd1SGA", "libSceAppContentIro", 1, "libSceAppContent", 1, 1, sceAppContentGetAddcontInfoByEntitlementId); LIB_FUNCTION("3wUaDTGmjcQ", "libSceAppContentIro", 1, "libSceAppContent", 1, 1, diff --git a/src/core/libraries/app_content/app_content.h b/src/core/libraries/app_content/app_content.h index ecf69199e..3e6f9b540 100644 --- a/src/core/libraries/app_content/app_content.h +++ b/src/core/libraries/app_content/app_content.h @@ -92,8 +92,8 @@ int PS4_SYSV_ABI sceAppContentTemporaryDataMount2(OrbisAppContentTemporaryDataOp int PS4_SYSV_ABI sceAppContentTemporaryDataUnmount(); int PS4_SYSV_ABI sceAppContentGetPftFlag(); int PS4_SYSV_ABI Func_C59A36FF8D7C59DA(); -int PS4_SYSV_ABI sceAppContentAddcontEnqueueDownloadByEntitlemetId(); -int PS4_SYSV_ABI sceAppContentAddcontMountByEntitlemetId(); +int PS4_SYSV_ABI sceAppContentAddcontEnqueueDownloadByEntitlementId(); +int PS4_SYSV_ABI sceAppContentAddcontMountByEntitlementId(); int PS4_SYSV_ABI sceAppContentGetAddcontInfoByEntitlementId(); int PS4_SYSV_ABI sceAppContentGetAddcontInfoListByIroTag(); int PS4_SYSV_ABI sceAppContentGetDownloadedStoreCountry(); diff --git a/src/core/libraries/avplayer/avplayer_data_streamer.h b/src/core/libraries/avplayer/avplayer_data_streamer.h index 04097bb4d..319c88a91 100644 --- a/src/core/libraries/avplayer/avplayer_data_streamer.h +++ b/src/core/libraries/avplayer/avplayer_data_streamer.h @@ -7,6 +7,8 @@ #include "common/types.h" +#include + struct AVIOContext; namespace Libraries::AvPlayer { @@ -14,6 +16,7 @@ namespace Libraries::AvPlayer { class IDataStreamer { public: virtual ~IDataStreamer() = default; + virtual bool Init(std::string_view path) = 0; virtual AVIOContext* GetContext() = 0; }; diff --git a/src/core/libraries/avplayer/avplayer_file_streamer.cpp b/src/core/libraries/avplayer/avplayer_file_streamer.cpp index dc1386a47..c7bd5b5de 100644 --- a/src/core/libraries/avplayer/avplayer_file_streamer.cpp +++ b/src/core/libraries/avplayer/avplayer_file_streamer.cpp @@ -18,19 +18,8 @@ extern "C" { namespace Libraries::AvPlayer { -AvPlayerFileStreamer::AvPlayerFileStreamer(const SceAvPlayerFileReplacement& file_replacement, - std::string_view path) - : m_file_replacement(file_replacement) { - const auto ptr = m_file_replacement.object_ptr; - m_fd = m_file_replacement.open(ptr, path.data()); - ASSERT(m_fd >= 0); - m_file_size = m_file_replacement.size(ptr); - // avio_buffer is deallocated in `avio_context_free` - const auto avio_buffer = reinterpret_cast(av_malloc(AVPLAYER_AVIO_BUFFER_SIZE)); - m_avio_context = - avio_alloc_context(avio_buffer, AVPLAYER_AVIO_BUFFER_SIZE, 0, this, - &AvPlayerFileStreamer::ReadPacket, nullptr, &AvPlayerFileStreamer::Seek); -} +AvPlayerFileStreamer::AvPlayerFileStreamer(const SceAvPlayerFileReplacement& file_replacement) + : m_file_replacement(file_replacement) {} AvPlayerFileStreamer::~AvPlayerFileStreamer() { if (m_avio_context != nullptr) { @@ -43,6 +32,21 @@ AvPlayerFileStreamer::~AvPlayerFileStreamer() { } } +bool AvPlayerFileStreamer::Init(std::string_view path) { + const auto ptr = m_file_replacement.object_ptr; + m_fd = m_file_replacement.open(ptr, path.data()); + if (m_fd < 0) { + return false; + } + m_file_size = m_file_replacement.size(ptr); + // avio_buffer is deallocated in `avio_context_free` + const auto avio_buffer = reinterpret_cast(av_malloc(AVPLAYER_AVIO_BUFFER_SIZE)); + m_avio_context = + avio_alloc_context(avio_buffer, AVPLAYER_AVIO_BUFFER_SIZE, 0, this, + &AvPlayerFileStreamer::ReadPacket, nullptr, &AvPlayerFileStreamer::Seek); + return true; +} + s32 AvPlayerFileStreamer::ReadPacket(void* opaque, u8* buffer, s32 size) { const auto self = reinterpret_cast(opaque); if (self->m_position >= self->m_file_size) { diff --git a/src/core/libraries/avplayer/avplayer_file_streamer.h b/src/core/libraries/avplayer/avplayer_file_streamer.h index 658ce8c1e..034e40dd4 100644 --- a/src/core/libraries/avplayer/avplayer_file_streamer.h +++ b/src/core/libraries/avplayer/avplayer_file_streamer.h @@ -15,9 +15,11 @@ namespace Libraries::AvPlayer { class AvPlayerFileStreamer : public IDataStreamer { public: - AvPlayerFileStreamer(const SceAvPlayerFileReplacement& file_replacement, std::string_view path); + AvPlayerFileStreamer(const SceAvPlayerFileReplacement& file_replacement); ~AvPlayerFileStreamer(); + bool Init(std::string_view path) override; + AVIOContext* GetContext() override { return m_avio_context; } diff --git a/src/core/libraries/avplayer/avplayer_impl.cpp b/src/core/libraries/avplayer/avplayer_impl.cpp index cdfff8277..6de7b4c20 100644 --- a/src/core/libraries/avplayer/avplayer_impl.cpp +++ b/src/core/libraries/avplayer/avplayer_impl.cpp @@ -110,7 +110,7 @@ s32 AvPlayer::AddSource(std::string_view path) { if (path.empty()) { return ORBIS_AVPLAYER_ERROR_INVALID_PARAMS; } - if (AVPLAYER_IS_ERROR(m_state->AddSource(path, GetSourceType(path)))) { + if (!m_state->AddSource(path, GetSourceType(path))) { return ORBIS_AVPLAYER_ERROR_OPERATION_FAILED; } return ORBIS_OK; @@ -128,7 +128,7 @@ s32 AvPlayer::GetStreamCount() { } s32 AvPlayer::GetStreamInfo(u32 stream_index, SceAvPlayerStreamInfo& info) { - if (AVPLAYER_IS_ERROR(m_state->GetStreamInfo(stream_index, info))) { + if (!m_state->GetStreamInfo(stream_index, info)) { return ORBIS_AVPLAYER_ERROR_OPERATION_FAILED; } return ORBIS_OK; @@ -145,7 +145,10 @@ s32 AvPlayer::EnableStream(u32 stream_index) { } s32 AvPlayer::Start() { - return m_state->Start(); + if (!m_state->Start()) { + return ORBIS_AVPLAYER_ERROR_OPERATION_FAILED; + } + return ORBIS_OK; } bool AvPlayer::GetVideoData(SceAvPlayerFrameInfo& video_info) { diff --git a/src/core/libraries/avplayer/avplayer_source.cpp b/src/core/libraries/avplayer/avplayer_source.cpp index 2e4ea8aab..99ba2e8b6 100644 --- a/src/core/libraries/avplayer/avplayer_source.cpp +++ b/src/core/libraries/avplayer/avplayer_source.cpp @@ -24,31 +24,39 @@ namespace Libraries::AvPlayer { using namespace Kernel; -AvPlayerSource::AvPlayerSource(AvPlayerStateCallback& state, std::string_view path, - const SceAvPlayerInitData& init_data, - SceAvPlayerSourceType source_type) - : m_state(state), m_memory_replacement(init_data.memory_replacement), - m_num_output_video_framebuffers( - std::min(std::max(2, init_data.num_output_video_framebuffers), 16)) { - AVFormatContext* context = avformat_alloc_context(); - if (init_data.file_replacement.open != nullptr) { - m_up_data_streamer = - std::make_unique(init_data.file_replacement, path); - context->pb = m_up_data_streamer->GetContext(); - ASSERT(!AVPLAYER_IS_ERROR(avformat_open_input(&context, nullptr, nullptr, nullptr))); - } else { - const auto mnt = Common::Singleton::Instance(); - const auto filepath = mnt->GetHostPath(path); - ASSERT(!AVPLAYER_IS_ERROR( - avformat_open_input(&context, filepath.string().c_str(), nullptr, nullptr))); - } - m_avformat_context = AVFormatContextPtr(context, &ReleaseAVFormatContext); -} +AvPlayerSource::AvPlayerSource(AvPlayerStateCallback& state) : m_state(state) {} AvPlayerSource::~AvPlayerSource() { Stop(); } +bool AvPlayerSource::Init(const SceAvPlayerInitData& init_data, std::string_view path) { + m_memory_replacement = init_data.memory_replacement, + m_num_output_video_framebuffers = + std::min(std::max(2, init_data.num_output_video_framebuffers), 16); + + AVFormatContext* context = avformat_alloc_context(); + if (init_data.file_replacement.open != nullptr) { + m_up_data_streamer = std::make_unique(init_data.file_replacement); + if (!m_up_data_streamer->Init(path)) { + return false; + } + context->pb = m_up_data_streamer->GetContext(); + if (AVPLAYER_IS_ERROR(avformat_open_input(&context, nullptr, nullptr, nullptr))) { + return false; + } + } else { + const auto mnt = Common::Singleton::Instance(); + const auto filepath = mnt->GetHostPath(path); + if (AVPLAYER_IS_ERROR( + avformat_open_input(&context, filepath.string().c_str(), nullptr, nullptr))) { + return false; + } + } + m_avformat_context = AVFormatContextPtr(context, &ReleaseAVFormatContext); + return true; +} + bool AvPlayerSource::FindStreamInfo() { if (m_avformat_context == nullptr) { LOG_ERROR(Lib_AvPlayer, "Could not find stream info. NULL context."); @@ -87,16 +95,16 @@ static f32 AVRationalToF32(const AVRational rational) { return f32(rational.num) / rational.den; } -s32 AvPlayerSource::GetStreamInfo(u32 stream_index, SceAvPlayerStreamInfo& info) { +bool AvPlayerSource::GetStreamInfo(u32 stream_index, SceAvPlayerStreamInfo& info) { info = {}; if (m_avformat_context == nullptr || stream_index >= m_avformat_context->nb_streams) { LOG_ERROR(Lib_AvPlayer, "Could not get stream {} info.", stream_index); - return -1; + return false; } const auto p_stream = m_avformat_context->streams[stream_index]; if (p_stream == nullptr || p_stream->codecpar == nullptr) { LOG_ERROR(Lib_AvPlayer, "Could not get stream {} info. NULL stream.", stream_index); - return -1; + return false; } info.type = CodecTypeToStreamType(p_stream->codecpar->codec_type); info.start_time = p_stream->start_time; @@ -140,9 +148,9 @@ s32 AvPlayerSource::GetStreamInfo(u32 stream_index, SceAvPlayerStreamInfo& info) break; default: LOG_ERROR(Lib_AvPlayer, "Stream {} type is unknown: {}.", stream_index, info.type); - return -1; + return false; } - return 0; + return true; } bool AvPlayerSource::EnableStream(u32 stream_index) { @@ -215,12 +223,12 @@ std::optional AvPlayerSource::HasFrames(u32 num_frames) { return m_video_packets.Size() > num_frames || m_is_eof; } -s32 AvPlayerSource::Start() { +bool AvPlayerSource::Start() { std::unique_lock lock(m_state_mutex); if (m_audio_codec_context == nullptr && m_video_codec_context == nullptr) { LOG_ERROR(Lib_AvPlayer, "Could not start playback. NULL context."); - return -1; + return false; } m_demuxer_thread = std::jthread([this](std::stop_token stop) { this->DemuxerThread(stop); }); m_video_decoder_thread = @@ -228,7 +236,7 @@ s32 AvPlayerSource::Start() { m_audio_decoder_thread = std::jthread([this](std::stop_token stop) { this->AudioDecoderThread(stop); }); m_start_time = std::chrono::high_resolution_clock::now(); - return 0; + return true; } bool AvPlayerSource::Stop() { diff --git a/src/core/libraries/avplayer/avplayer_source.h b/src/core/libraries/avplayer/avplayer_source.h index 7144e7ee4..906122142 100644 --- a/src/core/libraries/avplayer/avplayer_source.h +++ b/src/core/libraries/avplayer/avplayer_source.h @@ -120,17 +120,17 @@ private: class AvPlayerSource { public: - AvPlayerSource(AvPlayerStateCallback& state, std::string_view path, - const SceAvPlayerInitData& init_data, SceAvPlayerSourceType source_type); + AvPlayerSource(AvPlayerStateCallback& state); ~AvPlayerSource(); + bool Init(const SceAvPlayerInitData& init_data, std::string_view path); bool FindStreamInfo(); s32 GetStreamCount(); - s32 GetStreamInfo(u32 stream_index, SceAvPlayerStreamInfo& info); + bool GetStreamInfo(u32 stream_index, SceAvPlayerStreamInfo& info); bool EnableStream(u32 stream_index); void SetLooping(bool is_looping); std::optional HasFrames(u32 num_frames); - s32 Start(); + bool Start(); bool Stop(); bool GetAudioData(SceAvPlayerFrameInfo& audio_info); bool GetVideoData(SceAvPlayerFrameInfo& video_info); diff --git a/src/core/libraries/avplayer/avplayer_state.cpp b/src/core/libraries/avplayer/avplayer_state.cpp index cb3be2f57..a512063f2 100644 --- a/src/core/libraries/avplayer/avplayer_state.cpp +++ b/src/core/libraries/avplayer/avplayer_state.cpp @@ -24,6 +24,7 @@ void PS4_SYSV_ABI AvPlayerState::AutoPlayEventCallback(void* opaque, s32 event_i s32 timedtext_stream_index = -1; const s32 stream_count = self->GetStreamCount(); if (AVPLAYER_IS_ERROR(stream_count)) { + self->Stop(); return; } if (stream_count == 0) { @@ -32,7 +33,10 @@ void PS4_SYSV_ABI AvPlayerState::AutoPlayEventCallback(void* opaque, s32 event_i } for (u32 stream_index = 0; stream_index < stream_count; ++stream_index) { SceAvPlayerStreamInfo info{}; - self->GetStreamInfo(stream_index, info); + if (!self->GetStreamInfo(stream_index, info)) { + self->Stop(); + return; + } const std::string_view default_language( reinterpret_cast(self->m_default_language)); @@ -116,23 +120,28 @@ AvPlayerState::~AvPlayerState() { } // Called inside GAME thread -s32 AvPlayerState::AddSource(std::string_view path, SceAvPlayerSourceType source_type) { +bool AvPlayerState::AddSource(std::string_view path, SceAvPlayerSourceType source_type) { if (path.empty()) { LOG_ERROR(Lib_AvPlayer, "File path is empty."); - return -1; + return false; } { std::unique_lock lock(m_source_mutex); if (m_up_source != nullptr) { LOG_ERROR(Lib_AvPlayer, "Only one source is supported."); - return -1; + return false; } - m_up_source = std::make_unique(*this, path, m_init_data, source_type); + m_up_source = std::make_unique(*this); + if (!m_up_source->Init(m_init_data, path)) { + SetState(AvState::Error); + m_up_source.reset(); + return false; + } } AddSourceEvent(); - return 0; + return true; } // Called inside GAME thread @@ -146,25 +155,25 @@ s32 AvPlayerState::GetStreamCount() { } // Called inside GAME thread -s32 AvPlayerState::GetStreamInfo(u32 stream_index, SceAvPlayerStreamInfo& info) { +bool AvPlayerState::GetStreamInfo(u32 stream_index, SceAvPlayerStreamInfo& info) { std::shared_lock lock(m_source_mutex); if (m_up_source == nullptr) { LOG_ERROR(Lib_AvPlayer, "Could not get stream {} info. No source.", stream_index); - return -1; + return false; } return m_up_source->GetStreamInfo(stream_index, info); } // Called inside GAME thread -s32 AvPlayerState::Start() { +bool AvPlayerState::Start() { std::shared_lock lock(m_source_mutex); - if (m_up_source == nullptr || m_up_source->Start() < 0) { + if (m_up_source == nullptr || !m_up_source->Start()) { LOG_ERROR(Lib_AvPlayer, "Could not start playback."); - return -1; + return false; } SetState(AvState::Play); OnPlaybackStateChanged(AvState::Play); - return 0; + return true; } void AvPlayerState::AvControllerThread(std::stop_token stop) { @@ -219,10 +228,10 @@ bool AvPlayerState::Stop() { if (m_up_source == nullptr || m_current_state == AvState::Stop) { return false; } - if (!SetState(AvState::Stop)) { + if (!m_up_source->Stop()) { return false; } - if (!m_up_source->Stop()) { + if (!SetState(AvState::Stop)) { return false; } OnPlaybackStateChanged(AvState::Stop); diff --git a/src/core/libraries/avplayer/avplayer_state.h b/src/core/libraries/avplayer/avplayer_state.h index ff80b6cea..a5a3bd689 100644 --- a/src/core/libraries/avplayer/avplayer_state.h +++ b/src/core/libraries/avplayer/avplayer_state.h @@ -24,11 +24,11 @@ public: AvPlayerState(const SceAvPlayerInitData& init_data); ~AvPlayerState(); - s32 AddSource(std::string_view filename, SceAvPlayerSourceType source_type); + bool AddSource(std::string_view filename, SceAvPlayerSourceType source_type); s32 GetStreamCount(); - s32 GetStreamInfo(u32 stream_index, SceAvPlayerStreamInfo& info); + bool GetStreamInfo(u32 stream_index, SceAvPlayerStreamInfo& info); bool EnableStream(u32 stream_index); - s32 Start(); + bool Start(); bool Stop(); bool GetAudioData(SceAvPlayerFrameInfo& audio_info); bool GetVideoData(SceAvPlayerFrameInfo& video_info); diff --git a/src/core/libraries/error_codes.h b/src/core/libraries/error_codes.h index 123edcee8..1453b0a8f 100644 --- a/src/core/libraries/error_codes.h +++ b/src/core/libraries/error_codes.h @@ -233,9 +233,6 @@ constexpr int SCE_KERNEL_ERROR_ESDKVERSION = 0x80020063; constexpr int SCE_KERNEL_ERROR_ESTART = 0x80020064; constexpr int SCE_KERNEL_ERROR_ESTOP = 0x80020065; -// libSceRandom error codes -constexpr int SCE_RANDOM_ERROR_INVALID = 0x817C0016; - // videoOut constexpr int SCE_VIDEO_OUT_ERROR_INVALID_VALUE = 0x80290001; // invalid argument constexpr int SCE_VIDEO_OUT_ERROR_INVALID_ADDRESS = 0x80290002; // invalid addresses @@ -249,14 +246,6 @@ constexpr int SCE_VIDEO_OUT_ERROR_SLOT_OCCUPIED = 0x80290010; // slot alr constexpr int SCE_VIDEO_OUT_ERROR_FLIP_QUEUE_FULL = 0x80290012; // flip queue is full constexpr int SCE_VIDEO_OUT_ERROR_INVALID_OPTION = 0x8029001A; // Invalid buffer attribute option -// GnmDriver -constexpr int ORBIS_GNM_ERROR_COMPUTEQUEUE_INVALID_PIPE_ID = 0x80D17000; -constexpr int ORBIS_GNM_ERROR_COMPUTEQUEUE_INVALID_QUEUE_ID = 0x80D17001; -constexpr int ORBIS_GNM_ERROR_COMPUTEQUEUE_INVALID_RING_BASE_ADDR = 0x80D17003; -constexpr int ORBIS_GNM_ERROR_COMPUTEQUEUE_INVALID_RING_SIZE = 0x80D17002; -constexpr int ORBIS_GNM_ERROR_COMPUTEQUEUE_INVALID_READ_PTR_ADDR = 0x80D17004; -constexpr int ORBIS_GNM_ERROR_FAILURE = 0x8EEE00FF; - // Generic constexpr int ORBIS_OK = 0x00000000; constexpr int ORBIS_FAIL = 0xFFFFFFFF; diff --git a/src/core/libraries/gnmdriver/gnm_error.h b/src/core/libraries/gnmdriver/gnm_error.h new file mode 100644 index 000000000..eab684a24 --- /dev/null +++ b/src/core/libraries/gnmdriver/gnm_error.h @@ -0,0 +1,85 @@ +// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +constexpr int ORBIS_GNM_ERROR_SUBMISSION_FAILED_INVALID_ARGUMENT = 0x80D11000; +constexpr int ORBIS_GNM_ERROR_SUBMISSION_NOT_ENOUGH_RESOURCES = 0x80D11001; +constexpr int ORBIS_GNM_ERROR_SUBMISSION_AND_FLIP_FAILED_INVALID_COMMAND_BUFFER = 0x80D11080; +constexpr int ORBIS_GNM_ERROR_SUBMISSION_AND_FLIP_FAILED_INVALID_QUEUE_FULL = 0x80D11081; +constexpr int ORBIS_GNM_ERROR_SUBMISSION_AND_FLIP_FAILED_REQUEST_FAILED = 0x80D11082; +constexpr int ORBIS_GNM_ERROR_SUBMISSION_FAILED_INTERNAL_ERROR = 0x80D110FF; +constexpr int ORBIS_GNM_ERROR_VALIDATION_WARNING = 0x80D12000; +constexpr int ORBIS_GNM_ERROR_VALIDATION_WARNING_RWBUFFER_ROTYPE = 0x80D12001; +constexpr int ORBIS_GNM_ERROR_VALIDATION_WARNING_BLENDING = 0x80D12002; +constexpr int ORBIS_GNM_ERROR_VALIDATION_WARNING_DRAW_CU_MASK = 0x80D12003; +constexpr int ORBIS_GNM_ERROR_VALIDATION_WARNING_MRT_SETUP = 0x80D12004; +constexpr int ORBIS_GNM_ERROR_VALIDATION_WARNING_DEPTH_RT_SETUP = 0x80D12005; +constexpr int ORBIS_GNM_ERROR_VALIDATION_WARNING_PS_AND_MRT_FORMAT = 0x80D1200F; +constexpr int ORBIS_GNM_ERROR_VALIDATION_ERROR = 0x80D13000; +constexpr int ORBIS_GNM_ERROR_VALIDATION_VSHARP = 0x80D13001; +constexpr int ORBIS_GNM_ERROR_VALIDATION_TSHARP = 0x80D13002; +constexpr int ORBIS_GNM_ERROR_VALIDATION_RESOURCE = 0x80D13003; +constexpr int ORBIS_GNM_ERROR_VALIDATION_TABLE_MEMORY = 0x80D13004; +constexpr int ORBIS_GNM_ERROR_VALIDATION_WRITE_EVENT_OP = 0x80D13005; +constexpr int ORBIS_GNM_ERROR_VALIDATION_INDEX_BUFFER = 0x80D13006; +constexpr int ORBIS_GNM_ERROR_VALIDATION_TESS_FACTOR_BUFFER = 0x80D13007; +constexpr int ORBIS_GNM_ERROR_VALIDATION_SCRATCH_RING = 0x80D13008; +constexpr int ORBIS_GNM_ERROR_VALIDATION_PRIMITIVE_TYPE = 0x80D13009; +constexpr int ORBIS_GNM_ERROR_VALIDATION_INDEX_SIZE = 0x80D1300A; +constexpr int ORBIS_GNM_ERROR_VALIDATION_INLINE_DRAW_SIZE = 0x80D1300B; +constexpr int ORBIS_GNM_ERROR_VALIDATION_NUM_INPUT_PATCHES = 0x80D1300C; +constexpr int ORBIS_GNM_ERROR_VALIDATION_GS_MODE = 0x80D1300D; +constexpr int ORBIS_GNM_ERROR_VALIDATION_SHADER_ADDRESS = 0x80D1300E; +constexpr int ORBIS_GNM_ERROR_VALIDATION_BORDER_COLOR_TABLE = 0x80D1300F; +constexpr int ORBIS_GNM_ERROR_VALIDATION_SSHARP = 0x80D13010; +constexpr int ORBIS_GNM_ERROR_VALIDATION_DISPATCH_DRAW = 0x80D13011; +constexpr int ORBIS_GNM_ERROR_VALIDATION_ACTIVE_SHADER_STAGE = 0x80D13012; +constexpr int ORBIS_GNM_ERROR_VALIDATION_DCB = 0x80D13013; +constexpr int ORBIS_GNM_ERROR_VALIDATION_MISMATCH_SHADER_STAGE = 0x80D13014; +constexpr int ORBIS_GNM_ERROR_VALIDATION_MRT_SETUP = 0x80D13015; +constexpr int ORBIS_GNM_ERROR_VALIDATION_BAD_OP_CODE = 0x80D13016; +constexpr int ORBIS_GNM_ERROR_VALIDATION_DEPTH_RT_SETUP = 0x80D13017; +constexpr int ORBIS_GNM_ERROR_VALIDATION_NUM_INSTANCES = 0x80D13018; +constexpr int ORBIS_GNM_ERROR_VALIDATION_SRT = 0x80D13019; +constexpr int ORBIS_GNM_ERROR_VALIDATION_INVALID_ARGUMENT = 0x80D13FFD; +constexpr int ORBIS_GNM_ERROR_VALIDATION_FAILED_INTERNAL_ERROR = 0x80D13FFE; +constexpr int ORBIS_GNM_ERROR_VALIDATION_NOT_ENABLED = 0x80D13FFF; +constexpr int ORBIS_GNM_ERROR_CAPTURE_FILE_IO = 0x80D15000; +constexpr int ORBIS_GNM_ERROR_CAPTURE_RAZOR_NOT_LOADED = 0x80D15001; +constexpr int ORBIS_GNM_ERROR_CAPTURE_NOTHING_TO_CAPTURE = 0x80D15002; +constexpr int ORBIS_GNM_ERROR_CAPTURE_FAILED_INTERNAL = 0x80D1500F; +constexpr int ORBIS_GNM_ERROR_COMPUTEQUEUE_INVALID_PIPE_ID = 0x80D17000; +constexpr int ORBIS_GNM_ERROR_COMPUTEQUEUE_INVALID_QUEUE_ID = 0x80D17001; +constexpr int ORBIS_GNM_ERROR_COMPUTEQUEUE_INVALID_RING_SIZE = 0x80D17002; +constexpr int ORBIS_GNM_ERROR_COMPUTEQUEUE_INVALID_RING_BASE_ADDR = 0x80D17003; +constexpr int ORBIS_GNM_ERROR_COMPUTEQUEUE_INVALID_READ_PTR_ADDR = 0x80D17004; +constexpr int ORBIS_GNM_ERROR_COMPUTEQUEUE_INVALID_PIPE_PRIORITY = 0x80D17005; +constexpr int ORBIS_GNM_ERROR_COMPUTEQUEUE_INTERNAL = 0x80D170FF; +constexpr int ORBIS_GNM_ERROR_RESOURCE_REGISTRATION_INVALID_ARGUMENT = 0x80D19000; +constexpr int ORBIS_GNM_ERROR_RESOURCE_REGISTRATION_INVALID_SHADER = 0x80D19001; +constexpr int ORBIS_GNM_ERROR_RESOURCE_REGISTRATION_STALE_HANDLE = 0x80D19002; +constexpr int ORBIS_GNM_ERROR_RESOURCE_REGISTRATION_FULL = 0x80D19003; +constexpr int ORBIS_GNM_ERROR_RESOURCE_REGISTRATION_NOT_PERMITTED = 0x80D19004; +constexpr int ORBIS_GNM_ERROR_RESOURCE_REGISTRATION_OUTPUT_ARGUMENT_IS_NULL = 0x80D19005; +constexpr int ORBIS_GNM_ERROR_RESOURCE_REGISTRATION_OWNER_HANDLE_INVALID = 0x80D19006; +constexpr int ORBIS_GNM_ERROR_RESOURCE_REGISTRATION_RESOURCE_HANDLE_INVALID = 0x80D19007; +constexpr int ORBIS_GNM_ERROR_RESOURCE_REGISTRATION_RESOURCE_TYPE_INVALID = 0x80D19008; +constexpr int ORBIS_GNM_ERROR_RESOURCE_REGISTRATION_GDS_RESOURCE_TYPE_INVALID = 0x80D19009; +constexpr int ORBIS_GNM_ERROR_RESOURCE_REGISTRATION_RESOURCE_SIZE_INVALID = 0x80D1900A; +constexpr int ORBIS_GNM_ERROR_RESOURCE_REGISTRATION_RESOURCE_ADDRESS_IS_NULL = 0x80D1900B; +constexpr int ORBIS_GNM_ERROR_RESOURCE_REGISTRATION_GDS_OFFSET_INVALID = 0x80D1900C; +constexpr int ORBIS_GNM_ERROR_RESOURCE_REGISTRATION_RESOURCE_NAME_IS_NULL = 0x80D1900D; +constexpr int ORBIS_GNM_ERROR_RESOURCE_REGISTRATION_OWNER_NAME_IS_NULL = 0x80D1900E; +constexpr int ORBIS_GNM_ERROR_RESOURCE_REGISTRATION_FIND_CALLBACK_IS_NULL = 0x80D1900F; +constexpr int ORBIS_GNM_ERROR_RESOURCE_REGISTRATION_RESOURCE_IS_NOT_SHADER = 0x80D19010; +constexpr int ORBIS_GNM_ERROR_RESOURCE_REGISTRATION_USER_MEMORY_PARAM_IS_NULL = 0x80D19011; +constexpr int ORBIS_GNM_ERROR_RESOURCE_REGISTRATION_USER_MEMORY_PARAM_NOT_ALIGNED = 0x80D19012; +constexpr int ORBIS_GNM_ERROR_RESOURCE_REGISTRATION_INVALID_NAME_LENGTH_PARAM = 0x80D19013; +constexpr int ORBIS_GNM_ERROR_RESOURCE_REGISTRATION_INVALID_SIZE_PARAM = 0x80D19014; +constexpr int ORBIS_GNM_ERROR_RESOURCE_REGISTRATION_INVALID_NUM_RESOURCES_PARAM = 0x80D19015; +constexpr int ORBIS_GNM_ERROR_RESOURCE_REGISTRATION_INTERNAL = 0x80D19FFF; +constexpr int ORBIS_GNM_ERROR_GET_GPU_INFO_PARAMETER_NULL = 0x80D1B000; +constexpr int ORBIS_GNM_ERROR_GET_GPU_INFO_FAILED = 0x80D1B001; +constexpr int ORBIS_GNM_ERROR_GET_GPU_INFO_PARAMETER_INVALID = 0x80D1B002; +constexpr int ORBIS_GNM_ERROR_FAILURE = 0x8EEE00FF; diff --git a/src/core/libraries/gnmdriver/gnmdriver.cpp b/src/core/libraries/gnmdriver/gnmdriver.cpp index c2ee6d592..6b8b070b8 100644 --- a/src/core/libraries/gnmdriver/gnmdriver.cpp +++ b/src/core/libraries/gnmdriver/gnmdriver.cpp @@ -1,6 +1,9 @@ // SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later +#include "gnm_error.h" +#include "gnmdriver.h" + #include "common/assert.h" #include "common/config.h" #include "common/debug.h" @@ -9,7 +12,6 @@ #include "common/slot_vector.h" #include "core/address_space.h" #include "core/libraries/error_codes.h" -#include "core/libraries/gnmdriver/gnmdriver.h" #include "core/libraries/kernel/libkernel.h" #include "core/libraries/libs.h" #include "core/libraries/videoout/video_out.h" @@ -55,6 +57,10 @@ static constexpr auto HwInitPacketSize = 0x100u; // clang-format off static constexpr std::array InitSequence{ + // A fake preamble to mimic context reset sent by FW + 0xc0001200u, 0u, // IT_CLEAR_STATE + + // Actual init state sequence 0xc0017600u, 0x216u, 0xffffffffu, 0xc0017600u, 0x217u, 0xffffffffu, 0xc0017600u, 0x215u, 0u, @@ -94,9 +100,13 @@ static constexpr std::array InitSequence{ 0xc0036900u, 0x295u, 0x100u, 0x100u, 4u, 0xc0017900u, 0x200u, 0xe0000000u, }; -static_assert(InitSequence.size() == 0x73); +static_assert(InitSequence.size() == 0x73 + 2); static constexpr std::array InitSequence175{ + // A fake preamble to mimic context reset sent by FW + 0xc0001200u, 0u, // IT_CLEAR_STATE + + // Actual init state sequence 0xc0017600u, 0x216u, 0xffffffffu, 0xc0017600u, 0x217u, 0xffffffffu, 0xc0017600u, 0x215u, 0u, @@ -136,9 +146,13 @@ static constexpr std::array InitSequence175{ 0xc0036900u, 0x295u, 0x100u, 0x100u, 4u, 0xc0017900u, 0x200u, 0xe0000000u, }; -static_assert(InitSequence175.size() == 0x73); +static_assert(InitSequence175.size() == 0x73 + 2); static constexpr std::array InitSequence200{ + // A fake preamble to mimic context reset sent by FW + 0xc0001200u, 0u, // IT_CLEAR_STATE + + // Actual init state sequence 0xc0017600u, 0x216u, 0xffffffffu, 0xc0017600u, 0x217u, 0xffffffffu, 0xc0017600u, 0x215u, 0u, @@ -179,9 +193,13 @@ static constexpr std::array InitSequence200{ 0xc0036900u, 0x295u, 0x100u, 0x100u, 4u, 0xc0017900u, 0x200u, 0xe0000000u, }; -static_assert(InitSequence200.size() == 0x76); +static_assert(InitSequence200.size() == 0x76 + 2); static constexpr std::array InitSequence350{ + // A fake preamble to mimic context reset sent by FW + 0xc0001200u, 0u, // IT_CLEAR_STATE + + // Actual init state sequence 0xc0017600u, 0x216u, 0xffffffffu, 0xc0017600u, 0x217u, 0xffffffffu, 0xc0017600u, 0x215u, 0u, @@ -224,7 +242,7 @@ static constexpr std::array InitSequence350{ 0xc0017900u, 0x200u, 0xe0000000u, 0xc0016900u, 0x2aau, 0xffu, }; -static_assert(InitSequence350.size() == 0x7c); +static_assert(InitSequence350.size() == 0x7c + 2); static constexpr std::array CtxInitSequence{ 0xc0012800u, 0x80000000u, 0x80000000u, @@ -735,11 +753,11 @@ u32 PS4_SYSV_ABI sceGnmDrawInitDefaultHardwareState(u32* cmdbuf, u32 size) { cmdbuf = ClearContextState(cmdbuf); } - std::memcpy(cmdbuf, InitSequence.data(), InitSequence.size() * 4); - cmdbuf += InitSequence.size(); + std::memcpy(cmdbuf, &InitSequence[2], (InitSequence.size() - 2) * 4); + cmdbuf += InitSequence.size() - 2; const auto cmdbuf_left = - HwInitPacketSize - InitSequence.size() - (clear_state ? 0xc : 0) - 1; + HwInitPacketSize - (InitSequence.size() - 2) - (clear_state ? 0xc : 0) - 1; cmdbuf = WriteHeader(cmdbuf, cmdbuf_left); cmdbuf = WriteBody(cmdbuf, 0u); @@ -757,10 +775,10 @@ u32 PS4_SYSV_ABI sceGnmDrawInitDefaultHardwareState175(u32* cmdbuf, u32 size) { } cmdbuf = ClearContextState(cmdbuf); - std::memcpy(cmdbuf, InitSequence175.data(), InitSequence175.size() * 4); - cmdbuf += InitSequence175.size(); + std::memcpy(cmdbuf, &InitSequence175[2], (InitSequence175.size() - 2) * 4); + cmdbuf += InitSequence175.size() - 2; - constexpr auto cmdbuf_left = HwInitPacketSize - InitSequence175.size() - 0xc - 1; + constexpr auto cmdbuf_left = HwInitPacketSize - (InitSequence175.size() - 2) - 0xc - 1; WriteTrailingNop(cmdbuf); return HwInitPacketSize; @@ -778,11 +796,11 @@ u32 PS4_SYSV_ABI sceGnmDrawInitDefaultHardwareState200(u32* cmdbuf, u32 size) { cmdbuf = ClearContextState(cmdbuf); } - std::memcpy(cmdbuf, InitSequence200.data(), InitSequence200.size() * 4); - cmdbuf += InitSequence200.size(); + std::memcpy(cmdbuf, &InitSequence200[2], (InitSequence200.size() - 2) * 4); + cmdbuf += InitSequence200.size() - 2; const auto cmdbuf_left = - HwInitPacketSize - InitSequence200.size() - (clear_state ? 0xc : 0) - 1; + HwInitPacketSize - (InitSequence200.size() - 2) - (clear_state ? 0xc : 0) - 1; cmdbuf = WriteHeader(cmdbuf, cmdbuf_left); cmdbuf = WriteBody(cmdbuf, 0u); @@ -804,11 +822,11 @@ u32 PS4_SYSV_ABI sceGnmDrawInitDefaultHardwareState350(u32* cmdbuf, u32 size) { cmdbuf = ClearContextState(cmdbuf); } - std::memcpy(cmdbuf, InitSequence350.data(), InitSequence350.size() * 4); - cmdbuf += InitSequence350.size(); + std::memcpy(cmdbuf, &InitSequence350[2], (InitSequence350.size() - 2) * 4); + cmdbuf += InitSequence350.size() - 2; const auto cmdbuf_left = - HwInitPacketSize - InitSequence350.size() - (clear_state ? 0xc : 0) - 1; + HwInitPacketSize - (InitSequence350.size() - 2) - (clear_state ? 0xc : 0) - 1; cmdbuf = WriteHeader(cmdbuf, cmdbuf_left); cmdbuf = WriteBody(cmdbuf, 0u); @@ -1743,7 +1761,7 @@ s32 PS4_SYSV_ABI sceGnmSetVsShader(u32* cmdbuf, u32 size, const u32* vs_regs, u3 return -1; } - const u32 var = shader_modifier == 0 ? vs_regs[2] : (vs_regs[2] & 0xfcfffc3f | shader_modifier); + const u32 var = shader_modifier == 0 ? vs_regs[2] : (vs_regs[2] & 0xfcfffc3f) | shader_modifier; cmdbuf = PM4CmdSetData::SetShReg(cmdbuf, 0x48u, vs_regs[0], 0u); // SPI_SHADER_PGM_LO_VS cmdbuf = PM4CmdSetData::SetShReg(cmdbuf, 0x4au, var, vs_regs[3]); // SPI_SHADER_PGM_RSRC1_VS cmdbuf = PM4CmdSetData::SetContextReg(cmdbuf, 0x207u, vs_regs[6]); // PA_CL_VS_OUT_CNTL diff --git a/src/core/libraries/kernel/file_system.cpp b/src/core/libraries/kernel/file_system.cpp index 990b11d69..f7f58df59 100644 --- a/src/core/libraries/kernel/file_system.cpp +++ b/src/core/libraries/kernel/file_system.cpp @@ -538,7 +538,7 @@ void fileSystemSymbolsRegister(Core::Loader::SymbolsResolver* sym) { // openOrbis (to check if it is valid out of OpenOrbis LIB_FUNCTION("6c3rCVE-fTU", "libkernel", 1, "libkernel", 1, 1, - posix_open); // _open shoudld be equal to open function + posix_open); // _open should be equal to open function } } // namespace Libraries::Kernel diff --git a/src/core/libraries/kernel/memory_management.cpp b/src/core/libraries/kernel/memory_management.cpp index 826d47973..3fc837d96 100644 --- a/src/core/libraries/kernel/memory_management.cpp +++ b/src/core/libraries/kernel/memory_management.cpp @@ -15,7 +15,8 @@ namespace Libraries::Kernel { u64 PS4_SYSV_ABI sceKernelGetDirectMemorySize() { LOG_WARNING(Kernel_Vmm, "called"); - return SCE_KERNEL_MAIN_DMEM_SIZE; + const auto* memory = Core::Memory::Instance(); + return memory->GetTotalDirectSize(); } int PS4_SYSV_ABI sceKernelAllocateDirectMemory(s64 searchStart, s64 searchEnd, u64 len, @@ -52,8 +53,8 @@ int PS4_SYSV_ABI sceKernelAllocateDirectMemory(s64 searchStart, s64 searchEnd, u s32 PS4_SYSV_ABI sceKernelAllocateMainDirectMemory(size_t len, size_t alignment, int memoryType, s64* physAddrOut) { - return sceKernelAllocateDirectMemory(0, SCE_KERNEL_MAIN_DMEM_SIZE, len, alignment, memoryType, - physAddrOut); + const auto searchEnd = static_cast(sceKernelGetDirectMemorySize()); + return sceKernelAllocateDirectMemory(0, searchEnd, len, alignment, memoryType, physAddrOut); } s32 PS4_SYSV_ABI sceKernelCheckedReleaseDirectMemory(u64 start, size_t len) { @@ -75,19 +76,28 @@ s32 PS4_SYSV_ABI sceKernelAvailableDirectMemorySize(u64 searchStart, u64 searchE LOG_WARNING(Kernel_Vmm, "called searchStart = {:#x}, searchEnd = {:#x}, alignment = {:#x}", searchStart, searchEnd, alignment); - if (searchEnd <= searchStart) { + if (physAddrOut == nullptr || sizeOut == nullptr) { return ORBIS_KERNEL_ERROR_EINVAL; } - if (searchEnd > SCE_KERNEL_MAIN_DMEM_SIZE) { + if (searchEnd > sceKernelGetDirectMemorySize()) { return ORBIS_KERNEL_ERROR_EINVAL; } + if (searchEnd <= searchStart) { + return ORBIS_KERNEL_ERROR_ENOMEM; + } auto* memory = Core::Memory::Instance(); - PAddr physAddr; - s32 result = - memory->DirectQueryAvailable(searchStart, searchEnd, alignment, &physAddr, sizeOut); + PAddr physAddr{}; + size_t size{}; + s32 result = memory->DirectQueryAvailable(searchStart, searchEnd, alignment, &physAddr, &size); + + if (size == 0) { + return ORBIS_KERNEL_ERROR_ENOMEM; + } + *physAddrOut = static_cast(physAddr); + *sizeOut = size; return result; } @@ -245,46 +255,56 @@ int PS4_SYSV_ABI sceKernelMunmap(void* addr, size_t len); s32 PS4_SYSV_ABI sceKernelBatchMap2(OrbisKernelBatchMapEntry* entries, int numEntries, int* numEntriesOut, int flags) { + int result = ORBIS_OK; int processed = 0; - int result = 0; - for (int i = 0; i < numEntries; i++) { + for (int i = 0; i < numEntries; i++, processed++) { if (entries == nullptr || entries[i].length == 0 || entries[i].operation > 4) { result = ORBIS_KERNEL_ERROR_EINVAL; break; // break and assign a value to numEntriesOut. } - if (entries[i].operation == MemoryOpTypes::ORBIS_KERNEL_MAP_OP_MAP_DIRECT) { + switch (entries[i].operation) { + case MemoryOpTypes::ORBIS_KERNEL_MAP_OP_MAP_DIRECT: { result = sceKernelMapNamedDirectMemory(&entries[i].start, entries[i].length, entries[i].protection, flags, static_cast(entries[i].offset), 0, ""); - LOG_INFO( - Kernel_Vmm, - "BatchMap: entry = {}, operation = {}, len = {:#x}, offset = {:#x}, type = {}, " - "result = {}", - i, entries[i].operation, entries[i].length, entries[i].offset, (u8)entries[i].type, - result); - - if (result == 0) - processed++; - } else if (entries[i].operation == MemoryOpTypes::ORBIS_KERNEL_MAP_OP_UNMAP) { + LOG_INFO(Kernel_Vmm, + "entry = {}, operation = {}, len = {:#x}, offset = {:#x}, type = {}, " + "result = {}", + i, entries[i].operation, entries[i].length, entries[i].offset, + (u8)entries[i].type, result); + break; + } + case MemoryOpTypes::ORBIS_KERNEL_MAP_OP_UNMAP: { result = sceKernelMunmap(entries[i].start, entries[i].length); - LOG_INFO(Kernel_Vmm, "BatchMap: entry = {}, operation = {}, len = {:#x}, result = {}", - i, entries[i].operation, entries[i].length, result); - - if (result == 0) - processed++; - } else if (entries[i].operation == MemoryOpTypes::ORBIS_KERNEL_MAP_OP_MAP_FLEXIBLE) { + LOG_INFO(Kernel_Vmm, "entry = {}, operation = {}, len = {:#x}, result = {}", i, + entries[i].operation, entries[i].length, result); + break; + } + case MemoryOpTypes::ORBIS_KERNEL_MAP_OP_MAP_FLEXIBLE: { result = sceKernelMapNamedFlexibleMemory(&entries[i].start, entries[i].length, entries[i].protection, flags, ""); LOG_INFO(Kernel_Vmm, - "BatchMap: entry = {}, operation = {}, len = {:#x}, type = {}, " + "entry = {}, operation = {}, len = {:#x}, type = {}, " "result = {}", i, entries[i].operation, entries[i].length, (u8)entries[i].type, result); + break; + } + case MemoryOpTypes::ORBIS_KERNEL_MAP_OP_TYPE_PROTECT: { + // By now, ignore protection and log it instead + LOG_WARNING(Kernel_Vmm, + "entry = {}, operation = {}, len = {:#x}, type = {} " + "is UNSUPPORTED and skipped", + i, entries[i].operation, entries[i].length, (u8)entries[i].type); + break; + } + default: { + UNREACHABLE(); + } + } - if (result == 0) - processed++; - } else { - UNREACHABLE_MSG("called: Unimplemented Operation = {}", entries[i].operation); + if (result != ORBIS_OK) { + break; } } if (numEntriesOut != NULL) { // can be zero. do not return an error code. diff --git a/src/core/libraries/kernel/memory_management.h b/src/core/libraries/kernel/memory_management.h index 378449cc5..9a447fe8b 100644 --- a/src/core/libraries/kernel/memory_management.h +++ b/src/core/libraries/kernel/memory_management.h @@ -6,7 +6,7 @@ #include "common/bit_field.h" #include "common/types.h" -constexpr u64 SCE_KERNEL_MAIN_DMEM_SIZE = 6_GB; // ~ 6GB +constexpr u64 SCE_KERNEL_MAIN_DMEM_SIZE = 5056_MB; // ~ 5GB namespace Libraries::Kernel { diff --git a/src/core/libraries/kernel/thread_management.cpp b/src/core/libraries/kernel/thread_management.cpp index 567fff184..605d0d29f 100644 --- a/src/core/libraries/kernel/thread_management.cpp +++ b/src/core/libraries/kernel/thread_management.cpp @@ -2,8 +2,8 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include +#include #include -#include #include "common/alignment.h" #include "common/assert.h" #include "common/error.h" @@ -510,23 +510,24 @@ int PS4_SYSV_ABI scePthreadMutexattrInit(ScePthreadMutexattr* attr) { int PS4_SYSV_ABI scePthreadMutexattrSettype(ScePthreadMutexattr* attr, int type) { int ptype = PTHREAD_MUTEX_DEFAULT; switch (type) { - case 1: + case ORBIS_PTHREAD_MUTEX_ERRORCHECK: ptype = PTHREAD_MUTEX_ERRORCHECK; break; - case 2: + case ORBIS_PTHREAD_MUTEX_RECURSIVE: ptype = PTHREAD_MUTEX_RECURSIVE; break; - case 3: - case 4: + case ORBIS_PTHREAD_MUTEX_NORMAL: + case ORBIS_PTHREAD_MUTEX_ADAPTIVE: ptype = PTHREAD_MUTEX_NORMAL; break; default: - UNREACHABLE_MSG("Invalid type: {}", type); + return SCE_KERNEL_ERROR_EINVAL; } int result = pthread_mutexattr_settype(&(*attr)->pth_mutex_attr, ptype); + ASSERT(result == 0); - return result == 0 ? SCE_OK : SCE_KERNEL_ERROR_EINVAL; + return SCE_OK; } int PS4_SYSV_ABI scePthreadMutexattrSetprotocol(ScePthreadMutexattr* attr, int protocol) { @@ -1373,90 +1374,97 @@ int PS4_SYSV_ABI posix_pthread_detach(ScePthread thread) { return pthread_detach(thread->pth); } -int PS4_SYSV_ABI posix_sem_init(sem_t* sem, int pshared, unsigned int value) { - int result = sem_init(sem, pshared, value); - if (result == -1) { - SetPosixErrno(errno); +int PS4_SYSV_ABI posix_sem_init(PthreadSemInternal** sem, int pshared, unsigned int value) { + if (value > ORBIS_KERNEL_SEM_VALUE_MAX) { + SetPosixErrno(EINVAL); + return -1; } - return result; + if (sem != nullptr) { + *sem = new PthreadSemInternal{ + .semaphore = std::counting_semaphore{value}, + .value = {static_cast(value)}, + }; + } + return 0; } -int PS4_SYSV_ABI posix_sem_wait(sem_t* sem) { - int result = sem_wait(sem); - if (result == -1) { - SetPosixErrno(errno); +int PS4_SYSV_ABI posix_sem_wait(PthreadSemInternal** sem) { + if (sem == nullptr || *sem == nullptr) { + SetPosixErrno(EINVAL); + return -1; } - return result; + (*sem)->semaphore.acquire(); + --(*sem)->value; + return 0; } -int PS4_SYSV_ABI posix_sem_trywait(sem_t* sem) { - int result = sem_trywait(sem); - if (result == -1) { - SetPosixErrno(errno); +int PS4_SYSV_ABI posix_sem_trywait(PthreadSemInternal** sem) { + if (sem == nullptr || *sem == nullptr) { + SetPosixErrno(EINVAL); + return -1; } - return result; + if (!(*sem)->semaphore.try_acquire()) { + SetPosixErrno(EAGAIN); + return -1; + } + --(*sem)->value; + return 0; } -#ifndef HAVE_SEM_TIMEDWAIT -int sem_timedwait(sem_t* sem, const struct timespec* abstime) { - int rc; - while ((rc = sem_trywait(sem)) == EAGAIN) { - struct timespec curr_time; - clock_gettime(CLOCK_REALTIME, &curr_time); - - s64 remaining_ns = 0; - remaining_ns += - (static_cast(abstime->tv_sec) - static_cast(curr_time.tv_sec)) * 1000000000L; - remaining_ns += static_cast(abstime->tv_nsec) - static_cast(curr_time.tv_nsec); - - if (remaining_ns <= 0) { - return ETIMEDOUT; - } - - struct timespec sleep_time; - sleep_time.tv_sec = 0; - if (remaining_ns < 5000000L) { - sleep_time.tv_nsec = remaining_ns; - } else { - sleep_time.tv_nsec = 5000000; - } - - nanosleep(&sleep_time, nullptr); +int PS4_SYSV_ABI posix_sem_timedwait(PthreadSemInternal** sem, const timespec* t) { + if (sem == nullptr || *sem == nullptr) { + SetPosixErrno(EINVAL); + return -1; } - return rc; -} -#endif -int PS4_SYSV_ABI posix_sem_timedwait(sem_t* sem, const timespec* t) { - int result = sem_timedwait(sem, t); - if (result == -1) { - SetPosixErrno(errno); + using std::chrono::duration_cast; + using std::chrono::nanoseconds; + using std::chrono::seconds; + using std::chrono::system_clock; + + const system_clock::time_point time{ + duration_cast(seconds{t->tv_sec} + nanoseconds{t->tv_nsec})}; + if (!(*sem)->semaphore.try_acquire_until(time)) { + SetPosixErrno(ETIMEDOUT); + return -1; } - return result; + --(*sem)->value; + return 0; } -int PS4_SYSV_ABI posix_sem_post(sem_t* sem) { - int result = sem_post(sem); - if (result == -1) { - SetPosixErrno(errno); +int PS4_SYSV_ABI posix_sem_post(PthreadSemInternal** sem) { + if (sem == nullptr || *sem == nullptr) { + SetPosixErrno(EINVAL); + return -1; } - return result; + if ((*sem)->value == ORBIS_KERNEL_SEM_VALUE_MAX) { + SetPosixErrno(EOVERFLOW); + return -1; + } + ++(*sem)->value; + (*sem)->semaphore.release(); + return 0; } -int PS4_SYSV_ABI posix_sem_destroy(sem_t* sem) { - int result = sem_destroy(sem); - if (result == -1) { - SetPosixErrno(errno); +int PS4_SYSV_ABI posix_sem_destroy(PthreadSemInternal** sem) { + if (sem == nullptr || *sem == nullptr) { + SetPosixErrno(EINVAL); + return -1; } - return result; + delete *sem; + *sem = nullptr; + return 0; } -int PS4_SYSV_ABI posix_sem_getvalue(sem_t* sem, int* sval) { - int result = sem_getvalue(sem, sval); - if (result == -1) { - SetPosixErrno(errno); +int PS4_SYSV_ABI posix_sem_getvalue(PthreadSemInternal** sem, int* sval) { + if (sem == nullptr || *sem == nullptr) { + SetPosixErrno(EINVAL); + return -1; } - return result; + if (sval) { + *sval = (*sem)->value; + } + return 0; } int PS4_SYSV_ABI posix_pthread_attr_getstacksize(const pthread_attr_t* attr, size_t* size) { diff --git a/src/core/libraries/kernel/thread_management.h b/src/core/libraries/kernel/thread_management.h index c5935275f..27cd7929a 100644 --- a/src/core/libraries/kernel/thread_management.h +++ b/src/core/libraries/kernel/thread_management.h @@ -5,6 +5,7 @@ #include #include +#include #include #include #include @@ -19,6 +20,12 @@ namespace Libraries::Kernel { constexpr int ORBIS_KERNEL_PRIO_FIFO_DEFAULT = 700; constexpr int ORBIS_KERNEL_PRIO_FIFO_HIGHEST = 256; constexpr int ORBIS_KERNEL_PRIO_FIFO_LOWEST = 767; +constexpr int ORBIS_KERNEL_SEM_VALUE_MAX = 0x7FFFFFFF; + +constexpr int ORBIS_PTHREAD_MUTEX_ERRORCHECK = 1; +constexpr int ORBIS_PTHREAD_MUTEX_RECURSIVE = 2; +constexpr int ORBIS_PTHREAD_MUTEX_NORMAL = 3; +constexpr int ORBIS_PTHREAD_MUTEX_ADAPTIVE = 4; struct PthreadInternal; struct PthreadAttrInternal; @@ -104,6 +111,11 @@ struct PthreadRwInternal { std::string name; }; +struct PthreadSemInternal { + std::counting_semaphore semaphore; + std::atomic value; +}; + class PThreadPool { public: ScePthread Create(); diff --git a/src/core/libraries/kernel/time_management.cpp b/src/core/libraries/kernel/time_management.cpp index 214f039b4..d01b0c83f 100644 --- a/src/core/libraries/kernel/time_management.cpp +++ b/src/core/libraries/kernel/time_management.cpp @@ -3,6 +3,7 @@ #include #include "common/assert.h" +#include "common/debug.h" #include "common/native_clock.h" #include "core/libraries/error_codes.h" #include "core/libraries/kernel/time_management.h" @@ -30,7 +31,8 @@ u64 PS4_SYSV_ABI sceKernelGetTscFrequency() { } u64 PS4_SYSV_ABI sceKernelGetProcessTime() { - return clock->GetProcessTimeUS(); + // TODO: this timer should support suspends, so initial ptc needs to be updated on wake up + return clock->GetTimeUS(initial_ptc); } u64 PS4_SYSV_ABI sceKernelGetProcessTimeCounter() { diff --git a/src/core/libraries/ngs2/ngs2_error.h b/src/core/libraries/ngs2/ngs2_error.h index 254ae26e6..2773168e2 100644 --- a/src/core/libraries/ngs2/ngs2_error.h +++ b/src/core/libraries/ngs2/ngs2_error.h @@ -3,54 +3,116 @@ #pragma once -constexpr int ORBIS_NGS2_ERROR_INVALID_PARAMETERS = 0x804A0001; -constexpr int ORBIS_NGS2_ERROR_INVALID_MAXIMUM_GRAIN_SAMPLES = 0x804A0050; -constexpr int ORBIS_NGS2_ERROR_INVALID_GRAIN_SAMPLES = 0x804A0051; -constexpr int ORBIS_NGS2_ERROR_INVALID_CHANNELS = 0x804A0052; -constexpr int ORBIS_NGS2_ERROR_INVALD_ADDRESS = 0x804A0053; -constexpr int ORBIS_NGS2_ERROR_INVALD_SIZE = 0x804A0054; +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_RACK_OPTION_MAX_MATRICES = 0x804A0100; -constexpr int ORBIS_NGS2_ERROR_INVALID_RACK_OPTION_MAX_PORTS = 0x804A0101; -constexpr int ORBIS_NGS2_ERROR_INVALID_RACK_OPTION_MAX_INPUT_DELAY_BLOCKS = 0x804A0102; -constexpr int ORBIS_NGS2_ERROR_INVALID_MATRIX_LEVELS = 0x804A0150; -constexpr int ORBIS_NGS2_ERROR_SAMPLER_WAVEFORM_TERMINATED = 0x804A0151; -constexpr int ORBIS_NGS2_ERROR_INVALID_ENVELOPE_POINTS = 0x804A0152; +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_SAMPLER_WAVEFORM_BLOCK_ADDRESS = 0x804A0154; +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_ALIGNMENT = 0x804A0208; +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_VERIFY_FAILED = 0x804A020B; -constexpr int ORBIS_NGS2_ERROR_MODULE_PLAYER_DATA_EMPTY = 0x804A020C; +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_VOICE_EVENT = 0x804A0303; -constexpr int ORBIS_NGS2_ERROR_INVALID_VOICE_PORT_INDEX = 0x804A0304; -constexpr int ORBIS_NGS2_ERROR_INVALID_VOICE_INPUT_OR_RACK_OCCUPIED = 0x804A0305; -constexpr int ORBIS_NGS2_ERROR_INVALID_CONTROL_ID = 0x804A0308; -constexpr int ORBIS_NGS2_ERROR_INVALID_VOICE_CONTROL_PARAMETER = 0x804A0309; -constexpr int ORBIS_NGS2_ERROR_INVALID_PARAMETER_SIZE = 0x804A030A; +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_INVALID_SAMPLER_WAVEFORM_DATA = 0x804A0400; -constexpr int ORBIS_NGS2_ERROR_INVALID_SAMPLER_WAVEFORM_FORMAT = 0x804A0401; -constexpr int ORBIS_NGS2_ERROR_INVALID_SAMPLER_WAVEFORM_TYPE_NO_ATRAC9_DECODERS = 0x804A0402; -constexpr int ORBIS_NGS2_ERROR_INVALID_SAMPLER_ATRAC9_CONFIG_DATA = 0x804A0403; -constexpr int ORBIS_NGS2_ERROR_INVALID_SAMPLER_WAVEFORM_SAMPLE_RATE = 0x804A0404; -constexpr int ORBIS_NGS2_ERROR_INVALID_SAMPLER_WAVEFORM_FRAME = 0x804A0405; -constexpr int ORBIS_NGS2_ERROR_INVALID_SAMPLER_WAVEFORM_ADDRESS = 0x804A0406; +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_CUT_OFF_FREQUENCY = 0x804A0603; -constexpr int ORBIS_NGS2_ERROR_INVALID_MATRIX_INDEX_OR_TYPE = 0x804A0700; \ No newline at end of file +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_impl.cpp b/src/core/libraries/ngs2/ngs2_impl.cpp index 50c62f5e4..793435d83 100644 --- a/src/core/libraries/ngs2/ngs2_impl.cpp +++ b/src/core/libraries/ngs2/ngs2_impl.cpp @@ -138,13 +138,13 @@ s32 Ngs2::SystemSetupCore(StackBuffer* buf, SystemOptions* options, Ngs2Handle** // Validate maxGrainSamples if (maxGrainSamples < 64 || maxGrainSamples > 1024 || (maxGrainSamples & 0x3F) != 0) { LOG_ERROR(Lib_Ngs2, "Invalid system option (maxGrainSamples={},x64)", maxGrainSamples); - return ORBIS_NGS2_ERROR_INVALID_MAXIMUM_GRAIN_SAMPLES; + return ORBIS_NGS2_ERROR_INVALID_MAX_GRAIN_SAMPLES; } // Validate numGrainSamples if (numGrainSamples < 64 || numGrainSamples > 1024 || (numGrainSamples & 0x3F) != 0) { LOG_ERROR(Lib_Ngs2, "Invalid system option (numGrainSamples={},x64)", numGrainSamples); - return ORBIS_NGS2_ERROR_INVALID_GRAIN_SAMPLES; + return ORBIS_NGS2_ERROR_INVALID_NUM_GRAIN_SAMPLES; } // Validate sampleRate diff --git a/src/core/libraries/pad/pad.cpp b/src/core/libraries/pad/pad.cpp index 305b20bd6..a0abfdf73 100644 --- a/src/core/libraries/pad/pad.cpp +++ b/src/core/libraries/pad/pad.cpp @@ -4,6 +4,7 @@ // Generated By moduleGenerator #include #include +#include "common/config.h" #include "common/logging/log.h" #include "core/libraries/error_codes.h" #include "core/libraries/libs.h" @@ -25,6 +26,9 @@ int PS4_SYSV_ABI scePadConnectPort() { int PS4_SYSV_ABI scePadDeviceClassGetExtendedInformation( s32 handle, OrbisPadDeviceClassExtendedInformation* pExtInfo) { LOG_ERROR(Lib_Pad, "(STUBBED) called"); + if (Config::getUseSpecialPad()) { + pExtInfo->deviceClass = (OrbisPadDeviceClass)Config::getSpecialPadClass(); + } return ORBIS_OK; } @@ -107,6 +111,10 @@ int PS4_SYSV_ABI scePadGetControllerInformation(s32 handle, OrbisPadControllerIn pInfo->connectedCount = 1; pInfo->connected = true; pInfo->deviceClass = ORBIS_PAD_DEVICE_CLASS_STANDARD; + if (Config::getUseSpecialPad()) { + pInfo->connectionType = ORBIS_PAD_PORT_TYPE_SPECIAL; + pInfo->deviceClass = (OrbisPadDeviceClass)Config::getSpecialPadClass(); + } return SCE_OK; } @@ -239,11 +247,26 @@ int PS4_SYSV_ABI scePadMbusTerm() { int PS4_SYSV_ABI scePadOpen(s32 userId, s32 type, s32 index, const OrbisPadOpenParam* pParam) { LOG_INFO(Lib_Pad, "(DUMMY) called user_id = {} type = {} index = {}", userId, type, index); + if (Config::getUseSpecialPad()) { + if (type != ORBIS_PAD_PORT_TYPE_SPECIAL) + return ORBIS_PAD_ERROR_DEVICE_NOT_CONNECTED; + } else { + if (type != ORBIS_PAD_PORT_TYPE_STANDARD) + return ORBIS_PAD_ERROR_DEVICE_NOT_CONNECTED; + } return 1; // dummy } -int PS4_SYSV_ABI scePadOpenExt() { +int PS4_SYSV_ABI scePadOpenExt(s32 userId, s32 type, s32 index, + const OrbisPadOpenExtParam* pParam) { LOG_ERROR(Lib_Pad, "(STUBBED) called"); + if (Config::getUseSpecialPad()) { + if (type != ORBIS_PAD_PORT_TYPE_SPECIAL) + return ORBIS_PAD_ERROR_DEVICE_NOT_CONNECTED; + } else { + if (type != ORBIS_PAD_PORT_TYPE_STANDARD) + return ORBIS_PAD_ERROR_DEVICE_NOT_CONNECTED; + } return 1; // dummy } @@ -286,12 +309,13 @@ int PS4_SYSV_ABI scePadRead(s32 handle, OrbisPadData* pData, s32 num) { pData[i].angularVelocity.x = 0.0f; pData[i].angularVelocity.y = 0.0f; pData[i].angularVelocity.z = 0.0f; - pData[i].touchData.touchNum = 0; - pData[i].touchData.touch[0].x = 0; - pData[i].touchData.touch[0].y = 0; + pData[i].touchData.touchNum = + (states[i].touchpad[0].state ? 1 : 0) + (states[i].touchpad[1].state ? 1 : 0); + pData[i].touchData.touch[0].x = states[i].touchpad[0].x; + pData[i].touchData.touch[0].y = states[i].touchpad[0].y; pData[i].touchData.touch[0].id = 1; - pData[i].touchData.touch[1].x = 0; - pData[i].touchData.touch[1].y = 0; + pData[i].touchData.touch[1].x = states[i].touchpad[1].x; + pData[i].touchData.touch[1].y = states[i].touchpad[1].y; pData[i].touchData.touch[1].id = 2; pData[i].connected = connected; pData[i].timestamp = states[i].time; diff --git a/src/core/libraries/pad/pad.h b/src/core/libraries/pad/pad.h index 3e9c14a17..b18bbc355 100644 --- a/src/core/libraries/pad/pad.h +++ b/src/core/libraries/pad/pad.h @@ -229,6 +229,13 @@ struct OrbisPadOpenParam { u8 reserve[8]; }; +struct OrbisPadOpenExtParam { + u16 vendorId; + u16 productId; + u16 productId_2; + u8 reserve[10]; +}; + struct OrbisPadLightBarParam { u8 r; u8 g; @@ -284,7 +291,7 @@ int PS4_SYSV_ABI scePadIsValidHandle(); int PS4_SYSV_ABI scePadMbusInit(); int PS4_SYSV_ABI scePadMbusTerm(); int PS4_SYSV_ABI scePadOpen(s32 userId, s32 type, s32 index, const OrbisPadOpenParam* pParam); -int PS4_SYSV_ABI scePadOpenExt(); +int PS4_SYSV_ABI scePadOpenExt(s32 userId, s32 type, s32 index, const OrbisPadOpenExtParam* pParam); int PS4_SYSV_ABI scePadOpenExt2(); int PS4_SYSV_ABI scePadOutputReport(); int PS4_SYSV_ABI scePadRead(s32 handle, OrbisPadData* pData, s32 num); diff --git a/src/core/libraries/random/random.cpp b/src/core/libraries/random/random.cpp index 8147c5183..f7cc3fd2c 100644 --- a/src/core/libraries/random/random.cpp +++ b/src/core/libraries/random/random.cpp @@ -1,14 +1,16 @@ // 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" -#include "random.h" namespace Libraries::Random { -s32 PS4_SYSV_ABI sceRandomGetRandomNumber(u8* buf, size_t size) { +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; diff --git a/src/core/libraries/random/random.h b/src/core/libraries/random/random.h index b5f87f877..7bb41f016 100644 --- a/src/core/libraries/random/random.h +++ b/src/core/libraries/random/random.h @@ -11,7 +11,7 @@ class SymbolsResolver; namespace Libraries::Random { constexpr int32_t SCE_RANDOM_MAX_SIZE = 64; -s32 PS4_SYSV_ABI sceRandomGetRandomNumber(u8* buf, size_t size); +s32 PS4_SYSV_ABI sceRandomGetRandomNumber(u8* buf, std::size_t size); void RegisterlibSceRandom(Core::Loader::SymbolsResolver* sym); } // namespace Libraries::Random \ No newline at end of file diff --git a/src/core/libraries/random/random_error.h b/src/core/libraries/random/random_error.h new file mode 100644 index 000000000..772316ae5 --- /dev/null +++ b/src/core/libraries/random/random_error.h @@ -0,0 +1,8 @@ +// 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/save_data/savedata.cpp b/src/core/libraries/save_data/savedata.cpp index d62e39f88..eb309183f 100644 --- a/src/core/libraries/save_data/savedata.cpp +++ b/src/core/libraries/save_data/savedata.cpp @@ -505,8 +505,11 @@ s32 saveDataMount(u32 user_id, char* dir_name, u32 mount_mode, ORBIS_SAVE_DATA_MOUNT_MODE_DESTRUCT_OFF: case ORBIS_SAVE_DATA_MOUNT_MODE_CREATE | ORBIS_SAVE_DATA_MOUNT_MODE_RDWR | ORBIS_SAVE_DATA_MOUNT_MODE_COPY_ICON: + case ORBIS_SAVE_DATA_MOUNT_MODE_CREATE | ORBIS_SAVE_DATA_MOUNT_MODE_COPY_ICON: case ORBIS_SAVE_DATA_MOUNT_MODE_CREATE | ORBIS_SAVE_DATA_MOUNT_MODE_DESTRUCT_OFF | - ORBIS_SAVE_DATA_MOUNT_MODE_COPY_ICON: { + ORBIS_SAVE_DATA_MOUNT_MODE_COPY_ICON: + case ORBIS_SAVE_DATA_MOUNT_MODE_CREATE | ORBIS_SAVE_DATA_MOUNT_MODE_RDWR | + ORBIS_SAVE_DATA_MOUNT_MODE_DESTRUCT_OFF | ORBIS_SAVE_DATA_MOUNT_MODE_COPY_ICON: { if (std::filesystem::exists(mount_dir)) { return ORBIS_SAVE_DATA_ERROR_EXISTS; } diff --git a/src/core/libraries/videoout/driver.cpp b/src/core/libraries/videoout/driver.cpp index dbbcb1def..09e9cef5b 100644 --- a/src/core/libraries/videoout/driver.cpp +++ b/src/core/libraries/videoout/driver.cpp @@ -96,7 +96,7 @@ int VideoOutDriver::RegisterBuffers(VideoOutPort* port, s32 startIndex, void* co } if (attribute->reserved0 != 0 || attribute->reserved1 != 0) { - LOG_ERROR(Lib_VideoOut, "Invalid reserved memebers"); + LOG_ERROR(Lib_VideoOut, "Invalid reserved members"); return ORBIS_VIDEO_OUT_ERROR_INVALID_VALUE; } if (attribute->aspect_ratio != 0) { diff --git a/src/core/libraries/videoout/video_out.cpp b/src/core/libraries/videoout/video_out.cpp index d13062cd4..a6c1a7623 100644 --- a/src/core/libraries/videoout/video_out.cpp +++ b/src/core/libraries/videoout/video_out.cpp @@ -185,14 +185,16 @@ s32 PS4_SYSV_ABI sceVideoOutGetFlipStatus(s32 handle, FlipStatus* status) { return ORBIS_VIDEO_OUT_ERROR_INVALID_HANDLE; } - std::unique_lock lock{port->port_mutex}; - *status = port->flip_status; + { + std::unique_lock lock{port->port_mutex}; + *status = port->flip_status; + } - LOG_INFO(Lib_VideoOut, - "count = {}, processTime = {}, tsc = {}, submitTsc = {}, flipArg = {}, gcQueueNum = " - "{}, flipPendingNum = {}, currentBuffer = {}", - status->count, status->processTime, status->tsc, status->submitTsc, status->flipArg, - status->gcQueueNum, status->flipPendingNum, status->currentBuffer); + LOG_TRACE(Lib_VideoOut, + "count = {}, processTime = {}, tsc = {}, submitTsc = {}, flipArg = {}, gcQueueNum = " + "{}, flipPendingNum = {}, currentBuffer = {}", + status->count, status->processTime, status->tsc, status->submitTsc, status->flipArg, + status->gcQueueNum, status->flipPendingNum, status->currentBuffer); return ORBIS_OK; } diff --git a/src/core/linker.cpp b/src/core/linker.cpp index d4a15825b..9783ad96f 100644 --- a/src/core/linker.cpp +++ b/src/core/linker.cpp @@ -68,11 +68,19 @@ void Linker::Execute() { } // Configure used flexible memory size. - // if (auto* mem_param = GetProcParam()->mem_param) { - // if (u64* flexible_size = mem_param->flexible_memory_size) { - // memory->SetTotalFlexibleSize(*flexible_size); - // } - // } + if (const auto* proc_param = GetProcParam()) { + if (proc_param->size >= + offsetof(OrbisProcParam, mem_param) + sizeof(OrbisKernelMemParam*)) { + if (const auto* mem_param = proc_param->mem_param) { + if (mem_param->size >= + offsetof(OrbisKernelMemParam, flexible_memory_size) + sizeof(u64*)) { + if (const auto* flexible_size = mem_param->flexible_memory_size) { + memory->SetupMemoryRegions(*flexible_size); + } + } + } + } + } // Init primary thread. Common::SetCurrentThreadName("GAME_MainThread"); @@ -168,7 +176,7 @@ void Linker::Relocate(Module* module) { auto sym_bind = sym.GetBind(); auto sym_type = sym.GetType(); auto sym_visibility = sym.GetVisibility(); - u64 symbol_vitrual_addr = 0; + u64 symbol_virtual_addr = 0; Loader::SymbolRecord symrec{}; switch (sym_type) { case STT_FUN: @@ -185,12 +193,12 @@ void Linker::Relocate(Module* module) { } if (sym_visibility != 0) { - LOG_INFO(Core_Linker, "symbol visilibity !=0"); + LOG_INFO(Core_Linker, "symbol visibility !=0"); } switch (sym_bind) { case STB_LOCAL: - symbol_vitrual_addr = rel_base_virtual_addr + sym.st_value; + symbol_virtual_addr = rel_base_virtual_addr + sym.st_value; module->SetRelaBit(bit_idx); break; case STB_GLOBAL: @@ -200,14 +208,14 @@ void Linker::Relocate(Module* module) { // Only set the rela bit if the symbol was actually resolved and not stubbed. module->SetRelaBit(bit_idx); } - symbol_vitrual_addr = symrec.virtual_address; + symbol_virtual_addr = symrec.virtual_address; break; } default: ASSERT_MSG(0, "unknown bind type {}", sym_bind); } - rel_is_resolved = (symbol_vitrual_addr != 0); - rel_value = (rel_is_resolved ? symbol_vitrual_addr + addend : 0); + rel_is_resolved = (symbol_virtual_addr != 0); + rel_value = (rel_is_resolved ? symbol_virtual_addr + addend : 0); rel_name = symrec.name; break; } diff --git a/src/core/memory.cpp b/src/core/memory.cpp index 552c4039c..2722c68a9 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp @@ -11,9 +11,11 @@ namespace Core { +constexpr u64 SCE_DEFAULT_FLEXIBLE_MEMORY_SIZE = 448_MB; + MemoryManager::MemoryManager() { - // Insert an area that covers direct memory physical block. - dmem_map.emplace(0, DirectMemoryArea{0, SCE_KERNEL_MAIN_DMEM_SIZE}); + // Set up the direct and flexible memory regions. + SetupMemoryRegions(SCE_DEFAULT_FLEXIBLE_MEMORY_SIZE); // Insert a virtual memory area that covers the entire area we manage. const VAddr system_managed_base = impl.SystemManagedVirtualBase(); @@ -35,6 +37,19 @@ MemoryManager::MemoryManager() { MemoryManager::~MemoryManager() = default; +void MemoryManager::SetupMemoryRegions(u64 flexible_size) { + total_flexible_size = flexible_size; + total_direct_size = SCE_KERNEL_MAIN_DMEM_SIZE - flexible_size; + + // Insert an area that covers direct memory physical block. + // Note that this should never be called after direct memory allocations have been made. + dmem_map.clear(); + dmem_map.emplace(0, DirectMemoryArea{0, total_direct_size}); + + LOG_INFO(Kernel_Vmm, "Configured memory regions: flexible size = {:#x}, direct size = {:#x}", + total_flexible_size, total_direct_size); +} + PAddr MemoryManager::Allocate(PAddr search_start, PAddr search_end, size_t size, u64 alignment, int memory_type) { std::scoped_lock lk{mutex}; @@ -42,12 +57,17 @@ PAddr MemoryManager::Allocate(PAddr search_start, PAddr search_end, size_t size, auto dmem_area = FindDmemArea(search_start); const auto is_suitable = [&] { - return dmem_area->second.is_free && dmem_area->second.size >= size; + const auto aligned_base = alignment > 0 ? Common::AlignUp(dmem_area->second.base, alignment) + : dmem_area->second.base; + const auto alignment_size = aligned_base - dmem_area->second.base; + const auto remaining_size = + dmem_area->second.size >= alignment_size ? dmem_area->second.size - alignment_size : 0; + return dmem_area->second.is_free && remaining_size >= size; }; while (!is_suitable() && dmem_area->second.GetEnd() <= search_end) { dmem_area++; } - ASSERT_MSG(is_suitable(), "Unable to find free direct memory area"); + ASSERT_MSG(is_suitable(), "Unable to find free direct memory area: size = {:#x}", size); // Align free position PAddr free_addr = dmem_area->second.base; @@ -328,14 +348,24 @@ int MemoryManager::DirectQueryAvailable(PAddr search_start, PAddr search_end, si PAddr paddr{}; size_t max_size{}; while (dmem_area != dmem_map.end() && dmem_area->second.GetEnd() <= search_end) { - if (dmem_area->second.size > max_size) { - paddr = dmem_area->second.base; - max_size = dmem_area->second.size; + if (!dmem_area->second.is_free) { + dmem_area++; + continue; + } + + const auto aligned_base = alignment > 0 ? Common::AlignUp(dmem_area->second.base, alignment) + : dmem_area->second.base; + const auto alignment_size = aligned_base - dmem_area->second.base; + const auto remaining_size = + dmem_area->second.size >= alignment_size ? dmem_area->second.size - alignment_size : 0; + if (remaining_size > max_size) { + paddr = aligned_base; + max_size = remaining_size; } dmem_area++; } - *phys_addr_out = alignment > 0 ? Common::AlignUp(paddr, alignment) : paddr; + *phys_addr_out = paddr; *size_out = max_size; return ORBIS_OK; } @@ -344,7 +374,7 @@ void MemoryManager::NameVirtualRange(VAddr virtual_addr, size_t size, std::strin auto it = FindVMA(virtual_addr); ASSERT_MSG(it->second.Contains(virtual_addr, size), - "Range provided is not fully containted in vma"); + "Range provided is not fully contained in vma"); it->second.name = name; } VAddr MemoryManager::SearchFree(VAddr virtual_addr, size_t size, u32 alignment) { @@ -413,7 +443,8 @@ MemoryManager::DMemHandle MemoryManager::CarveDmemArea(PAddr addr, size_t size) const PAddr start_in_area = addr - area.base; const PAddr end_in_vma = start_in_area + size; - ASSERT_MSG(end_in_vma <= area.size, "Mapping cannot fit inside free region"); + ASSERT_MSG(end_in_vma <= area.size, "Mapping cannot fit inside free region: size = {:#x}", + size); if (end_in_vma != area.size) { // Split VMA at the end of the allocated region diff --git a/src/core/memory.h b/src/core/memory.h index d58269678..c8638626a 100644 --- a/src/core/memory.h +++ b/src/core/memory.h @@ -130,8 +130,8 @@ public: rasterizer = rasterizer_; } - void SetTotalFlexibleSize(u64 size) { - total_flexible_size = size; + u64 GetTotalDirectSize() const { + return total_direct_size; } u64 GetAvailableFlexibleSize() const { @@ -142,6 +142,8 @@ public: return impl.SystemReservedVirtualBase(); } + void SetupMemoryRegions(u64 flexible_size); + PAddr Allocate(PAddr search_start, PAddr search_end, size_t size, u64 alignment, int memory_type); @@ -217,7 +219,8 @@ private: DMemMap dmem_map; VMAMap vma_map; std::recursive_mutex mutex; - size_t total_flexible_size = 448_MB; + size_t total_direct_size{}; + size_t total_flexible_size{}; size_t flexible_usage{}; Vulkan::Rasterizer* rasterizer{}; }; diff --git a/src/core/module.cpp b/src/core/module.cpp index 775e1ef19..f48848bbd 100644 --- a/src/core/module.cpp +++ b/src/core/module.cpp @@ -5,6 +5,9 @@ #include "common/alignment.h" #include "common/assert.h" #include "common/logging/log.h" +#ifdef ENABLE_QT_GUI +#include "qt_gui/memory_patcher.h" +#endif #include "common/string_util.h" #include "core/aerolib/aerolib.h" #include "core/cpu_patches.h" @@ -192,6 +195,16 @@ void Module::LoadModuleToMemory(u32& max_tls_index) { const VAddr entry_addr = base_virtual_addr + elf.GetElfEntry(); LOG_INFO(Core_Linker, "program entry addr ..........: {:#018x}", entry_addr); + +#ifdef ENABLE_QT_GUI + if (MemoryPatcher::g_eboot_address == 0) { + if (name == "eboot") { + MemoryPatcher::g_eboot_address = base_virtual_addr; + MemoryPatcher::g_eboot_image_size = base_size; + MemoryPatcher::OnGameLoaded(); + } + } +#endif } void Module::LoadDynamicInfo() { diff --git a/src/emulator.cpp b/src/emulator.cpp index 836b989e5..b12bb8591 100644 --- a/src/emulator.cpp +++ b/src/emulator.cpp @@ -7,6 +7,9 @@ #include "common/debug.h" #include "common/logging/backend.h" #include "common/logging/log.h" +#ifdef ENABLE_QT_GUI +#include "qt_gui/memory_patcher.h" +#endif #include "common/ntapi.h" #include "common/path_util.h" #include "common/polyfill_thread.h" @@ -93,6 +96,9 @@ void Emulator::Run(const std::filesystem::path& file) { auto* param_sfo = Common::Singleton::Instance(); param_sfo->open(sce_sys_folder.string() + "/param.sfo", {}); id = std::string(param_sfo->GetString("CONTENT_ID"), 7, 9); +#ifdef ENABLE_QT_GUI + MemoryPatcher::g_game_serial = id; +#endif title = param_sfo->GetString("TITLE"); LOG_INFO(Loader, "Game id: {} Title: {}", id, title); u32 fw_version = param_sfo->GetInteger("SYSTEM_VER"); diff --git a/src/input/controller.cpp b/src/input/controller.cpp index 4a3db1633..4de6d83b8 100644 --- a/src/input/controller.cpp +++ b/src/input/controller.cpp @@ -132,15 +132,29 @@ bool GameController::SetVibration(u8 smallMotor, u8 largeMotor) { return true; } +void GameController::SetTouchpadState(int touchIndex, bool touchDown, float x, float y) { + if (touchIndex < 2) { + std::scoped_lock lock{m_mutex}; + auto state = GetLastState(); + state.time = Libraries::Kernel::sceKernelGetProcessTime(); + + state.touchpad[touchIndex].state = touchDown; + state.touchpad[touchIndex].x = static_cast(x * 1920); + state.touchpad[touchIndex].y = static_cast(y * 941); + + AddState(state); + } +} + void GameController::TryOpenSDLController() { if (m_sdl_gamepad == nullptr || !SDL_GamepadConnected(m_sdl_gamepad)) { int gamepad_count; SDL_JoystickID* gamepads = SDL_GetGamepads(&gamepad_count); m_sdl_gamepad = gamepad_count > 0 ? SDL_OpenGamepad(gamepads[0]) : nullptr; SDL_free(gamepads); - } - SetLightBarRGB(0, 0, 255); + SetLightBarRGB(0, 0, 255); + } } } // namespace Input diff --git a/src/input/controller.h b/src/input/controller.h index ef0991568..0a0d663a1 100644 --- a/src/input/controller.h +++ b/src/input/controller.h @@ -21,10 +21,17 @@ enum class Axis { AxisMax }; +struct TouchpadEntry { + bool state{}; + u16 x{}; + u16 y{}; +}; + struct State { u32 buttonsState = 0; u64 time = 0; int axes[static_cast(Axis::AxisMax)] = {128, 128, 128, 128, 0, 0}; + TouchpadEntry touchpad[2] = {{false, 0, 0}, {false, 0, 0}}; }; inline int GetAxis(int min, int max, int value) { @@ -47,6 +54,7 @@ public: void Axis(int id, Input::Axis axis, int value); void SetLightBarRGB(u8 r, u8 g, u8 b); bool SetVibration(u8 smallMotor, u8 largeMotor); + void SetTouchpadState(int touchIndex, bool touchDown, float x, float y); void TryOpenSDLController(); private: diff --git a/src/qt_gui/cheats_patches.cpp b/src/qt_gui/cheats_patches.cpp new file mode 100644 index 000000000..662d52cc1 --- /dev/null +++ b/src/qt_gui/cheats_patches.cpp @@ -0,0 +1,1264 @@ +// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "cheats_patches.h" +#include "common/path_util.h" +#include "core/module.h" +#include "qt_gui/memory_patcher.h" + +using namespace Common::FS; + +CheatsPatches::CheatsPatches(const QString& gameName, const QString& gameSerial, + const QString& gameVersion, const QString& gameSize, + const QPixmap& gameImage, QWidget* parent) + : QWidget(parent), m_gameName(gameName), m_gameSerial(gameSerial), m_gameVersion(gameVersion), + m_gameSize(gameSize), m_gameImage(gameImage), manager(new QNetworkAccessManager(this)) { + setupUI(); + resize(500, 400); + setWindowTitle(tr("Cheats / Patches")); +} + +CheatsPatches::~CheatsPatches() {} + +void CheatsPatches::setupUI() { + defaultTextEdit = tr("defaultTextEdit_MSG"); + defaultTextEdit.replace("\\n", "\n"); + + QString CHEATS_DIR_QString = + QString::fromStdString(Common::FS::GetUserPath(Common::FS::PathType::CheatsDir).string()); + QString NameCheatJson = m_gameSerial + "_" + m_gameVersion + ".json"; + m_cheatFilePath = CHEATS_DIR_QString + "/" + NameCheatJson; + + QHBoxLayout* mainLayout = new QHBoxLayout(this); + + // Create the game info group box + QGroupBox* gameInfoGroupBox = new QGroupBox(); + QVBoxLayout* gameInfoLayout = new QVBoxLayout(gameInfoGroupBox); + gameInfoLayout->setAlignment(Qt::AlignTop); + + QLabel* gameImageLabel = new QLabel(); + if (!m_gameImage.isNull()) { + gameImageLabel->setPixmap(m_gameImage.scaled(275, 275, Qt::KeepAspectRatio)); + } else { + gameImageLabel->setText(tr("No Image Available")); + } + gameImageLabel->setAlignment(Qt::AlignCenter); + gameInfoLayout->addWidget(gameImageLabel, 0, Qt::AlignCenter); + + QLabel* gameNameLabel = new QLabel(m_gameName); + gameNameLabel->setAlignment(Qt::AlignLeft); + gameNameLabel->setWordWrap(true); + gameInfoLayout->addWidget(gameNameLabel); + + QLabel* gameSerialLabel = new QLabel(tr("Serial: ") + m_gameSerial); + gameSerialLabel->setAlignment(Qt::AlignLeft); + gameInfoLayout->addWidget(gameSerialLabel); + + QLabel* gameVersionLabel = new QLabel(tr("Version: ") + m_gameVersion); + gameVersionLabel->setAlignment(Qt::AlignLeft); + gameInfoLayout->addWidget(gameVersionLabel); + + QLabel* gameSizeLabel = new QLabel(tr("Size: ") + m_gameSize); + gameSizeLabel->setAlignment(Qt::AlignLeft); + gameInfoLayout->addWidget(gameSizeLabel); + + // Add a text area for instructions and 'Patch' descriptions + instructionsTextEdit = new QTextEdit(); + instructionsTextEdit->setText(defaultTextEdit); + instructionsTextEdit->setReadOnly(true); + instructionsTextEdit->setFixedHeight(290); + gameInfoLayout->addWidget(instructionsTextEdit); + + // Create the tab widget + QTabWidget* tabWidget = new QTabWidget(); + QWidget* cheatsTab = new QWidget(); + QWidget* patchesTab = new QWidget(); + + // Layouts for the tabs + QVBoxLayout* cheatsLayout = new QVBoxLayout(); + QVBoxLayout* patchesLayout = new QVBoxLayout(); + + // Setup the cheats tab + QGroupBox* cheatsGroupBox = new QGroupBox(); + rightLayout = new QVBoxLayout(cheatsGroupBox); + rightLayout->setAlignment(Qt::AlignTop); + + cheatsGroupBox->setLayout(rightLayout); + QScrollArea* scrollArea = new QScrollArea(); + scrollArea->setWidgetResizable(true); + scrollArea->setWidget(cheatsGroupBox); + scrollArea->setMinimumHeight(490); + cheatsLayout->addWidget(scrollArea); + + // QListView + listView_selectFile = new QListView(); + listView_selectFile->setSelectionMode(QAbstractItemView::SingleSelection); + listView_selectFile->setEditTriggers(QAbstractItemView::NoEditTriggers); + + // Add QListView to layout + QVBoxLayout* fileListLayout = new QVBoxLayout(); + fileListLayout->addWidget(new QLabel(tr("Select Cheat File:"))); + fileListLayout->addWidget(listView_selectFile); + cheatsLayout->addLayout(fileListLayout, 2); + + // Call the method to fill the list of cheat files + populateFileListCheats(); + + QLabel* repositoryLabel = new QLabel("Repository:"); + repositoryLabel->setAlignment(Qt::AlignLeft); + repositoryLabel->setAlignment(Qt::AlignVCenter); + + // Add a combo box and a download button + QHBoxLayout* controlLayout = new QHBoxLayout(); + controlLayout->addWidget(repositoryLabel); + controlLayout->setAlignment(Qt::AlignLeft); + QComboBox* downloadComboBox = new QComboBox(); + + downloadComboBox->addItem("wolf2022", "wolf2022"); + downloadComboBox->addItem("GoldHEN", "GoldHEN"); + downloadComboBox->addItem("shadPS4", "shadPS4"); + + controlLayout->addWidget(downloadComboBox); + + QPushButton* downloadButton = new QPushButton(tr("Download Cheats")); + connect(downloadButton, &QPushButton::clicked, [=]() { + QString source = downloadComboBox->currentData().toString(); + downloadCheats(source, m_gameSerial, m_gameVersion, true); + }); + + QPushButton* deleteCheatButton = new QPushButton(tr("Delete File")); + connect(deleteCheatButton, &QPushButton::clicked, [=]() { + QStringListModel* model = qobject_cast(listView_selectFile->model()); + if (!model) { + return; + } + QItemSelectionModel* selectionModel = listView_selectFile->selectionModel(); + if (!selectionModel) { + return; + } + QModelIndexList selectedIndexes = selectionModel->selectedIndexes(); + if (selectedIndexes.isEmpty()) { + QMessageBox::warning( + this, tr("Delete File"), + tr("No files selected.") + "\n" + + tr("You can delete the cheats you don't want after downloading them.")); + return; + } + QModelIndex selectedIndex = selectedIndexes.first(); + QString selectedFileName = model->data(selectedIndex).toString(); + + int ret = QMessageBox::warning( + this, tr("Delete File"), + QString(tr("Do you want to delete the selected file?\n%1")).arg(selectedFileName), + QMessageBox::Yes | QMessageBox::No); + + if (ret == QMessageBox::Yes) { + QString filePath = CHEATS_DIR_QString + "/" + selectedFileName; + QFile::remove(filePath); + populateFileListCheats(); + } + }); + + controlLayout->addWidget(downloadButton); + controlLayout->addWidget(deleteCheatButton); + + cheatsLayout->addLayout(controlLayout); + cheatsTab->setLayout(cheatsLayout); + + // Setup the patches tab + QGroupBox* patchesGroupBox = new QGroupBox(); + patchesGroupBoxLayout = new QVBoxLayout(patchesGroupBox); + patchesGroupBoxLayout->setAlignment(Qt::AlignTop); + patchesGroupBox->setLayout(patchesGroupBoxLayout); + + QScrollArea* patchesScrollArea = new QScrollArea(); + patchesScrollArea->setWidgetResizable(true); + patchesScrollArea->setWidget(patchesGroupBox); + patchesScrollArea->setMinimumHeight(490); + patchesLayout->addWidget(patchesScrollArea); + + // List of files in patchesListView + patchesListView = new QListView(); + patchesListView->setSelectionMode(QAbstractItemView::SingleSelection); + patchesListView->setEditTriggers(QAbstractItemView::NoEditTriggers); + + // Add new label "Select Patch File:" above the QListView + QVBoxLayout* patchFileListLayout = new QVBoxLayout(); + patchFileListLayout->addWidget(new QLabel(tr("Select Patch File:"))); + patchFileListLayout->addWidget(patchesListView); + patchesLayout->addLayout(patchFileListLayout, 2); + + QStringListModel* patchesModel = new QStringListModel(); + patchesListView->setModel(patchesModel); + + QHBoxLayout* patchesControlLayout = new QHBoxLayout(); + + QLabel* patchesRepositoryLabel = new QLabel(tr("Repository:")); + patchesRepositoryLabel->setAlignment(Qt::AlignLeft); + patchesRepositoryLabel->setAlignment(Qt::AlignVCenter); + patchesControlLayout->addWidget(patchesRepositoryLabel); + + // Add the combo box with options + patchesComboBox = new QComboBox(); + patchesComboBox->addItem("GoldHEN", "GoldHEN"); + patchesComboBox->addItem("shadPS4", "shadPS4"); + patchesControlLayout->addWidget(patchesComboBox); + + QPushButton* patchesButton = new QPushButton(tr("Download Patches")); + connect(patchesButton, &QPushButton::clicked, [=]() { + QString selectedOption = patchesComboBox->currentData().toString(); + downloadPatches(selectedOption, true); + }); + patchesControlLayout->addWidget(patchesButton); + + QPushButton* saveButton = new QPushButton(tr("Save")); + connect(saveButton, &QPushButton::clicked, this, &CheatsPatches::onSaveButtonClicked); + + patchesControlLayout->addWidget(saveButton); + + patchesLayout->addLayout(patchesControlLayout); + patchesTab->setLayout(patchesLayout); + + tabWidget->addTab(cheatsTab, tr("Cheats")); + tabWidget->addTab(patchesTab, tr("Patches")); + + connect(tabWidget, &QTabWidget::currentChanged, this, [this](int index) { + if (index == 1) { + populateFileListPatches(); + } + }); + + mainLayout->addWidget(gameInfoGroupBox, 1); + mainLayout->addWidget(tabWidget, 3); + + manager = new QNetworkAccessManager(this); + + setLayout(mainLayout); +} + +void CheatsPatches::onSaveButtonClicked() { + // Get the name of the selected folder in the patchesListView + QString selectedPatchName; + QModelIndexList selectedIndexes = patchesListView->selectionModel()->selectedIndexes(); + if (selectedIndexes.isEmpty()) { + QMessageBox::warning(this, tr("Error"), tr("No patch selected.")); + return; + } + selectedPatchName = patchesListView->model()->data(selectedIndexes.first()).toString(); + int separatorIndex = selectedPatchName.indexOf(" | "); + selectedPatchName = selectedPatchName.mid(separatorIndex + 3); + + QString patchDir = + QString::fromStdString(Common::FS::GetUserPath(Common::FS::PathType::PatchesDir).string()) + + "/" + selectedPatchName; + + QString filesJsonPath = patchDir + "/files.json"; + QFile jsonFile(filesJsonPath); + if (!jsonFile.open(QIODevice::ReadOnly)) { + QMessageBox::critical(this, tr("Error"), tr("Unable to open files.json for reading.")); + return; + } + + QByteArray jsonData = jsonFile.readAll(); + jsonFile.close(); + + QJsonDocument jsonDoc = QJsonDocument::fromJson(jsonData); + QJsonObject jsonObject = jsonDoc.object(); + + QString selectedFileName; + QString serial = m_gameSerial; + + for (auto it = jsonObject.constBegin(); it != jsonObject.constEnd(); ++it) { + QString filePath = it.key(); + QJsonArray idsArray = it.value().toArray(); + + if (idsArray.contains(QJsonValue(serial))) { + selectedFileName = filePath; + break; + } + } + + if (selectedFileName.isEmpty()) { + QMessageBox::critical(this, tr("Error"), tr("No patch file found for the current serial.")); + return; + } + + QString filePath = patchDir + "/" + selectedFileName; + QFile file(filePath); + if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { + QMessageBox::critical(this, tr("Error"), tr("Unable to open the file for reading.")); + return; + } + + QByteArray xmlData = file.readAll(); + file.close(); + + QString newXmlData; + QXmlStreamWriter xmlWriter(&newXmlData); + xmlWriter.setAutoFormatting(true); + xmlWriter.writeStartDocument(); + + QXmlStreamReader xmlReader(xmlData); + bool insideMetadata = false; + + while (!xmlReader.atEnd()) { + xmlReader.readNext(); + + if (xmlReader.isStartElement()) { + if (xmlReader.name() == QStringLiteral("Metadata")) { + insideMetadata = true; + xmlWriter.writeStartElement(xmlReader.name().toString()); + + QString name = xmlReader.attributes().value("Name").toString(); + bool isEnabled = false; + bool hasIsEnabled = false; + bool foundPatchInfo = false; + + // Check and update the isEnabled attribute + for (const QXmlStreamAttribute& attr : xmlReader.attributes()) { + if (attr.name() == QStringLiteral("isEnabled")) { + hasIsEnabled = true; + auto it = m_patchInfos.find(name); + if (it != m_patchInfos.end()) { + QCheckBox* checkBox = findCheckBoxByName(it->name); + if (checkBox) { + foundPatchInfo = true; + isEnabled = checkBox->isChecked(); + xmlWriter.writeAttribute("isEnabled", isEnabled ? "true" : "false"); + } + } + if (!foundPatchInfo) { + auto maskIt = m_patchInfos.find(name + " (any version)"); + if (maskIt != m_patchInfos.end()) { + QCheckBox* checkBox = findCheckBoxByName(maskIt->name); + if (checkBox) { + foundPatchInfo = true; + isEnabled = checkBox->isChecked(); + xmlWriter.writeAttribute("isEnabled", + isEnabled ? "true" : "false"); + } + } + } + + } else { + xmlWriter.writeAttribute(attr.name().toString(), attr.value().toString()); + } + } + + if (!hasIsEnabled) { + auto it = m_patchInfos.find(name); + if (it != m_patchInfos.end()) { + QCheckBox* checkBox = findCheckBoxByName(it->name); + if (checkBox) { + foundPatchInfo = true; + isEnabled = checkBox->isChecked(); + } + } + if (!foundPatchInfo) { + auto maskIt = m_patchInfos.find(name + " (any version)"); + if (maskIt != m_patchInfos.end()) { + QCheckBox* checkBox = findCheckBoxByName(maskIt->name); + if (checkBox) { + foundPatchInfo = true; + isEnabled = checkBox->isChecked(); + } + } + } + xmlWriter.writeAttribute("isEnabled", isEnabled ? "true" : "false"); + } + } else { + xmlWriter.writeStartElement(xmlReader.name().toString()); + for (const QXmlStreamAttribute& attr : xmlReader.attributes()) { + xmlWriter.writeAttribute(attr.name().toString(), attr.value().toString()); + } + } + } else if (xmlReader.isEndElement()) { + if (xmlReader.name() == QStringLiteral("Metadata")) { + insideMetadata = false; + } + xmlWriter.writeEndElement(); + } else if (xmlReader.isCharacters() && !xmlReader.isWhitespace()) { + xmlWriter.writeCharacters(xmlReader.text().toString()); + } + } + + xmlWriter.writeEndDocument(); + + if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) { + QMessageBox::critical(this, tr("Error"), tr("Unable to open the file for writing.")); + return; + } + + QTextStream textStream(&file); + textStream << newXmlData; + file.close(); + + if (xmlReader.hasError()) { + QMessageBox::critical(this, tr("Error"), + tr("Failed to parse XML: ") + "\n" + xmlReader.errorString()); + } else { + QMessageBox::information(this, tr("Success"), tr("Options saved successfully.")); + } +} + +QCheckBox* CheatsPatches::findCheckBoxByName(const QString& name) { + for (int i = 0; i < patchesGroupBoxLayout->count(); ++i) { + QLayoutItem* item = patchesGroupBoxLayout->itemAt(i); + if (item) { + QWidget* widget = item->widget(); + QCheckBox* checkBox = qobject_cast(widget); + if (checkBox) { + if (checkBox->text().toStdString().find(name.toStdString()) != std::string::npos) { + return checkBox; + } + } + } + } + return nullptr; +} + +void CheatsPatches::downloadCheats(const QString& source, const QString& m_gameSerial, + const QString& m_gameVersion, const bool showMessageBox) { + QDir dir(Common::FS::GetUserPath(Common::FS::PathType::CheatsDir)); + if (!dir.exists()) { + dir.mkpath("."); + } + + QString url; + if (source == "GoldHEN") { + url = "https://raw.githubusercontent.com/GoldHEN/GoldHEN_Cheat_Repository/main/json.txt"; + } else if (source == "wolf2022") { + url = "https://wolf2022.ir/trainer/" + m_gameSerial + "_" + m_gameVersion + ".json"; + } else if (source == "shadPS4") { + url = "https://raw.githubusercontent.com/shadps4-emu/ps4_cheats/main/" + "CHEATS_JSON.txt"; + } else { + QMessageBox::warning(this, tr("Invalid Source"), + QString(tr("The selected source is invalid.") + "\n%1").arg(source)); + return; + } + + QNetworkRequest request(url); + QNetworkReply* reply = manager->get(request); + + connect(reply, &QNetworkReply::finished, [=]() { + if (reply->error() == QNetworkReply::NoError) { + QByteArray jsonData = reply->readAll(); + bool foundFiles = false; + + if (source == "GoldHEN" || source == "shadPS4") { + QString textContent(jsonData); + QRegularExpression regex( + QString("%1_%2[^=]*\.json").arg(m_gameSerial).arg(m_gameVersion)); + QRegularExpressionMatchIterator matches = regex.globalMatch(textContent); + QString baseUrl; + + if (source == "GoldHEN") { + baseUrl = "https://raw.githubusercontent.com/GoldHEN/GoldHEN_Cheat_Repository/" + "main/json/"; + } else { + baseUrl = "https://raw.githubusercontent.com/shadps4-emu/ps4_cheats/" + "main/CHEATS/"; + } + + while (matches.hasNext()) { + QRegularExpressionMatch match = matches.next(); + QString fileName = match.captured(0); + + if (!fileName.isEmpty()) { + QString newFileName = fileName; + int dotIndex = newFileName.lastIndexOf('.'); + if (dotIndex != -1) { + + if (source == "GoldHEN") { + newFileName.insert(dotIndex, "_GoldHEN"); + } else { + newFileName.insert(dotIndex, "_shadPS4"); + } + } + QString fileUrl = baseUrl + fileName; + QString localFilePath = dir.filePath(newFileName); + + if (QFile::exists(localFilePath) && showMessageBox) { + QMessageBox::StandardButton reply; + reply = QMessageBox::question( + this, tr("File Exists"), + tr("File already exists. Do you want to replace it?"), + QMessageBox::Yes | QMessageBox::No); + if (reply == QMessageBox::No) { + continue; + } + } + QNetworkRequest fileRequest(fileUrl); + QNetworkReply* fileReply = manager->get(fileRequest); + + connect(fileReply, &QNetworkReply::finished, [=]() { + if (fileReply->error() == QNetworkReply::NoError) { + QByteArray fileData = fileReply->readAll(); + QFile localFile(localFilePath); + if (localFile.open(QIODevice::WriteOnly)) { + localFile.write(fileData); + localFile.close(); + } else { + QMessageBox::warning( + this, tr("Error"), + QString(tr("Failed to save file:") + "\n%1") + .arg(localFilePath)); + } + } else { + QMessageBox::warning(this, tr("Error"), + QString(tr("Failed to download file:") + + "%1\n\n" + tr("Error:") + "%2") + .arg(fileUrl) + .arg(fileReply->errorString())); + } + fileReply->deleteLater(); + }); + + foundFiles = true; + } + } + if (!foundFiles && showMessageBox) { + QMessageBox::warning(this, tr("Cheats Not Found"), tr("CheatsNotFound_MSG")); + } + } else if (source == "wolf2022") { + QString fileName = QFileInfo(QUrl(url).path()).fileName(); + QString baseFileName = fileName; + int dotIndex = baseFileName.lastIndexOf('.'); + if (dotIndex != -1) { + baseFileName.insert(dotIndex, "_wolf2022"); + } + QString filePath = + QString::fromStdString( + Common::FS::GetUserPath(Common::FS::PathType::CheatsDir).string()) + + "/" + baseFileName; + if (QFile::exists(filePath) && showMessageBox) { + QMessageBox::StandardButton reply2; + reply2 = + QMessageBox::question(this, tr("File Exists"), + tr("File already exists. Do you want to replace it?"), + QMessageBox::Yes | QMessageBox::No); + if (reply2 == QMessageBox::No) { + reply->deleteLater(); + return; + } + } + QFile cheatFile(filePath); + if (cheatFile.open(QIODevice::WriteOnly)) { + cheatFile.write(jsonData); + cheatFile.close(); + foundFiles = true; + populateFileListCheats(); + } else { + QMessageBox::warning( + this, tr("Error"), + QString(tr("Failed to save file:") + "\n%1").arg(filePath)); + } + } + if (foundFiles && showMessageBox) { + QMessageBox::information(this, tr("Cheats Downloaded Successfully"), + tr("CheatsDownloadedSuccessfully_MSG")); + populateFileListCheats(); + } + + } else { + if (showMessageBox) { + QMessageBox::warning(this, tr("Cheats Not Found"), tr("CheatsNotFound_MSG")); + } + } + reply->deleteLater(); + emit downloadFinished(); + }); + + // connect(reply, &QNetworkReply::errorOccurred, [=](QNetworkReply::NetworkError code) { + // if (showMessageBox) + // QMessageBox::warning(this, "Download Error", + // QString("Error in response: %1").arg(reply->errorString())); + // }); +} + +void CheatsPatches::populateFileListPatches() { + QLayoutItem* item; + while ((item = patchesGroupBoxLayout->takeAt(0)) != nullptr) { + delete item->widget(); + delete item; + } + m_patchInfos.clear(); + + QString patchesDir = + QString::fromStdString(Common::FS::GetUserPath(Common::FS::PathType::PatchesDir).string()); + QDir dir(patchesDir); + + QStringList folders = dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot); + QStringList matchingFiles; + + foreach (const QString& folder, folders) { + QString folderPath = dir.filePath(folder); + QDir subDir(folderPath); + + QString filesJsonPath = subDir.filePath("files.json"); + QFile file(filesJsonPath); + + if (file.open(QIODevice::ReadOnly)) { + QByteArray fileData = file.readAll(); + file.close(); + + QJsonDocument jsonDoc(QJsonDocument::fromJson(fileData)); + QJsonObject jsonObj = jsonDoc.object(); + + for (auto it = jsonObj.constBegin(); it != jsonObj.constEnd(); ++it) { + QString fileName = it.key(); + QJsonArray serials = it.value().toArray(); + + if (serials.contains(QJsonValue(m_gameSerial))) { + QString fileEntry = fileName + " | " + folder; + if (!matchingFiles.contains(fileEntry)) { + matchingFiles << fileEntry; + } + } + } + } + } + QStringListModel* model = new QStringListModel(matchingFiles, this); + patchesListView->setModel(model); + + connect( + patchesListView->selectionModel(), &QItemSelectionModel::selectionChanged, this, [this]() { + QModelIndexList selectedIndexes = patchesListView->selectionModel()->selectedIndexes(); + if (!selectedIndexes.isEmpty()) { + QString selectedText = selectedIndexes.first().data().toString(); + addPatchesToLayout(selectedText); + } + }); + + if (!matchingFiles.isEmpty()) { + QModelIndex firstIndex = model->index(0, 0); + patchesListView->selectionModel()->select(firstIndex, QItemSelectionModel::Select | + QItemSelectionModel::Rows); + patchesListView->setCurrentIndex(firstIndex); + } +} + +void CheatsPatches::downloadPatches(const QString repository, const bool showMessageBox) { + QString url; + if (repository == "GoldHEN") { + url = "https://github.com/GoldHEN/GoldHEN_Patch_Repository/tree/main/" + "patches/xml"; + } + if (repository == "shadPS4") { + url = "https://github.com/shadps4-emu/ps4_cheats/tree/main/" + "PATCHES"; + } + QNetworkAccessManager* manager = new QNetworkAccessManager(this); + QNetworkRequest request(url); + QNetworkReply* reply = manager->get(request); + + connect(reply, &QNetworkReply::finished, [=]() { + if (reply->error() == QNetworkReply::NoError) { + QByteArray htmlData = reply->readAll(); + reply->deleteLater(); + + // Parsear HTML e extrair JSON usando QRegularExpression + QString htmlString = QString::fromUtf8(htmlData); + QRegularExpression jsonRegex( + R"()"); + QRegularExpressionMatch match = jsonRegex.match(htmlString); + + if (match.hasMatch()) { + QByteArray jsonData = match.captured(1).toUtf8(); + QJsonDocument jsonDoc = QJsonDocument::fromJson(jsonData); + QJsonObject jsonObj = jsonDoc.object(); + QJsonArray itemsArray = + jsonObj["payload"].toObject()["tree"].toObject()["items"].toArray(); + + QDir dir(Common::FS::GetUserPath(Common::FS::PathType::PatchesDir)); + QString fullPath = dir.filePath(repository); + if (!dir.exists(fullPath)) { + dir.mkpath(fullPath); + } + dir.setPath(fullPath); + + foreach (const QJsonValue& value, itemsArray) { + QJsonObject fileObj = value.toObject(); + QString fileName = fileObj["name"].toString(); + QString filePath = fileObj["path"].toString(); + + if (fileName.endsWith(".xml")) { + QString fileUrl; + if (repository == "GoldHEN") { + fileUrl = QString("https://raw.githubusercontent.com/GoldHEN/" + "GoldHEN_Patch_Repository/main/%1") + .arg(filePath); + } + if (repository == "shadPS4") { + fileUrl = QString("https://raw.githubusercontent.com/shadps4-emu/" + "ps4_cheats/main/%1") + .arg(filePath); + } + QNetworkRequest fileRequest(fileUrl); + QNetworkReply* fileReply = manager->get(fileRequest); + + connect(fileReply, &QNetworkReply::finished, [=]() { + if (fileReply->error() == QNetworkReply::NoError) { + QByteArray fileData = fileReply->readAll(); + QFile localFile(dir.filePath(fileName)); + if (localFile.open(QIODevice::WriteOnly)) { + localFile.write(fileData); + localFile.close(); + } else { + if (showMessageBox) { + QMessageBox::warning( + this, tr("Error"), + QString(tr("Failed to save:") + "\n%1").arg(fileName)); + } + } + } else { + if (showMessageBox) { + QMessageBox::warning( + this, tr("Error"), + QString(tr("Failed to download:") + "\n%1").arg(fileUrl)); + } + } + fileReply->deleteLater(); + }); + } + } + if (showMessageBox) { + QMessageBox::information(this, tr("Download Complete"), + QString(tr("DownloadComplete_MSG"))); + } + + // Create the files.json file with the identification of which file to open + createFilesJson(repository); + populateFileListPatches(); + + } else { + if (showMessageBox) { + QMessageBox::warning(this, tr("Error"), + tr("Failed to parse JSON data from HTML.")); + } + } + } else { + if (showMessageBox) { + QMessageBox::warning(this, tr("Error"), tr("Failed to retrieve HTML page.")); + } + } + emit downloadFinished(); + }); +} + +void CheatsPatches::createFilesJson(const QString& repository) { + + QDir dir(Common::FS::GetUserPath(Common::FS::PathType::PatchesDir)); + QString fullPath = dir.filePath(repository); + if (!dir.exists(fullPath)) { + dir.mkpath(fullPath); + } + dir.setPath(fullPath); + + QJsonObject filesObject; + QStringList xmlFiles = dir.entryList(QStringList() << "*.xml", QDir::Files); + + foreach (const QString& xmlFile, xmlFiles) { + QFile file(dir.filePath(xmlFile)); + if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { + QMessageBox::warning(this, tr("ERROR"), + QString(tr("Failed to open file:") + "\n%1").arg(xmlFile)); + continue; + } + + QXmlStreamReader xmlReader(&file); + QJsonArray titleIdsArray; + + while (!xmlReader.atEnd() && !xmlReader.hasError()) { + QXmlStreamReader::TokenType token = xmlReader.readNext(); + if (token == QXmlStreamReader::StartElement) { + if (xmlReader.name() == QStringLiteral("ID")) { + titleIdsArray.append(xmlReader.readElementText()); + } + } + } + + if (xmlReader.hasError()) { + QMessageBox::warning(this, tr("ERROR"), + QString(tr("XML ERROR:") + "\n%1").arg(xmlReader.errorString())); + } + filesObject[xmlFile] = titleIdsArray; + } + + QFile jsonFile(dir.absolutePath() + "/files.json"); + if (!jsonFile.open(QIODevice::WriteOnly)) { + QMessageBox::warning(this, tr("ERROR"), tr("Failed to open files.json for writing")); + return; + } + + QJsonDocument jsonDoc(filesObject); + jsonFile.write(jsonDoc.toJson()); + jsonFile.close(); +} + +void CheatsPatches::addCheatsToLayout(const QJsonArray& modsArray, const QJsonArray& creditsArray) { + QLayoutItem* item; + while ((item = rightLayout->takeAt(0)) != nullptr) { + delete item->widget(); + delete item; + } + m_cheats.clear(); + m_cheatCheckBoxes.clear(); + + int maxWidthButton = 0; + + for (const QJsonValue& modValue : modsArray) { + QJsonObject modObject = modValue.toObject(); + QString modName = modObject["name"].toString(); + QString modType = modObject["type"].toString(); + + Cheat cheat; + cheat.name = modName; + cheat.type = modType; + + QJsonArray memoryArray = modObject["memory"].toArray(); + for (const QJsonValue& memoryValue : memoryArray) { + QJsonObject memoryObject = memoryValue.toObject(); + MemoryMod memoryMod; + memoryMod.offset = memoryObject["offset"].toString(); + memoryMod.on = memoryObject["on"].toString(); + memoryMod.off = memoryObject["off"].toString(); + cheat.memoryMods.append(memoryMod); + } + + // Check for the presence of 'hint' field + cheat.hasHint = modObject.contains("hint"); + + m_cheats[modName] = cheat; + + if (modType == "checkbox") { + QCheckBox* cheatCheckBox = new QCheckBox(modName); + rightLayout->addWidget(cheatCheckBox); + m_cheatCheckBoxes.append(cheatCheckBox); + connect(cheatCheckBox, &QCheckBox::toggled, + [=](bool checked) { applyCheat(modName, checked); }); + } else if (modType == "button") { + QPushButton* cheatButton = new QPushButton(modName); + cheatButton->adjustSize(); + int buttonWidth = cheatButton->sizeHint().width(); + if (buttonWidth > maxWidthButton) { + maxWidthButton = buttonWidth; + } + + // Create a horizontal layout for buttons + QHBoxLayout* buttonLayout = new QHBoxLayout(); + buttonLayout->setContentsMargins(0, 0, 0, 0); + buttonLayout->addWidget(cheatButton); + buttonLayout->addStretch(); + + rightLayout->addLayout(buttonLayout); + connect(cheatButton, &QPushButton::clicked, [=]() { applyCheat(modName, true); }); + } + } + + // Set minimum and fixed size for all buttons + 20 + for (int i = 0; i < rightLayout->count(); ++i) { + QLayoutItem* layoutItem = rightLayout->itemAt(i); + QWidget* widget = layoutItem->widget(); + if (widget) { + QPushButton* button = qobject_cast(widget); + if (button) { + button->setMinimumWidth(maxWidthButton); + button->setFixedWidth(maxWidthButton + 20); + } + } else { + QLayout* layout = layoutItem->layout(); + if (layout) { + for (int j = 0; j < layout->count(); ++j) { + QLayoutItem* innerItem = layout->itemAt(j); + QWidget* innerWidget = innerItem->widget(); + if (innerWidget) { + QPushButton* button = qobject_cast(innerWidget); + if (button) { + button->setMinimumWidth(maxWidthButton); + button->setFixedWidth(maxWidthButton + 20); + } + } + } + } + } + } + + // Set credits label + QLabel* creditsLabel = new QLabel(); + QString creditsText = tr("Author: "); + if (!creditsArray.isEmpty()) { + creditsText += creditsArray[0].toString(); + } + creditsLabel->setText(creditsText); + creditsLabel->setAlignment(Qt::AlignLeft); + rightLayout->addWidget(creditsLabel); +} + +void CheatsPatches::populateFileListCheats() { + QString cheatsDir = + QString::fromStdString(Common::FS::GetUserPath(Common::FS::PathType::CheatsDir).string()); + QString pattern = m_gameSerial + "_" + m_gameVersion + "*.json"; + + QDir dir(cheatsDir); + QStringList filters; + filters << pattern; + dir.setNameFilters(filters); + + QFileInfoList fileList = dir.entryInfoList(QDir::Files); + QStringList fileNames; + + for (const QFileInfo& fileInfo : fileList) { + fileNames << fileInfo.fileName(); + } + + QStringListModel* model = new QStringListModel(fileNames, this); + listView_selectFile->setModel(model); + + connect(listView_selectFile->selectionModel(), &QItemSelectionModel::selectionChanged, this, + [this]() { + QModelIndexList selectedIndexes = + listView_selectFile->selectionModel()->selectedIndexes(); + if (!selectedIndexes.isEmpty()) { + + QString selectedFileName = selectedIndexes.first().data().toString(); + QString cheatsDir = QString::fromStdString( + Common::FS::GetUserPath(Common::FS::PathType::CheatsDir).string()); + + QFile file(cheatsDir + "/" + selectedFileName); + if (file.open(QIODevice::ReadOnly)) { + QByteArray jsonData = file.readAll(); + QJsonDocument jsonDoc = QJsonDocument::fromJson(jsonData); + QJsonObject jsonObject = jsonDoc.object(); + QJsonArray modsArray = jsonObject["mods"].toArray(); + QJsonArray creditsArray = jsonObject["credits"].toArray(); + addCheatsToLayout(modsArray, creditsArray); + } + } + }); + + if (!fileNames.isEmpty()) { + QModelIndex firstIndex = model->index(0, 0); + listView_selectFile->selectionModel()->select(firstIndex, QItemSelectionModel::Select | + QItemSelectionModel::Rows); + listView_selectFile->setCurrentIndex(firstIndex); + } +} + +void CheatsPatches::addPatchesToLayout(const QString& filePath) { + if (filePath == "") { + return; + } + QString folderPath = filePath.section(" | ", 1, 1); + + // Clear existing layout items + QLayoutItem* item; + while ((item = patchesGroupBoxLayout->takeAt(0)) != nullptr) { + delete item->widget(); + delete item; + } + m_patchInfos.clear(); + + QDir dir(Common::FS::GetUserPath(Common::FS::PathType::PatchesDir)); + QString fullPath = dir.filePath(folderPath); + + if (!dir.exists(fullPath)) { + QMessageBox::warning(this, tr("ERROR"), + QString(tr("Directory does not exist:") + "\n%1").arg(fullPath)); + return; + } + dir.setPath(fullPath); + + QString filesJsonPath = dir.filePath("files.json"); + + QFile jsonFile(filesJsonPath); + if (!jsonFile.open(QIODevice::ReadOnly)) { + QMessageBox::warning(this, tr("ERROR"), tr("Failed to open files.json for reading.")); + return; + } + + QByteArray jsonData = jsonFile.readAll(); + jsonFile.close(); + + QJsonDocument jsonDoc = QJsonDocument::fromJson(jsonData); + QJsonObject jsonObject = jsonDoc.object(); + + bool patchAdded = false; + + // Iterate over each entry in the JSON file + for (auto it = jsonObject.constBegin(); it != jsonObject.constEnd(); ++it) { + QString xmlFileName = it.key(); + QJsonArray idsArray = it.value().toArray(); + + // Check if the serial is in the ID list + if (idsArray.contains(QJsonValue(m_gameSerial))) { + QString xmlFilePath = dir.filePath(xmlFileName); + QFile xmlFile(xmlFilePath); + + if (!xmlFile.open(QIODevice::ReadOnly)) { + QMessageBox::warning( + this, tr("ERROR"), + QString(tr("Failed to open file:") + "\n%1").arg(xmlFile.fileName())); + continue; + } + QXmlStreamReader xmlReader(&xmlFile); + QString patchName; + QString patchAuthor; + QString patchNote; + QJsonArray patchLines; + bool isEnabled = false; + + while (!xmlReader.atEnd() && !xmlReader.hasError()) { + xmlReader.readNext(); + + if (xmlReader.tokenType() == QXmlStreamReader::StartElement) { + if (xmlReader.name() == QStringLiteral("Metadata")) { + QXmlStreamAttributes attributes = xmlReader.attributes(); + QString appVer = attributes.value("AppVer").toString(); + if (appVer == m_gameVersion) { + patchName = attributes.value("Name").toString(); + patchAuthor = attributes.value("Author").toString(); + patchNote = attributes.value("Note").toString(); + isEnabled = + attributes.value("isEnabled").toString() == QStringLiteral("true"); + } + if (appVer == "mask") { + patchName = attributes.value("Name").toString() + " (any version)"; + patchAuthor = attributes.value("Author").toString(); + patchNote = attributes.value("Note").toString(); + isEnabled = + attributes.value("isEnabled").toString() == QStringLiteral("true"); + } + } else if (xmlReader.name() == QStringLiteral("PatchList")) { + QJsonArray linesArray; + while (!xmlReader.atEnd() && + !(xmlReader.tokenType() == QXmlStreamReader::EndElement && + xmlReader.name() == QStringLiteral("PatchList"))) { + xmlReader.readNext(); + if (xmlReader.tokenType() == QXmlStreamReader::StartElement && + xmlReader.name() == QStringLiteral("Line")) { + QXmlStreamAttributes attributes = xmlReader.attributes(); + QJsonObject lineObject; + lineObject["Type"] = attributes.value("Type").toString(); + lineObject["Address"] = attributes.value("Address").toString(); + lineObject["Value"] = attributes.value("Value").toString(); + linesArray.append(lineObject); + } + } + patchLines = linesArray; + } + } + + if (!patchName.isEmpty() && !patchLines.isEmpty()) { + QCheckBox* patchCheckBox = new QCheckBox(patchName); + patchCheckBox->setChecked(isEnabled); + patchesGroupBoxLayout->addWidget(patchCheckBox); + + PatchInfo patchInfo; + patchInfo.name = patchName; + patchInfo.author = patchAuthor; + patchInfo.note = patchNote; + patchInfo.linesArray = patchLines; + patchInfo.serial = m_gameSerial; + m_patchInfos[patchName] = patchInfo; + + patchCheckBox->installEventFilter(this); + + connect(patchCheckBox, &QCheckBox::toggled, + [=](bool checked) { applyPatch(patchName, checked); }); + + patchName.clear(); + patchAuthor.clear(); + patchNote.clear(); + patchLines = QJsonArray(); + patchAdded = true; + } + } + xmlFile.close(); + } + } + + // Remove the item from the list view if no patches were added (the game has patches, but not + // for the current version) + if (!patchAdded) { + QStringListModel* model = qobject_cast(patchesListView->model()); + if (model) { + QStringList items = model->stringList(); + int index = items.indexOf(filePath); + if (index != -1) { + items.removeAt(index); + model->setStringList(items); + } + } + } +} + +void CheatsPatches::updateNoteTextEdit(const QString& patchName) { + if (m_patchInfos.contains(patchName)) { + const PatchInfo& patchInfo = m_patchInfos[patchName]; + QString text = QString(tr("Name:") + " %1\n" + tr("Author:") + " %2\n\n%3") + .arg(patchInfo.name) + .arg(patchInfo.author) + .arg(patchInfo.note); + + foreach (const QJsonValue& value, patchInfo.linesArray) { + QJsonObject lineObject = value.toObject(); + QString type = lineObject["Type"].toString(); + QString address = lineObject["Address"].toString(); + QString patchValue = lineObject["Value"].toString(); + + // add the values ​​to be modified in instructionsTextEdit + // text.append(QString("\nType: %1\nAddress: %2\n\nValue: %3") + // .arg(type) + // .arg(address) + // .arg(patchValue)); + } + text.replace("\\n", "\n"); + instructionsTextEdit->setText(text); + } +} + +bool showErrorMessage = true; +void CheatsPatches::uncheckAllCheatCheckBoxes() { + for (auto& cheatCheckBox : m_cheatCheckBoxes) { + cheatCheckBox->setChecked(false); + } + showErrorMessage = true; +} + +void CheatsPatches::applyCheat(const QString& modName, bool enabled) { + if (!m_cheats.contains(modName)) + return; + + Cheat cheat = m_cheats[modName]; + + for (const MemoryMod& memoryMod : cheat.memoryMods) { + QString value = enabled ? memoryMod.on : memoryMod.off; + + std::string modNameStr = modName.toStdString(); + std::string offsetStr = memoryMod.offset.toStdString(); + std::string valueStr = value.toStdString(); + + if (MemoryPatcher::g_eboot_address == 0) { + MemoryPatcher::patchInfo addingPatch; + addingPatch.modNameStr = modNameStr; + addingPatch.offsetStr = offsetStr; + addingPatch.valueStr = valueStr; + addingPatch.isOffset = true; + + MemoryPatcher::AddPatchToQueue(addingPatch); + continue; + } + // Determine if the hint field is present + bool isHintPresent = m_cheats[modName].hasHint; + MemoryPatcher::PatchMemory(modNameStr, offsetStr, valueStr, !isHintPresent, false); + } +} + +void CheatsPatches::applyPatch(const QString& patchName, bool enabled) { + if (!enabled) + return; + if (m_patchInfos.contains(patchName)) { + const PatchInfo& patchInfo = m_patchInfos[patchName]; + + foreach (const QJsonValue& value, patchInfo.linesArray) { + QJsonObject lineObject = value.toObject(); + QString type = lineObject["Type"].toString(); + QString address = lineObject["Address"].toString(); + QString patchValue = lineObject["Value"].toString(); + QString maskOffsetStr = lineObject["Offset"].toString(); + + patchValue = MemoryPatcher::convertValueToHex(type, patchValue); + + bool littleEndian = false; + + if (type == "bytes16") { + littleEndian = true; + } else if (type == "bytes32") { + littleEndian = true; + } else if (type == "bytes64") { + littleEndian = true; + } + + MemoryPatcher::PatchMask patchMask = MemoryPatcher::PatchMask::None; + int maskOffsetValue = 0; + + if (type == "mask") { + patchMask = MemoryPatcher::PatchMask::Mask; + + // im not sure if this works, there is no games to test the mask offset on yet + if (!maskOffsetStr.toStdString().empty()) + maskOffsetValue = std::stoi(maskOffsetStr.toStdString(), 0, 10); + } + + if (type == "mask_jump32") + patchMask = MemoryPatcher::PatchMask::Mask_Jump32; + + if (MemoryPatcher::g_eboot_address == 0) { + MemoryPatcher::patchInfo addingPatch; + addingPatch.gameSerial = patchInfo.serial.toStdString(); + addingPatch.modNameStr = patchName.toStdString(); + addingPatch.offsetStr = address.toStdString(); + addingPatch.valueStr = patchValue.toStdString(); + addingPatch.isOffset = false; + addingPatch.littleEndian = littleEndian; + addingPatch.patchMask = patchMask; + addingPatch.maskOffset = maskOffsetValue; + + MemoryPatcher::AddPatchToQueue(addingPatch); + continue; + } + MemoryPatcher::PatchMemory(patchName.toStdString(), address.toStdString(), + patchValue.toStdString(), false, littleEndian, patchMask); + } + } +} + +bool CheatsPatches::eventFilter(QObject* obj, QEvent* event) { + if (event->type() == QEvent::HoverEnter || event->type() == QEvent::HoverLeave) { + QCheckBox* checkBox = qobject_cast(obj); + if (checkBox) { + bool hovered = (event->type() == QEvent::HoverEnter); + onPatchCheckBoxHovered(checkBox, hovered); + return true; + } + } + // Pass the event on to base class + return QWidget::eventFilter(obj, event); +} + +void CheatsPatches::onPatchCheckBoxHovered(QCheckBox* checkBox, bool hovered) { + if (hovered) { + QString text = checkBox->text(); + updateNoteTextEdit(text); + } else { + instructionsTextEdit->setText(defaultTextEdit); + } +} \ No newline at end of file diff --git a/src/qt_gui/cheats_patches.h b/src/qt_gui/cheats_patches.h new file mode 100644 index 000000000..7a68829cd --- /dev/null +++ b/src/qt_gui/cheats_patches.h @@ -0,0 +1,115 @@ +// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#ifndef CHEATS_PATCHES_H +#define CHEATS_PATCHES_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class CheatsPatches : public QWidget { + Q_OBJECT + +public: + CheatsPatches(const QString& gameName, const QString& gameSerial, const QString& gameVersion, + const QString& gameSize, const QPixmap& gameImage, QWidget* parent = nullptr); + ~CheatsPatches(); + + // Public Methods + void downloadCheats(const QString& source, const QString& m_gameSerial, + const QString& m_gameVersion, bool showMessageBox); + void downloadPatches(const QString repository, const bool showMessageBox); + +signals: + void downloadFinished(); + +private: + // UI Setup and Event Handlers + void setupUI(); + void onSaveButtonClicked(); + QCheckBox* findCheckBoxByName(const QString& name); + bool eventFilter(QObject* obj, QEvent* event); + void onPatchCheckBoxHovered(QCheckBox* checkBox, bool hovered); + + // Cheat and Patch Management + void populateFileListCheats(); + void populateFileListPatches(); + + void addCheatsToLayout(const QJsonArray& modsArray, const QJsonArray& creditsArray); + void addPatchesToLayout(const QString& serial); + + void applyCheat(const QString& modName, bool enabled); + void applyPatch(const QString& patchName, bool enabled); + + void createFilesJson(const QString& repository); + void uncheckAllCheatCheckBoxes(); + void updateNoteTextEdit(const QString& patchName); + + // Network Manager + QNetworkAccessManager* manager; + + // Patch Info Structures + struct MemoryMod { + QString offset; + QString on; + QString off; + }; + + struct Cheat { + QString name; + QString type; + bool hasHint; + QVector memoryMods; + }; + + struct PatchInfo { + QString name; + QString author; + QString note; + QJsonArray linesArray; + QString serial; + }; + + // Members + QString m_gameName; + QString m_gameSerial; + QString m_gameVersion; + QString m_gameSize; + QPixmap m_gameImage; + QString m_cheatFilePath; + QMap m_cheats; + QMap m_patchInfos; + QVector m_cheatCheckBoxes; + + // UI Elements + QVBoxLayout* rightLayout; + QVBoxLayout* patchesGroupBoxLayout; + QGroupBox* patchesGroupBox; + QVBoxLayout* patchesLayout; + QTextEdit* instructionsTextEdit; + QListView* listView_selectFile; + QItemSelectionModel* selectionModel; + QComboBox* patchesComboBox; + QListView* patchesListView; + + QString defaultTextEdit; +}; + +#endif // CHEATS_PATCHES_H \ No newline at end of file diff --git a/src/qt_gui/game_info.cpp b/src/qt_gui/game_info.cpp index d2bf3bb2d..2821a0322 100644 --- a/src/qt_gui/game_info.cpp +++ b/src/qt_gui/game_info.cpp @@ -23,8 +23,8 @@ void GameInfoClass::GetGameInfo(QWidget* parent) { }).results(); // Progress bar, please be patient :) - QProgressDialog dialog("Loading game list, please wait :3", "Cancel", 0, 0, parent); - dialog.setWindowTitle("Loading..."); + QProgressDialog dialog(tr("Loading game list, please wait :3"), tr("Cancel"), 0, 0, parent); + dialog.setWindowTitle(tr("Loading...")); QFutureWatcher futureWatcher; GameListUtils game_util; diff --git a/src/qt_gui/game_install_dialog.cpp b/src/qt_gui/game_install_dialog.cpp index 4b2b8528b..5f031bdec 100644 --- a/src/qt_gui/game_install_dialog.cpp +++ b/src/qt_gui/game_install_dialog.cpp @@ -21,14 +21,14 @@ GameInstallDialog::GameInstallDialog() : m_gamesDirectory(nullptr) { layout->addStretch(); layout->addWidget(SetupDialogActions()); - setWindowTitle("shadPS4 - Choose directory"); + setWindowTitle(tr("shadPS4 - Choose directory")); setWindowIcon(QIcon(":images/shadps4.ico")); } GameInstallDialog::~GameInstallDialog() {} void GameInstallDialog::Browse() { - auto path = QFileDialog::getExistingDirectory(this, "Directory to install games"); + auto path = QFileDialog::getExistingDirectory(this, tr("Directory to install games")); if (!path.isEmpty()) { m_gamesDirectory->setText(QDir::toNativeSeparators(path)); @@ -36,7 +36,7 @@ void GameInstallDialog::Browse() { } QWidget* GameInstallDialog::SetupGamesDirectory() { - auto group = new QGroupBox("Directory to install games"); + auto group = new QGroupBox(tr("Directory to install games")); auto layout = new QHBoxLayout(group); // Input. @@ -47,7 +47,7 @@ QWidget* GameInstallDialog::SetupGamesDirectory() { layout->addWidget(m_gamesDirectory); // Browse button. - auto browse = new QPushButton("Browse"); + auto browse = new QPushButton(tr("Browse")); connect(browse, &QPushButton::clicked, this, &GameInstallDialog::Browse); @@ -71,7 +71,7 @@ void GameInstallDialog::Save() { if (gamesDirectory.isEmpty() || !QDir(gamesDirectory).exists() || !QDir::isAbsolutePath(gamesDirectory)) { - QMessageBox::critical(this, "Error", + QMessageBox::critical(this, tr("Error"), "The value for location to install games is not valid."); return; } diff --git a/src/qt_gui/game_list_utils.h b/src/qt_gui/game_list_utils.h index 8f934388d..7911ce46f 100644 --- a/src/qt_gui/game_list_utils.h +++ b/src/qt_gui/game_list_utils.h @@ -4,7 +4,7 @@ #pragma once struct GameInfo { - std::string path; // root path of game directory (normaly directory that contains eboot.bin) + std::string path; // root path of game directory (normally directory that contains eboot.bin) std::string icon_path; // path of icon0.png std::string pic_path; // path of pic1.png QImage icon; diff --git a/src/qt_gui/gui_context_menus.h b/src/qt_gui/gui_context_menus.h index 16afdb188..c43ff8f87 100644 --- a/src/qt_gui/gui_context_menus.h +++ b/src/qt_gui/gui_context_menus.h @@ -10,6 +10,7 @@ #include #include +#include "cheats_patches.h" #include "game_info.h" #include "trophy_viewer.h" @@ -20,6 +21,7 @@ #include #include #endif +#include "common/path_util.h" class GuiContextMenus : public QObject { Q_OBJECT @@ -34,23 +36,30 @@ public: itemID = widget->currentRow() * widget->columnCount() + widget->currentColumn(); } + // Do not show the menu if an item is selected + if (itemID == -1) { + return; + } + // Setup menu. QMenu menu(widget); - QAction createShortcut("Create Shortcut", widget); - QAction openFolder("Open Game Folder", widget); - QAction openSfoViewer("SFO Viewer", widget); - QAction openTrophyViewer("Trophy Viewer", widget); + QAction createShortcut(tr("Create Shortcut"), widget); + QAction openFolder(tr("Open Game Folder"), widget); + QAction openCheats(tr("Cheats / Patches"), widget); + QAction openSfoViewer(tr("SFO Viewer"), widget); + QAction openTrophyViewer(tr("Trophy Viewer"), widget); menu.addAction(&openFolder); menu.addAction(&createShortcut); + menu.addAction(&openCheats); menu.addAction(&openSfoViewer); menu.addAction(&openTrophyViewer); // "Copy" submenu. - QMenu* copyMenu = new QMenu("Copy info", widget); - QAction* copyName = new QAction("Copy Name", widget); - QAction* copySerial = new QAction("Copy Serial", widget); - QAction* copyNameAll = new QAction("Copy All", widget); + QMenu* copyMenu = new QMenu(tr("Copy info"), widget); + QAction* copyName = new QAction(tr("Copy Name"), widget); + QAction* copySerial = new QAction(tr("Copy Serial"), widget); + QAction* copyNameAll = new QAction(tr("Copy All"), widget); copyMenu->addAction(copyName); copyMenu->addAction(copySerial); @@ -116,11 +125,24 @@ public: tableWidget->horizontalHeader()->setVisible(false); tableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Fixed); - tableWidget->setWindowTitle("SFO Viewer"); + tableWidget->setWindowTitle(tr("SFO Viewer")); tableWidget->show(); } } + if (selected == &openCheats) { + QString gameName = QString::fromStdString(m_games[itemID].name); + QString gameSerial = QString::fromStdString(m_games[itemID].serial); + QString gameVersion = QString::fromStdString(m_games[itemID].version); + QString gameSize = QString::fromStdString(m_games[itemID].size); + QPixmap gameImage(QString::fromStdString(m_games[itemID].icon_path)); + CheatsPatches* cheatsPatches = + new CheatsPatches(gameName, gameSerial, gameVersion, gameSize, gameImage); + cheatsPatches->show(); + connect(widget->parent(), &QWidget::destroyed, cheatsPatches, + [widget, cheatsPatches]() { cheatsPatches->deleteLater(); }); + } + if (selected == &openTrophyViewer) { QString trophyPath = QString::fromStdString(m_games[itemID].serial); QString gameTrpPath = QString::fromStdString(m_games[itemID].path); @@ -170,15 +192,15 @@ public: if (createShortcutLinux(linkPath, ebootPath, iconPath)) { #endif QMessageBox::information( - nullptr, "Shortcut creation", - QString("Shortcut created successfully!\n %1").arg(linkPath)); + nullptr, tr("Shortcut creation"), + QString(tr("Shortcut created successfully!\n %1")).arg(linkPath)); } else { QMessageBox::critical( - nullptr, "Error", - QString("Error creating shortcut!\n %1").arg(linkPath)); + nullptr, tr("Error"), + QString(tr("Error creating shortcut!\n %1")).arg(linkPath)); } } else { - QMessageBox::critical(nullptr, "Error", "Failed to convert icon."); + QMessageBox::critical(nullptr, tr("Error"), tr("Failed to convert icon.")); } } else { // If the icon is already in ICO format, we just create the shortcut @@ -188,11 +210,12 @@ public: if (createShortcutLinux(linkPath, ebootPath, iconPath)) { #endif QMessageBox::information( - nullptr, "Shortcut creation", - QString("Shortcut created successfully!\n %1").arg(linkPath)); + nullptr, tr("Shortcut creation"), + QString(tr("Shortcut created successfully!\n %1")).arg(linkPath)); } else { - QMessageBox::critical(nullptr, "Error", - QString("Error creating shortcut!\n %1").arg(linkPath)); + QMessageBox::critical( + nullptr, tr("Error"), + QString(tr("Error creating shortcut!\n %1")).arg(linkPath)); } } } @@ -249,7 +272,7 @@ public: int itemIndex = GetRowIndex(treeWidget, currentItem); // row QMenu menu(treeWidget); - QAction installPackage("Install PKG", treeWidget); + QAction installPackage(tr("Install PKG"), treeWidget); menu.addAction(&installPackage); diff --git a/src/qt_gui/main_window.cpp b/src/qt_gui/main_window.cpp index b6711d719..23668ef78 100644 --- a/src/qt_gui/main_window.cpp +++ b/src/qt_gui/main_window.cpp @@ -5,6 +5,7 @@ #include #include "about_dialog.h" +#include "cheats_patches.h" #include "common/io_file.h" #include "common/version.h" #include "core/file_format/pkg.h" @@ -37,6 +38,7 @@ bool MainWindow::Init() { SetLastUsedTheme(); SetLastIconSizeBullet(); GetPhysicalDevices(); + LoadTranslation(); // show ui setMinimumSize(350, minimumSizeHint().height()); setWindowTitle(QString::fromStdString("shadPS4 v" + std::string(Common::VERSION))); @@ -115,7 +117,7 @@ void MainWindow::CreateDockWindows() { m_elf_viewer->hide(); m_game_list_frame->show(); m_dock_widget->setWidget(m_game_list_frame.data()); - slider_pos = Config::getSliderPositon(); + slider_pos = Config::getSliderPosition(); ui->sizeSlider->setSliderPosition(slider_pos); // set slider pos at start; isTableList = true; } else if (table_mode == 1) { // Grid @@ -123,7 +125,7 @@ void MainWindow::CreateDockWindows() { m_elf_viewer->hide(); m_game_grid_frame->show(); m_dock_widget->setWidget(m_game_grid_frame.data()); - slider_pos = Config::getSliderPositonGrid(); + slider_pos = Config::getSliderPositionGrid(); ui->sizeSlider->setSliderPosition(slider_pos); // set slider pos at start; isTableList = false; } else { @@ -163,7 +165,7 @@ void MainWindow::GetPhysicalDevices() { auto prop = physical_device.getProperties(); QString name = QString::fromUtf8(prop.deviceName, -1); if (prop.apiVersion < Vulkan::TargetVulkanApiVersion) { - name += " * Unsupported Vulkan Version"; + name += tr(" * Unsupported Vulkan Version"); } m_physical_devices.push_back(name); } @@ -183,12 +185,12 @@ void MainWindow::CreateConnects() { 36 + value; // 36 is the minimum icon size to use due to text disappearing. m_game_list_frame->ResizeIcons(36 + value); Config::setIconSize(36 + value); - Config::setSliderPositon(value); + Config::setSliderPosition(value); } else { m_game_grid_frame->icon_size = 69 + value; m_game_grid_frame->PopulateGameGrid(m_game_info->m_games, false); Config::setIconSizeGrid(69 + value); - Config::setSliderPositonGrid(value); + Config::setSliderPositionGrid(value); } }); @@ -200,11 +202,19 @@ void MainWindow::CreateConnects() { connect(ui->configureAct, &QAction::triggered, this, [this]() { auto settingsDialog = new SettingsDialog(m_physical_devices, this); + + connect(settingsDialog, &SettingsDialog::LanguageChanged, this, + &MainWindow::OnLanguageChanged); + settingsDialog->exec(); }); connect(ui->settingsButton, &QPushButton::clicked, this, [this]() { auto settingsDialog = new SettingsDialog(m_physical_devices, this); + + connect(settingsDialog, &SettingsDialog::LanguageChanged, this, + &MainWindow::OnLanguageChanged); + settingsDialog->exec(); }); @@ -219,11 +229,11 @@ void MainWindow::CreateConnects() { 36; // 36 is the minimum icon size to use due to text disappearing. ui->sizeSlider->setValue(0); // icone_size - 36 Config::setIconSize(36); - Config::setSliderPositon(0); + Config::setSliderPosition(0); } else { ui->sizeSlider->setValue(0); // icone_size - 36 Config::setIconSizeGrid(69); - Config::setSliderPositonGrid(0); + Config::setSliderPositionGrid(0); } }); @@ -232,11 +242,11 @@ void MainWindow::CreateConnects() { m_game_list_frame->icon_size = 64; ui->sizeSlider->setValue(28); Config::setIconSize(64); - Config::setSliderPositon(28); + Config::setSliderPosition(28); } else { ui->sizeSlider->setValue(28); Config::setIconSizeGrid(97); - Config::setSliderPositonGrid(28); + Config::setSliderPositionGrid(28); } }); @@ -245,11 +255,11 @@ void MainWindow::CreateConnects() { m_game_list_frame->icon_size = 128; ui->sizeSlider->setValue(92); Config::setIconSize(128); - Config::setSliderPositon(92); + Config::setSliderPosition(92); } else { ui->sizeSlider->setValue(92); Config::setIconSizeGrid(160); - Config::setSliderPositonGrid(91); + Config::setSliderPositionGrid(91); } }); @@ -258,11 +268,11 @@ void MainWindow::CreateConnects() { m_game_list_frame->icon_size = 256; ui->sizeSlider->setValue(220); Config::setIconSize(256); - Config::setSliderPositon(220); + Config::setSliderPosition(220); } else { ui->sizeSlider->setValue(220); Config::setIconSizeGrid(256); - Config::setSliderPositonGrid(220); + Config::setSliderPositionGrid(220); } }); // List @@ -277,7 +287,7 @@ void MainWindow::CreateConnects() { } isTableList = true; Config::setTableMode(0); - int slider_pos = Config::getSliderPositon(); + int slider_pos = Config::getSliderPosition(); ui->sizeSlider->setEnabled(true); ui->sizeSlider->setSliderPosition(slider_pos); }); @@ -293,7 +303,7 @@ void MainWindow::CreateConnects() { } isTableList = false; Config::setTableMode(1); - int slider_pos_grid = Config::getSliderPositonGrid(); + int slider_pos_grid = Config::getSliderPositionGrid(); ui->sizeSlider->setEnabled(true); ui->sizeSlider->setSliderPosition(slider_pos_grid); }); @@ -308,6 +318,83 @@ void MainWindow::CreateConnects() { Config::setTableMode(2); }); + // Cheats/Patches Download. + connect(ui->downloadCheatsPatchesAct, &QAction::triggered, this, [this]() { + QDialog* panelDialog = new QDialog(this); + QVBoxLayout* layout = new QVBoxLayout(panelDialog); + QPushButton* downloadAllCheatsButton = + new QPushButton(tr("Download Cheats For All Installed Games"), panelDialog); + QPushButton* downloadAllPatchesButton = + new QPushButton(tr("Download Patches For All Games"), panelDialog); + + layout->addWidget(downloadAllCheatsButton); + layout->addWidget(downloadAllPatchesButton); + + panelDialog->setLayout(layout); + + connect(downloadAllCheatsButton, &QPushButton::clicked, this, [this, panelDialog]() { + QEventLoop eventLoop; + int pendingDownloads = 0; + + auto onDownloadFinished = [&]() { + if (--pendingDownloads <= 0) { + eventLoop.quit(); + } + }; + + for (const GameInfo& game : m_game_info->m_games) { + QString empty = ""; + QString gameSerial = QString::fromStdString(game.serial); + QString gameVersion = QString::fromStdString(game.version); + + CheatsPatches* cheatsPatches = + new CheatsPatches(empty, empty, empty, empty, empty, nullptr); + connect(cheatsPatches, &CheatsPatches::downloadFinished, onDownloadFinished); + + pendingDownloads += 3; + + cheatsPatches->downloadCheats("wolf2022", gameSerial, gameVersion, false); + cheatsPatches->downloadCheats("GoldHEN", gameSerial, gameVersion, false); + cheatsPatches->downloadCheats("shadPS4", gameSerial, gameVersion, false); + } + eventLoop.exec(); + + QMessageBox::information( + nullptr, tr("Download Complete"), + tr("You have downloaded cheats for all the games you have installed.")); + + panelDialog->accept(); + }); + connect(downloadAllPatchesButton, &QPushButton::clicked, this, [this, panelDialog]() { + QEventLoop eventLoop; + int pendingDownloads = 0; + + auto onDownloadFinished = [&]() { + if (--pendingDownloads <= 0) { + eventLoop.quit(); + } + }; + + QString empty = ""; + CheatsPatches* cheatsPatches = + new CheatsPatches(empty, empty, empty, empty, empty, nullptr); + connect(cheatsPatches, &CheatsPatches::downloadFinished, onDownloadFinished); + + pendingDownloads += 2; + + cheatsPatches->downloadPatches("GoldHEN", false); + cheatsPatches->downloadPatches("shadPS4", false); + + eventLoop.exec(); + QMessageBox::information( + nullptr, tr("Download Complete"), + QString(tr("Patches Downloaded Successfully!") + "\n" + + tr("All Patches available for all games have been downloaded."))); + panelDialog->accept(); + }); + panelDialog->exec(); + }); + // Dump game list. connect(ui->dumpGameListAct, &QAction::triggered, this, [&] { QString filePath = qApp->applicationDirPath().append("/GameList.txt"); @@ -459,7 +546,7 @@ void MainWindow::RefreshGameTable() { m_game_grid_frame->PopulateGameGrid(m_game_info->m_games, false); statusBar->clearMessage(); int numGames = m_game_info->m_games.size(); - QString statusMessage = "Games: " + QString::number(numGames); + QString statusMessage = tr("Games: ") + QString::number(numGames); statusBar->showMessage(statusMessage); } @@ -510,7 +597,8 @@ void MainWindow::BootGame() { int nFiles = fileNames.size(); if (nFiles > 1) { - QMessageBox::critical(nullptr, "Game Boot", QString("Only one file can be selected!")); + QMessageBox::critical(nullptr, tr("Game Boot"), + QString(tr("Only one file can be selected!"))); } else { std::filesystem::path path(fileNames[0].toStdString()); #ifdef _WIN64 @@ -533,7 +621,7 @@ void MainWindow::InstallDragDropPkg(std::filesystem::path file, int pkgNum, int QDir game_dir(QString::fromStdString(extract_path.string())); if (game_dir.exists()) { QMessageBox msgBox; - msgBox.setWindowTitle("PKG Extraction"); + msgBox.setWindowTitle(tr("PKG Extraction")); if (pkgType.contains("PATCH")) { psf.open("", pkg.sfo); QString pkg_app_version = QString::fromStdString(psf.GetString("APP_VER")); @@ -542,23 +630,24 @@ void MainWindow::InstallDragDropPkg(std::filesystem::path file, int pkgNum, int double appD = game_app_version.toDouble(); double pkgD = pkg_app_version.toDouble(); if (pkgD == appD) { - msgBox.setText( - QString("Patch detected!\nPKG and Game versions match!: %1\nWould you like " - "to overwrite?") - .arg(pkg_app_version)); + msgBox.setText(QString(tr("Patch detected!\nPKG and Game versions match!: " + "%1\nWould you like ") + + tr("to overwrite?")) + .arg(pkg_app_version)); msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No); msgBox.setDefaultButton(QMessageBox::No); } else if (pkgD < appD) { - msgBox.setText(QString("Patch detected!\nPKG Version %1 is older " - "than installed version!: %2\nWould you like " - "to overwrite?") + msgBox.setText(QString(tr("Patch detected!\nPKG Version %1 is older ") + + tr("than installed version!: %2\nWould you like ") + + tr("to overwrite?")) .arg(pkg_app_version, game_app_version)); msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No); msgBox.setDefaultButton(QMessageBox::No); } else { - msgBox.setText(QString("Patch detected!\nGame is installed: %1\nWould you like " - "to install Patch: %2?") - .arg(game_app_version, pkg_app_version)); + msgBox.setText( + QString(tr("Patch detected!\nGame is installed: %1\nWould you like ") + + tr("to install Patch: %2?")) + .arg(game_app_version, pkg_app_version)); msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No); msgBox.setDefaultButton(QMessageBox::No); } @@ -569,8 +658,9 @@ void MainWindow::InstallDragDropPkg(std::filesystem::path file, int pkgNum, int return; } } else { - msgBox.setText(QString("Game already installed\n%1\nWould you like to overwrite?") - .arg(QString::fromStdString(extract_path.string()))); + msgBox.setText( + QString(tr("Game already installed\n%1\nWould you like to overwrite?")) + .arg(QString::fromStdString(extract_path.string()))); msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No); msgBox.setDefaultButton(QMessageBox::No); int result = msgBox.exec(); @@ -583,15 +673,15 @@ void MainWindow::InstallDragDropPkg(std::filesystem::path file, int pkgNum, int } else { // Do nothing; if (pkgType.contains("PATCH")) { - QMessageBox::information(this, "PKG Extraction", - "PKG is a patch, please install the game first!"); + QMessageBox::information(this, tr("PKG Extraction"), + tr("PKG is a patch, please install the game first!")); return; } // what else? } if (!pkg.Extract(file, extract_path, failreason)) { - QMessageBox::critical(this, "PKG ERROR", QString::fromStdString(failreason)); + QMessageBox::critical(this, tr("PKG ERROR"), QString::fromStdString(failreason)); } else { int nfiles = pkg.GetNumberOfFiles(); @@ -601,9 +691,9 @@ void MainWindow::InstallDragDropPkg(std::filesystem::path file, int pkgNum, int } QProgressDialog dialog; - dialog.setWindowTitle("PKG Extraction"); + dialog.setWindowTitle(tr("PKG Extraction")); dialog.setWindowModality(Qt::WindowModal); - QString extractmsg = QString("Extracting PKG %1/%2").arg(pkgNum).arg(nPkg); + QString extractmsg = QString(tr("Extracting PKG %1/%2")).arg(pkgNum).arg(nPkg); dialog.setLabelText(extractmsg); dialog.setAutoClose(true); dialog.setRange(0, nfiles); @@ -613,8 +703,9 @@ void MainWindow::InstallDragDropPkg(std::filesystem::path file, int pkgNum, int if (pkgNum == nPkg) { QString path = QString::fromStdString(Config::getGameInstallDir()); QMessageBox extractMsgBox(this); - extractMsgBox.setWindowTitle("Extraction Finished"); - extractMsgBox.setText(QString("Game successfully installed at %1").arg(path)); + extractMsgBox.setWindowTitle(tr("Extraction Finished")); + extractMsgBox.setText( + QString(tr("Game successfully installed at %1")).arg(path)); extractMsgBox.addButton(QMessageBox::Ok); extractMsgBox.setDefaultButton(QMessageBox::Ok); connect(&extractMsgBox, &QMessageBox::buttonClicked, this, @@ -635,7 +726,8 @@ void MainWindow::InstallDragDropPkg(std::filesystem::path file, int pkgNum, int dialog.exec(); } } else { - QMessageBox::critical(this, "PKG ERROR", "File doesn't appear to be a valid PKG file"); + QMessageBox::critical(this, tr("PKG ERROR"), + tr("File doesn't appear to be a valid PKG file")); } } @@ -781,3 +873,35 @@ void MainWindow::CreateRecentGameActions() { emulator.Run(gamePath.toUtf8().constData()); }); } + +void MainWindow::LoadTranslation() { + auto language = QString::fromStdString(Config::getEmulatorLanguage()); + + const QString base_dir = QStringLiteral(":/translations"); + QString base_path = QStringLiteral("%1/%2.qm").arg(base_dir).arg(language); + + if (QFile::exists(base_path)) { + if (translator != nullptr) { + qApp->removeTranslator(translator); + } + + translator = new QTranslator(qApp); + if (!translator->load(base_path)) { + QMessageBox::warning( + nullptr, QStringLiteral("Translation Error"), + QStringLiteral("Failed to find load translation file for '%1':\n%2") + .arg(language) + .arg(base_path)); + delete translator; + } else { + qApp->installTranslator(translator); + ui->retranslateUi(this); + } + } +} + +void MainWindow::OnLanguageChanged(const std::string& locale) { + Config::setEmulatorLanguage(locale); + + LoadTranslation(); +} \ No newline at end of file diff --git a/src/qt_gui/main_window.h b/src/qt_gui/main_window.h index 1abe17625..d3b83e619 100644 --- a/src/qt_gui/main_window.h +++ b/src/qt_gui/main_window.h @@ -5,6 +5,7 @@ #include #include +#include #include "common/config.h" #include "common/path_util.h" @@ -43,6 +44,7 @@ private Q_SLOTS: void ShowGameList(); void RefreshGameTable(); void HandleResize(QResizeEvent* event); + void OnLanguageChanged(const std::string& locale); private: Ui_MainWindow* ui; @@ -59,6 +61,7 @@ private: void InstallPkg(); void BootGame(); void AddRecentFiles(QString filePath); + void LoadTranslation(); QIcon RecolorIcon(const QIcon& icon, bool isWhite); bool isIconBlack = false; bool isTableList = true; @@ -84,6 +87,8 @@ private: std::shared_ptr m_game_info = std::make_shared(); + QTranslator* translator; + protected: void dragEnterEvent(QDragEnterEvent* event1) override { if (event1->mimeData()->hasUrls()) { diff --git a/src/qt_gui/main_window_ui.h b/src/qt_gui/main_window_ui.h index 1a2a560e0..498cec735 100644 --- a/src/qt_gui/main_window_ui.h +++ b/src/qt_gui/main_window_ui.h @@ -25,6 +25,7 @@ public: QAction* setlistModeGridAct; QAction* setlistElfAct; QAction* gameInstallPathAct; + QAction* downloadCheatsPatchesAct; QAction* dumpGameListAct; QAction* pkgViewerAct; QAction* aboutAct; @@ -120,11 +121,12 @@ public: gameInstallPathAct = new QAction(MainWindow); gameInstallPathAct->setObjectName("gameInstallPathAct"); gameInstallPathAct->setIcon(QIcon(":images/folder_icon.png")); + downloadCheatsPatchesAct = new QAction(MainWindow); + downloadCheatsPatchesAct->setObjectName("downloadCheatsPatchesAct"); dumpGameListAct = new QAction(MainWindow); dumpGameListAct->setObjectName("dumpGameList"); pkgViewerAct = new QAction(MainWindow); pkgViewerAct->setObjectName("pkgViewer"); - pkgViewerAct->setObjectName("pkgViewer"); pkgViewerAct->setIcon(QIcon(":images/file_icon.png")); aboutAct = new QAction(MainWindow); aboutAct->setObjectName("aboutAct"); @@ -277,6 +279,7 @@ public: menuSettings->addAction(configureAct); menuSettings->addAction(gameInstallPathAct); menuSettings->addAction(menuUtils->menuAction()); + menuUtils->addAction(downloadCheatsPatchesAct); menuUtils->addAction(dumpGameListAct); menuUtils->addAction(pkgViewerAct); menuAbout->addAction(aboutAct); @@ -323,6 +326,8 @@ public: setlistElfAct->setText(QCoreApplication::translate("MainWindow", "Elf Viewer", nullptr)); gameInstallPathAct->setText( QCoreApplication::translate("MainWindow", "Game Install Directory", nullptr)); + downloadCheatsPatchesAct->setText( + QCoreApplication::translate("MainWindow", "Download Cheats/Patches", nullptr)); dumpGameListAct->setText( QCoreApplication::translate("MainWindow", "Dump Game List", nullptr)); pkgViewerAct->setText(QCoreApplication::translate("MainWindow", "PKG Viewer", nullptr)); diff --git a/src/qt_gui/memory_patcher.cpp b/src/qt_gui/memory_patcher.cpp new file mode 100644 index 000000000..d5ffa1c99 --- /dev/null +++ b/src/qt_gui/memory_patcher.cpp @@ -0,0 +1,347 @@ +// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "common/logging/log.h" +#include "common/path_util.h" +#include "memory_patcher.h" + +namespace MemoryPatcher { + +uintptr_t g_eboot_address; +u64 g_eboot_image_size; +std::string g_game_serial; +std::vector pending_patches; + +QString toHex(unsigned long long value, size_t byteSize) { + std::stringstream ss; + ss << std::hex << std::setfill('0') << std::setw(byteSize * 2) << value; + return QString::fromStdString(ss.str()); +} + +QString convertValueToHex(const QString& type, const QString& valueStr) { + QString result; + std::string typeStr = type.toStdString(); + std::string valueStrStd = valueStr.toStdString(); + + if (typeStr == "byte") { + unsigned int value = std::stoul(valueStrStd, nullptr, 16); + result = toHex(value, 1); + } else if (typeStr == "bytes16") { + unsigned int value = std::stoul(valueStrStd, nullptr, 16); + result = toHex(value, 2); + } else if (typeStr == "bytes32") { + unsigned long value = std::stoul(valueStrStd, nullptr, 16); + result = toHex(value, 4); + } else if (typeStr == "bytes64") { + unsigned long long value = std::stoull(valueStrStd, nullptr, 16); + result = toHex(value, 8); + } else if (typeStr == "float32") { + union { + float f; + uint32_t i; + } floatUnion; + floatUnion.f = std::stof(valueStrStd); + result = toHex(floatUnion.i, sizeof(floatUnion.i)); + } else if (typeStr == "float64") { + union { + double d; + uint64_t i; + } doubleUnion; + doubleUnion.d = std::stod(valueStrStd); + result = toHex(doubleUnion.i, sizeof(doubleUnion.i)); + } else if (typeStr == "utf8") { + QByteArray byteArray = QString::fromStdString(valueStrStd).toUtf8(); + byteArray.append('\0'); + std::stringstream ss; + for (unsigned char c : byteArray) { + ss << std::hex << std::setfill('0') << std::setw(2) << static_cast(c); + } + result = QString::fromStdString(ss.str()); + } else if (typeStr == "utf16") { + QByteArray byteArray( + reinterpret_cast(QString::fromStdString(valueStrStd).utf16()), + QString::fromStdString(valueStrStd).size() * 2); + byteArray.append('\0'); + byteArray.append('\0'); + std::stringstream ss; + for (unsigned char c : byteArray) { + ss << std::hex << std::setfill('0') << std::setw(2) << static_cast(c); + } + result = QString::fromStdString(ss.str()); + } else if (typeStr == "bytes") { + result = valueStr; + } else if (typeStr == "mask" || typeStr == "mask_jump32") { + result = valueStr; + } else { + LOG_INFO(Loader, "Error applying Patch, unknown type: {}", typeStr); + } + return result; +} + +void OnGameLoaded() { + + // We use the QT headers for the xml and json parsing, this define is only true on QT builds + QString patchDir = + QString::fromStdString(Common::FS::GetUserPath(Common::FS::PathType::PatchesDir).string()); + QString repositories[] = {"GoldHEN", "shadPS4"}; + + for (const QString& repository : repositories) { + QString filesJsonPath = patchDir + "/" + repository + "/files.json"; + + QFile jsonFile(filesJsonPath); + if (!jsonFile.open(QIODevice::ReadOnly)) { + LOG_ERROR(Loader, "Unable to open files.json for reading."); + continue; + } + + QByteArray jsonData = jsonFile.readAll(); + jsonFile.close(); + + QJsonDocument jsonDoc = QJsonDocument::fromJson(jsonData); + QJsonObject jsonObject = jsonDoc.object(); + + QString selectedFileName; + QString serial = QString::fromStdString(g_game_serial); + + for (auto it = jsonObject.constBegin(); it != jsonObject.constEnd(); ++it) { + QString filePath = it.key(); + QJsonArray idsArray = it.value().toArray(); + + if (idsArray.contains(QJsonValue(serial))) { + selectedFileName = filePath; + break; + } + } + + if (selectedFileName.isEmpty()) { + LOG_ERROR(Loader, "No patch file found for the current serial."); + continue; + } + + QString filePath = patchDir + "/" + repository + "/" + selectedFileName; + QFile file(filePath); + if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { + LOG_ERROR(Loader, "Unable to open the file for reading."); + continue; + } + + QByteArray xmlData = file.readAll(); + file.close(); + + QString newXmlData; + + QXmlStreamReader xmlReader(xmlData); + bool insideMetadata = false; + + bool isEnabled = false; + std::string currentPatchName; + while (!xmlReader.atEnd()) { + xmlReader.readNext(); + + if (xmlReader.isStartElement()) { + QJsonArray patchLines; + if (xmlReader.name() == QStringLiteral("Metadata")) { + insideMetadata = true; + + QString name = xmlReader.attributes().value("Name").toString(); + currentPatchName = name.toStdString(); + + // Check and update the isEnabled attribute + for (const QXmlStreamAttribute& attr : xmlReader.attributes()) { + if (attr.name() == QStringLiteral("isEnabled")) { + if (attr.value().toString() == "true") { + isEnabled = true; + } else + isEnabled = false; + } + } + } else if (xmlReader.name() == QStringLiteral("PatchList")) { + QJsonArray linesArray; + while (!xmlReader.atEnd() && + !(xmlReader.tokenType() == QXmlStreamReader::EndElement && + xmlReader.name() == QStringLiteral("PatchList"))) { + xmlReader.readNext(); + if (xmlReader.tokenType() == QXmlStreamReader::StartElement && + xmlReader.name() == QStringLiteral("Line")) { + QXmlStreamAttributes attributes = xmlReader.attributes(); + QJsonObject lineObject; + lineObject["Type"] = attributes.value("Type").toString(); + lineObject["Address"] = attributes.value("Address").toString(); + lineObject["Value"] = attributes.value("Value").toString(); + linesArray.append(lineObject); + } + } + + patchLines = linesArray; + if (isEnabled) { + foreach (const QJsonValue& value, patchLines) { + QJsonObject lineObject = value.toObject(); + QString type = lineObject["Type"].toString(); + QString address = lineObject["Address"].toString(); + QString patchValue = lineObject["Value"].toString(); + QString maskOffsetStr = lineObject["Offset"].toString(); + + patchValue = convertValueToHex(type, patchValue); + + bool littleEndian = false; + + if (type == "bytes16") { + littleEndian = true; + } else if (type == "bytes32") { + littleEndian = true; + } else if (type == "bytes64") { + littleEndian = true; + } + + MemoryPatcher::PatchMask patchMask = MemoryPatcher::PatchMask::None; + int maskOffsetValue = 0; + + if (type == "mask") { + patchMask = MemoryPatcher::PatchMask::Mask; + + // im not sure if this works, there is no games to test the mask + // offset on yet + if (!maskOffsetStr.toStdString().empty()) + maskOffsetValue = std::stoi(maskOffsetStr.toStdString(), 0, 10); + } + + if (type == "mask_jump32") + patchMask = MemoryPatcher::PatchMask::Mask_Jump32; + + MemoryPatcher::PatchMemory(currentPatchName, address.toStdString(), + patchValue.toStdString(), false, + littleEndian, patchMask); + } + } + } + } + } + + if (xmlReader.hasError()) { + LOG_ERROR(Loader, "Failed to parse XML for {}", g_game_serial); + } else { + LOG_INFO(Loader, "Patches loaded successfully"); + } + ApplyPendingPatches(); + } +} + +void AddPatchToQueue(patchInfo patchToAdd) { + pending_patches.push_back(patchToAdd); +} + +void ApplyPendingPatches() { + + for (size_t i = 0; i < pending_patches.size(); ++i) { + patchInfo currentPatch = pending_patches[i]; + + if (currentPatch.gameSerial != g_game_serial) + continue; + + PatchMemory(currentPatch.modNameStr, currentPatch.offsetStr, currentPatch.valueStr, + currentPatch.isOffset, currentPatch.littleEndian, currentPatch.patchMask, + currentPatch.maskOffset); + } + + pending_patches.clear(); +} + +void PatchMemory(std::string modNameStr, std::string offsetStr, std::string valueStr, bool isOffset, + bool littleEndian, PatchMask patchMask, int maskOffset) { + // Send a request to modify the process memory. + void* cheatAddress = nullptr; + + if (patchMask == PatchMask::None) { + if (isOffset) { + cheatAddress = reinterpret_cast(g_eboot_address + std::stoi(offsetStr, 0, 16)); + } else { + cheatAddress = + reinterpret_cast(g_eboot_address + (std::stoi(offsetStr, 0, 16) - 0x400000)); + } + } + + if (patchMask == PatchMask::Mask) { + cheatAddress = reinterpret_cast(PatternScan(offsetStr) + maskOffset); + } + + // TODO: implement mask_jump32 + + if (cheatAddress == nullptr) { + LOG_ERROR(Loader, "Failed to get address for patch {}", modNameStr); + return; + } + + std::vector bytePatch; + + for (size_t i = 0; i < valueStr.length(); i += 2) { + unsigned char byte = + static_cast(std::strtol(valueStr.substr(i, 2).c_str(), nullptr, 16)); + + bytePatch.push_back(byte); + } + + if (littleEndian) { + std::reverse(bytePatch.begin(), bytePatch.end()); + } + + std::memcpy(cheatAddress, bytePatch.data(), bytePatch.size()); + + LOG_INFO(Loader, "Applied patch: {}, Offset: {}, Value: {}", modNameStr, + (uintptr_t)cheatAddress, valueStr); +} + +static std::vector PatternToByte(const std::string& pattern) { + std::vector bytes; + const char* start = pattern.data(); + const char* end = start + pattern.size(); + + for (const char* current = start; current < end; ++current) { + if (*current == '?') { + ++current; + if (*current == '?') + ++current; + bytes.push_back(-1); + } else { + bytes.push_back(strtoul(current, const_cast(¤t), 16)); + } + } + + return bytes; +} + +uintptr_t PatternScan(const std::string& signature) { + std::vector patternBytes = PatternToByte(signature); + const auto scanBytes = static_cast((void*)g_eboot_address); + + const int32_t* sigPtr = patternBytes.data(); + const size_t sigSize = patternBytes.size(); + + uint32_t foundResults = 0; + for (uint32_t i = 0; i < g_eboot_image_size - sigSize; ++i) { + bool found = true; + for (uint32_t j = 0; j < sigSize; ++j) { + if (scanBytes[i + j] != sigPtr[j] && sigPtr[j] != -1) { + found = false; + break; + } + } + + if (found) { + foundResults++; + return reinterpret_cast(&scanBytes[i]); + } + } + + return 0; +} + +} // namespace MemoryPatcher \ No newline at end of file diff --git a/src/qt_gui/memory_patcher.h b/src/qt_gui/memory_patcher.h new file mode 100644 index 000000000..821184ade --- /dev/null +++ b/src/qt_gui/memory_patcher.h @@ -0,0 +1,47 @@ +// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once +#include +#include +#include +#include + +namespace MemoryPatcher { + +extern uintptr_t g_eboot_address; +extern u64 g_eboot_image_size; +extern std::string g_game_serial; + +enum PatchMask : uint8_t { + None, + Mask, + Mask_Jump32, +}; + +struct patchInfo { + std::string gameSerial; + std::string modNameStr; + std::string offsetStr; + std::string valueStr; + bool isOffset; + bool littleEndian; + PatchMask patchMask; + int maskOffset; +}; + +extern std::vector pending_patches; + +QString convertValueToHex(const QString& type, const QString& valueStr); + +void OnGameLoaded(); +void AddPatchToQueue(patchInfo patchToAdd); +void ApplyPendingPatches(); + +void PatchMemory(std::string modNameStr, std::string offsetStr, std::string valueStr, bool isOffset, + bool littleEndian, PatchMask patchMask = PatchMask::None, int maskOffset = 0); + +static std::vector PatternToByte(const std::string& pattern); +uintptr_t PatternScan(const std::string& signature); + +} // namespace MemoryPatcher \ No newline at end of file diff --git a/src/qt_gui/settings_dialog.cpp b/src/qt_gui/settings_dialog.cpp index 09247951a..d572915c6 100644 --- a/src/qt_gui/settings_dialog.cpp +++ b/src/qt_gui/settings_dialog.cpp @@ -2,7 +2,9 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include +#include +#include "main_window.h" #include "settings_dialog.h" #include "ui_settings_dialog.h" @@ -60,6 +62,7 @@ SettingsDialog::SettingsDialog(std::span physical_devices, QWidge completer->setCaseSensitivity(Qt::CaseInsensitive); ui->consoleLanguageComboBox->setCompleter(completer); + InitializeEmulatorLanguages(); LoadValuesFromConfig(); connect(ui->buttonBox, &QDialogButtonBox::rejected, this, &QWidget::close); @@ -158,6 +161,7 @@ void SettingsDialog::LoadValuesFromConfig() { languageIndexes.begin(), std::find(languageIndexes.begin(), languageIndexes.end(), Config::GetLanguage())) % languageIndexes.size()); + ui->emulatorLanguageComboBox->setCurrentIndex(languages[Config::getEmulatorLanguage()]); ui->graphicsAdapterBox->setCurrentIndex(Config::getGpuId() + 1); ui->widthSpinBox->setValue(Config::getScreenWidth()); ui->heightSpinBox->setValue(Config::getScreenHeight()); @@ -179,6 +183,35 @@ void SettingsDialog::LoadValuesFromConfig() { ui->rdocCheckBox->setChecked(Config::isRdocEnabled()); } +void SettingsDialog::InitializeEmulatorLanguages() { + QDirIterator it(QStringLiteral(":/translations"), QDirIterator::NoIteratorFlags); + + int idx = 0; + while (it.hasNext()) { + QString locale = it.next(); + locale.truncate(locale.lastIndexOf(QLatin1Char{'.'})); + locale.remove(0, locale.lastIndexOf(QLatin1Char{'/'}) + 1); + const QString lang = QLocale::languageToString(QLocale(locale).language()); + const QString country = QLocale::territoryToString(QLocale(locale).territory()); + ui->emulatorLanguageComboBox->addItem(QStringLiteral("%1 (%2)").arg(lang, country), locale); + + languages[locale.toStdString()] = idx; + idx++; + } + + connect(ui->emulatorLanguageComboBox, qOverload(&QComboBox::currentIndexChanged), this, + &SettingsDialog::OnLanguageChanged); +} + +void SettingsDialog::OnLanguageChanged(int index) { + if (index == -1) + return; + + ui->retranslateUi(this); + + emit LanguageChanged(ui->emulatorLanguageComboBox->itemData(index).toString().toStdString()); +} + int SettingsDialog::exec() { return QDialog::exec(); } diff --git a/src/qt_gui/settings_dialog.h b/src/qt_gui/settings_dialog.h index 7d8701093..ddae7daac 100644 --- a/src/qt_gui/settings_dialog.h +++ b/src/qt_gui/settings_dialog.h @@ -22,8 +22,15 @@ public: int exec() override; +signals: + void LanguageChanged(const std::string& locale); + private: void LoadValuesFromConfig(); + void InitializeEmulatorLanguages(); + void OnLanguageChanged(int index); std::unique_ptr ui; + + std::map languages; }; diff --git a/src/qt_gui/settings_dialog.ui b/src/qt_gui/settings_dialog.ui index d11f177d1..1ecd12495 100644 --- a/src/qt_gui/settings_dialog.ui +++ b/src/qt_gui/settings_dialog.ui @@ -79,32 +79,6 @@ System - - - - 6 - - - 0 - - - - - - - Username - - - - - - - - - - - - @@ -117,6 +91,18 @@ + + + + Emulator Language + + + + + + + + @@ -156,17 +142,30 @@ - - - Qt::Orientation::Horizontal + + + 6 - - - 40 - 20 - + + 0 - + + + + + + Username + + + + + + + + + + + diff --git a/src/qt_gui/translations/da_DK.ts b/src/qt_gui/translations/da_DK.ts new file mode 100644 index 000000000..de9097f2b --- /dev/null +++ b/src/qt_gui/translations/da_DK.ts @@ -0,0 +1,892 @@ + + + + AboutDialog + + + About shadPS4 + About shadPS4 + + + + shadPS4 + shadPS4 + + + + shadPS4 is an experimental open-source emulator for the PlayStation 4. + shadPS4 is an experimental open-source emulator for the PlayStation 4. + + + + This software should not be used to play games you have not legally obtained. + This software should not be used to play games you have not legally obtained. + + + + ElfViewer + + + Open Folder + Open Folder + + + + GameInfoClass + + + Loading game list, please wait :3 + Loading game list, please wait :3 + + + + Cancel + Cancel + + + + Loading... + Loading... + + + + GameInstallDialog + + + shadPS4 - Choose directory + shadPS4 - Choose directory + + + + Directory to install games + Directory to install games + + + + Browse + Browse + + + + Error + Error + + + + The value for location to install games is not valid. + The value for location to install games is not valid. + + + + GuiContextMenus + + + Create Shortcut + Create Shortcut + + + + Open Game Folder + Open Game Folder + + + + Cheats / Patches + Trick / Patches + + + + SFO Viewer + SFO Viewer + + + + Trophy Viewer + Trophy Viewer + + + + Copy info + Copy info + + + + Copy Name + Copy Name + + + + Copy Serial + Copy Serial + + + + Copy All + Copy All + + + + Shortcut creation + Shortcut creation + + + + Shortcut created successfully!\n %1 + Shortcut created successfully!\n %1 + + + + Error + Error + + + + Error creating shortcut!\n %1 + Error creating shortcut!\n %1 + + + + Install PKG + Install PKG + + + + MainWindow + + + Open/Add Elf Folder + Open/Add Elf Folder + + + + Install Packages (PKG) + Install Packages (PKG) + + + + Boot Game + Boot Game + + + + About shadPS4 + About shadPS4 + + + + Configure... + Configure... + + + + Install application from a .pkg file + Install application from a .pkg file + + + + Recent Games + Recent Games + + + + Exit + Exit + + + + Exit shadPS4 + Exit shadPS4 + + + + Exit the application. + Exit the application. + + + + Show Game List + Show Game List + + + + Game List Refresh + Game List Refresh + + + + Tiny + Tiny + + + + Small + Small + + + + Medium + Medium + + + + Large + Large + + + + List View + List View + + + + Grid View + Grid View + + + + Elf Viewer + Elf Viewer + + + + Game Install Directory + Game Install Directory + + + + Download Cheats/Patches + Download Tricks / Patches + + + + Dump Game List + Dump Game List + + + + PKG Viewer + PKG Viewer + + + + Search... + Search... + + + + File + File + + + + View + View + + + + Game List Icons + Game List Icons + + + + Game List Mode + Game List Mode + + + + Settings + Settings + + + + Utils + Utils + + + + Themes + Themes + + + + About + About + + + + Dark + Dark + + + + Light + Light + + + + Green + Green + + + + Blue + Blue + + + + Violet + Violet + + + + toolBar + toolBar + + + + PKGViewer + + + Open Folder + Open Folder + + + + TrophyViewer + + + Trophy Viewer + Trophy Viewer + + + + SettingsDialog + + + Settings + Settings + + + + General + General + + + + System + System + + + + Console Language + Console Language + + + + Emulator Language + Emulator Language + + + + Emulator + Emulator + + + + Enable Fullscreen + Enable Fullscreen + + + + Show Splash + Show Splash + + + + Is PS4 Pro + Is PS4 Pro + + + + Username + Username + + + + Logger + Logger + + + + Log Type + Log Type + + + + Log Filter + Log Filter + + + + Graphics + Graphics + + + + Graphics Device + Graphics Device + + + + Width + Width + + + + Height + Height + + + + Vblank Divider + Vblank Divider + + + + Advanced + Advanced + + + + Enable Shaders Dumping + Enable Shaders Dumping + + + + Enable NULL GPU + Enable NULL GPU + + + + Enable PM4 Dumping + Enable PM4 Dumping + + + + Debug + Debug + + + + Enable Debug Dumping + Enable Debug Dumping + + + + Enable Vulkan Validation Layers + Enable Vulkan Validation Layers + + + + Enable Vulkan Synchronization Validation + Enable Vulkan Synchronization Validation + + + + Enable RenderDoc Debugging + Enable RenderDoc Debugging + + + + MainWindow + + + * Unsupported Vulkan Version + * Ikke understøttet Vulkan-version + + + + Download Cheats For All Installed Games + Hent snyd til alle installerede spil + + + + Download Patches For All Games + Hent patches til alle spil + + + + Download Complete + Download fuldført + + + + You have downloaded cheats for all the games you have installed. + Du har hentet snyd til alle de spil, du har installeret. + + + + Patches Downloaded Successfully! + Patcher hentet med succes! + + + + All Patches available for all games have been downloaded. + Alle patches til alle spil er blevet hentet. + + + + Games: + Spil: + + + + PKG File (*.PKG) + PKG-fil (*.PKG) + + + + ELF files (*.bin *.elf *.oelf) + ELF-filer (*.bin *.elf *.oelf) + + + + Game Boot + Spil-boot + + + + Only one file can be selected! + Kun én fil kan vælges! + + + + PKG Extraction + PKG-udtrækning + + + + Patch detected!\nPKG and Game versions match!: %1\nWould you like + Patch opdaget!\nPKG- og spilversioner stemmer overens!: %1\nVil du + + + + to overwrite? + overskrive? + + + + Patch detected!\nPKG Version %1 is older + Patch opdaget!\nPKG-version %1 er ældre + + + + than installed version!: %2\nWould you like + end installeret version!: %2\nVil du + + + + to overwrite? + overskrive? + + + + Patch detected!\nGame is installed: %1\nWould you like + Patch opdaget!\nSpillet er installeret: %1\nVil du + + + + to install Patch: %2? + installere patch: %2? + + + + Game already installed\n%1\nWould you like to overwrite? + Spil allerede installeret\n%1\nVil du overskrive? + + + + PKG is a patch, please install the game first! + PKG er en patch, venligst installer spillet først! + + + + PKG ERROR + PKG FEJL + + + + Extracting PKG %1/%2 + Udvinding af PKG %1/%2 + + + + Extraction Finished + Udvinding afsluttet + + + + Game successfully installed at %1 + Spillet blev installeret succesfuldt på %1 + + + + File doesn't appear to be a valid PKG file + Filen ser ikke ud til at være en gyldig PKG-fil + + + + CheatsPatches + + + Cheats / Patches + Snyd / Patches + + + + defaultTextEdit_MSG + Cheats/Patches er eksperimentelle.\nBrug med forsigtighed.\n\nDownload cheats individuelt ved at vælge lageret og klikke på download-knappen.\nUnder fanen Patches kan du downloade alle patches på én gang, vælge hvilke du vil bruge og gemme valget.\n\nDa vi ikke udvikler cheats/patches,\nvenligst rapporter problemer til cheat-udvikleren.\n\nHar du lavet en ny cheat? Besøg:\nhttps://github.com/shadps4-emu/ps4_cheats + + + + No Image Available + Ingen billede tilgængelig + + + + Serial: + Serienummer: + + + + Version: + Version: + + + + Size: + Størrelse: + + + + Select Cheat File: + Vælg snyd-fil: + + + + Repository: + Repository: + + + + Download Cheats + Hent snyd + + + + Delete File + Slet fil + + + + No files selected. + Ingen filer valgt. + + + + You can delete the cheats you don't want after downloading them. + Du kan slette de snyd, du ikke ønsker, efter at have hentet dem. + + + + Do you want to delete the selected file?\n%1 + Ønsker du at slette den valgte fil?\n%1 + + + + Select Patch File: + Vælg patch-fil: + + + + Download Patches + Hent patches + + + + Save + Gem + + + + Cheats + Snyd + + + + Patches + Patches + + + + Error + Fejl + + + + No patch selected. + Ingen patch valgt. + + + + Unable to open files.json for reading. + Kan ikke åbne files.json til læsning. + + + + No patch file found for the current serial. + Ingen patch-fil fundet for det nuværende serienummer. + + + + Unable to open the file for reading. + Kan ikke åbne filen til læsning. + + + + Unable to open the file for writing. + Kan ikke åbne filen til skrivning. + + + + Failed to parse XML: + Kunne ikke analysere XML: + + + + Success + Succes + + + + Options saved successfully. + Indstillinger gemt med succes. + + + + Invalid Source + Ugyldig kilde + + + + The selected source is invalid. + Den valgte kilde er ugyldig. + + + + File Exists + Fil findes + + + + File already exists. Do you want to replace it? + Filen findes allerede. Vil du erstatte den? + + + + Failed to save file: + Kunne ikke gemme fil: + + + + Failed to download file: + Kunne ikke hente fil: + + + + Cheats Not Found + Snyd ikke fundet + + + + CheatsNotFound_MSG + Ingen snyd fundet til dette spil i denne version af det valgte repository, prøv et andet repository eller en anden version af spillet. + + + + Cheats Downloaded Successfully + Snyd hentet med succes + + + + CheatsDownloadedSuccessfully_MSG + Du har succesfuldt hentet snyd for denne version af spillet fra det valgte repository. Du kan prøve at hente fra et andet repository, hvis det er tilgængeligt, vil det også være muligt at bruge det ved at vælge filen fra listen. + + + + Failed to save: + Kunne ikke gemme: + + + + Failed to download: + Kunne ikke hente: + + + + Download Complete + Download fuldført + + + + DownloadComplete_MSG + Patcher hentet med succes! Alle patches til alle spil er blevet hentet, der er ikke behov for at hente dem individuelt for hvert spil, som det sker med snyd. + + + + Failed to parse JSON data from HTML. + Kunne ikke analysere JSON-data fra HTML. + + + + Failed to retrieve HTML page. + Kunne ikke hente HTML-side. + + + + Failed to open file: + Kunne ikke åbne fil: + + + + XML ERROR: + XML FEJL: + + + + Failed to open files.json for writing + Kunne ikke åbne files.json til skrivning + + + + Author: + Forfatter: + + + + Directory does not exist: + Mappe findes ikke: + + + + Failed to open files.json for reading. + Kunne ikke åbne files.json til læsning. + + + + Name: + Navn: + + + \ No newline at end of file diff --git a/src/qt_gui/translations/de.ts b/src/qt_gui/translations/de.ts new file mode 100644 index 000000000..6183c812d --- /dev/null +++ b/src/qt_gui/translations/de.ts @@ -0,0 +1,892 @@ + + + + AboutDialog + + + About shadPS4 + About shadPS4 + + + + shadPS4 + shadPS4 + + + + shadPS4 is an experimental open-source emulator for the PlayStation 4. + shadPS4 is an experimental open-source emulator for the PlayStation 4. + + + + This software should not be used to play games you have not legally obtained. + This software should not be used to play games you have not legally obtained. + + + + ElfViewer + + + Open Folder + Open Folder + + + + GameInfoClass + + + Loading game list, please wait :3 + Loading game list, please wait :3 + + + + Cancel + Cancel + + + + Loading... + Loading... + + + + GameInstallDialog + + + shadPS4 - Choose directory + shadPS4 - Choose directory + + + + Directory to install games + Directory to install games + + + + Browse + Browse + + + + Error + Error + + + + The value for location to install games is not valid. + The value for location to install games is not valid. + + + + GuiContextMenus + + + Create Shortcut + Create Shortcut + + + + Open Game Folder + Open Game Folder + + + + Cheats / Patches + Cheats / Patches + + + + SFO Viewer + SFO Viewer + + + + Trophy Viewer + Trophy Viewer + + + + Copy info + Copy info + + + + Copy Name + Copy Name + + + + Copy Serial + Copy Serial + + + + Copy All + Copy All + + + + Shortcut creation + Shortcut creation + + + + Shortcut created successfully!\n %1 + Shortcut created successfully!\n %1 + + + + Error + Error + + + + Error creating shortcut!\n %1 + Error creating shortcut!\n %1 + + + + Install PKG + Install PKG + + + + MainWindow + + + Open/Add Elf Folder + Open/Add Elf Folder + + + + Install Packages (PKG) + Install Packages (PKG) + + + + Boot Game + Boot Game + + + + About shadPS4 + About shadPS4 + + + + Configure... + Configure... + + + + Install application from a .pkg file + Install application from a .pkg file + + + + Recent Games + Recent Games + + + + Exit + Exit + + + + Exit shadPS4 + Exit shadPS4 + + + + Exit the application. + Exit the application. + + + + Show Game List + Show Game List + + + + Game List Refresh + Game List Refresh + + + + Tiny + Tiny + + + + Small + Small + + + + Medium + Medium + + + + Large + Large + + + + List View + List View + + + + Grid View + Grid View + + + + Elf Viewer + Elf Viewer + + + + Game Install Directory + Game Install Directory + + + + Download Cheats/Patches + Cheats / Patches herunterladen + + + + Dump Game List + Dump Game List + + + + PKG Viewer + PKG Viewer + + + + Search... + Search... + + + + File + File + + + + View + View + + + + Game List Icons + Game List Icons + + + + Game List Mode + Game List Mode + + + + Settings + Settings + + + + Utils + Utils + + + + Themes + Themes + + + + About + About + + + + Dark + Dark + + + + Light + Light + + + + Green + Green + + + + Blue + Blue + + + + Violet + Violet + + + + toolBar + toolBar + + + + PKGViewer + + + Open Folder + Open Folder + + + + TrophyViewer + + + Trophy Viewer + Trophy Viewer + + + + SettingsDialog + + + Settings + Settings + + + + General + General + + + + System + System + + + + Console Language + Console Language + + + + Emulator Language + Emulator Language + + + + Emulator + Emulator + + + + Enable Fullscreen + Enable Fullscreen + + + + Show Splash + Show Splash + + + + Is PS4 Pro + Is PS4 Pro + + + + Username + Username + + + + Logger + Logger + + + + Log Type + Log Type + + + + Log Filter + Log Filter + + + + Graphics + Graphics + + + + Graphics Device + Graphics Device + + + + Width + Width + + + + Height + Height + + + + Vblank Divider + Vblank Divider + + + + Advanced + Advanced + + + + Enable Shaders Dumping + Enable Shaders Dumping + + + + Enable NULL GPU + Enable NULL GPU + + + + Enable PM4 Dumping + Enable PM4 Dumping + + + + Debug + Debug + + + + Enable Debug Dumping + Enable Debug Dumping + + + + Enable Vulkan Validation Layers + Enable Vulkan Validation Layers + + + + Enable Vulkan Synchronization Validation + Enable Vulkan Synchronization Validation + + + + Enable RenderDoc Debugging + Enable RenderDoc Debugging + + + + MainWindow + + + * Unsupported Vulkan Version + * Nicht unterstützte Vulkan-Version + + + + Download Cheats For All Installed Games + Cheats für alle installierten Spiele herunterladen + + + + Download Patches For All Games + Patches für alle Spiele herunterladen + + + + Download Complete + Download abgeschlossen + + + + You have downloaded cheats for all the games you have installed. + Sie haben Cheats für alle installierten Spiele heruntergeladen. + + + + Patches Downloaded Successfully! + Patches erfolgreich heruntergeladen! + + + + All Patches available for all games have been downloaded. + Alle Patches für alle Spiele wurden heruntergeladen. + + + + Games: + Spiele: + + + + PKG File (*.PKG) + PKG-Datei (*.PKG) + + + + ELF files (*.bin *.elf *.oelf) + ELF-Dateien (*.bin *.elf *.oelf) + + + + Game Boot + Spiel-Start + + + + Only one file can be selected! + Es kann nur eine Datei ausgewählt werden! + + + + PKG Extraction + PKG-Extraktion + + + + Patch detected!\nPKG and Game versions match!: %1\nWould you like + Patch erkannt!\nPKG- und Spielversion stimmen überein!: %1\nMöchten Sie + + + + to overwrite? + überschreiben? + + + + Patch detected!\nPKG Version %1 is older + Patch erkannt!\nPKG-Version %1 ist älter + + + + than installed version!: %2\nWould you like + als die installierte Version!: %2\nMöchten Sie + + + + to overwrite? + überschreiben? + + + + Patch detected!\nGame is installed: %1\nWould you like + Patch erkannt!\nSpiel ist installiert: %1\nMöchten Sie + + + + to install Patch: %2? + Patch installieren: %2? + + + + Game already installed\n%1\nWould you like to overwrite? + Spiel bereits installiert\n%1\nMöchten Sie überschreiben? + + + + PKG is a patch, please install the game first! + PKG ist ein Patch, bitte installieren Sie zuerst das Spiel! + + + + PKG ERROR + PKG-ERROR + + + + Extracting PKG %1/%2 + Extrahiere PKG %1/%2 + + + + Extraction Finished + Extraktion abgeschlossen + + + + Game successfully installed at %1 + Spiel erfolgreich installiert auf %1 + + + + File doesn't appear to be a valid PKG file + Die Datei scheint keine gültige PKG-Datei zu sein + + + + CheatsPatches + + + Cheats / Patches + Cheats / Patches + + + + defaultTextEdit_MSG + Cheats/Patches sind experimentell.\nVerwenden Sie sie mit Vorsicht.\n\nLaden Sie Cheats einzeln herunter, indem Sie das Repository auswählen und auf die Download-Schaltfläche klicken.\nAuf der Registerkarte Patches können Sie alle Patches auf einmal herunterladen, auswählen, welche Sie verwenden möchten, und die Auswahl speichern.\n\nDa wir die Cheats/Patches nicht entwickeln,\nbitte melden Sie Probleme an den Cheat-Autor.\n\nHaben Sie einen neuen Cheat erstellt? Besuchen Sie:\nhttps://github.com/shadps4-emu/ps4_cheats + + + + No Image Available + Kein Bild verfügbar + + + + Serial: + Seriennummer: + + + + Version: + Version: + + + + Size: + Größe: + + + + Select Cheat File: + Cheat-Datei auswählen: + + + + Repository: + Repository: + + + + Download Cheats + Cheats herunterladen + + + + Delete File + Datei löschen + + + + No files selected. + Keine Dateien ausgewählt. + + + + You can delete the cheats you don't want after downloading them. + Sie können die Cheats, die Sie nicht möchten, nach dem Herunterladen löschen. + + + + Do you want to delete the selected file?\n%1 + Wollen Sie die ausgewählte Datei löschen?\n%1 + + + + Select Patch File: + Patch-Datei auswählen: + + + + Download Patches + Patches herunterladen + + + + Save + Speichern + + + + Cheats + Cheats + + + + Patches + Patches + + + + Error + Fehler + + + + No patch selected. + Kein Patch ausgewählt. + + + + Unable to open files.json for reading. + Kann files.json nicht zum Lesen öffnen. + + + + No patch file found for the current serial. + Keine Patch-Datei für die aktuelle Seriennummer gefunden. + + + + Unable to open the file for reading. + Kann die Datei nicht zum Lesen öffnen. + + + + Unable to open the file for writing. + Kann die Datei nicht zum Schreiben öffnen. + + + + Failed to parse XML: + Fehler beim Parsen von XML: + + + + Success + Erfolg + + + + Options saved successfully. + Optionen erfolgreich gespeichert. + + + + Invalid Source + Ungültige Quelle + + + + The selected source is invalid. + Die ausgewählte Quelle ist ungültig. + + + + File Exists + Datei existiert + + + + File already exists. Do you want to replace it? + Datei existiert bereits. Möchten Sie sie ersetzen? + + + + Failed to save file: + Fehler beim Speichern der Datei: + + + + Failed to download file: + Fehler beim Herunterladen der Datei: + + + + Cheats Not Found + Cheats nicht gefunden + + + + CheatsNotFound_MSG + Keine Cheats für dieses Spiel in dieser Version des gewählten Repositories gefunden. Versuchen Sie es mit einem anderen Repository oder einer anderen Version des Spiels. + + + + Cheats Downloaded Successfully + Cheats erfolgreich heruntergeladen + + + + CheatsDownloadedSuccessfully_MSG + Sie haben erfolgreich Cheats für diese Version des Spiels aus dem gewählten Repository heruntergeladen. Sie können versuchen, von einem anderen Repository herunterzuladen. Wenn verfügbar, können Sie es auswählen, indem Sie die Datei aus der Liste auswählen. + + + + Failed to save: + Speichern fehlgeschlagen: + + + + Failed to download: + Herunterladen fehlgeschlagen: + + + + Download Complete + Download abgeschlossen + + + + DownloadComplete_MSG + Patches erfolgreich heruntergeladen! Alle Patches für alle Spiele wurden heruntergeladen, es ist nicht notwendig, sie einzeln für jedes Spiel herunterzuladen, wie es bei Cheats der Fall ist. + + + + Failed to parse JSON data from HTML. + Fehler beim Parsen der JSON-Daten aus HTML. + + + + Failed to retrieve HTML page. + Fehler beim Abrufen der HTML-Seite. + + + + Failed to open file: + Fehler beim Öffnen der Datei: + + + + XML ERROR: + XML-Fehler: + + + + Failed to open files.json for writing + Kann files.json nicht zum Schreiben öffnen + + + + Author: + Autor: + + + + Directory does not exist: + Verzeichnis existiert nicht: + + + + Failed to open files.json for reading. + Kann files.json nicht zum Lesen öffnen. + + + + Name: + Name: + + + \ No newline at end of file diff --git a/src/qt_gui/translations/el.ts b/src/qt_gui/translations/el.ts new file mode 100644 index 000000000..5d4a15d8a --- /dev/null +++ b/src/qt_gui/translations/el.ts @@ -0,0 +1,892 @@ + + + + AboutDialog + + + About shadPS4 + About shadPS4 + + + + shadPS4 + shadPS4 + + + + shadPS4 is an experimental open-source emulator for the PlayStation 4. + shadPS4 is an experimental open-source emulator for the PlayStation 4. + + + + This software should not be used to play games you have not legally obtained. + This software should not be used to play games you have not legally obtained. + + + + ElfViewer + + + Open Folder + Open Folder + + + + GameInfoClass + + + Loading game list, please wait :3 + Loading game list, please wait :3 + + + + Cancel + Cancel + + + + Loading... + Loading... + + + + GameInstallDialog + + + shadPS4 - Choose directory + shadPS4 - Choose directory + + + + Directory to install games + Directory to install games + + + + Browse + Browse + + + + Error + Error + + + + The value for location to install games is not valid. + The value for location to install games is not valid. + + + + GuiContextMenus + + + Create Shortcut + Create Shortcut + + + + Open Game Folder + Open Game Folder + + + + Cheats / Patches + Kodikí / Enimeróseis + + + + SFO Viewer + SFO Viewer + + + + Trophy Viewer + Trophy Viewer + + + + Copy info + Copy info + + + + Copy Name + Copy Name + + + + Copy Serial + Copy Serial + + + + Copy All + Copy All + + + + Shortcut creation + Shortcut creation + + + + Shortcut created successfully!\n %1 + Shortcut created successfully!\n %1 + + + + Error + Error + + + + Error creating shortcut!\n %1 + Error creating shortcut!\n %1 + + + + Install PKG + Install PKG + + + + MainWindow + + + Open/Add Elf Folder + Open/Add Elf Folder + + + + Install Packages (PKG) + Install Packages (PKG) + + + + Boot Game + Boot Game + + + + About shadPS4 + About shadPS4 + + + + Configure... + Configure... + + + + Install application from a .pkg file + Install application from a .pkg file + + + + Recent Games + Recent Games + + + + Exit + Exit + + + + Exit shadPS4 + Exit shadPS4 + + + + Exit the application. + Exit the application. + + + + Show Game List + Show Game List + + + + Game List Refresh + Game List Refresh + + + + Tiny + Tiny + + + + Small + Small + + + + Medium + Medium + + + + Large + Large + + + + List View + List View + + + + Grid View + Grid View + + + + Elf Viewer + Elf Viewer + + + + Game Install Directory + Game Install Directory + + + + Download Cheats/Patches + Κατεβάστε Κωδικούς / Ενημερώσεις + + + + Dump Game List + Dump Game List + + + + PKG Viewer + PKG Viewer + + + + Search... + Search... + + + + File + File + + + + View + View + + + + Game List Icons + Game List Icons + + + + Game List Mode + Game List Mode + + + + Settings + Settings + + + + Utils + Utils + + + + Themes + Themes + + + + About + About + + + + Dark + Dark + + + + Light + Light + + + + Green + Green + + + + Blue + Blue + + + + Violet + Violet + + + + toolBar + toolBar + + + + PKGViewer + + + Open Folder + Open Folder + + + + TrophyViewer + + + Trophy Viewer + Trophy Viewer + + + + SettingsDialog + + + Settings + Settings + + + + General + General + + + + System + System + + + + Console Language + Console Language + + + + Emulator Language + Emulator Language + + + + Emulator + Emulator + + + + Enable Fullscreen + Enable Fullscreen + + + + Show Splash + Show Splash + + + + Is PS4 Pro + Is PS4 Pro + + + + Username + Username + + + + Logger + Logger + + + + Log Type + Log Type + + + + Log Filter + Log Filter + + + + Graphics + Graphics + + + + Graphics Device + Graphics Device + + + + Width + Width + + + + Height + Height + + + + Vblank Divider + Vblank Divider + + + + Advanced + Advanced + + + + Enable Shaders Dumping + Enable Shaders Dumping + + + + Enable NULL GPU + Enable NULL GPU + + + + Enable PM4 Dumping + Enable PM4 Dumping + + + + Debug + Debug + + + + Enable Debug Dumping + Enable Debug Dumping + + + + Enable Vulkan Validation Layers + Enable Vulkan Validation Layers + + + + Enable Vulkan Synchronization Validation + Enable Vulkan Synchronization Validation + + + + Enable RenderDoc Debugging + Enable RenderDoc Debugging + + + + MainWindow + + + * Unsupported Vulkan Version + * Μη υποστηριζόμενη έκδοση Vulkan + + + + Download Cheats For All Installed Games + Λήψη Cheats για όλα τα εγκατεστημένα παιχνίδια + + + + Download Patches For All Games + Λήψη Patches για όλα τα παιχνίδια + + + + Download Complete + Η λήψη ολοκληρώθηκε + + + + You have downloaded cheats for all the games you have installed. + Έχετε κατεβάσει cheats για όλα τα εγκατεστημένα παιχνίδια. + + + + Patches Downloaded Successfully! + Τα Patches κατέβηκαν επιτυχώς! + + + + All Patches available for all games have been downloaded. + Όλα τα διαθέσιμα Patches για όλα τα παιχνίδια έχουν κατέβει. + + + + Games: + Παιχνίδια: + + + + PKG File (*.PKG) + Αρχείο PKG (*.PKG) + + + + ELF files (*.bin *.elf *.oelf) + Αρχεία ELF (*.bin *.elf *.oelf) + + + + Game Boot + Εκκίνηση παιχνιδιού + + + + Only one file can be selected! + Μπορεί να επιλεγεί μόνο ένα αρχείο! + + + + PKG Extraction + Εξαγωγή PKG + + + + Patch detected!\nPKG and Game versions match!: %1\nWould you like + Ανίχνευση Patch!\nΟι εκδόσεις PKG και παιχνιδιού ταιριάζουν!: %1\nΘέλετε + + + + to overwrite? + να αντικαταστήσετε; + + + + Patch detected!\nPKG Version %1 is older + Ανίχνευση Patch!\nΗ έκδοση PKG %1 είναι παλαιότερη + + + + than installed version!: %2\nWould you like + από την εγκατεστημένη έκδοση!: %2\nΘέλετε + + + + to overwrite? + να αντικαταστήσετε; + + + + Patch detected!\nGame is installed: %1\nWould you like + Ανίχνευση Patch!\nΤο παιχνίδι είναι εγκατεστημένο: %1\nΘέλετε + + + + to install Patch: %2? + να εγκαταστήσετε το Patch: %2; + + + + Game already installed\n%1\nWould you like to overwrite? + Το παιχνίδι είναι ήδη εγκατεστημένο\n%1\nΘέλετε να αντικαταστήσετε; + + + + PKG is a patch, please install the game first! + Το PKG είναι patch, παρακαλώ εγκαταστήστε πρώτα το παιχνίδι! + + + + PKG ERROR + ΣΦΑΛΜΑ PKG + + + + Extracting PKG %1/%2 + Εξαγωγή PKG %1/%2 + + + + Extraction Finished + Η εξαγωγή ολοκληρώθηκε + + + + Game successfully installed at %1 + Το παιχνίδι εγκαταστάθηκε επιτυχώς στο %1 + + + + File doesn't appear to be a valid PKG file + Η αρχείο δεν φαίνεται να είναι έγκυρο αρχείο PKG + + + + CheatsPatches + + + Cheats / Patches + Cheats / Patches + + + + defaultTextEdit_MSG + Οι cheats/patches είναι πειραματικά.\nΧρησιμοποιήστε τα με προσοχή.\n\nΚατεβάστε τους cheats μεμονωμένα επιλέγοντας το αποθετήριο και κάνοντας κλικ στο κουμπί λήψης.\nΣτην καρτέλα Patches, μπορείτε να κατεβάσετε όλα τα patches ταυτόχρονα, να επιλέξετε ποια θέλετε να χρησιμοποιήσετε και να αποθηκεύσετε την επιλογή.\n\nΔεδομένου ότι δεν αναπτύσσουμε τους cheats/patches,\nπαρακαλώ αναφέρετε προβλήματα στον δημιουργό του cheat.\n\nΔημιουργήσατε ένα νέο cheat; Επισκεφθείτε:\nhttps://github.com/shadps4-emu/ps4_cheats + + + + No Image Available + Δεν διατίθεται εικόνα + + + + Serial: + Σειριακός αριθμός: + + + + Version: + Έκδοση: + + + + Size: + Μέγεθος: + + + + Select Cheat File: + Επιλέξτε αρχείο Cheat: + + + + Repository: + Αποθετήριο: + + + + Download Cheats + Λήψη Cheats + + + + Delete File + Διαγραφή αρχείου + + + + No files selected. + Δεν έχουν επιλεγεί αρχεία. + + + + You can delete the cheats you don't want after downloading them. + Μπορείτε να διαγράψετε τα cheats που δεν θέλετε μετά τη λήψη τους. + + + + Do you want to delete the selected file?\n%1 + Θέλετε να διαγράψετε το επιλεγμένο αρχείο;\n%1 + + + + Select Patch File: + Επιλέξτε αρχείο Patch: + + + + Download Patches + Λήψη Patches + + + + Save + Αποθήκευση + + + + Cheats + Cheats + + + + Patches + Patches + + + + Error + Σφάλμα + + + + No patch selected. + Δεν έχει επιλεγεί κανένα patch. + + + + Unable to open files.json for reading. + Αδυναμία ανοίγματος του files.json για ανάγνωση. + + + + No patch file found for the current serial. + Δεν βρέθηκε αρχείο patch για τον τρέχοντα σειριακό αριθμό. + + + + Unable to open the file for reading. + Αδυναμία ανοίγματος του αρχείου για ανάγνωση. + + + + Unable to open the file for writing. + Αδυναμία ανοίγματος του αρχείου για εγγραφή. + + + + Failed to parse XML: + Αποτυχία ανάλυσης XML: + + + + Success + Επιτυχία + + + + Options saved successfully. + Οι ρυθμίσεις αποθηκεύτηκαν επιτυχώς. + + + + Invalid Source + Μη έγκυρη Πηγή + + + + The selected source is invalid. + Η επιλεγμένη πηγή είναι μη έγκυρη. + + + + File Exists + Η αρχείο υπάρχει + + + + File already exists. Do you want to replace it? + Η αρχείο υπάρχει ήδη. Θέλετε να την αντικαταστήσετε; + + + + Failed to save file: + Αποτυχία αποθήκευσης αρχείου: + + + + Failed to download file: + Αποτυχία λήψης αρχείου: + + + + Cheats Not Found + Δεν βρέθηκαν Cheats + + + + CheatsNotFound_MSG + Δεν βρέθηκαν cheats για αυτό το παιχνίδι στην τρέχουσα έκδοση του επιλεγμένου αποθετηρίου. Δοκιμάστε να κατεβάσετε από άλλο αποθετήριο ή άλλη έκδοση του παιχνιδιού. + + + + Cheats Downloaded Successfully + Cheats κατεβάστηκαν επιτυχώς + + + + CheatsDownloadedSuccessfully_MSG + Κατεβάσατε επιτυχώς cheats για αυτή την έκδοση του παιχνιδιού από το επιλεγμένο αποθετήριο. Μπορείτε να δοκιμάσετε να κατεβάσετε από άλλο αποθετήριο. Αν είναι διαθέσιμο, μπορείτε να το επιλέξετε επιλέγοντας το αρχείο από τη λίστα. + + + + Failed to save: + Αποτυχία αποθήκευσης: + + + + Failed to download: + Αποτυχία λήψης: + + + + Download Complete + Η λήψη ολοκληρώθηκε + + + + DownloadComplete_MSG + Τα Patches κατεβάστηκαν επιτυχώς! Όλα τα Patches για όλα τα παιχνίδια έχουν κατέβει, δεν είναι απαραίτητο να τα κατεβάσετε ένα-ένα για κάθε παιχνίδι, όπως με τα Cheats. + + + + Failed to parse JSON data from HTML. + Αποτυχία ανάλυσης δεδομένων JSON από HTML. + + + + Failed to retrieve HTML page. + Αποτυχία ανάκτησης σελίδας HTML. + + + + Failed to open file: + Αποτυχία ανοίγματος αρχείου: + + + + XML ERROR: + ΣΦΑΛΜΑ XML: + + + + Failed to open files.json for writing + Αποτυχία ανοίγματος του files.json για εγγραφή + + + + Author: + Συγγραφέας: + + + + Directory does not exist: + Ο φάκελος δεν υπάρχει: + + + + Failed to open files.json for reading. + Αποτυχία ανοίγματος του files.json για ανάγνωση. + + + + Name: + Όνομα: + + + \ No newline at end of file diff --git a/src/qt_gui/translations/en.ts b/src/qt_gui/translations/en.ts new file mode 100644 index 000000000..aa8a1a5d8 --- /dev/null +++ b/src/qt_gui/translations/en.ts @@ -0,0 +1,892 @@ + + + + AboutDialog + + + About shadPS4 + About shadPS4 + + + + shadPS4 + shadPS4 + + + + shadPS4 is an experimental open-source emulator for the PlayStation 4. + shadPS4 is an experimental open-source emulator for the PlayStation 4. + + + + This software should not be used to play games you have not legally obtained. + This software should not be used to play games you have not legally obtained. + + + + ElfViewer + + + Open Folder + Open Folder + + + + GameInfoClass + + + Loading game list, please wait :3 + Loading game list, please wait :3 + + + + Cancel + Cancel + + + + Loading... + Loading... + + + + GameInstallDialog + + + shadPS4 - Choose directory + shadPS4 - Choose directory + + + + Directory to install games + Directory to install games + + + + Browse + Browse + + + + Error + Error + + + + The value for location to install games is not valid. + The value for location to install games is not valid. + + + + GuiContextMenus + + + Create Shortcut + Create Shortcut + + + + Open Game Folder + Open Game Folder + + + + Cheats / Patches + Cheats / Patches + + + + SFO Viewer + SFO Viewer + + + + Trophy Viewer + Trophy Viewer + + + + Copy info + Copy info + + + + Copy Name + Copy Name + + + + Copy Serial + Copy Serial + + + + Copy All + Copy All + + + + Shortcut creation + Shortcut creation + + + + Shortcut created successfully!\n %1 + Shortcut created successfully!\n %1 + + + + Error + Error + + + + Error creating shortcut!\n %1 + Error creating shortcut!\n %1 + + + + Install PKG + Install PKG + + + + MainWindow + + + Open/Add Elf Folder + Open/Add Elf Folder + + + + Install Packages (PKG) + Install Packages (PKG) + + + + Boot Game + Boot Game + + + + About shadPS4 + About shadPS4 + + + + Configure... + Configure... + + + + Install application from a .pkg file + Install application from a .pkg file + + + + Recent Games + Recent Games + + + + Exit + Exit + + + + Exit shadPS4 + Exit shadPS4 + + + + Exit the application. + Exit the application. + + + + Show Game List + Show Game List + + + + Game List Refresh + Game List Refresh + + + + Tiny + Tiny + + + + Small + Small + + + + Medium + Medium + + + + Large + Large + + + + List View + List View + + + + Grid View + Grid View + + + + Elf Viewer + Elf Viewer + + + + Game Install Directory + Game Install Directory + + + + Download Cheats/Patches + Download Cheats / Patches + + + + Dump Game List + Dump Game List + + + + PKG Viewer + PKG Viewer + + + + Search... + Search... + + + + File + File + + + + View + View + + + + Game List Icons + Game List Icons + + + + Game List Mode + Game List Mode + + + + Settings + Settings + + + + Utils + Utils + + + + Themes + Themes + + + + About + About + + + + Dark + Dark + + + + Light + Light + + + + Green + Green + + + + Blue + Blue + + + + Violet + Violet + + + + toolBar + toolBar + + + + PKGViewer + + + Open Folder + Open Folder + + + + TrophyViewer + + + Trophy Viewer + Trophy Viewer + + + + SettingsDialog + + + Settings + Settings + + + + General + General + + + + System + System + + + + Console Language + Console Language + + + + Emulator Language + Emulator Language + + + + Emulator + Emulator + + + + Enable Fullscreen + Enable Fullscreen + + + + Show Splash + Show Splash + + + + Is PS4 Pro + Is PS4 Pro + + + + Username + Username + + + + Logger + Logger + + + + Log Type + Log Type + + + + Log Filter + Log Filter + + + + Graphics + Graphics + + + + Graphics Device + Graphics Device + + + + Width + Width + + + + Height + Height + + + + Vblank Divider + Vblank Divider + + + + Advanced + Advanced + + + + Enable Shaders Dumping + Enable Shaders Dumping + + + + Enable NULL GPU + Enable NULL GPU + + + + Enable PM4 Dumping + Enable PM4 Dumping + + + + Debug + Debug + + + + Enable Debug Dumping + Enable Debug Dumping + + + + Enable Vulkan Validation Layers + Enable Vulkan Validation Layers + + + + Enable Vulkan Synchronization Validation + Enable Vulkan Synchronization Validation + + + + Enable RenderDoc Debugging + Enable RenderDoc Debugging + + + + MainWindow + + + * Unsupported Vulkan Version + * Unsupported Vulkan Version + + + + Download Cheats For All Installed Games + Download Cheats For All Installed Games + + + + Download Patches For All Games + Download Patches For All Games + + + + Download Complete + Download Complete + + + + You have downloaded cheats for all the games you have installed. + You have downloaded cheats for all the games you have installed. + + + + Patches Downloaded Successfully! + Patches Downloaded Successfully! + + + + All Patches available for all games have been downloaded. + All Patches available for all games have been downloaded. + + + + Games: + Games: + + + + PKG File (*.PKG) + PKG File (*.PKG) + + + + ELF files (*.bin *.elf *.oelf) + ELF files (*.bin *.elf *.oelf) + + + + Game Boot + Game Boot + + + + Only one file can be selected! + Only one file can be selected! + + + + PKG Extraction + PKG Extraction + + + + Patch detected!\nPKG and Game versions match!: %1\nWould you like + Patch detected!\nPKG and Game versions match!: %1\nWould you like + + + + to overwrite? + to overwrite? + + + + Patch detected!\nPKG Version %1 is older + Patch detected!\nPKG Version %1 is older + + + + than installed version!: %2\nWould you like + than installed version!: %2\nWould you like + + + + to overwrite? + to overwrite? + + + + Patch detected!\nGame is installed: %1\nWould you like + Patch detected!\nGame is installed: %1\nWould you like + + + + to install Patch: %2? + to install Patch: %2? + + + + Game already installed\n%1\nWould you like to overwrite? + Game already installed\n%1\nWould you like to overwrite? + + + + PKG is a patch, please install the game first! + PKG is a patch, please install the game first! + + + + PKG ERROR + PKG ERROR + + + + Extracting PKG %1/%2 + Extracting PKG %1/%2 + + + + Extraction Finished + Extraction Finished + + + + Game successfully installed at %1 + Game successfully installed at %1 + + + + File doesn't appear to be a valid PKG file + File doesn't appear to be a valid PKG file + + + + CheatsPatches + + + Cheats / Patches + Cheats / Patches + + + + defaultTextEdit_MSG + Cheats/Patches are experimental.\nUse with caution.\n\nDownload cheats individually by selecting the repository and clicking the download button.\nIn the Patches tab, you can download all patches at once, choose which ones you want to use, and save your selection.\n\nSince we do not develop the Cheats/Patches,\nplease report issues to the cheat author.\n\nCreated a new cheat? Visit:\nhttps://github.com/shadps4-emu/ps4_cheats + + + + No Image Available + No Image Available + + + + Serial: + Serial: + + + + Version: + Version: + + + + Size: + Size: + + + + Select Cheat File: + Select Cheat File: + + + + Repository: + Repository: + + + + Download Cheats + Download Cheats + + + + Delete File + Delete File + + + + No files selected. + No files selected. + + + + You can delete the cheats you don't want after downloading them. + You can delete the cheats you don't want after downloading them. + + + + Do you want to delete the selected file?\n%1 + Do you want to delete the selected file?\n%1 + + + + Select Patch File: + Select Patch File: + + + + Download Patches + Download Patches + + + + Save + Save + + + + Cheats + Cheats + + + + Patches + Patches + + + + Error + Error + + + + No patch selected. + No patch selected. + + + + Unable to open files.json for reading. + Unable to open files.json for reading. + + + + No patch file found for the current serial. + No patch file found for the current serial. + + + + Unable to open the file for reading. + Unable to open the file for reading. + + + + Unable to open the file for writing. + Unable to open the file for writing. + + + + Failed to parse XML: + Failed to parse XML: + + + + Success + Success + + + + Options saved successfully. + Options saved successfully. + + + + Invalid Source + Invalid Source + + + + The selected source is invalid. + The selected source is invalid. + + + + File Exists + File Exists + + + + File already exists. Do you want to replace it? + File already exists. Do you want to replace it? + + + + Failed to save file: + Failed to save file: + + + + Failed to download file: + Failed to download file: + + + + Cheats Not Found + Cheats Not Found + + + + CheatsNotFound_MSG + No Cheats found for this game in this version of the selected repository,try another repository or a different version of the game. + + + + Cheats Downloaded Successfully + Cheats Downloaded Successfully + + + + CheatsDownloadedSuccessfully_MSG + You have successfully downloaded the cheats for this version of the game from the selected repository. You can try downloading from another repository, if it is available it will also be possible to use it by selecting the file from the list. + + + + Failed to save: + Failed to save: + + + + Failed to download: + Failed to download: + + + + Download Complete + Download Complete + + + + DownloadComplete_MSG + Patches Downloaded Successfully! All Patches available for all games have been downloaded, there is no need to download them individually for each game as happens in Cheats. + + + + Failed to parse JSON data from HTML. + Failed to parse JSON data from HTML. + + + + Failed to retrieve HTML page. + Failed to retrieve HTML page. + + + + Failed to open file: + Failed to open file: + + + + XML ERROR: + XML ERROR: + + + + Failed to open files.json for writing + Failed to open files.json for writing + + + + Author: + Author: + + + + Directory does not exist: + Directory does not exist: + + + + Failed to open files.json for reading. + Failed to open files.json for reading. + + + + Name: + Name: + + + \ No newline at end of file diff --git a/src/qt_gui/translations/es_ES.ts b/src/qt_gui/translations/es_ES.ts new file mode 100644 index 000000000..5b7ad4b6d --- /dev/null +++ b/src/qt_gui/translations/es_ES.ts @@ -0,0 +1,892 @@ + + + + AboutDialog + + + About shadPS4 + Acerca de shadPS4 + + + + shadPS4 + shadPS4 + + + + shadPS4 is an experimental open-source emulator for the PlayStation 4. + shadPS4 es un emulador experimental de código abierto para la PlayStation 4. + + + + This software should not be used to play games you have not legally obtained. + Este software no debe utilizarse para jugar juegos que no hayas obtenido legalmente. + + + + ElfViewer + + + Open Folder + Abrir carpeta + + + + GameInfoClass + + + Loading game list, please wait :3 + Cargando lista de juegos, por favor espera :3 + + + + Cancel + Cancelar + + + + Loading... + Cargando... + + + + GameInstallDialog + + + shadPS4 - Choose directory + shadPS4 - Elegir carpeta + + + + Directory to install games + Carpeta para instalar juegos + + + + Browse + Buscar + + + + Error + Error + + + + The value for location to install games is not valid. + El valor para la ubicación de instalación de los juegos no es válido. + + + + GuiContextMenus + + + Create Shortcut + Crear acceso directo + + + + Open Game Folder + Abrir carpeta del juego + + + + Cheats / Patches + Trucos / Parches + + + + SFO Viewer + Vista SFO + + + + Trophy Viewer + Ver trofeos + + + + Copy info + Copiar información + + + + Copy Name + Copiar nombre + + + + Copy Serial + Copiar serial + + + + Copy All + Copiar todo + + + + Shortcut creation + Acceso directo creado + + + + Shortcut created successfully!\n %1 + ¡Acceso directo creado con éxito!\n %1 + + + + Error + Error + + + + Error creating shortcut!\n %1 + ¡Error al crear el acceso directo!\n %1 + + + + Install PKG + Instalar PKG + + + + MainWindow + + + Open/Add Elf Folder + Abrir/Agregar carpeta Elf + + + + Install Packages (PKG) + Instalar paquetes (PKG) + + + + Boot Game + Iniciar juego + + + + About shadPS4 + Acerca de shadPS4 + + + + Configure... + Configurar... + + + + Install application from a .pkg file + Instalar aplicación desde un archivo .pkg + + + + Recent Games + Juegos recientes + + + + Exit + Salir + + + + Exit shadPS4 + Salir de shadPS4 + + + + Exit the application. + Salir de la aplicación. + + + + Show Game List + Mostrar lista de juegos + + + + Game List Refresh + Actualizar lista de juegos + + + + Tiny + Muy pequeño + + + + Small + Pequeño + + + + Medium + Mediano + + + + Large + Grande + + + + List View + Vista de lista + + + + Grid View + Vista de cuadrícula + + + + Elf Viewer + Vista Elf + + + + Game Install Directory + Carpeta de instalación de los juegos + + + + Download Cheats/Patches + Descargar Trucos / Parches + + + + Dump Game List + Volcar lista de juegos + + + + PKG Viewer + Vista PKG + + + + Search... + Buscar... + + + + File + Archivo + + + + View + Vista + + + + Game List Icons + Iconos de los juegos + + + + Game List Mode + Tipo de lista + + + + Settings + Configuraciones + + + + Utils + Utilidades + + + + Themes + Temas + + + + About + Ayuda + + + + Dark + Oscuro + + + + Light + Claro + + + + Green + Verde + + + + Blue + Azul + + + + Violet + Violeta + + + + toolBar + barra de herramientas + + + + PKGViewer + + + Open Folder + Abrir carpeta + + + + TrophyViewer + + + Trophy Viewer + Vista de trofeos + + + + SettingsDialog + + + Settings + Configuraciones + + + + General + General + + + + System + Sistema + + + + Console Language + Idioma de la consola + + + + Emulator Language + Idioma del emulador + + + + Emulator + Emulador + + + + Enable Fullscreen + Habilitar pantalla completa + + + + Show Splash + Mostrar splash + + + + Is PS4 Pro + Modo PS4 Pro + + + + Username + Nombre de usuario + + + + Logger + Registro + + + + Log Type + Tipo de registro + + + + Log Filter + Filtro de registro + + + + Graphics + Gráficos + + + + Graphics Device + Dispositivo gráfico + + + + Width + Ancho + + + + Height + Alto + + + + Vblank Divider + Divisor de Vblank + + + + Advanced + Avanzado + + + + Enable Shaders Dumping + Habilitar volcado de shaders + + + + Enable NULL GPU + Habilitar GPU NULL + + + + Enable PM4 Dumping + Habilitar volcado de PM4 + + + + Debug + Depuración + + + + Enable Debug Dumping + Habilitar volcado de depuración + + + + Enable Vulkan Validation Layers + Habilitar capas de validación de Vulkan + + + + Enable Vulkan Synchronization Validation + Habilitar validación de sincronización de Vulkan + + + + Enable RenderDoc Debugging + Habilitar depuración de RenderDoc + + + + MainWindow + + + * Unsupported Vulkan Version + * Versión de Vulkan no soportada + + + + Download Cheats For All Installed Games + Descargar trucos para todos los juegos instalados + + + + Download Patches For All Games + Descargar parches para todos los juegos + + + + Download Complete + Descarga completa + + + + You have downloaded cheats for all the games you have installed. + Has descargado trucos para todos los juegos que tienes instalados. + + + + Patches Downloaded Successfully! + ¡Parches descargados exitosamente! + + + + All Patches available for all games have been downloaded. + Todos los parches disponibles para todos los juegos han sido descargados. + + + + Games: + Juegos: + + + + PKG File (*.PKG) + Archivo PKG (*.PKG) + + + + ELF files (*.bin *.elf *.oelf) + Archivos ELF (*.bin *.elf *.oelf) + + + + Game Boot + Inicio del juego + + + + Only one file can be selected! + ¡Solo se puede seleccionar un archivo! + + + + PKG Extraction + Extracción de PKG + + + + Patch detected!\nPKG and Game versions match!: %1\nWould you like + ¡Parche detectado!\n¡La versión de PKG y del juego coinciden!: %1\n¿Te gustaría + + + + to overwrite? + ¿sobrescribir? + + + + Patch detected!\nPKG Version %1 is older + ¡Parche detectado!\nLa versión de PKG %1 es más antigua + + + + than installed version!: %2\nWould you like + que la versión instalada!: %2\n¿Te gustaría + + + + to overwrite? + ¿sobrescribir? + + + + Patch detected!\nGame is installed: %1\nWould you like + ¡Parche detectado!\nJuego está instalado: %1\n¿Te gustaría + + + + to install Patch: %2? + ¿instalar el parche: %2? + + + + Game already installed\n%1\nWould you like to overwrite? + Juego ya instalado\n%1\n¿Te gustaría sobrescribirlo? + + + + PKG is a patch, please install the game first! + PKG es un parche, ¡por favor instala el juego primero! + + + + PKG ERROR + ERROR PKG + + + + Extracting PKG %1/%2 + Extrayendo PKG %1/%2 + + + + Extraction Finished + Extracción terminada + + + + Game successfully installed at %1 + Juego instalado exitosamente en %1 + + + + File doesn't appear to be a valid PKG file + El archivo no parece ser un archivo PKG válido + + + + CheatsPatches + + + Cheats / Patches + Trucos / Parches + + + + defaultTextEdit_MSG + Los cheats/patches son experimentales.\nÚselos con precaución.\n\nDescargue los cheats individualmente seleccionando el repositorio y haciendo clic en el botón de descarga.\nEn la pestaña Patches, puede descargar todos los patches a la vez, elegir cuáles desea usar y guardar la selección.\n\nComo no desarrollamos los Cheats/Patches,\npor favor informe los problemas al autor del cheat.\n\n¿Creaste un nuevo cheat? Visita:\nhttps://github.com/shadps4-emu/ps4_cheats + + + + No Image Available + No hay imagen disponible + + + + Serial: + Serie: + + + + Version: + Versión: + + + + Size: + Tamaño: + + + + Select Cheat File: + Seleccionar archivo de trucos: + + + + Repository: + Repositorio: + + + + Download Cheats + Descargar trucos + + + + Delete File + Eliminar archivo + + + + No files selected. + No se han seleccionado archivos. + + + + You can delete the cheats you don't want after downloading them. + Puedes eliminar los trucos que no quieras después de descargarlos. + + + + Do you want to delete the selected file?\n%1 + ¿Deseas eliminar el archivo seleccionado?\n%1 + + + + Select Patch File: + Seleccionar archivo de parche: + + + + Download Patches + Descargar parches + + + + Save + Guardar + + + + Cheats + Trucos + + + + Patches + Parche + + + + Error + Error + + + + No patch selected. + No se ha seleccionado ningún parche. + + + + Unable to open files.json for reading. + No se puede abrir files.json para lectura. + + + + No patch file found for the current serial. + No se encontró ningún archivo de parche para la serie actual. + + + + Unable to open the file for reading. + No se puede abrir el archivo para lectura. + + + + Unable to open the file for writing. + No se puede abrir el archivo para escritura. + + + + Failed to parse XML: + Error al analizar XML: + + + + Success + Éxito + + + + Options saved successfully. + Opciones guardadas exitosamente. + + + + Invalid Source + Fuente inválida + + + + The selected source is invalid. + La fuente seleccionada es inválida. + + + + File Exists + El archivo ya existe + + + + File already exists. Do you want to replace it? + El archivo ya existe. ¿Deseas reemplazarlo? + + + + Failed to save file: + Error al guardar el archivo: + + + + Failed to download file: + Error al descargar el archivo: + + + + Cheats Not Found + Trucos no encontrados + + + + CheatsNotFound_MSG + No se encontraron trucos para este juego en esta versión del repositorio seleccionado,intenta con otro repositorio o con una versión diferente del juego. + + + + Cheats Downloaded Successfully + Trucos descargados exitosamente + + + + CheatsDownloadedSuccessfully_MSG + Has descargado exitosamente los trucos para esta versión del juego desde el repositorio seleccionado. Puedes intentar descargar desde otro repositorio; si está disponible, también será posible usarlo seleccionando el archivo de la lista. + + + + Failed to save: + Error al guardar: + + + + Failed to download: + Error al descargar: + + + + Download Complete + Descarga completa + + + + DownloadComplete_MSG + ¡Parches descargados exitosamente! Todos los parches disponibles para todos los juegos han sido descargados, no es necesario descargarlos individualmente para cada juego como ocurre con los trucos. + + + + Failed to parse JSON data from HTML. + Error al analizar los datos JSON del HTML. + + + + Failed to retrieve HTML page. + Error al recuperar la página HTML. + + + + Failed to open file: + Error al abrir el archivo: + + + + XML ERROR: + ERROR XML: + + + + Failed to open files.json for writing + Error al abrir files.json para escritura + + + + Author: + Autor: + + + + Directory does not exist: + El directorio no existe: + + + + Failed to open files.json for reading. + Error al abrir files.json para lectura. + + + + Name: + Nombre: + + + \ No newline at end of file diff --git a/src/qt_gui/translations/fi.ts b/src/qt_gui/translations/fi.ts new file mode 100644 index 000000000..70345efbe --- /dev/null +++ b/src/qt_gui/translations/fi.ts @@ -0,0 +1,892 @@ + + + + AboutDialog + + + About shadPS4 + About shadPS4 + + + + shadPS4 + shadPS4 + + + + shadPS4 is an experimental open-source emulator for the PlayStation 4. + shadPS4 is an experimental open-source emulator for the PlayStation 4. + + + + This software should not be used to play games you have not legally obtained. + This software should not be used to play games you have not legally obtained. + + + + ElfViewer + + + Open Folder + Open Folder + + + + GameInfoClass + + + Loading game list, please wait :3 + Loading game list, please wait :3 + + + + Cancel + Cancel + + + + Loading... + Loading... + + + + GameInstallDialog + + + shadPS4 - Choose directory + shadPS4 - Choose directory + + + + Directory to install games + Directory to install games + + + + Browse + Browse + + + + Error + Error + + + + The value for location to install games is not valid. + The value for location to install games is not valid. + + + + GuiContextMenus + + + Create Shortcut + Create Shortcut + + + + Open Game Folder + Open Game Folder + + + + Cheats / Patches + Huijaukset / Korjaukset + + + + SFO Viewer + SFO Viewer + + + + Trophy Viewer + Trophy Viewer + + + + Copy info + Copy info + + + + Copy Name + Copy Name + + + + Copy Serial + Copy Serial + + + + Copy All + Copy All + + + + Shortcut creation + Shortcut creation + + + + Shortcut created successfully!\n %1 + Shortcut created successfully!\n %1 + + + + Error + Error + + + + Error creating shortcut!\n %1 + Error creating shortcut!\n %1 + + + + Install PKG + Install PKG + + + + MainWindow + + + Open/Add Elf Folder + Open/Add Elf Folder + + + + Install Packages (PKG) + Install Packages (PKG) + + + + Boot Game + Boot Game + + + + About shadPS4 + About shadPS4 + + + + Configure... + Configure... + + + + Install application from a .pkg file + Install application from a .pkg file + + + + Recent Games + Recent Games + + + + Exit + Exit + + + + Exit shadPS4 + Exit shadPS4 + + + + Exit the application. + Exit the application. + + + + Show Game List + Show Game List + + + + Game List Refresh + Game List Refresh + + + + Tiny + Tiny + + + + Small + Small + + + + Medium + Medium + + + + Large + Large + + + + List View + List View + + + + Grid View + Grid View + + + + Elf Viewer + Elf Viewer + + + + Game Install Directory + Game Install Directory + + + + Download Cheats/Patches + Lataa Huijaukset / Korjaukset + + + + Dump Game List + Dump Game List + + + + PKG Viewer + PKG Viewer + + + + Search... + Search... + + + + File + File + + + + View + View + + + + Game List Icons + Game List Icons + + + + Game List Mode + Game List Mode + + + + Settings + Settings + + + + Utils + Utils + + + + Themes + Themes + + + + About + About + + + + Dark + Dark + + + + Light + Light + + + + Green + Green + + + + Blue + Blue + + + + Violet + Violet + + + + toolBar + toolBar + + + + PKGViewer + + + Open Folder + Open Folder + + + + TrophyViewer + + + Trophy Viewer + Trophy Viewer + + + + SettingsDialog + + + Settings + Settings + + + + General + General + + + + System + System + + + + Console Language + Console Language + + + + Emulator Language + Emulator Language + + + + Emulator + Emulator + + + + Enable Fullscreen + Enable Fullscreen + + + + Show Splash + Show Splash + + + + Is PS4 Pro + Is PS4 Pro + + + + Username + Username + + + + Logger + Logger + + + + Log Type + Log Type + + + + Log Filter + Log Filter + + + + Graphics + Graphics + + + + Graphics Device + Graphics Device + + + + Width + Width + + + + Height + Height + + + + Vblank Divider + Vblank Divider + + + + Advanced + Advanced + + + + Enable Shaders Dumping + Enable Shaders Dumping + + + + Enable NULL GPU + Enable NULL GPU + + + + Enable PM4 Dumping + Enable PM4 Dumping + + + + Debug + Debug + + + + Enable Debug Dumping + Enable Debug Dumping + + + + Enable Vulkan Validation Layers + Enable Vulkan Validation Layers + + + + Enable Vulkan Synchronization Validation + Enable Vulkan Synchronization Validation + + + + Enable RenderDoc Debugging + Enable RenderDoc Debugging + + + + MainWindow + + + * Unsupported Vulkan Version + * Tuettu Vulkan-versio + + + + Download Cheats For All Installed Games + Lataa huijaukset kaikille asennetuille peleille + + + + Download Patches For All Games + Lataa korjaukset kaikille peleille + + + + Download Complete + Lataus valmis + + + + You have downloaded cheats for all the games you have installed. + Olet ladannut huijaukset kaikkiin asennettuihin peleihin. + + + + Patches Downloaded Successfully! + Korjaukset ladattu onnistuneesti! + + + + All Patches available for all games have been downloaded. + Kaikki saatavilla olevat korjaukset kaikille peleille on ladattu. + + + + Games: + Pelit: + + + + PKG File (*.PKG) + PKG-tiedosto (*.PKG) + + + + ELF files (*.bin *.elf *.oelf) + ELF-tiedostot (*.bin *.elf *.oelf) + + + + Game Boot + Pelin käynnistys + + + + Only one file can be selected! + Vain yksi tiedosto voidaan valita! + + + + PKG Extraction + PKG:n purku + + + + Patch detected!\nPKG and Game versions match!: %1\nWould you like + Korjaus havaittu!\nPKG:n ja pelin versiot vastaavat!: %1\nHaluatko + + + + to overwrite? + korvata? + + + + Patch detected!\nPKG Version %1 is older + Korjaus havaittu!\nPKG Version %1 on vanhempi + + + + than installed version!: %2\nWould you like + kuin asennettu versio!: %2\nHaluatko + + + + to overwrite? + korvata? + + + + Patch detected!\nGame is installed: %1\nWould you like + Korjaus havaittu!\nPeli on asennettu: %1\nHaluatko + + + + to install Patch: %2? + asentaa korjaus: %2? + + + + Game already installed\n%1\nWould you like to overwrite? + Peli on jo asennettu\n%1\nHaluatko korvata sen? + + + + PKG is a patch, please install the game first! + PKG on korjaus, asenna peli ensin! + + + + PKG ERROR + PKG VIRHE + + + + Extracting PKG %1/%2 + Purkaminen PKG %1/%2 + + + + Extraction Finished + Purku valmis + + + + Game successfully installed at %1 + Peli asennettu onnistuneesti kohtaan %1 + + + + File doesn't appear to be a valid PKG file + Tiedosto ei vaikuta olevan kelvollinen PKG-tiedosto + + + + CheatsPatches + + + Cheats / Patches + Huijaukset / Korjaukset + + + + defaultTextEdit_MSG + Cheats/Patches ovat kokeellisia.\nKäytä varoen.\n\nLataa cheats yksitellen valitsemalla repositorio ja napsauttamalla latauspainiketta.\nPatches-välilehdellä voit ladata kaikki patchit kerralla, valita, mitä haluat käyttää, ja tallentaa valinnan.\n\nKoska emme kehitä Cheats/Patches,\nilmoita ongelmista cheatin tekijälle.\n\nLuo uusi cheat? Käy osoitteessa:\nhttps://github.com/shadps4-emu/ps4_cheats + + + + No Image Available + Kuvaa ei saatavilla + + + + Serial: + Sarjanumero: + + + + Version: + Versio: + + + + Size: + Koko: + + + + Select Cheat File: + Valitse huijaustiedosto: + + + + Repository: + Repo: + + + + Download Cheats + Lataa huijaukset + + + + Delete File + Poista tiedosto + + + + No files selected. + Ei tiedostoja valittu. + + + + You can delete the cheats you don't want after downloading them. + Voit poistaa ei-toivomasi huijaukset lataamisen jälkeen. + + + + Do you want to delete the selected file?\n%1 + Haluatko poistaa valitun tiedoston?\n%1 + + + + Select Patch File: + Valitse korjaustiedosto: + + + + Download Patches + Lataa korjaukset + + + + Save + Tallenna + + + + Cheats + Huijaukset + + + + Patches + Korjaukset + + + + Error + Virhe + + + + No patch selected. + Ei korjausta valittu. + + + + Unable to open files.json for reading. + Tiedostoa files.json ei voitu avata lukemista varten. + + + + No patch file found for the current serial. + Nykyiselle sarjanumerolle ei löytynyt korjaustiedostoa. + + + + Unable to open the file for reading. + Tiedostoa ei voitu avata lukemista varten. + + + + Unable to open the file for writing. + Tiedostoa ei voitu avata kirjoittamista varten. + + + + Failed to parse XML: + XML:n jäsentäminen epäonnistui: + + + + Success + Onnistui + + + + Options saved successfully. + Vaihtoehdot tallennettu onnistuneesti. + + + + Invalid Source + Virheellinen lähde + + + + The selected source is invalid. + Valittu lähde on virheellinen. + + + + File Exists + Tiedosto on olemassa + + + + File already exists. Do you want to replace it? + Tiedosto on jo olemassa. Haluatko korvata sen? + + + + Failed to save file: + Tiedoston tallentaminen epäonnistui: + + + + Failed to download file: + Tiedoston lataaminen epäonnistui: + + + + Cheats Not Found + Huijauksia ei löytynyt + + + + CheatsNotFound_MSG + Huijauksia ei löytynyt tälle pelille tämän version valitusta repositoriosta, yritä toista repositoriota tai pelin eri versiota. + + + + Cheats Downloaded Successfully + Huijaukset ladattu onnistuneesti + + + + CheatsDownloadedSuccessfully_MSG + Olet ladannut huijaukset onnistuneesti valitusta repositoriosta tälle pelin versiolle. Voit yrittää ladata toisesta repositoriosta, jos se on saatavilla, voit myös käyttää sitä valitsemalla tiedoston luettelosta. + + + + Failed to save: + Tallentaminen epäonnistui: + + + + Failed to download: + Lataaminen epäonnistui: + + + + Download Complete + Lataus valmis + + + + DownloadComplete_MSG + Korjaukset ladattu onnistuneesti! Kaikki saatavilla olevat korjaukset kaikille peleille on ladattu, eikä niitä tarvitse ladata yksittäin jokaiselle pelille kuten huijauksissa. + + + + Failed to parse JSON data from HTML. + JSON-tietojen jäsentäminen HTML:stä epäonnistui. + + + + Failed to retrieve HTML page. + HTML-sivun hakeminen epäonnistui. + + + + Failed to open file: + Tiedoston avaaminen epäonnistui: + + + + XML ERROR: + XML VIRHE: + + + + Failed to open files.json for writing + Tiedostoa files.json ei voitu avata kirjoittamista varten + + + + Author: + Tekijä: + + + + Directory does not exist: + Kansiota ei ole olemassa: + + + + Failed to open files.json for reading. + Tiedostoa files.json ei voitu avata lukemista varten. + + + + Name: + Nimi: + + + \ No newline at end of file diff --git a/src/qt_gui/translations/fr.ts b/src/qt_gui/translations/fr.ts new file mode 100644 index 000000000..371da9616 --- /dev/null +++ b/src/qt_gui/translations/fr.ts @@ -0,0 +1,892 @@ + + + + AboutDialog + + + About shadPS4 + À propos de shadPS4 + + + + shadPS4 + shadPS4 + + + + shadPS4 is an experimental open-source emulator for the PlayStation 4. + shadPS4 est un émulateur open-source expérimental de la PlayStation 4. + + + + This software should not be used to play games you have not legally obtained. + Ce logiciel ne doit pas être utilisé pour jouer à des jeux que vous n'avez pas obtenus légalement. + + + + ElfViewer + + + Open Folder + Ouvrir un dossier + + + + GameInfoClass + + + Loading game list, please wait :3 + Chargement de la liste de jeu, veuillez patienter... + + + + Cancel + Annuler + + + + Loading... + Chargement... + + + + GameInstallDialog + + + shadPS4 - Choose directory + shadPS4 - Choisir un répertoire + + + + Directory to install games + Répertoire d'installation des jeux + + + + Browse + Parcourir + + + + Error + Erreur + + + + The value for location to install games is not valid. + Le répertoire d'installation des jeux n'est pas valide. + + + + GuiContextMenus + + + Create Shortcut + Créer un raccourci + + + + Open Game Folder + Ouvrir le dossier du jeu + + + + Cheats / Patches + Cheats/Patchs + + + + SFO Viewer + Visionneuse SFO + + + + Trophy Viewer + Visionneuse de trophées + + + + Copy info + Copier infos + + + + Copy Name + Copier le nom + + + + Copy Serial + Copier le numéro de série + + + + Copy All + Copier tout + + + + Shortcut creation + Création du raccourci + + + + Shortcut created successfully!\n %1 + Raccourci créé avec succès !\n %1 + + + + Error + Erreur + + + + Error creating shortcut!\n %1 + Erreur lors de la création du raccourci !\n %1 + + + + Install PKG + Installer un PKG + + + + MainWindow + + + Open/Add Elf Folder + Ouvrir/Ajouter un dossier ELF + + + + Install Packages (PKG) + Installer des packages (PKG) + + + + Boot Game + Démarrer un jeu + + + + About shadPS4 + À propos de shadPS4 + + + + Configure... + Configurer... + + + + Install application from a .pkg file + Installer une application depuis un fichier .pkg + + + + Recent Games + Jeux récents + + + + Exit + Fermer + + + + Exit shadPS4 + Fermer shadPS4 + + + + Exit the application. + Fermer l'application. + + + + Show Game List + Afficher la liste de jeux + + + + Game List Refresh + Rafraîchir la liste de jeux + + + + Tiny + Très Petit + + + + Small + Petit + + + + Medium + Moyen + + + + Large + Grand + + + + List View + Mode liste + + + + Grid View + Mode grille + + + + Elf Viewer + Visionneuse ELF + + + + Game Install Directory + Répertoire des jeux + + + + Download Cheats/Patches + Télécharger Cheats/Patchs + + + + Dump Game List + Dumper la liste des jeux + + + + PKG Viewer + Visionneuse PKG + + + + Search... + Chercher... + + + + File + Fichier + + + + View + Affichage + + + + Game List Icons + Icônes des jeux + + + + Game List Mode + Mode d'affichage + + + + Settings + Paramètres + + + + Utils + Utilitaire + + + + Themes + Thèmes + + + + About + À propos + + + + Dark + Noir + + + + Light + Blanc + + + + Green + Vert + + + + Blue + Bleu + + + + Violet + Violet + + + + toolBar + Bare d'outils + + + + PKGViewer + + + Open Folder + Ouvrir un dossier + + + + TrophyViewer + + + Trophy Viewer + Visionneuse de trophées + + + + SettingsDialog + + + Settings + Paramètres + + + + General + Général + + + + System + Système + + + + Console Language + Langage de la console + + + + Emulator Language + Langage de l'émulateur + + + + Emulator + Émulateur + + + + Enable Fullscreen + Plein écran + + + + Show Splash + Afficher l'image du jeu + + + + Is PS4 Pro + Mode PS4 Pro + + + + Username + Nom d'utilisateur + + + + Logger + Journalisation + + + + Log Type + Type + + + + Log Filter + Filtre + + + + Graphics + Graphismes + + + + Graphics Device + Carte graphique + + + + Width + Largeur + + + + Height + Hauteur + + + + Vblank Divider + Vblank + + + + Advanced + Avancé + + + + Enable Shaders Dumping + Dumper les shaders + + + + Enable NULL GPU + NULL GPU + + + + Enable PM4 Dumping + Dumper le PM4 + + + + Debug + Débogage + + + + Enable Debug Dumping + Activer le débogage + + + + Enable Vulkan Validation Layers + Activer la couche de validation Vulkan + + + + Enable Vulkan Synchronization Validation + Activer la synchronisation de la validation Vulkan + + + + Enable RenderDoc Debugging + Activer le débogage RenderDoc + + + + MainWindow + + + * Unsupported Vulkan Version + * Version de Vulkan non prise en charge + + + + Download Cheats For All Installed Games + Télécharger les Cheats pour tous les jeux installés + + + + Download Patches For All Games + Télécharger les patchs pour tous les jeux + + + + Download Complete + Téléchargement terminé + + + + You have downloaded cheats for all the games you have installed. + Vous avez téléchargé des Cheats pour tous les jeux installés. + + + + Patches Downloaded Successfully! + Patchs téléchargés avec succès ! + + + + All Patches available for all games have been downloaded. + Tous les patchs disponibles pour les jeux ont été téléchargés. + + + + Games: + Jeux : + + + + PKG File (*.PKG) + Fichiers PKG (*.PKG) + + + + ELF files (*.bin *.elf *.oelf) + Fichiers ELF (*.bin *.elf *.oelf) + + + + Game Boot + Démarrer un jeu + + + + Only one file can be selected! + Un seul fichier peut être sélectionné ! + + + + PKG Extraction + Extraction du PKG + + + + Patch detected!\nPKG and Game versions match!: %1\nWould you like + Patch détecté !\nLa version du PKG et du jeu correspondent : %1\nSouhaitez-vous + + + + to overwrite? + écraser ? + + + + Patch detected!\nPKG Version %1 is older + Patch détecté !\nVersion PKG %1 est plus ancienne + + + + than installed version!: %2\nWould you like + que la version installée ! : %2\nSouhaitez-vous + + + + to overwrite? + écraser ? + + + + Patch detected!\nGame is installed: %1\nWould you like + Patch détecté !\nJeu est installé : %1\nSouhaitez-vous + + + + to install Patch: %2? + installer le patch : %2 ? + + + + Game already installed\n%1\nWould you like to overwrite? + Jeu déjà installé\n%1\nSouhaitez-vous écraser ? + + + + PKG is a patch, please install the game first! + Le PKG est un patch, veuillez d'abord installer le jeu ! + + + + PKG ERROR + Erreur PKG + + + + Extracting PKG %1/%2 + Extraction PKG %1/%2 + + + + Extraction Finished + Extraction terminée + + + + Game successfully installed at %1 + Jeu installé avec succès à %1 + + + + File doesn't appear to be a valid PKG file + Le fichier ne semble pas être un PKG valide + + + + CheatsPatches + + + Cheats / Patches + Cheats/Patches + + + + defaultTextEdit_MSG + Les Cheats/Patchs sont expérimentaux.\nUtilisez-les avec précaution.\n\nTéléchargez les Cheats individuellement en sélectionnant le dépôt et en cliquant sur le bouton de téléchargement.\nDans l'onglet Patchs, vous pouvez télécharger tous les patchs en une seule fois, choisir lesquels vous souhaitez utiliser et enregistrer votre sélection.\n\nComme nous ne développons pas les Cheats/Patches,\nmerci de signaler les problèmes à l'auteur du Cheat.\n\nVous avez créé un nouveau cheat ? Visitez :\nhttps://github.com/shadps4-emu/ps4_cheats + + + + No Image Available + Aucune image disponible + + + + Serial: + Série : + + + + Version: + Version : + + + + Size: + Taille : + + + + Select Cheat File: + Sélectionner le fichier de Cheat : + + + + Repository: + Dépôt : + + + + Download Cheats + Télécharger les Cheats + + + + Delete File + Supprimer le fichier + + + + No files selected. + Aucun fichier sélectionné. + + + + You can delete the cheats you don't want after downloading them. + Vous pouvez supprimer les Cheats que vous ne souhaitez pas après les avoir téléchargés. + + + + Do you want to delete the selected file?\n%1 + Voulez-vous supprimer le fichier sélectionné ?\n%1 + + + + Select Patch File: + Sélectionner le fichier de patch : + + + + Download Patches + Télécharger les patchs + + + + Save + Enregistrer + + + + Cheats + Cheats + + + + Patches + Patchs + + + + Error + Erreur + + + + No patch selected. + Aucun patch sélectionné. + + + + Unable to open files.json for reading. + Impossible d'ouvrir files.json pour la lecture. + + + + No patch file found for the current serial. + Aucun fichier de patch trouvé pour la série actuelle. + + + + Unable to open the file for reading. + Impossible d'ouvrir le fichier pour la lecture. + + + + Unable to open the file for writing. + Impossible d'ouvrir le fichier pour l'écriture. + + + + Failed to parse XML: + Échec de l'analyse XML : + + + + Success + Succès + + + + Options saved successfully. + Options enregistrées avec succès. + + + + Invalid Source + Source invalide + + + + The selected source is invalid. + La source sélectionnée est invalide. + + + + File Exists + Le fichier existe + + + + File already exists. Do you want to replace it? + Le fichier existe déjà. Voulez-vous le remplacer ? + + + + Failed to save file: + Échec de l'enregistrement du fichier : + + + + Failed to download file: + Échec du téléchargement du fichier : + + + + Cheats Not Found + Cheats non trouvés + + + + CheatsNotFound_MSG + Aucun Cheat trouvé pour ce jeu dans cette version du dépôt sélectionné, essayez un autre dépôt ou une version différente du jeu. + + + + Cheats Downloaded Successfully + Cheats téléchargés avec succès + + + + CheatsDownloadedSuccessfully_MSG + Vous avez téléchargé les cheats avec succès pour cette version du jeu depuis le dépôt sélectionné. Vous pouvez essayer de télécharger depuis un autre dépôt, si disponible, il sera également possible de l'utiliser en sélectionnant le fichier dans la liste. + + + + Failed to save: + Échec de l'enregistrement : + + + + Failed to download: + Échec du téléchargement : + + + + Download Complete + Téléchargement terminé + + + + DownloadComplete_MSG + Patchs téléchargés avec succès ! Tous les patches disponibles pour tous les jeux ont été téléchargés, il n'est pas nécessaire de les télécharger individuellement pour chaque jeu comme c'est le cas pour les Cheats. + + + + Failed to parse JSON data from HTML. + Échec de l'analyse des données JSON à partir du HTML. + + + + Failed to retrieve HTML page. + Échec de la récupération de la page HTML. + + + + Failed to open file: + Échec de l'ouverture du fichier : + + + + XML ERROR: + Erreur XML : + + + + Failed to open files.json for writing + Échec de l'ouverture de files.json pour l'écriture + + + + Author: + Auteur : + + + + Directory does not exist: + Répertoire n'existe pas : + + + + Failed to open files.json for reading. + Échec de l'ouverture de files.json pour la lecture. + + + + Name: + Nom : + + + diff --git a/src/qt_gui/translations/hu_HU.ts b/src/qt_gui/translations/hu_HU.ts new file mode 100644 index 000000000..e531df45c --- /dev/null +++ b/src/qt_gui/translations/hu_HU.ts @@ -0,0 +1,892 @@ + + + + AboutDialog + + + About shadPS4 + A shadPS4-ről + + + + shadPS4 + shadPS4 + + + + shadPS4 is an experimental open-source emulator for the PlayStation 4. + A shadPS4 egy kezdetleges, open-source PlayStation 4 emulátor. + + + + This software should not be used to play games you have not legally obtained. + Ne használja ezt a szoftvert olyan játékokkal, amelyeket nem legális módon szerzett be. + + + + ElfViewer + + + Open Folder + Mappa megnyitása + + + + GameInfoClass + + + Loading game list, please wait :3 + Játék könyvtár betöltése, kérjük várjon :3 + + + + Cancel + Megszakítás + + + + Loading... + Betöltés.. + + + + GameInstallDialog + + + shadPS4 - Choose directory + shadPS4 - Mappa kiválasztása + + + + Directory to install games + Mappa a játékok telepítésére + + + + Browse + Böngészés + + + + Error + Hiba + + + + The value for location to install games is not valid. + A játékok telepítéséhez megadott érték nem érvényes. + + + + GuiContextMenus + + + Create Shortcut + Parancsikon Létrehozása + + + + Open Game Folder + Játék Mappa Megnyitása + + + + Cheats / Patches + Csalások / Javítások + + + + SFO Viewer + SFO Néző + + + + Trophy Viewer + Trófeák Megtekintése + + + + Copy info + Információ Másolása + + + + Copy Name + Név Másolása + + + + Copy Serial + Széria Másolása + + + + Copy All + Összes Másolása + + + + Shortcut creation + Parancsikon létrehozása + + + + Shortcut created successfully!\n %1 + Parancsikon sikeresen létrehozva!\n %1 + + + + Error + Hiba + + + + Error creating shortcut!\n %1 + Hiba a parancsikon létrehozásával!\n %1 + + + + Install PKG + PKG telepítése + + + + MainWindow + + + Open/Add Elf Folder + Efl Mappa Megnyitása/Hozzáadása + + + + Install Packages (PKG) + PKG-k Telepítése (PKG) + + + + Boot Game + Játék Bootolása + + + + About shadPS4 + A shadPS4-ről + + + + Configure... + Konfigurálás... + + + + Install application from a .pkg file + Program telepítése egy .pkg fájlból + + + + Recent Games + Legutóbbi Játékok + + + + Exit + Kilépés + + + + Exit shadPS4 + Kilépés a shadPS4 + + + + Exit the application. + Lépjen ki az programból. + + + + Show Game List + Játék Könyvtár Megjelenítése + + + + Game List Refresh + Játék Könyvtár Újratöltése + + + + Tiny + Apró + + + + Small + Kicsi + + + + Medium + Közepes + + + + Large + Nagy + + + + List View + Lista Nézet + + + + Grid View + Rács Nézet + + + + Elf Viewer + Elf Néző + + + + Game Install Directory + Játék Telepítési Mappa + + + + Download Cheats/Patches + Csalások / Javítások letöltése + + + + Dump Game List + Játék Lista Dumpolása + + + + PKG Viewer + PKG Néző + + + + Search... + Keresés... + + + + File + Fájl + + + + View + Megnézés + + + + Game List Icons + Játék Könyvtár Ikonok + + + + Game List Mode + Játék Könyvtár Mód + + + + Settings + Beállítások + + + + Utils + Segédeszközök + + + + Themes + Témák + + + + About + Segítség + + + + Dark + Sötét + + + + Light + Világos + + + + Green + Zöld + + + + Blue + Kék + + + + Violet + Ibolya + + + + toolBar + Eszköztár + + + + PKGViewer + + + Open Folder + Mappa Megnyitása + + + + TrophyViewer + + + Trophy Viewer + Trófeák Megtekintése + + + + SettingsDialog + + + Settings + Beállítások + + + + General + Általános + + + + System + Rendszer + + + + Console Language + A Konzol Nyelvezete + + + + Emulator Language + Az Emulátor Nyelvezete + + + + Emulator + Emulátor + + + + Enable Fullscreen + Teljesképernyő Engedélyezése + + + + Show Splash + Indítóképernyő Mutatása + + + + Is PS4 Pro + PS4 Pro + + + + Username + Felhasználónév + + + + Logger + Naplózó + + + + Log Type + Naplózási Típus + + + + Log Filter + Naplózási Filter + + + + Graphics + Grafika + + + + Graphics Device + Grafikai Eszköz + + + + Width + Szélesség + + + + Height + Magasság + + + + Vblank Divider + Vblank Elosztó + + + + Advanced + Haladó + + + + Enable Shaders Dumping + Shader Dumpolás Engedélyezése + + + + Enable NULL GPU + NULL GPU Engedélyezése + + + + Enable PM4 Dumping + PM4 Dumpolás Engedélyezése + + + + Debug + Debugolás + + + + Enable Debug Dumping + Debug Dumpolás Engedélyezése + + + + Enable Vulkan Validation Layers + Vulkan Validációs Rétegek Engedélyezése + + + + Enable Vulkan Synchronization Validation + Vulkan Szinkronizálás Validáció + + + + Enable RenderDoc Debugging + RenderDoc Debugolás Engedélyezése + + + + MainWindow + + + * Unsupported Vulkan Version + * Támogatott Vulkan verzió hiányzik + + + + Download Cheats For All Installed Games + Letöltés csalások minden telepített játékhoz + + + + Download Patches For All Games + Frissítések letöltése minden játékhoz + + + + Download Complete + Letöltés befejezve + + + + You have downloaded cheats for all the games you have installed. + Csalásokat töltöttél le az összes telepített játékhoz. + + + + Patches Downloaded Successfully! + Frissítések sikeresen letöltve! + + + + All Patches available for all games have been downloaded. + Az összes játékhoz elérhető frissítés letöltésre került. + + + + Games: + Játékok: + + + + PKG File (*.PKG) + PKG fájl (*.PKG) + + + + ELF files (*.bin *.elf *.oelf) + ELF fájlok (*.bin *.elf *.oelf) + + + + Game Boot + Játék indító + + + + Only one file can be selected! + Csak egy fájl választható ki! + + + + PKG Extraction + PKG kicsomagolás + + + + Patch detected!\nPKG and Game versions match!: %1\nWould you like + Javítás észlelve!\nA PKG és a játék verziók egyeznek: %1\nSzeretnéd + + + + to overwrite? + felülírni? + + + + Patch detected!\nPKG Version %1 is older + Javítás észlelve!\nA PKG verzió %1 régebbi + + + + than installed version!: %2\nWould you like + mint a telepített verzió: %2\nSzeretnéd + + + + to overwrite? + felülírni? + + + + Patch detected!\nGame is installed: %1\nWould you like + Javítás észlelve!\nA játék telepítve van: %1\nSzeretnéd + + + + to install Patch: %2? + a javítást telepíteni: %2? + + + + Game already installed\n%1\nWould you like to overwrite? + A játék már telepítve van\n%1\nSzeretnéd felülírni? + + + + PKG is a patch, please install the game first! + A PKG egy javítás, először telepítsd a játékot! + + + + PKG ERROR + PKG HIBA + + + + Extracting PKG %1/%2 + PKG kicsomagolása %1/%2 + + + + Extraction Finished + Kicsomagolás befejezve + + + + Game successfully installed at %1 + A játék sikeresen telepítve itt: %1 + + + + File doesn't appear to be a valid PKG file + A fájl nem tűnik érvényes PKG fájlnak + + + + CheatsPatches + + + Cheats / Patches + Csalások / Javítások + + + + defaultTextEdit_MSG + A csalások/patchek kísérleti jellegűek.\nHasználja őket óvatosan.\n\nTöltse le a csalásokat egyesével a repository kiválasztásával és a letöltés gombra kattintással.\nA Patches fül alatt egyszerre letöltheti az összes patchet, választhat, melyeket szeretné használni, és elmentheti a választását.\n\nMivel nem fejlesztjük a csalásokat/patch-eket,\nkérjük, jelentse a problémákat a csalás szerzőjének.\n\nKészített egy új csalást? Látogasson el ide:\nhttps://github.com/shadps4-emu/ps4_cheats + + + + No Image Available + Nincs elérhető kép + + + + Serial: + Sorozatszám: + + + + Version: + Verzió: + + + + Size: + Méret: + + + + Select Cheat File: + Válaszd ki a csalás fájlt: + + + + Repository: + Tároló: + + + + Download Cheats + Csalások letöltése + + + + Delete File + Fájl törlése + + + + No files selected. + Nincsenek kiválasztott fájlok. + + + + You can delete the cheats you don't want after downloading them. + Törölheted a nem kívánt csalásokat a letöltés után. + + + + Do you want to delete the selected file?\n%1 + Szeretnéd törölni a kiválasztott fájlt?\n%1 + + + + Select Patch File: + Válaszd ki a javítás fájlt: + + + + Download Patches + Javítások letöltése + + + + Save + Mentés + + + + Cheats + Csalások + + + + Patches + Javítások + + + + Error + Hiba + + + + No patch selected. + Nincs kiválasztva javítás. + + + + Unable to open files.json for reading. + Nem sikerült megnyitni a files.json fájlt olvasásra. + + + + No patch file found for the current serial. + Nincs található javítási fájl a jelenlegi sorozatszámhoz. + + + + Unable to open the file for reading. + Nem sikerült megnyitni a fájlt olvasásra. + + + + Unable to open the file for writing. + Nem sikerült megnyitni a fájlt írásra. + + + + Failed to parse XML: + XML elemzési hiba: + + + + Success + Siker + + + + Options saved successfully. + A beállítások sikeresen elmentve. + + + + Invalid Source + Érvénytelen forrás + + + + The selected source is invalid. + A kiválasztott forrás érvénytelen. + + + + File Exists + A fájl létezik + + + + File already exists. Do you want to replace it? + A fájl már létezik. Szeretnéd helyettesíteni? + + + + Failed to save file: + Nem sikerült elmenteni a fájlt: + + + + Failed to download file: + Nem sikerült letölteni a fájlt: + + + + Cheats Not Found + Csalások nem találhatóak + + + + CheatsNotFound_MSG + Nincs található csalás ezen a játékverzión ebben a kiválasztott tárolóban,próbálj meg egy másik tárolót vagy a játék egy másik verzióját. + + + + Cheats Downloaded Successfully + Csalások sikeresen letöltve + + + + CheatsDownloadedSuccessfully_MSG + Sikeresen letöltötted a csalásokat ennek a játéknak a verziójához a kiválasztott tárolóból. Próbálhatsz letölteni egy másik tárolóból is, ha az elérhető, akkor a fájl kiválasztásával az is használható lesz. + + + + Failed to save: + Nem sikerült menteni: + + + + Failed to download: + Nem sikerült letölteni: + + + + Download Complete + Letöltés befejezve + + + + DownloadComplete_MSG + Frissítések sikeresen letöltve! Minden elérhető frissítés letöltésre került, nem szükséges egyesével letölteni őket minden játékhoz, mint a csalások esetében. + + + + Failed to parse JSON data from HTML. + Nem sikerült az JSON adatok elemzése HTML-ből. + + + + Failed to retrieve HTML page. + Nem sikerült HTML oldal lekérése. + + + + Failed to open file: + Nem sikerült megnyitni a fájlt: + + + + XML ERROR: + XML HIBA: + + + + Failed to open files.json for writing + Nem sikerült megnyitni a files.json fájlt írásra + + + + Author: + Szerző: + + + + Directory does not exist: + A könyvtár nem létezik: + + + + Failed to open files.json for reading. + Nem sikerült megnyitni a files.json fájlt olvasásra. + + + + Name: + Név: + + + diff --git a/src/qt_gui/translations/id.ts b/src/qt_gui/translations/id.ts new file mode 100644 index 000000000..dde590469 --- /dev/null +++ b/src/qt_gui/translations/id.ts @@ -0,0 +1,892 @@ + + + + AboutDialog + + + About shadPS4 + About shadPS4 + + + + shadPS4 + shadPS4 + + + + shadPS4 is an experimental open-source emulator for the PlayStation 4. + shadPS4 is an experimental open-source emulator for the PlayStation 4. + + + + This software should not be used to play games you have not legally obtained. + This software should not be used to play games you have not legally obtained. + + + + ElfViewer + + + Open Folder + Open Folder + + + + GameInfoClass + + + Loading game list, please wait :3 + Loading game list, please wait :3 + + + + Cancel + Cancel + + + + Loading... + Loading... + + + + GameInstallDialog + + + shadPS4 - Choose directory + shadPS4 - Choose directory + + + + Directory to install games + Directory to install games + + + + Browse + Browse + + + + Error + Error + + + + The value for location to install games is not valid. + The value for location to install games is not valid. + + + + GuiContextMenus + + + Create Shortcut + Create Shortcut + + + + Open Game Folder + Open Game Folder + + + + Cheats / Patches + Cheat / Patch + + + + SFO Viewer + SFO Viewer + + + + Trophy Viewer + Trophy Viewer + + + + Copy info + Copy info + + + + Copy Name + Copy Name + + + + Copy Serial + Copy Serial + + + + Copy All + Copy All + + + + Shortcut creation + Shortcut creation + + + + Shortcut created successfully!\n %1 + Shortcut created successfully!\n %1 + + + + Error + Error + + + + Error creating shortcut!\n %1 + Error creating shortcut!\n %1 + + + + Install PKG + Install PKG + + + + MainWindow + + + Open/Add Elf Folder + Open/Add Elf Folder + + + + Install Packages (PKG) + Install Packages (PKG) + + + + Boot Game + Boot Game + + + + About shadPS4 + About shadPS4 + + + + Configure... + Configure... + + + + Install application from a .pkg file + Install application from a .pkg file + + + + Recent Games + Recent Games + + + + Exit + Exit + + + + Exit shadPS4 + Exit shadPS4 + + + + Exit the application. + Exit the application. + + + + Show Game List + Show Game List + + + + Game List Refresh + Game List Refresh + + + + Tiny + Tiny + + + + Small + Small + + + + Medium + Medium + + + + Large + Large + + + + List View + List View + + + + Grid View + Grid View + + + + Elf Viewer + Elf Viewer + + + + Game Install Directory + Game Install Directory + + + + Download Cheats/Patches + Unduh Cheat / Patch + + + + Dump Game List + Dump Game List + + + + PKG Viewer + PKG Viewer + + + + Search... + Search... + + + + File + File + + + + View + View + + + + Game List Icons + Game List Icons + + + + Game List Mode + Game List Mode + + + + Settings + Settings + + + + Utils + Utils + + + + Themes + Themes + + + + About + About + + + + Dark + Dark + + + + Light + Light + + + + Green + Green + + + + Blue + Blue + + + + Violet + Violet + + + + toolBar + toolBar + + + + PKGViewer + + + Open Folder + Open Folder + + + + TrophyViewer + + + Trophy Viewer + Trophy Viewer + + + + SettingsDialog + + + Settings + Settings + + + + General + General + + + + System + System + + + + Console Language + Console Language + + + + Emulator Language + Emulator Language + + + + Emulator + Emulator + + + + Enable Fullscreen + Enable Fullscreen + + + + Show Splash + Show Splash + + + + Is PS4 Pro + Is PS4 Pro + + + + Username + Username + + + + Logger + Logger + + + + Log Type + Log Type + + + + Log Filter + Log Filter + + + + Graphics + Graphics + + + + Graphics Device + Graphics Device + + + + Width + Width + + + + Height + Height + + + + Vblank Divider + Vblank Divider + + + + Advanced + Advanced + + + + Enable Shaders Dumping + Enable Shaders Dumping + + + + Enable NULL GPU + Enable NULL GPU + + + + Enable PM4 Dumping + Enable PM4 Dumping + + + + Debug + Debug + + + + Enable Debug Dumping + Enable Debug Dumping + + + + Enable Vulkan Validation Layers + Enable Vulkan Validation Layers + + + + Enable Vulkan Synchronization Validation + Enable Vulkan Synchronization Validation + + + + Enable RenderDoc Debugging + Enable RenderDoc Debugging + + + + MainWindow + + + * Unsupported Vulkan Version + * Versi Vulkan Tidak Didukung + + + + Download Cheats For All Installed Games + Unduh Cheat Untuk Semua Game Yang Terpasang + + + + Download Patches For All Games + Unduh Patch Untuk Semua Game + + + + Download Complete + Unduhan Selesai + + + + You have downloaded cheats for all the games you have installed. + Anda telah mengunduh cheat untuk semua game yang terpasang. + + + + Patches Downloaded Successfully! + Patch Berhasil Diunduh! + + + + All Patches available for all games have been downloaded. + Semua Patch yang tersedia untuk semua game telah diunduh. + + + + Games: + Game: + + + + PKG File (*.PKG) + File PKG (*.PKG) + + + + ELF files (*.bin *.elf *.oelf) + File ELF (*.bin *.elf *.oelf) + + + + Game Boot + Boot Game + + + + Only one file can be selected! + Hanya satu file yang bisa dipilih! + + + + PKG Extraction + Ekstraksi PKG + + + + Patch detected!\nPKG and Game versions match!: %1\nWould you like + Patch terdeteksi!\nVersi PKG dan Game cocok!: %1\nApakah Anda ingin + + + + to overwrite? + menimpa? + + + + Patch detected!\nPKG Version %1 is older + Patch terdeteksi!\nVersi PKG %1 lebih lama + + + + than installed version!: %2\nWould you like + daripada versi yang terpasang!: %2\nApakah Anda ingin + + + + to overwrite? + menimpa? + + + + Patch detected!\nGame is installed: %1\nWould you like + Patch terdeteksi!\nGame terpasang: %1\nApakah Anda ingin + + + + to install Patch: %2? + memasang Patch: %2? + + + + Game already installed\n%1\nWould you like to overwrite? + Game sudah terpasang\n%1\nApakah Anda ingin menimpa? + + + + PKG is a patch, please install the game first! + PKG adalah patch, harap pasang game terlebih dahulu! + + + + PKG ERROR + KESALAHAN PKG + + + + Extracting PKG %1/%2 + Mengekstrak PKG %1/%2 + + + + Extraction Finished + Ekstraksi Selesai + + + + Game successfully installed at %1 + Game berhasil dipasang di %1 + + + + File doesn't appear to be a valid PKG file + File tampaknya bukan file PKG yang valid + + + + CheatsPatches + + + Cheats / Patches + Cheat / Patch + + + + defaultTextEdit_MSG + Cheats/Patches bersifat eksperimental.\nGunakan dengan hati-hati.\n\nUnduh cheats satu per satu dengan memilih repositori dan mengklik tombol unduh.\nDi tab Patches, Anda dapat mengunduh semua patch sekaligus, memilih yang ingin digunakan, dan menyimpan pilihan Anda.\n\nKarena kami tidak mengembangkan Cheats/Patches,\nharap laporkan masalah kepada pembuat cheat.\n\nMembuat cheat baru? Kunjungi:\nhttps://github.com/shadps4-emu/ps4_cheats + + + + No Image Available + Tidak Ada Gambar Tersedia + + + + Serial: + Serial: + + + + Version: + Versi: + + + + Size: + Ukuran: + + + + Select Cheat File: + Pilih File Cheat: + + + + Repository: + Repositori: + + + + Download Cheats + Unduh Cheat + + + + Delete File + Hapus File + + + + No files selected. + Tidak ada file yang dipilih. + + + + You can delete the cheats you don't want after downloading them. + Anda dapat menghapus cheat yang tidak Anda inginkan setelah mengunduhnya. + + + + Do you want to delete the selected file?\n%1 + Apakah Anda ingin menghapus berkas yang dipilih?\n%1 + + + + Select Patch File: + Pilih File Patch: + + + + Download Patches + Unduh Patch + + + + Save + Simpan + + + + Cheats + Cheat + + + + Patches + Patch + + + + Error + Kesalahan + + + + No patch selected. + Tidak ada patch yang dipilih. + + + + Unable to open files.json for reading. + Tidak dapat membuka files.json untuk dibaca. + + + + No patch file found for the current serial. + Tidak ada file patch ditemukan untuk serial saat ini. + + + + Unable to open the file for reading. + Tidak dapat membuka file untuk dibaca. + + + + Unable to open the file for writing. + Tidak dapat membuka file untuk menulis. + + + + Failed to parse XML: + Gagal menganalisis XML: + + + + Success + Sukses + + + + Options saved successfully. + Opsi berhasil disimpan. + + + + Invalid Source + Sumber Tidak Valid + + + + The selected source is invalid. + Sumber yang dipilih tidak valid. + + + + File Exists + File Ada + + + + File already exists. Do you want to replace it? + File sudah ada. Apakah Anda ingin menggantinya? + + + + Failed to save file: + Gagal menyimpan file: + + + + Failed to download file: + Gagal mengunduh file: + + + + Cheats Not Found + Cheat Tidak Ditemukan + + + + CheatsNotFound_MSG + Cheat tidak ditemukan untuk game ini dalam versi repositori yang dipilih,cobalah repositori lain atau versi game yang berbeda. + + + + Cheats Downloaded Successfully + Cheat Berhasil Diunduh + + + + CheatsDownloadedSuccessfully_MSG + Anda telah berhasil mengunduh cheat untuk versi game ini dari repositori yang dipilih. Anda bisa mencoba mengunduh dari repositori lain, jika tersedia akan juga memungkinkan untuk menggunakannya dengan memilih file dari daftar. + + + + Failed to save: + Gagal menyimpan: + + + + Failed to download: + Gagal mengunduh: + + + + Download Complete + Unduhan Selesai + + + + DownloadComplete_MSG + Patch Berhasil Diunduh! Semua Patch yang tersedia untuk semua game telah diunduh, tidak perlu mengunduhnya satu per satu seperti yang terjadi pada Cheat. + + + + Failed to parse JSON data from HTML. + Gagal menganalisis data JSON dari HTML. + + + + Failed to retrieve HTML page. + Gagal mengambil halaman HTML. + + + + Failed to open file: + Gagal membuka file: + + + + XML ERROR: + KESALAHAN XML: + + + + Failed to open files.json for writing + Gagal membuka files.json untuk menulis + + + + Author: + Penulis: + + + + Directory does not exist: + Direktori tidak ada: + + + + Failed to open files.json for reading. + Gagal membuka files.json untuk dibaca. + + + + Name: + Nama: + + + \ No newline at end of file diff --git a/src/qt_gui/translations/it.ts b/src/qt_gui/translations/it.ts new file mode 100644 index 000000000..4cb050b70 --- /dev/null +++ b/src/qt_gui/translations/it.ts @@ -0,0 +1,892 @@ + + + + AboutDialog + + + About shadPS4 + Riguardo shadPS4 + + + + shadPS4 + shadPS4 + + + + shadPS4 is an experimental open-source emulator for the PlayStation 4. + shadPS4 è un emulatore sperimentale open source per PlayStation 4. + + + + This software should not be used to play games you have not legally obtained. + Questo programma non dovrebbe essere utilizzato per riprodurre giochi che non vengono ottenuti legalmente. + + + + ElfViewer + + + Open Folder + Apri Cartella + + + + GameInfoClass + + + Loading game list, please wait :3 + Caricamento lista giochi, attendere :3 + + + + Cancel + Annulla + + + + Loading... + Caricamento... + + + + GameInstallDialog + + + shadPS4 - Choose directory + shadPS4 - Scegli cartella + + + + Directory to install games + Cartella di installazione dei giochi + + + + Browse + Sfoglia + + + + Error + Errore + + + + The value for location to install games is not valid. + Il valore del percorso di installazione dei giochi non è valido. + + + + GuiContextMenus + + + Create Shortcut + Crea scorciatoia + + + + Open Game Folder + Apri cartella del gioco + + + + Cheats / Patches + Trucchi / Patch + + + + SFO Viewer + Visualizzatore SFO + + + + Trophy Viewer + Visualizzatore Trofei + + + + Copy info + Copia informazioni + + + + Copy Name + Copia Nome + + + + Copy Serial + Copia Seriale + + + + Copy All + Copia Tutto + + + + Shortcut creation + Creazione scorciatoia + + + + Shortcut created successfully!\n %1 + Scorciatoia creata con successo!\n %1 + + + + Error + Errore + + + + Error creating shortcut!\n %1 + Errore nella creazione della scorciatoia!\n %1 + + + + Install PKG + Installa PKG + + + + MainWindow + + + Open/Add Elf Folder + Apri/Aggiungi cartella Elf + + + + Install Packages (PKG) + Installa Pacchetti (PKG) + + + + Boot Game + Avvia Gioco + + + + About shadPS4 + Riguardo a shadPS4 + + + + Configure... + Configura... + + + + Install application from a .pkg file + Installa applicazione da un file .pkg file + + + + Recent Games + Giochi Recenti + + + + Exit + Uscita + + + + Exit shadPS4 + Esci da shadPS4 + + + + Exit the application. + Esci dall'applicazione. + + + + Show Game List + Mostra Lista Giochi + + + + Game List Refresh + Aggiorna Lista Giochi + + + + Tiny + Minuscolo + + + + Small + Piccolo + + + + Medium + Medio + + + + Large + Grande + + + + List View + Visualizzazione lista + + + + Grid View + Visualizzazione Griglia + + + + Elf Viewer + Visualizzatore Elf + + + + Game Install Directory + Cartella Installazione Giochi + + + + Download Cheats/Patches + Scarica Trucchi / Patch + + + + Dump Game List + Scarica Lista Giochi + + + + PKG Viewer + Visualizzatore PKG + + + + Search... + Cerca... + + + + File + File + + + + View + Visualizza + + + + Game List Icons + Icone Lista Giochi + + + + Game List Mode + Modalità Lista Giochi + + + + Settings + Impostazioni + + + + Utils + Utilità + + + + Themes + Temi + + + + About + Info su + + + + Dark + Scuro + + + + Light + Chiaro + + + + Green + Verde + + + + Blue + Blu + + + + Violet + Viola + + + + toolBar + barra strumenti + + + + PKGViewer + + + Open Folder + Apri Cartella + + + + TrophyViewer + + + Visualizzatore Trofei + Trophy Viewer + + + + SettingsDialog + + + Settings + Impostazioni + + + + General + Generale + + + + System + Sistema + + + + Console Language + Lingua della console + + + + Emulator Language + Lingua dell'emulatore + + + + Emulator + Emulatore + + + + Enable Fullscreen + Abilita Schermo Intero + + + + Show Splash + Mostra Schermata Iniziale + + + + Is PS4 Pro + Modalità Ps4Pro + + + + Username + Nome Utente + + + + Logger + Logger + + + + Log Type + Tipo di Log + + + + Log Filter + Filtro Log + + + + Graphics + Grafica + + + + Graphics Device + Adattatore grafico + + + + Width + Larghezza + + + + Height + Altezza + + + + Vblank Divider + Divisore Vblank + + + + Advanced + Avanzato + + + + Enable Shaders Dumping + Abilita Dump Shader + + + + Enable NULL GPU + Abilita NULL GPU + + + + Enable PM4 Dumping + Abilita Dump PM4 + + + + Debug + Debug + + + + Enable Debug Dumping + Abilita Dump Debug + + + + Enable Vulkan Validation Layers + Abilita Vulkan Validation Layers + + + + Enable Vulkan Synchronization Validation + Abilita Vulkan Synchronization Validation + + + + Enable RenderDoc Debugging + Abilita Debugging RenderDoc + + + + MainWindow + + + * Unsupported Vulkan Version + * Versi Vulkan Tidak Didukung + + + + Download Cheats For All Installed Games + Unduh Cheat Untuk Semua Game yang Terinstal + + + + Download Patches For All Games + Unduh Patch Untuk Semua Game + + + + Download Complete + Unduhan Selesai + + + + You have downloaded cheats for all the games you have installed. + Anda telah mengunduh cheat untuk semua game yang telah Anda instal. + + + + Patches Downloaded Successfully! + Patch Berhasil Diunduh! + + + + All Patches available for all games have been downloaded. + Semua patch yang tersedia untuk semua game telah diunduh. + + + + Games: + Game: + + + + PKG File (*.PKG) + File PKG (*.PKG) + + + + ELF files (*.bin *.elf *.oelf) + File ELF (*.bin *.elf *.oelf) + + + + Game Boot + Boot Game + + + + Only one file can be selected! + Hanya satu file yang dapat dipilih! + + + + PKG Extraction + Ekstraksi PKG + + + + Patch detected!\nPKG and Game versions match!: %1\nWould you like + Patch terdeteksi!\nVersi PKG dan Game cocok!: %1\nApakah Anda ingin + + + + to overwrite? + menimpa? + + + + Patch detected!\nPKG Version %1 is older + Patch terdeteksi!\nVersi PKG %1 lebih lama + + + + than installed version!: %2\nWould you like + daripada versi yang terinstal!: %2\nApakah Anda ingin + + + + to overwrite? + menimpa? + + + + Patch detected!\nGame is installed: %1\nWould you like + Patch terdeteksi!\nGame terinstal: %1\nApakah Anda ingin + + + + to install Patch: %2? + menginstal Patch: %2? + + + + Game already installed\n%1\nWould you like to overwrite? + Game sudah terinstal\n%1\nApakah Anda ingin menimpa? + + + + PKG is a patch, please install the game first! + PKG adalah patch, silakan instal game terlebih dahulu! + + + + PKG ERROR + ERROR PKG + + + + Extracting PKG %1/%2 + Estrazione PKG %1/%2 + + + + Extraction Finished + Ekstraksi Selesai + + + + Game successfully installed at %1 + Game berhasil diinstal di %1 + + + + File doesn't appear to be a valid PKG file + File tidak tampak sebagai file PKG yang valid + + + + CheatsPatches + + + Cheats / Patches + Cheat / Patch + + + + defaultTextEdit_MSG + I cheats/patches sono sperimentali.\nUtilizzali con cautela.\n\nScarica i cheats singolarmente selezionando il repository e cliccando sul pulsante di download.\nNella scheda Patches, puoi scaricare tutti i patch in una volta sola, scegliere quali vuoi utilizzare e salvare la tua selezione.\n\nPoiché non sviluppiamo i Cheats/Patches,\nper favore segnala i problemi all'autore del cheat.\n\nHai creato un nuovo cheat? Visita:\nhttps://github.com/shadps4-emu/ps4_cheats + + + + No Image Available + Tidak Ada Gambar + + + + Serial: + Serial: + + + + Version: + Versi: + + + + Size: + Ukuran: + + + + Select Cheat File: + Pilih File Cheat: + + + + Repository: + Repositori: + + + + Download Cheats + Unduh Cheat + + + + Delete File + Hapus File + + + + No files selected. + Tidak ada file yang dipilih. + + + + You can delete the cheats you don't want after downloading them. + Anda dapat menghapus cheat yang tidak diinginkan setelah mengunduhnya. + + + + Do you want to delete the selected file?\n%1 + Apakah Anda ingin menghapus file yang dipilih?\n%1 + + + + Select Patch File: + Pilih File Patch: + + + + Download Patches + Unduh Patch + + + + Save + Simpan + + + + Cheats + Cheat + + + + Patches + Patch + + + + Error + Kesalahan + + + + No patch selected. + Tidak ada patch yang dipilih. + + + + Unable to open files.json for reading. + Gagal membuka files.json untuk dibaca. + + + + No patch file found for the current serial. + Tidak ada file patch ditemukan untuk serial saat ini. + + + + Unable to open the file for reading. + Gagal membuka file untuk dibaca. + + + + Unable to open the file for writing. + Gagal membuka file untuk ditulis. + + + + Failed to parse XML: + Gagal mengurai XML: + + + + Success + Berhasil + + + + Options saved successfully. + Opsi berhasil disimpan. + + + + Invalid Source + Sumber Tidak Valid + + + + The selected source is invalid. + Sumber yang dipilih tidak valid. + + + + File Exists + File Ada + + + + File already exists. Do you want to replace it? + File sudah ada. Apakah Anda ingin menggantinya? + + + + Failed to save file: + Gagal menyimpan file: + + + + Failed to download file: + Gagal mengunduh file: + + + + Cheats Not Found + Cheat Tidak Ditemukan + + + + CheatsNotFound_MSG + Cheat tidak ditemukan untuk game ini dalam versi repositori yang dipilih, coba repositori lain atau versi game yang berbeda. + + + + Cheats Downloaded Successfully + Cheat Berhasil Diunduh + + + + CheatsDownloadedSuccessfully_MSG + Anda telah berhasil mengunduh cheat untuk versi game ini dari repositori yang dipilih. Anda dapat mencoba mengunduh dari repositori lain, jika tersedia, Anda juga dapat menggunakannya dengan memilih file dari daftar. + + + + Failed to save: + Gagal menyimpan: + + + + Failed to download: + Gagal mengunduh: + + + + Download Complete + Unduhan Selesai + + + + DownloadComplete_MSG + Patch Berhasil Diunduh! Semua patch yang tersedia untuk semua game telah diunduh, tidak perlu mengunduhnya secara individu untuk setiap game seperti yang terjadi pada Cheat. + + + + Failed to parse JSON data from HTML. + Gagal mengurai data JSON dari HTML. + + + + Failed to retrieve HTML page. + Gagal mengambil halaman HTML. + + + + Failed to open file: + Gagal membuka file: + + + + XML ERROR: + KESALAHAN XML: + + + + Failed to open files.json for writing + Gagal membuka files.json untuk menulis + + + + Author: + Penulis: + + + + Directory does not exist: + Direktori tidak ada: + + + + Failed to open files.json for reading. + Gagal membuka files.json untuk dibaca. + + + + Name: + Nama: + + + \ No newline at end of file diff --git a/src/qt_gui/translations/ja_JP.ts b/src/qt_gui/translations/ja_JP.ts new file mode 100644 index 000000000..c3eaaba19 --- /dev/null +++ b/src/qt_gui/translations/ja_JP.ts @@ -0,0 +1,892 @@ + + + + AboutDialog + + + About shadPS4 + shadPS4について + + + + shadPS4 + shadPS4 + + + + shadPS4 is an experimental open-source emulator for the PlayStation 4. + shadPS4は、PlayStation 4の実験的なオープンソースエミュレーターです。 + + + + This software should not be used to play games you have not legally obtained. + このソフトウェアは、合法的に入手していないゲームをプレイするために使用するものではありません。 + + + + ElfViewer + + + Open Folder + フォルダを開く + + + + GameInfoClass + + + Loading game list, please wait :3 + ゲームリストを読み込み中です。お待ちください :3 + + + + Cancel + キャンセル + + + + Loading... + 読み込み中... + + + + GameInstallDialog + + + shadPS4 - Choose directory + shadPS4 - ディレクトリを選択 + + + + Directory to install games + ゲームをインストールするディレクトリ + + + + Browse + 参照 + + + + Error + エラー + + + + The value for location to install games is not valid. + ゲームをインストールする場所が無効です。 + + + + GuiContextMenus + + + Create Shortcut + ショートカットを作成 + + + + Open Game Folder + ゲームフォルダを開く + + + + Cheats / Patches + チート / パッチ + + + + SFO Viewer + SFOビューワー + + + + Trophy Viewer + トロフィービューワー + + + + Copy info + 情報をコピー + + + + Copy Name + 名前をコピー + + + + Copy Serial + シリアルをコピー + + + + Copy All + すべてコピー + + + + Shortcut creation + ショートカットの作成 + + + + Shortcut created successfully!\n %1 + ショートカットが正常に作成されました!\n %1 + + + + Error + エラー + + + + Error creating shortcut!\n %1 + ショートカットの作成に失敗しました!\n %1 + + + + Install PKG + PKGをインストール + + + + MainWindow + + + Open/Add Elf Folder + Elfフォルダを開く/追加する + + + + Install Packages (PKG) + パッケージをインストール (PKG) + + + + Boot Game + ゲームを起動 + + + + About shadPS4 + shadPS4について + + + + Configure... + 設定... + + + + Install application from a .pkg file + .pkgファイルからアプリケーションをインストールする + + + + Recent Games + 最近のゲーム + + + + Exit + 終了 + + + + Exit shadPS4 + shadPS4を終了 + + + + Exit the application. + アプリケーションを終了します。 + + + + Show Game List + ゲームリストを表示 + + + + Game List Refresh + ゲームリストの更新 + + + + Tiny + 極小 + + + + Small + + + + + Medium + + + + + Large + + + + + List View + リストビュー + + + + Grid View + グリッドビュー + + + + Elf Viewer + Elfビュワー + + + + Game Install Directory + ゲームインストールディレクトリ + + + + Download Cheats/Patches + チート / パッチをダウンロード + + + + Dump Game List + ゲームリストをダンプ + + + + PKG Viewer + PKGビューアー + + + + Search... + 検索... + + + + File + ファイル + + + + View + 表示 + + + + Game List Icons + ゲームリストアイコン + + + + Game List Mode + ゲームリストモード + + + + Settings + 設定 + + + + Utils + ユーティリティ + + + + Themes + テーマ + + + + About + 情報 + + + + Dark + ダーク + + + + Light + ライト + + + + Green + グリーン + + + + Blue + ブルー + + + + Violet + バイオレット + + + + toolBar + ツールバー + + + + PKGViewer + + + Open Folder + フォルダーを開く + + + + TrophyViewer + + + Trophy Viewer + トロフィービューアー + + + + SettingsDialog + + + Settings + 設定 + + + + General + 一般 + + + + System + システム + + + + Console Language + コンソール言語 + + + + Emulator Language + エミュレーター言語 + + + + Emulator + エミュレーター + + + + Enable Fullscreen + フルスクリーンを有効にする + + + + Show Splash + スプラッシュを表示する + + + + Is PS4 Pro + PS4 Proモード + + + + Username + ユーザー名 + + + + Logger + ロガー + + + + Log Type + ログタイプ + + + + Log Filter + ログフィルター + + + + Graphics + グラフィックス + + + + Graphics Device + グラフィックスデバイス + + + + Width + + + + + Height + 高さ + + + + Vblank Divider + Vblankディバイダー + + + + Advanced + 高度な設定 + + + + Enable Shaders Dumping + シェーダーのダンプを有効にする + + + + Enable NULL GPU + NULL GPUを有効にする + + + + Enable PM4 Dumping + PM4ダンプを有効にする + + + + Debug + デバッグ + + + + Enable Debug Dumping + デバッグダンプを有効にする + + + + Enable Vulkan Validation Layers + Vulkan検証レイヤーを有効にする + + + + Enable Vulkan Synchronization Validation + Vulkan同期検証を有効にする + + + + Enable RenderDoc Debugging + RenderDocデバッグを有効にする + + + + MainWindow + + + * Unsupported Vulkan Version + * サポートされていないVulkanバージョン + + + + Download Cheats For All Installed Games + すべてのインストール済みゲームのチートをダウンロード + + + + Download Patches For All Games + すべてのゲームのパッチをダウンロード + + + + Download Complete + ダウンロード完了 + + + + You have downloaded cheats for all the games you have installed. + インストールしたすべてのゲームのチートをダウンロードしました。 + + + + Patches Downloaded Successfully! + パッチが正常にダウンロードされました! + + + + All Patches available for all games have been downloaded. + すべてのゲームに利用可能なパッチがダウンロードされました。 + + + + Games: + ゲーム: + + + + PKG File (*.PKG) + PKGファイル (*.PKG) + + + + ELF files (*.bin *.elf *.oelf) + ELFファイル (*.bin *.elf *.oelf) + + + + Game Boot + ゲームブート + + + + Only one file can be selected! + 1つのファイルしか選択できません! + + + + PKG Extraction + PKG抽出 + + + + Patch detected!\nPKG and Game versions match!: %1\nWould you like + パッチが検出されました!\nPKGとゲームバージョンが一致しています!: %1\n上書きしますか + + + + to overwrite? + 上書きしますか? + + + + Patch detected!\nPKG Version %1 is older + パッチが検出されました!\nPKGバージョン %1 は古い + + + + than installed version!: %2\nWould you like + インストールされているバージョンよりも古いです!: %2\n上書きしますか + + + + to overwrite? + 上書きしますか? + + + + Patch detected!\nGame is installed: %1\nWould you like + パッチが検出されました!\nゲームがインストールされています: %1\nインストールしますか + + + + to install Patch: %2? + パッチをインストールしますか: %2? + + + + Game already installed\n%1\nWould you like to overwrite? + ゲームはすでにインストールされています\n%1\n上書きしますか? + + + + PKG is a patch, please install the game first! + PKGはパッチです。ゲームを先にインストールしてください! + + + + PKG ERROR + PKGエラー + + + + Extracting PKG %1/%2 + PKGを抽出中 %1/%2 + + + + Extraction Finished + 抽出完了 + + + + Game successfully installed at %1 + ゲームが %1 に正常にインストールされました + + + + File doesn't appear to be a valid PKG file + ファイルが有効なPKGファイルでないようです + + + + CheatsPatches + + + Cheats / Patches + チート / パッチ + + + + defaultTextEdit_MSG + チート/パッチは実験的です。\n使用には注意してください。\n\nリポジトリを選択し、ダウンロードボタンをクリックしてチートを個別にダウンロードします。\n「Patches」タブでは、すべてのパッチを一度にダウンロードし、使用したいものを選択して選択を保存できます。\n\nチート/パッチを開発していないため、\n問題があればチートの作者に報告してください。\n\n新しいチートを作成しましたか?\nhttps://github.com/shadps4-emu/ps4_cheats を訪問してください。 + + + + No Image Available + 画像は利用できません + + + + Serial: + シリアル: + + + + Version: + バージョン: + + + + Size: + サイズ: + + + + Select Cheat File: + チートファイルを選択: + + + + Repository: + リポジトリ: + + + + Download Cheats + チートをダウンロード + + + + Delete File + ファイルを削除 + + + + No files selected. + ファイルが選択されていません。 + + + + You can delete the cheats you don't want after downloading them. + ダウンロード後に不要なチートを削除できます。 + + + + Do you want to delete the selected file?\n%1 + 選択したファイルを削除しますか?\n%1 + + + + Select Patch File: + パッチファイルを選択: + + + + Download Patches + パッチをダウンロード + + + + Save + 保存 + + + + Cheats + チート + + + + Patches + パッチ + + + + Error + エラー + + + + No patch selected. + パッチが選択されていません。 + + + + Unable to open files.json for reading. + files.jsonを読み込み用に開けません。 + + + + No patch file found for the current serial. + 現在のシリアルに対するパッチファイルが見つかりません。 + + + + Unable to open the file for reading. + ファイルを読み込み用に開けません。 + + + + Unable to open the file for writing. + ファイルを記録用に開けません。 + + + + Failed to parse XML: + XMLの解析に失敗しました: + + + + Success + 成功 + + + + Options saved successfully. + オプションが正常に保存されました。 + + + + Invalid Source + 無効なソース + + + + The selected source is invalid. + 選択したソースは無効です。 + + + + File Exists + ファイルが存在します + + + + File already exists. Do you want to replace it? + ファイルはすでに存在します。置き換えますか? + + + + Failed to save file: + ファイルの保存に失敗しました: + + + + Failed to download file: + ファイルのダウンロードに失敗しました: + + + + Cheats Not Found + チートが見つかりません + + + + CheatsNotFound_MSG + このゲームのこのバージョンのチートが選択されたリポジトリに見つかりませんでした。別のリポジトリまたはゲームの別のバージョンを試してください。 + + + + Cheats Downloaded Successfully + チートが正常にダウンロードされました + + + + CheatsDownloadedSuccessfully_MSG + このゲームのこのバージョンのチートをリポジトリから正常にダウンロードしました。 別のリポジトリからのダウンロードも試せます。利用可能であれば、リストからファイルを選択して使用することも可能です。 + + + + Failed to save: + 保存に失敗しました: + + + + Failed to download: + ダウンロードに失敗しました: + + + + Download Complete + ダウンロード完了 + + + + DownloadComplete_MSG + パッチが正常にダウンロードされました! すべてのゲームに利用可能なパッチがダウンロードされました。チートとは異なり、各ゲームごとに個別にダウンロードする必要はありません。 + + + + Failed to parse JSON data from HTML. + HTMLからJSONデータの解析に失敗しました。 + + + + Failed to retrieve HTML page. + HTMLページの取得に失敗しました。 + + + + Failed to open file: + ファイルを開くのに失敗しました: + + + + XML ERROR: + XMLエラー: + + + + Failed to open files.json for writing + files.jsonを記録用に開けません + + + + Author: + 著者: + + + + Directory does not exist: + ディレクトリが存在しません: + + + + Failed to open files.json for reading. + files.jsonを読み込み用に開けません。 + + + + Name: + 名前: + + + \ No newline at end of file diff --git a/src/qt_gui/translations/ko_KR.ts b/src/qt_gui/translations/ko_KR.ts new file mode 100644 index 000000000..579c6ca79 --- /dev/null +++ b/src/qt_gui/translations/ko_KR.ts @@ -0,0 +1,892 @@ + + + + AboutDialog + + + About shadPS4 + About shadPS4 + + + + shadPS4 + shadPS4 + + + + shadPS4 is an experimental open-source emulator for the PlayStation 4. + shadPS4 is an experimental open-source emulator for the PlayStation 4. + + + + This software should not be used to play games you have not legally obtained. + This software should not be used to play games you have not legally obtained. + + + + ElfViewer + + + Open Folder + Open Folder + + + + GameInfoClass + + + Loading game list, please wait :3 + Loading game list, please wait :3 + + + + Cancel + Cancel + + + + Loading... + Loading... + + + + GameInstallDialog + + + shadPS4 - Choose directory + shadPS4 - Choose directory + + + + Directory to install games + Directory to install games + + + + Browse + Browse + + + + Error + Error + + + + The value for location to install games is not valid. + The value for location to install games is not valid. + + + + GuiContextMenus + + + Create Shortcut + Create Shortcut + + + + Open Game Folder + Open Game Folder + + + + Cheats / Patches + 치트 / 패치 + + + + SFO Viewer + SFO Viewer + + + + Trophy Viewer + Trophy Viewer + + + + Copy info + Copy info + + + + Copy Name + Copy Name + + + + Copy Serial + Copy Serial + + + + Copy All + Copy All + + + + Shortcut creation + Shortcut creation + + + + Shortcut created successfully!\n %1 + Shortcut created successfully!\n %1 + + + + Error + Error + + + + Error creating shortcut!\n %1 + Error creating shortcut!\n %1 + + + + Install PKG + Install PKG + + + + MainWindow + + + Open/Add Elf Folder + Open/Add Elf Folder + + + + Install Packages (PKG) + Install Packages (PKG) + + + + Boot Game + Boot Game + + + + About shadPS4 + About shadPS4 + + + + Configure... + Configure... + + + + Install application from a .pkg file + Install application from a .pkg file + + + + Recent Games + Recent Games + + + + Exit + Exit + + + + Exit shadPS4 + Exit shadPS4 + + + + Exit the application. + Exit the application. + + + + Show Game List + Show Game List + + + + Game List Refresh + Game List Refresh + + + + Tiny + Tiny + + + + Small + Small + + + + Medium + Medium + + + + Large + Large + + + + List View + List View + + + + Grid View + Grid View + + + + Elf Viewer + Elf Viewer + + + + Game Install Directory + Game Install Directory + + + + Download Cheats/Patches + 치트 / 패치 다운로드 + + + + Dump Game List + Dump Game List + + + + PKG Viewer + PKG Viewer + + + + Search... + Search... + + + + File + File + + + + View + View + + + + Game List Icons + Game List Icons + + + + Game List Mode + Game List Mode + + + + Settings + Settings + + + + Utils + Utils + + + + Themes + Themes + + + + About + About + + + + Dark + Dark + + + + Light + Light + + + + Green + Green + + + + Blue + Blue + + + + Violet + Violet + + + + toolBar + toolBar + + + + PKGViewer + + + Open Folder + Open Folder + + + + TrophyViewer + + + Trophy Viewer + Trophy Viewer + + + + SettingsDialog + + + Settings + Settings + + + + General + General + + + + System + System + + + + Console Language + Console Language + + + + Emulator Language + Emulator Language + + + + Emulator + Emulator + + + + Enable Fullscreen + Enable Fullscreen + + + + Show Splash + Show Splash + + + + Is PS4 Pro + Is PS4 Pro + + + + Username + Username + + + + Logger + Logger + + + + Log Type + Log Type + + + + Log Filter + Log Filter + + + + Graphics + Graphics + + + + Graphics Device + Graphics Device + + + + Width + Width + + + + Height + Height + + + + Vblank Divider + Vblank Divider + + + + Advanced + Advanced + + + + Enable Shaders Dumping + Enable Shaders Dumping + + + + Enable NULL GPU + Enable NULL GPU + + + + Enable PM4 Dumping + Enable PM4 Dumping + + + + Debug + Debug + + + + Enable Debug Dumping + Enable Debug Dumping + + + + Enable Vulkan Validation Layers + Enable Vulkan Validation Layers + + + + Enable Vulkan Synchronization Validation + Enable Vulkan Synchronization Validation + + + + Enable RenderDoc Debugging + Enable RenderDoc Debugging + + + + MainWindow + + + * Unsupported Vulkan Version + * Unsupported Vulkan Version + + + + Download Cheats For All Installed Games + Download Cheats For All Installed Games + + + + Download Patches For All Games + Download Patches For All Games + + + + Download Complete + Download Complete + + + + You have downloaded cheats for all the games you have installed. + You have downloaded cheats for all the games you have installed. + + + + Patches Downloaded Successfully! + Patches Downloaded Successfully! + + + + All Patches available for all games have been downloaded. + All Patches available for all games have been downloaded. + + + + Games: + Games: + + + + PKG File (*.PKG) + PKG File (*.PKG) + + + + ELF files (*.bin *.elf *.oelf) + ELF files (*.bin *.elf *.oelf) + + + + Game Boot + Game Boot + + + + Only one file can be selected! + Only one file can be selected! + + + + PKG Extraction + PKG Extraction + + + + Patch detected!\nPKG and Game versions match!: %1\nWould you like + Patch detected!\nPKG and Game versions match!: %1\nWould you like + + + + to overwrite? + to overwrite? + + + + Patch detected!\nPKG Version %1 is older + Patch detected!\nPKG Version %1 is older + + + + than installed version!: %2\nWould you like + than installed version!: %2\nWould you like + + + + to overwrite? + to overwrite? + + + + Patch detected!\nGame is installed: %1\nWould you like + Patch detected!\nGame is installed: %1\nWould you like + + + + to install Patch: %2? + to install Patch: %2? + + + + Game already installed\n%1\nWould you like to overwrite? + Game already installed\n%1\nWould you like to overwrite? + + + + PKG is a patch, please install the game first! + PKG is a patch, please install the game first! + + + + PKG ERROR + PKG ERROR + + + + Extracting PKG %1/%2 + Extracting PKG %1/%2 + + + + Extraction Finished + Extraction Finished + + + + Game successfully installed at %1 + Game successfully installed at %1 + + + + File doesn't appear to be a valid PKG file + File doesn't appear to be a valid PKG file + + + + CheatsPatches + + + Cheats / Patches + Cheats / Patches + + + + defaultTextEdit_MSG + Cheats/Patches are experimental.\nUse with caution.\n\nDownload cheats individually by selecting the repository and clicking the download button.\nIn the Patches tab, you can download all patches at once, choose which ones you want to use, and save your selection.\n\nSince we do not develop the Cheats/Patches,\nplease report issues to the cheat author.\n\nCreated a new cheat? Visit:\nhttps://github.com/shadps4-emu/ps4_cheats + + + + No Image Available + No Image Available + + + + Serial: + Serial: + + + + Version: + Version: + + + + Size: + Size: + + + + Select Cheat File: + Select Cheat File: + + + + Repository: + Repository: + + + + Download Cheats + Download Cheats + + + + Delete File + Delete File + + + + No files selected. + No files selected. + + + + You can delete the cheats you don't want after downloading them. + You can delete the cheats you don't want after downloading them. + + + + Do you want to delete the selected file?\n%1 + Do you want to delete the selected file?\n%1 + + + + Select Patch File: + Select Patch File: + + + + Download Patches + Download Patches + + + + Save + Save + + + + Cheats + Cheats + + + + Patches + Patches + + + + Error + Error + + + + No patch selected. + No patch selected. + + + + Unable to open files.json for reading. + Unable to open files.json for reading. + + + + No patch file found for the current serial. + No patch file found for the current serial. + + + + Unable to open the file for reading. + Unable to open the file for reading. + + + + Unable to open the file for writing. + Unable to open the file for writing. + + + + Failed to parse XML: + Failed to parse XML: + + + + Success + Success + + + + Options saved successfully. + Options saved successfully. + + + + Invalid Source + Invalid Source + + + + The selected source is invalid. + The selected source is invalid. + + + + File Exists + File Exists + + + + File already exists. Do you want to replace it? + File already exists. Do you want to replace it? + + + + Failed to save file: + Failed to save file: + + + + Failed to download file: + Failed to download file: + + + + Cheats Not Found + Cheats Not Found + + + + CheatsNotFound_MSG + No Cheats found for this game in this version of the selected repository,try another repository or a different version of the game. + + + + Cheats Downloaded Successfully + Cheats Downloaded Successfully + + + + CheatsDownloadedSuccessfully_MSG + You have successfully downloaded the cheats for this version of the game from the selected repository. You can try downloading from another repository, if it is available it will also be possible to use it by selecting the file from the list. + + + + Failed to save: + Failed to save: + + + + Failed to download: + Failed to download: + + + + Download Complete + Download Complete + + + + DownloadComplete_MSG + Patches Downloaded Successfully! All Patches available for all games have been downloaded, there is no need to download them individually for each game as happens in Cheats. + + + + Failed to parse JSON data from HTML. + Failed to parse JSON data from HTML. + + + + Failed to retrieve HTML page. + Failed to retrieve HTML page. + + + + Failed to open file: + Failed to open file: + + + + XML ERROR: + XML ERROR: + + + + Failed to open files.json for writing + Failed to open files.json for writing + + + + Author: + Author: + + + + Directory does not exist: + Directory does not exist: + + + + Failed to open files.json for reading. + Failed to open files.json for reading. + + + + Name: + Name: + + + \ No newline at end of file diff --git a/src/qt_gui/translations/lt_LT.ts b/src/qt_gui/translations/lt_LT.ts new file mode 100644 index 000000000..c94edb745 --- /dev/null +++ b/src/qt_gui/translations/lt_LT.ts @@ -0,0 +1,892 @@ + + + + AboutDialog + + + About shadPS4 + About shadPS4 + + + + shadPS4 + shadPS4 + + + + shadPS4 is an experimental open-source emulator for the PlayStation 4. + shadPS4 is an experimental open-source emulator for the PlayStation 4. + + + + This software should not be used to play games you have not legally obtained. + This software should not be used to play games you have not legally obtained. + + + + ElfViewer + + + Open Folder + Open Folder + + + + GameInfoClass + + + Loading game list, please wait :3 + Loading game list, please wait :3 + + + + Cancel + Cancel + + + + Loading... + Loading... + + + + GameInstallDialog + + + shadPS4 - Choose directory + shadPS4 - Choose directory + + + + Directory to install games + Directory to install games + + + + Browse + Browse + + + + Error + Error + + + + The value for location to install games is not valid. + The value for location to install games is not valid. + + + + GuiContextMenus + + + Create Shortcut + Create Shortcut + + + + Open Game Folder + Open Game Folder + + + + Apgaulės / Pleistrai + Cheats / Patches + + + + SFO Viewer + SFO Viewer + + + + Trophy Viewer + Trophy Viewer + + + + Copy info + Copy info + + + + Copy Name + Copy Name + + + + Copy Serial + Copy Serial + + + + Copy All + Copy All + + + + Shortcut creation + Shortcut creation + + + + Shortcut created successfully!\n %1 + Shortcut created successfully!\n %1 + + + + Error + Error + + + + Error creating shortcut!\n %1 + Error creating shortcut!\n %1 + + + + Install PKG + Install PKG + + + + MainWindow + + + Open/Add Elf Folder + Open/Add Elf Folder + + + + Install Packages (PKG) + Install Packages (PKG) + + + + Boot Game + Boot Game + + + + About shadPS4 + About shadPS4 + + + + Configure... + Configure... + + + + Install application from a .pkg file + Install application from a .pkg file + + + + Recent Games + Recent Games + + + + Exit + Exit + + + + Exit shadPS4 + Exit shadPS4 + + + + Exit the application. + Exit the application. + + + + Show Game List + Show Game List + + + + Game List Refresh + Game List Refresh + + + + Tiny + Tiny + + + + Small + Small + + + + Medium + Medium + + + + Large + Large + + + + List View + List View + + + + Grid View + Grid View + + + + Elf Viewer + Elf Viewer + + + + Game Install Directory + Game Install Directory + + + + Download Cheats/Patches + Atsisiųsti Apgaules / Pleistrus + + + + Dump Game List + Dump Game List + + + + PKG Viewer + PKG Viewer + + + + Search... + Search... + + + + File + File + + + + View + View + + + + Game List Icons + Game List Icons + + + + Game List Mode + Game List Mode + + + + Settings + Settings + + + + Utils + Utils + + + + Themes + Themes + + + + About + About + + + + Dark + Dark + + + + Light + Light + + + + Green + Green + + + + Blue + Blue + + + + Violet + Violet + + + + toolBar + toolBar + + + + PKGViewer + + + Open Folder + Open Folder + + + + TrophyViewer + + + Trophy Viewer + Trophy Viewer + + + + SettingsDialog + + + Settings + Settings + + + + General + General + + + + System + System + + + + Console Language + Console Language + + + + Emulator Language + Emulator Language + + + + Emulator + Emulator + + + + Enable Fullscreen + Enable Fullscreen + + + + Show Splash + Show Splash + + + + Is PS4 Pro + Is PS4 Pro + + + + Username + Username + + + + Logger + Logger + + + + Log Type + Log Type + + + + Log Filter + Log Filter + + + + Graphics + Graphics + + + + Graphics Device + Graphics Device + + + + Width + Width + + + + Height + Height + + + + Vblank Divider + Vblank Divider + + + + Advanced + Advanced + + + + Enable Shaders Dumping + Enable Shaders Dumping + + + + Enable NULL GPU + Enable NULL GPU + + + + Enable PM4 Dumping + Enable PM4 Dumping + + + + Debug + Debug + + + + Enable Debug Dumping + Enable Debug Dumping + + + + Enable Vulkan Validation Layers + Enable Vulkan Validation Layers + + + + Enable Vulkan Synchronization Validation + Enable Vulkan Synchronization Validation + + + + Enable RenderDoc Debugging + Enable RenderDoc Debugging + + + + MainWindow + + + * Unsupported Vulkan Version + * Nepalaikoma Vulkan versija + + + + Download Cheats For All Installed Games + Atsisiųsti sukčiavimus visiems įdiegtiems žaidimams + + + + Download Patches For All Games + Atsisiųsti pataisas visiems žaidimams + + + + Download Complete + Atsisiuntimas baigtas + + + + You have downloaded cheats for all the games you have installed. + Jūs atsisiuntėte sukčiavimus visiems jūsų įdiegtiesiems žaidimams. + + + + Patches Downloaded Successfully! + Pataisos sėkmingai atsisiųstos! + + + + All Patches available for all games have been downloaded. + Visos pataisos visiems žaidimams buvo atsisiųstos. + + + + Games: + Žaidimai: + + + + PKG File (*.PKG) + PKG failas (*.PKG) + + + + ELF files (*.bin *.elf *.oelf) + ELF failai (*.bin *.elf *.oelf) + + + + Game Boot + Žaidimo paleidimas + + + + Only one file can be selected! + Galite pasirinkti tik vieną failą! + + + + PKG Extraction + PKG ištraukimas + + + + Patch detected!\nPKG and Game versions match!: %1\nWould you like + Pataisa aptikta!\nPKG ir žaidimo versijos atitinka!: %1\nAr norėtumėte + + + + to overwrite? + perrašyti? + + + + Patch detected!\nPKG Version %1 is older + Pataisa aptikta!\nPKG versija %1 yra senesnė + + + + than installed version!: %2\nWould you like + nei įdiegta versija!: %2\nAr norėtumėte + + + + to overwrite? + perrašyti? + + + + Patch detected!\nGame is installed: %1\nWould you like + Pataisa aptikta!\nŽaidimas įdiegtas: %1\nAr norėtumėte + + + + to install Patch: %2? + įdiegti pataisą: %2? + + + + Game already installed\n%1\nWould you like to overwrite? + Žaidimas jau įdiegtas\n%1\nAr norėtumėte perrašyti? + + + + PKG is a patch, please install the game first! + PKG yra pataisa, prašome pirmiausia įdiegti žaidimą! + + + + PKG ERROR + PKG KLAIDA + + + + Extracting PKG %1/%2 + Ekstrakcinis PKG %1/%2 + + + + Extraction Finished + Ekstrakcija baigta + + + + Game successfully installed at %1 + Žaidimas sėkmingai įdiegtas %1 + + + + File doesn't appear to be a valid PKG file + Failas atrodo, kad nėra galiojantis PKG failas + + + + CheatsPatches + + + Cheats / Patches + Sukčiavimai / Pataisos + + + + defaultTextEdit_MSG + Cheats/Patches yra eksperimentiniai.\nNaudokite atsargiai.\n\nAtsisiųskite cheats atskirai pasirinkdami saugyklą ir paspausdami atsisiuntimo mygtuką.\nPatches skirtuke galite atsisiųsti visus patch’us vienu metu, pasirinkti, kuriuos norite naudoti, ir išsaugoti pasirinkimą.\n\nKadangi mes nekurime Cheats/Patches,\npraneškite problemas cheat autoriui.\n\nSukūrėte naują cheat? Apsilankykite:\nhttps://github.com/shadps4-emu/ps4_cheats + + + + No Image Available + Nuotrauka neprieinama + + + + Serial: + Seriinis numeris: + + + + Version: + Versija: + + + + Size: + Dydis: + + + + Select Cheat File: + Pasirinkite sukčiavimo failą: + + + + Repository: + Saugykla: + + + + Download Cheats + Atsisiųsti sukčiavimus + + + + Delete File + Pašalinti failą + + + + No files selected. + Failai nepasirinkti. + + + + You can delete the cheats you don't want after downloading them. + Galite pašalinti sukčiavimus, kurių nenorite, juos atsisiuntę. + + + + Do you want to delete the selected file?\n%1 + Ar norite ištrinti pasirinktą failą?\n%1 + + + + Select Patch File: + Pasirinkite pataisos failą: + + + + Download Patches + Atsisiųsti pataisas + + + + Save + Įrašyti + + + + Cheats + Sukčiavimai + + + + Patches + Pataisos + + + + Error + Klaida + + + + No patch selected. + Nieko nepataisyta. + + + + Unable to open files.json for reading. + Neįmanoma atidaryti files.json skaitymui. + + + + No patch file found for the current serial. + Nepavyko rasti pataisos failo dabartiniam serijiniam numeriui. + + + + Unable to open the file for reading. + Neįmanoma atidaryti failo skaitymui. + + + + Unable to open the file for writing. + Neįmanoma atidaryti failo rašymui. + + + + Failed to parse XML: + Nepavyko išanalizuoti XML: + + + + Success + Sėkmė + + + + Options saved successfully. + Nustatymai sėkmingai išsaugoti. + + + + Invalid Source + Netinkamas šaltinis + + + + The selected source is invalid. + Pasirinktas šaltinis yra netinkamas. + + + + File Exists + Failas egzistuoja + + + + File already exists. Do you want to replace it? + Failas jau egzistuoja. Ar norite jį pakeisti? + + + + Failed to save file: + Nepavyko išsaugoti failo: + + + + Failed to download file: + Nepavyko atsisiųsti failo: + + + + Cheats Not Found + Sukčiavimai nerasti + + + + CheatsNotFound_MSG + Nerasta sukčiavimų šiam žaidimui šioje pasirinktos saugyklos versijoje,bandykite kitą saugyklą arba skirtingą žaidimo versiją. + + + + Cheats Downloaded Successfully + Sukčiavimai sėkmingai atsisiųsti + + + + CheatsDownloadedSuccessfully_MSG + Sėkmingai atsisiuntėte sukčiavimus šios žaidimo versijos iš pasirinktos saugyklos. Galite pabandyti atsisiųsti iš kitos saugyklos, jei ji yra prieinama, taip pat bus galima ją naudoti pasirinkus failą iš sąrašo. + + + + Failed to save: + Nepavyko išsaugoti: + + + + Failed to download: + Nepavyko atsisiųsti: + + + + Download Complete + Atsisiuntimas baigtas + + + + DownloadComplete_MSG + Pataisos sėkmingai atsisiųstos! Visos pataisos visiems žaidimams buvo atsisiųstos, nebėra reikalo jas atsisiųsti atskirai kiekvienam žaidimui, kaip tai vyksta su sukčiavimais. + + + + Failed to parse JSON data from HTML. + Nepavyko išanalizuoti JSON duomenų iš HTML. + + + + Failed to retrieve HTML page. + Nepavyko gauti HTML puslapio. + + + + Failed to open file: + Nepavyko atidaryti failo: + + + + XML ERROR: + XML KLAIDA: + + + + Failed to open files.json for writing + Nepavyko atidaryti files.json rašymui + + + + Author: + Autorius: + + + + Directory does not exist: + Katalogas neegzistuoja: + + + + Failed to open files.json for reading. + Nepavyko atidaryti files.json skaitymui. + + + + Name: + Pavadinimas: + + + \ No newline at end of file diff --git a/src/qt_gui/translations/nb.ts b/src/qt_gui/translations/nb.ts new file mode 100644 index 000000000..3c5401a2b --- /dev/null +++ b/src/qt_gui/translations/nb.ts @@ -0,0 +1,892 @@ + + + + AboutDialog + + + About shadPS4 + About shadPS4 + + + + shadPS4 + shadPS4 + + + + shadPS4 is an experimental open-source emulator for the PlayStation 4. + shadPS4 is an experimental open-source emulator for the PlayStation 4. + + + + This software should not be used to play games you have not legally obtained. + This software should not be used to play games you have not legally obtained. + + + + ElfViewer + + + Open Folder + Open Folder + + + + GameInfoClass + + + Loading game list, please wait :3 + Loading game list, please wait :3 + + + + Cancel + Cancel + + + + Loading... + Loading... + + + + GameInstallDialog + + + shadPS4 - Choose directory + shadPS4 - Choose directory + + + + Directory to install games + Directory to install games + + + + Browse + Browse + + + + Error + Error + + + + The value for location to install games is not valid. + The value for location to install games is not valid. + + + + GuiContextMenus + + + Create Shortcut + Create Shortcut + + + + Open Game Folder + Open Game Folder + + + + Cheats / Patches + Juks / Oppdateringer + + + + SFO Viewer + SFO Viewer + + + + Trophy Viewer + Trophy Viewer + + + + Copy info + Copy info + + + + Copy Name + Copy Name + + + + Copy Serial + Copy Serial + + + + Copy All + Copy All + + + + Shortcut creation + Shortcut creation + + + + Shortcut created successfully!\n %1 + Shortcut created successfully!\n %1 + + + + Error + Error + + + + Error creating shortcut!\n %1 + Error creating shortcut!\n %1 + + + + Install PKG + Install PKG + + + + MainWindow + + + Open/Add Elf Folder + Open/Add Elf Folder + + + + Install Packages (PKG) + Install Packages (PKG) + + + + Boot Game + Boot Game + + + + About shadPS4 + About shadPS4 + + + + Configure... + Configure... + + + + Install application from a .pkg file + Install application from a .pkg file + + + + Recent Games + Recent Games + + + + Exit + Exit + + + + Exit shadPS4 + Exit shadPS4 + + + + Exit the application. + Exit the application. + + + + Show Game List + Show Game List + + + + Game List Refresh + Game List Refresh + + + + Tiny + Tiny + + + + Small + Small + + + + Medium + Medium + + + + Large + Large + + + + List View + List View + + + + Grid View + Grid View + + + + Elf Viewer + Elf Viewer + + + + Game Install Directory + Game Install Directory + + + + Download Cheats/Patches + Last ned Juks / Oppdateringer + + + + Dump Game List + Dump Game List + + + + PKG Viewer + PKG Viewer + + + + Search... + Search... + + + + File + File + + + + View + View + + + + Game List Icons + Game List Icons + + + + Game List Mode + Game List Mode + + + + Settings + Settings + + + + Utils + Utils + + + + Themes + Themes + + + + About + About + + + + Dark + Dark + + + + Light + Light + + + + Green + Green + + + + Blue + Blue + + + + Violet + Violet + + + + toolBar + toolBar + + + + PKGViewer + + + Open Folder + Open Folder + + + + TrophyViewer + + + Trophy Viewer + Trophy Viewer + + + + SettingsDialog + + + Settings + Settings + + + + General + General + + + + System + System + + + + Console Language + Console Language + + + + Emulator Language + Emulator Language + + + + Emulator + Emulator + + + + Enable Fullscreen + Enable Fullscreen + + + + Show Splash + Show Splash + + + + Is PS4 Pro + Is PS4 Pro + + + + Username + Username + + + + Logger + Logger + + + + Log Type + Log Type + + + + Log Filter + Log Filter + + + + Graphics + Graphics + + + + Graphics Device + Graphics Device + + + + Width + Width + + + + Height + Height + + + + Vblank Divider + Vblank Divider + + + + Advanced + Advanced + + + + Enable Shaders Dumping + Enable Shaders Dumping + + + + Enable NULL GPU + Enable NULL GPU + + + + Enable PM4 Dumping + Enable PM4 Dumping + + + + Debug + Debug + + + + Enable Debug Dumping + Enable Debug Dumping + + + + Enable Vulkan Validation Layers + Enable Vulkan Validation Layers + + + + Enable Vulkan Synchronization Validation + Enable Vulkan Synchronization Validation + + + + Enable RenderDoc Debugging + Enable RenderDoc Debugging + + + + MainWindow + + + * Unsupported Vulkan Version + * Ikke støttet Vulkan-versjon + + + + Download Cheats For All Installed Games + Last ned jukser for alle installerte spill + + + + Download Patches For All Games + Last ned oppdateringer for alle spill + + + + Download Complete + Nedlasting fullført + + + + You have downloaded cheats for all the games you have installed. + Du har lastet ned jukser for alle spillene du har installert. + + + + Patches Downloaded Successfully! + Oppdateringer lastet ned vellykket! + + + + All Patches available for all games have been downloaded. + Alle oppdateringer tilgjengelige for alle spillene har blitt lastet ned. + + + + Games: + Spill: + + + + PKG File (*.PKG) + PKG-fil (*.PKG) + + + + ELF files (*.bin *.elf *.oelf) + ELF-filer (*.bin *.elf *.oelf) + + + + Game Boot + Spilloppstart + + + + Only one file can be selected! + Kun én fil kan velges! + + + + PKG Extraction + PKG-ekstraksjon + + + + Patch detected!\nPKG and Game versions match!: %1\nWould you like + Oppdatering oppdaget!\nPKG og spillversjoner stemmer!: %1\nØnsker du å + + + + to overwrite? + overskrive? + + + + Patch detected!\nPKG Version %1 is older + Oppdatering oppdaget!\nPKG-versjon %1 er eldre + + + + than installed version!: %2\nWould you like + enn installert versjon!: %2\nØnsker du å + + + + to overwrite? + overskrive? + + + + Patch detected!\nGame is installed: %1\nWould you like + Oppdatering oppdaget!\nSpillet er installert: %1\nØnsker du å + + + + to install Patch: %2? + installere oppdateringen: %2? + + + + Game already installed\n%1\nWould you like to overwrite? + Spill allerede installert\n%1\nØnsker du å overskrive? + + + + PKG is a patch, please install the game first! + PKG er en oppdatering, vennligst installer spillet først! + + + + PKG ERROR + PKG FEIL + + + + Extracting PKG %1/%2 + Ekstraherer PKG %1/%2 + + + + Extraction Finished + Ekstrahering fullført + + + + Game successfully installed at %1 + Spillet ble installert vellykket på %1 + + + + File doesn't appear to be a valid PKG file + Fil ser ikke ut til å være en gyldig PKG-fil + + + + CheatsPatches + + + Cheats / Patches + Jukser / Oppdateringer + + + + defaultTextEdit_MSG + Cheats/Patches er eksperimentelle.\nBruk med forsiktighet.\n\nLast ned cheats individuelt ved å velge depotet og klikke på nedlastingsknappen.\nPå fanen Patches kan du laste ned alle patches samtidig, velge hvilke du ønsker å bruke, og lagre valget ditt.\n\nSiden vi ikke utvikler Cheats/Patches,\nvær vennlig å rapportere problemer til cheat-utvikleren.\n\nHar du laget en ny cheat? Besøk:\nhttps://github.com/shadps4-emu/ps4_cheats + + + + No Image Available + Ingen bilde tilgjengelig + + + + Serial: + Serienummer: + + + + Version: + Versjon: + + + + Size: + Størrelse: + + + + Select Cheat File: + Velg juksfil: + + + + Repository: + Depot: + + + + Download Cheats + Last ned jukser + + + + Delete File + Slett fil + + + + No files selected. + Ingen filer valgt. + + + + You can delete the cheats you don't want after downloading them. + Du kan slette jukser du ikke ønsker etter å ha lastet dem ned. + + + + Do you want to delete the selected file?\n%1 + Ønsker du å slette den valgte filen?\n%1 + + + + Select Patch File: + Velg oppdateringsfil: + + + + Download Patches + Last ned oppdateringer + + + + Save + Lagre + + + + Cheats + Jukser + + + + Patches + Oppdateringer + + + + Error + Feil + + + + No patch selected. + Ingen oppdatering valgt. + + + + Unable to open files.json for reading. + Kan ikke åpne files.json for lesing. + + + + No patch file found for the current serial. + Ingen oppdateringsfil funnet for det aktuelle serienummeret. + + + + Unable to open the file for reading. + Kan ikke åpne filen for lesing. + + + + Unable to open the file for writing. + Kan ikke åpne filen for skriving. + + + + Failed to parse XML: + Feil ved parsing av XML: + + + + Success + Vellykket + + + + Options saved successfully. + Alternativer lagret vellykket. + + + + Invalid Source + Ugyldig kilde + + + + The selected source is invalid. + Den valgte kilden er ugyldig. + + + + File Exists + Fil eksisterer + + + + File already exists. Do you want to replace it? + Fil eksisterer allerede. Ønsker du å erstatte den? + + + + Failed to save file: + Kunne ikke lagre fil: + + + + Failed to download file: + Kunne ikke laste ned fil: + + + + Cheats Not Found + Jukser ikke funnet + + + + CheatsNotFound_MSG + Ingen jukser funnet for dette spillet i denne versjonen av det valgte depotet,prøv et annet depot eller en annen versjon av spillet. + + + + Cheats Downloaded Successfully + Jukser lastet ned vellykket + + + + CheatsDownloadedSuccessfully_MSG + Du har lastet ned jukser vellykket for denne versjonen av spillet fra det valgte depotet. Du kan prøve å laste ned fra et annet depot, hvis det er tilgjengelig, vil det også være mulig å bruke det ved å velge filen fra listen. + + + + Failed to save: + Kunne ikke lagre: + + + + Failed to download: + Kunne ikke laste ned: + + + + Download Complete + Nedlasting fullført + + + + DownloadComplete_MSG + Oppdateringer lastet ned vellykket! Alle oppdateringer tilgjengelige for alle spill har blitt lastet ned, det er ikke nødvendig å laste dem ned individuelt for hvert spill som skjer med jukser. + + + + Failed to parse JSON data from HTML. + Kunne ikke analysere JSON-data fra HTML. + + + + Failed to retrieve HTML page. + Kunne ikke hente HTML-side. + + + + Failed to open file: + Kunne ikke åpne fil: + + + + XML ERROR: + XML FEIL: + + + + Failed to open files.json for writing + Kunne ikke åpne files.json for skriving + + + + Author: + Forfatter: + + + + Directory does not exist: + Direktory eksisterer ikke: + + + + Failed to open files.json for reading. + Kunne ikke åpne files.json for lesing. + + + + Name: + Navn: + + + \ No newline at end of file diff --git a/src/qt_gui/translations/nl.ts b/src/qt_gui/translations/nl.ts new file mode 100644 index 000000000..8b55b0e2a --- /dev/null +++ b/src/qt_gui/translations/nl.ts @@ -0,0 +1,892 @@ + + + + AboutDialog + + + About shadPS4 + About shadPS4 + + + + shadPS4 + shadPS4 + + + + shadPS4 is an experimental open-source emulator for the PlayStation 4. + shadPS4 is an experimental open-source emulator for the PlayStation 4. + + + + This software should not be used to play games you have not legally obtained. + This software should not be used to play games you have not legally obtained. + + + + ElfViewer + + + Open Folder + Open Folder + + + + GameInfoClass + + + Loading game list, please wait :3 + Loading game list, please wait :3 + + + + Cancel + Cancel + + + + Loading... + Loading... + + + + GameInstallDialog + + + shadPS4 - Choose directory + shadPS4 - Choose directory + + + + Directory to install games + Directory to install games + + + + Browse + Browse + + + + Error + Error + + + + The value for location to install games is not valid. + The value for location to install games is not valid. + + + + GuiContextMenus + + + Create Shortcut + Create Shortcut + + + + Open Game Folder + Open Game Folder + + + + Cheats / Patches + Cheats / Patches + + + + SFO Viewer + SFO Viewer + + + + Trophy Viewer + Trophy Viewer + + + + Copy info + Copy info + + + + Copy Name + Copy Name + + + + Copy Serial + Copy Serial + + + + Copy All + Copy All + + + + Shortcut creation + Shortcut creation + + + + Shortcut created successfully!\n %1 + Shortcut created successfully!\n %1 + + + + Error + Error + + + + Error creating shortcut!\n %1 + Error creating shortcut!\n %1 + + + + Install PKG + Install PKG + + + + MainWindow + + + Open/Add Elf Folder + Open/Add Elf Folder + + + + Install Packages (PKG) + Install Packages (PKG) + + + + Boot Game + Boot Game + + + + About shadPS4 + About shadPS4 + + + + Configure... + Configure... + + + + Install application from a .pkg file + Install application from a .pkg file + + + + Recent Games + Recent Games + + + + Exit + Exit + + + + Exit shadPS4 + Exit shadPS4 + + + + Exit the application. + Exit the application. + + + + Show Game List + Show Game List + + + + Game List Refresh + Game List Refresh + + + + Tiny + Tiny + + + + Small + Small + + + + Medium + Medium + + + + Large + Large + + + + List View + List View + + + + Grid View + Grid View + + + + Elf Viewer + Elf Viewer + + + + Game Install Directory + Game Install Directory + + + + Download Cheats/Patches + Download Cheats/Patches + + + + Dump Game List + Dump Game List + + + + PKG Viewer + PKG Viewer + + + + Search... + Search... + + + + File + File + + + + View + View + + + + Game List Icons + Game List Icons + + + + Game List Mode + Game List Mode + + + + Settings + Settings + + + + Utils + Utils + + + + Themes + Themes + + + + About + About + + + + Dark + Dark + + + + Light + Light + + + + Green + Green + + + + Blue + Blue + + + + Violet + Violet + + + + toolBar + toolBar + + + + PKGViewer + + + Open Folder + Open Folder + + + + TrophyViewer + + + Trophy Viewer + Trophy Viewer + + + + SettingsDialog + + + Settings + Settings + + + + General + General + + + + System + System + + + + Console Language + Console Language + + + + Emulator Language + Emulator Language + + + + Emulator + Emulator + + + + Enable Fullscreen + Enable Fullscreen + + + + Show Splash + Show Splash + + + + Is PS4 Pro + Is PS4 Pro + + + + Username + Username + + + + Logger + Logger + + + + Log Type + Log Type + + + + Log Filter + Log Filter + + + + Graphics + Graphics + + + + Graphics Device + Graphics Device + + + + Width + Width + + + + Height + Height + + + + Vblank Divider + Vblank Divider + + + + Advanced + Advanced + + + + Enable Shaders Dumping + Enable Shaders Dumping + + + + Enable NULL GPU + Enable NULL GPU + + + + Enable PM4 Dumping + Enable PM4 Dumping + + + + Debug + Debug + + + + Enable Debug Dumping + Enable Debug Dumping + + + + Enable Vulkan Validation Layers + Enable Vulkan Validation Layers + + + + Enable Vulkan Synchronization Validation + Enable Vulkan Synchronization Validation + + + + Enable RenderDoc Debugging + Enable RenderDoc Debugging + + + + MainWindow + + + * Unsupported Vulkan Version + * Niet ondersteunde Vulkan-versie + + + + Download Cheats For All Installed Games + Download cheats voor alle geïnstalleerde spellen + + + + Download Patches For All Games + Download patches voor alle spellen + + + + Download Complete + Download voltooid + + + + You have downloaded cheats for all the games you have installed. + Je hebt cheats gedownload voor alle spellen die je hebt geïnstalleerd. + + + + Patches Downloaded Successfully! + Patches succesvol gedownload! + + + + All Patches available for all games have been downloaded. + Alle patches voor alle spellen zijn gedownload. + + + + Games: + Spellen: + + + + PKG File (*.PKG) + PKG-bestand (*.PKG) + + + + ELF files (*.bin *.elf *.oelf) + ELF-bestanden (*.bin *.elf *.oelf) + + + + Game Boot + Spelopstart + + + + Only one file can be selected! + Je kunt slechts één bestand selecteren! + + + + PKG Extraction + PKG-extractie + + + + Patch detected!\nPKG and Game versions match!: %1\nWould you like + Patch gedetecteerd!\nPKG en spelversies komen overeen!: %1\nWil je + + + + to overwrite? + overschrijven? + + + + Patch detected!\nPKG Version %1 is older + Patch gedetecteerd!\nPKG-versie %1 is ouder + + + + than installed version!: %2\nWould you like + dan de geïnstalleerde versie!: %2\nWil je + + + + to overwrite? + overschrijven? + + + + Patch detected!\nGame is installed: %1\nWould you like + Patch gedetecteerd!\nSpel is geïnstalleerd: %1\nWil je + + + + to install Patch: %2? + de patch installeren: %2? + + + + Game already installed\n%1\nWould you like to overwrite? + Spel al geïnstalleerd\n%1\nWil je het overschrijven? + + + + PKG is a patch, please install the game first! + PKG is een patch, installeer eerst het spel! + + + + PKG ERROR + PKG FOUT + + + + Extracting PKG %1/%2 + PKG %1/%2 aan het extraheren + + + + Extraction Finished + Extractie voltooid + + + + Game successfully installed at %1 + Spel succesvol geïnstalleerd op %1 + + + + File doesn't appear to be a valid PKG file + Het bestand lijkt geen geldig PKG-bestand te zijn + + + + CheatsPatches + + + Cheats / Patches + Cheats / Patches + + + + defaultTextEdit_MSG + Cheats/Patches zijn experimenteel.\nGebruik met voorzichtigheid.\n\nDownload cheats afzonderlijk door het repository te selecteren en op de downloadknop te klikken.\nOp het tabblad Patches kun je alle patches tegelijk downloaden, kiezen welke je wilt gebruiken en je selectie opslaan.\n\nAangezien wij de Cheats/Patches niet ontwikkelen,\nmeld problemen bij de auteur van de cheat.\n\nHeb je een nieuwe cheat gemaakt? Bezoek:\nhttps://github.com/shadps4-emu/ps4_cheats + + + + No Image Available + Geen afbeelding beschikbaar + + + + Serial: + Serie: + + + + Version: + Versie: + + + + Size: + Grootte: + + + + Select Cheat File: + Selecteer cheatbestand: + + + + Repository: + Repository: + + + + Download Cheats + Download cheats + + + + Delete File + Bestand verwijderen + + + + No files selected. + Geen bestanden geselecteerd. + + + + You can delete the cheats you don't want after downloading them. + Je kunt de cheats die je niet wilt verwijderen nadat je ze hebt gedownload. + + + + Do you want to delete the selected file?\n%1 + Wil je het geselecteerde bestand verwijderen?\n%1 + + + + Select Patch File: + Selecteer patchbestand: + + + + Download Patches + Download patches + + + + Save + Opslaan + + + + Cheats + Cheats + + + + Patches + Patches + + + + Error + Fout + + + + No patch selected. + Geen patch geselecteerd. + + + + Unable to open files.json for reading. + Kan files.json niet openen voor lezen. + + + + No patch file found for the current serial. + Geen patchbestand gevonden voor het huidige serienummer. + + + + Unable to open the file for reading. + Kan het bestand niet openen voor lezen. + + + + Unable to open the file for writing. + Kan het bestand niet openen voor schrijven. + + + + Failed to parse XML: + XML parsing mislukt: + + + + Success + Succes + + + + Options saved successfully. + Opties succesvol opgeslagen. + + + + Invalid Source + Ongeldige bron + + + + The selected source is invalid. + De geselecteerde bron is ongeldig. + + + + File Exists + Bestand bestaat + + + + File already exists. Do you want to replace it? + Bestand bestaat al. Wil je het vervangen? + + + + Failed to save file: + Kan bestand niet opslaan: + + + + Failed to download file: + Kan bestand niet downloaden: + + + + Cheats Not Found + Cheats niet gevonden + + + + CheatsNotFound_MSG + Geen cheats gevonden voor deze game in deze versie van de geselecteerde repository.Probeer een andere repository of een andere versie van het spel. + + + + Cheats Downloaded Successfully + Cheats succesvol gedownload + + + + CheatsDownloadedSuccessfully_MSG + Je hebt cheats succesvol gedownload voor deze versie van het spel uit de geselecteerde repository. Je kunt proberen te downloaden van een andere repository. Als deze beschikbaar is, kan het ook worden gebruikt door het bestand uit de lijst te selecteren. + + + + Failed to save: + Opslaan mislukt: + + + + Failed to download: + Downloaden mislukt: + + + + Download Complete + Download voltooid + + + + DownloadComplete_MSG + Patches succesvol gedownload! Alle beschikbare patches voor alle spellen zijn gedownload. Het is niet nodig om ze afzonderlijk te downloaden voor elk spel dat cheats heeft. + + + + Failed to parse JSON data from HTML. + Kan JSON-gegevens uit HTML niet parseren. + + + + Failed to retrieve HTML page. + Kan HTML-pagina niet ophalen. + + + + Failed to open file: + Kan bestand niet openen: + + + + XML ERROR: + XML FOUT: + + + + Failed to open files.json for writing + Kan files.json niet openen voor schrijven + + + + Author: + Auteur: + + + + Directory does not exist: + Map bestaat niet: + + + + Failed to open files.json for reading. + Kan files.json niet openen voor lezen. + + + + Name: + Naam: + + + \ No newline at end of file diff --git a/src/qt_gui/translations/pl_PL.ts b/src/qt_gui/translations/pl_PL.ts new file mode 100644 index 000000000..41c06f89f --- /dev/null +++ b/src/qt_gui/translations/pl_PL.ts @@ -0,0 +1,892 @@ + + + + AboutDialog + + + About shadPS4 + O programie + + + + shadPS4 + shadPS4 + + + + shadPS4 is an experimental open-source emulator for the PlayStation 4. + shadPS4 to eksperymentalny otwartoźródłowy emulator konsoli PlayStation 4. + + + + This software should not be used to play games you have not legally obtained. + To oprogramowanie nie służy do grania w gry pochodzące z nielegalnego źródła. + + + + ElfViewer + + + Open Folder + Otwórz folder + + + + GameInfoClass + + + Loading game list, please wait :3 + Ładowanie listy gier, proszę poczekaj :3 + + + + Cancel + Anuluj + + + + Loading... + Ładowanie... + + + + GameInstallDialog + + + shadPS4 - Choose directory + shadPS4 - Wybierz katalog + + + + Directory to install games + Katalog do instalacji gier + + + + Browse + Przeglądaj + + + + Error + Błąd + + + + The value for location to install games is not valid. + Podana ścieżka do instalacji gier nie jest prawidłowa. + + + + GuiContextMenus + + + Create Shortcut + Utwórz skrót + + + + Open Game Folder + Otwórz katalog gry + + + + Cheats / Patches + Kody / Patche + + + + SFO Viewer + Menedżer plików SFO + + + + Trophy Viewer + Menedżer trofeów + + + + Copy info + Kopiuj informacje + + + + Copy Name + Kopiuj nazwę + + + + Copy Serial + Kopiuj numer seryjny + + + + Copy All + Kopiuj wszystko + + + + Shortcut creation + Tworzenie skrótu + + + + Shortcut created successfully!\n %1 + Utworzenie skrótu zakończone pomyślnie!\n %1 + + + + Error + Błąd + + + + Error creating shortcut!\n %1 + Utworzenie skrótu zakończone niepowodzeniem!\n %1 + + + + Install PKG + Zainstaluj PKG + + + + MainWindow + + + Open/Add Elf Folder + Otwórz/Dodaj folder Elf + + + + Install Packages (PKG) + Zainstaluj paczkę (PKG) + + + + Boot Game + Uruchom grę + + + + About shadPS4 + O programie + + + + Configure... + Konfiguruj... + + + + Install application from a .pkg file + Zainstaluj aplikacje z pliku .pkg + + + + Recent Games + Ostatnie gry + + + + Exit + Wyjdź + + + + Exit shadPS4 + Wyjdź z shadPS4 + + + + Exit the application. + Wyjdź z aplikacji. + + + + Show Game List + Pokaż listę gier + + + + Game List Refresh + Odśwież listę gier + + + + Tiny + Malutkie + + + + Small + Małe + + + + Medium + Średnie + + + + Large + Wielkie + + + + List View + Widok listy + + + + Grid View + Widok siatki + + + + Elf Viewer + Menedżer plików ELF + + + + Game Install Directory + Katalog zainstalowanej gry + + + + Download Cheats/Patches + Pobierz Kody / Patche + + + + Dump Game List + Zgraj listę gier + + + + PKG Viewer + Menedżer plików PKG + + + + Search... + Szukaj... + + + + File + Plik + + + + View + Widok + + + + Game List Icons + Ikony w widoku listy + + + + Game List Mode + Tryb listy gier + + + + Settings + Ustawienia + + + + Utils + Narzędzia + + + + Themes + Motywy + + + + About + O programie + + + + Dark + Ciemny + + + + Light + Jasny + + + + Green + Zielony + + + + Blue + Niebieski + + + + Violet + Fioletowy + + + + toolBar + Pasek narzędzi + + + + PKGViewer + + + Open Folder + Open Folder + + + + TrophyViewer + + + Trophy Viewer + Menedżer trofeów + + + + SettingsDialog + + + Settings + Ustawienia + + + + General + Ogólne + + + + System + System + + + + Console Language + Język konsoli + + + + Emulator Language + Język emulatora + + + + Emulator + Emulator + + + + Enable Fullscreen + Włącz pełny ekran + + + + Show Splash + Pokaż ekran powitania + + + + Is PS4 Pro + Emulacja PS4 Pro + + + + Username + Nazwa użytkownika + + + + Logger + Dziennik zdarzeń + + + + Log Type + Typ dziennika + + + + Log Filter + Filtrowanie dziennika + + + + Graphics + Grafika + + + + Graphics Device + Karta graficzna + + + + Width + Szerokość + + + + Height + Wysokość + + + + Vblank Divider + Dzielnik pionowego blankingu (Vblank) + + + + Advanced + Zaawansowane + + + + Enable Shaders Dumping + Włącz zgrywanie cieni + + + + Enable NULL GPU + Wyłącz kartę graficzną + + + + Enable PM4 Dumping + Włącz zgrywanie PM4 + + + + Debug + Debugowanie + + + + Enable Debug Dumping + Włącz zgrywanie debugowania + + + + Enable Vulkan Validation Layers + Włącz warstwy walidacji Vulkan + + + + Enable Vulkan Synchronization Validation + Włącz walidację synchronizacji Vulkan + + + + Enable RenderDoc Debugging + Włącz debugowanie RenderDoc + + + + MainWindow + + + * Unsupported Vulkan Version + * Nieobsługiwana wersja Vulkan + + + + Download Cheats For All Installed Games + Pobierz kody do wszystkich zainstalowanych gier + + + + Download Patches For All Games + Pobierz poprawki do wszystkich gier + + + + Download Complete + Pobieranie zakończone + + + + You have downloaded cheats for all the games you have installed. + Pobrałeś kody do wszystkich zainstalowanych gier. + + + + Patches Downloaded Successfully! + Poprawki pobrane pomyślnie! + + + + All Patches available for all games have been downloaded. + Wszystkie poprawki dostępne dla wszystkich gier zostały pobrane. + + + + Games: + Gry: + + + + PKG File (*.PKG) + Plik PKG (*.PKG) + + + + ELF files (*.bin *.elf *.oelf) + Pliki ELF (*.bin *.elf *.oelf) + + + + Game Boot + Uruchomienie gry + + + + Only one file can be selected! + Można wybrać tylko jeden plik! + + + + PKG Extraction + Ekstrakcja PKG + + + + Patch detected!\nPKG and Game versions match!: %1\nWould you like + Wykryto poprawkę!\nWersje PKG i gry pasują do siebie!: %1\nCzy chcesz + + + + to overwrite? + nadpisać? + + + + Patch detected!\nPKG Version %1 is older + Wykryto poprawkę!\nWersja PKG %1 jest starsza + + + + than installed version!: %2\nWould you like + niż zainstalowana wersja!: %2\nCzy chcesz + + + + to overwrite? + nadpisać? + + + + Patch detected!\nGame is installed: %1\nWould you like + Wykryto poprawkę!\nGra jest zainstalowana: %1\nCzy chcesz + + + + to install Patch: %2? + zainstalować poprawkę: %2? + + + + Game already installed\n%1\nWould you like to overwrite? + Gra już zainstalowana\n%1\nCzy chcesz ją nadpisać? + + + + PKG is a patch, please install the game first! + PKG jest poprawką, proszę najpierw zainstalować grę! + + + + PKG ERROR + BŁĄD PKG + + + + Extracting PKG %1/%2 + Ekstrakcja PKG %1/%2 + + + + Extraction Finished + Ekstrakcja zakończona + + + + Game successfully installed at %1 + Gra pomyślnie zainstalowana w %1 + + + + File doesn't appear to be a valid PKG file + Plik nie wydaje się być prawidłowym plikiem PKG + + + + CheatsPatches + + + Cheats / Patches + Kody / Poprawki + + + + defaultTextEdit_MSG + Cheaty/Patche są eksperymentalne.\nUżywaj ich ostrożnie.\n\nPobierz cheaty pojedynczo, wybierając repozytorium i klikając przycisk pobierania.\nNa zakładce Patches możesz pobrać wszystkie patche jednocześnie, wybrać, które chcesz używać, i zapisać wybór.\n\nPonieważ nie rozwijamy Cheats/Patches,\nproszę zgłosić problemy do autora cheatu.\n\nStworzyłeś nowy cheat? Odwiedź:\nhttps://github.com/shadps4-emu/ps4_cheats + + + + No Image Available + Brak dostępnego obrazu + + + + Serial: + Numer seryjny: + + + + Version: + Wersja: + + + + Size: + Rozmiar: + + + + Select Cheat File: + Wybierz plik kodu: + + + + Repository: + Repozytorium: + + + + Download Cheats + Pobierz kody + + + + Remove Old Files + Usuń stare pliki + + + + Do you want to delete the files after downloading them? + Czy chcesz usunąć pliki po ich pobraniu? + + + + Do you want to delete the files after downloading them?\n%1 + Czy chcesz usunąć pliki po ich pobraniu?\n%1 + + + + Do you want to delete the selected file?\n%1 + Czy chcesz usunąć wybrany plik?\n%1 + + + + Select Patch File: + Wybierz plik poprawki: + + + + Download Patches + Pobierz poprawki + + + + Save + Zapisz + + + + Cheats + Kody + + + + Patches + Poprawki + + + + Error + Błąd + + + + No patch selected. + Nie wybrano poprawki. + + + + Unable to open files.json for reading. + Nie można otworzyć pliku files.json do odczytu. + + + + No patch file found for the current serial. + Nie znaleziono pliku poprawki dla bieżącego numeru seryjnego. + + + + Unable to open the file for reading. + Nie można otworzyć pliku do odczytu. + + + + Unable to open the file for writing. + Nie można otworzyć pliku do zapisu. + + + + Failed to parse XML: + Nie udało się sparsować XML: + + + + Success + Sukces + + + + Options saved successfully. + Opcje zostały pomyślnie zapisane. + + + + Invalid Source + Nieprawidłowe źródło + + + + The selected source is invalid. + Wybrane źródło jest nieprawidłowe. + + + + File Exists + Plik istnieje + + + + File already exists. Do you want to replace it? + Plik już istnieje. Czy chcesz go zastąpić? + + + + Failed to save file: + Nie udało się zapisać pliku: + + + + Failed to download file: + Nie udało się pobrać pliku: + + + + Cheats Not Found + Nie znaleziono kodów + + + + CheatsNotFound_MSG + Nie znaleziono kodów do tej gry w tej wersji wybranego repozytorium.Spróbuj innego repozytorium lub innej wersji gry. + + + + Cheats Downloaded Successfully + Kody pobrane pomyślnie + + + + CheatsDownloadedSuccessfully_MSG + Pomyślnie pobrano kody dla tej wersji gry z wybranego repozytorium. Możesz spróbować pobrać z innego repozytorium. Jeśli jest dostępne, możesz również użyć go, wybierając plik z listy. + + + + Failed to save: + Nie udało się zapisać: + + + + Failed to download: + Nie udało się pobrać: + + + + Download Complete + Pobieranie zakończone + + + + DownloadComplete_MSG + Poprawki zostały pomyślnie pobrane! Wszystkie dostępne poprawki dla wszystkich gier zostały pobrane. Nie ma potrzeby pobierania ich osobno dla każdej gry, która ma kody. + + + + Failed to parse JSON data from HTML. + Nie udało się sparsować danych JSON z HTML. + + + + Failed to retrieve HTML page. + Nie udało się pobrać strony HTML. + + + + Failed to open file: + Nie udało się otworzyć pliku: + + + + XML ERROR: + BŁĄD XML: + + + + Failed to open files.json for writing + Nie udało się otworzyć pliku files.json do zapisu + + + + Author: + Autor: + + + + Directory does not exist: + Katalog nie istnieje: + + + + Directory does not exist: %1 + Katalog nie istnieje: %1 + + + + Failed to parse JSON: + Nie udało się sparsować JSON: + + + \ No newline at end of file diff --git a/src/qt_gui/translations/pt_BR.ts b/src/qt_gui/translations/pt_BR.ts new file mode 100644 index 000000000..c198d1fd3 --- /dev/null +++ b/src/qt_gui/translations/pt_BR.ts @@ -0,0 +1,892 @@ + + + + AboutDialog + + + About shadPS4 + Sobre o shadPS4 + + + + shadPS4 + shadPS4 + + + + shadPS4 is an experimental open-source emulator for the PlayStation 4. + shadPS4 é um emulador experimental de código-fonte aberto para o PlayStation 4. + + + + This software should not be used to play games you have not legally obtained. + Este software não deve ser usado para jogar jogos piratas. + + + + ElfViewer + + + Open Folder + Abrir Pasta + + + + GameInfoClass + + + Loading game list, please wait :3 + Carregando lista de jogos, por favor aguarde :3 + + + + Cancel + Cancelar + + + + Loading... + Carregando... + + + + GameInstallDialog + + + shadPS4 - Choose directory + shadPS4 - Escolha o diretório + + + + Directory to install games + Diretório para instalar jogos + + + + Browse + Procurar + + + + Error + Erro + + + + The value for location to install games is not valid. + O diretório da instalação dos jogos não é válido. + + + + GuiContextMenus + + + Create Shortcut + Criar Atalho + + + + Open Game Folder + Abrir Pasta do Jogo + + + + Cheats / Patches + Cheats / Patches + + + + SFO Viewer + Visualizador de SFO + + + + Trophy Viewer + Visualizador de Troféu + + + + Copy info + Copiar informação + + + + Copy Name + Copiar Nome + + + + Copy Serial + Copiar Serial + + + + Copy All + Copiar Tudo + + + + Shortcut creation + Criação de atalho + + + + Shortcut created successfully!\n %1 + Atalho criado com sucesso!\n %1 + + + + Error + Erro + + + + Error creating shortcut!\n %1 + Erro ao criar atalho!\n %1 + + + + Install PKG + Instalar PKG + + + + MainWindow + + + Open/Add Elf Folder + Abrir/Adicionar pasta Elf + + + + Install Packages (PKG) + Instalar Pacotes (PKG) + + + + Boot Game + Iniciar Jogo + + + + About shadPS4 + Sobre o shadPS4 + + + + Configure... + Configurar... + + + + Install application from a .pkg file + Instalar aplicação de um arquivo .pkg + + + + Recent Games + Jogos Recentes + + + + Exit + Sair + + + + Exit shadPS4 + Sair do shadPS4 + + + + Exit the application. + Sair da aplicação. + + + + Show Game List + Mostrar Lista de Jogos + + + + Game List Refresh + Atualizar Lista de Jogos + + + + Tiny + Muito pequeno + + + + Small + Pequeno + + + + Medium + Médio + + + + Large + Grande + + + + List View + Visualizar em Lista + + + + Grid View + Visualizar em Grade + + + + Elf Viewer + Visualizador de Elf + + + + Game Install Directory + Diretório de Instalação de Jogos + + + + Download Cheats/Patches + Baixar Trapaças / Patches + + + + Dump Game List + Dumpar Lista de Jogos + + + + PKG Viewer + Visualizador de PKG + + + + Search... + Pesquisar... + + + + File + Arquivo + + + + View + Ver + + + + Game List Icons + Ícones da Lista de Jogos + + + + Game List Mode + Modo de Lista de Jogos + + + + Settings + Configurações + + + + Utils + Utilitários + + + + Themes + Temas + + + + About + Sobre + + + + Dark + Escuro + + + + Light + Claro + + + + Green + Verde + + + + Blue + Azul + + + + Violet + Violeta + + + + toolBar + Barra de Ferramentas + + + + PKGViewer + + + Open Folder + Abrir Pasta + + + + TrophyViewer + + + Trophy Viewer + Visualizador de Troféu + + + + SettingsDialog + + + Settings + Configurações + + + + General + Geral + + + + System + Sistema + + + + Console Language + Idioma do Console + + + + Emulator Language + Idioma do Emulador + + + + Emulator + Emulador + + + + Enable Fullscreen + Ativar Tela Cheia + + + + Show Splash + Mostrar Splash Inicial + + + + Is PS4 Pro + Modo PS4 Pro + + + + Username + Nome de usuário + + + + Logger + Registro + + + + Log Type + Tipo de Registro + + + + Log Filter + Filtro + + + + Graphics + Gráficos + + + + Graphics Device + Placa de Vídeo + + + + Width + Largura + + + + Height + Altura + + + + Vblank Divider + Divisor Vblank + + + + Advanced + Avançado + + + + Enable Shaders Dumping + Ativar Dumping de Shaders + + + + Enable NULL GPU + Ativar GPU NULA + + + + Enable PM4 Dumping + Ativar Dumping de PM4 + + + + Debug + Depuração + + + + Enable Debug Dumping + Ativar Depuração de Dumping + + + + Enable Vulkan Validation Layers + Ativar Camadas de Validação do Vulkan + + + + Enable Vulkan Synchronization Validation + Ativar Validação de Sincronização do Vulkan + + + + Enable RenderDoc Debugging + Ativar Depuração por RenderDoc + + + + MainWindow + + + * Unsupported Vulkan Version + * Versão Vulkan não suportada + + + + Download Cheats For All Installed Games + Baixar Trapaças para todos os jogos instalados + + + + Download Patches For All Games + Baixar Patches para todos os jogos + + + + Download Complete + Download Completo + + + + You have downloaded cheats for all the games you have installed. + Você baixou trapaças para todos os jogos que instalou. + + + + Patches Downloaded Successfully! + Patches Baixados com Sucesso! + + + + All Patches available for all games have been downloaded. + Todos os patches disponíveis para todos os jogos foram baixados. + + + + Games: + Jogos: + + + + PKG File (*.PKG) + Arquivo PKG (*.PKG) + + + + ELF files (*.bin *.elf *.oelf) + Arquivos ELF (*.bin *.elf *.oelf) + + + + Game Boot + Inicialização do Jogo + + + + Only one file can be selected! + Apenas um arquivo pode ser selecionado! + + + + PKG Extraction + Extração de PKG + + + + Patch detected!\nPKG and Game versions match!: %1\nWould you like + Patch detectado!\nVersões PKG e do Jogo correspondem!: %1\nGostaria de + + + + to overwrite? + substituir? + + + + Patch detected!\nPKG Version %1 is older + Patch detectado!\nVersão PKG %1 é mais antiga + + + + than installed version!: %2\nWould you like + do que a versão instalada!: %2\nGostaria de + + + + to overwrite? + substituir? + + + + Patch detected!\nGame is installed: %1\nWould you like + Patch detectado!\nJogo está instalado: %1\nGostaria de + + + + to install Patch: %2? + instalar o Patch: %2? + + + + Game already installed\n%1\nWould you like to overwrite? + Jogo já instalado\n%1\nGostaria de substituir? + + + + PKG is a patch, please install the game first! + PKG é um patch, por favor, instale o jogo primeiro! + + + + PKG ERROR + ERRO PKG + + + + Extracting PKG %1/%2 + Extraindo PKG %1/%2 + + + + Extraction Finished + Extração Concluída + + + + Game successfully installed at %1 + Jogo instalado com sucesso em %1 + + + + File doesn't appear to be a valid PKG file + O arquivo não parece ser um arquivo PKG válido + + + + CheatsPatches + + + Cheats / Patches + Trapaças / Patches + + + + defaultTextEdit_MSG + Trapaças/Patches são experimentais.\nUse com cautela.\n\nBaixe as trapaças individualmente selecionando o repositório e clicando no botão de download.\nNa aba Patches, você pode baixar todos os Patches de uma vez, escolher qual deseja usar e salvar a opção.\n\nComo não desenvolvemos as Trapaças/Patches,\npor favor, reporte problemas relacionados ao autor da trapaça.\n\nCriou uma nova trapaça? Visite:\nhttps://github.com/shadps4-emu/ps4_cheats + + + + No Image Available + Imagem Não Disponível + + + + Serial: + Série: + + + + Version: + Versão: + + + + Size: + Tamanho: + + + + Select Cheat File: + Selecione o Arquivo de Trapaça: + + + + Repository: + Repositório: + + + + Download Cheats + Baixar Trapaças + + + + Delete File + Excluir Arquivo + + + + No files selected. + Nenhum arquivo selecionado. + + + + You can delete the cheats you don't want after downloading them. + Você pode excluir as trapaças que não deseja após baixá-las. + + + + Do you want to delete the selected file?\n%1 + Deseja excluir o arquivo selecionado?\n%1 + + + + Select Patch File: + Selecione o Arquivo de Patch: + + + + Download Patches + Baixar Patches + + + + Save + Salvar + + + + Cheats + Trapaças + + + + Patches + Patches + + + + Error + Erro + + + + No patch selected. + Nenhum patch selecionado. + + + + Unable to open files.json for reading. + Não foi possível abrir files.json para leitura. + + + + No patch file found for the current serial. + Nenhum arquivo de patch encontrado para a série atual. + + + + Unable to open the file for reading. + Não foi possível abrir o arquivo para leitura. + + + + Unable to open the file for writing. + Não foi possível abrir o arquivo para gravação. + + + + Failed to parse XML: + Falha ao analisar XML: + + + + Success + Sucesso + + + + Options saved successfully. + Opções salvas com sucesso. + + + + Invalid Source + Fonte Inválida + + + + The selected source is invalid. + A fonte selecionada é inválida. + + + + File Exists + Arquivo Existe + + + + File already exists. Do you want to replace it? + O arquivo já existe. Deseja substituí-lo? + + + + Failed to save file: + Falha ao salvar o arquivo: + + + + Failed to download file: + Falha ao baixar o arquivo: + + + + Cheats Not Found + Trapaças Não Encontradas + + + + CheatsNotFound_MSG + Nenhuma trapaça encontrada para este jogo nesta versão do repositório selecionado, tente outro repositório ou uma versão diferente do jogo. + + + + Cheats Downloaded Successfully + Trapaças Baixadas com Sucesso + + + + CheatsDownloadedSuccessfully_MSG + Você baixou as trapaças com sucesso. Para esta versão do jogo a partir do repositório selecionado.Você pode tentar baixar de outro repositório, se estiver disponível, também será possível usá-lo selecionando o arquivo da lista. + + + + Failed to save: + Falha ao salvar: + + + + Failed to download: + Falha ao baixar: + + + + Download Complete + Download Completo + + + + DownloadComplete_MSG + Patches Baixados com Sucesso! Todos os patches disponíveis para todos os jogos foram baixados, não é necessário baixá-los individualmente para cada jogo como acontece com as Trapaças. + + + + Failed to parse JSON data from HTML. + Falha ao analisar dados JSON do HTML. + + + + Failed to retrieve HTML page. + Falha ao recuperar a página HTML. + + + + Failed to open file: + Falha ao abrir o arquivo: + + + + XML ERROR: + ERRO XML: + + + + Failed to open files.json for writing + Falha ao abrir files.json para gravação + + + + Author: + Autor: + + + + Directory does not exist: + Diretório não existe: + + + + Failed to open files.json for reading. + Falha ao abrir files.json para leitura. + + + + Name: + Nome: + + + \ No newline at end of file diff --git a/src/qt_gui/translations/ro_RO.ts b/src/qt_gui/translations/ro_RO.ts new file mode 100644 index 000000000..3463182f5 --- /dev/null +++ b/src/qt_gui/translations/ro_RO.ts @@ -0,0 +1,892 @@ + + + + AboutDialog + + + About shadPS4 + About shadPS4 + + + + shadPS4 + shadPS4 + + + + shadPS4 is an experimental open-source emulator for the PlayStation 4. + shadPS4 is an experimental open-source emulator for the PlayStation 4. + + + + This software should not be used to play games you have not legally obtained. + This software should not be used to play games you have not legally obtained. + + + + ElfViewer + + + Open Folder + Open Folder + + + + GameInfoClass + + + Loading game list, please wait :3 + Loading game list, please wait :3 + + + + Cancel + Cancel + + + + Loading... + Loading... + + + + GameInstallDialog + + + shadPS4 - Choose directory + shadPS4 - Choose directory + + + + Directory to install games + Directory to install games + + + + Browse + Browse + + + + Error + Error + + + + The value for location to install games is not valid. + The value for location to install games is not valid. + + + + GuiContextMenus + + + Create Shortcut + Create Shortcut + + + + Open Game Folder + Open Game Folder + + + + Trapaças / Patches + Coduri / Patch-uri + + + + SFO Viewer + SFO Viewer + + + + Trophy Viewer + Trophy Viewer + + + + Copy info + Copy info + + + + Copy Name + Copy Name + + + + Copy Serial + Copy Serial + + + + Copy All + Copy All + + + + Shortcut creation + Shortcut creation + + + + Shortcut created successfully!\n %1 + Shortcut created successfully!\n %1 + + + + Error + Error + + + + Error creating shortcut!\n %1 + Error creating shortcut!\n %1 + + + + Install PKG + Install PKG + + + + MainWindow + + + Open/Add Elf Folder + Open/Add Elf Folder + + + + Install Packages (PKG) + Install Packages (PKG) + + + + Boot Game + Boot Game + + + + About shadPS4 + About shadPS4 + + + + Configure... + Configure... + + + + Install application from a .pkg file + Install application from a .pkg file + + + + Recent Games + Recent Games + + + + Exit + Exit + + + + Exit shadPS4 + Exit shadPS4 + + + + Exit the application. + Exit the application. + + + + Show Game List + Show Game List + + + + Game List Refresh + Game List Refresh + + + + Tiny + Tiny + + + + Small + Small + + + + Medium + Medium + + + + Large + Large + + + + List View + List View + + + + Grid View + Grid View + + + + Elf Viewer + Elf Viewer + + + + Game Install Directory + Game Install Directory + + + + Download Cheats/Patches + Descarcă Coduri / Patch-uri + + + + Dump Game List + Dump Game List + + + + PKG Viewer + PKG Viewer + + + + Search... + Search... + + + + File + File + + + + View + View + + + + Game List Icons + Game List Icons + + + + Game List Mode + Game List Mode + + + + Settings + Settings + + + + Utils + Utils + + + + Themes + Themes + + + + About + About + + + + Dark + Dark + + + + Light + Light + + + + Green + Green + + + + Blue + Blue + + + + Violet + Violet + + + + toolBar + toolBar + + + + PKGViewer + + + Open Folder + Open Folder + + + + TrophyViewer + + + Trophy Viewer + Trophy Viewer + + + + SettingsDialog + + + Settings + Settings + + + + General + General + + + + System + System + + + + Console Language + Console Language + + + + Emulator Language + Emulator Language + + + + Emulator + Emulator + + + + Enable Fullscreen + Enable Fullscreen + + + + Show Splash + Show Splash + + + + Is PS4 Pro + Is PS4 Pro + + + + Username + Username + + + + Logger + Logger + + + + Log Type + Log Type + + + + Log Filter + Log Filter + + + + Graphics + Graphics + + + + Graphics Device + Graphics Device + + + + Width + Width + + + + Height + Height + + + + Vblank Divider + Vblank Divider + + + + Advanced + Advanced + + + + Enable Shaders Dumping + Enable Shaders Dumping + + + + Enable NULL GPU + Enable NULL GPU + + + + Enable PM4 Dumping + Enable PM4 Dumping + + + + Debug + Debug + + + + Enable Debug Dumping + Enable Debug Dumping + + + + Enable Vulkan Validation Layers + Enable Vulkan Validation Layers + + + + Enable Vulkan Synchronization Validation + Enable Vulkan Synchronization Validation + + + + Enable RenderDoc Debugging + Enable RenderDoc Debugging + + + + MainWindow + + + * Unsupported Vulkan Version + * Versiune Vulkan nesuportată + + + + Download Cheats For All Installed Games + Descarcă Cheats pentru toate jocurile instalate + + + + Download Patches For All Games + Descarcă Patches pentru toate jocurile + + + + Download Complete + Descărcare completă + + + + You have downloaded cheats for all the games you have installed. + Ai descărcat cheats pentru toate jocurile instalate. + + + + Patches Downloaded Successfully! + Patches descărcate cu succes! + + + + All Patches available for all games have been downloaded. + Toate Patches disponibile pentru toate jocurile au fost descărcate. + + + + Games: + Jocuri: + + + + PKG File (*.PKG) + Fișier PKG (*.PKG) + + + + ELF files (*.bin *.elf *.oelf) + Fișiere ELF (*.bin *.elf *.oelf) + + + + Game Boot + Boot Joc + + + + Only one file can be selected! + Numai un fișier poate fi selectat! + + + + PKG Extraction + Extracție PKG + + + + Patch detected!\nPKG and Game versions match!: %1\nWould you like + Patch detectat!\nVersiunile PKG și Joc se potrivesc!: %1\nAi dori să + + + + to overwrite? + să suprascrii? + + + + Patch detected!\nPKG Version %1 is older + Patch detectat!\nVersiunea PKG %1 este mai veche + + + + than installed version!: %2\nWould you like + decât versiunea instalată!: %2\nAi dori să + + + + to overwrite? + să suprascrii? + + + + Patch detected!\nGame is installed: %1\nWould you like + Patch detectat!\nJocul este instalat: %1\nAi dori să + + + + to install Patch: %2? + să instalezi Patch-ul: %2? + + + + Game already installed\n%1\nWould you like to overwrite? + Jocul este deja instalat\n%1\nAi dori să suprascrii? + + + + PKG is a patch, please install the game first! + PKG este un patch, te rugăm să instalezi mai întâi jocul! + + + + PKG ERROR + EROARE PKG + + + + Extracting PKG %1/%2 + Extracție PKG %1/%2 + + + + Extraction Finished + Extracție terminată + + + + Game successfully installed at %1 + Jocul a fost instalat cu succes la %1 + + + + File doesn't appear to be a valid PKG file + Fișierul nu pare să fie un fișier PKG valid + + + + CheatsPatches + + + Cheats / Patches + Cheats / Patches + + + + defaultTextEdit_MSG + Cheats/Patches sunt experimentale.\nUtilizați cu prudență.\n\nDescărcați cheats individual prin selectarea depozitului și făcând clic pe butonul de descărcare.\nÎn fila Patches, puteți descărca toate patch-urile deodată, alege pe cele pe care doriți să le utilizați și salvați selecția.\n\nDeoarece nu dezvoltăm Cheats/Patches,\nte rugăm să raportezi problemele autorului cheat-ului.\n\nAi creat un nou cheat? Vizitează:\nhttps://github.com/shadps4-emu/ps4_cheats + + + + No Image Available + Nu este disponibilă imaginea + + + + Serial: + Serial: + + + + Version: + Versiune: + + + + Size: + Dimensiune: + + + + Select Cheat File: + Selectează fișierul Cheat: + + + + Repository: + Repository: + + + + Download Cheats + Descarcă Cheats + + + + Delete File + Șterge Fișierul + + + + No files selected. + Nu sunt fișiere selectate. + + + + You can delete the cheats you don't want after downloading them. + Poti șterge cheats-urile pe care nu le dorești după ce le-ai descărcat. + + + + Do you want to delete the selected file?\n%1 + Vrei să ștergi fișierul selectat?\n%1 + + + + Select Patch File: + Selectează fișierul Patch: + + + + Download Patches + Descarcă Patches + + + + Save + Salvează + + + + Cheats + Cheats + + + + Patches + Patches + + + + Error + Eroare + + + + No patch selected. + Nu este selectat niciun patch. + + + + Unable to open files.json for reading. + Imposibil de deschis files.json pentru citire. + + + + No patch file found for the current serial. + Nu s-a găsit niciun fișier patch pentru serialul curent. + + + + Unable to open the file for reading. + Imposibil de deschis fișierul pentru citire. + + + + Unable to open the file for writing. + Imposibil de deschis fișierul pentru scriere. + + + + Failed to parse XML: + Nu s-a reușit pararea XML: + + + + Success + Succes + + + + Options saved successfully. + Opțiunile au fost salvate cu succes. + + + + Invalid Source + Sursă invalidă + + + + The selected source is invalid. + Sursa selectată este invalidă. + + + + File Exists + Fișier existent + + + + File already exists. Do you want to replace it? + Fișierul există deja. Vrei să-l înlocuiești? + + + + Failed to save file: + Nu s-a reușit salvarea fișierului: + + + + Failed to download file: + Nu s-a reușit descărcarea fișierului: + + + + Cheats Not Found + Cheats Nu au fost găsite + + + + CheatsNotFound_MSG + Nu au fost găsite cheats pentru acest joc în această versiune a repository-ului selectat, încearcă un alt repository sau o versiune diferită a jocului. + + + + Cheats Downloaded Successfully + Cheats descărcate cu succes + + + + CheatsDownloadedSuccessfully_MSG + Ai descărcat cu succes cheats-urile pentru această versiune a jocului din repository-ul selectat. Poți încerca descărcarea din alt repository; dacă este disponibil, va fi posibil să-l folosești selectând fișierul din listă. + + + + Failed to save: + Nu s-a reușit salvarea: + + + + Failed to download: + Nu s-a reușit descărcarea: + + + + Download Complete + Descărcare completă + + + + DownloadComplete_MSG + Patches descărcate cu succes! Toate Patches disponibile pentru toate jocurile au fost descărcate; nu este nevoie să le descarci individual pentru fiecare joc, așa cum se întâmplă cu Cheats. + + + + Failed to parse JSON data from HTML. + Nu s-a reușit pararea datelor JSON din HTML. + + + + Failed to retrieve HTML page. + Nu s-a reușit obținerea paginii HTML. + + + + Failed to open file: + Nu s-a reușit deschiderea fișierului: + + + + XML ERROR: + EROARE XML: + + + + Failed to open files.json for writing + Nu s-a reușit deschiderea files.json pentru scriere + + + + Author: + Autor: + + + + Directory does not exist: + Directorul nu există: + + + + Failed to open files.json for reading. + Nu s-a reușit deschiderea files.json pentru citire. + + + + Name: + Nume: + + + \ No newline at end of file diff --git a/src/qt_gui/translations/ru_RU.ts b/src/qt_gui/translations/ru_RU.ts new file mode 100644 index 000000000..a71533a35 --- /dev/null +++ b/src/qt_gui/translations/ru_RU.ts @@ -0,0 +1,892 @@ + + + + AboutDialog + + + About shadPS4 + О shadPS4 + + + + shadPS4 + shadPS4 + + + + shadPS4 is an experimental open-source emulator for the PlayStation 4. + shadPS4 это экспериментальный эмулятор с открытым исходным кодом для PlayStation 4. + + + + This software should not be used to play games you have not legally obtained. + Это програмное обеспечение не должно использоваться для запуска игр, которые вы получили нелегально. + + + + ElfViewer + + + Open Folder + Открыть папку + + + + GameInfoClass + + + Loading game list, please wait :3 + Загрузка списка игр, пожалуйста подождите :3 + + + + Cancel + Отмена + + + + Loading... + Загрузка... + + + + GameInstallDialog + + + shadPS4 - Choose directory + shadPS4 - Выберите папку + + + + Directory to install games + Папка для установки игр + + + + Browse + Обзор + + + + Error + Ошибка + + + + The value for location to install games is not valid. + Недопустимое значение местоположения для установки игр. + + + + GuiContextMenus + + + Create Shortcut + Создать ярлык + + + + Open Game Folder + Открыть папку с игрой + + + + Cheats / Patches + Читы / Патчи + + + + SFO Viewer + Просмотр SFO + + + + Trophy Viewer + Просмотр трофеев + + + + Copy info + Копировать информацию + + + + Copy Name + Копировать имя + + + + Copy Serial + Копировать серийный номер + + + + Copy All + Копировать все + + + + Shortcut creation + Создание ярлыка + + + + Shortcut created successfully!\n %1 + Ярлык создан успешно!\n %1 + + + + Error + Ошибка + + + + Error creating shortcut!\n %1 + Ошибка создания ярлыка!\n %1 + + + + Install PKG + Установить PKG + + + + MainWindow + + + Open/Add Elf Folder + Открыть/Добавить папку Elf + + + + Install Packages (PKG) + Установить пакеты (PKG) + + + + Boot Game + Запустить игру + + + + About shadPS4 + О shadPS4 + + + + Configure... + Настроить... + + + + Install application from a .pkg file + Установить приложение из файла .pkg + + + + Recent Games + Недавние игры + + + + Exit + Выход + + + + Exit shadPS4 + Выйти из shadPS4 + + + + Exit the application. + Выйти из приложения. + + + + Show Game List + Показать список игр + + + + Game List Refresh + Обновить список игр + + + + Tiny + Крошечный + + + + Small + Маленький + + + + Medium + Средний + + + + Large + Большой + + + + List View + Список + + + + Grid View + Сетка + + + + Elf Viewer + Elf + + + + Game Install Directory + Каталог установки игры + + + + Download Cheats/Patches + Скачать Читы / Патчи + + + + Dump Game List + Дамп списка игр + + + + PKG Viewer + Просмотр PKG + + + + Search... + Поиск... + + + + File + Файл + + + + View + Вид + + + + Game List Icons + Размер иконок списка игр + + + + Game List Mode + Вид списка игр + + + + Settings + Настройки + + + + Utils + Утилиты + + + + Themes + Темы + + + + About + Справка + + + + Dark + Темная + + + + Light + Светлая + + + + Green + Зеленая + + + + Blue + Синяя + + + + Violet + Фиолетовая + + + + toolBar + Панель инструментов + + + + PKGViewer + + + Open Folder + Открыть папку + + + + TrophyViewer + + + Trophy Viewer + Трофеи + + + + SettingsDialog + + + Settings + Настройки + + + + General + Общее + + + + System + Система + + + + Console Language + Язык консоли + + + + Emulator Language + Язык эмулятора + + + + Emulator + Эмулятор + + + + Enable Fullscreen + Включить полноэкранный режим + + + + Show Splash + Показать заставку + + + + Is PS4 Pro + Режим PS4 Pro + + + + Username + Имя пользователя + + + + Logger + Логирование + + + + Log Type + Тип логов + + + + Log Filter + Фильтр логов + + + + Graphics + Графика + + + + Graphics Device + Графическое устройство + + + + Width + Ширина + + + + Height + Высота + + + + Vblank Divider + Разделитель Vblank + + + + Advanced + Продвинутые + + + + Enable Shaders Dumping + Включить дамп шейдеров + + + + Enable NULL GPU + Включить NULL GPU + + + + Enable PM4 Dumping + Включить дамп PM4 + + + + Debug + Отладка + + + + Enable Debug Dumping + Включить отладочные дампы + + + + Enable Vulkan Validation Layers + Включить слои валидации Vulkan + + + + Enable Vulkan Synchronization Validation + Включить валидацию синхронизации Vulkan + + + + Enable RenderDoc Debugging + Включить отладку RenderDoc + + + + MainWindow + + + * Unsupported Vulkan Version + * Неподдерживаемая версия Vulkan + + + + Download Cheats For All Installed Games + Скачать читы для всех установленных игр + + + + Download Patches For All Games + Скачать патчи для всех игр + + + + Download Complete + Скачивание завершено + + + + You have downloaded cheats for all the games you have installed. + Вы скачали читы для всех установленных игр. + + + + Patches Downloaded Successfully! + Патчи успешно скачаны! + + + + All Patches available for all games have been downloaded. + Все доступные патчи для всех игр были скачаны. + + + + Games: + Игры: + + + + PKG File (*.PKG) + Файл PKG (*.PKG) + + + + ELF files (*.bin *.elf *.oelf) + Файл ELF (*.bin *.elf *.oelf) + + + + Game Boot + Запуск игры + + + + Only one file can be selected! + Можно выбрать только один файл! + + + + PKG Extraction + Извлечение PKG + + + + Patch detected!\nPKG and Game versions match!: %1\nWould you like + Обнаружен патч!\nВерсии PKG и игры совпадают!: %1\nХотите + + + + to overwrite? + перезаписать? + + + + Patch detected!\nPKG Version %1 is older + Обнаружен патч!\nВерсия PKG %1 устарела + + + + than installed version!: %2\nWould you like + по сравнению с установленной версией!: %2\nХотите + + + + to overwrite? + перезаписать? + + + + Patch detected!\nGame is installed: %1\nWould you like + Обнаружен патч!\nИгра установлена: %1\nХотите + + + + to install Patch: %2? + установить патч: %2? + + + + Game already installed\n%1\nWould you like to overwrite? + Игра уже установлена\n%1\nХотите перезаписать? + + + + PKG is a patch, please install the game first! + PKG - это патч, сначала установите игру! + + + + PKG ERROR + ОШИБКА PKG + + + + Extracting PKG %1/%2 + Извлечение PKG %1/%2 + + + + Extraction Finished + Извлечение завершено + + + + Game successfully installed at %1 + Игра успешно установлена по адресу %1 + + + + File doesn't appear to be a valid PKG file + Файл не является допустимым файлом PKG + + + + CheatsPatches + + + Cheats / Patches + Читы / Патчи + + + + defaultTextEdit_MSG + Cheats/Patches sunt experimentale.\nUtilizați cu prudență.\n\nDescărcați cheats individual prin selectarea depozitului și făcând clic pe butonul de descărcare.\nÎn fila Patches, puteți descărca toate patch-urile deodată, alege pe cele pe care doriți să le utilizați și salvați selecția.\n\nDeoarece nu dezvoltăm Cheats/Patches,\nte rugăm să raportezi problemele autorului cheat-ului.\n\nAi creat un nou cheat? Vizitează:\nhttps://github.com/shadps4-emu/ps4_cheats + + + + No Image Available + Изображение недоступно + + + + Serial: + Серийный номер: + + + + Version: + Версия: + + + + Size: + Размер: + + + + Select Cheat File: + Выберите файл чита: + + + + Repository: + Репозиторий: + + + + Download Cheats + Скачать читы + + + + Delete File + Удалить файл + + + + No files selected. + Файлы не выбраны. + + + + You can delete the cheats you don't want after downloading them. + Вы можете удалить ненужные читы после их скачивания. + + + + Do you want to delete the selected file?\n%1 + Вы хотите удалить выбранный файл?\n%1 + + + + Select Patch File: + Выберите файл патча: + + + + Download Patches + Скачать патчи + + + + Save + Сохранить + + + + Cheats + Читы + + + + Patches + Патчи + + + + Error + Ошибка + + + + No patch selected. + Патч не выбран. + + + + Unable to open files.json for reading. + Не удалось открыть файл files.json для чтения. + + + + No patch file found for the current serial. + Не найден файл патча для текущего серийного номера. + + + + Unable to open the file for reading. + Не удалось открыть файл для чтения. + + + + Unable to open the file for writing. + Не удалось открыть файл для записи. + + + + Failed to parse XML: + Не удалось разобрать XML: + + + + Success + Успех + + + + Options saved successfully. + Опции успешно сохранены. + + + + Invalid Source + Неверный источник + + + + The selected source is invalid. + Выбранный источник недействителен. + + + + File Exists + Файл существует + + + + File already exists. Do you want to replace it? + Файл уже существует. Хотите заменить его? + + + + Failed to save file: + Не удалось сохранить файл: + + + + Failed to download file: + Не удалось скачать файл: + + + + Cheats Not Found + Читы не найдены + + + + CheatsNotFound_MSG + Читы не найдены для этой игры в выбранном репозитории. Попробуйте другой репозиторий или другую версию игры. + + + + Cheats Downloaded Successfully + Читы успешно скачаны + + + + CheatsDownloadedSuccessfully_MSG + Вы успешно скачали читы для этой версии игры из выбранного репозитория. Вы можете попробовать скачать из другого репозитория. Если он доступен, его также можно будет использовать, выбрав файл из списка. + + + + Failed to save: + Не удалось сохранить: + + + + Failed to download: + Не удалось скачать: + + + + Download Complete + Скачивание завершено + + + + DownloadComplete_MSG + Патчи успешно скачаны! Все доступные патчи для всех игр были скачаны, нет необходимости скачивать их по отдельности для каждой игры, как это происходит с читами. + + + + Failed to parse JSON data from HTML. + Не удалось разобрать данные JSON из HTML. + + + + Failed to retrieve HTML page. + Не удалось получить HTML-страницу. + + + + Failed to open file: + Не удалось открыть файл: + + + + XML ERROR: + ОШИБКА XML: + + + + Failed to open files.json for writing + Не удалось открыть файл files.json для записи + + + + Author: + Автор: + + + + Directory does not exist: + Каталог не существует: + + + + Failed to open files.json for reading. + Не удалось открыть файл files.json для чтения. + + + + Name: + Имя: + + + \ No newline at end of file diff --git a/src/qt_gui/translations/tr_TR.ts b/src/qt_gui/translations/tr_TR.ts new file mode 100644 index 000000000..514b9af7e --- /dev/null +++ b/src/qt_gui/translations/tr_TR.ts @@ -0,0 +1,963 @@ + + + + AboutDialog + + + About shadPS4 + shadPS4 Hakkında + + + + shadPS4 + shadPS4 + + + + shadPS4 is an experimental open-source emulator for the PlayStation 4. + shadPS4, PlayStation 4 için deneysel bir açık kaynak kodlu emülatördür. + + + + This software should not be used to play games you have not legally obtained. + Bu yazılım, yasal olarak edinmediğiniz oyunları oynamak için kullanılmamalıdır. + + + + ElfViewer + + + Open Folder + Klasörü Aç + + + + GameInfoClass + + + Loading game list, please wait :3 + Oyun listesi yükleniyor, lütfen bekleyin :3 + + + + Cancel + İptal + + + + Loading... + Yükleniyor... + + + + GameInstallDialog + + + shadPS4 - Choose directory + shadPS4 - Klasörü Seç + + + + Directory to install games + Oyunların yükleneceği klasör + + + + Browse + Gözat + + + + Error + Hata + + + + The value for location to install games is not valid. + Oyunların yükleneceği konum için girilen klasör geçerli değil. + + + + GuiContextMenus + + + Create Shortcut + Kısayol Oluştur + + + + Open Game Folder + Oyun Klasörünü Aç + + + + Cheats / Patches + Hileler / Yamanlar + + + + SFO Viewer + SFO Görüntüleyici + + + + Trophy Viewer + Kupa Görüntüleyici + + + + Copy info + Bilgiyi Kopyala + + + + Copy Name + Adı Kopyala + + + + Copy Serial + Seri Numarasını Kopyala + + + + Copy All + Tümünü Kopyala + + + + Shortcut creation + Kısayol oluşturma + + + + Shortcut created successfully!\n %1 + Kısayol başarıyla oluşturuldu!\n %1 + + + + Error + Hata + + + + Error creating shortcut!\n %1 + Kısayol oluşturulurken hata oluştu!\n %1 + + + + Install PKG + PKG Yükle + + + + MainWindow + + + Open/Add Elf Folder + Elf Klasörünü Aç/Ekle + + + + Install Packages (PKG) + Paketleri Kur (PKG) + + + + Boot Game + Oyunu Başlat + + + + About shadPS4 + shadPS4 Hakkında + + + + Configure... + Yapılandır... + + + + Install application from a .pkg file + .pkg dosyasından uygulama yükle + + + + Recent Games + Son Oyunlar + + + + Exit + Çıkış + + + + Exit shadPS4 + shadPS4'ten Çık + + + + Exit the application. + Uygulamadan çık. + + + + Show Game List + Oyun Listesini Göster + + + + Game List Refresh + Oyun Listesini Yenile + + + + Tiny + Küçük + + + + Small + Ufak + + + + Medium + Orta + + + + Large + Büyük + + + + List View + Liste Görünümü + + + + Grid View + Izgara Görünümü + + + + Elf Viewer + Elf Görüntüleyici + + + + Game Install Directory + Oyun Kurulum Klasörü + + + + Download Cheats/Patches + Hileler / Yamanlar İndir + + + + Dump Game List + Oyun Listesini Kaydet + + + + PKG Viewer + PKG Görüntüleyici + + + + Search... + Ara... + + + + File + Dosya + + + + View + Görünüm + + + + Game List Icons + Oyun Listesi Simgeleri + + + + Game List Mode + Oyun Listesi Modu + + + + Settings + Ayarlar + + + + Utils + Yardımcı Araçlar + + + + Themes + Temalar + + + + About + Hakkında + + + + Dark + Koyu + + + + Light + Açık + + + + Green + Yeşil + + + + Blue + Mavi + + + + Violet + Mor + + + + toolBar + Araç Çubuğu + + + + PKGViewer + + + Open Folder + Klasörü Aç + + + + TrophyViewer + + + Trophy Viewer + Kupa Görüntüleyici + + + + SettingsDialog + + + Settings + Ayarlar + + + + General + Genel + + + + System + Sistem + + + + Console Language + Konsol Dili + + + + Emulator Language + Emülatör Dili + + + + Emulator + Emülatör + + + + Enable Fullscreen + Tam Ekranı Etkinleştir + + + + Show Splash + Başlangıç Ekranını Göster + + + + Is PS4 Pro + PS4 Pro mu + + + + Username + Kullanıcı Adı + + + + Logger + Kayıt Tutucu + + + + Log Type + Kayıt Türü + + + + Log Filter + Kayıt Filtresi + + + + Graphics + Grafikler + + + + Graphics Device + Grafik Cihazı + + + + Width + Genişlik + + + + Height + Yükseklik + + + + Vblank Divider + Vblank Bölücü + + + + Advanced + Gelişmiş + + + + Enable Shaders Dumping + Shader Kaydını Etkinleştir + + + + Enable NULL GPU + NULL GPU'yu Etkinleştir + + + + Enable PM4 Dumping + PM4 Kaydını Etkinleştir + + + + Debug + Hata Ayıklama + + + + Enable Debug Dumping + Hata Ayıklama Dökümü Etkinleştir + + + + Enable Vulkan Validation Layers + Vulkan Doğrulama Katmanlarını Etkinleştir + + + + Enable Vulkan Synchronization Validation + Vulkan Senkronizasyon Doğrulamasını Etkinleştir + + + + Enable RenderDoc Debugging + RenderDoc Hata Ayıklamayı Etkinleştir + + + + MainWindow + + + * Unsupported Vulkan Version + * Desteklenmeyen Vulkan Sürümü + + + + Download Cheats For All Installed Games + Tüm Yüklenmiş Oyunlar İçin Hileleri İndir + + + + Download Patches For All Games + Tüm Oyunlar İçin Yamanları İndir + + + + Download Complete + İndirme Tamamlandı + + + + You have downloaded cheats for all the games you have installed. + Yüklediğiniz tüm oyunlar için hileleri indirdiniz. + + + + Patches Downloaded Successfully! + Yamalar Başarıyla İndirildi! + + + + All Patches available for all games have been downloaded. + Tüm oyunlar için mevcut tüm yamalar indirildi. + + + + Games: + Oyunlar: + + + + PKG File (*.PKG) + PKG Dosyası (*.PKG) + + + + ELF files (*.bin *.elf *.oelf) + ELF Dosyaları (*.bin *.elf *.oelf) + + + + Game Boot + Oyun Başlatma + + + + Only one file can be selected! + Sadece bir dosya seçilebilir! + + + + PKG Extraction + PKG Çıkartma + + + + Patch detected!\nPKG and Game versions match!: %1\nWould you like + Yama tespit edildi!\nPKG ve Oyun sürümleri uyuyor!: %1\nÜzerine yazmak ister misiniz? + + + + to overwrite? + üzerine yazmak? + + + + Patch detected!\nPKG Version %1 is older + Yama tespit edildi!\nPKG Sürümü %1 daha eski + + + + than installed version!: %2\nWould you like + yüklü sürümden!: %2\nÜzerine yazmak ister misiniz? + + + + to overwrite? + üzerine yazmak? + + + + Patch detected!\nGame is installed: %1\nWould you like + Yama tespit edildi!\nOyun yüklü: %1\nÜzerine yazmak ister misiniz? + + + + to install Patch: %2? + Yamayı kurmak ister misiniz: %2? + + + + Game already installed\n%1\nWould you like to overwrite? + Oyun zaten yüklü\n%1\nÜzerine yazmak ister misiniz? + + + + PKG is a patch, please install the game first! + PKG bir yama, lütfen önce oyunu yükleyin! + + + + PKG ERROR + PKG HATASI + + + + Extracting PKG %1/%2 + PKG Çıkarılıyor %1/%2 + + + + Extraction Finished + Çıkarma Tamamlandı + + + + Game successfully installed at %1 + Oyun başarıyla %1 konumuna yüklendi + + + + File doesn't appear to be a valid PKG file + Dosya geçerli bir PKG dosyası gibi görünmüyor + + + + CheatsPatches + + + Cheats / Patches + Hileler / Yamalar + + + + defaultTextEdit_MSG + Cheats/Patches deneysel niteliktedir.\nDikkatli kullanın.\n\nCheat'leri ayrı ayrı indirerek, depo seçerek ve indirme düğmesine tıklayarak indirin.\nPatches sekmesinde tüm patch'leri bir kerede indirebilir, hangi patch'leri kullanmak istediğinizi seçebilir ve seçiminizi kaydedebilirsiniz.\n\nCheats/Patches'i geliştirmediğimiz için,\nproblemleri cheat yazarına bildirin.\n\nYeni bir cheat mi oluşturduğunuz? Şu adresi ziyaret edin:\nhttps://github.com/shadps4-emu/ps4_cheats + + + + No Image Available + Görüntü Mevcut Değil + + + + Serial: + Seri Numarası: + + + + Version: + Sürüm: + + + + Size: + Boyut: + + + + Select Cheat File: + Hile Dosyasını Seçin: + + + + Repository: + Depo: + + + + Download Cheats + Hileleri İndir + + + + Confirm Delete + Silme Onayı + + + + Are you sure you want to delete the selected cheat?\n%1 + Seçilen hileyi silmek istediğinizden emin misiniz?\n%1 + + + + You can delete the cheats you don't want after downloading them. + İndirdikten sonra istemediğiniz hileleri silebilirsiniz. + + + + Do you want to delete the selected file?\n%1 + Seçilen dosyayı silmek istiyor musunuz?\n%1 + + + + Select Patch File: + Yama Dosyasını Seçin: + + + + Download Patches + Yamaları İndir + + + + Save + Kaydet + + + + Cheats + Hileler + + + + Patches + Yamalar + + + + Error + Hata + + + + No patch selected. + Hiç yama seçilmedi. + + + + Unable to open files.json for reading. + files.json dosyasını okumak için açılamadı. + + + + No patch file found for the current serial. + Mevcut seri numarası için hiç yama dosyası bulunamadı. + + + + Unable to open the file for reading. + Dosya okumak için açılamadı. + + + + Unable to open the file for writing. + Dosya yazmak için açılamadı. + + + + Failed to parse XML: + XML ayrıştırılamadı: + + + + Success + Başarı + + + + Options saved successfully. + Ayarlar başarıyla kaydedildi. + + + + Invalid Source + Geçersiz Kaynak + + + + The selected source is invalid. + Seçilen kaynak geçersiz. + + + + File Exists + Dosya Var + + + + File already exists. Do you want to replace it? + Dosya zaten var. Üzerine yazmak ister misiniz? + + + + Failed to save file: + Dosya kaydedilemedi: + + + + Failed to download file: + Dosya indirilemedi: + + + + Cheats Not Found + Hileler Bulunamadı + + + + CheatsNotFound_MSG + Bu oyun için seçilen depoda hile bulunamadı.Başka bir depo veya oyun sürümü deneyin. + + + + Cheats Downloaded Successfully + Hileler Başarıyla İndirildi + + + + CheatsDownloadedSuccessfully_MSG + Bu oyun sürümü için hileleri başarıyla indirdiniz. Başka bir depodan indirmeyi deneyebilirsiniz. Eğer mevcutsa, listeden dosyayı seçerek de kullanılabilir. + + + + Failed to save: + Kaydedilemedi: + + + + Failed to download: + İndirilemedi: + + + + Download Complete + İndirme Tamamlandı + + + + DownloadComplete_MSG + Yamalar başarıyla indirildi! Tüm oyunlar için mevcut tüm yamalar indirildi, her oyun için ayrı ayrı indirme yapmanız gerekmez, hilelerle olduğu gibi. + + + + Failed to parse JSON data from HTML. + HTML'den JSON verileri ayrıştırılamadı. + + + + Failed to retrieve HTML page. + HTML sayfası alınamadı. + + + + Failed to open file: + Dosya açılamadı: + + + + XML ERROR: + XML HATASI: + + + + Failed to open files.json for writing + files.json dosyası yazmak için açılamadı + + + + Author: + Yazar: + + + + Directory does not exist: + Klasör mevcut değil: + + + + Failed to open files.json for reading. + files.json dosyası okumak için açılamadı. + + + + Name: + İsim: + + + + Version: + Sürüm: + + + + Size: + Boyut: + + + + LangDialog + + + Language Settings + Dil Ayarları + + + + Select Language: + Dil Seçin: + + + + Restart Required + Yeniden Başlatma Gerekiyor + + + + Changes will take effect after restarting the application. + Değişiklikler uygulama yeniden başlatıldığında geçerli olacaktır. + + + + SettingsDialog + + + Settings + Ayarlar + + + + General + Genel + + + + Cheats + Hileler + + + + Update + Güncelleme + + + + Save + Kaydet + + + + Reset to Default + Varsayılana Sıfırla + + + + Apply Changes + Değişiklikleri Uygula + + + \ No newline at end of file diff --git a/src/qt_gui/translations/vi_VN.ts b/src/qt_gui/translations/vi_VN.ts new file mode 100644 index 000000000..977b6760c --- /dev/null +++ b/src/qt_gui/translations/vi_VN.ts @@ -0,0 +1,892 @@ + + + + AboutDialog + + + About shadPS4 + About shadPS4 + + + + shadPS4 + shadPS4 + + + + shadPS4 is an experimental open-source emulator for the PlayStation 4. + shadPS4 is an experimental open-source emulator for the PlayStation 4. + + + + This software should not be used to play games you have not legally obtained. + This software should not be used to play games you have not legally obtained. + + + + ElfViewer + + + Open Folder + Open Folder + + + + GameInfoClass + + + Loading game list, please wait :3 + Loading game list, please wait :3 + + + + Cancel + Cancel + + + + Loading... + Loading... + + + + GameInstallDialog + + + shadPS4 - Choose directory + shadPS4 - Choose directory + + + + Directory to install games + Directory to install games + + + + Browse + Browse + + + + Error + Error + + + + The value for location to install games is not valid. + The value for location to install games is not valid. + + + + GuiContextMenus + + + Create Shortcut + Create Shortcut + + + + Open Game Folder + Open Game Folder + + + + Cheats / Patches + Mẹo / Bản vá + + + + SFO Viewer + SFO Viewer + + + + Trophy Viewer + Trophy Viewer + + + + Copy info + Copy info + + + + Copy Name + Copy Name + + + + Copy Serial + Copy Serial + + + + Copy All + Copy All + + + + Shortcut creation + Shortcut creation + + + + Shortcut created successfully!\n %1 + Shortcut created successfully!\n %1 + + + + Error + Error + + + + Error creating shortcut!\n %1 + Error creating shortcut!\n %1 + + + + Install PKG + Install PKG + + + + MainWindow + + + Open/Add Elf Folder + Open/Add Elf Folder + + + + Install Packages (PKG) + Install Packages (PKG) + + + + Boot Game + Boot Game + + + + About shadPS4 + About shadPS4 + + + + Configure... + Configure... + + + + Install application from a .pkg file + Install application from a .pkg file + + + + Recent Games + Recent Games + + + + Exit + Exit + + + + Exit shadPS4 + Exit shadPS4 + + + + Exit the application. + Exit the application. + + + + Show Game List + Show Game List + + + + Game List Refresh + Game List Refresh + + + + Tiny + Tiny + + + + Small + Small + + + + Medium + Medium + + + + Large + Large + + + + List View + List View + + + + Grid View + Grid View + + + + Elf Viewer + Elf Viewer + + + + Game Install Directory + Game Install Directory + + + + Download Cheats/Patches + Tải Mẹo / Bản vá + + + + Dump Game List + Dump Game List + + + + PKG Viewer + PKG Viewer + + + + Search... + Search... + + + + File + File + + + + View + View + + + + Game List Icons + Game List Icons + + + + Game List Mode + Game List Mode + + + + Settings + Settings + + + + Utils + Utils + + + + Themes + Themes + + + + About + About + + + + Dark + Dark + + + + Light + Light + + + + Green + Green + + + + Blue + Blue + + + + Violet + Violet + + + + toolBar + toolBar + + + + PKGViewer + + + Open Folder + Open Folder + + + + TrophyViewer + + + Trophy Viewer + Trophy Viewer + + + + SettingsDialog + + + Settings + Settings + + + + General + General + + + + System + System + + + + Console Language + Console Language + + + + Emulator Language + Emulator Language + + + + Emulator + Emulator + + + + Enable Fullscreen + Enable Fullscreen + + + + Show Splash + Show Splash + + + + Is PS4 Pro + Is PS4 Pro + + + + Username + Username + + + + Logger + Logger + + + + Log Type + Log Type + + + + Log Filter + Log Filter + + + + Graphics + Graphics + + + + Graphics Device + Graphics Device + + + + Width + Width + + + + Height + Height + + + + Vblank Divider + Vblank Divider + + + + Advanced + Advanced + + + + Enable Shaders Dumping + Enable Shaders Dumping + + + + Enable NULL GPU + Enable NULL GPU + + + + Enable PM4 Dumping + Enable PM4 Dumping + + + + Debug + Debug + + + + Enable Debug Dumping + Enable Debug Dumping + + + + Enable Vulkan Validation Layers + Enable Vulkan Validation Layers + + + + Enable Vulkan Synchronization Validation + Enable Vulkan Synchronization Validation + + + + Enable RenderDoc Debugging + Enable RenderDoc Debugging + + + + MainWindow + + + * Unsupported Vulkan Version + * Phiên bản Vulkan không được hỗ trợ + + + + Download Cheats For All Installed Games + Tải xuống cheat cho tất cả các trò chơi đã cài đặt + + + + Download Patches For All Games + Tải xuống bản vá cho tất cả các trò chơi + + + + Download Complete + Tải xuống hoàn tất + + + + You have downloaded cheats for all the games you have installed. + Bạn đã tải xuống cheat cho tất cả các trò chơi mà bạn đã cài đặt. + + + + Patches Downloaded Successfully! + Bản vá đã tải xuống thành công! + + + + All Patches available for all games have been downloaded. + Tất cả các bản vá có sẵn cho tất cả các trò chơi đã được tải xuống. + + + + Games: + Trò chơi: + + + + PKG File (*.PKG) + Tệp PKG (*.PKG) + + + + ELF files (*.bin *.elf *.oelf) + Tệp ELF (*.bin *.elf *.oelf) + + + + Game Boot + Khởi động trò chơi + + + + Only one file can be selected! + Chỉ có thể chọn một tệp duy nhất! + + + + PKG Extraction + Giải nén PKG + + + + Patch detected!\nPKG and Game versions match!: %1\nWould you like + Đã phát hiện bản vá!\nPhiên bản PKG và trò chơi khớp!: %1\nBạn có muốn + + + + to overwrite? + ghi đè không? + + + + Patch detected!\nPKG Version %1 is older + Đã phát hiện bản vá!\nPhiên bản PKG %1 cũ hơn + + + + than installed version!: %2\nWould you like + so với phiên bản đã cài đặt!: %2\nBạn có muốn + + + + to overwrite? + ghi đè không? + + + + Patch detected!\nGame is installed: %1\nWould you like + Đã phát hiện bản vá!\nTrò chơi đã được cài đặt: %1\nBạn có muốn + + + + to install Patch: %2? + cài đặt bản vá: %2? + + + + Game already installed\n%1\nWould you like to overwrite? + Trò chơi đã được cài đặt\n%1\nBạn có muốn ghi đè không? + + + + PKG is a patch, please install the game first! + PKG là bản vá, vui lòng cài đặt trò chơi trước! + + + + PKG ERROR + LOI PKG + + + + Extracting PKG %1/%2 + Đang giải nén PKG %1/%2 + + + + Extraction Finished + Giải nén hoàn tất + + + + Game successfully installed at %1 + Trò chơi đã được cài đặt thành công tại %1 + + + + File doesn't appear to be a valid PKG file + Tệp không có vẻ là tệp PKG hợp lệ + + + + CheatsPatches + + + Cheats / Patches + Cheat / Bản vá + + + + defaultTextEdit_MSG + Cheats/Patches là các tính năng thử nghiệm.\nHãy sử dụng cẩn thận.\n\nTải xuống các cheat riêng lẻ bằng cách chọn kho lưu trữ và nhấp vào nút tải xuống.\nTại tab Patches, bạn có thể tải xuống tất cả các patch cùng một lúc, chọn cái nào bạn muốn sử dụng và lưu lựa chọn của mình.\n\nVì chúng tôi không phát triển Cheats/Patches,\nxin vui lòng báo cáo các vấn đề cho tác giả cheat.\n\nBạn đã tạo ra một cheat mới? Truy cập:\nhttps://github.com/shadps4-emu/ps4_cheats + + + + No Image Available + Không có hình ảnh + + + + Serial: + Số seri: + + + + Version: + Phiên bản: + + + + Size: + Kích thước: + + + + Select Cheat File: + Chọn tệp Cheat: + + + + Repository: + Kho lưu trữ: + + + + Download Cheats + Tải xuống Cheat + + + + Delete File + Xóa tệp + + + + No files selected. + Không có tệp nào được chọn. + + + + You can delete the cheats you don't want after downloading them. + Bạn có thể xóa các cheat không muốn sau khi tải xuống. + + + + Do you want to delete the selected file?\n%1 + Bạn có muốn xóa tệp đã chọn?\n%1 + + + + Select Patch File: + Chọn tệp Bản vá: + + + + Download Patches + Tải xuống Bản vá + + + + Save + Lưu + + + + Cheats + Cheat + + + + Patches + Bản vá + + + + Error + Lỗi + + + + No patch selected. + Không có bản vá nào được chọn. + + + + Unable to open files.json for reading. + Không thể mở files.json để đọc. + + + + No patch file found for the current serial. + Không tìm thấy tệp bản vá cho số seri hiện tại. + + + + Unable to open the file for reading. + Không thể mở tệp để đọc. + + + + Unable to open the file for writing. + Không thể mở tệp để ghi. + + + + Failed to parse XML: + Không thể phân tích XML: + + + + Success + Thành công + + + + Options saved successfully. + Các tùy chọn đã được lưu thành công. + + + + Invalid Source + Nguồn không hợp lệ + + + + The selected source is invalid. + Nguồn đã chọn không hợp lệ. + + + + File Exists + Tệp đã tồn tại + + + + File already exists. Do you want to replace it? + Tệp đã tồn tại. Bạn có muốn thay thế nó không? + + + + Failed to save file: + Không thể lưu tệp: + + + + Failed to download file: + Không thể tải xuống tệp: + + + + Cheats Not Found + Không tìm thấy Cheat + + + + CheatsNotFound_MSG + Không tìm thấy Cheat cho trò chơi này trong phiên bản kho lưu trữ đã chọn,hãy thử kho lưu trữ khác hoặc phiên bản khác của trò chơi. + + + + Cheats Downloaded Successfully + Cheat đã tải xuống thành công + + + + CheatsDownloadedSuccessfully_MSG + Bạn đã tải xuống các cheat thành công. Cho phiên bản trò chơi này từ kho lưu trữ đã chọn. Bạn có thể thử tải xuống từ kho lưu trữ khác, nếu có, bạn cũng có thể sử dụng bằng cách chọn tệp từ danh sách. + + + + Failed to save: + Không thể lưu: + + + + Failed to download: + Không thể tải xuống: + + + + Download Complete + Tải xuống hoàn tất + + + + DownloadComplete_MSG + Bản vá đã tải xuống thành công! Tất cả các bản vá có sẵn cho tất cả các trò chơi đã được tải xuống, không cần tải xuống riêng lẻ cho mỗi trò chơi như trong Cheat. + + + + Failed to parse JSON data from HTML. + Không thể phân tích dữ liệu JSON từ HTML. + + + + Failed to retrieve HTML page. + Không thể lấy trang HTML. + + + + Failed to open file: + Không thể mở tệp: + + + + XML ERROR: + LỖI XML: + + + + Failed to open files.json for writing + Không thể mở files.json để ghi + + + + Author: + Tác giả: + + + + Directory does not exist: + Thư mục không tồn tại: + + + + Failed to open files.json for reading. + Không thể mở files.json để đọc. + + + + Name: + Tên: + + + \ No newline at end of file diff --git a/src/qt_gui/translations/zh_CN.ts b/src/qt_gui/translations/zh_CN.ts new file mode 100644 index 000000000..d5ace320d --- /dev/null +++ b/src/qt_gui/translations/zh_CN.ts @@ -0,0 +1,892 @@ + + + + AboutDialog + + + About shadPS4 + About shadPS4 + + + + shadPS4 + shadPS4 + + + + shadPS4 is an experimental open-source emulator for the PlayStation 4. + shadPS4 is an experimental open-source emulator for the PlayStation 4. + + + + This software should not be used to play games you have not legally obtained. + This software should not be used to play games you have not legally obtained. + + + + ElfViewer + + + Open Folder + Open Folder + + + + GameInfoClass + + + Loading game list, please wait :3 + Loading game list, please wait :3 + + + + Cancel + Cancel + + + + Loading... + Loading... + + + + GameInstallDialog + + + shadPS4 - Choose directory + shadPS4 - Choose directory + + + + Directory to install games + Directory to install games + + + + Browse + Browse + + + + Error + Error + + + + The value for location to install games is not valid. + The value for location to install games is not valid. + + + + GuiContextMenus + + + Create Shortcut + Create Shortcut + + + + Open Game Folder + Open Game Folder + + + + Cheats / Patches + Zuòbì / Bǔdīng + + + + SFO Viewer + SFO Viewer + + + + Trophy Viewer + Trophy Viewer + + + + Copy info + Copy info + + + + Copy Name + Copy Name + + + + Copy Serial + Copy Serial + + + + Copy All + Copy All + + + + Shortcut creation + Shortcut creation + + + + Shortcut created successfully!\n %1 + Shortcut created successfully!\n %1 + + + + Error + Error + + + + Error creating shortcut!\n %1 + Error creating shortcut!\n %1 + + + + Install PKG + Install PKG + + + + MainWindow + + + Open/Add Elf Folder + Open/Add Elf Folder + + + + Install Packages (PKG) + Install Packages (PKG) + + + + Boot Game + Boot Game + + + + About shadPS4 + About shadPS4 + + + + Configure... + Configure... + + + + Install application from a .pkg file + Install application from a .pkg file + + + + Recent Games + Recent Games + + + + Exit + Exit + + + + Exit shadPS4 + Exit shadPS4 + + + + Exit the application. + Exit the application. + + + + Show Game List + Show Game List + + + + Game List Refresh + Game List Refresh + + + + Tiny + Tiny + + + + Small + Small + + + + Medium + Medium + + + + Large + Large + + + + List View + List View + + + + Grid View + Grid View + + + + Elf Viewer + Elf Viewer + + + + Game Install Directory + Game Install Directory + + + + Download Cheats/Patches + Xiàzài Zuòbì / Bǔdīng + + + + Dump Game List + Dump Game List + + + + PKG Viewer + PKG Viewer + + + + Search... + Search... + + + + File + File + + + + View + View + + + + Game List Icons + Game List Icons + + + + Game List Mode + Game List Mode + + + + Settings + Settings + + + + Utils + Utils + + + + Themes + Themes + + + + About + About + + + + Dark + Dark + + + + Light + Light + + + + Green + Green + + + + Blue + Blue + + + + Violet + Violet + + + + toolBar + toolBar + + + + PKGViewer + + + Open Folder + Open Folder + + + + TrophyViewer + + + Trophy Viewer + Trophy Viewer + + + + SettingsDialog + + + Settings + Settings + + + + General + General + + + + System + System + + + + Console Language + Console Language + + + + Emulator Language + Emulator Language + + + + Emulator + Emulator + + + + Enable Fullscreen + Enable Fullscreen + + + + Show Splash + Show Splash + + + + Is PS4 Pro + Is PS4 Pro + + + + Username + Username + + + + Logger + Logger + + + + Log Type + Log Type + + + + Log Filter + Log Filter + + + + Graphics + Graphics + + + + Graphics Device + Graphics Device + + + + Width + Width + + + + Height + Height + + + + Vblank Divider + Vblank Divider + + + + Advanced + Advanced + + + + Enable Shaders Dumping + Enable Shaders Dumping + + + + Enable NULL GPU + Enable NULL GPU + + + + Enable PM4 Dumping + Enable PM4 Dumping + + + + Debug + Debug + + + + Enable Debug Dumping + Enable Debug Dumping + + + + Enable Vulkan Validation Layers + Enable Vulkan Validation Layers + + + + Enable Vulkan Synchronization Validation + Enable Vulkan Synchronization Validation + + + + Enable RenderDoc Debugging + Enable RenderDoc Debugging + + + + MainWindow + + + * Unsupported Vulkan Version + * 不支持的 Vulkan 版本 + + + + Download Cheats For All Installed Games + 下载所有已安装游戏的作弊码 + + + + Download Patches For All Games + 下载所有游戏的补丁 + + + + Download Complete + 下载完成 + + + + You have downloaded cheats for all the games you have installed. + 您已下载了所有已安装游戏的作弊码。 + + + + Patches Downloaded Successfully! + 补丁下载成功! + + + + All Patches available for all games have been downloaded. + 所有游戏的所有补丁都已下载。 + + + + Games: + 游戏: + + + + PKG File (*.PKG) + PKG 文件 (*.PKG) + + + + ELF files (*.bin *.elf *.oelf) + ELF 文件 (*.bin *.elf *.oelf) + + + + Game Boot + 游戏启动 + + + + Only one file can be selected! + 只能选择一个文件! + + + + PKG Extraction + PKG 解压 + + + + Patch detected!\nPKG and Game versions match!: %1\nWould you like + 检测到补丁!\nPKG 和游戏版本匹配:%1\n您想要 + + + + to overwrite? + 覆盖吗? + + + + Patch detected!\nPKG Version %1 is older + 检测到补丁!\nPKG 版本 %1 较旧 + + + + than installed version!: %2\nWould you like + 与已安装版本相比:%2\n您想要 + + + + to overwrite? + 覆盖吗? + + + + Patch detected!\nGame is installed: %1\nWould you like + 检测到补丁!\n游戏已安装:%1\n您想要 + + + + to install Patch: %2? + 安装补丁:%2? + + + + Game already installed\n%1\nWould you like to overwrite? + 游戏已安装\n%1\n您想要覆盖吗? + + + + PKG is a patch, please install the game first! + PKG 是一个补丁,请先安装游戏! + + + + PKG ERROR + PKG 错误 + + + + Extracting PKG %1/%2 + 正在解压 PKG %1/%2 + + + + Extraction Finished + 解压完成 + + + + Game successfully installed at %1 + 游戏成功安装在 %1 + + + + File doesn't appear to be a valid PKG file + 文件似乎不是有效的 PKG 文件 + + + + CheatsPatches + + + Cheats / Patches + 作弊码 / 补丁 + + + + defaultTextEdit_MSG + 作弊/补丁是实验性的。\n请小心使用。\n\n通过选择存储库并点击下载按钮,单独下载作弊程序。\n在“补丁”选项卡中,您可以一次性下载所有补丁,选择要使用的补丁并保存选择。\n\n由于我们不开发作弊程序/补丁,\n请将问题报告给作弊程序的作者。\n\n创建了新的作弊程序?访问:\nhttps://github.com/shadps4-emu/ps4_cheats + + + + No Image Available + 没有可用的图像 + + + + Serial: + 序列号: + + + + Version: + 版本: + + + + Size: + 大小: + + + + Select Cheat File: + 选择作弊码文件: + + + + Repository: + 存储库: + + + + Download Cheats + 下载作弊码 + + + + Delete File + 删除文件 + + + + No files selected. + 没有选择文件。 + + + + You can delete the cheats you don't want after downloading them. + 您可以在下载后删除不想要的作弊码。 + + + + Do you want to delete the selected file?\n%1 + 您要删除选中的文件吗?\n%1 + + + + Select Patch File: + 选择补丁文件: + + + + Download Patches + 下载补丁 + + + + Save + 保存 + + + + Cheats + 作弊码 + + + + Patches + 补丁 + + + + Error + 错误 + + + + No patch selected. + 没有选择补丁。 + + + + Unable to open files.json for reading. + 无法打开 files.json 进行读取。 + + + + No patch file found for the current serial. + 未找到当前序列号的补丁文件。 + + + + Unable to open the file for reading. + 无法打开文件进行读取。 + + + + Unable to open the file for writing. + 无法打开文件进行写入。 + + + + Failed to parse XML: + 解析 XML 失败: + + + + Success + 成功 + + + + Options saved successfully. + 选项已成功保存。 + + + + Invalid Source + 无效的来源 + + + + The selected source is invalid. + 选择的来源无效。 + + + + File Exists + 文件已存在 + + + + File already exists. Do you want to replace it? + 文件已存在。您要替换它吗? + + + + Failed to save file: + 保存文件失败: + + + + Failed to download file: + 下载文件失败: + + + + Cheats Not Found + 未找到作弊码 + + + + CheatsNotFound_MSG + 在所选存储库的版本中找不到该游戏的作弊码,请尝试其他存储库或游戏版本。 + + + + Cheats Downloaded Successfully + 作弊码下载成功 + + + + CheatsDownloadedSuccessfully_MSG + 您已成功下载了该游戏版本的作弊码 从所选存储库中。如果有,您还可以尝试从其他存储库下载,或通过从列表中选择文件来使用它们。 + + + + Failed to save: + 保存失败: + + + + Failed to download: + 下载失败: + + + + Download Complete + 下载完成 + + + + DownloadComplete_MSG + 补丁下载成功!所有可用的补丁已下载完成,无需像作弊码那样单独下载每个游戏的补丁。 + + + + Failed to parse JSON data from HTML. + 无法解析 HTML 中的 JSON 数据。 + + + + Failed to retrieve HTML page. + 无法获取 HTML 页面。 + + + + Failed to open file: + 无法打开文件: + + + + XML ERROR: + XML 错误: + + + + Failed to open files.json for writing + 无法打开 files.json 进行写入 + + + + Author: + 作者: + + + + Directory does not exist: + 目录不存在: + + + + Failed to open files.json for reading. + 无法打开 files.json 进行读取。 + + + + Name: + 名称: + + + \ No newline at end of file diff --git a/src/qt_gui/translations/zh_TW.ts b/src/qt_gui/translations/zh_TW.ts new file mode 100644 index 000000000..4a9da9f37 --- /dev/null +++ b/src/qt_gui/translations/zh_TW.ts @@ -0,0 +1,892 @@ + + + + AboutDialog + + + About shadPS4 + About shadPS4 + + + + shadPS4 + shadPS4 + + + + shadPS4 is an experimental open-source emulator for the PlayStation 4. + shadPS4 is an experimental open-source emulator for the PlayStation 4. + + + + This software should not be used to play games you have not legally obtained. + This software should not be used to play games you have not legally obtained. + + + + ElfViewer + + + Open Folder + Open Folder + + + + GameInfoClass + + + Loading game list, please wait :3 + Loading game list, please wait :3 + + + + Cancel + Cancel + + + + Loading... + Loading... + + + + GameInstallDialog + + + shadPS4 - Choose directory + shadPS4 - Choose directory + + + + Directory to install games + Directory to install games + + + + Browse + Browse + + + + Error + Error + + + + The value for location to install games is not valid. + The value for location to install games is not valid. + + + + GuiContextMenus + + + Create Shortcut + Create Shortcut + + + + Open Game Folder + Open Game Folder + + + + Cheats / Patches + Zuòbì / Xiūbǔ chéngshì + + + + SFO Viewer + SFO Viewer + + + + Trophy Viewer + Trophy Viewer + + + + Copy info + Copy info + + + + Copy Name + Copy Name + + + + Copy Serial + Copy Serial + + + + Copy All + Copy All + + + + Shortcut creation + Shortcut creation + + + + Shortcut created successfully!\n %1 + Shortcut created successfully!\n %1 + + + + Error + Error + + + + Error creating shortcut!\n %1 + Error creating shortcut!\n %1 + + + + Install PKG + Install PKG + + + + MainWindow + + + Open/Add Elf Folder + Open/Add Elf Folder + + + + Install Packages (PKG) + Install Packages (PKG) + + + + Boot Game + Boot Game + + + + About shadPS4 + About shadPS4 + + + + Configure... + Configure... + + + + Install application from a .pkg file + Install application from a .pkg file + + + + Recent Games + Recent Games + + + + Exit + Exit + + + + Exit shadPS4 + Exit shadPS4 + + + + Exit the application. + Exit the application. + + + + Show Game List + Show Game List + + + + Game List Refresh + Game List Refresh + + + + Tiny + Tiny + + + + Small + Small + + + + Medium + Medium + + + + Large + Large + + + + List View + List View + + + + Grid View + Grid View + + + + Elf Viewer + Elf Viewer + + + + Game Install Directory + Game Install Directory + + + + Download Cheats/Patches + Xiàzài Zuòbì / Xiūbǔ chéngshì + + + + Dump Game List + Dump Game List + + + + PKG Viewer + PKG Viewer + + + + Search... + Search... + + + + File + File + + + + View + View + + + + Game List Icons + Game List Icons + + + + Game List Mode + Game List Mode + + + + Settings + Settings + + + + Utils + Utils + + + + Themes + Themes + + + + About + About + + + + Dark + Dark + + + + Light + Light + + + + Green + Green + + + + Blue + Blue + + + + Violet + Violet + + + + toolBar + toolBar + + + + PKGViewer + + + Open Folder + Open Folder + + + + TrophyViewer + + + Trophy Viewer + Trophy Viewer + + + + SettingsDialog + + + Settings + Settings + + + + General + General + + + + System + System + + + + Console Language + Console Language + + + + Emulator Language + Emulator Language + + + + Emulator + Emulator + + + + Enable Fullscreen + Enable Fullscreen + + + + Show Splash + Show Splash + + + + Is PS4 Pro + Is PS4 Pro + + + + Username + Username + + + + Logger + Logger + + + + Log Type + Log Type + + + + Log Filter + Log Filter + + + + Graphics + Graphics + + + + Graphics Device + Graphics Device + + + + Width + Width + + + + Height + Height + + + + Vblank Divider + Vblank Divider + + + + Advanced + Advanced + + + + Enable Shaders Dumping + Enable Shaders Dumping + + + + Enable NULL GPU + Enable NULL GPU + + + + Enable PM4 Dumping + Enable PM4 Dumping + + + + Debug + Debug + + + + Enable Debug Dumping + Enable Debug Dumping + + + + Enable Vulkan Validation Layers + Enable Vulkan Validation Layers + + + + Enable Vulkan Synchronization Validation + Enable Vulkan Synchronization Validation + + + + Enable RenderDoc Debugging + Enable RenderDoc Debugging + + + + MainWindow + + + * Unsupported Vulkan Version + * 不支援的 Vulkan 版本 + + + + Download Cheats For All Installed Games + 下載所有已安裝遊戲的作弊碼 + + + + Download Patches For All Games + 下載所有遊戲的修補檔 + + + + Download Complete + 下載完成 + + + + You have downloaded cheats for all the games you have installed. + 您已經下載了所有已安裝遊戲的作弊碼。 + + + + Patches Downloaded Successfully! + 修補檔下載成功! + + + + All Patches available for all games have been downloaded. + 所有遊戲的修補檔已經下載完成。 + + + + Games: + 遊戲: + + + + PKG File (*.PKG) + PKG 檔案 (*.PKG) + + + + ELF files (*.bin *.elf *.oelf) + ELF 檔案 (*.bin *.elf *.oelf) + + + + Game Boot + 遊戲啟動 + + + + Only one file can be selected! + 只能選擇一個檔案! + + + + PKG Extraction + PKG 解壓縮 + + + + Patch detected!\nPKG and Game versions match!: %1\nWould you like + 偵測到修補檔!\nPKG 和遊戲版本匹配!: %1\n您是否希望 + + + + to overwrite? + 覆蓋嗎? + + + + Patch detected!\nPKG Version %1 is older + 偵測到修補檔!\nPKG 版本 %1 較舊 + + + + than installed version!: %2\nWould you like + 比安裝的版本舊!: %2\n您是否希望 + + + + to overwrite? + 覆蓋嗎? + + + + Patch detected!\nGame is installed: %1\nWould you like + 偵測到修補檔!\n遊戲已安裝: %1\n您是否希望 + + + + to install Patch: %2? + 安裝修補檔: %2? + + + + Game already installed\n%1\nWould you like to overwrite? + 遊戲已經安裝\n%1\n您是否希望覆蓋? + + + + PKG is a patch, please install the game first! + PKG 是修補檔,請先安裝遊戲! + + + + PKG ERROR + PKG 錯誤 + + + + Extracting PKG %1/%2 + 正在解壓縮 PKG %1/%2 + + + + Extraction Finished + 解壓縮完成 + + + + Game successfully installed at %1 + 遊戲成功安裝於 %1 + + + + File doesn't appear to be a valid PKG file + 檔案似乎不是有效的 PKG 檔案 + + + + CheatsPatches + + + Cheats / Patches + 作弊碼 / 修補檔 + + + + defaultTextEdit_MSG + 作弊/補丁為實驗性功能。\n請小心使用。\n\n透過選擇儲存庫並點擊下載按鈕來單獨下載作弊程式。\n在“補丁”標籤頁中,您可以一次下載所有補丁,選擇要使用的補丁並保存您的選擇。\n\n由於我們不開發作弊/補丁,\n請將問題報告給作弊程式的作者。\n\n創建了新的作弊程式?請訪問:\nhttps://github.com/shadps4-emu/ps4_cheats + + + + No Image Available + 沒有可用的圖片 + + + + Serial: + 序號: + + + + Version: + 版本: + + + + Size: + 大小: + + + + Select Cheat File: + 選擇作弊檔案: + + + + Repository: + 儲存庫: + + + + Download Cheats + 下載作弊碼 + + + + Delete File + 刪除檔案 + + + + No files selected. + 沒有選擇檔案。 + + + + You can delete the cheats you don't want after downloading them. + 您可以在下載後刪除不需要的作弊碼。 + + + + Do you want to delete the selected file?\n%1 + 您是否要刪除選定的檔案?\n%1 + + + + Select Patch File: + 選擇修補檔案: + + + + Download Patches + 下載修補檔 + + + + Save + 儲存 + + + + Cheats + 作弊碼 + + + + Patches + 修補檔 + + + + Error + 錯誤 + + + + No patch selected. + 未選擇修補檔。 + + + + Unable to open files.json for reading. + 無法打開 files.json 進行讀取。 + + + + No patch file found for the current serial. + 找不到當前序號的修補檔。 + + + + Unable to open the file for reading. + 無法打開檔案進行讀取。 + + + + Unable to open the file for writing. + 無法打開檔案進行寫入。 + + + + Failed to parse XML: + 解析 XML 失敗: + + + + Success + 成功 + + + + Options saved successfully. + 選項已成功儲存。 + + + + Invalid Source + 無效的來源 + + + + The selected source is invalid. + 選擇的來源無效。 + + + + File Exists + 檔案已存在 + + + + File already exists. Do you want to replace it? + 檔案已存在。您是否希望替換它? + + + + Failed to save file: + 無法儲存檔案: + + + + Failed to download file: + 無法下載檔案: + + + + Cheats Not Found + 未找到作弊碼 + + + + CheatsNotFound_MSG + 在此版本的儲存庫中未找到該遊戲的作弊碼,請嘗試另一個儲存庫或不同版本的遊戲。 + + + + Cheats Downloaded Successfully + 作弊碼下載成功 + + + + CheatsDownloadedSuccessfully_MSG + 您已成功下載該遊戲版本的作弊碼 從選定的儲存庫中。 您可以嘗試從其他儲存庫下載,如果可用,您也可以選擇從列表中選擇檔案來使用它。 + + + + Failed to save: + 儲存失敗: + + + + Failed to download: + 下載失敗: + + + + Download Complete + 下載完成 + + + + DownloadComplete_MSG + 修補檔下載成功!所有遊戲的修補檔已下載完成,無需像作弊碼那樣為每個遊戲單獨下載。 + + + + Failed to parse JSON data from HTML. + 無法從 HTML 解析 JSON 數據。 + + + + Failed to retrieve HTML page. + 無法檢索 HTML 頁面。 + + + + Failed to open file: + 無法打開檔案: + + + + XML ERROR: + XML 錯誤: + + + + Failed to open files.json for writing + 無法打開 files.json 進行寫入 + + + + Author: + 作者: + + + + Directory does not exist: + 目錄不存在: + + + + Failed to open files.json for reading. + 無法打開 files.json 進行讀取。 + + + + Name: + 名稱: + + + \ No newline at end of file diff --git a/src/qt_gui/trophy_viewer.cpp b/src/qt_gui/trophy_viewer.cpp index bb17dfc3a..57dce6b4e 100644 --- a/src/qt_gui/trophy_viewer.cpp +++ b/src/qt_gui/trophy_viewer.cpp @@ -5,7 +5,7 @@ #include "trophy_viewer.h" TrophyViewer::TrophyViewer(QString trophyPath, QString gameTrpPath) : QMainWindow() { - this->setWindowTitle("Trophy Viewer"); + this->setWindowTitle(tr("Trophy Viewer")); this->setAttribute(Qt::WA_DeleteOnClose); tabWidget = new QTabWidget(this); gameTrpPath_ = gameTrpPath; diff --git a/src/sdl_window.cpp b/src/sdl_window.cpp index eec31c901..b83afd299 100644 --- a/src/sdl_window.cpp +++ b/src/sdl_window.cpp @@ -98,6 +98,11 @@ void WindowSDL::waitEvent() { case SDL_EVENT_GAMEPAD_BUTTON_DOWN: case SDL_EVENT_GAMEPAD_BUTTON_UP: case SDL_EVENT_GAMEPAD_AXIS_MOTION: + case SDL_EVENT_GAMEPAD_ADDED: + case SDL_EVENT_GAMEPAD_REMOVED: + case SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN: + case SDL_EVENT_GAMEPAD_TOUCHPAD_UP: + case SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION: onGamepadEvent(&event); break; case SDL_EVENT_QUIT: @@ -273,6 +278,15 @@ void WindowSDL::onKeyPress(const SDL_Event* event) { case SDLK_SPACE: button = OrbisPadButtonDataOffset::ORBIS_PAD_BUTTON_TOUCH_PAD; break; + case SDLK_F11: + if (event->type == SDL_EVENT_KEY_DOWN) { + { + SDL_WindowFlags flag = SDL_GetWindowFlags(window); + bool is_fullscreen = flag & SDL_WINDOW_FULLSCREEN; + SDL_SetWindowFullscreen(window, !is_fullscreen); + } + } + break; default: break; } @@ -290,6 +304,17 @@ void WindowSDL::onGamepadEvent(const SDL_Event* event) { u32 button = 0; Input::Axis axis = Input::Axis::AxisMax; switch (event->type) { + case SDL_EVENT_GAMEPAD_ADDED: + case SDL_EVENT_GAMEPAD_REMOVED: + controller->TryOpenSDLController(); + break; + case SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN: + case SDL_EVENT_GAMEPAD_TOUCHPAD_UP: + case SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION: + controller->SetTouchpadState(event->gtouchpad.finger, + event->type != SDL_EVENT_GAMEPAD_TOUCHPAD_UP, + event->gtouchpad.x, event->gtouchpad.y); + break; case SDL_EVENT_GAMEPAD_BUTTON_DOWN: case SDL_EVENT_GAMEPAD_BUTTON_UP: button = sdlGamepadToOrbisButton(event->gbutton.button); diff --git a/src/shader_recompiler/backend/spirv/emit_spirv.cpp b/src/shader_recompiler/backend/spirv/emit_spirv.cpp index c70427635..09a9fd629 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv.cpp @@ -179,6 +179,7 @@ void DefineEntryPoint(const IR::Program& program, EmitContext& ctx, Id main) { spv::ExecutionModel execution_model{}; ctx.AddCapability(spv::Capability::Image1D); ctx.AddCapability(spv::Capability::Sampled1D); + ctx.AddCapability(spv::Capability::ImageQuery); if (info.uses_fp16) { ctx.AddCapability(spv::Capability::Float16); ctx.AddCapability(spv::Capability::Int16); diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_atomic.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_atomic.cpp index 37e91d3b1..1d553dc56 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_atomic.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_atomic.cpp @@ -102,7 +102,7 @@ Id EmitBufferAtomicXor32(EmitContext& ctx, IR::Inst* inst, u32 handle, Id addres return BufferAtomicU32(ctx, inst, handle, address, value, &Sirit::Module::OpAtomicXor); } -Id EmitBufferAtomicExchange32(EmitContext& ctx, IR::Inst* inst, u32 handle, Id address, Id value) { +Id EmitBufferAtomicSwap32(EmitContext& ctx, IR::Inst* inst, u32 handle, Id address, Id value) { return BufferAtomicU32(ctx, inst, handle, address, value, &Sirit::Module::OpAtomicExchange); } 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 0b02f3a37..03fc52ff4 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 @@ -305,7 +305,7 @@ static Id ConvertValue(EmitContext& ctx, Id value, AmdGpu::NumberFormat format, case AmdGpu::NumberFormat::Float: return value; default: - UNREACHABLE_MSG("Unsupported number fromat for conversion: {}", + UNREACHABLE_MSG("Unsupported number format for conversion: {}", magic_enum::enum_name(format)); } } @@ -478,7 +478,7 @@ static Id ConvertF32ToFormat(EmitContext& ctx, Id value, AmdGpu::NumberFormat fo case AmdGpu::NumberFormat::Float: return value; default: - UNREACHABLE_MSG("Unsupported number fromat for conversion: {}", + UNREACHABLE_MSG("Unsupported number format for conversion: {}", magic_enum::enum_name(format)); } } diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_instructions.h b/src/shader_recompiler/backend/spirv/emit_spirv_instructions.h index 0703efb96..ce4d3f137 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_instructions.h +++ b/src/shader_recompiler/backend/spirv/emit_spirv_instructions.h @@ -91,7 +91,7 @@ Id EmitBufferAtomicDec32(EmitContext& ctx, IR::Inst* inst, u32 handle, Id addres Id EmitBufferAtomicAnd32(EmitContext& ctx, IR::Inst* inst, u32 handle, Id address, Id value); Id EmitBufferAtomicOr32(EmitContext& ctx, IR::Inst* inst, u32 handle, Id address, Id value); Id EmitBufferAtomicXor32(EmitContext& ctx, IR::Inst* inst, u32 handle, Id address, Id value); -Id EmitBufferAtomicExchange32(EmitContext& ctx, IR::Inst* inst, u32 handle, Id address, Id value); +Id EmitBufferAtomicSwap32(EmitContext& ctx, IR::Inst* inst, u32 handle, Id address, Id value); Id EmitGetAttribute(EmitContext& ctx, IR::Attribute attr, u32 comp); Id EmitGetAttributeU32(EmitContext& ctx, IR::Attribute attr, u32 comp); void EmitSetAttribute(EmitContext& ctx, IR::Attribute attr, Id value, u32 comp); @@ -286,6 +286,7 @@ Id EmitShiftRightLogical64(EmitContext& ctx, Id base, Id shift); Id EmitShiftRightArithmetic32(EmitContext& ctx, Id base, Id shift); Id EmitShiftRightArithmetic64(EmitContext& ctx, Id base, Id shift); Id EmitBitwiseAnd32(EmitContext& ctx, IR::Inst* inst, Id a, Id b); +Id EmitBitwiseAnd64(EmitContext& ctx, IR::Inst* inst, Id a, Id b); Id EmitBitwiseOr32(EmitContext& ctx, IR::Inst* inst, Id a, Id b); Id EmitBitwiseOr64(EmitContext& ctx, IR::Inst* inst, Id a, Id b); Id EmitBitwiseXor32(EmitContext& ctx, IR::Inst* inst, Id a, Id b); diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_integer.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_integer.cpp index f20c4fac2..a9becb1eb 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_integer.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_integer.cpp @@ -139,6 +139,13 @@ Id EmitBitwiseAnd32(EmitContext& ctx, IR::Inst* inst, Id a, Id b) { return result; } +Id EmitBitwiseAnd64(EmitContext& ctx, IR::Inst* inst, Id a, Id b) { + const Id result{ctx.OpBitwiseAnd(ctx.U64, a, b)}; + SetZeroFlag(ctx, inst, result); + SetSignFlag(ctx, inst, result); + return result; +} + Id EmitBitwiseOr32(EmitContext& ctx, IR::Inst* inst, Id a, Id b) { const Id result{ctx.OpBitwiseOr(ctx.U32[1], a, b)}; SetZeroFlag(ctx, inst, result); diff --git a/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp b/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp index e48b89f4b..994c2847e 100644 --- a/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp +++ b/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp @@ -405,6 +405,10 @@ spv::ImageFormat GetFormat(const AmdGpu::Image& image) { image.GetNumberFmt() == AmdGpu::NumberFormat::Float) { return spv::ImageFormat::Rg16f; } + if (image.GetDataFmt() == AmdGpu::DataFormat::Format16_16 && + image.GetNumberFmt() == AmdGpu::NumberFormat::Snorm) { + return spv::ImageFormat::Rg16Snorm; + } if (image.GetDataFmt() == AmdGpu::DataFormat::Format8_8 && image.GetNumberFmt() == AmdGpu::NumberFormat::Unorm) { return spv::ImageFormat::Rg8; diff --git a/src/shader_recompiler/frontend/control_flow_graph.cpp b/src/shader_recompiler/frontend/control_flow_graph.cpp index 3faf8665b..276bd9db0 100644 --- a/src/shader_recompiler/frontend/control_flow_graph.cpp +++ b/src/shader_recompiler/frontend/control_flow_graph.cpp @@ -21,8 +21,13 @@ struct Compare { } }; -static IR::Condition MakeCondition(Opcode opcode) { - switch (opcode) { +static IR::Condition MakeCondition(const GcnInst& inst) { + if (inst.IsCmpx()) { + ASSERT(inst.opcode == Opcode::V_CMPX_NE_U32); + return IR::Condition::Execnz; + } + + switch (inst.opcode) { case Opcode::S_CBRANCH_SCC0: return IR::Condition::Scc0; case Opcode::S_CBRANCH_SCC1: @@ -37,7 +42,6 @@ static IR::Condition MakeCondition(Opcode opcode) { return IR::Condition::Execnz; case Opcode::S_AND_SAVEEXEC_B64: case Opcode::S_ANDN2_B64: - case Opcode::V_CMPX_NE_U32: return IR::Condition::Execnz; default: return IR::Condition::True; @@ -94,7 +98,8 @@ void CFG::EmitDivergenceLabels() { // While this instruction does not save EXEC it is often used paired // with SAVEEXEC to mask the threads that didn't pass the condition // of initial branch. - inst.opcode == Opcode::S_ANDN2_B64 || inst.opcode == Opcode::V_CMPX_NE_U32; + (inst.opcode == Opcode::S_ANDN2_B64 && inst.dst[0].field == OperandField::ExecLo) || + inst.opcode == Opcode::V_CMPX_NE_U32; }; const auto is_close_scope = [](const GcnInst& inst) { // Closing an EXEC scope can be either a branch instruction @@ -104,7 +109,8 @@ void CFG::EmitDivergenceLabels() { // Sometimes compiler might insert instructions between the SAVEEXEC and the branch. // Those instructions need to be wrapped in the condition as well so allow branch // as end scope instruction. - inst.opcode == Opcode::S_CBRANCH_EXECZ || inst.opcode == Opcode::S_ANDN2_B64; + inst.opcode == Opcode::S_CBRANCH_EXECZ || + (inst.opcode == Opcode::S_ANDN2_B64 && inst.dst[0].field == OperandField::ExecLo); }; // Since we will be adding new labels, avoid iterating those as well. @@ -171,7 +177,7 @@ void CFG::EmitBlocks() { block->begin_index = GetIndex(start); block->end_index = end_index; block->end_inst = end_inst; - block->cond = MakeCondition(end_inst.opcode); + block->cond = MakeCondition(end_inst); blocks.insert(*block); } } diff --git a/src/shader_recompiler/frontend/instruction.cpp b/src/shader_recompiler/frontend/instruction.cpp index 756d3b4e2..a0c132053 100644 --- a/src/shader_recompiler/frontend/instruction.cpp +++ b/src/shader_recompiler/frontend/instruction.cpp @@ -47,4 +47,18 @@ bool GcnInst::IsConditionalBranch() const { return false; } +bool GcnInst::IsCmpx() const { + if ((opcode >= Opcode::V_CMPX_F_F32 && opcode <= Opcode::V_CMPX_T_F32) || + (opcode >= Opcode::V_CMPX_F_F64 && opcode <= Opcode::V_CMPX_T_F64) || + (opcode >= Opcode::V_CMPSX_F_F32 && opcode <= Opcode::V_CMPSX_T_F32) || + (opcode >= Opcode::V_CMPSX_F_F64 && opcode <= Opcode::V_CMPSX_T_F64) || + (opcode >= Opcode::V_CMPX_F_I32 && opcode <= Opcode::V_CMPX_CLASS_F32) || + (opcode >= Opcode::V_CMPX_F_I64 && opcode <= Opcode::V_CMPX_CLASS_F64) || + (opcode >= Opcode::V_CMPX_F_U32 && opcode <= Opcode::V_CMPX_T_U32) || + (opcode >= Opcode::V_CMPX_F_U64 && opcode <= Opcode::V_CMPX_T_U64)) { + return true; + } + return false; +} + } // namespace Shader::Gcn diff --git a/src/shader_recompiler/frontend/instruction.h b/src/shader_recompiler/frontend/instruction.h index f83f43db5..7c2e0bd1e 100644 --- a/src/shader_recompiler/frontend/instruction.h +++ b/src/shader_recompiler/frontend/instruction.h @@ -203,6 +203,7 @@ struct GcnInst { bool IsUnconditionalBranch() const; bool IsConditionalBranch() const; bool IsFork() const; + bool IsCmpx() const; }; } // namespace Shader::Gcn diff --git a/src/shader_recompiler/frontend/structured_control_flow.cpp b/src/shader_recompiler/frontend/structured_control_flow.cpp index b50205d46..fefc623fc 100644 --- a/src/shader_recompiler/frontend/structured_control_flow.cpp +++ b/src/shader_recompiler/frontend/structured_control_flow.cpp @@ -3,6 +3,7 @@ #include #include +#include #include #include #include diff --git a/src/shader_recompiler/frontend/translate/scalar_alu.cpp b/src/shader_recompiler/frontend/translate/scalar_alu.cpp index 7f7c9d7e0..da74f9018 100644 --- a/src/shader_recompiler/frontend/translate/scalar_alu.cpp +++ b/src/shader_recompiler/frontend/translate/scalar_alu.cpp @@ -6,96 +6,150 @@ namespace Shader::Gcn { void Translator::EmitScalarAlu(const GcnInst& inst) { + switch (inst.encoding) { + case InstEncoding::SOPC: { + EmitSOPC(inst); + break; + } + case InstEncoding::SOPK: { + EmitSOPK(inst); + break; + } + default: + switch (inst.opcode) { + case Opcode::S_MOV_B32: + return S_MOV(inst); + case Opcode::S_MUL_I32: + return S_MUL_I32(inst); + case Opcode::S_AND_SAVEEXEC_B64: + return S_AND_SAVEEXEC_B64(inst); + case Opcode::S_MOV_B64: + return S_MOV_B64(inst); + case Opcode::S_OR_B64: + return S_OR_B64(NegateMode::None, false, inst); + case Opcode::S_NOR_B64: + return S_OR_B64(NegateMode::Result, false, inst); + case Opcode::S_XOR_B64: + return S_OR_B64(NegateMode::None, true, inst); + case Opcode::S_ORN2_B64: + return S_OR_B64(NegateMode::Src1, false, inst); + case Opcode::S_AND_B64: + return S_AND_B64(NegateMode::None, inst); + case Opcode::S_NAND_B64: + return S_AND_B64(NegateMode::Result, inst); + case Opcode::S_ANDN2_B64: + return S_AND_B64(NegateMode::Src1, inst); + case Opcode::S_NOT_B64: + return S_NOT_B64(inst); + case Opcode::S_ADD_I32: + return S_ADD_I32(inst); + case Opcode::S_AND_B32: + return S_AND_B32(inst); + case Opcode::S_ASHR_I32: + return S_ASHR_I32(inst); + case Opcode::S_OR_B32: + return S_OR_B32(inst); + case Opcode::S_LSHL_B32: + return S_LSHL_B32(inst); + case Opcode::S_LSHR_B32: + return S_LSHR_B32(inst); + case Opcode::S_CSELECT_B32: + return S_CSELECT_B32(inst); + case Opcode::S_CSELECT_B64: + return S_CSELECT_B64(inst); + case Opcode::S_BFE_U32: + return S_BFE_U32(inst); + case Opcode::S_BFM_B32: + return S_BFM_B32(inst); + case Opcode::S_BREV_B32: + return S_BREV_B32(inst); + case Opcode::S_ADD_U32: + return S_ADD_U32(inst); + case Opcode::S_ADDC_U32: + return S_ADDC_U32(inst); + case Opcode::S_SUB_U32: + case Opcode::S_SUB_I32: + return S_SUB_U32(inst); + case Opcode::S_MIN_U32: + return S_MIN_U32(inst); + case Opcode::S_MAX_U32: + return S_MAX_U32(inst); + case Opcode::S_WQM_B64: + break; + default: + LogMissingOpcode(inst); + } + break; + } +} + +void Translator::EmitSOPC(const GcnInst& inst) { switch (inst.opcode) { - case Opcode::S_MOVK_I32: - return S_MOVK(inst); - case Opcode::S_MOV_B32: - return S_MOV(inst); - case Opcode::S_MUL_I32: - return S_MUL_I32(inst); - case Opcode::S_AND_SAVEEXEC_B64: - return S_AND_SAVEEXEC_B64(inst); - case Opcode::S_MOV_B64: - return S_MOV_B64(inst); - case Opcode::S_CMP_LT_U32: - return S_CMP(ConditionOp::LT, false, inst); - case Opcode::S_CMP_LE_U32: - return S_CMP(ConditionOp::LE, false, inst); - case Opcode::S_CMP_LG_U32: - return S_CMP(ConditionOp::LG, false, inst); - case Opcode::S_CMP_LT_I32: - return S_CMP(ConditionOp::LT, true, inst); + case Opcode::S_CMP_EQ_I32: + return S_CMP(ConditionOp::EQ, true, inst); case Opcode::S_CMP_LG_I32: return S_CMP(ConditionOp::LG, true, inst); case Opcode::S_CMP_GT_I32: return S_CMP(ConditionOp::GT, true, inst); - case Opcode::S_CMP_LE_I32: - return S_CMP(ConditionOp::LE, true, inst); case Opcode::S_CMP_GE_I32: return S_CMP(ConditionOp::GE, true, inst); - case Opcode::S_CMP_EQ_I32: - return S_CMP(ConditionOp::EQ, true, inst); + case Opcode::S_CMP_LT_I32: + return S_CMP(ConditionOp::LT, true, inst); + case Opcode::S_CMP_LE_I32: + return S_CMP(ConditionOp::LE, true, inst); + case Opcode::S_CMP_EQ_U32: return S_CMP(ConditionOp::EQ, false, inst); - case Opcode::S_CMP_GE_U32: - return S_CMP(ConditionOp::GE, false, inst); + case Opcode::S_CMP_LG_U32: + return S_CMP(ConditionOp::LG, false, inst); case Opcode::S_CMP_GT_U32: return S_CMP(ConditionOp::GT, false, inst); - case Opcode::S_OR_B64: - return S_OR_B64(NegateMode::None, false, inst); - case Opcode::S_NOR_B64: - return S_OR_B64(NegateMode::Result, false, inst); - case Opcode::S_XOR_B64: - return S_OR_B64(NegateMode::None, true, inst); - case Opcode::S_ORN2_B64: - return S_OR_B64(NegateMode::Src1, false, inst); - case Opcode::S_AND_B64: - return S_AND_B64(NegateMode::None, inst); - case Opcode::S_NAND_B64: - return S_AND_B64(NegateMode::Result, inst); - case Opcode::S_ANDN2_B64: - return S_AND_B64(NegateMode::Src1, inst); - case Opcode::S_NOT_B64: - return S_NOT_B64(inst); - case Opcode::S_ADD_I32: - return S_ADD_I32(inst); - case Opcode::S_AND_B32: - return S_AND_B32(inst); - case Opcode::S_ASHR_I32: - return S_ASHR_I32(inst); - case Opcode::S_OR_B32: - return S_OR_B32(inst); - case Opcode::S_LSHL_B32: - return S_LSHL_B32(inst); - case Opcode::S_LSHR_B32: - return S_LSHR_B32(inst); - case Opcode::S_CSELECT_B32: - return S_CSELECT_B32(inst); - case Opcode::S_CSELECT_B64: - return S_CSELECT_B64(inst); - case Opcode::S_BFE_U32: - return S_BFE_U32(inst); - case Opcode::S_BFM_B32: - return S_BFM_B32(inst); - case Opcode::S_BREV_B32: - return S_BREV_B32(inst); - case Opcode::S_ADD_U32: - return S_ADD_U32(inst); - case Opcode::S_ADDC_U32: - return S_ADDC_U32(inst); + case Opcode::S_CMP_GE_U32: + return S_CMP(ConditionOp::GE, false, inst); + case Opcode::S_CMP_LT_U32: + return S_CMP(ConditionOp::LT, false, inst); + case Opcode::S_CMP_LE_U32: + return S_CMP(ConditionOp::LE, false, inst); + default: + LogMissingOpcode(inst); + } +} + +void Translator::EmitSOPK(const GcnInst& inst) { + switch (inst.opcode) { + case Opcode::S_MOVK_I32: + return S_MOVK(inst); + + case Opcode::S_CMPK_EQ_I32: + return S_CMPK(ConditionOp::EQ, true, inst); + case Opcode::S_CMPK_LG_I32: + return S_CMPK(ConditionOp::LG, true, inst); + case Opcode::S_CMPK_GT_I32: + return S_CMPK(ConditionOp::GT, true, inst); + case Opcode::S_CMPK_GE_I32: + return S_CMPK(ConditionOp::GE, true, inst); + case Opcode::S_CMPK_LT_I32: + return S_CMPK(ConditionOp::LT, true, inst); + case Opcode::S_CMPK_LE_I32: + return S_CMPK(ConditionOp::LE, true, inst); + + case Opcode::S_CMPK_EQ_U32: + return S_CMPK(ConditionOp::EQ, false, inst); + case Opcode::S_CMPK_LG_U32: + return S_CMPK(ConditionOp::LG, false, inst); + case Opcode::S_CMPK_GT_U32: + return S_CMPK(ConditionOp::GT, false, inst); + case Opcode::S_CMPK_GE_U32: + return S_CMPK(ConditionOp::GE, false, inst); + case Opcode::S_CMPK_LT_U32: + return S_CMPK(ConditionOp::LT, false, inst); + case Opcode::S_CMPK_LE_U32: + return S_CMPK(ConditionOp::LE, false, inst); + case Opcode::S_ADDK_I32: return S_ADDK_I32(inst); case Opcode::S_MULK_I32: return S_MULK_I32(inst); - case Opcode::S_SUB_U32: - case Opcode::S_SUB_I32: - return S_SUB_U32(inst); - case Opcode::S_MIN_U32: - return S_MIN_U32(inst); - case Opcode::S_MAX_U32: - return S_MAX_U32(inst); - case Opcode::S_WQM_B64: - break; default: LogMissingOpcode(inst); } @@ -152,6 +206,31 @@ void Translator::S_CMP(ConditionOp cond, bool is_signed, const GcnInst& inst) { ir.SetScc(result); } +void Translator::S_CMPK(ConditionOp cond, bool is_signed, const GcnInst& inst) { + const s32 simm16 = inst.control.sopk.simm; + const IR::U32 lhs = GetSrc(inst.dst[0]); + const IR::U32 rhs = ir.Imm32(simm16); + const IR::U1 result = [&] { + switch (cond) { + case ConditionOp::EQ: + return ir.IEqual(lhs, rhs); + case ConditionOp::LG: + return ir.INotEqual(lhs, rhs); + case ConditionOp::GT: + return ir.IGreaterThan(lhs, rhs, is_signed); + case ConditionOp::GE: + return ir.IGreaterThanEqual(lhs, rhs, is_signed); + case ConditionOp::LT: + return ir.ILessThan(lhs, rhs, is_signed); + case ConditionOp::LE: + return ir.ILessThanEqual(lhs, rhs, is_signed); + default: + UNREACHABLE(); + } + }(); + ir.SetScc(result); +} + void Translator::S_AND_SAVEEXEC_B64(const GcnInst& inst) { // This instruction normally operates on 64-bit data (EXEC, VCC, SGPRs) // However here we flatten it to 1-bit EXEC and 1-bit VCC. For the destination diff --git a/src/shader_recompiler/frontend/translate/translate.h b/src/shader_recompiler/frontend/translate/translate.h index 009acabdf..8cbf7357e 100644 --- a/src/shader_recompiler/frontend/translate/translate.h +++ b/src/shader_recompiler/frontend/translate/translate.h @@ -69,6 +69,10 @@ public: void EmitScalarAlu(const GcnInst& inst); void EmitVectorAlu(const GcnInst& inst); + // Instruction encodings + void EmitSOPC(const GcnInst& inst); + void EmitSOPK(const GcnInst& inst); + // Scalar ALU void S_MOVK(const GcnInst& inst); void S_MOV(const GcnInst& inst); @@ -98,6 +102,7 @@ public: void S_ADDK_I32(const GcnInst& inst); void S_MAX_U32(const GcnInst& inst); void S_MIN_U32(const GcnInst& inst); + void S_CMPK(ConditionOp cond, bool is_signed, const GcnInst& inst); // Scalar Memory void S_LOAD_DWORD(int num_dwords, const GcnInst& inst); @@ -116,6 +121,7 @@ public: void V_AND_B32(const GcnInst& inst); void V_LSHLREV_B32(const GcnInst& inst); void V_LSHL_B32(const GcnInst& inst); + void V_LSHL_B64(const GcnInst& inst); void V_ADD_I32(const GcnInst& inst); void V_ADDC_U32(const GcnInst& inst); void V_CVT_F32_I32(const GcnInst& inst); diff --git a/src/shader_recompiler/frontend/translate/vector_alu.cpp b/src/shader_recompiler/frontend/translate/vector_alu.cpp index 1b49999a6..274dcff11 100644 --- a/src/shader_recompiler/frontend/translate/vector_alu.cpp +++ b/src/shader_recompiler/frontend/translate/vector_alu.cpp @@ -11,6 +11,8 @@ void Translator::EmitVectorAlu(const GcnInst& inst) { return V_LSHLREV_B32(inst); case Opcode::V_LSHL_B32: return V_LSHL_B32(inst); + case Opcode::V_LSHL_B64: + return V_LSHL_B64(inst); case Opcode::V_BFREV_B32: return V_BFREV_B32(inst); case Opcode::V_BFE_U32: @@ -280,6 +282,8 @@ void Translator::EmitVectorAlu(const GcnInst& inst) { return V_CMP_U32(ConditionOp::GT, true, false, inst); case Opcode::V_CMP_LT_I32: return V_CMP_U32(ConditionOp::LT, true, false, inst); + case Opcode::V_CMPX_GT_I32: + return V_CMP_U32(ConditionOp::GT, true, true, inst); case Opcode::V_CMPX_LT_I32: return V_CMP_U32(ConditionOp::LT, true, true, inst); case Opcode::V_CMPX_F_U32: @@ -305,7 +309,6 @@ void Translator::EmitVectorAlu(const GcnInst& inst) { return V_MBCNT_U32_B32(true, inst); case Opcode::V_MBCNT_HI_U32_B32: return V_MBCNT_U32_B32(false, inst); - case Opcode::V_NOP: return; default: @@ -389,6 +392,16 @@ void Translator::V_LSHL_B32(const GcnInst& inst) { SetDst(inst.dst[0], ir.ShiftLeftLogical(src0, ir.BitwiseAnd(src1, ir.Imm32(0x1F)))); } +void Translator::V_LSHL_B64(const GcnInst& inst) { + const IR::U64 src0{GetSrc64(inst.src[0])}; + const IR::U64 src1{GetSrc64(inst.src[1])}; + const IR::VectorReg dst_reg{inst.dst[0].code}; + ASSERT_MSG(src0.IsImmediate() && src0.U64() == 0 && src1.IsImmediate() && src1.U64() == 0, + "V_LSHL_B64 with non-zero src0 or src1 is not supported"); + ir.SetVectorReg(dst_reg, ir.Imm32(0)); + ir.SetVectorReg(dst_reg + 1, ir.Imm32(0)); +} + void Translator::V_ADD_I32(const GcnInst& inst) { const IR::U32 src0{GetSrc(inst.src[0])}; const IR::U32 src1{ir.GetVectorReg(IR::VectorReg(inst.src[1].code))}; diff --git a/src/shader_recompiler/frontend/translate/vector_memory.cpp b/src/shader_recompiler/frontend/translate/vector_memory.cpp index 41eb91234..b88cfc46c 100644 --- a/src/shader_recompiler/frontend/translate/vector_memory.cpp +++ b/src/shader_recompiler/frontend/translate/vector_memory.cpp @@ -94,6 +94,8 @@ void Translator::EmitVectorMemory(const GcnInst& inst) { case Opcode::TBUFFER_STORE_FORMAT_X: return BUFFER_STORE_FORMAT(1, true, true, inst); + case Opcode::TBUFFER_STORE_FORMAT_XY: + return BUFFER_STORE_FORMAT(2, true, true, inst); case Opcode::TBUFFER_STORE_FORMAT_XYZ: return BUFFER_STORE_FORMAT(3, true, true, inst); @@ -109,6 +111,8 @@ void Translator::EmitVectorMemory(const GcnInst& inst) { // Buffer atomic operations case Opcode::BUFFER_ATOMIC_ADD: return BUFFER_ATOMIC(AtomicOp::Add, inst); + case Opcode::BUFFER_ATOMIC_SWAP: + return BUFFER_ATOMIC(AtomicOp::Swap, inst); default: LogMissingOpcode(inst); } @@ -474,7 +478,7 @@ void Translator::BUFFER_ATOMIC(AtomicOp op, const GcnInst& inst) { const IR::Value original_val = [&] { switch (op) { case AtomicOp::Swap: - return ir.BufferAtomicExchange(handle, address, vdata_val, info); + return ir.BufferAtomicSwap(handle, address, vdata_val, info); case AtomicOp::Add: return ir.BufferAtomicIAdd(handle, address, vdata_val, info); case AtomicOp::Smin: diff --git a/src/shader_recompiler/ir/ir_emitter.cpp b/src/shader_recompiler/ir/ir_emitter.cpp index 0f2fb2f7c..65de98b7e 100644 --- a/src/shader_recompiler/ir/ir_emitter.cpp +++ b/src/shader_recompiler/ir/ir_emitter.cpp @@ -404,9 +404,9 @@ Value IREmitter::BufferAtomicXor(const Value& handle, const Value& address, cons return Inst(Opcode::BufferAtomicXor32, Flags{info}, handle, address, value); } -Value IREmitter::BufferAtomicExchange(const Value& handle, const Value& address, const Value& value, - BufferInstInfo info) { - return Inst(Opcode::BufferAtomicExchange32, Flags{info}, handle, address, value); +Value IREmitter::BufferAtomicSwap(const Value& handle, const Value& address, const Value& value, + BufferInstInfo info) { + return Inst(Opcode::BufferAtomicSwap32, Flags{info}, handle, address, value); } void IREmitter::StoreBufferFormat(int num_dwords, const Value& handle, const Value& address, @@ -1115,8 +1115,18 @@ U32U64 IREmitter::ShiftRightArithmetic(const U32U64& base, const U32& shift) { } } -U32 IREmitter::BitwiseAnd(const U32& a, const U32& b) { - return Inst(Opcode::BitwiseAnd32, a, b); +U32U64 IREmitter::BitwiseAnd(const U32U64& a, const U32U64& b) { + if (a.Type() != b.Type()) { + UNREACHABLE_MSG("Mismatching types {} and {}", a.Type(), b.Type()); + } + switch (a.Type()) { + case Type::U32: + return Inst(Opcode::BitwiseAnd32, a, b); + case Type::U64: + return Inst(Opcode::BitwiseAnd64, a, b); + default: + ThrowInvalidType(a.Type()); + } } U32U64 IREmitter::BitwiseOr(const U32U64& a, const U32U64& b) { diff --git a/src/shader_recompiler/ir/ir_emitter.h b/src/shader_recompiler/ir/ir_emitter.h index 45fa5f216..a60f4c288 100644 --- a/src/shader_recompiler/ir/ir_emitter.h +++ b/src/shader_recompiler/ir/ir_emitter.h @@ -115,8 +115,8 @@ public: const Value& value, BufferInstInfo info); [[nodiscard]] Value BufferAtomicXor(const Value& handle, const Value& address, const Value& value, BufferInstInfo info); - [[nodiscard]] Value BufferAtomicExchange(const Value& handle, const Value& address, - const Value& value, BufferInstInfo info); + [[nodiscard]] Value BufferAtomicSwap(const Value& handle, const Value& address, + const Value& value, BufferInstInfo info); [[nodiscard]] U32 LaneId(); [[nodiscard]] U32 WarpId(); @@ -195,7 +195,7 @@ public: [[nodiscard]] U32U64 ShiftLeftLogical(const U32U64& base, const U32& shift); [[nodiscard]] U32U64 ShiftRightLogical(const U32U64& base, const U32& shift); [[nodiscard]] U32U64 ShiftRightArithmetic(const U32U64& base, const U32& shift); - [[nodiscard]] U32 BitwiseAnd(const U32& a, const U32& b); + [[nodiscard]] U32U64 BitwiseAnd(const U32U64& a, const U32U64& b); [[nodiscard]] U32U64 BitwiseOr(const U32U64& a, const U32U64& b); [[nodiscard]] U32 BitwiseXor(const U32& a, const U32& b); [[nodiscard]] U32 BitFieldInsert(const U32& base, const U32& insert, const U32& offset, diff --git a/src/shader_recompiler/ir/microinstruction.cpp b/src/shader_recompiler/ir/microinstruction.cpp index e35be8a7f..a8c8b0737 100644 --- a/src/shader_recompiler/ir/microinstruction.cpp +++ b/src/shader_recompiler/ir/microinstruction.cpp @@ -70,7 +70,7 @@ bool Inst::MayHaveSideEffects() const noexcept { case Opcode::BufferAtomicAnd32: case Opcode::BufferAtomicOr32: case Opcode::BufferAtomicXor32: - case Opcode::BufferAtomicExchange32: + case Opcode::BufferAtomicSwap32: case Opcode::WriteSharedU128: case Opcode::WriteSharedU64: case Opcode::WriteSharedU32: diff --git a/src/shader_recompiler/ir/opcodes.inc b/src/shader_recompiler/ir/opcodes.inc index 9be89f648..a49ea1c77 100644 --- a/src/shader_recompiler/ir/opcodes.inc +++ b/src/shader_recompiler/ir/opcodes.inc @@ -95,7 +95,7 @@ OPCODE(StoreBufferFormatF32x4, Void, Opaq OPCODE(StoreBufferU32, Void, Opaque, Opaque, U32, ) // Buffer atomic operations -OPCODE(BufferAtomicIAdd32, U32, Opaque, Opaque, U32 ) +OPCODE(BufferAtomicIAdd32, U32, Opaque, Opaque, U32 ) OPCODE(BufferAtomicSMin32, U32, Opaque, Opaque, U32 ) OPCODE(BufferAtomicUMin32, U32, Opaque, Opaque, U32 ) OPCODE(BufferAtomicSMax32, U32, Opaque, Opaque, U32 ) @@ -105,7 +105,7 @@ OPCODE(BufferAtomicDec32, U32, Opaq OPCODE(BufferAtomicAnd32, U32, Opaque, Opaque, U32, ) OPCODE(BufferAtomicOr32, U32, Opaque, Opaque, U32, ) OPCODE(BufferAtomicXor32, U32, Opaque, Opaque, U32, ) -OPCODE(BufferAtomicExchange32, U32, Opaque, Opaque, U32, ) +OPCODE(BufferAtomicSwap32, U32, Opaque, Opaque, U32, ) // Vector utility OPCODE(CompositeConstructU32x2, U32x2, U32, U32, ) @@ -260,6 +260,7 @@ OPCODE(ShiftRightLogical64, U64, U64, OPCODE(ShiftRightArithmetic32, U32, U32, U32, ) OPCODE(ShiftRightArithmetic64, U64, U64, U32, ) OPCODE(BitwiseAnd32, U32, U32, U32, ) +OPCODE(BitwiseAnd64, U64, U64, U64, ) OPCODE(BitwiseOr32, U32, U32, U32, ) OPCODE(BitwiseOr64, U64, U64, U64, ) OPCODE(BitwiseXor32, U32, U32, U32, ) diff --git a/src/shader_recompiler/ir/passes/constant_propogation_pass.cpp b/src/shader_recompiler/ir/passes/constant_propagation_pass.cpp similarity index 98% rename from src/shader_recompiler/ir/passes/constant_propogation_pass.cpp rename to src/shader_recompiler/ir/passes/constant_propagation_pass.cpp index b0d9dcc45..87a069338 100644 --- a/src/shader_recompiler/ir/passes/constant_propogation_pass.cpp +++ b/src/shader_recompiler/ir/passes/constant_propagation_pass.cpp @@ -352,9 +352,15 @@ void ConstantPropagation(IR::Block& block, IR::Inst& inst) { case IR::Opcode::BitwiseAnd32: FoldWhenAllImmediates(inst, [](u32 a, u32 b) { return a & b; }); return; + case IR::Opcode::BitwiseAnd64: + FoldWhenAllImmediates(inst, [](u64 a, u64 b) { return a & b; }); + return; case IR::Opcode::BitwiseOr32: FoldWhenAllImmediates(inst, [](u32 a, u32 b) { return a | b; }); return; + case IR::Opcode::BitwiseOr64: + FoldWhenAllImmediates(inst, [](u64 a, u64 b) { return a | b; }); + return; case IR::Opcode::BitwiseXor32: FoldWhenAllImmediates(inst, [](u32 a, u32 b) { return a ^ b; }); return; diff --git a/src/shader_recompiler/ir/passes/resource_tracking_pass.cpp b/src/shader_recompiler/ir/passes/resource_tracking_pass.cpp index efee710db..ace6a37d8 100644 --- a/src/shader_recompiler/ir/passes/resource_tracking_pass.cpp +++ b/src/shader_recompiler/ir/passes/resource_tracking_pass.cpp @@ -32,7 +32,7 @@ bool IsBufferAtomic(const IR::Inst& inst) { case IR::Opcode::BufferAtomicAnd32: case IR::Opcode::BufferAtomicOr32: case IR::Opcode::BufferAtomicXor32: - case IR::Opcode::BufferAtomicExchange32: + case IR::Opcode::BufferAtomicSwap32: return true; default: return false; @@ -136,6 +136,7 @@ IR::Type BufferDataType(const IR::Inst& inst, AmdGpu::NumberFormat num_format) { case IR::Opcode::ReadConstBufferU32: case IR::Opcode::StoreBufferU32: case IR::Opcode::BufferAtomicIAdd32: + case IR::Opcode::BufferAtomicSwap32: return IR::Type::U32; default: UNREACHABLE(); @@ -246,10 +247,7 @@ public: return true; } // Samplers with different bindings might still be the same. - const auto old_sharp = - info.ReadUd(existing.sgpr_base, existing.dword_offset); - const auto new_sharp = info.ReadUd(desc.sgpr_base, desc.dword_offset); - return old_sharp == new_sharp; + return existing.GetSsharp(info) == desc.GetSsharp(info); })}; return index; } @@ -295,10 +293,11 @@ std::pair TryDisableAnisoLod0(const IR::Inst* inst) { return not_found; } - // The bits range is for lods + // The bits range is for lods (note that constants are changed after constant propagation pass) const auto* prod0_arg0 = prod0->Arg(0).InstRecursive(); if (prod0_arg0->GetOpcode() != IR::Opcode::BitFieldUExtract || - prod0_arg0->Arg(1).InstRecursive()->Arg(0).U32() != 0x0008000cu) { + !(prod0_arg0->Arg(1).IsIdentity() && prod0_arg0->Arg(1).U32() == 12) || + !(prod0_arg0->Arg(2).IsIdentity() && prod0_arg0->Arg(2).U32() == 8)) { return not_found; } diff --git a/src/video_core/amdgpu/default_context.cpp b/src/video_core/amdgpu/default_context.cpp new file mode 100644 index 000000000..01229e7b1 --- /dev/null +++ b/src/video_core/amdgpu/default_context.cpp @@ -0,0 +1,55 @@ +// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "common/types.h" +#include "video_core/amdgpu/liverpool.h" + +#include + +namespace AmdGpu { + +// The following values are taken from fpPS4: +// https://github.com/red-prig/fpPS4/blob/436b43064be4c78229500f3d3c054fc76639247d/chip/pm4_pfp.pas#L410 +// +static constexpr std::array reg_array_default{ + 0x00000000u, 0x80000000u, 0x40004000u, 0xdeadbeefu, 0x00000000u, 0x40004000u, 0x00000000u, + 0x40004000u, 0x00000000u, 0x40004000u, 0x00000000u, 0x40004000u, 0xaa99aaaau, 0x00000000u, + 0xdeadbeefu, 0xdeadbeefu, 0x80000000u, 0x40004000u, 0x00000000u, 0x00000000u, 0x80000000u, + 0x40004000u, 0x80000000u, 0x40004000u, 0x80000000u, 0x40004000u, 0x80000000u, 0x40004000u, + 0x80000000u, 0x40004000u, 0x80000000u, 0x40004000u, 0x80000000u, 0x40004000u, 0x80000000u, + 0x40004000u, 0x80000000u, 0x40004000u, 0x80000000u, 0x40004000u, 0x80000000u, 0x40004000u, + 0x80000000u, 0x40004000u, 0x80000000u, 0x40004000u, 0x80000000u, 0x40004000u, 0x80000000u, + 0x40004000u, 0x80000000u, 0x40004000u, 0x00000000u, 0x3f800000u, 0x00000000u, 0x3f800000u, + 0x00000000u, 0x3f800000u, 0x00000000u, 0x3f800000u, 0x00000000u, 0x3f800000u, 0x00000000u, + 0x3f800000u, 0x00000000u, 0x3f800000u, 0x00000000u, 0x3f800000u, 0x00000000u, 0x3f800000u, + 0x00000000u, 0x3f800000u, 0x00000000u, 0x3f800000u, 0x00000000u, 0x3f800000u, 0x00000000u, + 0x3f800000u, 0x00000000u, 0x3f800000u, 0x00000000u, 0x3f800000u, 0x00000000u, 0x3f800000u, + 0x2a00161au, +}; + +void Liverpool::Regs::SetDefaults() { + std::memset(reg_array.data(), 0, reg_array.size() * sizeof(u32)); + + std::memcpy(®_array[ContextRegWordOffset + 0x80], reg_array_default.data(), + reg_array_default.size() * sizeof(u32)); + + // Individual context regs values + reg_array[ContextRegWordOffset + 0x000d] = 0x40004000u; + reg_array[ContextRegWordOffset + 0x01b6] = 0x00000002u; + reg_array[ContextRegWordOffset + 0x0204] = 0x00090000u; + reg_array[ContextRegWordOffset + 0x0205] = 0x00000004u; + reg_array[ContextRegWordOffset + 0x0295] = 0x00000100u; + reg_array[ContextRegWordOffset + 0x0296] = 0x00000080u; + reg_array[ContextRegWordOffset + 0x0297] = 0x00000002u; + reg_array[ContextRegWordOffset + 0x02aa] = 0x00001000u; + reg_array[ContextRegWordOffset + 0x02f7] = 0x00001000u; + reg_array[ContextRegWordOffset + 0x02f9] = 0x00000005u; + reg_array[ContextRegWordOffset + 0x02fa] = 0x3f800000u; + reg_array[ContextRegWordOffset + 0x02fb] = 0x3f800000u; + reg_array[ContextRegWordOffset + 0x02fc] = 0x3f800000u; + reg_array[ContextRegWordOffset + 0x02fd] = 0x3f800000u; + reg_array[ContextRegWordOffset + 0x0316] = 0x0000000eu; + reg_array[ContextRegWordOffset + 0x0317] = 0x00000010u; +} + +} // namespace AmdGpu diff --git a/src/video_core/amdgpu/liverpool.cpp b/src/video_core/amdgpu/liverpool.cpp index dce2d4b42..8570a2908 100644 --- a/src/video_core/amdgpu/liverpool.cpp +++ b/src/video_core/amdgpu/liverpool.cpp @@ -2,6 +2,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include "common/assert.h" +#include "common/config.h" #include "common/debug.h" #include "common/polyfill_thread.h" #include "common/thread.h" @@ -175,290 +176,305 @@ Liverpool::Task Liverpool::ProcessGraphics(std::span dcb, std::span(dcb.data()); const u32 type = header->type; - if (type != 3) { - // No other types of packets were spotted so far - UNREACHABLE_MSG("Invalid PM4 type {}", type); - } - const u32 count = header->type3.NumWords(); - const PM4ItOpcode opcode = header->type3.opcode; - switch (opcode) { - case PM4ItOpcode::Nop: { - const auto* nop = reinterpret_cast(header); - if (nop->header.count.Value() == 0) { - break; - } + switch (type) { + case 0: + case 1: + UNREACHABLE_MSG("Unsupported PM4 type {}", type); + break; + case 2: + // Type-2 packet are used for padding purposes + dcb = dcb.subspan(1); + continue; + case 3: + const u32 count = header->type3.NumWords(); + const PM4ItOpcode opcode = header->type3.opcode; + switch (opcode) { + case PM4ItOpcode::Nop: { + const auto* nop = reinterpret_cast(header); + if (nop->header.count.Value() == 0) { + break; + } - switch (nop->data_block[0]) { - case PM4CmdNop::PayloadType::PatchedFlip: { - // There is no evidence that GPU CP drives flip events by parsing - // special NOP packets. For convenience lets assume that it does. - Platform::IrqC::Instance()->Signal(Platform::InterruptId::GfxFlip); + switch (nop->data_block[0]) { + case PM4CmdNop::PayloadType::PatchedFlip: { + // There is no evidence that GPU CP drives flip events by parsing + // special NOP packets. For convenience lets assume that it does. + Platform::IrqC::Instance()->Signal(Platform::InterruptId::GfxFlip); + break; + } + case PM4CmdNop::PayloadType::DebugMarkerPush: { + const auto marker_sz = nop->header.count.Value() * 2; + const std::string_view label{reinterpret_cast(&nop->data_block[1]), + marker_sz}; + rasterizer->ScopeMarkerBegin(label); + break; + } + case PM4CmdNop::PayloadType::DebugMarkerPop: { + rasterizer->ScopeMarkerEnd(); + break; + } + default: + break; + } break; } - case PM4CmdNop::PayloadType::DebugMarkerPush: { - const auto marker_sz = nop->header.count.Value() * 2; - const std::string_view label{reinterpret_cast(&nop->data_block[1]), - marker_sz}; - rasterizer->ScopeMarkerBegin(label); + case PM4ItOpcode::ContextControl: { break; } - case PM4CmdNop::PayloadType::DebugMarkerPop: { - rasterizer->ScopeMarkerEnd(); + case PM4ItOpcode::ClearState: { + regs.SetDefaults(); + break; + } + case PM4ItOpcode::SetConfigReg: { + const auto* set_data = reinterpret_cast(header); + const auto reg_addr = ConfigRegWordOffset + set_data->reg_offset; + const auto* payload = reinterpret_cast(header + 2); + std::memcpy(®s.reg_array[reg_addr], payload, (count - 1) * sizeof(u32)); + break; + } + case PM4ItOpcode::SetContextReg: { + const auto* set_data = reinterpret_cast(header); + const auto reg_addr = ContextRegWordOffset + set_data->reg_offset; + const auto* payload = reinterpret_cast(header + 2); + + std::memcpy(®s.reg_array[reg_addr], payload, (count - 1) * sizeof(u32)); + + // In the case of HW, render target memory has alignment as color block operates on + // tiles. There is no information of actual resource extents stored in CB context + // regs, so any deduction of it from slices/pitch will lead to a larger surface + // created. The same applies to the depth targets. Fortunately, the guest always + // sends a trailing NOP packet right after the context regs setup, so we can use the + // heuristic below and extract the hint to determine actual resource dims. + + switch (reg_addr) { + case ContextRegs::CbColor0Base: + case ContextRegs::CbColor1Base: + case ContextRegs::CbColor2Base: + case ContextRegs::CbColor3Base: + case ContextRegs::CbColor4Base: + case ContextRegs::CbColor5Base: + case ContextRegs::CbColor6Base: + case ContextRegs::CbColor7Base: { + const auto col_buf_id = (reg_addr - ContextRegs::CbColor0Base) / + (ContextRegs::CbColor1Base - ContextRegs::CbColor0Base); + ASSERT(col_buf_id < NumColorBuffers); + + const auto nop_offset = header->type3.count; + if (nop_offset == 0x0e || nop_offset == 0x0d || nop_offset == 0x0b) { + ASSERT_MSG(payload[nop_offset] == 0xc0001000, + "NOP hint is missing in CB setup sequence"); + last_cb_extent[col_buf_id].raw = payload[nop_offset + 1]; + } else { + last_cb_extent[col_buf_id].raw = 0; + } + break; + } + case ContextRegs::CbColor0Cmask: + case ContextRegs::CbColor1Cmask: + case ContextRegs::CbColor2Cmask: + case ContextRegs::CbColor3Cmask: + case ContextRegs::CbColor4Cmask: + case ContextRegs::CbColor5Cmask: + case ContextRegs::CbColor6Cmask: + case ContextRegs::CbColor7Cmask: { + const auto col_buf_id = + (reg_addr - ContextRegs::CbColor0Cmask) / + (ContextRegs::CbColor1Cmask - ContextRegs::CbColor0Cmask); + ASSERT(col_buf_id < NumColorBuffers); + + const auto nop_offset = header->type3.count; + if (nop_offset == 0x04) { + ASSERT_MSG(payload[nop_offset] == 0xc0001000, + "NOP hint is missing in CB setup sequence"); + last_cb_extent[col_buf_id].raw = payload[nop_offset + 1]; + } + break; + } + case ContextRegs::DbZInfo: { + if (header->type3.count == 8) { + ASSERT_MSG(payload[20] == 0xc0001000, + "NOP hint is missing in DB setup sequence"); + last_db_extent.raw = payload[21]; + } else { + last_db_extent.raw = 0; + } + break; + } + default: + break; + } + break; + } + case PM4ItOpcode::SetShReg: { + const auto* set_data = reinterpret_cast(header); + std::memcpy(®s.reg_array[ShRegWordOffset + set_data->reg_offset], header + 2, + (count - 1) * sizeof(u32)); + break; + } + case PM4ItOpcode::SetUconfigReg: { + const auto* set_data = reinterpret_cast(header); + std::memcpy(®s.reg_array[UconfigRegWordOffset + set_data->reg_offset], + header + 2, (count - 1) * sizeof(u32)); + break; + } + case PM4ItOpcode::IndexType: { + const auto* index_type = reinterpret_cast(header); + regs.index_buffer_type.raw = index_type->raw; + break; + } + case PM4ItOpcode::DrawIndex2: { + const auto* draw_index = reinterpret_cast(header); + regs.max_index_size = draw_index->max_size; + regs.index_base_address.base_addr_lo = draw_index->index_base_lo; + regs.index_base_address.base_addr_hi.Assign(draw_index->index_base_hi); + regs.num_indices = draw_index->index_count; + regs.draw_initiator = draw_index->draw_initiator; + if (rasterizer) { + const auto cmd_address = reinterpret_cast(header); + rasterizer->ScopeMarkerBegin(fmt::format("dcb:{}:DrawIndex2", cmd_address)); + rasterizer->Breadcrumb(u64(cmd_address)); + rasterizer->Draw(true); + rasterizer->ScopeMarkerEnd(); + } + break; + } + case PM4ItOpcode::DrawIndexOffset2: { + const auto* draw_index_off = + reinterpret_cast(header); + regs.max_index_size = draw_index_off->max_size; + regs.num_indices = draw_index_off->index_count; + regs.draw_initiator = draw_index_off->draw_initiator; + if (rasterizer) { + const auto cmd_address = reinterpret_cast(header); + rasterizer->ScopeMarkerBegin( + fmt::format("dcb:{}:DrawIndexOffset2", cmd_address)); + rasterizer->Breadcrumb(u64(cmd_address)); + rasterizer->Draw(true, draw_index_off->index_offset); + rasterizer->ScopeMarkerEnd(); + } + break; + } + case PM4ItOpcode::DrawIndexAuto: { + const auto* draw_index = reinterpret_cast(header); + regs.num_indices = draw_index->index_count; + regs.draw_initiator = draw_index->draw_initiator; + if (rasterizer) { + const auto cmd_address = reinterpret_cast(header); + rasterizer->ScopeMarkerBegin(fmt::format("dcb:{}:DrawIndexAuto", cmd_address)); + rasterizer->Breadcrumb(u64(cmd_address)); + rasterizer->Draw(false); + rasterizer->ScopeMarkerEnd(); + } + break; + } + case PM4ItOpcode::DispatchDirect: { + const auto* dispatch_direct = reinterpret_cast(header); + regs.cs_program.dim_x = dispatch_direct->dim_x; + regs.cs_program.dim_y = dispatch_direct->dim_y; + regs.cs_program.dim_z = dispatch_direct->dim_z; + regs.cs_program.dispatch_initiator = dispatch_direct->dispatch_initiator; + if (rasterizer && (regs.cs_program.dispatch_initiator & 1)) { + const auto cmd_address = reinterpret_cast(header); + rasterizer->ScopeMarkerBegin(fmt::format("dcb:{}:Dispatch", cmd_address)); + rasterizer->Breadcrumb(u64(cmd_address)); + rasterizer->DispatchDirect(); + rasterizer->ScopeMarkerEnd(); + } + break; + } + case PM4ItOpcode::NumInstances: { + const auto* num_instances = reinterpret_cast(header); + regs.num_instances.num_instances = num_instances->num_instances; + break; + } + case PM4ItOpcode::IndexBase: { + const auto* index_base = reinterpret_cast(header); + regs.index_base_address.base_addr_lo = index_base->addr_lo; + regs.index_base_address.base_addr_hi.Assign(index_base->addr_hi); + break; + } + case PM4ItOpcode::IndexBufferSize: { + const auto* index_size = reinterpret_cast(header); + regs.num_indices = index_size->num_indices; + break; + } + case PM4ItOpcode::EventWrite: { + // const auto* event = reinterpret_cast(header); + break; + } + case PM4ItOpcode::EventWriteEos: { + const auto* event_eos = reinterpret_cast(header); + event_eos->SignalFence(); + break; + } + case PM4ItOpcode::EventWriteEop: { + const auto* event_eop = reinterpret_cast(header); + event_eop->SignalFence(); + break; + } + case PM4ItOpcode::DmaData: { + const auto* dma_data = reinterpret_cast(header); + break; + } + case PM4ItOpcode::WriteData: { + const auto* write_data = reinterpret_cast(header); + ASSERT(write_data->dst_sel.Value() == 2 || write_data->dst_sel.Value() == 5); + const u32 data_size = (header->type3.count.Value() - 2) * 4; + u64* address = write_data->Address(); + if (!write_data->wr_one_addr.Value()) { + std::memcpy(address, write_data->data, data_size); + } else { + UNREACHABLE(); + } + break; + } + case PM4ItOpcode::AcquireMem: { + // const auto* acquire_mem = reinterpret_cast(header); + break; + } + case PM4ItOpcode::WaitRegMem: { + const auto* wait_reg_mem = reinterpret_cast(header); + // ASSERT(wait_reg_mem->engine.Value() == PM4CmdWaitRegMem::Engine::Me); + // Optimization: VO label waits are special because the emulator + // will write to the label when presentation is finished. So if + // there are no other submits to yield to we can sleep the thread + // instead and allow other tasks to run. + const u64* wait_addr = wait_reg_mem->Address(); + if (vo_port->IsVoLabel(wait_addr) && num_submits == 1) { + vo_port->WaitVoLabel([&] { return wait_reg_mem->Test(); }); + } + while (!wait_reg_mem->Test()) { + mapped_queues[GfxQueueId].cs_state = regs.cs_program; + TracyFiberLeave; + co_yield {}; + TracyFiberEnter(dcb_task_name); + regs.cs_program = mapped_queues[GfxQueueId].cs_state; + } + break; + } + case PM4ItOpcode::IncrementDeCounter: { + ++cblock.de_count; + break; + } + case PM4ItOpcode::WaitOnCeCounter: { + while (cblock.ce_count <= cblock.de_count) { + TracyFiberLeave; + ce_task.handle.resume(); + TracyFiberEnter(dcb_task_name); + } + break; + } + case PM4ItOpcode::PfpSyncMe: { break; } default: - break; + UNREACHABLE_MSG("Unknown PM4 type 3 opcode {:#x} with count {}", + static_cast(opcode), count); } + dcb = dcb.subspan(header->type3.NumWords() + 1); break; } - case PM4ItOpcode::ContextControl: { - break; - } - case PM4ItOpcode::ClearState: { - break; - } - case PM4ItOpcode::SetConfigReg: { - const auto* set_data = reinterpret_cast(header); - const auto reg_addr = ConfigRegWordOffset + set_data->reg_offset; - const auto* payload = reinterpret_cast(header + 2); - std::memcpy(®s.reg_array[reg_addr], payload, (count - 1) * sizeof(u32)); - break; - } - case PM4ItOpcode::SetContextReg: { - const auto* set_data = reinterpret_cast(header); - const auto reg_addr = ContextRegWordOffset + set_data->reg_offset; - const auto* payload = reinterpret_cast(header + 2); - - std::memcpy(®s.reg_array[reg_addr], payload, (count - 1) * sizeof(u32)); - - // In the case of HW, render target memory has alignment as color block operates on - // tiles. There is no information of actual resource extents stored in CB context - // regs, so any deduction of it from slices/pitch will lead to a larger surface created. - // The same applies to the depth targets. Fortunately, the guest always sends - // a trailing NOP packet right after the context regs setup, so we can use the heuristic - // below and extract the hint to determine actual resource dims. - - switch (reg_addr) { - case ContextRegs::CbColor0Base: - case ContextRegs::CbColor1Base: - case ContextRegs::CbColor2Base: - case ContextRegs::CbColor3Base: - case ContextRegs::CbColor4Base: - case ContextRegs::CbColor5Base: - case ContextRegs::CbColor6Base: - case ContextRegs::CbColor7Base: { - const auto col_buf_id = (reg_addr - ContextRegs::CbColor0Base) / - (ContextRegs::CbColor1Base - ContextRegs::CbColor0Base); - ASSERT(col_buf_id < NumColorBuffers); - - const auto nop_offset = header->type3.count; - if (nop_offset == 0x0e || nop_offset == 0x0d || nop_offset == 0x0b) { - ASSERT_MSG(payload[nop_offset] == 0xc0001000, - "NOP hint is missing in CB setup sequence"); - last_cb_extent[col_buf_id].raw = payload[nop_offset + 1]; - } else { - last_cb_extent[col_buf_id].raw = 0; - } - break; - } - case ContextRegs::CbColor0Cmask: - case ContextRegs::CbColor1Cmask: - case ContextRegs::CbColor2Cmask: - case ContextRegs::CbColor3Cmask: - case ContextRegs::CbColor4Cmask: - case ContextRegs::CbColor5Cmask: - case ContextRegs::CbColor6Cmask: - case ContextRegs::CbColor7Cmask: { - const auto col_buf_id = (reg_addr - ContextRegs::CbColor0Cmask) / - (ContextRegs::CbColor1Cmask - ContextRegs::CbColor0Cmask); - ASSERT(col_buf_id < NumColorBuffers); - - const auto nop_offset = header->type3.count; - if (nop_offset == 0x04) { - ASSERT_MSG(payload[nop_offset] == 0xc0001000, - "NOP hint is missing in CB setup sequence"); - last_cb_extent[col_buf_id].raw = payload[nop_offset + 1]; - } - break; - } - case ContextRegs::DbZInfo: { - if (header->type3.count == 8) { - ASSERT_MSG(payload[20] == 0xc0001000, - "NOP hint is missing in DB setup sequence"); - last_db_extent.raw = payload[21]; - } else { - last_db_extent.raw = 0; - } - break; - } - default: - break; - } - break; - } - case PM4ItOpcode::SetShReg: { - const auto* set_data = reinterpret_cast(header); - std::memcpy(®s.reg_array[ShRegWordOffset + set_data->reg_offset], header + 2, - (count - 1) * sizeof(u32)); - break; - } - case PM4ItOpcode::SetUconfigReg: { - const auto* set_data = reinterpret_cast(header); - std::memcpy(®s.reg_array[UconfigRegWordOffset + set_data->reg_offset], header + 2, - (count - 1) * sizeof(u32)); - break; - } - case PM4ItOpcode::IndexType: { - const auto* index_type = reinterpret_cast(header); - regs.index_buffer_type.raw = index_type->raw; - break; - } - case PM4ItOpcode::DrawIndex2: { - const auto* draw_index = reinterpret_cast(header); - regs.max_index_size = draw_index->max_size; - regs.index_base_address.base_addr_lo = draw_index->index_base_lo; - regs.index_base_address.base_addr_hi.Assign(draw_index->index_base_hi); - regs.num_indices = draw_index->index_count; - regs.draw_initiator = draw_index->draw_initiator; - if (rasterizer) { - const auto cmd_address = reinterpret_cast(header); - rasterizer->ScopeMarkerBegin(fmt::format("dcb:{}:DrawIndex2", cmd_address)); - rasterizer->Breadcrumb(u64(cmd_address)); - rasterizer->Draw(true); - rasterizer->ScopeMarkerEnd(); - } - break; - } - case PM4ItOpcode::DrawIndexOffset2: { - const auto* draw_index_off = reinterpret_cast(header); - regs.max_index_size = draw_index_off->max_size; - regs.num_indices = draw_index_off->index_count; - regs.draw_initiator = draw_index_off->draw_initiator; - if (rasterizer) { - const auto cmd_address = reinterpret_cast(header); - rasterizer->ScopeMarkerBegin(fmt::format("dcb:{}:DrawIndexOffset2", cmd_address)); - rasterizer->Breadcrumb(u64(cmd_address)); - rasterizer->Draw(true, draw_index_off->index_offset); - rasterizer->ScopeMarkerEnd(); - } - break; - } - case PM4ItOpcode::DrawIndexAuto: { - const auto* draw_index = reinterpret_cast(header); - regs.num_indices = draw_index->index_count; - regs.draw_initiator = draw_index->draw_initiator; - if (rasterizer) { - const auto cmd_address = reinterpret_cast(header); - rasterizer->ScopeMarkerBegin(fmt::format("dcb:{}:DrawIndexAuto", cmd_address)); - rasterizer->Breadcrumb(u64(cmd_address)); - rasterizer->Draw(false); - rasterizer->ScopeMarkerEnd(); - } - break; - } - case PM4ItOpcode::DispatchDirect: { - const auto* dispatch_direct = reinterpret_cast(header); - regs.cs_program.dim_x = dispatch_direct->dim_x; - regs.cs_program.dim_y = dispatch_direct->dim_y; - regs.cs_program.dim_z = dispatch_direct->dim_z; - regs.cs_program.dispatch_initiator = dispatch_direct->dispatch_initiator; - if (rasterizer && (regs.cs_program.dispatch_initiator & 1)) { - const auto cmd_address = reinterpret_cast(header); - rasterizer->ScopeMarkerBegin(fmt::format("dcb:{}:Dispatch", cmd_address)); - rasterizer->Breadcrumb(u64(cmd_address)); - rasterizer->DispatchDirect(); - rasterizer->ScopeMarkerEnd(); - } - break; - } - case PM4ItOpcode::NumInstances: { - const auto* num_instances = reinterpret_cast(header); - regs.num_instances.num_instances = num_instances->num_instances; - break; - } - case PM4ItOpcode::IndexBase: { - const auto* index_base = reinterpret_cast(header); - regs.index_base_address.base_addr_lo = index_base->addr_lo; - regs.index_base_address.base_addr_hi.Assign(index_base->addr_hi); - break; - } - case PM4ItOpcode::IndexBufferSize: { - const auto* index_size = reinterpret_cast(header); - regs.num_indices = index_size->num_indices; - break; - } - case PM4ItOpcode::EventWrite: { - // const auto* event = reinterpret_cast(header); - break; - } - case PM4ItOpcode::EventWriteEos: { - const auto* event_eos = reinterpret_cast(header); - event_eos->SignalFence(); - break; - } - case PM4ItOpcode::EventWriteEop: { - const auto* event_eop = reinterpret_cast(header); - event_eop->SignalFence(); - break; - } - case PM4ItOpcode::DmaData: { - const auto* dma_data = reinterpret_cast(header); - break; - } - case PM4ItOpcode::WriteData: { - const auto* write_data = reinterpret_cast(header); - ASSERT(write_data->dst_sel.Value() == 2 || write_data->dst_sel.Value() == 5); - const u32 data_size = (header->type3.count.Value() - 2) * 4; - u64* address = write_data->Address(); - if (!write_data->wr_one_addr.Value()) { - std::memcpy(address, write_data->data, data_size); - } else { - UNREACHABLE(); - } - break; - } - case PM4ItOpcode::AcquireMem: { - // const auto* acquire_mem = reinterpret_cast(header); - break; - } - case PM4ItOpcode::WaitRegMem: { - const auto* wait_reg_mem = reinterpret_cast(header); - // ASSERT(wait_reg_mem->engine.Value() == PM4CmdWaitRegMem::Engine::Me); - // Optimization: VO label waits are special because the emulator - // will write to the label when presentation is finished. So if - // there are no other submits to yield to we can sleep the thread - // instead and allow other tasks to run. - const u64* wait_addr = wait_reg_mem->Address(); - if (vo_port->IsVoLabel(wait_addr) && num_submits == 1) { - vo_port->WaitVoLabel([&] { return wait_reg_mem->Test(); }); - } - while (!wait_reg_mem->Test()) { - mapped_queues[GfxQueueId].cs_state = regs.cs_program; - TracyFiberLeave; - co_yield {}; - TracyFiberEnter(dcb_task_name); - regs.cs_program = mapped_queues[GfxQueueId].cs_state; - } - break; - } - case PM4ItOpcode::IncrementDeCounter: { - ++cblock.de_count; - break; - } - case PM4ItOpcode::WaitOnCeCounter: { - while (cblock.ce_count <= cblock.de_count) { - TracyFiberLeave; - ce_task.handle.resume(); - TracyFiberEnter(dcb_task_name); - } - break; - } - default: - UNREACHABLE_MSG("Unknown PM4 type 3 opcode {:#x} with count {}", - static_cast(opcode), count); - } - dcb = dcb.subspan(header->type3.NumWords() + 1); } if (ce_task.handle) { @@ -564,9 +580,43 @@ Liverpool::Task Liverpool::ProcessCompute(std::span acb, int vqid) { TracyFiberLeave; } +std::pair, std::span> Liverpool::CopyCmdBuffers( + std::span dcb, std::span ccb) { + auto& queue = mapped_queues[GfxQueueId]; + + queue.dcb_buffer.resize( + std::max(queue.dcb_buffer.size(), queue.dcb_buffer_offset + dcb.size())); + queue.ccb_buffer.resize( + std::max(queue.ccb_buffer.size(), queue.ccb_buffer_offset + ccb.size())); + + u32 prev_dcb_buffer_offset = queue.dcb_buffer_offset; + u32 prev_ccb_buffer_offset = queue.ccb_buffer_offset; + if (!dcb.empty()) { + std::memcpy(queue.dcb_buffer.data() + queue.dcb_buffer_offset, dcb.data(), + dcb.size_bytes()); + queue.dcb_buffer_offset += dcb.size(); + dcb = std::span{queue.dcb_buffer.begin() + prev_dcb_buffer_offset, + queue.dcb_buffer.begin() + queue.dcb_buffer_offset}; + } + + if (!ccb.empty()) { + std::memcpy(queue.ccb_buffer.data() + queue.ccb_buffer_offset, ccb.data(), + ccb.size_bytes()); + queue.ccb_buffer_offset += ccb.size(); + ccb = std::span{queue.ccb_buffer.begin() + prev_ccb_buffer_offset, + queue.ccb_buffer.begin() + queue.ccb_buffer_offset}; + } + + return std::make_pair(dcb, ccb); +} + void Liverpool::SubmitGfx(std::span dcb, std::span ccb) { auto& queue = mapped_queues[GfxQueueId]; + if (Config::copyGPUCmdBuffers()) { + std::tie(dcb, ccb) = CopyCmdBuffers(dcb, ccb); + } + auto task = ProcessGraphics(dcb, ccb); { std::scoped_lock lock{queue.m_access}; diff --git a/src/video_core/amdgpu/liverpool.h b/src/video_core/amdgpu/liverpool.h index 595c98f56..14284bbc6 100644 --- a/src/video_core/amdgpu/liverpool.h +++ b/src/video_core/amdgpu/liverpool.h @@ -10,6 +10,7 @@ #include #include #include +#include #include #include "common/assert.h" @@ -556,7 +557,7 @@ struct Liverpool { union { BitField<0, 15, s32> top_left_x; BitField<15, 15, s32> top_left_y; - BitField<30, 1, s32> window_offset_disble; + BitField<30, 1, s32> window_offset_disable; }; union { BitField<0, 15, s32> bottom_right_x; @@ -1017,6 +1018,8 @@ struct Liverpool { } return nullptr; } + + void SetDefaults(); }; Regs regs{}; @@ -1045,6 +1048,8 @@ public: void SubmitDone() noexcept { std::scoped_lock lk{submit_mutex}; + mapped_queues[GfxQueueId].ccb_buffer_offset = 0; + mapped_queues[GfxQueueId].dcb_buffer_offset = 0; submit_done = true; submit_cv.notify_one(); } @@ -1106,6 +1111,8 @@ private: Handle handle; }; + std::pair, std::span> CopyCmdBuffers(std::span dcb, + std::span ccb); Task ProcessGraphics(std::span dcb, std::span ccb); Task ProcessCeUpdate(std::span ccb); Task ProcessCompute(std::span acb, int vqid); @@ -1114,6 +1121,10 @@ private: struct GpuQueue { std::mutex m_access{}; + std::atomic dcb_buffer_offset; + std::atomic ccb_buffer_offset; + std::vector dcb_buffer; + std::vector ccb_buffer; std::queue submits{}; ComputeProgram cs_state{}; }; diff --git a/src/video_core/amdgpu/pm4_opcodes.h b/src/video_core/amdgpu/pm4_opcodes.h index fba0cbb9f..83c1deaa4 100644 --- a/src/video_core/amdgpu/pm4_opcodes.h +++ b/src/video_core/amdgpu/pm4_opcodes.h @@ -48,7 +48,7 @@ enum class PM4ItOpcode : u32 { EventWriteEop = 0x47, EventWriteEos = 0x48, ReleaseMem = 0x49, - PremableCntl = 0x4A, + PreambleCntl = 0x4A, DmaData = 0x50, ContextRegRmw = 0x51, AcquireMem = 0x58, diff --git a/src/video_core/buffer_cache/buffer.h b/src/video_core/buffer_cache/buffer.h index d373fbffb..87293c768 100644 --- a/src/video_core/buffer_cache/buffer.h +++ b/src/video_core/buffer_cache/buffer.h @@ -4,6 +4,7 @@ #pragma once #include +#include #include #include #include "common/types.h" @@ -38,9 +39,9 @@ struct UniqueBuffer { UniqueBuffer& operator=(const UniqueBuffer&) = delete; UniqueBuffer(UniqueBuffer&& other) - : buffer{std::exchange(other.buffer, VK_NULL_HANDLE)}, - allocator{std::exchange(other.allocator, VK_NULL_HANDLE)}, - allocation{std::exchange(other.allocation, VK_NULL_HANDLE)} {} + : allocator{std::exchange(other.allocator, VK_NULL_HANDLE)}, + allocation{std::exchange(other.allocation, VK_NULL_HANDLE)}, + buffer{std::exchange(other.buffer, VK_NULL_HANDLE)} {} UniqueBuffer& operator=(UniqueBuffer&& other) { buffer = std::exchange(other.buffer, VK_NULL_HANDLE); allocator = std::exchange(other.allocator, VK_NULL_HANDLE); diff --git a/src/video_core/host_shaders/detile_m8x1.comp b/src/video_core/host_shaders/detile_m8x1.comp index 5ec48fae2..3ca2e64bd 100644 --- a/src/video_core/host_shaders/detile_m8x1.comp +++ b/src/video_core/host_shaders/detile_m8x1.comp @@ -4,7 +4,7 @@ #version 450 #extension GL_KHR_shader_subgroup_shuffle : require -// NOTE: Current subgroup utilization is subotimal on most GPUs, so +// NOTE: Current subgroup utilization is suboptimal on most GPUs, so // it will be nice to process two tiles at once here. layout (local_size_x = 16, local_size_y = 1, local_size_z = 1) in; diff --git a/src/video_core/host_shaders/detile_m8x2.comp b/src/video_core/host_shaders/detile_m8x2.comp index d27bc6e2d..ee9b72810 100644 --- a/src/video_core/host_shaders/detile_m8x2.comp +++ b/src/video_core/host_shaders/detile_m8x2.comp @@ -3,7 +3,7 @@ #version 450 -// NOTE: Current subgroup utilization is subotimal on most GPUs, so +// NOTE: Current subgroup utilization is suboptimal on most GPUs, so // it will be nice to process two tiles at once here. layout (local_size_x = 32, local_size_y = 1, local_size_z = 1) in; diff --git a/src/video_core/renderer_vulkan/liverpool_to_vk.cpp b/src/video_core/renderer_vulkan/liverpool_to_vk.cpp index c42e4f609..3ae19a82a 100644 --- a/src/video_core/renderer_vulkan/liverpool_to_vk.cpp +++ b/src/video_core/renderer_vulkan/liverpool_to_vk.cpp @@ -296,6 +296,7 @@ std::span GetAllFormats() { vk::Format::eB10G11R11UfloatPack32, vk::Format::eBc1RgbaSrgbBlock, vk::Format::eBc1RgbaUnormBlock, + vk::Format::eBc2SrgbBlock, vk::Format::eBc2UnormBlock, vk::Format::eBc3SrgbBlock, vk::Format::eBc3UnormBlock, @@ -320,6 +321,7 @@ std::span GetAllFormats() { vk::Format::eR8G8Uint, vk::Format::eR8G8Unorm, vk::Format::eR8Sint, + vk::Format::eR8Snorm, vk::Format::eR8Uint, vk::Format::eR8Unorm, vk::Format::eR8Srgb, @@ -451,12 +453,18 @@ vk::Format SurfaceFormat(AmdGpu::DataFormat data_format, AmdGpu::NumberFormat nu if (data_format == AmdGpu::DataFormat::Format8_8 && num_format == AmdGpu::NumberFormat::Unorm) { return vk::Format::eR8G8Unorm; } + if (data_format == AmdGpu::DataFormat::Format8_8 && num_format == AmdGpu::NumberFormat::Uint) { + return vk::Format::eR8G8Uint; + } if (data_format == AmdGpu::DataFormat::Format8_8 && num_format == AmdGpu::NumberFormat::Snorm) { return vk::Format::eR8G8Snorm; } if (data_format == AmdGpu::DataFormat::FormatBc7 && num_format == AmdGpu::NumberFormat::Unorm) { return vk::Format::eBc7UnormBlock; } + if (data_format == AmdGpu::DataFormat::FormatBc2 && num_format == AmdGpu::NumberFormat::Srgb) { + return vk::Format::eBc2SrgbBlock; + } if (data_format == AmdGpu::DataFormat::FormatBc2 && num_format == AmdGpu::NumberFormat::Unorm) { return vk::Format::eBc2UnormBlock; } diff --git a/src/video_core/renderer_vulkan/renderer_vulkan.cpp b/src/video_core/renderer_vulkan/renderer_vulkan.cpp index c78d629e4..b12708088 100644 --- a/src/video_core/renderer_vulkan/renderer_vulkan.cpp +++ b/src/video_core/renderer_vulkan/renderer_vulkan.cpp @@ -258,7 +258,7 @@ void RendererVulkan::Present(Frame* frame) { { auto* profiler_ctx = instance.GetProfilerContext(); TracyVkNamedZoneC(profiler_ctx, renderer_gpu_zone, cmdbuf, "Host frame", - MarkersPallete::GpuMarkerColor, profiler_ctx != nullptr); + MarkersPalette::GpuMarkerColor, profiler_ctx != nullptr); const vk::Extent2D extent = swapchain.GetExtent(); const std::array pre_barriers{ @@ -380,7 +380,7 @@ Frame* RendererVulkan::GetRenderFrame() { // Reset fence for next queue submission. device.resetFences(frame->present_done); - // If the window dimentions changed, recreate this frame + // If the window dimensions changed, recreate this frame if (frame->width != window.getWidth() || frame->height != window.getHeight()) { RecreateFrame(frame, window.getWidth(), window.getHeight()); } diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp index 95d3a4b2d..5623e431c 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp @@ -94,7 +94,7 @@ GraphicsPipeline::GraphicsPipeline(const Instance& instance_, Scheduler& schedul .depthClampEnable = false, .rasterizerDiscardEnable = false, .polygonMode = LiverpoolToVK::PolygonMode(key.polygon_mode), - .cullMode = vk::CullModeFlagBits::eNone /*LiverpoolToVK::CullMode(key.cull_mode)*/, + .cullMode = LiverpoolToVK::CullMode(key.cull_mode), .frontFace = key.front_face == Liverpool::FrontFace::Clockwise ? vk::FrontFace::eClockwise : vk::FrontFace::eCounterClockwise, diff --git a/src/video_core/renderer_vulkan/vk_instance.cpp b/src/video_core/renderer_vulkan/vk_instance.cpp index 12db47576..19939a329 100644 --- a/src/video_core/renderer_vulkan/vk_instance.cpp +++ b/src/video_core/renderer_vulkan/vk_instance.cpp @@ -274,6 +274,7 @@ bool Instance::CreateDevice() { .independentBlend = features.independentBlend, .geometryShader = features.geometryShader, .logicOp = features.logicOp, + .depthBiasClamp = features.depthBiasClamp, .multiViewport = features.multiViewport, .samplerAnisotropy = features.samplerAnisotropy, .fragmentStoresAndAtomics = features.fragmentStoresAndAtomics, diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 3b02a98ab..f22f19eaf 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -138,8 +138,8 @@ void Rasterizer::BeginRendering() { using StencilFormat = AmdGpu::Liverpool::DepthBuffer::StencilFormat; if (regs.depth_buffer.Address() != 0 && ((regs.depth_control.depth_enable && regs.depth_buffer.z_info.format != ZFormat::Invalid) || - regs.depth_control.stencil_enable && - regs.depth_buffer.stencil_info.format != StencilFormat::Invalid)) { + (regs.depth_control.stencil_enable && + regs.depth_buffer.stencil_info.format != StencilFormat::Invalid))) { const auto htile_address = regs.depth_htile_data_base.GetAddress(); const bool is_clear = regs.depth_render_control.depth_clear_enable || texture_cache.IsMetaCleared(htile_address); @@ -243,7 +243,7 @@ void Rasterizer::UpdateDepthStencilState() { } void Rasterizer::ScopeMarkerBegin(const std::string_view& str) { - if (!Config::isMarkersEnabled()) { + if (Config::nullGpu() || !Config::isMarkersEnabled()) { return; } @@ -254,7 +254,7 @@ void Rasterizer::ScopeMarkerBegin(const std::string_view& str) { } void Rasterizer::ScopeMarkerEnd() { - if (!Config::isMarkersEnabled()) { + if (Config::nullGpu() || !Config::isMarkersEnabled()) { return; } @@ -263,7 +263,7 @@ void Rasterizer::ScopeMarkerEnd() { } void Rasterizer::ScopedMarkerInsert(const std::string_view& str) { - if (!Config::isMarkersEnabled()) { + if (Config::nullGpu() || !Config::isMarkersEnabled()) { return; } @@ -274,7 +274,7 @@ void Rasterizer::ScopedMarkerInsert(const std::string_view& str) { } void Rasterizer::Breadcrumb(u64 id) { - if (!instance.HasNvCheckpoints()) { + if (Config::nullGpu() || !instance.HasNvCheckpoints()) { return; } scheduler.CommandBuffer().setCheckpointNV(id); diff --git a/src/video_core/renderer_vulkan/vk_scheduler.cpp b/src/video_core/renderer_vulkan/vk_scheduler.cpp index ef0307efd..2f1f13d72 100644 --- a/src/video_core/renderer_vulkan/vk_scheduler.cpp +++ b/src/video_core/renderer_vulkan/vk_scheduler.cpp @@ -145,7 +145,7 @@ void Scheduler::AllocateWorkerCommandBuffers() { auto* profiler_ctx = instance.GetProfilerContext(); if (profiler_ctx) { static const auto scope_loc = - GPU_SCOPE_LOCATION("Guest Frame", MarkersPallete::GpuMarkerColor); + GPU_SCOPE_LOCATION("Guest Frame", MarkersPalette::GpuMarkerColor); new (profiler_scope) tracy::VkCtxScope{profiler_ctx, &scope_loc, current_cmdbuf, true}; } } diff --git a/src/video_core/texture_cache/image.h b/src/video_core/texture_cache/image.h index 5a888346f..3df8ddb70 100644 --- a/src/video_core/texture_cache/image.h +++ b/src/video_core/texture_cache/image.h @@ -43,9 +43,9 @@ struct UniqueImage { UniqueImage& operator=(const UniqueImage&) = delete; UniqueImage(UniqueImage&& other) - : image{std::exchange(other.image, VK_NULL_HANDLE)}, - allocator{std::exchange(other.allocator, VK_NULL_HANDLE)}, - allocation{std::exchange(other.allocation, VK_NULL_HANDLE)} {} + : allocator{std::exchange(other.allocator, VK_NULL_HANDLE)}, + allocation{std::exchange(other.allocation, VK_NULL_HANDLE)}, + image{std::exchange(other.image, VK_NULL_HANDLE)} {} UniqueImage& operator=(UniqueImage&& other) { image = std::exchange(other.image, VK_NULL_HANDLE); allocator = std::exchange(other.allocator, VK_NULL_HANDLE); diff --git a/src/video_core/texture_cache/image_info.cpp b/src/video_core/texture_cache/image_info.cpp index a073d046e..4ac4aee8f 100644 --- a/src/video_core/texture_cache/image_info.cpp +++ b/src/video_core/texture_cache/image_info.cpp @@ -34,6 +34,7 @@ static vk::ImageType ConvertImageType(AmdGpu::ImageType type) noexcept { case AmdGpu::ImageType::Color1DArray: return vk::ImageType::e1D; case AmdGpu::ImageType::Color2D: + case AmdGpu::ImageType::Color2DMsaa: case AmdGpu::ImageType::Cube: case AmdGpu::ImageType::Color2DArray: return vk::ImageType::e2D; diff --git a/src/video_core/texture_cache/image_view.cpp b/src/video_core/texture_cache/image_view.cpp index cbf77f2d8..00c3833fe 100644 --- a/src/video_core/texture_cache/image_view.cpp +++ b/src/video_core/texture_cache/image_view.cpp @@ -2,6 +2,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include "common/logging/log.h" +#include "video_core/amdgpu/resource.h" #include "video_core/renderer_vulkan/liverpool_to_vk.h" #include "video_core/renderer_vulkan/vk_instance.h" #include "video_core/texture_cache/image.h" @@ -16,6 +17,7 @@ vk::ImageViewType ConvertImageViewType(AmdGpu::ImageType type) { case AmdGpu::ImageType::Color1DArray: return vk::ImageViewType::e1DArray; case AmdGpu::ImageType::Color2D: + case AmdGpu::ImageType::Color2DMsaa: return vk::ImageViewType::e2D; case AmdGpu::ImageType::Cube: return vk::ImageViewType::eCube; @@ -58,6 +60,9 @@ vk::Format TrySwizzleFormat(vk::Format format, u32 dst_sel) { if (format == vk::Format::eR8G8B8A8Unorm && dst_sel == 0b111100101110) { return vk::Format::eB8G8R8A8Unorm; } + if (format == vk::Format::eR8G8B8A8Srgb && dst_sel == 0b111100101110) { + return vk::Format::eB8G8R8A8Srgb; + } return format; } @@ -110,7 +115,7 @@ ImageViewInfo::ImageViewInfo(const AmdGpu::Liverpool::DepthBuffer& depth_buffer, ImageView::ImageView(const Vulkan::Instance& instance, const ImageViewInfo& info_, Image& image, ImageId image_id_, std::optional usage_override /*= {}*/) - : info{info_}, image_id{image_id_} { + : image_id{image_id_}, info{info_} { vk::ImageViewUsageCreateInfo usage_ci{}; if (usage_override) { usage_ci.usage = usage_override.value(); diff --git a/src/video_core/texture_cache/tile_manager.cpp b/src/video_core/texture_cache/tile_manager.cpp index 6bb104a66..0bed5adc2 100644 --- a/src/video_core/texture_cache/tile_manager.cpp +++ b/src/video_core/texture_cache/tile_manager.cpp @@ -342,12 +342,6 @@ TileManager::ScratchBuffer TileManager::AllocBuffer(u32 size, bool is_storage /* .usage = usage, }; -#ifdef __APPLE__ - // Fix for detiler artifacts on macOS - const bool is_large_buffer = true; -#else - const bool is_large_buffer = size > 128_MB; -#endif VmaAllocationCreateInfo alloc_info{ .flags = !is_storage ? VMA_ALLOCATION_CREATE_HOST_ACCESS_ALLOW_TRANSFER_INSTEAD_BIT | VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT @@ -462,7 +456,6 @@ std::optional TileManager::TryDetile(Image& image) { (m > 0 ? params.sizes[m - 1] : 0); } - auto pitch = image.info.pitch; cmdbuf.pushConstants(*detiler->pl_layout, vk::ShaderStageFlagBits::eCompute, 0u, sizeof(params), ¶ms);