Commit Graph

459 Commits

Author SHA1 Message Date
ITotalJustice
931531e799 devoptab: add SFTP. fs: disable stdio buffering. cmake: add options to disable components of sphaira, add new "lite" build with minimal features. 2025-09-09 18:39:03 +01:00
ITotalJustice
1695d69aa3 audio: enable flac, make thread safe, fix crash on exit if audio wasn't init. 2025-09-09 10:39:52 +01:00
ITotalJustice
217bd3bed3 mui: add list index to sidebar and popup_list, and better center the index text. 2025-09-08 01:47:41 +01:00
ITotalJustice
384e8794bf devoptab: refactor all custom mounts to inherit from helper struct. 2025-09-08 01:34:20 +01:00
ITotalJustice
61b398a89a fatfs: use devoptab mounting. devoptab: add config for hidding from fs and dump, fix http being writeable. 2025-09-07 17:35:37 +01:00
ITotalJustice
ba78fd0dc5 devoptab: add vfs, change mount.ini path location. 2025-09-07 15:43:01 +01:00
ITotalJustice
43969a773e fs: fix CreateDirectoryRecursivelyWithPath() for root files. save: fix restore detection. devoptab: return proper errno codes. 2025-09-07 14:40:45 +01:00
ITotalJustice
6e1eabbe0f devoptab: deprecate locations.ini in favour of hdd/network mounts, better handle folder creation errors. 2025-09-07 13:30:53 +01:00
ITotalJustice
b99d1e5dea devoptab: add webdav, refactor network devices, multi thread r/w to improve perf and support webdav uploads. 2025-09-07 12:40:45 +01:00
ITotalJustice
6ce566aea5 http: optimise the dir_list parsing, only parse tables. filebrowser: option to disable stat per fs.
this improves network fs speed by disabling stat for http entriely, and only enabling file stat for everything else.
this can be overriden in the config.
2025-09-05 14:10:06 +01:00
ITotalJustice
a4209961e2 devoptab: add ftp mount with random read and streaming write support.
read still needs some work. opening a file should open a thread where data is read/written async.
this avoids the huge number of roundtrips per r/w.

eg, a read currently has to REST, open the data socket, send the file data, send ABOR to close and then close the data socket.

using the thread approach would just send the file over the already open data socket.
writes will also benefit from the above, just instead of REST it would be APPE.

seeks would need to do the above ABORT, close and re-open. however most reads in sphaira are not random access. so this isn't an issue.
2025-09-04 22:29:35 +01:00
ITotalJustice
181ff3f2bf devoptab: fix http config parsing, add more options to network mounts (timeout,uid,port). fs: update path size.
fs path was changed to 255 in the past because that is the real path size that fs can handle.
however, this restriction does not apply to nfs, samba, http - and it is very easy to exceed this 255 path length.

to fix this, i have increased the path len to 1024. this allows fs to continue to work as the buffer is
big enough, but also gives network mounts enough space to work with.
2025-09-04 12:18:34 +01:00
ITotalJustice
b85b522643 app: remove ams erpt disable as it is possible to cause ams to fatal if a crash report fails to write. 2025-09-04 09:40:39 +01:00
ITotalJustice
5158e264c0 devoptab: add http, nfs and smb mount. nca: zero init ncz structs. fs: fix FsPath compare. 2025-09-03 18:56:54 +01:00
ITotalJustice
fd67da0527 webusb: add support for exporting. usb: block requests with no timeout, using pbox to cancel if the user presses B. 2025-09-02 04:24:45 +01:00
ITotalJustice
7bdec8457f tests: move location of usb tests and update workflows for the new paths. 2025-08-31 07:37:54 +01:00
ITotalJustice
bc75c9a89f workflow: temp disable main workflow on dev until libnx pushes a new release. 2025-08-31 07:30:13 +01:00
ITotalJustice
c2e8734e85 webusb: add webUSB page and workflow to auto build it. 2025-08-31 07:15:53 +01:00
ITotalJustice
22e965521a usb: change api so that every packet sent is crc32c, update python usb api, add automated tests for usb. 2025-08-31 06:12:02 +01:00
ITotalJustice
b6b1af5959 Revert "Clean up python (#212)"
This reverts commit 0a8bc01870.
2025-08-31 04:27:53 +01:00
ITotalJustice
876be3b7b6 download: add ref count to cache init/exit and have all threads call init.
this ensures that the etag cache is ready to use before a download request is made, avoiding a rare race condition.
2025-08-31 03:50:44 +01:00
ITotalJustice
62f48353ba download: use new etag cache file and delete the old one, this removes all the old themezer entries. 2025-08-31 03:50:44 +01:00
ITotalJustice
9c65e5a12d app: remove old themezer cache 2025-08-31 03:50:44 +01:00
ITotalJustice
235e947186 app: move config to async init 2025-08-31 03:50:44 +01:00
AndrewSpangler
0a8bc01870 Clean up python (#212)
* Python cleanup
2025-08-31 03:48:37 +01:00
ITotalJustice
f0bdc01156 huge changes to everything (see below).
Changelog:
- re-enable use in release build.
- remove ftpsrv and untitled from builtin ghdl options, as both packages are available in the appstore.
- add image viewer (png, jpg, bmp)
- add music player (bfstm, bfwav, mp3, wav, ogg)
- add idv3 tag parsing support for mp3.
- add "decyption" of GTA Vice City mp3.
- add usbdvd support for music playback and file browsing.
- add nsz export support (solid, block, ldm).
- add xcz export support (same as above).
- add nro fs proper mount support (romfs, nacp, icon).
- add program nca fs support.
- add bfsar fs support.
- re-write the usb protocol, still wip. replaces tinfoil protocol.
- all threads are now create with pre-emptive support with the proper affinity mask set.
- fix oob crash in libpulsar when a bfwav was opened that had more than 2 channels.
- bump yyjson version.
- bump usbhsfs version.
- disable nvjpg.
- add support for theme music of any supported playback type (bfstm, bfwav, mp3, wav, ogg).
- add support for setting background music.
- add async exit to blocking threads (download, nxlink, ftpsrv) to reduce exit time.
- add support for dumping to pc via usb.
- add null, deflate, zstd hash options, mainly used for benchmarking.
- add sidebar slider (currently unused).
- file_viwer can now be used with any filesystem.
- filebrowser will only ever stat file once. previously it would keep stat'ing until it succeeded.
- disabled themezer due to the api breaking and i am not willing to keep maintaining it.
- disable zlt handling in usbds as it's not needed for my api's because the size is always known.
- remove usbds enums and GetSpeed() as i pr'd it to libnx.
- added support for mounting nca's from any source, including files, memory, nsps, xcis etc.
- split the lru cache into it's own header as it's now used in multiple places (nsz, all mounted options).
- add support for fetching and decrypting es personalised tickets.
- fix es common ticket converting where i forgot to also convert the cert chain as well.
- remove the download default music option.
- improve performance of libpulsar when opening a bfsar by remove the large setvbuf option. instead, use the default 1k buffer and handle large buffers manually in sphaira by using a lru cache (todo: just write my own bfsar parser).
- during app init and exit, load times have been halved as i now load/exit async. timestamps have also been added to measure how long everything takes.
- download now async loads / exits the etag json file to improve init times.
- add custom zip io to dumper to support writing a zip to any dest (such as usb).
- dumper now returns a proper error if the transfer was cancelled by the user.
- fatfs mount now sets the timestamp for files.
- fatfs mount handles folders with the archive bit by reporting them as a file.
- ftpsrv config is async loaded to speed up load times.
- nxlink now tries attempt to connect/accept by handling blocking rather than just bailing out.
- added support for minini floats.
- thread_file_transfer now spawns 3 threads rather than 2, to have the middle thread be a optional processor (mainly used for compressing/decompressing).
- added spinner to progress box, taken from nvg demo.
- progress box disables sleep mode on init.
- add gamecard detection to game menu to detect a refresh.
- handle xci that have the key area prepended.
- change gamecard mount fs to use the xci mount code instead of native fs, that way we can see all the partitions rather than just secure.
- reformat the ghdl entries to show the timestamp first.
- support for exporting saves to pc via usb.
- zip fs now uses lru cache.
2025-08-28 23:12:34 +01:00
ITotalJustice
cd6fed6aae devoptab: use fixed size array of entries rather than vector as vector can change/break pointers when it reallocs. fs: disable loading assoc when mounting custom fs. 2025-08-12 08:04:24 +01:00
ITotalJustice
7835ebc346 perf: async signal exit ftpsrv and nxlink thread in order to not block. add perf logging for exit. 2025-08-11 22:26:28 +01:00
ITotalJustice
3c33581a08 devoptab: cache all reads to max read throughput, now as fast as normal sd card reads, including compressed zips (80MiB/s). 2025-08-11 21:35:43 +01:00
ITotalJustice
3e9a8c9249 devoptab: only add new entry if mounting is successful. 2025-08-11 20:59:56 +01:00
ITotalJustice
d6c8f120c6 fs: add zip mount support. hash: fix not checking open result for file. fs: fix stdio not checking nullptr access. 2025-08-11 20:01:53 +01:00
ITotalJustice
cb2fa1abfc fs: add support for mounting nsp an xci files in the filebrowser. 2025-08-11 07:01:52 +01:00
ITotalJustice
25f2cfbff2 save: support for mounting save fs, add LRU cache for fatfs. add mounting nro romfs. 2025-08-10 17:31:22 +01:00
ITotalJustice
3404d4cece app: destroy widgets in reverse order on exit as the widgets are a stack. 2025-08-09 11:45:13 +01:00
ITotalJustice
44e1584461 fs: add support for mounting nca, save and gamecard fs. file picker inherits from browser. fix bugs (see below).
- fixed fs real path length not actually being 0x301, but instead 255. fixes #204
- file picker inherits from file browser now so there's a lot less duplicated code.
- file browser now saves the last highlighted file.
- fix bug in file browser where the new file path could be empty (ie not containing a /).
- added support for viewing qlaunch romfs.
- moved fs mount options to the top of the list (may revert).
2025-08-09 11:34:35 +01:00
ITotalJustice
8a16188996 fat: add support for mounting fat bis paritions (prodinfof, safe, user, system), inital work needed for fetching personalised es tickets. 2025-08-08 05:12:51 +01:00
ITotalJustice
70518762ae game_menu: remove stubbed option to enable/disable title cache.
the option was never actually implemented and there's no benifit to disabling it anyway.
2025-08-06 14:11:59 +01:00
ITotalJustice
a0370912da Add content/nca viewer for games menu, fix manual nca title fetch for chinese lang icon, rename "dump" to "export". 2025-08-06 14:11:05 +01:00
ITotalJustice
3fee702ee2 ftp_menu: fix passphrase ascii convert which could cause a stack overflow.
from my notes:
this converts the passphrase array into an ascii string
well, turns out std::transform does not actually increase the std::string size when pushing the new ascii characters
basically, std::string (normally) has small string optimisation. For this, they have a small array which it uses instead of allocating memory.

std::transform casts the std::string itr to a void*. sooo it was basically manually writing to the class, which just so happened to be the SSO buffer. however after 32chars, it runs out...and starts overwriting the stack. so this was a stack overflow lmao
only reason i found this is because i changed some optimisation flags, so the compiler ended up inlining std::transform, which detected the buffer overflow. and then i realised how fucked it was lol.
2025-08-04 20:17:14 +01:00
ITotalJustice
54d73a6d3b optimise: pass all large objects (std::function, std::string, structs) by const ref rather than value.
really, these functions should be passed by && and using std::forward on assignment.
however, this means writing a lot of extra code for every single class, as well as explicitly calling move
in a lot of cases.

In the case of std::string, passing by value and calling std::move is the correct approach, especially if the
string is created as an rvalue, then it is only created once and moved into the dest.
Whereas with a const ref, the string is created and then copied into the dst, basically creating 2 copies.
The same thing happens std::function, and well any object.

However, accepting everything by value sucks if you call a constructor from within a constructor, as now you need to create 2 impls
that accept by value and the other by rvalue. All of this extra code to have a more efficent impl just isn't worth it when, going by
the benchmarks, makes no measurable difference (i count anything within >= 1ms as measurable).
2025-08-04 18:58:20 +01:00
ITotalJustice
9fe9c9d491 themezer: only show latest release for nxtheme when prompting user to download nro. 2025-08-03 04:00:21 +01:00
ITotalJustice
4300c9ee1b filebrowser/picker: backport changes in totalsms (optimise zip peek, remove unused vars and code, optimise folder count, fix missed extension parse). 2025-08-03 03:26:24 +01:00
ITotalJustice
a3780bdcea filebrowser: add forwarder creator. 2025-08-03 00:58:03 +01:00
ITotalJustice
6554b68efa menu: add filepicker, sidebar: add file picker entry.
the filepicker is a stripped down version of the file browser. only file picking is supported atm, no "select folder" yet.
2025-08-02 22:19:48 +01:00
ITotalJustice
1a00db9d55 sidebar: add text input entry 2025-08-02 19:18:42 +01:00
ITotalJustice
fb3ad260da install: add enable prompt to filebrowser and gc menu when an install option is clicked whilst disabled. 2025-08-02 18:41:52 +01:00
ITotalJustice
ed02b0f260 sidebar: add callback when a disabled option is clicked. install: option to enable when a disabled option is clicked. 2025-08-02 18:30:56 +01:00
ITotalJustice
620334439c themezer: show option to launch nro. 2025-08-02 17:51:36 +01:00
ITotalJustice
ab5c54b47a themeze: prompt user to install theme after installing. 2025-08-02 17:47:09 +01:00
ITotalJustice
40e4616520 themezer: prompt user to download ThemeInjector if not installed on launch. 2025-08-02 17:21:07 +01:00