feat: implement missing kernel event handle and service function

- Implement CreateInterruptEvent SVC function to resolve panic
  - Add proper resource management with KScopedResourceReservation
  - Use regular KEvent as placeholder for interrupt events
  - Add proper cleanup with SCOPE_EXIT
  - Include debug logging for troubleshooting

- Implement GetLaunchRequiredVersionUpgrade in IApplicationFunctions service
  - Fix "Unknown / unimplemented function" error for command 210
  - Return event handle instead of boolean to match Nintendo Switch API
  - Use state_changed_event as placeholder until dedicated event is implemented
  - Add function declaration to header file

Tested with Hollow Knight: Silksong - successfully boots.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
This commit is contained in:
Zephyron
2025-09-05 15:43:59 +10:00
parent 50afaefffb
commit 69c3bc705c
3 changed files with 49 additions and 3 deletions

View File

@@ -86,7 +86,7 @@ IApplicationFunctions::IApplicationFunctions(Core::System& system_, std::shared_
{181, nullptr, "UpgradeLaunchRequiredVersion"},
{190, nullptr, "SendServerMaintenanceOverlayNotification"},
{200, nullptr, "GetLastApplicationExitReason"},
{210, nullptr, "GetLaunchRequiredVersionUpgrade"},
{210, D<&IApplicationFunctions::GetLaunchRequiredVersionUpgrade>, "GetLaunchRequiredVersionUpgrade"},
{211, nullptr, "GetLaunchRequiredVersionUpgradeStatus"},
{300, nullptr, "RequestToLaunchApplication"},
{301, nullptr, "RequestToLaunchApplicationWithUserAndArguments"},
@@ -508,4 +508,13 @@ Result IApplicationFunctions::PrepareForJit() {
R_SUCCEED();
}
Result IApplicationFunctions::GetLaunchRequiredVersionUpgrade(OutCopyHandle<Kernel::KReadableEvent> out_event) {
LOG_WARNING(Service_AM, "(STUBBED) called");
// TODO(ZEP): Add a dedicated launch_required_version_upgrade_event when implemented
*out_event = m_applet->state_changed_event.GetHandle();
R_SUCCEED();
}
} // namespace Service::AM

View File

@@ -77,6 +77,7 @@ private:
Result GetNotificationStorageChannelEvent(OutCopyHandle<Kernel::KReadableEvent> out_event);
Result GetHealthWarningDisappearedSystemEvent(OutCopyHandle<Kernel::KReadableEvent> out_event);
Result PrepareForJit();
Result GetLaunchRequiredVersionUpgrade(OutCopyHandle<Kernel::KReadableEvent> out_event);
const std::shared_ptr<Applet> m_applet;
};