commit 0370e47f7fac0e426675624f363fe50f3b442048 Author: ITotalJustice <47043333+ITotalJustice@users.noreply.github.com> Date: Mon Dec 16 21:13:05 2024 +0000 public release diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b7327b9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,24 @@ +nxbuild +build*/ +*.elf +*.nro +*.nacp +*.dksh +*.nso +*ignoreme +src/ignoreme/ +old_code +created_ncas +assets/romfs/shaders +.vscode/settings.json +info/ +romfs/shaders +assets/unused + +libs/libpulsar +libs/stb +libs/yyjson +libs/tweeny + +compile_commands.json +out diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..19c3679 --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,28 @@ +{ + "configurations": [ + { + "name": "switch", + "includePath": [ + "${default}", + "${workspaceFolder}/**", + "${workspaceFolder}/sphaira/include", + "${DEVKITPRO}/libnx/include/", + "${DEVKITPRO}/portlibs/switch/include/" + ], + "defines": [ + "__SWITCH__", + "VERSION_DIRTY=\"1.0.0\"", + "VERSION=\"3.0.0\"", + "YYJSON_DISABLE_WRITER=1", + "YYJSON_DISABLE_UTILS=1", + "YYJSON_DISABLE_NON_STANDARD=1", + "YYJSON_DISABLE_UTF8_VALIDATION=1" + ], + "cStandard": "gnu17", + "cppStandard": "gnu++23", + "compilerPath": "${DEVKITPRO}/devkitA64/bin/aarch64-none-elf-gcc", + "configurationProvider": "ms-vscode.cmake-tools" + } + ], + "version": 4 +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..3fc08dd --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,17 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "type": "cmake", + "label": "CMake: build", + "command": "build", + "targets": [ + "all" + ], + "preset": "${command:cmake.activeBuildPresetName}", + "group": "build", + "problemMatcher": [], + "detail": "CMake template build task" + } + ] +} diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..7622d68 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,46 @@ +cmake_minimum_required(VERSION 3.13) + +if (NOT DEFINED ENV{DEVKITPRO}) + message(FATAL_ERROR "DEVKITPRO is not defined!") +endif() + +if (NOT DEFINED CMAKE_TOOLCHAIN_FILE) + if (EXISTS $ENV{DEVKITPRO}/cmake/Switch.cmake) + set(CMAKE_TOOLCHAIN_FILE $ENV{DEVKITPRO}/cmake/Switch.cmake) + else() + message(FATAL_ERROR "please run 'sudo pacman -S switch-cmake`") + endif() +endif() + +project(sphaira LANGUAGES C CXX) + +# enable setting cmake options via set() +set(CMAKE_POLICY_DEFAULT_CMP0077 NEW) + +# export compile commands +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + +# enable LTO (only in release builds) +if (CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "MinSizeRel") + include(CheckIPOSupported) + check_ipo_supported(RESULT ipo_supported OUTPUT ipo_error) + if (ipo_supported) + message(STATUS "IPO / LTO enabled for ALL targets") + cmake_policy(SET CMP0069 NEW) + set(CMAKE_POLICY_DEFAULT_CMP0069 NEW) + set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) + else() + message(STATUS "IPO / LTO not supported: <${ipo_error}>") + endif() +else() + message(STATUS "IPO / LTO not enabled in debug build") +endif() + +function(dkp_fatal_if_not_found var package) + if (DEFINED ${var}_NOT_FOUND OR DEFINED ${var}-NOTFOUND) + message(FATAL_ERROR "${package} not found, please run pacman -S switch-${package}") + endif() +endfunction(dkp_fatal_if_not_found var package) + +add_subdirectory(hbl) +add_subdirectory(sphaira) diff --git a/CMakePresets.json b/CMakePresets.json new file mode 100644 index 0000000..008d505 --- /dev/null +++ b/CMakePresets.json @@ -0,0 +1,62 @@ +{ + "version": 3, + "cmakeMinimumRequired": { + "major": 3, + "minor": 21, + "patch": 0 + }, + "configurePresets": [ + { + "name": "core", + "displayName": "core", + "hidden": true, + "binaryDir": "${sourceDir}/build/${presetName}" + }, + { + "name": "Release", + "displayName": "Release", + "inherits":["core"], + "cacheVariables": { "CMAKE_BUILD_TYPE": "Release" } + }, + { + "name": "RelWithDebInfo", + "displayName": "RelWithDebInfo", + "inherits":["core"], + "cacheVariables": { "CMAKE_BUILD_TYPE":"RelWithDebInfo" } + }, + { + "name": "MinSizeRel", + "displayName": "MinSizeRel", + "inherits":["core"], + "cacheVariables": { "CMAKE_BUILD_TYPE":"MinSizeRel" } + }, + { + "name": "Debug", + "displayName": "Debug", + "inherits":["core"], + "cacheVariables": { "CMAKE_BUILD_TYPE":"Debug" } + } + ], + "buildPresets": [ + { + "name": "Release", + "configurePreset": "Release", + "jobs": 16 + }, + { + "name": "RelWithDebInfo", + "configurePreset": "RelWithDebInfo", + "jobs": 16 + }, + { + "name": "MinSizeRel", + "configurePreset": "MinSizeRel", + "jobs": 16 + }, + { + "name": "Debug", + "configurePreset": "Debug", + "jobs": 16 + } + ] +} diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e62ec04 --- /dev/null +++ b/LICENSE @@ -0,0 +1,674 @@ +GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/README.md b/README.md new file mode 100644 index 0000000..389deaf --- /dev/null +++ b/README.md @@ -0,0 +1,53 @@ +# sphaira + +A homebrew menu for the switch. + +It was built for my usage, as such, features that may seem out of place are included because i found them useful. + +[See the gbatemp thread for more details / discussion](https://gbatemp.net/threads/sphaira-hbmenu-replacement.664523/). + +## showcase + +| | | +:-------------------------:|:-------------------------: +![Img](assets/screenshots/2024121522512100-879193CD6A8B96CD00931A628B1187CB.jpg) | ![Img](assets/screenshots/2024121522514300-879193CD6A8B96CD00931A628B1187CB.jpg) +![Img](assets/screenshots/2024121522513300-879193CD6A8B96CD00931A628B1187CB.jpg) | ![Img](assets/screenshots/2024121523084100-879193CD6A8B96CD00931A628B1187CB.jpg) +![Img](assets/screenshots/2024121522505300-879193CD6A8B96CD00931A628B1187CB.jpg) | ![Img](assets/screenshots/2024121522502300-879193CD6A8B96CD00931A628B1187CB.jpg) +![Img](assets/screenshots/2024121523033200-879193CD6A8B96CD00931A628B1187CB.jpg) | ![Img](assets/screenshots/2024121523070300-879193CD6A8B96CD00931A628B1187CB.jpg) + +## 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 + +## file assoc + +sphaira has file assoc support. lets say your app supports loading .png files, then you could write an assoc 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. + +```ini +[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 + +## Credits + +- borealis +- stb +- yyjson +- nx-hbmenu +- nx-hbloader +- deko3d-nanovg +- libpulsar +- minIni +- gbatemp diff --git a/assets/icon.jpg b/assets/icon.jpg new file mode 100644 index 0000000..e028c3b Binary files /dev/null and b/assets/icon.jpg differ diff --git a/assets/romfs/GET.png b/assets/romfs/GET.png new file mode 100644 index 0000000..f3db6ff Binary files /dev/null and b/assets/romfs/GET.png differ diff --git a/assets/romfs/INSTALLED.png b/assets/romfs/INSTALLED.png new file mode 100644 index 0000000..69e6d22 Binary files /dev/null and b/assets/romfs/INSTALLED.png differ diff --git a/assets/romfs/LOCAL.png b/assets/romfs/LOCAL.png new file mode 100644 index 0000000..bd03965 Binary files /dev/null and b/assets/romfs/LOCAL.png differ diff --git a/assets/romfs/UPDATE.png b/assets/romfs/UPDATE.png new file mode 100644 index 0000000..55df85c Binary files /dev/null and b/assets/romfs/UPDATE.png differ diff --git a/assets/romfs/assoc/2048_libretro_libnx.ini b/assets/romfs/assoc/2048_libretro_libnx.ini new file mode 100644 index 0000000..8900e63 --- /dev/null +++ b/assets/romfs/assoc/2048_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/2048_libretro_libnx.nro +supported_extensions= +database=2048 diff --git a/assets/romfs/assoc/81_libretro_libnx.ini b/assets/romfs/assoc/81_libretro_libnx.ini new file mode 100644 index 0000000..dd5da61 --- /dev/null +++ b/assets/romfs/assoc/81_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/81_libretro_libnx.nro +supported_extensions=p|tzx|t81 +database=Sinclair - ZX 81 diff --git a/assets/romfs/assoc/a5200_libretro_libnx.ini b/assets/romfs/assoc/a5200_libretro_libnx.ini new file mode 100644 index 0000000..2b48e16 --- /dev/null +++ b/assets/romfs/assoc/a5200_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/a5200_libretro_libnx.nro +supported_extensions=a52|bin +database=Atari - 5200 diff --git a/assets/romfs/assoc/arduous_libretro_libnx.ini b/assets/romfs/assoc/arduous_libretro_libnx.ini new file mode 100644 index 0000000..7c81ce7 --- /dev/null +++ b/assets/romfs/assoc/arduous_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/arduous_libretro_libnx.nro +supported_extensions=hex +database=Arduboy diff --git a/assets/romfs/assoc/atari800_libretro_libnx.ini b/assets/romfs/assoc/atari800_libretro_libnx.ini new file mode 100644 index 0000000..ad36238 --- /dev/null +++ b/assets/romfs/assoc/atari800_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/atari800_libretro_libnx.nro +supported_extensions=xfd|atr|cdm|cas|bin|a52|zip|atx|car|rom|com|xex +database=Atari - 5200|Atari - 8-bit diff --git a/assets/romfs/assoc/bk_libretro_libnx.ini b/assets/romfs/assoc/bk_libretro_libnx.ini new file mode 100644 index 0000000..df3870c --- /dev/null +++ b/assets/romfs/assoc/bk_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/bk_libretro_libnx.nro +supported_extensions=bin +database=BK-0010/BK-0011 diff --git a/assets/romfs/assoc/bluemsx_libretro_libnx.ini b/assets/romfs/assoc/bluemsx_libretro_libnx.ini new file mode 100644 index 0000000..1b040a7 --- /dev/null +++ b/assets/romfs/assoc/bluemsx_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/bluemsx_libretro_libnx.nro +supported_extensions=rom|ri|mx1|mx2|col|dsk|cas|sg|sc|sf|m3u +database=Microsoft - MSX|Microsoft - MSX2|Coleco - ColecoVision|Sega - SG-1000 diff --git a/assets/romfs/assoc/boom3_libretro_libnx.ini b/assets/romfs/assoc/boom3_libretro_libnx.ini new file mode 100644 index 0000000..3185e84 --- /dev/null +++ b/assets/romfs/assoc/boom3_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/boom3_libretro_libnx.nro +supported_extensions=pk4 +database=Doom 3 diff --git a/assets/romfs/assoc/boom3_xp_libretro_libnx.ini b/assets/romfs/assoc/boom3_xp_libretro_libnx.ini new file mode 100644 index 0000000..af02091 --- /dev/null +++ b/assets/romfs/assoc/boom3_xp_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/boom3_xp_libretro_libnx.nro +supported_extensions=pk4 +database=Doom 3 diff --git a/assets/romfs/assoc/bsnes_hd_beta_libretro_libnx.ini b/assets/romfs/assoc/bsnes_hd_beta_libretro_libnx.ini new file mode 100644 index 0000000..73baeba --- /dev/null +++ b/assets/romfs/assoc/bsnes_hd_beta_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/bsnes_hd_beta_libretro_libnx.nro +supported_extensions=smc|sfc|swc|fig|gb|gbc|bs +database=Nintendo - Super Nintendo Entertainment System|Nintendo - Sufami Turbo|Nintendo - Satellaview diff --git a/assets/romfs/assoc/bsnes_libretro_libnx.ini b/assets/romfs/assoc/bsnes_libretro_libnx.ini new file mode 100644 index 0000000..1b7c9db --- /dev/null +++ b/assets/romfs/assoc/bsnes_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/bsnes_libretro_libnx.nro +supported_extensions=smc|sfc|swc|fig|gb|gbc|bs +database=Nintendo - Super Nintendo Entertainment System|Nintendo - Sufami Turbo|Nintendo - Satellaview diff --git a/assets/romfs/assoc/cannonball_libretro_libnx.ini b/assets/romfs/assoc/cannonball_libretro_libnx.ini new file mode 100644 index 0000000..b463496 --- /dev/null +++ b/assets/romfs/assoc/cannonball_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/cannonball_libretro_libnx.nro +supported_extensions=game|88 +database=Cannonball diff --git a/assets/romfs/assoc/cap32_libretro_libnx.ini b/assets/romfs/assoc/cap32_libretro_libnx.ini new file mode 100644 index 0000000..565894e --- /dev/null +++ b/assets/romfs/assoc/cap32_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/cap32_libretro_libnx.nro +supported_extensions=dsk|sna|zip|tap|cdt|voc|cpr|m3u +database=Amstrad - CPC|Amstrad - GX4000 diff --git a/assets/romfs/assoc/chailove_libretro_libnx.ini b/assets/romfs/assoc/chailove_libretro_libnx.ini new file mode 100644 index 0000000..b63127e --- /dev/null +++ b/assets/romfs/assoc/chailove_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/chailove_libretro_libnx.nro +supported_extensions=chai|chailove +database=ChaiLove diff --git a/assets/romfs/assoc/citra_libretro_libnx.ini b/assets/romfs/assoc/citra_libretro_libnx.ini new file mode 100644 index 0000000..8597ddd --- /dev/null +++ b/assets/romfs/assoc/citra_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/citra_libretro_libnx.nro +supported_extensions=3ds|3dsx|elf|axf|cci|cxi|app +database=Nintendo - Nintendo 3DS diff --git a/assets/romfs/assoc/crocods_libretro_libnx.ini b/assets/romfs/assoc/crocods_libretro_libnx.ini new file mode 100644 index 0000000..64c48fd --- /dev/null +++ b/assets/romfs/assoc/crocods_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/crocods_libretro_libnx.nro +supported_extensions=dsk|sna|kcr +database=Amstrad - CPC diff --git a/assets/romfs/assoc/desmume_libretro_libnx.ini b/assets/romfs/assoc/desmume_libretro_libnx.ini new file mode 100644 index 0000000..c2ae6f3 --- /dev/null +++ b/assets/romfs/assoc/desmume_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/desmume_libretro_libnx.nro +supported_extensions=nds|ids|bin +database=Nintendo - Nintendo DS|Nintendo - Nintendo DS (Download Play) diff --git a/assets/romfs/assoc/dinothawr_libretro_libnx.ini b/assets/romfs/assoc/dinothawr_libretro_libnx.ini new file mode 100644 index 0000000..971d7f1 --- /dev/null +++ b/assets/romfs/assoc/dinothawr_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/dinothawr_libretro_libnx.nro +supported_extensions=game +database=Dinothawr diff --git a/assets/romfs/assoc/dosbox_svn_libretro_libnx.ini b/assets/romfs/assoc/dosbox_svn_libretro_libnx.ini new file mode 100644 index 0000000..6801fa2 --- /dev/null +++ b/assets/romfs/assoc/dosbox_svn_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/dosbox_svn_libretro_libnx.nro +supported_extensions=exe|com|bat|conf|cue|iso +database=DOS diff --git a/assets/romfs/assoc/easyrpg_libretro_libnx.ini b/assets/romfs/assoc/easyrpg_libretro_libnx.ini new file mode 100644 index 0000000..ab9d562 --- /dev/null +++ b/assets/romfs/assoc/easyrpg_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/easyrpg_libretro_libnx.nro +supported_extensions=ldb|zip|easyrpg +database=RPG Maker diff --git a/assets/romfs/assoc/ecwolf_libretro_libnx.ini b/assets/romfs/assoc/ecwolf_libretro_libnx.ini new file mode 100644 index 0000000..4f57a54 --- /dev/null +++ b/assets/romfs/assoc/ecwolf_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/ecwolf_libretro_libnx.nro +supported_extensions=wl6|n3d|sod|sdm|wl1|pk3|exe +database=Wolfenstein 3D diff --git a/assets/romfs/assoc/fbalpha2012_cps1_libretro_libnx.ini b/assets/romfs/assoc/fbalpha2012_cps1_libretro_libnx.ini new file mode 100644 index 0000000..9a34990 --- /dev/null +++ b/assets/romfs/assoc/fbalpha2012_cps1_libretro_libnx.ini @@ -0,0 +1,3 @@ +[config] +path=/retroarch/cores/fbalpha2012_cps1_libretro_libnx.nro +supported_extensions=zip diff --git a/assets/romfs/assoc/fbalpha2012_cps2_libretro_libnx.ini b/assets/romfs/assoc/fbalpha2012_cps2_libretro_libnx.ini new file mode 100644 index 0000000..767310d --- /dev/null +++ b/assets/romfs/assoc/fbalpha2012_cps2_libretro_libnx.ini @@ -0,0 +1,3 @@ +[config] +path=/retroarch/cores/fbalpha2012_cps2_libretro_libnx.nro +supported_extensions=zip diff --git a/assets/romfs/assoc/fbalpha2012_libretro_libnx.ini b/assets/romfs/assoc/fbalpha2012_libretro_libnx.ini new file mode 100644 index 0000000..7ab3910 --- /dev/null +++ b/assets/romfs/assoc/fbalpha2012_libretro_libnx.ini @@ -0,0 +1,3 @@ +[config] +path=/retroarch/cores/fbalpha2012_libretro_libnx.nro +supported_extensions=iso|zip|7z diff --git a/assets/romfs/assoc/fbalpha2012_neogeo_libretro_libnx.ini b/assets/romfs/assoc/fbalpha2012_neogeo_libretro_libnx.ini new file mode 100644 index 0000000..b56c759 --- /dev/null +++ b/assets/romfs/assoc/fbalpha2012_neogeo_libretro_libnx.ini @@ -0,0 +1,3 @@ +[config] +path=/retroarch/cores/fbalpha2012_neogeo_libretro_libnx.nro +supported_extensions=zip diff --git a/assets/romfs/assoc/fbneo_libretro_libnx.ini b/assets/romfs/assoc/fbneo_libretro_libnx.ini new file mode 100644 index 0000000..fc13ee8 --- /dev/null +++ b/assets/romfs/assoc/fbneo_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/fbneo_libretro_libnx.nro +supported_extensions=zip|7z|cue|ccd +database=FBNeo - Arcade Games diff --git a/assets/romfs/assoc/fceumm_libretro_libnx.ini b/assets/romfs/assoc/fceumm_libretro_libnx.ini new file mode 100644 index 0000000..61dbd46 --- /dev/null +++ b/assets/romfs/assoc/fceumm_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/fceumm_libretro_libnx.nro +supported_extensions=fds|nes|unif|unf +database=Nintendo - Nintendo Entertainment System|Nintendo - Family Computer Disk System diff --git a/assets/romfs/assoc/flycast_libretro_libnx.ini b/assets/romfs/assoc/flycast_libretro_libnx.ini new file mode 100644 index 0000000..27d2cc4 --- /dev/null +++ b/assets/romfs/assoc/flycast_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/flycast_libretro_libnx.nro +supported_extensions=chd|cdi|elf|bin|cue|gdi|lst|zip|dat|7z|m3u +database=Sega - Dreamcast|Sega - Naomi|Sega - Naomi 2|Atomiswave diff --git a/assets/romfs/assoc/fmsx_libretro_libnx.ini b/assets/romfs/assoc/fmsx_libretro_libnx.ini new file mode 100644 index 0000000..6da04f4 --- /dev/null +++ b/assets/romfs/assoc/fmsx_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/fmsx_libretro_libnx.nro +supported_extensions=rom|mx1|mx2|dsk|fdi|cas|m3u +database=Microsoft - MSX|Microsoft - MSX2 diff --git a/assets/romfs/assoc/freechaf_libretro_libnx.ini b/assets/romfs/assoc/freechaf_libretro_libnx.ini new file mode 100644 index 0000000..71aa9bb --- /dev/null +++ b/assets/romfs/assoc/freechaf_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/freechaf_libretro_libnx.nro +supported_extensions=bin|chf +database=Fairchild - Channel F diff --git a/assets/romfs/assoc/freeintv_libretro_libnx.ini b/assets/romfs/assoc/freeintv_libretro_libnx.ini new file mode 100644 index 0000000..cd877db --- /dev/null +++ b/assets/romfs/assoc/freeintv_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/freeintv_libretro_libnx.nro +supported_extensions=int|bin|rom +database=Mattel - Intellivision diff --git a/assets/romfs/assoc/frodo_libretro_libnx.ini b/assets/romfs/assoc/frodo_libretro_libnx.ini new file mode 100644 index 0000000..73b574e --- /dev/null +++ b/assets/romfs/assoc/frodo_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/frodo_libretro_libnx.nro +supported_extensions=d64|t64|x64|p00|lnx|zip +database=Commodore - 64 diff --git a/assets/romfs/assoc/fuse_libretro_libnx.ini b/assets/romfs/assoc/fuse_libretro_libnx.ini new file mode 100644 index 0000000..778fd29 --- /dev/null +++ b/assets/romfs/assoc/fuse_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/fuse_libretro_libnx.nro +supported_extensions=tzx|tap|z80|rzx|scl|trd|dsk|zip +database=Sinclair - ZX Spectrum +3|Sinclair - ZX Spectrum diff --git a/assets/romfs/assoc/gambatte_libretro_libnx.ini b/assets/romfs/assoc/gambatte_libretro_libnx.ini new file mode 100644 index 0000000..ff98f85 --- /dev/null +++ b/assets/romfs/assoc/gambatte_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/gambatte_libretro_libnx.nro +supported_extensions=gb|gbc|dmg +database=Nintendo - Game Boy|Nintendo - Game Boy Color diff --git a/assets/romfs/assoc/gearboy_libretro_libnx.ini b/assets/romfs/assoc/gearboy_libretro_libnx.ini new file mode 100644 index 0000000..72f9a2d --- /dev/null +++ b/assets/romfs/assoc/gearboy_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/gearboy_libretro_libnx.nro +supported_extensions=gb|dmg|gbc|cgb|sgb +database=Nintendo - Game Boy|Nintendo - Game Boy Color diff --git a/assets/romfs/assoc/gearcoleco_libretro_libnx.ini b/assets/romfs/assoc/gearcoleco_libretro_libnx.ini new file mode 100644 index 0000000..7472371 --- /dev/null +++ b/assets/romfs/assoc/gearcoleco_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/gearcoleco_libretro_libnx.nro +supported_extensions=col|cv|bin|rom +database=Coleco - ColecoVision diff --git a/assets/romfs/assoc/gearsystem_libretro_libnx.ini b/assets/romfs/assoc/gearsystem_libretro_libnx.ini new file mode 100644 index 0000000..d078c9a --- /dev/null +++ b/assets/romfs/assoc/gearsystem_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/gearsystem_libretro_libnx.nro +supported_extensions=sms|gg|sg|bin|rom +database=Sega - Game Gear|Sega - Master System - Mark III|Sega - SG-1000 diff --git a/assets/romfs/assoc/genesis_plus_gx_libretro_libnx.ini b/assets/romfs/assoc/genesis_plus_gx_libretro_libnx.ini new file mode 100644 index 0000000..ed89335 --- /dev/null +++ b/assets/romfs/assoc/genesis_plus_gx_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/genesis_plus_gx_libretro_libnx.nro +supported_extensions=mdx|md|smd|gen|bin|cue|iso|sms|bms|gg|sg|68k|sgd|chd|m3u +database=Sega - Game Gear|Sega - Master System - Mark III|Sega - Mega-CD - Sega CD|Sega - Mega Drive - Genesis|Sega - PICO|Sega - SG-1000 diff --git a/assets/romfs/assoc/genesis_plus_gx_wide_libretro_libnx.ini b/assets/romfs/assoc/genesis_plus_gx_wide_libretro_libnx.ini new file mode 100644 index 0000000..1a527a9 --- /dev/null +++ b/assets/romfs/assoc/genesis_plus_gx_wide_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/genesis_plus_gx_wide_libretro_libnx.nro +supported_extensions=mdx|md|smd|gen|bin|cue|iso|sms|bms|gg|sg|68k|sgd|chd|m3u +database=Sega - Game Gear|Sega - Master System - Mark III|Sega - Mega-CD - Sega CD|Sega - Mega Drive - Genesis|Sega - PICO|Sega - SG-1000 diff --git a/assets/romfs/assoc/gme_libretro_libnx.ini b/assets/romfs/assoc/gme_libretro_libnx.ini new file mode 100644 index 0000000..980c3f2 --- /dev/null +++ b/assets/romfs/assoc/gme_libretro_libnx.ini @@ -0,0 +1,3 @@ +[config] +path=/retroarch/cores/gme_libretro_libnx.nro +supported_extensions=ay|gbs|gym|hes|kss|nsf|nsfe|sap|spc|vgm|vgz|zip diff --git a/assets/romfs/assoc/gong_libretro_libnx.ini b/assets/romfs/assoc/gong_libretro_libnx.ini new file mode 100644 index 0000000..e767c0c --- /dev/null +++ b/assets/romfs/assoc/gong_libretro_libnx.ini @@ -0,0 +1,3 @@ +[config] +path=/retroarch/cores/gong_libretro_libnx.nro +supported_extensions= diff --git a/assets/romfs/assoc/gw_libretro_libnx.ini b/assets/romfs/assoc/gw_libretro_libnx.ini new file mode 100644 index 0000000..9ae8da4 --- /dev/null +++ b/assets/romfs/assoc/gw_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/gw_libretro_libnx.nro +supported_extensions=mgw +database=Handheld Electronic Game diff --git a/assets/romfs/assoc/handy_libretro_libnx.ini b/assets/romfs/assoc/handy_libretro_libnx.ini new file mode 100644 index 0000000..af97bd8 --- /dev/null +++ b/assets/romfs/assoc/handy_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/handy_libretro_libnx.nro +supported_extensions=lnx|o +database=Atari - Lynx diff --git a/assets/romfs/assoc/jaxe_libretro_libnx.ini b/assets/romfs/assoc/jaxe_libretro_libnx.ini new file mode 100644 index 0000000..3c5a276 --- /dev/null +++ b/assets/romfs/assoc/jaxe_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/jaxe_libretro_libnx.nro +supported_extensions=ch8|sc8|xo8 +database=CHIP-8 diff --git a/assets/romfs/assoc/jumpnbump_libretro_libnx.ini b/assets/romfs/assoc/jumpnbump_libretro_libnx.ini new file mode 100644 index 0000000..ba4649b --- /dev/null +++ b/assets/romfs/assoc/jumpnbump_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/jumpnbump_libretro_libnx.nro +supported_extensions=dat +database=Jump 'n Bump diff --git a/assets/romfs/assoc/lowresnx_libretro_libnx.ini b/assets/romfs/assoc/lowresnx_libretro_libnx.ini new file mode 100644 index 0000000..8ad6404 --- /dev/null +++ b/assets/romfs/assoc/lowresnx_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/lowresnx_libretro_libnx.nro +supported_extensions=nx +database=LowRes NX diff --git a/assets/romfs/assoc/lutro_libretro_libnx.ini b/assets/romfs/assoc/lutro_libretro_libnx.ini new file mode 100644 index 0000000..85c14df --- /dev/null +++ b/assets/romfs/assoc/lutro_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/lutro_libretro_libnx.nro +supported_extensions=lutro|love|lua +database=Lutro diff --git a/assets/romfs/assoc/mame2000_libretro_libnx.ini b/assets/romfs/assoc/mame2000_libretro_libnx.ini new file mode 100644 index 0000000..3de6c5d --- /dev/null +++ b/assets/romfs/assoc/mame2000_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/mame2000_libretro_libnx.nro +supported_extensions=zip|7z|chd +database=MAME 2000 diff --git a/assets/romfs/assoc/mame2003_libretro_libnx.ini b/assets/romfs/assoc/mame2003_libretro_libnx.ini new file mode 100644 index 0000000..be5d860 --- /dev/null +++ b/assets/romfs/assoc/mame2003_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/mame2003_libretro_libnx.nro +supported_extensions=zip +database=MAME 2003 diff --git a/assets/romfs/assoc/mame2003_plus_libretro_libnx.ini b/assets/romfs/assoc/mame2003_plus_libretro_libnx.ini new file mode 100644 index 0000000..1f33675 --- /dev/null +++ b/assets/romfs/assoc/mame2003_plus_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/mame2003_plus_libretro_libnx.nro +supported_extensions=zip +database=MAME 2003-Plus diff --git a/assets/romfs/assoc/mednafen_lynx_libretro_libnx.ini b/assets/romfs/assoc/mednafen_lynx_libretro_libnx.ini new file mode 100644 index 0000000..8dd9abc --- /dev/null +++ b/assets/romfs/assoc/mednafen_lynx_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/mednafen_lynx_libretro_libnx.nro +supported_extensions=lnx|o +database=Atari - Lynx diff --git a/assets/romfs/assoc/mednafen_ngp_libretro_libnx.ini b/assets/romfs/assoc/mednafen_ngp_libretro_libnx.ini new file mode 100644 index 0000000..d2c460b --- /dev/null +++ b/assets/romfs/assoc/mednafen_ngp_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/mednafen_ngp_libretro_libnx.nro +supported_extensions=ngp|ngc|ngpc|npc +database=SNK - Neo Geo Pocket|SNK - Neo Geo Pocket Color diff --git a/assets/romfs/assoc/mednafen_pce_fast_libretro_libnx.ini b/assets/romfs/assoc/mednafen_pce_fast_libretro_libnx.ini new file mode 100644 index 0000000..7c45bea --- /dev/null +++ b/assets/romfs/assoc/mednafen_pce_fast_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/mednafen_pce_fast_libretro_libnx.nro +supported_extensions=pce|cue|ccd|chd|toc|m3u +database=NEC - PC Engine - TurboGrafx 16|NEC - PC Engine CD - TurboGrafx-CD diff --git a/assets/romfs/assoc/mednafen_pce_libretro_libnx.ini b/assets/romfs/assoc/mednafen_pce_libretro_libnx.ini new file mode 100644 index 0000000..aabcec2 --- /dev/null +++ b/assets/romfs/assoc/mednafen_pce_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/mednafen_pce_libretro_libnx.nro +supported_extensions=pce|sgx|cue|ccd|chd|toc|m3u +database=NEC - PC Engine SuperGrafx|NEC - PC Engine - TurboGrafx 16|NEC - PC Engine CD - TurboGrafx-CD diff --git a/assets/romfs/assoc/mednafen_pcfx_libretro_libnx.ini b/assets/romfs/assoc/mednafen_pcfx_libretro_libnx.ini new file mode 100644 index 0000000..30dab19 --- /dev/null +++ b/assets/romfs/assoc/mednafen_pcfx_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/mednafen_pcfx_libretro_libnx.nro +supported_extensions=cue|ccd|toc|chd +database=NEC - PC-FX diff --git a/assets/romfs/assoc/mednafen_supergrafx_libretro_libnx.ini b/assets/romfs/assoc/mednafen_supergrafx_libretro_libnx.ini new file mode 100644 index 0000000..23521bc --- /dev/null +++ b/assets/romfs/assoc/mednafen_supergrafx_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/mednafen_supergrafx_libretro_libnx.nro +supported_extensions=pce|sgx|cue|ccd|chd +database=NEC - PC Engine SuperGrafx|NEC - PC Engine - TurboGrafx 16|NEC - PC Engine CD - TurboGrafx-CD diff --git a/assets/romfs/assoc/mednafen_vb_libretro_libnx.ini b/assets/romfs/assoc/mednafen_vb_libretro_libnx.ini new file mode 100644 index 0000000..97f3e83 --- /dev/null +++ b/assets/romfs/assoc/mednafen_vb_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/mednafen_vb_libretro_libnx.nro +supported_extensions=vb|vboy|bin +database=Nintendo - Virtual Boy diff --git a/assets/romfs/assoc/mednafen_wswan_libretro_libnx.ini b/assets/romfs/assoc/mednafen_wswan_libretro_libnx.ini new file mode 100644 index 0000000..bcda838 --- /dev/null +++ b/assets/romfs/assoc/mednafen_wswan_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/mednafen_wswan_libretro_libnx.nro +supported_extensions=ws|wsc|pc2|pcv2 +database=Bandai - WonderSwan|Bandai - WonderSwan Color diff --git a/assets/romfs/assoc/melonds.ini b/assets/romfs/assoc/melonds.ini new file mode 100644 index 0000000..c6118f0 --- /dev/null +++ b/assets/romfs/assoc/melonds.ini @@ -0,0 +1,4 @@ +[config] +supported_extensions=nds +database=Nintendo - Nintendo DS + diff --git a/assets/romfs/assoc/melonds_libretro_libnx.ini b/assets/romfs/assoc/melonds_libretro_libnx.ini new file mode 100644 index 0000000..3c0a60f --- /dev/null +++ b/assets/romfs/assoc/melonds_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/melonds_libretro_libnx.nro +supported_extensions=nds|ids|dsi +database=Nintendo - Nintendo DS|Nintendo - Nintendo DS (Download Play)|Nintendo - Nintendo DSi|Nintendo - Nintendo DSi Decrypted|Nintendo - Nintendo DSi (Digital) diff --git a/assets/romfs/assoc/mesen-s_libretro_libnx.ini b/assets/romfs/assoc/mesen-s_libretro_libnx.ini new file mode 100644 index 0000000..0a4e75b --- /dev/null +++ b/assets/romfs/assoc/mesen-s_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/mesen-s_libretro_libnx.nro +supported_extensions=sfc|smc|fig|swc|bs|gb|gbc +database=Nintendo - Super Nintendo Entertainment System|Nintendo - Satellaview|Nintendo - Game Boy|Nintendo - Game Boy Color diff --git a/assets/romfs/assoc/mesen_libretro_libnx.ini b/assets/romfs/assoc/mesen_libretro_libnx.ini new file mode 100644 index 0000000..371abfe --- /dev/null +++ b/assets/romfs/assoc/mesen_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/mesen_libretro_libnx.nro +supported_extensions=nes|fds|unf|unif +database=Nintendo - Nintendo Entertainment System|Nintendo - Family Computer Disk System diff --git a/assets/romfs/assoc/mgba.ini b/assets/romfs/assoc/mgba.ini new file mode 100644 index 0000000..14d2c71 --- /dev/null +++ b/assets/romfs/assoc/mgba.ini @@ -0,0 +1,3 @@ +[config] +supported_extensions=gba|gbc|sgb|gb +database=Nintendo - Game Boy|Nintendo - Game Boy Color|Nintendo - Game Boy Advance diff --git a/assets/romfs/assoc/mgba_libretro_libnx.ini b/assets/romfs/assoc/mgba_libretro_libnx.ini new file mode 100644 index 0000000..c5b0458 --- /dev/null +++ b/assets/romfs/assoc/mgba_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/mgba_libretro_libnx.nro +supported_extensions=gb|gbc|gba +database=Nintendo - Game Boy|Nintendo - Game Boy Color|Nintendo - Game Boy Advance diff --git a/assets/romfs/assoc/minivmac_libretro_libnx.ini b/assets/romfs/assoc/minivmac_libretro_libnx.ini new file mode 100644 index 0000000..f047720 --- /dev/null +++ b/assets/romfs/assoc/minivmac_libretro_libnx.ini @@ -0,0 +1,3 @@ +[config] +path=/retroarch/cores/minivmac_libretro_libnx.nro +supported_extensions=dsk|img|zip|hvf|cmd diff --git a/assets/romfs/assoc/mu_libretro_libnx.ini b/assets/romfs/assoc/mu_libretro_libnx.ini new file mode 100644 index 0000000..61ee02b --- /dev/null +++ b/assets/romfs/assoc/mu_libretro_libnx.ini @@ -0,0 +1,3 @@ +[config] +path=/retroarch/cores/mu_libretro_libnx.nro +supported_extensions=prc|pqa|img|pdb|zip diff --git a/assets/romfs/assoc/mupen64plus_next_libretro_libnx.ini b/assets/romfs/assoc/mupen64plus_next_libretro_libnx.ini new file mode 100644 index 0000000..88e9216 --- /dev/null +++ b/assets/romfs/assoc/mupen64plus_next_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/mupen64plus_next_libretro_libnx.nro +supported_extensions=n64|v64|z64|ndd|bin|u1 +database=Nintendo - Nintendo 64 diff --git a/assets/romfs/assoc/neocd_libretro_libnx.ini b/assets/romfs/assoc/neocd_libretro_libnx.ini new file mode 100644 index 0000000..2111b00 --- /dev/null +++ b/assets/romfs/assoc/neocd_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/neocd_libretro_libnx.nro +supported_extensions=cue|chd +database=SNK - Neo Geo CD diff --git a/assets/romfs/assoc/nestopia_libretro_libnx.ini b/assets/romfs/assoc/nestopia_libretro_libnx.ini new file mode 100644 index 0000000..579bd33 --- /dev/null +++ b/assets/romfs/assoc/nestopia_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/nestopia_libretro_libnx.nro +supported_extensions=nes|fds|unf|unif +database=Nintendo - Nintendo Entertainment System|Nintendo - Family Computer Disk System diff --git a/assets/romfs/assoc/np2kai_libretro_libnx.ini b/assets/romfs/assoc/np2kai_libretro_libnx.ini new file mode 100644 index 0000000..e33e194 --- /dev/null +++ b/assets/romfs/assoc/np2kai_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/np2kai_libretro_libnx.nro +supported_extensions=d98|zip|98d|fdi|fdd|2hd|tfd|d88|88d|hdm|xdf|dup|cmd|hdi|thd|nhd|hdd|hdn +database=NEC - PC-98 diff --git a/assets/romfs/assoc/numero_libretro_libnx.ini b/assets/romfs/assoc/numero_libretro_libnx.ini new file mode 100644 index 0000000..8dc5772 --- /dev/null +++ b/assets/romfs/assoc/numero_libretro_libnx.ini @@ -0,0 +1,3 @@ +[config] +path=/retroarch/cores/numero_libretro_libnx.nro +supported_extensions=8xp|8xk|8xg diff --git a/assets/romfs/assoc/nxengine_libretro_libnx.ini b/assets/romfs/assoc/nxengine_libretro_libnx.ini new file mode 100644 index 0000000..7bb0710 --- /dev/null +++ b/assets/romfs/assoc/nxengine_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/nxengine_libretro_libnx.nro +supported_extensions=exe +database=Cave Story diff --git a/assets/romfs/assoc/o2em_libretro_libnx.ini b/assets/romfs/assoc/o2em_libretro_libnx.ini new file mode 100644 index 0000000..391d948 --- /dev/null +++ b/assets/romfs/assoc/o2em_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/o2em_libretro_libnx.nro +supported_extensions=bin +database=Magnavox - Odyssey2|Philips - Videopac+ diff --git a/assets/romfs/assoc/opera_libretro_libnx.ini b/assets/romfs/assoc/opera_libretro_libnx.ini new file mode 100644 index 0000000..3be942e --- /dev/null +++ b/assets/romfs/assoc/opera_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/opera_libretro_libnx.nro +supported_extensions=iso|bin|chd|cue +database=The 3DO Company - 3DO diff --git a/assets/romfs/assoc/pcsx_rearmed_libretro_libnx.ini b/assets/romfs/assoc/pcsx_rearmed_libretro_libnx.ini new file mode 100644 index 0000000..9861603 --- /dev/null +++ b/assets/romfs/assoc/pcsx_rearmed_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/pcsx_rearmed_libretro_libnx.nro +supported_extensions=bin|cue|img|mdf|pbp|toc|cbn|m3u|ccd|chd +database=Sony - PlayStation diff --git a/assets/romfs/assoc/picodrive_libretro_libnx.ini b/assets/romfs/assoc/picodrive_libretro_libnx.ini new file mode 100644 index 0000000..6650012 --- /dev/null +++ b/assets/romfs/assoc/picodrive_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/picodrive_libretro_libnx.nro +supported_extensions=bin|gen|smd|md|32x|cue|iso|chd|sms|gg|sg|sc|m3u|68k|sgd|pco +database=Sega - Master System - Mark III|Sega - Game Gear|Sega - Mega-CD - Sega CD|Sega - Mega Drive - Genesis|Sega - PICO|Sega - 32X diff --git a/assets/romfs/assoc/pocketcdg_libretro_libnx.ini b/assets/romfs/assoc/pocketcdg_libretro_libnx.ini new file mode 100644 index 0000000..a2a4144 --- /dev/null +++ b/assets/romfs/assoc/pocketcdg_libretro_libnx.ini @@ -0,0 +1,3 @@ +[config] +path=/retroarch/cores/pocketcdg_libretro_libnx.nro +supported_extensions=cdg diff --git a/assets/romfs/assoc/pokemini_libretro_libnx.ini b/assets/romfs/assoc/pokemini_libretro_libnx.ini new file mode 100644 index 0000000..867afe9 --- /dev/null +++ b/assets/romfs/assoc/pokemini_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/pokemini_libretro_libnx.nro +supported_extensions=min +database=Nintendo - Pokemon Mini diff --git a/assets/romfs/assoc/potator_libretro_libnx.ini b/assets/romfs/assoc/potator_libretro_libnx.ini new file mode 100644 index 0000000..5063027 --- /dev/null +++ b/assets/romfs/assoc/potator_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/potator_libretro_libnx.nro +supported_extensions=bin|sv +database=Watara - Supervision diff --git a/assets/romfs/assoc/ppsspp_libretro_libnx.ini b/assets/romfs/assoc/ppsspp_libretro_libnx.ini new file mode 100644 index 0000000..90538e2 --- /dev/null +++ b/assets/romfs/assoc/ppsspp_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/ppsspp_libretro_libnx.nro +supported_extensions=elf|iso|cso|prx|pbp +database=Sony - PlayStation Portable diff --git a/assets/romfs/assoc/prboom_libretro_libnx.ini b/assets/romfs/assoc/prboom_libretro_libnx.ini new file mode 100644 index 0000000..aca6758 --- /dev/null +++ b/assets/romfs/assoc/prboom_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/prboom_libretro_libnx.nro +supported_extensions=wad|iwad|pwad +database=DOOM diff --git a/assets/romfs/assoc/prosystem_libretro_libnx.ini b/assets/romfs/assoc/prosystem_libretro_libnx.ini new file mode 100644 index 0000000..a1596f0 --- /dev/null +++ b/assets/romfs/assoc/prosystem_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/prosystem_libretro_libnx.nro +supported_extensions=a78|bin|cdf +database=Atari - 7800 diff --git a/assets/romfs/assoc/puae2021_libretro_libnx.ini b/assets/romfs/assoc/puae2021_libretro_libnx.ini new file mode 100644 index 0000000..35edef9 --- /dev/null +++ b/assets/romfs/assoc/puae2021_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/puae2021_libretro_libnx.nro +supported_extensions=adf|adz|dms|fdi|ipf|hdf|hdz|lha|slave|info|cue|ccd|nrg|mds|iso|chd|uae|m3u|zip|7z|rp9 +database=Commodore - Amiga|Commodore - CD32|Commodore - CDTV diff --git a/assets/romfs/assoc/puae_libretro_libnx.ini b/assets/romfs/assoc/puae_libretro_libnx.ini new file mode 100644 index 0000000..569162d --- /dev/null +++ b/assets/romfs/assoc/puae_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/puae_libretro_libnx.nro +supported_extensions=adf|adz|dms|fdi|ipf|hdf|hdz|lha|slave|info|cue|ccd|nrg|mds|iso|chd|uae|m3u|zip|7z|rp9 +database=Commodore - Amiga|Commodore - CD32|Commodore - CDTV diff --git a/assets/romfs/assoc/px68k_libretro_libnx.ini b/assets/romfs/assoc/px68k_libretro_libnx.ini new file mode 100644 index 0000000..a83b5d7 --- /dev/null +++ b/assets/romfs/assoc/px68k_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/px68k_libretro_libnx.nro +supported_extensions=dim|zip|img|d88|88d|hdm|dup|2hd|xdf|hdf|cmd|m3u +database=Sharp - X68000 diff --git a/assets/romfs/assoc/quasi88_libretro_libnx.ini b/assets/romfs/assoc/quasi88_libretro_libnx.ini new file mode 100644 index 0000000..2323e69 --- /dev/null +++ b/assets/romfs/assoc/quasi88_libretro_libnx.ini @@ -0,0 +1,3 @@ +[config] +path=/retroarch/cores/quasi88_libretro_libnx.nro +supported_extensions=d88|u88|m3u diff --git a/assets/romfs/assoc/quicknes_libretro_libnx.ini b/assets/romfs/assoc/quicknes_libretro_libnx.ini new file mode 100644 index 0000000..be159f8 --- /dev/null +++ b/assets/romfs/assoc/quicknes_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/quicknes_libretro_libnx.nro +supported_extensions=nes +database=Nintendo - Nintendo Entertainment System diff --git a/assets/romfs/assoc/race_libretro_libnx.ini b/assets/romfs/assoc/race_libretro_libnx.ini new file mode 100644 index 0000000..64e60dc --- /dev/null +++ b/assets/romfs/assoc/race_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/race_libretro_libnx.nro +supported_extensions=ngp|ngc|ngpc|npc +database=SNK - Neo Geo Pocket|SNK - Neo Geo Pocket Color diff --git a/assets/romfs/assoc/reminiscence_libretro_libnx.ini b/assets/romfs/assoc/reminiscence_libretro_libnx.ini new file mode 100644 index 0000000..86f0dbf --- /dev/null +++ b/assets/romfs/assoc/reminiscence_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/reminiscence_libretro_libnx.nro +supported_extensions=map|aba|seq|lev +database=Flashback diff --git a/assets/romfs/assoc/retro8_libretro_libnx.ini b/assets/romfs/assoc/retro8_libretro_libnx.ini new file mode 100644 index 0000000..cd834b7 --- /dev/null +++ b/assets/romfs/assoc/retro8_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/retro8_libretro_libnx.nro +supported_extensions=p8|png +database=PICO8 diff --git a/assets/romfs/assoc/sameboy_libretro_libnx.ini b/assets/romfs/assoc/sameboy_libretro_libnx.ini new file mode 100644 index 0000000..fbebe4c --- /dev/null +++ b/assets/romfs/assoc/sameboy_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/sameboy_libretro_libnx.nro +supported_extensions=gb|gbc +database=Nintendo - Game Boy|Nintendo - Game Boy Color diff --git a/assets/romfs/assoc/scummvm_libretro_libnx.ini b/assets/romfs/assoc/scummvm_libretro_libnx.ini new file mode 100644 index 0000000..e82661c --- /dev/null +++ b/assets/romfs/assoc/scummvm_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/scummvm_libretro_libnx.nro +supported_extensions= Seuss's ABC|#02|$00|(A)|(a)|(b)|0|000|001|002|003|004|005|006|007|009|025|1|101|102|12|1C|1c|2|2 US|25|26|3|34|4|455|5|512|6|8|84|85|86|87|99|99 (PG)|ACX|AD|ADF|ADV|AGA|ALD|ALL|AN|ANG|AP|ASK|AUD|AVD|AVI|BAT|BIN|BLB|BMV|BND|BRO|BS +database=ScummVM diff --git a/assets/romfs/assoc/smsplus_libretro_libnx.ini b/assets/romfs/assoc/smsplus_libretro_libnx.ini new file mode 100644 index 0000000..17cb7e2 --- /dev/null +++ b/assets/romfs/assoc/smsplus_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/smsplus_libretro_libnx.nro +supported_extensions=sms|bin|rom|col|gg|sg +database=Sega - Game Gear|Sega - Master System - Mark III diff --git a/assets/romfs/assoc/snes9x2010_libretro_libnx.ini b/assets/romfs/assoc/snes9x2010_libretro_libnx.ini new file mode 100644 index 0000000..d4b5bc7 --- /dev/null +++ b/assets/romfs/assoc/snes9x2010_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/snes9x2010_libretro_libnx.nro +supported_extensions=smc|fig|sfc|gd3|gd7|dx2|bsx|swc +database=Nintendo - Super Nintendo Entertainment System|Nintendo - Sufami Turbo|Nintendo - Satellaview diff --git a/assets/romfs/assoc/snes9x_libretro_libnx.ini b/assets/romfs/assoc/snes9x_libretro_libnx.ini new file mode 100644 index 0000000..6561b43 --- /dev/null +++ b/assets/romfs/assoc/snes9x_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/snes9x_libretro_libnx.nro +supported_extensions=smc|sfc|swc|fig|bs|st +database=Nintendo - Super Nintendo Entertainment System|Nintendo - Sufami Turbo|Nintendo - Satellaview diff --git a/assets/romfs/assoc/sphaira.ini b/assets/romfs/assoc/sphaira.ini new file mode 100644 index 0000000..bc79fa0 --- /dev/null +++ b/assets/romfs/assoc/sphaira.ini @@ -0,0 +1,2 @@ +[config] +ext=nro diff --git a/assets/romfs/assoc/squirreljme_libretro_libnx.ini b/assets/romfs/assoc/squirreljme_libretro_libnx.ini new file mode 100644 index 0000000..9502f89 --- /dev/null +++ b/assets/romfs/assoc/squirreljme_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/squirreljme_libretro_libnx.nro +supported_extensions=jar|sqc|jam|jad|kjx +database=J2ME diff --git a/assets/romfs/assoc/stella2014_libretro_libnx.ini b/assets/romfs/assoc/stella2014_libretro_libnx.ini new file mode 100644 index 0000000..86d00c4 --- /dev/null +++ b/assets/romfs/assoc/stella2014_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/stella2014_libretro_libnx.nro +supported_extensions=a26|bin +database=Atari - 2600 diff --git a/assets/romfs/assoc/stella_libretro_libnx.ini b/assets/romfs/assoc/stella_libretro_libnx.ini new file mode 100644 index 0000000..79602a1 --- /dev/null +++ b/assets/romfs/assoc/stella_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/stella_libretro_libnx.nro +supported_extensions=a26|bin +database=Atari - 2600 diff --git a/assets/romfs/assoc/superbroswar_libretro_libnx.ini b/assets/romfs/assoc/superbroswar_libretro_libnx.ini new file mode 100644 index 0000000..143236e --- /dev/null +++ b/assets/romfs/assoc/superbroswar_libretro_libnx.ini @@ -0,0 +1,3 @@ +[config] +path=/retroarch/cores/superbroswar_libretro_libnx.nro +supported_extensions=game diff --git a/assets/romfs/assoc/tgbdual_libretro_libnx.ini b/assets/romfs/assoc/tgbdual_libretro_libnx.ini new file mode 100644 index 0000000..049794a --- /dev/null +++ b/assets/romfs/assoc/tgbdual_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/tgbdual_libretro_libnx.nro +supported_extensions=cgb|dmg|gb|gbc|sgb +database=Nintendo - Game Boy|Nintendo - Game Boy Color diff --git a/assets/romfs/assoc/theodore_libretro_libnx.ini b/assets/romfs/assoc/theodore_libretro_libnx.ini new file mode 100644 index 0000000..0ecb9e8 --- /dev/null +++ b/assets/romfs/assoc/theodore_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/theodore_libretro_libnx.nro +supported_extensions=fd|sap|k7|m7|m5|rom +database=Thomson - MOTO diff --git a/assets/romfs/assoc/tic80_libretro_libnx.ini b/assets/romfs/assoc/tic80_libretro_libnx.ini new file mode 100644 index 0000000..de23c28 --- /dev/null +++ b/assets/romfs/assoc/tic80_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/tic80_libretro_libnx.nro +supported_extensions=tic +database=TIC-80 diff --git a/assets/romfs/assoc/tyrquake_libretro_libnx.ini b/assets/romfs/assoc/tyrquake_libretro_libnx.ini new file mode 100644 index 0000000..089d57f --- /dev/null +++ b/assets/romfs/assoc/tyrquake_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/tyrquake_libretro_libnx.nro +supported_extensions=pak +database=Quake diff --git a/assets/romfs/assoc/uzem_libretro_libnx.ini b/assets/romfs/assoc/uzem_libretro_libnx.ini new file mode 100644 index 0000000..b392588 --- /dev/null +++ b/assets/romfs/assoc/uzem_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/uzem_libretro_libnx.nro +supported_extensions=uze +database=Uzebox diff --git a/assets/romfs/assoc/vaporspec_libretro_libnx.ini b/assets/romfs/assoc/vaporspec_libretro_libnx.ini new file mode 100644 index 0000000..d3d908f --- /dev/null +++ b/assets/romfs/assoc/vaporspec_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/vaporspec_libretro_libnx.nro +supported_extensions=vaporbin +database=VaporSpec diff --git a/assets/romfs/assoc/vba_next_libretro_libnx.ini b/assets/romfs/assoc/vba_next_libretro_libnx.ini new file mode 100644 index 0000000..368ea7c --- /dev/null +++ b/assets/romfs/assoc/vba_next_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/vba_next_libretro_libnx.nro +supported_extensions=gba +database=Nintendo - Game Boy Advance diff --git a/assets/romfs/assoc/vbam_libretro_libnx.ini b/assets/romfs/assoc/vbam_libretro_libnx.ini new file mode 100644 index 0000000..239609c --- /dev/null +++ b/assets/romfs/assoc/vbam_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/vbam_libretro_libnx.nro +supported_extensions=dmg|gb|gbc|cgb|sgb|gba +database=Nintendo - Game Boy|Nintendo - Game Boy Color|Nintendo - Game Boy Advance diff --git a/assets/romfs/assoc/vecx_libretro_libnx.ini b/assets/romfs/assoc/vecx_libretro_libnx.ini new file mode 100644 index 0000000..bf75331 --- /dev/null +++ b/assets/romfs/assoc/vecx_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/vecx_libretro_libnx.nro +supported_extensions=bin|vec +database=GCE - Vectrex diff --git a/assets/romfs/assoc/vgedit.ini b/assets/romfs/assoc/vgedit.ini new file mode 100644 index 0000000..97654a4 --- /dev/null +++ b/assets/romfs/assoc/vgedit.ini @@ -0,0 +1,2 @@ +[config] +supported_extensions=txt|json|cfg|ini|md|log diff --git a/assets/romfs/assoc/vice_x128_libretro_libnx.ini b/assets/romfs/assoc/vice_x128_libretro_libnx.ini new file mode 100644 index 0000000..b3aa0e9 --- /dev/null +++ b/assets/romfs/assoc/vice_x128_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/vice_x128_libretro_libnx.nro +supported_extensions=d64|d71|d80|d81|d82|g64|g41|x64|t64|tap|prg|p00|crt|bin|zip|gz|d6z|d7z|d8z|g6z|g4z|x6z|cmd|m3u|vfl|vsf|nib|nbz|d2m|d4m +database=Commodore - 64 diff --git a/assets/romfs/assoc/vice_x64_libretro_libnx.ini b/assets/romfs/assoc/vice_x64_libretro_libnx.ini new file mode 100644 index 0000000..a85fca7 --- /dev/null +++ b/assets/romfs/assoc/vice_x64_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/vice_x64_libretro_libnx.nro +supported_extensions=d64|d71|d80|d81|d82|g64|g41|x64|t64|tap|prg|p00|crt|bin|zip|gz|d6z|d7z|d8z|g6z|g4z|x6z|cmd|m3u|vfl|vsf|nib|nbz|d2m|d4m +database=Commodore - 64 diff --git a/assets/romfs/assoc/vice_x64sc_libretro_libnx.ini b/assets/romfs/assoc/vice_x64sc_libretro_libnx.ini new file mode 100644 index 0000000..d757f5d --- /dev/null +++ b/assets/romfs/assoc/vice_x64sc_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/vice_x64sc_libretro_libnx.nro +supported_extensions=d64|d71|d80|d81|d82|g64|g41|x64|t64|tap|prg|p00|crt|bin|zip|gz|d6z|d7z|d8z|g6z|g4z|x6z|cmd|m3u|vfl|vsf|nib|nbz|d2m|d4m +database=Commodore - 64 diff --git a/assets/romfs/assoc/vice_xcbm2_libretro_libnx.ini b/assets/romfs/assoc/vice_xcbm2_libretro_libnx.ini new file mode 100644 index 0000000..acda47c --- /dev/null +++ b/assets/romfs/assoc/vice_xcbm2_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/vice_xcbm2_libretro_libnx.nro +supported_extensions=d64|d71|d80|d81|d82|g64|g41|x64|t64|tap|prg|p00|crt|bin|zip|gz|d6z|d7z|d8z|g6z|g4z|x6z|cmd|m3u|vfl|vsf|nib|nbz|d2m|d4m +database=Commodore - CBM-II diff --git a/assets/romfs/assoc/vice_xcbm5x0_libretro_libnx.ini b/assets/romfs/assoc/vice_xcbm5x0_libretro_libnx.ini new file mode 100644 index 0000000..15c59b9 --- /dev/null +++ b/assets/romfs/assoc/vice_xcbm5x0_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/vice_xcbm5x0_libretro_libnx.nro +supported_extensions=d64|d71|d80|d81|d82|g64|g41|x64|t64|tap|prg|p00|crt|bin|zip|gz|d6z|d7z|d8z|g6z|g4z|x6z|cmd|m3u|vfl|vsf|nib|nbz|d2m|d4m +database=Commodore - CBM-5x0 diff --git a/assets/romfs/assoc/vice_xpet_libretro_libnx.ini b/assets/romfs/assoc/vice_xpet_libretro_libnx.ini new file mode 100644 index 0000000..5a3c173 --- /dev/null +++ b/assets/romfs/assoc/vice_xpet_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/vice_xpet_libretro_libnx.nro +supported_extensions=d64|d71|d80|d81|d82|g64|g41|x64|t64|tap|prg|p00|crt|bin|zip|gz|d6z|d7z|d8z|g6z|g4z|x6z|cmd|m3u|vfl|vsf|nib|nbz|d2m|d4m +database=Commodore - PET diff --git a/assets/romfs/assoc/vice_xplus4_libretro_libnx.ini b/assets/romfs/assoc/vice_xplus4_libretro_libnx.ini new file mode 100644 index 0000000..8045c0b --- /dev/null +++ b/assets/romfs/assoc/vice_xplus4_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/vice_xplus4_libretro_libnx.nro +supported_extensions=d64|d71|d80|d81|d82|g64|g41|x64|t64|tap|prg|p00|crt|bin|zip|gz|d6z|d7z|d8z|g6z|g4z|x6z|cmd|m3u|vfl|vsf|nib|nbz|d2m|d4m +database=Commodore - Plus-4 diff --git a/assets/romfs/assoc/vice_xscpu64_libretro_libnx.ini b/assets/romfs/assoc/vice_xscpu64_libretro_libnx.ini new file mode 100644 index 0000000..3f6e9d5 --- /dev/null +++ b/assets/romfs/assoc/vice_xscpu64_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/vice_xscpu64_libretro_libnx.nro +supported_extensions=d64|d71|d80|d81|d82|g64|g41|x64|t64|tap|prg|p00|crt|bin|zip|gz|d6z|d7z|d8z|g6z|g4z|x6z|cmd|m3u|vfl|vsf|nib|nbz|d2m|d4m +database=Commodore - 64 diff --git a/assets/romfs/assoc/vice_xvic_libretro_libnx.ini b/assets/romfs/assoc/vice_xvic_libretro_libnx.ini new file mode 100644 index 0000000..7e4350f --- /dev/null +++ b/assets/romfs/assoc/vice_xvic_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/vice_xvic_libretro_libnx.nro +supported_extensions=d64|d71|d80|d81|d82|g64|g41|x64|t64|tap|prg|p00|crt|bin|zip|gz|d6z|d7z|d8z|g6z|g4z|x6z|cmd|m3u|vfl|vsf|nib|nbz|d2m|d4m|20|40|60|a0|b0|rom +database=Commodore - VIC-20 diff --git a/assets/romfs/assoc/virtualjaguar_libretro_libnx.ini b/assets/romfs/assoc/virtualjaguar_libretro_libnx.ini new file mode 100644 index 0000000..cf1cdae --- /dev/null +++ b/assets/romfs/assoc/virtualjaguar_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/virtualjaguar_libretro_libnx.nro +supported_extensions=j64|jag|rom|abs|cof|bin|prg +database=Atari - Jaguar diff --git a/assets/romfs/assoc/vitaquake2-rogue_libretro_libnx.ini b/assets/romfs/assoc/vitaquake2-rogue_libretro_libnx.ini new file mode 100644 index 0000000..844a44c --- /dev/null +++ b/assets/romfs/assoc/vitaquake2-rogue_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/vitaquake2-rogue_libretro_libnx.nro +supported_extensions=pak +database=Quake II diff --git a/assets/romfs/assoc/vitaquake2-xatrix_libretro_libnx.ini b/assets/romfs/assoc/vitaquake2-xatrix_libretro_libnx.ini new file mode 100644 index 0000000..b9fded4 --- /dev/null +++ b/assets/romfs/assoc/vitaquake2-xatrix_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/vitaquake2-xatrix_libretro_libnx.nro +supported_extensions=pak +database=Quake II diff --git a/assets/romfs/assoc/vitaquake2-zaero_libretro_libnx.ini b/assets/romfs/assoc/vitaquake2-zaero_libretro_libnx.ini new file mode 100644 index 0000000..91de5c9 --- /dev/null +++ b/assets/romfs/assoc/vitaquake2-zaero_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/vitaquake2-zaero_libretro_libnx.nro +supported_extensions=pak +database=Quake II diff --git a/assets/romfs/assoc/vitaquake2_libretro_libnx.ini b/assets/romfs/assoc/vitaquake2_libretro_libnx.ini new file mode 100644 index 0000000..004d115 --- /dev/null +++ b/assets/romfs/assoc/vitaquake2_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/vitaquake2_libretro_libnx.nro +supported_extensions=pak +database=Quake II diff --git a/assets/romfs/assoc/vitaquake3_libretro_libnx.ini b/assets/romfs/assoc/vitaquake3_libretro_libnx.ini new file mode 100644 index 0000000..3d6c627 --- /dev/null +++ b/assets/romfs/assoc/vitaquake3_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/vitaquake3_libretro_libnx.nro +supported_extensions=pk3 +database=Quake III diff --git a/assets/romfs/assoc/wasm4_libretro_libnx.ini b/assets/romfs/assoc/wasm4_libretro_libnx.ini new file mode 100644 index 0000000..454e596 --- /dev/null +++ b/assets/romfs/assoc/wasm4_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/wasm4_libretro_libnx.nro +supported_extensions=wasm +database=WASM-4 diff --git a/assets/romfs/assoc/x1_libretro_libnx.ini b/assets/romfs/assoc/x1_libretro_libnx.ini new file mode 100644 index 0000000..4e2d015 --- /dev/null +++ b/assets/romfs/assoc/x1_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/x1_libretro_libnx.nro +supported_extensions=dx1|zip|2d|2hd|tfd|d88|88d|hdm|xdf|dup|tap|cmd +database=Sharp X1 diff --git a/assets/romfs/assoc/xrick_libretro_libnx.ini b/assets/romfs/assoc/xrick_libretro_libnx.ini new file mode 100644 index 0000000..04f9665 --- /dev/null +++ b/assets/romfs/assoc/xrick_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/xrick_libretro_libnx.nro +supported_extensions=zip +database=Rick Dangerous diff --git a/assets/romfs/assoc/yabause_libretro_libnx.ini b/assets/romfs/assoc/yabause_libretro_libnx.ini new file mode 100644 index 0000000..bd2c102 --- /dev/null +++ b/assets/romfs/assoc/yabause_libretro_libnx.ini @@ -0,0 +1,4 @@ +[config] +path=/retroarch/cores/yabause_libretro_libnx.nro +supported_extensions=bin|ccd|chd|cue|iso|mds|zip|m3u +database=Sega - Saturn diff --git a/assets/romfs/default.png b/assets/romfs/default.png new file mode 100644 index 0000000..1b6b0f5 Binary files /dev/null and b/assets/romfs/default.png differ diff --git a/assets/romfs/i18n/de.json b/assets/romfs/i18n/de.json new file mode 100644 index 0000000..6391b22 --- /dev/null +++ b/assets/romfs/i18n/de.json @@ -0,0 +1,114 @@ +{ + "Launch": "Start", + "Options": "Optionen", + "Homebrew Options": "Homebrew-Optionen", + "Sort By": "Sortieren nach", + "Sort Options": "Sortieroptionen", + "Updated": "Aktualisiert", + "Size": "Größe", + "Alphabetical": "Alphabetisch", + "Decending": "Absteigend", + "Ascending": "Aufsteigend", + "Sort": "Sortieren", + "Order": "Befehl", + "Info": "Info", + "Delete": "Löschen", + "Hide Sphaira": "Sphaira verstecken", + "Are you sure you want to delete ": "Sind Sie sicher, dass Sie löschen möchten? ", + "Install Forwarder": "Weiterleitung installieren", + "WARNING: Installing forwarders will lead to a ban!": "ACHTUNG: Der Einbau von Forwardern führt zu einem Verbot!", + "Back": "Zurück", + "Install": "Installieren", + "Fs": "Fs", + "App": "App", + "Menu": "Speisekarte", + "Homebrew": "Homebrew", + "FileBrowser": "DateiBrowser", + "Open": "Offen", + "Theme Options": "Themenoptionen", + "Select Theme": "Wählen Sie Thema aus", + "Shuffle": "Shuffle", + "Music": "Musik", + "Show Hidden": "Versteckt anzeigen", + "Folders First": "Ordner zuerst", + "Hidden Last": "Zuletzt versteckt", + "Yes": "Ja", + "No": "NEIN", + "Network Options": "Netzwerkoptionen", + "Nxlink": "Nxlink", + "Check for update": "Suchen Sie nach Updates", + "File Options": "Dateioptionen", + "Cut": "Schneiden", + "Copy": "Kopie", + "Rename": "Umbenennen", + "Advanced Options": "Datei erstellen", + "Create File": "Datei erstellen", + "Create Folder": "Ordner erstellen", + "View as text": "Als Text anzeigen", + "View as text (unfinished)": "Als Text anzeigen (unvollendet)", + "Set Archive Bit": "Archivbit setzen", + "AppStore Options": "AppStore-Optionen", + "All": "Alle", + "Games": "Spiele", + "Emulators": "Emulatoren", + "Tools": "Werkzeuge", + "Advanced": "Fortschrittlich", + "Themes": "Themen", + "Legacy": "Vermächtnis", + "Misc": "Sonstiges", + "Downloads": "Downloads", + "Filter": "Filter", + "Search": "Suchen", + "Menu Options": "Menüoptionen", + "Header": "Kopfzeile", + "Theme": "Thema", + "Network": "Netzwerk", + "Logging": "Protokollierung", + "Enabled": "Ermöglicht", + "Disabled": "Deaktiviert", + "Replace hbmenu on exit": "Ersetzen Sie hbmenu beim Beenden", + "Misc Options": "Verschiedene Optionen", + "Themezer": "Themezer", + "Irs": "Irs", + "Web": "Web", + "Download": "Herunterladen", + "Next Page": "Nächste Seite", + "Prev Page": "Vorherige Seite", + "Pad ": "Unterlage ", + " (Unconnected)": " (Nicht verbunden)", + "HandHeld": "Handheld", + " (Available)": " (Verfügbar)", + "0 (Sideways)": "0 (Seitwärts)", + "90 (Flat)": "90 (flach)", + "180 (-Sideways)": "180 (-Seitwärts)", + "270 (Upside down)": "270 (verkehrt herum)", + "Grey": "Grau", + "Ironbow": "Eisenbogen", + "Green": "Grün", + "Red": "Rot", + "Blue": "Blau", + "All leds": "Alle LEDs", + "Bright group": "Helle Gruppe", + "Dim group": "Dunkle Gruppe", + "None": "Keiner", + "Normal image": "Normales Bild", + "Negative image": "Negatives Bild", + "320x240": "320x240", + "160x120": "160x120", + "80x60": "80x60", + "40x30": "40x30", + "20x15": "20x15", + "Controller": "Regler", + "Rotation": "Drehung", + "Colour": "Farbe", + "Light Target": "Leichtes Ziel", + "Gain": "Gewinnen", + "Negative Image": "Negatives Bild", + "Format": "Format", + "Trimming Format": "Zuschneideformat", + "External Light Filter": "Externer Lichtfilter", + "Load Default": "Standard laden", + "No Internet": "Kein Internet", + "[Applet Mode]": "[Applet-Modus]", + "Language": "Sprache" +} diff --git a/assets/romfs/i18n/en.json b/assets/romfs/i18n/en.json new file mode 100644 index 0000000..49575d0 --- /dev/null +++ b/assets/romfs/i18n/en.json @@ -0,0 +1,114 @@ +{ + "Launch" : "Launch", + "Options" : "Options", + "Homebrew Options" : "Homebrew Options", + "Sort By" : "Sort By", + "Sort Options" : "Sort Options", + "Updated" : "Updated", + "Size" : "Size", + "Alphabetical" : "Alphabetical", + "Decending" : "Decending", + "Ascending" : "Ascending", + "Sort" : "Sort", + "Order" : "Order", + "Info" : "Info", + "Delete" : "Delete", + "Hide Sphaira" : "Hide Sphaira", + "Are you sure you want to delete " : "Are you sure you want to delete ", + "Install Forwarder" : "Install Forwarder", + "WARNING: Installing forwarders will lead to a ban!" : "WARNING: Installing forwarders will lead to a ban!", + "Back" : "Back", + "Install" : "Install", + "Fs" : "Fs", + "App" : "App", + "Menu" : "Menu", + "Homebrew" : "Homebrew", + "FileBrowser" : "FileBrowser", + "Open" : "Open", + "Theme Options" : "Theme Options", + "Select Theme" : "Select Theme", + "Shuffle" : "Shuffle", + "Music" : "Music", + "Show Hidden" : "Show Hidden", + "Folders First" : "Folders First", + "Hidden Last" : "Hidden Last", + "Yes" : "Yes", + "No" : "No", + "Network Options" : "Network Options", + "Nxlink" : "Nxlink", + "Check for update" : "Check for update", + "File Options" : "File Options", + "Cut" : "Cut", + "Copy" : "Copy", + "Rename" : "Rename", + "Advanced Options" : "Create File", + "Create File" : "Create File", + "Create Folder" : "Create Folder", + "View as text" : "View as text", + "View as text (unfinished)" : "View as text (unfinished)", + "Set Archive Bit" : "Set Archive Bit", + "AppStore Options" : "AppStore Options", + "All" : "All", + "Games" : "Games", + "Emulators" : "Emulators", + "Tools" : "Tools", + "Advanced" : "Advanced", + "Themes" : "Themes", + "Legacy" : "Legacy", + "Misc" : "Misc", + "Downloads" : "Downloads", + "Filter" : "Filter", + "Search" : "Search", + "Menu Options" : "Menu Options", + "Header" : "Header", + "Theme" : "Theme", + "Network" : "Network", + "Logging" : "Logging", + "Enabled" : "Enabled", + "Disabled" : "Disabled", + "Replace hbmenu on exit" : "Replace hbmenu on exit", + "Misc Options" : "Misc Options", + "Themezer" : "Themezer", + "Irs" : "Irs", + "Web" : "Web", + "Download" : "Download", + "Next Page" : "Next Page", + "Prev Page" : "Prev Page", + "Pad " : "Pad ", + " (Unconnected)" : " (Unconnected)", + "HandHeld" : "HandHeld", + " (Available)" : " (Available)", + "0 (Sideways)" : "0 (Sideways)", + "90 (Flat)" : "90 (Flat)", + "180 (-Sideways)" : "180 (-Sideways)", + "270 (Upside down)" : "270 (Upside down)", + "Grey" : "Grey", + "Ironbow" : "Ironbow", + "Green" : "Green", + "Red" : "Red", + "Blue" : "Blue", + "All leds" : "All leds", + "Bright group" : "Bright group", + "Dim group" : "Dim group", + "None" : "None", + "Normal image" : "Normal image", + "Negative image" : "Negative image", + "320x240" : "320x240", + "160x120" : "160x120", + "80x60" : "80x60", + "40x30" : "40x30", + "20x15" : "20x15", + "Controller" : "Controller", + "Rotation" : "Rotation", + "Colour" : "Colour", + "Light Target" : "Light Target", + "Gain" : "Gain", + "Negative Image" : "Negative Image", + "Format" : "Format", + "Trimming Format" : "Trimming Format", + "External Light Filter" : "External Light Filter", + "Load Default" : "Load Default", + "No Internet" : "No Internet", + "[Applet Mode]" : "[Applet Mode]", + "Language": "Language" +} diff --git a/assets/romfs/i18n/es.json b/assets/romfs/i18n/es.json new file mode 100644 index 0000000..2424338 --- /dev/null +++ b/assets/romfs/i18n/es.json @@ -0,0 +1,114 @@ +{ + "Launch": "Lanzamiento", + "Options": "Opciones", + "Homebrew Options": "Opciones de elaboración casera", + "Sort By": "Ordenar por", + "Sort Options": "Opciones de clasificación", + "Updated": "Actualizado", + "Size": "Tamaño", + "Alphabetical": "Alfabético", + "Decending": "Descendente", + "Ascending": "Ascendente", + "Sort": "Clasificar", + "Order": "Orden", + "Info": "Información", + "Delete": "Borrar", + "Hide Sphaira": "Ocultar Sphaira", + "Are you sure you want to delete ": "¿Estás seguro de que quieres eliminar? ", + "Install Forwarder": "Instalar reenviador", + "WARNING: Installing forwarders will lead to a ban!": "ADVERTENCIA: ¡La instalación de reenviadores dará lugar a una prohibición!", + "Back": "Atrás", + "Install": "Instalar", + "Fs": "fs", + "App": "Aplicación", + "Menu": "Menú", + "Homebrew": "cerveza casera", + "FileBrowser": "Explorador de archivos", + "Open": "Abierto", + "Theme Options": "Opciones de tema", + "Select Theme": "Seleccionar tema", + "Shuffle": "Barajar", + "Music": "Música", + "Show Hidden": "Mostrar oculto", + "Folders First": "Carpetas primero", + "Hidden Last": "Oculto último", + "Yes": "Sí", + "No": "No", + "Network Options": "Opciones de red", + "Nxlink": "nxenlace", + "Check for update": "Buscar actualizaciones", + "File Options": "Opciones de archivo", + "Cut": "Cortar", + "Copy": "Copiar", + "Rename": "Rebautizar", + "Advanced Options": "Crear archivo", + "Create File": "Crear archivo", + "Create Folder": "Crear carpeta", + "View as text": "Ver como texto", + "View as text (unfinished)": "Ver como texto (sin terminar)", + "Set Archive Bit": "Establecer bit de archivo", + "AppStore Options": "Opciones de la tienda de aplicaciones", + "All": "Todo", + "Games": "Juegos", + "Emulators": "Emuladores", + "Tools": "Herramientas", + "Advanced": "Avanzado", + "Themes": "Temas", + "Legacy": "Legado", + "Misc": "Varios", + "Downloads": "Descargas", + "Filter": "Filtrar", + "Search": "Buscar", + "Menu Options": "Opciones de menú", + "Header": "Encabezamiento", + "Theme": "Tema", + "Network": "Red", + "Logging": "Explotación florestal", + "Enabled": "Activado", + "Disabled": "Desactivado", + "Replace hbmenu on exit": "Reemplazar hbmenu al salir", + "Misc Options": "Opciones varias", + "Themezer": "Temazer", + "Irs": "irs", + "Web": "Web", + "Download": "Descargar", + "Next Page": "Página siguiente", + "Prev Page": "Página anterior", + "Pad ": "Almohadilla ", + " (Unconnected)": " (Desconectado)", + "HandHeld": "Portátil", + " (Available)": " (Disponible)", + "0 (Sideways)": "0 (de lado)", + "90 (Flat)": "90 (plano)", + "180 (-Sideways)": "180 (-de lado)", + "270 (Upside down)": "270 (al revés)", + "Grey": "Gris", + "Ironbow": "arco de hierro", + "Green": "Verde", + "Red": "Rojo", + "Blue": "Azul", + "All leds": "todos los leds", + "Bright group": "grupo brillante", + "Dim group": "grupo tenue", + "None": "Ninguno", + "Normal image": "imagen normal", + "Negative image": "Imagen negativa", + "320x240": "320x240", + "160x120": "160x120", + "80x60": "80x60", + "40x30": "40x30", + "20x15": "20x15", + "Controller": "Controlador", + "Rotation": "Rotación", + "Colour": "Color", + "Light Target": "Objetivo de luz", + "Gain": "Ganar", + "Negative Image": "Imagen negativa", + "Format": "Formato", + "Trimming Format": "Formato de recorte", + "External Light Filter": "Filtro de luz externo", + "Load Default": "Cargar predeterminado", + "No Internet": "sin internet", + "[Applet Mode]": "[Modo subprograma]", + "Language": "Idioma" +} diff --git a/assets/romfs/i18n/fr.json b/assets/romfs/i18n/fr.json new file mode 100644 index 0000000..6f1b686 --- /dev/null +++ b/assets/romfs/i18n/fr.json @@ -0,0 +1,114 @@ +{ + "Launch": "Lancement", + "Options": "Possibilités", + "Homebrew Options": "Options de brassage maison", + "Sort By": "Trier par", + "Sort Options": "Options de tri", + "Updated": "Mis à jour", + "Size": "Taille", + "Alphabetical": "Alphabétique", + "Decending": "Décroissant", + "Ascending": "Ascendant", + "Sort": "Trier", + "Order": "Commande", + "Info": "Informations", + "Delete": "Supprimer", + "Hide Sphaira": "Masquer Sphaira", + "Are you sure you want to delete ": "Etes-vous sûr de vouloir supprimer ", + "Install Forwarder": "Installer le redirecteur", + "WARNING: Installing forwarders will lead to a ban!": "ATTENTION : L'installation de transitaires entraînera une interdiction !", + "Back": "Dos", + "Install": "Installer", + "Fs": "Fs", + "App": "Application", + "Menu": "Menu", + "Homebrew": "Homebrew", + "FileBrowser": "Navigateur de fichiers", + "Open": "Ouvrir", + "Theme Options": "Options de thème", + "Select Theme": "Sélectionnez un thème", + "Shuffle": "Mélanger", + "Music": "Musique", + "Show Hidden": "Afficher masqué", + "Folders First": "Les dossiers d'abord", + "Hidden Last": "Dernier caché", + "Yes": "Oui", + "No": "Non", + "Network Options": "Options réseau", + "Nxlink": "Nxlien", + "Check for update": "Vérifier la mise à jour", + "File Options": "Options de fichier", + "Cut": "Couper", + "Copy": "Copie", + "Rename": "Rebaptiser", + "Advanced Options": "Créer un fichier", + "Create File": "Créer un fichier", + "Create Folder": "Créer un dossier", + "View as text": "Afficher sous forme de texte", + "View as text (unfinished)": "Afficher sous forme de texte (inachevé)", + "Set Archive Bit": "Définir le bit d'archive", + "AppStore Options": "Options de l'AppStore", + "All": "Tous", + "Games": "Jeux", + "Emulators": "Émulateurs", + "Tools": "Outils", + "Advanced": "Avancé", + "Themes": "Thèmes", + "Legacy": "Héritage", + "Misc": "Divers", + "Downloads": "Téléchargements", + "Filter": "Filtre", + "Search": "Recherche", + "Menu Options": "Options des menus", + "Header": "En-tête", + "Theme": "Thème", + "Network": "Réseau", + "Logging": "Enregistrement", + "Enabled": "Activé", + "Disabled": "Désactivé", + "Replace hbmenu on exit": "Remplacer hbmenu à la sortie", + "Misc Options": "Diverses options", + "Themezer": "Thème", + "Irs": "Irs", + "Web": "Web", + "Download": "Télécharger", + "Next Page": "Page suivante", + "Prev Page": "Page précédente", + "Pad ": "Tampon ", + " (Unconnected)": " (Sans rapport)", + "HandHeld": "Portable", + " (Available)": " (Disponible)", + "0 (Sideways)": "0 (latéralement)", + "90 (Flat)": "90 (plat)", + "180 (-Sideways)": "180 (-Côté)", + "270 (Upside down)": "270 (à l'envers)", + "Grey": "Gris", + "Ironbow": "Arc de fer", + "Green": "Vert", + "Red": "Rouge", + "Blue": "Bleu", + "All leds": "Toutes les LED", + "Bright group": "Groupe lumineux", + "Dim group": "Groupe de gradation", + "None": "Aucun", + "Normal image": "Image normale", + "Negative image": "Image négative", + "320x240": "320x240", + "160x120": "160x120", + "80x60": "80x60", + "40x30": "40x30", + "20x15": "20x15", + "Controller": "Contrôleur", + "Rotation": "Rotation", + "Colour": "Couleur", + "Light Target": "Cible légère", + "Gain": "Gagner", + "Negative Image": "Image négative", + "Format": "Format", + "Trimming Format": "Format de découpage", + "External Light Filter": "Filtre de lumière externe", + "Load Default": "Charger par défaut", + "No Internet": "Pas d'Internet", + "[Applet Mode]": "[Mode Applet]", + "Language": "Langue" +} diff --git a/assets/romfs/i18n/it.json b/assets/romfs/i18n/it.json new file mode 100644 index 0000000..649f454 --- /dev/null +++ b/assets/romfs/i18n/it.json @@ -0,0 +1,114 @@ +{ + "Launch": "Lancio", + "Options": "Opzioni", + "Homebrew Options": "Opzioni per l'homebrew", + "Sort By": "Ordina per", + "Sort Options": "Opzioni di ordinamento", + "Updated": "Aggiornato", + "Size": "Misurare", + "Alphabetical": "Alfabetico", + "Decending": "Decrescente", + "Ascending": "Ascendente", + "Sort": "Ordinare", + "Order": "Ordine", + "Info": "Informazioni", + "Delete": "Eliminare", + "Hide Sphaira": "Nascondi Sphaira", + "Are you sure you want to delete ": "Sei sicuro di voler eliminare? ", + "Install Forwarder": "Installa lo spedizioniere", + "WARNING: Installing forwarders will lead to a ban!": "ATTENZIONE: l'installazione di forwarder porterà al ban!", + "Back": "Indietro", + "Install": "Installare", + "Fs": "Fs", + "App": "App", + "Menu": "Menu", + "Homebrew": "Birra fatta in casa", + "FileBrowser": "FileBrowser", + "Open": "Aprire", + "Theme Options": "Opzioni del tema", + "Select Theme": "Seleziona Tema", + "Shuffle": "Mescola", + "Music": "Musica", + "Show Hidden": "Mostra nascosto", + "Folders First": "Prima le cartelle", + "Hidden Last": "Ultimo nascosto", + "Yes": "SÌ", + "No": "NO", + "Network Options": "Opzioni di rete", + "Nxlink": "Nxlink", + "Check for update": "Controlla l'aggiornamento", + "File Options": "Opzioni file", + "Cut": "Taglio", + "Copy": "Copia", + "Rename": "Rinominare", + "Advanced Options": "Crea file", + "Create File": "Crea file", + "Create Folder": "Crea cartella", + "View as text": "Visualizza come testo", + "View as text (unfinished)": "Visualizza come testo (non finito)", + "Set Archive Bit": "Imposta bit di archivio", + "AppStore Options": "Opzioni dell'App Store", + "All": "Tutto", + "Games": "Giochi", + "Emulators": "Emulatori", + "Tools": "Utensili", + "Advanced": "Avanzato", + "Themes": "Temi", + "Legacy": "Eredità", + "Misc": "Varie", + "Downloads": "Download", + "Filter": "Filtro", + "Search": "Ricerca", + "Menu Options": "Opzioni del menu", + "Header": "Intestazione", + "Theme": "Tema", + "Network": "Rete", + "Logging": "Registrazione", + "Enabled": "Abilitato", + "Disabled": "Disabilitato", + "Replace hbmenu on exit": "Sostituisci hbmenu all'uscita", + "Misc Options": "Opzioni varie", + "Themezer": "Themezer", + "Irs": "Irs", + "Web": "Rete", + "Download": "Scaricamento", + "Next Page": "Pagina successiva", + "Prev Page": "Pagina precedente", + "Pad ": "Pad ", + " (Unconnected)": " (Non connesso)", + "HandHeld": "Tenuto in mano", + " (Available)": " (Disponibile)", + "0 (Sideways)": "0 (lateralmente)", + "90 (Flat)": "90 (Piatto)", + "180 (-Sideways)": "180 (-lateralmente)", + "270 (Upside down)": "270 (Capovolto)", + "Grey": "Grigio", + "Ironbow": "Arco di ferro", + "Green": "Verde", + "Red": "Rosso", + "Blue": "Blu", + "All leds": "Tutti i led", + "Bright group": "Gruppo brillante", + "Dim group": "Gruppo debole", + "None": "Nessuno", + "Normal image": "Immagine normale", + "Negative image": "Immagine negativa", + "320x240": "320x240", + "160x120": "160x120", + "80x60": "80x60", + "40x30": "40x30", + "20x15": "20×15", + "Controller": "Controllore", + "Rotation": "Rotazione", + "Colour": "Colore", + "Light Target": "Bersaglio leggero", + "Gain": "Guadagno", + "Negative Image": "Immagine negativa", + "Format": "Formato", + "Trimming Format": "Formato di ritaglio", + "External Light Filter": "Filtro luce esterno", + "Load Default": "Carica predefinito", + "No Internet": "Niente Internet", + "[Applet Mode]": "[Modalità applet]", + "Language": "Lingua" +} diff --git a/assets/romfs/i18n/ja.json b/assets/romfs/i18n/ja.json new file mode 100644 index 0000000..2052f15 --- /dev/null +++ b/assets/romfs/i18n/ja.json @@ -0,0 +1,114 @@ +{ + "Launch": "打ち上げ", + "Options": "オプション", + "Homebrew Options": "自作オプション", + "Sort By": "並べ替え", + "Sort Options": "並べ替えオプション", + "Updated": "更新されました", + "Size": "サイズ", + "Alphabetical": "アルファベット順", + "Decending": "降順", + "Ascending": "上昇", + "Sort": "選別", + "Order": "注文", + "Info": "情報", + "Delete": "消去", + "Hide Sphaira": "ハイド・スファイラ", + "Are you sure you want to delete ": "削除してもよろしいですか ", + "Install Forwarder": "フォワーダーのインストール", + "WARNING: Installing forwarders will lead to a ban!": "警告: フォワーダーをインストールすると禁止されます。", + "Back": "戻る", + "Install": "インストール", + "Fs": "Fs", + "App": "アプリ", + "Menu": "メニュー", + "Homebrew": "自作", + "FileBrowser": "ファイルブラウザ", + "Open": "開ける", + "Theme Options": "テーマのオプション", + "Select Theme": "テーマの選択", + "Shuffle": "シャッフル", + "Music": "音楽", + "Show Hidden": "非表示を表示", + "Folders First": "フォルダーを最初に", + "Hidden Last": "隠された最後", + "Yes": "はい", + "No": "いいえ", + "Network Options": "ネットワークオプション", + "Nxlink": "Nxlink", + "Check for update": "アップデートを確認する", + "File Options": "ファイルオプション", + "Cut": "カット", + "Copy": "コピー", + "Rename": "名前の変更", + "Advanced Options": "ファイルの作成", + "Create File": "ファイルの作成", + "Create Folder": "フォルダーの作成", + "View as text": "テキストとして表示", + "View as text (unfinished)": "テキストとして表示 (未完成)", + "Set Archive Bit": "アーカイブビットの設定", + "AppStore Options": "AppStore オプション", + "All": "全て", + "Games": "ゲーム", + "Emulators": "エミュレータ", + "Tools": "ツール", + "Advanced": "高度な", + "Themes": "テーマ", + "Legacy": "遺産", + "Misc": "その他", + "Downloads": "ダウンロード", + "Filter": "フィルター", + "Search": "検索", + "Menu Options": "メニューオプション", + "Header": "ヘッダ", + "Theme": "テーマ", + "Network": "ネットワーク", + "Logging": "ロギング", + "Enabled": "有効", + "Disabled": "無効", + "Replace hbmenu on exit": "終了時に hbmenu を置き換える", + "Misc Options": "その他のオプション", + "Themezer": "テーマ設定者", + "Irs": "イルス", + "Web": "ウェブ", + "Download": "ダウンロード", + "Next Page": "次のページ", + "Prev Page": "前のページ", + "Pad ": "パッド ", + " (Unconnected)": " (未接続)", + "HandHeld": "ハンドヘルド", + " (Available)": " (利用可能)", + "0 (Sideways)": "0(横)", + "90 (Flat)": "90(フラット)", + "180 (-Sideways)": "180 (-横)", + "270 (Upside down)": "270(上下逆さま)", + "Grey": "グレー", + "Ironbow": "アイアンボウ", + "Green": "緑", + "Red": "赤", + "Blue": "青", + "All leds": "すべてのLED", + "Bright group": "明るいグループ", + "Dim group": "薄暗いグループ", + "None": "なし", + "Normal image": "通常画像", + "Negative image": "ネガティブなイメージ", + "320x240": "320×240", + "160x120": "160×120", + "80x60": "80×60", + "40x30": "40×30", + "20x15": "20x15", + "Controller": "コントローラ", + "Rotation": "回転", + "Colour": "色", + "Light Target": "ライトターゲット", + "Gain": "得", + "Negative Image": "ネガティブなイメージ", + "Format": "形式", + "Trimming Format": "トリミングフォーマット", + "External Light Filter": "外光フィルター", + "Load Default": "デフォルトをロード", + "No Internet": "インターネットなし", + "[Applet Mode]": "[アプレットモード]", + "Language": "言語" +} diff --git a/assets/romfs/i18n/ko.json b/assets/romfs/i18n/ko.json new file mode 100644 index 0000000..515bbfd --- /dev/null +++ b/assets/romfs/i18n/ko.json @@ -0,0 +1,114 @@ +{ + "Launch": "시작하다", + "Options": "옵션", + "Homebrew Options": "홈브류 옵션", + "Sort By": "정렬 기준", + "Sort Options": "정렬 옵션", + "Updated": "업데이트됨", + "Size": "크기", + "Alphabetical": "알파벳순", + "Decending": "내림차순", + "Ascending": "오름차순", + "Sort": "종류", + "Order": "주문하다", + "Info": "정보", + "Delete": "삭제", + "Hide Sphaira": "스파이라 숨기기", + "Are you sure you want to delete ": "삭제하시겠습니까? ", + "Install Forwarder": "포워더 설치", + "WARNING: Installing forwarders will lead to a ban!": "경고: 전달자를 설치하면 금지됩니다!", + "Back": "뒤쪽에", + "Install": "설치하다", + "Fs": "Fs", + "App": "앱", + "Menu": "메뉴", + "Homebrew": "홈브류", + "FileBrowser": "파일브라우저", + "Open": "열려 있는", + "Theme Options": "테마 옵션", + "Select Theme": "테마 선택", + "Shuffle": "혼합", + "Music": "음악", + "Show Hidden": "숨겨진 표시", + "Folders First": "폴더 먼저", + "Hidden Last": "숨겨진 마지막", + "Yes": "예", + "No": "아니요", + "Network Options": "네트워크 옵션", + "Nxlink": "Nxlink", + "Check for update": "업데이트 확인", + "File Options": "파일 옵션", + "Cut": "자르다", + "Copy": "복사", + "Rename": "이름 바꾸기", + "Advanced Options": "파일 생성", + "Create File": "파일 생성", + "Create Folder": "폴더 생성", + "View as text": "텍스트로 보기", + "View as text (unfinished)": "텍스트로 보기(미완성)", + "Set Archive Bit": "보관 비트 설정", + "AppStore Options": "앱스토어 옵션", + "All": "모두", + "Games": "계략", + "Emulators": "에뮬레이터", + "Tools": "도구", + "Advanced": "고급의", + "Themes": "테마", + "Legacy": "유산", + "Misc": "기타", + "Downloads": "다운로드", + "Filter": "필터", + "Search": "찾다", + "Menu Options": "메뉴 옵션", + "Header": "헤더", + "Theme": "주제", + "Network": "회로망", + "Logging": "벌채 반출", + "Enabled": "활성화됨", + "Disabled": "장애가 있는", + "Replace hbmenu on exit": "종료 시 hbmenu 교체", + "Misc Options": "기타 옵션", + "Themezer": "테마저", + "Irs": "국세청", + "Web": "편물", + "Download": "다운로드", + "Next Page": "다음 페이지", + "Prev Page": "이전 페이지", + "Pad ": "인주 ", + " (Unconnected)": " (연결되지 않음)", + "HandHeld": "휴대용", + " (Available)": " (사용 가능)", + "0 (Sideways)": "0(가로)", + "90 (Flat)": "90(플랫)", + "180 (-Sideways)": "180 (-옆으로)", + "270 (Upside down)": "270 (거꾸로)", + "Grey": "회색", + "Ironbow": "아이언보우", + "Green": "녹색", + "Red": "빨간색", + "Blue": "파란색", + "All leds": "모든 LED", + "Bright group": "밝은 그룹", + "Dim group": "희미한 그룹", + "None": "없음", + "Normal image": "일반 이미지", + "Negative image": "부정적인 이미지", + "320x240": "320x240", + "160x120": "160x120", + "80x60": "80x60", + "40x30": "40x30", + "20x15": "20x15", + "Controller": "제어 장치", + "Rotation": "회전", + "Colour": "색상", + "Light Target": "라이트 타겟", + "Gain": "얻다", + "Negative Image": "네거티브 이미지", + "Format": "체재", + "Trimming Format": "트리밍 형식", + "External Light Filter": "외부 조명 필터", + "Load Default": "기본값 로드", + "No Internet": "인터넷 없음", + "[Applet Mode]": "[애플릿 모드]", + "Language": "언어" +} diff --git a/assets/romfs/i18n/nl.json b/assets/romfs/i18n/nl.json new file mode 100644 index 0000000..47ec9e3 --- /dev/null +++ b/assets/romfs/i18n/nl.json @@ -0,0 +1,114 @@ +{ + "Launch": "Launch", + "Options": "Opties", + "Homebrew Options": "Homebrew-opties", + "Sort By": "Sorteer op", + "Sort Options": "Sorteeropties", + "Updated": "Bijgewerkt", + "Size": "Maat", + "Alphabetical": "Alfabetisch", + "Decending": "Aflopend", + "Ascending": "Oplopend", + "Sort": "Soort", + "Order": "Volgorde", + "Info": "Info", + "Delete": "Verwijderen", + "Hide Sphaira": "Verberg Sphaira", + "Are you sure you want to delete ": "Weet u zeker dat u wilt verwijderen ", + "Install Forwarder": "Forwarder installeren", + "WARNING: Installing forwarders will lead to a ban!": "WAARSCHUWING: Het installeren van forwarders leidt tot een ban!", + "Back": "Terug", + "Install": "Installeren", + "Fs": "Fs", + "App": "App", + "Menu": "Menu", + "Homebrew": "Zelf brouwen", + "FileBrowser": "Bestandsbrowser", + "Open": "Open", + "Theme Options": "Thema Opties", + "Select Theme": "Selecteer Thema", + "Shuffle": "Schudden", + "Music": "Muziek", + "Show Hidden": "Toon verborgen", + "Folders First": "Mappen eerst", + "Hidden Last": "Verborgen laatste", + "Yes": "Ja", + "No": "Nee", + "Network Options": "Netwerkopties", + "Nxlink": "Nxlink", + "Check for update": "Controleer op update", + "File Options": "Bestandsopties", + "Cut": "Snee", + "Copy": "Kopiëren", + "Rename": "Hernoemen", + "Advanced Options": "Bestand maken", + "Create File": "Bestand maken", + "Create Folder": "Map maken", + "View as text": "Bekijk als tekst", + "View as text (unfinished)": "Bekijk als tekst (onvoltooid)", + "Set Archive Bit": "Archiefbit instellen", + "AppStore Options": "AppStore-opties", + "All": "Alle", + "Games": "Spellen", + "Emulators": "Emulators", + "Tools": "Hulpmiddelen", + "Advanced": "Geavanceerd", + "Themes": "Thema's", + "Legacy": "Nalatenschap", + "Misc": "Diversen", + "Downloads": "Downloads", + "Filter": "Filter", + "Search": "Zoekopdracht", + "Menu Options": "Menu-opties", + "Header": "Koptekst", + "Theme": "Thema", + "Network": "Netwerk", + "Logging": "Loggen", + "Enabled": "Ingeschakeld", + "Disabled": "Gehandicapt", + "Replace hbmenu on exit": "Vervang hbmenu bij afsluiten", + "Misc Options": "Diverse opties", + "Themezer": "Themamaker", + "Irs": "Ir", + "Web": "Web", + "Download": "Downloaden", + "Next Page": "Volgende pagina", + "Prev Page": "Vorige pagina", + "Pad ": "Pad ", + " (Unconnected)": " (Niet verbonden)", + "HandHeld": "Handbediende", + " (Available)": " (Beschikbaar)", + "0 (Sideways)": "0 (zijwaarts)", + "90 (Flat)": "90 (plat)", + "180 (-Sideways)": "180 (-zijwaarts)", + "270 (Upside down)": "270 (ondersteboven)", + "Grey": "Grijs", + "Ironbow": "Ijzerboog", + "Green": "Groente", + "Red": "Rood", + "Blue": "Blauw", + "All leds": "Alle leds", + "Bright group": "Heldere groep", + "Dim group": "Dim groep", + "None": "Geen", + "Normal image": "Normaal beeld", + "Negative image": "Negatief beeld", + "320x240": "320x240", + "160x120": "160x120", + "80x60": "80x60", + "40x30": "40x30", + "20x15": "20x15", + "Controller": "Controleur", + "Rotation": "Rotatie", + "Colour": "Kleur", + "Light Target": "Licht doel", + "Gain": "Verdienen", + "Negative Image": "Negatief beeld", + "Format": "Formaat", + "Trimming Format": "Trimformaat", + "External Light Filter": "Extern lichtfilter", + "Load Default": "Standaard laden", + "No Internet": "Geen internet", + "[Applet Mode]": "[Applet-modus]", + "Language": "Taal" +} diff --git a/assets/romfs/i18n/pt.json b/assets/romfs/i18n/pt.json new file mode 100644 index 0000000..b3d5ada --- /dev/null +++ b/assets/romfs/i18n/pt.json @@ -0,0 +1,114 @@ +{ + "Launch": "Lançar", + "Options": "Opções", + "Homebrew Options": "Opções de fermentação caseira", + "Sort By": "Ordenar por", + "Sort Options": "Opções de classificação", + "Updated": "Atualizado", + "Size": "Tamanho", + "Alphabetical": "Alfabético", + "Decending": "Decrescente", + "Ascending": "Ascendente", + "Sort": "Organizar", + "Order": "Ordem", + "Info": "Informações", + "Delete": "Excluir", + "Hide Sphaira": "Esconder Sphaira", + "Are you sure you want to delete ": "Tem certeza de que deseja excluir ", + "Install Forwarder": "Instalar encaminhador", + "WARNING: Installing forwarders will lead to a ban!": "AVISO: A instalação de encaminhadores levará ao banimento!", + "Back": "Voltar", + "Install": "Instalar", + "Fs": "Fs", + "App": "Aplicativo", + "Menu": "Menu", + "Homebrew": "Cerveja caseira", + "FileBrowser": "Navegador de arquivos", + "Open": "Abrir", + "Theme Options": "Opções de tema", + "Select Theme": "Selecione o tema", + "Shuffle": "Embaralhar", + "Music": "Música", + "Show Hidden": "Mostrar oculto", + "Folders First": "Pastas primeiro", + "Hidden Last": "Oculto por último", + "Yes": "Sim", + "No": "Não", + "Network Options": "Opções de rede", + "Nxlink": "Nxlink", + "Check for update": "Verifique se há atualização", + "File Options": "Opções de arquivo", + "Cut": "Corte", + "Copy": "Cópia", + "Rename": "Renomear", + "Advanced Options": "Criar arquivo", + "Create File": "Criar arquivo", + "Create Folder": "Criar pasta", + "View as text": "Ver como texto", + "View as text (unfinished)": "Ver como texto (inacabado)", + "Set Archive Bit": "Definir bit de arquivo", + "AppStore Options": "Opções da AppStore", + "All": "Todos", + "Games": "Jogos", + "Emulators": "Emuladores", + "Tools": "Ferramentas", + "Advanced": "Avançado", + "Themes": "Temas", + "Legacy": "Legado", + "Misc": "Diversos", + "Downloads": "Transferências", + "Filter": "Filtro", + "Search": "Procurar", + "Menu Options": "Opções de cardápio", + "Header": "Cabeçalho", + "Theme": "Tema", + "Network": "Rede", + "Logging": "Registro", + "Enabled": "Habilitado", + "Disabled": "Desabilitado", + "Replace hbmenu on exit": "Substitua hbmenu ao sair", + "Misc Options": "Opções diversas", + "Themezer": "Temazer", + "Irs": "Receita Federal", + "Web": "Rede", + "Download": "Download", + "Next Page": "Próxima página", + "Prev Page": "Página anterior", + "Pad ": "Almofada ", + " (Unconnected)": " (Desconectado)", + "HandHeld": "Portátil", + " (Available)": " (Disponível)", + "0 (Sideways)": "0 (lateralmente)", + "90 (Flat)": "90 (plano)", + "180 (-Sideways)": "180 (-lateralmente)", + "270 (Upside down)": "270 (de cabeça para baixo)", + "Grey": "Cinza", + "Ironbow": "Arco de Ferro", + "Green": "Verde", + "Red": "Vermelho", + "Blue": "Azul", + "All leds": "Todos os LEDs", + "Bright group": "Grupo brilhante", + "Dim group": "Grupo escuro", + "None": "Nenhum", + "Normal image": "Imagem normal", + "Negative image": "Imagem negativa", + "320x240": "320x240", + "160x120": "160x120", + "80x60": "80x60", + "40x30": "40x30", + "20x15": "20x15", + "Controller": "Controlador", + "Rotation": "Rotação", + "Colour": "Cor", + "Light Target": "Alvo leve", + "Gain": "Ganho", + "Negative Image": "Imagem negativa", + "Format": "Formatar", + "Trimming Format": "Formato de corte", + "External Light Filter": "Filtro de luz externo", + "Load Default": "Carregar padrão", + "No Internet": "Sem Internet", + "[Applet Mode]": "[Modo miniaplicativo]", + "Language": "Idioma" +} diff --git a/assets/romfs/i18n/ru.json b/assets/romfs/i18n/ru.json new file mode 100644 index 0000000..e02234f --- /dev/null +++ b/assets/romfs/i18n/ru.json @@ -0,0 +1,114 @@ +{ + "Launch": "Запуск", + "Options": "Параметры", + "Homebrew Options": "Варианты домашнего пивоварения", + "Sort By": "Сортировать по", + "Sort Options": "Параметры сортировки", + "Updated": "Обновлено", + "Size": "Размер", + "Alphabetical": "Алфавитный", + "Decending": "по убыванию", + "Ascending": "восходящий", + "Sort": "Сортировать", + "Order": "Заказ", + "Info": "Информация", + "Delete": "Удалить", + "Hide Sphaira": "Скрыть Сфаиру", + "Are you sure you want to delete ": "Вы уверены, что хотите удалить ", + "Install Forwarder": "Установить переадресатор", + "WARNING: Installing forwarders will lead to a ban!": "ВНИМАНИЕ: Установка форвардеров приведет к бану!", + "Back": "Назад", + "Install": "Установить", + "Fs": "Фс", + "App": "Приложение", + "Menu": "Меню", + "Homebrew": "Домашнее пиво", + "FileBrowser": "ФайлБраузер", + "Open": "Открыть", + "Theme Options": "Параметры темы", + "Select Theme": "Выберите тему", + "Shuffle": "Перетасовать", + "Music": "Музыка", + "Show Hidden": "Показать скрытое", + "Folders First": "Папки в первую очередь", + "Hidden Last": "Скрытый последний", + "Yes": "Да", + "No": "Нет", + "Network Options": "Параметры сети", + "Nxlink": "Нкслинк", + "Check for update": "Проверить наличие обновлений", + "File Options": "Параметры файла", + "Cut": "Резать", + "Copy": "Копировать", + "Rename": "Переименовать", + "Advanced Options": "Создать файл", + "Create File": "Создать файл", + "Create Folder": "Создать папку", + "View as text": "Посмотреть как текст", + "View as text (unfinished)": "Посмотреть как текст (незакончено)", + "Set Archive Bit": "Установить бит архива", + "AppStore Options": "Параметры магазина приложений", + "All": "Все", + "Games": "Игры", + "Emulators": "Эмуляторы", + "Tools": "Инструменты", + "Advanced": "Передовой", + "Themes": "Темы", + "Legacy": "Наследие", + "Misc": "Разное", + "Downloads": "Загрузки", + "Filter": "Фильтр", + "Search": "Поиск", + "Menu Options": "Опции меню", + "Header": "Заголовок", + "Theme": "Тема", + "Network": "Сеть", + "Logging": "Ведение журнала", + "Enabled": "Включено", + "Disabled": "Неполноценный", + "Replace hbmenu on exit": "Заменить hbmenu при выходе", + "Misc Options": "Разные параметры", + "Themezer": "Темезер", + "Irs": "IRS", + "Web": "Интернет", + "Download": "Скачать", + "Next Page": "Следующая страница", + "Prev Page": "Предыдущая страница", + "Pad ": "Подушка ", + " (Unconnected)": " (Не подключено)", + "HandHeld": "Ручной", + " (Available)": " (Доступный)", + "0 (Sideways)": "0 (вбок)", + "90 (Flat)": "90 (квартира)", + "180 (-Sideways)": "180 (-вбок)", + "270 (Upside down)": "270 (перевернутый)", + "Grey": "Серый", + "Ironbow": "Железный лук", + "Green": "Зеленый", + "Red": "Красный", + "Blue": "Синий", + "All leds": "Все светодиоды", + "Bright group": "Яркая группа", + "Dim group": "Тусклая группа", + "None": "Никто", + "Normal image": "Обычное изображение", + "Negative image": "Негативный имидж", + "320x240": "320x240", + "160x120": "160x120", + "80x60": "80х60", + "40x30": "40x30", + "20x15": "20x15", + "Controller": "Контроллер", + "Rotation": "Вращение", + "Colour": "Цвет", + "Light Target": "Легкая мишень", + "Gain": "Прирост", + "Negative Image": "Негативное изображение", + "Format": "Формат", + "Trimming Format": "Формат обрезки", + "External Light Filter": "Внешний светофильтр", + "Load Default": "Загрузить по умолчанию", + "No Internet": "Нет Интернета", + "[Applet Mode]": "[Режим апплета]", + "Language": "Язык" +} diff --git a/assets/romfs/i18n/zh.json b/assets/romfs/i18n/zh.json new file mode 100644 index 0000000..b5fc8cd --- /dev/null +++ b/assets/romfs/i18n/zh.json @@ -0,0 +1,114 @@ +{ + "Launch": "发射", + "Options": "选项", + "Homebrew Options": "自制选项", + "Sort By": "排序方式", + "Sort Options": "排序选项", + "Updated": "已更新", + "Size": "尺寸", + "Alphabetical": "按字母顺序", + "Decending": "降序", + "Ascending": "升序", + "Sort": "种类", + "Order": "命令", + "Info": "信息", + "Delete": "删除", + "Hide Sphaira": "隐藏斯菲拉", + "Are you sure you want to delete ": "您确定要删除吗 ", + "Install Forwarder": "安装转发器", + "WARNING: Installing forwarders will lead to a ban!": "警告:安装转发器将导致禁止!", + "Back": "后退", + "Install": "安装", + "Fs": "FS", + "App": "应用程序", + "Menu": "菜单", + "Homebrew": "自制", + "FileBrowser": "文件浏览器", + "Open": "打开", + "Theme Options": "主题选项", + "Select Theme": "选择主题", + "Shuffle": "随机播放", + "Music": "音乐", + "Show Hidden": "显示隐藏", + "Folders First": "文件夹优先", + "Hidden Last": "隐藏最后", + "Yes": "是的", + "No": "不", + "Network Options": "网络选项", + "Nxlink": "恩克斯联", + "Check for update": "检查更新", + "File Options": "文件选项", + "Cut": "切", + "Copy": "复制", + "Rename": "重命名", + "Advanced Options": "创建文件", + "Create File": "创建文件", + "Create Folder": "创建文件夹", + "View as text": "以文本形式查看", + "View as text (unfinished)": "以文本形式查看(未完成)", + "Set Archive Bit": "设置存档位", + "AppStore Options": "应用商店选项", + "All": "全部", + "Games": "游戏", + "Emulators": "模拟器", + "Tools": "工具", + "Advanced": "先进的", + "Themes": "主题", + "Legacy": "遗产", + "Misc": "杂项", + "Downloads": "下载", + "Filter": "筛选", + "Search": "搜索", + "Menu Options": "菜单选项", + "Header": "标头", + "Theme": "主题", + "Network": "网络", + "Logging": "记录", + "Enabled": "启用", + "Disabled": "残疾人", + "Replace hbmenu on exit": "退出时替换 hbmenu", + "Misc Options": "其他选项", + "Themezer": "主题器", + "Irs": "国税局", + "Web": "网络", + "Download": "下载", + "Next Page": "下一页", + "Prev Page": "上一页", + "Pad ": "软垫 ", + " (Unconnected)": " (未连接)", + "HandHeld": "手持式", + " (Available)": " (可用的)", + "0 (Sideways)": "0(横向)", + "90 (Flat)": "90(平)", + "180 (-Sideways)": "180(-横向)", + "270 (Upside down)": "270(颠倒)", + "Grey": "灰色的", + "Ironbow": "铁弓", + "Green": "绿色的", + "Red": "红色的", + "Blue": "蓝色的", + "All leds": "所有 LED", + "Bright group": "光明集团", + "Dim group": "昏暗组", + "None": "没有任何", + "Normal image": "正常图像", + "Negative image": "负像", + "320x240": "320x240", + "160x120": "160x120", + "80x60": "80x60", + "40x30": "40x30", + "20x15": "20x15", + "Controller": "控制器", + "Rotation": "旋转", + "Colour": "颜色", + "Light Target": "光目标", + "Gain": "获得", + "Negative Image": "负面形象", + "Format": "格式", + "Trimming Format": "修剪格式", + "External Light Filter": "外部滤光片", + "Load Default": "加载默认值", + "No Internet": "没有互联网", + "[Applet Mode]": "[小程序模式]", + "Language": "语言" +} diff --git a/assets/romfs/theme/icon_audio.png b/assets/romfs/theme/icon_audio.png new file mode 100644 index 0000000..18546ca Binary files /dev/null and b/assets/romfs/theme/icon_audio.png differ diff --git a/assets/romfs/theme/icon_file.png b/assets/romfs/theme/icon_file.png new file mode 100644 index 0000000..497c48d Binary files /dev/null and b/assets/romfs/theme/icon_file.png differ diff --git a/assets/romfs/theme/icon_folder.png b/assets/romfs/theme/icon_folder.png new file mode 100644 index 0000000..a8f7203 Binary files /dev/null and b/assets/romfs/theme/icon_folder.png differ diff --git a/assets/romfs/theme/icon_image.png b/assets/romfs/theme/icon_image.png new file mode 100644 index 0000000..0bb3687 Binary files /dev/null and b/assets/romfs/theme/icon_image.png differ diff --git a/assets/romfs/theme/icon_nro.png b/assets/romfs/theme/icon_nro.png new file mode 100644 index 0000000..ee918d6 Binary files /dev/null and b/assets/romfs/theme/icon_nro.png differ diff --git a/assets/romfs/theme/icon_video.png b/assets/romfs/theme/icon_video.png new file mode 100644 index 0000000..b4e5bdb Binary files /dev/null and b/assets/romfs/theme/icon_video.png differ diff --git a/assets/romfs/theme/icon_zip.png b/assets/romfs/theme/icon_zip.png new file mode 100644 index 0000000..9694769 Binary files /dev/null and b/assets/romfs/theme/icon_zip.png differ diff --git a/assets/romfs/themes/abyss_theme.ini b/assets/romfs/themes/abyss_theme.ini new file mode 100644 index 0000000..34d19c4 --- /dev/null +++ b/assets/romfs/themes/abyss_theme.ini @@ -0,0 +1,22 @@ +[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 diff --git a/assets/romfs/themes/black_theme.ini b/assets/romfs/themes/black_theme.ini new file mode 100644 index 0000000..cabd402 --- /dev/null +++ b/assets/romfs/themes/black_theme.ini @@ -0,0 +1,23 @@ +[meta] +name=Black +author=TotalJustice +version=1.0.0 +preview=romfs:/theme/preview.jpg + +[theme] +background=0x2d2d2dff +cursor=romfs:/theme/cursor.png +cursor_drag=romfs:/theme/cursor_drag.png +grid=0x46464630 +selected=0x464646ff +selected_overlay=0x00ffc8ff +text=0xfbfbfbff +text_selected=0x00ffc8ff + +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 diff --git a/assets/romfs/themes/white_theme.ini b/assets/romfs/themes/white_theme.ini new file mode 100644 index 0000000..ff1fdf5 --- /dev/null +++ b/assets/romfs/themes/white_theme.ini @@ -0,0 +1,23 @@ +[meta] +name="White not finished" +author=TotalJustice +version=1.0.0 +preview=romfs:/theme/preview.jpg + +[theme] +background=0xEBEBEBff +cursor=romfs:/theme/cursor.png +cursor_drag=romfs:/theme/cursor_drag.png +grid=0x46464630 +selected=0x464646ff +selected_overlay=0x00ffc8ff +text=0x2D2D2Dff +text_selected=0x3A50F0ff + +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 diff --git a/assets/screenshots/2024121522502300-879193CD6A8B96CD00931A628B1187CB.jpg b/assets/screenshots/2024121522502300-879193CD6A8B96CD00931A628B1187CB.jpg new file mode 100644 index 0000000..19d15a9 Binary files /dev/null and b/assets/screenshots/2024121522502300-879193CD6A8B96CD00931A628B1187CB.jpg differ diff --git a/assets/screenshots/2024121522505300-879193CD6A8B96CD00931A628B1187CB.jpg b/assets/screenshots/2024121522505300-879193CD6A8B96CD00931A628B1187CB.jpg new file mode 100644 index 0000000..c7ccc7b Binary files /dev/null and b/assets/screenshots/2024121522505300-879193CD6A8B96CD00931A628B1187CB.jpg differ diff --git a/assets/screenshots/2024121522512100-879193CD6A8B96CD00931A628B1187CB.jpg b/assets/screenshots/2024121522512100-879193CD6A8B96CD00931A628B1187CB.jpg new file mode 100644 index 0000000..2a59ce7 Binary files /dev/null and b/assets/screenshots/2024121522512100-879193CD6A8B96CD00931A628B1187CB.jpg differ diff --git a/assets/screenshots/2024121522513300-879193CD6A8B96CD00931A628B1187CB.jpg b/assets/screenshots/2024121522513300-879193CD6A8B96CD00931A628B1187CB.jpg new file mode 100644 index 0000000..419d3c1 Binary files /dev/null and b/assets/screenshots/2024121522513300-879193CD6A8B96CD00931A628B1187CB.jpg differ diff --git a/assets/screenshots/2024121522514300-879193CD6A8B96CD00931A628B1187CB.jpg b/assets/screenshots/2024121522514300-879193CD6A8B96CD00931A628B1187CB.jpg new file mode 100644 index 0000000..99c8422 Binary files /dev/null and b/assets/screenshots/2024121522514300-879193CD6A8B96CD00931A628B1187CB.jpg differ diff --git a/assets/screenshots/2024121523033200-879193CD6A8B96CD00931A628B1187CB.jpg b/assets/screenshots/2024121523033200-879193CD6A8B96CD00931A628B1187CB.jpg new file mode 100644 index 0000000..98cadf3 Binary files /dev/null and b/assets/screenshots/2024121523033200-879193CD6A8B96CD00931A628B1187CB.jpg differ diff --git a/assets/screenshots/2024121523070300-879193CD6A8B96CD00931A628B1187CB.jpg b/assets/screenshots/2024121523070300-879193CD6A8B96CD00931A628B1187CB.jpg new file mode 100644 index 0000000..b35a9b6 Binary files /dev/null and b/assets/screenshots/2024121523070300-879193CD6A8B96CD00931A628B1187CB.jpg differ diff --git a/assets/screenshots/2024121523074900-879193CD6A8B96CD00931A628B1187CB.jpg b/assets/screenshots/2024121523074900-879193CD6A8B96CD00931A628B1187CB.jpg new file mode 100644 index 0000000..1e36b70 Binary files /dev/null and b/assets/screenshots/2024121523074900-879193CD6A8B96CD00931A628B1187CB.jpg differ diff --git a/assets/screenshots/2024121523084100-879193CD6A8B96CD00931A628B1187CB.jpg b/assets/screenshots/2024121523084100-879193CD6A8B96CD00931A628B1187CB.jpg new file mode 100644 index 0000000..81f1a7f Binary files /dev/null and b/assets/screenshots/2024121523084100-879193CD6A8B96CD00931A628B1187CB.jpg differ diff --git a/build_release.sh b/build_release.sh new file mode 100644 index 0000000..301c035 --- /dev/null +++ b/build_release.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +# builds a preset +build_preset() { + echo Configuring $1 ... + cmake --preset $1 + echo Building $1 ... + cmake --build --preset $1 +} + +build_preset MinSizeRel + +rm -rf out + +# --- SWITCH --- # +mkdir -p out/switch/sphaira/ +cp -r build/MinSizeRel/*.nro out/switch/sphaira/sphaira.nro +cd out +zip -r9 sphaira.zip switch +cd ../.. diff --git a/hbl/CMakeLists.txt b/hbl/CMakeLists.txt new file mode 100644 index 0000000..1147739 --- /dev/null +++ b/hbl/CMakeLists.txt @@ -0,0 +1,88 @@ +project(hbl + VERSION 3.0.0 + LANGUAGES ASM C +) + +add_executable(hbl + source/main.c + source/trampoline.s +) + +set_target_properties(hbl PROPERTIES + C_STANDARD 11 + C_EXTENSIONS ON +) + +target_link_options(hbl PRIVATE + -Wl,-wrap,exit +) + +target_compile_definitions(hbl PRIVATE + VERSION="${CMAKE_PROJECT_VERSION}" +) + +find_program(NX_ELF2NSO_EXE NAMES elf2nso HINTS "${DEVKITPRO}/tools/bin" REQUIRED) +find_program(NX_NPDMTOOL_EXE NAMES npdmtool HINTS "${DEVKITPRO}/tools/bin" REQUIRED) + +function(nx_create_nso target) + cmake_parse_arguments(PARSE_ARGV 1 NX_NSO "" "OUTPUT" "") + + set(intarget "${target}") + set(outtarget "${target}_nso") + + if (DEFINED NX_NSO_OUTPUT) + get_filename_component(NX_NSO_OUTPUT "${NX_NSO_OUTPUT}" ABSOLUTE BASE_DIR "${CMAKE_CURRENT_BINARY_DIR}") + else() + set(NX_NSO_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${target}.nso") + endif() + + add_custom_command( + OUTPUT "${NX_NSO_OUTPUT}" + COMMAND ${NX_ELF2NSO_EXE} "$" "${NX_NSO_OUTPUT}" + DEPENDS ${intarget} + COMMENT "Converting ${intarget} to NSO format" + VERBATIM + ) + + add_custom_target(${outtarget} ALL DEPENDS "${NX_NSO_OUTPUT}") + dkp_set_target_file(${outtarget} "${NX_NSO_OUTPUT}") +endfunction() + +function(nx_create_npdm target config) + cmake_parse_arguments(PARSE_ARGV 1 NX_NPDM "" "OUTPUT;CONFIG" "") + + set(intarget "${target}") + set(outtarget "${target}_npdm") + + if (DEFINED NX_NPDM_CONFIG) + get_filename_component(NX_NPDM_CONFIG "${NX_NPDM_CONFIG}" ABSOLUTE) + else() + message(FATAL_ERROR "nx_create_exefs: must provide a CONFIG file in json format") + endif() + + if (DEFINED NX_NPDM_OUTPUT) + get_filename_component(NX_NPDM_OUTPUT "${NX_NPDM_OUTPUT}" ABSOLUTE BASE_DIR "${CMAKE_CURRENT_BINARY_DIR}") + else() + set(NX_NPDM_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${target}.npdm") + endif() + + add_custom_command( + OUTPUT "${NX_NPDM_OUTPUT}" + COMMAND ${NX_NPDMTOOL_EXE} "${NX_NPDM_CONFIG}" "${NX_NPDM_OUTPUT}" + DEPENDS "${NX_NPDM_CONFIG}" + COMMENT "Generating NPDM for ${outtarget}" + VERBATIM + ) + + add_custom_target(${outtarget} ALL DEPENDS "${NX_NPDM_OUTPUT}") + dkp_set_target_file(${outtarget} "${NX_NPDM_OUTPUT}") +endfunction() + +nx_create_nso(hbl + OUTPUT main +) + +nx_create_npdm(hbl + OUTPUT main.npdm + CONFIG ${CMAKE_CURRENT_SOURCE_DIR}/hbl.json +) diff --git a/hbl/hbl.json b/hbl/hbl.json new file mode 100644 index 0000000..dff1f47 --- /dev/null +++ b/hbl/hbl.json @@ -0,0 +1,263 @@ +{ + "name": "Application", + "title_id": "0x0000000000000000", + "title_id_range_min": "0x0000000000000000", + "title_id_range_max": "0x0000000000000000", + "main_thread_stack_size": "0x100000", + "main_thread_priority": 44, + "default_cpu_id": 0, + "process_category": 0, + "pool_partition": 0, + "is_64_bit": true, + "address_space_type": 1, + "is_retail": true, + "filesystem_access": { + "permissions": "0xFFFFFFFFFFFFFFFF", + "content_owner_ids": [ + "0x0100000000001000" + ] + }, + "service_host": [ + "*" + ], + "service_access": [ + "*" + ], + "kernel_capabilities": [ + { + "type": "kernel_flags", + "value": { + "highest_thread_priority": 59, + "lowest_thread_priority": 28, + "highest_cpu_id": 3, + "lowest_cpu_id": 0 + } + }, + { + "type": "syscalls", + "value": { + "svcUnassigned00": "0x00", + "svcSetHeapSize": "0x01", + "svcSetMemoryPermission": "0x02", + "svcSetMemoryAttribute": "0x03", + "svcMapMemory": "0x04", + "svcUnmapMemory": "0x05", + "svcQueryMemory": "0x06", + "svcExitProcess": "0x07", + "svcCreateThread": "0x08", + "svcStartThread": "0x09", + "svcExitThread": "0x0A", + "svcSleepThread": "0x0B", + "svcGetThreadPriority": "0x0C", + "svcSetThreadPriority": "0x0D", + "svcGetThreadCoreMask": "0x0E", + "svcSetThreadCoreMask": "0x0F", + "svcGetCurrentProcessorNumber": "0x10", + "svcSignalEvent": "0x11", + "svcClearEvent": "0x12", + "svcMapSharedMemory": "0x13", + "svcUnmapSharedMemory": "0x14", + "svcCreateTransferMemory": "0x15", + "svcCloseHandle": "0x16", + "svcResetSignal": "0x17", + "svcWaitSynchronization": "0x18", + "svcCancelSynchronization": "0x19", + "svcArbitrateLock": "0x1A", + "svcArbitrateUnlock": "0x1B", + "svcWaitProcessWideKeyAtomic": "0x1C", + "svcSignalProcessWideKey": "0x1D", + "svcGetSystemTick": "0x1E", + "svcConnectToNamedPort": "0x1F", + "svcSendSyncRequestLight": "0x20", + "svcSendSyncRequest": "0x21", + "svcSendSyncRequestWithUserBuffer": "0x22", + "svcSendAsyncRequestWithUserBuffer": "0x23", + "svcGetProcessId": "0x24", + "svcGetThreadId": "0x25", + "svcBreak": "0x26", + "svcOutputDebugString": "0x27", + "svcReturnFromException": "0x28", + "svcGetInfo": "0x29", + "svcFlushEntireDataCache": "0x2A", + "svcFlushDataCache": "0x2B", + "svcMapPhysicalMemory": "0x2C", + "svcUnmapPhysicalMemory": "0x2D", + "svcGetDebugFutureThreadInfo": "0x2E", + "svcGetLastThreadInfo": "0x2F", + "svcGetResourceLimitLimitValue": "0x30", + "svcGetResourceLimitCurrentValue": "0x31", + "svcSetThreadActivity": "0x32", + "svcGetThreadContext3": "0x33", + "svcWaitForAddress": "0x34", + "svcSignalToAddress": "0x35", + "svcSynchronizePreemptionState": "0x36", + "svcGetResourceLimitPeakValue": "0x37", + "svcUnassigned38": "0x38", + "svcCreateIoPool": "0x39", + "svcCreateIoRegion": "0x3A", + "svcUnassigned3B": "0x3B", + "svcKernelDebug": "0x3C", + "svcChangeKernelTraceState": "0x3D", + "svcUnassigned3E": "0x3E", + "svcUnassigned3F": "0x3F", + "svcCreateSession": "0x40", + "svcAcceptSession": "0x41", + "svcReplyAndReceiveLight": "0x42", + "svcReplyAndReceive": "0x43", + "svcReplyAndReceiveWithUserBuffer": "0x44", + "svcCreateEvent": "0x45", + "svcMapIoRegion": "0x46", + "svcUnmapIoRegion": "0x47", + "svcMapPhysicalMemoryUnsafe": "0x48", + "svcUnmapPhysicalMemoryUnsafe": "0x49", + "svcSetUnsafeLimit": "0x4A", + "svcCreateCodeMemory": "0x4B", + "svcControlCodeMemory": "0x4C", + "svcSleepSystem": "0x4D", + "svcReadWriteRegister": "0x4E", + "svcSetProcessActivity": "0x4F", + "svcCreateSharedMemory": "0x50", + "svcMapTransferMemory": "0x51", + "svcUnmapTransferMemory": "0x52", + "svcCreateInterruptEvent": "0x53", + "svcQueryPhysicalAddress": "0x54", + "svcQueryIoMapping": "0x55", + "svcCreateDeviceAddressSpace": "0x56", + "svcAttachDeviceAddressSpace": "0x57", + "svcDetachDeviceAddressSpace": "0x58", + "svcMapDeviceAddressSpaceByForce": "0x59", + "svcMapDeviceAddressSpaceAligned": "0x5A", + "svcMapDeviceAddressSpace": "0x5B", + "svcUnmapDeviceAddressSpace": "0x5C", + "svcInvalidateProcessDataCache": "0x5D", + "svcStoreProcessDataCache": "0x5E", + "svcFlushProcessDataCache": "0x5F", + "svcDebugActiveProcess": "0x60", + "svcBreakDebugProcess": "0x61", + "svcTerminateDebugProcess": "0x62", + "svcGetDebugEvent": "0x63", + "svcContinueDebugEvent": "0x64", + "svcGetProcessList": "0x65", + "svcGetThreadList": "0x66", + "svcGetDebugThreadContext": "0x67", + "svcSetDebugThreadContext": "0x68", + "svcQueryDebugProcessMemory": "0x69", + "svcReadDebugProcessMemory": "0x6A", + "svcWriteDebugProcessMemory": "0x6B", + "svcSetHardwareBreakPoint": "0x6C", + "svcGetDebugThreadParam": "0x6D", + "svcUnassigned6E": "0x6E", + "svcGetSystemInfo": "0x6F", + "svcCreatePort": "0x70", + "svcManageNamedPort": "0x71", + "svcConnectToPort": "0x72", + "svcSetProcessMemoryPermission": "0x73", + "svcMapProcessMemory": "0x74", + "svcUnmapProcessMemory": "0x75", + "svcQueryProcessMemory": "0x76", + "svcMapProcessCodeMemory": "0x77", + "svcUnmapProcessCodeMemory": "0x78", + "svcCreateProcess": "0x79", + "svcStartProcess": "0x7A", + "svcTerminateProcess": "0x7B", + "svcGetProcessInfo": "0x7C", + "svcCreateResourceLimit": "0x7D", + "svcSetResourceLimitLimitValue": "0x7E", + "svcCallSecureMonitor": "0x7F", + "svcUnassigned80": "0x80", + "svcUnassigned81": "0x81", + "svcUnassigned82": "0x82", + "svcUnassigned83": "0x83", + "svcUnassigned84": "0x84", + "svcUnassigned85": "0x85", + "svcUnassigned86": "0x86", + "svcUnassigned87": "0x87", + "svcUnassigned88": "0x88", + "svcUnassigned89": "0x89", + "svcUnassigned8A": "0x8A", + "svcUnassigned8B": "0x8B", + "svcUnassigned8C": "0x8C", + "svcUnassigned8D": "0x8D", + "svcUnassigned8E": "0x8E", + "svcUnassigned8F": "0x8F", + "svcMapInsecureMemory": "0x90", + "svcUnmapInsecureMemory": "0x91", + "svcUnassigned92": "0x92", + "svcUnassigned93": "0x93", + "svcUnassigned94": "0x94", + "svcUnassigned95": "0x95", + "svcUnassigned96": "0x96", + "svcUnassigned97": "0x97", + "svcUnassigned98": "0x98", + "svcUnassigned99": "0x99", + "svcUnassigned9A": "0x9A", + "svcUnassigned9B": "0x9B", + "svcUnassigned9C": "0x9C", + "svcUnassigned9D": "0x9D", + "svcUnassigned9E": "0x9E", + "svcUnassigned9F": "0x9F", + "svcUnassignedA0": "0xA0", + "svcUnassignedA1": "0xA1", + "svcUnassignedA2": "0xA2", + "svcUnassignedA3": "0xA3", + "svcUnassignedA4": "0xA4", + "svcUnassignedA5": "0xA5", + "svcUnassignedA6": "0xA6", + "svcUnassignedA7": "0xA7", + "svcUnassignedA8": "0xA8", + "svcUnassignedA9": "0xA9", + "svcUnassignedAA": "0xAA", + "svcUnassignedAB": "0xAB", + "svcUnassignedAC": "0xAC", + "svcUnassignedAD": "0xAD", + "svcUnassignedAE": "0xAE", + "svcUnassignedAF": "0xAF", + "svcUnassignedB0": "0xB0", + "svcUnassignedB1": "0xB1", + "svcUnassignedB2": "0xB2", + "svcUnassignedB3": "0xB3", + "svcUnassignedB4": "0xB4", + "svcUnassignedB5": "0xB5", + "svcUnassignedB6": "0xB6", + "svcUnassignedB7": "0xB7", + "svcUnassignedB8": "0xB8", + "svcUnassignedB9": "0xB9", + "svcUnassignedBA": "0xBA", + "svcUnassignedBB": "0xBB", + "svcUnassignedBC": "0xBC", + "svcUnassignedBD": "0xBD", + "svcUnassignedBE": "0xBE", + "svcUnassignedBF": "0xBF" + } + }, + { + "type": "application_type", + "value": 1 + }, + { + "type": "min_kernel_version", + "value": "0x30" + }, + { + "type": "handle_table_size", + "value": 512 + }, + { + "type": "debug_flags", + "value": { + "allow_debug": false, + "force_debug_prod": true, + "force_debug": false + } + }, + { + "type": "map_region", + "value": [ + { + "region_type": 1, + "is_ro": true + } + ] + } + ] +} diff --git a/hbl/nx-hbloader.LICENSE.md b/hbl/nx-hbloader.LICENSE.md new file mode 100644 index 0000000..a25f02b --- /dev/null +++ b/hbl/nx-hbloader.LICENSE.md @@ -0,0 +1,5 @@ +Copyright 2017-2018 nx-hbloader Authors + +Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. \ No newline at end of file diff --git a/hbl/source/main.c b/hbl/source/main.c new file mode 100644 index 0000000..ec4a140 --- /dev/null +++ b/hbl/source/main.c @@ -0,0 +1,563 @@ +#include +#include +#include + +#define EXIT_DETECTION_STR "if this isn't replaced i will exit :)" + +// this uses 3-4KiB more than nx-hbloader. +static char g_argv[2048] = {0}; +// this can and will be modified by libnx if launched nro calls envSetNextLoad(). +static char g_nextArgv[2048] = {0}; +static char g_nextNroPath[FS_MAX_PATH] = {0}; +// stores first launched nro argv + path. +static char g_defaultArgv[2048] = {0}; +static char g_defaultNroPath[FS_MAX_PATH] = {0}; + +static const char g_noticeText[] = { "sphaira " VERSION }; + +static u64 g_nroSize = 0; +static NroHeader g_nroHeader = {0}; + +static enum { + CodeMemoryUnavailable = 0, + CodeMemoryForeignProcess = BIT(0), + CodeMemorySameProcess = BIT(0) | BIT(1), +} g_codeMemoryCapability = CodeMemoryUnavailable; + +static void* g_heapAddr = {0}; +static size_t g_heapSize = {0}; + +static Handle g_procHandle = {0}; +static u128 g_userIdStorage = {0}; +static u8 g_savedTls[0x100] = {0}; + +// Used by trampoline.s +u64 g_nroAddr = 0; +Result g_lastRet = 0; + +void NX_NORETURN nroEntrypointTrampoline(const ConfigEntry* entries, u64 handle, u64 entrypoint); + +static void fix_nro_path(char* path) { + // hbmenu prefixes paths with sdmc: which fsFsOpenFile won't like + if (!strncmp(path, "sdmc:/", 6)) { + // memmove(path, path + 5, strlen(path)-5); + memmove(path, path + 5, FS_MAX_PATH-5); + } +} + +// Credit to behemoth +// SOURCE: https://github.com/HookedBehemoth/nx-hbloader/commit/7f8000a41bc5e8a6ad96a097ef56634cfd2fabcb +static NX_NORETURN void selfExit(void) { + Result rc = smInitialize(); + if (R_FAILED(rc)) + goto fail0; + + Service applet, proxy, self; + + rc = smGetService(&applet, "appletOE"); + if (R_FAILED(rc)) + goto fail1; + + const u32 cmd_id = 0; + const u64 reserved = 0; + + // GetSessionProxy + rc = serviceDispatchIn(&applet, cmd_id, reserved, + .in_send_pid = true, + .in_num_handles = 1, + .in_handles = { g_procHandle }, + .out_num_objects = 1, + .out_objects = &proxy, + ); + if (R_FAILED(rc)) + goto fail2; + + // GetSelfController + rc = serviceDispatch(&proxy, 1, + .out_num_objects = 1, + .out_objects = &self, + ); + if (R_FAILED(rc)) + goto fail3; + + // Exit + rc = serviceDispatch(&self, 0); + + serviceClose(&self); + +fail3: + serviceClose(&proxy); + +fail2: + serviceClose(&applet); + +fail1: + smExit(); + +fail0: + if (R_SUCCEEDED(rc)) { + while(1) svcSleepThread(86400000000000ULL); + svcExitProcess(); + __builtin_unreachable(); + } else { + diagAbortWithResult(rc); + } +} + +static u64 calculateMaxHeapSize(void) { + u64 size = 0; + u64 mem_available = 0, mem_used = 0; + + svcGetInfo(&mem_available, InfoType_TotalMemorySize, CUR_PROCESS_HANDLE, 0); + svcGetInfo(&mem_used, InfoType_UsedMemorySize, CUR_PROCESS_HANDLE, 0); + + if (mem_available > mem_used+0x200000) + size = (mem_available - mem_used - 0x200000) & ~0x1FFFFF; + if (size == 0) + size = 0x2000000*16; + if (size > 0x6000000) + size -= 0x6000000; + + return size; +} + +static void setupHbHeap(void) { + void* addr = NULL; + u64 size = calculateMaxHeapSize(); + Result rc = svcSetHeapSize(&addr, size); + + if (R_FAILED(rc) || addr==NULL) + diagAbortWithResult(MAKERESULT(Module_HomebrewLoader, 9)); + + g_heapAddr = addr; + g_heapSize = size; +} + +static void procHandleReceiveThread(void* arg) { + Handle session = (Handle)(uintptr_t)arg; + Result rc; + + void* base = armGetTls(); + hipcMakeRequestInline(base); + + s32 idx = 0; + rc = svcReplyAndReceive(&idx, &session, 1, INVALID_HANDLE, UINT64_MAX); + if (R_FAILED(rc)) + diagAbortWithResult(MAKERESULT(Module_HomebrewLoader, 15)); + + HipcParsedRequest r = hipcParseRequest(base); + if (r.meta.num_copy_handles != 1) + diagAbortWithResult(MAKERESULT(Module_HomebrewLoader, 17)); + + g_procHandle = r.data.copy_handles[0]; + svcCloseHandle(session); +} + +static void getOwnProcessHandle(void) { + Result rc; + + Handle server_handle, client_handle; + rc = svcCreateSession(&server_handle, &client_handle, 0, 0); + if (R_FAILED(rc)) + diagAbortWithResult(MAKERESULT(Module_HomebrewLoader, 12)); + + Thread t; + rc = threadCreate(&t, &procHandleReceiveThread, (void*)(uintptr_t)server_handle, NULL, 0x1000, 0x20, 0); + if (R_FAILED(rc)) + diagAbortWithResult(MAKERESULT(Module_HomebrewLoader, 10)); + + rc = threadStart(&t); + if (R_FAILED(rc)) + diagAbortWithResult(MAKERESULT(Module_HomebrewLoader, 13)); + + hipcMakeRequestInline(armGetTls(), + .num_copy_handles = 1, + ).copy_handles[0] = CUR_PROCESS_HANDLE; + + svcSendSyncRequest(client_handle); + svcCloseHandle(client_handle); + + threadWaitForExit(&t); + threadClose(&t); +} + +static bool isKernel5xOrLater(void) { + u64 dummy = 0; + Result rc = svcGetInfo(&dummy, InfoType_UserExceptionContextAddress, INVALID_HANDLE, 0); + return R_VALUE(rc) != KERNELRESULT(InvalidEnumValue); +} + +static bool isKernel4x(void) { + u64 dummy = 0; + Result rc = svcGetInfo(&dummy, InfoType_InitialProcessIdRange, INVALID_HANDLE, 0); + return R_VALUE(rc) != KERNELRESULT(InvalidEnumValue); +} + +static void getCodeMemoryCapability(void) { + if (detectMesosphere()) { + // Mesosphère allows for same-process code memory usage. + g_codeMemoryCapability = CodeMemorySameProcess; + } else if (isKernel5xOrLater()) { + // On [5.0.0+], the kernel does not allow the creator process of a CodeMemory object + // to use svcControlCodeMemory on itself, thus returning InvalidMemoryState (0xD401). + // However the kernel can be patched to support same-process usage of CodeMemory. + // We can detect that by passing a bad operation and observe if we actually get InvalidEnumValue (0xF001). + Handle code; + Result rc = svcCreateCodeMemory(&code, g_heapAddr, 0x1000); + if (R_SUCCEEDED(rc)) { + rc = svcControlCodeMemory(code, (CodeMapOperation)-1, 0, 0x1000, 0); + svcCloseHandle(code); + + if (R_VALUE(rc) == KERNELRESULT(InvalidEnumValue)) + g_codeMemoryCapability = CodeMemorySameProcess; + else + g_codeMemoryCapability = CodeMemoryForeignProcess; + } + } else if (isKernel4x()) { + // On [4.0.0-4.1.0] there is no such restriction on same-process CodeMemory usage. + g_codeMemoryCapability = CodeMemorySameProcess; + } else { + // This kernel is too old to support CodeMemory syscalls. + g_codeMemoryCapability = CodeMemoryUnavailable; + } +} + +void NX_NORETURN loadNro(void) { + NroHeader* header = NULL; + size_t rw_size = 0; + Result rc = 0; + + memcpy((u8*)armGetTls() + 0x100, g_savedTls, 0x100); + + // check's if the homebrew replaced nro_path. + // if so, load new nro, otherwise, exit. + if (!strcmp(g_nextArgv, EXIT_DETECTION_STR)) { + if (!strcmp(g_nextNroPath, g_defaultNroPath)) { + selfExit(); + } else { + // exited nro, now returning to default nro + strcpy(g_nextNroPath, g_defaultNroPath); + strcpy(g_nextArgv, g_defaultArgv); + } + } + + if (g_nroSize) { + // checks if nro was previously mapped, if so, unmap + header = &g_nroHeader; + rw_size = header->segments[2].size + header->bss_size; + rw_size = (rw_size+0xFFF) & ~0xFFF; + + if (R_FAILED(rc = svcBreak(BreakReason_NotificationOnlyFlag | BreakReason_PreUnloadDll, g_nroAddr, g_nroSize))) { + diagAbortWithResult(rc); + } + + // .text + rc = svcUnmapProcessCodeMemory( + g_procHandle, g_nroAddr + header->segments[0].file_off, ((u64) g_heapAddr) + header->segments[0].file_off, header->segments[0].size); + + if (R_FAILED(rc)) + diagAbortWithResult(MAKERESULT(Module_HomebrewLoader, 24)); + + // .rodata + rc = svcUnmapProcessCodeMemory( + g_procHandle, g_nroAddr + header->segments[1].file_off, ((u64) g_heapAddr) + header->segments[1].file_off, header->segments[1].size); + + if (R_FAILED(rc)) + diagAbortWithResult(MAKERESULT(Module_HomebrewLoader, 25)); + + // .data + .bss + rc = svcUnmapProcessCodeMemory( + g_procHandle, g_nroAddr + header->segments[2].file_off, ((u64) g_heapAddr) + header->segments[2].file_off, rw_size); + + if (R_FAILED(rc)) + diagAbortWithResult(MAKERESULT(Module_HomebrewLoader, 26)); + + if (R_FAILED(rc = svcBreak(BreakReason_NotificationOnlyFlag | BreakReason_PostUnloadDll, g_nroAddr, g_nroSize))) { + diagAbortWithResult(rc); + } + + g_nroAddr = g_nroSize = 0; + } else { + // otherwise, this is the first time launching, read path / argv from romfs + FsStorage s; + romfs_header romfs_header; + + if (R_FAILED(rc = fsOpenDataStorageByCurrentProcess(&s))) { + diagAbortWithResult(rc); + } + + if (R_FAILED(rc = fsStorageRead(&s, 0, &romfs_header, sizeof(romfs_header)))) { + diagAbortWithResult(rc); + } + + u8* romfs_dirs = malloc(romfs_header.dirTableSize); // should be 1 entry ("/") + u8* romfs_files = malloc(romfs_header.fileTableSize); // should be 2 entries (argv and nro) + + if (!romfs_dirs || !romfs_files) { + diagAbortWithResult(MAKERESULT(Module_HomebrewLoader, LibnxError_OutOfMemory)); + } + + if (R_FAILED(rc = fsStorageRead(&s, romfs_header.dirTableOff, romfs_dirs, romfs_header.dirTableSize))) { + diagAbortWithResult(rc); + } + + if (R_FAILED(rc = fsStorageRead(&s, romfs_header.fileTableOff, romfs_files, romfs_header.fileTableSize))) { + diagAbortWithResult(rc); + } + + const romfs_dir* dir = (const romfs_dir*)romfs_dirs; + const romfs_file* next_argv_file = (const romfs_file*)(romfs_files + dir->childFile); + const romfs_file* next_nro_file = (const romfs_file*)(romfs_files + next_argv_file->sibling); + + if (R_FAILED(rc = fsStorageRead(&s, romfs_header.fileDataOff + next_argv_file->dataOff, g_nextArgv, next_argv_file->dataSize))) { + diagAbortWithResult(rc); + } + + if (R_FAILED(rc = fsStorageRead(&s, romfs_header.fileDataOff + next_nro_file->dataOff, g_nextNroPath, next_nro_file->dataSize))) { + diagAbortWithResult(rc); + } + + free(romfs_dirs); + free(romfs_files); + fsStorageClose(&s); + + strcpy(g_defaultNroPath, g_nextNroPath); + strcpy(g_defaultArgv, g_nextArgv); + } + + { + // fix paths + char fixedNextNroPath[FS_MAX_PATH]; + strcpy(fixedNextNroPath, g_nextNroPath); + fix_nro_path(fixedNextNroPath); + + memcpy(g_argv, g_nextArgv, sizeof(g_argv)); + if (R_FAILED(rc = svcBreak(BreakReason_NotificationOnlyFlag | BreakReason_PreLoadDll, (uintptr_t)g_argv, sizeof(g_argv)))) { + diagAbortWithResult(rc); + } + + uint8_t *nrobuf = (uint8_t*) g_heapAddr; + + NroStart* start = (NroStart*) (nrobuf + 0); + header = (NroHeader*) (nrobuf + sizeof(NroStart)); + uint8_t* rest = (uint8_t*) (nrobuf + sizeof(NroStart) + sizeof(NroHeader)); + + FsFileSystem fs; + FsFile f; + u64 bytes_read = 0; + s64 offset = 0; + + if (R_FAILED(rc = fsOpenSdCardFileSystem(&fs))) { + diagAbortWithResult(rc); + } + + // don't fatal if we don't find the nro, exit to menu + if (R_FAILED(rc = fsFsOpenFile(&fs, fixedNextNroPath, FsOpenMode_Read, &f))) { + diagAbortWithResult(rc); + } + + if (R_FAILED(rc = fsFileRead(&f, offset, start, sizeof(*start), FsReadOption_None, &bytes_read)) || + bytes_read != sizeof(*start)) { + diagAbortWithResult(rc); + } + offset += sizeof(*start); + + if (R_FAILED(rc = fsFileRead(&f, offset, header, sizeof(*header), FsReadOption_None, &bytes_read)) || + bytes_read != sizeof(*header) || header->magic != NROHEADER_MAGIC) { + diagAbortWithResult(rc); + } + offset += sizeof(*header); + + const size_t rest_size = header->size - (sizeof(NroStart) + sizeof(NroHeader)); + if (R_FAILED(rc = fsFileRead(&f, offset, rest, rest_size, FsReadOption_None, &bytes_read)) || + bytes_read != rest_size) { + diagAbortWithResult(rc); + } + + fsFileClose(&f); + fsFsClose(&fs); + } + + rw_size = header->segments[2].size + header->bss_size; + rw_size = (rw_size+0xFFF) & ~0xFFF; + + for (int i = 0; i < 3; i++) { + if (header->segments[i].file_off >= header->size || header->segments[i].size > header->size || + (header->segments[i].file_off + header->segments[i].size) > header->size) + { + diagAbortWithResult(MAKERESULT(Module_HomebrewLoader, 6)); + } + } + + // todo: Detect whether NRO fits into heap or not. + + // Copy header to elsewhere because we're going to unmap it next. + memcpy(&g_nroHeader, header, sizeof(g_nroHeader)); + header = &g_nroHeader; + + // Map code memory to a new randomized address + virtmemLock(); + const size_t total_size = (header->size + header->bss_size + 0xFFF) & ~0xFFF; + void* map_addr = virtmemFindCodeMemory(total_size, 0); + rc = svcMapProcessCodeMemory(g_procHandle, (u64)map_addr, (u64)g_heapAddr, total_size); + virtmemUnlock(); + + if (R_FAILED(rc)) + diagAbortWithResult(MAKERESULT(Module_HomebrewLoader, 18)); + + // .text + rc = svcSetProcessMemoryPermission( + g_procHandle, (u64)map_addr + header->segments[0].file_off, header->segments[0].size, Perm_R | Perm_X); + + if (R_FAILED(rc)) + diagAbortWithResult(rc); + + // .rodata + rc = svcSetProcessMemoryPermission( + g_procHandle, (u64)map_addr + header->segments[1].file_off, header->segments[1].size, Perm_R); + + if (R_FAILED(rc)) + diagAbortWithResult(rc); + + // .data + .bss + rc = svcSetProcessMemoryPermission( + g_procHandle, (u64)map_addr + header->segments[2].file_off, rw_size, Perm_Rw); + + if (R_FAILED(rc)) + diagAbortWithResult(rc); + + const u64 nro_size = header->segments[2].file_off + rw_size; + const u64 nro_heap_start = ((u64) g_heapAddr) + nro_size; + const u64 nro_heap_size = g_heapSize + (u64) g_heapAddr - (u64) nro_heap_start; + + #define M EntryFlag_IsMandatory + + static ConfigEntry entries[] = { + { EntryType_MainThreadHandle, 0, {0, 0} }, + { EntryType_ProcessHandle, 0, {0, 0} }, + { EntryType_AppletType, 0, {AppletType_SystemApplication, EnvAppletFlags_ApplicationOverride} }, + { EntryType_OverrideHeap, M, {0, 0} }, + { EntryType_Argv, 0, {0, 0} }, + { EntryType_NextLoadPath, 0, {0, 0} }, + { EntryType_LastLoadResult, 0, {0, 0} }, + { EntryType_SyscallAvailableHint, 0, {UINT64_MAX, UINT64_MAX} }, + { EntryType_SyscallAvailableHint2, 0, {UINT64_MAX, 0} }, + { EntryType_RandomSeed, 0, {0, 0} }, + { EntryType_UserIdStorage, 0, {(u64)(uintptr_t)&g_userIdStorage, 0} }, + { EntryType_HosVersion, 0, {0, 0} }, + { EntryType_EndOfList, 0, {(u64)(uintptr_t)g_noticeText, sizeof(g_noticeText)} } + }; + + ConfigEntry *entry_Syscalls = &entries[7]; + + if (!(g_codeMemoryCapability & BIT(0))) { + // Revoke access to svcCreateCodeMemory if it's not available. + entry_Syscalls->Value[0x4B/64] &= ~(1UL << (0x4B%64)); + } + + if (!(g_codeMemoryCapability & BIT(1))) { + // Revoke access to svcControlCodeMemory if it's not available for same-process usage. + entry_Syscalls->Value[0x4C/64] &= ~(1UL << (0x4C%64)); // svcControlCodeMemory + } + + // MainThreadHandle + entries[0].Value[0] = envGetMainThreadHandle(); + // ProcessHandle + entries[1].Value[0] = g_procHandle; + // OverrideHeap + entries[3].Value[0] = nro_heap_start; + entries[3].Value[1] = nro_heap_size; + // Argv + entries[4].Value[1] = (u64)(uintptr_t)&g_argv[0]; + // NextLoadPath + entries[5].Value[0] = (u64)(uintptr_t)&g_nextNroPath[0]; + entries[5].Value[1] = (u64)(uintptr_t)&g_nextArgv[0]; + // LastLoadResult + entries[6].Value[0] = g_lastRet; + // RandomSeed + entries[9].Value[0] = randomGet64(); + entries[9].Value[1] = randomGet64(); + // HosVersion + entries[11].Value[0] = hosversionGet(); + entries[11].Value[1] = hosversionIsAtmosphere() ? 0x41544d4f53504852UL : 0; // 'ATMOSPHR' + + g_nroAddr = (u64)map_addr; + g_nroSize = nro_size; + + svcBreak(BreakReason_NotificationOnlyFlag | BreakReason_PostLoadDll, g_nroAddr, nro_size); + + // write exit detection + strcpy(g_nextArgv, EXIT_DETECTION_STR); + // jump to trampoline.s + nroEntrypointTrampoline(&entries[0], -1, g_nroAddr); +} + +int main(int argc, char **argv) { + memcpy(g_savedTls, (const u8*)armGetTls() + 0x100, 0x100); + setupHbHeap(); + getOwnProcessHandle(); + getCodeMemoryCapability(); + loadNro(); +} + +// libnx stuff +u32 __nx_applet_type = AppletType_Application; +// Minimize fs resource usage +u32 __nx_fs_num_sessions = 1; +// these aren't needed, keeping them as someone will eventually +// copy this code, use fsdev, and not add back these vars. +u32 __nx_fsdev_direntry_cache_size = 1; +bool __nx_fsdev_support_cwd = false; +// enable to always exit to homemenu, dbi does this. +// u32 __nx_applet_exit_mode = 1; +// u32 __nx_applet_exit_mode = 0; + +void __libnx_initheap(void) { + static char g_innerheap[0x4000]; + + extern char* fake_heap_start; + extern char* fake_heap_end; + + fake_heap_start = &g_innerheap[0]; + fake_heap_end = &g_innerheap[sizeof(g_innerheap)]; +} + +void __appInit(void) { + Result rc; + + // Detect Atmosphère early on. This is required for hosversion logic. + // In the future, this check will be replaced by detectMesosphere(). + Handle dummy; + rc = svcConnectToNamedPort(&dummy, "ams"); + u32 ams_flag = (R_VALUE(rc) != KERNELRESULT(NotFound)) ? BIT(31) : 0; + if (R_SUCCEEDED(rc)) + svcCloseHandle(dummy); + + rc = smInitialize(); + if (R_FAILED(rc)) + diagAbortWithResult(MAKERESULT(Module_HomebrewLoader, LibnxError_InitFail_SM)); + + rc = setsysInitialize(); + if (R_SUCCEEDED(rc)) { + SetSysFirmwareVersion fw; + rc = setsysGetFirmwareVersion(&fw); + if (R_SUCCEEDED(rc)) + hosversionSet(ams_flag | MAKEHOSVERSION(fw.major, fw.minor, fw.micro)); + setsysExit(); + } + + rc = fsInitialize(); + if (R_FAILED(rc)) + diagAbortWithResult(MAKERESULT(Module_HomebrewLoader, LibnxError_InitFail_FS)); + + smExit(); // Close SM as we don't need it anymore. +} + +void __appExit(void) { + +} + +void __wrap_exit(void) { + // exit() effectively never gets called, so let's stub it out. + diagAbortWithResult(MAKERESULT(Module_HomebrewLoader, 39)); +} diff --git a/hbl/source/trampoline.s b/hbl/source/trampoline.s new file mode 100644 index 0000000..a1cb00c --- /dev/null +++ b/hbl/source/trampoline.s @@ -0,0 +1,47 @@ +.section .text.nroEntrypointTrampoline, "ax", %progbits +.align 2 +.global nroEntrypointTrampoline +.type nroEntrypointTrampoline, %function +.cfi_startproc +nroEntrypointTrampoline: + + // Reset stack pointer. + adrp x8, __stack_top //Defined in libnx. + ldr x8, [x8, #:lo12:__stack_top] + mov sp, x8 + + // Call NRO. + blr x2 + + // Save retval + adrp x1, g_lastRet + str w0, [x1, #:lo12:g_lastRet] + + // Reset stack pointer and load next NRO. + adrp x8, __stack_top + ldr x8, [x8, #:lo12:__stack_top] + mov sp, x8 + + b loadNro + +.cfi_endproc + +.section .text.__libnx_exception_entry, "ax", %progbits +.align 2 +.global __libnx_exception_entry +.type __libnx_exception_entry, %function +.cfi_startproc +__libnx_exception_entry: + + // Divert execution to the NRO entrypoint (if a NRO is actually loaded). + adrp x7, g_nroAddr + ldr x7, [x7, #:lo12:g_nroAddr] + cbz x7, .Lfail + br x7 + +.Lfail: + // Otherwise, pass this unhandled exception right back to the kernel. + mov w0, #0xf801 // KERNELRESULT(UnhandledUserInterrupt) + svc 0x28 // svcReturnFromException + +.cfi_endproc diff --git a/sphaira/CMakeLists.txt b/sphaira/CMakeLists.txt new file mode 100644 index 0000000..ec18501 --- /dev/null +++ b/sphaira/CMakeLists.txt @@ -0,0 +1,265 @@ +cmake_minimum_required(VERSION 3.13) + +set(sphaira_VERSION 0.3.0) + +project(sphaira + VERSION ${sphaira_VERSION} + LANGUAGES C CXX +) + +find_package(Git REQUIRED) + +execute_process( + COMMAND "${GIT_EXECUTABLE}" rev-parse --short HEAD + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" + OUTPUT_VARIABLE GIT_COMMIT + OUTPUT_STRIP_TRAILING_WHITESPACE +) + +execute_process( + COMMAND "${GIT_EXECUTABLE}" symbolic-ref --short HEAD + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" + OUTPUT_VARIABLE GIT_BRANCH + OUTPUT_STRIP_TRAILING_WHITESPACE +) + +execute_process( + COMMAND "${GIT_EXECUTABLE}" status --porcelain + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" + OUTPUT_VARIABLE GIT_DIRTY + OUTPUT_STRIP_TRAILING_WHITESPACE +) + +if (GIT_DIRTY) + set(sphaira_VERSION_HASH "${sphaira_VERSION} ${GIT_COMMIT}-dirty") +else() + set(sphaira_VERSION_HASH "${sphaira_VERSION} ${GIT_COMMIT}") +endif() + +add_executable(sphaira + source/ui/menus/appstore.cpp + source/ui/menus/file_viewer.cpp + source/ui/menus/filebrowser.cpp + source/ui/menus/homebrew.cpp + source/ui/menus/irs_menu.cpp + source/ui/menus/main_menu.cpp + source/ui/menus/menu_base.cpp + source/ui/menus/themezer.cpp + + source/ui/error_box.cpp + source/ui/notification.cpp + source/ui/nvg_util.cpp + source/ui/option_box.cpp + source/ui/option_list.cpp + source/ui/popup_list.cpp + source/ui/progress_box.cpp + source/ui/scrollable_text.cpp + source/ui/scrollbar.cpp + source/ui/sidebar.cpp + source/ui/widget.cpp + + source/app.cpp + source/download.cpp + source/option.cpp + source/evman.cpp + source/fs.cpp + source/image.cpp + source/log.cpp + source/main.cpp + source/nro.cpp + source/nxlink.cpp + source/owo.cpp + source/swkbd.cpp + source/web.cpp + source/i18n.cpp +) + +target_compile_definitions(sphaira PRIVATE + -DAPP_VERSION="${sphaira_VERSION}" + -DAPP_VERSION_HASH="${sphaira_VERSION_HASH}" +) + +include(FetchContent) +set(FETCHCONTENT_QUIET FALSE) + +FetchContent_Declare(libpulsar + GIT_REPOSITORY https://github.com/ITotalJustice/switch-libpulsar.git + GIT_TAG d729be3 +) + +FetchContent_Declare(nanovg + GIT_REPOSITORY https://github.com/ITotalJustice/nanovg-deko3d.git + GIT_TAG 1902b38 +) + +FetchContent_Declare(stb + GIT_REPOSITORY https://github.com/nothings/stb.git + GIT_TAG 5c20573 +) + +FetchContent_Declare(yyjson + GIT_REPOSITORY https://github.com/ibireme/yyjson.git + GIT_TAG 0.10.0 +) + +FetchContent_Declare(minIni-sphaira + GIT_REPOSITORY https://github.com/ITotalJustice/minIni-nx.git + GIT_TAG 63ec295 +) + +set(MININI_LIB_NAME minIni-sphaira) +set(MININI_USE_STDIO ON) +set(MININI_USE_NX ON) +set(MININI_USE_FLOAT OFF) + +if (CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") + set(NANOVG_DEBUG ON) +endif() +set(NANOVG_NO_JPEG OFF) +set(NANOVG_NO_PNG OFF) +set(NANOVG_NO_BMP ON) +set(NANOVG_NO_PSD ON) +set(NANOVG_NO_TGA ON) +set(NANOVG_NO_GIF ON) +set(NANOVG_NO_HDR ON) +set(NANOVG_NO_PIC ON) +set(NANOVG_NO_PNM ON) +set(NANOVG_STBI_STATIC OFF) +set(NANOVG_STBTT_STATIC ON) + +set(YYJSON_DISABLE_READER OFF) +set(YYJSON_DISABLE_WRITER ON) +set(YYJSON_DISABLE_UTILS ON) +set(YYJSON_DISABLE_FAST_FP_CONV ON) +set(YYJSON_DISABLE_NON_STANDARD ON) +set(YYJSON_DISABLE_UTF8_VALIDATION ON) +set(YYJSON_DISABLE_UNALIGNED_MEMORY_ACCESS OFF) + +FetchContent_MakeAvailable( + libpulsar + nanovg + stb + minIni-sphaira + yyjson +) + +# todo: upstream cmake +add_library(libpulsar + ${libpulsar_SOURCE_DIR}/src/archive/archive_file.c + ${libpulsar_SOURCE_DIR}/src/archive/archive.c + ${libpulsar_SOURCE_DIR}/src/bfgrp/bfgrp_location.c + ${libpulsar_SOURCE_DIR}/src/bfgrp/bfgrp.c + ${libpulsar_SOURCE_DIR}/src/bfsar/bfsar_file.c + ${libpulsar_SOURCE_DIR}/src/bfsar/bfsar_group.c + ${libpulsar_SOURCE_DIR}/src/bfsar/bfsar_sound.c + ${libpulsar_SOURCE_DIR}/src/bfsar/bfsar_string.c + ${libpulsar_SOURCE_DIR}/src/bfsar/bfsar_wave_archive.c + ${libpulsar_SOURCE_DIR}/src/bfsar/bfsar.c + ${libpulsar_SOURCE_DIR}/src/bfstm/bfstm_channel.c + ${libpulsar_SOURCE_DIR}/src/bfstm/bfstm_info.c + ${libpulsar_SOURCE_DIR}/src/bfstm/bfstm.c + ${libpulsar_SOURCE_DIR}/src/bfwar/bfwar_file.c + ${libpulsar_SOURCE_DIR}/src/bfwar/bfwar.c + ${libpulsar_SOURCE_DIR}/src/bfwav/bfwav_info.c + ${libpulsar_SOURCE_DIR}/src/bfwav/bfwav.c + ${libpulsar_SOURCE_DIR}/src/bfwsd/bfwsd_sound_data.c + ${libpulsar_SOURCE_DIR}/src/bfwsd/bfwsd_wave_id.c + ${libpulsar_SOURCE_DIR}/src/bfwsd/bfwsd.c + ${libpulsar_SOURCE_DIR}/src/player/player_load_formats.c + ${libpulsar_SOURCE_DIR}/src/player/player_load_lookup.c + ${libpulsar_SOURCE_DIR}/src/player/player_load.c + ${libpulsar_SOURCE_DIR}/src/player/player.c +) +target_include_directories(libpulsar PUBLIC ${libpulsar_SOURCE_DIR}/include) +set_target_properties(libpulsar PROPERTIES + C_STANDARD 11 + C_EXTENSIONS ON +) + +add_library(stb INTERFACE) +target_include_directories(stb INTERFACE ${stb_SOURCE_DIR}) + +find_package(ZLIB REQUIRED) +find_library(minizip_lib minizip REQUIRED) +find_path(minizip_inc minizip REQUIRED) + +find_package(CURL REQUIRED) +find_path(mbedtls_inc mbedtls REQUIRED) +find_library(mbedcrypto_lib mbedcrypto REQUIRED) + +set_target_properties(sphaira PROPERTIES + C_STANDARD 11 + C_EXTENSIONS ON + CXX_STANDARD 23 + CXX_EXTENSIONS ON +) + +target_link_libraries(sphaira PRIVATE + libpulsar + minIni-sphaira + nanovg + stb + yyjson + + ${minizip_lib} + ZLIB::ZLIB + CURL::libcurl + ${mbedcrypto_lib} +) + +target_include_directories(sphaira PRIVATE + include + ${minizip_inc} + ${mbedtls_inc} +) + +# copy the romfs +file(COPY ${CMAKE_SOURCE_DIR}/assets/romfs DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) + +# create assets target +dkp_add_asset_target(sphaira_romfs ${CMAKE_CURRENT_BINARY_DIR}/romfs) + +# add hbl exefs to romfs, used for forwarders +dkp_install_assets(sphaira_romfs + DESTINATION exefs + TARGETS + hbl_nso + hbl_npdm +) + +# add nanovg shaders to romfs +dkp_install_assets(sphaira_romfs + DESTINATION shaders + TARGETS + fill_aa_fsh + fill_fsh + fill_vsh +) + +# create nacp +nx_generate_nacp( + OUTPUT sphaira.nacp + NAME ${CMAKE_PROJECT_NAME} + AUTHOR TotalJustice + VERSION ${CMAKE_PROJECT_VERSION} +) + +# create nro +nx_create_nro(sphaira + OUTPUT ${CMAKE_BINARY_DIR}/sphaira.nro + ICON ${CMAKE_SOURCE_DIR}/assets/icon.jpg + NACP sphaira.nacp + ROMFS sphaira_romfs +) + +file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/switch/sphaira) + +add_custom_command( + TARGET sphaira_nro POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy + ${CMAKE_BINARY_DIR}/sphaira.nro + ${CMAKE_BINARY_DIR}/switch/sphaira/sphaira.nro +) + +message(STATUS "generating nro in: ${CMAKE_BINARY_DIR}/sphaira.nro") +message(STATUS "run nxlink -s ${CMAKE_BINARY_DIR}/sphaira.nro") diff --git a/sphaira/include/app.hpp b/sphaira/include/app.hpp new file mode 100644 index 0000000..e4b9bc7 --- /dev/null +++ b/sphaira/include/app.hpp @@ -0,0 +1,173 @@ +#pragma once + +#include "nanovg.h" +#include "nanovg/dk_renderer.hpp" +#include "pulsar.h" +#include "ui/widget.hpp" +#include "ui/notification.hpp" +#include "owo.hpp" +#include "option.hpp" +#include "fs.hpp" + +#include +#include +#include +#include +#include + +namespace sphaira { + +enum SoundEffect { + SoundEffect_Music, + SoundEffect_Focus, + SoundEffect_Scroll, + SoundEffect_Limit, + SoundEffect_Startup, + SoundEffect_Install, + SoundEffect_Error, +}; + +enum class LaunchType { + Normal, + Forwader_Unknown, + Forwader_Sphaira, +}; + +void DrawElement(float x, float y, float w, float h, ThemeEntryID id); + +class App { +public: + App(const char* argv0); + ~App(); + void Loop(); + + static void Exit(); + static auto GetVg() -> NVGcontext*; + static void Push(std::shared_ptr); + + // this is thread safe (todo: make it thread safe) + static void Notify(std::string text, ui::NotifEntry::Side side = ui::NotifEntry::Side::RIGHT); + static void Notify(ui::NotifEntry entry); + static void NotifyPop(ui::NotifEntry::Side side = ui::NotifEntry::Side::RIGHT); + static void NotifyClear(ui::NotifEntry::Side side = ui::NotifEntry::Side::RIGHT); + + static auto GetThemeMetaList() -> std::span; + static void SetTheme(u64 theme_index); + static auto GetThemeIndex() -> u64; + + // returns argv[0] + static auto GetExePath() -> fs::FsPath; + // returns true if we are hbmenu. + static auto IsHbmenu() -> bool; + + static auto GetNxlinkEnable() -> bool; + static auto GetLogEnable() -> bool; + static auto GetReplaceHbmenuEnable() -> bool; + static auto GetInstallSdEnable() -> bool; + static auto GetThemeShuffleEnable() -> bool; + static auto GetThemeMusicEnable() -> bool; + static auto GetLanguage() -> long; + + static void SetNxlinkEnable(bool enable); + static void SetLogEnable(bool enable); + static void SetReplaceHbmenuEnable(bool enable); + static void SetInstallSdEnable(bool enable); + static void SetThemeShuffleEnable(bool enable); + static void SetThemeMusicEnable(bool enable); + static void SetLanguage(long index); + + static auto Install(OwoConfig& config) -> Result; + static auto Install(ui::ProgressBox* pbox, OwoConfig& config) -> Result; + + static void PlaySoundEffect(SoundEffect effect); + + void Draw(); + void Update(); + void Poll(); + + void DrawBackground(); + void DrawTouch(); + + // void DrawElement(float x, float y, float w, float h, ui::ThemeEntryID id); + auto LoadElementImage(std::string_view value) -> ElementEntry; + auto LoadElementColour(std::string_view value) -> ElementEntry; + auto LoadElement(std::string_view data) -> ElementEntry; + + void LoadTheme(const fs::FsPath& path); + void CloseTheme(); + void ScanThemes(const std::string& path); + void ScanThemeEntries(); + + static auto IsApplication() -> bool { + const auto type = appletGetAppletType(); + return type == AppletType_Application || type == AppletType_SystemApplication; + } + +// private: + static constexpr inline auto CONFIG_PATH = "/config/sphaira/config.ini"; + static constexpr inline auto PLAYLOG_PATH = "/config/sphaira/playlog.ini"; + static constexpr inline auto INI_SECTION = "config"; + + fs::FsPath m_app_path; + u64 m_start_timestamp{}; + u64 m_prev_timestamp{}; + fs::FsPath m_prev_last_launch{}; + + bool m_is_launched_via_sphaira_forwader{}; + + NVGcontext* vg{}; + PadState m_pad{}; + TouchInfo m_touch_info{}; + Controller m_controller{}; + std::vector m_theme_meta_entries; + + Vec2 m_scale{1, 1}; + + std::vector> m_widgets; + u32 m_pop_count{}; + ui::NotifMananger m_notif_manager{}; + + AppletHookCookie m_appletHookCookie{}; + + Theme m_theme{}; + fs::FsPath theme_path{}; + std::size_t m_theme_index{}; + + bool m_quit{}; + + option::OptionBool m_nxlink_enabled{INI_SECTION, "nxlink_enabled", true}; + option::OptionBool m_log_enabled{INI_SECTION, "log_enabled", false}; + option::OptionBool m_replace_hbmenu{INI_SECTION, "replace_hbmenu", false}; + option::OptionBool m_install_sd{INI_SECTION, "install_sd", true}; + option::OptionBool m_theme_shuffle{INI_SECTION, "theme_shuffle", false}; + option::OptionBool m_theme_music{INI_SECTION, "theme_music", true}; + option::OptionLong m_language{INI_SECTION, "language", 0}; // auto + + PLSR_BFSAR m_qlaunch_bfsar{}; + PLSR_PlayerSoundId m_sound_ids[24]{}; + +private: // from nanovg decko3d example by adubbz + static constexpr unsigned NumFramebuffers = 2; + static constexpr unsigned StaticCmdSize = 0x1000; + unsigned s_width{1280}; + unsigned s_height{720}; + dk::UniqueDevice device; + dk::UniqueQueue queue; + std::optional pool_images; + std::optional pool_code; + std::optional pool_data; + dk::UniqueCmdBuf cmdbuf; + CMemPool::Handle depthBuffer_mem; + CMemPool::Handle framebuffers_mem[NumFramebuffers]; + dk::Image depthBuffer; + dk::Image framebuffers[NumFramebuffers]; + DkCmdList framebuffer_cmdlists[NumFramebuffers]; + dk::UniqueSwapchain swapchain; + DkCmdList render_cmdlist; + std::optional renderer; + void createFramebufferResources(); + void destroyFramebufferResources(); + void recordStaticCommands(); +}; + +} // namespace sphaira diff --git a/sphaira/include/defines.hpp b/sphaira/include/defines.hpp new file mode 100644 index 0000000..c9da42c --- /dev/null +++ b/sphaira/include/defines.hpp @@ -0,0 +1,550 @@ +#pragma once + +#include +#include + +enum { + Module_Svc = 1, + Module_Fs = 2, + Module_Os = 3, + Module_Htcs = 4, + Module_Ncm = 5, + Module_Dd = 6, + Module_Osdbg = 7, + Module_Lr = 8, + Module_Ldr = 9, + Module_Sf = 10, + Module_Sf_Hipc = 11, + Module_Tma = 12, + Module_Dmnt = 13, + Module_Gds = 14, + Module_Pm = 15, + Module_Ns = 16, + Module_Bsdsockets = 17, + Module_Htc = 18, + Module_Tsc = 19, + Module_Kvdb = 20, + Module_Sm = 21, + Module_Ro = 22, + Module_Gc = 23, + Module_Sdmmc = 24, + Module_Ovln = 25, + Module_Spl = 26, + Module_Socket = 27, + Module_Htclow = 29, + Module_Ddsf = 30, + Module_Htcfs = 31, + Module_Async = 32, + Module_Util = 33, + Module_Tipc = 35, + Module_Anif = 37, + Module_Crt = 39, + Module_Eth = 100, + Module_I2c = 101, + Module_Gpio = 102, + Module_Uart = 103, + Module_Cpad = 104, + Module_Settings = 105, + Module_Ftm = 106, + Module_Wlan = 107, + Module_Xcd = 108, + Module_Tmp451 = 109, + Module_Nifm = 110, + Module_Codec = 111, + Module_Lsm6ds3 = 112, + Module_Bluetooth = 113, + Module_Vi = 114, + Module_Nfp = 115, + Module_Time = 116, + Module_Fgm = 117, + Module_Oe = 118, + Module_Bh1730fvc = 119, + Module_Pcie = 120, + Module_Friends = 121, + Module_Bcat = 122, + Module_Ssl = 123, + Module_Account = 124, + Module_News = 125, + Module_Mii = 126, + Module_Nfc = 127, + Module_Am = 128, + Module_Prepo = 129, + Module_Ahid = 130, + Module_Applet = 131, + Module_Ae = 132, + Module_Pcv = 133, + Module_Usb_Pd = 134, + Module_Bpc = 135, + Module_Psm = 136, + Module_Nim = 137, + Module_Psc = 138, + Module_Tc = 139, + Module_Usb = 140, + Module_Nsd = 141, + Module_Pctl = 142, + Module_Btm = 143, + Module_La = 144, + Module_Es = 145, + Module_Ngc = 146, + Module_Erpt = 147, + Module_Apm = 148, + Module_Cec = 149, + Module_Profiler = 150, + Module_Eupld = 151, + Module_Lidbe = 152, + Module_Audio = 153, + Module_Npns = 154, + Module_Http = 155, + Module_Idle = 156, + Module_Arp = 157, + Module_Updater = 158, + Module_Swkbd = 159, + Module_Netdiag = 160, + Module_Nfc_Mifare = 161, + Module_Err = 162, + Module_Fatal = 163, + Module_Ec = 164, + Module_Spsm = 165, + Module_Aoc = 166, + Module_Bgtc = 167, + Module_Creport = 168, + Module_Sasbus = 169, + Module_Pl = 170, + Module_Audioctrl = 172, + Module_Lbl = 173, + Module_Jit = 175, + Module_Hdcp = 176, + Module_Omm = 177, + Module_Pdm = 178, + Module_Olsc = 179, + Module_Srepo = 180, + Module_Dauth = 181, + Module_Stdfu = 182, + Module_Dbg = 183, + Module_Dhcps = 186, + Module_Spi = 187, + Module_Avm = 188, + Module_Pwm = 189, + Module_Rtc = 191, + Module_Regulator = 192, + Module_Led = 193, + Module_Sio = 195, + Module_Pcm = 196, + Module_Clkrst = 197, + Module_Powctl = 198, + Module_Audio_Old = 201, + Module_Hid = 202, + Module_Ldn = 203, + Module_Cs = 204, + Module_Irsensor = 205, + Module_Capsrv = 206, + Module_Manu = 208, + Module_Atk = 209, + Module_Web = 210, + Module_Lcs = 211, + Module_Grc = 212, + Module_Repair = 213, + Module_Album = 214, + Module_Rid = 215, + Module_Migration = 216, + Module_Migration_Idc = 217, + Module_Hidbus = 218, + Module_Ens = 219, + Module_Websocket = 223, + Module_Dcdmtp = 227, + Module_Pgl = 228, + Module_Notification = 229, + Module_Ins = 230, + Module_Lp2p = 231, + Module_Rcd = 232, + Module_Icm40607 = 233, + Module_Prc = 235, + Module_Tma_Htc = 237, + Module_Ectx = 238, + Module_Mnpp = 239, + Module_Hshl = 240, + Module_Capmtp = 242, + Module_Dp2hdmi = 244, + Module_Cradle = 245, + Module_Sprofile = 246, + Module_Icm42607p = 248, + Module_Ndrm = 250, + Module_Fst2 = 251, + Module_Nex = 306, + Module_Npln = 321, + Module_Tspm = 499, + Module_Devmenu = 500, +}; + +enum SvcError { + SvcError_OutOfSessions = 0xE01, + SvcError_InvalidArgument = 0x1C01, + SvcError_NotImplemented = 0x4201, + SvcError_StopProcessingException = 0x6C01, + SvcError_NoSynchronizationObject = 0x7201, + SvcError_TerminationRequested = 0x7601, + SvcError_NoEvent = 0x8C01, + SvcError_InvalidSize = 0xCA01, + SvcError_InvalidAddress = 0xCC01, + SvcError_OutOfResource = 0xCE01, + SvcError_OutOfMemory = 0xD001, + SvcError_OutOfHandles = 0xD201, + SvcError_InvalidCurrentMemory = 0xD401, + SvcError_InvalidNewMemoryPermission = 0xD801, + SvcError_InvalidMemoryRegion = 0xDC01, + SvcError_InvalidPriority = 0xE001, + SvcError_InvalidCoreId = 0xE201, + SvcError_InvalidHandle = 0xE401, + SvcError_InvalidPointer = 0xE601, + SvcError_InvalidCombination = 0xE801, + SvcError_TimedOut = 0xEA01, + SvcError_Cancelled = 0xEC01, + SvcError_OutOfRange = 0xEE01, + SvcError_InvalidEnumValue = 0xF001, + SvcError_NotFound = 0xF201, + SvcError_Busy = 0xF401, + SvcError_SessionClosed = 0xF601, + SvcError_NotHandled = 0xF801, + SvcError_InvalidState = 0xFA01, + SvcError_ReservedUsed = 0xFC01, + SvcError_NotSupported = 0xFE01, + SvcError_Debug = 0x10001, + SvcError_NoThread = 0x10201, + SvcError_UnknownThread = 0x10401, + SvcError_PortClosed = 0x10601, + SvcError_LimitReached = 0x10801, + SvcError_InvalidMemoryPool = 0x10A01, + SvcError_ReceiveListBroken = 0x20401, + SvcError_OutOfAddressSpace = 0x20601, + SvcError_MessageTooLarge = 0x20801, + SvcError_InvalidProcessId = 0x40A01, + SvcError_InvalidThreadId = 0x40C01, + SvcError_InvalidId = 0x40E01, + SvcError_ProcessTerminated = 0x41001, +}; + +enum FsError { + FsError_ResultPathNotFound = 0x202, + FsError_ResultPathAlreadyExists = 0x402, + FsError_ResultTargetLocked = 0xE02, + FsError_UsableSpaceNotEnoughMmcCalibration = 0x4602, + FsError_UsableSpaceNotEnoughMmcSafe = 0x4802, + FsError_UsableSpaceNotEnoughMmcUser = 0x4A02, + FsError_UsableSpaceNotEnoughMmcSystem = 0x4C02, + FsError_ResultUsableSpaceNotEnoughSdCard = 0x4E02, + FsError_ResultUnsupportedSdkVersion = 0x6402, + FsError_ResultMountNameAlreadyExists = 0x7802, + FsError_ResultPartitionNotFound = 0x7D202, + FsError_ResultTargetNotFound = 0x7D402, + FsError_PortSdCardNoDevice = 0xFA202, + FsError_GameCardCardNotInserted = 0x13B002, + FsError_GameCardCardNotActivated = 0x13B402, + FsError_GameCardInvalidSecureAccess = 0x13D802, + FsError_GameCardInvalidNormalAccess = 0x13DA02, + FsError_GameCardInvalidAccessAcrossMode = 0x13DC02, + FsError_GameCardInitialDataMismatch = 0x13E002, + FsError_GameCardInitialNotFilledWithZero = 0x13E202, + FsError_GameCardKekIndexMismatch = 0x13E402, + FsError_GameCardCardHeaderReadFailure = 0x13EE02, + FsError_GameCardShouldTransitFromInitialToNormal = 0x145002, + FsError_GameCardShouldTransitFromNormalModeToSecure = 0x145202, + FsError_GameCardShouldTransitFromNormalModeToDebug = 0x145402, + FsError_GameCardSendFirmwareFailure = 0x149402, + FsError_GameCardReceiveCertificateFailure = 0x149A02, + FsError_GameCardSendSocCertificateFailure = 0x14A002, + FsError_GameCardReceiveRandomValueFailure = 0x14AA02, + FsError_GameCardSendRandomValueFailure = 0x14AC02, + FsError_GameCardReceiveDeviceChallengeFailure = 0x14B602, + FsError_GameCardRespondDeviceChallengeFailure = 0x14B802, + FsError_GameCardSendHostChallengeFailure = 0x14BA02, + FsError_GameCardReceiveChallengeResponseFailure = 0x14BC02, + FsError_GameCardChallengeAndResponseFailure = 0x14BE02, + FsError_GameCardSplGenerateRandomBytesFailure = 0x14D802, + FsError_GameCardReadRegisterFailure = 0x14DE02, + FsError_GameCardWriteRegisterFailure = 0x14E002, + FsError_GameCardEnableCardBusFailure = 0x14E202, + FsError_GameCardGetCardHeaderFailure = 0x14E402, + FsError_GameCardAsicStatusError = 0x14E602, + FsError_GameCardChangeGcModeToSecureFailure = 0x14E802, + FsError_GameCardChangeGcModeToDebugFailure = 0x14EA02, + FsError_GameCardReadRmaInfoFailure = 0x14EC02, + FsError_GameCardStateCardSecureModeRequired = 0x150802, + FsError_GameCardStateCardDebugModeRequired = 0x150A02, + FsError_GameCardCommandReadId1Failure = 0x155602, + FsError_GameCardCommandReadId2Failure = 0x155802, + FsError_GameCardCommandReadId3Failure = 0x155A02, + FsError_GameCardCommandReadPageFailure = 0x155E02, + FsError_GameCardCommandWritePageFailure = 0x156202, + FsError_GameCardCommandRefreshFailure = 0x156402, + FsError_GameCardCommandReadCrcFailure = 0x156C02, + FsError_GameCardCommandEraseFailure = 0x156E02, + FsError_GameCardCommandReadDevParamFailure = 0x157002, + FsError_GameCardCommandWriteDevParamFailure = 0x157202, + FsError_GameCardDebugCardReceivedIdMismatch = 0x16B002, + FsError_GameCardDebugCardId1Mismatch = 0x16B202, + FsError_GameCardDebugCardId2Mismatch = 0x16B402, + FsError_GameCardFsCheckHandleInGetStatusFailure = 0x171402, + FsError_GameCardFsCheckHandleInCreateReadOnlyFailure = 0x172002, + FsError_GameCardFsCheckHandleInCreateSecureReadOnlyFailure = 0x172202, + FsError_ResultNotImplemented = 0x177202, + FsError_ResultAlreadyExists = 0x177602, + FsError_ResultOutOfRange = 0x177A02, + FsError_AllocationMemoryFailedInFatFileSystemA = 0x190202, + FsError_AllocationMemoryFailedInFatFileSystemB = 0x190402, + FsError_AllocationMemoryFailedInFatFileSystemC = 0x190602, + FsError_AllocationMemoryFailedInFatFileSystemD = 0x190802, + FsError_AllocationMemoryFailedInFatFileSystemE = 0x190A02, + FsError_AllocationMemoryFailedInFatFileSystemF = 0x190C02, + FsError_AllocationMemoryFailedInFatFileSystemG = 0x190E02, + FsError_AllocationMemoryFailedInFatFileSystemH = 0x191002, + FsError_AllocationMemoryFailedInSdCardA = 0x195802, + FsError_AllocationMemoryFailedInSdCardB = 0x195A02, + FsError_AllocationMemoryFailedInSystemSaveDataA = 0x195C02, + FsError_AllocationMemoryFailedInRomFsFileSystemA = 0x195E02, + FsError_AllocationMemoryFailedInRomFsFileSystemB = 0x196002, + FsError_AllocationMemoryFailedInRomFsFileSystemC = 0x196202, + FsError_AllocationMemoryFailedInSdmmcStorageServiceA = 0x1A3E02, + FsError_AllocationMemoryFailedInBuiltInStorageCreatorA = 0x1A4002, + FsError_AllocationMemoryFailedInRegisterA = 0x1A4A02, + FsError_IncorrectSaveDataFileSystemMagicCode = 0x21BC02, + FsError_InvalidAcidFileSize = 0x234202, + FsError_InvalidAcidSize = 0x234402, + FsError_InvalidAcid = 0x234602, + FsError_AcidVerificationFailed = 0x234802, + FsError_InvalidNcaSignature = 0x234A02, + FsError_NcaHeaderSignature1VerificationFailed = 0x234C02, + FsError_NcaHeaderSignature2VerificationFailed = 0x234E02, + FsError_NcaFsHeaderHashVerificationFailed = 0x235002, + FsError_InvalidNcaKeyIndex = 0x235202, + FsError_InvalidNcaFsHeaderEncryptionType = 0x235602, + FsError_InvalidNcaPatchInfoIndirectSize = 0x235802, + FsError_InvalidNcaPatchInfoAesCtrExSize = 0x235A02, + FsError_InvalidNcaPatchInfoAesCtrExOffset = 0x235C02, + FsError_InvalidNcaId = 0x235E02, + FsError_InvalidNcaHeader = 0x236002, + FsError_InvalidNcaFsHeader = 0x236202, + FsError_InvalidHierarchicalSha256BlockSize = 0x236802, + FsError_InvalidHierarchicalSha256LayerCount = 0x236A02, + FsError_HierarchicalSha256BaseStorageTooLarge = 0x236C02, + FsError_HierarchicalSha256HashVerificationFailed = 0x236E02, + FsError_InvalidSha256PartitionHashTarget = 0x244402, + FsError_Sha256PartitionHashVerificationFailed = 0x244602, + FsError_PartitionSignatureVerificationFailed = 0x244802, + FsError_Sha256PartitionSignatureVerificationFailed = 0x244A02, + FsError_InvalidPartitionEntryOffset = 0x244C02, + FsError_InvalidSha256PartitionMetaDataSize = 0x244E02, + FsError_InvalidFatFileNumber = 0x249802, + FsError_InvalidFatFormatBisUser = 0x249C02, + FsError_InvalidFatFormatBisSystem = 0x249E02, + FsError_InvalidFatFormatBisSafe = 0x24A002, + FsError_InvalidFatFormatBisCalibration = 0x24A202, + FsError_AesXtsFileSystemFileHeaderCorruptedOnFileOpen = 0x250E02, + FsError_AesXtsFileSystemFileNoHeaderOnFileOpen = 0x251002, + FsError_FatFsFormatUnsupportedSize = 0x280202, + FsError_FatFsFormatInvalidBpb = 0x280402, + FsError_FatFsFormatInvalidParameter = 0x280602, + FsError_FatFsFormatIllegalSectorsA = 0x280802, + FsError_FatFsFormatIllegalSectorsB = 0x280A02, + FsError_FatFsFormatIllegalSectorsC = 0x280C02, + FsError_FatFsFormatIllegalSectorsD = 0x280E02, + FsError_UnexpectedInMountTableA = 0x296A02, + FsError_ResultTooLongPath = 0x2EE602, + FsError_ResultInvalidCharacter = 0x2EE802, + FsError_ResultInvalidPathFormat = 0x2EEA02, + FsError_ResultDirectoryUnobtainable = 0x2EEC02, + FsError_ResultInvalidOffset = 0x2F5A02, + FsError_ResultInvalidSize = 0x2F5C02, + FsError_ResultNullptrArgument = 0x2F5E02, + FsError_ResultInvalidAlignment = 0x2F6002, + FsError_ResultInvalidMountName = 0x2F6202, + FsError_ResultExtensionSizeTooLarge = 0x2F6402, + FsError_ResultExtensionSizeInvalid = 0x2F6602, + FsError_ResultFileExtensionWithoutOpenModeAllowAppend = 0x307202, + FsError_UnsupportedCommitTarget = 0x313A02, + FsError_UnsupportedSetSizeForNotResizableSubStorage = 0x313C02, + FsError_UnsupportedSetSizeForResizableSubStorage = 0x313E02, + FsError_UnsupportedSetSizeForMemoryStorage = 0x314002, + FsError_UnsupportedOperateRangeForMemoryStorage = 0x314202, + FsError_UnsupportedOperateRangeForFileStorage = 0x314402, + FsError_UnsupportedOperateRangeForFileHandleStorage = 0x314602, + FsError_UnsupportedOperateRangeForSwitchStorage = 0x314802, + FsError_UnsupportedOperateRangeForStorageServiceObjectAdapter = 0x314A02, + FsError_UnsupportedWriteForAesCtrCounterExtendedStorage = 0x314C02, + FsError_UnsupportedSetSizeForAesCtrCounterExtendedStorage = 0x314E02, + FsError_UnsupportedOperateRangeForAesCtrCounterExtendedStorage = 0x315002, + FsError_UnsupportedWriteForAesCtrStorageExternal = 0x315202, + FsError_UnsupportedSetSizeForAesCtrStorageExternal = 0x315402, + FsError_UnsupportedSetSizeForAesCtrStorage = 0x315602, + FsError_UnsupportedSetSizeForHierarchicalIntegrityVerificationStorage = 0x315802, + FsError_UnsupportedOperateRangeForHierarchicalIntegrityVerificationStorage = 0x315A02, + FsError_UnsupportedSetSizeForIntegrityVerificationStorage = 0x315C02, + FsError_UnsupportedOperateRangeForWritableIntegrityVerificationStorage = 0x315E02, + FsError_UnsupportedOperateRangeForIntegrityVerificationStorage = 0x316002, + FsError_UnsupportedSetSizeForBlockCacheBufferedStorage = 0x316202, + FsError_UnsupportedOperateRangeForWritableBlockCacheBufferedStorage = 0x316402, + FsError_UnsupportedOperateRangeForBlockCacheBufferedStorage = 0x316602, + FsError_UnsupportedWriteForIndirectStorage = 0x316802, + FsError_UnsupportedSetSizeForIndirectStorage = 0x316A02, + FsError_UnsupportedOperateRangeForIndirectStorage = 0x316C02, + FsError_UnsupportedWriteForZeroStorage = 0x316E02, + FsError_UnsupportedSetSizeForZeroStorage = 0x317002, + FsError_UnsupportedSetSizeForHierarchicalSha256Storage = 0x317202, + FsError_UnsupportedWriteForReadOnlyBlockCacheStorage = 0x317402, + FsError_UnsupportedSetSizeForReadOnlyBlockCacheStorage = 0x317602, + FsError_UnsupportedSetSizeForIntegrityRomFsStorage = 0x317802, + FsError_UnsupportedSetSizeForDuplexStorage = 0x317A02, + FsError_UnsupportedOperateRangeForDuplexStorage = 0x317C02, + FsError_UnsupportedSetSizeForHierarchicalDuplexStorage = 0x317E02, + FsError_UnsupportedGetSizeForRemapStorage = 0x318002, + FsError_UnsupportedSetSizeForRemapStorage = 0x318202, + FsError_UnsupportedOperateRangeForRemapStorage = 0x318402, + FsError_UnsupportedSetSizeForIntegritySaveDataStorage = 0x318602, + FsError_UnsupportedOperateRangeForIntegritySaveDataStorage = 0x318802, + FsError_UnsupportedSetSizeForJournalIntegritySaveDataStorage = 0x318A02, + FsError_UnsupportedOperateRangeForJournalIntegritySaveDataStorage = 0x318C02, + FsError_UnsupportedGetSizeForJournalStorage = 0x318E02, + FsError_UnsupportedSetSizeForJournalStorage = 0x319002, + FsError_UnsupportedOperateRangeForJournalStorage = 0x319202, + FsError_UnsupportedSetSizeForUnionStorage = 0x319402, + FsError_UnsupportedSetSizeForAllocationTableStorage = 0x319602, + FsError_UnsupportedReadForWriteOnlyGameCardStorage = 0x319802, + FsError_UnsupportedSetSizeForWriteOnlyGameCardStorage = 0x319A02, + FsError_UnsupportedWriteForReadOnlyGameCardStorage = 0x319C02, + FsError_UnsupportedSetSizeForReadOnlyGameCardStorage = 0x319E02, + FsError_UnsupportedOperateRangeForReadOnlyGameCardStorage = 0x31A002, + FsError_UnsupportedSetSizeForSdmmcStorage = 0x31A202, + FsError_UnsupportedOperateRangeForSdmmcStorage = 0x31A402, + FsError_UnsupportedOperateRangeForFatFile = 0x31A602, + FsError_UnsupportedOperateRangeForStorageFile = 0x31A802, + FsError_UnsupportedSetSizeForInternalStorageConcatenationFile = 0x31AA02, + FsError_UnsupportedOperateRangeForInternalStorageConcatenationFile = 0x31AC02, + FsError_UnsupportedQueryEntryForConcatenationFileSystem = 0x31AE02, + FsError_UnsupportedOperateRangeForConcatenationFile = 0x31B002, + FsError_UnsupportedSetSizeForZeroBitmapFile = 0x31B202, + FsError_UnsupportedOperateRangeForFileServiceObjectAdapter = 0x31B402, + FsError_UnsupportedOperateRangeForAesXtsFile = 0x31B602, + FsError_UnsupportedWriteForRomFsFileSystem = 0x31B802, + FsError_UnsupportedCommitProvisionallyForRomFsFileSystem = 0x31BA02, + FsError_UnsupportedGetTotalSpaceSizeForRomFsFileSystem = 0x31BC02, + FsError_UnsupportedWriteForRomFsFile = 0x31BE02, + FsError_UnsupportedOperateRangeForRomFsFile = 0x31C002, + FsError_UnsupportedWriteForReadOnlyFileSystem = 0x31C202, + FsError_UnsupportedCommitProvisionallyForReadOnlyFileSystem = 0x31C402, + FsError_UnsupportedGetTotalSpaceSizeForReadOnlyFileSystem = 0x31C602, + FsError_UnsupportedWriteForReadOnlyFile = 0x31C802, + FsError_UnsupportedOperateRangeForReadOnlyFile = 0x31CA02, + FsError_UnsupportedWriteForPartitionFileSystem = 0x31CC02, + FsError_UnsupportedCommitProvisionallyForPartitionFileSystem = 0x31CE02, + FsError_UnsupportedWriteForPartitionFile = 0x31D002, + FsError_UnsupportedOperateRangeForPartitionFile = 0x31D202, + FsError_UnsupportedOperateRangeForTmFileSystemFile = 0x31D402, + FsError_UnsupportedWriteForSaveDataInternalStorageFileSystem = 0x31D602, + FsError_UnsupportedCommitProvisionallyForApplicationTemporaryFileSystem = 0x31DC02, + FsError_UnsupportedCommitProvisionallyForSaveDataFileSystem = 0x31DE02, + FsError_UnsupportedCommitProvisionallyForDirectorySaveDataFileSystem = 0x31E002, + FsError_UnsupportedWriteForZeroBitmapHashStorageFile = 0x31E202, + FsError_UnsupportedSetSizeForZeroBitmapHashStorageFile = 0x31E402, + FsError_ResultNcaExternalKeyUnregisteredDeprecated = 0x326602, + FsError_ResultFileNotClosed = 0x326E02, + FsError_ResultDirectoryNotClosed = 0x327002, + FsError_ResultWriteModeFileNotClosed = 0x327202, + FsError_ResultAllocatorAlreadyRegistered = 0x327402, + FsError_ResultDefaultAllocatorAlreadyUsed = 0x327602, + FsError_ResultAllocatorAlignmentViolation = 0x327A02, + FsError_ResultUserNotExist = 0x328202, + FsError_FileNotFound = 0x339402, + FsError_DirectoryNotFound = 0x339602, + FsError_MappingTableFull = 0x346402, + FsError_OpenCountLimit = 0x346A02, + FsError_MultiCommitFileSystemLimit = 0x346C02, + FsError_MapFull = 0x353602, + FsError_NotMounted = 0x35F202, + FsError_DbmKeyNotFound = 0x3DBC02, + FsError_DbmFileNotFound = 0x3DBE02, + FsError_DbmDirectoryNotFound = 0x3DC002, + FsError_DbmAlreadyExists = 0x3DC402, + FsError_DbmKeyFull = 0x3DC602, + FsError_DbmDirectoryEntryFull = 0x3DC802, + FsError_DbmFileEntryFull = 0x3DCA02, + FsError_DbmInvalidOperation = 0x3DD402, +}; + +enum OsError { + OsError_ResultNoPermission = 0x203, + OsError_ResultAccessViolation = 0x403, + OsError_ResultBadRequest = 0x603, + OsError_ResultBusy = 0x803, + OsError_ResultDeadlock = 0xA03, + OsError_ResultInvalidAddress = 0xC03, + OsError_ResultInvalidParameter = 0xE03, + OsError_ResultOutOfMemory = 0x1003, + OsError_ResultOutOfResource = 0x1203, + OsError_InvalidHandle = 0x3EA03, + OsError_InvalidCurrentMemoryState = 0x3EC03, + OsError_InvalidTransferMemoryState = 0x3EE03, + OsError_InvalidTransferMemorySize = 0x3F003, + OsError_ResultInternalError = 0x7FE03, +}; + +enum NcmError { + NcmError_ContentNotFound = 0xA05, + NcmError_ContentMetaNotFound = 0xE05, + NcmError_UnknownStorage = 0x1805, + NcmError_InvalidContentMetaDatabase = 0xDC05, + NcmError_WriteToReadOnlyContentStorage = 0x17C05, +}; + +#define R_SUCCEED() return 0 + +#define R_THROW(_rc) return _rc + +#define R_TRY_RESULT(r, _result) { \ + if (const auto _rc = (r); R_FAILED(_rc)) { \ + R_THROW(_result); \ + } \ +} + +#define R_TRY(r) { \ + if (const auto _rc = (r); R_FAILED(_rc)) { \ + R_THROW(_rc); \ + } \ +} + +#define R_UNLESS(expr, res) { \ + if (!(expr)) { \ + R_THROW(res); \ + } \ +} + +#define CONCATENATE_IMPL(s1, s2) s1##s2 +#define CONCATENATE(s1, s2) CONCATENATE_IMPL(s1, s2) +#define ANONYMOUS_VARIABLE(pref) CONCATENATE(pref, __COUNTER__) + +#define ON_SCOPE_EXIT(_f) std::experimental::scope_exit ANONYMOUS_VARIABLE(SCOPE_EXIT_STATE_){[&] { _f; }}; +#define ON_SCOPE_FAIL(_f) std::experimental::scope_exit ANONYMOUS_VARIABLE(SCOPE_EXIT_STATE_){[&] { if (R_FAILED(rc)) { _f; } }}; +#define ON_SCOPE_SUCCESS(_f) std::experimental::scope_exit ANONYMOUS_VARIABLE(SCOPE_EXIT_STATE_){[&] { if (R_SUCCEEDED(rc)) { _f; } }}; + +#if 0 +constexpr auto cexprHash(const char *str, std::size_t v = 0) noexcept -> std::size_t { + return (*str == 0) ? v : 31 * cexprHash(str + 1) + *str; +} + +constexpr auto cexprStrlen(const char *str) noexcept -> std::size_t { + return (*str != 0) ? 1 + cexprStrlen(str + 1) : 0; +} + +inline void showError(const char* title, const char* desc, Result rc) { + const auto type = appletGetAppletType(); + if (type == AppletType_Application || type == AppletType_SystemApplication) { + ErrorApplicationConfig cfg; + errorApplicationCreate(&cfg, title, desc); + errorApplicationSetNumber(&cfg, rc); + errorApplicationShow(&cfg); + } else { + ErrorSystemConfig cfg; + errorSystemCreate(&cfg, title, desc); + errorSystemSetResult(&cfg, rc); + errorSystemShow(&cfg); + } +} +#endif diff --git a/sphaira/include/download.hpp b/sphaira/include/download.hpp new file mode 100644 index 0000000..19e39cc --- /dev/null +++ b/sphaira/include/download.hpp @@ -0,0 +1,41 @@ +#pragma once + +#include +#include +#include +#include + +namespace sphaira { + +using DownloadCallback = std::function& data, bool success)>; +using ProgressCallback = std::function; + +enum class DownloadPriority { + Normal, // gets pushed to the back of the queue + High, // gets pushed to the front of the queue +}; + +struct DownloadEventData { + DownloadCallback callback; + std::vector data; + bool result; +}; + +auto DownloadInit() -> bool; +void DownloadExit(); + +// sync functions +auto DownloadMemory(const std::string& url, const std::string& post, ProgressCallback pcallback = nullptr) -> std::vector; +auto DownloadFile(const std::string& url, const std::string& out, const std::string& post, ProgressCallback pcallback = nullptr) -> bool; +// async functions +// starts the downloads in a new thread, pushes an event when complete +// then, the callback will be called on the main thread. +// auto DownloadMemoryAsync(const std::string& url, DownloadCallback callback, DownloadPriority prio = DownloadPriority::Normal) -> bool; +// auto DownloadFileAsync(const std::string& url, const std::string& out, DownloadCallback callback, DownloadPriority prio = DownloadPriority::Normal) -> bool; + +auto DownloadMemoryAsync(const std::string& url, const std::string& post, DownloadCallback callback, ProgressCallback pcallback = nullptr, DownloadPriority prio = DownloadPriority::Normal) -> bool; +auto DownloadFileAsync(const std::string& url, const std::string& out, const std::string& post, DownloadCallback callback, ProgressCallback pcallback = nullptr, DownloadPriority prio = DownloadPriority::Normal) -> bool; + +void DownloadClearCache(const std::string& url); + +} // namespace sphaira diff --git a/sphaira/include/evman.hpp b/sphaira/include/evman.hpp new file mode 100644 index 0000000..cba3385 --- /dev/null +++ b/sphaira/include/evman.hpp @@ -0,0 +1,45 @@ +// simple thread-safe list of events. +#pragma once + +#include +#include +#include +#include +#include +#include +#include "download.hpp" + +namespace sphaira::evman { + +struct LaunchNroEventData { + std::string path; + std::string argv; +}; + +struct ExitEventData { + bool dummy; +}; + +using EventData = std::variant< + LaunchNroEventData, + ExitEventData, + NxlinkCallbackData, + DownloadEventData +>; + +// returns number of events +auto count() -> std::size_t; + +// thread-safe +auto push(const EventData& e, bool remove_matching = true) -> bool; +auto push(EventData&& e, bool remove_matching = true) -> bool; + +// events are returned FIFO style, so if you push event a,b,c +// then pop() will return a then b then c. +auto pop() -> std::optional; + +// this pops all events, this is ideal to stop the main thread from +// hanging if loads of events are pushed and popped at the same time. +auto popall() -> std::list; + +} // namespace sphaira::evman diff --git a/sphaira/include/fs.hpp b/sphaira/include/fs.hpp new file mode 100644 index 0000000..f2fccf3 --- /dev/null +++ b/sphaira/include/fs.hpp @@ -0,0 +1,459 @@ +#pragma once + +#include +#include +#include +#include +#include +#include "defines.hpp" + +namespace fs { + +struct FsPath { + FsPath() = default; + constexpr FsPath(const auto& str) { From(str); } + + constexpr void From(const FsPath& p) { + *this = p; + } + + constexpr void From(const char* str) { + if consteval { + for (u32 i = 0; str[i] != '\0'; i++) { + s[i] = str[i]; + } + } else { + std::strcpy(s, str); + } + } + + constexpr void From(const std::string& str) { + std::copy(str.cbegin(), str.cend(), std::begin(s)); + } + + constexpr void From(const std::string_view& str) { + std::copy(str.cbegin(), str.cend(), std::begin(s)); + } + + constexpr auto toString() const -> std::string { + return s; + } + + constexpr auto empty() const { + return s[0] == '\0'; + } + + constexpr auto size() const { + return std::strlen(s); + } + + constexpr auto length() const { + return std::strlen(s); + } + + constexpr void clear() { + s[0] = '\0'; + } + + constexpr operator const char*() const { return s; } + constexpr operator char*() { return s; } + constexpr operator std::string() { return s; } + constexpr operator std::string_view() { return s; } + constexpr operator std::string() const { return s; } + constexpr operator std::string_view() const { return s; } + constexpr char& operator[](std::size_t idx) { return s[idx]; } + constexpr const char& operator[](std::size_t idx) const { return s[idx]; } + + constexpr FsPath operator+(const FsPath& v) const noexcept { + FsPath r{*this}; + return r += v; + } + + constexpr FsPath operator+(const char* v) const noexcept { + FsPath r{*this}; + return r += v; + } + + constexpr FsPath operator+(const std::string& v) const noexcept { + FsPath r{*this}; + return r += v; + } + + constexpr FsPath operator+(const std::string_view v) const noexcept { + FsPath r{*this}; + return r += v; + } + + constexpr const char* operator+(std::size_t v) const noexcept { + return this->s + v; + } + + constexpr FsPath& operator+=(const FsPath& v) noexcept { + std::strcat(*this, v); + return *this; + } + + constexpr FsPath& operator+=(const char* v) noexcept { + std::strcat(*this, v); + return *this; + } + + constexpr FsPath& operator+=(const std::string& v) noexcept { + std::strncat(*this, v.data(), v.length()); + return *this; + } + + constexpr FsPath& operator+=(const std::string_view& v) noexcept { + std::strncat(*this, v.data(), v.length()); + return *this; + } + + constexpr FsPath& operator+=(char v) noexcept { + const auto sz = size(); + s[sz + 0] = v; + s[sz + 1] = '\0'; + return *this; + } + + constexpr bool operator==(const FsPath& v) const noexcept { + return !strcasecmp(*this, v); + } + + constexpr bool operator==(const char* v) const noexcept { + return !strcasecmp(*this, v); + } + + constexpr bool operator==(const std::string& v) const noexcept { + return !strncasecmp(*this, v.data(), v.length()); + } + + constexpr bool operator==(const std::string_view v) const noexcept { + return !strncasecmp(*this, v.data(), v.length()); + } + + static consteval bool Test(const auto& str) { + FsPath path{str}; + return path[0] == str[0]; + } + static consteval bool TestFrom(const auto& str) { + FsPath path; + path.From(str); + return path[0] == str[0]; + } + + char s[FS_MAX_PATH]{}; +}; + +inline FsPath operator+(const char* v, const FsPath& fp) { + FsPath r{v}; + return r += fp; +} + +inline FsPath operator+(const std::string& v, const FsPath& fp) { + FsPath r{v}; + return r += fp; +} + +inline FsPath operator+(const std::string_view& v, const FsPath& fp) { + FsPath r{v}; + return r += fp; +} + +static_assert(FsPath::Test("abc")); +static_assert(FsPath::Test(std::string_view{"abc"})); +static_assert(FsPath::Test(std::string{"abc"})); +static_assert(FsPath::Test(FsPath{"abc"})); + +static_assert(FsPath::TestFrom("abc")); +static_assert(FsPath::TestFrom(std::string_view{"abc"})); +static_assert(FsPath::TestFrom(std::string{"abc"})); +static_assert(FsPath::TestFrom(FsPath{"abc"})); + +FsPath AppendPath(const fs::FsPath& root_path, const fs::FsPath& file_path); + +Result CreateFile(FsFileSystem* fs, const FsPath& path, u64 size = 0, u32 option = 0, bool ignore_read_only = false); +Result CreateDirectory(FsFileSystem* fs, const FsPath& path, bool ignore_read_only = false); +Result CreateDirectoryRecursively(FsFileSystem* fs, const FsPath& path, bool ignore_read_only = false); +Result CreateDirectoryRecursivelyWithPath(FsFileSystem* fs, const FsPath& path, bool ignore_read_only = false); +Result DeleteFile(FsFileSystem* fs, const FsPath& path, bool ignore_read_only = false); +Result DeleteDirectory(FsFileSystem* fs, const FsPath& path, bool ignore_read_only = false); +Result DeleteDirectoryRecursively(FsFileSystem* fs, const FsPath& path, bool ignore_read_only = false); +Result RenameFile(FsFileSystem* fs, const FsPath& src, const FsPath& dst, bool ignore_read_only = false); +Result RenameDirectory(FsFileSystem* fs, const FsPath& src, const FsPath& dst, bool ignore_read_only = false); +Result GetEntryType(FsFileSystem* fs, const FsPath& path, FsDirEntryType* out); +Result GetFileTimeStampRaw(FsFileSystem* fs, const FsPath& path, FsTimeStampRaw *out); +bool FileExists(FsFileSystem* fs, const FsPath& path); +bool DirExists(FsFileSystem* fs, const FsPath& path); +Result read_entire_file(FsFileSystem* fs, const FsPath& path, std::vector& out); +Result write_entire_file(FsFileSystem* fs, const FsPath& path, const std::vector& in, bool ignore_read_only = false); +Result copy_entire_file(FsFileSystem* fs, const FsPath& dst, const FsPath& src, bool ignore_read_only = false); + +Result CreateFile(const FsPath& path, u64 size = 0, u32 option = 0, bool ignore_read_only = false); +Result CreateDirectory(const FsPath& path, bool ignore_read_only = false); +Result CreateDirectoryRecursively(const FsPath& path, bool ignore_read_only = false); +Result CreateDirectoryRecursivelyWithPath(const FsPath& path, bool ignore_read_only = false); +Result DeleteFile(const FsPath& path, bool ignore_read_only = false); +Result DeleteDirectory(const FsPath& path, bool ignore_read_only = false); +Result DeleteDirectoryRecursively(const FsPath& path, bool ignore_read_only = false); +Result RenameFile(const FsPath& src, const FsPath& dst, bool ignore_read_only = false); +Result RenameDirectory(const FsPath& src, const FsPath& dst, bool ignore_read_only = false); +Result GetEntryType(const FsPath& path, FsDirEntryType* out); +Result GetFileTimeStampRaw(const FsPath& path, FsTimeStampRaw *out); +bool FileExists(const FsPath& path); +bool DirExists(const FsPath& path); +Result read_entire_file(const FsPath& path, std::vector& out); +Result write_entire_file(const FsPath& path, const std::vector& in, bool ignore_read_only = false); +Result copy_entire_file(const FsPath& dst, const FsPath& src, bool ignore_read_only = false); + +struct Fs { + static constexpr inline u32 FsModule = 505; + static constexpr inline Result ResultTooManyEntries = MAKERESULT(FsModule, 1); + static constexpr inline Result ResultNewPathTooLarge = MAKERESULT(FsModule, 2); + static constexpr inline Result ResultInvalidType = MAKERESULT(FsModule, 3); + static constexpr inline Result ResultEmpty = MAKERESULT(FsModule, 4); + static constexpr inline Result ResultAlreadyRoot = MAKERESULT(FsModule, 5); + static constexpr inline Result ResultNoCurrentPath = MAKERESULT(FsModule, 6); + static constexpr inline Result ResultBrokenCurrentPath = MAKERESULT(FsModule, 7); + static constexpr inline Result ResultIndexOutOfBounds = MAKERESULT(FsModule, 8); + static constexpr inline Result ResultFsNotActive = MAKERESULT(FsModule, 9); + static constexpr inline Result ResultNewPathEmpty = MAKERESULT(FsModule, 10); + static constexpr inline Result ResultLoadingCancelled = MAKERESULT(FsModule, 11); + static constexpr inline Result ResultBrokenRoot = MAKERESULT(FsModule, 12); + static constexpr inline Result ResultUnknownStdioError = MAKERESULT(FsModule, 13); + static constexpr inline Result ResultReadOnly = MAKERESULT(FsModule, 14); + + virtual Result CreateFile(const FsPath& path, u64 size = 0, u32 option = 0, bool ignore_read_only = false) = 0; + virtual Result CreateDirectory(const FsPath& path, bool ignore_read_only = false) = 0; + virtual Result CreateDirectoryRecursively(const FsPath& path, bool ignore_read_only = false) = 0; + virtual Result CreateDirectoryRecursivelyWithPath(const FsPath& path, bool ignore_read_only = false) = 0; + virtual Result DeleteFile(const FsPath& path, bool ignore_read_only = false) = 0; + virtual Result DeleteDirectory(const FsPath& path, bool ignore_read_only = false) = 0; + virtual Result DeleteDirectoryRecursively(const FsPath& path, bool ignore_read_only = false) = 0; + virtual Result RenameFile(const FsPath& src, const FsPath& dst, bool ignore_read_only = false) = 0; + virtual Result RenameDirectory(const FsPath& src, const FsPath& dst, bool ignore_read_only = false) = 0; + virtual Result GetEntryType(const FsPath& path, FsDirEntryType* out) = 0; + virtual Result GetFileTimeStampRaw(const FsPath& path, FsTimeStampRaw *out) = 0; + virtual bool FileExists(const FsPath& path) = 0; + virtual bool DirExists(const FsPath& path) = 0; + virtual Result read_entire_file(const FsPath& path, std::vector& out) = 0; + virtual Result write_entire_file(const FsPath& path, const std::vector& in, bool ignore_read_only = false) = 0; + virtual Result copy_entire_file(const FsPath& dst, const FsPath& src, bool ignore_read_only = false) = 0; +}; + +struct FsStdio : Fs { + Result CreateFile(const FsPath& path, u64 size = 0, u32 option = 0, bool ignore_read_only = false) override { + return fs::CreateFile(path, size, option, ignore_read_only); + } + Result CreateDirectory(const FsPath& path, bool ignore_read_only = false) override { + return fs::CreateDirectory(path, ignore_read_only); + } + Result CreateDirectoryRecursively(const FsPath& path, bool ignore_read_only = false) override { + return fs::CreateDirectoryRecursively(path, ignore_read_only); + } + Result CreateDirectoryRecursivelyWithPath(const FsPath& path, bool ignore_read_only = false) override { + return fs::CreateDirectoryRecursivelyWithPath(path, ignore_read_only); + } + Result DeleteFile(const FsPath& path, bool ignore_read_only = false) override { + return fs::DeleteFile(path, ignore_read_only); + } + Result DeleteDirectory(const FsPath& path, bool ignore_read_only = false) override { + return fs::DeleteDirectory(path, ignore_read_only); + } + Result DeleteDirectoryRecursively(const FsPath& path, bool ignore_read_only = false) override { + return fs::DeleteDirectoryRecursively(path, ignore_read_only); + } + Result RenameFile(const FsPath& src, const FsPath& dst, bool ignore_read_only = false) override { + return fs::RenameFile(src, dst, ignore_read_only); + } + Result RenameDirectory(const FsPath& src, const FsPath& dst, bool ignore_read_only = false) override { + return fs::RenameDirectory(src, dst, ignore_read_only); + } + Result GetEntryType(const FsPath& path, FsDirEntryType* out) override { + return fs::GetEntryType(path, out); + } + Result GetFileTimeStampRaw(const FsPath& path, FsTimeStampRaw *out) override { + return fs::GetFileTimeStampRaw(path, out); + } + bool FileExists(const FsPath& path) override { + return fs::FileExists(path); + } + bool DirExists(const FsPath& path) override { + return fs::DirExists(path); + } + Result read_entire_file(const FsPath& path, std::vector& out) override { + return fs::read_entire_file(path, out); + } + Result write_entire_file(const FsPath& path, const std::vector& in, bool ignore_read_only = false) override { + return fs::write_entire_file(path, in, ignore_read_only); + } + Result copy_entire_file(const FsPath& dst, const FsPath& src, bool ignore_read_only = false) override { + return fs::copy_entire_file(dst, src, ignore_read_only); + } +}; + +struct FsNative : Fs { + FsNative() = default; + FsNative(FsFileSystem* fs, bool own) : m_fs{*fs}, m_own{own} {} + + virtual ~FsNative() { + if (m_own) { + fsFsClose(&m_fs); + } + } + + Result Commit() { + return fsFsCommit(&m_fs); + } + + Result GetFreeSpace(const FsPath& path, s64* out) { + return fsFsGetFreeSpace(&m_fs, path, out); + } + + Result GetTotalSpace(const FsPath& path, s64* out) { + return fsFsGetTotalSpace(&m_fs, path, out); + } + + Result OpenFile(const FsPath& path, u32 mode, FsFile *out) { + return fsFsOpenFile(&m_fs, path, mode, out); + } + + Result OpenDirectory(const FsPath& path, u32 mode, FsDir *out) { + return fsFsOpenDirectory(&m_fs, path, mode, out); + } + + void DirClose(FsDir *d) { + fsDirClose(d); + } + + Result DirGetEntryCount(FsDir *d, s64* out) { + return fsDirGetEntryCount(d, out); + } + + Result DirGetEntryCount(const FsPath& path, u32 mode, s64* out) { + FsDir d; + R_TRY(OpenDirectory(path, mode, &d)); + ON_SCOPE_EXIT(DirClose(&d)); + return DirGetEntryCount(&d, out); + } + + Result DirRead(FsDir *d, s64 *total_entries, size_t max_entries, FsDirectoryEntry *buf) { + return fsDirRead(d, total_entries, max_entries, buf); + } + + Result DirRead(const FsPath& path, u32 mode, s64 *total_entries, size_t max_entries, FsDirectoryEntry *buf) { + FsDir d; + R_TRY(OpenDirectory(path, mode, &d)); + ON_SCOPE_EXIT(DirClose(&d)); + return DirRead(&d, total_entries, max_entries, buf); + } + + virtual bool IsFsActive() { + return serviceIsActive(&m_fs.s); + } + + virtual Result GetFsOpenResult() const { + return m_open_result; + } + + Result CreateFile(const FsPath& path, u64 size = 0, u32 option = 0, bool ignore_read_only = false) override { + return fs::CreateFile(&m_fs, path, size, option, ignore_read_only); + } + Result CreateDirectory(const FsPath& path, bool ignore_read_only = false) override { + return fs::CreateDirectory(&m_fs, path, ignore_read_only); + } + Result CreateDirectoryRecursively(const FsPath& path, bool ignore_read_only = false) override { + return fs::CreateDirectoryRecursively(&m_fs, path, ignore_read_only); + } + Result CreateDirectoryRecursivelyWithPath(const FsPath& path, bool ignore_read_only = false) override { + return fs::CreateDirectoryRecursivelyWithPath(&m_fs, path, ignore_read_only); + } + Result DeleteFile(const FsPath& path, bool ignore_read_only = false) override { + return fs::DeleteFile(&m_fs, path, ignore_read_only); + } + Result DeleteDirectory(const FsPath& path, bool ignore_read_only = false) override { + return fs::DeleteDirectory(&m_fs, path, ignore_read_only); + } + Result DeleteDirectoryRecursively(const FsPath& path, bool ignore_read_only = false) override { + return fs::DeleteDirectoryRecursively(&m_fs, path, ignore_read_only); + } + Result RenameFile(const FsPath& src, const FsPath& dst, bool ignore_read_only = false) override { + return fs::RenameFile(&m_fs, src, dst, ignore_read_only); + } + Result RenameDirectory(const FsPath& src, const FsPath& dst, bool ignore_read_only = false) override { + return fs::RenameDirectory(&m_fs, src, dst, ignore_read_only); + } + Result GetEntryType(const FsPath& path, FsDirEntryType* out) override { + return fs::GetEntryType(&m_fs, path, out); + } + Result GetFileTimeStampRaw(const FsPath& path, FsTimeStampRaw *out) override { + return fs::GetFileTimeStampRaw(&m_fs, path, out); + } + bool FileExists(const FsPath& path) override { + return fs::FileExists(&m_fs, path); + } + bool DirExists(const FsPath& path) override { + return fs::DirExists(&m_fs, path); + } + Result read_entire_file(const FsPath& path, std::vector& out) override { + return fs::read_entire_file(&m_fs, path, out); + } + Result write_entire_file(const FsPath& path, const std::vector& in, bool ignore_read_only = false) override { + return fs::write_entire_file(&m_fs, path, in, ignore_read_only); + } + Result copy_entire_file(const FsPath& dst, const FsPath& src, bool ignore_read_only = false) override { + return fs::copy_entire_file(&m_fs, dst, src, ignore_read_only); + } + + FsFileSystem m_fs{}; + Result m_open_result{}; + bool m_own{true}; +}; + +#if 0 +struct FsNativeSd final : FsNative { + FsNativeSd() { + m_open_result = fsOpenSdCardFileSystem(&m_fs); + } +}; +#else +struct FsNativeSd final : FsNative { + FsNativeSd() : FsNative{fsdevGetDeviceFileSystem("sdmc:"), false} { + m_open_result = 0; + } +}; +#endif + +struct FsNativeBis final : FsNative { + FsNativeBis(FsBisPartitionId id, const FsPath& string) { + m_open_result = fsOpenBisFileSystem(&m_fs, id, string); + } +}; + +struct FsNativeImage final : FsNative { + FsNativeImage(FsImageDirectoryId id) { + m_open_result = fsOpenImageDirectoryFileSystem(&m_fs, id); + } +}; + +struct FsNativeContentStorage final : FsNative { + FsNativeContentStorage(FsContentStorageId id) { + m_open_result = fsOpenContentStorageFileSystem(&m_fs, id); + } +}; + +// auto file_exists(const FsPath& path) -> bool; +// auto create_file(const FsPath& path, u64 size = 0) -> Result; +// auto delete_file(const FsPath& path) -> Result; +// auto create_directory(const FsPath& path) -> Result; +// auto create_directory_recursively(const FsPath& path) -> Result; +// auto delete_directory(const FsPath& path) -> Result; +// auto delete_directory_recursively(const FsPath& path) -> Result; +// auto rename_file(const FsPath& src, const FsPath& dst) -> Result; +// auto rename_directory(const FsPath& src, const FsPath& dst) -> Result; + +// auto read_entire_file(const FsPath& path, std::vector& out) -> Result; +// auto write_entire_file(const FsPath& path, const std::vector& in) -> Result; +// // single threaded one shot copy, only use for very small files! +// auto copy_entire_file(const FsPath& dst, const FsPath& src) -> Result; + +} // namespace fs diff --git a/sphaira/include/i18n.hpp b/sphaira/include/i18n.hpp new file mode 100644 index 0000000..44ec020 --- /dev/null +++ b/sphaira/include/i18n.hpp @@ -0,0 +1,16 @@ +#pragma once + +#include + +namespace sphaira::i18n { + +bool init(long index); +void exit(); + +} // namespace sphaira::i18n + +inline namespace literals { + +std::string operator"" _i18n(const char* str, size_t len); + +} // namespace literals diff --git a/sphaira/include/image.hpp b/sphaira/include/image.hpp new file mode 100644 index 0000000..f589231 --- /dev/null +++ b/sphaira/include/image.hpp @@ -0,0 +1,20 @@ +#pragma once + +#include +#include +#include +#include "fs.hpp" + +namespace sphaira { + +struct ImageResult { + std::vector data; + int w, h; +}; + +auto ImageLoadFromMemory(std::span data) -> ImageResult; +auto ImageLoadFromFile(const fs::FsPath& file) -> ImageResult; +auto ImageResize(std::span data, int inx, int iny, int outx, int outy) -> ImageResult; +auto ImageConvertToJpg(std::span data, int x, int y) -> ImageResult; + +} // namespace sphaira diff --git a/sphaira/include/log.hpp b/sphaira/include/log.hpp new file mode 100644 index 0000000..231d147 --- /dev/null +++ b/sphaira/include/log.hpp @@ -0,0 +1,21 @@ +#pragma once + +#define sphaira_USE_LOG 1 + +#if sphaira_USE_LOG +auto log_file_init() -> bool; +auto log_nxlink_init() -> bool; +void log_file_exit(); +void log_nxlink_exit(); +void log_write(const char* s, ...) __attribute__ ((format (printf, 1, 2))); +#else +inline auto log_file_init() -> bool { + return true; +} +inline auto log_nxlink_init() -> bool { + return true; +} +#define log_file_exit() +#define log_nxlink_exit() +#define log_write(...) +#endif diff --git a/sphaira/include/nro.hpp b/sphaira/include/nro.hpp new file mode 100644 index 0000000..1f87795 --- /dev/null +++ b/sphaira/include/nro.hpp @@ -0,0 +1,77 @@ +#pragma once + +#include +#include +#include +#include +#include "fs.hpp" + +namespace sphaira { + +struct Hbini { + u64 timestamp{}; // timestamp of last launch + u32 launch_count{}; // +}; + +struct NroEntry { + fs::FsPath path; + s64 size; + NacpStruct nacp; + + std::vector icon; + u64 icon_size; + u64 icon_offset; + + FsTimeStampRaw timestamp; + Hbini hbini; + + int image; // nvg image + int x,y,w,h; // image + bool is_nacp_valid; + + auto GetName() const -> const char* { + return nacp.lang[0].name; + } + + auto GetAuthor() const -> const char* { + return nacp.lang[0].author; + } + + auto GetDisplayVersion() const -> const char* { + return nacp.display_version; + } +}; + +auto nro_verify(std::span data) -> Result; +auto nro_parse(const fs::FsPath& path, NroEntry& entry) -> Result; + +/** + * Scans a folder for all nro's. + * + * \param path path to the folder that is to be scanned. + * \param nros output of all scanned nros. + * \param nested if true, it will scan any folders for nros, ie path/folder/game.nro. + * \param scan_all_dir if true, when a folder is found, it will scan the entire + * folder for all nros, rather than stopping at the first + * nro found. + * this does nothing if nested=false. + */ +auto nro_scan(const fs::FsPath& path, std::vector& nros, bool hide_spahira, bool nested = true, bool scan_all_dir = true) -> Result; + +auto nro_get_icon(const fs::FsPath& path, u64 size, u64 offset) -> std::vector; +auto nro_get_icon(const fs::FsPath& path) -> std::vector; +auto nro_get_nacp(const fs::FsPath& path, NacpStruct& nacp) -> Result; + +// path is pre-appended to args, such that argv[0] == path +auto nro_launch(std::string path, std::string args = {}) -> Result; + +// if the arg contains a space, it will wrap it in quotes +auto nro_add_arg(std::string arg) -> std::string; + +// same as above but prefixes "sdmc" to keep compat with hbmenu +auto nro_add_arg_file(std::string arg) -> std::string; + +// strips sdmc: +auto nro_normalise_path(const std::string& p) -> std::string; + +} // namespace sphaira diff --git a/sphaira/include/nxlink.h b/sphaira/include/nxlink.h new file mode 100644 index 0000000..da769ab --- /dev/null +++ b/sphaira/include/nxlink.h @@ -0,0 +1,49 @@ +// any data sent will be accepted and if all the data is sent whilst the +// thread is active, then an event will be sent to launch the .nro. +#pragma once + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { + NxlinkCallbackType_Connected, // data = none + NxlinkCallbackType_WriteBegin, // data = file + NxlinkCallbackType_WriteProgress, // data = progress + NxlinkCallbackType_WriteEnd, // data = file +} NxlinkCallbackType; + +typedef struct { + char filename[0x301]; +} NxlinkCallbackDataConnect; + +typedef struct { + char filename[0x301]; +} NxlinkCallbackDataFile; + +typedef struct { + long long offset; + long long size; +} NxlinkCallbackDataProgress; + +typedef struct { + NxlinkCallbackType type; + union { + NxlinkCallbackDataFile file; + NxlinkCallbackDataProgress progress; + }; +} NxlinkCallbackData; + +typedef void(*NxlinkCallback)(const NxlinkCallbackData* data); + +// start the server thread and wait for connection. +bool nxlinkInitialize(NxlinkCallback callback); + +// signal for the event to close and then join the thread. +void nxlinkExit(); + +#ifdef __cplusplus +} +#endif diff --git a/sphaira/include/option.hpp b/sphaira/include/option.hpp new file mode 100644 index 0000000..cebab9a --- /dev/null +++ b/sphaira/include/option.hpp @@ -0,0 +1,30 @@ +#pragma once + +#include +#include + +namespace sphaira::option { + +template +struct OptionBase { + OptionBase(const std::string& section, const std::string& name, T default_value) + : m_section{section} + , m_name{name} + , m_default_value{default_value} + {} + + auto Get() -> T; + void Set(T value); + +private: + const std::string m_section; + const std::string m_name; + const T m_default_value; + std::optional m_value; +}; + +using OptionBool = OptionBase; +using OptionLong = OptionBase; +using OptionString = OptionBase; + +} // namespace sphaira::option diff --git a/sphaira/include/owo.hpp b/sphaira/include/owo.hpp new file mode 100644 index 0000000..ed2a6f7 --- /dev/null +++ b/sphaira/include/owo.hpp @@ -0,0 +1,41 @@ +#pragma once + +#include +#include +#include +#include "ui/progress_box.hpp" +// #include + +namespace sphaira { + +struct OwoConfig { + std::string nro_path; + std::string args{}; + std::string name{}; + std::string author{}; + NacpStruct nacp; + std::vector icon; + std::vector main; + std::vector npdm; + std::vector logo; + std::vector gif; + + // std::optional tid; + std::vector program_nca{}; +}; + +enum { + Module_Owo = 424, +}; + +enum OwoError { + OwoError_BadArgs = MAKERESULT(Module_Owo, 1), +}; + +// fwd +// struct ui::ProgressBox; + +auto install_forwarder(OwoConfig& config, NcmStorageId storage_id) -> Result; +auto install_forwarder(ui::ProgressBox* pbox, OwoConfig& config, NcmStorageId storage_id) -> Result; + +} // namespace sphaira diff --git a/sphaira/include/swkbd.hpp b/sphaira/include/swkbd.hpp new file mode 100644 index 0000000..3c76c9f --- /dev/null +++ b/sphaira/include/swkbd.hpp @@ -0,0 +1,11 @@ +#pragma once + +#include +#include + +namespace sphaira::swkbd { + +Result ShowText(std::string& out, const char* guide = nullptr, s64 len_min = -1, s64 len_max = -1); +Result ShowNumPad(s64& out, const char* guide = nullptr, s64 len_min = -1, s64 len_max = -1); + +} // namespace sphaira::swkbd diff --git a/sphaira/include/ui/error_box.hpp b/sphaira/include/ui/error_box.hpp new file mode 100644 index 0000000..e6e58f8 --- /dev/null +++ b/sphaira/include/ui/error_box.hpp @@ -0,0 +1,23 @@ +#pragma once + +#include "ui/widget.hpp" +#include + +namespace sphaira::ui { + +class ErrorBox final : public Widget { +public: + ErrorBox(Result code, const std::string& message); + + auto Update(Controller* controller, TouchInfo* touch) -> void override; + auto OnLayoutChange() -> void override; + auto Draw(NVGcontext* vg, Theme* theme) -> void override; + +private: + Result m_code; + std::string m_message; + std::string m_module_str; + std::string m_description_str; +}; + +} // namespace sphaira::ui diff --git a/sphaira/include/ui/menus/appstore.hpp b/sphaira/include/ui/menus/appstore.hpp new file mode 100644 index 0000000..ddfaa43 --- /dev/null +++ b/sphaira/include/ui/menus/appstore.hpp @@ -0,0 +1,220 @@ +#pragma once + +#include "ui/menus/menu_base.hpp" +#include "ui/scrollable_text.hpp" +#include "nro.hpp" +#include "fs.hpp" +#include + +namespace sphaira::ui::menu::appstore { + +struct ManifestEntry { + char command; + fs::FsPath path; +}; + +using ManifestEntries = std::vector; + +enum class ImageDownloadState { + None, // not started + Progress, // Download started + Done, // finished downloading + Failed, // attempted to download but failed +}; + +struct LazyImage { + LazyImage() = default; + ~LazyImage(); + int image{}; + int w{}, h{}; + ImageDownloadState state{ImageDownloadState::None}; + u8 first_pixel[4]{}; +}; + +enum class EntryStatus { + Get, + Installed, + Local, + Update, +}; + +struct Entry { + std::string category; // todo: lable + std::string binary; // optional, only valid for .nro + std::string updated; // date of update + std::string name; + std::string license; // optional + std::string title; // same as name but with spaces + std::string url; // url of repo (optional?) + std::string description; + std::string author; + std::string changelog; // optional + u64 screens; // number of screenshots + u64 extracted; // extracted size in KiB + std::string version; + u64 filesize; // compressed size in KiB + std::string details; + u64 app_dls; + std::string md5; // md5 of the zip + + LazyImage image; + u32 updated_num; + EntryStatus status{EntryStatus::Get}; +}; + +// number to index m_entries to get entry +using EntryMini = u32; +struct Menu; // fwd + +struct EntryMenu final : MenuBase { + EntryMenu(Entry& entry, const LazyImage& default_icon, Menu& menu); + ~EntryMenu(); + + void Update(Controller* controller, TouchInfo* touch) override; + void Draw(NVGcontext* vg, Theme* theme) override; + // void OnFocusGained() override; + + void ShowChangelogAction(); + void SetIndex(std::size_t index); + + void UpdateOptions(); + +private: + struct Option { + Option(const std::string& dt, const std::string& ct, std::function f) + : display_text{dt}, confirm_text{ct}, func{f} {} + Option(const std::string& dt, std::function f) + : display_text{dt}, func{f} {} + + std::string display_text{}; + std::string confirm_text{}; + std::function func{}; + }; + + Entry& m_entry; + const LazyImage& m_default_icon; + Menu& m_menu; + + std::size_t m_index{}; // where i am in the array + std::vector