aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaufeat <sahyno1996@gmail.com>2026-02-05 23:46:52 +0100
committercrueter <crueter@eden-emu.dev>2026-02-05 23:46:52 +0100
commit08232ce64275eaf388eba7005f4dae28fc18a0b7 (patch)
treeaf7a2c78386e0b8355cfc4b30c04a408229de270 /src
parentd536a6601016ea54792358e2df9c3f0ad8a526e7 (diff)
[core, am] stub SetGpuTimeSliceBoost & fix ExitProcessAndReturn (#3475)
A few things noticed on "Super Mario Allstars", this stubs SetGpuTimeSliceBoost and adds a fix for the "Return to title selection" menĂ¼. Basically ExitProcessAndReturn now starts/restarts the process on program_index 0 (main menu / title screen) and fixes a device memory clear when using that method. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3475 Reviewed-by: Lizzie <lizzie@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev> Co-authored-by: Maufeat <sahyno1996@gmail.com> Co-committed-by: Maufeat <sahyno1996@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/core/core.cpp4
-rw-r--r--src/core/hle/service/am/service/applet_common_functions.cpp9
-rw-r--r--src/core/hle/service/am/service/applet_common_functions.h3
-rw-r--r--src/core/hle/service/am/service/library_applet_self_accessor.cpp9
4 files changed, 20 insertions, 5 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp
index bada8ef2c1..50572ea449 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -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
#include <array>
@@ -142,6 +142,7 @@ struct System::Impl {
void ReinitializeIfNecessary(System& system) {
const bool must_reinitialize =
+ !device_memory.has_value() ||
is_multicore != Settings::values.use_multi_core.GetValue() ||
extended_memory_layout != (Settings::values.memory_layout_mode.GetValue() !=
Settings::MemoryLayout::Memory_4Gb);
@@ -414,6 +415,7 @@ struct System::Impl {
cpu_manager.Shutdown();
debugger.reset();
kernel.Shutdown();
+ device_memory.reset();
stop_event = {};
Network::RestartSocketOperations();
diff --git a/src/core/hle/service/am/service/applet_common_functions.cpp b/src/core/hle/service/am/service/applet_common_functions.cpp
index 2bfcd10d04..ee536221d9 100644
--- a/src/core/hle/service/am/service/applet_common_functions.cpp
+++ b/src/core/hle/service/am/service/applet_common_functions.cpp
@@ -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 2024 yuzu Emulator Project
@@ -36,7 +36,7 @@ IAppletCommonFunctions::IAppletCommonFunctions(Core::System& system_,
{100, nullptr, "SetApplicationCoreUsageMode"},
{300, D<&IAppletCommonFunctions::GetCurrentApplicationId>, "GetCurrentApplicationId"},
{310, nullptr, "IsSystemAppletHomeMenu"}, //19.0.0+
- {320, nullptr, "SetGpuTimeSliceBoost"}, //19.0.0+
+ {320, D<&IAppletCommonFunctions::SetGpuTimeSliceBoost>, "SetGpuTimeSliceBoost"}, //19.0.0+
{321, nullptr, "SetGpuTimeSliceBoostDueToApplication"}, //19.0.0+
{350, D<&IAppletCommonFunctions::Unknown350>, "Unknown350"} //20.0.0+
};
@@ -82,6 +82,11 @@ Result IAppletCommonFunctions::GetCurrentApplicationId(Out<u64> out_application_
R_SUCCEED();
}
+Result IAppletCommonFunctions::SetGpuTimeSliceBoost(s64 time_span) {
+ LOG_WARNING(Service_AM, "(STUBBED) called, time_span={}", time_span);
+ R_SUCCEED();
+}
+
Result IAppletCommonFunctions::Unknown350(Out<u16> out_unknown) {
LOG_WARNING(Service_AM, "(STUBBED) called");
*out_unknown = 0;
diff --git a/src/core/hle/service/am/service/applet_common_functions.h b/src/core/hle/service/am/service/applet_common_functions.h
index be867f00e7..696fcd5bd1 100644
--- a/src/core/hle/service/am/service/applet_common_functions.h
+++ b/src/core/hle/service/am/service/applet_common_functions.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 2024 yuzu Emulator Project
@@ -24,6 +24,7 @@ private:
Result SetDisplayMagnification(f32 x, f32 y, f32 width, f32 height);
Result SetCpuBoostRequestPriority(s32 priority);
Result GetCurrentApplicationId(Out<u64> out_application_id);
+ Result SetGpuTimeSliceBoost(s64 time_span);
Result Unknown350(Out<u16> out_unknown);
const std::shared_ptr<Applet> applet;
diff --git a/src/core/hle/service/am/service/library_applet_self_accessor.cpp b/src/core/hle/service/am/service/library_applet_self_accessor.cpp
index 0f71f24b0b..0335ae5be6 100644
--- a/src/core/hle/service/am/service/library_applet_self_accessor.cpp
+++ b/src/core/hle/service/am/service/library_applet_self_accessor.cpp
@@ -179,7 +179,14 @@ Result ILibraryAppletSelfAccessor::GetMainAppletStorageId(Out<FileSys::StorageId
Result ILibraryAppletSelfAccessor::ExitProcessAndReturn() {
LOG_INFO(Service_AM, "called");
- m_applet->process->Terminate();
+
+ if (const auto caller_applet = m_applet->caller_applet.lock(); caller_applet) {
+ system.GetUserChannel() = caller_applet->user_channel_launch_parameter;
+ } else {
+ system.GetUserChannel() = m_applet->user_channel_launch_parameter;
+ }
+
+ system.ExecuteProgram(0);
R_SUCCEED();
}