Compare commits

..

4 Commits

Author SHA1 Message Date
PavelBARABANOV bc37f1a7d7 John patch 2026-10-26 10:37:15 +01:00
lizzie 46be0c27ac [hle] constexpr handler dispatch maps, introduce version gating (#4480)
This PR primarily focuses on upbringing constexpr maps for handlers.

Each time an HLE object of a service is construed, it registers it's own handlers, over and over.
Regardless of whetever it needs them at the moment or not.
Additionally we don't require to keep track of different function pointers amongst each object.
This can be done by overriding the given function instead, as opposed to having a separate
hash map for every given object.

In other words: Remove handlers (and handlers_tipc) map for every instance
then read from a static defined per-class.

- [x] Migrate all HLE functions to new `frozen::map` constexpr time finder
- [ ] Measure if this approach actually makes better codegen

Optional:
- [x] Properly gate all functions (that have versions commented next to them)
- [x] Maybe store `HandlerFnP<>` and `const char*` separately, version gating can go in a different map as well

Information such as name can be used on debug builds, but doesn't particularly help on release as one can consult an external reference (or have an annotated IPC map)

Signed-off-by: lizzie <lizzie@eden-emu.dev>

- [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.

-------------------

Co-authored-by: Maufeat <sahyno1996@gmail.com>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4480
Reviewed-by: Maufeat <sahyno1996@gmail.com>
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
2026-10-26 10:37:15 +01:00
PavelBARABANOV eb88a40a8e [qt] fix graphics API toggle getting stuck on OpenGL_GLSL (#4577)
- [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.

-------------------

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4577
Reviewed-by: crueter <crueter@eden-emu.dev>
Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
2026-10-25 16:06:46 +01:00
PavelBARABANOV 305f40100d Fix aarch and android builds (#4576)
- [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.

-------------------
credit: John and Crueter

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4576
Reviewed-by: crueter <crueter@eden-emu.dev>
2026-10-25 10:03:16 +01:00
5 changed files with 29 additions and 11 deletions
+1 -1
View File
@@ -259,7 +259,7 @@ android {
externalNativeBuild {
cmake {
version = "3.31.6"
version = "3.31.5"
path = file("${edenDir}/CMakeLists.txt")
}
}
+2 -2
View File
@@ -1,5 +1,5 @@
# SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later
// 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 */
+4 -3
View File
@@ -72,9 +72,10 @@ void ServiceFrameworkBase::ReportUnimplementedFunction(HLERequestContext& ctx, c
}
[[nodiscard]] static bool VersionGateCheck(Core::System& system, u32 vg) {
u32 const c_maj = FirmwareManager::GetFirmwareVersion(system).first.major;
u32 const c_min = FirmwareManager::GetFirmwareVersion(system).first.minor;
u32 const c_pat = FirmwareManager::GetFirmwareVersion(system).first.micro;
const auto fw = FirmwareManager::GetFirmwareVersion(system).first;
u32 const c_maj = fw.major;
u32 const c_min = fw.minor;
u32 const c_pat = fw.micro;
u32 const cg = (c_pat << 0) | (c_min << 4) | (c_maj << 8);
u32 const sg = (vg >> 16) & 0xffff;
u32 const ug = vg & 0xffff;
+19 -2
View File
@@ -4,6 +4,8 @@
#pragma once
#include "common/common_types.h"
#include <mutex>
#include "core/core.h"
#include "core/file_sys/nca_metadata.h"
#include "core/file_sys/content_archive.h"
@@ -95,13 +97,28 @@ FirmwareCheckResult VerifyFirmware(Core::System &system);
*/
inline std::pair<Service::Set::FirmwareVersionFormat, Result> GetFirmwareVersion(Core::System &system)
{
// The version cannot change while a session runs, and this is on the IPC dispatch path:
// looking it up per call costs a firmware data read with firmware installed, and a
// synthesized SystemVersion archive without one. Remember it.
static std::mutex cache_mutex;
static std::pair<Core::System*, std::pair<Service::Set::FirmwareVersionFormat, Result>> cache{};
{
std::scoped_lock lock{cache_mutex};
if (cache.first == &system) {
return cache.second;
}
}
Service::Set::FirmwareVersionFormat firmware_data{};
const auto result
= Service::Set::GetFirmwareVersionImpl(firmware_data,
system,
Service::Set::GetFirmwareVersionType::Version2);
return {firmware_data, result};
{
std::scoped_lock lock{cache_mutex};
cache = {&system, {firmware_data, result}};
return cache.second;
}
}
// TODO(crueter): GET AS STRING
+3 -3
View File
@@ -3661,12 +3661,12 @@ void MainWindow::OnToggleGraphicsAPI() {
api = Settings::RendererBackend::OpenGL_GLSL;
break;
case Settings::RendererBackend::OpenGL_GLSL:
api = Settings::RendererBackend::OpenGL_GLSL;
break;
case Settings::RendererBackend::OpenGL_SPIRV:
api = Settings::RendererBackend::OpenGL_GLASM;
break;
case Settings::RendererBackend::OpenGL_GLASM:
api = Settings::RendererBackend::OpenGL_SPIRV;
break;
case Settings::RendererBackend::OpenGL_SPIRV:
api = Settings::RendererBackend::Null;
break;
#else