Makes it possible to generate TitleInfo and TitleApplicationMetadata elements for gamecards that can't be used with ncm (e.g. Kiosk / Quest gamecards under retail, non-Quest units). This is achieved by:
1. Retrieving a Hash FS context for the gamecard's secure partition.
2. Initializing NCA and CNMT contexts for all of the Meta NCAs within the secure partition.
3. Manually generating NcmContentMetaKey and NcmContentInfo elements per each CNMT context.
4. Creating TitleInfo elements using the generated NcmContentMetaKey and NcmContentInfo elements.
5. Initializing NCA and NACP contexts for the base (or update) Control NCAs within the secure partition.
6. Manually generating a NsApplicationControlData element per each NACP context.
7. Creating TitleApplicationMetadata elements using the generated NsApplicationControlData elements.
Afterwards, gamecard title/content enumeration and all other features that rely on it (e.g. NSP, NCA, NCA FS) work as expected. Please note that this process is only carried out if regular title storage initialization fails.
Other changes include:
* title: reorder code.
* title: add TitleGameCardContentMetaContext struct.
* title: rename titleGetInfoFromStorageByTitleId() -> titleGetTitleInfoEntryFromStorageByTitleId().
* title: add titleInitializeGameCardTitleStorageByHashFileSystem().
* title: rename titleGenerateDummySystemMetadataEntry() -> titleGetSystemMetadataEntry().
* title: rename titleRetrieveUserApplicationMetadataByTitleId() -> titleGenerateUserMetadataEntryFromNs().
* title: move ns logic from titleRetrieveUserApplicationMetadataByTitleId() into a new function: titleGetApplicationControlDataFromNs().
* title: add titleGenerateUserMetadataEntryFromControlNca().
* title: add titleGetApplicationControlDataFromControlNca().
* title: add titleInitializeUserMetadataEntryFromControlData().
* title: add titleGenerateTitleInfoEntriesByHashFileSystemForGameCardTitleStorage().
* title: move TitleInfo generation logic from titleGenerateTitleInfoEntriesForTitleStorage() into a new function: titleGenerateTitleInfoEntry().
* title: add titleInitializeTitleInfoApplicationMetadataFromControlNca().
* title: add titleGetGameCardContentMetaContexts().
* title: add titleFreeGameCardContentMetaContexts().
* title: add titleGetContentInfosByGameCardContentMetaContext().
* title: rename _titleGetInfoFromStorageByTitleId() -> _titleGetTitleInfoEntryFromStorageByTitleId().
* title: rename titleSystemTitleMetadataEntrySortFunction() -> titleSystemMetadataSortFunction().
* title: rename titleUserApplicationMetadataEntrySortFunction() -> titleUserMetadataSortFunction().
* title: rename titleInfoEntrySortFunction() -> titleInfoSortFunction().
* title: add titleGameCardContentMetaContextSortFunction().
* codebase: update to reflect the rest of the changes.
Other changes include:
* Codebase: remove `_i18n` operators from strings used in brls::i18n::getStr() calls.
* GameCardStatusTask: rename first_notification -> skip_notification.
* GameCardStatusTask: fire event before displaying a notification.
* libs: update borealis fork.
* TitlesTab: store application metadata pointer array and size into local variables.
The struct has been typedef'd as TitleApplicationMetadataInfo. It holds the pointer to the array returned by titleGetApplicationMetadataEntries(), as well as the number of elements available in the array.
There's no point in populating a vector when we already have an array we can work with.
titleGetApplicationMetadataEntries() and titleGetGameCardApplicationMetadataEntries() will now return dynamically allocated copies of internal pre-filtered / pre-processed arrays, which are generated using the background gamecard thread. This results in less overhead for any potential calls to these functions.
Other changes include:
* title: rename TitleGameCardApplicationMetadataEntry -> TitleGameCardApplicationMetadata.
* title: add `has_patch` field to TitleGameCardApplicationMetadata struct.
* title: declare internal TitleApplicationMetadata arrays to hold pre-filtered application metadata.
* title: declare internal TitleGameCardApplicationMetadata array to hold pre-processed gamecard application metadata.
* title: move filtering logic from titleGetApplicationMetadataEntries() to a new function: titleGenerateFilteredApplicationMetadataPointerArray().
* title: move processing logic from titleGetGameCardApplicationMetadataEntries() to a new function: titleGenerateGameCardApplicationMetadataArray().
* title: rename titleGetPatchVersionString() -> titleGetDisplayVersionString().
* title: add extra debug log messages to some functions.
* title: update titleFreeApplicationMetadata() to also free the new internal metadata arrays.
* title: update background thread logic in titleGameCardInfoThreadFunc() to also regenerate the pre-filtered application metadata and gamecard application metadata arrays right after a successful call to titleRefreshGameCardTitleInfo().
* title: update titleGetDisplayVersionString() to also support base application titles.
* title: simplify string generation logic in titleGenerateGameCardFileName() by using the cached gamecard application metadata array.
* GameCardStatusTask: add GetGameCardStatus() method.
* GameCardTab: fix callback argument type in class constructor.
* GameCardTab: update ProcessGameCardStatus() to block user inputs while processing the new gamecard status.
* RootView: add GetGameCardStatus() method.
* StatusInfoTask: turn IsInternetConnectionAvailable() into an inline method.
* TitleMetadataTask: turn GetApplicationMetadata() into an inline method.
* TitleMetadataTask: move debug log messages around.
* TitlesTab: update PopulateList() to block user inputs while updating the titles list.
* UmsTask: turn GetUmsDevices() into an inline method.
* UsbHostTask: turn GetUsbHostSpeed() into an inline method.
The directory layout is partially based on the C++ namespaces we're currently using.
Other changes include:
* devoptab: move directory into "core".
* fatfs: move directory into "core".
* GameCardTab: move portions of logic from PopulateList() into their own methods.
* GameCardTab: use a macro to generate the properties table.
* GameCardTab: use a macro to add ListItem elements.
* GameCardTab: update AddApplicationMetadataItems() method to also display the number of DLCs available in the inserted gamecard for each application whenever possible.
* Makefile: remove all extra entries from the INCLUDES variable.
* nxdt_includes: move HOS version structs into their own header file.
* tasks: move code for each individual task into its own file(s).
* title: update titleGetGameCardApplicationMetadataEntries() to also count the number of DLCs available in the inserted gamecard for any given base application.
* title: reorder gamecard application metadata entries by name before returning the buffer in titleGetGameCardApplicationMetadataEntries().