diff --git a/README.md b/README.md index 2b6aa85..a3d5644 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Adjust the color of the screen of your Nintendo Switch. # Installation -Download the latest zip from the [release page](https://github.com/averne/Fizeau/releases/latest), unzip it to the root of your sd card (be careful to merge and not overwrite folders), and reboot. Choose the chainloader ("-chl") version if you wish for your settings to be automatically applied at boot, instead of needing to open the application/overlay. +Download the latest zip from the [release page](https://github.com/averne/Fizeau/releases/latest), unzip it to the root of your sd card (be careful to merge and not overwrite folders), and reboot. Only the latest version of the [Atmosphère](https://github.com/Atmosphere-NX/Atmosphere) CFW is supported. @@ -36,15 +36,15 @@ All firmares are expected working. The software was tested working on 1.0.0, 2.0 You can refer to the built-in help. Navigate with either the touchscreen or the D-pad buttons. -## Settings: - - Settings are saved at /switch/Fizeau/config.ini, which you can also edit. - - To reduce the memory usage of the sysmodule, settings are not read at boot. Instead, they are applied on application/overlay launch. Thus, you will need to **launch a client after a reboot to fully restart Fizeau**. The chainloader version automatically applies settings at boot, at the expense of needing an additional loader module. +## Settings + +Settings are saved at /switch/Fizeau/config.ini, which you can also edit. # Building > **Warning** > For the moment devkitA64 version r18 or earlier is required - - Compiling requires a working [devkitA64](https://devkitpro.org/wiki/devkitPro_pacman) installation, with package `switch-glm` installed. + - Compiling requires a working [devkitA64](https://devkitpro.org/wiki/devkitPro_pacman) installation, with package `switch-glm` installed. You also need `rsync` to be available (it should be by default on all major operating systems). - Clone this repository recursively (`git clone --recursive https://github.com/averne/Fizeau`) - Navigate to its directory (`cd Fizeau`). - Run `make dist`. diff --git a/application/Makefile b/application/Makefile index c0d1d59..0597fdd 100644 --- a/application/Makefile +++ b/application/Makefile @@ -109,7 +109,7 @@ libs: $(CUSTOM_LIBS) shaders: ../lib/imgui-nx @mkdir -p $(ROMFS) - $(shell find ../lib/imgui-nx/lib/ -type f -name '*.dksh' -exec cp -u {} $(ROMFS) \;) + $(shell find ../lib/imgui-nx/lib/ -type f -name '*.dksh' -exec rsync -u {} $(ROMFS) \;) $(CUSTOM_LIBS): @$(MAKE) -s --no-print-directory -C $@ diff --git a/common/src/config.cpp b/common/src/config.cpp index 0287ba4..b82f695 100644 --- a/common/src/config.cpp +++ b/common/src/config.cpp @@ -134,8 +134,12 @@ std::string Config::make() { if (this->internal_profile < FizeauProfileId_Total) str += "handheld_profile = " + format_profile(this->internal_profile) + '\n'; + else + str += "handheld_profile = " + format_profile(FizeauProfileId_Profile1) + '\n'; if (this->external_profile < FizeauProfileId_Total) str += "docked_profile = " + format_profile(this->external_profile) + '\n'; + else + str += "docked_profile = " + format_profile(FizeauProfileId_Profile2) + '\n'; str += '\n'; for (int id = FizeauProfileId_Profile1; id < FizeauProfileId_Total; ++id) { diff --git a/common/src/fizeau.c b/common/src/fizeau.c index 473bb15..82dc559 100644 --- a/common/src/fizeau.c +++ b/common/src/fizeau.c @@ -83,14 +83,11 @@ Result fizeauSetProfile(FizeauProfileId id, FizeauProfile *profile) { } Result fizeauGetActiveProfileId(bool is_external, FizeauProfileId *id) { - struct { - bool is_external; - FizeauProfileId id; - } tmp = { is_external }; - Result rc = serviceDispatchOut(&g_fizeau_srv, FizeauCommandId_GetActiveProfileId, tmp); + FizeauProfileId tmp; + Result rc = serviceDispatchInOut(&g_fizeau_srv, FizeauCommandId_GetActiveProfileId, is_external, tmp); - if (R_SUCCEEDED(rc) && id) - *id = tmp.id; + if (R_SUCCEEDED(rc)) + *id = tmp; return rc; } diff --git a/overlay/src/gui.cpp b/overlay/src/gui.cpp index 7fe17d9..3360f71 100644 --- a/overlay/src/gui.cpp +++ b/overlay/src/gui.cpp @@ -64,11 +64,8 @@ FizeauOverlayGui::FizeauOverlayGui() { if (this->rc = apmGetPerformanceMode(&perf_mode); R_FAILED(this->rc)) return; - FizeauProfileId id; - if (this->rc = fizeauGetActiveProfileId(perf_mode != ApmPerformanceMode_Normal, &id); R_FAILED(this->rc)) - return; - - if (this->rc = this->config.open_profile(id); R_FAILED(this->rc)) + if (this->rc = this->config.open_profile(perf_mode == ApmPerformanceMode_Normal ? + config.internal_profile : config.external_profile); R_FAILED(this->rc)) return; }