1
0
Fork 0
mirror of https://github.com/Atmosphere-NX/Atmosphere.git synced 2024-11-17 17:36:44 +00:00

emummc: update for 15.0.0

This commit is contained in:
Michael Scire 2022-10-12 00:53:34 -07:00 committed by SciresM
parent bf4fdf6188
commit 0c3f1bed33
5 changed files with 130 additions and 1 deletions

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 - 13.1.0** **1.0.0 - 15.0.0**
## Features ## Features
* Arbitrary SDMMC backend selection * Arbitrary SDMMC backend selection

View file

@ -61,6 +61,8 @@
#include "offsets/1310_exfat.h" #include "offsets/1310_exfat.h"
#include "offsets/1400.h" #include "offsets/1400.h"
#include "offsets/1400_exfat.h" #include "offsets/1400_exfat.h"
#include "offsets/1500.h"
#include "offsets/1500_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
@ -133,6 +135,8 @@ DEFINE_OFFSET_STRUCT(_1310);
DEFINE_OFFSET_STRUCT(_1310_EXFAT); DEFINE_OFFSET_STRUCT(_1310_EXFAT);
DEFINE_OFFSET_STRUCT(_1400); DEFINE_OFFSET_STRUCT(_1400);
DEFINE_OFFSET_STRUCT(_1400_EXFAT); DEFINE_OFFSET_STRUCT(_1400_EXFAT);
DEFINE_OFFSET_STRUCT(_1500);
DEFINE_OFFSET_STRUCT(_1500_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) {
@ -226,6 +230,10 @@ const fs_offsets_t *get_fs_offsets(enum FS_VER version) {
return &(GET_OFFSET_STRUCT_NAME(_1400)); return &(GET_OFFSET_STRUCT_NAME(_1400));
case FS_VER_14_0_0_EXFAT: case FS_VER_14_0_0_EXFAT:
return &(GET_OFFSET_STRUCT_NAME(_1400_EXFAT)); return &(GET_OFFSET_STRUCT_NAME(_1400_EXFAT));
case FS_VER_15_0_0:
return &(GET_OFFSET_STRUCT_NAME(_1500));
case FS_VER_15_0_0_EXFAT:
return &(GET_OFFSET_STRUCT_NAME(_1500_EXFAT));
default: default:
fatal_abort(Fatal_UnknownVersion); fatal_abort(Fatal_UnknownVersion);
} }

View file

@ -89,6 +89,9 @@ enum FS_VER
FS_VER_14_0_0, FS_VER_14_0_0,
FS_VER_14_0_0_EXFAT, FS_VER_14_0_0_EXFAT,
FS_VER_15_0_0,
FS_VER_15_0_0_EXFAT,
FS_VER_MAX, FS_VER_MAX,
}; };

59
emummc/source/FS/offsets/1500.h vendored Normal file
View file

@ -0,0 +1,59 @@
/*
* 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_1500_H__
#define __FS_1500_H__
// Accessor vtable getters
#define FS_OFFSET_1500_SDMMC_ACCESSOR_GC 0x183E20
#define FS_OFFSET_1500_SDMMC_ACCESSOR_SD 0x185AA0
#define FS_OFFSET_1500_SDMMC_ACCESSOR_NAND 0x1842E0
// Hooks
#define FS_OFFSET_1500_SDMMC_WRAPPER_READ 0x17FCF0
#define FS_OFFSET_1500_SDMMC_WRAPPER_WRITE 0x17FD50
#define FS_OFFSET_1500_RTLD 0x26518
#define FS_OFFSET_1500_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x3C)))
#define FS_OFFSET_1500_CLKRST_SET_MIN_V_CLK_RATE 0x1A0870
// Misc funcs
#define FS_OFFSET_1500_LOCK_MUTEX 0x1791A0
#define FS_OFFSET_1500_UNLOCK_MUTEX 0x1791F0
#define FS_OFFSET_1500_SDMMC_WRAPPER_CONTROLLER_OPEN 0x17FCB0
#define FS_OFFSET_1500_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x17FCD0
// Misc Data
#define FS_OFFSET_1500_SD_MUTEX 0xFF33F0
#define FS_OFFSET_1500_NAND_MUTEX 0xFEE2E8
#define FS_OFFSET_1500_ACTIVE_PARTITION 0xFEE328
#define FS_OFFSET_1500_SDMMC_DAS_HANDLE 0xFD38D8
// NOPs
#define FS_OFFSET_1500_SD_DAS_INIT 0x25454
// Nintendo Paths
#define FS_OFFSET_1500_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x00063050, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x0006FDE8, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x000768D4, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x00089364, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_1500_H__

59
emummc/source/FS/offsets/1500_exfat.h vendored Normal file
View file

@ -0,0 +1,59 @@
/*
* 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_1500_EXFAT_H__
#define __FS_1500_EXFAT_H__
// Accessor vtable getters
#define FS_OFFSET_1500_EXFAT_SDMMC_ACCESSOR_GC 0x18EDB0
#define FS_OFFSET_1500_EXFAT_SDMMC_ACCESSOR_SD 0x190A30
#define FS_OFFSET_1500_EXFAT_SDMMC_ACCESSOR_NAND 0x18F270
// Hooks
#define FS_OFFSET_1500_EXFAT_SDMMC_WRAPPER_READ 0x18AC80
#define FS_OFFSET_1500_EXFAT_SDMMC_WRAPPER_WRITE 0x18ACE0
#define FS_OFFSET_1500_EXFAT_RTLD 0x26518
#define FS_OFFSET_1500_EXFAT_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x3C)))
#define FS_OFFSET_1500_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x1AB800
// Misc funcs
#define FS_OFFSET_1500_EXFAT_LOCK_MUTEX 0x184130
#define FS_OFFSET_1500_EXFAT_UNLOCK_MUTEX 0x184180
#define FS_OFFSET_1500_EXFAT_SDMMC_WRAPPER_CONTROLLER_OPEN 0x18AC40
#define FS_OFFSET_1500_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x18AC60
// Misc Data
#define FS_OFFSET_1500_EXFAT_SD_MUTEX 0x10053F0
#define FS_OFFSET_1500_EXFAT_NAND_MUTEX 0x10002E8
#define FS_OFFSET_1500_EXFAT_ACTIVE_PARTITION 0x1000328
#define FS_OFFSET_1500_EXFAT_SDMMC_DAS_HANDLE 0xFE08D8
// NOPs
#define FS_OFFSET_1500_EXFAT_SD_DAS_INIT 0x25454
// Nintendo Paths
#define FS_OFFSET_1500_EXFAT_NINTENDO_PATHS \
{ \
{.opcode_reg = 3, .adrp_offset = 0x00063050, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 3, .adrp_offset = 0x0006FDE8, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x000768D4, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 4, .adrp_offset = 0x00089364, .add_rel_offset = 0x00000004}, \
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
}
#endif // __FS_1500_EXFAT_H__