Compare commits
1 Commits
netusejthr
...
sjkdbsdfjk
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ba9486fe18 |
@@ -487,6 +487,10 @@ else()
|
||||
# wow
|
||||
find_package(Boost 1.57.0 CONFIG REQUIRED OPTIONAL_COMPONENTS headers context system fiber filesystem)
|
||||
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Linux" OR ANDROID)
|
||||
find_package(gamemode 1.7 MODULE)
|
||||
endif()
|
||||
|
||||
if (ENABLE_OPENSSL)
|
||||
find_package(OpenSSL 1.1.1 REQUIRED)
|
||||
endif()
|
||||
@@ -562,7 +566,6 @@ find_package(VulkanUtilityLibraries)
|
||||
find_package(SimpleIni)
|
||||
find_package(SPIRV-Tools)
|
||||
find_package(sirit)
|
||||
find_package(gamemode)
|
||||
|
||||
if (ARCHITECTURE_x86 OR ARCHITECTURE_x86_64)
|
||||
find_package(xbyak)
|
||||
|
||||
@@ -1,154 +0,0 @@
|
||||
# User Handbook - Adding Boolean Settings Toggles
|
||||
|
||||
> [!WARNING]
|
||||
> This guide is intended for developers ONLY. If you are not a developer, this likely irrelevant to yourself.
|
||||
>
|
||||
> If you want to add temporary toggles, please refer to **[Adding Debug Knobs](AddingDebugKnobs.md)**
|
||||
|
||||
This guide will walk you through adding a new boolean toggle setting to Eden's configuration across both Qt's (PC) and Kotlin's (Android) UIs.
|
||||
|
||||
## Index
|
||||
|
||||
1. [Step 1 - src/common/settings](#step-1-src-common-settings)
|
||||
2. [Qt's (PC) Steps](#qt-pc-steps)
|
||||
|
||||
* [Step 2 - src/qt_common/config/shared_translation.cpp](#step-2-src-qt_common-config-shared_translation-cpp)
|
||||
3. [ Kotlin's (Android) Steps](#android-steps)
|
||||
|
||||
* [Step 3 - BooleanSetting.kt](#step-3-src-android-app-src-main-java-org-yuzu-yuzu_emu-features-settings-model-booleansetting-kt)
|
||||
* [Step 4 - SettingsItem.kt](#step-4-src-android-app-src-main-java-org-yuzu-yuzu_emu-features-settings-model-view-settingsitem-kt)
|
||||
* [Step 5 - SettingsFragmentPresenter.kt](#step-5-src-android-app-src-main-java-org-yuzu-yuzu_emu-features-settings-ui-settingsfragmentpresenter-kt)
|
||||
* [Step 6 - strings.xml](#step-6-src-android-app-src-main-res-values-strings-xml)
|
||||
4. [Step 7 - Use Your Toggle](#step-7-use-your-toggle)
|
||||
5. [Best Practices](#best-practices)
|
||||
|
||||
---
|
||||
|
||||
## Step 1 - src/common/settings.
|
||||
|
||||
Firstly add your desired toggle inside `setting.h`,
|
||||
Example:
|
||||
|
||||
```
|
||||
SwitchableSetting<bool> your_setting_name{linkage, false, "your_setting_name", Category::RendererExtensions};
|
||||
```
|
||||
|
||||
NOTE - If you wish for your toggle to be on by default then change `false` to `true` after `linkage,`.
|
||||
|
||||
### Remember to add your toggle to the appropriate category, for example:
|
||||
|
||||
Common Categories:
|
||||
|
||||
* Category::Renderer
|
||||
* Category::RendererAdvanced
|
||||
* Category::RendererExtensions
|
||||
* Category::System
|
||||
* Category::Core
|
||||
|
||||
---
|
||||
|
||||
## Qt (PC) Steps
|
||||
|
||||
### Step 2 - src/qt_common/config/shared_translation.cpp
|
||||
|
||||
Now you can add the toggle to the QT (PC) UI inside `shared_translation.cpp`,
|
||||
Find where you wish for it to appear and place it there.
|
||||
Example:
|
||||
|
||||
```
|
||||
INSERT(Settings,
|
||||
your_setting_name,
|
||||
tr("Your Setting Display Name"),
|
||||
tr("Detailed description of what this setting does.\n"
|
||||
"You can use multiple lines.\n"
|
||||
"Explain any caveats or requirements."));
|
||||
```
|
||||
|
||||
### Make sure to:
|
||||
|
||||
* Keep display naming consistant
|
||||
* Put detailed info in the description
|
||||
* Use `\n` for line breaks in descriptions
|
||||
|
||||
---
|
||||
|
||||
## Android Steps
|
||||
|
||||
### Step 3 - src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/BooleanSetting.kt
|
||||
|
||||
Now add it inside `BooleanSetting.kt` where it should be in the settings.
|
||||
Example:
|
||||
|
||||
```
|
||||
RENDERER_YOUR_SETTING_NAME("your_setting_name"),
|
||||
```
|
||||
|
||||
Remember to make sure the naming of the prefix matches the desired category.
|
||||
|
||||
### Step 4 - src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt
|
||||
|
||||
Now you may add the toggle to the Kotlin (Android) UI inside `SettingsItem.kt`.
|
||||
Example:
|
||||
|
||||
```
|
||||
put(
|
||||
SwitchSetting(
|
||||
BooleanSetting.RENDERER_YOUR_SETTING_NAME,
|
||||
titleId = R.string.your_setting_name,
|
||||
descriptionId = R.string.your_setting_name_description
|
||||
)
|
||||
)
|
||||
```
|
||||
|
||||
### Step 5 - src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsFragmentPresenter.kt
|
||||
|
||||
Now add your setting to the correct location inside `SettingsFragmentPresenter.kt` within the right category.
|
||||
Example:
|
||||
|
||||
```
|
||||
add(BooleanSetting.RENDERER_YOUR_SETTING_NAME.key)
|
||||
```
|
||||
|
||||
Remember, placing matters! Settings appear in the order of where you add them.
|
||||
|
||||
### Step 6 - src/android/app/src/main/res/values/strings.xml
|
||||
|
||||
Now add your setting and description to `strings.xml` in the appropriate place.
|
||||
Example:
|
||||
|
||||
```
|
||||
<string name="your_setting_name">Your Setting Display Name</string>
|
||||
<string name="your_setting_name_description">Detailed description of what this setting does. Explain any caveats, requirements, or warnings here.</string>
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Step 7 - Use Your Toggle!
|
||||
|
||||
Now the UI part is done find a place in the code for the toggle,
|
||||
And use it to your heart's desire!
|
||||
Example:
|
||||
|
||||
```
|
||||
const bool your_value = Settings::values.your_setting_name.GetValue();
|
||||
|
||||
if (your_value) {
|
||||
// Do something when enabled
|
||||
}
|
||||
```
|
||||
|
||||
If you wish to do something only when the toggle is disabled,
|
||||
Use `if (!your_value) {` instead of `if (your_value) {`.
|
||||
|
||||
---
|
||||
|
||||
## Best Practices
|
||||
|
||||
* Naming - Use clear, descriptive names. Something for both the devs and the users.
|
||||
* Defaults - Choose safe default values (usually false for new features).
|
||||
* Documentation - Write clear descriptions explaining when and why to use the setting.
|
||||
* Categories - Put settings in the appropriate category.
|
||||
* Order - Place related settings near each other.
|
||||
* Testing - Always test on both PC and Android before committing when possible.
|
||||
|
||||
### Thank you for reading, I hope this guide helped you making your toggle!
|
||||
@@ -1,119 +0,0 @@
|
||||
# User Handbook - Adding Debug Knobs
|
||||
|
||||
Debug Knobs is a 16-bit integer setting (`debug_knobs`) in the Eden Emulator that serves as a bitmask for gating various testing and debugging features. This allows developers and advanced users to enable or disable specific debug behaviors without requiring deploying of complete but temporary toggles.
|
||||
|
||||
The setting ranges from 0 to 65535 (0x0000 to 0xFFFF), where each bit represents a different debug feature flag.
|
||||
|
||||
## Index
|
||||
|
||||
1. [Advantages](#advantages)
|
||||
2. [Usage](#usage)
|
||||
|
||||
* [Accessing Debug Knobs (dev side)](#accessing-debug-knobs-dev-side)
|
||||
* [Setting Debug Knobs (user side)](#setting-debug-knobs-user-side)
|
||||
* [Bit Manipulation Examples](#bit-manipulation-examples)
|
||||
3. [Examples](#examples)
|
||||
|
||||
* [Example 1: Conditional Debug Logging](#example-1-conditional-debug-logging)
|
||||
* [Example 2: Performance Tuning](#example-2-performance-tuning)
|
||||
* [Example 3: Feature Gating](#example-3-feature-gating)
|
||||
4. [Best Practices](#best-practices)
|
||||
|
||||
---
|
||||
|
||||
## Advantages
|
||||
|
||||
The main advantage is to avoid deploying new disposable toggles (those made only for testing stage, and are disposed once new feature gets good to merge). This empowers devs to be free of all frontend burocracy and hassle of new toggles.
|
||||
|
||||
Common advantages recap:
|
||||
|
||||
* **Fine-Grained Control**: Enable or disable up to 16 individual debug features independently using bit manipulation on a single build
|
||||
* **Runtime Configuration**: Change debug behavior at runtime the same way as new toggles would do
|
||||
* **Safe incremental development**: New debug features can be added while impact can be isolated from previous deployments
|
||||
|
||||
## Usage
|
||||
|
||||
### Accessing Debug Knobs (dev side)
|
||||
|
||||
Use the `Settings::getDebugKnobAt(u8 i)` function to check if a specific bit is set:
|
||||
|
||||
```cpp
|
||||
#include "common/settings.h"
|
||||
|
||||
// Check if bit 0 is set
|
||||
bool feature_enabled = Settings::getDebugKnobAt(0);
|
||||
|
||||
// Check if bit 15 is set
|
||||
bool another_feature = Settings::getDebugKnobAt(15);
|
||||
```
|
||||
|
||||
The function returns `true` if the specified bit (0-15) is set in the `debug_knobs` value, `false` otherwise.
|
||||
|
||||
### Setting Debug Knobs (user side)
|
||||
|
||||
Developers must inform which knobs are tied to each functionality to be tested.
|
||||
|
||||
The debug knobs value can be set through:
|
||||
|
||||
1. **Desktop UI**: In the Debug configuration tab, there's a spinbox for "Debug knobs" (0-65535)
|
||||
2. **Android UI**: Available as an integer setting in the Debug section
|
||||
3. **Configuration Files**: Set the `debug_knobs` value in the emulator's configuration
|
||||
|
||||
### Bit Manipulation Examples
|
||||
|
||||
To enable specific features, calculate the decimal value by setting the appropriate bits:
|
||||
|
||||
* **Enable only bit 0**: Value = 1 (2^0)
|
||||
* **Enable only bit 1**: Value = 2 (2^1)
|
||||
* **Enable bits 0 and 1**: Value = 3 (2^0 + 2^1)
|
||||
* **Enable bit 15**: Value = 32768 (2^15)
|
||||
|
||||
## Examples
|
||||
|
||||
### Example 1: Conditional Debug Logging
|
||||
|
||||
```cpp
|
||||
void SomeFunction() {
|
||||
if (Settings::getDebugKnobAt(0)) {
|
||||
LOG_DEBUG(Common, "Debug feature 0 is enabled");
|
||||
// Additional debug code here
|
||||
}
|
||||
|
||||
if (Settings::getDebugKnobAt(1)) {
|
||||
LOG_DEBUG(Common, "Debug feature 1 is enabled");
|
||||
// Different debug behavior
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Example 2: Performance Tuning
|
||||
|
||||
```cpp
|
||||
bool UseOptimizedPath() {
|
||||
// Skip optimization if debug bit 2 is set for testing
|
||||
return !Settings::getDebugKnobAt(2);
|
||||
}
|
||||
```
|
||||
|
||||
### Example 3: Feature Gating
|
||||
|
||||
```cpp
|
||||
void ExperimentalFeature() {
|
||||
static constexpr u8 EXPERIMENTAL_FEATURE_BIT = 3;
|
||||
|
||||
if (!Settings::getDebugKnobAt(EXPERIMENTAL_FEATURE_BIT)) {
|
||||
// Fallback to stable implementation
|
||||
StableImplementation();
|
||||
return;
|
||||
}
|
||||
|
||||
// Experimental implementation
|
||||
ExperimentalImplementation();
|
||||
}
|
||||
```
|
||||
|
||||
## Best Practices
|
||||
|
||||
* This setting is intended for development and testing purposes only
|
||||
* Knobs must be unwired before PR creation
|
||||
* The setting is per-game configurable, allowing different debug setups for different titles
|
||||
@@ -14,4 +14,3 @@ This handbook is primarily aimed at the end-user - baking useful knowledge for e
|
||||
- **[Orphaned Profiles](Orphaned.md)**
|
||||
- **[Command Line](CommandLine.md)**
|
||||
- **[Native Application Development](Native.md)**
|
||||
- **[Adding Boolean Settings Toggles](AddingBooleanToggles.md)**
|
||||
|
||||
6
externals/CMakeLists.txt
vendored
6
externals/CMakeLists.txt
vendored
@@ -267,11 +267,9 @@ if (ANDROID AND ARCHITECTURE_arm64)
|
||||
AddJsonPackage(libadrenotools)
|
||||
endif()
|
||||
|
||||
AddJsonPackage(gamemode)
|
||||
|
||||
if (gamemode_ADDED)
|
||||
if (UNIX AND NOT APPLE AND NOT TARGET gamemode::headers)
|
||||
add_library(gamemode INTERFACE)
|
||||
target_include_directories(gamemode INTERFACE ${gamemode_SOURCE_DIR}/lib)
|
||||
target_include_directories(gamemode INTERFACE gamemode)
|
||||
add_library(gamemode::headers ALIAS gamemode)
|
||||
endif()
|
||||
|
||||
|
||||
7
externals/cpmfile.json
vendored
7
externals/cpmfile.json
vendored
@@ -218,12 +218,5 @@
|
||||
"artifact": "MoltenVK-macOS.tar",
|
||||
"hash": "5695b36ca5775819a71791557fcb40a4a5ee4495be6b8442e0b666d0c436bec02aae68cc6210183f7a5c986bdbec0e117aecfad5396e496e9c2fd5c89133a347",
|
||||
"bundled": true
|
||||
},
|
||||
"gamemode": {
|
||||
"repo": "FeralInteractive/gamemode",
|
||||
"sha": "ce6fe122f3",
|
||||
"hash": "e87ec14ed3e826d578ebf095c41580069dda603792ba91efa84f45f4571a28f4d91889675055fd6f042d7dc25b0b9443daf70963ae463e38b11bcba95f4c65a9",
|
||||
"version": "1.7",
|
||||
"find_args": "MODULE"
|
||||
}
|
||||
}
|
||||
|
||||
376
externals/gamemode/gamemode_client.h
vendored
Normal file
376
externals/gamemode/gamemode_client.h
vendored
Normal file
@@ -0,0 +1,376 @@
|
||||
/*
|
||||
|
||||
Copyright (c) 2017-2019, Feral Interactive
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Feral Interactive nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
#ifndef CLIENT_GAMEMODE_H
|
||||
#define CLIENT_GAMEMODE_H
|
||||
/*
|
||||
* GameMode supports the following client functions
|
||||
* Requests are refcounted in the daemon
|
||||
*
|
||||
* int gamemode_request_start() - Request gamemode starts
|
||||
* 0 if the request was sent successfully
|
||||
* -1 if the request failed
|
||||
*
|
||||
* int gamemode_request_end() - Request gamemode ends
|
||||
* 0 if the request was sent successfully
|
||||
* -1 if the request failed
|
||||
*
|
||||
* GAMEMODE_AUTO can be defined to make the above two functions apply during static init and
|
||||
* destruction, as appropriate. In this configuration, errors will be printed to stderr
|
||||
*
|
||||
* int gamemode_query_status() - Query the current status of gamemode
|
||||
* 0 if gamemode is inactive
|
||||
* 1 if gamemode is active
|
||||
* 2 if gamemode is active and this client is registered
|
||||
* -1 if the query failed
|
||||
*
|
||||
* int gamemode_request_start_for(pid_t pid) - Request gamemode starts for another process
|
||||
* 0 if the request was sent successfully
|
||||
* -1 if the request failed
|
||||
* -2 if the request was rejected
|
||||
*
|
||||
* int gamemode_request_end_for(pid_t pid) - Request gamemode ends for another process
|
||||
* 0 if the request was sent successfully
|
||||
* -1 if the request failed
|
||||
* -2 if the request was rejected
|
||||
*
|
||||
* int gamemode_query_status_for(pid_t pid) - Query status of gamemode for another process
|
||||
* 0 if gamemode is inactive
|
||||
* 1 if gamemode is active
|
||||
* 2 if gamemode is active and this client is registered
|
||||
* -1 if the query failed
|
||||
*
|
||||
* const char* gamemode_error_string() - Get an error string
|
||||
* returns a string describing any of the above errors
|
||||
*
|
||||
* Note: All the above requests can be blocking - dbus requests can and will block while the daemon
|
||||
* handles the request. It is not recommended to make these calls in performance critical code
|
||||
*/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <dlfcn.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
static char internal_gamemode_client_error_string[512] = { 0 };
|
||||
|
||||
/**
|
||||
* Load libgamemode dynamically to dislodge us from most dependencies.
|
||||
* This allows clients to link and/or use this regardless of runtime.
|
||||
* See SDL2 for an example of the reasoning behind this in terms of
|
||||
* dynamic versioning as well.
|
||||
*/
|
||||
static volatile int internal_libgamemode_loaded = 1;
|
||||
|
||||
/* Typedefs for the functions to load */
|
||||
typedef int (*api_call_return_int)(void);
|
||||
typedef const char *(*api_call_return_cstring)(void);
|
||||
typedef int (*api_call_pid_return_int)(pid_t);
|
||||
|
||||
/* Storage for functors */
|
||||
static api_call_return_int REAL_internal_gamemode_request_start = NULL;
|
||||
static api_call_return_int REAL_internal_gamemode_request_end = NULL;
|
||||
static api_call_return_int REAL_internal_gamemode_query_status = NULL;
|
||||
static api_call_return_cstring REAL_internal_gamemode_error_string = NULL;
|
||||
static api_call_pid_return_int REAL_internal_gamemode_request_start_for = NULL;
|
||||
static api_call_pid_return_int REAL_internal_gamemode_request_end_for = NULL;
|
||||
static api_call_pid_return_int REAL_internal_gamemode_query_status_for = NULL;
|
||||
|
||||
/**
|
||||
* Internal helper to perform the symbol binding safely.
|
||||
*
|
||||
* Returns 0 on success and -1 on failure
|
||||
*/
|
||||
__attribute__((always_inline)) static inline int internal_bind_libgamemode_symbol(
|
||||
void *handle, const char *name, void **out_func, size_t func_size, bool required)
|
||||
{
|
||||
void *symbol_lookup = NULL;
|
||||
char *dl_error = NULL;
|
||||
|
||||
/* Safely look up the symbol */
|
||||
symbol_lookup = dlsym(handle, name);
|
||||
dl_error = dlerror();
|
||||
if (required && (dl_error || !symbol_lookup)) {
|
||||
snprintf(internal_gamemode_client_error_string,
|
||||
sizeof(internal_gamemode_client_error_string),
|
||||
"dlsym failed - %s",
|
||||
dl_error);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Have the symbol correctly, copy it to make it usable */
|
||||
memcpy(out_func, &symbol_lookup, func_size);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads libgamemode and needed functions
|
||||
*
|
||||
* Returns 0 on success and -1 on failure
|
||||
*/
|
||||
__attribute__((always_inline)) static inline int internal_load_libgamemode(void)
|
||||
{
|
||||
/* We start at 1, 0 is a success and -1 is a fail */
|
||||
if (internal_libgamemode_loaded != 1) {
|
||||
return internal_libgamemode_loaded;
|
||||
}
|
||||
|
||||
/* Anonymous struct type to define our bindings */
|
||||
struct binding {
|
||||
const char *name;
|
||||
void **functor;
|
||||
size_t func_size;
|
||||
bool required;
|
||||
} bindings[] = {
|
||||
{ "real_gamemode_request_start",
|
||||
(void **)&REAL_internal_gamemode_request_start,
|
||||
sizeof(REAL_internal_gamemode_request_start),
|
||||
true },
|
||||
{ "real_gamemode_request_end",
|
||||
(void **)&REAL_internal_gamemode_request_end,
|
||||
sizeof(REAL_internal_gamemode_request_end),
|
||||
true },
|
||||
{ "real_gamemode_query_status",
|
||||
(void **)&REAL_internal_gamemode_query_status,
|
||||
sizeof(REAL_internal_gamemode_query_status),
|
||||
false },
|
||||
{ "real_gamemode_error_string",
|
||||
(void **)&REAL_internal_gamemode_error_string,
|
||||
sizeof(REAL_internal_gamemode_error_string),
|
||||
true },
|
||||
{ "real_gamemode_request_start_for",
|
||||
(void **)&REAL_internal_gamemode_request_start_for,
|
||||
sizeof(REAL_internal_gamemode_request_start_for),
|
||||
false },
|
||||
{ "real_gamemode_request_end_for",
|
||||
(void **)&REAL_internal_gamemode_request_end_for,
|
||||
sizeof(REAL_internal_gamemode_request_end_for),
|
||||
false },
|
||||
{ "real_gamemode_query_status_for",
|
||||
(void **)&REAL_internal_gamemode_query_status_for,
|
||||
sizeof(REAL_internal_gamemode_query_status_for),
|
||||
false },
|
||||
};
|
||||
|
||||
void *libgamemode = NULL;
|
||||
|
||||
/* Try and load libgamemode */
|
||||
libgamemode = dlopen("libgamemode.so.0", RTLD_NOW);
|
||||
if (!libgamemode) {
|
||||
/* Attempt to load unversioned library for compatibility with older
|
||||
* versions (as of writing, there are no ABI changes between the two -
|
||||
* this may need to change if ever ABI-breaking changes are made) */
|
||||
libgamemode = dlopen("libgamemode.so", RTLD_NOW);
|
||||
if (!libgamemode) {
|
||||
snprintf(internal_gamemode_client_error_string,
|
||||
sizeof(internal_gamemode_client_error_string),
|
||||
"dlopen failed - %s",
|
||||
dlerror());
|
||||
internal_libgamemode_loaded = -1;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Attempt to bind all symbols */
|
||||
for (size_t i = 0; i < sizeof(bindings) / sizeof(bindings[0]); i++) {
|
||||
struct binding *binder = &bindings[i];
|
||||
|
||||
if (internal_bind_libgamemode_symbol(libgamemode,
|
||||
binder->name,
|
||||
binder->functor,
|
||||
binder->func_size,
|
||||
binder->required)) {
|
||||
internal_libgamemode_loaded = -1;
|
||||
return -1;
|
||||
};
|
||||
}
|
||||
|
||||
/* Success */
|
||||
internal_libgamemode_loaded = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Redirect to the real libgamemode
|
||||
*/
|
||||
__attribute__((always_inline)) static inline const char *gamemode_error_string(void)
|
||||
{
|
||||
/* If we fail to load the system gamemode, or we have an error string already, return our error
|
||||
* string instead of diverting to the system version */
|
||||
if (internal_load_libgamemode() < 0 || internal_gamemode_client_error_string[0] != '\0') {
|
||||
return internal_gamemode_client_error_string;
|
||||
}
|
||||
|
||||
/* Assert for static analyser that the function is not NULL */
|
||||
assert(REAL_internal_gamemode_error_string != NULL);
|
||||
|
||||
return REAL_internal_gamemode_error_string();
|
||||
}
|
||||
|
||||
/**
|
||||
* Redirect to the real libgamemode
|
||||
* Allow automatically requesting game mode
|
||||
* Also prints errors as they happen.
|
||||
*/
|
||||
#ifdef GAMEMODE_AUTO
|
||||
__attribute__((constructor))
|
||||
#else
|
||||
__attribute__((always_inline)) static inline
|
||||
#endif
|
||||
int gamemode_request_start(void)
|
||||
{
|
||||
/* Need to load gamemode */
|
||||
if (internal_load_libgamemode() < 0) {
|
||||
#ifdef GAMEMODE_AUTO
|
||||
fprintf(stderr, "gamemodeauto: %s\n", gamemode_error_string());
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Assert for static analyser that the function is not NULL */
|
||||
assert(REAL_internal_gamemode_request_start != NULL);
|
||||
|
||||
if (REAL_internal_gamemode_request_start() < 0) {
|
||||
#ifdef GAMEMODE_AUTO
|
||||
fprintf(stderr, "gamemodeauto: %s\n", gamemode_error_string());
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Redirect to the real libgamemode */
|
||||
#ifdef GAMEMODE_AUTO
|
||||
__attribute__((destructor))
|
||||
#else
|
||||
__attribute__((always_inline)) static inline
|
||||
#endif
|
||||
int gamemode_request_end(void)
|
||||
{
|
||||
/* Need to load gamemode */
|
||||
if (internal_load_libgamemode() < 0) {
|
||||
#ifdef GAMEMODE_AUTO
|
||||
fprintf(stderr, "gamemodeauto: %s\n", gamemode_error_string());
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Assert for static analyser that the function is not NULL */
|
||||
assert(REAL_internal_gamemode_request_end != NULL);
|
||||
|
||||
if (REAL_internal_gamemode_request_end() < 0) {
|
||||
#ifdef GAMEMODE_AUTO
|
||||
fprintf(stderr, "gamemodeauto: %s\n", gamemode_error_string());
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Redirect to the real libgamemode */
|
||||
__attribute__((always_inline)) static inline int gamemode_query_status(void)
|
||||
{
|
||||
/* Need to load gamemode */
|
||||
if (internal_load_libgamemode() < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (REAL_internal_gamemode_query_status == NULL) {
|
||||
snprintf(internal_gamemode_client_error_string,
|
||||
sizeof(internal_gamemode_client_error_string),
|
||||
"gamemode_query_status missing (older host?)");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return REAL_internal_gamemode_query_status();
|
||||
}
|
||||
|
||||
/* Redirect to the real libgamemode */
|
||||
__attribute__((always_inline)) static inline int gamemode_request_start_for(pid_t pid)
|
||||
{
|
||||
/* Need to load gamemode */
|
||||
if (internal_load_libgamemode() < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (REAL_internal_gamemode_request_start_for == NULL) {
|
||||
snprintf(internal_gamemode_client_error_string,
|
||||
sizeof(internal_gamemode_client_error_string),
|
||||
"gamemode_request_start_for missing (older host?)");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return REAL_internal_gamemode_request_start_for(pid);
|
||||
}
|
||||
|
||||
/* Redirect to the real libgamemode */
|
||||
__attribute__((always_inline)) static inline int gamemode_request_end_for(pid_t pid)
|
||||
{
|
||||
/* Need to load gamemode */
|
||||
if (internal_load_libgamemode() < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (REAL_internal_gamemode_request_end_for == NULL) {
|
||||
snprintf(internal_gamemode_client_error_string,
|
||||
sizeof(internal_gamemode_client_error_string),
|
||||
"gamemode_request_end_for missing (older host?)");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return REAL_internal_gamemode_request_end_for(pid);
|
||||
}
|
||||
|
||||
/* Redirect to the real libgamemode */
|
||||
__attribute__((always_inline)) static inline int gamemode_query_status_for(pid_t pid)
|
||||
{
|
||||
/* Need to load gamemode */
|
||||
if (internal_load_libgamemode() < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (REAL_internal_gamemode_query_status_for == NULL) {
|
||||
snprintf(internal_gamemode_client_error_string,
|
||||
sizeof(internal_gamemode_client_error_string),
|
||||
"gamemode_query_status_for missing (older host?)");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return REAL_internal_gamemode_query_status_for(pid);
|
||||
}
|
||||
|
||||
#endif // CLIENT_GAMEMODE_H
|
||||
@@ -24,6 +24,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" android:required="false" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
|
||||
@@ -52,6 +52,10 @@ enum class BooleanSetting(override val key: String) : AbstractBooleanSetting {
|
||||
SHOW_FW_VERSION("show_firmware_version"),
|
||||
|
||||
SOC_OVERLAY_BACKGROUND("soc_overlay_background"),
|
||||
|
||||
FRAME_INTERPOLATION("frame_interpolation"),
|
||||
// FRAME_SKIPPING("frame_skipping"),
|
||||
|
||||
ENABLE_INPUT_OVERLAY_AUTO_HIDE("enable_input_overlay_auto_hide"),
|
||||
|
||||
PERF_OVERLAY_BACKGROUND("perf_overlay_background"),
|
||||
|
||||
@@ -236,6 +236,21 @@ abstract class SettingsItem(
|
||||
|
||||
override fun reset() = BooleanSetting.USE_DOCKED_MODE.reset()
|
||||
}
|
||||
put(
|
||||
SwitchSetting(
|
||||
BooleanSetting.FRAME_INTERPOLATION,
|
||||
titleId = R.string.frame_interpolation,
|
||||
descriptionId = R.string.frame_interpolation_description
|
||||
)
|
||||
)
|
||||
|
||||
// put(
|
||||
// SwitchSetting(
|
||||
// BooleanSetting.FRAME_SKIPPING,
|
||||
// titleId = R.string.frame_skipping,
|
||||
// descriptionId = R.string.frame_skipping_description
|
||||
// )
|
||||
// )
|
||||
|
||||
put(
|
||||
SwitchSetting(
|
||||
|
||||
@@ -463,6 +463,7 @@ class SettingsFragmentPresenter(
|
||||
add(BooleanSetting.RENDERER_EARLY_RELEASE_FENCES.key)
|
||||
add(IntSetting.DMA_ACCURACY.key)
|
||||
add(BooleanSetting.BUFFER_REORDER_DISABLE.key)
|
||||
add(BooleanSetting.FRAME_INTERPOLATION.key)
|
||||
add(BooleanSetting.RENDERER_FAST_GPU.key)
|
||||
add(IntSetting.FAST_GPU_TIME.key)
|
||||
add(IntSetting.RENDERER_SHADER_BACKEND.key)
|
||||
|
||||
@@ -1127,7 +1127,14 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback {
|
||||
val actualFps = perfStats[FPS]
|
||||
|
||||
if (BooleanSetting.SHOW_FPS.getBoolean(needsGlobal)) {
|
||||
val enableFrameInterpolation =
|
||||
BooleanSetting.FRAME_INTERPOLATION.getBoolean()
|
||||
// val enableFrameSkipping = BooleanSetting.FRAME_SKIPPING.getBoolean()
|
||||
|
||||
var fpsText = String.format("FPS: %.1f", actualFps)
|
||||
if (enableFrameInterpolation) {
|
||||
fpsText = String.format("eFPS: %.1f", actualFps)
|
||||
}
|
||||
sb.append(fpsText)
|
||||
}
|
||||
|
||||
|
||||
@@ -98,6 +98,8 @@
|
||||
<string name="sample_shading_fraction_description">كثافة تمرير تظليل العينة. تؤدي القيم الأعلى إلى تحسين الجودة بشكل أكبر، ولكنها تقلل أيضًا من الأداء إلى حد كبير.</string>
|
||||
|
||||
<string name="veil_renderer">العارض</string>
|
||||
<string name="frame_interpolation">تحسين سرعة الإطارات</string>
|
||||
<string name="frame_interpolation_description">يضمن تسليمًا سلسًا ومتناسقًا للإطارات من خلال مزامنة التوقيت بينها، مما يقلل من التقطيع وعدم انتظام الحركة. مثالي للألعاب التي تعاني من عدم استقرار في توقيت الإطارات أو تقطع دقيق أثناء اللعب.</string>
|
||||
<string name="renderer_early_release_fences">إطلاق الأسوار مبكرًا</string>
|
||||
<string name="renderer_early_release_fences_description">يساعد في إصلاح مشكلة 0 إطار في الثانية في ألعاب مثل DKCR:HD وSubnautica Below Zero وOri 2، ولكن قد يتسبب في تعطيل التحميل أو الأداء في ألعاب Unreal Engine.</string>
|
||||
<string name="sync_memory_operations">مزامنة عمليات الذاكرة</string>
|
||||
@@ -470,6 +472,8 @@
|
||||
<string name="display">الشاشة</string>
|
||||
<string name="processing">تأثيرات بعد المعالجة</string>
|
||||
|
||||
<string name="frame_skipping">قيد التطوير: تخطي الإطارات</string>
|
||||
<string name="frame_skipping_description">تبديل تخطي الإطارات لتحسين الأداء عن طريق تقليل عدد الإطارات المعروضة. هذه الميزة قيد التطوير وسيتم تمكينها في الإصدارات المستقبلية.</string>
|
||||
<string name="renderer_accuracy">مستوى الدقة</string>
|
||||
<string name="renderer_resolution">الدقة (الإرساء/محمول)</string>
|
||||
<string name="renderer_vsync">VSync وضع</string>
|
||||
|
||||
@@ -76,6 +76,8 @@
|
||||
<string name="sample_shading_fraction_description">چڕی تێپەڕاندنی سێبەرکردنی نموونە. بەهای زیاتر کوالێتی باشتر دەکات بەڵام کارایی زیاتر کەم دەکاتەوە.</string>
|
||||
|
||||
<string name="veil_renderer">رێندرەر</string>
|
||||
<string name="frame_interpolation">تحسين توقيت الإطارات</string>
|
||||
<string name="frame_interpolation_description">يضمن تسليمًا سلسًا ومتناسقًا للإطارات من خلال مزامنة التوقيت بينها، مما يقلل من التقطيع وعدم انتظام الحركة. مثالي للألعاب التي تعاني من عدم استقرار في توقيت الإطارات أو تقطع دقيق أثناء اللعب.</string>
|
||||
<string name="renderer_early_release_fences">زێدەکردنی پەرستارەکان زووتر</string>
|
||||
<string name="renderer_early_release_fences_description">یارمەتی دەدات لە چارەسەری 0 FPS لە یارییەکانی وەک DKCR:HD، Subnautica Below Zero و Ori 2، بەڵام ڕەنگە بارکردن یان کارایی لە یارییەکانی Unreal Engine تێکبدات.</string>
|
||||
<string name="sync_memory_operations">هاوبەشیی کردارەکانی بیرگە</string>
|
||||
@@ -380,6 +382,8 @@
|
||||
<string name="display">پیشاندان</string>
|
||||
<string name="processing">پاشپڕۆسەکردن</string>
|
||||
|
||||
<string name="frame_skipping">قيد التطوير: تخطي الإطارات</string>
|
||||
<string name="frame_skipping_description">تێپەڕاندنی فرەیمەکان بکە بۆ باشترکردنی کارایی بە کەمکردنەوەی ژمارەی فرەیمە ڕێندرکراوەکان. ئەم تایبەتمەندییە هێشتا کاردەکرێت و لە وەشانە داهاتووەکاندا چالاکدەکرێت.</string>
|
||||
<string name="renderer_accuracy">ئاستی وردبینی</string>
|
||||
<string name="renderer_resolution">ڕوونی (دۆخی دەستی/دۆخی دۆک)</string>
|
||||
<string name="renderer_vsync">دۆخی VSync</string>
|
||||
|
||||
@@ -76,6 +76,8 @@
|
||||
<string name="sample_shading_fraction_description">Intenzita průchodu stínování vzorku. Vyšší hodnoty zlepšují kvalitu, ale také výrazněji snižují výkon.</string>
|
||||
|
||||
<string name="veil_renderer">Renderer</string>
|
||||
<string name="frame_interpolation">Vylepšené časování snímků</string>
|
||||
<string name="frame_interpolation_description">Zajišťuje plynulé a konzistentní zobrazování snímků synchronizací jejich časování, čímž snižuje trhání a nerovnoměrné animace. Ideální pro hry, které trpí nestabilitou časování snímků nebo mikrotrháním během hraní.</string>
|
||||
<string name="renderer_early_release_fences">Uvolnit ploty brzy</string>
|
||||
<string name="renderer_early_release_fences_description">Pomáhá opravit 0 FPS v hrách jako DKCR:HD, Subnautica Below Zero a Ori 2, ale může narušit načítání nebo výkon v hrách na Unreal Engine.</string>
|
||||
<string name="sync_memory_operations">Synchronizace paměťových operací</string>
|
||||
@@ -368,6 +370,8 @@
|
||||
<string name="display">Zobrazení</string>
|
||||
<string name="processing">Postprocesing</string>
|
||||
|
||||
<string name="frame_skipping">WIP: Přeskočení snímků</string>
|
||||
<string name="frame_skipping_description">Přepínání přeskočení snímků pro zlepšení výkonu snížením počtu vykreslených snímků. Tato funkce je stále ve vývoji a bude povolena v budoucích verzích.</string>
|
||||
<string name="renderer_accuracy">Úroveň přesnosti</string>
|
||||
<string name="renderer_resolution">Rozlišení (Handheld/Docked)</string>
|
||||
<string name="renderer_vsync">VSync režim</string>
|
||||
|
||||
@@ -84,6 +84,8 @@
|
||||
<string name="sample_shading_fraction_description">Die Intensität des Sample-Shading-Durchgangs. Höhere Werte verbessern die Qualität stärker, beeinträchtigen aber auch die Leistung stärker.</string>
|
||||
|
||||
<string name="veil_renderer">Renderer</string>
|
||||
<string name="frame_interpolation">Erweiterte Frame-Synchronisation</string>
|
||||
<string name="frame_interpolation_description">Sorgt für eine gleichmäßige und konsistente Frame-Wiedergabe durch Synchronisierung der Frame-Zeiten, was Ruckeln und ungleichmäßige Animationen reduziert. Ideal für Spiele, die unter instabilen Frame-Zeiten oder Mikrorucklern leiden.</string>
|
||||
<string name="renderer_early_release_fences">Zäune früher freigeben</string>
|
||||
<string name="renderer_early_release_fences_description">Behebt 0 FPS in Spielen wie DKCR:HD, Subnautica Below Zero und Ori 2, kann aber Ladezeiten oder Performance in Unreal Engine-Spielen beeinträchtigen.</string>
|
||||
<string name="sync_memory_operations">Speicheroperationen synchronisieren</string>
|
||||
@@ -421,6 +423,12 @@ Wird der Handheld-Modus verwendet, verringert es die Auflösung und erhöht die
|
||||
|
||||
<!-- Graphics settings strings -->
|
||||
<string name="backend">Backend</string>
|
||||
<string name="display">Anzeige</string>
|
||||
<string name="processing">Nachbearbeitung</string>
|
||||
|
||||
<string name="frame_skipping">WIP: Frame Skipping</string>
|
||||
<string name="frame_skipping_description">Aktivieren Sie Frame Skipping, um die Leistung durch Reduzierung der gerenderten Frames zu verbessern. Diese Funktion wird noch entwickelt und in zukünftigen Versionen verfügbar sein.</string>
|
||||
<string name="renderer_accuracy">Genauigkeitsstufe</string>
|
||||
<string name="renderer_resolution">Auflösung (Handheld/Gedockt)</string>
|
||||
<string name="renderer_vsync">VSync-Modus</string>
|
||||
<string name="renderer_screen_layout">Ausrichtung</string>
|
||||
|
||||
@@ -98,6 +98,8 @@
|
||||
<string name="sample_shading_fraction_description">La intensidad del paso de sombreado de la muestra. Los valores más altos mejoran más la calidad, pero también reducen el rendimiento en mayor medida.</string>
|
||||
|
||||
<string name="veil_renderer">Renderizador</string>
|
||||
<string name="frame_interpolation">Ritmo de fotogramas mejorado</string>
|
||||
<string name="frame_interpolation_description">Garantiza una entrega de fotogramas fluida y consistente al sincronizar el tiempo entre fotogramas, reduciendo la tartamudez y la animación desigual. Ideal para juegos que experimentan inestabilidad en el tiempo de fotogramas o microtartamudeos durante el juego.</string>
|
||||
<string name="renderer_early_release_fences">Liberar las vallas antes</string>
|
||||
<string name="renderer_early_release_fences_description">Ayuda a arreglar 0 FPS en juegos como DKCR:HD, Subnautica Below Zero y Ori 2, pero puede romper la carga o el rendimiento en juegos de Unreal Engine.</string>
|
||||
<string name="sync_memory_operations">Sincronizar operaciones de memoria</string>
|
||||
@@ -444,6 +446,8 @@
|
||||
<string name="display">Pantalla</string>
|
||||
<string name="processing">Postprocesado</string>
|
||||
|
||||
<string name="frame_skipping">WIP: Salto de fotogramas</string>
|
||||
<string name="frame_skipping_description">Activa o desactiva el salto de fotogramas para mejorar el rendimiento reduciendo el número de fotogramas renderizados. Esta función está en desarrollo y se habilitará en futuras versiones.</string>
|
||||
<string name="renderer_accuracy">Nivel de precisión</string>
|
||||
<string name="renderer_resolution">Resolución (Portátil/Sobremesa)</string>
|
||||
<string name="renderer_vsync">Modo VSync</string>
|
||||
|
||||
@@ -65,6 +65,10 @@
|
||||
<string name="veil_misc">پردازنده و حافظه</string>
|
||||
<string name="eden_veil">پرده عدن</string>
|
||||
<string name="eden_veil_description">تنظیمات آزمایشی برای بهبود عملکرد و قابلیت. این تنظیمات ممکن است باعث نمایش صفحه سیاه یا سایر مشکلات بازی شود.</string>
|
||||
<string name="frame_skipping">در حال توسعه: رد کردن فریمها</string>
|
||||
<string name="frame_skipping_description">با فعال کردن رد کردن فریمها، عملکرد را با کاهش تعداد فریمهای رندر شده بهبود دهید. این قابلیت در حال توسعه است و در نسخههای آینده فعال خواهد شد.</string>
|
||||
<string name="frame_interpolation">زمانبندی پیشرفته فریمها</string>
|
||||
<string name="frame_interpolation_description">ارسال یکنواخت و پایدار فریمها را با همگامسازی زمان بین آنها تضمین میکند، که منجر به کاهش لرزش و انیمیشنهای ناهموار میشود. برای بازیهایی که ناپایداری در زمانبندی فریمها یا میکرو لرزش در حین بازی دارند ایدهآل است</string>
|
||||
<string name="renderer_early_release_fences">رهاسازی حصارها زودتر</string>
|
||||
<string name="renderer_early_release_fences_description">به رفع مشکل 0 فریم بر ثانیه در بازیهایی مانند DKCR:HD، Subnautica Below Zero و Ori 2 کمک میکند، اما ممکن است بارگذاری یا عملکرد بازیهای Unreal Engine را مختل کند.</string>
|
||||
<string name="sync_memory_operations">همگامسازی عملیات حافظه</string>
|
||||
|
||||
@@ -98,6 +98,8 @@
|
||||
<string name="sample_shading_fraction_description">L\'intensité de la passe d\'ombrage d\'échantillon. Des valeurs plus élevées améliorent davantage la qualité mais réduisent aussi plus fortement les performances.</string>
|
||||
|
||||
<string name="veil_renderer">Rendu</string>
|
||||
<string name="frame_interpolation">Synchronisation avancée des frames</string>
|
||||
<string name="frame_interpolation_description">Assure une diffusion fluide et régulière des frames en synchronisant leur timing, réduisant ainsi les saccades et les animations irrégulières. Idéal pour les jeux souffrant d`instabilité de timing des frames ou de micro-saccades pendant le jeu.</string>
|
||||
<string name="renderer_early_release_fences">Libérer les barrières plus tôt</string>
|
||||
<string name="renderer_early_release_fences_description">Résout les problèmes de 0 FPS dans des jeux comme DKCR:HD, Subnautica Below Zero et Ori 2, mais peut perturber le chargement ou les performances des jeux Unreal Engine.</string>
|
||||
<string name="sync_memory_operations">Synchroniser les opérations mémoire</string>
|
||||
@@ -445,6 +447,8 @@
|
||||
<string name="display">Affichage</string>
|
||||
<string name="processing">Post-traitement</string>
|
||||
|
||||
<string name="frame_skipping">WIP: Saut de frames</string>
|
||||
<string name="frame_skipping_description">Activez ou désactivez le saut d\'images pour améliorer les performances en réduisant le nombre d\'images affichées. Cette fonctionnalité est en cours de développement et sera activée dans les futures versions.</string>
|
||||
<string name="renderer_accuracy">Niveau de précision</string>
|
||||
<string name="renderer_resolution">Résolution (Mode Portable/Mode TV)</string>
|
||||
<string name="renderer_vsync">Mode VSync</string>
|
||||
|
||||
@@ -76,6 +76,8 @@
|
||||
<string name="sample_shading_fraction_description">עוצמת מעבר ההצללה לדוגמה. ערכים גבוהים יותר משפרים את האיכות יותר אך גם מפחיתים את הביצועים במידה רבה יותר.</string>
|
||||
|
||||
<string name="veil_renderer">רנדרר</string>
|
||||
<string name="frame_interpolation">סנכרון פריימים מתקדם</string>
|
||||
<string name="frame_interpolation_description">מבטיח אספקה חלקה ועקבית של פריימים על ידי סנכרון התזמון ביניהם, מפחית קפיצות ואנימציה לא אחידה. אידיאלי למשחקים עם בעיות בתזמון פריימים או מיקרו-קפיצות במהלך המשחק.</string>
|
||||
<string name="renderer_early_release_fences">שחרר גדרות מוקדם</string>
|
||||
<string name="renderer_early_release_fences_description">עוזר לתקן 0 FPS במשחקים כמו DKCR:HD, Subnautica Below Zero ו-Ori 2, אך עלול לפגוע בטעינה או בביצועים במשחקי Unreal Engine.</string>
|
||||
<string name="sync_memory_operations">סנכרון פעולות זיכרון</string>
|
||||
@@ -404,6 +406,8 @@
|
||||
<string name="display">תצוגה</string>
|
||||
<string name="processing">עיבוד לאחר</string>
|
||||
|
||||
<string name="frame_skipping">בעבודה: דילוג פריימים</string>
|
||||
<string name="frame_skipping_description">החלף דילוג על פריימים כדי לשפר ביצועים על ידי הפחתת מספר הפריימים המוצגים. תכונה זו עדיין בפיתוח ותופעל בגרסאות עתידיות.</string>
|
||||
<string name="renderer_accuracy">רמת דיוק</string>
|
||||
<string name="renderer_resolution">רזולוציה (מעוגן/נייד)</string>
|
||||
<string name="renderer_vsync">מצב VSync</string>
|
||||
|
||||
@@ -76,6 +76,8 @@
|
||||
<string name="sample_shading_fraction_description">A mintavételezés árnyékolási lépés intenzitása. A magasabb értékek jobb minőséget eredményeznek, de nagyobb mértékben csökkentik a teljesítményt.</string>
|
||||
|
||||
<string name="veil_renderer">Megjelenítő</string>
|
||||
<string name="frame_interpolation">Továbbfejlesztett Képkocka-időzítés</string>
|
||||
<string name="frame_interpolation_description">Biztosítja a képkockák sima és egyenletes kézbesítését azok időzítésének szinkronizálásával, csökkentve a megakadásokat és egyenetlen animációkat. Ideális azokhoz a játékokhoz, amelyek képkocka-időzítési instabilitást vagy mikro-reccsenést tapasztalnak játék közben.</string>
|
||||
<string name="renderer_early_release_fences">Korai kerítés-felszabadítás</string>
|
||||
<string name="renderer_early_release_fences_description">Segít javítani a 0 FPS-t olyan játékokban, mint a DKCR:HD, Subnautica Below Zero és az Ori 2, de ronthatja az Unreal Engine játékok betöltését vagy teljesítményét.</string>
|
||||
<string name="sync_memory_operations">Memória-műveletek szinkronizálása</string>
|
||||
@@ -399,6 +401,8 @@
|
||||
<string name="display">Kijelző</string>
|
||||
<string name="processing">Utófeldolgozás</string>
|
||||
|
||||
<string name="frame_skipping">Folyamatban: Képkihagyás</string>
|
||||
<string name="frame_skipping_description">Kapcsolja be a képkihagyást a teljesítmény javításához a renderelt képkockák számának csökkentésével. Ez a funkció még fejlesztés alatt áll, és a jövőbeli kiadásokban lesz elérhető.</string>
|
||||
<string name="renderer_accuracy">Pontosság szintje</string>
|
||||
<string name="renderer_resolution">Felbontás (Kézi/Dockolt)</string>
|
||||
<string name="renderer_vsync">VSync mód</string>
|
||||
|
||||
@@ -98,6 +98,8 @@
|
||||
<string name="sample_shading_fraction_description">Intensitas proses pencahayaan sampel. Nilai lebih tinggi meningkatkan kualitas lebih baik tetapi juga mengurangi performa lebih besar.</string>
|
||||
|
||||
<string name="veil_renderer">Renderer</string>
|
||||
<string name="frame_interpolation">Penyelarasan Frame Tingkat Lanjut</string>
|
||||
<string name="frame_interpolation_description">Memastikan pengiriman frame yang halus dan konsisten dengan menyinkronkan waktu antar frame, mengurangi stuttering dan animasi tidak rata. Ideal untuk game yang mengalami ketidakstabilan waktu frame atau micro-stutter selama gameplay.</string>
|
||||
<string name="renderer_early_release_fences">Lepas Pagar Lebih Awal</string>
|
||||
<string name="renderer_early_release_fences_description">Membantu memperbaiki 0 FPS di game seperti DKCR:HD, Subnautica Below Zero dan Ori 2, tapi mungkin mengganggu loading atau performa di game Unreal Engine.</string>
|
||||
<string name="sync_memory_operations">Sinkronisasi Operasi Memori</string>
|
||||
@@ -435,6 +437,8 @@
|
||||
<string name="display">Tampilan</string>
|
||||
<string name="processing">Pascaproses</string>
|
||||
|
||||
<string name="frame_skipping">WIP: Loncatan Frame</string>
|
||||
<string name="frame_skipping_description">Aktifkan atau nonaktifkan frame skipping untuk meningkatkan performa dengan mengurangi jumlah frame yang dirender. Fitur ini masih dalam pengembangan dan akan diaktifkan di rilis mendatang.</string>
|
||||
<string name="renderer_accuracy">Tingkatan Akurasi</string>
|
||||
<string name="renderer_resolution">Resolusi (Handheld/Docked)</string>
|
||||
<string name="renderer_vsync">Mode Sinkronisasi Vertikal</string>
|
||||
|
||||
@@ -98,6 +98,8 @@
|
||||
<string name="sample_shading_fraction_description">L\'intensità della passata di ombreggiatura campione. Valori più alti migliorano la qualità ma riducono maggiormente le prestazioni.</string>
|
||||
|
||||
<string name="veil_renderer">Renderer</string>
|
||||
<string name="frame_interpolation">Sincronizzazione avanzata fotogrammi</string>
|
||||
<string name="frame_interpolation_description">Garantisce una consegna fluida e costante dei fotogrammi sincronizzandone i tempi, riducendo scatti e animazioni irregolari. Ideale per giochi che presentano instabilità nei tempi dei fotogrammi o micro-scatti durante il gameplay.</string>
|
||||
<string name="renderer_early_release_fences">Rilascia le barriere prima</string>
|
||||
<string name="renderer_early_release_fences_description">Risolve problemi di 0 FPS in giochi come DKCR:HD, Subnautica Below Zero e Ori 2, ma potrebbe compromettere caricamento o prestazioni in giochi Unreal Engine.</string>
|
||||
<string name="sync_memory_operations">Sincronizza operazioni di memoria</string>
|
||||
@@ -445,6 +447,8 @@
|
||||
<string name="display">Schermo</string>
|
||||
<string name="processing">Post-elaborazione</string>
|
||||
|
||||
<string name="frame_skipping">WIP: Salto fotogrammi</string>
|
||||
<string name="frame_skipping_description">Attiva o disattiva il salto dei fotogrammi per migliorare le prestazioni riducendo il numero di fotogrammi renderizzati. Questa funzionalità è ancora in sviluppo e verrà abilitata nelle versioni future.</string>
|
||||
<string name="renderer_accuracy">Livello di accuratezza</string>
|
||||
<string name="renderer_resolution">Risoluzione (Portatile/Docked)</string>
|
||||
<string name="renderer_vsync">Modalità VSync</string>
|
||||
|
||||
@@ -76,6 +76,8 @@
|
||||
<string name="sample_shading_fraction_description">サンプルシェーディング処理の強度。高い値ほど品質は向上しますが、パフォーマンスも大きく低下します。</string>
|
||||
|
||||
<string name="veil_renderer">レンダラー</string>
|
||||
<string name="frame_interpolation">高度なフレーム同期</string>
|
||||
<string name="frame_interpolation_description">フレーム間のタイミングを同期させることで、スムーズで一貫したフレーム配信を確保し、カクつきや不均一なアニメーションを軽減します。フレームタイミングの不安定さやマイクロスタッターが発生するゲームに最適です。</string>
|
||||
<string name="renderer_early_release_fences">フェンスを早期に解放</string>
|
||||
<string name="renderer_early_release_fences_description">DKCR:HD、Subnautica Below Zero、Ori 2などのゲームで0 FPSを修正しますが、Unreal Engineゲームの読み込みやパフォーマンスに影響する可能性があります。</string>
|
||||
<string name="sync_memory_operations">メモリ操作の同期</string>
|
||||
@@ -399,6 +401,8 @@
|
||||
<string name="display">ディスプレイ</string>
|
||||
<string name="processing">後処理</string>
|
||||
|
||||
<string name="frame_skipping">WIP: フレームスキップ</string>
|
||||
<string name="frame_skipping_description">フレームスキップを切り替えて、レンダリングされるフレーム数を減らしパフォーマンスを向上させます。この機能は開発中であり、今後のリリースで有効になります。</string>
|
||||
<string name="renderer_accuracy">精度</string>
|
||||
<string name="renderer_resolution">解像度(携帯モード/TVモード)</string>
|
||||
<string name="renderer_vsync">垂直同期モード</string>
|
||||
|
||||
@@ -76,6 +76,8 @@
|
||||
<string name="sample_shading_fraction_description">샘플 쉐이딩 패스의 강도. 값이 높을수록 품질이 더 향상되지만 성능도 더 크게 저하됩니다.</string>
|
||||
|
||||
<string name="veil_renderer">렌더러</string>
|
||||
<string name="frame_interpolation">향상된 프레임 페이싱</string>
|
||||
<string name="frame_interpolation_description">프레임 간 타이밍을 동기화하여 부드럽고 일관된 프레임 전달을 보장하며, 끊김과 불균일한 애니메이션을 줄입니다. 프레임 타이밍 불안정이나 게임 플레이 중 미세 끊김이 발생하는 게임에 이상적입니다.</string>
|
||||
<string name="renderer_early_release_fences">펜스 조기 해제</string>
|
||||
<string name="renderer_early_release_fences_description">DKCR:HD, Subnautica Below Zero, Ori 2 등의 게임에서 0 FPS 현상을 해결하지만, Unreal Engine 게임의 로딩이나 성능에 문제를 일으킬 수 있습니다.</string>
|
||||
<string name="sync_memory_operations">메모리 작업 동기화</string>
|
||||
@@ -399,6 +401,8 @@
|
||||
<string name="display">디스플레이</string>
|
||||
<string name="processing">후처리</string>
|
||||
|
||||
<string name="frame_skipping">작업 중: 프레임 스킵</string>
|
||||
<string name="frame_skipping_description">렌더링되는 프레임 수를 줄여 성능을 향상시키기 위해 프레임 스킵을 전환합니다. 이 기능은 현재 개발 중이며 향후 출시 버전에서 활성화될 예정입니다.</string>
|
||||
<string name="renderer_accuracy">정확도 수준</string>
|
||||
<string name="renderer_resolution">해상도 (휴대 모드/독 모드)</string>
|
||||
<string name="renderer_vsync">수직동기화 모드</string>
|
||||
|
||||
@@ -76,6 +76,8 @@
|
||||
<string name="sample_shading_fraction_description">Intensiteten til prøveskyggepasseringen. Høyere verdier forbedrer kvaliteten mer, men reduserer også ytelsen i større grad.</string>
|
||||
|
||||
<string name="veil_renderer">Renderer</string>
|
||||
<string name="frame_interpolation">Avansert bildevindu-synkronisering</string>
|
||||
<string name="frame_interpolation_description">Sikrer jevn og konsekvent bildelevering ved å synkronisere tiden mellom bilder, noe som reduserer hakking og ujevn animasjon. Ideelt for spill som opplever ustabil bildetid eller mikro-hakk under spilling.</string>
|
||||
<string name="renderer_early_release_fences">Frigjør gjerder tidlig</string>
|
||||
<string name="renderer_early_release_fences_description">Løser 0 FPS i spill som DKCR:HD, Subnautica Below Zero og Ori 2, men kan forårsake problemer med lasting eller ytelse i Unreal Engine-spill.</string>
|
||||
<string name="sync_memory_operations">Synkroniser minneoperasjoner</string>
|
||||
@@ -380,6 +382,8 @@
|
||||
<string name="display">Skjerm</string>
|
||||
<string name="processing">Etterbehandling</string>
|
||||
|
||||
<string name="frame_skipping">WIP: Hoppe over bilder</string>
|
||||
<string name="frame_skipping_description">Slå av/på frame skipping for å forbedre ytelsen ved å redusere antall renderte bilder. Denne funksjonen er fortsatt under utvikling og vil bli aktivert i fremtidige versjoner.</string>
|
||||
<string name="renderer_accuracy">Nøyaktighetsnivå</string>
|
||||
<string name="renderer_resolution">Oppløsning (håndholdt/dokket)</string>
|
||||
<string name="renderer_vsync">VSync-modus</string>
|
||||
|
||||
@@ -98,6 +98,8 @@
|
||||
<string name="sample_shading_fraction_description">Intensywność przebiegu cieniowania próbki. Wyższe wartości poprawiają jakość, ale także w większym stopniu zmniejszają wydajność.</string>
|
||||
|
||||
<string name="veil_renderer">Renderer</string>
|
||||
<string name="frame_interpolation">Zaawansowana synchronizacja klatek</string>
|
||||
<string name="frame_interpolation_description">Zapewnia płynne i spójne wyświetlanie klatek poprzez synchronizację ich czasu, redukując zacinanie i nierówną animację. Idealne dla gier z niestabilnym czasem klatek lub mikro-zacinaniem podczas rozgrywki.</string>
|
||||
<string name="renderer_early_release_fences">Wcześniejsze zwalnianie zabezpieczeń</string>
|
||||
<string name="renderer_early_release_fences_description">Pomaga naprawić 0 FPS w grach takich jak DKCR:HD, Subnautica Below Zero i Ori 2, ale może zaburzyć ładowanie lub wydajność w grach Unreal Engine.</string>
|
||||
<string name="sync_memory_operations">Synchronizuj operacje pamięci</string>
|
||||
@@ -466,6 +468,8 @@
|
||||
<string name="display">Wyświetlacz</string>
|
||||
<string name="processing">Postprocessing</string>
|
||||
|
||||
<string name="frame_skipping">WIP: Pomijanie klatek</string>
|
||||
<string name="frame_skipping_description">Włącz lub wyłącz pomijanie klatek, aby poprawić wydajność poprzez zmniejszenie liczby renderowanych klatek. Ta funkcja jest wciąż w fazie rozwoju i zostanie włączona w przyszłych wersjach.</string>
|
||||
<string name="renderer_accuracy">Poziom precyzji emulacji</string>
|
||||
<string name="renderer_resolution">Rozdzielczość (Handheld/Zadokowany)</string>
|
||||
<string name="renderer_vsync">Synchronizacja pionowa VSync</string>
|
||||
|
||||
@@ -98,6 +98,8 @@
|
||||
<string name="sample_shading_fraction_description">Fração de Sombreamento de Amostra: Define a intensidade do sample shading. Quanto maior, melhor a qualidade, mas maior o impacto no desempenho.</string>
|
||||
|
||||
<string name="veil_renderer">Renderizador</string>
|
||||
<string name="frame_interpolation">Enhanced Frame Pacing</string>
|
||||
<string name="frame_interpolation_description">Sincronização Melhorada de Quadros: Sincroniza o tempo entre os quadros para uma entrega mais uniforme, reduzindo travamentos e animações irregulares. Útil em jogos que sofrem com microtravamentos ou instabilidade na taxa de frames.</string>
|
||||
<string name="renderer_early_release_fences">Release Fences Early</string>
|
||||
<string name="renderer_early_release_fences_description">Liberar Cercas Antecipadamente: Ajuda a corrigir 0 FPS em jogos como DKCR:HD, Subnautica Below Zero e Ori 2, mas pode prejudicar o carregamento ou o desempenho em jogos feitos com Unreal Engine.</string>
|
||||
<string name="sync_memory_operations">Sincronizar Operações de Memória</string>
|
||||
@@ -444,6 +446,8 @@
|
||||
<string name="display">Tela</string>
|
||||
<string name="processing">Pós-Processamento</string>
|
||||
|
||||
<string name="frame_skipping">WIP: Pular quadros</string>
|
||||
<string name="frame_skipping_description">Ative ou desative o pulo de quadros para melhorar o desempenho reduzindo o número de quadros renderizados. Este recurso ainda está em desenvolvimento e será habilitado em versões futuras.</string>
|
||||
<string name="renderer_accuracy">Nível de precisão</string>
|
||||
<string name="renderer_resolution">Resolução (Portátil/Modo TV)</string>
|
||||
<string name="renderer_vsync">Modo de VSync</string>
|
||||
|
||||
@@ -76,6 +76,8 @@
|
||||
<string name="sample_shading_fraction_description">A intensidade da passagem de sombreamento de amostra. Valores mais elevados melhoram a qualidade, mas também reduzem o desempenho numa maior medida.</string>
|
||||
|
||||
<string name="veil_renderer">Renderizador</string>
|
||||
<string name="frame_interpolation">Sincronização avançada de frames</string>
|
||||
<string name="frame_interpolation_description">Garante uma entrega suave e consistente de frames sincronizando o seu tempo, reduzindo engasgadelas e animações irregulares. Ideal para jogos que experienciam instabilidade no tempo de frames ou micro-engasgadelas durante o jogo.</string>
|
||||
<string name="renderer_early_release_fences">Libertar barreiras antecipadamente</string>
|
||||
<string name="renderer_early_release_fences_description">Ajuda a corrigir 0 FPS em jogos como DKCR:HD, Subnautica Below Zero e Ori 2, mas pode afetar carregamento ou desempenho em jogos Unreal Engine.</string>
|
||||
<string name="sync_memory_operations">Sincronizar Operações de Memória</string>
|
||||
@@ -403,6 +405,8 @@
|
||||
<string name="display">Ecrã</string>
|
||||
<string name="processing">Pós-processamento</string>
|
||||
|
||||
<string name="frame_skipping">WIP: Saltar frames</string>
|
||||
<string name="frame_skipping_description">Ative ou desative o salto de frames para melhorar o desempenho reduzindo o número de frames renderizados. Esta funcionalidade ainda está em desenvolvimento e será ativada em versões futuras.</string>
|
||||
<string name="renderer_accuracy">Nível de precisão</string>
|
||||
<string name="renderer_resolution">Resolução (Portátil/Ancorado)</string>
|
||||
<string name="renderer_vsync">Modo VSync</string>
|
||||
|
||||
@@ -98,6 +98,8 @@
|
||||
<string name="sample_shading_fraction_description">Интенсивность прохода сэмплового затенения. Более высокие значения улучшают качество, но и сильнее снижают производительность.</string>
|
||||
|
||||
<string name="veil_renderer">Рендеринг</string>
|
||||
<string name="frame_interpolation">Улучшенная синхронизация кадров</string>
|
||||
<string name="frame_interpolation_description">Обеспечивает плавную и стабильную подачу кадров за счет синхронизации их времени, уменьшая подтормаживания и неравномерную анимацию. Идеально для игр с нестабильным временем кадров или микро-подтормаживаниями во время игры.</string>
|
||||
<string name="renderer_early_release_fences">Ранний релиз ограждений</string>
|
||||
<string name="renderer_early_release_fences_description">Помогает исправить 0 FPS в играх типа DKCR:HD, Subnautica Below Zero и Ori 2, но может нарушить загрузку или производительность в играх на Unreal Engine.</string>
|
||||
<string name="sync_memory_operations">Синхронизация операций с памятью</string>
|
||||
@@ -464,6 +466,8 @@
|
||||
<string name="display">Дисплей</string>
|
||||
<string name="processing">Постобработка</string>
|
||||
|
||||
<string name="frame_skipping">В разработке: Пропуск кадров</string>
|
||||
<string name="frame_skipping_description">Включите или отключите пропуск кадров для повышения производительности за счет уменьшения количества отображаемых кадров. Эта функция находится в разработке и будет включена в будущих версиях.</string>
|
||||
<string name="renderer_accuracy">Уровень точности</string>
|
||||
<string name="renderer_resolution">Разрешение (портативное/в док-станции)</string>
|
||||
<string name="renderer_vsync">Режим верт. синхронизации</string>
|
||||
|
||||
@@ -75,6 +75,8 @@
|
||||
<string name="sample_shading_fraction_description">Интензитет проласка сенчења узорка. Веће вредности побољшавају квалитет више, али такође више смањују перформансе.</string>
|
||||
|
||||
<string name="veil_renderer">Рендерер</string>
|
||||
<string name="frame_interpolation">Побољшани оквирни пејсинг</string>
|
||||
<string name="frame_interpolation_description">Осигурава глатку и доследан испоруку оквира синхронизацијом времена између оквира, смањење муцања и неуједначене анимације. Идеално за игре које доживљавају временски оквир нестабилност или микро-штитнике током играња.</string>
|
||||
<string name="renderer_early_release_fences">Ranije oslobađanje ograda</string>
|
||||
<string name="renderer_early_release_fences_description">Pomaže u popravci 0 FPS u igrama kao što su DKCR:HD, Subnautica Below Zero i Ori 2, ali može oštetiti učitavanje ili performanse u Unreal Engine igrama.</string>
|
||||
<string name="sync_memory_operations">Синхронизација меморијских операција</string>
|
||||
@@ -403,6 +405,8 @@
|
||||
<string name="display">Приказ</string>
|
||||
<string name="processing">Постпроцесирање</string>
|
||||
|
||||
<string name="frame_skipping">ВИП: Фрамескип</string>
|
||||
<string name="frame_skipping_description">Пребацивање оквира прескакање да бисте побољшали перформансе смањењем броја пружених оквира. Ова функција се и даље ради и биће омогућена у будућим издањима.</string>
|
||||
<string name="renderer_accuracy">Ниво тачности</string>
|
||||
<string name="renderer_resolution">Резолуција (ручно / прикључено)</string>
|
||||
<string name="renderer_vsync">Всинц мод</string>
|
||||
|
||||
@@ -98,6 +98,8 @@
|
||||
<string name="sample_shading_fraction_description">Інтенсивність проходу затінення зразка. Вищі значення покращують якість, але й сильніше знижують продуктивність.</string>
|
||||
|
||||
<string name="veil_renderer">Візуалізатор</string>
|
||||
<string name="frame_interpolation">Покращена синхронізація кадрів</string>
|
||||
<string name="frame_interpolation_description">Забезпечує плавну та стабільну подачу кадрів шляхом синхронізації їх часу, зменшуючи підвисання та нерівномірну анімацію. Ідеально для ігор з нестабільним часом кадрів або мікро-підвисаннями під час гри.</string>
|
||||
<string name="renderer_early_release_fences">Release fences early</string>
|
||||
<string name="renderer_early_release_fences_description">Це налаштування може бути необхідним для виправлення помилок 0FPS у деяких іграх (зокрема DKCR:HD, Subnautica та Ori 2). Водночас інші ігри, особливо створені на рушії Unreal Engine, можуть працювати некоректно або взагалі не запускатися.</string>
|
||||
<string name="sync_memory_operations">Синхронізація операцій з пам\'яттю</string>
|
||||
@@ -466,6 +468,8 @@
|
||||
<string name="display">Дисплей</string>
|
||||
<string name="processing">Постобробка</string>
|
||||
|
||||
<string name="frame_skipping">В розробці: Пропуск кадрів</string>
|
||||
<string name="frame_skipping_description">Увімкніть або вимкніть пропуск кадрів для покращення продуктивності за рахунок зменшення кількості візуалізованих кадрів. Ця функція ще розробляється та буде доступна у майбутніх версіях.</string>
|
||||
<string name="renderer_accuracy">Рівень точності</string>
|
||||
<string name="renderer_resolution">Роздільна здатність (Портативний/Док)</string>
|
||||
<string name="renderer_vsync">Режим верт. синхронізації</string>
|
||||
|
||||
@@ -76,6 +76,8 @@
|
||||
<string name="sample_shading_fraction_description">Cường độ của bước tô bóng mẫu. Giá trị cao hơn cải thiện chất lượng tốt hơn nhưng cũng giảm hiệu suất nhiều hơn.</string>
|
||||
|
||||
<string name="veil_renderer">Trình kết xuất</string>
|
||||
<string name="frame_interpolation">Đồng bộ khung hình nâng cao</string>
|
||||
<string name="frame_interpolation_description">Đảm bảo cung cấp khung hình mượt mà và ổn định bằng cách đồng bộ hóa thời gian giữa các khung hình, giảm giật lag và hoạt ảnh không đồng đều. Lý tưởng cho các trò chơi gặp vấn đề về thời gian khung hình không ổn định hoặc giật lag nhẹ trong khi chơi.</string>
|
||||
<string name="renderer_early_release_fences">Giải phóng rào chắn sớm</string>
|
||||
<string name="renderer_early_release_fences_description">Giúp sửa lỗi 0 FPS trong các trò chơi như DKCR:HD, Subnautica Below Zero và Ori 2, nhưng có thể ảnh hưởng đến tải hoặc hiệu suất trong trò chơi Unreal Engine.</string>
|
||||
<string name="sync_memory_operations">Đồng bộ hoá thao tác bộ nhớ</string>
|
||||
@@ -378,6 +380,8 @@
|
||||
<string name="display">Hiển thị</string>
|
||||
<string name="processing">Hậu xử lý</string>
|
||||
|
||||
<string name="frame_skipping">WIP: Bỏ qua khung hình</string>
|
||||
<string name="frame_skipping_description">Bật hoặc tắt bỏ qua khung hình để cải thiện hiệu suất bằng cách giảm số lượng khung hình được kết xuất. Tính năng này đang được phát triển và sẽ được kích hoạt trong các bản phát hành tương lai.</string>
|
||||
<string name="renderer_accuracy">Mức độ chính xác</string>
|
||||
<string name="renderer_resolution">Độ phân giải (Handheld/Docked)</string>
|
||||
<string name="renderer_vsync">Chế độ VSync</string>
|
||||
|
||||
@@ -98,6 +98,8 @@
|
||||
<string name="sample_shading_fraction_description">采样着色处理的强度。值越高,质量改善越多,但性能降低也越明显。</string>
|
||||
|
||||
<string name="veil_renderer">渲染器</string>
|
||||
<string name="frame_interpolation">增强帧同步</string>
|
||||
<string name="frame_interpolation_description">通过同步帧间时间确保流畅一致的帧交付,减少卡顿和不均匀动画。适合存在帧时间不稳定或游戏过程中出现微卡顿的游戏。</string>
|
||||
<string name="renderer_early_release_fences">提前释放围栏</string>
|
||||
<string name="renderer_early_release_fences_description">可修复《大金刚国度:热带寒流》《深海迷航:零度之下》和《奥日2》等游戏中的0 FPS问题,但可能影响Unreal Engine游戏的加载或性能。</string>
|
||||
<string name="sync_memory_operations">同步内存操作</string>
|
||||
@@ -441,6 +443,8 @@
|
||||
<string name="display">显示</string>
|
||||
<string name="processing">后处理</string>
|
||||
|
||||
<string name="frame_skipping">开发中:跳帧</string>
|
||||
<string name="frame_skipping_description">启用或禁用跳帧以减少渲染帧数,提高性能。此功能仍在开发中,将在未来版本中启用。</string>
|
||||
<string name="renderer_accuracy">精度等级</string>
|
||||
<string name="renderer_resolution">分辨率 (掌机模式/主机模式)</string>
|
||||
<string name="renderer_vsync">垂直同步模式</string>
|
||||
|
||||
@@ -98,6 +98,8 @@
|
||||
<string name="sample_shading_fraction_description">採樣著色處理的強度。數值越高,品質改善越多,但效能降低也越明顯。</string>
|
||||
|
||||
<string name="veil_renderer">渲染器</string>
|
||||
<string name="frame_interpolation">增強幀同步</string>
|
||||
<string name="frame_interpolation_description">通過同步幀間時間確保幀傳輸流暢一致,減少卡頓和不均勻動畫。適合存在幀時間不穩定或遊戲過程中出現些微卡頓的遊戲。</string>
|
||||
<string name="renderer_early_release_fences">提前釋放圍欄</string>
|
||||
<string name="renderer_early_release_fences_description">可修復《咚奇剛歸來HD》、《深海迷航:冰點之下》和《聖靈之光2》等遊戲中的0 FPS問題,但可能影響Unreal Engine遊戲的載入或效能。</string>
|
||||
<string name="sync_memory_operations">同步記憶體操作</string>
|
||||
@@ -441,6 +443,8 @@
|
||||
<string name="display">顯示</string>
|
||||
<string name="processing">後處理</string>
|
||||
|
||||
<string name="frame_skipping">開發中:跳幀</string>
|
||||
<string name="frame_skipping_description">啟用或停用跳幀以減少渲染幀數,提高效能。此功能仍在開發中,將在未來版本中啟用。</string>
|
||||
<string name="renderer_accuracy">準確度層級</string>
|
||||
<string name="renderer_resolution">解析度 (手提/底座)</string>
|
||||
<string name="renderer_vsync">垂直同步</string>
|
||||
|
||||
@@ -105,6 +105,8 @@
|
||||
<string name="sample_shading_fraction_description">The intensity of the sample shading pass. Higher values improve quality more but also reduce performance to a greater extent.</string>
|
||||
|
||||
<string name="veil_renderer">Renderer</string>
|
||||
<string name="frame_interpolation">Enhanced Frame Pacing</string>
|
||||
<string name="frame_interpolation_description">Ensures smooth and consistent frame delivery by synchronizing the timing between frames, reducing stuttering and uneven animation. Ideal for games that experience frame timing instability or micro-stutters during gameplay.</string>
|
||||
<string name="renderer_early_release_fences">Release Fences Early</string>
|
||||
<string name="renderer_early_release_fences_description">Helps fix 0 FPS in games like DKCR:HD, Subnautica Below Zero and Ori 2, but may break loading or performance in Unreal Engine games.</string>
|
||||
<string name="sync_memory_operations">Sync Memory Operations</string>
|
||||
@@ -487,6 +489,8 @@
|
||||
<string name="display">Display</string>
|
||||
<string name="processing">Post-Processing</string>
|
||||
|
||||
<string name="frame_skipping">WIP: Frameskip</string>
|
||||
<string name="frame_skipping_description">Toggle frame skipping to improve performance by reducing the number of rendered frames. This feature is still being worked on and will be enabled in future releases.</string>
|
||||
<string name="renderer_accuracy">Accuracy level</string>
|
||||
<string name="renderer_resolution">Resolution (Handheld/Docked)</string>
|
||||
<string name="renderer_vsync">VSync mode</string>
|
||||
|
||||
@@ -181,6 +181,12 @@ if(ANDROID)
|
||||
android/applets/software_keyboard.h)
|
||||
endif()
|
||||
|
||||
if(LINUX AND NOT APPLE)
|
||||
target_sources(common PRIVATE linux/gamemode.cpp linux/gamemode.h)
|
||||
|
||||
target_link_libraries(common PRIVATE gamemode::headers)
|
||||
endif()
|
||||
|
||||
if(ARCHITECTURE_x86_64)
|
||||
target_sources(
|
||||
common
|
||||
|
||||
40
src/common/linux/gamemode.cpp
Normal file
40
src/common/linux/gamemode.cpp
Normal file
@@ -0,0 +1,40 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include <gamemode_client.h>
|
||||
|
||||
#include "common/linux/gamemode.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "common/settings.h"
|
||||
|
||||
namespace Common::Linux {
|
||||
|
||||
void StartGamemode() {
|
||||
if (Settings::values.enable_gamemode) {
|
||||
if (gamemode_request_start() < 0) {
|
||||
LOG_WARNING(Frontend, "Failed to start gamemode: {}", gamemode_error_string());
|
||||
} else {
|
||||
LOG_INFO(Frontend, "Started gamemode");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void StopGamemode() {
|
||||
if (Settings::values.enable_gamemode) {
|
||||
if (gamemode_request_end() < 0) {
|
||||
LOG_WARNING(Frontend, "Failed to stop gamemode: {}", gamemode_error_string());
|
||||
} else {
|
||||
LOG_INFO(Frontend, "Stopped gamemode");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SetGamemodeState(bool state) {
|
||||
if (state) {
|
||||
StartGamemode();
|
||||
} else {
|
||||
StopGamemode();
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Common::Linux
|
||||
24
src/common/linux/gamemode.h
Normal file
24
src/common/linux/gamemode.h
Normal file
@@ -0,0 +1,24 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace Common::Linux {
|
||||
|
||||
/**
|
||||
* Start the (Feral Interactive) Linux gamemode if it is installed and it is activated
|
||||
*/
|
||||
void StartGamemode();
|
||||
|
||||
/**
|
||||
* Stop the (Feral Interactive) Linux gamemode if it is installed and it is activated
|
||||
*/
|
||||
void StopGamemode();
|
||||
|
||||
/**
|
||||
* Start or stop the (Feral Interactive) Linux gamemode if it is installed and it is activated
|
||||
* @param state The new state the gamemode should have
|
||||
*/
|
||||
void SetGamemodeState(bool state);
|
||||
|
||||
} // namespace Common::Linux
|
||||
@@ -271,6 +271,8 @@ const char* TranslateCategory(Category category) {
|
||||
return "Services";
|
||||
case Category::Paths:
|
||||
return "Paths";
|
||||
case Category::Linux:
|
||||
return "Linux";
|
||||
case Category::MaxEnum:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -333,7 +333,12 @@ struct Values {
|
||||
"shader_backend", Category::Renderer, Specialization::RuntimeList};
|
||||
SwitchableSetting<int> vulkan_device{linkage, 0, "vulkan_device", Category::Renderer,
|
||||
Specialization::RuntimeList};
|
||||
|
||||
#ifdef __ANDROID__
|
||||
SwitchableSetting<bool> frame_interpolation{linkage, true, "frame_interpolation", Category::Renderer,
|
||||
Specialization::RuntimeList};
|
||||
SwitchableSetting<bool> frame_skipping{linkage, false, "frame_skipping", Category::Renderer,
|
||||
Specialization::RuntimeList};
|
||||
#endif
|
||||
SwitchableSetting<bool> use_disk_shader_cache{linkage, true, "use_disk_shader_cache",
|
||||
Category::Renderer};
|
||||
SwitchableSetting<SpirvOptimizeMode, true> optimize_spirv_output{linkage,
|
||||
@@ -616,6 +621,13 @@ struct Values {
|
||||
true,
|
||||
true};
|
||||
|
||||
// Linux
|
||||
SwitchableSetting<bool> enable_gamemode{linkage, true, "enable_gamemode", Category::Linux};
|
||||
#ifdef __unix__
|
||||
SwitchableSetting<bool> gui_force_x11{linkage, false, "gui_force_x11", Category::Linux};
|
||||
Setting<bool> gui_hide_backend_warning{linkage, false, "gui_hide_backend_warning", Category::Linux};
|
||||
#endif
|
||||
|
||||
// Controls
|
||||
InputSetting<std::array<PlayerInput, 10>> players;
|
||||
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
@@ -47,6 +44,7 @@ enum class Category : u32 {
|
||||
Multiplayer,
|
||||
Services,
|
||||
Paths,
|
||||
Linux,
|
||||
LibraryApplet,
|
||||
MaxEnum,
|
||||
};
|
||||
|
||||
@@ -308,6 +308,16 @@ void Config::ReadDebuggingValues() {
|
||||
EndGroup();
|
||||
}
|
||||
|
||||
#ifdef __unix__
|
||||
void Config::ReadLinuxValues() {
|
||||
BeginGroup(Settings::TranslateCategory(Settings::Category::Linux));
|
||||
|
||||
ReadCategory(Settings::Category::Linux);
|
||||
|
||||
EndGroup();
|
||||
}
|
||||
#endif
|
||||
|
||||
void Config::ReadServiceValues() {
|
||||
BeginGroup(Settings::TranslateCategory(Settings::Category::Services));
|
||||
|
||||
@@ -424,6 +434,9 @@ void Config::ReadValues() {
|
||||
ReadControlValues();
|
||||
ReadCoreValues();
|
||||
ReadCpuValues();
|
||||
#ifdef __unix__
|
||||
ReadLinuxValues();
|
||||
#endif
|
||||
ReadRendererValues();
|
||||
ReadAudioValues();
|
||||
ReadSystemValues();
|
||||
@@ -524,6 +537,9 @@ void Config::SaveValues() {
|
||||
SaveControlValues();
|
||||
SaveCoreValues();
|
||||
SaveCpuValues();
|
||||
#ifdef __unix__
|
||||
SaveLinuxValues();
|
||||
#endif
|
||||
SaveRendererValues();
|
||||
SaveAudioValues();
|
||||
SaveSystemValues();
|
||||
@@ -600,6 +616,16 @@ void Config::SaveDebuggingValues() {
|
||||
EndGroup();
|
||||
}
|
||||
|
||||
#ifdef __unix__
|
||||
void Config::SaveLinuxValues() {
|
||||
BeginGroup(Settings::TranslateCategory(Settings::Category::Linux));
|
||||
|
||||
WriteCategory(Settings::Category::Linux);
|
||||
|
||||
EndGroup();
|
||||
}
|
||||
#endif
|
||||
|
||||
void Config::SaveNetworkValues() {
|
||||
BeginGroup(Settings::TranslateCategory(Settings::Category::Services));
|
||||
|
||||
|
||||
@@ -84,6 +84,9 @@ protected:
|
||||
void ReadCoreValues();
|
||||
void ReadDataStorageValues();
|
||||
void ReadDebuggingValues();
|
||||
#ifdef __unix__
|
||||
void ReadLinuxValues();
|
||||
#endif
|
||||
void ReadServiceValues();
|
||||
void ReadDisabledAddOnValues();
|
||||
void ReadMiscellaneousValues();
|
||||
@@ -116,6 +119,9 @@ protected:
|
||||
void SaveCoreValues();
|
||||
void SaveDataStorageValues();
|
||||
void SaveDebuggingValues();
|
||||
#ifdef __unix__
|
||||
void SaveLinuxValues();
|
||||
#endif
|
||||
void SaveNetworkValues();
|
||||
void SaveDisabledAddOnValues();
|
||||
void SaveMiscellaneousValues();
|
||||
|
||||
@@ -49,13 +49,16 @@ u64 ClearDir(DataDir dir, const std::string &user_id)
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string ReadableBytesSize(u64 size) noexcept {
|
||||
std::array<std::string_view, 6> const units{"B", "KB", "MB", "GB", "TB", "PB"};
|
||||
u64 const base = 1000;
|
||||
if (size == 0)
|
||||
const std::string ReadableBytesSize(u64 size)
|
||||
{
|
||||
static constexpr std::array units{"B", "KiB", "MiB", "GiB", "TiB", "PiB"};
|
||||
if (size == 0) {
|
||||
return "0 B";
|
||||
auto const digit_groups = std::min<u64>(u64(std::log10(size) / std::log10(base)), u64(units.size()));
|
||||
return fmt::format("{:.1f} {}", size / std::pow(base, digit_groups), units[digit_groups]);
|
||||
}
|
||||
|
||||
const int digit_groups = (std::min) (static_cast<int>(std::log10(size) / std::log10(1024)),
|
||||
static_cast<int>(units.size()));
|
||||
return fmt::format("{:.1f} {}", size / std::pow(1024, digit_groups), units[digit_groups]);
|
||||
}
|
||||
|
||||
u64 DataDirSize(DataDir dir)
|
||||
|
||||
@@ -16,7 +16,8 @@ const std::filesystem::path GetDataDir(DataDir dir, const std::string &user_id =
|
||||
const std::string GetDataDirString(DataDir dir, const std::string &user_id = "");
|
||||
|
||||
u64 ClearDir(DataDir dir, const std::string &user_id = "");
|
||||
std::string ReadableBytesSize(u64 size) noexcept;
|
||||
|
||||
const std::string ReadableBytesSize(u64 size);
|
||||
|
||||
u64 DataDirSize(DataDir dir);
|
||||
|
||||
|
||||
@@ -19,6 +19,9 @@
|
||||
|
||||
namespace Core {
|
||||
|
||||
// Time between room is announced to web_service
|
||||
static constexpr std::chrono::seconds announce_time_interval(15);
|
||||
|
||||
AnnounceMultiplayerSession::AnnounceMultiplayerSession() {
|
||||
#ifdef ENABLE_WEB_SERVICE
|
||||
backend = std::make_unique<WebService::RoomJson>(Settings::values.web_api_url.GetValue(),
|
||||
@@ -50,58 +53,18 @@ WebService::WebResult AnnounceMultiplayerSession::Register() {
|
||||
}
|
||||
|
||||
void AnnounceMultiplayerSession::Start() {
|
||||
if (announce_multiplayer_thread.has_value()) {
|
||||
if (announce_multiplayer_thread) {
|
||||
Stop();
|
||||
}
|
||||
announce_multiplayer_thread.emplace([&](std::stop_token stoken) {
|
||||
// Invokes all current bound error callbacks.
|
||||
const auto ErrorCallback = [this](WebService::WebResult result) {
|
||||
std::lock_guard lock(callback_mutex);
|
||||
for (auto callback : error_callbacks)
|
||||
(*callback)(result);
|
||||
};
|
||||
|
||||
if (!registered) {
|
||||
WebService::WebResult result = Register();
|
||||
if (result.result_code != WebService::WebResult::Code::Success) {
|
||||
ErrorCallback(result);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Time between room is announced to web_service
|
||||
std::chrono::seconds const announce_timeslice(15);
|
||||
auto update_time = std::chrono::steady_clock::now();
|
||||
std::future<WebService::WebResult> future;
|
||||
while (!shutdown_event.WaitUntil(update_time)) {
|
||||
update_time = std::chrono::steady_clock::now() + announce_timeslice;
|
||||
auto room = Network::GetRoom().lock();
|
||||
if (!room) {
|
||||
break;
|
||||
}
|
||||
if (room->GetState() != Network::Room::State::Open) {
|
||||
break;
|
||||
}
|
||||
UpdateBackendData(room);
|
||||
WebService::WebResult result = backend->Update();
|
||||
if (result.result_code != WebService::WebResult::Code::Success) {
|
||||
ErrorCallback(result);
|
||||
}
|
||||
if (result.result_string == "404") {
|
||||
registered = false;
|
||||
// Needs to register the room again
|
||||
WebService::WebResult register_result = Register();
|
||||
if (register_result.result_code != WebService::WebResult::Code::Success) {
|
||||
ErrorCallback(register_result);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
shutdown_event.Reset();
|
||||
announce_multiplayer_thread =
|
||||
std::make_unique<std::thread>(&AnnounceMultiplayerSession::AnnounceMultiplayerLoop, this);
|
||||
}
|
||||
|
||||
void AnnounceMultiplayerSession::Stop() {
|
||||
if (announce_multiplayer_thread.has_value()) {
|
||||
if (announce_multiplayer_thread) {
|
||||
shutdown_event.Set();
|
||||
announce_multiplayer_thread->join();
|
||||
announce_multiplayer_thread.reset();
|
||||
backend->Delete();
|
||||
registered = false;
|
||||
@@ -138,10 +101,58 @@ void AnnounceMultiplayerSession::UpdateBackendData(std::shared_ptr<Network::Room
|
||||
}
|
||||
}
|
||||
|
||||
void AnnounceMultiplayerSession::AnnounceMultiplayerLoop() {
|
||||
// Invokes all current bound error callbacks.
|
||||
const auto ErrorCallback = [this](WebService::WebResult result) {
|
||||
std::lock_guard lock(callback_mutex);
|
||||
for (auto callback : error_callbacks) {
|
||||
(*callback)(result);
|
||||
}
|
||||
};
|
||||
|
||||
if (!registered) {
|
||||
WebService::WebResult result = Register();
|
||||
if (result.result_code != WebService::WebResult::Code::Success) {
|
||||
ErrorCallback(result);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
auto update_time = std::chrono::steady_clock::now();
|
||||
std::future<WebService::WebResult> future;
|
||||
while (!shutdown_event.WaitUntil(update_time)) {
|
||||
update_time += announce_time_interval;
|
||||
auto room = Network::GetRoom().lock();
|
||||
if (!room) {
|
||||
break;
|
||||
}
|
||||
if (room->GetState() != Network::Room::State::Open) {
|
||||
break;
|
||||
}
|
||||
UpdateBackendData(room);
|
||||
WebService::WebResult result = backend->Update();
|
||||
if (result.result_code != WebService::WebResult::Code::Success) {
|
||||
ErrorCallback(result);
|
||||
}
|
||||
if (result.result_string == "404") {
|
||||
registered = false;
|
||||
// Needs to register the room again
|
||||
WebService::WebResult register_result = Register();
|
||||
if (register_result.result_code != WebService::WebResult::Code::Success) {
|
||||
ErrorCallback(register_result);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AnnounceMultiplayerRoom::RoomList AnnounceMultiplayerSession::GetRoomList() {
|
||||
return backend->GetRoomList();
|
||||
}
|
||||
|
||||
bool AnnounceMultiplayerSession::IsRunning() const {
|
||||
return announce_multiplayer_thread != nullptr;
|
||||
}
|
||||
|
||||
void AnnounceMultiplayerSession::UpdateCredentials() {
|
||||
ASSERT_MSG(!IsRunning(), "Credentials can only be updated when session is not running");
|
||||
#ifdef ENABLE_WEB_SERVICE
|
||||
|
||||
@@ -72,9 +72,7 @@ public:
|
||||
/**
|
||||
* Whether the announce session is still running
|
||||
*/
|
||||
[[nodiscard]] bool IsRunning() const {
|
||||
return announce_multiplayer_thread.has_value();
|
||||
}
|
||||
bool IsRunning() const;
|
||||
|
||||
/**
|
||||
* Recreates the backend, updating the credentials.
|
||||
@@ -84,13 +82,16 @@ public:
|
||||
|
||||
private:
|
||||
void UpdateBackendData(std::shared_ptr<Network::Room> room);
|
||||
void AnnounceMultiplayerLoop();
|
||||
|
||||
Common::Event shutdown_event;
|
||||
std::mutex callback_mutex;
|
||||
std::set<CallbackHandle> error_callbacks;
|
||||
std::optional<std::jthread> announce_multiplayer_thread;
|
||||
std::unique_ptr<std::thread> announce_multiplayer_thread;
|
||||
|
||||
/// Backend interface that logs fields
|
||||
std::unique_ptr<AnnounceMultiplayerRoom::Backend> backend;
|
||||
std::mutex callback_mutex;
|
||||
|
||||
std::atomic_bool registered = false; ///< Whether the room has been registered
|
||||
};
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2017 Citra Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
@@ -12,7 +13,6 @@
|
||||
#include <shared_mutex>
|
||||
#include <sstream>
|
||||
#include <thread>
|
||||
#include "common/polyfill_thread.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "enet/enet.h"
|
||||
#include "network/packet.h"
|
||||
@@ -54,11 +54,13 @@ public:
|
||||
RoomImpl() : random_gen(std::random_device()()) {}
|
||||
|
||||
/// Thread that receives and dispatches network packets
|
||||
std::optional<std::jthread> room_thread;
|
||||
std::unique_ptr<std::thread> room_thread;
|
||||
|
||||
/// Verification backend of the room
|
||||
std::unique_ptr<VerifyUser::Backend> verify_backend;
|
||||
|
||||
/// Thread function that will receive and dispatch messages until the room is destroyed.
|
||||
void ServerLoop();
|
||||
void StartLoop();
|
||||
|
||||
/**
|
||||
@@ -238,57 +240,59 @@ public:
|
||||
};
|
||||
|
||||
// RoomImpl
|
||||
void Room::RoomImpl::StartLoop() {
|
||||
room_thread.emplace([&](std::stop_token stoken) {
|
||||
while (state != State::Closed) {
|
||||
ENetEvent event;
|
||||
if (enet_host_service(server, &event, 5) > 0) {
|
||||
switch (event.type) {
|
||||
case ENET_EVENT_TYPE_RECEIVE:
|
||||
switch (event.packet->data[0]) {
|
||||
case IdJoinRequest:
|
||||
HandleJoinRequest(&event);
|
||||
break;
|
||||
case IdSetGameInfo:
|
||||
HandleGameInfoPacket(&event);
|
||||
break;
|
||||
case IdProxyPacket:
|
||||
HandleProxyPacket(&event);
|
||||
break;
|
||||
case IdLdnPacket:
|
||||
HandleLdnPacket(&event);
|
||||
break;
|
||||
case IdChatMessage:
|
||||
HandleChatPacket(&event);
|
||||
break;
|
||||
// Moderation
|
||||
case IdModKick:
|
||||
HandleModKickPacket(&event);
|
||||
break;
|
||||
case IdModBan:
|
||||
HandleModBanPacket(&event);
|
||||
break;
|
||||
case IdModUnban:
|
||||
HandleModUnbanPacket(&event);
|
||||
break;
|
||||
case IdModGetBanList:
|
||||
HandleModGetBanListPacket(&event);
|
||||
break;
|
||||
}
|
||||
enet_packet_destroy(event.packet);
|
||||
void Room::RoomImpl::ServerLoop() {
|
||||
while (state != State::Closed) {
|
||||
ENetEvent event;
|
||||
if (enet_host_service(server, &event, 5) > 0) {
|
||||
switch (event.type) {
|
||||
case ENET_EVENT_TYPE_RECEIVE:
|
||||
switch (event.packet->data[0]) {
|
||||
case IdJoinRequest:
|
||||
HandleJoinRequest(&event);
|
||||
break;
|
||||
case ENET_EVENT_TYPE_DISCONNECT:
|
||||
HandleClientDisconnection(event.peer);
|
||||
case IdSetGameInfo:
|
||||
HandleGameInfoPacket(&event);
|
||||
break;
|
||||
case ENET_EVENT_TYPE_NONE:
|
||||
case ENET_EVENT_TYPE_CONNECT:
|
||||
case IdProxyPacket:
|
||||
HandleProxyPacket(&event);
|
||||
break;
|
||||
case IdLdnPacket:
|
||||
HandleLdnPacket(&event);
|
||||
break;
|
||||
case IdChatMessage:
|
||||
HandleChatPacket(&event);
|
||||
break;
|
||||
// Moderation
|
||||
case IdModKick:
|
||||
HandleModKickPacket(&event);
|
||||
break;
|
||||
case IdModBan:
|
||||
HandleModBanPacket(&event);
|
||||
break;
|
||||
case IdModUnban:
|
||||
HandleModUnbanPacket(&event);
|
||||
break;
|
||||
case IdModGetBanList:
|
||||
HandleModGetBanListPacket(&event);
|
||||
break;
|
||||
}
|
||||
enet_packet_destroy(event.packet);
|
||||
break;
|
||||
case ENET_EVENT_TYPE_DISCONNECT:
|
||||
HandleClientDisconnection(event.peer);
|
||||
break;
|
||||
case ENET_EVENT_TYPE_NONE:
|
||||
case ENET_EVENT_TYPE_CONNECT:
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Close the connection to all members:
|
||||
SendCloseMessage();
|
||||
});
|
||||
}
|
||||
// Close the connection to all members:
|
||||
SendCloseMessage();
|
||||
}
|
||||
|
||||
void Room::RoomImpl::StartLoop() {
|
||||
room_thread = std::make_unique<std::thread>(&Room::RoomImpl::ServerLoop, this);
|
||||
}
|
||||
|
||||
void Room::RoomImpl::HandleJoinRequest(const ENetEvent* event) {
|
||||
@@ -1129,6 +1133,7 @@ void Room::SetVerifyUID(const std::string& uid) {
|
||||
|
||||
void Room::Destroy() {
|
||||
room_impl->state = State::Closed;
|
||||
room_impl->room_thread->join();
|
||||
room_impl->room_thread.reset();
|
||||
|
||||
if (room_impl->server) {
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// SPDX-FileCopyrightText: Copyright 2017 Citra Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
@@ -9,7 +7,6 @@
|
||||
#include <set>
|
||||
#include <thread>
|
||||
#include "common/assert.h"
|
||||
#include "common/polyfill_thread.h"
|
||||
#include "common/socket_types.h"
|
||||
#include "enet/enet.h"
|
||||
#include "network/packet.h"
|
||||
@@ -21,21 +18,6 @@ constexpr u32 ConnectionTimeoutMs = 5000;
|
||||
|
||||
class RoomMember::RoomMemberImpl {
|
||||
public:
|
||||
void SetState(const State new_state) noexcept {
|
||||
if (state != new_state) {
|
||||
state = new_state;
|
||||
Invoke<State>(state);
|
||||
}
|
||||
}
|
||||
|
||||
void SetError(const Error new_error) noexcept {
|
||||
Invoke<Error>(new_error);
|
||||
}
|
||||
|
||||
[[nodiscard]] bool IsConnected() const noexcept {
|
||||
return state == State::Joining || state == State::Joined || state == State::Moderator;
|
||||
}
|
||||
|
||||
ENetHost* client = nullptr; ///< ENet network interface.
|
||||
ENetPeer* server = nullptr; ///< The server peer the client is connected to
|
||||
|
||||
@@ -48,6 +30,9 @@ public:
|
||||
GameInfo current_game_info;
|
||||
|
||||
std::atomic<State> state{State::Idle}; ///< Current state of the RoomMember.
|
||||
void SetState(const State new_state);
|
||||
void SetError(const Error new_error);
|
||||
bool IsConnected() const;
|
||||
|
||||
std::string nickname; ///< The nickname of this member.
|
||||
|
||||
@@ -58,9 +43,9 @@ public:
|
||||
|
||||
std::mutex network_mutex; ///< Mutex that controls access to the `client` variable.
|
||||
/// Thread that receives and dispatches network packets
|
||||
std::optional<std::jthread> loop_thread;
|
||||
std::unique_ptr<std::thread> loop_thread;
|
||||
std::mutex send_list_mutex; ///< Mutex that controls access to the `send_list` variable.
|
||||
std::vector<Packet> send_list; ///< A list that stores all packets to send the async
|
||||
std::list<Packet> send_list; ///< A list that stores all packets to send the async
|
||||
|
||||
template <typename T>
|
||||
using CallbackSet = std::set<CallbackHandle<T>>;
|
||||
@@ -83,6 +68,8 @@ public:
|
||||
};
|
||||
Callbacks callbacks; ///< All CallbackSets to all events
|
||||
|
||||
void MemberLoop();
|
||||
|
||||
void StartLoop();
|
||||
|
||||
/**
|
||||
@@ -159,117 +146,134 @@ public:
|
||||
};
|
||||
|
||||
// RoomMemberImpl
|
||||
void RoomMember::RoomMemberImpl::StartLoop() {
|
||||
loop_thread.emplace([&](std::stop_token stoken) {
|
||||
// Receive packets while the connection is open
|
||||
while (IsConnected()) {
|
||||
std::lock_guard lock(network_mutex);
|
||||
ENetEvent event;
|
||||
if (enet_host_service(client, &event, 5) > 0) {
|
||||
switch (event.type) {
|
||||
case ENET_EVENT_TYPE_RECEIVE:
|
||||
switch (event.packet->data[0]) {
|
||||
case IdProxyPacket:
|
||||
HandleProxyPackets(&event);
|
||||
break;
|
||||
case IdLdnPacket:
|
||||
HandleLdnPackets(&event);
|
||||
break;
|
||||
case IdChatMessage:
|
||||
HandleChatPacket(&event);
|
||||
break;
|
||||
case IdStatusMessage:
|
||||
HandleStatusMessagePacket(&event);
|
||||
break;
|
||||
case IdRoomInformation:
|
||||
HandleRoomInformationPacket(&event);
|
||||
break;
|
||||
case IdJoinSuccess:
|
||||
case IdJoinSuccessAsMod:
|
||||
// The join request was successful, we are now in the room.
|
||||
// If we joined successfully, there must be at least one client in the room: us.
|
||||
ASSERT_MSG(member_information.size() > 0,
|
||||
"We have not yet received member information.");
|
||||
HandleJoinPacket(&event); // Get the MAC Address for the client
|
||||
if (event.packet->data[0] == IdJoinSuccessAsMod) {
|
||||
SetState(State::Moderator);
|
||||
} else {
|
||||
SetState(State::Joined);
|
||||
}
|
||||
break;
|
||||
case IdModBanListResponse:
|
||||
HandleModBanListResponsePacket(&event);
|
||||
break;
|
||||
case IdRoomIsFull:
|
||||
SetState(State::Idle);
|
||||
SetError(Error::RoomIsFull);
|
||||
break;
|
||||
case IdNameCollision:
|
||||
SetState(State::Idle);
|
||||
SetError(Error::NameCollision);
|
||||
break;
|
||||
case IdIpCollision:
|
||||
SetState(State::Idle);
|
||||
SetError(Error::IpCollision);
|
||||
break;
|
||||
case IdVersionMismatch:
|
||||
SetState(State::Idle);
|
||||
SetError(Error::WrongVersion);
|
||||
break;
|
||||
case IdWrongPassword:
|
||||
SetState(State::Idle);
|
||||
SetError(Error::WrongPassword);
|
||||
break;
|
||||
case IdCloseRoom:
|
||||
SetState(State::Idle);
|
||||
SetError(Error::LostConnection);
|
||||
break;
|
||||
case IdHostKicked:
|
||||
SetState(State::Idle);
|
||||
SetError(Error::HostKicked);
|
||||
break;
|
||||
case IdHostBanned:
|
||||
SetState(State::Idle);
|
||||
SetError(Error::HostBanned);
|
||||
break;
|
||||
case IdModPermissionDenied:
|
||||
SetError(Error::PermissionDenied);
|
||||
break;
|
||||
case IdModNoSuchUser:
|
||||
SetError(Error::NoSuchUser);
|
||||
break;
|
||||
}
|
||||
enet_packet_destroy(event.packet);
|
||||
void RoomMember::RoomMemberImpl::SetState(const State new_state) {
|
||||
if (state != new_state) {
|
||||
state = new_state;
|
||||
Invoke<State>(state);
|
||||
}
|
||||
}
|
||||
|
||||
void RoomMember::RoomMemberImpl::SetError(const Error new_error) {
|
||||
Invoke<Error>(new_error);
|
||||
}
|
||||
|
||||
bool RoomMember::RoomMemberImpl::IsConnected() const {
|
||||
return state == State::Joining || state == State::Joined || state == State::Moderator;
|
||||
}
|
||||
|
||||
void RoomMember::RoomMemberImpl::MemberLoop() {
|
||||
// Receive packets while the connection is open
|
||||
while (IsConnected()) {
|
||||
std::lock_guard lock(network_mutex);
|
||||
ENetEvent event;
|
||||
if (enet_host_service(client, &event, 5) > 0) {
|
||||
switch (event.type) {
|
||||
case ENET_EVENT_TYPE_RECEIVE:
|
||||
switch (event.packet->data[0]) {
|
||||
case IdProxyPacket:
|
||||
HandleProxyPackets(&event);
|
||||
break;
|
||||
case ENET_EVENT_TYPE_DISCONNECT:
|
||||
if (state == State::Joined || state == State::Moderator) {
|
||||
SetState(State::Idle);
|
||||
SetError(Error::LostConnection);
|
||||
case IdLdnPacket:
|
||||
HandleLdnPackets(&event);
|
||||
break;
|
||||
case IdChatMessage:
|
||||
HandleChatPacket(&event);
|
||||
break;
|
||||
case IdStatusMessage:
|
||||
HandleStatusMessagePacket(&event);
|
||||
break;
|
||||
case IdRoomInformation:
|
||||
HandleRoomInformationPacket(&event);
|
||||
break;
|
||||
case IdJoinSuccess:
|
||||
case IdJoinSuccessAsMod:
|
||||
// The join request was successful, we are now in the room.
|
||||
// If we joined successfully, there must be at least one client in the room: us.
|
||||
ASSERT_MSG(member_information.size() > 0,
|
||||
"We have not yet received member information.");
|
||||
HandleJoinPacket(&event); // Get the MAC Address for the client
|
||||
if (event.packet->data[0] == IdJoinSuccessAsMod) {
|
||||
SetState(State::Moderator);
|
||||
} else {
|
||||
SetState(State::Joined);
|
||||
}
|
||||
break;
|
||||
case ENET_EVENT_TYPE_NONE:
|
||||
case IdModBanListResponse:
|
||||
HandleModBanListResponsePacket(&event);
|
||||
break;
|
||||
case ENET_EVENT_TYPE_CONNECT:
|
||||
// The ENET_EVENT_TYPE_CONNECT event can not possibly happen here because we're
|
||||
// already connected
|
||||
ASSERT_MSG(false, "Received unexpected connect event while already connected");
|
||||
case IdRoomIsFull:
|
||||
SetState(State::Idle);
|
||||
SetError(Error::RoomIsFull);
|
||||
break;
|
||||
case IdNameCollision:
|
||||
SetState(State::Idle);
|
||||
SetError(Error::NameCollision);
|
||||
break;
|
||||
case IdIpCollision:
|
||||
SetState(State::Idle);
|
||||
SetError(Error::IpCollision);
|
||||
break;
|
||||
case IdVersionMismatch:
|
||||
SetState(State::Idle);
|
||||
SetError(Error::WrongVersion);
|
||||
break;
|
||||
case IdWrongPassword:
|
||||
SetState(State::Idle);
|
||||
SetError(Error::WrongPassword);
|
||||
break;
|
||||
case IdCloseRoom:
|
||||
SetState(State::Idle);
|
||||
SetError(Error::LostConnection);
|
||||
break;
|
||||
case IdHostKicked:
|
||||
SetState(State::Idle);
|
||||
SetError(Error::HostKicked);
|
||||
break;
|
||||
case IdHostBanned:
|
||||
SetState(State::Idle);
|
||||
SetError(Error::HostBanned);
|
||||
break;
|
||||
case IdModPermissionDenied:
|
||||
SetError(Error::PermissionDenied);
|
||||
break;
|
||||
case IdModNoSuchUser:
|
||||
SetError(Error::NoSuchUser);
|
||||
break;
|
||||
}
|
||||
enet_packet_destroy(event.packet);
|
||||
break;
|
||||
case ENET_EVENT_TYPE_DISCONNECT:
|
||||
if (state == State::Joined || state == State::Moderator) {
|
||||
SetState(State::Idle);
|
||||
SetError(Error::LostConnection);
|
||||
}
|
||||
break;
|
||||
case ENET_EVENT_TYPE_NONE:
|
||||
break;
|
||||
case ENET_EVENT_TYPE_CONNECT:
|
||||
// The ENET_EVENT_TYPE_CONNECT event can not possibly happen here because we're
|
||||
// already connected
|
||||
ASSERT_MSG(false, "Received unexpected connect event while already connected");
|
||||
break;
|
||||
}
|
||||
std::vector<Packet> packets;
|
||||
{
|
||||
std::lock_guard send_lock(send_list_mutex);
|
||||
packets.swap(send_list);
|
||||
}
|
||||
for (auto const& packet : packets) {
|
||||
ENetPacket* enetPacket = enet_packet_create(packet.GetData(), packet.GetDataSize(),
|
||||
ENET_PACKET_FLAG_RELIABLE);
|
||||
enet_peer_send(server, 0, enetPacket);
|
||||
}
|
||||
enet_host_flush(client);
|
||||
}
|
||||
Disconnect();
|
||||
});
|
||||
std::list<Packet> packets;
|
||||
{
|
||||
std::lock_guard send_lock(send_list_mutex);
|
||||
packets.swap(send_list);
|
||||
}
|
||||
for (const auto& packet : packets) {
|
||||
ENetPacket* enetPacket = enet_packet_create(packet.GetData(), packet.GetDataSize(),
|
||||
ENET_PACKET_FLAG_RELIABLE);
|
||||
enet_peer_send(server, 0, enetPacket);
|
||||
}
|
||||
enet_host_flush(client);
|
||||
}
|
||||
Disconnect();
|
||||
};
|
||||
|
||||
void RoomMember::RoomMemberImpl::StartLoop() {
|
||||
loop_thread = std::make_unique<std::thread>(&RoomMember::RoomMemberImpl::MemberLoop, this);
|
||||
}
|
||||
|
||||
void RoomMember::RoomMemberImpl::Send(Packet&& packet) {
|
||||
@@ -743,7 +747,9 @@ void RoomMember::Unbind(CallbackHandle<T> handle) {
|
||||
|
||||
void RoomMember::Leave() {
|
||||
room_member_impl->SetState(State::Idle);
|
||||
room_member_impl->loop_thread->join();
|
||||
room_member_impl->loop_thread.reset();
|
||||
|
||||
enet_host_destroy(room_member_impl->client);
|
||||
room_member_impl->client = nullptr;
|
||||
}
|
||||
|
||||
@@ -5,9 +5,6 @@ add_library(qt_common STATIC
|
||||
qt_common.h
|
||||
qt_common.cpp
|
||||
|
||||
gamemode.cpp
|
||||
gamemode.h
|
||||
|
||||
config/uisettings.cpp
|
||||
config/uisettings.h
|
||||
config/qt_config.cpp
|
||||
@@ -85,7 +82,6 @@ find_package(frozen)
|
||||
|
||||
target_link_libraries(qt_common PRIVATE core Qt6::Core Qt6::Concurrent SimpleIni::SimpleIni QuaZip::QuaZip)
|
||||
target_link_libraries(qt_common PUBLIC frozen::frozen-headers)
|
||||
target_link_libraries(qt_common PRIVATE gamemode::headers)
|
||||
|
||||
if (NOT APPLE AND ENABLE_OPENGL)
|
||||
target_compile_definitions(qt_common PUBLIC HAS_OPENGL)
|
||||
|
||||
@@ -433,10 +433,10 @@ std::unique_ptr<TranslationMap> InitializeTranslations(QObject* parent)
|
||||
tr("Whether or not to check for updates upon startup."));
|
||||
|
||||
// Linux
|
||||
INSERT(UISettings, enable_gamemode, tr("Enable Gamemode"), QString());
|
||||
INSERT(Settings, enable_gamemode, tr("Enable Gamemode"), QString());
|
||||
#ifdef __unix__
|
||||
INSERT(UISettings, gui_force_x11, tr("Force X11 as Graphics Backend"), QString());
|
||||
INSERT(UISettings, gui_hide_backend_warning, QString(), QString());
|
||||
INSERT(Settings, gui_force_x11, tr("Force X11 as Graphics Backend"), QString());
|
||||
INSERT(Settings, gui_hide_backend_warning, QString(), QString());
|
||||
#endif
|
||||
|
||||
// Ui Debugging
|
||||
|
||||
@@ -142,19 +142,6 @@ struct Values {
|
||||
|
||||
Setting<bool> check_for_updates{linkage, true, "check_for_updates", Category::UiGeneral};
|
||||
|
||||
// Linux/MinGW may support (requires libdl support)
|
||||
SwitchableSetting<bool> enable_gamemode{linkage,
|
||||
#ifndef _MSC_VER
|
||||
true,
|
||||
#else
|
||||
false,
|
||||
#endif
|
||||
"enable_gamemode", Category::UiGeneral};
|
||||
#ifdef __unix__
|
||||
SwitchableSetting<bool> gui_force_x11{linkage, false, "gui_force_x11", Category::UiGeneral};
|
||||
Setting<bool> gui_hide_backend_warning{linkage, false, "gui_hide_backend_warning", Category::UiGeneral};
|
||||
#endif
|
||||
|
||||
// Discord RPC
|
||||
Setting<bool> enable_discord_presence{linkage, false, "enable_discord_presence", Category::Ui};
|
||||
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
// While technically available on al *NIX platforms, Linux is only available
|
||||
// as the primary target of libgamemode.so - so warnings are suppressed
|
||||
#ifdef __unix__
|
||||
#include <gamemode_client.h>
|
||||
#endif
|
||||
#include "qt_common/gamemode.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "qt_common/config/uisettings.h"
|
||||
|
||||
namespace Common::FeralGamemode {
|
||||
|
||||
/// @brief Start the gamemode client
|
||||
void Start() noexcept {
|
||||
if (UISettings::values.enable_gamemode) {
|
||||
#ifdef __unix__
|
||||
if (gamemode_request_start() < 0) {
|
||||
#ifdef __linux__
|
||||
LOG_WARNING(Frontend, "{}", gamemode_error_string());
|
||||
#else
|
||||
LOG_INFO(Frontend, "{}", gamemode_error_string());
|
||||
#endif
|
||||
} else {
|
||||
LOG_INFO(Frontend, "Done");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
/// @brief Stop the gmemode client
|
||||
void Stop() noexcept {
|
||||
if (UISettings::values.enable_gamemode) {
|
||||
#ifdef __unix__
|
||||
if (gamemode_request_end() < 0) {
|
||||
#ifdef __linux__
|
||||
LOG_WARNING(Frontend, "{}", gamemode_error_string());
|
||||
#else
|
||||
LOG_INFO(Frontend, "{}", gamemode_error_string());
|
||||
#endif
|
||||
} else {
|
||||
LOG_INFO(Frontend, "Done");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Common::Linux
|
||||
@@ -1,14 +0,0 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace Common::FeralGamemode {
|
||||
|
||||
void Start() noexcept;
|
||||
void Stop() noexcept;
|
||||
|
||||
} // namespace Common::FeralGamemode
|
||||
@@ -22,9 +22,13 @@ public:
|
||||
: socket(io_context, boost::asio::ip::udp::endpoint(boost::asio::ip::udp::v4(), 0)) {}
|
||||
|
||||
~FakeCemuhookServer() {
|
||||
is_running = false;
|
||||
boost::system::error_code error_code;
|
||||
socket.shutdown(boost::asio::socket_base::shutdown_both, error_code);
|
||||
socket.close();
|
||||
if (handler.joinable()) {
|
||||
handler.join();
|
||||
}
|
||||
}
|
||||
|
||||
u16 GetPort() {
|
||||
@@ -41,9 +45,10 @@ public:
|
||||
sizeof(InputCommon::CemuhookUDP::Message<InputCommon::CemuhookUDP::Response::PadData>);
|
||||
|
||||
REQUIRE(touch_movement_path.size() > 0);
|
||||
handler = std::jthread([touch_movement_path, this](std::stop_token stoken) {
|
||||
is_running = true;
|
||||
handler = std::thread([touch_movement_path, this]() {
|
||||
auto current_touch_position = touch_movement_path.begin();
|
||||
while (!stoken.stop_requested()) {
|
||||
while (is_running) {
|
||||
boost::asio::ip::udp::endpoint sender_endpoint;
|
||||
boost::system::error_code error_code;
|
||||
auto received_size = socket.receive_from(boost::asio::buffer(receive_buffer),
|
||||
@@ -86,7 +91,8 @@ private:
|
||||
boost::asio::ip::udp::socket socket;
|
||||
std::array<u8, InputCommon::CemuhookUDP::MAX_PACKET_SIZE> send_buffer;
|
||||
std::array<u8, InputCommon::CemuhookUDP::MAX_PACKET_SIZE> receive_buffer;
|
||||
std::jthread handler;
|
||||
bool is_running = false;
|
||||
std::thread handler;
|
||||
};
|
||||
|
||||
TEST_CASE("CalibrationConfigurationJob completed", "[input_common]") {
|
||||
|
||||
@@ -180,7 +180,145 @@ RendererVulkan::~RendererVulkan() {
|
||||
void(device.GetLogical().WaitIdle());
|
||||
}
|
||||
|
||||
#ifdef __ANDROID__
|
||||
class BooleanSetting {
|
||||
public:
|
||||
// static BooleanSetting FRAME_SKIPPING;
|
||||
static BooleanSetting FRAME_INTERPOLATION;
|
||||
explicit BooleanSetting(bool initial_value = false) : value(initial_value) {}
|
||||
|
||||
[[nodiscard]] bool getBoolean() const {
|
||||
return value;
|
||||
}
|
||||
|
||||
void setBoolean(bool new_value) {
|
||||
value = new_value;
|
||||
}
|
||||
|
||||
private:
|
||||
bool value;
|
||||
};
|
||||
|
||||
// Initialize static members
|
||||
// BooleanSetting BooleanSetting::FRAME_SKIPPING(false);
|
||||
BooleanSetting BooleanSetting::FRAME_INTERPOLATION(false);
|
||||
|
||||
// extern "C" JNIEXPORT jboolean JNICALL
|
||||
// Java_org_yuzu_yuzu_1emu_features_settings_model_BooleanSetting_isFrameSkippingEnabled(JNIEnv* env, jobject /* this */) {
|
||||
// return static_cast<jboolean>(BooleanSetting::FRAME_SKIPPING.getBoolean());
|
||||
// }
|
||||
|
||||
extern "C" JNIEXPORT jboolean JNICALL
|
||||
Java_org_yuzu_yuzu_1emu_features_settings_model_BooleanSetting_isFrameInterpolationEnabled(JNIEnv* env, jobject /* this */) {
|
||||
return static_cast<jboolean>(BooleanSetting::FRAME_INTERPOLATION.getBoolean());
|
||||
}
|
||||
|
||||
void RendererVulkan::InterpolateFrames(Frame* prev_frame, Frame* interpolated_frame) {
|
||||
if (!prev_frame || !interpolated_frame || !prev_frame->image || !interpolated_frame->image) {
|
||||
return;
|
||||
}
|
||||
|
||||
const auto& framebuffer_layout = render_window.GetFramebufferLayout();
|
||||
// Fixed aggressive downscale (50%)
|
||||
VkExtent2D dst_extent{
|
||||
.width = framebuffer_layout.width / 2,
|
||||
.height = framebuffer_layout.height / 2
|
||||
};
|
||||
|
||||
// Check if we need to recreate the destination frame
|
||||
bool needs_recreation = false; // Only recreate when necessary
|
||||
if (!interpolated_frame->image_view) {
|
||||
needs_recreation = true; // Need to create initially
|
||||
} else {
|
||||
// Check if dimensions have changed
|
||||
if (interpolated_frame->framebuffer) {
|
||||
needs_recreation = (framebuffer_layout.width / 2 != dst_extent.width) ||
|
||||
(framebuffer_layout.height / 2 != dst_extent.height);
|
||||
} else {
|
||||
needs_recreation = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (needs_recreation) {
|
||||
interpolated_frame->image = CreateWrappedImage(memory_allocator, dst_extent, swapchain.GetImageViewFormat());
|
||||
interpolated_frame->image_view = CreateWrappedImageView(device, interpolated_frame->image, swapchain.GetImageViewFormat());
|
||||
interpolated_frame->framebuffer = blit_swapchain.CreateFramebuffer(
|
||||
Layout::FramebufferLayout{dst_extent.width, dst_extent.height},
|
||||
*interpolated_frame->image_view,
|
||||
swapchain.GetImageViewFormat());
|
||||
}
|
||||
|
||||
scheduler.RequestOutsideRenderPassOperationContext();
|
||||
scheduler.Record([&](vk::CommandBuffer cmdbuf) {
|
||||
// Transition images to transfer layouts
|
||||
TransitionImageLayout(cmdbuf, *prev_frame->image, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL);
|
||||
TransitionImageLayout(cmdbuf, *interpolated_frame->image, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL);
|
||||
|
||||
// Perform the downscale blit
|
||||
VkImageBlit blit_region{};
|
||||
blit_region.srcSubresource = {VK_IMAGE_ASPECT_COLOR_BIT, 0, 0, 1};
|
||||
blit_region.srcOffsets[0] = {0, 0, 0};
|
||||
blit_region.srcOffsets[1] = {
|
||||
static_cast<int32_t>(framebuffer_layout.width),
|
||||
static_cast<int32_t>(framebuffer_layout.height),
|
||||
1
|
||||
};
|
||||
blit_region.dstSubresource = {VK_IMAGE_ASPECT_COLOR_BIT, 0, 0, 1};
|
||||
blit_region.dstOffsets[0] = {0, 0, 0};
|
||||
blit_region.dstOffsets[1] = {
|
||||
static_cast<int32_t>(dst_extent.width),
|
||||
static_cast<int32_t>(dst_extent.height),
|
||||
1
|
||||
};
|
||||
|
||||
// Using the wrapper's BlitImage with proper parameters
|
||||
cmdbuf.BlitImage(
|
||||
*prev_frame->image, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
|
||||
*interpolated_frame->image, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
|
||||
blit_region, VK_FILTER_NEAREST
|
||||
);
|
||||
|
||||
// Transition back to general layout
|
||||
TransitionImageLayout(cmdbuf, *prev_frame->image, VK_IMAGE_LAYOUT_GENERAL);
|
||||
TransitionImageLayout(cmdbuf, *interpolated_frame->image, VK_IMAGE_LAYOUT_GENERAL);
|
||||
});
|
||||
}
|
||||
#endif
|
||||
|
||||
void RendererVulkan::Composite(std::span<const Tegra::FramebufferConfig> framebuffers) {
|
||||
#ifdef __ANDROID__
|
||||
static int frame_counter = 0;
|
||||
static int target_fps = 60; // Target FPS (30 or 60)
|
||||
int frame_skip_threshold = 1;
|
||||
|
||||
bool frame_skipping = false; //BooleanSetting::FRAME_SKIPPING.getBoolean();
|
||||
bool frame_interpolation = BooleanSetting::FRAME_INTERPOLATION.getBoolean();
|
||||
#endif
|
||||
|
||||
if (framebuffers.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef __ANDROID__
|
||||
if (frame_skipping) {
|
||||
frame_skip_threshold = (target_fps == 30) ? 2 : 2;
|
||||
}
|
||||
|
||||
frame_counter++;
|
||||
if (frame_counter % frame_skip_threshold != 0) {
|
||||
if (frame_interpolation && previous_frame) {
|
||||
Frame* interpolated_frame = present_manager.GetRenderFrame();
|
||||
InterpolateFrames(previous_frame, interpolated_frame);
|
||||
blit_swapchain.DrawToFrame(rasterizer, interpolated_frame, framebuffers,
|
||||
render_window.GetFramebufferLayout(), swapchain.GetImageCount(),
|
||||
swapchain.GetImageViewFormat());
|
||||
scheduler.Flush(*interpolated_frame->render_ready);
|
||||
present_manager.Present(interpolated_frame);
|
||||
}
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
SCOPE_EXIT {
|
||||
render_window.OnFrameDisplayed();
|
||||
};
|
||||
|
||||
@@ -104,6 +104,9 @@ add_executable(yuzu
|
||||
configuration/configure_input_profile_dialog.cpp
|
||||
configuration/configure_input_profile_dialog.h
|
||||
configuration/configure_input_profile_dialog.ui
|
||||
configuration/configure_linux_tab.cpp
|
||||
configuration/configure_linux_tab.h
|
||||
configuration/configure_linux_tab.ui
|
||||
configuration/configure_mouse_panning.cpp
|
||||
configuration/configure_mouse_panning.h
|
||||
configuration/configure_mouse_panning.ui
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
@@ -1494,36 +1495,53 @@ void QtSoftwareKeyboardDialog::MoveTextCursorDirection(Direction direction) {
|
||||
}
|
||||
|
||||
void QtSoftwareKeyboardDialog::StartInputThread() {
|
||||
input_thread = std::jthread([&](std::stop_token stoken) {
|
||||
while (!stoken.stop_requested()) {
|
||||
input_interpreter->PollInput();
|
||||
HandleButtonPressedOnce<
|
||||
Core::HID::NpadButton::A, Core::HID::NpadButton::B, Core::HID::NpadButton::X,
|
||||
Core::HID::NpadButton::Y, Core::HID::NpadButton::StickL, Core::HID::NpadButton::StickR,
|
||||
Core::HID::NpadButton::L, Core::HID::NpadButton::R, Core::HID::NpadButton::Plus,
|
||||
Core::HID::NpadButton::Left, Core::HID::NpadButton::Up, Core::HID::NpadButton::Right,
|
||||
Core::HID::NpadButton::Down, Core::HID::NpadButton::StickLLeft,
|
||||
Core::HID::NpadButton::StickLUp, Core::HID::NpadButton::StickLRight,
|
||||
Core::HID::NpadButton::StickLDown, Core::HID::NpadButton::StickRLeft,
|
||||
Core::HID::NpadButton::StickRUp, Core::HID::NpadButton::StickRRight,
|
||||
Core::HID::NpadButton::StickRDown>();
|
||||
HandleButtonHold<Core::HID::NpadButton::B, Core::HID::NpadButton::L,
|
||||
Core::HID::NpadButton::R, Core::HID::NpadButton::Left,
|
||||
Core::HID::NpadButton::Up, Core::HID::NpadButton::Right,
|
||||
Core::HID::NpadButton::Down, Core::HID::NpadButton::StickLLeft,
|
||||
Core::HID::NpadButton::StickLUp, Core::HID::NpadButton::StickLRight,
|
||||
Core::HID::NpadButton::StickLDown, Core::HID::NpadButton::StickRLeft,
|
||||
Core::HID::NpadButton::StickRUp, Core::HID::NpadButton::StickRRight,
|
||||
Core::HID::NpadButton::StickRDown>();
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(50));
|
||||
}
|
||||
});
|
||||
if (input_thread_running) {
|
||||
return;
|
||||
}
|
||||
|
||||
input_thread_running = true;
|
||||
|
||||
input_thread = std::thread(&QtSoftwareKeyboardDialog::InputThread, this);
|
||||
}
|
||||
|
||||
void QtSoftwareKeyboardDialog::StopInputThread() {
|
||||
input_thread.request_stop();
|
||||
if (input_interpreter)
|
||||
input_thread_running = false;
|
||||
|
||||
if (input_thread.joinable()) {
|
||||
input_thread.join();
|
||||
}
|
||||
|
||||
if (input_interpreter) {
|
||||
input_interpreter->ResetButtonStates();
|
||||
}
|
||||
}
|
||||
|
||||
void QtSoftwareKeyboardDialog::InputThread() {
|
||||
while (input_thread_running) {
|
||||
input_interpreter->PollInput();
|
||||
|
||||
HandleButtonPressedOnce<
|
||||
Core::HID::NpadButton::A, Core::HID::NpadButton::B, Core::HID::NpadButton::X,
|
||||
Core::HID::NpadButton::Y, Core::HID::NpadButton::StickL, Core::HID::NpadButton::StickR,
|
||||
Core::HID::NpadButton::L, Core::HID::NpadButton::R, Core::HID::NpadButton::Plus,
|
||||
Core::HID::NpadButton::Left, Core::HID::NpadButton::Up, Core::HID::NpadButton::Right,
|
||||
Core::HID::NpadButton::Down, Core::HID::NpadButton::StickLLeft,
|
||||
Core::HID::NpadButton::StickLUp, Core::HID::NpadButton::StickLRight,
|
||||
Core::HID::NpadButton::StickLDown, Core::HID::NpadButton::StickRLeft,
|
||||
Core::HID::NpadButton::StickRUp, Core::HID::NpadButton::StickRRight,
|
||||
Core::HID::NpadButton::StickRDown>();
|
||||
|
||||
HandleButtonHold<Core::HID::NpadButton::B, Core::HID::NpadButton::L,
|
||||
Core::HID::NpadButton::R, Core::HID::NpadButton::Left,
|
||||
Core::HID::NpadButton::Up, Core::HID::NpadButton::Right,
|
||||
Core::HID::NpadButton::Down, Core::HID::NpadButton::StickLLeft,
|
||||
Core::HID::NpadButton::StickLUp, Core::HID::NpadButton::StickLRight,
|
||||
Core::HID::NpadButton::StickLDown, Core::HID::NpadButton::StickRLeft,
|
||||
Core::HID::NpadButton::StickRUp, Core::HID::NpadButton::StickRRight,
|
||||
Core::HID::NpadButton::StickRDown>();
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(50));
|
||||
}
|
||||
}
|
||||
|
||||
QtSoftwareKeyboard::QtSoftwareKeyboard(MainWindow& main_window) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
@@ -184,6 +185,9 @@ private:
|
||||
void StartInputThread();
|
||||
void StopInputThread();
|
||||
|
||||
/// The thread where input is being polled and processed.
|
||||
void InputThread();
|
||||
|
||||
std::unique_ptr<Ui::QtSoftwareKeyboardDialog> ui;
|
||||
|
||||
Core::System& system;
|
||||
@@ -219,7 +223,10 @@ private:
|
||||
std::atomic<bool> caps_lock_enabled{false};
|
||||
|
||||
std::unique_ptr<InputInterpreter> input_interpreter;
|
||||
std::jthread input_thread;
|
||||
|
||||
std::thread input_thread;
|
||||
|
||||
std::atomic<bool> input_thread_running{};
|
||||
};
|
||||
|
||||
class QtSoftwareKeyboard final : public QObject, public Core::Frontend::SoftwareKeyboardApplet {
|
||||
|
||||
@@ -285,41 +285,54 @@ void QtNXWebEngineView::SendKeyPressEvent(int key) {
|
||||
}
|
||||
|
||||
void QtNXWebEngineView::StartInputThread() {
|
||||
input_thread = std::jthread([&](std::stop_token stoken) {
|
||||
// Wait for 1 second before allowing any inputs to be processed.
|
||||
std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||
if (is_local) {
|
||||
QWidget::grabKeyboard();
|
||||
}
|
||||
while (!stoken.stop_requested()) {
|
||||
input_interpreter->PollInput();
|
||||
if (input_thread_running) {
|
||||
return;
|
||||
}
|
||||
|
||||
HandleWindowFooterButtonPressedOnce<Core::HID::NpadButton::A, Core::HID::NpadButton::B,
|
||||
Core::HID::NpadButton::X, Core::HID::NpadButton::Y,
|
||||
Core::HID::NpadButton::L, Core::HID::NpadButton::R>();
|
||||
|
||||
HandleWindowKeyButtonPressedOnce<
|
||||
Core::HID::NpadButton::Left, Core::HID::NpadButton::Up, Core::HID::NpadButton::Right,
|
||||
Core::HID::NpadButton::Down, Core::HID::NpadButton::StickLLeft,
|
||||
Core::HID::NpadButton::StickLUp, Core::HID::NpadButton::StickLRight,
|
||||
Core::HID::NpadButton::StickLDown>();
|
||||
|
||||
HandleWindowKeyButtonHold<
|
||||
Core::HID::NpadButton::Left, Core::HID::NpadButton::Up, Core::HID::NpadButton::Right,
|
||||
Core::HID::NpadButton::Down, Core::HID::NpadButton::StickLLeft,
|
||||
Core::HID::NpadButton::StickLUp, Core::HID::NpadButton::StickLRight,
|
||||
Core::HID::NpadButton::StickLDown>();
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(50));
|
||||
}
|
||||
});
|
||||
input_thread_running = true;
|
||||
input_thread = std::thread(&QtNXWebEngineView::InputThread, this);
|
||||
}
|
||||
|
||||
void QtNXWebEngineView::StopInputThread() {
|
||||
if (is_local) {
|
||||
QWidget::releaseKeyboard();
|
||||
}
|
||||
input_thread.request_stop();
|
||||
|
||||
input_thread_running = false;
|
||||
if (input_thread.joinable()) {
|
||||
input_thread.join();
|
||||
}
|
||||
}
|
||||
|
||||
void QtNXWebEngineView::InputThread() {
|
||||
// Wait for 1 second before allowing any inputs to be processed.
|
||||
std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||
|
||||
if (is_local) {
|
||||
QWidget::grabKeyboard();
|
||||
}
|
||||
|
||||
while (input_thread_running) {
|
||||
input_interpreter->PollInput();
|
||||
|
||||
HandleWindowFooterButtonPressedOnce<Core::HID::NpadButton::A, Core::HID::NpadButton::B,
|
||||
Core::HID::NpadButton::X, Core::HID::NpadButton::Y,
|
||||
Core::HID::NpadButton::L, Core::HID::NpadButton::R>();
|
||||
|
||||
HandleWindowKeyButtonPressedOnce<
|
||||
Core::HID::NpadButton::Left, Core::HID::NpadButton::Up, Core::HID::NpadButton::Right,
|
||||
Core::HID::NpadButton::Down, Core::HID::NpadButton::StickLLeft,
|
||||
Core::HID::NpadButton::StickLUp, Core::HID::NpadButton::StickLRight,
|
||||
Core::HID::NpadButton::StickLDown>();
|
||||
|
||||
HandleWindowKeyButtonHold<
|
||||
Core::HID::NpadButton::Left, Core::HID::NpadButton::Up, Core::HID::NpadButton::Right,
|
||||
Core::HID::NpadButton::Down, Core::HID::NpadButton::StickLLeft,
|
||||
Core::HID::NpadButton::StickLUp, Core::HID::NpadButton::StickLRight,
|
||||
Core::HID::NpadButton::StickLDown>();
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(50));
|
||||
}
|
||||
}
|
||||
|
||||
void QtNXWebEngineView::LoadExtractedFonts() {
|
||||
|
||||
@@ -158,6 +158,9 @@ private:
|
||||
void StartInputThread();
|
||||
void StopInputThread();
|
||||
|
||||
/// The thread where input is being polled and processed.
|
||||
void InputThread();
|
||||
|
||||
/// Loads the extracted fonts using JavaScript.
|
||||
void LoadExtractedFonts();
|
||||
|
||||
@@ -165,13 +168,24 @@ private:
|
||||
void FocusFirstLinkElement();
|
||||
|
||||
InputCommon::InputSubsystem* input_subsystem;
|
||||
|
||||
std::unique_ptr<UrlRequestInterceptor> url_interceptor;
|
||||
|
||||
std::unique_ptr<InputInterpreter> input_interpreter;
|
||||
std::jthread input_thread;
|
||||
|
||||
std::thread input_thread;
|
||||
|
||||
std::atomic<bool> input_thread_running{};
|
||||
|
||||
std::atomic<bool> finished{};
|
||||
Service::AM::Frontend::WebExitReason exit_reason{Service::AM::Frontend::WebExitReason::EndButtonPressed};
|
||||
|
||||
Service::AM::Frontend::WebExitReason exit_reason{
|
||||
Service::AM::Frontend::WebExitReason::EndButtonPressed};
|
||||
|
||||
std::string last_url{"http://localhost/"};
|
||||
|
||||
bool is_local{};
|
||||
|
||||
QWebEngineProfile* default_profile;
|
||||
QWebEngineSettings* global_settings;
|
||||
};
|
||||
|
||||
@@ -40,6 +40,8 @@ void ConfigureGeneral::SetConfiguration() {}
|
||||
|
||||
void ConfigureGeneral::Setup(const ConfigurationShared::Builder& builder) {
|
||||
QLayout& general_layout = *ui->general_widget->layout();
|
||||
QLayout& linux_layout = *ui->linux_widget->layout();
|
||||
|
||||
std::map<u32, QWidget*> general_hold{};
|
||||
std::map<u32, QWidget*> linux_hold{};
|
||||
|
||||
@@ -52,6 +54,13 @@ void ConfigureGeneral::Setup(const ConfigurationShared::Builder& builder) {
|
||||
};
|
||||
|
||||
push(UISettings::values.linkage.by_category[Settings::Category::UiGeneral]);
|
||||
push(Settings::values.linkage.by_category[Settings::Category::Linux]);
|
||||
|
||||
// Only show Linux group on Unix
|
||||
#ifndef __unix__
|
||||
ui->LinuxGroupBox->setVisible(false);
|
||||
#endif
|
||||
|
||||
for (const auto setting : settings) {
|
||||
auto* widget = builder.BuildWidget(setting, apply_funcs);
|
||||
|
||||
@@ -67,6 +76,9 @@ void ConfigureGeneral::Setup(const ConfigurationShared::Builder& builder) {
|
||||
case Settings::Category::UiGeneral:
|
||||
general_hold.emplace(setting->Id(), widget);
|
||||
break;
|
||||
case Settings::Category::Linux:
|
||||
linux_hold.emplace(setting->Id(), widget);
|
||||
break;
|
||||
default:
|
||||
widget->deleteLater();
|
||||
}
|
||||
@@ -75,6 +87,9 @@ void ConfigureGeneral::Setup(const ConfigurationShared::Builder& builder) {
|
||||
for (const auto& [id, widget] : general_hold) {
|
||||
general_layout.addWidget(widget);
|
||||
}
|
||||
for (const auto& [id, widget] : linux_hold) {
|
||||
linux_layout.addWidget(widget);
|
||||
}
|
||||
}
|
||||
|
||||
// Called to set the callback when resetting settings to defaults
|
||||
|
||||
@@ -46,6 +46,33 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="LinuxGroupBox">
|
||||
<property name="title">
|
||||
<string>Linux</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="LinuxVerticalLayout_1">
|
||||
<item>
|
||||
<widget class="QWidget" name="linux_widget" native="true">
|
||||
<layout class="QVBoxLayout" name="LinuxVerticalLayout_2">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
|
||||
75
src/yuzu/configuration/configure_linux_tab.cpp
Normal file
75
src/yuzu/configuration/configure_linux_tab.cpp
Normal file
@@ -0,0 +1,75 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "common/settings.h"
|
||||
#include "core/core.h"
|
||||
#include "ui_configure_linux_tab.h"
|
||||
#include "yuzu/configuration/configuration_shared.h"
|
||||
#include "yuzu/configuration/configure_linux_tab.h"
|
||||
#include "yuzu/configuration/shared_widget.h"
|
||||
|
||||
ConfigureLinuxTab::ConfigureLinuxTab(const Core::System& system_,
|
||||
std::shared_ptr<std::vector<ConfigurationShared::Tab*>> group_,
|
||||
const ConfigurationShared::Builder& builder, QWidget* parent)
|
||||
: Tab(group_, parent), ui(std::make_unique<Ui::ConfigureLinuxTab>()), system{system_} {
|
||||
ui->setupUi(this);
|
||||
|
||||
Setup(builder);
|
||||
|
||||
SetConfiguration();
|
||||
}
|
||||
|
||||
ConfigureLinuxTab::~ConfigureLinuxTab() = default;
|
||||
|
||||
void ConfigureLinuxTab::SetConfiguration() {}
|
||||
void ConfigureLinuxTab::Setup(const ConfigurationShared::Builder& builder) {
|
||||
QLayout& linux_layout = *ui->linux_widget->layout();
|
||||
|
||||
std::map<u32, QWidget*> linux_hold{};
|
||||
|
||||
std::vector<Settings::BasicSetting*> settings;
|
||||
const auto push = [&](Settings::Category category) {
|
||||
for (const auto setting : Settings::values.linkage.by_category[category]) {
|
||||
settings.push_back(setting);
|
||||
}
|
||||
};
|
||||
|
||||
push(Settings::Category::Linux);
|
||||
|
||||
for (auto* setting : settings) {
|
||||
auto* widget = builder.BuildWidget(setting, apply_funcs);
|
||||
|
||||
if (widget == nullptr) {
|
||||
continue;
|
||||
}
|
||||
if (!widget->Valid()) {
|
||||
widget->deleteLater();
|
||||
continue;
|
||||
}
|
||||
|
||||
linux_hold.insert({setting->Id(), widget});
|
||||
}
|
||||
|
||||
for (const auto& [id, widget] : linux_hold) {
|
||||
linux_layout.addWidget(widget);
|
||||
}
|
||||
}
|
||||
|
||||
void ConfigureLinuxTab::ApplyConfiguration() {
|
||||
const bool is_powered_on = system.IsPoweredOn();
|
||||
for (const auto& apply_func : apply_funcs) {
|
||||
apply_func(is_powered_on);
|
||||
}
|
||||
}
|
||||
|
||||
void ConfigureLinuxTab::changeEvent(QEvent* event) {
|
||||
if (event->type() == QEvent::LanguageChange) {
|
||||
RetranslateUI();
|
||||
}
|
||||
|
||||
QWidget::changeEvent(event);
|
||||
}
|
||||
|
||||
void ConfigureLinuxTab::RetranslateUI() {
|
||||
ui->retranslateUi(this);
|
||||
}
|
||||
44
src/yuzu/configuration/configure_linux_tab.h
Normal file
44
src/yuzu/configuration/configure_linux_tab.h
Normal file
@@ -0,0 +1,44 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Ui {
|
||||
class ConfigureLinuxTab;
|
||||
}
|
||||
|
||||
namespace ConfigurationShared {
|
||||
class Builder;
|
||||
}
|
||||
|
||||
class ConfigureLinuxTab : public ConfigurationShared::Tab {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ConfigureLinuxTab(const Core::System& system_,
|
||||
std::shared_ptr<std::vector<ConfigurationShared::Tab*>> group,
|
||||
const ConfigurationShared::Builder& builder,
|
||||
QWidget* parent = nullptr);
|
||||
~ConfigureLinuxTab() override;
|
||||
|
||||
void ApplyConfiguration() override;
|
||||
void SetConfiguration() override;
|
||||
|
||||
private:
|
||||
void changeEvent(QEvent* event) override;
|
||||
void RetranslateUI();
|
||||
|
||||
void Setup(const ConfigurationShared::Builder& builder);
|
||||
|
||||
std::unique_ptr<Ui::ConfigureLinuxTab> ui;
|
||||
|
||||
const Core::System& system;
|
||||
|
||||
std::vector<std::function<void(bool)>> apply_funcs{};
|
||||
};
|
||||
53
src/yuzu/configuration/configure_linux_tab.ui
Normal file
53
src/yuzu/configuration/configure_linux_tab.ui
Normal file
@@ -0,0 +1,53 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ConfigureLinuxTab</class>
|
||||
<widget class="QWidget" name="ConfigureLinuxTab">
|
||||
<property name="accessibleName">
|
||||
<string>Linux</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="LinuxGroupBox">
|
||||
<property name="title">
|
||||
<string>Linux</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="LinuxVerticalLayout_1">
|
||||
<item>
|
||||
<widget class="QWidget" name="linux_widget" native="true">
|
||||
<layout class="QVBoxLayout" name="LinuxVerticalLayout_2">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "yuzu/configuration/configure_graphics_advanced.h"
|
||||
#include "yuzu/configuration/configure_graphics_extensions.h"
|
||||
#include "yuzu/configuration/configure_input_per_game.h"
|
||||
#include "yuzu/configuration/configure_linux_tab.h"
|
||||
#include "yuzu/configuration/configure_per_game.h"
|
||||
#include "yuzu/configuration/configure_per_game_addons.h"
|
||||
#include "yuzu/configuration/configure_system.h"
|
||||
@@ -67,6 +68,7 @@ ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id_, const std::st
|
||||
system_, vk_device_records, [&]() { graphics_advanced_tab->ExposeComputeOption(); },
|
||||
[](Settings::AspectRatio, Settings::ResolutionSetup) {}, tab_group, *builder, this);
|
||||
input_tab = std::make_unique<ConfigureInputPerGame>(system_, game_config.get(), this);
|
||||
linux_tab = std::make_unique<ConfigureLinuxTab>(system_, tab_group, *builder, this);
|
||||
system_tab = std::make_unique<ConfigureSystem>(system_, tab_group, *builder, this);
|
||||
network_tab = std::make_unique<ConfigureNetwork>(system_, this);
|
||||
|
||||
@@ -82,6 +84,13 @@ ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id_, const std::st
|
||||
ui->tabWidget->addTab(input_tab.get(), tr("Input Profiles"));
|
||||
ui->tabWidget->addTab(network_tab.get(), tr("Network"));
|
||||
|
||||
// Only show Linux tab on Unix
|
||||
linux_tab->setVisible(false);
|
||||
#ifdef __unix__
|
||||
linux_tab->setVisible(true);
|
||||
ui->tabWidget->addTab(linux_tab.get(), tr("Linux"));
|
||||
#endif
|
||||
|
||||
setFocusPolicy(Qt::ClickFocus);
|
||||
setWindowTitle(tr("Properties"));
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ class ConfigureGraphics;
|
||||
class ConfigureGraphicsAdvanced;
|
||||
class ConfigureGraphicsExtensions;
|
||||
class ConfigureInputPerGame;
|
||||
class ConfigureLinuxTab;
|
||||
class ConfigureSystem;
|
||||
class ConfigureNetwork;
|
||||
|
||||
@@ -91,6 +92,7 @@ private:
|
||||
std::unique_ptr<ConfigureGraphicsExtensions> graphics_extensions_tab;
|
||||
std::unique_ptr<ConfigureGraphics> graphics_tab;
|
||||
std::unique_ptr<ConfigureInputPerGame> input_tab;
|
||||
std::unique_ptr<ConfigureLinuxTab> linux_tab;
|
||||
std::unique_ptr<ConfigureSystem> system_tab;
|
||||
std::unique_ptr<ConfigureNetwork> network_tab;
|
||||
};
|
||||
|
||||
@@ -122,9 +122,7 @@ int main(int argc, char* argv[]) {
|
||||
// the user folder in the Qt Frontend, we need to cd into that working directory
|
||||
const auto bin_path = Common::FS::GetBundleDirectory() / "..";
|
||||
chdir(Common::FS::PathToUTF8String(bin_path).c_str());
|
||||
#endif
|
||||
|
||||
#ifdef __unix__
|
||||
#elif defined(__unix__) && !defined(__ANDROID__)
|
||||
// Set the DISPLAY variable in order to open web browsers
|
||||
// TODO (lat9nq): Find a better solution for AppImages to start external applications
|
||||
if (QString::fromLocal8Bit(qgetenv("DISPLAY")).isEmpty()) {
|
||||
|
||||
@@ -164,7 +164,9 @@ static FileSys::VirtualFile VfsDirectoryCreateFileWrapper(const FileSys::Virtual
|
||||
|
||||
#endif
|
||||
|
||||
#include "qt_common/gamemode.h"
|
||||
#ifdef __linux__
|
||||
#include "common/linux/gamemode.h"
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "core/core_timing.h"
|
||||
@@ -421,7 +423,9 @@ MainWindow::MainWindow(bool has_broken_vulkan)
|
||||
SetupSigInterrupts();
|
||||
#endif
|
||||
|
||||
SetGamemodeEnabled(UISettings::values.enable_gamemode.GetValue());
|
||||
#ifdef __linux__
|
||||
SetGamemodeEnabled(Settings::values.enable_gamemode.GetValue());
|
||||
#endif
|
||||
|
||||
UISettings::RestoreWindowState(config);
|
||||
|
||||
@@ -2194,7 +2198,10 @@ void MainWindow::OnEmulationStopped() {
|
||||
emulation_running = false;
|
||||
|
||||
discord_rpc->Update();
|
||||
Common::FeralGamemode::Stop();
|
||||
|
||||
#ifdef __linux__
|
||||
Common::Linux::StopGamemode();
|
||||
#endif
|
||||
|
||||
// The emulation is stopped, so closing the window or not does not matter anymore
|
||||
disconnect(render_window, &GRenderWindow::Closed, this, &MainWindow::OnStopGame);
|
||||
@@ -3065,7 +3072,10 @@ void MainWindow::OnStartGame() {
|
||||
play_time_manager->Start();
|
||||
|
||||
discord_rpc->Update();
|
||||
Common::FeralGamemode::Start();
|
||||
|
||||
#ifdef __linux__
|
||||
Common::Linux::StartGamemode();
|
||||
#endif
|
||||
}
|
||||
|
||||
void MainWindow::OnRestartGame() {
|
||||
@@ -3086,7 +3096,10 @@ void MainWindow::OnPauseGame() {
|
||||
play_time_manager->Stop();
|
||||
UpdateMenuState();
|
||||
AllowOSSleep();
|
||||
Common::FeralGamemode::Stop();
|
||||
|
||||
#ifdef __linux__
|
||||
Common::Linux::StopGamemode();
|
||||
#endif
|
||||
}
|
||||
|
||||
void MainWindow::OnPauseContinueGame() {
|
||||
@@ -3371,9 +3384,11 @@ void MainWindow::OnConfigure() {
|
||||
const auto old_theme = UISettings::values.theme;
|
||||
const bool old_discord_presence = UISettings::values.enable_discord_presence.GetValue();
|
||||
const auto old_language_index = Settings::values.language_index.GetValue();
|
||||
const bool old_gamemode = UISettings::values.enable_gamemode.GetValue();
|
||||
#ifdef __linux__
|
||||
const bool old_gamemode = Settings::values.enable_gamemode.GetValue();
|
||||
#endif
|
||||
#ifdef __unix__
|
||||
const bool old_force_x11 = UISettings::values.gui_force_x11.GetValue();
|
||||
const bool old_force_x11 = Settings::values.gui_force_x11.GetValue();
|
||||
#endif
|
||||
|
||||
Settings::SetConfiguringGlobal(true);
|
||||
@@ -3434,12 +3449,14 @@ void MainWindow::OnConfigure() {
|
||||
if (UISettings::values.enable_discord_presence.GetValue() != old_discord_presence) {
|
||||
SetDiscordEnabled(UISettings::values.enable_discord_presence.GetValue());
|
||||
}
|
||||
if (UISettings::values.enable_gamemode.GetValue() != old_gamemode) {
|
||||
SetGamemodeEnabled(UISettings::values.enable_gamemode.GetValue());
|
||||
#ifdef __linux__
|
||||
if (Settings::values.enable_gamemode.GetValue() != old_gamemode) {
|
||||
SetGamemodeEnabled(Settings::values.enable_gamemode.GetValue());
|
||||
}
|
||||
#endif
|
||||
#ifdef __unix__
|
||||
if (UISettings::values.gui_force_x11.GetValue() != old_force_x11) {
|
||||
GraphicsBackend::SetForceX11(UISettings::values.gui_force_x11.GetValue());
|
||||
if (Settings::values.gui_force_x11.GetValue() != old_force_x11) {
|
||||
GraphicsBackend::SetForceX11(Settings::values.gui_force_x11.GetValue());
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -4386,7 +4403,7 @@ void MainWindow::OnCheckGraphicsBackend() {
|
||||
if (!isWayland)
|
||||
return;
|
||||
|
||||
const bool currently_hidden = UISettings::values.gui_hide_backend_warning.GetValue();
|
||||
const bool currently_hidden = Settings::values.gui_hide_backend_warning.GetValue();
|
||||
if (currently_hidden)
|
||||
return;
|
||||
|
||||
@@ -4409,11 +4426,11 @@ void MainWindow::OnCheckGraphicsBackend() {
|
||||
|
||||
const bool hide = cb->isChecked();
|
||||
if (hide != currently_hidden) {
|
||||
UISettings::values.gui_hide_backend_warning.SetValue(hide);
|
||||
Settings::values.gui_hide_backend_warning.SetValue(hide);
|
||||
}
|
||||
|
||||
if (msgbox.clickedButton() == okButton) {
|
||||
UISettings::values.gui_force_x11.SetValue(true);
|
||||
Settings::values.gui_force_x11.SetValue(true);
|
||||
GraphicsBackend::SetForceX11(true);
|
||||
QMessageBox::information(this,
|
||||
tr("Restart Required"),
|
||||
@@ -4743,14 +4760,13 @@ void MainWindow::SetDiscordEnabled([[maybe_unused]] bool state) {
|
||||
discord_rpc->Update();
|
||||
}
|
||||
|
||||
#ifdef __linux__
|
||||
void MainWindow::SetGamemodeEnabled(bool state) {
|
||||
if (emulation_running) {
|
||||
if (state)
|
||||
Common::FeralGamemode::Start();
|
||||
else
|
||||
Common::FeralGamemode::Stop();
|
||||
Common::Linux::SetGamemodeState(state);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void MainWindow::changeEvent(QEvent* event) {
|
||||
#ifdef __unix__
|
||||
|
||||
@@ -314,8 +314,8 @@ private:
|
||||
void SetupSigInterrupts();
|
||||
static void HandleSigInterrupt(int);
|
||||
void OnSigInterruptNotifierActivated();
|
||||
#endif
|
||||
void SetGamemodeEnabled(bool state);
|
||||
#endif
|
||||
|
||||
Service::AM::FrontendAppletParameters ApplicationAppletParameters();
|
||||
Service::AM::FrontendAppletParameters LibraryAppletParameters(u64 program_id,
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
@@ -233,20 +231,34 @@ void OverlayDialog::TranslateButtonPress(Core::HID::NpadButton button) {
|
||||
}
|
||||
|
||||
void OverlayDialog::StartInputThread() {
|
||||
input_thread = std::jthread([&](std::stop_token stoken) {
|
||||
while (!stoken.stop_requested()) {
|
||||
input_interpreter->PollInput();
|
||||
HandleButtonPressedOnce<Core::HID::NpadButton::A, Core::HID::NpadButton::B,
|
||||
Core::HID::NpadButton::Left, Core::HID::NpadButton::Right,
|
||||
Core::HID::NpadButton::StickLLeft,
|
||||
Core::HID::NpadButton::StickLRight>();
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(50));
|
||||
}
|
||||
});
|
||||
if (input_thread_running) {
|
||||
return;
|
||||
}
|
||||
|
||||
input_thread_running = true;
|
||||
|
||||
input_thread = std::thread(&OverlayDialog::InputThread, this);
|
||||
}
|
||||
|
||||
void OverlayDialog::StopInputThread() {
|
||||
input_thread.request_stop();
|
||||
input_thread_running = false;
|
||||
|
||||
if (input_thread.joinable()) {
|
||||
input_thread.join();
|
||||
}
|
||||
}
|
||||
|
||||
void OverlayDialog::InputThread() {
|
||||
while (input_thread_running) {
|
||||
input_interpreter->PollInput();
|
||||
|
||||
HandleButtonPressedOnce<Core::HID::NpadButton::A, Core::HID::NpadButton::B,
|
||||
Core::HID::NpadButton::Left, Core::HID::NpadButton::Right,
|
||||
Core::HID::NpadButton::StickLLeft,
|
||||
Core::HID::NpadButton::StickLRight>();
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(50));
|
||||
}
|
||||
}
|
||||
|
||||
void OverlayDialog::keyPressEvent(QKeyEvent* e) {
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <atomic>
|
||||
#include <memory>
|
||||
#include <thread>
|
||||
|
||||
@@ -92,6 +91,9 @@ private:
|
||||
|
||||
void StartInputThread();
|
||||
void StopInputThread();
|
||||
|
||||
/// The thread where input is being polled and processed.
|
||||
void InputThread();
|
||||
void keyPressEvent(QKeyEvent* e) override;
|
||||
|
||||
std::unique_ptr<Ui::OverlayDialog> ui;
|
||||
@@ -99,5 +101,8 @@ private:
|
||||
bool use_rich_text;
|
||||
|
||||
std::unique_ptr<InputInterpreter> input_interpreter;
|
||||
std::jthread input_thread;
|
||||
|
||||
std::thread input_thread;
|
||||
|
||||
std::atomic<bool> input_thread_running{};
|
||||
};
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
// SPDX-FileCopyrightText: 2015 Citra Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include <array>
|
||||
#include <cmath>
|
||||
#include <QPainter>
|
||||
|
||||
@@ -11,7 +12,6 @@
|
||||
#include "common/logging/log.h"
|
||||
#include "core/frontend/applets/profile_select.h"
|
||||
#include "core/hle/service/acc/profile_manager.h"
|
||||
#include "frontend_common/data_manager.h"
|
||||
#include "qt_common/qt_common.h"
|
||||
#include "yuzu/util/util.h"
|
||||
|
||||
@@ -29,7 +29,16 @@ QFont GetMonospaceFont() {
|
||||
}
|
||||
|
||||
QString ReadableByteSize(qulonglong size) {
|
||||
return QString::fromStdString(FrontendCommon::DataManager::ReadableBytesSize(size));
|
||||
static constexpr std::array units{"B", "KiB", "MiB", "GiB", "TiB", "PiB"};
|
||||
if (size == 0) {
|
||||
return QStringLiteral("0");
|
||||
}
|
||||
|
||||
const int digit_groups = (std::min)(static_cast<int>(std::log10(size) / std::log10(1024)),
|
||||
static_cast<int>(units.size()));
|
||||
return QStringLiteral("%L1 %2")
|
||||
.arg(size / std::pow(1024, digit_groups), 0, 'f', 1)
|
||||
.arg(QString::fromUtf8(units[digit_groups]));
|
||||
}
|
||||
|
||||
QPixmap CreateCirclePixmapFromColor(const QColor& color) {
|
||||
|
||||
@@ -60,6 +60,10 @@ __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __linux__
|
||||
#include "common/linux/gamemode.h"
|
||||
#endif
|
||||
|
||||
static void PrintHelp(const char* argv0) {
|
||||
std::cout << "Usage: " << argv0
|
||||
<< " [options] <filename>\n"
|
||||
@@ -423,6 +427,11 @@ int main(int argc, char** argv) {
|
||||
// Just exit right away.
|
||||
exit(0);
|
||||
});
|
||||
|
||||
#ifdef __linux__
|
||||
Common::Linux::StartGamemode();
|
||||
#endif
|
||||
|
||||
void(system.Run());
|
||||
if (system.DebuggerEnabled()) {
|
||||
system.InitializeDebugger();
|
||||
@@ -433,6 +442,11 @@ int main(int argc, char** argv) {
|
||||
system.DetachDebugger();
|
||||
void(system.Pause());
|
||||
system.ShutdownMainProcess();
|
||||
|
||||
#ifdef __linux__
|
||||
Common::Linux::StopGamemode();
|
||||
#endif
|
||||
|
||||
detached_tasks.WaitForAllTasks();
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user