Compare commits

..

No commits in common. "master" and "1.10.0-prerelease" have entirely different histories.

18 changed files with 21 additions and 188 deletions

View File

@ -1,11 +1,4 @@
# Changelog # Changelog
## 1.10.2
+ Basic support was added for 21.2.0.
+ General system stability improvements to enhance the user's experience.
## 1.10.1
+ Basic support was added for 21.1.0.
+ A bug was fixed that caused some games (e.g. Tomb Raider definitive edition) to fail to launch.
+ General system stability improvements to enhance the user's experience.
## 1.10.0 ## 1.10.0
+ Basic support was added for 21.0.0. + Basic support was added for 21.0.0.
+ The console should boot and atmosphère should be fully functional. + The console should boot and atmosphère should be fully functional.

4
emummc/.gitrepo vendored
View File

@ -6,7 +6,7 @@
[subrepo] [subrepo]
remote = https://github.com/m4xw/emummc remote = https://github.com/m4xw/emummc
branch = develop branch = develop
commit = 8ab963b0b1c24b68de8e0c98c62c7822a9765bf3 commit = 3c57b20ba3820ec87d7dd239d6fcf9ba97510606
parent = 1e88f37892555da4c38ca6c95f43c56cc6bb87e6 parent = d61ee942d9b34cadd80464d5d549c5e2e5bf1689
method = merge method = merge
cmdver = 0.4.1 cmdver = 0.4.1

2
emummc/README.md vendored
View File

@ -2,7 +2,7 @@
*A SDMMC driver replacement for Nintendo's Filesystem Services, by **m4xw*** *A SDMMC driver replacement for Nintendo's Filesystem Services, by **m4xw***
### Supported Horizon Versions ### Supported Horizon Versions
**1.0.0 - 21.2.0** **1.0.0 - 21.0.0**
## Features ## Features
* Arbitrary SDMMC backend selection * Arbitrary SDMMC backend selection

View File

@ -81,8 +81,6 @@
#include "offsets/2010_exfat.h" #include "offsets/2010_exfat.h"
#include "offsets/2100.h" #include "offsets/2100.h"
#include "offsets/2100_exfat.h" #include "offsets/2100_exfat.h"
#include "offsets/2120.h"
#include "offsets/2120_exfat.h"
#include "../utils/fatal.h" #include "../utils/fatal.h"
#define GET_OFFSET_STRUCT_NAME(vers) g_offsets##vers #define GET_OFFSET_STRUCT_NAME(vers) g_offsets##vers
@ -175,8 +173,6 @@ DEFINE_OFFSET_STRUCT(_2010);
DEFINE_OFFSET_STRUCT(_2010_EXFAT); DEFINE_OFFSET_STRUCT(_2010_EXFAT);
DEFINE_OFFSET_STRUCT(_2100); DEFINE_OFFSET_STRUCT(_2100);
DEFINE_OFFSET_STRUCT(_2100_EXFAT); DEFINE_OFFSET_STRUCT(_2100_EXFAT);
DEFINE_OFFSET_STRUCT(_2120);
DEFINE_OFFSET_STRUCT(_2120_EXFAT);
const fs_offsets_t *get_fs_offsets(enum FS_VER version) { const fs_offsets_t *get_fs_offsets(enum FS_VER version) {
switch (version) { switch (version) {
@ -310,10 +306,6 @@ const fs_offsets_t *get_fs_offsets(enum FS_VER version) {
return &(GET_OFFSET_STRUCT_NAME(_2100)); return &(GET_OFFSET_STRUCT_NAME(_2100));
case FS_VER_21_0_0_EXFAT: case FS_VER_21_0_0_EXFAT:
return &(GET_OFFSET_STRUCT_NAME(_2100_EXFAT)); return &(GET_OFFSET_STRUCT_NAME(_2100_EXFAT));
case FS_VER_21_2_0:
return &(GET_OFFSET_STRUCT_NAME(_2120));
case FS_VER_21_2_0_EXFAT:
return &(GET_OFFSET_STRUCT_NAME(_2120_EXFAT));
default: default:
fatal_abort(Fatal_UnknownVersion); fatal_abort(Fatal_UnknownVersion);
} }

View File

@ -119,9 +119,6 @@ enum FS_VER
FS_VER_21_0_0, FS_VER_21_0_0,
FS_VER_21_0_0_EXFAT, FS_VER_21_0_0_EXFAT,
FS_VER_21_2_0,
FS_VER_21_2_0_EXFAT,
FS_VER_MAX, FS_VER_MAX,
}; };

View File

@ -1,59 +0,0 @@
/*
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
* 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 <http://www.gnu.org/licenses/>.
*/
#ifndef __FS_2120_H__
#define __FS_2120_H__
// Accessor vtable getters
#define FS_OFFSET_2120_SDMMC_ACCESSOR_GC 0x1AC970
#define FS_OFFSET_2120_SDMMC_ACCESSOR_SD 0x1AE980
#define FS_OFFSET_2120_SDMMC_ACCESSOR_NAND 0x1ACFA0
// Hooks
#define FS_OFFSET_2120_SDMMC_WRAPPER_READ 0x1A8850
#define FS_OFFSET_2120_SDMMC_WRAPPER_WRITE 0x1A88B0
#define FS_OFFSET_2120_RTLD 0x2E1C0
#define FS_OFFSET_2120_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x4C)))
#define FS_OFFSET_2120_CLKRST_SET_MIN_V_CLK_RATE 0x1CB9B0
// Misc funcs
#define FS_OFFSET_2120_LOCK_MUTEX 0x1A17D0
#define FS_OFFSET_2120_UNLOCK_MUTEX 0x1A1830
#define FS_OFFSET_2120_SDMMC_WRAPPER_CONTROLLER_OPEN 0x1A8810
#define FS_OFFSET_2120_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x1A8830
// Misc Data
#define FS_OFFSET_2120_SD_MUTEX 0xFEE408
#define FS_OFFSET_2120_NAND_MUTEX 0xFE9CF0
#define FS_OFFSET_2120_ACTIVE_PARTITION 0xFE9D30
#define FS_OFFSET_2120_SDMMC_DAS_HANDLE 0xFCBB18
// NOPs
#define FS_OFFSET_2120_SD_DAS_INIT 0x2B5C8
// Nintendo Paths
#define FS_OFFSET_2120_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x000718CC, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x000824F4, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0008AF18, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x000A0B8C, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_2120_H__

View File

@ -1,59 +0,0 @@
/*
* Copyright (c) 2019 m4xw <m4x@m4xw.net>
* 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 <http://www.gnu.org/licenses/>.
*/
#ifndef __FS_2120_EXFAT_EXFAT_H__
#define __FS_2120_EXFAT_EXFAT_H__
// Accessor vtable getters
#define FS_OFFSET_2120_EXFAT_SDMMC_ACCESSOR_GC 0x1B7AD0
#define FS_OFFSET_2120_EXFAT_SDMMC_ACCESSOR_SD 0x1B9AE0
#define FS_OFFSET_2120_EXFAT_SDMMC_ACCESSOR_NAND 0x1B8100
// Hooks
#define FS_OFFSET_2120_EXFAT_SDMMC_WRAPPER_READ 0x1B39B0
#define FS_OFFSET_2120_EXFAT_SDMMC_WRAPPER_WRITE 0x1B3A10
#define FS_OFFSET_2120_EXFAT_RTLD 0x2E1C0
#define FS_OFFSET_2120_EXFAT_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x4C)))
#define FS_OFFSET_2120_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x1D6B10
// Misc funcs
#define FS_OFFSET_2120_EXFAT_LOCK_MUTEX 0x1AC930
#define FS_OFFSET_2120_EXFAT_UNLOCK_MUTEX 0x1AC990
#define FS_OFFSET_2120_EXFAT_SDMMC_WRAPPER_CONTROLLER_OPEN 0x1B3970
#define FS_OFFSET_2120_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x1B3990
// Misc Data
#define FS_OFFSET_2120_EXFAT_SD_MUTEX 0xFFF408
#define FS_OFFSET_2120_EXFAT_NAND_MUTEX 0xFFACF0
#define FS_OFFSET_2120_EXFAT_ACTIVE_PARTITION 0xFFAD30
#define FS_OFFSET_2120_EXFAT_SDMMC_DAS_HANDLE 0xFD8B18
// NOPs
#define FS_OFFSET_2120_EXFAT_SD_DAS_INIT 0x2B5C8
// Nintendo Paths
#define FS_OFFSET_2120_EXFAT_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x000718CC, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x000824F4, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x0008AF18, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x000A0B8C, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_2120_EXFAT_EXFAT_H__

View File

@ -602,7 +602,7 @@ namespace ams::nxboot {
Print("\n"); Print("\n");
if (R_SUCCEEDED(save_result)) { if (R_SUCCEEDED(save_result)) {
Print("Report saved to /atmosphere/fatal_errors/report_%016" PRIx64 ".bin\n", f_ctx->report_identifier); Print("Report saved to /atmosphere/fatal_errors/report_%016" PRIx64 ".bin", f_ctx->report_identifier);
} else { } else {
Print("Failed to save report to the SD card! (%08" PRIx32 ")\n", save_result.GetValue()); Print("Failed to save report to the SD card! (%08" PRIx32 ")\n", save_result.GetValue());
} }

View File

@ -189,9 +189,6 @@ namespace ams::nxboot {
FsVersion_21_0_0, FsVersion_21_0_0,
FsVersion_21_0_0_Exfat, FsVersion_21_0_0_Exfat,
FsVersion_21_2_0,
FsVersion_21_2_0_Exfat,
FsVersion_Count, FsVersion_Count,
}; };
@ -293,9 +290,6 @@ namespace ams::nxboot {
{ 0xEE, 0x4B, 0x30, 0x12, 0xA6, 0x84, 0x02, 0x25 }, /* FsVersion_21_0_0 */ { 0xEE, 0x4B, 0x30, 0x12, 0xA6, 0x84, 0x02, 0x25 }, /* FsVersion_21_0_0 */
{ 0x6E, 0x2B, 0xD9, 0xBA, 0xA3, 0xB9, 0x10, 0xF1 }, /* FsVersion_21_0_0_Exfat */ { 0x6E, 0x2B, 0xD9, 0xBA, 0xA3, 0xB9, 0x10, 0xF1 }, /* FsVersion_21_0_0_Exfat */
{ 0xAF, 0x1D, 0xBD, 0xC7, 0x82, 0x98, 0x3C, 0xBD }, /* FsVersion_21_2_0 */
{ 0x56, 0x25, 0x17, 0xA1, 0x92, 0xC3, 0xC8, 0xF0 }, /* FsVersion_21_2_0_Exfat */
}; };
const InitialProcessBinaryHeader *FindInitialProcessBinary(const pkg2::Package2Header *header, const u8 *data, ams::TargetFirmware target_firmware) { const InitialProcessBinaryHeader *FindInitialProcessBinary(const pkg2::Package2Header *header, const u8 *data, ams::TargetFirmware target_firmware) {
@ -698,13 +692,11 @@ namespace ams::nxboot {
AddPatch(fs_meta, 0x187B70, NogcPatch1, sizeof(NogcPatch1)); AddPatch(fs_meta, 0x187B70, NogcPatch1, sizeof(NogcPatch1));
break; break;
case FsVersion_21_0_0: case FsVersion_21_0_0:
case FsVersion_21_2_0:
AddPatch(fs_meta, 0x1AC9ED, NogcPatch0, sizeof(NogcPatch0)); AddPatch(fs_meta, 0x1AC9ED, NogcPatch0, sizeof(NogcPatch0));
AddPatch(fs_meta, 0x1ACA05 , NogcPatch0, sizeof(NogcPatch0)); AddPatch(fs_meta, 0x1ACA05 , NogcPatch0, sizeof(NogcPatch0));
AddPatch(fs_meta, 0x17FBE0, NogcPatch1, sizeof(NogcPatch1)); AddPatch(fs_meta, 0x17FBE0, NogcPatch1, sizeof(NogcPatch1));
break; break;
case FsVersion_21_0_0_Exfat: case FsVersion_21_0_0_Exfat:
case FsVersion_21_2_0_Exfat:
AddPatch(fs_meta, 0x1B7B4D, NogcPatch0, sizeof(NogcPatch0)); AddPatch(fs_meta, 0x1B7B4D, NogcPatch0, sizeof(NogcPatch0));
AddPatch(fs_meta, 0x1B7B65, NogcPatch0, sizeof(NogcPatch0)); AddPatch(fs_meta, 0x1B7B65, NogcPatch0, sizeof(NogcPatch0));
AddPatch(fs_meta, 0x18AD40, NogcPatch1, sizeof(NogcPatch1)); AddPatch(fs_meta, 0x18AD40, NogcPatch1, sizeof(NogcPatch1));

View File

@ -6,7 +6,7 @@
[subrepo] [subrepo]
remote = https://github.com/Atmosphere-NX/Atmosphere-libs remote = https://github.com/Atmosphere-NX/Atmosphere-libs
branch = master branch = master
commit = 9a8703e710760be8c88147d15414a1c581711625 commit = 6e2c09c795c3996397b2c5720007453b782e7db9
parent = eb34f9789c62745d87f37e76761b14d946bac300 parent = 4928bcb00322a17345521f27f30bafa3e58ea681
method = merge method = merge
cmdver = 0.4.1 cmdver = 0.4.1

View File

@ -361,18 +361,10 @@ namespace ams::kern::board::nintendo::nx {
}(); }();
/* Return (possibly) adjusted size. */ /* Return (possibly) adjusted size. */
/* NOTE: On 20.0.0+ (and even more-so 21.0.0+) the browser requires much more memory in the applet pool in order to function. */ /* NOTE: On 20.0.0+ the browser requires much more memory in the applet pool in order to function. */
/* Thus, we have to reduce our extra system memory size by 26 MB to compensate. */ /* Thus, we have to reduce our extra system memory size by 26 MB to compensate. */
if (kern::GetTargetFirmware() >= ams::TargetFirmware_21_0_0) { const size_t ExtraSystemMemoryForAtmosphere = kern::GetTargetFirmware() >= ams::TargetFirmware_20_0_0 ? 14_MB : 40_MB;
constexpr size_t ExtraSystemMemoryForAtmosphere_21_0_0 = 7_MB; return base_pool_size - ExtraSystemMemoryForAtmosphere - KTraceBufferSize;
return base_pool_size - ExtraSystemMemoryForAtmosphere_21_0_0 - KTraceBufferSize;
} else if (kern::GetTargetFirmware() >= ams::TargetFirmware_20_0_0) {
constexpr size_t ExtraSystemMemoryForAtmosphere_20_0_0 = 14_MB;
return base_pool_size - ExtraSystemMemoryForAtmosphere_20_0_0 - KTraceBufferSize;
} else {
constexpr size_t ExtraSystemMemoryForAtmosphere = 40_MB;
return base_pool_size - ExtraSystemMemoryForAtmosphere - KTraceBufferSize;
}
} }
size_t KSystemControl::Init::GetMinimumNonSecureSystemPoolSize() { size_t KSystemControl::Init::GetMinimumNonSecureSystemPoolSize() {

View File

@ -97,9 +97,6 @@ namespace ams::hos {
Version_20_4_0 = ::ams::TargetFirmware_20_4_0, Version_20_4_0 = ::ams::TargetFirmware_20_4_0,
Version_20_5_0 = ::ams::TargetFirmware_20_5_0, Version_20_5_0 = ::ams::TargetFirmware_20_5_0,
Version_21_0_0 = ::ams::TargetFirmware_21_0_0, Version_21_0_0 = ::ams::TargetFirmware_21_0_0,
Version_21_0_1 = ::ams::TargetFirmware_21_0_1,
Version_21_1_0 = ::ams::TargetFirmware_21_1_0,
Version_21_2_0 = ::ams::TargetFirmware_21_2_0,
Version_Current = ::ams::TargetFirmware_Current, Version_Current = ::ams::TargetFirmware_Current,

View File

@ -388,7 +388,7 @@
} }
ALWAYS_INLINE Result GetDebugEvent(::ams::svc::UserPointer< ::ams::svc::lp64::DebugEventInfo *> out_info, ::ams::svc::Handle debug_handle) { ALWAYS_INLINE Result GetDebugEvent(::ams::svc::UserPointer< ::ams::svc::lp64::DebugEventInfo *> out_info, ::ams::svc::Handle debug_handle) {
R_RETURN(::svcGetDebugEvent(reinterpret_cast<::DebugEventInfo *>(out_info.GetPointerUnsafe()), debug_handle)); R_RETURN(::svcGetDebugEvent(out_info.GetPointerUnsafe(), debug_handle));
} }
ALWAYS_INLINE Result ContinueDebugEvent(::ams::svc::Handle debug_handle, uint32_t flags, ::ams::svc::UserPointer<const uint64_t *> thread_ids, int32_t num_thread_ids) { ALWAYS_INLINE Result ContinueDebugEvent(::ams::svc::Handle debug_handle, uint32_t flags, ::ams::svc::UserPointer<const uint64_t *> thread_ids, int32_t num_thread_ids) {

View File

@ -17,10 +17,10 @@
#define ATMOSPHERE_RELEASE_VERSION_MAJOR 1 #define ATMOSPHERE_RELEASE_VERSION_MAJOR 1
#define ATMOSPHERE_RELEASE_VERSION_MINOR 10 #define ATMOSPHERE_RELEASE_VERSION_MINOR 10
#define ATMOSPHERE_RELEASE_VERSION_MICRO 2 #define ATMOSPHERE_RELEASE_VERSION_MICRO 0
#define ATMOSPHERE_RELEASE_VERSION ATMOSPHERE_RELEASE_VERSION_MAJOR, ATMOSPHERE_RELEASE_VERSION_MINOR, ATMOSPHERE_RELEASE_VERSION_MICRO #define ATMOSPHERE_RELEASE_VERSION ATMOSPHERE_RELEASE_VERSION_MAJOR, ATMOSPHERE_RELEASE_VERSION_MINOR, ATMOSPHERE_RELEASE_VERSION_MICRO
#define ATMOSPHERE_SUPPORTED_HOS_VERSION_MAJOR 21 #define ATMOSPHERE_SUPPORTED_HOS_VERSION_MAJOR 21
#define ATMOSPHERE_SUPPORTED_HOS_VERSION_MINOR 2 #define ATMOSPHERE_SUPPORTED_HOS_VERSION_MINOR 0
#define ATMOSPHERE_SUPPORTED_HOS_VERSION_MICRO 0 #define ATMOSPHERE_SUPPORTED_HOS_VERSION_MICRO 0

View File

@ -95,11 +95,8 @@
#define ATMOSPHERE_TARGET_FIRMWARE_20_4_0 ATMOSPHERE_TARGET_FIRMWARE(20, 4, 0) #define ATMOSPHERE_TARGET_FIRMWARE_20_4_0 ATMOSPHERE_TARGET_FIRMWARE(20, 4, 0)
#define ATMOSPHERE_TARGET_FIRMWARE_20_5_0 ATMOSPHERE_TARGET_FIRMWARE(20, 5, 0) #define ATMOSPHERE_TARGET_FIRMWARE_20_5_0 ATMOSPHERE_TARGET_FIRMWARE(20, 5, 0)
#define ATMOSPHERE_TARGET_FIRMWARE_21_0_0 ATMOSPHERE_TARGET_FIRMWARE(21, 0, 0) #define ATMOSPHERE_TARGET_FIRMWARE_21_0_0 ATMOSPHERE_TARGET_FIRMWARE(21, 0, 0)
#define ATMOSPHERE_TARGET_FIRMWARE_21_0_1 ATMOSPHERE_TARGET_FIRMWARE(21, 0, 1)
#define ATMOSPHERE_TARGET_FIRMWARE_21_1_0 ATMOSPHERE_TARGET_FIRMWARE(21, 1, 0)
#define ATMOSPHERE_TARGET_FIRMWARE_21_2_0 ATMOSPHERE_TARGET_FIRMWARE(21, 2, 0)
#define ATMOSPHERE_TARGET_FIRMWARE_CURRENT ATMOSPHERE_TARGET_FIRMWARE_21_2_0 #define ATMOSPHERE_TARGET_FIRMWARE_CURRENT ATMOSPHERE_TARGET_FIRMWARE_21_0_0
#define ATMOSPHERE_TARGET_FIRMWARE_MIN ATMOSPHERE_TARGET_FIRMWARE(0, 0, 0) #define ATMOSPHERE_TARGET_FIRMWARE_MIN ATMOSPHERE_TARGET_FIRMWARE(0, 0, 0)
#define ATMOSPHERE_TARGET_FIRMWARE_MAX ATMOSPHERE_TARGET_FIRMWARE_CURRENT #define ATMOSPHERE_TARGET_FIRMWARE_MAX ATMOSPHERE_TARGET_FIRMWARE_CURRENT
@ -187,9 +184,6 @@ namespace ams {
TargetFirmware_20_4_0 = ATMOSPHERE_TARGET_FIRMWARE_20_4_0, TargetFirmware_20_4_0 = ATMOSPHERE_TARGET_FIRMWARE_20_4_0,
TargetFirmware_20_5_0 = ATMOSPHERE_TARGET_FIRMWARE_20_5_0, TargetFirmware_20_5_0 = ATMOSPHERE_TARGET_FIRMWARE_20_5_0,
TargetFirmware_21_0_0 = ATMOSPHERE_TARGET_FIRMWARE_21_0_0, TargetFirmware_21_0_0 = ATMOSPHERE_TARGET_FIRMWARE_21_0_0,
TargetFirmware_21_0_1 = ATMOSPHERE_TARGET_FIRMWARE_21_0_1,
TargetFirmware_21_1_0 = ATMOSPHERE_TARGET_FIRMWARE_21_1_0,
TargetFirmware_21_2_0 = ATMOSPHERE_TARGET_FIRMWARE_21_2_0,
TargetFirmware_Current = ATMOSPHERE_TARGET_FIRMWARE_CURRENT, TargetFirmware_Current = ATMOSPHERE_TARGET_FIRMWARE_CURRENT,

View File

@ -79,11 +79,6 @@ constexpr inline const EmbeddedPatchEntry Usb30ForceEnablePatches_20_1_0[] = {
{ 0x7090, "\x20\x00\x80\x52\xC0\x03\x5F\xD6", 8 }, { 0x7090, "\x20\x00\x80\x52\xC0\x03\x5F\xD6", 8 },
}; };
constexpr inline const EmbeddedPatchEntry Usb30ForceEnablePatches_21_0_0[] = {
{ 0x6D60, "\x20\x00\x80\x52\xC0\x03\x5F\xD6", 8 },
{ 0x6DE0, "\x20\x00\x80\x52\xC0\x03\x5F\xD6", 8 },
};
constexpr inline const EmbeddedPatch Usb30ForceEnablePatches[] = { constexpr inline const EmbeddedPatch Usb30ForceEnablePatches[] = {
{ ParseModuleId("C0D3F4E87E8B0FE9BBE9F1968A20767F3DC08E03"), util::size(Usb30ForceEnablePatches_9_0_0), Usb30ForceEnablePatches_9_0_0 }, { ParseModuleId("C0D3F4E87E8B0FE9BBE9F1968A20767F3DC08E03"), util::size(Usb30ForceEnablePatches_9_0_0), Usb30ForceEnablePatches_9_0_0 },
{ ParseModuleId("B9C700CA8335F8BAA0D2041D8D09F772890BA988"), util::size(Usb30ForceEnablePatches_10_0_0), Usb30ForceEnablePatches_10_0_0 }, { ParseModuleId("B9C700CA8335F8BAA0D2041D8D09F772890BA988"), util::size(Usb30ForceEnablePatches_10_0_0), Usb30ForceEnablePatches_10_0_0 },
@ -98,6 +93,5 @@ constexpr inline const EmbeddedPatch Usb30ForceEnablePatches[] = {
{ ParseModuleId("4F21AE15E814FA46515C0401BB23D4F7ADCBF3F4"), util::size(Usb30ForceEnablePatches_18_0_0), Usb30ForceEnablePatches_18_0_0 }, /* 18.0.0 */ { ParseModuleId("4F21AE15E814FA46515C0401BB23D4F7ADCBF3F4"), util::size(Usb30ForceEnablePatches_18_0_0), Usb30ForceEnablePatches_18_0_0 }, /* 18.0.0 */
{ ParseModuleId("54BB9BB32C958E02752DC5E4AE8D016BFE1F5418"), util::size(Usb30ForceEnablePatches_19_0_0), Usb30ForceEnablePatches_19_0_0 }, /* 19.0.0 */ { ParseModuleId("54BB9BB32C958E02752DC5E4AE8D016BFE1F5418"), util::size(Usb30ForceEnablePatches_19_0_0), Usb30ForceEnablePatches_19_0_0 }, /* 19.0.0 */
{ ParseModuleId("40E80E7442C0DFC985315E6F9E8C77229818AC0F"), util::size(Usb30ForceEnablePatches_20_0_0), Usb30ForceEnablePatches_20_0_0 }, /* 20.0.0 */ { ParseModuleId("40E80E7442C0DFC985315E6F9E8C77229818AC0F"), util::size(Usb30ForceEnablePatches_20_0_0), Usb30ForceEnablePatches_20_0_0 }, /* 20.0.0 */
{ ParseModuleId("A5EF8D22EDF8A384E4135270ED596C1D2D524159"), util::size(Usb30ForceEnablePatches_20_1_0), Usb30ForceEnablePatches_20_1_0 }, /* 20.1.0 - 20.5.0 */ { ParseModuleId("A5EF8D22EDF8A384E4135270ED596C1D2D524159"), util::size(Usb30ForceEnablePatches_20_1_0), Usb30ForceEnablePatches_20_1_0 }, /* 20.1.0 - 20.1.1 */
{ ParseModuleId("766D0C2277207B40AD9B8DE309396D50CCE94885"), util::size(Usb30ForceEnablePatches_21_0_0), Usb30ForceEnablePatches_21_0_0 }, /* 21.0.0 */
}; };

View File

@ -245,14 +245,14 @@ namespace ams::ldr {
/* If we don't have an RTLD, we must only have a main. */ /* If we don't have an RTLD, we must only have a main. */
const bool has_browser_dll = (acid_flags & Acid::AcidFlag_LoadBrowserCoreDll) != 0; const bool has_browser_dll = (acid_flags & Acid::AcidFlag_LoadBrowserCoreDll) != 0;
if (!ali->has_rtld) { if (ali->has_rtld) {
/* If don't have rtld, we must also not have sdk. */ /* If we have rtld, we must also have sdk. */
R_UNLESS(!ali->has_sdk, ldr::ResultInvalidNso()); R_UNLESS(ali->has_sdk, ldr::ResultInvalidNso());
/* We must also not have both subsdk and browser dll. */ /* We must also only have one of [subsdk, browser dll]. */
R_UNLESS(!(ali->has_subsdk && has_browser_dll), ldr::ResultInvalidNso()); R_UNLESS(!(ali->has_subsdk && has_browser_dll), ldr::ResultInvalidNso());
} else { } else {
/* If we have rtld, we must not have browser core dll. */ /* If we don't have rtld, we are not browser, and must not have browser core dll. */
R_UNLESS(!has_browser_dll, ldr::ResultInvalidNso()); R_UNLESS(!has_browser_dll, ldr::ResultInvalidNso());
} }

View File

@ -53,14 +53,14 @@ namespace ams::ro::impl {
Result SetNroPerms(os::NativeHandle process_handle, u64 base_address, u64 rx_size, u64 ro_size, u64 rw_size, bool is_aligned_header) { Result SetNroPerms(os::NativeHandle process_handle, u64 base_address, u64 rx_size, u64 ro_size, u64 rw_size, bool is_aligned_header) {
const u64 rx_offset = is_aligned_header ? os::MemoryPageSize : 0; const u64 rx_offset = is_aligned_header ? os::MemoryPageSize : 0;
const u64 ro_offset = rx_size; const u64 ro_offset = rx_offset + rx_size;
const u64 rw_offset = ro_offset + ro_size; const u64 rw_offset = ro_offset + ro_size;
if (is_aligned_header) { if (is_aligned_header) {
R_TRY(os::SetProcessMemoryPermission(process_handle, base_address, os::MemoryPageSize, os::MemoryPermission_ReadOnly)); R_TRY(os::SetProcessMemoryPermission(process_handle, base_address, os::MemoryPageSize, os::MemoryPermission_ReadOnly));
} }
R_TRY(os::SetProcessMemoryPermission(process_handle, base_address + rx_offset, rx_size - rx_offset, os::MemoryPermission_ReadExecute)); R_TRY(os::SetProcessMemoryPermission(process_handle, base_address + rx_offset, rx_size, os::MemoryPermission_ReadExecute));
R_TRY(os::SetProcessMemoryPermission(process_handle, base_address + ro_offset, ro_size, os::MemoryPermission_ReadOnly)); R_TRY(os::SetProcessMemoryPermission(process_handle, base_address + ro_offset, ro_size, os::MemoryPermission_ReadOnly));
R_TRY(os::SetProcessMemoryPermission(process_handle, base_address + rw_offset, rw_size, os::MemoryPermission_ReadWrite)); R_TRY(os::SetProcessMemoryPermission(process_handle, base_address + rw_offset, rw_size, os::MemoryPermission_ReadWrite));