mirror of
https://git.eden-emu.dev/archive/citron
synced 2026-03-23 01:56:08 -04:00
feat(hle/am): add event handling for state controllers
- Implement GetGpuErrorDetectedSystemEvent (cmd 1020) - Implement GetFriendInvitationStorageChannelEvent (cmd 1030) - Implement GetNotificationStorageChannelEvent (cmd 1040) - Implement GetHealthWarningDisappearedSystemEvent (cmd 1050) - Implement GetAccumulatedSuspendedTickChangedEvent (cmd 63)
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||||
// SPDX-FileCopyrightText: Copyright 2025 citron Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2026 citron Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
#include "common/settings.h"
|
#include "common/settings.h"
|
||||||
@@ -82,13 +82,13 @@ ICommonStateGetter::ICommonStateGetter(Core::System& system_, std::shared_ptr<Ap
|
|||||||
{1001, nullptr, "GetScreenShotPermission"},
|
{1001, nullptr, "GetScreenShotPermission"},
|
||||||
{1010, nullptr, "GetNextProgramArgumentInfo"},
|
{1010, nullptr, "GetNextProgramArgumentInfo"},
|
||||||
{1011, nullptr, "GetPreviousProgramArgumentInfo"},
|
{1011, nullptr, "GetPreviousProgramArgumentInfo"},
|
||||||
{1020, nullptr, "GetGpuErrorDetectedSystemEvent"},
|
{1020, D<&ICommonStateGetter::GetGpuErrorDetectedSystemEvent>, "GetGpuErrorDetectedSystemEvent"},
|
||||||
{1021, nullptr, "SetDelayTimeToAbortOnGpuError"},
|
{1021, nullptr, "SetDelayTimeToAbortOnGpuError"},
|
||||||
{1030, nullptr, "GetFriendInvitationStorageChannelEvent"},
|
{1030, D<&ICommonStateGetter::GetFriendInvitationStorageChannelEvent>, "GetFriendInvitationStorageChannelEvent"},
|
||||||
{1031, nullptr, "TryPopFromFriendInvitationStorageChannel"},
|
{1031, nullptr, "TryPopFromFriendInvitationStorageChannel"},
|
||||||
{1040, nullptr, "GetNotificationStorageChannelEvent"},
|
{1040, D<&ICommonStateGetter::GetNotificationStorageChannelEvent>, "GetNotificationStorageChannelEvent"},
|
||||||
{1041, nullptr, "TryPopFromNotificationStorageChannel"},
|
{1041, nullptr, "TryPopFromNotificationStorageChannel"},
|
||||||
{1050, nullptr, "GetHealthWarningDisappearedSystemEvent"},
|
{1050, D<&ICommonStateGetter::GetHealthWarningDisappearedSystemEvent>, "GetHealthWarningDisappearedSystemEvent"},
|
||||||
{1060, nullptr, "SetHdcpAuthenticationActivated"},
|
{1060, nullptr, "SetHdcpAuthenticationActivated"},
|
||||||
{1061, nullptr, "GetLastForegroundCaptureImageEx"},
|
{1061, nullptr, "GetLastForegroundCaptureImageEx"},
|
||||||
{1062, nullptr, "GetLastApplicationCaptureImageEx"},
|
{1062, nullptr, "GetLastApplicationCaptureImageEx"},
|
||||||
@@ -297,4 +297,32 @@ Result ICommonStateGetter::SetRequestExitToLibraryAppletAtExecuteNextProgramEnab
|
|||||||
R_SUCCEED();
|
R_SUCCEED();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Result ICommonStateGetter::GetGpuErrorDetectedSystemEvent(
|
||||||
|
OutCopyHandle<Kernel::KReadableEvent> out_event) {
|
||||||
|
LOG_DEBUG(Service_AM, "called");
|
||||||
|
*out_event = m_applet->gpu_error_detected_event.GetHandle();
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ICommonStateGetter::GetFriendInvitationStorageChannelEvent(
|
||||||
|
OutCopyHandle<Kernel::KReadableEvent> out_event) {
|
||||||
|
LOG_DEBUG(Service_AM, "called");
|
||||||
|
*out_event = m_applet->friend_invitation_storage_channel_event.GetHandle();
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ICommonStateGetter::GetNotificationStorageChannelEvent(
|
||||||
|
OutCopyHandle<Kernel::KReadableEvent> out_event) {
|
||||||
|
LOG_DEBUG(Service_AM, "called");
|
||||||
|
*out_event = m_applet->notification_storage_channel_event.GetHandle();
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
|
Result ICommonStateGetter::GetHealthWarningDisappearedSystemEvent(
|
||||||
|
OutCopyHandle<Kernel::KReadableEvent> out_event) {
|
||||||
|
LOG_DEBUG(Service_AM, "called");
|
||||||
|
*out_event = m_applet->health_warning_disappeared_system_event.GetHandle();
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Service::AM
|
} // namespace Service::AM
|
||||||
|
|||||||
@@ -53,6 +53,10 @@ private:
|
|||||||
OutArray<AppletId, BufferAttr_HipcMapAlias> out_applet_ids);
|
OutArray<AppletId, BufferAttr_HipcMapAlias> out_applet_ids);
|
||||||
Result GetSettingsPlatformRegion(Out<Set::PlatformRegion> out_settings_platform_region);
|
Result GetSettingsPlatformRegion(Out<Set::PlatformRegion> out_settings_platform_region);
|
||||||
Result SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled();
|
Result SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled();
|
||||||
|
Result GetGpuErrorDetectedSystemEvent(OutCopyHandle<Kernel::KReadableEvent> out_event);
|
||||||
|
Result GetFriendInvitationStorageChannelEvent(OutCopyHandle<Kernel::KReadableEvent> out_event);
|
||||||
|
Result GetNotificationStorageChannelEvent(OutCopyHandle<Kernel::KReadableEvent> out_event);
|
||||||
|
Result GetHealthWarningDisappearedSystemEvent(OutCopyHandle<Kernel::KReadableEvent> out_event);
|
||||||
|
|
||||||
void SetCpuBoostMode(HLERequestContext& ctx);
|
void SetCpuBoostMode(HLERequestContext& ctx);
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||||
// SPDX-FileCopyrightText: Copyright 2025 citron Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2026 citron Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
#include "core/hle/service/am/service/cradle_firmware_updater.h"
|
#include "core/hle/service/am/service/cradle_firmware_updater.h"
|
||||||
@@ -10,7 +10,8 @@ namespace Service::AM {
|
|||||||
|
|
||||||
IGlobalStateController::IGlobalStateController(Core::System& system_)
|
IGlobalStateController::IGlobalStateController(Core::System& system_)
|
||||||
: ServiceFramework{system_, "IGlobalStateController"},
|
: ServiceFramework{system_, "IGlobalStateController"},
|
||||||
m_context{system_, "IGlobalStateController"}, m_hdcp_authentication_failed_event{m_context} {
|
m_context{system_, "IGlobalStateController"}, m_hdcp_authentication_failed_event{m_context},
|
||||||
|
m_accumulated_suspended_tick_changed_event{m_context} {
|
||||||
// clang-format off
|
// clang-format off
|
||||||
static const FunctionInfo functions[] = {
|
static const FunctionInfo functions[] = {
|
||||||
{0, D<&IGlobalStateController::RequestToEnterSleep>, "RequestToEnterSleep"},
|
{0, D<&IGlobalStateController::RequestToEnterSleep>, "RequestToEnterSleep"},
|
||||||
@@ -35,7 +36,7 @@ IGlobalStateController::IGlobalStateController(Core::System& system_)
|
|||||||
{60, nullptr, "SetWirelessPriorityMode"},
|
{60, nullptr, "SetWirelessPriorityMode"},
|
||||||
{61, nullptr, "GetWirelessPriorityMode"},
|
{61, nullptr, "GetWirelessPriorityMode"},
|
||||||
{62, nullptr, "GetAccumulatedSuspendedTickValue"},
|
{62, nullptr, "GetAccumulatedSuspendedTickValue"},
|
||||||
{63, nullptr, "GetAccumulatedSuspendedTickChangedEvent"},
|
{63, D<&IGlobalStateController::GetAccumulatedSuspendedTickChangedEvent>, "GetAccumulatedSuspendedTickChangedEvent"},
|
||||||
{64, nullptr, "SetAlarmTimeChangeEvent"},
|
{64, nullptr, "SetAlarmTimeChangeEvent"},
|
||||||
{65, nullptr, "GetWakeupCount"},
|
{65, nullptr, "GetWakeupCount"},
|
||||||
{66, nullptr, "GetHomeButtonInputProtectionStartTime"},
|
{66, nullptr, "GetHomeButtonInputProtectionStartTime"},
|
||||||
@@ -130,4 +131,11 @@ Result IGlobalStateController::UpdateDefaultDisplayResolution() {
|
|||||||
R_SUCCEED();
|
R_SUCCEED();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Result IGlobalStateController::GetAccumulatedSuspendedTickChangedEvent(
|
||||||
|
OutCopyHandle<Kernel::KReadableEvent> out_event) {
|
||||||
|
LOG_DEBUG(Service_AM, "called");
|
||||||
|
*out_event = m_accumulated_suspended_tick_changed_event.GetHandle();
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Service::AM
|
} // namespace Service::AM
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||||
// SPDX-FileCopyrightText: Copyright 2025 citron Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2026 citron Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
@@ -33,9 +33,11 @@ private:
|
|||||||
Result GetHdcpAuthenticationFailedEvent(OutCopyHandle<Kernel::KReadableEvent> out_event);
|
Result GetHdcpAuthenticationFailedEvent(OutCopyHandle<Kernel::KReadableEvent> out_event);
|
||||||
Result OpenCradleFirmwareUpdater(
|
Result OpenCradleFirmwareUpdater(
|
||||||
Out<SharedPointer<ICradleFirmwareUpdater>> out_cradle_firmware_updater);
|
Out<SharedPointer<ICradleFirmwareUpdater>> out_cradle_firmware_updater);
|
||||||
|
Result GetAccumulatedSuspendedTickChangedEvent(OutCopyHandle<Kernel::KReadableEvent> out_event);
|
||||||
|
|
||||||
KernelHelpers::ServiceContext m_context;
|
KernelHelpers::ServiceContext m_context;
|
||||||
Event m_hdcp_authentication_failed_event;
|
Event m_hdcp_authentication_failed_event;
|
||||||
|
Event m_accumulated_suspended_tick_changed_event;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Service::AM
|
} // namespace Service::AM
|
||||||
|
|||||||
Reference in New Issue
Block a user