[hle/ui] Add cmds and fix invalid handle return, remove Starter applet from UI (#3376)

This fixes qlaunch "+ Options" :)

More:
- Remove Starter-Applet from menu (Starter is started by qlaunch)
- Stub OLSC cmds and add IStopperObject
- Fail-safe invalid handle return for system applets
- Stub IHomeMenuFunctions::IsSleepEnabled (closes qlaunch now when hitting sleep)
- Lower BuiltInNews timeout from 10s to 2s
- Use proper Event instead of KEvent in npns

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3376
Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
Co-authored-by: Maufeat <sahyno1996@gmail.com>
Co-committed-by: Maufeat <sahyno1996@gmail.com>
This commit is contained in:
Maufeat
2026-01-24 14:15:08 +01:00
committed by crueter
parent 29fad5a89e
commit ddbb6f2219
20 changed files with 210 additions and 62 deletions
@@ -21,7 +21,7 @@ IDaemonController::IDaemonController(Core::System& system_)
{5, D<&IDaemonController::GetGlobalAutoDownloadSetting>, "GetGlobalAutoDownloadSetting"}, // 11.0.0+
{6, D<&IDaemonController::SetGlobalAutoDownloadSetting>, "SetGlobalAutoDownloadSetting"}, // 11.0.0+
{10, nullptr, "CreateForbiddenSaveDataInidication"},
{11, nullptr, "StopAutonomyTaskExecution"},
{11, D<&IDaemonController::StopAutonomyTaskExecution>, "StopAutonomyTaskExecution"},
{12, D<&IDaemonController::GetAutonomyTaskStatus>, "GetAutonomyTaskStatus"},
{13, nullptr, "Unknown13_20_0_0_Plus"}, // 20.0.0+
};
@@ -92,6 +92,13 @@ Result IDaemonController::SetGlobalAutoDownloadSetting(bool is_enabled, Common::
R_SUCCEED();
}
Result IDaemonController::StopAutonomyTaskExecution(Out<SharedPointer<IStopperObject>> out_stopper) {
LOG_WARNING(Service_OLSC, "(STUBBED) called");
*out_stopper = std::make_shared<IStopperObject>(system);
R_SUCCEED();
}
Result IDaemonController::GetAutonomyTaskStatus(Out<u8> out_status, Common::UUID user_id) {
LOG_INFO(Service_OLSC, "called, user_id={}", user_id.FormattedString());
@@ -1,4 +1,3 @@
#pragma once
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
@@ -9,6 +8,7 @@
#include "common/uuid.h"
#include "core/hle/service/cmif_types.h"
#include "core/hle/service/olsc/stopper_object.h"
#include "core/hle/service/service.h"
namespace Service::OLSC {
@@ -32,6 +32,8 @@ private:
Result GetGlobalAutoDownloadSetting(Out<bool> out_is_enabled, Common::UUID user_id);
Result SetGlobalAutoDownloadSetting(bool is_enabled, Common::UUID user_id);
Result StopAutonomyTaskExecution(Out<SharedPointer<IStopperObject>> out_stopper);
Result GetAutonomyTaskStatus(Out<u8> out_status, Common::UUID user_id);
// Internal in-memory state to back the above APIs
@@ -1,13 +1,20 @@
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include "core/hle/service/cmif_serialization.h"
#include "core/hle/service/olsc/native_handle_holder.h"
#include "core/hle/kernel/k_event.h"
#include "core/hle/kernel/k_readable_event.h"
namespace Service::OLSC {
INativeHandleHolder::INativeHandleHolder(Core::System& system_)
: ServiceFramework{system_, "INativeHandleHolder"} {
: ServiceFramework{system_, "INativeHandleHolder"}, service_context{system_, "OLSC"} {
event = service_context.CreateEvent("OLSC::INativeHandleHolder");
// clang-format off
static const FunctionInfo functions[] = {
{0, D<&INativeHandleHolder::GetNativeHandle>, "GetNativeHandle"},
@@ -17,11 +24,19 @@ INativeHandleHolder::INativeHandleHolder(Core::System& system_)
RegisterHandlers(functions);
}
INativeHandleHolder::~INativeHandleHolder() = default;
INativeHandleHolder::~INativeHandleHolder() {
service_context.CloseEvent(event);
event = nullptr;
}
Result INativeHandleHolder::GetNativeHandle(OutCopyHandle<Kernel::KReadableEvent> out_event) {
LOG_WARNING(Service_OLSC, "(STUBBED) called");
*out_event = nullptr;
if (event) {
event->Signal();
*out_event = std::addressof(event->GetReadableEvent());
} else {
*out_event = nullptr;
}
R_SUCCEED();
}
@@ -1,11 +1,17 @@
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include "core/hle/service/cmif_types.h"
#include "core/hle/service/service.h"
#include "core/hle/service/kernel_helpers.h"
namespace Kernel {
class KReadableEvent;
class KEvent;
}
namespace Service::OLSC {
@@ -17,6 +23,9 @@ public:
private:
Result GetNativeHandle(OutCopyHandle<Kernel::KReadableEvent> out_event);
Service::KernelHelpers::ServiceContext service_context;
Kernel::KEvent* event{};
};
} // namespace Service::OLSC
@@ -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
@@ -28,7 +28,7 @@ IOlscServiceForSystemService::IOlscServiceForSystemService(Core::System& system_
{102, nullptr, "RemoveLastErrorInfoOld"},
{103, nullptr, "GetLastErrorInfo"},
{104, nullptr, "GetLastErrorEventHolder"},
{105, nullptr, "GetLastTransferTaskErrorInfo"},
{105, D<&IOlscServiceForSystemService::GetTransferTaskErrorInfo>, "GetTransferTaskErrorInfo"},
{200, D<&IOlscServiceForSystemService::GetDataTransferPolicy>, "GetDataTransferPolicy"},
{201, nullptr, "DeleteDataTransferPolicyCache"},
{202, nullptr, "Unknown202"},
@@ -116,6 +116,24 @@ Result IOlscServiceForSystemService::GetDataTransferPolicy(
R_SUCCEED();
}
Result IOlscServiceForSystemService::GetTransferTaskErrorInfo(Out<TransferTaskErrorInfo> out_info,
Common::UUID uuid, u64 application_id) {
LOG_WARNING(Service_OLSC, "(STUBBED) called, uuid={} application_id={:016X}",
uuid.FormattedString(), application_id);
TransferTaskErrorInfo info{};
info.uid = uuid;
info.application_id = application_id;
info.unknown_0x18 = 0;
info.reserved_0x19.fill(0);
info.unknown_0x20 = 0;
info.error_code = 0;
info.reserved_0x2C = 0;
*out_info = info;
R_SUCCEED();
}
Result IOlscServiceForSystemService::GetOlscServiceForSystemService(
Out<SharedPointer<IOlscServiceForSystemService>> out_interface) {
LOG_INFO(Service_OLSC, "called");
@@ -1,9 +1,12 @@
// 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
// SPDX-License-Identifier: GPL-2.0-or-later
#include <array>
#include "common/uuid.h"
#include "core/hle/service/cmif_types.h"
#include "core/hle/service/service.h"
@@ -18,6 +21,17 @@ struct DataTransferPolicy {
u8 download_policy;
};
struct TransferTaskErrorInfo {
Common::UUID uid;
u64 application_id;
u8 unknown_0x18;
std::array<u8, 7> reserved_0x19;
u64 unknown_0x20;
u32 error_code;
u32 reserved_0x2C;
};
static_assert(sizeof(TransferTaskErrorInfo) == 0x30, "TransferTaskErrorInfo has incorrect size.");
class IOlscServiceForSystemService final : public ServiceFramework<IOlscServiceForSystemService> {
public:
explicit IOlscServiceForSystemService(Core::System& system_);
@@ -29,7 +43,9 @@ private:
Result GetRemoteStorageController(Out<SharedPointer<IRemoteStorageController>> out_interface);
Result GetDaemonController(Out<SharedPointer<IDaemonController>> out_interface);
Result GetDataTransferPolicy(Out<DataTransferPolicy> out_policy, u64 application_id);
Result GetOlscServiceForSystemService(Out<SharedPointer<IOlscServiceForSystemService>> out_interface);
Result GetTransferTaskErrorInfo(Out<TransferTaskErrorInfo> out_info, Common::UUID uid, u64 application_id);
Result GetOlscServiceForSystemService(
Out<SharedPointer<IOlscServiceForSystemService>> out_interface);
};
} // namespace Service::OLSC
@@ -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,7 +24,7 @@ IRemoteStorageController::IRemoteStorageController(Core::System& system_)
{11, nullptr, "CreateDeleteDataTask"},
{12, nullptr, "DeleteSeriesInfo"},
{13, nullptr, "CreateRegisterNotificationTokenTask"},
{14, nullptr, "UpdateSeriesInfo"},
{14, D<&IRemoteStorageController::GetDataNewnessByApplicationId>, "GetDataNewnessByApplicationId"},
{15, nullptr, "RegisterUploadSaveDataTransferTaskForAutonomyRegistration"},
{16, nullptr, "CreateCleanupToDeleteSaveDataArchiveInfoTask"},
{17, nullptr, "ListDataInfo"},
@@ -37,7 +37,7 @@ IRemoteStorageController::IRemoteStorageController(Core::System& system_)
{24, nullptr, "GetSecondarySaveDataInfo"},
{25, nullptr, "RegisterDownloadSaveDataTransferTaskForAutonomyRegistration"},
{26, nullptr, "Unknown26"}, //20.0.0+
{27, nullptr, "Unknown27"}, //20.0.0+
{27, D<&IRemoteStorageController::Unknown27>, "Unknown27"}, //20.0.0+
{28, nullptr, "Unknown28"}, //20.0.0+
{29, nullptr, "Unknown29"}, //21.0.0+
{800, nullptr, "Unknown800"}, //20.0.0+
@@ -60,4 +60,17 @@ Result IRemoteStorageController::GetSecondarySave(Out<bool> out_has_secondary_sa
R_SUCCEED();
}
Result IRemoteStorageController::GetDataNewnessByApplicationId(Out<u8> out_newness,
u64 application_id) {
LOG_WARNING(Service_OLSC, "(STUBBED) called, application_id={:016X}", application_id);
*out_newness = 0;
R_SUCCEED();
}
Result IRemoteStorageController::Unknown27(Out<std::array<u8, 0x38>> out_data, u64 application_id) {
LOG_WARNING(Service_OLSC, "(STUBBED) called, application_id={:016X}", application_id);
out_data->fill(0);
R_SUCCEED();
}
} // namespace Service::OLSC
@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@@ -14,6 +17,8 @@ public:
private:
Result GetSecondarySave(Out<bool> out_has_secondary_save, Out<std::array<u64, 3>> out_unknown,
u64 application_id);
Result GetDataNewnessByApplicationId(Out<u8> out_newness, u64 application_id);
Result Unknown27(Out<std::array<u8, 0x38>> out_data, u64 application_id);
};
} // namespace Service::OLSC
@@ -0,0 +1,15 @@
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
#include "core/hle/service/cmif_serialization.h"
#include "core/hle/service/olsc/stopper_object.h"
namespace Service::OLSC {
IStopperObject::IStopperObject(Core::System& system_) : ServiceFramework{system_, "IStopperObject"} {
// TODO(Maufeat): If ever needed, add cmds
}
IStopperObject::~IStopperObject() = default;
} // namespace Service::OLSC
@@ -0,0 +1,17 @@
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
#pragma once
#include "core/hle/service/cmif_types.h"
#include "core/hle/service/service.h"
namespace Service::OLSC {
class IStopperObject final : public ServiceFramework<IStopperObject> {
public:
explicit IStopperObject(Core::System& system_);
~IStopperObject() override;
};
} // namespace Service::OLSC
@@ -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
@@ -6,6 +6,7 @@
#include "core/hle/service/cmif_serialization.h"
#include "core/hle/service/olsc/native_handle_holder.h"
#include "core/hle/service/olsc/stopper_object.h"
#include "core/hle/service/olsc/transfer_task_list_controller.h"
namespace Service::OLSC {
@@ -22,7 +23,7 @@ ITransferTaskListController::ITransferTaskListController(Core::System& system_)
{5, D<&ITransferTaskListController::GetTransferTaskEndEventNativeHandleHolder>, "GetTransferTaskEndEventNativeHandleHolder"},
{6, nullptr, "GetTransferTaskProgressForOcean"},
{7, nullptr, "GetTransferTaskLastResultForOcean"},
{8, nullptr, "StopNextTransferTaskExecution"},
{8, D<&ITransferTaskListController::StopNextTransferTaskExecution>, "StopNextTransferTaskExecution"},
{9, D<&ITransferTaskListController::GetTransferTaskStartEventNativeHandleHolder>, "GetTransferTaskStartEventNativeHandleHolder"},
{10, nullptr, "SuspendTransferTaskForOcean"},
{11, nullptr, "GetCurrentTransferTaskInfoForOcean"},
@@ -30,7 +31,7 @@ ITransferTaskListController::ITransferTaskListController(Core::System& system_)
{13, nullptr, "CancelCurrentRepairTransferTask"},
{14, nullptr, "GetRepairTransferTaskProgress"},
{15, nullptr, "EnsureExecutableForRepairTransferTask"},
{16, nullptr, "GetTransferTaskCount"},
{16, D<&ITransferTaskListController::GetTransferTaskCount>, "GetTransferTaskCount"},
{17, nullptr, "GetTransferTaskInfo"},
{18, nullptr, "ListTransferTaskInfo"},
{19, nullptr, "DeleteTransferTask"},
@@ -38,8 +39,8 @@ ITransferTaskListController::ITransferTaskListController(Core::System& system_)
{21, nullptr, "GetTransferTaskProgress"},
{22, nullptr, "GetTransferTaskLastResult"},
{23, nullptr, "SuspendTransferTask"},
{24, nullptr, "GetCurrentTransferTaskInfo"},
{25, nullptr, "Unknown25"}, //20.1.0+
{24, D<&ITransferTaskListController::GetCurrentTransferTaskInfo>, "GetCurrentTransferTaskInfo"},
{25, D<&ITransferTaskListController::FindTransferTaskInfo>, "FindTransferTaskInfo"},
{26, nullptr, "Unknown26"}, //20.1.0+
{27, nullptr, "Unknown27"}, //20.1.0+
{28, nullptr, "Unknown28"}, //20.1.0+
@@ -60,6 +61,13 @@ Result ITransferTaskListController::GetTransferTaskEndEventNativeHandleHolder(
R_SUCCEED();
}
Result ITransferTaskListController::StopNextTransferTaskExecution(
Out<SharedPointer<IStopperObject>> out_stopper) {
LOG_WARNING(Service_OLSC, "(STUBBED) called");
*out_stopper = std::make_shared<IStopperObject>(system);
R_SUCCEED();
}
Result ITransferTaskListController::GetTransferTaskStartEventNativeHandleHolder(
Out<SharedPointer<INativeHandleHolder>> out_holder) {
LOG_WARNING(Service_OLSC, "(STUBBED) called");
@@ -67,4 +75,24 @@ Result ITransferTaskListController::GetTransferTaskStartEventNativeHandleHolder(
R_SUCCEED();
}
Result ITransferTaskListController::GetCurrentTransferTaskInfo(Out<std::array<u8, 0x30>> out_info,
u8 unknown) {
LOG_WARNING(Service_OLSC, "(STUBBED) called, unknown={:#x}", unknown);
out_info->fill(0);
R_SUCCEED();
}
Result ITransferTaskListController::FindTransferTaskInfo(Out<std::array<u8, 0x30>> out_info,
InBuffer<BufferAttr_HipcAutoSelect> in) {
LOG_WARNING(Service_OLSC, "(STUBBED) called, in_size={}", in.size());
out_info->fill(0);
R_SUCCEED();
}
Result ITransferTaskListController::GetTransferTaskCount(Out<u32> out_count, u8 unknown) {
LOG_WARNING(Service_OLSC, "(STUBBED) called, unknown={:#x}", unknown);
*out_count = 0;
R_SUCCEED();
}
} // namespace Service::OLSC
@@ -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
@@ -10,6 +10,7 @@
namespace Service::OLSC {
class INativeHandleHolder;
class IStopperObject;
class ITransferTaskListController final : public ServiceFramework<ITransferTaskListController> {
public:
@@ -19,6 +20,10 @@ public:
private:
Result GetTransferTaskEndEventNativeHandleHolder(Out<SharedPointer<INativeHandleHolder>> out_holder);
Result GetTransferTaskStartEventNativeHandleHolder(Out<SharedPointer<INativeHandleHolder>> out_holder);
Result StopNextTransferTaskExecution(Out<SharedPointer<IStopperObject>> out_stopper);
Result GetTransferTaskCount(Out<u32> out_count, u8 unknown);
Result GetCurrentTransferTaskInfo(Out<std::array<u8, 0x30>> out_info, u8 unknown);
Result FindTransferTaskInfo(Out<std::array<u8, 0x30>> out_info, InBuffer<BufferAttr_HipcAutoSelect> in);
};
} // namespace Service::OLSC