aboutsummaryrefslogtreecommitdiff
path: root/src/core/core.cpp
diff options
context:
space:
mode:
authorBriar <205427297+icy-briar@users.noreply.github.com>2025-04-09 23:44:33 +0200
committerGitHub <noreply@github.com>2025-04-09 23:44:33 +0200
commit077592903e3a4204fb81655d2af0a8a69bd7f5e8 (patch)
tree08da955b056d1144255fa16f016ccc8a36feea99 /src/core/core.cpp
parent8ef4da686cad5476a497a30e6325b908c54fb0fb (diff)
core: Add support for game settings overrides (#6)
* core: Add support for game settings overrides --------- Co-authored-by: Gamer64 <76565986+Gamer64ytb@users.noreply.github.com> Co-authored-by: zhang wei <zwdreams@gmail.com>
Diffstat (limited to 'src/core/core.cpp')
-rw-r--r--src/core/core.cpp44
1 files changed, 42 insertions, 2 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp
index 0cb81d6d8f..61b8182c08 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -1,5 +1,5 @@
-// SPDX-FileCopyrightText: 2014 Citra Emulator Project
-// SPDX-License-Identifier: GPL-2.0-or-later
+// SPDX-FileCopyrightText: Copyright yuzu/Citra Emulator Project / Eden Emulator Project
+// SPDX-License-Identifier: GPL-3.0-or-later
#include <array>
#include <atomic>
@@ -114,6 +114,8 @@ struct System::Impl {
: kernel{system}, fs_controller{system}, hid_core{}, room_network{}, cpu_manager{system},
reporter{system}, applet_manager{system}, frontend_applets{system}, profile_manager{} {}
+ u64 program_id;
+
void Initialize(System& system) {
device_memory = std::make_unique<Core::DeviceMemory>();
@@ -301,6 +303,38 @@ struct System::Impl {
return SystemResultStatus::Success;
}
+
+ void LoadOverrides(u64 programId) const {
+ std::string vendor = gpu_core->Renderer().GetDeviceVendor();
+ LOG_INFO(Core, "GPU Vendor: {}", vendor);
+
+ // Insert PC overrides here
+
+ #ifdef ANDROID
+ // Example on how to set a setting based on the program ID and vendor
+ if (programId == 0x010028600EBDA000 && vendor == "Mali") { // Mario 3d World
+ // Settings::values.example = true;
+ }
+
+ // Example array of program IDs
+ const std::array<u64, 10> example_array = {
+ //0xprogramId
+ 0x0004000000033400, // Game 1
+ 0x0004000000033500 // Game 2
+ // And so on
+ };
+
+ for (auto id : example_array) {
+ if (programId == id) {
+ // Settings::values.example = true;
+ break;
+ }
+ }
+
+ #endif
+
+ }
+
SystemResultStatus Load(System& system, Frontend::EmuWindow& emu_window,
const std::string& filepath,
Service::AM::FrontendAppletParameters& params) {
@@ -381,6 +415,12 @@ struct System::Impl {
if (metadata.first != nullptr) {
title_version = metadata.first->GetVersionString();
}
+
+ if (app_loader->ReadProgramId(program_id) != Loader::ResultStatus::Success) {
+ LOG_ERROR(Core, "Failed to find program id for ROM");
+ }
+
+ LoadOverrides(program_id);
if (auto room_member = room_network.GetRoomMember().lock()) {
Network::GameInfo game_info;
game_info.name = name;