Compare commits
31 Commits
1.9.0-prer
...
1.9.4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d7936d3fa4 | ||
|
|
1c0ea680b6 | ||
|
|
b8ed942ae4 | ||
|
|
98bc030b37 | ||
|
|
081e76a2b5 | ||
|
|
e8de1e3c34 | ||
|
|
41b28bb0c4 | ||
|
|
3197b1e25b | ||
|
|
822cbbbc8b | ||
|
|
4237f52ee2 | ||
|
|
8b8e4438e8 | ||
|
|
debfff9f62 | ||
|
|
c77acb32be | ||
|
|
af859d9e65 | ||
|
|
a487efad6b | ||
|
|
7e0eb10e32 | ||
|
|
4a3e2b5c57 | ||
|
|
d8a37b4b71 | ||
|
|
b11850b3a3 | ||
|
|
77603bf7e5 | ||
|
|
6b01ebca9e | ||
|
|
17be65b4b9 | ||
|
|
409c3cf9e1 | ||
|
|
f4e1d0bf9f | ||
|
|
ae65b5df0c | ||
|
|
0a299a3d40 | ||
|
|
801438953d | ||
|
|
3fbc59cce1 | ||
|
|
f646d9c8f9 | ||
|
|
69cc653e7f | ||
|
|
6da88f8f3e |
@@ -4,6 +4,7 @@
|
||||
|
||||

|
||||
[](https://discordapp.com/invite/ZdqEhed)
|
||||

|
||||
|
||||
Atmosphère is a work-in-progress customized firmware for the Nintendo Switch.
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ dist-no-debug: package3 $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR)
|
||||
cp stratosphere/dmnt.gen2/$(ATMOSPHERE_OUT_DIR)/dmnt.gen2.nsp $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/010000000000d609/exefs.nsp
|
||||
cp stratosphere/TioServer/$(ATMOSPHERE_OUT_DIR)/TioServer.nsp $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/010000000000d623/exefs.nsp
|
||||
cp stratosphere/memlet/$(ATMOSPHERE_OUT_DIR)/memlet.nsp $(DIST_DIR)/stratosphere_romfs/atmosphere/contents/0100000000000421/exefs.nsp
|
||||
@build_romfs $(DIST_DIR)/stratosphere_romfs $(DIST_DIR)/atmosphere/stratosphere.romfs
|
||||
@PATH="$(DEVKITPRO)/tools/bin:$$PATH" build_romfs $(DIST_DIR)/stratosphere_romfs $(DIST_DIR)/atmosphere/stratosphere.romfs
|
||||
rm -r $(DIST_DIR)/stratosphere_romfs
|
||||
cp troposphere/reboot_to_payload/reboot_to_payload.nro $(DIST_DIR)/switch/reboot_to_payload.nro
|
||||
cp troposphere/daybreak/daybreak.nro $(DIST_DIR)/switch/daybreak.nro
|
||||
@@ -117,7 +117,7 @@ dist-no-debug: package3 $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR)
|
||||
cp fusee/$(ATMOSPHERE_BOOT_OUT_DIR)/fusee.bin $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR)/fusee.bin
|
||||
|
||||
package3: emummc fusee stratosphere mesosphere exosphere troposphere
|
||||
@python fusee/build_package3.py $(CURRENT_DIRECTORY) $(ATMOSPHERE_OUT_DIR) $(ATMOSPHERE_BOOT_OUT_DIR) $(ATMOSPHERE_GIT_HASH) $(ATMOSPHERE_MAJOR_VERSION) $(ATMOSPHERE_MINOR_VERSION) $(ATMOSPHERE_MICRO_VERSION) 0 $(ATMOSPHERE_SUPPORTED_HOS_MAJOR_VERSION) $(ATMOSPHERE_SUPPORTED_HOS_MINOR_VERSION) $(ATMOSPHERE_SUPPORTED_HOS_MICRO_VERSION) 0
|
||||
$(SILENTCMD)$(PYTHON) fusee/build_package3.py $(CURRENT_DIRECTORY) $(ATMOSPHERE_OUT_DIR) $(ATMOSPHERE_BOOT_OUT_DIR) $(ATMOSPHERE_GIT_HASH) $(ATMOSPHERE_MAJOR_VERSION) $(ATMOSPHERE_MINOR_VERSION) $(ATMOSPHERE_MICRO_VERSION) 0 $(ATMOSPHERE_SUPPORTED_HOS_MAJOR_VERSION) $(ATMOSPHERE_SUPPORTED_HOS_MINOR_VERSION) $(ATMOSPHERE_SUPPORTED_HOS_MICRO_VERSION) 0
|
||||
@echo "Built package3!"
|
||||
|
||||
emummc:
|
||||
|
||||
@@ -1,4 +1,22 @@
|
||||
# Changelog
|
||||
## 1.9.3
|
||||
+ Basic support was added for 20.4.0.
|
||||
+ An issue was fixed in `exosphère`'s register accessilibity tables (thanks @CTCaer).
|
||||
+ I believe this had no impact on official code, though it would have prevented some homebrew from interacting correctly with the MC0/MC1 registers.
|
||||
+ An issue was fixed that could cause a deadlock when building multiple romfs images simultaneously (thanks @Ereza).
|
||||
+ This fixes support for certain mods, e.g. system language translations overriding content for both overlayDisp and qlaunch.
|
||||
+ General system stability improvements to enhance the user's experience.
|
||||
## 1.9.3
|
||||
+ Basic support was added for 20.3.0.
|
||||
+ Compatibility was fixed for loading mods with KOTOR 2 (star wars).
|
||||
+ General system stability improvements to enhance the user's experience.
|
||||
## 1.9.2
|
||||
+ Basic support was added for 20.2.0.
|
||||
+ USB 3.0 support force-enable was fixed for 20.1.0+.
|
||||
+ General system stability improvements to enhance the user's experience.
|
||||
## 1.9.1
|
||||
+ Basic support was added for 20.1.0.
|
||||
+ General system stability improvements to enhance the user's experience.
|
||||
## 1.9.0
|
||||
+ Basic support was added for 20.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.
|
||||
|
||||
@@ -423,41 +423,41 @@ Note that for multiple button combinations, the bitmasks should be OR'd together
|
||||
#### Keypad Values
|
||||
Note: This is the direct output of `hidKeysDown()`.
|
||||
|
||||
+ 000000001: A
|
||||
+ 000000002: B
|
||||
+ 000000004: X
|
||||
+ 000000008: Y
|
||||
+ 000000010: Left Stick Pressed
|
||||
+ 000000020: Right Stick Pressed
|
||||
+ 000000040: L
|
||||
+ 000000080: R
|
||||
+ 000000100: ZL
|
||||
+ 000000200: ZR
|
||||
+ 000000400: Plus
|
||||
+ 000000800: Minus
|
||||
+ 000001000: Left
|
||||
+ 000002000: Up
|
||||
+ 000004000: Right
|
||||
+ 000008000: Down
|
||||
+ 000010000: Left Stick Left
|
||||
+ 000020000: Left Stick Up
|
||||
+ 000040000: Left Stick Right
|
||||
+ 000080000: Left Stick Down
|
||||
+ 000100000: Right Stick Left
|
||||
+ 000200000: Right Stick Up
|
||||
+ 000400000: Right Stick Right
|
||||
+ 000800000: Right Stick Down
|
||||
+ 001000000: SL Left Joy-Con
|
||||
+ 002000000: SR Left Joy-Con
|
||||
+ 004000000: SL Right Joy-Con
|
||||
+ 008000000: SR Right Joy-Con
|
||||
+ 010000000: Top button on Poké Ball Plus (Palma) controller
|
||||
+ 020000000: Verification
|
||||
+ 040000000: B button on Left NES/HVC controller in Handheld mode
|
||||
+ 080000000: Left C button in N64 controller
|
||||
+ 100000000: Up C button in N64 controller
|
||||
+ 200000000: Right C button in N64 controller
|
||||
+ 400000000: Down C button in N64 controller
|
||||
+ 00000000 00000001: A
|
||||
+ 00000000 00000002: B
|
||||
+ 00000000 00000004: X
|
||||
+ 00000000 00000008: Y
|
||||
+ 00000000 00000010: Left Stick Pressed
|
||||
+ 00000000 00000020: Right Stick Pressed
|
||||
+ 00000000 00000040: L
|
||||
+ 00000000 00000080: R
|
||||
+ 00000000 00000100: ZL
|
||||
+ 00000000 00000200: ZR
|
||||
+ 00000000 00000400: Plus
|
||||
+ 00000000 00000800: Minus
|
||||
+ 00000000 00001000: Left
|
||||
+ 00000000 00002000: Up
|
||||
+ 00000000 00004000: Right
|
||||
+ 00000000 00008000: Down
|
||||
+ 00000000 00010000: Left Stick Left
|
||||
+ 00000000 00020000: Left Stick Up
|
||||
+ 00000000 00040000: Left Stick Right
|
||||
+ 00000000 00080000: Left Stick Down
|
||||
+ 00000000 00100000: Right Stick Left
|
||||
+ 00000000 00200000: Right Stick Up
|
||||
+ 00000000 00400000: Right Stick Right
|
||||
+ 00000000 00800000: Right Stick Down
|
||||
+ 00000000 01000000: SL Left Joy-Con
|
||||
+ 00000000 02000000: SR Left Joy-Con
|
||||
+ 00000000 04000000: SL Right Joy-Con
|
||||
+ 00000000 08000000: SR Right Joy-Con
|
||||
+ 00000000 10000000: Top button on Poké Ball Plus (Palma) controller
|
||||
+ 00000000 20000000: Verification
|
||||
+ 00000000 40000000: B button on Left NES/HVC controller in Handheld mode
|
||||
+ 00000000 80000000: Left C button in N64 controller
|
||||
+ 00000001 00000000: Up C button in N64 controller
|
||||
+ 00000002 00000000: Right C button in N64 controller
|
||||
+ 00000004 00000000: Down C button in N64 controller
|
||||
|
||||
### Code Type 0xF0: Double Extended-Width Instruction
|
||||
Code Type 0xF0 signals to the VM to treat the upper three nybbles of the first dword as instruction type, instead of just the upper nybble.
|
||||
|
||||
4
emummc/.gitrepo
vendored
4
emummc/.gitrepo
vendored
@@ -6,7 +6,7 @@
|
||||
[subrepo]
|
||||
remote = https://github.com/m4xw/emummc
|
||||
branch = develop
|
||||
commit = 7522f1f6054a71bdff5beadee0302cead1235be3
|
||||
parent = 0e2ef545f947d24c6add254874ab493ba84bbdc9
|
||||
commit = a8e5f1a184aeb8ba884166a1e4f386088d4a6cf1
|
||||
parent = 409c3cf9e190dbb65fe76570954939cbe8a5eca0
|
||||
method = merge
|
||||
cmdver = 0.4.1
|
||||
|
||||
2
emummc/README.md
vendored
2
emummc/README.md
vendored
@@ -2,7 +2,7 @@
|
||||
*A SDMMC driver replacement for Nintendo's Filesystem Services, by **m4xw***
|
||||
|
||||
### Supported Horizon Versions
|
||||
**1.0.0 - 20.0.0**
|
||||
**1.0.0 - 20.1.0**
|
||||
|
||||
## Features
|
||||
* Arbitrary SDMMC backend selection
|
||||
|
||||
8
emummc/source/FS/FS_offsets.c
vendored
8
emummc/source/FS/FS_offsets.c
vendored
@@ -77,6 +77,8 @@
|
||||
#include "offsets/1900_exfat.h"
|
||||
#include "offsets/2000.h"
|
||||
#include "offsets/2000_exfat.h"
|
||||
#include "offsets/2010.h"
|
||||
#include "offsets/2010_exfat.h"
|
||||
#include "../utils/fatal.h"
|
||||
|
||||
#define GET_OFFSET_STRUCT_NAME(vers) g_offsets##vers
|
||||
@@ -165,6 +167,8 @@ DEFINE_OFFSET_STRUCT(_1900);
|
||||
DEFINE_OFFSET_STRUCT(_1900_EXFAT);
|
||||
DEFINE_OFFSET_STRUCT(_2000);
|
||||
DEFINE_OFFSET_STRUCT(_2000_EXFAT);
|
||||
DEFINE_OFFSET_STRUCT(_2010);
|
||||
DEFINE_OFFSET_STRUCT(_2010_EXFAT);
|
||||
|
||||
const fs_offsets_t *get_fs_offsets(enum FS_VER version) {
|
||||
switch (version) {
|
||||
@@ -290,6 +294,10 @@ const fs_offsets_t *get_fs_offsets(enum FS_VER version) {
|
||||
return &(GET_OFFSET_STRUCT_NAME(_2000));
|
||||
case FS_VER_20_0_0_EXFAT:
|
||||
return &(GET_OFFSET_STRUCT_NAME(_2000_EXFAT));
|
||||
case FS_VER_20_1_0:
|
||||
return &(GET_OFFSET_STRUCT_NAME(_2010));
|
||||
case FS_VER_20_1_0_EXFAT:
|
||||
return &(GET_OFFSET_STRUCT_NAME(_2010_EXFAT));
|
||||
default:
|
||||
fatal_abort(Fatal_UnknownVersion);
|
||||
}
|
||||
|
||||
3
emummc/source/FS/FS_versions.h
vendored
3
emummc/source/FS/FS_versions.h
vendored
@@ -113,6 +113,9 @@ enum FS_VER
|
||||
FS_VER_20_0_0,
|
||||
FS_VER_20_0_0_EXFAT,
|
||||
|
||||
FS_VER_20_1_0,
|
||||
FS_VER_20_1_0_EXFAT,
|
||||
|
||||
FS_VER_MAX,
|
||||
};
|
||||
|
||||
|
||||
59
emummc/source/FS/offsets/2010.h
vendored
Normal file
59
emummc/source/FS/offsets/2010.h
vendored
Normal 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_2010_H__
|
||||
#define __FS_2010_H__
|
||||
|
||||
// Accessor vtable getters
|
||||
#define FS_OFFSET_2010_SDMMC_ACCESSOR_GC 0x1A7DB0
|
||||
#define FS_OFFSET_2010_SDMMC_ACCESSOR_SD 0x1AA130
|
||||
#define FS_OFFSET_2010_SDMMC_ACCESSOR_NAND 0x1A8560
|
||||
|
||||
// Hooks
|
||||
#define FS_OFFSET_2010_SDMMC_WRAPPER_READ 0x1A3C20
|
||||
#define FS_OFFSET_2010_SDMMC_WRAPPER_WRITE 0x1A3C80
|
||||
#define FS_OFFSET_2010_RTLD 0x2B594
|
||||
#define FS_OFFSET_2010_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x4C)))
|
||||
|
||||
#define FS_OFFSET_2010_CLKRST_SET_MIN_V_CLK_RATE 0x1C6150
|
||||
|
||||
// Misc funcs
|
||||
#define FS_OFFSET_2010_LOCK_MUTEX 0x19CD80
|
||||
#define FS_OFFSET_2010_UNLOCK_MUTEX 0x19CDD0
|
||||
|
||||
#define FS_OFFSET_2010_SDMMC_WRAPPER_CONTROLLER_OPEN 0x1A3BE0
|
||||
#define FS_OFFSET_2010_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x1A3C00
|
||||
|
||||
// Misc Data
|
||||
#define FS_OFFSET_2010_SD_MUTEX 0xFF5408
|
||||
#define FS_OFFSET_2010_NAND_MUTEX 0xFF0CF0
|
||||
#define FS_OFFSET_2010_ACTIVE_PARTITION 0xFF0D30
|
||||
#define FS_OFFSET_2010_SDMMC_DAS_HANDLE 0xFD2B08
|
||||
|
||||
// NOPs
|
||||
#define FS_OFFSET_2010_SD_DAS_INIT 0x289F4
|
||||
|
||||
// Nintendo Paths
|
||||
#define FS_OFFSET_2010_NINTENDO_PATHS \
|
||||
{ \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x0006DB14, .add_rel_offset = 0x00000004}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x0007CE1C, .add_rel_offset = 0x00000004}, \
|
||||
{.opcode_reg = 4, .adrp_offset = 0x00084A08, .add_rel_offset = 0x00000004}, \
|
||||
{.opcode_reg = 4, .adrp_offset = 0x0009AE48, .add_rel_offset = 0x00000004}, \
|
||||
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
|
||||
}
|
||||
|
||||
#endif // __FS_2010_H__
|
||||
59
emummc/source/FS/offsets/2010_exfat.h
vendored
Normal file
59
emummc/source/FS/offsets/2010_exfat.h
vendored
Normal 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_2010_EXFAT_H__
|
||||
#define __FS_2010_EXFAT_H__
|
||||
|
||||
// Accessor vtable getters
|
||||
#define FS_OFFSET_2010_EXFAT_SDMMC_ACCESSOR_GC 0x1B36D0
|
||||
#define FS_OFFSET_2010_EXFAT_SDMMC_ACCESSOR_SD 0x1B5A50
|
||||
#define FS_OFFSET_2010_EXFAT_SDMMC_ACCESSOR_NAND 0x1B3E80
|
||||
|
||||
// Hooks
|
||||
#define FS_OFFSET_2010_EXFAT_SDMMC_WRAPPER_READ 0x1AF540
|
||||
#define FS_OFFSET_2010_EXFAT_SDMMC_WRAPPER_WRITE 0x1AF5A0
|
||||
#define FS_OFFSET_2010_EXFAT_RTLD 0x2B594
|
||||
#define FS_OFFSET_2010_EXFAT_RTLD_DESTINATION ((uintptr_t)(INT64_C(-0x4C)))
|
||||
|
||||
#define FS_OFFSET_2010_EXFAT_CLKRST_SET_MIN_V_CLK_RATE 0x1D1A70
|
||||
|
||||
// Misc funcs
|
||||
#define FS_OFFSET_2010_EXFAT_LOCK_MUTEX 0x1A86A0
|
||||
#define FS_OFFSET_2010_EXFAT_UNLOCK_MUTEX 0x1A86F0
|
||||
|
||||
#define FS_OFFSET_2010_EXFAT_SDMMC_WRAPPER_CONTROLLER_OPEN 0x1AF500
|
||||
#define FS_OFFSET_2010_EXFAT_SDMMC_WRAPPER_CONTROLLER_CLOSE 0x1AF520
|
||||
|
||||
// Misc Data
|
||||
#define FS_OFFSET_2010_EXFAT_SD_MUTEX 0x1006408
|
||||
#define FS_OFFSET_2010_EXFAT_NAND_MUTEX 0x1001CF0
|
||||
#define FS_OFFSET_2010_EXFAT_ACTIVE_PARTITION 0x1001D30
|
||||
#define FS_OFFSET_2010_EXFAT_SDMMC_DAS_HANDLE 0xFDFB08
|
||||
|
||||
// NOPs
|
||||
#define FS_OFFSET_2010_EXFAT_SD_DAS_INIT 0x289F4
|
||||
|
||||
// Nintendo Paths
|
||||
#define FS_OFFSET_2010_EXFAT_NINTENDO_PATHS \
|
||||
{ \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x0006DB14, .add_rel_offset = 0x00000004}, \
|
||||
{.opcode_reg = 3, .adrp_offset = 0x0007CE1C, .add_rel_offset = 0x00000004}, \
|
||||
{.opcode_reg = 4, .adrp_offset = 0x00084A08, .add_rel_offset = 0x00000004}, \
|
||||
{.opcode_reg = 4, .adrp_offset = 0x0009AE48, .add_rel_offset = 0x00000004}, \
|
||||
{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \
|
||||
}
|
||||
|
||||
#endif // __FS_2010_EXFAT_H__
|
||||
@@ -70,6 +70,6 @@ clean:
|
||||
@$(MAKE) --no-print-directory -C $(ATMOSPHERE_LIBRARIES_DIR)/libexosphere -f $(ATMOSPHERE_LIBRARIES_DIR)/libexosphere/libexosphere.mk clean
|
||||
@$(MAKE) --no-print-directory -C $(ATMOSPHERE_LIBRARIES_DIR)/libexosphere -f $(ATMOSPHERE_LIBRARIES_DIR)/libexosphere/libexosphere.mk clean ATMOSPHERE_CPU="$(strip $(ATMOSPHERE_BOOT_CPU))"
|
||||
@rm -fr $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR)
|
||||
@for i in $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR); do [ -d $$i ] && rmdir --ignore-fail-on-non-empty $$i || true; done
|
||||
@for i in $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR); do [ -d $$i ] && rmdir $$i 2>/dev/null || true; done
|
||||
|
||||
.PHONY: all clean check_lib check_boot_lib check_loader_stub check_program check_mariko_fatal check_warmboot
|
||||
@@ -119,7 +119,7 @@ DEPENDS := $(OFILES:.o=.d)
|
||||
#---------------------------------------------------------------------------------
|
||||
|
||||
$(OUTPUT).lz4 : $(OUTPUT).bin
|
||||
@python $(CURRENT_DIRECTORY)/split_program.py $(OUTPUT).bin $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR)
|
||||
$(SILENTCMD)$(PYTHON) $(CURRENT_DIRECTORY)/split_program.py $(OUTPUT).bin $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR)
|
||||
@echo built ... $(notdir $@)
|
||||
|
||||
$(OUTPUT).bin : $(OUTPUT).elf
|
||||
|
||||
@@ -101,10 +101,10 @@ namespace ams::secmon::smc {
|
||||
#include "secmon_define_mc01_access_table.inc"
|
||||
|
||||
constexpr const AccessTableEntry AccessTables[] = {
|
||||
{ PmcAccessTable::ReducedAccessTable.data(), MemoryRegionVirtualDevicePmc.GetAddress(), PmcAccessTable::Address, PmcAccessTable::Size, },
|
||||
{ McAccessTable::ReducedAccessTable.data(), MemoryRegionVirtualDeviceMemoryController.GetAddress(), McAccessTable::Address, McAccessTable::Size, },
|
||||
{ Mc01AccessTable::ReducedAccessTable.data(), MemoryRegionVirtualDeviceMemoryController0.GetAddress(), Mc01AccessTable::Address + MemoryRegionPhysicalDeviceMemoryController0.GetAddress(), Mc01AccessTable::Size, },
|
||||
{ Mc01AccessTable::ReducedAccessTable.data(), MemoryRegionVirtualDeviceMemoryController1.GetAddress(), Mc01AccessTable::Address + MemoryRegionPhysicalDeviceMemoryController1.GetAddress(), Mc01AccessTable::Size, },
|
||||
{ PmcAccessTable::ReducedAccessTable.data(), MemoryRegionVirtualDevicePmc.GetAddress(), PmcAccessTable::Address, PmcAccessTable::Size, },
|
||||
{ McAccessTable::ReducedAccessTable.data(), MemoryRegionVirtualDeviceMemoryController.GetAddress(), McAccessTable::Address, McAccessTable::Size, },
|
||||
{ Mc01AccessTable::ReducedAccessTable.data(), Mc01AccessTable::Address + MemoryRegionVirtualDeviceMemoryController0.GetAddress(), Mc01AccessTable::Address + MemoryRegionPhysicalDeviceMemoryController0.GetAddress(), Mc01AccessTable::Size, },
|
||||
{ Mc01AccessTable::ReducedAccessTable.data(), Mc01AccessTable::Address + MemoryRegionVirtualDeviceMemoryController1.GetAddress(), Mc01AccessTable::Address + MemoryRegionPhysicalDeviceMemoryController1.GetAddress(), Mc01AccessTable::Size, },
|
||||
};
|
||||
|
||||
constexpr bool IsAccessAllowed(const AccessTableEntry &entry, uintptr_t address) {
|
||||
|
||||
@@ -43,6 +43,6 @@ clean:
|
||||
@$(MAKE) --no-print-directory -C $(CURRENT_DIRECTORY)/loader_stub -f $(CURRENT_DIRECTORY)/loader_stub/loader_stub.mk clean
|
||||
@$(MAKE) --no-print-directory -C $(CURRENT_DIRECTORY)/program -f $(CURRENT_DIRECTORY)/program/program.mk clean
|
||||
@rm -fr $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR)
|
||||
@for i in $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR); do [ -d $$i ] && rmdir --ignore-fail-on-non-empty $$i || true; done
|
||||
@for i in $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR); do [ -d $$i ] && rmdir $$i 2>/dev/null || true; done
|
||||
|
||||
.PHONY: all clean check_lib check_loader_stub check_program
|
||||
@@ -84,7 +84,7 @@ DEPENDS := $(OFILES:.o=.d)
|
||||
#---------------------------------------------------------------------------------
|
||||
|
||||
$(OUTPUT).lz4 : $(OUTPUT).bin
|
||||
@python $(CURRENT_DIRECTORY)/lz4_compress.py $(OUTPUT).bin $(OUTPUT).lz4
|
||||
$(SILENTCMD)$(PYTHON) $(CURRENT_DIRECTORY)/lz4_compress.py $(OUTPUT).bin $(OUTPUT).lz4
|
||||
@echo built ... $(notdir $@)
|
||||
|
||||
$(OUTPUT).bin : $(OUTPUT).elf
|
||||
|
||||
@@ -183,6 +183,9 @@ namespace ams::nxboot {
|
||||
FsVersion_20_0_0,
|
||||
FsVersion_20_0_0_Exfat,
|
||||
|
||||
FsVersion_20_1_0,
|
||||
FsVersion_20_1_0_Exfat,
|
||||
|
||||
FsVersion_Count,
|
||||
};
|
||||
|
||||
@@ -278,6 +281,9 @@ namespace ams::nxboot {
|
||||
|
||||
{ 0x63, 0x54, 0x96, 0x9E, 0x60, 0xA7, 0x97, 0x7B }, /* FsVersion_20_0_0 */
|
||||
{ 0x47, 0x41, 0x07, 0x10, 0x65, 0x4F, 0xA4, 0x3F }, /* FsVersion_20_0_0_Exfat */
|
||||
|
||||
{ 0xED, 0x34, 0xB4, 0x50, 0x58, 0x4A, 0x5B, 0x43 }, /* FsVersion_20_1_0 */
|
||||
{ 0xA5, 0x1A, 0xA4, 0x92, 0x6C, 0x41, 0x87, 0x59 }, /* FsVersion_20_1_0_Exfat */
|
||||
};
|
||||
|
||||
const InitialProcessBinaryHeader *FindInitialProcessBinary(const pkg2::Package2Header *header, const u8 *data, ams::TargetFirmware target_firmware) {
|
||||
@@ -668,11 +674,13 @@ namespace ams::nxboot {
|
||||
AddPatch(fs_meta, 0x17A9A0, NogcPatch1, sizeof(NogcPatch1));
|
||||
break;
|
||||
case FsVersion_20_0_0:
|
||||
case FsVersion_20_1_0:
|
||||
AddPatch(fs_meta, 0x1A7E25, NogcPatch0, sizeof(NogcPatch0));
|
||||
AddPatch(fs_meta, 0x1A8025, NogcPatch0, sizeof(NogcPatch0));
|
||||
AddPatch(fs_meta, 0x17C250, NogcPatch1, sizeof(NogcPatch1));
|
||||
break;
|
||||
case FsVersion_20_0_0_Exfat:
|
||||
case FsVersion_20_1_0_Exfat:
|
||||
AddPatch(fs_meta, 0x1B3745, NogcPatch0, sizeof(NogcPatch0));
|
||||
AddPatch(fs_meta, 0x1B3945, NogcPatch0, sizeof(NogcPatch0));
|
||||
AddPatch(fs_meta, 0x187B70, NogcPatch1, sizeof(NogcPatch1));
|
||||
|
||||
BIN
img/np++.png
Normal file
BIN
img/np++.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.2 KiB |
@@ -6,7 +6,7 @@
|
||||
[subrepo]
|
||||
remote = https://github.com/Atmosphere-NX/Atmosphere-libs
|
||||
branch = master
|
||||
commit = 9e8cbe3faa4604e9ae162546d13a74755ce30667
|
||||
parent = 4d4f0ba96876d20e505c7aa11c9bf215f276dd8b
|
||||
commit = bbd085442eb240f400ab26bd808ad18c42ceb103
|
||||
parent = 98bc030b37a24b76a130b418f846d2dabc47bf27
|
||||
method = merge
|
||||
cmdver = 0.4.1
|
||||
|
||||
@@ -297,6 +297,23 @@ FIND_SOURCE_FILES=$(foreach dir,$1,$(filter-out $(notdir $(wildcard $(dir)/*.arc
|
||||
|
||||
ATMOSPHERE_GCH_IDENTIFIER := $(ATMOSPHERE_FULL_NAME)
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# Python. The scripts should work with Python 2 or 3, but 2 is preferred.
|
||||
#---------------------------------------------------------------------------------
|
||||
PYTHON = $(shell command -v python >/dev/null && echo python || echo python3)
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# Export MAKE:
|
||||
# GCC's LTO driver invokes Make internally. This invocation respects both $(MAKE)
|
||||
# and $(MAKEFLAGS), but only if they're in the environment. By default, MAKEFLAGS
|
||||
# is in the environment while MAKE isn't, so GCC will always use the default
|
||||
# `make` command, yet it inherits MAKEFLAGS from the copy of Make the user
|
||||
# invoked, which might have incompatible flags. In practice this is an issue on
|
||||
# macOS when running e.g. `gmake -j32 -Otarget`. This behavior is arguably a bug
|
||||
# in GCC and/or Make, but we can work around it by exporting MAKE.
|
||||
#---------------------------------------------------------------------------------
|
||||
export MAKE
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# Rules for compiling pre-compiled headers
|
||||
#---------------------------------------------------------------------------------
|
||||
|
||||
@@ -104,7 +104,7 @@ clean:
|
||||
@echo clean $(ATMOSPHERE_BUILD_NAME) ...
|
||||
@rm -fr $(ATMOSPHERE_BUILD_DIR) $(ATMOSPHERE_OUT_DIR)
|
||||
@rm -fr $(foreach hdr,$(GCH_DIRS),$(hdr)/$(ATMOSPHERE_GCH_IDENTIFIER))
|
||||
@for i in $(GCH_DIRS); do [ -d $$i ] && rmdir --ignore-fail-on-non-empty $$i || true; done
|
||||
@for i in $(GCH_DIRS); do [ -d $$i ] && rmdir $$i 2>/dev/null || true; done
|
||||
|
||||
$(ATMOSPHERE_LIBRARY_DIR) $(ATMOSPHERE_BUILD_DIR) $(GCH_DIRS):
|
||||
@[ -d $@ ] || mkdir -p $@
|
||||
|
||||
@@ -116,7 +116,9 @@ namespace ams::kern::arch::arm {
|
||||
u32 ipriorityr[NumLocalInterrupts / 4];
|
||||
u32 itargetsr[NumLocalInterrupts / 4];
|
||||
u32 icfgr[NumLocalInterrupts / 16];
|
||||
u32 spendsgir[4];
|
||||
};
|
||||
static_assert(sizeof(LocalState{}.spendsgir) == sizeof(GicDistributor{}.spendsgir));
|
||||
|
||||
struct GlobalState {
|
||||
u32 isenabler[NumGlobalInterrupts / 32];
|
||||
|
||||
@@ -86,7 +86,7 @@ clean:
|
||||
@echo clean $(ATMOSPHERE_BUILD_NAME) ...
|
||||
@rm -fr $(ATMOSPHERE_BUILD_DIR) $(ATMOSPHERE_OUT_DIR)
|
||||
@rm -fr $(foreach hdr,$(GCH_DIRS),$(hdr)/$(ATMOSPHERE_GCH_IDENTIFIER))
|
||||
@for i in $(GCH_DIRS); do [ -d $$i ] && rmdir --ignore-fail-on-non-empty $$i || true; done
|
||||
@for i in $(GCH_DIRS); do [ -d $$i ] && rmdir $$i 2>/dev/null || true; done
|
||||
|
||||
$(ATMOSPHERE_LIBRARY_DIR) $(ATMOSPHERE_BUILD_DIR) $(GCH_DIRS):
|
||||
@[ -d $@ ] || mkdir -p $@
|
||||
|
||||
@@ -113,6 +113,11 @@ namespace ams::kern::arch::arm {
|
||||
constexpr size_t Offset = 0;
|
||||
state->icfgr[i] = m_gicd->icfgr[i + Offset];
|
||||
}
|
||||
|
||||
/* Save spendsgir. */
|
||||
for (size_t i = 0; i < util::size(state->spendsgir); ++i) {
|
||||
state->spendsgir[i] = m_gicd->spendsgir[i];
|
||||
}
|
||||
}
|
||||
|
||||
void KInterruptController::SaveGlobal(GlobalState *state) const {
|
||||
@@ -168,6 +173,11 @@ namespace ams::kern::arch::arm {
|
||||
m_gicd->icenabler[i + Offset] = 0xFFFFFFFF;
|
||||
m_gicd->isenabler[i + Offset] = state->isenabler[i];
|
||||
}
|
||||
|
||||
/* Restore spendsgir. */
|
||||
for (size_t i = 0; i < util::size(state->spendsgir); ++i) {
|
||||
m_gicd->spendsgir[i] = state->spendsgir[i];
|
||||
}
|
||||
}
|
||||
|
||||
void KInterruptController::RestoreGlobal(const GlobalState *state) const {
|
||||
|
||||
@@ -112,7 +112,7 @@ namespace ams::kern::arch::arm64::cpu {
|
||||
class KCoreBarrierInterruptHandler : public KInterruptHandler {
|
||||
private:
|
||||
util::Atomic<u64> m_target_cores;
|
||||
KSpinLock m_lock;
|
||||
KLightLock m_lock;
|
||||
public:
|
||||
constexpr KCoreBarrierInterruptHandler() : KInterruptHandler(), m_target_cores(0), m_lock() { /* ... */ }
|
||||
|
||||
@@ -123,11 +123,8 @@ namespace ams::kern::arch::arm64::cpu {
|
||||
}
|
||||
|
||||
void SynchronizeCores(u64 core_mask) {
|
||||
/* Disable dispatch while we synchronize. */
|
||||
KScopedDisableDispatch dd;
|
||||
|
||||
/* Acquire exclusive access to ourselves. */
|
||||
KScopedSpinLock lk(m_lock);
|
||||
KScopedLightLock lk(m_lock);
|
||||
|
||||
/* If necessary, force synchronization with other cores. */
|
||||
if (const u64 other_cores_mask = core_mask & ~(1ul << GetCurrentCoreId()); other_cores_mask != 0) {
|
||||
|
||||
@@ -524,6 +524,14 @@ namespace ams::kern::board::nintendo::nx {
|
||||
/* Ensure that all cores get to this point before continuing. */
|
||||
cpu::SynchronizeAllCores();
|
||||
|
||||
/* Wait 100us before continuing. */
|
||||
{
|
||||
const s64 timeout = KHardwareTimer::GetTick() + ams::svc::Tick(TimeSpan::FromMicroSeconds(100));
|
||||
while (KHardwareTimer::GetTick() < timeout) {
|
||||
__asm__ __volatile__("" ::: "memory");
|
||||
}
|
||||
}
|
||||
|
||||
/* Save the interrupt manager's state. */
|
||||
Kernel::GetInterruptManager().Save(core_id);
|
||||
|
||||
|
||||
@@ -926,6 +926,7 @@
|
||||
HANDLER(GameCardLastAwakenFailureResult, 732, GameCardDetailedErrorInfo, FieldType_NumericU32, FieldFlag_None ) \
|
||||
HANDLER(GameCardInsertedTimestamp, 733, GameCardDetailedErrorInfo, FieldType_NumericI64, FieldFlag_None ) \
|
||||
HANDLER(GameCardPreviousInsertedTimestamp, 734, GameCardDetailedErrorInfo, FieldType_NumericI64, FieldFlag_None ) \
|
||||
HANDLER(WlanChipResetTriggered, 735, WlanInfo, FieldType_Bool, FieldFlag_None ) \
|
||||
HANDLER(TestStringNx, 1000, TestNx, FieldType_String, FieldFlag_None ) \
|
||||
HANDLER(BoostModeCurrentLimit, 1001, BatteryChargeInfo, FieldType_NumericI32, FieldFlag_None ) \
|
||||
HANDLER(ChargeConfiguration, 1002, BatteryChargeInfo, FieldType_NumericI32, FieldFlag_None ) \
|
||||
|
||||
@@ -89,6 +89,12 @@ namespace ams::hos {
|
||||
Version_19_0_1 = ::ams::TargetFirmware_19_0_1,
|
||||
Version_20_0_0 = ::ams::TargetFirmware_20_0_0,
|
||||
Version_20_0_1 = ::ams::TargetFirmware_20_0_1,
|
||||
Version_20_1_0 = ::ams::TargetFirmware_20_1_0,
|
||||
Version_20_1_1 = ::ams::TargetFirmware_20_1_1,
|
||||
Version_20_1_5 = ::ams::TargetFirmware_20_1_5,
|
||||
Version_20_2_0 = ::ams::TargetFirmware_20_2_0,
|
||||
Version_20_3_0 = ::ams::TargetFirmware_20_3_0,
|
||||
Version_20_4_0 = ::ams::TargetFirmware_20_4_0,
|
||||
|
||||
Version_Current = ::ams::TargetFirmware_Current,
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ clean:
|
||||
@echo clean $(ATMOSPHERE_BUILD_NAME) ...
|
||||
@rm -fr $(ATMOSPHERE_BUILD_DIR) $(ATMOSPHERE_OUT_DIR)
|
||||
@rm -fr $(foreach hdr,$(GCH_DIRS),$(hdr)/$(ATMOSPHERE_GCH_IDENTIFIER))
|
||||
@for i in $(GCH_DIRS); do [ -d $$i ] && rmdir --ignore-fail-on-non-empty $$i || true; done
|
||||
@for i in $(GCH_DIRS); do [ -d $$i ] && rmdir $$i 2>/dev/null || true; done
|
||||
|
||||
$(ATMOSPHERE_LIBRARY_DIR) $(ATMOSPHERE_BUILD_DIR) $(GCH_DIRS):
|
||||
@[ -d $@ ] || mkdir -p $@
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
|
||||
#define ATMOSPHERE_RELEASE_VERSION_MAJOR 1
|
||||
#define ATMOSPHERE_RELEASE_VERSION_MINOR 9
|
||||
#define ATMOSPHERE_RELEASE_VERSION_MICRO 0
|
||||
#define ATMOSPHERE_RELEASE_VERSION_MICRO 4
|
||||
|
||||
#define ATMOSPHERE_RELEASE_VERSION ATMOSPHERE_RELEASE_VERSION_MAJOR, ATMOSPHERE_RELEASE_VERSION_MINOR, ATMOSPHERE_RELEASE_VERSION_MICRO
|
||||
|
||||
#define ATMOSPHERE_SUPPORTED_HOS_VERSION_MAJOR 20
|
||||
#define ATMOSPHERE_SUPPORTED_HOS_VERSION_MINOR 0
|
||||
#define ATMOSPHERE_SUPPORTED_HOS_VERSION_MINOR 4
|
||||
#define ATMOSPHERE_SUPPORTED_HOS_VERSION_MICRO 0
|
||||
|
||||
@@ -87,8 +87,14 @@
|
||||
#define ATMOSPHERE_TARGET_FIRMWARE_19_0_1 ATMOSPHERE_TARGET_FIRMWARE(19, 0, 1)
|
||||
#define ATMOSPHERE_TARGET_FIRMWARE_20_0_0 ATMOSPHERE_TARGET_FIRMWARE(20, 0, 0)
|
||||
#define ATMOSPHERE_TARGET_FIRMWARE_20_0_1 ATMOSPHERE_TARGET_FIRMWARE(20, 0, 1)
|
||||
#define ATMOSPHERE_TARGET_FIRMWARE_20_1_0 ATMOSPHERE_TARGET_FIRMWARE(20, 1, 0)
|
||||
#define ATMOSPHERE_TARGET_FIRMWARE_20_1_1 ATMOSPHERE_TARGET_FIRMWARE(20, 1, 1)
|
||||
#define ATMOSPHERE_TARGET_FIRMWARE_20_1_5 ATMOSPHERE_TARGET_FIRMWARE(20, 1, 5)
|
||||
#define ATMOSPHERE_TARGET_FIRMWARE_20_2_0 ATMOSPHERE_TARGET_FIRMWARE(20, 2, 0)
|
||||
#define ATMOSPHERE_TARGET_FIRMWARE_20_3_0 ATMOSPHERE_TARGET_FIRMWARE(20, 3, 0)
|
||||
#define ATMOSPHERE_TARGET_FIRMWARE_20_4_0 ATMOSPHERE_TARGET_FIRMWARE(20, 4, 0)
|
||||
|
||||
#define ATMOSPHERE_TARGET_FIRMWARE_CURRENT ATMOSPHERE_TARGET_FIRMWARE_20_0_1
|
||||
#define ATMOSPHERE_TARGET_FIRMWARE_CURRENT ATMOSPHERE_TARGET_FIRMWARE_20_4_0
|
||||
|
||||
#define ATMOSPHERE_TARGET_FIRMWARE_MIN ATMOSPHERE_TARGET_FIRMWARE(0, 0, 0)
|
||||
#define ATMOSPHERE_TARGET_FIRMWARE_MAX ATMOSPHERE_TARGET_FIRMWARE_CURRENT
|
||||
@@ -168,6 +174,12 @@ namespace ams {
|
||||
TargetFirmware_19_0_1 = ATMOSPHERE_TARGET_FIRMWARE_19_0_1,
|
||||
TargetFirmware_20_0_0 = ATMOSPHERE_TARGET_FIRMWARE_20_0_0,
|
||||
TargetFirmware_20_0_1 = ATMOSPHERE_TARGET_FIRMWARE_20_0_1,
|
||||
TargetFirmware_20_1_0 = ATMOSPHERE_TARGET_FIRMWARE_20_1_0,
|
||||
TargetFirmware_20_1_1 = ATMOSPHERE_TARGET_FIRMWARE_20_1_1,
|
||||
TargetFirmware_20_1_5 = ATMOSPHERE_TARGET_FIRMWARE_20_1_5,
|
||||
TargetFirmware_20_2_0 = ATMOSPHERE_TARGET_FIRMWARE_20_2_0,
|
||||
TargetFirmware_20_3_0 = ATMOSPHERE_TARGET_FIRMWARE_20_3_0,
|
||||
TargetFirmware_20_4_0 = ATMOSPHERE_TARGET_FIRMWARE_20_4_0,
|
||||
|
||||
TargetFirmware_Current = ATMOSPHERE_TARGET_FIRMWARE_CURRENT,
|
||||
|
||||
|
||||
@@ -44,8 +44,9 @@
|
||||
#include <bit>
|
||||
#include <span>
|
||||
|
||||
/* Stratosphere wants additional libstdc++ headers, others do not. */
|
||||
#ifdef ATMOSPHERE_IS_STRATOSPHERE
|
||||
/* Stratosphere/Troposphere want additional libstdc++ headers and libnx,
|
||||
* others do not. */
|
||||
#if defined(ATMOSPHERE_IS_STRATOSPHERE) || defined(ATMOSPHERE_IS_TROPOSPHERE)
|
||||
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
@@ -71,7 +72,7 @@
|
||||
/* Non-EL0 code can't include libnx. */
|
||||
#include "types.hpp"
|
||||
|
||||
#endif /* ATMOSPHERE_IS_STRATOSPHERE */
|
||||
#endif /* defined(ATMOSPHERE_IS_STRATOSPHERE) || defined(ATMOSPHERE_IS_TROPOSPHERE) */
|
||||
|
||||
/* Atmosphere meta. */
|
||||
#include <vapours/ams_version.h>
|
||||
|
||||
@@ -8,7 +8,7 @@ include $(CURRENT_DIRECTORY)/../libraries/config/common.mk
|
||||
all: $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR)/mesosphere.bin
|
||||
|
||||
$(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR)/mesosphere.bin: $(CURRENT_DIRECTORY)/kernel/$(ATMOSPHERE_OUT_DIR)/kernel.bin $(CURRENT_DIRECTORY)/kernel_ldr/$(ATMOSPHERE_OUT_DIR)/kernel_ldr.bin $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR)
|
||||
@python build_mesosphere.py $(CURRENT_DIRECTORY)/kernel_ldr/$(ATMOSPHERE_OUT_DIR)/kernel_ldr.bin $(CURRENT_DIRECTORY)/kernel/$(ATMOSPHERE_OUT_DIR)/kernel.bin $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR)/mesosphere.bin
|
||||
$(SILENTCMD)$(PYTHON) build_mesosphere.py $(CURRENT_DIRECTORY)/kernel_ldr/$(ATMOSPHERE_OUT_DIR)/kernel_ldr.bin $(CURRENT_DIRECTORY)/kernel/$(ATMOSPHERE_OUT_DIR)/kernel.bin $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR)/mesosphere.bin
|
||||
@echo "Built mesosphere.bin..."
|
||||
|
||||
$(CURRENT_DIRECTORY)/kernel/$(ATMOSPHERE_OUT_DIR)/kernel.bin: check_kernel
|
||||
@@ -44,6 +44,6 @@ clean:
|
||||
@$(MAKE) --no-print-directory -C $(CURRENT_DIRECTORY)/kernel -f $(CURRENT_DIRECTORY)/kernel/kernel.mk clean
|
||||
@$(MAKE) --no-print-directory -C $(CURRENT_DIRECTORY)/kernel_ldr -f $(CURRENT_DIRECTORY)/kernel_ldr/kernel_ldr.mk clean
|
||||
@rm -fr $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR)/mesosphere.bin
|
||||
@for i in $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR); do [ -d $$i ] && rmdir --ignore-fail-on-non-empty $$i || true; done
|
||||
@for i in $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR); do [ -d $$i ] && rmdir $$i 2>/dev/null || true; done
|
||||
|
||||
.PHONY: all clean check_lib check_kernel check_kernel_ldr
|
||||
@@ -215,43 +215,47 @@ namespace ams::mitm::fs {
|
||||
using namespace ams::fs;
|
||||
|
||||
std::shared_ptr<ams::fs::IStorage> GetLayeredRomfsStorage(ncm::ProgramId program_id, ::FsStorage &data_storage, bool is_process_romfs) {
|
||||
std::scoped_lock lk(g_storage_set_mutex);
|
||||
/*Prepare to find or create a new storage. */
|
||||
LayeredRomfsStorageImpl *impl = nullptr;
|
||||
{
|
||||
std::scoped_lock lk(g_storage_set_mutex);
|
||||
|
||||
/* Find an existing storage. */
|
||||
if (auto it = g_storage_set.find_key(program_id.value); it != g_storage_set.end()) {
|
||||
return std::make_shared<LayeredRomfsStorage>(it->GetImpl());
|
||||
}
|
||||
/* Find an existing storage. */
|
||||
if (auto it = g_storage_set.find_key(program_id.value); it != g_storage_set.end()) {
|
||||
return std::make_shared<LayeredRomfsStorage>(it->GetImpl());
|
||||
}
|
||||
|
||||
/* We don't have an existing storage. If we're creating process romfs, free any unreferenced process romfs. */
|
||||
/* This should help prevent too much memory in use at any time. */
|
||||
if (is_process_romfs) {
|
||||
auto it = g_storage_set.begin();
|
||||
while (it != g_storage_set.end()) {
|
||||
if (it->GetReferenceCount() > 0 || !it->IsProcessRomfs()) {
|
||||
++it;
|
||||
} else {
|
||||
auto *holder = std::addressof(*it);
|
||||
it = g_storage_set.erase(it);
|
||||
delete holder;
|
||||
/* We don't have an existing storage. If we're creating process romfs, free any unreferenced process romfs. */
|
||||
/* This should help prevent too much memory in use at any time. */
|
||||
if (is_process_romfs) {
|
||||
auto it = g_storage_set.begin();
|
||||
while (it != g_storage_set.end()) {
|
||||
if (it->GetReferenceCount() > 0 || !it->IsProcessRomfs()) {
|
||||
++it;
|
||||
} else {
|
||||
auto *holder = std::addressof(*it);
|
||||
it = g_storage_set.erase(it);
|
||||
delete holder;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Create a new storage. */
|
||||
LayeredRomfsStorageImpl *impl;
|
||||
{
|
||||
::FsFile data_file;
|
||||
if (R_SUCCEEDED(OpenAtmosphereSdFile(std::addressof(data_file), program_id, "romfs.bin", OpenMode_Read))) {
|
||||
impl = new LayeredRomfsStorageImpl(std::make_unique<ReadOnlyStorageAdapter>(new RemoteStorage(data_storage)), std::make_unique<ReadOnlyStorageAdapter>(new FileStorage(new RemoteFile(data_file))), program_id);
|
||||
} else {
|
||||
impl = new LayeredRomfsStorageImpl(std::make_unique<ReadOnlyStorageAdapter>(new RemoteStorage(data_storage)), nullptr, program_id);
|
||||
/* Create a new storage. */
|
||||
{
|
||||
::FsFile data_file;
|
||||
if (R_SUCCEEDED(OpenAtmosphereSdFile(std::addressof(data_file), program_id, "romfs.bin", OpenMode_Read))) {
|
||||
impl = new LayeredRomfsStorageImpl(std::make_unique<ReadOnlyStorageAdapter>(new RemoteStorage(data_storage)), std::make_unique<ReadOnlyStorageAdapter>(new FileStorage(new RemoteFile(data_file))), program_id);
|
||||
} else {
|
||||
impl = new LayeredRomfsStorageImpl(std::make_unique<ReadOnlyStorageAdapter>(new RemoteStorage(data_storage)), nullptr, program_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Insert holder. Reference count will now be one. */
|
||||
g_storage_set.insert(*(new LayeredRomfsStorageHolder(impl, is_process_romfs)));
|
||||
/* Insert holder. Reference count will now be one. */
|
||||
g_storage_set.insert(*(new LayeredRomfsStorageHolder(impl, is_process_romfs)));
|
||||
}
|
||||
|
||||
/* Begin initialization. When this finishes, a decref will occur. */
|
||||
AMS_ABORT_UNLESS(impl != nullptr);
|
||||
impl->BeginInitialize();
|
||||
|
||||
/* Return a new shared storage for the impl. */
|
||||
|
||||
@@ -36,6 +36,11 @@ namespace ams::mitm::fs {
|
||||
};
|
||||
|
||||
constexpr const ApplicationWithDynamicHeapInfo ApplicationsWithDynamicHeap[] = {
|
||||
/* STAR WARS: Knights of the Old Republic II: The Sith Lords. */
|
||||
/* Requirement ? MB. 16 MB stolen heap fixes a crash, though. */
|
||||
/* Unknown heap sensitivity. */
|
||||
{ 0x0100B2C016252000, 16_MB, 0_MB },
|
||||
|
||||
/* Animal Crossing: New Horizons. */
|
||||
/* Requirement ~24 MB. */
|
||||
/* No particular heap sensitivity. */
|
||||
|
||||
@@ -74,6 +74,11 @@ constexpr inline const EmbeddedPatchEntry Usb30ForceEnablePatches_20_0_0[] = {
|
||||
{ 0x7090, "\x20\x00\x80\x52\xC0\x03\x5F\xD6", 8 },
|
||||
};
|
||||
|
||||
constexpr inline const EmbeddedPatchEntry Usb30ForceEnablePatches_20_1_0[] = {
|
||||
{ 0x7010, "\x20\x00\x80\x52\xC0\x03\x5F\xD6", 8 },
|
||||
{ 0x7090, "\x20\x00\x80\x52\xC0\x03\x5F\xD6", 8 },
|
||||
};
|
||||
|
||||
constexpr inline const EmbeddedPatch Usb30ForceEnablePatches[] = {
|
||||
{ ParseModuleId("C0D3F4E87E8B0FE9BBE9F1968A20767F3DC08E03"), util::size(Usb30ForceEnablePatches_9_0_0), Usb30ForceEnablePatches_9_0_0 },
|
||||
{ ParseModuleId("B9C700CA8335F8BAA0D2041D8D09F772890BA988"), util::size(Usb30ForceEnablePatches_10_0_0), Usb30ForceEnablePatches_10_0_0 },
|
||||
@@ -88,4 +93,5 @@ constexpr inline const EmbeddedPatch Usb30ForceEnablePatches[] = {
|
||||
{ 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("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.1.1 */
|
||||
};
|
||||
|
||||
@@ -95,7 +95,7 @@ $(ATMOSPHERE_OUT_DIR) $(ATMOSPHERE_BUILD_DIR):
|
||||
clean:
|
||||
@echo clean ...
|
||||
@rm -fr $(BUILD) $(BOARD_TARGET) $(TARGET).elf
|
||||
@for i in $(ATMOSPHERE_OUT_DIR) $(ATMOSPHERE_BUILD_DIR); do [ -d $$i ] && rmdir --ignore-fail-on-non-empty $$i || true; done
|
||||
@for i in $(ATMOSPHERE_OUT_DIR) $(ATMOSPHERE_BUILD_DIR); do [ -d $$i ] && rmdir $$i 2>/dev/null || true; done
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
|
||||
@@ -95,7 +95,7 @@ $(ATMOSPHERE_OUT_DIR) $(ATMOSPHERE_BUILD_DIR):
|
||||
clean:
|
||||
@echo clean ...
|
||||
@rm -fr $(BUILD) $(BOARD_TARGET) $(TARGET).elf
|
||||
@for i in $(ATMOSPHERE_OUT_DIR) $(ATMOSPHERE_BUILD_DIR); do [ -d $$i ] && rmdir --ignore-fail-on-non-empty $$i || true; done
|
||||
@for i in $(ATMOSPHERE_OUT_DIR) $(ATMOSPHERE_BUILD_DIR); do [ -d $$i ] && rmdir $$i 2>/dev/null || true; done
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
|
||||
@@ -95,7 +95,7 @@ $(ATMOSPHERE_OUT_DIR) $(ATMOSPHERE_BUILD_DIR):
|
||||
clean:
|
||||
@echo clean ...
|
||||
@rm -fr $(BUILD) $(BOARD_TARGET) $(TARGET).elf
|
||||
@for i in $(ATMOSPHERE_OUT_DIR) $(ATMOSPHERE_BUILD_DIR); do [ -d $$i ] && rmdir --ignore-fail-on-non-empty $$i || true; done
|
||||
@for i in $(ATMOSPHERE_OUT_DIR) $(ATMOSPHERE_BUILD_DIR); do [ -d $$i ] && rmdir $$i 2>/dev/null || true; done
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
|
||||
@@ -95,7 +95,7 @@ $(ATMOSPHERE_OUT_DIR) $(ATMOSPHERE_BUILD_DIR):
|
||||
clean:
|
||||
@echo clean ...
|
||||
@rm -fr $(BUILD) $(BOARD_TARGET) $(TARGET).elf
|
||||
@for i in $(ATMOSPHERE_OUT_DIR) $(ATMOSPHERE_BUILD_DIR); do [ -d $$i ] && rmdir --ignore-fail-on-non-empty $$i || true; done
|
||||
@for i in $(ATMOSPHERE_OUT_DIR) $(ATMOSPHERE_BUILD_DIR); do [ -d $$i ] && rmdir $$i 2>/dev/null || true; done
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
|
||||
@@ -50,6 +50,8 @@ ARCH := -march=armv8-a+crc+crypto -mtune=cortex-a57 -mtp=soft -fPIE
|
||||
CFLAGS := -g -Wall -O2 -ffunction-sections \
|
||||
$(ARCH) $(DEFINES)
|
||||
|
||||
CFLAGS += -Wno-misleading-indentation -Wno-use-after-free -Wno-unused-function
|
||||
|
||||
CFLAGS += $(INCLUDE) -D__SWITCH__
|
||||
|
||||
CXXFLAGS := $(CFLAGS) -std=gnu++17 -fno-exceptions -fno-rtti
|
||||
|
||||
@@ -1277,7 +1277,7 @@ namespace dbk {
|
||||
if (InitializeMenu(screen_width, screen_height)) {
|
||||
|
||||
/* Set the update path. */
|
||||
strncpy(g_update_path, update_path, sizeof(g_update_path));
|
||||
strncpy(g_update_path, update_path, sizeof(g_update_path)-1);
|
||||
|
||||
/* Change the menu. */
|
||||
ChangeMenu(std::make_shared<ValidateUpdateMenu>(g_current_menu));
|
||||
|
||||
@@ -15,7 +15,9 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#define ATMOSPHERE_IS_TROPOSPHERE
|
||||
#define ATMOSPHERE_OS_HORIZON
|
||||
#define ATMOSPHERE_BOARD_NINTENDO_NX
|
||||
#define ATMOSPHERE_ARCH_ARM64
|
||||
#define ATMOSPHERE_ARCH_ARM_V8A
|
||||
|
||||
|
||||
Reference in New Issue
Block a user