Compare commits

..

4 Commits

Author SHA1 Message Date
lizzie 4feeade51a death^2 2026-09-12 23:38:11 +00:00
lizzie 255407a4b8 reduce vaddr u64->u32 2026-09-12 23:38:11 +00:00
lizzie b2fd37bb26 [core/arm/dynarmic] fix ICache invalidate on KPageTable
Signed-off-by: lizzie <lizzie@eden-emu.dev>
2026-09-12 23:38:11 +00:00
PavelBARABANOV 5d150cac5c [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 <lizzie@eden-emu.dev>
Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
2026-09-13 02:13:06 +02:00
9 changed files with 34 additions and 19 deletions
@@ -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 {
+4 -3
View File
@@ -42,7 +42,7 @@ u64 DynarmicCallbacks32::MemoryRead64(u32 vaddr) {
std::optional<u32> DynarmicCallbacks32::MemoryReadCode(u32 vaddr) {
if (!m_memory.IsValidVirtualAddressRange(vaddr, sizeof(u32)))
return std::nullopt;
auto const aligned_vaddr = vaddr & ~Core::Memory::YUZU_PAGEMASK;
auto const aligned_vaddr = vaddr & u32(~Core::Memory::YUZU_PAGEMASK);
if (last_code_addr != aligned_vaddr) {
m_memory.ReadBlock(aligned_vaddr, &cached_code_page, sizeof(cached_code_page));
last_code_addr = aligned_vaddr;
@@ -427,12 +427,13 @@ void ArmDynarmic32::SignalInterrupt(Kernel::KThread* thread) {
}
void ArmDynarmic32::ClearInstructionCache() {
m_cb->last_code_addr = u64(-1);
m_cb->last_code_addr = u32(-1);
m_jit->ClearCache();
}
void ArmDynarmic32::InvalidateCacheRange(u64 addr, std::size_t size) {
m_jit->InvalidateCacheRange(static_cast<u32>(addr), size);
m_cb->last_code_addr = u32(-1);
m_jit->InvalidateCacheRange(u32(addr), size);
}
} // namespace Core
+2 -2
View File
@@ -36,7 +36,7 @@ public:
u64 MemoryRead64(u32 vaddr) override;
std::optional<u32> MemoryReadCode(u32 vaddr) override;
void InstructionSynchronizationBarrierRaised() override {
last_code_addr = u64(-1); //reset back, force refetch
last_code_addr = u32(-1); //reset back, force refetch
}
void MemoryWrite8(u32 vaddr, u8 value) override;
void MemoryWrite16(u32 vaddr, u16 value) override;
@@ -54,7 +54,7 @@ public:
void ReturnException(u32 pc, Dynarmic::HaltReason hr);
//
Dynarmic::CodePage cached_code_page;
u64 last_code_addr = u64(-1);
u32 last_code_addr = u32(-1);
ArmDynarmic32& m_parent;
Core::Memory::Memory& m_memory;
Kernel::KProcess* m_process{};
+2 -1
View File
@@ -105,7 +105,7 @@ void DynarmicCallbacks64::InstructionCacheOperationRaised(Dynarmic::A64::Instruc
last_code_addr = u64(-1); //invalidate cached page
switch (op) {
case Dynarmic::A64::InstructionCacheOperation::InvalidateByVAToPoU: {
static constexpr u64 ICACHE_LINE_SIZE = 64;
constexpr u64 ICACHE_LINE_SIZE = 64;
const u64 cache_line_start = value & ~(ICACHE_LINE_SIZE - 1);
m_parent.InvalidateCacheRange(cache_line_start, ICACHE_LINE_SIZE);
break;
@@ -458,6 +458,7 @@ void ArmDynarmic64::ClearInstructionCache() {
}
void ArmDynarmic64::InvalidateCacheRange(u64 addr, std::size_t size) {
m_cb->last_code_addr = u64(-1);
m_jit->InvalidateCacheRange(addr, size);
}
@@ -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();
}
@@ -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
@@ -274,8 +274,8 @@ std::pair<oaknut::XReg, oaknut::XReg> 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) {
@@ -2850,6 +2850,8 @@ Sampler::VariantKey Sampler::MakeKey(const ImageView& image_view, bool is_depth)
VariantKey key{};
key.reduce_anisotropy = has_added_anisotropy && !image_view.SupportsAnisotropy();
key.force_nearest = has_linear_filtering && IsPixelFormatInteger(image_view.format);
key.drop_depth_comparison =
is_depth && has_depth_comparison && !image_view.SupportsDepthComparison();
key.drop_reduction = has_minmax_reduction && !image_view.SupportsMinmaxFilter();
key.drop_custom_border = has_custom_border_colors && image_view.RequiresBorderColorFormat();
key.srgb_border = has_srgb_border_color && IsPixelFormatSRGB(image_view.format);
@@ -2927,6 +2929,9 @@ VkSampler Sampler::Emplace(VariantKey key) {
create_info.anisotropyEnable = static_cast<VkBool32>(default_anisotropy > 1.0f);
create_info.maxAnisotropy = default_anisotropy;
}
if (key.drop_depth_comparison) {
create_info.compareEnable = VK_FALSE;
}
if (!custom_border) {
create_info.borderColor = ConvertBorderColor(color);
}
@@ -536,6 +536,7 @@ private:
struct VariantKey {
bool reduce_anisotropy;
bool force_nearest;
bool drop_depth_comparison;
bool drop_reduction;
bool drop_custom_border;
bool srgb_border;