From 9b18d0b1113fb2b73acc539d2e4dfae85e511cd4 Mon Sep 17 00:00:00 2001 From: lizzie Date: Fri, 22 May 2026 21:15:31 +0200 Subject: [PATCH 1/5] [tools] refactor, use #!/bin/sh, update license files (#3998) Signed-off-by: lizzie Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3998 Reviewed-by: crueter Reviewed-by: MaranBr --- .ci/license-header.sh | 11 ++++++----- .ci/source.sh | 22 ---------------------- docs/Caveats.md | 2 +- docs/user/SteamROM.md | 2 +- docs/user/ThirdParty.md | 1 + externals/nx_tzdb/tzdb_template.h.in | 3 +++ hooks/pre-commit | 13 +++++++------ shell.nix | 4 ++++ tools/README.md | 2 +- tools/clang-format.sh | 2 +- tools/dtrace-tool.pl | 5 +++-- tools/lanczos-gen.pl | 4 ++-- tools/llvmpipe-run.sh | 5 +++-- tools/optimize-assets.sh | 2 +- tools/stale-translations.sh | 2 +- tools/svc_generator.py | 20 ++++++++++---------- tools/translations/qt-source.sh | 4 ++-- tools/translations/update-translations.sh | 4 ++-- tools/unused-strings.sh | 2 +- tools/windows/install-vulkan-sdk.sh | 2 +- 20 files changed, 51 insertions(+), 61 deletions(-) delete mode 100755 .ci/source.sh mode change 100644 => 100755 shell.nix mode change 100644 => 100755 tools/lanczos-gen.pl diff --git a/.ci/license-header.sh b/.ci/license-header.sh index 6b19f91185..fcc2c1f583 100755 --- a/.ci/license-header.sh +++ b/.ci/license-header.sh @@ -7,7 +7,7 @@ EXCLUDE_FILES="CPM.cmake CPMUtil.cmake GetSCMRev.cmake renderdoc_app.h tools/cpm tools/shellcheck.sh tools/update-cpm.sh tools/windows/vcvarsall.sh externals/stb externals/glad externals/getopt externals/gamemode externals/FidelityFX-FSR externals/demangle externals/bc_decoder externals/cmake-modules" # license header constants, please change when needed :)))) -YEAR=2026 +YEAR=$(date "+%Y") HOLDER="Eden Emulator Project" LICENSE="GPL-3.0-or-later" @@ -112,10 +112,10 @@ for file in $FILES; do [ "$excluded" = "true" ] && continue case "$file" in - *.cmake|*.sh|*CMakeLists.txt) + *.cmake|*.sh|*.ps1|*.py|*.rb|*.perl|*.pl|*.nix|*CMakeLists.txt) begin="#" ;; - *.kt*|*.cpp|*.h|*.qml) + *.kt|*.kts|*.cpp|*.h|*.qml|*.c|*.hpp|*.hxx|*.cxx|*.h.in|*.inc) begin="//" ;; *) @@ -185,11 +185,12 @@ if [ "$UPDATE" = "true" ]; then for file in $SRC_FILES $OTHER_FILES; do case $(basename -- "$file") in - *.cmake|*CMakeLists.txt) + # Windows Powershell wont use shebangs + *.cmake|*.ps1|*CMakeLists.txt) begin="#" shell="false" ;; - *.sh) + *.sh|*.py|*.rb|*.perl|*.pl|*.nix) begin="#" shell=true ;; diff --git a/.ci/source.sh b/.ci/source.sh deleted file mode 100755 index cbdacd1cd7..0000000000 --- a/.ci/source.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -ex - -# git-archive-all -export PATH="$PATH:/home/$USER/.local/bin" - -GITDATE="`git show -s --date=short --format='%ad' | sed 's/-//g'`" -GITREV="`git show -s --format='%h'`" -REV_NAME="eden-unified-source-${GITDATE}-${GITREV}" - -COMPAT_LIST='dist/compatibility_list/compatibility_list.json' - -mkdir artifacts - -touch "${COMPAT_LIST}" -git describe --abbrev=0 --always HEAD > GIT-COMMIT -git describe --tags HEAD > GIT-TAG || echo 'unknown' > GIT-TAG -git-archive-all --include "${COMPAT_LIST}" --include GIT-COMMIT --include GIT-TAG --force-submodules artifacts/"${REV_NAME}.tar" - -cd artifacts/ -xz -T0 -9 "${REV_NAME}.tar" -sha256sum "${REV_NAME}.tar.xz" > "${REV_NAME}.tar.xz.sha256sum" -cd .. diff --git a/docs/Caveats.md b/docs/Caveats.md index fb86437737..c5b925f4cd 100644 --- a/docs/Caveats.md +++ b/docs/Caveats.md @@ -46,7 +46,7 @@ Qt Widgets appears to be broken. For now, add `-DENABLE_QT=OFF` to your configur This is needed for some dependencies that call cc directly (tz): ```sh -echo '#!/bin/sh' >cc +echo '#!/bin/sh -e' >cc echo 'gcc $@' >>cc chmod +x cc export PATH="$PATH:$PWD" diff --git a/docs/user/SteamROM.md b/docs/user/SteamROM.md index a782b51969..2ea069bf09 100644 --- a/docs/user/SteamROM.md +++ b/docs/user/SteamROM.md @@ -59,7 +59,7 @@ EmuDeck will automatically create an *Emulators - Emulators* parser for ***Steam 4. Paste the following code into the contents of the file, save and close the file. ```bash - #!/bin/bash + #!/bin/sh -e emuName="eden" #parameterize me . "$HOME/.config/EmuDeck/backend/functions/all.sh" diff --git a/docs/user/ThirdParty.md b/docs/user/ThirdParty.md index 5bd72ebe72..1dd359cec3 100644 --- a/docs/user/ThirdParty.md +++ b/docs/user/ThirdParty.md @@ -13,6 +13,7 @@ The main origin repository is always at https://git.eden-emu.dev/eden-emu/eden. - https://github.com/eden-emulator/mirror - https://git.crueter.xyz/mirror/eden +- https://codeberg.org/eden-emu/eden - https://collective.taymaerz.de/eden/eden Other mirrors obviously exist on the internet, but we can't guarantee their reliability and/or availability. diff --git a/externals/nx_tzdb/tzdb_template.h.in b/externals/nx_tzdb/tzdb_template.h.in index d7907b846d..c349a143d5 100644 --- a/externals/nx_tzdb/tzdb_template.h.in +++ b/externals/nx_tzdb/tzdb_template.h.in @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/hooks/pre-commit b/hooks/pre-commit index 484eef1762..b543ff36ab 100755 --- a/hooks/pre-commit +++ b/hooks/pre-commit @@ -1,5 +1,7 @@ -#!/bin/sh +#!/bin/sh -e +# SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-FileCopyrightText: 2015 Citra Emulator Project # SPDX-License-Identifier: GPL-2.0-or-later @@ -10,20 +12,19 @@ paths_to_check="src/ CMakeLists.txt" # If there are whitespace errors, print the offending file names and fail. if ! git diff --cached --check -- $paths_to_check ; then - cat<` (for `.py`, `.rb`, or `.perl`). Keep scripts POSIX compliant (i.e not require hard `bash` to run, just plain old `sh`). ## Third-Party diff --git a/tools/clang-format.sh b/tools/clang-format.sh index e2857d9723..ca5e6fce39 100755 --- a/tools/clang-format.sh +++ b/tools/clang-format.sh @@ -1,4 +1,4 @@ -#! /bin/sh +#!/bin/sh -e # SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project # SPDX-License-Identifier: GPL-3.0-or-later diff --git a/tools/dtrace-tool.pl b/tools/dtrace-tool.pl index d143d36f3e..693a9e7507 100755 --- a/tools/dtrace-tool.pl +++ b/tools/dtrace-tool.pl @@ -1,5 +1,6 @@ -#!/usr/bin/perl -# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +#!/usr/bin/env perl + +# SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project # SPDX-License-Identifier: GPL-3.0-or-later # Basic script to run dtrace sampling over the program (requires Flamegraph) # Usage is either running as: ./dtrace-tool.sh pid (then input the pid of the process) diff --git a/tools/lanczos-gen.pl b/tools/lanczos-gen.pl old mode 100644 new mode 100755 index 2e26c8c6b9..3eab5cdb10 --- a/tools/lanczos-gen.pl +++ b/tools/lanczos-gen.pl @@ -1,5 +1,5 @@ -#!/usr/bin/perl -# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +#!/usr/bin/env perl +# SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project # SPDX-License-Identifier: GPL-3.0-or-later use strict; use warnings; diff --git a/tools/llvmpipe-run.sh b/tools/llvmpipe-run.sh index c3a5a85d41..f09fe87ef4 100755 --- a/tools/llvmpipe-run.sh +++ b/tools/llvmpipe-run.sh @@ -1,5 +1,6 @@ -#!/bin/sh -# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +#!/bin/sh -e + +# SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project # SPDX-License-Identifier: GPL-3.0-or-later # This script basically allows you to "dirtily" use llvmpipe in any configuration diff --git a/tools/optimize-assets.sh b/tools/optimize-assets.sh index 70fa2375a5..a9b2888648 100755 --- a/tools/optimize-assets.sh +++ b/tools/optimize-assets.sh @@ -1,6 +1,6 @@ #!/bin/sh -e -# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +# SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project # SPDX-License-Identifier: GPL-3.0-or-later which optipng || exit diff --git a/tools/stale-translations.sh b/tools/stale-translations.sh index 3a9362a252..63ea87b19a 100755 --- a/tools/stale-translations.sh +++ b/tools/stale-translations.sh @@ -1,6 +1,6 @@ #!/bin/sh -e -# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +# SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project # SPDX-License-Identifier: GPL-3.0-or-later ANDROID=src/android/app/src/main diff --git a/tools/svc_generator.py b/tools/svc_generator.py index d00fe0ba63..9a99c3ba51 100755 --- a/tools/svc_generator.py +++ b/tools/svc_generator.py @@ -1,5 +1,5 @@ -#!/usr/bin/python3 -# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +#!/usr/bin/env python3 +# SPDX-FileCopyrightText: Copyright 2026 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 @@ -212,7 +212,7 @@ def emit_size_check(): if type != "void": lines.append(f"static_assert(sizeof({type}) == {size});") - return "\n".join(lines) + return f"\n{lines}" # Replaces a type with an arch-specific one, if it exists. @@ -423,7 +423,7 @@ def emit_lines(lines, indent=' '): output_lines.append(line) first = False - return "\n".join(output_lines) + return f"\n{output_lines}" # Emit a C++ function to wrap a guest SVC. @@ -601,7 +601,7 @@ def emit_call(bitness, names, suffix): lines.append(f"{indent}}}") lines.append("}") - return "\n".join(lines) + return f"\n{lines}" def build_fn_declaration(return_type, name, arguments): @@ -623,7 +623,7 @@ def build_enum_declarations(): lines.append(f"{indent}{name} = {hex(imm)},") lines.append("};") - return "\n".join(lines) + return f"\n{lines}" def main(): @@ -665,11 +665,11 @@ def main(): with open("src/core/hle/kernel/svc.h", "w") as f: f.write(COPYRIGHT) f.write(PROLOGUE_H) - f.write("\n".join(svc_fw_declarations)) + f.write(f"\n{svc_fw_declarations}") f.write("\n\n") - f.write("\n".join(arch_fw_declarations[BIT_32])) + f.write(f"\n{arch_fw_declarations[BIT_32]}") f.write("\n\n") - f.write("\n".join(arch_fw_declarations[BIT_64])) + f.write(f"\n{arch_fw_declarations[BIT_64]}") f.write("\n\n") f.write(enum_decls) f.write(EPILOGUE_H) @@ -679,7 +679,7 @@ def main(): f.write(PROLOGUE_CPP) f.write(emit_size_check()) f.write("\n\n") - f.write("\n\n".join(wrapper_fns)) + f.write(f"\n\n{wrapper_fns}") f.write("\n\n") f.write(call_32) f.write("\n\n") diff --git a/tools/translations/qt-source.sh b/tools/translations/qt-source.sh index 89c881d8c0..707ec2783c 100755 --- a/tools/translations/qt-source.sh +++ b/tools/translations/qt-source.sh @@ -1,6 +1,6 @@ -#!/bin/sh +#!/bin/sh -e -# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +# SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project # SPDX-License-Identifier: GPL-3.0-or-later SOURCES=$(find src/yuzu src/qt_common -type f \( -name "*.ui" -o -name "*.cpp" -o -name "*.h" -o -name "*.plist" \)) diff --git a/tools/translations/update-translations.sh b/tools/translations/update-translations.sh index 8bcd79142f..6ed740140d 100755 --- a/tools/translations/update-translations.sh +++ b/tools/translations/update-translations.sh @@ -1,6 +1,6 @@ -#!/bin/sh +#!/bin/sh -e -# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +# SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project # SPDX-License-Identifier: GPL-3.0-or-later command -v tx-cli && COMMAND=tx-cli diff --git a/tools/unused-strings.sh b/tools/unused-strings.sh index 1165a203aa..10f6a63565 100755 --- a/tools/unused-strings.sh +++ b/tools/unused-strings.sh @@ -1,6 +1,6 @@ #!/bin/sh -e -# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +# SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project # SPDX-License-Identifier: GPL-3.0-or-later ANDROID=src/android/app/src/main diff --git a/tools/windows/install-vulkan-sdk.sh b/tools/windows/install-vulkan-sdk.sh index 0f136748cf..2151363793 100644 --- a/tools/windows/install-vulkan-sdk.sh +++ b/tools/windows/install-vulkan-sdk.sh @@ -1,4 +1,4 @@ -#!/usr/bin/sh +#!/bin/sh -e # SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project # SPDX-License-Identifier: GPL-3.0-or-later From 83683440b24c2d07536fddf2faa77c000c14374b Mon Sep 17 00:00:00 2001 From: xbzk Date: Fri, 22 May 2026 22:48:15 +0200 Subject: [PATCH 2/5] [net] ban api.epicgames.dev domain (#3999) Adding 'api.epicgames.dev' to the banlist, as instructed by lizzie. MCI insists on connection and randomly crashes at Network::Poll(...). Airplane mode would do, but then the DLC gets unavailable. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3999 Reviewed-by: Maufeat Reviewed-by: Lizzie --- src/core/hle/service/sockets/sfdnsres.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/hle/service/sockets/sfdnsres.cpp b/src/core/hle/service/sockets/sfdnsres.cpp index fa3a5bb82a..fa921790e4 100644 --- a/src/core/hle/service/sockets/sfdnsres.cpp +++ b/src/core/hle/service/sockets/sfdnsres.cpp @@ -91,6 +91,7 @@ static const constexpr std::array blockedDomains = { "microsoft.com", //minecraft dungeons + other games "mojang.com", "xboxlive.com", + "api.epicgames.dev", // marvel cosmic invasion +? "minecraftservices.com" }; From da1dc2f340e2ef4989cf2ef7cb490beca8173c4a Mon Sep 17 00:00:00 2001 From: xbzk Date: Fri, 22 May 2026 19:42:56 -0300 Subject: [PATCH 3/5] [fence_manager, ui] antiflicker fix + toggle integration --- .../yuzu_emu/features/settings/model/BooleanSetting.kt | 1 + .../yuzu_emu/features/settings/model/view/SettingsItem.kt | 7 +++++++ .../features/settings/ui/SettingsFragmentPresenter.kt | 1 + src/android/app/src/main/res/values/strings.xml | 2 ++ src/common/settings.h | 7 +++++++ src/qt_common/config/shared_translation.cpp | 3 +++ src/video_core/fence_manager.h | 6 +++--- 7 files changed, 24 insertions(+), 3 deletions(-) diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/BooleanSetting.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/BooleanSetting.kt index eccf0549e7..a412a80a2e 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/BooleanSetting.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/BooleanSetting.kt @@ -16,6 +16,7 @@ enum class BooleanSetting(override val key: String) : AbstractBooleanSetting { RENDERER_USE_SPEED_LIMIT("use_speed_limit"), USE_CUSTOM_CPU_TICKS("use_custom_cpu_ticks"), SKIP_CPU_INNER_INVALIDATION("skip_cpu_inner_invalidation"), + ANTIFLICKER("antiflicker"), FIX_BLOOM_EFFECTS("fix_bloom_effects"), EMULATE_BGR565("emulate_bgr565"), RESCALE_HACK("rescale_hack"), diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt index 230390749e..f95c53720f 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt @@ -750,6 +750,13 @@ abstract class SettingsItem( descriptionId = R.string.skip_cpu_inner_invalidation_description ) ) + put( + SwitchSetting( + BooleanSetting.ANTIFLICKER, + titleId = R.string.antiflicker, + descriptionId = R.string.antiflicker_description + ) + ) put( SwitchSetting( BooleanSetting.FIX_BLOOM_EFFECTS, diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsFragmentPresenter.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsFragmentPresenter.kt index 4da218bfcc..92a4a19fcd 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsFragmentPresenter.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsFragmentPresenter.kt @@ -291,6 +291,7 @@ class SettingsFragmentPresenter( add(IntSetting.FAST_GPU_TIME.key) add(BooleanSetting.SKIP_CPU_INNER_INVALIDATION.key) + add(BooleanSetting.ANTIFLICKER.key) add(BooleanSetting.FIX_BLOOM_EFFECTS.key) add(BooleanSetting.EMULATE_BGR565.key) add(BooleanSetting.RESCALE_HACK.key) diff --git a/src/android/app/src/main/res/values/strings.xml b/src/android/app/src/main/res/values/strings.xml index 7372fa5e34..815660fe5c 100644 --- a/src/android/app/src/main/res/values/strings.xml +++ b/src/android/app/src/main/res/values/strings.xml @@ -509,6 +509,8 @@ Forces most games to run at their highest native resolution. Use 256 for maximal performance and 512 for maximal graphics fidelity. Skip CPU Inner Invalidation Skips certain CPU-side cache invalidations during memory updates, reducing CPU usage and improving it\'s performance. This may cause glitches or crashes on some games. + Anti-Flicker + Forces GPU fence callbacks to wait for submitted GPU work. Use with Fast GPU mode, to avoid flicker with lower performance impact. Fix Bloom Effects Reduces bloom blur in LA/EOW (Adreno A6XX - A7XX/ Turnip), removes bloom in Burnout. Warning: may cause graphical artifacts in other games. Emulate BGR565 diff --git a/src/common/settings.h b/src/common/settings.h index e8877fce1e..f38e95d5a4 100644 --- a/src/common/settings.h +++ b/src/common/settings.h @@ -545,6 +545,13 @@ struct Values { Specialization::Default, true, true}; + SwitchableSetting antiflicker{linkage, + false, + "antiflicker", + Category::RendererHacks, + Specialization::Default, + true, + true}; SwitchableSetting async_presentation{linkage, #ifdef ANDROID false, diff --git a/src/qt_common/config/shared_translation.cpp b/src/qt_common/config/shared_translation.cpp index 6b8f8e73b6..2429a2632f 100644 --- a/src/qt_common/config/shared_translation.cpp +++ b/src/qt_common/config/shared_translation.cpp @@ -193,6 +193,9 @@ std::unique_ptr InitializeTranslations(QObject* parent) { INSERT(Settings, skip_cpu_inner_invalidation, tr("Skip CPU Inner Invalidation"), tr("Skips certain cache invalidations during memory updates, reducing CPU usage and " "improving latency. This may cause soft-crashes.")); + INSERT(Settings, antiflicker, tr("Anti-Flicker"), + tr("Forces GPU fence callbacks to wait for submitted GPU work.\n" + "Use with Fast GPU mode, to avoid flicker with lower performance impact.")); INSERT(Settings, vsync_mode, tr("VSync Mode:"), tr("FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen " "refresh rate.\nFIFO Relaxed allows tearing as it recovers from a slow down.\n" diff --git a/src/video_core/fence_manager.h b/src/video_core/fence_manager.h index e4c4329e81..b9f5e1a9c0 100644 --- a/src/video_core/fence_manager.h +++ b/src/video_core/fence_manager.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project @@ -76,9 +76,9 @@ public: TryReleasePendingFences(); } const bool should_flush = ShouldFlush(); - const bool delay_fence = Settings::IsGPULevelHigh() || (Settings::IsGPULevelMedium() && should_flush); + const bool delay_fence = Settings::values.antiflicker.GetValue() || !Settings::IsGPULevelLow(); CommitAsyncFlushes(); - TFence new_fence = CreateFence(!should_flush); + TFence new_fence = CreateFence(!should_flush && !delay_fence); if constexpr (can_async_check) { guard.lock(); } From d761ecba8c3ce2a740d5a5b9d5e0b23a6e248e92 Mon Sep 17 00:00:00 2001 From: lost-chaos Date: Sat, 23 May 2026 15:31:23 +0200 Subject: [PATCH 4/5] [core/arm/nce] suppress unused variable warnings (#4002) Add `[[maybe_unused]]` to unused constants in the ARM NCE backend to suppress compiler warnings. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4002 Reviewed-by: Lizzie Reviewed-by: MaranBr --- src/core/arm/nce/arm_nce.cpp | 2 +- src/core/arm/nce/interpreter_visitor.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/arm/nce/arm_nce.cpp b/src/core/arm/nce/arm_nce.cpp index bbff9f2829..63d5638fce 100644 --- a/src/core/arm/nce/arm_nce.cpp +++ b/src/core/arm/nce/arm_nce.cpp @@ -388,7 +388,7 @@ void ArmNce::SignalInterrupt(Kernel::KThread* thread) { } } -const std::size_t CACHE_PAGE_SIZE = 4096; +[[maybe_unused]] const std::size_t CACHE_PAGE_SIZE = 4096; void ArmNce::ClearInstructionCache() { #ifdef __aarch64__ diff --git a/src/core/arm/nce/interpreter_visitor.cpp b/src/core/arm/nce/interpreter_visitor.cpp index ec2b155fe4..2ccc176323 100644 --- a/src/core/arm/nce/interpreter_visitor.cpp +++ b/src/core/arm/nce/interpreter_visitor.cpp @@ -12,9 +12,9 @@ namespace Core { namespace { // Prefetch tuning parameters -constexpr size_t CACHE_LINE_SIZE = 64; -constexpr size_t PREFETCH_STRIDE = 128; // 2 cache lines ahead -constexpr size_t SIMD_PREFETCH_THRESHOLD = 32; // Bytes +[[maybe_unused]] constexpr size_t CACHE_LINE_SIZE = 64; +[[maybe_unused]] constexpr size_t PREFETCH_STRIDE = 128; // 2 cache lines ahead +[[maybe_unused]] constexpr size_t SIMD_PREFETCH_THRESHOLD = 32; // Bytes } // namespace template From 90764401e1516455c522cd1e1257f3b357e39a9c Mon Sep 17 00:00:00 2001 From: xbzk Date: Fri, 22 May 2026 19:42:56 -0300 Subject: [PATCH 5/5] [fence_manager, ui] antiflicker fix + toggle integration --- .../yuzu_emu/features/settings/model/BooleanSetting.kt | 1 + .../yuzu_emu/features/settings/model/view/SettingsItem.kt | 7 +++++++ .../features/settings/ui/SettingsFragmentPresenter.kt | 1 + src/android/app/src/main/res/values/strings.xml | 2 ++ src/common/settings.h | 7 +++++++ src/qt_common/config/shared_translation.cpp | 3 +++ src/video_core/fence_manager.h | 6 +++--- 7 files changed, 24 insertions(+), 3 deletions(-) diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/BooleanSetting.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/BooleanSetting.kt index eccf0549e7..a412a80a2e 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/BooleanSetting.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/BooleanSetting.kt @@ -16,6 +16,7 @@ enum class BooleanSetting(override val key: String) : AbstractBooleanSetting { RENDERER_USE_SPEED_LIMIT("use_speed_limit"), USE_CUSTOM_CPU_TICKS("use_custom_cpu_ticks"), SKIP_CPU_INNER_INVALIDATION("skip_cpu_inner_invalidation"), + ANTIFLICKER("antiflicker"), FIX_BLOOM_EFFECTS("fix_bloom_effects"), EMULATE_BGR565("emulate_bgr565"), RESCALE_HACK("rescale_hack"), diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt index 230390749e..f95c53720f 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt @@ -750,6 +750,13 @@ abstract class SettingsItem( descriptionId = R.string.skip_cpu_inner_invalidation_description ) ) + put( + SwitchSetting( + BooleanSetting.ANTIFLICKER, + titleId = R.string.antiflicker, + descriptionId = R.string.antiflicker_description + ) + ) put( SwitchSetting( BooleanSetting.FIX_BLOOM_EFFECTS, diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsFragmentPresenter.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsFragmentPresenter.kt index 4da218bfcc..92a4a19fcd 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsFragmentPresenter.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsFragmentPresenter.kt @@ -291,6 +291,7 @@ class SettingsFragmentPresenter( add(IntSetting.FAST_GPU_TIME.key) add(BooleanSetting.SKIP_CPU_INNER_INVALIDATION.key) + add(BooleanSetting.ANTIFLICKER.key) add(BooleanSetting.FIX_BLOOM_EFFECTS.key) add(BooleanSetting.EMULATE_BGR565.key) add(BooleanSetting.RESCALE_HACK.key) diff --git a/src/android/app/src/main/res/values/strings.xml b/src/android/app/src/main/res/values/strings.xml index 7372fa5e34..815660fe5c 100644 --- a/src/android/app/src/main/res/values/strings.xml +++ b/src/android/app/src/main/res/values/strings.xml @@ -509,6 +509,8 @@ Forces most games to run at their highest native resolution. Use 256 for maximal performance and 512 for maximal graphics fidelity. Skip CPU Inner Invalidation Skips certain CPU-side cache invalidations during memory updates, reducing CPU usage and improving it\'s performance. This may cause glitches or crashes on some games. + Anti-Flicker + Forces GPU fence callbacks to wait for submitted GPU work. Use with Fast GPU mode, to avoid flicker with lower performance impact. Fix Bloom Effects Reduces bloom blur in LA/EOW (Adreno A6XX - A7XX/ Turnip), removes bloom in Burnout. Warning: may cause graphical artifacts in other games. Emulate BGR565 diff --git a/src/common/settings.h b/src/common/settings.h index e8877fce1e..f38e95d5a4 100644 --- a/src/common/settings.h +++ b/src/common/settings.h @@ -545,6 +545,13 @@ struct Values { Specialization::Default, true, true}; + SwitchableSetting antiflicker{linkage, + false, + "antiflicker", + Category::RendererHacks, + Specialization::Default, + true, + true}; SwitchableSetting async_presentation{linkage, #ifdef ANDROID false, diff --git a/src/qt_common/config/shared_translation.cpp b/src/qt_common/config/shared_translation.cpp index 6b8f8e73b6..2429a2632f 100644 --- a/src/qt_common/config/shared_translation.cpp +++ b/src/qt_common/config/shared_translation.cpp @@ -193,6 +193,9 @@ std::unique_ptr InitializeTranslations(QObject* parent) { INSERT(Settings, skip_cpu_inner_invalidation, tr("Skip CPU Inner Invalidation"), tr("Skips certain cache invalidations during memory updates, reducing CPU usage and " "improving latency. This may cause soft-crashes.")); + INSERT(Settings, antiflicker, tr("Anti-Flicker"), + tr("Forces GPU fence callbacks to wait for submitted GPU work.\n" + "Use with Fast GPU mode, to avoid flicker with lower performance impact.")); INSERT(Settings, vsync_mode, tr("VSync Mode:"), tr("FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen " "refresh rate.\nFIFO Relaxed allows tearing as it recovers from a slow down.\n" diff --git a/src/video_core/fence_manager.h b/src/video_core/fence_manager.h index e4c4329e81..b9f5e1a9c0 100644 --- a/src/video_core/fence_manager.h +++ b/src/video_core/fence_manager.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project @@ -76,9 +76,9 @@ public: TryReleasePendingFences(); } const bool should_flush = ShouldFlush(); - const bool delay_fence = Settings::IsGPULevelHigh() || (Settings::IsGPULevelMedium() && should_flush); + const bool delay_fence = Settings::values.antiflicker.GetValue() || !Settings::IsGPULevelLow(); CommitAsyncFlushes(); - TFence new_fence = CreateFence(!should_flush); + TFence new_fence = CreateFence(!should_flush && !delay_fence); if constexpr (can_async_check) { guard.lock(); }