ITotalJustice f7c5ccfa87 huge optimisations (see below). Build with c++26 and c23.
- build with c++26 and c23, fixes warnings due to this change.
- use #embed over romfs where applicable.
- load all configs upfront in the app menu, massively improves boot time
- enable boost mode during load/scan time in all (slow loading) menus, huge load time improvement.
- enable boost mode when exiting the app, to speed up closing all the menus and saving the config.
- reduce the size of the nro nacp when loading to just the title + author + display version.
- add option to enable boost mode for all progress bar menus, huge perf improvement again.
- remove unused launch_count var from the playlog file.
- display full path when dumping.
- optimise appstore unzip code by iterating through the zip rather than finding a specific file, reduces retroarch extract time from 52s to 26s.

overall, this commit has reduced boot time from 0.4s to 0.3s and massively increased load times of other menus.
(it also reduced the binary size by 4kb, so yay)
2025-05-25 20:57:03 +01:00
2024-12-16 21:13:05 +00:00
2024-12-16 21:13:05 +00:00
2024-12-16 21:13:05 +00:00
2024-12-16 21:13:05 +00:00

Sphaira

A homebrew menu for the Nintendo Switch.

See the GBATemp thread for more details / discussion.

We have now have a Discord server!. Please use the issues tab to report bugs, as it is much easier for me to track.

Showcase

Img Img
Img Img
Img Img
Img Img

Bug reports

For any bug reports, please use the issues tab and explain in as much detail as possible!

Please include:

  • CFW type (i assume Atmosphere, but someone out there is still using Rajnx);
  • CFW version;
  • FW version;
  • The bug itself and how to reproduce it.

FTP

FTP can be enabled via the network menu. It uses the same config as ftpsrv /config/ftpsrv/config.ini. See here for the full list of all configs available.

MTP

MTP can be enabled via the Network menu.

File association

Sphaira has file association support. Let's say your app supports loading .png files, then you could write an association file, then when using the file browser, clicking on a .png file will launch your app along with the .png file as argv[1]. This was primarly added for rom loading support for emulators / frontends such as RetroArch, MelonDS, mGBA etc.

[config]
path=/switch/your_app.nro
supported_extensions=jpg|png|mp4|mp3

The path field is optional. If left out, it will use the name of the ini to find the nro. For example, if the ini is called mgba.ini, it will try to find the nro in /switch/mgba.nro and /switch/folder/mgba.nro.

See assets/romfs/assoc/ for more examples of file assoc entries.

Installing (applications)

Sphaira can install applications (nsp, xci, nsz, xcz) from various sources (sd card, gamecard, ftp, usb).

For informantion about the install options, see the wiki.

Usb (install)

The USB protocol is the same as tinfoil, so tools such as ns-usbloader and fluffy should work with sphaira. You may also use the provided python script found here.

Ftp (install)

Once you have connected your ftp client to your switch, you can upload files to install into the install folder.

Building from source

You will first need to install devkitPro.

Next you will need to install the dependencies:

sudo pacman -S switch-dev deko3d switch-cmake switch-curl switch-glm switch-zlib

Once devkitPro and all dependencies are installed, you can now build sphaira.

git clone https://github.com/ITotalJustice/sphaira.git
cd sphaira
cmake --preset MinSizeRel
cmake --build --preset MinSizeRel

The output will be found in build/MinSizeRel/sphaira.nro

Credits

  • borealis
  • stb
  • yyjson
  • nx-hbmenu
  • nx-hbloader
  • deko3d-nanovg
  • libpulsar
  • minIni
  • GBATemp
  • hb-appstore
  • haze
  • nxdumptool (for gamecard bin dumping and rsa verify code)
  • Everyone who has contributed to this project!
Description
A homebrew menu for the Nintendo Switch
Readme GPL-3.0 16 MiB
Languages
C 52.1%
C++ 45.1%
JavaScript 1.2%
CMake 0.6%
Python 0.5%
Other 0.5%