From 5346ca27b521cd7fdcfcafad978137dde2d9586c Mon Sep 17 00:00:00 2001 From: Steveice10 <1269164+Steveice10@users.noreply.github.com> Date: Wed, 29 Mar 2023 04:55:29 -0700 Subject: [PATCH] Rework system title handling with up-to-date title list and region detection support. (#6356) --- .../configuration/configure_system.cpp | 23 +- .../configuration/configure_system.ui | 61 +- src/citra_qt/main.cpp | 30 +- src/citra_qt/main.h | 2 +- src/citra_qt/main.ui | 48 +- src/core/CMakeLists.txt | 2 + src/core/loader/ncch.cpp | 15 +- src/core/loader/ncch.h | 4 +- src/core/system_titles.cpp | 1123 +++++++++++++++++ src/core/system_titles.h | 28 + src/web_service/CMakeLists.txt | 1 - src/web_service/nus_titles.h | 761 ----------- 12 files changed, 1292 insertions(+), 806 deletions(-) create mode 100644 src/core/system_titles.cpp create mode 100644 src/core/system_titles.h delete mode 100644 src/web_service/nus_titles.h diff --git a/src/citra_qt/configuration/configure_system.cpp b/src/citra_qt/configuration/configure_system.cpp index 159106701..14cf4c65b 100644 --- a/src/citra_qt/configuration/configure_system.cpp +++ b/src/citra_qt/configuration/configure_system.cpp @@ -15,10 +15,8 @@ #include "core/hle/service/cfg/cfg.h" #include "core/hle/service/ptm/ptm.h" #include "core/hw/aes/key.h" +#include "core/system_titles.h" #include "ui_configure_system.h" -#ifdef ENABLE_WEB_SERVICE -#include "web_service/nus_titles.h" -#endif static const std::array days_in_month = {{ 31, @@ -246,7 +244,9 @@ ConfigureSystem::ConfigureSystem(QWidget* parent) SetupPerGameUI(); - ui->combo_download_mode->setCurrentIndex(1); // set to Recommended + ui->combo_download_set->setCurrentIndex(0); // set to Minimal + ui->combo_download_region->setCurrentIndex(0); // set to the base region + bool keys_available = true; HW::AES::InitKeys(true); for (u8 i = 0; i < HW::AES::MaxCommonKeySlot; i++) { @@ -258,11 +258,13 @@ ConfigureSystem::ConfigureSystem(QWidget* parent) } if (keys_available) { ui->button_start_download->setEnabled(true); - ui->combo_download_mode->setEnabled(true); + ui->combo_download_set->setEnabled(true); + ui->combo_download_region->setEnabled(true); ui->label_nus_download->setText(tr("Download System Files from Nintendo servers")); } else { ui->button_start_download->setEnabled(false); - ui->combo_download_mode->setEnabled(false); + ui->combo_download_set->setEnabled(false); + ui->combo_download_region->setEnabled(false); ui->label_nus_download->setTextInteractionFlags(Qt::TextBrowserInteraction); ui->label_nus_download->setOpenExternalLinks(true); ui->label_nus_download->setText( @@ -343,6 +345,9 @@ void ConfigureSystem::ReadSystemSettings() { // set play coin play_coin = Service::PTM::Module::GetPlayCoins(); ui->spinBox_play_coins->setValue(play_coin); + + // set firmware download region + ui->combo_download_region->setCurrentIndex(static_cast(cfg->GetRegionValue())); } void ConfigureSystem::ApplyConfiguration() { @@ -535,8 +540,10 @@ void ConfigureSystem::DownloadFromNUS() { #ifdef ENABLE_WEB_SERVICE ui->button_start_download->setEnabled(false); - const auto mode = static_cast(ui->combo_download_mode->currentIndex()); - const std::vector titles = BuildFirmwareTitleList(mode, cfg->GetRegionValue()); + const auto mode = + static_cast(1 << ui->combo_download_set->currentIndex()); + const auto region = static_cast(ui->combo_download_region->currentIndex()); + const std::vector titles = Core::GetSystemTitleIds(mode, region); QProgressDialog progress(tr("Downloading files..."), tr("Cancel"), 0, static_cast(titles.size()), this); diff --git a/src/citra_qt/configuration/configure_system.ui b/src/citra_qt/configuration/configure_system.ui index 064ce3835..d73e70d52 100644 --- a/src/citra_qt/configuration/configure_system.ui +++ b/src/citra_qt/configuration/configure_system.ui @@ -371,22 +371,61 @@ - - - - All - - - - - Recommended - - + Minimal + + + Old 3DS + + + + + New 3DS + + + + + + + + + JPN + + + + + USA + + + + + EUR + + + + + AUS + + + + + CHN + + + + + KOR + + + + + TWN + + diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index b2cf72f18..efa6c8116 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -94,6 +94,7 @@ #include "core/loader/loader.h" #include "core/movie.h" #include "core/savestate.h" +#include "core/system_titles.h" #include "game_list_p.h" #include "input_common/main.h" #include "network/network_settings.h" @@ -747,7 +748,10 @@ void GMainWindow::ConnectMenuEvents() { // File connect_menu(ui->action_Load_File, &GMainWindow::OnMenuLoadFile); connect_menu(ui->action_Install_CIA, &GMainWindow::OnMenuInstallCIA); - connect_menu(ui->action_Boot_Home_Menu, &GMainWindow::OnMenuBootHomeMenu); + for (u32 region = 0; region < Core::NUM_SYSTEM_TITLE_REGIONS; region++) { + connect_menu(ui->menu_Boot_Home_Menu->actions().at(region), + [this, region] { OnMenuBootHomeMenu(region); }); + } connect_menu(ui->action_Exit, &QMainWindow::close); connect_menu(ui->action_Load_Amiibo, &GMainWindow::OnLoadAmiibo); connect_menu(ui->action_Remove_Amiibo, &GMainWindow::OnRemoveAmiibo); @@ -1633,18 +1637,8 @@ void GMainWindow::OnMenuInstallCIA() { InstallCIA(filepaths); } -static std::string GetHomeMenuPath() { - static const std::array home_menu_tids = { - 0x0004003000008202, 0x0004003000008F02, 0x0004003000009802, 0x0004003000009802, - 0x000400300000A102, 0x000400300000A902, 0x000400300000B102}; - - Service::CFG::Module cfg{}; - return Service::AM::GetTitleContentPath(Service::FS::MediaType::NAND, - home_menu_tids[cfg.GetRegionValue()]); -} - -void GMainWindow::OnMenuBootHomeMenu() { - BootGame(QString::fromStdString(GetHomeMenuPath())); +void GMainWindow::OnMenuBootHomeMenu(u32 region) { + BootGame(QString::fromStdString(Core::GetHomeMenuNcchPath(region))); } void GMainWindow::InstallCIA(QStringList filepaths) { @@ -2292,9 +2286,13 @@ void GMainWindow::UpdateStatusBar() { } void GMainWindow::UpdateBootHomeMenuState() { - const std::string home_menu_path = GetHomeMenuPath(); - ui->action_Boot_Home_Menu->setEnabled(!home_menu_path.empty() && - FileUtil::Exists(GetHomeMenuPath())); + const auto current_region = Settings::values.region_value.GetValue(); + for (u32 region = 0; region < Core::NUM_SYSTEM_TITLE_REGIONS; region++) { + const auto path = Core::GetHomeMenuNcchPath(region); + ui->menu_Boot_Home_Menu->actions().at(region)->setEnabled( + (current_region == Settings::REGION_VALUE_AUTO_SELECT || current_region == region) && + !path.empty() && FileUtil::Exists(path)); + } } void GMainWindow::HideMouseCursor() { diff --git a/src/citra_qt/main.h b/src/citra_qt/main.h index c323072d6..7ee216557 100644 --- a/src/citra_qt/main.h +++ b/src/citra_qt/main.h @@ -196,7 +196,7 @@ private slots: void OnConfigurePerGame(); void OnMenuLoadFile(); void OnMenuInstallCIA(); - void OnMenuBootHomeMenu(); + void OnMenuBootHomeMenu(u32 region); void OnUpdateProgress(std::size_t written, std::size_t total); void OnCIAInstallReport(Service::AM::InstallStatus status, QString filepath); void OnCIAInstallFinished(); diff --git a/src/citra_qt/main.ui b/src/citra_qt/main.ui index 38fff8b71..ba64ab75f 100644 --- a/src/citra_qt/main.ui +++ b/src/citra_qt/main.ui @@ -52,6 +52,18 @@ &File + + + Boot Home Menu + + + + + + + + + Recent Files @@ -66,7 +78,7 @@ - + @@ -210,9 +222,39 @@ Install CIA... - + - Boot Home Menu + JPN + + + + + USA + + + + + EUR + + + + + AUS + + + + + CHN + + + + + KOR + + + + + TWN diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index aedb6b135..8aadcad81 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -458,6 +458,8 @@ add_library(core STATIC rpc/udp_server.h savestate.cpp savestate.h + system_titles.cpp + system_titles.h telemetry_session.cpp telemetry_session.h tracer/citrace.h diff --git a/src/core/loader/ncch.cpp b/src/core/loader/ncch.cpp index d233aef26..56053029c 100644 --- a/src/core/loader/ncch.cpp +++ b/src/core/loader/ncch.cpp @@ -25,6 +25,7 @@ #include "core/loader/ncch.h" #include "core/loader/smdh.h" #include "core/memory.h" +#include "core/system_titles.h" #include "network/network.h" //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -162,7 +163,10 @@ ResultStatus AppLoader_NCCH::LoadExec(std::shared_ptr& process) return ResultStatus::Error; } -void AppLoader_NCCH::ParseRegionLockoutInfo() { +void AppLoader_NCCH::ParseRegionLockoutInfo(u64 program_id) { + auto cfg = Service::CFG::GetModule(Core::System::GetInstance()); + ASSERT_MSG(cfg, "CFG Module missing!"); + std::vector smdh_buffer; if (ReadIcon(smdh_buffer) == ResultStatus::Success && smdh_buffer.size() >= sizeof(SMDH)) { SMDH smdh; @@ -176,9 +180,12 @@ void AppLoader_NCCH::ParseRegionLockoutInfo() { } region_lockout >>= 1; } - auto cfg = Service::CFG::GetModule(Core::System::GetInstance()); - ASSERT_MSG(cfg, "CFG Module missing!"); cfg->SetPreferredRegionCodes(regions); + } else { + const auto region = Core::GetSystemTitleRegion(program_id); + if (region.has_value()) { + cfg->SetPreferredRegionCodes({region.value()}); + } } } @@ -229,7 +236,7 @@ ResultStatus AppLoader_NCCH::Load(std::shared_ptr& process) { system.ArchiveManager().RegisterSelfNCCH(*this); - ParseRegionLockoutInfo(); + ParseRegionLockoutInfo(ncch_program_id); return ResultStatus::Success; } diff --git a/src/core/loader/ncch.h b/src/core/loader/ncch.h index 76ce61446..3100b0616 100644 --- a/src/core/loader/ncch.h +++ b/src/core/loader/ncch.h @@ -76,7 +76,9 @@ private: ResultStatus LoadExec(std::shared_ptr& process); /// Reads the region lockout info in the SMDH and send it to CFG service - void ParseRegionLockoutInfo(); + /// If an SMDH is not present, the program ID is compared against a list + /// of known system titles to determine the region. + void ParseRegionLockoutInfo(u64 program_id); /// Detects whether the NCCH contains GBA Virtual Console. bool IsGbaVirtualConsole(const std::vector& code); diff --git a/src/core/system_titles.cpp b/src/core/system_titles.cpp new file mode 100644 index 000000000..661106e6b --- /dev/null +++ b/src/core/system_titles.cpp @@ -0,0 +1,1123 @@ +// Copyright 2023 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#include +#include "core/hle/service/am/am.h" +#include "core/hle/service/fs/archive.h" +#include "core/system_titles.h" + +namespace Core { + +struct SystemTitle { + std::string_view name; + u32 sets = SystemTitleSet::Old3ds | SystemTitleSet::New3ds; + std::array title_id_lows; +}; + +struct SystemTitleCategory { + std::string_view name; + u32 title_id_high; + std::vector titles; +}; + +static constexpr u32 NUM_SYSTEM_TITLE_CATEGORIES = 7; + +static constexpr u64 home_menu_title_id_high = 0x00040030; +static constexpr SystemTitle home_menu_title = { + .name = "HOME Menu", + .title_id_lows = {0x00008202, 0x00008F02, 0x00009802, 0x00009802, 0x0000A102, 0x0000A902, + 0x0000B102}, +}; + +static const std::array + system_titles = + { + { + {.name = "System Applications", + .title_id_high = 0x00040010, + .titles = + { + { + .name = "System Settings", + .title_id_lows = {0x00020000, 0x00021000, 0x00022000, 0x00022000, + 0x00026000, 0x00027000, 0x00028000}, + }, + { + .name = "Download Play", + .title_id_lows = {0x00020100, 0x00021100, 0x00022100, 0x00022100, + 0x00026100, 0x00027100, 0x00028100}, + }, + { + .name = "Activity Log", + .title_id_lows = {0x00020200, 0x00021200, 0x00022200, 0x00022200, + 0x00026200, 0x00027200, 0x00028200}, + }, + { + .name = "Health and Safety Information (O3DS)", + .sets = SystemTitleSet::Old3ds, + .title_id_lows = {0x00020300, 0x00021300, 0x00022300, 0x00022300, + 0x00026300, 0x00027300, 0x00028300}, + }, + { + .name = "Health and Safety Information (N3DS)", + .sets = SystemTitleSet::New3ds, + .title_id_lows = {0x20020300, 0x20021300, 0x20022300, 0x20022300, 0, + 0x20027300, 0}, + }, + { + .name = "Nintendo 3DS Camera", + .title_id_lows = {0x00020400, 0x00021400, 0x00022400, 0x00022400, + 0x00026400, 0x00027400, 0x00028400}, + }, + { + .name = "Nintendo 3DS Sound", + .title_id_lows = + {0x00020500, + 0x00021500, 0x00022500, 0x00022500, 0x00026500, 0x00027500, 0x00028500}, + }, + { + .name = "Mii Maker", + .title_id_lows = + {0x00020700, + 0x00021700, 0x00022700, 0x00022700, 0x00026700, 0x00027700, 0x00028700}, + }, + { + .name = "StreetPass Mii Plaza", + .title_id_lows = + {0x00020800, + 0x00021800, 0x00022800, 0x00022800, 0x00026800, 0x00027800, 0x00028800}, + }, + { + .name = "Nintendo eShop", + .title_id_lows = {0x00020900, 0x00021900, 0x00022900, 0x00022900, 0, + 0x00027900, 0x00028900}, + }, + { + .name = "System Transfer", + .title_id_lows = {0x00020A00, 0x00021A00, 0x00022A00, 0x00022A00, 0, + 0x00027A00, 0x00028A00}, + }, + { + .name = "Nintendo Zone", + .title_id_lows = {0x00020B00, 0x00021B00, 0x00022B00, 0x00022B00, 0, + 0, 0}, + }, + { + .name = "Face Raiders (O3DS)", + .sets = SystemTitleSet::Old3ds, + .title_id_lows = + {0x00020D00, + 0x00021D00, 0x00022D00, 0x00022D00, 0x00026D00, 0x00027D00, 0x00028D00}, + }, + { + .name = "Face Raiders (N3DS)", + .sets = SystemTitleSet::New3ds, + .title_id_lows = {0x20020D00, 0x20021D00, 0x20022D00, 0x20022D00, 0, + 0x20027D00, 0}, + }, + { + .name = "AR Games", + .title_id_lows = + {0x00020E00, + 0x00021E00, 0x00022E00, 0x00022E00, 0x00026E00, 0x00027E00, 0x00028E00}, + }, + { + .name = "System Updater (Safe Mode)", + .title_id_lows = + {0x00020F00, + 0x00021F00, 0x00022F00, 0x00022F00, 0x00026F00, 0x00027F00, 0x00028F00}, + }, + { + .name = "Nintendo Network ID Settings", + .title_id_lows = {0x0002BF00, 0x0002C000, 0x0002C100, 0x0002C100, 0, + 0, 0}, + }, + { + .name = "microSD Management (N3DS)", + .sets = SystemTitleSet::New3ds, + .title_id_lows = {0x20023100, 0x20024100, 0x20025100, 0x20025100, 0, + 0, 0}, + }, + { + .name = "HOME Menu Digital Manual (N3DS)", + .sets = SystemTitleSet::New3ds, + .title_id_lows = {0x2002C800, 0x2002CF00, 0x2002D000, 0x2002D000, 0, + 0x2002D700, 0}, + }, + { + .name = "Friends List Digital Manual (N3DS)", + .sets = SystemTitleSet::New3ds, + .title_id_lows = {0x2002C900, 0x2002D100, 0x2002D200, 0x2002D200, 0, + 0x2002D800, 0}, + }, + { + .name = "Notifications Digital Manual (N3DS)", + .sets = SystemTitleSet::New3ds, + .title_id_lows = {0x2002CA00, 0x2002D300, 0x2002D400, 0x2002D400, 0, + 0x2002D900, 0}, + }, + { + .name = "Game Notes Digital Manual (N3DS)", + .sets = SystemTitleSet::New3ds, + .title_id_lows = {0x2002CB00, 0x2002D500, 0x2002D600, 0x2002D600, 0, + 0x2002DA00, 0}, + }, + }}, + {.name = "System Data Archives", + .title_id_high = 0x0004001B, + .titles = + { + { + .name = "ClCertA", + .sets = SystemTitleSet::Old3ds | SystemTitleSet::New3ds | + SystemTitleSet::Minimal, + .title_id_lows = {0x00010002, 0x00010002, 0x00010002, 0x00010002, + 0x00010002, 0x00010002, 0x00010002}, + }, + { + .name = "NS CFA", + .title_id_lows = {0x00010702, 0x00010702, 0x00010702, 0x00010702, + 0x00010702, 0x00010702, 0x00010702}, + }, + { + .name = "Dummy CFA", + .title_id_lows = {0x00010802, 0x00010802, 0x00010802, 0x00010802, + 0x00010802, 0x00010802, 0x00010802}, + }, + { + .name = "NNID Web Browser Data", + .title_id_lows = {0x00018002, 0x00018002, 0x00018002, 0x00018002, + 0x00018002, 0x00018002, 0x00018002}, + }, + { + .name = "Miiverse Offline Mode Web Browser Data", + .title_id_lows = {0x00018102, 0x00018102, 0x00018102, 0x00018102, + 0x00018102, 0x00018102, 0x00018102}, + }, + { + .name = "NNID/Miiverse OSS CROs", + .title_id_lows = {0x00018202, 0x00018202, 0x00018202, 0x00018202, + 0x00018202, 0x00018202, 0x00018202}, + }, + { + .name = "NFC Peripheral Firmware", + .title_id_lows = {0x00019002, 0x00019002, 0x00019002, 0x00019002, + 0x00019002, 0x00019002, 0x00019002}, + }, + }}, + {.name = "System Applets", + .title_id_high = 0x00040030, + .titles = + { + home_menu_title, + { + .name = "Camera Applet", + .title_id_lows = {0x00008402, 0x00009002, 0x00009902, 0x00009902, + 0x0000A202, 0x0000AA02, 0x0000B202}, + }, + { + .name = "Instruction Manual", + .title_id_lows = {0x00008602, 0x00009202, 0x00009B02, 0x00009B02, + 0x0000A402, 0x0000AC02, 0x0000B402}, + }, + { + .name = "Game Notes", + .title_id_lows = {0x00008702, 0x00009302, 0x00009C02, 0x00009C02, + 0x0000A502, 0x0000AD02, 0x0000B502}, + }, + { + .name = "Internet Browser (O3DS)", + .sets = SystemTitleSet::Old3ds, + .title_id_lows = {0x00008802, 0x00009402, 0x00009D02, 0x00009D02, + 0x0000A602, 0x0000AE02, 0x0000B602}, + }, + { + .name = "Internet Browser (N3DS)", + .sets = SystemTitleSet::New3ds, + .title_id_lows = {0x20008802, 0x20009402, 0x20009D02, 0x20009D02, 0, + 0x2000AE02, 0}, + }, + { + .name = "Error Display", + .title_id_lows = {0x00008A02, 0x00008A02, 0x00008A02, 0x00008A02, + 0x00008A02, 0x00008A02, 0x00008A02}, + }, + { + .name = "Error Display (Safe Mode, O3DS)", + .sets = SystemTitleSet::Old3ds, + .title_id_lows = {0x00008A03, 0x00008A03, 0x00008A03, 0x00008A03, + 0x00008A03, 0x00008A03, 0x00008A03}, + }, + { + .name = "Error Display (Safe Mode, N3DS)", + .sets = SystemTitleSet::New3ds, + .title_id_lows = {0x20008A03, 0x20008A03, 0x20008A03, 0x20008A03, + 0x20008A03, 0x20008A03, 0x20008A03}, + }, + { + .name = "Friends List", + .title_id_lows = {0x00008D02, 0x00009602, 0x00009F02, 0x00009F02, + 0x0000A702, 0x0000AF02, 0x0000B702}, + }, + { + .name = "Notifications", + .title_id_lows = {0x00008E02, 0x00009702, 0x0000A002, 0x0000A002, + 0x0000A802, 0x0000B002, 0x0000B802}, + }, + { + .name = "Software Keyboard", + .title_id_lows = {0x0000C002, 0x0000C802, 0x0000D002, 0x0000D002, + 0x0000D802, 0x0000DE02, 0x0000E402}, + }, + { + .name = "Software Keyboard (Safe Mode, O3DS)", + .sets = SystemTitleSet::Old3ds, + .title_id_lows = {0x0000C003, 0x0000C803, 0x0000D003, 0x0000D003, + 0x0000D803, 0x0000DE03, 0x0000E403}, + }, + { + .name = "Software Keyboard (Safe Mode, N3DS)", + .sets = SystemTitleSet::New3ds, + .title_id_lows = {0x2000C003, 0x2000C803, 0x2000D003, 0x2000D003, 0, + 0x2000DE03, 0}, + }, + { + .name = "Mii Picker", + .title_id_lows = {0x0000C102, 0x0000C902, 0x0000D102, 0x0000D102, + 0x0000D902, 0x0000DF02, 0x0000E502}, + }, + { + .name = "Photo Picker", + .title_id_lows = {0x0000C302, 0x0000CB02, 0x0000D302, 0x0000D302, + 0x0000DB02, 0x0000E102, 0x0000E702}, + }, + { + .name = "Sound Picker", + .title_id_lows = {0x0000C402, 0x0000CC02, 0x0000D402, 0x0000D402, + 0x0000DC02, 0x0000E202, 0x0000E802}, + }, + { + .name = "Error/EULA Display", + .title_id_lows = {0x0000C502, 0x0000C502, 0x0000C502, 0x0000C502, + 0x0000CF02, 0x0000CF02, 0x0000CF02}, + }, + { + .name = "Error/EULA Display (Safe Mode, O3DS)", + .sets = SystemTitleSet::Old3ds, + .title_id_lows = {0x0000C503, 0x0000C503, 0x0000C503, 0x0000C503, + 0x0000CF03, 0x0000CF03, 0x0000CF03}, + }, + { + .name = "Error/EULA Display (Safe Mode, N3DS)", + .sets = SystemTitleSet::New3ds, + .title_id_lows = {0x2000C503, 0x2000C503, 0x2000C503, 0x2000C503, + 0x2000CF03, 0x2000CF03, 0x2000CF03}, + }, + { + .name = "Circle Pad Pro Calibration", + .title_id_lows = {0x0000CD02, 0x0000CD02, 0x0000CD02, 0x0000CD02, + 0x0000D502, 0x0000D502, 0x0000D502}, + }, + { + .name = "Nintendo eShop Applet", + .title_id_lows = {0x0000C602, 0x0000CE02, 0x0000D602, 0x0000D602, 0, + 0x0000E302, 0x0000E902}, + }, + { + .name = "Miiverse", + .title_id_lows = {0x0000BC02, 0x0000BD02, 0x0000BE02, 0x0000BE02, 0, + 0, 0}, + }, + { + .name = "Miiverse System Library", + .title_id_lows = {0x0000F602, 0x0000F602, 0x0000F602, 0x0000F602, 0, + 0, 0}, + }, + { + .name = "Miiverse Post Applet", + .title_id_lows = {0x00008302, 0x00008B02, 0x0000BA02, 0x0000BA02, 0, + 0, 0}, + }, + { + .name = "Amiibo Settings", + .title_id_lows = {0x00009502, 0x00009E02, 0x0000B902, 0x0000B902, 0, + 0x00008C02, 0x0000BF02}, + }, + }}, + {.name = "Shared Data Archives", + .title_id_high = 0x0004009B, + .titles = + { + { + .name = "CFL_Res.dat", + .title_id_lows = {0x00010202, 0x00010202, 0x00010202, 0x00010202, + 0x00010202, 0x00010202, 0x00010202}, + }, + { + .name = "Region Manifest", + .title_id_lows = {0x00010402, 0x00010402, 0x00010402, 0x00010402, + 0x00010402, 0x00010402, 0x00010402}, + }, + { + .name = "Public Root-CA Certificates", + .sets = SystemTitleSet::Old3ds | SystemTitleSet::New3ds | + SystemTitleSet::Minimal, + .title_id_lows = {0x00010602, 0x00010602, 0x00010602, 0x00010602, + 0x00010602, 0x00010602, 0x00010602}, + }, + { + .name = "CHN/CN Dictionary", + .title_id_lows = {0, 0, 0, 0, 0x00011002, 0, 0}, + }, + { + .name = "TWN/TN Dictionary", + .title_id_lows = {0, 0, 0, 0, 0, 0, 0x00011102}, + }, + { + .name = "NL/NL Dictionary", + .title_id_lows = {0, 0, 0x00011202, 0x00011202, 0, 0, 0}, + }, + { + .name = "EN/GB Dictionary", + .title_id_lows = {0, 0, 0x00011302, 0x00011302, 0, 0, 0}, + }, + { + .name = "EN/US Dictionary", + .title_id_lows = {0, 0x00011402, 0, 0, 0, 0, 0}, + }, + { + .name = "FR/FR/regular Dictionary", + .title_id_lows = {0, 0, 0x00011502, 0x00011502, 0, 0, 0}, + }, + { + .name = "FR/CA/regular Dictionary", + .title_id_lows = {0, 0x00011602, 0, 0, 0, 0, 0}, + }, + { + .name = "DE/regular Dictionary", + .title_id_lows = {0, 0, 0x00011702, 0x00011702, 0, 0, 0}, + }, + { + .name = "IT/IT Dictionary", + .title_id_lows = {0, 0, 0x00011802, 0x00011802, 0, 0, 0}, + }, + { + .name = "JA_small/32 Dictionary", + .title_id_lows = {0x00011902, 0, 0, 0, 0, 0, 0}, + }, + { + .name = "KO/KO Dictionary", + .title_id_lows = {0, 0, 0, 0, 0, 0x00011A02, 0}, + }, + { + .name = "PT/PT/regular Dictionary", + .title_id_lows = {0, 0, 0x00011B02, 0x00011B02, 0, 0, 0}, + }, + { + .name = "RU/regular Dictionary", + .title_id_lows = {0, 0, 0x00011C02, 0x00011C02, 0, 0, 0}, + }, + { + .name = "ES/ES Dictionary", + .title_id_lows = {0, 0x00011D02, 0x00011D02, 0x00011D02, 0, 0, 0}, + }, + { + .name = "PT/BR/regular Dictionary", + .title_id_lows = {0, 0x00011E02, 0, 0, 0, 0, 0}, + }, + { + .name = "Error Strings", + .title_id_lows = {0x00012202, 0x00012302, 0x00012102, 0x00012102, + 0x00012402, 0x00012502, 0x00012602}, + }, + { + .name = "EULA", + .title_id_lows = {0x00013202, 0x00013302, 0x00013102, 0x00013102, + 0x00013502, 0, 0}, + }, + { + .name = "JPN/EUR/USA System Font", + .sets = SystemTitleSet::Old3ds | SystemTitleSet::New3ds | + SystemTitleSet::Minimal, + .title_id_lows = {0x00014002, 0x00014002, 0x00014002, 0x00014002, + 0x00014002, 0x00014002, 0x00014002}, + }, + { + .name = "CHN System Font", + .sets = SystemTitleSet::Old3ds | SystemTitleSet::New3ds | + SystemTitleSet::Minimal, + .title_id_lows = {0x00014102, 0x00014102, 0x00014102, 0x00014102, + 0x00014102, 0x00014102, 0x00014102}, + }, + { + .name = "KOR System Font", + .sets = SystemTitleSet::Old3ds | SystemTitleSet::New3ds | + SystemTitleSet::Minimal, + .title_id_lows = {0x00014202, 0x00014202, 0x00014202, 0x00014202, + 0x00014202, 0x00014202, 0x00014202}, + }, + { + .name = "TWN System Font", + .sets = SystemTitleSet::Old3ds | SystemTitleSet::New3ds | + SystemTitleSet::Minimal, + .title_id_lows = {0x00014302, 0x00014302, 0x00014302, 0x00014302, + 0x00014302, 0x00014302, 0x00014302}, + }, + { + .name = "Rate", + .title_id_lows = {0x00015202, 0x00015302, 0x00015102, 0x00015102, 0, + 0x00015502, 0x0015602}, + }, + }}, + {.name = "System Data Archives", + .title_id_high = 0x000400DB, + .titles = + { + { + .name = "NGWord List", + .title_id_lows = {0x00010302, 0x00010302, 0x00010302, 0x00010302, + 0x00010302, 0x00010302, 0x00010302}, + }, + { + .name = "Nintendo Zone Hotspot List", + .title_id_lows = {0x00010502, 0x00010502, 0x00010502, 0x00010502, + 0x00010502, 0x00010502, 0x00010502}, + }, + { + .name = "NVer (O3DS)", + .sets = SystemTitleSet::Old3ds, + .title_id_lows = {0x00016202, 0x00016302, 0x00016102, 0x00016102, + 0x00016402, 0x00016502, 0x00016602}, + }, + { + .name = "NVer (N3DS)", + .sets = SystemTitleSet::New3ds, + .title_id_lows = {0x20016202, 0x20016302, 0x20016102, 0x20016102, 0, + 0x20016502, 0}, + }, + { + .name = "CVer", + .title_id_lows = {0x00017202, 0x00017302, 0x00017102, 0x00017102, + 0x00017402, 0x00017502, 0x00017602}, + }, + }}, + {.name = "System Modules", + .title_id_high = 0x00040130, + .titles = + { + { + .name = "AM Module", + .title_id_lows = {0x00001502, 0x00001502, 0x00001502, 0x00001502, + 0x00001502, 0x00001502, 0x00001502}, + }, + { + .name = "AM Module (Safe Mode, O3DS)", + .sets = SystemTitleSet::Old3ds, + .title_id_lows = {0x00001503, 0x00001503, 0x00001503, 0x00001503, + 0x00001503, 0x00001503, 0x00001503}, + }, + { + .name = "AM Module (Safe Mode, N3DS)", + .sets = SystemTitleSet::New3ds, + .title_id_lows = {0x20001503, 0x20001503, 0x20001503, 0x20001503, + 0x20001503, 0x20001503, 0x20001503}, + }, + { + .name = "Camera Module (O3DS)", + .sets = SystemTitleSet::Old3ds, + .title_id_lows = {0x00001602, 0x00001602, 0x00001602, 0x00001602, + 0x00001602, 0x00001602, 0x00001602}, + }, + { + .name = "Camera Module (N3DS)", + .sets = SystemTitleSet::New3ds, + .title_id_lows = {0x20001602, 0x20001602, 0x20001602, 0x20001602, + 0x20001602, 0x20001602, 0x20001602}, + }, + { + .name = "Config Module", + .title_id_lows = {0x00001702, 0x00001702, 0x00001702, 0x00001702, + 0x00001702, 0x00001702, 0x00001702}, + }, + { + .name = "Config Module (Safe Mode, O3DS)", + .sets = SystemTitleSet::Old3ds, + .title_id_lows = {0x00001703, 0x00001703, 0x00001703, 0x00001703, + 0x00001703, 0x00001703, 0x00001503}, + }, + { + .name = "Config Module (Safe Mode, N3DS)", + .sets = SystemTitleSet::New3ds, + .title_id_lows = {0x20001703, 0x20001703, 0x20001703, 0x20001703, + 0x20001703, 0x20001703, 0x20001703}, + }, + { + .name = "Codec Module", + .title_id_lows = {0x00001802, 0x00001802, 0x00001802, 0x00001802, + 0x00001802, 0x00001802, 0x00001802}, + }, + { + .name = "Codec Module (Safe Mode, O3DS)", + .sets = SystemTitleSet::Old3ds, + .title_id_lows = {0x00001803, 0x00001803, 0x00001803, 0x00001803, + 0x00001803, 0x00001803, 0x00001803}, + }, + { + .name = "Codec Module (Safe Mode, N3DS)", + .sets = SystemTitleSet::New3ds, + .title_id_lows = {0x20001803, 0x20001803, 0x20001803, 0x20001803, + 0x20001803, 0x20001803, 0x20001803}, + }, + { + .name = "DSP Module", + .title_id_lows = {0x00001A02, 0x00001A02, 0x00001A02, 0x00001A02, + 0x00001A02, 0x00001A02, 0x00001A02}, + }, + { + .name = "DSP Module (Safe Mode, O3DS)", + .sets = SystemTitleSet::Old3ds, + .title_id_lows = {0x00001A03, 0x00001A03, 0x00001A03, 0x00001A03, + 0x00001A03, 0x00001A03, 0x00001A03}, + }, + { + .name = "DSP Module (Safe Mode, N3DS)", + .sets = SystemTitleSet::New3ds, + .title_id_lows = {0x20001A03, 0x20001A03, 0x20001A03, 0x20001A03, + 0x20001A03, 0x20001A03, 0x20001A03}, + }, + { + .name = "GPIO Module", + .title_id_lows = {0x00001B02, 0x00001B02, 0x00001B02, 0x00001B02, + 0x00001B02, 0x00001B02, 0x00001B02}, + }, + { + .name = "GPIO Module (Safe Mode, O3DS)", + .sets = SystemTitleSet::Old3ds, + .title_id_lows = {0x00001B03, 0x00001B03, 0x00001B03, 0x00001B03, + 0x00001B03, 0x00001B03, 0x00001B03}, + }, + { + .name = "GPIO Module (Safe Mode, N3DS)", + .sets = SystemTitleSet::New3ds, + .title_id_lows = {0x20001B03, 0x20001B03, 0x20001B03, 0x20001B03, + 0x20001B03, 0x20001B03, 0x20001B03}, + }, + { + .name = "GSP Module (O3DS)", + .sets = SystemTitleSet::Old3ds, + .title_id_lows = {0x00001C02, 0x00001C02, 0x00001C02, 0x00001C02, + 0x00001C02, 0x00001C02, 0x00001C02}, + }, + { + .name = "GSP Module (N3DS)", + .sets = SystemTitleSet::New3ds, + .title_id_lows = {0x20001C02, 0x20001C02, 0x20001C02, 0x20001C02, + 0x20001C02, 0x20001C02, 0x20001C02}, + }, + { + .name = "GSP Module (Safe Mode, O3DS)", + .sets = SystemTitleSet::Old3ds, + .title_id_lows = {0x00001C03, 0x00001C03, 0x00001C03, 0x00001C03, + 0x00001C03, 0x00001C03, 0x00001C03}, + }, + { + .name = "GSP Module (Safe Mode, N3DS)", + .sets = SystemTitleSet::New3ds, + .title_id_lows = {0x20001C03, 0x20001C03, 0x20001C03, 0x20001C03, + 0x20001C03, 0x20001C03, 0x20001C03}, + }, + { + .name = "HID Module", + .title_id_lows = {0x00001D02, 0x00001D02, 0x00001D02, 0x00001D02, + 0x00001D02, 0x00001D02, 0x00001D02}, + }, + { + .name = "HID Module (Safe Mode, O3DS)", + .sets = SystemTitleSet::Old3ds, + .title_id_lows = {0x00001D03, 0x00001D03, 0x00001D03, 0x00001D03, + 0x00001D03, 0x00001D03, 0x00001D03}, + }, + { + .name = "HID Module (Safe Mode, N3DS)", + .sets = SystemTitleSet::New3ds, + .title_id_lows = {0x20001D03, 0x20001D03, 0x20001D03, 0x20001D03, + 0x20001D03, 0x20001D03, 0x20001D03}, + }, + { + .name = "I2C Module (O3DS)", + .sets = SystemTitleSet::Old3ds, + .title_id_lows = {0x00001E02, 0x00001E02, 0x00001E02, 0x00001E02, + 0x00001E02, 0x00001E02, 0x00001E02}, + }, + { + .name = "I2C Module (N3DS)", + .sets = SystemTitleSet::New3ds, + .title_id_lows = {0x20001E02, 0x20001E02, 0x20001E02, 0x20001E02, + 0x20001E02, 0x20001E02, 0x20001E02}, + }, + { + .name = "I2C Module (Safe Mode, O3DS)", + .sets = SystemTitleSet::Old3ds, + .title_id_lows = {0x00001E03, 0x00001E03, 0x00001E03, 0x00001E03, + 0x00001E03, 0x00001E03, 0x00001E03}, + }, + { + .name = "I2C Module (Safe Mode, N3DS)", + .sets = SystemTitleSet::New3ds, + .title_id_lows = {0x20001E03, 0x20001E03, 0x20001E03, 0x20001E03, + 0x20001E03, 0x20001E03, 0x20001E03}, + }, + { + .name = "MCU Module (O3DS)", + .sets = SystemTitleSet::Old3ds, + .title_id_lows = {0x00001F02, 0x00001F02, 0x00001F02, 0x00001F02, + 0x00001F02, 0x00001F02, 0x00001F02}, + }, + { + .name = "MCU Module (N3DS)", + .sets = SystemTitleSet::New3ds, + .title_id_lows = {0x20001F02, 0x20001F02, 0x20001F02, 0x20001F02, + 0x20001F02, 0x20001F02, 0x20001F02}, + }, + { + .name = "MCU Module (Safe Mode, O3DS)", + .sets = SystemTitleSet::Old3ds, + .title_id_lows = {0x00001F03, 0x00001F03, 0x00001F03, 0x00001F03, + 0x00001F03, 0x00001F03, 0x00001F03}, + }, + { + .name = "MCU Module (Safe Mode, N3DS)", + .sets = SystemTitleSet::New3ds, + .title_id_lows = {0x20001F03, 0x20001F03, 0x20001F03, 0x20001F03, + 0x20001F03, 0x20001F03, 0x20001F03}, + }, + { + .name = "MIC Module", + .title_id_lows = {0x00002002, 0x00002002, 0x00002002, 0x00002002, + 0x00002002, 0x00002002, 0x00002002}, + }, + { + .name = "PDN Module", + .title_id_lows = {0x00002102, 0x00002102, 0x00002102, 0x00002102, + 0x00002102, 0x00002102, 0x00002102}, + }, + { + .name = "PDN Module (Safe Mode, O3DS)", + .sets = SystemTitleSet::Old3ds, + .title_id_lows = {0x00002103, 0x00002103, 0x00002103, 0x00002103, + 0x00002103, 0x00002103, 0x00002103}, + }, + { + .name = "PDN Module (Safe Mode, N3DS)", + .sets = SystemTitleSet::New3ds, + .title_id_lows = {0x20002103, 0x20002103, 0x20002103, 0x20002103, + 0x20002103, 0x20002103, 0x20002103}, + }, + { + .name = "PTM Module (O3DS)", + .sets = SystemTitleSet::Old3ds, + .title_id_lows = {0x00002202, 0x00002202, 0x00002202, 0x00002202, + 0x00002202, 0x00002202, 0x00002202}, + }, + { + .name = "PTM Module (N3DS)", + .sets = SystemTitleSet::New3ds, + .title_id_lows = {0x20002202, 0x20002202, 0x20002202, 0x20002202, + 0x20002202, 0x20002202, 0x20002202}, + }, + { + .name = "PTM Module (Safe Mode, O3DS)", + .sets = SystemTitleSet::Old3ds, + .title_id_lows = {0x00002203, 0x00002203, 0x00002203, 0x00002203, + 0x00002203, 0x00002203, 0x00002203}, + }, + { + .name = "PTM Module (Safe Mode, N3DS)", + .sets = SystemTitleSet::New3ds, + .title_id_lows = {0x20002203, 0x20002203, 0x20002203, 0x20002203, + 0x20002203, 0x20002203, 0x20002203}, + }, + { + .name = "SPI Module (O3DS)", + .sets = SystemTitleSet::Old3ds, + .title_id_lows = {0x00002302, 0x00002302, 0x00002302, 0x00002302, + 0x00002302, 0x00002302, 0x00002302}, + }, + { + .name = "SPI Module (N3DS)", + .sets = SystemTitleSet::New3ds, + .title_id_lows = {0x20002302, 0x20002302, 0x20002302, 0x20002302, + 0x20002302, 0x20002302, 0x20002302}, + }, + { + .name = "SPI Module (Safe Mode, O3DS)", + .sets = SystemTitleSet::Old3ds, + .title_id_lows = {0x00002303, 0x00002303, 0x00002303, 0x00002303, + 0x00002303, 0x00002303, 0x00002303}, + }, + { + .name = "SPI Module (Safe Mode, N3DS)", + .sets = SystemTitleSet::New3ds, + .title_id_lows = {0x20002303, 0x20002303, 0x20002303, 0x20002303, + 0x20002303, 0x20002303, 0x20002303}, + }, + { + .name = "AC Module", + .title_id_lows = {0x00002402, 0x00002402, 0x00002402, 0x00002402, + 0x00002402, 0x00002402, 0x00002402}, + }, + { + .name = "AC Module (Safe Mode, O3DS)", + .sets = SystemTitleSet::Old3ds, + .title_id_lows = {0x00002403, 0x00002403, 0x00002403, 0x00002403, + 0x00002403, 0x00002403, 0x00002403}, + }, + { + .name = "AC Module (Safe Mode, N3DS)", + .sets = SystemTitleSet::New3ds, + .title_id_lows = {0x20002403, 0x20002403, 0x20002403, 0x20002403, + 0x20002403, 0x20002403, 0x20002403}, + }, + { + .name = "CECD Module", + .title_id_lows = {0x00002602, 0x00002602, 0x00002602, 0x00002602, + 0x00002602, 0x00002602, 0x00002602}, + }, + { + .name = "CSND Module", + .title_id_lows = {0x00002702, 0x00002702, 0x00002702, 0x00002702, + 0x00002702, 0x00002702, 0x00002702}, + }, + { + .name = "CSND Module (Safe Mode, O3DS)", + .sets = SystemTitleSet::Old3ds, + .title_id_lows = {0x00002703, 0x00002703, 0x00002703, 0x00002703, + 0x00002703, 0x00002703, 0x00002703}, + }, + { + .name = "CSND Module (Safe Mode, N3DS)", + .sets = SystemTitleSet::New3ds, + .title_id_lows = {0x20002703, 0x20002703, 0x20002703, 0x20002703, + 0x20002703, 0x20002703, 0x20002703}, + }, + { + .name = "DLP Module", + .title_id_lows = {0x00002802, 0x00002802, 0x00002802, 0x00002802, + 0x00002802, 0x00002802, 0x00002802}, + }, + { + .name = "HTTP Module", + .title_id_lows = {0x00002902, 0x00002902, 0x00002902, 0x00002902, + 0x00002902, 0x00002902, 0x00002902}, + }, + { + .name = "HTTP Module (Safe Mode, O3DS)", + .sets = SystemTitleSet::Old3ds, + .title_id_lows = {0x00002903, 0x00002903, 0x00002903, 0x00002903, + 0x00002903, 0x00002903, 0x00002903}, + }, + { + .name = "HTTP Module (Safe Mode, N3DS)", + .sets = SystemTitleSet::New3ds, + .title_id_lows = {0x20002903, 0x20002903, 0x20002903, 0x20002903, + 0x20002903, 0x20002903, 0x20002903}, + }, + { + .name = "MP Module", + .title_id_lows = {0x00002A02, 0x00002A02, 0x00002A02, 0x00002A02, + 0x00002A02, 0x00002A02, 0x00002A02}, + }, + { + .name = "MP Module (Safe Mode)", + .title_id_lows = {0x00002A03, 0x00002A03, 0x00002A03, 0x00002A03, + 0x00002A03, 0x00002A03, 0x00002A03}, + }, + { + .name = "NDM Module", + .title_id_lows = {0x00002B02, 0x00002B02, 0x00002B02, 0x00002B02, + 0x00002B02, 0x00002B02, 0x00002B02}, + }, + { + .name = "NIM Module", + .title_id_lows = {0x00002C02, 0x00002C02, 0x00002C02, 0x00002C02, + 0x00002C02, 0x00002C02, 0x00002C02}, + }, + { + .name = "NIM Module (Safe Mode, O3DS)", + .sets = SystemTitleSet::Old3ds, + .title_id_lows = {0x00002C03, 0x00002C03, 0x00002C03, 0x00002C03, + 0x00002C03, 0x00002C03, 0x00002C03}, + }, + { + .name = "NIM Module (Safe Mode, N3DS)", + .sets = SystemTitleSet::New3ds, + .title_id_lows = {0x20002C03, 0x20002C03, 0x20002C03, 0x20002C03, + 0x20002C03, 0x20002C03, 0x20002C03}, + }, + { + .name = "NWM Module", + .title_id_lows = {0x00002D02, 0x00002D02, 0x00002D02, 0x00002D02, + 0x00002D02, 0x00002D02, 0x00002D02}, + }, + { + .name = "NWM Module (Safe Mode, O3DS)", + .sets = SystemTitleSet::Old3ds, + .title_id_lows = {0x00002D03, 0x00002D03, 0x00002D03, 0x00002D03, + 0x00002D03, 0x00002D03, 0x00002D03}, + }, + { + .name = "NWM Module (Safe Mode, N3DS)", + .sets = SystemTitleSet::New3ds, + .title_id_lows = {0x20002D03, 0x20002D03, 0x20002D03, 0x20002D03, + 0x20002D03, 0x20002D03, 0x20002D03}, + }, + { + .name = "Sockets Module", + .title_id_lows = {0x00002E02, 0x00002E02, 0x00002E02, 0x00002E02, + 0x00002E02, 0x00002E02, 0x00002E02}, + }, + { + .name = "Sockets Module (Safe Mode, O3DS)", + .sets = SystemTitleSet::Old3ds, + .title_id_lows = {0x00002E03, 0x00002E03, 0x00002E03, 0x00002E03, + 0x00002E03, 0x00002E03, 0x00002E03}, + }, + { + .name = "Sockets Module (Safe Mode, N3DS)", + .sets = SystemTitleSet::New3ds, + .title_id_lows = {0x20002E03, 0x20002E03, 0x20002E03, 0x20002E03, + 0x20002E03, 0x20002E03, 0x20002E03}, + }, + { + .name = "SSL Module", + .title_id_lows = {0x00002F02, 0x00002F02, 0x00002F02, 0x00002F02, + 0x00002F02, 0x00002F02, 0x00002F02}, + }, + { + .name = "SSL Module (Safe Mode, O3DS)", + .sets = SystemTitleSet::Old3ds, + .title_id_lows = {0x00002F03, 0x00002F03, 0x00002F03, 0x00002F03, + 0x00002F03, 0x00002F03, 0x00002F03}, + }, + { + .name = "SSL Module (Safe Mode, N3DS)", + .sets = SystemTitleSet::New3ds, + .title_id_lows = {0x20002F03, 0x20002F03, 0x20002F03, 0x20002F03, + 0x20002F03, 0x20002F03, 0x20002F03}, + }, + { + .name = "PS Module", + .title_id_lows = {0x00003102, 0x00003102, 0x00003102, 0x00003102, + 0x00003102, 0x00003102, 0x00003102}, + }, + { + .name = "PS Module (Safe Mode, O3DS)", + .sets = SystemTitleSet::Old3ds, + .title_id_lows = {0x00003103, 0x00003103, 0x00003103, 0x00003103, + 0x00003103, 0x00003103, 0x00003103}, + }, + { + .name = "PS Module (Safe Mode, N3DS)", + .sets = SystemTitleSet::New3ds, + .title_id_lows = {0x20003103, 0x20003103, 0x20003103, 0x20003103, + 0x20003103, 0x20003103, 0x20003103}, + }, + { + .name = "Friends Module", + .title_id_lows = {0x00003202, 0x00003202, 0x00003202, 0x00003202, + 0x00003202, 0x00003202, 0x00003202}, + }, + { + .name = "Friends Module (Safe Mode, O3DS)", + .sets = SystemTitleSet::Old3ds, + .title_id_lows = {0x00003203, 0x00003203, 0x00003203, 0x00003203, + 0x00003203, 0x00003203, 0x00003203}, + }, + { + .name = "Friends Module (Safe Mode, N3DS)", + .sets = SystemTitleSet::New3ds, + .title_id_lows = {0x20003203, 0x20003203, 0x20003203, 0x20003203, + 0x20003203, 0x20003203, 0x20003203}, + }, + { + .name = "IR Module", + .title_id_lows = {0x00003302, 0x00003302, 0x00003302, 0x00003302, + 0x00003302, 0x00003302, 0x00003302}, + }, + { + .name = "IR Module (Safe Mode, O3DS)", + .sets = SystemTitleSet::Old3ds, + .title_id_lows = {0x00003303, 0x00003303, 0x00003303, 0x00003303, + 0x00003303, 0x00003303, 0x00003303}, + }, + { + .name = "IR Module (Safe Mode, N3DS)", + .sets = SystemTitleSet::New3ds, + .title_id_lows = {0x20003303, 0x20003303, 0x20003303, 0x20003303, + 0x20003303, 0x20003303, 0x20003303}, + }, + { + .name = "BOSS Module", + .title_id_lows = {0x00003402, 0x00003402, 0x00003402, 0x00003402, + 0x00003402, 0x00003402, 0x00003402}, + }, + { + .name = "News Module", + .title_id_lows = {0x00003502, 0x00003502, 0x00003502, 0x00003502, + 0x00003502, 0x00003502, 0x00003502}, + }, + { + .name = "RO Module", + .title_id_lows = {0x00003702, 0x00003702, 0x00003702, 0x00003702, + 0x00003702, 0x00003702, 0x00003702}, + }, + { + .name = "ACT Module", + .title_id_lows = {0x00003802, 0x00003802, 0x00003802, 0x00003802, + 0x00003802, 0x00003802, 0x00003802}, + }, + { + .name = "NFC Module (O3DS)", + .sets = SystemTitleSet::Old3ds, + .title_id_lows = {0x00004002, 0x00004002, 0x00004002, 0x00004002, + 0x00004002, 0x00004002, 0x00004002}, + }, + { + .name = "NFC Module (N3DS)", + .sets = SystemTitleSet::New3ds, + .title_id_lows = {0x20004002, 0x20004002, 0x20004002, 0x20004002, + 0x20004002, 0x20004002, 0x20004002}, + }, + { + .name = "MVD Module (N3DS)", + .sets = SystemTitleSet::New3ds, + .title_id_lows = {0x20004102, 0x20004102, 0x20004102, 0x20004102, + 0x20004102, 0x20004102, 0x20004102}, + }, + { + .name = "QTM Module (N3DS)", + .sets = SystemTitleSet::New3ds, + .title_id_lows = {0x20004202, 0x20004202, 0x20004202, 0x20004202, + 0x20004202, 0x20004202, 0x20004202}, + }, + { + .name = "NS Module", + .title_id_lows = {0x00008002, 0x00008002, 0x00008002, 0x00008002, + 0x00008002, 0x00008002, 0x00008002}, + }, + { + .name = "NS Module (Safe Mode, O3DS)", + .sets = SystemTitleSet::Old3ds, + .title_id_lows = {0x00008003, 0x00008003, 0x00008003, 0x00008003, + 0x00008003, 0x00008003, 0x00008003}, + }, + { + .name = "NS Module (Safe Mode, N3DS)", + .sets = SystemTitleSet::New3ds, + .title_id_lows = {0x20008003, 0x20008003, 0x20008003, 0x20008003, + 0x20008003, 0x20008003, 0x20008003}, + }, + }}, + {.name = "System Firmware", + .title_id_high = 0x00040138, + .titles = + { + { + .name = "NATIVE_FIRM (O3DS)", + .sets = SystemTitleSet::Old3ds | SystemTitleSet::Minimal, + .title_id_lows = {0x00000002, 0x00000002, 0x00000002, 0x00000002, + 0x00000002, 0x00000002, 0x00000002}, + }, + { + .name = "NATIVE_FIRM (N3DS)", + .sets = SystemTitleSet::New3ds | SystemTitleSet::Minimal, + .title_id_lows = {0x20000002, 0x20000002, 0x20000002, 0x20000002, + 0x20000002, 0x20000002, 0x20000002}, + }, + { + .name = "SAFE_MODE_FIRM (O3DS)", + .sets = SystemTitleSet::Old3ds | SystemTitleSet::Minimal, + .title_id_lows = {0x00000003, 0x00000003, 0x00000003, 0x00000003, + 0x00000003, 0x00000003, 0x00000003}, + }, + { + .name = "SAFE_MODE_FIRM (N3DS)", + .sets = SystemTitleSet::New3ds | SystemTitleSet::Minimal, + .title_id_lows = {0x20000003, 0x20000003, 0x20000003, 0x20000003, + 0x20000003, 0x20000003, 0x20000003}, + }, + { + .name = "TWL_FIRM (O3DS)", + .sets = SystemTitleSet::Old3ds, + .title_id_lows = {0x00000102, 0x00000102, 0x00000102, 0x00000102, + 0x00000102, 0x00000102, 0x00000102}, + }, + { + .name = "TWL_FIRM (N3DS)", + .sets = SystemTitleSet::New3ds, + .title_id_lows = {0x20000102, 0x20000102, 0x20000102, 0x20000102, + 0x20000102, 0x20000102, 0x20000102}, + }, + { + .name = "AGB_FIRM (O3DS)", + .sets = SystemTitleSet::Old3ds, + .title_id_lows = {0x00000202, 0x00000202, 0x00000202, 0x00000202, + 0x00000202, 0x00000202, 0x00000202}, + }, + { + .name = "AGB_FIRM (N3DS)", + .sets = SystemTitleSet::New3ds, + .title_id_lows = {0x20000202, 0x20000202, 0x20000202, 0x20000202, + 0x20000202, 0x20000202, 0x20000202}, + }, + }}, + }}; + +std::vector GetSystemTitleIds(SystemTitleSet set, u32 region) { + std::vector title_ids; + for (const auto& category : system_titles) { + for (const auto& title : category.titles) { + if ((title.sets & set) != 0 && title.title_id_lows[region] != 0) { + title_ids.push_back((static_cast(category.title_id_high) << 32) | + static_cast(title.title_id_lows[region])); + } + } + } + + return title_ids; +} + +u64 GetHomeMenuTitleId(u32 region) { + return (static_cast(home_menu_title_id_high) << 32) | + static_cast(home_menu_title.title_id_lows[region]); +} + +std::string GetHomeMenuNcchPath(u32 region) { + return Service::AM::GetTitleContentPath(Service::FS::MediaType::NAND, + GetHomeMenuTitleId(region)); +} + +std::optional GetSystemTitleRegion(u64 title_id) { + const auto title_id_high = static_cast(title_id >> 32); + const auto category = std::find_if(system_titles.begin(), system_titles.end(), + [title_id_high](const SystemTitleCategory& category) { + return category.title_id_high == title_id_high; + }); + if (category == system_titles.end()) { + return std::nullopt; + } + + const auto title_id_low = static_cast(title_id & 0xFFFFFFFF); + for (const auto& title : category->titles) { + for (u32 region = 0; region < NUM_SYSTEM_TITLE_REGIONS; region++) { + if (title.title_id_lows[region] == title_id_low) { + return region; + } + } + } + + return std::nullopt; +} + +} // namespace Core diff --git a/src/core/system_titles.h b/src/core/system_titles.h new file mode 100644 index 000000000..6a0b343e0 --- /dev/null +++ b/src/core/system_titles.h @@ -0,0 +1,28 @@ +// Copyright 2023 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include +#include "common/common_types.h" + +namespace Core { + +constexpr u32 NUM_SYSTEM_TITLE_REGIONS = 7; + +enum SystemTitleSet : u32 { Minimal = 1 << 0, Old3ds = 1 << 1, New3ds = 1 << 2 }; + +/// Returns a list of firmware title IDs for a specific set and region. +std::vector GetSystemTitleIds(SystemTitleSet set, u32 region); + +/// Gets the home menu title ID for a specific region. +u64 GetHomeMenuTitleId(u32 region); + +/// Gets the home menu NCCH path for a specific region. +std::string GetHomeMenuNcchPath(u32 region); + +/// Returns the region of a system title, if it can be determined. +std::optional GetSystemTitleRegion(u64 title_id); + +} // namespace Core diff --git a/src/web_service/CMakeLists.txt b/src/web_service/CMakeLists.txt index 553b36298..9082a0118 100644 --- a/src/web_service/CMakeLists.txt +++ b/src/web_service/CMakeLists.txt @@ -3,7 +3,6 @@ add_library(web_service STATIC announce_room_json.h nus_download.cpp nus_download.h - nus_titles.h precompiled_headers.h telemetry_json.cpp telemetry_json.h diff --git a/src/web_service/nus_titles.h b/src/web_service/nus_titles.h deleted file mode 100644 index fe7b6d183..000000000 --- a/src/web_service/nus_titles.h +++ /dev/null @@ -1,761 +0,0 @@ -// Copyright 2023 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#pragma once - -#include "common/common_types.h" - -constexpr u32 SYSTEM_FIRMWARE_UPPER_TITLE_ID = 0x00040138; -constexpr u32 SYSTEM_APPLICATION_UPPER_TITLE_ID = 0x00040010; -constexpr u32 SYSTEM_DATA_ARCHIVE_UPPER_TITLE_ID = 0x0004001B; -constexpr u32 SYSTEM_APPLET_UPPER_TITLE_ID = 0x00040030; -constexpr u32 SHARED_DATA_ARCHIVE_UPPER_TITLE_ID = 0x0004009B; -constexpr u32 SYSTEM_DATA_ARCHIVE_2_UPPER_TITLE_ID = 0x000400DB; -constexpr u32 SYSTEM_MODULE_UPPER_TITLE_ID = 0x00040130; - -struct Title { - enum Mode { All, Recommended, Minimal }; - std::string name; - u32 upper_title_id; - std::array lower_title_id; - Mode mode = Mode::All; -}; - -static const std::array SYSTEM_FIRMWARE = { - {{"Safe Mode Native Firmware", - SYSTEM_FIRMWARE_UPPER_TITLE_ID, - {{0x00000003, 0x00000003, 0x00000003, 0x00000003, 0x00000003, 0x00000003}}, - Title::Mode::Minimal}, - {"New_3DS Safe Mode Native Firmware", - SYSTEM_FIRMWARE_UPPER_TITLE_ID, - {{0x20000003, 0x20000003, 0x20000003, 0x20000003, 0x20000003, 0x20000003}}, - Title::Mode::Minimal}, - {"Native Firmware", - SYSTEM_FIRMWARE_UPPER_TITLE_ID, - {{0x00000002, 0x00000002, 0x00000002, 0x00000002, 0x00000002, 0x00000002}}, - Title::Mode::Minimal}, - {"New_3DS Native Firmware", - SYSTEM_FIRMWARE_UPPER_TITLE_ID, - {{0x20000002, 0x20000002, 0x20000002, 0x20000002, 0x20000002, 0x20000002}}, - Title::Mode::Minimal}}}; -static const std::array SYSTEM_APPLICATIONS = { - {{"System Settings", - SYSTEM_APPLICATION_UPPER_TITLE_ID, - {{0x00020000, 0x00021000, 0x00022000, 0x00026000, 0x00027000, 0x00028000}}, - Title::Mode::All}, - {"Download Play", - SYSTEM_APPLICATION_UPPER_TITLE_ID, - {{0x00020100, 0x00021100, 0x00022100, 0x00026100, 0x00027100, 0x00028100}}, - Title::Mode::Recommended}, - {"Activity Log", - SYSTEM_APPLICATION_UPPER_TITLE_ID, - {{0x00020200, 0x00021200, 0x00022200, 0x00026200, 0x00027200, 0x00028200}}, - Title::Mode::All}, - {"Health and Safety Information", - SYSTEM_APPLICATION_UPPER_TITLE_ID, - {{0x00020300, 0x00021300, 0x00022300, 0x00026300, 0x00027300, 0x00028300}}, - Title::Mode::All}, - {"New_3DS Health and Safety Information", - SYSTEM_APPLICATION_UPPER_TITLE_ID, - {{0x20020300, 0x20021300, 0x20022300, 0x0, 0x20027300, 0x0}}, - Title::Mode::All}, - {"Nintendo 3DS Camera", - SYSTEM_APPLICATION_UPPER_TITLE_ID, - {{0x00020400, 0x00021400, 0x00022400, 0x00026400, 0x00027400, 0x00028400}}, - Title::Mode::All}, - {"Nintendo 3DS Sound", - SYSTEM_APPLICATION_UPPER_TITLE_ID, - {{0x00020500, 0x00021500, 0x00022500, 0x00026500, 0x00027500, 0x00028500}}, - Title::Mode::All}, - {"Mii Maker", - SYSTEM_APPLICATION_UPPER_TITLE_ID, - {{0x00020700, 0x00021700, 0x00022700, 0x00026700, 0x00027700, 0x00028700}}, - Title::Mode::Recommended}, - {"StreetPass Mii Plaza", - SYSTEM_APPLICATION_UPPER_TITLE_ID, - {{0x00020800, 0x00021800, 0x00022800, 0x00026800, 0x00027800, 0x00028800}}, - Title::Mode::All}, - {"eShop", - SYSTEM_APPLICATION_UPPER_TITLE_ID, - {{0x00020900, 0x00021900, 0x00022900, 0x0, 0x00027900, 0x00028900}}, - Title::Mode::Recommended}, - {"System Transfer", - SYSTEM_APPLICATION_UPPER_TITLE_ID, - {{0x00020A00, 0x00021A00, 0x00022A00, 0x0, 0x00027A00, 0x00028A00}}, - Title::Mode::All}, - {"Nintendo Zone", - SYSTEM_APPLICATION_UPPER_TITLE_ID, - {{0x00020B00, 0x00021B00, 0x00022B00, 0x0, 0x0, 0x0}}, - Title::Mode::All}, - {"Face Raiders", - SYSTEM_APPLICATION_UPPER_TITLE_ID, - {{0x00020D00, 0x00021D00, 0x00022D00, 0x00026D00, 0x00027D00, 0x00028D00}}, - Title::Mode::All}, - {"New_3DS Face Raiders", - SYSTEM_APPLICATION_UPPER_TITLE_ID, - {{0x20020D00, 0x20021D00, 0x20022D00, 0x0, 0x20027D00, 0x0}}, - Title::Mode::All}, - {"AR Games", - SYSTEM_APPLICATION_UPPER_TITLE_ID, - {{0x00020E00, 0x00021E00, 0x00022E00, 0x00026E00, 0x00027E00, 0x00028E00}}, - Title::Mode::All}, - {"Nintendo Network ID Settings", - SYSTEM_APPLICATION_UPPER_TITLE_ID, - {{0x0002BF00, 0x0002C000, 0x0002C100, 0x0, 0x0, 0x0}}, - Title::Mode::Recommended}, - {"microSD Management", - SYSTEM_APPLICATION_UPPER_TITLE_ID, - {{0x20023100, 0x20024100, 0x20025100, 0x0, 0x0, 0x0}}, - Title::Mode::All}}}; - -static const std::array SYSTEM_DATA_ARCHIVES = { - {{"ClCertA", - SYSTEM_DATA_ARCHIVE_UPPER_TITLE_ID, - {{0x00010002, 0x00010002, 0x00010002, 0x00010002, 0x00010002, 0x00010002}}, - Title::Mode::Recommended}, - {"NS CFA", - SYSTEM_DATA_ARCHIVE_UPPER_TITLE_ID, - {{0x00010702, 0x00010702, 0x00010702, 0x00010702, 0x00010702, 0x00010702}}, - Title::Mode::All}, - {"dummy.txt", - SYSTEM_DATA_ARCHIVE_UPPER_TITLE_ID, - {{0x00010802, 0x00010802, 0x00010802, 0x00010802, 0x00010802, 0x00010802}}, - Title::Mode::All}, - {"CFA web-browser data", - SYSTEM_DATA_ARCHIVE_UPPER_TITLE_ID, - {{0x00018002, 0x00018002, 0x00018002, 0x00018002, 0x00018002, 0x00018002}}, - Title::Mode::All}, - {"local web-browser data", - SYSTEM_DATA_ARCHIVE_UPPER_TITLE_ID, - {{0x00018102, 0x00018102, 0x00018102, 0x00018102, 0x00018102, 0x00018102}}, - Title::Mode::All}, - {"webkit/OSS CROs", - SYSTEM_DATA_ARCHIVE_UPPER_TITLE_ID, - {{0x00018202, 0x00018202, 0x00018202, 0x00018202, 0x00018202, 0x00018202}}, - Title::Mode::All}, - {"Fangate_updater", - SYSTEM_DATA_ARCHIVE_UPPER_TITLE_ID, - {{0x00019002, 0x00019002, 0x00019002, 0x00019002, 0x00019002, 0x00019002}}, - Title::Mode::All}}}; - -static const std::array SYSTEM_APPLETS = { - {{"Home Menu", - SYSTEM_APPLET_UPPER_TITLE_ID, - {{0x00008202, 0x00008F02, 0x00009802, 0x0000A102, 0x0000A902, 0x0000B102}}, - Title::Mode::All}, - {"Camera applet", - SYSTEM_APPLET_UPPER_TITLE_ID, - {{0x00008402, 0x00009002, 0x00009902, 0x0000A202, 0x0000AA02, 0x0000B202}}, - Title::Mode::All}, - {"Instruction Manual", - SYSTEM_APPLET_UPPER_TITLE_ID, - {{0x00008602, 0x00009202, 0x00009B02, 0x0000A402, 0x0000AC02, 0x0000B402}}, - Title::Mode::Recommended}, - {"Game Notes", - SYSTEM_APPLET_UPPER_TITLE_ID, - {{0x00008702, 0x00009302, 0x00009C02, 0x0000A502, 0x0000AD02, 0x0000B502}}, - Title::Mode::All}, - {"Internet Browser", - SYSTEM_APPLET_UPPER_TITLE_ID, - {{0x00008802, 0x00009402, 0x00009D02, 0x0000A602, 0x0000AE02, 0x0000B602}}, - Title::Mode::All}, - {"New 3DS Internet Browser", - SYSTEM_APPLET_UPPER_TITLE_ID, - {{0x20008802, 0x20009402, 0x20009D02, 0x0, 0x2000AE02, 0x0}}, - Title::Mode::All}, - {"Fatal error viewer", - SYSTEM_APPLET_UPPER_TITLE_ID, - {{0x00008A02, 0x00008A02, 0x00008A02, 0x00008A02, 0x00008A02, 0x00008A02}}, - Title::Mode::All}, - {"Safe Mode Fatal error viewer", - SYSTEM_APPLET_UPPER_TITLE_ID, - {{0x00008A03, 0x00008A03, 0x00008A03, 0x00008A03, 0x00008A03, 0x00008A03}}, - Title::Mode::All}, - {"New 3DS Safe Mode Fatal error viewer", - SYSTEM_APPLET_UPPER_TITLE_ID, - {{0x20008A03, 0x20008A03, 0x20008A03, 0x0, 0x20008A03, 0x0}}, - Title::Mode::All}, - {"Friend List", - SYSTEM_APPLET_UPPER_TITLE_ID, - {{0x00008D02, 0x00009602, 0x00009F02, 0x0000A702, 0x0000AF02, 0x0000B702}}, - Title::Mode::Recommended}, - {"Notifications", - SYSTEM_APPLET_UPPER_TITLE_ID, - {{0x00008E02, 0x000009702, 0x0000A002, 0x0000A802, 0x0000B002, 0x0000B802}}, - Title::Mode::All}, - {"Software Keyboard", - SYSTEM_APPLET_UPPER_TITLE_ID, - {{0x00000C002, 0x0000C802, 0x0000D002, 0x0000D802, 0x0000DE02, 0x0000E402}}, - Title::Mode::Recommended}, - {"Safe Mode Software Keyboard", - SYSTEM_APPLET_UPPER_TITLE_ID, - {{0x00000C003, 0x0000C803, 0x0000D003, 0x0000D803, 0x0000DE03, 0x0000E403}}, - Title::Mode::All}, - {"New 3DS Safe Mode Software Keyboard", - SYSTEM_APPLET_UPPER_TITLE_ID, - {{0x2000C003, 0x2000C803, 0x2000D003, 0x0, 0x2000DE03, 0x0}}, - Title::Mode::All}, - {"Mii picker", - SYSTEM_APPLET_UPPER_TITLE_ID, - {{0x0000C102, 0x0000C902, 0x0000D102, 0x0000D902, 0x0000DF02, 0x0000E502}}, - Title::Mode::Recommended}, - {"Picture picker", - SYSTEM_APPLET_UPPER_TITLE_ID, - {{0x0000C302, 0x0000CB02, 0x0000D302, 0x0000DB02, 0x0000E102, 0x0000E702}}, - Title::Mode::All}, - {"Voice memo picker", - SYSTEM_APPLET_UPPER_TITLE_ID, - {{0x0000C402, 0x0000CC02, 0x0000D402, 0x0000DC02, 0x0000E202, 0x0000E802}}, - Title::Mode::All}, - {"Error display", - SYSTEM_APPLET_UPPER_TITLE_ID, - {{0x0000C502, 0x0000C502, 0x0000C502, 0x0000CF02, 0x0000CF02, 0x0000CF02}}, - Title::Mode::All}, - {"Safe mode error display", - SYSTEM_APPLET_UPPER_TITLE_ID, - {{0x0000C503, 0x0000C503, 0x0000C503, 0x0000CF03, 0x0000CF03, 0x0000CF03}}, - Title::Mode::All}, - {"New 3DS safe mode error display", - SYSTEM_APPLET_UPPER_TITLE_ID, - {{0x2000C503, 0x2000C503, 0x2000C503, 0x0, 0x2000CF03, 0x0}}, - Title::Mode::All}, - {"Circle Pad Pro test/calibration applet", - SYSTEM_APPLET_UPPER_TITLE_ID, - {{0x0000CD02, 0x0000CD02, 0x0000CD02, 0x0000D502, 0x0000D502, 0x0000D502}}, - Title::Mode::All}, - {"eShop applet", - SYSTEM_APPLET_UPPER_TITLE_ID, - {{0x0000C602, 0x0000CE02, 0x0000D602, 0x0, 0x0000E302, 0x0000E902}}, - Title::Mode::Recommended}, - {"Miiverse", - SYSTEM_APPLET_UPPER_TITLE_ID, - {{0x0000BC02, 0x0000BC02, 0x0000BC02, 0x0, 0x0, 0x0}}, - Title::Mode::All}, - {"Miiverse system library", - SYSTEM_APPLET_UPPER_TITLE_ID, - {{0x0000F602, 0x0000F602, 0x0000F602, 0x0, 0x0, 0x0}}, - Title::Mode::All}, - {"Miiverse-posting applet", - SYSTEM_APPLET_UPPER_TITLE_ID, - {{0x00008302, 0x00008B02, 0x0000BA02, 0x0, 0x0, 0x0}}, - Title::Mode::All}, - {"Amiibo Settings", - SYSTEM_APPLET_UPPER_TITLE_ID, - {{0x00009502, 0x00009E02, 0x0000B902, 0x0, 0x00008C02, 0x0000BF02}}, - Title::Mode::All}}}; - -static const std::array SHARED_DATA_ARCHIVES = { - {{"CFL_Res.dat", - SHARED_DATA_ARCHIVE_UPPER_TITLE_ID, - {{0x00010202, 0x00010202, 0x00010202, 0x00010202, 0x00010202, 0x00010202}}, - Title::Mode::All}, - {"Region Manifest", - SHARED_DATA_ARCHIVE_UPPER_TITLE_ID, - {{0x00010402, 0x00010402, 0x00010402, 0x00010402, 0x00010402, 0x00010402}}, - Title::Mode::All}, - {"Non-Nintendo TLS Root-CA Certificates", - SHARED_DATA_ARCHIVE_UPPER_TITLE_ID, - {{0x00010602, 0x00010602, 0x00010602, 0x00010602, 0x00010602, 0x00010602}}, - Title::Mode::Recommended}, - {"CHN/CN Dictionary", - SHARED_DATA_ARCHIVE_UPPER_TITLE_ID, - {{0x0, 0x0, 0x0, 0x00011002, 0x0, 0x0}}, - Title::Mode::All}, - {"TWN/TN dictionary", - SHARED_DATA_ARCHIVE_UPPER_TITLE_ID, - {{0x0, 0x0, 0x0, 0x0, 0x0, 0x00011102}}, - Title::Mode::All}, - {"NL/NL dictionary", - SHARED_DATA_ARCHIVE_UPPER_TITLE_ID, - {{0x0, 0x0, 0x00011202, 0x0, 0x0, 0x0}}, - Title::Mode::All}, - {"EN/GB dictionary", - SHARED_DATA_ARCHIVE_UPPER_TITLE_ID, - {{0x0, 0x0, 0x00011302, 0x0, 0x0, 0x0}}, - Title::Mode::All}, - {"EN/US dictionary", - SHARED_DATA_ARCHIVE_UPPER_TITLE_ID, - {{0x0, 0x00011402, 0x0, 0x0, 0x0, 0x0}}, - Title::Mode::All}, - {"FR/FR/regular dictionary", - SHARED_DATA_ARCHIVE_UPPER_TITLE_ID, - {{0x0, 0x0, 0x00011502, 0x0, 0x0, 0x0}}, - Title::Mode::All}, - {"FR/CA/regular dictionary", - SHARED_DATA_ARCHIVE_UPPER_TITLE_ID, - {{0x0, 0x00011602, 0x0, 0x0, 0x0, 0x0}}, - Title::Mode::All}, - {"DE/regular dictionary", - SHARED_DATA_ARCHIVE_UPPER_TITLE_ID, - {{0x0, 0x0, 0x00011702, 0x0, 0x0, 0x0}}, - Title::Mode::All}, - {"IT/IT dictionary", - SHARED_DATA_ARCHIVE_UPPER_TITLE_ID, - {{0x0, 0x0, 0x00011802, 0x0, 0x0, 0x0}}, - Title::Mode::All}, - {"JA_small/32 dictionary", - SHARED_DATA_ARCHIVE_UPPER_TITLE_ID, - {{0x00011902, 0x0, 0x0, 0x0, 0x0, 0x0}}, - Title::Mode::All}, - {"KO/KO dictionary", - SHARED_DATA_ARCHIVE_UPPER_TITLE_ID, - {{0x0, 0x0, 0x0, 0x0, 0x00011A02, 0x0}}, - Title::Mode::All}, - {"PT/PT/regular dictionary", - SHARED_DATA_ARCHIVE_UPPER_TITLE_ID, - {{0x0, 0x0, 0x00011B02, 0x0, 0x0, 0x0}}, - Title::Mode::All}, - {"RU/regular dictionary", - SHARED_DATA_ARCHIVE_UPPER_TITLE_ID, - {{0x0, 0x0, 0x00011C02, 0x0, 0x0, 0x0}}, - Title::Mode::All}, - {"ES/ES dictionary", - SHARED_DATA_ARCHIVE_UPPER_TITLE_ID, - {{0x0, 0x00011D02, 0x00011D02, 0x0, 0x0, 0x0}}, - Title::Mode::All}, - {"PT/BR/regular dictionary", - SHARED_DATA_ARCHIVE_UPPER_TITLE_ID, - {{0x0, 0x00011E02, 0x0, 0x0, 0x0, 0x0}}, - Title::Mode::All}, - {"error strings", - SHARED_DATA_ARCHIVE_UPPER_TITLE_ID, - {{0x00012202, 0x00012302, 0x00012102, 0x00012402, 0x00012502, 0x00012602}}, - Title::Mode::All}, - {"eula", - SHARED_DATA_ARCHIVE_UPPER_TITLE_ID, - {{0x00013202, 0x00013302, 0x00013102, 0x00013502, 0x0, 0x0}}, - Title::Mode::All}, - {"JPN/EUR/USA System Font", - SHARED_DATA_ARCHIVE_UPPER_TITLE_ID, - {{0x00014002, 0x00014002, 0x00014002, 0x00014002, 0x00014002, 0x00014002}}, - Title::Mode::Recommended}, - {"CHN System Font", - SHARED_DATA_ARCHIVE_UPPER_TITLE_ID, - {{0x00014102, 0x00014102, 0x00014102, 0x00014102, 0x00014102, 0x00014102}}, - Title::Mode::Recommended}, - {"KOR System Font", - SHARED_DATA_ARCHIVE_UPPER_TITLE_ID, - {{0x00014202, 0x00014202, 0x00014202, 0x00014202, 0x00014202, 0x00014202}}, - Title::Mode::Recommended}, - {"TWN System Font", - SHARED_DATA_ARCHIVE_UPPER_TITLE_ID, - {{0x00014302, 0x00014302, 0x00014302, 0x00014302, 0x00014302, 0x00014302}}, - Title::Mode::Recommended}, - {"rate", - SHARED_DATA_ARCHIVE_UPPER_TITLE_ID, - {{0x00015202, 0x00015302, 0x00015102, 0x0, 0x0015502, 0x00015602}}, - Title::Mode::All}}}; - -static const std::array SYSTEM_DATA_ARCHIVES_2 = { - {{"bad word list", - SYSTEM_DATA_ARCHIVE_2_UPPER_TITLE_ID, - {{0x00010302, 0x00010302, 0x00010302, 0x00010302, 0x00010302, 0x00010302}}, - Title::Mode::All}, - {"Nintendo Zone hotspot list", - SYSTEM_DATA_ARCHIVE_2_UPPER_TITLE_ID, - {{0x00010502, 0x00010502, 0x00010502, 0x00010502, 0x00010502, 0x00010502}}, - Title::Mode::All}, - {"NVer", - SYSTEM_DATA_ARCHIVE_2_UPPER_TITLE_ID, - {{0x00016102, 0x00016202, 0x00016302, 0x00016402, 0x00016502, 0x00016602}}, - Title::Mode::All}, - {"New_3DS NVer", - SYSTEM_DATA_ARCHIVE_2_UPPER_TITLE_ID, - {{0x20016102, 0x20016202, 0x20016302, 0x0, 0x20016502, 0x0}}, - Title::Mode::All}, - {"CVer", - SYSTEM_DATA_ARCHIVE_2_UPPER_TITLE_ID, - {{0x00017102, 0x00017202, 0x00017302, 0x00017402, 0x00017502, 0x00017602}}, - Title::Mode::All}}}; - -static const std::array SYSTEM_MODULES = { - {{"AM ( Application Manager )", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00001502, 0x00001502, 0x00001502, 0x00001502, 0x00001502, 0x00001502}}, - Title::Mode::All}, - {"Safe Mode AM", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00001503, 0x00001503, 0x00001503, 0x00001503, 0x00001503, 0x00001503}}, - Title::Mode::All}, - {"New_3DS Safe Mode AM", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x20001503, 0x20001503, 0x20001503, 0x20001503, 0x20001503, 0x20001503}}, - Title::Mode::All}, - {"Camera", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00001602, 0x00001602, 0x00001602, 0x00001602, 0x00001602, 0x00001602}}, - Title::Mode::All}, - {"New_3DS Camera", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x20001602, 0x20001602, 0x20001602, 0x20001602, 0x20001602, 0x20001602}}, - Title::Mode::All}, - {"Config (cfg)", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00001702, 0x00001702, 0x00001702, 0x00001702, 0x00001702, 0x00001702}}, - Title::Mode::All}, - {"Safe Mode Config (cfg)", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00001703, 0x00001703, 0x00001703, 0x00001703, 0x00001703, 0x00001703}}, - Title::Mode::All}, - {"New_3DS Safe Mode Config (cfg)", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x20001703, 0x20001703, 0x20001703, 0x20001703, 0x20001703, 0x20001703}}, - Title::Mode::All}, - {"Codec", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00001802, 0x00001802, 0x00001802, 0x00001802, 0x00001802, 0x00001802}}, - Title::Mode::All}, - {"Safe Mode Codec", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00001803, 0x00001803, 0x00001803, 0x00001803, 0x00001803, 0x00001803}}, - Title::Mode::All}, - {"New_3DS Safe Mode Codec", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x20001803, 0x20001803, 0x20001803, 0x20001803, 0x20001803, 0x20001803}}, - Title::Mode::All}, - {"DSP", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00001A02, 0x00001A02, 0x00001A02, 0x00001A02, 0x00001A02, 0x00001A02}}, - Title::Mode::All}, - {"Safe Mode DSP", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00001A03, 0x00001A03, 0x00001A03, 0x00001A03, 0x00001A03, 0x00001A03}}, - Title::Mode::All}, - {"New_3DS Safe Mode DSP", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x20001A03, 0x20001A03, 0x20001A03, 0x20001A03, 0x20001A03, 0x20001A03}}, - Title::Mode::All}, - {"GPIO", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00001B02, 0x00001B02, 0x00001B02, 0x00001B02, 0x00001B02, 0x00001B02}}, - Title::Mode::All}, - {"Safe Mode GPIO", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00001B03, 0x00001B03, 0x00001B03, 0x00001B03, 0x00001B03, 0x00001B03}}, - Title::Mode::All}, - {"New_3DS Safe Mode GPIO", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x20001B03, 0x20001B03, 0x20001B03, 0x20001B03, 0x20001B03, 0x20001B03}}, - Title::Mode::All}, - {"GSP", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00001C02, 0x00001C02, 0x00001C02, 0x00001C02, 0x00001C02, 0x00001C02}}, - Title::Mode::All}, - {"New_3DS GSP", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x20001C02, 0x20001C02, 0x20001C02, 0x20001C02, 0x20001C02, 0x20001C02}}, - Title::Mode::All}, - {"Safe Mode GSP", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00001C03, 0x00001C03, 0x00001C03, 0x00001C03, 0x00001C03, 0x00001C03}}, - Title::Mode::All}, - {"New_3DS Safe Mode GSP", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x20001C03, 0x20001C03, 0x20001C03, 0x20001C03, 0x20001C03, 0x20001C03}}, - Title::Mode::All}, - {"HID (Human Interface Devices)", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00001D02, 0x00001D02, 0x00001D02, 0x00001D02, 0x00001D02, 0x00001D02}}, - Title::Mode::All}, - {"Safe Mode HID", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00001D03, 0x00001D03, 0x00001D03, 0x00001D03, 0x00001D03, 0x00001D03}}, - Title::Mode::All}, - {"New_3DS Safe Mode HID", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x20001D03, 0x20001D03, 0x20001D03, 0x20001D03, 0x20001D03, 0x20001D03}}, - Title::Mode::All}, - {"i2c", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00001E02, 0x00001E02, 0x00001E02, 0x00001E02, 0x00001E02, 0x00001E02}}, - Title::Mode::All}, - {"New_3DS i2c", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x20001E02, 0x20001E02, 0x20001E02, 0x20001E02, 0x20001E02, 0x20001E02}}, - Title::Mode::All}, - {"Safe Mode i2c", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00001E03, 0x00001E03, 0x00001E03, 0x00001E03, 0x00001E03, 0x00001E03}}, - Title::Mode::All}, - {"New_3DS Safe Mode i2c", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x20001E03, 0x20001E03, 0x20001E03, 0x20001E03, 0x20001E03, 0x20001E03}}, - Title::Mode::All}, - {"MCU", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00001F02, 0x00001F02, 0x00001F02, 0x00001F02, 0x00001F02, 0x00001F02}}, - Title::Mode::All}, - {"New_3DS MCU", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x20001F02, 0x20001F02, 0x20001F02, 0x20001F02, 0x20001F02, 0x20001F02}}, - Title::Mode::All}, - {"Safe Mode MCU", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00001F03, 0x00001F03, 0x00001F03, 0x00001F03, 0x00001F03, 0x00001F03}}, - Title::Mode::All}, - {"New_3DS Safe Mode MCU", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x20001F03, 0x20001F03, 0x20001F03, 0x20001F03, 0x20001F03, 0x20001F03}}, - Title::Mode::All}, - {"MIC (Microphone)", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00002002, 0x00002002, 0x00002002, 0x00002002, 0x00002002, 0x00002002}}, - Title::Mode::All}, - {"PDN", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00002102, 0x00002102, 0x00002102, 0x00002102, 0x00002102, 0x00002102}}, - Title::Mode::All}, - {"Safe Mode PDN", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00002103, 0x00002103, 0x00002103, 0x00002103, 0x00002103, 0x00002103}}, - Title::Mode::All}, - {"New_3DS Safe Mode PDN", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x20002103, 0x20002103, 0x20002103, 0x20002103, 0x20002103, 0x20002103}}, - Title::Mode::All}, - {"PTM (Play time, pedometer, and battery manager)", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00002202, 0x00002202, 0x00002202, 0x00002202, 0x00002202, 0x00002202}}, - Title::Mode::All}, - {"New_3DS PTM (Play time, pedometer, and battery manager)", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x20002202, 0x20002202, 0x20002202, 0x20002202, 0x20002202, 0x20002202}}, - Title::Mode::All}, - {"Safe Mode PTM", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00002203, 0x00002203, 0x00002203, 0x00002203, 0x00002203, 0x00002203}}, - Title::Mode::All}, - {"New_3DS Safe Mode PTM", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x20002203, 0x20002203, 0x20002203, 0x20002203, 0x20002203, 0x20002203}}, - Title::Mode::All}, - {"spi", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00002302, 0x00002302, 0x00002302, 0x00002302, 0x00002302, 0x00002302}}, - Title::Mode::All}, - {"New_3DS spi", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x20002302, 0x20002302, 0x20002302, 0x20002302, 0x20002302, 0x20002302}}, - Title::Mode::All}, - {"Safe Mode spi", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00002303, 0x00002303, 0x00002303, 0x00002303, 0x00002303, 0x00002303}}, - Title::Mode::All}, - {"New_3DS Safe Mode spi", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x20002303, 0x20002303, 0x20002303, 0x20002303, 0x20002303, 0x20002303}}, - Title::Mode::All}, - {"AC (Network manager)", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00002402, 0x00002402, 0x00002402, 0x00002402, 0x00002402, 0x00002402}}, - Title::Mode::All}, - {"Safe Mode AC", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00002403, 0x00002403, 0x00002403, 0x00002403, 0x00002403, 0x00002403}}, - Title::Mode::All}, - {"New_3DS Safe Mode AC", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x20002403, 0x20002403, 0x20002403, 0x20002403, 0x20002403, 0x20002403}}, - Title::Mode::All}, - {"Cecd (StreetPass)", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00002602, 0x00002602, 0x00002602, 0x00002602, 0x00002602, 0x00002602}}, - Title::Mode::All}, - {"CSND", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00002702, 0x00002702, 0x00002702, 0x00002702, 0x00002702, 0x00002702}}, - Title::Mode::All}, - {"Safe Mode CSND", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00002703, 0x00002703, 0x00002703, 0x00002703, 0x00002703, 0x00002703}}, - Title::Mode::All}, - {"New_3DS Safe Mode CSND", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x20002703, 0x20002703, 0x20002703, 0x20002703, 0x20002703, 0x20002703}}, - Title::Mode::All}, - {"DLP (Download Play)", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00002802, 0x00002802, 0x00002802, 0x00002802, 0x00002802, 0x00002802}}, - Title::Mode::Recommended}, - {"HTTP", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00002902, 0x00002902, 0x00002902, 0x00002902, 0x00002902, 0x00002902}}, - Title::Mode::All}, - {"Safe Mode HTTP", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00002903, 0x00002903, 0x00002903, 0x00002903, 0x00002903, 0x00002903}}, - Title::Mode::All}, - {"New_3DS Safe Mode HTTP", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x20002903, 0x20002903, 0x20002903, 0x20002903, 0x20002903, 0x20002903}}, - Title::Mode::All}, - {"MP", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00002A02, 0x00002A02, 0x00002A02, 0x00002A02, 0x00002A02, 0x00002A02}}, - Title::Mode::All}, - {"Safe Mode MP", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00002A03, 0x00002A03, 0x00002A03, 0x00002A03, 0x00002A03, 0x00002A03}}, - Title::Mode::All}, - {"NDM", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00002B02, 0x00002B02, 0x00002B02, 0x00002B02, 0x00002B02, 0x00002B02}}, - Title::Mode::All}, - {"NIM", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00002C02, 0x00002C02, 0x00002C02, 0x00002C02, 0x00002C02, 0x00002C02}}, - Title::Mode::All}, - {"Safe Mode NIM", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00002C03, 0x00002C03, 0x00002C03, 0x00002C03, 0x00002C03, 0x00002C03}}, - Title::Mode::All}, - {"New_3DS Safe Mode NIM", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x20002C03, 0x20002C03, 0x20002C03, 0x20002C03, 0x20002C03, 0x20002C03}}, - Title::Mode::All}, - {"NWM ( Low-level wifi manager )", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00002D02, 0x00002D02, 0x00002D02, 0x00002D02, 0x00002D02, 0x00002D02}}, - Title::Mode::All}, - {"Safe Mode NWM", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00002D03, 0x00002D03, 0x00002D03, 0x00002D03, 0x00002D03, 0x00002D03}}, - Title::Mode::All}, - {"New_3DS Safe Mode NWM", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x20002D03, 0x20002D03, 0x20002D03, 0x20002D03, 0x20002D03, 0x20002D03}}, - Title::Mode::All}, - {"Sockets", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00002E02, 0x00002E02, 0x00002E02, 0x00002E02, 0x00002E02, 0x00002E02}}, - Title::Mode::All}, - {"Safe Mode Sockets", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00002E03, 0x00002E03, 0x00002E03, 0x00002E03, 0x00002E03, 0x00002E03}}, - Title::Mode::All}, - {"New_3DS Safe Mode Sockets", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x20002E03, 0x20002E03, 0x20002E03, 0x20002E03, 0x20002E03, 0x20002E03}}, - Title::Mode::All}, - {"SSL", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00002F02, 0x00002F02, 0x00002F02, 0x00002F02, 0x00002F02, 0x00002F02}}, - Title::Mode::All}, - {"Safe Mode SSL", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00002F03, 0x00002F03, 0x00002F03, 0x00002F03, 0x00002F03, 0x00002F03}}, - Title::Mode::All}, - {"New_3DS Safe Mode SSL", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x20002F03, 0x20002F03, 0x20002F03, 0x20002F03, 0x20002F03, 0x20002F03}}, - Title::Mode::All}, - {"PS ( Process Manager )", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00003102, 0x00003102, 0x00003102, 0x00003102, 0x00003102, 0x00003102}}, - Title::Mode::All}, - {"Safe Mode PS", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00003103, 0x00003103, 0x00003103, 0x00003103, 0x00003103, 0x00003103}}, - Title::Mode::All}, - {"New_3DS Safe Mode PS", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x20003103, 0x20003103, 0x20003103, 0x20003103, 0x20003103, 0x20003103}}, - Title::Mode::All}, - {"friends (Friends list)", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00003202, 0x00003202, 0x00003202, 0x00003202, 0x00003202, 0x00003202}}, - Title::Mode::All}, - {"Safe Mode friends (Friends list)", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00003203, 0x00003203, 0x00003203, 0x00003203, 0x00003203, 0x00003203}}, - Title::Mode::All}, - {"New_3DS Safe Mode friends (Friends list)", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x20003203, 0x20003203, 0x20003203, 0x20003203, 0x20003203, 0x20003203}}, - Title::Mode::All}, - {"IR (Infrared)", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00003302, 0x00003302, 0x00003302, 0x00003302, 0x00003302, 0x00003302}}, - Title::Mode::All}, - {"Safe Mode IR", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00003303, 0x00003303, 0x00003303, 0x00003303, 0x00003303, 0x00003303}}, - Title::Mode::All}, - {"New_3DS Safe Mode IR", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x20003303, 0x20003303, 0x20003303, 0x20003303, 0x20003303, 0x20003303}}, - Title::Mode::All}, - {"BOSS (SpotPass)", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00003402, 0x00003402, 0x00003402, 0x00003402, 0x00003402, 0x00003402}}, - Title::Mode::All}, - {"News (Notifications)", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00003502, 0x00003502, 0x00003502, 0x00003502, 0x00003502, 0x00003502}}, - Title::Mode::All}, - {"RO", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00003702, 0x00003702, 0x00003702, 0x00003702, 0x00003702, 0x00003702}}, - Title::Mode::All}, - {"act", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00003802, 0x00003802, 0x00003802, 0x00003802, 0x00003802, 0x00003802}}, - Title::Mode::All}, - {"nfc", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00004002, 0x00004002, 0x00004002, 0x00004002, 0x00004002, 0x00004002}}, - Title::Mode::All}, - {"New_3DS mvd", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x20004102, 0x20004102, 0x20004102, 0x20004102, 0x20004102, 0x20004102}}, - Title::Mode::All}, - {"New_3DS qtm", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x20004202, 0x20004202, 0x20004202, 0x20004202, 0x20004202, 0x20004202}}, - Title::Mode::All}, - {"NS", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00008002, 0x00008002, 0x00008002, 0x00008002, 0x00008002, 0x00008002}}, - Title::Mode::All}, - {"Safe Mode NS", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x00008003, 0x00008003, 0x00008003, 0x00008003, 0x00008003, 0x00008003}}, - Title::Mode::All}, - {"New_3DS Safe Mode NS", - SYSTEM_MODULE_UPPER_TITLE_ID, - {{0x20008003, 0x20008003, 0x20008003, 0x20008003, 0x20008003, 0x20008003}}, - Title::Mode::All}}}; - -std::vector BuildFirmwareTitleList(const Title::Mode& mode, u32 region) { - // Since Australia and Europe share the same title, - // offset down by one for Australia and above. - const u32 region_index = region >= 3 ? region - 1 : region; - - const auto titles_with_mode = [mode, region_index](const Title& title) { - return mode <= title.mode && title.lower_title_id[region_index] != 0; - }; - - std::vector titles; - const auto inserter = std::back_inserter(titles); - std::copy_if(SYSTEM_FIRMWARE.begin(), SYSTEM_FIRMWARE.end(), inserter, titles_with_mode); - std::copy_if(SYSTEM_APPLICATIONS.begin(), SYSTEM_APPLICATIONS.end(), inserter, - titles_with_mode); - std::copy_if(SYSTEM_DATA_ARCHIVES.begin(), SYSTEM_DATA_ARCHIVES.end(), inserter, - titles_with_mode); - std::copy_if(SYSTEM_APPLETS.begin(), SYSTEM_APPLETS.end(), inserter, titles_with_mode); - std::copy_if(SHARED_DATA_ARCHIVES.begin(), SHARED_DATA_ARCHIVES.end(), inserter, - titles_with_mode); - std::copy_if(SYSTEM_DATA_ARCHIVES_2.begin(), SYSTEM_DATA_ARCHIVES_2.end(), inserter, - titles_with_mode); - std::copy_if(SYSTEM_MODULES.begin(), SYSTEM_MODULES.end(), inserter, titles_with_mode); - - const auto get_title_id = [region_index](const Title& title) { - return (static_cast<u64>(title.upper_title_id) << 32) + - static_cast<u64>(title.lower_title_id[region_index]); - }; - - std::vector<u64> title_ids; - std::transform(titles.begin(), titles.end(), std::back_inserter(title_ids), get_title_id); - return title_ids; -}