diff --git a/docs/changelog.md b/docs/changelog.md index 1532855a4..ae38d0d70 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,4 +1,10 @@ # Changelog +## 1.7.1 ++ Support was added for 18.1.0. ++ Atmosphère was updated to use GCC 14/newlib (latest devkitA64/devkitARM releases). ++ Further changes were for 18.0.0: + + `loader` was updated to reflect the latest official behavior. ++ General system stability improvements to enhance the user's experience. ## 1.7.0 + Basic support was added for 18.0.0. + The console should boot and atmosphère should be fully functional. However, not all modules have been fully updated to reflect the latest changes. diff --git a/emummc/.gitrepo b/emummc/.gitrepo index 0aab4ee6e..f4eb810eb 100644 --- a/emummc/.gitrepo +++ b/emummc/.gitrepo @@ -6,7 +6,7 @@ [subrepo] remote = https://github.com/m4xw/emummc branch = develop - commit = 832b2442685b45b086697ffe09c5fde05d7444e9 - parent = 3ccb0ae02bc06769f44d61233bf177301ba9d5f3 + commit = f23f943d4092ca9490dbcebbdd117abc3740abcf + parent = 1e3349e99a023517269b3fc1bc32fd84e5b3caa9 method = merge cmdver = 0.4.1 diff --git a/emummc/README.md b/emummc/README.md index 81e43f4b4..f01783ba5 100644 --- a/emummc/README.md +++ b/emummc/README.md @@ -2,7 +2,7 @@ *A SDMMC driver replacement for Nintendo's Filesystem Services, by **m4xw*** ### Supported Horizon Versions -**1.0.0 - 18.0.0** +**1.0.0 - 18.1.0** ## Features * Arbitrary SDMMC backend selection diff --git a/emummc/source/FS/FS_offsets.c b/emummc/source/FS/FS_offsets.c index 069f5d9d1..b2059c092 100644 --- a/emummc/source/FS/FS_offsets.c +++ b/emummc/source/FS/FS_offsets.c @@ -71,6 +71,8 @@ #include "offsets/1700_exfat.h" #include "offsets/1800.h" #include "offsets/1800_exfat.h" +#include "offsets/1810.h" +#include "offsets/1810_exfat.h" #include "../utils/fatal.h" #define GET_OFFSET_STRUCT_NAME(vers) g_offsets##vers @@ -153,6 +155,8 @@ DEFINE_OFFSET_STRUCT(_1700); DEFINE_OFFSET_STRUCT(_1700_EXFAT); DEFINE_OFFSET_STRUCT(_1800); DEFINE_OFFSET_STRUCT(_1800_EXFAT); +DEFINE_OFFSET_STRUCT(_1810); +DEFINE_OFFSET_STRUCT(_1810_EXFAT); const fs_offsets_t *get_fs_offsets(enum FS_VER version) { switch (version) { @@ -266,6 +270,10 @@ const fs_offsets_t *get_fs_offsets(enum FS_VER version) { return &(GET_OFFSET_STRUCT_NAME(_1800)); case FS_VER_18_0_0_EXFAT: return &(GET_OFFSET_STRUCT_NAME(_1800_EXFAT)); + case FS_VER_18_1_0: + return &(GET_OFFSET_STRUCT_NAME(_1810)); + case FS_VER_18_1_0_EXFAT: + return &(GET_OFFSET_STRUCT_NAME(_1810_EXFAT)); default: fatal_abort(Fatal_UnknownVersion); } diff --git a/emummc/source/FS/FS_versions.h b/emummc/source/FS/FS_versions.h index fc7011011..ec4f9ecf8 100644 --- a/emummc/source/FS/FS_versions.h +++ b/emummc/source/FS/FS_versions.h @@ -104,6 +104,9 @@ enum FS_VER FS_VER_18_0_0, FS_VER_18_0_0_EXFAT, + FS_VER_18_1_0, + FS_VER_18_1_0_EXFAT, + FS_VER_MAX, }; diff --git a/emummc/source/FS/offsets/1810.h b/emummc/source/FS/offsets/1810.h new file mode 100644 index 000000000..2b71db7a1 --- /dev/null +++ b/emummc/source/FS/offsets/1810.h @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2019 m4xw + * Copyright (c) 2019 Atmosphere-NX + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#ifndef __FS_1810_H__ +#define __FS_1810_H__ + +// Accessor vtable getters +#define FS_OFFSET_1810_SDMMC_ACCESSOR_GC 0x18AB00 +#define FS_OFFSET_1810_SDMMC_ACCESSOR_SD 0x18C800 +#define FS_OFFSET_1810_SDMMC_ACCESSOR_NAND 0x18AFE0 + +// Hooks +#define FS_OFFSET_1810_SDMMC_WRAPPER_READ 0x186A50 +#define FS_OFFSET_1810_SDMMC_WRAPPER_WRITE 0x186AB0 +#define FS_OFFSET_1810_RTLD 0x2A3A4 +#define FS_OFFSET_1810_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x44))) + +#define FS_OFFSET_1810_CLKRST_SET_MIN_V_CLK_RATE 0x1A77D0 + +// Misc funcs +#define FS_OFFSET_1810_LOCK_MUTEX 0x17FCC0 +#define FS_OFFSET_1810_UNLOCK_MUTEX 0x17FD10 + +#define FS_OFFSET_1810_SDMMC_WRAPPER_CONTROLLER_OPEN 0x186A10 +#define FS_OFFSET_1810_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x186A30 + +// Misc Data +#define FS_OFFSET_1810_SD_MUTEX 0xFD13F0 +#define FS_OFFSET_1810_NAND_MUTEX 0xFCCB28 +#define FS_OFFSET_1810_ACTIVE_PARTITION 0xFCCB68 +#define FS_OFFSET_1810_SDMMC_DAS_HANDLE 0xFB1950 + +// NOPs +#define FS_OFFSET_1810_SD_DAS_INIT 0x28F24 + +// Nintendo Paths +#define FS_OFFSET_1810_NINTENDO_PATHS \ +{ \ + {.opcode_reg = 3, .adrp_offset = 0x00068B08, .add_rel_offset = 0x00000004}, \ + {.opcode_reg = 3, .adrp_offset = 0x000758DC, .add_rel_offset = 0x00000004}, \ + {.opcode_reg = 4, .adrp_offset = 0x0007C77C, .add_rel_offset = 0x00000004}, \ + {.opcode_reg = 4, .adrp_offset = 0x000905C4, .add_rel_offset = 0x00000004}, \ + {.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \ +} + +#endif // __FS_1810_H__ diff --git a/emummc/source/FS/offsets/1810_exfat.h b/emummc/source/FS/offsets/1810_exfat.h new file mode 100644 index 000000000..4ac55481c --- /dev/null +++ b/emummc/source/FS/offsets/1810_exfat.h @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2019 m4xw + * Copyright (c) 2019 Atmosphere-NX + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#ifndef __FS_1810_EXFAT_H__ +#define __FS_1810_EXFAT_H__ + +// Accessor vtable getters +#define FS_OFFSET_1810_EXFAT_SDMMC_ACCESSOR_GC 0x195B90 +#define FS_OFFSET_1810_EXFAT_SDMMC_ACCESSOR_SD 0x197890 +#define FS_OFFSET_1810_EXFAT_SDMMC_ACCESSOR_NAND 0x196070 + +// Hooks +#define FS_OFFSET_1810_EXFAT_SDMMC_WRAPPER_READ 0x191AE0 +#define FS_OFFSET_1810_EXFAT_SDMMC_WRAPPER_WRITE 0x191B40 +#define FS_OFFSET_1810_EXFAT_RTLD 0x2A3A4 +#define FS_OFFSET_1810_EXFAT_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x44))) + +#define FS_OFFSET_1810_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x1B2860 + +// Misc funcs +#define FS_OFFSET_1810_EXFAT_LOCK_MUTEX 0x18AD50 +#define FS_OFFSET_1810_EXFAT_UNLOCK_MUTEX 0x18ADA0 + +#define FS_OFFSET_1810_EXFAT_SDMMC_WRAPPER_CONTROLLER_OPEN 0x191AA0 +#define FS_OFFSET_1810_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x191AC0 + +// Misc Data +#define FS_OFFSET_1810_EXFAT_SD_MUTEX 0xFE33F0 +#define FS_OFFSET_1810_EXFAT_NAND_MUTEX 0xFDEB28 +#define FS_OFFSET_1810_EXFAT_ACTIVE_PARTITION 0xFDEB68 +#define FS_OFFSET_1810_EXFAT_SDMMC_DAS_HANDLE 0xFBE950 + +// NOPs +#define FS_OFFSET_1810_EXFAT_SD_DAS_INIT 0x28F24 + +// Nintendo Paths +#define FS_OFFSET_1810_EXFAT_NINTENDO_PATHS \ +{ \ + {.opcode_reg = 3, .adrp_offset = 0x00068B08, .add_rel_offset = 0x00000004}, \ + {.opcode_reg = 3, .adrp_offset = 0x000758DC, .add_rel_offset = 0x00000004}, \ + {.opcode_reg = 4, .adrp_offset = 0x0007C77C, .add_rel_offset = 0x00000004}, \ + {.opcode_reg = 4, .adrp_offset = 0x000905C4, .add_rel_offset = 0x00000004}, \ + {.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \ +} + +#endif // __FS_1810_EXFAT_H__ diff --git a/fusee/program/source/fusee_stratosphere.cpp b/fusee/program/source/fusee_stratosphere.cpp index add639c05..a7a380d97 100644 --- a/fusee/program/source/fusee_stratosphere.cpp +++ b/fusee/program/source/fusee_stratosphere.cpp @@ -174,6 +174,9 @@ namespace ams::nxboot { FsVersion_18_0_0, FsVersion_18_0_0_Exfat, + FsVersion_18_1_0, + FsVersion_18_1_0_Exfat, + FsVersion_Count, }; @@ -260,6 +263,9 @@ namespace ams::nxboot { { 0x79, 0x5F, 0x5A, 0x5E, 0xB0, 0xC6, 0x77, 0x9E }, /* FsVersion_18_0_0 */ { 0x1E, 0x2C, 0x64, 0xB1, 0xCC, 0xE2, 0x78, 0x24 }, /* FsVersion_18_0_0_Exfat */ + + { 0xA3, 0x39, 0xF0, 0x1C, 0x95, 0xBF, 0xA7, 0x68 }, /* FsVersion_18_1_0 */ + { 0x20, 0x4C, 0xBA, 0x86, 0xDE, 0x08, 0x44, 0x6A }, /* FsVersion_18_1_0_Exfat */ }; const InitialProcessBinaryHeader *FindInitialProcessBinary(const pkg2::Package2Header *header, const u8 *data, ams::TargetFirmware target_firmware) { @@ -631,6 +637,14 @@ namespace ams::nxboot { AddPatch(fs_meta, 0x195FD9, NogcPatch0, sizeof(NogcPatch0)); AddPatch(fs_meta, 0x16FBE0, NogcPatch1, sizeof(NogcPatch1)); break; + case FsVersion_18_1_0: + AddPatch(fs_meta, 0x18AF49, NogcPatch0, sizeof(NogcPatch0)); + AddPatch(fs_meta, 0x164B50, NogcPatch1, sizeof(NogcPatch1)); + break; + case FsVersion_18_1_0_Exfat: + AddPatch(fs_meta, 0x195FD9, NogcPatch0, sizeof(NogcPatch0)); + AddPatch(fs_meta, 0x16FBE0, NogcPatch1, sizeof(NogcPatch1)); + break; default: break; } diff --git a/libraries/.gitrepo b/libraries/.gitrepo index c1120c7e7..fe36741b8 100644 --- a/libraries/.gitrepo +++ b/libraries/.gitrepo @@ -6,7 +6,7 @@ [subrepo] remote = https://github.com/Atmosphere-NX/Atmosphere-libs branch = master - commit = fadec2981727636ec7ba81d6c83995b7b9782190 - parent = 410f23035efeb9e1bd399a020334793bba95bf91 + commit = bb767869105d0eb5c38425f54bf20614639a078d + parent = ab5cc7568430e2c1b3fa1be6be104b7c5f71eb32 method = merge cmdver = 0.4.1 diff --git a/libraries/libstratosphere/include/stratosphere/hos/hos_types.hpp b/libraries/libstratosphere/include/stratosphere/hos/hos_types.hpp index ff8c36898..597cc0876 100644 --- a/libraries/libstratosphere/include/stratosphere/hos/hos_types.hpp +++ b/libraries/libstratosphere/include/stratosphere/hos/hos_types.hpp @@ -83,6 +83,7 @@ namespace ams::hos { Version_17_0_0 = ::ams::TargetFirmware_17_0_0, Version_17_0_1 = ::ams::TargetFirmware_17_0_1, Version_18_0_0 = ::ams::TargetFirmware_18_0_0, + Version_18_1_0 = ::ams::TargetFirmware_18_1_0, Version_Current = ::ams::TargetFirmware_Current, diff --git a/libraries/libstratosphere/include/stratosphere/sf/sf_buffers.hpp b/libraries/libstratosphere/include/stratosphere/sf/sf_buffers.hpp index 32286f48f..bc134fd91 100644 --- a/libraries/libstratosphere/include/stratosphere/sf/sf_buffers.hpp +++ b/libraries/libstratosphere/include/stratosphere/sf/sf_buffers.hpp @@ -42,7 +42,7 @@ namespace ams::sf { } else if constexpr(TransferMode == BufferTransferMode::AutoSelect) { return SfBufferAttr_HipcAutoSelect; } else { - static_assert(TransferMode != TransferMode, "Invalid BufferTransferMode"); + static_assert(false, "Invalid BufferTransferMode"); } }(); diff --git a/libraries/libstratosphere/include/stratosphere/sf/sf_default_allocation_policy.hpp b/libraries/libstratosphere/include/stratosphere/sf/sf_default_allocation_policy.hpp index 64a491eb0..56ca7f5a7 100644 --- a/libraries/libstratosphere/include/stratosphere/sf/sf_default_allocation_policy.hpp +++ b/libraries/libstratosphere/include/stratosphere/sf/sf_default_allocation_policy.hpp @@ -29,7 +29,7 @@ namespace ams::sf { private: struct Holder { MemoryResource *allocator; - typename std::aligned_storage::type storage; + alignas(alignof(T)) std::byte storage[sizeof(T)]; }; public: void *Allocate(size_t size) { diff --git a/libraries/libstratosphere/include/stratosphere/sf/sf_exp_heap_allocator.hpp b/libraries/libstratosphere/include/stratosphere/sf/sf_exp_heap_allocator.hpp index 5a30b09ee..6ec6fcdca 100644 --- a/libraries/libstratosphere/include/stratosphere/sf/sf_exp_heap_allocator.hpp +++ b/libraries/libstratosphere/include/stratosphere/sf/sf_exp_heap_allocator.hpp @@ -57,7 +57,7 @@ namespace ams::sf { struct Globals { ExpHeapAllocator allocator; - typename std::aligned_storage::type buffer; + alignas(0x10) std::byte buffer[Size == 0 ? 1 : Size]; }; static constinit inline Globals _globals = {}; diff --git a/libraries/libvapours/include/vapours/ams/ams_api_version.h b/libraries/libvapours/include/vapours/ams/ams_api_version.h index 2319e1895..0e06af0fb 100644 --- a/libraries/libvapours/include/vapours/ams/ams_api_version.h +++ b/libraries/libvapours/include/vapours/ams/ams_api_version.h @@ -17,10 +17,10 @@ #define ATMOSPHERE_RELEASE_VERSION_MAJOR 1 #define ATMOSPHERE_RELEASE_VERSION_MINOR 7 -#define ATMOSPHERE_RELEASE_VERSION_MICRO 0 +#define ATMOSPHERE_RELEASE_VERSION_MICRO 1 #define ATMOSPHERE_RELEASE_VERSION ATMOSPHERE_RELEASE_VERSION_MAJOR, ATMOSPHERE_RELEASE_VERSION_MINOR, ATMOSPHERE_RELEASE_VERSION_MICRO #define ATMOSPHERE_SUPPORTED_HOS_VERSION_MAJOR 18 -#define ATMOSPHERE_SUPPORTED_HOS_VERSION_MINOR 0 +#define ATMOSPHERE_SUPPORTED_HOS_VERSION_MINOR 1 #define ATMOSPHERE_SUPPORTED_HOS_VERSION_MICRO 0 diff --git a/libraries/libvapours/include/vapours/ams/ams_target_firmware.h b/libraries/libvapours/include/vapours/ams/ams_target_firmware.h index 112bbd74f..0dde6da81 100644 --- a/libraries/libvapours/include/vapours/ams/ams_target_firmware.h +++ b/libraries/libvapours/include/vapours/ams/ams_target_firmware.h @@ -81,8 +81,9 @@ #define ATMOSPHERE_TARGET_FIRMWARE_17_0_0 ATMOSPHERE_TARGET_FIRMWARE(17, 0, 0) #define ATMOSPHERE_TARGET_FIRMWARE_17_0_1 ATMOSPHERE_TARGET_FIRMWARE(17, 0, 1) #define ATMOSPHERE_TARGET_FIRMWARE_18_0_0 ATMOSPHERE_TARGET_FIRMWARE(18, 0, 0) +#define ATMOSPHERE_TARGET_FIRMWARE_18_1_0 ATMOSPHERE_TARGET_FIRMWARE(18, 1, 0) -#define ATMOSPHERE_TARGET_FIRMWARE_CURRENT ATMOSPHERE_TARGET_FIRMWARE_18_0_0 +#define ATMOSPHERE_TARGET_FIRMWARE_CURRENT ATMOSPHERE_TARGET_FIRMWARE_18_1_0 #define ATMOSPHERE_TARGET_FIRMWARE_MIN ATMOSPHERE_TARGET_FIRMWARE(0, 0, 0) #define ATMOSPHERE_TARGET_FIRMWARE_MAX ATMOSPHERE_TARGET_FIRMWARE_CURRENT @@ -156,6 +157,7 @@ namespace ams { TargetFirmware_17_0_0 = ATMOSPHERE_TARGET_FIRMWARE_17_0_0, TargetFirmware_17_0_1 = ATMOSPHERE_TARGET_FIRMWARE_17_0_1, TargetFirmware_18_0_0 = ATMOSPHERE_TARGET_FIRMWARE_18_0_0, + TargetFirmware_18_1_0 = ATMOSPHERE_TARGET_FIRMWARE_18_1_0, TargetFirmware_Current = ATMOSPHERE_TARGET_FIRMWARE_CURRENT,