Commit Graph

40 Commits

Author SHA1 Message Date
Pablo Curiel 34ada96e2f [ci skip] Update Makefile 2024-05-01 21:18:05 +02:00
Pablo Curiel 3356bfa89c Update Makefile 2024-05-01 20:24:41 +02:00
Pablo Curiel 50deeeb41b Improve directory layout while we still can.
The directory layout is partially based on the C++ namespaces we're currently using.

Other changes include:

* devoptab: move directory into "core".

* fatfs: move directory into "core".

* GameCardTab: move portions of logic from PopulateList() into their own methods.
* GameCardTab: use a macro to generate the properties table.
* GameCardTab: use a macro to add ListItem elements.
* GameCardTab: update AddApplicationMetadataItems() method to also display the number of DLCs available in the inserted gamecard for each application whenever possible.

* Makefile: remove all extra entries from the INCLUDES variable.

* nxdt_includes: move HOS version structs into their own header file.

* tasks: move code for each individual task into its own file(s).

* title: update titleGetGameCardApplicationMetadataEntries() to also count the number of DLCs available in the inserted gamecard for any given base application.
* title: reorder gamecard application metadata entries by name before returning the buffer in titleGetGameCardApplicationMetadataEntries().
2024-04-30 23:01:42 +02:00
Pablo Curiel 7b707509c7 bktr: perform binary search in bktrGetTreeNodeEntryIndex()
Other changes include:

* poc: fix switching to a different title entry via L/R/ZL/ZR if the content counts don't match. Fixes issues with MGS Master Collection games.
2024-02-16 23:31:24 +01:00
Pablo Curiel d402776032 Custom devoptab wrappers (part 1).
This commit implements a devoptab wrapper for Partition FS sections within NCAs, using code from pfs.c/h.

Other changes include:

* codebase: use NX_IGNORE_ARG macro where needed.

* hfs: slight tweaks to some of the static functions.

* pfs: slight tweaks to some of the static functions.
* pfs: use pfsIsValidContext() where needed.

* utils: update utilsInitializeResources() to use __system_argc and __system_argv variables from libnx.

* todo: update text file.
2023-12-20 20:32:48 +01:00
Pablo Curiel eb4bdbf27a nxdt_log: use __FILE__ macro
Takes advantage of the -fmacro-prefix-map option from GCC8+.

Also updated libusbhsfs again.
2023-06-29 19:08:48 +02:00
Pablo Curiel eee1b2a771 More changes.
* Update libusbhsfs.

* Update borealis.

* nsp_dumper: force free size retrieval after dumping an NSP.

* title: add titleGetGameCardApplicationMetadataEntries().

* Makefile: remove -gdwarf-4 flag.

* nxdt_utils: treat NT_MAX_FILENAME_LENGTH as bytes instead of codepoints, add "TiB" to the array of supported size suffixes.

* GameCardTab: add ProcessGameCardStatus() and PopulateList(), manage list updates in the same fashion as TitlesTab, display message about how to mitigate launch errors after exiting the application, display available applications in the inserted gamecard, display message about how to perform individual operations on the gamecard titles.

* main: add a try/catch block to intercept any possible exceptions thrown while the application is running + use brls::Application::crash() to gracefully exit afterwards. Temporarily disable Applet Mode support.

* exception_handler: use LOG_LEVEL_ERROR.

* LayeredErrorFrame: add GetListFirstFocusableChild().
2022-07-28 00:53:52 +02:00
Pablo Curiel a9b5f7211c Some changes. Read full commit message.
* title: implemented titleGetNcmStorageIdName().

* nxdt_log: implemented log verbosity levels (debug, info, warning, error, none) and helper macros for each level. The rest of the codebase still needs to be updated to take advantange of this change.

* nxdt_log: implemented auxiliary logging via nxlink, if available.

* nxdt_utils: system CPU/MEM overclocking is now only applied through utilsSetLongRunningProcessState(), as it should have been from the beginning.

* nxdt_utils: nxlink initialization is now carried out without redirecting stdout and/or stderr, entirely removing the need for utilsRestoreConsoleOutput(). utilsGetNxLinkFileDescriptor() is used to send data to the nxlink host via dprintf() in log functions.
2022-07-12 02:27:03 +02:00
Pablo Curiel f6d133d793 gc_dumper: change info TXT layout. 2022-02-07 01:32:39 +01:00
Pablo Curiel 28cd0ce10f OptionsTab: fully implement application update feature.
Other changes include:

* Codebase: move JSON parsing logic from config.c/h to nxdt_json.c/h.
* Codebase: replace all calls to localtime() with localtime_r() to guarantee thread-safety.
* Codebase: updated todo.txt.
* utils: implement utilsParseGitHubReleaseJsonData(), utilsFreeGitHubReleaseJsonData(), utilsGetApplicationUpdatedState() and utilsGetApplicationUpdatedState().
* utils: add extra logic to move the application's NRO to its proper path if the launch path isn't the right one (commented out at this moment).
* utils: add extra logic to replace the application's NRO at exit (commented out at this moment).
* defines: add DEVOPTAB_SDMC_DEVICE and tweak GitHub URL macros.
* DownloadTask: set percentage to 0 if the download size is unknown.
* DownloadTask: fix ETA string formatting.
* OptionsTab: repurpose OptionsTabUpdateFileDialogContent into OptionsTabUpdateProgress.
* OptionsTab: implement OptionsTabUpdateApplicationFrame.
* RootView: move date formatting into the static GetFormattedDateString() method.
* Makefile: use _GNU_SOURCE as part of CFLAGS to use strptime().
2021-08-07 04:42:03 -04:00
Pablo Curiel 05dec93795 Implemented AsyncTask class.
Other changes include:

* Updated borealis.
* Updated Makefile.
* Began implementation of a (very) simple, CURL-based HTTP handler.
* OptionsTab: added a small disclaimer about dump options.
* OptionsTab:  added notifications for the update application item (running as NSO, app already updated).
* config: improved boundary handling while validating integer entries.
* utils: (de)initialize CURL (this will be moved to http.c eventually).
2021-07-25 01:37:13 -04:00
Pablo Curiel 64ab1705bc Implement JSON configuration handler.
* Thread-safe.
* Provides getter/setter functions for the data types used by nxdumptool's configuration.
* Each setter function writes the modified JSON configuration back to the SD card.
* Configuration is validated on interface initialization. If validation fails, a default JSON template is loaded from the application's RomFS and written back to the SD card.

Other changes:

* Implement directory creation.
* Moved more preprocessor definitions to defines.h.
* Replaced strtok() calls throughout the code with strtok_r() to guarantee thread-safety.
2021-07-21 11:04:18 -04:00
Pablo Curiel 5aa3eb05b7 Add subtle click animation and scrollbars.
Also use DWARFv4 explicitly for debug ELFs.
2021-06-27 14:54:27 -04:00
Pablo Curiel 4d1b3660c3 Cherry-pick improvements from the rewrite-yoga branch. 2021-06-23 14:27:06 -04:00
Pablo Curiel 601cae399f UI changes.
* GameCardTab: use fmt library to format strings.
* AboutTab: finish view.
2021-06-17 03:55:42 -04:00
Pablo Curiel 78f780a981 Implemented C++ scope guards.
Thanks @SciresM

These will be used for handling resource deinitialization in Borealis-related code.
2021-06-07 23:13:45 -04:00
Pablo Curiel f82d7a3db4 Small code refactor (part 2).
* Rewrote mutex handling throughout the code to use a small, macro-based scoped lock implementation.

* Removed extern variables from common.h - launch path management is now completely handled in utils.c.

* Updated NpdmSystemCallId_Count to reflect changes introduced in 12.0.0.

* Added NcaMainSignatureKeyGeneration enum.

* NCA main signature moduli are now retrieved from FS .rodata at runtime.

* Simplified lock management in usb.c by using a single global mutex with scoped locks instead of three different r/w locks.

* Updated FatFs to R0.14b.

* Enabled 64-bit LBA support in FatFs to potentially support custom eMMC replacements / resized USER partitions in the future.

* Updated LZ4 to v1.9.3.

* Fixed typos.

* USB gamecard dumper PoC now only dumps the Initial Data area.

* Updated to-do list.
2021-05-18 08:32:43 -04:00
Pablo Curiel 3d5b3757ec Use legacy Borealis. 2021-03-29 17:57:36 -04:00
Pablo Curiel 45b2e2398f Update Makefile 2021-03-26 00:36:00 -04:00
Pablo Curiel 11da814fb2 Fix building issues with Borealis. 2021-03-26 00:35:14 -04:00
Pablo Curiel e92c6e536b Add Borealis as a git submodule. 2021-03-25 22:49:59 -04:00
Pablo Curiel c6c5667bf0 Change project layout + upgrade license to GPLv3. 2021-03-25 15:26:58 -04:00
Pablo Curiel dd9cf1f41d Remove references to Freetype and LVGL. 2021-03-25 03:22:32 -04:00
Pablo Curiel 1e58ed4f8a Makefile: build as a C++ project.
Yes, we'll be using Borealis.
2021-03-24 20:45:31 -04:00
Pablo Curiel 3cb6ef93aa Some changes.
* Placed C++ extern "C" blocks inside include guards.

* Added a "clean_all" rule to the Makefile to avoid recompiling libusbhsfs after each time "clean" is used.

* Added static asserts for all structs that may need it throughout the code.

* Preprocessor macros are now used to generate certificate and ticket structs.
2021-03-24 13:25:19 -04:00
Pablo Curiel a7984de0c8 Send Git commit hash as part of the StartSession block. 2021-03-16 01:08:38 -04:00
Pablo Curiel 736f2e155b Add DisableDeviceAddressSpaceMerge NPDM meta flag.
Also updated the Makefile to link the application against lwext4.
2020-12-23 14:02:02 -04:00
Pablo Curiel 6c931988d3 Treat errors as warnings. 2020-12-04 03:24:17 -04:00
Pablo Curiel c29f994b35 Support for HOS 11.0.0.
* Updated hardcoded system title list to match HOS 11.0.0.
* Updated NcaKeyGeneration_Current.
* Updated button input handling to match the new pad API from libnx.
2020-12-04 02:38:44 -04:00
Pablo Curiel 9732bf9adf libusbhsfs-related changes.
* Free space is now retrieved via statvfs() for all filesystems, including the SD card.
* Updated Makefile to reflect latest libusbhsfs changes (dev branch).
2020-12-02 02:28:35 -04:00
Pablo Curiel 32c134ca4e Add libusbhsfs submodule. 2020-11-23 21:45:20 -04:00
Pablo Curiel 477c321773 Remove unnecessary code.
libusbhsfs doesn't return FsFileSystem objects, that's why.
2020-11-21 06:29:29 -04:00
Pablo Curiel e8956c0e4b Various changes.
* Cancel USB file transfer if something goes wrong during a NSP transfer via USB.
* Added SD card RomFS dumper.
* Further optimizations to the *WriteNcaPatch() functions.
* Change struct naming in nso.c/h (thanks @0Liam !).
* Replace fsp-usb with libusbhsfs. ( ͡° ͜ʖ ͡°)
2020-11-08 15:08:30 -04:00
Pablo Curiel 14ee45b38a Use BUILD_TYPE as APP_TITLE. 2020-10-26 16:17:57 -04:00
Pablo Curiel 3e59d15bc4 Minor template tweaks + LegalInfo fix. 2020-10-10 06:10:50 -04:00
Pablo Curiel a19d3f2338 Ditched C threads in favor of libnx threads.
Preemptive multithreading is still used, just like libnx's newlib implementation.

Also changed the version number because the rewrite deserves it.
2020-08-18 01:04:13 -04:00
Pablo Curiel e4a6e0e77a Begin work on title listing stuff. 2020-07-25 01:56:35 -04:00
Pablo Curiel 298676ae46 Preliminar Switch <-> PC protocol using usb:ds. 2020-05-05 11:22:16 -04:00
Pablo Curiel eccd3f0c1c Baby steps. 2020-04-15 16:50:07 -04:00
Pablo Curiel e5a4532a63 First commit. 2020-04-11 01:28:26 -04:00