service/apt: Add and implement more service commands. (#6721)

* service/apt: Add and implement more service commands.

* service/apt: Implement power button.

* Address review comments and fix GetApplicationRunningMode bug.
This commit is contained in:
Steveice10 2023-07-29 00:26:16 -07:00 committed by GitHub
parent 51996c54f0
commit bb364d9bc0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 939 additions and 221 deletions

View file

@ -521,6 +521,11 @@ InstallStatus InstallFromNus(u64 title_id, int version) {
#endif
}
u64 GetTitleUpdateId(u64 title_id) {
// Real services seem to just discard and replace the whole high word.
return (title_id & 0xFFFFFFFF) | (static_cast<u64>(TID_HIGH_UPDATE) << 32);
}
Service::FS::MediaType GetTitleMediaType(u64 titleId) {
u16 platform = static_cast<u16>(titleId >> 48);
u16 category = static_cast<u16>((titleId >> 32) & 0xFFFF);

View file

@ -118,6 +118,13 @@ InstallStatus InstallCIA(const std::string& path,
*/
InstallStatus InstallFromNus(u64 title_id, int version = -1);
/**
* Get the update title ID for a title
* @param titleId the title ID
* @returns The update title ID
*/
u64 GetTitleUpdateId(u64 title_id);
/**
* Get the mediatype for an installed title
* @param titleId the installed title ID