From 5d150cac5c6624fa6a0e94266846b75d91a6a5d0 Mon Sep 17 00:00:00 2001 From: PavelBARABANOV Date: Sun, 13 Sep 2026 02:13:06 +0200 Subject: [PATCH] [dynarmic, am, android, ns] Fixes the latest qlaunch regressions on Android and adds cmd23 for launching games on FW 23 (#4407) - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- [dynarmic] use TST + B.NE instead of TBNZ for marked bit Fixes qlaunch and ac3 crashes. [am] Bruno FIX OVERLAY 2.0 Fixes incorrect load display when the overlay applet is enabled in AC3. [android] handle empty programId in Game.settingsName The ReShade post-processing change started calling SettingsFile.loadCustomConfig() on every drawer open through withPerGameConfig(), which exposed a pre-existing crash in Game.settingsName when programId was an empty string. [ns] use GetApplicationControlData3 for cmd23 in IReadOnlyApplicationControlDataInterface We can use this method for now for launching games on fw23, while we don't have all the information. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4407 Reviewed-by: lizzie Reviewed-by: CamilleLaVey --- .../main/java/org/yuzu/yuzu_emu/model/Game.kt | 6 ++--- .../hle/service/am/display_layer_manager.cpp | 22 ++++++++++++------- ...nly_application_control_data_interface.cpp | 1 + .../backend/arm64/emit_arm64_memory.cpp | 4 ++-- 4 files changed, 20 insertions(+), 13 deletions(-) diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/model/Game.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/model/Game.kt index 799708dfa7..6717894c93 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/model/Game.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/model/Game.kt @@ -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: 2023 yuzu Emulator Project @@ -37,7 +37,7 @@ class Game( val settingsName: String get() { - val programIdLong = programId.toLong() + val programIdLong = programId.toLongOrNull() ?: 0L return if (programIdLong == 0L) { FileUtil.getFilename(Uri.parse(path)) } else { @@ -47,7 +47,7 @@ class Game( val programIdHex: String get() { - val programIdLong = programId.toLong() + val programIdLong = programId.toLongOrNull() ?: 0L return if (programIdLong == 0L) { "0" } else { diff --git a/src/core/hle/service/am/display_layer_manager.cpp b/src/core/hle/service/am/display_layer_manager.cpp index 494e8a132b..cd9e26e899 100644 --- a/src/core/hle/service/am/display_layer_manager.cpp +++ b/src/core/hle/service/am/display_layer_manager.cpp @@ -73,16 +73,20 @@ Result DisplayLayerManager::CreateManagedDisplayLayer(u64* out_layer_id) { R_TRY(m_manager_display_service->CreateManagedLayer( out_layer_id, 0, display_id, Service::AppletResourceUserId{m_process->GetProcessId()})); + m_manager_display_service->SetLayerVisibility(m_visible, *out_layer_id); + (void)m_display_service->GetContainer()->SetLayerStackMask(*out_layer_id, + this->GetLayerStackMask()); + if (m_applet_id != AppletId::Application) { (void)m_manager_display_service->SetLayerBlending(m_blending_enabled, *out_layer_id); if (m_applet_id == AppletId::OverlayDisplay) { - (void)m_manager_display_service->SetLayerZIndex(-1, *out_layer_id); - (void)m_display_service->GetContainer()->SetLayerIsOverlay(*out_layer_id, true); + (void)m_manager_display_service->SetLayerZIndex(Overlay, *out_layer_id); } else { - (void)m_manager_display_service->SetLayerZIndex(1, *out_layer_id); + (void)m_manager_display_service->SetLayerZIndex(Foreground, *out_layer_id); } } - (void)m_display_service->GetContainer()->SetLayerZIndex(*out_layer_id, true); + + m_display_service->GetContainer()->SetLayerZIndex(*out_layer_id, true); m_managed_display_layers.emplace(*out_layer_id); R_SUCCEED(); @@ -122,14 +126,16 @@ Result DisplayLayerManager::IsSystemBufferSharingEnabled() { // Ensure the overlay layer is visible m_manager_display_service->SetLayerVisibility(m_visible, m_system_shared_layer_id); - m_manager_display_service->SetLayerBlending(m_blending_enabled, m_system_shared_layer_id); - s32 initial_z = 1; - (void)m_display_service->GetContainer()->SetLayerZIndex(m_system_shared_layer_id, true); + (void)m_manager_display_service->SetLayerBlending(m_blending_enabled, m_system_shared_layer_id); + s32 initial_z = Foreground; if (m_applet_id == AppletId::OverlayDisplay) { - initial_z = -1; + initial_z = Overlay; + (void)m_manager_display_service->SetLayerZIndex(initial_z, m_system_shared_layer_id); (void)m_display_service->GetContainer()->SetLayerIsOverlay(m_system_shared_layer_id, true); } m_manager_display_service->SetLayerZIndex(initial_z, m_system_shared_layer_id); + m_display_service->GetContainer()->SetLayerZIndex(m_system_shared_layer_id, true); + m_managed_display_layers.emplace(m_system_shared_layer_id); R_SUCCEED(); } diff --git a/src/core/hle/service/ns/read_only_application_control_data_interface.cpp b/src/core/hle/service/ns/read_only_application_control_data_interface.cpp index c7606a83bf..fb3b627585 100644 --- a/src/core/hle/service/ns/read_only_application_control_data_interface.cpp +++ b/src/core/hle/service/ns/read_only_application_control_data_interface.cpp @@ -142,6 +142,7 @@ IReadOnlyApplicationControlDataInterface::IReadOnlyApplicationControlDataInterfa {10, &IReadOnlyApplicationControlDataInterface::ListApplicationIcon, "ListApplicationIcon"}, {13, &IReadOnlyApplicationControlDataInterface::ListApplicationTitle, "ListApplicationTitle"}, {19, D<&IReadOnlyApplicationControlDataInterface::GetApplicationControlData3>, "GetApplicationControlData"}, + {23, D<&IReadOnlyApplicationControlDataInterface::GetApplicationControlData3>, "GetApplicationControlData"}, }; // clang-format on diff --git a/src/dynarmic/src/dynarmic/backend/arm64/emit_arm64_memory.cpp b/src/dynarmic/src/dynarmic/backend/arm64/emit_arm64_memory.cpp index 1f758a190a..170fcf9613 100644 --- a/src/dynarmic/src/dynarmic/backend/arm64/emit_arm64_memory.cpp +++ b/src/dynarmic/src/dynarmic/backend/arm64/emit_arm64_memory.cpp @@ -274,8 +274,8 @@ std::pair InlinePageTableEmitVAddrLookup(oaknut::Cod code.LDR(Xscratch0, Xpagetable, Xscratch0); if (ctx.conf.page_table_marked_bit) { - // check for marked bit - code.TBNZ(Xscratch0, *ctx.conf.page_table_marked_bit, *fallback); + code.TST(Xscratch0, 1ULL << *ctx.conf.page_table_marked_bit); + code.B(NE, *fallback); } if (ctx.conf.page_table_pointer_mask != 0) {