Skip to content

Commit

Permalink
Some minor bugfixes/changes (#80)
Browse files Browse the repository at this point in the history
* Fix building on macOS hosts

* Fix broken config being created when no config available

* Fix fizeauGetActiveProfileId being broken

* Make overlay determine the current profile from the config like the nro does

* Use actual enum name instead of casting

* Mention rsync and remove chainloader references in readme
  • Loading branch information
AuroraWright authored May 24, 2024
1 parent 4a47bad commit b1c2681
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 18 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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`.
Expand Down
2 changes: 1 addition & 1 deletion application/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 $@
Expand Down
4 changes: 4 additions & 0 deletions common/src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
11 changes: 4 additions & 7 deletions common/src/fizeau.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
7 changes: 2 additions & 5 deletions overlay/src/gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit b1c2681

Please sign in to comment.