From 48616c364d8257f975c7072bb337f3c1db445939 Mon Sep 17 00:00:00 2001 From: MasaGratoR Date: Sat, 21 Feb 2026 09:39:48 +0100 Subject: [PATCH 1/8] Update NacpStruct to match switchbrew wiki --- nx/include/switch/nacp.h | 46 +++++++++++++++++++++++++++++++++++----- 1 file changed, 41 insertions(+), 5 deletions(-) diff --git a/nx/include/switch/nacp.h b/nx/include/switch/nacp.h index 0a03c4d53d..f40f4d7e9e 100644 --- a/nx/include/switch/nacp.h +++ b/nx/include/switch/nacp.h @@ -30,6 +30,18 @@ typedef struct { u64 memory_size; ///< MemorySize } NacpApplicationJitConfiguration; +/// ApplicationControlDataCondition +typedef struct { + u8 type[8]; ///< Type + struct { + u8 priority; ///< Priority + u8 reserved_x1[0x7]; ///< Reserved + u16 aoc_index; ///< AocIndex + u8 reserved_xa[0x6]; ///< Reserved + } data[8]; + u8 count; ///< Count +} NacpApplicationControlDataCondition; + /// ns ApplicationControlProperty typedef struct { NacpLanguageEntry lang[16]; ///< \ref NacpLanguageEntry @@ -60,7 +72,8 @@ typedef struct { u8 logo_handling; ///< LogoHandling u8 runtime_add_on_content_install; ///< RuntimeAddOnContentInstall u8 runtime_parameter_delivery; ///< RuntimeParameterDelivery - u8 reserved_x30f4[0x2]; ///< Reserved + u8 appropriate_age_for_china; ///< AppropriateAgeForChina + u8 reserved_x30f5; ///< Reserved u8 crash_report; ///< CrashReport u8 hdcp; ///< Hdcp u64 pseudo_device_id_seed; ///< SeedForPseudoDeviceId @@ -76,19 +89,42 @@ typedef struct { u64 cache_storage_journal_size; ///< CacheStorageJournalSize u64 cache_storage_data_and_journal_size_max; ///< CacheStorageDataAndJournalSizeMax u16 cache_storage_index_max; ///< CacheStorageIndexMax - u8 reserved_x318a[0x6]; ///< Reserved + u8 reserved_x318a; ///< Reserved + u8 runtime_upgrade; ///< RuntimeUpgrade + u32 supporting_limited_applications_licenses; ///< SupportingLimitedApplicationLicenses u64 play_log_queryable_application_id[0x10]; ///< PlayLogQueryableApplicationId u8 play_log_query_capability; ///< PlayLogQueryCapability u8 repair_flag; ///< RepairFlag u8 program_index; ///< ProgramIndex u8 required_network_service_license_on_launch; ///< RequiredNetworkServiceLicenseOnLaunchFlag - u32 reserved_x3214; ///< Reserved + u8 application_error_code_prefix; ///< [20.0.0+] ApplicationErrorCodePrefix + u8 titles_data_format; ///< [21.0.0+] TitlesDataFormat + u8 acd_index; ///< [20.0.0+] AcdIndex + u8 apparent_platform; ///< [21.0.0+] ApparentPlatform NacpNeighborDetectionClientConfiguration neighbor_detection_client_configuration; ///< NeighborDetectionClientConfiguration NacpApplicationJitConfiguration jit_configuration; ///< JitConfiguration - u8 reserved_x33c0[0xc40]; ///< Reserved + u16 required_addon_contents_set_binary_descriptor[0x20]; ///< RequiredAddOnContentsSetBinaryDescriptor + u8 play_report_permission; ///< PlayReportPermission + u8 crash_screenshot_for_prod; ///< CrashScreenshotForProd + u8 crash_screenshot_for_dev; ///< CrashScreenshotForDev + u8 contents_availability_transition_policy; ///< ContentsAvailabilityTransitionPolicy + u8 supported_language_flag_for_nx_addon; ///< [21.0.0+] SupportedLanguageFlagForNxAddon + u64 accessible_launch_required_version[0x8]; ///< AccessibleLaunchRequiredVersion + NacpApplicationControlDataCondition application_control_data_condition; ///< [20.0.0+] ApplicationControlDataCondition + u8 initial_program_index; ///< [20.0.0+] InitialProgramIndex + u8 reserved_x34d2; ///< Reserved + u32 accessible_program_index_flags; ///< [20.0.0+] AccessibleProgramIndexFlags + u8 album_file_export; ///< [20.0.0+] AlbumFileExport + u8 reserved_x34d9[0x7]; ///< Reserved + u8 save_data_certificate_bytes[0x80]; ///< [20.0.0+] SaveDataCertificateBytes + u8 has_in_game_voice_char; ///< [20.0.0+] HasInGameVoiceChat + u8 reserved_x3561[0x3]; ///< Reserved + u32 supported_extra_addon_content_flag; ///< [20.0.0+] SupportedExtraAddOnContentFlag + u8 has_karaoke_feature; ///< [21.0.0+] HasKaraokeFeature + u8 reserved_x3569[0x697]; ///< Reserved + u8 platform_specific_region[0x400]; ///< [20.0.0+] PlatformSpecificRegion } NacpStruct; /// Get the NacpLanguageEntry from the input nacp corresponding to the current system language (this may fallback to other languages when needed). Output langentry is NULL if none found / content of entry is empty. /// If you're using ns you may want to use \ref nsGetApplicationDesiredLanguage instead. Result nacpGetLanguageEntry(NacpStruct* nacp, NacpLanguageEntry** langentry); - From 67209f9555b1123f0c6305341b2d395422727a04 Mon Sep 17 00:00:00 2001 From: MasaGratoR Date: Sat, 21 Feb 2026 11:50:14 +0100 Subject: [PATCH 2/8] Update nacp.h --- nx/include/switch/nacp.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/nx/include/switch/nacp.h b/nx/include/switch/nacp.h index f40f4d7e9e..baf4fc53fa 100644 --- a/nx/include/switch/nacp.h +++ b/nx/include/switch/nacp.h @@ -42,9 +42,17 @@ typedef struct { u8 count; ///< Count } NacpApplicationControlDataCondition; +typedef union { + NacpLanguageEntry lang[16]; ///< \ref NacpLanguageEntry, use only if TitlesDataFormat == 0 + struct { + u16 buffer_size; + u8 buffer[0x2FFE]; + } compressed_data; ///< ///< \ref use only if TitlesDataFormat == 1, uncompressed data matches NacpLanguageEntry[32] +} NacpLanguageEntryData; + /// ns ApplicationControlProperty typedef struct { - NacpLanguageEntry lang[16]; ///< \ref NacpLanguageEntry + NacpLanguageEntryData lang_data; ///< \ref NacpLanguageEntryData u8 isbn[0x25]; ///< Isbn u8 startup_user_account; ///< StartupUserAccount u8 user_account_switch_lock; ///< UserAccountSwitchLock From 1cf45ca6eec357e6525a5e0d8a0e306442e5ab5f Mon Sep 17 00:00:00 2001 From: MasaGratoR Date: Sat, 21 Feb 2026 12:09:54 +0100 Subject: [PATCH 3/8] Update nacp.h --- nx/include/switch/nacp.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nx/include/switch/nacp.h b/nx/include/switch/nacp.h index baf4fc53fa..5033aad62d 100644 --- a/nx/include/switch/nacp.h +++ b/nx/include/switch/nacp.h @@ -43,11 +43,11 @@ typedef struct { } NacpApplicationControlDataCondition; typedef union { - NacpLanguageEntry lang[16]; ///< \ref NacpLanguageEntry, use only if TitlesDataFormat == 0 + NacpLanguageEntry lang[16]; ///< use only if TitlesDataFormat == 0, \ref NacpLanguageEntry struct { u16 buffer_size; u8 buffer[0x2FFE]; - } compressed_data; ///< ///< \ref use only if TitlesDataFormat == 1, uncompressed data matches NacpLanguageEntry[32] + } compressed_data; ///< use only if TitlesDataFormat == 1, uncompressed data matches NacpLanguageEntry[32] } NacpLanguageEntryData; /// ns ApplicationControlProperty From 5a99341a1b8451601957ef474d73477587045aff Mon Sep 17 00:00:00 2001 From: MasaGratoR Date: Sat, 21 Feb 2026 12:17:18 +0100 Subject: [PATCH 4/8] Update ns.c --- nx/source/services/ns.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nx/source/services/ns.c b/nx/source/services/ns.c index a1ec650e83..b2a19a26fb 100644 --- a/nx/source/services/ns.c +++ b/nx/source/services/ns.c @@ -541,11 +541,11 @@ Result nsGetApplicationDesiredLanguage(NacpStruct *nacp, NacpLanguageEntry **lan if (R_SUCCEEDED(rc)) { for (u32 i=0; i<16; i++) { - entry = &nacp->lang[i]; + entry = &nacp->lang_data.lang[i]; if (entry->name[0] || entry->author[0]) lang_bitmask |= BIT(i); } if (!lang_bitmask) { - *langentry = &nacp->lang[0]; + *langentry = &nacp->lang_data.lang[0]; return 0; } } @@ -554,7 +554,7 @@ Result nsGetApplicationDesiredLanguage(NacpStruct *nacp, NacpLanguageEntry **lan if (R_SUCCEEDED(rc)) { if (out > 16) out = 0; if (lang_bitmask & BIT(out)) - *langentry = &nacp->lang[out]; + *langentry = &nacp->lang_data.lang[out]; else rc = MAKERESULT(Module_Libnx, LibnxError_ShouldNotHappen); } From 91a4aa138c093b2009a7a9c4904e5563b1c83e3c Mon Sep 17 00:00:00 2001 From: MasaGratoR Date: Sat, 21 Feb 2026 12:20:50 +0100 Subject: [PATCH 5/8] Update nacp.c --- nx/source/runtime/nacp.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/nx/source/runtime/nacp.c b/nx/source/runtime/nacp.c index 29842e564a..d97ad66263 100644 --- a/nx/source/runtime/nacp.c +++ b/nx/source/runtime/nacp.c @@ -60,11 +60,11 @@ Result nacpGetLanguageEntry(NacpStruct* nacp, NacpLanguageEntry** langentry) { if (R_FAILED(rc)) return rc; - entry = &nacp->lang[g_nacpLanguageTable[Language]]; + entry = &nacp->lang_data.lang[g_nacpLanguageTable[Language]]; if (entry->name[0]==0 && entry->author[0]==0) { for(i=0; i<16; i++) { - entry = &nacp->lang[i]; + entry = &nacp->lang_data.lang[i]; if (entry->name[0] || entry->author[0]) break; } } @@ -76,4 +76,3 @@ Result nacpGetLanguageEntry(NacpStruct* nacp, NacpLanguageEntry** langentry) { return rc; } - From 36571a81b9611b03b232ad6b1cf4af07f8856eec Mon Sep 17 00:00:00 2001 From: MasaGratoR Date: Sat, 21 Feb 2026 12:31:45 +0100 Subject: [PATCH 6/8] Update nacp.h --- nx/include/switch/nacp.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nx/include/switch/nacp.h b/nx/include/switch/nacp.h index 5033aad62d..305e5fe75c 100644 --- a/nx/include/switch/nacp.h +++ b/nx/include/switch/nacp.h @@ -43,11 +43,11 @@ typedef struct { } NacpApplicationControlDataCondition; typedef union { - NacpLanguageEntry lang[16]; ///< use only if TitlesDataFormat == 0, \ref NacpLanguageEntry + NacpLanguageEntry lang[16]; ///< Use only if TitlesDataFormat == 0, \ref NacpLanguageEntry struct { u16 buffer_size; - u8 buffer[0x2FFE]; - } compressed_data; ///< use only if TitlesDataFormat == 1, uncompressed data matches NacpLanguageEntry[32] + u8 buffer[0x2FFE]; ///< Compressed using DEFLATE with wbits set to -15 + } compressed_data; ///< Use only if TitlesDataFormat == 1, uncompressed data matches NacpLanguageEntry[32] } NacpLanguageEntryData; /// ns ApplicationControlProperty From 698cb6bfdd8bfe589c7ea102f487ae995a74eb79 Mon Sep 17 00:00:00 2001 From: MasaGratoR Date: Sat, 21 Feb 2026 12:32:39 +0100 Subject: [PATCH 7/8] Update nacp.h --- nx/include/switch/nacp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nx/include/switch/nacp.h b/nx/include/switch/nacp.h index 305e5fe75c..2467549643 100644 --- a/nx/include/switch/nacp.h +++ b/nx/include/switch/nacp.h @@ -46,7 +46,7 @@ typedef union { NacpLanguageEntry lang[16]; ///< Use only if TitlesDataFormat == 0, \ref NacpLanguageEntry struct { u16 buffer_size; - u8 buffer[0x2FFE]; ///< Compressed using DEFLATE with wbits set to -15 + u8 buffer[0x2FFE]; ///< Compressed using DEFLATE with wbits = -15 } compressed_data; ///< Use only if TitlesDataFormat == 1, uncompressed data matches NacpLanguageEntry[32] } NacpLanguageEntryData; From 8d2f77e622e719a3b3ff608d6fd3a833a5c28c46 Mon Sep 17 00:00:00 2001 From: MasaGratoR Date: Sat, 21 Feb 2026 16:49:24 +0100 Subject: [PATCH 8/8] Update nacp.h --- nx/include/switch/nacp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nx/include/switch/nacp.h b/nx/include/switch/nacp.h index 2467549643..a11f819aac 100644 --- a/nx/include/switch/nacp.h +++ b/nx/include/switch/nacp.h @@ -108,7 +108,7 @@ typedef struct { u8 application_error_code_prefix; ///< [20.0.0+] ApplicationErrorCodePrefix u8 titles_data_format; ///< [21.0.0+] TitlesDataFormat u8 acd_index; ///< [20.0.0+] AcdIndex - u8 apparent_platform; ///< [21.0.0+] ApparentPlatform + u8 apparent_platform; ///< [20.0.0+] ApparentPlatform NacpNeighborDetectionClientConfiguration neighbor_detection_client_configuration; ///< NeighborDetectionClientConfiguration NacpApplicationJitConfiguration jit_configuration; ///< JitConfiguration u16 required_addon_contents_set_binary_descriptor[0x20]; ///< RequiredAddOnContentsSetBinaryDescriptor