Sphaira - hbmenu replacement

Sphaira is hbmenu alternative. It currently has feature parity with hbmenu (that is, launches homebrew + nxlink) whilst adding quite a few features.



HomeBrew​

The main menu tab, it lists all the .nro found in "/switch/". From there, you can launch, sort, delete, create a forwarder etc.
You can navigate to the other menu tabs using "L" and "R", explained below.

FileBrowser​

By pressing "L" from the main menu, you can access the file browser. You can Cut, Copy, Delete, Rename etc.
You can select multiple files / folders by using the "ZR" button and then se the above functions of that group of files.

Forwaders can be created if the selected file has a file assoc, see below for more details.

Appstore​

sphaira features an appstore, using the api from https://hb-app.store/switch. It can be navigated to by pressing "R" from the main menu.
The appstore is feature parity with hb-appstore app, as well as installing the manifests in the same folder as hb-appstore, in order to not break compatibility between the two.

Themes​

sphaira comes with 3 themes, abyss (default), black and white (unfinished).
custom themes can be added to "/config/sphaira/themes/", here is the abyss theme for example:
INI:
[meta]
name=Abyss
author=TotalJustice
version=1.0.0
; unused currently
preview=romfs:/theme/preview.jpg

[theme]
background=0x0f111aff
grid=0x0f115c30
selected=0x0f115cff
selected_overlay=0x529cffff
text=0xffbc41ff
text_selected=0x529cffff

icon_audio=romfs:/theme/icon_audio.png
icon_video=romfs:/theme/icon_video.png
icon_image=romfs:/theme/icon_image.png
icon_file=romfs:/theme/icon_file.png
icon_folder=romfs:/theme/icon_folder.png
icon_zip=romfs:/theme/icon_zip.png
icon_nro=romfs:/theme/icon_nro.png

music can be added to a theme, as long as the music is converted to bfstm format. simply add an entry like so: `music=/config/sphaira/themes/music/bgmusic_pcm.bfstm`

Forwaders​

sphaira can create and install forwarders for any .nro. It will use the icon of the .nro and the name + author.

It can also install forwarders for files that have a file assoc. For example, if mgba is installed and a game is located in "/roms/gba/game.gba", then the "Install Fowarder" option will appear. In this case, it will try to scrape the icon of the game, otherwise it will use the icon of the .nro and the name will be a combination of the .nro name and game name.

File Assoc​

file assoc is a way to associate file extensions (.gba, .nro etc) with a homebrew app. For example, clicking on rom.gbc that has an file assoc will bring up a list of all the applications that can handle it.
This can be used for emulators, media players, text editors etc...

custom file assoc should go in the folder "/config/sphaira/assoc/"

the format is *very* simple, here is an example of vgedit.ini
INI:
[config]
supported_extensions=txt|json|cfg|ini|md|log

and again for mgba.ini
INI:
[config]
supported_extensions=gba|gbc|sgb|gb
database=Nintendo - Game Boy|Nintendo - Game Boy Color|Nintendo - Game Boy Advance

"path": (optional) fullpath to the .nro. if not specified, it uses the name of the ini, ie, mgba.ini will use mgba.nro.
"supported_extensions": list of extensions the application supports, separated by |. plea
"database": (optional) name of the rom database to use defined by the left-side of this table <https://gist.github.com/ITotalJustice/d5e82ba601ca13b638af9b00e33a4a86>..

All of the retroarch cores has file assoc built into sphaira, so if you download retroarch using the appstore, and then navigate to "/roms/gbc/game.gbc", gambatte and mgba will be available to be selected.

Games can be kept in .zip format, sphaira will peek into the .zip and find the real extension and use that for displaying icons / file assoc.

Roms​

roms should be placed in "/roms/system_name/" where system name is defined by this table right-side entries <https://gist.github.com/ITotalJustice/d5e82ba601ca13b638af9b00e33a4a86>.
this is the same layout emulation station uses. the reason for forcing roms to be in specific folders is due to many roms for different systems using the same file extension, ie, .bin / .cue or .chd.

roms placed in subfolders are allowed, for example "/roms/psx/scooby-doo/scooby-doo.bin" is valid.

Themezer​

themes can be browsed and download by going Menu Options -> Misc -> Themezer. Themes will be downloaded to "/themes/sphaira/Theme Name - By Author/".
To install themes, launch "NXThemes Installer" and browse to the selected folder listed above.

Nxlink​

For homebrew developers, nxlink is built into sphaira. You do not have to press any special buttons, just do "nxlink *.nro" and send your nro like normal, console logging works to be using "nxlink -s *.nro"
By default, this is enabled in the background, to disable it: Menu Options -> Network -> Nxlink.



That's most of the features spahira has. If you enjoy it so much that you'd rather it be launched over regular hbmenu, you can enable the option in "Menu Options -> Replace hbmenu on exit" where it will do just that. It will create a backup of hbmenu in "/switch/hbmenu.nro" should you wish to swap back.
homebrew.jpg

games.jpg

appstore.jpg

appstore_page.jpg

file_browser.jpg

themezer.jpg

launch_options.jpg


Releases: https://github.com/ITotalJustice/sphaira/releases/
Bleeding-edge Releases: https://github.com/ITotalJustice/sphaira/actions
Source Code: https://github.com/ITotalJustice/sphaira
 
Last edited by Deleted member 413168,
This is really great! All the other homebrews you've created are outstanding, and I'm a big fan of yours. By the way, in the homebrew list, Sphaira itself is displayed at the very top, and it takes up one space. How about hiding Sphaira itself from the list?
 
This is really great! All the other homebrews you've created are outstanding, and I'm a big fan of yours. By the way, in the homebrew list, Sphaira itself is displayed at the very top, and it takes up one space. How about hiding Sphaira itself from the list?
good idea. ive changed the zip in the main post that hides sphaira.
 
This is great, would be nice add a built in text editor if it’s not much complicated (I see text reader in not finished yet)
Also in file browser it doesn't display ".overlays", ".packages" folders, I think it's because the "." prefix
 
Last edited by cucholix,
  • Like
Reactions: lordelan
we finally has sphaira thread :D:D

I absolutely love this app and make it my default since day one, great job!

But It will crash(or hang) when enter sphaira(applet mode) after exit to home from game(didn't exit the game in fact.) use default oc clocking (even oc disabled),
but no crash on HBmenu. (issues fixed with sphaira 0.3.0)

Tested Game(trigger crash):
  • Monster Hunter Rise JP 1.6.0.2 / 16.0.1
  • Monster Hunter Generations US 1.3.0
  • TOTK 1.2.1
I attach a crash log for ur reference.

btw, can we have muti-lang in following updates?
I can help with zhCN languages.
 

Attachments

Last edited by WE1ZARD,
No source code? No hard feelings, do whatever you want, thank you for the program and everything, but some of us avoid closed sources since the dbi drama.
 
  • Like
Reactions: n37w0rk
No source code? No hard feelings, do whatever you want, thank you for the program and everything, but some of us avoid closed sources since the dbi drama.

Time to bin your Nintendo Switch then, Horizon OS is closed source!
 
we finally has sphaira thread :D:D

I absolutely love this app and make it my default since day one, great job!

But It will crash(or hang) when enter sphaira(applet mode) after exit to home from game(didn't exit the game in fact.) use default oc clocking (even oc disabled),
but no crash on HBmenu.

Tested Game(trigger crash):
  • Monster Hunter Rise JP 1.6.0.2 / 16.0.1
  • Monster Hunter Generations US 1.3.0
  • TOTK 1.2.1
I attach a crash log for ur reference.

btw, can we have muti-lang in following updates?
I can help with zhCN languages.
hmm i can't reproduce. I have tried:
Open TOTK in game -> Open album to launch sphaira -> Press Home.
for me, it exits to the home menu like normal. Are you using v0.2.0? you Can press Y whilst in the sphaira menu to see the version.
You can also enable logging in sphaira from that same menu, logs go into "/config/sphaira/log.txt", that would help a lot with knowing where it crashed.

As for translations, i'll look into it today! i've not had to add multi language support before, what would you expect the format to look like? A file that has english text on the left and translated text on the right? ie:
{ "Delete File", "删除文件" },
{ "Create File", "" },
if left blank, it will use the text on the left. i'll see if theres a tool that will parse the source code for text and generate the language files for me, iirc gcc has something for that - i'll get back to you
 
Hi bro, thanks for the nice job!
About tr , I think the SDL lib written by JK is very useful here. If you take a look, it will be very easy to translate and recognize Switch console languages.

here,the repo:https://github.com/J-D-K/SDLLib

(Yes, you may have better approach, Just for reference)
 
Last edited by hongkbird,
I think the SDL lib written by JK is very useful here. If you take a look, it will be very easy to translate and recognize Switch console languages.

here,the repo:https://github.com/J-D-K/SDLLib
I don't think he needs help rendering or displaying glyphs. All I do is use libjson-c and iterate through the json file and add them to a map so I can grab them according to what they're named in the json. I'm pretty sure he knows how to do that already.
 
No source code? No hard feelings, do whatever you want, thank you for the program and everything, but some of us avoid closed sources since the dbi drama.
i am not sure what the dbi drama is. i understand avoiding closed source software, however in my experience, being open source doesn't really mean much. no one is going to "vet" the code to make sure it safe. I'd argue no one is going to read it. The only exception is those that copy a portion of the code to use in their own app (which is fine of course).

That being said, the only reason i haven't open sourced sphaira is because the code is pretty bad :rofl: you have to understand that the base for the entire codebase was written in early 2020, by that point i had only been coding for ~5 months. It was all in C, i didn't know what i was doing and it had memory leaks everywhere.

fast-forward to 2023, i got a oled switch, made sys-patch then found this old shit code in a folder on a usb stick. i tried to revive it by rewriting it in C++, using some gui code from untitled / borealis and added a ton of features - but the code still sucks, especially the ui code (hard coded values everywhere).

after that, it has been sat unmodified for about a year, until i released ftpsrv where i pushed a public version of sphaira for people to mess around with.

however, adding translations kinda requires me to open source. it would make contributions much easier, better bug report system and *maybe* someone will help me with the gui code. so once i finish the translation code, ill make it open source :)
 
i am not sure what the dbi drama is. i understand avoiding closed source software, however in my experience, being open source doesn't really mean much. no one is going to "vet" the code to make sure it safe. I'd argue no one is going to read it. The only exception is those that copy a portion of the code to use in their own app (which is fine of course).

That being said, the only reason i haven't open sourced sphaira is because the code is pretty bad :rofl: you have to understand that the base for the entire codebase was written in early 2020, by that point i had only been coding for ~5 months. It was all in C, i didn't know what i was doing and it had memory leaks everywhere.

fast-forward to 2023, i got a oled switch, made sys-patch then found this old shit code in a folder on a usb stick. i tried to revive it by rewriting it in C++, using some gui code from untitled / borealis and added a ton of features - but the code still sucks, especially the ui code (hard coded values everywhere).

after that, it has been sat unmodified for about a year, until i released ftpsrv where i pushed a public version of sphaira for people to mess around with.

however, adding translations kinda requires me to open source. it would make contributions much easier, better bug report system and *maybe* someone will help me with the gui code. so once i finish the translation code, ill make it open source :)
TLDR about DBI drama. He is annoyed about people asking for English that he threatened to add malware to his software if your Switch where in English, basically destroying your Switch.
 
we finally has sphaira thread :D:D

I absolutely love this app and make it my default since day one, great job!

But It will crash(or hang) when enter sphaira(applet mode) after exit to home from game(didn't exit the game in fact.) use default oc clocking (even oc disabled),
but no crash on HBmenu.

Tested Game(trigger crash):
  • Monster Hunter Rise JP 1.6.0.2 / 16.0.1
  • Monster Hunter Generations US 1.3.0
  • TOTK 1.2.1
I attach a crash log for ur reference.

btw, can we have muti-lang in following updates?
I can help with zhCN languages.
i've finished the translation code, i think most(?) of the app is now translated. i used https://translate.i18next.com/ to translate the json files automatically for me, but there will likely be some mistakes. i'll post a new build later today
 
i am not sure what the dbi drama is. i understand avoiding closed source software, however in my experience, being open source doesn't really mean much. no one is going to "vet" the code to make sure it safe. I'd argue no one is going to read it. The only exception is those that copy a portion of the code to use in their own app (which is fine of course).

That being said, the only reason i haven't open sourced sphaira is because the code is pretty bad :rofl: you have to understand that the base for the entire codebase was written in early 2020, by that point i had only been coding for ~5 months. It was all in C, i didn't know what i was doing and it had memory leaks everywhere.

fast-forward to 2023, i got a oled switch, made sys-patch then found this old shit code in a folder on a usb stick. i tried to revive it by rewriting it in C++, using some gui code from untitled / borealis and added a ton of features - but the code still sucks, especially the ui code (hard coded values everywhere).

after that, it has been sat unmodified for about a year, until i released ftpsrv where i pushed a public version of sphaira for people to mess around with.

however, adding translations kinda requires me to open source. it would make contributions much easier, better bug report system and *maybe* someone will help me with the gui code. so once i finish the translation code, ill make it open source :)
FWIW, I read the nx-hblauncher code today to get a bit of an idea about how people do things on the switch, and more code, however horrible, is always appreciated on a platform that does have a somewhat limited pool of public code written for it.
 

Site & Scene News

Popular threads in this forum