From 7686597006401c03a526f95dda218f4a164a7f13 Mon Sep 17 00:00:00 2001 From: cathery Date: Mon, 19 Apr 2021 18:31:16 +0300 Subject: [PATCH] Fix booting on FW 12.0.0 --- README.md | 2 +- source/Sysmodule/Makefile | 21 +++------------------ source/Sysmodule/source/main.cpp | 8 ++++++-- 3 files changed, 10 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index a6f4d13..e0234d4 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ Instead, clone the repository **recursively** using any git client you have. (Gi Like all other switch projects, you need to have [devkitA64](https://switchbrew.org/wiki/Setting_up_Development_Environment) set up on your system. -For compatibility with the Atmosphere-libs dependency, this project currently uses a version of libnx at commit **[0d32a2c](https://github.com/switchbrew/libnx/commit/0d32a2c0d5343fe212a0957420d285c0ef44fb36)**. Clone the repository, checkout to that commit, and run `make install` to set it up. +For compatibility with the Atmosphere-libs dependency, this project currently uses a version of libnx at commit **[5509f8f](https://github.com/switchbrew/libnx/commit/5509f8f14bc87a41794855d2b965cf0c08e9dd6d)**. Clone the repository, checkout to that commit, and run `make install` to set it up. If you have **Visual Studio Code**, you can open the project as a folder and run the build tasks from inside the program. It also has Intellisense configured for switch development, if you have DEVKITPRO correctly defined in your environment variables. Handy! diff --git a/source/Sysmodule/Makefile b/source/Sysmodule/Makefile index 939f496..109297e 100644 --- a/source/Sysmodule/Makefile +++ b/source/Sysmodule/Makefile @@ -22,24 +22,9 @@ export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \ export DEPSDIR := $(CURDIR)/$(BUILD) - -CFILES := $(foreach dir,$(SOURCES),$(filter-out $(notdir $(wildcard $(dir)/*.arch.*.c)) $(notdir $(wildcard $(dir)/*.board.*.c)) $(notdir $(wildcard $(dir)/*.os.*.c)), \ - $(notdir $(wildcard $(dir)/*.c)))) -CFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.arch.$(ATMOSPHERE_ARCH_NAME).c))) -CFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.board.$(ATMOSPHERE_BOARD_NAME).c))) -CFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.os.$(ATMOSPHERE_OS_NAME).c))) - -CPPFILES := $(foreach dir,$(SOURCES),$(filter-out $(notdir $(wildcard $(dir)/*.arch.*.cpp)) $(notdir $(wildcard $(dir)/*.board.*.cpp)) $(notdir $(wildcard $(dir)/*.os.*.cpp)), \ - $(notdir $(wildcard $(dir)/*.cpp)))) -CPPFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.arch.$(ATMOSPHERE_ARCH_NAME).cpp))) -CPPFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.board.$(ATMOSPHERE_BOARD_NAME).cpp))) -CPPFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.os.$(ATMOSPHERE_OS_NAME).cpp))) - -SFILES := $(foreach dir,$(SOURCES),$(filter-out $(notdir $(wildcard $(dir)/*.arch.*.s)) $(notdir $(wildcard $(dir)/*.board.*.s)) $(notdir $(wildcard $(dir)/*.os.*.s)), \ - $(notdir $(wildcard $(dir)/*.s)))) -SFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.arch.$(ATMOSPHERE_ARCH_NAME).s))) -SFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.board.$(ATMOSPHERE_BOARD_NAME).s))) -SFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.os.$(ATMOSPHERE_OS_NAME).s))) +CFILES := $(call FIND_SOURCE_FILES,$(SOURCES),c) +CPPFILES := $(call FIND_SOURCE_FILES,$(SOURCES),cpp) +SFILES := $(call FIND_SOURCE_FILES,$(SOURCES),s) BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) diff --git a/source/Sysmodule/source/main.cpp b/source/Sysmodule/source/main.cpp index 7c43183..814ceec 100644 --- a/source/Sysmodule/source/main.cpp +++ b/source/Sysmodule/source/main.cpp @@ -54,7 +54,9 @@ namespace ams extern "C" void __appInit(void) { - ams::sm::DoWithSession([] { + R_ABORT_UNLESS(smInitialize()); + // ams::sm::DoWithSession([] + { //Initialize system firmware version R_ABORT_UNLESS(setsysInitialize()); SetSysFirmwareVersion fw; @@ -68,7 +70,9 @@ extern "C" void __appInit(void) R_ABORT_UNLESS(usbHsInitialize()); R_ABORT_UNLESS(pscmInitialize()); R_ABORT_UNLESS(fsInitialize()); - }); + } + // ); + smExit(); R_ABORT_UNLESS(fsdevMountSdmc()); }