diff options
| author | 2018-12-06 10:17:50 -0500 | |
|---|---|---|
| committer | 2018-12-06 10:17:50 -0500 | |
| commit | 8be475d4dc9ce6a3cdc46ed08ce8874c34bbe8cc (patch) | |
| tree | a4ad32bd925925f3288808fb11b2ca5ac81df801 | |
| parent | Merge pull request #1867 from lioncash/alloc (diff) | |
| download | yuzu-8be475d4dc9ce6a3cdc46ed08ce8874c34bbe8cc.tar.gz yuzu-8be475d4dc9ce6a3cdc46ed08ce8874c34bbe8cc.tar.xz yuzu-8be475d4dc9ce6a3cdc46ed08ce8874c34bbe8cc.zip | |
system_archive: Implement open source NgWord2
| -rw-r--r-- | src/core/file_sys/system_archive/ng_word.cpp | 39 | ||||
| -rw-r--r-- | src/core/file_sys/system_archive/ng_word.h | 1 | ||||
| -rw-r--r-- | src/core/file_sys/system_archive/system_archive.cpp | 2 |
3 files changed, 41 insertions, 1 deletions
diff --git a/src/core/file_sys/system_archive/ng_word.cpp b/src/core/file_sys/system_archive/ng_word.cpp index a24f1e496..f4443784d 100644 --- a/src/core/file_sys/system_archive/ng_word.cpp +++ b/src/core/file_sys/system_archive/ng_word.cpp | |||
| @@ -39,4 +39,43 @@ VirtualDir NgWord1() { | |||
| 39 | return std::make_shared<VectorVfsDirectory>(files, std::vector<VirtualDir>{}, "data"); | 39 | return std::make_shared<VectorVfsDirectory>(files, std::vector<VirtualDir>{}, "data"); |
| 40 | } | 40 | } |
| 41 | 41 | ||
| 42 | namespace NgWord2Data { | ||
| 43 | |||
| 44 | constexpr std::size_t NUMBER_AC_NX_FILES = 0x10; | ||
| 45 | |||
| 46 | // Should this archive replacement mysteriously not work on a future game, consider updating. | ||
| 47 | constexpr std::array<u8, 4> VERSION_DAT{0x0, 0x0, 0x0, 0x15}; // 5.1.0 System Version | ||
| 48 | |||
| 49 | constexpr std::array<u8, 0x2C> AC_NX_DATA{ | ||
| 50 | 0x1F, 0x8B, 0x08, 0x08, 0xD5, 0x2C, 0x09, 0x5C, 0x04, 0x00, 0x61, 0x63, 0x72, 0x61, 0x77, | ||
| 51 | 0x00, 0xED, 0xC1, 0x01, 0x0D, 0x00, 0x00, 0x00, 0xC2, 0x20, 0xFB, 0xA7, 0xB6, 0xC7, 0x07, | ||
| 52 | 0x0C, 0x00, 0x00, 0x00, 0xC8, 0x3B, 0x11, 0x00, 0x1C, 0xC7, 0x00, 0x10, 0x00, 0x00, | ||
| 53 | }; // Deserializes to no bad words | ||
| 54 | |||
| 55 | } // namespace NgWord2Data | ||
| 56 | |||
| 57 | VirtualDir NgWord2() { | ||
| 58 | std::vector<VirtualFile> files(NgWord2Data::NUMBER_AC_NX_FILES * 3); | ||
| 59 | |||
| 60 | for (std::size_t i = 0; i < NgWord2Data::NUMBER_AC_NX_FILES; ++i) { | ||
| 61 | files[3 * i] = std::make_shared<ArrayVfsFile<NgWord2Data::AC_NX_DATA.size()>>( | ||
| 62 | NgWord2Data::AC_NX_DATA, fmt::format("ac_{}_b1_nx", i)); | ||
| 63 | files[3 * i + 1] = std::make_shared<ArrayVfsFile<NgWord2Data::AC_NX_DATA.size()>>( | ||
| 64 | NgWord2Data::AC_NX_DATA, fmt::format("ac_{}_b2_nx", i)); | ||
| 65 | files[3 * i + 2] = std::make_shared<ArrayVfsFile<NgWord2Data::AC_NX_DATA.size()>>( | ||
| 66 | NgWord2Data::AC_NX_DATA, fmt::format("ac_{}_not_b_nx", i)); | ||
| 67 | } | ||
| 68 | |||
| 69 | files.push_back(std::make_shared<ArrayVfsFile<NgWord2Data::AC_NX_DATA.size()>>( | ||
| 70 | NgWord2Data::AC_NX_DATA, "ac_common_b1_nx")); | ||
| 71 | files.push_back(std::make_shared<ArrayVfsFile<NgWord2Data::AC_NX_DATA.size()>>( | ||
| 72 | NgWord2Data::AC_NX_DATA, "ac_common_b2_nx")); | ||
| 73 | files.push_back(std::make_shared<ArrayVfsFile<NgWord2Data::AC_NX_DATA.size()>>( | ||
| 74 | NgWord2Data::AC_NX_DATA, "ac_common_not_b_nx")); | ||
| 75 | files.push_back(std::make_shared<ArrayVfsFile<NgWord2Data::VERSION_DAT.size()>>( | ||
| 76 | NgWord2Data::VERSION_DAT, "version.dat")); | ||
| 77 | |||
| 78 | return std::make_shared<VectorVfsDirectory>(files, std::vector<VirtualDir>{}, "data"); | ||
| 79 | } | ||
| 80 | |||
| 42 | } // namespace FileSys::SystemArchive | 81 | } // namespace FileSys::SystemArchive |
diff --git a/src/core/file_sys/system_archive/ng_word.h b/src/core/file_sys/system_archive/ng_word.h index f4bc67344..cd81e0abb 100644 --- a/src/core/file_sys/system_archive/ng_word.h +++ b/src/core/file_sys/system_archive/ng_word.h | |||
| @@ -9,5 +9,6 @@ | |||
| 9 | namespace FileSys::SystemArchive { | 9 | namespace FileSys::SystemArchive { |
| 10 | 10 | ||
| 11 | VirtualDir NgWord1(); | 11 | VirtualDir NgWord1(); |
| 12 | VirtualDir NgWord2(); | ||
| 12 | 13 | ||
| 13 | } // namespace FileSys::SystemArchive | 14 | } // namespace FileSys::SystemArchive |
diff --git a/src/core/file_sys/system_archive/system_archive.cpp b/src/core/file_sys/system_archive/system_archive.cpp index d3883267c..e3e79f40a 100644 --- a/src/core/file_sys/system_archive/system_archive.cpp +++ b/src/core/file_sys/system_archive/system_archive.cpp | |||
| @@ -56,7 +56,7 @@ constexpr std::array<SystemArchiveDescriptor, SYSTEM_ARCHIVE_COUNT> SYSTEM_ARCHI | |||
| 56 | {0x0100000000000820, "PlatformConfigCopper", nullptr}, | 56 | {0x0100000000000820, "PlatformConfigCopper", nullptr}, |
| 57 | {0x0100000000000821, "PlatformConfigHoag", nullptr}, | 57 | {0x0100000000000821, "PlatformConfigHoag", nullptr}, |
| 58 | {0x0100000000000822, "ControllerFirmware", nullptr}, | 58 | {0x0100000000000822, "ControllerFirmware", nullptr}, |
| 59 | {0x0100000000000823, "NgWord2", nullptr}, | 59 | {0x0100000000000823, "NgWord2", &NgWord2}, |
| 60 | {0x0100000000000824, "PlatformConfigIcosaMariko", nullptr}, | 60 | {0x0100000000000824, "PlatformConfigIcosaMariko", nullptr}, |
| 61 | {0x0100000000000825, "ApplicationBlackList", nullptr}, | 61 | {0x0100000000000825, "ApplicationBlackList", nullptr}, |
| 62 | {0x0100000000000826, "RebootlessSystemUpdateVersion", nullptr}, | 62 | {0x0100000000000826, "RebootlessSystemUpdateVersion", nullptr}, |