Merge branch 'main' into filesystem_win

This commit is contained in:
Stephen Miller 2025-06-22 19:48:29 -05:00 committed by GitHub
commit 6277975bc4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
193 changed files with 10772 additions and 4681 deletions

View file

@ -76,18 +76,13 @@ jobs:
${{ env.cache-name }}-
- name: Cache CMake Build
uses: hendrikmuhs/ccache-action@v1.2.17
uses: hendrikmuhs/ccache-action@v1.2.18
env:
cache-name: ${{ runner.os }}-sdl-cache-cmake-build
with:
append-timestamp: false
key: ${{ env.cache-name }}-${{ hashFiles('**/CMakeLists.txt', 'cmake/**') }}
- name: Setup VS Environment
uses: ilammy/msvc-dev-cmd@v1.13.0
with:
arch: amd64
- name: Configure CMake
run: cmake --fresh -G Ninja -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE=ON -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
@ -111,7 +106,7 @@ jobs:
- name: Setup Qt
uses: jurplel/install-qt-action@v4
with:
version: 6.9.0
version: 6.9.1
host: windows
target: desktop
arch: win64_msvc2022_64
@ -130,18 +125,13 @@ jobs:
${{ env.cache-name }}-
- name: Cache CMake Build
uses: hendrikmuhs/ccache-action@v1.2.17
uses: hendrikmuhs/ccache-action@v1.2.18
env:
cache-name: ${{ runner.os }}-qt-cache-cmake-build
with:
append-timestamp: false
key: ${{ env.cache-name }}-${{ hashFiles('**/CMakeLists.txt', 'cmake/**') }}
- name: Setup VS Environment
uses: ilammy/msvc-dev-cmd@v1.13.0
with:
arch: amd64
- name: Configure CMake
run: cmake --fresh -G Ninja -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DENABLE_QT_GUI=ON -DENABLE_UPDATER=ON -DCMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE=ON -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
@ -186,7 +176,7 @@ jobs:
${{ env.cache-name }}-
- name: Cache CMake Build
uses: hendrikmuhs/ccache-action@v1.2.17
uses: hendrikmuhs/ccache-action@v1.2.18
env:
cache-name: ${{runner.os}}-sdl-cache-cmake-build
with:
@ -228,13 +218,16 @@ jobs:
- name: Setup Qt
uses: jurplel/install-qt-action@v4
with:
version: 6.9.0
version: 6.9.1
host: mac
target: desktop
arch: clang_64
archives: qtbase qttools
modules: qtmultimedia
- name: Workaround Qt <=6.9.1 issue
run: sed -i '' '/target_link_libraries(WrapOpenGL::WrapOpenGL INTERFACE ${__opengl_agl_fw_path})/d' ${{env.QT_ROOT_DIR}}/lib/cmake/Qt6/FindWrapOpenGL.cmake
- name: Cache CMake Configuration
uses: actions/cache@v4
env:
@ -247,7 +240,7 @@ jobs:
${{ env.cache-name }}-
- name: Cache CMake Build
uses: hendrikmuhs/ccache-action@v1.2.17
uses: hendrikmuhs/ccache-action@v1.2.18
env:
cache-name: ${{runner.os}}-qt-cache-cmake-build
with:
@ -301,7 +294,7 @@ jobs:
${{ env.cache-name }}-
- name: Cache CMake Build
uses: hendrikmuhs/ccache-action@v1.2.17
uses: hendrikmuhs/ccache-action@v1.2.18
env:
cache-name: ${{ runner.os }}-sdl-cache-cmake-build
with:
@ -362,7 +355,7 @@ jobs:
${{ env.cache-name }}-
- name: Cache CMake Build
uses: hendrikmuhs/ccache-action@v1.2.17
uses: hendrikmuhs/ccache-action@v1.2.18
env:
cache-name: ${{ runner.os }}-qt-cache-cmake-build
with:
@ -409,7 +402,7 @@ jobs:
${{ env.cache-name }}-
- name: Cache CMake Build
uses: hendrikmuhs/ccache-action@v1.2.17
uses: hendrikmuhs/ccache-action@v1.2.18
env:
cache-name: ${{ runner.os }}-sdl-gcc-cache-cmake-build
with:
@ -445,7 +438,7 @@ jobs:
${{ env.cache-name }}-
- name: Cache CMake Build
uses: hendrikmuhs/ccache-action@v1.2.17
uses: hendrikmuhs/ccache-action@v1.2.18
env:
cache-name: ${{ runner.os }}-qt-gcc-cache-cmake-build
with:
@ -494,7 +487,7 @@ jobs:
with:
token: ${{ secrets.SHADPS4_TOKEN_REPO }}
name: "Pre-release-shadPS4-${{ needs.get-info.outputs.date }}-${{ needs.get-info.outputs.shorthash }}"
tag: "Pre-release-shadPS4-${{ needs.get-info.outputs.date }}-${{ needs.get-info.outputs.shorthash }}"
tag: "Pre-release-shadPS4-${{ needs.get-info.outputs.date }}-${{ needs.get-info.outputs.fullhash }}"
draft: false
prerelease: true
body: "Full Changelog: [${{ env.last_release_tag }}...${{ needs.get-info.outputs.shorthash }}](https://github.com/shadps4-emu/shadPS4/compare/${{ env.last_release_tag }}...${{ needs.get-info.outputs.fullhash }})"
@ -530,14 +523,14 @@ jobs:
# Check if release already exists and get ID
release_id=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \
"https://api.github.com/repos/$REPO/releases/tags/Pre-release-shadPS4-${{ needs.get-info.outputs.date }}-${{ needs.get-info.outputs.shorthash }}" | jq -r '.id')
"https://api.github.com/repos/$REPO/releases/tags/Pre-release-shadPS4-${{ needs.get-info.outputs.date }}-${{ needs.get-info.outputs.fullhash }}" | jq -r '.id')
if [[ "$release_id" == "null" ]]; then
echo "Creating release in $REPO for $filename"
release_id=$(curl -s -X POST -H "Authorization: token $GITHUB_TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
-d '{
"tag_name": "Pre-release-shadPS4-${{ needs.get-info.outputs.date }}-${{ needs.get-info.outputs.shorthash }}",
"tag_name": "Pre-release-shadPS4-${{ needs.get-info.outputs.date }}-${{ needs.get-info.outputs.fullhash }}",
"name": "Pre-release-shadPS4-${{ needs.get-info.outputs.date }}-${{ needs.get-info.outputs.shorthash }}",
"draft": false,
"prerelease": true,

View file

@ -653,6 +653,7 @@ set(COMMON src/common/logging/backend.cpp
src/common/arch.h
src/common/assert.cpp
src/common/assert.h
src/common/bit_array.h
src/common/bit_field.h
src/common/bounded_threadsafe_queue.h
src/common/concepts.h
@ -870,6 +871,7 @@ set(SHADER_RECOMPILER src/shader_recompiler/exception.h
src/shader_recompiler/ir/passes/ring_access_elimination.cpp
src/shader_recompiler/ir/passes/shader_info_collection_pass.cpp
src/shader_recompiler/ir/passes/shared_memory_barrier_pass.cpp
src/shader_recompiler/ir/passes/shared_memory_simplify_pass.cpp
src/shader_recompiler/ir/passes/shared_memory_to_storage_pass.cpp
src/shader_recompiler/ir/passes/ssa_rewrite_pass.cpp
src/shader_recompiler/ir/abstract_syntax_list.cpp
@ -912,9 +914,10 @@ set(VIDEO_CORE src/video_core/amdgpu/liverpool.cpp
src/video_core/buffer_cache/buffer.h
src/video_core/buffer_cache/buffer_cache.cpp
src/video_core/buffer_cache/buffer_cache.h
src/video_core/buffer_cache/memory_tracker_base.h
src/video_core/buffer_cache/memory_tracker.h
src/video_core/buffer_cache/range_set.h
src/video_core/buffer_cache/word_manager.h
src/video_core/buffer_cache/region_definitions.h
src/video_core/buffer_cache/region_manager.h
src/video_core/renderer_vulkan/liverpool_to_vk.cpp
src/video_core/renderer_vulkan/liverpool_to_vk.h
src/video_core/renderer_vulkan/vk_common.cpp
@ -951,6 +954,10 @@ set(VIDEO_CORE src/video_core/amdgpu/liverpool.cpp
src/video_core/renderer_vulkan/host_passes/fsr_pass.h
src/video_core/renderer_vulkan/host_passes/pp_pass.cpp
src/video_core/renderer_vulkan/host_passes/pp_pass.h
src/video_core/texture_cache/blit_helper.cpp
src/video_core/texture_cache/blit_helper.h
src/video_core/texture_cache/host_compatibility.cpp
src/video_core/texture_cache/host_compatibility.h
src/video_core/texture_cache/image.cpp
src/video_core/texture_cache/image.h
src/video_core/texture_cache/image_info.cpp
@ -964,7 +971,6 @@ set(VIDEO_CORE src/video_core/amdgpu/liverpool.cpp
src/video_core/texture_cache/tile_manager.cpp
src/video_core/texture_cache/tile_manager.h
src/video_core/texture_cache/types.h
src/video_core/texture_cache/host_compatibility.h
src/video_core/page_manager.cpp
src/video_core/page_manager.h
src/video_core/multi_level_page_table.h
@ -1053,6 +1059,10 @@ set(QT_GUI src/qt_gui/about_dialog.cpp
src/qt_gui/settings_dialog.h
src/qt_gui/settings_dialog.ui
src/qt_gui/main.cpp
src/qt_gui/gui_settings.cpp
src/qt_gui/gui_settings.h
src/qt_gui/settings.cpp
src/qt_gui/settings.h
${EMULATOR}
${RESOURCE_FILES}
${TRANSLATIONS}
@ -1118,6 +1128,10 @@ if (APPLE)
set(MVK_BUNDLE_PATH "Resources/vulkan/icd.d")
set_property(TARGET shadps4 APPEND PROPERTY BUILD_RPATH "@executable_path/../${MVK_BUNDLE_PATH}")
set(MVK_DST ${CMAKE_CURRENT_BINARY_DIR}/shadps4.app/Contents/${MVK_BUNDLE_PATH})
add_custom_command(
OUTPUT ${MVK_DST}
COMMAND ${CMAKE_COMMAND} -E make_directory ${MVK_DST})
else()
set_property(TARGET shadps4 APPEND PROPERTY BUILD_RPATH "@executable_path")
set(MVK_DST ${CMAKE_CURRENT_BINARY_DIR})
@ -1128,9 +1142,6 @@ if (APPLE)
set(MVK_ICD_SRC ${CMAKE_CURRENT_SOURCE_DIR}/externals/MoltenVK/MoltenVK/MoltenVK/icd/MoltenVK_icd.json)
set(MVK_ICD_DST ${MVK_DST}/MoltenVK_icd.json)
add_custom_command(
OUTPUT ${MVK_DST}
COMMAND ${CMAKE_COMMAND} -E make_directory ${MVK_DST})
add_custom_command(
OUTPUT ${MVK_ICD_DST}
DEPENDS ${MVK_ICD_SRC} ${MVK_DST}
@ -1145,17 +1156,13 @@ if (APPLE)
if (ARCHITECTURE STREQUAL "x86_64")
# Reserve system-managed memory space.
target_link_options(shadps4 PRIVATE -Wl,-no_pie,-no_fixup_chains,-no_huge,-pagezero_size,0x4000,-segaddr,TCB_SPACE,0x4000,-segaddr,SYSTEM_MANAGED,0x400000,-segaddr,SYSTEM_RESERVED,0x7FFFFC000,-image_base,0x20000000000)
target_link_options(shadps4 PRIVATE -Wl,-ld_classic,-no_pie,-no_fixup_chains,-no_huge,-pagezero_size,0x4000,-segaddr,TCB_SPACE,0x4000,-segaddr,SYSTEM_MANAGED,0x400000,-segaddr,SYSTEM_RESERVED,0x7FFFFC000,-image_base,0x20000000000)
endif()
# Replacement for std::chrono::time_zone
target_link_libraries(shadps4 PRIVATE date::date-tz)
endif()
if (NOT ENABLE_QT_GUI)
target_link_libraries(shadps4 PRIVATE SDL3::SDL3)
endif()
if (ENABLE_QT_GUI)
target_link_libraries(shadps4 PRIVATE Qt6::Widgets Qt6::Concurrent Qt6::Network Qt6::Multimedia)
add_definitions(-DENABLE_QT_GUI)

View file

@ -36,7 +36,7 @@ SPDX-License-Identifier: GPL-2.0-or-later
**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).\
If you encounter problems or have doubts, do not hesitate to look at the [**Quickstart**](https://github.com/shadps4-emu/shadPS4/wiki/I.-Quick-start-%5BUsers%5D).\
To verify that a game works, you can look at [**shadPS4 Game Compatibility**](https://github.com/shadps4-emu/shadps4-game-compatibility).\
To discuss shadPS4 development, suggest ideas or to ask for help, join our [**Discord server**](https://discord.gg/bFJxfftGW6).\
To get the latest news, go to our [**X (Twitter)**](https://x.com/shadps4) or our [**website**](https://shadps4.net/).\
@ -124,8 +124,8 @@ Keyboard and mouse inputs can be customized in the settings menu by clicking the
# Firmware files
shadPS4 can load some PlayStation 4 firmware files, these must be dumped from your legally owned PlayStation 4 console.\
The following firmware modules are supported and must be placed in shadPS4's `user/sys_modules` folder.
shadPS4 can load some PlayStation 4 firmware files, these must be dumped from your legally owned PlayStation 4 console.
The following firmware modules are supported and must be placed in shadPS4's `sys_modules` folder.
<div align="center">
@ -138,8 +138,7 @@ The following firmware modules are supported and must be placed in shadPS4's `us
</div>
> [!Caution]
> The above modules are required to run the games properly and must be extracted from your PlayStation 4.\
> **We do not provide any information or support on how to do this**.
> The above modules are required to run the games properly and must be extracted from your PlayStation 4.
@ -148,7 +147,7 @@ The following firmware modules are supported and must be placed in shadPS4's `us
- [**georgemoralis**](https://github.com/georgemoralis)
- [**psucien**](https://github.com/psucien)
- [**viniciuslrangel**](https://github.com/viniciuslrangel)
- [**roamic**](https://github.com/vladmikhalin)
- [**roamic**](https://github.com/roamic)
- [**squidbus**](https://github.com/squidbus)
- [**frodo**](https://github.com/baggins183)
- [**Stephen Miller**](https://github.com/StevenMiller123)
@ -158,7 +157,7 @@ Logo is done by [**Xphalnos**](https://github.com/Xphalnos)
# Contributing
If you want to contribute, please look the [**CONTRIBUTING.md**](https://github.com/shadps4-emu/shadPS4/blob/main/CONTRIBUTING.md) file.\
If you want to contribute, please read the [**CONTRIBUTING.md**](https://github.com/shadps4-emu/shadPS4/blob/main/CONTRIBUTING.md) file.\
Open a PR and we'll check it :)
# Translations

View file

@ -29,6 +29,7 @@ path = [
"src/images/discord.png",
"src/images/dump_icon.png",
"src/images/exit_icon.png",
"src/images/favorite_icon.png",
"src/images/file_icon.png",
"src/images/trophy_icon.png",
"src/images/flag_china.png",

View file

@ -25,7 +25,7 @@ sudo apt install build-essential clang git cmake libasound2-dev \
```bash
sudo dnf install clang git cmake libatomic alsa-lib-devel \
pipewire-jack-audio-connection-kit-devel openal-devel \
pipewire-jack-audio-connection-kit-devel openal-soft-devel \
openssl-devel libevdev-devel libudev-devel libXext-devel \
qt6-qtbase-devel qt6-qtbase-private-devel \
qt6-qtmultimedia-devel qt6-qtsvg-devel qt6-qttools-devel \
@ -74,6 +74,7 @@ and install the dependencies on that container as cited above.
This option is **highly recommended** for distributions with immutable/atomic filesystems (example: Fedora Kinoite, SteamOS).
### Cloning
The project uses submodules to manage dependencies, and they need to be initialized before you can build the project. To achieve this, make sure you've cloned the repository with the --recursive flag
```bash
git clone --recursive https://github.com/shadps4-emu/shadPS4.git

@ -1 +1 @@
Subproject commit 3a0b07a24a4a681ffe70b461b1f4333b2729e2ef
Subproject commit 00abd384ce01cbd439045905d2fa6cf799dfa2f6

@ -1 +1 @@
Subproject commit 969e75f7cc0718774231d029f9d52fa87d4ae1b2
Subproject commit 1a69a919fa302e92b337594bd0a8aaea61037d91

411
src/common/bit_array.h Normal file
View file

@ -0,0 +1,411 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <array>
#include <cstddef>
#include "common/types.h"
#ifdef __AVX2__
#define BIT_ARRAY_USE_AVX
#include <immintrin.h>
#endif
namespace Common {
template <size_t N>
class BitArray {
static_assert(N % 64 == 0, "BitArray size must be a multiple of 64 bits.");
static constexpr size_t BITS_PER_WORD = 64;
static constexpr size_t WORD_COUNT = N / BITS_PER_WORD;
static constexpr size_t WORDS_PER_AVX = 4;
static constexpr size_t AVX_WORD_COUNT = WORD_COUNT / WORDS_PER_AVX;
public:
using Range = std::pair<size_t, size_t>;
class Iterator {
public:
explicit Iterator(const BitArray& bit_array_, u64 start) : bit_array(bit_array_) {
range = bit_array.FirstRangeFrom(start);
}
Iterator& operator++() {
range = bit_array.FirstRangeFrom(range.second);
return *this;
}
bool operator==(const Iterator& other) const {
return range == other.range;
}
bool operator!=(const Iterator& other) const {
return !(*this == other);
}
const Range& operator*() const {
return range;
}
const Range* operator->() const {
return &range;
}
private:
const BitArray& bit_array;
Range range;
};
using const_iterator = Iterator;
using iterator_category = std::forward_iterator_tag;
using value_type = Range;
using difference_type = std::ptrdiff_t;
using pointer = const Range*;
using reference = const Range&;
BitArray() = default;
BitArray(const BitArray& other) = default;
BitArray& operator=(const BitArray& other) = default;
BitArray(BitArray&& other) noexcept = default;
BitArray& operator=(BitArray&& other) noexcept = default;
~BitArray() = default;
BitArray(const BitArray& other, size_t start, size_t end) {
if (start >= end || end > N) {
return;
}
const size_t first_word = start / BITS_PER_WORD;
const size_t last_word = (end - 1) / BITS_PER_WORD;
const size_t start_bit = start % BITS_PER_WORD;
const size_t end_bit = (end - 1) % BITS_PER_WORD;
const u64 start_mask = ~((1ULL << start_bit) - 1);
const u64 end_mask = end_bit == BITS_PER_WORD - 1 ? ~0ULL : (1ULL << (end_bit + 1)) - 1;
if (first_word == last_word) {
data[first_word] = other.data[first_word] & (start_mask & end_mask);
} else {
data[first_word] = other.data[first_word] & start_mask;
size_t i = first_word + 1;
#ifdef BIT_ARRAY_USE_AVX
for (; i + WORDS_PER_AVX <= last_word; i += WORDS_PER_AVX) {
const __m256i current =
_mm256_loadu_si256(reinterpret_cast<const __m256i*>(&other.data[i]));
_mm256_storeu_si256(reinterpret_cast<__m256i*>(&data[i]), current);
}
#endif
for (; i < last_word; ++i) {
data[i] = other.data[i];
}
data[last_word] = other.data[last_word] & end_mask;
}
}
BitArray(const BitArray& other, const Range& range)
: BitArray(other, range.first, range.second) {}
const_iterator begin() const {
return Iterator(*this, 0);
}
const_iterator end() const {
return Iterator(*this, N);
}
inline constexpr void Set(size_t idx) {
data[idx / BITS_PER_WORD] |= (1ULL << (idx % BITS_PER_WORD));
}
inline constexpr void Unset(size_t idx) {
data[idx / BITS_PER_WORD] &= ~(1ULL << (idx % BITS_PER_WORD));
}
inline constexpr bool Get(size_t idx) const {
return (data[idx / BITS_PER_WORD] & (1ULL << (idx % BITS_PER_WORD))) != 0;
}
inline void SetRange(size_t start, size_t end) {
if (start >= end || end > N) {
return;
}
const size_t first_word = start / BITS_PER_WORD;
const size_t last_word = (end - 1) / BITS_PER_WORD;
const size_t start_bit = start % BITS_PER_WORD;
const size_t end_bit = (end - 1) % BITS_PER_WORD;
const u64 start_mask = ~((1ULL << start_bit) - 1);
const u64 end_mask = end_bit == BITS_PER_WORD - 1 ? ~0ULL : (1ULL << (end_bit + 1)) - 1;
if (first_word == last_word) {
data[first_word] |= start_mask & end_mask;
} else {
data[first_word] |= start_mask;
size_t i = first_word + 1;
#ifdef BIT_ARRAY_USE_AVX
const __m256i value = _mm256_set1_epi64x(-1);
for (; i + WORDS_PER_AVX <= last_word; i += WORDS_PER_AVX) {
_mm256_storeu_si256(reinterpret_cast<__m256i*>(&data[i]), value);
}
#endif
for (; i < last_word; ++i) {
data[i] = ~0ULL;
}
data[last_word] |= end_mask;
}
}
inline void UnsetRange(size_t start, size_t end) {
if (start >= end || end > N) {
return;
}
size_t first_word = start / BITS_PER_WORD;
const size_t last_word = (end - 1) / BITS_PER_WORD;
const size_t start_bit = start % BITS_PER_WORD;
const size_t end_bit = (end - 1) % BITS_PER_WORD;
const u64 start_mask = (1ULL << start_bit) - 1;
const u64 end_mask = end_bit == BITS_PER_WORD - 1 ? 0ULL : ~((1ULL << (end_bit + 1)) - 1);
if (first_word == last_word) {
data[first_word] &= start_mask | end_mask;
} else {
data[first_word] &= start_mask;
size_t i = first_word + 1;
#ifdef BIT_ARRAY_USE_AVX
const __m256i value = _mm256_setzero_si256();
for (; i + WORDS_PER_AVX <= last_word; i += WORDS_PER_AVX) {
_mm256_storeu_si256(reinterpret_cast<__m256i*>(&data[i]), value);
}
#endif
for (; i < last_word; ++i) {
data[i] = 0ULL;
}
data[last_word] &= end_mask;
}
}
inline constexpr void SetRange(const Range& range) {
SetRange(range.first, range.second);
}
inline constexpr void UnsetRange(const Range& range) {
UnsetRange(range.first, range.second);
}
inline constexpr void Clear() {
data.fill(0);
}
inline constexpr void Fill() {
data.fill(~0ULL);
}
inline constexpr bool None() const {
u64 result = 0;
for (const auto& word : data) {
result |= word;
}
return result == 0;
}
inline constexpr bool Any() const {
return !None();
}
Range FirstRangeFrom(size_t start) const {
if (start >= N) {
return {N, N};
}
const auto find_end_bit = [&](size_t word) {
#ifdef BIT_ARRAY_USE_AVX
const __m256i all_one = _mm256_set1_epi64x(-1);
for (; word + WORDS_PER_AVX <= WORD_COUNT; word += WORDS_PER_AVX) {
const __m256i current =
_mm256_loadu_si256(reinterpret_cast<const __m256i*>(&data[word]));
const __m256i cmp = _mm256_cmpeq_epi64(current, all_one);
if (_mm256_movemask_epi8(cmp) != 0xFFFFFFFF) {
break;
}
}
#endif
for (; word < WORD_COUNT; ++word) {
if (data[word] != ~0ULL) {
return (word * BITS_PER_WORD) + std::countr_one(data[word]);
}
}
return N;
};
const auto word_bits = [&](size_t index, u64 word) {
const int empty_bits = std::countr_zero(word);
const int ones_count = std::countr_one(word >> empty_bits);
const size_t start_bit = index * BITS_PER_WORD + empty_bits;
if (ones_count + empty_bits < BITS_PER_WORD) {
return Range{start_bit, start_bit + ones_count};
}
return Range{start_bit, find_end_bit(index + 1)};
};
const size_t start_word = start / BITS_PER_WORD;
const size_t start_bit = start % BITS_PER_WORD;
const u64 masked_first = data[start_word] & (~((1ULL << start_bit) - 1));
if (masked_first) {
return word_bits(start_word, masked_first);
}
size_t word = start_word + 1;
#ifdef BIT_ARRAY_USE_AVX
for (; word + WORDS_PER_AVX <= WORD_COUNT; word += WORDS_PER_AVX) {
const __m256i current =
_mm256_loadu_si256(reinterpret_cast<const __m256i*>(&data[word]));
if (!_mm256_testz_si256(current, current)) {
break;
}
}
#endif
for (; word < WORD_COUNT; ++word) {
if (data[word] != 0) {
return word_bits(word, data[word]);
}
}
return {N, N};
}
inline constexpr Range FirstRange() const {
return FirstRangeFrom(0);
}
Range LastRangeFrom(size_t end) const {
if (end == 0) {
return {0, 0};
}
if (end > N) {
end = N;
}
const auto find_start_bit = [&](size_t word) {
#ifdef BIT_ARRAY_USE_AVX
const __m256i all_zero = _mm256_setzero_si256();
for (; word >= WORDS_PER_AVX; word -= WORDS_PER_AVX) {
const __m256i current = _mm256_loadu_si256(
reinterpret_cast<const __m256i*>(&data[word - WORDS_PER_AVX]));
const __m256i cmp = _mm256_cmpeq_epi64(current, all_zero);
if (_mm256_movemask_epi8(cmp) != 0xFFFFFFFF) {
break;
}
}
#endif
for (; word > 0; --word) {
if (data[word - 1] != ~0ULL) {
return word * BITS_PER_WORD - std::countl_one(data[word - 1]);
}
}
return size_t(0);
};
const auto word_bits = [&](size_t index, u64 word) {
const int empty_bits = std::countl_zero(word);
const int ones_count = std::countl_one(word << empty_bits);
const size_t end_bit = index * BITS_PER_WORD - empty_bits;
if (empty_bits + ones_count < BITS_PER_WORD) {
return Range{end_bit - ones_count, end_bit};
}
return Range{find_start_bit(index - 1), end_bit};
};
const size_t end_word = ((end - 1) / BITS_PER_WORD) + 1;
const size_t end_bit = (end - 1) % BITS_PER_WORD;
u64 masked_last = data[end_word - 1];
if (end_bit < BITS_PER_WORD - 1) {
masked_last &= (1ULL << (end_bit + 1)) - 1;
}
if (masked_last) {
return word_bits(end_word, masked_last);
}
size_t word = end_word - 1;
#ifdef BIT_ARRAY_USE_AVX
for (; word >= WORDS_PER_AVX; word -= WORDS_PER_AVX) {
const __m256i current =
_mm256_loadu_si256(reinterpret_cast<const __m256i*>(&data[word - WORDS_PER_AVX]));
if (!_mm256_testz_si256(current, current)) {
break;
}
}
#endif
for (; word > 0; --word) {
if (data[word - 1] != 0) {
return word_bits(word, data[word - 1]);
}
}
return {0, 0};
}
inline constexpr Range LastRange() const {
return LastRangeFrom(N);
}
inline constexpr size_t Size() const {
return N;
}
inline constexpr BitArray& operator|=(const BitArray& other) {
for (size_t i = 0; i < WORD_COUNT; ++i) {
data[i] |= other.data[i];
}
return *this;
}
inline constexpr BitArray& operator&=(const BitArray& other) {
for (size_t i = 0; i < WORD_COUNT; ++i) {
data[i] &= other.data[i];
}
return *this;
}
inline constexpr BitArray& operator^=(const BitArray& other) {
for (size_t i = 0; i < WORD_COUNT; ++i) {
data[i] ^= other.data[i];
}
return *this;
}
inline constexpr BitArray& operator~() {
for (size_t i = 0; i < WORD_COUNT; ++i) {
data[i] = ~data[i];
}
return *this;
}
inline constexpr BitArray operator|(const BitArray& other) const {
BitArray result = *this;
result |= other;
return result;
}
inline constexpr BitArray operator&(const BitArray& other) const {
BitArray result = *this;
result &= other;
return result;
}
inline constexpr BitArray operator^(const BitArray& other) const {
BitArray result = *this;
result ^= other;
return result;
}
inline constexpr BitArray operator~() const {
BitArray result = *this;
result = ~result;
return result;
}
inline constexpr bool operator==(const BitArray& other) const {
u64 result = 0;
for (size_t i = 0; i < WORD_COUNT; ++i) {
result |= data[i] ^ other.data[i];
}
return result == 0;
}
inline constexpr bool operator!=(const BitArray& other) const {
return !(*this == other);
}
private:
std::array<u64, WORD_COUNT> data{};
};
} // namespace Common

View file

@ -33,9 +33,7 @@ namespace Config {
static bool isNeo = false;
static bool isDevKit = false;
static bool playBGM = false;
static bool isTrophyPopupDisabled = false;
static int BGMvolume = 50;
static bool enableDiscordRPC = false;
static u32 screenWidth = 1280;
static u32 screenHeight = 720;
@ -43,17 +41,13 @@ static s32 gpuId = -1; // Vulkan physical device index. Set to negative for auto
static std::string logFilter;
static std::string logType = "sync";
static std::string userName = "shadPS4";
static std::string updateChannel;
static std::string chooseHomeTab;
static std::string backButtonBehavior = "left";
static bool useSpecialPad = false;
static int specialPadClass = 1;
static bool isMotionControlsEnabled = true;
static bool isDebugDump = false;
static bool isShaderDebug = false;
static bool isShowSplash = false;
static bool isAutoUpdate = false;
static bool isAlwaysShowChangelog = false;
static std::string isSideTrophy = "right";
static bool isNullGpu = false;
static bool shouldCopyGPUBuffers = false;
@ -86,27 +80,9 @@ static std::vector<GameInstallDir> settings_install_dirs = {};
std::vector<bool> install_dirs_enabled = {};
std::filesystem::path settings_addon_install_dir = {};
std::filesystem::path save_data_path = {};
u32 main_window_geometry_x = 400;
u32 main_window_geometry_y = 400;
u32 main_window_geometry_w = 1280;
u32 main_window_geometry_h = 720;
u32 mw_themes = 0;
u32 m_icon_size = 36;
u32 m_icon_size_grid = 69;
u32 m_slider_pos = 0;
u32 m_slider_pos_grid = 0;
u32 m_table_mode = 0;
u32 m_window_size_W = 1280;
u32 m_window_size_H = 720;
std::vector<std::string> m_elf_viewer;
std::vector<std::string> m_recent_files;
std::string emulator_language = "en_US";
static int backgroundImageOpacity = 50;
static bool showBackgroundImage = true;
static bool isFullscreen = false;
static std::string fullscreenMode = "Windowed";
static bool isHDRAllowed = false;
static bool showLabelsUnderIcons = true;
// Language
u32 m_language = 1; // english
@ -176,14 +152,6 @@ bool getIsFullscreen() {
return isFullscreen;
}
bool getShowLabelsUnderIcons() {
return showLabelsUnderIcons;
}
bool setShowLabelsUnderIcons() {
return false;
}
std::string getFullscreenMode() {
return fullscreenMode;
}
@ -192,14 +160,6 @@ bool getisTrophyPopupDisabled() {
return isTrophyPopupDisabled;
}
bool getPlayBGM() {
return playBGM;
}
int getBGMvolume() {
return BGMvolume;
}
bool getEnableDiscordRPC() {
return enableDiscordRPC;
}
@ -240,18 +200,10 @@ std::string getUserName() {
return userName;
}
std::string getUpdateChannel() {
return updateChannel;
}
std::string getChooseHomeTab() {
return chooseHomeTab;
}
std::string getBackButtonBehavior() {
return backButtonBehavior;
}
bool getUseSpecialPad() {
return useSpecialPad;
}
@ -276,14 +228,6 @@ bool showSplash() {
return isShowSplash;
}
bool autoUpdate() {
return isAutoUpdate;
}
bool alwaysShowChangelog() {
return isAlwaysShowChangelog;
}
std::string sideTrophy() {
return isSideTrophy;
}
@ -384,14 +328,6 @@ void setShowSplash(bool enable) {
isShowSplash = enable;
}
void setAutoUpdate(bool enable) {
isAutoUpdate = enable;
}
void setAlwaysShowChangelog(bool enable) {
isAlwaysShowChangelog = enable;
}
void setSideTrophy(std::string side) {
isSideTrophy = side;
}
@ -431,9 +367,6 @@ void setVblankDiv(u32 value) {
void setIsFullscreen(bool enable) {
isFullscreen = enable;
}
static void setShowLabelsUnderIcons(bool enable) {
showLabelsUnderIcons = enable;
}
void setFullscreenMode(std::string mode) {
fullscreenMode = mode;
@ -443,14 +376,6 @@ void setisTrophyPopupDisabled(bool disable) {
isTrophyPopupDisabled = disable;
}
void setPlayBGM(bool enable) {
playBGM = enable;
}
void setBGMvolume(int volume) {
BGMvolume = volume;
}
void setEnableDiscordRPC(bool enable) {
enableDiscordRPC = enable;
}
@ -490,17 +415,10 @@ void setUserName(const std::string& type) {
userName = type;
}
void setUpdateChannel(const std::string& type) {
updateChannel = type;
}
void setChooseHomeTab(const std::string& type) {
chooseHomeTab = type;
}
void setBackButtonBehavior(const std::string& type) {
backButtonBehavior = type;
}
void setUseSpecialPad(bool use) {
useSpecialPad = use;
}
@ -521,13 +439,6 @@ void setCheckCompatibilityOnStartup(bool use) {
checkCompatibilityOnStartup = use;
}
void setMainWindowGeometry(u32 x, u32 y, u32 w, u32 h) {
main_window_geometry_x = x;
main_window_geometry_y = y;
main_window_geometry_w = w;
main_window_geometry_h = h;
}
bool addGameInstallDir(const std::filesystem::path& dir, bool enabled) {
for (const auto& install_dir : settings_install_dirs) {
if (install_dir.path == dir) {
@ -560,52 +471,6 @@ void setAddonInstallDir(const std::filesystem::path& dir) {
settings_addon_install_dir = dir;
}
void setMainWindowTheme(u32 theme) {
mw_themes = theme;
}
void setIconSize(u32 size) {
m_icon_size = size;
}
void setIconSizeGrid(u32 size) {
m_icon_size_grid = size;
}
void setSliderPosition(u32 pos) {
m_slider_pos = pos;
}
void setSliderPositionGrid(u32 pos) {
m_slider_pos_grid = pos;
}
void setTableMode(u32 mode) {
m_table_mode = mode;
}
void setMainWindowWidth(u32 width) {
m_window_size_W = width;
}
void setMainWindowHeight(u32 height) {
m_window_size_H = height;
}
void setElfViewer(const std::vector<std::string>& elfList) {
m_elf_viewer.resize(elfList.size());
m_elf_viewer = elfList;
}
void setRecentFiles(const std::vector<std::string>& recentFiles) {
m_recent_files.resize(recentFiles.size());
m_recent_files = recentFiles;
}
void setEmulatorLanguage(std::string language) {
emulator_language = language;
}
void setGameInstallDirs(const std::vector<std::filesystem::path>& dirs_config) {
settings_install_dirs.clear();
for (const auto& dir : dirs_config) {
@ -621,22 +486,6 @@ void setSaveDataPath(const std::filesystem::path& path) {
save_data_path = path;
}
u32 getMainWindowGeometryX() {
return main_window_geometry_x;
}
u32 getMainWindowGeometryY() {
return main_window_geometry_y;
}
u32 getMainWindowGeometryW() {
return main_window_geometry_w;
}
u32 getMainWindowGeometryH() {
return main_window_geometry_h;
}
const std::vector<std::filesystem::path> getGameInstallDirs() {
std::vector<std::filesystem::path> enabled_dirs;
for (const auto& dir : settings_install_dirs) {
@ -663,50 +512,6 @@ std::filesystem::path getAddonInstallDir() {
return settings_addon_install_dir;
}
u32 getMainWindowTheme() {
return mw_themes;
}
u32 getIconSize() {
return m_icon_size;
}
u32 getIconSizeGrid() {
return m_icon_size_grid;
}
u32 getSliderPosition() {
return m_slider_pos;
}
u32 getSliderPositionGrid() {
return m_slider_pos_grid;
}
u32 getTableMode() {
return m_table_mode;
}
u32 getMainWindowWidth() {
return m_window_size_W;
}
u32 getMainWindowHeight() {
return m_window_size_H;
}
std::vector<std::string> getElfViewer() {
return m_elf_viewer;
}
std::vector<std::string> getRecentFiles() {
return m_recent_files;
}
std::string getEmulatorLanguage() {
return emulator_language;
}
u32 GetLanguage() {
return m_language;
}
@ -715,22 +520,6 @@ bool getSeparateLogFilesEnabled() {
return isSeparateLogFilesEnabled;
}
int getBackgroundImageOpacity() {
return backgroundImageOpacity;
}
void setBackgroundImageOpacity(int opacity) {
backgroundImageOpacity = std::clamp(opacity, 0, 100);
}
bool getShowBackgroundImage() {
return showBackgroundImage;
}
void setShowBackgroundImage(bool show) {
showBackgroundImage = show;
}
bool getPSNSignedIn() {
return isPSNSignedIn;
}
@ -764,23 +553,14 @@ void load(const std::filesystem::path& path) {
isNeo = toml::find_or<bool>(general, "isPS4Pro", false);
isDevKit = toml::find_or<bool>(general, "isDevKit", false);
isPSNSignedIn = toml::find_or<bool>(general, "isPSNSignedIn", false);
playBGM = toml::find_or<bool>(general, "playBGM", false);
isTrophyPopupDisabled = toml::find_or<bool>(general, "isTrophyPopupDisabled", false);
trophyNotificationDuration =
toml::find_or<double>(general, "trophyNotificationDuration", 5.0);
BGMvolume = toml::find_or<int>(general, "BGMvolume", 50);
enableDiscordRPC = toml::find_or<bool>(general, "enableDiscordRPC", true);
logFilter = toml::find_or<std::string>(general, "logFilter", "");
logType = toml::find_or<std::string>(general, "logType", "sync");
userName = toml::find_or<std::string>(general, "userName", "shadPS4");
if (Common::g_is_release) {
updateChannel = toml::find_or<std::string>(general, "updateChannel", "Release");
} else {
updateChannel = toml::find_or<std::string>(general, "updateChannel", "Nightly");
}
isShowSplash = toml::find_or<bool>(general, "showSplash", true);
isAutoUpdate = toml::find_or<bool>(general, "autoUpdate", false);
isAlwaysShowChangelog = toml::find_or<bool>(general, "alwaysShowChangelog", false);
isSideTrophy = toml::find_or<std::string>(general, "sideTrophy", "right");
compatibilityData = toml::find_or<bool>(general, "compatibilityEnabled", false);
checkCompatibilityOnStartup =
@ -793,7 +573,6 @@ void load(const std::filesystem::path& path) {
cursorState = toml::find_or<int>(input, "cursorState", HideCursorState::Idle);
cursorHideTimeout = toml::find_or<int>(input, "cursorHideTimeout", 5);
backButtonBehavior = toml::find_or<std::string>(input, "backButtonBehavior", "left");
useSpecialPad = toml::find_or<bool>(input, "useSpecialPad", false);
specialPadClass = toml::find_or<int>(input, "specialPadClass", 1);
isMotionControlsEnabled = toml::find_or<bool>(input, "isMotionControlsEnabled", true);
@ -841,13 +620,6 @@ void load(const std::filesystem::path& path) {
const toml::value& gui = data.at("GUI");
load_game_size = toml::find_or<bool>(gui, "loadGameSizeEnabled", true);
m_icon_size = toml::find_or<int>(gui, "iconSize", 0);
m_icon_size_grid = toml::find_or<int>(gui, "iconSizeGrid", 0);
m_slider_pos = toml::find_or<int>(gui, "sliderPos", 0);
m_slider_pos_grid = toml::find_or<int>(gui, "sliderPosGrid", 0);
mw_themes = toml::find_or<int>(gui, "theme", 0);
m_window_size_W = toml::find_or<int>(gui, "mw_width", 0);
m_window_size_H = toml::find_or<int>(gui, "mw_height", 0);
const auto install_dir_array =
toml::find_or<std::vector<std::u8string>>(gui, "installDirs", {});
@ -872,16 +644,6 @@ void load(const std::filesystem::path& path) {
save_data_path = toml::find_fs_path_or(gui, "saveDataPath", {});
settings_addon_install_dir = toml::find_fs_path_or(gui, "addonInstallDir", {});
main_window_geometry_x = toml::find_or<int>(gui, "geometry_x", 0);
main_window_geometry_y = toml::find_or<int>(gui, "geometry_y", 0);
main_window_geometry_w = toml::find_or<int>(gui, "geometry_w", 0);
main_window_geometry_h = toml::find_or<int>(gui, "geometry_h", 0);
m_elf_viewer = toml::find_or<std::vector<std::string>>(gui, "elfDirs", {});
m_recent_files = toml::find_or<std::vector<std::string>>(gui, "recentFiles", {});
m_table_mode = toml::find_or<int>(gui, "gameTableMode", 0);
emulator_language = toml::find_or<std::string>(gui, "emulatorLanguage", "en_US");
backgroundImageOpacity = toml::find_or<int>(gui, "backgroundImageOpacity", 50);
showBackgroundImage = toml::find_or<bool>(gui, "showBackgroundImage", true);
}
if (data.contains("Settings")) {
@ -894,18 +656,6 @@ void load(const std::filesystem::path& path) {
const toml::value& keys = data.at("Keys");
trophyKey = toml::find_or<std::string>(keys, "TrophyKey", "");
}
// Check if the loaded language is in the allowed list
const std::vector<std::string> allowed_languages = {
"ar_SA", "da_DK", "de_DE", "el_GR", "en_US", "es_ES", "fa_IR", "fi_FI", "fr_FR", "hu_HU",
"id_ID", "it_IT", "ja_JP", "ko_KR", "lt_LT", "nb_NO", "nl_NL", "pl_PL", "pt_BR", "pt_PT",
"ro_RO", "ru_RU", "sq_AL", "sv_SE", "tr_TR", "uk_UA", "vi_VN", "zh_CN", "zh_TW"};
if (std::find(allowed_languages.begin(), allowed_languages.end(), emulator_language) ==
allowed_languages.end()) {
emulator_language = "en_US"; // Default to en_US if not in the list
save(path);
}
}
void sortTomlSections(toml::ordered_value& data) {
@ -966,23 +716,17 @@ void save(const std::filesystem::path& path) {
data["General"]["isPSNSignedIn"] = isPSNSignedIn;
data["General"]["isTrophyPopupDisabled"] = isTrophyPopupDisabled;
data["General"]["trophyNotificationDuration"] = trophyNotificationDuration;
data["General"]["playBGM"] = playBGM;
data["General"]["BGMvolume"] = BGMvolume;
data["General"]["enableDiscordRPC"] = enableDiscordRPC;
data["General"]["logFilter"] = logFilter;
data["General"]["logType"] = logType;
data["General"]["userName"] = userName;
data["General"]["updateChannel"] = updateChannel;
data["General"]["chooseHomeTab"] = chooseHomeTab;
data["General"]["showSplash"] = isShowSplash;
data["General"]["autoUpdate"] = isAutoUpdate;
data["General"]["alwaysShowChangelog"] = isAlwaysShowChangelog;
data["General"]["sideTrophy"] = isSideTrophy;
data["General"]["compatibilityEnabled"] = compatibilityData;
data["General"]["checkCompatibilityOnStartup"] = checkCompatibilityOnStartup;
data["Input"]["cursorState"] = cursorState;
data["Input"]["cursorHideTimeout"] = cursorHideTimeout;
data["Input"]["backButtonBehavior"] = backButtonBehavior;
data["Input"]["useSpecialPad"] = useSpecialPad;
data["Input"]["specialPadClass"] = specialPadClass;
data["Input"]["isMotionControlsEnabled"] = isMotionControlsEnabled;
@ -1045,9 +789,6 @@ void save(const std::filesystem::path& path) {
data["GUI"]["addonInstallDir"] =
std::string{fmt::UTF(settings_addon_install_dir.u8string()).data};
data["GUI"]["emulatorLanguage"] = emulator_language;
data["GUI"]["backgroundImageOpacity"] = backgroundImageOpacity;
data["GUI"]["showBackgroundImage"] = showBackgroundImage;
data["Settings"]["consoleLanguage"] = m_language;
// Sorting of TOML sections
@ -1056,53 +797,6 @@ void save(const std::filesystem::path& path) {
std::ofstream file(path, std::ios::binary);
file << data;
file.close();
saveMainWindow(path);
}
void saveMainWindow(const std::filesystem::path& path) {
toml::ordered_value data;
std::error_code error;
if (std::filesystem::exists(path, error)) {
try {
std::ifstream ifs;
ifs.exceptions(std::ifstream::failbit | std::ifstream::badbit);
ifs.open(path, std::ios_base::binary);
data = toml::parse<toml::ordered_type_config>(
ifs, std::string{fmt::UTF(path.filename().u8string()).data});
} catch (const std::exception& ex) {
fmt::print("Exception trying to parse config file. Exception: {}\n", ex.what());
return;
}
} else {
if (error) {
fmt::print("Filesystem error: {}\n", error.message());
}
fmt::print("Saving new configuration file {}\n", fmt::UTF(path.u8string()));
}
data["GUI"]["mw_width"] = m_window_size_W;
data["GUI"]["mw_height"] = m_window_size_H;
data["GUI"]["theme"] = mw_themes;
data["GUI"]["iconSize"] = m_icon_size;
data["GUI"]["sliderPos"] = m_slider_pos;
data["GUI"]["iconSizeGrid"] = m_icon_size_grid;
data["GUI"]["sliderPosGrid"] = m_slider_pos_grid;
data["GUI"]["gameTableMode"] = m_table_mode;
data["GUI"]["geometry_x"] = main_window_geometry_x;
data["GUI"]["geometry_y"] = main_window_geometry_y;
data["GUI"]["geometry_w"] = main_window_geometry_w;
data["GUI"]["geometry_h"] = main_window_geometry_h;
data["GUI"]["elfDirs"] = m_elf_viewer;
data["GUI"]["recentFiles"] = m_recent_files;
// Sorting of TOML sections
sortTomlSections(data);
std::ofstream file(path, std::ios::binary);
file << data;
file.close();
}
void setDefaultValues() {
@ -1112,31 +806,22 @@ void setDefaultValues() {
isPSNSignedIn = false;
isFullscreen = false;
isTrophyPopupDisabled = false;
playBGM = false;
BGMvolume = 50;
enableDiscordRPC = true;
screenWidth = 1280;
screenHeight = 720;
logFilter = "";
logType = "sync";
userName = "shadPS4";
if (Common::g_is_release) {
updateChannel = "Release";
} else {
updateChannel = "Nightly";
}
chooseHomeTab = "General";
cursorState = HideCursorState::Idle;
cursorHideTimeout = 5;
trophyNotificationDuration = 6.0;
backButtonBehavior = "left";
useSpecialPad = false;
specialPadClass = 1;
isDebugDump = false;
isShaderDebug = false;
isShowSplash = false;
isAutoUpdate = false;
isAlwaysShowChangelog = false;
isSideTrophy = "right";
isNullGpu = false;
shouldDumpShaders = false;
@ -1148,13 +833,10 @@ void setDefaultValues() {
vkHostMarkers = false;
vkGuestMarkers = false;
rdocEnable = false;
emulator_language = "en_US";
m_language = 1;
gpuId = -1;
compatibilityData = false;
checkCompatibilityOnStartup = false;
backgroundImageOpacity = 50;
showBackgroundImage = true;
}
constexpr std::string_view GetDefaultKeyboardConfig() {
@ -1180,7 +862,7 @@ l3 = x
r3 = m
options = enter
touchpad = space
touchpad_center = space
pad_up = up
pad_down = down
@ -1212,7 +894,7 @@ r2 = r2
r3 = r3
options = options
touchpad = back
touchpad_center = back
pad_up = pad_up
pad_down = pad_down

View file

@ -18,170 +18,116 @@ enum HideCursorState : int { Never, Idle, Always };
void load(const std::filesystem::path& path);
void save(const std::filesystem::path& path);
void saveMainWindow(const std::filesystem::path& path);
std::string getTrophyKey();
void setTrophyKey(std::string key);
bool getIsFullscreen();
void setIsFullscreen(bool enable);
std::string getFullscreenMode();
void setFullscreenMode(std::string mode);
u32 getScreenWidth();
u32 getScreenHeight();
void setScreenWidth(u32 width);
void setScreenHeight(u32 height);
bool debugDump();
void setDebugDump(bool enable);
s32 getGpuId();
void setGpuId(s32 selectedGpuId);
bool allowHDR();
void setAllowHDR(bool enable);
bool collectShadersForDebug();
void setCollectShaderForDebug(bool enable);
bool showSplash();
void setShowSplash(bool enable);
std::string sideTrophy();
void setSideTrophy(std::string side);
bool nullGpu();
void setNullGpu(bool enable);
bool copyGPUCmdBuffers();
void setCopyGPUCmdBuffers(bool enable);
bool dumpShaders();
void setDumpShaders(bool enable);
u32 vblankDiv();
void setVblankDiv(u32 value);
bool getisTrophyPopupDisabled();
void setisTrophyPopupDisabled(bool disable);
s16 getCursorState();
void setCursorState(s16 cursorState);
bool vkValidationEnabled();
void setVkValidation(bool enable);
bool vkValidationSyncEnabled();
void setVkSyncValidation(bool enable);
bool getVkCrashDiagnosticEnabled();
void setVkCrashDiagnosticEnabled(bool enable);
bool getVkHostMarkersEnabled();
void setVkHostMarkersEnabled(bool enable);
bool getVkGuestMarkersEnabled();
void setVkGuestMarkersEnabled(bool enable);
bool getEnableDiscordRPC();
void setEnableDiscordRPC(bool enable);
bool isRdocEnabled();
void setRdocEnabled(bool enable);
std::string getLogType();
void setLogType(const std::string& type);
std::string getLogFilter();
void setLogFilter(const std::string& type);
double getTrophyNotificationDuration();
void setTrophyNotificationDuration(double newTrophyNotificationDuration);
int getCursorHideTimeout();
void setCursorHideTimeout(int newcursorHideTimeout);
void setSeparateLogFilesEnabled(bool enabled);
bool getSeparateLogFilesEnabled();
u32 GetLanguage();
void setLanguage(u32 language);
void setUseSpecialPad(bool use);
bool getUseSpecialPad();
void setSpecialPadClass(int type);
int getSpecialPadClass();
bool getPSNSignedIn();
void setPSNSignedIn(bool sign); // no ui setting
bool patchShaders(); // no set
bool fpsColor(); // no set
bool isNeoModeConsole();
void setNeoMode(bool enable); // no ui setting
bool isDevKitConsole(); // no set
bool vkValidationGpuEnabled(); // no set
bool getIsMotionControlsEnabled();
void setIsMotionControlsEnabled(bool use);
// TODO
bool GetLoadGameSizeEnabled();
std::filesystem::path GetSaveDataPath();
void setLoadGameSizeEnabled(bool enable);
bool getIsFullscreen();
bool getShowLabelsUnderIcons();
bool setShowLabelsUnderIcons();
std::string getFullscreenMode();
bool isNeoModeConsole();
bool isDevKitConsole();
bool getPlayBGM();
int getBGMvolume();
bool getisTrophyPopupDisabled();
bool getEnableDiscordRPC();
bool getCompatibilityEnabled();
bool getCheckCompatibilityOnStartup();
int getBackgroundImageOpacity();
bool getShowBackgroundImage();
bool getPSNSignedIn();
std::string getLogFilter();
std::string getLogType();
std::string getUserName();
std::string getUpdateChannel();
std::string getChooseHomeTab();
s16 getCursorState();
int getCursorHideTimeout();
double getTrophyNotificationDuration();
std::string getBackButtonBehavior();
bool getUseSpecialPad();
int getSpecialPadClass();
bool getIsMotionControlsEnabled();
bool GetUseUnifiedInputConfig();
void SetUseUnifiedInputConfig(bool use);
bool GetOverrideControllerColor();
void SetOverrideControllerColor(bool enable);
int* GetControllerCustomColor();
void SetControllerCustomColor(int r, int b, int g);
u32 getScreenWidth();
u32 getScreenHeight();
s32 getGpuId();
bool allowHDR();
bool debugDump();
bool collectShadersForDebug();
bool showSplash();
bool autoUpdate();
bool alwaysShowChangelog();
std::string sideTrophy();
bool nullGpu();
bool copyGPUCmdBuffers();
bool dumpShaders();
bool patchShaders();
bool isRdocEnabled();
bool fpsColor();
u32 vblankDiv();
void setDebugDump(bool enable);
void setCollectShaderForDebug(bool enable);
void setShowSplash(bool enable);
void setAutoUpdate(bool enable);
void setAlwaysShowChangelog(bool enable);
void setSideTrophy(std::string side);
void setNullGpu(bool enable);
void setAllowHDR(bool enable);
void setCopyGPUCmdBuffers(bool enable);
void setDumpShaders(bool enable);
void setVblankDiv(u32 value);
void setGpuId(s32 selectedGpuId);
void setScreenWidth(u32 width);
void setScreenHeight(u32 height);
void setIsFullscreen(bool enable);
void setFullscreenMode(std::string mode);
void setisTrophyPopupDisabled(bool disable);
void setPlayBGM(bool enable);
void setBGMvolume(int volume);
void setEnableDiscordRPC(bool enable);
void setLanguage(u32 language);
void setNeoMode(bool enable);
void setUserName(const std::string& type);
void setUpdateChannel(const std::string& type);
void setChooseHomeTab(const std::string& type);
void setGameInstallDirs(const std::vector<std::filesystem::path>& dirs_config);
void setAllGameInstallDirs(const std::vector<GameInstallDir>& dirs_config);
void setSaveDataPath(const std::filesystem::path& path);
void setCompatibilityEnabled(bool use);
void setCheckCompatibilityOnStartup(bool use);
void setBackgroundImageOpacity(int opacity);
void setShowBackgroundImage(bool show);
void setPSNSignedIn(bool sign);
void setCursorState(s16 cursorState);
void setCursorHideTimeout(int newcursorHideTimeout);
void setTrophyNotificationDuration(double newTrophyNotificationDuration);
void setBackButtonBehavior(const std::string& type);
void setUseSpecialPad(bool use);
void setSpecialPadClass(int type);
void setIsMotionControlsEnabled(bool use);
void setLogType(const std::string& type);
void setLogFilter(const std::string& type);
void setSeparateLogFilesEnabled(bool enabled);
bool getSeparateLogFilesEnabled();
void setVkValidation(bool enable);
void setVkSyncValidation(bool enable);
void setRdocEnabled(bool enable);
bool vkValidationEnabled();
bool vkValidationSyncEnabled();
bool vkValidationGpuEnabled();
bool getVkCrashDiagnosticEnabled();
bool getVkHostMarkersEnabled();
bool getVkGuestMarkersEnabled();
void setVkCrashDiagnosticEnabled(bool enable);
void setVkHostMarkersEnabled(bool enable);
void setVkGuestMarkersEnabled(bool enable);
// Gui
void setMainWindowGeometry(u32 x, u32 y, u32 w, u32 h);
bool addGameInstallDir(const std::filesystem::path& dir, bool enabled = true);
void removeGameInstallDir(const std::filesystem::path& dir);
void setGameInstallDirEnabled(const std::filesystem::path& dir, bool enabled);
void setAddonInstallDir(const std::filesystem::path& dir);
void setMainWindowTheme(u32 theme);
void setIconSize(u32 size);
void setIconSizeGrid(u32 size);
void setSliderPosition(u32 pos);
void setSliderPositionGrid(u32 pos);
void setTableMode(u32 mode);
void setMainWindowWidth(u32 width);
void setMainWindowHeight(u32 height);
void setElfViewer(const std::vector<std::string>& elfList);
void setRecentFiles(const std::vector<std::string>& recentFiles);
void setEmulatorLanguage(std::string language);
u32 getMainWindowGeometryX();
u32 getMainWindowGeometryY();
u32 getMainWindowGeometryW();
u32 getMainWindowGeometryH();
const std::vector<std::filesystem::path> getGameInstallDirs();
const std::vector<bool> getGameInstallDirsEnabled();
std::filesystem::path getAddonInstallDir();
u32 getMainWindowTheme();
u32 getIconSize();
u32 getIconSizeGrid();
u32 getSliderPosition();
u32 getSliderPositionGrid();
u32 getTableMode();
u32 getMainWindowWidth();
u32 getMainWindowHeight();
std::vector<std::string> getElfViewer();
std::vector<std::string> getRecentFiles();
std::string getEmulatorLanguage();
void setDefaultValues();
// todo: name and function location pending
std::filesystem::path GetFoolproofKbmConfigFile(const std::string& game_id = "");
// settings
u32 GetLanguage();
}; // namespace Config

View file

@ -186,7 +186,9 @@ public:
template <typename T>
size_t WriteRaw(const void* data, size_t size) const {
return std::fwrite(data, sizeof(T), size, file);
auto bytes = std::fwrite(data, sizeof(T), size, file);
std::fflush(file);
return bytes;
}
template <typename T>

View file

@ -88,7 +88,8 @@ static bool FilterTcbAccess(const ZydisDecodedOperand* operands) {
dst_op.reg.value <= ZYDIS_REGISTER_R15;
}
static void GenerateTcbAccess(const ZydisDecodedOperand* operands, Xbyak::CodeGenerator& c) {
static void GenerateTcbAccess(void* /* address */, const ZydisDecodedOperand* operands,
Xbyak::CodeGenerator& c) {
const auto dst = ZydisToXbyakRegisterOperand(operands[0]);
#if defined(_WIN32)
@ -126,7 +127,8 @@ static bool FilterNoSSE4a(const ZydisDecodedOperand*) {
return !cpu.has(Cpu::tSSE4a);
}
static void GenerateEXTRQ(const ZydisDecodedOperand* operands, Xbyak::CodeGenerator& c) {
static void GenerateEXTRQ(void* /* address */, const ZydisDecodedOperand* operands,
Xbyak::CodeGenerator& c) {
bool immediateForm = operands[1].type == ZYDIS_OPERAND_TYPE_IMMEDIATE &&
operands[2].type == ZYDIS_OPERAND_TYPE_IMMEDIATE;
@ -245,7 +247,8 @@ static void GenerateEXTRQ(const ZydisDecodedOperand* operands, Xbyak::CodeGenera
}
}
static void GenerateINSERTQ(const ZydisDecodedOperand* operands, Xbyak::CodeGenerator& c) {
static void GenerateINSERTQ(void* /* address */, const ZydisDecodedOperand* operands,
Xbyak::CodeGenerator& c) {
bool immediateForm = operands[2].type == ZYDIS_OPERAND_TYPE_IMMEDIATE &&
operands[3].type == ZYDIS_OPERAND_TYPE_IMMEDIATE;
@ -383,8 +386,44 @@ static void GenerateINSERTQ(const ZydisDecodedOperand* operands, Xbyak::CodeGene
}
}
static void ReplaceMOVNT(void* address, u8 rep_prefix) {
// Find the opcode byte
// There can be any amount of prefixes but the instruction can't be more than 15 bytes
// And we know for sure this is a MOVNTSS/MOVNTSD
bool found = false;
bool rep_prefix_found = false;
int index = 0;
u8* ptr = reinterpret_cast<u8*>(address);
for (int i = 0; i < 15; i++) {
if (ptr[i] == rep_prefix) {
rep_prefix_found = true;
} else if (ptr[i] == 0x2B) {
index = i;
found = true;
break;
}
}
// Some sanity checks
ASSERT(found);
ASSERT(index >= 2);
ASSERT(ptr[index - 1] == 0x0F);
ASSERT(rep_prefix_found);
// This turns the MOVNTSS/MOVNTSD to a MOVSS/MOVSD m, xmm
ptr[index] = 0x11;
}
static void ReplaceMOVNTSS(void* address, const ZydisDecodedOperand*, Xbyak::CodeGenerator&) {
ReplaceMOVNT(address, 0xF3);
}
static void ReplaceMOVNTSD(void* address, const ZydisDecodedOperand*, Xbyak::CodeGenerator&) {
ReplaceMOVNT(address, 0xF2);
}
using PatchFilter = bool (*)(const ZydisDecodedOperand*);
using InstructionGenerator = void (*)(const ZydisDecodedOperand*, Xbyak::CodeGenerator&);
using InstructionGenerator = void (*)(void*, const ZydisDecodedOperand*, Xbyak::CodeGenerator&);
struct PatchInfo {
/// Filter for more granular patch conditions past just the instruction mnemonic.
PatchFilter filter;
@ -400,6 +439,8 @@ static const std::unordered_map<ZydisMnemonic, PatchInfo> Patches = {
// SSE4a
{ZYDIS_MNEMONIC_EXTRQ, {FilterNoSSE4a, GenerateEXTRQ, true}},
{ZYDIS_MNEMONIC_INSERTQ, {FilterNoSSE4a, GenerateINSERTQ, true}},
{ZYDIS_MNEMONIC_MOVNTSS, {FilterNoSSE4a, ReplaceMOVNTSS, false}},
{ZYDIS_MNEMONIC_MOVNTSD, {FilterNoSSE4a, ReplaceMOVNTSD, false}},
#if defined(_WIN32)
// Windows needs a trampoline.
@ -477,7 +518,7 @@ static std::pair<bool, u64> TryPatch(u8* code, PatchModule* module) {
auto& trampoline_gen = module->trampoline_gen;
const auto trampoline_ptr = trampoline_gen.getCurr();
patch_info.generator(operands, trampoline_gen);
patch_info.generator(code, operands, trampoline_gen);
// Return to the following instruction at the end of the trampoline.
trampoline_gen.jmp(code + instruction.length);
@ -485,7 +526,7 @@ static std::pair<bool, u64> TryPatch(u8* code, PatchModule* module) {
// Replace instruction with near jump to the trampoline.
patch_gen.jmp(trampoline_ptr, Xbyak::CodeGenerator::LabelType::T_NEAR);
} else {
patch_info.generator(operands, patch_gen);
patch_info.generator(code, operands, patch_gen);
}
const auto patch_size = patch_gen.getCurr() - code;

View file

@ -10,6 +10,8 @@
namespace Core::FileSys {
bool MntPoints::ignore_game_patches = false;
std::string RemoveTrailingSlashes(const std::string& path) {
// Remove trailing slashes to make comparisons simpler.
std::string path_sanitized = path;
@ -77,7 +79,7 @@ std::filesystem::path MntPoints::GetHostPath(std::string_view path, bool* is_rea
patch_path /= rel_path;
if ((corrected_path.starts_with("/app0") || corrected_path.starts_with("/hostapp")) &&
!force_base_path && std::filesystem::exists(patch_path)) {
!force_base_path && !ignore_game_patches && std::filesystem::exists(patch_path)) {
return patch_path;
}
@ -137,7 +139,7 @@ std::filesystem::path MntPoints::GetHostPath(std::string_view path, bool* is_rea
return std::optional<std::filesystem::path>(current_path);
};
if (!force_base_path) {
if (!force_base_path && !ignore_game_patches) {
if (const auto path = search(patch_path)) {
return *path;
}

View file

@ -21,6 +21,7 @@ class MntPoints {
static constexpr bool NeedsCaseInsensitiveSearch = true;
#endif
public:
static bool ignore_game_patches;
struct MntPair {
std::filesystem::path host_path;
std::string mount; // e.g /app0

View file

@ -125,7 +125,6 @@ int EqueueInternal::WaitForEvents(SceKernelEvent* ev, int num, u32 micros) {
.count();
count = WaitForSmallTimer(ev, num, std::max(0l, long(micros - time_waited)));
}
small_timer_event.event.data = 0;
}
if (ev->flags & SceKernelEvent::Flags::OneShot) {
@ -179,39 +178,46 @@ int EqueueInternal::GetTriggeredEvents(SceKernelEvent* ev, int num) {
}
bool EqueueInternal::AddSmallTimer(EqueueEvent& ev) {
// We assume that only one timer event (with the same ident across calls)
// can be posted to the queue, based on observations so far. In the opposite case,
// the small timer storage and wait logic should be reworked.
ASSERT(!HasSmallTimer() || small_timer_event.event.ident == ev.event.ident);
ev.time_added = std::chrono::steady_clock::now();
small_timer_event = std::move(ev);
SmallTimer st;
st.event = ev.event;
st.added = std::chrono::steady_clock::now();
st.interval = std::chrono::microseconds{ev.event.data};
{
std::scoped_lock lock{m_mutex};
m_small_timers[st.event.ident] = std::move(st);
}
return true;
}
int EqueueInternal::WaitForSmallTimer(SceKernelEvent* ev, int num, u32 micros) {
int count{};
ASSERT(num == 1);
ASSERT(num >= 1);
auto curr_clock = std::chrono::steady_clock::now();
const auto wait_end_us = (micros == 0) ? std::chrono::steady_clock::time_point::max()
: curr_clock + std::chrono::microseconds{micros};
int count = 0;
do {
curr_clock = std::chrono::steady_clock::now();
{
std::scoped_lock lock{m_mutex};
if ((curr_clock - small_timer_event.time_added) >
std::chrono::microseconds{small_timer_event.event.data}) {
ev[count++] = small_timer_event.event;
small_timer_event.event.data = 0;
break;
for (auto it = m_small_timers.begin(); it != m_small_timers.end() && count < num;) {
const SmallTimer& st = it->second;
if (curr_clock - st.added >= st.interval) {
ev[count++] = st.event;
it = m_small_timers.erase(it);
} else {
++it;
}
}
if (count > 0)
return count;
}
std::this_thread::yield();
} while (curr_clock < wait_end_us);
return count;
return 0;
}
bool EqueueInternal::EventExists(u64 id, s16 filter) {
@ -326,6 +332,11 @@ s32 PS4_SYSV_ABI sceKernelAddHRTimerEvent(SceKernelEqueue eq, int id, timespec*
// `HrTimerSpinlockThresholdUs`) and fall back to boost asio timers if the time to tick is
// large. Even for large delays, we truncate a small portion to complete the wait
// using the spinlock, prioritizing precision.
if (eq->EventExists(event.event.ident, event.event.filter)) {
eq->RemoveEvent(id, SceKernelEvent::Filter::HrTimer);
}
if (total_us < HrTimerSpinlockThresholdUs) {
return eq->AddSmallTimer(event) ? ORBIS_OK : ORBIS_KERNEL_ERROR_ENOMEM;
}

View file

@ -9,6 +9,7 @@
#include <vector>
#include <boost/asio/steady_timer.hpp>
#include <unordered_map>
#include "common/rdtsc.h"
#include "common/types.h"
@ -135,6 +136,12 @@ private:
};
class EqueueInternal {
struct SmallTimer {
SceKernelEvent event;
std::chrono::steady_clock::time_point added;
std::chrono::microseconds interval;
};
public:
explicit EqueueInternal(std::string_view name) : m_name(name) {}
@ -151,13 +158,14 @@ public:
int GetTriggeredEvents(SceKernelEvent* ev, int num);
bool AddSmallTimer(EqueueEvent& event);
bool HasSmallTimer() const {
return small_timer_event.event.data != 0;
bool HasSmallTimer() {
std::scoped_lock lock{m_mutex};
return !m_small_timers.empty();
}
bool RemoveSmallTimer(u64 id) {
if (HasSmallTimer() && small_timer_event.event.ident == id) {
small_timer_event = {};
return true;
if (HasSmallTimer()) {
std::scoped_lock lock{m_mutex};
return m_small_timers.erase(id) > 0;
}
return false;
}
@ -170,8 +178,8 @@ private:
std::string m_name;
std::mutex m_mutex;
std::vector<EqueueEvent> m_events;
EqueueEvent small_timer_event{};
std::condition_variable m_cond;
std::unordered_map<u64, SmallTimer> m_small_timers;
};
u64 PS4_SYSV_ABI sceKernelGetEventData(const SceKernelEvent* ev);

View file

@ -293,6 +293,7 @@ s64 PS4_SYSV_ABI write(s32 fd, const void* buf, size_t nbytes) {
}
return result;
}
return file->f.WriteRaw<u8>(buf, nbytes);
}
@ -750,7 +751,24 @@ s32 PS4_SYSV_ABI posix_rename(const char* from, const char* to) {
*__Error() = POSIX_ENOTEMPTY;
return -1;
}
// On Windows, std::filesystem::rename will error if the file has been opened before.
std::filesystem::copy(src_path, dst_path, std::filesystem::copy_options::overwrite_existing);
auto* h = Common::Singleton<Core::FileSys::HandleTable>::Instance();
auto file = h->GetFile(src_path);
if (file) {
// We need to force ReadWrite if the file had Write access before
// Otherwise f.Open will clear the file contents.
auto access_mode = file->f.GetAccessMode() == Common::FS::FileAccessMode::Write
? Common::FS::FileAccessMode::ReadWrite
: file->f.GetAccessMode();
file->f.Close();
std::filesystem::remove(src_path);
file->f.Open(dst_path, access_mode);
} else {
std::filesystem::remove(src_path);
}
return ORBIS_OK;
}
@ -1050,6 +1068,7 @@ void RegisterFileSystem(Core::Loader::SymbolsResolver* sym) {
LIB_FUNCTION("4wSze92BhLI", "libkernel", 1, "libkernel", 1, 1, sceKernelWrite);
LIB_FUNCTION("+WRlkKjZvag", "libkernel", 1, "libkernel", 1, 1, readv);
LIB_FUNCTION("YSHRBRLn2pI", "libkernel", 1, "libkernel", 1, 1, writev);
LIB_FUNCTION("kAt6VDbHmro", "libkernel", 1, "libkernel", 1, 1, sceKernelWritev);
LIB_FUNCTION("Oy6IpwgtYOk", "libScePosix", 1, "libkernel", 1, 1, posix_lseek);
LIB_FUNCTION("Oy6IpwgtYOk", "libkernel", 1, "libkernel", 1, 1, posix_lseek);
LIB_FUNCTION("oib76F-12fk", "libkernel", 1, "libkernel", 1, 1, sceKernelLseek);

View file

@ -76,21 +76,21 @@ static PS4_SYSV_ABI void stack_chk_fail() {
UNREACHABLE();
}
static thread_local int g_posix_errno = 0;
static thread_local s32 g_posix_errno = 0;
int* PS4_SYSV_ABI __Error() {
s32* PS4_SYSV_ABI __Error() {
return &g_posix_errno;
}
void ErrSceToPosix(int error) {
void ErrSceToPosix(s32 error) {
g_posix_errno = error - ORBIS_KERNEL_ERROR_UNKNOWN;
}
int ErrnoToSceKernelError(int error) {
s32 ErrnoToSceKernelError(s32 error) {
return error + ORBIS_KERNEL_ERROR_UNKNOWN;
}
void SetPosixErrno(int e) {
void SetPosixErrno(s32 e) {
// Some error numbers are different between supported OSes
switch (e) {
case EPERM:
@ -132,15 +132,15 @@ void SetPosixErrno(int e) {
}
}
static uint64_t g_mspace_atomic_id_mask = 0;
static uint64_t g_mstate_table[64] = {0};
static u64 g_mspace_atomic_id_mask = 0;
static u64 g_mstate_table[64] = {0};
struct HeapInfoInfo {
uint64_t size = sizeof(HeapInfoInfo);
uint32_t flag;
uint32_t getSegmentInfo;
uint64_t* mspace_atomic_id_mask;
uint64_t* mstate_table;
u64 size = sizeof(HeapInfoInfo);
u32 flag;
u32 getSegmentInfo;
u64* mspace_atomic_id_mask;
u64* mstate_table;
};
void PS4_SYSV_ABI sceLibcHeapGetTraceInfo(HeapInfoInfo* info) {
@ -159,7 +159,7 @@ struct OrbisKernelUuid {
};
static_assert(sizeof(OrbisKernelUuid) == 0x10);
int PS4_SYSV_ABI sceKernelUuidCreate(OrbisKernelUuid* orbisUuid) {
s32 PS4_SYSV_ABI sceKernelUuidCreate(OrbisKernelUuid* orbisUuid) {
if (!orbisUuid) {
return ORBIS_KERNEL_ERROR_EINVAL;
}
@ -176,7 +176,7 @@ int PS4_SYSV_ABI sceKernelUuidCreate(OrbisKernelUuid* orbisUuid) {
return ORBIS_OK;
}
int PS4_SYSV_ABI kernel_ioctl(int fd, u64 cmd, VA_ARGS) {
s32 PS4_SYSV_ABI kernel_ioctl(s32 fd, u64 cmd, VA_ARGS) {
auto* h = Common::Singleton<Core::FileSys::HandleTable>::Instance();
auto* file = h->GetFile(fd);
if (file == nullptr) {
@ -190,7 +190,7 @@ int PS4_SYSV_ABI kernel_ioctl(int fd, u64 cmd, VA_ARGS) {
return -1;
}
VA_CTX(ctx);
int result = file->device->ioctl(cmd, &ctx);
s32 result = file->device->ioctl(cmd, &ctx);
LOG_TRACE(Lib_Kernel, "ioctl: fd = {:X} cmd = {:X} result = {}", fd, cmd, result);
if (result < 0) {
ErrSceToPosix(result);
@ -204,15 +204,15 @@ const char* PS4_SYSV_ABI sceKernelGetFsSandboxRandomWord() {
return path;
}
int PS4_SYSV_ABI _sigprocmask() {
s32 PS4_SYSV_ABI _sigprocmask() {
return ORBIS_OK;
}
int PS4_SYSV_ABI posix_getpagesize() {
s32 PS4_SYSV_ABI posix_getpagesize() {
return 16_KB;
}
int PS4_SYSV_ABI posix_getsockname(Libraries::Net::OrbisNetId s,
s32 PS4_SYSV_ABI posix_getsockname(Libraries::Net::OrbisNetId s,
Libraries::Net::OrbisNetSockaddr* addr, u32* paddrlen) {
auto* netcall = Common::Singleton<Libraries::Net::NetInternal>::Instance();
auto sock = netcall->FindSocket(s);
@ -221,7 +221,7 @@ int PS4_SYSV_ABI posix_getsockname(Libraries::Net::OrbisNetId s,
LOG_ERROR(Lib_Net, "socket id is invalid = {}", s);
return -1;
}
int returncode = sock->GetSocketAddress(addr, paddrlen);
s32 returncode = sock->GetSocketAddress(addr, paddrlen);
if (returncode >= 0) {
LOG_ERROR(Lib_Net, "return code : {:#x}", (u32)returncode);
return 0;
@ -230,6 +230,19 @@ int PS4_SYSV_ABI posix_getsockname(Libraries::Net::OrbisNetId s,
LOG_ERROR(Lib_Net, "error code returned : {:#x}", (u32)returncode);
return -1;
}
// stubbed on non-devkit consoles
s32 PS4_SYSV_ABI sceKernelGetGPI() {
LOG_DEBUG(Kernel, "called");
return ORBIS_OK;
}
// stubbed on non-devkit consoles
s32 PS4_SYSV_ABI sceKernelSetGPO() {
LOG_DEBUG(Kernel, "called");
return ORBIS_OK;
}
void RegisterKernel(Core::Loader::SymbolsResolver* sym) {
service_thread = std::jthread{KernelServiceThread};
@ -273,6 +286,13 @@ void RegisterKernel(Core::Loader::SymbolsResolver* sym) {
Libraries::Net::sceNetInetNtop); // TODO fix it to sys_ ...
LIB_FUNCTION("4n51s0zEf0c", "libScePosix", 1, "libkernel", 1, 1,
Libraries::Net::sceNetInetPton); // TODO fix it to sys_ ...
LIB_FUNCTION("XVL8So3QJUk", "libScePosix", 1, "libkernel", 1, 1, Libraries::Net::sys_connect);
LIB_FUNCTION("3e+4Iv7IJ8U", "libScePosix", 1, "libkernel", 1, 1, Libraries::Net::sys_accept);
LIB_FUNCTION("aNeavPDNKzA", "libScePosix", 1, "libkernel", 1, 1, Libraries::Net::sys_sendmsg);
LIB_FUNCTION("pxnCmagrtao", "libScePosix", 1, "libkernel", 1, 1, Libraries::Net::sys_listen);
LIB_FUNCTION("4oXYe9Xmk0Q", "libkernel", 1, "libkernel", 1, 1, sceKernelGetGPI);
LIB_FUNCTION("ca7v6Cxulzs", "libkernel", 1, "libkernel", 1, 1, sceKernelSetGPO);
}
} // namespace Libraries::Kernel

View file

@ -12,10 +12,10 @@ class SymbolsResolver;
namespace Libraries::Kernel {
void ErrSceToPosix(int result);
int ErrnoToSceKernelError(int e);
void SetPosixErrno(int e);
int* PS4_SYSV_ABI __Error();
void ErrSceToPosix(s32 result);
s32 ErrnoToSceKernelError(s32 e);
void SetPosixErrno(s32 e);
s32* PS4_SYSV_ABI __Error();
template <class F, F f>
struct OrbisWrapperImpl;
@ -33,7 +33,7 @@ struct OrbisWrapperImpl<PS4_SYSV_ABI R (*)(Args...), f> {
#define ORBIS(func) (Libraries::Kernel::OrbisWrapperImpl<decltype(&(func)), func>::wrap)
int* PS4_SYSV_ABI __Error();
s32* PS4_SYSV_ABI __Error();
void RegisterKernel(Core::Loader::SymbolsResolver* sym);

View file

@ -23,8 +23,8 @@ u64 PS4_SYSV_ABI sceKernelGetDirectMemorySize() {
return memory->GetTotalDirectSize();
}
int PS4_SYSV_ABI sceKernelAllocateDirectMemory(s64 searchStart, s64 searchEnd, u64 len,
u64 alignment, int memoryType, s64* physAddrOut) {
s32 PS4_SYSV_ABI sceKernelAllocateDirectMemory(s64 searchStart, s64 searchEnd, u64 len,
u64 alignment, s32 memoryType, s64* physAddrOut) {
if (searchStart < 0 || searchEnd < 0) {
LOG_ERROR(Kernel_Vmm, "Invalid parameters!");
return ORBIS_KERNEL_ERROR_EINVAL;
@ -71,13 +71,13 @@ int PS4_SYSV_ABI sceKernelAllocateDirectMemory(s64 searchStart, s64 searchEnd, u
return ORBIS_OK;
}
s32 PS4_SYSV_ABI sceKernelAllocateMainDirectMemory(size_t len, size_t alignment, int memoryType,
s32 PS4_SYSV_ABI sceKernelAllocateMainDirectMemory(u64 len, u64 alignment, s32 memoryType,
s64* physAddrOut) {
const auto searchEnd = static_cast<s64>(sceKernelGetDirectMemorySize());
return sceKernelAllocateDirectMemory(0, searchEnd, len, alignment, memoryType, physAddrOut);
}
s32 PS4_SYSV_ABI sceKernelCheckedReleaseDirectMemory(u64 start, size_t len) {
s32 PS4_SYSV_ABI sceKernelCheckedReleaseDirectMemory(u64 start, u64 len) {
if (len == 0) {
return ORBIS_OK;
}
@ -87,7 +87,7 @@ s32 PS4_SYSV_ABI sceKernelCheckedReleaseDirectMemory(u64 start, size_t len) {
return ORBIS_OK;
}
s32 PS4_SYSV_ABI sceKernelReleaseDirectMemory(u64 start, size_t len) {
s32 PS4_SYSV_ABI sceKernelReleaseDirectMemory(u64 start, u64 len) {
if (len == 0) {
return ORBIS_OK;
}
@ -96,10 +96,9 @@ s32 PS4_SYSV_ABI sceKernelReleaseDirectMemory(u64 start, size_t len) {
return ORBIS_OK;
}
s32 PS4_SYSV_ABI sceKernelAvailableDirectMemorySize(u64 searchStart, u64 searchEnd,
size_t alignment, u64* physAddrOut,
size_t* sizeOut) {
LOG_WARNING(Kernel_Vmm, "called searchStart = {:#x}, searchEnd = {:#x}, alignment = {:#x}",
s32 PS4_SYSV_ABI sceKernelAvailableDirectMemorySize(u64 searchStart, u64 searchEnd, u64 alignment,
u64* physAddrOut, u64* sizeOut) {
LOG_INFO(Kernel_Vmm, "called searchStart = {:#x}, searchEnd = {:#x}, alignment = {:#x}",
searchStart, searchEnd, alignment);
if (physAddrOut == nullptr || sizeOut == nullptr) {
@ -109,7 +108,7 @@ s32 PS4_SYSV_ABI sceKernelAvailableDirectMemorySize(u64 searchStart, u64 searchE
auto* memory = Core::Memory::Instance();
PAddr physAddr{};
size_t size{};
u64 size{};
s32 result = memory->DirectQueryAvailable(searchStart, searchEnd, alignment, &physAddr, &size);
if (size == 0) {
@ -122,14 +121,14 @@ s32 PS4_SYSV_ABI sceKernelAvailableDirectMemorySize(u64 searchStart, u64 searchE
return result;
}
s32 PS4_SYSV_ABI sceKernelVirtualQuery(const void* addr, int flags, OrbisVirtualQueryInfo* info,
size_t infoSize) {
s32 PS4_SYSV_ABI sceKernelVirtualQuery(const void* addr, s32 flags, OrbisVirtualQueryInfo* info,
u64 infoSize) {
LOG_INFO(Kernel_Vmm, "called addr = {}, flags = {:#x}", fmt::ptr(addr), flags);
auto* memory = Core::Memory::Instance();
return memory->VirtualQuery(std::bit_cast<VAddr>(addr), flags, info);
}
s32 PS4_SYSV_ABI sceKernelReserveVirtualRange(void** addr, u64 len, int flags, u64 alignment) {
s32 PS4_SYSV_ABI sceKernelReserveVirtualRange(void** addr, u64 len, s32 flags, u64 alignment) {
LOG_INFO(Kernel_Vmm, "addr = {}, len = {:#x}, flags = {:#x}, alignment = {:#x}",
fmt::ptr(*addr), len, flags, alignment);
if (addr == nullptr) {
@ -159,7 +158,7 @@ s32 PS4_SYSV_ABI sceKernelReserveVirtualRange(void** addr, u64 len, int flags, u
return result;
}
int PS4_SYSV_ABI sceKernelMapNamedDirectMemory(void** addr, u64 len, int prot, int flags,
s32 PS4_SYSV_ABI sceKernelMapNamedDirectMemory(void** addr, u64 len, s32 prot, s32 flags,
s64 directMemoryStart, u64 alignment,
const char* name) {
LOG_INFO(Kernel_Vmm,
@ -202,7 +201,7 @@ int PS4_SYSV_ABI sceKernelMapNamedDirectMemory(void** addr, u64 len, int prot, i
return ret;
}
int PS4_SYSV_ABI sceKernelMapDirectMemory(void** addr, u64 len, int prot, int flags,
s32 PS4_SYSV_ABI sceKernelMapDirectMemory(void** addr, u64 len, s32 prot, s32 flags,
s64 directMemoryStart, u64 alignment) {
LOG_INFO(Kernel_Vmm, "called, redirected to sceKernelMapNamedDirectMemory");
return sceKernelMapNamedDirectMemory(addr, len, prot, flags, directMemoryStart, alignment,
@ -222,9 +221,10 @@ s32 PS4_SYSV_ABI sceKernelMapDirectMemory2(void** addr, u64 len, s32 type, s32 p
return ret;
}
s32 PS4_SYSV_ABI sceKernelMapNamedFlexibleMemory(void** addr_in_out, std::size_t len, int prot,
int flags, const char* name) {
s32 PS4_SYSV_ABI sceKernelMapNamedFlexibleMemory(void** addr_in_out, u64 len, s32 prot, s32 flags,
const char* name) {
LOG_INFO(Kernel_Vmm, "in_addr = {}, len = {:#x}, prot = {:#x}, flags = {:#x}, name = '{}'",
fmt::ptr(*addr_in_out), len, prot, flags, name);
if (len == 0 || !Common::Is16KBAligned(len)) {
LOG_ERROR(Kernel_Vmm, "len is 0 or not 16kb multiple");
return ORBIS_KERNEL_ERROR_EINVAL;
@ -243,22 +243,18 @@ s32 PS4_SYSV_ABI sceKernelMapNamedFlexibleMemory(void** addr_in_out, std::size_t
const VAddr in_addr = reinterpret_cast<VAddr>(*addr_in_out);
const auto mem_prot = static_cast<Core::MemoryProt>(prot);
const auto map_flags = static_cast<Core::MemoryMapFlags>(flags);
SCOPE_EXIT {
LOG_INFO(Kernel_Vmm,
"in_addr = {:#x}, out_addr = {}, len = {:#x}, prot = {:#x}, flags = {:#x}",
in_addr, fmt::ptr(*addr_in_out), len, prot, flags);
};
auto* memory = Core::Memory::Instance();
return memory->MapMemory(addr_in_out, in_addr, len, mem_prot, map_flags,
const auto ret = memory->MapMemory(addr_in_out, in_addr, len, mem_prot, map_flags,
Core::VMAType::Flexible, name);
LOG_INFO(Kernel_Vmm, "out_addr = {}", fmt::ptr(*addr_in_out));
return ret;
}
s32 PS4_SYSV_ABI sceKernelMapFlexibleMemory(void** addr_in_out, std::size_t len, int prot,
int flags) {
s32 PS4_SYSV_ABI sceKernelMapFlexibleMemory(void** addr_in_out, u64 len, s32 prot, s32 flags) {
return sceKernelMapNamedFlexibleMemory(addr_in_out, len, prot, flags, "anon");
}
int PS4_SYSV_ABI sceKernelQueryMemoryProtection(void* addr, void** start, void** end, u32* prot) {
s32 PS4_SYSV_ABI sceKernelQueryMemoryProtection(void* addr, void** start, void** end, u32* prot) {
auto* memory = Core::Memory::Instance();
return memory->QueryProtection(std::bit_cast<VAddr>(addr), start, end, prot);
}
@ -288,14 +284,14 @@ s32 PS4_SYSV_ABI sceKernelMtypeprotect(const void* addr, u64 size, s32 mtype, s3
return memory_manager->Protect(std::bit_cast<VAddr>(addr), size, protection_flags);
}
int PS4_SYSV_ABI sceKernelDirectMemoryQuery(u64 offset, int flags, OrbisQueryInfo* query_info,
size_t infoSize) {
LOG_WARNING(Kernel_Vmm, "called offset = {:#x}, flags = {:#x}", offset, flags);
s32 PS4_SYSV_ABI sceKernelDirectMemoryQuery(u64 offset, s32 flags, OrbisQueryInfo* query_info,
u64 infoSize) {
LOG_INFO(Kernel_Vmm, "called offset = {:#x}, flags = {:#x}", offset, flags);
auto* memory = Core::Memory::Instance();
return memory->DirectMemoryQuery(offset, flags == 1, query_info);
}
s32 PS4_SYSV_ABI sceKernelAvailableFlexibleMemorySize(size_t* out_size) {
s32 PS4_SYSV_ABI sceKernelAvailableFlexibleMemorySize(u64* out_size) {
auto* memory = Core::Memory::Instance();
*out_size = memory->GetAvailableFlexibleSize();
LOG_INFO(Kernel_Vmm, "called size = {:#x}", *out_size);
@ -307,7 +303,7 @@ void PS4_SYSV_ABI _sceKernelRtldSetApplicationHeapAPI(void* func[]) {
linker->SetHeapAPI(func);
}
int PS4_SYSV_ABI sceKernelGetDirectMemoryType(u64 addr, int* directMemoryTypeOut,
s32 PS4_SYSV_ABI sceKernelGetDirectMemoryType(u64 addr, s32* directMemoryTypeOut,
void** directMemoryStartOut,
void** directMemoryEndOut) {
LOG_WARNING(Kernel_Vmm, "called, direct memory addr = {:#x}", addr);
@ -316,23 +312,23 @@ int PS4_SYSV_ABI sceKernelGetDirectMemoryType(u64 addr, int* directMemoryTypeOut
directMemoryEndOut);
}
int PS4_SYSV_ABI sceKernelIsStack(void* addr, void** start, void** end) {
s32 PS4_SYSV_ABI sceKernelIsStack(void* addr, void** start, void** end) {
LOG_DEBUG(Kernel_Vmm, "called, addr = {}", fmt::ptr(addr));
auto* memory = Core::Memory::Instance();
return memory->IsStack(std::bit_cast<VAddr>(addr), start, end);
}
s32 PS4_SYSV_ABI sceKernelBatchMap(OrbisKernelBatchMapEntry* entries, int numEntries,
int* numEntriesOut) {
s32 PS4_SYSV_ABI sceKernelBatchMap(OrbisKernelBatchMapEntry* entries, s32 numEntries,
s32* numEntriesOut) {
return sceKernelBatchMap2(entries, numEntries, numEntriesOut,
MemoryFlags::SCE_KERNEL_MAP_FIXED); // 0x10, 0x410?
}
s32 PS4_SYSV_ABI sceKernelBatchMap2(OrbisKernelBatchMapEntry* entries, int numEntries,
int* numEntriesOut, int flags) {
int result = ORBIS_OK;
int processed = 0;
for (int i = 0; i < numEntries; i++, processed++) {
s32 PS4_SYSV_ABI sceKernelBatchMap2(OrbisKernelBatchMapEntry* entries, s32 numEntries,
s32* numEntriesOut, s32 flags) {
s32 result = ORBIS_OK;
s32 processed = 0;
for (s32 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.
@ -622,7 +618,7 @@ s32 PS4_SYSV_ABI sceKernelConfiguredFlexibleMemorySize(u64* sizeOut) {
return ORBIS_OK;
}
int PS4_SYSV_ABI sceKernelMunmap(void* addr, size_t len) {
s32 PS4_SYSV_ABI sceKernelMunmap(void* addr, u64 len) {
LOG_INFO(Kernel_Vmm, "addr = {}, len = {:#x}", fmt::ptr(addr), len);
if (len == 0) {
return ORBIS_KERNEL_ERROR_EINVAL;
@ -631,8 +627,8 @@ int PS4_SYSV_ABI sceKernelMunmap(void* addr, size_t len) {
return memory->UnmapMemory(std::bit_cast<VAddr>(addr), len);
}
int PS4_SYSV_ABI posix_munmap(void* addr, size_t len) {
int result = sceKernelMunmap(addr, len);
s32 PS4_SYSV_ABI posix_munmap(void* addr, u64 len) {
s32 result = sceKernelMunmap(addr, len);
if (result < 0) {
LOG_ERROR(Kernel_Pthread, "posix_munmap: error = {}", result);
ErrSceToPosix(result);
@ -641,12 +637,12 @@ int PS4_SYSV_ABI posix_munmap(void* addr, size_t len) {
return result;
}
static constexpr int MAX_PRT_APERTURES = 3;
static constexpr s32 MAX_PRT_APERTURES = 3;
static constexpr VAddr PRT_AREA_START_ADDR = 0x1000000000;
static constexpr size_t PRT_AREA_SIZE = 0xec00000000;
static std::array<std::pair<VAddr, size_t>, MAX_PRT_APERTURES> PrtApertures{};
static constexpr u64 PRT_AREA_SIZE = 0xec00000000;
static std::array<std::pair<VAddr, u64>, MAX_PRT_APERTURES> PrtApertures{};
int PS4_SYSV_ABI sceKernelSetPrtAperture(int id, VAddr address, size_t size) {
s32 PS4_SYSV_ABI sceKernelSetPrtAperture(s32 id, VAddr address, u64 size) {
if (id < 0 || id >= MAX_PRT_APERTURES) {
return ORBIS_KERNEL_ERROR_EINVAL;
}
@ -663,11 +659,14 @@ int PS4_SYSV_ABI sceKernelSetPrtAperture(int id, VAddr address, size_t size) {
"PRT aperture id = {}, address = {:#x}, size = {:#x} is set but not used", id,
address, size);
auto* memory = Core::Memory::Instance();
memory->SetPrtArea(id, address, size);
PrtApertures[id] = {address, size};
return ORBIS_OK;
}
int PS4_SYSV_ABI sceKernelGetPrtAperture(int id, VAddr* address, size_t* size) {
s32 PS4_SYSV_ABI sceKernelGetPrtAperture(s32 id, VAddr* address, u64* size) {
if (id < 0 || id >= MAX_PRT_APERTURES) {
return ORBIS_KERNEL_ERROR_EINVAL;
}

View file

@ -52,13 +52,13 @@ constexpr u32 ORBIS_KERNEL_MAXIMUM_NAME_LENGTH = 32;
struct OrbisQueryInfo {
uintptr_t start;
uintptr_t end;
int memoryType;
s32 memoryType;
};
struct OrbisVirtualQueryInfo {
uintptr_t start;
uintptr_t end;
size_t offset;
u64 offset;
s32 protection;
s32 memory_type;
u8 is_flexible : 1;
@ -73,12 +73,12 @@ static_assert(sizeof(OrbisVirtualQueryInfo) == 72,
struct OrbisKernelBatchMapEntry {
void* start;
size_t offset;
size_t length;
u64 offset;
u64 length;
char protection;
char type;
short reserved;
int operation;
s16 reserved;
s32 operation;
};
enum class OrbisKernelMemoryPoolOpcode : u32 {
@ -124,46 +124,44 @@ struct OrbisKernelMemoryPoolBatchEntry {
};
u64 PS4_SYSV_ABI sceKernelGetDirectMemorySize();
int PS4_SYSV_ABI sceKernelAllocateDirectMemory(s64 searchStart, s64 searchEnd, u64 len,
u64 alignment, int memoryType, s64* physAddrOut);
int PS4_SYSV_ABI sceKernelMapNamedDirectMemory(void** addr, u64 len, int prot, int flags,
s32 PS4_SYSV_ABI sceKernelAllocateDirectMemory(s64 searchStart, s64 searchEnd, u64 len,
u64 alignment, s32 memoryType, s64* physAddrOut);
s32 PS4_SYSV_ABI sceKernelMapNamedDirectMemory(void** addr, u64 len, s32 prot, s32 flags,
s64 directMemoryStart, u64 alignment,
const char* name);
int PS4_SYSV_ABI sceKernelMapDirectMemory(void** addr, u64 len, int prot, int flags,
s32 PS4_SYSV_ABI sceKernelMapDirectMemory(void** addr, u64 len, s32 prot, s32 flags,
s64 directMemoryStart, u64 alignment);
s32 PS4_SYSV_ABI sceKernelAllocateMainDirectMemory(size_t len, size_t alignment, int memoryType,
s32 PS4_SYSV_ABI sceKernelAllocateMainDirectMemory(u64 len, u64 alignment, s32 memoryType,
s64* physAddrOut);
s32 PS4_SYSV_ABI sceKernelReleaseDirectMemory(u64 start, size_t len);
s32 PS4_SYSV_ABI sceKernelCheckedReleaseDirectMemory(u64 start, size_t len);
s32 PS4_SYSV_ABI sceKernelAvailableDirectMemorySize(u64 searchStart, u64 searchEnd,
size_t alignment, u64* physAddrOut,
size_t* sizeOut);
s32 PS4_SYSV_ABI sceKernelVirtualQuery(const void* addr, int flags, OrbisVirtualQueryInfo* info,
size_t infoSize);
s32 PS4_SYSV_ABI sceKernelReserveVirtualRange(void** addr, u64 len, int flags, u64 alignment);
s32 PS4_SYSV_ABI sceKernelMapNamedFlexibleMemory(void** addrInOut, std::size_t len, int prot,
int flags, const char* name);
s32 PS4_SYSV_ABI sceKernelMapFlexibleMemory(void** addr_in_out, std::size_t len, int prot,
int flags);
int PS4_SYSV_ABI sceKernelQueryMemoryProtection(void* addr, void** start, void** end, u32* prot);
s32 PS4_SYSV_ABI sceKernelReleaseDirectMemory(u64 start, u64 len);
s32 PS4_SYSV_ABI sceKernelCheckedReleaseDirectMemory(u64 start, u64 len);
s32 PS4_SYSV_ABI sceKernelAvailableDirectMemorySize(u64 searchStart, u64 searchEnd, u64 alignment,
u64* physAddrOut, u64* sizeOut);
s32 PS4_SYSV_ABI sceKernelVirtualQuery(const void* addr, s32 flags, OrbisVirtualQueryInfo* info,
u64 infoSize);
s32 PS4_SYSV_ABI sceKernelReserveVirtualRange(void** addr, u64 len, s32 flags, u64 alignment);
s32 PS4_SYSV_ABI sceKernelMapNamedFlexibleMemory(void** addr_in_out, u64 len, s32 prot, s32 flags,
const char* name);
s32 PS4_SYSV_ABI sceKernelMapFlexibleMemory(void** addr_in_out, u64 len, s32 prot, s32 flags);
s32 PS4_SYSV_ABI sceKernelQueryMemoryProtection(void* addr, void** start, void** end, u32* prot);
s32 PS4_SYSV_ABI sceKernelMprotect(const void* addr, u64 size, s32 prot);
s32 PS4_SYSV_ABI sceKernelMtypeprotect(const void* addr, u64 size, s32 mtype, s32 prot);
int PS4_SYSV_ABI sceKernelDirectMemoryQuery(u64 offset, int flags, OrbisQueryInfo* query_info,
size_t infoSize);
s32 PS4_SYSV_ABI sceKernelAvailableFlexibleMemorySize(size_t* sizeOut);
s32 PS4_SYSV_ABI sceKernelDirectMemoryQuery(u64 offset, s32 flags, OrbisQueryInfo* query_info,
u64 infoSize);
s32 PS4_SYSV_ABI sceKernelAvailableFlexibleMemorySize(u64* sizeOut);
void PS4_SYSV_ABI _sceKernelRtldSetApplicationHeapAPI(void* func[]);
int PS4_SYSV_ABI sceKernelGetDirectMemoryType(u64 addr, int* directMemoryTypeOut,
s32 PS4_SYSV_ABI sceKernelGetDirectMemoryType(u64 addr, s32* directMemoryTypeOut,
void** directMemoryStartOut,
void** directMemoryEndOut);
int PS4_SYSV_ABI sceKernelIsStack(void* addr, void** start, void** end);
s32 PS4_SYSV_ABI sceKernelIsStack(void* addr, void** start, void** end);
s32 PS4_SYSV_ABI sceKernelBatchMap(OrbisKernelBatchMapEntry* entries, int numEntries,
int* numEntriesOut);
s32 PS4_SYSV_ABI sceKernelBatchMap2(OrbisKernelBatchMapEntry* entries, int numEntries,
int* numEntriesOut, int flags);
s32 PS4_SYSV_ABI sceKernelBatchMap(OrbisKernelBatchMapEntry* entries, s32 numEntries,
s32* numEntriesOut);
s32 PS4_SYSV_ABI sceKernelBatchMap2(OrbisKernelBatchMapEntry* entries, s32 numEntries,
s32* numEntriesOut, s32 flags);
s32 PS4_SYSV_ABI sceKernelSetVirtualRangeName(const void* addr, u64 len, const char* name);
@ -176,7 +174,7 @@ s32 PS4_SYSV_ABI sceKernelMemoryPoolDecommit(void* addr, u64 len, s32 flags);
s32 PS4_SYSV_ABI sceKernelMemoryPoolBatch(const OrbisKernelMemoryPoolBatchEntry* entries, s32 count,
s32* num_processed, s32 flags);
int PS4_SYSV_ABI sceKernelMunmap(void* addr, size_t len);
s32 PS4_SYSV_ABI sceKernelMunmap(void* addr, u64 len);
void RegisterMemory(Core::Loader::SymbolsResolver* sym);

View file

@ -426,6 +426,7 @@ void RegisterMutex(Core::Loader::SymbolsResolver* sym) {
// Posix
LIB_FUNCTION("ttHNfU+qDBU", "libScePosix", 1, "libkernel", 1, 1, posix_pthread_mutex_init);
LIB_FUNCTION("7H0iTOciTLo", "libScePosix", 1, "libkernel", 1, 1, posix_pthread_mutex_lock);
LIB_FUNCTION("Io9+nTKXZtA", "libScePosix", 1, "libkernel", 1, 1, posix_pthread_mutex_timedlock);
LIB_FUNCTION("2Z+PpY6CaJg", "libScePosix", 1, "libkernel", 1, 1, posix_pthread_mutex_unlock);
LIB_FUNCTION("ltCfaGr2JGE", "libScePosix", 1, "libkernel", 1, 1, posix_pthread_mutex_destroy);
LIB_FUNCTION("dQHWEsJtoE4", "libScePosix", 1, "libkernel", 1, 1, posix_pthread_mutexattr_init);

View file

@ -100,6 +100,11 @@ s32 SystemSetupCore(StackBuffer* stackBuffer, const OrbisNgs2SystemOption* optio
return ORBIS_NGS2_ERROR_INVALID_SAMPLE_RATE;
}
if (outSystem) {
// dummy handle
outSystem->systemHandle = 1;
}
return ORBIS_OK;
}

View file

@ -164,10 +164,12 @@ s32 PS4_SYSV_ABI sceNpTrophyCreateContext(OrbisNpTrophyContext* context, int32_t
}
const auto ctx_id = trophy_contexts.insert(user_id, service_label);
contexts_internal[key].context_id = ctx_id.index;
LOG_INFO(Lib_NpTrophy, "New context = {}, user_id = {} service label = {}", ctx_id.index,
user_id, service_label);
*context = ctx_id.index;
*context = ctx_id.index + 1;
contexts_internal[key].context_id = *context;
LOG_INFO(Lib_NpTrophy, "New context = {}, user_id = {} service label = {}", *context, user_id,
service_label);
return ORBIS_OK;
}
@ -179,21 +181,27 @@ s32 PS4_SYSV_ABI sceNpTrophyCreateHandle(OrbisNpTrophyHandle* handle) {
if (trophy_handles.size() >= MaxTrophyHandles) {
return ORBIS_NP_TROPHY_ERROR_HANDLE_EXCEEDS_MAX;
}
const auto handle_id = trophy_handles.insert();
LOG_INFO(Lib_NpTrophy, "New handle = {}", handle_id.index);
*handle = handle_id.index;
const auto handle_id = trophy_handles.insert();
*handle = handle_id.index + 1;
LOG_INFO(Lib_NpTrophy, "New handle = {}", *handle);
return ORBIS_OK;
}
int PS4_SYSV_ABI sceNpTrophyDestroyContext(OrbisNpTrophyContext context) {
LOG_INFO(Lib_NpTrophy, "Destroyed Context {}", context);
if (context == ORBIS_NP_TROPHY_INVALID_CONTEXT)
if (context == ORBIS_NP_TROPHY_INVALID_CONTEXT) {
return ORBIS_NP_TROPHY_ERROR_INVALID_CONTEXT;
}
Common::SlotId contextId;
contextId.index = context;
contextId.index = context - 1;
if (contextId.index >= trophy_contexts.size()) {
return ORBIS_NP_TROPHY_ERROR_INVALID_CONTEXT;
}
ContextKey contextkey = trophy_contexts[contextId];
trophy_contexts.erase(contextId);
@ -206,15 +214,17 @@ s32 PS4_SYSV_ABI sceNpTrophyDestroyHandle(OrbisNpTrophyHandle handle) {
if (handle == ORBIS_NP_TROPHY_INVALID_HANDLE)
return ORBIS_NP_TROPHY_ERROR_INVALID_HANDLE;
if (handle >= trophy_handles.size()) {
s32 handle_index = handle - 1;
if (handle_index >= trophy_handles.size()) {
LOG_ERROR(Lib_NpTrophy, "Invalid handle {}", handle);
return ORBIS_NP_TROPHY_ERROR_INVALID_HANDLE;
}
if (!trophy_handles.is_allocated({static_cast<u32>(handle)})) {
if (!trophy_handles.is_allocated({static_cast<u32>(handle_index)})) {
return ORBIS_NP_TROPHY_ERROR_INVALID_HANDLE;
}
trophy_handles.erase({static_cast<u32>(handle)});
trophy_handles.erase({static_cast<u32>(handle_index)});
LOG_INFO(Lib_NpTrophy, "Handle {} destroyed", handle);
return ORBIS_OK;
}

View file

@ -447,22 +447,19 @@ int PS4_SYSV_ABI scePadReadState(s32 handle, OrbisPadData* pData) {
// Only do this on handle 1 for now
if (engine && handle == 1) {
const auto gyro_poll_rate = engine->GetAccelPollRate();
if (gyro_poll_rate != 0.0f) {
auto now = std::chrono::steady_clock::now();
float deltaTime = std::chrono::duration_cast<std::chrono::microseconds>(
now - controller->GetLastUpdate())
float deltaTime =
std::chrono::duration_cast<std::chrono::microseconds>(now - controller->GetLastUpdate())
.count() /
1000000.0f;
controller->SetLastUpdate(now);
Libraries::Pad::OrbisFQuaternion lastOrientation = controller->GetLastOrientation();
Libraries::Pad::OrbisFQuaternion outputOrientation = {0.0f, 0.0f, 0.0f, 1.0f};
GameController::CalculateOrientation(pData->acceleration, pData->angularVelocity,
deltaTime, lastOrientation, outputOrientation);
GameController::CalculateOrientation(pData->acceleration, pData->angularVelocity, deltaTime,
lastOrientation, outputOrientation);
pData->orientation = outputOrientation;
controller->SetLastOrientation(outputOrientation);
}
}
pData->touchData.touchNum =
(state.touchpad[0].state ? 1 : 0) + (state.touchpad[1].state ? 1 : 0);

View file

@ -22,25 +22,25 @@ static Core::FileSys::MntPoints* g_mnt = Common::Singleton<Core::FileSys::MntPoi
namespace fs = std::filesystem;
// clang-format off
static const std::unordered_map<std::string, std::string> default_title = {
{"ja_JP", "セーブデータ"},
{"en_US", "Saved Data"},
{"fr_FR", "Données sauvegardées"},
{"es_ES", "Datos guardados"},
{"de_DE", "Gespeicherte Daten"},
{"it_IT", "Dati salvati"},
{"nl_NL", "Opgeslagen data"},
{"pt_PT", "Dados guardados"},
{"ru_RU", "Сохраненные данные"},
{"ko_KR", "저장 데이터"},
{"zh_CN", "保存数据"},
{"fi_FI", "Tallennetut tiedot"},
{"sv_SE", "Sparade data"},
{"da_DK", "Gemte data"},
{"no_NO", "Lagrede data"},
{"pl_PL", "Zapisane dane"},
{"pt_BR", "Dados salvos"},
{"tr_TR", "Kayıtlı Veriler"},
static const std::unordered_map<int, std::string> default_title = {
{0/*"ja_JP"*/, "セーブデータ"},
{1/*"en_US"*/, "Saved Data"},
{2/*"fr_FR"*/, "Données sauvegardées"},
{3/*"es_ES"*/, "Datos guardados"},
{4/*"de_DE"*/, "Gespeicherte Daten"},
{5/*"it_IT"*/, "Dati salvati"},
{6/*"nl_NL"*/, "Opgeslagen data"},
{7/*"pt_PT"*/, "Dados guardados"},
{8/*"ru_RU"*/, "Сохраненные данные"},
{9/*"ko_KR"*/, "저장 데이터"},
{10/*"zh_CN"*/, "保存数据"},
{12/*"fi_FI"*/, "Tallennetut tiedot"},
{13/*"sv_SE"*/, "Sparade data"},
{14/*"da_DK"*/, "Gemte data"},
{15/*"no_NO"*/, "Lagrede data"},
{16/*"pl_PL"*/, "Zapisane dane"},
{17/*"pt_BR"*/, "Dados salvos"},
{19/*"tr_TR"*/, "Kayıtlı Veriler"},
};
// clang-format on
@ -71,9 +71,9 @@ fs::path SaveInstance::GetParamSFOPath(const fs::path& dir_path) {
void SaveInstance::SetupDefaultParamSFO(PSF& param_sfo, std::string dir_name,
std::string game_serial) {
std::string locale = Config::getEmulatorLanguage();
int locale = Config::GetLanguage();
if (!default_title.contains(locale)) {
locale = "en_US";
locale = 1; // default to en_US if not found
}
#define P(type, key, ...) param_sfo.Add##type(std::string{key}, __VA_ARGS__)

View file

@ -140,7 +140,7 @@ s32 PS4_SYSV_ABI sceVideodec2Flush(OrbisVideodec2Decoder decoder,
return ORBIS_VIDEODEC2_ERROR_ARGUMENT_POINTER;
}
if (frameBuffer->thisSize != sizeof(OrbisVideodec2FrameBuffer) ||
outputInfo->thisSize != sizeof(OrbisVideodec2OutputInfo)) {
(outputInfo->thisSize | 8) != sizeof(OrbisVideodec2OutputInfo)) {
LOG_ERROR(Lib_Vdec2, "Invalid struct size");
return ORBIS_VIDEODEC2_ERROR_STRUCT_SIZE;
}
@ -167,7 +167,7 @@ s32 PS4_SYSV_ABI sceVideodec2GetPictureInfo(const OrbisVideodec2OutputInfo* outp
LOG_ERROR(Lib_Vdec2, "Invalid arguments");
return ORBIS_VIDEODEC2_ERROR_ARGUMENT_POINTER;
}
if (outputInfo->thisSize != sizeof(OrbisVideodec2OutputInfo)) {
if ((outputInfo->thisSize | 8) != sizeof(OrbisVideodec2OutputInfo)) {
LOG_ERROR(Lib_Vdec2, "Invalid struct size");
return ORBIS_VIDEODEC2_ERROR_STRUCT_SIZE;
}
@ -179,7 +179,7 @@ s32 PS4_SYSV_ABI sceVideodec2GetPictureInfo(const OrbisVideodec2OutputInfo* outp
if (p1stPictureInfoOut) {
OrbisVideodec2AvcPictureInfo* picInfo =
static_cast<OrbisVideodec2AvcPictureInfo*>(p1stPictureInfoOut);
if (picInfo->thisSize != sizeof(OrbisVideodec2AvcPictureInfo)) {
if ((picInfo->thisSize | 16) != sizeof(OrbisVideodec2AvcPictureInfo)) {
LOG_ERROR(Lib_Vdec2, "Invalid struct size");
return ORBIS_VIDEODEC2_ERROR_STRUCT_SIZE;
}

View file

@ -73,8 +73,10 @@ struct OrbisVideodec2OutputInfo {
u32 frameHeight;
void* frameBuffer;
u64 frameBufferSize;
u32 frameFormat;
u32 framePitchInBytes;
};
static_assert(sizeof(OrbisVideodec2OutputInfo) == 0x30);
static_assert(sizeof(OrbisVideodec2OutputInfo) == 0x38);
struct OrbisVideodec2FrameBuffer {
u64 thisSize;

View file

@ -55,6 +55,23 @@ struct OrbisVideodec2AvcPictureInfo {
u8 pic_struct;
u8 field_pic_flag;
u8 bottom_field_flag;
u8 sequenceParameterSetPresentFlag;
u8 pictureParameterSetPresentFlag;
u8 auDelimiterPresentFlag;
u8 endOfSequencePresentFlag;
u8 endOfStreamPresentFlag;
u8 fillerDataPresentFlag;
u8 pictureTimingSeiPresentFlag;
u8 bufferingPeriodSeiPresentFlag;
u8 constraint_set0_flag;
u8 constraint_set1_flag;
u8 constraint_set2_flag;
u8 constraint_set3_flag;
u8 constraint_set4_flag;
u8 constraint_set5_flag;
};
static_assert(sizeof(OrbisVideodec2AvcPictureInfo) == 0x78);
} // namespace Libraries::Vdec2

View file

@ -44,11 +44,15 @@ s32 VdecDecoder::Decode(const OrbisVideodec2InputData& inputData,
OrbisVideodec2FrameBuffer& frameBuffer,
OrbisVideodec2OutputInfo& outputInfo) {
frameBuffer.isAccepted = false;
outputInfo.thisSize = sizeof(OrbisVideodec2OutputInfo);
outputInfo.isValid = false;
outputInfo.isErrorFrame = true;
outputInfo.pictureCount = 0;
// Only set frameFormat if the game uses the newer struct version.
if (outputInfo.thisSize == sizeof(OrbisVideodec2OutputInfo)) {
outputInfo.frameFormat = 0;
}
if (!inputData.auData) {
return ORBIS_VIDEODEC2_ERROR_ACCESS_UNIT_POINTER;
}
@ -113,6 +117,11 @@ s32 VdecDecoder::Decode(const OrbisVideodec2InputData& inputData,
outputInfo.isErrorFrame = false;
outputInfo.pictureCount = 1; // TODO: 2 pictures for interlaced video
// Only set framePitchInBytes if the game uses the newer struct version.
if (outputInfo.thisSize == sizeof(OrbisVideodec2OutputInfo)) {
outputInfo.framePitchInBytes = frame->linesize[0];
}
if (outputInfo.isValid) {
OrbisVideodec2AvcPictureInfo pictureInfo = {};
@ -140,11 +149,15 @@ s32 VdecDecoder::Decode(const OrbisVideodec2InputData& inputData,
s32 VdecDecoder::Flush(OrbisVideodec2FrameBuffer& frameBuffer,
OrbisVideodec2OutputInfo& outputInfo) {
frameBuffer.isAccepted = false;
outputInfo.thisSize = sizeof(OrbisVideodec2OutputInfo);
outputInfo.isValid = false;
outputInfo.isErrorFrame = true;
outputInfo.pictureCount = 0;
// Only set frameFormat if the game uses the newer struct version.
if (outputInfo.thisSize == sizeof(OrbisVideodec2OutputInfo)) {
outputInfo.frameFormat = 0;
}
AVFrame* frame = av_frame_alloc();
if (!frame) {
LOG_ERROR(Lib_Vdec2, "Failed to allocate frame");
@ -182,6 +195,11 @@ s32 VdecDecoder::Flush(OrbisVideodec2FrameBuffer& frameBuffer,
outputInfo.isErrorFrame = false;
outputInfo.pictureCount = 1; // TODO: 2 pictures for interlaced video
// Only set framePitchInBytes if the game uses the newer struct version.
if (outputInfo.thisSize == sizeof(OrbisVideodec2OutputInfo)) {
outputInfo.framePitchInBytes = frame->linesize[0];
}
// FIXME: Should we add picture info here too?
}

View file

@ -282,7 +282,12 @@ s32 PS4_SYSV_ABI sceVideoOutGetVblankStatus(int handle, SceVideoOutVblankStatus*
s32 PS4_SYSV_ABI sceVideoOutGetResolutionStatus(s32 handle, SceVideoOutResolutionStatus* status) {
LOG_INFO(Lib_VideoOut, "called");
*status = driver->GetPort(handle)->resolution;
auto* port = driver->GetPort(handle);
if (!port || !port->is_open) {
return ORBIS_VIDEO_OUT_ERROR_INVALID_HANDLE;
}
*status = port->resolution;
return ORBIS_OK;
}

View file

@ -51,7 +51,7 @@ void ZlibTaskThread(const std::stop_token& stop) {
if (!task_queue_cv.wait(lock, stop, [&] { return !task_queue.empty(); })) {
break;
}
task = task_queue.back();
task = task_queue.front();
task_queue.pop();
}
@ -136,7 +136,7 @@ s32 PS4_SYSV_ABI sceZlibWaitForDone(u64* request_id, const u32* timeout) {
} else {
done_queue_cv.wait(lock, pred);
}
*request_id = done_queue.back();
*request_id = done_queue.front();
done_queue.pop();
}
return ORBIS_OK;

View file

@ -332,20 +332,21 @@ bool Linker::Resolve(const std::string& name, Loader::SymbolType sym_type, Modul
sr.type = sym_type;
const auto* record = m_hle_symbols.FindSymbol(sr);
if (!record) {
if (record) {
*return_info = *record;
Core::Devtools::Widget::ModuleList::AddModule(sr.library);
return true;
}
// Check if it an export function
const auto* p = FindExportedModule(*module, *library);
if (p && p->export_sym.GetSize() > 0) {
record = p->export_sym.FindSymbol(sr);
}
}
if (record) {
*return_info = *record;
Core::Devtools::Widget::ModuleList::AddModule(sr.library);
return true;
}
}
const auto aeronid = AeroLib::FindByNid(sr.name.c_str());
if (aeronid) {

View file

@ -17,11 +17,11 @@ namespace Core {
MemoryManager::MemoryManager() {
// Insert a virtual memory area that covers the entire area we manage.
const VAddr system_managed_base = impl.SystemManagedVirtualBase();
const size_t system_managed_size = impl.SystemManagedVirtualSize();
const u64 system_managed_size = impl.SystemManagedVirtualSize();
const VAddr system_reserved_base = impl.SystemReservedVirtualBase();
const size_t system_reserved_size = impl.SystemReservedVirtualSize();
const u64 system_reserved_size = impl.SystemReservedVirtualSize();
const VAddr user_base = impl.UserVirtualBase();
const size_t user_size = impl.UserVirtualSize();
const u64 user_size = impl.UserVirtualSize();
vma_map.emplace(system_managed_base,
VirtualMemoryArea{system_managed_base, system_managed_size});
vma_map.emplace(system_reserved_base,
@ -95,6 +95,46 @@ u64 MemoryManager::ClampRangeSize(VAddr virtual_addr, u64 size) {
return clamped_size;
}
void MemoryManager::SetPrtArea(u32 id, VAddr address, u64 size) {
PrtArea& area = prt_areas[id];
if (area.mapped) {
rasterizer->UnmapMemory(area.start, area.end - area.start);
}
area.start = address;
area.end = address + size;
area.mapped = true;
// Pretend the entire PRT area is mapped to avoid GPU tracking errors.
// The caches will use CopySparseMemory to fetch data which avoids unmapped areas.
rasterizer->MapMemory(address, size);
}
void MemoryManager::CopySparseMemory(VAddr virtual_addr, u8* dest, u64 size) {
const bool is_sparse = std::ranges::any_of(
prt_areas, [&](const PrtArea& area) { return area.Overlaps(virtual_addr, size); });
if (!is_sparse) {
std::memcpy(dest, std::bit_cast<const u8*>(virtual_addr), size);
return;
}
auto vma = FindVMA(virtual_addr);
ASSERT_MSG(vma->second.Contains(virtual_addr, 0),
"Attempted to access invalid GPU address {:#x}", virtual_addr);
while (size) {
u64 copy_size = std::min<u64>(vma->second.size - (virtual_addr - vma->first), size);
if (vma->second.IsFree()) {
std::memset(dest, 0, copy_size);
} else {
std::memcpy(dest, std::bit_cast<const u8*>(virtual_addr), copy_size);
}
size -= copy_size;
virtual_addr += copy_size;
dest += copy_size;
++vma;
}
}
bool MemoryManager::TryWriteBacking(void* address, const void* data, u32 num_bytes) {
const VAddr virtual_addr = std::bit_cast<VAddr>(address);
const auto& vma = FindVMA(virtual_addr)->second;
@ -108,7 +148,7 @@ bool MemoryManager::TryWriteBacking(void* address, const void* data, u32 num_byt
return true;
}
PAddr MemoryManager::PoolExpand(PAddr search_start, PAddr search_end, size_t size, u64 alignment) {
PAddr MemoryManager::PoolExpand(PAddr search_start, PAddr search_end, u64 size, u64 alignment) {
std::scoped_lock lk{mutex};
alignment = alignment > 0 ? alignment : 64_KB;
@ -148,8 +188,8 @@ PAddr MemoryManager::PoolExpand(PAddr search_start, PAddr search_end, size_t siz
return mapping_start;
}
PAddr MemoryManager::Allocate(PAddr search_start, PAddr search_end, size_t size, u64 alignment,
int memory_type) {
PAddr MemoryManager::Allocate(PAddr search_start, PAddr search_end, u64 size, u64 alignment,
s32 memory_type) {
std::scoped_lock lk{mutex};
alignment = alignment > 0 ? alignment : 16_KB;
@ -186,7 +226,7 @@ PAddr MemoryManager::Allocate(PAddr search_start, PAddr search_end, size_t size,
return mapping_start;
}
void MemoryManager::Free(PAddr phys_addr, size_t size) {
void MemoryManager::Free(PAddr phys_addr, u64 size) {
std::scoped_lock lk{mutex};
auto dmem_area = CarveDmemArea(phys_addr, size);
@ -216,7 +256,7 @@ void MemoryManager::Free(PAddr phys_addr, size_t size) {
MergeAdjacent(dmem_map, dmem_area);
}
int MemoryManager::PoolCommit(VAddr virtual_addr, size_t size, MemoryProt prot) {
s32 MemoryManager::PoolCommit(VAddr virtual_addr, u64 size, MemoryProt prot) {
std::scoped_lock lk{mutex};
const u64 alignment = 64_KB;
@ -280,6 +320,28 @@ s32 MemoryManager::MapMemory(void** out_addr, VAddr virtual_addr, u64 size, Memo
return ORBIS_KERNEL_ERROR_ENOMEM;
}
// Validate the requested physical address range
if (phys_addr != -1) {
u64 validated_size = 0;
do {
auto dmem_area = FindDmemArea(phys_addr + validated_size)->second;
// If any requested dmem area is not allocated, return an error.
if (dmem_area.is_free) {
LOG_ERROR(Kernel_Vmm, "Unable to map {:#x} bytes at physical address {:#x}", size,
phys_addr);
return ORBIS_KERNEL_ERROR_ENOMEM;
}
// Track how much we've validated.
validated_size += dmem_area.size - (phys_addr + validated_size - dmem_area.base);
} while (validated_size < size && phys_addr + validated_size < GetTotalDirectSize());
// If the requested range goes outside the dmem map, return an error.
if (validated_size < size) {
LOG_ERROR(Kernel_Vmm, "Unable to map {:#x} bytes at physical address {:#x}", size,
phys_addr);
return ORBIS_KERNEL_ERROR_ENOMEM;
}
}
// Limit the minumum address to SystemManagedVirtualBase to prevent hardware-specific issues.
VAddr mapped_addr = (virtual_addr == 0) ? impl.SystemManagedVirtualBase() : virtual_addr;
@ -363,7 +425,7 @@ s32 MemoryManager::MapFile(void** out_addr, VAddr virtual_addr, u64 size, Memory
auto* h = Common::Singleton<Core::FileSys::HandleTable>::Instance();
VAddr mapped_addr = (virtual_addr == 0) ? impl.SystemManagedVirtualBase() : virtual_addr;
const size_t size_aligned = Common::AlignUp(size, 16_KB);
const u64 size_aligned = Common::AlignUp(size, 16_KB);
// Find first free area to map the file.
if (False(flags & MemoryMapFlags::Fixed)) {
@ -376,7 +438,7 @@ s32 MemoryManager::MapFile(void** out_addr, VAddr virtual_addr, u64 size, Memory
if (True(flags & MemoryMapFlags::Fixed)) {
const auto& vma = FindVMA(virtual_addr)->second;
const size_t remaining_size = vma.base + vma.size - virtual_addr;
const u64 remaining_size = vma.base + vma.size - virtual_addr;
ASSERT_MSG(!vma.IsMapped() && remaining_size >= size,
"Memory region {:#x} to {:#x} isn't free enough to map region {:#x} to {:#x}",
vma.base, vma.base + vma.size, virtual_addr, virtual_addr + size);
@ -408,7 +470,7 @@ s32 MemoryManager::MapFile(void** out_addr, VAddr virtual_addr, u64 size, Memory
return ORBIS_OK;
}
s32 MemoryManager::PoolDecommit(VAddr virtual_addr, size_t size) {
s32 MemoryManager::PoolDecommit(VAddr virtual_addr, u64 size) {
std::scoped_lock lk{mutex};
const auto it = FindVMA(virtual_addr);
@ -458,7 +520,7 @@ s32 MemoryManager::PoolDecommit(VAddr virtual_addr, size_t size) {
return ORBIS_OK;
}
s32 MemoryManager::UnmapMemory(VAddr virtual_addr, size_t size) {
s32 MemoryManager::UnmapMemory(VAddr virtual_addr, u64 size) {
std::scoped_lock lk{mutex};
return UnmapMemoryImpl(virtual_addr, size);
}
@ -524,7 +586,7 @@ s32 MemoryManager::UnmapMemoryImpl(VAddr virtual_addr, u64 size) {
return ORBIS_OK;
}
int MemoryManager::QueryProtection(VAddr addr, void** start, void** end, u32* prot) {
s32 MemoryManager::QueryProtection(VAddr addr, void** start, void** end, u32* prot) {
std::scoped_lock lk{mutex};
const auto it = FindVMA(addr);
@ -546,8 +608,7 @@ int MemoryManager::QueryProtection(VAddr addr, void** start, void** end, u32* pr
return ORBIS_OK;
}
s64 MemoryManager::ProtectBytes(VAddr addr, VirtualMemoryArea vma_base, size_t size,
MemoryProt prot) {
s64 MemoryManager::ProtectBytes(VAddr addr, VirtualMemoryArea vma_base, u64 size, MemoryProt prot) {
const auto start_in_vma = addr - vma_base.base;
const auto adjusted_size =
vma_base.size - start_in_vma < size ? vma_base.size - start_in_vma : size;
@ -584,7 +645,7 @@ s64 MemoryManager::ProtectBytes(VAddr addr, VirtualMemoryArea vma_base, size_t s
return adjusted_size;
}
s32 MemoryManager::Protect(VAddr addr, size_t size, MemoryProt prot) {
s32 MemoryManager::Protect(VAddr addr, u64 size, MemoryProt prot) {
std::scoped_lock lk{mutex};
// Validate protection flags
@ -609,8 +670,7 @@ s32 MemoryManager::Protect(VAddr addr, size_t size, MemoryProt prot) {
auto& vma_base = it->second;
ASSERT_MSG(vma_base.Contains(addr + protected_bytes, 0), "Address {:#x} is out of bounds",
addr + protected_bytes);
auto result = 0;
result = ProtectBytes(aligned_addr + protected_bytes, vma_base,
auto result = ProtectBytes(aligned_addr + protected_bytes, vma_base,
aligned_size - protected_bytes, prot);
if (result < 0) {
// ProtectBytes returned an error, return it
@ -622,7 +682,7 @@ s32 MemoryManager::Protect(VAddr addr, size_t size, MemoryProt prot) {
return ORBIS_OK;
}
int MemoryManager::VirtualQuery(VAddr addr, int flags,
s32 MemoryManager::VirtualQuery(VAddr addr, s32 flags,
::Libraries::Kernel::OrbisVirtualQueryInfo* info) {
std::scoped_lock lk{mutex};
@ -667,7 +727,7 @@ int MemoryManager::VirtualQuery(VAddr addr, int flags,
return ORBIS_OK;
}
int MemoryManager::DirectMemoryQuery(PAddr addr, bool find_next,
s32 MemoryManager::DirectMemoryQuery(PAddr addr, bool find_next,
::Libraries::Kernel::OrbisQueryInfo* out_info) {
std::scoped_lock lk{mutex};
@ -688,13 +748,13 @@ int MemoryManager::DirectMemoryQuery(PAddr addr, bool find_next,
return ORBIS_OK;
}
int MemoryManager::DirectQueryAvailable(PAddr search_start, PAddr search_end, size_t alignment,
PAddr* phys_addr_out, size_t* size_out) {
s32 MemoryManager::DirectQueryAvailable(PAddr search_start, PAddr search_end, u64 alignment,
PAddr* phys_addr_out, u64* size_out) {
std::scoped_lock lk{mutex};
auto dmem_area = FindDmemArea(search_start);
PAddr paddr{};
size_t max_size{};
u64 max_size{};
while (dmem_area != dmem_map.end()) {
if (!dmem_area->second.is_free) {
@ -775,13 +835,60 @@ void MemoryManager::NameVirtualRange(VAddr virtual_addr, u64 size, std::string_v
}
}
s32 MemoryManager::GetDirectMemoryType(PAddr addr, s32* directMemoryTypeOut,
void** directMemoryStartOut, void** directMemoryEndOut) {
std::scoped_lock lk{mutex};
auto dmem_area = FindDmemArea(addr);
if (addr > dmem_area->second.GetEnd() || dmem_area->second.is_free) {
LOG_ERROR(Core, "Unable to find allocated direct memory region to check type!");
return ORBIS_KERNEL_ERROR_ENOENT;
}
const auto& area = dmem_area->second;
*directMemoryStartOut = reinterpret_cast<void*>(area.base);
*directMemoryEndOut = reinterpret_cast<void*>(area.GetEnd());
*directMemoryTypeOut = area.memory_type;
return ORBIS_OK;
}
s32 MemoryManager::IsStack(VAddr addr, void** start, void** end) {
auto vma_handle = FindVMA(addr);
if (vma_handle == vma_map.end()) {
return ORBIS_KERNEL_ERROR_EINVAL;
}
const VirtualMemoryArea& vma = vma_handle->second;
if (!vma.Contains(addr, 0) || vma.IsFree()) {
return ORBIS_KERNEL_ERROR_EACCES;
}
u64 stack_start = 0;
u64 stack_end = 0;
if (vma.type == VMAType::Stack) {
stack_start = vma.base;
stack_end = vma.base + vma.size;
}
if (start != nullptr) {
*start = reinterpret_cast<void*>(stack_start);
}
if (end != nullptr) {
*end = reinterpret_cast<void*>(stack_end);
}
return ORBIS_OK;
}
void MemoryManager::InvalidateMemory(const VAddr addr, const u64 size) const {
if (rasterizer) {
rasterizer->InvalidateMemory(addr, size);
}
}
VAddr MemoryManager::SearchFree(VAddr virtual_addr, size_t size, u32 alignment) {
VAddr MemoryManager::SearchFree(VAddr virtual_addr, u64 size, u32 alignment) {
// If the requested address is below the mapped range, start search from the lowest address
auto min_search_address = impl.SystemManagedVirtualBase();
if (virtual_addr < min_search_address) {
@ -824,7 +931,7 @@ VAddr MemoryManager::SearchFree(VAddr virtual_addr, size_t size, u32 alignment)
}
// If there's enough space in the VMA, return the address.
const size_t remaining_size = vma.base + vma.size - virtual_addr;
const u64 remaining_size = vma.base + vma.size - virtual_addr;
if (remaining_size >= size) {
return virtual_addr;
}
@ -837,7 +944,7 @@ VAddr MemoryManager::SearchFree(VAddr virtual_addr, size_t size, u32 alignment)
return -1;
}
MemoryManager::VMAHandle MemoryManager::CarveVMA(VAddr virtual_addr, size_t size) {
MemoryManager::VMAHandle MemoryManager::CarveVMA(VAddr virtual_addr, u64 size) {
auto vma_handle = FindVMA(virtual_addr);
ASSERT_MSG(vma_handle->second.Contains(virtual_addr, 0), "Virtual address not in vm_map");
@ -866,7 +973,7 @@ MemoryManager::VMAHandle MemoryManager::CarveVMA(VAddr virtual_addr, size_t size
return vma_handle;
}
MemoryManager::DMemHandle MemoryManager::CarveDmemArea(PAddr addr, size_t size) {
MemoryManager::DMemHandle MemoryManager::CarveDmemArea(PAddr addr, u64 size) {
auto dmem_handle = FindDmemArea(addr);
ASSERT_MSG(addr <= dmem_handle->second.GetEnd(), "Physical address not in dmem_map");
@ -890,7 +997,7 @@ MemoryManager::DMemHandle MemoryManager::CarveDmemArea(PAddr addr, size_t size)
return dmem_handle;
}
MemoryManager::VMAHandle MemoryManager::Split(VMAHandle vma_handle, size_t offset_in_vma) {
MemoryManager::VMAHandle MemoryManager::Split(VMAHandle vma_handle, u64 offset_in_vma) {
auto& old_vma = vma_handle->second;
ASSERT(offset_in_vma < old_vma.size && offset_in_vma > 0);
@ -905,7 +1012,7 @@ MemoryManager::VMAHandle MemoryManager::Split(VMAHandle vma_handle, size_t offse
return vma_map.emplace_hint(std::next(vma_handle), new_vma.base, new_vma);
}
MemoryManager::DMemHandle MemoryManager::Split(DMemHandle dmem_handle, size_t offset_in_area) {
MemoryManager::DMemHandle MemoryManager::Split(DMemHandle dmem_handle, u64 offset_in_area) {
auto& old_area = dmem_handle->second;
ASSERT(offset_in_area < old_area.size && offset_in_area > 0);
@ -917,51 +1024,4 @@ MemoryManager::DMemHandle MemoryManager::Split(DMemHandle dmem_handle, size_t of
return dmem_map.emplace_hint(std::next(dmem_handle), new_area.base, new_area);
}
int MemoryManager::GetDirectMemoryType(PAddr addr, int* directMemoryTypeOut,
void** directMemoryStartOut, void** directMemoryEndOut) {
std::scoped_lock lk{mutex};
auto dmem_area = FindDmemArea(addr);
if (addr > dmem_area->second.GetEnd() || dmem_area->second.is_free) {
LOG_ERROR(Core, "Unable to find allocated direct memory region to check type!");
return ORBIS_KERNEL_ERROR_ENOENT;
}
const auto& area = dmem_area->second;
*directMemoryStartOut = reinterpret_cast<void*>(area.base);
*directMemoryEndOut = reinterpret_cast<void*>(area.GetEnd());
*directMemoryTypeOut = area.memory_type;
return ORBIS_OK;
}
int MemoryManager::IsStack(VAddr addr, void** start, void** end) {
auto vma_handle = FindVMA(addr);
if (vma_handle == vma_map.end()) {
return ORBIS_KERNEL_ERROR_EINVAL;
}
const VirtualMemoryArea& vma = vma_handle->second;
if (!vma.Contains(addr, 0) || vma.IsFree()) {
return ORBIS_KERNEL_ERROR_EACCES;
}
auto stack_start = 0ul;
auto stack_end = 0ul;
if (vma.type == VMAType::Stack) {
stack_start = vma.base;
stack_end = vma.base + vma.size;
}
if (start != nullptr) {
*start = reinterpret_cast<void*>(stack_start);
}
if (end != nullptr) {
*end = reinterpret_cast<void*>(stack_end);
}
return ORBIS_OK;
}
} // namespace Core

View file

@ -5,6 +5,7 @@
#include <map>
#include <mutex>
#include <string>
#include <string_view>
#include "common/enum.h"
#include "common/singleton.h"
@ -62,8 +63,8 @@ enum class VMAType : u32 {
struct DirectMemoryArea {
PAddr base = 0;
size_t size = 0;
int memory_type = 0;
u64 size = 0;
s32 memory_type = 0;
bool is_pooled = false;
bool is_free = true;
@ -75,6 +76,9 @@ struct DirectMemoryArea {
if (base + size != next.base) {
return false;
}
if (memory_type != next.memory_type) {
return false;
}
if (is_free != next.is_free) {
return false;
}
@ -84,7 +88,7 @@ struct DirectMemoryArea {
struct VirtualMemoryArea {
VAddr base = 0;
size_t size = 0;
u64 size = 0;
PAddr phys_base = 0;
VMAType type = VMAType::Free;
MemoryProt prot = MemoryProt::NoAccess;
@ -93,7 +97,7 @@ struct VirtualMemoryArea {
uintptr_t fd = 0;
bool is_exec = false;
bool Contains(VAddr addr, size_t size) const {
bool Contains(VAddr addr, u64 size) const {
return addr >= base && (addr + size) <= (base + this->size);
}
@ -172,18 +176,21 @@ public:
u64 ClampRangeSize(VAddr virtual_addr, u64 size);
void SetPrtArea(u32 id, VAddr address, u64 size);
void CopySparseMemory(VAddr source, u8* dest, u64 size);
bool TryWriteBacking(void* address, const void* data, u32 num_bytes);
void SetupMemoryRegions(u64 flexible_size, bool use_extended_mem1, bool use_extended_mem2);
PAddr PoolExpand(PAddr search_start, PAddr search_end, size_t size, u64 alignment);
PAddr PoolExpand(PAddr search_start, PAddr search_end, u64 size, u64 alignment);
PAddr Allocate(PAddr search_start, PAddr search_end, size_t size, u64 alignment,
int memory_type);
PAddr Allocate(PAddr search_start, PAddr search_end, u64 size, u64 alignment, s32 memory_type);
void Free(PAddr phys_addr, size_t size);
void Free(PAddr phys_addr, u64 size);
int PoolCommit(VAddr virtual_addr, size_t size, MemoryProt prot);
s32 PoolCommit(VAddr virtual_addr, u64 size, MemoryProt prot);
s32 MapMemory(void** out_addr, VAddr virtual_addr, u64 size, MemoryProt prot,
MemoryMapFlags flags, VMAType type, std::string_view name = "anon",
@ -192,35 +199,35 @@ public:
s32 MapFile(void** out_addr, VAddr virtual_addr, u64 size, MemoryProt prot,
MemoryMapFlags flags, s32 fd, s64 phys_addr);
s32 PoolDecommit(VAddr virtual_addr, size_t size);
s32 PoolDecommit(VAddr virtual_addr, u64 size);
s32 UnmapMemory(VAddr virtual_addr, size_t size);
s32 UnmapMemory(VAddr virtual_addr, u64 size);
int QueryProtection(VAddr addr, void** start, void** end, u32* prot);
s32 QueryProtection(VAddr addr, void** start, void** end, u32* prot);
s32 Protect(VAddr addr, size_t size, MemoryProt prot);
s32 Protect(VAddr addr, u64 size, MemoryProt prot);
s64 ProtectBytes(VAddr addr, VirtualMemoryArea vma_base, size_t size, MemoryProt prot);
s64 ProtectBytes(VAddr addr, VirtualMemoryArea vma_base, u64 size, MemoryProt prot);
int VirtualQuery(VAddr addr, int flags, ::Libraries::Kernel::OrbisVirtualQueryInfo* info);
s32 VirtualQuery(VAddr addr, s32 flags, ::Libraries::Kernel::OrbisVirtualQueryInfo* info);
int DirectMemoryQuery(PAddr addr, bool find_next,
s32 DirectMemoryQuery(PAddr addr, bool find_next,
::Libraries::Kernel::OrbisQueryInfo* out_info);
int DirectQueryAvailable(PAddr search_start, PAddr search_end, size_t alignment,
PAddr* phys_addr_out, size_t* size_out);
s32 DirectQueryAvailable(PAddr search_start, PAddr search_end, u64 alignment,
PAddr* phys_addr_out, u64* size_out);
int GetDirectMemoryType(PAddr addr, int* directMemoryTypeOut, void** directMemoryStartOut,
s32 GetDirectMemoryType(PAddr addr, s32* directMemoryTypeOut, void** directMemoryStartOut,
void** directMemoryEndOut);
s32 IsStack(VAddr addr, void** start, void** end);
s32 SetDirectMemoryType(s64 phys_addr, s32 memory_type);
void NameVirtualRange(VAddr virtual_addr, u64 size, std::string_view name);
void InvalidateMemory(VAddr addr, u64 size) const;
int IsStack(VAddr addr, void** start, void** end);
private:
VMAHandle FindVMA(VAddr target) {
return std::prev(vma_map.upper_bound(target));
@ -250,15 +257,15 @@ private:
return iter;
}
VAddr SearchFree(VAddr virtual_addr, size_t size, u32 alignment = 0);
VAddr SearchFree(VAddr virtual_addr, u64 size, u32 alignment = 0);
VMAHandle CarveVMA(VAddr virtual_addr, size_t size);
VMAHandle CarveVMA(VAddr virtual_addr, u64 size);
DMemHandle CarveDmemArea(PAddr addr, size_t size);
DMemHandle CarveDmemArea(PAddr addr, u64 size);
VMAHandle Split(VMAHandle vma_handle, size_t offset_in_vma);
VMAHandle Split(VMAHandle vma_handle, u64 offset_in_vma);
DMemHandle Split(DMemHandle dmem_handle, size_t offset_in_area);
DMemHandle Split(DMemHandle dmem_handle, u64 offset_in_area);
u64 UnmapBytesFromEntry(VAddr virtual_addr, VirtualMemoryArea vma_base, u64 size);
@ -269,12 +276,24 @@ private:
DMemMap dmem_map;
VMAMap vma_map;
std::mutex mutex;
size_t total_direct_size{};
size_t total_flexible_size{};
size_t flexible_usage{};
size_t pool_budget{};
u64 total_direct_size{};
u64 total_flexible_size{};
u64 flexible_usage{};
u64 pool_budget{};
Vulkan::Rasterizer* rasterizer{};
struct PrtArea {
VAddr start;
VAddr end;
bool mapped;
bool Overlaps(VAddr test_address, u64 test_size) const {
const VAddr overlap_end = test_address + test_size;
return start < overlap_end && test_address < end;
}
};
std::array<PrtArea, 3> prt_areas{};
friend class ::Core::Devtools::Widget::MemoryMapViewer;
};

View file

@ -11,6 +11,7 @@
#include <windows.h>
#else
#include <csignal>
#include <pthread.h>
#ifdef ARCH_X86_64
#include <Zydis/Formatter.h>
#endif

View file

@ -5,6 +5,7 @@
#include <set>
#include "common/singleton.h"
#include "common/types.h"
namespace Core {

View file

@ -51,7 +51,7 @@ Tcb* GetTcbBase() {
// Apple x86_64
// Reserve space in the 32-bit address range for allocating TCB pages.
asm(".zerofill TCB_SPACE,TCB_SPACE,__guest_system,0x3FC000");
asm(".zerofill TCB_SPACE,TCB_SPACE,__tcb_space,0x3FC000");
struct LdtPage {
void* tcb;

View file

@ -58,10 +58,7 @@ Emulator::Emulator() {
#endif
}
Emulator::~Emulator() {
const auto config_dir = Common::FS::GetUserPath(Common::FS::PathType::UserDir);
Config::saveMainWindow(config_dir / "config.toml");
}
Emulator::~Emulator() {}
void Emulator::Run(std::filesystem::path file, const std::vector<std::string> args) {
if (std::filesystem::is_directory(file)) {
@ -75,7 +72,7 @@ void Emulator::Run(std::filesystem::path file, const std::vector<std::string> ar
game_folder_name.ends_with("-UPDATE") || game_folder_name.ends_with("-patch")) {
// If an executable was launched from a separate update directory,
// use the base game directory as the game folder.
const auto base_name = game_folder_name.substr(0, game_folder_name.size() - 7);
const std::string base_name = game_folder_name.substr(0, game_folder_name.rfind('-'));
const auto base_path = game_folder.parent_path() / base_name;
if (std::filesystem::is_directory(base_path)) {
game_folder = base_path;

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -66,6 +66,7 @@ auto output_array = std::array{
ControllerOutput(LEFTJOYSTICK_HALFMODE),
ControllerOutput(RIGHTJOYSTICK_HALFMODE),
ControllerOutput(KEY_TOGGLE),
ControllerOutput(MOUSE_GYRO_ROLL_MODE),
// Button mappings
ControllerOutput(SDL_GAMEPAD_BUTTON_NORTH), // Triangle
@ -77,7 +78,9 @@ auto output_array = std::array{
ControllerOutput(SDL_GAMEPAD_BUTTON_RIGHT_SHOULDER), // R1
ControllerOutput(SDL_GAMEPAD_BUTTON_RIGHT_STICK), // R3
ControllerOutput(SDL_GAMEPAD_BUTTON_START), // Options
ControllerOutput(SDL_GAMEPAD_BUTTON_TOUCHPAD), // TouchPad
ControllerOutput(SDL_GAMEPAD_BUTTON_TOUCHPAD_LEFT), // TouchPad
ControllerOutput(SDL_GAMEPAD_BUTTON_TOUCHPAD_CENTER), // TouchPad
ControllerOutput(SDL_GAMEPAD_BUTTON_TOUCHPAD_RIGHT), // TouchPad
ControllerOutput(SDL_GAMEPAD_BUTTON_DPAD_UP), // Up
ControllerOutput(SDL_GAMEPAD_BUTTON_DPAD_DOWN), // Down
ControllerOutput(SDL_GAMEPAD_BUTTON_DPAD_LEFT), // Left
@ -130,6 +133,12 @@ static OrbisPadButtonDataOffset SDLGamepadToOrbisButton(u8 button) {
return OPBDO::Options;
case SDL_GAMEPAD_BUTTON_TOUCHPAD:
return OPBDO::TouchPad;
case SDL_GAMEPAD_BUTTON_TOUCHPAD_LEFT:
return OPBDO::TouchPad;
case SDL_GAMEPAD_BUTTON_TOUCHPAD_CENTER:
return OPBDO::TouchPad;
case SDL_GAMEPAD_BUTTON_TOUCHPAD_RIGHT:
return OPBDO::TouchPad;
case SDL_GAMEPAD_BUTTON_BACK:
return OPBDO::TouchPad;
case SDL_GAMEPAD_BUTTON_LEFT_SHOULDER:
@ -176,7 +185,7 @@ InputBinding GetBindingFromString(std::string& line) {
if (string_to_keyboard_key_map.find(t) != string_to_keyboard_key_map.end()) {
input = InputID(InputType::KeyboardMouse, string_to_keyboard_key_map.at(t));
} else if (string_to_axis_map.find(t) != string_to_axis_map.end()) {
input = InputID(InputType::Axis, (u32)string_to_axis_map.at(t).axis);
input = InputID(InputType::Axis, string_to_axis_map.at(t).axis);
} else if (string_to_cbutton_map.find(t) != string_to_cbutton_map.end()) {
input = InputID(InputType::Controller, string_to_cbutton_map.at(t));
} else {
@ -227,19 +236,15 @@ void ParseInputConfig(const std::string game_id = "") {
line.erase(std::remove_if(line.begin(), line.end(),
[](unsigned char c) { return std::isspace(c); }),
line.end());
if (line.empty()) {
continue;
}
// Truncate lines starting at #
std::size_t comment_pos = line.find('#');
if (comment_pos != std::string::npos) {
line = line.substr(0, comment_pos);
}
// Remove trailing semicolon
if (!line.empty() && line[line.length() - 1] == ';') {
line = line.substr(0, line.length() - 1);
}
if (line.empty()) {
continue;
}
@ -254,8 +259,13 @@ void ParseInputConfig(const std::string game_id = "") {
std::string output_string = line.substr(0, equal_pos);
std::string input_string = line.substr(equal_pos + 1);
std::size_t comma_pos = input_string.find(',');
// Remove trailing semicolon from input_string
if (!input_string.empty() && input_string[input_string.length() - 1] == ';' &&
input_string != ";") {
line = line.substr(0, line.length() - 1);
}
std::size_t comma_pos = input_string.find(',');
auto parseInt = [](const std::string& s) -> std::optional<int> {
try {
return std::stoi(s);
@ -373,7 +383,6 @@ void ParseInputConfig(const std::string game_id = "") {
BindingConnection connection(InputID(), nullptr);
auto button_it = string_to_cbutton_map.find(output_string);
auto axis_it = string_to_axis_map.find(output_string);
if (binding.IsEmpty()) {
LOG_WARNING(Input, "Invalid format at line: {}, data: \"{}\", skipping line.",
lineCount, line);
@ -411,7 +420,7 @@ void ParseInputConfig(const std::string game_id = "") {
u32 GetMouseWheelEvent(const SDL_Event& event) {
if (event.type != SDL_EVENT_MOUSE_WHEEL && event.type != SDL_EVENT_MOUSE_WHEEL_OFF) {
LOG_WARNING(Input, "Something went wrong with wheel input parsing!");
return (u32)-1;
return SDL_UNMAPPED;
}
if (event.wheel.y > 0) {
return SDL_MOUSE_WHEEL_UP;
@ -422,7 +431,7 @@ u32 GetMouseWheelEvent(const SDL_Event& event) {
} else if (event.wheel.x < 0) {
return SDL_MOUSE_WHEEL_LEFT;
}
return (u32)-1;
return SDL_UNMAPPED;
}
InputEvent InputBinding::GetInputEventFromSDLEvent(const SDL_Event& e) {
@ -432,16 +441,19 @@ InputEvent InputBinding::GetInputEventFromSDLEvent(const SDL_Event& e) {
return InputEvent(InputType::KeyboardMouse, e.key.key, e.key.down, 0);
case SDL_EVENT_MOUSE_BUTTON_DOWN:
case SDL_EVENT_MOUSE_BUTTON_UP:
return InputEvent(InputType::KeyboardMouse, (u32)e.button.button, e.button.down, 0);
return InputEvent(InputType::KeyboardMouse, static_cast<u32>(e.button.button),
e.button.down, 0);
case SDL_EVENT_MOUSE_WHEEL:
case SDL_EVENT_MOUSE_WHEEL_OFF:
return InputEvent(InputType::KeyboardMouse, GetMouseWheelEvent(e),
e.type == SDL_EVENT_MOUSE_WHEEL, 0);
case SDL_EVENT_GAMEPAD_BUTTON_DOWN:
case SDL_EVENT_GAMEPAD_BUTTON_UP:
return InputEvent(InputType::Controller, (u32)e.gbutton.button, e.gbutton.down, 0);
return InputEvent(InputType::Controller, static_cast<u32>(e.gbutton.button), e.gbutton.down,
0); // clang made me do it
case SDL_EVENT_GAMEPAD_AXIS_MOTION:
return InputEvent(InputType::Axis, (u32)e.gaxis.axis, true, e.gaxis.value / 256);
return InputEvent(InputType::Axis, static_cast<u32>(e.gaxis.axis), true,
e.gaxis.value / 256); // this too
default:
return InputEvent();
}
@ -499,14 +511,21 @@ void ControllerOutput::FinalizeUpdate() {
}
old_button_state = new_button_state;
old_param = *new_param;
float touchpad_x = 0;
if (button != SDL_GAMEPAD_BUTTON_INVALID) {
switch (button) {
case SDL_GAMEPAD_BUTTON_TOUCHPAD:
touchpad_x = Config::getBackButtonBehavior() == "left" ? 0.25f
: Config::getBackButtonBehavior() == "right" ? 0.75f
: 0.5f;
controller->SetTouchpadState(0, new_button_state, touchpad_x, 0.5f);
case SDL_GAMEPAD_BUTTON_TOUCHPAD_LEFT:
LOG_INFO(Input, "Topuchpad left");
controller->SetTouchpadState(0, new_button_state, 0.25f, 0.5f);
controller->CheckButton(0, SDLGamepadToOrbisButton(button), new_button_state);
break;
case SDL_GAMEPAD_BUTTON_TOUCHPAD_CENTER:
LOG_INFO(Input, "Topuchpad center");
controller->SetTouchpadState(0, new_button_state, 0.50f, 0.5f);
controller->CheckButton(0, SDLGamepadToOrbisButton(button), new_button_state);
break;
case SDL_GAMEPAD_BUTTON_TOUCHPAD_RIGHT:
LOG_INFO(Input, "Topuchpad right");
controller->SetTouchpadState(0, new_button_state, 0.75f, 0.5f);
controller->CheckButton(0, SDLGamepadToOrbisButton(button), new_button_state);
break;
case LEFTJOYSTICK_HALFMODE:
@ -519,6 +538,9 @@ void ControllerOutput::FinalizeUpdate() {
// to do it, and it would be inconvenient to force it here, when AddUpdate does the job just
// fine, and a toggle doesn't have to checked against every input that's bound to it, it's
// enough that one is pressed
case MOUSE_GYRO_ROLL_MODE:
SetMouseGyroRollMode(new_button_state);
break;
default: // is a normal key (hopefully)
controller->CheckButton(0, SDLGamepadToOrbisButton(button), new_button_state);
break;
@ -570,7 +592,7 @@ void ControllerOutput::FinalizeUpdate() {
bool UpdatePressedKeys(InputEvent event) {
// Skip invalid inputs
InputID input = event.input;
if (input.sdl_id == (u32)-1) {
if (input.sdl_id == SDL_UNMAPPED) {
return false;
}
if (input.type == InputType::Axis) {

View file

@ -23,6 +23,10 @@
#define SDL_MOUSE_WHEEL_LEFT SDL_EVENT_MOUSE_WHEEL + 5
#define SDL_MOUSE_WHEEL_RIGHT SDL_EVENT_MOUSE_WHEEL + 7
#define SDL_GAMEPAD_BUTTON_TOUCHPAD_LEFT SDL_GAMEPAD_BUTTON_COUNT + 1
#define SDL_GAMEPAD_BUTTON_TOUCHPAD_CENTER SDL_GAMEPAD_BUTTON_COUNT + 2
#define SDL_GAMEPAD_BUTTON_TOUCHPAD_RIGHT SDL_GAMEPAD_BUTTON_COUNT + 3
// idk who already used what where so I just chose a big number
#define SDL_EVENT_MOUSE_WHEEL_OFF SDL_EVENT_USER + 10
@ -31,6 +35,9 @@
#define BACK_BUTTON 0x00040000
#define KEY_TOGGLE 0x00200000
#define MOUSE_GYRO_ROLL_MODE 0x00400000
#define SDL_UNMAPPED UINT32_MAX - 1
namespace Input {
using Input::Axis;
@ -49,7 +56,7 @@ class InputID {
public:
InputType type;
u32 sdl_id;
InputID(InputType d = InputType::Count, u32 i = (u32)-1) : type(d), sdl_id(i) {}
InputID(InputType d = InputType::Count, u32 i = SDL_UNMAPPED) : type(d), sdl_id(i) {}
bool operator==(const InputID& o) const {
return type == o.type && sdl_id == o.sdl_id;
}
@ -63,7 +70,7 @@ public:
return *this != InputID();
}
std::string ToString() {
return fmt::format("({}: {:x})", input_type_names[(u8)type], sdl_id);
return fmt::format("({}: {:x})", input_type_names[static_cast<u8>(type)], sdl_id);
}
};
@ -96,12 +103,19 @@ const std::map<std::string, u32> string_to_cbutton_map = {
{"options", SDL_GAMEPAD_BUTTON_START},
// these are outputs only (touchpad can only be bound to itself)
{"touchpad", SDL_GAMEPAD_BUTTON_TOUCHPAD},
{"touchpad_left", SDL_GAMEPAD_BUTTON_TOUCHPAD_LEFT},
{"touchpad_center", SDL_GAMEPAD_BUTTON_TOUCHPAD_CENTER},
{"touchpad_right", SDL_GAMEPAD_BUTTON_TOUCHPAD_RIGHT},
{"leftjoystick_halfmode", LEFTJOYSTICK_HALFMODE},
{"rightjoystick_halfmode", RIGHTJOYSTICK_HALFMODE},
// this is only for input
{"back", SDL_GAMEPAD_BUTTON_BACK},
{"lpaddle_high", SDL_GAMEPAD_BUTTON_LEFT_PADDLE1},
{"lpaddle_low", SDL_GAMEPAD_BUTTON_LEFT_PADDLE2},
{"rpaddle_high", SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1},
{"rpaddle_low", SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2},
{"mouse_gyro_roll_mode", MOUSE_GYRO_ROLL_MODE},
};
const std::map<std::string, AxisMapping> string_to_axis_map = {
@ -124,6 +138,7 @@ const std::map<std::string, AxisMapping> string_to_axis_map = {
{"axis_right_y", {SDL_GAMEPAD_AXIS_RIGHTY, 127}},
};
const std::map<std::string, u32> string_to_keyboard_key_map = {
// alphanumeric
{"a", SDLK_A},
{"b", SDLK_B},
{"c", SDLK_C},
@ -160,6 +175,73 @@ const std::map<std::string, u32> string_to_keyboard_key_map = {
{"7", SDLK_7},
{"8", SDLK_8},
{"9", SDLK_9},
// symbols
{"`", SDLK_GRAVE},
{"~", SDLK_TILDE},
{"!", SDLK_EXCLAIM},
{"@", SDLK_AT},
{"#", SDLK_HASH},
{"$", SDLK_DOLLAR},
{"%", SDLK_PERCENT},
{"^", SDLK_CARET},
{"&", SDLK_AMPERSAND},
{"*", SDLK_ASTERISK},
{"(", SDLK_LEFTPAREN},
{")", SDLK_RIGHTPAREN},
{"-", SDLK_MINUS},
{"_", SDLK_UNDERSCORE},
{"=", SDLK_EQUALS},
{"+", SDLK_PLUS},
{"[", SDLK_LEFTBRACKET},
{"]", SDLK_RIGHTBRACKET},
{"{", SDLK_LEFTBRACE},
{"}", SDLK_RIGHTBRACE},
{"\\", SDLK_BACKSLASH},
{"|", SDLK_PIPE},
{";", SDLK_SEMICOLON},
{":", SDLK_COLON},
{"'", SDLK_APOSTROPHE},
{"\"", SDLK_DBLAPOSTROPHE},
{",", SDLK_COMMA},
{"<", SDLK_LESS},
{".", SDLK_PERIOD},
{">", SDLK_GREATER},
{"/", SDLK_SLASH},
{"?", SDLK_QUESTION},
// special keys
{"escape", SDLK_ESCAPE},
{"printscreen", SDLK_PRINTSCREEN},
{"scrolllock", SDLK_SCROLLLOCK},
{"pausebreak", SDLK_PAUSE},
{"backspace", SDLK_BACKSPACE},
{"delete", SDLK_DELETE},
{"insert", SDLK_INSERT},
{"home", SDLK_HOME},
{"end", SDLK_END},
{"pgup", SDLK_PAGEUP},
{"pgdown", SDLK_PAGEDOWN},
{"tab", SDLK_TAB},
{"capslock", SDLK_CAPSLOCK},
{"enter", SDLK_RETURN},
{"lshift", SDLK_LSHIFT},
{"rshift", SDLK_RSHIFT},
{"lctrl", SDLK_LCTRL},
{"rctrl", SDLK_RCTRL},
{"lalt", SDLK_LALT},
{"ralt", SDLK_RALT},
{"lmeta", SDLK_LGUI},
{"rmeta", SDLK_RGUI},
{"lwin", SDLK_LGUI},
{"rwin", SDLK_RGUI},
{"space", SDLK_SPACE},
{"up", SDLK_UP},
{"down", SDLK_DOWN},
{"left", SDLK_LEFT},
{"right", SDLK_RIGHT},
// keypad
{"kp0", SDLK_KP_0},
{"kp1", SDLK_KP_1},
{"kp2", SDLK_KP_2},
@ -170,43 +252,16 @@ const std::map<std::string, u32> string_to_keyboard_key_map = {
{"kp7", SDLK_KP_7},
{"kp8", SDLK_KP_8},
{"kp9", SDLK_KP_9},
{"comma", SDLK_COMMA},
{"period", SDLK_PERIOD},
{"question", SDLK_QUESTION},
{"semicolon", SDLK_SEMICOLON},
{"minus", SDLK_MINUS},
{"underscore", SDLK_UNDERSCORE},
{"lparenthesis", SDLK_LEFTPAREN},
{"rparenthesis", SDLK_RIGHTPAREN},
{"lbracket", SDLK_LEFTBRACKET},
{"rbracket", SDLK_RIGHTBRACKET},
{"lbrace", SDLK_LEFTBRACE},
{"rbrace", SDLK_RIGHTBRACE},
{"backslash", SDLK_BACKSLASH},
{"dash", SDLK_SLASH},
{"enter", SDLK_RETURN},
{"space", SDLK_SPACE},
{"tab", SDLK_TAB},
{"backspace", SDLK_BACKSPACE},
{"escape", SDLK_ESCAPE},
{"left", SDLK_LEFT},
{"right", SDLK_RIGHT},
{"up", SDLK_UP},
{"down", SDLK_DOWN},
{"lctrl", SDLK_LCTRL},
{"rctrl", SDLK_RCTRL},
{"lshift", SDLK_LSHIFT},
{"rshift", SDLK_RSHIFT},
{"lalt", SDLK_LALT},
{"ralt", SDLK_RALT},
{"lmeta", SDLK_LGUI},
{"rmeta", SDLK_RGUI},
{"lwin", SDLK_LGUI},
{"rwin", SDLK_RGUI},
{"home", SDLK_HOME},
{"end", SDLK_END},
{"pgup", SDLK_PAGEUP},
{"pgdown", SDLK_PAGEDOWN},
{"kp.", SDLK_KP_PERIOD},
{"kp,", SDLK_KP_COMMA},
{"kp/", SDLK_KP_DIVIDE},
{"kp*", SDLK_KP_MULTIPLY},
{"kp-", SDLK_KP_MINUS},
{"kp+", SDLK_KP_PLUS},
{"kp=", SDLK_KP_EQUALS},
{"kpenter", SDLK_KP_ENTER},
// mouse
{"leftbutton", SDL_BUTTON_LEFT},
{"rightbutton", SDL_BUTTON_RIGHT},
{"middlebutton", SDL_BUTTON_MIDDLE},
@ -216,15 +271,9 @@ const std::map<std::string, u32> string_to_keyboard_key_map = {
{"mousewheeldown", SDL_MOUSE_WHEEL_DOWN},
{"mousewheelleft", SDL_MOUSE_WHEEL_LEFT},
{"mousewheelright", SDL_MOUSE_WHEEL_RIGHT},
{"kpperiod", SDLK_KP_PERIOD},
{"kpcomma", SDLK_KP_COMMA},
{"kpdivide", SDLK_KP_DIVIDE},
{"kpmultiply", SDLK_KP_MULTIPLY},
{"kpminus", SDLK_KP_MINUS},
{"kpplus", SDLK_KP_PLUS},
{"kpenter", SDLK_KP_ENTER},
{"kpequals", SDLK_KP_EQUALS},
{"capslock", SDLK_CAPSLOCK},
// no binding
{"unmapped", SDL_UNMAPPED},
};
void ParseInputConfig(const std::string game_id);
@ -320,6 +369,7 @@ public:
// returns an InputEvent based on the event type (keyboard, mouse buttons/wheel, or controller)
static InputEvent GetInputEventFromSDLEvent(const SDL_Event& e);
};
class ControllerOutput {
static GameController* controller;

View file

@ -3,6 +3,7 @@
#include <cmath>
#include "common/assert.h"
#include "common/types.h"
#include "input/controller.h"
#include "input_mouse.h"
@ -13,12 +14,19 @@ namespace Input {
int mouse_joystick_binding = 0;
float mouse_deadzone_offset = 0.5, mouse_speed = 1, mouse_speed_offset = 0.1250;
bool mouse_gyro_roll_mode = false;
Uint32 mouse_polling_id = 0;
bool mouse_enabled = false;
MouseMode mouse_mode = MouseMode::Off;
// We had to go through 3 files of indirection just to update a flag
void ToggleMouseEnabled() {
mouse_enabled = !mouse_enabled;
// Switches mouse to a set mode or turns mouse emulation off if it was already in that mode.
// Returns whether the mode is turned on.
bool ToggleMouseModeTo(MouseMode m) {
if (mouse_mode == m) {
mouse_mode = MouseMode::Off;
} else {
mouse_mode = m;
}
return mouse_mode == m;
}
void SetMouseToJoystick(int joystick) {
@ -31,10 +39,11 @@ void SetMouseParams(float mdo, float ms, float mso) {
mouse_speed_offset = mso;
}
Uint32 MousePolling(void* param, Uint32 id, Uint32 interval) {
auto* controller = (GameController*)param;
if (!mouse_enabled)
return interval;
void SetMouseGyroRollMode(bool mode) {
mouse_gyro_roll_mode = mode;
}
void EmulateJoystick(GameController* controller, u32 interval) {
Axis axis_x, axis_y;
switch (mouse_joystick_binding) {
@ -47,7 +56,7 @@ Uint32 MousePolling(void* param, Uint32 id, Uint32 interval) {
axis_y = Axis::RightY;
break;
default:
return interval; // no update needed
return; // no update needed
}
float d_x = 0, d_y = 0;
@ -67,7 +76,35 @@ Uint32 MousePolling(void* param, Uint32 id, Uint32 interval) {
controller->Axis(0, axis_x, GetAxis(-0x80, 0x7f, 0));
controller->Axis(0, axis_y, GetAxis(-0x80, 0x7f, 0));
}
}
constexpr float constant_down_accel[3] = {0.0f, 10.0f, 0.0f};
void EmulateGyro(GameController* controller, u32 interval) {
// LOG_INFO(Input, "todo gyro");
float d_x = 0, d_y = 0;
SDL_GetRelativeMouseState(&d_x, &d_y);
controller->Acceleration(1, constant_down_accel);
float gyro_from_mouse[3] = {-d_y / 100, -d_x / 100, 0.0f};
if (mouse_gyro_roll_mode) {
gyro_from_mouse[1] = 0.0f;
gyro_from_mouse[2] = -d_x / 100;
}
controller->Gyro(1, gyro_from_mouse);
}
Uint32 MousePolling(void* param, Uint32 id, Uint32 interval) {
auto* controller = (GameController*)param;
switch (mouse_mode) {
case MouseMode::Joystick:
EmulateJoystick(controller, interval);
break;
case MouseMode::Gyro:
EmulateGyro(controller, interval);
break;
default:
break;
}
return interval;
}

View file

@ -8,11 +8,21 @@
namespace Input {
void ToggleMouseEnabled();
enum MouseMode {
Off = 0,
Joystick,
Gyro,
};
bool ToggleMouseModeTo(MouseMode m);
void SetMouseToJoystick(int joystick);
void SetMouseParams(float mouse_deadzone_offset, float mouse_speed, float mouse_speed_offset);
void SetMouseGyroRollMode(bool mode);
// Polls the mouse for changes, and simulates joystick movement from it.
void EmulateJoystick(GameController* controller, u32 interval);
void EmulateGyro(GameController* controller, u32 interval);
// Polls the mouse for changes
Uint32 MousePolling(void* param, Uint32 id, Uint32 interval);
} // namespace Input

View file

@ -35,16 +35,19 @@ int main(int argc, char* argv[]) {
std::unordered_map<std::string, std::function<void(int&)>> arg_map = {
{"-h",
[&](int&) {
std::cout << "Usage: shadps4 [options] <elf or eboot.bin path>\n"
std::cout
<< "Usage: shadps4 [options] <elf or eboot.bin path>\n"
"Options:\n"
" -g, --game <path|ID> Specify game path to launch\n"
" -- ... Parameters passed to the game ELF. "
"Needs to be at the end of the line, and everything after \"--\" is a "
"game argument.\n"
" -p, --patch <patch_file> Apply specified patch file\n"
" -i, --ignore-game-patch Disable automatic loading of game patch\n"
" -f, --fullscreen <true|false> Specify window initial fullscreen "
"state. Does not overwrite the config file.\n"
" --add-game-folder <folder> Adds a new game folder to the config.\n"
" --set-addon-folder <folder> Sets the addon folder to the config.\n"
" -h, --help Display this help message\n";
exit(0);
}},
@ -72,6 +75,8 @@ int main(int argc, char* argv[]) {
}
}},
{"--patch", [&](int& i) { arg_map["-p"](i); }},
{"-i", [&](int&) { Core::FileSys::MntPoints::ignore_game_patches = true; }},
{"--ignore-game-patch", [&](int& i) { arg_map["-i"](i); }},
{"-f",
[&](int& i) {
if (++i >= argc) {
@ -112,7 +117,24 @@ int main(int argc, char* argv[]) {
std::cout << "Game folder successfully saved.\n";
exit(0);
}},
};
{"--set-addon-folder", [&](int& i) {
if (++i >= argc) {
std::cerr << "Error: Missing argument for --add-addon-folder\n";
exit(1);
}
std::string config_dir(argv[i]);
std::filesystem::path config_path = std::filesystem::path(config_dir);
std::error_code discard;
if (!std::filesystem::exists(config_path, discard)) {
std::cerr << "Error: File does not exist: " << config_path << "\n";
exit(1);
}
Config::setAddonInstallDir(config_path);
Config::save(Common::FS::GetUserPath(Common::FS::PathType::UserDir) / "config.toml");
std::cout << "Addon folder successfully saved.\n";
exit(0);
}}};
if (argc == 1) {
int dummy = 0; // one does not simply pass 0 directly

View file

@ -12,7 +12,8 @@
#include "main_window_themes.h"
#include "ui_about_dialog.h"
AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent), ui(new Ui::AboutDialog) {
AboutDialog::AboutDialog(std::shared_ptr<gui_settings> gui_settings, QWidget* parent)
: QDialog(parent), ui(new Ui::AboutDialog), m_gui_settings(std::move(gui_settings)) {
ui->setupUi(this);
preloadImages();
@ -57,7 +58,7 @@ void AboutDialog::preloadImages() {
}
void AboutDialog::updateImagesForCurrentTheme() {
Theme currentTheme = static_cast<Theme>(Config::getMainWindowTheme());
Theme currentTheme = static_cast<Theme>(m_gui_settings->GetValue(gui::gen_theme).toInt());
bool isDarkTheme = (currentTheme == Theme::Dark || currentTheme == Theme::Green ||
currentTheme == Theme::Blue || currentTheme == Theme::Violet);
if (isDarkTheme) {
@ -188,7 +189,7 @@ void AboutDialog::removeHoverEffect(QLabel* label) {
}
bool AboutDialog::isDarkTheme() const {
Theme currentTheme = static_cast<Theme>(Config::getMainWindowTheme());
Theme currentTheme = static_cast<Theme>(m_gui_settings->GetValue(gui::gen_theme).toInt());
return currentTheme == Theme::Dark || currentTheme == Theme::Green ||
currentTheme == Theme::Blue || currentTheme == Theme::Violet;
}

View file

@ -8,6 +8,7 @@
#include <QLabel>
#include <QPixmap>
#include <QUrl>
#include "gui_settings.h"
namespace Ui {
class AboutDialog;
@ -17,7 +18,7 @@ class AboutDialog : public QDialog {
Q_OBJECT
public:
explicit AboutDialog(QWidget* parent = nullptr);
explicit AboutDialog(std::shared_ptr<gui_settings> gui_settings, QWidget* parent = nullptr);
~AboutDialog();
bool eventFilter(QObject* obj, QEvent* event);
@ -33,4 +34,5 @@ private:
QPixmap originalImages[5];
QPixmap invertedImages[5];
std::shared_ptr<gui_settings> m_gui_settings;
};

View file

@ -28,8 +28,10 @@
using namespace Common::FS;
CheckUpdate::CheckUpdate(const bool showMessage, QWidget* parent)
: QDialog(parent), networkManager(new QNetworkAccessManager(this)) {
CheckUpdate::CheckUpdate(std::shared_ptr<gui_settings> gui_settings, const bool showMessage,
QWidget* parent)
: QDialog(parent), m_gui_settings(std::move(gui_settings)),
networkManager(new QNetworkAccessManager(this)) {
setWindowTitle(tr("Auto Updater"));
setFixedSize(0, 0);
CheckForUpdates(showMessage);
@ -43,7 +45,7 @@ void CheckUpdate::CheckForUpdates(const bool showMessage) {
bool checkName = true;
while (checkName) {
updateChannel = QString::fromStdString(Config::getUpdateChannel());
updateChannel = m_gui_settings->GetValue(gui::gen_updateChannel).toString();
if (updateChannel == "Nightly") {
url = QUrl("https://api.github.com/repos/shadps4-emu/shadPS4/releases");
checkName = false;
@ -52,12 +54,10 @@ void CheckUpdate::CheckForUpdates(const bool showMessage) {
checkName = false;
} else {
if (Common::g_is_release) {
Config::setUpdateChannel("Release");
m_gui_settings->SetValue(gui::gen_updateChannel, "Release");
} else {
Config::setUpdateChannel("Nightly");
m_gui_settings->SetValue(gui::gen_updateChannel, "Nightly");
}
const auto config_dir = Common::FS::GetUserPath(Common::FS::PathType::UserDir);
Config::save(config_dir / "config.toml");
}
}
@ -137,7 +137,7 @@ tr("The Auto Updater allows up to 60 update checks per hour.\\nYou have reached
}
}
latestRev = latestVersion.right(7);
latestRev = latestVersion.right(40);
latestDate = jsonObj["published_at"].toString();
QJsonArray assets = jsonObj["assets"].toArray();
@ -167,7 +167,7 @@ tr("The Auto Updater allows up to 60 update checks per hour.\\nYou have reached
QDateTime dateTime = QDateTime::fromString(latestDate, Qt::ISODate);
latestDate = dateTime.isValid() ? dateTime.toString("yyyy-MM-dd HH:mm:ss") : "Unknown date";
if (latestRev == currentRev.left(7)) {
if (latestRev == currentRev) {
if (showMessage) {
QMessageBox::information(this, tr("Auto Updater"),
tr("Your version is already up to date!"));
@ -198,7 +198,7 @@ void CheckUpdate::setupUI(const QString& downloadUrl, const QString& latestDate,
titleLayout->addWidget(titleLabel);
layout->addLayout(titleLayout);
QString updateChannel = QString::fromStdString(Config::getUpdateChannel());
QString updateChannel = m_gui_settings->GetValue(gui::gen_updateChannel).toString();
QString updateText = QString("<p><b>" + tr("Update Channel") + ": </b>" + updateChannel +
"<br>"
@ -215,7 +215,7 @@ void CheckUpdate::setupUI(const QString& downloadUrl, const QString& latestDate,
"<td>%3</td>"
"<td>(%4)</td>"
"</tr></table></p>")
.arg(currentRev.left(7), currentDate, latestRev, latestDate);
.arg(currentRev.left(7), currentDate, latestRev.left(7), latestDate);
QLabel* updateLabel = new QLabel(updateText, this);
layout->addWidget(updateLabel);
@ -273,7 +273,7 @@ void CheckUpdate::setupUI(const QString& downloadUrl, const QString& latestDate,
}
});
if (Config::alwaysShowChangelog()) {
if (m_gui_settings->GetValue(gui::gen_showChangeLog).toBool()) {
requestChangelog(currentRev, latestRev, downloadUrl, latestDate, currentDate);
textField->setVisible(true);
toggleButton->setText(tr("Hide Changelog"));
@ -290,14 +290,14 @@ void CheckUpdate::setupUI(const QString& downloadUrl, const QString& latestDate,
connect(noButton, &QPushButton::clicked, this, [this]() { close(); });
autoUpdateCheckBox->setChecked(Config::autoUpdate());
autoUpdateCheckBox->setChecked(m_gui_settings->GetValue(gui::gen_checkForUpdates).toBool());
#if (QT_VERSION < QT_VERSION_CHECK(6, 7, 0))
connect(autoUpdateCheckBox, &QCheckBox::stateChanged, this, [](int state) {
connect(autoUpdateCheckBox, &QCheckBox::stateChanged, this, [this](int state) {
#else
connect(autoUpdateCheckBox, &QCheckBox::checkStateChanged, this, [](Qt::CheckState state) {
connect(autoUpdateCheckBox, &QCheckBox::checkStateChanged, this, [this](Qt::CheckState state) {
#endif
const auto user_dir = Common::FS::GetUserPath(Common::FS::PathType::UserDir);
Config::setAutoUpdate(state == Qt::Checked);
m_gui_settings->SetValue(gui::gen_checkForUpdates, (state == Qt::Checked));
Config::save(user_dir / "config.toml");
});

View file

@ -8,12 +8,14 @@
#include <QDialog>
#include <QNetworkAccessManager>
#include <QPushButton>
#include "gui_settings.h"
class CheckUpdate : public QDialog {
Q_OBJECT
public:
explicit CheckUpdate(const bool showMessage, QWidget* parent = nullptr);
explicit CheckUpdate(std::shared_ptr<gui_settings> gui_settings, const bool showMessage,
QWidget* parent = nullptr);
~CheckUpdate();
private slots:
@ -35,6 +37,7 @@ private:
QString updateDownloadUrl;
QNetworkAccessManager* networkManager;
std::shared_ptr<gui_settings> m_gui_settings;
};
#endif // CHECKUPDATE_H

View file

@ -39,14 +39,28 @@ private:
"pad_left", "pad_right", "axis_left_x", "axis_left_y", "axis_right_x",
"axis_right_y", "back"};
const QStringList ButtonOutputs = {"cross", "circle", "square", "triangle", "l1",
"r1", "l2", "r2", "l3",
const QStringList ButtonOutputs = {"cross",
"circle",
"square",
"triangle",
"l1",
"r1",
"l2",
"r2",
"l3",
"r3", "options", "pad_up",
"r3",
"options",
"pad_up",
"pad_down",
"pad_left", "pad_right", "touchpad", "unmapped"};
"pad_left",
"pad_right",
"touchpad_left",
"touchpad_center",
"touchpad_right",
"unmapped"};
const QStringList StickOutputs = {"axis_left_x", "axis_left_y", "axis_right_x", "axis_right_y",
"unmapped"};

View file

@ -3,10 +3,12 @@
#include "elf_viewer.h"
ElfViewer::ElfViewer(QWidget* parent) : QTableWidget(parent) {
dir_list_std = Config::getElfViewer();
for (const auto& str : dir_list_std) {
dir_list.append(QString::fromStdString(str));
ElfViewer::ElfViewer(std::shared_ptr<gui_settings> gui_settings, QWidget* parent)
: QTableWidget(parent), m_gui_settings(std::move(gui_settings)) {
list = gui_settings::Var2List(m_gui_settings->GetValue(gui::gen_elfDirs));
for (const auto& str : list) {
dir_list.append(str);
}
CheckElfFolders();
@ -55,11 +57,11 @@ void ElfViewer::OpenElfFolder() {
}
std::ranges::sort(m_elf_list);
OpenElfFiles();
dir_list_std.clear();
list.clear();
for (auto dir : dir_list) {
dir_list_std.push_back(dir.toStdString());
list.push_back(dir);
}
Config::setElfViewer(dir_list_std);
m_gui_settings->SetValue(gui::gen_elfDirs, gui_settings::List2Var(list));
} else {
// qDebug() << "Folder selection canceled.";
}

View file

@ -11,7 +11,7 @@
class ElfViewer : public QTableWidget {
Q_OBJECT
public:
explicit ElfViewer(QWidget* parent = nullptr);
explicit ElfViewer(std::shared_ptr<gui_settings> gui_settings, QWidget* parent = nullptr);
QStringList m_elf_list;
private:
@ -21,7 +21,8 @@ private:
Core::Loader::Elf m_elf_file;
QStringList dir_list;
QStringList elf_headers_list;
std::vector<std::string> dir_list_std;
QList<QString> list;
std::shared_ptr<gui_settings> m_gui_settings;
void SetTableItem(QTableWidget* game_list, int row, int column, QString itemStr) {
QTableWidgetItem* item = new QTableWidgetItem();

View file

@ -5,11 +5,13 @@
#include "game_grid_frame.h"
#include "qt_gui/compatibility_info.h"
GameGridFrame::GameGridFrame(std::shared_ptr<GameInfoClass> game_info_get,
GameGridFrame::GameGridFrame(std::shared_ptr<gui_settings> gui_settings,
std::shared_ptr<GameInfoClass> game_info_get,
std::shared_ptr<CompatibilityInfoClass> compat_info_get,
QWidget* parent)
: QTableWidget(parent), m_game_info(game_info_get), m_compat_info(compat_info_get) {
icon_size = Config::getIconSizeGrid();
: QTableWidget(parent), m_gui_settings(std::move(gui_settings)), m_game_info(game_info_get),
m_compat_info(compat_info_get) {
icon_size = m_gui_settings->GetValue(gui::gg_icon_size).toInt();
windowWidth = parent->width();
this->setShowGrid(false);
this->setEditTriggers(QAbstractItemView::NoEditTriggers);
@ -32,7 +34,9 @@ GameGridFrame::GameGridFrame(std::shared_ptr<GameInfoClass> game_info_get,
connect(this->horizontalScrollBar(), &QScrollBar::valueChanged, this,
&GameGridFrame::RefreshGridBackgroundImage);
connect(this, &QTableWidget::customContextMenuRequested, this, [=, this](const QPoint& pos) {
m_gui_context_menus.RequestGameMenu(pos, m_game_info->m_games, m_compat_info, this, false);
m_gui_context_menus.RequestGameMenu(pos, m_game_info->m_games, m_compat_info,
m_gui_settings, this, false);
PopulateGameGrid(m_game_info->m_games, false);
});
}
@ -74,7 +78,7 @@ void GameGridFrame::onCurrentCellChanged(int currentRow, int currentColumn, int
}
void GameGridFrame::PlayBackgroundMusic(QString path) {
if (path.isEmpty() || !Config::getPlayBGM()) {
if (path.isEmpty() || !m_gui_settings->GetValue(gui::gl_playBackgroundMusic).toBool()) {
BackgroundMusicPlayer::getInstance().stopMusic();
return;
}
@ -86,12 +90,16 @@ void GameGridFrame::PopulateGameGrid(QVector<GameInfo> m_games_search, bool from
this->crtColumn = -1;
QVector<GameInfo> m_games_;
this->clearContents();
if (fromSearch)
if (fromSearch) {
SortByFavorite(&m_games_search);
m_games_ = m_games_search;
else
} else {
SortByFavorite(&(m_game_info->m_games));
m_games_ = m_game_info->m_games;
}
m_games_shared = std::make_shared<QVector<GameInfo>>(m_games_);
icon_size = Config::getIconSizeGrid(); // update icon size for resize event.
icon_size =
m_gui_settings->GetValue(gui::gg_icon_size).toInt(); // update icon size for resize event.
int gamesPerRow = windowWidth / (icon_size + 20); // 2 x cell widget border size.
int row = 0;
@ -107,18 +115,25 @@ void GameGridFrame::PopulateGameGrid(QVector<GameInfo> m_games_search, bool from
for (int i = 0; i < m_games_.size(); i++) {
QWidget* widget = new QWidget();
QVBoxLayout* layout = new QVBoxLayout();
QLabel* image_label = new QLabel();
QWidget* image_container = new QWidget();
image_container->setFixedSize(icon_size, icon_size);
QLabel* image_label = new QLabel(image_container);
QImage icon = m_games_[gameCounter].icon.scaled(
QSize(icon_size, icon_size), Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
image_label->setFixedSize(icon.width(), icon.height());
image_label->setPixmap(QPixmap::fromImage(icon));
image_label->move(0, 0);
SetFavoriteIcon(image_container, m_games_, gameCounter);
QLabel* name_label = new QLabel(QString::fromStdString(m_games_[gameCounter].serial));
name_label->setAlignment(Qt::AlignHCenter);
layout->addWidget(image_label);
layout->addWidget(image_container);
layout->addWidget(name_label);
// Resizing of font-size.
float fontSize = (Config::getIconSizeGrid() / 5.5f);
float fontSize = (m_gui_settings->GetValue(gui::gg_icon_size).toInt() / 5.5f);
QString styleSheet =
QString("color: white; font-weight: bold; font-size: %1px;").arg(fontSize);
name_label->setStyleSheet(styleSheet);
@ -168,7 +183,7 @@ void GameGridFrame::SetGridBackgroundImage(int row, int column) {
}
// If background images are hidden, clear the background image
if (!Config::getShowBackgroundImage()) {
if (!m_gui_settings->GetValue(gui::gl_showBackgroundImage).toBool()) {
backgroundImage = QImage();
m_last_opacity = -1; // Reset opacity tracking when disabled
m_current_game_path.clear(); // Reset current game path
@ -177,7 +192,7 @@ void GameGridFrame::SetGridBackgroundImage(int row, int column) {
}
const auto& game = (*m_games_shared)[itemID];
const int opacity = Config::getBackgroundImageOpacity();
const int opacity = m_gui_settings->GetValue(gui::gl_backgroundImageOpacity).toInt();
// Recompute if opacity changed or we switched to a different game
if (opacity != m_last_opacity || game.pic_path != m_current_game_path) {
@ -195,7 +210,8 @@ void GameGridFrame::SetGridBackgroundImage(int row, int column) {
void GameGridFrame::RefreshGridBackgroundImage() {
QPalette palette;
if (!backgroundImage.isNull() && Config::getShowBackgroundImage()) {
if (!backgroundImage.isNull() &&
m_gui_settings->GetValue(gui::gl_showBackgroundImage).toBool()) {
QSize widgetSize = size();
QPixmap scaledPixmap =
QPixmap::fromImage(backgroundImage)
@ -221,3 +237,43 @@ void GameGridFrame::resizeEvent(QResizeEvent* event) {
bool GameGridFrame::IsValidCellSelected() {
return validCellSelected;
}
void GameGridFrame::SetFavoriteIcon(QWidget* parentWidget, QVector<GameInfo> m_games_,
int gameCounter) {
QString serialStr = QString::fromStdString(m_games_[gameCounter].serial);
QList<QString> list = gui_settings::Var2List(m_gui_settings->GetValue(gui::favorites_list));
bool isFavorite = list.contains(serialStr);
QLabel* label = new QLabel(parentWidget);
label->setPixmap(QPixmap(":images/favorite_icon.png")
.scaled(icon_size / 3.8, icon_size / 3.8, Qt::KeepAspectRatio,
Qt::SmoothTransformation));
label->move(icon_size - icon_size / 4, 2);
label->raise();
label->setVisible(isFavorite);
label->setObjectName("favoriteIcon");
}
void GameGridFrame::SortByFavorite(QVector<GameInfo>* game_list) {
std::sort(game_list->begin(), game_list->end(), [this](const GameInfo& a, const GameInfo& b) {
return this->CompareWithFavorite(a, b);
});
}
bool GameGridFrame::CompareWithFavorite(GameInfo a, GameInfo b) {
std::string serial_a = a.serial;
std::string serial_b = b.serial;
QString serialStr_a = QString::fromStdString(a.serial);
QString serialStr_b = QString::fromStdString(b.serial);
QList<QString> list = gui_settings::Var2List(m_gui_settings->GetValue(gui::favorites_list));
bool isFavorite_a = list.contains(serialStr_a);
bool isFavorite_b = list.contains(serialStr_b);
if (isFavorite_a != isFavorite_b) {
return isFavorite_a;
} else {
std::string name_a = a.name, name_b = b.name;
std::transform(name_a.begin(), name_a.end(), name_a.begin(), ::tolower);
std::transform(name_b.begin(), name_b.end(), name_b.begin(), ::tolower);
return name_a < name_b;
}
}

View file

@ -11,6 +11,7 @@
#include "game_info.h"
#include "game_list_utils.h"
#include "gui_context_menus.h"
#include "gui_settings.h"
#include "qt_gui/compatibility_info.h"
class GameGridFrame : public QTableWidget {
@ -37,13 +38,18 @@ private:
bool validCellSelected = false;
int m_last_opacity = -1; // Track last opacity to avoid unnecessary recomputation
std::filesystem::path m_current_game_path; // Track current game path to detect changes
std::shared_ptr<gui_settings> m_gui_settings;
void SetFavoriteIcon(QWidget* parentWidget, QVector<GameInfo> m_games_, int gameCounter);
bool CompareWithFavorite(GameInfo a, GameInfo b);
public:
explicit GameGridFrame(std::shared_ptr<GameInfoClass> game_info_get,
explicit GameGridFrame(std::shared_ptr<gui_settings> gui_settings,
std::shared_ptr<GameInfoClass> game_info_get,
std::shared_ptr<CompatibilityInfoClass> compat_info_get,
QWidget* parent = nullptr);
void PopulateGameGrid(QVector<GameInfo> m_games, bool fromSearch);
bool IsValidCellSelected();
void SortByFavorite(QVector<GameInfo>* game_list);
bool cellClicked = false;
int icon_size;

View file

@ -9,11 +9,14 @@
#include "game_list_frame.h"
#include "game_list_utils.h"
GameListFrame::GameListFrame(std::shared_ptr<GameInfoClass> game_info_get,
GameListFrame::GameListFrame(std::shared_ptr<gui_settings> gui_settings,
std::shared_ptr<GameInfoClass> game_info_get,
std::shared_ptr<CompatibilityInfoClass> compat_info_get,
QWidget* parent)
: QTableWidget(parent), m_game_info(game_info_get), m_compat_info(compat_info_get) {
icon_size = Config::getIconSize();
: QTableWidget(parent), m_gui_settings(std::move(gui_settings)), m_game_info(game_info_get),
m_compat_info(compat_info_get) {
icon_size = m_gui_settings->GetValue(gui::gl_icon_size).toInt();
last_favorite = "";
this->setShowGrid(false);
this->setEditTriggers(QAbstractItemView::NoEditTriggers);
this->setSelectionBehavior(QAbstractItemView::SelectRows);
@ -28,9 +31,8 @@ GameListFrame::GameListFrame(std::shared_ptr<GameInfoClass> game_info_get,
this->horizontalHeader()->setContextMenuPolicy(Qt::CustomContextMenu);
this->horizontalHeader()->setHighlightSections(false);
this->horizontalHeader()->setSortIndicatorShown(true);
this->horizontalHeader()->setStretchLastSection(true);
this->setContextMenuPolicy(Qt::CustomContextMenu);
this->setColumnCount(10);
this->setColumnCount(11);
this->setColumnWidth(1, 300); // Name
this->setColumnWidth(2, 140); // Compatibility
this->setColumnWidth(3, 120); // Serial
@ -39,14 +41,18 @@ GameListFrame::GameListFrame(std::shared_ptr<GameInfoClass> game_info_get,
this->setColumnWidth(6, 90); // Size
this->setColumnWidth(7, 90); // Version
this->setColumnWidth(8, 120); // Play Time
this->setColumnWidth(10, 90); // Favorite
QStringList headers;
headers << tr("Icon") << tr("Name") << tr("Compatibility") << tr("Serial") << tr("Region")
<< tr("Firmware") << tr("Size") << tr("Version") << tr("Play Time") << tr("Path");
<< tr("Firmware") << tr("Size") << tr("Version") << tr("Play Time") << tr("Path")
<< tr("Favorite");
this->setHorizontalHeaderLabels(headers);
this->horizontalHeader()->setSortIndicatorShown(true);
this->horizontalHeader()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
this->horizontalHeader()->setSectionResizeMode(3, QHeaderView::Fixed);
this->horizontalHeader()->setSectionResizeMode(4, QHeaderView::Fixed);
this->horizontalHeader()->setSectionResizeMode(9, QHeaderView::Stretch);
this->horizontalHeader()->setSectionResizeMode(10, QHeaderView::Fixed);
PopulateGameList();
connect(this, &QTableWidget::currentCellChanged, this, &GameListFrame::onCurrentCellChanged);
@ -63,17 +69,24 @@ GameListFrame::GameListFrame(std::shared_ptr<GameInfoClass> game_info_get,
SortNameDescending(columnIndex);
this->horizontalHeader()->setSortIndicator(columnIndex, Qt::DescendingOrder);
ListSortedAsc = false;
sortColumn = columnIndex;
} else {
SortNameAscending(columnIndex);
this->horizontalHeader()->setSortIndicator(columnIndex, Qt::AscendingOrder);
ListSortedAsc = true;
sortColumn = columnIndex;
}
this->clearContents();
PopulateGameList(false);
});
connect(this, &QTableWidget::customContextMenuRequested, this, [=, this](const QPoint& pos) {
m_gui_context_menus.RequestGameMenu(pos, m_game_info->m_games, m_compat_info, this, true);
int changedFavorite = m_gui_context_menus.RequestGameMenu(
pos, m_game_info->m_games, m_compat_info, m_gui_settings, this, true);
if (changedFavorite) {
last_favorite = m_game_info->m_games[this->currentRow()].serial;
PopulateGameList(false);
}
});
connect(this, &QTableWidget::cellClicked, this, [=, this](int row, int column) {
@ -81,6 +94,19 @@ GameListFrame::GameListFrame(std::shared_ptr<GameInfoClass> game_info_get,
auto url_issues = "https://github.com/shadps4-emu/shadps4-game-compatibility/issues/";
QDesktopServices::openUrl(
QUrl(url_issues + m_game_info->m_games[row].compatibility.issue_number));
} else if (column == 10) {
last_favorite = m_game_info->m_games[row].serial;
QString serialStr = QString::fromStdString(last_favorite);
QList<QString> list =
gui_settings::Var2List(m_gui_settings->GetValue(gui::favorites_list));
bool isFavorite = list.contains(serialStr);
if (isFavorite) {
list.removeOne(serialStr);
} else {
list.append(serialStr);
}
m_gui_settings->SetValue(gui::favorites_list, gui_settings::List2Var(list));
PopulateGameList(false);
}
});
}
@ -97,7 +123,7 @@ void GameListFrame::onCurrentCellChanged(int currentRow, int currentColumn, int
}
void GameListFrame::PlayBackgroundMusic(QTableWidgetItem* item) {
if (!item || !Config::getPlayBGM()) {
if (!item || !m_gui_settings->GetValue(gui::gl_playBackgroundMusic).toBool()) {
BackgroundMusicPlayer::getInstance().stopMusic();
return;
}
@ -115,10 +141,7 @@ void GameListFrame::PopulateGameList(bool isInitialPopulation) {
this->setRowCount(m_game_info->m_games.size());
ResizeIcons(icon_size);
if (isInitialPopulation) {
SortNameAscending(1); // Column 1 = Name
ResizeIcons(icon_size);
}
ApplyLastSorting(isInitialPopulation);
for (int i = 0; i < m_game_info->m_games.size(); i++) {
SetTableItem(i, 1, QString::fromStdString(m_game_info->m_games[i].name));
@ -127,6 +150,11 @@ void GameListFrame::PopulateGameList(bool isInitialPopulation) {
SetTableItem(i, 5, QString::fromStdString(m_game_info->m_games[i].fw));
SetTableItem(i, 6, QString::fromStdString(m_game_info->m_games[i].size));
SetTableItem(i, 7, QString::fromStdString(m_game_info->m_games[i].version));
SetFavoriteIcon(i, 10);
if (m_game_info->m_games[i].serial == last_favorite && !isInitialPopulation) {
this->setCurrentCell(i, 10);
}
m_game_info->m_games[i].compatibility =
m_compat_info->GetCompatibilityInfo(m_game_info->m_games[i].serial);
@ -172,7 +200,7 @@ void GameListFrame::SetListBackgroundImage(QTableWidgetItem* item) {
}
// If background images are hidden, clear the background image
if (!Config::getShowBackgroundImage()) {
if (!m_gui_settings->GetValue(gui::gl_showBackgroundImage).toBool()) {
backgroundImage = QImage();
m_last_opacity = -1; // Reset opacity tracking when disabled
m_current_game_path.clear(); // Reset current game path
@ -181,7 +209,7 @@ void GameListFrame::SetListBackgroundImage(QTableWidgetItem* item) {
}
const auto& game = m_game_info->m_games[item->row()];
const int opacity = Config::getBackgroundImageOpacity();
const int opacity = m_gui_settings->GetValue(gui::gl_backgroundImageOpacity).toInt();
// Recompute if opacity changed or we switched to a different game
if (opacity != m_last_opacity || game.pic_path != m_current_game_path) {
@ -200,7 +228,8 @@ void GameListFrame::SetListBackgroundImage(QTableWidgetItem* item) {
void GameListFrame::RefreshListBackgroundImage() {
QPalette palette;
if (!backgroundImage.isNull() && Config::getShowBackgroundImage()) {
if (!backgroundImage.isNull() &&
m_gui_settings->GetValue(gui::gl_showBackgroundImage).toBool()) {
QSize widgetSize = size();
QPixmap scaledPixmap =
QPixmap::fromImage(backgroundImage)
@ -223,20 +252,50 @@ void GameListFrame::resizeEvent(QResizeEvent* event) {
RefreshListBackgroundImage();
}
bool GameListFrame::CompareWithFavorite(GameInfo a, GameInfo b, int columnIndex, bool ascending) {
std::string serial_a = a.serial;
std::string serial_b = b.serial;
QString serialStr_a = QString::fromStdString(a.serial);
QString serialStr_b = QString::fromStdString(b.serial);
QList<QString> list = gui_settings::Var2List(m_gui_settings->GetValue(gui::favorites_list));
bool isFavorite_a = list.contains(serialStr_a);
bool isFavorite_b = list.contains(serialStr_b);
if (isFavorite_a != isFavorite_b) {
return isFavorite_a;
} else if (ascending) {
return CompareStringsAscending(a, b, columnIndex);
} else {
return CompareStringsDescending(a, b, columnIndex);
}
}
void GameListFrame::SortNameAscending(int columnIndex) {
std::sort(m_game_info->m_games.begin(), m_game_info->m_games.end(),
[columnIndex](const GameInfo& a, const GameInfo& b) {
return CompareStringsAscending(a, b, columnIndex);
[this, columnIndex](const GameInfo& a, const GameInfo& b) {
return this->CompareWithFavorite(a, b, columnIndex, true);
});
}
void GameListFrame::SortNameDescending(int columnIndex) {
std::sort(m_game_info->m_games.begin(), m_game_info->m_games.end(),
[columnIndex](const GameInfo& a, const GameInfo& b) {
return CompareStringsDescending(a, b, columnIndex);
[this, columnIndex](const GameInfo& a, const GameInfo& b) {
return this->CompareWithFavorite(a, b, columnIndex, false);
});
}
void GameListFrame::ApplyLastSorting(bool isInitialPopulation) {
if (isInitialPopulation) {
SortNameAscending(1); // Column 1 = Name
ResizeIcons(icon_size);
} else if (ListSortedAsc) {
SortNameAscending(sortColumn);
ResizeIcons(icon_size);
} else {
SortNameDescending(sortColumn);
ResizeIcons(icon_size);
}
}
void GameListFrame::ResizeIcons(int iconSize) {
for (int index = 0; auto& game : m_game_info->m_games) {
QImage scaledPixmap = game.icon.scaled(QSize(iconSize, iconSize), Qt::KeepAspectRatio,
@ -387,6 +446,35 @@ void GameListFrame::SetRegionFlag(int row, int column, QString itemStr) {
this->setCellWidget(row, column, widget);
}
void GameListFrame::SetFavoriteIcon(int row, int column) {
QString serialStr = QString::fromStdString(m_game_info->m_games[row].serial);
QList<QString> list = gui_settings::Var2List(m_gui_settings->GetValue(gui::favorites_list));
bool isFavorite = list.contains(serialStr);
QTableWidgetItem* item = new QTableWidgetItem();
QImage scaledPixmap = QImage(":images/favorite_icon.png");
scaledPixmap = scaledPixmap.scaledToHeight(this->columnWidth(column) / 2.5);
scaledPixmap = scaledPixmap.scaledToWidth(this->columnWidth(column) / 2.5);
QWidget* widget = new QWidget(this);
QVBoxLayout* layout = new QVBoxLayout(widget);
QLabel* label = new QLabel(widget);
label->setPixmap(QPixmap::fromImage(scaledPixmap));
label->setObjectName("favoriteIcon");
label->setVisible(isFavorite);
layout->setAlignment(Qt::AlignCenter);
layout->addWidget(label);
widget->setLayout(layout);
this->setItem(row, column, item);
this->setCellWidget(row, column, widget);
if (column > 0) {
this->horizontalHeader()->setSectionResizeMode(column - 1, QHeaderView::Stretch);
}
}
QString GameListFrame::GetPlayTime(const std::string& serial) {
QString playTime;
const auto user_dir = Common::FS::GetUserPath(Common::FS::PathType::UserDir);

View file

@ -17,11 +17,13 @@
#include "game_info.h"
#include "game_list_utils.h"
#include "gui_context_menus.h"
#include "gui_settings.h"
class GameListFrame : public QTableWidget {
Q_OBJECT
public:
explicit GameListFrame(std::shared_ptr<GameInfoClass> game_info_get,
explicit GameListFrame(std::shared_ptr<gui_settings> gui_settings,
std::shared_ptr<GameInfoClass> game_info_get,
std::shared_ptr<CompatibilityInfoClass> compat_info_get,
QWidget* parent = nullptr);
Q_SIGNALS:
@ -40,18 +42,22 @@ public Q_SLOTS:
private:
void SetTableItem(int row, int column, QString itemStr);
void SetRegionFlag(int row, int column, QString itemStr);
void SetFavoriteIcon(int row, int column);
void SetCompatibilityItem(int row, int column, CompatibilityEntry entry);
QString GetPlayTime(const std::string& serial);
QList<QAction*> m_columnActs;
GameInfoClass* game_inf_get = nullptr;
bool ListSortedAsc = true;
int sortColumn = 1;
QTableWidgetItem* m_current_item = nullptr;
int m_last_opacity = -1; // Track last opacity to avoid unnecessary recomputation
std::filesystem::path m_current_game_path; // Track current game path to detect changes
std::shared_ptr<gui_settings> m_gui_settings;
public:
void PopulateGameList(bool isInitialPopulation = true);
void ResizeIcons(int iconSize);
void ApplyLastSorting(bool isInitialPopulation);
QTableWidgetItem* GetCurrentItem();
QImage backgroundImage;
GameListUtils m_game_list_utils;
@ -60,6 +66,7 @@ public:
std::shared_ptr<CompatibilityInfoClass> m_compat_info;
int icon_size;
std::string last_favorite;
static float parseAsFloat(const std::string& str, const int& offset) {
return std::stof(str.substr(0, str.size() - offset));
@ -127,4 +134,6 @@ public:
return false;
}
}
bool CompareWithFavorite(GameInfo a, GameInfo b, int columnIndex, bool ascending);
};

View file

@ -16,6 +16,7 @@
#include "common/scm_rev.h"
#include "compatibility_info.h"
#include "game_info.h"
#include "gui_settings.h"
#include "trophy_viewer.h"
#ifdef Q_OS_WIN
@ -30,11 +31,13 @@
class GuiContextMenus : public QObject {
Q_OBJECT
public:
void RequestGameMenu(const QPoint& pos, QVector<GameInfo>& m_games,
int RequestGameMenu(const QPoint& pos, QVector<GameInfo>& m_games,
std::shared_ptr<CompatibilityInfoClass> m_compat_info,
QTableWidget* widget, bool isList) {
std::shared_ptr<gui_settings> settings, QTableWidget* widget, bool isList) {
QPoint global_pos = widget->viewport()->mapToGlobal(pos);
std::shared_ptr<gui_settings> m_gui_settings = std::move(settings);
int itemID = 0;
int changedFavorite = 0;
if (isList) {
itemID = widget->currentRow();
} else {
@ -43,7 +46,7 @@ public:
// Do not show the menu if no item is selected
if (itemID < 0 || itemID >= m_games.size()) {
return;
return changedFavorite;
}
// Setup menu.
@ -63,11 +66,22 @@ public:
menu.addMenu(openFolderMenu);
QString serialStr = QString::fromStdString(m_games[itemID].serial);
QList<QString> list = gui_settings::Var2List(m_gui_settings->GetValue(gui::favorites_list));
bool isFavorite = list.contains(serialStr);
QAction* toggleFavorite;
if (isFavorite) {
toggleFavorite = new QAction(tr("Remove from Favorites"), widget);
} else {
toggleFavorite = new QAction(tr("Add to Favorites"), widget);
}
QAction createShortcut(tr("Create Shortcut"), widget);
QAction openCheats(tr("Cheats / Patches"), widget);
QAction openSfoViewer(tr("SFO Viewer"), widget);
QAction openTrophyViewer(tr("Trophy Viewer"), widget);
menu.addAction(toggleFavorite);
menu.addAction(&createShortcut);
menu.addAction(&openCheats);
menu.addAction(&openSfoViewer);
@ -128,7 +142,7 @@ public:
// Show menu.
auto selected = menu.exec(global_pos);
if (!selected) {
return;
return changedFavorite;
}
if (selected == openGameFolder) {
@ -301,6 +315,16 @@ public:
}
}
if (selected == toggleFavorite) {
if (isFavorite) {
list.removeOne(serialStr);
} else {
list.append(serialStr);
}
m_gui_settings->SetValue(gui::favorites_list, gui_settings::List2Var(list));
changedFavorite = 1;
}
if (selected == &openCheats) {
QString gameName = QString::fromStdString(m_games[itemID].name);
QString gameSerial = QString::fromStdString(m_games[itemID].serial);
@ -357,7 +381,7 @@ public:
QString gameName = QString::fromStdString(m_games[itemID].name);
TrophyViewer* trophyViewer =
new TrophyViewer(trophyPath, gameTrpPath, gameName, allTrophyGames);
new TrophyViewer(m_gui_settings, trophyPath, gameTrpPath, gameName, allTrophyGames);
trophyViewer->show();
connect(widget->parent(), &QWidget::destroyed, trophyViewer,
[trophyViewer]() { trophyViewer->deleteLater(); });
@ -586,6 +610,7 @@ public:
QUrl(url_issues + m_games[itemID].compatibility.issue_number));
}
}
return changedFavorite;
}
int GetRowIndex(QTreeWidget* treeWidget, QTreeWidgetItem* item) {

View file

@ -0,0 +1,9 @@
// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include "gui_settings.h"
gui_settings::gui_settings(QObject* parent) : settings(parent) {
m_settings = std::make_unique<QSettings>(ComputeSettingsDir() + "qt_ui.ini",
QSettings::Format::IniFormat, parent);
}

57
src/qt_gui/gui_settings.h Normal file
View file

@ -0,0 +1,57 @@
// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <QWindow>
#include "settings.h"
namespace gui {
// categories
const QString general_settings = "general_settings";
const QString main_window = "main_window";
const QString game_list = "game_list";
const QString game_grid = "game_grid";
const QString favorites = "favorites";
// general
const gui_value gen_checkForUpdates = gui_value(general_settings, "checkForUpdates", false);
const gui_value gen_showChangeLog = gui_value(general_settings, "showChangeLog", false);
const gui_value gen_updateChannel = gui_value(general_settings, "updateChannel", "Release");
const gui_value gen_recentFiles =
gui_value(main_window, "recentFiles", QVariant::fromValue(QList<QString>()));
const gui_value gen_guiLanguage = gui_value(general_settings, "guiLanguage", "en_US");
const gui_value gen_elfDirs =
gui_value(main_window, "elfDirs", QVariant::fromValue(QList<QString>()));
const gui_value gen_theme = gui_value(general_settings, "theme", 0);
// main window settings
const gui_value mw_geometry = gui_value(main_window, "geometry", QByteArray());
const gui_value mw_showLabelsUnderIcons = gui_value(main_window, "showLabelsUnderIcons", true);
// game list settings
const gui_value gl_mode = gui_value(game_list, "tableMode", 0);
const gui_value gl_icon_size = gui_value(game_list, "icon_size", 36);
const gui_value gl_slider_pos = gui_value(game_list, "slider_pos", 0);
const gui_value gl_showBackgroundImage = gui_value(game_list, "showBackgroundImage", true);
const gui_value gl_backgroundImageOpacity = gui_value(game_list, "backgroundImageOpacity", 50);
const gui_value gl_playBackgroundMusic = gui_value(game_list, "playBackgroundMusic", true);
const gui_value gl_backgroundMusicVolume = gui_value(game_list, "backgroundMusicVolume", 50);
// game grid settings
const gui_value gg_icon_size = gui_value(game_grid, "icon_size", 69);
const gui_value gg_slider_pos = gui_value(game_grid, "slider_pos", 0);
// favorites list
const gui_value favorites_list =
gui_value(favorites, "favoritesList", QVariant::fromValue(QList<QString>()));
} // namespace gui
class gui_settings : public settings {
Q_OBJECT
public:
explicit gui_settings(QObject* parent = nullptr);
~gui_settings() override = default;
};

View file

@ -32,14 +32,34 @@ KBMSettings::KBMSettings(std::shared_ptr<GameInfoClass> game_info_get, QWidget*
ui->ProfileComboBox->addItem(QString::fromStdString(m_game_info->m_games[i].serial));
}
ButtonsList = {
ui->CrossButton, ui->CircleButton, ui->TriangleButton, ui->SquareButton,
ui->L1Button, ui->R1Button, ui->L2Button, ui->R2Button,
ui->L3Button, ui->R3Button, ui->TouchpadButton, ui->OptionsButton,
ui->TouchpadButton, ui->DpadUpButton, ui->DpadDownButton, ui->DpadLeftButton,
ui->DpadRightButton, ui->LStickUpButton, ui->LStickDownButton, ui->LStickLeftButton,
ui->LStickRightButton, ui->RStickUpButton, ui->RStickDownButton, ui->RStickLeftButton,
ui->RStickRightButton, ui->LHalfButton, ui->RHalfButton};
ButtonsList = {ui->CrossButton,
ui->CircleButton,
ui->TriangleButton,
ui->SquareButton,
ui->L1Button,
ui->R1Button,
ui->L2Button,
ui->R2Button,
ui->L3Button,
ui->R3Button,
ui->OptionsButton,
ui->TouchpadLeftButton,
ui->TouchpadCenterButton,
ui->TouchpadRightButton,
ui->DpadUpButton,
ui->DpadDownButton,
ui->DpadLeftButton,
ui->DpadRightButton,
ui->LStickUpButton,
ui->LStickDownButton,
ui->LStickLeftButton,
ui->LStickRightButton,
ui->RStickUpButton,
ui->RStickDownButton,
ui->RStickLeftButton,
ui->RStickRightButton,
ui->LHalfButton,
ui->RHalfButton};
ButtonConnects();
SetUIValuestoMappings("default");
@ -144,187 +164,73 @@ void KBMSettings::EnableMappingButtons() {
}
}
void KBMSettings::SaveKBMConfig(bool CloseOnSave) {
void KBMSettings::SaveKBMConfig(bool close_on_save) {
std::string output_string = "", input_string = "";
std::vector<std::string> lines, inputs;
// Comment lines for config file
lines.push_back("#Feeling lost? Check out the Help section!");
lines.push_back("");
lines.push_back("#Keyboard bindings");
lines.push_back("");
input_string = ui->CrossButton->text().toStdString();
output_string = "cross";
// Lambda to reduce repetitive code for mapping buttons to config lines
auto add_mapping = [&](const QString& buttonText, const std::string& output_name) {
input_string = buttonText.toStdString();
output_string = output_name;
lines.push_back(output_string + " = " + input_string);
if (input_string != "unmapped")
if (input_string != "unmapped") {
inputs.push_back(input_string);
}
};
input_string = ui->CircleButton->text().toStdString();
output_string = "circle";
lines.push_back(output_string + " = " + input_string);
if (input_string != "unmapped")
inputs.push_back(input_string);
input_string = ui->TriangleButton->text().toStdString();
output_string = "triangle";
lines.push_back(output_string + " = " + input_string);
if (input_string != "unmapped")
inputs.push_back(input_string);
input_string = ui->SquareButton->text().toStdString();
output_string = "square";
lines.push_back(output_string + " = " + input_string);
if (input_string != "unmapped")
inputs.push_back(input_string);
add_mapping(ui->CrossButton->text(), "cross");
add_mapping(ui->CircleButton->text(), "circle");
add_mapping(ui->TriangleButton->text(), "triangle");
add_mapping(ui->SquareButton->text(), "square");
lines.push_back("");
input_string = ui->DpadUpButton->text().toStdString();
output_string = "pad_up";
lines.push_back(output_string + " = " + input_string);
if (input_string != "unmapped")
inputs.push_back(input_string);
input_string = ui->DpadDownButton->text().toStdString();
output_string = "pad_down";
lines.push_back(output_string + " = " + input_string);
if (input_string != "unmapped")
inputs.push_back(input_string);
input_string = ui->DpadLeftButton->text().toStdString();
output_string = "pad_left";
lines.push_back(output_string + " = " + input_string);
if (input_string != "unmapped")
inputs.push_back(input_string);
input_string = ui->DpadRightButton->text().toStdString();
output_string = "pad_right";
lines.push_back(output_string + " = " + input_string);
if (input_string != "unmapped")
inputs.push_back(input_string);
add_mapping(ui->DpadUpButton->text(), "pad_up");
add_mapping(ui->DpadDownButton->text(), "pad_down");
add_mapping(ui->DpadLeftButton->text(), "pad_left");
add_mapping(ui->DpadRightButton->text(), "pad_right");
lines.push_back("");
input_string = ui->L1Button->text().toStdString();
output_string = "l1";
lines.push_back(output_string + " = " + input_string);
if (input_string != "unmapped")
inputs.push_back(input_string);
input_string = ui->R1Button->text().toStdString();
output_string = "r1";
lines.push_back(output_string + " = " + input_string);
if (input_string != "unmapped")
inputs.push_back(input_string);
input_string = ui->L2Button->text().toStdString();
output_string = "l2";
lines.push_back(output_string + " = " + input_string);
if (input_string != "unmapped")
inputs.push_back(input_string);
input_string = ui->R2Button->text().toStdString();
output_string = "r2";
lines.push_back(output_string + " = " + input_string);
if (input_string != "unmapped")
inputs.push_back(input_string);
input_string = ui->L3Button->text().toStdString();
output_string = "l3";
lines.push_back(output_string + " = " + input_string);
if (input_string != "unmapped")
inputs.push_back(input_string);
input_string = ui->R3Button->text().toStdString();
output_string = "r3";
lines.push_back(output_string + " = " + input_string);
if (input_string != "unmapped")
inputs.push_back(input_string);
add_mapping(ui->L1Button->text(), "l1");
add_mapping(ui->R1Button->text(), "r1");
add_mapping(ui->L2Button->text(), "l2");
add_mapping(ui->R2Button->text(), "r2");
add_mapping(ui->L3Button->text(), "l3");
add_mapping(ui->R3Button->text(), "r3");
lines.push_back("");
input_string = ui->OptionsButton->text().toStdString();
output_string = "options";
lines.push_back(output_string + " = " + input_string);
if (input_string != "unmapped")
inputs.push_back(input_string);
input_string = ui->TouchpadButton->text().toStdString();
output_string = "touchpad";
lines.push_back(output_string + " = " + input_string);
if (input_string != "unmapped")
inputs.push_back(input_string);
add_mapping(ui->TouchpadLeftButton->text(), "touchpad_left");
add_mapping(ui->TouchpadCenterButton->text(), "touchpad_center");
add_mapping(ui->TouchpadRightButton->text(), "touchpad_right");
add_mapping(ui->OptionsButton->text(), "options");
lines.push_back("");
input_string = ui->LStickUpButton->text().toStdString();
output_string = "axis_left_y_minus";
lines.push_back(output_string + " = " + input_string);
if (input_string != "unmapped")
inputs.push_back(input_string);
input_string = ui->LStickDownButton->text().toStdString();
output_string = "axis_left_y_plus";
lines.push_back(output_string + " = " + input_string);
if (input_string != "unmapped")
inputs.push_back(input_string);
input_string = ui->LStickLeftButton->text().toStdString();
output_string = "axis_left_x_minus";
lines.push_back(output_string + " = " + input_string);
if (input_string != "unmapped")
inputs.push_back(input_string);
input_string = ui->LStickRightButton->text().toStdString();
output_string = "axis_left_x_plus";
lines.push_back(output_string + " = " + input_string);
if (input_string != "unmapped")
inputs.push_back(input_string);
add_mapping(ui->LStickUpButton->text(), "axis_left_y_minus");
add_mapping(ui->LStickDownButton->text(), "axis_left_y_plus");
add_mapping(ui->LStickLeftButton->text(), "axis_left_x_minus");
add_mapping(ui->LStickRightButton->text(), "axis_left_x_plus");
lines.push_back("");
input_string = ui->RStickUpButton->text().toStdString();
output_string = "axis_right_y_minus";
lines.push_back(output_string + " = " + input_string);
if (input_string != "unmapped")
inputs.push_back(input_string);
input_string = ui->RStickDownButton->text().toStdString();
output_string = "axis_right_y_plus";
lines.push_back(output_string + " = " + input_string);
if (input_string != "unmapped")
inputs.push_back(input_string);
input_string = ui->RStickLeftButton->text().toStdString();
output_string = "axis_right_x_minus";
lines.push_back(output_string + " = " + input_string);
if (input_string != "unmapped")
inputs.push_back(input_string);
input_string = ui->RStickRightButton->text().toStdString();
output_string = "axis_right_x_plus";
lines.push_back(output_string + " = " + input_string);
if (input_string != "unmapped")
inputs.push_back(input_string);
add_mapping(ui->RStickUpButton->text(), "axis_right_y_minus");
add_mapping(ui->RStickDownButton->text(), "axis_right_y_plus");
add_mapping(ui->RStickLeftButton->text(), "axis_right_x_minus");
add_mapping(ui->RStickRightButton->text(), "axis_right_x_plus");
lines.push_back("");
input_string = ui->MouseJoystickBox->currentText().toStdString();
output_string = "mouse_to_joystick";
if (input_string != "unmapped")
lines.push_back(output_string + " = " + input_string);
input_string = ui->LHalfButton->text().toStdString();
output_string = "leftjoystick_halfmode";
lines.push_back(output_string + " = " + input_string);
if (input_string != "unmapped")
inputs.push_back(input_string);
input_string = ui->RHalfButton->text().toStdString();
output_string = "rightjoystick_halfmode";
lines.push_back(output_string + " = " + input_string);
if (input_string != "unmapped")
inputs.push_back(input_string);
add_mapping(ui->MouseJoystickBox->currentText(), "mouse_to_joystick");
add_mapping(ui->LHalfButton->text(), "leftjoystick_halfmode");
add_mapping(ui->RHalfButton->text(), "rightjoystick_halfmode");
std::string DOString = std::format("{:.2f}", (ui->DeadzoneOffsetSlider->value() / 100.f));
std::string SMString = std::format("{:.1f}", (ui->SpeedMultiplierSlider->value() / 10.f));
@ -372,14 +278,32 @@ void KBMSettings::SaveKBMConfig(bool CloseOnSave) {
file.close();
// Prevent duplicate inputs for KBM as this breaks the engine
bool duplicateFound = false;
QSet<QString> duplicateMappings;
for (auto it = inputs.begin(); it != inputs.end(); ++it) {
if (std::find(it + 1, inputs.end(), *it) != inputs.end()) {
QMessageBox::information(this, tr("Unable to Save"),
tr("Cannot bind any unique input more than once"));
return;
duplicateFound = true;
duplicateMappings.insert(QString::fromStdString(*it));
}
}
if (duplicateFound) {
QStringList duplicatesList;
for (const QString mapping : duplicateMappings) {
for (const auto& button : ButtonsList) {
if (button->text() == mapping)
duplicatesList.append(button->objectName() + " - " + mapping);
}
}
QMessageBox::information(
this, tr("Unable to Save"),
// clang-format off
QString(tr("Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons:\n\n%1").arg(duplicatesList.join("\n"))));
// clang-format on
return;
}
std::vector<std::string> save;
bool CurrentLineEmpty = false, LastLineEmpty = false;
for (auto const& line : lines) {
@ -398,7 +322,7 @@ void KBMSettings::SaveKBMConfig(bool CloseOnSave) {
Config::SetUseUnifiedInputConfig(!ui->PerGameCheckBox->isChecked());
Config::save(Common::FS::GetUserPath(Common::FS::PathType::UserDir) / "config.toml");
if (CloseOnSave)
if (close_on_save)
QWidget::close();
}
@ -415,7 +339,9 @@ void KBMSettings::SetDefault() {
ui->R2Button->setText("o");
ui->R3Button->setText("m");
ui->TouchpadButton->setText("space");
ui->TouchpadLeftButton->setText("space");
ui->TouchpadCenterButton->setText("unmapped");
ui->TouchpadRightButton->setText("unmapped");
ui->OptionsButton->setText("enter");
ui->DpadUpButton->setText("up");
@ -464,7 +390,6 @@ void KBMSettings::SetUIValuestoMappings(std::string config_id) {
if (std::find(ControllerInputs.begin(), ControllerInputs.end(), input_string) ==
ControllerInputs.end()) {
if (output_string == "cross") {
ui->CrossButton->setText(QString::fromStdString(input_string));
} else if (output_string == "circle") {
@ -495,8 +420,12 @@ void KBMSettings::SetUIValuestoMappings(std::string config_id) {
ui->DpadRightButton->setText(QString::fromStdString(input_string));
} else if (output_string == "options") {
ui->OptionsButton->setText(QString::fromStdString(input_string));
} else if (output_string == "touchpad") {
ui->TouchpadButton->setText(QString::fromStdString(input_string));
} else if (output_string == "touchpad_left") {
ui->TouchpadLeftButton->setText(QString::fromStdString(input_string));
} else if (output_string == "touchpad_center") {
ui->TouchpadCenterButton->setText(QString::fromStdString(input_string));
} else if (output_string == "touchpad_right") {
ui->TouchpadRightButton->setText(QString::fromStdString(input_string));
} else if (output_string == "axis_left_x_minus") {
ui->LStickLeftButton->setText(QString::fromStdString(input_string));
} else if (output_string == "axis_left_x_plus") {
@ -524,7 +453,7 @@ void KBMSettings::SetUIValuestoMappings(std::string config_id) {
if (comma_pos != std::string::npos) {
std::string DOstring = line.substr(equal_pos + 1, comma_pos);
float DOffsetValue = std::stof(DOstring) * 100.0;
int DOffsetInt = int(DOffsetValue);
int DOffsetInt = static_cast<int>(DOffsetValue);
ui->DeadzoneOffsetSlider->setValue(DOffsetInt);
QString LabelValue = QString::number(DOffsetInt / 100.0, 'f', 2);
QString LabelString = tr("Deadzone Offset (def 0.50):") + " " + LabelValue;
@ -534,12 +463,8 @@ void KBMSettings::SetUIValuestoMappings(std::string config_id) {
std::size_t comma_pos2 = SMSOstring.find(',');
if (comma_pos2 != std::string::npos) {
std::string SMstring = SMSOstring.substr(0, comma_pos2);
float SpeedMultValue = std::stof(SMstring) * 10.0;
int SpeedMultInt = int(SpeedMultValue);
if (SpeedMultInt < 1)
SpeedMultInt = 1;
if (SpeedMultInt > 50)
SpeedMultInt = 50;
float SpeedMultValue = std::clamp(std::stof(SMstring) * 10.0f, 1.0f, 50.0f);
int SpeedMultInt = static_cast<int>(SpeedMultValue);
ui->SpeedMultiplierSlider->setValue(SpeedMultInt);
LabelValue = QString::number(SpeedMultInt / 10.0, 'f', 1);
LabelString = tr("Speed Multiplier (def 1.0):") + " " + LabelValue;
@ -547,7 +472,7 @@ void KBMSettings::SetUIValuestoMappings(std::string config_id) {
std::string SOstring = SMSOstring.substr(comma_pos2 + 1);
float SOffsetValue = std::stof(SOstring) * 1000.0;
int SOffsetInt = int(SOffsetValue);
int SOffsetInt = static_cast<int>(SOffsetValue);
ui->SpeedOffsetSlider->setValue(SOffsetInt);
LabelValue = QString::number(SOffsetInt / 1000.0, 'f', 3);
LabelString = tr("Speed Offset (def 0.125):") + " " + LabelValue;
@ -645,6 +570,16 @@ void KBMSettings::SetMapping(QString input) {
MappingCompleted = true;
}
// Helper lambda to get the modified button text based on the current keyboard modifiers
auto GetModifiedButton = [](Qt::KeyboardModifiers modifier, const std::string& m_button,
const std::string& n_button) -> QString {
if (QApplication::keyboardModifiers() & modifier) {
return QString::fromStdString(m_button);
} else {
return QString::fromStdString(n_button);
}
};
bool KBMSettings::eventFilter(QObject* obj, QEvent* event) {
if (event->type() == QEvent::Close) {
if (HelpWindowOpen) {
@ -665,213 +600,7 @@ bool KBMSettings::eventFilter(QObject* obj, QEvent* event) {
}
switch (keyEvent->key()) {
case Qt::Key_Space:
pressedKeys.insert("space");
break;
case Qt::Key_Comma:
if (Qt::KeypadModifier & QApplication::keyboardModifiers()) {
pressedKeys.insert("kpcomma");
} else {
pressedKeys.insert("comma");
}
break;
case Qt::Key_Period:
if (Qt::KeypadModifier & QApplication::keyboardModifiers()) {
pressedKeys.insert("kpperiod");
} else {
pressedKeys.insert("period");
}
break;
case Qt::Key_Slash:
if (Qt::KeypadModifier & QApplication::keyboardModifiers())
pressedKeys.insert("kpdivide");
break;
case Qt::Key_Asterisk:
if (Qt::KeypadModifier & QApplication::keyboardModifiers())
pressedKeys.insert("kpmultiply");
break;
case Qt::Key_Question:
pressedKeys.insert("question");
break;
case Qt::Key_Semicolon:
pressedKeys.insert("semicolon");
break;
case Qt::Key_Minus:
if (Qt::KeypadModifier & QApplication::keyboardModifiers()) {
pressedKeys.insert("kpminus");
} else {
pressedKeys.insert("minus");
}
break;
case Qt::Key_Plus:
if (Qt::KeypadModifier & QApplication::keyboardModifiers()) {
pressedKeys.insert("kpplus");
} else {
pressedKeys.insert("plus");
}
break;
case Qt::Key_ParenLeft:
pressedKeys.insert("lparenthesis");
break;
case Qt::Key_ParenRight:
pressedKeys.insert("rparenthesis");
break;
case Qt::Key_BracketLeft:
pressedKeys.insert("lbracket");
break;
case Qt::Key_BracketRight:
pressedKeys.insert("rbracket");
break;
case Qt::Key_BraceLeft:
pressedKeys.insert("lbrace");
break;
case Qt::Key_BraceRight:
pressedKeys.insert("rbrace");
break;
case Qt::Key_Backslash:
pressedKeys.insert("backslash");
break;
case Qt::Key_Tab:
pressedKeys.insert("tab");
break;
case Qt::Key_Backspace:
pressedKeys.insert("backspace");
break;
case Qt::Key_Return:
pressedKeys.insert("enter");
break;
case Qt::Key_Enter:
pressedKeys.insert("kpenter");
break;
case Qt::Key_Home:
pressedKeys.insert("home");
break;
case Qt::Key_End:
pressedKeys.insert("end");
break;
case Qt::Key_PageDown:
pressedKeys.insert("pgdown");
break;
case Qt::Key_PageUp:
pressedKeys.insert("pgup");
break;
case Qt::Key_CapsLock:
pressedKeys.insert("capslock");
break;
case Qt::Key_Escape:
pressedKeys.insert("unmapped");
break;
case Qt::Key_Shift:
if (keyEvent->nativeScanCode() == rshift) {
pressedKeys.insert("rshift");
} else {
pressedKeys.insert("lshift");
}
break;
case Qt::Key_Alt:
if (keyEvent->nativeScanCode() == ralt) {
pressedKeys.insert("ralt");
} else {
pressedKeys.insert("lalt");
}
break;
case Qt::Key_Control:
if (keyEvent->nativeScanCode() == rctrl) {
pressedKeys.insert("rctrl");
} else {
pressedKeys.insert("lctrl");
}
break;
case Qt::Key_Meta:
activateWindow();
#ifdef _WIN32
pressedKeys.insert("lwin");
#else
pressedKeys.insert("lmeta");
#endif
case Qt::Key_1:
if (Qt::KeypadModifier & QApplication::keyboardModifiers()) {
pressedKeys.insert("kp1");
} else {
pressedKeys.insert("1");
}
break;
case Qt::Key_2:
if (Qt::KeypadModifier & QApplication::keyboardModifiers()) {
pressedKeys.insert("kp2");
} else {
pressedKeys.insert("2");
}
break;
case Qt::Key_3:
if (Qt::KeypadModifier & QApplication::keyboardModifiers()) {
pressedKeys.insert("kp3");
} else {
pressedKeys.insert("3");
}
break;
case Qt::Key_4:
if (Qt::KeypadModifier & QApplication::keyboardModifiers()) {
pressedKeys.insert("kp4");
} else {
pressedKeys.insert("4");
}
break;
case Qt::Key_5:
if (Qt::KeypadModifier & QApplication::keyboardModifiers()) {
pressedKeys.insert("kp5");
} else {
pressedKeys.insert("5");
}
break;
case Qt::Key_6:
if (Qt::KeypadModifier & QApplication::keyboardModifiers()) {
pressedKeys.insert("kp6");
} else {
pressedKeys.insert("6");
}
break;
case Qt::Key_7:
if (Qt::KeypadModifier & QApplication::keyboardModifiers()) {
pressedKeys.insert("kp7");
} else {
pressedKeys.insert("7");
}
break;
case Qt::Key_8:
if (Qt::KeypadModifier & QApplication::keyboardModifiers()) {
pressedKeys.insert("kp8");
} else {
pressedKeys.insert("8");
}
break;
case Qt::Key_9:
if (Qt::KeypadModifier & QApplication::keyboardModifiers()) {
pressedKeys.insert("kp9");
} else {
pressedKeys.insert("9");
}
break;
case Qt::Key_0:
if (Qt::KeypadModifier & QApplication::keyboardModifiers()) {
pressedKeys.insert("kp0");
} else {
pressedKeys.insert("0");
}
break;
case Qt::Key_Up:
activateWindow();
pressedKeys.insert("up");
break;
case Qt::Key_Down:
pressedKeys.insert("down");
break;
case Qt::Key_Left:
pressedKeys.insert("left");
break;
case Qt::Key_Right:
pressedKeys.insert("right");
break;
// alphanumeric
case Qt::Key_A:
pressedKeys.insert("a");
break;
@ -945,13 +674,232 @@ bool KBMSettings::eventFilter(QObject* obj, QEvent* event) {
pressedKeys.insert("x");
break;
case Qt::Key_Y:
pressedKeys.insert("Y");
pressedKeys.insert("y");
break;
case Qt::Key_Z:
pressedKeys.insert("z");
break;
case Qt::Key_0:
pressedKeys.insert(GetModifiedButton(Qt::KeypadModifier, "kp0", "0"));
break;
case Qt::Key_1:
pressedKeys.insert(GetModifiedButton(Qt::KeypadModifier, "kp1", "1"));
break;
case Qt::Key_2:
pressedKeys.insert(GetModifiedButton(Qt::KeypadModifier, "kp2", "2"));
break;
case Qt::Key_3:
pressedKeys.insert(GetModifiedButton(Qt::KeypadModifier, "kp3", "3"));
break;
case Qt::Key_4:
pressedKeys.insert(GetModifiedButton(Qt::KeypadModifier, "kp4", "4"));
break;
case Qt::Key_5:
pressedKeys.insert(GetModifiedButton(Qt::KeypadModifier, "kp5", "5"));
break;
case Qt::Key_6:
pressedKeys.insert(GetModifiedButton(Qt::KeypadModifier, "kp6", "6"));
break;
case Qt::Key_7:
pressedKeys.insert(GetModifiedButton(Qt::KeypadModifier, "kp7", "7"));
break;
case Qt::Key_8:
pressedKeys.insert(GetModifiedButton(Qt::KeypadModifier, "kp8", "8"));
break;
case Qt::Key_9:
pressedKeys.insert(GetModifiedButton(Qt::KeypadModifier, "kp9", "9"));
break;
// symbols
case Qt::Key_Exclam:
pressedKeys.insert("!");
break;
case Qt::Key_At:
pressedKeys.insert("@");
break;
case Qt::Key_NumberSign:
pressedKeys.insert("#");
break;
case Qt::Key_Dollar:
pressedKeys.insert("$");
break;
case Qt::Key_Percent:
pressedKeys.insert("%");
break;
case Qt::Key_AsciiCircum:
pressedKeys.insert("^");
break;
case Qt::Key_Ampersand:
pressedKeys.insert("&");
break;
case Qt::Key_Asterisk:
pressedKeys.insert(GetModifiedButton(Qt::KeypadModifier, "kp*", "*"));
break;
case Qt::Key_ParenLeft:
pressedKeys.insert("(");
break;
case Qt::Key_ParenRight:
pressedKeys.insert(")");
break;
case Qt::Key_Minus:
pressedKeys.insert(GetModifiedButton(Qt::KeypadModifier, "kp-", "-"));
break;
case Qt::Key_Underscore:
pressedKeys.insert("_");
break;
case Qt::Key_Equal:
pressedKeys.insert(GetModifiedButton(Qt::KeypadModifier, "kp=", "="));
break;
case Qt::Key_Plus:
pressedKeys.insert(GetModifiedButton(Qt::KeypadModifier, "kp+", "+"));
break;
case Qt::Key_BracketLeft:
pressedKeys.insert("[");
break;
case Qt::Key_BracketRight:
pressedKeys.insert("]");
break;
case Qt::Key_BraceLeft:
pressedKeys.insert("{");
break;
case Qt::Key_BraceRight:
pressedKeys.insert("}");
break;
case Qt::Key_Backslash:
pressedKeys.insert("\\");
break;
case Qt::Key_Bar:
pressedKeys.insert("|");
break;
case Qt::Key_Semicolon:
pressedKeys.insert(";");
break;
case Qt::Key_Colon:
pressedKeys.insert(":");
break;
case Qt::Key_Apostrophe:
pressedKeys.insert("'");
break;
case Qt::Key_QuoteDbl:
pressedKeys.insert("\"");
break;
case Qt::Key_Comma:
pressedKeys.insert(GetModifiedButton(Qt::KeypadModifier, "kp,", ","));
break;
case Qt::Key_Less:
pressedKeys.insert("<");
break;
case Qt::Key_Period:
pressedKeys.insert(GetModifiedButton(Qt::KeypadModifier, "kp.", "."));
break;
case Qt::Key_Greater:
pressedKeys.insert(">");
break;
case Qt::Key_Slash:
pressedKeys.insert(GetModifiedButton(Qt::KeypadModifier, "kp/", "/"));
break;
case Qt::Key_Question:
pressedKeys.insert("question");
break;
// special keys
case Qt::Key_Print:
pressedKeys.insert("printscreen");
break;
case Qt::Key_ScrollLock:
pressedKeys.insert("scrolllock");
break;
case Qt::Key_Pause:
pressedKeys.insert("pausebreak");
break;
case Qt::Key_Backspace:
pressedKeys.insert("backspace");
break;
case Qt::Key_Insert:
pressedKeys.insert("insert");
break;
case Qt::Key_Delete:
pressedKeys.insert("delete");
break;
case Qt::Key_Home:
pressedKeys.insert("home");
break;
case Qt::Key_End:
pressedKeys.insert("end");
break;
case Qt::Key_PageUp:
pressedKeys.insert("pgup");
break;
case Qt::Key_PageDown:
pressedKeys.insert("pgdown");
break;
case Qt::Key_Tab:
pressedKeys.insert("tab");
break;
case Qt::Key_CapsLock:
pressedKeys.insert("capslock");
break;
case Qt::Key_Return:
pressedKeys.insert("enter");
break;
case Qt::Key_Enter:
pressedKeys.insert(GetModifiedButton(Qt::ShiftModifier, "kpenter", "enter"));
break;
case Qt::Key_Shift:
if (keyEvent->nativeScanCode() == LSHIFT_KEY) {
pressedKeys.insert("lshift");
} else {
pressedKeys.insert("rshift");
}
break;
case Qt::Key_Alt:
if (keyEvent->nativeScanCode() == LALT_KEY) {
pressedKeys.insert("lalt");
} else {
pressedKeys.insert("ralt");
}
break;
case Qt::Key_Control:
if (keyEvent->nativeScanCode() == LCTRL_KEY) {
pressedKeys.insert("lctrl");
} else {
pressedKeys.insert("rctrl");
}
break;
case Qt::Key_Meta:
activateWindow();
#ifdef _WIN32
pressedKeys.insert("lwin");
#else
pressedKeys.insert("lmeta");
#endif
break;
case Qt::Key_Space:
pressedKeys.insert("space");
break;
case Qt::Key_Up:
activateWindow();
pressedKeys.insert("up");
break;
case Qt::Key_Down:
pressedKeys.insert("down");
break;
case Qt::Key_Left:
pressedKeys.insert("left");
break;
case Qt::Key_Right:
pressedKeys.insert("right");
break;
// cancel mapping
case Qt::Key_Escape:
pressedKeys.insert("unmapped");
break;
// default case
default:
break;
// bottom text
}
return true;
}
@ -970,8 +918,17 @@ bool KBMSettings::eventFilter(QObject* obj, QEvent* event) {
case Qt::MiddleButton:
pressedKeys.insert("middlebutton");
break;
case Qt::XButton1:
pressedKeys.insert("sidebuttonback");
break;
case Qt::XButton2:
pressedKeys.insert("sidebuttonforward");
break;
// default case
default:
break;
// bottom text
}
return true;
}
@ -1002,22 +959,16 @@ bool KBMSettings::eventFilter(QObject* obj, QEvent* event) {
if (wheelEvent->angleDelta().x() > 5) {
if (std::find(AxisList.begin(), AxisList.end(), MappingButton) == AxisList.end()) {
// QT changes scrolling to horizontal for all widgets with the alt modifier
if (Qt::AltModifier & QApplication::keyboardModifiers()) {
pressedKeys.insert("mousewheelup");
} else {
pressedKeys.insert("mousewheelright");
}
pressedKeys.insert(
GetModifiedButton(Qt::AltModifier, "mousewheelup", "mousewheelright"));
} else {
QMessageBox::information(this, tr("Cannot set mapping"),
tr("Mousewheel cannot be mapped to stick outputs"));
}
} else if (wheelEvent->angleDelta().x() < -5) {
if (std::find(AxisList.begin(), AxisList.end(), MappingButton) == AxisList.end()) {
if (Qt::AltModifier & QApplication::keyboardModifiers()) {
pressedKeys.insert("mousewheeldown");
} else {
pressedKeys.insert("mousewheelleft");
}
pressedKeys.insert(
GetModifiedButton(Qt::AltModifier, "mousewheeldown", "mousewheelleft"));
} else {
QMessageBox::information(this, tr("Cannot set mapping"),
tr("Mousewheel cannot be mapped to stick outputs"));

View file

@ -4,6 +4,18 @@
#include <QDialog>
#include "game_info.h"
// macros > declaring constants
// also, we were only using one counterpart
#ifdef _WIN32
#define LCTRL_KEY 29
#define LALT_KEY 56
#define LSHIFT_KEY 42
#else
#define LCTRL_KEY 37
#define LALT_KEY 64
#define LSHIFT_KEY 50
#endif
namespace Ui {
class KBMSettings;
}
@ -25,22 +37,6 @@ private:
std::unique_ptr<Ui::KBMSettings> ui;
std::shared_ptr<GameInfoClass> m_game_info;
#ifdef _WIN32
const int lctrl = 29;
const int rctrl = 57373;
const int lalt = 56;
const int ralt = 57400;
const int lshift = 42;
const int rshift = 54;
#else
const int lctrl = 37;
const int rctrl = 105;
const int lalt = 64;
const int ralt = 108;
const int lshift = 50;
const int rshift = 62;
#endif
bool eventFilter(QObject* obj, QEvent* event) override;
void ButtonConnects();
void SetUIValuestoMappings(std::string config_id);

View file

@ -11,8 +11,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>1234</width>
<height>796</height>
<width>1235</width>
<height>842</height>
</rect>
</property>
<property name="sizePolicy">
@ -44,8 +44,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>1214</width>
<height>746</height>
<width>1215</width>
<height>792</height>
</rect>
</property>
<widget class="QWidget" name="layoutWidget">
@ -54,7 +54,7 @@
<x>0</x>
<y>0</y>
<width>1211</width>
<height>741</height>
<height>791</height>
</rect>
</property>
<layout class="QHBoxLayout" name="RemapLayout">
@ -793,7 +793,7 @@
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="layout_system_buttons" stretch="0">
<layout class="QVBoxLayout" name="layout_system_buttons" stretch="0,0">
<item>
<widget class="QGroupBox" name="groupBox_4">
<property name="sizePolicy">
@ -825,8 +825,11 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumHeight">
<number>48</number>
<property name="minimumSize">
<size>
<width>0</width>
<height>24</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::FocusPolicy::NoFocus</enum>
@ -844,8 +847,11 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumHeight">
<number>48</number>
<property name="minimumSize">
<size>
<width>0</width>
<height>24</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::FocusPolicy::NoFocus</enum>
@ -858,6 +864,55 @@
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="gb_options">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>160</width>
<height>0</height>
</size>
</property>
<property name="title">
<string>Options</string>
</property>
<layout class="QVBoxLayout" name="gb_start_layout">
<property name="leftMargin">
<number>5</number>
</property>
<property name="topMargin">
<number>5</number>
</property>
<property name="rightMargin">
<number>5</number>
</property>
<property name="bottomMargin">
<number>5</number>
</property>
<item>
<widget class="QPushButton" name="OptionsButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="focusPolicy">
<enum>Qt::FocusPolicy::NoFocus</enum>
</property>
<property name="text">
<string>unmapped</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item>
@ -1067,34 +1122,13 @@
</widget>
</item>
<item>
<widget class="QGroupBox" name="gb_touchpad">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>160</width>
<height>0</height>
</size>
</property>
<widget class="QGroupBox" name="gb_touchpadleft">
<property name="title">
<string>Touchpad Click</string>
<string>Touchpad Left</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_9">
<layout class="QVBoxLayout" name="verticalLayout_17">
<item>
<widget class="QPushButton" name="TouchpadButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="focusPolicy">
<enum>Qt::FocusPolicy::NoFocus</enum>
</property>
<widget class="QPushButton" name="TouchpadLeftButton">
<property name="text">
<string>unmapped</string>
</property>
@ -1150,6 +1184,22 @@
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="gb_touchpadcenter">
<property name="title">
<string>Touchpad Center</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_11">
<item>
<widget class="QPushButton" name="TouchpadCenterButton">
<property name="text">
<string>unmapped</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item>
@ -1204,7 +1254,7 @@
</widget>
</item>
<item>
<widget class="QGroupBox" name="gb_options">
<widget class="QGroupBox" name="gb_touchpadright">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
@ -1218,23 +1268,11 @@
</size>
</property>
<property name="title">
<string>Options</string>
</property>
<layout class="QVBoxLayout" name="gb_start_layout">
<property name="leftMargin">
<number>5</number>
</property>
<property name="topMargin">
<number>5</number>
</property>
<property name="rightMargin">
<number>5</number>
</property>
<property name="bottomMargin">
<number>5</number>
<string>Touchpad Right</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_9">
<item>
<widget class="QPushButton" name="OptionsButton">
<widget class="QPushButton" name="TouchpadRightButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>

View file

@ -78,16 +78,16 @@ HelpDialog::HelpDialog(bool* open_flag, QWidget* parent) : QDialog(parent) {
// Add expandable sections to container layout
auto* quickstartSection = new ExpandableSection(tr("Quickstart"), quickstart());
auto* faqSection = new ExpandableSection(tr("FAQ"), faq());
auto* syntaxSection = new ExpandableSection(tr("Syntax"), syntax());
auto* specialSection = new ExpandableSection(tr("Special Bindings"), special());
auto* bindingsSection = new ExpandableSection(tr("Keybindings"), bindings());
auto* specialSection = new ExpandableSection(tr("Special Bindings"), special());
auto* faqSection = new ExpandableSection(tr("FAQ"), faq());
containerLayout->addWidget(quickstartSection);
containerLayout->addWidget(faqSection);
containerLayout->addWidget(syntaxSection);
containerLayout->addWidget(specialSection);
containerLayout->addWidget(bindingsSection);
containerLayout->addWidget(specialSection);
containerLayout->addWidget(faqSection);
containerLayout->addStretch(1);
// Scroll area wrapping the container
@ -110,3 +110,160 @@ HelpDialog::HelpDialog(bool* open_flag, QWidget* parent) : QDialog(parent) {
connect(specialSection, &ExpandableSection::expandedChanged, this, &HelpDialog::adjustSize);
connect(bindingsSection, &ExpandableSection::expandedChanged, this, &HelpDialog::adjustSize);
}
// Helper functions that store the text contents for each tab inb the HelpDialog menu
QString HelpDialog::quickstart() {
return R"(
The keyboard and controller remapping backend, GUI, and documentation have been written by kalaposfos.
In this section, you will find information about the project and its features, as well as help setting up your ideal setup.
To view the config file's syntax, check out the Syntax tab, for keybind names, visit Normal Keybinds and Special Bindings, and if you are here to view emulator-wide keybinds, you can find it in the FAQ section.
This project began because I disliked the original, unchangeable keybinds. Rather than waiting for someone else to do it, I implemented this myself. From the default keybinds, you can clearly tell this was a project built for Bloodborne, but obviously, you can make adjustments however you like.)";
}
QString HelpDialog::faq() {
return R"(
Q: What are the emulator-wide keybinds?
A:
-F12: Triggers Renderdoc capture
-F11: Toggles fullscreen
-F10: Toggles FPS counter
-Ctrl+F10: Open the debug menu
-F9: Pauses the emulator if the debug menu is open
-F8: Reparses the config file while in-game
-F7: Toggles mouse capture and mouse input
-F6: Toggles mouse-to-gyro emulation
Q: How do I switch between mouse and controller joystick input? Why is it even required?
A: Pressing F7 toggles between mouse and controller joystick input. It is required because the program polls the mouse input, which means it checks mouse movement every frame. If it didn't move, the code would manually set the emulator's virtual controller to 0 (to the center), even if other input devices would update it.
Q: What happens if I accidentally make a typo in the config?
A: The code recognises the line as wrong and skips it, so the rest of the file will get parsed, but that line in question will be treated like a comment line. You can find these lines in the log if you search for 'input_handler'.
Q: I want to bind <input> to <output>, but your code doesn't support <input>!
A: Some keys are intentionally omitted, but if you read the bindings through, and you're sure it is not there and isn't one of the intentionally disabled ones, open an issue on https://github.com/shadps4-emu/shadPS4.
Q: What does default.ini do?
A: If you're using per-game configs, it's the base from which all new games generate their config file. If you use the unified config, then default.ini is used for every game directly instead.
Q: What does the use Per-game Config checkbox do?
A: It controls whether the config is loaded from CUSAXXXXX.ini for a game or from default.ini. This way, if you only want to manage one set of bindings, you can do so, but if you want to use a different setup for every game, that's possible as well.)";
}
QString HelpDialog::syntax() {
return R"(
Below is the file format for mouse, keyboard, and controller inputs:
Rules:
- You can bind up to 3 inputs to one button.
- Adding '#' at the beginning of a line creates a comment.
- Extra whitespace doesn't affect input.
<output>=<input>; is just as valid as <output> = <input>;
- ';' at the end of a line is also optional.
Syntax (aka how a line can look like):
#Comment line
<controller_button> = <input>, <input>, <input>;
<controller_button> = <input>, <input>;
<controller_button> = <input>;
Examples:
#Interact
cross = e;
#Heavy attack (in BB)
r2 = leftbutton, lshift;
#Move forward
axis_left_y_minus = w;)";
}
QString HelpDialog::bindings() {
return R"(
The following names should be interpreted without the '' around them. For inputs that have left and right versions, only the left one is shown, but the right version also works.
(Example: 'lshift', 'rshift')
Keyboard:
Alphabet:
'a', 'b', ..., 'z'
Numbers:
'0', '1', ..., '9'
Keypad:
'kp 0', 'kp 1', ..., 'kp 9',
'kp .', 'kp ,', 'kp /', 'kp *', 'kp -', 'kp +', 'kp =', 'kp enter'
Symbols:
'`', '~', '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '-', '_', '=', '+', '{', '}', '[', ']', '\', '|',
';', ':', ''', '"', ',', '<', '.', '>', '/', '?'
Special keys:
'escape (text editor only)', 'printscreen', 'scrolllock', 'pausebreak',
'backspace', 'insert', 'delete', 'home', 'end', 'pgup', 'pgdown', 'tab',
'capslock', 'enter', 'space'
Arrow keys:
'up', 'down', 'left', 'right'
Modifier keys:
'lctrl', 'lshift', 'lalt', 'lwin' = 'lmeta' (same input, different names, so if you are not on Windows and don't like calling this the Windows key, there is an alternative)
Mouse:
'leftbutton', 'rightbutton', 'middlebutton', 'sidebuttonforward',
'sidebuttonback'
The following wheel inputs cannot be bound to axis input, only button:
'mousewheelup', 'mousewheeldown', 'mousewheelleft',
'mousewheelright'
Controller:
The touchpad currently can't be rebound to anything else, but you can bind buttons to it.
If you have a controller that has different names for buttons, it will still work. Just look up the equivalent names for that controller.
The same left-right rule still applies here.
Buttons:
'triangle', 'circle', 'cross', 'square', 'l1', 'l3',
'options', touchpad', 'up', 'down', 'left', 'right'
Input-only:
'lpaddle_low', 'lpaddle_high'
Output-only:
'touchpad_left', 'touchpad_center', 'touchpad_right'
Axes if you bind them to a button input:
'axis_left_x_plus', 'axis_left_x_minus', 'axis_left_y_plus', 'axis_left_y_minus',
'axis_right_x_plus', ..., 'axis_right_y_minus',
'l2'
Axes if you bind them to another axis input:
'axis_left_x', 'axis_left_y', 'axis_right_x', 'axis_right_y',
'l2'
Invalid Inputs:
'F1-F12' are reserved for emulator-wide keybinds, and cannot be bound to controller inputs.)";
}
QString HelpDialog::special() {
return R"(
There are some extra bindings you can put in the config file that don't correspond to a controller input but something else.
You can find these here, with detailed comments, examples, and suggestions for most of them.
'leftjoystick_halfmode' and 'rightjoystick_halfmode' = <key>;
These are a pair of input modifiers that change the way keyboard button-bound axes work. By default, those push the joystick to the max in their respective direction, but if their respective 'joystick_halfmode' modifier value is true, they only push it... halfway. With this, you can change from run to walk in games like Bloodborne.
'mouse_to_joystick' = 'none', 'left' or 'right';
This binds the mouse movement to either joystick. If it receives a value that is not 'left' or 'right', it defaults to 'none'.
'mouse_movement_params' = float, float, float;
(If you don't know what a float is, it is a data type that stores decimal numbers.)
Default values: 0.5, 1, 0.125
Let's break each parameter down:
1st: 'mouse_deadzone_offset' should have a value between 0 and 1 (it gets clamped to that range anyway), with 0 being no offset and 1 being pushing the joystick to the max in the direction the mouse moved.
This controls the minimum distance the joystick gets moved when moving the mouse. If set to 0, it will emulate raw mouse input, which doesn't work very well due to deadzones preventing input if the movement is not large enough.
2nd: 'mouse_speed' is just a standard multiplier to the mouse input speed.
If you input a negative number, the axis directions get reversed. Keep in mind that the offset can still push it back to positive if it's big enough.
3rd: 'mouse_speed_offset' should be in the 0 to 1 range, with 0 being no offset and 1 being offsetting to the max possible value.
Let's set 'mouse_deadzone_offset' to 0.5, and 'mouse_speed_offset' to 0: This means that if we move the mouse very slowly, it still inputs a half-strength joystick input, and if we increase the speed, it would stay that way until we move faster than half the max speed. If we instead set this to 0.25, we now only need to move the mouse faster than the 0.5-0.25=0.25=quarter of the max speed, to get an increase in joystick speed. If we set it to 0.5, then even moving the mouse at 1 pixel per frame will result in a faster-than-minimum speed.
'key_toggle' = <key>, <key_to_toggle>;
This assigns a key to another key, and if pressed, toggles that key's virtual value. If it's on, then it doesn't matter if the key is pressed or not, the input handler will treat it as if it's pressed.
Let's say we want to be able to toggle 'l1' with 't'. You can then bind 'l1' to a key you won't use, like 'kpenter'. Then bind 't' to toggle that. You will end up with this:
l1 = kpenter;
key_toggle = t, kpenter;
'analog_deadzone' = <device>, <value>, <value>;
This sets the deadzone range for various inputs. The first value is the minimum deadzone while the second is the maximum. Values go from 1 to 127 (no deadzone to max deadzone).
If you only want a minimum or maximum deadzone, set the other value to 1 or 127 respectively.
Valid devices: 'leftjoystick', 'rightjoystick', 'l2', 'r2'
'mouse_gyro_roll_mode':
Controls whether moving the mouse sideways causes a panning or a rolling motion while mouse-to-gyro emulation is active.)";
}

View file

@ -42,135 +42,9 @@ protected:
private:
bool* help_open_ptr;
QString quickstart() {
return
R"(The keyboard and controller remapping backend, GUI and documentation have been written by kalaposfos
In this section, you will find information about the project, its features and help on setting up your ideal setup.
To view the config file's syntax, check out the Syntax tab, for keybind names, visit Normal Keybinds and Special Bindings, and if you are here to view emulator-wide keybinds, you can find it in the FAQ section.
This project started out because I didn't like the original unchangeable keybinds, but rather than waiting for someone else to do it, I implemented this myself. From the default keybinds, you can clearly tell this was a project built for Bloodborne, but ovbiously you can make adjustments however you like.
)";
}
QString faq() {
return
R"(Q: What are the emulator-wide keybinds?
A: -F12: Triggers Renderdoc capture
-F11: Toggles fullscreen
-F10: Toggles FPS counter
-Ctrl F10: Open the debug menu
-F9: Pauses emultor, if the debug menu is open
-F8: Reparses the config file while in-game
-F7: Toggles mouse capture and mouse input
Q: How do I change between mouse and controller joystick input, and why is it even required?
A: You can switch between them with F7, and it is required, because mouse input is done with polling, which means mouse movement is checked every frame, and if it didn't move, the code manually sets the emulator's virtual controller to 0 (back to the center), even if other input devices would update it.
Q: What happens if I accidentally make a typo in the config?
A: The code recognises the line as wrong, and skip it, so the rest of the file will get parsed, but that line in question will be treated like a comment line. You can find these lines in the log, if you search for 'input_handler'.
Q: I want to bind <input> to <output>, but your code doesn't support <input>!
A: Some keys are intentionally omitted, but if you read the bindings through, and you're sure it is not there and isn't one of the intentionally disabled ones, open an issue on https://github.com/shadps4-emu/shadPS4.
Q: What does default.ini do?
A: If you're using per-game configs, it's the base from which all new games generate their config file. If you use the unified config, then this is used for every game directly instead.
Q: What does the use Per-game Config checkbox do?
A: It controls whether the config is loaded from CUSAXXXXX.ini for a game, or from default.ini. This way, if you only want to manage one set of bindings, you can do so, but if you want to use a different setup for every game, that's possible as well.
)";
}
QString syntax() {
return
R"(This is the full list of currently supported mouse, keyboard and controller inputs, and how to use them.
Emulator-reserved keys: F1 through F12
Syntax (aka how a line can look like):
#Comment line
<controller_button> = <input>, <input>, <input>;
<controller_button> = <input>, <input>;
<controller_button> = <input>;
Examples:
#Interact
cross = e;
#Heavy attack (in BB)
r2 = leftbutton, lshift;
#Move forward
axis_left_y_minus = w;
You can make a comment line by putting # as the first character.
Whitespace doesn't matter, <output>=<input>; is just as valid as <output> = <input>;
';' at the ends of lines is also optional.
)";
}
QString bindings() {
return
R"(The following names should be interpreted without the '' around them, and for inputs that have left and right versions, only the left one is shown, but the right can be inferred from that.
Example: 'lshift', 'rshift'
Keyboard:
Alphabet: 'a', 'b', ..., 'z'
Numbers: '0', '1', ..., '9'
Keypad: 'kp0', kp1', ..., 'kp9', 'kpperiod', 'kpcomma',
'kpdivide', 'kpmultiply', 'kpdivide', 'kpplus', 'kpminus', 'kpenter'
Punctuation and misc:
'space', 'comma', 'period', 'question', 'semicolon', 'minus', 'plus', 'lparenthesis', 'lbracket', 'lbrace', 'backslash', 'dash',
'enter', 'tab', backspace', 'escape'
Arrow keys: 'up', 'down', 'left', 'right'
Modifier keys:
'lctrl', 'lshift', 'lalt', 'lwin' = 'lmeta' (same input, different names, so if you are not on Windows and don't like calling this the Windows key, there is an alternative)
Mouse:
'leftbutton', 'rightbutton', 'middlebutton', 'sidebuttonforward', 'sidebuttonback'
The following wheel inputs cannot be bound to axis input, only button:
'mousewheelup', 'mousewheeldown', 'mousewheelleft', 'mousewheelright'
Controller:
The touchpad currently can't be rebound to anything else, but you can bind buttons to it.
If you have a controller that has different names for buttons, it will still work, just look up what are the equivalent names for that controller
The same left-right rule still applies here.
Buttons:
'triangle', 'circle', 'cross', 'square', 'l1', 'l3',
'options', touchpad', 'up', 'down', 'left', 'right'
Axes if you bind them to a button input:
'axis_left_x_plus', 'axis_left_x_minus', 'axis_left_y_plus', 'axis_left_y_minus',
'axis_right_x_plus', ..., 'axis_right_y_minus',
'l2'
Axes if you bind them to another axis input:
'axis_left_x' 'axis_left_y' 'axis_right_x' 'axis_right_y',
'l2'
)";
}
QString special() {
return
R"(There are some extra bindings you can put into the config file, that don't correspond to a controller input, but rather something else.
You can find these here, with detailed comments, examples and suggestions for most of them.
'leftjoystick_halfmode' and 'rightjoystick_halfmode' = <key>;
These are a pair of input modifiers, that change the way keyboard button bound axes work. By default, those push the joystick to the max in their respective direction, but if their respective joystick_halfmode modifier value is true, they only push it... halfway. With this, you can change from run to walk in games like Bloodborne.
'mouse_to_joystick' = 'none', 'left' or 'right';
This binds the mouse movement to either joystick. If it recieves a value that is not 'left' or 'right', it defaults to 'none'.
'mouse_movement_params' = float, float, float;
(If you don't know what a float is, it is a data type that stores non-whole numbers.)
Default values: 0.5, 1, 0.125
Let's break each parameter down:
1st: mouse_deadzone_offset: this value should have a value between 0 and 1 (It gets clamped to that range anyway), with 0 being no offset and 1 being pushing the joystick to the max in the direction the mouse moved.
This controls the minimum distance the joystick gets moved, when moving the mouse. If set to 0, it will emulate raw mouse input, which doesn't work very well due to deadzones preventing input if the movement is not large enough.
2nd: mouse_speed: It's just a standard multiplier to the mouse input speed.
If you input a negative number, the axis directions get reversed (Keep in mind that the offset can still push it back to positive, if it's big enough)
3rd: mouse_speed_offset: This also should be in the 0 to 1 range, with 0 being no offset and 1 being offsetting to the max possible value.
This is best explained through an example: Let's set mouse_deadzone to 0.5, and this to 0: This means that if we move the mousevery slowly, it still inputs a half-strength joystick input, and if we increase the speed, it would stay that way until we move faster than half the max speed. If we instead set this to 0.25, we now only need to move the mouse faster than the 0.5-0.25=0.25=quarter of the max speed, to get an increase in joystick speed. If we set it to 0.5, then even moving the mouse at 1 pixel per frame will result in a faster-than-minimum speed.
'key_toggle' = <key>, <key_to_toggle>;
This assigns a key to another key, and if pressed, toggles that key's virtual value. If it's on, then it doesn't matter if the key is pressed or not, the input handler will treat it as if it's pressed.
You can make an input toggleable with this, for example: Let's say we want to be able to toggle l1 with t. You can then bind l1 to a key you won't use, like kpenter, then bind t to toggle that, so you will end up with this:
l1 = kpenter;
key_toggle = t, kpenter;
'analog_deadzone' = <device>, <value>, <value>;
Values go from 1 to 127 (no deadzone to max deadzone), first is the inner, second is the outer deadzone
If you only want inner or outer deadzone, set the other to 1 or 127, respectively
Devices: leftjoystick, rightjoystick, l2, r2
)";
}
QString quickstart();
QString faq();
QString syntax();
QString bindings();
QString special();
};

View file

@ -41,7 +41,8 @@ int main(int argc, char* argv[]) {
std::unordered_map<std::string, std::function<void(int&)>> arg_map = {
{"-h",
[&](int&) {
std::cout << "Usage: shadps4 [options]\n"
std::cout
<< "Usage: shadps4 [options]\n"
"Options:\n"
" No arguments: Opens the GUI.\n"
" -g, --game <path|ID> Specify <eboot.bin or elf path> or "
@ -50,6 +51,7 @@ int main(int argc, char* argv[]) {
"Needs to be at the end of the line, and everything after \"--\" is a "
"game argument.\n"
" -p, --patch <patch_file> Apply specified patch file\n"
" -i, --ignore-game-patch Disable automatic loading of game patch\n"
" -s, --show-gui Show the GUI\n"
" -f, --fullscreen <true|false> Specify window initial fullscreen "
"state. Does not overwrite the config file.\n"
@ -84,6 +86,8 @@ int main(int argc, char* argv[]) {
}
}},
{"--patch", [&](int& i) { arg_map["-p"](i); }},
{"-i", [&](int&) { Core::FileSys::MntPoints::ignore_game_patches = true; }},
{"--ignore-game-patch", [&](int& i) { arg_map["-i"](i); }},
{"-f",
[&](int& i) {
if (++i >= argc) {

View file

@ -32,12 +32,13 @@ MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent), ui(new Ui::MainWi
ui->setupUi(this);
installEventFilter(this);
setAttribute(Qt::WA_DeleteOnClose);
m_gui_settings = std::make_shared<gui_settings>();
ui->toggleLabelsAct->setChecked(
m_gui_settings->GetValue(gui::mw_showLabelsUnderIcons).toBool());
}
MainWindow::~MainWindow() {
SaveWindowState();
const auto config_dir = Common::FS::GetUserPath(Common::FS::PathType::UserDir);
Config::saveMainWindow(config_dir / "config.toml");
}
bool MainWindow::Init() {
@ -139,7 +140,7 @@ void MainWindow::PauseGame() {
void MainWindow::toggleLabelsUnderIcons() {
bool showLabels = ui->toggleLabelsAct->isChecked();
Config::setShowLabelsUnderIcons();
m_gui_settings->SetValue(gui::mw_showLabelsUnderIcons, showLabels);
UpdateToolbarLabels();
if (isGameRunning) {
UpdateToolbarButtons();
@ -290,21 +291,21 @@ void MainWindow::CreateDockWindows() {
setCentralWidget(phCentralWidget);
m_dock_widget.reset(new QDockWidget(tr("Game List"), this));
m_game_list_frame.reset(new GameListFrame(m_game_info, m_compat_info, this));
m_game_list_frame.reset(new GameListFrame(m_gui_settings, m_game_info, m_compat_info, this));
m_game_list_frame->setObjectName("gamelist");
m_game_grid_frame.reset(new GameGridFrame(m_game_info, m_compat_info, this));
m_game_grid_frame.reset(new GameGridFrame(m_gui_settings, m_game_info, m_compat_info, this));
m_game_grid_frame->setObjectName("gamegridlist");
m_elf_viewer.reset(new ElfViewer(this));
m_elf_viewer.reset(new ElfViewer(m_gui_settings, this));
m_elf_viewer->setObjectName("elflist");
int table_mode = Config::getTableMode();
int table_mode = m_gui_settings->GetValue(gui::gl_mode).toInt();
int slider_pos = 0;
if (table_mode == 0) { // List
m_game_grid_frame->hide();
m_elf_viewer->hide();
m_game_list_frame->show();
m_dock_widget->setWidget(m_game_list_frame.data());
slider_pos = Config::getSliderPosition();
slider_pos = m_gui_settings->GetValue(gui::gl_slider_pos).toInt();
ui->sizeSlider->setSliderPosition(slider_pos); // set slider pos at start;
isTableList = true;
} else if (table_mode == 1) { // Grid
@ -312,7 +313,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::getSliderPositionGrid();
slider_pos = m_gui_settings->GetValue(gui::gg_slider_pos).toInt();
ui->sizeSlider->setSliderPosition(slider_pos); // set slider pos at start;
isTableList = false;
} else {
@ -356,11 +357,11 @@ void MainWindow::LoadGameLists() {
#ifdef ENABLE_UPDATER
void MainWindow::CheckUpdateMain(bool checkSave) {
if (checkSave) {
if (!Config::autoUpdate()) {
if (!m_gui_settings->GetValue(gui::gen_checkForUpdates).toBool()) {
return;
}
}
auto checkUpdate = new CheckUpdate(false);
auto checkUpdate = new CheckUpdate(m_gui_settings, false);
checkUpdate->exec();
}
#endif
@ -380,13 +381,13 @@ void MainWindow::CreateConnects() {
m_game_list_frame->icon_size =
48 + value; // 48 is the minimum icon size to use due to text disappearing.
m_game_list_frame->ResizeIcons(48 + value);
Config::setIconSize(48 + value);
Config::setSliderPosition(value);
m_gui_settings->SetValue(gui::gl_icon_size, 48 + value);
m_gui_settings->SetValue(gui::gl_slider_pos, 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::setSliderPositionGrid(value);
m_gui_settings->SetValue(gui::gg_icon_size, 69 + value);
m_gui_settings->SetValue(gui::gg_slider_pos, value);
}
});
@ -404,7 +405,7 @@ void MainWindow::CreateConnects() {
&MainWindow::StartGame);
connect(ui->configureAct, &QAction::triggered, this, [this]() {
auto settingsDialog = new SettingsDialog(m_compat_info, this);
auto settingsDialog = new SettingsDialog(m_gui_settings, m_compat_info, this);
connect(settingsDialog, &SettingsDialog::LanguageChanged, this,
&MainWindow::OnLanguageChanged);
@ -418,7 +419,8 @@ void MainWindow::CreateConnects() {
connect(settingsDialog, &SettingsDialog::BackgroundOpacityChanged, this,
[this](int opacity) {
Config::setBackgroundImageOpacity(opacity);
m_gui_settings->SetValue(gui::gl_backgroundImageOpacity,
std::clamp(opacity, 0, 100));
if (m_game_list_frame) {
QTableWidgetItem* current = m_game_list_frame->GetCurrentItem();
if (current) {
@ -437,7 +439,7 @@ void MainWindow::CreateConnects() {
});
connect(ui->settingsButton, &QPushButton::clicked, this, [this]() {
auto settingsDialog = new SettingsDialog(m_compat_info, this);
auto settingsDialog = new SettingsDialog(m_gui_settings, m_compat_info, this);
connect(settingsDialog, &SettingsDialog::LanguageChanged, this,
&MainWindow::OnLanguageChanged);
@ -451,7 +453,8 @@ void MainWindow::CreateConnects() {
connect(settingsDialog, &SettingsDialog::BackgroundOpacityChanged, this,
[this](int opacity) {
Config::setBackgroundImageOpacity(opacity);
m_gui_settings->SetValue(gui::gl_backgroundImageOpacity,
std::clamp(opacity, 0, 100));
if (m_game_list_frame) {
QTableWidgetItem* current = m_game_list_frame->GetCurrentItem();
if (current) {
@ -481,13 +484,13 @@ void MainWindow::CreateConnects() {
#ifdef ENABLE_UPDATER
connect(ui->updaterAct, &QAction::triggered, this, [this]() {
auto checkUpdate = new CheckUpdate(true);
auto checkUpdate = new CheckUpdate(m_gui_settings, true);
checkUpdate->exec();
});
#endif
connect(ui->aboutAct, &QAction::triggered, this, [this]() {
auto aboutDialog = new AboutDialog(this);
auto aboutDialog = new AboutDialog(m_gui_settings, this);
aboutDialog->exec();
});
@ -496,13 +499,13 @@ void MainWindow::CreateConnects() {
m_game_list_frame->icon_size =
36; // 36 is the minimum icon size to use due to text disappearing.
ui->sizeSlider->setValue(0); // icone_size - 36
Config::setIconSize(36);
Config::setSliderPosition(0);
m_gui_settings->SetValue(gui::gl_icon_size, 36);
m_gui_settings->SetValue(gui::gl_slider_pos, 0);
} else {
m_game_grid_frame->icon_size = 69;
ui->sizeSlider->setValue(0); // icone_size - 36
Config::setIconSizeGrid(69);
Config::setSliderPositionGrid(0);
m_gui_settings->SetValue(gui::gg_icon_size, 69);
m_gui_settings->SetValue(gui::gg_slider_pos, 9);
m_game_grid_frame->PopulateGameGrid(m_game_info->m_games, false);
}
});
@ -511,13 +514,13 @@ void MainWindow::CreateConnects() {
if (isTableList) {
m_game_list_frame->icon_size = 64;
ui->sizeSlider->setValue(28);
Config::setIconSize(64);
Config::setSliderPosition(28);
m_gui_settings->SetValue(gui::gl_icon_size, 64);
m_gui_settings->SetValue(gui::gl_slider_pos, 28);
} else {
m_game_grid_frame->icon_size = 97;
ui->sizeSlider->setValue(28);
Config::setIconSizeGrid(97);
Config::setSliderPositionGrid(28);
m_gui_settings->SetValue(gui::gg_icon_size, 97);
m_gui_settings->SetValue(gui::gg_slider_pos, 28);
m_game_grid_frame->PopulateGameGrid(m_game_info->m_games, false);
}
});
@ -526,13 +529,13 @@ void MainWindow::CreateConnects() {
if (isTableList) {
m_game_list_frame->icon_size = 128;
ui->sizeSlider->setValue(92);
Config::setIconSize(128);
Config::setSliderPosition(92);
m_gui_settings->SetValue(gui::gl_icon_size, 128);
m_gui_settings->SetValue(gui::gl_slider_pos, 92);
} else {
m_game_grid_frame->icon_size = 161;
ui->sizeSlider->setValue(92);
Config::setIconSizeGrid(161);
Config::setSliderPositionGrid(92);
m_gui_settings->SetValue(gui::gg_icon_size, 161);
m_gui_settings->SetValue(gui::gg_slider_pos, 92);
m_game_grid_frame->PopulateGameGrid(m_game_info->m_games, false);
}
});
@ -541,13 +544,13 @@ void MainWindow::CreateConnects() {
if (isTableList) {
m_game_list_frame->icon_size = 256;
ui->sizeSlider->setValue(220);
Config::setIconSize(256);
Config::setSliderPosition(220);
m_gui_settings->SetValue(gui::gl_icon_size, 256);
m_gui_settings->SetValue(gui::gl_slider_pos, 220);
} else {
m_game_grid_frame->icon_size = 256;
ui->sizeSlider->setValue(220);
Config::setIconSizeGrid(256);
Config::setSliderPositionGrid(220);
m_gui_settings->SetValue(gui::gg_icon_size, 256);
m_gui_settings->SetValue(gui::gg_slider_pos, 220);
m_game_grid_frame->PopulateGameGrid(m_game_info->m_games, false);
}
});
@ -558,13 +561,11 @@ void MainWindow::CreateConnects() {
m_game_grid_frame->hide();
m_elf_viewer->hide();
m_game_list_frame->show();
if (m_game_list_frame->item(0, 0) == nullptr) {
m_game_list_frame->clearContents();
m_game_list_frame->PopulateGameList();
}
isTableList = true;
Config::setTableMode(0);
int slider_pos = Config::getSliderPosition();
m_gui_settings->SetValue(gui::gl_mode, 0);
int slider_pos = m_gui_settings->GetValue(gui::gl_slider_pos).toInt();
ui->sizeSlider->setEnabled(true);
ui->sizeSlider->setSliderPosition(slider_pos);
ui->mw_searchbar->setText("");
@ -582,8 +583,8 @@ void MainWindow::CreateConnects() {
m_game_grid_frame->PopulateGameGrid(m_game_info->m_games, false);
}
isTableList = false;
Config::setTableMode(1);
int slider_pos_grid = Config::getSliderPositionGrid();
m_gui_settings->SetValue(gui::gl_mode, 1);
int slider_pos_grid = m_gui_settings->GetValue(gui::gg_slider_pos).toInt();
ui->sizeSlider->setEnabled(true);
ui->sizeSlider->setSliderPosition(slider_pos_grid);
ui->mw_searchbar->setText("");
@ -598,7 +599,7 @@ void MainWindow::CreateConnects() {
m_elf_viewer->show();
isTableList = false;
ui->sizeSlider->setDisabled(true);
Config::setTableMode(2);
m_gui_settings->SetValue(gui::gl_mode, 2);
SetLastIconSizeBullet();
});
@ -766,14 +767,14 @@ void MainWindow::CreateConnects() {
QString gameName = QString::fromStdString(firstGame.name);
TrophyViewer* trophyViewer =
new TrophyViewer(trophyPath, gameTrpPath, gameName, allTrophyGames);
new TrophyViewer(m_gui_settings, trophyPath, gameTrpPath, gameName, allTrophyGames);
trophyViewer->show();
});
// Themes
connect(ui->setThemeDark, &QAction::triggered, &m_window_themes, [this]() {
m_window_themes.SetWindowTheme(Theme::Dark, ui->mw_searchbar);
Config::setMainWindowTheme(static_cast<int>(Theme::Dark));
m_gui_settings->SetValue(gui::gen_theme, static_cast<int>(Theme::Dark));
if (isIconBlack) {
SetUiIcons(false);
isIconBlack = false;
@ -781,7 +782,7 @@ void MainWindow::CreateConnects() {
});
connect(ui->setThemeLight, &QAction::triggered, &m_window_themes, [this]() {
m_window_themes.SetWindowTheme(Theme::Light, ui->mw_searchbar);
Config::setMainWindowTheme(static_cast<int>(Theme::Light));
m_gui_settings->SetValue(gui::gen_theme, static_cast<int>(Theme::Light));
if (!isIconBlack) {
SetUiIcons(true);
isIconBlack = true;
@ -789,7 +790,7 @@ void MainWindow::CreateConnects() {
});
connect(ui->setThemeGreen, &QAction::triggered, &m_window_themes, [this]() {
m_window_themes.SetWindowTheme(Theme::Green, ui->mw_searchbar);
Config::setMainWindowTheme(static_cast<int>(Theme::Green));
m_gui_settings->SetValue(gui::gen_theme, static_cast<int>(Theme::Green));
if (isIconBlack) {
SetUiIcons(false);
isIconBlack = false;
@ -797,7 +798,7 @@ void MainWindow::CreateConnects() {
});
connect(ui->setThemeBlue, &QAction::triggered, &m_window_themes, [this]() {
m_window_themes.SetWindowTheme(Theme::Blue, ui->mw_searchbar);
Config::setMainWindowTheme(static_cast<int>(Theme::Blue));
m_gui_settings->SetValue(gui::gen_theme, static_cast<int>(Theme::Blue));
if (isIconBlack) {
SetUiIcons(false);
isIconBlack = false;
@ -805,7 +806,7 @@ void MainWindow::CreateConnects() {
});
connect(ui->setThemeViolet, &QAction::triggered, &m_window_themes, [this]() {
m_window_themes.SetWindowTheme(Theme::Violet, ui->mw_searchbar);
Config::setMainWindowTheme(static_cast<int>(Theme::Violet));
m_gui_settings->SetValue(gui::gen_theme, static_cast<int>(Theme::Violet));
if (isIconBlack) {
SetUiIcons(false);
isIconBlack = false;
@ -813,7 +814,7 @@ void MainWindow::CreateConnects() {
});
connect(ui->setThemeGruvbox, &QAction::triggered, &m_window_themes, [this]() {
m_window_themes.SetWindowTheme(Theme::Gruvbox, ui->mw_searchbar);
Config::setMainWindowTheme(static_cast<int>(Theme::Gruvbox));
m_gui_settings->SetValue(gui::gen_theme, static_cast<int>(Theme::Gruvbox));
if (isIconBlack) {
SetUiIcons(false);
isIconBlack = false;
@ -821,7 +822,7 @@ void MainWindow::CreateConnects() {
});
connect(ui->setThemeTokyoNight, &QAction::triggered, &m_window_themes, [this]() {
m_window_themes.SetWindowTheme(Theme::TokyoNight, ui->mw_searchbar);
Config::setMainWindowTheme(static_cast<int>(Theme::TokyoNight));
m_gui_settings->SetValue(gui::gen_theme, static_cast<int>(Theme::TokyoNight));
if (isIconBlack) {
SetUiIcons(false);
isIconBlack = false;
@ -829,7 +830,7 @@ void MainWindow::CreateConnects() {
});
connect(ui->setThemeOled, &QAction::triggered, &m_window_themes, [this]() {
m_window_themes.SetWindowTheme(Theme::Oled, ui->mw_searchbar);
Config::setMainWindowTheme(static_cast<int>(Theme::Oled));
m_gui_settings->SetValue(gui::gen_theme, static_cast<int>(Theme::Oled));
if (isIconBlack) {
SetUiIcons(false);
isIconBlack = false;
@ -840,7 +841,7 @@ void MainWindow::CreateConnects() {
void MainWindow::StartGame() {
BackgroundMusicPlayer::getInstance().stopMusic();
QString gamePath = "";
int table_mode = Config::getTableMode();
int table_mode = m_gui_settings->GetValue(gui::gl_mode).toInt();
if (table_mode == 0) {
if (m_game_list_frame->currentItem()) {
int itemID = m_game_list_frame->currentItem()->row();
@ -925,25 +926,25 @@ void MainWindow::RefreshGameTable() {
}
void MainWindow::ConfigureGuiFromSettings() {
setGeometry(Config::getMainWindowGeometryX(), Config::getMainWindowGeometryY(),
Config::getMainWindowGeometryW(), Config::getMainWindowGeometryH());
if (!restoreGeometry(m_gui_settings->GetValue(gui::mw_geometry).toByteArray())) {
// By default, set the window to 70% of the screen
resize(QGuiApplication::primaryScreen()->availableSize() * 0.7);
}
ui->showGameListAct->setChecked(true);
if (Config::getTableMode() == 0) {
int table_mode = m_gui_settings->GetValue(gui::gl_mode).toInt();
if (table_mode == 0) {
ui->setlistModeListAct->setChecked(true);
} else if (Config::getTableMode() == 1) {
} else if (table_mode == 1) {
ui->setlistModeGridAct->setChecked(true);
} else if (Config::getTableMode() == 2) {
} else if (table_mode == 2) {
ui->setlistElfAct->setChecked(true);
}
BackgroundMusicPlayer::getInstance().setVolume(Config::getBGMvolume());
BackgroundMusicPlayer::getInstance().setVolume(
m_gui_settings->GetValue(gui::gl_backgroundMusicVolume).toInt());
}
void MainWindow::SaveWindowState() const {
Config::setMainWindowWidth(this->width());
Config::setMainWindowHeight(this->height());
Config::setMainWindowGeometry(this->geometry().x(), this->geometry().y(),
this->geometry().width(), this->geometry().height());
void MainWindow::SaveWindowState() {
m_gui_settings->SetValue(gui::mw_geometry, saveGeometry(), false);
}
void MainWindow::BootGame() {
@ -976,7 +977,7 @@ void MainWindow::InstallDirectory() {
}
void MainWindow::SetLastUsedTheme() {
Theme lastTheme = static_cast<Theme>(Config::getMainWindowTheme());
Theme lastTheme = static_cast<Theme>(m_gui_settings->GetValue(gui::gen_theme).toInt());
m_window_themes.SetWindowTheme(lastTheme, ui->mw_searchbar);
switch (lastTheme) {
@ -1024,8 +1025,8 @@ void MainWindow::SetLastUsedTheme() {
void MainWindow::SetLastIconSizeBullet() {
// set QAction bullet point if applicable
int lastSize = Config::getIconSize();
int lastSizeGrid = Config::getIconSizeGrid();
int lastSize = m_gui_settings->GetValue(gui::gl_icon_size).toInt();
int lastSizeGrid = m_gui_settings->GetValue(gui::gg_icon_size).toInt();
if (isTableList) {
switch (lastSize) {
case 36:
@ -1117,33 +1118,32 @@ void MainWindow::HandleResize(QResizeEvent* event) {
}
void MainWindow::AddRecentFiles(QString filePath) {
std::vector<std::string> vec = Config::getRecentFiles();
if (!vec.empty()) {
if (filePath.toStdString() == vec.at(0)) {
QList<QString> list = gui_settings::Var2List(m_gui_settings->GetValue(gui::gen_recentFiles));
if (!list.empty()) {
if (filePath == list.at(0)) {
return;
}
auto it = std::find(vec.begin(), vec.end(), filePath.toStdString());
if (it != vec.end()) {
vec.erase(it);
auto it = std::find(list.begin(), list.end(), filePath);
if (it != list.end()) {
list.erase(it);
}
}
vec.insert(vec.begin(), filePath.toStdString());
if (vec.size() > 6) {
vec.pop_back();
list.insert(list.begin(), filePath);
if (list.size() > 6) {
list.pop_back();
}
Config::setRecentFiles(vec);
const auto config_dir = Common::FS::GetUserPath(Common::FS::PathType::UserDir);
Config::saveMainWindow(config_dir / "config.toml");
m_gui_settings->SetValue(gui::gen_recentFiles, gui_settings::List2Var(list));
CreateRecentGameActions(); // Refresh the QActions.
}
void MainWindow::CreateRecentGameActions() {
m_recent_files_group = new QActionGroup(this);
ui->menuRecent->clear();
std::vector<std::string> vec = Config::getRecentFiles();
for (int i = 0; i < vec.size(); i++) {
QList<QString> list = gui_settings::Var2List(m_gui_settings->GetValue(gui::gen_recentFiles));
for (int i = 0; i < list.size(); i++) {
QAction* recentFileAct = new QAction(this);
recentFileAct->setText(QString::fromStdString(vec.at(i)));
recentFileAct->setText(list.at(i));
ui->menuRecent->addAction(recentFileAct);
m_recent_files_group->addAction(recentFileAct);
}
@ -1160,7 +1160,7 @@ void MainWindow::CreateRecentGameActions() {
}
void MainWindow::LoadTranslation() {
auto language = QString::fromStdString(Config::getEmulatorLanguage());
auto language = m_gui_settings->GetValue(gui::gen_guiLanguage).toString();
const QString base_dir = QStringLiteral(":/translations");
QString base_path = QStringLiteral("%1/%2.qm").arg(base_dir).arg(language);
@ -1185,8 +1185,8 @@ void MainWindow::LoadTranslation() {
}
}
void MainWindow::OnLanguageChanged(const std::string& locale) {
Config::setEmulatorLanguage(locale);
void MainWindow::OnLanguageChanged(const QString& locale) {
m_gui_settings->SetValue(gui::gen_guiLanguage, locale);
LoadTranslation();
}
@ -1195,7 +1195,7 @@ bool MainWindow::eventFilter(QObject* obj, QEvent* event) {
if (event->type() == QEvent::KeyPress) {
QKeyEvent* keyEvent = static_cast<QKeyEvent*>(event);
if (keyEvent->key() == Qt::Key_Enter || keyEvent->key() == Qt::Key_Return) {
auto tblMode = Config::getTableMode();
auto tblMode = m_gui_settings->GetValue(gui::gl_mode).toInt();
if (tblMode != 2 && (tblMode != 1 || m_game_grid_frame->IsValidCellSelected())) {
StartGame();
return true;

View file

@ -20,6 +20,7 @@
#include "game_info.h"
#include "game_list_frame.h"
#include "game_list_utils.h"
#include "gui_settings.h"
#include "main_window_themes.h"
#include "main_window_ui.h"
@ -41,12 +42,12 @@ public:
private Q_SLOTS:
void ConfigureGuiFromSettings();
void SaveWindowState() const;
void SaveWindowState();
void SearchGameTable(const QString& text);
void ShowGameList();
void RefreshGameTable();
void HandleResize(QResizeEvent* event);
void OnLanguageChanged(const std::string& locale);
void OnLanguageChanged(const QString& locale);
void toggleLabelsUnderIcons();
private:
@ -102,6 +103,7 @@ private:
std::make_shared<CompatibilityInfoClass>();
QTranslator* translator;
std::shared_ptr<gui_settings> m_gui_settings;
protected:
bool eventFilter(QObject* obj, QEvent* event) override;

View file

@ -107,7 +107,6 @@ public:
toggleLabelsAct = new QAction(MainWindow);
toggleLabelsAct->setObjectName("toggleLabelsAct");
toggleLabelsAct->setCheckable(true);
toggleLabelsAct->setChecked(Config::getShowLabelsUnderIcons());
setIconSizeTinyAct = new QAction(MainWindow);
setIconSizeTinyAct->setObjectName("setIconSizeTinyAct");

91
src/qt_gui/settings.cpp Normal file
View file

@ -0,0 +1,91 @@
// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include <common/path_util.h>
#include "settings.h"
settings::settings(QObject* parent) : QObject(parent), m_settings_dir(ComputeSettingsDir()) {}
settings::~settings() {
sync();
}
void settings::sync() {
if (m_settings) {
m_settings->sync();
}
}
QString settings::GetSettingsDir() const {
return m_settings_dir.absolutePath();
}
QString settings::ComputeSettingsDir() {
const auto config_dir = Common::FS::GetUserPath(Common::FS::PathType::UserDir);
return QString::fromStdString(config_dir.string() + "/");
}
void settings::RemoveValue(const QString& key, const QString& name, bool sync) const {
if (m_settings) {
m_settings->beginGroup(key);
m_settings->remove(name);
m_settings->endGroup();
if (sync) {
m_settings->sync();
}
}
}
void settings::RemoveValue(const gui_value& entry, bool sync) const {
RemoveValue(entry.key, entry.name, sync);
}
QVariant settings::GetValue(const QString& key, const QString& name, const QVariant& def) const {
return m_settings ? m_settings->value(key + "/" + name, def) : def;
}
QVariant settings::GetValue(const gui_value& entry) const {
return GetValue(entry.key, entry.name, entry.def);
}
void settings::SetValue(const gui_value& entry, const QVariant& value, bool sync) const {
SetValue(entry.key, entry.name, value, sync);
}
void settings::SetValue(const QString& key, const QVariant& value, bool sync) const {
if (m_settings) {
m_settings->setValue(key, value);
if (sync) {
m_settings->sync();
}
}
}
void settings::SetValue(const QString& key, const QString& name, const QVariant& value,
bool sync) const {
if (m_settings) {
m_settings->beginGroup(key);
m_settings->setValue(name, value);
m_settings->endGroup();
if (sync) {
m_settings->sync();
}
}
}
QVariant settings::List2Var(const QList<QString>& list) {
QByteArray ba;
QDataStream stream(&ba, QIODevice::WriteOnly);
stream << list;
return QVariant(ba);
}
QList<QString> settings::Var2List(const QVariant& var) {
QList<QString> list;
QByteArray ba = var.toByteArray();
QDataStream stream(&ba, QIODevice::ReadOnly);
stream >> list;
return list;
}

57
src/qt_gui/settings.h Normal file
View file

@ -0,0 +1,57 @@
// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <QDir>
#include <QSettings>
#include <QString>
#include <QVariant>
struct gui_value {
QString key;
QString name;
QVariant def;
gui_value() {}
gui_value(const QString& k, const QString& n, const QVariant& d) : key(k), name(n), def(d) {}
bool operator==(const gui_value& rhs) const noexcept {
return key == rhs.key && name == rhs.name && def == rhs.def;
}
};
class settings : public QObject {
Q_OBJECT
public:
explicit settings(QObject* parent = nullptr);
~settings();
void sync();
QString GetSettingsDir() const;
QVariant GetValue(const QString& key, const QString& name, const QVariant& def) const;
QVariant GetValue(const gui_value& entry) const;
static QVariant List2Var(const QList<QString>& list);
static QList<QString> Var2List(const QVariant& var);
public Q_SLOTS:
/** Remove entry */
void RemoveValue(const QString& key, const QString& name, bool sync = true) const;
void RemoveValue(const gui_value& entry, bool sync = true) const;
/** Write value to entry */
void SetValue(const gui_value& entry, const QVariant& value, bool sync = true) const;
void SetValue(const QString& key, const QVariant& value, bool sync = true) const;
void SetValue(const QString& key, const QString& name, const QVariant& value,
bool sync = true) const;
protected:
static QString ComputeSettingsDir();
std::unique_ptr<QSettings> m_settings;
QDir m_settings_dir;
};

View file

@ -71,9 +71,10 @@ int bgm_volume_backup;
static std::vector<QString> m_physical_devices;
SettingsDialog::SettingsDialog(std::shared_ptr<CompatibilityInfoClass> m_compat_info,
SettingsDialog::SettingsDialog(std::shared_ptr<gui_settings> gui_settings,
std::shared_ptr<CompatibilityInfoClass> m_compat_info,
QWidget* parent)
: QDialog(parent), ui(new Ui::SettingsDialog) {
: QDialog(parent), ui(new Ui::SettingsDialog), m_gui_settings(std::move(gui_settings)) {
ui->setupUi(this);
ui->tabWidgetSettings->setUsesScrollButtons(false);
@ -122,11 +123,6 @@ SettingsDialog::SettingsDialog(std::shared_ptr<CompatibilityInfoClass> m_compat_
ui->hideCursorComboBox->addItem(tr("Idle"));
ui->hideCursorComboBox->addItem(tr("Always"));
ui->backButtonBehaviorComboBox->addItem(tr("Touchpad Left"), "left");
ui->backButtonBehaviorComboBox->addItem(tr("Touchpad Center"), "center");
ui->backButtonBehaviorComboBox->addItem(tr("Touchpad Right"), "right");
ui->backButtonBehaviorComboBox->addItem(tr("None"), "none");
InitializeEmulatorLanguages();
LoadValuesFromConfig();
@ -147,6 +143,7 @@ SettingsDialog::SettingsDialog(std::shared_ptr<CompatibilityInfoClass> m_compat_
Config::save(config_dir / "config.toml");
} else if (button == ui->buttonBox->button(QDialogButtonBox::RestoreDefaults)) {
Config::setDefaultValues();
setDefaultValues();
Config::save(config_dir / "config.toml");
LoadValuesFromConfig();
} else if (button == ui->buttonBox->button(QDialogButtonBox::Close)) {
@ -175,28 +172,34 @@ SettingsDialog::SettingsDialog(std::shared_ptr<CompatibilityInfoClass> m_compat_
{
#ifdef ENABLE_UPDATER
#if (QT_VERSION < QT_VERSION_CHECK(6, 7, 0))
connect(ui->updateCheckBox, &QCheckBox::stateChanged, this,
[](int state) { Config::setAutoUpdate(state == Qt::Checked); });
connect(ui->updateCheckBox, &QCheckBox::stateChanged, this, [this](int state) {
m_gui_settings->SetValue(gui::gen_checkForUpdates, state == Qt::Checked);
});
connect(ui->changelogCheckBox, &QCheckBox::stateChanged, this,
[](int state) { Config::setAlwaysShowChangelog(state == Qt::Checked); });
connect(ui->changelogCheckBox, &QCheckBox::stateChanged, this, [this](int state) {
m_gui_settings->SetValue(gui::gen_showChangeLog, state == Qt::Checked);
});
#else
connect(ui->updateCheckBox, &QCheckBox::checkStateChanged, this,
[](Qt::CheckState state) { Config::setAutoUpdate(state == Qt::Checked); });
[this](Qt::CheckState state) {
m_gui_settings->SetValue(gui::gen_checkForUpdates, state == Qt::Checked);
});
connect(ui->changelogCheckBox, &QCheckBox::checkStateChanged, this,
[](Qt::CheckState state) { Config::setAlwaysShowChangelog(state == Qt::Checked); });
[this](Qt::CheckState state) {
m_gui_settings->SetValue(gui::gen_showChangeLog, state == Qt::Checked);
});
#endif
connect(ui->updateComboBox, &QComboBox::currentTextChanged, this,
[this](const QString& channel) {
if (channelMap.contains(channel)) {
Config::setUpdateChannel(channelMap.value(channel).toStdString());
m_gui_settings->SetValue(gui::gen_updateChannel, channelMap.value(channel));
}
});
connect(ui->checkUpdateButton, &QPushButton::clicked, this, []() {
auto checkUpdate = new CheckUpdate(true);
connect(ui->checkUpdateButton, &QPushButton::clicked, this, [this]() {
auto checkUpdate = new CheckUpdate(m_gui_settings, true);
checkUpdate->exec();
});
#else
@ -235,12 +238,12 @@ SettingsDialog::SettingsDialog(std::shared_ptr<CompatibilityInfoClass> m_compat_
[](const QString& hometab) { Config::setChooseHomeTab(hometab.toStdString()); });
#if (QT_VERSION < QT_VERSION_CHECK(6, 7, 0))
connect(ui->showBackgroundImageCheckBox, &QCheckBox::stateChanged, this, [](int state) {
connect(ui->showBackgroundImageCheckBox, &QCheckBox::stateChanged, this, [this](int state) {
#else
connect(ui->showBackgroundImageCheckBox, &QCheckBox::checkStateChanged, this,
[](Qt::CheckState state) {
[this](Qt::CheckState state) {
#endif
Config::setShowBackgroundImage(state == Qt::Checked);
m_gui_settings->SetValue(gui::gl_showBackgroundImage, state == Qt::Checked);
});
}
@ -358,7 +361,6 @@ SettingsDialog::SettingsDialog(std::shared_ptr<CompatibilityInfoClass> m_compat_
// Input
ui->hideCursorGroupBox->installEventFilter(this);
ui->idleTimeoutGroupBox->installEventFilter(this);
ui->backButtonBehaviorGroupBox->installEventFilter(this);
// Graphics
ui->graphicsAdapterGroupBox->installEventFilter(this);
@ -448,7 +450,7 @@ void SettingsDialog::LoadValuesFromConfig() {
ui->dumpShadersCheckBox->setChecked(toml::find_or<bool>(data, "GPU", "dumpShaders", false));
ui->nullGpuCheckBox->setChecked(toml::find_or<bool>(data, "GPU", "nullGpu", false));
ui->enableHDRCheckBox->setChecked(toml::find_or<bool>(data, "GPU", "allowHDR", false));
ui->playBGMCheckBox->setChecked(toml::find_or<bool>(data, "General", "playBGM", false));
ui->playBGMCheckBox->setChecked(m_gui_settings->GetValue(gui::gl_playBackgroundMusic).toBool());
ui->disableTrophycheckBox->setChecked(
toml::find_or<bool>(data, "General", "isTrophyPopupDisabled", false));
ui->popUpDurationSpinBox->setValue(Config::getTrophyNotificationDuration());
@ -460,7 +462,7 @@ void SettingsDialog::LoadValuesFromConfig() {
ui->radioButton_Top->setChecked(side == "top");
ui->radioButton_Bottom->setChecked(side == "bottom");
ui->BGMVolumeSlider->setValue(toml::find_or<int>(data, "General", "BGMvolume", 50));
ui->BGMVolumeSlider->setValue(m_gui_settings->GetValue(gui::gl_backgroundMusicVolume).toInt());
ui->discordRPCCheckbox->setChecked(
toml::find_or<bool>(data, "General", "enableDiscordRPC", true));
QString translatedText_FullscreenMode =
@ -501,11 +503,10 @@ void SettingsDialog::LoadValuesFromConfig() {
toml::find_or<bool>(data, "General", "checkCompatibilityOnStartup", false));
#ifdef ENABLE_UPDATER
ui->updateCheckBox->setChecked(toml::find_or<bool>(data, "General", "autoUpdate", false));
ui->changelogCheckBox->setChecked(
toml::find_or<bool>(data, "General", "alwaysShowChangelog", false));
ui->updateCheckBox->setChecked(m_gui_settings->GetValue(gui::gen_checkForUpdates).toBool());
ui->changelogCheckBox->setChecked(m_gui_settings->GetValue(gui::gen_showChangeLog).toBool());
QString updateChannel = QString::fromStdString(Config::getUpdateChannel());
QString updateChannel = m_gui_settings->GetValue(gui::gen_updateChannel).toString();
ui->updateComboBox->setCurrentText(
channelMap.key(updateChannel != "Release" && updateChannel != "Nightly"
? (Common::g_is_release ? "Release" : "Nightly")
@ -527,20 +528,19 @@ void SettingsDialog::LoadValuesFromConfig() {
indexTab = 0;
ui->tabWidgetSettings->setCurrentIndex(indexTab);
QString backButtonBehavior = QString::fromStdString(
toml::find_or<std::string>(data, "Input", "backButtonBehavior", "left"));
int index = ui->backButtonBehaviorComboBox->findData(backButtonBehavior);
ui->backButtonBehaviorComboBox->setCurrentIndex(index != -1 ? index : 0);
ui->motionControlsCheckBox->setChecked(
toml::find_or<bool>(data, "Input", "isMotionControlsEnabled", true));
ui->removeFolderButton->setEnabled(!ui->gameFoldersListWidget->selectedItems().isEmpty());
ResetInstallFolders();
ui->backgroundImageOpacitySlider->setValue(Config::getBackgroundImageOpacity());
ui->showBackgroundImageCheckBox->setChecked(Config::getShowBackgroundImage());
ui->backgroundImageOpacitySlider->setValue(
m_gui_settings->GetValue(gui::gl_backgroundImageOpacity).toInt());
ui->showBackgroundImageCheckBox->setChecked(
m_gui_settings->GetValue(gui::gl_showBackgroundImage).toBool());
backgroundImageOpacitySlider_backup = Config::getBackgroundImageOpacity();
bgm_volume_backup = Config::getBGMvolume();
backgroundImageOpacitySlider_backup =
m_gui_settings->GetValue(gui::gl_backgroundImageOpacity).toInt();
bgm_volume_backup = m_gui_settings->GetValue(gui::gl_backgroundMusicVolume).toInt();
}
void SettingsDialog::InitializeEmulatorLanguages() {
@ -584,7 +584,7 @@ void SettingsDialog::OnLanguageChanged(int index) {
ui->retranslateUi(this);
emit LanguageChanged(ui->emulatorLanguageComboBox->itemData(index).toString().toStdString());
emit LanguageChanged(ui->emulatorLanguageComboBox->itemData(index).toString());
}
void SettingsDialog::OnCursorStateChanged(s16 index) {
@ -656,8 +656,6 @@ void SettingsDialog::updateNoteTextEdit(const QString& elementName) {
text = tr("Hide Cursor:\\nChoose when the cursor will disappear:\\nNever: You will always see the mouse.\\nidle: Set a time for it to disappear after being idle.\\nAlways: you will never see the mouse.");
} else if (elementName == "idleTimeoutGroupBox") {
text = tr("Hide Idle Cursor Timeout:\\nThe duration (seconds) after which the cursor that has been idle hides itself.");
} else if (elementName == "backButtonBehaviorGroupBox") {
text = tr("Back Button Behavior:\\nSets the controller's back button to emulate tapping the specified position on the PS4 touchpad.");
}
// Graphics
@ -735,8 +733,6 @@ bool SettingsDialog::eventFilter(QObject* obj, QEvent* event) {
void SettingsDialog::UpdateSettings() {
const QVector<std::string> TouchPadIndex = {"left", "center", "right", "none"};
Config::setBackButtonBehavior(TouchPadIndex[ui->backButtonBehaviorComboBox->currentIndex()]);
Config::setIsFullscreen(screenModeMap.value(ui->displayModeComboBox->currentText()) !=
"Windowed");
Config::setFullscreenMode(
@ -754,8 +750,7 @@ void SettingsDialog::UpdateSettings() {
} else if (ui->radioButton_Bottom->isChecked()) {
Config::setSideTrophy("bottom");
}
Config::setPlayBGM(ui->playBGMCheckBox->isChecked());
m_gui_settings->SetValue(gui::gl_playBackgroundMusic, ui->playBGMCheckBox->isChecked());
Config::setAllowHDR(ui->enableHDRCheckBox->isChecked());
Config::setLogType(logTypeMap.value(ui->logTypeComboBox->currentText()).toStdString());
Config::setLogFilter(ui->logFilterLineEdit->text().toStdString());
@ -764,7 +759,7 @@ void SettingsDialog::UpdateSettings() {
Config::setCursorState(ui->hideCursorComboBox->currentIndex());
Config::setCursorHideTimeout(ui->idleTimeoutSpinBox->value());
Config::setGpuId(ui->graphicsAdapterBox->currentIndex() - 1);
Config::setBGMvolume(ui->BGMVolumeSlider->value());
m_gui_settings->SetValue(gui::gl_backgroundMusicVolume, ui->BGMVolumeSlider->value());
Config::setLanguage(languageIndexes[ui->consoleLanguageComboBox->currentIndex()]);
Config::setEnableDiscordRPC(ui->discordRPCCheckbox->isChecked());
Config::setScreenWidth(ui->widthSpinBox->value());
@ -784,16 +779,19 @@ void SettingsDialog::UpdateSettings() {
Config::setVkCrashDiagnosticEnabled(ui->crashDiagnosticsCheckBox->isChecked());
Config::setCollectShaderForDebug(ui->collectShaderCheckBox->isChecked());
Config::setCopyGPUCmdBuffers(ui->copyGPUBuffersCheckBox->isChecked());
Config::setAutoUpdate(ui->updateCheckBox->isChecked());
Config::setAlwaysShowChangelog(ui->changelogCheckBox->isChecked());
Config::setUpdateChannel(channelMap.value(ui->updateComboBox->currentText()).toStdString());
m_gui_settings->SetValue(gui::gen_checkForUpdates, ui->updateCheckBox->isChecked());
m_gui_settings->SetValue(gui::gen_showChangeLog, ui->changelogCheckBox->isChecked());
m_gui_settings->SetValue(gui::gen_updateChannel,
channelMap.value(ui->updateComboBox->currentText()));
Config::setChooseHomeTab(
chooseHomeTabMap.value(ui->chooseHomeTabComboBox->currentText()).toStdString());
Config::setCompatibilityEnabled(ui->enableCompatibilityCheckBox->isChecked());
Config::setCheckCompatibilityOnStartup(ui->checkCompatibilityOnStartupCheckBox->isChecked());
Config::setBackgroundImageOpacity(ui->backgroundImageOpacitySlider->value());
m_gui_settings->SetValue(gui::gl_backgroundImageOpacity,
std::clamp(ui->backgroundImageOpacitySlider->value(), 0, 100));
emit BackgroundOpacityChanged(ui->backgroundImageOpacitySlider->value());
Config::setShowBackgroundImage(ui->showBackgroundImageCheckBox->isChecked());
m_gui_settings->SetValue(gui::gl_showBackgroundImage,
ui->showBackgroundImageCheckBox->isChecked());
std::vector<Config::GameInstallDir> dirs_with_states;
for (int i = 0; i < ui->gameFoldersListWidget->count(); i++) {
@ -862,3 +860,17 @@ void SettingsDialog::ResetInstallFolders() {
Config::setAllGameInstallDirs(settings_install_dirs_config);
}
}
void SettingsDialog::setDefaultValues() {
m_gui_settings->SetValue(gui::gl_showBackgroundImage, true);
m_gui_settings->SetValue(gui::gl_backgroundImageOpacity, 50);
m_gui_settings->SetValue(gui::gl_playBackgroundMusic, false);
m_gui_settings->SetValue(gui::gl_backgroundMusicVolume, 50);
m_gui_settings->SetValue(gui::gen_checkForUpdates, false);
m_gui_settings->SetValue(gui::gen_showChangeLog, false);
if (Common::g_is_release) {
m_gui_settings->SetValue(gui::gen_updateChannel, "Release");
} else {
m_gui_settings->SetValue(gui::gen_updateChannel, "Nightly");
}
m_gui_settings->SetValue(gui::gen_guiLanguage, "en_US");
}

View file

@ -11,6 +11,7 @@
#include "common/config.h"
#include "common/path_util.h"
#include "gui_settings.h"
#include "qt_gui/compatibility_info.h"
namespace Ui {
@ -20,7 +21,8 @@ class SettingsDialog;
class SettingsDialog : public QDialog {
Q_OBJECT
public:
explicit SettingsDialog(std::shared_ptr<CompatibilityInfoClass> m_compat_info,
explicit SettingsDialog(std::shared_ptr<gui_settings> gui_settings,
std::shared_ptr<CompatibilityInfoClass> m_compat_info,
QWidget* parent = nullptr);
~SettingsDialog();
@ -30,7 +32,7 @@ public:
int exec() override;
signals:
void LanguageChanged(const std::string& locale);
void LanguageChanged(const QString& locale);
void CompatibilityChanged();
void BackgroundOpacityChanged(int opacity);
@ -42,6 +44,7 @@ private:
void OnLanguageChanged(int index);
void OnCursorStateChanged(s16 index);
void closeEvent(QCloseEvent* event) override;
void setDefaultValues();
std::unique_ptr<Ui::SettingsDialog> ui;
@ -52,4 +55,5 @@ private:
int initialHeight;
bool is_saving = false;
std::shared_ptr<gui_settings> m_gui_settings;
};

View file

@ -1613,36 +1613,6 @@
<property name="bottomMargin">
<number>11</number>
</property>
<item>
<widget class="QGroupBox" name="backButtonBehaviorGroupBox">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="title">
<string>Back Button Behavior</string>
</property>
<layout class="QVBoxLayout" name="BackButtonLayout">
<property name="leftMargin">
<number>11</number>
</property>
<item>
<widget class="QComboBox" name="backButtonBehaviorComboBox"/>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QCheckBox" name="motionControlsCheckBox">
<property name="text">

View file

@ -1056,10 +1056,6 @@
<source>L3</source>
<translation>L3</translation>
</message>
<message>
<source>Touchpad Click</source>
<translation>زر لوحة اللمس</translation>
</message>
<message>
<source>Mouse to Joystick</source>
<translation>تحويل الماوس إلى عصا التحكم</translation>
@ -1152,10 +1148,6 @@
<source>Unable to Save</source>
<translation>تعذّر الحفظ</translation>
</message>
<message>
<source>Cannot bind any unique input more than once</source>
<translation>لا يمكن تعيين نفس الزر لأكثر من وظيفة</translation>
</message>
<message>
<source>Press a key</source>
<translation>اضغط زرًا</translation>
@ -1184,6 +1176,26 @@
<source>Cancel</source>
<translation>إلغاء</translation>
</message>
<message>
<source>Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons:
%1</source>
<translation type="unfinished">Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons:
%1</translation>
</message>
<message>
<source>Touchpad Left</source>
<translation type="unfinished">Touchpad Left</translation>
</message>
<message>
<source>Touchpad Center</source>
<translation type="unfinished">Touchpad Center</translation>
</message>
<message>
<source>Touchpad Right</source>
<translation type="unfinished">Touchpad Right</translation>
</message>
</context>
<context>
<name>MainWindow</name>
@ -1542,10 +1554,6 @@
<source>Controller</source>
<translation>التحكم</translation>
</message>
<message>
<source>Back Button Behavior</source>
<translation>سلوك زر العودة</translation>
</message>
<message>
<source>Graphics</source>
<translation>الرسوميات</translation>
@ -1783,10 +1791,6 @@ Nightly: نُسخ تحتوي على أحدث الميزات، لكنها أقل
<source>Hide Idle Cursor Timeout:\nThe duration (seconds) after which the cursor that has been idle hides itself.</source>
<translation>مدة إخفاء المؤشر عند الخمول:\nالوقت (بالثواني) الذي ينتظره المؤشر قبل أن يختفي تلقائيًا عند عدم استخدامه.</translation>
</message>
<message>
<source>Back Button Behavior:\nSets the controller&apos;s back button to emulate tapping the specified position on the PS4 touchpad.</source>
<translation>سلوك زر الرجوع:\nيحدد وظيفة زر&apos; الرجوع في وحدة التحكم لمحاكاة اللمس في موقع معيّن على لوحة اللمس الخاصة بـ PS4.</translation>
</message>
<message>
<source>Display Compatibility Data:\nDisplays game compatibility information in table view. Enable &quot;Update Compatibility On Startup&quot; to get up-to-date information.</source>
<translation>عرض بيانات التوافق:\nيعرض معلومات توافق الألعاب في عرض جدولي. فعّل &quot;"تحديث التوافق عند بدء التشغيل&quot;" للحصول على أحدث المعلومات.</translation>
@ -1811,22 +1815,6 @@ Nightly: نُسخ تحتوي على أحدث الميزات، لكنها أقل
<source>Always</source>
<translation>دائماً</translation>
</message>
<message>
<source>Touchpad Left</source>
<translation>الجانب الأيسر من لوحة اللمس</translation>
</message>
<message>
<source>Touchpad Right</source>
<translation>الجانب الأيمن من لوحة اللمس</translation>
</message>
<message>
<source>Touchpad Center</source>
<translation>مركز لوحة اللمس</translation>
</message>
<message>
<source>None</source>
<translation>لا شيء</translation>
</message>
<message>
<source>Graphics Device:\nOn multiple GPU systems, select the GPU the emulator will use from the drop down list,\nor select &quot;Auto Select&quot; to automatically determine it.</source>
<translation>جهاز الرسوميات:\nفي الأنظمة التي تحتوي على أكثر من معالج رسومي، اختر وحدة المعالجة الرسومية GPU التي سيستخدمها المحاكي من القائمة المنسدلة،\nأو اختر "&quot;تحديد تلقائي&quot;" ليتم اختيارها تلقائيًا.</translation>
@ -2049,7 +2037,7 @@ Nightly: نُسخ تحتوي على أحدث الميزات، لكنها أقل
</message>
<message>
<source> * Unsupported Vulkan Version</source>
<translation type="unfinished"> * Unsupported Vulkan Version</translation>
<translation>نسخ Vulkan غير مدعومة</translation>
</message>
</context>
<context>

File diff suppressed because it is too large Load diff

View file

@ -1056,10 +1056,6 @@
<source>L3</source>
<translation type="unfinished">L3</translation>
</message>
<message>
<source>Touchpad Click</source>
<translation type="unfinished">Touchpad Click</translation>
</message>
<message>
<source>Mouse to Joystick</source>
<translation type="unfinished">Mouse to Joystick</translation>
@ -1152,10 +1148,6 @@
<source>Unable to Save</source>
<translation type="unfinished">Unable to Save</translation>
</message>
<message>
<source>Cannot bind any unique input more than once</source>
<translation type="unfinished">Cannot bind any unique input more than once</translation>
</message>
<message>
<source>Press a key</source>
<translation type="unfinished">Press a key</translation>
@ -1184,6 +1176,26 @@
<source>Cancel</source>
<translation type="unfinished">Cancel</translation>
</message>
<message>
<source>Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons:
%1</source>
<translation type="unfinished">Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons:
%1</translation>
</message>
<message>
<source>Touchpad Left</source>
<translation type="unfinished">Touchpad Left</translation>
</message>
<message>
<source>Touchpad Center</source>
<translation type="unfinished">Touchpad Center</translation>
</message>
<message>
<source>Touchpad Right</source>
<translation type="unfinished">Touchpad Right</translation>
</message>
</context>
<context>
<name>MainWindow</name>
@ -1542,10 +1554,6 @@
<source>Controller</source>
<translation type="unfinished">Controller</translation>
</message>
<message>
<source>Back Button Behavior</source>
<translation>Tilbageknap adfærd</translation>
</message>
<message>
<source>Graphics</source>
<translation type="unfinished">Graphics</translation>
@ -1782,10 +1790,6 @@
<source>Hide Idle Cursor Timeout:\nThe duration (seconds) after which the cursor that has been idle hides itself.</source>
<translation>Indstil en tid for, at musen skal forsvinde efter at være inaktiv.</translation>
</message>
<message>
<source>Back Button Behavior:\nSets the controller&apos;s back button to emulate tapping the specified position on the PS4 touchpad.</source>
<translation>Tilbageknap Adfærd:\nIndstiller controllerens tilbageknap til at efterligne tryk den angivne position PS4 berøringsflade.</translation>
</message>
<message>
<source>Display Compatibility Data:\nDisplays game compatibility information in table view. Enable &quot;Update Compatibility On Startup&quot; to get up-to-date information.</source>
<translation type="unfinished">Display Compatibility Data:\nDisplays game compatibility information in table view. Enable &quot;Update Compatibility On Startup&quot; to get up-to-date information.</translation>
@ -1810,22 +1814,6 @@
<source>Always</source>
<translation>Altid</translation>
</message>
<message>
<source>Touchpad Left</source>
<translation>Berøringsplade Venstre</translation>
</message>
<message>
<source>Touchpad Right</source>
<translation>Berøringsplade Højre</translation>
</message>
<message>
<source>Touchpad Center</source>
<translation>Berøringsplade Center</translation>
</message>
<message>
<source>None</source>
<translation>Ingen</translation>
</message>
<message>
<source>Graphics Device:\nOn multiple GPU systems, select the GPU the emulator will use from the drop down list,\nor select &quot;Auto Select&quot; to automatically determine it.</source>
<translation>Grafikadapter:\nPå systemer med flere GPU&apos;er skal du vælge den GPU, emulatoren vil bruge fra en rullemenu,\neller vælge &quot;Auto Select&quot; for at vælge den automatisk.</translation>

View file

@ -1056,10 +1056,6 @@
<source>L3</source>
<translation>L3</translation>
</message>
<message>
<source>Touchpad Click</source>
<translation>Touchpad-Klick</translation>
</message>
<message>
<source>Mouse to Joystick</source>
<translation>Maus zu Joystick</translation>
@ -1152,10 +1148,6 @@
<source>Unable to Save</source>
<translation>Speichern nicht möglich</translation>
</message>
<message>
<source>Cannot bind any unique input more than once</source>
<translation>Kann keine eindeutige Eingabe mehr als einmal zuordnen</translation>
</message>
<message>
<source>Press a key</source>
<translation>Drücken Sie eine Taste</translation>
@ -1184,6 +1176,26 @@
<source>Cancel</source>
<translation>Abbrechen</translation>
</message>
<message>
<source>Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons:
%1</source>
<translation type="unfinished">Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons:
%1</translation>
</message>
<message>
<source>Touchpad Left</source>
<translation type="unfinished">Touchpad Left</translation>
</message>
<message>
<source>Touchpad Center</source>
<translation type="unfinished">Touchpad Center</translation>
</message>
<message>
<source>Touchpad Right</source>
<translation type="unfinished">Touchpad Right</translation>
</message>
</context>
<context>
<name>MainWindow</name>
@ -1542,10 +1554,6 @@
<source>Controller</source>
<translation>Kontroller</translation>
</message>
<message>
<source>Back Button Behavior</source>
<translation>Verhalten der Zurück-Taste</translation>
</message>
<message>
<source>Graphics</source>
<translation>Grafik</translation>
@ -1782,10 +1790,6 @@
<source>Hide Idle Cursor Timeout:\nThe duration (seconds) after which the cursor that has been idle hides itself.</source>
<translation>Stellen Sie eine Zeit ein, nach der die Maus nach Inaktivität verschwinden soll.</translation>
</message>
<message>
<source>Back Button Behavior:\nSets the controller&apos;s back button to emulate tapping the specified position on the PS4 touchpad.</source>
<translation>Zurück-Button Verhalten:\nStellt die Zurück-Taste des Controllers so ein, dass sie das Antippen der angegebenen Position auf dem PS4-Touchpad emuliert.</translation>
</message>
<message>
<source>Display Compatibility Data:\nDisplays game compatibility information in table view. Enable &quot;Update Compatibility On Startup&quot; to get up-to-date information.</source>
<translation>Kompatibilitätsdaten anzeigen:\nZeigt Spielkompatibilitätsinformationen in Tabellenansicht an. Aktivieren Sie Aktualisiere Kompatibilitätsdatenbank beim Start, um aktuelle Informationen zu erhalten.</translation>
@ -1810,22 +1814,6 @@
<source>Always</source>
<translation>Immer</translation>
</message>
<message>
<source>Touchpad Left</source>
<translation>Touchpad Links</translation>
</message>
<message>
<source>Touchpad Right</source>
<translation>Touchpad Rechts</translation>
</message>
<message>
<source>Touchpad Center</source>
<translation>Touchpad Mitte</translation>
</message>
<message>
<source>None</source>
<translation>Keine</translation>
</message>
<message>
<source>Graphics Device:\nOn multiple GPU systems, select the GPU the emulator will use from the drop down list,\nor select &quot;Auto Select&quot; to automatically determine it.</source>
<translation>Grafikkarte:\nAuf Systemen mit mehreren GPUs wählen Sie aus einem Dropdown-Menü die GPU aus, die der Emulator verwenden wird,\noder wählen Sie &quot;Auto Select&quot;, um sie automatisch auszuwählen.</translation>

View file

@ -1056,10 +1056,6 @@
<source>L3</source>
<translation type="unfinished">L3</translation>
</message>
<message>
<source>Touchpad Click</source>
<translation type="unfinished">Touchpad Click</translation>
</message>
<message>
<source>Mouse to Joystick</source>
<translation type="unfinished">Mouse to Joystick</translation>
@ -1152,10 +1148,6 @@
<source>Unable to Save</source>
<translation type="unfinished">Unable to Save</translation>
</message>
<message>
<source>Cannot bind any unique input more than once</source>
<translation type="unfinished">Cannot bind any unique input more than once</translation>
</message>
<message>
<source>Press a key</source>
<translation type="unfinished">Press a key</translation>
@ -1184,6 +1176,26 @@
<source>Cancel</source>
<translation type="unfinished">Cancel</translation>
</message>
<message>
<source>Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons:
%1</source>
<translation type="unfinished">Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons:
%1</translation>
</message>
<message>
<source>Touchpad Left</source>
<translation type="unfinished">Touchpad Left</translation>
</message>
<message>
<source>Touchpad Center</source>
<translation type="unfinished">Touchpad Center</translation>
</message>
<message>
<source>Touchpad Right</source>
<translation type="unfinished">Touchpad Right</translation>
</message>
</context>
<context>
<name>MainWindow</name>
@ -1542,10 +1554,6 @@
<source>Controller</source>
<translation type="unfinished">Controller</translation>
</message>
<message>
<source>Back Button Behavior</source>
<translation>Συμπεριφορά κουμπιού επιστροφής</translation>
</message>
<message>
<source>Graphics</source>
<translation type="unfinished">Graphics</translation>
@ -1782,10 +1790,6 @@
<source>Hide Idle Cursor Timeout:\nThe duration (seconds) after which the cursor that has been idle hides itself.</source>
<translation>Ορίστε έναν χρόνο για να εξαφανιστεί το ποντίκι μετά από αδράνεια.</translation>
</message>
<message>
<source>Back Button Behavior:\nSets the controller&apos;s back button to emulate tapping the specified position on the PS4 touchpad.</source>
<translation>Συμπεριφορά Κουμπιού Επιστροφής:\nΟρίζει το κουμπί επιστροφής του ελεγκτή να προσομοιώνει το πάτημα της καθορισμένης θέσης στην οθόνη αφής PS4.</translation>
</message>
<message>
<source>Display Compatibility Data:\nDisplays game compatibility information in table view. Enable &quot;Update Compatibility On Startup&quot; to get up-to-date information.</source>
<translation type="unfinished">Display Compatibility Data:\nDisplays game compatibility information in table view. Enable &quot;Update Compatibility On Startup&quot; to get up-to-date information.</translation>
@ -1810,22 +1814,6 @@
<source>Always</source>
<translation>Πάντα</translation>
</message>
<message>
<source>Touchpad Left</source>
<translation>Touchpad Αριστερά</translation>
</message>
<message>
<source>Touchpad Right</source>
<translation>Touchpad Δεξιά</translation>
</message>
<message>
<source>Touchpad Center</source>
<translation>Κέντρο Touchpad</translation>
</message>
<message>
<source>None</source>
<translation>Κανένα</translation>
</message>
<message>
<source>Graphics Device:\nOn multiple GPU systems, select the GPU the emulator will use from the drop down list,\nor select &quot;Auto Select&quot; to automatically determine it.</source>
<translation>Προσαρμογέας Γραφικών:\nΣε συστήματα με πολλές GPU, επιλέξτε από το μενού την GPU που θα χρησιμοποιήσει ο εξομοιωτής,\ επιλέξτε &quot;Auto Select&quot; για αυτόματη επιλογή.</translation>

View file

@ -1056,10 +1056,6 @@
<source>L3</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Touchpad Click</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Mouse to Joystick</source>
<translation type="unfinished"></translation>
@ -1152,10 +1148,6 @@
<source>Unable to Save</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Cannot bind any unique input more than once</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Press a key</source>
<translation type="unfinished"></translation>
@ -1184,6 +1176,24 @@
<source>Cancel</source>
<translation type="unfinished">Cancel</translation>
</message>
<message>
<source>Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons:
%1</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Touchpad Left</source>
<translation type="unfinished">Touchpad Left</translation>
</message>
<message>
<source>Touchpad Center</source>
<translation type="unfinished">Touchpad Center</translation>
</message>
<message>
<source>Touchpad Right</source>
<translation type="unfinished">Touchpad Right</translation>
</message>
</context>
<context>
<name>MainWindow</name>
@ -1542,10 +1552,6 @@
<source>Controller</source>
<translation>Controller</translation>
</message>
<message>
<source>Back Button Behavior</source>
<translation>Back Button Behavior</translation>
</message>
<message>
<source>Graphics</source>
<translation>Graphics</translation>
@ -1782,10 +1788,6 @@
<source>Hide Idle Cursor Timeout:\nThe duration (seconds) after which the cursor that has been idle hides itself.</source>
<translation>Hide Idle Cursor Timeout:\nThe duration (seconds) after which the cursor that has been idle hides itself.</translation>
</message>
<message>
<source>Back Button Behavior:\nSets the controller&apos;s back button to emulate tapping the specified position on the PS4 touchpad.</source>
<translation>Back Button Behavior:\nSets the controller&apos;s back button to emulate tapping the specified position on the PS4 touchpad.</translation>
</message>
<message>
<source>Display Compatibility Data:\nDisplays game compatibility information in table view. Enable &quot;Update Compatibility On Startup&quot; to get up-to-date information.</source>
<translation>Display Compatibility Data:\nDisplays game compatibility information in table view. Enable &quot;Update Compatibility On Startup&quot; to get up-to-date information.</translation>
@ -1810,22 +1812,6 @@
<source>Always</source>
<translation>Always</translation>
</message>
<message>
<source>Touchpad Left</source>
<translation>Touchpad Left</translation>
</message>
<message>
<source>Touchpad Right</source>
<translation>Touchpad Right</translation>
</message>
<message>
<source>Touchpad Center</source>
<translation>Touchpad Center</translation>
</message>
<message>
<source>None</source>
<translation>None</translation>
</message>
<message>
<source>Graphics Device:\nOn multiple GPU systems, select the GPU the emulator will use from the drop down list,\nor select &quot;Auto Select&quot; to automatically determine it.</source>
<translation>Graphics Device:\nOn multiple GPU systems, select the GPU the emulator will use from the drop down list,\nor select &quot;Auto Select&quot; to automatically determine it.</translation>

View file

@ -1056,10 +1056,6 @@
<source>L3</source>
<translation>L3</translation>
</message>
<message>
<source>Touchpad Click</source>
<translation>Clic de pantalla táctil</translation>
</message>
<message>
<source>Mouse to Joystick</source>
<translation>Ratón a Joystick</translation>
@ -1152,10 +1148,6 @@
<source>Unable to Save</source>
<translation>No se Pudo Guardar</translation>
</message>
<message>
<source>Cannot bind any unique input more than once</source>
<translation>No se puede vincular ninguna entrada única más de una vez</translation>
</message>
<message>
<source>Press a key</source>
<translation>Pulsa una tecla</translation>
@ -1184,6 +1176,26 @@
<source>Cancel</source>
<translation>Cancelar</translation>
</message>
<message>
<source>Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons:
%1</source>
<translation type="unfinished">Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons:
%1</translation>
</message>
<message>
<source>Touchpad Left</source>
<translation type="unfinished">Touchpad Left</translation>
</message>
<message>
<source>Touchpad Center</source>
<translation type="unfinished">Touchpad Center</translation>
</message>
<message>
<source>Touchpad Right</source>
<translation type="unfinished">Touchpad Right</translation>
</message>
</context>
<context>
<name>MainWindow</name>
@ -1542,10 +1554,6 @@
<source>Controller</source>
<translation>Controlador</translation>
</message>
<message>
<source>Back Button Behavior</source>
<translation>Comportamiento del Botón de Retroceso</translation>
</message>
<message>
<source>Graphics</source>
<translation>Gráficos</translation>
@ -1782,10 +1790,6 @@
<source>Hide Idle Cursor Timeout:\nThe duration (seconds) after which the cursor that has been idle hides itself.</source>
<translation>Establezca un tiempo para que el ratón desaparezca después de estar inactivo.</translation>
</message>
<message>
<source>Back Button Behavior:\nSets the controller&apos;s back button to emulate tapping the specified position on the PS4 touchpad.</source>
<translation>Comportamiento del Botón Atrás:\nEstablece el botón atrás del controlador para emular el toque en la posición especificada en el touchpad del PS4.</translation>
</message>
<message>
<source>Display Compatibility Data:\nDisplays game compatibility information in table view. Enable &quot;Update Compatibility On Startup&quot; to get up-to-date information.</source>
<translation>Mostrar Datos de Compatibilidad:\nMuestra información de compatibilidad de juegos en vista de tabla. Habilite &quot;Actualizar Compatibilidad al Iniciar&quot; para obtener información actualizada.</translation>
@ -1810,22 +1814,6 @@
<source>Always</source>
<translation>Siempre</translation>
</message>
<message>
<source>Touchpad Left</source>
<translation>Touchpad Izquierda</translation>
</message>
<message>
<source>Touchpad Right</source>
<translation>Touchpad Derecha</translation>
</message>
<message>
<source>Touchpad Center</source>
<translation>Centro del Touchpad</translation>
</message>
<message>
<source>None</source>
<translation>Ninguno</translation>
</message>
<message>
<source>Graphics Device:\nOn multiple GPU systems, select the GPU the emulator will use from the drop down list,\nor select &quot;Auto Select&quot; to automatically determine it.</source>
<translation>Dispositivo Gráfico:\nEn sistemas con múltiples GPU, selecciona la GPU que el emulador utilizará de la lista desplegable,\o selecciona &quot;Auto Select&quot; para determinarla automáticamente.</translation>

View file

@ -26,7 +26,7 @@
</message>
<message>
<source>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:\n</source>
<translation type="unfinished">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:\n</translation>
<translation>تقلبها/پچها آزمایشی هستند.\n با احتیاط استفاده کنید.\n\n با انتخاب مخزن و کلیک روی دکمه دانلود، تقلبها را بهصورت جداگانه دانلود کنید.\n در تب پچها، میتوانید همه پچها را بهطور همزمان دانلود کنید، انتخاب کنید که میخواهید از کدام استفاده کنید و انتخاب خود را ذخیره کنید.\n\n از آنجایی که ما تقلبها/پچها را توسعه نمیدهیم،\n لطفاً مشکلات را به نویسنده تقلب گزارش دهید.\n\n تقلب جدیدی ایجاد کردهاید؟ به این صفحه مراجعه کنید: \n</translation>
</message>
<message>
<source>No Image Available</source>
@ -214,7 +214,7 @@
</message>
<message>
<source>XML ERROR:</source>
<translation type="unfinished">XML ERROR:</translation>
<translation>XML خطای :</translation>
</message>
<message>
<source>Failed to open files.json for writing</source>
@ -407,43 +407,43 @@
<name>ControlSettings</name>
<message>
<source>Configure Controls</source>
<translation type="unfinished">Configure Controls</translation>
<translation>پیکربندی دسته ها</translation>
</message>
<message>
<source>D-Pad</source>
<translation type="unfinished">D-Pad</translation>
<translation>D-Pad</translation>
</message>
<message>
<source>Up</source>
<translation type="unfinished">Up</translation>
<translation>بالا</translation>
</message>
<message>
<source>Left</source>
<translation type="unfinished">Left</translation>
<translation>چپ</translation>
</message>
<message>
<source>Right</source>
<translation type="unfinished">Right</translation>
<translation>راست</translation>
</message>
<message>
<source>Down</source>
<translation type="unfinished">Down</translation>
<translation>پایین</translation>
</message>
<message>
<source>Left Stick Deadzone (def:2 max:127)</source>
<translation type="unfinished">Left Stick Deadzone (def:2 max:127)</translation>
<translation>منطقهی حساس به حرکت چپ (def:2 max:127)</translation>
</message>
<message>
<source>Left Deadzone</source>
<translation type="unfinished">Left Deadzone</translation>
<translation>منطقه مرده چپ</translation>
</message>
<message>
<source>Left Stick</source>
<translation type="unfinished">Left Stick</translation>
<translation>جواستیک چپ</translation>
</message>
<message>
<source>Config Selection</source>
<translation type="unfinished">Config Selection</translation>
<translation>انتخاب پیکربندی</translation>
</message>
<message>
<source>Common Config</source>
@ -451,7 +451,7 @@
</message>
<message>
<source>Use per-game configs</source>
<translation type="unfinished">Use per-game configs</translation>
<translation>از پیکربندیهای مخصوص هر بازی استفاده کنید</translation>
</message>
<message>
<source>L1 / LB</source>
@ -483,7 +483,7 @@
</message>
<message>
<source>R3</source>
<translation type="unfinished">R3</translation>
<translation>R3</translation>
</message>
<message>
<source>Face Buttons</source>
@ -491,7 +491,7 @@
</message>
<message>
<source>Triangle / Y</source>
<translation type="unfinished">Triangle / Y</translation>
<translation>مثلث / Y</translation>
</message>
<message>
<source>Square / X</source>
@ -531,7 +531,7 @@
</message>
<message>
<source>B:</source>
<translation type="unfinished">B:</translation>
<translation>B:</translation>
</message>
<message>
<source>Override Lightbar Color</source>
@ -543,7 +543,7 @@
</message>
<message>
<source>Unable to Save</source>
<translation type="unfinished">Unable to Save</translation>
<translation>ذخیره امکان پذیر نیست</translation>
</message>
<message>
<source>Cannot bind axis values more than once</source>
@ -570,7 +570,7 @@
<name>EditorDialog</name>
<message>
<source>Edit Keyboard + Mouse and Controller input bindings</source>
<translation type="unfinished">Edit Keyboard + Mouse and Controller input bindings</translation>
<translation>تغییر دکمه های کیبرد + ماوس و دسته</translation>
</message>
<message>
<source>Use Per-Game configs</source>
@ -582,7 +582,7 @@
</message>
<message>
<source>Could not open the file for reading</source>
<translation type="unfinished">Could not open the file for reading</translation>
<translation>نمی تواند فایل را برای خواندن باز کند</translation>
</message>
<message>
<source>Could not open the file for writing</source>
@ -602,7 +602,7 @@
</message>
<message>
<source>Do you want to reset your custom default config to the original default config?</source>
<translation type="unfinished">Do you want to reset your custom default config to the original default config?</translation>
<translation>آیا میخواهید پیکربندی سفارشی خود را به پیکربندی پیشفرض اصلی بازگردانید ؟</translation>
</message>
<message>
<source>Do you want to reset this config to your custom default config?</source>
@ -860,7 +860,7 @@
</message>
<message>
<source>View report</source>
<translation type="unfinished">View report</translation>
<translation>مشاهده گزارش</translation>
</message>
<message>
<source>Submit a report</source>
@ -916,11 +916,11 @@
</message>
<message>
<source>Delete Save Data</source>
<translation type="unfinished">Delete Save Data</translation>
<translation>پاک کردن داده های ذخیره شده</translation>
</message>
<message>
<source>This game has no update folder to open!</source>
<translation type="unfinished">This game has no update folder to open!</translation>
<translation>این بازی هیچ پوشهی بهروزرسانی برای باز کردن ندارد!</translation>
</message>
<message>
<source>No log file found for this game!</source>
@ -948,7 +948,7 @@
</message>
<message>
<source>SFO Viewer for </source>
<translation type="unfinished">SFO Viewer for </translation>
<translation>SFO مشاهده </translation>
</message>
</context>
<context>
@ -986,7 +986,7 @@
</message>
<message>
<source>Up</source>
<translation type="unfinished">Up</translation>
<translation/>
</message>
<message>
<source>unmapped</source>
@ -1056,10 +1056,6 @@
<source>L3</source>
<translation type="unfinished">L3</translation>
</message>
<message>
<source>Touchpad Click</source>
<translation type="unfinished">Touchpad Click</translation>
</message>
<message>
<source>Mouse to Joystick</source>
<translation type="unfinished">Mouse to Joystick</translation>
@ -1078,7 +1074,7 @@
</message>
<message>
<source>Mouse Movement Parameters</source>
<translation type="unfinished">Mouse Movement Parameters</translation>
<translation/>
</message>
<message>
<source>note: click Help Button/Special Keybindings for more information</source>
@ -1102,7 +1098,7 @@
</message>
<message>
<source>Cross</source>
<translation type="unfinished">Cross</translation>
<translation>ضربدر</translation>
</message>
<message>
<source>Right Analog Halfmode</source>
@ -1122,7 +1118,7 @@
</message>
<message>
<source>Copy from Common Config</source>
<translation type="unfinished">Copy from Common Config</translation>
<translation>کپی از پیکربندی مشترک</translation>
</message>
<message>
<source>Deadzone Offset (def 0.50):</source>
@ -1130,32 +1126,28 @@
</message>
<message>
<source>Speed Multiplier (def 1.0):</source>
<translation type="unfinished">Speed Multiplier (def 1.0):</translation>
<translation>ضریب سرعت (def 1.0):</translation>
</message>
<message>
<source>Common Config Selected</source>
<translation type="unfinished">Common Config Selected</translation>
<translation>پیکربندی مشترک انتخاب شده</translation>
</message>
<message>
<source>This button copies mappings from the Common Config to the currently selected profile, and cannot be used when the currently selected profile is the Common Config.</source>
<translation type="unfinished">This button copies mappings from the Common Config to the currently selected profile, and cannot be used when the currently selected profile is the Common Config.</translation>
<translation>این دکمه نگاشتها را از پیکربندی مشترک به پروفایل انتخابشدهی فعلی کپی میکند و وقتی پروفایل انتخابشدهی فعلی پیکربندی مشترک باشد، نمیتوان از آن استفاده کرد.</translation>
</message>
<message>
<source>Copy values from Common Config</source>
<translation type="unfinished">Copy values from Common Config</translation>
<translation>کپی کردن مقادیر از پیکربندی مشترک</translation>
</message>
<message>
<source>Do you want to overwrite existing mappings with the mappings from the Common Config?</source>
<translation type="unfinished">Do you want to overwrite existing mappings with the mappings from the Common Config?</translation>
<translation>آیا میخواهید نگاشتهای موجود را با نگاشتهای پیکربندی مشترک جایگزین کنید؟</translation>
</message>
<message>
<source>Unable to Save</source>
<translation type="unfinished">Unable to Save</translation>
</message>
<message>
<source>Cannot bind any unique input more than once</source>
<translation type="unfinished">Cannot bind any unique input more than once</translation>
</message>
<message>
<source>Press a key</source>
<translation type="unfinished">Press a key</translation>
@ -1170,7 +1162,7 @@
</message>
<message>
<source>Save</source>
<translation type="unfinished">Save</translation>
<translation>ذخیرهسازی</translation>
</message>
<message>
<source>Apply</source>
@ -1184,6 +1176,26 @@
<source>Cancel</source>
<translation type="unfinished">Cancel</translation>
</message>
<message>
<source>Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons:
%1</source>
<translation type="unfinished">Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons:
%1</translation>
</message>
<message>
<source>Touchpad Left</source>
<translation type="unfinished">Touchpad Left</translation>
</message>
<message>
<source>Touchpad Center</source>
<translation type="unfinished">Touchpad Center</translation>
</message>
<message>
<source>Touchpad Right</source>
<translation type="unfinished">Touchpad Right</translation>
</message>
</context>
<context>
<name>MainWindow</name>
@ -1213,7 +1225,7 @@
</message>
<message>
<source>Open shadPS4 Folder</source>
<translation type="unfinished">Open shadPS4 Folder</translation>
<translation>پوشه shadPS4 را باز کنید</translation>
</message>
<message>
<source>Exit</source>
@ -1542,10 +1554,6 @@
<source>Controller</source>
<translation>دسته بازی</translation>
</message>
<message>
<source>Back Button Behavior</source>
<translation>رفتار دکمه بازگشت</translation>
</message>
<message>
<source>Graphics</source>
<translation>گرافیک</translation>
@ -1624,7 +1632,7 @@
</message>
<message>
<source>Collect Shaders</source>
<translation type="unfinished">Collect Shaders</translation>
<translation>جمع آوری شیدرها</translation>
</message>
<message>
<source>Copy GPU Buffers</source>
@ -1664,7 +1672,7 @@
</message>
<message>
<source>Title Music</source>
<translation type="unfinished">Title Music</translation>
<translation/>
</message>
<message>
<source>Disable Trophy Notification</source>
@ -1728,7 +1736,7 @@
</message>
<message>
<source>Console Language:\nSets the language that the PS4 game uses.\nIt&apos;s recommended to set this to a language the game supports, which will vary by region.</source>
<translation type="unfinished">Console Language:\nSets the language that the PS4 game uses.\nIt&apos;s recommended to set this to a language the game supports, which will vary by region.</translation>
<translation>زبان کنسول:\nزبانی را که بازی PS4 استفاده میکند تنظیم میکند.\nتوصیه میشود این را روی زبانی که بازی پشتیبانی میکند تنظیم کنید، که بسته به منطقه متفاوت خواهد بود.</translation>
</message>
<message>
<source>Emulator Language:\nSets the language of the emulator&apos;s user interface.</source>
@ -1748,7 +1756,7 @@
</message>
<message>
<source>Trophy Key:\nKey used to decrypt trophies. Must be obtained from your jailbroken console.\nMust contain only hex characters.</source>
<translation type="unfinished">Trophy Key:\nKey used to decrypt trophies. Must be obtained from your jailbroken console.\nMust contain only hex characters.</translation>
<translation>کلید تروفی:\و کلیدی که برای رمزگشایی تروفیها استفاده میشود. باید از کنسول جیلبریک شده شما دریافت شود.\باید فقط شامل کاراکترهای هگز باشد.</translation>
</message>
<message>
<source>Log Type:\nSets whether to synchronize the output of the log window for performance. May have adverse effects on emulation.</source>
@ -1756,7 +1764,7 @@
</message>
<message>
<source>Log Filter:\nFilters the log to only print specific information.\nExamples: &quot;Core:Trace&quot; &quot;Lib.Pad:Debug Common.Filesystem:Error&quot; &quot;*:Critical&quot;\nLevels: Trace, Debug, Info, Warning, Error, Critical - in this order, a specific level silences all levels preceding it in the list and logs every level after it.</source>
<translation type="unfinished">Log Filter:\nFilters the log to only print specific information.\nExamples: &quot;Core:Trace&quot; &quot;Lib.Pad:Debug Common.Filesystem:Error&quot; &quot;*:Critical&quot;\nLevels: Trace, Debug, Info, Warning, Error, Critical - in this order, a specific level silences all levels preceding it in the list and logs every level after it.</translation>
<translation>فیلتر گزارش:\nگزارش را فیلتر میکند تا فقط اطلاعات خاصی چاپ شود.\nمثالها: &quot;هسته:ردیابی&quot; &quot;Lib.Pad:اشکال‌زدایی Common.Filesystem:خطا&quot; &quot;*:بحرانی&quot;\nسطوح: ردیابی، اشکالزدایی، اطلاعات، هشدار، خطا، بحرانی - به این ترتیب، یک سطح خاص تمام سطوح قبل از خود را در لیست بیصدا میکند و هر سطح بعد از خود را ثبت میکند.</translation>
</message>
<message>
<source>Update:\nRelease: Official versions released every month that may be very outdated, but are more reliable and tested.\nNightly: Development versions that have all the latest features and fixes, but may contain bugs and are less stable.</source>
@ -1764,7 +1772,7 @@
</message>
<message>
<source>Background Image:\nControl the opacity of the game background image.</source>
<translation type="unfinished">Background Image:\nControl the opacity of the game background image.</translation>
<translation>تصویر پس‌زمینه: میزان شفافیت تصویر پسزمینه بازی را کنترل کنید.</translation>
</message>
<message>
<source>Play Title Music:\nIf a game supports it, enable playing special music when selecting the game in the GUI.</source>
@ -1782,10 +1790,6 @@
<source>Hide Idle Cursor Timeout:\nThe duration (seconds) after which the cursor that has been idle hides itself.</source>
<translation>زمانی را برای ناپدید شدن ماوس بعد از غیرفعالی تعیین کنید.</translation>
</message>
<message>
<source>Back Button Behavior:\nSets the controller&apos;s back button to emulate tapping the specified position on the PS4 touchpad.</source>
<translation>رفتار دکمه برگشت:\nدکمه برگشت کنترلر را طوری تنظیم می کند که ضربه زدن روی موقعیت مشخص شده روی صفحه لمسی PS4 را شبیه سازی کند.</translation>
</message>
<message>
<source>Display Compatibility Data:\nDisplays game compatibility information in table view. Enable &quot;Update Compatibility On Startup&quot; to get up-to-date information.</source>
<translation>نمایش دادههای سازگاری:\nاطلاعات سازگاری بازی را به صورت جدول نمایش میدهد. برای دریافت اطلاعات بهروز، گزینه &quot;بهروزرسانی سازگاری هنگام راهاندازی&quot; را فعال کنید.</translation>
@ -1810,22 +1814,6 @@
<source>Always</source>
<translation>همیشه</translation>
</message>
<message>
<source>Touchpad Left</source>
<translation>صفحه لمسی سمت چپ</translation>
</message>
<message>
<source>Touchpad Right</source>
<translation>صفحه لمسی سمت راست</translation>
</message>
<message>
<source>Touchpad Center</source>
<translation>مرکز صفحه لمسی</translation>
</message>
<message>
<source>None</source>
<translation>هیچ کدام</translation>
</message>
<message>
<source>Graphics Device:\nOn multiple GPU systems, select the GPU the emulator will use from the drop down list,\nor select &quot;Auto Select&quot; to automatically determine it.</source>
<translation>دستگاه گرافیکی:\nدر سیستمهای با چندین پردازنده گرافیکی، از فهرست کشویی، پردازنده گرافیکی که شبیهساز از آن استفاده میکند را انتخاب کنید، یا گزینه &quot;انتخاب خودکار&quot; را انتخاب کنید تا به طور خودکار تعیین شود.</translation>
@ -1844,11 +1832,11 @@
</message>
<message>
<source>Enable Null GPU:\nFor the sake of technical debugging, disables game rendering as if there were no graphics card.</source>
<translation type="unfinished">Enable Null GPU:\nFor the sake of technical debugging, disables game rendering as if there were no graphics card.</translation>
<translation>فعال کردن پردازنده گرافیکی خالی:\برای رفع اشکال فنی، رندر بازی را طوری غیرفعال کنید که انگار هیچ کارت گرافیکی وجود ندارد.</translation>
</message>
<message>
<source>Enable HDR:\nEnables HDR in games that support it.\nYour monitor must have support for the BT2020 PQ color space and the RGB10A2 swapchain format.</source>
<translation type="unfinished">Enable HDR:\nEnables HDR in games that support it.\nYour monitor must have support for the BT2020 PQ color space and the RGB10A2 swapchain format.</translation>
<translation>فعال کردن HDR و :\n این گزینه HDR را در بازیهایی که از آن پشتیبانی میکنند فعال میکند.\n مانیتور شما باید از فضای رنگی BT2020 PQ و فرمت swapchain RGB10A2 پشتیبانی کند.</translation>
</message>
<message>
<source>Game Folders:\nThe list of folders to check for installed games.</source>
@ -1860,7 +1848,7 @@
</message>
<message>
<source>Remove:\nRemove a folder from the list.</source>
<translation>حذف:\nیک پوشه را از لیست حذف کنید.</translation>
<translation>حذف:\n یک پوشه را از لیست حذف کنید.</translation>
</message>
<message>
<source>Enable Debug Dumping:\nSaves the import and export symbols and file header information of the currently running PS4 program to a directory.</source>
@ -1868,11 +1856,11 @@
</message>
<message>
<source>Enable Vulkan Validation Layers:\nEnables a system that validates the state of the Vulkan renderer and logs information about its internal state.\nThis will reduce performance and likely change the behavior of emulation.</source>
<translation type="unfinished">Enable Vulkan Validation Layers:\nEnables a system that validates the state of the Vulkan renderer and logs information about its internal state.\nThis will reduce performance and likely change the behavior of emulation.</translation>
<translation>فعال کردن لایههای اعتبارسنجی Vulkan: \nسیستمی را فعال میکند که وضعیت رندرکننده Vulkan را اعتبارسنجی کرده و اطلاعات مربوط به وضعیت داخلی آن را ثبت میکند.\n این کار باعث کاهش عملکرد و احتمالاً تغییر رفتار شبیهسازی میشود.</translation>
</message>
<message>
<source>Enable Vulkan Synchronization Validation:\nEnables a system that validates the timing of Vulkan rendering tasks.\nThis will reduce performance and likely change the behavior of emulation.</source>
<translation type="unfinished">Enable Vulkan Synchronization Validation:\nEnables a system that validates the timing of Vulkan rendering tasks.\nThis will reduce performance and likely change the behavior of emulation.</translation>
<translation>فعال کردن اعتبارسنجی همگامسازی Vulkan: \nسیستمی را فعال میکند که زمانبندی وظایف رندر Vulkan را اعتبارسنجی میکند.\n این کار باعث کاهش عملکرد و احتمالاً تغییر رفتار شبیهسازی میشود.</translation>
</message>
<message>
<source>Enable RenderDoc Debugging:\nIf enabled, the emulator will provide compatibility with Renderdoc to allow capture and analysis of the currently rendered frame.</source>
@ -1880,7 +1868,7 @@
</message>
<message>
<source>Collect Shaders:\nYou need this enabled to edit shaders with the debug menu (Ctrl + F10).</source>
<translation type="unfinished">Collect Shaders:\nYou need this enabled to edit shaders with the debug menu (Ctrl + F10).</translation>
<translation>جمعآوری سایهزنها:\n برای ویرایش سایهزنها با منوی اشکالزدایی (Ctrl + F10) باید این گزینه فعال باشد.</translation>
</message>
<message>
<source>Crash Diagnostics:\nCreates a .yaml file with info about the Vulkan state at the time of crashing.\nUseful for debugging &apos;Device lost&apos; errors. If you have this enabled, you should enable Host AND Guest Debug Markers.\nDoes not work on Intel GPUs.\nYou need Vulkan Validation Layers enabled and the Vulkan SDK for this to work.</source>
@ -1912,7 +1900,7 @@
</message>
<message>
<source>Nightly</source>
<translation type="unfinished">Nightly</translation>
<translation>اخرین نسخه شبانه</translation>
</message>
<message>
<source>Set the volume of the background music.</source>
@ -1936,7 +1924,7 @@
</message>
<message>
<source>sync</source>
<translation type="unfinished">sync</translation>
<translation>همزمان</translation>
</message>
<message>
<source>Auto Select</source>
@ -2000,7 +1988,7 @@
</message>
<message>
<source>Right</source>
<translation type="unfinished">Right</translation>
<translation>راست</translation>
</message>
<message>
<source>Top</source>
@ -2032,7 +2020,7 @@
</message>
<message>
<source>%1 already exists</source>
<translation type="unfinished">%1 already exists</translation>
<translation>%1 از قبل وجود دارد</translation>
</message>
<message>
<source>Portable user folder created</source>
@ -2044,7 +2032,7 @@
</message>
<message>
<source>Open the custom trophy images/sounds folder:\nYou can add custom images to the trophies and an audio.\nAdd the files to custom_trophy with the following names:\ntrophy.wav OR trophy.mp3, bronze.png, gold.png, platinum.png, silver.png\nNote: The sound will only work in QT versions.</source>
<translation type="unfinished">Open the custom trophy images/sounds folder:\nYou can add custom images to the trophies and an audio.\nAdd the files to custom_trophy with the following names:\ntrophy.wav OR trophy.mp3, bronze.png, gold.png, platinum.png, silver.png\nNote: The sound will only work in QT versions.</translation>
<translation>پوشه تصاویر/صداهای تروفی سفارشی را باز کنید:\n شما میتوانید تصاویر و صدای سفارشی به تروفیها اضافه کنید.\n فایلها را با نامهای زیر به custom_trophy اضافه کنید:\ntrophy.wav یا trophy.mp3، bronze.png، gold.png، platinum.png، silver.png \nتوجه: صدا فقط در نسخههای QT کار میکند.</translation>
</message>
<message>
<source> * Unsupported Vulkan Version</source>
@ -2075,7 +2063,7 @@
</message>
<message>
<source>Show Hidden Trophies</source>
<translation type="unfinished">Show Hidden Trophies</translation>
<translation>نمایش جوایز مخفی</translation>
</message>
</context>
</TS>

View file

@ -1056,10 +1056,6 @@
<source>L3</source>
<translation>L3</translation>
</message>
<message>
<source>Touchpad Click</source>
<translation>Kosketuslevyn Klikkaus</translation>
</message>
<message>
<source>Mouse to Joystick</source>
<translation>Hiiri Joystickinä</translation>
@ -1152,10 +1148,6 @@
<source>Unable to Save</source>
<translation type="unfinished">Unable to Save</translation>
</message>
<message>
<source>Cannot bind any unique input more than once</source>
<translation type="unfinished">Cannot bind any unique input more than once</translation>
</message>
<message>
<source>Press a key</source>
<translation type="unfinished">Press a key</translation>
@ -1184,6 +1176,26 @@
<source>Cancel</source>
<translation type="unfinished">Cancel</translation>
</message>
<message>
<source>Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons:
%1</source>
<translation type="unfinished">Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons:
%1</translation>
</message>
<message>
<source>Touchpad Left</source>
<translation type="unfinished">Touchpad Left</translation>
</message>
<message>
<source>Touchpad Center</source>
<translation type="unfinished">Touchpad Center</translation>
</message>
<message>
<source>Touchpad Right</source>
<translation type="unfinished">Touchpad Right</translation>
</message>
</context>
<context>
<name>MainWindow</name>
@ -1542,10 +1554,6 @@
<source>Controller</source>
<translation>Ohjain</translation>
</message>
<message>
<source>Back Button Behavior</source>
<translation>Takaisin-painikkeen Käyttäytyminen</translation>
</message>
<message>
<source>Graphics</source>
<translation>Grafiikka</translation>
@ -1782,10 +1790,6 @@
<source>Hide Idle Cursor Timeout:\nThe duration (seconds) after which the cursor that has been idle hides itself.</source>
<translation>Aseta aika, milloin hiiri häviää oltuaan aktiivinen.</translation>
</message>
<message>
<source>Back Button Behavior:\nSets the controller&apos;s back button to emulate tapping the specified position on the PS4 touchpad.</source>
<translation>Takaisin-napin käyttäytyminen:\nAsettaa ohjaimen takaisin-napin jäljittelemään kosketusta PS4:n kosketuslevyn määritettyyn kohtaan.</translation>
</message>
<message>
<source>Display Compatibility Data:\nDisplays game compatibility information in table view. Enable &quot;Update Compatibility On Startup&quot; to get up-to-date information.</source>
<translation>Näytä Yhteensopivuustiedot:\nNäyttää pelien yhteensopivuustiedot listanäkymässä. Ota käyttöön &quot;Päivitä Yhteensopivuustietokanta Käynnistäessä&quot; saadaksesi ajantasaista tietoa.</translation>
@ -1810,22 +1814,6 @@
<source>Always</source>
<translation>Aina</translation>
</message>
<message>
<source>Touchpad Left</source>
<translation>Kosketuslevyn Vasen Puoli</translation>
</message>
<message>
<source>Touchpad Right</source>
<translation>Kosketuslevyn Oikea Puoli</translation>
</message>
<message>
<source>Touchpad Center</source>
<translation>Kosketuslevyn Keskikohta</translation>
</message>
<message>
<source>None</source>
<translation>Ei mitään</translation>
</message>
<message>
<source>Graphics Device:\nOn multiple GPU systems, select the GPU the emulator will use from the drop down list,\nor select &quot;Auto Select&quot; to automatically determine it.</source>
<translation>Näytönohjain:\nUseamman näytönohjaimen järjestelmissä, valitse pudotusvalikosta, mitä näytönohjainta emulaattori käyttää,\n tai valitse &quot;Auto Select&quot; automaattiseen määritykseen.</translation>

View file

@ -1056,10 +1056,6 @@
<source>L3</source>
<translation>L3</translation>
</message>
<message>
<source>Touchpad Click</source>
<translation>Clic tactile</translation>
</message>
<message>
<source>Mouse to Joystick</source>
<translation>Souris vers Joystick</translation>
@ -1152,10 +1148,6 @@
<source>Unable to Save</source>
<translation>Impossible de sauvegarder</translation>
</message>
<message>
<source>Cannot bind any unique input more than once</source>
<translation>Impossible de lier une entrée unique plus d'une fois</translation>
</message>
<message>
<source>Press a key</source>
<translation>Appuyez sur un bouton</translation>
@ -1184,6 +1176,26 @@
<source>Cancel</source>
<translation>Annuler</translation>
</message>
<message>
<source>Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons:
%1</source>
<translation type="unfinished">Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons:
%1</translation>
</message>
<message>
<source>Touchpad Left</source>
<translation type="unfinished">Touchpad Left</translation>
</message>
<message>
<source>Touchpad Center</source>
<translation type="unfinished">Touchpad Center</translation>
</message>
<message>
<source>Touchpad Right</source>
<translation type="unfinished">Touchpad Right</translation>
</message>
</context>
<context>
<name>MainWindow</name>
@ -1542,10 +1554,6 @@
<source>Controller</source>
<translation>Manette</translation>
</message>
<message>
<source>Back Button Behavior</source>
<translation>Comportement du bouton retour</translation>
</message>
<message>
<source>Graphics</source>
<translation>Graphismes</translation>
@ -1782,10 +1790,6 @@
<source>Hide Idle Cursor Timeout:\nThe duration (seconds) after which the cursor that has been idle hides itself.</source>
<translation>Définissez un temps pour que la souris disparaisse après être inactif.</translation>
</message>
<message>
<source>Back Button Behavior:\nSets the controller&apos;s back button to emulate tapping the specified position on the PS4 touchpad.</source>
<translation>Comportement du bouton retour:\nDéfinit le bouton de retour de la manette pour imiter le toucher de la position spécifiée sur le pavé tactile PS4.</translation>
</message>
<message>
<source>Display Compatibility Data:\nDisplays game compatibility information in table view. Enable &quot;Update Compatibility On Startup&quot; to get up-to-date information.</source>
<translation>Afficher les données de compatibilité:\nAffiche les informations de compatibilité des jeux dans une colonne dédiée. Activez &quot;Mettre à jour la compatibilité au démarrage&quot; pour avoir des informations à jour.</translation>
@ -1810,22 +1814,6 @@
<source>Always</source>
<translation>Toujours</translation>
</message>
<message>
<source>Touchpad Left</source>
<translation>Pavé Tactile Gauche</translation>
</message>
<message>
<source>Touchpad Right</source>
<translation>Pavé Tactile Droit</translation>
</message>
<message>
<source>Touchpad Center</source>
<translation>Centre du Pavé Tactile</translation>
</message>
<message>
<source>None</source>
<translation>Aucun</translation>
</message>
<message>
<source>Graphics Device:\nOn multiple GPU systems, select the GPU the emulator will use from the drop down list,\nor select &quot;Auto Select&quot; to automatically determine it.</source>
<translation>Adaptateur graphique:\nSélectionnez le GPU que l&apos;émulateur utilisera dans les systèmes multi-GPU à partir de la liste déroulante,\nou choisissez &quot;Auto Select&quot; pour le déterminer automatiquement.</translation>

View file

@ -1056,10 +1056,6 @@
<source>L3</source>
<translation type="unfinished">L3</translation>
</message>
<message>
<source>Touchpad Click</source>
<translation type="unfinished">Touchpad Click</translation>
</message>
<message>
<source>Mouse to Joystick</source>
<translation type="unfinished">Mouse to Joystick</translation>
@ -1152,10 +1148,6 @@
<source>Unable to Save</source>
<translation type="unfinished">Unable to Save</translation>
</message>
<message>
<source>Cannot bind any unique input more than once</source>
<translation type="unfinished">Cannot bind any unique input more than once</translation>
</message>
<message>
<source>Press a key</source>
<translation type="unfinished">Press a key</translation>
@ -1184,6 +1176,26 @@
<source>Cancel</source>
<translation type="unfinished">Cancel</translation>
</message>
<message>
<source>Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons:
%1</source>
<translation type="unfinished">Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons:
%1</translation>
</message>
<message>
<source>Touchpad Left</source>
<translation type="unfinished">Touchpad Left</translation>
</message>
<message>
<source>Touchpad Center</source>
<translation type="unfinished">Touchpad Center</translation>
</message>
<message>
<source>Touchpad Right</source>
<translation type="unfinished">Touchpad Right</translation>
</message>
</context>
<context>
<name>MainWindow</name>
@ -1542,10 +1554,6 @@
<source>Controller</source>
<translation>Kontroller</translation>
</message>
<message>
<source>Back Button Behavior</source>
<translation>Vissza gomb Viselkedése</translation>
</message>
<message>
<source>Graphics</source>
<translation>Grafika</translation>
@ -1782,10 +1790,6 @@
<source>Hide Idle Cursor Timeout:\nThe duration (seconds) after which the cursor that has been idle hides itself.</source>
<translation>Állítson be egy időt, ami után egér inaktív állapotban eltűnik.</translation>
</message>
<message>
<source>Back Button Behavior:\nSets the controller&apos;s back button to emulate tapping the specified position on the PS4 touchpad.</source>
<translation>Vissza gomb viselkedés:\nBeállítja a vezérlő vissza gombját, hogy utánozza a PS4 érintőpadján megadott pozíció megérintését.</translation>
</message>
<message>
<source>Display Compatibility Data:\nDisplays game compatibility information in table view. Enable &quot;Update Compatibility On Startup&quot; to get up-to-date information.</source>
<translation type="unfinished">Display Compatibility Data:\nDisplays game compatibility information in table view. Enable &quot;Update Compatibility On Startup&quot; to get up-to-date information.</translation>
@ -1810,22 +1814,6 @@
<source>Always</source>
<translation>Mindig</translation>
</message>
<message>
<source>Touchpad Left</source>
<translation>Érintőpad Bal</translation>
</message>
<message>
<source>Touchpad Right</source>
<translation>Érintőpad Jobb</translation>
</message>
<message>
<source>Touchpad Center</source>
<translation>Érintőpad Közép</translation>
</message>
<message>
<source>None</source>
<translation>Semmi</translation>
</message>
<message>
<source>Graphics Device:\nOn multiple GPU systems, select the GPU the emulator will use from the drop down list,\nor select &quot;Auto Select&quot; to automatically determine it.</source>
<translation>Grafikus eszköz:\nTöbb GPU-s rendszereken válassza ki, melyik GPU-t használja az emulátor a legördülő listából,\nvagy válassza az &quot;Auto Select&quot; lehetőséget, hogy automatikusan kiválassza azt.</translation>

View file

@ -1056,10 +1056,6 @@
<source>L3</source>
<translation type="unfinished">L3</translation>
</message>
<message>
<source>Touchpad Click</source>
<translation type="unfinished">Touchpad Click</translation>
</message>
<message>
<source>Mouse to Joystick</source>
<translation type="unfinished">Mouse to Joystick</translation>
@ -1152,10 +1148,6 @@
<source>Unable to Save</source>
<translation type="unfinished">Unable to Save</translation>
</message>
<message>
<source>Cannot bind any unique input more than once</source>
<translation type="unfinished">Cannot bind any unique input more than once</translation>
</message>
<message>
<source>Press a key</source>
<translation type="unfinished">Press a key</translation>
@ -1184,6 +1176,26 @@
<source>Cancel</source>
<translation type="unfinished">Cancel</translation>
</message>
<message>
<source>Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons:
%1</source>
<translation type="unfinished">Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons:
%1</translation>
</message>
<message>
<source>Touchpad Left</source>
<translation type="unfinished">Touchpad Left</translation>
</message>
<message>
<source>Touchpad Center</source>
<translation type="unfinished">Touchpad Center</translation>
</message>
<message>
<source>Touchpad Right</source>
<translation type="unfinished">Touchpad Right</translation>
</message>
</context>
<context>
<name>MainWindow</name>
@ -1542,10 +1554,6 @@
<source>Controller</source>
<translation>Pengontrol</translation>
</message>
<message>
<source>Back Button Behavior</source>
<translation>Perilaku tombol kembali</translation>
</message>
<message>
<source>Graphics</source>
<translation type="unfinished">Graphics</translation>
@ -1782,10 +1790,6 @@
<source>Hide Idle Cursor Timeout:\nThe duration (seconds) after which the cursor that has been idle hides itself.</source>
<translation>Tetapkan waktu untuk mouse menghilang setelah tidak aktif.</translation>
</message>
<message>
<source>Back Button Behavior:\nSets the controller&apos;s back button to emulate tapping the specified position on the PS4 touchpad.</source>
<translation>Perilaku Tombol Kembali:\nMengatur tombol kembali pada pengontrol untuk meniru ketukan di posisi yang ditentukan di touchpad PS4.</translation>
</message>
<message>
<source>Display Compatibility Data:\nDisplays game compatibility information in table view. Enable &quot;Update Compatibility On Startup&quot; to get up-to-date information.</source>
<translation type="unfinished">Display Compatibility Data:\nDisplays game compatibility information in table view. Enable &quot;Update Compatibility On Startup&quot; to get up-to-date information.</translation>
@ -1810,22 +1814,6 @@
<source>Always</source>
<translation>Selalu</translation>
</message>
<message>
<source>Touchpad Left</source>
<translation>Touchpad Kiri</translation>
</message>
<message>
<source>Touchpad Right</source>
<translation>Touchpad Kanan</translation>
</message>
<message>
<source>Touchpad Center</source>
<translation>Pusat Touchpad</translation>
</message>
<message>
<source>None</source>
<translation>Tidak Ada</translation>
</message>
<message>
<source>Graphics Device:\nOn multiple GPU systems, select the GPU the emulator will use from the drop down list,\nor select &quot;Auto Select&quot; to automatically determine it.</source>
<translation>Perangkat Grafis:\nPada sistem GPU ganda, pilih GPU yang akan digunakan emulator dari daftar dropdown,\natau pilih &quot;Auto Select&quot; untuk menentukan secara otomatis.</translation>

View file

@ -1056,10 +1056,6 @@
<source>L3</source>
<translation>L3</translation>
</message>
<message>
<source>Touchpad Click</source>
<translation>Click Touchpad</translation>
</message>
<message>
<source>Mouse to Joystick</source>
<translation>Mouse a Joystick</translation>
@ -1152,10 +1148,6 @@
<source>Unable to Save</source>
<translation>Impossibile Salvare</translation>
</message>
<message>
<source>Cannot bind any unique input more than once</source>
<translation>Non è possibile associare qualsiasi input univoco più di una volta</translation>
</message>
<message>
<source>Press a key</source>
<translation>Premi un tasto</translation>
@ -1184,6 +1176,26 @@
<source>Cancel</source>
<translation>Annulla</translation>
</message>
<message>
<source>Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons:
%1</source>
<translation>Non è possibile associare più di una volta qualsiasi input univoco. Sono presenti input duplicati mappati ai seguenti pulsanti:
%1</translation>
</message>
<message>
<source>Touchpad Left</source>
<translation type="unfinished">Touchpad Left</translation>
</message>
<message>
<source>Touchpad Center</source>
<translation type="unfinished">Touchpad Center</translation>
</message>
<message>
<source>Touchpad Right</source>
<translation type="unfinished">Touchpad Right</translation>
</message>
</context>
<context>
<name>MainWindow</name>
@ -1542,10 +1554,6 @@
<source>Controller</source>
<translation>Controller</translation>
</message>
<message>
<source>Back Button Behavior</source>
<translation>Comportamento del pulsante Indietro</translation>
</message>
<message>
<source>Graphics</source>
<translation>Grafica</translation>
@ -1782,10 +1790,6 @@
<source>Hide Idle Cursor Timeout:\nThe duration (seconds) after which the cursor that has been idle hides itself.</source>
<translation>Imposta un tempo affinché il mouse scompaia dopo essere stato inattivo.</translation>
</message>
<message>
<source>Back Button Behavior:\nSets the controller&apos;s back button to emulate tapping the specified position on the PS4 touchpad.</source>
<translation>Comportamento del pulsante Indietro:\nImposta il pulsante Indietro del controller per emulare il tocco sulla posizione specificata sul touchpad PS4.</translation>
</message>
<message>
<source>Display Compatibility Data:\nDisplays game compatibility information in table view. Enable &quot;Update Compatibility On Startup&quot; to get up-to-date information.</source>
<translation>Mostra Dati Compatibilità:\nMostra informazioni sulla compatibilità del gioco nella visualizzazione lista. Abilita &quot;Aggiorna Compatiblità all&apos;Avvio&quot; per ottenere informazioni aggiornate.</translation>
@ -1810,22 +1814,6 @@
<source>Always</source>
<translation>Sempre</translation>
</message>
<message>
<source>Touchpad Left</source>
<translation>Touchpad Sinistra</translation>
</message>
<message>
<source>Touchpad Right</source>
<translation>Touchpad Destra</translation>
</message>
<message>
<source>Touchpad Center</source>
<translation>Centro del Touchpad</translation>
</message>
<message>
<source>None</source>
<translation>Nessuno</translation>
</message>
<message>
<source>Graphics Device:\nOn multiple GPU systems, select the GPU the emulator will use from the drop down list,\nor select &quot;Auto Select&quot; to automatically determine it.</source>
<translation>Dispositivo Grafico:\nIn sistemi con più GPU, seleziona la GPU che l&apos;emulatore utilizzerà dall&apos;elenco a discesa,\no seleziona &quot;Selezione Automatica&quot; per determinarlo automaticamente.</translation>

View file

@ -1056,10 +1056,6 @@
<source>L3</source>
<translation type="unfinished">L3</translation>
</message>
<message>
<source>Touchpad Click</source>
<translation type="unfinished">Touchpad Click</translation>
</message>
<message>
<source>Mouse to Joystick</source>
<translation type="unfinished">Mouse to Joystick</translation>
@ -1152,10 +1148,6 @@
<source>Unable to Save</source>
<translation type="unfinished">Unable to Save</translation>
</message>
<message>
<source>Cannot bind any unique input more than once</source>
<translation type="unfinished">Cannot bind any unique input more than once</translation>
</message>
<message>
<source>Press a key</source>
<translation type="unfinished">Press a key</translation>
@ -1184,6 +1176,26 @@
<source>Cancel</source>
<translation type="unfinished">Cancel</translation>
</message>
<message>
<source>Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons:
%1</source>
<translation type="unfinished">Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons:
%1</translation>
</message>
<message>
<source>Touchpad Left</source>
<translation type="unfinished">Touchpad Left</translation>
</message>
<message>
<source>Touchpad Center</source>
<translation type="unfinished">Touchpad Center</translation>
</message>
<message>
<source>Touchpad Right</source>
<translation type="unfinished">Touchpad Right</translation>
</message>
</context>
<context>
<name>MainWindow</name>
@ -1542,10 +1554,6 @@
<source>Controller</source>
<translation></translation>
</message>
<message>
<source>Back Button Behavior</source>
<translation></translation>
</message>
<message>
<source>Graphics</source>
<translation></translation>
@ -1782,10 +1790,6 @@
<source>Hide Idle Cursor Timeout:\nThe duration (seconds) after which the cursor that has been idle hides itself.</source>
<translation></translation>
</message>
<message>
<source>Back Button Behavior:\nSets the controller&apos;s back button to emulate tapping the specified position on the PS4 touchpad.</source>
<translation>:\nコントローラーの戻るボタンをPS4のタッチパッドの指定された位置をタッチするように設定します</translation>
</message>
<message>
<source>Display Compatibility Data:\nDisplays game compatibility information in table view. Enable &quot;Update Compatibility On Startup&quot; to get up-to-date information.</source>
<translation>:\nゲームの互換性に関する情報を表として表示します&quot;&quot; </translation>
@ -1810,22 +1814,6 @@
<source>Always</source>
<translation></translation>
</message>
<message>
<source>Touchpad Left</source>
<translation></translation>
</message>
<message>
<source>Touchpad Right</source>
<translation></translation>
</message>
<message>
<source>Touchpad Center</source>
<translation></translation>
</message>
<message>
<source>None</source>
<translation></translation>
</message>
<message>
<source>Graphics Device:\nOn multiple GPU systems, select the GPU the emulator will use from the drop down list,\nor select &quot;Auto Select&quot; to automatically determine it.</source>
<translation>:\nシステムに複数のGPUが搭載されている場合使GPUを選択するか\n</translation>

View file

@ -1056,10 +1056,6 @@
<source>L3</source>
<translation type="unfinished">L3</translation>
</message>
<message>
<source>Touchpad Click</source>
<translation type="unfinished">Touchpad Click</translation>
</message>
<message>
<source>Mouse to Joystick</source>
<translation type="unfinished">Mouse to Joystick</translation>
@ -1152,10 +1148,6 @@
<source>Unable to Save</source>
<translation type="unfinished">Unable to Save</translation>
</message>
<message>
<source>Cannot bind any unique input more than once</source>
<translation type="unfinished">Cannot bind any unique input more than once</translation>
</message>
<message>
<source>Press a key</source>
<translation type="unfinished">Press a key</translation>
@ -1184,6 +1176,26 @@
<source>Cancel</source>
<translation type="unfinished">Cancel</translation>
</message>
<message>
<source>Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons:
%1</source>
<translation type="unfinished">Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons:
%1</translation>
</message>
<message>
<source>Touchpad Left</source>
<translation type="unfinished">Touchpad Left</translation>
</message>
<message>
<source>Touchpad Center</source>
<translation type="unfinished">Touchpad Center</translation>
</message>
<message>
<source>Touchpad Right</source>
<translation type="unfinished">Touchpad Right</translation>
</message>
</context>
<context>
<name>MainWindow</name>
@ -1542,10 +1554,6 @@
<source>Controller</source>
<translation type="unfinished">Controller</translation>
</message>
<message>
<source>Back Button Behavior</source>
<translation type="unfinished">Back Button Behavior</translation>
</message>
<message>
<source>Graphics</source>
<translation type="unfinished">Graphics</translation>
@ -1782,10 +1790,6 @@
<source>Hide Idle Cursor Timeout:\nThe duration (seconds) after which the cursor that has been idle hides itself.</source>
<translation type="unfinished">Hide Idle Cursor Timeout:\nThe duration (seconds) after which the cursor that has been idle hides itself.</translation>
</message>
<message>
<source>Back Button Behavior:\nSets the controller&apos;s back button to emulate tapping the specified position on the PS4 touchpad.</source>
<translation type="unfinished">Back Button Behavior:\nSets the controller&apos;s back button to emulate tapping the specified position on the PS4 touchpad.</translation>
</message>
<message>
<source>Display Compatibility Data:\nDisplays game compatibility information in table view. Enable &quot;Update Compatibility On Startup&quot; to get up-to-date information.</source>
<translation type="unfinished">Display Compatibility Data:\nDisplays game compatibility information in table view. Enable &quot;Update Compatibility On Startup&quot; to get up-to-date information.</translation>
@ -1810,22 +1814,6 @@
<source>Always</source>
<translation type="unfinished">Always</translation>
</message>
<message>
<source>Touchpad Left</source>
<translation type="unfinished">Touchpad Left</translation>
</message>
<message>
<source>Touchpad Right</source>
<translation type="unfinished">Touchpad Right</translation>
</message>
<message>
<source>Touchpad Center</source>
<translation type="unfinished">Touchpad Center</translation>
</message>
<message>
<source>None</source>
<translation type="unfinished">None</translation>
</message>
<message>
<source>Graphics Device:\nOn multiple GPU systems, select the GPU the emulator will use from the drop down list,\nor select &quot;Auto Select&quot; to automatically determine it.</source>
<translation type="unfinished">Graphics Device:\nOn multiple GPU systems, select the GPU the emulator will use from the drop down list,\nor select &quot;Auto Select&quot; to automatically determine it.</translation>

View file

@ -1056,10 +1056,6 @@
<source>L3</source>
<translation type="unfinished">L3</translation>
</message>
<message>
<source>Touchpad Click</source>
<translation type="unfinished">Touchpad Click</translation>
</message>
<message>
<source>Mouse to Joystick</source>
<translation type="unfinished">Mouse to Joystick</translation>
@ -1152,10 +1148,6 @@
<source>Unable to Save</source>
<translation type="unfinished">Unable to Save</translation>
</message>
<message>
<source>Cannot bind any unique input more than once</source>
<translation type="unfinished">Cannot bind any unique input more than once</translation>
</message>
<message>
<source>Press a key</source>
<translation type="unfinished">Press a key</translation>
@ -1184,6 +1176,26 @@
<source>Cancel</source>
<translation type="unfinished">Cancel</translation>
</message>
<message>
<source>Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons:
%1</source>
<translation type="unfinished">Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons:
%1</translation>
</message>
<message>
<source>Touchpad Left</source>
<translation type="unfinished">Touchpad Left</translation>
</message>
<message>
<source>Touchpad Center</source>
<translation type="unfinished">Touchpad Center</translation>
</message>
<message>
<source>Touchpad Right</source>
<translation type="unfinished">Touchpad Right</translation>
</message>
</context>
<context>
<name>MainWindow</name>
@ -1542,10 +1554,6 @@
<source>Controller</source>
<translation>Valdiklis</translation>
</message>
<message>
<source>Back Button Behavior</source>
<translation>Atgal mygtuko elgsena</translation>
</message>
<message>
<source>Graphics</source>
<translation type="unfinished">Graphics</translation>
@ -1782,10 +1790,6 @@
<source>Hide Idle Cursor Timeout:\nThe duration (seconds) after which the cursor that has been idle hides itself.</source>
<translation>Slėpti tuščiosios eigos žymeklio skirtąjį laiką:\nTrukmė (sekundėmis), po kurios neaktyvus žymeklis pasislepia.</translation>
</message>
<message>
<source>Back Button Behavior:\nSets the controller&apos;s back button to emulate tapping the specified position on the PS4 touchpad.</source>
<translation>Atgal mygtuko elgesys:\nNustato valdiklio atgal mygtuką imituoti paspaudimą nurodytoje vietoje PS4 jutiklinėje plokštėje.</translation>
</message>
<message>
<source>Display Compatibility Data:\nDisplays game compatibility information in table view. Enable &quot;Update Compatibility On Startup&quot; to get up-to-date information.</source>
<translation type="unfinished">Display Compatibility Data:\nDisplays game compatibility information in table view. Enable &quot;Update Compatibility On Startup&quot; to get up-to-date information.</translation>
@ -1810,22 +1814,6 @@
<source>Always</source>
<translation>Visada</translation>
</message>
<message>
<source>Touchpad Left</source>
<translation>Jutiklinis Paviršius Kairėje</translation>
</message>
<message>
<source>Touchpad Right</source>
<translation>Jutiklinis Paviršius Dešinėje</translation>
</message>
<message>
<source>Touchpad Center</source>
<translation>Jutiklinis Paviršius Centre</translation>
</message>
<message>
<source>None</source>
<translation>Nieko</translation>
</message>
<message>
<source>Graphics Device:\nOn multiple GPU systems, select the GPU the emulator will use from the drop down list,\nor select &quot;Auto Select&quot; to automatically determine it.</source>
<translation>Grafikos įrenginys:\nDaugiagrafikėse sistemose pasirinkite GPU, kurį emuliatorius naudos išskleidžiamojo sąrašo,\n arba pasirinkite &quot;Auto Select&quot;, kad jis būtų nustatytas automatiškai.</translation>

View file

@ -337,7 +337,7 @@
</message>
<message>
<source>The update has been downloaded, press OK to install.</source>
<translation>Oppdateringen ble lastet ned, trykk OK for å installere.</translation>
<translation>Oppdateringen er lastet ned, trykk OK for å installere.</translation>
</message>
<message>
<source>Failed to save the update file at</source>
@ -990,7 +990,7 @@
</message>
<message>
<source>unmapped</source>
<translation>Ikke satt opp</translation>
<translation>Ikke tildelt</translation>
</message>
<message>
<source>Left</source>
@ -1056,10 +1056,6 @@
<source>L3</source>
<translation>L3</translation>
</message>
<message>
<source>Touchpad Click</source>
<translation>Berøringsplateknapp</translation>
</message>
<message>
<source>Mouse to Joystick</source>
<translation>Mus til styrespak</translation>
@ -1152,10 +1148,6 @@
<source>Unable to Save</source>
<translation>Klarte ikke lagre</translation>
</message>
<message>
<source>Cannot bind any unique input more than once</source>
<translation>Kan ikke tildele unike oppsett mer enn en gang</translation>
</message>
<message>
<source>Press a key</source>
<translation>Trykk en tast</translation>
@ -1184,6 +1176,26 @@
<source>Cancel</source>
<translation>Avbryt</translation>
</message>
<message>
<source>Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons:
%1</source>
<translation>Kan ikke tildele samme inndata mer enn én gang. Dupliserte inndata tildeles følgende taster:
%1</translation>
</message>
<message>
<source>Touchpad Left</source>
<translation type="unfinished">Touchpad Left</translation>
</message>
<message>
<source>Touchpad Center</source>
<translation type="unfinished">Touchpad Center</translation>
</message>
<message>
<source>Touchpad Right</source>
<translation type="unfinished">Touchpad Right</translation>
</message>
</context>
<context>
<name>MainWindow</name>
@ -1542,10 +1554,6 @@
<source>Controller</source>
<translation>Kontroller</translation>
</message>
<message>
<source>Back Button Behavior</source>
<translation>Tilbakeknapp atferd</translation>
</message>
<message>
<source>Graphics</source>
<translation>Grafikk</translation>
@ -1782,10 +1790,6 @@
<source>Hide Idle Cursor Timeout:\nThe duration (seconds) after which the cursor that has been idle hides itself.</source>
<translation>Sett en tid for når musepekeren forsvinner etter å ha vært inaktiv.</translation>
</message>
<message>
<source>Back Button Behavior:\nSets the controller&apos;s back button to emulate tapping the specified position on the PS4 touchpad.</source>
<translation>Atferd for tilbaketasten:\nSetter tilbaketasten kontrolleren til å imitere et trykk den angitte posisjonen PS4s berøringsplate.</translation>
</message>
<message>
<source>Display Compatibility Data:\nDisplays game compatibility information in table view. Enable &quot;Update Compatibility On Startup&quot; to get up-to-date information.</source>
<translation>Vis kompatibilitets-data:\nViser informasjon om spillkompatibilitet i tabellvisning. Bruk «Oppdater database ved oppstart» for oppdatert informasjon.</translation>
@ -1810,22 +1814,6 @@
<source>Always</source>
<translation>Alltid</translation>
</message>
<message>
<source>Touchpad Left</source>
<translation>Berøringsplate venstre</translation>
</message>
<message>
<source>Touchpad Right</source>
<translation>Berøringsplate høyre</translation>
</message>
<message>
<source>Touchpad Center</source>
<translation>Berøringsplate midten</translation>
</message>
<message>
<source>None</source>
<translation>Ingen</translation>
</message>
<message>
<source>Graphics Device:\nOn multiple GPU systems, select the GPU the emulator will use from the drop down list,\nor select &quot;Auto Select&quot; to automatically determine it.</source>
<translation>Grafikkenhet:\nSystemer med flere GPU-er, kan emulatoren velge hvilken enhet som skal brukes fra rullegardinlista,\neller bruk «Velg automatisk».</translation>

View file

@ -1056,10 +1056,6 @@
<source>L3</source>
<translation type="unfinished">L3</translation>
</message>
<message>
<source>Touchpad Click</source>
<translation type="unfinished">Touchpad Click</translation>
</message>
<message>
<source>Mouse to Joystick</source>
<translation type="unfinished">Mouse to Joystick</translation>
@ -1152,10 +1148,6 @@
<source>Unable to Save</source>
<translation type="unfinished">Unable to Save</translation>
</message>
<message>
<source>Cannot bind any unique input more than once</source>
<translation type="unfinished">Cannot bind any unique input more than once</translation>
</message>
<message>
<source>Press a key</source>
<translation type="unfinished">Press a key</translation>
@ -1184,6 +1176,26 @@
<source>Cancel</source>
<translation type="unfinished">Cancel</translation>
</message>
<message>
<source>Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons:
%1</source>
<translation type="unfinished">Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons:
%1</translation>
</message>
<message>
<source>Touchpad Left</source>
<translation type="unfinished">Touchpad Left</translation>
</message>
<message>
<source>Touchpad Center</source>
<translation type="unfinished">Touchpad Center</translation>
</message>
<message>
<source>Touchpad Right</source>
<translation type="unfinished">Touchpad Right</translation>
</message>
</context>
<context>
<name>MainWindow</name>
@ -1542,10 +1554,6 @@
<source>Controller</source>
<translation type="unfinished">Controller</translation>
</message>
<message>
<source>Back Button Behavior</source>
<translation>Achterknop gedrag</translation>
</message>
<message>
<source>Graphics</source>
<translation type="unfinished">Graphics</translation>
@ -1782,10 +1790,6 @@
<source>Hide Idle Cursor Timeout:\nThe duration (seconds) after which the cursor that has been idle hides itself.</source>
<translation>Stel een tijd in voor wanneer de muis verdwijnt na inactiviteit.</translation>
</message>
<message>
<source>Back Button Behavior:\nSets the controller&apos;s back button to emulate tapping the specified position on the PS4 touchpad.</source>
<translation>Gedrag van de terugknop:\nStelt de terugknop van de controller in om een aanraking op de opgegeven positie op de PS4-touchpad na te bootsen.</translation>
</message>
<message>
<source>Display Compatibility Data:\nDisplays game compatibility information in table view. Enable &quot;Update Compatibility On Startup&quot; to get up-to-date information.</source>
<translation type="unfinished">Display Compatibility Data:\nDisplays game compatibility information in table view. Enable &quot;Update Compatibility On Startup&quot; to get up-to-date information.</translation>
@ -1810,22 +1814,6 @@
<source>Always</source>
<translation>Altijd</translation>
</message>
<message>
<source>Touchpad Left</source>
<translation>Touchpad Links</translation>
</message>
<message>
<source>Touchpad Right</source>
<translation>Touchpad Rechts</translation>
</message>
<message>
<source>Touchpad Center</source>
<translation>Touchpad Midden</translation>
</message>
<message>
<source>None</source>
<translation>Geen</translation>
</message>
<message>
<source>Graphics Device:\nOn multiple GPU systems, select the GPU the emulator will use from the drop down list,\nor select &quot;Auto Select&quot; to automatically determine it.</source>
<translation>Grafische adapter:\nIn systemen met meerdere GPU&apos;s, kies de GPU die de emulator uit de vervolgkeuzelijst moet gebruiken,\nof kies &quot;Auto Select&quot; om dit automatisch in te stellen.</translation>

View file

@ -1056,10 +1056,6 @@
<source>L3</source>
<translation>L3</translation>
</message>
<message>
<source>Touchpad Click</source>
<translation>Kliknięcie Touchpada</translation>
</message>
<message>
<source>Mouse to Joystick</source>
<translation>Mysz na Joystick</translation>
@ -1152,10 +1148,6 @@
<source>Unable to Save</source>
<translation>Zapisywanie nie powiodło się</translation>
</message>
<message>
<source>Cannot bind any unique input more than once</source>
<translation>Nie można powiązać żadnych unikalnych danych wejściowych więcej niż raz</translation>
</message>
<message>
<source>Press a key</source>
<translation>Naciśnij klawisz</translation>
@ -1184,6 +1176,26 @@
<source>Cancel</source>
<translation>Anuluj</translation>
</message>
<message>
<source>Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons:
%1</source>
<translation type="unfinished">Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons:
%1</translation>
</message>
<message>
<source>Touchpad Left</source>
<translation type="unfinished">Touchpad Left</translation>
</message>
<message>
<source>Touchpad Center</source>
<translation type="unfinished">Touchpad Center</translation>
</message>
<message>
<source>Touchpad Right</source>
<translation type="unfinished">Touchpad Right</translation>
</message>
</context>
<context>
<name>MainWindow</name>
@ -1542,10 +1554,6 @@
<source>Controller</source>
<translation>Kontroler</translation>
</message>
<message>
<source>Back Button Behavior</source>
<translation>Zachowanie przycisku wstecz</translation>
</message>
<message>
<source>Graphics</source>
<translation>Grafika</translation>
@ -1782,10 +1790,6 @@
<source>Hide Idle Cursor Timeout:\nThe duration (seconds) after which the cursor that has been idle hides itself.</source>
<translation>Ustaw czas, po którym mysz zniknie po bezczynności.</translation>
</message>
<message>
<source>Back Button Behavior:\nSets the controller&apos;s back button to emulate tapping the specified position on the PS4 touchpad.</source>
<translation>Zachowanie przycisku Wstecz:\nUstawia przycisk Wstecz kontrolera tak, aby emulował dotknięcie określonego miejsca na panelu dotykowym PS4.</translation>
</message>
<message>
<source>Display Compatibility Data:\nDisplays game compatibility information in table view. Enable &quot;Update Compatibility On Startup&quot; to get up-to-date information.</source>
<translation>Wyświetl dane zgodności:\nWyświetla informacje o kompatybilności gry w widoku tabeli. Włącz opcję Aktualizuj zgodność przy uruchomieniu, aby uzyskać aktualne informacje.</translation>
@ -1810,22 +1814,6 @@
<source>Always</source>
<translation>Zawsze</translation>
</message>
<message>
<source>Touchpad Left</source>
<translation>Touchpad Lewy</translation>
</message>
<message>
<source>Touchpad Right</source>
<translation>Touchpad Prawy</translation>
</message>
<message>
<source>Touchpad Center</source>
<translation>Touchpad Środkowy</translation>
</message>
<message>
<source>None</source>
<translation>Brak</translation>
</message>
<message>
<source>Graphics Device:\nOn multiple GPU systems, select the GPU the emulator will use from the drop down list,\nor select &quot;Auto Select&quot; to automatically determine it.</source>
<translation>Urządzenie graficzne:\nW systemach z wieloma GPU, wybierz GPU, który emulator ma używać z rozwijanego menu,\n lub wybierz &quot;Auto Select&quot;, aby ustawić go automatycznie.</translation>

View file

@ -1056,10 +1056,6 @@
<source>L3</source>
<translation>L3</translation>
</message>
<message>
<source>Touchpad Click</source>
<translation>Clique do Touchpad</translation>
</message>
<message>
<source>Mouse to Joystick</source>
<translation>Mouse para Analógico</translation>
@ -1152,10 +1148,6 @@
<source>Unable to Save</source>
<translation>Não foi possível salvar</translation>
</message>
<message>
<source>Cannot bind any unique input more than once</source>
<translation>Não é possível vincular qualquer entrada única mais de uma vez</translation>
</message>
<message>
<source>Press a key</source>
<translation>Aperte uma tecla</translation>
@ -1184,6 +1176,26 @@
<source>Cancel</source>
<translation>Cancelar</translation>
</message>
<message>
<source>Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons:
%1</source>
<translation>Não é possível atribuir a mesma entrada mais de uma vez. Entradas duplicadas foram atribuídas aos seguintes botões:
%1</translation>
</message>
<message>
<source>Touchpad Left</source>
<translation>Touchpad Esquerdo</translation>
</message>
<message>
<source>Touchpad Center</source>
<translation>Centro do Touchpad</translation>
</message>
<message>
<source>Touchpad Right</source>
<translation>Touchpad Direito</translation>
</message>
</context>
<context>
<name>MainWindow</name>
@ -1542,10 +1554,6 @@
<source>Controller</source>
<translation>Controle</translation>
</message>
<message>
<source>Back Button Behavior</source>
<translation>Comportamento do Botão Voltar</translation>
</message>
<message>
<source>Graphics</source>
<translation>Gráficos</translation>
@ -1782,10 +1790,6 @@
<source>Hide Idle Cursor Timeout:\nThe duration (seconds) after which the cursor that has been idle hides itself.</source>
<translation>Tempo de Inatividade para Ocultar Cursor:\nDefina um tempo em segundos para o mouse desaparecer após ficar inativo.</translation>
</message>
<message>
<source>Back Button Behavior:\nSets the controller&apos;s back button to emulate tapping the specified position on the PS4 touchpad.</source>
<translation>Comportamento do Botão Voltar:\nDefine o botão voltar do controle para emular o toque na posição especificada no touchpad do PS4.</translation>
</message>
<message>
<source>Display Compatibility Data:\nDisplays game compatibility information in table view. Enable &quot;Update Compatibility On Startup&quot; to get up-to-date information.</source>
<translation>Exibir Dados de Compatibilidade:\nExibe informações de compatibilidade dos jogos na visualização de tabela.\nAtive &quot;Atualizar Compatibilidade ao Inicializar&quot; para obter informações atualizadas.</translation>
@ -1810,22 +1814,6 @@
<source>Always</source>
<translation>Sempre</translation>
</message>
<message>
<source>Touchpad Left</source>
<translation>Touchpad Esquerdo</translation>
</message>
<message>
<source>Touchpad Right</source>
<translation>Touchpad Direito</translation>
</message>
<message>
<source>Touchpad Center</source>
<translation>Centro do Touchpad</translation>
</message>
<message>
<source>None</source>
<translation>Nenhum</translation>
</message>
<message>
<source>Graphics Device:\nOn multiple GPU systems, select the GPU the emulator will use from the drop down list,\nor select &quot;Auto Select&quot; to automatically determine it.</source>
<translation>Placa de Vídeo:\nEm sistemas com múltiplas GPUs, escolha qual GPU o emulador utilizará da lista suspensa,\nou escolha &quot;Seleção Automática&quot; para escolher automaticamente o mesmo.</translation>
@ -2048,7 +2036,7 @@
</message>
<message>
<source> * Unsupported Vulkan Version</source>
<translation type="unfinished"> * Unsupported Vulkan Version</translation>
<translation> * Versão do Vulkan não suportada</translation>
</message>
</context>
<context>

View file

@ -1056,10 +1056,6 @@
<source>L3</source>
<translation>L3</translation>
</message>
<message>
<source>Touchpad Click</source>
<translation>Clique do Touchpad</translation>
</message>
<message>
<source>Mouse to Joystick</source>
<translation>Rato para Manípulo</translation>
@ -1152,10 +1148,6 @@
<source>Unable to Save</source>
<translation>Não foi possível guardar</translation>
</message>
<message>
<source>Cannot bind any unique input more than once</source>
<translation>Não é possível vincular qualquer entrada única mais de uma vez</translation>
</message>
<message>
<source>Press a key</source>
<translation>Pressione uma tecla</translation>
@ -1184,6 +1176,26 @@
<source>Cancel</source>
<translation>Cancelar</translation>
</message>
<message>
<source>Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons:
%1</source>
<translation type="unfinished">Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons:
%1</translation>
</message>
<message>
<source>Touchpad Left</source>
<translation type="unfinished">Touchpad Left</translation>
</message>
<message>
<source>Touchpad Center</source>
<translation type="unfinished">Touchpad Center</translation>
</message>
<message>
<source>Touchpad Right</source>
<translation type="unfinished">Touchpad Right</translation>
</message>
</context>
<context>
<name>MainWindow</name>
@ -1542,10 +1554,6 @@
<source>Controller</source>
<translation>Comando</translation>
</message>
<message>
<source>Back Button Behavior</source>
<translation>Comportamento do Botão Voltar</translation>
</message>
<message>
<source>Graphics</source>
<translation>Gráficos</translation>
@ -1782,10 +1790,6 @@
<source>Hide Idle Cursor Timeout:\nThe duration (seconds) after which the cursor that has been idle hides itself.</source>
<translation>Tempo de Espera para Ocultar o Cursor:\nDefine o tempo em segundos para o rato desaparecer após ficar inativo.</translation>
</message>
<message>
<source>Back Button Behavior:\nSets the controller&apos;s back button to emulate tapping the specified position on the PS4 touchpad.</source>
<translation>Comportamento do Botão Voltar:\nConfigura o botão Voltar do comando para emular um toque na posição especificada no touchpad do PS4.</translation>
</message>
<message>
<source>Display Compatibility Data:\nDisplays game compatibility information in table view. Enable &quot;Update Compatibility On Startup&quot; to get up-to-date information.</source>
<translation>Exibir Dados de Compatibilidade:\nExibe informações de compatibilidade dos jogos em visualização de tabela.\nAtivar &quot;Atualizar Base de Dados de Compatibilidade no Arranque&quot; para obter informações atualizadas.</translation>
@ -1810,22 +1814,6 @@
<source>Always</source>
<translation>Sempre</translation>
</message>
<message>
<source>Touchpad Left</source>
<translation>Esquerda do Touchpad</translation>
</message>
<message>
<source>Touchpad Right</source>
<translation>Direita do Touchpad</translation>
</message>
<message>
<source>Touchpad Center</source>
<translation>Centro do Touchpad</translation>
</message>
<message>
<source>None</source>
<translation>Nenhum</translation>
</message>
<message>
<source>Graphics Device:\nOn multiple GPU systems, select the GPU the emulator will use from the drop down list,\nor select &quot;Auto Select&quot; to automatically determine it.</source>
<translation>Placa Gráfica:\nEm sistemas com múltiplas GPUs, escolha qual GPU da lista o emulador utilizará,\nou escolha &quot;Seleção Automática&quot; para escolher automaticamente a mesma.</translation>

View file

@ -1056,10 +1056,6 @@
<source>L3</source>
<translation type="unfinished">L3</translation>
</message>
<message>
<source>Touchpad Click</source>
<translation type="unfinished">Touchpad Click</translation>
</message>
<message>
<source>Mouse to Joystick</source>
<translation type="unfinished">Mouse to Joystick</translation>
@ -1152,10 +1148,6 @@
<source>Unable to Save</source>
<translation type="unfinished">Unable to Save</translation>
</message>
<message>
<source>Cannot bind any unique input more than once</source>
<translation type="unfinished">Cannot bind any unique input more than once</translation>
</message>
<message>
<source>Press a key</source>
<translation type="unfinished">Press a key</translation>
@ -1184,6 +1176,26 @@
<source>Cancel</source>
<translation type="unfinished">Cancel</translation>
</message>
<message>
<source>Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons:
%1</source>
<translation type="unfinished">Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons:
%1</translation>
</message>
<message>
<source>Touchpad Left</source>
<translation type="unfinished">Touchpad Left</translation>
</message>
<message>
<source>Touchpad Center</source>
<translation type="unfinished">Touchpad Center</translation>
</message>
<message>
<source>Touchpad Right</source>
<translation type="unfinished">Touchpad Right</translation>
</message>
</context>
<context>
<name>MainWindow</name>
@ -1542,10 +1554,6 @@
<source>Controller</source>
<translation>Controler</translation>
</message>
<message>
<source>Back Button Behavior</source>
<translation>Comportament buton înapoi</translation>
</message>
<message>
<source>Graphics</source>
<translation type="unfinished">Graphics</translation>
@ -1782,10 +1790,6 @@
<source>Hide Idle Cursor Timeout:\nThe duration (seconds) after which the cursor that has been idle hides itself.</source>
<translation>Setați un timp pentru ca mouse-ul dispară după ce a fost inactiv.</translation>
</message>
<message>
<source>Back Button Behavior:\nSets the controller&apos;s back button to emulate tapping the specified position on the PS4 touchpad.</source>
<translation>Comportamentul butonului înapoi:\nSetează butonul înapoi al controlerului imite atingerea poziției specificate pe touchpad-ul PS4.</translation>
</message>
<message>
<source>Display Compatibility Data:\nDisplays game compatibility information in table view. Enable &quot;Update Compatibility On Startup&quot; to get up-to-date information.</source>
<translation type="unfinished">Display Compatibility Data:\nDisplays game compatibility information in table view. Enable &quot;Update Compatibility On Startup&quot; to get up-to-date information.</translation>
@ -1810,22 +1814,6 @@
<source>Always</source>
<translation>Întotdeauna</translation>
</message>
<message>
<source>Touchpad Left</source>
<translation>Touchpad Stânga</translation>
</message>
<message>
<source>Touchpad Right</source>
<translation>Touchpad Dreapta</translation>
</message>
<message>
<source>Touchpad Center</source>
<translation>Centru Touchpad</translation>
</message>
<message>
<source>None</source>
<translation>Niciunul</translation>
</message>
<message>
<source>Graphics Device:\nOn multiple GPU systems, select the GPU the emulator will use from the drop down list,\nor select &quot;Auto Select&quot; to automatically determine it.</source>
<translation>Dispozitiv grafic:\nPe sistemele cu mai multe GPU-uri, alege GPU-ul pe care emulatorul îl va folosi din lista derulantă,\nsau selectează &quot;Auto Select&quot; pentru a-l determina automat.</translation>

View file

@ -1056,10 +1056,6 @@
<source>L3</source>
<translation>L3</translation>
</message>
<message>
<source>Touchpad Click</source>
<translation>Нажатие на тачпад</translation>
</message>
<message>
<source>Mouse to Joystick</source>
<translation>Мышь в джойстик</translation>
@ -1138,7 +1134,7 @@
</message>
<message>
<source>This button copies mappings from the Common Config to the currently selected profile, and cannot be used when the currently selected profile is the Common Config.</source>
<translation>Эта кнопка копирует настройки из общего конфига в текущий выбранный профиль, и не может быть использован, когда выбранный профиль это общий конфиг.</translation>
<translation>Эта кнопка копирует настройки из общего конфига в текущий выбранный профиль, и не может быть использован, когда выбранный профиль - это общий конфиг.</translation>
</message>
<message>
<source>Copy values from Common Config</source>
@ -1152,10 +1148,6 @@
<source>Unable to Save</source>
<translation>Не удаётся сохранить</translation>
</message>
<message>
<source>Cannot bind any unique input more than once</source>
<translation>Невозможно привязать уникальный ввод более одного раза</translation>
</message>
<message>
<source>Press a key</source>
<translation>Нажмите кнопку</translation>
@ -1184,6 +1176,26 @@
<source>Cancel</source>
<translation>Отмена</translation>
</message>
<message>
<source>Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons:
%1</source>
<translation>Невозможно привязать уникальный ввод более одного раза. Дублированные вводы назначены на следующие кнопки:
%1</translation>
</message>
<message>
<source>Touchpad Left</source>
<translation>Тачпад слева</translation>
</message>
<message>
<source>Touchpad Center</source>
<translation>Тачпад центр</translation>
</message>
<message>
<source>Touchpad Right</source>
<translation>Тачпад справа</translation>
</message>
</context>
<context>
<name>MainWindow</name>
@ -1542,10 +1554,6 @@
<source>Controller</source>
<translation>Контроллер</translation>
</message>
<message>
<source>Back Button Behavior</source>
<translation>Поведение кнопки назад</translation>
</message>
<message>
<source>Graphics</source>
<translation>Графика</translation>
@ -1782,10 +1790,6 @@
<source>Hide Idle Cursor Timeout:\nThe duration (seconds) after which the cursor that has been idle hides itself.</source>
<translation>Время скрытия курсора при бездействии:\nВремя (в секундах), через которое курсор исчезнет при бездействии.</translation>
</message>
<message>
<source>Back Button Behavior:\nSets the controller&apos;s back button to emulate tapping the specified position on the PS4 touchpad.</source>
<translation>Поведение кнопки «Назад»:\nНастраивает кнопку «Назад» контроллера на эмуляцию нажатия на указанную область на сенсорной панели контроллера PS4.</translation>
</message>
<message>
<source>Display Compatibility Data:\nDisplays game compatibility information in table view. Enable &quot;Update Compatibility On Startup&quot; to get up-to-date information.</source>
<translation>Показывать данные совместимости:\оказывает информацию о совместимости игр в таблице. Включите «Обновлять базу совместимости при запуске» для получения актуальной информации.</translation>
@ -1810,22 +1814,6 @@
<source>Always</source>
<translation>Всегда</translation>
</message>
<message>
<source>Touchpad Left</source>
<translation>Тачпад слева</translation>
</message>
<message>
<source>Touchpad Right</source>
<translation>Тачпад справа</translation>
</message>
<message>
<source>Touchpad Center</source>
<translation>Центр тачпада</translation>
</message>
<message>
<source>None</source>
<translation>Нет</translation>
</message>
<message>
<source>Graphics Device:\nOn multiple GPU systems, select the GPU the emulator will use from the drop down list,\nor select &quot;Auto Select&quot; to automatically determine it.</source>
<translation>Графическое устройство:\nВ системах с несколькими GPU выберите тот, который будет использовать эмулятор.\nВыберите &quot;Автовыбор&quot;, чтобы определить GPU автоматически.</translation>

View file

@ -1056,10 +1056,6 @@
<source>L3</source>
<translation type="unfinished">L3</translation>
</message>
<message>
<source>Touchpad Click</source>
<translation type="unfinished">Touchpad Click</translation>
</message>
<message>
<source>Mouse to Joystick</source>
<translation type="unfinished">Mouse to Joystick</translation>
@ -1152,10 +1148,6 @@
<source>Unable to Save</source>
<translation type="unfinished">Unable to Save</translation>
</message>
<message>
<source>Cannot bind any unique input more than once</source>
<translation type="unfinished">Cannot bind any unique input more than once</translation>
</message>
<message>
<source>Press a key</source>
<translation type="unfinished">Press a key</translation>
@ -1184,6 +1176,26 @@
<source>Cancel</source>
<translation type="unfinished">Cancel</translation>
</message>
<message>
<source>Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons:
%1</source>
<translation type="unfinished">Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons:
%1</translation>
</message>
<message>
<source>Touchpad Left</source>
<translation type="unfinished">Touchpad Left</translation>
</message>
<message>
<source>Touchpad Center</source>
<translation type="unfinished">Touchpad Center</translation>
</message>
<message>
<source>Touchpad Right</source>
<translation type="unfinished">Touchpad Right</translation>
</message>
</context>
<context>
<name>MainWindow</name>
@ -1542,10 +1554,6 @@
<source>Controller</source>
<translation type="unfinished">Controller</translation>
</message>
<message>
<source>Back Button Behavior</source>
<translation type="unfinished">Back Button Behavior</translation>
</message>
<message>
<source>Graphics</source>
<translation type="unfinished">Graphics</translation>
@ -1782,10 +1790,6 @@
<source>Hide Idle Cursor Timeout:\nThe duration (seconds) after which the cursor that has been idle hides itself.</source>
<translation type="unfinished">Hide Idle Cursor Timeout:\nThe duration (seconds) after which the cursor that has been idle hides itself.</translation>
</message>
<message>
<source>Back Button Behavior:\nSets the controller&apos;s back button to emulate tapping the specified position on the PS4 touchpad.</source>
<translation type="unfinished">Back Button Behavior:\nSets the controller&apos;s back button to emulate tapping the specified position on the PS4 touchpad.</translation>
</message>
<message>
<source>Display Compatibility Data:\nDisplays game compatibility information in table view. Enable &quot;Update Compatibility On Startup&quot; to get up-to-date information.</source>
<translation type="unfinished">Display Compatibility Data:\nDisplays game compatibility information in table view. Enable &quot;Update Compatibility On Startup&quot; to get up-to-date information.</translation>
@ -1810,22 +1814,6 @@
<source>Always</source>
<translation type="unfinished">Always</translation>
</message>
<message>
<source>Touchpad Left</source>
<translation type="unfinished">Touchpad Left</translation>
</message>
<message>
<source>Touchpad Right</source>
<translation type="unfinished">Touchpad Right</translation>
</message>
<message>
<source>Touchpad Center</source>
<translation type="unfinished">Touchpad Center</translation>
</message>
<message>
<source>None</source>
<translation type="unfinished">None</translation>
</message>
<message>
<source>Graphics Device:\nOn multiple GPU systems, select the GPU the emulator will use from the drop down list,\nor select &quot;Auto Select&quot; to automatically determine it.</source>
<translation type="unfinished">Graphics Device:\nOn multiple GPU systems, select the GPU the emulator will use from the drop down list,\nor select &quot;Auto Select&quot; to automatically determine it.</translation>

View file

@ -1056,10 +1056,6 @@
<source>L3</source>
<translation>L3</translation>
</message>
<message>
<source>Touchpad Click</source>
<translation>Klikim i Panelit me Prekje</translation>
</message>
<message>
<source>Mouse to Joystick</source>
<translation>Miu Levë</translation>
@ -1152,10 +1148,6 @@
<source>Unable to Save</source>
<translation>Ruajtja Dështoi</translation>
</message>
<message>
<source>Cannot bind any unique input more than once</source>
<translation>Asnjë hyrje unike nuk mund caktohet shumë se një herë</translation>
</message>
<message>
<source>Press a key</source>
<translation>Shtyp një tast</translation>
@ -1184,6 +1176,26 @@
<source>Cancel</source>
<translation>Anulo</translation>
</message>
<message>
<source>Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons:
%1</source>
<translation>Nuk mund caktohet e njëjta hyrje unike shumë se një herë. Hyrjet e dublikuara janë caktuar butonët e mëposhtëm:
%1</translation>
</message>
<message>
<source>Touchpad Left</source>
<translation type="unfinished">Touchpad Left</translation>
</message>
<message>
<source>Touchpad Center</source>
<translation type="unfinished">Touchpad Center</translation>
</message>
<message>
<source>Touchpad Right</source>
<translation type="unfinished">Touchpad Right</translation>
</message>
</context>
<context>
<name>MainWindow</name>
@ -1542,10 +1554,6 @@
<source>Controller</source>
<translation>Dorezë</translation>
</message>
<message>
<source>Back Button Behavior</source>
<translation>Sjellja e butonit mbrapa</translation>
</message>
<message>
<source>Graphics</source>
<translation>Grafika</translation>
@ -1782,10 +1790,6 @@
<source>Hide Idle Cursor Timeout:\nThe duration (seconds) after which the cursor that has been idle hides itself.</source>
<translation>Koha për fshehjen e kursorit joaktiv:\nKohëzgjatja ( sekonda) pas cilës kursori nuk ka qënë veprim fshihet.</translation>
</message>
<message>
<source>Back Button Behavior:\nSets the controller&apos;s back button to emulate tapping the specified position on the PS4 touchpad.</source>
<translation>Sjellja e butonit mbrapa:\nLejon përcaktohet se cilën pjesë panelit me prekje dorezës do imitojë një prekje butoni mbrapa.</translation>
</message>
<message>
<source>Display Compatibility Data:\nDisplays game compatibility information in table view. Enable &quot;Update Compatibility On Startup&quot; to get up-to-date information.</source>
<translation>Shfaq dhënat e përputhshmërisë:\nShfaq informacionin e përputhshmërisë lojës formë tabele. Aktivizo &quot;Përditëso përputhshmërinë gjatë nisjes&quot; për marrë informacion përditësuar.</translation>
@ -1810,22 +1814,6 @@
<source>Always</source>
<translation>Gjithmonë</translation>
</message>
<message>
<source>Touchpad Left</source>
<translation>Paneli me Prekje Majtas</translation>
</message>
<message>
<source>Touchpad Right</source>
<translation>Paneli me Prekje Djathtas</translation>
</message>
<message>
<source>Touchpad Center</source>
<translation>Paneli me Prekje Qendër</translation>
</message>
<message>
<source>None</source>
<translation>Asnjë</translation>
</message>
<message>
<source>Graphics Device:\nOn multiple GPU systems, select the GPU the emulator will use from the drop down list,\nor select &quot;Auto Select&quot; to automatically determine it.</source>
<translation>Pajisja grafike:\nNë sistemet me GPU shumëfishta, zgjidh GPU- do përdorë emulatori nga lista rënëse,\nose zgjidh &quot;Auto Select&quot; për ta përcaktuar automatikisht.</translation>

File diff suppressed because it is too large Load diff

View file

@ -158,7 +158,7 @@
</message>
<message>
<source>No Cheats found for this game in this version of the selected repository,try another repository or a different version of the game.</source>
<translation>Inga fusk hittades för detta spel i denna version av det valda förrådet. Prova ett annat förråd eller en annan version av spelet</translation>
<translation>Inga fusk hittades för detta spel i denna version av det valda förrådet. Prova ett annat förråd eller en annan version av spelet.</translation>
</message>
<message>
<source>Cheats Downloaded Successfully</source>
@ -166,7 +166,7 @@
</message>
<message>
<source>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.</source>
<translation>Du har hämtat ner fusken för denna version av spelet från valt förråd. Du kan försöka att hämta från andra förråd, om de är tillgängliga kan det vara möjligt att använda det genom att välja det genom att välja filen från listan</translation>
<translation>Du har hämtat ner fusken för denna version av spelet från valt förråd. Du kan försöka att hämta från andra förråd, om de är tillgängliga kan det vara möjligt att använda det genom att välja det genom att välja filen från listan.</translation>
</message>
<message>
<source>Failed to save:</source>
@ -182,7 +182,7 @@
</message>
<message>
<source>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. If the patch does not appear, it may be that it does not exist for the specific serial and version of the game.</source>
<translation>Patchhämtningen är färdig! Alla patchar tillgängliga för alla spel har hämtats och de behövs inte hämtas individuellt för varje spel som med fusk. Om patchen inte dyker upp kan det bero att den inte finns för det specifika serienumret och versionen av spelet</translation>
<translation>Patchhämtningen är färdig! Alla patchar tillgängliga för alla spel har hämtats och de behövs inte hämtas individuellt för varje spel som med fusk. Om patchen inte dyker upp kan det bero att den inte finns för det specifika serienumret och versionen av spelet.</translation>
</message>
<message>
<source>Failed to parse JSON data from HTML.</source>
@ -261,7 +261,7 @@
</message>
<message>
<source>The Auto Updater allows up to 60 update checks per hour.\nYou have reached this limit. Please try again later.</source>
<translation>Den automatiska uppdateraren tillåter upp till 60 uppdateringskontroller per timme.\nDu har uppnått denna gräns. Försök igen senare</translation>
<translation>Den automatiska uppdateraren tillåter upp till 60 uppdateringskontroller per timme.\nDu har uppnått denna gräns. Försök igen senare.</translation>
</message>
<message>
<source>Failed to parse update information.</source>
@ -1056,10 +1056,6 @@
<source>L3</source>
<translation>L3</translation>
</message>
<message>
<source>Touchpad Click</source>
<translation>Klick styrplatta</translation>
</message>
<message>
<source>Mouse to Joystick</source>
<translation>Mus till styrspak</translation>
@ -1152,10 +1148,6 @@
<source>Unable to Save</source>
<translation>Kunde inte spara</translation>
</message>
<message>
<source>Cannot bind any unique input more than once</source>
<translation>Kan inte binda någon unik inmatning fler än en gång</translation>
</message>
<message>
<source>Press a key</source>
<translation>Tryck en tangent</translation>
@ -1184,6 +1176,26 @@
<source>Cancel</source>
<translation>Avbryt</translation>
</message>
<message>
<source>Cannot bind any unique input more than once. Duplicate inputs mapped to the following buttons:
%1</source>
<translation>Det går inte att binda samma unika inmatning mer än en gång. Dubbla inmatningar har mappats till följande knappar:
%1</translation>
</message>
<message>
<source>Touchpad Left</source>
<translation type="unfinished">Touchpad Left</translation>
</message>
<message>
<source>Touchpad Center</source>
<translation type="unfinished">Touchpad Center</translation>
</message>
<message>
<source>Touchpad Right</source>
<translation type="unfinished">Touchpad Right</translation>
</message>
</context>
<context>
<name>MainWindow</name>
@ -1542,10 +1554,6 @@
<source>Controller</source>
<translation>Handkontroller</translation>
</message>
<message>
<source>Back Button Behavior</source>
<translation>Beteende för bakåtknapp</translation>
</message>
<message>
<source>Graphics</source>
<translation>Grafik</translation>
@ -1728,47 +1736,47 @@
</message>
<message>
<source>Console Language:\nSets the language that the PS4 game uses.\nIt&apos;s recommended to set this to a language the game supports, which will vary by region.</source>
<translation>Konsollspråk:\nStäller in språket som PS4-spelet använder.\nDet rekommenderas att ställa in detta till ett språk som spelet har stöd för, vilket kan skilja sig mellan regioner</translation>
<translation>Konsollspråk:\nStäller in språket som PS4-spelet använder.\nDet rekommenderas att ställa in detta till ett språk som spelet har stöd för, vilket kan skilja sig mellan regioner.</translation>
</message>
<message>
<source>Emulator Language:\nSets the language of the emulator&apos;s user interface.</source>
<translation>Emulatorspråk:\nStäller in språket för emulatorns användargränssnitt</translation>
<translation>Emulatorspråk:\nStäller in språket för emulatorns användargränssnitt.</translation>
</message>
<message>
<source>Show Splash Screen:\nShows the game&apos;s splash screen (a special image) while the game is starting.</source>
<translation>Visa startskärm:\nVisar spelets startskärm (en speciell bild) när spelet startas</translation>
<translation>Visa startskärm:\nVisar spelets startskärm (en speciell bild) när spelet startas.</translation>
</message>
<message>
<source>Enable Discord Rich Presence:\nDisplays the emulator icon and relevant information on your Discord profile.</source>
<translation>Aktivera Discord Rich Presence:\nVisar emulatorikonen och relevant information din Discord-profil</translation>
<translation>Aktivera Discord Rich Presence:\nVisar emulatorikonen och relevant information din Discord-profil.</translation>
</message>
<message>
<source>Username:\nSets the PS4&apos;s account username, which may be displayed by some games.</source>
<translation>Användarnamn:\nStäller in PS4ans användarkonto, som kan visas av vissa spel</translation>
<translation>Användarnamn:\nStäller in PS4ans användarkonto, som kan visas av vissa spel.</translation>
</message>
<message>
<source>Trophy Key:\nKey used to decrypt trophies. Must be obtained from your jailbroken console.\nMust contain only hex characters.</source>
<translation>Trofényckel:\nNyckel som används för att avkryptera troféer. Måste hämtas från din konsoll (jailbroken).\nMåste innehålla endast hex-tecken</translation>
<translation>Trofényckel:\nNyckel som används för att avkryptera troféer. Måste hämtas från din konsoll (jailbroken).\nMåste innehålla endast hex-tecken.</translation>
</message>
<message>
<source>Log Type:\nSets whether to synchronize the output of the log window for performance. May have adverse effects on emulation.</source>
<translation>Loggtyp:\nStäller in huruvida synkronisering av utdata för loggfönstret för prestanda. Kan ha inverkan emulationen</translation>
<translation>Loggtyp:\nStäller in huruvida synkronisering av utdata för loggfönstret för prestanda. Kan ha inverkan emulationen.</translation>
</message>
<message>
<source>Log Filter:\nFilters the log to only print specific information.\nExamples: &quot;Core:Trace&quot; &quot;Lib.Pad:Debug Common.Filesystem:Error&quot; &quot;*:Critical&quot;\nLevels: Trace, Debug, Info, Warning, Error, Critical - in this order, a specific level silences all levels preceding it in the list and logs every level after it.</source>
<translation>Loggfilter:\nFiltrera loggen till att endast skriva ut specifik information.\nExempel: &quot;Core:Trace&quot; &quot;Lib.Pad:Debug Common.Filesystem:Error&quot; &quot;*:Critical&quot;\nNivåer: Trace, Debug, Info, Warning, Error, Critical - i den ordningen, en specifik nivå som tystar alla nivåer före den i listan och loggar allting efter den</translation>
<translation>Loggfilter:\nFiltrera loggen till att endast skriva ut specifik information.\nExempel: &quot;Core:Trace&quot; &quot;Lib.Pad:Debug Common.Filesystem:Error&quot; &quot;*:Critical&quot;\nNivåer: Trace, Debug, Info, Warning, Error, Critical - i den ordningen, en specifik nivå som tystar alla nivåer före den i listan och loggar allting efter den.</translation>
</message>
<message>
<source>Update:\nRelease: Official versions released every month that may be very outdated, but are more reliable and tested.\nNightly: Development versions that have all the latest features and fixes, but may contain bugs and are less stable.</source>
<translation>Uppdatering:\nRelease: Officiella versioner som släpps varje månad som kan vara mycket utdaterade, men är mer pålitliga och testade.\nNightly: Utvecklingsversioner som har de senaste funktionerna och fixarna, men kan innehålla fel och är mindre stabila</translation>
<translation>Uppdatering:\nRelease: Officiella versioner som släpps varje månad som kan vara mycket utdaterade, men är mer pålitliga och testade.\nNightly: Utvecklingsversioner som har de senaste funktionerna och fixarna, men kan innehålla fel och är mindre stabila.</translation>
</message>
<message>
<source>Background Image:\nControl the opacity of the game background image.</source>
<translation>Bakgrundsbild:\nKontrollerar opaciteten för spelets bakgrundsbild</translation>
<translation>Bakgrundsbild:\nKontrollerar opaciteten för spelets bakgrundsbild.</translation>
</message>
<message>
<source>Play Title Music:\nIf a game supports it, enable playing special music when selecting the game in the GUI.</source>
<translation>Spela upp titelmusik:\nOm ett spel har stöd för det kan speciell musik spelas upp från spelet i gränssnittet</translation>
<translation>Spela upp titelmusik:\nOm ett spel har stöd för det kan speciell musik spelas upp från spelet i gränssnittet.</translation>
</message>
<message>
<source>Disable Trophy Pop-ups:\nDisable in-game trophy notifications. Trophy progress can still be tracked using the Trophy Viewer (right-click the game in the main window).</source>
@ -1776,27 +1784,23 @@
</message>
<message>
<source>Hide Cursor:\nChoose when the cursor will disappear:\nNever: You will always see the mouse.\nidle: Set a time for it to disappear after being idle.\nAlways: you will never see the mouse.</source>
<translation>Dölj pekare:\nVälj när muspekaren ska försvinna:\nAldrig: Du kommer alltid se muspekaren.\nOverksam: Ställ in en tid för när den ska försvinna efter den inte använts.\nAlltid: du kommer aldrig se muspekaren</translation>
<translation>Dölj pekare:\nVälj när muspekaren ska försvinna:\nAldrig: Du kommer alltid se muspekaren.\nOverksam: Ställ in en tid för när den ska försvinna efter den inte använts.\nAlltid: du kommer aldrig se muspekaren.</translation>
</message>
<message>
<source>Hide Idle Cursor Timeout:\nThe duration (seconds) after which the cursor that has been idle hides itself.</source>
<translation>Dölj pekare vid overksam:\nLängden (sekunder) efter vilken som muspekaren som har varit overksam döljer sig själv</translation>
</message>
<message>
<source>Back Button Behavior:\nSets the controller&apos;s back button to emulate tapping the specified position on the PS4 touchpad.</source>
<translation>Beteende för bakåtknapp:\nStäller in handkontrollerns bakåtknapp för att emulera ett tryck angivna positionen PS4ns touchpad</translation>
<translation>Dölj pekare vid overksam:\nLängden (sekunder) efter vilken som muspekaren som har varit overksam döljer sig själv.</translation>
</message>
<message>
<source>Display Compatibility Data:\nDisplays game compatibility information in table view. Enable &quot;Update Compatibility On Startup&quot; to get up-to-date information.</source>
<translation>Visa kompatibilitetsdata:\nVisar information om spelkompatibilitet i tabellvyn. Aktivera &quot;Uppdatera kompatibilitet vid uppstart&quot; för att uppdaterad information</translation>
<translation>Visa kompatibilitetsdata:\nVisar information om spelkompatibilitet i tabellvyn. Aktivera &quot;Uppdatera kompatibilitet vid uppstart&quot; för att uppdaterad information.</translation>
</message>
<message>
<source>Update Compatibility On Startup:\nAutomatically update the compatibility database when shadPS4 starts.</source>
<translation>Uppdatera kompatibilitet vid uppstart:\nUppdatera automatiskt kompatibilitetsdatabasen när shadPS4 startar</translation>
<translation>Uppdatera kompatibilitet vid uppstart:\nUppdatera automatiskt kompatibilitetsdatabasen när shadPS4 startar.</translation>
</message>
<message>
<source>Update Compatibility Database:\nImmediately update the compatibility database.</source>
<translation>Uppdatera kompatibilitetsdatabasen:\nUppdaterar kompatibilitetsdatabasen direkt</translation>
<translation>Uppdatera kompatibilitetsdatabasen:\nUppdaterar kompatibilitetsdatabasen direkt.</translation>
</message>
<message>
<source>Never</source>
@ -1810,41 +1814,25 @@
<source>Always</source>
<translation>Alltid</translation>
</message>
<message>
<source>Touchpad Left</source>
<translation>Touchpad vänster</translation>
</message>
<message>
<source>Touchpad Right</source>
<translation>Touchpad höger</translation>
</message>
<message>
<source>Touchpad Center</source>
<translation>Touchpad mitten</translation>
</message>
<message>
<source>None</source>
<translation>Ingen</translation>
</message>
<message>
<source>Graphics Device:\nOn multiple GPU systems, select the GPU the emulator will use from the drop down list,\nor select &quot;Auto Select&quot; to automatically determine it.</source>
<translation>Grafikenhet:\nFör system med flera GPUer kan du välja den GPU som emulatorn ska använda från rullgardinsmenyn,\neller välja &quot;Auto Select&quot; för att automatiskt bestämma det</translation>
<translation>Grafikenhet:\nFör system med flera GPUer kan du välja den GPU som emulatorn ska använda från rullgardinsmenyn,\neller välja &quot;Auto Select&quot; för att automatiskt bestämma det.</translation>
</message>
<message>
<source>Width/Height:\nSets the size of the emulator window at launch, which can be resized during gameplay.\nThis is different from the in-game resolution.</source>
<translation>Bredd/Höjd:\nStäller in storleken för emulatorfönstret vid uppstart, som kan storleksändras under spelning.\nDetta är inte det samma som spelupplösningen</translation>
<translation>Bredd/Höjd:\nStäller in storleken för emulatorfönstret vid uppstart, som kan storleksändras under spelning.\nDetta är inte det samma som spelupplösningen.</translation>
</message>
<message>
<source>Vblank Divider:\nThe frame rate at which the emulator refreshes at is multiplied by this number. Changing this may have adverse effects, such as increasing the game speed, or breaking critical game functionality that does not expect this to change!</source>
<translation>Vblank Divider:\nBildfrekvensen som emulatorn uppdaterar vid multipliceras med detta tal. Ändra detta kan ha inverkan saker, såsom ökad spelhastighet eller göra sönder kritisk spelfunktionalitet, som inte förväntar sig denna ändring</translation>
<translation>Vblank Divider:\nBildfrekvensen som emulatorn uppdaterar vid multipliceras med detta tal. Ändra detta kan ha inverkan saker, såsom ökad spelhastighet eller göra sönder kritisk spelfunktionalitet, som inte förväntar sig denna ändring!</translation>
</message>
<message>
<source>Enable Shaders Dumping:\nFor the sake of technical debugging, saves the games shaders to a folder as they render.</source>
<translation>Aktivera Shaders Dumping:\nFör teknisk felsökning, sparar spelets shaders till en mapp när de renderas</translation>
<translation>Aktivera Shaders Dumping:\nFör teknisk felsökning, sparar spelets shaders till en mapp när de renderas.</translation>
</message>
<message>
<source>Enable Null GPU:\nFor the sake of technical debugging, disables game rendering as if there were no graphics card.</source>
<translation>Aktivera Null GPU:\nFör teknisk felsökning, inaktiverar spelrenderingen som om det inte fanns något grafikkort</translation>
<translation>Aktivera Null GPU:\nFör teknisk felsökning, inaktiverar spelrenderingen som om det inte fanns något grafikkort.</translation>
</message>
<message>
<source>Enable HDR:\nEnables HDR in games that support it.\nYour monitor must have support for the BT2020 PQ color space and the RGB10A2 swapchain format.</source>
@ -1852,31 +1840,31 @@
</message>
<message>
<source>Game Folders:\nThe list of folders to check for installed games.</source>
<translation>Spelmappar:\nListan över mappar att leta i efter installerade spel</translation>
<translation>Spelmappar:\nListan över mappar att leta i efter installerade spel.</translation>
</message>
<message>
<source>Add:\nAdd a folder to the list.</source>
<translation>Aktivera separat uppdateringsmapp:\nAktiverar installation av speluppdateringar till en separat mapp för enkel hantering.\nDetta kan manuellt skapas genom att lägga till den uppackade uppdateringen till spelmappen med namnet &quot;CUSA00000-UPDATE&quot; där CUSA ID matchar spelets id</translation>
<translation>Lägg till:\Lägg till en mapp till listan.</translation>
</message>
<message>
<source>Remove:\nRemove a folder from the list.</source>
<translation>Ta bort:\nTa bort en mapp från listan</translation>
<translation>Ta bort:\nTa bort en mapp från listan.</translation>
</message>
<message>
<source>Enable Debug Dumping:\nSaves the import and export symbols and file header information of the currently running PS4 program to a directory.</source>
<translation>Aktivera felsökningsdumpning:\nSparar import och export av symboler och fil-header-information för aktuellt körande PS4-program till en katalog</translation>
<translation>Aktivera felsökningsdumpning:\nSparar import och export av symboler och fil-header-information för aktuellt körande PS4-program till en katalog.</translation>
</message>
<message>
<source>Enable Vulkan Validation Layers:\nEnables a system that validates the state of the Vulkan renderer and logs information about its internal state.\nThis will reduce performance and likely change the behavior of emulation.</source>
<translation>Aktivera Vulkan Validation Layers:\nAktiverar ett system som validerar tillståndet för Vulkan renderer och loggar information om dess interna tillstånd.\nDetta kommer minska prestandan och antagligen ändra beteendet för emuleringen</translation>
<translation>Aktivera Vulkan Validation Layers:\nAktiverar ett system som validerar tillståndet för Vulkan renderer och loggar information om dess interna tillstånd.\nDetta kommer minska prestandan och antagligen ändra beteendet för emuleringen.</translation>
</message>
<message>
<source>Enable Vulkan Synchronization Validation:\nEnables a system that validates the timing of Vulkan rendering tasks.\nThis will reduce performance and likely change the behavior of emulation.</source>
<translation>Aktivera Vulkan Synchronization Validation:\nAktiverar ett system som validerar timing för Vulkan rendering tasks.\nDetta kommer minska prestandan och antagligen ändra beteendet för emuleringen</translation>
<translation>Aktivera Vulkan Synchronization Validation:\nAktiverar ett system som validerar timing för Vulkan rendering tasks.\nDetta kommer minska prestandan och antagligen ändra beteendet för emuleringen.</translation>
</message>
<message>
<source>Enable RenderDoc Debugging:\nIf enabled, the emulator will provide compatibility with Renderdoc to allow capture and analysis of the currently rendered frame.</source>
<translation>Aktivera RenderDoc-felsökning:\nOm aktiverad kommer emulatorn att tillhandahålla kompatibilitet med Renderdoc för att tillåta fångst och analys för aktuell renderad bildruta</translation>
<translation>Aktivera RenderDoc-felsökning:\nOm aktiverad kommer emulatorn att tillhandahålla kompatibilitet med Renderdoc för att tillåta fångst och analys för aktuell renderad bildruta.</translation>
</message>
<message>
<source>Collect Shaders:\nYou need this enabled to edit shaders with the debug menu (Ctrl + F10).</source>
@ -1884,27 +1872,27 @@
</message>
<message>
<source>Crash Diagnostics:\nCreates a .yaml file with info about the Vulkan state at the time of crashing.\nUseful for debugging &apos;Device lost&apos; errors. If you have this enabled, you should enable Host AND Guest Debug Markers.\nDoes not work on Intel GPUs.\nYou need Vulkan Validation Layers enabled and the Vulkan SDK for this to work.</source>
<translation>Krashdiagnostik:\nSkapar en .yaml-fil med information om Vulkan-tillståndet vid tid för kraschen.\nAnvändbart för felsökning av &apos;Device lost&apos;-fel. Om du har aktiverat detta bör du aktivera felsökningsmarkörer för Värd OCH Gäst.\nFungerar inte Intel GPUer.\nDu behöver aktivera Vulkan Validation Layers och Vulkan SDK för att detta ska fungera</translation>
<translation>Krashdiagnostik:\nSkapar en .yaml-fil med information om Vulkan-tillståndet vid tid för kraschen.\nAnvändbart för felsökning av &apos;Device lost&apos;-fel. Om du har aktiverat detta bör du aktivera felsökningsmarkörer för Värd OCH Gäst.\nFungerar inte Intel GPUer.\nDu behöver aktivera Vulkan Validation Layers och Vulkan SDK för att detta ska fungera.</translation>
</message>
<message>
<source>Copy GPU Buffers:\nGets around race conditions involving GPU submits.\nMay or may not help with PM4 type 0 crashes.</source>
<translation>Kopiera GPU-buffertar:\nGör att man kan komma runt race conditions som involverar GPU submits.\nKan eller kan inte hjälpa med PM4 type 0-kraschar</translation>
<translation>Kopiera GPU-buffertar:\nGör att man kan komma runt race conditions som involverar GPU submits.\nKan eller kan inte hjälpa med PM4 type 0-kraschar.</translation>
</message>
<message>
<source>Host Debug Markers:\nInserts emulator-side information like markers for specific AMDGPU commands around Vulkan commands, as well as giving resources debug names.\nIf you have this enabled, you should enable Crash Diagnostics.\nUseful for programs like RenderDoc.</source>
<translation>Felsökningsmarkörer för värd:\nInfogar informationsliknande markörer i emulatorn för specifika AMDGPU-kommandon runt Vulkan-kommandon, väl som ger resurser felsökningsnamn.\nOm du har detta aktiverat bör du aktivera Kraschdiagnostik.\nAnvändbart för program som RenderDoc</translation>
<translation>Felsökningsmarkörer för värd:\nInfogar informationsliknande markörer i emulatorn för specifika AMDGPU-kommandon runt Vulkan-kommandon, väl som ger resurser felsökningsnamn.\nOm du har detta aktiverat bör du aktivera Kraschdiagnostik.\nAnvändbart för program som RenderDoc.</translation>
</message>
<message>
<source>Guest Debug Markers:\nInserts any debug markers the game itself has added to the command buffer.\nIf you have this enabled, you should enable Crash Diagnostics.\nUseful for programs like RenderDoc.</source>
<translation>Felsökningsmarkörer för gäst:\nInfogar felsökningsmarkörer som själva spelet har lagt till i kommandobufferten.\nOm du har aktiverat detta bör du aktivera Kraschdiagnostik.\nAnvändbart för program som RenderDoc</translation>
<translation>Felsökningsmarkörer för gäst:\nInfogar felsökningsmarkörer som själva spelet har lagt till i kommandobufferten.\nOm du har aktiverat detta bör du aktivera Kraschdiagnostik.\nAnvändbart för program som RenderDoc.</translation>
</message>
<message>
<source>Save Data Path:\nThe folder where game save data will be saved.</source>
<translation>Sökväg för sparat data:\nSökvägen där spelets sparade data kommer att sparas</translation>
<translation>Sökväg för sparat data:\nSökvägen där spelets sparade data kommer att sparas.</translation>
</message>
<message>
<source>Browse:\nBrowse for a folder to set as the save data path.</source>
<translation>Bläddra:\nBläddra efter en mapp att ställa in som sökväg för sparat data</translation>
<translation>Bläddra:\nBläddra efter en mapp att ställa in som sökväg för sparat data.</translation>
</message>
<message>
<source>Release</source>

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